@treasuredata/tdx 0.23.1 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a110_0x40c26b=a110_0x371e;(function(_0x38fe1f,_0x388c0c){const _0x1c814e=a110_0x371e,_0x400867=_0x38fe1f();while(!![]){try{const _0x51421d=-parseInt(_0x1c814e(0xf5))/0x1*(parseInt(_0x1c814e(0xd6))/0x2)+-parseInt(_0x1c814e(0x155))/0x3*(-parseInt(_0x1c814e(0x146))/0x4)+parseInt(_0x1c814e(0x12c))/0x5*(parseInt(_0x1c814e(0xc6))/0x6)+parseInt(_0x1c814e(0xba))/0x7+parseInt(_0x1c814e(0x98))/0x8*(parseInt(_0x1c814e(0x142))/0x9)+parseInt(_0x1c814e(0x122))/0xa+-parseInt(_0x1c814e(0x163))/0xb;if(_0x51421d===_0x388c0c)break;else _0x400867['push'](_0x400867['shift']());}catch(_0x21ab9b){_0x400867['push'](_0x400867['shift']());}}}(a110_0x2253,0x3477b));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a110_0x40c26b(0xd3);export function createPendingSegmentId(_0x4b45e2){return''+PENDING_SEGMENT_PREFIX+_0x4b45e2+'__';}export function isPendingSegmentId(_0x4ec188){return _0x4ec188['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5bb410){const _0x367365=a110_0x40c26b;return _0x5bb410[_0x367365(0x150)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1ed91d){return''+PENDING_ACTIVATION_PREFIX+_0x1ed91d+'__';}export function isPendingActivationId(_0x17131f){const _0x11d538=a110_0x40c26b;return _0x17131f[_0x11d538(0x168)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1eb424){return _0x1eb424['replace'](/^__pending_act_(.+)__$/,'$1');}function a110_0x371e(_0x214e95,_0x30f97e){_0x214e95=_0x214e95-0x84;const _0x225317=a110_0x2253();let _0x371ea0=_0x225317[_0x214e95];return _0x371ea0;}function generateDeterministicJourneySegmentName(_0x54a162,_0x378f82){const _0x54af5f=a110_0x40c26b,_0x367546=_0x54a162+'::'+(_0x378f82['trim']()||_0x54af5f(0x10b)),_0x13168b=createHash('sha1')[_0x54af5f(0xb9)](_0x367546)[_0x54af5f(0x160)](_0x54af5f(0xfe))['slice'](0x0,0xc);return _0x54af5f(0xfa)+_0x13168b;}export function ensureJourneyDefaults(_0x7ba53a){const _0x36fe9e=a110_0x40c26b;!_0x7ba53a[_0x36fe9e(0x135)]&&(_0x7ba53a['description']=''),!_0x7ba53a[_0x36fe9e(0x105)]&&(_0x7ba53a[_0x36fe9e(0x105)]=_0x36fe9e(0x137));}export function resolveTDFolderPath(_0x55a27d,_0x1984ad,_0x6df61c){if(!_0x1984ad)return _0x55a27d;if(_0x55a27d===_0x6df61c||_0x55a27d['startsWith'](_0x6df61c+'/'))return _0x55a27d;return _0x55a27d?_0x6df61c+'/'+_0x55a27d:_0x6df61c;}export function addFoldersToCreate(_0x512a4b,_0x5f572f,_0x19343e){const _0x5cfe23=a110_0x40c26b;if(!_0x512a4b)return;if(_0x5f572f[_0x5cfe23(0x167)](_0x512a4b))return;const _0x99025c=_0x512a4b[_0x5cfe23(0x159)]('/');let _0x503933='';for(const _0xc20a91 of _0x99025c){_0x503933=_0x503933?_0x503933+'/'+_0xc20a91:_0xc20a91,!_0x5f572f[_0x5cfe23(0x167)](_0x503933)&&_0x19343e[_0x5cfe23(0xb6)](_0x503933);}}import*as a110_0x345e85 from'yaml';import{readFileSync}from'fs';import a110_0x2f9800 from'path';import{isJourneyDef,parseYamlString as a110_0x17e757,toYamlString as a110_0x33704e,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(_0x1d3827){const _0x31aa97=a110_0x40c26b;if(Array[_0x31aa97(0x129)](_0x1d3827))return'['+_0x1d3827['map'](_0x504c45=>stableStringify(_0x504c45))[_0x31aa97(0x92)](',')+']';if(_0x1d3827&&typeof _0x1d3827===_0x31aa97(0xdb)){const _0x958d4c=_0x1d3827,_0xbefd76=Object['keys'](_0x958d4c)['sort'](),_0x3428c2=_0xbefd76[_0x31aa97(0x115)](_0x3380b6=>'\x22'+_0x3380b6+'\x22:'+stableStringify(_0x958d4c[_0x3380b6]));return'{'+_0x3428c2[_0x31aa97(0x92)](',')+'}';}const _0x53ce01=JSON[_0x31aa97(0x15c)](_0x1d3827);return _0x53ce01===undefined?_0x31aa97(0x154):_0x53ce01;}function activationSignature(_0x402e61){const _0x3da27e=a110_0x40c26b,_0x12c3bb={'connection':_0x402e61[_0x3da27e(0x11f)],..._0x402e61[_0x3da27e(0xe9)]!==undefined&&{'all_columns':_0x402e61[_0x3da27e(0xe9)]},..._0x402e61[_0x3da27e(0x8c)]!==undefined&&{'columns':_0x402e61[_0x3da27e(0x8c)]},..._0x402e61[_0x3da27e(0x165)]!==undefined&&{'behavior':_0x402e61[_0x3da27e(0x165)]},..._0x402e61[_0x3da27e(0xfc)]!==undefined&&{'schedule':_0x402e61[_0x3da27e(0xfc)]},..._0x402e61[_0x3da27e(0xdf)]!==undefined&&{'notification':_0x402e61[_0x3da27e(0xdf)]},..._0x402e61[_0x3da27e(0x8d)]!==undefined&&{'connector_config':_0x402e61[_0x3da27e(0x8d)]},..._0x402e61[_0x3da27e(0xce)]!==undefined&&{'activation_template_id':_0x402e61[_0x3da27e(0xce)]}};return stableStringify(_0x12c3bb);}export async function prepareSegmentFiles(_0x22fb2f,_0x169b91,_0x9a9e31,_0x25d8e9,_0x476b18){const _0x4daebc=a110_0x40c26b,{activationDefToCreateRequest:_0x9c0b29}=await import(_0x4daebc(0x158)),_0x54a6d7=[],_0x28e25f=new Set();for(const {yamlConfig:_0x28522f,folderPath:_0x4257e7,sourcePath:_0x56f86d}of _0x22fb2f){const _0x109de5=resolveTDFolderPath(_0x4257e7,_0x25d8e9,_0x476b18),_0x1dec21=_0x109de5+':'+_0x28522f[_0x4daebc(0x15d)],_0x3bc791=_0x169b91[_0x4daebc(0x10e)][_0x4daebc(0x109)](_0x1dec21),_0x3b89e3=_0x3bc791?_0x169b91[_0x4daebc(0xee)]['get'](_0x3bc791['id'])||[]:[];addFoldersToCreate(_0x109de5,_0x169b91[_0x4daebc(0x14b)],_0x28e25f);const _0x154191=calculateActivationActions(_0x28522f['activations']||[],_0x3b89e3,_0x169b91[_0x4daebc(0xc7)],_0x169b91[_0x4daebc(0x169)]);for(const _0xca13e3 of _0x154191){(_0xca13e3[_0x4daebc(0x162)]==='create'||_0xca13e3[_0x4daebc(0x162)]===_0x4daebc(0xb9))&&_0xca13e3[_0x4daebc(0xbf)]&&(_0xca13e3['validatedRequest']=await _0x9c0b29(_0xca13e3[_0x4daebc(0xbf)],_0x9a9e31));}const _0x373d4c=calculateSegmentDiff(_0x28522f,_0x3bc791,_0x3b89e3,_0x169b91[_0x4daebc(0xc7)],_0x169b91[_0x4daebc(0x169)]);_0x54a6d7[_0x4daebc(0x145)]({'relativePath':_0x28522f['name'],'absolutePath':_0x56f86d,'yamlConfig':_0x28522f,'folderPath':_0x109de5,'existingSegment':_0x3bc791,'existingActivations':_0x3b89e3,'isNew':_0x373d4c[_0x4daebc(0x164)],'hasChanges':_0x373d4c['hasChanges'],'diff':_0x373d4c[_0x4daebc(0x161)],'activationActions':_0x154191});}return{'segmentFiles':_0x54a6d7,'foldersToCreate':_0x28e25f};}export async function prepareJourneyFiles(_0x3d9a62,_0x55abb8,_0x2a0d27,_0x39edf0){const _0x3cfe35=a110_0x40c26b,_0x40d59b=[],_0x4d9d48=new Set();for(const {yamlConfig:_0x15988f,folderPath:_0x1d4a65,sourcePath:_0x63cec1}of _0x3d9a62){const _0x2a11b5=resolveTDFolderPath(_0x1d4a65,_0x2a0d27,_0x39edf0),_0x5ddc14=_0x2a11b5+':'+_0x15988f[_0x3cfe35(0x15d)],_0x349d4a=_0x55abb8[_0x3cfe35(0x84)][_0x3cfe35(0x109)](_0x5ddc14);let _0x95515f,_0x1c6414;if(_0x349d4a&&_0x349d4a[_0x3cfe35(0x106)]>0x0){const _0x130349=buildLocalExpandedRuleMappings(_0x15988f),{createYamlContext:_0x1bc584,prefetchJourneySegments:_0x3b600b}=createPushYamlContextForBundle(_0x55abb8['deps'],_0x55abb8['parentId'],_0x55abb8['existingSegments'],_0x130349,_0x55abb8[_0x3cfe35(0xc7)],_0x55abb8[_0x3cfe35(0x169)],_0x55abb8[_0x3cfe35(0x139)],_0x55abb8[_0x3cfe35(0xab)]);await _0x3b600b(_0x349d4a['map'](_0x2e3890=>_0x2e3890['id']));const _0x4af101=hasMultipleVersions(_0x15988f),_0x1902b7=async _0x5854a4=>{const _0x1979fc=_0x3cfe35,_0x165ca9=_0x55abb8[_0x1979fc(0xab)]?.[_0x1979fc(0x109)](_0x5854a4);if(_0x165ca9)return _0x165ca9;return _0x55abb8[_0x1979fc(0xf1)]({'journeyId':_0x5854a4,'journeyName':_0x15988f[_0x1979fc(0x15d)],'isMultiVersion':_0x349d4a[_0x1979fc(0x106)]>0x1});};if(_0x4af101&&_0x349d4a['length']>0x1){const _0x4cdfcc=[];for(const _0xab5f7a of _0x349d4a){const _0x1a54c4=_0xab5f7a[_0x3cfe35(0xbd)]||0x1;_0x55abb8[_0x3cfe35(0xeb)]?.['update']('Fetching\x20'+_0x15988f['name']+'\x20v'+_0x1a54c4);const _0x5a86f5=await _0x1902b7(_0xab5f7a['id']),_0x248026=_0x1bc584(_0xab5f7a['id']),_0x13c357=await journeyResponseToDef(_0x5a86f5,_0x248026);_0x4cdfcc[_0x3cfe35(0x145)]({'item':_0xab5f7a,'yaml':_0x13c357});}const _0x21eac2=buildLocalRuleToNameMappingFromJourney(_0x15988f);_0x1c6414=buildMergedJourneyDef(_0x4cdfcc,_0x21eac2);const _0x2263e6=Math[_0x3cfe35(0x8a)](..._0x4cdfcc[_0x3cfe35(0x115)](_0x35577e=>_0x35577e[_0x3cfe35(0xc9)][_0x3cfe35(0xbd)]||0x0)),_0x455c4f=_0x349d4a[_0x3cfe35(0xd0)](_0x32ff29=>(_0x32ff29[_0x3cfe35(0xbd)]||0x0)===_0x2263e6);_0x455c4f&&(_0x55abb8[_0x3cfe35(0xeb)]?.['update']('Fetching\x20'+_0x15988f[_0x3cfe35(0x15d)]+'\x20v'+_0x2263e6),_0x95515f=await _0x1902b7(_0x455c4f['id']));}else{const _0x1595af=_0x349d4a[_0x349d4a[_0x3cfe35(0x106)]-0x1];_0x55abb8[_0x3cfe35(0xeb)]?.[_0x3cfe35(0xb9)](_0x3cfe35(0xc0)+_0x15988f['name']),_0x95515f=await _0x1902b7(_0x1595af['id']);const _0x3f6d1e=_0x1bc584(_0x1595af['id']),_0x310506=await journeyResponseToDef(_0x95515f,_0x3f6d1e),_0x268440=buildLocalRuleToNameMappingFromJourney(_0x15988f);_0x1c6414=buildMergedJourneyDef([{'item':_0x1595af,'yaml':_0x310506}],_0x268440);}}addFoldersToCreate(_0x2a11b5,_0x55abb8[_0x3cfe35(0x14b)],_0x4d9d48);const _0x15b8ef=calculateJourneyDiff(_0x15988f,_0x1c6414);_0x40d59b['push']({'relativePath':_0x15988f[_0x3cfe35(0x15d)],'absolutePath':_0x63cec1,'yamlConfig':_0x15988f,'folderPath':_0x2a11b5,'existingJourney':_0x95515f,'isNew':_0x15b8ef[_0x3cfe35(0x164)],'hasChanges':_0x15b8ef[_0x3cfe35(0x9e)],'diff':_0x15b8ef['diff']});}return{'journeyFiles':_0x40d59b,'foldersToCreate':_0x4d9d48};}export function calculateActivationActions(_0x2466ed,_0xf02486,_0x30e6e4,_0x3c02b9){const _0x310f50=a110_0x40c26b,_0x3f34fa=[],_0x238c0a=new Map();for(const _0x4ab198 of _0xf02486){_0x238c0a[_0x310f50(0xb4)](_0x4ab198[_0x310f50(0x15d)],_0x4ab198);}const _0x526d03=new Map();for(const _0x1ce3ca of _0x2466ed){_0x526d03[_0x310f50(0xb4)](_0x1ce3ca[_0x310f50(0x15d)],_0x1ce3ca);}for(const _0x5de6d0 of _0x2466ed){const _0x7e791b=_0x238c0a[_0x310f50(0x109)](_0x5de6d0[_0x310f50(0x15d)]);if(!_0x7e791b)_0x3f34fa[_0x310f50(0x145)]({'type':'create','name':_0x5de6d0[_0x310f50(0x15d)],'yamlActivation':_0x5de6d0});else{const _0x32984d=activationResponseToDef(_0x7e791b,_0x30e6e4,_0x3c02b9),_0x46f61b=a110_0x345e85[_0x310f50(0x15c)](_0x32984d),_0x2566df=a110_0x345e85['stringify'](_0x5de6d0);_0x46f61b!==_0x2566df&&_0x3f34fa[_0x310f50(0x145)]({'type':_0x310f50(0xb9),'name':_0x5de6d0['name'],'yamlActivation':_0x5de6d0,'existingActivation':_0x7e791b});}}for(const _0x338bb7 of _0xf02486){!_0x526d03[_0x310f50(0x167)](_0x338bb7[_0x310f50(0x15d)])&&_0x3f34fa[_0x310f50(0x145)]({'type':_0x310f50(0x9f),'name':_0x338bb7['name'],'existingActivation':_0x338bb7});}return _0x3f34fa;}function a110_0x2253(){const _0xfd7469=['filter','./child-segment-yaml.js','split','all','\x27\x20entry\x20criteria','stringify','name','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','folderPath','digest','diff','type','8598821RMuVGl','isNew','behavior','relative','has','startsWith','connectionIdToNameMap','journeyBundlesByFolderAndName','listSegments','utf-8','../../utils/async.js','ACTIVATION_UPDATE_ERROR','Updated\x20journey\x20\x27','max','segmentId','columns','connector_config','results','journey_created','activationActions','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','join','toString','activation_deleting','\x20journey\x20from\x20file:\x20','create','Deleted\x20activation\x20\x27','64mauCoj','activation_','getActivation','with','Entry\x20criteria:\x20','\x20(referenced\x20in\x20journey\x20','hasChanges','delete','nameToType','embedded_segment_created','updateSegmentById','embedded_segment_creating','reduce','existingSegments','segment_created','keys','\x27\x20exit\x20criteria','slice','flatMap','journeyById','createJourneySegment','folderId','segment_deleted','createActivation','deleteActivation','parentSegmentFolder','attributes','SEGMENT_UPDATE_ERROR','set','resolveJourneyId','add','kind','WaitStep','update','2383906PuiAXc','parentFolder','updated','versionNumber','Journey\x20\x27','yamlActivation','Fetching\x20','activations',').\x20','existingActivation','activation_updated','values','99066POOfrB','idToEmailMap','segment_deleting','item','NOT_FOUND','index','Name\x20has\x20already\x20been\x20taken','journeyBundleName','activation_template_id','logWarning','find','createSegment','Segment\x20not\x20found:\x20','__pending_act_','Updating\x20activation\x20\x27','getJourney','449534GDzxdS','verbose','unchanged','stage\x20\x27','folder_created','object','journey_creating','parse','goal','notification','\x27\x20not\x20found\x20in\x20journey\x20\x27','toLowerCase','Failed\x20to\x20','\x27\x20for\x20','relationships','existingJourney','activation_creating','entry','onProgress','all_columns','SEGMENT_SYNTAX_ERROR','progress','milestone','errors','activationsBySegmentId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','effectiveFolderId','fetchJourney','buildUserMaps','localSegmentRules','size','1PffkoA','Deleted\x20segment\x20\x27','journeyStages','journeyActivationNameToId','\x27...','journey_entry_criteria_','sort','schedule','list','hex','segments','logSuccess','createdSegmentId','\x27\x20milestone','Creating\x20folder\x20\x27','Updated\x20segment\x20\x27','state','length','\x27\x20decision\x20point\x20branch\x20\x27','embeddedSegmentNameToId','get','journeyId','segment','validatedRequest','\x27\x20from\x20file:\x20','segmentByFolderAndName','SEGMENT_NOT_FOUND','created','JOURNEY_SYNTAX_ERROR','Created\x20activation\x20\x27','Created\x20journey\x20\x27','segment_updating','map','withProgress','from','Activation','waitCondition','activationContext','entry_criteria','createdSegmentIds','journey','INTERNAL','connection','\x20activation\x20\x27','rule','174240wsGKVQ','journeyActivationStepId','Created\x20segment\x20\x27','ACTIVATION_SYNTAX_ERROR','stages','logDeleted','folder_creating','isArray','Updated\x20activation\x20\x27','steps','75kRbeBz','getSegment','Created\x20folder\x20\x27','action','Updating\x20segment\x20\x27','yamlConfig','logInfo','absolutePath','\x0a\x20\x20','description','segmentFolderId','draft','Creating\x20segment\x20\x27','activationStepsById','journeys','embedded_activation_created','dirname','deleteSegment','entryCriteria','rootFolderId','./journey-yaml.js','valid','462798FFAaGJ','listActivations','user','push','408724jvVnWH','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','parentId','existingSegment','createFolder','folderPathToId','data','goal\x20criteria','segmentNameToId','branches','replace','DecisionPoint','skipSegments','deleted','null','6KaFSbq','exitCriterias'];a110_0x2253=function(){return _0xfd7469;};return a110_0x2253();}export function calculateSegmentDiff(_0x551802,_0x9aba93,_0x56bd5e,_0x3ea8db,_0x26a0b3){const _0x19e457=segmentToYamlString(_0x551802);if(_0x9aba93){const _0x2b8ef=segmentWithActivationsToYaml(_0x9aba93,_0x56bd5e,undefined,_0x3ea8db,_0x26a0b3),_0x23f943=segmentToYamlString(_0x2b8ef),_0x5c126e=generateDiff(_0x23f943,_0x19e457),_0x1222ae=hasChanges(_0x5c126e);return{'isNew':![],'hasChanges':_0x1222ae,'diff':_0x1222ae?formatDiffWithColors(_0x5c126e):undefined};}const _0x31f29f=generateDiff('',_0x19e457);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x31f29f)};}export function calculateJourneyDiff(_0x5aa6e1,_0x41c3b8){const _0x29c15d=normalizeJourneyDef(_0x5aa6e1,_0x5aa6e1),_0x28904b=a110_0x33704e(_0x29c15d);if(_0x41c3b8){const _0x18feac=normalizeJourneyDef(_0x41c3b8,_0x5aa6e1),_0x54bccb=a110_0x33704e(_0x18feac),_0x2454b5=generateDiff(_0x54bccb,_0x28904b),_0x3e32ef=hasChanges(_0x2454b5);return{'isNew':![],'hasChanges':_0x3e32ef,'diff':_0x3e32ef?formatDiffWithColors(_0x2454b5):undefined};}const _0x5a91c0=generateDiff('',_0x28904b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5a91c0)};}export function findSegmentsToDelete(_0x382670,_0x32866b,_0xa71ffa,_0x80d08c,_0x49cee8){const _0x1705ee=a110_0x40c26b,_0x5bc423=new Set();for(const {yamlConfig:_0x3bd653,folderPath:_0x16c580}of _0x32866b){_0x5bc423[_0x1705ee(0xb6)](_0x16c580+':'+_0x3bd653[_0x1705ee(0x15d)]);}return _0x382670[_0x1705ee(0x157)](_0x17ab35=>{const _0x533a63=_0x1705ee,_0x42db24=_0x17ab35[_0x533a63(0x136)]?_0xa71ffa[_0x533a63(0x109)](_0x17ab35[_0x533a63(0x136)]['toString']())||'':'',_0x402252=_0x42db24+':'+_0x17ab35[_0x533a63(0x15d)];if(_0x5bc423[_0x533a63(0x167)](_0x402252))return![];if(_0x49cee8)return _0x42db24===_0x80d08c||_0x42db24[_0x533a63(0x168)](_0x80d08c+'/');return!![];});}export function findJourneysToDelete(_0x4af1d4,_0x4150d4,_0x50b40e,_0x5513cc,_0x45e43f){const _0x42f07e=a110_0x40c26b,_0x2dc5ee=new Set();for(const {yamlConfig:_0x3a97c5,folderPath:_0x14d6d7}of _0x4150d4){_0x2dc5ee['add'](_0x14d6d7+':'+_0x3a97c5['name']);}return _0x4af1d4[_0x42f07e(0x157)](_0x387fed=>{const _0x2b8e48=_0x42f07e,_0x1b4db1=_0x387fed[_0x2b8e48(0xad)]?_0x50b40e[_0x2b8e48(0x109)](_0x387fed[_0x2b8e48(0xad)])||'':'',_0x5b3922=_0x1b4db1+':'+_0x387fed[_0x2b8e48(0xcd)];if(_0x2dc5ee['has'](_0x5b3922))return![];if(_0x45e43f)return _0x1b4db1===_0x5513cc||_0x1b4db1[_0x2b8e48(0x168)](_0x5513cc+'/');return!![];});}export function buildSegmentLookupMap(_0x1b85de,_0xa658b1){const _0x2e83c8=a110_0x40c26b,_0x2a233b=new Map();for(const _0x17af93 of _0x1b85de){const _0x1b306f=_0x17af93[_0x2e83c8(0x136)]?_0xa658b1[_0x2e83c8(0x109)](_0x17af93['segmentFolderId'][_0x2e83c8(0x93)]())||'':'',_0x4b2d48=_0x1b306f+':'+_0x17af93['name'];_0x2a233b[_0x2e83c8(0xb4)](_0x4b2d48,_0x17af93);}return _0x2a233b;}export function buildSegmentNameToIdMap(_0x21b5ec){const _0x2a939c=a110_0x40c26b,_0x46b19f=new Map();for(const _0x352c80 of _0x21b5ec){_0x46b19f[_0x2a939c(0xb4)](_0x352c80['name'],_0x352c80['id']);}return _0x46b19f;}export function buildJourneyBundleLookupMap(_0x3f7b04,_0x282bcd){const _0x40d99c=a110_0x40c26b,_0x2db627=new Map();for(const _0x3696dc of _0x3f7b04){const _0x3360c7=_0x3696dc['folderId']?_0x282bcd[_0x40d99c(0x109)](_0x3696dc['folderId'])||'':'',_0x22e1f8=_0x3360c7+':'+_0x3696dc[_0x40d99c(0xcd)];!_0x2db627[_0x40d99c(0x167)](_0x22e1f8)&&_0x2db627['set'](_0x22e1f8,[]),_0x2db627[_0x40d99c(0x109)](_0x22e1f8)[_0x40d99c(0x145)](_0x3696dc);}for(const _0x2649a9 of _0x2db627[_0x40d99c(0xc5)]()){_0x2649a9['sort']((_0x153b6,_0x4e277d)=>(_0x153b6[_0x40d99c(0xbd)]||0x0)-(_0x4e277d[_0x40d99c(0xbd)]||0x0));}return _0x2db627;}export function collectFoldersToCreate(_0x54ee42,_0x12ea29){const _0x15ce2d=a110_0x40c26b,_0x27309c=new Set();for(const _0x4704dc of _0x54ee42){if(!_0x4704dc)continue;if(_0x12ea29[_0x15ce2d(0x167)](_0x4704dc))continue;const _0x2c6a2f=_0x4704dc['split']('/');let _0x5ba7a4='';for(const _0x1520bf of _0x2c6a2f){_0x5ba7a4=_0x5ba7a4?_0x5ba7a4+'/'+_0x1520bf:_0x1520bf,!_0x12ea29[_0x15ce2d(0x167)](_0x5ba7a4)&&_0x27309c[_0x15ce2d(0xb6)](_0x5ba7a4);}}return _0x27309c;}export function parseAndClassifyYamlFiles(_0x16b1df,_0x182eb7,_0x56ad96){const _0x1f07f4=a110_0x40c26b,_0x2e9b38=[],_0x5fab0=[];for(const _0xb2212b of _0x16b1df){const _0x552a40=a110_0x2f9800[_0x1f07f4(0x166)](_0x182eb7,a110_0x2f9800[_0x1f07f4(0x13c)](_0xb2212b)),_0xda353d=_0x552a40==='.'?'':_0x552a40,_0x49c01e=readFileSync(_0xb2212b,'utf-8'),_0x40492c=a110_0x345e85['parse'](_0x49c01e);if(isJourneyDef(_0x40492c)){const _0x2ceb02=a110_0x17e757(_0x49c01e);_0x5fab0['push']({'yamlConfig':_0x2ceb02,'folderPath':_0xda353d,'sourcePath':_0xb2212b});}else{if(!_0x56ad96?.[_0x1f07f4(0x152)]){const _0x327e60=parseSegmentYamlFile(_0x49c01e),_0xeab2ee=normalizeChildSegmentYaml(_0x327e60);_0x2e9b38[_0x1f07f4(0x145)]({'yamlConfig':_0xeab2ee,'folderPath':_0xda353d,'sourcePath':_0xb2212b});}}}return{'segments':_0x2e9b38,'journeys':_0x5fab0};}export function validateParsedFiles(_0x3ea969,_0x23a073){const _0x57d9c5=a110_0x40c26b,_0x513cdf=[];for(const {yamlConfig:_0x32baae,sourcePath:_0xd28681}of _0x3ea969['segments']){const _0xd3a564=readFileSync(_0xd28681,_0x57d9c5(0x86)),_0x20a5f4=a110_0x345e85['parseDocument'](_0xd3a564),_0x577e97=validateSegmentDef(_0x32baae,{'source':_0xd3a564,'document':_0x20a5f4});if(!_0x577e97[_0x57d9c5(0x141)]){const _0x36a7bf=a110_0x2f9800[_0x57d9c5(0x166)](_0x23a073,_0xd28681);_0x513cdf[_0x57d9c5(0x145)]({'filePath':_0x36a7bf,'source':_0xd3a564,'result':_0x577e97,'isJourney':![]});}}for(const {yamlConfig:_0x432250,sourcePath:_0x25b38a}of _0x3ea969[_0x57d9c5(0x13a)]){const _0x2b6283=readFileSync(_0x25b38a,_0x57d9c5(0x86)),_0x6e2917=a110_0x345e85['parseDocument'](_0x2b6283),_0x3cdc95=validateJourneyDef(_0x432250,{'source':_0x2b6283,'document':_0x6e2917});if(!_0x3cdc95[_0x57d9c5(0x141)]){const _0x7eb157=a110_0x2f9800['relative'](_0x23a073,_0x25b38a);_0x513cdf[_0x57d9c5(0x145)]({'filePath':_0x7eb157,'source':_0x2b6283,'result':_0x3cdc95,'isJourney':!![]});}}return _0x513cdf;}export function formatValidationErrors(_0x14aa47){const _0x34e0f0=a110_0x40c26b,_0x1d351b=[];for(const {filePath:_0x1a283f,source:_0x434e22,result:_0xb74d65,isJourney:_0x4f8505}of _0x14aa47){const _0x4de038=_0x4f8505?'journey':'segment';_0x1d351b[_0x34e0f0(0x145)]('\x0a'+_0x1a283f+'\x20('+_0x4de038+'):\x20'+_0xb74d65[_0x34e0f0(0xed)]['length']+'\x20error(s)'),_0x1d351b[_0x34e0f0(0x145)](formatValidationResult(_0xb74d65,_0x434e22,_0x1a283f));}return _0x1d351b[_0x34e0f0(0x92)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x12f758){const _0x595f83=a110_0x40c26b,_0x3fa5c6=new Set(),_0x3e3132=new Map(),_0x2d1c26=collectSegmentUsageCounts(_0x12f758);if(_0x12f758[_0x595f83(0xff)])for(const [_0x126473,_0x33169f]of Object['entries'](_0x12f758[_0x595f83(0xff)])){_0x3fa5c6[_0x595f83(0xb6)](_0x126473);if(_0x33169f[_0x595f83(0x121)]){const _0x4708c0=yamlRuleToApi(_0x33169f['rule']),_0x5579a5=apiRuleToYaml(_0x4708c0);_0x3e3132['set'](_0x126473,_0x5579a5);}}const _0x4d33a2=new Map();let _0xe47309=0x0;for(const [_0x390950,_0x384d29]of _0x3e3132){const _0x1c4f2c=serializeExpandedRule(_0x384d29,_0x3e3132),_0x52326b=_0x4d33a2['get'](_0x1c4f2c)||[];_0x52326b[_0x595f83(0x145)]({'name':_0x390950,'index':_0xe47309}),_0x4d33a2[_0x595f83(0xb4)](_0x1c4f2c,_0x52326b),_0xe47309++;}const _0x2b5942=new Map();for(const [_0x4b9cd7,_0x41f27b]of _0x4d33a2){const _0x389036=_0x41f27b[_0x595f83(0xa9)]()['sort']((_0x463c34,_0x2ed6b6)=>{const _0x182775=_0x595f83,_0x289033=_0x2d1c26[_0x182775(0x109)](_0x463c34[_0x182775(0x15d)])||0x0,_0x400ba2=_0x2d1c26['get'](_0x2ed6b6[_0x182775(0x15d)])||0x0;if(_0x289033!==_0x400ba2)return _0x400ba2-_0x289033;return _0x463c34[_0x182775(0xcb)]-_0x2ed6b6['index'];})[_0x595f83(0x115)](_0x619474=>_0x619474[_0x595f83(0x15d)]),_0x38089f=[];for(const _0x1c3e92 of _0x389036){const _0x55c122=_0x2d1c26[_0x595f83(0x109)](_0x1c3e92)||0x0,_0x27e544=Math[_0x595f83(0x8a)](_0x55c122,0x1);for(let _0x4e3e21=0x0;_0x4e3e21<_0x27e544;_0x4e3e21++){_0x38089f[_0x595f83(0x145)](_0x1c3e92);}}_0x2b5942['set'](_0x4b9cd7,_0x38089f);}return{'existingLocalSegmentNames':_0x3fa5c6,'localSegmentRules':_0x3e3132,'localExpandedRuleToNames':_0x2b5942};}async function buildServerSegmentRuleMap(_0x59e7a6,_0x26a939,_0x3cb7ac,_0x2544cb){const _0x892d65=new Map(),_0x34deb1=new Set(),_0x18cad7=async _0x37c45f=>{const _0x3b0ea0=a110_0x371e;if(_0x34deb1['has'](_0x37c45f))return;_0x34deb1[_0x3b0ea0(0xb6)](_0x37c45f);let _0xcfabad=_0x3cb7ac['find'](_0x580eb=>_0x580eb['id']===_0x37c45f);if(!_0xcfabad)try{_0xcfabad=await _0x59e7a6[_0x3b0ea0(0x10b)][_0x3b0ea0(0x12d)](_0x26a939,_0x37c45f);}catch{return;}if(!_0xcfabad?.[_0x3b0ea0(0x121)])return;const _0x4b30a4=apiRuleToYaml(_0xcfabad['rule']);_0x892d65[_0x3b0ea0(0xb4)](_0x37c45f,_0x4b30a4);const _0x135b0d=collectSegmentRefsFromRule(_0x4b30a4);for(const _0xabbe4f of _0x135b0d){await _0x18cad7(_0xabbe4f);}};for(const _0x1bd35d of _0x2544cb){await _0x18cad7(_0x1bd35d);}return _0x892d65;}export function createSegmentIdResolver(_0x3b48d8,_0x38630c){return async _0x57e0e6=>{const _0x3407d7=a110_0x371e,_0x536dc6=_0x3b48d8[_0x3407d7(0x109)](_0x57e0e6);if(!_0x536dc6)throw new SDKError(ErrorCode[_0x3407d7(0x10f)],_0x3407d7(0xd2)+_0x57e0e6+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x38630c+'\x27)');return _0x536dc6;};}export function extractRootFolderId(_0x2854e7){const _0x50ceb1=a110_0x40c26b;return _0x2854e7[_0x50ceb1(0xe4)]?.[_0x50ceb1(0xb1)]?.['data']?.['id']||_0x2854e7[_0x50ceb1(0xe4)]?.[_0x50ceb1(0xbb)]?.[_0x50ceb1(0x14c)]?.['id'];}export function buildConnectionMaps(_0x1c72fa){const _0x54a8c4=a110_0x40c26b,_0x44ba79=new Map(),_0x17580a=new Map(),_0x20a73d=new Map();for(const _0x56256c of _0x1c72fa){_0x44ba79[_0x54a8c4(0xb4)](_0x56256c[_0x54a8c4(0x15d)],parseInt(_0x56256c['id'],0xa)),_0x17580a[_0x54a8c4(0xb4)](_0x56256c['id'],_0x56256c[_0x54a8c4(0x15d)]),_0x20a73d[_0x54a8c4(0xb4)](_0x56256c[_0x54a8c4(0x15d)],_0x56256c[_0x54a8c4(0x162)]);}return{'nameToId':_0x44ba79,'idToName':_0x17580a,'nameToType':_0x20a73d};}export function calculatePushStats(_0x3822fb,_0x1d671d,_0x5317fa,_0x350b75,_0x19cae0,_0xa5036b,_0x26231a){const _0x3c3cbd=a110_0x40c26b,_0x414d93=_0x3822fb['filter'](_0x271506=>_0x271506[_0x3c3cbd(0x164)]),_0x4d528a=_0x3822fb[_0x3c3cbd(0x157)](_0x2846d8=>!_0x2846d8[_0x3c3cbd(0x164)]&&_0x2846d8['hasChanges']),_0x3d2bfd=_0x3822fb[_0x3c3cbd(0x157)](_0x4ba755=>!_0x4ba755[_0x3c3cbd(0x164)]&&!_0x4ba755[_0x3c3cbd(0x9e)]),_0x150f60=_0xa5036b?_0x350b75:[],_0x1c346f=_0x1d671d[_0x3c3cbd(0x157)](_0x396d50=>_0x396d50[_0x3c3cbd(0x164)]),_0x2f2448=_0x1d671d[_0x3c3cbd(0x157)](_0x46cb64=>!_0x46cb64[_0x3c3cbd(0x164)]&&_0x46cb64[_0x3c3cbd(0x9e)]),_0x4180fb=_0x1d671d[_0x3c3cbd(0x157)](_0x31c7a0=>!_0x31c7a0[_0x3c3cbd(0x164)]&&!_0x31c7a0['hasChanges']),_0x1a43a8=_0xa5036b?_0x19cae0:[],_0x4dd9bd=_0x3822fb[_0x3c3cbd(0xaa)](_0x54fb7f=>_0x54fb7f[_0x3c3cbd(0x90)]),_0x1ec28f=_0x4dd9bd[_0x3c3cbd(0x157)](_0x23dcfd=>_0x23dcfd[_0x3c3cbd(0x162)]==='create'),_0x5829bf=_0x4dd9bd[_0x3c3cbd(0x157)](_0x3430e7=>_0x3430e7['type']===_0x3c3cbd(0xb9)),_0x36e515=_0x4dd9bd[_0x3c3cbd(0x157)](_0x3044bb=>_0x3044bb[_0x3c3cbd(0x162)]===_0x3c3cbd(0x9f)),_0x4446b2=Array[_0x3c3cbd(0x117)](_0x5317fa)[_0x3c3cbd(0xfb)](),_0x493666=_0x26231a?![]:_0x414d93[_0x3c3cbd(0x106)]>0x0||_0x4d528a[_0x3c3cbd(0x106)]>0x0||_0x150f60['length']>0x0,_0x37eb30=_0x1c346f['length']>0x0||_0x2f2448[_0x3c3cbd(0x106)]>0x0||_0x1a43a8['length']>0x0,_0x25bb8d=_0x26231a?![]:_0x4dd9bd[_0x3c3cbd(0x106)]>0x0,_0x4888c8=_0x4446b2[_0x3c3cbd(0x106)]>0x0;return{'segments':{'new':_0x414d93,'changed':_0x4d528a,'unchanged':_0x3d2bfd,'toDelete':_0x150f60},'journeys':{'new':_0x1c346f,'changed':_0x2f2448,'unchanged':_0x4180fb,'toDelete':_0x1a43a8},'activations':{'all':_0x4dd9bd,'toCreate':_0x1ec28f,'toUpdate':_0x5829bf,'toDelete':_0x36e515},'folders':{'toCreate':_0x4446b2},'counts':{'segments':{'new':_0x414d93[_0x3c3cbd(0x106)],'changed':_0x4d528a[_0x3c3cbd(0x106)],'unchanged':_0x3d2bfd[_0x3c3cbd(0x106)],'toDelete':_0x150f60['length']},'journeys':{'new':_0x1c346f['length'],'changed':_0x2f2448[_0x3c3cbd(0x106)],'unchanged':_0x4180fb[_0x3c3cbd(0x106)],'toDelete':_0x1a43a8[_0x3c3cbd(0x106)]},'activations':{'create':_0x1ec28f['length'],'update':_0x5829bf[_0x3c3cbd(0x106)],'delete':_0x36e515['length']},'folders':_0x4446b2['length']},'hasChanges':_0x493666||_0x37eb30||_0x25bb8d||_0x4888c8};}export async function buildPushExecutionContext(_0x12c454,_0x13d065,_0x9fbdbc,_0x463e4c,_0x1bd469,_0x6a1c7a){const _0x47567c=a110_0x40c26b,_0xf5a36f=extractRootFolderId(_0x9fbdbc),{pathToId:_0x1db68c,idToPath:_0x2a60fc}=buildFolderMaps(_0x1bd469),_0x10fd74=buildSegmentNameToIdMap(_0x463e4c),_0x13e419=new Map(),{batchAsync:_0x1de0e2}=await import('../../utils/async.js'),[_0x3d37f1,_0x25bbd2]=await Promise[_0x47567c(0x15a)]([_0x12c454[_0x47567c(0x144)][_0x47567c(0xf2)](),_0x12c454['connection'][_0x47567c(0xfd)](),((async()=>{const _0x551271=_0x47567c;!_0x6a1c7a&&_0x463e4c[_0x551271(0x106)]>0x0&&await _0x1de0e2(_0x463e4c,async _0x4a9e68=>{const _0x3dea53=_0x551271,_0x56f338=await _0x12c454[_0x3dea53(0x10b)][_0x3dea53(0x143)](_0x13d065,_0x4a9e68['id']);_0x13e419[_0x3dea53(0xb4)](_0x4a9e68['id'],_0x56f338);});})())]),{emailToId:_0x1a33a4,idToEmail:_0x5dedf7}=_0x3d37f1,_0x1d174f=buildConnectionMaps(_0x25bbd2);return{'rootFolderId':_0xf5a36f,'folderPathToId':_0x1db68c,'folderIdToPath':_0x2a60fc,'segmentNameToId':_0x10fd74,'activationsBySegmentId':_0x13e419,'emailToIdMap':_0x1a33a4,'idToEmailMap':_0x5dedf7,'connectionNameToIdMap':_0x1d174f['nameToId'],'connectionIdToNameMap':_0x1d174f['idToName'],'connectionNameToTypeMap':_0x1d174f[_0x47567c(0xa0)]};}export function createPushYamlContextForBundle(_0x25adcc,_0x351e9c,_0x4b8207,_0xf45510,_0x15c27e,_0x78885c,_0x51321c,_0x449a2e){const {existingLocalSegmentNames:_0x487461,localExpandedRuleToNames:_0xf1bb7c}=_0xf45510,_0x200271=new Set(),_0x4a8407=new Map(),_0x39da07=new Map(),_0x4066e5=new Map(),_0x4ddf6d=createJumpTargetCache(),_0x5875f9=new Map(),_0x68753c=new Map(),_0x188cb1=new Set();let _0x55f05f;const _0x125bee=_0x211599=>{const _0x45c8a5={'resolveSegment':async _0x366990=>{const _0x4f6f4d=a110_0x371e,_0x3fdb16=_0x4066e5[_0x4f6f4d(0x109)](_0x366990);if(_0x3fdb16!==undefined)return{'name':_0x3fdb16,'isJourneyLocal':!![]};try{let _0x5c5d6d=_0x4b8207[_0x4f6f4d(0xd0)](_0x27af20=>_0x27af20['id']===_0x366990);!_0x5c5d6d&&(_0x5c5d6d=await _0x25adcc[_0x4f6f4d(0x10b)][_0x4f6f4d(0x12d)](_0x351e9c,_0x366990));const _0x5378fa=generateJourneyLocalName(_0x5c5d6d[_0x4f6f4d(0x15d)]),_0x8bcc81=_0x5c5d6d[_0x4f6f4d(0xb7)]===SEGMENT_KIND_JOURNEY&&_0x5378fa!==undefined;let _0x29dc59=_0x5c5d6d['name'],_0x5bc787;if(_0x8bcc81&&_0x5c5d6d[_0x4f6f4d(0x121)]){const _0x229b63=apiRuleToYaml(_0x5c5d6d['rule']);_0x68753c[_0x4f6f4d(0xb4)](_0x366990,_0x229b63);const _0x2749f0=async _0x2efeff=>{const _0x3dd996=_0x4f6f4d,_0x321616=collectSegmentRefsFromRule(_0x2efeff);for(const _0x3f6975 of _0x321616){if(!_0x68753c[_0x3dd996(0x167)](_0x3f6975))try{const _0x5d6350=await _0x25adcc['segment'][_0x3dd996(0x12d)](_0x351e9c,_0x3f6975);if(_0x5d6350?.[_0x3dd996(0x121)]){const _0x188028=apiRuleToYaml(_0x5d6350[_0x3dd996(0x121)]);_0x68753c[_0x3dd996(0xb4)](_0x3f6975,_0x188028),await _0x2749f0(_0x188028);}}catch{}}};await _0x2749f0(_0x229b63);const _0x49aa63=serializeExpandedRule(_0x229b63,_0x68753c),_0x4c8aeb=_0xf1bb7c[_0x4f6f4d(0x109)](_0x49aa63);if(_0x4c8aeb&&_0x4c8aeb['length']>0x0){const _0x31b7a9=_0x4a8407[_0x4f6f4d(0x109)](_0x49aa63)||0x0,_0x4512b0=_0x4c8aeb[_0x31b7a9]||_0x4c8aeb[_0x4c8aeb[_0x4f6f4d(0x106)]-0x1];_0x4a8407['set'](_0x49aa63,_0x31b7a9+0x1),_0x29dc59=_0x4512b0,_0x200271['add'](_0x29dc59),_0x4066e5[_0x4f6f4d(0xb4)](_0x366990,_0x29dc59);const _0x1171a2=await resolveRuleSegmentRefs(_0x229b63,async _0x1ca339=>{const _0x34c088=_0x4066e5['get'](_0x1ca339);if(_0x34c088)return _0x34c088;const _0x4487fd=await _0x55f05f['resolveSegment'](_0x1ca339);return _0x4487fd['name'];});_0x5bc787={'description':_0x5c5d6d['description'],'rule':_0x1171a2};}else{const _0x37f3c6=_0x5875f9['get'](_0x49aa63);if(_0x37f3c6)_0x29dc59=_0x37f3c6,_0x4066e5['set'](_0x366990,_0x29dc59);else{if(_0x5378fa){let _0x72b921=_0x5378fa,_0x12f2e3=0x2;while(_0x200271[_0x4f6f4d(0x167)](_0x72b921)||_0x487461[_0x4f6f4d(0x167)](_0x72b921)){_0x72b921=_0x5378fa+'_'+_0x12f2e3,_0x12f2e3++;}_0x200271[_0x4f6f4d(0xb6)](_0x72b921),_0x29dc59=_0x72b921;}_0x4066e5[_0x4f6f4d(0xb4)](_0x366990,_0x29dc59),_0x5875f9[_0x4f6f4d(0xb4)](_0x49aa63,_0x29dc59);const _0x4cfc23=await resolveRuleSegmentRefs(_0x229b63,async _0x37ab44=>{const _0x1dbca6=_0x4066e5['get'](_0x37ab44);if(_0x1dbca6)return _0x1dbca6;const _0x1b3feb=await _0x55f05f['resolveSegment'](_0x37ab44);return _0x1b3feb['name'];});_0x5bc787={'description':_0x5c5d6d['description'],'rule':_0x4cfc23};}}}return{'name':_0x29dc59,'isJourneyLocal':_0x8bcc81,'definition':_0x5bc787};}catch{return{'name':_0x366990,'isJourneyLocal':![]};}},'resolveActivation':async _0x59bc53=>{const _0x4d5e73=a110_0x371e,_0x4252e4=_0x39da07[_0x4d5e73(0x109)](_0x59bc53);if(_0x4252e4!==undefined)return{'name':_0x4252e4,'isJourneyLocal':!![]};try{let _0x1fedfc=_0x51321c?.[_0x4d5e73(0x109)](_0x59bc53);!_0x1fedfc&&(_0x1fedfc=await _0x25adcc[_0x4d5e73(0x11d)][_0x4d5e73(0x9a)](_0x211599,_0x59bc53));const _0x3ae7cf=_0x1fedfc['attributes']['activationParams'][_0x4d5e73(0x15d)]||_0x59bc53,_0x37a2e7=sanitizeYamlKey(_0x3ae7cf)||_0x4d5e73(0x99)+_0x59bc53,_0x6f53b0=_0x37a2e7;_0x39da07[_0x4d5e73(0xb4)](_0x59bc53,_0x6f53b0);const _0x7b2701=journeyActivationStepToYaml(_0x1fedfc,_0x15c27e,_0x78885c);return{'name':_0x6f53b0,'isJourneyLocal':!![],'definition':_0x7b2701};}catch{return{'name':_0x59bc53,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3a5235,_0x5f420c)=>resolveJumpTarget(_0x3a5235,_0x5f420c,_0x4ddf6d,async _0x1c9299=>{const _0x50554d=a110_0x371e,_0x204d37=_0x449a2e?.[_0x50554d(0x109)](_0x1c9299);if(_0x204d37)return _0x204d37;return _0x25adcc[_0x50554d(0x11d)]['getJourney'](_0x1c9299);})};return _0x55f05f=_0x45c8a5,_0x45c8a5;},_0x3a27a3=async _0x35ced3=>{const _0x4e7663=a110_0x371e,{collectSegmentIdsFromJourneyApi:_0xe9767a}=await import('./journey-yaml.js'),{batchAsync:_0x5214c9}=await import('../../utils/async.js'),_0x28eea3=new Set();for(const _0x3ec9f1 of _0x35ced3){let _0x20926c=_0x449a2e?.['get'](_0x3ec9f1);!_0x20926c&&(_0x20926c=await _0x25adcc[_0x4e7663(0x11d)][_0x4e7663(0xd5)](_0x3ec9f1));const _0x2bf5ee=_0xe9767a(_0x20926c);for(const _0x14645a of _0x2bf5ee){_0x28eea3[_0x4e7663(0xb6)](_0x14645a);}}let _0x1a8a67=Array[_0x4e7663(0x117)](_0x28eea3);while(_0x1a8a67[_0x4e7663(0x106)]>0x0){const _0x19e3e0=_0x1a8a67[_0x4e7663(0x157)](_0x14f4b4=>!_0x188cb1['has'](_0x14f4b4));if(_0x19e3e0['length']===0x0)break;const _0x5551e0=await _0x5214c9(_0x19e3e0,async _0x13e3d2=>{const _0x5b61b4=_0x4e7663;_0x188cb1[_0x5b61b4(0xb6)](_0x13e3d2);let _0x1dc3e2=_0x4b8207[_0x5b61b4(0xd0)](_0xa2d590=>_0xa2d590['id']===_0x13e3d2);if(!_0x1dc3e2)try{_0x1dc3e2=await _0x25adcc[_0x5b61b4(0x10b)][_0x5b61b4(0x12d)](_0x351e9c,_0x13e3d2);}catch{return null;}return{'segmentId':_0x13e3d2,'segment':_0x1dc3e2};},0xa),_0x46bfbb=new Set();for(const _0x526c2e of _0x5551e0){if(!_0x526c2e?.[_0x4e7663(0x10b)]?.[_0x4e7663(0x121)])continue;const _0x19c7d4=apiRuleToYaml(_0x526c2e['segment']['rule']);_0x68753c[_0x4e7663(0xb4)](_0x526c2e[_0x4e7663(0x8b)],_0x19c7d4);const _0x22c9a9=collectSegmentRefsFromRule(_0x19c7d4);for(const _0x21156c of _0x22c9a9){!_0x188cb1[_0x4e7663(0x167)](_0x21156c)&&_0x46bfbb['add'](_0x21156c);}}_0x1a8a67=Array[_0x4e7663(0x117)](_0x46bfbb);}};return{'createYamlContext':_0x125bee,'prefetchJourneySegments':_0x3a27a3};}export async function executePushSegments(_0x9f6b73,_0x5ab520,_0x3ca9a1,_0x5b4e62,_0x2191d1){const _0x2a1766=a110_0x40c26b,{segmentDefToCreateRequest:_0x48e32e,segmentDefToUpdateRequest:_0x59ab19}=await import(_0x2a1766(0x158)),_0x1699cf=_0x3ca9a1['folderPathToId'],_0x5ce059=0x5,_0x8045d9=async _0x2da982=>{const _0x2ce50a=_0x2a1766,_0x2c33f9=_0x2da982[_0x2ce50a(0x15f)]?_0x1699cf['get'](_0x2da982['folderPath']):undefined;let _0xe6d757;const _0x1bbcf9={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2da982[_0x2ce50a(0x164)]){_0x2191d1['onProgress']?.({'type':'segment_creating','name':_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]});const _0x1be9b1=_0x48e32e(_0x2da982[_0x2ce50a(0x131)],_0x2c33f9),_0x3bb11e=await _0x2191d1[_0x2ce50a(0x116)](_0x2ce50a(0x138)+_0x2da982['yamlConfig']['name']+_0x2ce50a(0xf9),()=>_0x9f6b73[_0x2ce50a(0x10b)][_0x2ce50a(0xd1)](_0x5b4e62[_0x2ce50a(0x148)],_0x1be9b1));_0xe6d757=_0x3bb11e[_0x2ce50a(0x14c)]['id'],_0x1bbcf9[_0x2ce50a(0x101)]={'name':_0x2da982['yamlConfig'][_0x2ce50a(0x15d)],'id':_0xe6d757},_0x2191d1[_0x2ce50a(0xe8)]?.({'type':_0x2ce50a(0xa6),'name':_0x2da982['yamlConfig'][_0x2ce50a(0x15d)],'segmentId':_0xe6d757}),_0x2191d1[_0x2ce50a(0x100)]?.(_0x2ce50a(0x124)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+'\x27'),_0x1bbcf9[_0x2ce50a(0x110)]=0x1;}else{if(_0x2da982[_0x2ce50a(0x9e)]){_0x2191d1[_0x2ce50a(0xe8)]?.({'type':_0x2ce50a(0x114),'name':_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]});const _0x2760b5=_0x59ab19(_0x2da982[_0x2ce50a(0x131)]);_0x2c33f9!==_0x2da982['existingSegment']?.[_0x2ce50a(0x136)]&&(_0x2760b5[_0x2ce50a(0x136)]=_0x2c33f9?parseInt(_0x2c33f9,0xa):undefined),await _0x2191d1[_0x2ce50a(0x116)](_0x2ce50a(0x130)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+_0x2ce50a(0xf9),()=>_0x9f6b73['segment'][_0x2ce50a(0xa2)](_0x5b4e62[_0x2ce50a(0x148)],_0x2da982[_0x2ce50a(0x149)]['id'],_0x2760b5)),_0xe6d757=_0x2da982['existingSegment']['id'],_0x2191d1['onProgress']?.({'type':'segment_updated','name':_0x2da982['yamlConfig']['name']}),_0x2191d1[_0x2ce50a(0x100)]?.(_0x2ce50a(0x104)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+'\x27'),_0x1bbcf9['updated']=0x1;}else _0xe6d757=_0x2da982[_0x2ce50a(0x149)]['id'];}}catch(_0x628b43){const _0x4aca53=isHttp400Error(_0x628b43),_0x1b8a05=_0x4aca53?ErrorCode[_0x2ce50a(0xea)]:ErrorCode[_0x2ce50a(0xb3)],_0x116c7b=getErrorMessage(_0x628b43);throw new SDKError(_0x1b8a05,'Failed\x20to\x20'+(_0x2da982[_0x2ce50a(0x164)]?'create':'update')+'\x20segment\x20from\x20file:\x20'+_0x2da982[_0x2ce50a(0x133)]+'\x0a\x20\x20'+_0x116c7b,_0x628b43);}try{const _0x58668f=await syncActivationsForSegment(_0x9f6b73,_0x5b4e62[_0x2ce50a(0x148)],_0xe6d757,_0x2da982[_0x2ce50a(0x131)]['name'],_0x2da982[_0x2ce50a(0x90)],_0x2191d1,_0x2da982[_0x2ce50a(0x133)]);_0x1bbcf9[_0x2ce50a(0xc1)]=_0x58668f;}catch(_0x19f716){if(_0x19f716 instanceof SDKError)throw _0x19f716;throw new SDKError(ErrorCode[_0x2ce50a(0x88)],_0x2ce50a(0x91)+_0x2da982[_0x2ce50a(0x131)][_0x2ce50a(0x15d)]+_0x2ce50a(0x10d)+_0x2da982[_0x2ce50a(0x133)]+_0x2ce50a(0x134)+getErrorMessage(_0x19f716),_0x19f716);}return _0x1bbcf9;},_0x3720d4=await batchAsync(_0x5ab520,_0x8045d9,_0x5ce059),_0x28fc1d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x27820f of _0x3720d4){_0x28fc1d[_0x2a1766(0x110)]+=_0x27820f['created'],_0x28fc1d[_0x2a1766(0xbc)]+=_0x27820f[_0x2a1766(0xbc)],_0x27820f[_0x2a1766(0x101)]&&_0x28fc1d[_0x2a1766(0x11c)][_0x2a1766(0xb4)](_0x27820f['createdSegmentId'][_0x2a1766(0x15d)],_0x27820f[_0x2a1766(0x101)]['id']),_0x28fc1d[_0x2a1766(0xc1)]['created']+=_0x27820f['activations'][_0x2a1766(0x110)],_0x28fc1d[_0x2a1766(0xc1)][_0x2a1766(0xbc)]+=_0x27820f['activations'][_0x2a1766(0xbc)],_0x28fc1d['activations']['deleted']+=_0x27820f[_0x2a1766(0xc1)][_0x2a1766(0x153)];}return _0x28fc1d;}async function syncActivationsForSegment(_0x26973a,_0xbcc1f3,_0x56a307,_0x36d44d,_0x261e6c,_0x39e13f,_0x5da963){const _0x4b9847=a110_0x40c26b,_0x3c3c09={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4be1ba of _0x261e6c){try{if(_0x4be1ba['type']==='create'&&_0x4be1ba[_0x4b9847(0x10c)])_0x39e13f[_0x4b9847(0xe8)]?.({'type':_0x4b9847(0xe6),'segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),await _0x39e13f[_0x4b9847(0x116)]('Creating\x20activation\x20\x27'+_0x4be1ba[_0x4b9847(0x15d)]+_0x4b9847(0xf9),()=>_0x26973a['segment'][_0x4b9847(0xaf)](_0xbcc1f3,_0x56a307,_0x4be1ba[_0x4b9847(0x10c)])),_0x39e13f[_0x4b9847(0xe8)]?.({'type':'activation_created','segmentName':_0x36d44d,'activationName':_0x4be1ba['name']}),_0x39e13f['logSuccess']?.(_0x4b9847(0x112)+_0x4be1ba[_0x4b9847(0x15d)]+'\x27'),_0x3c3c09['created']++;else{if(_0x4be1ba[_0x4b9847(0x162)]===_0x4b9847(0xb9)&&_0x4be1ba[_0x4b9847(0x10c)]&&_0x4be1ba[_0x4b9847(0xc3)])_0x39e13f[_0x4b9847(0xe8)]?.({'type':'activation_updating','segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),await _0x39e13f[_0x4b9847(0x116)](_0x4b9847(0xd4)+_0x4be1ba[_0x4b9847(0x15d)]+_0x4b9847(0xf9),()=>_0x26973a[_0x4b9847(0x10b)]['updateActivation'](_0xbcc1f3,_0x56a307,_0x4be1ba[_0x4b9847(0xc3)]['id'],_0x4be1ba[_0x4b9847(0x10c)])),_0x39e13f[_0x4b9847(0xe8)]?.({'type':_0x4b9847(0xc4),'segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),_0x39e13f[_0x4b9847(0x100)]?.(_0x4b9847(0x12a)+_0x4be1ba[_0x4b9847(0x15d)]+'\x27'),_0x3c3c09['updated']++;else _0x4be1ba[_0x4b9847(0x162)]==='delete'&&_0x4be1ba[_0x4b9847(0xc3)]&&(_0x39e13f['onProgress']?.({'type':_0x4b9847(0x94),'segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),await _0x39e13f[_0x4b9847(0x116)]('Deleting\x20activation\x20\x27'+_0x4be1ba['name']+_0x4b9847(0xf9),()=>_0x26973a[_0x4b9847(0x10b)][_0x4b9847(0xb0)](_0xbcc1f3,_0x56a307,_0x4be1ba['existingActivation']['id'])),_0x39e13f[_0x4b9847(0xe8)]?.({'type':'activation_deleted','segmentName':_0x36d44d,'activationName':_0x4be1ba[_0x4b9847(0x15d)]}),_0x39e13f[_0x4b9847(0x127)]?.(_0x4b9847(0x97)+_0x4be1ba['name']+'\x27'),_0x3c3c09['deleted']++);}}catch(_0x164212){const _0x2bf69b=isHttp400Error(_0x164212),_0x142fd2=_0x2bf69b?ErrorCode[_0x4b9847(0x125)]:ErrorCode[_0x4b9847(0x88)],_0x4010d5=getErrorMessage(_0x164212);throw new SDKError(_0x142fd2,_0x4b9847(0xe2)+_0x4be1ba[_0x4b9847(0x162)]+_0x4b9847(0x120)+_0x4be1ba[_0x4b9847(0x15d)]+'\x27\x20from\x20file:\x20'+_0x5da963+'\x0a\x20\x20'+_0x4010d5,_0x164212);}}return _0x3c3c09;}export async function executePushFolders(_0x4f0154,_0x5b3055,_0x552efd,_0x2fc75a,_0x1529e9){const _0x1a9f61=a110_0x40c26b,_0xef0210=new Map(_0x552efd);for(const _0x11c4e2 of _0x5b3055){const _0x3b9038=_0x11c4e2[_0x1a9f61(0x159)]('/'),_0x4b068c=_0x3b9038[_0x3b9038[_0x1a9f61(0x106)]-0x1],_0x3f28f5=_0x3b9038[_0x1a9f61(0xa9)](0x0,-0x1)['join']('/'),_0x5782bf=_0xef0210[_0x1a9f61(0x109)](_0x3f28f5);_0x1529e9['onProgress']?.({'type':_0x1a9f61(0x128),'folder':_0x11c4e2});const _0xade784={'name':_0x4b068c,'parentFolderId':_0x5782bf},_0x5d2881=await _0x1529e9['withProgress'](_0x1a9f61(0x103)+_0x11c4e2+_0x1a9f61(0xf9),()=>_0x4f0154[_0x1a9f61(0x10b)][_0x1a9f61(0x14a)](_0x2fc75a[_0x1a9f61(0x148)],_0xade784));_0xef0210[_0x1a9f61(0xb4)](_0x11c4e2,_0x5d2881[_0x1a9f61(0x14c)]['id']),_0x1529e9[_0x1a9f61(0xe8)]?.({'type':_0x1a9f61(0xda),'folder':_0x11c4e2,'folderId':_0x5d2881['data']['id']}),_0x1529e9[_0x1a9f61(0x132)]?.(_0x1a9f61(0x12e)+_0x11c4e2+'\x27');}return _0xef0210;}export async function executePushSegmentDeletions(_0x1e9729,_0x15acff,_0x4e6f4e){const _0x2bf789=a110_0x40c26b;if(_0x15acff[_0x2bf789(0x106)]===0x0)return 0x0;const {batchAsync:_0x5b9248}=await import(_0x2bf789(0x87)),_0x4ca2a0=0x5,_0x54d319=await _0x5b9248(_0x15acff,async _0x5264dd=>{const _0x8dbdc1=_0x2bf789;return _0x4e6f4e[_0x8dbdc1(0xe8)]?.({'type':_0x8dbdc1(0xc8),'name':_0x5264dd[_0x8dbdc1(0x15d)]}),await _0x1e9729[_0x8dbdc1(0x10b)][_0x8dbdc1(0x13d)](_0x5264dd['id']),_0x4e6f4e[_0x8dbdc1(0xe8)]?.({'type':_0x8dbdc1(0xae),'name':_0x5264dd[_0x8dbdc1(0x15d)]}),_0x4e6f4e[_0x8dbdc1(0x127)]?.(_0x8dbdc1(0xf6)+_0x5264dd['name']+'\x27'),0x1;},_0x4ca2a0);return _0x54d319[_0x2bf789(0xa4)]((_0x651d82,_0x29e5ba)=>_0x651d82+_0x29e5ba,0x0);}export async function executePushJourneys(_0x16cf43,_0xb2284d,_0x1e98bd,_0x450a1e,_0x61b20){const _0x2aee78=a110_0x40c26b,{journeyDefToRequest:_0x1858f1}=await import(_0x2aee78(0x140)),{activationDefToCreateRequest:_0x537478,yamlRuleToApi:_0x157630,validateSegmentRule:_0x14f79e}=await import(_0x2aee78(0x158)),_0x2ef1e8={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x39ee83=new Map(_0x1e98bd[_0x2aee78(0x14e)]),_0x527d91=0x5;for(let _0x351afa=0x0;_0x351afa<_0xb2284d[_0x2aee78(0x106)];_0x351afa+=_0x527d91){const _0x4cb4f1=_0xb2284d[_0x2aee78(0xa9)](_0x351afa,_0x351afa+_0x527d91),_0x9f5f99=await Promise[_0x2aee78(0x15a)](_0x4cb4f1['map'](async _0x283e67=>{const _0x306e1f=_0x2aee78;if(!_0x283e67[_0x306e1f(0x164)]&&!_0x283e67[_0x306e1f(0x9e)])return{'action':_0x306e1f(0xd8),'name':_0x283e67[_0x306e1f(0x131)]['name'],'journeyId':_0x283e67[_0x306e1f(0xe5)]?.['id']};const _0x336b80=_0x283e67[_0x306e1f(0x15f)]?_0x1e98bd['folderPathToId']['get'](_0x283e67[_0x306e1f(0x15f)]):undefined;_0x61b20[_0x306e1f(0xe8)]?.({'type':_0x283e67['isNew']?_0x306e1f(0xdc):'journey_updating','name':_0x283e67[_0x306e1f(0x131)][_0x306e1f(0x15d)]});try{const _0x2ea88d=await executeSingleJourneyPush(_0x16cf43,_0x283e67,{..._0x1e98bd,'segmentNameToId':_0x39ee83},{'parentId':_0x450a1e[_0x306e1f(0x148)],'rootFolderId':_0x450a1e[_0x306e1f(0x13f)],'folderId':_0x336b80,'verbose':_0x450a1e[_0x306e1f(0xd7)]},_0x61b20,{'journeyDefToRequest':_0x1858f1,'activationDefToCreateRequest':_0x537478,'yamlRuleToApi':_0x157630,'validateSegmentRule':_0x14f79e});for(const [_0x53adff,_0x221cc6]of _0x2ea88d[_0x306e1f(0x108)]){_0x39ee83[_0x306e1f(0xb4)](_0x53adff,_0x221cc6),_0x2ef1e8[_0x306e1f(0x108)][_0x306e1f(0xb4)](_0x53adff,_0x221cc6);}if(_0x2ea88d['action']===_0x306e1f(0x110))_0x61b20[_0x306e1f(0xe8)]?.({'type':_0x306e1f(0x8f),'name':_0x283e67['yamlConfig'][_0x306e1f(0x15d)],'journeyId':_0x2ea88d[_0x306e1f(0x10a)]}),_0x61b20[_0x306e1f(0x100)]?.(_0x306e1f(0x113)+_0x283e67['yamlConfig'][_0x306e1f(0x15d)]+'\x27'),_0x2ef1e8['created']++;else _0x2ea88d[_0x306e1f(0x12f)]===_0x306e1f(0xbc)&&(_0x61b20['onProgress']?.({'type':'journey_updated','name':_0x283e67[_0x306e1f(0x131)][_0x306e1f(0x15d)]}),_0x61b20[_0x306e1f(0x100)]?.(_0x306e1f(0x89)+_0x283e67['yamlConfig']['name']+'\x27'),_0x2ef1e8[_0x306e1f(0xbc)]++);return{'action':_0x2ea88d[_0x306e1f(0x12f)],'name':_0x283e67[_0x306e1f(0x131)][_0x306e1f(0x15d)],'journeyId':_0x2ea88d[_0x306e1f(0x10a)]};}catch(_0x5d347f){const _0x395837=isHttp400Error(_0x5d347f),_0x419aeb=_0x395837?ErrorCode[_0x306e1f(0x111)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x267647=getErrorMessage(_0x5d347f);throw new SDKError(_0x419aeb,_0x306e1f(0xe2)+(_0x283e67[_0x306e1f(0x164)]?_0x306e1f(0x96):_0x306e1f(0xb9))+_0x306e1f(0x95)+_0x283e67[_0x306e1f(0x133)]+_0x306e1f(0x134)+_0x267647,_0x5d347f);}}));_0x2ef1e8[_0x2aee78(0x8e)][_0x2aee78(0x145)](..._0x9f5f99);}return _0x2ef1e8;}async function executeSingleJourneyPush(_0x1629bb,_0x2ed488,_0x5b12ef,_0x3b5db1,_0x5ebdd7,_0xedbc19){const _0x4b636f=a110_0x40c26b,{journeyDefToRequest:_0x32c202,activationDefToCreateRequest:_0x5f48c4,yamlRuleToApi:_0x397a97,validateSegmentRule:_0x498eea}=_0xedbc19,_0x252ebf=new Map(),_0x5f3a52=new Map(),_0x52cf0a=new Map(),_0x431463=new Map(),_0x5feb65=new Map();let _0x51cccb;const _0x2443f0=async()=>{const _0x931060=a110_0x371e;if(_0x51cccb)return;_0x51cccb=new Map();if(!_0x2ed488[_0x931060(0xe5)])return;const _0x13583e=await _0x1629bb['journey'][_0x931060(0x143)](_0x2ed488['existingJourney']['id']);for(const _0x5a4e3c of _0x13583e){const _0x1a71ea=journeyActivationStepToYaml(_0x5a4e3c,_0x5b12ef[_0x931060(0xc7)],_0x5b12ef[_0x931060(0x169)]),_0xe80ad6=activationSignature(_0x1a71ea);!_0x51cccb['has'](_0xe80ad6)&&_0x51cccb[_0x931060(0xb4)](_0xe80ad6,_0x5a4e3c['id']),_0x1a71ea[_0x931060(0x15d)]&&_0x5f3a52[_0x931060(0xb4)](_0x1a71ea[_0x931060(0x15d)],_0x5a4e3c['id']);}};if(_0x2ed488[_0x4b636f(0xe5)]&&_0x2ed488['yamlConfig'][_0x4b636f(0xff)]){const _0x1c999d=buildLocalExpandedRuleMappings(_0x2ed488[_0x4b636f(0x131)]),_0xdf95e4=_0x1c999d[_0x4b636f(0xf3)];if(_0xdf95e4[_0x4b636f(0xf4)]>0x0){const _0x595eab=new Map();for(const [_0x43013c,_0x2365e9]of _0xdf95e4){const _0x537b26=serializeExpandedRule(_0x2365e9,_0xdf95e4);_0x595eab[_0x4b636f(0xb4)](_0x43013c,_0x537b26);}const _0x222aeb=collectSegmentIdsFromJourneyApi(_0x2ed488[_0x4b636f(0xe5)]);if(_0x222aeb[_0x4b636f(0xf4)]>0x0){const _0x1f9e2f=await buildServerSegmentRuleMap(_0x1629bb,_0x3b5db1['parentId'],_0x5b12ef[_0x4b636f(0xa5)],_0x222aeb);if(_0x1f9e2f['size']>0x0){const _0x287db6=new Map();for(const [_0x1b6426,_0x378607]of _0x1f9e2f){const _0x59a597=serializeExpandedRule(_0x378607,_0x1f9e2f);!_0x287db6[_0x4b636f(0x167)](_0x59a597)&&_0x287db6[_0x4b636f(0xb4)](_0x59a597,_0x1b6426);}for(const [_0x5e847f,_0x37ad69]of _0x595eab){const _0x4c81ff=_0x287db6['get'](_0x37ad69);_0x4c81ff&&(_0x5feb65[_0x4b636f(0xb4)](_0x5e847f,_0x4c81ff),_0x5b12ef[_0x4b636f(0x14e)][_0x4b636f(0xb4)](_0x5e847f,_0x4c81ff));}}}}}const _0xbed600={'resolveSegmentId':async _0x1ccaf3=>{const _0x1a65d2=_0x4b636f,_0x4eb317=_0x5b12ef['segmentNameToId'][_0x1a65d2(0x109)](_0x1ccaf3);if(!_0x4eb317)throw new SDKError(ErrorCode[_0x1a65d2(0x10f)],'Segment\x20not\x20found:\x20'+_0x1ccaf3+_0x1a65d2(0x9d)+_0x2ed488[_0x1a65d2(0x131)][_0x1a65d2(0x15d)]+')');return _0x4eb317;},'resolveEmbeddedSegmentId':async(_0x48c153,_0x3b01bc)=>{const _0x4cad24=_0x4b636f,_0x4ea81e=_0x5b12ef[_0x4cad24(0x14e)][_0x4cad24(0x109)](_0x48c153);if(_0x4ea81e)return _0x4ea81e;const _0x5e3a6b=_0x5feb65[_0x4cad24(0x109)](_0x48c153);if(_0x5e3a6b)return _0x5b12ef[_0x4cad24(0x14e)][_0x4cad24(0xb4)](_0x48c153,_0x5e3a6b),_0x5e3a6b;const _0x1bec9c=_0x5b12ef[_0x4cad24(0xa5)][_0x4cad24(0xd0)](_0x33f8a4=>_0x33f8a4[_0x4cad24(0x15d)]===_0x48c153);if(_0x1bec9c)return _0x5b12ef[_0x4cad24(0x14e)][_0x4cad24(0xb4)](_0x48c153,_0x1bec9c['id']),_0x1bec9c['id'];if(_0x2ed488[_0x4cad24(0x164)]){const {stageName:_0x1832fc,criteriaName:_0x369420}=findSegmentCriteriaLocation(_0x2ed488['yamlConfig'],_0x48c153);return _0x498eea(_0x48c153,_0x3b01bc[_0x4cad24(0x121)]),_0x52cf0a[_0x4cad24(0xb4)](_0x48c153,{'definition':_0x3b01bc,'stageName':_0x1832fc,'criteriaName':_0x369420}),createPendingSegmentId(_0x48c153);}const _0x465415=_0x2ed488[_0x4cad24(0xe5)]?.['id'];if(!_0x465415)throw new SDKError(ErrorCode['INTERNAL'],_0x4cad24(0x147));_0x498eea(_0x48c153,_0x3b01bc['rule']);const _0x42f2f2=generateDeterministicJourneySegmentName(_0x2ed488[_0x4cad24(0x131)][_0x4cad24(0x15d)],_0x48c153),_0x484189=_0x5b12ef[_0x4cad24(0xa5)]['find'](_0x4f774d=>_0x4f774d[_0x4cad24(0x15d)]===_0x42f2f2),_0x4c96ab=createSegmentIdResolver(_0x5b12ef[_0x4cad24(0x14e)],_0x48c153),_0x20f18f=await resolveRuleSegmentIds(_0x3b01bc[_0x4cad24(0x121)],_0x4c96ab);let _0x1a9422;if(_0x484189)await _0x1629bb[_0x4cad24(0x10b)][_0x4cad24(0xa2)](_0x3b5db1[_0x4cad24(0x148)],_0x484189['id'],{'description':_0x3b01bc[_0x4cad24(0x135)]||_0x4cad24(0x9c)+_0x48c153,'rule':_0x397a97(_0x20f18f,!![]),'countPopulation':!![]}),_0x1a9422=_0x484189['id'];else try{_0x1a9422=await _0x1629bb[_0x4cad24(0x10b)][_0x4cad24(0xac)]({'name':_0x42f2f2,'description':_0x3b01bc['description']||_0x4cad24(0x9c)+_0x48c153,'journeyId':_0x465415,'rule':_0x397a97(_0x20f18f,!![]),'countPopulation':!![],'parentFolderId':_0x3b5db1[_0x4cad24(0x13f)]||'','audienceId':_0x3b5db1[_0x4cad24(0x148)]});}catch(_0x49a7e){const _0x2aac97=_0x49a7e instanceof Error&&_0x49a7e['message']['includes'](_0x4cad24(0xcc));if(_0x2aac97){const _0x254918=await _0x1629bb[_0x4cad24(0x10b)][_0x4cad24(0x85)](_0x3b5db1[_0x4cad24(0x148)]),_0x1d099e=_0x254918['find'](_0x13d6c6=>_0x13d6c6[_0x4cad24(0x15d)]===_0x42f2f2);if(_0x1d099e)await _0x1629bb['segment'][_0x4cad24(0xa2)](_0x3b5db1['parentId'],_0x1d099e['id'],{'description':_0x3b01bc['description']||_0x4cad24(0x9c)+_0x48c153,'rule':_0x397a97(_0x20f18f,!![]),'countPopulation':!![]}),_0x1a9422=_0x1d099e['id'];else throw _0x49a7e;}else throw _0x49a7e;}return _0x5b12ef['segmentNameToId']['set'](_0x48c153,_0x1a9422),_0x252ebf['set'](_0x48c153,_0x1a9422),_0x1a9422;},'resolveActivationId':async _0x54ce99=>{const _0xe3d712=_0x4b636f,_0x46735b=_0x5f3a52[_0xe3d712(0x109)](_0x54ce99);if(_0x46735b)return _0x46735b;if(_0x2ed488[_0xe3d712(0xe5)]){await _0x2443f0();const _0x3765fe=_0x5f3a52[_0xe3d712(0x109)](_0x54ce99);if(_0x3765fe)return _0x3765fe;}throw new SDKError(ErrorCode[_0xe3d712(0xca)],'Activation\x20not\x20found:\x20'+_0x54ce99+'\x20(referenced\x20in\x20journey\x20'+_0x2ed488[_0xe3d712(0x131)][_0xe3d712(0x15d)]+_0xe3d712(0xc2)+_0xe3d712(0xef));},'resolveEmbeddedActivationId':async(_0x575272,_0x4a4ce4)=>{const _0x5eb113=_0x4b636f,_0x3365e0=_0x5f3a52[_0x5eb113(0x109)](_0x575272);if(_0x3365e0)return _0x3365e0;if(_0x2ed488['isNew'])return _0x431463[_0x5eb113(0xb4)](_0x575272,_0x4a4ce4),createPendingActivationId(_0x575272);if(_0x2ed488[_0x5eb113(0xe5)]){await _0x2443f0();const _0xe579d4=_0x5f3a52[_0x5eb113(0x109)](_0x4a4ce4[_0x5eb113(0x15d)]);if(_0xe579d4)return _0x5f3a52['set'](_0x575272,_0xe579d4),_0xe579d4;const _0x13eae7=activationSignature(_0x4a4ce4),_0x3ba9c3=_0x51cccb?.['get'](_0x13eae7);if(_0x3ba9c3)return _0x5f3a52[_0x5eb113(0xb4)](_0x575272,_0x3ba9c3),_0x3ba9c3;const _0x2e88b9=await _0x5f48c4(_0x4a4ce4,_0x5b12ef['activationContext']),_0xdcb418=await _0x1629bb[_0x5eb113(0x11d)][_0x5eb113(0xaf)](_0x2ed488[_0x5eb113(0xe5)]['id'],_0x2e88b9);return _0x5f3a52[_0x5eb113(0xb4)](_0x575272,_0xdcb418['id']),_0xdcb418['id'];}throw new SDKError(ErrorCode[_0x5eb113(0x11e)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x4330db=>{const _0x780442=_0x4b636f;try{return await _0x1629bb[_0x780442(0x11d)][_0x780442(0xb5)](_0x3b5db1[_0x780442(0x148)],_0x4330db);}catch(_0x8dff79){throw new SDKError(ErrorCode[_0x780442(0xca)],_0x780442(0xbe)+_0x4330db+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2ed488[_0x780442(0x131)][_0x780442(0x15d)]+'\x27)',_0x8dff79);}},'resolveStageId':async(_0xd52e7,_0x261939)=>{const _0x38d49d=_0x4b636f,_0x1353ec=await _0x1629bb[_0x38d49d(0x11d)][_0x38d49d(0xd5)](_0xd52e7),_0x180607=_0x1353ec[_0x38d49d(0xb2)][_0x38d49d(0xf7)][_0x38d49d(0xd0)](_0x1b03bf=>_0x1b03bf[_0x38d49d(0x15d)][_0x38d49d(0xe1)]()===_0x261939[_0x38d49d(0xe1)]());if(!_0x180607?.['id'])throw new SDKError(ErrorCode[_0x38d49d(0xca)],'Stage\x20\x27'+_0x261939+_0x38d49d(0xe0)+(_0x1353ec[_0x38d49d(0xb2)][_0x38d49d(0xcd)]||_0x1353ec['attributes']['name'])+'\x27');return _0x180607['id'];}},_0x433858=await _0x32c202(_0x2ed488[_0x4b636f(0x131)],_0x3b5db1[_0x4b636f(0x148)],_0xbed600),_0x13a96b=_0x3b5db1['folderId']||_0x3b5db1[_0x4b636f(0x13f)];_0x13a96b&&(_0x433858['relationships']={'parentFolder':{'data':{'id':_0x13a96b,'type':'folder'}}});if(_0x2ed488[_0x4b636f(0x164)]){if(_0x52cf0a[_0x4b636f(0xf4)]>0x0||_0x431463[_0x4b636f(0xf4)]>0x0)return await executeThreeStepJourneyCreate(_0x1629bb,_0x2ed488,_0x433858,{'pendingEmbeddedSegments':_0x52cf0a,'pendingEmbeddedActivations':_0x431463,'embeddedSegmentNameToId':_0x252ebf,'journeyActivationNameToId':_0x5f3a52},{..._0x3b5db1,'effectiveFolderId':_0x13a96b},_0x5b12ef,_0x5ebdd7,_0xedbc19);else{ensureJourneyDefaults(_0x433858['attributes']);const _0x2ba386=await _0x1629bb[_0x4b636f(0x11d)][_0x4b636f(0x96)](_0x433858);return{'action':_0x4b636f(0x110),'journeyId':_0x2ba386['id'],'embeddedSegmentNameToId':_0x252ebf};}}else{if(_0x2ed488[_0x4b636f(0x9e)]&&_0x2ed488[_0x4b636f(0xe5)])return ensureJourneyDefaults(_0x433858[_0x4b636f(0xb2)]),await _0x1629bb[_0x4b636f(0x11d)][_0x4b636f(0xb9)](_0x2ed488['existingJourney']['id'],_0x433858),{'action':_0x4b636f(0xbc),'journeyId':_0x2ed488[_0x4b636f(0xe5)]['id'],'embeddedSegmentNameToId':_0x252ebf};}return{'action':_0x4b636f(0xd8),'journeyId':_0x2ed488[_0x4b636f(0xe5)]?.['id'],'embeddedSegmentNameToId':_0x252ebf};}function findSegmentCriteriaLocation(_0x218c5e,_0x32bd71){const _0x51d70a=a110_0x40c26b,_0x36bc98=_0x218c5e[_0x51d70a(0x126)]||_0x218c5e[_0x51d70a(0x13a)]?.[0x0]?.[_0x51d70a(0x126)]||[];let _0x502ab3=_0x51d70a(0xe7),_0xbf9b42=_0x32bd71;const _0x11a6ee=_0x218c5e['goal']||_0x218c5e[_0x51d70a(0x13a)]?.[0x0]?.['goal'];if(_0x11a6ee?.[_0x51d70a(0x10b)]===_0x32bd71)return{'stageName':'goal','criteriaName':_0x11a6ee[_0x51d70a(0x15d)]||_0x32bd71};_0x5f5945:for(const _0xe9bf85 of _0x36bc98){if(_0xe9bf85[_0x51d70a(0x11b)]?.['segment']===_0x32bd71){_0x502ab3=_0xe9bf85['name'],_0xbf9b42=_0xe9bf85['entry_criteria'][_0x51d70a(0x15d)]||_0x32bd71;break;}if(_0xe9bf85[_0x51d70a(0x12b)])for(const _0x402c0f of _0xe9bf85[_0x51d70a(0x12b)]){if(_0x402c0f[_0x51d70a(0x162)]==='decision_point'&&_0x402c0f[_0x51d70a(0x9b)]?.[_0x51d70a(0x14f)])for(const _0x278165 of _0x402c0f[_0x51d70a(0x9b)][_0x51d70a(0x14f)]){if(_0x278165[_0x51d70a(0x10b)]===_0x32bd71){_0x502ab3=_0xe9bf85[_0x51d70a(0x15d)],_0xbf9b42=_0x278165[_0x51d70a(0x15d)]||_0x32bd71;break _0x5f5945;}}}}return{'stageName':_0x502ab3,'criteriaName':_0xbf9b42};}async function executeThreeStepJourneyCreate(_0x398279,_0x3c266c,_0x3f4129,_0x1ef57e,_0x30ed0d,_0x45fcdf,_0x4b4ab4,_0x31f8aa){const _0x161f0f=a110_0x40c26b,{activationDefToCreateRequest:_0x21caec,yamlRuleToApi:_0x4aa34e}=_0x31f8aa,{pendingEmbeddedSegments:_0x37de0c,pendingEmbeddedActivations:_0x16ee30,embeddedSegmentNameToId:_0x322f77}=_0x1ef57e,_0x2fa61f=JSON[_0x161f0f(0xdd)](JSON[_0x161f0f(0x15c)](_0x3f4129));ensureJourneyDefaults(_0x2fa61f[_0x161f0f(0xb2)]),stripPendingIds(_0x2fa61f);const _0x50d485=await _0x398279[_0x161f0f(0x11d)][_0x161f0f(0x96)](_0x2fa61f),_0x71531b=_0x50d485['id'],_0x421e69=new Map();for(const _0x39635d of _0x50d485[_0x161f0f(0xb2)][_0x161f0f(0xf7)]){_0x421e69['set'](_0x39635d[_0x161f0f(0x15d)][_0x161f0f(0xe1)](),_0x39635d['id']);}for(const [_0x509f7d,{definition:_0x35518b}]of _0x37de0c){const _0x4fefec=generateDeterministicJourneySegmentName(_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],_0x509f7d);_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':_0x161f0f(0xa3),'journeyName':_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],'segmentName':_0x509f7d});const _0x34220b=createSegmentIdResolver(_0x45fcdf[_0x161f0f(0x14e)],_0x509f7d),_0x5ed9d2=await resolveRuleSegmentIds(_0x35518b[_0x161f0f(0x121)],_0x34220b),_0x3bc211=await _0x398279[_0x161f0f(0x10b)][_0x161f0f(0xac)]({'name':_0x4fefec,'description':_0x35518b['description']||_0x161f0f(0x9c)+_0x509f7d,'journeyId':_0x71531b,'rule':_0x4aa34e(_0x5ed9d2,!![]),'countPopulation':!![],'parentFolderId':_0x30ed0d[_0x161f0f(0xf0)]||'','audienceId':_0x30ed0d[_0x161f0f(0x148)]});_0x322f77[_0x161f0f(0xb4)](_0x509f7d,_0x3bc211),_0x45fcdf[_0x161f0f(0x14e)][_0x161f0f(0xb4)](_0x509f7d,_0x3bc211),_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':_0x161f0f(0xa1),'journeyName':_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],'segmentName':_0x509f7d});}const _0x39e825=new Map();for(const [_0x55db27,_0x472768]of _0x16ee30){_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':'embedded_activation_creating','journeyName':_0x3c266c['yamlConfig'][_0x161f0f(0x15d)],'activationName':_0x55db27});const _0x4aab08=await _0x21caec(_0x472768,_0x45fcdf[_0x161f0f(0x11a)]),_0x23531a=await _0x398279[_0x161f0f(0x11d)]['createActivation'](_0x71531b,_0x4aab08);_0x39e825[_0x161f0f(0xb4)](_0x55db27,_0x23531a['id']),_0x1ef57e[_0x161f0f(0xf8)][_0x161f0f(0xb4)](_0x55db27,_0x23531a['id']),_0x4b4ab4[_0x161f0f(0xe8)]?.({'type':_0x161f0f(0x13b),'journeyName':_0x3c266c[_0x161f0f(0x131)][_0x161f0f(0x15d)],'activationName':_0x55db27});}const _0x1c0a9f=JSON['parse'](JSON[_0x161f0f(0x15c)](_0x3f4129));return _0x1c0a9f['id']=_0x71531b,ensureJourneyDefaults(_0x1c0a9f['attributes']),resolvePendingIdsInRequest(_0x1c0a9f,_0x3f4129,_0x421e69,_0x322f77,_0x39e825,_0x4b4ab4),await _0x398279[_0x161f0f(0x11d)][_0x161f0f(0xb9)](_0x71531b,_0x1c0a9f),{'action':'created','journeyId':_0x71531b,'embeddedSegmentNameToId':_0x322f77};}function stripPendingIds(_0x12890f){const _0x1e93bf=a110_0x40c26b;for(const _0x4a860f of _0x12890f[_0x1e93bf(0xb2)]['journeyStages']||[]){_0x4a860f[_0x1e93bf(0x13e)]?.[_0x1e93bf(0x8b)]&&isPendingSegmentId(_0x4a860f[_0x1e93bf(0x13e)][_0x1e93bf(0x8b)])&&delete _0x4a860f[_0x1e93bf(0x13e)];if(_0x4a860f[_0x1e93bf(0x12b)])for(const _0x49117e of Object[_0x1e93bf(0xa7)](_0x4a860f[_0x1e93bf(0x12b)])){const _0x34b591=_0x4a860f[_0x1e93bf(0x12b)][_0x49117e];_0x34b591['type']===_0x1e93bf(0x118)&&_0x34b591[_0x1e93bf(0x123)]&&isPendingActivationId(_0x34b591[_0x1e93bf(0x123)])&&(_0x34b591['journeyActivationStepId']='');if(_0x34b591[_0x1e93bf(0x162)]===_0x1e93bf(0x151)&&_0x34b591[_0x1e93bf(0x14f)])for(const _0x1715f8 of _0x34b591[_0x1e93bf(0x14f)]){_0x1715f8[_0x1e93bf(0x8b)]&&isPendingSegmentId(_0x1715f8[_0x1e93bf(0x8b)])&&(_0x1715f8['segmentId']='');}_0x34b591['type']==='WaitStep'&&_0x34b591['waitCondition']?.[_0x1e93bf(0x8b)]&&isPendingSegmentId(_0x34b591[_0x1e93bf(0x119)][_0x1e93bf(0x8b)])&&(_0x34b591[_0x1e93bf(0x119)][_0x1e93bf(0x8b)]='');}}}function resolvePendingIdsInRequest(_0x206072,_0x18e05a,_0x376e19,_0x147bd8,_0x17fa0b,_0x4cad52){const _0x2480d7=a110_0x40c26b,_0xdc856a=(_0x48674d,_0x3be2a5)=>{const _0x210734=a110_0x371e;if(!isPendingSegmentId(_0x48674d))return _0x48674d;const _0x39876c=extractPendingSegmentName(_0x48674d),_0x24d20d=_0x147bd8['get'](_0x39876c);return!_0x24d20d&&_0x4cad52[_0x210734(0xcf)]?.(_0x210734(0x15e)+_0x39876c+_0x210734(0xe3)+_0x3be2a5),_0x24d20d;};if(_0x206072['attributes'][_0x2480d7(0xde)]?.['segmentId']&&isPendingSegmentId(_0x206072[_0x2480d7(0xb2)][_0x2480d7(0xde)]['segmentId'])){const _0x331542=_0xdc856a(_0x206072['attributes'][_0x2480d7(0xde)][_0x2480d7(0x8b)],_0x2480d7(0x14d));_0x331542&&(_0x206072[_0x2480d7(0xb2)]['goal'][_0x2480d7(0x8b)]=_0x331542);}for(const _0x42eb37 of _0x206072[_0x2480d7(0xb2)][_0x2480d7(0xf7)]||[]){const _0x33cb95=_0x376e19[_0x2480d7(0x109)](_0x42eb37[_0x2480d7(0x15d)][_0x2480d7(0xe1)]());_0x33cb95&&(_0x42eb37['id']=_0x33cb95);if(_0x42eb37[_0x2480d7(0x13e)]?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x42eb37['entryCriteria']['segmentId'])){const _0x3a83a7=_0xdc856a(_0x42eb37[_0x2480d7(0x13e)]['segmentId'],_0x2480d7(0xd9)+_0x42eb37[_0x2480d7(0x15d)]+_0x2480d7(0x15b));_0x3a83a7&&(_0x42eb37[_0x2480d7(0x13e)][_0x2480d7(0x8b)]=_0x3a83a7);}if(_0x42eb37[_0x2480d7(0x156)])for(const _0x81348e of _0x42eb37[_0x2480d7(0x156)]){if(_0x81348e['segmentId']&&isPendingSegmentId(_0x81348e[_0x2480d7(0x8b)])){const _0x374253=_0xdc856a(_0x81348e[_0x2480d7(0x8b)],_0x2480d7(0xd9)+_0x42eb37['name']+_0x2480d7(0xa8));_0x374253&&(_0x81348e[_0x2480d7(0x8b)]=_0x374253);}}if(_0x42eb37[_0x2480d7(0xec)]?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x42eb37[_0x2480d7(0xec)][_0x2480d7(0x8b)])){const _0x98298e=_0xdc856a(_0x42eb37[_0x2480d7(0xec)]['segmentId'],_0x2480d7(0xd9)+_0x42eb37['name']+_0x2480d7(0x102));_0x98298e&&(_0x42eb37[_0x2480d7(0xec)][_0x2480d7(0x8b)]=_0x98298e);}if(_0x42eb37['steps']){const _0x515bd8=_0x33b13c=>_0x18e05a[_0x2480d7(0xb2)][_0x2480d7(0xf7)][_0x2480d7(0xd0)](_0x4abf5b=>_0x4abf5b[_0x2480d7(0x15d)]['toLowerCase']()===_0x42eb37[_0x2480d7(0x15d)][_0x2480d7(0xe1)]())?.[_0x2480d7(0x12b)]?.[_0x33b13c];for(const _0x39ef96 of Object[_0x2480d7(0xa7)](_0x42eb37['steps'])){const _0x518622=_0x42eb37[_0x2480d7(0x12b)][_0x39ef96],_0x5f586e=_0x515bd8(_0x39ef96);if(_0x518622['type']==='Activation'&&_0x518622['journeyActivationStepId']&&(isPendingActivationId(_0x518622['journeyActivationStepId'])||_0x518622['journeyActivationStepId']==='')){if(_0x5f586e?.[_0x2480d7(0x123)]&&isPendingActivationId(_0x5f586e[_0x2480d7(0x123)])){const _0x144d97=extractPendingActivationName(_0x5f586e[_0x2480d7(0x123)]),_0x23aebe=_0x17fa0b[_0x2480d7(0x109)](_0x144d97);_0x23aebe&&(_0x518622[_0x2480d7(0x123)]=_0x23aebe);}}if(_0x518622[_0x2480d7(0x162)]==='DecisionPoint'&&_0x518622[_0x2480d7(0x14f)]&&_0x5f586e?.[_0x2480d7(0x14f)])for(let _0x2a9517=0x0;_0x2a9517<_0x518622[_0x2480d7(0x14f)]['length'];_0x2a9517++){const _0x5c5030=_0x518622[_0x2480d7(0x14f)][_0x2a9517],_0x1a7b9e=_0x5f586e[_0x2480d7(0x14f)][_0x2a9517];if(_0x1a7b9e?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x1a7b9e[_0x2480d7(0x8b)])){const _0x2275b6=_0xdc856a(_0x1a7b9e[_0x2480d7(0x8b)],_0x2480d7(0xd9)+_0x42eb37[_0x2480d7(0x15d)]+_0x2480d7(0x107)+(_0x5c5030[_0x2480d7(0x15d)]||_0x2a9517)+'\x27');_0x2275b6&&(_0x5c5030[_0x2480d7(0x8b)]=_0x2275b6);}}if(_0x518622[_0x2480d7(0x162)]===_0x2480d7(0xb8)&&_0x518622[_0x2480d7(0x119)]?.['segmentId']&&_0x5f586e?.[_0x2480d7(0x119)]?.[_0x2480d7(0x8b)]&&isPendingSegmentId(_0x5f586e[_0x2480d7(0x119)][_0x2480d7(0x8b)])){const _0x292ea0=_0xdc856a(_0x5f586e[_0x2480d7(0x119)]['segmentId'],_0x2480d7(0xd9)+_0x42eb37['name']+'\x27\x20wait\x20condition');_0x292ea0&&(_0x518622[_0x2480d7(0x119)][_0x2480d7(0x8b)]=_0x292ea0);}}}}}
|
|
1
|
+
const a110_0x3fa165=a110_0x3a2b;(function(_0x1fe507,_0x306e50){const _0x4a5053=a110_0x3a2b,_0x2a9383=_0x1fe507();while(!![]){try{const _0x2b2af9=parseInt(_0x4a5053(0x194))/0x1+parseInt(_0x4a5053(0x1c6))/0x2+-parseInt(_0x4a5053(0x24a))/0x3+parseInt(_0x4a5053(0x1c4))/0x4+parseInt(_0x4a5053(0x1ad))/0x5+parseInt(_0x4a5053(0x240))/0x6+-parseInt(_0x4a5053(0x1fe))/0x7*(parseInt(_0x4a5053(0x1e3))/0x8);if(_0x2b2af9===_0x306e50)break;else _0x2a9383['push'](_0x2a9383['shift']());}catch(_0xf9dd9b){_0x2a9383['push'](_0x2a9383['shift']());}}}(a110_0x4dbd,0xf2c12));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a110_0x3fa165(0x1b5);export const PENDING_ACTIVATION_PREFIX=a110_0x3fa165(0x1da);export function createPendingSegmentId(_0x1b089b){return''+PENDING_SEGMENT_PREFIX+_0x1b089b+'__';}export function isPendingSegmentId(_0x198283){const _0x3225c2=a110_0x3fa165;return _0x198283[_0x3225c2(0x214)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0xa42de1){const _0xdd80b=a110_0x3fa165;return _0xa42de1[_0xdd80b(0x20f)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1d1cb3){return''+PENDING_ACTIVATION_PREFIX+_0x1d1cb3+'__';}export function isPendingActivationId(_0x226270){return _0x226270['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4ef709){const _0x4f5252=a110_0x3fa165;return _0x4ef709[_0x4f5252(0x20f)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x416daa,_0x2c67ac){const _0x173862=a110_0x3fa165,_0x33d6fa=_0x416daa+'::'+(_0x2c67ac[_0x173862(0x175)]()||_0x173862(0x20e)),_0x4816b9=createHash(_0x173862(0x1a6))['update'](_0x33d6fa)[_0x173862(0x245)](_0x173862(0x20d))[_0x173862(0x1c5)](0x0,0xc);return _0x173862(0x1d2)+_0x4816b9;}export function ensureJourneyDefaults(_0x142ca0){const _0x36ec63=a110_0x3fa165;!_0x142ca0[_0x36ec63(0x19d)]&&(_0x142ca0[_0x36ec63(0x19d)]=''),!_0x142ca0[_0x36ec63(0x195)]&&(_0x142ca0['state']=_0x36ec63(0x17d));}export function resolveTDFolderPath(_0x3b833a,_0x4ed206,_0x394406){const _0x3f8dcf=a110_0x3fa165;if(!_0x4ed206)return _0x3b833a;if(_0x3b833a===_0x394406||_0x3b833a[_0x3f8dcf(0x214)](_0x394406+'/'))return _0x3b833a;return _0x3b833a?_0x394406+'/'+_0x3b833a:_0x394406;}function a110_0x4dbd(){const _0x95473f=['Activation','folderId','keys','segment_creating','size','sha1','\x20(referenced\x20in\x20journey\x20','deleted','decision_point','Updated\x20journey\x20\x27','createdSegmentId','Failed\x20to\x20','4487585fQqSUv','Created\x20activation\x20\x27','logInfo','index','\x20segment\x20from\x20file:\x20','INTERNAL','deleteActivation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','__pending_','Created\x20journey\x20\x27','toString','map','createFolder','activationsBySegmentId','reduce','\x27\x20from\x20file:\x20','flatMap','logSuccess','journeyId','parse','from','goal','isArray','1543276ZxJyMz','slice','497636RPYXeg','isNew','SEGMENT_NOT_FOUND','Deleted\x20segment\x20\x27','set','Created\x20folder\x20\x27','embedded_segment_created','journey_creating','existingJourney','journey','add','journeyBundleName','journey_entry_criteria_','\x20journey\x20from\x20file:\x20','push','journeyActivationStepId','parseDocument','filter','validatedRequest','length','__pending_act_','\x27\x20for\x20','action','max','folderPathToId','\x27...','stringify','with','has','258360qKbeze','versionNumber','stages','type','journeyById','Segment\x20not\x20found:\x20','Activation\x20not\x20found:\x20','Creating\x20activation\x20\x27','split','activation_deleted','localSegmentRules','embedded_activation_created','activationContext','activation_updating','embeddedSegmentNameToId','waitCondition','unchanged','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','data','listActivations','create','errors','activation_creating','activationActions','absolutePath','journeys','existingSegment','133MsNtCJ','deleteSegment','rule','stage\x20\x27','activationParams','\x27\x20exit\x20criteria','NOT_FOUND','utf-8','segmentNameToId','nameToType','JOURNEY_SYNTAX_ERROR','connector_config','delete','relationships','Updated\x20activation\x20\x27','hex','segment','replace','\x27\x20entry\x20criteria','sort','updated','Entry\x20criteria:\x20','startsWith','journeyBundlesByFolderAndName','Updating\x20segment\x20\x27','attributes','idToEmailMap','Updated\x20segment\x20\x27','DecisionPoint','includes','relative','createSegment','\x27\x20milestone','notification','getActivation','hasChanges','onProgress','listSegments','activation_template_id','journey_created','null','SEGMENT_UPDATE_ERROR','withProgress','milestone','createdSegmentIds','exitCriterias','connectionIdToNameMap','entry_criteria','journey_updating','resolveSegment','columns','logDeleted','created','./journey-yaml.js','Journey\x20\x27','parentId','journeyStages','activation_deleting','folderPath','schedule','steps','\x20activation\x20\x27','folder_creating','diff','):\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','1545156GBVEzd','progress','journeyActivationNameToId','rootFolderId','./child-segment-yaml.js','digest','entry','idToName','nameToId','toLowerCase','4526484heOlcN','\x0a\x20\x20','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','yamlConfig','folder','embedded_activation_creating','get','entryCriteria','../../utils/async.js','trim','all_columns','getJourney','message','WaitStep','Fetching\x20','segmentFolderId','join','draft','name','parentFolder','existingSegments','find','createJourneySegment','existingActivation','segmentId','updateSegmentById','results','Deleting\x20activation\x20\x27','parentSegmentFolder','values','deps','getSegment','ACTIVATION_UPDATE_ERROR','connection','createActivation','segments','Creating\x20segment\x20\x27','branches','fetchJourney','effectiveFolderId','1327075LwAvfQ','state','activation_created','behavior','update','\x27\x20wait\x20condition','activations','segment_deleted','skipSegments','description','Creating\x20folder\x20\x27','resolveJourneyId','all'];a110_0x4dbd=function(){return _0x95473f;};return a110_0x4dbd();}export function addFoldersToCreate(_0x3c7200,_0x45089f,_0x32684b){const _0x4b50f6=a110_0x3fa165;if(!_0x3c7200)return;if(_0x45089f['has'](_0x3c7200))return;const _0x24554e=_0x3c7200['split']('/');let _0x19919b='';for(const _0x428679 of _0x24554e){_0x19919b=_0x19919b?_0x19919b+'/'+_0x428679:_0x428679,!_0x45089f[_0x4b50f6(0x1e2)](_0x19919b)&&_0x32684b['add'](_0x19919b);}}import*as a110_0x2d76ab from'yaml';import{readFileSync}from'fs';import a110_0x3e4ea7 from'path';import{isJourneyDef,parseYamlString as a110_0x6afbf,toYamlString as a110_0x2bb947,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(_0x503912){const _0x13a7d0=a110_0x3fa165;if(Array[_0x13a7d0(0x1c3)](_0x503912))return'['+_0x503912['map'](_0x41f9b6=>stableStringify(_0x41f9b6))['join'](',')+']';if(_0x503912&&typeof _0x503912==='object'){const _0x1b69db=_0x503912,_0x218ffe=Object[_0x13a7d0(0x1a3)](_0x1b69db)[_0x13a7d0(0x211)](),_0x3361a6=_0x218ffe[_0x13a7d0(0x1b8)](_0x46905f=>'\x22'+_0x46905f+'\x22:'+stableStringify(_0x1b69db[_0x46905f]));return'{'+_0x3361a6['join'](',')+'}';}const _0x22807d=JSON[_0x13a7d0(0x1e0)](_0x503912);return _0x22807d===undefined?_0x13a7d0(0x226):_0x22807d;}function activationSignature(_0x1c6ece){const _0x3e7f33=a110_0x3fa165,_0x1f660c={'connection':_0x1c6ece[_0x3e7f33(0x18d)],..._0x1c6ece[_0x3e7f33(0x176)]!==undefined&&{'all_columns':_0x1c6ece[_0x3e7f33(0x176)]},..._0x1c6ece[_0x3e7f33(0x230)]!==undefined&&{'columns':_0x1c6ece[_0x3e7f33(0x230)]},..._0x1c6ece[_0x3e7f33(0x197)]!==undefined&&{'behavior':_0x1c6ece[_0x3e7f33(0x197)]},..._0x1c6ece[_0x3e7f33(0x239)]!==undefined&&{'schedule':_0x1c6ece[_0x3e7f33(0x239)]},..._0x1c6ece['notification']!==undefined&&{'notification':_0x1c6ece[_0x3e7f33(0x21f)]},..._0x1c6ece[_0x3e7f33(0x209)]!==undefined&&{'connector_config':_0x1c6ece[_0x3e7f33(0x209)]},..._0x1c6ece[_0x3e7f33(0x224)]!==undefined&&{'activation_template_id':_0x1c6ece[_0x3e7f33(0x224)]}};return stableStringify(_0x1f660c);}export async function prepareSegmentFiles(_0x1ccd45,_0xe796f8,_0x214079,_0x3dbfbd,_0xc51fce){const _0x2bd3cd=a110_0x3fa165,{activationDefToCreateRequest:_0x3256c9}=await import(_0x2bd3cd(0x244)),_0x361fc0=[],_0x18617b=new Set();for(const {yamlConfig:_0x2dde59,folderPath:_0xcb3687,sourcePath:_0x1b2be1}of _0x1ccd45){const _0x2cc23f=resolveTDFolderPath(_0xcb3687,_0x3dbfbd,_0xc51fce),_0x2eebd1=_0x2cc23f+':'+_0x2dde59[_0x2bd3cd(0x17e)],_0x410892=_0xe796f8['segmentByFolderAndName']['get'](_0x2eebd1),_0x4d4026=_0x410892?_0xe796f8[_0x2bd3cd(0x1ba)][_0x2bd3cd(0x172)](_0x410892['id'])||[]:[];addFoldersToCreate(_0x2cc23f,_0xe796f8['folderPathToId'],_0x18617b);const _0x4aaaa2=calculateActivationActions(_0x2dde59[_0x2bd3cd(0x19a)]||[],_0x4d4026,_0xe796f8['idToEmailMap'],_0xe796f8[_0x2bd3cd(0x22c)]);for(const _0x37ea0d of _0x4aaaa2){(_0x37ea0d[_0x2bd3cd(0x1e6)]===_0x2bd3cd(0x1f7)||_0x37ea0d[_0x2bd3cd(0x1e6)]===_0x2bd3cd(0x198))&&_0x37ea0d['yamlActivation']&&(_0x37ea0d['validatedRequest']=await _0x3256c9(_0x37ea0d['yamlActivation'],_0x214079));}const _0x2837be=calculateSegmentDiff(_0x2dde59,_0x410892,_0x4d4026,_0xe796f8[_0x2bd3cd(0x218)],_0xe796f8[_0x2bd3cd(0x22c)]);_0x361fc0[_0x2bd3cd(0x1d4)]({'relativePath':_0x2dde59['name'],'absolutePath':_0x1b2be1,'yamlConfig':_0x2dde59,'folderPath':_0x2cc23f,'existingSegment':_0x410892,'existingActivations':_0x4d4026,'isNew':_0x2837be[_0x2bd3cd(0x1c7)],'hasChanges':_0x2837be['hasChanges'],'diff':_0x2837be[_0x2bd3cd(0x23d)],'activationActions':_0x4aaaa2});}return{'segmentFiles':_0x361fc0,'foldersToCreate':_0x18617b};}export async function prepareJourneyFiles(_0x5c968b,_0x56efaf,_0x3033b4,_0x263eae){const _0x147015=a110_0x3fa165,_0xc788e2=[],_0x4a6900=new Set();for(const {yamlConfig:_0x1beac4,folderPath:_0x6e72e,sourcePath:_0x22d202}of _0x5c968b){const _0x4f6396=resolveTDFolderPath(_0x6e72e,_0x3033b4,_0x263eae),_0xf5998=_0x4f6396+':'+_0x1beac4[_0x147015(0x17e)],_0x4a57b6=_0x56efaf[_0x147015(0x215)]['get'](_0xf5998);let _0x1fa9e7,_0x6fd9d6;if(_0x4a57b6&&_0x4a57b6[_0x147015(0x1d9)]>0x0){const _0x188f55=buildLocalExpandedRuleMappings(_0x1beac4),{createYamlContext:_0x40dd0a,prefetchJourneySegments:_0xf2152d}=createPushYamlContextForBundle(_0x56efaf[_0x147015(0x18a)],_0x56efaf[_0x147015(0x235)],_0x56efaf['existingSegments'],_0x188f55,_0x56efaf[_0x147015(0x218)],_0x56efaf[_0x147015(0x22c)],_0x56efaf['activationStepsById'],_0x56efaf['journeyById']);await _0xf2152d(_0x4a57b6[_0x147015(0x1b8)](_0x12b668=>_0x12b668['id']));const _0x2310d4=hasMultipleVersions(_0x1beac4),_0x5a79ad=async _0x403a7c=>{const _0x51f9d6=_0x147015,_0x53d375=_0x56efaf[_0x51f9d6(0x1e7)]?.[_0x51f9d6(0x172)](_0x403a7c);if(_0x53d375)return _0x53d375;return _0x56efaf[_0x51f9d6(0x192)]({'journeyId':_0x403a7c,'journeyName':_0x1beac4['name'],'isMultiVersion':_0x4a57b6[_0x51f9d6(0x1d9)]>0x1});};if(_0x2310d4&&_0x4a57b6[_0x147015(0x1d9)]>0x1){const _0x572748=[];for(const _0x49c9e7 of _0x4a57b6){const _0x303eab=_0x49c9e7['versionNumber']||0x1;_0x56efaf[_0x147015(0x241)]?.[_0x147015(0x198)](_0x147015(0x17a)+_0x1beac4[_0x147015(0x17e)]+'\x20v'+_0x303eab);const _0x5956e6=await _0x5a79ad(_0x49c9e7['id']),_0x3083bc=_0x40dd0a(_0x49c9e7['id']),_0x49b598=await journeyResponseToDef(_0x5956e6,_0x3083bc);_0x572748[_0x147015(0x1d4)]({'item':_0x49c9e7,'yaml':_0x49b598});}const _0x5ef7ce=buildLocalRuleToNameMappingFromJourney(_0x1beac4);_0x6fd9d6=buildMergedJourneyDef(_0x572748,_0x5ef7ce);const _0x21b6d8=Math[_0x147015(0x1dd)](..._0x572748['map'](_0x39882a=>_0x39882a['item'][_0x147015(0x1e4)]||0x0)),_0x33ce22=_0x4a57b6[_0x147015(0x181)](_0x119f03=>(_0x119f03[_0x147015(0x1e4)]||0x0)===_0x21b6d8);_0x33ce22&&(_0x56efaf['progress']?.[_0x147015(0x198)](_0x147015(0x17a)+_0x1beac4[_0x147015(0x17e)]+'\x20v'+_0x21b6d8),_0x1fa9e7=await _0x5a79ad(_0x33ce22['id']));}else{const _0x14f7fe=_0x4a57b6[_0x4a57b6['length']-0x1];_0x56efaf[_0x147015(0x241)]?.[_0x147015(0x198)](_0x147015(0x17a)+_0x1beac4[_0x147015(0x17e)]),_0x1fa9e7=await _0x5a79ad(_0x14f7fe['id']);const _0x3d5ba2=_0x40dd0a(_0x14f7fe['id']),_0xf27ed2=await journeyResponseToDef(_0x1fa9e7,_0x3d5ba2),_0x178e3a=buildLocalRuleToNameMappingFromJourney(_0x1beac4);_0x6fd9d6=buildMergedJourneyDef([{'item':_0x14f7fe,'yaml':_0xf27ed2}],_0x178e3a);}}addFoldersToCreate(_0x4f6396,_0x56efaf[_0x147015(0x1de)],_0x4a6900);const _0x18f1a8=calculateJourneyDiff(_0x1beac4,_0x6fd9d6);_0xc788e2[_0x147015(0x1d4)]({'relativePath':_0x1beac4['name'],'absolutePath':_0x22d202,'yamlConfig':_0x1beac4,'folderPath':_0x4f6396,'existingJourney':_0x1fa9e7,'isNew':_0x18f1a8[_0x147015(0x1c7)],'hasChanges':_0x18f1a8['hasChanges'],'diff':_0x18f1a8[_0x147015(0x23d)]});}return{'journeyFiles':_0xc788e2,'foldersToCreate':_0x4a6900};}export function calculateActivationActions(_0x5bac55,_0x4bf756,_0x1d7c0e,_0x32ecaf){const _0x26e235=a110_0x3fa165,_0x280bc9=[],_0x146aef=new Map();for(const _0x2e8282 of _0x4bf756){_0x146aef[_0x26e235(0x1ca)](_0x2e8282[_0x26e235(0x17e)],_0x2e8282);}const _0x324767=new Map();for(const _0x2b8c9d of _0x5bac55){_0x324767[_0x26e235(0x1ca)](_0x2b8c9d[_0x26e235(0x17e)],_0x2b8c9d);}for(const _0x36901d of _0x5bac55){const _0x2686cf=_0x146aef['get'](_0x36901d[_0x26e235(0x17e)]);if(!_0x2686cf)_0x280bc9[_0x26e235(0x1d4)]({'type':_0x26e235(0x1f7),'name':_0x36901d[_0x26e235(0x17e)],'yamlActivation':_0x36901d});else{const _0x4f01d9=activationResponseToDef(_0x2686cf,_0x1d7c0e,_0x32ecaf),_0x14cd21=a110_0x2d76ab[_0x26e235(0x1e0)](_0x4f01d9),_0x83a2f9=a110_0x2d76ab[_0x26e235(0x1e0)](_0x36901d);_0x14cd21!==_0x83a2f9&&_0x280bc9['push']({'type':_0x26e235(0x198),'name':_0x36901d[_0x26e235(0x17e)],'yamlActivation':_0x36901d,'existingActivation':_0x2686cf});}}for(const _0xbd7659 of _0x4bf756){!_0x324767['has'](_0xbd7659[_0x26e235(0x17e)])&&_0x280bc9[_0x26e235(0x1d4)]({'type':'delete','name':_0xbd7659[_0x26e235(0x17e)],'existingActivation':_0xbd7659});}return _0x280bc9;}export function calculateSegmentDiff(_0x5c71d8,_0x365fea,_0x56d094,_0x23dab5,_0x3a03ed){const _0x558904=segmentToYamlString(_0x5c71d8);if(_0x365fea){const _0x3742e6=segmentWithActivationsToYaml(_0x365fea,_0x56d094,undefined,_0x23dab5,_0x3a03ed),_0x12aa3b=segmentToYamlString(_0x3742e6),_0x17b4d9=generateDiff(_0x12aa3b,_0x558904),_0x294b76=hasChanges(_0x17b4d9);return{'isNew':![],'hasChanges':_0x294b76,'diff':_0x294b76?formatDiffWithColors(_0x17b4d9):undefined};}const _0x33c108=generateDiff('',_0x558904);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x33c108)};}export function calculateJourneyDiff(_0x1e7c36,_0x103ad8){const _0x10d65a=normalizeJourneyDef(_0x1e7c36,_0x1e7c36),_0x531804=a110_0x2bb947(_0x10d65a);if(_0x103ad8){const _0x4440a1=normalizeJourneyDef(_0x103ad8,_0x1e7c36),_0x40cb4b=a110_0x2bb947(_0x4440a1),_0xd612c0=generateDiff(_0x40cb4b,_0x531804),_0x386c32=hasChanges(_0xd612c0);return{'isNew':![],'hasChanges':_0x386c32,'diff':_0x386c32?formatDiffWithColors(_0xd612c0):undefined};}const _0x1f6bd2=generateDiff('',_0x531804);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1f6bd2)};}export function findSegmentsToDelete(_0x82ee5e,_0x588b0d,_0x3aa70c,_0x593f77,_0x59c44d){const _0xc47fef=a110_0x3fa165,_0x55c8e7=new Set();for(const {yamlConfig:_0x15c9e5,folderPath:_0x5e0774}of _0x588b0d){_0x55c8e7[_0xc47fef(0x1d0)](_0x5e0774+':'+_0x15c9e5[_0xc47fef(0x17e)]);}return _0x82ee5e[_0xc47fef(0x1d7)](_0x5cada3=>{const _0x1af1d2=_0xc47fef,_0x20fca6=_0x5cada3['segmentFolderId']?_0x3aa70c['get'](_0x5cada3[_0x1af1d2(0x17b)]['toString']())||'':'',_0x5ea3c7=_0x20fca6+':'+_0x5cada3[_0x1af1d2(0x17e)];if(_0x55c8e7[_0x1af1d2(0x1e2)](_0x5ea3c7))return![];if(_0x59c44d)return _0x20fca6===_0x593f77||_0x20fca6[_0x1af1d2(0x214)](_0x593f77+'/');return!![];});}export function findJourneysToDelete(_0x48de51,_0x52d2be,_0x5731b4,_0x375158,_0x442401){const _0xb3d2a2=a110_0x3fa165,_0x2b9a73=new Set();for(const {yamlConfig:_0x410bfe,folderPath:_0x126b1e}of _0x52d2be){_0x2b9a73['add'](_0x126b1e+':'+_0x410bfe['name']);}return _0x48de51[_0xb3d2a2(0x1d7)](_0x3ef5e8=>{const _0x30c35e=_0xb3d2a2,_0x2aa5e5=_0x3ef5e8[_0x30c35e(0x1a2)]?_0x5731b4[_0x30c35e(0x172)](_0x3ef5e8[_0x30c35e(0x1a2)])||'':'',_0x17d9a2=_0x2aa5e5+':'+_0x3ef5e8[_0x30c35e(0x1d1)];if(_0x2b9a73[_0x30c35e(0x1e2)](_0x17d9a2))return![];if(_0x442401)return _0x2aa5e5===_0x375158||_0x2aa5e5[_0x30c35e(0x214)](_0x375158+'/');return!![];});}export function buildSegmentLookupMap(_0xffc785,_0x2912d5){const _0x18d5a2=a110_0x3fa165,_0x4fae1e=new Map();for(const _0x4de95d of _0xffc785){const _0x3eabbc=_0x4de95d[_0x18d5a2(0x17b)]?_0x2912d5['get'](_0x4de95d[_0x18d5a2(0x17b)][_0x18d5a2(0x1b7)]())||'':'',_0x476a27=_0x3eabbc+':'+_0x4de95d[_0x18d5a2(0x17e)];_0x4fae1e[_0x18d5a2(0x1ca)](_0x476a27,_0x4de95d);}return _0x4fae1e;}export function buildSegmentNameToIdMap(_0x501d49){const _0x445494=a110_0x3fa165,_0x3a15be=new Map();for(const _0x28e887 of _0x501d49){_0x3a15be['set'](_0x28e887[_0x445494(0x17e)],_0x28e887['id']);}return _0x3a15be;}export function buildJourneyBundleLookupMap(_0x2dcdff,_0xea0baf){const _0x4d36d3=a110_0x3fa165,_0x8337c6=new Map();for(const _0x3f4229 of _0x2dcdff){const _0x199396=_0x3f4229[_0x4d36d3(0x1a2)]?_0xea0baf[_0x4d36d3(0x172)](_0x3f4229[_0x4d36d3(0x1a2)])||'':'',_0x33360f=_0x199396+':'+_0x3f4229[_0x4d36d3(0x1d1)];!_0x8337c6[_0x4d36d3(0x1e2)](_0x33360f)&&_0x8337c6[_0x4d36d3(0x1ca)](_0x33360f,[]),_0x8337c6['get'](_0x33360f)[_0x4d36d3(0x1d4)](_0x3f4229);}for(const _0x290d05 of _0x8337c6[_0x4d36d3(0x189)]()){_0x290d05[_0x4d36d3(0x211)]((_0x270135,_0x2202e4)=>(_0x270135[_0x4d36d3(0x1e4)]||0x0)-(_0x2202e4[_0x4d36d3(0x1e4)]||0x0));}return _0x8337c6;}export function collectFoldersToCreate(_0x3b03ac,_0x17eb1b){const _0x3087e9=a110_0x3fa165,_0x495223=new Set();for(const _0x40b434 of _0x3b03ac){if(!_0x40b434)continue;if(_0x17eb1b[_0x3087e9(0x1e2)](_0x40b434))continue;const _0x3388e4=_0x40b434[_0x3087e9(0x1eb)]('/');let _0x478d1d='';for(const _0x4d2f24 of _0x3388e4){_0x478d1d=_0x478d1d?_0x478d1d+'/'+_0x4d2f24:_0x4d2f24,!_0x17eb1b[_0x3087e9(0x1e2)](_0x478d1d)&&_0x495223['add'](_0x478d1d);}}return _0x495223;}export function parseAndClassifyYamlFiles(_0x42544b,_0x17e2d3,_0x4fce3b){const _0x5dcd90=a110_0x3fa165,_0x4e8580=[],_0x3a4fec=[];for(const _0x4108d4 of _0x42544b){const _0x58fe11=a110_0x3e4ea7[_0x5dcd90(0x21c)](_0x17e2d3,a110_0x3e4ea7['dirname'](_0x4108d4)),_0x3b6772=_0x58fe11==='.'?'':_0x58fe11,_0x3657e7=readFileSync(_0x4108d4,_0x5dcd90(0x205)),_0x14ab1c=a110_0x2d76ab['parse'](_0x3657e7);if(isJourneyDef(_0x14ab1c)){const _0x135c3a=a110_0x6afbf(_0x3657e7);_0x3a4fec[_0x5dcd90(0x1d4)]({'yamlConfig':_0x135c3a,'folderPath':_0x3b6772,'sourcePath':_0x4108d4});}else{if(!_0x4fce3b?.[_0x5dcd90(0x19c)]){const _0x30c00e=parseSegmentYamlFile(_0x3657e7),_0x36d788=normalizeChildSegmentYaml(_0x30c00e);_0x4e8580[_0x5dcd90(0x1d4)]({'yamlConfig':_0x36d788,'folderPath':_0x3b6772,'sourcePath':_0x4108d4});}}}return{'segments':_0x4e8580,'journeys':_0x3a4fec};}export function validateParsedFiles(_0x15cbb8,_0x3c9f48){const _0x5cb778=a110_0x3fa165,_0x200f84=[];for(const {yamlConfig:_0x36a709,sourcePath:_0x43c8bd}of _0x15cbb8[_0x5cb778(0x18f)]){const _0x41ed80=readFileSync(_0x43c8bd,'utf-8'),_0x22674b=a110_0x2d76ab['parseDocument'](_0x41ed80),_0xe8b41a=validateSegmentDef(_0x36a709,{'source':_0x41ed80,'document':_0x22674b});if(!_0xe8b41a['valid']){const _0xd5013b=a110_0x3e4ea7[_0x5cb778(0x21c)](_0x3c9f48,_0x43c8bd);_0x200f84[_0x5cb778(0x1d4)]({'filePath':_0xd5013b,'source':_0x41ed80,'result':_0xe8b41a,'isJourney':![]});}}for(const {yamlConfig:_0xb8989b,sourcePath:_0x3e02a9}of _0x15cbb8[_0x5cb778(0x1fc)]){const _0x461438=readFileSync(_0x3e02a9,_0x5cb778(0x205)),_0x3bb2c8=a110_0x2d76ab[_0x5cb778(0x1d6)](_0x461438),_0x2c1279=validateJourneyDef(_0xb8989b,{'source':_0x461438,'document':_0x3bb2c8});if(!_0x2c1279['valid']){const _0x1e81f2=a110_0x3e4ea7[_0x5cb778(0x21c)](_0x3c9f48,_0x3e02a9);_0x200f84[_0x5cb778(0x1d4)]({'filePath':_0x1e81f2,'source':_0x461438,'result':_0x2c1279,'isJourney':!![]});}}return _0x200f84;}export function formatValidationErrors(_0x5922a2){const _0x5ee92e=a110_0x3fa165,_0x181006=[];for(const {filePath:_0x5d2670,source:_0x50dcd7,result:_0x2b23c9,isJourney:_0x2ed8e9}of _0x5922a2){const _0x35aed0=_0x2ed8e9?_0x5ee92e(0x1cf):_0x5ee92e(0x20e);_0x181006[_0x5ee92e(0x1d4)]('\x0a'+_0x5d2670+'\x20('+_0x35aed0+_0x5ee92e(0x23e)+_0x2b23c9[_0x5ee92e(0x1f8)][_0x5ee92e(0x1d9)]+'\x20error(s)'),_0x181006[_0x5ee92e(0x1d4)](formatValidationResult(_0x2b23c9,_0x50dcd7,_0x5d2670));}return _0x181006[_0x5ee92e(0x17c)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x39a42a){const _0xe88875=a110_0x3fa165,_0x66b926=new Set(),_0x19a515=new Map(),_0x1cf7d2=collectSegmentUsageCounts(_0x39a42a);if(_0x39a42a[_0xe88875(0x18f)])for(const [_0x1fe57f,_0x4764bb]of Object['entries'](_0x39a42a[_0xe88875(0x18f)])){_0x66b926['add'](_0x1fe57f);if(_0x4764bb['rule']){const _0xd763de=yamlRuleToApi(_0x4764bb[_0xe88875(0x200)]),_0x3a2a4a=apiRuleToYaml(_0xd763de);_0x19a515['set'](_0x1fe57f,_0x3a2a4a);}}const _0xc14f46=new Map();let _0x233ef9=0x0;for(const [_0x29aa0c,_0x3227d8]of _0x19a515){const _0x594243=serializeExpandedRule(_0x3227d8,_0x19a515),_0xc42184=_0xc14f46[_0xe88875(0x172)](_0x594243)||[];_0xc42184['push']({'name':_0x29aa0c,'index':_0x233ef9}),_0xc14f46[_0xe88875(0x1ca)](_0x594243,_0xc42184),_0x233ef9++;}const _0x2cc247=new Map();for(const [_0x3fbfe9,_0x168c19]of _0xc14f46){const _0x468d6a=_0x168c19[_0xe88875(0x1c5)]()['sort']((_0x47dda2,_0x5825f5)=>{const _0x5a1679=_0xe88875,_0x6cc2ac=_0x1cf7d2[_0x5a1679(0x172)](_0x47dda2[_0x5a1679(0x17e)])||0x0,_0x474336=_0x1cf7d2[_0x5a1679(0x172)](_0x5825f5[_0x5a1679(0x17e)])||0x0;if(_0x6cc2ac!==_0x474336)return _0x474336-_0x6cc2ac;return _0x47dda2[_0x5a1679(0x1b0)]-_0x5825f5[_0x5a1679(0x1b0)];})[_0xe88875(0x1b8)](_0x106313=>_0x106313[_0xe88875(0x17e)]),_0x4076a3=[];for(const _0xef5b60 of _0x468d6a){const _0x43c6f0=_0x1cf7d2[_0xe88875(0x172)](_0xef5b60)||0x0,_0x4f2bf1=Math[_0xe88875(0x1dd)](_0x43c6f0,0x1);for(let _0x501515=0x0;_0x501515<_0x4f2bf1;_0x501515++){_0x4076a3[_0xe88875(0x1d4)](_0xef5b60);}}_0x2cc247[_0xe88875(0x1ca)](_0x3fbfe9,_0x4076a3);}return{'existingLocalSegmentNames':_0x66b926,'localSegmentRules':_0x19a515,'localExpandedRuleToNames':_0x2cc247};}async function buildServerSegmentRuleMap(_0x220a3e,_0x1a5f65,_0x312e46,_0x39585a){const _0x110751=new Map(),_0x4c7066=new Set(),_0x46fe78=async _0x2c342c=>{const _0x80e19c=a110_0x3a2b;if(_0x4c7066[_0x80e19c(0x1e2)](_0x2c342c))return;_0x4c7066['add'](_0x2c342c);let _0x25909b=_0x312e46[_0x80e19c(0x181)](_0x288a7f=>_0x288a7f['id']===_0x2c342c);if(!_0x25909b)try{_0x25909b=await _0x220a3e[_0x80e19c(0x20e)][_0x80e19c(0x18b)](_0x1a5f65,_0x2c342c);}catch{return;}if(!_0x25909b?.[_0x80e19c(0x200)])return;const _0xa511dd=apiRuleToYaml(_0x25909b['rule']);_0x110751[_0x80e19c(0x1ca)](_0x2c342c,_0xa511dd);const _0x1f1a82=collectSegmentRefsFromRule(_0xa511dd);for(const _0x41a68c of _0x1f1a82){await _0x46fe78(_0x41a68c);}};for(const _0x3301a2 of _0x39585a){await _0x46fe78(_0x3301a2);}return _0x110751;}export function createSegmentIdResolver(_0x177c81,_0x4b9d94){return async _0xaac5f8=>{const _0x10ca33=a110_0x3a2b,_0xb7c63b=_0x177c81[_0x10ca33(0x172)](_0xaac5f8);if(!_0xb7c63b)throw new SDKError(ErrorCode[_0x10ca33(0x1c8)],_0x10ca33(0x1e8)+_0xaac5f8+_0x10ca33(0x16e)+_0x4b9d94+'\x27)');return _0xb7c63b;};}export function extractRootFolderId(_0x162fd9){const _0x165314=a110_0x3fa165;return _0x162fd9[_0x165314(0x20b)]?.[_0x165314(0x188)]?.[_0x165314(0x1f5)]?.['id']||_0x162fd9[_0x165314(0x20b)]?.[_0x165314(0x17f)]?.[_0x165314(0x1f5)]?.['id'];}export function buildConnectionMaps(_0xce4f80){const _0x387634=a110_0x3fa165,_0x441ff2=new Map(),_0x5dbd58=new Map(),_0x391ecf=new Map();for(const _0x5e9e98 of _0xce4f80){_0x441ff2[_0x387634(0x1ca)](_0x5e9e98['name'],parseInt(_0x5e9e98['id'],0xa)),_0x5dbd58[_0x387634(0x1ca)](_0x5e9e98['id'],_0x5e9e98[_0x387634(0x17e)]),_0x391ecf[_0x387634(0x1ca)](_0x5e9e98[_0x387634(0x17e)],_0x5e9e98['type']);}return{'nameToId':_0x441ff2,'idToName':_0x5dbd58,'nameToType':_0x391ecf};}export function calculatePushStats(_0x218429,_0x209385,_0x2c6fd4,_0x34fa4c,_0x2e8e57,_0x5e6bad,_0x4322b5){const _0x494cc1=a110_0x3fa165,_0x448a78=_0x218429[_0x494cc1(0x1d7)](_0x387280=>_0x387280[_0x494cc1(0x1c7)]),_0xa278ad=_0x218429[_0x494cc1(0x1d7)](_0x1b05e2=>!_0x1b05e2[_0x494cc1(0x1c7)]&&_0x1b05e2[_0x494cc1(0x221)]),_0x3a97e2=_0x218429[_0x494cc1(0x1d7)](_0x1d180e=>!_0x1d180e[_0x494cc1(0x1c7)]&&!_0x1d180e[_0x494cc1(0x221)]),_0x4215d9=_0x5e6bad?_0x34fa4c:[],_0x5b7307=_0x209385[_0x494cc1(0x1d7)](_0x2b0a99=>_0x2b0a99[_0x494cc1(0x1c7)]),_0x58695f=_0x209385[_0x494cc1(0x1d7)](_0x33a4a5=>!_0x33a4a5[_0x494cc1(0x1c7)]&&_0x33a4a5[_0x494cc1(0x221)]),_0x276fb8=_0x209385[_0x494cc1(0x1d7)](_0x4f1c8b=>!_0x4f1c8b['isNew']&&!_0x4f1c8b[_0x494cc1(0x221)]),_0xf84307=_0x5e6bad?_0x2e8e57:[],_0x13a652=_0x218429[_0x494cc1(0x1bd)](_0x5ea865=>_0x5ea865['activationActions']),_0x1dee63=_0x13a652['filter'](_0xa51f35=>_0xa51f35[_0x494cc1(0x1e6)]===_0x494cc1(0x1f7)),_0x263abc=_0x13a652['filter'](_0x393472=>_0x393472[_0x494cc1(0x1e6)]==='update'),_0x1d095a=_0x13a652[_0x494cc1(0x1d7)](_0x1a4975=>_0x1a4975['type']===_0x494cc1(0x20a)),_0x3d7fe7=Array[_0x494cc1(0x1c1)](_0x2c6fd4)['sort'](),_0x2fcdee=_0x4322b5?![]:_0x448a78['length']>0x0||_0xa278ad[_0x494cc1(0x1d9)]>0x0||_0x4215d9[_0x494cc1(0x1d9)]>0x0,_0x1bcf9c=_0x5b7307['length']>0x0||_0x58695f[_0x494cc1(0x1d9)]>0x0||_0xf84307['length']>0x0,_0x3f158a=_0x4322b5?![]:_0x13a652[_0x494cc1(0x1d9)]>0x0,_0x551c50=_0x3d7fe7['length']>0x0;return{'segments':{'new':_0x448a78,'changed':_0xa278ad,'unchanged':_0x3a97e2,'toDelete':_0x4215d9},'journeys':{'new':_0x5b7307,'changed':_0x58695f,'unchanged':_0x276fb8,'toDelete':_0xf84307},'activations':{'all':_0x13a652,'toCreate':_0x1dee63,'toUpdate':_0x263abc,'toDelete':_0x1d095a},'folders':{'toCreate':_0x3d7fe7},'counts':{'segments':{'new':_0x448a78[_0x494cc1(0x1d9)],'changed':_0xa278ad[_0x494cc1(0x1d9)],'unchanged':_0x3a97e2[_0x494cc1(0x1d9)],'toDelete':_0x4215d9[_0x494cc1(0x1d9)]},'journeys':{'new':_0x5b7307['length'],'changed':_0x58695f[_0x494cc1(0x1d9)],'unchanged':_0x276fb8['length'],'toDelete':_0xf84307['length']},'activations':{'create':_0x1dee63[_0x494cc1(0x1d9)],'update':_0x263abc['length'],'delete':_0x1d095a[_0x494cc1(0x1d9)]},'folders':_0x3d7fe7[_0x494cc1(0x1d9)]},'hasChanges':_0x2fcdee||_0x1bcf9c||_0x3f158a||_0x551c50};}function a110_0x3a2b(_0x3cd9d6,_0x2122a8){_0x3cd9d6=_0x3cd9d6-0x16d;const _0x4dbdb6=a110_0x4dbd();let _0x3a2b94=_0x4dbdb6[_0x3cd9d6];return _0x3a2b94;}export async function buildPushExecutionContext(_0x4e03f7,_0x1cb85b,_0x55e9ab,_0x765978,_0x220e27,_0x448b2f){const _0xbc86b9=a110_0x3fa165,_0x4ad815=extractRootFolderId(_0x55e9ab),{pathToId:_0x51f6e7,idToPath:_0x34b7d0}=buildFolderMaps(_0x220e27),_0x51ccd7=buildSegmentNameToIdMap(_0x765978),_0x171dd2=new Map(),{batchAsync:_0x305b2c}=await import(_0xbc86b9(0x174)),[_0x28e5e3,_0x2d598a]=await Promise[_0xbc86b9(0x1a0)]([_0x4e03f7['user']['buildUserMaps'](),_0x4e03f7[_0xbc86b9(0x18d)]['list'](),((async()=>{const _0x2e62dc=_0xbc86b9;!_0x448b2f&&_0x765978[_0x2e62dc(0x1d9)]>0x0&&await _0x305b2c(_0x765978,async _0x43dbf7=>{const _0x29b255=_0x2e62dc,_0x1e0b27=await _0x4e03f7[_0x29b255(0x20e)][_0x29b255(0x1f6)](_0x1cb85b,_0x43dbf7['id']);_0x171dd2['set'](_0x43dbf7['id'],_0x1e0b27);});})())]),{emailToId:_0x50ef48,idToEmail:_0x5c03d8}=_0x28e5e3,_0xb30bd4=buildConnectionMaps(_0x2d598a);return{'rootFolderId':_0x4ad815,'folderPathToId':_0x51f6e7,'folderIdToPath':_0x34b7d0,'segmentNameToId':_0x51ccd7,'activationsBySegmentId':_0x171dd2,'emailToIdMap':_0x50ef48,'idToEmailMap':_0x5c03d8,'connectionNameToIdMap':_0xb30bd4[_0xbc86b9(0x248)],'connectionIdToNameMap':_0xb30bd4[_0xbc86b9(0x247)],'connectionNameToTypeMap':_0xb30bd4[_0xbc86b9(0x207)]};}export function createPushYamlContextForBundle(_0x3c7c4d,_0x428e38,_0x230a33,_0x31bc45,_0x639647,_0xec7827,_0x3d0a9e,_0x2cf11c){const {existingLocalSegmentNames:_0x33133,localExpandedRuleToNames:_0x7a4ee}=_0x31bc45,_0x587dbd=new Set(),_0x2b8136=new Map(),_0x35e29b=new Map(),_0x29fa9d=new Map(),_0x1044ad=createJumpTargetCache(),_0x5747d3=new Map(),_0x373963=new Map(),_0x402574=new Set();let _0x288104;const _0x11f188=_0x429fbd=>{const _0xd928fe={'resolveSegment':async _0xb1f622=>{const _0x1a9009=a110_0x3a2b,_0x598cf3=_0x29fa9d[_0x1a9009(0x172)](_0xb1f622);if(_0x598cf3!==undefined)return{'name':_0x598cf3,'isJourneyLocal':!![]};try{let _0x13cbf6=_0x230a33[_0x1a9009(0x181)](_0x16e407=>_0x16e407['id']===_0xb1f622);!_0x13cbf6&&(_0x13cbf6=await _0x3c7c4d['segment'][_0x1a9009(0x18b)](_0x428e38,_0xb1f622));const _0x3343a5=generateJourneyLocalName(_0x13cbf6[_0x1a9009(0x17e)]),_0x5b0bff=_0x13cbf6['kind']===SEGMENT_KIND_JOURNEY&&_0x3343a5!==undefined;let _0x3df4c5=_0x13cbf6['name'],_0x9fb4df;if(_0x5b0bff&&_0x13cbf6[_0x1a9009(0x200)]){const _0x1d13e6=apiRuleToYaml(_0x13cbf6[_0x1a9009(0x200)]);_0x373963[_0x1a9009(0x1ca)](_0xb1f622,_0x1d13e6);const _0x48233b=async _0x360eb5=>{const _0x216717=_0x1a9009,_0x56c711=collectSegmentRefsFromRule(_0x360eb5);for(const _0x2d9fa0 of _0x56c711){if(!_0x373963['has'](_0x2d9fa0))try{const _0x225c77=await _0x3c7c4d['segment'][_0x216717(0x18b)](_0x428e38,_0x2d9fa0);if(_0x225c77?.[_0x216717(0x200)]){const _0x1ab563=apiRuleToYaml(_0x225c77['rule']);_0x373963['set'](_0x2d9fa0,_0x1ab563),await _0x48233b(_0x1ab563);}}catch{}}};await _0x48233b(_0x1d13e6);const _0x451ac6=serializeExpandedRule(_0x1d13e6,_0x373963),_0x56138c=_0x7a4ee['get'](_0x451ac6);if(_0x56138c&&_0x56138c[_0x1a9009(0x1d9)]>0x0){const _0x20279d=_0x2b8136[_0x1a9009(0x172)](_0x451ac6)||0x0,_0x119ba6=_0x56138c[_0x20279d]||_0x56138c[_0x56138c[_0x1a9009(0x1d9)]-0x1];_0x2b8136[_0x1a9009(0x1ca)](_0x451ac6,_0x20279d+0x1),_0x3df4c5=_0x119ba6,_0x587dbd['add'](_0x3df4c5),_0x29fa9d[_0x1a9009(0x1ca)](_0xb1f622,_0x3df4c5);const _0x54893f=await resolveRuleSegmentRefs(_0x1d13e6,async _0x42f503=>{const _0x58a3fb=_0x1a9009,_0x404390=_0x29fa9d[_0x58a3fb(0x172)](_0x42f503);if(_0x404390)return _0x404390;const _0x744798=await _0x288104[_0x58a3fb(0x22f)](_0x42f503);return _0x744798['name'];});_0x9fb4df={'description':_0x13cbf6[_0x1a9009(0x19d)],'rule':_0x54893f};}else{const _0x387cf0=_0x5747d3[_0x1a9009(0x172)](_0x451ac6);if(_0x387cf0)_0x3df4c5=_0x387cf0,_0x29fa9d[_0x1a9009(0x1ca)](_0xb1f622,_0x3df4c5);else{if(_0x3343a5){let _0x4df927=_0x3343a5,_0x1ff1bb=0x2;while(_0x587dbd['has'](_0x4df927)||_0x33133[_0x1a9009(0x1e2)](_0x4df927)){_0x4df927=_0x3343a5+'_'+_0x1ff1bb,_0x1ff1bb++;}_0x587dbd['add'](_0x4df927),_0x3df4c5=_0x4df927;}_0x29fa9d['set'](_0xb1f622,_0x3df4c5),_0x5747d3[_0x1a9009(0x1ca)](_0x451ac6,_0x3df4c5);const _0x105c9c=await resolveRuleSegmentRefs(_0x1d13e6,async _0x3b42f2=>{const _0x4ef59e=_0x1a9009,_0x316d0c=_0x29fa9d[_0x4ef59e(0x172)](_0x3b42f2);if(_0x316d0c)return _0x316d0c;const _0x5337db=await _0x288104[_0x4ef59e(0x22f)](_0x3b42f2);return _0x5337db['name'];});_0x9fb4df={'description':_0x13cbf6[_0x1a9009(0x19d)],'rule':_0x105c9c};}}}return{'name':_0x3df4c5,'isJourneyLocal':_0x5b0bff,'definition':_0x9fb4df};}catch{return{'name':_0xb1f622,'isJourneyLocal':![]};}},'resolveActivation':async _0x37e804=>{const _0x4708e5=a110_0x3a2b,_0x41948d=_0x35e29b[_0x4708e5(0x172)](_0x37e804);if(_0x41948d!==undefined)return{'name':_0x41948d,'isJourneyLocal':!![]};try{let _0x5d3bf0=_0x3d0a9e?.[_0x4708e5(0x172)](_0x37e804);!_0x5d3bf0&&(_0x5d3bf0=await _0x3c7c4d[_0x4708e5(0x1cf)][_0x4708e5(0x220)](_0x429fbd,_0x37e804));const _0x1acf35=_0x5d3bf0[_0x4708e5(0x217)][_0x4708e5(0x202)]['name']||_0x37e804,_0x22c816=sanitizeYamlKey(_0x1acf35)||'activation_'+_0x37e804,_0x4e20eb=_0x22c816;_0x35e29b[_0x4708e5(0x1ca)](_0x37e804,_0x4e20eb);const _0x4afd2b=journeyActivationStepToYaml(_0x5d3bf0,_0x639647,_0xec7827);return{'name':_0x4e20eb,'isJourneyLocal':!![],'definition':_0x4afd2b};}catch{return{'name':_0x37e804,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x282e83,_0x95d88e)=>resolveJumpTarget(_0x282e83,_0x95d88e,_0x1044ad,async _0x2b7da6=>{const _0x4d218f=a110_0x3a2b,_0x466d09=_0x2cf11c?.[_0x4d218f(0x172)](_0x2b7da6);if(_0x466d09)return _0x466d09;return _0x3c7c4d['journey']['getJourney'](_0x2b7da6);})};return _0x288104=_0xd928fe,_0xd928fe;},_0x233f54=async _0x20d9c3=>{const _0x18a5f8=a110_0x3a2b,{collectSegmentIdsFromJourneyApi:_0x5a5317}=await import(_0x18a5f8(0x233)),{batchAsync:_0x3f0faf}=await import(_0x18a5f8(0x174)),_0x1bf38e=new Set();for(const _0x1a81b3 of _0x20d9c3){let _0x428684=_0x2cf11c?.[_0x18a5f8(0x172)](_0x1a81b3);!_0x428684&&(_0x428684=await _0x3c7c4d[_0x18a5f8(0x1cf)]['getJourney'](_0x1a81b3));const _0x234710=_0x5a5317(_0x428684);for(const _0x310b33 of _0x234710){_0x1bf38e['add'](_0x310b33);}}let _0x288da8=Array[_0x18a5f8(0x1c1)](_0x1bf38e);while(_0x288da8[_0x18a5f8(0x1d9)]>0x0){const _0x5606dc=_0x288da8[_0x18a5f8(0x1d7)](_0x5b0cee=>!_0x402574[_0x18a5f8(0x1e2)](_0x5b0cee));if(_0x5606dc[_0x18a5f8(0x1d9)]===0x0)break;const _0x3879a7=await _0x3f0faf(_0x5606dc,async _0x332fa8=>{const _0x16e39c=_0x18a5f8;_0x402574['add'](_0x332fa8);let _0x575b4d=_0x230a33['find'](_0x47bc7a=>_0x47bc7a['id']===_0x332fa8);if(!_0x575b4d)try{_0x575b4d=await _0x3c7c4d[_0x16e39c(0x20e)]['getSegment'](_0x428e38,_0x332fa8);}catch{return null;}return{'segmentId':_0x332fa8,'segment':_0x575b4d};},0xa),_0x23c3b3=new Set();for(const _0x360b13 of _0x3879a7){if(!_0x360b13?.[_0x18a5f8(0x20e)]?.[_0x18a5f8(0x200)])continue;const _0x5a7690=apiRuleToYaml(_0x360b13[_0x18a5f8(0x20e)][_0x18a5f8(0x200)]);_0x373963['set'](_0x360b13[_0x18a5f8(0x184)],_0x5a7690);const _0x23f1c7=collectSegmentRefsFromRule(_0x5a7690);for(const _0x4ecc90 of _0x23f1c7){!_0x402574[_0x18a5f8(0x1e2)](_0x4ecc90)&&_0x23c3b3[_0x18a5f8(0x1d0)](_0x4ecc90);}}_0x288da8=Array[_0x18a5f8(0x1c1)](_0x23c3b3);}};return{'createYamlContext':_0x11f188,'prefetchJourneySegments':_0x233f54};}export async function executePushSegments(_0x1f7dd8,_0x2570d8,_0x405f95,_0x27f88b,_0x3cbf41){const _0x47cbf7=a110_0x3fa165,{segmentDefToCreateRequest:_0x31d92b,segmentDefToUpdateRequest:_0x5ab716}=await import(_0x47cbf7(0x244)),_0x57a6c5=_0x405f95[_0x47cbf7(0x1de)],_0x26a27b=0x5,_0x4c2dfc=async _0x3845d4=>{const _0x3f6c89=_0x47cbf7,_0x5210e7=_0x3845d4[_0x3f6c89(0x238)]?_0x57a6c5[_0x3f6c89(0x172)](_0x3845d4['folderPath']):undefined;let _0x925fd2;const _0x25507e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x3845d4[_0x3f6c89(0x1c7)]){_0x3cbf41[_0x3f6c89(0x222)]?.({'type':_0x3f6c89(0x1a4),'name':_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]});const _0x1db2ee=_0x31d92b(_0x3845d4[_0x3f6c89(0x16f)],_0x5210e7),_0xddd1b3=await _0x3cbf41['withProgress'](_0x3f6c89(0x190)+_0x3845d4['yamlConfig'][_0x3f6c89(0x17e)]+_0x3f6c89(0x1df),()=>_0x1f7dd8[_0x3f6c89(0x20e)][_0x3f6c89(0x21d)](_0x27f88b['parentId'],_0x1db2ee));_0x925fd2=_0xddd1b3[_0x3f6c89(0x1f5)]['id'],_0x25507e[_0x3f6c89(0x1ab)]={'name':_0x3845d4['yamlConfig'][_0x3f6c89(0x17e)],'id':_0x925fd2},_0x3cbf41['onProgress']?.({'type':'segment_created','name':_0x3845d4['yamlConfig']['name'],'segmentId':_0x925fd2}),_0x3cbf41[_0x3f6c89(0x1be)]?.('Created\x20segment\x20\x27'+_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]+'\x27'),_0x25507e[_0x3f6c89(0x232)]=0x1;}else{if(_0x3845d4[_0x3f6c89(0x221)]){_0x3cbf41['onProgress']?.({'type':'segment_updating','name':_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]});const _0x3c394c=_0x5ab716(_0x3845d4[_0x3f6c89(0x16f)]);_0x5210e7!==_0x3845d4[_0x3f6c89(0x1fd)]?.[_0x3f6c89(0x17b)]&&(_0x3c394c['segmentFolderId']=_0x5210e7?parseInt(_0x5210e7,0xa):undefined),await _0x3cbf41[_0x3f6c89(0x228)](_0x3f6c89(0x216)+_0x3845d4[_0x3f6c89(0x16f)]['name']+'\x27...',()=>_0x1f7dd8['segment'][_0x3f6c89(0x185)](_0x27f88b['parentId'],_0x3845d4[_0x3f6c89(0x1fd)]['id'],_0x3c394c)),_0x925fd2=_0x3845d4['existingSegment']['id'],_0x3cbf41[_0x3f6c89(0x222)]?.({'type':'segment_updated','name':_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)]}),_0x3cbf41['logSuccess']?.(_0x3f6c89(0x219)+_0x3845d4[_0x3f6c89(0x16f)]['name']+'\x27'),_0x25507e[_0x3f6c89(0x212)]=0x1;}else _0x925fd2=_0x3845d4[_0x3f6c89(0x1fd)]['id'];}}catch(_0x1ba00d){const _0x532053=isHttp400Error(_0x1ba00d),_0x45dfd4=_0x532053?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x3f6c89(0x227)],_0x416fcb=getErrorMessage(_0x1ba00d);throw new SDKError(_0x45dfd4,'Failed\x20to\x20'+(_0x3845d4[_0x3f6c89(0x1c7)]?'create':_0x3f6c89(0x198))+_0x3f6c89(0x1b1)+_0x3845d4[_0x3f6c89(0x1fb)]+'\x0a\x20\x20'+_0x416fcb,_0x1ba00d);}try{const _0x929318=await syncActivationsForSegment(_0x1f7dd8,_0x27f88b[_0x3f6c89(0x235)],_0x925fd2,_0x3845d4[_0x3f6c89(0x16f)][_0x3f6c89(0x17e)],_0x3845d4[_0x3f6c89(0x1fa)],_0x3cbf41,_0x3845d4['absolutePath']);_0x25507e[_0x3f6c89(0x19a)]=_0x929318;}catch(_0x5cf45d){if(_0x5cf45d instanceof SDKError)throw _0x5cf45d;throw new SDKError(ErrorCode[_0x3f6c89(0x18c)],_0x3f6c89(0x1f4)+_0x3845d4['yamlConfig'][_0x3f6c89(0x17e)]+_0x3f6c89(0x1bc)+_0x3845d4['absolutePath']+_0x3f6c89(0x16d)+getErrorMessage(_0x5cf45d),_0x5cf45d);}return _0x25507e;},_0x495f80=await batchAsync(_0x2570d8,_0x4c2dfc,_0x26a27b),_0x1e8ede={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3fb81e of _0x495f80){_0x1e8ede[_0x47cbf7(0x232)]+=_0x3fb81e[_0x47cbf7(0x232)],_0x1e8ede[_0x47cbf7(0x212)]+=_0x3fb81e[_0x47cbf7(0x212)],_0x3fb81e[_0x47cbf7(0x1ab)]&&_0x1e8ede[_0x47cbf7(0x22a)]['set'](_0x3fb81e[_0x47cbf7(0x1ab)]['name'],_0x3fb81e[_0x47cbf7(0x1ab)]['id']),_0x1e8ede[_0x47cbf7(0x19a)][_0x47cbf7(0x232)]+=_0x3fb81e[_0x47cbf7(0x19a)][_0x47cbf7(0x232)],_0x1e8ede[_0x47cbf7(0x19a)][_0x47cbf7(0x212)]+=_0x3fb81e[_0x47cbf7(0x19a)]['updated'],_0x1e8ede['activations'][_0x47cbf7(0x1a8)]+=_0x3fb81e[_0x47cbf7(0x19a)][_0x47cbf7(0x1a8)];}return _0x1e8ede;}async function syncActivationsForSegment(_0x3f5484,_0x1ed7e7,_0xb57d97,_0xd371b9,_0x55e3d5,_0x1ed410,_0x12744f){const _0x39d105=a110_0x3fa165,_0x2165fd={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xd6d3d4 of _0x55e3d5){try{if(_0xd6d3d4[_0x39d105(0x1e6)]===_0x39d105(0x1f7)&&_0xd6d3d4[_0x39d105(0x1d8)])_0x1ed410['onProgress']?.({'type':_0x39d105(0x1f9),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),await _0x1ed410[_0x39d105(0x228)](_0x39d105(0x1ea)+_0xd6d3d4[_0x39d105(0x17e)]+_0x39d105(0x1df),()=>_0x3f5484[_0x39d105(0x20e)][_0x39d105(0x18e)](_0x1ed7e7,_0xb57d97,_0xd6d3d4[_0x39d105(0x1d8)])),_0x1ed410[_0x39d105(0x222)]?.({'type':_0x39d105(0x196),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),_0x1ed410[_0x39d105(0x1be)]?.(_0x39d105(0x1ae)+_0xd6d3d4['name']+'\x27'),_0x2165fd[_0x39d105(0x232)]++;else{if(_0xd6d3d4['type']===_0x39d105(0x198)&&_0xd6d3d4[_0x39d105(0x1d8)]&&_0xd6d3d4[_0x39d105(0x183)])_0x1ed410[_0x39d105(0x222)]?.({'type':_0x39d105(0x1f0),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),await _0x1ed410[_0x39d105(0x228)]('Updating\x20activation\x20\x27'+_0xd6d3d4['name']+_0x39d105(0x1df),()=>_0x3f5484[_0x39d105(0x20e)]['updateActivation'](_0x1ed7e7,_0xb57d97,_0xd6d3d4[_0x39d105(0x183)]['id'],_0xd6d3d4[_0x39d105(0x1d8)])),_0x1ed410['onProgress']?.({'type':'activation_updated','segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),_0x1ed410['logSuccess']?.(_0x39d105(0x20c)+_0xd6d3d4[_0x39d105(0x17e)]+'\x27'),_0x2165fd[_0x39d105(0x212)]++;else _0xd6d3d4['type']===_0x39d105(0x20a)&&_0xd6d3d4[_0x39d105(0x183)]&&(_0x1ed410[_0x39d105(0x222)]?.({'type':_0x39d105(0x237),'segmentName':_0xd371b9,'activationName':_0xd6d3d4[_0x39d105(0x17e)]}),await _0x1ed410[_0x39d105(0x228)](_0x39d105(0x187)+_0xd6d3d4[_0x39d105(0x17e)]+'\x27...',()=>_0x3f5484[_0x39d105(0x20e)][_0x39d105(0x1b3)](_0x1ed7e7,_0xb57d97,_0xd6d3d4[_0x39d105(0x183)]['id'])),_0x1ed410['onProgress']?.({'type':_0x39d105(0x1ec),'segmentName':_0xd371b9,'activationName':_0xd6d3d4['name']}),_0x1ed410[_0x39d105(0x231)]?.('Deleted\x20activation\x20\x27'+_0xd6d3d4[_0x39d105(0x17e)]+'\x27'),_0x2165fd[_0x39d105(0x1a8)]++);}}catch(_0x2bb80e){const _0x23e1cd=isHttp400Error(_0x2bb80e),_0x217f39=_0x23e1cd?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4681d8=getErrorMessage(_0x2bb80e);throw new SDKError(_0x217f39,'Failed\x20to\x20'+_0xd6d3d4[_0x39d105(0x1e6)]+_0x39d105(0x23b)+_0xd6d3d4[_0x39d105(0x17e)]+_0x39d105(0x1bc)+_0x12744f+'\x0a\x20\x20'+_0x4681d8,_0x2bb80e);}}return _0x2165fd;}export async function executePushFolders(_0x5694bc,_0x72a629,_0x170216,_0x2c1c14,_0x3b6ab3){const _0x595d82=a110_0x3fa165,_0x46a668=new Map(_0x170216);for(const _0x383bf of _0x72a629){const _0x3f2c57=_0x383bf[_0x595d82(0x1eb)]('/'),_0x19151a=_0x3f2c57[_0x3f2c57[_0x595d82(0x1d9)]-0x1],_0x1cea78=_0x3f2c57[_0x595d82(0x1c5)](0x0,-0x1)['join']('/'),_0x3cb1b9=_0x46a668[_0x595d82(0x172)](_0x1cea78);_0x3b6ab3[_0x595d82(0x222)]?.({'type':_0x595d82(0x23c),'folder':_0x383bf});const _0x495a5f={'name':_0x19151a,'parentFolderId':_0x3cb1b9},_0xb19b5=await _0x3b6ab3[_0x595d82(0x228)](_0x595d82(0x19e)+_0x383bf+_0x595d82(0x1df),()=>_0x5694bc['segment'][_0x595d82(0x1b9)](_0x2c1c14[_0x595d82(0x235)],_0x495a5f));_0x46a668[_0x595d82(0x1ca)](_0x383bf,_0xb19b5[_0x595d82(0x1f5)]['id']),_0x3b6ab3[_0x595d82(0x222)]?.({'type':'folder_created','folder':_0x383bf,'folderId':_0xb19b5[_0x595d82(0x1f5)]['id']}),_0x3b6ab3[_0x595d82(0x1af)]?.(_0x595d82(0x1cb)+_0x383bf+'\x27');}return _0x46a668;}export async function executePushSegmentDeletions(_0x1dfa10,_0xf64d62,_0x11408d){const _0x21b31e=a110_0x3fa165;if(_0xf64d62[_0x21b31e(0x1d9)]===0x0)return 0x0;const {batchAsync:_0x34f54b}=await import(_0x21b31e(0x174)),_0x25ed04=0x5,_0x32634e=await _0x34f54b(_0xf64d62,async _0x4face1=>{const _0x501b47=_0x21b31e;return _0x11408d[_0x501b47(0x222)]?.({'type':'segment_deleting','name':_0x4face1[_0x501b47(0x17e)]}),await _0x1dfa10[_0x501b47(0x20e)][_0x501b47(0x1ff)](_0x4face1['id']),_0x11408d['onProgress']?.({'type':_0x501b47(0x19b),'name':_0x4face1[_0x501b47(0x17e)]}),_0x11408d[_0x501b47(0x231)]?.(_0x501b47(0x1c9)+_0x4face1['name']+'\x27'),0x1;},_0x25ed04);return _0x32634e[_0x21b31e(0x1bb)]((_0x18a73e,_0x559c38)=>_0x18a73e+_0x559c38,0x0);}export async function executePushJourneys(_0x1280ea,_0xf9bed3,_0x2628d7,_0x2ebd65,_0x3cb63d){const _0x50ccfd=a110_0x3fa165,{journeyDefToRequest:_0xa6beb}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x4bc9f9,yamlRuleToApi:_0x33de99,validateSegmentRule:_0x4d2ed9}=await import(_0x50ccfd(0x244)),_0x10c098={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2146dc=new Map(_0x2628d7['segmentNameToId']),_0x3207d1=0x5;for(let _0x3156ce=0x0;_0x3156ce<_0xf9bed3[_0x50ccfd(0x1d9)];_0x3156ce+=_0x3207d1){const _0x383082=_0xf9bed3[_0x50ccfd(0x1c5)](_0x3156ce,_0x3156ce+_0x3207d1),_0x4d18b6=await Promise[_0x50ccfd(0x1a0)](_0x383082[_0x50ccfd(0x1b8)](async _0x41980f=>{const _0x12abcf=_0x50ccfd;if(!_0x41980f[_0x12abcf(0x1c7)]&&!_0x41980f[_0x12abcf(0x221)])return{'action':_0x12abcf(0x1f3),'name':_0x41980f['yamlConfig'][_0x12abcf(0x17e)],'journeyId':_0x41980f['existingJourney']?.['id']};const _0x17f764=_0x41980f['folderPath']?_0x2628d7[_0x12abcf(0x1de)]['get'](_0x41980f['folderPath']):undefined;_0x3cb63d['onProgress']?.({'type':_0x41980f['isNew']?_0x12abcf(0x1cd):_0x12abcf(0x22e),'name':_0x41980f[_0x12abcf(0x16f)]['name']});try{const _0x2f8351=await executeSingleJourneyPush(_0x1280ea,_0x41980f,{..._0x2628d7,'segmentNameToId':_0x2146dc},{'parentId':_0x2ebd65['parentId'],'rootFolderId':_0x2ebd65[_0x12abcf(0x243)],'folderId':_0x17f764,'verbose':_0x2ebd65['verbose']},_0x3cb63d,{'journeyDefToRequest':_0xa6beb,'activationDefToCreateRequest':_0x4bc9f9,'yamlRuleToApi':_0x33de99,'validateSegmentRule':_0x4d2ed9});for(const [_0x369986,_0x2cd06d]of _0x2f8351[_0x12abcf(0x1f1)]){_0x2146dc[_0x12abcf(0x1ca)](_0x369986,_0x2cd06d),_0x10c098['embeddedSegmentNameToId']['set'](_0x369986,_0x2cd06d);}if(_0x2f8351[_0x12abcf(0x1dc)]===_0x12abcf(0x232))_0x3cb63d['onProgress']?.({'type':_0x12abcf(0x225),'name':_0x41980f[_0x12abcf(0x16f)]['name'],'journeyId':_0x2f8351[_0x12abcf(0x1bf)]}),_0x3cb63d[_0x12abcf(0x1be)]?.(_0x12abcf(0x1b6)+_0x41980f[_0x12abcf(0x16f)]['name']+'\x27'),_0x10c098[_0x12abcf(0x232)]++;else _0x2f8351[_0x12abcf(0x1dc)]===_0x12abcf(0x212)&&(_0x3cb63d[_0x12abcf(0x222)]?.({'type':'journey_updated','name':_0x41980f[_0x12abcf(0x16f)][_0x12abcf(0x17e)]}),_0x3cb63d['logSuccess']?.(_0x12abcf(0x1aa)+_0x41980f[_0x12abcf(0x16f)]['name']+'\x27'),_0x10c098[_0x12abcf(0x212)]++);return{'action':_0x2f8351[_0x12abcf(0x1dc)],'name':_0x41980f[_0x12abcf(0x16f)][_0x12abcf(0x17e)],'journeyId':_0x2f8351[_0x12abcf(0x1bf)]};}catch(_0x4b389d){const _0x47dde6=isHttp400Error(_0x4b389d),_0x5a3cf3=_0x47dde6?ErrorCode[_0x12abcf(0x208)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x201f53=getErrorMessage(_0x4b389d);throw new SDKError(_0x5a3cf3,_0x12abcf(0x1ac)+(_0x41980f[_0x12abcf(0x1c7)]?'create':'update')+_0x12abcf(0x1d3)+_0x41980f[_0x12abcf(0x1fb)]+_0x12abcf(0x16d)+_0x201f53,_0x4b389d);}}));_0x10c098[_0x50ccfd(0x186)][_0x50ccfd(0x1d4)](..._0x4d18b6);}return _0x10c098;}async function executeSingleJourneyPush(_0x330a6f,_0x2ca680,_0x56d236,_0x24fd2d,_0x1b30b7,_0x21269c){const _0x2a807d=a110_0x3fa165,{journeyDefToRequest:_0x16d8b4,activationDefToCreateRequest:_0x17b68b,yamlRuleToApi:_0x43ba0c,validateSegmentRule:_0x3c98ad}=_0x21269c,_0x4a31a6=new Map(),_0x4866c8=new Map(),_0x37bb1e=new Map(),_0x46ba64=new Map(),_0x3cb54c=new Map();let _0x1a6a6d;const _0x4aa67f=async()=>{const _0x5ed2cc=a110_0x3a2b;if(_0x1a6a6d)return;_0x1a6a6d=new Map();if(!_0x2ca680[_0x5ed2cc(0x1ce)])return;const _0x421ad5=await _0x330a6f['journey'][_0x5ed2cc(0x1f6)](_0x2ca680['existingJourney']['id']);for(const _0x5df310 of _0x421ad5){const _0x274919=journeyActivationStepToYaml(_0x5df310,_0x56d236['idToEmailMap'],_0x56d236['connectionIdToNameMap']),_0x265e54=activationSignature(_0x274919);!_0x1a6a6d[_0x5ed2cc(0x1e2)](_0x265e54)&&_0x1a6a6d[_0x5ed2cc(0x1ca)](_0x265e54,_0x5df310['id']),_0x274919[_0x5ed2cc(0x17e)]&&_0x4866c8[_0x5ed2cc(0x1ca)](_0x274919[_0x5ed2cc(0x17e)],_0x5df310['id']);}};if(_0x2ca680[_0x2a807d(0x1ce)]&&_0x2ca680[_0x2a807d(0x16f)][_0x2a807d(0x18f)]){const _0x1c9511=buildLocalExpandedRuleMappings(_0x2ca680[_0x2a807d(0x16f)]),_0x5e5893=_0x1c9511[_0x2a807d(0x1ed)];if(_0x5e5893[_0x2a807d(0x1a5)]>0x0){const _0x43b14e=new Map();for(const [_0x2910e7,_0x18b837]of _0x5e5893){const _0x4122e3=serializeExpandedRule(_0x18b837,_0x5e5893);_0x43b14e['set'](_0x2910e7,_0x4122e3);}const _0x2aed0c=collectSegmentIdsFromJourneyApi(_0x2ca680['existingJourney']);if(_0x2aed0c[_0x2a807d(0x1a5)]>0x0){const _0x56aefc=await buildServerSegmentRuleMap(_0x330a6f,_0x24fd2d[_0x2a807d(0x235)],_0x56d236[_0x2a807d(0x180)],_0x2aed0c);if(_0x56aefc[_0x2a807d(0x1a5)]>0x0){const _0x285f9c=new Map();for(const [_0x5cfeae,_0x2814a6]of _0x56aefc){const _0x3b48b6=serializeExpandedRule(_0x2814a6,_0x56aefc);!_0x285f9c[_0x2a807d(0x1e2)](_0x3b48b6)&&_0x285f9c[_0x2a807d(0x1ca)](_0x3b48b6,_0x5cfeae);}for(const [_0x2e2046,_0x1bbf7b]of _0x43b14e){const _0x35a093=_0x285f9c[_0x2a807d(0x172)](_0x1bbf7b);_0x35a093&&(_0x3cb54c[_0x2a807d(0x1ca)](_0x2e2046,_0x35a093),_0x56d236['segmentNameToId']['set'](_0x2e2046,_0x35a093));}}}}}const _0x201f9={'resolveSegmentId':async _0x36a3fb=>{const _0x5e2972=_0x2a807d,_0x5a764f=_0x56d236[_0x5e2972(0x206)][_0x5e2972(0x172)](_0x36a3fb);if(!_0x5a764f)throw new SDKError(ErrorCode[_0x5e2972(0x1c8)],'Segment\x20not\x20found:\x20'+_0x36a3fb+_0x5e2972(0x1a7)+_0x2ca680[_0x5e2972(0x16f)]['name']+')');return _0x5a764f;},'resolveEmbeddedSegmentId':async(_0x2c2ee0,_0x3ac191)=>{const _0x402532=_0x2a807d,_0x571e4b=_0x56d236[_0x402532(0x206)][_0x402532(0x172)](_0x2c2ee0);if(_0x571e4b)return _0x571e4b;const _0x26312d=_0x3cb54c[_0x402532(0x172)](_0x2c2ee0);if(_0x26312d)return _0x56d236[_0x402532(0x206)][_0x402532(0x1ca)](_0x2c2ee0,_0x26312d),_0x26312d;const _0x13f032=_0x56d236['existingSegments'][_0x402532(0x181)](_0x20562a=>_0x20562a[_0x402532(0x17e)]===_0x2c2ee0);if(_0x13f032)return _0x56d236['segmentNameToId'][_0x402532(0x1ca)](_0x2c2ee0,_0x13f032['id']),_0x13f032['id'];if(_0x2ca680[_0x402532(0x1c7)]){const {stageName:_0x4fb2ee,criteriaName:_0x1c4083}=findSegmentCriteriaLocation(_0x2ca680['yamlConfig'],_0x2c2ee0);return _0x3c98ad(_0x2c2ee0,_0x3ac191[_0x402532(0x200)]),_0x37bb1e['set'](_0x2c2ee0,{'definition':_0x3ac191,'stageName':_0x4fb2ee,'criteriaName':_0x1c4083}),createPendingSegmentId(_0x2c2ee0);}const _0x451855=_0x2ca680[_0x402532(0x1ce)]?.['id'];if(!_0x451855)throw new SDKError(ErrorCode[_0x402532(0x1b2)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x3c98ad(_0x2c2ee0,_0x3ac191[_0x402532(0x200)]);const _0x10b9e4=generateDeterministicJourneySegmentName(_0x2ca680[_0x402532(0x16f)][_0x402532(0x17e)],_0x2c2ee0),_0x20f949=_0x56d236[_0x402532(0x180)][_0x402532(0x181)](_0x3fe51f=>_0x3fe51f[_0x402532(0x17e)]===_0x10b9e4),_0x16ff63=createSegmentIdResolver(_0x56d236[_0x402532(0x206)],_0x2c2ee0),_0x424008=await resolveRuleSegmentIds(_0x3ac191[_0x402532(0x200)],_0x16ff63);let _0x5539d7;if(_0x20f949)await _0x330a6f['segment'][_0x402532(0x185)](_0x24fd2d['parentId'],_0x20f949['id'],{'description':_0x3ac191[_0x402532(0x19d)]||_0x402532(0x213)+_0x2c2ee0,'rule':_0x43ba0c(_0x424008,!![]),'countPopulation':!![]}),_0x5539d7=_0x20f949['id'];else try{_0x5539d7=await _0x330a6f['segment'][_0x402532(0x182)]({'name':_0x10b9e4,'description':_0x3ac191['description']||_0x402532(0x213)+_0x2c2ee0,'journeyId':_0x451855,'rule':_0x43ba0c(_0x424008,!![]),'countPopulation':!![],'parentFolderId':_0x24fd2d['rootFolderId']||'','audienceId':_0x24fd2d[_0x402532(0x235)]});}catch(_0x5eecb8){const _0x509085=_0x5eecb8 instanceof Error&&_0x5eecb8[_0x402532(0x178)][_0x402532(0x21b)]('Name\x20has\x20already\x20been\x20taken');if(_0x509085){const _0x3e2987=await _0x330a6f[_0x402532(0x20e)][_0x402532(0x223)](_0x24fd2d[_0x402532(0x235)]),_0x29fa17=_0x3e2987['find'](_0x5672c8=>_0x5672c8[_0x402532(0x17e)]===_0x10b9e4);if(_0x29fa17)await _0x330a6f[_0x402532(0x20e)][_0x402532(0x185)](_0x24fd2d[_0x402532(0x235)],_0x29fa17['id'],{'description':_0x3ac191['description']||'Entry\x20criteria:\x20'+_0x2c2ee0,'rule':_0x43ba0c(_0x424008,!![]),'countPopulation':!![]}),_0x5539d7=_0x29fa17['id'];else throw _0x5eecb8;}else throw _0x5eecb8;}return _0x56d236[_0x402532(0x206)]['set'](_0x2c2ee0,_0x5539d7),_0x4a31a6['set'](_0x2c2ee0,_0x5539d7),_0x5539d7;},'resolveActivationId':async _0x51b3ce=>{const _0x1ec051=_0x2a807d,_0x4c53b4=_0x4866c8[_0x1ec051(0x172)](_0x51b3ce);if(_0x4c53b4)return _0x4c53b4;if(_0x2ca680['existingJourney']){await _0x4aa67f();const _0xcb6a26=_0x4866c8[_0x1ec051(0x172)](_0x51b3ce);if(_0xcb6a26)return _0xcb6a26;}throw new SDKError(ErrorCode[_0x1ec051(0x204)],_0x1ec051(0x1e9)+_0x51b3ce+_0x1ec051(0x1a7)+_0x2ca680[_0x1ec051(0x16f)][_0x1ec051(0x17e)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x394427,_0x18e936)=>{const _0x22ce38=_0x2a807d,_0x1f776c=_0x4866c8[_0x22ce38(0x172)](_0x394427);if(_0x1f776c)return _0x1f776c;if(_0x2ca680['isNew'])return _0x46ba64['set'](_0x394427,_0x18e936),createPendingActivationId(_0x394427);if(_0x2ca680[_0x22ce38(0x1ce)]){await _0x4aa67f();const _0x5665d3=_0x4866c8[_0x22ce38(0x172)](_0x18e936[_0x22ce38(0x17e)]);if(_0x5665d3)return _0x4866c8[_0x22ce38(0x1ca)](_0x394427,_0x5665d3),_0x5665d3;const _0x542bac=activationSignature(_0x18e936),_0x333c43=_0x1a6a6d?.[_0x22ce38(0x172)](_0x542bac);if(_0x333c43)return _0x4866c8[_0x22ce38(0x1ca)](_0x394427,_0x333c43),_0x333c43;const _0xe86961=await _0x17b68b(_0x18e936,_0x56d236[_0x22ce38(0x1ef)]),_0x44fc3b=await _0x330a6f[_0x22ce38(0x1cf)][_0x22ce38(0x18e)](_0x2ca680[_0x22ce38(0x1ce)]['id'],_0xe86961);return _0x4866c8[_0x22ce38(0x1ca)](_0x394427,_0x44fc3b['id']),_0x44fc3b['id'];}throw new SDKError(ErrorCode[_0x22ce38(0x1b2)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x2d2254=>{const _0x44aeec=_0x2a807d;try{return await _0x330a6f[_0x44aeec(0x1cf)][_0x44aeec(0x19f)](_0x24fd2d['parentId'],_0x2d2254);}catch(_0x541e4){throw new SDKError(ErrorCode[_0x44aeec(0x204)],_0x44aeec(0x234)+_0x2d2254+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x2ca680['yamlConfig']['name']+'\x27)',_0x541e4);}},'resolveStageId':async(_0x29d45b,_0x450a1d)=>{const _0x4e0c25=_0x2a807d,_0x1effdb=await _0x330a6f['journey'][_0x4e0c25(0x177)](_0x29d45b),_0x225964=_0x1effdb[_0x4e0c25(0x217)][_0x4e0c25(0x236)][_0x4e0c25(0x181)](_0x30dab2=>_0x30dab2[_0x4e0c25(0x17e)][_0x4e0c25(0x249)]()===_0x450a1d[_0x4e0c25(0x249)]());if(!_0x225964?.['id'])throw new SDKError(ErrorCode[_0x4e0c25(0x204)],'Stage\x20\x27'+_0x450a1d+_0x4e0c25(0x23f)+(_0x1effdb[_0x4e0c25(0x217)][_0x4e0c25(0x1d1)]||_0x1effdb[_0x4e0c25(0x217)][_0x4e0c25(0x17e)])+'\x27');return _0x225964['id'];}},_0x4d46bd=await _0x16d8b4(_0x2ca680[_0x2a807d(0x16f)],_0x24fd2d['parentId'],_0x201f9),_0x8fc24=_0x24fd2d['folderId']||_0x24fd2d[_0x2a807d(0x243)];_0x8fc24&&(_0x4d46bd[_0x2a807d(0x20b)]={'parentFolder':{'data':{'id':_0x8fc24,'type':_0x2a807d(0x170)}}});if(_0x2ca680[_0x2a807d(0x1c7)]){if(_0x37bb1e[_0x2a807d(0x1a5)]>0x0||_0x46ba64[_0x2a807d(0x1a5)]>0x0)return await executeThreeStepJourneyCreate(_0x330a6f,_0x2ca680,_0x4d46bd,{'pendingEmbeddedSegments':_0x37bb1e,'pendingEmbeddedActivations':_0x46ba64,'embeddedSegmentNameToId':_0x4a31a6,'journeyActivationNameToId':_0x4866c8},{..._0x24fd2d,'effectiveFolderId':_0x8fc24},_0x56d236,_0x1b30b7,_0x21269c);else{ensureJourneyDefaults(_0x4d46bd[_0x2a807d(0x217)]);const _0x5e373e=await _0x330a6f[_0x2a807d(0x1cf)][_0x2a807d(0x1f7)](_0x4d46bd);return{'action':_0x2a807d(0x232),'journeyId':_0x5e373e['id'],'embeddedSegmentNameToId':_0x4a31a6};}}else{if(_0x2ca680[_0x2a807d(0x221)]&&_0x2ca680[_0x2a807d(0x1ce)])return ensureJourneyDefaults(_0x4d46bd['attributes']),await _0x330a6f[_0x2a807d(0x1cf)][_0x2a807d(0x198)](_0x2ca680[_0x2a807d(0x1ce)]['id'],_0x4d46bd),{'action':'updated','journeyId':_0x2ca680[_0x2a807d(0x1ce)]['id'],'embeddedSegmentNameToId':_0x4a31a6};}return{'action':_0x2a807d(0x1f3),'journeyId':_0x2ca680[_0x2a807d(0x1ce)]?.['id'],'embeddedSegmentNameToId':_0x4a31a6};}function findSegmentCriteriaLocation(_0x50bd3f,_0x1e368f){const _0x5efaab=a110_0x3fa165,_0x4fbc7c=_0x50bd3f[_0x5efaab(0x1e5)]||_0x50bd3f[_0x5efaab(0x1fc)]?.[0x0]?.[_0x5efaab(0x1e5)]||[];let _0x1ca337=_0x5efaab(0x246),_0x1a3827=_0x1e368f;const _0x214591=_0x50bd3f[_0x5efaab(0x1c2)]||_0x50bd3f['journeys']?.[0x0]?.['goal'];if(_0x214591?.[_0x5efaab(0x20e)]===_0x1e368f)return{'stageName':_0x5efaab(0x1c2),'criteriaName':_0x214591[_0x5efaab(0x17e)]||_0x1e368f};_0x1eaedb:for(const _0x1eb441 of _0x4fbc7c){if(_0x1eb441['entry_criteria']?.[_0x5efaab(0x20e)]===_0x1e368f){_0x1ca337=_0x1eb441[_0x5efaab(0x17e)],_0x1a3827=_0x1eb441[_0x5efaab(0x22d)][_0x5efaab(0x17e)]||_0x1e368f;break;}if(_0x1eb441[_0x5efaab(0x23a)])for(const _0xbbfce8 of _0x1eb441[_0x5efaab(0x23a)]){if(_0xbbfce8[_0x5efaab(0x1e6)]===_0x5efaab(0x1a9)&&_0xbbfce8[_0x5efaab(0x1e1)]?.['branches'])for(const _0x3bb077 of _0xbbfce8[_0x5efaab(0x1e1)][_0x5efaab(0x191)]){if(_0x3bb077['segment']===_0x1e368f){_0x1ca337=_0x1eb441['name'],_0x1a3827=_0x3bb077[_0x5efaab(0x17e)]||_0x1e368f;break _0x1eaedb;}}}}return{'stageName':_0x1ca337,'criteriaName':_0x1a3827};}async function executeThreeStepJourneyCreate(_0x8f4962,_0x2a90b2,_0x4f82bc,_0x48074c,_0x574016,_0x3cdb91,_0x34122e,_0x12da38){const _0x189fe9=a110_0x3fa165,{activationDefToCreateRequest:_0x266964,yamlRuleToApi:_0x390e59}=_0x12da38,{pendingEmbeddedSegments:_0x4b3166,pendingEmbeddedActivations:_0x139e6c,embeddedSegmentNameToId:_0x39d02b}=_0x48074c,_0x8b6b9d=JSON[_0x189fe9(0x1c0)](JSON[_0x189fe9(0x1e0)](_0x4f82bc));ensureJourneyDefaults(_0x8b6b9d[_0x189fe9(0x217)]),stripPendingIds(_0x8b6b9d);const _0x3d77c9=await _0x8f4962[_0x189fe9(0x1cf)][_0x189fe9(0x1f7)](_0x8b6b9d),_0x5ae603=_0x3d77c9['id'],_0x1ac710=new Map();for(const _0x268b54 of _0x3d77c9[_0x189fe9(0x217)][_0x189fe9(0x236)]){_0x1ac710[_0x189fe9(0x1ca)](_0x268b54[_0x189fe9(0x17e)][_0x189fe9(0x249)](),_0x268b54['id']);}for(const [_0x232d78,{definition:_0xe26001}]of _0x4b3166){const _0x1da1bb=generateDeterministicJourneySegmentName(_0x2a90b2['yamlConfig'][_0x189fe9(0x17e)],_0x232d78);_0x34122e[_0x189fe9(0x222)]?.({'type':'embedded_segment_creating','journeyName':_0x2a90b2[_0x189fe9(0x16f)][_0x189fe9(0x17e)],'segmentName':_0x232d78});const _0x169897=createSegmentIdResolver(_0x3cdb91[_0x189fe9(0x206)],_0x232d78),_0x5f1e66=await resolveRuleSegmentIds(_0xe26001['rule'],_0x169897),_0x38d51a=await _0x8f4962[_0x189fe9(0x20e)][_0x189fe9(0x182)]({'name':_0x1da1bb,'description':_0xe26001[_0x189fe9(0x19d)]||'Entry\x20criteria:\x20'+_0x232d78,'journeyId':_0x5ae603,'rule':_0x390e59(_0x5f1e66,!![]),'countPopulation':!![],'parentFolderId':_0x574016[_0x189fe9(0x193)]||'','audienceId':_0x574016[_0x189fe9(0x235)]});_0x39d02b[_0x189fe9(0x1ca)](_0x232d78,_0x38d51a),_0x3cdb91[_0x189fe9(0x206)][_0x189fe9(0x1ca)](_0x232d78,_0x38d51a),_0x34122e['onProgress']?.({'type':_0x189fe9(0x1cc),'journeyName':_0x2a90b2[_0x189fe9(0x16f)][_0x189fe9(0x17e)],'segmentName':_0x232d78});}const _0x1309d1=new Map();for(const [_0x274e13,_0x4d4a37]of _0x139e6c){_0x34122e[_0x189fe9(0x222)]?.({'type':_0x189fe9(0x171),'journeyName':_0x2a90b2[_0x189fe9(0x16f)]['name'],'activationName':_0x274e13});const _0x449ea0=await _0x266964(_0x4d4a37,_0x3cdb91[_0x189fe9(0x1ef)]),_0x20c3c0=await _0x8f4962[_0x189fe9(0x1cf)][_0x189fe9(0x18e)](_0x5ae603,_0x449ea0);_0x1309d1['set'](_0x274e13,_0x20c3c0['id']),_0x48074c[_0x189fe9(0x242)]['set'](_0x274e13,_0x20c3c0['id']),_0x34122e['onProgress']?.({'type':_0x189fe9(0x1ee),'journeyName':_0x2a90b2[_0x189fe9(0x16f)][_0x189fe9(0x17e)],'activationName':_0x274e13});}const _0x2bff07=JSON[_0x189fe9(0x1c0)](JSON[_0x189fe9(0x1e0)](_0x4f82bc));return _0x2bff07['id']=_0x5ae603,ensureJourneyDefaults(_0x2bff07[_0x189fe9(0x217)]),resolvePendingIdsInRequest(_0x2bff07,_0x4f82bc,_0x1ac710,_0x39d02b,_0x1309d1,_0x34122e),await _0x8f4962[_0x189fe9(0x1cf)][_0x189fe9(0x198)](_0x5ae603,_0x2bff07),{'action':_0x189fe9(0x232),'journeyId':_0x5ae603,'embeddedSegmentNameToId':_0x39d02b};}function stripPendingIds(_0x9d547f){const _0x45cee6=a110_0x3fa165;for(const _0x29addf of _0x9d547f['attributes'][_0x45cee6(0x236)]||[]){_0x29addf[_0x45cee6(0x173)]?.['segmentId']&&isPendingSegmentId(_0x29addf[_0x45cee6(0x173)]['segmentId'])&&delete _0x29addf[_0x45cee6(0x173)];if(_0x29addf[_0x45cee6(0x23a)])for(const _0x591e47 of Object[_0x45cee6(0x1a3)](_0x29addf[_0x45cee6(0x23a)])){const _0x463ee0=_0x29addf[_0x45cee6(0x23a)][_0x591e47];_0x463ee0['type']===_0x45cee6(0x1a1)&&_0x463ee0[_0x45cee6(0x1d5)]&&isPendingActivationId(_0x463ee0[_0x45cee6(0x1d5)])&&(_0x463ee0[_0x45cee6(0x1d5)]='');if(_0x463ee0['type']===_0x45cee6(0x21a)&&_0x463ee0[_0x45cee6(0x191)])for(const _0x933cd2 of _0x463ee0[_0x45cee6(0x191)]){_0x933cd2[_0x45cee6(0x184)]&&isPendingSegmentId(_0x933cd2[_0x45cee6(0x184)])&&(_0x933cd2['segmentId']='');}_0x463ee0[_0x45cee6(0x1e6)]===_0x45cee6(0x179)&&_0x463ee0[_0x45cee6(0x1f2)]?.[_0x45cee6(0x184)]&&isPendingSegmentId(_0x463ee0[_0x45cee6(0x1f2)][_0x45cee6(0x184)])&&(_0x463ee0['waitCondition']['segmentId']='');}}}function resolvePendingIdsInRequest(_0x5e9f68,_0x486722,_0x2789e7,_0x34221a,_0xe53240,_0x1f45db){const _0x38fc7c=a110_0x3fa165,_0x5c6529=(_0x4b08d1,_0x5ac08b)=>{const _0x3754e3=a110_0x3a2b;if(!isPendingSegmentId(_0x4b08d1))return _0x4b08d1;const _0x57c8ac=extractPendingSegmentName(_0x4b08d1),_0x3d069e=_0x34221a[_0x3754e3(0x172)](_0x57c8ac);return!_0x3d069e&&_0x1f45db['logWarning']?.(_0x3754e3(0x1b4)+_0x57c8ac+_0x3754e3(0x1db)+_0x5ac08b),_0x3d069e;};if(_0x5e9f68[_0x38fc7c(0x217)][_0x38fc7c(0x1c2)]?.['segmentId']&&isPendingSegmentId(_0x5e9f68[_0x38fc7c(0x217)][_0x38fc7c(0x1c2)][_0x38fc7c(0x184)])){const _0x90571e=_0x5c6529(_0x5e9f68['attributes'][_0x38fc7c(0x1c2)][_0x38fc7c(0x184)],'goal\x20criteria');_0x90571e&&(_0x5e9f68[_0x38fc7c(0x217)][_0x38fc7c(0x1c2)][_0x38fc7c(0x184)]=_0x90571e);}for(const _0x4a0401 of _0x5e9f68['attributes']['journeyStages']||[]){const _0x37a625=_0x2789e7[_0x38fc7c(0x172)](_0x4a0401[_0x38fc7c(0x17e)][_0x38fc7c(0x249)]());_0x37a625&&(_0x4a0401['id']=_0x37a625);if(_0x4a0401[_0x38fc7c(0x173)]?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x4a0401[_0x38fc7c(0x173)]['segmentId'])){const _0x4b89ed=_0x5c6529(_0x4a0401[_0x38fc7c(0x173)][_0x38fc7c(0x184)],_0x38fc7c(0x201)+_0x4a0401[_0x38fc7c(0x17e)]+_0x38fc7c(0x210));_0x4b89ed&&(_0x4a0401[_0x38fc7c(0x173)]['segmentId']=_0x4b89ed);}if(_0x4a0401[_0x38fc7c(0x22b)])for(const _0x2d4e05 of _0x4a0401[_0x38fc7c(0x22b)]){if(_0x2d4e05[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x2d4e05[_0x38fc7c(0x184)])){const _0x5921a1=_0x5c6529(_0x2d4e05['segmentId'],_0x38fc7c(0x201)+_0x4a0401[_0x38fc7c(0x17e)]+_0x38fc7c(0x203));_0x5921a1&&(_0x2d4e05[_0x38fc7c(0x184)]=_0x5921a1);}}if(_0x4a0401[_0x38fc7c(0x229)]?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x4a0401['milestone'][_0x38fc7c(0x184)])){const _0x5ee517=_0x5c6529(_0x4a0401[_0x38fc7c(0x229)]['segmentId'],_0x38fc7c(0x201)+_0x4a0401[_0x38fc7c(0x17e)]+_0x38fc7c(0x21e));_0x5ee517&&(_0x4a0401[_0x38fc7c(0x229)][_0x38fc7c(0x184)]=_0x5ee517);}if(_0x4a0401[_0x38fc7c(0x23a)]){const _0x2c99ff=_0x270d93=>_0x486722[_0x38fc7c(0x217)]['journeyStages'][_0x38fc7c(0x181)](_0x51434a=>_0x51434a[_0x38fc7c(0x17e)][_0x38fc7c(0x249)]()===_0x4a0401[_0x38fc7c(0x17e)][_0x38fc7c(0x249)]())?.[_0x38fc7c(0x23a)]?.[_0x270d93];for(const _0x5d5951 of Object[_0x38fc7c(0x1a3)](_0x4a0401[_0x38fc7c(0x23a)])){const _0x2013dd=_0x4a0401[_0x38fc7c(0x23a)][_0x5d5951],_0x1a5788=_0x2c99ff(_0x5d5951);if(_0x2013dd['type']===_0x38fc7c(0x1a1)&&_0x2013dd[_0x38fc7c(0x1d5)]&&(isPendingActivationId(_0x2013dd[_0x38fc7c(0x1d5)])||_0x2013dd[_0x38fc7c(0x1d5)]==='')){if(_0x1a5788?.[_0x38fc7c(0x1d5)]&&isPendingActivationId(_0x1a5788[_0x38fc7c(0x1d5)])){const _0x2b31c8=extractPendingActivationName(_0x1a5788['journeyActivationStepId']),_0x1af44f=_0xe53240['get'](_0x2b31c8);_0x1af44f&&(_0x2013dd[_0x38fc7c(0x1d5)]=_0x1af44f);}}if(_0x2013dd[_0x38fc7c(0x1e6)]===_0x38fc7c(0x21a)&&_0x2013dd['branches']&&_0x1a5788?.[_0x38fc7c(0x191)])for(let _0x54705e=0x0;_0x54705e<_0x2013dd[_0x38fc7c(0x191)][_0x38fc7c(0x1d9)];_0x54705e++){const _0x10e923=_0x2013dd[_0x38fc7c(0x191)][_0x54705e],_0x4c6660=_0x1a5788[_0x38fc7c(0x191)][_0x54705e];if(_0x4c6660?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x4c6660[_0x38fc7c(0x184)])){const _0x2ab5fb=_0x5c6529(_0x4c6660[_0x38fc7c(0x184)],'stage\x20\x27'+_0x4a0401[_0x38fc7c(0x17e)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x10e923[_0x38fc7c(0x17e)]||_0x54705e)+'\x27');_0x2ab5fb&&(_0x10e923[_0x38fc7c(0x184)]=_0x2ab5fb);}}if(_0x2013dd['type']===_0x38fc7c(0x179)&&_0x2013dd['waitCondition']?.[_0x38fc7c(0x184)]&&_0x1a5788?.['waitCondition']?.[_0x38fc7c(0x184)]&&isPendingSegmentId(_0x1a5788['waitCondition'][_0x38fc7c(0x184)])){const _0x1dbba2=_0x5c6529(_0x1a5788[_0x38fc7c(0x1f2)]['segmentId'],_0x38fc7c(0x201)+_0x4a0401['name']+_0x38fc7c(0x199));_0x1dbba2&&(_0x2013dd[_0x38fc7c(0x1f2)][_0x38fc7c(0x184)]=_0x1dbba2);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x160273,_0x2eb1c6){const _0x4b5432=a111_0x30d2,_0x9ca892=_0x160273();while(!![]){try{const _0x56494a=-parseInt(_0x4b5432(0x98))/0x1+-parseInt(_0x4b5432(0x8c))/0x2+-parseInt(_0x4b5432(0x92))/0x3*(-parseInt(_0x4b5432(0x96))/0x4)+parseInt(_0x4b5432(0x91))/0x5+-parseInt(_0x4b5432(0x94))/0x6+parseInt(_0x4b5432(0x8d))/0x7*(-parseInt(_0x4b5432(0x90))/0x8)+parseInt(_0x4b5432(0x8a))/0x9;if(_0x56494a===_0x2eb1c6)break;else _0x9ca892['push'](_0x9ca892['shift']());}catch(_0x95f4a6){_0x9ca892['push'](_0x9ca892['shift']());}}}(a111_0x4c43,0x1ddfe));export function buildFolderIdToPathMap(_0x3d2027){const _0x4d7abc=a111_0x30d2,_0x5d1de8=new Map(),_0x387324=new Map();for(const _0x42edcc of _0x3d2027){_0x387324[_0x4d7abc(0x8f)](_0x42edcc['id'],_0x42edcc);}const _0x558514=new Set();for(const _0x285e7a of _0x3d2027){!_0x285e7a[_0x4d7abc(0x95)]&&_0x558514[_0x4d7abc(0x93)](_0x285e7a['id']);}function _0x55706e(_0x16906c){const _0x3e7fb1=_0x4d7abc;if(_0x5d1de8[_0x3e7fb1(0x8e)](_0x16906c['id']))return _0x5d1de8[_0x3e7fb1(0x97)](_0x16906c['id']);if(_0x558514[_0x3e7fb1(0x8e)](_0x16906c['id']))return _0x5d1de8['set'](_0x16906c['id'],''),'';if(_0x16906c[_0x3e7fb1(0x95)]){const _0x2c46e6=_0x387324['get'](_0x16906c[_0x3e7fb1(0x95)]);if(_0x2c46e6){const _0x13aa64=_0x55706e(_0x2c46e6),_0x5cb2b6=_0x13aa64?_0x13aa64+'/'+_0x16906c[_0x3e7fb1(0x8b)]:_0x16906c[_0x3e7fb1(0x8b)];return _0x5d1de8[_0x3e7fb1(0x8f)](_0x16906c['id'],_0x5cb2b6),_0x5cb2b6;}}const _0x3359e3=_0x16906c[_0x3e7fb1(0x8b)];return _0x5d1de8[_0x3e7fb1(0x8f)](_0x16906c['id'],_0x3359e3),_0x3359e3;}for(const _0x2d53b8 of _0x3d2027){_0x55706e(_0x2d53b8);}return _0x5d1de8;}export function buildFolderPathToIdMap(_0x1af8e4){const _0x291268=a111_0x30d2,_0x4d0db3=new Map(),_0x3b3296=new Map();for(const _0x37d984 of _0x1af8e4){_0x3b3296['set'](_0x37d984['id'],_0x37d984);}const _0x28d06e=new Set();for(const _0x235268 of _0x1af8e4){!_0x235268['parentFolderId']&&_0x28d06e[_0x291268(0x93)](_0x235268['id']);}function _0x3c5014(_0x3781c4){const _0x56eb65=_0x291268;if(_0x28d06e[_0x56eb65(0x8e)](_0x3781c4['id']))return'';if(_0x3781c4[_0x56eb65(0x95)]){const _0x1bfb66=_0x3b3296[_0x56eb65(0x97)](_0x3781c4[_0x56eb65(0x95)]);if(_0x1bfb66){const _0x28d0ec=_0x3c5014(_0x1bfb66);return _0x28d0ec?_0x28d0ec+'/'+_0x3781c4['name']:_0x3781c4['name'];}}return _0x3781c4[_0x56eb65(0x8b)];}for(const _0x5468d7 of _0x1af8e4){const _0x10c511=_0x3c5014(_0x5468d7);_0x4d0db3['set'](_0x10c511,_0x5468d7['id']);}return _0x4d0db3;}function a111_0x4c43(){const _0x70ef3a=['286710nYwJVf','15DcGjWu','add','1153542ZJlsvK','parentFolderId','99272TSpIKq','get','8202LGomTN','3933783CmviXg','name','444152oPcdtD','7sHohEg','has','set','588944pGheVU'];a111_0x4c43=function(){return _0x70ef3a;};return a111_0x4c43();}function a111_0x30d2(_0x122dd4,_0x4ff471){_0x122dd4=_0x122dd4-0x8a;const _0x4c43d4=a111_0x4c43();let _0x30d2db=_0x4c43d4[_0x122dd4];return _0x30d2db;}export function buildFolderMaps(_0x2ef972){const _0x4defcf=a111_0x30d2,_0x1a1120=buildFolderIdToPathMap(_0x2ef972),_0x3b1d12=new Map();for(const [_0x3d6489,_0x27d39d]of _0x1a1120){_0x3b1d12[_0x4defcf(0x8f)](_0x27d39d,_0x3d6489);}return{'idToPath':_0x1a1120,'pathToId':_0x3b1d12};}export function getFolderPath(_0x490a02,_0x5aaf15){if(!_0x490a02)return'';return _0x5aaf15['get'](_0x490a02)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1d0691,_0x2b9a95){const _0x3b4fee=a112_0x2aab,_0x4f4852=_0x1d0691();while(!![]){try{const _0x577572=parseInt(_0x3b4fee(0x115))/0x1+-parseInt(_0x3b4fee(0x124))/0x2*(parseInt(_0x3b4fee(0x11a))/0x3)+parseInt(_0x3b4fee(0x126))/0x4*(-parseInt(_0x3b4fee(0x12c))/0x5)+-parseInt(_0x3b4fee(0x12e))/0x6*(parseInt(_0x3b4fee(0x11f))/0x7)+-parseInt(_0x3b4fee(0x13a))/0x8*(parseInt(_0x3b4fee(0x123))/0x9)+-parseInt(_0x3b4fee(0x135))/0xa*(parseInt(_0x3b4fee(0x113))/0xb)+-parseInt(_0x3b4fee(0x121))/0xc*(-parseInt(_0x3b4fee(0x129))/0xd);if(_0x577572===_0x2b9a95)break;else _0x4f4852['push'](_0x4f4852['shift']());}catch(_0x91ddf2){_0x4f4852['push'](_0x4f4852['shift']());}}}(a112_0x5522,0xd0605));import a112_0x554899 from'path';import{parse as a112_0x2ddc2c}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x435e02){const _0x9094af=a112_0x2aab;if(!_0x435e02||_0x435e02[_0x9094af(0x12b)]()==='')throw new Error(_0x9094af(0x112));const _0x405079=_0x435e02[_0x9094af(0x12b)]();if(_0x405079==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x435e02};const _0x5d5bd0=_0x405079[_0x9094af(0x133)]('/')?_0x405079[_0x9094af(0x11e)](0x1):_0x405079,_0x161dac=_0x5d5bd0[_0x9094af(0x118)]('/')[_0x9094af(0x122)](_0x2b8ac8=>_0x2b8ac8!=='');if(_0x161dac[_0x9094af(0x137)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x4d2d40=_0x405079[_0x9094af(0x133)]('/')||!isRelativePathSegment(_0x161dac[0x0]);for(const _0x24b134 of _0x161dac){validatePathSegment(_0x24b134);}return{'segments':_0x161dac,'isAbsolute':_0x4d2d40,'raw':_0x435e02};}function isRelativePathSegment(_0x747c58){return _0x747c58==='.'||_0x747c58==='..';}function validatePathSegment(_0x4ffa8d){const _0x5f5343=a112_0x2aab;if(_0x4ffa8d==='')throw new Error(_0x5f5343(0x134));if(_0x4ffa8d==='.'||_0x4ffa8d==='..')return;if(/[\x00-\x1F\x7F]/[_0x5f5343(0x13c)](_0x4ffa8d))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x4ffa8d);if(_0x4ffa8d!==_0x4ffa8d[_0x5f5343(0x12b)]()){}}export function validatePath(_0x150bdc){const _0x58bd93=a112_0x2aab;if(_0x150bdc['segments']['length']===0x0&&!_0x150bdc['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x150bdc[_0x58bd93(0x10e)]){if(_0x150bdc[_0x58bd93(0x11b)][0x0]==='..')throw new Error(_0x58bd93(0x125));let _0x5ac8d3=0x0;for(const _0x33ee8b of _0x150bdc[_0x58bd93(0x11b)]){if(_0x33ee8b==='..'){if(_0x5ac8d3===0x0)throw new Error(_0x58bd93(0x10d));_0x5ac8d3--;}else _0x33ee8b!=='.'&&_0x5ac8d3++;}}}function a112_0x2aab(_0x300c8b,_0x4a8a64){_0x300c8b=_0x300c8b-0x10d;const _0x552249=a112_0x5522();let _0x2aabe2=_0x552249[_0x300c8b];return _0x2aabe2;}export function joinPaths(_0x2cc6a6,_0x1632a0){const _0x3518a6=a112_0x2aab;if(!_0x2cc6a6||_0x2cc6a6==='/')return _0x1632a0;if(!_0x1632a0||_0x1632a0==='.')return _0x2cc6a6;if(_0x1632a0[_0x3518a6(0x133)]('/'))return _0x1632a0;const _0x346fce=parsePath(_0x2cc6a6),_0x3c49d0=parsePath(_0x1632a0),_0x1d856f=[..._0x346fce[_0x3518a6(0x11b)]];for(const _0x3c6366 of _0x3c49d0[_0x3518a6(0x11b)]){if(_0x3c6366==='.')continue;else{if(_0x3c6366==='..'){if(_0x1d856f[_0x3518a6(0x137)]===0x0)throw new Error(_0x3518a6(0x111));_0x1d856f[_0x3518a6(0x12f)]();}else _0x1d856f['push'](_0x3c6366);}}const _0x5a6561=_0x1d856f['join']('/');return _0x346fce[_0x3518a6(0x138)][_0x3518a6(0x133)]('/')?'/'+_0x5a6561:_0x5a6561;}export function normalizePath(_0x4010fa){const _0x27f974=a112_0x2aab,_0x2f5220=parsePath(_0x4010fa),_0x461e90=[];for(const _0x1caa70 of _0x2f5220[_0x27f974(0x11b)]){if(_0x1caa70==='.')continue;else{if(_0x1caa70==='..'){if(_0x461e90[_0x27f974(0x137)]===0x0){if(_0x2f5220[_0x27f974(0x10e)])throw new Error(_0x27f974(0x111));_0x461e90[_0x27f974(0x119)]('..');}else _0x461e90[_0x461e90[_0x27f974(0x137)]-0x1]==='..'?_0x461e90[_0x27f974(0x119)]('..'):_0x461e90[_0x27f974(0x12f)]();}else _0x461e90[_0x27f974(0x119)](_0x1caa70);}}if(_0x461e90[_0x27f974(0x137)]===0x0)return _0x2f5220[_0x27f974(0x10e)]?'/':'.';const _0x4d498d=_0x461e90[_0x27f974(0x130)]('/');return _0x2f5220[_0x27f974(0x138)][_0x27f974(0x133)]('/')?'/'+_0x4d498d:_0x4d498d;}export function getParentPath(_0x493d96){const _0x2c0814=a112_0x2aab,_0x130301=parsePath(_0x493d96);if(_0x130301['segments'][_0x2c0814(0x137)]<=0x1)return'/';const _0x166890=_0x130301[_0x2c0814(0x11b)][_0x2c0814(0x139)](0x0,-0x1)['join']('/');return _0x130301[_0x2c0814(0x138)][_0x2c0814(0x133)]('/')?'/'+_0x166890:_0x166890;}export function getBaseName(_0x316914){const _0x27c125=a112_0x2aab,_0x46c207=parsePath(_0x316914);return _0x46c207['segments'][_0x46c207[_0x27c125(0x11b)][_0x27c125(0x137)]-0x1]||'';}export function isChildPath(_0x230779,_0x237d26){const _0x3403d3=a112_0x2aab,_0x14d509=parsePath(_0x230779),_0x1d7dfc=parsePath(_0x237d26);if(_0x14d509[_0x3403d3(0x11b)][_0x3403d3(0x137)]<=_0x1d7dfc[_0x3403d3(0x11b)][_0x3403d3(0x137)])return![];for(let _0x3c3184=0x0;_0x3c3184<_0x1d7dfc[_0x3403d3(0x11b)]['length'];_0x3c3184++){if(_0x14d509[_0x3403d3(0x11b)][_0x3c3184]!==_0x1d7dfc[_0x3403d3(0x11b)][_0x3c3184])return![];}return!![];}export function splitPath(_0x437a0c){const _0x1edccb=a112_0x2aab,_0x3ebf56=parsePath(_0x437a0c);if(_0x3ebf56['segments']['length']===0x0)throw new Error(_0x1edccb(0x131));if(_0x3ebf56[_0x1edccb(0x11b)][_0x1edccb(0x137)]===0x1)return{'parent':_0x3ebf56[_0x1edccb(0x11b)][0x0]};return{'parent':_0x3ebf56[_0x1edccb(0x11b)][0x0],'child':_0x3ebf56['segments'][_0x1edccb(0x139)](0x1)['join']('/')};}function a112_0x5522(){const _0x41680f=['tdx.json','80772991NKaJaG','dirname','trim','10aKfdzq','File\x20not\x20found:\x20','163686OUqWVN','pop','join','Cannot\x20split\x20empty\x20path','root','startsWith','Path\x20segment\x20cannot\x20be\x20empty','50Ckrlbr','exists','length','raw','slice','632YpSNxU','replace','test','type','Path\x20attempts\x20to\x20navigate\x20above\x20root','isAbsolute','endsWith','resolve','Cannot\x20navigate\x20above\x20root','Path\x20cannot\x20be\x20empty','2772440tXstKO','.yml','877271gJlpsW','No\x20tdx.json\x20found\x20for\x20file:\x20','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','split','push','428955rVImoR','segments','parent_segment','parse','substring','371izqETg','readFile','12miRGUu','filter','115353OEBPVh','18RbLPco','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','2463136UYHuLK','journey'];a112_0x5522=function(){return _0x41680f;};return a112_0x5522();}export function isYamlFilePath(_0x3c9214){const _0x49c5b0=a112_0x2aab;return _0x3c9214[_0x49c5b0(0x10f)](_0x49c5b0(0x114))||_0x3c9214['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x15d92e,_0x3bea7f=nodeFileSystem){const _0x2ededf=a112_0x2aab,_0x5e7d1d=a112_0x554899[_0x2ededf(0x110)](_0x15d92e);if(!await _0x3bea7f[_0x2ededf(0x136)](_0x5e7d1d))throw new Error(_0x2ededf(0x12d)+_0x15d92e);let _0x37046c=a112_0x554899[_0x2ededf(0x12a)](_0x5e7d1d),_0x2e55f8=null,_0xb207bb=null;const _0x2de7d4=a112_0x554899[_0x2ededf(0x11d)](_0x37046c)[_0x2ededf(0x132)];while(_0x37046c!==_0x2de7d4){const _0x422293=a112_0x554899[_0x2ededf(0x130)](_0x37046c,_0x2ededf(0x128));if(await _0x3bea7f['exists'](_0x422293)){_0x2e55f8=_0x422293,_0xb207bb=_0x37046c;break;}_0x37046c=a112_0x554899[_0x2ededf(0x12a)](_0x37046c);}if(!_0x2e55f8||!_0xb207bb)throw new Error(_0x2ededf(0x116)+_0x15d92e);const _0x58c37a=await _0x3bea7f[_0x2ededf(0x120)](_0x2e55f8),_0x30e972=JSON[_0x2ededf(0x11d)](_0x58c37a),_0x3fbe04=_0x30e972[_0x2ededf(0x11c)];if(!_0x3fbe04)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x4b64f7=await _0x3bea7f[_0x2ededf(0x120)](_0x5e7d1d),_0x4c1ea8=a112_0x2ddc2c(_0x4b64f7),_0x35f506=_0x4c1ea8['name'];if(!_0x35f506)throw new Error(_0x2ededf(0x117)+_0x15d92e);const _0x174b02=_0x4c1ea8[_0x2ededf(0x13d)]===_0x2ededf(0x127)?'journey':'segment',_0x48188f=a112_0x554899['relative'](_0xb207bb,_0x5e7d1d),_0xe93c3c=a112_0x554899[_0x2ededf(0x12a)](_0x48188f),_0x3eaa1d=_0xe93c3c==='.'?'':_0xe93c3c[_0x2ededf(0x13b)](/\\/g,'/'),_0x54b800=_0x3eaa1d?_0x3fbe04+'/'+_0x3eaa1d+'/'+_0x35f506:_0x3fbe04+'/'+_0x35f506;return{'parentSegment':_0x3fbe04,'segmentName':_0x35f506,'folderPath':_0x3eaa1d,'fullPath':_0x54b800,'resourceType':_0x174b02};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3f6ec1,_0x2ba42b){const _0x21f4a8=a113_0x5377,_0x56a0f2=_0x3f6ec1();while(!![]){try{const _0xc62c64=parseInt(_0x21f4a8(0x169))/0x1*(parseInt(_0x21f4a8(0x166))/0x2)+-parseInt(_0x21f4a8(0x163))/0x3+parseInt(_0x21f4a8(0x162))/0x4+parseInt(_0x21f4a8(0x167))/0x5+-parseInt(_0x21f4a8(0x160))/0x6*(parseInt(_0x21f4a8(0x165))/0x7)+-parseInt(_0x21f4a8(0x15f))/0x8+parseInt(_0x21f4a8(0x161))/0x9;if(_0xc62c64===_0x2ba42b)break;else _0x56a0f2['push'](_0x56a0f2['shift']());}catch(_0x886438){_0x56a0f2['push'](_0x56a0f2['shift']());}}}(a113_0x5d8f,0xb929b));export function parseSegmentRef(_0x4083c4){const _0x14ecff=a113_0x5377,_0x1c9a40=_0x4083c4[_0x14ecff(0x15d)]('/');if(_0x1c9a40===-0x1)return{'parentId':_0x4083c4};if(_0x1c9a40===0x0)throw new Error(_0x14ecff(0x15e)+_0x4083c4+_0x14ecff(0x164));const _0x259d31=_0x4083c4[_0x14ecff(0x168)](0x0,_0x1c9a40),_0x5766a9=_0x4083c4[_0x14ecff(0x168)](_0x1c9a40+0x1);if(_0x5766a9==='')throw new Error(_0x14ecff(0x15e)+_0x4083c4+_0x14ecff(0x16a));return{'parentId':_0x259d31,'childId':_0x5766a9};}function a113_0x5377(_0x55dbb5,_0x26653b){_0x55dbb5=_0x55dbb5-0x15d;const _0x5d8f54=a113_0x5d8f();let _0x53778c=_0x5d8f54[_0x55dbb5];return _0x53778c;}function a113_0x5d8f(){const _0x21ff74=['5037435UVCQAB','substring','5gdXqtH','.\x20Child\x20name\x20cannot\x20be\x20empty','indexOf','Invalid\x20segment\x20reference\x20format:\x20','5596088jitksg','6395118aoaUod','8936658GJOSkT','740260hfFCLH','2201559YwyrDk','.\x20Parent\x20name\x20cannot\x20be\x20empty','7TawtwX','428852CWDEgh'];a113_0x5d8f=function(){return _0x21ff74;};return a113_0x5d8f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x362e75,_0xc7d3f7){const _0x1b42ef=a114_0x485a,_0xff76fa=_0x362e75();while(!![]){try{const _0x2c0462=parseInt(_0x1b42ef(0x222))/0x1+-parseInt(_0x1b42ef(0x1f7))/0x2+parseInt(_0x1b42ef(0x21d))/0x3*(-parseInt(_0x1b42ef(0x20a))/0x4)+parseInt(_0x1b42ef(0x224))/0x5*(parseInt(_0x1b42ef(0x1f4))/0x6)+parseInt(_0x1b42ef(0x1f3))/0x7*(-parseInt(_0x1b42ef(0x21b))/0x8)+parseInt(_0x1b42ef(0x212))/0x9+-parseInt(_0x1b42ef(0x1f6))/0xa;if(_0x2c0462===_0xc7d3f7)break;else _0xff76fa['push'](_0xff76fa['shift']());}catch(_0x319483){_0xff76fa['push'](_0xff76fa['shift']());}}}(a114_0x68f2,0xe0059));import a114_0x328b52 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(_0x3a5b6c){const _0x4e53f2=a114_0x485a;return _0x3a5b6c['type']!==_0x4e53f2(0x1ff);}export function isScopedResolution(_0x10ecc8){const _0x26cb72=a114_0x485a;return _0x10ecc8['type']===_0x26cb72(0x215)||_0x10ecc8[_0x26cb72(0x207)]===_0x26cb72(0x223)||_0x10ecc8['type']===_0x26cb72(0x220);}export function getScopedDetails(_0x4c1741){const _0x272135=a114_0x485a;if(isScopedResolution(_0x4c1741))return{'isScoped':_0x4c1741[_0x272135(0x20c)],'scopedFolderPath':_0x4c1741[_0x272135(0x1fe)]};return undefined;}function a114_0x68f2(){const _0x30e12f=['folderPath','context','No\x20tdx.json\x20found\x20for\x20file:\x20','908632LZrZVC','file','85kzukVB','segment','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','resourceType','readFile','resolve','replace','parent_name','7NBkexr','421554GtgaPo','string','11149650myUTKX','2057728VAwILf','join','invalid_yaml','includes','No\x20tdx.json\x20found','dirname','journey','scopedFolderPath','error','File\x20not\x20found','isFile','trim','cwd','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','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','Parent\x20segment\x20not\x20specified','type','segmentName','no_parent','1625916eIGtiT','basename','isScoped','file_not_found','configDir','parent_segment','parse','relative','12409641uOvcuz','no_config','extname','directory','exists','File\x20not\x20found:\x20','Not\x20a\x20YAML\x20file:\x20','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentSegment','111864DmbOCH','stat','3dmQjGv','match'];a114_0x68f2=function(){return _0x30e12f;};return a114_0x68f2();}async function findTdxConfigAsync(_0x50bba4,_0x15a4e5){const _0x28e409=a114_0x485a;let _0x142ac0=a114_0x328b52[_0x28e409(0x229)](_0x50bba4);const _0xbdfd4b=a114_0x328b52[_0x28e409(0x210)](_0x142ac0)['root'];while(_0x142ac0!==_0xbdfd4b){const _0x33b92a=a114_0x328b52[_0x28e409(0x1f8)](_0x142ac0,'tdx.json');if(await _0x15a4e5[_0x28e409(0x216)](_0x33b92a))try{const _0x26d50a=await _0x15a4e5[_0x28e409(0x228)](_0x33b92a),_0x1b7027=JSON[_0x28e409(0x210)](_0x26d50a);if(_0x1b7027['parent_segment']&&typeof _0x1b7027[_0x28e409(0x20f)]===_0x28e409(0x1f5))return{'configPath':_0x33b92a,'configDir':_0x142ac0,'parentSegment':_0x1b7027[_0x28e409(0x20f)]};}catch{}_0x142ac0=a114_0x328b52['dirname'](_0x142ac0);}return null;}function a114_0x485a(_0x4ce788,_0x1a417b){_0x4ce788=_0x4ce788-0x1f2;const _0x68f286=a114_0x68f2();let _0x485a29=_0x68f286[_0x4ce788];return _0x485a29;}function calculateScopedPath(_0x30a7c5,_0x28d1a9){const _0x1ac95a=a114_0x485a,_0x4eb973=a114_0x328b52[_0x1ac95a(0x211)](_0x28d1a9,_0x30a7c5),_0x54fe6e=_0x4eb973!==''&&_0x4eb973!=='.'&&!_0x4eb973['startsWith']('..');return{'isScoped':_0x54fe6e,'scopedFolderPath':_0x54fe6e?_0x4eb973[_0x1ac95a(0x22a)](/\\/g,'/'):''};}export async function resolveTarget(_0x3cd24f){const _0x31101f=a114_0x485a,{arg:_0x532b1e,contextParent:_0x1fb5d8,cwd:cwd=process[_0x31101f(0x203)](),fs:fs=nodeFileSystem}=_0x3cd24f;if(_0x532b1e&&isYamlFilePath(_0x532b1e))try{const _0x4e2088=await resolveYamlFilePath(_0x532b1e,fs),_0x4113cb=a114_0x328b52['resolve'](_0x532b1e),_0x125a32=a114_0x328b52[_0x31101f(0x1fc)](_0x4113cb),_0x403a37=await findTdxConfigAsync(_0x125a32,fs);if(!_0x403a37){if(_0x1fb5d8){const _0x52ae82=a114_0x328b52['dirname'](_0x4113cb);return{'type':_0x31101f(0x223),'parentName':_0x1fb5d8,'targetDir':_0x52ae82,'configRoot':_0x52ae82,'filePath':_0x4113cb,'resourceName':_0x4e2088[_0x31101f(0x208)],'folderPath':_0x4e2088[_0x31101f(0x21f)],'resourceType':_0x4e2088[_0x31101f(0x227)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x31101f(0x213),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x532b1e,'arg':_0x532b1e,'helpText':_0x31101f(0x204)};}const _0x3c8c59=calculateScopedPath(_0x125a32,_0x403a37[_0x31101f(0x20e)]);return{'type':'file','parentName':_0x403a37[_0x31101f(0x21a)],'targetDir':_0x403a37[_0x31101f(0x20e)],'configRoot':_0x403a37['configDir'],'filePath':_0x4113cb,'resourceName':_0x4e2088['segmentName'],'folderPath':_0x4e2088[_0x31101f(0x21f)],'resourceType':_0x4e2088['resourceType'],'isScoped':_0x3c8c59['isScoped'],'scopedFolderPath':_0x3c8c59[_0x31101f(0x1fe)]};}catch(_0x22858e){const _0x121dc1=_0x22858e instanceof Error?_0x22858e['message']:String(_0x22858e);if(_0x121dc1[_0x31101f(0x1fa)](_0x31101f(0x200)))return{'type':_0x31101f(0x1ff),'errorCode':_0x31101f(0x20d),'message':_0x31101f(0x217)+_0x532b1e,'arg':_0x532b1e};if(_0x121dc1[_0x31101f(0x1fa)](_0x31101f(0x1fb))){if(_0x1fb5d8){const _0x3640cf=a114_0x328b52[_0x31101f(0x229)](_0x532b1e);if(await fs[_0x31101f(0x216)](_0x3640cf)){const _0x4ccbc5=a114_0x328b52[_0x31101f(0x1fc)](_0x3640cf),_0x1ef1b7=await fs['readFile'](_0x3640cf),_0x4d5d0a=_0x1ef1b7[_0x31101f(0x21e)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x4b11b9=_0x1ef1b7['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x3a30dd=_0x4d5d0a?_0x4d5d0a[0x1][_0x31101f(0x202)]():a114_0x328b52[_0x31101f(0x20b)](_0x532b1e,a114_0x328b52[_0x31101f(0x214)](_0x532b1e)),_0xdaa0a9=_0x4b11b9&&_0x4b11b9[0x1][_0x31101f(0x202)]()===_0x31101f(0x1fd)?_0x31101f(0x1fd):_0x31101f(0x225);return{'type':'file','parentName':_0x1fb5d8,'targetDir':_0x4ccbc5,'configRoot':_0x4ccbc5,'filePath':_0x3640cf,'resourceName':_0x3a30dd,'folderPath':'','resourceType':_0xdaa0a9,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x31101f(0x1ff),'errorCode':'no_config','message':_0x31101f(0x221)+_0x532b1e,'arg':_0x532b1e,'helpText':_0x31101f(0x204)};}return{'type':_0x31101f(0x1ff),'errorCode':_0x31101f(0x1f9),'message':_0x121dc1,'arg':_0x532b1e};}if(_0x532b1e){const _0x3a6fe1=a114_0x328b52[_0x31101f(0x229)](cwd,_0x532b1e);let _0x315c32=null;try{_0x315c32=await fs[_0x31101f(0x21c)](_0x3a6fe1);}catch{}if(_0x315c32?.['isDirectory']()){const _0x2d0b29=await findTdxConfigAsync(_0x3a6fe1,fs);if(_0x2d0b29){const _0x25393f=calculateScopedPath(_0x3a6fe1,_0x2d0b29[_0x31101f(0x20e)]);return{'type':'directory','parentName':_0x2d0b29[_0x31101f(0x21a)],'targetDir':_0x3a6fe1,'configRoot':_0x2d0b29[_0x31101f(0x20e)],'isScoped':_0x25393f[_0x31101f(0x20c)],'scopedFolderPath':_0x25393f[_0x31101f(0x1fe)]};}if(_0x1fb5d8)return{'type':_0x31101f(0x215),'parentName':_0x1fb5d8,'targetDir':_0x3a6fe1,'configRoot':_0x3a6fe1,'isScoped':![],'scopedFolderPath':''};return{'type':_0x31101f(0x1ff),'errorCode':_0x31101f(0x213),'message':_0x31101f(0x219)+_0x532b1e,'arg':_0x532b1e,'helpText':_0x31101f(0x204)};}if(_0x315c32?.[_0x31101f(0x201)]())return{'type':'error','errorCode':'invalid_yaml','message':_0x31101f(0x218)+_0x532b1e,'arg':_0x532b1e,'helpText':_0x31101f(0x226)};const _0x396263=sanitizeFileName(_0x532b1e),_0x543f7f=getSegmentRootDir(_0x396263,cwd);return{'type':_0x31101f(0x1f2),'parentName':_0x532b1e,'targetDir':_0x543f7f,'configRoot':_0x543f7f};}const _0x27a93f=await findTdxConfigAsync(cwd,fs);if(_0x27a93f){const _0x343906=calculateScopedPath(cwd,_0x27a93f[_0x31101f(0x20e)]);return{'type':_0x31101f(0x220),'parentName':_0x27a93f['parentSegment'],'targetDir':cwd,'configRoot':_0x27a93f[_0x31101f(0x20e)],'isScoped':_0x343906[_0x31101f(0x20c)],'scopedFolderPath':_0x343906[_0x31101f(0x1fe)]};}if(_0x1fb5d8){const _0x22530a=sanitizeFileName(_0x1fb5d8),_0xda7ad6=getSegmentRootDir(_0x22530a,cwd);return{'type':_0x31101f(0x220),'parentName':_0x1fb5d8,'targetDir':_0xda7ad6,'configRoot':_0xda7ad6,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x31101f(0x209),'message':_0x31101f(0x206),'helpText':_0x31101f(0x205)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x348a10=a115_0x2e21;(function(_0x30cbd5,_0x4d1532){const _0x2f01f0=a115_0x2e21,_0x1a37c4=_0x30cbd5();while(!![]){try{const _0x11a8cf=parseInt(_0x2f01f0(0x16a))/0x1*(-parseInt(_0x2f01f0(0x16c))/0x2)+-parseInt(_0x2f01f0(0x158))/0x3+-parseInt(_0x2f01f0(0x16b))/0x4*(-parseInt(_0x2f01f0(0x168))/0x5)+parseInt(_0x2f01f0(0x161))/0x6*(parseInt(_0x2f01f0(0x16f))/0x7)+parseInt(_0x2f01f0(0x15e))/0x8+parseInt(_0x2f01f0(0x166))/0x9+parseInt(_0x2f01f0(0x16e))/0xa*(-parseInt(_0x2f01f0(0x15d))/0xb);if(_0x11a8cf===_0x4d1532)break;else _0x1a37c4['push'](_0x1a37c4['shift']());}catch(_0x316955){_0x1a37c4['push'](_0x1a37c4['shift']());}}}(a115_0x1ef3,0x80e52));import{existsSync,readFileSync}from'fs';function a115_0x1ef3(){const _0x29441a=['Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','26515JVDVfv','tdx.json','514667OzBJeJ','316AEbJNa','2pGblKz','utf-8','10jrNmgl','47243csvnij','relative','replace','join','dirname','string','root','504258MjIxAt','parent_segment','segments','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','parse','11962511TbXKAP','6416120OnWpHo','object','cwd','282IhKMEX','stringify','resolve','Invalid\x20JSON\x20in\x20','startsWith','6840477vUlmDA'];a115_0x1ef3=function(){return _0x29441a;};return a115_0x1ef3();}import a115_0x1e4a89 from'path';const TDX_CONFIG_FILE=a115_0x348a10(0x169),SEGMENTS_DIR=a115_0x348a10(0x15a);export function findTdxConfigPath(_0xe19f6=process[a115_0x348a10(0x160)]()){const _0x278a91=a115_0x348a10;let _0x4335fd=a115_0x1e4a89['resolve'](_0xe19f6);const _0x13757a=a115_0x1e4a89[_0x278a91(0x15c)](_0x4335fd)[_0x278a91(0x157)];while(_0x4335fd!==_0x13757a){const _0x1540a9=a115_0x1e4a89[_0x278a91(0x154)](_0x4335fd,TDX_CONFIG_FILE);if(existsSync(_0x1540a9))return _0x1540a9;_0x4335fd=a115_0x1e4a89[_0x278a91(0x155)](_0x4335fd);}return null;}export function loadTdxConfig(_0x5e84a3){const _0x551869=a115_0x348a10,_0x58a189=readFileSync(_0x5e84a3,_0x551869(0x16d));let _0x392fbf;try{_0x392fbf=JSON[_0x551869(0x15c)](_0x58a189);}catch{throw new Error(_0x551869(0x164)+_0x5e84a3);}if(!_0x392fbf||typeof _0x392fbf!==_0x551869(0x15f))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x559cf9=_0x392fbf;if(!_0x559cf9[_0x551869(0x159)]||typeof _0x559cf9['parent_segment']!==_0x551869(0x156))throw new Error(_0x551869(0x167));return{'parent_segment':_0x559cf9[_0x551869(0x159)]};}export function findTdxConfig(_0x150f82=process['cwd']()){const _0x40cd8e=a115_0x348a10,_0x1b47cb=findTdxConfigPath(_0x150f82);if(!_0x1b47cb)throw new Error(_0x40cd8e(0x15b));const _0x5030c8=loadTdxConfig(_0x1b47cb),_0x4cb096=a115_0x1e4a89[_0x40cd8e(0x155)](_0x1b47cb);return{'config':_0x5030c8,'configPath':_0x1b47cb,'configDir':_0x4cb096};}export function tryFindTdxConfig(_0x27624a){try{return findTdxConfig(_0x27624a);}catch{return null;}}export function getSegmentRootDir(_0x4b0cf9,_0x3351b7=process['cwd']()){const _0x5d0a06=a115_0x348a10;return a115_0x1e4a89[_0x5d0a06(0x154)](_0x3351b7,SEGMENTS_DIR,_0x4b0cf9);}function a115_0x2e21(_0x2e3691,_0x584fce){_0x2e3691=_0x2e3691-0x153;const _0x1ef312=a115_0x1ef3();let _0x2e21f1=_0x1ef312[_0x2e3691];return _0x2e21f1;}export function getTdxConfigPath(_0x3b4804,_0xdf99fa=process['cwd']()){return a115_0x1e4a89['join'](getSegmentRootDir(_0x3b4804,_0xdf99fa),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x4d5396,_0x12059d){const _0x3201c8=a115_0x348a10,_0x4213b3=a115_0x1e4a89[_0x3201c8(0x163)](_0x4d5396),_0x2a27d1=a115_0x1e4a89[_0x3201c8(0x170)](_0x12059d,_0x4213b3);if(_0x2a27d1[_0x3201c8(0x165)]('..'))return'';return _0x2a27d1;}export function localPathToTdFolderPath(_0x40bdb2){const _0x458d5c=a115_0x348a10,_0x17dfa7=a115_0x1e4a89[_0x458d5c(0x155)](_0x40bdb2);if(_0x17dfa7==='.'||_0x17dfa7==='')return'';return _0x17dfa7[_0x458d5c(0x153)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x1f6685,_0x18958f){const _0x552456=a115_0x348a10;if(!_0x1f6685)return _0x18958f;return a115_0x1e4a89[_0x552456(0x154)](_0x18958f,_0x1f6685);}export function createTdxConfigContent(_0x26916a){const _0x59a58a=a115_0x348a10,_0x2b705b={'parent_segment':_0x26916a};return JSON[_0x59a58a(0x162)](_0x2b705b,null,0x2)+'\x0a';}
|