@treasuredata/tdx 0.9.5 β†’ 0.9.6

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 (136) 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.d.ts.map +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/connection-command.js.map +1 -1
  25. package/dist/commands/context-command.js +1 -1
  26. package/dist/commands/databases.js +1 -1
  27. package/dist/commands/describe.js +1 -1
  28. package/dist/commands/engage-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.d.ts.map +1 -1
  31. package/dist/commands/journey-command.js +1 -1
  32. package/dist/commands/journey-command.js.map +1 -1
  33. package/dist/commands/llm-command.js +1 -1
  34. package/dist/commands/llm-proxy.js +1 -1
  35. package/dist/commands/parent-segment-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.d.ts +6 -0
  42. package/dist/commands/segment-pull-command.d.ts.map +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-pull-command.js.map +1 -1
  45. package/dist/commands/segment-push-command.d.ts.map +1 -1
  46. package/dist/commands/segment-push-command.js +1 -1
  47. package/dist/commands/segment-push-command.js.map +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segments.js +1 -1
  51. package/dist/commands/show.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/workflow-command.js +1 -1
  56. package/dist/core/auth.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/credential-cache.js +1 -1
  60. package/dist/core/global-context.js +1 -1
  61. package/dist/core/keychain.js +1 -1
  62. package/dist/core/profile.js +1 -1
  63. package/dist/core/project-config.js +1 -1
  64. package/dist/core/session.js +1 -1
  65. package/dist/core/user-cache.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/proxy/anthropic-adapter.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/context-signature.js +1 -1
  70. package/dist/proxy/conversation-utils.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/sdk/agent/agent-yaml.js +1 -1
  74. package/dist/sdk/api.js +1 -1
  75. package/dist/sdk/connection-validator.js +1 -1
  76. package/dist/sdk/connection.js +1 -1
  77. package/dist/sdk/engage.js +1 -1
  78. package/dist/sdk/errors.js +1 -1
  79. package/dist/sdk/index.js +1 -1
  80. package/dist/sdk/job.js +1 -1
  81. package/dist/sdk/journey.js +1 -1
  82. package/dist/sdk/llm.js +1 -1
  83. package/dist/sdk/query.js +1 -1
  84. package/dist/sdk/segment/child-segment-yaml.d.ts +113 -1
  85. package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
  86. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  87. package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
  88. package/dist/sdk/segment/journey-yaml.d.ts +1 -1
  89. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  90. package/dist/sdk/segment/journey-yaml.js +1 -1
  91. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  92. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  93. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  94. package/dist/sdk/segment.js +1 -1
  95. package/dist/sdk/user.js +1 -1
  96. package/dist/sdk/workflow.js +1 -1
  97. package/dist/types/cdp.d.ts +2 -1
  98. package/dist/types/cdp.d.ts.map +1 -1
  99. package/dist/types/endpoints.js +1 -1
  100. package/dist/types/index.js +1 -1
  101. package/dist/utils/agent-config.js +1 -1
  102. package/dist/utils/agent-ref-parser.js +1 -1
  103. package/dist/utils/async.js +1 -1
  104. package/dist/utils/chat-cache.js +1 -1
  105. package/dist/utils/colors.js +1 -1
  106. package/dist/utils/command-output.js +1 -1
  107. package/dist/utils/constants.js +1 -1
  108. package/dist/utils/diff.js +1 -1
  109. package/dist/utils/fields-display.js +1 -1
  110. package/dist/utils/file-permissions.js +1 -1
  111. package/dist/utils/format-detector.js +1 -1
  112. package/dist/utils/formatters.js +1 -1
  113. package/dist/utils/journey-utils.d.ts.map +1 -1
  114. package/dist/utils/journey-utils.js +1 -1
  115. package/dist/utils/journey-utils.js.map +1 -1
  116. package/dist/utils/json-loader.js +1 -1
  117. package/dist/utils/llm-backup-utils.js +1 -1
  118. package/dist/utils/model-aliases.js +1 -1
  119. package/dist/utils/model-factors.js +1 -1
  120. package/dist/utils/option-validation.js +1 -1
  121. package/dist/utils/port.js +1 -1
  122. package/dist/utils/process.js +1 -1
  123. package/dist/utils/prompt.js +1 -1
  124. package/dist/utils/segment-path-parser.js +1 -1
  125. package/dist/utils/segment-ref-parser.js +1 -1
  126. package/dist/utils/spinner.js +1 -1
  127. package/dist/utils/sql-parser.js +1 -1
  128. package/dist/utils/sse-parser.js +1 -1
  129. package/dist/utils/string-utils.js +1 -1
  130. package/dist/utils/table-ref-parser.js +1 -1
  131. package/dist/utils/tdx-config.js +1 -1
  132. package/dist/utils/tdx-logger.js +1 -1
  133. package/dist/utils/tree-formatter.js +1 -1
  134. package/dist/utils/version-check.js +1 -1
  135. package/dist/utils/workflow-utils.js +1 -1
  136. package/package.json +1 -1
