@treasuredata/tdx 0.28.7 → 0.28.8
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/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.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/upgrade-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/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-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/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.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/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.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-validator.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-recovery.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/file-reader.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/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a128_0x5352b9=a128_0x2d4b;(function(_0x454fe6,_0x1b98c6){const _0x152d0c=a128_0x2d4b,_0x5e47bc=_0x454fe6();while(!![]){try{const _0x4740a8=-parseInt(_0x152d0c(0x1d5))/0x1*(-parseInt(_0x152d0c(0x1a6))/0x2)+-parseInt(_0x152d0c(0x275))/0x3+parseInt(_0x152d0c(0x289))/0x4*(-parseInt(_0x152d0c(0x234))/0x5)+-parseInt(_0x152d0c(0x276))/0x6*(-parseInt(_0x152d0c(0x250))/0x7)+parseInt(_0x152d0c(0x211))/0x8+parseInt(_0x152d0c(0x241))/0x9+-parseInt(_0x152d0c(0x20a))/0xa;if(_0x4740a8===_0x1b98c6)break;else _0x5e47bc['push'](_0x5e47bc['shift']());}catch(_0x407a5c){_0x5e47bc['push'](_0x5e47bc['shift']());}}}(a128_0x91af,0xc35c2));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a128_0x5352b9(0x1e3));export const PENDING_SEGMENT_PREFIX=a128_0x5352b9(0x252);export const PENDING_ACTIVATION_PREFIX=a128_0x5352b9(0x247);export function createPendingSegmentId(_0x1ced76){return''+PENDING_SEGMENT_PREFIX+_0x1ced76+'__';}export function isPendingSegmentId(_0x7d508a){const _0x42ac20=a128_0x5352b9;return _0x7d508a[_0x42ac20(0x27a)](PENDING_SEGMENT_PREFIX)&&!_0x7d508a[_0x42ac20(0x27a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x289844){const _0x42b8d4=a128_0x5352b9;return _0x289844[_0x42b8d4(0x1a9)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4ba23c){return''+PENDING_ACTIVATION_PREFIX+_0x4ba23c+'__';}export function isPendingActivationId(_0x1f098b){const _0x4cd0ee=a128_0x5352b9;return _0x1f098b[_0x4cd0ee(0x27a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1ff259){const _0x4276d0=a128_0x5352b9;return _0x1ff259[_0x4276d0(0x1a9)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x10cbea,_0x2dc20a){const _0x2154de=a128_0x5352b9,_0x50eedd=_0x10cbea+'::'+(_0x2dc20a['trim']()||_0x2154de(0x217)),_0x6f33b9=createHash(_0x2154de(0x1e2))[_0x2154de(0x22b)](_0x50eedd)['digest'](_0x2154de(0x201))['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x6f33b9;}export function ensureJourneyDefaults(_0x416d14){const _0x490b0c=a128_0x5352b9;!_0x416d14['description']&&(_0x416d14[_0x490b0c(0x208)]=''),!_0x416d14[_0x490b0c(0x1b7)]&&(_0x416d14['state']=_0x490b0c(0x1eb));}export function injectExistingStageIds(_0x38f015,_0x3e4d75){const _0x13592c=a128_0x5352b9,_0x5a7e48=new Map(_0x3e4d75['map'](_0x1605b9=>[_0x1605b9[_0x13592c(0x1ee)],_0x1605b9['id']]));for(const _0x25dd36 of _0x38f015){if(!_0x25dd36['id']){const _0x14c674=_0x5a7e48[_0x13592c(0x231)](_0x25dd36['name']);_0x14c674&&(_0x25dd36['id']=_0x14c674);}}}export function resolveTDFolderPath(_0x391747,_0x3a9b06,_0x3cddd0){const _0x4c713a=a128_0x5352b9;if(!_0x3a9b06)return _0x391747;if(_0x391747===_0x3cddd0||_0x391747[_0x4c713a(0x27a)](_0x3cddd0+'/'))return _0x391747;return _0x391747?_0x3cddd0+'/'+_0x391747:_0x3cddd0;}export function addFoldersToCreate(_0x1b578f,_0x54b0e3,_0x555813){const _0x2eb6ab=a128_0x5352b9;if(!_0x1b578f)return;if(_0x54b0e3[_0x2eb6ab(0x190)](_0x1b578f))return;const _0x527931=_0x1b578f[_0x2eb6ab(0x20d)]('/');let _0x445a95='';for(const _0x1b1b60 of _0x527931){_0x445a95=_0x445a95?_0x445a95+'/'+_0x1b1b60:_0x1b1b60,!_0x54b0e3[_0x2eb6ab(0x190)](_0x445a95)&&_0x555813[_0x2eb6ab(0x25d)](_0x445a95);}}export function sortFoldersByDepth(_0x1de1d3){return[..._0x1de1d3]['sort']((_0x5dc7f0,_0x487337)=>{const _0x3db182=a128_0x2d4b,_0xfa2245=(_0x5dc7f0[_0x3db182(0x1c2)](/\//g)||[])[_0x3db182(0x1cc)],_0x3046bb=(_0x487337[_0x3db182(0x1c2)](/\//g)||[])[_0x3db182(0x1cc)];return _0xfa2245-_0x3046bb;});}function a128_0x2d4b(_0x4e0417,_0x4b25fc){_0x4e0417=_0x4e0417-0x184;const _0x91aff7=a128_0x91af();let _0x2d4b7a=_0x91aff7[_0x4e0417];return _0x2d4b7a;}import*as a128_0x99d6c0 from'yaml';import{readFileSync}from'fs';import a128_0x5dfaf0 from'path';import{isJourneyDef,parseYamlString as a128_0x1eed67,toYamlString as a128_0x2bd843,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{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x3fe111){const _0x122c55=a128_0x5352b9;if(Array[_0x122c55(0x23e)](_0x3fe111))return'['+_0x3fe111['map'](_0x23843e=>stableStringify(_0x23843e))[_0x122c55(0x282)](',')+']';if(_0x3fe111&&typeof _0x3fe111==='object'){const _0x310fa3=_0x3fe111,_0x337bd1=Object[_0x122c55(0x1ce)](_0x310fa3)['sort'](),_0x488175=_0x337bd1[_0x122c55(0x22d)](_0x40cf5c=>'\x22'+_0x40cf5c+'\x22:'+stableStringify(_0x310fa3[_0x40cf5c]));return'{'+_0x488175['join'](',')+'}';}const _0x2de102=JSON[_0x122c55(0x23c)](_0x3fe111);return _0x2de102===undefined?'null':_0x2de102;}function activationSignature(_0x57cee8){const _0x554dfd=a128_0x5352b9,_0x5ff83d={'connection':_0x57cee8[_0x554dfd(0x243)],..._0x57cee8[_0x554dfd(0x256)]!==undefined&&{'all_columns':_0x57cee8[_0x554dfd(0x256)]},..._0x57cee8[_0x554dfd(0x1d0)]!==undefined&&{'columns':_0x57cee8[_0x554dfd(0x1d0)]},..._0x57cee8[_0x554dfd(0x227)]!==undefined&&{'behavior':_0x57cee8[_0x554dfd(0x227)]},..._0x57cee8['schedule']!==undefined&&{'schedule':_0x57cee8[_0x554dfd(0x22a)]},..._0x57cee8['notification']!==undefined&&{'notification':_0x57cee8[_0x554dfd(0x1a1)]},..._0x57cee8['connector_config']!==undefined&&{'connector_config':_0x57cee8[_0x554dfd(0x212)]},..._0x57cee8['activation_template_id']!==undefined&&{'activation_template_id':_0x57cee8[_0x554dfd(0x23a)]}};return stableStringify(_0x5ff83d);}async function fetchSegment(_0x1abe67,_0x1a3836,_0x2d5a39,_0x2f9b87){const _0x1010ea=a128_0x5352b9,_0x4502fe=_0x2f9b87?.['find'](_0x3e2853=>_0x3e2853['id']===_0x2d5a39);if(_0x4502fe)return _0x4502fe;try{return await _0x1abe67[_0x1010ea(0x217)][_0x1010ea(0x28a)](_0x1a3836,_0x2d5a39);}catch(_0x246bdc){logger[_0x1010ea(0x237)](_0x1010ea(0x1a0)+_0x2d5a39+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x246bdc);try{return await _0x1abe67['segment'][_0x1010ea(0x1c9)](_0x2d5a39);}catch(_0x5a8f24){return logger[_0x1010ea(0x237)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2d5a39+':\x20'+_0x5a8f24),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2cff4f,_0x131b28,_0x565378){const _0xda43f9=a128_0x5352b9,_0x360ee3=readPushRecovery(_0x2cff4f['absolutePath']);if(_0x360ee3?.[_0xda43f9(0x1a7)]===_0x2cff4f[_0xda43f9(0x263)][_0xda43f9(0x1ee)])for(const [_0x159be6,_0x326791]of Object[_0xda43f9(0x225)](_0x360ee3[_0xda43f9(0x271)])){const _0x226e3a=generateDeterministicJourneySegmentName(_0x2cff4f[_0xda43f9(0x263)][_0xda43f9(0x1ee)],_0x159be6);_0x326791[_0xda43f9(0x264)]===_0x226e3a&&(_0x131b28['set'](_0x159be6,_0x326791[_0xda43f9(0x235)]),_0x565378['set'](_0x159be6,_0x326791['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x478b8f,_0x415c47,_0x543376,_0x3871cc){const _0x1df32c=a128_0x5352b9;let _0x171205;try{_0x171205=await _0x478b8f[_0x1df32c(0x217)][_0x1df32c(0x25a)]({'name':_0x543376['uniqueSegmentName'],'description':_0x543376[_0x1df32c(0x208)],'journeyId':_0x543376[_0x1df32c(0x1ad)],'rule':_0x3871cc(_0x543376['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x543376['folderId'],'audienceId':_0x543376[_0x1df32c(0x198)]});}catch(_0x3333dd){const _0x5d45a6=_0x3333dd instanceof Error&&_0x3333dd[_0x1df32c(0x189)][_0x1df32c(0x202)]('Name\x20has\x20already\x20been\x20taken');if(_0x5d45a6){const _0x294b31=readPushRecovery(_0x415c47[_0x1df32c(0x239)]),_0x4842b5=_0x294b31?.[_0x1df32c(0x1a7)]===_0x415c47[_0x1df32c(0x263)]['name']?_0x294b31[_0x1df32c(0x271)][_0x543376[_0x1df32c(0x226)]]:undefined;if(_0x4842b5?.[_0x1df32c(0x264)]===_0x543376[_0x1df32c(0x19b)])await _0x478b8f[_0x1df32c(0x217)]['updateSegmentById'](_0x543376[_0x1df32c(0x198)],_0x4842b5['segmentId'],{'description':_0x543376[_0x1df32c(0x208)],'rule':_0x3871cc(_0x543376[_0x1df32c(0x1b6)],!![]),'countPopulation':!![]}),_0x171205=_0x4842b5['segmentId'];else throw new SDKError(ErrorCode[_0x1df32c(0x1d7)],_0x1df32c(0x1fd)+_0x543376['localName']+_0x1df32c(0x223)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x415c47[_0x1df32c(0x239)][_0x1df32c(0x1a9)](/([^/]+)$/,_0x1df32c(0x286))+')\x20')+_0x1df32c(0x283),_0x3333dd);}else throw _0x3333dd;}return saveSegmentToPushRecovery(_0x415c47[_0x1df32c(0x239)],_0x415c47[_0x1df32c(0x263)][_0x1df32c(0x1ee)],_0x543376[_0x1df32c(0x226)],{'segmentId':_0x171205,'uniqueServerName':_0x543376[_0x1df32c(0x19b)],'createdAt':new Date()[_0x1df32c(0x219)]()}),_0x171205;}export async function prepareSegmentFiles(_0x547c2e,_0x6a22da,_0x4c3218,_0x301768,_0x2eb7aa){const _0xb993cb=a128_0x5352b9,{activationDefToCreateRequest:_0x283678}=await import(_0xb993cb(0x26c)),_0x58e5b8=[],_0x571ed2=new Set();for(const {yamlConfig:_0x303ea6,folderPath:_0x3e29cc,sourcePath:_0x3410f6}of _0x547c2e){const _0x593271=resolveTDFolderPath(_0x3e29cc,_0x301768,_0x2eb7aa),_0x89fcb9=_0x593271+':'+_0x303ea6['name'],_0x530762=_0x6a22da[_0xb993cb(0x1e5)]['get'](_0x89fcb9),_0x4451b8=_0x530762?_0x6a22da[_0xb993cb(0x23b)][_0xb993cb(0x231)](_0x530762['id'])||[]:[];addFoldersToCreate(_0x593271,_0x6a22da['folderPathToId'],_0x571ed2);const _0x175705=calculateActivationActions(_0x303ea6['activations']||[],_0x4451b8,_0x6a22da[_0xb993cb(0x1ef)],_0x6a22da[_0xb993cb(0x272)]);for(const _0x1584eb of _0x175705){(_0x1584eb[_0xb993cb(0x230)]==='create'||_0x1584eb[_0xb993cb(0x230)]===_0xb993cb(0x22b))&&_0x1584eb[_0xb993cb(0x1f5)]&&(_0x1584eb[_0xb993cb(0x1b4)]=await _0x283678(_0x1584eb['yamlActivation'],_0x4c3218));}const _0x3b99fc=calculateSegmentDiff(_0x303ea6,_0x530762,_0x4451b8,_0x6a22da[_0xb993cb(0x1ef)],_0x6a22da[_0xb993cb(0x272)]);_0x58e5b8['push']({'relativePath':_0x303ea6['name'],'absolutePath':_0x3410f6,'yamlConfig':_0x303ea6,'folderPath':_0x593271,'existingSegment':_0x530762,'existingActivations':_0x4451b8,'isNew':_0x3b99fc[_0xb993cb(0x281)],'hasChanges':_0x3b99fc[_0xb993cb(0x194)],'diff':_0x3b99fc['diff'],'activationActions':_0x175705});}return{'segmentFiles':_0x58e5b8,'foldersToCreate':_0x571ed2};}export async function prepareJourneyFiles(_0x4c744d,_0x183a05,_0x2b72e9,_0x4bcbe7){const _0x31e971=a128_0x5352b9,_0x213468=[],_0x5781da=new Set();for(const {yamlConfig:_0x111cff,folderPath:_0x40a1ed,sourcePath:_0x5d728c}of _0x4c744d){const _0x4483c4=resolveTDFolderPath(_0x40a1ed,_0x2b72e9,_0x4bcbe7),_0x34f92e=_0x4483c4+':'+_0x111cff[_0x31e971(0x1ee)],_0xf997a4=_0x183a05[_0x31e971(0x259)][_0x31e971(0x231)](_0x34f92e);let _0x109d7d,_0x5c51a1;if(_0xf997a4&&_0xf997a4[_0x31e971(0x1cc)]>0x0){const _0x2bfd93=buildLocalExpandedRuleMappings(_0x111cff),{createYamlContext:_0x50066f,prefetchJourneySegments:_0x3e4e13}=createPushYamlContextForBundle(_0x183a05[_0x31e971(0x1f2)],_0x183a05[_0x31e971(0x198)],_0x183a05['existingSegments'],_0x2bfd93,_0x183a05[_0x31e971(0x1ef)],_0x183a05[_0x31e971(0x272)],_0x183a05[_0x31e971(0x206)],_0x183a05[_0x31e971(0x19f)]);await _0x3e4e13(_0xf997a4['map'](_0x5e4024=>_0x5e4024['id']));const _0x34a452=await _0x183a05[_0x31e971(0x1f2)][_0x31e971(0x265)]['getLatestJourneyId'](_0xf997a4[0x0][_0x31e971(0x21d)]),_0xdd7966=hasMultipleVersions(_0x111cff),_0xd6f3fc=async _0x3294b6=>{const _0x170688=_0x31e971,_0x8748a6=_0x183a05[_0x170688(0x19f)]?.['get'](_0x3294b6);if(_0x8748a6)return _0x8748a6;return _0x183a05[_0x170688(0x195)]({'journeyId':_0x3294b6,'journeyName':_0x111cff[_0x170688(0x1ee)],'isMultiVersion':_0xf997a4[_0x170688(0x1cc)]>0x1});};if(_0xdd7966&&_0xf997a4[_0x31e971(0x1cc)]>0x1){const _0x30cbc4=[];for(const _0x43d038 of _0xf997a4){const _0x7a06b9=_0x43d038[_0x31e971(0x21e)]||0x1;_0x183a05[_0x31e971(0x262)]?.[_0x31e971(0x22b)](_0x31e971(0x1aa)+_0x111cff['name']+'\x20v'+_0x7a06b9);const _0x32c985=await _0xd6f3fc(_0x43d038['id']),_0x552958=_0x50066f(_0x43d038['id']),_0x1cc8d0=await journeyResponseToDef(_0x32c985,_0x552958);_0x30cbc4[_0x31e971(0x1e0)]({'item':_0x43d038,'yaml':_0x1cc8d0});}const _0x2a4107=buildLocalRuleToNameMappingFromJourney(_0x111cff);_0x5c51a1=buildMergedJourneyDef(_0x30cbc4,_0x2a4107,_0x34a452);const _0x2106ff=Math[_0x31e971(0x267)](..._0x30cbc4['map'](_0x352a08=>_0x352a08[_0x31e971(0x1d1)]['versionNumber']||0x0)),_0x32dab5=_0xf997a4[_0x31e971(0x1fe)](_0x1bdc01=>(_0x1bdc01[_0x31e971(0x21e)]||0x0)===_0x2106ff);_0x32dab5&&(_0x183a05[_0x31e971(0x262)]?.['update']('Fetching\x20'+_0x111cff[_0x31e971(0x1ee)]+'\x20v'+_0x2106ff),_0x109d7d=await _0xd6f3fc(_0x32dab5['id']));}else{const _0x41e3ed=_0xf997a4[_0xf997a4['length']-0x1];_0x183a05[_0x31e971(0x262)]?.[_0x31e971(0x22b)](_0x31e971(0x1aa)+_0x111cff[_0x31e971(0x1ee)]),_0x109d7d=await _0xd6f3fc(_0x41e3ed['id']);const _0x34fceb=_0x50066f(_0x41e3ed['id']),_0xb762b4=await journeyResponseToDef(_0x109d7d,_0x34fceb),_0x86fdea=buildLocalRuleToNameMappingFromJourney(_0x111cff);_0x5c51a1=buildMergedJourneyDef([{'item':_0x41e3ed,'yaml':_0xb762b4}],_0x86fdea,_0x34a452);}}addFoldersToCreate(_0x4483c4,_0x183a05[_0x31e971(0x1de)],_0x5781da);const _0xeae179=calculateJourneyDiff(_0x111cff,_0x5c51a1);_0x213468[_0x31e971(0x1e0)]({'relativePath':_0x111cff['name'],'absolutePath':_0x5d728c,'yamlConfig':_0x111cff,'folderPath':_0x4483c4,'existingJourney':_0x109d7d,'isNew':_0xeae179[_0x31e971(0x281)],'hasChanges':_0xeae179['hasChanges'],'diff':_0xeae179[_0x31e971(0x268)]});}return{'journeyFiles':_0x213468,'foldersToCreate':_0x5781da};}export function calculateActivationActions(_0x3e26c8,_0x241a41,_0x34da5d,_0x13a4b1){const _0x1ee226=a128_0x5352b9,_0x35e668=[],_0x2133ed=new Map();for(const _0x4035fc of _0x241a41){_0x2133ed[_0x1ee226(0x215)](_0x4035fc[_0x1ee226(0x1ee)],_0x4035fc);}const _0x4ffcc8=new Map();for(const _0x4eab75 of _0x3e26c8){_0x4ffcc8[_0x1ee226(0x215)](_0x4eab75[_0x1ee226(0x1ee)],_0x4eab75);}for(const _0x41edd3 of _0x3e26c8){const _0x49fc93=_0x2133ed[_0x1ee226(0x231)](_0x41edd3['name']);if(!_0x49fc93)_0x35e668[_0x1ee226(0x1e0)]({'type':_0x1ee226(0x1ca),'name':_0x41edd3[_0x1ee226(0x1ee)],'yamlActivation':_0x41edd3});else{const _0x322f55=activationResponseToDef(_0x49fc93,_0x34da5d,_0x13a4b1),_0xe375d1=a128_0x99d6c0[_0x1ee226(0x23c)](_0x322f55),_0x169ae6=a128_0x99d6c0[_0x1ee226(0x23c)](_0x41edd3);_0xe375d1!==_0x169ae6&&_0x35e668[_0x1ee226(0x1e0)]({'type':'update','name':_0x41edd3[_0x1ee226(0x1ee)],'yamlActivation':_0x41edd3,'existingActivation':_0x49fc93});}}for(const _0x5d9d14 of _0x241a41){!_0x4ffcc8[_0x1ee226(0x190)](_0x5d9d14['name'])&&_0x35e668[_0x1ee226(0x1e0)]({'type':_0x1ee226(0x232),'name':_0x5d9d14[_0x1ee226(0x1ee)],'existingActivation':_0x5d9d14});}return _0x35e668;}function calculateYamlDiff(_0x548730,_0x2e4506){if(_0x2e4506){const _0x3c2412=generateDiff(_0x2e4506,_0x548730),_0x5b5660=hasChanges(_0x3c2412);return{'isNew':![],'hasChanges':_0x5b5660,'diff':_0x5b5660?formatDiffWithColors(_0x3c2412):undefined};}const _0x2cecc8=generateDiff('',_0x548730);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2cecc8)};}function a128_0x91af(){const _0x809f1f=['Created\x20journey\x20\x27','steps','hex','includes','Activation\x20not\x20found:\x20','activationActions','rootFolderId','activationStepsById','journeyBundleName','description','journey_updating','4125020ayQdNG','embeddedSegmentNameToId','sort','split','../../utils/async.js','\x0a\x20\x20','embedded_activation_created','927024leDFXw','connector_config','folder_creating','):\x20','set','segment_deleted','segment','Deleted\x20segment\x20\x27','toISOString','activationContext','ACTIVATION_UPDATE_ERROR','Created\x20segment\x20\x27','journeyBundleId','versionNumber','kind','activation_updating','idToName','listActivations','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','embedded_activation_creating','entries','localName','behavior','Updated\x20activation\x20\x27','conditionTimeoutDuration','schedule','update','\x27\x20entry\x20criteria','map','dirname','createFolder','type','get','delete','logSuccess','640niGdhN','segmentId','created','debug','INTERNAL','absolutePath','activation_template_id','activationsBySegmentId','stringify','updateActivation','isArray','journeys','journey_creating','8419968KGLBDr','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','connection','conditionTimeoutUnit','parse','\x27...','__pending_act_','Segment\x20not\x20found:\x20','conditionSegmentId','goal','WaitStep','SEGMENT_SYNTAX_ERROR','index','parseDocument','stage\x20\x27','1372434vWolGM','\x27\x20not\x20found\x20in\x20journey\x20\x27','__pending_','size','\x27\x20wait\x20condition','relative','all_columns','deleted','Updated\x20segment\x20\x27','journeyBundlesByFolderAndName','createJourneySegment','all','Condition','add','Failed\x20to\x20resolve\x20activation\x20','getActivation','Created\x20folder\x20\x27','journeyActivationStepId','progress','yamlConfig','uniqueServerName','journey','\x20(referenced\x20in\x20journey\x20','max','diff','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','parentSegmentFolder','./child-segment-yaml.js','NOT_FOUND','attributes','updated','./journey-yaml.js','segments','connectionIdToNameMap','waitStep','SEGMENT_NOT_FOUND','3425181yahLlO','30aFaQMm','entry','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','existingSegment','startsWith','withProgress','waitStepUnit','folder','createSegment','with','updateSegmentById','isNew','join','and\x20the\x20server\x20segment,\x20then\x20retry.','\x27\x20exit\x20criteria','Duration','.$1.push-recovery.json','\x20error(s)','waitStepType','19412vTPeMj','getSegment','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','existingJourney','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','parentFolder','buildUserMaps','message','DecisionPoint','Updating\x20segment\x20\x27','activation_creating','Segment\x20not\x20found','JOURNEY_UPDATE_ERROR','Updating\x20activation\x20\x27','has','stages','relationships','journeyStages','hasChanges','fetchJourney','onProgress','activation_','parentId','milestone','rule','uniqueSegmentName','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','Failed\x20to\x20','day','journeyById','getSegment\x20failed\x20for\x20','notification','resolveJourneyId','utf-8','data','segment_updating','2UZLCJJ','journeyName','\x20activation\x20\x27','replace','Fetching\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27\x20by\x20rule\x20content','journeyId','effectiveFolderId','\x27\x20from\x20file:\x20','segment_creating','unchanged','folderId','Matched\x20server\x20segment\x20\x27','validatedRequest','user','resolvedRule','state','getJourney','segment_updated','folderPath','logInfo','Entry\x20criteria:\x20','from','activations','skipSegments','segmentFolderId','activation_updated','match','action','createdSegmentIds','JOURNEY_SYNTAX_ERROR','Updated\x20journey\x20\x27','Activation','createActivation','getSegmentEntity','create','Deleting\x20activation\x20\x27','length','entryCriteria','keys','filter','columns','item','goal\x20criteria',').\x20','existingActivation','943867yGIlgF','Deleted\x20activation\x20\x27','SEGMENT_UPDATE_ERROR','errors','createdSegmentId','branches','journey_created','conditions','list','folderPathToId','\x20segment\x20from\x20file:\x20','push','ACTIVATION_SYNTAX_ERROR','sha1','tdx.sdk.push-workflow','verbose','segmentByFolderAndName','segment_deleting','run_after_journey_refresh','toString','toLowerCase','exitCriterias','draft','slice','nameToType','name','idToEmailMap','existingSegments','entry_criteria','deps','\x20journey\x20from\x20file:\x20','nameToId','yamlActivation','valid','segmentNameToId','logWarning','some','embedded_segment_created','logDeleted','values','Embedded\x20segment\x20\x27','find'];a128_0x91af=function(){return _0x809f1f;};return a128_0x91af();}export function calculateSegmentDiff(_0x7eed29,_0x428850,_0x3aeee2,_0x1a8a7f,_0x197e59){const _0x352fdd=segmentToYamlString(_0x7eed29),_0x553294=_0x428850?segmentToYamlString(segmentWithActivationsToYaml(_0x428850,_0x3aeee2,undefined,_0x1a8a7f,_0x197e59)):undefined;return calculateYamlDiff(_0x352fdd,_0x553294);}export function calculateJourneyDiff(_0x96936a,_0x38eef0){const _0x1efd3c=normalizeJourneyDef(_0x96936a,_0x96936a),_0x49c638=a128_0x2bd843(_0x1efd3c),_0x3eeb5f=_0x38eef0?a128_0x2bd843(normalizeJourneyDef(_0x38eef0,_0x96936a)):undefined;return calculateYamlDiff(_0x49c638,_0x3eeb5f);}export function findSegmentsToDelete(_0x20f965,_0x182b78,_0x5b7e39,_0x1d3535,_0x48901a){const _0x589a29=a128_0x5352b9,_0x4a7004=new Set();for(const {yamlConfig:_0x60f272,folderPath:_0x1cc1c5}of _0x182b78){_0x4a7004[_0x589a29(0x25d)](_0x1cc1c5+':'+_0x60f272[_0x589a29(0x1ee)]);}return _0x20f965[_0x589a29(0x1cf)](_0x3457a5=>{const _0x4dc544=_0x589a29,_0x22f817=_0x3457a5[_0x4dc544(0x1c0)]?_0x5b7e39[_0x4dc544(0x231)](_0x3457a5['segmentFolderId']['toString']())||'':'',_0x33915e=_0x22f817+':'+_0x3457a5[_0x4dc544(0x1ee)];if(_0x4a7004[_0x4dc544(0x190)](_0x33915e))return![];if(_0x48901a)return _0x22f817===_0x1d3535||_0x22f817[_0x4dc544(0x27a)](_0x1d3535+'/');return!![];});}export function findJourneysToDelete(_0x3d4366,_0x66fc70,_0x217e9e,_0x32973a,_0x245e1d){const _0x1ae926=a128_0x5352b9,_0xf01aaf=new Set();for(const {yamlConfig:_0x8e3b86,folderPath:_0x3cdb28}of _0x66fc70){_0xf01aaf[_0x1ae926(0x25d)](_0x3cdb28+':'+_0x8e3b86[_0x1ae926(0x1ee)]);}return _0x3d4366[_0x1ae926(0x1cf)](_0x773c99=>{const _0x3d8aa9=_0x1ae926,_0x2866c4=_0x773c99['folderId']?_0x217e9e[_0x3d8aa9(0x231)](_0x773c99[_0x3d8aa9(0x1b2)])||'':'',_0x142f3b=_0x2866c4+':'+_0x773c99[_0x3d8aa9(0x207)];if(_0xf01aaf[_0x3d8aa9(0x190)](_0x142f3b))return![];if(_0x245e1d)return _0x2866c4===_0x32973a||_0x2866c4[_0x3d8aa9(0x27a)](_0x32973a+'/');return!![];});}export function buildSegmentLookupMap(_0x5e138d,_0x14ffe8){const _0x405df4=a128_0x5352b9,_0x13b56a=new Map();for(const _0x401512 of _0x5e138d){const _0x470d81=_0x401512['segmentFolderId']?_0x14ffe8[_0x405df4(0x231)](_0x401512[_0x405df4(0x1c0)][_0x405df4(0x1e8)]())||'':'',_0x47b4a4=_0x470d81+':'+_0x401512['name'];_0x13b56a[_0x405df4(0x215)](_0x47b4a4,_0x401512);}return _0x13b56a;}export function buildSegmentNameToIdMap(_0x21ea7d){const _0xf9a1fb=a128_0x5352b9,_0xd93291=new Map();for(const _0x361549 of _0x21ea7d){_0xd93291[_0xf9a1fb(0x215)](_0x361549['name'],_0x361549['id']);}return _0xd93291;}export function buildJourneyBundleLookupMap(_0x13d153,_0x195bb0){const _0x342313=a128_0x5352b9,_0x28dd09=new Map();for(const _0x3d956f of _0x13d153){const _0x53e87c=_0x3d956f[_0x342313(0x1b2)]?_0x195bb0['get'](_0x3d956f[_0x342313(0x1b2)])||'':'',_0x4fb6c6=_0x53e87c+':'+_0x3d956f['journeyBundleName'];!_0x28dd09[_0x342313(0x190)](_0x4fb6c6)&&_0x28dd09[_0x342313(0x215)](_0x4fb6c6,[]),_0x28dd09[_0x342313(0x231)](_0x4fb6c6)[_0x342313(0x1e0)](_0x3d956f);}for(const _0x440183 of _0x28dd09[_0x342313(0x1fc)]()){_0x440183[_0x342313(0x20c)]((_0x3de50c,_0x13a52c)=>(_0x3de50c['versionNumber']||0x0)-(_0x13a52c[_0x342313(0x21e)]||0x0));}return _0x28dd09;}export function collectFoldersToCreate(_0x1b6dff,_0x510558){const _0x430fca=a128_0x5352b9,_0x2387ad=new Set();for(const _0x32e390 of _0x1b6dff){if(!_0x32e390)continue;if(_0x510558[_0x430fca(0x190)](_0x32e390))continue;const _0xab8f06=_0x32e390[_0x430fca(0x20d)]('/');let _0x1c15eb='';for(const _0x4a3d98 of _0xab8f06){_0x1c15eb=_0x1c15eb?_0x1c15eb+'/'+_0x4a3d98:_0x4a3d98,!_0x510558[_0x430fca(0x190)](_0x1c15eb)&&_0x2387ad[_0x430fca(0x25d)](_0x1c15eb);}}return _0x2387ad;}export function parseAndClassifyYamlFiles(_0x3a9b7b,_0x291f9b,_0x1ded3e){const _0x41a38c=a128_0x5352b9,_0x1fc3ea=[],_0xe9f954=[];for(const _0x349a3a of _0x3a9b7b){const _0xd8d68=a128_0x5dfaf0[_0x41a38c(0x255)](_0x291f9b,a128_0x5dfaf0[_0x41a38c(0x22e)](_0x349a3a)),_0x33f315=_0xd8d68==='.'?'':_0xd8d68,_0x50800f=readFileSync(_0x349a3a,_0x41a38c(0x1a3)),_0x3e887a=a128_0x99d6c0['parse'](_0x50800f);if(isJourneyDef(_0x3e887a)){const _0x3189de=a128_0x1eed67(_0x50800f);_0xe9f954['push']({'yamlConfig':_0x3189de,'folderPath':_0x33f315,'sourcePath':_0x349a3a});}else{if(!_0x1ded3e?.[_0x41a38c(0x1bf)]){const _0x24bbc8=parseSegmentYamlFile(_0x50800f),_0x17744d=normalizeChildSegmentYaml(_0x24bbc8);_0x1fc3ea[_0x41a38c(0x1e0)]({'yamlConfig':_0x17744d,'folderPath':_0x33f315,'sourcePath':_0x349a3a});}}}return{'segments':_0x1fc3ea,'journeys':_0xe9f954};}export function validateParsedFiles(_0x47f75a,_0x39eccc){const _0x4ce99e=a128_0x5352b9,_0x532a6d=[];for(const {yamlConfig:_0x3b815f,sourcePath:_0x258004}of _0x47f75a[_0x4ce99e(0x271)]){const _0x526f05=readFileSync(_0x258004,_0x4ce99e(0x1a3)),_0x4cf785=a128_0x99d6c0[_0x4ce99e(0x24e)](_0x526f05),_0x4f4ffd=validateSegmentDef(_0x3b815f,{'source':_0x526f05,'document':_0x4cf785});if(!_0x4f4ffd[_0x4ce99e(0x1f6)]){const _0x3d1e93=a128_0x5dfaf0[_0x4ce99e(0x255)](_0x39eccc,_0x258004);_0x532a6d['push']({'filePath':_0x3d1e93,'source':_0x526f05,'result':_0x4f4ffd,'isJourney':![]});}}for(const {yamlConfig:_0x51ef50,sourcePath:_0x3ebebb}of _0x47f75a['journeys']){const _0x340cb7=readFileSync(_0x3ebebb,'utf-8'),_0x5af993=a128_0x99d6c0[_0x4ce99e(0x24e)](_0x340cb7),_0x2d2cc9=validateJourneyDef(_0x51ef50,{'source':_0x340cb7,'document':_0x5af993});if(!_0x2d2cc9[_0x4ce99e(0x1f6)]){const _0x2551a7=a128_0x5dfaf0[_0x4ce99e(0x255)](_0x39eccc,_0x3ebebb);_0x532a6d[_0x4ce99e(0x1e0)]({'filePath':_0x2551a7,'source':_0x340cb7,'result':_0x2d2cc9,'isJourney':!![]});}}return _0x532a6d;}export function formatValidationErrors(_0xe5cf4){const _0x57c60c=a128_0x5352b9,_0x5213f=[];for(const {filePath:_0x39331b,source:_0x3afc13,result:_0xf726e1,isJourney:_0xbbe972}of _0xe5cf4){const _0x5dee90=_0xbbe972?_0x57c60c(0x265):_0x57c60c(0x217);_0x5213f[_0x57c60c(0x1e0)]('\x0a'+_0x39331b+'\x20('+_0x5dee90+_0x57c60c(0x214)+_0xf726e1[_0x57c60c(0x1d8)][_0x57c60c(0x1cc)]+_0x57c60c(0x287)),_0x5213f[_0x57c60c(0x1e0)](formatValidationResult(_0xf726e1,_0x3afc13,_0x39331b));}return _0x5213f['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x6b4b35){const _0x1d22d2=a128_0x5352b9,_0x1920d0=new Set(),_0x1603a5=new Map(),_0xc8a956=collectSegmentUsageCounts(_0x6b4b35);if(_0x6b4b35[_0x1d22d2(0x271)])for(const [_0x140d86,_0x2e77ec]of Object[_0x1d22d2(0x225)](_0x6b4b35['segments'])){_0x1920d0[_0x1d22d2(0x25d)](_0x140d86);if(_0x2e77ec[_0x1d22d2(0x19a)]){const _0x5cd599=yamlRuleToApi(_0x2e77ec[_0x1d22d2(0x19a)]),_0x5e9712=apiRuleToYaml(_0x5cd599);_0x1603a5[_0x1d22d2(0x215)](_0x140d86,_0x5e9712);}}const _0x5afe79=new Map();let _0x1da74e=0x0;for(const [_0x1cc7af,_0x1c9eae]of _0x1603a5){const _0x334d4e=serializeExpandedRule(_0x1c9eae,_0x1603a5),_0x22ac71=_0x5afe79['get'](_0x334d4e)||[];_0x22ac71[_0x1d22d2(0x1e0)]({'name':_0x1cc7af,'index':_0x1da74e}),_0x5afe79[_0x1d22d2(0x215)](_0x334d4e,_0x22ac71),_0x1da74e++;}const _0x5661bf=new Map();for(const [_0x9e86d2,_0x1a241d]of _0x5afe79){const _0x16e586=_0x1a241d[_0x1d22d2(0x1ec)]()[_0x1d22d2(0x20c)]((_0x5e8333,_0x461db4)=>{const _0x202cfd=_0x1d22d2,_0x543984=_0xc8a956[_0x202cfd(0x231)](_0x5e8333[_0x202cfd(0x1ee)])||0x0,_0x253bd8=_0xc8a956[_0x202cfd(0x231)](_0x461db4['name'])||0x0;if(_0x543984!==_0x253bd8)return _0x253bd8-_0x543984;return _0x5e8333[_0x202cfd(0x24d)]-_0x461db4[_0x202cfd(0x24d)];})[_0x1d22d2(0x22d)](_0x3f9a1e=>_0x3f9a1e[_0x1d22d2(0x1ee)]),_0x1c0a46=[];for(const _0xf1858a of _0x16e586){const _0x25d7d3=_0xc8a956['get'](_0xf1858a)||0x0,_0x575260=Math[_0x1d22d2(0x267)](_0x25d7d3,0x1);for(let _0x527d2f=0x0;_0x527d2f<_0x575260;_0x527d2f++){_0x1c0a46[_0x1d22d2(0x1e0)](_0xf1858a);}}_0x5661bf[_0x1d22d2(0x215)](_0x9e86d2,_0x1c0a46);}return{'existingLocalSegmentNames':_0x1920d0,'localSegmentRules':_0x1603a5,'localExpandedRuleToNames':_0x5661bf};}export function createSegmentIdResolver(_0x50b92b,_0x4541d0){return async _0x49a761=>{const _0x364759=a128_0x2d4b,_0x32ab8b=_0x50b92b['get'](_0x49a761);if(!_0x32ab8b)throw new SDKError(ErrorCode[_0x364759(0x274)],_0x364759(0x248)+_0x49a761+_0x364759(0x242)+_0x4541d0+'\x27)');return _0x32ab8b;};}export function extractRootFolderId(_0x3db562){const _0x2c2109=a128_0x5352b9;return _0x3db562['relationships']?.[_0x2c2109(0x26b)]?.[_0x2c2109(0x1a4)]?.['id']||_0x3db562['relationships']?.[_0x2c2109(0x187)]?.['data']?.['id'];}export function buildConnectionMaps(_0x3ee56f){const _0x5d8b2e=a128_0x5352b9,_0x33a80e=new Map(),_0x1e97c1=new Map(),_0x4fc475=new Map();for(const _0x2dc89c of _0x3ee56f){_0x33a80e['set'](_0x2dc89c[_0x5d8b2e(0x1ee)],parseInt(_0x2dc89c['id'],0xa)),_0x1e97c1['set'](_0x2dc89c['id'],_0x2dc89c[_0x5d8b2e(0x1ee)]),_0x4fc475['set'](_0x2dc89c['name'],_0x2dc89c[_0x5d8b2e(0x230)]);}return{'nameToId':_0x33a80e,'idToName':_0x1e97c1,'nameToType':_0x4fc475};}export function calculatePushStats(_0x40961d,_0x584474,_0x4ae5ac,_0x97edb1,_0x18f1a0,_0x115249,_0x1735fe){const _0x39fa33=a128_0x5352b9,_0x457c41=_0x40961d[_0x39fa33(0x1cf)](_0x10f57f=>_0x10f57f['isNew']),_0xcf86a8=_0x40961d[_0x39fa33(0x1cf)](_0xb50a1e=>!_0xb50a1e[_0x39fa33(0x281)]&&_0xb50a1e[_0x39fa33(0x194)]),_0x5a6d79=_0x40961d['filter'](_0x319acc=>!_0x319acc['isNew']&&!_0x319acc[_0x39fa33(0x194)]),_0x8c81a2=_0x115249?_0x97edb1:[],_0x25023b=_0x584474['filter'](_0xb8c693=>_0xb8c693['isNew']),_0x399890=_0x584474[_0x39fa33(0x1cf)](_0x57e30b=>!_0x57e30b[_0x39fa33(0x281)]&&_0x57e30b[_0x39fa33(0x194)]),_0x23a782=_0x584474[_0x39fa33(0x1cf)](_0x53f8c4=>!_0x53f8c4[_0x39fa33(0x281)]&&!_0x53f8c4[_0x39fa33(0x194)]),_0x5e034b=_0x115249?_0x18f1a0:[],_0x360df8=_0x40961d['flatMap'](_0x485eb1=>_0x485eb1[_0x39fa33(0x204)]),_0x3109d9=_0x360df8[_0x39fa33(0x1cf)](_0x59d34a=>_0x59d34a[_0x39fa33(0x230)]==='create'),_0xf3c5e6=_0x360df8[_0x39fa33(0x1cf)](_0x58fceb=>_0x58fceb[_0x39fa33(0x230)]===_0x39fa33(0x22b)),_0x7f8f85=_0x360df8[_0x39fa33(0x1cf)](_0x10176b=>_0x10176b['type']===_0x39fa33(0x232)),_0x19d6c7=Array[_0x39fa33(0x1bd)](_0x4ae5ac)[_0x39fa33(0x20c)](),_0x24de5d=_0x1735fe?![]:_0x457c41[_0x39fa33(0x1cc)]>0x0||_0xcf86a8['length']>0x0||_0x8c81a2[_0x39fa33(0x1cc)]>0x0,_0x5521ee=_0x25023b['length']>0x0||_0x399890[_0x39fa33(0x1cc)]>0x0||_0x5e034b[_0x39fa33(0x1cc)]>0x0,_0x3ba6c6=_0x1735fe?![]:_0x360df8[_0x39fa33(0x1cc)]>0x0,_0x22b22f=_0x19d6c7[_0x39fa33(0x1cc)]>0x0;return{'segments':{'new':_0x457c41,'changed':_0xcf86a8,'unchanged':_0x5a6d79,'toDelete':_0x8c81a2},'journeys':{'new':_0x25023b,'changed':_0x399890,'unchanged':_0x23a782,'toDelete':_0x5e034b},'activations':{'all':_0x360df8,'toCreate':_0x3109d9,'toUpdate':_0xf3c5e6,'toDelete':_0x7f8f85},'folders':{'toCreate':_0x19d6c7},'counts':{'segments':{'new':_0x457c41[_0x39fa33(0x1cc)],'changed':_0xcf86a8[_0x39fa33(0x1cc)],'unchanged':_0x5a6d79['length'],'toDelete':_0x8c81a2[_0x39fa33(0x1cc)]},'journeys':{'new':_0x25023b[_0x39fa33(0x1cc)],'changed':_0x399890[_0x39fa33(0x1cc)],'unchanged':_0x23a782['length'],'toDelete':_0x5e034b['length']},'activations':{'create':_0x3109d9[_0x39fa33(0x1cc)],'update':_0xf3c5e6[_0x39fa33(0x1cc)],'delete':_0x7f8f85[_0x39fa33(0x1cc)]},'folders':_0x19d6c7[_0x39fa33(0x1cc)]},'hasChanges':_0x24de5d||_0x5521ee||_0x3ba6c6||_0x22b22f};}export async function buildPushExecutionContext(_0x2bf417,_0x23083f,_0x53b4f6,_0x5b11b4,_0x2a319e,_0x213d6d){const _0x2d7b36=a128_0x5352b9,_0x118361=extractRootFolderId(_0x53b4f6),{pathToId:_0x270376,idToPath:_0x5a0dc6}=buildFolderMaps(_0x2a319e),_0x2121e1=buildSegmentNameToIdMap(_0x5b11b4),_0x2bbec1=new Map(),{batchAsync:_0x268576}=await import('../../utils/async.js'),[_0x171a87,_0x4a9d8f]=await Promise[_0x2d7b36(0x25b)]([_0x2bf417[_0x2d7b36(0x1b5)][_0x2d7b36(0x188)](),_0x2bf417[_0x2d7b36(0x243)][_0x2d7b36(0x1dd)](),((async()=>{const _0x72f0c5=_0x2d7b36;!_0x213d6d&&_0x5b11b4[_0x72f0c5(0x1cc)]>0x0&&await _0x268576(_0x5b11b4,async _0x44718f=>{const _0x4f1e35=_0x72f0c5,_0x5122fc=await _0x2bf417[_0x4f1e35(0x217)][_0x4f1e35(0x222)](_0x23083f,_0x44718f['id']);_0x2bbec1[_0x4f1e35(0x215)](_0x44718f['id'],_0x5122fc);});})())]),{emailToId:_0x5cb2d1,idToEmail:_0x101ec8}=_0x171a87,_0x49af0b=buildConnectionMaps(_0x4a9d8f);return{'rootFolderId':_0x118361,'folderPathToId':_0x270376,'folderIdToPath':_0x5a0dc6,'segmentNameToId':_0x2121e1,'activationsBySegmentId':_0x2bbec1,'emailToIdMap':_0x5cb2d1,'idToEmailMap':_0x101ec8,'connectionNameToIdMap':_0x49af0b[_0x2d7b36(0x1f4)],'connectionIdToNameMap':_0x49af0b[_0x2d7b36(0x221)],'connectionNameToTypeMap':_0x49af0b[_0x2d7b36(0x1ed)]};}export function createPushYamlContextForBundle(_0x3f5ed4,_0x3512f9,_0xd138d1,_0xdde0eb,_0x202ebf,_0x286e12,_0x5d573c,_0x4c6f84){const {existingLocalSegmentNames:_0x177c9e,localExpandedRuleToNames:_0x8713a3}=_0xdde0eb,_0x4b64ba=new Set(),_0x490093=new Map(),_0x286cc6=new Map(),_0x29faf7=new Map(),_0x10bc7f=createJumpTargetCache(),_0x3bc4fe=new Map(),_0x5dab7e=new Map(),_0x152ef1=new Set();let _0x3df27b;const _0x35c7d8=_0x270a0b=>{const _0x480f09={'resolveSegment':async _0x2329ce=>{const _0x2a4961=a128_0x2d4b,_0x69aa70=_0x29faf7[_0x2a4961(0x231)](_0x2329ce);if(_0x69aa70!==undefined)return{'name':_0x69aa70,'isJourneyLocal':!![]};try{const _0x58662e=await fetchSegment(_0x3f5ed4,_0x3512f9,_0x2329ce,_0xd138d1);if(!_0x58662e)throw new Error(_0x2a4961(0x18d));const _0x14779a=generateJourneyLocalName(_0x58662e[_0x2a4961(0x1ee)]),_0x335e12=_0x58662e[_0x2a4961(0x21f)]===SEGMENT_KIND_JOURNEY&&_0x14779a!==undefined;let _0x581e4f=_0x58662e['name'],_0x458249;if(_0x335e12&&_0x58662e[_0x2a4961(0x19a)]){const _0x11e727=apiRuleToYaml(_0x58662e['rule']);_0x5dab7e[_0x2a4961(0x215)](_0x2329ce,_0x11e727);const _0xbe0b27=async _0xb56e8=>{const _0x1b159d=_0x2a4961,_0x5b4388=collectSegmentRefsFromRule(_0xb56e8);for(const _0x42cd8c of _0x5b4388){if(!_0x5dab7e[_0x1b159d(0x190)](_0x42cd8c))try{const _0x1b6212=await fetchSegment(_0x3f5ed4,_0x3512f9,_0x42cd8c,_0xd138d1);if(_0x1b6212?.[_0x1b159d(0x19a)]){const _0x3fa898=apiRuleToYaml(_0x1b6212['rule']);_0x5dab7e[_0x1b159d(0x215)](_0x42cd8c,_0x3fa898),await _0xbe0b27(_0x3fa898);}}catch(_0x1595ac){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x42cd8c+':\x20'+_0x1595ac);}}};await _0xbe0b27(_0x11e727);const _0x5dfd73=serializeExpandedRule(_0x11e727,_0x5dab7e),_0x41e7e6=_0x8713a3[_0x2a4961(0x231)](_0x5dfd73);if(_0x41e7e6&&_0x41e7e6[_0x2a4961(0x1cc)]>0x0){const _0x5e2523=_0x490093[_0x2a4961(0x231)](_0x5dfd73)||0x0,_0x3daae7=_0x41e7e6[_0x5e2523]||_0x41e7e6[_0x41e7e6[_0x2a4961(0x1cc)]-0x1];_0x490093[_0x2a4961(0x215)](_0x5dfd73,_0x5e2523+0x1),_0x581e4f=_0x3daae7,_0x4b64ba[_0x2a4961(0x25d)](_0x581e4f),_0x29faf7[_0x2a4961(0x215)](_0x2329ce,_0x581e4f);const _0x995197=await resolveRuleSegmentRefs(_0x11e727,async _0xf4fa64=>{const _0x5f033e=_0x2a4961,_0x324418=_0x29faf7[_0x5f033e(0x231)](_0xf4fa64);if(_0x324418)return _0x324418;const _0x50be41=await _0x3df27b['resolveSegment'](_0xf4fa64);return _0x50be41['name'];});_0x458249={'description':_0x58662e['description'],'rule':_0x995197};}else{const _0x2a66f7=_0x3bc4fe['get'](_0x5dfd73);if(_0x2a66f7)_0x581e4f=_0x2a66f7,_0x29faf7[_0x2a4961(0x215)](_0x2329ce,_0x581e4f);else{if(_0x14779a){let _0x1d2ecf=_0x14779a,_0x5f1e79=0x2;while(_0x4b64ba['has'](_0x1d2ecf)||_0x177c9e[_0x2a4961(0x190)](_0x1d2ecf)){_0x1d2ecf=_0x14779a+'_'+_0x5f1e79,_0x5f1e79++;}_0x4b64ba[_0x2a4961(0x25d)](_0x1d2ecf),_0x581e4f=_0x1d2ecf;}_0x29faf7[_0x2a4961(0x215)](_0x2329ce,_0x581e4f),_0x3bc4fe['set'](_0x5dfd73,_0x581e4f);const _0x188b34=await resolveRuleSegmentRefs(_0x11e727,async _0x4a820a=>{const _0xc13c42=_0x2a4961,_0x274015=_0x29faf7[_0xc13c42(0x231)](_0x4a820a);if(_0x274015)return _0x274015;const _0x134ae3=await _0x3df27b['resolveSegment'](_0x4a820a);return _0x134ae3[_0xc13c42(0x1ee)];});_0x458249={'description':_0x58662e['description'],'rule':_0x188b34};}}}return{'name':_0x581e4f,'isJourneyLocal':_0x335e12,'definition':_0x458249};}catch(_0x42410a){return logger[_0x2a4961(0x237)]('Failed\x20to\x20resolve\x20segment\x20'+_0x2329ce+':\x20'+_0x42410a),{'name':_0x2329ce,'isJourneyLocal':![]};}},'resolveActivation':async _0x314d1b=>{const _0x3fe11f=a128_0x2d4b,_0x33576c=_0x286cc6[_0x3fe11f(0x231)](_0x314d1b);if(_0x33576c!==undefined)return{'name':_0x33576c,'isJourneyLocal':!![]};try{let _0x3f4250=_0x5d573c?.[_0x3fe11f(0x231)](_0x314d1b);!_0x3f4250&&(_0x3f4250=await _0x3f5ed4[_0x3fe11f(0x265)][_0x3fe11f(0x25f)](_0x270a0b,_0x314d1b));const _0x57bda9=_0x3f4250[_0x3fe11f(0x26e)]['activationParams'][_0x3fe11f(0x1ee)]||_0x314d1b,_0x362513=sanitizeYamlKey(_0x57bda9)||_0x3fe11f(0x197)+_0x314d1b,_0xcef505=_0x362513;_0x286cc6[_0x3fe11f(0x215)](_0x314d1b,_0xcef505);const _0x125bb1=journeyActivationStepToYaml(_0x3f4250,_0x202ebf,_0x286e12);return{'name':_0xcef505,'isJourneyLocal':!![],'definition':_0x125bb1};}catch(_0x3b7047){return logger[_0x3fe11f(0x237)](_0x3fe11f(0x25e)+_0x314d1b+':\x20'+_0x3b7047),{'name':_0x314d1b,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x21204b,_0x368e94)=>resolveJumpTarget(_0x21204b,_0x368e94,_0x10bc7f,async _0xe0acb5=>{const _0x34a40d=a128_0x2d4b,_0x1944ec=_0x4c6f84?.[_0x34a40d(0x231)](_0xe0acb5);if(_0x1944ec)return _0x1944ec;return _0x3f5ed4[_0x34a40d(0x265)][_0x34a40d(0x1b8)](_0xe0acb5);})};return _0x3df27b=_0x480f09,_0x480f09;},_0x4a2133=async _0x228d99=>{const _0x21fbe5=a128_0x2d4b,{collectSegmentIdsFromJourneyApi:_0xe7233}=await import('./journey-yaml.js'),{batchAsync:_0x5ac3cf}=await import(_0x21fbe5(0x20e)),_0x587fb=new Set();for(const _0x26f0ca of _0x228d99){let _0x564336=_0x4c6f84?.['get'](_0x26f0ca);!_0x564336&&(_0x564336=await _0x3f5ed4['journey'][_0x21fbe5(0x1b8)](_0x26f0ca));const _0x81651d=_0xe7233(_0x564336);for(const _0x39325b of _0x81651d){_0x587fb['add'](_0x39325b);}}let _0x5713cf=Array[_0x21fbe5(0x1bd)](_0x587fb);while(_0x5713cf[_0x21fbe5(0x1cc)]>0x0){const _0x8706=_0x5713cf[_0x21fbe5(0x1cf)](_0x19a9fa=>!_0x152ef1['has'](_0x19a9fa));if(_0x8706[_0x21fbe5(0x1cc)]===0x0)break;const _0x483eac=await _0x5ac3cf(_0x8706,async _0x3f3495=>{const _0x50a753=_0x21fbe5;_0x152ef1[_0x50a753(0x25d)](_0x3f3495);const _0x2199f0=await fetchSegment(_0x3f5ed4,_0x3512f9,_0x3f3495,_0xd138d1);if(!_0x2199f0)return null;return{'segmentId':_0x3f3495,'segment':_0x2199f0};},0xa),_0xa940ce=new Set();for(const _0x3d5558 of _0x483eac){if(!_0x3d5558?.['segment']?.[_0x21fbe5(0x19a)])continue;const _0x1eb9c6=apiRuleToYaml(_0x3d5558[_0x21fbe5(0x217)][_0x21fbe5(0x19a)]);_0x5dab7e[_0x21fbe5(0x215)](_0x3d5558[_0x21fbe5(0x235)],_0x1eb9c6);const _0x1e3bdf=collectSegmentRefsFromRule(_0x1eb9c6);for(const _0x598df0 of _0x1e3bdf){!_0x152ef1[_0x21fbe5(0x190)](_0x598df0)&&_0xa940ce[_0x21fbe5(0x25d)](_0x598df0);}}_0x5713cf=Array[_0x21fbe5(0x1bd)](_0xa940ce);}};return{'createYamlContext':_0x35c7d8,'prefetchJourneySegments':_0x4a2133};}export async function executePushSegments(_0x440c13,_0x53189b,_0x1a4754,_0x3651e7,_0x1775e8){const _0xc398d7=a128_0x5352b9,{segmentDefToCreateRequest:_0x2e31df,segmentDefToUpdateRequest:_0x5e2949}=await import(_0xc398d7(0x26c)),_0x189dd6=_0x1a4754['folderPathToId'],_0x556f26=0x5,_0x34bda9=async _0x118676=>{const _0xe52332=_0xc398d7,_0x205f77=_0x118676[_0xe52332(0x1ba)]?_0x189dd6['get'](_0x118676['folderPath']):undefined;let _0x3cce6e;const _0x2deddd={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x118676['isNew']){_0x1775e8[_0xe52332(0x196)]?.({'type':_0xe52332(0x1b0),'name':_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)]});const _0x4ec11e=_0x2e31df(_0x118676[_0xe52332(0x263)],_0x205f77),_0x5b700e=await _0x1775e8[_0xe52332(0x27b)]('Creating\x20segment\x20\x27'+_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)]+_0xe52332(0x246),()=>_0x440c13['segment'][_0xe52332(0x27e)](_0x3651e7['parentId'],_0x4ec11e));_0x3cce6e=_0x5b700e['data']['id'],_0x2deddd[_0xe52332(0x1d9)]={'name':_0x118676['yamlConfig']['name'],'id':_0x3cce6e},_0x1775e8[_0xe52332(0x196)]?.({'type':'segment_created','name':_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)],'segmentId':_0x3cce6e}),_0x1775e8[_0xe52332(0x233)]?.(_0xe52332(0x21c)+_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)]+'\x27'),_0x2deddd[_0xe52332(0x236)]=0x1;}else{if(_0x118676[_0xe52332(0x194)]){_0x1775e8[_0xe52332(0x196)]?.({'type':_0xe52332(0x1a5),'name':_0x118676['yamlConfig'][_0xe52332(0x1ee)]});const _0x4ca39f=_0x5e2949(_0x118676[_0xe52332(0x263)]);_0x205f77!==_0x118676['existingSegment']?.[_0xe52332(0x1c0)]&&(_0x4ca39f[_0xe52332(0x1c0)]=_0x205f77?parseInt(_0x205f77,0xa):undefined),await _0x1775e8[_0xe52332(0x27b)](_0xe52332(0x18b)+_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)]+_0xe52332(0x246),()=>_0x440c13[_0xe52332(0x217)][_0xe52332(0x280)](_0x3651e7['parentId'],_0x118676[_0xe52332(0x279)]['id'],_0x4ca39f)),_0x3cce6e=_0x118676[_0xe52332(0x279)]['id'],_0x1775e8[_0xe52332(0x196)]?.({'type':_0xe52332(0x1b9),'name':_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)]}),_0x1775e8[_0xe52332(0x233)]?.(_0xe52332(0x258)+_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)]+'\x27'),_0x2deddd[_0xe52332(0x26f)]=0x1;}else _0x3cce6e=_0x118676[_0xe52332(0x279)]['id'];}}catch(_0x95be32){const _0x539316=isHttp400Error(_0x95be32),_0x28643d=_0x539316?ErrorCode[_0xe52332(0x24c)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x3b3233=getErrorMessage(_0x95be32);throw new SDKError(_0x28643d,_0xe52332(0x19d)+(_0x118676['isNew']?_0xe52332(0x1ca):_0xe52332(0x22b))+_0xe52332(0x1df)+_0x118676['absolutePath']+_0xe52332(0x20f)+_0x3b3233,_0x95be32);}try{const _0x4ca3b7=await syncActivationsForSegment(_0x440c13,_0x3651e7[_0xe52332(0x198)],_0x3cce6e,_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)],_0x118676[_0xe52332(0x204)],_0x1775e8,_0x118676[_0xe52332(0x239)]);_0x2deddd['activations']=_0x4ca3b7;}catch(_0x219802){if(_0x219802 instanceof SDKError)throw _0x219802;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xe52332(0x269)+_0x118676[_0xe52332(0x263)][_0xe52332(0x1ee)]+_0xe52332(0x1af)+_0x118676[_0xe52332(0x239)]+'\x0a\x20\x20'+getErrorMessage(_0x219802),_0x219802);}return _0x2deddd;},_0x1243a4=await batchAsync(_0x53189b,_0x34bda9,_0x556f26),_0x577a01={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x43613c of _0x1243a4){_0x577a01[_0xc398d7(0x236)]+=_0x43613c[_0xc398d7(0x236)],_0x577a01[_0xc398d7(0x26f)]+=_0x43613c[_0xc398d7(0x26f)],_0x43613c[_0xc398d7(0x1d9)]&&_0x577a01[_0xc398d7(0x1c4)][_0xc398d7(0x215)](_0x43613c[_0xc398d7(0x1d9)][_0xc398d7(0x1ee)],_0x43613c[_0xc398d7(0x1d9)]['id']),_0x577a01[_0xc398d7(0x1be)][_0xc398d7(0x236)]+=_0x43613c[_0xc398d7(0x1be)][_0xc398d7(0x236)],_0x577a01[_0xc398d7(0x1be)][_0xc398d7(0x26f)]+=_0x43613c[_0xc398d7(0x1be)][_0xc398d7(0x26f)],_0x577a01[_0xc398d7(0x1be)][_0xc398d7(0x257)]+=_0x43613c['activations'][_0xc398d7(0x257)];}return _0x577a01;}async function syncActivationsForSegment(_0x470e07,_0x28c839,_0x45bd6d,_0x24e60b,_0x3251cd,_0x466364,_0x1ed3f8){const _0x229cdc=a128_0x5352b9,_0x57489a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1e22a3 of _0x3251cd){try{if(_0x1e22a3[_0x229cdc(0x230)]==='create'&&_0x1e22a3[_0x229cdc(0x1b4)])_0x466364[_0x229cdc(0x196)]?.({'type':_0x229cdc(0x18c),'segmentName':_0x24e60b,'activationName':_0x1e22a3['name']}),await _0x466364[_0x229cdc(0x27b)]('Creating\x20activation\x20\x27'+_0x1e22a3[_0x229cdc(0x1ee)]+_0x229cdc(0x246),()=>_0x470e07[_0x229cdc(0x217)][_0x229cdc(0x1c8)](_0x28c839,_0x45bd6d,_0x1e22a3[_0x229cdc(0x1b4)])),_0x466364[_0x229cdc(0x196)]?.({'type':'activation_created','segmentName':_0x24e60b,'activationName':_0x1e22a3['name']}),_0x466364['logSuccess']?.('Created\x20activation\x20\x27'+_0x1e22a3[_0x229cdc(0x1ee)]+'\x27'),_0x57489a[_0x229cdc(0x236)]++;else{if(_0x1e22a3[_0x229cdc(0x230)]===_0x229cdc(0x22b)&&_0x1e22a3['validatedRequest']&&_0x1e22a3[_0x229cdc(0x1d4)])_0x466364[_0x229cdc(0x196)]?.({'type':_0x229cdc(0x220),'segmentName':_0x24e60b,'activationName':_0x1e22a3[_0x229cdc(0x1ee)]}),await _0x466364[_0x229cdc(0x27b)](_0x229cdc(0x18f)+_0x1e22a3[_0x229cdc(0x1ee)]+_0x229cdc(0x246),()=>_0x470e07[_0x229cdc(0x217)][_0x229cdc(0x23d)](_0x28c839,_0x45bd6d,_0x1e22a3[_0x229cdc(0x1d4)]['id'],_0x1e22a3['validatedRequest'])),_0x466364[_0x229cdc(0x196)]?.({'type':_0x229cdc(0x1c1),'segmentName':_0x24e60b,'activationName':_0x1e22a3[_0x229cdc(0x1ee)]}),_0x466364[_0x229cdc(0x233)]?.(_0x229cdc(0x228)+_0x1e22a3['name']+'\x27'),_0x57489a[_0x229cdc(0x26f)]++;else _0x1e22a3['type']===_0x229cdc(0x232)&&_0x1e22a3[_0x229cdc(0x1d4)]&&(_0x466364[_0x229cdc(0x196)]?.({'type':'activation_deleting','segmentName':_0x24e60b,'activationName':_0x1e22a3['name']}),await _0x466364['withProgress'](_0x229cdc(0x1cb)+_0x1e22a3[_0x229cdc(0x1ee)]+_0x229cdc(0x246),()=>_0x470e07[_0x229cdc(0x217)]['deleteActivation'](_0x28c839,_0x45bd6d,_0x1e22a3[_0x229cdc(0x1d4)]['id'])),_0x466364['onProgress']?.({'type':'activation_deleted','segmentName':_0x24e60b,'activationName':_0x1e22a3[_0x229cdc(0x1ee)]}),_0x466364[_0x229cdc(0x1fb)]?.(_0x229cdc(0x1d6)+_0x1e22a3['name']+'\x27'),_0x57489a['deleted']++);}}catch(_0x5836cf){const _0x27cdea=isHttp400Error(_0x5836cf),_0x56eb10=_0x27cdea?ErrorCode[_0x229cdc(0x1e1)]:ErrorCode[_0x229cdc(0x21b)],_0x5d5ae6=getErrorMessage(_0x5836cf);throw new SDKError(_0x56eb10,_0x229cdc(0x19d)+_0x1e22a3[_0x229cdc(0x230)]+_0x229cdc(0x1a8)+_0x1e22a3[_0x229cdc(0x1ee)]+_0x229cdc(0x1af)+_0x1ed3f8+'\x0a\x20\x20'+_0x5d5ae6,_0x5836cf);}}return _0x57489a;}export async function executePushFolders(_0xbd0295,_0x1c4e51,_0x535cb8,_0x5a067a,_0x1f63b9){const _0x116950=a128_0x5352b9,_0x2308bb=new Map(_0x535cb8),_0x2093f5=sortFoldersByDepth(_0x1c4e51);for(const _0x50ce32 of _0x2093f5){const _0x499d61=_0x50ce32[_0x116950(0x20d)]('/'),_0x487133=_0x499d61[_0x499d61[_0x116950(0x1cc)]-0x1],_0x92a415=_0x499d61[_0x116950(0x1ec)](0x0,-0x1)[_0x116950(0x282)]('/'),_0x453beb=_0x2308bb[_0x116950(0x231)](_0x92a415);_0x1f63b9[_0x116950(0x196)]?.({'type':_0x116950(0x213),'folder':_0x50ce32});const _0x4b924={'name':_0x487133,'parentFolderId':_0x453beb},_0x169ed9=await _0x1f63b9[_0x116950(0x27b)]('Creating\x20folder\x20\x27'+_0x50ce32+'\x27...',()=>_0xbd0295['segment'][_0x116950(0x22f)](_0x5a067a[_0x116950(0x198)],_0x4b924));_0x2308bb[_0x116950(0x215)](_0x50ce32,_0x169ed9[_0x116950(0x1a4)]['id']),_0x1f63b9[_0x116950(0x196)]?.({'type':'folder_created','folder':_0x50ce32,'folderId':_0x169ed9[_0x116950(0x1a4)]['id']}),_0x1f63b9[_0x116950(0x1bb)]?.(_0x116950(0x260)+_0x50ce32+'\x27');}return _0x2308bb;}export async function executePushSegmentDeletions(_0x291276,_0x2a26a8,_0x5bdd3c){const _0x1abc47=a128_0x5352b9;if(_0x2a26a8[_0x1abc47(0x1cc)]===0x0)return 0x0;const {batchAsync:_0x88b3bd}=await import(_0x1abc47(0x20e)),_0x1d5cfa=0x5,_0x54c8f0=await _0x88b3bd(_0x2a26a8,async _0x457e62=>{const _0x4cec49=_0x1abc47;return _0x5bdd3c['onProgress']?.({'type':_0x4cec49(0x1e6),'name':_0x457e62[_0x4cec49(0x1ee)]}),await _0x291276[_0x4cec49(0x217)]['deleteSegment'](_0x457e62['id']),_0x5bdd3c[_0x4cec49(0x196)]?.({'type':_0x4cec49(0x216),'name':_0x457e62[_0x4cec49(0x1ee)]}),_0x5bdd3c['logDeleted']?.(_0x4cec49(0x218)+_0x457e62[_0x4cec49(0x1ee)]+'\x27'),0x1;},_0x1d5cfa);return _0x54c8f0['reduce']((_0x43f2c9,_0x4b025a)=>_0x43f2c9+_0x4b025a,0x0);}export async function executePushJourneys(_0x49a67f,_0x1f221f,_0x5c8cf7,_0x780eb8,_0x31c740){const _0x47d934=a128_0x5352b9,{journeyDefToRequest:_0x2969b6}=await import(_0x47d934(0x270)),{activationDefToCreateRequest:_0x128eee,yamlRuleToApi:_0x2b0a8b,validateSegmentRule:_0x1f9262}=await import('./child-segment-yaml.js'),_0x394363={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1825e7=new Map(_0x5c8cf7[_0x47d934(0x1f7)]),_0xdebc1b=0x5;for(let _0x4b807d=0x0;_0x4b807d<_0x1f221f['length'];_0x4b807d+=_0xdebc1b){const _0x4f7205=_0x1f221f[_0x47d934(0x1ec)](_0x4b807d,_0x4b807d+_0xdebc1b),_0x26fd5a=await Promise[_0x47d934(0x25b)](_0x4f7205[_0x47d934(0x22d)](async _0x3004f8=>{const _0x2e3fc0=_0x47d934;if(!_0x3004f8[_0x2e3fc0(0x281)]&&!_0x3004f8['hasChanges'])return{'action':'unchanged','name':_0x3004f8[_0x2e3fc0(0x263)][_0x2e3fc0(0x1ee)],'journeyId':_0x3004f8[_0x2e3fc0(0x185)]?.['id']};const _0x333cfd=_0x3004f8[_0x2e3fc0(0x1ba)]?_0x5c8cf7[_0x2e3fc0(0x1de)][_0x2e3fc0(0x231)](_0x3004f8['folderPath']):undefined;_0x31c740[_0x2e3fc0(0x196)]?.({'type':_0x3004f8['isNew']?_0x2e3fc0(0x240):_0x2e3fc0(0x209),'name':_0x3004f8['yamlConfig'][_0x2e3fc0(0x1ee)]});try{const _0x11149f=await executeSingleJourneyPush(_0x49a67f,_0x3004f8,{..._0x5c8cf7,'segmentNameToId':_0x1825e7},{'parentId':_0x780eb8['parentId'],'rootFolderId':_0x780eb8[_0x2e3fc0(0x205)],'folderId':_0x333cfd,'verbose':_0x780eb8[_0x2e3fc0(0x1e4)]},_0x31c740,{'journeyDefToRequest':_0x2969b6,'activationDefToCreateRequest':_0x128eee,'yamlRuleToApi':_0x2b0a8b,'validateSegmentRule':_0x1f9262});for(const [_0x1b2533,_0x1cc1af]of _0x11149f[_0x2e3fc0(0x20b)]){_0x1825e7[_0x2e3fc0(0x215)](_0x1b2533,_0x1cc1af),_0x394363[_0x2e3fc0(0x20b)][_0x2e3fc0(0x215)](_0x1b2533,_0x1cc1af);}if(_0x11149f['action']===_0x2e3fc0(0x236))_0x31c740[_0x2e3fc0(0x196)]?.({'type':_0x2e3fc0(0x1db),'name':_0x3004f8[_0x2e3fc0(0x263)][_0x2e3fc0(0x1ee)],'journeyId':_0x11149f[_0x2e3fc0(0x1ad)]}),_0x31c740['logSuccess']?.(_0x2e3fc0(0x1ff)+_0x3004f8[_0x2e3fc0(0x263)]['name']+'\x27'),_0x394363[_0x2e3fc0(0x236)]++;else _0x11149f[_0x2e3fc0(0x1c3)]===_0x2e3fc0(0x26f)&&(_0x31c740[_0x2e3fc0(0x196)]?.({'type':'journey_updated','name':_0x3004f8[_0x2e3fc0(0x263)]['name']}),_0x31c740['logSuccess']?.(_0x2e3fc0(0x1c6)+_0x3004f8[_0x2e3fc0(0x263)][_0x2e3fc0(0x1ee)]+'\x27'),_0x394363[_0x2e3fc0(0x26f)]++);return{'action':_0x11149f[_0x2e3fc0(0x1c3)],'name':_0x3004f8['yamlConfig']['name'],'journeyId':_0x11149f[_0x2e3fc0(0x1ad)]};}catch(_0x4ab9e7){const _0x3771e5=isHttp400Error(_0x4ab9e7),_0x28ba3c=_0x3771e5?ErrorCode[_0x2e3fc0(0x1c5)]:ErrorCode[_0x2e3fc0(0x18e)],_0x116028=getErrorMessage(_0x4ab9e7);throw new SDKError(_0x28ba3c,'Failed\x20to\x20'+(_0x3004f8[_0x2e3fc0(0x281)]?_0x2e3fc0(0x1ca):_0x2e3fc0(0x22b))+_0x2e3fc0(0x1f3)+_0x3004f8[_0x2e3fc0(0x239)]+_0x2e3fc0(0x20f)+_0x116028,_0x4ab9e7);}}));_0x394363['results'][_0x47d934(0x1e0)](..._0x26fd5a);}return _0x394363;}async function matchExistingJourneySegments(_0x3e3495,_0xcb0870,_0x53f7d2,_0xedba48,_0x1b05b0){const _0x212030=a128_0x5352b9;if(!_0xcb0870[_0x212030(0x185)]||!_0xcb0870[_0x212030(0x263)][_0x212030(0x271)])return;const _0xc713d9=new Map(),_0x2f0abf=new Set();for(const _0x114cad of Object[_0x212030(0x1ce)](_0xcb0870[_0x212030(0x263)][_0x212030(0x271)])){const _0x4516fa=generateDeterministicJourneySegmentName(_0xcb0870[_0x212030(0x263)]['name'],_0x114cad);_0xc713d9[_0x212030(0x215)](_0x4516fa,_0x114cad),_0x2f0abf[_0x212030(0x25d)](_0x114cad);}const _0x418195=[],_0x25ca1f=collectSegmentIdsFromJourneyApi(_0xcb0870['existingJourney']);for(const _0x4cd6b2 of _0x25ca1f){const _0x421df7=await fetchSegment(_0x3e3495,_0x53f7d2,_0x4cd6b2,_0xedba48);if(!_0x421df7?.[_0x212030(0x1ee)])continue;const _0x1723f2=_0xc713d9[_0x212030(0x231)](_0x421df7['name']);_0x1723f2?(_0x1b05b0[_0x212030(0x215)](_0x1723f2,_0x4cd6b2),_0x2f0abf[_0x212030(0x232)](_0x1723f2)):_0x418195[_0x212030(0x1e0)]({'id':_0x4cd6b2,'seg':_0x421df7});}if(_0x2f0abf[_0x212030(0x253)]>0x0&&_0x418195[_0x212030(0x1cc)]>0x0){const {localExpandedRuleToNames:_0x195485}=buildLocalExpandedRuleMappings(_0xcb0870[_0x212030(0x263)]),_0x47d893=new Map();for(const {id:_0x3179f8,seg:_0x37f296}of _0x418195){if(_0x37f296[_0x212030(0x19a)]){const _0x1aa389=apiRuleToYaml(_0x37f296[_0x212030(0x19a)]);_0x47d893[_0x212030(0x215)](_0x3179f8,_0x1aa389);}}for(const {id:_0xe0f1bf,seg:_0xa311a1}of _0x418195){if(!_0xa311a1[_0x212030(0x19a)])continue;const _0x40594c=_0x47d893[_0x212030(0x231)](_0xe0f1bf);if(!_0x40594c)continue;const _0x9f3c86=serializeExpandedRule(_0x40594c,_0x47d893),_0x9d8fe8=_0x195485[_0x212030(0x231)](_0x9f3c86);if(_0x9d8fe8){const _0x3d2694=_0x9d8fe8[_0x212030(0x1fe)](_0x53bd35=>_0x2f0abf[_0x212030(0x190)](_0x53bd35));_0x3d2694&&(_0x1b05b0[_0x212030(0x215)](_0x3d2694,_0xe0f1bf),_0x2f0abf[_0x212030(0x232)](_0x3d2694),logger['debug'](_0x212030(0x1b3)+_0xa311a1[_0x212030(0x1ee)]+'\x27\x20to\x20local\x20\x27'+_0x3d2694+_0x212030(0x1ac)));}}}}async function executeSingleJourneyPush(_0x4f93ca,_0x4fe158,_0x457ed6,_0x1afd01,_0x59191b,_0x33b4a9){const _0x287a06=a128_0x5352b9,{journeyDefToRequest:_0x4a7c87,activationDefToCreateRequest:_0x2581d8,yamlRuleToApi:_0x1cd80d,validateSegmentRule:_0x51f89b}=_0x33b4a9,_0x5d4694=new Map(),_0xb12793=new Map();recoverSegmentIdsFromPushRecovery(_0x4fe158,_0x5d4694,_0x457ed6['segmentNameToId']);const _0x24ef5e=new Map(),_0x590224=new Map(),_0x4faf46=new Map();let _0x2ccfe8;const _0x3611f3=async()=>{const _0x52a0df=a128_0x2d4b;if(_0x2ccfe8)return;_0x2ccfe8=new Map();if(!_0x4fe158['existingJourney'])return;const _0x2291ee=await _0x4f93ca[_0x52a0df(0x265)][_0x52a0df(0x222)](_0x4fe158[_0x52a0df(0x185)]['id']);for(const _0x4481b9 of _0x2291ee){const _0x49bc55=journeyActivationStepToYaml(_0x4481b9,_0x457ed6['idToEmailMap'],_0x457ed6[_0x52a0df(0x272)]),_0x26f40f=activationSignature(_0x49bc55);!_0x2ccfe8[_0x52a0df(0x190)](_0x26f40f)&&_0x2ccfe8[_0x52a0df(0x215)](_0x26f40f,_0x4481b9['id']),_0x49bc55[_0x52a0df(0x1ee)]&&_0xb12793['set'](_0x49bc55[_0x52a0df(0x1ee)],_0x4481b9['id']);}};await matchExistingJourneySegments(_0x4f93ca,_0x4fe158,_0x1afd01['parentId'],_0x457ed6['existingSegments'],_0x457ed6[_0x287a06(0x1f7)]);const _0x2fd522={'resolveSegmentId':async _0x553cfb=>{const _0x375538=_0x287a06,_0x1516d5=_0x457ed6[_0x375538(0x1f7)]['get'](_0x553cfb);if(!_0x1516d5)throw new SDKError(ErrorCode[_0x375538(0x274)],'Segment\x20not\x20found:\x20'+_0x553cfb+_0x375538(0x266)+_0x4fe158[_0x375538(0x263)]['name']+')');return _0x1516d5;},'resolveEmbeddedSegmentId':async(_0x4c7e7f,_0x18d58b)=>{const _0x51d02d=_0x287a06,_0x539833=_0x457ed6[_0x51d02d(0x1f7)][_0x51d02d(0x231)](_0x4c7e7f);if(_0x539833)return _0x539833;const _0x49e83e=_0x457ed6[_0x51d02d(0x1f0)][_0x51d02d(0x1fe)](_0x1a3db=>_0x1a3db[_0x51d02d(0x1ee)]===_0x4c7e7f);if(_0x49e83e)return _0x457ed6[_0x51d02d(0x1f7)][_0x51d02d(0x215)](_0x4c7e7f,_0x49e83e['id']),_0x49e83e['id'];if(_0x4fe158[_0x51d02d(0x281)]){const {stageName:_0x347bff,criteriaName:_0x2f22d3}=findSegmentCriteriaLocation(_0x4fe158[_0x51d02d(0x263)],_0x4c7e7f);return _0x51f89b(_0x4c7e7f,_0x18d58b[_0x51d02d(0x19a)]),_0x590224[_0x51d02d(0x215)](_0x4c7e7f,{'definition':_0x18d58b,'stageName':_0x347bff,'criteriaName':_0x2f22d3}),createPendingSegmentId(_0x4c7e7f);}const _0x8ef130=_0x4fe158[_0x51d02d(0x185)]?.['id'];if(!_0x8ef130)throw new SDKError(ErrorCode[_0x51d02d(0x238)],_0x51d02d(0x1ab));const _0x355c19=_0x24ef5e[_0x51d02d(0x231)](_0x4c7e7f);if(_0x355c19)return _0x355c19;const _0x2c4140=((async()=>{const _0xcb65b9=_0x51d02d;_0x51f89b(_0x4c7e7f,_0x18d58b[_0xcb65b9(0x19a)]);const _0x5be8df=generateDeterministicJourneySegmentName(_0x4fe158['yamlConfig']['name'],_0x4c7e7f),_0x3b81a0=_0x457ed6[_0xcb65b9(0x1f0)][_0xcb65b9(0x1fe)](_0x159d76=>_0x159d76[_0xcb65b9(0x1ee)]===_0x5be8df),_0xf2f0b=createSegmentIdResolver(_0x457ed6[_0xcb65b9(0x1f7)],_0x4c7e7f),_0x1fa536=await resolveRuleSegmentIds(_0x18d58b[_0xcb65b9(0x19a)],_0xf2f0b);let _0xe3ee19;return _0x3b81a0?(await _0x4f93ca['segment']['updateSegmentById'](_0x1afd01[_0xcb65b9(0x198)],_0x3b81a0['id'],{'description':_0x18d58b[_0xcb65b9(0x208)]||'Entry\x20criteria:\x20'+_0x4c7e7f,'rule':_0x1cd80d(_0x1fa536,!![]),'countPopulation':!![]}),_0xe3ee19=_0x3b81a0['id'],saveSegmentToPushRecovery(_0x4fe158['absolutePath'],_0x4fe158[_0xcb65b9(0x263)]['name'],_0x4c7e7f,{'segmentId':_0xe3ee19,'uniqueServerName':_0x5be8df,'createdAt':new Date()['toISOString']()})):_0xe3ee19=await createOrRecoverEmbeddedSegment(_0x4f93ca,_0x4fe158,{'localName':_0x4c7e7f,'uniqueSegmentName':_0x5be8df,'description':_0x18d58b[_0xcb65b9(0x208)]||_0xcb65b9(0x1bc)+_0x4c7e7f,'journeyId':_0x8ef130,'resolvedRule':_0x1fa536,'parentId':_0x1afd01[_0xcb65b9(0x198)],'folderId':_0x1afd01[_0xcb65b9(0x205)]||''},_0x1cd80d),_0x457ed6[_0xcb65b9(0x1f7)][_0xcb65b9(0x215)](_0x4c7e7f,_0xe3ee19),_0x5d4694[_0xcb65b9(0x215)](_0x4c7e7f,_0xe3ee19),_0xe3ee19;})());_0x24ef5e['set'](_0x4c7e7f,_0x2c4140);try{return await _0x2c4140;}finally{_0x24ef5e[_0x51d02d(0x232)](_0x4c7e7f);}},'resolveActivationId':async _0x1629d8=>{const _0x482858=_0x287a06,_0x5159db=_0xb12793[_0x482858(0x231)](_0x1629d8);if(_0x5159db)return _0x5159db;if(_0x4fe158[_0x482858(0x185)]){await _0x3611f3();const _0xffdc95=_0xb12793['get'](_0x1629d8);if(_0xffdc95)return _0xffdc95;}throw new SDKError(ErrorCode[_0x482858(0x26d)],_0x482858(0x203)+_0x1629d8+_0x482858(0x266)+_0x4fe158[_0x482858(0x263)]['name']+_0x482858(0x1d3)+_0x482858(0x186));},'resolveEmbeddedActivationId':async(_0x428f22,_0x341fb8)=>{const _0x25eae1=_0x287a06,_0x4795b5=_0xb12793['get'](_0x428f22);if(_0x4795b5)return _0x4795b5;if(_0x4fe158[_0x25eae1(0x281)])return _0x4faf46[_0x25eae1(0x215)](_0x428f22,_0x341fb8),createPendingActivationId(_0x428f22);if(_0x4fe158['existingJourney']){await _0x3611f3();const _0x3cae2f=_0xb12793[_0x25eae1(0x231)](_0x341fb8[_0x25eae1(0x1ee)]);if(_0x3cae2f)return _0xb12793[_0x25eae1(0x215)](_0x428f22,_0x3cae2f),_0x3cae2f;const _0x242cc2=activationSignature(_0x341fb8),_0x56a8f5=_0x2ccfe8?.[_0x25eae1(0x231)](_0x242cc2);if(_0x56a8f5)return _0xb12793['set'](_0x428f22,_0x56a8f5),_0x56a8f5;const _0x3209c0=await _0x2581d8(_0x341fb8,_0x457ed6['activationContext']),_0x588a2b={..._0x3209c0,..._0x341fb8[_0x25eae1(0x1e7)]!==undefined&&{'runAfterJourneyRefresh':_0x341fb8[_0x25eae1(0x1e7)]}},_0x3660b3=await _0x4f93ca['journey'][_0x25eae1(0x1c8)](_0x4fe158[_0x25eae1(0x185)]['id'],_0x588a2b);return _0xb12793['set'](_0x428f22,_0x3660b3['id']),_0x3660b3['id'];}throw new SDKError(ErrorCode[_0x25eae1(0x238)],_0x25eae1(0x184));},'resolveJourneyId':async _0x1d70ca=>{const _0x2cc5af=_0x287a06;try{return await _0x4f93ca[_0x2cc5af(0x265)][_0x2cc5af(0x1a2)](_0x1afd01[_0x2cc5af(0x198)],_0x1d70ca);}catch(_0x19f64d){throw new SDKError(ErrorCode[_0x2cc5af(0x26d)],'Journey\x20\x27'+_0x1d70ca+_0x2cc5af(0x278)+_0x4fe158['yamlConfig']['name']+'\x27)',_0x19f64d);}},'resolveStageId':async(_0x69ea64,_0x56e75e)=>{const _0x3dea93=_0x287a06,_0x21181d=await _0x4f93ca[_0x3dea93(0x265)][_0x3dea93(0x1b8)](_0x69ea64),_0x5c7de6=_0x21181d[_0x3dea93(0x26e)][_0x3dea93(0x193)][_0x3dea93(0x1fe)](_0xd83a34=>_0xd83a34[_0x3dea93(0x1ee)][_0x3dea93(0x1e9)]()===_0x56e75e[_0x3dea93(0x1e9)]());if(!_0x5c7de6?.['id'])throw new SDKError(ErrorCode[_0x3dea93(0x26d)],'Stage\x20\x27'+_0x56e75e+_0x3dea93(0x251)+(_0x21181d[_0x3dea93(0x26e)][_0x3dea93(0x207)]||_0x21181d[_0x3dea93(0x26e)][_0x3dea93(0x1ee)])+'\x27');return _0x5c7de6['id'];}},_0x61c7a9=await _0x4a7c87(_0x4fe158['yamlConfig'],_0x1afd01[_0x287a06(0x198)],_0x2fd522),_0x376384=_0x1afd01[_0x287a06(0x1b2)]||_0x1afd01[_0x287a06(0x205)];_0x376384&&(_0x61c7a9[_0x287a06(0x192)]={'parentFolder':{'data':{'id':_0x376384,'type':_0x287a06(0x27d)}}});if(_0x4fe158[_0x287a06(0x281)]){if(_0x590224['size']>0x0||_0x4faf46[_0x287a06(0x253)]>0x0)return await executeThreeStepJourneyCreate(_0x4f93ca,_0x4fe158,_0x61c7a9,{'pendingEmbeddedSegments':_0x590224,'pendingEmbeddedActivations':_0x4faf46,'embeddedSegmentNameToId':_0x5d4694,'journeyActivationNameToId':_0xb12793},{..._0x1afd01,'effectiveFolderId':_0x376384},_0x457ed6,_0x59191b,_0x33b4a9);else{ensureJourneyDefaults(_0x61c7a9[_0x287a06(0x26e)]);const _0x1ab5e4=await _0x4f93ca[_0x287a06(0x265)][_0x287a06(0x1ca)](_0x61c7a9);return deletePushRecovery(_0x4fe158[_0x287a06(0x239)]),{'action':_0x287a06(0x236),'journeyId':_0x1ab5e4['id'],'embeddedSegmentNameToId':_0x5d4694};}}else{if(_0x4fe158[_0x287a06(0x194)]&&_0x4fe158[_0x287a06(0x185)]){_0x61c7a9['id']=_0x4fe158['existingJourney']['id'];const _0x3da949=_0x61c7a9[_0x287a06(0x26e)];_0x4fe158[_0x287a06(0x185)][_0x287a06(0x26e)]?.[_0x287a06(0x207)]&&(_0x3da949[_0x287a06(0x207)]=_0x4fe158[_0x287a06(0x185)][_0x287a06(0x26e)][_0x287a06(0x207)]);const _0x4e80c6=_0x4fe158['existingJourney'][_0x287a06(0x26e)]?.['journeyStages'];return _0x4e80c6&&_0x61c7a9[_0x287a06(0x26e)][_0x287a06(0x193)]&&injectExistingStageIds(_0x61c7a9[_0x287a06(0x26e)]['journeyStages'],_0x4e80c6),ensureJourneyDefaults(_0x3da949),await _0x4f93ca[_0x287a06(0x265)]['update'](_0x4fe158[_0x287a06(0x185)]['id'],_0x61c7a9),deletePushRecovery(_0x4fe158[_0x287a06(0x239)]),{'action':'updated','journeyId':_0x4fe158['existingJourney']['id'],'embeddedSegmentNameToId':_0x5d4694};}}return deletePushRecovery(_0x4fe158[_0x287a06(0x239)]),{'action':_0x287a06(0x1b1),'journeyId':_0x4fe158['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5d4694};}function findSegmentCriteriaLocation(_0x436060,_0x40c441){const _0x149a40=a128_0x5352b9,_0xb1b787=_0x436060[_0x149a40(0x191)]||_0x436060[_0x149a40(0x23f)]?.[0x0]?.[_0x149a40(0x191)]||[];let _0x11abe3=_0x149a40(0x277),_0x42ce01=_0x40c441;const _0x6a0e3c=_0x436060['goal']||_0x436060[_0x149a40(0x23f)]?.[0x0]?.[_0x149a40(0x24a)];if(_0x6a0e3c?.[_0x149a40(0x217)]===_0x40c441)return{'stageName':_0x149a40(0x24a),'criteriaName':_0x6a0e3c[_0x149a40(0x1ee)]||_0x40c441};_0x439355:for(const _0x4ccecb of _0xb1b787){if(_0x4ccecb[_0x149a40(0x1f1)]?.[_0x149a40(0x217)]===_0x40c441){_0x11abe3=_0x4ccecb[_0x149a40(0x1ee)],_0x42ce01=_0x4ccecb[_0x149a40(0x1f1)][_0x149a40(0x1ee)]||_0x40c441;break;}if(_0x4ccecb[_0x149a40(0x200)])for(const _0x28c561 of _0x4ccecb['steps']){if(_0x28c561[_0x149a40(0x230)]==='decision_point'&&_0x28c561[_0x149a40(0x27f)]?.[_0x149a40(0x1da)])for(const _0x394be6 of _0x28c561[_0x149a40(0x27f)][_0x149a40(0x1da)]){if(_0x394be6[_0x149a40(0x217)]===_0x40c441){_0x11abe3=_0x4ccecb[_0x149a40(0x1ee)],_0x42ce01=_0x394be6['name']||_0x40c441;break _0x439355;}}}}return{'stageName':_0x11abe3,'criteriaName':_0x42ce01};}async function executeThreeStepJourneyCreate(_0x49586b,_0x9b29f3,_0x513e05,_0x685b7e,_0x183428,_0xf5b528,_0x2eacd5,_0x3ad265){const _0x240a59=a128_0x5352b9,{activationDefToCreateRequest:_0x23b1e,yamlRuleToApi:_0xd3994a}=_0x3ad265,{pendingEmbeddedSegments:_0x14d73e,pendingEmbeddedActivations:_0x4ceff8,embeddedSegmentNameToId:_0x4824cb}=_0x685b7e,_0x18cbf1=JSON[_0x240a59(0x245)](JSON[_0x240a59(0x23c)](_0x513e05));ensureJourneyDefaults(_0x18cbf1[_0x240a59(0x26e)]),stripPendingIds(_0x18cbf1);const _0x3b02f9=await _0x49586b[_0x240a59(0x265)][_0x240a59(0x1ca)](_0x18cbf1),_0x39e145=_0x3b02f9['id'],_0x367e5a=new Map();for(const _0x44da2b of _0x3b02f9[_0x240a59(0x26e)][_0x240a59(0x193)]){_0x367e5a[_0x240a59(0x215)](_0x44da2b[_0x240a59(0x1ee)][_0x240a59(0x1e9)](),_0x44da2b['id']);}recoverSegmentIdsFromPushRecovery(_0x9b29f3,_0x4824cb,_0xf5b528[_0x240a59(0x1f7)]);for(const [_0x53904b,{definition:_0x563146}]of _0x14d73e){if(_0x4824cb[_0x240a59(0x190)](_0x53904b)){_0x2eacd5[_0x240a59(0x196)]?.({'type':_0x240a59(0x1fa),'journeyName':_0x9b29f3[_0x240a59(0x263)][_0x240a59(0x1ee)],'segmentName':_0x53904b});continue;}const _0x1133bb=generateDeterministicJourneySegmentName(_0x9b29f3[_0x240a59(0x263)][_0x240a59(0x1ee)],_0x53904b);_0x2eacd5[_0x240a59(0x196)]?.({'type':'embedded_segment_creating','journeyName':_0x9b29f3[_0x240a59(0x263)][_0x240a59(0x1ee)],'segmentName':_0x53904b});const _0x3ce342=createSegmentIdResolver(_0xf5b528[_0x240a59(0x1f7)],_0x53904b),_0x52a130=await resolveRuleSegmentIds(_0x563146[_0x240a59(0x19a)],_0x3ce342),_0x13b73b=await createOrRecoverEmbeddedSegment(_0x49586b,_0x9b29f3,{'localName':_0x53904b,'uniqueSegmentName':_0x1133bb,'description':_0x563146[_0x240a59(0x208)]||_0x240a59(0x1bc)+_0x53904b,'journeyId':_0x39e145,'resolvedRule':_0x52a130,'parentId':_0x183428['parentId'],'folderId':_0x183428[_0x240a59(0x1ae)]||''},_0xd3994a);_0x4824cb[_0x240a59(0x215)](_0x53904b,_0x13b73b),_0xf5b528[_0x240a59(0x1f7)][_0x240a59(0x215)](_0x53904b,_0x13b73b),_0x2eacd5[_0x240a59(0x196)]?.({'type':'embedded_segment_created','journeyName':_0x9b29f3[_0x240a59(0x263)]['name'],'segmentName':_0x53904b});}const _0x361357=new Map();for(const [_0x53d751,_0x40e639]of _0x4ceff8){_0x2eacd5[_0x240a59(0x196)]?.({'type':_0x240a59(0x224),'journeyName':_0x9b29f3[_0x240a59(0x263)][_0x240a59(0x1ee)],'activationName':_0x53d751});const _0x3867b2=await _0x23b1e(_0x40e639,_0xf5b528[_0x240a59(0x21a)]),_0x2b6b8d={..._0x3867b2,..._0x40e639['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x40e639[_0x240a59(0x1e7)]}},_0x225a2b=await _0x49586b[_0x240a59(0x265)][_0x240a59(0x1c8)](_0x39e145,_0x2b6b8d);_0x361357['set'](_0x53d751,_0x225a2b['id']),_0x685b7e['journeyActivationNameToId'][_0x240a59(0x215)](_0x53d751,_0x225a2b['id']),_0x2eacd5[_0x240a59(0x196)]?.({'type':_0x240a59(0x210),'journeyName':_0x9b29f3[_0x240a59(0x263)]['name'],'activationName':_0x53d751});}const _0x501c10=JSON['parse'](JSON[_0x240a59(0x23c)](_0x513e05));return _0x501c10['id']=_0x39e145,ensureJourneyDefaults(_0x501c10[_0x240a59(0x26e)]),resolvePendingIdsInRequest(_0x501c10,_0x513e05,_0x367e5a,_0x4824cb,_0x361357,_0x2eacd5),await _0x49586b[_0x240a59(0x265)][_0x240a59(0x22b)](_0x39e145,_0x501c10),deletePushRecovery(_0x9b29f3[_0x240a59(0x239)]),{'action':_0x240a59(0x236),'journeyId':_0x39e145,'embeddedSegmentNameToId':_0x4824cb};}export function stripWaitStepPendingIds(_0x2f6e26){const _0x3ff8b6=a128_0x5352b9,_0x4c13ba=_0x2f6e26[_0x3ff8b6(0x249)]&&isPendingSegmentId(_0x2f6e26[_0x3ff8b6(0x249)]),_0x11a742=_0x2f6e26['conditions']?.[_0x3ff8b6(0x1f9)](_0x572fea=>_0x572fea[_0x3ff8b6(0x235)]&&isPendingSegmentId(_0x572fea[_0x3ff8b6(0x235)]));(_0x4c13ba||_0x11a742)&&(_0x2f6e26['waitStepType']=_0x3ff8b6(0x285),_0x2f6e26[_0x3ff8b6(0x273)]=0x1,_0x2f6e26[_0x3ff8b6(0x27c)]=_0x3ff8b6(0x19e),delete _0x2f6e26['conditionSegmentId'],delete _0x2f6e26[_0x3ff8b6(0x229)],delete _0x2f6e26['conditionTimeoutUnit'],delete _0x2f6e26[_0x3ff8b6(0x1dc)]);}export function resolveWaitStepPendingIds(_0x4fbdf8,_0x5a8460,_0x3a2acf,_0x343a0e){const _0x425d0b=a128_0x5352b9;if(_0x5a8460[_0x425d0b(0x249)]&&isPendingSegmentId(_0x5a8460['conditionSegmentId'])){const _0x183d1e=_0x3a2acf(_0x5a8460[_0x425d0b(0x249)],_0x425d0b(0x24f)+_0x343a0e+_0x425d0b(0x254));_0x183d1e&&(_0x4fbdf8['waitStepType']=_0x425d0b(0x25c),_0x4fbdf8[_0x425d0b(0x249)]=_0x183d1e,delete _0x4fbdf8[_0x425d0b(0x273)],delete _0x4fbdf8['waitStepUnit'],_0x5a8460[_0x425d0b(0x229)]!==undefined&&(_0x4fbdf8['conditionTimeoutDuration']=_0x5a8460['conditionTimeoutDuration']),_0x5a8460[_0x425d0b(0x244)]&&(_0x4fbdf8[_0x425d0b(0x244)]=_0x5a8460[_0x425d0b(0x244)]));}if(_0x5a8460[_0x425d0b(0x1dc)]){const _0x3b2915=_0x5a8460['conditions'][_0x425d0b(0x1f9)](_0x48d6ba=>_0x48d6ba[_0x425d0b(0x235)]&&isPendingSegmentId(_0x48d6ba[_0x425d0b(0x235)]));if(_0x3b2915){const _0x2a366b=_0x5a8460['conditions'][_0x425d0b(0x22d)](_0x3b54d6=>{const _0x2f8ff4=_0x425d0b;if(_0x3b54d6[_0x2f8ff4(0x235)]&&isPendingSegmentId(_0x3b54d6[_0x2f8ff4(0x235)])){const _0x1644c5=_0x3a2acf(_0x3b54d6['segmentId'],_0x2f8ff4(0x24f)+_0x343a0e+'\x27\x20wait\x20condition');return{..._0x3b54d6,'segmentId':_0x1644c5||_0x3b54d6[_0x2f8ff4(0x235)]};}return{..._0x3b54d6};});_0x4fbdf8[_0x425d0b(0x288)]=_0x425d0b(0x25c),_0x4fbdf8[_0x425d0b(0x1dc)]=_0x2a366b,delete _0x4fbdf8[_0x425d0b(0x273)],delete _0x4fbdf8[_0x425d0b(0x27c)],delete _0x4fbdf8['conditionSegmentId'],delete _0x4fbdf8['conditionTimeoutDuration'],delete _0x4fbdf8[_0x425d0b(0x244)];}}}function stripPendingIds(_0x20e017){const _0x35541f=a128_0x5352b9;_0x20e017[_0x35541f(0x26e)][_0x35541f(0x24a)]?.['segmentId']&&isPendingSegmentId(_0x20e017['attributes'][_0x35541f(0x24a)][_0x35541f(0x235)])&&delete _0x20e017['attributes'][_0x35541f(0x24a)];for(const _0x8da0 of _0x20e017['attributes'][_0x35541f(0x193)]||[]){_0x8da0[_0x35541f(0x1cd)]?.[_0x35541f(0x235)]&&isPendingSegmentId(_0x8da0[_0x35541f(0x1cd)][_0x35541f(0x235)])&&delete _0x8da0['entryCriteria'];_0x8da0[_0x35541f(0x199)]?.[_0x35541f(0x235)]&&isPendingSegmentId(_0x8da0[_0x35541f(0x199)][_0x35541f(0x235)])&&delete _0x8da0[_0x35541f(0x199)];_0x8da0[_0x35541f(0x1ea)]&&(_0x8da0['exitCriterias']=_0x8da0[_0x35541f(0x1ea)]['filter'](_0x2b3bd4=>!_0x2b3bd4['segmentId']||!isPendingSegmentId(_0x2b3bd4['segmentId'])));if(_0x8da0[_0x35541f(0x200)])for(const _0x29f10a of Object[_0x35541f(0x1ce)](_0x8da0[_0x35541f(0x200)])){const _0x176d85=_0x8da0[_0x35541f(0x200)][_0x29f10a];_0x176d85[_0x35541f(0x230)]===_0x35541f(0x1c7)&&_0x176d85[_0x35541f(0x261)]&&isPendingActivationId(_0x176d85['journeyActivationStepId'])&&(_0x176d85[_0x35541f(0x261)]='');if(_0x176d85[_0x35541f(0x230)]===_0x35541f(0x18a)&&_0x176d85[_0x35541f(0x1da)])for(const _0x4cbdfc of _0x176d85[_0x35541f(0x1da)]){_0x4cbdfc['segmentId']&&isPendingSegmentId(_0x4cbdfc[_0x35541f(0x235)])&&(_0x4cbdfc[_0x35541f(0x235)]='');}_0x176d85[_0x35541f(0x230)]===_0x35541f(0x24b)&&stripWaitStepPendingIds(_0x176d85);}}}function resolvePendingIdsInRequest(_0x2875d7,_0x5543e5,_0x32d4ca,_0x1c00ab,_0x24eb8c,_0x225437){const _0x3e5340=a128_0x5352b9,_0x297eff=(_0x39e833,_0x1581fa)=>{const _0x1742c5=a128_0x2d4b;if(!isPendingSegmentId(_0x39e833))return _0x39e833;const _0x2e7db5=extractPendingSegmentName(_0x39e833),_0x54381f=_0x1c00ab[_0x1742c5(0x231)](_0x2e7db5);return!_0x54381f&&_0x225437[_0x1742c5(0x1f8)]?.(_0x1742c5(0x19c)+_0x2e7db5+'\x27\x20for\x20'+_0x1581fa),_0x54381f;};if(_0x2875d7[_0x3e5340(0x26e)][_0x3e5340(0x24a)]?.[_0x3e5340(0x235)]&&isPendingSegmentId(_0x2875d7['attributes'][_0x3e5340(0x24a)][_0x3e5340(0x235)])){const _0x4df8ba=_0x297eff(_0x2875d7[_0x3e5340(0x26e)][_0x3e5340(0x24a)][_0x3e5340(0x235)],_0x3e5340(0x1d2));_0x4df8ba&&(_0x2875d7[_0x3e5340(0x26e)][_0x3e5340(0x24a)][_0x3e5340(0x235)]=_0x4df8ba);}for(const _0xcc83fb of _0x2875d7[_0x3e5340(0x26e)]['journeyStages']||[]){const _0x29dd5f=_0x32d4ca[_0x3e5340(0x231)](_0xcc83fb[_0x3e5340(0x1ee)][_0x3e5340(0x1e9)]());_0x29dd5f&&(_0xcc83fb['id']=_0x29dd5f);if(_0xcc83fb[_0x3e5340(0x1cd)]?.[_0x3e5340(0x235)]&&isPendingSegmentId(_0xcc83fb[_0x3e5340(0x1cd)][_0x3e5340(0x235)])){const _0x554737=_0x297eff(_0xcc83fb[_0x3e5340(0x1cd)]['segmentId'],_0x3e5340(0x24f)+_0xcc83fb[_0x3e5340(0x1ee)]+_0x3e5340(0x22c));_0x554737&&(_0xcc83fb[_0x3e5340(0x1cd)][_0x3e5340(0x235)]=_0x554737);}if(_0xcc83fb['exitCriterias'])for(const _0x78a9b7 of _0xcc83fb[_0x3e5340(0x1ea)]){if(_0x78a9b7['segmentId']&&isPendingSegmentId(_0x78a9b7[_0x3e5340(0x235)])){const _0x2705da=_0x297eff(_0x78a9b7[_0x3e5340(0x235)],_0x3e5340(0x24f)+_0xcc83fb['name']+_0x3e5340(0x284));_0x2705da&&(_0x78a9b7['segmentId']=_0x2705da);}}if(_0xcc83fb[_0x3e5340(0x199)]?.['segmentId']&&isPendingSegmentId(_0xcc83fb[_0x3e5340(0x199)]['segmentId'])){const _0x1a5167=_0x297eff(_0xcc83fb[_0x3e5340(0x199)][_0x3e5340(0x235)],_0x3e5340(0x24f)+_0xcc83fb[_0x3e5340(0x1ee)]+'\x27\x20milestone');_0x1a5167&&(_0xcc83fb[_0x3e5340(0x199)][_0x3e5340(0x235)]=_0x1a5167);}if(_0xcc83fb[_0x3e5340(0x200)]){const _0x915426=_0x2519bf=>_0x5543e5[_0x3e5340(0x26e)][_0x3e5340(0x193)]?.['find'](_0x37e029=>_0x37e029['name']['toLowerCase']()===_0xcc83fb[_0x3e5340(0x1ee)][_0x3e5340(0x1e9)]())?.['steps']?.[_0x2519bf];for(const _0x30f6f7 of Object[_0x3e5340(0x1ce)](_0xcc83fb[_0x3e5340(0x200)])){const _0x2c08db=_0xcc83fb[_0x3e5340(0x200)][_0x30f6f7],_0x551f86=_0x915426(_0x30f6f7);if(_0x2c08db[_0x3e5340(0x230)]==='Activation'&&_0x2c08db[_0x3e5340(0x261)]&&(isPendingActivationId(_0x2c08db[_0x3e5340(0x261)])||_0x2c08db[_0x3e5340(0x261)]==='')){if(_0x551f86?.[_0x3e5340(0x261)]&&isPendingActivationId(_0x551f86['journeyActivationStepId'])){const _0x4603d4=extractPendingActivationName(_0x551f86[_0x3e5340(0x261)]),_0x4ada3c=_0x24eb8c[_0x3e5340(0x231)](_0x4603d4);_0x4ada3c&&(_0x2c08db['journeyActivationStepId']=_0x4ada3c);}}if(_0x2c08db[_0x3e5340(0x230)]===_0x3e5340(0x18a)&&_0x2c08db['branches']&&_0x551f86?.[_0x3e5340(0x1da)])for(let _0x5d6b2d=0x0;_0x5d6b2d<_0x2c08db['branches'][_0x3e5340(0x1cc)];_0x5d6b2d++){const _0x42da46=_0x2c08db[_0x3e5340(0x1da)][_0x5d6b2d],_0x290ab4=_0x551f86[_0x3e5340(0x1da)][_0x5d6b2d];if(_0x290ab4?.[_0x3e5340(0x235)]&&isPendingSegmentId(_0x290ab4[_0x3e5340(0x235)])){const _0x5d06fa=_0x297eff(_0x290ab4[_0x3e5340(0x235)],_0x3e5340(0x24f)+_0xcc83fb['name']+_0x3e5340(0x26a)+(_0x42da46[_0x3e5340(0x1ee)]||_0x5d6b2d)+'\x27');_0x5d06fa&&(_0x42da46['segmentId']=_0x5d06fa);}}_0x2c08db['type']===_0x3e5340(0x24b)&&_0x551f86?.[_0x3e5340(0x230)]==='WaitStep'&&resolveWaitStepPendingIds(_0x2c08db,_0x551f86,_0x297eff,_0xcc83fb[_0x3e5340(0x1ee)]);}}}}
|
|
1
|
+
const a128_0x29b006=a128_0x23ac;(function(_0x5586fd,_0x1c93c1){const _0x1a875f=a128_0x23ac,_0x2c5436=_0x5586fd();while(!![]){try{const _0x25751a=parseInt(_0x1a875f(0x1ea))/0x1*(-parseInt(_0x1a875f(0x214))/0x2)+parseInt(_0x1a875f(0x25e))/0x3+parseInt(_0x1a875f(0x1a0))/0x4*(-parseInt(_0x1a875f(0x178))/0x5)+-parseInt(_0x1a875f(0x195))/0x6+-parseInt(_0x1a875f(0x19e))/0x7*(-parseInt(_0x1a875f(0x1a7))/0x8)+parseInt(_0x1a875f(0x227))/0x9+parseInt(_0x1a875f(0x1ac))/0xa*(parseInt(_0x1a875f(0x1cc))/0xb);if(_0x25751a===_0x1c93c1)break;else _0x2c5436['push'](_0x2c5436['shift']());}catch(_0x259813){_0x2c5436['push'](_0x2c5436['shift']());}}}(a128_0x5231,0xcd7e8));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a128_0x29b006(0x233);export const PENDING_ACTIVATION_PREFIX=a128_0x29b006(0x209);export function createPendingSegmentId(_0x55c1f9){return''+PENDING_SEGMENT_PREFIX+_0x55c1f9+'__';}export function isPendingSegmentId(_0x598bb5){const _0x2b8ef2=a128_0x29b006;return _0x598bb5[_0x2b8ef2(0x16e)](PENDING_SEGMENT_PREFIX)&&!_0x598bb5[_0x2b8ef2(0x16e)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x903a06){const _0xe4c40e=a128_0x29b006;return _0x903a06[_0xe4c40e(0x26d)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1c685d){return''+PENDING_ACTIVATION_PREFIX+_0x1c685d+'__';}export function isPendingActivationId(_0x200b6f){const _0x530b6e=a128_0x29b006;return _0x200b6f[_0x530b6e(0x16e)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x522721){const _0x100fcc=a128_0x29b006;return _0x522721[_0x100fcc(0x26d)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3e87b8,_0x5de119){const _0x2685ac=a128_0x29b006,_0x43df9f=_0x3e87b8+'::'+(_0x5de119['trim']()||_0x2685ac(0x1f3)),_0x4e92a5=createHash(_0x2685ac(0x16d))[_0x2685ac(0x24a)](_0x43df9f)[_0x2685ac(0x1db)](_0x2685ac(0x249))[_0x2685ac(0x262)](0x0,0xc);return'journey_entry_criteria_'+_0x4e92a5;}export function ensureJourneyDefaults(_0x5ec949){const _0x41430e=a128_0x29b006;!_0x5ec949[_0x41430e(0x1b5)]&&(_0x5ec949['description']=''),!_0x5ec949[_0x41430e(0x245)]&&(_0x5ec949[_0x41430e(0x245)]=_0x41430e(0x250));}export function injectExistingStageIds(_0x11e7fb,_0x62bd43){const _0x2170db=a128_0x29b006,_0x5f1f8d=new Map(_0x62bd43[_0x2170db(0x1f1)](_0x5e92c1=>[_0x5e92c1['name'],_0x5e92c1['id']]));for(const _0x18bc9c of _0x11e7fb){if(!_0x18bc9c['id']){const _0x10d48a=_0x5f1f8d[_0x2170db(0x267)](_0x18bc9c[_0x2170db(0x21b)]);_0x10d48a&&(_0x18bc9c['id']=_0x10d48a);}}}function a128_0x5231(){const _0x465792=['absolutePath','12788PrCHxk','getSegment','journeyStages','set','JOURNEY_UPDATE_ERROR','null','add','name','conditions','from','yamlConfig','./journey-yaml.js','\x27\x20entry\x20criteria','branches','valid','isNew','sort','activation_deleted','\x27\x20wait\x20condition','3264057yrdPls','createdSegmentIds','../../utils/async.js','Created\x20activation\x20\x27','nameToId','updated','journeyActivationStepId','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','segmentFolderId','rule','verbose','createFolder','__pending_','keys','behavior','DecisionPoint','Failed\x20to\x20','logInfo','embeddedSegmentNameToId','Name\x20has\x20already\x20been\x20taken','schedule','.$1.push-recovery.json','folder_creating','journeyBundleId','Created\x20segment\x20\x27','activation_creating','segment_created','SEGMENT_NOT_FOUND','journeys','getLatestJourneyId','state','unchanged','validatedRequest','ACTIVATION_SYNTAX_ERROR','hex','update','\x0a\x20\x20','createdSegmentId','parentFolder','activationActions','getJourney','draft','segments','listActivations','fetchJourney','and\x20the\x20server\x20segment,\x20then\x20retry.','journeyId','existingJourney','push','getActivation','versionNumber','activationStepsById','Journey\x20\x27','folderId','updateActivation','4808973WoGxVq','resolveSegment','SEGMENT_UPDATE_ERROR','journeyActivationNameToId','slice','user','\x27\x20not\x20found\x20in\x20journey\x20\x27','uniqueServerName','folderPathToId','get','entries','utf-8','withProgress','conditionTimeoutDuration','embedded_segment_creating','replace','uniqueSegmentName','parse','sha1','startsWith','deps','connection','Updating\x20segment\x20\x27','Stage\x20\x27','Fetching\x20','logDeleted','find','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','hasChanges','160tKGhrf','toISOString','steps','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','WaitStep','stage\x20\x27','Creating\x20segment\x20\x27','includes','embedded_activation_creating','journey','buildUserMaps','NOT_FOUND','\x27\x20from\x20file:\x20','delete','activationsBySegmentId','message','resolveJourneyId','journeyBundlesByFolderAndName','has','max','create','existingSegment','\x27\x20decision\x20point\x20branch\x20\x27','activationParams','\x20journey\x20from\x20file:\x20','connectionIdToNameMap','\x20activation\x20\x27','activations','type','5429778omZiKe','journey_creating','all_columns','parseDocument','\x27...','activation_template_id','skipSegments','):\x20','\x27\x20for\x20','7WQshvx','reduce','38344CuCDUR','parentId','action','SEGMENT_SYNTAX_ERROR','split','Deleted\x20activation\x20\x27','Updated\x20segment\x20\x27','2434984RbBdQK','idToEmailMap','\x27\x20milestone','logSuccess','exitCriterias','610jxZQSN','milestone','activation_updating','folderPath','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','debug','journey_created','idToName','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','description','some','activation_created','activationContext','getSegment\x20failed\x20for\x20','journeyById','Delete\x20the\x20push\x20recovery\x20file\x20(','segment_deleted','existingSegments','updateSegmentById','rootFolderId','attributes','values','getSegmentEntity','item','diff','relative','join','Entry\x20criteria:\x20','size','\x20segment\x20from\x20file:\x20','Activation','results','120054GsTInl','Creating\x20activation\x20\x27','existingActivation','yamlActivation','entry','resolvedRule','Failed\x20to\x20resolve\x20activation\x20','with','createSegment','decision_point','waitStepUnit','columns','journey_updating','segment_creating','connector_config','digest','onProgress','entryCriteria','waitStepType','index','filter','waitStep','journeyName','INTERNAL','embedded_segment_created','embedded_activation_created','toString','segment_updated','createActivation','deleted','138KLwnub','run_after_journey_refresh','journey_updated','toLowerCase','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','folder','relationships','map','entry_criteria','segment','localName','segmentNameToId','./child-segment-yaml.js','notification','Condition','day','stages','errors','goal','segmentId','journeyBundleName','progress','Updating\x20activation\x20\x27','match','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','length','stringify','\x20(referenced\x20in\x20journey\x20','kind','data','Updated\x20journey\x20\x27','__pending_act_','conditionTimeoutUnit','Segment\x20not\x20found','\x20error(s)','\x27\x20by\x20rule\x20content','\x27\x20to\x20local\x20\x27','Embedded\x20segment\x20\x27','conditionSegmentId','createJourneySegment','created'];a128_0x5231=function(){return _0x465792;};return a128_0x5231();}export function resolveTDFolderPath(_0x2da4f9,_0x4aefa8,_0x1c9069){const _0x5b614=a128_0x29b006;if(!_0x4aefa8)return _0x2da4f9;if(_0x2da4f9===_0x1c9069||_0x2da4f9[_0x5b614(0x16e)](_0x1c9069+'/'))return _0x2da4f9;return _0x2da4f9?_0x1c9069+'/'+_0x2da4f9:_0x1c9069;}export function addFoldersToCreate(_0x3c542c,_0x55ac95,_0x38399e){const _0x496c80=a128_0x29b006;if(!_0x3c542c)return;if(_0x55ac95[_0x496c80(0x18a)](_0x3c542c))return;const _0xa99cdb=_0x3c542c[_0x496c80(0x1a4)]('/');let _0x305f68='';for(const _0x58d360 of _0xa99cdb){_0x305f68=_0x305f68?_0x305f68+'/'+_0x58d360:_0x58d360,!_0x55ac95['has'](_0x305f68)&&_0x38399e['add'](_0x305f68);}}export function sortFoldersByDepth(_0x3dea5b){const _0x23bb6a=a128_0x29b006;return[..._0x3dea5b][_0x23bb6a(0x224)]((_0x29aba6,_0x3fdf83)=>{const _0xf3eb77=_0x23bb6a,_0x38f33e=(_0x29aba6[_0xf3eb77(0x201)](/\//g)||[])[_0xf3eb77(0x203)],_0x3bd0d3=(_0x3fdf83[_0xf3eb77(0x201)](/\//g)||[])['length'];return _0x38f33e-_0x3bd0d3;});}import*as a128_0x31986e from'yaml';import{readFileSync}from'fs';import a128_0x3ac8f0 from'path';import{isJourneyDef,parseYamlString as a128_0x54a7e1,toYamlString as a128_0x2fdd84,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{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x39ab35){const _0x516a99=a128_0x29b006;if(Array['isArray'](_0x39ab35))return'['+_0x39ab35['map'](_0x10d244=>stableStringify(_0x10d244))['join'](',')+']';if(_0x39ab35&&typeof _0x39ab35==='object'){const _0x45c647=_0x39ab35,_0x507566=Object[_0x516a99(0x234)](_0x45c647)[_0x516a99(0x224)](),_0x1dadc4=_0x507566['map'](_0x1b9e9e=>'\x22'+_0x1b9e9e+'\x22:'+stableStringify(_0x45c647[_0x1b9e9e]));return'{'+_0x1dadc4['join'](',')+'}';}const _0x22c275=JSON[_0x516a99(0x204)](_0x39ab35);return _0x22c275===undefined?_0x516a99(0x219):_0x22c275;}function activationSignature(_0x6c9975){const _0x44f9d4=a128_0x29b006,_0x4464fa={'connection':_0x6c9975[_0x44f9d4(0x170)],..._0x6c9975[_0x44f9d4(0x197)]!==undefined&&{'all_columns':_0x6c9975['all_columns']},..._0x6c9975[_0x44f9d4(0x1d7)]!==undefined&&{'columns':_0x6c9975[_0x44f9d4(0x1d7)]},..._0x6c9975[_0x44f9d4(0x235)]!==undefined&&{'behavior':_0x6c9975[_0x44f9d4(0x235)]},..._0x6c9975[_0x44f9d4(0x23b)]!==undefined&&{'schedule':_0x6c9975[_0x44f9d4(0x23b)]},..._0x6c9975[_0x44f9d4(0x1f7)]!==undefined&&{'notification':_0x6c9975[_0x44f9d4(0x1f7)]},..._0x6c9975[_0x44f9d4(0x1da)]!==undefined&&{'connector_config':_0x6c9975['connector_config']},..._0x6c9975[_0x44f9d4(0x19a)]!==undefined&&{'activation_template_id':_0x6c9975[_0x44f9d4(0x19a)]}};return stableStringify(_0x4464fa);}async function fetchSegment(_0x3b84d5,_0x30c7d5,_0x36e848,_0x1db9e4){const _0xa0f9ab=a128_0x29b006,_0x42adc0=_0x1db9e4?.[_0xa0f9ab(0x175)](_0x2711df=>_0x2711df['id']===_0x36e848);if(_0x42adc0)return _0x42adc0;try{return await _0x3b84d5[_0xa0f9ab(0x1f3)][_0xa0f9ab(0x215)](_0x30c7d5,_0x36e848);}catch(_0x275160){logger['debug'](_0xa0f9ab(0x1b9)+_0x36e848+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x275160);try{return await _0x3b84d5['segment'][_0xa0f9ab(0x1c2)](_0x36e848);}catch(_0x53832e){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x36e848+':\x20'+_0x53832e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x76e642,_0x2bb6d4,_0x3e2b3a){const _0x29edfe=a128_0x29b006,_0x355f9d=readPushRecovery(_0x76e642[_0x29edfe(0x213)]);if(_0x355f9d?.[_0x29edfe(0x1e2)]===_0x76e642[_0x29edfe(0x21e)]['name'])for(const [_0x214d45,_0x167eee]of Object[_0x29edfe(0x268)](_0x355f9d[_0x29edfe(0x251)])){const _0x391027=generateDeterministicJourneySegmentName(_0x76e642[_0x29edfe(0x21e)]['name'],_0x214d45);_0x167eee[_0x29edfe(0x265)]===_0x391027&&(_0x2bb6d4[_0x29edfe(0x217)](_0x214d45,_0x167eee['segmentId']),_0x3e2b3a['set'](_0x214d45,_0x167eee[_0x29edfe(0x1fd)]));}}async function createOrRecoverEmbeddedSegment(_0x49564d,_0x2e8a7f,_0x2e2abe,_0x175100){const _0x55b612=a128_0x29b006;let _0x1dea9e;try{_0x1dea9e=await _0x49564d[_0x55b612(0x1f3)][_0x55b612(0x211)]({'name':_0x2e2abe[_0x55b612(0x26e)],'description':_0x2e2abe[_0x55b612(0x1b5)],'journeyId':_0x2e2abe[_0x55b612(0x255)],'rule':_0x175100(_0x2e2abe[_0x55b612(0x1d1)],!![]),'countPopulation':!![],'parentFolderId':_0x2e2abe[_0x55b612(0x25c)],'audienceId':_0x2e2abe['parentId']});}catch(_0x209078){const _0x4b22da=_0x209078 instanceof Error&&_0x209078[_0x55b612(0x187)][_0x55b612(0x17f)](_0x55b612(0x23a));if(_0x4b22da){const _0xf1adb8=readPushRecovery(_0x2e8a7f['absolutePath']),_0x2e2e8c=_0xf1adb8?.[_0x55b612(0x1e2)]===_0x2e8a7f[_0x55b612(0x21e)][_0x55b612(0x21b)]?_0xf1adb8[_0x55b612(0x251)][_0x2e2abe[_0x55b612(0x1f4)]]:undefined;if(_0x2e2e8c?.[_0x55b612(0x265)]===_0x2e2abe[_0x55b612(0x26e)])await _0x49564d[_0x55b612(0x1f3)][_0x55b612(0x1be)](_0x2e2abe['parentId'],_0x2e2e8c[_0x55b612(0x1fd)],{'description':_0x2e2abe[_0x55b612(0x1b5)],'rule':_0x175100(_0x2e2abe[_0x55b612(0x1d1)],!![]),'countPopulation':!![]}),_0x1dea9e=_0x2e2e8c[_0x55b612(0x1fd)];else throw new SDKError(ErrorCode[_0x55b612(0x260)],_0x55b612(0x20f)+_0x2e2abe[_0x55b612(0x1f4)]+_0x55b612(0x1b4)+(_0x55b612(0x1bb)+_0x2e8a7f['absolutePath']['replace'](/([^/]+)$/,_0x55b612(0x23c))+')\x20')+_0x55b612(0x254),_0x209078);}else throw _0x209078;}return saveSegmentToPushRecovery(_0x2e8a7f['absolutePath'],_0x2e8a7f[_0x55b612(0x21e)]['name'],_0x2e2abe[_0x55b612(0x1f4)],{'segmentId':_0x1dea9e,'uniqueServerName':_0x2e2abe[_0x55b612(0x26e)],'createdAt':new Date()['toISOString']()}),_0x1dea9e;}export async function prepareSegmentFiles(_0x18452f,_0x3a9edc,_0x4070f4,_0x4a12d7,_0x524381){const _0x105ac4=a128_0x29b006,{activationDefToCreateRequest:_0x3962b4}=await import(_0x105ac4(0x1f6)),_0x3302b7=[],_0x22a3e4=new Set();for(const {yamlConfig:_0x134f56,folderPath:_0x169971,sourcePath:_0x3a6e09}of _0x18452f){const _0x45125c=resolveTDFolderPath(_0x169971,_0x4a12d7,_0x524381),_0x5b51aa=_0x45125c+':'+_0x134f56['name'],_0x54cad3=_0x3a9edc['segmentByFolderAndName'][_0x105ac4(0x267)](_0x5b51aa),_0x5b3e20=_0x54cad3?_0x3a9edc[_0x105ac4(0x186)][_0x105ac4(0x267)](_0x54cad3['id'])||[]:[];addFoldersToCreate(_0x45125c,_0x3a9edc[_0x105ac4(0x266)],_0x22a3e4);const _0x3117dc=calculateActivationActions(_0x134f56[_0x105ac4(0x193)]||[],_0x5b3e20,_0x3a9edc[_0x105ac4(0x1a8)],_0x3a9edc['connectionIdToNameMap']);for(const _0xb63d68 of _0x3117dc){(_0xb63d68[_0x105ac4(0x194)]==='create'||_0xb63d68[_0x105ac4(0x194)]===_0x105ac4(0x24a))&&_0xb63d68['yamlActivation']&&(_0xb63d68[_0x105ac4(0x247)]=await _0x3962b4(_0xb63d68[_0x105ac4(0x1cf)],_0x4070f4));}const _0x513f63=calculateSegmentDiff(_0x134f56,_0x54cad3,_0x5b3e20,_0x3a9edc[_0x105ac4(0x1a8)],_0x3a9edc[_0x105ac4(0x191)]);_0x3302b7[_0x105ac4(0x257)]({'relativePath':_0x134f56[_0x105ac4(0x21b)],'absolutePath':_0x3a6e09,'yamlConfig':_0x134f56,'folderPath':_0x45125c,'existingSegment':_0x54cad3,'existingActivations':_0x5b3e20,'isNew':_0x513f63[_0x105ac4(0x223)],'hasChanges':_0x513f63[_0x105ac4(0x177)],'diff':_0x513f63[_0x105ac4(0x1c4)],'activationActions':_0x3117dc});}return{'segmentFiles':_0x3302b7,'foldersToCreate':_0x22a3e4};}export async function prepareJourneyFiles(_0x314788,_0x2cb693,_0x11fc7b,_0x1cd5f6){const _0x3e2866=a128_0x29b006,_0x4a5f0e=[],_0x1ae285=new Set();for(const {yamlConfig:_0x3eeb43,folderPath:_0x4522f2,sourcePath:_0x446a31}of _0x314788){const _0x46ae3b=resolveTDFolderPath(_0x4522f2,_0x11fc7b,_0x1cd5f6),_0x469c5c=_0x46ae3b+':'+_0x3eeb43[_0x3e2866(0x21b)],_0x446c6d=_0x2cb693[_0x3e2866(0x189)]['get'](_0x469c5c);let _0x50c512,_0x3a4a5c;if(_0x446c6d&&_0x446c6d[_0x3e2866(0x203)]>0x0){const _0x1285fc=buildLocalExpandedRuleMappings(_0x3eeb43),{createYamlContext:_0xcf1c54,prefetchJourneySegments:_0x422f21}=createPushYamlContextForBundle(_0x2cb693[_0x3e2866(0x16f)],_0x2cb693[_0x3e2866(0x1a1)],_0x2cb693[_0x3e2866(0x1bd)],_0x1285fc,_0x2cb693['idToEmailMap'],_0x2cb693[_0x3e2866(0x191)],_0x2cb693[_0x3e2866(0x25a)],_0x2cb693[_0x3e2866(0x1ba)]);await _0x422f21(_0x446c6d['map'](_0x32afb9=>_0x32afb9['id']));const _0x48f79f=await _0x2cb693['deps'][_0x3e2866(0x181)][_0x3e2866(0x244)](_0x446c6d[0x0][_0x3e2866(0x23e)]),_0x40e565=hasMultipleVersions(_0x3eeb43),_0x304b0d=async _0x3fc06c=>{const _0x23f4f3=_0x3e2866,_0x3aa085=_0x2cb693['journeyById']?.[_0x23f4f3(0x267)](_0x3fc06c);if(_0x3aa085)return _0x3aa085;return _0x2cb693[_0x23f4f3(0x253)]({'journeyId':_0x3fc06c,'journeyName':_0x3eeb43[_0x23f4f3(0x21b)],'isMultiVersion':_0x446c6d[_0x23f4f3(0x203)]>0x1});};if(_0x40e565&&_0x446c6d[_0x3e2866(0x203)]>0x1){const _0xe9660d=[];for(const _0x244334 of _0x446c6d){const _0x36ee9b=_0x244334[_0x3e2866(0x259)]||0x1;_0x2cb693[_0x3e2866(0x1ff)]?.[_0x3e2866(0x24a)](_0x3e2866(0x173)+_0x3eeb43[_0x3e2866(0x21b)]+'\x20v'+_0x36ee9b);const _0x1be4d1=await _0x304b0d(_0x244334['id']),_0x42fcfb=_0xcf1c54(_0x244334['id']),_0x5376df=await journeyResponseToDef(_0x1be4d1,_0x42fcfb);_0xe9660d['push']({'item':_0x244334,'yaml':_0x5376df});}const _0x23d6bd=buildLocalRuleToNameMappingFromJourney(_0x3eeb43);_0x3a4a5c=buildMergedJourneyDef(_0xe9660d,_0x23d6bd,_0x48f79f);const _0x260e20=Math[_0x3e2866(0x18b)](..._0xe9660d[_0x3e2866(0x1f1)](_0x2e1afb=>_0x2e1afb[_0x3e2866(0x1c3)][_0x3e2866(0x259)]||0x0)),_0x4ecae9=_0x446c6d['find'](_0x415630=>(_0x415630[_0x3e2866(0x259)]||0x0)===_0x260e20);_0x4ecae9&&(_0x2cb693[_0x3e2866(0x1ff)]?.[_0x3e2866(0x24a)](_0x3e2866(0x173)+_0x3eeb43[_0x3e2866(0x21b)]+'\x20v'+_0x260e20),_0x50c512=await _0x304b0d(_0x4ecae9['id']));}else{const _0x22e927=_0x446c6d[_0x446c6d[_0x3e2866(0x203)]-0x1];_0x2cb693[_0x3e2866(0x1ff)]?.[_0x3e2866(0x24a)]('Fetching\x20'+_0x3eeb43[_0x3e2866(0x21b)]),_0x50c512=await _0x304b0d(_0x22e927['id']);const _0xf9c852=_0xcf1c54(_0x22e927['id']),_0x220061=await journeyResponseToDef(_0x50c512,_0xf9c852),_0x333b7e=buildLocalRuleToNameMappingFromJourney(_0x3eeb43);_0x3a4a5c=buildMergedJourneyDef([{'item':_0x22e927,'yaml':_0x220061}],_0x333b7e,_0x48f79f);}}addFoldersToCreate(_0x46ae3b,_0x2cb693[_0x3e2866(0x266)],_0x1ae285);const _0x5b32e3=calculateJourneyDiff(_0x3eeb43,_0x3a4a5c);_0x4a5f0e[_0x3e2866(0x257)]({'relativePath':_0x3eeb43[_0x3e2866(0x21b)],'absolutePath':_0x446a31,'yamlConfig':_0x3eeb43,'folderPath':_0x46ae3b,'existingJourney':_0x50c512,'isNew':_0x5b32e3[_0x3e2866(0x223)],'hasChanges':_0x5b32e3[_0x3e2866(0x177)],'diff':_0x5b32e3[_0x3e2866(0x1c4)]});}return{'journeyFiles':_0x4a5f0e,'foldersToCreate':_0x1ae285};}export function calculateActivationActions(_0x49f48e,_0x4d48da,_0x4b940e,_0x4c46aa){const _0x15df22=a128_0x29b006,_0x234b8c=[],_0x51edef=new Map();for(const _0x2e63ec of _0x4d48da){_0x51edef[_0x15df22(0x217)](_0x2e63ec['name'],_0x2e63ec);}const _0x171f68=new Map();for(const _0x5334f3 of _0x49f48e){_0x171f68['set'](_0x5334f3[_0x15df22(0x21b)],_0x5334f3);}for(const _0x946dab of _0x49f48e){const _0x53f686=_0x51edef['get'](_0x946dab['name']);if(!_0x53f686)_0x234b8c[_0x15df22(0x257)]({'type':'create','name':_0x946dab['name'],'yamlActivation':_0x946dab});else{const _0x49d23f=activationResponseToDef(_0x53f686,_0x4b940e,_0x4c46aa),_0x20542f=a128_0x31986e[_0x15df22(0x204)](_0x49d23f),_0x4df401=a128_0x31986e[_0x15df22(0x204)](_0x946dab);_0x20542f!==_0x4df401&&_0x234b8c[_0x15df22(0x257)]({'type':_0x15df22(0x24a),'name':_0x946dab['name'],'yamlActivation':_0x946dab,'existingActivation':_0x53f686});}}for(const _0x3be032 of _0x4d48da){!_0x171f68['has'](_0x3be032[_0x15df22(0x21b)])&&_0x234b8c[_0x15df22(0x257)]({'type':_0x15df22(0x185),'name':_0x3be032[_0x15df22(0x21b)],'existingActivation':_0x3be032});}return _0x234b8c;}function calculateYamlDiff(_0x14badb,_0x530615){if(_0x530615){const _0x5e8eee=generateDiff(_0x530615,_0x14badb),_0x23830f=hasChanges(_0x5e8eee);return{'isNew':![],'hasChanges':_0x23830f,'diff':_0x23830f?formatDiffWithColors(_0x5e8eee):undefined};}const _0x4ceedf=generateDiff('',_0x14badb);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4ceedf)};}export function calculateSegmentDiff(_0x4a9a55,_0x335885,_0x244cec,_0x5eebb1,_0x255baf){const _0x343d06=segmentToYamlString(_0x4a9a55),_0x2cee20=_0x335885?segmentToYamlString(segmentWithActivationsToYaml(_0x335885,_0x244cec,undefined,_0x5eebb1,_0x255baf)):undefined;return calculateYamlDiff(_0x343d06,_0x2cee20);}export function calculateJourneyDiff(_0x133ec5,_0x2703bf){const _0x26c21e=normalizeJourneyDef(_0x133ec5,_0x133ec5),_0x143b6c=a128_0x2fdd84(_0x26c21e),_0x4359c3=_0x2703bf?a128_0x2fdd84(normalizeJourneyDef(_0x2703bf,_0x133ec5)):undefined;return calculateYamlDiff(_0x143b6c,_0x4359c3);}export function findSegmentsToDelete(_0x2197a7,_0x48676d,_0x4cd589,_0x3b8a60,_0x3e1f27){const _0x2bc598=a128_0x29b006,_0x1a7053=new Set();for(const {yamlConfig:_0x247d0c,folderPath:_0x484e0c}of _0x48676d){_0x1a7053[_0x2bc598(0x21a)](_0x484e0c+':'+_0x247d0c[_0x2bc598(0x21b)]);}return _0x2197a7[_0x2bc598(0x1e0)](_0x360c33=>{const _0x4afb27=_0x2bc598,_0xa06152=_0x360c33[_0x4afb27(0x22f)]?_0x4cd589[_0x4afb27(0x267)](_0x360c33['segmentFolderId'][_0x4afb27(0x1e6)]())||'':'',_0x197452=_0xa06152+':'+_0x360c33[_0x4afb27(0x21b)];if(_0x1a7053[_0x4afb27(0x18a)](_0x197452))return![];if(_0x3e1f27)return _0xa06152===_0x3b8a60||_0xa06152['startsWith'](_0x3b8a60+'/');return!![];});}export function findJourneysToDelete(_0x1409c4,_0x505269,_0x41e19f,_0x3b35d7,_0xc38718){const _0x2a2d47=a128_0x29b006,_0x3aa40c=new Set();for(const {yamlConfig:_0x304d1b,folderPath:_0x3f0b74}of _0x505269){_0x3aa40c[_0x2a2d47(0x21a)](_0x3f0b74+':'+_0x304d1b[_0x2a2d47(0x21b)]);}return _0x1409c4[_0x2a2d47(0x1e0)](_0x39239e=>{const _0x2a46c7=_0x2a2d47,_0x38a9d2=_0x39239e[_0x2a46c7(0x25c)]?_0x41e19f[_0x2a46c7(0x267)](_0x39239e[_0x2a46c7(0x25c)])||'':'',_0x50ee61=_0x38a9d2+':'+_0x39239e[_0x2a46c7(0x1fe)];if(_0x3aa40c[_0x2a46c7(0x18a)](_0x50ee61))return![];if(_0xc38718)return _0x38a9d2===_0x3b35d7||_0x38a9d2[_0x2a46c7(0x16e)](_0x3b35d7+'/');return!![];});}export function buildSegmentLookupMap(_0x3912a8,_0x311aec){const _0x213296=a128_0x29b006,_0x5ad02f=new Map();for(const _0x4be077 of _0x3912a8){const _0x427663=_0x4be077[_0x213296(0x22f)]?_0x311aec[_0x213296(0x267)](_0x4be077[_0x213296(0x22f)][_0x213296(0x1e6)]())||'':'',_0x277471=_0x427663+':'+_0x4be077['name'];_0x5ad02f[_0x213296(0x217)](_0x277471,_0x4be077);}return _0x5ad02f;}export function buildSegmentNameToIdMap(_0x45c665){const _0x1363be=a128_0x29b006,_0x3209eb=new Map();for(const _0x289e75 of _0x45c665){_0x3209eb['set'](_0x289e75[_0x1363be(0x21b)],_0x289e75['id']);}return _0x3209eb;}export function buildJourneyBundleLookupMap(_0x1e2e39,_0x37789d){const _0x51691a=a128_0x29b006,_0x4a1f96=new Map();for(const _0x2a6da4 of _0x1e2e39){const _0xf17726=_0x2a6da4[_0x51691a(0x25c)]?_0x37789d[_0x51691a(0x267)](_0x2a6da4['folderId'])||'':'',_0x3bd7a2=_0xf17726+':'+_0x2a6da4['journeyBundleName'];!_0x4a1f96[_0x51691a(0x18a)](_0x3bd7a2)&&_0x4a1f96[_0x51691a(0x217)](_0x3bd7a2,[]),_0x4a1f96[_0x51691a(0x267)](_0x3bd7a2)[_0x51691a(0x257)](_0x2a6da4);}for(const _0x6c81ef of _0x4a1f96[_0x51691a(0x1c1)]()){_0x6c81ef[_0x51691a(0x224)]((_0x25ab1d,_0x1da003)=>(_0x25ab1d[_0x51691a(0x259)]||0x0)-(_0x1da003['versionNumber']||0x0));}return _0x4a1f96;}export function collectFoldersToCreate(_0xaff990,_0x3f8d65){const _0xa0f355=a128_0x29b006,_0x2baf35=new Set();for(const _0x1a142 of _0xaff990){if(!_0x1a142)continue;if(_0x3f8d65['has'](_0x1a142))continue;const _0x56096a=_0x1a142[_0xa0f355(0x1a4)]('/');let _0x548f44='';for(const _0xcdffa6 of _0x56096a){_0x548f44=_0x548f44?_0x548f44+'/'+_0xcdffa6:_0xcdffa6,!_0x3f8d65['has'](_0x548f44)&&_0x2baf35[_0xa0f355(0x21a)](_0x548f44);}}return _0x2baf35;}export function parseAndClassifyYamlFiles(_0x50d905,_0x2bb819,_0x5946b0){const _0x31da55=a128_0x29b006,_0x484857=[],_0x157f4a=[];for(const _0x4fde51 of _0x50d905){const _0x4dd813=a128_0x3ac8f0[_0x31da55(0x1c5)](_0x2bb819,a128_0x3ac8f0['dirname'](_0x4fde51)),_0x54d949=_0x4dd813==='.'?'':_0x4dd813,_0xa1e3c6=readFileSync(_0x4fde51,_0x31da55(0x269)),_0x45d748=a128_0x31986e['parse'](_0xa1e3c6);if(isJourneyDef(_0x45d748)){const _0x3ae6df=a128_0x54a7e1(_0xa1e3c6);_0x157f4a['push']({'yamlConfig':_0x3ae6df,'folderPath':_0x54d949,'sourcePath':_0x4fde51});}else{if(!_0x5946b0?.[_0x31da55(0x19b)]){const _0x28ec99=parseSegmentYamlFile(_0xa1e3c6),_0x17f55f=normalizeChildSegmentYaml(_0x28ec99);_0x484857[_0x31da55(0x257)]({'yamlConfig':_0x17f55f,'folderPath':_0x54d949,'sourcePath':_0x4fde51});}}}return{'segments':_0x484857,'journeys':_0x157f4a};}export function validateParsedFiles(_0x3018ad,_0x3bce0c){const _0x50df33=a128_0x29b006,_0x578147=[];for(const {yamlConfig:_0x17a626,sourcePath:_0x57ace2}of _0x3018ad[_0x50df33(0x251)]){const _0x41a1d6=readFileSync(_0x57ace2,'utf-8'),_0x1c0318=a128_0x31986e[_0x50df33(0x198)](_0x41a1d6),_0x1df444=validateSegmentDef(_0x17a626,{'source':_0x41a1d6,'document':_0x1c0318});if(!_0x1df444[_0x50df33(0x222)]){const _0x3aa1af=a128_0x3ac8f0[_0x50df33(0x1c5)](_0x3bce0c,_0x57ace2);_0x578147[_0x50df33(0x257)]({'filePath':_0x3aa1af,'source':_0x41a1d6,'result':_0x1df444,'isJourney':![]});}}for(const {yamlConfig:_0x485b62,sourcePath:_0x4f6947}of _0x3018ad[_0x50df33(0x243)]){const _0x101533=readFileSync(_0x4f6947,_0x50df33(0x269)),_0x5dbbe8=a128_0x31986e[_0x50df33(0x198)](_0x101533),_0x4a92b7=validateJourneyDef(_0x485b62,{'source':_0x101533,'document':_0x5dbbe8});if(!_0x4a92b7[_0x50df33(0x222)]){const _0x5cb1d9=a128_0x3ac8f0[_0x50df33(0x1c5)](_0x3bce0c,_0x4f6947);_0x578147[_0x50df33(0x257)]({'filePath':_0x5cb1d9,'source':_0x101533,'result':_0x4a92b7,'isJourney':!![]});}}return _0x578147;}function a128_0x23ac(_0x27f53b,_0xe1b14b){_0x27f53b=_0x27f53b-0x16c;const _0x523136=a128_0x5231();let _0x23acd0=_0x523136[_0x27f53b];return _0x23acd0;}export function formatValidationErrors(_0x3dcf86){const _0x495fee=a128_0x29b006,_0x4ea97c=[];for(const {filePath:_0x521150,source:_0x5bbb74,result:_0x2b9735,isJourney:_0x4dfc20}of _0x3dcf86){const _0x507eac=_0x4dfc20?'journey':_0x495fee(0x1f3);_0x4ea97c[_0x495fee(0x257)]('\x0a'+_0x521150+'\x20('+_0x507eac+_0x495fee(0x19c)+_0x2b9735[_0x495fee(0x1fb)][_0x495fee(0x203)]+_0x495fee(0x20c)),_0x4ea97c[_0x495fee(0x257)](formatValidationResult(_0x2b9735,_0x5bbb74,_0x521150));}return _0x4ea97c[_0x495fee(0x1c6)]('\x0a');}export function buildLocalExpandedRuleMappings(_0xa77774){const _0x2dbd8b=a128_0x29b006,_0x41b173=new Set(),_0x58b4d1=new Map(),_0x37f968=collectSegmentUsageCounts(_0xa77774);if(_0xa77774[_0x2dbd8b(0x251)])for(const [_0x540652,_0x38d09b]of Object[_0x2dbd8b(0x268)](_0xa77774['segments'])){_0x41b173[_0x2dbd8b(0x21a)](_0x540652);if(_0x38d09b[_0x2dbd8b(0x230)]){const _0xd3e080=yamlRuleToApi(_0x38d09b[_0x2dbd8b(0x230)]),_0x1fe52e=apiRuleToYaml(_0xd3e080);_0x58b4d1['set'](_0x540652,_0x1fe52e);}}const _0x495418=new Map();let _0x5e94bf=0x0;for(const [_0x5aa312,_0x1ee258]of _0x58b4d1){const _0x48201a=serializeExpandedRule(_0x1ee258,_0x58b4d1),_0x3c6a43=_0x495418[_0x2dbd8b(0x267)](_0x48201a)||[];_0x3c6a43[_0x2dbd8b(0x257)]({'name':_0x5aa312,'index':_0x5e94bf}),_0x495418['set'](_0x48201a,_0x3c6a43),_0x5e94bf++;}const _0x29f645=new Map();for(const [_0x5f4e0d,_0x4afe63]of _0x495418){const _0x511641=_0x4afe63[_0x2dbd8b(0x262)]()[_0x2dbd8b(0x224)]((_0xc8bf3d,_0x3d58f1)=>{const _0x52028d=_0x2dbd8b,_0x2c5984=_0x37f968[_0x52028d(0x267)](_0xc8bf3d[_0x52028d(0x21b)])||0x0,_0x5b9f12=_0x37f968[_0x52028d(0x267)](_0x3d58f1['name'])||0x0;if(_0x2c5984!==_0x5b9f12)return _0x5b9f12-_0x2c5984;return _0xc8bf3d[_0x52028d(0x1df)]-_0x3d58f1['index'];})[_0x2dbd8b(0x1f1)](_0xa88ecf=>_0xa88ecf[_0x2dbd8b(0x21b)]),_0x3f2e09=[];for(const _0x12c500 of _0x511641){const _0x1dbad4=_0x37f968['get'](_0x12c500)||0x0,_0x354eec=Math['max'](_0x1dbad4,0x1);for(let _0x240e67=0x0;_0x240e67<_0x354eec;_0x240e67++){_0x3f2e09[_0x2dbd8b(0x257)](_0x12c500);}}_0x29f645['set'](_0x5f4e0d,_0x3f2e09);}return{'existingLocalSegmentNames':_0x41b173,'localSegmentRules':_0x58b4d1,'localExpandedRuleToNames':_0x29f645};}export function createSegmentIdResolver(_0x3decd0,_0x53195d){return async _0x1218cb=>{const _0x2bf3f6=a128_0x23ac,_0x2a3a7c=_0x3decd0[_0x2bf3f6(0x267)](_0x1218cb);if(!_0x2a3a7c)throw new SDKError(ErrorCode[_0x2bf3f6(0x242)],'Segment\x20not\x20found:\x20'+_0x1218cb+_0x2bf3f6(0x1ee)+_0x53195d+'\x27)');return _0x2a3a7c;};}export function extractRootFolderId(_0x4b55da){const _0x9d0e2e=a128_0x29b006;return _0x4b55da['relationships']?.['parentSegmentFolder']?.[_0x9d0e2e(0x207)]?.['id']||_0x4b55da['relationships']?.[_0x9d0e2e(0x24d)]?.[_0x9d0e2e(0x207)]?.['id'];}export function buildConnectionMaps(_0x58d7d4){const _0xa1a834=a128_0x29b006,_0x2e29f5=new Map(),_0x262d1f=new Map(),_0x132601=new Map();for(const _0xc98ea9 of _0x58d7d4){_0x2e29f5[_0xa1a834(0x217)](_0xc98ea9[_0xa1a834(0x21b)],parseInt(_0xc98ea9['id'],0xa)),_0x262d1f[_0xa1a834(0x217)](_0xc98ea9['id'],_0xc98ea9[_0xa1a834(0x21b)]),_0x132601[_0xa1a834(0x217)](_0xc98ea9[_0xa1a834(0x21b)],_0xc98ea9['type']);}return{'nameToId':_0x2e29f5,'idToName':_0x262d1f,'nameToType':_0x132601};}export function calculatePushStats(_0x1d2627,_0x52e9ea,_0x243a31,_0x3f3fcd,_0x3915f4,_0x49a890,_0x3c6d49){const _0x5c7d45=a128_0x29b006,_0x3944a8=_0x1d2627[_0x5c7d45(0x1e0)](_0x1e1b9d=>_0x1e1b9d[_0x5c7d45(0x223)]),_0x34ccd2=_0x1d2627[_0x5c7d45(0x1e0)](_0x2273ed=>!_0x2273ed['isNew']&&_0x2273ed[_0x5c7d45(0x177)]),_0xc1f10=_0x1d2627[_0x5c7d45(0x1e0)](_0x10ec69=>!_0x10ec69[_0x5c7d45(0x223)]&&!_0x10ec69[_0x5c7d45(0x177)]),_0x3b9966=_0x49a890?_0x3f3fcd:[],_0x1f68f8=_0x52e9ea['filter'](_0x53e45f=>_0x53e45f['isNew']),_0x43160a=_0x52e9ea['filter'](_0x408600=>!_0x408600[_0x5c7d45(0x223)]&&_0x408600[_0x5c7d45(0x177)]),_0x59fe90=_0x52e9ea[_0x5c7d45(0x1e0)](_0xb77821=>!_0xb77821[_0x5c7d45(0x223)]&&!_0xb77821[_0x5c7d45(0x177)]),_0x17a5c9=_0x49a890?_0x3915f4:[],_0x3052b7=_0x1d2627['flatMap'](_0x131307=>_0x131307[_0x5c7d45(0x24e)]),_0x5e0184=_0x3052b7[_0x5c7d45(0x1e0)](_0x135d88=>_0x135d88['type']===_0x5c7d45(0x18c)),_0x541e03=_0x3052b7[_0x5c7d45(0x1e0)](_0x5e2d92=>_0x5e2d92['type']===_0x5c7d45(0x24a)),_0x500183=_0x3052b7['filter'](_0x18ecff=>_0x18ecff['type']===_0x5c7d45(0x185)),_0x35c744=Array[_0x5c7d45(0x21d)](_0x243a31)['sort'](),_0x1d6681=_0x3c6d49?![]:_0x3944a8['length']>0x0||_0x34ccd2[_0x5c7d45(0x203)]>0x0||_0x3b9966['length']>0x0,_0xfb13d1=_0x1f68f8['length']>0x0||_0x43160a['length']>0x0||_0x17a5c9[_0x5c7d45(0x203)]>0x0,_0x513e84=_0x3c6d49?![]:_0x3052b7[_0x5c7d45(0x203)]>0x0,_0x174141=_0x35c744[_0x5c7d45(0x203)]>0x0;return{'segments':{'new':_0x3944a8,'changed':_0x34ccd2,'unchanged':_0xc1f10,'toDelete':_0x3b9966},'journeys':{'new':_0x1f68f8,'changed':_0x43160a,'unchanged':_0x59fe90,'toDelete':_0x17a5c9},'activations':{'all':_0x3052b7,'toCreate':_0x5e0184,'toUpdate':_0x541e03,'toDelete':_0x500183},'folders':{'toCreate':_0x35c744},'counts':{'segments':{'new':_0x3944a8[_0x5c7d45(0x203)],'changed':_0x34ccd2['length'],'unchanged':_0xc1f10['length'],'toDelete':_0x3b9966[_0x5c7d45(0x203)]},'journeys':{'new':_0x1f68f8[_0x5c7d45(0x203)],'changed':_0x43160a[_0x5c7d45(0x203)],'unchanged':_0x59fe90[_0x5c7d45(0x203)],'toDelete':_0x17a5c9['length']},'activations':{'create':_0x5e0184[_0x5c7d45(0x203)],'update':_0x541e03['length'],'delete':_0x500183[_0x5c7d45(0x203)]},'folders':_0x35c744[_0x5c7d45(0x203)]},'hasChanges':_0x1d6681||_0xfb13d1||_0x513e84||_0x174141};}export async function buildPushExecutionContext(_0xa3f3c,_0x3439f7,_0x4e712d,_0x5e2b4a,_0x5a3fdb,_0xe25a8c){const _0x5fc044=a128_0x29b006,_0x16a3b9=extractRootFolderId(_0x4e712d),{pathToId:_0x527174,idToPath:_0x1ecd05}=buildFolderMaps(_0x5a3fdb),_0x1d5491=buildSegmentNameToIdMap(_0x5e2b4a),_0x1e7622=new Map(),{batchAsync:_0x568c5f}=await import(_0x5fc044(0x229)),[_0x3b12ee,_0x40eefe]=await Promise['all']([_0xa3f3c[_0x5fc044(0x263)][_0x5fc044(0x182)](),_0xa3f3c[_0x5fc044(0x170)]['list'](),((async()=>{const _0x31ed15=_0x5fc044;!_0xe25a8c&&_0x5e2b4a[_0x31ed15(0x203)]>0x0&&await _0x568c5f(_0x5e2b4a,async _0x5a63bd=>{const _0x47e9df=_0x31ed15,_0x4b025a=await _0xa3f3c[_0x47e9df(0x1f3)]['listActivations'](_0x3439f7,_0x5a63bd['id']);_0x1e7622['set'](_0x5a63bd['id'],_0x4b025a);});})())]),{emailToId:_0x59762f,idToEmail:_0x55374e}=_0x3b12ee,_0x2d50dd=buildConnectionMaps(_0x40eefe);return{'rootFolderId':_0x16a3b9,'folderPathToId':_0x527174,'folderIdToPath':_0x1ecd05,'segmentNameToId':_0x1d5491,'activationsBySegmentId':_0x1e7622,'emailToIdMap':_0x59762f,'idToEmailMap':_0x55374e,'connectionNameToIdMap':_0x2d50dd[_0x5fc044(0x22b)],'connectionIdToNameMap':_0x2d50dd[_0x5fc044(0x1b3)],'connectionNameToTypeMap':_0x2d50dd['nameToType']};}export function createPushYamlContextForBundle(_0x423580,_0x3ac8e7,_0x4445d7,_0x12893f,_0x4832b8,_0x9e073b,_0x3a35cb,_0x26409b){const {existingLocalSegmentNames:_0x3b489d,localExpandedRuleToNames:_0x294787}=_0x12893f,_0x45a873=new Set(),_0x35c2b1=new Map(),_0xadf0ad=new Map(),_0x464b54=new Map(),_0x225d2c=createJumpTargetCache(),_0x2f4998=new Map(),_0x31a563=new Map(),_0x1a8961=new Set();let _0xe9bab;const _0x2a0402=_0x452c5b=>{const _0x25295f={'resolveSegment':async _0x2a709c=>{const _0x2c92c2=a128_0x23ac,_0x23a288=_0x464b54[_0x2c92c2(0x267)](_0x2a709c);if(_0x23a288!==undefined)return{'name':_0x23a288,'isJourneyLocal':!![]};try{const _0x47274a=await fetchSegment(_0x423580,_0x3ac8e7,_0x2a709c,_0x4445d7);if(!_0x47274a)throw new Error(_0x2c92c2(0x20b));const _0x29ab13=generateJourneyLocalName(_0x47274a[_0x2c92c2(0x21b)]),_0x98722c=_0x47274a[_0x2c92c2(0x206)]===SEGMENT_KIND_JOURNEY&&_0x29ab13!==undefined;let _0x158461=_0x47274a[_0x2c92c2(0x21b)],_0x263153;if(_0x98722c&&_0x47274a['rule']){const _0x1d03be=apiRuleToYaml(_0x47274a['rule']);_0x31a563[_0x2c92c2(0x217)](_0x2a709c,_0x1d03be);const _0x4a8406=async _0x5ed757=>{const _0x1faf1d=_0x2c92c2,_0x25117a=collectSegmentRefsFromRule(_0x5ed757);for(const _0x2ab86d of _0x25117a){if(!_0x31a563['has'](_0x2ab86d))try{const _0x52ab7c=await fetchSegment(_0x423580,_0x3ac8e7,_0x2ab86d,_0x4445d7);if(_0x52ab7c?.[_0x1faf1d(0x230)]){const _0x46a5e4=apiRuleToYaml(_0x52ab7c[_0x1faf1d(0x230)]);_0x31a563[_0x1faf1d(0x217)](_0x2ab86d,_0x46a5e4),await _0x4a8406(_0x46a5e4);}}catch(_0x442a5d){logger[_0x1faf1d(0x1b1)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x2ab86d+':\x20'+_0x442a5d);}}};await _0x4a8406(_0x1d03be);const _0x25a57e=serializeExpandedRule(_0x1d03be,_0x31a563),_0x159736=_0x294787[_0x2c92c2(0x267)](_0x25a57e);if(_0x159736&&_0x159736[_0x2c92c2(0x203)]>0x0){const _0x5e1970=_0x35c2b1[_0x2c92c2(0x267)](_0x25a57e)||0x0,_0x381772=_0x159736[_0x5e1970]||_0x159736[_0x159736[_0x2c92c2(0x203)]-0x1];_0x35c2b1[_0x2c92c2(0x217)](_0x25a57e,_0x5e1970+0x1),_0x158461=_0x381772,_0x45a873[_0x2c92c2(0x21a)](_0x158461),_0x464b54['set'](_0x2a709c,_0x158461);const _0x5076a3=await resolveRuleSegmentRefs(_0x1d03be,async _0x4567b1=>{const _0x2a3f52=_0x2c92c2,_0x4944dd=_0x464b54[_0x2a3f52(0x267)](_0x4567b1);if(_0x4944dd)return _0x4944dd;const _0x4eba51=await _0xe9bab[_0x2a3f52(0x25f)](_0x4567b1);return _0x4eba51[_0x2a3f52(0x21b)];});_0x263153={'description':_0x47274a[_0x2c92c2(0x1b5)],'rule':_0x5076a3};}else{const _0x15698d=_0x2f4998[_0x2c92c2(0x267)](_0x25a57e);if(_0x15698d)_0x158461=_0x15698d,_0x464b54[_0x2c92c2(0x217)](_0x2a709c,_0x158461);else{if(_0x29ab13){let _0x24a626=_0x29ab13,_0x3e560a=0x2;while(_0x45a873['has'](_0x24a626)||_0x3b489d[_0x2c92c2(0x18a)](_0x24a626)){_0x24a626=_0x29ab13+'_'+_0x3e560a,_0x3e560a++;}_0x45a873[_0x2c92c2(0x21a)](_0x24a626),_0x158461=_0x24a626;}_0x464b54[_0x2c92c2(0x217)](_0x2a709c,_0x158461),_0x2f4998['set'](_0x25a57e,_0x158461);const _0x4a736a=await resolveRuleSegmentRefs(_0x1d03be,async _0x45709c=>{const _0x86fe66=_0x2c92c2,_0xb030c8=_0x464b54[_0x86fe66(0x267)](_0x45709c);if(_0xb030c8)return _0xb030c8;const _0x2048dd=await _0xe9bab['resolveSegment'](_0x45709c);return _0x2048dd[_0x86fe66(0x21b)];});_0x263153={'description':_0x47274a[_0x2c92c2(0x1b5)],'rule':_0x4a736a};}}}return{'name':_0x158461,'isJourneyLocal':_0x98722c,'definition':_0x263153};}catch(_0x641508){return logger[_0x2c92c2(0x1b1)]('Failed\x20to\x20resolve\x20segment\x20'+_0x2a709c+':\x20'+_0x641508),{'name':_0x2a709c,'isJourneyLocal':![]};}},'resolveActivation':async _0x22048f=>{const _0x532755=a128_0x23ac,_0x32de21=_0xadf0ad[_0x532755(0x267)](_0x22048f);if(_0x32de21!==undefined)return{'name':_0x32de21,'isJourneyLocal':!![]};try{let _0x514eca=_0x3a35cb?.['get'](_0x22048f);!_0x514eca&&(_0x514eca=await _0x423580[_0x532755(0x181)][_0x532755(0x258)](_0x452c5b,_0x22048f));const _0x279dd1=_0x514eca[_0x532755(0x1c0)][_0x532755(0x18f)][_0x532755(0x21b)]||_0x22048f,_0x4b5e23=sanitizeYamlKey(_0x279dd1)||'activation_'+_0x22048f,_0x57d7a0=_0x4b5e23;_0xadf0ad['set'](_0x22048f,_0x57d7a0);const _0x5907d6=journeyActivationStepToYaml(_0x514eca,_0x4832b8,_0x9e073b);return{'name':_0x57d7a0,'isJourneyLocal':!![],'definition':_0x5907d6};}catch(_0x191978){return logger[_0x532755(0x1b1)](_0x532755(0x1d2)+_0x22048f+':\x20'+_0x191978),{'name':_0x22048f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x185e29,_0x93ebcd)=>resolveJumpTarget(_0x185e29,_0x93ebcd,_0x225d2c,async _0x480f95=>{const _0x383a90=a128_0x23ac,_0x4ae22b=_0x26409b?.[_0x383a90(0x267)](_0x480f95);if(_0x4ae22b)return _0x4ae22b;return _0x423580[_0x383a90(0x181)][_0x383a90(0x24f)](_0x480f95);})};return _0xe9bab=_0x25295f,_0x25295f;},_0x4039f5=async _0xdd9919=>{const _0x2f3212=a128_0x23ac,{collectSegmentIdsFromJourneyApi:_0x2661d6}=await import('./journey-yaml.js'),{batchAsync:_0x5316de}=await import(_0x2f3212(0x229)),_0x2e7cd4=new Set();for(const _0x46db26 of _0xdd9919){let _0x2358b9=_0x26409b?.['get'](_0x46db26);!_0x2358b9&&(_0x2358b9=await _0x423580['journey'][_0x2f3212(0x24f)](_0x46db26));const _0x46895d=_0x2661d6(_0x2358b9);for(const _0x1b59ce of _0x46895d){_0x2e7cd4[_0x2f3212(0x21a)](_0x1b59ce);}}let _0x22e3a1=Array[_0x2f3212(0x21d)](_0x2e7cd4);while(_0x22e3a1[_0x2f3212(0x203)]>0x0){const _0x5a6e7f=_0x22e3a1[_0x2f3212(0x1e0)](_0x225de0=>!_0x1a8961[_0x2f3212(0x18a)](_0x225de0));if(_0x5a6e7f[_0x2f3212(0x203)]===0x0)break;const _0x5943fe=await _0x5316de(_0x5a6e7f,async _0x1c4347=>{const _0x5b1499=_0x2f3212;_0x1a8961[_0x5b1499(0x21a)](_0x1c4347);const _0x2d69fd=await fetchSegment(_0x423580,_0x3ac8e7,_0x1c4347,_0x4445d7);if(!_0x2d69fd)return null;return{'segmentId':_0x1c4347,'segment':_0x2d69fd};},0xa),_0x180e66=new Set();for(const _0x586fb7 of _0x5943fe){if(!_0x586fb7?.[_0x2f3212(0x1f3)]?.[_0x2f3212(0x230)])continue;const _0x11c23b=apiRuleToYaml(_0x586fb7['segment']['rule']);_0x31a563[_0x2f3212(0x217)](_0x586fb7[_0x2f3212(0x1fd)],_0x11c23b);const _0x3cbad3=collectSegmentRefsFromRule(_0x11c23b);for(const _0x4f2306 of _0x3cbad3){!_0x1a8961[_0x2f3212(0x18a)](_0x4f2306)&&_0x180e66[_0x2f3212(0x21a)](_0x4f2306);}}_0x22e3a1=Array[_0x2f3212(0x21d)](_0x180e66);}};return{'createYamlContext':_0x2a0402,'prefetchJourneySegments':_0x4039f5};}export async function executePushSegments(_0x404a36,_0x54eedb,_0x35efe5,_0x3026d8,_0x5f5a8e){const _0x3bebe0=a128_0x29b006,{segmentDefToCreateRequest:_0x41a5e2,segmentDefToUpdateRequest:_0x5d595a}=await import('./child-segment-yaml.js'),_0x4e28d8=_0x35efe5[_0x3bebe0(0x266)],_0x36064a=0x5,_0x1ba4d4=async _0x17feca=>{const _0x515f74=_0x3bebe0,_0x21750e=_0x17feca[_0x515f74(0x1af)]?_0x4e28d8[_0x515f74(0x267)](_0x17feca[_0x515f74(0x1af)]):undefined;let _0x51b2a3;const _0x15a0e0={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x17feca[_0x515f74(0x223)]){_0x5f5a8e[_0x515f74(0x1dc)]?.({'type':_0x515f74(0x1d9),'name':_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)]});const _0x95a26b=_0x41a5e2(_0x17feca[_0x515f74(0x21e)],_0x21750e),_0x3057a4=await _0x5f5a8e[_0x515f74(0x26a)](_0x515f74(0x17e)+_0x17feca[_0x515f74(0x21e)]['name']+_0x515f74(0x199),()=>_0x404a36[_0x515f74(0x1f3)][_0x515f74(0x1d4)](_0x3026d8[_0x515f74(0x1a1)],_0x95a26b));_0x51b2a3=_0x3057a4[_0x515f74(0x207)]['id'],_0x15a0e0[_0x515f74(0x24c)]={'name':_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)],'id':_0x51b2a3},_0x5f5a8e['onProgress']?.({'type':_0x515f74(0x241),'name':_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)],'segmentId':_0x51b2a3}),_0x5f5a8e['logSuccess']?.(_0x515f74(0x23f)+_0x17feca['yamlConfig'][_0x515f74(0x21b)]+'\x27'),_0x15a0e0[_0x515f74(0x212)]=0x1;}else{if(_0x17feca['hasChanges']){_0x5f5a8e[_0x515f74(0x1dc)]?.({'type':'segment_updating','name':_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)]});const _0x3805ee=_0x5d595a(_0x17feca[_0x515f74(0x21e)]);_0x21750e!==_0x17feca[_0x515f74(0x18d)]?.['segmentFolderId']&&(_0x3805ee[_0x515f74(0x22f)]=_0x21750e?parseInt(_0x21750e,0xa):undefined),await _0x5f5a8e[_0x515f74(0x26a)](_0x515f74(0x171)+_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)]+_0x515f74(0x199),()=>_0x404a36['segment'][_0x515f74(0x1be)](_0x3026d8[_0x515f74(0x1a1)],_0x17feca[_0x515f74(0x18d)]['id'],_0x3805ee)),_0x51b2a3=_0x17feca[_0x515f74(0x18d)]['id'],_0x5f5a8e['onProgress']?.({'type':_0x515f74(0x1e7),'name':_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)]}),_0x5f5a8e['logSuccess']?.(_0x515f74(0x1a6)+_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)]+'\x27'),_0x15a0e0[_0x515f74(0x22c)]=0x1;}else _0x51b2a3=_0x17feca[_0x515f74(0x18d)]['id'];}}catch(_0x47fc96){const _0x4c7458=isHttp400Error(_0x47fc96),_0xeb3a63=_0x4c7458?ErrorCode[_0x515f74(0x1a3)]:ErrorCode[_0x515f74(0x260)],_0x5bb976=getErrorMessage(_0x47fc96);throw new SDKError(_0xeb3a63,_0x515f74(0x237)+(_0x17feca['isNew']?_0x515f74(0x18c):_0x515f74(0x24a))+_0x515f74(0x1c9)+_0x17feca[_0x515f74(0x213)]+_0x515f74(0x24b)+_0x5bb976,_0x47fc96);}try{const _0x43eaf2=await syncActivationsForSegment(_0x404a36,_0x3026d8[_0x515f74(0x1a1)],_0x51b2a3,_0x17feca['yamlConfig']['name'],_0x17feca[_0x515f74(0x24e)],_0x5f5a8e,_0x17feca[_0x515f74(0x213)]);_0x15a0e0[_0x515f74(0x193)]=_0x43eaf2;}catch(_0x208f4d){if(_0x208f4d instanceof SDKError)throw _0x208f4d;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x17feca[_0x515f74(0x21e)][_0x515f74(0x21b)]+'\x27\x20from\x20file:\x20'+_0x17feca['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x208f4d),_0x208f4d);}return _0x15a0e0;},_0x40fdeb=await batchAsync(_0x54eedb,_0x1ba4d4,_0x36064a),_0xb4ddc8={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5e3acd of _0x40fdeb){_0xb4ddc8[_0x3bebe0(0x212)]+=_0x5e3acd[_0x3bebe0(0x212)],_0xb4ddc8[_0x3bebe0(0x22c)]+=_0x5e3acd[_0x3bebe0(0x22c)],_0x5e3acd['createdSegmentId']&&_0xb4ddc8[_0x3bebe0(0x228)][_0x3bebe0(0x217)](_0x5e3acd[_0x3bebe0(0x24c)]['name'],_0x5e3acd[_0x3bebe0(0x24c)]['id']),_0xb4ddc8[_0x3bebe0(0x193)][_0x3bebe0(0x212)]+=_0x5e3acd[_0x3bebe0(0x193)][_0x3bebe0(0x212)],_0xb4ddc8[_0x3bebe0(0x193)][_0x3bebe0(0x22c)]+=_0x5e3acd[_0x3bebe0(0x193)][_0x3bebe0(0x22c)],_0xb4ddc8[_0x3bebe0(0x193)][_0x3bebe0(0x1e9)]+=_0x5e3acd[_0x3bebe0(0x193)][_0x3bebe0(0x1e9)];}return _0xb4ddc8;}async function syncActivationsForSegment(_0x1e585e,_0x1237c4,_0x11377d,_0x17ad84,_0x3a05d3,_0x5b5a58,_0x5644ea){const _0x2b5c6d=a128_0x29b006,_0x151498={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2831dd of _0x3a05d3){try{if(_0x2831dd['type']==='create'&&_0x2831dd[_0x2b5c6d(0x247)])_0x5b5a58[_0x2b5c6d(0x1dc)]?.({'type':_0x2b5c6d(0x240),'segmentName':_0x17ad84,'activationName':_0x2831dd[_0x2b5c6d(0x21b)]}),await _0x5b5a58[_0x2b5c6d(0x26a)](_0x2b5c6d(0x1cd)+_0x2831dd['name']+_0x2b5c6d(0x199),()=>_0x1e585e['segment'][_0x2b5c6d(0x1e8)](_0x1237c4,_0x11377d,_0x2831dd[_0x2b5c6d(0x247)])),_0x5b5a58[_0x2b5c6d(0x1dc)]?.({'type':_0x2b5c6d(0x1b7),'segmentName':_0x17ad84,'activationName':_0x2831dd[_0x2b5c6d(0x21b)]}),_0x5b5a58['logSuccess']?.(_0x2b5c6d(0x22a)+_0x2831dd[_0x2b5c6d(0x21b)]+'\x27'),_0x151498[_0x2b5c6d(0x212)]++;else{if(_0x2831dd[_0x2b5c6d(0x194)]===_0x2b5c6d(0x24a)&&_0x2831dd[_0x2b5c6d(0x247)]&&_0x2831dd[_0x2b5c6d(0x1ce)])_0x5b5a58[_0x2b5c6d(0x1dc)]?.({'type':_0x2b5c6d(0x1ae),'segmentName':_0x17ad84,'activationName':_0x2831dd[_0x2b5c6d(0x21b)]}),await _0x5b5a58[_0x2b5c6d(0x26a)](_0x2b5c6d(0x200)+_0x2831dd[_0x2b5c6d(0x21b)]+_0x2b5c6d(0x199),()=>_0x1e585e[_0x2b5c6d(0x1f3)][_0x2b5c6d(0x25d)](_0x1237c4,_0x11377d,_0x2831dd['existingActivation']['id'],_0x2831dd['validatedRequest'])),_0x5b5a58['onProgress']?.({'type':'activation_updated','segmentName':_0x17ad84,'activationName':_0x2831dd[_0x2b5c6d(0x21b)]}),_0x5b5a58[_0x2b5c6d(0x1aa)]?.('Updated\x20activation\x20\x27'+_0x2831dd[_0x2b5c6d(0x21b)]+'\x27'),_0x151498[_0x2b5c6d(0x22c)]++;else _0x2831dd[_0x2b5c6d(0x194)]===_0x2b5c6d(0x185)&&_0x2831dd['existingActivation']&&(_0x5b5a58[_0x2b5c6d(0x1dc)]?.({'type':'activation_deleting','segmentName':_0x17ad84,'activationName':_0x2831dd[_0x2b5c6d(0x21b)]}),await _0x5b5a58[_0x2b5c6d(0x26a)]('Deleting\x20activation\x20\x27'+_0x2831dd['name']+_0x2b5c6d(0x199),()=>_0x1e585e[_0x2b5c6d(0x1f3)]['deleteActivation'](_0x1237c4,_0x11377d,_0x2831dd[_0x2b5c6d(0x1ce)]['id'])),_0x5b5a58['onProgress']?.({'type':_0x2b5c6d(0x225),'segmentName':_0x17ad84,'activationName':_0x2831dd[_0x2b5c6d(0x21b)]}),_0x5b5a58[_0x2b5c6d(0x174)]?.(_0x2b5c6d(0x1a5)+_0x2831dd[_0x2b5c6d(0x21b)]+'\x27'),_0x151498['deleted']++);}}catch(_0x2d1dbc){const _0x20bd0b=isHttp400Error(_0x2d1dbc),_0x46e67a=_0x20bd0b?ErrorCode[_0x2b5c6d(0x248)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3d0dc5=getErrorMessage(_0x2d1dbc);throw new SDKError(_0x46e67a,'Failed\x20to\x20'+_0x2831dd[_0x2b5c6d(0x194)]+_0x2b5c6d(0x192)+_0x2831dd[_0x2b5c6d(0x21b)]+_0x2b5c6d(0x184)+_0x5644ea+_0x2b5c6d(0x24b)+_0x3d0dc5,_0x2d1dbc);}}return _0x151498;}export async function executePushFolders(_0x58ead8,_0x3728eb,_0x2e5ae2,_0x5f43b5,_0x37849a){const _0x39ba56=a128_0x29b006,_0x1bb25b=new Map(_0x2e5ae2),_0x883ac8=sortFoldersByDepth(_0x3728eb);for(const _0x4888f9 of _0x883ac8){const _0x496c57=_0x4888f9[_0x39ba56(0x1a4)]('/'),_0x456047=_0x496c57[_0x496c57[_0x39ba56(0x203)]-0x1],_0x5b874e=_0x496c57[_0x39ba56(0x262)](0x0,-0x1)[_0x39ba56(0x1c6)]('/'),_0x58f142=_0x1bb25b['get'](_0x5b874e);_0x37849a[_0x39ba56(0x1dc)]?.({'type':_0x39ba56(0x23d),'folder':_0x4888f9});const _0xe3a2d1={'name':_0x456047,'parentFolderId':_0x58f142},_0x5e14c2=await _0x37849a['withProgress']('Creating\x20folder\x20\x27'+_0x4888f9+_0x39ba56(0x199),()=>_0x58ead8[_0x39ba56(0x1f3)][_0x39ba56(0x232)](_0x5f43b5[_0x39ba56(0x1a1)],_0xe3a2d1));_0x1bb25b[_0x39ba56(0x217)](_0x4888f9,_0x5e14c2[_0x39ba56(0x207)]['id']),_0x37849a['onProgress']?.({'type':'folder_created','folder':_0x4888f9,'folderId':_0x5e14c2[_0x39ba56(0x207)]['id']}),_0x37849a[_0x39ba56(0x238)]?.('Created\x20folder\x20\x27'+_0x4888f9+'\x27');}return _0x1bb25b;}export async function executePushSegmentDeletions(_0x1f36d6,_0x50efc3,_0x6970b){const _0x29a098=a128_0x29b006;if(_0x50efc3[_0x29a098(0x203)]===0x0)return 0x0;const {batchAsync:_0x510fe8}=await import('../../utils/async.js'),_0x5cdd99=0x5,_0x1fd8b6=await _0x510fe8(_0x50efc3,async _0x51e848=>{const _0x2b1bb4=_0x29a098;return _0x6970b[_0x2b1bb4(0x1dc)]?.({'type':'segment_deleting','name':_0x51e848['name']}),await _0x1f36d6[_0x2b1bb4(0x1f3)]['deleteSegment'](_0x51e848['id']),_0x6970b['onProgress']?.({'type':_0x2b1bb4(0x1bc),'name':_0x51e848[_0x2b1bb4(0x21b)]}),_0x6970b[_0x2b1bb4(0x174)]?.('Deleted\x20segment\x20\x27'+_0x51e848['name']+'\x27'),0x1;},_0x5cdd99);return _0x1fd8b6[_0x29a098(0x19f)]((_0x19428c,_0x521fc0)=>_0x19428c+_0x521fc0,0x0);}export async function executePushJourneys(_0x4d1593,_0x562857,_0x247764,_0x4f53c6,_0x177e08){const _0x4199f7=a128_0x29b006,{journeyDefToRequest:_0x22e68b}=await import(_0x4199f7(0x21f)),{activationDefToCreateRequest:_0x2fa524,yamlRuleToApi:_0x5c2bf3,validateSegmentRule:_0x374402}=await import(_0x4199f7(0x1f6)),_0x1eb23e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x53ac79=new Map(_0x247764[_0x4199f7(0x1f5)]),_0x3f3bf6=0x5;for(let _0x36a013=0x0;_0x36a013<_0x562857[_0x4199f7(0x203)];_0x36a013+=_0x3f3bf6){const _0x30d00d=_0x562857[_0x4199f7(0x262)](_0x36a013,_0x36a013+_0x3f3bf6),_0x5892c3=await Promise['all'](_0x30d00d[_0x4199f7(0x1f1)](async _0x5ec467=>{const _0x309291=_0x4199f7;if(!_0x5ec467[_0x309291(0x223)]&&!_0x5ec467[_0x309291(0x177)])return{'action':_0x309291(0x246),'name':_0x5ec467[_0x309291(0x21e)]['name'],'journeyId':_0x5ec467['existingJourney']?.['id']};const _0x477caf=_0x5ec467['folderPath']?_0x247764[_0x309291(0x266)][_0x309291(0x267)](_0x5ec467[_0x309291(0x1af)]):undefined;_0x177e08[_0x309291(0x1dc)]?.({'type':_0x5ec467[_0x309291(0x223)]?_0x309291(0x196):_0x309291(0x1d8),'name':_0x5ec467['yamlConfig']['name']});try{const _0x482206=await executeSingleJourneyPush(_0x4d1593,_0x5ec467,{..._0x247764,'segmentNameToId':_0x53ac79},{'parentId':_0x4f53c6[_0x309291(0x1a1)],'rootFolderId':_0x4f53c6[_0x309291(0x1bf)],'folderId':_0x477caf,'verbose':_0x4f53c6[_0x309291(0x231)]},_0x177e08,{'journeyDefToRequest':_0x22e68b,'activationDefToCreateRequest':_0x2fa524,'yamlRuleToApi':_0x5c2bf3,'validateSegmentRule':_0x374402});for(const [_0x1d71b1,_0x5a541e]of _0x482206[_0x309291(0x239)]){_0x53ac79[_0x309291(0x217)](_0x1d71b1,_0x5a541e),_0x1eb23e[_0x309291(0x239)][_0x309291(0x217)](_0x1d71b1,_0x5a541e);}if(_0x482206[_0x309291(0x1a2)]==='created')_0x177e08['onProgress']?.({'type':_0x309291(0x1b2),'name':_0x5ec467[_0x309291(0x21e)][_0x309291(0x21b)],'journeyId':_0x482206[_0x309291(0x255)]}),_0x177e08[_0x309291(0x1aa)]?.('Created\x20journey\x20\x27'+_0x5ec467[_0x309291(0x21e)][_0x309291(0x21b)]+'\x27'),_0x1eb23e[_0x309291(0x212)]++;else _0x482206[_0x309291(0x1a2)]===_0x309291(0x22c)&&(_0x177e08[_0x309291(0x1dc)]?.({'type':_0x309291(0x1ec),'name':_0x5ec467[_0x309291(0x21e)][_0x309291(0x21b)]}),_0x177e08[_0x309291(0x1aa)]?.(_0x309291(0x208)+_0x5ec467[_0x309291(0x21e)][_0x309291(0x21b)]+'\x27'),_0x1eb23e['updated']++);return{'action':_0x482206['action'],'name':_0x5ec467[_0x309291(0x21e)][_0x309291(0x21b)],'journeyId':_0x482206['journeyId']};}catch(_0x2ebd43){const _0x4c952f=isHttp400Error(_0x2ebd43),_0x59e631=_0x4c952f?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x309291(0x218)],_0x5923c4=getErrorMessage(_0x2ebd43);throw new SDKError(_0x59e631,_0x309291(0x237)+(_0x5ec467[_0x309291(0x223)]?'create':_0x309291(0x24a))+_0x309291(0x190)+_0x5ec467[_0x309291(0x213)]+_0x309291(0x24b)+_0x5923c4,_0x2ebd43);}}));_0x1eb23e[_0x4199f7(0x1cb)]['push'](..._0x5892c3);}return _0x1eb23e;}async function matchExistingJourneySegments(_0xc45410,_0x4031ce,_0x215a90,_0x11c438,_0x32cdc7){const _0x8a77c0=a128_0x29b006;if(!_0x4031ce[_0x8a77c0(0x256)]||!_0x4031ce[_0x8a77c0(0x21e)]['segments'])return;const _0x58b48c=new Map(),_0x3d9cd4=new Set();for(const _0x3fd613 of Object[_0x8a77c0(0x234)](_0x4031ce['yamlConfig'][_0x8a77c0(0x251)])){const _0x160b61=generateDeterministicJourneySegmentName(_0x4031ce['yamlConfig'][_0x8a77c0(0x21b)],_0x3fd613);_0x58b48c['set'](_0x160b61,_0x3fd613),_0x3d9cd4[_0x8a77c0(0x21a)](_0x3fd613);}const _0xd01295=[],_0x38af50=collectSegmentIdsFromJourneyApi(_0x4031ce[_0x8a77c0(0x256)]);for(const _0x158217 of _0x38af50){const _0x2d9431=await fetchSegment(_0xc45410,_0x215a90,_0x158217,_0x11c438);if(!_0x2d9431?.[_0x8a77c0(0x21b)])continue;const _0x29d5c6=_0x58b48c[_0x8a77c0(0x267)](_0x2d9431[_0x8a77c0(0x21b)]);_0x29d5c6?(_0x32cdc7[_0x8a77c0(0x217)](_0x29d5c6,_0x158217),_0x3d9cd4[_0x8a77c0(0x185)](_0x29d5c6)):_0xd01295[_0x8a77c0(0x257)]({'id':_0x158217,'seg':_0x2d9431});}if(_0x3d9cd4[_0x8a77c0(0x1c8)]>0x0&&_0xd01295[_0x8a77c0(0x203)]>0x0){const {localExpandedRuleToNames:_0x3b679f}=buildLocalExpandedRuleMappings(_0x4031ce[_0x8a77c0(0x21e)]),_0x5f5fed=new Map();for(const {id:_0x44e76e,seg:_0x56cb0f}of _0xd01295){if(_0x56cb0f[_0x8a77c0(0x230)]){const _0x1b1bb3=apiRuleToYaml(_0x56cb0f['rule']);_0x5f5fed[_0x8a77c0(0x217)](_0x44e76e,_0x1b1bb3);}}for(const {id:_0x23d4d2,seg:_0x57db78}of _0xd01295){if(!_0x57db78[_0x8a77c0(0x230)])continue;const _0x58a8f6=_0x5f5fed[_0x8a77c0(0x267)](_0x23d4d2);if(!_0x58a8f6)continue;const _0x1d5a23=serializeExpandedRule(_0x58a8f6,_0x5f5fed),_0x17195f=_0x3b679f[_0x8a77c0(0x267)](_0x1d5a23);if(_0x17195f){const _0x65768=_0x17195f['find'](_0x34a374=>_0x3d9cd4[_0x8a77c0(0x18a)](_0x34a374));_0x65768&&(_0x32cdc7[_0x8a77c0(0x217)](_0x65768,_0x23d4d2),_0x3d9cd4[_0x8a77c0(0x185)](_0x65768),logger[_0x8a77c0(0x1b1)]('Matched\x20server\x20segment\x20\x27'+_0x57db78[_0x8a77c0(0x21b)]+_0x8a77c0(0x20e)+_0x65768+_0x8a77c0(0x20d)));}}}}async function executeSingleJourneyPush(_0x95852d,_0x4a6f45,_0x50a679,_0x4dff0a,_0x5eaa7f,_0xfbcaba){const _0x123da6=a128_0x29b006,{journeyDefToRequest:_0x3528e4,activationDefToCreateRequest:_0x36deb8,yamlRuleToApi:_0x3984eb,validateSegmentRule:_0x4936ed}=_0xfbcaba,_0x1d09ea=new Map(),_0x2d3f6a=new Map();recoverSegmentIdsFromPushRecovery(_0x4a6f45,_0x1d09ea,_0x50a679[_0x123da6(0x1f5)]);const _0x3a6f70=new Map(),_0x224c5d=new Map(),_0x47e1f2=new Map();let _0x3e6dee;const _0x454c64=async()=>{const _0x1c10e8=_0x123da6;if(_0x3e6dee)return;_0x3e6dee=new Map();if(!_0x4a6f45[_0x1c10e8(0x256)])return;const _0x219ad1=await _0x95852d['journey'][_0x1c10e8(0x252)](_0x4a6f45[_0x1c10e8(0x256)]['id']);for(const _0x3e4be7 of _0x219ad1){const _0x1d3935=journeyActivationStepToYaml(_0x3e4be7,_0x50a679['idToEmailMap'],_0x50a679[_0x1c10e8(0x191)]),_0x533146=activationSignature(_0x1d3935);!_0x3e6dee[_0x1c10e8(0x18a)](_0x533146)&&_0x3e6dee[_0x1c10e8(0x217)](_0x533146,_0x3e4be7['id']),_0x1d3935[_0x1c10e8(0x21b)]&&_0x2d3f6a[_0x1c10e8(0x217)](_0x1d3935[_0x1c10e8(0x21b)],_0x3e4be7['id']);}};await matchExistingJourneySegments(_0x95852d,_0x4a6f45,_0x4dff0a[_0x123da6(0x1a1)],_0x50a679[_0x123da6(0x1bd)],_0x50a679[_0x123da6(0x1f5)]);const _0x3283db={'resolveSegmentId':async _0x4aad83=>{const _0x3c8194=_0x123da6,_0x246610=_0x50a679['segmentNameToId'][_0x3c8194(0x267)](_0x4aad83);if(!_0x246610)throw new SDKError(ErrorCode[_0x3c8194(0x242)],'Segment\x20not\x20found:\x20'+_0x4aad83+_0x3c8194(0x205)+_0x4a6f45[_0x3c8194(0x21e)][_0x3c8194(0x21b)]+')');return _0x246610;},'resolveEmbeddedSegmentId':async(_0x1c1b72,_0x2eafc6)=>{const _0x336160=_0x123da6,_0xe69d0f=_0x50a679[_0x336160(0x1f5)][_0x336160(0x267)](_0x1c1b72);if(_0xe69d0f)return _0xe69d0f;const _0x4fd737=_0x50a679[_0x336160(0x1bd)][_0x336160(0x175)](_0x423cc8=>_0x423cc8['name']===_0x1c1b72);if(_0x4fd737)return _0x50a679[_0x336160(0x1f5)][_0x336160(0x217)](_0x1c1b72,_0x4fd737['id']),_0x4fd737['id'];if(_0x4a6f45[_0x336160(0x223)]){const {stageName:_0x336018,criteriaName:_0x2f67b3}=findSegmentCriteriaLocation(_0x4a6f45['yamlConfig'],_0x1c1b72);return _0x4936ed(_0x1c1b72,_0x2eafc6['rule']),_0x224c5d[_0x336160(0x217)](_0x1c1b72,{'definition':_0x2eafc6,'stageName':_0x336018,'criteriaName':_0x2f67b3}),createPendingSegmentId(_0x1c1b72);}const _0x27a59f=_0x4a6f45[_0x336160(0x256)]?.['id'];if(!_0x27a59f)throw new SDKError(ErrorCode[_0x336160(0x1e3)],_0x336160(0x17b));const _0xa28178=_0x3a6f70[_0x336160(0x267)](_0x1c1b72);if(_0xa28178)return _0xa28178;const _0x267c43=((async()=>{const _0x46e5e0=_0x336160;_0x4936ed(_0x1c1b72,_0x2eafc6[_0x46e5e0(0x230)]);const _0x53ab0e=generateDeterministicJourneySegmentName(_0x4a6f45[_0x46e5e0(0x21e)][_0x46e5e0(0x21b)],_0x1c1b72),_0x1710c8=_0x50a679[_0x46e5e0(0x1bd)][_0x46e5e0(0x175)](_0x5e2001=>_0x5e2001[_0x46e5e0(0x21b)]===_0x53ab0e),_0x13ee1e=createSegmentIdResolver(_0x50a679[_0x46e5e0(0x1f5)],_0x1c1b72),_0x6ba517=await resolveRuleSegmentIds(_0x2eafc6[_0x46e5e0(0x230)],_0x13ee1e);let _0x2b38cb;return _0x1710c8?(await _0x95852d[_0x46e5e0(0x1f3)][_0x46e5e0(0x1be)](_0x4dff0a[_0x46e5e0(0x1a1)],_0x1710c8['id'],{'description':_0x2eafc6['description']||_0x46e5e0(0x1c7)+_0x1c1b72,'rule':_0x3984eb(_0x6ba517,!![]),'countPopulation':!![]}),_0x2b38cb=_0x1710c8['id'],saveSegmentToPushRecovery(_0x4a6f45['absolutePath'],_0x4a6f45[_0x46e5e0(0x21e)][_0x46e5e0(0x21b)],_0x1c1b72,{'segmentId':_0x2b38cb,'uniqueServerName':_0x53ab0e,'createdAt':new Date()[_0x46e5e0(0x179)]()})):_0x2b38cb=await createOrRecoverEmbeddedSegment(_0x95852d,_0x4a6f45,{'localName':_0x1c1b72,'uniqueSegmentName':_0x53ab0e,'description':_0x2eafc6[_0x46e5e0(0x1b5)]||_0x46e5e0(0x1c7)+_0x1c1b72,'journeyId':_0x27a59f,'resolvedRule':_0x6ba517,'parentId':_0x4dff0a[_0x46e5e0(0x1a1)],'folderId':_0x4dff0a[_0x46e5e0(0x1bf)]||''},_0x3984eb),_0x50a679[_0x46e5e0(0x1f5)]['set'](_0x1c1b72,_0x2b38cb),_0x1d09ea[_0x46e5e0(0x217)](_0x1c1b72,_0x2b38cb),_0x2b38cb;})());_0x3a6f70[_0x336160(0x217)](_0x1c1b72,_0x267c43);try{return await _0x267c43;}finally{_0x3a6f70[_0x336160(0x185)](_0x1c1b72);}},'resolveActivationId':async _0x2f4014=>{const _0x281735=_0x123da6,_0x40602f=_0x2d3f6a[_0x281735(0x267)](_0x2f4014);if(_0x40602f)return _0x40602f;if(_0x4a6f45[_0x281735(0x256)]){await _0x454c64();const _0x3fef19=_0x2d3f6a[_0x281735(0x267)](_0x2f4014);if(_0x3fef19)return _0x3fef19;}throw new SDKError(ErrorCode[_0x281735(0x183)],'Activation\x20not\x20found:\x20'+_0x2f4014+_0x281735(0x205)+_0x4a6f45[_0x281735(0x21e)]['name']+').\x20'+_0x281735(0x176));},'resolveEmbeddedActivationId':async(_0x3bdd4e,_0x477fe4)=>{const _0x1be5e2=_0x123da6,_0x269baa=_0x2d3f6a[_0x1be5e2(0x267)](_0x3bdd4e);if(_0x269baa)return _0x269baa;if(_0x4a6f45[_0x1be5e2(0x223)])return _0x47e1f2['set'](_0x3bdd4e,_0x477fe4),createPendingActivationId(_0x3bdd4e);if(_0x4a6f45[_0x1be5e2(0x256)]){await _0x454c64();const _0x35497d=_0x2d3f6a['get'](_0x477fe4[_0x1be5e2(0x21b)]);if(_0x35497d)return _0x2d3f6a[_0x1be5e2(0x217)](_0x3bdd4e,_0x35497d),_0x35497d;const _0x195801=activationSignature(_0x477fe4),_0x1a92be=_0x3e6dee?.[_0x1be5e2(0x267)](_0x195801);if(_0x1a92be)return _0x2d3f6a['set'](_0x3bdd4e,_0x1a92be),_0x1a92be;const _0x262a7d=await _0x36deb8(_0x477fe4,_0x50a679[_0x1be5e2(0x1b8)]),_0x53777c={..._0x262a7d,..._0x477fe4[_0x1be5e2(0x1eb)]!==undefined&&{'runAfterJourneyRefresh':_0x477fe4[_0x1be5e2(0x1eb)]}},_0xd6f1f0=await _0x95852d[_0x1be5e2(0x181)][_0x1be5e2(0x1e8)](_0x4a6f45[_0x1be5e2(0x256)]['id'],_0x53777c);return _0x2d3f6a[_0x1be5e2(0x217)](_0x3bdd4e,_0xd6f1f0['id']),_0xd6f1f0['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x1be5e2(0x22e));},'resolveJourneyId':async _0x3b369f=>{const _0x3146fa=_0x123da6;try{return await _0x95852d[_0x3146fa(0x181)][_0x3146fa(0x188)](_0x4dff0a[_0x3146fa(0x1a1)],_0x3b369f);}catch(_0x69e288){throw new SDKError(ErrorCode['NOT_FOUND'],_0x3146fa(0x25b)+_0x3b369f+_0x3146fa(0x1b0)+_0x4a6f45[_0x3146fa(0x21e)][_0x3146fa(0x21b)]+'\x27)',_0x69e288);}},'resolveStageId':async(_0xb8cb4d,_0x507e98)=>{const _0x2f7dc0=_0x123da6,_0x21bdc6=await _0x95852d['journey'][_0x2f7dc0(0x24f)](_0xb8cb4d),_0x541ddd=_0x21bdc6[_0x2f7dc0(0x1c0)][_0x2f7dc0(0x216)][_0x2f7dc0(0x175)](_0x38fdfe=>_0x38fdfe[_0x2f7dc0(0x21b)][_0x2f7dc0(0x1ed)]()===_0x507e98[_0x2f7dc0(0x1ed)]());if(!_0x541ddd?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x2f7dc0(0x172)+_0x507e98+_0x2f7dc0(0x264)+(_0x21bdc6[_0x2f7dc0(0x1c0)]['journeyBundleName']||_0x21bdc6[_0x2f7dc0(0x1c0)][_0x2f7dc0(0x21b)])+'\x27');return _0x541ddd['id'];}},_0x5d9a3e=await _0x3528e4(_0x4a6f45[_0x123da6(0x21e)],_0x4dff0a['parentId'],_0x3283db),_0x19a925=_0x4dff0a[_0x123da6(0x25c)]||_0x4dff0a[_0x123da6(0x1bf)];_0x19a925&&(_0x5d9a3e[_0x123da6(0x1f0)]={'parentFolder':{'data':{'id':_0x19a925,'type':_0x123da6(0x1ef)}}});if(_0x4a6f45[_0x123da6(0x223)]){if(_0x224c5d[_0x123da6(0x1c8)]>0x0||_0x47e1f2[_0x123da6(0x1c8)]>0x0)return await executeThreeStepJourneyCreate(_0x95852d,_0x4a6f45,_0x5d9a3e,{'pendingEmbeddedSegments':_0x224c5d,'pendingEmbeddedActivations':_0x47e1f2,'embeddedSegmentNameToId':_0x1d09ea,'journeyActivationNameToId':_0x2d3f6a},{..._0x4dff0a,'effectiveFolderId':_0x19a925},_0x50a679,_0x5eaa7f,_0xfbcaba);else{ensureJourneyDefaults(_0x5d9a3e['attributes']);const _0x4da451=await _0x95852d[_0x123da6(0x181)][_0x123da6(0x18c)](_0x5d9a3e);return deletePushRecovery(_0x4a6f45['absolutePath']),{'action':_0x123da6(0x212),'journeyId':_0x4da451['id'],'embeddedSegmentNameToId':_0x1d09ea};}}else{if(_0x4a6f45[_0x123da6(0x177)]&&_0x4a6f45[_0x123da6(0x256)]){_0x5d9a3e['id']=_0x4a6f45[_0x123da6(0x256)]['id'];const _0x461c23=_0x5d9a3e[_0x123da6(0x1c0)];_0x4a6f45[_0x123da6(0x256)][_0x123da6(0x1c0)]?.[_0x123da6(0x1fe)]&&(_0x461c23[_0x123da6(0x1fe)]=_0x4a6f45['existingJourney']['attributes'][_0x123da6(0x1fe)]);const _0x37fb3c=_0x4a6f45[_0x123da6(0x256)][_0x123da6(0x1c0)]?.['journeyStages'];return _0x37fb3c&&_0x5d9a3e[_0x123da6(0x1c0)][_0x123da6(0x216)]&&injectExistingStageIds(_0x5d9a3e[_0x123da6(0x1c0)][_0x123da6(0x216)],_0x37fb3c),ensureJourneyDefaults(_0x461c23),await _0x95852d[_0x123da6(0x181)]['update'](_0x4a6f45['existingJourney']['id'],_0x5d9a3e),deletePushRecovery(_0x4a6f45[_0x123da6(0x213)]),{'action':_0x123da6(0x22c),'journeyId':_0x4a6f45[_0x123da6(0x256)]['id'],'embeddedSegmentNameToId':_0x1d09ea};}}return deletePushRecovery(_0x4a6f45[_0x123da6(0x213)]),{'action':_0x123da6(0x246),'journeyId':_0x4a6f45[_0x123da6(0x256)]?.['id'],'embeddedSegmentNameToId':_0x1d09ea};}function findSegmentCriteriaLocation(_0x2eb839,_0x237640){const _0x6d8a69=a128_0x29b006,_0x5e51a7=_0x2eb839[_0x6d8a69(0x1fa)]||_0x2eb839[_0x6d8a69(0x243)]?.[0x0]?.[_0x6d8a69(0x1fa)]||[];let _0xd1c861=_0x6d8a69(0x1d0),_0x24938e=_0x237640;const _0x19eace=_0x2eb839[_0x6d8a69(0x1fc)]||_0x2eb839['journeys']?.[0x0]?.[_0x6d8a69(0x1fc)];if(_0x19eace?.[_0x6d8a69(0x1f3)]===_0x237640)return{'stageName':_0x6d8a69(0x1fc),'criteriaName':_0x19eace[_0x6d8a69(0x21b)]||_0x237640};_0x474c3e:for(const _0x456a70 of _0x5e51a7){if(_0x456a70[_0x6d8a69(0x1f2)]?.[_0x6d8a69(0x1f3)]===_0x237640){_0xd1c861=_0x456a70[_0x6d8a69(0x21b)],_0x24938e=_0x456a70[_0x6d8a69(0x1f2)]['name']||_0x237640;break;}if(_0x456a70[_0x6d8a69(0x17a)])for(const _0x3c6fed of _0x456a70['steps']){if(_0x3c6fed['type']===_0x6d8a69(0x1d5)&&_0x3c6fed['with']?.[_0x6d8a69(0x221)])for(const _0x32dbce of _0x3c6fed[_0x6d8a69(0x1d3)][_0x6d8a69(0x221)]){if(_0x32dbce[_0x6d8a69(0x1f3)]===_0x237640){_0xd1c861=_0x456a70['name'],_0x24938e=_0x32dbce[_0x6d8a69(0x21b)]||_0x237640;break _0x474c3e;}}}}return{'stageName':_0xd1c861,'criteriaName':_0x24938e};}async function executeThreeStepJourneyCreate(_0x1e454a,_0x1b774c,_0x58506a,_0x24cfc6,_0x54d242,_0x2821e4,_0x150c1e,_0x440f3c){const _0x485e79=a128_0x29b006,{activationDefToCreateRequest:_0x92189a,yamlRuleToApi:_0x3eadaf}=_0x440f3c,{pendingEmbeddedSegments:_0x480a5f,pendingEmbeddedActivations:_0x3c43dc,embeddedSegmentNameToId:_0x26ded1}=_0x24cfc6,_0x1dc3fa=JSON['parse'](JSON[_0x485e79(0x204)](_0x58506a));ensureJourneyDefaults(_0x1dc3fa[_0x485e79(0x1c0)]),stripPendingIds(_0x1dc3fa);const _0x21a128=await _0x1e454a[_0x485e79(0x181)]['create'](_0x1dc3fa),_0x34ff1f=_0x21a128['id'],_0x287a70=new Map();for(const _0xb35f47 of _0x21a128[_0x485e79(0x1c0)]['journeyStages']){_0x287a70[_0x485e79(0x217)](_0xb35f47[_0x485e79(0x21b)][_0x485e79(0x1ed)](),_0xb35f47['id']);}recoverSegmentIdsFromPushRecovery(_0x1b774c,_0x26ded1,_0x2821e4[_0x485e79(0x1f5)]);for(const [_0x755da3,{definition:_0x5ac946}]of _0x480a5f){if(_0x26ded1[_0x485e79(0x18a)](_0x755da3)){_0x150c1e[_0x485e79(0x1dc)]?.({'type':_0x485e79(0x1e4),'journeyName':_0x1b774c['yamlConfig'][_0x485e79(0x21b)],'segmentName':_0x755da3});continue;}const _0x2a10cc=generateDeterministicJourneySegmentName(_0x1b774c[_0x485e79(0x21e)][_0x485e79(0x21b)],_0x755da3);_0x150c1e['onProgress']?.({'type':_0x485e79(0x26c),'journeyName':_0x1b774c[_0x485e79(0x21e)][_0x485e79(0x21b)],'segmentName':_0x755da3});const _0x1765e3=createSegmentIdResolver(_0x2821e4[_0x485e79(0x1f5)],_0x755da3),_0xd4952a=await resolveRuleSegmentIds(_0x5ac946['rule'],_0x1765e3),_0x49d5e3=await createOrRecoverEmbeddedSegment(_0x1e454a,_0x1b774c,{'localName':_0x755da3,'uniqueSegmentName':_0x2a10cc,'description':_0x5ac946[_0x485e79(0x1b5)]||_0x485e79(0x1c7)+_0x755da3,'journeyId':_0x34ff1f,'resolvedRule':_0xd4952a,'parentId':_0x54d242[_0x485e79(0x1a1)],'folderId':_0x54d242['effectiveFolderId']||''},_0x3eadaf);_0x26ded1[_0x485e79(0x217)](_0x755da3,_0x49d5e3),_0x2821e4['segmentNameToId'][_0x485e79(0x217)](_0x755da3,_0x49d5e3),_0x150c1e[_0x485e79(0x1dc)]?.({'type':_0x485e79(0x1e4),'journeyName':_0x1b774c[_0x485e79(0x21e)]['name'],'segmentName':_0x755da3});}const _0x4fccd3=new Map();for(const [_0x2b186e,_0x147cae]of _0x3c43dc){_0x150c1e['onProgress']?.({'type':_0x485e79(0x180),'journeyName':_0x1b774c['yamlConfig'][_0x485e79(0x21b)],'activationName':_0x2b186e});const _0x1453a1=await _0x92189a(_0x147cae,_0x2821e4['activationContext']),_0x1a8153={..._0x1453a1,..._0x147cae[_0x485e79(0x1eb)]!==undefined&&{'runAfterJourneyRefresh':_0x147cae[_0x485e79(0x1eb)]}},_0x2d19b6=await _0x1e454a[_0x485e79(0x181)][_0x485e79(0x1e8)](_0x34ff1f,_0x1a8153);_0x4fccd3[_0x485e79(0x217)](_0x2b186e,_0x2d19b6['id']),_0x24cfc6[_0x485e79(0x261)][_0x485e79(0x217)](_0x2b186e,_0x2d19b6['id']),_0x150c1e['onProgress']?.({'type':_0x485e79(0x1e5),'journeyName':_0x1b774c[_0x485e79(0x21e)]['name'],'activationName':_0x2b186e});}const _0x4268c5=JSON[_0x485e79(0x16c)](JSON[_0x485e79(0x204)](_0x58506a));return _0x4268c5['id']=_0x34ff1f,ensureJourneyDefaults(_0x4268c5[_0x485e79(0x1c0)]),resolvePendingIdsInRequest(_0x4268c5,_0x58506a,_0x287a70,_0x26ded1,_0x4fccd3,_0x150c1e),await _0x1e454a['journey'][_0x485e79(0x24a)](_0x34ff1f,_0x4268c5),deletePushRecovery(_0x1b774c[_0x485e79(0x213)]),{'action':_0x485e79(0x212),'journeyId':_0x34ff1f,'embeddedSegmentNameToId':_0x26ded1};}export function stripWaitStepPendingIds(_0x5d98f4){const _0x1797fd=a128_0x29b006,_0x5049b0=_0x5d98f4[_0x1797fd(0x210)]&&isPendingSegmentId(_0x5d98f4[_0x1797fd(0x210)]),_0x5c2ec6=_0x5d98f4['conditions']?.['some'](_0x2fa982=>_0x2fa982[_0x1797fd(0x1fd)]&&isPendingSegmentId(_0x2fa982[_0x1797fd(0x1fd)]));(_0x5049b0||_0x5c2ec6)&&(_0x5d98f4[_0x1797fd(0x1de)]='Duration',_0x5d98f4[_0x1797fd(0x1e1)]=0x1,_0x5d98f4[_0x1797fd(0x1d6)]=_0x1797fd(0x1f9),delete _0x5d98f4[_0x1797fd(0x210)],delete _0x5d98f4[_0x1797fd(0x26b)],delete _0x5d98f4['conditionTimeoutUnit'],delete _0x5d98f4[_0x1797fd(0x21c)]);}export function resolveWaitStepPendingIds(_0x25bbba,_0x5df87c,_0x15be84,_0xc56eaa){const _0x2f6b2e=a128_0x29b006;if(_0x5df87c[_0x2f6b2e(0x210)]&&isPendingSegmentId(_0x5df87c['conditionSegmentId'])){const _0x5a33c3=_0x15be84(_0x5df87c[_0x2f6b2e(0x210)],_0x2f6b2e(0x17d)+_0xc56eaa+_0x2f6b2e(0x226));_0x5a33c3&&(_0x25bbba[_0x2f6b2e(0x1de)]=_0x2f6b2e(0x1f8),_0x25bbba[_0x2f6b2e(0x210)]=_0x5a33c3,delete _0x25bbba[_0x2f6b2e(0x1e1)],delete _0x25bbba[_0x2f6b2e(0x1d6)],_0x5df87c[_0x2f6b2e(0x26b)]!==undefined&&(_0x25bbba[_0x2f6b2e(0x26b)]=_0x5df87c['conditionTimeoutDuration']),_0x5df87c[_0x2f6b2e(0x20a)]&&(_0x25bbba[_0x2f6b2e(0x20a)]=_0x5df87c[_0x2f6b2e(0x20a)]));}if(_0x5df87c['conditions']){const _0x5265db=_0x5df87c[_0x2f6b2e(0x21c)][_0x2f6b2e(0x1b6)](_0x323668=>_0x323668[_0x2f6b2e(0x1fd)]&&isPendingSegmentId(_0x323668[_0x2f6b2e(0x1fd)]));if(_0x5265db){const _0x4ac28c=_0x5df87c['conditions'][_0x2f6b2e(0x1f1)](_0x583590=>{const _0xe90d1=_0x2f6b2e;if(_0x583590['segmentId']&&isPendingSegmentId(_0x583590['segmentId'])){const _0x504ed8=_0x15be84(_0x583590[_0xe90d1(0x1fd)],_0xe90d1(0x17d)+_0xc56eaa+_0xe90d1(0x226));return{..._0x583590,'segmentId':_0x504ed8||_0x583590[_0xe90d1(0x1fd)]};}return{..._0x583590};});_0x25bbba[_0x2f6b2e(0x1de)]='Condition',_0x25bbba[_0x2f6b2e(0x21c)]=_0x4ac28c,delete _0x25bbba[_0x2f6b2e(0x1e1)],delete _0x25bbba[_0x2f6b2e(0x1d6)],delete _0x25bbba[_0x2f6b2e(0x210)],delete _0x25bbba[_0x2f6b2e(0x26b)],delete _0x25bbba[_0x2f6b2e(0x20a)];}}}function stripPendingIds(_0x131536){const _0x679852=a128_0x29b006;_0x131536[_0x679852(0x1c0)][_0x679852(0x1fc)]?.[_0x679852(0x1fd)]&&isPendingSegmentId(_0x131536[_0x679852(0x1c0)][_0x679852(0x1fc)][_0x679852(0x1fd)])&&delete _0x131536[_0x679852(0x1c0)][_0x679852(0x1fc)];for(const _0x20ff90 of _0x131536['attributes'][_0x679852(0x216)]||[]){_0x20ff90['entryCriteria']?.[_0x679852(0x1fd)]&&isPendingSegmentId(_0x20ff90[_0x679852(0x1dd)][_0x679852(0x1fd)])&&delete _0x20ff90[_0x679852(0x1dd)];_0x20ff90[_0x679852(0x1ad)]?.[_0x679852(0x1fd)]&&isPendingSegmentId(_0x20ff90['milestone']['segmentId'])&&delete _0x20ff90[_0x679852(0x1ad)];_0x20ff90[_0x679852(0x1ab)]&&(_0x20ff90[_0x679852(0x1ab)]=_0x20ff90[_0x679852(0x1ab)][_0x679852(0x1e0)](_0x450e6d=>!_0x450e6d[_0x679852(0x1fd)]||!isPendingSegmentId(_0x450e6d[_0x679852(0x1fd)])));if(_0x20ff90[_0x679852(0x17a)])for(const _0x3e4e59 of Object[_0x679852(0x234)](_0x20ff90['steps'])){const _0x29c230=_0x20ff90[_0x679852(0x17a)][_0x3e4e59];_0x29c230[_0x679852(0x194)]===_0x679852(0x1ca)&&_0x29c230[_0x679852(0x22d)]&&isPendingActivationId(_0x29c230[_0x679852(0x22d)])&&(_0x29c230['journeyActivationStepId']='');if(_0x29c230[_0x679852(0x194)]==='DecisionPoint'&&_0x29c230[_0x679852(0x221)])for(const _0x2cfe37 of _0x29c230[_0x679852(0x221)]){_0x2cfe37[_0x679852(0x1fd)]&&isPendingSegmentId(_0x2cfe37['segmentId'])&&(_0x2cfe37[_0x679852(0x1fd)]='');}_0x29c230[_0x679852(0x194)]==='WaitStep'&&stripWaitStepPendingIds(_0x29c230);}}}function resolvePendingIdsInRequest(_0xa56aab,_0x289b57,_0x438902,_0x20483c,_0x1eccdb,_0x56419b){const _0x21d8b0=a128_0x29b006,_0x1ca928=(_0x379556,_0x396fc4)=>{const _0x541a5f=a128_0x23ac;if(!isPendingSegmentId(_0x379556))return _0x379556;const _0xf1d3f7=extractPendingSegmentName(_0x379556),_0x9c64fc=_0x20483c[_0x541a5f(0x267)](_0xf1d3f7);return!_0x9c64fc&&_0x56419b['logWarning']?.(_0x541a5f(0x202)+_0xf1d3f7+_0x541a5f(0x19d)+_0x396fc4),_0x9c64fc;};if(_0xa56aab[_0x21d8b0(0x1c0)]['goal']?.[_0x21d8b0(0x1fd)]&&isPendingSegmentId(_0xa56aab[_0x21d8b0(0x1c0)][_0x21d8b0(0x1fc)][_0x21d8b0(0x1fd)])){const _0x5c2597=_0x1ca928(_0xa56aab[_0x21d8b0(0x1c0)][_0x21d8b0(0x1fc)][_0x21d8b0(0x1fd)],'goal\x20criteria');_0x5c2597&&(_0xa56aab['attributes']['goal'][_0x21d8b0(0x1fd)]=_0x5c2597);}for(const _0x13a93c of _0xa56aab['attributes'][_0x21d8b0(0x216)]||[]){const _0x55b0bc=_0x438902[_0x21d8b0(0x267)](_0x13a93c[_0x21d8b0(0x21b)][_0x21d8b0(0x1ed)]());_0x55b0bc&&(_0x13a93c['id']=_0x55b0bc);if(_0x13a93c['entryCriteria']?.[_0x21d8b0(0x1fd)]&&isPendingSegmentId(_0x13a93c[_0x21d8b0(0x1dd)]['segmentId'])){const _0x3185d4=_0x1ca928(_0x13a93c[_0x21d8b0(0x1dd)][_0x21d8b0(0x1fd)],'stage\x20\x27'+_0x13a93c[_0x21d8b0(0x21b)]+_0x21d8b0(0x220));_0x3185d4&&(_0x13a93c['entryCriteria'][_0x21d8b0(0x1fd)]=_0x3185d4);}if(_0x13a93c['exitCriterias'])for(const _0x3465a5 of _0x13a93c['exitCriterias']){if(_0x3465a5['segmentId']&&isPendingSegmentId(_0x3465a5['segmentId'])){const _0x4465a8=_0x1ca928(_0x3465a5[_0x21d8b0(0x1fd)],_0x21d8b0(0x17d)+_0x13a93c[_0x21d8b0(0x21b)]+'\x27\x20exit\x20criteria');_0x4465a8&&(_0x3465a5[_0x21d8b0(0x1fd)]=_0x4465a8);}}if(_0x13a93c[_0x21d8b0(0x1ad)]?.[_0x21d8b0(0x1fd)]&&isPendingSegmentId(_0x13a93c[_0x21d8b0(0x1ad)]['segmentId'])){const _0x2fd434=_0x1ca928(_0x13a93c['milestone'][_0x21d8b0(0x1fd)],_0x21d8b0(0x17d)+_0x13a93c[_0x21d8b0(0x21b)]+_0x21d8b0(0x1a9));_0x2fd434&&(_0x13a93c[_0x21d8b0(0x1ad)][_0x21d8b0(0x1fd)]=_0x2fd434);}if(_0x13a93c[_0x21d8b0(0x17a)]){const _0x16426=_0x5d9ced=>_0x289b57[_0x21d8b0(0x1c0)][_0x21d8b0(0x216)]?.[_0x21d8b0(0x175)](_0x135e3c=>_0x135e3c[_0x21d8b0(0x21b)][_0x21d8b0(0x1ed)]()===_0x13a93c[_0x21d8b0(0x21b)]['toLowerCase']())?.['steps']?.[_0x5d9ced];for(const _0x54437b of Object[_0x21d8b0(0x234)](_0x13a93c[_0x21d8b0(0x17a)])){const _0x36a5db=_0x13a93c[_0x21d8b0(0x17a)][_0x54437b],_0x8e5dd=_0x16426(_0x54437b);if(_0x36a5db[_0x21d8b0(0x194)]===_0x21d8b0(0x1ca)&&_0x36a5db['journeyActivationStepId']&&(isPendingActivationId(_0x36a5db[_0x21d8b0(0x22d)])||_0x36a5db[_0x21d8b0(0x22d)]==='')){if(_0x8e5dd?.[_0x21d8b0(0x22d)]&&isPendingActivationId(_0x8e5dd[_0x21d8b0(0x22d)])){const _0x4ac44c=extractPendingActivationName(_0x8e5dd[_0x21d8b0(0x22d)]),_0x7f3bc5=_0x1eccdb[_0x21d8b0(0x267)](_0x4ac44c);_0x7f3bc5&&(_0x36a5db[_0x21d8b0(0x22d)]=_0x7f3bc5);}}if(_0x36a5db[_0x21d8b0(0x194)]===_0x21d8b0(0x236)&&_0x36a5db['branches']&&_0x8e5dd?.['branches'])for(let _0x157cbc=0x0;_0x157cbc<_0x36a5db['branches'][_0x21d8b0(0x203)];_0x157cbc++){const _0x291b21=_0x36a5db[_0x21d8b0(0x221)][_0x157cbc],_0x8338a9=_0x8e5dd[_0x21d8b0(0x221)][_0x157cbc];if(_0x8338a9?.[_0x21d8b0(0x1fd)]&&isPendingSegmentId(_0x8338a9[_0x21d8b0(0x1fd)])){const _0x58bc1=_0x1ca928(_0x8338a9[_0x21d8b0(0x1fd)],_0x21d8b0(0x17d)+_0x13a93c[_0x21d8b0(0x21b)]+_0x21d8b0(0x18e)+(_0x291b21['name']||_0x157cbc)+'\x27');_0x58bc1&&(_0x291b21[_0x21d8b0(0x1fd)]=_0x58bc1);}}_0x36a5db[_0x21d8b0(0x194)]===_0x21d8b0(0x17c)&&_0x8e5dd?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x36a5db,_0x8e5dd,_0x1ca928,_0x13a93c[_0x21d8b0(0x21b)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd04fb9,_0x48bd7f){const _0x142fa1=a129_0x4045,_0x158617=_0xd04fb9();while(!![]){try{const _0x406c44=parseInt(_0x142fa1(0x1d0))/0x1+parseInt(_0x142fa1(0x1dd))/0x2*(-parseInt(_0x142fa1(0x1d5))/0x3)+parseInt(_0x142fa1(0x1da))/0x4+-parseInt(_0x142fa1(0x1d7))/0x5*(-parseInt(_0x142fa1(0x1de))/0x6)+-parseInt(_0x142fa1(0x1d3))/0x7+-parseInt(_0x142fa1(0x1d1))/0x8*(parseInt(_0x142fa1(0x1dc))/0x9)+parseInt(_0x142fa1(0x1db))/0xa;if(_0x406c44===_0x48bd7f)break;else _0x158617['push'](_0x158617['shift']());}catch(_0x27ed69){_0x158617['push'](_0x158617['shift']());}}}(a129_0x1bc6,0x7df4a));export function buildFolderIdToPathMap(_0x522b5d){const _0x55e64e=a129_0x4045,_0x10cdaf=new Map(),_0x2d9016=new Map();for(const _0x4f07b6 of _0x522b5d){_0x2d9016[_0x55e64e(0x1df)](_0x4f07b6['id'],_0x4f07b6);}const _0x37cbfd=new Set();for(const _0x589909 of _0x522b5d){!_0x589909[_0x55e64e(0x1d9)]&&_0x37cbfd[_0x55e64e(0x1d6)](_0x589909['id']);}function _0x5b1096(_0x504c92){const _0x2878f8=_0x55e64e;if(_0x10cdaf[_0x2878f8(0x1d2)](_0x504c92['id']))return _0x10cdaf[_0x2878f8(0x1d4)](_0x504c92['id']);if(_0x37cbfd[_0x2878f8(0x1d2)](_0x504c92['id']))return _0x10cdaf['set'](_0x504c92['id'],''),'';if(_0x504c92[_0x2878f8(0x1d9)]){const _0x50ba80=_0x2d9016[_0x2878f8(0x1d4)](_0x504c92[_0x2878f8(0x1d9)]);if(_0x50ba80){const _0x2ed401=_0x5b1096(_0x50ba80),_0x5b561d=_0x2ed401?_0x2ed401+'/'+_0x504c92[_0x2878f8(0x1d8)]:_0x504c92[_0x2878f8(0x1d8)];return _0x10cdaf['set'](_0x504c92['id'],_0x5b561d),_0x5b561d;}}const _0x38a0eb=_0x504c92[_0x2878f8(0x1d8)];return _0x10cdaf['set'](_0x504c92['id'],_0x38a0eb),_0x38a0eb;}for(const _0x5e2c69 of _0x522b5d){_0x5b1096(_0x5e2c69);}return _0x10cdaf;}function a129_0x4045(_0x475886,_0x5acecb){_0x475886=_0x475886-0x1d0;const _0x1bc636=a129_0x1bc6();let _0x4045bd=_0x1bc636[_0x475886];return _0x4045bd;}export function buildFolderPathToIdMap(_0x4b8e83){const _0x5c0b05=a129_0x4045,_0x139bf9=new Map(),_0x18ebea=new Map();for(const _0x3b1f77 of _0x4b8e83){_0x18ebea[_0x5c0b05(0x1df)](_0x3b1f77['id'],_0x3b1f77);}const _0x424078=new Set();for(const _0x337929 of _0x4b8e83){!_0x337929[_0x5c0b05(0x1d9)]&&_0x424078[_0x5c0b05(0x1d6)](_0x337929['id']);}function _0x3edb23(_0xda3d1d){const _0x53d16c=_0x5c0b05;if(_0x424078[_0x53d16c(0x1d2)](_0xda3d1d['id']))return'';if(_0xda3d1d[_0x53d16c(0x1d9)]){const _0x21b29c=_0x18ebea[_0x53d16c(0x1d4)](_0xda3d1d[_0x53d16c(0x1d9)]);if(_0x21b29c){const _0x303602=_0x3edb23(_0x21b29c);return _0x303602?_0x303602+'/'+_0xda3d1d[_0x53d16c(0x1d8)]:_0xda3d1d[_0x53d16c(0x1d8)];}}return _0xda3d1d[_0x53d16c(0x1d8)];}for(const _0xe0788a of _0x4b8e83){const _0x377b4e=_0x3edb23(_0xe0788a);_0x139bf9[_0x5c0b05(0x1df)](_0x377b4e,_0xe0788a['id']);}return _0x139bf9;}export function buildFolderMaps(_0x57a3c0){const _0x8efcd2=a129_0x4045,_0x4f1671=buildFolderIdToPathMap(_0x57a3c0),_0xad526a=new Map();for(const [_0x2681f2,_0x112736]of _0x4f1671){_0xad526a[_0x8efcd2(0x1df)](_0x112736,_0x2681f2);}return{'idToPath':_0x4f1671,'pathToId':_0xad526a};}export function getFolderPath(_0x11f922,_0x5858e8){const _0x5d6a17=a129_0x4045;if(!_0x11f922)return'';return _0x5858e8[_0x5d6a17(0x1d4)](_0x11f922)??'';}function a129_0x1bc6(){const _0x1d617e=['11578oGGHsJ','11982zzrfLW','set','532524goLGXj','24IXqPfA','has','1496383foXzOz','get','411PXVeIM','add','885BgOfXe','name','parentFolderId','2798396xyxeeX','7732810fpgPDI','2508291bPlXJY'];a129_0x1bc6=function(){return _0x1d617e;};return a129_0x1bc6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3979df,_0xc827de){const _0x3e0d9f=a130_0x188e,_0x59adce=_0x3979df();while(!![]){try{const _0x4f3af8=parseInt(_0x3e0d9f(0x183))/0x1+-parseInt(_0x3e0d9f(0x194))/0x2+parseInt(_0x3e0d9f(0x184))/0x3*(-parseInt(_0x3e0d9f(0x185))/0x4)+parseInt(_0x3e0d9f(0x19c))/0x5*(parseInt(_0x3e0d9f(0x190))/0x6)+parseInt(_0x3e0d9f(0x182))/0x7+-parseInt(_0x3e0d9f(0x191))/0x8*(parseInt(_0x3e0d9f(0x188))/0x9)+parseInt(_0x3e0d9f(0x192))/0xa;if(_0x4f3af8===_0xc827de)break;else _0x59adce['push'](_0x59adce['shift']());}catch(_0x5524c7){_0x59adce['push'](_0x59adce['shift']());}}}(a130_0x2d01,0xc38c0));import a130_0x40a9c1 from'path';import{parse as a130_0x45948c}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x576d7a){const _0x4c5148=a130_0x188e;if(!_0x576d7a||_0x576d7a[_0x4c5148(0x17a)]()==='')throw new Error(_0x4c5148(0x186));const _0x1b7d9a=_0x576d7a[_0x4c5148(0x17a)]();if(_0x1b7d9a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x576d7a};const _0x660fd9=_0x1b7d9a[_0x4c5148(0x178)]('/')?_0x1b7d9a[_0x4c5148(0x17b)](0x1):_0x1b7d9a,_0x375d31=_0x660fd9[_0x4c5148(0x18f)]('/')[_0x4c5148(0x199)](_0x27f55c=>_0x27f55c!=='');if(_0x375d31['length']===0x0)throw new Error(_0x4c5148(0x198));const _0x1d0960=_0x1b7d9a['startsWith']('/')||!isRelativePathSegment(_0x375d31[0x0]);for(const _0x43e1ff of _0x375d31){validatePathSegment(_0x43e1ff);}return{'segments':_0x375d31,'isAbsolute':_0x1d0960,'raw':_0x576d7a};}function isRelativePathSegment(_0x52ecb1){return _0x52ecb1==='.'||_0x52ecb1==='..';}function validatePathSegment(_0x35de5e){const _0x5679dd=a130_0x188e;if(_0x35de5e==='')throw new Error(_0x5679dd(0x196));if(_0x35de5e==='.'||_0x35de5e==='..')return;if(/[\x00-\x1F\x7F]/[_0x5679dd(0x17e)](_0x35de5e))throw new Error(_0x5679dd(0x180)+_0x35de5e);if(_0x35de5e!==_0x35de5e[_0x5679dd(0x17a)]()){}}export function validatePath(_0x2a603b){const _0x5a1fac=a130_0x188e;if(_0x2a603b[_0x5a1fac(0x19d)][_0x5a1fac(0x1a2)]===0x0&&!_0x2a603b['isAbsolute'])throw new Error(_0x5a1fac(0x181));if(_0x2a603b['isAbsolute']){if(_0x2a603b[_0x5a1fac(0x19d)][0x0]==='..')throw new Error(_0x5a1fac(0x187));let _0x1073fa=0x0;for(const _0x4873bb of _0x2a603b['segments']){if(_0x4873bb==='..'){if(_0x1073fa===0x0)throw new Error(_0x5a1fac(0x19a));_0x1073fa--;}else _0x4873bb!=='.'&&_0x1073fa++;}}}export function joinPaths(_0x34fdc3,_0x6660ee){const _0x2153f4=a130_0x188e;if(!_0x34fdc3||_0x34fdc3==='/')return _0x6660ee;if(!_0x6660ee||_0x6660ee==='.')return _0x34fdc3;if(_0x6660ee[_0x2153f4(0x178)]('/'))return _0x6660ee;const _0x51a922=parsePath(_0x34fdc3),_0x1bff34=parsePath(_0x6660ee),_0x6c3034=[..._0x51a922[_0x2153f4(0x19d)]];for(const _0x37dc46 of _0x1bff34['segments']){if(_0x37dc46==='.')continue;else{if(_0x37dc46==='..'){if(_0x6c3034[_0x2153f4(0x1a2)]===0x0)throw new Error(_0x2153f4(0x197));_0x6c3034[_0x2153f4(0x195)]();}else _0x6c3034['push'](_0x37dc46);}}const _0x2ea57a=_0x6c3034[_0x2153f4(0x18c)]('/');return _0x51a922[_0x2153f4(0x19f)][_0x2153f4(0x178)]('/')?'/'+_0x2ea57a:_0x2ea57a;}export function normalizePath(_0x58bbaf){const _0x1a8dfe=a130_0x188e,_0x12d691=parsePath(_0x58bbaf),_0x2b2ae9=[];for(const _0x30d5fb of _0x12d691['segments']){if(_0x30d5fb==='.')continue;else{if(_0x30d5fb==='..'){if(_0x2b2ae9[_0x1a8dfe(0x1a2)]===0x0){if(_0x12d691[_0x1a8dfe(0x18e)])throw new Error(_0x1a8dfe(0x197));_0x2b2ae9['push']('..');}else _0x2b2ae9[_0x2b2ae9[_0x1a8dfe(0x1a2)]-0x1]==='..'?_0x2b2ae9['push']('..'):_0x2b2ae9[_0x1a8dfe(0x195)]();}else _0x2b2ae9['push'](_0x30d5fb);}}if(_0x2b2ae9['length']===0x0)return _0x12d691['isAbsolute']?'/':'.';const _0x13cea4=_0x2b2ae9[_0x1a8dfe(0x18c)]('/');return _0x12d691[_0x1a8dfe(0x19f)][_0x1a8dfe(0x178)]('/')?'/'+_0x13cea4:_0x13cea4;}export function getParentPath(_0x3027d4){const _0x35b66d=a130_0x188e,_0x1a4714=parsePath(_0x3027d4);if(_0x1a4714[_0x35b66d(0x19d)][_0x35b66d(0x1a2)]<=0x1)return'/';const _0x4c771f=_0x1a4714[_0x35b66d(0x19d)][_0x35b66d(0x1a0)](0x0,-0x1)['join']('/');return _0x1a4714[_0x35b66d(0x19f)][_0x35b66d(0x178)]('/')?'/'+_0x4c771f:_0x4c771f;}export function getBaseName(_0x29fa84){const _0x413ae5=a130_0x188e,_0x4cbd64=parsePath(_0x29fa84);return _0x4cbd64[_0x413ae5(0x19d)][_0x4cbd64[_0x413ae5(0x19d)][_0x413ae5(0x1a2)]-0x1]||'';}export function isChildPath(_0x520f31,_0x207bf1){const _0x264e53=a130_0x188e,_0x1d111b=parsePath(_0x520f31),_0x91a18a=parsePath(_0x207bf1);if(_0x1d111b['segments'][_0x264e53(0x1a2)]<=_0x91a18a[_0x264e53(0x19d)][_0x264e53(0x1a2)])return![];for(let _0x390735=0x0;_0x390735<_0x91a18a['segments'][_0x264e53(0x1a2)];_0x390735++){if(_0x1d111b[_0x264e53(0x19d)][_0x390735]!==_0x91a18a[_0x264e53(0x19d)][_0x390735])return![];}return!![];}function a130_0x188e(_0x3aab99,_0x2b30db){_0x3aab99=_0x3aab99-0x178;const _0x2d0130=a130_0x2d01();let _0x188e90=_0x2d0130[_0x3aab99];return _0x188e90;}export function splitPath(_0x195069){const _0xad5f91=a130_0x188e,_0x1b337a=parsePath(_0x195069);if(_0x1b337a['segments'][_0xad5f91(0x1a2)]===0x0)throw new Error(_0xad5f91(0x193));if(_0x1b337a[_0xad5f91(0x19d)][_0xad5f91(0x1a2)]===0x1)return{'parent':_0x1b337a[_0xad5f91(0x19d)][0x0]};return{'parent':_0x1b337a['segments'][0x0],'child':_0x1b337a[_0xad5f91(0x19d)]['slice'](0x1)['join']('/')};}export function isYamlFilePath(_0x46d7f){const _0x3b2fd5=a130_0x188e;return _0x46d7f['endsWith'](_0x3b2fd5(0x189))||_0x46d7f['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x1f0288,_0x5ecfde=nodeFileSystem){const _0x3f82ba=a130_0x188e,_0xc7194f=a130_0x40a9c1[_0x3f82ba(0x17d)](_0x1f0288);if(!await _0x5ecfde[_0x3f82ba(0x1a3)](_0xc7194f))throw new Error(_0x3f82ba(0x18b)+_0x1f0288);let _0x42bae3=a130_0x40a9c1[_0x3f82ba(0x1a4)](_0xc7194f),_0x3acfac=null,_0x40d2ba=null;const _0x239496=a130_0x40a9c1[_0x3f82ba(0x19e)](_0x42bae3)['root'];while(_0x42bae3!==_0x239496){const _0x506c08=a130_0x40a9c1[_0x3f82ba(0x18c)](_0x42bae3,_0x3f82ba(0x18d));if(await _0x5ecfde[_0x3f82ba(0x1a3)](_0x506c08)){_0x3acfac=_0x506c08,_0x40d2ba=_0x42bae3;break;}_0x42bae3=a130_0x40a9c1[_0x3f82ba(0x1a4)](_0x42bae3);}if(!_0x3acfac||!_0x40d2ba)throw new Error(_0x3f82ba(0x18a)+_0x1f0288);const _0x79b7b9=await _0x5ecfde[_0x3f82ba(0x1a1)](_0x3acfac),_0x7b9c82=JSON[_0x3f82ba(0x19e)](_0x79b7b9),_0x2b91ff=_0x7b9c82[_0x3f82ba(0x17c)];if(!_0x2b91ff)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x4cf23c=await _0x5ecfde[_0x3f82ba(0x1a1)](_0xc7194f),_0x1cd879=a130_0x45948c(_0x4cf23c),_0x31901e=_0x1cd879['name'];if(!_0x31901e)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x1f0288);const _0x56c3dc=_0x1cd879[_0x3f82ba(0x19b)]===_0x3f82ba(0x17f)?_0x3f82ba(0x17f):_0x3f82ba(0x179),_0x4a543a=a130_0x40a9c1['relative'](_0x40d2ba,_0xc7194f),_0x8b81b7=a130_0x40a9c1[_0x3f82ba(0x1a4)](_0x4a543a),_0x1e792c=_0x8b81b7==='.'?'':_0x8b81b7['replace'](/\\/g,'/'),_0x2455e4=_0x1e792c?_0x2b91ff+'/'+_0x1e792c+'/'+_0x31901e:_0x2b91ff+'/'+_0x31901e;return{'parentSegment':_0x2b91ff,'segmentName':_0x31901e,'folderPath':_0x1e792c,'fullPath':_0x2455e4,'resourceType':_0x56c3dc};}function a130_0x2d01(){const _0x42facd=['resolve','test','journey','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Relative\x20path\x20cannot\x20be\x20empty','985404FMltjV','1305534OebPRf','3993141yZWKSK','4tBBWdg','Path\x20cannot\x20be\x20empty','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','570393JMFQSu','.yml','No\x20tdx.json\x20found\x20for\x20file:\x20','File\x20not\x20found:\x20','join','tdx.json','isAbsolute','split','6780654OdpxDA','88HXOiZz','16331320soOXFn','Cannot\x20split\x20empty\x20path','2760786sEWgpp','pop','Path\x20segment\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','filter','Path\x20attempts\x20to\x20navigate\x20above\x20root','type','5sPLPmp','segments','parse','raw','slice','readFile','length','exists','dirname','startsWith','segment','trim','substring','parent_segment'];a130_0x2d01=function(){return _0x42facd;};return a130_0x2d01();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a131_0x15a8(_0x5a8fa6,_0x3f5f15){_0x5a8fa6=_0x5a8fa6-0xda;const _0x21a1f7=a131_0x21a1();let _0x15a8da=_0x21a1f7[_0x5a8fa6];return _0x15a8da;}function a131_0x21a1(){const _0x41ab87=['752864fFAgZo','substring','5REhhtX','.\x20Parent\x20name\x20cannot\x20be\x20empty','Invalid\x20segment\x20reference\x20format:\x20','104nFkStZ','indexOf','6662292GrpsDe','27UZfHlw','4ZnpyWG','56AYGtZb','2563WePbMp','3213753ZqHWGS','37850FpqRPa','139284CkaXZB','313776vjrFHc','33074JsASIM'];a131_0x21a1=function(){return _0x41ab87;};return a131_0x21a1();}(function(_0x46680b,_0x3010df){const _0x4c1373=a131_0x15a8,_0x5a5a64=_0x46680b();while(!![]){try{const _0x227d93=parseInt(_0x4c1373(0xe5))/0x1*(parseInt(_0x4c1373(0xdc))/0x2)+-parseInt(_0x4c1373(0xe9))/0x3*(-parseInt(_0x4c1373(0xe6))/0x4)+-parseInt(_0x4c1373(0xdf))/0x5*(-parseInt(_0x4c1373(0xe4))/0x6)+parseInt(_0x4c1373(0xdd))/0x7*(-parseInt(_0x4c1373(0xe7))/0x8)+parseInt(_0x4c1373(0xda))/0x9+parseInt(_0x4c1373(0xea))/0xa*(-parseInt(_0x4c1373(0xe8))/0xb)+parseInt(_0x4c1373(0xdb))/0xc*(-parseInt(_0x4c1373(0xe2))/0xd);if(_0x227d93===_0x3010df)break;else _0x5a5a64['push'](_0x5a5a64['shift']());}catch(_0x41505c){_0x5a5a64['push'](_0x5a5a64['shift']());}}}(a131_0x21a1,0xc33a7));export function parseSegmentRef(_0x14e06a){const _0x14c4aa=a131_0x15a8,_0x566b35=_0x14e06a[_0x14c4aa(0xe3)]('/');if(_0x566b35===-0x1)return{'parentId':_0x14e06a};if(_0x566b35===0x0)throw new Error(_0x14c4aa(0xe1)+_0x14e06a+_0x14c4aa(0xe0));const _0x3e92b9=_0x14e06a[_0x14c4aa(0xde)](0x0,_0x566b35),_0x49cc7d=_0x14e06a[_0x14c4aa(0xde)](_0x566b35+0x1);if(_0x49cc7d==='')throw new Error(_0x14c4aa(0xe1)+_0x14e06a+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x3e92b9,'childId':_0x49cc7d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x335f22,_0x20313f){const _0x425bfd=a132_0x51d2,_0x4166d7=_0x335f22();while(!![]){try{const _0x481634=-parseInt(_0x425bfd(0x124))/0x1+parseInt(_0x425bfd(0x135))/0x2*(parseInt(_0x425bfd(0x153))/0x3)+parseInt(_0x425bfd(0x14b))/0x4*(parseInt(_0x425bfd(0x156))/0x5)+-parseInt(_0x425bfd(0x132))/0x6*(-parseInt(_0x425bfd(0x150))/0x7)+parseInt(_0x425bfd(0x130))/0x8*(-parseInt(_0x425bfd(0x13f))/0x9)+-parseInt(_0x425bfd(0x155))/0xa+-parseInt(_0x425bfd(0x148))/0xb*(parseInt(_0x425bfd(0x152))/0xc);if(_0x481634===_0x20313f)break;else _0x4166d7['push'](_0x4166d7['shift']());}catch(_0x515382){_0x4166d7['push'](_0x4166d7['shift']());}}}(a132_0x3474,0x9523f));import a132_0xd0b3a2 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';function a132_0x3474(){const _0x4d9b05=['folderPath','message','invalid_yaml','No\x20tdx.json\x20found\x20for\x20file:\x20','8239pHAmVd','readFile','492sWJIZX','77583dJYNJy','trim','1961930qYpsQS','1145YDOVTJ','parent_segment','match','replace','30713vcpUCn','exists','parentSegment','join','scopedFolderPath','resolve','resourceType','error','includes','cwd','extname','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','8lBnLxD','File\x20not\x20found','552mazRYd','journey','file','46MTNGhe','parent_name','Not\x20a\x20YAML\x20file:\x20','segmentName','segment','dirname','configDir','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','startsWith','no_parent','4287924RPJjfq','string','type','stat','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','basename','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','isScoped','no_config','6039ZXkqkN','directory','context','11068WivzLu'];a132_0x3474=function(){return _0x4d9b05;};return a132_0x3474();}function a132_0x51d2(_0x152434,_0x5ebff1){_0x152434=_0x152434-0x123;const _0x3474a9=a132_0x3474();let _0x51d233=_0x3474a9[_0x152434];return _0x51d233;}import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x591852){const _0xb13b74=a132_0x51d2;return _0x591852['type']!==_0xb13b74(0x12b);}export function isScopedResolution(_0x410bae){const _0xdff876=a132_0x51d2;return _0x410bae[_0xdff876(0x141)]==='directory'||_0x410bae[_0xdff876(0x141)]===_0xdff876(0x134)||_0x410bae[_0xdff876(0x141)]==='context';}export function getScopedDetails(_0x423fb4){const _0x17f24d=a132_0x51d2;if(isScopedResolution(_0x423fb4))return{'isScoped':_0x423fb4[_0x17f24d(0x146)],'scopedFolderPath':_0x423fb4[_0x17f24d(0x128)]};return undefined;}async function findTdxConfigAsync(_0x4c939e,_0x36c132){const _0x33fb06=a132_0x51d2;let _0x190c9a=a132_0xd0b3a2[_0x33fb06(0x129)](_0x4c939e);const _0x4da706=a132_0xd0b3a2['parse'](_0x190c9a)['root'];while(_0x190c9a!==_0x4da706){const _0x3b6f2b=a132_0xd0b3a2[_0x33fb06(0x127)](_0x190c9a,'tdx.json');if(await _0x36c132[_0x33fb06(0x125)](_0x3b6f2b))try{const _0x27ec01=await _0x36c132[_0x33fb06(0x151)](_0x3b6f2b),_0x27bf95=JSON['parse'](_0x27ec01);if(_0x27bf95[_0x33fb06(0x157)]&&typeof _0x27bf95[_0x33fb06(0x157)]===_0x33fb06(0x140))return{'configPath':_0x3b6f2b,'configDir':_0x190c9a,'parentSegment':_0x27bf95[_0x33fb06(0x157)]};}catch{}_0x190c9a=a132_0xd0b3a2['dirname'](_0x190c9a);}return null;}function calculateScopedPath(_0x23ac66,_0xc733f0){const _0x1a7253=a132_0x51d2,_0x2cbd8c=a132_0xd0b3a2['relative'](_0xc733f0,_0x23ac66),_0x514398=_0x2cbd8c!==''&&_0x2cbd8c!=='.'&&!_0x2cbd8c[_0x1a7253(0x13d)]('..');return{'isScoped':_0x514398,'scopedFolderPath':_0x514398?_0x2cbd8c[_0x1a7253(0x123)](/\\/g,'/'):''};}export async function resolveTarget(_0x3908bf){const _0x5e158b=a132_0x51d2,{arg:_0x42fb42,contextParent:_0x453741,cwd:cwd=process[_0x5e158b(0x12d)](),fs:fs=nodeFileSystem}=_0x3908bf;if(_0x42fb42&&isYamlFilePath(_0x42fb42))try{const _0x5a0247=await resolveYamlFilePath(_0x42fb42,fs),_0x3370a3=a132_0xd0b3a2[_0x5e158b(0x129)](_0x42fb42),_0x3b377a=a132_0xd0b3a2[_0x5e158b(0x13a)](_0x3370a3),_0x271c2a=await findTdxConfigAsync(_0x3b377a,fs);if(!_0x271c2a){if(_0x453741){const _0x241faa=a132_0xd0b3a2[_0x5e158b(0x13a)](_0x3370a3);return{'type':'file','parentName':_0x453741,'targetDir':_0x241faa,'configRoot':_0x241faa,'filePath':_0x3370a3,'resourceName':_0x5a0247[_0x5e158b(0x138)],'folderPath':_0x5a0247['folderPath'],'resourceType':_0x5a0247[_0x5e158b(0x12a)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x147),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x42fb42,'arg':_0x42fb42,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}const _0x46c403=calculateScopedPath(_0x3b377a,_0x271c2a['configDir']);return{'type':_0x5e158b(0x134),'parentName':_0x271c2a['parentSegment'],'targetDir':_0x271c2a[_0x5e158b(0x13b)],'configRoot':_0x271c2a['configDir'],'filePath':_0x3370a3,'resourceName':_0x5a0247['segmentName'],'folderPath':_0x5a0247[_0x5e158b(0x14c)],'resourceType':_0x5a0247[_0x5e158b(0x12a)],'isScoped':_0x46c403['isScoped'],'scopedFolderPath':_0x46c403[_0x5e158b(0x128)]};}catch(_0x51b84b){const _0x4fcd4d=_0x51b84b instanceof Error?_0x51b84b[_0x5e158b(0x14d)]:String(_0x51b84b);if(_0x4fcd4d[_0x5e158b(0x12c)](_0x5e158b(0x131)))return{'type':'error','errorCode':'file_not_found','message':'File\x20not\x20found:\x20'+_0x42fb42,'arg':_0x42fb42};if(_0x4fcd4d['includes']('No\x20tdx.json\x20found')){if(_0x453741){const _0x251cb4=a132_0xd0b3a2['resolve'](_0x42fb42);if(await fs['exists'](_0x251cb4)){const _0x5a4781=a132_0xd0b3a2[_0x5e158b(0x13a)](_0x251cb4),_0x3e999a=await fs['readFile'](_0x251cb4),_0x416a3d=_0x3e999a['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1e95f8=_0x3e999a[_0x5e158b(0x158)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x4d21c1=_0x416a3d?_0x416a3d[0x1][_0x5e158b(0x154)]():a132_0xd0b3a2[_0x5e158b(0x144)](_0x42fb42,a132_0xd0b3a2[_0x5e158b(0x12e)](_0x42fb42)),_0x256eee=_0x1e95f8&&_0x1e95f8[0x1][_0x5e158b(0x154)]()===_0x5e158b(0x133)?_0x5e158b(0x133):_0x5e158b(0x139);return{'type':_0x5e158b(0x134),'parentName':_0x453741,'targetDir':_0x5a4781,'configRoot':_0x5a4781,'filePath':_0x251cb4,'resourceName':_0x4d21c1,'folderPath':'','resourceType':_0x256eee,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x147),'message':_0x5e158b(0x14f)+_0x42fb42,'arg':_0x42fb42,'helpText':_0x5e158b(0x145)};}return{'type':_0x5e158b(0x12b),'errorCode':'invalid_yaml','message':_0x4fcd4d,'arg':_0x42fb42};}if(_0x42fb42){const _0xce439=a132_0xd0b3a2[_0x5e158b(0x129)](cwd,_0x42fb42);let _0x23d282=null;try{_0x23d282=await fs[_0x5e158b(0x142)](_0xce439);}catch{}if(_0x23d282?.['isDirectory']()){const _0x1fd3fa=await findTdxConfigAsync(_0xce439,fs);if(_0x1fd3fa){const _0x8e9a26=calculateScopedPath(_0xce439,_0x1fd3fa[_0x5e158b(0x13b)]);return{'type':'directory','parentName':_0x1fd3fa[_0x5e158b(0x126)],'targetDir':_0xce439,'configRoot':_0x1fd3fa[_0x5e158b(0x13b)],'isScoped':_0x8e9a26[_0x5e158b(0x146)],'scopedFolderPath':_0x8e9a26[_0x5e158b(0x128)]};}if(_0x453741)return{'type':_0x5e158b(0x149),'parentName':_0x453741,'targetDir':_0xce439,'configRoot':_0xce439,'isScoped':![],'scopedFolderPath':''};return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x147),'message':_0x5e158b(0x143)+_0x42fb42,'arg':_0x42fb42,'helpText':_0x5e158b(0x145)};}if(_0x23d282?.['isFile']())return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x14e),'message':_0x5e158b(0x137)+_0x42fb42,'arg':_0x42fb42,'helpText':_0x5e158b(0x13c)};const _0x356e7d=sanitizeFileName(_0x42fb42),_0x2b54d9=getSegmentRootDir(_0x356e7d,cwd);return{'type':_0x5e158b(0x136),'parentName':_0x42fb42,'targetDir':_0x2b54d9,'configRoot':_0x2b54d9};}const _0x19cece=await findTdxConfigAsync(cwd,fs);if(_0x19cece){const _0x2b6ae1=calculateScopedPath(cwd,_0x19cece[_0x5e158b(0x13b)]);return{'type':_0x5e158b(0x14a),'parentName':_0x19cece['parentSegment'],'targetDir':cwd,'configRoot':_0x19cece[_0x5e158b(0x13b)],'isScoped':_0x2b6ae1[_0x5e158b(0x146)],'scopedFolderPath':_0x2b6ae1['scopedFolderPath']};}if(_0x453741){const _0x1105f1=sanitizeFileName(_0x453741),_0xfbc3c4=getSegmentRootDir(_0x1105f1,cwd);return{'type':_0x5e158b(0x14a),'parentName':_0x453741,'targetDir':_0xfbc3c4,'configRoot':_0xfbc3c4,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x5e158b(0x12b),'errorCode':_0x5e158b(0x13e),'message':'Parent\x20segment\x20not\x20specified','helpText':_0x5e158b(0x12f)};}
|