@treasuredata/tdx 0.25.1 → 0.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x24b027,_0x46d0e5){const _0xf57cf6=a110_0xe770,_0x12a275=_0x24b027();while(!![]){try{const _0x4df7f2=-parseInt(_0xf57cf6(0x21e))/0x1*(parseInt(_0xf57cf6(0x226))/0x2)+-parseInt(_0xf57cf6(0x20d))/0x3*(-parseInt(_0xf57cf6(0x267))/0x4)+parseInt(_0xf57cf6(0x20e))/0x5*(-parseInt(_0xf57cf6(0x206))/0x6)+-parseInt(_0xf57cf6(0x1ac))/0x7*(-parseInt(_0xf57cf6(0x25d))/0x8)+-parseInt(_0xf57cf6(0x1e2))/0x9+-parseInt(_0xf57cf6(0x239))/0xa*(parseInt(_0xf57cf6(0x253))/0xb)+parseInt(_0xf57cf6(0x213))/0xc;if(_0x4df7f2===_0x46d0e5)break;else _0x12a275['push'](_0x12a275['shift']());}catch(_0x52a852){_0x12a275['push'](_0x12a275['shift']());}}}(a110_0x23d9,0x280a7));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4f8c11){return''+PENDING_SEGMENT_PREFIX+_0x4f8c11+'__';}export function isPendingSegmentId(_0xead5b5){const _0x964974=a110_0xe770;return _0xead5b5[_0x964974(0x1b3)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0xb10964){const _0xead6b=a110_0xe770;return _0xb10964[_0xead6b(0x211)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xdb9522){return''+PENDING_ACTIVATION_PREFIX+_0xdb9522+'__';}export function isPendingActivationId(_0x38a26c){return _0x38a26c['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1e6cb2){const _0x5a2fc9=a110_0xe770;return _0x1e6cb2[_0x5a2fc9(0x211)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x5672d2,_0x470852){const _0x578de0=a110_0xe770,_0x20622f=_0x5672d2+'::'+(_0x470852[_0x578de0(0x1c4)]()||_0x578de0(0x20f)),_0x499ddb=createHash(_0x578de0(0x1c9))[_0x578de0(0x27f)](_0x20622f)[_0x578de0(0x1a4)]('hex')[_0x578de0(0x284)](0x0,0xc);return _0x578de0(0x1b6)+_0x499ddb;}export function ensureJourneyDefaults(_0xa447c3){const _0x28e7b4=a110_0xe770;!_0xa447c3[_0x28e7b4(0x25e)]&&(_0xa447c3['description']=''),!_0xa447c3[_0x28e7b4(0x1e4)]&&(_0xa447c3[_0x28e7b4(0x1e4)]=_0x28e7b4(0x259));}export function resolveTDFolderPath(_0x163a27,_0x1fce58,_0x243598){const _0x172b25=a110_0xe770;if(!_0x1fce58)return _0x163a27;if(_0x163a27===_0x243598||_0x163a27[_0x172b25(0x1b3)](_0x243598+'/'))return _0x163a27;return _0x163a27?_0x243598+'/'+_0x163a27:_0x243598;}export function addFoldersToCreate(_0x32a3bb,_0xf6ef7f,_0x24a9e2){const _0x54564e=a110_0xe770;if(!_0x32a3bb)return;if(_0xf6ef7f['has'](_0x32a3bb))return;const _0x5579e2=_0x32a3bb[_0x54564e(0x265)]('/');let _0xfe7627='';for(const _0x5e925e of _0x5579e2){_0xfe7627=_0xfe7627?_0xfe7627+'/'+_0x5e925e:_0x5e925e,!_0xf6ef7f[_0x54564e(0x201)](_0xfe7627)&&_0x24a9e2[_0x54564e(0x257)](_0xfe7627);}}import*as a110_0x3c7318 from'yaml';import{readFileSync}from'fs';import a110_0x350486 from'path';import{isJourneyDef,parseYamlString as a110_0x58e05f,toYamlString as a110_0x26f9fb,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x1dc9e1){const _0x49e04a=a110_0xe770;if(Array[_0x49e04a(0x1d4)](_0x1dc9e1))return'['+_0x1dc9e1[_0x49e04a(0x287)](_0x3481b3=>stableStringify(_0x3481b3))[_0x49e04a(0x1ba)](',')+']';if(_0x1dc9e1&&typeof _0x1dc9e1===_0x49e04a(0x1d2)){const _0x1b69e4=_0x1dc9e1,_0x14f7c1=Object['keys'](_0x1b69e4)[_0x49e04a(0x250)](),_0x6c9a96=_0x14f7c1[_0x49e04a(0x287)](_0x5398c1=>'\x22'+_0x5398c1+'\x22:'+stableStringify(_0x1b69e4[_0x5398c1]));return'{'+_0x6c9a96['join'](',')+'}';}const _0xd7077b=JSON['stringify'](_0x1dc9e1);return _0xd7077b===undefined?_0x49e04a(0x1d5):_0xd7077b;}function activationSignature(_0x253245){const _0x1d3709=a110_0xe770,_0x2d3114={'connection':_0x253245[_0x1d3709(0x1cc)],..._0x253245[_0x1d3709(0x255)]!==undefined&&{'all_columns':_0x253245[_0x1d3709(0x255)]},..._0x253245[_0x1d3709(0x262)]!==undefined&&{'columns':_0x253245[_0x1d3709(0x262)]},..._0x253245['behavior']!==undefined&&{'behavior':_0x253245[_0x1d3709(0x25c)]},..._0x253245[_0x1d3709(0x1b0)]!==undefined&&{'schedule':_0x253245['schedule']},..._0x253245['notification']!==undefined&&{'notification':_0x253245[_0x1d3709(0x1dd)]},..._0x253245[_0x1d3709(0x268)]!==undefined&&{'connector_config':_0x253245[_0x1d3709(0x268)]},..._0x253245[_0x1d3709(0x1b4)]!==undefined&&{'activation_template_id':_0x253245[_0x1d3709(0x1b4)]}};return stableStringify(_0x2d3114);}export async function prepareSegmentFiles(_0x6d83ec,_0x1f3b7c,_0x10bc0e,_0x281c11,_0x1bafb8){const _0x239b21=a110_0xe770,{activationDefToCreateRequest:_0x32444f}=await import(_0x239b21(0x1fd)),_0x68d14e=[],_0x239584=new Set();for(const {yamlConfig:_0x52024f,folderPath:_0x5a3987,sourcePath:_0x37e83f}of _0x6d83ec){const _0x20a3bf=resolveTDFolderPath(_0x5a3987,_0x281c11,_0x1bafb8),_0x3f736d=_0x20a3bf+':'+_0x52024f[_0x239b21(0x244)],_0x319ff9=_0x1f3b7c[_0x239b21(0x1c7)]['get'](_0x3f736d),_0x23e94c=_0x319ff9?_0x1f3b7c['activationsBySegmentId'][_0x239b21(0x223)](_0x319ff9['id'])||[]:[];addFoldersToCreate(_0x20a3bf,_0x1f3b7c[_0x239b21(0x252)],_0x239584);const _0x4a76ba=calculateActivationActions(_0x52024f[_0x239b21(0x20b)]||[],_0x23e94c,_0x1f3b7c['idToEmailMap'],_0x1f3b7c['connectionIdToNameMap']);for(const _0x2d3e9b of _0x4a76ba){(_0x2d3e9b[_0x239b21(0x1b8)]===_0x239b21(0x1fe)||_0x2d3e9b['type']==='update')&&_0x2d3e9b[_0x239b21(0x1b5)]&&(_0x2d3e9b[_0x239b21(0x24d)]=await _0x32444f(_0x2d3e9b[_0x239b21(0x1b5)],_0x10bc0e));}const _0x339c36=calculateSegmentDiff(_0x52024f,_0x319ff9,_0x23e94c,_0x1f3b7c[_0x239b21(0x26e)],_0x1f3b7c[_0x239b21(0x1a7)]);_0x68d14e['push']({'relativePath':_0x52024f[_0x239b21(0x244)],'absolutePath':_0x37e83f,'yamlConfig':_0x52024f,'folderPath':_0x20a3bf,'existingSegment':_0x319ff9,'existingActivations':_0x23e94c,'isNew':_0x339c36[_0x239b21(0x1f5)],'hasChanges':_0x339c36[_0x239b21(0x21a)],'diff':_0x339c36['diff'],'activationActions':_0x4a76ba});}return{'segmentFiles':_0x68d14e,'foldersToCreate':_0x239584};}export async function prepareJourneyFiles(_0x5c3dcf,_0x55c174,_0x27de2c,_0x5b9a8f){const _0x4f12bb=a110_0xe770,_0x2eebeb=[],_0x58f389=new Set();for(const {yamlConfig:_0x24024e,folderPath:_0x531868,sourcePath:_0x3a89ea}of _0x5c3dcf){const _0x3fefb6=resolveTDFolderPath(_0x531868,_0x27de2c,_0x5b9a8f),_0x59f7ef=_0x3fefb6+':'+_0x24024e[_0x4f12bb(0x244)],_0x4c1343=_0x55c174['journeyBundlesByFolderAndName'][_0x4f12bb(0x223)](_0x59f7ef);let _0x292868,_0x57593b;if(_0x4c1343&&_0x4c1343[_0x4f12bb(0x281)]>0x0){const _0x2126e8=buildLocalExpandedRuleMappings(_0x24024e),{createYamlContext:_0x1b7e5e,prefetchJourneySegments:_0x261584}=createPushYamlContextForBundle(_0x55c174[_0x4f12bb(0x1da)],_0x55c174['parentId'],_0x55c174[_0x4f12bb(0x236)],_0x2126e8,_0x55c174[_0x4f12bb(0x26e)],_0x55c174[_0x4f12bb(0x1a7)],_0x55c174[_0x4f12bb(0x238)],_0x55c174[_0x4f12bb(0x1ed)]);await _0x261584(_0x4c1343[_0x4f12bb(0x287)](_0x47ae44=>_0x47ae44['id']));const _0xfad359=hasMultipleVersions(_0x24024e),_0x2361f1=async _0x12f147=>{const _0x62b816=_0x4f12bb,_0x546724=_0x55c174[_0x62b816(0x1ed)]?.[_0x62b816(0x223)](_0x12f147);if(_0x546724)return _0x546724;return _0x55c174[_0x62b816(0x24c)]({'journeyId':_0x12f147,'journeyName':_0x24024e[_0x62b816(0x244)],'isMultiVersion':_0x4c1343[_0x62b816(0x281)]>0x1});};if(_0xfad359&&_0x4c1343[_0x4f12bb(0x281)]>0x1){const _0x468007=[];for(const _0x173856 of _0x4c1343){const _0x190b9a=_0x173856['versionNumber']||0x1;_0x55c174[_0x4f12bb(0x232)]?.[_0x4f12bb(0x27f)](_0x4f12bb(0x26b)+_0x24024e[_0x4f12bb(0x244)]+'\x20v'+_0x190b9a);const _0x322ef7=await _0x2361f1(_0x173856['id']),_0x24a2ef=_0x1b7e5e(_0x173856['id']),_0x2def7f=await journeyResponseToDef(_0x322ef7,_0x24a2ef);_0x468007[_0x4f12bb(0x241)]({'item':_0x173856,'yaml':_0x2def7f});}const _0x173fb2=buildLocalRuleToNameMappingFromJourney(_0x24024e);_0x57593b=buildMergedJourneyDef(_0x468007,_0x173fb2);const _0x587485=Math[_0x4f12bb(0x266)](..._0x468007[_0x4f12bb(0x287)](_0x167e3e=>_0x167e3e[_0x4f12bb(0x1f3)][_0x4f12bb(0x1d1)]||0x0)),_0x404308=_0x4c1343[_0x4f12bb(0x210)](_0x19cef9=>(_0x19cef9[_0x4f12bb(0x1d1)]||0x0)===_0x587485);_0x404308&&(_0x55c174['progress']?.[_0x4f12bb(0x27f)]('Fetching\x20'+_0x24024e[_0x4f12bb(0x244)]+'\x20v'+_0x587485),_0x292868=await _0x2361f1(_0x404308['id']));}else{const _0x513f9c=_0x4c1343[_0x4c1343[_0x4f12bb(0x281)]-0x1];_0x55c174[_0x4f12bb(0x232)]?.[_0x4f12bb(0x27f)]('Fetching\x20'+_0x24024e[_0x4f12bb(0x244)]),_0x292868=await _0x2361f1(_0x513f9c['id']);const _0x1af90b=_0x1b7e5e(_0x513f9c['id']),_0x3ba39e=await journeyResponseToDef(_0x292868,_0x1af90b),_0x1ad0d0=buildLocalRuleToNameMappingFromJourney(_0x24024e);_0x57593b=buildMergedJourneyDef([{'item':_0x513f9c,'yaml':_0x3ba39e}],_0x1ad0d0);}}addFoldersToCreate(_0x3fefb6,_0x55c174['folderPathToId'],_0x58f389);const _0x1c07b6=calculateJourneyDiff(_0x24024e,_0x57593b);_0x2eebeb[_0x4f12bb(0x241)]({'relativePath':_0x24024e[_0x4f12bb(0x244)],'absolutePath':_0x3a89ea,'yamlConfig':_0x24024e,'folderPath':_0x3fefb6,'existingJourney':_0x292868,'isNew':_0x1c07b6['isNew'],'hasChanges':_0x1c07b6[_0x4f12bb(0x21a)],'diff':_0x1c07b6['diff']});}return{'journeyFiles':_0x2eebeb,'foldersToCreate':_0x58f389};}export function calculateActivationActions(_0x46cba6,_0x3f845e,_0x5b5a35,_0x5794ce){const _0x728b2f=a110_0xe770,_0xa11bc9=[],_0x263871=new Map();for(const _0x54abd7 of _0x3f845e){_0x263871[_0x728b2f(0x219)](_0x54abd7['name'],_0x54abd7);}const _0x3dfe2d=new Map();for(const _0x145276 of _0x46cba6){_0x3dfe2d[_0x728b2f(0x219)](_0x145276[_0x728b2f(0x244)],_0x145276);}for(const _0x476f03 of _0x46cba6){const _0x242bd7=_0x263871[_0x728b2f(0x223)](_0x476f03[_0x728b2f(0x244)]);if(!_0x242bd7)_0xa11bc9[_0x728b2f(0x241)]({'type':_0x728b2f(0x1fe),'name':_0x476f03[_0x728b2f(0x244)],'yamlActivation':_0x476f03});else{const _0x44bc00=activationResponseToDef(_0x242bd7,_0x5b5a35,_0x5794ce),_0xab73ac=a110_0x3c7318['stringify'](_0x44bc00),_0x3f486d=a110_0x3c7318[_0x728b2f(0x1c1)](_0x476f03);_0xab73ac!==_0x3f486d&&_0xa11bc9[_0x728b2f(0x241)]({'type':_0x728b2f(0x27f),'name':_0x476f03[_0x728b2f(0x244)],'yamlActivation':_0x476f03,'existingActivation':_0x242bd7});}}for(const _0x2c4736 of _0x3f845e){!_0x3dfe2d[_0x728b2f(0x201)](_0x2c4736['name'])&&_0xa11bc9[_0x728b2f(0x241)]({'type':_0x728b2f(0x1be),'name':_0x2c4736[_0x728b2f(0x244)],'existingActivation':_0x2c4736});}return _0xa11bc9;}export function calculateSegmentDiff(_0x55f3f7,_0x4f2f58,_0x4c190c,_0x40edb4,_0x132b38){const _0x1b5b09=segmentToYamlString(_0x55f3f7);if(_0x4f2f58){const _0x121dd2=segmentWithActivationsToYaml(_0x4f2f58,_0x4c190c,undefined,_0x40edb4,_0x132b38),_0x395f95=segmentToYamlString(_0x121dd2),_0x5f1072=generateDiff(_0x395f95,_0x1b5b09),_0xdb86c9=hasChanges(_0x5f1072);return{'isNew':![],'hasChanges':_0xdb86c9,'diff':_0xdb86c9?formatDiffWithColors(_0x5f1072):undefined};}const _0x5c8fac=generateDiff('',_0x1b5b09);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5c8fac)};}export function calculateJourneyDiff(_0x24fc6d,_0x4dc9e2){const _0x36a504=normalizeJourneyDef(_0x24fc6d,_0x24fc6d),_0x47fa24=a110_0x26f9fb(_0x36a504);if(_0x4dc9e2){const _0x487d90=normalizeJourneyDef(_0x4dc9e2,_0x24fc6d),_0x5a7c2a=a110_0x26f9fb(_0x487d90),_0x205e19=generateDiff(_0x5a7c2a,_0x47fa24),_0x746117=hasChanges(_0x205e19);return{'isNew':![],'hasChanges':_0x746117,'diff':_0x746117?formatDiffWithColors(_0x205e19):undefined};}const _0x4ea098=generateDiff('',_0x47fa24);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4ea098)};}export function findSegmentsToDelete(_0x4ad7c0,_0x29000d,_0x4a49f1,_0x373caf,_0x9500eb){const _0x33cfa9=a110_0xe770,_0x1e5412=new Set();for(const {yamlConfig:_0x5240ad,folderPath:_0x8b3d1a}of _0x29000d){_0x1e5412['add'](_0x8b3d1a+':'+_0x5240ad[_0x33cfa9(0x244)]);}return _0x4ad7c0[_0x33cfa9(0x1d7)](_0x1392ba=>{const _0x3ac615=_0x33cfa9,_0x593287=_0x1392ba[_0x3ac615(0x200)]?_0x4a49f1[_0x3ac615(0x223)](_0x1392ba[_0x3ac615(0x200)]['toString']())||'':'',_0x13b84f=_0x593287+':'+_0x1392ba[_0x3ac615(0x244)];if(_0x1e5412[_0x3ac615(0x201)](_0x13b84f))return![];if(_0x9500eb)return _0x593287===_0x373caf||_0x593287[_0x3ac615(0x1b3)](_0x373caf+'/');return!![];});}export function findJourneysToDelete(_0xc68b95,_0x1cb248,_0x34d7b0,_0x59ed3b,_0x16e5b1){const _0x41d0b5=a110_0xe770,_0x1c5f18=new Set();for(const {yamlConfig:_0x78d0,folderPath:_0x18abc5}of _0x1cb248){_0x1c5f18['add'](_0x18abc5+':'+_0x78d0[_0x41d0b5(0x244)]);}return _0xc68b95[_0x41d0b5(0x1d7)](_0x4baca2=>{const _0x57bb1f=_0x41d0b5,_0x6f88a5=_0x4baca2[_0x57bb1f(0x1e6)]?_0x34d7b0[_0x57bb1f(0x223)](_0x4baca2[_0x57bb1f(0x1e6)])||'':'',_0x1dbb30=_0x6f88a5+':'+_0x4baca2[_0x57bb1f(0x1e9)];if(_0x1c5f18[_0x57bb1f(0x201)](_0x1dbb30))return![];if(_0x16e5b1)return _0x6f88a5===_0x59ed3b||_0x6f88a5[_0x57bb1f(0x1b3)](_0x59ed3b+'/');return!![];});}export function buildSegmentLookupMap(_0x31e5e4,_0x5bfd28){const _0xe49fe7=a110_0xe770,_0x2d25b2=new Map();for(const _0x3a8541 of _0x31e5e4){const _0x3351c7=_0x3a8541['segmentFolderId']?_0x5bfd28[_0xe49fe7(0x223)](_0x3a8541['segmentFolderId'][_0xe49fe7(0x217)]())||'':'',_0x5c9eb4=_0x3351c7+':'+_0x3a8541['name'];_0x2d25b2['set'](_0x5c9eb4,_0x3a8541);}return _0x2d25b2;}export function buildSegmentNameToIdMap(_0x38ca02){const _0x2127c0=a110_0xe770,_0x4668e3=new Map();for(const _0x538cf1 of _0x38ca02){_0x4668e3[_0x2127c0(0x219)](_0x538cf1[_0x2127c0(0x244)],_0x538cf1['id']);}return _0x4668e3;}export function buildJourneyBundleLookupMap(_0x52970b,_0x437869){const _0x452d58=a110_0xe770,_0x155de3=new Map();for(const _0x12d631 of _0x52970b){const _0x416550=_0x12d631[_0x452d58(0x1e6)]?_0x437869['get'](_0x12d631[_0x452d58(0x1e6)])||'':'',_0x55281d=_0x416550+':'+_0x12d631[_0x452d58(0x1e9)];!_0x155de3['has'](_0x55281d)&&_0x155de3[_0x452d58(0x219)](_0x55281d,[]),_0x155de3[_0x452d58(0x223)](_0x55281d)[_0x452d58(0x241)](_0x12d631);}for(const _0x71d070 of _0x155de3[_0x452d58(0x1a8)]()){_0x71d070['sort']((_0x578506,_0x102bec)=>(_0x578506[_0x452d58(0x1d1)]||0x0)-(_0x102bec['versionNumber']||0x0));}return _0x155de3;}export function collectFoldersToCreate(_0x1e54f6,_0x489ea2){const _0x5e8a39=a110_0xe770,_0x371f9e=new Set();for(const _0x326a53 of _0x1e54f6){if(!_0x326a53)continue;if(_0x489ea2[_0x5e8a39(0x201)](_0x326a53))continue;const _0x59a33d=_0x326a53[_0x5e8a39(0x265)]('/');let _0x327ce3='';for(const _0x2d5f7c of _0x59a33d){_0x327ce3=_0x327ce3?_0x327ce3+'/'+_0x2d5f7c:_0x2d5f7c,!_0x489ea2['has'](_0x327ce3)&&_0x371f9e[_0x5e8a39(0x257)](_0x327ce3);}}return _0x371f9e;}function a110_0x23d9(){const _0x93387f=['getSegment','sha1','./journey-yaml.js','Creating\x20activation\x20\x27','connection','relationships','effectiveFolderId','NOT_FOUND','journey','versionNumber','object','all','isArray','null','createdSegmentIds','filter','createActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','deps','getJourney','updateSegmentById','notification','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','journeys','verbose','folderPath','1397961WEKNbh','Activation','state','list','folderId','keys','Creating\x20folder\x20\x27','journeyBundleName','activation_','with','):\x20','journeyById','segment_updated','\x27\x20from\x20file:\x20','relative','branches','yamlConfig','item','segments','isNew','utf-8','errors','segmentId','existingActivation','activationParams','withProgress','flatMap','./child-segment-yaml.js','create','from','segmentFolderId','has','createJourneySegment','logInfo','segmentNameToId','folder_creating','6PUvqoZ','Failed\x20to\x20','existingJourney','DecisionPoint','../../utils/async.js','activations','skipSegments','32304IPkoqv','1559515vxMRTX','segment','find','replace','\x20activation\x20\x27','5066856XfxFEO','absolutePath','size','onProgress','toString','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','set','hasChanges','rule','Segment\x20not\x20found:\x20','Updating\x20activation\x20\x27','105568jvYtrQ','entry_criteria','SEGMENT_UPDATE_ERROR','journey_updating','stages','get','goal','logDeleted','2ijYYPt','Creating\x20segment\x20\x27','segment_creating','activation_creating','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','results','Deleted\x20segment\x20\x27','dirname','toLowerCase','Journey\x20\x27','valid','folder','progress','Updated\x20segment\x20\x27','SEGMENT_NOT_FOUND','getActivation','existingSegments','Updated\x20journey\x20\x27','activationStepsById','60oXPhUU','resolveSegment','segment_updating','updateActivation','decision_point','deleted','existingSegment','parseDocument','push','goal\x20criteria','logWarning','name','action','folder_created','Activation\x20not\x20found:\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','user','message','exitCriterias','fetchJourney','validatedRequest','rootFolderId','nameToId','sort','kind','folderPathToId','187638sBVVxs','segment_created','all_columns','\x27\x20wait\x20condition','add','buildUserMaps','draft','\x20(referenced\x20in\x20journey\x20','parentFolder','behavior','24trUWbu','description','embedded_activation_creating','parse','index','columns','data','created','split','max','52EFoEYm','connector_config','\x20journey\x20from\x20file:\x20','\x27\x20exit\x20criteria','Fetching\x20','Entry\x20criteria:\x20','INTERNAL','idToEmailMap','activation_deleted','\x20segment\x20from\x20file:\x20','entryCriteria','embedded_segment_created','entry','idToName','Created\x20folder\x20\x27','Deleting\x20activation\x20\x27','listActivations','milestone','activation_deleting','parentId','journeyActivationStepId','\x27\x20entry\x20criteria','logSuccess','stage\x20\x27','update','steps','length','Created\x20segment\x20\x27','journeyStages','slice','waitCondition','Created\x20activation\x20\x27','map','updated','digest','\x27...','attributes','connectionIdToNameMap','values','createdSegmentId','\x0a\x20\x20','segment_deleting','646177ODrAYt','\x27\x20decision\x20point\x20branch\x20\x27','listSegments','activation_created','schedule','WaitStep','segment_deleted','startsWith','activation_template_id','yamlActivation','journey_entry_criteria_','parentSegmentFolder','type','\x27\x20milestone','join','entries','unchanged','includes','delete','Updated\x20activation\x20\x27','Updating\x20segment\x20\x27','stringify','embeddedSegmentNameToId','ACTIVATION_UPDATE_ERROR','trim','activation_updating','journey_updated','segmentByFolderAndName'];a110_0x23d9=function(){return _0x93387f;};return a110_0x23d9();}export function parseAndClassifyYamlFiles(_0x2f051b,_0x2b878f,_0x2cb764){const _0x2f6679=a110_0xe770,_0x3bf67d=[],_0x4ef5a5=[];for(const _0x5445d9 of _0x2f051b){const _0x3eb297=a110_0x350486[_0x2f6679(0x1f0)](_0x2b878f,a110_0x350486[_0x2f6679(0x22d)](_0x5445d9)),_0x5d0e1c=_0x3eb297==='.'?'':_0x3eb297,_0x5e83b5=readFileSync(_0x5445d9,_0x2f6679(0x1f6)),_0x239b93=a110_0x3c7318[_0x2f6679(0x260)](_0x5e83b5);if(isJourneyDef(_0x239b93)){const _0x115c0a=a110_0x58e05f(_0x5e83b5);_0x4ef5a5[_0x2f6679(0x241)]({'yamlConfig':_0x115c0a,'folderPath':_0x5d0e1c,'sourcePath':_0x5445d9});}else{if(!_0x2cb764?.[_0x2f6679(0x20c)]){const _0x1ca6d5=parseSegmentYamlFile(_0x5e83b5),_0x4ab401=normalizeChildSegmentYaml(_0x1ca6d5);_0x3bf67d[_0x2f6679(0x241)]({'yamlConfig':_0x4ab401,'folderPath':_0x5d0e1c,'sourcePath':_0x5445d9});}}}return{'segments':_0x3bf67d,'journeys':_0x4ef5a5};}export function validateParsedFiles(_0x17d163,_0x3d44f4){const _0x5e634a=a110_0xe770,_0x54b818=[];for(const {yamlConfig:_0x29737f,sourcePath:_0x420f03}of _0x17d163['segments']){const _0x29d635=readFileSync(_0x420f03,_0x5e634a(0x1f6)),_0x3da7df=a110_0x3c7318[_0x5e634a(0x240)](_0x29d635),_0x4942ba=validateSegmentDef(_0x29737f,{'source':_0x29d635,'document':_0x3da7df});if(!_0x4942ba[_0x5e634a(0x230)]){const _0x5717e8=a110_0x350486['relative'](_0x3d44f4,_0x420f03);_0x54b818[_0x5e634a(0x241)]({'filePath':_0x5717e8,'source':_0x29d635,'result':_0x4942ba,'isJourney':![]});}}for(const {yamlConfig:_0x1fe4e1,sourcePath:_0x45690d}of _0x17d163['journeys']){const _0x260ef3=readFileSync(_0x45690d,_0x5e634a(0x1f6)),_0x776df9=a110_0x3c7318[_0x5e634a(0x240)](_0x260ef3),_0x23580a=validateJourneyDef(_0x1fe4e1,{'source':_0x260ef3,'document':_0x776df9});if(!_0x23580a[_0x5e634a(0x230)]){const _0x53ba56=a110_0x350486[_0x5e634a(0x1f0)](_0x3d44f4,_0x45690d);_0x54b818['push']({'filePath':_0x53ba56,'source':_0x260ef3,'result':_0x23580a,'isJourney':!![]});}}return _0x54b818;}export function formatValidationErrors(_0x1bca85){const _0x62e7b2=a110_0xe770,_0xc95162=[];for(const {filePath:_0x4441d3,source:_0x393f39,result:_0x4ca959,isJourney:_0x5c9616}of _0x1bca85){const _0x449a2a=_0x5c9616?_0x62e7b2(0x1d0):_0x62e7b2(0x20f);_0xc95162['push']('\x0a'+_0x4441d3+'\x20('+_0x449a2a+_0x62e7b2(0x1ec)+_0x4ca959[_0x62e7b2(0x1f7)][_0x62e7b2(0x281)]+'\x20error(s)'),_0xc95162[_0x62e7b2(0x241)](formatValidationResult(_0x4ca959,_0x393f39,_0x4441d3));}return _0xc95162[_0x62e7b2(0x1ba)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4b6e84){const _0x4f07b5=a110_0xe770,_0x180a5b=new Set(),_0x51415d=new Map(),_0x5c597e=collectSegmentUsageCounts(_0x4b6e84);if(_0x4b6e84[_0x4f07b5(0x1f4)])for(const [_0xac8c07,_0x3cc272]of Object[_0x4f07b5(0x1bb)](_0x4b6e84[_0x4f07b5(0x1f4)])){_0x180a5b[_0x4f07b5(0x257)](_0xac8c07);if(_0x3cc272[_0x4f07b5(0x21b)]){const _0x5e8e96=yamlRuleToApi(_0x3cc272['rule']),_0x5110e4=apiRuleToYaml(_0x5e8e96);_0x51415d[_0x4f07b5(0x219)](_0xac8c07,_0x5110e4);}}const _0x5f51f6=new Map();let _0x39539a=0x0;for(const [_0xbfdeb0,_0x3c8034]of _0x51415d){const _0x34d63f=serializeExpandedRule(_0x3c8034,_0x51415d),_0x3100ae=_0x5f51f6[_0x4f07b5(0x223)](_0x34d63f)||[];_0x3100ae['push']({'name':_0xbfdeb0,'index':_0x39539a}),_0x5f51f6[_0x4f07b5(0x219)](_0x34d63f,_0x3100ae),_0x39539a++;}const _0x28e5d4=new Map();for(const [_0x5c0018,_0x10b930]of _0x5f51f6){const _0x400f5c=_0x10b930[_0x4f07b5(0x284)]()[_0x4f07b5(0x250)]((_0x39d82c,_0x2d969b)=>{const _0x212474=_0x4f07b5,_0x384bdf=_0x5c597e[_0x212474(0x223)](_0x39d82c[_0x212474(0x244)])||0x0,_0x29172b=_0x5c597e['get'](_0x2d969b['name'])||0x0;if(_0x384bdf!==_0x29172b)return _0x29172b-_0x384bdf;return _0x39d82c[_0x212474(0x261)]-_0x2d969b[_0x212474(0x261)];})['map'](_0x11aed1=>_0x11aed1[_0x4f07b5(0x244)]),_0x33ca12=[];for(const _0x4b4eb1 of _0x400f5c){const _0x2fa060=_0x5c597e[_0x4f07b5(0x223)](_0x4b4eb1)||0x0,_0xdbe5e1=Math['max'](_0x2fa060,0x1);for(let _0xb78569=0x0;_0xb78569<_0xdbe5e1;_0xb78569++){_0x33ca12[_0x4f07b5(0x241)](_0x4b4eb1);}}_0x28e5d4[_0x4f07b5(0x219)](_0x5c0018,_0x33ca12);}return{'existingLocalSegmentNames':_0x180a5b,'localSegmentRules':_0x51415d,'localExpandedRuleToNames':_0x28e5d4};}async function buildServerSegmentRuleMap(_0x53bbaa,_0x1a613e,_0x422132,_0x5a3547){const _0x132c26=new Map(),_0x388a50=new Set(),_0x2d69c3=async _0x1a3028=>{const _0x1465a3=a110_0xe770;if(_0x388a50[_0x1465a3(0x201)](_0x1a3028))return;_0x388a50[_0x1465a3(0x257)](_0x1a3028);let _0xb580b=_0x422132['find'](_0x2e167e=>_0x2e167e['id']===_0x1a3028);if(!_0xb580b)try{_0xb580b=await _0x53bbaa[_0x1465a3(0x20f)]['getSegment'](_0x1a613e,_0x1a3028);}catch{return;}if(!_0xb580b?.[_0x1465a3(0x21b)])return;const _0x15a860=apiRuleToYaml(_0xb580b[_0x1465a3(0x21b)]);_0x132c26[_0x1465a3(0x219)](_0x1a3028,_0x15a860);const _0xf0676a=collectSegmentRefsFromRule(_0x15a860);for(const _0x24bc1d of _0xf0676a){await _0x2d69c3(_0x24bc1d);}};for(const _0x25f8ba of _0x5a3547){await _0x2d69c3(_0x25f8ba);}return _0x132c26;}export function createSegmentIdResolver(_0xab12b0,_0xc451ec){return async _0x528eae=>{const _0x422182=a110_0xe770,_0xf56015=_0xab12b0[_0x422182(0x223)](_0x528eae);if(!_0xf56015)throw new SDKError(ErrorCode[_0x422182(0x234)],'Segment\x20not\x20found:\x20'+_0x528eae+_0x422182(0x1de)+_0xc451ec+'\x27)');return _0xf56015;};}export function extractRootFolderId(_0x30041a){const _0x5ad1c8=a110_0xe770;return _0x30041a['relationships']?.[_0x5ad1c8(0x1b7)]?.[_0x5ad1c8(0x263)]?.['id']||_0x30041a[_0x5ad1c8(0x1cd)]?.[_0x5ad1c8(0x25b)]?.[_0x5ad1c8(0x263)]?.['id'];}export function buildConnectionMaps(_0x39e18a){const _0x5224aa=a110_0xe770,_0x29f83c=new Map(),_0x3d1b65=new Map(),_0x400c9a=new Map();for(const _0x571226 of _0x39e18a){_0x29f83c['set'](_0x571226[_0x5224aa(0x244)],parseInt(_0x571226['id'],0xa)),_0x3d1b65[_0x5224aa(0x219)](_0x571226['id'],_0x571226[_0x5224aa(0x244)]),_0x400c9a[_0x5224aa(0x219)](_0x571226[_0x5224aa(0x244)],_0x571226[_0x5224aa(0x1b8)]);}return{'nameToId':_0x29f83c,'idToName':_0x3d1b65,'nameToType':_0x400c9a};}export function calculatePushStats(_0x23fbcb,_0x3c5fc2,_0x485a00,_0x29ae46,_0x50f6d6,_0x50ebda,_0x2ac1c0){const _0x56e40b=a110_0xe770,_0xecbb38=_0x23fbcb[_0x56e40b(0x1d7)](_0xb6385f=>_0xb6385f[_0x56e40b(0x1f5)]),_0x69f77f=_0x23fbcb[_0x56e40b(0x1d7)](_0x473e09=>!_0x473e09[_0x56e40b(0x1f5)]&&_0x473e09['hasChanges']),_0x19375f=_0x23fbcb[_0x56e40b(0x1d7)](_0x28f511=>!_0x28f511[_0x56e40b(0x1f5)]&&!_0x28f511[_0x56e40b(0x21a)]),_0x2812e7=_0x50ebda?_0x29ae46:[],_0x480367=_0x3c5fc2['filter'](_0x23c994=>_0x23c994['isNew']),_0x3144e=_0x3c5fc2[_0x56e40b(0x1d7)](_0x536481=>!_0x536481[_0x56e40b(0x1f5)]&&_0x536481['hasChanges']),_0x13709d=_0x3c5fc2[_0x56e40b(0x1d7)](_0xb2e13e=>!_0xb2e13e['isNew']&&!_0xb2e13e[_0x56e40b(0x21a)]),_0x3bbd84=_0x50ebda?_0x50f6d6:[],_0x15764c=_0x23fbcb[_0x56e40b(0x1fc)](_0x57d9ab=>_0x57d9ab['activationActions']),_0x45f057=_0x15764c['filter'](_0x4a673c=>_0x4a673c[_0x56e40b(0x1b8)]===_0x56e40b(0x1fe)),_0x1e277d=_0x15764c['filter'](_0x498dbd=>_0x498dbd[_0x56e40b(0x1b8)]==='update'),_0x160973=_0x15764c[_0x56e40b(0x1d7)](_0x751ec5=>_0x751ec5[_0x56e40b(0x1b8)]===_0x56e40b(0x1be)),_0x32b338=Array[_0x56e40b(0x1ff)](_0x485a00)[_0x56e40b(0x250)](),_0xb339da=_0x2ac1c0?![]:_0xecbb38[_0x56e40b(0x281)]>0x0||_0x69f77f['length']>0x0||_0x2812e7[_0x56e40b(0x281)]>0x0,_0x2f7b1a=_0x480367[_0x56e40b(0x281)]>0x0||_0x3144e[_0x56e40b(0x281)]>0x0||_0x3bbd84[_0x56e40b(0x281)]>0x0,_0x32cc82=_0x2ac1c0?![]:_0x15764c[_0x56e40b(0x281)]>0x0,_0x2b4218=_0x32b338['length']>0x0;return{'segments':{'new':_0xecbb38,'changed':_0x69f77f,'unchanged':_0x19375f,'toDelete':_0x2812e7},'journeys':{'new':_0x480367,'changed':_0x3144e,'unchanged':_0x13709d,'toDelete':_0x3bbd84},'activations':{'all':_0x15764c,'toCreate':_0x45f057,'toUpdate':_0x1e277d,'toDelete':_0x160973},'folders':{'toCreate':_0x32b338},'counts':{'segments':{'new':_0xecbb38[_0x56e40b(0x281)],'changed':_0x69f77f['length'],'unchanged':_0x19375f[_0x56e40b(0x281)],'toDelete':_0x2812e7[_0x56e40b(0x281)]},'journeys':{'new':_0x480367['length'],'changed':_0x3144e[_0x56e40b(0x281)],'unchanged':_0x13709d[_0x56e40b(0x281)],'toDelete':_0x3bbd84[_0x56e40b(0x281)]},'activations':{'create':_0x45f057[_0x56e40b(0x281)],'update':_0x1e277d[_0x56e40b(0x281)],'delete':_0x160973[_0x56e40b(0x281)]},'folders':_0x32b338['length']},'hasChanges':_0xb339da||_0x2f7b1a||_0x32cc82||_0x2b4218};}export async function buildPushExecutionContext(_0x457449,_0x122f31,_0x1663be,_0x49da7b,_0x52e7c5,_0x447882){const _0x3bd08c=a110_0xe770,_0x31304d=extractRootFolderId(_0x1663be),{pathToId:_0x2cf4ae,idToPath:_0x3e4a71}=buildFolderMaps(_0x52e7c5),_0x2a8bfd=buildSegmentNameToIdMap(_0x49da7b),_0x1c85db=new Map(),{batchAsync:_0x4dbf4e}=await import('../../utils/async.js'),[_0x4599ab,_0x49999a]=await Promise['all']([_0x457449[_0x3bd08c(0x249)][_0x3bd08c(0x258)](),_0x457449[_0x3bd08c(0x1cc)][_0x3bd08c(0x1e5)](),((async()=>{!_0x447882&&_0x49da7b['length']>0x0&&await _0x4dbf4e(_0x49da7b,async _0x112e6c=>{const _0x3a6a78=a110_0xe770,_0x65eb6d=await _0x457449[_0x3a6a78(0x20f)][_0x3a6a78(0x277)](_0x122f31,_0x112e6c['id']);_0x1c85db['set'](_0x112e6c['id'],_0x65eb6d);});})())]),{emailToId:_0x5b06c7,idToEmail:_0x2156d8}=_0x4599ab,_0x584ca9=buildConnectionMaps(_0x49999a);return{'rootFolderId':_0x31304d,'folderPathToId':_0x2cf4ae,'folderIdToPath':_0x3e4a71,'segmentNameToId':_0x2a8bfd,'activationsBySegmentId':_0x1c85db,'emailToIdMap':_0x5b06c7,'idToEmailMap':_0x2156d8,'connectionNameToIdMap':_0x584ca9[_0x3bd08c(0x24f)],'connectionIdToNameMap':_0x584ca9[_0x3bd08c(0x274)],'connectionNameToTypeMap':_0x584ca9['nameToType']};}export function createPushYamlContextForBundle(_0x152fce,_0x819546,_0x5a7ac3,_0x4fea8f,_0x7142e4,_0xa6247a,_0x1327c3,_0x26f212){const {existingLocalSegmentNames:_0x1e672e,localExpandedRuleToNames:_0x7706f8}=_0x4fea8f,_0x45437c=new Set(),_0x52e549=new Map(),_0x438349=new Map(),_0xeebe50=new Map(),_0x401927=createJumpTargetCache(),_0x371977=new Map(),_0x1ccf5d=new Map(),_0xb390a5=new Set();let _0x3676e4;const _0x2a0b6a=_0x150e1a=>{const _0x6ca74d={'resolveSegment':async _0x327101=>{const _0x386257=a110_0xe770,_0xec069b=_0xeebe50[_0x386257(0x223)](_0x327101);if(_0xec069b!==undefined)return{'name':_0xec069b,'isJourneyLocal':!![]};try{let _0xdaee38=_0x5a7ac3[_0x386257(0x210)](_0x62a526=>_0x62a526['id']===_0x327101);!_0xdaee38&&(_0xdaee38=await _0x152fce[_0x386257(0x20f)][_0x386257(0x1c8)](_0x819546,_0x327101));const _0x75cc28=generateJourneyLocalName(_0xdaee38[_0x386257(0x244)]),_0x3a7111=_0xdaee38[_0x386257(0x251)]===SEGMENT_KIND_JOURNEY&&_0x75cc28!==undefined;let _0xc6911=_0xdaee38[_0x386257(0x244)],_0xbc0489;if(_0x3a7111&&_0xdaee38['rule']){const _0x5b7f40=apiRuleToYaml(_0xdaee38[_0x386257(0x21b)]);_0x1ccf5d[_0x386257(0x219)](_0x327101,_0x5b7f40);const _0x2413c5=async _0x1bc865=>{const _0x43e7a3=_0x386257,_0x4d46fa=collectSegmentRefsFromRule(_0x1bc865);for(const _0x18ac1f of _0x4d46fa){if(!_0x1ccf5d[_0x43e7a3(0x201)](_0x18ac1f))try{const _0x408600=await _0x152fce[_0x43e7a3(0x20f)][_0x43e7a3(0x1c8)](_0x819546,_0x18ac1f);if(_0x408600?.['rule']){const _0x9bcfad=apiRuleToYaml(_0x408600[_0x43e7a3(0x21b)]);_0x1ccf5d['set'](_0x18ac1f,_0x9bcfad),await _0x2413c5(_0x9bcfad);}}catch{}}};await _0x2413c5(_0x5b7f40);const _0x522619=serializeExpandedRule(_0x5b7f40,_0x1ccf5d),_0x30f953=_0x7706f8[_0x386257(0x223)](_0x522619);if(_0x30f953&&_0x30f953[_0x386257(0x281)]>0x0){const _0x3cdb53=_0x52e549[_0x386257(0x223)](_0x522619)||0x0,_0x3d8ff7=_0x30f953[_0x3cdb53]||_0x30f953[_0x30f953[_0x386257(0x281)]-0x1];_0x52e549['set'](_0x522619,_0x3cdb53+0x1),_0xc6911=_0x3d8ff7,_0x45437c[_0x386257(0x257)](_0xc6911),_0xeebe50['set'](_0x327101,_0xc6911);const _0x1f3a26=await resolveRuleSegmentRefs(_0x5b7f40,async _0x466747=>{const _0x36624c=_0x386257,_0x4a5a21=_0xeebe50[_0x36624c(0x223)](_0x466747);if(_0x4a5a21)return _0x4a5a21;const _0x42a099=await _0x3676e4[_0x36624c(0x23a)](_0x466747);return _0x42a099[_0x36624c(0x244)];});_0xbc0489={'description':_0xdaee38[_0x386257(0x25e)],'rule':_0x1f3a26};}else{const _0x2a8a60=_0x371977['get'](_0x522619);if(_0x2a8a60)_0xc6911=_0x2a8a60,_0xeebe50[_0x386257(0x219)](_0x327101,_0xc6911);else{if(_0x75cc28){let _0x1e619e=_0x75cc28,_0x2afb4a=0x2;while(_0x45437c[_0x386257(0x201)](_0x1e619e)||_0x1e672e['has'](_0x1e619e)){_0x1e619e=_0x75cc28+'_'+_0x2afb4a,_0x2afb4a++;}_0x45437c[_0x386257(0x257)](_0x1e619e),_0xc6911=_0x1e619e;}_0xeebe50[_0x386257(0x219)](_0x327101,_0xc6911),_0x371977[_0x386257(0x219)](_0x522619,_0xc6911);const _0x570f09=await resolveRuleSegmentRefs(_0x5b7f40,async _0x12e915=>{const _0x1fdeb2=_0x386257,_0x41b0d1=_0xeebe50['get'](_0x12e915);if(_0x41b0d1)return _0x41b0d1;const _0x6dadac=await _0x3676e4[_0x1fdeb2(0x23a)](_0x12e915);return _0x6dadac[_0x1fdeb2(0x244)];});_0xbc0489={'description':_0xdaee38['description'],'rule':_0x570f09};}}}return{'name':_0xc6911,'isJourneyLocal':_0x3a7111,'definition':_0xbc0489};}catch{return{'name':_0x327101,'isJourneyLocal':![]};}},'resolveActivation':async _0x175d89=>{const _0x313d81=a110_0xe770,_0x99ca93=_0x438349[_0x313d81(0x223)](_0x175d89);if(_0x99ca93!==undefined)return{'name':_0x99ca93,'isJourneyLocal':!![]};try{let _0x228f5b=_0x1327c3?.[_0x313d81(0x223)](_0x175d89);!_0x228f5b&&(_0x228f5b=await _0x152fce[_0x313d81(0x1d0)][_0x313d81(0x235)](_0x150e1a,_0x175d89));const _0x5a0cd7=_0x228f5b['attributes'][_0x313d81(0x1fa)]['name']||_0x175d89,_0x4f55ab=sanitizeYamlKey(_0x5a0cd7)||_0x313d81(0x1ea)+_0x175d89,_0x462eed=_0x4f55ab;_0x438349[_0x313d81(0x219)](_0x175d89,_0x462eed);const _0x1c2d8a=journeyActivationStepToYaml(_0x228f5b,_0x7142e4,_0xa6247a);return{'name':_0x462eed,'isJourneyLocal':!![],'definition':_0x1c2d8a};}catch{return{'name':_0x175d89,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x589707,_0x2cada8)=>resolveJumpTarget(_0x589707,_0x2cada8,_0x401927,async _0x2e24a2=>{const _0x2e0029=a110_0xe770,_0x2f17ae=_0x26f212?.['get'](_0x2e24a2);if(_0x2f17ae)return _0x2f17ae;return _0x152fce['journey'][_0x2e0029(0x1db)](_0x2e24a2);})};return _0x3676e4=_0x6ca74d,_0x6ca74d;},_0x7f6474=async _0x5317ac=>{const _0x525e2a=a110_0xe770,{collectSegmentIdsFromJourneyApi:_0xc9dc7}=await import(_0x525e2a(0x1ca)),{batchAsync:_0x13692}=await import(_0x525e2a(0x20a)),_0x3e336e=new Set();for(const _0x260c86 of _0x5317ac){let _0x46389b=_0x26f212?.['get'](_0x260c86);!_0x46389b&&(_0x46389b=await _0x152fce[_0x525e2a(0x1d0)][_0x525e2a(0x1db)](_0x260c86));const _0x465716=_0xc9dc7(_0x46389b);for(const _0x5df6db of _0x465716){_0x3e336e['add'](_0x5df6db);}}let _0x559214=Array['from'](_0x3e336e);while(_0x559214['length']>0x0){const _0x28a3b6=_0x559214['filter'](_0x3bbfba=>!_0xb390a5[_0x525e2a(0x201)](_0x3bbfba));if(_0x28a3b6[_0x525e2a(0x281)]===0x0)break;const _0x57a2e0=await _0x13692(_0x28a3b6,async _0x3ae00a=>{const _0x5d6ca2=_0x525e2a;_0xb390a5[_0x5d6ca2(0x257)](_0x3ae00a);let _0x1c4fea=_0x5a7ac3[_0x5d6ca2(0x210)](_0x1ab6cf=>_0x1ab6cf['id']===_0x3ae00a);if(!_0x1c4fea)try{_0x1c4fea=await _0x152fce[_0x5d6ca2(0x20f)][_0x5d6ca2(0x1c8)](_0x819546,_0x3ae00a);}catch{return null;}return{'segmentId':_0x3ae00a,'segment':_0x1c4fea};},0xa),_0x1e4b5a=new Set();for(const _0x3d2c04 of _0x57a2e0){if(!_0x3d2c04?.['segment']?.['rule'])continue;const _0x198c51=apiRuleToYaml(_0x3d2c04[_0x525e2a(0x20f)]['rule']);_0x1ccf5d[_0x525e2a(0x219)](_0x3d2c04['segmentId'],_0x198c51);const _0x489bc5=collectSegmentRefsFromRule(_0x198c51);for(const _0x51f7cb of _0x489bc5){!_0xb390a5[_0x525e2a(0x201)](_0x51f7cb)&&_0x1e4b5a[_0x525e2a(0x257)](_0x51f7cb);}}_0x559214=Array[_0x525e2a(0x1ff)](_0x1e4b5a);}};return{'createYamlContext':_0x2a0b6a,'prefetchJourneySegments':_0x7f6474};}export async function executePushSegments(_0x5ce358,_0xb31aea,_0x47093d,_0x43c785,_0x57fb87){const _0x5d6a58=a110_0xe770,{segmentDefToCreateRequest:_0x2a5e8e,segmentDefToUpdateRequest:_0xa0fa30}=await import(_0x5d6a58(0x1fd)),_0xf1f6d6=_0x47093d[_0x5d6a58(0x252)],_0x442ca1=0x5,_0x5504d9=async _0x2f577d=>{const _0x2fb54d=_0x5d6a58,_0x1223de=_0x2f577d['folderPath']?_0xf1f6d6['get'](_0x2f577d[_0x2fb54d(0x1e1)]):undefined;let _0x1b1e94;const _0x3b5baf={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2f577d[_0x2fb54d(0x1f5)]){_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x228),'name':_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]});const _0x295c30=_0x2a5e8e(_0x2f577d[_0x2fb54d(0x1f2)],_0x1223de),_0x2c8007=await _0x57fb87[_0x2fb54d(0x1fb)](_0x2fb54d(0x227)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+_0x2fb54d(0x1a5),()=>_0x5ce358[_0x2fb54d(0x20f)]['createSegment'](_0x43c785[_0x2fb54d(0x27a)],_0x295c30));_0x1b1e94=_0x2c8007['data']['id'],_0x3b5baf[_0x2fb54d(0x1a9)]={'name':_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)],'id':_0x1b1e94},_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x254),'name':_0x2f577d['yamlConfig'][_0x2fb54d(0x244)],'segmentId':_0x1b1e94}),_0x57fb87['logSuccess']?.(_0x2fb54d(0x282)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+'\x27'),_0x3b5baf[_0x2fb54d(0x264)]=0x1;}else{if(_0x2f577d[_0x2fb54d(0x21a)]){_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x23b),'name':_0x2f577d[_0x2fb54d(0x1f2)]['name']});const _0x1fc3da=_0xa0fa30(_0x2f577d[_0x2fb54d(0x1f2)]);_0x1223de!==_0x2f577d['existingSegment']?.[_0x2fb54d(0x200)]&&(_0x1fc3da['segmentFolderId']=_0x1223de?parseInt(_0x1223de,0xa):undefined),await _0x57fb87[_0x2fb54d(0x1fb)](_0x2fb54d(0x1c0)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+_0x2fb54d(0x1a5),()=>_0x5ce358[_0x2fb54d(0x20f)][_0x2fb54d(0x1dc)](_0x43c785[_0x2fb54d(0x27a)],_0x2f577d[_0x2fb54d(0x23f)]['id'],_0x1fc3da)),_0x1b1e94=_0x2f577d[_0x2fb54d(0x23f)]['id'],_0x57fb87[_0x2fb54d(0x216)]?.({'type':_0x2fb54d(0x1ee),'name':_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]}),_0x57fb87[_0x2fb54d(0x27d)]?.(_0x2fb54d(0x233)+_0x2f577d[_0x2fb54d(0x1f2)][_0x2fb54d(0x244)]+'\x27'),_0x3b5baf['updated']=0x1;}else _0x1b1e94=_0x2f577d['existingSegment']['id'];}}catch(_0x5e7875){const _0x4e8a73=isHttp400Error(_0x5e7875),_0x2a6831=_0x4e8a73?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x2fb54d(0x220)],_0x5a85fd=getErrorMessage(_0x5e7875);throw new SDKError(_0x2a6831,'Failed\x20to\x20'+(_0x2f577d[_0x2fb54d(0x1f5)]?_0x2fb54d(0x1fe):'update')+_0x2fb54d(0x270)+_0x2f577d[_0x2fb54d(0x214)]+_0x2fb54d(0x1aa)+_0x5a85fd,_0x5e7875);}try{const _0x46bde9=await syncActivationsForSegment(_0x5ce358,_0x43c785[_0x2fb54d(0x27a)],_0x1b1e94,_0x2f577d[_0x2fb54d(0x1f2)]['name'],_0x2f577d['activationActions'],_0x57fb87,_0x2f577d[_0x2fb54d(0x214)]);_0x3b5baf[_0x2fb54d(0x20b)]=_0x46bde9;}catch(_0x1002d1){if(_0x1002d1 instanceof SDKError)throw _0x1002d1;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2fb54d(0x218)+_0x2f577d['yamlConfig'][_0x2fb54d(0x244)]+_0x2fb54d(0x1ef)+_0x2f577d[_0x2fb54d(0x214)]+_0x2fb54d(0x1aa)+getErrorMessage(_0x1002d1),_0x1002d1);}return _0x3b5baf;},_0x15c5ef=await batchAsync(_0xb31aea,_0x5504d9,_0x442ca1),_0x4a93e={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x299e68 of _0x15c5ef){_0x4a93e[_0x5d6a58(0x264)]+=_0x299e68[_0x5d6a58(0x264)],_0x4a93e[_0x5d6a58(0x288)]+=_0x299e68[_0x5d6a58(0x288)],_0x299e68[_0x5d6a58(0x1a9)]&&_0x4a93e[_0x5d6a58(0x1d6)][_0x5d6a58(0x219)](_0x299e68['createdSegmentId']['name'],_0x299e68[_0x5d6a58(0x1a9)]['id']),_0x4a93e['activations']['created']+=_0x299e68[_0x5d6a58(0x20b)][_0x5d6a58(0x264)],_0x4a93e[_0x5d6a58(0x20b)]['updated']+=_0x299e68[_0x5d6a58(0x20b)]['updated'],_0x4a93e[_0x5d6a58(0x20b)][_0x5d6a58(0x23e)]+=_0x299e68['activations']['deleted'];}return _0x4a93e;}async function syncActivationsForSegment(_0x5187d9,_0x4a4ad6,_0xb1e240,_0x206ec4,_0x30b553,_0x226467,_0x269c28){const _0x515319=a110_0xe770,_0x594e30={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x21a38b of _0x30b553){try{if(_0x21a38b[_0x515319(0x1b8)]===_0x515319(0x1fe)&&_0x21a38b[_0x515319(0x24d)])_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x229),'segmentName':_0x206ec4,'activationName':_0x21a38b[_0x515319(0x244)]}),await _0x226467[_0x515319(0x1fb)](_0x515319(0x1cb)+_0x21a38b[_0x515319(0x244)]+'\x27...',()=>_0x5187d9['segment'][_0x515319(0x1d8)](_0x4a4ad6,_0xb1e240,_0x21a38b[_0x515319(0x24d)])),_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x1af),'segmentName':_0x206ec4,'activationName':_0x21a38b['name']}),_0x226467['logSuccess']?.(_0x515319(0x286)+_0x21a38b[_0x515319(0x244)]+'\x27'),_0x594e30[_0x515319(0x264)]++;else{if(_0x21a38b['type']===_0x515319(0x27f)&&_0x21a38b[_0x515319(0x24d)]&&_0x21a38b[_0x515319(0x1f9)])_0x226467['onProgress']?.({'type':_0x515319(0x1c5),'segmentName':_0x206ec4,'activationName':_0x21a38b['name']}),await _0x226467[_0x515319(0x1fb)](_0x515319(0x21d)+_0x21a38b[_0x515319(0x244)]+'\x27...',()=>_0x5187d9[_0x515319(0x20f)][_0x515319(0x23c)](_0x4a4ad6,_0xb1e240,_0x21a38b[_0x515319(0x1f9)]['id'],_0x21a38b[_0x515319(0x24d)])),_0x226467['onProgress']?.({'type':'activation_updated','segmentName':_0x206ec4,'activationName':_0x21a38b['name']}),_0x226467[_0x515319(0x27d)]?.(_0x515319(0x1bf)+_0x21a38b['name']+'\x27'),_0x594e30['updated']++;else _0x21a38b[_0x515319(0x1b8)]===_0x515319(0x1be)&&_0x21a38b[_0x515319(0x1f9)]&&(_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x279),'segmentName':_0x206ec4,'activationName':_0x21a38b[_0x515319(0x244)]}),await _0x226467[_0x515319(0x1fb)](_0x515319(0x276)+_0x21a38b['name']+'\x27...',()=>_0x5187d9[_0x515319(0x20f)]['deleteActivation'](_0x4a4ad6,_0xb1e240,_0x21a38b['existingActivation']['id'])),_0x226467[_0x515319(0x216)]?.({'type':_0x515319(0x26f),'segmentName':_0x206ec4,'activationName':_0x21a38b[_0x515319(0x244)]}),_0x226467[_0x515319(0x225)]?.('Deleted\x20activation\x20\x27'+_0x21a38b['name']+'\x27'),_0x594e30['deleted']++);}}catch(_0x5a71bb){const _0x21d881=isHttp400Error(_0x5a71bb),_0x3da0b4=_0x21d881?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x515319(0x1c3)],_0x20f91c=getErrorMessage(_0x5a71bb);throw new SDKError(_0x3da0b4,_0x515319(0x207)+_0x21a38b[_0x515319(0x1b8)]+_0x515319(0x212)+_0x21a38b['name']+_0x515319(0x1ef)+_0x269c28+'\x0a\x20\x20'+_0x20f91c,_0x5a71bb);}}return _0x594e30;}export async function executePushFolders(_0x10ecd5,_0x3e2da8,_0x33d79e,_0x1c9612,_0x54afef){const _0x3ed53c=a110_0xe770,_0x2cd1c8=new Map(_0x33d79e);for(const _0x4db854 of _0x3e2da8){const _0x312fe2=_0x4db854[_0x3ed53c(0x265)]('/'),_0x56fa0b=_0x312fe2[_0x312fe2['length']-0x1],_0x2fae84=_0x312fe2[_0x3ed53c(0x284)](0x0,-0x1)['join']('/'),_0x19bfa6=_0x2cd1c8[_0x3ed53c(0x223)](_0x2fae84);_0x54afef[_0x3ed53c(0x216)]?.({'type':_0x3ed53c(0x205),'folder':_0x4db854});const _0xa76426={'name':_0x56fa0b,'parentFolderId':_0x19bfa6},_0x581ef0=await _0x54afef[_0x3ed53c(0x1fb)](_0x3ed53c(0x1e8)+_0x4db854+_0x3ed53c(0x1a5),()=>_0x10ecd5[_0x3ed53c(0x20f)]['createFolder'](_0x1c9612[_0x3ed53c(0x27a)],_0xa76426));_0x2cd1c8[_0x3ed53c(0x219)](_0x4db854,_0x581ef0[_0x3ed53c(0x263)]['id']),_0x54afef['onProgress']?.({'type':_0x3ed53c(0x246),'folder':_0x4db854,'folderId':_0x581ef0['data']['id']}),_0x54afef[_0x3ed53c(0x203)]?.(_0x3ed53c(0x275)+_0x4db854+'\x27');}return _0x2cd1c8;}export async function executePushSegmentDeletions(_0x4d8a9e,_0x2460fe,_0x4de22b){if(_0x2460fe['length']===0x0)return 0x0;const {batchAsync:_0x1091fe}=await import('../../utils/async.js'),_0x493102=0x5,_0x3cc96a=await _0x1091fe(_0x2460fe,async _0x3b7ab3=>{const _0x1effa0=a110_0xe770;return _0x4de22b['onProgress']?.({'type':_0x1effa0(0x1ab),'name':_0x3b7ab3[_0x1effa0(0x244)]}),await _0x4d8a9e['segment']['deleteSegment'](_0x3b7ab3['id']),_0x4de22b[_0x1effa0(0x216)]?.({'type':_0x1effa0(0x1b2),'name':_0x3b7ab3['name']}),_0x4de22b[_0x1effa0(0x225)]?.(_0x1effa0(0x22c)+_0x3b7ab3[_0x1effa0(0x244)]+'\x27'),0x1;},_0x493102);return _0x3cc96a['reduce']((_0x4e7eae,_0x57511d)=>_0x4e7eae+_0x57511d,0x0);}function a110_0xe770(_0x3825d9,_0xb8a87c){_0x3825d9=_0x3825d9-0x1a4;const _0x23d95f=a110_0x23d9();let _0xe770a9=_0x23d95f[_0x3825d9];return _0xe770a9;}export async function executePushJourneys(_0x10b1a3,_0xaf4980,_0x48daab,_0x5ad8f1,_0x40d29d){const _0x135f17=a110_0xe770,{journeyDefToRequest:_0x186e89}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x50aec3,yamlRuleToApi:_0x237e12,validateSegmentRule:_0x478aa2}=await import(_0x135f17(0x1fd)),_0x2e3448={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x23c785=new Map(_0x48daab['segmentNameToId']),_0x18094b=0x5;for(let _0x589cf4=0x0;_0x589cf4<_0xaf4980[_0x135f17(0x281)];_0x589cf4+=_0x18094b){const _0x53ec81=_0xaf4980[_0x135f17(0x284)](_0x589cf4,_0x589cf4+_0x18094b),_0x56bee7=await Promise[_0x135f17(0x1d3)](_0x53ec81[_0x135f17(0x287)](async _0x193982=>{const _0x451ac5=_0x135f17;if(!_0x193982[_0x451ac5(0x1f5)]&&!_0x193982[_0x451ac5(0x21a)])return{'action':_0x451ac5(0x1bc),'name':_0x193982[_0x451ac5(0x1f2)]['name'],'journeyId':_0x193982[_0x451ac5(0x208)]?.['id']};const _0x3f960b=_0x193982[_0x451ac5(0x1e1)]?_0x48daab[_0x451ac5(0x252)]['get'](_0x193982['folderPath']):undefined;_0x40d29d[_0x451ac5(0x216)]?.({'type':_0x193982[_0x451ac5(0x1f5)]?'journey_creating':_0x451ac5(0x221),'name':_0x193982['yamlConfig']['name']});try{const _0x489cdf=await executeSingleJourneyPush(_0x10b1a3,_0x193982,{..._0x48daab,'segmentNameToId':_0x23c785},{'parentId':_0x5ad8f1['parentId'],'rootFolderId':_0x5ad8f1[_0x451ac5(0x24e)],'folderId':_0x3f960b,'verbose':_0x5ad8f1[_0x451ac5(0x1e0)]},_0x40d29d,{'journeyDefToRequest':_0x186e89,'activationDefToCreateRequest':_0x50aec3,'yamlRuleToApi':_0x237e12,'validateSegmentRule':_0x478aa2});for(const [_0x2ee652,_0x36e4ec]of _0x489cdf[_0x451ac5(0x1c2)]){_0x23c785[_0x451ac5(0x219)](_0x2ee652,_0x36e4ec),_0x2e3448['embeddedSegmentNameToId'][_0x451ac5(0x219)](_0x2ee652,_0x36e4ec);}if(_0x489cdf[_0x451ac5(0x245)]===_0x451ac5(0x264))_0x40d29d['onProgress']?.({'type':'journey_created','name':_0x193982[_0x451ac5(0x1f2)][_0x451ac5(0x244)],'journeyId':_0x489cdf['journeyId']}),_0x40d29d[_0x451ac5(0x27d)]?.('Created\x20journey\x20\x27'+_0x193982[_0x451ac5(0x1f2)][_0x451ac5(0x244)]+'\x27'),_0x2e3448[_0x451ac5(0x264)]++;else _0x489cdf['action']==='updated'&&(_0x40d29d[_0x451ac5(0x216)]?.({'type':_0x451ac5(0x1c6),'name':_0x193982[_0x451ac5(0x1f2)][_0x451ac5(0x244)]}),_0x40d29d[_0x451ac5(0x27d)]?.(_0x451ac5(0x237)+_0x193982[_0x451ac5(0x1f2)]['name']+'\x27'),_0x2e3448['updated']++);return{'action':_0x489cdf[_0x451ac5(0x245)],'name':_0x193982['yamlConfig'][_0x451ac5(0x244)],'journeyId':_0x489cdf['journeyId']};}catch(_0x3dcc64){const _0x106c97=isHttp400Error(_0x3dcc64),_0x125571=_0x106c97?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4f9ef9=getErrorMessage(_0x3dcc64);throw new SDKError(_0x125571,_0x451ac5(0x207)+(_0x193982[_0x451ac5(0x1f5)]?_0x451ac5(0x1fe):_0x451ac5(0x27f))+_0x451ac5(0x269)+_0x193982[_0x451ac5(0x214)]+_0x451ac5(0x1aa)+_0x4f9ef9,_0x3dcc64);}}));_0x2e3448[_0x135f17(0x22b)][_0x135f17(0x241)](..._0x56bee7);}return _0x2e3448;}async function executeSingleJourneyPush(_0x472503,_0x288f8c,_0x52b4bd,_0x284507,_0xcf48c5,_0x3aee61){const _0xc113ac=a110_0xe770,{journeyDefToRequest:_0x5d0446,activationDefToCreateRequest:_0x2b0f64,yamlRuleToApi:_0x599890,validateSegmentRule:_0x8b9ce2}=_0x3aee61,_0x1ec0d4=new Map(),_0x3cda6a=new Map(),_0x56d4b8=new Map(),_0x525e3a=new Map(),_0x414aa0=new Map();let _0x2e4be4;const _0x18c7f2=async()=>{const _0x258c0b=a110_0xe770;if(_0x2e4be4)return;_0x2e4be4=new Map();if(!_0x288f8c[_0x258c0b(0x208)])return;const _0x5e7657=await _0x472503['journey'][_0x258c0b(0x277)](_0x288f8c[_0x258c0b(0x208)]['id']);for(const _0x2fe9df of _0x5e7657){const _0x3138e3=journeyActivationStepToYaml(_0x2fe9df,_0x52b4bd[_0x258c0b(0x26e)],_0x52b4bd[_0x258c0b(0x1a7)]),_0x32163d=activationSignature(_0x3138e3);!_0x2e4be4[_0x258c0b(0x201)](_0x32163d)&&_0x2e4be4['set'](_0x32163d,_0x2fe9df['id']),_0x3138e3[_0x258c0b(0x244)]&&_0x3cda6a[_0x258c0b(0x219)](_0x3138e3[_0x258c0b(0x244)],_0x2fe9df['id']);}};if(_0x288f8c[_0xc113ac(0x208)]&&_0x288f8c['yamlConfig'][_0xc113ac(0x1f4)]){const _0x158635=buildLocalExpandedRuleMappings(_0x288f8c['yamlConfig']),_0xa3e9d1=_0x158635['localSegmentRules'];if(_0xa3e9d1['size']>0x0){const _0x100173=new Map();for(const [_0xb88afd,_0x44c6d8]of _0xa3e9d1){const _0x47d79e=serializeExpandedRule(_0x44c6d8,_0xa3e9d1);_0x100173['set'](_0xb88afd,_0x47d79e);}const _0x249f81=collectSegmentIdsFromJourneyApi(_0x288f8c[_0xc113ac(0x208)]);if(_0x249f81[_0xc113ac(0x215)]>0x0){const _0x58eb81=await buildServerSegmentRuleMap(_0x472503,_0x284507['parentId'],_0x52b4bd[_0xc113ac(0x236)],_0x249f81);if(_0x58eb81['size']>0x0){const _0x4509ca=new Map();for(const [_0x3442fd,_0x59e951]of _0x58eb81){const _0x413871=serializeExpandedRule(_0x59e951,_0x58eb81);!_0x4509ca[_0xc113ac(0x201)](_0x413871)&&_0x4509ca[_0xc113ac(0x219)](_0x413871,_0x3442fd);}for(const [_0x2b64e2,_0x3d8754]of _0x100173){const _0x404278=_0x4509ca[_0xc113ac(0x223)](_0x3d8754);_0x404278&&(_0x414aa0['set'](_0x2b64e2,_0x404278),_0x52b4bd[_0xc113ac(0x204)][_0xc113ac(0x219)](_0x2b64e2,_0x404278));}}}}}const _0x546826={'resolveSegmentId':async _0x3b371e=>{const _0xe67fcc=_0xc113ac,_0x4c76f3=_0x52b4bd[_0xe67fcc(0x204)][_0xe67fcc(0x223)](_0x3b371e);if(!_0x4c76f3)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xe67fcc(0x21c)+_0x3b371e+'\x20(referenced\x20in\x20journey\x20'+_0x288f8c[_0xe67fcc(0x1f2)][_0xe67fcc(0x244)]+')');return _0x4c76f3;},'resolveEmbeddedSegmentId':async(_0x15f0f8,_0x2b8071)=>{const _0x10e3f2=_0xc113ac,_0x14c81b=_0x52b4bd['segmentNameToId'][_0x10e3f2(0x223)](_0x15f0f8);if(_0x14c81b)return _0x14c81b;const _0x679072=_0x414aa0[_0x10e3f2(0x223)](_0x15f0f8);if(_0x679072)return _0x52b4bd[_0x10e3f2(0x204)][_0x10e3f2(0x219)](_0x15f0f8,_0x679072),_0x679072;const _0x8a6f0f=_0x52b4bd[_0x10e3f2(0x236)][_0x10e3f2(0x210)](_0x51a962=>_0x51a962['name']===_0x15f0f8);if(_0x8a6f0f)return _0x52b4bd[_0x10e3f2(0x204)]['set'](_0x15f0f8,_0x8a6f0f['id']),_0x8a6f0f['id'];if(_0x288f8c[_0x10e3f2(0x1f5)]){const {stageName:_0x4959f9,criteriaName:_0x5840e1}=findSegmentCriteriaLocation(_0x288f8c[_0x10e3f2(0x1f2)],_0x15f0f8);return _0x8b9ce2(_0x15f0f8,_0x2b8071[_0x10e3f2(0x21b)]),_0x56d4b8[_0x10e3f2(0x219)](_0x15f0f8,{'definition':_0x2b8071,'stageName':_0x4959f9,'criteriaName':_0x5840e1}),createPendingSegmentId(_0x15f0f8);}const _0x54e02a=_0x288f8c[_0x10e3f2(0x208)]?.['id'];if(!_0x54e02a)throw new SDKError(ErrorCode[_0x10e3f2(0x26d)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x8b9ce2(_0x15f0f8,_0x2b8071[_0x10e3f2(0x21b)]);const _0x49ae36=generateDeterministicJourneySegmentName(_0x288f8c['yamlConfig'][_0x10e3f2(0x244)],_0x15f0f8),_0x4c419b=_0x52b4bd['existingSegments'][_0x10e3f2(0x210)](_0x26abaa=>_0x26abaa[_0x10e3f2(0x244)]===_0x49ae36),_0x1b94b5=createSegmentIdResolver(_0x52b4bd[_0x10e3f2(0x204)],_0x15f0f8),_0x5b7eeb=await resolveRuleSegmentIds(_0x2b8071['rule'],_0x1b94b5);let _0x4dfdf4;if(_0x4c419b)await _0x472503[_0x10e3f2(0x20f)]['updateSegmentById'](_0x284507[_0x10e3f2(0x27a)],_0x4c419b['id'],{'description':_0x2b8071[_0x10e3f2(0x25e)]||_0x10e3f2(0x26c)+_0x15f0f8,'rule':_0x599890(_0x5b7eeb,!![]),'countPopulation':!![]}),_0x4dfdf4=_0x4c419b['id'];else try{_0x4dfdf4=await _0x472503['segment'][_0x10e3f2(0x202)]({'name':_0x49ae36,'description':_0x2b8071['description']||'Entry\x20criteria:\x20'+_0x15f0f8,'journeyId':_0x54e02a,'rule':_0x599890(_0x5b7eeb,!![]),'countPopulation':!![],'parentFolderId':_0x284507[_0x10e3f2(0x24e)]||'','audienceId':_0x284507[_0x10e3f2(0x27a)]});}catch(_0x11c84f){const _0x4cd8ff=_0x11c84f instanceof Error&&_0x11c84f[_0x10e3f2(0x24a)][_0x10e3f2(0x1bd)]('Name\x20has\x20already\x20been\x20taken');if(_0x4cd8ff){const _0x26fe38=await _0x472503[_0x10e3f2(0x20f)][_0x10e3f2(0x1ae)](_0x284507['parentId']),_0x241cc9=_0x26fe38['find'](_0x20a53f=>_0x20a53f[_0x10e3f2(0x244)]===_0x49ae36);if(_0x241cc9)await _0x472503[_0x10e3f2(0x20f)][_0x10e3f2(0x1dc)](_0x284507['parentId'],_0x241cc9['id'],{'description':_0x2b8071[_0x10e3f2(0x25e)]||_0x10e3f2(0x26c)+_0x15f0f8,'rule':_0x599890(_0x5b7eeb,!![]),'countPopulation':!![]}),_0x4dfdf4=_0x241cc9['id'];else throw _0x11c84f;}else throw _0x11c84f;}return _0x52b4bd[_0x10e3f2(0x204)]['set'](_0x15f0f8,_0x4dfdf4),_0x1ec0d4[_0x10e3f2(0x219)](_0x15f0f8,_0x4dfdf4),_0x4dfdf4;},'resolveActivationId':async _0x5d99f9=>{const _0x5ea6ad=_0xc113ac,_0x134331=_0x3cda6a[_0x5ea6ad(0x223)](_0x5d99f9);if(_0x134331)return _0x134331;if(_0x288f8c['existingJourney']){await _0x18c7f2();const _0x414872=_0x3cda6a[_0x5ea6ad(0x223)](_0x5d99f9);if(_0x414872)return _0x414872;}throw new SDKError(ErrorCode[_0x5ea6ad(0x1cf)],_0x5ea6ad(0x247)+_0x5d99f9+_0x5ea6ad(0x25a)+_0x288f8c[_0x5ea6ad(0x1f2)][_0x5ea6ad(0x244)]+').\x20'+_0x5ea6ad(0x22a));},'resolveEmbeddedActivationId':async(_0x10335d,_0x5e17e7)=>{const _0x5237bf=_0xc113ac,_0x378cf4=_0x3cda6a[_0x5237bf(0x223)](_0x10335d);if(_0x378cf4)return _0x378cf4;if(_0x288f8c[_0x5237bf(0x1f5)])return _0x525e3a[_0x5237bf(0x219)](_0x10335d,_0x5e17e7),createPendingActivationId(_0x10335d);if(_0x288f8c[_0x5237bf(0x208)]){await _0x18c7f2();const _0x5b723a=_0x3cda6a[_0x5237bf(0x223)](_0x5e17e7['name']);if(_0x5b723a)return _0x3cda6a[_0x5237bf(0x219)](_0x10335d,_0x5b723a),_0x5b723a;const _0x3d3b92=activationSignature(_0x5e17e7),_0x3048fe=_0x2e4be4?.[_0x5237bf(0x223)](_0x3d3b92);if(_0x3048fe)return _0x3cda6a[_0x5237bf(0x219)](_0x10335d,_0x3048fe),_0x3048fe;const _0x29cec7=await _0x2b0f64(_0x5e17e7,_0x52b4bd['activationContext']),_0xae3228=await _0x472503['journey'][_0x5237bf(0x1d8)](_0x288f8c['existingJourney']['id'],_0x29cec7);return _0x3cda6a[_0x5237bf(0x219)](_0x10335d,_0xae3228['id']),_0xae3228['id'];}throw new SDKError(ErrorCode[_0x5237bf(0x26d)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x5cdb8b=>{const _0x8f0090=_0xc113ac;try{return await _0x472503['journey']['resolveJourneyId'](_0x284507['parentId'],_0x5cdb8b);}catch(_0x186e9e){throw new SDKError(ErrorCode[_0x8f0090(0x1cf)],_0x8f0090(0x22f)+_0x5cdb8b+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x288f8c[_0x8f0090(0x1f2)][_0x8f0090(0x244)]+'\x27)',_0x186e9e);}},'resolveStageId':async(_0x14cc97,_0x235c12)=>{const _0x2cd8f5=_0xc113ac,_0x45957b=await _0x472503[_0x2cd8f5(0x1d0)][_0x2cd8f5(0x1db)](_0x14cc97),_0x48ae0e=_0x45957b[_0x2cd8f5(0x1a6)][_0x2cd8f5(0x283)][_0x2cd8f5(0x210)](_0x5311a5=>_0x5311a5[_0x2cd8f5(0x244)][_0x2cd8f5(0x22e)]()===_0x235c12[_0x2cd8f5(0x22e)]());if(!_0x48ae0e?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x235c12+_0x2cd8f5(0x248)+(_0x45957b['attributes']['journeyBundleName']||_0x45957b[_0x2cd8f5(0x1a6)][_0x2cd8f5(0x244)])+'\x27');return _0x48ae0e['id'];}},_0x41b80f=await _0x5d0446(_0x288f8c[_0xc113ac(0x1f2)],_0x284507[_0xc113ac(0x27a)],_0x546826),_0x3e38f4=_0x284507['folderId']||_0x284507[_0xc113ac(0x24e)];_0x3e38f4&&(_0x41b80f['relationships']={'parentFolder':{'data':{'id':_0x3e38f4,'type':_0xc113ac(0x231)}}});if(_0x288f8c[_0xc113ac(0x1f5)]){if(_0x56d4b8[_0xc113ac(0x215)]>0x0||_0x525e3a['size']>0x0)return await executeThreeStepJourneyCreate(_0x472503,_0x288f8c,_0x41b80f,{'pendingEmbeddedSegments':_0x56d4b8,'pendingEmbeddedActivations':_0x525e3a,'embeddedSegmentNameToId':_0x1ec0d4,'journeyActivationNameToId':_0x3cda6a},{..._0x284507,'effectiveFolderId':_0x3e38f4},_0x52b4bd,_0xcf48c5,_0x3aee61);else{ensureJourneyDefaults(_0x41b80f[_0xc113ac(0x1a6)]);const _0x1f7989=await _0x472503[_0xc113ac(0x1d0)][_0xc113ac(0x1fe)](_0x41b80f);return{'action':_0xc113ac(0x264),'journeyId':_0x1f7989['id'],'embeddedSegmentNameToId':_0x1ec0d4};}}else{if(_0x288f8c['hasChanges']&&_0x288f8c[_0xc113ac(0x208)])return ensureJourneyDefaults(_0x41b80f[_0xc113ac(0x1a6)]),await _0x472503[_0xc113ac(0x1d0)][_0xc113ac(0x27f)](_0x288f8c['existingJourney']['id'],_0x41b80f),{'action':_0xc113ac(0x288),'journeyId':_0x288f8c[_0xc113ac(0x208)]['id'],'embeddedSegmentNameToId':_0x1ec0d4};}return{'action':_0xc113ac(0x1bc),'journeyId':_0x288f8c[_0xc113ac(0x208)]?.['id'],'embeddedSegmentNameToId':_0x1ec0d4};}function findSegmentCriteriaLocation(_0x3e28c7,_0x2aed50){const _0x2cb1e9=a110_0xe770,_0x630e29=_0x3e28c7[_0x2cb1e9(0x222)]||_0x3e28c7[_0x2cb1e9(0x1df)]?.[0x0]?.[_0x2cb1e9(0x222)]||[];let _0x2d7234=_0x2cb1e9(0x273),_0x47d62c=_0x2aed50;const _0x5d62b0=_0x3e28c7[_0x2cb1e9(0x224)]||_0x3e28c7['journeys']?.[0x0]?.['goal'];if(_0x5d62b0?.['segment']===_0x2aed50)return{'stageName':'goal','criteriaName':_0x5d62b0[_0x2cb1e9(0x244)]||_0x2aed50};_0x1ffd0c:for(const _0x46335e of _0x630e29){if(_0x46335e[_0x2cb1e9(0x21f)]?.[_0x2cb1e9(0x20f)]===_0x2aed50){_0x2d7234=_0x46335e[_0x2cb1e9(0x244)],_0x47d62c=_0x46335e[_0x2cb1e9(0x21f)][_0x2cb1e9(0x244)]||_0x2aed50;break;}if(_0x46335e[_0x2cb1e9(0x280)])for(const _0x298f21 of _0x46335e[_0x2cb1e9(0x280)]){if(_0x298f21[_0x2cb1e9(0x1b8)]===_0x2cb1e9(0x23d)&&_0x298f21[_0x2cb1e9(0x1eb)]?.[_0x2cb1e9(0x1f1)])for(const _0xf854d3 of _0x298f21[_0x2cb1e9(0x1eb)][_0x2cb1e9(0x1f1)]){if(_0xf854d3[_0x2cb1e9(0x20f)]===_0x2aed50){_0x2d7234=_0x46335e[_0x2cb1e9(0x244)],_0x47d62c=_0xf854d3[_0x2cb1e9(0x244)]||_0x2aed50;break _0x1ffd0c;}}}}return{'stageName':_0x2d7234,'criteriaName':_0x47d62c};}async function executeThreeStepJourneyCreate(_0x1eb3e3,_0x1528b0,_0x1f6e9d,_0x56cf4e,_0x13877d,_0x395420,_0x49349d,_0x29a13f){const _0x3ccf68=a110_0xe770,{activationDefToCreateRequest:_0x5daa9e,yamlRuleToApi:_0xbe7ece}=_0x29a13f,{pendingEmbeddedSegments:_0x39998b,pendingEmbeddedActivations:_0x1906c7,embeddedSegmentNameToId:_0x105d5b}=_0x56cf4e,_0x18e8b1=JSON[_0x3ccf68(0x260)](JSON[_0x3ccf68(0x1c1)](_0x1f6e9d));ensureJourneyDefaults(_0x18e8b1['attributes']),stripPendingIds(_0x18e8b1);const _0x51a9a7=await _0x1eb3e3[_0x3ccf68(0x1d0)]['create'](_0x18e8b1),_0x44f3cd=_0x51a9a7['id'],_0x2d3ae7=new Map();for(const _0x145ded of _0x51a9a7[_0x3ccf68(0x1a6)][_0x3ccf68(0x283)]){_0x2d3ae7[_0x3ccf68(0x219)](_0x145ded[_0x3ccf68(0x244)][_0x3ccf68(0x22e)](),_0x145ded['id']);}for(const [_0x24af89,{definition:_0x16a52e}]of _0x39998b){const _0x4f4d35=generateDeterministicJourneySegmentName(_0x1528b0[_0x3ccf68(0x1f2)]['name'],_0x24af89);_0x49349d[_0x3ccf68(0x216)]?.({'type':'embedded_segment_creating','journeyName':_0x1528b0[_0x3ccf68(0x1f2)][_0x3ccf68(0x244)],'segmentName':_0x24af89});const _0x1472b5=createSegmentIdResolver(_0x395420[_0x3ccf68(0x204)],_0x24af89),_0x3d4e0a=await resolveRuleSegmentIds(_0x16a52e[_0x3ccf68(0x21b)],_0x1472b5),_0xb07c03=await _0x1eb3e3[_0x3ccf68(0x20f)]['createJourneySegment']({'name':_0x4f4d35,'description':_0x16a52e['description']||_0x3ccf68(0x26c)+_0x24af89,'journeyId':_0x44f3cd,'rule':_0xbe7ece(_0x3d4e0a,!![]),'countPopulation':!![],'parentFolderId':_0x13877d[_0x3ccf68(0x1ce)]||'','audienceId':_0x13877d[_0x3ccf68(0x27a)]});_0x105d5b[_0x3ccf68(0x219)](_0x24af89,_0xb07c03),_0x395420[_0x3ccf68(0x204)]['set'](_0x24af89,_0xb07c03),_0x49349d['onProgress']?.({'type':_0x3ccf68(0x272),'journeyName':_0x1528b0['yamlConfig']['name'],'segmentName':_0x24af89});}const _0x2d0a29=new Map();for(const [_0x1f5a4e,_0x2d94b4]of _0x1906c7){_0x49349d[_0x3ccf68(0x216)]?.({'type':_0x3ccf68(0x25f),'journeyName':_0x1528b0[_0x3ccf68(0x1f2)]['name'],'activationName':_0x1f5a4e});const _0x35e6b7=await _0x5daa9e(_0x2d94b4,_0x395420['activationContext']),_0x2ab9a2=await _0x1eb3e3[_0x3ccf68(0x1d0)]['createActivation'](_0x44f3cd,_0x35e6b7);_0x2d0a29[_0x3ccf68(0x219)](_0x1f5a4e,_0x2ab9a2['id']),_0x56cf4e['journeyActivationNameToId'][_0x3ccf68(0x219)](_0x1f5a4e,_0x2ab9a2['id']),_0x49349d[_0x3ccf68(0x216)]?.({'type':'embedded_activation_created','journeyName':_0x1528b0[_0x3ccf68(0x1f2)][_0x3ccf68(0x244)],'activationName':_0x1f5a4e});}const _0x4177f0=JSON['parse'](JSON[_0x3ccf68(0x1c1)](_0x1f6e9d));return _0x4177f0['id']=_0x44f3cd,ensureJourneyDefaults(_0x4177f0['attributes']),resolvePendingIdsInRequest(_0x4177f0,_0x1f6e9d,_0x2d3ae7,_0x105d5b,_0x2d0a29,_0x49349d),await _0x1eb3e3[_0x3ccf68(0x1d0)]['update'](_0x44f3cd,_0x4177f0),{'action':_0x3ccf68(0x264),'journeyId':_0x44f3cd,'embeddedSegmentNameToId':_0x105d5b};}function stripPendingIds(_0x31627a){const _0xf2f33e=a110_0xe770;for(const _0x3332fb of _0x31627a[_0xf2f33e(0x1a6)][_0xf2f33e(0x283)]||[]){_0x3332fb[_0xf2f33e(0x271)]?.[_0xf2f33e(0x1f8)]&&isPendingSegmentId(_0x3332fb[_0xf2f33e(0x271)]['segmentId'])&&delete _0x3332fb[_0xf2f33e(0x271)];if(_0x3332fb['steps'])for(const _0x5db026 of Object[_0xf2f33e(0x1e7)](_0x3332fb['steps'])){const _0x36e14d=_0x3332fb[_0xf2f33e(0x280)][_0x5db026];_0x36e14d[_0xf2f33e(0x1b8)]===_0xf2f33e(0x1e3)&&_0x36e14d[_0xf2f33e(0x27b)]&&isPendingActivationId(_0x36e14d[_0xf2f33e(0x27b)])&&(_0x36e14d[_0xf2f33e(0x27b)]='');if(_0x36e14d['type']===_0xf2f33e(0x209)&&_0x36e14d[_0xf2f33e(0x1f1)])for(const _0x3a01ad of _0x36e14d[_0xf2f33e(0x1f1)]){_0x3a01ad[_0xf2f33e(0x1f8)]&&isPendingSegmentId(_0x3a01ad[_0xf2f33e(0x1f8)])&&(_0x3a01ad[_0xf2f33e(0x1f8)]='');}_0x36e14d[_0xf2f33e(0x1b8)]===_0xf2f33e(0x1b1)&&_0x36e14d[_0xf2f33e(0x285)]?.[_0xf2f33e(0x1f8)]&&isPendingSegmentId(_0x36e14d['waitCondition'][_0xf2f33e(0x1f8)])&&(_0x36e14d['waitCondition'][_0xf2f33e(0x1f8)]='');}}}function resolvePendingIdsInRequest(_0x79bee3,_0x4502a4,_0x2a6fb0,_0x4b03f9,_0x3d1cfc,_0x23ca61){const _0x36b642=a110_0xe770,_0x56545b=(_0x5150e1,_0x2e1e08)=>{const _0x4ec3b1=a110_0xe770;if(!isPendingSegmentId(_0x5150e1))return _0x5150e1;const _0x452e9a=extractPendingSegmentName(_0x5150e1),_0xd5befd=_0x4b03f9['get'](_0x452e9a);return!_0xd5befd&&_0x23ca61[_0x4ec3b1(0x243)]?.(_0x4ec3b1(0x1d9)+_0x452e9a+'\x27\x20for\x20'+_0x2e1e08),_0xd5befd;};if(_0x79bee3[_0x36b642(0x1a6)][_0x36b642(0x224)]?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x79bee3['attributes']['goal'][_0x36b642(0x1f8)])){const _0x12c38d=_0x56545b(_0x79bee3[_0x36b642(0x1a6)][_0x36b642(0x224)][_0x36b642(0x1f8)],_0x36b642(0x242));_0x12c38d&&(_0x79bee3['attributes'][_0x36b642(0x224)]['segmentId']=_0x12c38d);}for(const _0x213363 of _0x79bee3[_0x36b642(0x1a6)][_0x36b642(0x283)]||[]){const _0x37dc98=_0x2a6fb0[_0x36b642(0x223)](_0x213363[_0x36b642(0x244)][_0x36b642(0x22e)]());_0x37dc98&&(_0x213363['id']=_0x37dc98);if(_0x213363['entryCriteria']?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x213363['entryCriteria'][_0x36b642(0x1f8)])){const _0x478d09=_0x56545b(_0x213363[_0x36b642(0x271)][_0x36b642(0x1f8)],'stage\x20\x27'+_0x213363[_0x36b642(0x244)]+_0x36b642(0x27c));_0x478d09&&(_0x213363['entryCriteria'][_0x36b642(0x1f8)]=_0x478d09);}if(_0x213363[_0x36b642(0x24b)])for(const _0x5d0099 of _0x213363['exitCriterias']){if(_0x5d0099[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x5d0099[_0x36b642(0x1f8)])){const _0x3c9e9c=_0x56545b(_0x5d0099[_0x36b642(0x1f8)],_0x36b642(0x27e)+_0x213363[_0x36b642(0x244)]+_0x36b642(0x26a));_0x3c9e9c&&(_0x5d0099[_0x36b642(0x1f8)]=_0x3c9e9c);}}if(_0x213363['milestone']?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x213363[_0x36b642(0x278)][_0x36b642(0x1f8)])){const _0x900f7c=_0x56545b(_0x213363[_0x36b642(0x278)]['segmentId'],_0x36b642(0x27e)+_0x213363[_0x36b642(0x244)]+_0x36b642(0x1b9));_0x900f7c&&(_0x213363[_0x36b642(0x278)]['segmentId']=_0x900f7c);}if(_0x213363[_0x36b642(0x280)]){const _0x5eb350=_0x4912a9=>_0x4502a4[_0x36b642(0x1a6)][_0x36b642(0x283)][_0x36b642(0x210)](_0x49ae33=>_0x49ae33[_0x36b642(0x244)][_0x36b642(0x22e)]()===_0x213363[_0x36b642(0x244)][_0x36b642(0x22e)]())?.['steps']?.[_0x4912a9];for(const _0x42d023 of Object['keys'](_0x213363[_0x36b642(0x280)])){const _0x3d68e6=_0x213363['steps'][_0x42d023],_0x104bf2=_0x5eb350(_0x42d023);if(_0x3d68e6[_0x36b642(0x1b8)]==='Activation'&&_0x3d68e6[_0x36b642(0x27b)]&&(isPendingActivationId(_0x3d68e6[_0x36b642(0x27b)])||_0x3d68e6[_0x36b642(0x27b)]==='')){if(_0x104bf2?.['journeyActivationStepId']&&isPendingActivationId(_0x104bf2[_0x36b642(0x27b)])){const _0x8e590c=extractPendingActivationName(_0x104bf2['journeyActivationStepId']),_0x1f3683=_0x3d1cfc[_0x36b642(0x223)](_0x8e590c);_0x1f3683&&(_0x3d68e6['journeyActivationStepId']=_0x1f3683);}}if(_0x3d68e6[_0x36b642(0x1b8)]===_0x36b642(0x209)&&_0x3d68e6[_0x36b642(0x1f1)]&&_0x104bf2?.[_0x36b642(0x1f1)])for(let _0x3e0996=0x0;_0x3e0996<_0x3d68e6['branches']['length'];_0x3e0996++){const _0x347df2=_0x3d68e6[_0x36b642(0x1f1)][_0x3e0996],_0x5531e2=_0x104bf2[_0x36b642(0x1f1)][_0x3e0996];if(_0x5531e2?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x5531e2[_0x36b642(0x1f8)])){const _0x504334=_0x56545b(_0x5531e2['segmentId'],_0x36b642(0x27e)+_0x213363['name']+_0x36b642(0x1ad)+(_0x347df2[_0x36b642(0x244)]||_0x3e0996)+'\x27');_0x504334&&(_0x347df2[_0x36b642(0x1f8)]=_0x504334);}}if(_0x3d68e6[_0x36b642(0x1b8)]==='WaitStep'&&_0x3d68e6[_0x36b642(0x285)]?.[_0x36b642(0x1f8)]&&_0x104bf2?.[_0x36b642(0x285)]?.[_0x36b642(0x1f8)]&&isPendingSegmentId(_0x104bf2[_0x36b642(0x285)][_0x36b642(0x1f8)])){const _0x22bb2c=_0x56545b(_0x104bf2[_0x36b642(0x285)][_0x36b642(0x1f8)],_0x36b642(0x27e)+_0x213363[_0x36b642(0x244)]+_0x36b642(0x256));_0x22bb2c&&(_0x3d68e6[_0x36b642(0x285)][_0x36b642(0x1f8)]=_0x22bb2c);}}}}}
|
|
1
|
+
const a110_0x4accd9=a110_0x574b;(function(_0x25f1eb,_0x5a958c){const _0x2c5da7=a110_0x574b,_0x4a0166=_0x25f1eb();while(!![]){try{const _0x44a6c1=-parseInt(_0x2c5da7(0xd4))/0x1+parseInt(_0x2c5da7(0x15e))/0x2*(parseInt(_0x2c5da7(0xe1))/0x3)+parseInt(_0x2c5da7(0x123))/0x4*(-parseInt(_0x2c5da7(0x133))/0x5)+-parseInt(_0x2c5da7(0x1a8))/0x6+-parseInt(_0x2c5da7(0x136))/0x7*(parseInt(_0x2c5da7(0xf2))/0x8)+-parseInt(_0x2c5da7(0x17e))/0x9+parseInt(_0x2c5da7(0x156))/0xa*(parseInt(_0x2c5da7(0x14f))/0xb);if(_0x44a6c1===_0x5a958c)break;else _0x4a0166['push'](_0x4a0166['shift']());}catch(_0x2c5d36){_0x4a0166['push'](_0x4a0166['shift']());}}}(a110_0xff5c,0x7e5d9));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a110_0x4accd9(0x189);export const PENDING_ACTIVATION_PREFIX=a110_0x4accd9(0x198);export function createPendingSegmentId(_0x447cec){return''+PENDING_SEGMENT_PREFIX+_0x447cec+'__';}export function isPendingSegmentId(_0x1ce24a){const _0x35d25f=a110_0x4accd9;return _0x1ce24a[_0x35d25f(0xf7)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x68e7ac){return _0x68e7ac['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x56bb5b){return''+PENDING_ACTIVATION_PREFIX+_0x56bb5b+'__';}export function isPendingActivationId(_0x466e9f){const _0x3aea46=a110_0x4accd9;return _0x466e9f[_0x3aea46(0xf7)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x331501){const _0x55866b=a110_0x4accd9;return _0x331501[_0x55866b(0x101)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x4b654e,_0x16fb8d){const _0x3073d3=a110_0x4accd9,_0x588de0=_0x4b654e+'::'+(_0x16fb8d[_0x3073d3(0x129)]()||_0x3073d3(0xe6)),_0x1e7159=createHash('sha1')[_0x3073d3(0x14e)](_0x588de0)[_0x3073d3(0x120)](_0x3073d3(0x11f))['slice'](0x0,0xc);return _0x3073d3(0xef)+_0x1e7159;}export function ensureJourneyDefaults(_0x36c9bc){const _0x1ea07a=a110_0x4accd9;!_0x36c9bc[_0x1ea07a(0x1ae)]&&(_0x36c9bc[_0x1ea07a(0x1ae)]=''),!_0x36c9bc[_0x1ea07a(0xfb)]&&(_0x36c9bc['state']=_0x1ea07a(0xde));}export function resolveTDFolderPath(_0x270670,_0xa22085,_0x5baf50){const _0xbb13cc=a110_0x4accd9;if(!_0xa22085)return _0x270670;if(_0x270670===_0x5baf50||_0x270670[_0xbb13cc(0xf7)](_0x5baf50+'/'))return _0x270670;return _0x270670?_0x5baf50+'/'+_0x270670:_0x5baf50;}export function addFoldersToCreate(_0x71b8f2,_0x4bcba5,_0x20e905){const _0x38c88d=a110_0x4accd9;if(!_0x71b8f2)return;if(_0x4bcba5[_0x38c88d(0x121)](_0x71b8f2))return;const _0x4544a4=_0x71b8f2[_0x38c88d(0x1a4)]('/');let _0x198aa3='';for(const _0x34c725 of _0x4544a4){_0x198aa3=_0x198aa3?_0x198aa3+'/'+_0x34c725:_0x34c725,!_0x4bcba5[_0x38c88d(0x121)](_0x198aa3)&&_0x20e905[_0x38c88d(0x18a)](_0x198aa3);}}import*as a110_0x4fe816 from'yaml';import{readFileSync}from'fs';import a110_0x32e708 from'path';import{isJourneyDef,parseYamlString as a110_0x29d79d,toYamlString as a110_0x305637,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x3acdec){const _0x3911c5=a110_0x4accd9;if(Array[_0x3911c5(0xfc)](_0x3acdec))return'['+_0x3acdec[_0x3911c5(0x190)](_0x5206f9=>stableStringify(_0x5206f9))[_0x3911c5(0x1a7)](',')+']';if(_0x3acdec&&typeof _0x3acdec==='object'){const _0x15ae70=_0x3acdec,_0x30c891=Object[_0x3911c5(0x117)](_0x15ae70)[_0x3911c5(0xcc)](),_0x22af2b=_0x30c891['map'](_0x2ee51c=>'\x22'+_0x2ee51c+'\x22:'+stableStringify(_0x15ae70[_0x2ee51c]));return'{'+_0x22af2b['join'](',')+'}';}const _0x21d02d=JSON[_0x3911c5(0x14a)](_0x3acdec);return _0x21d02d===undefined?_0x3911c5(0x100):_0x21d02d;}function a110_0xff5c(){const _0x2f2e37=['idToEmailMap','action','create','existingJourney','embedded_activation_created','logDeleted','sort','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','journeyBundleName','updateActivation','set','type','createdSegmentId','activations','975478VSxTqA','relative','created','attributes','Updating\x20activation\x20\x27','from','\x27\x20not\x20found\x20in\x20journey\x20\x27','yamlConfig','journeyActivationStepId','NOT_FOUND','draft','activationActions','\x20activation\x20\x27','114SwaSoG','connectionIdToNameMap','results','idToName','getActivation','segment','folderId','\x27\x20decision\x20point\x20branch\x20\x27','logWarning','createActivation','connector_config','activation_template_id','createSegment','\x27...','journey_entry_criteria_','find','journeyBundlesByFolderAndName','1442632BkzGqW','valid','Creating\x20activation\x20\x27','resolveJourneyId','embedded_segment_created','startsWith','journey_created','\x0a\x20\x20','segmentByFolderAndName','state','isArray','Created\x20segment\x20\x27','toString','flatMap','null','replace','stage\x20\x27','journey_creating','activation_deleted','segment_creating','unchanged','segmentId','activationsBySegmentId','Updated\x20segment\x20\x27','absolutePath','Deleting\x20activation\x20\x27','kind','onProgress','Updated\x20activation\x20\x27','\x20journey\x20from\x20file:\x20','Journey\x20\x27','parentSegmentFolder','all','deleted','activation_updating','folderPathToId','WaitStep','keys','ACTIVATION_UPDATE_ERROR','segmentFolderId','steps','max','yamlActivation','parentFolder','segmentNameToId','hex','digest','has','Created\x20journey\x20\x27','581304LhKhnu','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','deps','waitCondition','Activation','INTERNAL','trim','values','embeddedSegmentNameToId','fetchJourney','push','diff','SEGMENT_UPDATE_ERROR','Updated\x20journey\x20\x27','getSegment','parse','25dfMEeR','activation_creating','deleteActivation','21rDUCiV','nameToId','Segment\x20not\x20found:\x20','parseDocument','activation_created','createdSegmentIds','JOURNEY_SYNTAX_ERROR','dirname','SEGMENT_NOT_FOUND','parentId','entry_criteria','Activation\x20not\x20found:\x20','getJourney','decision_point','columns','stages','withProgress','name','journeyById','hasChanges','stringify','skipSegments','versionNumber','activationParams','update','11WoxUuR','embedded_segment_creating','Created\x20folder\x20\x27','segment_deleting','all_columns','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','34026360hvHhyw','effectiveFolderId','logSuccess','user','data','Updating\x20segment\x20\x27','branches','goal','21286YKitFp','listSegments','isNew','length','localSegmentRules','Stage\x20\x27','utf-8','goal\x20criteria','journeyStages','Failed\x20to\x20','segment_deleted','updated','notification','journeys','activationStepsById','folderPath','./child-segment-yaml.js','rootFolderId','schedule','deleteSegment','existingSegments','existingSegment','Name\x20has\x20already\x20been\x20taken','createJourneySegment','\x20segment\x20from\x20file:\x20','milestone','updateSegmentById','slice','filter','relationships','\x27\x20milestone','logInfo','5629293oxJpBD','entryCriteria','entry','Entry\x20criteria:\x20','exitCriterias','activationContext',').\x20','message','journey','existingActivation','activation_deleting','__pending_','add','listActivations','rule','folder_creating','list','journey_updating','map','./journey-yaml.js','../../utils/async.js','segments','\x27\x20wait\x20condition','\x20(referenced\x20in\x20journey\x20','with','folder','__pending_act_','resolveSegment','SEGMENT_SYNTAX_ERROR','get','index','progress','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','toLowerCase','Creating\x20segment\x20\x27','\x20error(s)','\x27\x20exit\x20criteria','connection','split','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','createFolder','join','2525430yFZRpB','Creating\x20folder\x20\x27','delete','size','validatedRequest','behavior','description','\x27\x20from\x20file:\x20','Fetching\x20','DecisionPoint','activation_updated'];a110_0xff5c=function(){return _0x2f2e37;};return a110_0xff5c();}function activationSignature(_0x3ba547){const _0x5081ff=a110_0x4accd9,_0x1cd047={'connection':_0x3ba547[_0x5081ff(0x1a3)],..._0x3ba547['all_columns']!==undefined&&{'all_columns':_0x3ba547[_0x5081ff(0x153)]},..._0x3ba547[_0x5081ff(0x144)]!==undefined&&{'columns':_0x3ba547['columns']},..._0x3ba547['behavior']!==undefined&&{'behavior':_0x3ba547[_0x5081ff(0x1ad)]},..._0x3ba547['schedule']!==undefined&&{'schedule':_0x3ba547[_0x5081ff(0x170)]},..._0x3ba547[_0x5081ff(0x16a)]!==undefined&&{'notification':_0x3ba547[_0x5081ff(0x16a)]},..._0x3ba547[_0x5081ff(0xeb)]!==undefined&&{'connector_config':_0x3ba547[_0x5081ff(0xeb)]},..._0x3ba547[_0x5081ff(0xec)]!==undefined&&{'activation_template_id':_0x3ba547['activation_template_id']}};return stableStringify(_0x1cd047);}export async function prepareSegmentFiles(_0x230e4d,_0x3d2673,_0x3864af,_0x386e6d,_0x59f3ef){const _0x5ed39c=a110_0x4accd9,{activationDefToCreateRequest:_0x19840a}=await import(_0x5ed39c(0x16e)),_0x2675cf=[],_0x3a3ab3=new Set();for(const {yamlConfig:_0x264a69,folderPath:_0x79d61a,sourcePath:_0x2d6568}of _0x230e4d){const _0x6f8df=resolveTDFolderPath(_0x79d61a,_0x386e6d,_0x59f3ef),_0x4b7489=_0x6f8df+':'+_0x264a69['name'],_0xfc5fc9=_0x3d2673[_0x5ed39c(0xfa)][_0x5ed39c(0x19b)](_0x4b7489),_0x2bb43e=_0xfc5fc9?_0x3d2673[_0x5ed39c(0x108)][_0x5ed39c(0x19b)](_0xfc5fc9['id'])||[]:[];addFoldersToCreate(_0x6f8df,_0x3d2673['folderPathToId'],_0x3a3ab3);const _0x4f3c45=calculateActivationActions(_0x264a69[_0x5ed39c(0xd3)]||[],_0x2bb43e,_0x3d2673[_0x5ed39c(0x1b3)],_0x3d2673[_0x5ed39c(0xe2)]);for(const _0x1384a7 of _0x4f3c45){(_0x1384a7[_0x5ed39c(0xd1)]===_0x5ed39c(0x1b5)||_0x1384a7[_0x5ed39c(0xd1)]==='update')&&_0x1384a7[_0x5ed39c(0x11c)]&&(_0x1384a7[_0x5ed39c(0x1ac)]=await _0x19840a(_0x1384a7[_0x5ed39c(0x11c)],_0x3864af));}const _0x2b73e4=calculateSegmentDiff(_0x264a69,_0xfc5fc9,_0x2bb43e,_0x3d2673[_0x5ed39c(0x1b3)],_0x3d2673[_0x5ed39c(0xe2)]);_0x2675cf[_0x5ed39c(0x12d)]({'relativePath':_0x264a69['name'],'absolutePath':_0x2d6568,'yamlConfig':_0x264a69,'folderPath':_0x6f8df,'existingSegment':_0xfc5fc9,'existingActivations':_0x2bb43e,'isNew':_0x2b73e4[_0x5ed39c(0x160)],'hasChanges':_0x2b73e4[_0x5ed39c(0x149)],'diff':_0x2b73e4['diff'],'activationActions':_0x4f3c45});}return{'segmentFiles':_0x2675cf,'foldersToCreate':_0x3a3ab3};}export async function prepareJourneyFiles(_0x595090,_0x352604,_0xef2785,_0x3592be){const _0x9cd071=a110_0x4accd9,_0x4a95e0=[],_0x1d1c5b=new Set();for(const {yamlConfig:_0x45ff51,folderPath:_0x3f0579,sourcePath:_0x205844}of _0x595090){const _0x694bf6=resolveTDFolderPath(_0x3f0579,_0xef2785,_0x3592be),_0x405588=_0x694bf6+':'+_0x45ff51[_0x9cd071(0x147)],_0x42ae9a=_0x352604[_0x9cd071(0xf1)][_0x9cd071(0x19b)](_0x405588);let _0x27430f,_0x436abe;if(_0x42ae9a&&_0x42ae9a[_0x9cd071(0x161)]>0x0){const _0x5a8d73=buildLocalExpandedRuleMappings(_0x45ff51),{createYamlContext:_0x1587da,prefetchJourneySegments:_0x4de2a5}=createPushYamlContextForBundle(_0x352604[_0x9cd071(0x125)],_0x352604[_0x9cd071(0x13f)],_0x352604[_0x9cd071(0x172)],_0x5a8d73,_0x352604[_0x9cd071(0x1b3)],_0x352604[_0x9cd071(0xe2)],_0x352604[_0x9cd071(0x16c)],_0x352604[_0x9cd071(0x148)]);await _0x4de2a5(_0x42ae9a[_0x9cd071(0x190)](_0x27ed4a=>_0x27ed4a['id']));const _0x3800ab=hasMultipleVersions(_0x45ff51),_0x24296f=async _0x524e63=>{const _0x158b50=_0x9cd071,_0x4cfc9a=_0x352604[_0x158b50(0x148)]?.['get'](_0x524e63);if(_0x4cfc9a)return _0x4cfc9a;return _0x352604[_0x158b50(0x12c)]({'journeyId':_0x524e63,'journeyName':_0x45ff51['name'],'isMultiVersion':_0x42ae9a[_0x158b50(0x161)]>0x1});};if(_0x3800ab&&_0x42ae9a[_0x9cd071(0x161)]>0x1){const _0x1227e9=[];for(const _0x5a7552 of _0x42ae9a){const _0x4ccd8b=_0x5a7552[_0x9cd071(0x14c)]||0x1;_0x352604['progress']?.['update'](_0x9cd071(0x1b0)+_0x45ff51[_0x9cd071(0x147)]+'\x20v'+_0x4ccd8b);const _0x2d46e1=await _0x24296f(_0x5a7552['id']),_0x1072f0=_0x1587da(_0x5a7552['id']),_0x206c1a=await journeyResponseToDef(_0x2d46e1,_0x1072f0);_0x1227e9['push']({'item':_0x5a7552,'yaml':_0x206c1a});}const _0x183467=buildLocalRuleToNameMappingFromJourney(_0x45ff51);_0x436abe=buildMergedJourneyDef(_0x1227e9,_0x183467);const _0x4d6433=Math[_0x9cd071(0x11b)](..._0x1227e9['map'](_0x34e1f8=>_0x34e1f8['item'][_0x9cd071(0x14c)]||0x0)),_0x46feb0=_0x42ae9a['find'](_0x40d110=>(_0x40d110[_0x9cd071(0x14c)]||0x0)===_0x4d6433);_0x46feb0&&(_0x352604[_0x9cd071(0x19d)]?.['update'](_0x9cd071(0x1b0)+_0x45ff51[_0x9cd071(0x147)]+'\x20v'+_0x4d6433),_0x27430f=await _0x24296f(_0x46feb0['id']));}else{const _0x1dcfae=_0x42ae9a[_0x42ae9a[_0x9cd071(0x161)]-0x1];_0x352604[_0x9cd071(0x19d)]?.[_0x9cd071(0x14e)]('Fetching\x20'+_0x45ff51[_0x9cd071(0x147)]),_0x27430f=await _0x24296f(_0x1dcfae['id']);const _0x4811d3=_0x1587da(_0x1dcfae['id']),_0x592765=await journeyResponseToDef(_0x27430f,_0x4811d3),_0x18e460=buildLocalRuleToNameMappingFromJourney(_0x45ff51);_0x436abe=buildMergedJourneyDef([{'item':_0x1dcfae,'yaml':_0x592765}],_0x18e460);}}addFoldersToCreate(_0x694bf6,_0x352604[_0x9cd071(0x115)],_0x1d1c5b);const _0x9c0622=calculateJourneyDiff(_0x45ff51,_0x436abe);_0x4a95e0[_0x9cd071(0x12d)]({'relativePath':_0x45ff51['name'],'absolutePath':_0x205844,'yamlConfig':_0x45ff51,'folderPath':_0x694bf6,'existingJourney':_0x27430f,'isNew':_0x9c0622['isNew'],'hasChanges':_0x9c0622[_0x9cd071(0x149)],'diff':_0x9c0622[_0x9cd071(0x12e)]});}return{'journeyFiles':_0x4a95e0,'foldersToCreate':_0x1d1c5b};}export function calculateActivationActions(_0x4e6b1e,_0x234243,_0x5c997c,_0x5763a2){const _0x1a0fb6=a110_0x4accd9,_0x449daa=[],_0x574de2=new Map();for(const _0x4fc86c of _0x234243){_0x574de2[_0x1a0fb6(0xd0)](_0x4fc86c['name'],_0x4fc86c);}const _0x420c63=new Map();for(const _0x1183a6 of _0x4e6b1e){_0x420c63['set'](_0x1183a6[_0x1a0fb6(0x147)],_0x1183a6);}for(const _0x242899 of _0x4e6b1e){const _0x31da99=_0x574de2['get'](_0x242899[_0x1a0fb6(0x147)]);if(!_0x31da99)_0x449daa[_0x1a0fb6(0x12d)]({'type':_0x1a0fb6(0x1b5),'name':_0x242899[_0x1a0fb6(0x147)],'yamlActivation':_0x242899});else{const _0xb8cc83=activationResponseToDef(_0x31da99,_0x5c997c,_0x5763a2),_0x345372=a110_0x4fe816[_0x1a0fb6(0x14a)](_0xb8cc83),_0x3a5a35=a110_0x4fe816[_0x1a0fb6(0x14a)](_0x242899);_0x345372!==_0x3a5a35&&_0x449daa[_0x1a0fb6(0x12d)]({'type':_0x1a0fb6(0x14e),'name':_0x242899[_0x1a0fb6(0x147)],'yamlActivation':_0x242899,'existingActivation':_0x31da99});}}for(const _0x1ba29a of _0x234243){!_0x420c63[_0x1a0fb6(0x121)](_0x1ba29a[_0x1a0fb6(0x147)])&&_0x449daa['push']({'type':'delete','name':_0x1ba29a[_0x1a0fb6(0x147)],'existingActivation':_0x1ba29a});}return _0x449daa;}export function calculateSegmentDiff(_0x42d4d7,_0x3d7e97,_0x3b7cd6,_0x1e5ebb,_0xd4866a){const _0x2d7be5=segmentToYamlString(_0x42d4d7);if(_0x3d7e97){const _0x5cc811=segmentWithActivationsToYaml(_0x3d7e97,_0x3b7cd6,undefined,_0x1e5ebb,_0xd4866a),_0x24abb6=segmentToYamlString(_0x5cc811),_0x5d22bb=generateDiff(_0x24abb6,_0x2d7be5),_0x5be215=hasChanges(_0x5d22bb);return{'isNew':![],'hasChanges':_0x5be215,'diff':_0x5be215?formatDiffWithColors(_0x5d22bb):undefined};}const _0x24e5e5=generateDiff('',_0x2d7be5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x24e5e5)};}export function calculateJourneyDiff(_0x292f0b,_0x4a4b2b){const _0x18f990=normalizeJourneyDef(_0x292f0b,_0x292f0b),_0x316416=a110_0x305637(_0x18f990);if(_0x4a4b2b){const _0x5eb790=normalizeJourneyDef(_0x4a4b2b,_0x292f0b),_0x365383=a110_0x305637(_0x5eb790),_0x1b6e6f=generateDiff(_0x365383,_0x316416),_0x991138=hasChanges(_0x1b6e6f);return{'isNew':![],'hasChanges':_0x991138,'diff':_0x991138?formatDiffWithColors(_0x1b6e6f):undefined};}const _0x2d70e5=generateDiff('',_0x316416);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2d70e5)};}export function findSegmentsToDelete(_0x430436,_0x49f173,_0x3d04ed,_0x44b35c,_0x24556a){const _0x28cf98=a110_0x4accd9,_0x49cf3e=new Set();for(const {yamlConfig:_0x3c41ca,folderPath:_0x25bebe}of _0x49f173){_0x49cf3e['add'](_0x25bebe+':'+_0x3c41ca[_0x28cf98(0x147)]);}return _0x430436[_0x28cf98(0x17a)](_0x5edf06=>{const _0x35309f=_0x28cf98,_0x2020d7=_0x5edf06['segmentFolderId']?_0x3d04ed['get'](_0x5edf06[_0x35309f(0x119)][_0x35309f(0xfe)]())||'':'',_0x1d2b84=_0x2020d7+':'+_0x5edf06[_0x35309f(0x147)];if(_0x49cf3e[_0x35309f(0x121)](_0x1d2b84))return![];if(_0x24556a)return _0x2020d7===_0x44b35c||_0x2020d7[_0x35309f(0xf7)](_0x44b35c+'/');return!![];});}export function findJourneysToDelete(_0xea42ed,_0x5d8170,_0x42ba99,_0x35d580,_0x54b4c6){const _0xc08d4=a110_0x4accd9,_0x3ec376=new Set();for(const {yamlConfig:_0x2ead91,folderPath:_0x57b459}of _0x5d8170){_0x3ec376[_0xc08d4(0x18a)](_0x57b459+':'+_0x2ead91[_0xc08d4(0x147)]);}return _0xea42ed[_0xc08d4(0x17a)](_0x52fb0b=>{const _0x519eb1=_0xc08d4,_0x1557b8=_0x52fb0b[_0x519eb1(0xe7)]?_0x42ba99['get'](_0x52fb0b[_0x519eb1(0xe7)])||'':'',_0x423a7a=_0x1557b8+':'+_0x52fb0b[_0x519eb1(0xce)];if(_0x3ec376['has'](_0x423a7a))return![];if(_0x54b4c6)return _0x1557b8===_0x35d580||_0x1557b8[_0x519eb1(0xf7)](_0x35d580+'/');return!![];});}export function buildSegmentLookupMap(_0x5acb82,_0x28c937){const _0x7e33e6=a110_0x4accd9,_0x9bc7e4=new Map();for(const _0x321883 of _0x5acb82){const _0x1f9ffc=_0x321883['segmentFolderId']?_0x28c937['get'](_0x321883[_0x7e33e6(0x119)][_0x7e33e6(0xfe)]())||'':'',_0x4d244e=_0x1f9ffc+':'+_0x321883[_0x7e33e6(0x147)];_0x9bc7e4[_0x7e33e6(0xd0)](_0x4d244e,_0x321883);}return _0x9bc7e4;}export function buildSegmentNameToIdMap(_0x1e6562){const _0x8f7c7f=a110_0x4accd9,_0x33b0e7=new Map();for(const _0x4e1143 of _0x1e6562){_0x33b0e7[_0x8f7c7f(0xd0)](_0x4e1143['name'],_0x4e1143['id']);}return _0x33b0e7;}export function buildJourneyBundleLookupMap(_0x2a85d7,_0x1aac5d){const _0x22e101=a110_0x4accd9,_0x10fbe8=new Map();for(const _0x3c4c40 of _0x2a85d7){const _0x7aa4b1=_0x3c4c40[_0x22e101(0xe7)]?_0x1aac5d[_0x22e101(0x19b)](_0x3c4c40[_0x22e101(0xe7)])||'':'',_0x2e0717=_0x7aa4b1+':'+_0x3c4c40[_0x22e101(0xce)];!_0x10fbe8['has'](_0x2e0717)&&_0x10fbe8[_0x22e101(0xd0)](_0x2e0717,[]),_0x10fbe8[_0x22e101(0x19b)](_0x2e0717)[_0x22e101(0x12d)](_0x3c4c40);}for(const _0x4f96d4 of _0x10fbe8[_0x22e101(0x12a)]()){_0x4f96d4['sort']((_0x261543,_0x1a7be8)=>(_0x261543['versionNumber']||0x0)-(_0x1a7be8[_0x22e101(0x14c)]||0x0));}return _0x10fbe8;}export function collectFoldersToCreate(_0x2bb290,_0x6b3e42){const _0x194736=a110_0x4accd9,_0x4ea2d1=new Set();for(const _0x7e14e4 of _0x2bb290){if(!_0x7e14e4)continue;if(_0x6b3e42[_0x194736(0x121)](_0x7e14e4))continue;const _0x47d8d7=_0x7e14e4[_0x194736(0x1a4)]('/');let _0x5b4ee8='';for(const _0x23d55d of _0x47d8d7){_0x5b4ee8=_0x5b4ee8?_0x5b4ee8+'/'+_0x23d55d:_0x23d55d,!_0x6b3e42[_0x194736(0x121)](_0x5b4ee8)&&_0x4ea2d1[_0x194736(0x18a)](_0x5b4ee8);}}return _0x4ea2d1;}export function parseAndClassifyYamlFiles(_0x10dedd,_0x54d6a4,_0x1e1062){const _0x3b0def=a110_0x4accd9,_0x27ce93=[],_0x4c439d=[];for(const _0x1402ae of _0x10dedd){const _0x4082cd=a110_0x32e708['relative'](_0x54d6a4,a110_0x32e708[_0x3b0def(0x13d)](_0x1402ae)),_0x2a4b6a=_0x4082cd==='.'?'':_0x4082cd,_0x4aa8f7=readFileSync(_0x1402ae,_0x3b0def(0x164)),_0x31dfb9=a110_0x4fe816[_0x3b0def(0x132)](_0x4aa8f7);if(isJourneyDef(_0x31dfb9)){const _0x5aeef0=a110_0x29d79d(_0x4aa8f7);_0x4c439d[_0x3b0def(0x12d)]({'yamlConfig':_0x5aeef0,'folderPath':_0x2a4b6a,'sourcePath':_0x1402ae});}else{if(!_0x1e1062?.[_0x3b0def(0x14b)]){const _0x306484=parseSegmentYamlFile(_0x4aa8f7),_0x9d176e=normalizeChildSegmentYaml(_0x306484);_0x27ce93[_0x3b0def(0x12d)]({'yamlConfig':_0x9d176e,'folderPath':_0x2a4b6a,'sourcePath':_0x1402ae});}}}return{'segments':_0x27ce93,'journeys':_0x4c439d};}export function validateParsedFiles(_0xde4155,_0x5305ae){const _0x2b8836=a110_0x4accd9,_0x550d4f=[];for(const {yamlConfig:_0x1f26b7,sourcePath:_0x10804e}of _0xde4155[_0x2b8836(0x193)]){const _0x5817fd=readFileSync(_0x10804e,'utf-8'),_0x528f38=a110_0x4fe816[_0x2b8836(0x139)](_0x5817fd),_0x259e03=validateSegmentDef(_0x1f26b7,{'source':_0x5817fd,'document':_0x528f38});if(!_0x259e03[_0x2b8836(0xf3)]){const _0xab5f8d=a110_0x32e708['relative'](_0x5305ae,_0x10804e);_0x550d4f[_0x2b8836(0x12d)]({'filePath':_0xab5f8d,'source':_0x5817fd,'result':_0x259e03,'isJourney':![]});}}for(const {yamlConfig:_0x4a26dc,sourcePath:_0xf1936e}of _0xde4155[_0x2b8836(0x16b)]){const _0x110f72=readFileSync(_0xf1936e,'utf-8'),_0x1138b9=a110_0x4fe816['parseDocument'](_0x110f72),_0x4a1c23=validateJourneyDef(_0x4a26dc,{'source':_0x110f72,'document':_0x1138b9});if(!_0x4a1c23['valid']){const _0x4116b6=a110_0x32e708[_0x2b8836(0xd5)](_0x5305ae,_0xf1936e);_0x550d4f[_0x2b8836(0x12d)]({'filePath':_0x4116b6,'source':_0x110f72,'result':_0x4a1c23,'isJourney':!![]});}}return _0x550d4f;}export function formatValidationErrors(_0x41c61d){const _0x301b68=a110_0x4accd9,_0xd533cf=[];for(const {filePath:_0x2576da,source:_0x4df972,result:_0x455d59,isJourney:_0x39a1bf}of _0x41c61d){const _0x291e00=_0x39a1bf?_0x301b68(0x186):'segment';_0xd533cf[_0x301b68(0x12d)]('\x0a'+_0x2576da+'\x20('+_0x291e00+'):\x20'+_0x455d59['errors'][_0x301b68(0x161)]+_0x301b68(0x1a1)),_0xd533cf[_0x301b68(0x12d)](formatValidationResult(_0x455d59,_0x4df972,_0x2576da));}return _0xd533cf[_0x301b68(0x1a7)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x342a22){const _0xbbb011=a110_0x4accd9,_0x106bb6=new Set(),_0x96e67b=new Map(),_0x44c372=collectSegmentUsageCounts(_0x342a22);if(_0x342a22[_0xbbb011(0x193)])for(const [_0x57d4e4,_0x3dce0b]of Object['entries'](_0x342a22[_0xbbb011(0x193)])){_0x106bb6[_0xbbb011(0x18a)](_0x57d4e4);if(_0x3dce0b[_0xbbb011(0x18c)]){const _0x48c032=yamlRuleToApi(_0x3dce0b[_0xbbb011(0x18c)]),_0x14d1ab=apiRuleToYaml(_0x48c032);_0x96e67b['set'](_0x57d4e4,_0x14d1ab);}}const _0x306b22=new Map();let _0xde0f5=0x0;for(const [_0x4d0f1d,_0x26fa1c]of _0x96e67b){const _0x74ea04=serializeExpandedRule(_0x26fa1c,_0x96e67b),_0x6b34c3=_0x306b22[_0xbbb011(0x19b)](_0x74ea04)||[];_0x6b34c3[_0xbbb011(0x12d)]({'name':_0x4d0f1d,'index':_0xde0f5}),_0x306b22['set'](_0x74ea04,_0x6b34c3),_0xde0f5++;}const _0xb04fff=new Map();for(const [_0x5efc5f,_0x5935df]of _0x306b22){const _0x45ebdf=_0x5935df['slice']()['sort']((_0x48517f,_0xd70a)=>{const _0x47d739=_0xbbb011,_0x143c1b=_0x44c372[_0x47d739(0x19b)](_0x48517f[_0x47d739(0x147)])||0x0,_0x4c4433=_0x44c372['get'](_0xd70a['name'])||0x0;if(_0x143c1b!==_0x4c4433)return _0x4c4433-_0x143c1b;return _0x48517f[_0x47d739(0x19c)]-_0xd70a['index'];})[_0xbbb011(0x190)](_0x59ecf7=>_0x59ecf7[_0xbbb011(0x147)]),_0x663230=[];for(const _0xac6716 of _0x45ebdf){const _0x30fd64=_0x44c372[_0xbbb011(0x19b)](_0xac6716)||0x0,_0x501f08=Math[_0xbbb011(0x11b)](_0x30fd64,0x1);for(let _0x2b1f3a=0x0;_0x2b1f3a<_0x501f08;_0x2b1f3a++){_0x663230[_0xbbb011(0x12d)](_0xac6716);}}_0xb04fff[_0xbbb011(0xd0)](_0x5efc5f,_0x663230);}return{'existingLocalSegmentNames':_0x106bb6,'localSegmentRules':_0x96e67b,'localExpandedRuleToNames':_0xb04fff};}async function buildServerSegmentRuleMap(_0x518887,_0x280c0e,_0x21d2cc,_0x30a694){const _0x22cbb7=new Map(),_0x192f01=new Set(),_0x4b9330=async _0x3e2520=>{const _0x3054de=a110_0x574b;if(_0x192f01['has'](_0x3e2520))return;_0x192f01['add'](_0x3e2520);let _0x160758=_0x21d2cc[_0x3054de(0xf0)](_0xe777bf=>_0xe777bf['id']===_0x3e2520);if(!_0x160758)try{_0x160758=await _0x518887[_0x3054de(0xe6)][_0x3054de(0x131)](_0x280c0e,_0x3e2520);}catch{return;}if(!_0x160758?.[_0x3054de(0x18c)])return;const _0x358119=apiRuleToYaml(_0x160758[_0x3054de(0x18c)]);_0x22cbb7[_0x3054de(0xd0)](_0x3e2520,_0x358119);const _0x92ed47=collectSegmentRefsFromRule(_0x358119);for(const _0x32a262 of _0x92ed47){await _0x4b9330(_0x32a262);}};for(const _0x108f4e of _0x30a694){await _0x4b9330(_0x108f4e);}return _0x22cbb7;}export function createSegmentIdResolver(_0x5b08e6,_0x23cf35){return async _0xc76ebb=>{const _0x6c2b70=a110_0x574b,_0xcc1adc=_0x5b08e6[_0x6c2b70(0x19b)](_0xc76ebb);if(!_0xcc1adc)throw new SDKError(ErrorCode[_0x6c2b70(0x13e)],_0x6c2b70(0x138)+_0xc76ebb+_0x6c2b70(0x124)+_0x23cf35+'\x27)');return _0xcc1adc;};}export function extractRootFolderId(_0x4e0f19){const _0x1321b=a110_0x4accd9;return _0x4e0f19[_0x1321b(0x17b)]?.[_0x1321b(0x111)]?.['data']?.['id']||_0x4e0f19['relationships']?.[_0x1321b(0x11d)]?.['data']?.['id'];}export function buildConnectionMaps(_0xaaf584){const _0x121205=a110_0x4accd9,_0x1ba1f4=new Map(),_0xfff451=new Map(),_0x16c782=new Map();for(const _0x5b1f99 of _0xaaf584){_0x1ba1f4[_0x121205(0xd0)](_0x5b1f99[_0x121205(0x147)],parseInt(_0x5b1f99['id'],0xa)),_0xfff451['set'](_0x5b1f99['id'],_0x5b1f99[_0x121205(0x147)]),_0x16c782[_0x121205(0xd0)](_0x5b1f99[_0x121205(0x147)],_0x5b1f99['type']);}return{'nameToId':_0x1ba1f4,'idToName':_0xfff451,'nameToType':_0x16c782};}export function calculatePushStats(_0x5e8c7b,_0x4b736e,_0x242472,_0x3dded8,_0x4e020a,_0x470c13,_0x4ab999){const _0x34f16b=a110_0x4accd9,_0x5c7ec2=_0x5e8c7b[_0x34f16b(0x17a)](_0x1752c8=>_0x1752c8[_0x34f16b(0x160)]),_0x34816b=_0x5e8c7b[_0x34f16b(0x17a)](_0x1ac205=>!_0x1ac205['isNew']&&_0x1ac205[_0x34f16b(0x149)]),_0x5ba285=_0x5e8c7b['filter'](_0x219642=>!_0x219642[_0x34f16b(0x160)]&&!_0x219642['hasChanges']),_0x7db320=_0x470c13?_0x3dded8:[],_0x4cf355=_0x4b736e[_0x34f16b(0x17a)](_0xa3e380=>_0xa3e380[_0x34f16b(0x160)]),_0x2a5b9d=_0x4b736e['filter'](_0x5e84d8=>!_0x5e84d8[_0x34f16b(0x160)]&&_0x5e84d8[_0x34f16b(0x149)]),_0x4d23c2=_0x4b736e[_0x34f16b(0x17a)](_0x180f0b=>!_0x180f0b['isNew']&&!_0x180f0b[_0x34f16b(0x149)]),_0x8f8812=_0x470c13?_0x4e020a:[],_0x35bcac=_0x5e8c7b[_0x34f16b(0xff)](_0x3cb1c5=>_0x3cb1c5[_0x34f16b(0xdf)]),_0x2fcb99=_0x35bcac[_0x34f16b(0x17a)](_0x5cf375=>_0x5cf375['type']==='create'),_0x9df34f=_0x35bcac[_0x34f16b(0x17a)](_0x339de8=>_0x339de8[_0x34f16b(0xd1)]===_0x34f16b(0x14e)),_0x32685b=_0x35bcac[_0x34f16b(0x17a)](_0x228755=>_0x228755[_0x34f16b(0xd1)]==='delete'),_0xa0d76c=Array[_0x34f16b(0xd9)](_0x242472)[_0x34f16b(0xcc)](),_0x4216d2=_0x4ab999?![]:_0x5c7ec2[_0x34f16b(0x161)]>0x0||_0x34816b[_0x34f16b(0x161)]>0x0||_0x7db320[_0x34f16b(0x161)]>0x0,_0x469dae=_0x4cf355[_0x34f16b(0x161)]>0x0||_0x2a5b9d[_0x34f16b(0x161)]>0x0||_0x8f8812[_0x34f16b(0x161)]>0x0,_0x70998d=_0x4ab999?![]:_0x35bcac[_0x34f16b(0x161)]>0x0,_0x2979de=_0xa0d76c['length']>0x0;return{'segments':{'new':_0x5c7ec2,'changed':_0x34816b,'unchanged':_0x5ba285,'toDelete':_0x7db320},'journeys':{'new':_0x4cf355,'changed':_0x2a5b9d,'unchanged':_0x4d23c2,'toDelete':_0x8f8812},'activations':{'all':_0x35bcac,'toCreate':_0x2fcb99,'toUpdate':_0x9df34f,'toDelete':_0x32685b},'folders':{'toCreate':_0xa0d76c},'counts':{'segments':{'new':_0x5c7ec2[_0x34f16b(0x161)],'changed':_0x34816b['length'],'unchanged':_0x5ba285[_0x34f16b(0x161)],'toDelete':_0x7db320[_0x34f16b(0x161)]},'journeys':{'new':_0x4cf355['length'],'changed':_0x2a5b9d[_0x34f16b(0x161)],'unchanged':_0x4d23c2['length'],'toDelete':_0x8f8812[_0x34f16b(0x161)]},'activations':{'create':_0x2fcb99[_0x34f16b(0x161)],'update':_0x9df34f[_0x34f16b(0x161)],'delete':_0x32685b[_0x34f16b(0x161)]},'folders':_0xa0d76c[_0x34f16b(0x161)]},'hasChanges':_0x4216d2||_0x469dae||_0x70998d||_0x2979de};}export async function buildPushExecutionContext(_0x1666e1,_0x4541b6,_0x2085e2,_0x383517,_0x4d0519,_0xbbe4ff){const _0x422919=a110_0x4accd9,_0x34e13e=extractRootFolderId(_0x2085e2),{pathToId:_0x3dff36,idToPath:_0x5a83b5}=buildFolderMaps(_0x4d0519),_0x2745bd=buildSegmentNameToIdMap(_0x383517),_0x4c0882=new Map(),{batchAsync:_0x13157c}=await import('../../utils/async.js'),[_0x350abd,_0x4a000d]=await Promise[_0x422919(0x112)]([_0x1666e1[_0x422919(0x159)]['buildUserMaps'](),_0x1666e1[_0x422919(0x1a3)][_0x422919(0x18e)](),((async()=>{const _0x4c2c79=_0x422919;!_0xbbe4ff&&_0x383517[_0x4c2c79(0x161)]>0x0&&await _0x13157c(_0x383517,async _0x343a43=>{const _0x2af1a5=_0x4c2c79,_0x4e43c0=await _0x1666e1['segment']['listActivations'](_0x4541b6,_0x343a43['id']);_0x4c0882[_0x2af1a5(0xd0)](_0x343a43['id'],_0x4e43c0);});})())]),{emailToId:_0xc495b9,idToEmail:_0x3a0e4d}=_0x350abd,_0x4e649e=buildConnectionMaps(_0x4a000d);return{'rootFolderId':_0x34e13e,'folderPathToId':_0x3dff36,'folderIdToPath':_0x5a83b5,'segmentNameToId':_0x2745bd,'activationsBySegmentId':_0x4c0882,'emailToIdMap':_0xc495b9,'idToEmailMap':_0x3a0e4d,'connectionNameToIdMap':_0x4e649e[_0x422919(0x137)],'connectionIdToNameMap':_0x4e649e[_0x422919(0xe4)],'connectionNameToTypeMap':_0x4e649e['nameToType']};}export function createPushYamlContextForBundle(_0xb9a924,_0x204b19,_0x48b0cc,_0xc5d5d,_0x2134cb,_0x146d70,_0xc99d0a,_0x3762de){const {existingLocalSegmentNames:_0x18d205,localExpandedRuleToNames:_0x2e972b}=_0xc5d5d,_0x389736=new Set(),_0x15af53=new Map(),_0x2d0643=new Map(),_0x2b5d1d=new Map(),_0x3b5abe=createJumpTargetCache(),_0x24ed03=new Map(),_0x2a65de=new Map(),_0x478511=new Set();let _0x39bdb7;const _0x1c50fc=_0x5e13c2=>{const _0x5188e4={'resolveSegment':async _0x4c1258=>{const _0x4ce6da=a110_0x574b,_0x5a1a3b=_0x2b5d1d['get'](_0x4c1258);if(_0x5a1a3b!==undefined)return{'name':_0x5a1a3b,'isJourneyLocal':!![]};try{let _0x13c83d=_0x48b0cc[_0x4ce6da(0xf0)](_0xeb85c8=>_0xeb85c8['id']===_0x4c1258);!_0x13c83d&&(_0x13c83d=await _0xb9a924['segment'][_0x4ce6da(0x131)](_0x204b19,_0x4c1258));const _0x3a038f=generateJourneyLocalName(_0x13c83d[_0x4ce6da(0x147)]),_0x167a37=_0x13c83d[_0x4ce6da(0x10c)]===SEGMENT_KIND_JOURNEY&&_0x3a038f!==undefined;let _0x53feb2=_0x13c83d[_0x4ce6da(0x147)],_0x3bd461;if(_0x167a37&&_0x13c83d['rule']){const _0x285754=apiRuleToYaml(_0x13c83d[_0x4ce6da(0x18c)]);_0x2a65de[_0x4ce6da(0xd0)](_0x4c1258,_0x285754);const _0x29acf0=async _0x2bfec4=>{const _0x2bc775=_0x4ce6da,_0x51935e=collectSegmentRefsFromRule(_0x2bfec4);for(const _0x38b271 of _0x51935e){if(!_0x2a65de[_0x2bc775(0x121)](_0x38b271))try{const _0x1691fd=await _0xb9a924[_0x2bc775(0xe6)][_0x2bc775(0x131)](_0x204b19,_0x38b271);if(_0x1691fd?.[_0x2bc775(0x18c)]){const _0x444445=apiRuleToYaml(_0x1691fd[_0x2bc775(0x18c)]);_0x2a65de[_0x2bc775(0xd0)](_0x38b271,_0x444445),await _0x29acf0(_0x444445);}}catch{}}};await _0x29acf0(_0x285754);const _0x7d8b9=serializeExpandedRule(_0x285754,_0x2a65de),_0x175fee=_0x2e972b[_0x4ce6da(0x19b)](_0x7d8b9);if(_0x175fee&&_0x175fee[_0x4ce6da(0x161)]>0x0){const _0x28a848=_0x15af53[_0x4ce6da(0x19b)](_0x7d8b9)||0x0,_0x1d8113=_0x175fee[_0x28a848]||_0x175fee[_0x175fee[_0x4ce6da(0x161)]-0x1];_0x15af53[_0x4ce6da(0xd0)](_0x7d8b9,_0x28a848+0x1),_0x53feb2=_0x1d8113,_0x389736[_0x4ce6da(0x18a)](_0x53feb2),_0x2b5d1d[_0x4ce6da(0xd0)](_0x4c1258,_0x53feb2);const _0x265d26=await resolveRuleSegmentRefs(_0x285754,async _0x78ba97=>{const _0x4a5e04=_0x4ce6da,_0x47d798=_0x2b5d1d[_0x4a5e04(0x19b)](_0x78ba97);if(_0x47d798)return _0x47d798;const _0x7a2989=await _0x39bdb7['resolveSegment'](_0x78ba97);return _0x7a2989['name'];});_0x3bd461={'description':_0x13c83d[_0x4ce6da(0x1ae)],'rule':_0x265d26};}else{const _0x17b8b7=_0x24ed03[_0x4ce6da(0x19b)](_0x7d8b9);if(_0x17b8b7)_0x53feb2=_0x17b8b7,_0x2b5d1d[_0x4ce6da(0xd0)](_0x4c1258,_0x53feb2);else{if(_0x3a038f){let _0x3baed8=_0x3a038f,_0x2b96ac=0x2;while(_0x389736['has'](_0x3baed8)||_0x18d205['has'](_0x3baed8)){_0x3baed8=_0x3a038f+'_'+_0x2b96ac,_0x2b96ac++;}_0x389736[_0x4ce6da(0x18a)](_0x3baed8),_0x53feb2=_0x3baed8;}_0x2b5d1d[_0x4ce6da(0xd0)](_0x4c1258,_0x53feb2),_0x24ed03[_0x4ce6da(0xd0)](_0x7d8b9,_0x53feb2);const _0xb32518=await resolveRuleSegmentRefs(_0x285754,async _0x5271ac=>{const _0x297f08=_0x4ce6da,_0x2978c1=_0x2b5d1d[_0x297f08(0x19b)](_0x5271ac);if(_0x2978c1)return _0x2978c1;const _0x28f5d6=await _0x39bdb7[_0x297f08(0x199)](_0x5271ac);return _0x28f5d6[_0x297f08(0x147)];});_0x3bd461={'description':_0x13c83d[_0x4ce6da(0x1ae)],'rule':_0xb32518};}}}return{'name':_0x53feb2,'isJourneyLocal':_0x167a37,'definition':_0x3bd461};}catch{return{'name':_0x4c1258,'isJourneyLocal':![]};}},'resolveActivation':async _0x328975=>{const _0x46fe8e=a110_0x574b,_0x4b29ee=_0x2d0643[_0x46fe8e(0x19b)](_0x328975);if(_0x4b29ee!==undefined)return{'name':_0x4b29ee,'isJourneyLocal':!![]};try{let _0x41e2be=_0xc99d0a?.[_0x46fe8e(0x19b)](_0x328975);!_0x41e2be&&(_0x41e2be=await _0xb9a924[_0x46fe8e(0x186)][_0x46fe8e(0xe5)](_0x5e13c2,_0x328975));const _0xc088ba=_0x41e2be[_0x46fe8e(0xd7)][_0x46fe8e(0x14d)][_0x46fe8e(0x147)]||_0x328975,_0x12b63b=sanitizeYamlKey(_0xc088ba)||'activation_'+_0x328975,_0x2580fe=_0x12b63b;_0x2d0643[_0x46fe8e(0xd0)](_0x328975,_0x2580fe);const _0x706e3a=journeyActivationStepToYaml(_0x41e2be,_0x2134cb,_0x146d70);return{'name':_0x2580fe,'isJourneyLocal':!![],'definition':_0x706e3a};}catch{return{'name':_0x328975,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4f3c82,_0x33ab0c)=>resolveJumpTarget(_0x4f3c82,_0x33ab0c,_0x3b5abe,async _0x2695d3=>{const _0x3954f1=a110_0x574b,_0x2e0169=_0x3762de?.[_0x3954f1(0x19b)](_0x2695d3);if(_0x2e0169)return _0x2e0169;return _0xb9a924['journey'][_0x3954f1(0x142)](_0x2695d3);})};return _0x39bdb7=_0x5188e4,_0x5188e4;},_0x252386=async _0x14993e=>{const _0x3c173f=a110_0x574b,{collectSegmentIdsFromJourneyApi:_0x9d92a}=await import(_0x3c173f(0x191)),{batchAsync:_0xddecc3}=await import(_0x3c173f(0x192)),_0x13cc0a=new Set();for(const _0x5e0f26 of _0x14993e){let _0x362ed3=_0x3762de?.[_0x3c173f(0x19b)](_0x5e0f26);!_0x362ed3&&(_0x362ed3=await _0xb9a924['journey']['getJourney'](_0x5e0f26));const _0x5b6f32=_0x9d92a(_0x362ed3);for(const _0x26dc7e of _0x5b6f32){_0x13cc0a[_0x3c173f(0x18a)](_0x26dc7e);}}let _0x65781d=Array[_0x3c173f(0xd9)](_0x13cc0a);while(_0x65781d[_0x3c173f(0x161)]>0x0){const _0x21b8bd=_0x65781d[_0x3c173f(0x17a)](_0x53ef6c=>!_0x478511['has'](_0x53ef6c));if(_0x21b8bd['length']===0x0)break;const _0x74b4da=await _0xddecc3(_0x21b8bd,async _0x3485e7=>{const _0x1e66cc=_0x3c173f;_0x478511[_0x1e66cc(0x18a)](_0x3485e7);let _0x5d5ef7=_0x48b0cc[_0x1e66cc(0xf0)](_0x4d6c05=>_0x4d6c05['id']===_0x3485e7);if(!_0x5d5ef7)try{_0x5d5ef7=await _0xb9a924[_0x1e66cc(0xe6)][_0x1e66cc(0x131)](_0x204b19,_0x3485e7);}catch{return null;}return{'segmentId':_0x3485e7,'segment':_0x5d5ef7};},0xa),_0x4576c0=new Set();for(const _0x244705 of _0x74b4da){if(!_0x244705?.['segment']?.[_0x3c173f(0x18c)])continue;const _0x1970c6=apiRuleToYaml(_0x244705[_0x3c173f(0xe6)][_0x3c173f(0x18c)]);_0x2a65de[_0x3c173f(0xd0)](_0x244705[_0x3c173f(0x107)],_0x1970c6);const _0xdb9acc=collectSegmentRefsFromRule(_0x1970c6);for(const _0x58fb69 of _0xdb9acc){!_0x478511['has'](_0x58fb69)&&_0x4576c0['add'](_0x58fb69);}}_0x65781d=Array['from'](_0x4576c0);}};return{'createYamlContext':_0x1c50fc,'prefetchJourneySegments':_0x252386};}export async function executePushSegments(_0x30ea91,_0x122e78,_0x4e36e3,_0x4587a3,_0x4597a3){const _0x1442b1=a110_0x4accd9,{segmentDefToCreateRequest:_0x15553a,segmentDefToUpdateRequest:_0x534b64}=await import(_0x1442b1(0x16e)),_0x5a677a=_0x4e36e3[_0x1442b1(0x115)],_0x2a83a3=0x5,_0x287543=async _0x3038dd=>{const _0xcf3898=_0x1442b1,_0x1d77d5=_0x3038dd['folderPath']?_0x5a677a[_0xcf3898(0x19b)](_0x3038dd[_0xcf3898(0x16d)]):undefined;let _0x206975;const _0x4ca30e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x3038dd[_0xcf3898(0x160)]){_0x4597a3['onProgress']?.({'type':_0xcf3898(0x105),'name':_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]});const _0x10b070=_0x15553a(_0x3038dd[_0xcf3898(0xdb)],_0x1d77d5),_0x10f759=await _0x4597a3[_0xcf3898(0x146)](_0xcf3898(0x1a0)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+_0xcf3898(0xee),()=>_0x30ea91[_0xcf3898(0xe6)][_0xcf3898(0xed)](_0x4587a3[_0xcf3898(0x13f)],_0x10b070));_0x206975=_0x10f759['data']['id'],_0x4ca30e[_0xcf3898(0xd2)]={'name':_0x3038dd['yamlConfig']['name'],'id':_0x206975},_0x4597a3['onProgress']?.({'type':'segment_created','name':_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)],'segmentId':_0x206975}),_0x4597a3['logSuccess']?.(_0xcf3898(0xfd)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+'\x27'),_0x4ca30e['created']=0x1;}else{if(_0x3038dd[_0xcf3898(0x149)]){_0x4597a3['onProgress']?.({'type':'segment_updating','name':_0x3038dd[_0xcf3898(0xdb)]['name']});const _0x477d24=_0x534b64(_0x3038dd[_0xcf3898(0xdb)]);_0x1d77d5!==_0x3038dd[_0xcf3898(0x173)]?.['segmentFolderId']&&(_0x477d24[_0xcf3898(0x119)]=_0x1d77d5?parseInt(_0x1d77d5,0xa):undefined),await _0x4597a3[_0xcf3898(0x146)](_0xcf3898(0x15b)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+_0xcf3898(0xee),()=>_0x30ea91['segment'][_0xcf3898(0x178)](_0x4587a3[_0xcf3898(0x13f)],_0x3038dd['existingSegment']['id'],_0x477d24)),_0x206975=_0x3038dd['existingSegment']['id'],_0x4597a3['onProgress']?.({'type':'segment_updated','name':_0x3038dd[_0xcf3898(0xdb)]['name']}),_0x4597a3['logSuccess']?.(_0xcf3898(0x109)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+'\x27'),_0x4ca30e[_0xcf3898(0x169)]=0x1;}else _0x206975=_0x3038dd['existingSegment']['id'];}}catch(_0x4e6c98){const _0x295d17=isHttp400Error(_0x4e6c98),_0x5cf7e7=_0x295d17?ErrorCode[_0xcf3898(0x19a)]:ErrorCode[_0xcf3898(0x12f)],_0x1d0a16=getErrorMessage(_0x4e6c98);throw new SDKError(_0x5cf7e7,_0xcf3898(0x167)+(_0x3038dd[_0xcf3898(0x160)]?'create':_0xcf3898(0x14e))+_0xcf3898(0x176)+_0x3038dd[_0xcf3898(0x10a)]+_0xcf3898(0xf9)+_0x1d0a16,_0x4e6c98);}try{const _0x339daa=await syncActivationsForSegment(_0x30ea91,_0x4587a3[_0xcf3898(0x13f)],_0x206975,_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)],_0x3038dd[_0xcf3898(0xdf)],_0x4597a3,_0x3038dd[_0xcf3898(0x10a)]);_0x4ca30e[_0xcf3898(0xd3)]=_0x339daa;}catch(_0x75d451){if(_0x75d451 instanceof SDKError)throw _0x75d451;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xcf3898(0x19e)+_0x3038dd[_0xcf3898(0xdb)][_0xcf3898(0x147)]+_0xcf3898(0x1af)+_0x3038dd[_0xcf3898(0x10a)]+'\x0a\x20\x20'+getErrorMessage(_0x75d451),_0x75d451);}return _0x4ca30e;},_0x252553=await batchAsync(_0x122e78,_0x287543,_0x2a83a3),_0xf707e5={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5d2a2e of _0x252553){_0xf707e5[_0x1442b1(0xd6)]+=_0x5d2a2e[_0x1442b1(0xd6)],_0xf707e5[_0x1442b1(0x169)]+=_0x5d2a2e['updated'],_0x5d2a2e[_0x1442b1(0xd2)]&&_0xf707e5[_0x1442b1(0x13b)][_0x1442b1(0xd0)](_0x5d2a2e[_0x1442b1(0xd2)][_0x1442b1(0x147)],_0x5d2a2e[_0x1442b1(0xd2)]['id']),_0xf707e5[_0x1442b1(0xd3)][_0x1442b1(0xd6)]+=_0x5d2a2e['activations'][_0x1442b1(0xd6)],_0xf707e5[_0x1442b1(0xd3)]['updated']+=_0x5d2a2e[_0x1442b1(0xd3)][_0x1442b1(0x169)],_0xf707e5['activations']['deleted']+=_0x5d2a2e[_0x1442b1(0xd3)][_0x1442b1(0x113)];}return _0xf707e5;}async function syncActivationsForSegment(_0x5dfbef,_0x1d6c6f,_0x341fc6,_0x47a975,_0x75fabb,_0x5f6004,_0x52c61b){const _0x1f9c70=a110_0x4accd9,_0x496c28={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2c2fc7 of _0x75fabb){try{if(_0x2c2fc7[_0x1f9c70(0xd1)]==='create'&&_0x2c2fc7[_0x1f9c70(0x1ac)])_0x5f6004['onProgress']?.({'type':_0x1f9c70(0x134),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),await _0x5f6004[_0x1f9c70(0x146)](_0x1f9c70(0xf4)+_0x2c2fc7[_0x1f9c70(0x147)]+'\x27...',()=>_0x5dfbef[_0x1f9c70(0xe6)][_0x1f9c70(0xea)](_0x1d6c6f,_0x341fc6,_0x2c2fc7['validatedRequest'])),_0x5f6004['onProgress']?.({'type':_0x1f9c70(0x13a),'segmentName':_0x47a975,'activationName':_0x2c2fc7['name']}),_0x5f6004[_0x1f9c70(0x158)]?.('Created\x20activation\x20\x27'+_0x2c2fc7[_0x1f9c70(0x147)]+'\x27'),_0x496c28[_0x1f9c70(0xd6)]++;else{if(_0x2c2fc7[_0x1f9c70(0xd1)]==='update'&&_0x2c2fc7[_0x1f9c70(0x1ac)]&&_0x2c2fc7[_0x1f9c70(0x187)])_0x5f6004[_0x1f9c70(0x10d)]?.({'type':_0x1f9c70(0x114),'segmentName':_0x47a975,'activationName':_0x2c2fc7['name']}),await _0x5f6004[_0x1f9c70(0x146)](_0x1f9c70(0xd8)+_0x2c2fc7[_0x1f9c70(0x147)]+_0x1f9c70(0xee),()=>_0x5dfbef['segment'][_0x1f9c70(0xcf)](_0x1d6c6f,_0x341fc6,_0x2c2fc7[_0x1f9c70(0x187)]['id'],_0x2c2fc7[_0x1f9c70(0x1ac)])),_0x5f6004[_0x1f9c70(0x10d)]?.({'type':_0x1f9c70(0x1b2),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),_0x5f6004[_0x1f9c70(0x158)]?.(_0x1f9c70(0x10e)+_0x2c2fc7['name']+'\x27'),_0x496c28[_0x1f9c70(0x169)]++;else _0x2c2fc7[_0x1f9c70(0xd1)]===_0x1f9c70(0x1aa)&&_0x2c2fc7[_0x1f9c70(0x187)]&&(_0x5f6004[_0x1f9c70(0x10d)]?.({'type':_0x1f9c70(0x188),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),await _0x5f6004['withProgress'](_0x1f9c70(0x10b)+_0x2c2fc7[_0x1f9c70(0x147)]+_0x1f9c70(0xee),()=>_0x5dfbef[_0x1f9c70(0xe6)][_0x1f9c70(0x135)](_0x1d6c6f,_0x341fc6,_0x2c2fc7[_0x1f9c70(0x187)]['id'])),_0x5f6004['onProgress']?.({'type':_0x1f9c70(0x104),'segmentName':_0x47a975,'activationName':_0x2c2fc7[_0x1f9c70(0x147)]}),_0x5f6004['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x2c2fc7['name']+'\x27'),_0x496c28[_0x1f9c70(0x113)]++);}}catch(_0x40e6e3){const _0x1d5847=isHttp400Error(_0x40e6e3),_0x3bac8f=_0x1d5847?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x1f9c70(0x118)],_0x39da6a=getErrorMessage(_0x40e6e3);throw new SDKError(_0x3bac8f,'Failed\x20to\x20'+_0x2c2fc7[_0x1f9c70(0xd1)]+_0x1f9c70(0xe0)+_0x2c2fc7[_0x1f9c70(0x147)]+_0x1f9c70(0x1af)+_0x52c61b+_0x1f9c70(0xf9)+_0x39da6a,_0x40e6e3);}}return _0x496c28;}export async function executePushFolders(_0x10208a,_0x1f91aa,_0x2e1e78,_0x147c8,_0x5e7b0e){const _0x5479f0=a110_0x4accd9,_0x3c783e=new Map(_0x2e1e78);for(const _0x42c09c of _0x1f91aa){const _0x7a91d=_0x42c09c[_0x5479f0(0x1a4)]('/'),_0x409ac4=_0x7a91d[_0x7a91d[_0x5479f0(0x161)]-0x1],_0x5188cf=_0x7a91d['slice'](0x0,-0x1)[_0x5479f0(0x1a7)]('/'),_0x563f8a=_0x3c783e['get'](_0x5188cf);_0x5e7b0e[_0x5479f0(0x10d)]?.({'type':_0x5479f0(0x18d),'folder':_0x42c09c});const _0x54c2e1={'name':_0x409ac4,'parentFolderId':_0x563f8a},_0x35e0a8=await _0x5e7b0e['withProgress'](_0x5479f0(0x1a9)+_0x42c09c+_0x5479f0(0xee),()=>_0x10208a['segment'][_0x5479f0(0x1a6)](_0x147c8[_0x5479f0(0x13f)],_0x54c2e1));_0x3c783e['set'](_0x42c09c,_0x35e0a8['data']['id']),_0x5e7b0e[_0x5479f0(0x10d)]?.({'type':'folder_created','folder':_0x42c09c,'folderId':_0x35e0a8[_0x5479f0(0x15a)]['id']}),_0x5e7b0e[_0x5479f0(0x17d)]?.(_0x5479f0(0x151)+_0x42c09c+'\x27');}return _0x3c783e;}export async function executePushSegmentDeletions(_0x2eee8b,_0x3603c7,_0x472ed8){const _0x519b32=a110_0x4accd9;if(_0x3603c7['length']===0x0)return 0x0;const {batchAsync:_0x223380}=await import(_0x519b32(0x192)),_0xedb521=0x5,_0x1bde47=await _0x223380(_0x3603c7,async _0x1d61cb=>{const _0x2f2c16=_0x519b32;return _0x472ed8['onProgress']?.({'type':_0x2f2c16(0x152),'name':_0x1d61cb['name']}),await _0x2eee8b[_0x2f2c16(0xe6)][_0x2f2c16(0x171)](_0x1d61cb['id']),_0x472ed8[_0x2f2c16(0x10d)]?.({'type':_0x2f2c16(0x168),'name':_0x1d61cb['name']}),_0x472ed8[_0x2f2c16(0xcb)]?.('Deleted\x20segment\x20\x27'+_0x1d61cb[_0x2f2c16(0x147)]+'\x27'),0x1;},_0xedb521);return _0x1bde47['reduce']((_0x49173f,_0xf3847e)=>_0x49173f+_0xf3847e,0x0);}function a110_0x574b(_0x2b6d9b,_0x1b01d2){_0x2b6d9b=_0x2b6d9b-0xc9;const _0xff5ce6=a110_0xff5c();let _0x574b14=_0xff5ce6[_0x2b6d9b];return _0x574b14;}export async function executePushJourneys(_0x19f3bf,_0x245e48,_0x43c4ed,_0x9c0fcb,_0x2a95a8){const _0x55e00f=a110_0x4accd9,{journeyDefToRequest:_0x4e7581}=await import(_0x55e00f(0x191)),{activationDefToCreateRequest:_0x1d0ec8,yamlRuleToApi:_0x5e49f4,validateSegmentRule:_0x59c507}=await import(_0x55e00f(0x16e)),_0x1ae0dd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x224cb3=new Map(_0x43c4ed['segmentNameToId']),_0x3519a1=0x5;for(let _0x19627a=0x0;_0x19627a<_0x245e48[_0x55e00f(0x161)];_0x19627a+=_0x3519a1){const _0x587a84=_0x245e48[_0x55e00f(0x179)](_0x19627a,_0x19627a+_0x3519a1),_0x4d8c8a=await Promise[_0x55e00f(0x112)](_0x587a84[_0x55e00f(0x190)](async _0x542159=>{const _0x300612=_0x55e00f;if(!_0x542159[_0x300612(0x160)]&&!_0x542159[_0x300612(0x149)])return{'action':_0x300612(0x106),'name':_0x542159[_0x300612(0xdb)][_0x300612(0x147)],'journeyId':_0x542159['existingJourney']?.['id']};const _0x12b455=_0x542159['folderPath']?_0x43c4ed[_0x300612(0x115)][_0x300612(0x19b)](_0x542159[_0x300612(0x16d)]):undefined;_0x2a95a8[_0x300612(0x10d)]?.({'type':_0x542159[_0x300612(0x160)]?_0x300612(0x103):_0x300612(0x18f),'name':_0x542159['yamlConfig']['name']});try{const _0x379709=await executeSingleJourneyPush(_0x19f3bf,_0x542159,{..._0x43c4ed,'segmentNameToId':_0x224cb3},{'parentId':_0x9c0fcb[_0x300612(0x13f)],'rootFolderId':_0x9c0fcb[_0x300612(0x16f)],'folderId':_0x12b455,'verbose':_0x9c0fcb['verbose']},_0x2a95a8,{'journeyDefToRequest':_0x4e7581,'activationDefToCreateRequest':_0x1d0ec8,'yamlRuleToApi':_0x5e49f4,'validateSegmentRule':_0x59c507});for(const [_0x5baea0,_0x40f6c9]of _0x379709[_0x300612(0x12b)]){_0x224cb3[_0x300612(0xd0)](_0x5baea0,_0x40f6c9),_0x1ae0dd['embeddedSegmentNameToId']['set'](_0x5baea0,_0x40f6c9);}if(_0x379709[_0x300612(0x1b4)]===_0x300612(0xd6))_0x2a95a8[_0x300612(0x10d)]?.({'type':_0x300612(0xf8),'name':_0x542159['yamlConfig']['name'],'journeyId':_0x379709['journeyId']}),_0x2a95a8[_0x300612(0x158)]?.(_0x300612(0x122)+_0x542159[_0x300612(0xdb)][_0x300612(0x147)]+'\x27'),_0x1ae0dd[_0x300612(0xd6)]++;else _0x379709[_0x300612(0x1b4)]===_0x300612(0x169)&&(_0x2a95a8[_0x300612(0x10d)]?.({'type':'journey_updated','name':_0x542159[_0x300612(0xdb)][_0x300612(0x147)]}),_0x2a95a8[_0x300612(0x158)]?.(_0x300612(0x130)+_0x542159['yamlConfig']['name']+'\x27'),_0x1ae0dd[_0x300612(0x169)]++);return{'action':_0x379709[_0x300612(0x1b4)],'name':_0x542159['yamlConfig'][_0x300612(0x147)],'journeyId':_0x379709['journeyId']};}catch(_0x29d736){const _0x3356fd=isHttp400Error(_0x29d736),_0x4abd2a=_0x3356fd?ErrorCode[_0x300612(0x13c)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x421b74=getErrorMessage(_0x29d736);throw new SDKError(_0x4abd2a,_0x300612(0x167)+(_0x542159[_0x300612(0x160)]?_0x300612(0x1b5):_0x300612(0x14e))+_0x300612(0x10f)+_0x542159['absolutePath']+_0x300612(0xf9)+_0x421b74,_0x29d736);}}));_0x1ae0dd[_0x55e00f(0xe3)][_0x55e00f(0x12d)](..._0x4d8c8a);}return _0x1ae0dd;}async function executeSingleJourneyPush(_0x55c94b,_0x540c86,_0x10c1cb,_0x546b21,_0x9d0134,_0x2b7232){const _0x52db46=a110_0x4accd9,{journeyDefToRequest:_0x536439,activationDefToCreateRequest:_0x3ceb40,yamlRuleToApi:_0xc47257,validateSegmentRule:_0x228a99}=_0x2b7232,_0x32ff3c=new Map(),_0x2d0c5c=new Map(),_0x23cc79=new Map(),_0x79d122=new Map(),_0x39bee0=new Map();let _0x2d1bc8;const _0x3473c4=async()=>{const _0x3aa058=a110_0x574b;if(_0x2d1bc8)return;_0x2d1bc8=new Map();if(!_0x540c86['existingJourney'])return;const _0x4290e8=await _0x55c94b['journey'][_0x3aa058(0x18b)](_0x540c86[_0x3aa058(0xc9)]['id']);for(const _0x1da27f of _0x4290e8){const _0x49852a=journeyActivationStepToYaml(_0x1da27f,_0x10c1cb['idToEmailMap'],_0x10c1cb[_0x3aa058(0xe2)]),_0x1c4ec6=activationSignature(_0x49852a);!_0x2d1bc8[_0x3aa058(0x121)](_0x1c4ec6)&&_0x2d1bc8['set'](_0x1c4ec6,_0x1da27f['id']),_0x49852a[_0x3aa058(0x147)]&&_0x2d0c5c[_0x3aa058(0xd0)](_0x49852a[_0x3aa058(0x147)],_0x1da27f['id']);}};if(_0x540c86[_0x52db46(0xc9)]&&_0x540c86[_0x52db46(0xdb)]['segments']){const _0x3cce34=buildLocalExpandedRuleMappings(_0x540c86['yamlConfig']),_0x367f47=_0x3cce34[_0x52db46(0x162)];if(_0x367f47['size']>0x0){const _0xcc8257=new Map();for(const [_0x2e964f,_0x264477]of _0x367f47){const _0x2eae14=serializeExpandedRule(_0x264477,_0x367f47);_0xcc8257[_0x52db46(0xd0)](_0x2e964f,_0x2eae14);}const _0x13d3be=collectSegmentIdsFromJourneyApi(_0x540c86[_0x52db46(0xc9)]);if(_0x13d3be[_0x52db46(0x1ab)]>0x0){const _0x1c1579=await buildServerSegmentRuleMap(_0x55c94b,_0x546b21['parentId'],_0x10c1cb[_0x52db46(0x172)],_0x13d3be);if(_0x1c1579[_0x52db46(0x1ab)]>0x0){const _0x414722=new Map();for(const [_0xaa070c,_0x82d194]of _0x1c1579){const _0x3cea43=serializeExpandedRule(_0x82d194,_0x1c1579);!_0x414722[_0x52db46(0x121)](_0x3cea43)&&_0x414722[_0x52db46(0xd0)](_0x3cea43,_0xaa070c);}for(const [_0x38f035,_0x3b42f6]of _0xcc8257){const _0x4d3029=_0x414722[_0x52db46(0x19b)](_0x3b42f6);_0x4d3029&&(_0x39bee0[_0x52db46(0xd0)](_0x38f035,_0x4d3029),_0x10c1cb['segmentNameToId'][_0x52db46(0xd0)](_0x38f035,_0x4d3029));}}}}}const _0x588ab1={'resolveSegmentId':async _0x277b67=>{const _0x5b0f7e=_0x52db46,_0x1aff7b=_0x10c1cb[_0x5b0f7e(0x11e)][_0x5b0f7e(0x19b)](_0x277b67);if(!_0x1aff7b)throw new SDKError(ErrorCode[_0x5b0f7e(0x13e)],_0x5b0f7e(0x138)+_0x277b67+_0x5b0f7e(0x195)+_0x540c86[_0x5b0f7e(0xdb)][_0x5b0f7e(0x147)]+')');return _0x1aff7b;},'resolveEmbeddedSegmentId':async(_0x17e98d,_0x19dd13)=>{const _0x14a87f=_0x52db46,_0x1d9ff2=_0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0x19b)](_0x17e98d);if(_0x1d9ff2)return _0x1d9ff2;const _0x70a6d7=_0x39bee0[_0x14a87f(0x19b)](_0x17e98d);if(_0x70a6d7)return _0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0xd0)](_0x17e98d,_0x70a6d7),_0x70a6d7;const _0x4b9a74=_0x10c1cb[_0x14a87f(0x172)][_0x14a87f(0xf0)](_0x297d90=>_0x297d90[_0x14a87f(0x147)]===_0x17e98d);if(_0x4b9a74)return _0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0xd0)](_0x17e98d,_0x4b9a74['id']),_0x4b9a74['id'];if(_0x540c86[_0x14a87f(0x160)]){const {stageName:_0x25ce78,criteriaName:_0x4ae1fc}=findSegmentCriteriaLocation(_0x540c86['yamlConfig'],_0x17e98d);return _0x228a99(_0x17e98d,_0x19dd13['rule']),_0x23cc79['set'](_0x17e98d,{'definition':_0x19dd13,'stageName':_0x25ce78,'criteriaName':_0x4ae1fc}),createPendingSegmentId(_0x17e98d);}const _0x1670b1=_0x540c86[_0x14a87f(0xc9)]?.['id'];if(!_0x1670b1)throw new SDKError(ErrorCode[_0x14a87f(0x128)],_0x14a87f(0xcd));_0x228a99(_0x17e98d,_0x19dd13[_0x14a87f(0x18c)]);const _0x3a0652=generateDeterministicJourneySegmentName(_0x540c86[_0x14a87f(0xdb)][_0x14a87f(0x147)],_0x17e98d),_0x150344=_0x10c1cb[_0x14a87f(0x172)][_0x14a87f(0xf0)](_0x14703e=>_0x14703e[_0x14a87f(0x147)]===_0x3a0652),_0x176728=createSegmentIdResolver(_0x10c1cb['segmentNameToId'],_0x17e98d),_0x5d3383=await resolveRuleSegmentIds(_0x19dd13['rule'],_0x176728);let _0x700c2c;if(_0x150344)await _0x55c94b[_0x14a87f(0xe6)]['updateSegmentById'](_0x546b21[_0x14a87f(0x13f)],_0x150344['id'],{'description':_0x19dd13[_0x14a87f(0x1ae)]||_0x14a87f(0x181)+_0x17e98d,'rule':_0xc47257(_0x5d3383,!![]),'countPopulation':!![]}),_0x700c2c=_0x150344['id'];else try{_0x700c2c=await _0x55c94b[_0x14a87f(0xe6)][_0x14a87f(0x175)]({'name':_0x3a0652,'description':_0x19dd13[_0x14a87f(0x1ae)]||_0x14a87f(0x181)+_0x17e98d,'journeyId':_0x1670b1,'rule':_0xc47257(_0x5d3383,!![]),'countPopulation':!![],'parentFolderId':_0x546b21[_0x14a87f(0x16f)]||'','audienceId':_0x546b21[_0x14a87f(0x13f)]});}catch(_0x3e97ff){const _0x38df9e=_0x3e97ff instanceof Error&&_0x3e97ff[_0x14a87f(0x185)]['includes'](_0x14a87f(0x174));if(_0x38df9e){const _0x229206=await _0x55c94b[_0x14a87f(0xe6)][_0x14a87f(0x15f)](_0x546b21[_0x14a87f(0x13f)]),_0x5d9d62=_0x229206['find'](_0x33c9c6=>_0x33c9c6[_0x14a87f(0x147)]===_0x3a0652);if(_0x5d9d62)await _0x55c94b[_0x14a87f(0xe6)][_0x14a87f(0x178)](_0x546b21[_0x14a87f(0x13f)],_0x5d9d62['id'],{'description':_0x19dd13['description']||_0x14a87f(0x181)+_0x17e98d,'rule':_0xc47257(_0x5d3383,!![]),'countPopulation':!![]}),_0x700c2c=_0x5d9d62['id'];else throw _0x3e97ff;}else throw _0x3e97ff;}return _0x10c1cb[_0x14a87f(0x11e)][_0x14a87f(0xd0)](_0x17e98d,_0x700c2c),_0x32ff3c[_0x14a87f(0xd0)](_0x17e98d,_0x700c2c),_0x700c2c;},'resolveActivationId':async _0x1e6689=>{const _0x4788d8=_0x52db46,_0x468d17=_0x2d0c5c['get'](_0x1e6689);if(_0x468d17)return _0x468d17;if(_0x540c86[_0x4788d8(0xc9)]){await _0x3473c4();const _0x2c5fd0=_0x2d0c5c[_0x4788d8(0x19b)](_0x1e6689);if(_0x2c5fd0)return _0x2c5fd0;}throw new SDKError(ErrorCode[_0x4788d8(0xdd)],_0x4788d8(0x141)+_0x1e6689+_0x4788d8(0x195)+_0x540c86[_0x4788d8(0xdb)][_0x4788d8(0x147)]+_0x4788d8(0x184)+_0x4788d8(0x1a5));},'resolveEmbeddedActivationId':async(_0x107e4b,_0xfcb0a1)=>{const _0x8b366d=_0x52db46,_0x1c976a=_0x2d0c5c['get'](_0x107e4b);if(_0x1c976a)return _0x1c976a;if(_0x540c86[_0x8b366d(0x160)])return _0x79d122[_0x8b366d(0xd0)](_0x107e4b,_0xfcb0a1),createPendingActivationId(_0x107e4b);if(_0x540c86[_0x8b366d(0xc9)]){await _0x3473c4();const _0xef6fe3=_0x2d0c5c[_0x8b366d(0x19b)](_0xfcb0a1[_0x8b366d(0x147)]);if(_0xef6fe3)return _0x2d0c5c[_0x8b366d(0xd0)](_0x107e4b,_0xef6fe3),_0xef6fe3;const _0x3b72d0=activationSignature(_0xfcb0a1),_0xae512e=_0x2d1bc8?.[_0x8b366d(0x19b)](_0x3b72d0);if(_0xae512e)return _0x2d0c5c[_0x8b366d(0xd0)](_0x107e4b,_0xae512e),_0xae512e;const _0x4ff381=await _0x3ceb40(_0xfcb0a1,_0x10c1cb[_0x8b366d(0x183)]),_0x17276b=await _0x55c94b[_0x8b366d(0x186)][_0x8b366d(0xea)](_0x540c86['existingJourney']['id'],_0x4ff381);return _0x2d0c5c[_0x8b366d(0xd0)](_0x107e4b,_0x17276b['id']),_0x17276b['id'];}throw new SDKError(ErrorCode[_0x8b366d(0x128)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x20d947=>{const _0x56acd4=_0x52db46;try{return await _0x55c94b['journey'][_0x56acd4(0xf5)](_0x546b21[_0x56acd4(0x13f)],_0x20d947);}catch(_0x1aef66){throw new SDKError(ErrorCode[_0x56acd4(0xdd)],_0x56acd4(0x110)+_0x20d947+_0x56acd4(0x154)+_0x540c86[_0x56acd4(0xdb)]['name']+'\x27)',_0x1aef66);}},'resolveStageId':async(_0x82761d,_0x3ce63c)=>{const _0x3f4777=_0x52db46,_0x595e2b=await _0x55c94b['journey'][_0x3f4777(0x142)](_0x82761d),_0x5444f8=_0x595e2b[_0x3f4777(0xd7)][_0x3f4777(0x166)]['find'](_0x3e4b77=>_0x3e4b77[_0x3f4777(0x147)][_0x3f4777(0x19f)]()===_0x3ce63c[_0x3f4777(0x19f)]());if(!_0x5444f8?.['id'])throw new SDKError(ErrorCode[_0x3f4777(0xdd)],_0x3f4777(0x163)+_0x3ce63c+_0x3f4777(0xda)+(_0x595e2b['attributes']['journeyBundleName']||_0x595e2b[_0x3f4777(0xd7)]['name'])+'\x27');return _0x5444f8['id'];}},_0x20ab17=await _0x536439(_0x540c86[_0x52db46(0xdb)],_0x546b21[_0x52db46(0x13f)],_0x588ab1),_0x34f1bd=_0x546b21[_0x52db46(0xe7)]||_0x546b21[_0x52db46(0x16f)];_0x34f1bd&&(_0x20ab17[_0x52db46(0x17b)]={'parentFolder':{'data':{'id':_0x34f1bd,'type':_0x52db46(0x197)}}});if(_0x540c86[_0x52db46(0x160)]){if(_0x23cc79[_0x52db46(0x1ab)]>0x0||_0x79d122['size']>0x0)return await executeThreeStepJourneyCreate(_0x55c94b,_0x540c86,_0x20ab17,{'pendingEmbeddedSegments':_0x23cc79,'pendingEmbeddedActivations':_0x79d122,'embeddedSegmentNameToId':_0x32ff3c,'journeyActivationNameToId':_0x2d0c5c},{..._0x546b21,'effectiveFolderId':_0x34f1bd},_0x10c1cb,_0x9d0134,_0x2b7232);else{ensureJourneyDefaults(_0x20ab17['attributes']);const _0x6c394b=await _0x55c94b['journey'][_0x52db46(0x1b5)](_0x20ab17);return{'action':_0x52db46(0xd6),'journeyId':_0x6c394b['id'],'embeddedSegmentNameToId':_0x32ff3c};}}else{if(_0x540c86[_0x52db46(0x149)]&&_0x540c86[_0x52db46(0xc9)])return ensureJourneyDefaults(_0x20ab17[_0x52db46(0xd7)]),await _0x55c94b[_0x52db46(0x186)]['update'](_0x540c86[_0x52db46(0xc9)]['id'],_0x20ab17),{'action':_0x52db46(0x169),'journeyId':_0x540c86['existingJourney']['id'],'embeddedSegmentNameToId':_0x32ff3c};}return{'action':_0x52db46(0x106),'journeyId':_0x540c86[_0x52db46(0xc9)]?.['id'],'embeddedSegmentNameToId':_0x32ff3c};}function findSegmentCriteriaLocation(_0x358937,_0x2e6fc9){const _0x529028=a110_0x4accd9,_0x5bcd3b=_0x358937[_0x529028(0x145)]||_0x358937[_0x529028(0x16b)]?.[0x0]?.['stages']||[];let _0x4192eb=_0x529028(0x180),_0x51eb75=_0x2e6fc9;const _0x26dca4=_0x358937[_0x529028(0x15d)]||_0x358937[_0x529028(0x16b)]?.[0x0]?.[_0x529028(0x15d)];if(_0x26dca4?.['segment']===_0x2e6fc9)return{'stageName':_0x529028(0x15d),'criteriaName':_0x26dca4[_0x529028(0x147)]||_0x2e6fc9};_0x556721:for(const _0x393307 of _0x5bcd3b){if(_0x393307['entry_criteria']?.[_0x529028(0xe6)]===_0x2e6fc9){_0x4192eb=_0x393307[_0x529028(0x147)],_0x51eb75=_0x393307[_0x529028(0x140)][_0x529028(0x147)]||_0x2e6fc9;break;}if(_0x393307[_0x529028(0x11a)])for(const _0x1a7618 of _0x393307[_0x529028(0x11a)]){if(_0x1a7618[_0x529028(0xd1)]===_0x529028(0x143)&&_0x1a7618[_0x529028(0x196)]?.[_0x529028(0x15c)])for(const _0x2cf2ad of _0x1a7618['with'][_0x529028(0x15c)]){if(_0x2cf2ad['segment']===_0x2e6fc9){_0x4192eb=_0x393307[_0x529028(0x147)],_0x51eb75=_0x2cf2ad[_0x529028(0x147)]||_0x2e6fc9;break _0x556721;}}}}return{'stageName':_0x4192eb,'criteriaName':_0x51eb75};}async function executeThreeStepJourneyCreate(_0x1b64c8,_0x225541,_0xb8ed80,_0x311fff,_0x3a087b,_0x286752,_0x5d1f27,_0x145ff8){const _0x314a2b=a110_0x4accd9,{activationDefToCreateRequest:_0x3dff13,yamlRuleToApi:_0x371406}=_0x145ff8,{pendingEmbeddedSegments:_0x174173,pendingEmbeddedActivations:_0x56311f,embeddedSegmentNameToId:_0x3e3484}=_0x311fff,_0x416d8f=JSON[_0x314a2b(0x132)](JSON[_0x314a2b(0x14a)](_0xb8ed80));ensureJourneyDefaults(_0x416d8f['attributes']),stripPendingIds(_0x416d8f);const _0x43189a=await _0x1b64c8[_0x314a2b(0x186)]['create'](_0x416d8f),_0xbe10b6=_0x43189a['id'],_0x960b34=new Map();for(const _0x3a28c6 of _0x43189a[_0x314a2b(0xd7)][_0x314a2b(0x166)]){_0x960b34[_0x314a2b(0xd0)](_0x3a28c6[_0x314a2b(0x147)][_0x314a2b(0x19f)](),_0x3a28c6['id']);}for(const [_0x49cbd4,{definition:_0x54953d}]of _0x174173){const _0x3b390f=generateDeterministicJourneySegmentName(_0x225541[_0x314a2b(0xdb)][_0x314a2b(0x147)],_0x49cbd4);_0x5d1f27[_0x314a2b(0x10d)]?.({'type':_0x314a2b(0x150),'journeyName':_0x225541[_0x314a2b(0xdb)][_0x314a2b(0x147)],'segmentName':_0x49cbd4});const _0x502bba=createSegmentIdResolver(_0x286752[_0x314a2b(0x11e)],_0x49cbd4),_0x3db84d=await resolveRuleSegmentIds(_0x54953d[_0x314a2b(0x18c)],_0x502bba),_0x531b5a=await _0x1b64c8[_0x314a2b(0xe6)][_0x314a2b(0x175)]({'name':_0x3b390f,'description':_0x54953d[_0x314a2b(0x1ae)]||_0x314a2b(0x181)+_0x49cbd4,'journeyId':_0xbe10b6,'rule':_0x371406(_0x3db84d,!![]),'countPopulation':!![],'parentFolderId':_0x3a087b[_0x314a2b(0x157)]||'','audienceId':_0x3a087b[_0x314a2b(0x13f)]});_0x3e3484['set'](_0x49cbd4,_0x531b5a),_0x286752[_0x314a2b(0x11e)]['set'](_0x49cbd4,_0x531b5a),_0x5d1f27[_0x314a2b(0x10d)]?.({'type':_0x314a2b(0xf6),'journeyName':_0x225541['yamlConfig']['name'],'segmentName':_0x49cbd4});}const _0x2f9f8c=new Map();for(const [_0x28d2ed,_0x24e434]of _0x56311f){_0x5d1f27[_0x314a2b(0x10d)]?.({'type':'embedded_activation_creating','journeyName':_0x225541['yamlConfig'][_0x314a2b(0x147)],'activationName':_0x28d2ed});const _0x510422=await _0x3dff13(_0x24e434,_0x286752['activationContext']),_0x11f43d=await _0x1b64c8['journey'][_0x314a2b(0xea)](_0xbe10b6,_0x510422);_0x2f9f8c[_0x314a2b(0xd0)](_0x28d2ed,_0x11f43d['id']),_0x311fff['journeyActivationNameToId'][_0x314a2b(0xd0)](_0x28d2ed,_0x11f43d['id']),_0x5d1f27[_0x314a2b(0x10d)]?.({'type':_0x314a2b(0xca),'journeyName':_0x225541[_0x314a2b(0xdb)][_0x314a2b(0x147)],'activationName':_0x28d2ed});}const _0xa3ba31=JSON[_0x314a2b(0x132)](JSON[_0x314a2b(0x14a)](_0xb8ed80));return _0xa3ba31['id']=_0xbe10b6,ensureJourneyDefaults(_0xa3ba31['attributes']),resolvePendingIdsInRequest(_0xa3ba31,_0xb8ed80,_0x960b34,_0x3e3484,_0x2f9f8c,_0x5d1f27),await _0x1b64c8[_0x314a2b(0x186)]['update'](_0xbe10b6,_0xa3ba31),{'action':'created','journeyId':_0xbe10b6,'embeddedSegmentNameToId':_0x3e3484};}function stripPendingIds(_0x463fdc){const _0x2cb6ba=a110_0x4accd9;for(const _0x246aa5 of _0x463fdc['attributes']['journeyStages']||[]){_0x246aa5[_0x2cb6ba(0x17f)]?.[_0x2cb6ba(0x107)]&&isPendingSegmentId(_0x246aa5[_0x2cb6ba(0x17f)][_0x2cb6ba(0x107)])&&delete _0x246aa5[_0x2cb6ba(0x17f)];if(_0x246aa5[_0x2cb6ba(0x11a)])for(const _0x1759aa of Object[_0x2cb6ba(0x117)](_0x246aa5[_0x2cb6ba(0x11a)])){const _0x203e31=_0x246aa5[_0x2cb6ba(0x11a)][_0x1759aa];_0x203e31[_0x2cb6ba(0xd1)]===_0x2cb6ba(0x127)&&_0x203e31[_0x2cb6ba(0xdc)]&&isPendingActivationId(_0x203e31['journeyActivationStepId'])&&(_0x203e31[_0x2cb6ba(0xdc)]='');if(_0x203e31[_0x2cb6ba(0xd1)]===_0x2cb6ba(0x1b1)&&_0x203e31[_0x2cb6ba(0x15c)])for(const _0xda92e2 of _0x203e31[_0x2cb6ba(0x15c)]){_0xda92e2['segmentId']&&isPendingSegmentId(_0xda92e2['segmentId'])&&(_0xda92e2[_0x2cb6ba(0x107)]='');}_0x203e31[_0x2cb6ba(0xd1)]===_0x2cb6ba(0x116)&&_0x203e31[_0x2cb6ba(0x126)]?.['segmentId']&&isPendingSegmentId(_0x203e31[_0x2cb6ba(0x126)][_0x2cb6ba(0x107)])&&(_0x203e31[_0x2cb6ba(0x126)][_0x2cb6ba(0x107)]='');}}}function resolvePendingIdsInRequest(_0x35b29d,_0x416b2b,_0x3c5a37,_0x597954,_0x5954b5,_0x252359){const _0x7c1fe4=a110_0x4accd9,_0x3a74d9=(_0x1ae8c3,_0x21f3c7)=>{const _0xcb5e3f=a110_0x574b;if(!isPendingSegmentId(_0x1ae8c3))return _0x1ae8c3;const _0x3fb860=extractPendingSegmentName(_0x1ae8c3),_0x3831d9=_0x597954[_0xcb5e3f(0x19b)](_0x3fb860);return!_0x3831d9&&_0x252359[_0xcb5e3f(0xe9)]?.(_0xcb5e3f(0x155)+_0x3fb860+'\x27\x20for\x20'+_0x21f3c7),_0x3831d9;};if(_0x35b29d[_0x7c1fe4(0xd7)][_0x7c1fe4(0x15d)]?.['segmentId']&&isPendingSegmentId(_0x35b29d[_0x7c1fe4(0xd7)][_0x7c1fe4(0x15d)][_0x7c1fe4(0x107)])){const _0x1ac55e=_0x3a74d9(_0x35b29d['attributes']['goal'][_0x7c1fe4(0x107)],_0x7c1fe4(0x165));_0x1ac55e&&(_0x35b29d[_0x7c1fe4(0xd7)]['goal'][_0x7c1fe4(0x107)]=_0x1ac55e);}for(const _0x246ed5 of _0x35b29d[_0x7c1fe4(0xd7)][_0x7c1fe4(0x166)]||[]){const _0x3c38c6=_0x3c5a37['get'](_0x246ed5[_0x7c1fe4(0x147)][_0x7c1fe4(0x19f)]());_0x3c38c6&&(_0x246ed5['id']=_0x3c38c6);if(_0x246ed5[_0x7c1fe4(0x17f)]?.['segmentId']&&isPendingSegmentId(_0x246ed5[_0x7c1fe4(0x17f)][_0x7c1fe4(0x107)])){const _0x986b4=_0x3a74d9(_0x246ed5['entryCriteria'][_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5['name']+'\x27\x20entry\x20criteria');_0x986b4&&(_0x246ed5[_0x7c1fe4(0x17f)][_0x7c1fe4(0x107)]=_0x986b4);}if(_0x246ed5[_0x7c1fe4(0x182)])for(const _0x4a5e92 of _0x246ed5['exitCriterias']){if(_0x4a5e92['segmentId']&&isPendingSegmentId(_0x4a5e92[_0x7c1fe4(0x107)])){const _0x2a4e6e=_0x3a74d9(_0x4a5e92[_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0x1a2));_0x2a4e6e&&(_0x4a5e92[_0x7c1fe4(0x107)]=_0x2a4e6e);}}if(_0x246ed5['milestone']?.[_0x7c1fe4(0x107)]&&isPendingSegmentId(_0x246ed5[_0x7c1fe4(0x177)][_0x7c1fe4(0x107)])){const _0x660cfe=_0x3a74d9(_0x246ed5[_0x7c1fe4(0x177)][_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0x17c));_0x660cfe&&(_0x246ed5[_0x7c1fe4(0x177)]['segmentId']=_0x660cfe);}if(_0x246ed5['steps']){const _0xcabf0e=_0x1353a7=>_0x416b2b[_0x7c1fe4(0xd7)][_0x7c1fe4(0x166)]['find'](_0x598146=>_0x598146[_0x7c1fe4(0x147)]['toLowerCase']()===_0x246ed5[_0x7c1fe4(0x147)]['toLowerCase']())?.[_0x7c1fe4(0x11a)]?.[_0x1353a7];for(const _0x1c84c4 of Object[_0x7c1fe4(0x117)](_0x246ed5[_0x7c1fe4(0x11a)])){const _0x3df2c4=_0x246ed5['steps'][_0x1c84c4],_0x12edf7=_0xcabf0e(_0x1c84c4);if(_0x3df2c4['type']==='Activation'&&_0x3df2c4[_0x7c1fe4(0xdc)]&&(isPendingActivationId(_0x3df2c4['journeyActivationStepId'])||_0x3df2c4[_0x7c1fe4(0xdc)]==='')){if(_0x12edf7?.[_0x7c1fe4(0xdc)]&&isPendingActivationId(_0x12edf7['journeyActivationStepId'])){const _0x4c63f4=extractPendingActivationName(_0x12edf7[_0x7c1fe4(0xdc)]),_0x4d594c=_0x5954b5[_0x7c1fe4(0x19b)](_0x4c63f4);_0x4d594c&&(_0x3df2c4['journeyActivationStepId']=_0x4d594c);}}if(_0x3df2c4[_0x7c1fe4(0xd1)]===_0x7c1fe4(0x1b1)&&_0x3df2c4[_0x7c1fe4(0x15c)]&&_0x12edf7?.['branches'])for(let _0x27a0b9=0x0;_0x27a0b9<_0x3df2c4['branches']['length'];_0x27a0b9++){const _0x12ba1f=_0x3df2c4[_0x7c1fe4(0x15c)][_0x27a0b9],_0x1491ea=_0x12edf7[_0x7c1fe4(0x15c)][_0x27a0b9];if(_0x1491ea?.[_0x7c1fe4(0x107)]&&isPendingSegmentId(_0x1491ea['segmentId'])){const _0x2dac10=_0x3a74d9(_0x1491ea['segmentId'],'stage\x20\x27'+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0xe8)+(_0x12ba1f['name']||_0x27a0b9)+'\x27');_0x2dac10&&(_0x12ba1f[_0x7c1fe4(0x107)]=_0x2dac10);}}if(_0x3df2c4[_0x7c1fe4(0xd1)]===_0x7c1fe4(0x116)&&_0x3df2c4[_0x7c1fe4(0x126)]?.['segmentId']&&_0x12edf7?.[_0x7c1fe4(0x126)]?.[_0x7c1fe4(0x107)]&&isPendingSegmentId(_0x12edf7['waitCondition'][_0x7c1fe4(0x107)])){const _0x58063b=_0x3a74d9(_0x12edf7[_0x7c1fe4(0x126)][_0x7c1fe4(0x107)],_0x7c1fe4(0x102)+_0x246ed5[_0x7c1fe4(0x147)]+_0x7c1fe4(0x194));_0x58063b&&(_0x3df2c4[_0x7c1fe4(0x126)][_0x7c1fe4(0x107)]=_0x58063b);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a111_0x4690(_0x3ec79c,_0x2c7101){_0x3ec79c=_0x3ec79c-0x173;const _0x120aff=a111_0x120a();let _0x4690b6=_0x120aff[_0x3ec79c];return _0x4690b6;}(function(_0x114186,_0x3a9479){const _0x16b480=a111_0x4690,_0x5b9c2b=_0x114186();while(!![]){try{const _0x172dbb=parseInt(_0x16b480(0x174))/0x1+-parseInt(_0x16b480(0x17d))/0x2+parseInt(_0x16b480(0x17b))/0x3*(parseInt(_0x16b480(0x181))/0x4)+-parseInt(_0x16b480(0x180))/0x5*(parseInt(_0x16b480(0x177))/0x6)+-parseInt(_0x16b480(0x17f))/0x7+-parseInt(_0x16b480(0x176))/0x8+-parseInt(_0x16b480(0x173))/0x9*(-parseInt(_0x16b480(0x17c))/0xa);if(_0x172dbb===_0x3a9479)break;else _0x5b9c2b['push'](_0x5b9c2b['shift']());}catch(_0x214f95){_0x5b9c2b['push'](_0x5b9c2b['shift']());}}}(a111_0x120a,0xb0f5f));export function buildFolderIdToPathMap(_0x5393f3){const _0x1fd253=a111_0x4690,_0xecfe0a=new Map(),_0x498867=new Map();for(const _0x13d821 of _0x5393f3){_0x498867[_0x1fd253(0x175)](_0x13d821['id'],_0x13d821);}const _0x5d584b=new Set();for(const _0x417921 of _0x5393f3){!_0x417921['parentFolderId']&&_0x5d584b[_0x1fd253(0x17a)](_0x417921['id']);}function _0x5185e6(_0x45f634){const _0x1015eb=_0x1fd253;if(_0xecfe0a['has'](_0x45f634['id']))return _0xecfe0a[_0x1015eb(0x17e)](_0x45f634['id']);if(_0x5d584b['has'](_0x45f634['id']))return _0xecfe0a[_0x1015eb(0x175)](_0x45f634['id'],''),'';if(_0x45f634[_0x1015eb(0x182)]){const _0x101f92=_0x498867[_0x1015eb(0x17e)](_0x45f634['parentFolderId']);if(_0x101f92){const _0xcf28d9=_0x5185e6(_0x101f92),_0x5c43af=_0xcf28d9?_0xcf28d9+'/'+_0x45f634['name']:_0x45f634['name'];return _0xecfe0a[_0x1015eb(0x175)](_0x45f634['id'],_0x5c43af),_0x5c43af;}}const _0x1487bd=_0x45f634['name'];return _0xecfe0a['set'](_0x45f634['id'],_0x1487bd),_0x1487bd;}for(const _0x2f3d1f of _0x5393f3){_0x5185e6(_0x2f3d1f);}return _0xecfe0a;}function a111_0x120a(){const _0x4b0159=['set','3172952cCCZaS','588828uFlMQQ','name','has','add','3405891kjLoUc','1864810mEjlgF','127344ZpksEp','get','3155789zogUks','55jZTkuA','4JrteJh','parentFolderId','45wXmjiq','647765ocOvSh'];a111_0x120a=function(){return _0x4b0159;};return a111_0x120a();}export function buildFolderPathToIdMap(_0x581bd9){const _0x476ea2=a111_0x4690,_0x557328=new Map(),_0x191b94=new Map();for(const _0x16a228 of _0x581bd9){_0x191b94['set'](_0x16a228['id'],_0x16a228);}const _0x25352d=new Set();for(const _0x124a55 of _0x581bd9){!_0x124a55[_0x476ea2(0x182)]&&_0x25352d['add'](_0x124a55['id']);}function _0x209598(_0x255bb9){const _0x388638=_0x476ea2;if(_0x25352d[_0x388638(0x179)](_0x255bb9['id']))return'';if(_0x255bb9['parentFolderId']){const _0x2deae1=_0x191b94['get'](_0x255bb9[_0x388638(0x182)]);if(_0x2deae1){const _0x1e4528=_0x209598(_0x2deae1);return _0x1e4528?_0x1e4528+'/'+_0x255bb9[_0x388638(0x178)]:_0x255bb9[_0x388638(0x178)];}}return _0x255bb9[_0x388638(0x178)];}for(const _0x11b659 of _0x581bd9){const _0x494307=_0x209598(_0x11b659);_0x557328[_0x476ea2(0x175)](_0x494307,_0x11b659['id']);}return _0x557328;}export function buildFolderMaps(_0x185d40){const _0x1b47ad=buildFolderIdToPathMap(_0x185d40),_0x1dc15c=new Map();for(const [_0x72559e,_0x26ed1d]of _0x1b47ad){_0x1dc15c['set'](_0x26ed1d,_0x72559e);}return{'idToPath':_0x1b47ad,'pathToId':_0x1dc15c};}export function getFolderPath(_0x221f15,_0x49bb49){if(!_0x221f15)return'';return _0x49bb49['get'](_0x221f15)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24baf6,_0x1bc1ee){const _0x16d13f=a112_0x3d83,_0x520df9=_0x24baf6();while(!![]){try{const _0xbf4751=-parseInt(_0x16d13f(0x127))/0x1*(parseInt(_0x16d13f(0x12c))/0x2)+parseInt(_0x16d13f(0x116))/0x3+-parseInt(_0x16d13f(0x137))/0x4*(-parseInt(_0x16d13f(0x134))/0x5)+parseInt(_0x16d13f(0x135))/0x6+-parseInt(_0x16d13f(0x121))/0x7*(-parseInt(_0x16d13f(0x144))/0x8)+-parseInt(_0x16d13f(0x13a))/0x9*(-parseInt(_0x16d13f(0x131))/0xa)+-parseInt(_0x16d13f(0x143))/0xb;if(_0xbf4751===_0x1bc1ee)break;else _0x520df9['push'](_0x520df9['shift']());}catch(_0x59e87b){_0x520df9['push'](_0x520df9['shift']());}}}(a112_0x5454,0x7b677));import a112_0x40376d from'path';import{parse as a112_0x41949f}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a112_0x3d83(_0x166a45,_0x1d906d){_0x166a45=_0x166a45-0x116;const _0x545485=a112_0x5454();let _0x3d831d=_0x545485[_0x166a45];return _0x3d831d;}function a112_0x5454(){const _0x13973b=['.yml','endsWith','9GjfZIw','filter','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','trim','pop','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','push','Path\x20attempts\x20to\x20navigate\x20above\x20root','split','14900193lvXnWw','6945720ktUjOR','readFile','1474680nXeCFK','File\x20not\x20found:\x20','name','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Cannot\x20navigate\x20above\x20root','length','startsWith','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','substring','journey','7GvceNo','slice','Path\x20cannot\x20be\x20empty','exists','raw','join','5KCGUkk','type','root','resolve','Path\x20segment\x20cannot\x20be\x20empty','276922hFAUSq','segment','parse','isAbsolute','segments','3659380fVeIzb','No\x20tdx.json\x20found\x20for\x20file:\x20','dirname','45295NqeEUN','2078946TvqtJM','Relative\x20path\x20cannot\x20be\x20empty','212iUNExe'];a112_0x5454=function(){return _0x13973b;};return a112_0x5454();}export function parsePath(_0x58c984){const _0x178dd2=a112_0x3d83;if(!_0x58c984||_0x58c984[_0x178dd2(0x13d)]()==='')throw new Error(_0x178dd2(0x123));const _0x5e8c65=_0x58c984[_0x178dd2(0x13d)]();if(_0x5e8c65==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x58c984};const _0x4741e7=_0x5e8c65[_0x178dd2(0x11c)]('/')?_0x5e8c65[_0x178dd2(0x11f)](0x1):_0x5e8c65,_0x72e80d=_0x4741e7[_0x178dd2(0x142)]('/')[_0x178dd2(0x13b)](_0x3c90dc=>_0x3c90dc!=='');if(_0x72e80d['length']===0x0)throw new Error(_0x178dd2(0x11d));const _0x10b7ca=_0x5e8c65['startsWith']('/')||!isRelativePathSegment(_0x72e80d[0x0]);for(const _0x24ef11 of _0x72e80d){validatePathSegment(_0x24ef11);}return{'segments':_0x72e80d,'isAbsolute':_0x10b7ca,'raw':_0x58c984};}function isRelativePathSegment(_0x20a66f){return _0x20a66f==='.'||_0x20a66f==='..';}function validatePathSegment(_0x43d4d5){const _0x3a7391=a112_0x3d83;if(_0x43d4d5==='')throw new Error(_0x3a7391(0x12b));if(_0x43d4d5==='.'||_0x43d4d5==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x43d4d5))throw new Error(_0x3a7391(0x13f)+_0x43d4d5);if(_0x43d4d5!==_0x43d4d5[_0x3a7391(0x13d)]()){}}export function validatePath(_0x5cc694){const _0x503723=a112_0x3d83;if(_0x5cc694[_0x503723(0x130)][_0x503723(0x11b)]===0x0&&!_0x5cc694[_0x503723(0x12f)])throw new Error(_0x503723(0x136));if(_0x5cc694[_0x503723(0x12f)]){if(_0x5cc694[_0x503723(0x130)][0x0]==='..')throw new Error(_0x503723(0x119));let _0x3524ad=0x0;for(const _0x241ea8 of _0x5cc694['segments']){if(_0x241ea8==='..'){if(_0x3524ad===0x0)throw new Error(_0x503723(0x141));_0x3524ad--;}else _0x241ea8!=='.'&&_0x3524ad++;}}}export function joinPaths(_0x554923,_0x192717){const _0x357d2e=a112_0x3d83;if(!_0x554923||_0x554923==='/')return _0x192717;if(!_0x192717||_0x192717==='.')return _0x554923;if(_0x192717[_0x357d2e(0x11c)]('/'))return _0x192717;const _0x147f05=parsePath(_0x554923),_0x3c0a5a=parsePath(_0x192717),_0x5dafb4=[..._0x147f05['segments']];for(const _0x6bdc14 of _0x3c0a5a['segments']){if(_0x6bdc14==='.')continue;else{if(_0x6bdc14==='..'){if(_0x5dafb4['length']===0x0)throw new Error(_0x357d2e(0x11a));_0x5dafb4[_0x357d2e(0x13e)]();}else _0x5dafb4[_0x357d2e(0x140)](_0x6bdc14);}}const _0x3fdf3e=_0x5dafb4[_0x357d2e(0x126)]('/');return _0x147f05[_0x357d2e(0x125)]['startsWith']('/')?'/'+_0x3fdf3e:_0x3fdf3e;}export function normalizePath(_0x974c8d){const _0x3d18d8=a112_0x3d83,_0x49e496=parsePath(_0x974c8d),_0x1ede25=[];for(const _0x45a22b of _0x49e496[_0x3d18d8(0x130)]){if(_0x45a22b==='.')continue;else{if(_0x45a22b==='..'){if(_0x1ede25['length']===0x0){if(_0x49e496['isAbsolute'])throw new Error(_0x3d18d8(0x11a));_0x1ede25[_0x3d18d8(0x140)]('..');}else _0x1ede25[_0x1ede25['length']-0x1]==='..'?_0x1ede25[_0x3d18d8(0x140)]('..'):_0x1ede25[_0x3d18d8(0x13e)]();}else _0x1ede25[_0x3d18d8(0x140)](_0x45a22b);}}if(_0x1ede25[_0x3d18d8(0x11b)]===0x0)return _0x49e496[_0x3d18d8(0x12f)]?'/':'.';const _0x180e26=_0x1ede25['join']('/');return _0x49e496[_0x3d18d8(0x125)][_0x3d18d8(0x11c)]('/')?'/'+_0x180e26:_0x180e26;}export function getParentPath(_0xc2a32a){const _0x66b73a=a112_0x3d83,_0x3993d0=parsePath(_0xc2a32a);if(_0x3993d0[_0x66b73a(0x130)]['length']<=0x1)return'/';const _0x39b5e6=_0x3993d0[_0x66b73a(0x130)][_0x66b73a(0x122)](0x0,-0x1)[_0x66b73a(0x126)]('/');return _0x3993d0[_0x66b73a(0x125)][_0x66b73a(0x11c)]('/')?'/'+_0x39b5e6:_0x39b5e6;}export function getBaseName(_0x4e4724){const _0x5b2238=parsePath(_0x4e4724);return _0x5b2238['segments'][_0x5b2238['segments']['length']-0x1]||'';}export function isChildPath(_0x192b8d,_0x154f4d){const _0x24b9d7=a112_0x3d83,_0x120f52=parsePath(_0x192b8d),_0xf4033f=parsePath(_0x154f4d);if(_0x120f52['segments'][_0x24b9d7(0x11b)]<=_0xf4033f['segments'][_0x24b9d7(0x11b)])return![];for(let _0x12d873=0x0;_0x12d873<_0xf4033f['segments']['length'];_0x12d873++){if(_0x120f52[_0x24b9d7(0x130)][_0x12d873]!==_0xf4033f[_0x24b9d7(0x130)][_0x12d873])return![];}return!![];}export function splitPath(_0x1a3e5c){const _0x74e03e=a112_0x3d83,_0x50c572=parsePath(_0x1a3e5c);if(_0x50c572['segments']['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x50c572['segments'][_0x74e03e(0x11b)]===0x1)return{'parent':_0x50c572[_0x74e03e(0x130)][0x0]};return{'parent':_0x50c572[_0x74e03e(0x130)][0x0],'child':_0x50c572[_0x74e03e(0x130)][_0x74e03e(0x122)](0x1)[_0x74e03e(0x126)]('/')};}export function isYamlFilePath(_0x51b290){const _0x8a8da3=a112_0x3d83;return _0x51b290[_0x8a8da3(0x139)](_0x8a8da3(0x138))||_0x51b290['endsWith']('.yaml');}export async function resolveYamlFilePath(_0xfb44ea,_0x4eeb7b=nodeFileSystem){const _0x840382=a112_0x3d83,_0x1a17de=a112_0x40376d[_0x840382(0x12a)](_0xfb44ea);if(!await _0x4eeb7b[_0x840382(0x124)](_0x1a17de))throw new Error(_0x840382(0x117)+_0xfb44ea);let _0x2c294b=a112_0x40376d[_0x840382(0x133)](_0x1a17de),_0x160eac=null,_0x34d4fd=null;const _0x3d1925=a112_0x40376d[_0x840382(0x12e)](_0x2c294b)[_0x840382(0x129)];while(_0x2c294b!==_0x3d1925){const _0x138564=a112_0x40376d['join'](_0x2c294b,'tdx.json');if(await _0x4eeb7b[_0x840382(0x124)](_0x138564)){_0x160eac=_0x138564,_0x34d4fd=_0x2c294b;break;}_0x2c294b=a112_0x40376d[_0x840382(0x133)](_0x2c294b);}if(!_0x160eac||!_0x34d4fd)throw new Error(_0x840382(0x132)+_0xfb44ea);const _0x5bb6ac=await _0x4eeb7b[_0x840382(0x145)](_0x160eac),_0x591413=JSON[_0x840382(0x12e)](_0x5bb6ac),_0x544e71=_0x591413['parent_segment'];if(!_0x544e71)throw new Error(_0x840382(0x13c));const _0x10979a=await _0x4eeb7b[_0x840382(0x145)](_0x1a17de),_0x81f7ef=a112_0x41949f(_0x10979a),_0x2f9060=_0x81f7ef[_0x840382(0x118)];if(!_0x2f9060)throw new Error(_0x840382(0x11e)+_0xfb44ea);const _0x301f50=_0x81f7ef[_0x840382(0x128)]==='journey'?_0x840382(0x120):_0x840382(0x12d),_0x3408ed=a112_0x40376d['relative'](_0x34d4fd,_0x1a17de),_0xe97828=a112_0x40376d[_0x840382(0x133)](_0x3408ed),_0x4b7873=_0xe97828==='.'?'':_0xe97828['replace'](/\\/g,'/'),_0xa41f8f=_0x4b7873?_0x544e71+'/'+_0x4b7873+'/'+_0x2f9060:_0x544e71+'/'+_0x2f9060;return{'parentSegment':_0x544e71,'segmentName':_0x2f9060,'folderPath':_0x4b7873,'fullPath':_0xa41f8f,'resourceType':_0x301f50};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x24c345,_0x522a2f){const _0x549aff=a113_0x407f,_0x15b1f2=_0x24c345();while(!![]){try{const _0x395082=parseInt(_0x549aff(0x19c))/0x1+parseInt(_0x549aff(0x19b))/0x2+-parseInt(_0x549aff(0x1a0))/0x3+-parseInt(_0x549aff(0x199))/0x4+-parseInt(_0x549aff(0x19d))/0x5+parseInt(_0x549aff(0x19f))/0x6*(parseInt(_0x549aff(0x1a4))/0x7)+parseInt(_0x549aff(0x198))/0x8*(parseInt(_0x549aff(0x1a1))/0x9);if(_0x395082===_0x522a2f)break;else _0x15b1f2['push'](_0x15b1f2['shift']());}catch(_0x46a23e){_0x15b1f2['push'](_0x15b1f2['shift']());}}}(a113_0x5dab,0xc1b84));export function parseSegmentRef(_0x47c7b5){const _0x16e91b=a113_0x407f,_0x971e3b=_0x47c7b5['indexOf']('/');if(_0x971e3b===-0x1)return{'parentId':_0x47c7b5};if(_0x971e3b===0x0)throw new Error(_0x16e91b(0x19a)+_0x47c7b5+_0x16e91b(0x19e));const _0x504391=_0x47c7b5['substring'](0x0,_0x971e3b),_0x5dede2=_0x47c7b5[_0x16e91b(0x1a3)](_0x971e3b+0x1);if(_0x5dede2==='')throw new Error(_0x16e91b(0x19a)+_0x47c7b5+_0x16e91b(0x1a2));return{'parentId':_0x504391,'childId':_0x5dede2};}function a113_0x407f(_0x585d61,_0x12d0d2){_0x585d61=_0x585d61-0x198;const _0x5dabea=a113_0x5dab();let _0x407f20=_0x5dabea[_0x585d61];return _0x407f20;}function a113_0x5dab(){const _0x1200d4=['6075590mnvZRm','.\x20Parent\x20name\x20cannot\x20be\x20empty','12HJdDgQ','324129RISgyB','5788899KqxAqr','.\x20Child\x20name\x20cannot\x20be\x20empty','substring','3772069oMAkkI','8pJfjWN','78948LWVcDi','Invalid\x20segment\x20reference\x20format:\x20','483540DVAUeD','173659jvtNcP'];a113_0x5dab=function(){return _0x1200d4;};return a113_0x5dab();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15df23,_0x44508c){const _0x205c99=a114_0x4da5,_0x4000f0=_0x15df23();while(!![]){try{const _0x3923bb=parseInt(_0x205c99(0x169))/0x1+parseInt(_0x205c99(0x161))/0x2+-parseInt(_0x205c99(0x15a))/0x3+parseInt(_0x205c99(0x145))/0x4+parseInt(_0x205c99(0x15b))/0x5+parseInt(_0x205c99(0x15e))/0x6+-parseInt(_0x205c99(0x164))/0x7;if(_0x3923bb===_0x44508c)break;else _0x4000f0['push'](_0x4000f0['shift']());}catch(_0x2b4728){_0x4000f0['push'](_0x4000f0['shift']());}}}(a114_0x3f0a,0x50bdc));import a114_0x517e09 from'path';function a114_0x4da5(_0x2ca15f,_0x2f8e23){_0x2ca15f=_0x2ca15f-0x145;const _0x3f0ac2=a114_0x3f0a();let _0x4da598=_0x3f0ac2[_0x2ca15f];return _0x4da598;}import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a114_0x3f0a(){const _0x338baf=['segmentName','10221981iRtRZP','journey','isFile','File\x20not\x20found:\x20','includes','284600IrpjpB','root','basename','readFile','no_config','Parent\x20segment\x20not\x20specified','No\x20tdx.json\x20found\x20for\x20file:\x20','parentSegment','extname','match','directory','stat','trim','isScoped','context','no_parent','2454292AnVuAk','invalid_yaml','Not\x20a\x20YAML\x20file:\x20','file_not_found','parent_segment','isDirectory','error','scopedFolderPath','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','parse','folderPath','replace','dirname','resolve','cwd','startsWith','join','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','exists','file','type','551037zKlNgD','2922995rxjOet','relative','configDir','956070SWZbhW','string','No\x20tdx.json\x20found','665122ediACk','resourceType'];a114_0x3f0a=function(){return _0x338baf;};return a114_0x3f0a();}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0xdafc16){const _0x56ac6b=a114_0x4da5;return _0xdafc16[_0x56ac6b(0x159)]!==_0x56ac6b(0x14b);}export function isScopedResolution(_0x2d8bd7){const _0x35e554=a114_0x4da5;return _0x2d8bd7[_0x35e554(0x159)]===_0x35e554(0x173)||_0x2d8bd7[_0x35e554(0x159)]===_0x35e554(0x158)||_0x2d8bd7[_0x35e554(0x159)]===_0x35e554(0x177);}export function getScopedDetails(_0x3b4c66){const _0x5cf339=a114_0x4da5;if(isScopedResolution(_0x3b4c66))return{'isScoped':_0x3b4c66[_0x5cf339(0x176)],'scopedFolderPath':_0x3b4c66[_0x5cf339(0x14c)]};return undefined;}async function findTdxConfigAsync(_0x23fdde,_0x220851){const _0x396b2e=a114_0x4da5;let _0x496685=a114_0x517e09[_0x396b2e(0x152)](_0x23fdde);const _0x5cf453=a114_0x517e09[_0x396b2e(0x14e)](_0x496685)[_0x396b2e(0x16a)];while(_0x496685!==_0x5cf453){const _0x532996=a114_0x517e09[_0x396b2e(0x155)](_0x496685,'tdx.json');if(await _0x220851[_0x396b2e(0x157)](_0x532996))try{const _0x403ffc=await _0x220851[_0x396b2e(0x16c)](_0x532996),_0x168bf=JSON[_0x396b2e(0x14e)](_0x403ffc);if(_0x168bf[_0x396b2e(0x149)]&&typeof _0x168bf['parent_segment']===_0x396b2e(0x15f))return{'configPath':_0x532996,'configDir':_0x496685,'parentSegment':_0x168bf[_0x396b2e(0x149)]};}catch{}_0x496685=a114_0x517e09[_0x396b2e(0x151)](_0x496685);}return null;}function calculateScopedPath(_0x1976c6,_0x2094e9){const _0x470f2c=a114_0x4da5,_0x2a2695=a114_0x517e09[_0x470f2c(0x15c)](_0x2094e9,_0x1976c6),_0x307b57=_0x2a2695!==''&&_0x2a2695!=='.'&&!_0x2a2695[_0x470f2c(0x154)]('..');return{'isScoped':_0x307b57,'scopedFolderPath':_0x307b57?_0x2a2695[_0x470f2c(0x150)](/\\/g,'/'):''};}export async function resolveTarget(_0xbae44f){const _0x430926=a114_0x4da5,{arg:_0x347166,contextParent:_0x1d0fa6,cwd:cwd=process[_0x430926(0x153)](),fs:fs=nodeFileSystem}=_0xbae44f;if(_0x347166&&isYamlFilePath(_0x347166))try{const _0x2af35c=await resolveYamlFilePath(_0x347166,fs),_0x55f1c4=a114_0x517e09['resolve'](_0x347166),_0x135548=a114_0x517e09[_0x430926(0x151)](_0x55f1c4),_0x34f3c6=await findTdxConfigAsync(_0x135548,fs);if(!_0x34f3c6){if(_0x1d0fa6){const _0x187279=a114_0x517e09[_0x430926(0x151)](_0x55f1c4);return{'type':_0x430926(0x158),'parentName':_0x1d0fa6,'targetDir':_0x187279,'configRoot':_0x187279,'filePath':_0x55f1c4,'resourceName':_0x2af35c[_0x430926(0x163)],'folderPath':_0x2af35c[_0x430926(0x14f)],'resourceType':_0x2af35c[_0x430926(0x162)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x16d),'message':_0x430926(0x16f)+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x14d)};}const _0x4b23e8=calculateScopedPath(_0x135548,_0x34f3c6[_0x430926(0x15d)]);return{'type':_0x430926(0x158),'parentName':_0x34f3c6[_0x430926(0x170)],'targetDir':_0x34f3c6[_0x430926(0x15d)],'configRoot':_0x34f3c6['configDir'],'filePath':_0x55f1c4,'resourceName':_0x2af35c[_0x430926(0x163)],'folderPath':_0x2af35c[_0x430926(0x14f)],'resourceType':_0x2af35c[_0x430926(0x162)],'isScoped':_0x4b23e8['isScoped'],'scopedFolderPath':_0x4b23e8[_0x430926(0x14c)]};}catch(_0x40be95){const _0x5ce8e8=_0x40be95 instanceof Error?_0x40be95['message']:String(_0x40be95);if(_0x5ce8e8[_0x430926(0x168)]('File\x20not\x20found'))return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x148),'message':_0x430926(0x167)+_0x347166,'arg':_0x347166};if(_0x5ce8e8[_0x430926(0x168)](_0x430926(0x160))){if(_0x1d0fa6){const _0x1efa0d=a114_0x517e09[_0x430926(0x152)](_0x347166);if(await fs['exists'](_0x1efa0d)){const _0x4b0040=a114_0x517e09[_0x430926(0x151)](_0x1efa0d),_0x1fe498=await fs[_0x430926(0x16c)](_0x1efa0d),_0x280b21=_0x1fe498[_0x430926(0x172)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x2e37c5=_0x1fe498['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x12cbfc=_0x280b21?_0x280b21[0x1][_0x430926(0x175)]():a114_0x517e09[_0x430926(0x16b)](_0x347166,a114_0x517e09[_0x430926(0x171)](_0x347166)),_0x46db69=_0x2e37c5&&_0x2e37c5[0x1][_0x430926(0x175)]()==='journey'?_0x430926(0x165):'segment';return{'type':_0x430926(0x158),'parentName':_0x1d0fa6,'targetDir':_0x4b0040,'configRoot':_0x4b0040,'filePath':_0x1efa0d,'resourceName':_0x12cbfc,'folderPath':'','resourceType':_0x46db69,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x16d),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x14d)};}return{'type':'error','errorCode':_0x430926(0x146),'message':_0x5ce8e8,'arg':_0x347166};}if(_0x347166){const _0xa99f2=a114_0x517e09[_0x430926(0x152)](cwd,_0x347166);let _0x26be12=null;try{_0x26be12=await fs[_0x430926(0x174)](_0xa99f2);}catch{}if(_0x26be12?.[_0x430926(0x14a)]()){const _0x13edec=await findTdxConfigAsync(_0xa99f2,fs);if(_0x13edec){const _0x22a3b9=calculateScopedPath(_0xa99f2,_0x13edec['configDir']);return{'type':_0x430926(0x173),'parentName':_0x13edec['parentSegment'],'targetDir':_0xa99f2,'configRoot':_0x13edec[_0x430926(0x15d)],'isScoped':_0x22a3b9[_0x430926(0x176)],'scopedFolderPath':_0x22a3b9[_0x430926(0x14c)]};}if(_0x1d0fa6)return{'type':_0x430926(0x173),'parentName':_0x1d0fa6,'targetDir':_0xa99f2,'configRoot':_0xa99f2,'isScoped':![],'scopedFolderPath':''};return{'type':_0x430926(0x14b),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x14d)};}if(_0x26be12?.[_0x430926(0x166)]())return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x146),'message':_0x430926(0x147)+_0x347166,'arg':_0x347166,'helpText':_0x430926(0x156)};const _0x294a5e=sanitizeFileName(_0x347166),_0x5d69fc=getSegmentRootDir(_0x294a5e,cwd);return{'type':'parent_name','parentName':_0x347166,'targetDir':_0x5d69fc,'configRoot':_0x5d69fc};}const _0x324d1f=await findTdxConfigAsync(cwd,fs);if(_0x324d1f){const _0x324943=calculateScopedPath(cwd,_0x324d1f[_0x430926(0x15d)]);return{'type':_0x430926(0x177),'parentName':_0x324d1f['parentSegment'],'targetDir':cwd,'configRoot':_0x324d1f['configDir'],'isScoped':_0x324943['isScoped'],'scopedFolderPath':_0x324943['scopedFolderPath']};}if(_0x1d0fa6){const _0x190e1b=sanitizeFileName(_0x1d0fa6),_0x37e16a=getSegmentRootDir(_0x190e1b,cwd);return{'type':_0x430926(0x177),'parentName':_0x1d0fa6,'targetDir':_0x37e16a,'configRoot':_0x37e16a,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x430926(0x14b),'errorCode':_0x430926(0x178),'message':_0x430926(0x16e),'helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x3b1a77=a115_0x7294;(function(_0x3109a9,_0x152f2e){const _0x55e339=a115_0x7294,_0x427762=_0x3109a9();while(!![]){try{const _0x3a0fd7=-parseInt(_0x55e339(0xc1))/0x1*(parseInt(_0x55e339(0xd0))/0x2)+parseInt(_0x55e339(0xd5))/0x3+parseInt(_0x55e339(0xcd))/0x4*(parseInt(_0x55e339(0xc7))/0x5)+-parseInt(_0x55e339(0xd7))/0x6+-parseInt(_0x55e339(0xcb))/0x7+parseInt(_0x55e339(0xc4))/0x8+-parseInt(_0x55e339(0xbe))/0x9*(-parseInt(_0x55e339(0xd6))/0xa);if(_0x3a0fd7===_0x152f2e)break;else _0x427762['push'](_0x427762['shift']());}catch(_0x98fd5a){_0x427762['push'](_0x427762['shift']());}}}(a115_0x3776,0x97cec));import{existsSync,readFileSync}from'fs';import a115_0x7a0a85 from'path';function a115_0x7294(_0x16da1e,_0x148cea){_0x16da1e=_0x16da1e-0xbe;const _0x37768f=a115_0x3776();let _0x729469=_0x37768f[_0x16da1e];return _0x729469;}const TDX_CONFIG_FILE=a115_0x3b1a77(0xcf),SEGMENTS_DIR='segments';export function findTdxConfigPath(_0x1b7cbf=process[a115_0x3b1a77(0xc5)]()){const _0x1809a4=a115_0x3b1a77;let _0x3594fb=a115_0x7a0a85[_0x1809a4(0xd1)](_0x1b7cbf);const _0x55b559=a115_0x7a0a85[_0x1809a4(0xbf)](_0x3594fb)[_0x1809a4(0xca)];while(_0x3594fb!==_0x55b559){const _0x441af8=a115_0x7a0a85[_0x1809a4(0xc2)](_0x3594fb,TDX_CONFIG_FILE);if(existsSync(_0x441af8))return _0x441af8;_0x3594fb=a115_0x7a0a85[_0x1809a4(0xc3)](_0x3594fb);}return null;}export function loadTdxConfig(_0x2de51f){const _0x51f786=a115_0x3b1a77,_0x452feb=readFileSync(_0x2de51f,_0x51f786(0xc6));let _0x1a4d9b;try{_0x1a4d9b=JSON[_0x51f786(0xbf)](_0x452feb);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x2de51f);}if(!_0x1a4d9b||typeof _0x1a4d9b!==_0x51f786(0xc0))throw new Error(_0x51f786(0xc9));const _0x1fc585=_0x1a4d9b;if(!_0x1fc585[_0x51f786(0xce)]||typeof _0x1fc585[_0x51f786(0xce)]!==_0x51f786(0xcc))throw new Error(_0x51f786(0xd2));return{'parent_segment':_0x1fc585[_0x51f786(0xce)]};}export function findTdxConfig(_0x471ec9=process[a115_0x3b1a77(0xc5)]()){const _0x48e794=a115_0x3b1a77,_0x25a058=findTdxConfigPath(_0x471ec9);if(!_0x25a058)throw new Error(_0x48e794(0xd4));const _0x1879e1=loadTdxConfig(_0x25a058),_0x2ef78a=a115_0x7a0a85[_0x48e794(0xc3)](_0x25a058);return{'config':_0x1879e1,'configPath':_0x25a058,'configDir':_0x2ef78a};}export function tryFindTdxConfig(_0x3ac3f8){try{return findTdxConfig(_0x3ac3f8);}catch{return null;}}export function getSegmentRootDir(_0x5bb17a,_0x5edc76=process[a115_0x3b1a77(0xc5)]()){const _0x390c53=a115_0x3b1a77;return a115_0x7a0a85[_0x390c53(0xc2)](_0x5edc76,SEGMENTS_DIR,_0x5bb17a);}export function getTdxConfigPath(_0x3bf5d8,_0x99523c=process[a115_0x3b1a77(0xc5)]()){return a115_0x7a0a85['join'](getSegmentRootDir(_0x3bf5d8,_0x99523c),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x45783e,_0x4fbdc4){const _0x4c79cc=a115_0x3b1a77,_0x3e345d=a115_0x7a0a85[_0x4c79cc(0xd1)](_0x45783e),_0x55978b=a115_0x7a0a85['relative'](_0x4fbdc4,_0x3e345d);if(_0x55978b[_0x4c79cc(0xc8)]('..'))return'';return _0x55978b;}function a115_0x3776(){const _0x41ac3e=['3867208IpwDeU','cwd','utf-8','10lFFTVo','startsWith','Invalid\x20tdx.json:\x20expected\x20object','root','7386162xJINUK','string','1611164kXBEuQ','parent_segment','tdx.json','779068VoKWKn','resolve','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','stringify','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','2391744xilGKK','915350gRsziA','667572mYZOQg','9PhfTzT','parse','object','1Ahajmk','join','dirname'];a115_0x3776=function(){return _0x41ac3e;};return a115_0x3776();}export function localPathToTdFolderPath(_0x5687a1){const _0x1b5a56=a115_0x3b1a77,_0x2d7a53=a115_0x7a0a85[_0x1b5a56(0xc3)](_0x5687a1);if(_0x2d7a53==='.'||_0x2d7a53==='')return'';return _0x2d7a53['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x38f689,_0x49539c){const _0x11ba49=a115_0x3b1a77;if(!_0x38f689)return _0x49539c;return a115_0x7a0a85[_0x11ba49(0xc2)](_0x49539c,_0x38f689);}export function createTdxConfigContent(_0x2a96f3){const _0x2ba717=a115_0x3b1a77,_0x433708={'parent_segment':_0x2a96f3};return JSON[_0x2ba717(0xd3)](_0x433708,null,0x2)+'\x0a';}
|