@@ -1 +1 @@
1
- const a36_0xb9787e=a36_0x5329;(function(_0x224ef8,_0x48b496){const _0x51c798=a36_0x5329,_0x2d6afc=_0x224ef8();while(!![]){try{const _0x210cbd=-parseInt(_0x51c798(0x270))/0x1+parseInt(_0x51c798(0x1ed))/0x2*(parseInt(_0x51c798(0x2af))/0x3)+parseInt(_0x51c798(0x22a))/0x4*(parseInt(_0x51c798(0x20d))/0x5)+parseInt(_0x51c798(0x1ef))/0x6*(-parseInt(_0x51c798(0x27f))/0x7)+parseInt(_0x51c798(0x2e6))/0x8*(parseInt(_0x51c798(0x224))/0x9)+-parseInt(_0x51c798(0x277))/0xa+parseInt(_0x51c798(0x279))/0xb*(-parseInt(_0x51c798(0x225))/0xc);if(_0x210cbd===_0x48b496)break;else _0x2d6afc['push'](_0x2d6afc['shift']());}catch(_0x51adc5){_0x2d6afc['push'](_0x2d6afc['shift']());}}}(a36_0xab8e,0x6e3ef));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,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x4b8566,yamlToApi as a36_0x46dd4c,toYamlString as a36_0x4acde4,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';import a36_0x55ad09 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';function a36_0xab8e(){const _0x46c022=['journey_entry_criteria_','segment\x20or\x20journey','draft',').\x20','βœ”\x20Created\x20segment\x20\x27','Fetching\x20existing\x20journeys...','\x20activations]','filter','unchanged','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20folders\x20to\x20create','Scoped\x20to\x20folder:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Creating','green','\x20\x20Journeys:\x20','split','\x27...','entries','existingJourney','\x27\x20not\x20found\x20in\x20journey\x20\x27','execute','Fetching\x20existing\x20folders...','journeys','absolutePath','error','activationParams','\x20\x20Source:\x20','\x27:\x20','red','createActivation','Aborted.','from','137691wMOOBc','\x20\x20\x20\x20','activations','\x0aβœ”\x20Push\x20complete','\x27\x20details...','entryCriteria','\x20journey\x20\x27','listFolders','parse','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','parentFolder','\x20to\x20delete','getSegment','Segment\x20not\x20found:\x20','__pending_','\x27\x20from\x20file:\x20','\x20unchanged','getJourney','.yaml','Folders\x20to\x20create:','segment','\x20\x20πŸ“Š\x20Segments:','Stage\x20\x27','Fetching\x20journey\x20\x27','DecisionPoint','\x20\x20Segments:\x20','slice',')\x20with\x20journeyId:\x20','cwd','activationActions','isFile','steps','Fetching\x20parent\x20segment\x20details...','Delete\x20journey:','/app/ps/','sort','Changes\x20to\x20journey:','Creating\x20folder\x20\x27','map','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','/e/','journeyId','Entry\x20criteria:\x20','all','setPhase','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','listActivations','Fetching\x20existing\x20segments...','entry','listSegments','\x0a\x20\x20','diff','stages','JOURNEY_UPDATE_ERROR','\x20to\x20create','1520aIZcYc','No\x20','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','existingSegment','18FBLjBP','getActivation','188364ZXHNhx','keys','item','folderPath','then','isNew','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','existingActivation','relationships','segmentFolderId','Activation\x20not\x20found:\x20','\x20changes?','\x20new','βœ”\x20Deleted\x20segment\x20\x27','branches','\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27','βœ”\x20Created\x20journey\x20\x27','resolve','\x20\x20Activations:\x20','size','create','yamlActivation','createJourneySegment','πŸ“\x20','journeyBundleName','parentSegmentFolder','dirname','attributes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','join','30iqFTMi','segment:push','parentSegment','push','\x20\x20βœ”\x20Updated\x20activation\x20\x27','parentFolderId','endsWith','Error\x20parsing\x20','folder','journeyStages','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)','segmentId','max','Journey\x20\x27','randomUUID','Updating\x20activation\x20\x27','user','\x20(referenced\x20in\x20journey\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','utf-8','SEGMENT_SYNTAX_ERROR','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','.yml','22104gJFFLW','120YErpZI','\x20\x20βœ”\x20Created\x20activation\x20\x27','\x20\x20πŸ—ΊοΈ\x20\x20Journeys:','data','updated','451032jEyqDJ','deleteSegment','Activation','βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date','type','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','relative','buildUserMaps','\x20created','\x27\x20v','hasChanges','verbose','delete','yellow','INTERNAL','action','stringify','Fetching\x20connections\x20for\x20name\x20resolution...','βœ”\x20Updated\x20segment\x20\x27','set','\x20activation\x20\x27','\x20changed','...','journey','deleteActivation','message','configDir','config','name','getOutputSchemaWithCache','kind','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','validatedRequest','\x27\x20with\x20ID:\x20','dim','JOURNEY_SYNTAX_ERROR','New\x20journey:','rule','toString','Push\x20','add','created','SEGMENT_NOT_FOUND','yamlConfig','Deleting\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','site','find','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/j/da/je','Failed\x20to\x20','versionNumber','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','connection','createFolder','createSegment','__pending_act_','toLowerCase','\x20\x20Created\x20embedded\x20segment\x20\x27','folderId','ACTIVATION_UPDATE_ERROR','journeysOnly','updateSegmentById','get','cyan','parent_segment','Parent\x20segment:\x20','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','resolveJourneyId','\x20YAML\x20files\x20found','439260IhrhTn','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Error:\x20Directory\x20not\x20found:\x20','\x27\x20(internal:\x20','replace','startsWith','state','5649700QlowAX','\x20deleted','75977uoBmLC','journeyActivationStepId','description','βœ”\x20Updated\x20journey\x20\x27','NOT_FOUND',')\x20with\x20ID:\x20','7KtJron','entry_criteria','length','blue','Creating\x20activation\x20\x27','\x20\x20Created\x20embedded\x20activation\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','has','\x20to\x20update','repeat','(Journey\x20will\x20be\x20deleted)','\x20updated','update','Pushing\x20journeys...','values'];a36_0xab8e=function(){return _0x46c022;};return a36_0xab8e();}import a36_0x5e769c from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x14c597 from'yaml';import{sanitizeFileName}from'../utils/string-utils.js';function a36_0x5329(_0x2160ed,_0x2d075f){_0x2160ed=_0x2160ed-0x1ec;const _0xab8e83=a36_0xab8e();let _0x532995=_0xab8e83[_0x2160ed];return _0x532995;}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyYaml,createJumpTargetCache,resolveJumpTarget}from'../utils/journey-utils.js';const PENDING_SEGMENT_PREFIX=a36_0xb9787e(0x2bd);function createPendingSegmentId(_0x1d8a8f){return''+PENDING_SEGMENT_PREFIX+_0x1d8a8f+'__';}function isPendingSegmentId(_0x2124c4){return _0x2124c4['startsWith'](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x35b2c){const _0x256c9e=a36_0xb9787e;return _0x35b2c[_0x256c9e(0x274)](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX=a36_0xb9787e(0x262);function createPendingActivationId(_0x40d04a){return''+PENDING_ACTIVATION_PREFIX+_0x40d04a+'__';}function isPendingActivationId(_0xc27646){const _0x3c27fc=a36_0xb9787e;return _0xc27646[_0x3c27fc(0x275)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x12ed88){const _0x4947f9=a36_0xb9787e;return _0x12ed88[_0x4947f9(0x274)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x49d4f8){const _0x28d0e3=a36_0xb9787e;!_0x49d4f8[_0x28d0e3(0x27b)]&&(_0x49d4f8[_0x28d0e3(0x27b)]=''),!_0x49d4f8[_0x28d0e3(0x276)]&&(_0x49d4f8[_0x28d0e3(0x276)]=_0x28d0e3(0x290));}function tryFindTdxConfig(_0x5c8cad){try{return findTdxConfig(_0x5c8cad);}catch{return null;}}function resolveTDFolderPath(_0x50db92,_0x6b90da,_0xcea48){if(!_0x6b90da)return _0x50db92;return _0x50db92?_0xcea48+'/'+_0x50db92:_0xcea48;}export class SegmentPushCommand extends BaseCommand{[a36_0xb9787e(0x246)]=a36_0xb9787e(0x20e);[a36_0xb9787e(0x27b)]=a36_0xb9787e(0x26d);async[a36_0xb9787e(0x2a3)](_0xad03f2){const _0x463af4=a36_0xb9787e,{options:_0x37f3fa,args:_0x5c4d8c,tdx:_0x1789c1}=_0xad03f2,_0x20a340=_0x37f3fa,_0x4c09ca=_0x37f3fa[_0x463af4(0x20f)],_0xff00fb=_0x5c4d8c[0x0];let _0x43f474,_0xed54b4,_0x29a59e,_0xb58b48;if(_0xff00fb){if(existsSync(_0xff00fb)&&statSync(_0xff00fb)['isDirectory']()){const _0x14e290=tryFindTdxConfig(_0xff00fb);if(_0x14e290)_0x43f474=_0x14e290['config'][_0x463af4(0x26b)],_0xed54b4=_0xff00fb,_0x29a59e=_0x14e290[_0x463af4(0x244)];else return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x29a)+_0xff00fb+'\x0a')),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x26a)](_0x463af4(0x25a))),0x1;}else{if(existsSync(_0xff00fb)&&statSync(_0xff00fb)[_0x463af4(0x2cd)]()){const _0x3753b5=a36_0x5e769c[_0x463af4(0x209)](_0xff00fb),_0x4f68fd=tryFindTdxConfig(_0x3753b5);if(_0x4f68fd)_0x43f474=_0x4f68fd['config'][_0x463af4(0x26b)],_0x29a59e=_0x4f68fd[_0x463af4(0x244)],_0xed54b4=_0x4f68fd[_0x463af4(0x244)],_0xb58b48=a36_0x5e769c[_0x463af4(0x200)](_0xff00fb);else return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x29a)+_0x3753b5+'\x0a')),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x26a)](_0x463af4(0x25a))),0x1;}else _0x43f474=_0xff00fb;}}else{const _0x6fb221=tryFindTdxConfig(process[_0x463af4(0x2cb)]());_0x6fb221?(_0x43f474=_0x6fb221[_0x463af4(0x245)][_0x463af4(0x26b)],_0xed54b4=process[_0x463af4(0x2cb)](),_0x29a59e=_0x6fb221['configDir']):_0x43f474=_0x4c09ca;}if(!_0x43f474)return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x20b))),console[_0x463af4(0x2a7)](_0x463af4(0x217)),console[_0x463af4(0x2a7)](_0x463af4(0x285)),console[_0x463af4(0x2a7)](_0x463af4(0x21f)),0x1;const _0x593d7e=_0xed54b4||getSegmentRootDir(sanitizeFileName(_0x43f474)),_0x35e3a7=_0x29a59e||_0x593d7e,_0x3478a9=a36_0x5e769c[_0x463af4(0x230)](_0x35e3a7,_0x593d7e),_0x416614=_0x3478a9!==''&&_0x3478a9!=='.';if(!existsSync(_0x593d7e))return console['error'](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x272)+_0x593d7e+'\x0a')),console[_0x463af4(0x2a7)](a36_0x55ad09['cyan'](_0x463af4(0x25a))),0x1;_0x20a340[_0x463af4(0x235)]&&(console[_0x463af4(0x2a7)]('Site:\x20'+_0x20a340[_0x463af4(0x258)]),console[_0x463af4(0x2a7)](_0x463af4(0x26c)+_0x43f474),console['error']('Source\x20directory:\x20'+_0x593d7e),_0x416614&&console[_0x463af4(0x2a7)](_0x463af4(0x299)+_0x3478a9));const _0x18c3d9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x43f474+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)]['resolveParentId'](_0x43f474),{'verbose':_0x20a340['verbose']}),_0x5c1555=_0x18c3d9[_0x463af4(0x228)],[_0x226a7c,_0x22241f,_0x5edf51,_0xefb1ca,_0x508ab7]=await Promise[_0x463af4(0x2da)]([withSpinner(_0x463af4(0x2cf),()=>_0x1789c1[_0x463af4(0x2c3)]['getParent'](_0x5c1555),{'verbose':_0x20a340['verbose']}),withSpinner(_0x463af4(0x2de),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x2e0)](_0x5c1555),{'verbose':_0x20a340['verbose']}),withSpinner(_0x463af4(0x2a4),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x2b6)](_0x5c1555),{'verbose':_0x20a340[_0x463af4(0x235)]}),withSpinner(_0x463af4(0x293),()=>_0x1789c1['journey']['listJourneysFromParentSegment'](_0x5c1555),{'verbose':_0x20a340['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x1789c1[_0x463af4(0x21d)][_0x463af4(0x231)](),{'verbose':_0x20a340[_0x463af4(0x235)]})[_0x463af4(0x1f3)](_0x463156=>_0x463156[_0x463af4(0x228)])]),_0x1897c7=_0x226a7c['data'],_0x2ec87b=_0x1897c7['relationships']?.[_0x463af4(0x208)]?.[_0x463af4(0x228)]?.['id']||_0x1897c7[_0x463af4(0x1f7)]?.[_0x463af4(0x2b9)]?.['data']?.['id'],_0x3e6b12=_0x22241f[_0x463af4(0x228)],_0x20a776=_0x5edf51['data'],_0x3b6170=_0xefb1ca[_0x463af4(0x228)],{emailToId:_0x4d1b84,idToEmail:_0x52bfe1}=_0x508ab7,[_0x15c7bb,_0x4fcd35,_0x4a647f]=await withSpinner(_0x463af4(0x23b),async()=>{const _0x38c928=_0x463af4,_0x5249ab=await _0x1789c1[_0x38c928(0x25f)]['list'](),_0x52c2fe=new Map(),_0x2481cd=new Map(),_0x1766ea=new Map();for(const _0x26d724 of _0x5249ab){_0x52c2fe[_0x38c928(0x23d)](_0x26d724[_0x38c928(0x246)],parseInt(_0x26d724['id'],0xa)),_0x2481cd[_0x38c928(0x23d)](_0x26d724['id'],_0x26d724[_0x38c928(0x246)]),_0x1766ea[_0x38c928(0x23d)](_0x26d724[_0x38c928(0x246)],_0x26d724[_0x38c928(0x22e)]);}return[_0x52c2fe,_0x2481cd,_0x1766ea];},{'verbose':_0x20a340['verbose']})[_0x463af4(0x1f3)](_0x20a980=>_0x20a980['data']),_0x16b623={'emailToIdMap':_0x4d1b84,'connectionNameToIdMap':_0x15c7bb,'connectionNameToTypeMap':_0x4a647f,'getSchema':_0x28475a=>_0x1789c1[_0x463af4(0x25f)][_0x463af4(0x247)](_0x28475a)},_0x37de8c=buildFolderPathToIdMap(_0x20a776),_0x3bce0e=new Map();for(const [_0x66544b,_0x57196e]of _0x37de8c[_0x463af4(0x2a0)]()){_0x3bce0e['set'](_0x57196e,_0x66544b);}const _0x4b8da3=new Map();for(const _0x5035b8 of _0x3e6b12){const _0x47e7ff=_0x5035b8[_0x463af4(0x1f8)]?_0x3bce0e[_0x463af4(0x269)](_0x5035b8[_0x463af4(0x1f8)]['toString']())||'':'',_0x576859=_0x47e7ff+':'+_0x5035b8[_0x463af4(0x246)];_0x4b8da3[_0x463af4(0x23d)](_0x576859,_0x5035b8);}const _0x13464f=new Map();for(const _0x212ad1 of _0x3e6b12){_0x13464f[_0x463af4(0x23d)](_0x212ad1['name'],_0x212ad1['id']);}const _0x2d51f5=new Map();for(const _0x405848 of _0x3b6170){const _0xa06b8b=_0x405848[_0x463af4(0x265)]?_0x3bce0e[_0x463af4(0x269)](_0x405848[_0x463af4(0x265)])||'':'',_0xd2079=_0xa06b8b+':'+_0x405848[_0x463af4(0x207)];!_0x2d51f5[_0x463af4(0x286)](_0xd2079)&&_0x2d51f5[_0x463af4(0x23d)](_0xd2079,[]),_0x2d51f5['get'](_0xd2079)[_0x463af4(0x210)](_0x405848);}for(const _0x237a50 of _0x2d51f5[_0x463af4(0x28d)]()){_0x237a50[_0x463af4(0x2d2)]((_0x45d02a,_0x2d0b0c)=>(_0x45d02a['versionNumber']||0x0)-(_0x2d0b0c[_0x463af4(0x25d)]||0x0));}let _0x5f0a0e;if(_0xb58b48){if(!_0xb58b48['endsWith'](_0x463af4(0x223))&&!_0xb58b48['endsWith'](_0x463af4(0x2c1)))return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x2dc)+_0xb58b48+'\x0a')),0x1;_0x5f0a0e=[_0xb58b48];}else _0x5f0a0e=findYamlFiles(_0x593d7e);if(_0x5f0a0e[_0x463af4(0x281)]===0x0)return console['error'](a36_0x55ad09['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x593d7e+'\x0a')),console['error'](a36_0x55ad09[_0x463af4(0x26a)](_0x463af4(0x25e))),0x1;const _0x1576b9=[],_0xef11d6=[];for(const _0x1b6bec of _0x5f0a0e){const _0x7c5809=a36_0x5e769c[_0x463af4(0x230)](_0x593d7e,a36_0x5e769c[_0x463af4(0x209)](_0x1b6bec)),_0x58f1b4=_0x7c5809==='.'?'':_0x7c5809,_0x4b716f=readFileSync(_0x1b6bec,_0x463af4(0x220));try{const _0x1cd7ef=a36_0x14c597['parse'](_0x4b716f);if(isJourneyYaml(_0x1cd7ef)){const _0x462f09=a36_0x4b8566(_0x4b716f);_0xef11d6[_0x463af4(0x210)]({'yamlConfig':_0x462f09,'folderPath':_0x58f1b4,'sourcePath':_0x1b6bec});}else{if(!_0x20a340[_0x463af4(0x267)]){const _0x4ad540=parseSegmentYamlFile(_0x4b716f),_0x4c9cac=normalizeChildSegmentYaml(_0x4ad540);_0x1576b9[_0x463af4(0x210)]({'yamlConfig':_0x4c9cac,'folderPath':_0x58f1b4,'sourcePath':_0x1b6bec});}}}catch(_0x9656c6){return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x214)+_0x1b6bec+':\x20'+(_0x9656c6 instanceof Error?_0x9656c6[_0x463af4(0x243)]:_0x9656c6))),0x1;}}if(_0x1576b9['length']===0x0&&_0xef11d6[_0x463af4(0x281)]===0x0){const _0xf0952e=_0x20a340[_0x463af4(0x267)]?_0x463af4(0x241):_0x463af4(0x28f);return console[_0x463af4(0x2a7)](a36_0x55ad09['yellow'](_0x463af4(0x2e7)+_0xf0952e+_0x463af4(0x26f))),0x0;}const _0x57494c=new Map();_0x3e6b12['length']>0x0&&!_0x20a340['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x3e6b12,async _0x530c88=>{const _0x92a19d=a36_0x5329,_0x4e960a=await _0x1789c1[_0x92a19d(0x2c3)][_0x92a19d(0x2dd)](_0x5c1555,_0x530c88['id']);_0x57494c[_0x92a19d(0x23d)](_0x530c88['id'],_0x4e960a);});},{'verbose':_0x20a340['verbose']});const _0x24107c=[],_0xd0573d=new Set();for(const {yamlConfig:_0x533979,folderPath:_0x5d530a,sourcePath:_0x1b325a}of _0x1576b9){const _0x2121f0=resolveTDFolderPath(_0x5d530a,_0x416614,_0x3478a9),_0x4df79e=_0x2121f0+':'+_0x533979[_0x463af4(0x246)],_0x1be3ff=_0x4b8da3[_0x463af4(0x269)](_0x4df79e),_0x82445e=_0x1be3ff?_0x57494c[_0x463af4(0x269)](_0x1be3ff['id'])||[]:[];if(_0x2121f0&&!_0x37de8c[_0x463af4(0x286)](_0x2121f0)){const _0x485756=_0x2121f0[_0x463af4(0x29e)]('/');let _0x55a2a3='';for(const _0x3b93da of _0x485756){_0x55a2a3=_0x55a2a3?_0x55a2a3+'/'+_0x3b93da:_0x3b93da,!_0x37de8c[_0x463af4(0x286)](_0x55a2a3)&&_0xd0573d[_0x463af4(0x252)](_0x55a2a3);}}const _0xb58437=calculateActivationActions(_0x533979[_0x463af4(0x2b1)]||[],_0x82445e,_0x52bfe1,_0x4fcd35);for(const _0x33ff42 of _0xb58437){(_0x33ff42[_0x463af4(0x22e)]===_0x463af4(0x203)||_0x33ff42[_0x463af4(0x22e)]===_0x463af4(0x28b))&&_0x33ff42[_0x463af4(0x204)]&&(_0x33ff42[_0x463af4(0x24a)]=await yamlActivationToCreateRequest(_0x33ff42[_0x463af4(0x204)],_0x16b623));}const _0x15ef35=segmentToYamlString(_0x533979);let _0x2b7a29,_0x54be46=![],_0xaae5d;if(_0x1be3ff){const _0x335895=segmentWithActivationsToYaml(_0x1be3ff,_0x82445e,undefined,_0x52bfe1,_0x4fcd35),_0xfcc059=segmentToYamlString(_0x335895);_0x2b7a29=generateDiff(_0xfcc059,_0x15ef35),_0x54be46=hasChanges(_0x2b7a29),_0x54be46&&(_0xaae5d=formatDiffWithColors(_0x2b7a29));}else _0x2b7a29=generateDiff('',_0x15ef35),_0xaae5d=formatDiffWithColors(_0x2b7a29);_0x24107c['push']({'relativePath':_0x533979['name'],'absolutePath':_0x1b325a,'yamlConfig':_0x533979,'folderPath':_0x2121f0,'existingSegment':_0x1be3ff,'existingActivations':_0x82445e,'isNew':!_0x1be3ff,'hasChanges':_0x54be46,'diff':_0xaae5d,'activationActions':_0xb58437});}let _0x1f9b96=[];if(!_0xb58b48){const _0x16844c=new Set();for(const {yamlConfig:_0x501ca7,folderPath:_0x1e85bd}of _0x1576b9){const _0x16860a=resolveTDFolderPath(_0x1e85bd,_0x416614,_0x3478a9);_0x16844c[_0x463af4(0x252)](_0x16860a+':'+_0x501ca7[_0x463af4(0x246)]);}_0x1f9b96=_0x3e6b12['filter'](_0x2acc79=>{const _0x4e4768=_0x463af4,_0x386723=_0x2acc79['segmentFolderId']?_0x3bce0e[_0x4e4768(0x269)](_0x2acc79[_0x4e4768(0x1f8)][_0x4e4768(0x250)]())||'':'',_0x1298af=_0x386723+':'+_0x2acc79[_0x4e4768(0x246)];if(_0x16844c[_0x4e4768(0x286)](_0x1298af))return![];if(_0x416614)return _0x386723===_0x3478a9||_0x386723[_0x4e4768(0x275)](_0x3478a9+'/');return!![];});}const _0x2ed3cc=[];for(const {yamlConfig:_0x164878,folderPath:_0x5deda2,sourcePath:_0x34f3a6}of _0xef11d6){const _0x4fb576=resolveTDFolderPath(_0x5deda2,_0x416614,_0x3478a9),_0x6a6f6e=_0x4fb576+':'+_0x164878[_0x463af4(0x246)],_0x1dd3c3=_0x2d51f5['get'](_0x6a6f6e);let _0x2435f4,_0xa0e1e4;if(_0x1dd3c3&&_0x1dd3c3[_0x463af4(0x281)]>0x0){const _0x2fcf8d=new Set(),_0x24d3a1=new Set(),_0x105637=new Map(),_0x19b75b=new Map(),_0xae62c1=createJumpTargetCache(),_0x4c09de=_0x5196d8=>({'resolveSegment':async _0x506fb2=>{const _0x5ab9a3=_0x463af4,_0x2432a5=_0x19b75b['get'](_0x506fb2);if(_0x2432a5!==undefined)return{'name':_0x2432a5,'isJourneyLocal':!![]};try{let _0xc4078e=_0x3e6b12[_0x5ab9a3(0x259)](_0x1af168=>_0x1af168['id']===_0x506fb2);!_0xc4078e&&(_0xc4078e=await _0x1789c1['segment'][_0x5ab9a3(0x2bb)](_0x5c1555,_0x506fb2));const _0x1ed8d2=generateJourneyLocalName(_0xc4078e['name']),_0x4c8bba=_0xc4078e[_0x5ab9a3(0x248)]===SEGMENT_KIND_JOURNEY&&_0x1ed8d2!==undefined;let _0x4aa245=_0xc4078e[_0x5ab9a3(0x246)];if(_0x4c8bba&&_0x1ed8d2){let _0x4c7fac=_0x1ed8d2,_0xd84256=0x2;while(_0x2fcf8d[_0x5ab9a3(0x286)](_0x4c7fac)){_0x4c7fac=_0x1ed8d2+'_'+_0xd84256,_0xd84256++;}_0x2fcf8d[_0x5ab9a3(0x252)](_0x4c7fac),_0x4aa245=_0x4c7fac,_0x19b75b['set'](_0x506fb2,_0x4aa245);}let _0x4c3afe;return _0x4c8bba&&_0xc4078e[_0x5ab9a3(0x24f)]&&(_0x4c3afe={'description':_0xc4078e[_0x5ab9a3(0x27b)],'rule':apiRuleToYaml(_0xc4078e[_0x5ab9a3(0x24f)])}),{'name':_0x4aa245,'isJourneyLocal':_0x4c8bba,'definition':_0x4c3afe};}catch{return{'name':_0x506fb2,'isJourneyLocal':![]};}},'resolveActivation':async _0x23f5d3=>{const _0x6d8bf6=_0x463af4,_0xb49d1=_0x105637[_0x6d8bf6(0x269)](_0x23f5d3);if(_0xb49d1!==undefined)return{'name':_0xb49d1,'isJourneyLocal':!![]};try{const _0x400e30=await _0x1789c1[_0x6d8bf6(0x241)][_0x6d8bf6(0x1ee)](_0x5196d8,_0x23f5d3),_0x56d6cd=_0x400e30['attributes'][_0x6d8bf6(0x2a8)][_0x6d8bf6(0x246)]||_0x23f5d3,_0xefdf74=sanitizeYamlKey(_0x56d6cd)||'activation_'+_0x23f5d3;let _0x466141=_0xefdf74,_0x5c5915=0x2;while(_0x24d3a1['has'](_0x466141)){_0x466141=_0xefdf74+'_'+_0x5c5915,_0x5c5915++;}_0x24d3a1[_0x6d8bf6(0x252)](_0x466141),_0x105637[_0x6d8bf6(0x23d)](_0x23f5d3,_0x466141);const _0x4b0a4a=journeyActivationStepToYaml(_0x400e30,_0x52bfe1,_0x4fcd35);return{'name':_0x466141,'isJourneyLocal':!![],'definition':_0x4b0a4a};}catch{return{'name':_0x23f5d3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x529046,_0x51aaaa)=>resolveJumpTarget(_0x529046,_0x51aaaa,_0xae62c1,_0x3d406a=>_0x1789c1[_0x463af4(0x241)]['getJourney'](_0x3d406a))}),_0x58d30b=hasMultipleVersions(_0x164878);if(_0x58d30b&&_0x1dd3c3['length']>0x1){const _0x6c3ec9=[];for(const _0x2ef70b of _0x1dd3c3){const _0x5d78b1=await withSpinner(_0x463af4(0x2c6)+_0x164878[_0x463af4(0x246)]+_0x463af4(0x233)+(_0x2ef70b[_0x463af4(0x25d)]||0x1)+_0x463af4(0x240),()=>_0x1789c1[_0x463af4(0x241)]['getJourney'](_0x2ef70b['id']),{'verbose':_0x20a340['verbose']}),_0x5b9d96=_0x4c09de(_0x2ef70b['id']),_0x36fbc5=await apiToYamlAsync(_0x5d78b1[_0x463af4(0x228)],_0x5b9d96);_0x6c3ec9['push']({'item':_0x2ef70b,'yaml':_0x36fbc5});}_0xa0e1e4=buildMergedJourneyYaml(_0x6c3ec9);const _0x5871a8=Math[_0x463af4(0x219)](..._0x6c3ec9[_0x463af4(0x2d5)](_0x3b153d=>_0x3b153d[_0x463af4(0x1f1)][_0x463af4(0x25d)]||0x0)),_0x52664d=_0x1dd3c3['find'](_0x6e65f1=>(_0x6e65f1[_0x463af4(0x25d)]||0x0)===_0x5871a8);_0x52664d&&(_0x2435f4=await _0x1789c1[_0x463af4(0x241)][_0x463af4(0x2c0)](_0x52664d['id']));}else{const _0x3c5554=_0x1dd3c3[_0x1dd3c3['length']-0x1],_0x2bd5ad=await withSpinner(_0x463af4(0x2c6)+_0x164878[_0x463af4(0x246)]+_0x463af4(0x2b3),()=>_0x1789c1[_0x463af4(0x241)][_0x463af4(0x2c0)](_0x3c5554['id']),{'verbose':_0x20a340['verbose']});_0x2435f4=_0x2bd5ad['data'];const _0xad16dc=_0x4c09de(_0x3c5554['id']);_0xa0e1e4=await apiToYamlAsync(_0x2435f4,_0xad16dc);}}if(_0x4fb576&&!_0x37de8c[_0x463af4(0x286)](_0x4fb576)){const _0x3fe2e7=_0x4fb576['split']('/');let _0x5d069d='';for(const _0x557c92 of _0x3fe2e7){_0x5d069d=_0x5d069d?_0x5d069d+'/'+_0x557c92:_0x557c92,!_0x37de8c[_0x463af4(0x286)](_0x5d069d)&&_0xd0573d['add'](_0x5d069d);}}const _0x44172e=normalizeJourneyYaml(_0x164878),_0x38a546=a36_0x4acde4(_0x44172e);let _0x706771=![],_0x19cc65;if(_0xa0e1e4){const _0x4715bc=normalizeJourneyYaml(_0xa0e1e4),_0x17a497=a36_0x4acde4(_0x4715bc),_0x3d517d=generateDiff(_0x17a497,_0x38a546);_0x706771=hasChanges(_0x3d517d),_0x706771&&(_0x19cc65=formatDiffWithColors(_0x3d517d));}else{const _0x13af63=generateDiff('',_0x38a546);_0x19cc65=formatDiffWithColors(_0x13af63);}_0x2ed3cc[_0x463af4(0x210)]({'relativePath':_0x164878[_0x463af4(0x246)],'absolutePath':_0x34f3a6,'yamlConfig':_0x164878,'folderPath':_0x4fb576,'existingJourney':_0x2435f4,'isNew':!_0x2435f4,'hasChanges':_0x706771,'diff':_0x19cc65});}let _0x5ee661=[];if(!_0xb58b48){const _0xb291cc=new Set();for(const {yamlConfig:_0xa6abe1,folderPath:_0x443ee0}of _0xef11d6){const _0x13749e=resolveTDFolderPath(_0x443ee0,_0x416614,_0x3478a9);_0xb291cc[_0x463af4(0x252)](_0x13749e+':'+_0xa6abe1[_0x463af4(0x246)]);}_0x5ee661=_0x3b6170[_0x463af4(0x295)](_0x37601c=>{const _0x1508bb=_0x463af4,_0xd4fd54=_0x37601c[_0x1508bb(0x265)]?_0x3bce0e['get'](_0x37601c['folderId'])||'':'',_0xdfabc=_0xd4fd54+':'+_0x37601c[_0x1508bb(0x207)];if(_0xb291cc[_0x1508bb(0x286)](_0xdfabc))return![];if(_0x416614)return _0xd4fd54===_0x3478a9||_0xd4fd54[_0x1508bb(0x275)](_0x3478a9+'/');return!![];});}const _0x52514a=_0x24107c[_0x463af4(0x295)](_0x1fd3ed=>_0x1fd3ed[_0x463af4(0x1f4)]),_0x50355e=_0x24107c[_0x463af4(0x295)](_0x2dac40=>!_0x2dac40[_0x463af4(0x1f4)]&&_0x2dac40[_0x463af4(0x234)]),_0x21a75d=_0x24107c[_0x463af4(0x295)](_0x4869a4=>!_0x4869a4['isNew']&&!_0x4869a4['hasChanges']),_0x9b4d36=Array[_0x463af4(0x2ae)](_0xd0573d)[_0x463af4(0x2d2)](),_0x697027=_0x20a340[_0x463af4(0x236)]?_0x1f9b96:[],_0x3d4c25=_0x20a340[_0x463af4(0x236)]?_0x5ee661:[],_0x1ecb39=_0x24107c['flatMap'](_0x1fa8da=>_0x1fa8da[_0x463af4(0x2cc)]),_0x1a8ce4=_0x1ecb39[_0x463af4(0x295)](_0x5cb3dc=>_0x5cb3dc[_0x463af4(0x22e)]==='create'),_0x59d85e=_0x1ecb39['filter'](_0x147a90=>_0x147a90[_0x463af4(0x22e)]==='update'),_0x1e02fe=_0x1ecb39[_0x463af4(0x295)](_0x34f85f=>_0x34f85f[_0x463af4(0x22e)]===_0x463af4(0x236)),_0xb00d72=_0x2ed3cc[_0x463af4(0x295)](_0x290950=>_0x290950[_0x463af4(0x1f4)]),_0x43aa11=_0x2ed3cc[_0x463af4(0x295)](_0x329e4a=>!_0x329e4a[_0x463af4(0x1f4)]&&_0x329e4a[_0x463af4(0x234)]),_0xce6658=_0x2ed3cc['filter'](_0x25babc=>!_0x25babc[_0x463af4(0x1f4)]&&!_0x25babc['hasChanges']);console[_0x463af4(0x2a7)]('\x0aPush\x20summary\x20for\x20\x27'+_0x43f474+'\x27:');_0x9b4d36[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09['blue'](_0x463af4(0x206)+_0x9b4d36[_0x463af4(0x281)]+_0x463af4(0x298)));if(!_0x20a340[_0x463af4(0x267)]){console[_0x463af4(0x2a7)](_0x463af4(0x2c4)),console['error']('\x20\x20\x20\x20'+a36_0x55ad09['green']('+\x20'+_0x52514a['length']+_0x463af4(0x1fb))),console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x237)]('~\x20'+_0x50355e[_0x463af4(0x281)]+_0x463af4(0x23f)));if(_0x697027['length']>0x0)console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x2ab)]('-\x20'+_0x697027['length']+_0x463af4(0x2ba)));else _0x1f9b96[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x236)]&&console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x24c)](_0x1f9b96[_0x463af4(0x281)]+_0x463af4(0x271)));console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09['dim']('=\x20'+_0x21a75d['length']+_0x463af4(0x2bf)));}if(_0x2ed3cc['length']>0x0||_0x5ee661['length']>0x0){console[_0x463af4(0x2a7)](_0x463af4(0x227)),console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x29c)]('+\x20'+_0xb00d72[_0x463af4(0x281)]+_0x463af4(0x1fb))),console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x237)]('~\x20'+_0x43aa11[_0x463af4(0x281)]+_0x463af4(0x23f)));if(_0x3d4c25[_0x463af4(0x281)]>0x0)console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x2ab)]('-\x20'+_0x3d4c25[_0x463af4(0x281)]+_0x463af4(0x2ba)));else _0x5ee661[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x236)]&&console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x24c)](_0x5ee661[_0x463af4(0x281)]+_0x463af4(0x271)));console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x24c)]('=\x20'+_0xce6658[_0x463af4(0x281)]+'\x20unchanged'));}_0x1ecb39[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)]&&(console['error'](''),console[_0x463af4(0x2a7)]('\x20\x20Activations:'),_0x1a8ce4[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)](_0x463af4(0x2b0)+a36_0x55ad09[_0x463af4(0x29c)]('+\x20'+_0x1a8ce4[_0x463af4(0x281)]+_0x463af4(0x2e5))),_0x59d85e[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x237)]('~\x20'+_0x59d85e[_0x463af4(0x281)]+_0x463af4(0x287))),_0x1e02fe[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)]('\x20\x20\x20\x20'+a36_0x55ad09[_0x463af4(0x2ab)]('-\x20'+_0x1e02fe[_0x463af4(0x281)]+_0x463af4(0x2ba))));console[_0x463af4(0x2a7)](_0x463af4(0x2a9)+a36_0x55ad09[_0x463af4(0x26a)](_0x593d7e)+'\x0a');if(_0x9b4d36[_0x463af4(0x281)]>0x0){console[_0x463af4(0x2a7)](_0x463af4(0x2c2));for(const _0x67b9a1 of _0x9b4d36){console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09[_0x463af4(0x282)]('+')+'\x20'+_0x67b9a1);}console['error']('');}if(_0x52514a[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)])for(const _0x24c5e7 of _0x52514a){const _0x1d332a=_0x24c5e7[_0x463af4(0x1f2)]?_0x24c5e7[_0x463af4(0x1f2)]+'/'+_0x24c5e7[_0x463af4(0x255)][_0x463af4(0x246)]:_0x24c5e7['yamlConfig'][_0x463af4(0x246)],_0x56ecf5=_0x24c5e7[_0x463af4(0x255)]['activations']?.[_0x463af4(0x281)]||0x0,_0x3494d2=_0x56ecf5>0x0?a36_0x55ad09['dim']('\x20['+_0x56ecf5+_0x463af4(0x294)):'';console['error']('\x0a'+a36_0x55ad09[_0x463af4(0x29c)]('New\x20segment:')+'\x20'+_0x1d332a+_0x3494d2),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),_0x24c5e7[_0x463af4(0x2e2)]&&console[_0x463af4(0x2a7)](_0x24c5e7['diff']),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}if(_0x697027[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)])for(const _0x3ca730 of _0x697027){const _0x562dfe=_0x3ca730[_0x463af4(0x1f8)]?_0x3bce0e['get'](_0x3ca730['segmentFolderId'][_0x463af4(0x250)]())||'':'',_0x5b8847=_0x562dfe?_0x562dfe+'/'+_0x3ca730[_0x463af4(0x246)]:_0x3ca730[_0x463af4(0x246)],_0x5403de=_0x57494c[_0x463af4(0x269)](_0x3ca730['id'])||[],_0xa22ed0=_0x5403de['length']>0x0?a36_0x55ad09[_0x463af4(0x24c)]('\x20['+_0x5403de[_0x463af4(0x281)]+_0x463af4(0x294)):'';console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09[_0x463af4(0x2ab)]('Delete\x20segment:')+'\x20'+_0x5b8847+_0xa22ed0),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));const _0x557a59=segmentWithActivationsToYaml(_0x3ca730,_0x5403de,undefined,_0x52bfe1,_0x4fcd35),_0x39b2ca=segmentToYamlString(_0x557a59),_0x5234ff=generateDiff(_0x39b2ca,'');console[_0x463af4(0x2a7)](formatDiffWithColors(_0x5234ff)),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}const _0x5284d0=_0x24107c[_0x463af4(0x295)](_0x1e72cf=>!_0x1e72cf[_0x463af4(0x1f4)]&&_0x1e72cf[_0x463af4(0x2e2)]);if(_0x5284d0[_0x463af4(0x281)]>0x0&&!_0x20a340[_0x463af4(0x267)])for(const _0xc21ffc of _0x5284d0){const _0x143008=_0xc21ffc[_0x463af4(0x1f2)]?_0xc21ffc[_0x463af4(0x1f2)]+'/'+_0xc21ffc[_0x463af4(0x255)][_0x463af4(0x246)]:_0xc21ffc[_0x463af4(0x255)][_0x463af4(0x246)];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09[_0x463af4(0x237)]('Changes\x20to:')+'\x20'+_0x143008),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),console[_0x463af4(0x2a7)](_0xc21ffc[_0x463af4(0x2e2)]),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}if(_0xb00d72[_0x463af4(0x281)]>0x0)for(const _0x271b34 of _0xb00d72){const _0x43f3b7=_0x271b34[_0x463af4(0x1f2)]?_0x271b34[_0x463af4(0x1f2)]+'/'+_0x271b34[_0x463af4(0x255)][_0x463af4(0x246)]:_0x271b34[_0x463af4(0x255)][_0x463af4(0x246)];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09['green'](_0x463af4(0x24e))+'\x20'+_0x43f3b7),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),_0x271b34[_0x463af4(0x2e2)]&&console[_0x463af4(0x2a7)](_0x271b34[_0x463af4(0x2e2)]),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}const _0x9348a9=_0x2ed3cc['filter'](_0x3fde26=>!_0x3fde26[_0x463af4(0x1f4)]&&_0x3fde26[_0x463af4(0x2e2)]);if(_0x9348a9[_0x463af4(0x281)]>0x0)for(const _0x44755c of _0x9348a9){const _0x4d0e47=_0x44755c['folderPath']?_0x44755c[_0x463af4(0x1f2)]+'/'+_0x44755c[_0x463af4(0x255)][_0x463af4(0x246)]:_0x44755c['yamlConfig'][_0x463af4(0x246)];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x2d3))+'\x20'+_0x4d0e47),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),console['error'](_0x44755c['diff']),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c));}if(_0x3d4c25[_0x463af4(0x281)]>0x0)for(const _0x4b9b9e of _0x3d4c25){const _0x36a18c=_0x4b9b9e['folderId']?_0x3bce0e[_0x463af4(0x269)](_0x4b9b9e['folderId'])||'':'',_0x2eaca2=_0x36a18c?_0x36a18c+'/'+_0x4b9b9e[_0x463af4(0x207)]:_0x4b9b9e['journeyBundleName'];console[_0x463af4(0x2a7)]('\x0a'+a36_0x55ad09['red'](_0x463af4(0x2d0))+'\x20'+_0x2eaca2),console[_0x463af4(0x2a7)]('─'[_0x463af4(0x288)](0x3c)),console['error'](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x289))),console['error']('─'['repeat'](0x3c));}if(_0x20a340['dryRun'])return console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x480df6=_0x20a340[_0x463af4(0x267)]?![]:_0x52514a[_0x463af4(0x281)]>0x0||_0x50355e[_0x463af4(0x281)]>0x0||_0x697027[_0x463af4(0x281)]>0x0,_0x376df1=_0xb00d72[_0x463af4(0x281)]>0x0||_0x43aa11['length']>0x0||_0x3d4c25['length']>0x0,_0x3c82ed=_0x20a340[_0x463af4(0x267)]?![]:_0x1ecb39[_0x463af4(0x281)]>0x0,_0x38b9a5=_0x9b4d36[_0x463af4(0x281)]>0x0;if(!_0x480df6&&!_0x376df1&&!_0x3c82ed&&!_0x38b9a5){const _0x1a8573=_0x20a340[_0x463af4(0x267)]?_0x463af4(0x22d):'βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x463af4(0x2a7)](a36_0x55ad09['green'](_0x1a8573));if(_0xb58b48&&_0xce6658[_0x463af4(0x281)]===0x1){const _0x3dbdc0=_0xce6658[0x0];if(_0x3dbdc0['existingJourney']?.['id']){const _0x489d41=getConsoleNextUrl(_0x20a340[_0x463af4(0x258)],_0x463af4(0x2d1)+_0x5c1555+'/e/'+_0x3dbdc0[_0x463af4(0x2a1)]['id']+_0x463af4(0x25b));console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09['cyan'](_0x489d41));}}return 0x0;}const _0xdd232=_0x20a340['journeysOnly']?_0xb00d72[_0x463af4(0x281)]+_0x43aa11['length']+_0x3d4c25[_0x463af4(0x281)]+_0x9b4d36['length']:_0x52514a[_0x463af4(0x281)]+_0x50355e[_0x463af4(0x281)]+_0x697027[_0x463af4(0x281)]+_0xb00d72[_0x463af4(0x281)]+_0x43aa11[_0x463af4(0x281)]+_0x3d4c25['length']+_0x9b4d36['length']+_0x1ecb39[_0x463af4(0x281)];if(!_0x20a340['yes']&&_0xdd232>0x0){const _0x40134a=await confirmKey(_0x463af4(0x251)+_0xdd232+_0x463af4(0x1fa));if(!_0x40134a)return console[_0x463af4(0x2a7)](_0x463af4(0x2ad)),0x1;}for(const _0x81258a of _0x9b4d36){const _0x1468da=_0x81258a[_0x463af4(0x29e)]('/'),_0x53151c=_0x1468da[_0x1468da[_0x463af4(0x281)]-0x1],_0x84ef6a=_0x1468da[_0x463af4(0x2c9)](0x0,-0x1)['join']('/'),_0x335027=_0x37de8c[_0x463af4(0x269)](_0x84ef6a),_0x442165={'name':_0x53151c,'parentFolderId':_0x335027},_0x249ca1=await withSpinner(_0x463af4(0x2d4)+_0x81258a+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x260)](_0x5c1555,_0x442165),{'verbose':_0x20a340[_0x463af4(0x235)]});_0x37de8c[_0x463af4(0x23d)](_0x81258a,_0x249ca1['data']['id']),console[_0x463af4(0x2a7)](a36_0x55ad09['blue']('βœ”\x20Created\x20folder\x20\x27'+_0x81258a+'\x27'));}let _0x3448f7=0x0,_0x4b4fc2=0x0,_0x18421c=0x0,_0x233b1b=0x0,_0xdeba32=0x0,_0x3441e2=0x0;const _0xc52272=new Map();for(const _0x4f69ad of _0x20a340[_0x463af4(0x267)]?[]:_0x24107c){const _0x3a21e5=_0x4f69ad[_0x463af4(0x1f2)]?_0x37de8c['get'](_0x4f69ad['folderPath']):undefined;let _0xdf03a2;try{if(_0x4f69ad['isNew']){const _0x53724b=yamlToCreateRequest(_0x4f69ad[_0x463af4(0x255)],_0x3a21e5),_0x212501=await withSpinner('Creating\x20segment\x20\x27'+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+_0x463af4(0x29f),()=>_0x1789c1['segment'][_0x463af4(0x261)](_0x5c1555,_0x53724b),{'verbose':_0x20a340[_0x463af4(0x235)]});_0xdf03a2=_0x212501[_0x463af4(0x228)]['id'],_0xc52272[_0x463af4(0x23d)](_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)],_0xdf03a2),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x29c)](_0x463af4(0x292)+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+'\x27')),_0x3448f7++;}else{if(_0x4f69ad[_0x463af4(0x234)]){const _0x4372d0=yamlToUpdateRequest(_0x4f69ad[_0x463af4(0x255)]);_0x3a21e5!==_0x4f69ad[_0x463af4(0x1ec)]?.['segmentFolderId']&&(_0x4372d0[_0x463af4(0x1f8)]=_0x3a21e5?parseInt(_0x3a21e5,0xa):undefined),await withSpinner('Updating\x20segment\x20\x27'+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+'\x27...',()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x268)](_0x5c1555,_0x4f69ad['existingSegment']['id'],_0x4372d0),{'verbose':_0x20a340['verbose']}),_0xdf03a2=_0x4f69ad[_0x463af4(0x1ec)]['id'],console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x23c)+_0x4f69ad[_0x463af4(0x255)][_0x463af4(0x246)]+'\x27')),_0x4b4fc2++;}else _0xdf03a2=_0x4f69ad[_0x463af4(0x1ec)]['id'];}}catch(_0x2b9fd4){const _0x63e762=isHttp400Error(_0x2b9fd4),_0x296cb7=_0x63e762?ErrorCode[_0x463af4(0x221)]:ErrorCode[_0x463af4(0x257)],_0x5821da=getErrorMessage(_0x2b9fd4);throw new SDKError(_0x296cb7,_0x463af4(0x25c)+(_0x4f69ad[_0x463af4(0x1f4)]?_0x463af4(0x203):_0x463af4(0x28b))+'\x20segment\x20from\x20file:\x20'+_0x4f69ad[_0x463af4(0x2a6)]+_0x463af4(0x2e1)+_0x5821da,_0x2b9fd4);}for(const _0x3a8f30 of _0x4f69ad[_0x463af4(0x2cc)]){try{if(_0x3a8f30['type']==='create'&&_0x3a8f30[_0x463af4(0x24a)])await withSpinner(_0x463af4(0x283)+_0x3a8f30['name']+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x2ac)](_0x5c1555,_0xdf03a2,_0x3a8f30[_0x463af4(0x24a)]),{'verbose':_0x20a340['verbose']}),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x29c)](_0x463af4(0x226)+_0x3a8f30[_0x463af4(0x246)]+'\x27')),_0x233b1b++;else{if(_0x3a8f30[_0x463af4(0x22e)]===_0x463af4(0x28b)&&_0x3a8f30['validatedRequest']&&_0x3a8f30[_0x463af4(0x1f6)])await withSpinner(_0x463af4(0x21c)+_0x3a8f30[_0x463af4(0x246)]+_0x463af4(0x29f),()=>_0x1789c1['segment']['updateActivation'](_0x5c1555,_0xdf03a2,_0x3a8f30['existingActivation']['id'],_0x3a8f30[_0x463af4(0x24a)]),{'verbose':_0x20a340[_0x463af4(0x235)]}),console[_0x463af4(0x2a7)](a36_0x55ad09['yellow'](_0x463af4(0x211)+_0x3a8f30['name']+'\x27')),_0xdeba32++;else _0x3a8f30[_0x463af4(0x22e)]===_0x463af4(0x236)&&_0x3a8f30[_0x463af4(0x1f6)]&&(await withSpinner(_0x463af4(0x256)+_0x3a8f30[_0x463af4(0x246)]+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x242)](_0x5c1555,_0xdf03a2,_0x3a8f30[_0x463af4(0x1f6)]['id']),{'verbose':_0x20a340[_0x463af4(0x235)]}),console[_0x463af4(0x2a7)](a36_0x55ad09['red']('\x20\x20βœ”\x20Deleted\x20activation\x20\x27'+_0x3a8f30[_0x463af4(0x246)]+'\x27')),_0x3441e2++);}}catch(_0x4c450a){const _0x6a4e0e=isHttp400Error(_0x4c450a),_0x3b56cd=_0x6a4e0e?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x463af4(0x266)],_0x389810=getErrorMessage(_0x4c450a);throw new SDKError(_0x3b56cd,_0x463af4(0x25c)+_0x3a8f30[_0x463af4(0x22e)]+_0x463af4(0x23e)+_0x3a8f30[_0x463af4(0x246)]+_0x463af4(0x2be)+_0x4f69ad[_0x463af4(0x2a6)]+'\x0a\x20\x20'+_0x389810,_0x4c450a);}}}for(const _0x17d2c4 of _0x20a340[_0x463af4(0x267)]?[]:_0x697027){await withSpinner('Deleting\x20segment\x20\x27'+_0x17d2c4['name']+_0x463af4(0x29f),()=>_0x1789c1[_0x463af4(0x2c3)][_0x463af4(0x22b)](_0x17d2c4['id']),{'verbose':_0x20a340[_0x463af4(0x235)]}),console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x2ab)](_0x463af4(0x1fc)+_0x17d2c4[_0x463af4(0x246)]+'\x27')),_0x18421c++;}let _0xf8126b=0x0,_0x49b210=0x0,_0x4d7f5c=0x0;const _0x26d46e=new Map(_0x13464f);for(const _0x3d77e6 of _0x24107c){_0x3d77e6[_0x463af4(0x1f4)]&&_0xc52272[_0x463af4(0x286)](_0x3d77e6[_0x463af4(0x255)][_0x463af4(0x246)])&&_0x26d46e[_0x463af4(0x23d)](_0x3d77e6['yamlConfig']['name'],_0xc52272[_0x463af4(0x269)](_0x3d77e6[_0x463af4(0x255)][_0x463af4(0x246)]));}if(_0x2ed3cc['length']>0x0){const _0x5cc12d=await withQuerySpinner(_0x463af4(0x28c),async _0x36d365=>{const _0x3a189d=_0x463af4,_0x11fddb=[];let _0x21d94a=0x0;const _0x222bc8=0x5;for(let _0x5e7e48=0x0;_0x5e7e48<_0x2ed3cc[_0x3a189d(0x281)];_0x5e7e48+=_0x222bc8){const _0x27aad0=_0x2ed3cc[_0x3a189d(0x2c9)](_0x5e7e48,_0x5e7e48+_0x222bc8),_0x12bafe=await Promise[_0x3a189d(0x2da)](_0x27aad0['map'](async _0x345219=>{const _0x3b4d8e=_0x3a189d;if(!_0x345219['isNew']&&!_0x345219[_0x3b4d8e(0x234)])return{'action':_0x3b4d8e(0x296),'name':_0x345219[_0x3b4d8e(0x255)]['name'],'journeyId':_0x345219[_0x3b4d8e(0x2a1)]?.['id']};const _0xf7430e=_0x345219[_0x3b4d8e(0x1f2)]?_0x37de8c[_0x3b4d8e(0x269)](_0x345219[_0x3b4d8e(0x1f2)]):undefined,_0x2936ab=_0x345219[_0x3b4d8e(0x1f4)]?_0x3b4d8e(0x29b):'Updating';_0x36d365[_0x3b4d8e(0x2db)](_0x2936ab+_0x3b4d8e(0x2b5)+_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)]+'\x27');const _0x21d4d7=new Map(),_0xfe395a=new Map(),_0x11dc2d=new Map(),_0x157770={'resolveSegmentId':async _0x219f6c=>{const _0x27ee9f=_0x3b4d8e,_0x1d4da1=_0x26d46e[_0x27ee9f(0x269)](_0x219f6c);if(!_0x1d4da1)throw new SDKError(ErrorCode[_0x27ee9f(0x254)],_0x27ee9f(0x2bc)+_0x219f6c+_0x27ee9f(0x21e)+_0x345219['yamlConfig'][_0x27ee9f(0x246)]+')');return _0x1d4da1;},'resolveEmbeddedSegmentId':async(_0x2696f3,_0x357d8a)=>{const _0x49d91e=_0x3b4d8e,_0x194be5=_0x26d46e[_0x49d91e(0x269)](_0x2696f3);if(_0x194be5)return _0x194be5;const _0x4c8823=_0x3e6b12['find'](_0x482027=>_0x482027[_0x49d91e(0x246)]===_0x2696f3);if(_0x4c8823)return _0x26d46e['set'](_0x2696f3,_0x4c8823['id']),_0x4c8823['id'];if(_0x345219[_0x49d91e(0x1f4)]){const _0xbcd6a5=_0x345219['yamlConfig'][_0x49d91e(0x2e3)]||_0x345219['yamlConfig'][_0x49d91e(0x2a5)]?.[0x0]?.[_0x49d91e(0x2e3)]||[];let _0xaea39=_0x49d91e(0x2df),_0x3e4011=_0x2696f3;for(const _0x16959d of _0xbcd6a5){if(_0x16959d[_0x49d91e(0x280)]?.[_0x49d91e(0x2c3)]===_0x2696f3){_0xaea39=_0x16959d[_0x49d91e(0x246)],_0x3e4011=_0x16959d[_0x49d91e(0x280)][_0x49d91e(0x246)]||_0x2696f3;break;}}return _0xfe395a[_0x49d91e(0x23d)](_0x2696f3,{'definition':_0x357d8a,'stageName':_0xaea39,'criteriaName':_0x3e4011}),createPendingSegmentId(_0x2696f3);}const _0x170599=_0x345219[_0x49d91e(0x2a1)]?.['id'];if(!_0x170599)throw new SDKError(ErrorCode[_0x49d91e(0x238)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x2e8799=_0x49d91e(0x28e)+crypto[_0x49d91e(0x21b)]();try{const _0x42b075=await _0x1789c1['segment'][_0x49d91e(0x205)]({'name':_0x2e8799,'description':_0x357d8a[_0x49d91e(0x27b)]||_0x49d91e(0x2d9)+_0x2696f3,'journeyId':_0x170599,'rule':yamlRuleToApi(_0x357d8a[_0x49d91e(0x24f)],!![]),'countPopulation':!![],'parentFolderId':_0x2ec87b||'','audienceId':_0x5c1555});return _0x20a340[_0x49d91e(0x235)]&&console[_0x49d91e(0x2a7)](_0x49d91e(0x264)+_0x2696f3+_0x49d91e(0x273)+_0x2e8799+_0x49d91e(0x27e)+_0x42b075),_0x26d46e['set'](_0x2696f3,_0x42b075),_0x42b075;}catch(_0x26d44d){throw new SDKError(ErrorCode[_0x49d91e(0x257)],_0x49d91e(0x2e8)+_0x2696f3+_0x49d91e(0x2aa)+getErrorMessage(_0x26d44d),_0x26d44d);}},'resolveActivationId':async _0xfcae4b=>{const _0x5ed47c=_0x3b4d8e,_0x57a93c=_0x21d4d7[_0x5ed47c(0x269)](_0xfcae4b);if(_0x57a93c)return _0x57a93c;if(_0x345219['existingJourney']){const _0x5b3ab7=await _0x1789c1['journey'][_0x5ed47c(0x2dd)](_0x345219[_0x5ed47c(0x2a1)]['id']),_0x259bc3=_0x5b3ab7[_0x5ed47c(0x259)](_0x59345d=>_0x59345d[_0x5ed47c(0x20a)][_0x5ed47c(0x2a8)]?.[_0x5ed47c(0x246)]===_0xfcae4b);if(_0x259bc3)return _0x21d4d7[_0x5ed47c(0x23d)](_0xfcae4b,_0x259bc3['id']),_0x259bc3['id'];}throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ed47c(0x1f9)+_0xfcae4b+'\x20(referenced\x20in\x20journey\x20'+_0x345219[_0x5ed47c(0x255)][_0x5ed47c(0x246)]+_0x5ed47c(0x291)+_0x5ed47c(0x249));},'resolveEmbeddedActivationId':async(_0x1386d8,_0x1ff737)=>{const _0x3406df=_0x3b4d8e,_0xd45dd6=_0x21d4d7[_0x3406df(0x269)](_0x1386d8);if(_0xd45dd6)return _0xd45dd6;if(_0x345219[_0x3406df(0x1f4)])return _0x11dc2d[_0x3406df(0x23d)](_0x1386d8,_0x1ff737),createPendingActivationId(_0x1386d8);if(_0x345219[_0x3406df(0x2a1)]){const _0x2630bd=await _0x1789c1[_0x3406df(0x241)][_0x3406df(0x2dd)](_0x345219[_0x3406df(0x2a1)]['id']),_0x25cae1=_0x2630bd[_0x3406df(0x259)](_0x428659=>_0x428659[_0x3406df(0x20a)]['activationParams']?.[_0x3406df(0x246)]===_0x1ff737['name']);if(_0x25cae1)return _0x21d4d7['set'](_0x1386d8,_0x25cae1['id']),_0x25cae1['id'];try{const _0x145455=await yamlActivationToCreateRequest(_0x1ff737,_0x16b623),_0x3780f7=await _0x1789c1[_0x3406df(0x241)][_0x3406df(0x2ac)](_0x345219[_0x3406df(0x2a1)]['id'],_0x145455);return _0x20a340[_0x3406df(0x235)]&&console[_0x3406df(0x2a7)](_0x3406df(0x284)+_0x1386d8+_0x3406df(0x24b)+_0x3780f7['id']),_0x21d4d7[_0x3406df(0x23d)](_0x1386d8,_0x3780f7['id']),_0x3780f7['id'];}catch(_0x4134d7){throw new SDKError(ErrorCode[_0x3406df(0x2e4)],_0x3406df(0x2d6)+_0x1386d8+'\x27:\x20'+getErrorMessage(_0x4134d7),_0x4134d7);}}throw new SDKError(ErrorCode[_0x3406df(0x238)],_0x3406df(0x222));},'resolveJourneyId':async _0x1a817d=>{const _0x1135a6=_0x3b4d8e;try{return await _0x1789c1[_0x1135a6(0x241)][_0x1135a6(0x26e)](_0x5c1555,_0x1a817d);}catch(_0x5d55be){throw new SDKError(ErrorCode[_0x1135a6(0x27d)],_0x1135a6(0x21a)+_0x1a817d+_0x1135a6(0x2b8)+_0x345219['yamlConfig'][_0x1135a6(0x246)]+'\x27)',_0x5d55be);}},'resolveStageId':async(_0x114d20,_0x3ab532)=>{const _0x5d49da=_0x3b4d8e,_0x2b6231=await _0x1789c1[_0x5d49da(0x241)][_0x5d49da(0x2c0)](_0x114d20),_0xe89e1b=_0x2b6231[_0x5d49da(0x20a)][_0x5d49da(0x216)][_0x5d49da(0x259)](_0x57896c=>_0x57896c['name']['toLowerCase']()===_0x3ab532[_0x5d49da(0x263)]());if(!_0xe89e1b?.['id'])throw new SDKError(ErrorCode[_0x5d49da(0x27d)],_0x5d49da(0x2c5)+_0x3ab532+_0x5d49da(0x2a2)+(_0x2b6231[_0x5d49da(0x20a)][_0x5d49da(0x207)]||_0x2b6231[_0x5d49da(0x20a)][_0x5d49da(0x246)])+'\x27');return _0xe89e1b['id'];}};try{const _0x2e41b0=await a36_0x46dd4c(_0x345219[_0x3b4d8e(0x255)],_0x5c1555,_0x157770),_0x4d45bd=_0xf7430e||_0x2ec87b;_0x4d45bd&&(_0x2e41b0[_0x3b4d8e(0x1f7)]={'parentFolder':{'data':{'id':_0x4d45bd,'type':_0x3b4d8e(0x215)}}});if(_0x345219[_0x3b4d8e(0x1f4)]){if(_0xfe395a[_0x3b4d8e(0x202)]>0x0||_0x11dc2d[_0x3b4d8e(0x202)]>0x0){const _0x204eb3=JSON[_0x3b4d8e(0x2b7)](JSON[_0x3b4d8e(0x23a)](_0x2e41b0));ensureJourneyDefaults(_0x204eb3[_0x3b4d8e(0x20a)]);for(const _0x564512 of _0x204eb3[_0x3b4d8e(0x20a)][_0x3b4d8e(0x216)]){_0x564512[_0x3b4d8e(0x2b4)]?.[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x564512['entryCriteria']['segmentId'])&&delete _0x564512[_0x3b4d8e(0x2b4)];if(_0x564512['steps'])for(const _0x30a7ba of Object[_0x3b4d8e(0x1f0)](_0x564512[_0x3b4d8e(0x2ce)])){const _0x3ce309=_0x564512[_0x3b4d8e(0x2ce)][_0x30a7ba];_0x3ce309[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x22c)&&_0x3ce309[_0x3b4d8e(0x27a)]&&isPendingActivationId(_0x3ce309[_0x3b4d8e(0x27a)])&&(_0x3ce309[_0x3b4d8e(0x27a)]='');if(_0x3ce309[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x2c7)&&_0x3ce309['branches'])for(const _0x29b0a1 of _0x3ce309[_0x3b4d8e(0x1fd)]){_0x29b0a1[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x29b0a1[_0x3b4d8e(0x218)])&&(_0x29b0a1['segmentId']='');}}}_0x20a340[_0x3b4d8e(0x235)]&&console['error'](_0x3b4d8e(0x1f5)+JSON['stringify'](_0x204eb3,null,0x2));const _0x5e0f4a=await _0x1789c1[_0x3b4d8e(0x241)][_0x3b4d8e(0x203)](_0x204eb3),_0x184241=_0x5e0f4a['id'],_0x83f032=new Map();for(const _0x4ffc52 of _0x5e0f4a[_0x3b4d8e(0x20a)]['journeyStages']){_0x83f032[_0x3b4d8e(0x23d)](_0x4ffc52[_0x3b4d8e(0x246)]['toLowerCase'](),_0x4ffc52['id']);}const _0x5bb0cc=new Map();for(const [_0x269c39,{definition:_0x2183e5,criteriaName:_0x385a96}]of _0xfe395a){const _0x407677=generateJourneyLocalName(_0x385a96)||'journey_entry_criteria_'+crypto[_0x3b4d8e(0x21b)]();_0x20a340[_0x3b4d8e(0x235)]&&console['error'](_0x3b4d8e(0x22f)+_0x269c39+_0x3b4d8e(0x273)+_0x407677+_0x3b4d8e(0x2ca)+_0x184241);const _0x501f89=await _0x1789c1[_0x3b4d8e(0x2c3)][_0x3b4d8e(0x205)]({'name':_0x407677,'description':_0x2183e5[_0x3b4d8e(0x27b)]||'Entry\x20criteria:\x20'+_0x269c39,'journeyId':_0x184241,'rule':yamlRuleToApi(_0x2183e5['rule'],!![]),'countPopulation':!![],'parentFolderId':_0x4d45bd||'','audienceId':_0x5c1555});_0x5bb0cc['set'](_0x269c39,_0x501f89),_0x26d46e[_0x3b4d8e(0x23d)](_0x269c39,_0x501f89),_0x20a340[_0x3b4d8e(0x235)]&&console[_0x3b4d8e(0x2a7)](_0x3b4d8e(0x264)+_0x269c39+_0x3b4d8e(0x24b)+_0x501f89);}const _0x3b34dd=new Map();for(const [_0x56d005,_0x269414]of _0x11dc2d){_0x20a340['verbose']&&console['error'](_0x3b4d8e(0x1fe)+_0x56d005+'\x27\x20with\x20journeyId:\x20'+_0x184241);try{const _0x2704b8=await yamlActivationToCreateRequest(_0x269414,_0x16b623),_0x524aee=await _0x1789c1['journey'][_0x3b4d8e(0x2ac)](_0x184241,_0x2704b8);_0x3b34dd[_0x3b4d8e(0x23d)](_0x56d005,_0x524aee['id']),_0x21d4d7[_0x3b4d8e(0x23d)](_0x56d005,_0x524aee['id']),_0x20a340[_0x3b4d8e(0x235)]&&console['error']('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x56d005+_0x3b4d8e(0x24b)+_0x524aee['id']);}catch(_0x1bae0e){throw new SDKError(ErrorCode[_0x3b4d8e(0x2e4)],_0x3b4d8e(0x2d6)+_0x56d005+_0x3b4d8e(0x2aa)+getErrorMessage(_0x1bae0e),_0x1bae0e);}}const _0x612f31=JSON[_0x3b4d8e(0x2b7)](JSON[_0x3b4d8e(0x23a)](_0x2e41b0));_0x612f31['id']=_0x184241,ensureJourneyDefaults(_0x612f31[_0x3b4d8e(0x20a)]);for(const _0x1775b3 of _0x612f31['attributes']['journeyStages']){const _0x4123c0=_0x83f032['get'](_0x1775b3[_0x3b4d8e(0x246)][_0x3b4d8e(0x263)]());_0x4123c0&&(_0x1775b3['id']=_0x4123c0);if(_0x1775b3[_0x3b4d8e(0x2b4)]?.[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x1775b3['entryCriteria'][_0x3b4d8e(0x218)])){const _0x418fab=extractPendingSegmentName(_0x1775b3[_0x3b4d8e(0x2b4)][_0x3b4d8e(0x218)]),_0x253312=_0x5bb0cc[_0x3b4d8e(0x269)](_0x418fab);_0x253312&&(_0x1775b3['entryCriteria']['segmentId']=_0x253312);}if(_0x1775b3['steps']){const _0x1293de=_0x126805=>_0x2e41b0[_0x3b4d8e(0x20a)][_0x3b4d8e(0x216)][_0x3b4d8e(0x259)](_0x4de781=>_0x4de781[_0x3b4d8e(0x246)][_0x3b4d8e(0x263)]()===_0x1775b3[_0x3b4d8e(0x246)][_0x3b4d8e(0x263)]())?.[_0x3b4d8e(0x2ce)]?.[_0x126805];for(const _0x1ca792 of Object['keys'](_0x1775b3['steps'])){const _0x77cfeb=_0x1775b3[_0x3b4d8e(0x2ce)][_0x1ca792],_0x32510e=_0x1293de(_0x1ca792);if(_0x77cfeb[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x22c)&&_0x77cfeb[_0x3b4d8e(0x27a)]&&(isPendingActivationId(_0x77cfeb[_0x3b4d8e(0x27a)])||_0x77cfeb[_0x3b4d8e(0x27a)]==='')){if(_0x32510e?.[_0x3b4d8e(0x27a)]&&isPendingActivationId(_0x32510e['journeyActivationStepId'])){const _0x5a8b4b=extractPendingActivationName(_0x32510e['journeyActivationStepId']),_0x4b4667=_0x3b34dd[_0x3b4d8e(0x269)](_0x5a8b4b);_0x4b4667&&(_0x77cfeb[_0x3b4d8e(0x27a)]=_0x4b4667);}}if(_0x77cfeb[_0x3b4d8e(0x22e)]===_0x3b4d8e(0x2c7)&&_0x77cfeb[_0x3b4d8e(0x1fd)]&&_0x32510e?.[_0x3b4d8e(0x1fd)])for(let _0x3fb4a0=0x0;_0x3fb4a0<_0x77cfeb[_0x3b4d8e(0x1fd)][_0x3b4d8e(0x281)];_0x3fb4a0++){const _0x435b2d=_0x77cfeb[_0x3b4d8e(0x1fd)][_0x3fb4a0],_0x20a4b2=_0x32510e[_0x3b4d8e(0x1fd)][_0x3fb4a0];if(_0x20a4b2?.[_0x3b4d8e(0x218)]&&isPendingSegmentId(_0x20a4b2[_0x3b4d8e(0x218)])){const _0x887544=extractPendingSegmentName(_0x20a4b2['segmentId']),_0x188801=_0x5bb0cc['get'](_0x887544);_0x188801&&(_0x435b2d[_0x3b4d8e(0x218)]=_0x188801);}}}}}return _0x20a340['verbose']&&console[_0x3b4d8e(0x2a7)]('\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20'+JSON[_0x3b4d8e(0x23a)](_0x612f31,null,0x2)),await _0x1789c1[_0x3b4d8e(0x241)]['update'](_0x184241,_0x612f31),{'action':'created','name':_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)],'journeyId':_0x184241};}else{ensureJourneyDefaults(_0x2e41b0['attributes']);_0x20a340['verbose']&&console[_0x3b4d8e(0x2a7)]('\x20\x20Journey\x20API\x20request:\x20'+JSON[_0x3b4d8e(0x23a)](_0x2e41b0,null,0x2));const _0x2c263b=await _0x1789c1[_0x3b4d8e(0x241)][_0x3b4d8e(0x203)](_0x2e41b0);return{'action':'created','name':_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)],'journeyId':_0x2c263b['id']};}}else{if(_0x345219[_0x3b4d8e(0x234)]&&_0x345219[_0x3b4d8e(0x2a1)])return ensureJourneyDefaults(_0x2e41b0[_0x3b4d8e(0x20a)]),await _0x1789c1['journey']['update'](_0x345219[_0x3b4d8e(0x2a1)]['id'],_0x2e41b0),{'action':_0x3b4d8e(0x229),'name':_0x345219[_0x3b4d8e(0x255)][_0x3b4d8e(0x246)],'journeyId':_0x345219['existingJourney']['id']};}return{'action':'unchanged','name':_0x345219['yamlConfig'][_0x3b4d8e(0x246)],'journeyId':_0x345219[_0x3b4d8e(0x2a1)]?.['id']};}catch(_0x5dc05d){const _0x263efa=isHttp400Error(_0x5dc05d),_0x312bd4=_0x263efa?ErrorCode[_0x3b4d8e(0x24d)]:ErrorCode[_0x3b4d8e(0x2e4)],_0x10811a=getErrorMessage(_0x5dc05d);throw new SDKError(_0x312bd4,'Failed\x20to\x20'+(_0x345219[_0x3b4d8e(0x1f4)]?_0x3b4d8e(0x203):'update')+'\x20journey\x20from\x20file:\x20'+_0x345219[_0x3b4d8e(0x2a6)]+'\x0a\x20\x20'+_0x10811a,_0x5dc05d);}}));_0x11fddb[_0x3a189d(0x210)](..._0x12bafe),_0x21d94a+=_0x27aad0['length'],_0x36d365['setExtra']('('+_0x21d94a+'/'+_0x2ed3cc['length']+')');}return _0x11fddb;},{'verbose':_0x20a340[_0x463af4(0x235)]});for(const _0x895676 of _0x5cc12d[_0x463af4(0x228)]){if(_0x895676[_0x463af4(0x239)]===_0x463af4(0x253))console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x29c)](_0x463af4(0x1ff)+_0x895676[_0x463af4(0x246)]+'\x27')),_0xf8126b++;else _0x895676[_0x463af4(0x239)]==='updated'&&(console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x27c)+_0x895676[_0x463af4(0x246)]+'\x27')),_0x49b210++);}if(_0xb58b48&&_0x5cc12d[_0x463af4(0x228)][_0x463af4(0x281)]===0x1){const _0x3ea8df=_0x5cc12d[_0x463af4(0x228)][0x0];if(_0x3ea8df[_0x463af4(0x2d8)]){const _0x4de8b7=getConsoleNextUrl(_0x20a340['site'],'/app/ps/'+_0x5c1555+_0x463af4(0x2d7)+_0x3ea8df[_0x463af4(0x2d8)]+'/j/da/je');console[_0x463af4(0x2a7)]('\x20\x20'+a36_0x55ad09[_0x463af4(0x26a)](_0x4de8b7));}}}for(const _0x2039db of _0x3d4c25){console[_0x463af4(0x2a7)](a36_0x55ad09[_0x463af4(0x237)](_0x463af4(0x297)+_0x2039db[_0x463af4(0x207)])),_0x4d7f5c++;}const _0x56edc4=[];if(_0x3448f7>0x0)_0x56edc4[_0x463af4(0x210)](_0x3448f7+_0x463af4(0x232));if(_0x4b4fc2>0x0)_0x56edc4[_0x463af4(0x210)](_0x4b4fc2+_0x463af4(0x28a));if(_0x18421c>0x0)_0x56edc4['push'](_0x18421c+_0x463af4(0x278));const _0x15105b=[];if(_0xf8126b>0x0)_0x15105b[_0x463af4(0x210)](_0xf8126b+'\x20created');if(_0x49b210>0x0)_0x15105b['push'](_0x49b210+_0x463af4(0x28a));if(_0x4d7f5c>0x0)_0x15105b[_0x463af4(0x210)](_0x4d7f5c+_0x463af4(0x278));const _0x2d01b5=[];if(_0x233b1b>0x0)_0x2d01b5[_0x463af4(0x210)](_0x233b1b+'\x20created');if(_0xdeba32>0x0)_0x2d01b5[_0x463af4(0x210)](_0xdeba32+_0x463af4(0x28a));if(_0x3441e2>0x0)_0x2d01b5[_0x463af4(0x210)](_0x3441e2+'\x20deleted');return console[_0x463af4(0x2a7)](a36_0x55ad09['green'](_0x463af4(0x2b2))),_0x56edc4[_0x463af4(0x281)]>0x0&&!_0x20a340['journeysOnly']&&console[_0x463af4(0x2a7)](_0x463af4(0x2c8)+_0x56edc4[_0x463af4(0x20c)](',\x20')),_0x15105b[_0x463af4(0x281)]>0x0&&console[_0x463af4(0x2a7)](_0x463af4(0x29d)+_0x15105b[_0x463af4(0x20c)](',\x20')),_0x2d01b5['length']>0x0&&!_0x20a340[_0x463af4(0x267)]&&console['error'](_0x463af4(0x201)+_0x2d01b5[_0x463af4(0x20c)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x2ebee9){const _0x3c0df3=a36_0xb9787e,_0x4ae849=new Map(),_0x103ecf=new Map();for(const _0x5b91c4 of _0x2ebee9){_0x103ecf['set'](_0x5b91c4['id'],_0x5b91c4);}const _0x3c203c=new Set();for(const _0x1d89ff of _0x2ebee9){!_0x1d89ff[_0x3c0df3(0x212)]&&_0x3c203c[_0x3c0df3(0x252)](_0x1d89ff['id']);}function _0x66ff67(_0x50b6ba){const _0x2bf44d=_0x3c0df3;if(_0x3c203c['has'](_0x50b6ba['id']))return'';if(_0x50b6ba[_0x2bf44d(0x212)]){const _0x4ccdc1=_0x103ecf['get'](_0x50b6ba['parentFolderId']);if(_0x4ccdc1){const _0x3754e8=_0x66ff67(_0x4ccdc1);return _0x3754e8?_0x3754e8+'/'+_0x50b6ba[_0x2bf44d(0x246)]:_0x50b6ba[_0x2bf44d(0x246)];}}return _0x50b6ba[_0x2bf44d(0x246)];}for(const _0x413bf8 of _0x2ebee9){const _0x127b73=_0x66ff67(_0x413bf8);_0x4ae849[_0x3c0df3(0x23d)](_0x127b73,_0x413bf8['id']);}return _0x4ae849;}function findYamlFiles(_0x48e3b7){const _0x2b785a=[];function _0x5e394b(_0x3cd1b1){const _0x46c350=a36_0x5329,_0x566d70=readdirSync(_0x3cd1b1,{'withFileTypes':!![]});for(const _0x4ea177 of _0x566d70){const _0x17b437=a36_0x5e769c[_0x46c350(0x20c)](_0x3cd1b1,_0x4ea177[_0x46c350(0x246)]);if(_0x4ea177['isDirectory']())_0x5e394b(_0x17b437);else(_0x4ea177[_0x46c350(0x246)]['endsWith']('.yml')||_0x4ea177[_0x46c350(0x246)][_0x46c350(0x213)](_0x46c350(0x2c1)))&&_0x2b785a[_0x46c350(0x210)](_0x17b437);}}return _0x5e394b(_0x48e3b7),_0x2b785a;}function calculateActivationActions(_0x51c1a9,_0x50f6ff,_0x1ca9a4,_0x25fb33){const _0x1065d6=a36_0xb9787e,_0x2cbda9=[],_0x4ef866=new Map();for(const _0x349f45 of _0x50f6ff){_0x4ef866[_0x1065d6(0x23d)](_0x349f45[_0x1065d6(0x246)],_0x349f45);}const _0xb61535=new Map();for(const _0x3342a6 of _0x51c1a9){_0xb61535[_0x1065d6(0x23d)](_0x3342a6['name'],_0x3342a6);}for(const _0x827540 of _0x51c1a9){const _0x42a70c=_0x4ef866[_0x1065d6(0x269)](_0x827540[_0x1065d6(0x246)]);if(!_0x42a70c)_0x2cbda9[_0x1065d6(0x210)]({'type':_0x1065d6(0x203),'name':_0x827540[_0x1065d6(0x246)],'yamlActivation':_0x827540});else{const _0x35c6ae=activationToYaml(_0x42a70c,_0x1ca9a4,_0x25fb33),_0x23d18b=a36_0x14c597[_0x1065d6(0x23a)](_0x35c6ae),_0x33bde0=a36_0x14c597[_0x1065d6(0x23a)](_0x827540);_0x23d18b!==_0x33bde0&&_0x2cbda9[_0x1065d6(0x210)]({'type':'update','name':_0x827540['name'],'yamlActivation':_0x827540,'existingActivation':_0x42a70c});}}for(const _0xbecf6e of _0x50f6ff){!_0xb61535['has'](_0xbecf6e[_0x1065d6(0x246)])&&_0x2cbda9['push']({'type':_0x1065d6(0x236),'name':_0xbecf6e[_0x1065d6(0x246)],'existingActivation':_0xbecf6e});}return _0x2cbda9;}
1
+ const a36_0x678b6b=a36_0x4aa3;(function(_0x1f9dbd,_0x48f377){const _0x13629e=a36_0x4aa3,_0x541aff=_0x1f9dbd();while(!![]){try{const _0x1222fc=parseInt(_0x13629e(0x23b))/0x1*(-parseInt(_0x13629e(0x25d))/0x2)+parseInt(_0x13629e(0x221))/0x3+-parseInt(_0x13629e(0x205))/0x4+parseInt(_0x13629e(0x1f3))/0x5*(-parseInt(_0x13629e(0x201))/0x6)+parseInt(_0x13629e(0x2cc))/0x7+-parseInt(_0x13629e(0x1fa))/0x8+parseInt(_0x13629e(0x1f0))/0x9*(parseInt(_0x13629e(0x2ac))/0xa);if(_0x1222fc===_0x48f377)break;else _0x541aff['push'](_0x541aff['shift']());}catch(_0x25942a){_0x541aff['push'](_0x541aff['shift']());}}}(a36_0x5d0b,0x93b83));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,journeyActivationStepToYaml,activationToYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,resolveRuleSegmentRefs}from'../sdk/segment/child-segment-yaml.js';import{isJourneyYaml,parseYamlString as a36_0x143775,yamlToApi as a36_0x211d32,toYamlString as a36_0x58d156,apiToYamlAsync,hasMultipleVersions,normalizeJourneyYaml}from'../sdk/segment/journey-yaml.js';function a36_0x4aa3(_0x567463,_0x284c94){_0x567463=_0x567463-0x1c4;const _0x5d0be1=a36_0x5d0b();let _0x4aa37c=_0x5d0be1[_0x567463];return _0x4aa37c;}function a36_0x5d0b(){const _0x461b7f=['\x20journey\x20from\x20file:\x20','isDirectory','stages','exitCriterias','40275PBGhgK','get','max','\x20activations]','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','config','\x20YAML\x20files\x20found','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Pushing\x20journeys...','/app/ps/','add','Fetching\x20parent\x20segment\x20details...','stringify','\x20folders\x20to\x20create','error','toLowerCase','journeysOnly','createJourneySegment','\x27\x20details...','βœ”\x20Created\x20folder\x20\x27','dirname','createActivation','Creating\x20folder\x20\x27','getOutputSchemaWithCache','entryCriteria','βœ”\x20Created\x20segment\x20\x27','3341KPuDVt','Error:\x20Directory\x20not\x20found:\x20','segment:push','Activation','\x20to\x20delete','unchanged','\x27\x20(internal:\x20','folderId','\x20\x20Step\x201:\x20Creating\x20journey\x20without\x20entry\x20criteria:\x20','replace','parentSegmentFolder','Deleting\x20activation\x20\x27','randomUUID','yamlConfig','goal\x20criteria','repeat','journey_entry_criteria_','red','journeyId','parent_segment','\x27\x20v','yes','Fetching\x20existing\x20folders...','folderPath','cyan','Creating','\x20\x20Activations:','\x20\x20Step\x203:\x20Updating\x20journey\x20with\x20entry\x20criteria\x20and\x20activation\x20IDs:\x20','list','\x20\x20Created\x20embedded\x20segment\x20\x27','updated','endsWith',')\x20with\x20ID:\x20','journeys','716GrjPbH','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)','πŸ“\x20','segments','DecisionPoint','stage\x20\x27','Deleting\x20segment\x20\x27','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20Created\x20embedded\x20activation\x20\x27','Scoped\x20to\x20folder:\x20','\x20\x20Activations:\x20','JOURNEY_SYNTAX_ERROR','NOT_FOUND','with','INTERNAL','conditions[','join','journeyActivationStepId','Segment\x20not\x20found:\x20','existingActivation','Push\x20','\x27\x20with\x20ID:\x20','\x20deleted','Fetching\x20users\x20for\x20email\x20resolution...','decision_point','string','activations','journeyBundleName','toString','SEGMENT_UPDATE_ERROR','isArray','absolutePath','\x20\x20βœ”\x20Deleted\x20activation\x20\x27','exitCriteria','push','\x27\x20from\x20file:\x20','ACTIVATION_SYNTAX_ERROR','include','slice','\x20segment\x20from\x20file:\x20','name','getSegment','parse','Activation\x20not\x20found:\x20','has','description','.yml','\x27\x20decision\x20point\x20branch\x20\x27','Site:\x20','\x20to\x20update','split','\x20\x20\x20\x20','versionNumber','Failed\x20to\x20','buildUserMaps','No\x20','entry','dim','attribute','startsWith','Please\x20specify\x20a\x20valid\x20attribute\x20name.','\x20activation\x20\x27','New\x20segment:','data','size','(Journey\x20will\x20be\x20deleted)','resolveSegment','sort','existingSegment','Fetching\x20existing\x20activations...',').\x20','update','map','parentFolderId','relationships','resolve','Source\x20directory:\x20','JOURNEY_UPDATE_ERROR','Fetching\x20connections\x20for\x20name\x20resolution...','124130gmzgvA','steps','values','listSegments','parentFolder','\x0aβœ”\x20Push\x20complete','verbose','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resolveJourneyId','segmentId','segmentFolderId','Failed\x20to\x20create\x20embedded\x20activation\x20\x27','attributes','connection','waitCondition','\x20updated','created','listActivations','segment\x20or\x20journey','dryRun','Error\x20parsing\x20','__pending_','Changes\x20to:','execute','Failed\x20to\x20create\x20embedded\x20segment\x20\x27','listJourneysFromParentSegment','yamlActivation','\x20unchanged','\x20\x20Journeys:\x20','Delete\x20segment:','/j/da/je','delete','2452464nKlRZY','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','state','journey','Creating\x20segment\x20\x27','\x20\x20βœ”\x20Updated\x20activation\x20\x27','existingJourney','\x20changed','setExtra','\x20\x20Step\x202:\x20Creating\x20embedded\x20segment\x20\x27','site','item','green','configDir','rule','Changes\x20to\x20journey:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','find','\x20\x20Or\x20set\x20context:\x20`tdx\x20sg\x20use\x20<parent_name>`','activationActions','createSegment','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20new','getJourney','\x20\x20Source:\x20','forEach','...','createFolder','\x20\x20βœ”\x20Created\x20activation\x20\x27','conditions','segment','New\x20journey:','\x27\x20with\x20journeyId:\x20','\x27\x20entry\x20criteria','\x0a\x20\x20','SEGMENT_SYNTAX_ERROR','getActivation','goal','listFolders',')\x20with\x20journeyId:\x20','Fetching\x20existing\x20journeys...','\x20\x20Segments:\x20','entries','SEGMENT_NOT_FOUND','create','branches','\x20(referenced\x20in\x20journey\x20','βœ”\x20Updated\x20segment\x20\x27','set','βœ”\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Fetching\x20journey\x20\x27','\x20created','2637sJiFDH','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x27\x20not\x20found\x20in\x20journey\x20\x27','1775zGSFEp','entry_criteria','resolveParentId','journeyStages','exclude','action','milestone','5231632kGCOJr','activationParams','βœ”\x20Created\x20journey\x20\x27','Fetching\x20existing\x20segments...','Updating\x20segment\x20\x27','updateActivation','length','6792cddmgD','all','yellow','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','4575340pVQdZZ','filter','isFile','\x27...','\x20\x20⚠\x20Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','hasChanges','validatedRequest','cwd','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','isNew','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Journey\x20\x27','Entry\x20criteria:\x20','type','relative','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','diff','Parent\x20segment:\x20','getParent','blue','/e/','\x20\x20Journey\x20API\x20request:\x20','ACTIVATION_UPDATE_ERROR','\x27:\x20'];a36_0x5d0b=function(){return _0x461b7f;};return a36_0x5d0b();}import a36_0x3a84f9 from'chalk';import{existsSync,readFileSync,statSync,readdirSync}from'fs';import a36_0x14a858 from'path';import{getConsoleNextUrl}from'../types/endpoints.js';import*as a36_0x1dad46 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_0x678b6b(0x2c1);function collectSegmentRefsFromRule(_0xa84b1d){const _0x449c5c=[],_0x2b803b=_0x5dc189=>{const _0x59951c=a36_0x4aa3;if(!_0x5dc189||typeof _0x5dc189!=='object')return;if(Array[_0x59951c(0x27b)](_0x5dc189)){_0x5dc189[_0x59951c(0x1d5)](_0x2b803b);return;}const _0x2ea107=_0x5dc189;(_0x2ea107[_0x59951c(0x212)]===_0x59951c(0x282)||_0x2ea107[_0x59951c(0x212)]===_0x59951c(0x1f7))&&typeof _0x2ea107[_0x59951c(0x1da)]===_0x59951c(0x276)&&_0x449c5c[_0x59951c(0x27f)](_0x2ea107[_0x59951c(0x1da)]);for(const _0x2bcdb8 of Object['values'](_0x2ea107)){_0x2b803b(_0x2bcdb8);}};return _0x2b803b(_0xa84b1d),_0x449c5c;}function collectSegmentIdsFromJourneyApi(_0x182dfb){const _0x145316=a36_0x678b6b,_0x47f89f=new Set();_0x182dfb[_0x145316(0x2b8)]['goal']?.['segmentId']&&_0x47f89f[_0x145316(0x22b)](_0x182dfb['attributes'][_0x145316(0x1e1)]['segmentId']);const _0x321471=_0x182dfb[_0x145316(0x2b8)][_0x145316(0x1f6)];if(Array[_0x145316(0x27b)](_0x321471))for(const _0x4bc54f of _0x321471){_0x4bc54f[_0x145316(0x239)]?.[_0x145316(0x2b5)]&&_0x47f89f[_0x145316(0x22b)](_0x4bc54f['entryCriteria']['segmentId']);if(Array[_0x145316(0x27b)](_0x4bc54f[_0x145316(0x27e)]))for(const _0x143044 of _0x4bc54f['exitCriteria']){_0x143044[_0x145316(0x2b5)]&&_0x47f89f['add'](_0x143044['segmentId']);}_0x4bc54f[_0x145316(0x1f9)]?.['segmentId']&&_0x47f89f[_0x145316(0x22b)](_0x4bc54f[_0x145316(0x1f9)][_0x145316(0x2b5)]);if(Array[_0x145316(0x27b)](_0x4bc54f['steps']))for(const _0xdfbeb0 of _0x4bc54f['steps']){_0xdfbeb0[_0x145316(0x2ba)]?.[_0x145316(0x2b5)]&&_0x47f89f[_0x145316(0x22b)](_0xdfbeb0[_0x145316(0x2ba)][_0x145316(0x2b5)]);if(Array[_0x145316(0x27b)](_0xdfbeb0[_0x145316(0x1e9)]))for(const _0x15e055 of _0xdfbeb0[_0x145316(0x1e9)]){_0x15e055['segmentId']&&_0x47f89f[_0x145316(0x22b)](_0x15e055[_0x145316(0x2b5)]);}}}return _0x47f89f;}function validateSegmentRule(_0x1ce3ab,_0x842c5d){const _0x223ffc=a36_0x678b6b;if(!_0x842c5d||!_0x842c5d['conditions'])return;for(let _0x404444=0x0;_0x404444<_0x842c5d[_0x223ffc(0x1d9)][_0x223ffc(0x200)];_0x404444++){const _0x83960a=_0x842c5d[_0x223ffc(0x1d9)][_0x404444];if('type'in _0x83960a&&_0x83960a[_0x223ffc(0x212)]==='Value'){const _0x11215d=_0x83960a;if(!_0x11215d['attribute']||_0x11215d[_0x223ffc(0x297)]==='')throw new SDKError(ErrorCode[_0x223ffc(0x268)],_0x223ffc(0x20d)+_0x1ce3ab+'\x27:\x20'+(_0x223ffc(0x26c)+_0x404444+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x223ffc(0x299));}}}function createPendingSegmentId(_0x4b6d53){return''+PENDING_SEGMENT_PREFIX+_0x4b6d53+'__';}function isPendingSegmentId(_0x1528b0){const _0x45bbb2=a36_0x678b6b;return _0x1528b0[_0x45bbb2(0x298)](PENDING_SEGMENT_PREFIX);}function extractPendingSegmentName(_0x390301){const _0x353c46=a36_0x678b6b;return _0x390301[_0x353c46(0x244)](/^__pending_(.+)__$/,'$1');}const PENDING_ACTIVATION_PREFIX='__pending_act_';function createPendingActivationId(_0x1f821a){return''+PENDING_ACTIVATION_PREFIX+_0x1f821a+'__';}function isPendingActivationId(_0x3c6421){const _0x4d748a=a36_0x678b6b;return _0x3c6421[_0x4d748a(0x298)](PENDING_ACTIVATION_PREFIX);}function extractPendingActivationName(_0x4944d0){const _0x415e33=a36_0x678b6b;return _0x4944d0[_0x415e33(0x244)](/^__pending_act_(.+)__$/,'$1');}function ensureJourneyDefaults(_0x4e728c){const _0xa5b66f=a36_0x678b6b;!_0x4e728c['description']&&(_0x4e728c[_0xa5b66f(0x28a)]=''),!_0x4e728c['state']&&(_0x4e728c[_0xa5b66f(0x2ce)]='draft');}function tryFindTdxConfig(_0x5a32a3){try{return findTdxConfig(_0x5a32a3);}catch{return null;}}function resolveTDFolderPath(_0x32a45e,_0x581959,_0x297400){if(!_0x581959)return _0x32a45e;return _0x32a45e?_0x297400+'/'+_0x32a45e:_0x297400;}export class SegmentPushCommand extends BaseCommand{[a36_0x678b6b(0x285)]=a36_0x678b6b(0x23d);[a36_0x678b6b(0x28a)]=a36_0x678b6b(0x264);async[a36_0x678b6b(0x2c3)](_0x45a164){const _0x56e0b9=a36_0x678b6b,{options:_0x5c9633,args:_0x51a75c,tdx:_0x461780}=_0x45a164,_0x2adbbb=_0x5c9633,_0x3dbc67=_0x5c9633['parentSegment'],_0x3a6be4=_0x51a75c[0x0];let _0x33bb53,_0x46dc08,_0xa531b,_0x48fc76;if(_0x3a6be4){if(existsSync(_0x3a6be4)&&statSync(_0x3a6be4)['isDirectory']()){const _0x4417a7=tryFindTdxConfig(_0x3a6be4);if(_0x4417a7)_0x33bb53=_0x4417a7[_0x56e0b9(0x226)]['parent_segment'],_0x46dc08=_0x3a6be4,_0xa531b=_0x4417a7[_0x56e0b9(0x1c9)];else{if(_0x3dbc67)_0x33bb53=_0x3dbc67,_0x46dc08=_0x3a6be4;else return console['error'](a36_0x3a84f9[_0x56e0b9(0x24c)](_0x56e0b9(0x228)+_0x3a6be4+'\x0a')),console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x253)](_0x56e0b9(0x1f1))),console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x253)](_0x56e0b9(0x1ce))),0x1;}}else{if(existsSync(_0x3a6be4)&&statSync(_0x3a6be4)[_0x56e0b9(0x207)]()){const _0x58b0e9=a36_0x14a858['dirname'](_0x3a6be4),_0x28bacc=tryFindTdxConfig(_0x58b0e9);if(_0x28bacc)_0x33bb53=_0x28bacc[_0x56e0b9(0x226)][_0x56e0b9(0x24e)],_0xa531b=_0x28bacc['configDir'],_0x46dc08=_0x28bacc['configDir'],_0x48fc76=a36_0x14a858[_0x56e0b9(0x2a8)](_0x3a6be4);else{if(_0x3dbc67)_0x33bb53=_0x3dbc67,_0x46dc08=_0x58b0e9,_0x48fc76=a36_0x14a858[_0x56e0b9(0x2a8)](_0x3a6be4);else return console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x24c)](_0x56e0b9(0x228)+_0x58b0e9+'\x0a')),console['error'](a36_0x3a84f9[_0x56e0b9(0x253)](_0x56e0b9(0x1f1))),console[_0x56e0b9(0x22f)](a36_0x3a84f9['cyan']('\x20\x20Or\x20set\x20context:\x20`tdx\x20sg\x20use\x20<parent_name>`')),0x1;}}else _0x33bb53=_0x3a6be4;}}else{const _0x18f7de=tryFindTdxConfig(process[_0x56e0b9(0x20c)]());_0x18f7de?(_0x33bb53=_0x18f7de[_0x56e0b9(0x226)][_0x56e0b9(0x24e)],_0x46dc08=process[_0x56e0b9(0x20c)](),_0xa531b=_0x18f7de[_0x56e0b9(0x1c9)]):_0x33bb53=_0x3dbc67;}if(!_0x33bb53)return console['error'](a36_0x3a84f9[_0x56e0b9(0x203)](_0x56e0b9(0x2b3))),console['error'](_0x56e0b9(0x25e)),console[_0x56e0b9(0x22f)](_0x56e0b9(0x214)),console[_0x56e0b9(0x22f)](_0x56e0b9(0x2cd)),0x1;const _0x355e6a=_0x46dc08||getSegmentRootDir(sanitizeFileName(_0x33bb53)),_0x134c5b=_0xa531b||_0x355e6a,_0x272c17=a36_0x14a858[_0x56e0b9(0x213)](_0x134c5b,_0x355e6a),_0x5b6a11=_0x272c17!==''&&_0x272c17!=='.';if(!existsSync(_0x355e6a))return console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x24c)](_0x56e0b9(0x23c)+_0x355e6a+'\x0a')),console[_0x56e0b9(0x22f)](a36_0x3a84f9['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x2adbbb['verbose']&&(console[_0x56e0b9(0x22f)](_0x56e0b9(0x28d)+_0x2adbbb[_0x56e0b9(0x1c6)]),console['error'](_0x56e0b9(0x216)+_0x33bb53),console[_0x56e0b9(0x22f)](_0x56e0b9(0x2a9)+_0x355e6a),_0x5b6a11&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x266)+_0x272c17));const _0xe4ec98=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x33bb53+_0x56e0b9(0x208),()=>_0x461780[_0x56e0b9(0x1da)][_0x56e0b9(0x1f5)](_0x33bb53),{'verbose':_0x2adbbb['verbose']}),_0x1e7a88=_0xe4ec98[_0x56e0b9(0x29c)],[_0x27b131,_0x1ea181,_0x3352c1,_0x24d737,_0xd1badd]=await Promise[_0x56e0b9(0x202)]([withSpinner(_0x56e0b9(0x22c),()=>_0x461780[_0x56e0b9(0x1da)][_0x56e0b9(0x217)](_0x1e7a88),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]}),withSpinner(_0x56e0b9(0x1fd),()=>_0x461780[_0x56e0b9(0x1da)][_0x56e0b9(0x2af)](_0x1e7a88),{'verbose':_0x2adbbb['verbose']}),withSpinner(_0x56e0b9(0x251),()=>_0x461780['segment'][_0x56e0b9(0x1e2)](_0x1e7a88),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]}),withSpinner(_0x56e0b9(0x1e4),()=>_0x461780[_0x56e0b9(0x2cf)][_0x56e0b9(0x2c5)](_0x1e7a88),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]}),withSpinner(_0x56e0b9(0x274),()=>_0x461780['user'][_0x56e0b9(0x293)](),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]})['then'](_0x390c97=>_0x390c97[_0x56e0b9(0x29c)])]),_0x557728=_0x27b131[_0x56e0b9(0x29c)],_0x26c0fc=_0x557728['relationships']?.[_0x56e0b9(0x245)]?.[_0x56e0b9(0x29c)]?.['id']||_0x557728[_0x56e0b9(0x2a7)]?.[_0x56e0b9(0x2b0)]?.[_0x56e0b9(0x29c)]?.['id'],_0x371a62=_0x1ea181[_0x56e0b9(0x29c)],_0x35729f=_0x3352c1['data'],_0x5bb86c=_0x24d737[_0x56e0b9(0x29c)],{emailToId:_0x2db77a,idToEmail:_0x43925a}=_0xd1badd,[_0x163af2,_0x4da911,_0x38b690]=await withSpinner(_0x56e0b9(0x2ab),async()=>{const _0x2acb44=_0x56e0b9,_0x195375=await _0x461780[_0x2acb44(0x2b9)][_0x2acb44(0x257)](),_0x23f06d=new Map(),_0x16eccf=new Map(),_0x2d3bc7=new Map();for(const _0x2b453a of _0x195375){_0x23f06d[_0x2acb44(0x1ec)](_0x2b453a[_0x2acb44(0x285)],parseInt(_0x2b453a['id'],0xa)),_0x16eccf[_0x2acb44(0x1ec)](_0x2b453a['id'],_0x2b453a['name']),_0x2d3bc7['set'](_0x2b453a[_0x2acb44(0x285)],_0x2b453a[_0x2acb44(0x212)]);}return[_0x23f06d,_0x16eccf,_0x2d3bc7];},{'verbose':_0x2adbbb['verbose']})['then'](_0x538609=>_0x538609[_0x56e0b9(0x29c)]),_0x14bd57={'emailToIdMap':_0x2db77a,'connectionNameToIdMap':_0x163af2,'connectionNameToTypeMap':_0x38b690,'getSchema':_0x3552ab=>_0x461780[_0x56e0b9(0x2b9)][_0x56e0b9(0x238)](_0x3552ab)},_0x41d642=buildFolderPathToIdMap(_0x35729f),_0x548002=new Map();for(const [_0x2981bf,_0x193f98]of _0x41d642[_0x56e0b9(0x1e6)]()){_0x548002[_0x56e0b9(0x1ec)](_0x193f98,_0x2981bf);}const _0x4fb855=new Map();for(const _0x4b835a of _0x371a62){const _0x6eda43=_0x4b835a[_0x56e0b9(0x2b6)]?_0x548002['get'](_0x4b835a[_0x56e0b9(0x2b6)][_0x56e0b9(0x279)]())||'':'',_0x2df190=_0x6eda43+':'+_0x4b835a['name'];_0x4fb855['set'](_0x2df190,_0x4b835a);}const _0x101016=new Map();for(const _0x49d676 of _0x371a62){_0x101016[_0x56e0b9(0x1ec)](_0x49d676[_0x56e0b9(0x285)],_0x49d676['id']);}const _0xff68e2=new Map();for(const _0x28220e of _0x5bb86c){const _0x2d3b5f=_0x28220e[_0x56e0b9(0x242)]?_0x548002[_0x56e0b9(0x222)](_0x28220e[_0x56e0b9(0x242)])||'':'',_0x37e2cd=_0x2d3b5f+':'+_0x28220e[_0x56e0b9(0x278)];!_0xff68e2[_0x56e0b9(0x289)](_0x37e2cd)&&_0xff68e2[_0x56e0b9(0x1ec)](_0x37e2cd,[]),_0xff68e2[_0x56e0b9(0x222)](_0x37e2cd)['push'](_0x28220e);}for(const _0x2b22df of _0xff68e2[_0x56e0b9(0x2ae)]()){_0x2b22df[_0x56e0b9(0x2a0)]((_0x273d9d,_0x2c64da)=>(_0x273d9d[_0x56e0b9(0x291)]||0x0)-(_0x2c64da[_0x56e0b9(0x291)]||0x0));}let _0x4173b1;if(_0x48fc76){if(!_0x48fc76['endsWith'](_0x56e0b9(0x28b))&&!_0x48fc76[_0x56e0b9(0x25a)]('.yaml'))return console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x24c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x48fc76+'\x0a')),0x1;_0x4173b1=[_0x48fc76];}else _0x4173b1=findYamlFiles(_0x355e6a);if(_0x4173b1[_0x56e0b9(0x200)]===0x0)return console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x24c)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x355e6a+'\x0a')),console[_0x56e0b9(0x22f)](a36_0x3a84f9['cyan'](_0x56e0b9(0x1cc))),0x1;const _0x31863a=[],_0x51148f=[];for(const _0x369bb7 of _0x4173b1){const _0x576140=a36_0x14a858[_0x56e0b9(0x213)](_0x355e6a,a36_0x14a858[_0x56e0b9(0x235)](_0x369bb7)),_0x56dc9c=_0x576140==='.'?'':_0x576140,_0x1f795f=readFileSync(_0x369bb7,'utf-8');try{const _0x42886b=a36_0x1dad46[_0x56e0b9(0x287)](_0x1f795f);if(isJourneyYaml(_0x42886b)){const _0x48348c=a36_0x143775(_0x1f795f);_0x51148f[_0x56e0b9(0x27f)]({'yamlConfig':_0x48348c,'folderPath':_0x56dc9c,'sourcePath':_0x369bb7});}else{if(!_0x2adbbb[_0x56e0b9(0x231)]){const _0x55c8d8=parseSegmentYamlFile(_0x1f795f),_0x24aa94=normalizeChildSegmentYaml(_0x55c8d8);_0x31863a[_0x56e0b9(0x27f)]({'yamlConfig':_0x24aa94,'folderPath':_0x56dc9c,'sourcePath':_0x369bb7});}}}catch(_0x2d7338){return console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x24c)](_0x56e0b9(0x2c0)+_0x369bb7+':\x20'+(_0x2d7338 instanceof Error?_0x2d7338['message']:_0x2d7338))),0x1;}}if(_0x31863a[_0x56e0b9(0x200)]===0x0&&_0x51148f[_0x56e0b9(0x200)]===0x0){const _0xe828a3=_0x2adbbb[_0x56e0b9(0x231)]?_0x56e0b9(0x2cf):_0x56e0b9(0x2be);return console['error'](a36_0x3a84f9[_0x56e0b9(0x203)](_0x56e0b9(0x294)+_0xe828a3+_0x56e0b9(0x227))),0x0;}const _0x4cdc1f=new Map();_0x371a62[_0x56e0b9(0x200)]>0x0&&!_0x2adbbb[_0x56e0b9(0x231)]&&await withSpinner(_0x56e0b9(0x2a2),async()=>{await batchAsync(_0x371a62,async _0x5231a6=>{const _0x2642cf=a36_0x4aa3,_0x4975f7=await _0x461780[_0x2642cf(0x1da)][_0x2642cf(0x2bd)](_0x1e7a88,_0x5231a6['id']);_0x4cdc1f[_0x2642cf(0x1ec)](_0x5231a6['id'],_0x4975f7);});},{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]});const _0x796f39=[],_0x59396=new Set();for(const {yamlConfig:_0xe6518,folderPath:_0x16c495,sourcePath:_0x6e3b13}of _0x31863a){const _0x340258=resolveTDFolderPath(_0x16c495,_0x5b6a11,_0x272c17),_0x176a6f=_0x340258+':'+_0xe6518[_0x56e0b9(0x285)],_0x931918=_0x4fb855[_0x56e0b9(0x222)](_0x176a6f),_0x10b1fd=_0x931918?_0x4cdc1f['get'](_0x931918['id'])||[]:[];if(_0x340258&&!_0x41d642['has'](_0x340258)){const _0xe111b5=_0x340258[_0x56e0b9(0x28f)]('/');let _0x5a24a1='';for(const _0x2dca5e of _0xe111b5){_0x5a24a1=_0x5a24a1?_0x5a24a1+'/'+_0x2dca5e:_0x2dca5e,!_0x41d642[_0x56e0b9(0x289)](_0x5a24a1)&&_0x59396[_0x56e0b9(0x22b)](_0x5a24a1);}}const _0x2be797=calculateActivationActions(_0xe6518['activations']||[],_0x10b1fd,_0x43925a,_0x4da911);for(const _0x5019ee of _0x2be797){(_0x5019ee['type']===_0x56e0b9(0x1e8)||_0x5019ee[_0x56e0b9(0x212)]===_0x56e0b9(0x2a4))&&_0x5019ee['yamlActivation']&&(_0x5019ee['validatedRequest']=await yamlActivationToCreateRequest(_0x5019ee[_0x56e0b9(0x2c6)],_0x14bd57));}const _0x231e77=segmentToYamlString(_0xe6518);let _0x56a5d5,_0x1eff5f=![],_0x3e5a8b;if(_0x931918){const _0x44475b=segmentWithActivationsToYaml(_0x931918,_0x10b1fd,undefined,_0x43925a,_0x4da911),_0x27246d=segmentToYamlString(_0x44475b);_0x56a5d5=generateDiff(_0x27246d,_0x231e77),_0x1eff5f=hasChanges(_0x56a5d5),_0x1eff5f&&(_0x3e5a8b=formatDiffWithColors(_0x56a5d5));}else _0x56a5d5=generateDiff('',_0x231e77),_0x3e5a8b=formatDiffWithColors(_0x56a5d5);_0x796f39['push']({'relativePath':_0xe6518['name'],'absolutePath':_0x6e3b13,'yamlConfig':_0xe6518,'folderPath':_0x340258,'existingSegment':_0x931918,'existingActivations':_0x10b1fd,'isNew':!_0x931918,'hasChanges':_0x1eff5f,'diff':_0x3e5a8b,'activationActions':_0x2be797});}let _0x34fc69=[];if(!_0x48fc76){const _0x473a75=new Set();for(const {yamlConfig:_0x3d06e8,folderPath:_0x36a1f6}of _0x31863a){const _0x1085e4=resolveTDFolderPath(_0x36a1f6,_0x5b6a11,_0x272c17);_0x473a75['add'](_0x1085e4+':'+_0x3d06e8[_0x56e0b9(0x285)]);}_0x34fc69=_0x371a62[_0x56e0b9(0x206)](_0xf5f564=>{const _0x1087fa=_0x56e0b9,_0x22207a=_0xf5f564['segmentFolderId']?_0x548002[_0x1087fa(0x222)](_0xf5f564[_0x1087fa(0x2b6)]['toString']())||'':'',_0x317d8a=_0x22207a+':'+_0xf5f564[_0x1087fa(0x285)];if(_0x473a75[_0x1087fa(0x289)](_0x317d8a))return![];if(_0x5b6a11)return _0x22207a===_0x272c17||_0x22207a[_0x1087fa(0x298)](_0x272c17+'/');return!![];});}const _0x2bb2a7=[];for(const {yamlConfig:_0x15e5aa,folderPath:_0x7efb2e,sourcePath:_0x3009a4}of _0x51148f){const _0x1a4d2d=resolveTDFolderPath(_0x7efb2e,_0x5b6a11,_0x272c17),_0x531b01=_0x1a4d2d+':'+_0x15e5aa[_0x56e0b9(0x285)],_0x2d87f2=_0xff68e2[_0x56e0b9(0x222)](_0x531b01);let _0x3a36ad,_0x20a5f2;if(_0x2d87f2&&_0x2d87f2[_0x56e0b9(0x200)]>0x0){const _0x396f2c=new Set(),_0x59836e=new Set(),_0x56e768=new Map(),_0x55acef=new Map(),_0x4cd5ce=createJumpTargetCache(),_0x161540=new Set(),_0x355a67=new Map();if(_0x15e5aa[_0x56e0b9(0x260)])for(const [_0x52580b,_0x5c1dd7]of Object[_0x56e0b9(0x1e6)](_0x15e5aa[_0x56e0b9(0x260)])){_0x161540[_0x56e0b9(0x22b)](_0x52580b);if(_0x5c1dd7[_0x56e0b9(0x1ca)]){const _0x2b644d=yamlRuleToApi(_0x5c1dd7[_0x56e0b9(0x1ca)]),_0x1dcbf3=apiRuleToYaml(_0x2b644d);_0x355a67[_0x56e0b9(0x1ec)](_0x52580b,_0x1dcbf3);}}const _0x58203f=new Map();for(const [_0x19f82c,_0x4ea931]of _0x355a67){const _0x220d45=serializeExpandedRule(_0x4ea931,_0x355a67);!_0x58203f['has'](_0x220d45)&&_0x58203f[_0x56e0b9(0x1ec)](_0x220d45,_0x19f82c);}const _0x45e7f5=new Map(),_0x3159d1=new Map(),_0x59d0ef=new Set(),_0x280c61=async _0x38d8f5=>{const _0x554f5e=_0x56e0b9;if(_0x59d0ef[_0x554f5e(0x289)](_0x38d8f5))return;_0x59d0ef['add'](_0x38d8f5);let _0x4f94f7=_0x371a62[_0x554f5e(0x1cd)](_0x1183d6=>_0x1183d6['id']===_0x38d8f5);if(!_0x4f94f7)try{_0x4f94f7=await _0x461780[_0x554f5e(0x1da)]['getSegment'](_0x1e7a88,_0x38d8f5);}catch{return;}if(_0x4f94f7?.[_0x554f5e(0x1ca)]){const _0x53c06b=apiRuleToYaml(_0x4f94f7['rule']);_0x3159d1[_0x554f5e(0x1ec)](_0x38d8f5,_0x53c06b);const _0x469fd4=collectSegmentRefsFromRule(_0x53c06b);for(const _0x227c1b of _0x469fd4){await _0x280c61(_0x227c1b);}}};for(const _0x3ca687 of _0x2d87f2){const _0x196aa7=await _0x461780[_0x56e0b9(0x2cf)][_0x56e0b9(0x1d3)](_0x3ca687['id']),_0x49a3c6=collectSegmentIdsFromJourneyApi(_0x196aa7);for(const _0x23714d of _0x49a3c6){await _0x280c61(_0x23714d);}}let _0x3c22ca;const _0x3e6b54=_0x5aa6c7=>({'resolveSegment':async _0x14e344=>{const _0x1b1a16=_0x56e0b9,_0x2e5101=_0x55acef['get'](_0x14e344);if(_0x2e5101!==undefined)return{'name':_0x2e5101,'isJourneyLocal':!![]};try{let _0x3b2a18=_0x371a62['find'](_0x497bb5=>_0x497bb5['id']===_0x14e344);!_0x3b2a18&&(_0x3b2a18=await _0x461780['segment'][_0x1b1a16(0x286)](_0x1e7a88,_0x14e344));const _0x5a0878=generateJourneyLocalName(_0x3b2a18[_0x1b1a16(0x285)]),_0x21f8b4=_0x3b2a18['kind']===SEGMENT_KIND_JOURNEY&&_0x5a0878!==undefined;let _0x2629e7=_0x3b2a18[_0x1b1a16(0x285)],_0x14cebc;if(_0x21f8b4&&_0x3b2a18[_0x1b1a16(0x1ca)]){const _0xbb0e65=apiRuleToYaml(_0x3b2a18['rule']);_0x3159d1[_0x1b1a16(0x1ec)](_0x14e344,_0xbb0e65);const _0x2b1532=async _0x2ef9a2=>{const _0x18c4ab=_0x1b1a16,_0x389d84=collectSegmentRefsFromRule(_0x2ef9a2);for(const _0x62f50c of _0x389d84){if(!_0x3159d1['has'](_0x62f50c))try{const _0x3bdb03=await _0x461780[_0x18c4ab(0x1da)]['getSegment'](_0x1e7a88,_0x62f50c);if(_0x3bdb03?.[_0x18c4ab(0x1ca)]){const _0x21b25d=apiRuleToYaml(_0x3bdb03[_0x18c4ab(0x1ca)]);_0x3159d1[_0x18c4ab(0x1ec)](_0x62f50c,_0x21b25d),await _0x2b1532(_0x21b25d);}}catch{}}};await _0x2b1532(_0xbb0e65);const _0x3695a8=serializeExpandedRule(_0xbb0e65,_0x3159d1),_0x22ec7e=_0x58203f['get'](_0x3695a8);if(_0x22ec7e&&!_0x396f2c[_0x1b1a16(0x289)](_0x22ec7e)){_0x2629e7=_0x22ec7e,_0x396f2c[_0x1b1a16(0x22b)](_0x2629e7),_0x55acef[_0x1b1a16(0x1ec)](_0x14e344,_0x2629e7);const _0x444ded=await resolveRuleSegmentRefs(_0xbb0e65,async _0x715dc2=>{const _0x50ea3d=_0x1b1a16,_0x56921c=_0x55acef[_0x50ea3d(0x222)](_0x715dc2);if(_0x56921c)return _0x56921c;const _0x40084a=await _0x3c22ca['resolveSegment'](_0x715dc2);return _0x40084a[_0x50ea3d(0x285)];});_0x14cebc={'description':_0x3b2a18[_0x1b1a16(0x28a)],'rule':_0x444ded};}else{if(_0x22ec7e&&_0x396f2c[_0x1b1a16(0x289)](_0x22ec7e))_0x2629e7=_0x22ec7e,_0x55acef[_0x1b1a16(0x1ec)](_0x14e344,_0x2629e7);else{const _0x4e7458=_0x45e7f5[_0x1b1a16(0x222)](_0x3695a8);if(_0x4e7458)_0x2629e7=_0x4e7458,_0x55acef[_0x1b1a16(0x1ec)](_0x14e344,_0x2629e7);else{if(_0x5a0878){let _0x4a9557=_0x5a0878,_0x531e46=0x2;while(_0x396f2c[_0x1b1a16(0x289)](_0x4a9557)||_0x161540[_0x1b1a16(0x289)](_0x4a9557)){_0x4a9557=_0x5a0878+'_'+_0x531e46,_0x531e46++;}_0x396f2c['add'](_0x4a9557),_0x2629e7=_0x4a9557;}_0x55acef[_0x1b1a16(0x1ec)](_0x14e344,_0x2629e7),_0x45e7f5['set'](_0x3695a8,_0x2629e7);const _0x17210f=await resolveRuleSegmentRefs(_0xbb0e65,async _0x21c372=>{const _0x384546=_0x1b1a16,_0x11d1c4=_0x55acef[_0x384546(0x222)](_0x21c372);if(_0x11d1c4)return _0x11d1c4;const _0x13d4fd=await _0x3c22ca[_0x384546(0x29f)](_0x21c372);return _0x13d4fd['name'];});_0x14cebc={'description':_0x3b2a18['description'],'rule':_0x17210f};}}}}return{'name':_0x2629e7,'isJourneyLocal':_0x21f8b4,'definition':_0x14cebc};}catch{return{'name':_0x14e344,'isJourneyLocal':![]};}},'resolveActivation':async _0x585d34=>{const _0x1c1855=_0x56e0b9,_0x147a4b=_0x56e768['get'](_0x585d34);if(_0x147a4b!==undefined)return{'name':_0x147a4b,'isJourneyLocal':!![]};try{const _0x57895f=await _0x461780[_0x1c1855(0x2cf)][_0x1c1855(0x1e0)](_0x5aa6c7,_0x585d34),_0x17dbb4=_0x57895f[_0x1c1855(0x2b8)][_0x1c1855(0x1fb)][_0x1c1855(0x285)]||_0x585d34,_0x193c68=sanitizeYamlKey(_0x17dbb4)||'activation_'+_0x585d34;let _0x106ce6=_0x193c68,_0x22597a=0x2;while(_0x59836e[_0x1c1855(0x289)](_0x106ce6)){_0x106ce6=_0x193c68+'_'+_0x22597a,_0x22597a++;}_0x59836e['add'](_0x106ce6),_0x56e768[_0x1c1855(0x1ec)](_0x585d34,_0x106ce6);const _0x4b1535=journeyActivationStepToYaml(_0x57895f,_0x43925a,_0x4da911);return{'name':_0x106ce6,'isJourneyLocal':!![],'definition':_0x4b1535};}catch{return{'name':_0x585d34,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2ae8b9,_0x1781bd)=>resolveJumpTarget(_0x2ae8b9,_0x1781bd,_0x4cd5ce,_0x9ce88=>_0x461780[_0x56e0b9(0x2cf)][_0x56e0b9(0x1d3)](_0x9ce88))}),_0x351e5d=hasMultipleVersions(_0x15e5aa);if(_0x351e5d&&_0x2d87f2[_0x56e0b9(0x200)]>0x1){const _0x4b7bc5=[];for(const _0x1c908e of _0x2d87f2){const _0x2d2970=await withSpinner(_0x56e0b9(0x1ee)+_0x15e5aa[_0x56e0b9(0x285)]+_0x56e0b9(0x24f)+(_0x1c908e[_0x56e0b9(0x291)]||0x1)+_0x56e0b9(0x1d6),()=>_0x461780[_0x56e0b9(0x2cf)][_0x56e0b9(0x1d3)](_0x1c908e['id']),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]}),_0xa0f905=_0x3e6b54(_0x1c908e['id']);_0x3c22ca=_0xa0f905;const _0x14b149=await apiToYamlAsync(_0x2d2970[_0x56e0b9(0x29c)],_0xa0f905);_0x4b7bc5[_0x56e0b9(0x27f)]({'item':_0x1c908e,'yaml':_0x14b149});}_0x20a5f2=buildMergedJourneyYaml(_0x4b7bc5);const _0x185fa4=Math[_0x56e0b9(0x223)](..._0x4b7bc5[_0x56e0b9(0x2a5)](_0x357a1d=>_0x357a1d[_0x56e0b9(0x1c7)][_0x56e0b9(0x291)]||0x0)),_0x275548=_0x2d87f2[_0x56e0b9(0x1cd)](_0x1febc7=>(_0x1febc7[_0x56e0b9(0x291)]||0x0)===_0x185fa4);_0x275548&&(_0x3a36ad=await _0x461780[_0x56e0b9(0x2cf)][_0x56e0b9(0x1d3)](_0x275548['id']));}else{const _0x44bc90=_0x2d87f2[_0x2d87f2[_0x56e0b9(0x200)]-0x1],_0x1f1357=await withSpinner(_0x56e0b9(0x1ee)+_0x15e5aa[_0x56e0b9(0x285)]+_0x56e0b9(0x233),()=>_0x461780[_0x56e0b9(0x2cf)]['getJourney'](_0x44bc90['id']),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]});_0x3a36ad=_0x1f1357[_0x56e0b9(0x29c)];const _0x225f81=_0x3e6b54(_0x44bc90['id']);_0x3c22ca=_0x225f81,_0x20a5f2=await apiToYamlAsync(_0x3a36ad,_0x225f81);}}if(_0x1a4d2d&&!_0x41d642['has'](_0x1a4d2d)){const _0x4f044f=_0x1a4d2d['split']('/');let _0x3ed1b0='';for(const _0x7fb829 of _0x4f044f){_0x3ed1b0=_0x3ed1b0?_0x3ed1b0+'/'+_0x7fb829:_0x7fb829,!_0x41d642['has'](_0x3ed1b0)&&_0x59396[_0x56e0b9(0x22b)](_0x3ed1b0);}}const _0xa97a95=normalizeJourneyYaml(_0x15e5aa,_0x15e5aa),_0x55534e=a36_0x58d156(_0xa97a95);let _0x141c1a=![],_0x39a31b;if(_0x20a5f2){const _0x149d69=normalizeJourneyYaml(_0x20a5f2,_0x15e5aa),_0x5d0e59=a36_0x58d156(_0x149d69),_0x15b90d=generateDiff(_0x5d0e59,_0x55534e);_0x141c1a=hasChanges(_0x15b90d),_0x141c1a&&(_0x39a31b=formatDiffWithColors(_0x15b90d));}else{const _0x200bad=generateDiff('',_0x55534e);_0x39a31b=formatDiffWithColors(_0x200bad);}_0x2bb2a7[_0x56e0b9(0x27f)]({'relativePath':_0x15e5aa[_0x56e0b9(0x285)],'absolutePath':_0x3009a4,'yamlConfig':_0x15e5aa,'folderPath':_0x1a4d2d,'existingJourney':_0x3a36ad,'isNew':!_0x3a36ad,'hasChanges':_0x141c1a,'diff':_0x39a31b});}let _0x2aee98=[];if(!_0x48fc76){const _0x4937d5=new Set();for(const {yamlConfig:_0x7f345a,folderPath:_0x4d8b4f}of _0x51148f){const _0x5f1f2a=resolveTDFolderPath(_0x4d8b4f,_0x5b6a11,_0x272c17);_0x4937d5[_0x56e0b9(0x22b)](_0x5f1f2a+':'+_0x7f345a[_0x56e0b9(0x285)]);}_0x2aee98=_0x5bb86c[_0x56e0b9(0x206)](_0x542ca3=>{const _0x58420c=_0x56e0b9,_0x57870a=_0x542ca3[_0x58420c(0x242)]?_0x548002['get'](_0x542ca3['folderId'])||'':'',_0x33f86e=_0x57870a+':'+_0x542ca3[_0x58420c(0x278)];if(_0x4937d5[_0x58420c(0x289)](_0x33f86e))return![];if(_0x5b6a11)return _0x57870a===_0x272c17||_0x57870a[_0x58420c(0x298)](_0x272c17+'/');return!![];});}const _0x120d9e=_0x796f39[_0x56e0b9(0x206)](_0x4803dc=>_0x4803dc[_0x56e0b9(0x20e)]),_0x1ad64e=_0x796f39[_0x56e0b9(0x206)](_0x4ecd9c=>!_0x4ecd9c[_0x56e0b9(0x20e)]&&_0x4ecd9c[_0x56e0b9(0x20a)]),_0x5ec1cc=_0x796f39[_0x56e0b9(0x206)](_0xabbe0=>!_0xabbe0['isNew']&&!_0xabbe0[_0x56e0b9(0x20a)]),_0x578d9d=Array['from'](_0x59396)[_0x56e0b9(0x2a0)](),_0x54f30a=_0x2adbbb[_0x56e0b9(0x2cb)]?_0x34fc69:[],_0x36f21c=_0x2adbbb['delete']?_0x2aee98:[],_0x4201a4=_0x796f39['flatMap'](_0x4bf794=>_0x4bf794['activationActions']),_0x51b611=_0x4201a4[_0x56e0b9(0x206)](_0x2fb708=>_0x2fb708[_0x56e0b9(0x212)]===_0x56e0b9(0x1e8)),_0x3ca5c1=_0x4201a4[_0x56e0b9(0x206)](_0x4f39df=>_0x4f39df['type']==='update'),_0x4e0156=_0x4201a4[_0x56e0b9(0x206)](_0xaacd5b=>_0xaacd5b[_0x56e0b9(0x212)]==='delete'),_0x2e6684=_0x2bb2a7[_0x56e0b9(0x206)](_0x4e1cab=>_0x4e1cab[_0x56e0b9(0x20e)]),_0x2eea73=_0x2bb2a7[_0x56e0b9(0x206)](_0x11d2ec=>!_0x11d2ec[_0x56e0b9(0x20e)]&&_0x11d2ec['hasChanges']),_0x5e127c=_0x2bb2a7['filter'](_0x19f88b=>!_0x19f88b[_0x56e0b9(0x20e)]&&!_0x19f88b['hasChanges']);console[_0x56e0b9(0x22f)]('\x0aPush\x20summary\x20for\x20\x27'+_0x33bb53+'\x27:');_0x578d9d[_0x56e0b9(0x200)]>0x0&&console['error']('\x20\x20'+a36_0x3a84f9[_0x56e0b9(0x218)](_0x56e0b9(0x25f)+_0x578d9d[_0x56e0b9(0x200)]+_0x56e0b9(0x22e)));if(!_0x2adbbb[_0x56e0b9(0x231)]){console[_0x56e0b9(0x22f)]('\x20\x20πŸ“Š\x20Segments:'),console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x1c8)]('+\x20'+_0x120d9e[_0x56e0b9(0x200)]+_0x56e0b9(0x1d2))),console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x203)]('~\x20'+_0x1ad64e[_0x56e0b9(0x200)]+_0x56e0b9(0x2d3)));if(_0x54f30a[_0x56e0b9(0x200)]>0x0)console['error'](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x24c)]('-\x20'+_0x54f30a[_0x56e0b9(0x200)]+'\x20to\x20delete'));else _0x34fc69[_0x56e0b9(0x200)]>0x0&&!_0x2adbbb[_0x56e0b9(0x2cb)]&&console[_0x56e0b9(0x22f)]('\x20\x20\x20\x20'+a36_0x3a84f9[_0x56e0b9(0x296)](_0x34fc69[_0x56e0b9(0x200)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x296)]('=\x20'+_0x5ec1cc['length']+_0x56e0b9(0x2c7)));}if(_0x2bb2a7[_0x56e0b9(0x200)]>0x0||_0x2aee98[_0x56e0b9(0x200)]>0x0){console[_0x56e0b9(0x22f)]('\x20\x20πŸ—ΊοΈ\x20\x20Journeys:'),console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x1c8)]('+\x20'+_0x2e6684[_0x56e0b9(0x200)]+_0x56e0b9(0x1d2))),console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x203)]('~\x20'+_0x2eea73[_0x56e0b9(0x200)]+_0x56e0b9(0x2d3)));if(_0x36f21c[_0x56e0b9(0x200)]>0x0)console[_0x56e0b9(0x22f)]('\x20\x20\x20\x20'+a36_0x3a84f9[_0x56e0b9(0x24c)]('-\x20'+_0x36f21c[_0x56e0b9(0x200)]+_0x56e0b9(0x23f)));else _0x2aee98[_0x56e0b9(0x200)]>0x0&&!_0x2adbbb['delete']&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x296)](_0x2aee98[_0x56e0b9(0x200)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x296)]('=\x20'+_0x5e127c[_0x56e0b9(0x200)]+'\x20unchanged'));}_0x4201a4[_0x56e0b9(0x200)]>0x0&&!_0x2adbbb['journeysOnly']&&(console[_0x56e0b9(0x22f)](''),console[_0x56e0b9(0x22f)](_0x56e0b9(0x255)),_0x51b611[_0x56e0b9(0x200)]>0x0&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x1c8)]('+\x20'+_0x51b611[_0x56e0b9(0x200)]+'\x20to\x20create')),_0x3ca5c1['length']>0x0&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9[_0x56e0b9(0x203)]('~\x20'+_0x3ca5c1[_0x56e0b9(0x200)]+_0x56e0b9(0x28e))),_0x4e0156[_0x56e0b9(0x200)]>0x0&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x290)+a36_0x3a84f9['red']('-\x20'+_0x4e0156[_0x56e0b9(0x200)]+_0x56e0b9(0x23f))));console[_0x56e0b9(0x22f)](_0x56e0b9(0x1d4)+a36_0x3a84f9[_0x56e0b9(0x253)](_0x355e6a)+'\x0a');if(_0x578d9d['length']>0x0){console[_0x56e0b9(0x22f)]('Folders\x20to\x20create:');for(const _0x184255 of _0x578d9d){console[_0x56e0b9(0x22f)]('\x20\x20'+a36_0x3a84f9['blue']('+')+'\x20'+_0x184255);}console[_0x56e0b9(0x22f)]('');}if(_0x120d9e[_0x56e0b9(0x200)]>0x0&&!_0x2adbbb[_0x56e0b9(0x231)])for(const _0x3efb80 of _0x120d9e){const _0x3c37df=_0x3efb80[_0x56e0b9(0x252)]?_0x3efb80[_0x56e0b9(0x252)]+'/'+_0x3efb80[_0x56e0b9(0x248)][_0x56e0b9(0x285)]:_0x3efb80[_0x56e0b9(0x248)][_0x56e0b9(0x285)],_0x366c8d=_0x3efb80[_0x56e0b9(0x248)][_0x56e0b9(0x277)]?.['length']||0x0,_0xaf1023=_0x366c8d>0x0?a36_0x3a84f9['dim']('\x20['+_0x366c8d+'\x20activations]'):'';console[_0x56e0b9(0x22f)]('\x0a'+a36_0x3a84f9['green'](_0x56e0b9(0x29b))+'\x20'+_0x3c37df+_0xaf1023),console[_0x56e0b9(0x22f)]('─'[_0x56e0b9(0x24a)](0x3c)),_0x3efb80[_0x56e0b9(0x215)]&&console[_0x56e0b9(0x22f)](_0x3efb80[_0x56e0b9(0x215)]),console[_0x56e0b9(0x22f)]('─'[_0x56e0b9(0x24a)](0x3c));}if(_0x54f30a['length']>0x0&&!_0x2adbbb[_0x56e0b9(0x231)])for(const _0x1ca235 of _0x54f30a){const _0x2709cf=_0x1ca235[_0x56e0b9(0x2b6)]?_0x548002[_0x56e0b9(0x222)](_0x1ca235[_0x56e0b9(0x2b6)][_0x56e0b9(0x279)]())||'':'',_0x445595=_0x2709cf?_0x2709cf+'/'+_0x1ca235[_0x56e0b9(0x285)]:_0x1ca235[_0x56e0b9(0x285)],_0xfb8d4a=_0x4cdc1f['get'](_0x1ca235['id'])||[],_0x618160=_0xfb8d4a[_0x56e0b9(0x200)]>0x0?a36_0x3a84f9[_0x56e0b9(0x296)]('\x20['+_0xfb8d4a[_0x56e0b9(0x200)]+_0x56e0b9(0x224)):'';console[_0x56e0b9(0x22f)]('\x0a'+a36_0x3a84f9[_0x56e0b9(0x24c)](_0x56e0b9(0x2c9))+'\x20'+_0x445595+_0x618160),console[_0x56e0b9(0x22f)]('─'[_0x56e0b9(0x24a)](0x3c));const _0x551224=segmentWithActivationsToYaml(_0x1ca235,_0xfb8d4a,undefined,_0x43925a,_0x4da911),_0x426731=segmentToYamlString(_0x551224),_0x522dff=generateDiff(_0x426731,'');console[_0x56e0b9(0x22f)](formatDiffWithColors(_0x522dff)),console[_0x56e0b9(0x22f)]('─'['repeat'](0x3c));}const _0x3c79ed=_0x796f39[_0x56e0b9(0x206)](_0x14ed72=>!_0x14ed72[_0x56e0b9(0x20e)]&&_0x14ed72[_0x56e0b9(0x215)]);if(_0x3c79ed[_0x56e0b9(0x200)]>0x0&&!_0x2adbbb['journeysOnly'])for(const _0x41fa43 of _0x3c79ed){const _0x52af0f=_0x41fa43[_0x56e0b9(0x252)]?_0x41fa43['folderPath']+'/'+_0x41fa43[_0x56e0b9(0x248)][_0x56e0b9(0x285)]:_0x41fa43[_0x56e0b9(0x248)]['name'];console[_0x56e0b9(0x22f)]('\x0a'+a36_0x3a84f9[_0x56e0b9(0x203)](_0x56e0b9(0x2c2))+'\x20'+_0x52af0f),console[_0x56e0b9(0x22f)]('─'['repeat'](0x3c)),console[_0x56e0b9(0x22f)](_0x41fa43['diff']),console[_0x56e0b9(0x22f)]('─'[_0x56e0b9(0x24a)](0x3c));}if(_0x2e6684[_0x56e0b9(0x200)]>0x0)for(const _0x19ae5f of _0x2e6684){const _0x2d2186=_0x19ae5f[_0x56e0b9(0x252)]?_0x19ae5f[_0x56e0b9(0x252)]+'/'+_0x19ae5f[_0x56e0b9(0x248)][_0x56e0b9(0x285)]:_0x19ae5f[_0x56e0b9(0x248)][_0x56e0b9(0x285)];console[_0x56e0b9(0x22f)]('\x0a'+a36_0x3a84f9[_0x56e0b9(0x1c8)](_0x56e0b9(0x1db))+'\x20'+_0x2d2186),console[_0x56e0b9(0x22f)]('─'[_0x56e0b9(0x24a)](0x3c)),_0x19ae5f['diff']&&console[_0x56e0b9(0x22f)](_0x19ae5f[_0x56e0b9(0x215)]),console['error']('─'[_0x56e0b9(0x24a)](0x3c));}const _0x21f4f4=_0x2bb2a7[_0x56e0b9(0x206)](_0x4dc8ba=>!_0x4dc8ba['isNew']&&_0x4dc8ba[_0x56e0b9(0x215)]);if(_0x21f4f4[_0x56e0b9(0x200)]>0x0)for(const _0xc2f900 of _0x21f4f4){const _0x3b89ab=_0xc2f900[_0x56e0b9(0x252)]?_0xc2f900[_0x56e0b9(0x252)]+'/'+_0xc2f900[_0x56e0b9(0x248)]['name']:_0xc2f900[_0x56e0b9(0x248)][_0x56e0b9(0x285)];console[_0x56e0b9(0x22f)]('\x0a'+a36_0x3a84f9[_0x56e0b9(0x203)](_0x56e0b9(0x1cb))+'\x20'+_0x3b89ab),console[_0x56e0b9(0x22f)]('─'[_0x56e0b9(0x24a)](0x3c)),console[_0x56e0b9(0x22f)](_0xc2f900[_0x56e0b9(0x215)]),console['error']('─'['repeat'](0x3c));}if(_0x36f21c[_0x56e0b9(0x200)]>0x0)for(const _0xa4f24c of _0x36f21c){const _0x2de6f0=_0xa4f24c[_0x56e0b9(0x242)]?_0x548002[_0x56e0b9(0x222)](_0xa4f24c[_0x56e0b9(0x242)])||'':'',_0x5e663e=_0x2de6f0?_0x2de6f0+'/'+_0xa4f24c[_0x56e0b9(0x278)]:_0xa4f24c[_0x56e0b9(0x278)];console[_0x56e0b9(0x22f)]('\x0a'+a36_0x3a84f9[_0x56e0b9(0x24c)]('Delete\x20journey:')+'\x20'+_0x5e663e),console[_0x56e0b9(0x22f)]('─'['repeat'](0x3c)),console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x24c)](_0x56e0b9(0x29e))),console['error']('─'['repeat'](0x3c));}if(_0x2adbbb[_0x56e0b9(0x2bf)])return console[_0x56e0b9(0x22f)](a36_0x3a84f9['yellow'](_0x56e0b9(0x20f))),0x0;const _0x290b37=_0x2adbbb[_0x56e0b9(0x231)]?![]:_0x120d9e[_0x56e0b9(0x200)]>0x0||_0x1ad64e['length']>0x0||_0x54f30a['length']>0x0,_0x3720ed=_0x2e6684[_0x56e0b9(0x200)]>0x0||_0x2eea73[_0x56e0b9(0x200)]>0x0||_0x36f21c[_0x56e0b9(0x200)]>0x0,_0x11187c=_0x2adbbb['journeysOnly']?![]:_0x4201a4[_0x56e0b9(0x200)]>0x0,_0x4de0e1=_0x578d9d[_0x56e0b9(0x200)]>0x0;if(!_0x290b37&&!_0x3720ed&&!_0x11187c&&!_0x4de0e1){const _0x33590a=_0x2adbbb['journeysOnly']?'βœ”\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x56e0b9(0x1ed);console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x1c8)](_0x33590a));if(_0x48fc76&&_0x5e127c['length']===0x1){const _0x13e061=_0x5e127c[0x0];if(_0x13e061[_0x56e0b9(0x2d2)]?.['id']){const _0x563189=getConsoleNextUrl(_0x2adbbb[_0x56e0b9(0x1c6)],_0x56e0b9(0x22a)+_0x1e7a88+_0x56e0b9(0x219)+_0x13e061[_0x56e0b9(0x2d2)]['id']+_0x56e0b9(0x2ca));console[_0x56e0b9(0x22f)]('\x20\x20'+a36_0x3a84f9[_0x56e0b9(0x253)](_0x563189));}}return 0x0;}const _0x3f15b7=_0x2adbbb[_0x56e0b9(0x231)]?_0x2e6684[_0x56e0b9(0x200)]+_0x2eea73[_0x56e0b9(0x200)]+_0x36f21c[_0x56e0b9(0x200)]+_0x578d9d[_0x56e0b9(0x200)]:_0x120d9e[_0x56e0b9(0x200)]+_0x1ad64e[_0x56e0b9(0x200)]+_0x54f30a['length']+_0x2e6684['length']+_0x2eea73[_0x56e0b9(0x200)]+_0x36f21c['length']+_0x578d9d[_0x56e0b9(0x200)]+_0x4201a4[_0x56e0b9(0x200)];if(!_0x2adbbb[_0x56e0b9(0x250)]&&_0x3f15b7>0x0){const _0x2768b5=await confirmKey(_0x56e0b9(0x271)+_0x3f15b7+'\x20changes?');if(!_0x2768b5)return console[_0x56e0b9(0x22f)]('Aborted.'),0x1;}for(const _0x3ef5b0 of _0x578d9d){const _0xb30d9d=_0x3ef5b0[_0x56e0b9(0x28f)]('/'),_0x27d312=_0xb30d9d[_0xb30d9d[_0x56e0b9(0x200)]-0x1],_0x1e6b98=_0xb30d9d['slice'](0x0,-0x1)[_0x56e0b9(0x26d)]('/'),_0x3ec385=_0x41d642[_0x56e0b9(0x222)](_0x1e6b98),_0x33e65={'name':_0x27d312,'parentFolderId':_0x3ec385},_0x42f62e=await withSpinner(_0x56e0b9(0x237)+_0x3ef5b0+_0x56e0b9(0x208),()=>_0x461780[_0x56e0b9(0x1da)][_0x56e0b9(0x1d7)](_0x1e7a88,_0x33e65),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]});_0x41d642[_0x56e0b9(0x1ec)](_0x3ef5b0,_0x42f62e[_0x56e0b9(0x29c)]['id']),console[_0x56e0b9(0x22f)](a36_0x3a84f9['blue'](_0x56e0b9(0x234)+_0x3ef5b0+'\x27'));}let _0x2e618e=0x0,_0x119e4c=0x0,_0x312293=0x0,_0x272208=0x0,_0x4a3d53=0x0,_0xfd11f1=0x0;const _0x1ca8be=new Map();for(const _0x504747 of _0x2adbbb[_0x56e0b9(0x231)]?[]:_0x796f39){const _0x14a638=_0x504747['folderPath']?_0x41d642[_0x56e0b9(0x222)](_0x504747['folderPath']):undefined;let _0x45344c;try{if(_0x504747[_0x56e0b9(0x20e)]){const _0x4f8c54=yamlToCreateRequest(_0x504747[_0x56e0b9(0x248)],_0x14a638),_0x4e4ba2=await withSpinner(_0x56e0b9(0x2d0)+_0x504747[_0x56e0b9(0x248)][_0x56e0b9(0x285)]+'\x27...',()=>_0x461780[_0x56e0b9(0x1da)][_0x56e0b9(0x1d0)](_0x1e7a88,_0x4f8c54),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]});_0x45344c=_0x4e4ba2[_0x56e0b9(0x29c)]['id'],_0x1ca8be['set'](_0x504747[_0x56e0b9(0x248)][_0x56e0b9(0x285)],_0x45344c),console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x1c8)](_0x56e0b9(0x23a)+_0x504747[_0x56e0b9(0x248)][_0x56e0b9(0x285)]+'\x27')),_0x2e618e++;}else{if(_0x504747[_0x56e0b9(0x20a)]){const _0x1c85b8=yamlToUpdateRequest(_0x504747[_0x56e0b9(0x248)]);_0x14a638!==_0x504747[_0x56e0b9(0x2a1)]?.[_0x56e0b9(0x2b6)]&&(_0x1c85b8[_0x56e0b9(0x2b6)]=_0x14a638?parseInt(_0x14a638,0xa):undefined),await withSpinner(_0x56e0b9(0x1fe)+_0x504747[_0x56e0b9(0x248)][_0x56e0b9(0x285)]+_0x56e0b9(0x208),()=>_0x461780[_0x56e0b9(0x1da)]['updateSegmentById'](_0x1e7a88,_0x504747[_0x56e0b9(0x2a1)]['id'],_0x1c85b8),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]}),_0x45344c=_0x504747[_0x56e0b9(0x2a1)]['id'],console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x203)](_0x56e0b9(0x1eb)+_0x504747[_0x56e0b9(0x248)][_0x56e0b9(0x285)]+'\x27')),_0x119e4c++;}else _0x45344c=_0x504747['existingSegment']['id'];}}catch(_0x2605dd){const _0x32513e=isHttp400Error(_0x2605dd),_0x2ed593=_0x32513e?ErrorCode[_0x56e0b9(0x1df)]:ErrorCode[_0x56e0b9(0x27a)],_0xdb0fae=getErrorMessage(_0x2605dd);throw new SDKError(_0x2ed593,_0x56e0b9(0x292)+(_0x504747[_0x56e0b9(0x20e)]?_0x56e0b9(0x1e8):'update')+_0x56e0b9(0x284)+_0x504747[_0x56e0b9(0x27c)]+'\x0a\x20\x20'+_0xdb0fae,_0x2605dd);}for(const _0x53ab47 of _0x504747[_0x56e0b9(0x1cf)]){try{if(_0x53ab47[_0x56e0b9(0x212)]===_0x56e0b9(0x1e8)&&_0x53ab47[_0x56e0b9(0x20b)])await withSpinner('Creating\x20activation\x20\x27'+_0x53ab47[_0x56e0b9(0x285)]+_0x56e0b9(0x208),()=>_0x461780['segment'][_0x56e0b9(0x236)](_0x1e7a88,_0x45344c,_0x53ab47[_0x56e0b9(0x20b)]),{'verbose':_0x2adbbb['verbose']}),console['error'](a36_0x3a84f9[_0x56e0b9(0x1c8)](_0x56e0b9(0x1d8)+_0x53ab47[_0x56e0b9(0x285)]+'\x27')),_0x272208++;else{if(_0x53ab47['type']==='update'&&_0x53ab47[_0x56e0b9(0x20b)]&&_0x53ab47[_0x56e0b9(0x270)])await withSpinner('Updating\x20activation\x20\x27'+_0x53ab47[_0x56e0b9(0x285)]+'\x27...',()=>_0x461780['segment'][_0x56e0b9(0x1ff)](_0x1e7a88,_0x45344c,_0x53ab47[_0x56e0b9(0x270)]['id'],_0x53ab47[_0x56e0b9(0x20b)]),{'verbose':_0x2adbbb['verbose']}),console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x203)](_0x56e0b9(0x2d1)+_0x53ab47[_0x56e0b9(0x285)]+'\x27')),_0x4a3d53++;else _0x53ab47['type']===_0x56e0b9(0x2cb)&&_0x53ab47[_0x56e0b9(0x270)]&&(await withSpinner(_0x56e0b9(0x246)+_0x53ab47[_0x56e0b9(0x285)]+_0x56e0b9(0x208),()=>_0x461780[_0x56e0b9(0x1da)]['deleteActivation'](_0x1e7a88,_0x45344c,_0x53ab47['existingActivation']['id']),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]}),console['error'](a36_0x3a84f9[_0x56e0b9(0x24c)](_0x56e0b9(0x27d)+_0x53ab47['name']+'\x27')),_0xfd11f1++);}}catch(_0x46241f){const _0x3a9f1f=isHttp400Error(_0x46241f),_0xfe817c=_0x3a9f1f?ErrorCode[_0x56e0b9(0x281)]:ErrorCode[_0x56e0b9(0x21b)],_0x2b538b=getErrorMessage(_0x46241f);throw new SDKError(_0xfe817c,_0x56e0b9(0x292)+_0x53ab47[_0x56e0b9(0x212)]+_0x56e0b9(0x29a)+_0x53ab47['name']+_0x56e0b9(0x280)+_0x504747[_0x56e0b9(0x27c)]+_0x56e0b9(0x1de)+_0x2b538b,_0x46241f);}}}for(const _0x14ac06 of _0x2adbbb[_0x56e0b9(0x231)]?[]:_0x54f30a){await withSpinner(_0x56e0b9(0x263)+_0x14ac06['name']+_0x56e0b9(0x208),()=>_0x461780['segment']['deleteSegment'](_0x14ac06['id']),{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]}),console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x24c)]('βœ”\x20Deleted\x20segment\x20\x27'+_0x14ac06[_0x56e0b9(0x285)]+'\x27')),_0x312293++;}let _0x17072f=0x0,_0xc213e7=0x0,_0xf8c5dc=0x0;const _0x3d1ef7=new Map(_0x101016);for(const _0x1c016d of _0x796f39){_0x1c016d[_0x56e0b9(0x20e)]&&_0x1ca8be[_0x56e0b9(0x289)](_0x1c016d[_0x56e0b9(0x248)][_0x56e0b9(0x285)])&&_0x3d1ef7['set'](_0x1c016d[_0x56e0b9(0x248)]['name'],_0x1ca8be[_0x56e0b9(0x222)](_0x1c016d[_0x56e0b9(0x248)]['name']));}if(_0x2bb2a7['length']>0x0){const _0x4a4b84=await withQuerySpinner(_0x56e0b9(0x229),async _0x30cca5=>{const _0x1b472d=_0x56e0b9,_0x5dd062=[];let _0x25ff7a=0x0;const _0x2ba043=0x5;for(let _0x317758=0x0;_0x317758<_0x2bb2a7[_0x1b472d(0x200)];_0x317758+=_0x2ba043){const _0x207302=_0x2bb2a7[_0x1b472d(0x283)](_0x317758,_0x317758+_0x2ba043),_0x39450d=await Promise[_0x1b472d(0x202)](_0x207302[_0x1b472d(0x2a5)](async _0x5876ec=>{const _0x321908=_0x1b472d;if(!_0x5876ec[_0x321908(0x20e)]&&!_0x5876ec[_0x321908(0x20a)])return{'action':_0x321908(0x240),'name':_0x5876ec['yamlConfig'][_0x321908(0x285)],'journeyId':_0x5876ec[_0x321908(0x2d2)]?.['id']};const _0x20a019=_0x5876ec[_0x321908(0x252)]?_0x41d642[_0x321908(0x222)](_0x5876ec['folderPath']):undefined,_0x15ec8d=_0x5876ec[_0x321908(0x20e)]?_0x321908(0x254):'Updating';_0x30cca5['setPhase'](_0x15ec8d+'\x20journey\x20\x27'+_0x5876ec[_0x321908(0x248)]['name']+'\x27');const _0x2dd6d4=new Map(),_0x1f0cd7=new Map(),_0x1e4e39=new Map(),_0x491b76={'resolveSegmentId':async _0x3848f2=>{const _0x5a08c3=_0x321908,_0x420a07=_0x3d1ef7[_0x5a08c3(0x222)](_0x3848f2);if(!_0x420a07)throw new SDKError(ErrorCode[_0x5a08c3(0x1e7)],_0x5a08c3(0x26f)+_0x3848f2+'\x20(referenced\x20in\x20journey\x20'+_0x5876ec[_0x5a08c3(0x248)]['name']+')');return _0x420a07;},'resolveEmbeddedSegmentId':async(_0x376953,_0x13a1d9)=>{const _0x19a834=_0x321908,_0x2e4e97=_0x3d1ef7['get'](_0x376953);if(_0x2e4e97)return _0x2e4e97;const _0x497c69=_0x371a62[_0x19a834(0x1cd)](_0x3bb504=>_0x3bb504['name']===_0x376953);if(_0x497c69)return _0x3d1ef7[_0x19a834(0x1ec)](_0x376953,_0x497c69['id']),_0x497c69['id'];if(_0x5876ec[_0x19a834(0x20e)]){const _0x1c04d6=_0x5876ec[_0x19a834(0x248)][_0x19a834(0x21f)]||_0x5876ec[_0x19a834(0x248)][_0x19a834(0x25c)]?.[0x0]?.[_0x19a834(0x21f)]||[];let _0x5dc22e=_0x19a834(0x295),_0x38ed26=_0x376953;const _0x1d7366=_0x5876ec[_0x19a834(0x248)][_0x19a834(0x1e1)]||_0x5876ec[_0x19a834(0x248)][_0x19a834(0x25c)]?.[0x0]?.[_0x19a834(0x1e1)];if(_0x1d7366?.['segment']===_0x376953)_0x5dc22e=_0x19a834(0x1e1),_0x38ed26=_0x1d7366['name']||_0x376953;else{_0x59713d:for(const _0x4e7185 of _0x1c04d6){if(_0x4e7185['entry_criteria']?.[_0x19a834(0x1da)]===_0x376953){_0x5dc22e=_0x4e7185['name'],_0x38ed26=_0x4e7185[_0x19a834(0x1f4)][_0x19a834(0x285)]||_0x376953;break;}if(_0x4e7185['steps'])for(const _0x3055cc of _0x4e7185[_0x19a834(0x2ad)]){if(_0x3055cc[_0x19a834(0x212)]===_0x19a834(0x275)&&_0x3055cc[_0x19a834(0x26a)]?.['branches'])for(const _0x1f1292 of _0x3055cc[_0x19a834(0x26a)][_0x19a834(0x1e9)]){if(_0x1f1292[_0x19a834(0x1da)]===_0x376953){_0x5dc22e=_0x4e7185['name'],_0x38ed26=_0x1f1292[_0x19a834(0x285)]||_0x376953;break _0x59713d;}}}}}return validateSegmentRule(_0x376953,_0x13a1d9[_0x19a834(0x1ca)]),_0x1f0cd7['set'](_0x376953,{'definition':_0x13a1d9,'stageName':_0x5dc22e,'criteriaName':_0x38ed26}),createPendingSegmentId(_0x376953);}const _0x58488f=_0x5876ec[_0x19a834(0x2d2)]?.['id'];if(!_0x58488f)throw new SDKError(ErrorCode[_0x19a834(0x26b)],_0x19a834(0x1d1));validateSegmentRule(_0x376953,_0x13a1d9[_0x19a834(0x1ca)]);const _0x2e2963=_0x19a834(0x24b)+crypto[_0x19a834(0x247)]();try{const _0x4e1f85=await _0x461780[_0x19a834(0x1da)]['createJourneySegment']({'name':_0x2e2963,'description':_0x13a1d9['description']||'Entry\x20criteria:\x20'+_0x376953,'journeyId':_0x58488f,'rule':yamlRuleToApi(_0x13a1d9[_0x19a834(0x1ca)],!![]),'countPopulation':!![],'parentFolderId':_0x26c0fc||'','audienceId':_0x1e7a88});return _0x2adbbb[_0x19a834(0x2b2)]&&console[_0x19a834(0x22f)](_0x19a834(0x258)+_0x376953+_0x19a834(0x241)+_0x2e2963+_0x19a834(0x25b)+_0x4e1f85),_0x3d1ef7[_0x19a834(0x1ec)](_0x376953,_0x4e1f85),_0x4e1f85;}catch(_0x408207){throw new SDKError(ErrorCode[_0x19a834(0x27a)],_0x19a834(0x2c4)+_0x376953+_0x19a834(0x21c)+getErrorMessage(_0x408207),_0x408207);}},'resolveActivationId':async _0x1aa0c2=>{const _0x1048a1=_0x321908,_0x242e7e=_0x2dd6d4[_0x1048a1(0x222)](_0x1aa0c2);if(_0x242e7e)return _0x242e7e;if(_0x5876ec[_0x1048a1(0x2d2)]){const _0x3f42c3=await _0x461780[_0x1048a1(0x2cf)]['listActivations'](_0x5876ec[_0x1048a1(0x2d2)]['id']),_0x1d9a68=_0x3f42c3[_0x1048a1(0x1cd)](_0x349a9e=>_0x349a9e['attributes'][_0x1048a1(0x1fb)]?.[_0x1048a1(0x285)]===_0x1aa0c2);if(_0x1d9a68)return _0x2dd6d4[_0x1048a1(0x1ec)](_0x1aa0c2,_0x1d9a68['id']),_0x1d9a68['id'];}throw new SDKError(ErrorCode[_0x1048a1(0x269)],_0x1048a1(0x288)+_0x1aa0c2+_0x1048a1(0x1ea)+_0x5876ec['yamlConfig'][_0x1048a1(0x285)]+_0x1048a1(0x2a3)+_0x1048a1(0x204));},'resolveEmbeddedActivationId':async(_0x4bcfe9,_0x52ee54)=>{const _0x17f31c=_0x321908,_0x52a63d=_0x2dd6d4[_0x17f31c(0x222)](_0x4bcfe9);if(_0x52a63d)return _0x52a63d;if(_0x5876ec[_0x17f31c(0x20e)])return _0x1e4e39['set'](_0x4bcfe9,_0x52ee54),createPendingActivationId(_0x4bcfe9);if(_0x5876ec[_0x17f31c(0x2d2)]){const _0x3e1028=await _0x461780['journey']['listActivations'](_0x5876ec[_0x17f31c(0x2d2)]['id']),_0x163dfb=_0x3e1028[_0x17f31c(0x1cd)](_0x809a26=>_0x809a26[_0x17f31c(0x2b8)][_0x17f31c(0x1fb)]?.[_0x17f31c(0x285)]===_0x52ee54[_0x17f31c(0x285)]);if(_0x163dfb)return _0x2dd6d4[_0x17f31c(0x1ec)](_0x4bcfe9,_0x163dfb['id']),_0x163dfb['id'];try{const _0xbc5780=await yamlActivationToCreateRequest(_0x52ee54,_0x14bd57),_0xb26a8b=await _0x461780['journey'][_0x17f31c(0x236)](_0x5876ec[_0x17f31c(0x2d2)]['id'],_0xbc5780);return _0x2adbbb['verbose']&&console['error']('\x20\x20Created\x20embedded\x20activation\x20\x27'+_0x4bcfe9+_0x17f31c(0x272)+_0xb26a8b['id']),_0x2dd6d4[_0x17f31c(0x1ec)](_0x4bcfe9,_0xb26a8b['id']),_0xb26a8b['id'];}catch(_0xef98bc){throw new SDKError(ErrorCode[_0x17f31c(0x2aa)],_0x17f31c(0x2b7)+_0x4bcfe9+_0x17f31c(0x21c)+getErrorMessage(_0xef98bc),_0xef98bc);}}throw new SDKError(ErrorCode[_0x17f31c(0x26b)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x32f6bd=>{const _0x466aff=_0x321908;try{return await _0x461780[_0x466aff(0x2cf)][_0x466aff(0x2b4)](_0x1e7a88,_0x32f6bd);}catch(_0x367eea){throw new SDKError(ErrorCode['NOT_FOUND'],_0x466aff(0x210)+_0x32f6bd+_0x466aff(0x225)+_0x5876ec[_0x466aff(0x248)][_0x466aff(0x285)]+'\x27)',_0x367eea);}},'resolveStageId':async(_0x5c2e3c,_0x1dcc8f)=>{const _0x25c44d=_0x321908,_0x13786f=await _0x461780['journey'][_0x25c44d(0x1d3)](_0x5c2e3c),_0x3cdb43=_0x13786f['attributes'][_0x25c44d(0x1f6)]['find'](_0x330bfb=>_0x330bfb[_0x25c44d(0x285)][_0x25c44d(0x230)]()===_0x1dcc8f[_0x25c44d(0x230)]());if(!_0x3cdb43?.['id'])throw new SDKError(ErrorCode[_0x25c44d(0x269)],'Stage\x20\x27'+_0x1dcc8f+_0x25c44d(0x1f2)+(_0x13786f[_0x25c44d(0x2b8)][_0x25c44d(0x278)]||_0x13786f['attributes'][_0x25c44d(0x285)])+'\x27');return _0x3cdb43['id'];}};try{const _0x36ce00=await a36_0x211d32(_0x5876ec['yamlConfig'],_0x1e7a88,_0x491b76),_0x294fd3=_0x20a019||_0x26c0fc;_0x294fd3&&(_0x36ce00[_0x321908(0x2a7)]={'parentFolder':{'data':{'id':_0x294fd3,'type':'folder'}}});if(_0x5876ec[_0x321908(0x20e)]){if(_0x1f0cd7[_0x321908(0x29d)]>0x0||_0x1e4e39['size']>0x0){const _0x24f319=JSON[_0x321908(0x287)](JSON[_0x321908(0x22d)](_0x36ce00));ensureJourneyDefaults(_0x24f319['attributes']);for(const _0x82998e of _0x24f319['attributes'][_0x321908(0x1f6)]){_0x82998e[_0x321908(0x239)]?.[_0x321908(0x2b5)]&&isPendingSegmentId(_0x82998e['entryCriteria'][_0x321908(0x2b5)])&&delete _0x82998e[_0x321908(0x239)];if(_0x82998e[_0x321908(0x2ad)])for(const _0xf36d20 of Object['keys'](_0x82998e[_0x321908(0x2ad)])){const _0x14fd9c=_0x82998e[_0x321908(0x2ad)][_0xf36d20];_0x14fd9c[_0x321908(0x212)]==='Activation'&&_0x14fd9c[_0x321908(0x26e)]&&isPendingActivationId(_0x14fd9c[_0x321908(0x26e)])&&(_0x14fd9c['journeyActivationStepId']='');if(_0x14fd9c[_0x321908(0x212)]===_0x321908(0x261)&&_0x14fd9c['branches'])for(const _0x2795a6 of _0x14fd9c[_0x321908(0x1e9)]){_0x2795a6[_0x321908(0x2b5)]&&isPendingSegmentId(_0x2795a6['segmentId'])&&(_0x2795a6['segmentId']='');}}}_0x2adbbb[_0x321908(0x2b2)]&&console[_0x321908(0x22f)](_0x321908(0x243)+JSON[_0x321908(0x22d)](_0x24f319,null,0x2));const _0x48fd51=await _0x461780[_0x321908(0x2cf)][_0x321908(0x1e8)](_0x24f319),_0x28e6d3=_0x48fd51['id'],_0x2a07c8=new Map();for(const _0x1d7cc3 of _0x48fd51[_0x321908(0x2b8)][_0x321908(0x1f6)]){_0x2a07c8[_0x321908(0x1ec)](_0x1d7cc3[_0x321908(0x285)][_0x321908(0x230)](),_0x1d7cc3['id']);}const _0x505b57=new Map();for(const [_0x40984f,{definition:_0x334137,criteriaName:_0x46ecaf}]of _0x1f0cd7){const _0x86b60a=generateJourneyLocalName(_0x46ecaf)||_0x321908(0x24b)+crypto[_0x321908(0x247)]();_0x2adbbb['verbose']&&console['error'](_0x321908(0x1c5)+_0x40984f+_0x321908(0x241)+_0x86b60a+_0x321908(0x1e3)+_0x28e6d3);const _0x573628=await _0x461780[_0x321908(0x1da)][_0x321908(0x232)]({'name':_0x86b60a,'description':_0x334137[_0x321908(0x28a)]||_0x321908(0x211)+_0x40984f,'journeyId':_0x28e6d3,'rule':yamlRuleToApi(_0x334137[_0x321908(0x1ca)],!![]),'countPopulation':!![],'parentFolderId':_0x294fd3||'','audienceId':_0x1e7a88});_0x505b57[_0x321908(0x1ec)](_0x40984f,_0x573628),_0x3d1ef7['set'](_0x40984f,_0x573628),_0x2adbbb[_0x321908(0x2b2)]&&console['error']('\x20\x20Created\x20embedded\x20segment\x20\x27'+_0x40984f+'\x27\x20with\x20ID:\x20'+_0x573628);}const _0x2071cd=new Map();for(const [_0x1404f4,_0x463653]of _0x1e4e39){_0x2adbbb['verbose']&&console[_0x321908(0x22f)]('\x20\x20Step\x202b:\x20Creating\x20embedded\x20activation\x20\x27'+_0x1404f4+_0x321908(0x1dc)+_0x28e6d3);try{const _0x3ceab3=await yamlActivationToCreateRequest(_0x463653,_0x14bd57),_0x3aa23a=await _0x461780[_0x321908(0x2cf)][_0x321908(0x236)](_0x28e6d3,_0x3ceab3);_0x2071cd[_0x321908(0x1ec)](_0x1404f4,_0x3aa23a['id']),_0x2dd6d4['set'](_0x1404f4,_0x3aa23a['id']),_0x2adbbb[_0x321908(0x2b2)]&&console[_0x321908(0x22f)](_0x321908(0x265)+_0x1404f4+_0x321908(0x272)+_0x3aa23a['id']);}catch(_0x7eb9b4){throw new SDKError(ErrorCode[_0x321908(0x2aa)],_0x321908(0x2b7)+_0x1404f4+_0x321908(0x21c)+getErrorMessage(_0x7eb9b4),_0x7eb9b4);}}const _0x1eb999=JSON[_0x321908(0x287)](JSON[_0x321908(0x22d)](_0x36ce00));_0x1eb999['id']=_0x28e6d3,ensureJourneyDefaults(_0x1eb999[_0x321908(0x2b8)]);const _0x54153c=(_0x1205bf,_0x324e66)=>{const _0x4ee096=_0x321908;if(!isPendingSegmentId(_0x1205bf))return _0x1205bf;const _0xbb6a1a=extractPendingSegmentName(_0x1205bf),_0x3513ed=_0x505b57[_0x4ee096(0x222)](_0xbb6a1a);return!_0x3513ed&&console[_0x4ee096(0x22f)](a36_0x3a84f9['yellow'](_0x4ee096(0x209)+_0xbb6a1a+'\x27\x20for\x20'+_0x324e66)),_0x3513ed;};if(_0x1eb999[_0x321908(0x2b8)][_0x321908(0x1e1)]?.[_0x321908(0x2b5)]&&isPendingSegmentId(_0x1eb999['attributes'][_0x321908(0x1e1)]['segmentId'])){const _0x33abce=_0x54153c(_0x1eb999[_0x321908(0x2b8)][_0x321908(0x1e1)]['segmentId'],_0x321908(0x249));_0x33abce&&(_0x1eb999[_0x321908(0x2b8)][_0x321908(0x1e1)][_0x321908(0x2b5)]=_0x33abce);}for(const _0x12bba1 of _0x1eb999[_0x321908(0x2b8)][_0x321908(0x1f6)]){const _0x2708c2=_0x2a07c8[_0x321908(0x222)](_0x12bba1[_0x321908(0x285)]['toLowerCase']());_0x2708c2&&(_0x12bba1['id']=_0x2708c2);if(_0x12bba1['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x12bba1[_0x321908(0x239)][_0x321908(0x2b5)])){const _0x25e542=_0x54153c(_0x12bba1['entryCriteria']['segmentId'],_0x321908(0x262)+_0x12bba1[_0x321908(0x285)]+_0x321908(0x1dd));_0x25e542&&(_0x12bba1[_0x321908(0x239)]['segmentId']=_0x25e542);}if(_0x12bba1[_0x321908(0x220)])for(const _0x2a8c07 of _0x12bba1[_0x321908(0x220)]){if(_0x2a8c07['segmentId']&&isPendingSegmentId(_0x2a8c07[_0x321908(0x2b5)])){const _0xa426d8=_0x54153c(_0x2a8c07[_0x321908(0x2b5)],_0x321908(0x262)+_0x12bba1[_0x321908(0x285)]+'\x27\x20exit\x20criteria');_0xa426d8&&(_0x2a8c07[_0x321908(0x2b5)]=_0xa426d8);}}if(_0x12bba1[_0x321908(0x1f9)]?.[_0x321908(0x2b5)]&&isPendingSegmentId(_0x12bba1[_0x321908(0x1f9)][_0x321908(0x2b5)])){const _0x2e3d76=_0x54153c(_0x12bba1[_0x321908(0x1f9)][_0x321908(0x2b5)],'stage\x20\x27'+_0x12bba1[_0x321908(0x285)]+'\x27\x20milestone');_0x2e3d76&&(_0x12bba1['milestone'][_0x321908(0x2b5)]=_0x2e3d76);}if(_0x12bba1[_0x321908(0x2ad)]){const _0x518da5=_0xcdd8e8=>_0x36ce00[_0x321908(0x2b8)]['journeyStages']['find'](_0x311d88=>_0x311d88[_0x321908(0x285)][_0x321908(0x230)]()===_0x12bba1[_0x321908(0x285)]['toLowerCase']())?.[_0x321908(0x2ad)]?.[_0xcdd8e8];for(const _0x264561 of Object['keys'](_0x12bba1['steps'])){const _0x136fc3=_0x12bba1[_0x321908(0x2ad)][_0x264561],_0x33dd2f=_0x518da5(_0x264561);if(_0x136fc3[_0x321908(0x212)]===_0x321908(0x23e)&&_0x136fc3[_0x321908(0x26e)]&&(isPendingActivationId(_0x136fc3[_0x321908(0x26e)])||_0x136fc3[_0x321908(0x26e)]==='')){if(_0x33dd2f?.[_0x321908(0x26e)]&&isPendingActivationId(_0x33dd2f['journeyActivationStepId'])){const _0x45ca03=extractPendingActivationName(_0x33dd2f[_0x321908(0x26e)]),_0x544c27=_0x2071cd[_0x321908(0x222)](_0x45ca03);_0x544c27&&(_0x136fc3[_0x321908(0x26e)]=_0x544c27);}}if(_0x136fc3['type']===_0x321908(0x261)&&_0x136fc3[_0x321908(0x1e9)]&&_0x33dd2f?.['branches'])for(let _0x55eab6=0x0;_0x55eab6<_0x136fc3['branches'][_0x321908(0x200)];_0x55eab6++){const _0x13aedd=_0x136fc3[_0x321908(0x1e9)][_0x55eab6],_0x1f3027=_0x33dd2f['branches'][_0x55eab6];if(_0x1f3027?.[_0x321908(0x2b5)]&&isPendingSegmentId(_0x1f3027['segmentId'])){const _0xb3add9=_0x54153c(_0x1f3027[_0x321908(0x2b5)],'stage\x20\x27'+_0x12bba1['name']+_0x321908(0x28c)+(_0x13aedd['name']||_0x55eab6)+'\x27');_0xb3add9&&(_0x13aedd[_0x321908(0x2b5)]=_0xb3add9);}}}}}return _0x2adbbb[_0x321908(0x2b2)]&&console[_0x321908(0x22f)](_0x321908(0x256)+JSON['stringify'](_0x1eb999,null,0x2)),await _0x461780['journey'][_0x321908(0x2a4)](_0x28e6d3,_0x1eb999),{'action':'created','name':_0x5876ec[_0x321908(0x248)][_0x321908(0x285)],'journeyId':_0x28e6d3};}else{ensureJourneyDefaults(_0x36ce00[_0x321908(0x2b8)]);_0x2adbbb[_0x321908(0x2b2)]&&console[_0x321908(0x22f)](_0x321908(0x21a)+JSON[_0x321908(0x22d)](_0x36ce00,null,0x2));const _0x1f0a39=await _0x461780[_0x321908(0x2cf)][_0x321908(0x1e8)](_0x36ce00);return{'action':_0x321908(0x2bc),'name':_0x5876ec['yamlConfig'][_0x321908(0x285)],'journeyId':_0x1f0a39['id']};}}else{if(_0x5876ec['hasChanges']&&_0x5876ec[_0x321908(0x2d2)])return ensureJourneyDefaults(_0x36ce00[_0x321908(0x2b8)]),await _0x461780['journey'][_0x321908(0x2a4)](_0x5876ec[_0x321908(0x2d2)]['id'],_0x36ce00),{'action':_0x321908(0x259),'name':_0x5876ec[_0x321908(0x248)][_0x321908(0x285)],'journeyId':_0x5876ec[_0x321908(0x2d2)]['id']};}return{'action':_0x321908(0x240),'name':_0x5876ec[_0x321908(0x248)][_0x321908(0x285)],'journeyId':_0x5876ec['existingJourney']?.['id']};}catch(_0x3ae367){const _0x3c8cc8=isHttp400Error(_0x3ae367),_0x2db244=_0x3c8cc8?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4dc1b0=getErrorMessage(_0x3ae367);throw new SDKError(_0x2db244,'Failed\x20to\x20'+(_0x5876ec[_0x321908(0x20e)]?_0x321908(0x1e8):_0x321908(0x2a4))+_0x321908(0x21d)+_0x5876ec['absolutePath']+_0x321908(0x1de)+_0x4dc1b0,_0x3ae367);}}));_0x5dd062[_0x1b472d(0x27f)](..._0x39450d),_0x25ff7a+=_0x207302[_0x1b472d(0x200)],_0x30cca5[_0x1b472d(0x1c4)]('('+_0x25ff7a+'/'+_0x2bb2a7[_0x1b472d(0x200)]+')');}return _0x5dd062;},{'verbose':_0x2adbbb[_0x56e0b9(0x2b2)]});for(const _0x3857e5 of _0x4a4b84[_0x56e0b9(0x29c)]){if(_0x3857e5['action']===_0x56e0b9(0x2bc))console[_0x56e0b9(0x22f)](a36_0x3a84f9['green'](_0x56e0b9(0x1fc)+_0x3857e5[_0x56e0b9(0x285)]+'\x27')),_0x17072f++;else _0x3857e5[_0x56e0b9(0x1f8)]===_0x56e0b9(0x259)&&(console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x203)]('βœ”\x20Updated\x20journey\x20\x27'+_0x3857e5[_0x56e0b9(0x285)]+'\x27')),_0xc213e7++);}if(_0x48fc76&&_0x4a4b84[_0x56e0b9(0x29c)][_0x56e0b9(0x200)]===0x1){const _0x2d49ce=_0x4a4b84['data'][0x0];if(_0x2d49ce[_0x56e0b9(0x24d)]){const _0xc17ba8=getConsoleNextUrl(_0x2adbbb['site'],'/app/ps/'+_0x1e7a88+_0x56e0b9(0x219)+_0x2d49ce[_0x56e0b9(0x24d)]+'/j/da/je');console[_0x56e0b9(0x22f)]('\x20\x20'+a36_0x3a84f9[_0x56e0b9(0x253)](_0xc17ba8));}}}for(const _0x49bbc9 of _0x36f21c){console[_0x56e0b9(0x22f)](a36_0x3a84f9['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x49bbc9[_0x56e0b9(0x278)])),_0xf8c5dc++;}const _0x5b85d4=[];if(_0x2e618e>0x0)_0x5b85d4['push'](_0x2e618e+'\x20created');if(_0x119e4c>0x0)_0x5b85d4[_0x56e0b9(0x27f)](_0x119e4c+'\x20updated');if(_0x312293>0x0)_0x5b85d4[_0x56e0b9(0x27f)](_0x312293+_0x56e0b9(0x273));const _0xaffcb9=[];if(_0x17072f>0x0)_0xaffcb9[_0x56e0b9(0x27f)](_0x17072f+_0x56e0b9(0x1ef));if(_0xc213e7>0x0)_0xaffcb9[_0x56e0b9(0x27f)](_0xc213e7+_0x56e0b9(0x2bb));if(_0xf8c5dc>0x0)_0xaffcb9[_0x56e0b9(0x27f)](_0xf8c5dc+_0x56e0b9(0x273));const _0x438730=[];if(_0x272208>0x0)_0x438730[_0x56e0b9(0x27f)](_0x272208+_0x56e0b9(0x1ef));if(_0x4a3d53>0x0)_0x438730['push'](_0x4a3d53+_0x56e0b9(0x2bb));if(_0xfd11f1>0x0)_0x438730[_0x56e0b9(0x27f)](_0xfd11f1+_0x56e0b9(0x273));return console[_0x56e0b9(0x22f)](a36_0x3a84f9[_0x56e0b9(0x1c8)](_0x56e0b9(0x2b1))),_0x5b85d4[_0x56e0b9(0x200)]>0x0&&!_0x2adbbb[_0x56e0b9(0x231)]&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x1e5)+_0x5b85d4[_0x56e0b9(0x26d)](',\x20')),_0xaffcb9[_0x56e0b9(0x200)]>0x0&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x2c8)+_0xaffcb9['join'](',\x20')),_0x438730['length']>0x0&&!_0x2adbbb[_0x56e0b9(0x231)]&&console[_0x56e0b9(0x22f)](_0x56e0b9(0x267)+_0x438730[_0x56e0b9(0x26d)](',\x20')),0x0;}}function buildFolderPathToIdMap(_0x2792af){const _0x244e51=a36_0x678b6b,_0x4502d6=new Map(),_0x549f88=new Map();for(const _0x5dc83e of _0x2792af){_0x549f88[_0x244e51(0x1ec)](_0x5dc83e['id'],_0x5dc83e);}const _0x290be6=new Set();for(const _0x516154 of _0x2792af){!_0x516154['parentFolderId']&&_0x290be6[_0x244e51(0x22b)](_0x516154['id']);}function _0x566268(_0xa2fdac){const _0x1f737c=_0x244e51;if(_0x290be6['has'](_0xa2fdac['id']))return'';if(_0xa2fdac['parentFolderId']){const _0x543da2=_0x549f88[_0x1f737c(0x222)](_0xa2fdac[_0x1f737c(0x2a6)]);if(_0x543da2){const _0x44b7af=_0x566268(_0x543da2);return _0x44b7af?_0x44b7af+'/'+_0xa2fdac['name']:_0xa2fdac[_0x1f737c(0x285)];}}return _0xa2fdac[_0x1f737c(0x285)];}for(const _0x4dbb4e of _0x2792af){const _0x354105=_0x566268(_0x4dbb4e);_0x4502d6[_0x244e51(0x1ec)](_0x354105,_0x4dbb4e['id']);}return _0x4502d6;}function findYamlFiles(_0xeb4a87){const _0xb57c39=[];function _0x1304ca(_0x5c236f){const _0x4600ed=a36_0x4aa3,_0x3c4af6=readdirSync(_0x5c236f,{'withFileTypes':!![]});for(const _0x2a17d of _0x3c4af6){const _0x348fc7=a36_0x14a858[_0x4600ed(0x26d)](_0x5c236f,_0x2a17d[_0x4600ed(0x285)]);if(_0x2a17d[_0x4600ed(0x21e)]())_0x1304ca(_0x348fc7);else(_0x2a17d[_0x4600ed(0x285)][_0x4600ed(0x25a)](_0x4600ed(0x28b))||_0x2a17d[_0x4600ed(0x285)][_0x4600ed(0x25a)]('.yaml'))&&_0xb57c39['push'](_0x348fc7);}}return _0x1304ca(_0xeb4a87),_0xb57c39;}function calculateActivationActions(_0x2bf28c,_0x4788ca,_0x5d30ef,_0x274d41){const _0x2cb8c=a36_0x678b6b,_0x5d603d=[],_0x3a4926=new Map();for(const _0x2abd36 of _0x4788ca){_0x3a4926[_0x2cb8c(0x1ec)](_0x2abd36[_0x2cb8c(0x285)],_0x2abd36);}const _0x365dcf=new Map();for(const _0x3e1520 of _0x2bf28c){_0x365dcf['set'](_0x3e1520['name'],_0x3e1520);}for(const _0x417ed3 of _0x2bf28c){const _0x57419b=_0x3a4926[_0x2cb8c(0x222)](_0x417ed3['name']);if(!_0x57419b)_0x5d603d[_0x2cb8c(0x27f)]({'type':_0x2cb8c(0x1e8),'name':_0x417ed3[_0x2cb8c(0x285)],'yamlActivation':_0x417ed3});else{const _0x1f1d57=activationToYaml(_0x57419b,_0x5d30ef,_0x274d41),_0x1024a6=a36_0x1dad46[_0x2cb8c(0x22d)](_0x1f1d57),_0x4944ee=a36_0x1dad46['stringify'](_0x417ed3);_0x1024a6!==_0x4944ee&&_0x5d603d[_0x2cb8c(0x27f)]({'type':'update','name':_0x417ed3[_0x2cb8c(0x285)],'yamlActivation':_0x417ed3,'existingActivation':_0x57419b});}}for(const _0x2f3021 of _0x4788ca){!_0x365dcf[_0x2cb8c(0x289)](_0x2f3021['name'])&&_0x5d603d[_0x2cb8c(0x27f)]({'type':'delete','name':_0x2f3021[_0x2cb8c(0x285)],'existingActivation':_0x2f3021});}return _0x5d603d;}