@treasuredata/tdx 0.16.9 → 0.16.11
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/README.md +3 -2
- 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.d.ts.map +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/claude-usage-command.js.map +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/llm-proxy.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/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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +31 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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.d.ts +0 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +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-aliases.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/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/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
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +0 -73
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +0 -1
- package/dist/sdk/claude-agent/environment.d.ts +0 -59
- package/dist/sdk/claude-agent/environment.d.ts.map +0 -1
- package/dist/sdk/claude-agent/environment.js +0 -1
- package/dist/sdk/claude-agent/environment.js.map +0 -1
- package/dist/sdk/claude-agent/index.d.ts +0 -15
- package/dist/sdk/claude-agent/index.d.ts.map +0 -1
- package/dist/sdk/claude-agent/index.js +0 -1
- package/dist/sdk/claude-agent/index.js.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.d.ts +0 -22
- package/dist/sdk/claude-agent/system-prompts.d.ts.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.js +0 -1
- package/dist/sdk/claude-agent/system-prompts.js.map +0 -1
- package/dist/sdk/claude-agent/types.d.ts +0 -107
- package/dist/sdk/claude-agent/types.d.ts.map +0 -1
- package/dist/sdk/claude-agent/types.js +0 -1
- package/dist/sdk/claude-agent/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a120_0x448e68=a120_0x3afa;(function(_0x556649,_0x48ae6a){const _0x29b39f=a120_0x3afa,_0x4af338=_0x556649();while(!![]){try{const _0x26fa53=-parseInt(_0x29b39f(0x129))/0x1+parseInt(_0x29b39f(0x1cf))/0x2*(parseInt(_0x29b39f(0x140))/0x3)+-parseInt(_0x29b39f(0x139))/0x4+-parseInt(_0x29b39f(0x143))/0x5+-parseInt(_0x29b39f(0x1d0))/0x6+parseInt(_0x29b39f(0x13c))/0x7*(-parseInt(_0x29b39f(0x1cd))/0x8)+parseInt(_0x29b39f(0x11f))/0x9;if(_0x26fa53===_0x48ae6a)break;else _0x4af338['push'](_0x4af338['shift']());}catch(_0x3b1b97){_0x4af338['push'](_0x4af338['shift']());}}}(a120_0x2827,0xe1922));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a120_0x448e68(0x19c);export const PENDING_ACTIVATION_PREFIX=a120_0x448e68(0x166);export function createPendingSegmentId(_0x5b93e3){return''+PENDING_SEGMENT_PREFIX+_0x5b93e3+'__';}export function isPendingSegmentId(_0xf9c4a){return _0xf9c4a['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4c68bd){const _0x416e81=a120_0x448e68;return _0x4c68bd[_0x416e81(0x1a5)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x53b773){return''+PENDING_ACTIVATION_PREFIX+_0x53b773+'__';}export function isPendingActivationId(_0x27480b){const _0x5cf95e=a120_0x448e68;return _0x27480b[_0x5cf95e(0x16b)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x23c1b6){const _0x4713c5=a120_0x448e68;return _0x23c1b6[_0x4713c5(0x1a5)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x3f1233,_0x1cf903){const _0x558b00=a120_0x448e68,_0x14dde2=_0x3f1233+'::'+(_0x1cf903[_0x558b00(0x184)]()||_0x558b00(0x19f)),_0x1393a8=createHash('sha1')[_0x558b00(0x1ce)](_0x14dde2)['digest']('hex')[_0x558b00(0x112)](0x0,0xc);return'journey_entry_criteria_'+_0x1393a8;}export function ensureJourneyDefaults(_0x283994){const _0x34bb46=a120_0x448e68;!_0x283994[_0x34bb46(0x105)]&&(_0x283994[_0x34bb46(0x105)]=''),!_0x283994[_0x34bb46(0x17e)]&&(_0x283994[_0x34bb46(0x17e)]='draft');}export function resolveTDFolderPath(_0x27f8e1,_0x4415ac,_0x136c12){const _0x154720=a120_0x448e68;if(!_0x4415ac)return _0x27f8e1;if(_0x27f8e1===_0x136c12||_0x27f8e1[_0x154720(0x16b)](_0x136c12+'/'))return _0x27f8e1;return _0x27f8e1?_0x136c12+'/'+_0x27f8e1:_0x136c12;}export function addFoldersToCreate(_0x15a947,_0x84d2ef,_0x98605e){const _0x4e51cf=a120_0x448e68;if(!_0x15a947)return;if(_0x84d2ef[_0x4e51cf(0x128)](_0x15a947))return;const _0x554e0d=_0x15a947[_0x4e51cf(0x187)]('/');let _0x47f07e='';for(const _0x33b941 of _0x554e0d){_0x47f07e=_0x47f07e?_0x47f07e+'/'+_0x33b941:_0x33b941,!_0x84d2ef[_0x4e51cf(0x128)](_0x47f07e)&&_0x98605e[_0x4e51cf(0x135)](_0x47f07e);}}import*as a120_0x5cf97a from'yaml';import{readFileSync}from'fs';import a120_0x241aeb from'path';import{isJourneyDef,parseYamlString as a120_0x7583b1,toYamlString as a120_0xd796cf,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(_0x16e415){const _0x306472=a120_0x448e68;if(Array[_0x306472(0x19d)](_0x16e415))return'['+_0x16e415[_0x306472(0x196)](_0x15343d=>stableStringify(_0x15343d))[_0x306472(0x127)](',')+']';if(_0x16e415&&typeof _0x16e415===_0x306472(0xfb)){const _0x42c24a=_0x16e415,_0xf2738b=Object[_0x306472(0x1b8)](_0x42c24a)[_0x306472(0x131)](),_0x213cef=_0xf2738b[_0x306472(0x196)](_0x2ebef6=>'\x22'+_0x2ebef6+'\x22:'+stableStringify(_0x42c24a[_0x2ebef6]));return'{'+_0x213cef['join'](',')+'}';}const _0x5ee024=JSON[_0x306472(0x115)](_0x16e415);return _0x5ee024===undefined?_0x306472(0x152):_0x5ee024;}function activationSignature(_0x22914d){const _0x179806=a120_0x448e68,_0x207d16={'connection':_0x22914d[_0x179806(0x1a1)],..._0x22914d[_0x179806(0x194)]!==undefined&&{'all_columns':_0x22914d['all_columns']},..._0x22914d[_0x179806(0x111)]!==undefined&&{'columns':_0x22914d[_0x179806(0x111)]},..._0x22914d['behavior']!==undefined&&{'behavior':_0x22914d[_0x179806(0x11d)]},..._0x22914d[_0x179806(0x106)]!==undefined&&{'schedule':_0x22914d['schedule']},..._0x22914d[_0x179806(0x1c2)]!==undefined&&{'notification':_0x22914d[_0x179806(0x1c2)]},..._0x22914d[_0x179806(0x126)]!==undefined&&{'connector_config':_0x22914d[_0x179806(0x126)]},..._0x22914d[_0x179806(0x1bf)]!==undefined&&{'activation_template_id':_0x22914d['activation_template_id']}};return stableStringify(_0x207d16);}export async function prepareSegmentFiles(_0x5e4875,_0x34888a,_0x4b20ff,_0x4faee0,_0x302439){const _0x3dc213=a120_0x448e68,{activationDefToCreateRequest:_0x456cd7}=await import('./child-segment-yaml.js'),_0x46c9ad=[],_0x236ec0=new Set();for(const {yamlConfig:_0x39f776,folderPath:_0x366ad5,sourcePath:_0x2df782}of _0x5e4875){const _0x5632a2=resolveTDFolderPath(_0x366ad5,_0x4faee0,_0x302439),_0x3b2851=_0x5632a2+':'+_0x39f776['name'],_0x41c081=_0x34888a[_0x3dc213(0x18c)][_0x3dc213(0x1ac)](_0x3b2851),_0x3ef802=_0x41c081?_0x34888a[_0x3dc213(0x1c3)][_0x3dc213(0x1ac)](_0x41c081['id'])||[]:[];addFoldersToCreate(_0x5632a2,_0x34888a[_0x3dc213(0x14d)],_0x236ec0);const _0x141279=calculateActivationActions(_0x39f776[_0x3dc213(0x132)]||[],_0x3ef802,_0x34888a['idToEmailMap'],_0x34888a[_0x3dc213(0x120)]);for(const _0x31b484 of _0x141279){(_0x31b484[_0x3dc213(0x183)]===_0x3dc213(0x110)||_0x31b484['type']==='update')&&_0x31b484[_0x3dc213(0x113)]&&(_0x31b484[_0x3dc213(0x180)]=await _0x456cd7(_0x31b484['yamlActivation'],_0x4b20ff));}const _0x1fefc6=calculateSegmentDiff(_0x39f776,_0x41c081,_0x3ef802,_0x34888a[_0x3dc213(0x146)],_0x34888a[_0x3dc213(0x120)]);_0x46c9ad['push']({'relativePath':_0x39f776[_0x3dc213(0x16a)],'absolutePath':_0x2df782,'yamlConfig':_0x39f776,'folderPath':_0x5632a2,'existingSegment':_0x41c081,'existingActivations':_0x3ef802,'isNew':_0x1fefc6[_0x3dc213(0x14b)],'hasChanges':_0x1fefc6[_0x3dc213(0x1ae)],'diff':_0x1fefc6[_0x3dc213(0x141)],'activationActions':_0x141279});}return{'segmentFiles':_0x46c9ad,'foldersToCreate':_0x236ec0};}export async function prepareJourneyFiles(_0x2850b3,_0x54276e,_0x22d7fd,_0x129e58){const _0xd6d0f8=a120_0x448e68,_0x13c287=[],_0x279e82=new Set();for(const {yamlConfig:_0x2c6805,folderPath:_0x2f7440,sourcePath:_0x42f794}of _0x2850b3){const _0x53326a=resolveTDFolderPath(_0x2f7440,_0x22d7fd,_0x129e58),_0x510bd3=_0x53326a+':'+_0x2c6805['name'],_0x4ed38a=_0x54276e[_0xd6d0f8(0x1b2)][_0xd6d0f8(0x1ac)](_0x510bd3);let _0x236598,_0x515758;if(_0x4ed38a&&_0x4ed38a['length']>0x0){const _0x42f711=buildLocalExpandedRuleMappings(_0x2c6805),{createYamlContext:_0xb815,prefetchJourneySegments:_0x43f477}=createPushYamlContextForBundle(_0x54276e[_0xd6d0f8(0x10c)],_0x54276e[_0xd6d0f8(0x197)],_0x54276e[_0xd6d0f8(0x12a)],_0x42f711,_0x54276e[_0xd6d0f8(0x146)],_0x54276e[_0xd6d0f8(0x120)],_0x54276e[_0xd6d0f8(0x124)],_0x54276e[_0xd6d0f8(0x1a8)]);await _0x43f477(_0x4ed38a[_0xd6d0f8(0x196)](_0xaa784c=>_0xaa784c['id']));const _0xe60e28=hasMultipleVersions(_0x2c6805),_0x182fd6=async _0x2b3937=>{const _0x31a210=_0xd6d0f8,_0xfe3dad=_0x54276e[_0x31a210(0x1a8)]?.[_0x31a210(0x1ac)](_0x2b3937);if(_0xfe3dad)return _0xfe3dad;return _0x54276e[_0x31a210(0x1bc)]({'journeyId':_0x2b3937,'journeyName':_0x2c6805[_0x31a210(0x16a)],'isMultiVersion':_0x4ed38a[_0x31a210(0x190)]>0x1});};if(_0xe60e28&&_0x4ed38a[_0xd6d0f8(0x190)]>0x1){const _0x1186d0=[];for(const _0x3ac5fe of _0x4ed38a){const _0x582741=_0x3ac5fe['versionNumber']||0x1;_0x54276e[_0xd6d0f8(0x1ca)]?.[_0xd6d0f8(0x1ce)](_0xd6d0f8(0x175)+_0x2c6805[_0xd6d0f8(0x16a)]+'\x20v'+_0x582741);const _0x521767=await _0x182fd6(_0x3ac5fe['id']),_0x3dcde1=_0xb815(_0x3ac5fe['id']),_0x100bf5=await journeyResponseToDef(_0x521767,_0x3dcde1);_0x1186d0['push']({'item':_0x3ac5fe,'yaml':_0x100bf5});}const _0x2c8c52=buildLocalRuleToNameMappingFromJourney(_0x2c6805);_0x515758=buildMergedJourneyDef(_0x1186d0,_0x2c8c52);const _0x279322=Math[_0xd6d0f8(0x1b7)](..._0x1186d0['map'](_0x316b0e=>_0x316b0e[_0xd6d0f8(0x159)][_0xd6d0f8(0x101)]||0x0)),_0xe4986f=_0x4ed38a['find'](_0x740519=>(_0x740519[_0xd6d0f8(0x101)]||0x0)===_0x279322);_0xe4986f&&(_0x54276e[_0xd6d0f8(0x1ca)]?.[_0xd6d0f8(0x1ce)](_0xd6d0f8(0x175)+_0x2c6805[_0xd6d0f8(0x16a)]+'\x20v'+_0x279322),_0x236598=await _0x182fd6(_0xe4986f['id']));}else{const _0x3b775d=_0x4ed38a[_0x4ed38a[_0xd6d0f8(0x190)]-0x1];_0x54276e[_0xd6d0f8(0x1ca)]?.[_0xd6d0f8(0x1ce)](_0xd6d0f8(0x175)+_0x2c6805[_0xd6d0f8(0x16a)]),_0x236598=await _0x182fd6(_0x3b775d['id']);const _0x46a2ba=_0xb815(_0x3b775d['id']),_0x2ab04c=await journeyResponseToDef(_0x236598,_0x46a2ba),_0x1e3d57=buildLocalRuleToNameMappingFromJourney(_0x2c6805);_0x515758=buildMergedJourneyDef([{'item':_0x3b775d,'yaml':_0x2ab04c}],_0x1e3d57);}}addFoldersToCreate(_0x53326a,_0x54276e[_0xd6d0f8(0x14d)],_0x279e82);const _0x5d3e93=calculateJourneyDiff(_0x2c6805,_0x515758);_0x13c287[_0xd6d0f8(0x1bb)]({'relativePath':_0x2c6805[_0xd6d0f8(0x16a)],'absolutePath':_0x42f794,'yamlConfig':_0x2c6805,'folderPath':_0x53326a,'existingJourney':_0x236598,'isNew':_0x5d3e93[_0xd6d0f8(0x14b)],'hasChanges':_0x5d3e93['hasChanges'],'diff':_0x5d3e93[_0xd6d0f8(0x141)]});}return{'journeyFiles':_0x13c287,'foldersToCreate':_0x279e82};}export function calculateActivationActions(_0x55263c,_0x30b73d,_0x2a9a4a,_0x218daa){const _0x136e29=a120_0x448e68,_0x22b856=[],_0x2e3622=new Map();for(const _0x47fc57 of _0x30b73d){_0x2e3622[_0x136e29(0x1b1)](_0x47fc57['name'],_0x47fc57);}const _0x1ba1b7=new Map();for(const _0x237b6a of _0x55263c){_0x1ba1b7[_0x136e29(0x1b1)](_0x237b6a[_0x136e29(0x16a)],_0x237b6a);}for(const _0x4421f5 of _0x55263c){const _0x32cb5b=_0x2e3622[_0x136e29(0x1ac)](_0x4421f5[_0x136e29(0x16a)]);if(!_0x32cb5b)_0x22b856[_0x136e29(0x1bb)]({'type':_0x136e29(0x110),'name':_0x4421f5['name'],'yamlActivation':_0x4421f5});else{const _0x5db174=activationResponseToDef(_0x32cb5b,_0x2a9a4a,_0x218daa),_0x5ebb42=a120_0x5cf97a[_0x136e29(0x115)](_0x5db174),_0x201e6c=a120_0x5cf97a[_0x136e29(0x115)](_0x4421f5);_0x5ebb42!==_0x201e6c&&_0x22b856[_0x136e29(0x1bb)]({'type':_0x136e29(0x1ce),'name':_0x4421f5[_0x136e29(0x16a)],'yamlActivation':_0x4421f5,'existingActivation':_0x32cb5b});}}for(const _0x3a9999 of _0x30b73d){!_0x1ba1b7[_0x136e29(0x128)](_0x3a9999[_0x136e29(0x16a)])&&_0x22b856[_0x136e29(0x1bb)]({'type':'delete','name':_0x3a9999[_0x136e29(0x16a)],'existingActivation':_0x3a9999});}return _0x22b856;}export function calculateSegmentDiff(_0x1a0473,_0x5669be,_0x42bfa9,_0x5d3493,_0x6a4547){const _0x465bd6=segmentToYamlString(_0x1a0473);if(_0x5669be){const _0x18f0bd=segmentWithActivationsToYaml(_0x5669be,_0x42bfa9,undefined,_0x5d3493,_0x6a4547),_0x1b0d54=segmentToYamlString(_0x18f0bd),_0x18553a=generateDiff(_0x1b0d54,_0x465bd6),_0xceecf3=hasChanges(_0x18553a);return{'isNew':![],'hasChanges':_0xceecf3,'diff':_0xceecf3?formatDiffWithColors(_0x18553a):undefined};}const _0x33b446=generateDiff('',_0x465bd6);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x33b446)};}export function calculateJourneyDiff(_0x212faf,_0x543db5){const _0x193607=normalizeJourneyDef(_0x212faf,_0x212faf),_0x4179ae=a120_0xd796cf(_0x193607);if(_0x543db5){const _0x66adb2=normalizeJourneyDef(_0x543db5,_0x212faf),_0x41cc32=a120_0xd796cf(_0x66adb2),_0x4bff55=generateDiff(_0x41cc32,_0x4179ae),_0x193271=hasChanges(_0x4bff55);return{'isNew':![],'hasChanges':_0x193271,'diff':_0x193271?formatDiffWithColors(_0x4bff55):undefined};}const _0x5588b4=generateDiff('',_0x4179ae);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5588b4)};}export function findSegmentsToDelete(_0x4e2f02,_0x233ceb,_0x553d16,_0x504cb7,_0x592238){const _0x752b32=a120_0x448e68,_0x21008b=new Set();for(const {yamlConfig:_0x2293fb,folderPath:_0xd589a3}of _0x233ceb){_0x21008b[_0x752b32(0x135)](_0xd589a3+':'+_0x2293fb[_0x752b32(0x16a)]);}return _0x4e2f02[_0x752b32(0x1b0)](_0x7c4192=>{const _0x16955f=_0x752b32,_0x15370c=_0x7c4192[_0x16955f(0x192)]?_0x553d16[_0x16955f(0x1ac)](_0x7c4192['segmentFolderId'][_0x16955f(0x150)]())||'':'',_0x5efee9=_0x15370c+':'+_0x7c4192[_0x16955f(0x16a)];if(_0x21008b[_0x16955f(0x128)](_0x5efee9))return![];if(_0x592238)return _0x15370c===_0x504cb7||_0x15370c[_0x16955f(0x16b)](_0x504cb7+'/');return!![];});}export function findJourneysToDelete(_0x52364f,_0x1fdb7d,_0x32bc4c,_0x1e28cc,_0x5c2562){const _0x23b0d4=a120_0x448e68,_0x1c57e3=new Set();for(const {yamlConfig:_0x107388,folderPath:_0x3afd49}of _0x1fdb7d){_0x1c57e3[_0x23b0d4(0x135)](_0x3afd49+':'+_0x107388[_0x23b0d4(0x16a)]);}return _0x52364f[_0x23b0d4(0x1b0)](_0x191c83=>{const _0xdd48a8=_0x23b0d4,_0x30fba5=_0x191c83[_0xdd48a8(0x186)]?_0x32bc4c['get'](_0x191c83[_0xdd48a8(0x186)])||'':'',_0x6ca898=_0x30fba5+':'+_0x191c83['journeyBundleName'];if(_0x1c57e3[_0xdd48a8(0x128)](_0x6ca898))return![];if(_0x5c2562)return _0x30fba5===_0x1e28cc||_0x30fba5[_0xdd48a8(0x16b)](_0x1e28cc+'/');return!![];});}export function buildSegmentLookupMap(_0x521078,_0x276b28){const _0x3ed5ab=a120_0x448e68,_0x145be7=new Map();for(const _0x30216d of _0x521078){const _0x494ee4=_0x30216d[_0x3ed5ab(0x192)]?_0x276b28[_0x3ed5ab(0x1ac)](_0x30216d['segmentFolderId'][_0x3ed5ab(0x150)]())||'':'',_0x11c313=_0x494ee4+':'+_0x30216d[_0x3ed5ab(0x16a)];_0x145be7[_0x3ed5ab(0x1b1)](_0x11c313,_0x30216d);}return _0x145be7;}export function buildSegmentNameToIdMap(_0x42d21b){const _0x565c93=a120_0x448e68,_0x4e1b1f=new Map();for(const _0x19184f of _0x42d21b){_0x4e1b1f['set'](_0x19184f[_0x565c93(0x16a)],_0x19184f['id']);}return _0x4e1b1f;}export function buildJourneyBundleLookupMap(_0x114013,_0x150ee6){const _0x94e507=a120_0x448e68,_0x10e699=new Map();for(const _0x30d6ec of _0x114013){const _0x380a87=_0x30d6ec[_0x94e507(0x186)]?_0x150ee6[_0x94e507(0x1ac)](_0x30d6ec[_0x94e507(0x186)])||'':'',_0x11731b=_0x380a87+':'+_0x30d6ec['journeyBundleName'];!_0x10e699[_0x94e507(0x128)](_0x11731b)&&_0x10e699[_0x94e507(0x1b1)](_0x11731b,[]),_0x10e699['get'](_0x11731b)['push'](_0x30d6ec);}for(const _0x3cf779 of _0x10e699[_0x94e507(0x1d6)]()){_0x3cf779[_0x94e507(0x131)]((_0x17ccf0,_0x1a9f89)=>(_0x17ccf0['versionNumber']||0x0)-(_0x1a9f89[_0x94e507(0x101)]||0x0));}return _0x10e699;}export function collectFoldersToCreate(_0x5630cd,_0x4e9953){const _0x391f4b=a120_0x448e68,_0x55ce31=new Set();for(const _0x336fb0 of _0x5630cd){if(!_0x336fb0)continue;if(_0x4e9953[_0x391f4b(0x128)](_0x336fb0))continue;const _0x513183=_0x336fb0['split']('/');let _0x4c4e69='';for(const _0x2741ae of _0x513183){_0x4c4e69=_0x4c4e69?_0x4c4e69+'/'+_0x2741ae:_0x2741ae,!_0x4e9953[_0x391f4b(0x128)](_0x4c4e69)&&_0x55ce31[_0x391f4b(0x135)](_0x4c4e69);}}return _0x55ce31;}export function parseAndClassifyYamlFiles(_0x8f3cd8,_0x488ccc,_0x3e04b2){const _0x2ade56=a120_0x448e68,_0x201b61=[],_0x505303=[];for(const _0x394b76 of _0x8f3cd8){const _0x4accbd=a120_0x241aeb[_0x2ade56(0x155)](_0x488ccc,a120_0x241aeb[_0x2ade56(0x18f)](_0x394b76)),_0x368112=_0x4accbd==='.'?'':_0x4accbd,_0x365930=readFileSync(_0x394b76,_0x2ade56(0x10b)),_0x213880=a120_0x5cf97a[_0x2ade56(0x147)](_0x365930);if(isJourneyDef(_0x213880)){const _0x540da7=a120_0x7583b1(_0x365930);_0x505303[_0x2ade56(0x1bb)]({'yamlConfig':_0x540da7,'folderPath':_0x368112,'sourcePath':_0x394b76});}else{if(!_0x3e04b2?.[_0x2ade56(0x1cb)]){const _0x56a98c=parseSegmentYamlFile(_0x365930),_0xa57eae=normalizeChildSegmentYaml(_0x56a98c);_0x201b61[_0x2ade56(0x1bb)]({'yamlConfig':_0xa57eae,'folderPath':_0x368112,'sourcePath':_0x394b76});}}}return{'segments':_0x201b61,'journeys':_0x505303};}export function validateParsedFiles(_0x16dbb6,_0x14b1b){const _0x324a06=a120_0x448e68,_0x568396=[];for(const {yamlConfig:_0x1331c2,sourcePath:_0x1c1dda}of _0x16dbb6[_0x324a06(0x1c9)]){const _0x121de1=readFileSync(_0x1c1dda,'utf-8'),_0x463151=a120_0x5cf97a[_0x324a06(0x19b)](_0x121de1),_0x31cd59=validateSegmentDef(_0x1331c2,{'source':_0x121de1,'document':_0x463151});if(!_0x31cd59['valid']){const _0x72c8ff=a120_0x241aeb[_0x324a06(0x155)](_0x14b1b,_0x1c1dda);_0x568396['push']({'filePath':_0x72c8ff,'source':_0x121de1,'result':_0x31cd59,'isJourney':![]});}}for(const {yamlConfig:_0x34c4de,sourcePath:_0xb4aa85}of _0x16dbb6[_0x324a06(0x16c)]){const _0x3d8790=readFileSync(_0xb4aa85,'utf-8'),_0x45182d=a120_0x5cf97a[_0x324a06(0x19b)](_0x3d8790),_0x10d270=validateJourneyDef(_0x34c4de,{'source':_0x3d8790,'document':_0x45182d});if(!_0x10d270[_0x324a06(0x109)]){const _0x5cbccd=a120_0x241aeb['relative'](_0x14b1b,_0xb4aa85);_0x568396[_0x324a06(0x1bb)]({'filePath':_0x5cbccd,'source':_0x3d8790,'result':_0x10d270,'isJourney':!![]});}}return _0x568396;}export function formatValidationErrors(_0x38aff0){const _0x32bd26=a120_0x448e68,_0x2a3b42=[];for(const {filePath:_0x3eb683,source:_0x1c7bdb,result:_0x50dfb9,isJourney:_0x299ff2}of _0x38aff0){const _0x21dbfe=_0x299ff2?_0x32bd26(0x18a):_0x32bd26(0x19f);_0x2a3b42[_0x32bd26(0x1bb)]('\x0a'+_0x3eb683+'\x20('+_0x21dbfe+'):\x20'+_0x50dfb9['errors'][_0x32bd26(0x190)]+'\x20error(s)'),_0x2a3b42['push'](formatValidationResult(_0x50dfb9,_0x1c7bdb,_0x3eb683));}return _0x2a3b42[_0x32bd26(0x127)]('\x0a');}export function buildLocalExpandedRuleMappings(_0xc1f456){const _0x308ada=a120_0x448e68,_0x418186=new Set(),_0x201d5f=new Map(),_0x16ca4b=collectSegmentUsageCounts(_0xc1f456);if(_0xc1f456[_0x308ada(0x1c9)])for(const [_0x33ac57,_0x16eaa7]of Object['entries'](_0xc1f456[_0x308ada(0x1c9)])){_0x418186[_0x308ada(0x135)](_0x33ac57);if(_0x16eaa7[_0x308ada(0x14c)]){const _0x45c078=yamlRuleToApi(_0x16eaa7[_0x308ada(0x14c)]),_0x4667b0=apiRuleToYaml(_0x45c078);_0x201d5f[_0x308ada(0x1b1)](_0x33ac57,_0x4667b0);}}const _0x3a73c1=new Map();let _0x34c2b0=0x0;for(const [_0x61a45c,_0x2d1094]of _0x201d5f){const _0x34a5bb=serializeExpandedRule(_0x2d1094,_0x201d5f),_0x54c7f5=_0x3a73c1['get'](_0x34a5bb)||[];_0x54c7f5[_0x308ada(0x1bb)]({'name':_0x61a45c,'index':_0x34c2b0}),_0x3a73c1[_0x308ada(0x1b1)](_0x34a5bb,_0x54c7f5),_0x34c2b0++;}const _0x2d0d0a=new Map();for(const [_0x2a8c00,_0x4b3c3b]of _0x3a73c1){const _0x49b795=_0x4b3c3b[_0x308ada(0x112)]()[_0x308ada(0x131)]((_0xbc7c89,_0x24671d)=>{const _0x7715=_0x308ada,_0x27a8a6=_0x16ca4b[_0x7715(0x1ac)](_0xbc7c89[_0x7715(0x16a)])||0x0,_0x1d48e0=_0x16ca4b[_0x7715(0x1ac)](_0x24671d[_0x7715(0x16a)])||0x0;if(_0x27a8a6!==_0x1d48e0)return _0x1d48e0-_0x27a8a6;return _0xbc7c89[_0x7715(0x15e)]-_0x24671d[_0x7715(0x15e)];})['map'](_0x264fa2=>_0x264fa2[_0x308ada(0x16a)]),_0x44cf64=[];for(const _0x3329fc of _0x49b795){const _0x11c8a2=_0x16ca4b[_0x308ada(0x1ac)](_0x3329fc)||0x0,_0x446dcc=Math['max'](_0x11c8a2,0x1);for(let _0x32d50f=0x0;_0x32d50f<_0x446dcc;_0x32d50f++){_0x44cf64[_0x308ada(0x1bb)](_0x3329fc);}}_0x2d0d0a[_0x308ada(0x1b1)](_0x2a8c00,_0x44cf64);}return{'existingLocalSegmentNames':_0x418186,'localSegmentRules':_0x201d5f,'localExpandedRuleToNames':_0x2d0d0a};}async function buildServerSegmentRuleMap(_0x3ff959,_0x5713a7,_0x15d27d,_0x263b58){const _0x5e0d6d=new Map(),_0xa1950e=new Set(),_0x3aaf11=async _0x301e51=>{const _0x14b2ff=a120_0x3afa;if(_0xa1950e['has'](_0x301e51))return;_0xa1950e[_0x14b2ff(0x135)](_0x301e51);let _0x97ccbf=_0x15d27d[_0x14b2ff(0x1ad)](_0x1571e0=>_0x1571e0['id']===_0x301e51);if(!_0x97ccbf)try{_0x97ccbf=await _0x3ff959[_0x14b2ff(0x19f)][_0x14b2ff(0x185)](_0x5713a7,_0x301e51);}catch{return;}if(!_0x97ccbf?.['rule'])return;const _0x3e639a=apiRuleToYaml(_0x97ccbf[_0x14b2ff(0x14c)]);_0x5e0d6d[_0x14b2ff(0x1b1)](_0x301e51,_0x3e639a);const _0x5b6a84=collectSegmentRefsFromRule(_0x3e639a);for(const _0x36ce26 of _0x5b6a84){await _0x3aaf11(_0x36ce26);}};for(const _0x1099fb of _0x263b58){await _0x3aaf11(_0x1099fb);}return _0x5e0d6d;}export function createSegmentIdResolver(_0x408567,_0x3bd605){return async _0x42c11c=>{const _0x43565b=a120_0x3afa,_0x372683=_0x408567[_0x43565b(0x1ac)](_0x42c11c);if(!_0x372683)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x43565b(0x1a6)+_0x42c11c+_0x43565b(0x145)+_0x3bd605+'\x27)');return _0x372683;};}export function extractRootFolderId(_0x58385f){const _0x34ebbc=a120_0x448e68;return _0x58385f[_0x34ebbc(0x1c1)]?.[_0x34ebbc(0x1cc)]?.[_0x34ebbc(0x13b)]?.['id']||_0x58385f['relationships']?.[_0x34ebbc(0x167)]?.['data']?.['id'];}export function buildConnectionMaps(_0x435e75){const _0x205852=a120_0x448e68,_0x305265=new Map(),_0x545380=new Map(),_0x4732e1=new Map();for(const _0x3a110b of _0x435e75){_0x305265[_0x205852(0x1b1)](_0x3a110b[_0x205852(0x16a)],parseInt(_0x3a110b['id'],0xa)),_0x545380[_0x205852(0x1b1)](_0x3a110b['id'],_0x3a110b[_0x205852(0x16a)]),_0x4732e1[_0x205852(0x1b1)](_0x3a110b[_0x205852(0x16a)],_0x3a110b['type']);}return{'nameToId':_0x305265,'idToName':_0x545380,'nameToType':_0x4732e1};}export function calculatePushStats(_0x3fd7f1,_0xa3f222,_0x2c874f,_0x2b11b5,_0x474bea,_0x3d0d3a,_0x157c73){const _0x409a21=a120_0x448e68,_0x40a637=_0x3fd7f1[_0x409a21(0x1b0)](_0xd9b77a=>_0xd9b77a[_0x409a21(0x14b)]),_0x2c3dca=_0x3fd7f1['filter'](_0x2bd326=>!_0x2bd326['isNew']&&_0x2bd326[_0x409a21(0x1ae)]),_0x20f7a0=_0x3fd7f1[_0x409a21(0x1b0)](_0x2fbff3=>!_0x2fbff3[_0x409a21(0x14b)]&&!_0x2fbff3['hasChanges']),_0x5b9033=_0x3d0d3a?_0x2b11b5:[],_0x342f68=_0xa3f222['filter'](_0x13543c=>_0x13543c[_0x409a21(0x14b)]),_0x260fa5=_0xa3f222['filter'](_0x54abd7=>!_0x54abd7['isNew']&&_0x54abd7[_0x409a21(0x1ae)]),_0xb73789=_0xa3f222[_0x409a21(0x1b0)](_0x364b14=>!_0x364b14[_0x409a21(0x14b)]&&!_0x364b14[_0x409a21(0x1ae)]),_0x4cd939=_0x3d0d3a?_0x474bea:[],_0x170ca6=_0x3fd7f1[_0x409a21(0x17a)](_0x423530=>_0x423530[_0x409a21(0xfa)]),_0x2dc662=_0x170ca6[_0x409a21(0x1b0)](_0x26e9a8=>_0x26e9a8['type']===_0x409a21(0x110)),_0x3140e8=_0x170ca6[_0x409a21(0x1b0)](_0x21e4f1=>_0x21e4f1['type']==='update'),_0x3ca744=_0x170ca6[_0x409a21(0x1b0)](_0x23b067=>_0x23b067[_0x409a21(0x183)]===_0x409a21(0x177)),_0x3fd24e=Array[_0x409a21(0x14e)](_0x2c874f)[_0x409a21(0x131)](),_0x31bf1e=_0x157c73?![]:_0x40a637[_0x409a21(0x190)]>0x0||_0x2c3dca[_0x409a21(0x190)]>0x0||_0x5b9033[_0x409a21(0x190)]>0x0,_0xb213a8=_0x342f68[_0x409a21(0x190)]>0x0||_0x260fa5[_0x409a21(0x190)]>0x0||_0x4cd939[_0x409a21(0x190)]>0x0,_0x36574a=_0x157c73?![]:_0x170ca6[_0x409a21(0x190)]>0x0,_0x1aee35=_0x3fd24e[_0x409a21(0x190)]>0x0;return{'segments':{'new':_0x40a637,'changed':_0x2c3dca,'unchanged':_0x20f7a0,'toDelete':_0x5b9033},'journeys':{'new':_0x342f68,'changed':_0x260fa5,'unchanged':_0xb73789,'toDelete':_0x4cd939},'activations':{'all':_0x170ca6,'toCreate':_0x2dc662,'toUpdate':_0x3140e8,'toDelete':_0x3ca744},'folders':{'toCreate':_0x3fd24e},'counts':{'segments':{'new':_0x40a637[_0x409a21(0x190)],'changed':_0x2c3dca[_0x409a21(0x190)],'unchanged':_0x20f7a0[_0x409a21(0x190)],'toDelete':_0x5b9033[_0x409a21(0x190)]},'journeys':{'new':_0x342f68[_0x409a21(0x190)],'changed':_0x260fa5[_0x409a21(0x190)],'unchanged':_0xb73789['length'],'toDelete':_0x4cd939['length']},'activations':{'create':_0x2dc662[_0x409a21(0x190)],'update':_0x3140e8[_0x409a21(0x190)],'delete':_0x3ca744[_0x409a21(0x190)]},'folders':_0x3fd24e[_0x409a21(0x190)]},'hasChanges':_0x31bf1e||_0xb213a8||_0x36574a||_0x1aee35};}export async function buildPushExecutionContext(_0x12a1fd,_0x46c2de,_0x4b2b13,_0x6f7438,_0x320e01,_0x498bc6){const _0xff4ea0=a120_0x448e68,_0xca5fd0=extractRootFolderId(_0x4b2b13),{pathToId:_0x25e57e,idToPath:_0x1c071e}=buildFolderMaps(_0x320e01),_0x625fe=buildSegmentNameToIdMap(_0x6f7438),_0x53747e=new Map(),{batchAsync:_0x5342c0}=await import('../../utils/async.js'),[_0x22af85,_0x5ad19f]=await Promise[_0xff4ea0(0x193)]([_0x12a1fd['user'][_0xff4ea0(0x169)](),_0x12a1fd['connection'][_0xff4ea0(0x1ba)](),((async()=>{const _0x3f6bec=_0xff4ea0;!_0x498bc6&&_0x6f7438[_0x3f6bec(0x190)]>0x0&&await _0x5342c0(_0x6f7438,async _0x10ad29=>{const _0x3d644d=_0x3f6bec,_0x52f5c2=await _0x12a1fd['segment'][_0x3d644d(0x11b)](_0x46c2de,_0x10ad29['id']);_0x53747e[_0x3d644d(0x1b1)](_0x10ad29['id'],_0x52f5c2);});})())]),{emailToId:_0x31209b,idToEmail:_0x3b6c25}=_0x22af85,_0x333eb3=buildConnectionMaps(_0x5ad19f);return{'rootFolderId':_0xca5fd0,'folderPathToId':_0x25e57e,'folderIdToPath':_0x1c071e,'segmentNameToId':_0x625fe,'activationsBySegmentId':_0x53747e,'emailToIdMap':_0x31209b,'idToEmailMap':_0x3b6c25,'connectionNameToIdMap':_0x333eb3['nameToId'],'connectionIdToNameMap':_0x333eb3[_0xff4ea0(0x171)],'connectionNameToTypeMap':_0x333eb3['nameToType']};}export function createPushYamlContextForBundle(_0x33b372,_0x26bf3d,_0x3e5fa2,_0x38c80b,_0x46f8fb,_0x5ddc56,_0x43be6d,_0x4c1c11){const {existingLocalSegmentNames:_0x212189,localExpandedRuleToNames:_0x54c15b}=_0x38c80b,_0x2fc2f4=new Set(),_0x2534cd=new Map(),_0x23d809=new Map(),_0x4bcbe8=new Map(),_0x3ecfae=createJumpTargetCache(),_0x5a4ce8=new Map(),_0x1d2db9=new Map(),_0x5771ab=new Set();let _0x534f1d;const _0x58fe02=_0x2d638d=>{const _0x2b9e7c={'resolveSegment':async _0x4c11f4=>{const _0x2d7f58=a120_0x3afa,_0x41fcfc=_0x4bcbe8[_0x2d7f58(0x1ac)](_0x4c11f4);if(_0x41fcfc!==undefined)return{'name':_0x41fcfc,'isJourneyLocal':!![]};try{let _0x32d5ac=_0x3e5fa2[_0x2d7f58(0x1ad)](_0x547eb4=>_0x547eb4['id']===_0x4c11f4);!_0x32d5ac&&(_0x32d5ac=await _0x33b372['segment'][_0x2d7f58(0x185)](_0x26bf3d,_0x4c11f4));const _0x4a26f4=generateJourneyLocalName(_0x32d5ac[_0x2d7f58(0x16a)]),_0x255b5a=_0x32d5ac[_0x2d7f58(0x13d)]===SEGMENT_KIND_JOURNEY&&_0x4a26f4!==undefined;let _0x59ddfe=_0x32d5ac[_0x2d7f58(0x16a)],_0x57e254;if(_0x255b5a&&_0x32d5ac[_0x2d7f58(0x14c)]){const _0x32016f=apiRuleToYaml(_0x32d5ac[_0x2d7f58(0x14c)]);_0x1d2db9['set'](_0x4c11f4,_0x32016f);const _0x3218a2=async _0x5e868a=>{const _0x577da4=_0x2d7f58,_0x1b0455=collectSegmentRefsFromRule(_0x5e868a);for(const _0x3a46d8 of _0x1b0455){if(!_0x1d2db9[_0x577da4(0x128)](_0x3a46d8))try{const _0x14bc95=await _0x33b372[_0x577da4(0x19f)][_0x577da4(0x185)](_0x26bf3d,_0x3a46d8);if(_0x14bc95?.[_0x577da4(0x14c)]){const _0x2e175b=apiRuleToYaml(_0x14bc95['rule']);_0x1d2db9['set'](_0x3a46d8,_0x2e175b),await _0x3218a2(_0x2e175b);}}catch{}}};await _0x3218a2(_0x32016f);const _0x3ef38f=serializeExpandedRule(_0x32016f,_0x1d2db9),_0x13c4a1=_0x54c15b[_0x2d7f58(0x1ac)](_0x3ef38f);if(_0x13c4a1&&_0x13c4a1['length']>0x0){const _0x32699a=_0x2534cd['get'](_0x3ef38f)||0x0,_0x1b65d6=_0x13c4a1[_0x32699a]||_0x13c4a1[_0x13c4a1['length']-0x1];_0x2534cd[_0x2d7f58(0x1b1)](_0x3ef38f,_0x32699a+0x1),_0x59ddfe=_0x1b65d6,_0x2fc2f4[_0x2d7f58(0x135)](_0x59ddfe),_0x4bcbe8[_0x2d7f58(0x1b1)](_0x4c11f4,_0x59ddfe);const _0x587d63=await resolveRuleSegmentRefs(_0x32016f,async _0x3f0195=>{const _0x1081ea=_0x4bcbe8['get'](_0x3f0195);if(_0x1081ea)return _0x1081ea;const _0x52c18b=await _0x534f1d['resolveSegment'](_0x3f0195);return _0x52c18b['name'];});_0x57e254={'description':_0x32d5ac[_0x2d7f58(0x105)],'rule':_0x587d63};}else{const _0xe5cf7a=_0x5a4ce8['get'](_0x3ef38f);if(_0xe5cf7a)_0x59ddfe=_0xe5cf7a,_0x4bcbe8[_0x2d7f58(0x1b1)](_0x4c11f4,_0x59ddfe);else{if(_0x4a26f4){let _0xde84ba=_0x4a26f4,_0x4ed82d=0x2;while(_0x2fc2f4[_0x2d7f58(0x128)](_0xde84ba)||_0x212189[_0x2d7f58(0x128)](_0xde84ba)){_0xde84ba=_0x4a26f4+'_'+_0x4ed82d,_0x4ed82d++;}_0x2fc2f4['add'](_0xde84ba),_0x59ddfe=_0xde84ba;}_0x4bcbe8[_0x2d7f58(0x1b1)](_0x4c11f4,_0x59ddfe),_0x5a4ce8[_0x2d7f58(0x1b1)](_0x3ef38f,_0x59ddfe);const _0x322b17=await resolveRuleSegmentRefs(_0x32016f,async _0xc8a88e=>{const _0x5e3b70=_0x2d7f58,_0xaff3fa=_0x4bcbe8['get'](_0xc8a88e);if(_0xaff3fa)return _0xaff3fa;const _0x52c696=await _0x534f1d[_0x5e3b70(0x156)](_0xc8a88e);return _0x52c696['name'];});_0x57e254={'description':_0x32d5ac['description'],'rule':_0x322b17};}}}return{'name':_0x59ddfe,'isJourneyLocal':_0x255b5a,'definition':_0x57e254};}catch{return{'name':_0x4c11f4,'isJourneyLocal':![]};}},'resolveActivation':async _0x3914fe=>{const _0x595ecb=a120_0x3afa,_0x5c6ca6=_0x23d809[_0x595ecb(0x1ac)](_0x3914fe);if(_0x5c6ca6!==undefined)return{'name':_0x5c6ca6,'isJourneyLocal':!![]};try{let _0x1df154=_0x43be6d?.['get'](_0x3914fe);!_0x1df154&&(_0x1df154=await _0x33b372[_0x595ecb(0x18a)][_0x595ecb(0x12c)](_0x2d638d,_0x3914fe));const _0x35a12d=_0x1df154[_0x595ecb(0x18e)]['activationParams']['name']||_0x3914fe,_0x55fba4=sanitizeYamlKey(_0x35a12d)||'activation_'+_0x3914fe,_0x3dd468=_0x55fba4;_0x23d809[_0x595ecb(0x1b1)](_0x3914fe,_0x3dd468);const _0x33d556=journeyActivationStepToYaml(_0x1df154,_0x46f8fb,_0x5ddc56);return{'name':_0x3dd468,'isJourneyLocal':!![],'definition':_0x33d556};}catch{return{'name':_0x3914fe,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x306414,_0x42f68d)=>resolveJumpTarget(_0x306414,_0x42f68d,_0x3ecfae,async _0x21405c=>{const _0x13eb5a=a120_0x3afa,_0x196b92=_0x4c1c11?.['get'](_0x21405c);if(_0x196b92)return _0x196b92;return _0x33b372['journey'][_0x13eb5a(0x16d)](_0x21405c);})};return _0x534f1d=_0x2b9e7c,_0x2b9e7c;},_0x1ed2a2=async _0x3a1268=>{const _0x45b918=a120_0x3afa,{collectSegmentIdsFromJourneyApi:_0x5a43b6}=await import('./journey-yaml.js'),{batchAsync:_0x56b00e}=await import('../../utils/async.js'),_0x15b86b=new Set();for(const _0x55f35b of _0x3a1268){let _0x5a0c87=_0x4c1c11?.[_0x45b918(0x1ac)](_0x55f35b);!_0x5a0c87&&(_0x5a0c87=await _0x33b372[_0x45b918(0x18a)]['getJourney'](_0x55f35b));const _0x5109c7=_0x5a43b6(_0x5a0c87);for(const _0x3c201b of _0x5109c7){_0x15b86b['add'](_0x3c201b);}}let _0x1f7616=Array['from'](_0x15b86b);while(_0x1f7616['length']>0x0){const _0x1d70cd=_0x1f7616[_0x45b918(0x1b0)](_0x2f0fb1=>!_0x5771ab['has'](_0x2f0fb1));if(_0x1d70cd['length']===0x0)break;const _0x4ad7f3=await _0x56b00e(_0x1d70cd,async _0x9197b4=>{const _0x1e83b2=_0x45b918;_0x5771ab[_0x1e83b2(0x135)](_0x9197b4);let _0x3db4ec=_0x3e5fa2[_0x1e83b2(0x1ad)](_0x37f688=>_0x37f688['id']===_0x9197b4);if(!_0x3db4ec)try{_0x3db4ec=await _0x33b372[_0x1e83b2(0x19f)][_0x1e83b2(0x185)](_0x26bf3d,_0x9197b4);}catch{return null;}return{'segmentId':_0x9197b4,'segment':_0x3db4ec};},0xa),_0x355768=new Set();for(const _0x23e4eb of _0x4ad7f3){if(!_0x23e4eb?.[_0x45b918(0x19f)]?.['rule'])continue;const _0x779e97=apiRuleToYaml(_0x23e4eb[_0x45b918(0x19f)]['rule']);_0x1d2db9[_0x45b918(0x1b1)](_0x23e4eb[_0x45b918(0x154)],_0x779e97);const _0x57d127=collectSegmentRefsFromRule(_0x779e97);for(const _0x4324b6 of _0x57d127){!_0x5771ab[_0x45b918(0x128)](_0x4324b6)&&_0x355768[_0x45b918(0x135)](_0x4324b6);}}_0x1f7616=Array[_0x45b918(0x14e)](_0x355768);}};return{'createYamlContext':_0x58fe02,'prefetchJourneySegments':_0x1ed2a2};}export async function executePushSegments(_0x4293a9,_0x151bb7,_0x8f1f5f,_0x236cad,_0x109a73){const _0x18e6bc=a120_0x448e68,{segmentDefToCreateRequest:_0x156cf6,segmentDefToUpdateRequest:_0x1e0c64}=await import(_0x18e6bc(0x14a)),_0x9449e=_0x8f1f5f[_0x18e6bc(0x14d)],_0x529243=0x5,_0x5d854f=async _0x323822=>{const _0x2471dc=_0x18e6bc,_0x4f4b88=_0x323822[_0x2471dc(0x172)]?_0x9449e[_0x2471dc(0x1ac)](_0x323822[_0x2471dc(0x172)]):undefined;let _0x237186;const _0x1443ad={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x323822[_0x2471dc(0x14b)]){_0x109a73[_0x2471dc(0x151)]?.({'type':'segment_creating','name':_0x323822[_0x2471dc(0x11a)]['name']});const _0x4aec93=_0x156cf6(_0x323822[_0x2471dc(0x11a)],_0x4f4b88),_0x294f0f=await _0x109a73['withProgress'](_0x2471dc(0x174)+_0x323822[_0x2471dc(0x11a)][_0x2471dc(0x16a)]+_0x2471dc(0x1b9),()=>_0x4293a9[_0x2471dc(0x19f)][_0x2471dc(0x1a4)](_0x236cad[_0x2471dc(0x197)],_0x4aec93));_0x237186=_0x294f0f['data']['id'],_0x1443ad[_0x2471dc(0x1a2)]={'name':_0x323822['yamlConfig'][_0x2471dc(0x16a)],'id':_0x237186},_0x109a73['onProgress']?.({'type':_0x2471dc(0x13e),'name':_0x323822[_0x2471dc(0x11a)][_0x2471dc(0x16a)],'segmentId':_0x237186}),_0x109a73[_0x2471dc(0x182)]?.(_0x2471dc(0x1d5)+_0x323822['yamlConfig']['name']+'\x27'),_0x1443ad[_0x2471dc(0x102)]=0x1;}else{if(_0x323822[_0x2471dc(0x1ae)]){_0x109a73['onProgress']?.({'type':_0x2471dc(0x100),'name':_0x323822['yamlConfig'][_0x2471dc(0x16a)]});const _0x15e1e8=_0x1e0c64(_0x323822['yamlConfig']);_0x4f4b88!==_0x323822[_0x2471dc(0x10e)]?.[_0x2471dc(0x192)]&&(_0x15e1e8[_0x2471dc(0x192)]=_0x4f4b88?parseInt(_0x4f4b88,0xa):undefined),await _0x109a73['withProgress'](_0x2471dc(0x157)+_0x323822['yamlConfig'][_0x2471dc(0x16a)]+_0x2471dc(0x1b9),()=>_0x4293a9['segment']['updateSegmentById'](_0x236cad[_0x2471dc(0x197)],_0x323822[_0x2471dc(0x10e)]['id'],_0x15e1e8)),_0x237186=_0x323822[_0x2471dc(0x10e)]['id'],_0x109a73[_0x2471dc(0x151)]?.({'type':_0x2471dc(0x158),'name':_0x323822[_0x2471dc(0x11a)]['name']}),_0x109a73[_0x2471dc(0x182)]?.(_0x2471dc(0x1ab)+_0x323822[_0x2471dc(0x11a)]['name']+'\x27'),_0x1443ad[_0x2471dc(0x16f)]=0x1;}else _0x237186=_0x323822[_0x2471dc(0x10e)]['id'];}}catch(_0x2c7622){const _0x1c8642=isHttp400Error(_0x2c7622),_0x151791=_0x1c8642?ErrorCode[_0x2471dc(0x125)]:ErrorCode[_0x2471dc(0x149)],_0x5c7c88=getErrorMessage(_0x2c7622);throw new SDKError(_0x151791,_0x2471dc(0x1af)+(_0x323822['isNew']?_0x2471dc(0x110):'update')+_0x2471dc(0x1d1)+_0x323822[_0x2471dc(0x137)]+'\x0a\x20\x20'+_0x5c7c88,_0x2c7622);}try{const _0xc6c341=await syncActivationsForSegment(_0x4293a9,_0x236cad[_0x2471dc(0x197)],_0x237186,_0x323822[_0x2471dc(0x11a)][_0x2471dc(0x16a)],_0x323822[_0x2471dc(0xfa)],_0x109a73,_0x323822[_0x2471dc(0x137)]);_0x1443ad[_0x2471dc(0x132)]=_0xc6c341;}catch(_0x251b0b){if(_0x251b0b instanceof SDKError)throw _0x251b0b;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x323822['yamlConfig']['name']+_0x2471dc(0x17c)+_0x323822[_0x2471dc(0x137)]+'\x0a\x20\x20'+getErrorMessage(_0x251b0b),_0x251b0b);}return _0x1443ad;},_0x310633=await batchAsync(_0x151bb7,_0x5d854f,_0x529243),_0x527d1b={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x26c338 of _0x310633){_0x527d1b[_0x18e6bc(0x102)]+=_0x26c338['created'],_0x527d1b[_0x18e6bc(0x16f)]+=_0x26c338[_0x18e6bc(0x16f)],_0x26c338[_0x18e6bc(0x1a2)]&&_0x527d1b[_0x18e6bc(0x1c0)][_0x18e6bc(0x1b1)](_0x26c338[_0x18e6bc(0x1a2)][_0x18e6bc(0x16a)],_0x26c338[_0x18e6bc(0x1a2)]['id']),_0x527d1b[_0x18e6bc(0x132)][_0x18e6bc(0x102)]+=_0x26c338[_0x18e6bc(0x132)][_0x18e6bc(0x102)],_0x527d1b['activations']['updated']+=_0x26c338[_0x18e6bc(0x132)][_0x18e6bc(0x16f)],_0x527d1b['activations'][_0x18e6bc(0x1c5)]+=_0x26c338[_0x18e6bc(0x132)]['deleted'];}return _0x527d1b;}async function syncActivationsForSegment(_0x58695b,_0x265bdc,_0x55aaaa,_0x420654,_0x52a45a,_0x2f34d4,_0xae7653){const _0x106d68=a120_0x448e68,_0x16d0b8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xb51e5b of _0x52a45a){try{if(_0xb51e5b[_0x106d68(0x183)]===_0x106d68(0x110)&&_0xb51e5b[_0x106d68(0x180)])_0x2f34d4[_0x106d68(0x151)]?.({'type':'activation_creating','segmentName':_0x420654,'activationName':_0xb51e5b[_0x106d68(0x16a)]}),await _0x2f34d4[_0x106d68(0x170)]('Creating\x20activation\x20\x27'+_0xb51e5b[_0x106d68(0x16a)]+_0x106d68(0x1b9),()=>_0x58695b[_0x106d68(0x19f)][_0x106d68(0x198)](_0x265bdc,_0x55aaaa,_0xb51e5b['validatedRequest'])),_0x2f34d4[_0x106d68(0x151)]?.({'type':_0x106d68(0x142),'segmentName':_0x420654,'activationName':_0xb51e5b[_0x106d68(0x16a)]}),_0x2f34d4[_0x106d68(0x182)]?.(_0x106d68(0x10d)+_0xb51e5b[_0x106d68(0x16a)]+'\x27'),_0x16d0b8['created']++;else{if(_0xb51e5b[_0x106d68(0x183)]===_0x106d68(0x1ce)&&_0xb51e5b[_0x106d68(0x180)]&&_0xb51e5b[_0x106d68(0xfc)])_0x2f34d4[_0x106d68(0x151)]?.({'type':_0x106d68(0x199),'segmentName':_0x420654,'activationName':_0xb51e5b[_0x106d68(0x16a)]}),await _0x2f34d4[_0x106d68(0x170)]('Updating\x20activation\x20\x27'+_0xb51e5b[_0x106d68(0x16a)]+'\x27...',()=>_0x58695b[_0x106d68(0x19f)]['updateActivation'](_0x265bdc,_0x55aaaa,_0xb51e5b[_0x106d68(0xfc)]['id'],_0xb51e5b[_0x106d68(0x180)])),_0x2f34d4[_0x106d68(0x151)]?.({'type':'activation_updated','segmentName':_0x420654,'activationName':_0xb51e5b[_0x106d68(0x16a)]}),_0x2f34d4[_0x106d68(0x182)]?.('Updated\x20activation\x20\x27'+_0xb51e5b['name']+'\x27'),_0x16d0b8['updated']++;else _0xb51e5b[_0x106d68(0x183)]===_0x106d68(0x177)&&_0xb51e5b[_0x106d68(0xfc)]&&(_0x2f34d4['onProgress']?.({'type':_0x106d68(0x119),'segmentName':_0x420654,'activationName':_0xb51e5b['name']}),await _0x2f34d4['withProgress'](_0x106d68(0x123)+_0xb51e5b[_0x106d68(0x16a)]+_0x106d68(0x1b9),()=>_0x58695b[_0x106d68(0x19f)][_0x106d68(0x1c4)](_0x265bdc,_0x55aaaa,_0xb51e5b['existingActivation']['id'])),_0x2f34d4[_0x106d68(0x151)]?.({'type':_0x106d68(0x12d),'segmentName':_0x420654,'activationName':_0xb51e5b['name']}),_0x2f34d4['logDeleted']?.(_0x106d68(0x19e)+_0xb51e5b['name']+'\x27'),_0x16d0b8[_0x106d68(0x1c5)]++);}}catch(_0x97ffda){const _0x426e83=isHttp400Error(_0x97ffda),_0x1f8b66=_0x426e83?ErrorCode[_0x106d68(0x1a3)]:ErrorCode[_0x106d68(0x176)],_0x46b64e=getErrorMessage(_0x97ffda);throw new SDKError(_0x1f8b66,_0x106d68(0x1af)+_0xb51e5b[_0x106d68(0x183)]+_0x106d68(0x104)+_0xb51e5b[_0x106d68(0x16a)]+_0x106d68(0x17c)+_0xae7653+_0x106d68(0x160)+_0x46b64e,_0x97ffda);}}return _0x16d0b8;}export async function executePushFolders(_0x56049f,_0xc1b15b,_0x257802,_0x37726b,_0x2bfb95){const _0x146d77=a120_0x448e68,_0x299a5a=new Map(_0x257802);for(const _0x5ca7a3 of _0xc1b15b){const _0x1463fd=_0x5ca7a3['split']('/'),_0x25fda7=_0x1463fd[_0x1463fd['length']-0x1],_0x990288=_0x1463fd[_0x146d77(0x112)](0x0,-0x1)['join']('/'),_0x37a361=_0x299a5a['get'](_0x990288);_0x2bfb95['onProgress']?.({'type':_0x146d77(0x103),'folder':_0x5ca7a3});const _0x36d79c={'name':_0x25fda7,'parentFolderId':_0x37a361},_0x37eb79=await _0x2bfb95[_0x146d77(0x170)]('Creating\x20folder\x20\x27'+_0x5ca7a3+_0x146d77(0x1b9),()=>_0x56049f[_0x146d77(0x19f)][_0x146d77(0x144)](_0x37726b['parentId'],_0x36d79c));_0x299a5a[_0x146d77(0x1b1)](_0x5ca7a3,_0x37eb79[_0x146d77(0x13b)]['id']),_0x2bfb95['onProgress']?.({'type':_0x146d77(0x1be),'folder':_0x5ca7a3,'folderId':_0x37eb79[_0x146d77(0x13b)]['id']}),_0x2bfb95[_0x146d77(0x10f)]?.(_0x146d77(0x1aa)+_0x5ca7a3+'\x27');}return _0x299a5a;}export async function executePushSegmentDeletions(_0x10f58c,_0x26ec39,_0x1b5e64){const _0x45705e=a120_0x448e68;if(_0x26ec39[_0x45705e(0x190)]===0x0)return 0x0;const {batchAsync:_0x6b22cf}=await import(_0x45705e(0x114)),_0x20d7b9=0x5,_0xe2260d=await _0x6b22cf(_0x26ec39,async _0x191322=>{const _0x35abd3=_0x45705e;return _0x1b5e64['onProgress']?.({'type':'segment_deleting','name':_0x191322[_0x35abd3(0x16a)]}),await _0x10f58c[_0x35abd3(0x19f)][_0x35abd3(0x136)](_0x191322['id']),_0x1b5e64[_0x35abd3(0x151)]?.({'type':_0x35abd3(0x178),'name':_0x191322[_0x35abd3(0x16a)]}),_0x1b5e64[_0x35abd3(0x1d7)]?.(_0x35abd3(0x1b4)+_0x191322[_0x35abd3(0x16a)]+'\x27'),0x1;},_0x20d7b9);return _0xe2260d['reduce']((_0x3a138f,_0x21b59d)=>_0x3a138f+_0x21b59d,0x0);}function a120_0x2827(){const _0xc95412=['created','folder_creating','\x20activation\x20\x27','description','schedule','embedded_activation_creating','\x27\x20exit\x20criteria','valid','existingJourney','utf-8','deps','Created\x20activation\x20\x27','existingSegment','logInfo','create','columns','slice','yamlActivation','../../utils/async.js','stringify','goal\x20criteria','INTERNAL','toLowerCase','activation_deleting','yamlConfig','listActivations','size','behavior','includes','40236354nNYTJT','connectionIdToNameMap','embedded_segment_creating','\x27\x20milestone','Deleting\x20activation\x20\x27','activationStepsById','SEGMENT_SYNTAX_ERROR','connector_config','join','has','1227792WZuQQT','existingSegments','journey_updating','getActivation','activation_deleted','entryCriteria','activationContext','folder','sort','activations','WaitStep','milestone','add','deleteSegment','absolutePath','message','5699400NNuUxZ','\x27\x20wait\x20condition','data','8197qSpNlk','kind','segment_created','resolveJourneyId','3419787ddwRfC','diff','activation_created','3699125oAdmzJ','createFolder','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','idToEmailMap','parse',').\x20','SEGMENT_UPDATE_ERROR','./child-segment-yaml.js','isNew','rule','folderPathToId','from','DecisionPoint','toString','onProgress','null','embeddedSegmentNameToId','segmentId','relative','resolveSegment','Updating\x20segment\x20\x27','segment_updated','item','rootFolderId','steps','journey_created','JOURNEY_SYNTAX_ERROR','index','segmentNameToId','\x0a\x20\x20','Activation\x20not\x20found:\x20','with','Name\x20has\x20already\x20been\x20taken','effectiveFolderId','NOT_FOUND','__pending_act_','parentFolder','embedded_activation_created','buildUserMaps','name','startsWith','journeys','getJourney','localSegmentRules','updated','withProgress','idToName','folderPath','action','Creating\x20segment\x20\x27','Fetching\x20','ACTIVATION_UPDATE_ERROR','delete','segment_deleted','waitCondition','flatMap','verbose','\x27\x20from\x20file:\x20','journeyStages','state','results','validatedRequest','journeyActivationStepId','logSuccess','type','trim','getSegment','folderId','split','journey_creating','goal','journey','createJourneySegment','segmentByFolderAndName','Stage\x20\x27','attributes','dirname','length','stages','segmentFolderId','all','all_columns','Updated\x20journey\x20\x27','map','parentId','createActivation','activation_updating','updateSegmentById','parseDocument','__pending_','isArray','Deleted\x20activation\x20\x27','segment','logWarning','connection','createdSegmentId','ACTIVATION_SYNTAX_ERROR','createSegment','replace','Segment\x20not\x20found:\x20','\x20journey\x20from\x20file:\x20','journeyById','entry_criteria','Created\x20folder\x20\x27','Updated\x20segment\x20\x27','get','find','hasChanges','Failed\x20to\x20','filter','set','journeyBundlesByFolderAndName','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Deleted\x20segment\x20\x27','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','max','keys','\x27...','list','push','fetchJourney','\x27\x20not\x20found\x20in\x20journey\x20\x27','folder_created','activation_template_id','createdSegmentIds','relationships','notification','activationsBySegmentId','deleteActivation','deleted','\x27\x20decision\x20point\x20branch\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','unchanged','segments','progress','skipSegments','parentSegmentFolder','2008cNlPlT','update','2hvPhhW','6001854rZVdmr','\x20segment\x20from\x20file:\x20','branches','Activation','embedded_segment_created','Created\x20segment\x20\x27','values','logDeleted','activationActions','object','existingActivation','Entry\x20criteria:\x20','journeyId','stage\x20\x27','segment_updating','versionNumber'];a120_0x2827=function(){return _0xc95412;};return a120_0x2827();}function a120_0x3afa(_0xe82ae8,_0x70f7ec){_0xe82ae8=_0xe82ae8-0xfa;const _0x2827f8=a120_0x2827();let _0x3afa37=_0x2827f8[_0xe82ae8];return _0x3afa37;}export async function executePushJourneys(_0x23a077,_0x3e0765,_0x1f7f21,_0x42385a,_0x4dd8f5){const _0x1c18e1=a120_0x448e68,{journeyDefToRequest:_0x524909}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x1da967,yamlRuleToApi:_0x18af99,validateSegmentRule:_0x56b374}=await import(_0x1c18e1(0x14a)),_0x3c308f={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4727bb=new Map(_0x1f7f21[_0x1c18e1(0x15f)]),_0x122c7f=0x5;for(let _0xd1a6bb=0x0;_0xd1a6bb<_0x3e0765[_0x1c18e1(0x190)];_0xd1a6bb+=_0x122c7f){const _0x465ac7=_0x3e0765[_0x1c18e1(0x112)](_0xd1a6bb,_0xd1a6bb+_0x122c7f),_0x36becc=await Promise['all'](_0x465ac7[_0x1c18e1(0x196)](async _0x502ffe=>{const _0x475849=_0x1c18e1;if(!_0x502ffe[_0x475849(0x14b)]&&!_0x502ffe[_0x475849(0x1ae)])return{'action':_0x475849(0x1c8),'name':_0x502ffe[_0x475849(0x11a)][_0x475849(0x16a)],'journeyId':_0x502ffe[_0x475849(0x10a)]?.['id']};const _0x160a20=_0x502ffe[_0x475849(0x172)]?_0x1f7f21['folderPathToId']['get'](_0x502ffe[_0x475849(0x172)]):undefined;_0x4dd8f5[_0x475849(0x151)]?.({'type':_0x502ffe['isNew']?_0x475849(0x188):_0x475849(0x12b),'name':_0x502ffe[_0x475849(0x11a)][_0x475849(0x16a)]});try{const _0x1f4df9=await executeSingleJourneyPush(_0x23a077,_0x502ffe,{..._0x1f7f21,'segmentNameToId':_0x4727bb},{'parentId':_0x42385a[_0x475849(0x197)],'rootFolderId':_0x42385a[_0x475849(0x15a)],'folderId':_0x160a20,'verbose':_0x42385a[_0x475849(0x17b)]},_0x4dd8f5,{'journeyDefToRequest':_0x524909,'activationDefToCreateRequest':_0x1da967,'yamlRuleToApi':_0x18af99,'validateSegmentRule':_0x56b374});for(const [_0x503fb8,_0x94a4d]of _0x1f4df9[_0x475849(0x153)]){_0x4727bb['set'](_0x503fb8,_0x94a4d),_0x3c308f[_0x475849(0x153)][_0x475849(0x1b1)](_0x503fb8,_0x94a4d);}if(_0x1f4df9['action']==='created')_0x4dd8f5[_0x475849(0x151)]?.({'type':_0x475849(0x15c),'name':_0x502ffe[_0x475849(0x11a)]['name'],'journeyId':_0x1f4df9[_0x475849(0xfe)]}),_0x4dd8f5['logSuccess']?.('Created\x20journey\x20\x27'+_0x502ffe[_0x475849(0x11a)][_0x475849(0x16a)]+'\x27'),_0x3c308f[_0x475849(0x102)]++;else _0x1f4df9[_0x475849(0x173)]===_0x475849(0x16f)&&(_0x4dd8f5[_0x475849(0x151)]?.({'type':'journey_updated','name':_0x502ffe[_0x475849(0x11a)]['name']}),_0x4dd8f5['logSuccess']?.(_0x475849(0x195)+_0x502ffe[_0x475849(0x11a)][_0x475849(0x16a)]+'\x27'),_0x3c308f[_0x475849(0x16f)]++);return{'action':_0x1f4df9[_0x475849(0x173)],'name':_0x502ffe[_0x475849(0x11a)][_0x475849(0x16a)],'journeyId':_0x1f4df9['journeyId']};}catch(_0x261ee5){const _0x535144=isHttp400Error(_0x261ee5),_0x5879ec=_0x535144?ErrorCode[_0x475849(0x15d)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x29361b=getErrorMessage(_0x261ee5);throw new SDKError(_0x5879ec,'Failed\x20to\x20'+(_0x502ffe[_0x475849(0x14b)]?_0x475849(0x110):_0x475849(0x1ce))+_0x475849(0x1a7)+_0x502ffe[_0x475849(0x137)]+'\x0a\x20\x20'+_0x29361b,_0x261ee5);}}));_0x3c308f[_0x1c18e1(0x17f)][_0x1c18e1(0x1bb)](..._0x36becc);}return _0x3c308f;}async function executeSingleJourneyPush(_0x505633,_0x265c97,_0x1e4399,_0x2ca91d,_0x53a06d,_0x23bd70){const _0xd7a8f2=a120_0x448e68,{journeyDefToRequest:_0x225850,activationDefToCreateRequest:_0x2a3f34,yamlRuleToApi:_0x2c4aba,validateSegmentRule:_0x337965}=_0x23bd70,_0x2cc799=new Map(),_0x136f2d=new Map(),_0xa1e8eb=new Map(),_0x398431=new Map(),_0x26113a=new Map();let _0x22a7dd;const _0xb55e4e=async()=>{const _0x23873e=a120_0x3afa;if(_0x22a7dd)return;_0x22a7dd=new Map();if(!_0x265c97['existingJourney'])return;const _0x5795de=await _0x505633[_0x23873e(0x18a)][_0x23873e(0x11b)](_0x265c97['existingJourney']['id']);for(const _0x33d609 of _0x5795de){const _0x564d09=journeyActivationStepToYaml(_0x33d609,_0x1e4399[_0x23873e(0x146)],_0x1e4399[_0x23873e(0x120)]),_0x2840bb=activationSignature(_0x564d09);!_0x22a7dd[_0x23873e(0x128)](_0x2840bb)&&_0x22a7dd[_0x23873e(0x1b1)](_0x2840bb,_0x33d609['id']),_0x564d09[_0x23873e(0x16a)]&&_0x136f2d['set'](_0x564d09[_0x23873e(0x16a)],_0x33d609['id']);}};if(_0x265c97[_0xd7a8f2(0x10a)]&&_0x265c97['yamlConfig'][_0xd7a8f2(0x1c9)]){const _0x2f34d2=buildLocalExpandedRuleMappings(_0x265c97[_0xd7a8f2(0x11a)]),_0x31d335=_0x2f34d2[_0xd7a8f2(0x16e)];if(_0x31d335[_0xd7a8f2(0x11c)]>0x0){const _0x9c13e4=new Map();for(const [_0x5415e2,_0x10559a]of _0x31d335){const _0x267061=serializeExpandedRule(_0x10559a,_0x31d335);_0x9c13e4[_0xd7a8f2(0x1b1)](_0x5415e2,_0x267061);}const _0x26d4ec=collectSegmentIdsFromJourneyApi(_0x265c97['existingJourney']);if(_0x26d4ec[_0xd7a8f2(0x11c)]>0x0){const _0x590c80=await buildServerSegmentRuleMap(_0x505633,_0x2ca91d['parentId'],_0x1e4399[_0xd7a8f2(0x12a)],_0x26d4ec);if(_0x590c80[_0xd7a8f2(0x11c)]>0x0){const _0x59304d=new Map();for(const [_0x979710,_0x84d6a0]of _0x590c80){const _0x26d08a=serializeExpandedRule(_0x84d6a0,_0x590c80);!_0x59304d[_0xd7a8f2(0x128)](_0x26d08a)&&_0x59304d[_0xd7a8f2(0x1b1)](_0x26d08a,_0x979710);}for(const [_0x51a4fe,_0x1a1025]of _0x9c13e4){const _0xf24c6c=_0x59304d[_0xd7a8f2(0x1ac)](_0x1a1025);_0xf24c6c&&(_0x26113a[_0xd7a8f2(0x1b1)](_0x51a4fe,_0xf24c6c),_0x1e4399[_0xd7a8f2(0x15f)][_0xd7a8f2(0x1b1)](_0x51a4fe,_0xf24c6c));}}}}}const _0x323886={'resolveSegmentId':async _0x37e52b=>{const _0x22cd50=_0xd7a8f2,_0x25ccc2=_0x1e4399[_0x22cd50(0x15f)][_0x22cd50(0x1ac)](_0x37e52b);if(!_0x25ccc2)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x22cd50(0x1a6)+_0x37e52b+'\x20(referenced\x20in\x20journey\x20'+_0x265c97['yamlConfig']['name']+')');return _0x25ccc2;},'resolveEmbeddedSegmentId':async(_0x45aaa6,_0x15f9ef)=>{const _0x1a4159=_0xd7a8f2,_0x291f18=_0x1e4399[_0x1a4159(0x15f)]['get'](_0x45aaa6);if(_0x291f18)return _0x291f18;const _0x2ba0dc=_0x26113a[_0x1a4159(0x1ac)](_0x45aaa6);if(_0x2ba0dc)return _0x1e4399[_0x1a4159(0x15f)][_0x1a4159(0x1b1)](_0x45aaa6,_0x2ba0dc),_0x2ba0dc;const _0x2142db=_0x1e4399['existingSegments']['find'](_0x2fa5a7=>_0x2fa5a7[_0x1a4159(0x16a)]===_0x45aaa6);if(_0x2142db)return _0x1e4399[_0x1a4159(0x15f)]['set'](_0x45aaa6,_0x2142db['id']),_0x2142db['id'];if(_0x265c97[_0x1a4159(0x14b)]){const {stageName:_0x209af9,criteriaName:_0x2c0c8f}=findSegmentCriteriaLocation(_0x265c97[_0x1a4159(0x11a)],_0x45aaa6);return _0x337965(_0x45aaa6,_0x15f9ef[_0x1a4159(0x14c)]),_0xa1e8eb[_0x1a4159(0x1b1)](_0x45aaa6,{'definition':_0x15f9ef,'stageName':_0x209af9,'criteriaName':_0x2c0c8f}),createPendingSegmentId(_0x45aaa6);}const _0x36341c=_0x265c97[_0x1a4159(0x10a)]?.['id'];if(!_0x36341c)throw new SDKError(ErrorCode[_0x1a4159(0x117)],_0x1a4159(0x1c7));_0x337965(_0x45aaa6,_0x15f9ef[_0x1a4159(0x14c)]);const _0x798214=generateDeterministicJourneySegmentName(_0x265c97[_0x1a4159(0x11a)][_0x1a4159(0x16a)],_0x45aaa6),_0x55034f=_0x1e4399[_0x1a4159(0x12a)][_0x1a4159(0x1ad)](_0x3fd3f7=>_0x3fd3f7[_0x1a4159(0x16a)]===_0x798214),_0x1df901=createSegmentIdResolver(_0x1e4399[_0x1a4159(0x15f)],_0x45aaa6),_0x1f80e1=await resolveRuleSegmentIds(_0x15f9ef['rule'],_0x1df901);let _0x580dfd;if(_0x55034f)await _0x505633[_0x1a4159(0x19f)][_0x1a4159(0x19a)](_0x2ca91d['parentId'],_0x55034f['id'],{'description':_0x15f9ef['description']||'Entry\x20criteria:\x20'+_0x45aaa6,'rule':_0x2c4aba(_0x1f80e1,!![]),'countPopulation':!![]}),_0x580dfd=_0x55034f['id'];else try{_0x580dfd=await _0x505633[_0x1a4159(0x19f)][_0x1a4159(0x18b)]({'name':_0x798214,'description':_0x15f9ef['description']||_0x1a4159(0xfd)+_0x45aaa6,'journeyId':_0x36341c,'rule':_0x2c4aba(_0x1f80e1,!![]),'countPopulation':!![],'parentFolderId':_0x2ca91d['rootFolderId']||'','audienceId':_0x2ca91d[_0x1a4159(0x197)]});}catch(_0x5a9a4e){const _0x54571b=_0x5a9a4e instanceof Error&&_0x5a9a4e[_0x1a4159(0x138)][_0x1a4159(0x11e)](_0x1a4159(0x163));if(_0x54571b){const _0x3e1ae6=await _0x505633[_0x1a4159(0x19f)]['listSegments'](_0x2ca91d[_0x1a4159(0x197)]),_0x4a62ab=_0x3e1ae6[_0x1a4159(0x1ad)](_0x25660f=>_0x25660f[_0x1a4159(0x16a)]===_0x798214);if(_0x4a62ab)await _0x505633[_0x1a4159(0x19f)][_0x1a4159(0x19a)](_0x2ca91d[_0x1a4159(0x197)],_0x4a62ab['id'],{'description':_0x15f9ef[_0x1a4159(0x105)]||_0x1a4159(0xfd)+_0x45aaa6,'rule':_0x2c4aba(_0x1f80e1,!![]),'countPopulation':!![]}),_0x580dfd=_0x4a62ab['id'];else throw _0x5a9a4e;}else throw _0x5a9a4e;}return _0x1e4399[_0x1a4159(0x15f)][_0x1a4159(0x1b1)](_0x45aaa6,_0x580dfd),_0x2cc799[_0x1a4159(0x1b1)](_0x45aaa6,_0x580dfd),_0x580dfd;},'resolveActivationId':async _0x235946=>{const _0x51432e=_0xd7a8f2,_0x5c68a5=_0x136f2d[_0x51432e(0x1ac)](_0x235946);if(_0x5c68a5)return _0x5c68a5;if(_0x265c97[_0x51432e(0x10a)]){await _0xb55e4e();const _0x515d24=_0x136f2d['get'](_0x235946);if(_0x515d24)return _0x515d24;}throw new SDKError(ErrorCode[_0x51432e(0x165)],_0x51432e(0x161)+_0x235946+'\x20(referenced\x20in\x20journey\x20'+_0x265c97[_0x51432e(0x11a)][_0x51432e(0x16a)]+_0x51432e(0x148)+_0x51432e(0x1b6));},'resolveEmbeddedActivationId':async(_0x49f918,_0x23947d)=>{const _0xc2d536=_0xd7a8f2,_0x3846bf=_0x136f2d[_0xc2d536(0x1ac)](_0x49f918);if(_0x3846bf)return _0x3846bf;if(_0x265c97['isNew'])return _0x398431[_0xc2d536(0x1b1)](_0x49f918,_0x23947d),createPendingActivationId(_0x49f918);if(_0x265c97[_0xc2d536(0x10a)]){await _0xb55e4e();const _0x401def=_0x136f2d['get'](_0x23947d[_0xc2d536(0x16a)]);if(_0x401def)return _0x136f2d[_0xc2d536(0x1b1)](_0x49f918,_0x401def),_0x401def;const _0x3d1f9e=activationSignature(_0x23947d),_0x359430=_0x22a7dd?.[_0xc2d536(0x1ac)](_0x3d1f9e);if(_0x359430)return _0x136f2d[_0xc2d536(0x1b1)](_0x49f918,_0x359430),_0x359430;const _0x579830=await _0x2a3f34(_0x23947d,_0x1e4399[_0xc2d536(0x12f)]),_0x210e85=await _0x505633[_0xc2d536(0x18a)][_0xc2d536(0x198)](_0x265c97[_0xc2d536(0x10a)]['id'],_0x579830);return _0x136f2d[_0xc2d536(0x1b1)](_0x49f918,_0x210e85['id']),_0x210e85['id'];}throw new SDKError(ErrorCode[_0xc2d536(0x117)],_0xc2d536(0x1b3));},'resolveJourneyId':async _0x102411=>{const _0xdac7e0=_0xd7a8f2;try{return await _0x505633[_0xdac7e0(0x18a)][_0xdac7e0(0x13f)](_0x2ca91d[_0xdac7e0(0x197)],_0x102411);}catch(_0x4c1d2e){throw new SDKError(ErrorCode[_0xdac7e0(0x165)],'Journey\x20\x27'+_0x102411+_0xdac7e0(0x1b5)+_0x265c97[_0xdac7e0(0x11a)]['name']+'\x27)',_0x4c1d2e);}},'resolveStageId':async(_0x48ef3c,_0x364647)=>{const _0x3b5d16=_0xd7a8f2,_0x2fd2dc=await _0x505633['journey'][_0x3b5d16(0x16d)](_0x48ef3c),_0x59aeeb=_0x2fd2dc[_0x3b5d16(0x18e)][_0x3b5d16(0x17d)]['find'](_0x282c34=>_0x282c34[_0x3b5d16(0x16a)][_0x3b5d16(0x118)]()===_0x364647['toLowerCase']());if(!_0x59aeeb?.['id'])throw new SDKError(ErrorCode[_0x3b5d16(0x165)],_0x3b5d16(0x18d)+_0x364647+_0x3b5d16(0x1bd)+(_0x2fd2dc['attributes']['journeyBundleName']||_0x2fd2dc[_0x3b5d16(0x18e)][_0x3b5d16(0x16a)])+'\x27');return _0x59aeeb['id'];}},_0x5b8a5b=await _0x225850(_0x265c97[_0xd7a8f2(0x11a)],_0x2ca91d['parentId'],_0x323886),_0x4f933c=_0x2ca91d[_0xd7a8f2(0x186)]||_0x2ca91d[_0xd7a8f2(0x15a)];_0x4f933c&&(_0x5b8a5b[_0xd7a8f2(0x1c1)]={'parentFolder':{'data':{'id':_0x4f933c,'type':_0xd7a8f2(0x130)}}});if(_0x265c97[_0xd7a8f2(0x14b)]){if(_0xa1e8eb[_0xd7a8f2(0x11c)]>0x0||_0x398431[_0xd7a8f2(0x11c)]>0x0)return await executeThreeStepJourneyCreate(_0x505633,_0x265c97,_0x5b8a5b,{'pendingEmbeddedSegments':_0xa1e8eb,'pendingEmbeddedActivations':_0x398431,'embeddedSegmentNameToId':_0x2cc799,'journeyActivationNameToId':_0x136f2d},{..._0x2ca91d,'effectiveFolderId':_0x4f933c},_0x1e4399,_0x53a06d,_0x23bd70);else{ensureJourneyDefaults(_0x5b8a5b[_0xd7a8f2(0x18e)]);const _0x556756=await _0x505633['journey'][_0xd7a8f2(0x110)](_0x5b8a5b);return{'action':_0xd7a8f2(0x102),'journeyId':_0x556756['id'],'embeddedSegmentNameToId':_0x2cc799};}}else{if(_0x265c97[_0xd7a8f2(0x1ae)]&&_0x265c97[_0xd7a8f2(0x10a)])return ensureJourneyDefaults(_0x5b8a5b[_0xd7a8f2(0x18e)]),await _0x505633[_0xd7a8f2(0x18a)][_0xd7a8f2(0x1ce)](_0x265c97[_0xd7a8f2(0x10a)]['id'],_0x5b8a5b),{'action':_0xd7a8f2(0x16f),'journeyId':_0x265c97[_0xd7a8f2(0x10a)]['id'],'embeddedSegmentNameToId':_0x2cc799};}return{'action':_0xd7a8f2(0x1c8),'journeyId':_0x265c97[_0xd7a8f2(0x10a)]?.['id'],'embeddedSegmentNameToId':_0x2cc799};}function findSegmentCriteriaLocation(_0x3b77b2,_0x555363){const _0x369fc3=a120_0x448e68,_0xb929e7=_0x3b77b2['stages']||_0x3b77b2[_0x369fc3(0x16c)]?.[0x0]?.[_0x369fc3(0x191)]||[];let _0x2beb6f='entry',_0x1b9909=_0x555363;const _0x529d87=_0x3b77b2['goal']||_0x3b77b2[_0x369fc3(0x16c)]?.[0x0]?.['goal'];if(_0x529d87?.[_0x369fc3(0x19f)]===_0x555363)return{'stageName':'goal','criteriaName':_0x529d87[_0x369fc3(0x16a)]||_0x555363};_0x20040d:for(const _0xbb5f6c of _0xb929e7){if(_0xbb5f6c[_0x369fc3(0x1a9)]?.[_0x369fc3(0x19f)]===_0x555363){_0x2beb6f=_0xbb5f6c['name'],_0x1b9909=_0xbb5f6c[_0x369fc3(0x1a9)][_0x369fc3(0x16a)]||_0x555363;break;}if(_0xbb5f6c[_0x369fc3(0x15b)])for(const _0x152737 of _0xbb5f6c[_0x369fc3(0x15b)]){if(_0x152737['type']==='decision_point'&&_0x152737[_0x369fc3(0x162)]?.['branches'])for(const _0x431984 of _0x152737[_0x369fc3(0x162)][_0x369fc3(0x1d2)]){if(_0x431984['segment']===_0x555363){_0x2beb6f=_0xbb5f6c[_0x369fc3(0x16a)],_0x1b9909=_0x431984[_0x369fc3(0x16a)]||_0x555363;break _0x20040d;}}}}return{'stageName':_0x2beb6f,'criteriaName':_0x1b9909};}async function executeThreeStepJourneyCreate(_0x37b95f,_0x396e37,_0x2fa099,_0x4aedb4,_0x5c25b4,_0x3cb258,_0x565925,_0x52373b){const _0x4dd9f5=a120_0x448e68,{activationDefToCreateRequest:_0x3d8bed,yamlRuleToApi:_0x1bf723}=_0x52373b,{pendingEmbeddedSegments:_0x96d924,pendingEmbeddedActivations:_0x51a1e2,embeddedSegmentNameToId:_0x486880}=_0x4aedb4,_0x340edd=JSON[_0x4dd9f5(0x147)](JSON[_0x4dd9f5(0x115)](_0x2fa099));ensureJourneyDefaults(_0x340edd[_0x4dd9f5(0x18e)]),stripPendingIds(_0x340edd);const _0x30aa6b=await _0x37b95f[_0x4dd9f5(0x18a)][_0x4dd9f5(0x110)](_0x340edd),_0x519a3d=_0x30aa6b['id'],_0x536f2a=new Map();for(const _0x4ace8e of _0x30aa6b[_0x4dd9f5(0x18e)]['journeyStages']){_0x536f2a[_0x4dd9f5(0x1b1)](_0x4ace8e[_0x4dd9f5(0x16a)]['toLowerCase'](),_0x4ace8e['id']);}for(const [_0x30eb26,{definition:_0x5a5aba}]of _0x96d924){const _0x567451=generateDeterministicJourneySegmentName(_0x396e37['yamlConfig'][_0x4dd9f5(0x16a)],_0x30eb26);_0x565925['onProgress']?.({'type':_0x4dd9f5(0x121),'journeyName':_0x396e37['yamlConfig']['name'],'segmentName':_0x30eb26});const _0x2105d2=createSegmentIdResolver(_0x3cb258[_0x4dd9f5(0x15f)],_0x30eb26),_0x2ab2cc=await resolveRuleSegmentIds(_0x5a5aba[_0x4dd9f5(0x14c)],_0x2105d2),_0x38ceaf=await _0x37b95f[_0x4dd9f5(0x19f)]['createJourneySegment']({'name':_0x567451,'description':_0x5a5aba[_0x4dd9f5(0x105)]||_0x4dd9f5(0xfd)+_0x30eb26,'journeyId':_0x519a3d,'rule':_0x1bf723(_0x2ab2cc,!![]),'countPopulation':!![],'parentFolderId':_0x5c25b4[_0x4dd9f5(0x164)]||'','audienceId':_0x5c25b4[_0x4dd9f5(0x197)]});_0x486880['set'](_0x30eb26,_0x38ceaf),_0x3cb258[_0x4dd9f5(0x15f)][_0x4dd9f5(0x1b1)](_0x30eb26,_0x38ceaf),_0x565925['onProgress']?.({'type':_0x4dd9f5(0x1d4),'journeyName':_0x396e37[_0x4dd9f5(0x11a)][_0x4dd9f5(0x16a)],'segmentName':_0x30eb26});}const _0x31ddf4=new Map();for(const [_0x4ded9f,_0x200e05]of _0x51a1e2){_0x565925[_0x4dd9f5(0x151)]?.({'type':_0x4dd9f5(0x107),'journeyName':_0x396e37[_0x4dd9f5(0x11a)][_0x4dd9f5(0x16a)],'activationName':_0x4ded9f});const _0x6037bf=await _0x3d8bed(_0x200e05,_0x3cb258['activationContext']),_0x42dd45=await _0x37b95f[_0x4dd9f5(0x18a)][_0x4dd9f5(0x198)](_0x519a3d,_0x6037bf);_0x31ddf4[_0x4dd9f5(0x1b1)](_0x4ded9f,_0x42dd45['id']),_0x4aedb4['journeyActivationNameToId'][_0x4dd9f5(0x1b1)](_0x4ded9f,_0x42dd45['id']),_0x565925[_0x4dd9f5(0x151)]?.({'type':_0x4dd9f5(0x168),'journeyName':_0x396e37[_0x4dd9f5(0x11a)][_0x4dd9f5(0x16a)],'activationName':_0x4ded9f});}const _0x1ad479=JSON['parse'](JSON['stringify'](_0x2fa099));return _0x1ad479['id']=_0x519a3d,ensureJourneyDefaults(_0x1ad479[_0x4dd9f5(0x18e)]),resolvePendingIdsInRequest(_0x1ad479,_0x2fa099,_0x536f2a,_0x486880,_0x31ddf4,_0x565925),await _0x37b95f[_0x4dd9f5(0x18a)][_0x4dd9f5(0x1ce)](_0x519a3d,_0x1ad479),{'action':_0x4dd9f5(0x102),'journeyId':_0x519a3d,'embeddedSegmentNameToId':_0x486880};}function stripPendingIds(_0x2df6f6){const _0x18c6de=a120_0x448e68;for(const _0x5ef845 of _0x2df6f6[_0x18c6de(0x18e)][_0x18c6de(0x17d)]||[]){_0x5ef845[_0x18c6de(0x12e)]?.['segmentId']&&isPendingSegmentId(_0x5ef845['entryCriteria']['segmentId'])&&delete _0x5ef845['entryCriteria'];if(_0x5ef845[_0x18c6de(0x15b)])for(const _0x197e6f of Object[_0x18c6de(0x1b8)](_0x5ef845['steps'])){const _0x3d680c=_0x5ef845['steps'][_0x197e6f];_0x3d680c[_0x18c6de(0x183)]===_0x18c6de(0x1d3)&&_0x3d680c['journeyActivationStepId']&&isPendingActivationId(_0x3d680c['journeyActivationStepId'])&&(_0x3d680c[_0x18c6de(0x181)]='');if(_0x3d680c['type']===_0x18c6de(0x14f)&&_0x3d680c[_0x18c6de(0x1d2)])for(const _0x4a279f of _0x3d680c[_0x18c6de(0x1d2)]){_0x4a279f[_0x18c6de(0x154)]&&isPendingSegmentId(_0x4a279f[_0x18c6de(0x154)])&&(_0x4a279f['segmentId']='');}_0x3d680c['type']===_0x18c6de(0x133)&&_0x3d680c['waitCondition']?.[_0x18c6de(0x154)]&&isPendingSegmentId(_0x3d680c[_0x18c6de(0x179)]['segmentId'])&&(_0x3d680c[_0x18c6de(0x179)][_0x18c6de(0x154)]='');}}}function resolvePendingIdsInRequest(_0x4eaa2e,_0x4c262b,_0x4403b2,_0x2b86f3,_0x1f3b57,_0x4d29f2){const _0x3d0755=a120_0x448e68,_0x2ed0ca=(_0x38db61,_0x30b5ca)=>{const _0x28c237=a120_0x3afa;if(!isPendingSegmentId(_0x38db61))return _0x38db61;const _0x302b25=extractPendingSegmentName(_0x38db61),_0x55fb63=_0x2b86f3[_0x28c237(0x1ac)](_0x302b25);return!_0x55fb63&&_0x4d29f2[_0x28c237(0x1a0)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x302b25+'\x27\x20for\x20'+_0x30b5ca),_0x55fb63;};if(_0x4eaa2e[_0x3d0755(0x18e)]['goal']?.[_0x3d0755(0x154)]&&isPendingSegmentId(_0x4eaa2e['attributes'][_0x3d0755(0x189)]['segmentId'])){const _0x3c5424=_0x2ed0ca(_0x4eaa2e['attributes'][_0x3d0755(0x189)][_0x3d0755(0x154)],_0x3d0755(0x116));_0x3c5424&&(_0x4eaa2e[_0x3d0755(0x18e)][_0x3d0755(0x189)][_0x3d0755(0x154)]=_0x3c5424);}for(const _0x2d3882 of _0x4eaa2e[_0x3d0755(0x18e)]['journeyStages']||[]){const _0x3c2cad=_0x4403b2[_0x3d0755(0x1ac)](_0x2d3882[_0x3d0755(0x16a)]['toLowerCase']());_0x3c2cad&&(_0x2d3882['id']=_0x3c2cad);if(_0x2d3882[_0x3d0755(0x12e)]?.[_0x3d0755(0x154)]&&isPendingSegmentId(_0x2d3882[_0x3d0755(0x12e)][_0x3d0755(0x154)])){const _0x5e7845=_0x2ed0ca(_0x2d3882['entryCriteria']['segmentId'],'stage\x20\x27'+_0x2d3882[_0x3d0755(0x16a)]+'\x27\x20entry\x20criteria');_0x5e7845&&(_0x2d3882[_0x3d0755(0x12e)][_0x3d0755(0x154)]=_0x5e7845);}if(_0x2d3882['exitCriterias'])for(const _0x1a675b of _0x2d3882['exitCriterias']){if(_0x1a675b[_0x3d0755(0x154)]&&isPendingSegmentId(_0x1a675b['segmentId'])){const _0x4f76a4=_0x2ed0ca(_0x1a675b[_0x3d0755(0x154)],_0x3d0755(0xff)+_0x2d3882['name']+_0x3d0755(0x108));_0x4f76a4&&(_0x1a675b[_0x3d0755(0x154)]=_0x4f76a4);}}if(_0x2d3882['milestone']?.[_0x3d0755(0x154)]&&isPendingSegmentId(_0x2d3882[_0x3d0755(0x134)][_0x3d0755(0x154)])){const _0x51bf16=_0x2ed0ca(_0x2d3882['milestone'][_0x3d0755(0x154)],'stage\x20\x27'+_0x2d3882[_0x3d0755(0x16a)]+_0x3d0755(0x122));_0x51bf16&&(_0x2d3882['milestone']['segmentId']=_0x51bf16);}if(_0x2d3882[_0x3d0755(0x15b)]){const _0x809ab=_0x3a773f=>_0x4c262b['attributes'][_0x3d0755(0x17d)][_0x3d0755(0x1ad)](_0xf6f816=>_0xf6f816[_0x3d0755(0x16a)][_0x3d0755(0x118)]()===_0x2d3882[_0x3d0755(0x16a)][_0x3d0755(0x118)]())?.['steps']?.[_0x3a773f];for(const _0x5f12dd of Object[_0x3d0755(0x1b8)](_0x2d3882[_0x3d0755(0x15b)])){const _0x18d936=_0x2d3882[_0x3d0755(0x15b)][_0x5f12dd],_0xf3f1ee=_0x809ab(_0x5f12dd);if(_0x18d936[_0x3d0755(0x183)]==='Activation'&&_0x18d936[_0x3d0755(0x181)]&&(isPendingActivationId(_0x18d936[_0x3d0755(0x181)])||_0x18d936[_0x3d0755(0x181)]==='')){if(_0xf3f1ee?.[_0x3d0755(0x181)]&&isPendingActivationId(_0xf3f1ee[_0x3d0755(0x181)])){const _0x32c31e=extractPendingActivationName(_0xf3f1ee['journeyActivationStepId']),_0x441e55=_0x1f3b57[_0x3d0755(0x1ac)](_0x32c31e);_0x441e55&&(_0x18d936['journeyActivationStepId']=_0x441e55);}}if(_0x18d936[_0x3d0755(0x183)]==='DecisionPoint'&&_0x18d936['branches']&&_0xf3f1ee?.[_0x3d0755(0x1d2)])for(let _0x4cb6f1=0x0;_0x4cb6f1<_0x18d936[_0x3d0755(0x1d2)][_0x3d0755(0x190)];_0x4cb6f1++){const _0x518598=_0x18d936[_0x3d0755(0x1d2)][_0x4cb6f1],_0x4c6a61=_0xf3f1ee[_0x3d0755(0x1d2)][_0x4cb6f1];if(_0x4c6a61?.[_0x3d0755(0x154)]&&isPendingSegmentId(_0x4c6a61[_0x3d0755(0x154)])){const _0x4490ef=_0x2ed0ca(_0x4c6a61['segmentId'],'stage\x20\x27'+_0x2d3882[_0x3d0755(0x16a)]+_0x3d0755(0x1c6)+(_0x518598[_0x3d0755(0x16a)]||_0x4cb6f1)+'\x27');_0x4490ef&&(_0x518598[_0x3d0755(0x154)]=_0x4490ef);}}if(_0x18d936[_0x3d0755(0x183)]===_0x3d0755(0x133)&&_0x18d936[_0x3d0755(0x179)]?.['segmentId']&&_0xf3f1ee?.[_0x3d0755(0x179)]?.[_0x3d0755(0x154)]&&isPendingSegmentId(_0xf3f1ee[_0x3d0755(0x179)][_0x3d0755(0x154)])){const _0x59e38e=_0x2ed0ca(_0xf3f1ee[_0x3d0755(0x179)]['segmentId'],'stage\x20\x27'+_0x2d3882[_0x3d0755(0x16a)]+_0x3d0755(0x13a));_0x59e38e&&(_0x18d936[_0x3d0755(0x179)][_0x3d0755(0x154)]=_0x59e38e);}}}}}
|
|
1
|
+
const a115_0x670463=a115_0x514f;function a115_0x4aa4(){const _0x8f7f65=['hasChanges','all','deps','activations','connectionIdToNameMap','create','folder','journeyBundleName','getJourney','journey','updated','absolutePath','slice','length','versionNumber','):\x20','sha1','210uYUvFD','all_columns','existingSegment','connector_config','journeys','logSuccess','INTERNAL','activation_updated','keys','embedded_activation_created','includes','1012102Zfoopq','parseDocument','rootFolderId','map','1767715AvnUFZ','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','segment_deleting','delete','resolveJourneyId','max','journeyActivationStepId','976712jINcmk','\x27\x20exit\x20criteria','\x20segment\x20from\x20file:\x20','\x27\x20entry\x20criteria','filter','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','existingJourney','logDeleted','columns','./child-segment-yaml.js','segmentFolderId','createActivation','connection','idToEmailMap','737001mITpxi','activation_deleted',').\x20','\x27\x20wait\x20condition','entry_criteria','sort','existingActivation','journeyById','data','activationActions','\x0a\x20\x20','createJourneySegment','localSegmentRules','decision_point','diff','16bObTNz','\x27...','push','null','exitCriterias','idToName','journeyStages','journeyActivationNameToId','skipSegments','stringify','Failed\x20to\x20','toLowerCase','from','activation_creating','results','values','dirname','Journey\x20\x27','join','Deleted\x20activation\x20\x27','state','size','12OJOhJQ','type','activationStepsById','createdSegmentId','created','steps','find','WaitStep','__pending_act_','segmentId','JOURNEY_UPDATE_ERROR','createdSegmentIds','unchanged','has','folderPathToId','notification','validatedRequest','deleteActivation','SEGMENT_UPDATE_ERROR','\x20journey\x20from\x20file:\x20','schedule','ACTIVATION_UPDATE_ERROR','progress','Activation\x20not\x20found:\x20','2248512XrKWVV','438063JIvMwD','milestone','Deleting\x20activation\x20\x27','Created\x20activation\x20\x27','folderPath','set','nameToId','deleted','digest','onProgress','Updated\x20activation\x20\x27','yamlConfig','parentFolder','activation_template_id','goal','behavior','../../utils/async.js','segment','folder_creating','startsWith','\x20activation\x20\x27','message','Creating\x20segment\x20\x27','activation_updating','journeyBundlesByFolderAndName','verbose','segments','kind','update','rule','logInfo','stages','add','get','SEGMENT_NOT_FOUND','journey_updated','isArray','yamlActivation','object','JOURNEY_SYNTAX_ERROR','621966gBAAES','branches','Deleted\x20segment\x20\x27','\x20(referenced\x20in\x20journey\x20','waitCondition','attributes','listActivations','withProgress','segment_creating','with','resolveSegment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','existingSegments','segmentNameToId','replace','activationParams','toString','DecisionPoint','split','journeyId','parse','getSegment','fetchJourney','Updating\x20activation\x20\x27','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','SEGMENT_SYNTAX_ERROR','reduce','description','./journey-yaml.js','valid','buildUserMaps','Fetching\x20','parentId','Entry\x20criteria:\x20','__pending_','NOT_FOUND','relative','activationContext','\x27\x20for\x20','\x27\x20decision\x20point\x20branch\x20\x27','createFolder','entryCriteria','relationships','item','isNew','utf-8','\x27\x20not\x20found\x20in\x20journey\x20\x27','Activation','activationsBySegmentId','folderId','\x27\x20milestone','errors','stage\x20\x27','updateSegmentById','effectiveFolderId','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Updating\x20segment\x20\x27','name','updateActivation','index','deleteSegment','embedded_segment_creating','journey_creating','segment_updated'];a115_0x4aa4=function(){return _0x8f7f65;};return a115_0x4aa4();}(function(_0x3734ed,_0x52101c){const _0x104dbc=a115_0x514f,_0x65b719=_0x3734ed();while(!![]){try{const _0x32fc57=-parseInt(_0x104dbc(0x1c5))/0x1+parseInt(_0x104dbc(0x179))/0x2+parseInt(_0x104dbc(0x112))/0x3+-parseInt(_0x104dbc(0x1c4))/0x4+-parseInt(_0x104dbc(0x172))/0x5*(parseInt(_0x104dbc(0x1ac))/0x6)+-parseInt(_0x104dbc(0x16e))/0x7*(parseInt(_0x104dbc(0x196))/0x8)+parseInt(_0x104dbc(0x187))/0x9*(parseInt(_0x104dbc(0x163))/0xa);if(_0x32fc57===_0x52101c)break;else _0x65b719['push'](_0x65b719['shift']());}catch(_0x55cd32){_0x65b719['push'](_0x65b719['shift']());}}}(a115_0x4aa4,0x66452));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a115_0x670463(0x134);export const PENDING_ACTIVATION_PREFIX=a115_0x670463(0x1b4);export function createPendingSegmentId(_0x4edbd0){return''+PENDING_SEGMENT_PREFIX+_0x4edbd0+'__';}export function isPendingSegmentId(_0x28d54d){const _0x212f60=a115_0x670463;return _0x28d54d[_0x212f60(0x1d8)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x298f8b){const _0x5e000b=a115_0x670463;return _0x298f8b[_0x5e000b(0x120)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1b87a1){return''+PENDING_ACTIVATION_PREFIX+_0x1b87a1+'__';}export function isPendingActivationId(_0x2240f1){const _0x7b645d=a115_0x670463;return _0x2240f1[_0x7b645d(0x1d8)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x412d5f){return _0x412d5f['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x4bf7ba,_0x5b7576){const _0x4592b8=a115_0x670463,_0x8fbb41=_0x4bf7ba+'::'+(_0x5b7576['trim']()||_0x4592b8(0x1d6)),_0x5d1b31=createHash(_0x4592b8(0x162))[_0x4592b8(0x106)](_0x8fbb41)[_0x4592b8(0x1cd)]('hex')[_0x4592b8(0x15e)](0x0,0xc);return'journey_entry_criteria_'+_0x5d1b31;}export function ensureJourneyDefaults(_0x5076f7){const _0x3e0f34=a115_0x670463;!_0x5076f7['description']&&(_0x5076f7['description']=''),!_0x5076f7[_0x3e0f34(0x1aa)]&&(_0x5076f7[_0x3e0f34(0x1aa)]='draft');}export function resolveTDFolderPath(_0x443bd4,_0x3c6cd7,_0x20bf2f){if(!_0x3c6cd7)return _0x443bd4;if(_0x443bd4===_0x20bf2f||_0x443bd4['startsWith'](_0x20bf2f+'/'))return _0x443bd4;return _0x443bd4?_0x20bf2f+'/'+_0x443bd4:_0x20bf2f;}export function addFoldersToCreate(_0x2097d2,_0x5129ff,_0x34619a){const _0x4340dd=a115_0x670463;if(!_0x2097d2)return;if(_0x5129ff['has'](_0x2097d2))return;const _0x3e6799=_0x2097d2['split']('/');let _0x449074='';for(const _0x479bf7 of _0x3e6799){_0x449074=_0x449074?_0x449074+'/'+_0x479bf7:_0x479bf7,!_0x5129ff[_0x4340dd(0x1b9)](_0x449074)&&_0x34619a['add'](_0x449074);}}import*as a115_0x4d4d85 from'yaml';import{readFileSync}from'fs';import a115_0x9be0a from'path';import{isJourneyDef,parseYamlString as a115_0x4a04fa,toYamlString as a115_0x1eb319,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(_0x35f04d){const _0x1928e0=a115_0x670463;if(Array[_0x1928e0(0x10e)](_0x35f04d))return'['+_0x35f04d[_0x1928e0(0x171)](_0x428b2e=>stableStringify(_0x428b2e))[_0x1928e0(0x1a8)](',')+']';if(_0x35f04d&&typeof _0x35f04d===_0x1928e0(0x110)){const _0x5b5a92=_0x35f04d,_0x452ed1=Object[_0x1928e0(0x16b)](_0x5b5a92)[_0x1928e0(0x18c)](),_0x47d323=_0x452ed1['map'](_0x5e161a=>'\x22'+_0x5e161a+'\x22:'+stableStringify(_0x5b5a92[_0x5e161a]));return'{'+_0x47d323[_0x1928e0(0x1a8)](',')+'}';}const _0x49a211=JSON[_0x1928e0(0x19f)](_0x35f04d);return _0x49a211===undefined?_0x1928e0(0x199):_0x49a211;}function activationSignature(_0x205a2f){const _0x2e9727=a115_0x670463,_0x2b7130={'connection':_0x205a2f[_0x2e9727(0x185)],..._0x205a2f[_0x2e9727(0x164)]!==undefined&&{'all_columns':_0x205a2f[_0x2e9727(0x164)]},..._0x205a2f[_0x2e9727(0x181)]!==undefined&&{'columns':_0x205a2f[_0x2e9727(0x181)]},..._0x205a2f['behavior']!==undefined&&{'behavior':_0x205a2f[_0x2e9727(0x1d4)]},..._0x205a2f[_0x2e9727(0x1c0)]!==undefined&&{'schedule':_0x205a2f[_0x2e9727(0x1c0)]},..._0x205a2f[_0x2e9727(0x1bb)]!==undefined&&{'notification':_0x205a2f['notification']},..._0x205a2f[_0x2e9727(0x166)]!==undefined&&{'connector_config':_0x205a2f[_0x2e9727(0x166)]},..._0x205a2f['activation_template_id']!==undefined&&{'activation_template_id':_0x205a2f[_0x2e9727(0x1d2)]}};return stableStringify(_0x2b7130);}export async function prepareSegmentFiles(_0x1faeac,_0xb2d5cd,_0x5dd455,_0x2c4c31,_0xd723d0){const _0x255fdb=a115_0x670463,{activationDefToCreateRequest:_0x36294e}=await import(_0x255fdb(0x182)),_0x373e6e=[],_0x2a0445=new Set();for(const {yamlConfig:_0x286ced,folderPath:_0x4bc0d7,sourcePath:_0x14589d}of _0x1faeac){const _0x23c8e7=resolveTDFolderPath(_0x4bc0d7,_0x2c4c31,_0xd723d0),_0x43c9f3=_0x23c8e7+':'+_0x286ced[_0x255fdb(0x14b)],_0xc345cc=_0xb2d5cd['segmentByFolderAndName']['get'](_0x43c9f3),_0x10895a=_0xc345cc?_0xb2d5cd[_0x255fdb(0x142)][_0x255fdb(0x10b)](_0xc345cc['id'])||[]:[];addFoldersToCreate(_0x23c8e7,_0xb2d5cd[_0x255fdb(0x1ba)],_0x2a0445);const _0x565d91=calculateActivationActions(_0x286ced['activations']||[],_0x10895a,_0xb2d5cd[_0x255fdb(0x186)],_0xb2d5cd[_0x255fdb(0x156)]);for(const _0x369096 of _0x565d91){(_0x369096['type']==='create'||_0x369096['type']===_0x255fdb(0x106))&&_0x369096[_0x255fdb(0x10f)]&&(_0x369096['validatedRequest']=await _0x36294e(_0x369096[_0x255fdb(0x10f)],_0x5dd455));}const _0x42d4e7=calculateSegmentDiff(_0x286ced,_0xc345cc,_0x10895a,_0xb2d5cd['idToEmailMap'],_0xb2d5cd[_0x255fdb(0x156)]);_0x373e6e[_0x255fdb(0x198)]({'relativePath':_0x286ced[_0x255fdb(0x14b)],'absolutePath':_0x14589d,'yamlConfig':_0x286ced,'folderPath':_0x23c8e7,'existingSegment':_0xc345cc,'existingActivations':_0x10895a,'isNew':_0x42d4e7['isNew'],'hasChanges':_0x42d4e7['hasChanges'],'diff':_0x42d4e7[_0x255fdb(0x195)],'activationActions':_0x565d91});}return{'segmentFiles':_0x373e6e,'foldersToCreate':_0x2a0445};}export async function prepareJourneyFiles(_0xfe00d3,_0x20b048,_0xba303,_0x411a81){const _0x309179=a115_0x670463,_0x4b396e=[],_0x32ddb3=new Set();for(const {yamlConfig:_0x40d09a,folderPath:_0x466693,sourcePath:_0x212e3c}of _0xfe00d3){const _0x2949f2=resolveTDFolderPath(_0x466693,_0xba303,_0x411a81),_0x4d16a1=_0x2949f2+':'+_0x40d09a[_0x309179(0x14b)],_0x2d2a9f=_0x20b048[_0x309179(0x102)][_0x309179(0x10b)](_0x4d16a1);let _0x1b3c41,_0x25eae5;if(_0x2d2a9f&&_0x2d2a9f['length']>0x0){const _0x3339ed=buildLocalExpandedRuleMappings(_0x40d09a),{createYamlContext:_0xdc99e7,prefetchJourneySegments:_0x5562c9}=createPushYamlContextForBundle(_0x20b048[_0x309179(0x154)],_0x20b048['parentId'],_0x20b048[_0x309179(0x11e)],_0x3339ed,_0x20b048[_0x309179(0x186)],_0x20b048[_0x309179(0x156)],_0x20b048[_0x309179(0x1ae)],_0x20b048['journeyById']);await _0x5562c9(_0x2d2a9f[_0x309179(0x171)](_0x4fbfde=>_0x4fbfde['id']));const _0x5621be=hasMultipleVersions(_0x40d09a),_0x56df09=async _0x45b9bb=>{const _0x247e3a=_0x309179,_0x14f638=_0x20b048[_0x247e3a(0x18e)]?.[_0x247e3a(0x10b)](_0x45b9bb);if(_0x14f638)return _0x14f638;return _0x20b048[_0x247e3a(0x128)]({'journeyId':_0x45b9bb,'journeyName':_0x40d09a[_0x247e3a(0x14b)],'isMultiVersion':_0x2d2a9f[_0x247e3a(0x15f)]>0x1});};if(_0x5621be&&_0x2d2a9f['length']>0x1){const _0x5f2027=[];for(const _0x3ae3ba of _0x2d2a9f){const _0x3531e6=_0x3ae3ba[_0x309179(0x160)]||0x1;_0x20b048[_0x309179(0x1c2)]?.['update'](_0x309179(0x131)+_0x40d09a[_0x309179(0x14b)]+'\x20v'+_0x3531e6);const _0x2a0a0d=await _0x56df09(_0x3ae3ba['id']),_0x31ae46=_0xdc99e7(_0x3ae3ba['id']),_0x1405f7=await journeyResponseToDef(_0x2a0a0d,_0x31ae46);_0x5f2027[_0x309179(0x198)]({'item':_0x3ae3ba,'yaml':_0x1405f7});}const _0xf8ee6b=buildLocalRuleToNameMappingFromJourney(_0x40d09a);_0x25eae5=buildMergedJourneyDef(_0x5f2027,_0xf8ee6b);const _0x3246cb=Math[_0x309179(0x177)](..._0x5f2027[_0x309179(0x171)](_0x125687=>_0x125687[_0x309179(0x13d)][_0x309179(0x160)]||0x0)),_0x97f0c3=_0x2d2a9f['find'](_0x5a3ac8=>(_0x5a3ac8['versionNumber']||0x0)===_0x3246cb);_0x97f0c3&&(_0x20b048[_0x309179(0x1c2)]?.[_0x309179(0x106)]('Fetching\x20'+_0x40d09a[_0x309179(0x14b)]+'\x20v'+_0x3246cb),_0x1b3c41=await _0x56df09(_0x97f0c3['id']));}else{const _0x4cf507=_0x2d2a9f[_0x2d2a9f[_0x309179(0x15f)]-0x1];_0x20b048[_0x309179(0x1c2)]?.[_0x309179(0x106)](_0x309179(0x131)+_0x40d09a['name']),_0x1b3c41=await _0x56df09(_0x4cf507['id']);const _0x1caaec=_0xdc99e7(_0x4cf507['id']),_0x33cb32=await journeyResponseToDef(_0x1b3c41,_0x1caaec),_0x269d73=buildLocalRuleToNameMappingFromJourney(_0x40d09a);_0x25eae5=buildMergedJourneyDef([{'item':_0x4cf507,'yaml':_0x33cb32}],_0x269d73);}}addFoldersToCreate(_0x2949f2,_0x20b048[_0x309179(0x1ba)],_0x32ddb3);const _0x598fe=calculateJourneyDiff(_0x40d09a,_0x25eae5);_0x4b396e[_0x309179(0x198)]({'relativePath':_0x40d09a[_0x309179(0x14b)],'absolutePath':_0x212e3c,'yamlConfig':_0x40d09a,'folderPath':_0x2949f2,'existingJourney':_0x1b3c41,'isNew':_0x598fe[_0x309179(0x13e)],'hasChanges':_0x598fe[_0x309179(0x152)],'diff':_0x598fe['diff']});}return{'journeyFiles':_0x4b396e,'foldersToCreate':_0x32ddb3};}export function calculateActivationActions(_0x34b452,_0x1a55bb,_0x4e3d3e,_0x3f217b){const _0x387731=a115_0x670463,_0x313f95=[],_0x138abc=new Map();for(const _0x102a00 of _0x1a55bb){_0x138abc['set'](_0x102a00[_0x387731(0x14b)],_0x102a00);}const _0x1809a6=new Map();for(const _0x5b6881 of _0x34b452){_0x1809a6['set'](_0x5b6881[_0x387731(0x14b)],_0x5b6881);}for(const _0x2915c5 of _0x34b452){const _0x400958=_0x138abc['get'](_0x2915c5[_0x387731(0x14b)]);if(!_0x400958)_0x313f95[_0x387731(0x198)]({'type':_0x387731(0x157),'name':_0x2915c5[_0x387731(0x14b)],'yamlActivation':_0x2915c5});else{const _0x573b8c=activationResponseToDef(_0x400958,_0x4e3d3e,_0x3f217b),_0x362146=a115_0x4d4d85[_0x387731(0x19f)](_0x573b8c),_0x545e9d=a115_0x4d4d85[_0x387731(0x19f)](_0x2915c5);_0x362146!==_0x545e9d&&_0x313f95[_0x387731(0x198)]({'type':_0x387731(0x106),'name':_0x2915c5[_0x387731(0x14b)],'yamlActivation':_0x2915c5,'existingActivation':_0x400958});}}for(const _0x2b0076 of _0x1a55bb){!_0x1809a6[_0x387731(0x1b9)](_0x2b0076[_0x387731(0x14b)])&&_0x313f95[_0x387731(0x198)]({'type':'delete','name':_0x2b0076[_0x387731(0x14b)],'existingActivation':_0x2b0076});}return _0x313f95;}export function calculateSegmentDiff(_0x3919d5,_0x31e44b,_0x18f8a8,_0x25f26a,_0x2b8bb8){const _0xbfb12f=segmentToYamlString(_0x3919d5);if(_0x31e44b){const _0x5635e7=segmentWithActivationsToYaml(_0x31e44b,_0x18f8a8,undefined,_0x25f26a,_0x2b8bb8),_0x36b67c=segmentToYamlString(_0x5635e7),_0xf1bbb7=generateDiff(_0x36b67c,_0xbfb12f),_0x3bdcfa=hasChanges(_0xf1bbb7);return{'isNew':![],'hasChanges':_0x3bdcfa,'diff':_0x3bdcfa?formatDiffWithColors(_0xf1bbb7):undefined};}const _0x2cc30a=generateDiff('',_0xbfb12f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2cc30a)};}export function calculateJourneyDiff(_0xef034e,_0x14ddf0){const _0x3bbd07=normalizeJourneyDef(_0xef034e,_0xef034e),_0x248c72=a115_0x1eb319(_0x3bbd07);if(_0x14ddf0){const _0x819396=normalizeJourneyDef(_0x14ddf0,_0xef034e),_0x44517d=a115_0x1eb319(_0x819396),_0x5be8b1=generateDiff(_0x44517d,_0x248c72),_0x5b7941=hasChanges(_0x5be8b1);return{'isNew':![],'hasChanges':_0x5b7941,'diff':_0x5b7941?formatDiffWithColors(_0x5be8b1):undefined};}const _0x2a03bb=generateDiff('',_0x248c72);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2a03bb)};}export function findSegmentsToDelete(_0x40d0eb,_0x2bd363,_0x1a9a39,_0x50ae82,_0x168e6f){const _0x18eb79=a115_0x670463,_0x1f7ffb=new Set();for(const {yamlConfig:_0xa21b1f,folderPath:_0x4b25d6}of _0x2bd363){_0x1f7ffb[_0x18eb79(0x10a)](_0x4b25d6+':'+_0xa21b1f[_0x18eb79(0x14b)]);}return _0x40d0eb[_0x18eb79(0x17d)](_0x44c0b7=>{const _0x3d16fc=_0x18eb79,_0x168481=_0x44c0b7[_0x3d16fc(0x183)]?_0x1a9a39[_0x3d16fc(0x10b)](_0x44c0b7[_0x3d16fc(0x183)][_0x3d16fc(0x122)]())||'':'',_0x472769=_0x168481+':'+_0x44c0b7[_0x3d16fc(0x14b)];if(_0x1f7ffb['has'](_0x472769))return![];if(_0x168e6f)return _0x168481===_0x50ae82||_0x168481[_0x3d16fc(0x1d8)](_0x50ae82+'/');return!![];});}export function findJourneysToDelete(_0x5c40fa,_0x269629,_0x1a2e35,_0x478fce,_0x22712b){const _0x43f4fe=a115_0x670463,_0x185626=new Set();for(const {yamlConfig:_0x5ba7ff,folderPath:_0x2576d3}of _0x269629){_0x185626[_0x43f4fe(0x10a)](_0x2576d3+':'+_0x5ba7ff[_0x43f4fe(0x14b)]);}return _0x5c40fa[_0x43f4fe(0x17d)](_0x4ee013=>{const _0xd4e373=_0x43f4fe,_0x458392=_0x4ee013['folderId']?_0x1a2e35[_0xd4e373(0x10b)](_0x4ee013[_0xd4e373(0x143)])||'':'',_0x9b8c1e=_0x458392+':'+_0x4ee013[_0xd4e373(0x159)];if(_0x185626[_0xd4e373(0x1b9)](_0x9b8c1e))return![];if(_0x22712b)return _0x458392===_0x478fce||_0x458392[_0xd4e373(0x1d8)](_0x478fce+'/');return!![];});}export function buildSegmentLookupMap(_0x20d51c,_0x411421){const _0x21d634=a115_0x670463,_0x12a063=new Map();for(const _0x503b68 of _0x20d51c){const _0x12b86d=_0x503b68[_0x21d634(0x183)]?_0x411421[_0x21d634(0x10b)](_0x503b68[_0x21d634(0x183)][_0x21d634(0x122)]())||'':'',_0xeb39a9=_0x12b86d+':'+_0x503b68[_0x21d634(0x14b)];_0x12a063[_0x21d634(0x1ca)](_0xeb39a9,_0x503b68);}return _0x12a063;}export function buildSegmentNameToIdMap(_0x231bee){const _0x46754c=a115_0x670463,_0xd00d69=new Map();for(const _0x2ce12b of _0x231bee){_0xd00d69[_0x46754c(0x1ca)](_0x2ce12b['name'],_0x2ce12b['id']);}return _0xd00d69;}export function buildJourneyBundleLookupMap(_0x37d1d9,_0x389c9d){const _0x4dfe3a=a115_0x670463,_0xda768c=new Map();for(const _0x3f60ab of _0x37d1d9){const _0x40e3f5=_0x3f60ab[_0x4dfe3a(0x143)]?_0x389c9d[_0x4dfe3a(0x10b)](_0x3f60ab['folderId'])||'':'',_0x1cf503=_0x40e3f5+':'+_0x3f60ab[_0x4dfe3a(0x159)];!_0xda768c['has'](_0x1cf503)&&_0xda768c[_0x4dfe3a(0x1ca)](_0x1cf503,[]),_0xda768c[_0x4dfe3a(0x10b)](_0x1cf503)[_0x4dfe3a(0x198)](_0x3f60ab);}for(const _0x2e48ed of _0xda768c[_0x4dfe3a(0x1a5)]()){_0x2e48ed[_0x4dfe3a(0x18c)]((_0x2acbae,_0x15ffc0)=>(_0x2acbae[_0x4dfe3a(0x160)]||0x0)-(_0x15ffc0[_0x4dfe3a(0x160)]||0x0));}return _0xda768c;}export function collectFoldersToCreate(_0x74a290,_0x587483){const _0x51d0a=a115_0x670463,_0x4a4f31=new Set();for(const _0x45625c of _0x74a290){if(!_0x45625c)continue;if(_0x587483['has'](_0x45625c))continue;const _0x5050ae=_0x45625c[_0x51d0a(0x124)]('/');let _0x25e780='';for(const _0x7e4b of _0x5050ae){_0x25e780=_0x25e780?_0x25e780+'/'+_0x7e4b:_0x7e4b,!_0x587483['has'](_0x25e780)&&_0x4a4f31['add'](_0x25e780);}}return _0x4a4f31;}export function parseAndClassifyYamlFiles(_0x5d1841,_0x252cfd,_0x5caccc){const _0x43e4a4=a115_0x670463,_0x4522d5=[],_0x19f3ad=[];for(const _0x2d0db3 of _0x5d1841){const _0x441673=a115_0x9be0a['relative'](_0x252cfd,a115_0x9be0a[_0x43e4a4(0x1a6)](_0x2d0db3)),_0x1377f6=_0x441673==='.'?'':_0x441673,_0x18e7b1=readFileSync(_0x2d0db3,_0x43e4a4(0x13f)),_0xe86a1e=a115_0x4d4d85['parse'](_0x18e7b1);if(isJourneyDef(_0xe86a1e)){const _0x24a44c=a115_0x4a04fa(_0x18e7b1);_0x19f3ad[_0x43e4a4(0x198)]({'yamlConfig':_0x24a44c,'folderPath':_0x1377f6,'sourcePath':_0x2d0db3});}else{if(!_0x5caccc?.[_0x43e4a4(0x19e)]){const _0x75af9a=parseSegmentYamlFile(_0x18e7b1),_0x2152b6=normalizeChildSegmentYaml(_0x75af9a);_0x4522d5[_0x43e4a4(0x198)]({'yamlConfig':_0x2152b6,'folderPath':_0x1377f6,'sourcePath':_0x2d0db3});}}}return{'segments':_0x4522d5,'journeys':_0x19f3ad};}export function validateParsedFiles(_0x541bc6,_0x2c3154){const _0x154d0a=a115_0x670463,_0x423579=[];for(const {yamlConfig:_0x5d2a88,sourcePath:_0x4c2add}of _0x541bc6[_0x154d0a(0x104)]){const _0x59e8f7=readFileSync(_0x4c2add,'utf-8'),_0x127c49=a115_0x4d4d85[_0x154d0a(0x16f)](_0x59e8f7),_0x5a2057=validateSegmentDef(_0x5d2a88,{'source':_0x59e8f7,'document':_0x127c49});if(!_0x5a2057[_0x154d0a(0x12f)]){const _0x1c265c=a115_0x9be0a[_0x154d0a(0x136)](_0x2c3154,_0x4c2add);_0x423579[_0x154d0a(0x198)]({'filePath':_0x1c265c,'source':_0x59e8f7,'result':_0x5a2057,'isJourney':![]});}}for(const {yamlConfig:_0x46cc96,sourcePath:_0x3d6105}of _0x541bc6[_0x154d0a(0x167)]){const _0x50a74e=readFileSync(_0x3d6105,_0x154d0a(0x13f)),_0x678d=a115_0x4d4d85[_0x154d0a(0x16f)](_0x50a74e),_0x2278a9=validateJourneyDef(_0x46cc96,{'source':_0x50a74e,'document':_0x678d});if(!_0x2278a9[_0x154d0a(0x12f)]){const _0x4b8232=a115_0x9be0a[_0x154d0a(0x136)](_0x2c3154,_0x3d6105);_0x423579[_0x154d0a(0x198)]({'filePath':_0x4b8232,'source':_0x50a74e,'result':_0x2278a9,'isJourney':!![]});}}return _0x423579;}export function formatValidationErrors(_0x27be2a){const _0x40629e=a115_0x670463,_0x36f1a5=[];for(const {filePath:_0x3c94da,source:_0x514dd2,result:_0x2cc333,isJourney:_0x19fcf3}of _0x27be2a){const _0xc953e5=_0x19fcf3?_0x40629e(0x15b):'segment';_0x36f1a5[_0x40629e(0x198)]('\x0a'+_0x3c94da+'\x20('+_0xc953e5+_0x40629e(0x161)+_0x2cc333[_0x40629e(0x145)][_0x40629e(0x15f)]+'\x20error(s)'),_0x36f1a5[_0x40629e(0x198)](formatValidationResult(_0x2cc333,_0x514dd2,_0x3c94da));}return _0x36f1a5['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x50a08d){const _0xc23258=a115_0x670463,_0x3fc628=new Set(),_0x52e2e4=new Map(),_0xe323d7=collectSegmentUsageCounts(_0x50a08d);if(_0x50a08d[_0xc23258(0x104)])for(const [_0x267679,_0x325391]of Object['entries'](_0x50a08d['segments'])){_0x3fc628[_0xc23258(0x10a)](_0x267679);if(_0x325391[_0xc23258(0x107)]){const _0x2a9efa=yamlRuleToApi(_0x325391[_0xc23258(0x107)]),_0x15b54c=apiRuleToYaml(_0x2a9efa);_0x52e2e4[_0xc23258(0x1ca)](_0x267679,_0x15b54c);}}const _0x133717=new Map();let _0x55cad3=0x0;for(const [_0x114623,_0x35ca61]of _0x52e2e4){const _0x29cd17=serializeExpandedRule(_0x35ca61,_0x52e2e4),_0x56bef2=_0x133717[_0xc23258(0x10b)](_0x29cd17)||[];_0x56bef2[_0xc23258(0x198)]({'name':_0x114623,'index':_0x55cad3}),_0x133717[_0xc23258(0x1ca)](_0x29cd17,_0x56bef2),_0x55cad3++;}const _0x279529=new Map();for(const [_0x3cbb08,_0x49948b]of _0x133717){const _0x3391ce=_0x49948b[_0xc23258(0x15e)]()['sort']((_0x5eb07a,_0x27079e)=>{const _0x1b8220=_0xc23258,_0x1f36dc=_0xe323d7[_0x1b8220(0x10b)](_0x5eb07a[_0x1b8220(0x14b)])||0x0,_0x18bc39=_0xe323d7[_0x1b8220(0x10b)](_0x27079e[_0x1b8220(0x14b)])||0x0;if(_0x1f36dc!==_0x18bc39)return _0x18bc39-_0x1f36dc;return _0x5eb07a['index']-_0x27079e[_0x1b8220(0x14d)];})[_0xc23258(0x171)](_0x554edc=>_0x554edc[_0xc23258(0x14b)]),_0x3775a8=[];for(const _0x956262 of _0x3391ce){const _0x165af6=_0xe323d7[_0xc23258(0x10b)](_0x956262)||0x0,_0x59fec5=Math['max'](_0x165af6,0x1);for(let _0x565877=0x0;_0x565877<_0x59fec5;_0x565877++){_0x3775a8[_0xc23258(0x198)](_0x956262);}}_0x279529['set'](_0x3cbb08,_0x3775a8);}return{'existingLocalSegmentNames':_0x3fc628,'localSegmentRules':_0x52e2e4,'localExpandedRuleToNames':_0x279529};}async function buildServerSegmentRuleMap(_0x2bd19f,_0x887078,_0x5066a5,_0x578008){const _0x4eaab6=new Map(),_0x4c6d02=new Set(),_0x459932=async _0xc6aeb=>{const _0x324cc1=a115_0x514f;if(_0x4c6d02[_0x324cc1(0x1b9)](_0xc6aeb))return;_0x4c6d02[_0x324cc1(0x10a)](_0xc6aeb);let _0x557413=_0x5066a5[_0x324cc1(0x1b2)](_0x452085=>_0x452085['id']===_0xc6aeb);if(!_0x557413)try{_0x557413=await _0x2bd19f[_0x324cc1(0x1d6)]['getSegment'](_0x887078,_0xc6aeb);}catch{return;}if(!_0x557413?.[_0x324cc1(0x107)])return;const _0x27ce12=apiRuleToYaml(_0x557413[_0x324cc1(0x107)]);_0x4eaab6[_0x324cc1(0x1ca)](_0xc6aeb,_0x27ce12);const _0x36dcd9=collectSegmentRefsFromRule(_0x27ce12);for(const _0x4a50c1 of _0x36dcd9){await _0x459932(_0x4a50c1);}};for(const _0xb8bbe9 of _0x578008){await _0x459932(_0xb8bbe9);}return _0x4eaab6;}export function createSegmentIdResolver(_0x3c6df6,_0x295fcd){return async _0x682a37=>{const _0x5e6b0f=a115_0x514f,_0x552dc2=_0x3c6df6['get'](_0x682a37);if(!_0x552dc2)throw new SDKError(ErrorCode[_0x5e6b0f(0x10c)],'Segment\x20not\x20found:\x20'+_0x682a37+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x295fcd+'\x27)');return _0x552dc2;};}export function extractRootFolderId(_0x42f964){const _0x17aa0c=a115_0x670463;return _0x42f964[_0x17aa0c(0x13c)]?.['parentSegmentFolder']?.[_0x17aa0c(0x18f)]?.['id']||_0x42f964[_0x17aa0c(0x13c)]?.[_0x17aa0c(0x1d1)]?.[_0x17aa0c(0x18f)]?.['id'];}export function buildConnectionMaps(_0x135249){const _0x45a61f=a115_0x670463,_0x306a56=new Map(),_0x363669=new Map(),_0x1cffd5=new Map();for(const _0x562ad3 of _0x135249){_0x306a56[_0x45a61f(0x1ca)](_0x562ad3[_0x45a61f(0x14b)],parseInt(_0x562ad3['id'],0xa)),_0x363669[_0x45a61f(0x1ca)](_0x562ad3['id'],_0x562ad3[_0x45a61f(0x14b)]),_0x1cffd5[_0x45a61f(0x1ca)](_0x562ad3[_0x45a61f(0x14b)],_0x562ad3[_0x45a61f(0x1ad)]);}return{'nameToId':_0x306a56,'idToName':_0x363669,'nameToType':_0x1cffd5};}function a115_0x514f(_0x3b495e,_0x4fbe89){_0x3b495e=_0x3b495e-0x102;const _0x4aa4e4=a115_0x4aa4();let _0x514f58=_0x4aa4e4[_0x3b495e];return _0x514f58;}export function calculatePushStats(_0x4c3f8a,_0x2967a9,_0x1edadb,_0x32b78e,_0x4b18f5,_0x416015,_0x1fbbf3){const _0x4c5ea4=a115_0x670463,_0x2073f7=_0x4c3f8a['filter'](_0x3edc4f=>_0x3edc4f[_0x4c5ea4(0x13e)]),_0x55b8ee=_0x4c3f8a['filter'](_0x1ed18c=>!_0x1ed18c[_0x4c5ea4(0x13e)]&&_0x1ed18c[_0x4c5ea4(0x152)]),_0x52d06d=_0x4c3f8a[_0x4c5ea4(0x17d)](_0x498dc0=>!_0x498dc0[_0x4c5ea4(0x13e)]&&!_0x498dc0[_0x4c5ea4(0x152)]),_0x4ca6cc=_0x416015?_0x32b78e:[],_0x40429a=_0x2967a9['filter'](_0x26dbea=>_0x26dbea[_0x4c5ea4(0x13e)]),_0x164c54=_0x2967a9[_0x4c5ea4(0x17d)](_0x41093e=>!_0x41093e[_0x4c5ea4(0x13e)]&&_0x41093e[_0x4c5ea4(0x152)]),_0x7fff9f=_0x2967a9[_0x4c5ea4(0x17d)](_0x151bb9=>!_0x151bb9['isNew']&&!_0x151bb9[_0x4c5ea4(0x152)]),_0x5e260c=_0x416015?_0x4b18f5:[],_0x3d0580=_0x4c3f8a['flatMap'](_0xfd0d83=>_0xfd0d83[_0x4c5ea4(0x190)]),_0xa6b12b=_0x3d0580[_0x4c5ea4(0x17d)](_0x586c3b=>_0x586c3b[_0x4c5ea4(0x1ad)]===_0x4c5ea4(0x157)),_0x5dbec8=_0x3d0580['filter'](_0x839c01=>_0x839c01[_0x4c5ea4(0x1ad)]==='update'),_0xdf201=_0x3d0580['filter'](_0x2443c6=>_0x2443c6['type']===_0x4c5ea4(0x175)),_0x2d48cd=Array[_0x4c5ea4(0x1a2)](_0x1edadb)[_0x4c5ea4(0x18c)](),_0x44f81f=_0x1fbbf3?![]:_0x2073f7[_0x4c5ea4(0x15f)]>0x0||_0x55b8ee[_0x4c5ea4(0x15f)]>0x0||_0x4ca6cc['length']>0x0,_0x395fa0=_0x40429a[_0x4c5ea4(0x15f)]>0x0||_0x164c54[_0x4c5ea4(0x15f)]>0x0||_0x5e260c[_0x4c5ea4(0x15f)]>0x0,_0x3a11e4=_0x1fbbf3?![]:_0x3d0580[_0x4c5ea4(0x15f)]>0x0,_0x42c1df=_0x2d48cd['length']>0x0;return{'segments':{'new':_0x2073f7,'changed':_0x55b8ee,'unchanged':_0x52d06d,'toDelete':_0x4ca6cc},'journeys':{'new':_0x40429a,'changed':_0x164c54,'unchanged':_0x7fff9f,'toDelete':_0x5e260c},'activations':{'all':_0x3d0580,'toCreate':_0xa6b12b,'toUpdate':_0x5dbec8,'toDelete':_0xdf201},'folders':{'toCreate':_0x2d48cd},'counts':{'segments':{'new':_0x2073f7[_0x4c5ea4(0x15f)],'changed':_0x55b8ee[_0x4c5ea4(0x15f)],'unchanged':_0x52d06d[_0x4c5ea4(0x15f)],'toDelete':_0x4ca6cc[_0x4c5ea4(0x15f)]},'journeys':{'new':_0x40429a[_0x4c5ea4(0x15f)],'changed':_0x164c54[_0x4c5ea4(0x15f)],'unchanged':_0x7fff9f[_0x4c5ea4(0x15f)],'toDelete':_0x5e260c[_0x4c5ea4(0x15f)]},'activations':{'create':_0xa6b12b[_0x4c5ea4(0x15f)],'update':_0x5dbec8[_0x4c5ea4(0x15f)],'delete':_0xdf201[_0x4c5ea4(0x15f)]},'folders':_0x2d48cd[_0x4c5ea4(0x15f)]},'hasChanges':_0x44f81f||_0x395fa0||_0x3a11e4||_0x42c1df};}export async function buildPushExecutionContext(_0x5cd5d4,_0x54fb88,_0x2e4f07,_0x26f4f9,_0x32ce81,_0x25481e){const _0x1b8106=a115_0x670463,_0x41b97d=extractRootFolderId(_0x2e4f07),{pathToId:_0x9a18c0,idToPath:_0xdb6f22}=buildFolderMaps(_0x32ce81),_0x2048a2=buildSegmentNameToIdMap(_0x26f4f9),_0x307e6c=new Map(),{batchAsync:_0x124073}=await import(_0x1b8106(0x1d5)),[_0x3e3539,_0x2ff406]=await Promise[_0x1b8106(0x153)]([_0x5cd5d4['user'][_0x1b8106(0x130)](),_0x5cd5d4['connection']['list'](),((async()=>{!_0x25481e&&_0x26f4f9['length']>0x0&&await _0x124073(_0x26f4f9,async _0x8b6903=>{const _0x569640=a115_0x514f,_0x5e1c74=await _0x5cd5d4[_0x569640(0x1d6)]['listActivations'](_0x54fb88,_0x8b6903['id']);_0x307e6c[_0x569640(0x1ca)](_0x8b6903['id'],_0x5e1c74);});})())]),{emailToId:_0x589898,idToEmail:_0xe14c41}=_0x3e3539,_0x18906e=buildConnectionMaps(_0x2ff406);return{'rootFolderId':_0x41b97d,'folderPathToId':_0x9a18c0,'folderIdToPath':_0xdb6f22,'segmentNameToId':_0x2048a2,'activationsBySegmentId':_0x307e6c,'emailToIdMap':_0x589898,'idToEmailMap':_0xe14c41,'connectionNameToIdMap':_0x18906e[_0x1b8106(0x1cb)],'connectionIdToNameMap':_0x18906e[_0x1b8106(0x19b)],'connectionNameToTypeMap':_0x18906e['nameToType']};}export function createPushYamlContextForBundle(_0x479cc0,_0xee3d73,_0x256b33,_0x1c9918,_0x40942d,_0x4c5526,_0x2cd042,_0x538d5b){const {existingLocalSegmentNames:_0x56c267,localExpandedRuleToNames:_0x41719a}=_0x1c9918,_0x4a248d=new Set(),_0x4c913a=new Map(),_0xd211c6=new Map(),_0x58d0e6=new Map(),_0x1a6b3e=createJumpTargetCache(),_0xb86ec9=new Map(),_0x586e85=new Map(),_0x387340=new Set();let _0x56c7f9;const _0x2f3258=_0x247c90=>{const _0x228f11={'resolveSegment':async _0x93037a=>{const _0x33bf58=a115_0x514f,_0x473978=_0x58d0e6['get'](_0x93037a);if(_0x473978!==undefined)return{'name':_0x473978,'isJourneyLocal':!![]};try{let _0x4f2bfc=_0x256b33[_0x33bf58(0x1b2)](_0x39e80e=>_0x39e80e['id']===_0x93037a);!_0x4f2bfc&&(_0x4f2bfc=await _0x479cc0['segment'][_0x33bf58(0x127)](_0xee3d73,_0x93037a));const _0x59cb76=generateJourneyLocalName(_0x4f2bfc[_0x33bf58(0x14b)]),_0x184820=_0x4f2bfc[_0x33bf58(0x105)]===SEGMENT_KIND_JOURNEY&&_0x59cb76!==undefined;let _0x3ef5ff=_0x4f2bfc[_0x33bf58(0x14b)],_0x5612df;if(_0x184820&&_0x4f2bfc[_0x33bf58(0x107)]){const _0x37312e=apiRuleToYaml(_0x4f2bfc[_0x33bf58(0x107)]);_0x586e85[_0x33bf58(0x1ca)](_0x93037a,_0x37312e);const _0x213152=async _0x2f2bb4=>{const _0x8b5ea=_0x33bf58,_0x5d84e9=collectSegmentRefsFromRule(_0x2f2bb4);for(const _0x32054a of _0x5d84e9){if(!_0x586e85[_0x8b5ea(0x1b9)](_0x32054a))try{const _0x1f413c=await _0x479cc0['segment'][_0x8b5ea(0x127)](_0xee3d73,_0x32054a);if(_0x1f413c?.['rule']){const _0x56a381=apiRuleToYaml(_0x1f413c[_0x8b5ea(0x107)]);_0x586e85[_0x8b5ea(0x1ca)](_0x32054a,_0x56a381),await _0x213152(_0x56a381);}}catch{}}};await _0x213152(_0x37312e);const _0x35c872=serializeExpandedRule(_0x37312e,_0x586e85),_0x50df5d=_0x41719a['get'](_0x35c872);if(_0x50df5d&&_0x50df5d[_0x33bf58(0x15f)]>0x0){const _0x4fbf86=_0x4c913a[_0x33bf58(0x10b)](_0x35c872)||0x0,_0x1ec03a=_0x50df5d[_0x4fbf86]||_0x50df5d[_0x50df5d[_0x33bf58(0x15f)]-0x1];_0x4c913a[_0x33bf58(0x1ca)](_0x35c872,_0x4fbf86+0x1),_0x3ef5ff=_0x1ec03a,_0x4a248d['add'](_0x3ef5ff),_0x58d0e6['set'](_0x93037a,_0x3ef5ff);const _0x44a654=await resolveRuleSegmentRefs(_0x37312e,async _0x2ddbae=>{const _0x11bf72=_0x33bf58,_0x2a29c=_0x58d0e6[_0x11bf72(0x10b)](_0x2ddbae);if(_0x2a29c)return _0x2a29c;const _0x3cbd0d=await _0x56c7f9[_0x11bf72(0x11c)](_0x2ddbae);return _0x3cbd0d['name'];});_0x5612df={'description':_0x4f2bfc[_0x33bf58(0x12d)],'rule':_0x44a654};}else{const _0x25dbf8=_0xb86ec9[_0x33bf58(0x10b)](_0x35c872);if(_0x25dbf8)_0x3ef5ff=_0x25dbf8,_0x58d0e6[_0x33bf58(0x1ca)](_0x93037a,_0x3ef5ff);else{if(_0x59cb76){let _0x72494d=_0x59cb76,_0x1386e6=0x2;while(_0x4a248d[_0x33bf58(0x1b9)](_0x72494d)||_0x56c267[_0x33bf58(0x1b9)](_0x72494d)){_0x72494d=_0x59cb76+'_'+_0x1386e6,_0x1386e6++;}_0x4a248d[_0x33bf58(0x10a)](_0x72494d),_0x3ef5ff=_0x72494d;}_0x58d0e6[_0x33bf58(0x1ca)](_0x93037a,_0x3ef5ff),_0xb86ec9[_0x33bf58(0x1ca)](_0x35c872,_0x3ef5ff);const _0x4bad37=await resolveRuleSegmentRefs(_0x37312e,async _0x20e322=>{const _0x55486f=_0x33bf58,_0x4e0820=_0x58d0e6[_0x55486f(0x10b)](_0x20e322);if(_0x4e0820)return _0x4e0820;const _0x56ee01=await _0x56c7f9[_0x55486f(0x11c)](_0x20e322);return _0x56ee01[_0x55486f(0x14b)];});_0x5612df={'description':_0x4f2bfc[_0x33bf58(0x12d)],'rule':_0x4bad37};}}}return{'name':_0x3ef5ff,'isJourneyLocal':_0x184820,'definition':_0x5612df};}catch{return{'name':_0x93037a,'isJourneyLocal':![]};}},'resolveActivation':async _0x220b80=>{const _0x2aa015=a115_0x514f,_0x459305=_0xd211c6[_0x2aa015(0x10b)](_0x220b80);if(_0x459305!==undefined)return{'name':_0x459305,'isJourneyLocal':!![]};try{let _0x35afc8=_0x2cd042?.['get'](_0x220b80);!_0x35afc8&&(_0x35afc8=await _0x479cc0[_0x2aa015(0x15b)]['getActivation'](_0x247c90,_0x220b80));const _0x240e71=_0x35afc8['attributes'][_0x2aa015(0x121)]['name']||_0x220b80,_0x4a8ebf=sanitizeYamlKey(_0x240e71)||'activation_'+_0x220b80,_0x3fdbd7=_0x4a8ebf;_0xd211c6[_0x2aa015(0x1ca)](_0x220b80,_0x3fdbd7);const _0x28feda=journeyActivationStepToYaml(_0x35afc8,_0x40942d,_0x4c5526);return{'name':_0x3fdbd7,'isJourneyLocal':!![],'definition':_0x28feda};}catch{return{'name':_0x220b80,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xeb1491,_0x5c2120)=>resolveJumpTarget(_0xeb1491,_0x5c2120,_0x1a6b3e,async _0x32cf5a=>{const _0x19f03f=a115_0x514f,_0x42f4f0=_0x538d5b?.[_0x19f03f(0x10b)](_0x32cf5a);if(_0x42f4f0)return _0x42f4f0;return _0x479cc0[_0x19f03f(0x15b)]['getJourney'](_0x32cf5a);})};return _0x56c7f9=_0x228f11,_0x228f11;},_0x318549=async _0x4ea628=>{const _0x127e13=a115_0x514f,{collectSegmentIdsFromJourneyApi:_0x4b5835}=await import(_0x127e13(0x12e)),{batchAsync:_0x26f5ba}=await import('../../utils/async.js'),_0x82aa0f=new Set();for(const _0x7523e1 of _0x4ea628){let _0x264172=_0x538d5b?.['get'](_0x7523e1);!_0x264172&&(_0x264172=await _0x479cc0[_0x127e13(0x15b)][_0x127e13(0x15a)](_0x7523e1));const _0x268442=_0x4b5835(_0x264172);for(const _0x29973b of _0x268442){_0x82aa0f[_0x127e13(0x10a)](_0x29973b);}}let _0xa50e22=Array[_0x127e13(0x1a2)](_0x82aa0f);while(_0xa50e22[_0x127e13(0x15f)]>0x0){const _0x2ca2c5=_0xa50e22[_0x127e13(0x17d)](_0x536626=>!_0x387340[_0x127e13(0x1b9)](_0x536626));if(_0x2ca2c5[_0x127e13(0x15f)]===0x0)break;const _0xe0d2fb=await _0x26f5ba(_0x2ca2c5,async _0x44693b=>{const _0x1160eb=_0x127e13;_0x387340[_0x1160eb(0x10a)](_0x44693b);let _0x1a141a=_0x256b33[_0x1160eb(0x1b2)](_0xa6a397=>_0xa6a397['id']===_0x44693b);if(!_0x1a141a)try{_0x1a141a=await _0x479cc0[_0x1160eb(0x1d6)][_0x1160eb(0x127)](_0xee3d73,_0x44693b);}catch{return null;}return{'segmentId':_0x44693b,'segment':_0x1a141a};},0xa),_0x315656=new Set();for(const _0x45c0eb of _0xe0d2fb){if(!_0x45c0eb?.[_0x127e13(0x1d6)]?.[_0x127e13(0x107)])continue;const _0x242adc=apiRuleToYaml(_0x45c0eb[_0x127e13(0x1d6)][_0x127e13(0x107)]);_0x586e85['set'](_0x45c0eb[_0x127e13(0x1b5)],_0x242adc);const _0x3106ed=collectSegmentRefsFromRule(_0x242adc);for(const _0x5e3b0f of _0x3106ed){!_0x387340[_0x127e13(0x1b9)](_0x5e3b0f)&&_0x315656[_0x127e13(0x10a)](_0x5e3b0f);}}_0xa50e22=Array[_0x127e13(0x1a2)](_0x315656);}};return{'createYamlContext':_0x2f3258,'prefetchJourneySegments':_0x318549};}export async function executePushSegments(_0x4eb1f1,_0x10d3aa,_0x4257d8,_0x3c0a15,_0x4390a6){const _0x2d7f99=a115_0x670463,{segmentDefToCreateRequest:_0x55f457,segmentDefToUpdateRequest:_0x3b7820}=await import(_0x2d7f99(0x182)),_0x2d8120=_0x4257d8[_0x2d7f99(0x1ba)],_0x431a66=0x5,_0x492cb6=async _0x57c313=>{const _0x2d47f5=_0x2d7f99,_0x141a8f=_0x57c313[_0x2d47f5(0x1c9)]?_0x2d8120[_0x2d47f5(0x10b)](_0x57c313['folderPath']):undefined;let _0x3ac308;const _0x33cf8d={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x57c313[_0x2d47f5(0x13e)]){_0x4390a6['onProgress']?.({'type':_0x2d47f5(0x11a),'name':_0x57c313[_0x2d47f5(0x1d0)][_0x2d47f5(0x14b)]});const _0x1e0898=_0x55f457(_0x57c313[_0x2d47f5(0x1d0)],_0x141a8f),_0x20d392=await _0x4390a6[_0x2d47f5(0x119)](_0x2d47f5(0x1db)+_0x57c313['yamlConfig']['name']+_0x2d47f5(0x197),()=>_0x4eb1f1[_0x2d47f5(0x1d6)]['createSegment'](_0x3c0a15['parentId'],_0x1e0898));_0x3ac308=_0x20d392[_0x2d47f5(0x18f)]['id'],_0x33cf8d[_0x2d47f5(0x1af)]={'name':_0x57c313[_0x2d47f5(0x1d0)][_0x2d47f5(0x14b)],'id':_0x3ac308},_0x4390a6[_0x2d47f5(0x1ce)]?.({'type':'segment_created','name':_0x57c313[_0x2d47f5(0x1d0)][_0x2d47f5(0x14b)],'segmentId':_0x3ac308}),_0x4390a6[_0x2d47f5(0x168)]?.('Created\x20segment\x20\x27'+_0x57c313[_0x2d47f5(0x1d0)]['name']+'\x27'),_0x33cf8d[_0x2d47f5(0x1b0)]=0x1;}else{if(_0x57c313[_0x2d47f5(0x152)]){_0x4390a6[_0x2d47f5(0x1ce)]?.({'type':'segment_updating','name':_0x57c313[_0x2d47f5(0x1d0)][_0x2d47f5(0x14b)]});const _0x291e7a=_0x3b7820(_0x57c313[_0x2d47f5(0x1d0)]);_0x141a8f!==_0x57c313[_0x2d47f5(0x165)]?.[_0x2d47f5(0x183)]&&(_0x291e7a[_0x2d47f5(0x183)]=_0x141a8f?parseInt(_0x141a8f,0xa):undefined),await _0x4390a6['withProgress'](_0x2d47f5(0x14a)+_0x57c313['yamlConfig']['name']+'\x27...',()=>_0x4eb1f1[_0x2d47f5(0x1d6)][_0x2d47f5(0x147)](_0x3c0a15['parentId'],_0x57c313['existingSegment']['id'],_0x291e7a)),_0x3ac308=_0x57c313[_0x2d47f5(0x165)]['id'],_0x4390a6[_0x2d47f5(0x1ce)]?.({'type':_0x2d47f5(0x151),'name':_0x57c313['yamlConfig'][_0x2d47f5(0x14b)]}),_0x4390a6[_0x2d47f5(0x168)]?.('Updated\x20segment\x20\x27'+_0x57c313[_0x2d47f5(0x1d0)][_0x2d47f5(0x14b)]+'\x27'),_0x33cf8d[_0x2d47f5(0x15c)]=0x1;}else _0x3ac308=_0x57c313[_0x2d47f5(0x165)]['id'];}}catch(_0x373ff6){const _0x416b4e=isHttp400Error(_0x373ff6),_0x455b66=_0x416b4e?ErrorCode[_0x2d47f5(0x12b)]:ErrorCode[_0x2d47f5(0x1be)],_0x20678e=getErrorMessage(_0x373ff6);throw new SDKError(_0x455b66,'Failed\x20to\x20'+(_0x57c313[_0x2d47f5(0x13e)]?_0x2d47f5(0x157):_0x2d47f5(0x106))+_0x2d47f5(0x17b)+_0x57c313[_0x2d47f5(0x15d)]+_0x2d47f5(0x191)+_0x20678e,_0x373ff6);}try{const _0x384f85=await syncActivationsForSegment(_0x4eb1f1,_0x3c0a15['parentId'],_0x3ac308,_0x57c313['yamlConfig'][_0x2d47f5(0x14b)],_0x57c313[_0x2d47f5(0x190)],_0x4390a6,_0x57c313[_0x2d47f5(0x15d)]);_0x33cf8d['activations']=_0x384f85;}catch(_0xe5dae1){if(_0xe5dae1 instanceof SDKError)throw _0xe5dae1;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2d47f5(0x11d)+_0x57c313[_0x2d47f5(0x1d0)][_0x2d47f5(0x14b)]+'\x27\x20from\x20file:\x20'+_0x57c313[_0x2d47f5(0x15d)]+_0x2d47f5(0x191)+getErrorMessage(_0xe5dae1),_0xe5dae1);}return _0x33cf8d;},_0x43f590=await batchAsync(_0x10d3aa,_0x492cb6,_0x431a66),_0x53d014={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5c8c5b of _0x43f590){_0x53d014[_0x2d7f99(0x1b0)]+=_0x5c8c5b[_0x2d7f99(0x1b0)],_0x53d014[_0x2d7f99(0x15c)]+=_0x5c8c5b['updated'],_0x5c8c5b[_0x2d7f99(0x1af)]&&_0x53d014[_0x2d7f99(0x1b7)][_0x2d7f99(0x1ca)](_0x5c8c5b[_0x2d7f99(0x1af)][_0x2d7f99(0x14b)],_0x5c8c5b[_0x2d7f99(0x1af)]['id']),_0x53d014[_0x2d7f99(0x155)]['created']+=_0x5c8c5b['activations'][_0x2d7f99(0x1b0)],_0x53d014[_0x2d7f99(0x155)][_0x2d7f99(0x15c)]+=_0x5c8c5b[_0x2d7f99(0x155)][_0x2d7f99(0x15c)],_0x53d014[_0x2d7f99(0x155)][_0x2d7f99(0x1cc)]+=_0x5c8c5b[_0x2d7f99(0x155)][_0x2d7f99(0x1cc)];}return _0x53d014;}async function syncActivationsForSegment(_0x7b7786,_0x1f92b5,_0x1ee636,_0x29d9c8,_0x5a2fdd,_0xf63ce0,_0x3ce074){const _0xa8d339=a115_0x670463,_0x1f5561={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x55682f of _0x5a2fdd){try{if(_0x55682f[_0xa8d339(0x1ad)]===_0xa8d339(0x157)&&_0x55682f[_0xa8d339(0x1bc)])_0xf63ce0['onProgress']?.({'type':_0xa8d339(0x1a3),'segmentName':_0x29d9c8,'activationName':_0x55682f[_0xa8d339(0x14b)]}),await _0xf63ce0[_0xa8d339(0x119)]('Creating\x20activation\x20\x27'+_0x55682f[_0xa8d339(0x14b)]+_0xa8d339(0x197),()=>_0x7b7786['segment'][_0xa8d339(0x184)](_0x1f92b5,_0x1ee636,_0x55682f[_0xa8d339(0x1bc)])),_0xf63ce0[_0xa8d339(0x1ce)]?.({'type':'activation_created','segmentName':_0x29d9c8,'activationName':_0x55682f[_0xa8d339(0x14b)]}),_0xf63ce0[_0xa8d339(0x168)]?.(_0xa8d339(0x1c8)+_0x55682f[_0xa8d339(0x14b)]+'\x27'),_0x1f5561[_0xa8d339(0x1b0)]++;else{if(_0x55682f[_0xa8d339(0x1ad)]===_0xa8d339(0x106)&&_0x55682f[_0xa8d339(0x1bc)]&&_0x55682f[_0xa8d339(0x18d)])_0xf63ce0[_0xa8d339(0x1ce)]?.({'type':_0xa8d339(0x1dc),'segmentName':_0x29d9c8,'activationName':_0x55682f[_0xa8d339(0x14b)]}),await _0xf63ce0[_0xa8d339(0x119)](_0xa8d339(0x129)+_0x55682f[_0xa8d339(0x14b)]+_0xa8d339(0x197),()=>_0x7b7786[_0xa8d339(0x1d6)][_0xa8d339(0x14c)](_0x1f92b5,_0x1ee636,_0x55682f[_0xa8d339(0x18d)]['id'],_0x55682f[_0xa8d339(0x1bc)])),_0xf63ce0['onProgress']?.({'type':_0xa8d339(0x16a),'segmentName':_0x29d9c8,'activationName':_0x55682f['name']}),_0xf63ce0[_0xa8d339(0x168)]?.(_0xa8d339(0x1cf)+_0x55682f[_0xa8d339(0x14b)]+'\x27'),_0x1f5561[_0xa8d339(0x15c)]++;else _0x55682f['type']==='delete'&&_0x55682f[_0xa8d339(0x18d)]&&(_0xf63ce0[_0xa8d339(0x1ce)]?.({'type':'activation_deleting','segmentName':_0x29d9c8,'activationName':_0x55682f[_0xa8d339(0x14b)]}),await _0xf63ce0[_0xa8d339(0x119)](_0xa8d339(0x1c7)+_0x55682f[_0xa8d339(0x14b)]+_0xa8d339(0x197),()=>_0x7b7786[_0xa8d339(0x1d6)][_0xa8d339(0x1bd)](_0x1f92b5,_0x1ee636,_0x55682f[_0xa8d339(0x18d)]['id'])),_0xf63ce0[_0xa8d339(0x1ce)]?.({'type':_0xa8d339(0x188),'segmentName':_0x29d9c8,'activationName':_0x55682f[_0xa8d339(0x14b)]}),_0xf63ce0[_0xa8d339(0x180)]?.(_0xa8d339(0x1a9)+_0x55682f[_0xa8d339(0x14b)]+'\x27'),_0x1f5561['deleted']++);}}catch(_0x4003b7){const _0xdd8fd=isHttp400Error(_0x4003b7),_0x106e12=_0xdd8fd?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0xa8d339(0x1c1)],_0x49d9e4=getErrorMessage(_0x4003b7);throw new SDKError(_0x106e12,_0xa8d339(0x1a0)+_0x55682f[_0xa8d339(0x1ad)]+_0xa8d339(0x1d9)+_0x55682f['name']+'\x27\x20from\x20file:\x20'+_0x3ce074+_0xa8d339(0x191)+_0x49d9e4,_0x4003b7);}}return _0x1f5561;}export async function executePushFolders(_0x3c43d4,_0x3f4b3e,_0x20df3a,_0x31a2b8,_0x48c629){const _0x3c3f64=a115_0x670463,_0x1271de=new Map(_0x20df3a);for(const _0x18b2aa of _0x3f4b3e){const _0x431279=_0x18b2aa[_0x3c3f64(0x124)]('/'),_0xe0f46=_0x431279[_0x431279['length']-0x1],_0x57cc82=_0x431279[_0x3c3f64(0x15e)](0x0,-0x1)[_0x3c3f64(0x1a8)]('/'),_0x13b487=_0x1271de[_0x3c3f64(0x10b)](_0x57cc82);_0x48c629[_0x3c3f64(0x1ce)]?.({'type':_0x3c3f64(0x1d7),'folder':_0x18b2aa});const _0x3baf60={'name':_0xe0f46,'parentFolderId':_0x13b487},_0x9b15af=await _0x48c629['withProgress']('Creating\x20folder\x20\x27'+_0x18b2aa+_0x3c3f64(0x197),()=>_0x3c43d4[_0x3c3f64(0x1d6)][_0x3c3f64(0x13a)](_0x31a2b8[_0x3c3f64(0x132)],_0x3baf60));_0x1271de[_0x3c3f64(0x1ca)](_0x18b2aa,_0x9b15af[_0x3c3f64(0x18f)]['id']),_0x48c629['onProgress']?.({'type':'folder_created','folder':_0x18b2aa,'folderId':_0x9b15af[_0x3c3f64(0x18f)]['id']}),_0x48c629[_0x3c3f64(0x108)]?.('Created\x20folder\x20\x27'+_0x18b2aa+'\x27');}return _0x1271de;}export async function executePushSegmentDeletions(_0xb718f,_0xb2eb70,_0x2a28d3){const _0x403dfe=a115_0x670463;if(_0xb2eb70['length']===0x0)return 0x0;const {batchAsync:_0x1b2c93}=await import(_0x403dfe(0x1d5)),_0x2874b5=0x5,_0x20b767=await _0x1b2c93(_0xb2eb70,async _0x37b1f3=>{const _0x199964=_0x403dfe;return _0x2a28d3[_0x199964(0x1ce)]?.({'type':_0x199964(0x174),'name':_0x37b1f3['name']}),await _0xb718f[_0x199964(0x1d6)][_0x199964(0x14e)](_0x37b1f3['id']),_0x2a28d3[_0x199964(0x1ce)]?.({'type':'segment_deleted','name':_0x37b1f3[_0x199964(0x14b)]}),_0x2a28d3[_0x199964(0x180)]?.(_0x199964(0x114)+_0x37b1f3[_0x199964(0x14b)]+'\x27'),0x1;},_0x2874b5);return _0x20b767[_0x403dfe(0x12c)]((_0xaa85e8,_0x338010)=>_0xaa85e8+_0x338010,0x0);}export async function executePushJourneys(_0x45cec5,_0x2820,_0x3e4da3,_0x4f9b3e,_0x393862){const _0x1cfa38=a115_0x670463,{journeyDefToRequest:_0x1ae4aa}=await import(_0x1cfa38(0x12e)),{activationDefToCreateRequest:_0x20c031,yamlRuleToApi:_0x1705ba,validateSegmentRule:_0x48d5d0}=await import(_0x1cfa38(0x182)),_0x549467={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x28c643=new Map(_0x3e4da3['segmentNameToId']),_0x389998=0x5;for(let _0x30230d=0x0;_0x30230d<_0x2820[_0x1cfa38(0x15f)];_0x30230d+=_0x389998){const _0x4ff9b7=_0x2820[_0x1cfa38(0x15e)](_0x30230d,_0x30230d+_0x389998),_0x144af8=await Promise[_0x1cfa38(0x153)](_0x4ff9b7[_0x1cfa38(0x171)](async _0xb80518=>{const _0x51b8f4=_0x1cfa38;if(!_0xb80518[_0x51b8f4(0x13e)]&&!_0xb80518[_0x51b8f4(0x152)])return{'action':'unchanged','name':_0xb80518['yamlConfig'][_0x51b8f4(0x14b)],'journeyId':_0xb80518[_0x51b8f4(0x17f)]?.['id']};const _0x230ee2=_0xb80518[_0x51b8f4(0x1c9)]?_0x3e4da3[_0x51b8f4(0x1ba)]['get'](_0xb80518['folderPath']):undefined;_0x393862['onProgress']?.({'type':_0xb80518['isNew']?_0x51b8f4(0x150):'journey_updating','name':_0xb80518[_0x51b8f4(0x1d0)][_0x51b8f4(0x14b)]});try{const _0x468934=await executeSingleJourneyPush(_0x45cec5,_0xb80518,{..._0x3e4da3,'segmentNameToId':_0x28c643},{'parentId':_0x4f9b3e['parentId'],'rootFolderId':_0x4f9b3e[_0x51b8f4(0x170)],'folderId':_0x230ee2,'verbose':_0x4f9b3e[_0x51b8f4(0x103)]},_0x393862,{'journeyDefToRequest':_0x1ae4aa,'activationDefToCreateRequest':_0x20c031,'yamlRuleToApi':_0x1705ba,'validateSegmentRule':_0x48d5d0});for(const [_0x49ddfe,_0x4d2e5c]of _0x468934['embeddedSegmentNameToId']){_0x28c643[_0x51b8f4(0x1ca)](_0x49ddfe,_0x4d2e5c),_0x549467['embeddedSegmentNameToId'][_0x51b8f4(0x1ca)](_0x49ddfe,_0x4d2e5c);}if(_0x468934['action']===_0x51b8f4(0x1b0))_0x393862['onProgress']?.({'type':'journey_created','name':_0xb80518[_0x51b8f4(0x1d0)][_0x51b8f4(0x14b)],'journeyId':_0x468934[_0x51b8f4(0x125)]}),_0x393862['logSuccess']?.('Created\x20journey\x20\x27'+_0xb80518[_0x51b8f4(0x1d0)][_0x51b8f4(0x14b)]+'\x27'),_0x549467[_0x51b8f4(0x1b0)]++;else _0x468934['action']===_0x51b8f4(0x15c)&&(_0x393862['onProgress']?.({'type':_0x51b8f4(0x10d),'name':_0xb80518[_0x51b8f4(0x1d0)]['name']}),_0x393862['logSuccess']?.('Updated\x20journey\x20\x27'+_0xb80518['yamlConfig'][_0x51b8f4(0x14b)]+'\x27'),_0x549467[_0x51b8f4(0x15c)]++);return{'action':_0x468934['action'],'name':_0xb80518[_0x51b8f4(0x1d0)][_0x51b8f4(0x14b)],'journeyId':_0x468934['journeyId']};}catch(_0x343e45){const _0x431a59=isHttp400Error(_0x343e45),_0x281d24=_0x431a59?ErrorCode[_0x51b8f4(0x111)]:ErrorCode[_0x51b8f4(0x1b6)],_0x27724e=getErrorMessage(_0x343e45);throw new SDKError(_0x281d24,_0x51b8f4(0x1a0)+(_0xb80518[_0x51b8f4(0x13e)]?'create':_0x51b8f4(0x106))+_0x51b8f4(0x1bf)+_0xb80518[_0x51b8f4(0x15d)]+_0x51b8f4(0x191)+_0x27724e,_0x343e45);}}));_0x549467[_0x1cfa38(0x1a4)][_0x1cfa38(0x198)](..._0x144af8);}return _0x549467;}async function executeSingleJourneyPush(_0xfb8019,_0x10a316,_0x19279b,_0x306cfb,_0x26f894,_0x93184c){const _0x18d817=a115_0x670463,{journeyDefToRequest:_0x51300c,activationDefToCreateRequest:_0x2773e2,yamlRuleToApi:_0x59cb21,validateSegmentRule:_0x4a15b5}=_0x93184c,_0x8607a9=new Map(),_0xc355f6=new Map(),_0x295ba2=new Map(),_0x31ded1=new Map(),_0xff7775=new Map();let _0x359e55;const _0x57595f=async()=>{const _0x3e44cc=a115_0x514f;if(_0x359e55)return;_0x359e55=new Map();if(!_0x10a316['existingJourney'])return;const _0xc10918=await _0xfb8019[_0x3e44cc(0x15b)][_0x3e44cc(0x118)](_0x10a316[_0x3e44cc(0x17f)]['id']);for(const _0x12f85c of _0xc10918){const _0xe978a2=journeyActivationStepToYaml(_0x12f85c,_0x19279b[_0x3e44cc(0x186)],_0x19279b[_0x3e44cc(0x156)]),_0x2cf758=activationSignature(_0xe978a2);!_0x359e55[_0x3e44cc(0x1b9)](_0x2cf758)&&_0x359e55[_0x3e44cc(0x1ca)](_0x2cf758,_0x12f85c['id']),_0xe978a2[_0x3e44cc(0x14b)]&&_0xc355f6[_0x3e44cc(0x1ca)](_0xe978a2[_0x3e44cc(0x14b)],_0x12f85c['id']);}};if(_0x10a316[_0x18d817(0x17f)]&&_0x10a316[_0x18d817(0x1d0)][_0x18d817(0x104)]){const _0x5a55a9=buildLocalExpandedRuleMappings(_0x10a316[_0x18d817(0x1d0)]),_0x263d64=_0x5a55a9[_0x18d817(0x193)];if(_0x263d64[_0x18d817(0x1ab)]>0x0){const _0x1da423=new Map();for(const [_0x2b2dd9,_0x531f83]of _0x263d64){const _0x5a0616=serializeExpandedRule(_0x531f83,_0x263d64);_0x1da423[_0x18d817(0x1ca)](_0x2b2dd9,_0x5a0616);}const _0x27b447=collectSegmentIdsFromJourneyApi(_0x10a316[_0x18d817(0x17f)]);if(_0x27b447[_0x18d817(0x1ab)]>0x0){const _0x54f6e8=await buildServerSegmentRuleMap(_0xfb8019,_0x306cfb[_0x18d817(0x132)],_0x19279b[_0x18d817(0x11e)],_0x27b447);if(_0x54f6e8[_0x18d817(0x1ab)]>0x0){const _0x2ceaeb=new Map();for(const [_0x5646d1,_0x2fe1ce]of _0x54f6e8){const _0x39618c=serializeExpandedRule(_0x2fe1ce,_0x54f6e8);!_0x2ceaeb[_0x18d817(0x1b9)](_0x39618c)&&_0x2ceaeb[_0x18d817(0x1ca)](_0x39618c,_0x5646d1);}for(const [_0x6fb57a,_0x6928c7]of _0x1da423){const _0x2b5a44=_0x2ceaeb[_0x18d817(0x10b)](_0x6928c7);_0x2b5a44&&(_0xff7775[_0x18d817(0x1ca)](_0x6fb57a,_0x2b5a44),_0x19279b['segmentNameToId'][_0x18d817(0x1ca)](_0x6fb57a,_0x2b5a44));}}}}}const _0x8ca04a={'resolveSegmentId':async _0x3537e0=>{const _0x34a8ee=_0x18d817,_0x4b7720=_0x19279b[_0x34a8ee(0x11f)][_0x34a8ee(0x10b)](_0x3537e0);if(!_0x4b7720)throw new SDKError(ErrorCode[_0x34a8ee(0x10c)],'Segment\x20not\x20found:\x20'+_0x3537e0+_0x34a8ee(0x115)+_0x10a316['yamlConfig'][_0x34a8ee(0x14b)]+')');return _0x4b7720;},'resolveEmbeddedSegmentId':async(_0x28b8d9,_0xcb7768)=>{const _0x231342=_0x18d817,_0x5ef113=_0x19279b['segmentNameToId'][_0x231342(0x10b)](_0x28b8d9);if(_0x5ef113)return _0x5ef113;const _0x1b8cfa=_0xff7775[_0x231342(0x10b)](_0x28b8d9);if(_0x1b8cfa)return _0x19279b[_0x231342(0x11f)][_0x231342(0x1ca)](_0x28b8d9,_0x1b8cfa),_0x1b8cfa;const _0x1e8c1d=_0x19279b['existingSegments'][_0x231342(0x1b2)](_0x25f095=>_0x25f095[_0x231342(0x14b)]===_0x28b8d9);if(_0x1e8c1d)return _0x19279b[_0x231342(0x11f)][_0x231342(0x1ca)](_0x28b8d9,_0x1e8c1d['id']),_0x1e8c1d['id'];if(_0x10a316[_0x231342(0x13e)]){const {stageName:_0x36c31,criteriaName:_0x342d51}=findSegmentCriteriaLocation(_0x10a316[_0x231342(0x1d0)],_0x28b8d9);return _0x4a15b5(_0x28b8d9,_0xcb7768['rule']),_0x295ba2[_0x231342(0x1ca)](_0x28b8d9,{'definition':_0xcb7768,'stageName':_0x36c31,'criteriaName':_0x342d51}),createPendingSegmentId(_0x28b8d9);}const _0x364aa3=_0x10a316[_0x231342(0x17f)]?.['id'];if(!_0x364aa3)throw new SDKError(ErrorCode['INTERNAL'],_0x231342(0x149));_0x4a15b5(_0x28b8d9,_0xcb7768[_0x231342(0x107)]);const _0x403278=generateDeterministicJourneySegmentName(_0x10a316[_0x231342(0x1d0)][_0x231342(0x14b)],_0x28b8d9),_0x179b7e=_0x19279b[_0x231342(0x11e)]['find'](_0x280a5b=>_0x280a5b[_0x231342(0x14b)]===_0x403278),_0x3988f5=createSegmentIdResolver(_0x19279b[_0x231342(0x11f)],_0x28b8d9),_0x109c01=await resolveRuleSegmentIds(_0xcb7768['rule'],_0x3988f5);let _0x2c73fe;if(_0x179b7e)await _0xfb8019[_0x231342(0x1d6)][_0x231342(0x147)](_0x306cfb[_0x231342(0x132)],_0x179b7e['id'],{'description':_0xcb7768[_0x231342(0x12d)]||_0x231342(0x133)+_0x28b8d9,'rule':_0x59cb21(_0x109c01,!![]),'countPopulation':!![]}),_0x2c73fe=_0x179b7e['id'];else try{_0x2c73fe=await _0xfb8019[_0x231342(0x1d6)][_0x231342(0x192)]({'name':_0x403278,'description':_0xcb7768[_0x231342(0x12d)]||_0x231342(0x133)+_0x28b8d9,'journeyId':_0x364aa3,'rule':_0x59cb21(_0x109c01,!![]),'countPopulation':!![],'parentFolderId':_0x306cfb[_0x231342(0x170)]||'','audienceId':_0x306cfb[_0x231342(0x132)]});}catch(_0x53ad8a){const _0x32cdc4=_0x53ad8a instanceof Error&&_0x53ad8a[_0x231342(0x1da)][_0x231342(0x16d)]('Name\x20has\x20already\x20been\x20taken');if(_0x32cdc4){const _0x4735ea=await _0xfb8019[_0x231342(0x1d6)]['listSegments'](_0x306cfb[_0x231342(0x132)]),_0x18fe40=_0x4735ea[_0x231342(0x1b2)](_0x34ec27=>_0x34ec27[_0x231342(0x14b)]===_0x403278);if(_0x18fe40)await _0xfb8019[_0x231342(0x1d6)][_0x231342(0x147)](_0x306cfb[_0x231342(0x132)],_0x18fe40['id'],{'description':_0xcb7768[_0x231342(0x12d)]||'Entry\x20criteria:\x20'+_0x28b8d9,'rule':_0x59cb21(_0x109c01,!![]),'countPopulation':!![]}),_0x2c73fe=_0x18fe40['id'];else throw _0x53ad8a;}else throw _0x53ad8a;}return _0x19279b[_0x231342(0x11f)][_0x231342(0x1ca)](_0x28b8d9,_0x2c73fe),_0x8607a9[_0x231342(0x1ca)](_0x28b8d9,_0x2c73fe),_0x2c73fe;},'resolveActivationId':async _0x4773b0=>{const _0x1341ab=_0x18d817,_0x290e29=_0xc355f6[_0x1341ab(0x10b)](_0x4773b0);if(_0x290e29)return _0x290e29;if(_0x10a316[_0x1341ab(0x17f)]){await _0x57595f();const _0x2affa0=_0xc355f6[_0x1341ab(0x10b)](_0x4773b0);if(_0x2affa0)return _0x2affa0;}throw new SDKError(ErrorCode[_0x1341ab(0x135)],_0x1341ab(0x1c3)+_0x4773b0+_0x1341ab(0x115)+_0x10a316[_0x1341ab(0x1d0)][_0x1341ab(0x14b)]+_0x1341ab(0x189)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0xcdfa69,_0x164a79)=>{const _0x182b4e=_0x18d817,_0x1039a2=_0xc355f6['get'](_0xcdfa69);if(_0x1039a2)return _0x1039a2;if(_0x10a316[_0x182b4e(0x13e)])return _0x31ded1['set'](_0xcdfa69,_0x164a79),createPendingActivationId(_0xcdfa69);if(_0x10a316[_0x182b4e(0x17f)]){await _0x57595f();const _0xa3f00b=_0xc355f6[_0x182b4e(0x10b)](_0x164a79[_0x182b4e(0x14b)]);if(_0xa3f00b)return _0xc355f6['set'](_0xcdfa69,_0xa3f00b),_0xa3f00b;const _0x33b25a=activationSignature(_0x164a79),_0x1a6d00=_0x359e55?.[_0x182b4e(0x10b)](_0x33b25a);if(_0x1a6d00)return _0xc355f6[_0x182b4e(0x1ca)](_0xcdfa69,_0x1a6d00),_0x1a6d00;const _0x29d656=await _0x2773e2(_0x164a79,_0x19279b['activationContext']),_0x80747f=await _0xfb8019[_0x182b4e(0x15b)][_0x182b4e(0x184)](_0x10a316[_0x182b4e(0x17f)]['id'],_0x29d656);return _0xc355f6[_0x182b4e(0x1ca)](_0xcdfa69,_0x80747f['id']),_0x80747f['id'];}throw new SDKError(ErrorCode[_0x182b4e(0x169)],_0x182b4e(0x12a));},'resolveJourneyId':async _0x5bdd89=>{const _0xa9025b=_0x18d817;try{return await _0xfb8019[_0xa9025b(0x15b)][_0xa9025b(0x176)](_0x306cfb[_0xa9025b(0x132)],_0x5bdd89);}catch(_0x2bcd89){throw new SDKError(ErrorCode[_0xa9025b(0x135)],_0xa9025b(0x1a7)+_0x5bdd89+_0xa9025b(0x17e)+_0x10a316['yamlConfig'][_0xa9025b(0x14b)]+'\x27)',_0x2bcd89);}},'resolveStageId':async(_0x2da904,_0x2ea265)=>{const _0x28479b=_0x18d817,_0x499f90=await _0xfb8019['journey'][_0x28479b(0x15a)](_0x2da904),_0x472618=_0x499f90[_0x28479b(0x117)][_0x28479b(0x19c)][_0x28479b(0x1b2)](_0x1cfe49=>_0x1cfe49[_0x28479b(0x14b)][_0x28479b(0x1a1)]()===_0x2ea265[_0x28479b(0x1a1)]());if(!_0x472618?.['id'])throw new SDKError(ErrorCode[_0x28479b(0x135)],'Stage\x20\x27'+_0x2ea265+_0x28479b(0x140)+(_0x499f90[_0x28479b(0x117)][_0x28479b(0x159)]||_0x499f90[_0x28479b(0x117)][_0x28479b(0x14b)])+'\x27');return _0x472618['id'];}},_0x52c129=await _0x51300c(_0x10a316[_0x18d817(0x1d0)],_0x306cfb[_0x18d817(0x132)],_0x8ca04a),_0x19f701=_0x306cfb['folderId']||_0x306cfb[_0x18d817(0x170)];_0x19f701&&(_0x52c129[_0x18d817(0x13c)]={'parentFolder':{'data':{'id':_0x19f701,'type':_0x18d817(0x158)}}});if(_0x10a316[_0x18d817(0x13e)]){if(_0x295ba2[_0x18d817(0x1ab)]>0x0||_0x31ded1[_0x18d817(0x1ab)]>0x0)return await executeThreeStepJourneyCreate(_0xfb8019,_0x10a316,_0x52c129,{'pendingEmbeddedSegments':_0x295ba2,'pendingEmbeddedActivations':_0x31ded1,'embeddedSegmentNameToId':_0x8607a9,'journeyActivationNameToId':_0xc355f6},{..._0x306cfb,'effectiveFolderId':_0x19f701},_0x19279b,_0x26f894,_0x93184c);else{ensureJourneyDefaults(_0x52c129['attributes']);const _0x47d4ea=await _0xfb8019['journey'][_0x18d817(0x157)](_0x52c129);return{'action':_0x18d817(0x1b0),'journeyId':_0x47d4ea['id'],'embeddedSegmentNameToId':_0x8607a9};}}else{if(_0x10a316[_0x18d817(0x152)]&&_0x10a316[_0x18d817(0x17f)])return ensureJourneyDefaults(_0x52c129[_0x18d817(0x117)]),await _0xfb8019[_0x18d817(0x15b)][_0x18d817(0x106)](_0x10a316[_0x18d817(0x17f)]['id'],_0x52c129),{'action':'updated','journeyId':_0x10a316[_0x18d817(0x17f)]['id'],'embeddedSegmentNameToId':_0x8607a9};}return{'action':_0x18d817(0x1b8),'journeyId':_0x10a316['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x8607a9};}function findSegmentCriteriaLocation(_0x2f168a,_0x5aea34){const _0x583e55=a115_0x670463,_0x5209d9=_0x2f168a['stages']||_0x2f168a[_0x583e55(0x167)]?.[0x0]?.[_0x583e55(0x109)]||[];let _0x1f52b8='entry',_0x2b96a9=_0x5aea34;const _0x334a7c=_0x2f168a[_0x583e55(0x1d3)]||_0x2f168a[_0x583e55(0x167)]?.[0x0]?.['goal'];if(_0x334a7c?.['segment']===_0x5aea34)return{'stageName':_0x583e55(0x1d3),'criteriaName':_0x334a7c[_0x583e55(0x14b)]||_0x5aea34};_0x1fe504:for(const _0x24a73d of _0x5209d9){if(_0x24a73d['entry_criteria']?.[_0x583e55(0x1d6)]===_0x5aea34){_0x1f52b8=_0x24a73d[_0x583e55(0x14b)],_0x2b96a9=_0x24a73d[_0x583e55(0x18b)]['name']||_0x5aea34;break;}if(_0x24a73d[_0x583e55(0x1b1)])for(const _0x1570cc of _0x24a73d[_0x583e55(0x1b1)]){if(_0x1570cc[_0x583e55(0x1ad)]===_0x583e55(0x194)&&_0x1570cc['with']?.['branches'])for(const _0xa77e6d of _0x1570cc[_0x583e55(0x11b)][_0x583e55(0x113)]){if(_0xa77e6d[_0x583e55(0x1d6)]===_0x5aea34){_0x1f52b8=_0x24a73d[_0x583e55(0x14b)],_0x2b96a9=_0xa77e6d['name']||_0x5aea34;break _0x1fe504;}}}}return{'stageName':_0x1f52b8,'criteriaName':_0x2b96a9};}async function executeThreeStepJourneyCreate(_0x25eb79,_0x451334,_0x183926,_0xfb5b6e,_0x85e008,_0x4fe13d,_0x3db4dc,_0x150e4c){const _0x4fd519=a115_0x670463,{activationDefToCreateRequest:_0x1da5a2,yamlRuleToApi:_0x59fece}=_0x150e4c,{pendingEmbeddedSegments:_0x4df5f4,pendingEmbeddedActivations:_0x4ef59e,embeddedSegmentNameToId:_0x399e60}=_0xfb5b6e,_0x1979f6=JSON[_0x4fd519(0x126)](JSON[_0x4fd519(0x19f)](_0x183926));ensureJourneyDefaults(_0x1979f6['attributes']),stripPendingIds(_0x1979f6);const _0x55bc87=await _0x25eb79['journey']['create'](_0x1979f6),_0x3fdd56=_0x55bc87['id'],_0x5c6727=new Map();for(const _0x7994b6 of _0x55bc87['attributes'][_0x4fd519(0x19c)]){_0x5c6727[_0x4fd519(0x1ca)](_0x7994b6[_0x4fd519(0x14b)][_0x4fd519(0x1a1)](),_0x7994b6['id']);}for(const [_0x2f6671,{definition:_0x3db969}]of _0x4df5f4){const _0x28610a=generateDeterministicJourneySegmentName(_0x451334[_0x4fd519(0x1d0)][_0x4fd519(0x14b)],_0x2f6671);_0x3db4dc['onProgress']?.({'type':_0x4fd519(0x14f),'journeyName':_0x451334['yamlConfig']['name'],'segmentName':_0x2f6671});const _0x205f4e=createSegmentIdResolver(_0x4fe13d[_0x4fd519(0x11f)],_0x2f6671),_0x14c0af=await resolveRuleSegmentIds(_0x3db969[_0x4fd519(0x107)],_0x205f4e),_0x3a1a70=await _0x25eb79['segment'][_0x4fd519(0x192)]({'name':_0x28610a,'description':_0x3db969[_0x4fd519(0x12d)]||_0x4fd519(0x133)+_0x2f6671,'journeyId':_0x3fdd56,'rule':_0x59fece(_0x14c0af,!![]),'countPopulation':!![],'parentFolderId':_0x85e008[_0x4fd519(0x148)]||'','audienceId':_0x85e008[_0x4fd519(0x132)]});_0x399e60[_0x4fd519(0x1ca)](_0x2f6671,_0x3a1a70),_0x4fe13d[_0x4fd519(0x11f)][_0x4fd519(0x1ca)](_0x2f6671,_0x3a1a70),_0x3db4dc[_0x4fd519(0x1ce)]?.({'type':'embedded_segment_created','journeyName':_0x451334[_0x4fd519(0x1d0)][_0x4fd519(0x14b)],'segmentName':_0x2f6671});}const _0x3c82b6=new Map();for(const [_0x63771a,_0x5b31aa]of _0x4ef59e){_0x3db4dc[_0x4fd519(0x1ce)]?.({'type':'embedded_activation_creating','journeyName':_0x451334[_0x4fd519(0x1d0)]['name'],'activationName':_0x63771a});const _0xf6d09a=await _0x1da5a2(_0x5b31aa,_0x4fe13d[_0x4fd519(0x137)]),_0x544155=await _0x25eb79[_0x4fd519(0x15b)][_0x4fd519(0x184)](_0x3fdd56,_0xf6d09a);_0x3c82b6[_0x4fd519(0x1ca)](_0x63771a,_0x544155['id']),_0xfb5b6e[_0x4fd519(0x19d)][_0x4fd519(0x1ca)](_0x63771a,_0x544155['id']),_0x3db4dc[_0x4fd519(0x1ce)]?.({'type':_0x4fd519(0x16c),'journeyName':_0x451334[_0x4fd519(0x1d0)]['name'],'activationName':_0x63771a});}const _0x18d17a=JSON[_0x4fd519(0x126)](JSON[_0x4fd519(0x19f)](_0x183926));return _0x18d17a['id']=_0x3fdd56,ensureJourneyDefaults(_0x18d17a['attributes']),resolvePendingIdsInRequest(_0x18d17a,_0x183926,_0x5c6727,_0x399e60,_0x3c82b6,_0x3db4dc),await _0x25eb79[_0x4fd519(0x15b)][_0x4fd519(0x106)](_0x3fdd56,_0x18d17a),{'action':_0x4fd519(0x1b0),'journeyId':_0x3fdd56,'embeddedSegmentNameToId':_0x399e60};}function stripPendingIds(_0x3113f0){const _0x5acc60=a115_0x670463;for(const _0x3e8fd4 of _0x3113f0['attributes'][_0x5acc60(0x19c)]||[]){_0x3e8fd4['entryCriteria']?.[_0x5acc60(0x1b5)]&&isPendingSegmentId(_0x3e8fd4['entryCriteria'][_0x5acc60(0x1b5)])&&delete _0x3e8fd4[_0x5acc60(0x13b)];if(_0x3e8fd4[_0x5acc60(0x1b1)])for(const _0x271dca of Object[_0x5acc60(0x16b)](_0x3e8fd4[_0x5acc60(0x1b1)])){const _0x59c296=_0x3e8fd4[_0x5acc60(0x1b1)][_0x271dca];_0x59c296['type']===_0x5acc60(0x141)&&_0x59c296[_0x5acc60(0x178)]&&isPendingActivationId(_0x59c296[_0x5acc60(0x178)])&&(_0x59c296[_0x5acc60(0x178)]='');if(_0x59c296[_0x5acc60(0x1ad)]===_0x5acc60(0x123)&&_0x59c296['branches'])for(const _0x31ff56 of _0x59c296[_0x5acc60(0x113)]){_0x31ff56['segmentId']&&isPendingSegmentId(_0x31ff56['segmentId'])&&(_0x31ff56['segmentId']='');}_0x59c296[_0x5acc60(0x1ad)]===_0x5acc60(0x1b3)&&_0x59c296[_0x5acc60(0x116)]?.[_0x5acc60(0x1b5)]&&isPendingSegmentId(_0x59c296[_0x5acc60(0x116)][_0x5acc60(0x1b5)])&&(_0x59c296['waitCondition']['segmentId']='');}}}function resolvePendingIdsInRequest(_0x359fc2,_0x354ad8,_0x15b1d9,_0x3c87d8,_0xf61908,_0x4943f7){const _0x56e04a=a115_0x670463,_0x4c554d=(_0x1539f0,_0x40d33c)=>{const _0x58f61c=a115_0x514f;if(!isPendingSegmentId(_0x1539f0))return _0x1539f0;const _0x17d03c=extractPendingSegmentName(_0x1539f0),_0x4bcf3e=_0x3c87d8[_0x58f61c(0x10b)](_0x17d03c);return!_0x4bcf3e&&_0x4943f7['logWarning']?.(_0x58f61c(0x173)+_0x17d03c+_0x58f61c(0x138)+_0x40d33c),_0x4bcf3e;};if(_0x359fc2[_0x56e04a(0x117)][_0x56e04a(0x1d3)]?.['segmentId']&&isPendingSegmentId(_0x359fc2[_0x56e04a(0x117)][_0x56e04a(0x1d3)][_0x56e04a(0x1b5)])){const _0xdc3ca1=_0x4c554d(_0x359fc2['attributes'][_0x56e04a(0x1d3)]['segmentId'],'goal\x20criteria');_0xdc3ca1&&(_0x359fc2[_0x56e04a(0x117)][_0x56e04a(0x1d3)][_0x56e04a(0x1b5)]=_0xdc3ca1);}for(const _0x3ca6a6 of _0x359fc2['attributes'][_0x56e04a(0x19c)]||[]){const _0x3d0209=_0x15b1d9[_0x56e04a(0x10b)](_0x3ca6a6[_0x56e04a(0x14b)][_0x56e04a(0x1a1)]());_0x3d0209&&(_0x3ca6a6['id']=_0x3d0209);if(_0x3ca6a6[_0x56e04a(0x13b)]?.['segmentId']&&isPendingSegmentId(_0x3ca6a6[_0x56e04a(0x13b)]['segmentId'])){const _0x286bf4=_0x4c554d(_0x3ca6a6[_0x56e04a(0x13b)][_0x56e04a(0x1b5)],_0x56e04a(0x146)+_0x3ca6a6[_0x56e04a(0x14b)]+_0x56e04a(0x17c));_0x286bf4&&(_0x3ca6a6[_0x56e04a(0x13b)][_0x56e04a(0x1b5)]=_0x286bf4);}if(_0x3ca6a6[_0x56e04a(0x19a)])for(const _0x19dc97 of _0x3ca6a6['exitCriterias']){if(_0x19dc97['segmentId']&&isPendingSegmentId(_0x19dc97[_0x56e04a(0x1b5)])){const _0x502855=_0x4c554d(_0x19dc97['segmentId'],'stage\x20\x27'+_0x3ca6a6[_0x56e04a(0x14b)]+_0x56e04a(0x17a));_0x502855&&(_0x19dc97[_0x56e04a(0x1b5)]=_0x502855);}}if(_0x3ca6a6[_0x56e04a(0x1c6)]?.[_0x56e04a(0x1b5)]&&isPendingSegmentId(_0x3ca6a6[_0x56e04a(0x1c6)][_0x56e04a(0x1b5)])){const _0x217677=_0x4c554d(_0x3ca6a6[_0x56e04a(0x1c6)]['segmentId'],_0x56e04a(0x146)+_0x3ca6a6[_0x56e04a(0x14b)]+_0x56e04a(0x144));_0x217677&&(_0x3ca6a6[_0x56e04a(0x1c6)][_0x56e04a(0x1b5)]=_0x217677);}if(_0x3ca6a6[_0x56e04a(0x1b1)]){const _0x366663=_0x5e2992=>_0x354ad8[_0x56e04a(0x117)][_0x56e04a(0x19c)][_0x56e04a(0x1b2)](_0x184bbb=>_0x184bbb[_0x56e04a(0x14b)]['toLowerCase']()===_0x3ca6a6[_0x56e04a(0x14b)][_0x56e04a(0x1a1)]())?.[_0x56e04a(0x1b1)]?.[_0x5e2992];for(const _0x3e53fb of Object[_0x56e04a(0x16b)](_0x3ca6a6[_0x56e04a(0x1b1)])){const _0x5a1c11=_0x3ca6a6[_0x56e04a(0x1b1)][_0x3e53fb],_0x516f0d=_0x366663(_0x3e53fb);if(_0x5a1c11[_0x56e04a(0x1ad)]===_0x56e04a(0x141)&&_0x5a1c11[_0x56e04a(0x178)]&&(isPendingActivationId(_0x5a1c11[_0x56e04a(0x178)])||_0x5a1c11[_0x56e04a(0x178)]==='')){if(_0x516f0d?.[_0x56e04a(0x178)]&&isPendingActivationId(_0x516f0d[_0x56e04a(0x178)])){const _0x253e5a=extractPendingActivationName(_0x516f0d[_0x56e04a(0x178)]),_0x1881f2=_0xf61908[_0x56e04a(0x10b)](_0x253e5a);_0x1881f2&&(_0x5a1c11['journeyActivationStepId']=_0x1881f2);}}if(_0x5a1c11['type']===_0x56e04a(0x123)&&_0x5a1c11[_0x56e04a(0x113)]&&_0x516f0d?.['branches'])for(let _0x4d0622=0x0;_0x4d0622<_0x5a1c11[_0x56e04a(0x113)][_0x56e04a(0x15f)];_0x4d0622++){const _0x35ea2d=_0x5a1c11['branches'][_0x4d0622],_0x385164=_0x516f0d[_0x56e04a(0x113)][_0x4d0622];if(_0x385164?.[_0x56e04a(0x1b5)]&&isPendingSegmentId(_0x385164[_0x56e04a(0x1b5)])){const _0x3ec0b9=_0x4c554d(_0x385164[_0x56e04a(0x1b5)],_0x56e04a(0x146)+_0x3ca6a6[_0x56e04a(0x14b)]+_0x56e04a(0x139)+(_0x35ea2d[_0x56e04a(0x14b)]||_0x4d0622)+'\x27');_0x3ec0b9&&(_0x35ea2d[_0x56e04a(0x1b5)]=_0x3ec0b9);}}if(_0x5a1c11[_0x56e04a(0x1ad)]===_0x56e04a(0x1b3)&&_0x5a1c11['waitCondition']?.['segmentId']&&_0x516f0d?.[_0x56e04a(0x116)]?.[_0x56e04a(0x1b5)]&&isPendingSegmentId(_0x516f0d[_0x56e04a(0x116)][_0x56e04a(0x1b5)])){const _0x41eae5=_0x4c554d(_0x516f0d[_0x56e04a(0x116)][_0x56e04a(0x1b5)],_0x56e04a(0x146)+_0x3ca6a6['name']+_0x56e04a(0x18a));_0x41eae5&&(_0x5a1c11['waitCondition']['segmentId']=_0x41eae5);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e7244,_0x1c5db5){const _0x2c0573=a116_0x1456,_0x318313=_0x4e7244();while(!![]){try{const _0x46f379=parseInt(_0x2c0573(0x1d6))/0x1*(parseInt(_0x2c0573(0x1db))/0x2)+-parseInt(_0x2c0573(0x1d8))/0x3+parseInt(_0x2c0573(0x1e0))/0x4+-parseInt(_0x2c0573(0x1e2))/0x5+parseInt(_0x2c0573(0x1de))/0x6+parseInt(_0x2c0573(0x1da))/0x7*(parseInt(_0x2c0573(0x1d5))/0x8)+-parseInt(_0x2c0573(0x1d9))/0x9;if(_0x46f379===_0x1c5db5)break;else _0x318313['push'](_0x318313['shift']());}catch(_0x32bf72){_0x318313['push'](_0x318313['shift']());}}}(a116_0x2985,0xbdf95));function a116_0x1456(_0x5f4398,_0x4dd02e){_0x5f4398=_0x5f4398-0x1d4;const _0x29851b=a116_0x2985();let _0x145646=_0x29851b[_0x5f4398];return _0x145646;}export function buildFolderIdToPathMap(_0x5a4c9c){const _0x3d6542=a116_0x1456,_0x5ee39e=new Map(),_0x5e7d0d=new Map();for(const _0x3b96b0 of _0x5a4c9c){_0x5e7d0d[_0x3d6542(0x1d4)](_0x3b96b0['id'],_0x3b96b0);}const _0x473813=new Set();for(const _0x9fd440 of _0x5a4c9c){!_0x9fd440[_0x3d6542(0x1df)]&&_0x473813['add'](_0x9fd440['id']);}function _0x5a56af(_0xaba833){const _0x7ed95d=_0x3d6542;if(_0x5ee39e['has'](_0xaba833['id']))return _0x5ee39e[_0x7ed95d(0x1dd)](_0xaba833['id']);if(_0x473813[_0x7ed95d(0x1e1)](_0xaba833['id']))return _0x5ee39e['set'](_0xaba833['id'],''),'';if(_0xaba833[_0x7ed95d(0x1df)]){const _0x133495=_0x5e7d0d[_0x7ed95d(0x1dd)](_0xaba833[_0x7ed95d(0x1df)]);if(_0x133495){const _0x4090ff=_0x5a56af(_0x133495),_0x7cbce4=_0x4090ff?_0x4090ff+'/'+_0xaba833[_0x7ed95d(0x1d7)]:_0xaba833[_0x7ed95d(0x1d7)];return _0x5ee39e[_0x7ed95d(0x1d4)](_0xaba833['id'],_0x7cbce4),_0x7cbce4;}}const _0x5d71c4=_0xaba833[_0x7ed95d(0x1d7)];return _0x5ee39e['set'](_0xaba833['id'],_0x5d71c4),_0x5d71c4;}for(const _0x164263 of _0x5a4c9c){_0x5a56af(_0x164263);}return _0x5ee39e;}export function buildFolderPathToIdMap(_0x14387d){const _0x5518f6=a116_0x1456,_0x56db08=new Map(),_0x27c603=new Map();for(const _0x4168ff of _0x14387d){_0x27c603[_0x5518f6(0x1d4)](_0x4168ff['id'],_0x4168ff);}const _0x1e5f56=new Set();for(const _0xf87c71 of _0x14387d){!_0xf87c71['parentFolderId']&&_0x1e5f56[_0x5518f6(0x1dc)](_0xf87c71['id']);}function _0x10146e(_0x325ee7){const _0x219ebf=_0x5518f6;if(_0x1e5f56[_0x219ebf(0x1e1)](_0x325ee7['id']))return'';if(_0x325ee7[_0x219ebf(0x1df)]){const _0x4c25ae=_0x27c603[_0x219ebf(0x1dd)](_0x325ee7[_0x219ebf(0x1df)]);if(_0x4c25ae){const _0x5daf2a=_0x10146e(_0x4c25ae);return _0x5daf2a?_0x5daf2a+'/'+_0x325ee7[_0x219ebf(0x1d7)]:_0x325ee7[_0x219ebf(0x1d7)];}}return _0x325ee7['name'];}for(const _0x105be3 of _0x14387d){const _0x51f283=_0x10146e(_0x105be3);_0x56db08[_0x5518f6(0x1d4)](_0x51f283,_0x105be3['id']);}return _0x56db08;}export function buildFolderMaps(_0x2864a8){const _0x254ca1=a116_0x1456,_0x54f77a=buildFolderIdToPathMap(_0x2864a8),_0xea3513=new Map();for(const [_0x1a20ad,_0x399cc9]of _0x54f77a){_0xea3513[_0x254ca1(0x1d4)](_0x399cc9,_0x1a20ad);}return{'idToPath':_0x54f77a,'pathToId':_0xea3513};}export function getFolderPath(_0x1a4ecb,_0x5bbc34){const _0x22ef32=a116_0x1456;if(!_0x1a4ecb)return'';return _0x5bbc34[_0x22ef32(0x1dd)](_0x1a4ecb)??'';}function a116_0x2985(){const _0x2b72c2=['11136024OkUHgI','7tiANsS','1460XnBqHn','add','get','7195122gLrXwR','parentFolderId','4916932USadvc','has','2644850OaIWEQ','set','11131312jAiYTe','163dhijUi','name','4183155KxgUmv'];a116_0x2985=function(){return _0x2b72c2;};return a116_0x2985();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4014c0,_0x411c55){const _0x417c28=a117_0x2c06,_0x386492=_0x4014c0();while(!![]){try{const _0x58da66=-parseInt(_0x417c28(0x123))/0x1*(-parseInt(_0x417c28(0x117))/0x2)+parseInt(_0x417c28(0x125))/0x3+-parseInt(_0x417c28(0x126))/0x4+parseInt(_0x417c28(0x100))/0x5*(-parseInt(_0x417c28(0x116))/0x6)+-parseInt(_0x417c28(0x115))/0x7+-parseInt(_0x417c28(0x11f))/0x8+parseInt(_0x417c28(0x10f))/0x9*(parseInt(_0x417c28(0x105))/0xa);if(_0x58da66===_0x411c55)break;else _0x386492['push'](_0x386492['shift']());}catch(_0x2b4bd4){_0x386492['push'](_0x386492['shift']());}}}(a117_0x4df5,0x1d90d));import a117_0x482bc9 from'path';function a117_0x2c06(_0x2e2a7c,_0x3a994c){_0x2e2a7c=_0x2e2a7c-0xff;const _0x4df500=a117_0x4df5();let _0x2c0694=_0x4df500[_0x2e2a7c];return _0x2c0694;}import{parse as a117_0x154058}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a117_0x4df5(){const _0xac190d=['relative','File\x20not\x20found:\x20','length','.yml','raw','parent_segment','segments','13779cERLvK','pop','exists','Cannot\x20navigate\x20above\x20root','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','1073163JxehBw','10674XuJEmo','526RbUuRj','readFile','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','slice','journey','isAbsolute','join','1900240kRPRbz','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','push','split','121sOGEAf','replace','534210QBrdRT','197700hrEMzW','substring','dirname','trim','resolve','parse','filter','75RERRxm','tdx.json','startsWith','test','Cannot\x20split\x20empty\x20path','2470rKwIIC','endsWith','name'];a117_0x4df5=function(){return _0xac190d;};return a117_0x4df5();}export function parsePath(_0x40ed29){const _0x27ffdf=a117_0x2c06;if(!_0x40ed29||_0x40ed29[_0x27ffdf(0x129)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x4f22f0=_0x40ed29[_0x27ffdf(0x129)]();if(_0x4f22f0==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x40ed29};const _0xe3cbae=_0x4f22f0['startsWith']('/')?_0x4f22f0[_0x27ffdf(0x127)](0x1):_0x4f22f0,_0x56f13b=_0xe3cbae[_0x27ffdf(0x122)]('/')[_0x27ffdf(0xff)](_0x4a434e=>_0x4a434e!=='');if(_0x56f13b[_0x27ffdf(0x10a)]===0x0)throw new Error(_0x27ffdf(0x114));const _0x420aa6=_0x4f22f0[_0x27ffdf(0x102)]('/')||!isRelativePathSegment(_0x56f13b[0x0]);for(const _0x1ffa71 of _0x56f13b){validatePathSegment(_0x1ffa71);}return{'segments':_0x56f13b,'isAbsolute':_0x420aa6,'raw':_0x40ed29};}function isRelativePathSegment(_0x34a7f5){return _0x34a7f5==='.'||_0x34a7f5==='..';}function validatePathSegment(_0x454dcd){const _0x15cc8b=a117_0x2c06;if(_0x454dcd==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x454dcd==='.'||_0x454dcd==='..')return;if(/[\x00-\x1F\x7F]/[_0x15cc8b(0x103)](_0x454dcd))throw new Error(_0x15cc8b(0x11a)+_0x454dcd);if(_0x454dcd!==_0x454dcd[_0x15cc8b(0x129)]()){}}export function validatePath(_0x5e89a6){const _0x2773f9=a117_0x2c06;if(_0x5e89a6[_0x2773f9(0x10e)][_0x2773f9(0x10a)]===0x0&&!_0x5e89a6[_0x2773f9(0x11d)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x5e89a6['isAbsolute']){if(_0x5e89a6[_0x2773f9(0x10e)][0x0]==='..')throw new Error(_0x2773f9(0x113));let _0x3b81d2=0x0;for(const _0x18f4ce of _0x5e89a6[_0x2773f9(0x10e)]){if(_0x18f4ce==='..'){if(_0x3b81d2===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x3b81d2--;}else _0x18f4ce!=='.'&&_0x3b81d2++;}}}export function joinPaths(_0x250de4,_0xed6a81){const _0x5278d8=a117_0x2c06;if(!_0x250de4||_0x250de4==='/')return _0xed6a81;if(!_0xed6a81||_0xed6a81==='.')return _0x250de4;if(_0xed6a81[_0x5278d8(0x102)]('/'))return _0xed6a81;const _0x6e8293=parsePath(_0x250de4),_0x4a5de0=parsePath(_0xed6a81),_0x3f489c=[..._0x6e8293[_0x5278d8(0x10e)]];for(const _0x4db75a of _0x4a5de0[_0x5278d8(0x10e)]){if(_0x4db75a==='.')continue;else{if(_0x4db75a==='..'){if(_0x3f489c['length']===0x0)throw new Error(_0x5278d8(0x112));_0x3f489c[_0x5278d8(0x110)]();}else _0x3f489c[_0x5278d8(0x121)](_0x4db75a);}}const _0x2901b1=_0x3f489c[_0x5278d8(0x11e)]('/');return _0x6e8293['raw']['startsWith']('/')?'/'+_0x2901b1:_0x2901b1;}export function normalizePath(_0x272a9c){const _0x1793ec=a117_0x2c06,_0x478b1d=parsePath(_0x272a9c),_0x32ebf8=[];for(const _0x31e587 of _0x478b1d['segments']){if(_0x31e587==='.')continue;else{if(_0x31e587==='..'){if(_0x32ebf8['length']===0x0){if(_0x478b1d[_0x1793ec(0x11d)])throw new Error(_0x1793ec(0x112));_0x32ebf8[_0x1793ec(0x121)]('..');}else _0x32ebf8[_0x32ebf8[_0x1793ec(0x10a)]-0x1]==='..'?_0x32ebf8[_0x1793ec(0x121)]('..'):_0x32ebf8[_0x1793ec(0x110)]();}else _0x32ebf8['push'](_0x31e587);}}if(_0x32ebf8[_0x1793ec(0x10a)]===0x0)return _0x478b1d['isAbsolute']?'/':'.';const _0x437030=_0x32ebf8[_0x1793ec(0x11e)]('/');return _0x478b1d[_0x1793ec(0x10c)][_0x1793ec(0x102)]('/')?'/'+_0x437030:_0x437030;}export function getParentPath(_0xde89f){const _0x26901e=a117_0x2c06,_0x225bdc=parsePath(_0xde89f);if(_0x225bdc['segments'][_0x26901e(0x10a)]<=0x1)return'/';const _0x2dc23b=_0x225bdc['segments']['slice'](0x0,-0x1)[_0x26901e(0x11e)]('/');return _0x225bdc['raw'][_0x26901e(0x102)]('/')?'/'+_0x2dc23b:_0x2dc23b;}export function getBaseName(_0x33ef3d){const _0x32e8e0=a117_0x2c06,_0x4569cf=parsePath(_0x33ef3d);return _0x4569cf[_0x32e8e0(0x10e)][_0x4569cf['segments'][_0x32e8e0(0x10a)]-0x1]||'';}export function isChildPath(_0x3a0a1a,_0x1becb8){const _0xdc1382=a117_0x2c06,_0x68a9c6=parsePath(_0x3a0a1a),_0x46a4a2=parsePath(_0x1becb8);if(_0x68a9c6[_0xdc1382(0x10e)][_0xdc1382(0x10a)]<=_0x46a4a2[_0xdc1382(0x10e)][_0xdc1382(0x10a)])return![];for(let _0x91321b=0x0;_0x91321b<_0x46a4a2[_0xdc1382(0x10e)][_0xdc1382(0x10a)];_0x91321b++){if(_0x68a9c6[_0xdc1382(0x10e)][_0x91321b]!==_0x46a4a2[_0xdc1382(0x10e)][_0x91321b])return![];}return!![];}export function splitPath(_0x2b100e){const _0x173500=a117_0x2c06,_0x10caf1=parsePath(_0x2b100e);if(_0x10caf1['segments'][_0x173500(0x10a)]===0x0)throw new Error(_0x173500(0x104));if(_0x10caf1['segments'][_0x173500(0x10a)]===0x1)return{'parent':_0x10caf1[_0x173500(0x10e)][0x0]};return{'parent':_0x10caf1[_0x173500(0x10e)][0x0],'child':_0x10caf1[_0x173500(0x10e)][_0x173500(0x11b)](0x1)['join']('/')};}export function isYamlFilePath(_0xe77e42){const _0x12051b=a117_0x2c06;return _0xe77e42[_0x12051b(0x106)](_0x12051b(0x10b))||_0xe77e42[_0x12051b(0x106)]('.yaml');}export async function resolveYamlFilePath(_0x294600,_0x17fb00=nodeFileSystem){const _0x5356a7=a117_0x2c06,_0x26d13d=a117_0x482bc9[_0x5356a7(0x12a)](_0x294600);if(!await _0x17fb00['exists'](_0x26d13d))throw new Error(_0x5356a7(0x109)+_0x294600);let _0x475833=a117_0x482bc9[_0x5356a7(0x128)](_0x26d13d),_0x67435c=null,_0xf0e5b0=null;const _0x329d66=a117_0x482bc9[_0x5356a7(0x12b)](_0x475833)['root'];while(_0x475833!==_0x329d66){const _0x5079f5=a117_0x482bc9['join'](_0x475833,_0x5356a7(0x101));if(await _0x17fb00[_0x5356a7(0x111)](_0x5079f5)){_0x67435c=_0x5079f5,_0xf0e5b0=_0x475833;break;}_0x475833=a117_0x482bc9[_0x5356a7(0x128)](_0x475833);}if(!_0x67435c||!_0xf0e5b0)throw new Error(_0x5356a7(0x119)+_0x294600);const _0x57ad9a=await _0x17fb00[_0x5356a7(0x118)](_0x67435c),_0x4a6777=JSON[_0x5356a7(0x12b)](_0x57ad9a),_0x451022=_0x4a6777[_0x5356a7(0x10d)];if(!_0x451022)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x144193=await _0x17fb00[_0x5356a7(0x118)](_0x26d13d),_0x3113eb=a117_0x154058(_0x144193),_0x58f1d9=_0x3113eb[_0x5356a7(0x107)];if(!_0x58f1d9)throw new Error(_0x5356a7(0x120)+_0x294600);const _0x55fe91=_0x3113eb['type']==='journey'?_0x5356a7(0x11c):'segment',_0x518593=a117_0x482bc9[_0x5356a7(0x108)](_0xf0e5b0,_0x26d13d),_0x5dcd60=a117_0x482bc9[_0x5356a7(0x128)](_0x518593),_0x27443a=_0x5dcd60==='.'?'':_0x5dcd60[_0x5356a7(0x124)](/\\/g,'/'),_0xa86dd9=_0x27443a?_0x451022+'/'+_0x27443a+'/'+_0x58f1d9:_0x451022+'/'+_0x58f1d9;return{'parentSegment':_0x451022,'segmentName':_0x58f1d9,'folderPath':_0x27443a,'fullPath':_0xa86dd9,'resourceType':_0x55fe91};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x11c35e,_0x4ea451){const _0x22c536=a118_0x378c,_0x2844e9=_0x11c35e();while(!![]){try{const _0x2b6197=-parseInt(_0x22c536(0x10f))/0x1*(parseInt(_0x22c536(0x10e))/0x2)+parseInt(_0x22c536(0x110))/0x3*(parseInt(_0x22c536(0x114))/0x4)+-parseInt(_0x22c536(0x10a))/0x5+-parseInt(_0x22c536(0x112))/0x6+parseInt(_0x22c536(0x111))/0x7*(-parseInt(_0x22c536(0x10c))/0x8)+parseInt(_0x22c536(0x107))/0x9+parseInt(_0x22c536(0x10d))/0xa;if(_0x2b6197===_0x4ea451)break;else _0x2844e9['push'](_0x2844e9['shift']());}catch(_0x4e8ab5){_0x2844e9['push'](_0x2844e9['shift']());}}}(a118_0x363b,0x526ba));function a118_0x363b(){const _0x19d5d7=['165400gYYimK','.\x20Child\x20name\x20cannot\x20be\x20empty','3443031wToLmT','substring','Invalid\x20segment\x20reference\x20format:\x20','2480875nFspFf','.\x20Parent\x20name\x20cannot\x20be\x20empty','32FsKqUw','6300510SybRWG','128JPJJNj','5302sYkrpM','42ccRFJp','322826ptZEpT','1403646YfRWrc','indexOf'];a118_0x363b=function(){return _0x19d5d7;};return a118_0x363b();}function a118_0x378c(_0x48da7e,_0x3aa70b){_0x48da7e=_0x48da7e-0x107;const _0x363b0a=a118_0x363b();let _0x378c21=_0x363b0a[_0x48da7e];return _0x378c21;}export function parseSegmentRef(_0x3f19a7){const _0xdd30cf=a118_0x378c,_0x28e0fc=_0x3f19a7[_0xdd30cf(0x113)]('/');if(_0x28e0fc===-0x1)return{'parentId':_0x3f19a7};if(_0x28e0fc===0x0)throw new Error(_0xdd30cf(0x109)+_0x3f19a7+_0xdd30cf(0x10b));const _0x20b29f=_0x3f19a7[_0xdd30cf(0x108)](0x0,_0x28e0fc),_0x34d451=_0x3f19a7[_0xdd30cf(0x108)](_0x28e0fc+0x1);if(_0x34d451==='')throw new Error(_0xdd30cf(0x109)+_0x3f19a7+_0xdd30cf(0x115));return{'parentId':_0x20b29f,'childId':_0x34d451};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a119_0xe6f0(_0x184391,_0x17ace8){_0x184391=_0x184391-0x11c;const _0x1ab9c5=a119_0x1ab9();let _0xe6f043=_0x1ab9c5[_0x184391];return _0xe6f043;}(function(_0x2f75b1,_0x4e17fe){const _0x1cadb1=a119_0xe6f0,_0x5de558=_0x2f75b1();while(!![]){try{const _0x5a164c=-parseInt(_0x1cadb1(0x135))/0x1+parseInt(_0x1cadb1(0x12b))/0x2+parseInt(_0x1cadb1(0x151))/0x3*(parseInt(_0x1cadb1(0x13f))/0x4)+-parseInt(_0x1cadb1(0x144))/0x5*(-parseInt(_0x1cadb1(0x13a))/0x6)+-parseInt(_0x1cadb1(0x127))/0x7*(-parseInt(_0x1cadb1(0x147))/0x8)+-parseInt(_0x1cadb1(0x130))/0x9*(-parseInt(_0x1cadb1(0x14e))/0xa)+-parseInt(_0x1cadb1(0x129))/0xb;if(_0x5a164c===_0x4e17fe)break;else _0x5de558['push'](_0x5de558['shift']());}catch(_0x2283f5){_0x5de558['push'](_0x5de558['shift']());}}}(a119_0x1ab9,0x82ed9));import a119_0x1e2b23 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x4d89f1){const _0xa4666f=a119_0xe6f0;return _0x4d89f1[_0xa4666f(0x136)]!==_0xa4666f(0x11d);}export function isScopedResolution(_0x5489ac){const _0xdd74f=a119_0xe6f0;return _0x5489ac[_0xdd74f(0x136)]===_0xdd74f(0x11c)||_0x5489ac['type']===_0xdd74f(0x132)||_0x5489ac[_0xdd74f(0x136)]===_0xdd74f(0x140);}export function getScopedDetails(_0x640177){const _0x4c128b=a119_0xe6f0;if(isScopedResolution(_0x640177))return{'isScoped':_0x640177[_0x4c128b(0x11e)],'scopedFolderPath':_0x640177[_0x4c128b(0x152)]};return undefined;}async function findTdxConfigAsync(_0x3474a1,_0x51dc69){const _0x10a6b5=a119_0xe6f0;let _0x4ea006=a119_0x1e2b23[_0x10a6b5(0x138)](_0x3474a1);const _0x1905ee=a119_0x1e2b23[_0x10a6b5(0x155)](_0x4ea006)[_0x10a6b5(0x13c)];while(_0x4ea006!==_0x1905ee){const _0x16eb0d=a119_0x1e2b23[_0x10a6b5(0x134)](_0x4ea006,_0x10a6b5(0x146));if(await _0x51dc69[_0x10a6b5(0x14d)](_0x16eb0d))try{const _0x45d0f0=await _0x51dc69[_0x10a6b5(0x123)](_0x16eb0d),_0x112e7e=JSON[_0x10a6b5(0x155)](_0x45d0f0);if(_0x112e7e[_0x10a6b5(0x125)]&&typeof _0x112e7e[_0x10a6b5(0x125)]===_0x10a6b5(0x12a))return{'configPath':_0x16eb0d,'configDir':_0x4ea006,'parentSegment':_0x112e7e[_0x10a6b5(0x125)]};}catch{}_0x4ea006=a119_0x1e2b23[_0x10a6b5(0x143)](_0x4ea006);}return null;}function a119_0x1ab9(){const _0x22425e=['parse','startsWith','directory','error','isScoped','replace','segmentName','isFile','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','readFile','file_not_found','parent_segment','Not\x20a\x20YAML\x20file:\x20','1665552mzugyo','message','24499761RaajKW','string','1105784EDVfmy','segment','File\x20not\x20found:\x20','invalid_yaml','includes','792SuUWen','parentSegment','file','no_parent','join','714154bkTFAr','type','resourceType','resolve','No\x20tdx.json\x20found\x20for\x20file:\x20','30PnDRdV','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','root','parent_name','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','92ocKzEB','context','File\x20not\x20found','relative','dirname','944185cMBAqK','No\x20tdx.json\x20found','tdx.json','16YhzaUH','configDir','folderPath','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','match','basename','exists','104170DWbSoF','no_config','extname','76701WSVApi','scopedFolderPath','trim','isDirectory'];a119_0x1ab9=function(){return _0x22425e;};return a119_0x1ab9();}function calculateScopedPath(_0x33f925,_0x5bdaa2){const _0x18ac3f=a119_0xe6f0,_0x2be5e5=a119_0x1e2b23[_0x18ac3f(0x142)](_0x5bdaa2,_0x33f925),_0x3d0677=_0x2be5e5!==''&&_0x2be5e5!=='.'&&!_0x2be5e5[_0x18ac3f(0x156)]('..');return{'isScoped':_0x3d0677,'scopedFolderPath':_0x3d0677?_0x2be5e5[_0x18ac3f(0x11f)](/\\/g,'/'):''};}export async function resolveTarget(_0x2f0b82){const _0x51d339=a119_0xe6f0,{arg:_0x53040c,contextParent:_0x4828ec,cwd:cwd=process['cwd'](),fs:fs=nodeFileSystem}=_0x2f0b82;if(_0x53040c&&isYamlFilePath(_0x53040c))try{const _0x4807f2=await resolveYamlFilePath(_0x53040c,fs),_0xac91b=a119_0x1e2b23[_0x51d339(0x138)](_0x53040c),_0x28a0fe=a119_0x1e2b23[_0x51d339(0x143)](_0xac91b),_0x1fd3fa=await findTdxConfigAsync(_0x28a0fe,fs);if(!_0x1fd3fa){if(_0x4828ec){const _0x4b4b73=a119_0x1e2b23[_0x51d339(0x143)](_0xac91b);return{'type':'file','parentName':_0x4828ec,'targetDir':_0x4b4b73,'configRoot':_0x4b4b73,'filePath':_0xac91b,'resourceName':_0x4807f2[_0x51d339(0x120)],'folderPath':_0x4807f2[_0x51d339(0x149)],'resourceType':_0x4807f2['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x51d339(0x11d),'errorCode':'no_config','message':_0x51d339(0x139)+_0x53040c,'arg':_0x53040c,'helpText':_0x51d339(0x13e)};}const _0x3a14d7=calculateScopedPath(_0x28a0fe,_0x1fd3fa['configDir']);return{'type':_0x51d339(0x132),'parentName':_0x1fd3fa[_0x51d339(0x131)],'targetDir':_0x1fd3fa[_0x51d339(0x148)],'configRoot':_0x1fd3fa['configDir'],'filePath':_0xac91b,'resourceName':_0x4807f2['segmentName'],'folderPath':_0x4807f2[_0x51d339(0x149)],'resourceType':_0x4807f2[_0x51d339(0x137)],'isScoped':_0x3a14d7[_0x51d339(0x11e)],'scopedFolderPath':_0x3a14d7[_0x51d339(0x152)]};}catch(_0x223969){const _0x117fa4=_0x223969 instanceof Error?_0x223969[_0x51d339(0x128)]:String(_0x223969);if(_0x117fa4[_0x51d339(0x12f)](_0x51d339(0x141)))return{'type':_0x51d339(0x11d),'errorCode':_0x51d339(0x124),'message':_0x51d339(0x12d)+_0x53040c,'arg':_0x53040c};if(_0x117fa4['includes'](_0x51d339(0x145))){if(_0x4828ec){const _0x62637f=a119_0x1e2b23['resolve'](_0x53040c);if(await fs['exists'](_0x62637f)){const _0x4f3ee9=a119_0x1e2b23[_0x51d339(0x143)](_0x62637f),_0x53699a=await fs['readFile'](_0x62637f),_0x520e01=_0x53699a[_0x51d339(0x14b)](/^name:\s*["']?([^"'\n]+)["']?/m),_0xc3a8c1=_0x53699a['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4de0f8=_0x520e01?_0x520e01[0x1]['trim']():a119_0x1e2b23[_0x51d339(0x14c)](_0x53040c,a119_0x1e2b23[_0x51d339(0x150)](_0x53040c)),_0x724bdb=_0xc3a8c1&&_0xc3a8c1[0x1][_0x51d339(0x153)]()==='journey'?'journey':_0x51d339(0x12c);return{'type':_0x51d339(0x132),'parentName':_0x4828ec,'targetDir':_0x4f3ee9,'configRoot':_0x4f3ee9,'filePath':_0x62637f,'resourceName':_0x4de0f8,'folderPath':'','resourceType':_0x724bdb,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x51d339(0x11d),'errorCode':_0x51d339(0x14f),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x53040c,'arg':_0x53040c,'helpText':'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'};}return{'type':'error','errorCode':_0x51d339(0x12e),'message':_0x117fa4,'arg':_0x53040c};}if(_0x53040c){const _0x1ef803=a119_0x1e2b23[_0x51d339(0x138)](cwd,_0x53040c);let _0x2ee037=null;try{_0x2ee037=await fs['stat'](_0x1ef803);}catch{}if(_0x2ee037?.[_0x51d339(0x154)]()){const _0x1b37dc=await findTdxConfigAsync(_0x1ef803,fs);if(_0x1b37dc){const _0x45d53e=calculateScopedPath(_0x1ef803,_0x1b37dc[_0x51d339(0x148)]);return{'type':'directory','parentName':_0x1b37dc[_0x51d339(0x131)],'targetDir':_0x1ef803,'configRoot':_0x1b37dc[_0x51d339(0x148)],'isScoped':_0x45d53e[_0x51d339(0x11e)],'scopedFolderPath':_0x45d53e[_0x51d339(0x152)]};}if(_0x4828ec)return{'type':_0x51d339(0x11c),'parentName':_0x4828ec,'targetDir':_0x1ef803,'configRoot':_0x1ef803,'isScoped':![],'scopedFolderPath':''};return{'type':_0x51d339(0x11d),'errorCode':_0x51d339(0x14f),'message':_0x51d339(0x122)+_0x53040c,'arg':_0x53040c,'helpText':'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'};}if(_0x2ee037?.[_0x51d339(0x121)]())return{'type':'error','errorCode':_0x51d339(0x12e),'message':_0x51d339(0x126)+_0x53040c,'arg':_0x53040c,'helpText':_0x51d339(0x13b)};const _0x258d4d=sanitizeFileName(_0x53040c),_0x1952f2=getSegmentRootDir(_0x258d4d,cwd);return{'type':_0x51d339(0x13d),'parentName':_0x53040c,'targetDir':_0x1952f2,'configRoot':_0x1952f2};}const _0x2009ca=await findTdxConfigAsync(cwd,fs);if(_0x2009ca){const _0x39e093=calculateScopedPath(cwd,_0x2009ca[_0x51d339(0x148)]);return{'type':_0x51d339(0x140),'parentName':_0x2009ca[_0x51d339(0x131)],'targetDir':cwd,'configRoot':_0x2009ca[_0x51d339(0x148)],'isScoped':_0x39e093[_0x51d339(0x11e)],'scopedFolderPath':_0x39e093[_0x51d339(0x152)]};}if(_0x4828ec){const _0x358023=sanitizeFileName(_0x4828ec),_0x45b1ec=getSegmentRootDir(_0x358023,cwd);return{'type':_0x51d339(0x140),'parentName':_0x4828ec,'targetDir':_0x45b1ec,'configRoot':_0x45b1ec,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x51d339(0x11d),'errorCode':_0x51d339(0x133),'message':'Parent\x20segment\x20not\x20specified','helpText':_0x51d339(0x14a)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a120_0xff88(){const _0x4c4cdc=['11594430NAkbsk','join','root','15384SEUswk','dirname','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','parent_segment','tdx.json','2724925pfKWqi','333kKvLlj','603777yRGdeM','replace','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','resolve','stringify','relative','1322624QVUmLW','object','72HeUhQK','257020hGRGZC','parse','2fTqegS','Invalid\x20tdx.json:\x20expected\x20object','cwd','segments','12278YxaBnT','Invalid\x20JSON\x20in\x20'];a120_0xff88=function(){return _0x4c4cdc;};return a120_0xff88();}const a120_0x1bf343=a120_0x3896;(function(_0xb214b3,_0x3a5285){const _0x31cecb=a120_0x3896,_0x2ca57a=_0xb214b3();while(!![]){try{const _0x44ee82=parseInt(_0x31cecb(0x19e))/0x1+-parseInt(_0x31cecb(0x1a0))/0x2*(parseInt(_0x31cecb(0x195))/0x3)+-parseInt(_0x31cecb(0x19b))/0x4+-parseInt(_0x31cecb(0x193))/0x5+-parseInt(_0x31cecb(0x19d))/0x6*(-parseInt(_0x31cecb(0x189))/0x7)+-parseInt(_0x31cecb(0x18e))/0x8*(parseInt(_0x31cecb(0x194))/0x9)+parseInt(_0x31cecb(0x18b))/0xa;if(_0x44ee82===_0x3a5285)break;else _0x2ca57a['push'](_0x2ca57a['shift']());}catch(_0x2e9571){_0x2ca57a['push'](_0x2ca57a['shift']());}}}(a120_0xff88,0x46ab4));import{existsSync,readFileSync}from'fs';import a120_0x5da368 from'path';const TDX_CONFIG_FILE=a120_0x1bf343(0x192),SEGMENTS_DIR=a120_0x1bf343(0x1a3);export function findTdxConfigPath(_0x52d0fa=process['cwd']()){const _0x34eaee=a120_0x1bf343;let _0x3c2a25=a120_0x5da368[_0x34eaee(0x198)](_0x52d0fa);const _0x4077e3=a120_0x5da368[_0x34eaee(0x19f)](_0x3c2a25)[_0x34eaee(0x18d)];while(_0x3c2a25!==_0x4077e3){const _0x11216b=a120_0x5da368[_0x34eaee(0x18c)](_0x3c2a25,TDX_CONFIG_FILE);if(existsSync(_0x11216b))return _0x11216b;_0x3c2a25=a120_0x5da368[_0x34eaee(0x18f)](_0x3c2a25);}return null;}export function loadTdxConfig(_0x8a7aec){const _0x5b1e3e=a120_0x1bf343,_0x472f90=readFileSync(_0x8a7aec,'utf-8');let _0x7b419;try{_0x7b419=JSON['parse'](_0x472f90);}catch{throw new Error(_0x5b1e3e(0x18a)+_0x8a7aec);}if(!_0x7b419||typeof _0x7b419!==_0x5b1e3e(0x19c))throw new Error(_0x5b1e3e(0x1a1));const _0x1358fe=_0x7b419;if(!_0x1358fe[_0x5b1e3e(0x191)]||typeof _0x1358fe[_0x5b1e3e(0x191)]!=='string')throw new Error(_0x5b1e3e(0x197));return{'parent_segment':_0x1358fe[_0x5b1e3e(0x191)]};}function a120_0x3896(_0x1d88fa,_0x2132b4){_0x1d88fa=_0x1d88fa-0x189;const _0xff880a=a120_0xff88();let _0x3896a2=_0xff880a[_0x1d88fa];return _0x3896a2;}export function findTdxConfig(_0x11709d=process[a120_0x1bf343(0x1a2)]()){const _0x50de0a=a120_0x1bf343,_0x4e4f5b=findTdxConfigPath(_0x11709d);if(!_0x4e4f5b)throw new Error(_0x50de0a(0x190));const _0x36983b=loadTdxConfig(_0x4e4f5b),_0x464822=a120_0x5da368[_0x50de0a(0x18f)](_0x4e4f5b);return{'config':_0x36983b,'configPath':_0x4e4f5b,'configDir':_0x464822};}export function tryFindTdxConfig(_0xcbce1a){try{return findTdxConfig(_0xcbce1a);}catch{return null;}}export function getSegmentRootDir(_0x3de39a,_0x462236=process['cwd']()){return a120_0x5da368['join'](_0x462236,SEGMENTS_DIR,_0x3de39a);}export function getTdxConfigPath(_0x595aac,_0x313b6e=process[a120_0x1bf343(0x1a2)]()){const _0x435150=a120_0x1bf343;return a120_0x5da368[_0x435150(0x18c)](getSegmentRootDir(_0x595aac,_0x313b6e),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x4806e3,_0x29bac0){const _0x39075e=a120_0x1bf343,_0x5c4f90=a120_0x5da368[_0x39075e(0x198)](_0x4806e3),_0x534ca3=a120_0x5da368[_0x39075e(0x19a)](_0x29bac0,_0x5c4f90);if(_0x534ca3['startsWith']('..'))return'';return _0x534ca3;}export function localPathToTdFolderPath(_0x19ece6){const _0x4763df=a120_0x1bf343,_0x5da2df=a120_0x5da368[_0x4763df(0x18f)](_0x19ece6);if(_0x5da2df==='.'||_0x5da2df==='')return'';return _0x5da2df[_0x4763df(0x196)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x62f366,_0x3fb61d){if(!_0x62f366)return _0x3fb61d;return a120_0x5da368['join'](_0x3fb61d,_0x62f366);}export function createTdxConfigContent(_0x45ba10){const _0x275d0d=a120_0x1bf343,_0x58eac7={'parent_segment':_0x45ba10};return JSON[_0x275d0d(0x199)](_0x58eac7,null,0x2)+'\x0a';}
|