@treasuredata/tdx 2026.3.24 → 2026.3.26
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/auth-login-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/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/policy-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/oauth-keychain.js +1 -1
- package/dist/core/oauth.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/oauth-refresh.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/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-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/types/template-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/policy.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/segment-validator.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/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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.d.ts +5 -0
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +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/paginate.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/github-releases.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
|
-
|
|
1
|
+
(function(_0x42ed21,_0x18297c){const _0x1a6a4b=a141_0x4164,_0x22d8f0=_0x42ed21();while(!![]){try{const _0x167d3c=-parseInt(_0x1a6a4b(0x1c6))/0x1+parseInt(_0x1a6a4b(0x1c5))/0x2+-parseInt(_0x1a6a4b(0x1b4))/0x3+parseInt(_0x1a6a4b(0x1bc))/0x4+-parseInt(_0x1a6a4b(0x1b9))/0x5+parseInt(_0x1a6a4b(0x1be))/0x6+parseInt(_0x1a6a4b(0x1bf))/0x7;if(_0x167d3c===_0x18297c)break;else _0x22d8f0['push'](_0x22d8f0['shift']());}catch(_0x5ac051){_0x22d8f0['push'](_0x22d8f0['shift']());}}}(a141_0x74b1,0x80e1d));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x180a5a from'path';import{Logger}from'../../utils/logger/index.js';function a141_0x4164(_0x5910ff,_0x2d4042){_0x5910ff=_0x5910ff-0x1b2;const _0x74b114=a141_0x74b1();let _0x4164cd=_0x74b114[_0x5910ff];return _0x4164cd;}const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x14e127){const _0x503f34=a141_0x4164,_0x4501fb=a141_0x180a5a[_0x503f34(0x1b2)](_0x14e127),_0x1a063f=a141_0x180a5a[_0x503f34(0x1ba)](_0x14e127);return a141_0x180a5a[_0x503f34(0x1c4)](_0x4501fb,'.'+_0x1a063f+_0x503f34(0x1c2));}function a141_0x74b1(){const _0x535369=['stringify','.push-recovery.json','ENOENT','join','2023730dMQgCI','973308DmeSNq','dirname','toISOString','2257083ggcIXr','string','parse','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','utf-8','4754945WYSINF','basename','debug','949660aKQOgL','warn','2675424wySamz','10565625VYAiJv','journeyName'];a141_0x74b1=function(){return _0x535369;};return a141_0x74b1();}export function readPushRecovery(_0x3382dc){const _0x32054e=a141_0x4164,_0xc11f9d=getPushRecoveryPath(_0x3382dc);if(!existsSync(_0xc11f9d))return undefined;try{const _0x2b916d=readFileSync(_0xc11f9d,'utf-8'),_0x4beea5=JSON[_0x32054e(0x1b6)](_0x2b916d);if(_0x4beea5?.['version']!==0x1||typeof _0x4beea5['journeyName']!==_0x32054e(0x1b5))return undefined;return _0x4beea5;}catch(_0x95942d){return _0x95942d instanceof SyntaxError?logger[_0x32054e(0x1bb)](_0x32054e(0x1b7)+_0x95942d):logger[_0x32054e(0x1bd)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x95942d),undefined;}}export function writePushRecovery(_0x13f794,_0x5d4bbc){const _0x136bb2=a141_0x4164,_0x104180=getPushRecoveryPath(_0x13f794),_0x235c3c=_0x104180+'.tmp';writeFileSync(_0x235c3c,JSON[_0x136bb2(0x1c1)](_0x5d4bbc,null,0x2)+'\x0a',_0x136bb2(0x1b8)),renameSync(_0x235c3c,_0x104180);}export function deletePushRecovery(_0x237246){const _0x159a30=a141_0x4164,_0x2b8c0a=getPushRecoveryPath(_0x237246);try{unlinkSync(_0x2b8c0a);}catch(_0x5c7fba){_0x5c7fba['code']!==_0x159a30(0x1c3)&&logger[_0x159a30(0x1bb)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x5c7fba);}}export function saveSegmentToPushRecovery(_0x398e9b,_0x308786,_0x5dbb33,_0xee4854){const _0x2b376c=a141_0x4164,_0x4fa474=readPushRecovery(_0x398e9b),_0x2212bc=_0x4fa474?.[_0x2b376c(0x1c0)]===_0x308786?{..._0x4fa474,'updatedAt':new Date()[_0x2b376c(0x1b3)]()}:{'version':0x1,'journeyName':_0x308786,'updatedAt':new Date()[_0x2b376c(0x1b3)](),'segments':{}};_0x2212bc['segments'][_0x5dbb33]=_0xee4854,writePushRecovery(_0x398e9b,_0x2212bc);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x3ef9cf=a142_0x3bff;(function(_0x554a80,_0x3216c9){const _0x544678=a142_0x3bff,_0x2c8489=_0x554a80();while(!![]){try{const _0x55a6ae=parseInt(_0x544678(0x21d))/0x1*(-parseInt(_0x544678(0x277))/0x2)+-parseInt(_0x544678(0x1cf))/0x3+-parseInt(_0x544678(0x1e0))/0x4+-parseInt(_0x544678(0x1de))/0x5*(-parseInt(_0x544678(0x22c))/0x6)+-parseInt(_0x544678(0x1eb))/0x7*(-parseInt(_0x544678(0x233))/0x8)+parseInt(_0x544678(0x232))/0x9+parseInt(_0x544678(0x1d3))/0xa;if(_0x55a6ae===_0x3216c9)break;else _0x2c8489['push'](_0x2c8489['shift']());}catch(_0x350141){_0x2c8489['push'](_0x2c8489['shift']());}}}(a142_0x570e,0x4c840));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x3ef9cf(0x2a0));export const PENDING_SEGMENT_PREFIX=a142_0x3ef9cf(0x296);export const PENDING_ACTIVATION_PREFIX=a142_0x3ef9cf(0x22b);export function createPendingSegmentId(_0x358f42){return''+PENDING_SEGMENT_PREFIX+_0x358f42+'__';}export function isPendingSegmentId(_0x4f67f6){const _0x3d3c34=a142_0x3ef9cf;return _0x4f67f6[_0x3d3c34(0x207)](PENDING_SEGMENT_PREFIX)&&!_0x4f67f6[_0x3d3c34(0x207)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x23a6b5){const _0x444785=a142_0x3ef9cf;return _0x23a6b5[_0x444785(0x275)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x17378f){return''+PENDING_ACTIVATION_PREFIX+_0x17378f+'__';}export function isPendingActivationId(_0x1e2954){return _0x1e2954['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5839d0){const _0xb743bb=a142_0x3ef9cf;return _0x5839d0[_0xb743bb(0x275)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3dd469,_0x16e630){const _0xdc2d0a=a142_0x3ef9cf,_0x3ff77b=_0x3dd469+'::'+(_0x16e630[_0xdc2d0a(0x266)]()||_0xdc2d0a(0x1c7)),_0x2ca757=createHash('sha1')[_0xdc2d0a(0x26c)](_0x3ff77b)[_0xdc2d0a(0x28c)](_0xdc2d0a(0x1e4))[_0xdc2d0a(0x212)](0x0,0xc);return'journey_entry_criteria_'+_0x2ca757;}export function ensureJourneyDefaults(_0x23af51){const _0x119e00=a142_0x3ef9cf;!_0x23af51[_0x119e00(0x23e)]&&(_0x23af51[_0x119e00(0x23e)]=''),!_0x23af51[_0x119e00(0x1ca)]&&(_0x23af51[_0x119e00(0x1ca)]=_0x119e00(0x287));}export function injectExistingStageIds(_0x4c00ff,_0x44ee94){const _0xced3b7=a142_0x3ef9cf,_0x18e7bc=new Map(_0x44ee94[_0xced3b7(0x209)](_0xf6a41c=>[_0xf6a41c['name'],_0xf6a41c['id']]));for(const _0x446f92 of _0x4c00ff){if(!_0x446f92['id']){const _0x5612d1=_0x18e7bc['get'](_0x446f92[_0xced3b7(0x26e)]);_0x5612d1&&(_0x446f92['id']=_0x5612d1);}}}export function resolveTDFolderPath(_0x2ae020,_0x3612c2,_0x3fa3b6){const _0x4a1b80=a142_0x3ef9cf;if(!_0x3612c2)return _0x2ae020;if(_0x2ae020===_0x3fa3b6||_0x2ae020[_0x4a1b80(0x207)](_0x3fa3b6+'/'))return _0x2ae020;return _0x2ae020?_0x3fa3b6+'/'+_0x2ae020:_0x3fa3b6;}export function addFoldersToCreate(_0x5cea0b,_0x33fe4c,_0xb99772){const _0x124ba3=a142_0x3ef9cf;if(!_0x5cea0b)return;if(_0x33fe4c[_0x124ba3(0x1d5)](_0x5cea0b))return;const _0x4160d3=_0x5cea0b['split']('/');let _0x5f198d='';for(const _0x3b6b7e of _0x4160d3){_0x5f198d=_0x5f198d?_0x5f198d+'/'+_0x3b6b7e:_0x3b6b7e,!_0x33fe4c[_0x124ba3(0x1d5)](_0x5f198d)&&_0xb99772['add'](_0x5f198d);}}export function sortFoldersByDepth(_0x24fb24){return[..._0x24fb24]['sort']((_0x19388f,_0x17c0da)=>{const _0x265a48=a142_0x3bff,_0x21b1f4=(_0x19388f[_0x265a48(0x1ac)](/\//g)||[])['length'],_0x1b2d2e=(_0x17c0da[_0x265a48(0x1ac)](/\//g)||[])[_0x265a48(0x1f4)];return _0x21b1f4-_0x1b2d2e;});}import*as a142_0x4a29a2 from'yaml';import{readFileSync}from'fs';import a142_0x3c5b6d from'path';import{isJourneyDef,parseYamlString as a142_0x4a5f14,toYamlString as a142_0x2c1878,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(_0x371f39){const _0x37d65a=a142_0x3ef9cf;if(Array[_0x37d65a(0x272)](_0x371f39))return'['+_0x371f39[_0x37d65a(0x209)](_0x49f73d=>stableStringify(_0x49f73d))['join'](',')+']';if(_0x371f39&&typeof _0x371f39===_0x37d65a(0x248)){const _0x1feaee=_0x371f39,_0xd6dc49=Object[_0x37d65a(0x294)](_0x1feaee)[_0x37d65a(0x1d0)](),_0x557ae4=_0xd6dc49[_0x37d65a(0x209)](_0x2a7a60=>'\x22'+_0x2a7a60+'\x22:'+stableStringify(_0x1feaee[_0x2a7a60]));return'{'+_0x557ae4['join'](',')+'}';}const _0x567307=JSON[_0x37d65a(0x216)](_0x371f39);return _0x567307===undefined?'null':_0x567307;}function activationSignature(_0x5e9895){const _0x192a49=a142_0x3ef9cf,_0x342d17={'connection':_0x5e9895[_0x192a49(0x1f2)],..._0x5e9895['all_columns']!==undefined&&{'all_columns':_0x5e9895[_0x192a49(0x205)]},..._0x5e9895['columns']!==undefined&&{'columns':_0x5e9895[_0x192a49(0x21e)]},..._0x5e9895['behavior']!==undefined&&{'behavior':_0x5e9895[_0x192a49(0x1d6)]},..._0x5e9895[_0x192a49(0x242)]!==undefined&&{'schedule':_0x5e9895['schedule']},..._0x5e9895['notification']!==undefined&&{'notification':_0x5e9895[_0x192a49(0x1ab)]},..._0x5e9895[_0x192a49(0x280)]!==undefined&&{'connector_config':_0x5e9895[_0x192a49(0x280)]},..._0x5e9895[_0x192a49(0x1f7)]!==undefined&&{'activation_template_id':_0x5e9895[_0x192a49(0x1f7)]}};return stableStringify(_0x342d17);}async function fetchSegment(_0x5f02d9,_0x281f56,_0x59149d,_0x4add08){const _0x43cb94=a142_0x3ef9cf,_0x294b99=_0x4add08?.[_0x43cb94(0x1d9)](_0x31a52f=>_0x31a52f['id']===_0x59149d);if(_0x294b99)return _0x294b99;try{return await _0x5f02d9[_0x43cb94(0x1c7)]['getSegment'](_0x281f56,_0x59149d);}catch(_0xd8d4ea){logger[_0x43cb94(0x270)]('getSegment\x20failed\x20for\x20'+_0x59149d+_0x43cb94(0x241)+_0xd8d4ea);try{return await _0x5f02d9[_0x43cb94(0x1c7)][_0x43cb94(0x224)](_0x59149d);}catch(_0x1261ae){return logger[_0x43cb94(0x270)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x59149d+':\x20'+_0x1261ae),null;}}}function recoverSegmentIdsFromPushRecovery(_0x399c6d,_0x39e025,_0xc1ef12){const _0x2bb764=a142_0x3ef9cf,_0x4aa918=readPushRecovery(_0x399c6d[_0x2bb764(0x27a)]);if(_0x4aa918?.[_0x2bb764(0x1b3)]===_0x399c6d[_0x2bb764(0x24a)][_0x2bb764(0x26e)])for(const [_0x14e49f,_0x3762ad]of Object['entries'](_0x4aa918[_0x2bb764(0x25b)])){const _0x2f63d0=generateDeterministicJourneySegmentName(_0x399c6d[_0x2bb764(0x24a)]['name'],_0x14e49f);_0x3762ad[_0x2bb764(0x1ec)]===_0x2f63d0&&(_0x39e025[_0x2bb764(0x21b)](_0x14e49f,_0x3762ad[_0x2bb764(0x221)]),_0xc1ef12[_0x2bb764(0x21b)](_0x14e49f,_0x3762ad[_0x2bb764(0x221)]));}}async function createOrRecoverEmbeddedSegment(_0x29a66a,_0x20ac3d,_0x8efa6,_0x236fbc){const _0x45040a=a142_0x3ef9cf;let _0x5019c5;try{_0x5019c5=await _0x29a66a[_0x45040a(0x1c7)][_0x45040a(0x293)]({'name':_0x8efa6['uniqueSegmentName'],'description':_0x8efa6[_0x45040a(0x23e)],'journeyId':_0x8efa6[_0x45040a(0x215)],'rule':_0x236fbc(_0x8efa6[_0x45040a(0x1e6)],!![]),'countPopulation':!![],'parentFolderId':_0x8efa6[_0x45040a(0x25e)],'audienceId':_0x8efa6[_0x45040a(0x23b)]});}catch(_0x46e390){const _0x29a3ee=_0x46e390 instanceof Error&&_0x46e390[_0x45040a(0x1da)][_0x45040a(0x1e2)](_0x45040a(0x1ea));if(_0x29a3ee){const _0x2a6c2d=readPushRecovery(_0x20ac3d['absolutePath']),_0x40620b=_0x2a6c2d?.[_0x45040a(0x1b3)]===_0x20ac3d[_0x45040a(0x24a)][_0x45040a(0x26e)]?_0x2a6c2d[_0x45040a(0x25b)][_0x8efa6[_0x45040a(0x267)]]:undefined;if(_0x40620b?.[_0x45040a(0x1ec)]===_0x8efa6['uniqueSegmentName'])await _0x29a66a['segment']['updateSegmentById'](_0x8efa6[_0x45040a(0x23b)],_0x40620b[_0x45040a(0x221)],{'description':_0x8efa6[_0x45040a(0x23e)],'rule':_0x236fbc(_0x8efa6[_0x45040a(0x1e6)],!![]),'countPopulation':!![]}),_0x5019c5=_0x40620b[_0x45040a(0x221)];else throw new SDKError(ErrorCode[_0x45040a(0x299)],_0x45040a(0x29c)+_0x8efa6['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x45040a(0x1d1)+_0x20ac3d[_0x45040a(0x27a)][_0x45040a(0x275)](/([^/]+)$/,_0x45040a(0x25a))+')\x20')+_0x45040a(0x253),_0x46e390);}else throw _0x46e390;}return saveSegmentToPushRecovery(_0x20ac3d[_0x45040a(0x27a)],_0x20ac3d[_0x45040a(0x24a)][_0x45040a(0x26e)],_0x8efa6[_0x45040a(0x267)],{'segmentId':_0x5019c5,'uniqueServerName':_0x8efa6[_0x45040a(0x24c)],'createdAt':new Date()['toISOString']()}),_0x5019c5;}export async function prepareSegmentFiles(_0x40cf55,_0x15a4e8,_0x1e2548,_0x575919,_0x50d19f){const _0x31b50b=a142_0x3ef9cf,{activationDefToCreateRequest:_0x124188}=await import(_0x31b50b(0x201)),_0x5b4b14=[],_0x2b7fe9=new Set();for(const {yamlConfig:_0x4938c4,folderPath:_0x333b85,sourcePath:_0x178f2f}of _0x40cf55){const _0x9d79e3=resolveTDFolderPath(_0x333b85,_0x575919,_0x50d19f),_0x31571f=_0x9d79e3+':'+_0x4938c4[_0x31b50b(0x26e)],_0x671ca3=_0x15a4e8['segmentByFolderAndName']['get'](_0x31571f),_0x2f516c=_0x671ca3?_0x15a4e8[_0x31b50b(0x238)]['get'](_0x671ca3['id'])||[]:[];addFoldersToCreate(_0x9d79e3,_0x15a4e8[_0x31b50b(0x27f)],_0x2b7fe9);const _0x49fe0f=calculateActivationActions(_0x4938c4['activations']||[],_0x2f516c,_0x15a4e8[_0x31b50b(0x298)],_0x15a4e8['connectionIdToNameMap']);for(const _0x18d803 of _0x49fe0f){(_0x18d803[_0x31b50b(0x21a)]==='create'||_0x18d803['type']===_0x31b50b(0x26c))&&_0x18d803[_0x31b50b(0x24d)]&&(_0x18d803[_0x31b50b(0x22f)]=await _0x124188(_0x18d803['yamlActivation'],_0x1e2548));}const _0x29191c=calculateSegmentDiff(_0x4938c4,_0x671ca3,_0x2f516c,_0x15a4e8['idToEmailMap'],_0x15a4e8['connectionIdToNameMap']);_0x5b4b14[_0x31b50b(0x1a4)]({'relativePath':_0x4938c4[_0x31b50b(0x26e)],'absolutePath':_0x178f2f,'yamlConfig':_0x4938c4,'folderPath':_0x9d79e3,'existingSegment':_0x671ca3,'existingActivations':_0x2f516c,'isNew':_0x29191c[_0x31b50b(0x279)],'hasChanges':_0x29191c[_0x31b50b(0x1e3)],'diff':_0x29191c['diff'],'activationActions':_0x49fe0f});}return{'segmentFiles':_0x5b4b14,'foldersToCreate':_0x2b7fe9};}export async function prepareJourneyFiles(_0x3ef1b1,_0x41d667,_0x5266c3,_0x508b38){const _0x50358b=a142_0x3ef9cf,_0x36bd0c=[],_0x3574f0=new Set();for(const {yamlConfig:_0x5e05d6,folderPath:_0x21209e,sourcePath:_0x241ff7}of _0x3ef1b1){const _0x21356=resolveTDFolderPath(_0x21209e,_0x5266c3,_0x508b38),_0x3c6268=_0x21356+':'+_0x5e05d6[_0x50358b(0x26e)],_0x3c8b8c=_0x41d667[_0x50358b(0x1b7)]['get'](_0x3c6268);let _0x1aff22,_0x206d6c;if(_0x3c8b8c&&_0x3c8b8c[_0x50358b(0x1f4)]>0x0){const _0x4a1d8d=buildLocalExpandedRuleMappings(_0x5e05d6),{createYamlContext:_0x508a22,prefetchJourneySegments:_0x4cfc70}=createPushYamlContextForBundle(_0x41d667[_0x50358b(0x240)],_0x41d667[_0x50358b(0x23b)],_0x41d667[_0x50358b(0x222)],_0x4a1d8d,_0x41d667[_0x50358b(0x298)],_0x41d667['connectionIdToNameMap'],_0x41d667['activationStepsById'],_0x41d667[_0x50358b(0x1ed)]);await _0x4cfc70(_0x3c8b8c[_0x50358b(0x209)](_0x3c2555=>_0x3c2555['id']));const _0x3c34b8=await _0x41d667[_0x50358b(0x240)]['journey'][_0x50358b(0x265)](_0x3c8b8c[0x0][_0x50358b(0x23c)]),_0x48fac3=hasMultipleVersions(_0x5e05d6),_0x123aa0=async _0x3007eb=>{const _0x3ae20c=_0x50358b,_0x18a564=_0x41d667['journeyById']?.['get'](_0x3007eb);if(_0x18a564)return _0x18a564;return _0x41d667[_0x3ae20c(0x26d)]({'journeyId':_0x3007eb,'journeyName':_0x5e05d6[_0x3ae20c(0x26e)],'isMultiVersion':_0x3c8b8c['length']>0x1});};if(_0x48fac3&&_0x3c8b8c['length']>0x1){const _0x39a913=[];for(const _0x57c1d2 of _0x3c8b8c){const _0x39e3c2=_0x57c1d2[_0x50358b(0x210)]||0x1;_0x41d667['progress']?.[_0x50358b(0x26c)](_0x50358b(0x202)+_0x5e05d6[_0x50358b(0x26e)]+'\x20v'+_0x39e3c2);const _0x2e0246=await _0x123aa0(_0x57c1d2['id']),_0x26dbc6=_0x508a22(_0x57c1d2['id']),_0x17a79b=await journeyResponseToDef(_0x2e0246,_0x26dbc6);_0x39a913[_0x50358b(0x1a4)]({'item':_0x57c1d2,'yaml':_0x17a79b});}const _0x17be42=buildLocalRuleToNameMappingFromJourney(_0x5e05d6);_0x206d6c=buildMergedJourneyDef(_0x39a913,_0x17be42,_0x3c34b8);const _0xdacdfa=Math[_0x50358b(0x285)](..._0x39a913[_0x50358b(0x209)](_0x8c33fe=>_0x8c33fe[_0x50358b(0x251)][_0x50358b(0x210)]||0x0)),_0x39eb01=_0x3c8b8c[_0x50358b(0x1d9)](_0x1ef212=>(_0x1ef212['versionNumber']||0x0)===_0xdacdfa);_0x39eb01&&(_0x41d667[_0x50358b(0x1e1)]?.[_0x50358b(0x26c)]('Fetching\x20'+_0x5e05d6['name']+'\x20v'+_0xdacdfa),_0x1aff22=await _0x123aa0(_0x39eb01['id']));}else{const _0x4273fc=_0x3c8b8c[_0x3c8b8c[_0x50358b(0x1f4)]-0x1];_0x41d667['progress']?.['update'](_0x50358b(0x202)+_0x5e05d6[_0x50358b(0x26e)]),_0x1aff22=await _0x123aa0(_0x4273fc['id']);const _0x7ad1e9=_0x508a22(_0x4273fc['id']),_0x5ae31a=await journeyResponseToDef(_0x1aff22,_0x7ad1e9),_0x40c906=buildLocalRuleToNameMappingFromJourney(_0x5e05d6);_0x206d6c=buildMergedJourneyDef([{'item':_0x4273fc,'yaml':_0x5ae31a}],_0x40c906,_0x3c34b8);}}addFoldersToCreate(_0x21356,_0x41d667[_0x50358b(0x27f)],_0x3574f0);const _0x3f8a02=calculateJourneyDiff(_0x5e05d6,_0x206d6c);_0x36bd0c[_0x50358b(0x1a4)]({'relativePath':_0x5e05d6[_0x50358b(0x26e)],'absolutePath':_0x241ff7,'yamlConfig':_0x5e05d6,'folderPath':_0x21356,'existingJourney':_0x1aff22,'isNew':_0x3f8a02[_0x50358b(0x279)],'hasChanges':_0x3f8a02[_0x50358b(0x1e3)],'diff':_0x3f8a02[_0x50358b(0x1d2)]});}return{'journeyFiles':_0x36bd0c,'foldersToCreate':_0x3574f0};}export function calculateActivationActions(_0x47b983,_0x41372e,_0x31ea45,_0x12efa7){const _0x1edf35=a142_0x3ef9cf,_0x593d76=[],_0x223aa3=new Map();for(const _0xb9bb6e of _0x41372e){_0x223aa3[_0x1edf35(0x21b)](_0xb9bb6e[_0x1edf35(0x26e)],_0xb9bb6e);}const _0x9259f=new Map();for(const _0x1fbbaa of _0x47b983){_0x9259f['set'](_0x1fbbaa[_0x1edf35(0x26e)],_0x1fbbaa);}for(const _0x56855c of _0x47b983){const _0x1637b0=_0x223aa3['get'](_0x56855c[_0x1edf35(0x26e)]);if(!_0x1637b0)_0x593d76[_0x1edf35(0x1a4)]({'type':'create','name':_0x56855c[_0x1edf35(0x26e)],'yamlActivation':_0x56855c});else{const _0x27c091=activationResponseToDef(_0x1637b0,_0x31ea45,_0x12efa7),_0x2163bc=a142_0x4a29a2[_0x1edf35(0x216)](_0x27c091),_0xa2751=a142_0x4a29a2[_0x1edf35(0x216)](_0x56855c);_0x2163bc!==_0xa2751&&_0x593d76[_0x1edf35(0x1a4)]({'type':_0x1edf35(0x26c),'name':_0x56855c[_0x1edf35(0x26e)],'yamlActivation':_0x56855c,'existingActivation':_0x1637b0});}}for(const _0x166d73 of _0x41372e){!_0x9259f[_0x1edf35(0x1d5)](_0x166d73[_0x1edf35(0x26e)])&&_0x593d76[_0x1edf35(0x1a4)]({'type':_0x1edf35(0x1f9),'name':_0x166d73['name'],'existingActivation':_0x166d73});}return _0x593d76;}function calculateYamlDiff(_0x1a0237,_0x110a8e){if(_0x110a8e){const _0x5872f6=generateDiff(_0x110a8e,_0x1a0237),_0x2cf5cd=hasChanges(_0x5872f6);return{'isNew':![],'hasChanges':_0x2cf5cd,'diff':_0x2cf5cd?formatDiffWithColors(_0x5872f6):undefined};}const _0x220fa5=generateDiff('',_0x1a0237);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x220fa5)};}export function calculateSegmentDiff(_0x396c56,_0x36c1d0,_0x531544,_0xa64b62,_0x575cf7){const _0x3e11d1=segmentToYamlString(_0x396c56),_0x4f57d8=_0x36c1d0?segmentToYamlString(segmentWithActivationsToYaml(_0x36c1d0,_0x531544,undefined,_0xa64b62,_0x575cf7)):undefined;return calculateYamlDiff(_0x3e11d1,_0x4f57d8);}export function calculateJourneyDiff(_0x2614f1,_0x5cf900){const _0x389595=normalizeJourneyDef(_0x2614f1,_0x2614f1),_0x4cee39=a142_0x2c1878(_0x389595),_0x35ef69=_0x5cf900?a142_0x2c1878(normalizeJourneyDef(_0x5cf900,_0x2614f1)):undefined;return calculateYamlDiff(_0x4cee39,_0x35ef69);}function a142_0x570e(){const _0x27af4e=['debug','join','isArray','segment_updated','deleteSegment','replace','WaitStep','12jXipVF','dirname','isNew','absolutePath','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','results','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x20error(s)','folderPathToId','connector_config','journey_created','conditions','folder_created','folder','max','list','draft','parentSegmentFolder','activation_deleted','\x20activation\x20\x27','create','digest','activationContext','entry_criteria','listActivations','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','Creating\x20folder\x20\x27','journey','createJourneySegment','keys','Creating\x20segment\x20\x27','__pending_','run_after_journey_refresh','idToEmailMap','SEGMENT_UPDATE_ERROR','conditionSegmentId','createActivation','Embedded\x20segment\x20\x27','activation_','filter','createdSegmentId','tdx.sdk.push-workflow','activation_creating','rule','rootFolderId','activations','):\x20','journeys','waitStepUnit','push','\x20(referenced\x20in\x20journey\x20','steps','deleteActivation','journey_updating','\x27...','connectionIdToNameMap','notification','match','exitCriterias','embedded_activation_creating','Updating\x20segment\x20\x27','Updating\x20activation\x20\x27','JOURNEY_UPDATE_ERROR','reduce','journeyName','activationActions','updated','activation_updating','journeyBundlesByFolderAndName','journeyBundleName','existingSegment','folderPath','parseDocument','activation_created','toString','embedded_activation_created','journeyActivationNameToId','Created\x20journey\x20\x27','getActivation','conditionTimeoutUnit','journey_updated','Activation\x20not\x20found:\x20','unchanged','with','segment','Stage\x20\x27','logDeleted','state','createSegment','existingActivation','activation_deleting','split','297660BTEkDB','sort','Delete\x20the\x20push\x20recovery\x20file\x20(','diff','6427540burXJe','segmentFolderId','has','behavior','values','buildUserMaps','find','message','valid','parse','Updated\x20segment\x20\x27','2005645bFjLBR','relative','1854340ZnUHWD','progress','includes','hasChanges','hex','embedded_segment_created','resolvedRule','created','getJourney','Activation','Name\x20has\x20already\x20been\x20taken','15393HeUaDj','uniqueServerName','journeyById','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27\x20not\x20found\x20in\x20journey\x20\x27','createFolder','existingJourney','connection','logSuccess','length','Entry\x20criteria:\x20','relationships','activation_template_id','Failed\x20to\x20resolve\x20activation\x20','delete','Deleted\x20activation\x20\x27','index','segmentNameToId','stages','attributes','\x20journey\x20from\x20file:\x20','updateSegmentById','./child-segment-yaml.js','Fetching\x20','SEGMENT_NOT_FOUND','Created\x20activation\x20\x27','all_columns','\x27\x20for\x20','startsWith','day','map','Updated\x20journey\x20\x27','Segment\x20not\x20found:\x20','stage\x20\x27','journeyActivationStepId','entryCriteria','all','versionNumber','conditionTimeoutDuration','slice','toISOString','ACTIVATION_UPDATE_ERROR','journeyId','stringify','errors','add','Deleted\x20segment\x20\x27','type','set','\x27\x20decision\x20point\x20branch\x20\x27','104018rRkkOi','columns','journeyStages','SEGMENT_SYNTAX_ERROR','segmentId','existingSegments','./journey-yaml.js','getSegmentEntity','\x0a\x20\x20','utf-8','size','onProgress','resolveSegment','deleted','__pending_act_','6fISXEG','../../utils/async.js','waitStep','validatedRequest','Failed\x20to\x20','nameToType','3177765rfyDtB','376ELBQgR','verbose','withProgress','milestone','Created\x20segment\x20\x27','activationsBySegmentId','get','nameToId','parentId','journeyBundleId','Journey\x20\x27','description','INTERNAL','deps',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','schedule','some','ACTIVATION_SYNTAX_ERROR','branches','from','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','object','createdSegmentIds','yamlConfig','toLowerCase','uniqueSegmentName','yamlActivation','entry','\x27\x20exit\x20criteria','activation_updated','item','Creating\x20activation\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','segment_created','action','\x27\x20from\x20file:\x20',').\x20','JOURNEY_SYNTAX_ERROR','Updated\x20activation\x20\x27','.$1.push-recovery.json','segments','Failed\x20to\x20resolve\x20segment\x20','updateActivation','folderId','activationParams','NOT_FOUND','data','waitStepType','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x27\x20wait\x20condition','getLatestJourneyId','trim','localName','flatMap','goal','embeddedSegmentNameToId','DecisionPoint','update','fetchJourney','name','\x20segment\x20from\x20file:\x20'];a142_0x570e=function(){return _0x27af4e;};return a142_0x570e();}export function findSegmentsToDelete(_0x33a1f5,_0x1388c2,_0x437af8,_0x4de174,_0x2b1e51){const _0x1e25e2=a142_0x3ef9cf,_0x2ff9c5=new Set();for(const {yamlConfig:_0x455b29,folderPath:_0x47a75e}of _0x1388c2){_0x2ff9c5['add'](_0x47a75e+':'+_0x455b29[_0x1e25e2(0x26e)]);}return _0x33a1f5[_0x1e25e2(0x29e)](_0x4590ed=>{const _0x48090f=_0x1e25e2,_0x52e94b=_0x4590ed['segmentFolderId']?_0x437af8['get'](_0x4590ed[_0x48090f(0x1d4)]['toString']())||'':'',_0x39f2f5=_0x52e94b+':'+_0x4590ed[_0x48090f(0x26e)];if(_0x2ff9c5[_0x48090f(0x1d5)](_0x39f2f5))return![];if(_0x2b1e51)return _0x52e94b===_0x4de174||_0x52e94b[_0x48090f(0x207)](_0x4de174+'/');return!![];});}export function findJourneysToDelete(_0xd2c845,_0x4172b8,_0x12bd70,_0x381b63,_0x210c70){const _0x4c0f02=a142_0x3ef9cf,_0x4ff9aa=new Set();for(const {yamlConfig:_0x5aab86,folderPath:_0x5a0fe6}of _0x4172b8){_0x4ff9aa[_0x4c0f02(0x218)](_0x5a0fe6+':'+_0x5aab86[_0x4c0f02(0x26e)]);}return _0xd2c845[_0x4c0f02(0x29e)](_0x7c25e2=>{const _0x1600d3=_0x4c0f02,_0x3fd7fe=_0x7c25e2['folderId']?_0x12bd70[_0x1600d3(0x239)](_0x7c25e2[_0x1600d3(0x25e)])||'':'',_0x5b70e9=_0x3fd7fe+':'+_0x7c25e2[_0x1600d3(0x1b8)];if(_0x4ff9aa[_0x1600d3(0x1d5)](_0x5b70e9))return![];if(_0x210c70)return _0x3fd7fe===_0x381b63||_0x3fd7fe[_0x1600d3(0x207)](_0x381b63+'/');return!![];});}export function buildSegmentLookupMap(_0x238649,_0x317c0c){const _0x549f85=a142_0x3ef9cf,_0x4cbd45=new Map();for(const _0x7bd865 of _0x238649){const _0x3eeeb4=_0x7bd865[_0x549f85(0x1d4)]?_0x317c0c[_0x549f85(0x239)](_0x7bd865[_0x549f85(0x1d4)][_0x549f85(0x1bd)]())||'':'',_0x1cd77e=_0x3eeeb4+':'+_0x7bd865[_0x549f85(0x26e)];_0x4cbd45[_0x549f85(0x21b)](_0x1cd77e,_0x7bd865);}return _0x4cbd45;}function a142_0x3bff(_0x1b776c,_0x143ee8){_0x1b776c=_0x1b776c-0x1a4;const _0x570e97=a142_0x570e();let _0x3bff15=_0x570e97[_0x1b776c];return _0x3bff15;}export function buildSegmentNameToIdMap(_0x139b51){const _0x4b1f62=a142_0x3ef9cf,_0x3f8afe=new Map();for(const _0x5319db of _0x139b51){_0x3f8afe[_0x4b1f62(0x21b)](_0x5319db[_0x4b1f62(0x26e)],_0x5319db['id']);}return _0x3f8afe;}export function buildJourneyBundleLookupMap(_0x178ddf,_0x53fda8){const _0x7bf2af=a142_0x3ef9cf,_0x10cfa1=new Map();for(const _0x2e2e4a of _0x178ddf){const _0x51b74e=_0x2e2e4a['folderId']?_0x53fda8['get'](_0x2e2e4a[_0x7bf2af(0x25e)])||'':'',_0x53fc05=_0x51b74e+':'+_0x2e2e4a[_0x7bf2af(0x1b8)];!_0x10cfa1[_0x7bf2af(0x1d5)](_0x53fc05)&&_0x10cfa1[_0x7bf2af(0x21b)](_0x53fc05,[]),_0x10cfa1[_0x7bf2af(0x239)](_0x53fc05)[_0x7bf2af(0x1a4)](_0x2e2e4a);}for(const _0x44857d of _0x10cfa1[_0x7bf2af(0x1d7)]()){_0x44857d[_0x7bf2af(0x1d0)]((_0x5e8e73,_0x31368e)=>(_0x5e8e73['versionNumber']||0x0)-(_0x31368e[_0x7bf2af(0x210)]||0x0));}return _0x10cfa1;}export function collectFoldersToCreate(_0x4521c7,_0x2fb469){const _0x574c94=a142_0x3ef9cf,_0x3508d5=new Set();for(const _0x80ffd4 of _0x4521c7){if(!_0x80ffd4)continue;if(_0x2fb469[_0x574c94(0x1d5)](_0x80ffd4))continue;const _0x3a6972=_0x80ffd4[_0x574c94(0x1ce)]('/');let _0x1709f6='';for(const _0x18e14d of _0x3a6972){_0x1709f6=_0x1709f6?_0x1709f6+'/'+_0x18e14d:_0x18e14d,!_0x2fb469[_0x574c94(0x1d5)](_0x1709f6)&&_0x3508d5[_0x574c94(0x218)](_0x1709f6);}}return _0x3508d5;}export function parseAndClassifyYamlFiles(_0x1702e6,_0x5a63a1,_0x332427){const _0x9c5754=a142_0x3ef9cf,_0x184e1f=[],_0x41c5bc=[];for(const _0x453e67 of _0x1702e6){const _0x576c68=a142_0x3c5b6d['relative'](_0x5a63a1,a142_0x3c5b6d[_0x9c5754(0x278)](_0x453e67)),_0x4b3159=_0x576c68==='.'?'':_0x576c68,_0xb06802=readFileSync(_0x453e67,'utf-8'),_0x32831d=a142_0x4a29a2[_0x9c5754(0x1dc)](_0xb06802);if(isJourneyDef(_0x32831d)){const _0x5f4f5b=a142_0x4a5f14(_0xb06802);_0x41c5bc['push']({'yamlConfig':_0x5f4f5b,'folderPath':_0x4b3159,'sourcePath':_0x453e67});}else{if(!_0x332427?.['skipSegments']){const _0x42622b=parseSegmentYamlFile(_0xb06802),_0x4297a2=normalizeChildSegmentYaml(_0x42622b);_0x184e1f[_0x9c5754(0x1a4)]({'yamlConfig':_0x4297a2,'folderPath':_0x4b3159,'sourcePath':_0x453e67});}}}return{'segments':_0x184e1f,'journeys':_0x41c5bc};}export function validateParsedFiles(_0x374afe,_0x376e3c){const _0x8c0e09=a142_0x3ef9cf,_0x2cd0ce=[];for(const {yamlConfig:_0x173472,sourcePath:_0x3f6d29}of _0x374afe[_0x8c0e09(0x25b)]){const _0x14c1d2=readFileSync(_0x3f6d29,_0x8c0e09(0x226)),_0x1c6d34=a142_0x4a29a2[_0x8c0e09(0x1bb)](_0x14c1d2),_0x5971d1=validateSegmentDef(_0x173472,{'source':_0x14c1d2,'document':_0x1c6d34},{'skipSchema':!![]});if(!_0x5971d1['valid']){const _0x46a348=a142_0x3c5b6d['relative'](_0x376e3c,_0x3f6d29);_0x2cd0ce['push']({'filePath':_0x46a348,'source':_0x14c1d2,'result':_0x5971d1,'isJourney':![]});}}for(const {yamlConfig:_0x18c92d,sourcePath:_0x3044c2}of _0x374afe[_0x8c0e09(0x2a6)]){const _0x5c6992=readFileSync(_0x3044c2,_0x8c0e09(0x226)),_0x37cb9b=a142_0x4a29a2[_0x8c0e09(0x1bb)](_0x5c6992),_0x466d62=validateJourneyDef(_0x18c92d,{'source':_0x5c6992,'document':_0x37cb9b},{'skipSchema':!![]});if(!_0x466d62[_0x8c0e09(0x1db)]){const _0x2fc8f3=a142_0x3c5b6d[_0x8c0e09(0x1df)](_0x376e3c,_0x3044c2);_0x2cd0ce[_0x8c0e09(0x1a4)]({'filePath':_0x2fc8f3,'source':_0x5c6992,'result':_0x466d62,'isJourney':!![]});}}return _0x2cd0ce;}export function formatValidationErrors(_0x5f2adb){const _0x214c8b=a142_0x3ef9cf,_0x2d3502=[];for(const {filePath:_0xf13c3c,source:_0x3c5e84,result:_0x489ee9,isJourney:_0x35c890}of _0x5f2adb){const _0xb3267d=_0x35c890?_0x214c8b(0x292):_0x214c8b(0x1c7);_0x2d3502[_0x214c8b(0x1a4)]('\x0a'+_0xf13c3c+'\x20('+_0xb3267d+_0x214c8b(0x2a5)+_0x489ee9[_0x214c8b(0x217)]['length']+_0x214c8b(0x27e)),_0x2d3502[_0x214c8b(0x1a4)](formatValidationResult(_0x489ee9,_0x3c5e84,_0xf13c3c));}return _0x2d3502[_0x214c8b(0x271)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x328e47){const _0x35179b=a142_0x3ef9cf,_0x336371=new Set(),_0x43a277=new Map(),_0x127949=collectSegmentUsageCounts(_0x328e47);if(_0x328e47[_0x35179b(0x25b)])for(const [_0x39b242,_0x2ebb1f]of Object['entries'](_0x328e47[_0x35179b(0x25b)])){_0x336371[_0x35179b(0x218)](_0x39b242);if(_0x2ebb1f[_0x35179b(0x2a2)]){const _0x46fca0=yamlRuleToApi(_0x2ebb1f[_0x35179b(0x2a2)]),_0x10a7f6=apiRuleToYaml(_0x46fca0);_0x43a277[_0x35179b(0x21b)](_0x39b242,_0x10a7f6);}}const _0x36cd2c=new Map();let _0x580575=0x0;for(const [_0x420f23,_0xccab7f]of _0x43a277){const _0x66a5f9=serializeExpandedRule(_0xccab7f,_0x43a277),_0x3246bf=_0x36cd2c[_0x35179b(0x239)](_0x66a5f9)||[];_0x3246bf['push']({'name':_0x420f23,'index':_0x580575}),_0x36cd2c['set'](_0x66a5f9,_0x3246bf),_0x580575++;}const _0x566104=new Map();for(const [_0x4c69c4,_0x5b3047]of _0x36cd2c){const _0x990c0f=_0x5b3047[_0x35179b(0x212)]()[_0x35179b(0x1d0)]((_0x14770a,_0x5b4461)=>{const _0x342ce7=_0x35179b,_0x126e0a=_0x127949['get'](_0x14770a[_0x342ce7(0x26e)])||0x0,_0x3febcb=_0x127949['get'](_0x5b4461[_0x342ce7(0x26e)])||0x0;if(_0x126e0a!==_0x3febcb)return _0x3febcb-_0x126e0a;return _0x14770a[_0x342ce7(0x1fb)]-_0x5b4461[_0x342ce7(0x1fb)];})['map'](_0x495280=>_0x495280[_0x35179b(0x26e)]),_0x33d07d=[];for(const _0x1e79e8 of _0x990c0f){const _0x4f96b8=_0x127949['get'](_0x1e79e8)||0x0,_0xcebba8=Math[_0x35179b(0x285)](_0x4f96b8,0x1);for(let _0x3884f2=0x0;_0x3884f2<_0xcebba8;_0x3884f2++){_0x33d07d[_0x35179b(0x1a4)](_0x1e79e8);}}_0x566104[_0x35179b(0x21b)](_0x4c69c4,_0x33d07d);}return{'existingLocalSegmentNames':_0x336371,'localSegmentRules':_0x43a277,'localExpandedRuleToNames':_0x566104};}export function createSegmentIdResolver(_0x36bd57,_0x4f4fb9){return async _0x398b42=>{const _0x4e8806=a142_0x3bff,_0x2f10d4=_0x36bd57[_0x4e8806(0x239)](_0x398b42);if(!_0x2f10d4)throw new SDKError(ErrorCode[_0x4e8806(0x203)],_0x4e8806(0x20b)+_0x398b42+_0x4e8806(0x27b)+_0x4f4fb9+'\x27)');return _0x2f10d4;};}export function extractRootFolderId(_0x1d1451){const _0x2a2679=a142_0x3ef9cf;return _0x1d1451[_0x2a2679(0x1f6)]?.[_0x2a2679(0x288)]?.[_0x2a2679(0x261)]?.['id']||_0x1d1451['relationships']?.['parentFolder']?.[_0x2a2679(0x261)]?.['id'];}export function buildConnectionMaps(_0x5290ef){const _0x67a573=a142_0x3ef9cf,_0x5dbbdd=new Map(),_0x20abd8=new Map(),_0x23086f=new Map();for(const _0x4227d4 of _0x5290ef){_0x5dbbdd[_0x67a573(0x21b)](_0x4227d4['name'],parseInt(_0x4227d4['id'],0xa)),_0x20abd8[_0x67a573(0x21b)](_0x4227d4['id'],_0x4227d4[_0x67a573(0x26e)]),_0x23086f[_0x67a573(0x21b)](_0x4227d4[_0x67a573(0x26e)],_0x4227d4['type']);}return{'nameToId':_0x5dbbdd,'idToName':_0x20abd8,'nameToType':_0x23086f};}export function calculatePushStats(_0x14ab0a,_0x2d0425,_0x4a3c3f,_0x58dcfe,_0x218877,_0x3a5860,_0x279ba0){const _0x5b2d58=a142_0x3ef9cf,_0x3a48f9=_0x14ab0a['filter'](_0x53c074=>_0x53c074['isNew']),_0x52cd3f=_0x14ab0a[_0x5b2d58(0x29e)](_0x7bca4f=>!_0x7bca4f[_0x5b2d58(0x279)]&&_0x7bca4f['hasChanges']),_0x3fde8c=_0x14ab0a['filter'](_0x304114=>!_0x304114[_0x5b2d58(0x279)]&&!_0x304114[_0x5b2d58(0x1e3)]),_0x5a39ff=_0x3a5860?_0x58dcfe:[],_0x1327ac=_0x2d0425['filter'](_0x24780e=>_0x24780e[_0x5b2d58(0x279)]),_0x335ab9=_0x2d0425[_0x5b2d58(0x29e)](_0x5d6461=>!_0x5d6461[_0x5b2d58(0x279)]&&_0x5d6461[_0x5b2d58(0x1e3)]),_0xa4de92=_0x2d0425[_0x5b2d58(0x29e)](_0x3ba9b9=>!_0x3ba9b9[_0x5b2d58(0x279)]&&!_0x3ba9b9[_0x5b2d58(0x1e3)]),_0x3228e6=_0x3a5860?_0x218877:[],_0x56776c=_0x14ab0a[_0x5b2d58(0x268)](_0x15ed34=>_0x15ed34['activationActions']),_0x28b94d=_0x56776c['filter'](_0x8fe17f=>_0x8fe17f[_0x5b2d58(0x21a)]==='create'),_0x26de2a=_0x56776c[_0x5b2d58(0x29e)](_0x426b5b=>_0x426b5b[_0x5b2d58(0x21a)]===_0x5b2d58(0x26c)),_0x161501=_0x56776c[_0x5b2d58(0x29e)](_0x44cc3c=>_0x44cc3c['type']===_0x5b2d58(0x1f9)),_0x3002ca=Array[_0x5b2d58(0x246)](_0x4a3c3f)['sort'](),_0x5a4c29=_0x279ba0?![]:_0x3a48f9[_0x5b2d58(0x1f4)]>0x0||_0x52cd3f['length']>0x0||_0x5a39ff[_0x5b2d58(0x1f4)]>0x0,_0x566b35=_0x1327ac[_0x5b2d58(0x1f4)]>0x0||_0x335ab9[_0x5b2d58(0x1f4)]>0x0||_0x3228e6['length']>0x0,_0x51c454=_0x279ba0?![]:_0x56776c['length']>0x0,_0x2f030b=_0x3002ca[_0x5b2d58(0x1f4)]>0x0;return{'segments':{'new':_0x3a48f9,'changed':_0x52cd3f,'unchanged':_0x3fde8c,'toDelete':_0x5a39ff},'journeys':{'new':_0x1327ac,'changed':_0x335ab9,'unchanged':_0xa4de92,'toDelete':_0x3228e6},'activations':{'all':_0x56776c,'toCreate':_0x28b94d,'toUpdate':_0x26de2a,'toDelete':_0x161501},'folders':{'toCreate':_0x3002ca},'counts':{'segments':{'new':_0x3a48f9[_0x5b2d58(0x1f4)],'changed':_0x52cd3f[_0x5b2d58(0x1f4)],'unchanged':_0x3fde8c['length'],'toDelete':_0x5a39ff[_0x5b2d58(0x1f4)]},'journeys':{'new':_0x1327ac[_0x5b2d58(0x1f4)],'changed':_0x335ab9['length'],'unchanged':_0xa4de92[_0x5b2d58(0x1f4)],'toDelete':_0x3228e6['length']},'activations':{'create':_0x28b94d[_0x5b2d58(0x1f4)],'update':_0x26de2a[_0x5b2d58(0x1f4)],'delete':_0x161501['length']},'folders':_0x3002ca[_0x5b2d58(0x1f4)]},'hasChanges':_0x5a4c29||_0x566b35||_0x51c454||_0x2f030b};}export async function buildPushExecutionContext(_0xa56521,_0x1d95bf,_0x29d094,_0x5e43b3,_0x5364bb,_0x1a86e0){const _0xe1b4ce=a142_0x3ef9cf,_0x2bee9a=extractRootFolderId(_0x29d094),{pathToId:_0x337dca,idToPath:_0x4d0c4c}=buildFolderMaps(_0x5364bb),_0x3cde21=buildSegmentNameToIdMap(_0x5e43b3),_0x2066f6=new Map(),{batchAsync:_0x36bb4d}=await import(_0xe1b4ce(0x22d)),[_0x25fc6f,_0x4aaeff]=await Promise[_0xe1b4ce(0x20f)]([_0xa56521['user'][_0xe1b4ce(0x1d8)](),_0xa56521['connection'][_0xe1b4ce(0x286)](),((async()=>{const _0x3f84ad=_0xe1b4ce;!_0x1a86e0&&_0x5e43b3[_0x3f84ad(0x1f4)]>0x0&&await _0x36bb4d(_0x5e43b3,async _0x8cbc31=>{const _0xa8a093=_0x3f84ad,_0x437486=await _0xa56521['segment'][_0xa8a093(0x28f)](_0x1d95bf,_0x8cbc31['id']);_0x2066f6[_0xa8a093(0x21b)](_0x8cbc31['id'],_0x437486);});})())]),{emailToId:_0x4dafc9,idToEmail:_0x162c44}=_0x25fc6f,_0x5de609=buildConnectionMaps(_0x4aaeff);return{'rootFolderId':_0x2bee9a,'folderPathToId':_0x337dca,'folderIdToPath':_0x4d0c4c,'segmentNameToId':_0x3cde21,'activationsBySegmentId':_0x2066f6,'emailToIdMap':_0x4dafc9,'idToEmailMap':_0x162c44,'connectionNameToIdMap':_0x5de609[_0xe1b4ce(0x23a)],'connectionIdToNameMap':_0x5de609['idToName'],'connectionNameToTypeMap':_0x5de609[_0xe1b4ce(0x231)]};}export function createPushYamlContextForBundle(_0x3a9e98,_0x29f84a,_0x387cab,_0x3e8933,_0xa22d7b,_0x32bf2d,_0x107666,_0x2568e4){const {existingLocalSegmentNames:_0x4bbae4,localExpandedRuleToNames:_0x3c6b7f}=_0x3e8933,_0x13de0d=new Set(),_0x327203=new Map(),_0x1cc531=new Map(),_0x565804=new Map(),_0x42312d=createJumpTargetCache(),_0x45cbae=new Map(),_0x4cc3b9=new Map(),_0x270b2e=new Set();let _0x5484d9;const _0x568907=_0x181843=>{const _0x33368c={'resolveSegment':async _0x2b5984=>{const _0x39df6e=a142_0x3bff,_0x5b9db9=_0x565804[_0x39df6e(0x239)](_0x2b5984);if(_0x5b9db9!==undefined)return{'name':_0x5b9db9,'isJourneyLocal':!![]};try{const _0x3bee38=await fetchSegment(_0x3a9e98,_0x29f84a,_0x2b5984,_0x387cab);if(!_0x3bee38)throw new Error('Segment\x20not\x20found');const _0x112aa1=generateJourneyLocalName(_0x3bee38['name']),_0x1d7f9c=_0x3bee38['kind']===SEGMENT_KIND_JOURNEY&&_0x112aa1!==undefined;let _0x1900c5=_0x3bee38[_0x39df6e(0x26e)],_0x1f1590;if(_0x1d7f9c&&_0x3bee38[_0x39df6e(0x2a2)]){const _0x5194e9=apiRuleToYaml(_0x3bee38[_0x39df6e(0x2a2)]);_0x4cc3b9['set'](_0x2b5984,_0x5194e9);const _0x27abb7=async _0x79eaed=>{const _0x3ed4e8=_0x39df6e,_0x49f498=collectSegmentRefsFromRule(_0x79eaed);for(const _0x5f2dc6 of _0x49f498){if(!_0x4cc3b9[_0x3ed4e8(0x1d5)](_0x5f2dc6))try{const _0x3dd3c2=await fetchSegment(_0x3a9e98,_0x29f84a,_0x5f2dc6,_0x387cab);if(_0x3dd3c2?.[_0x3ed4e8(0x2a2)]){const _0x3ef4cf=apiRuleToYaml(_0x3dd3c2[_0x3ed4e8(0x2a2)]);_0x4cc3b9['set'](_0x5f2dc6,_0x3ef4cf),await _0x27abb7(_0x3ef4cf);}}catch(_0x5eded8){logger[_0x3ed4e8(0x270)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x5f2dc6+':\x20'+_0x5eded8);}}};await _0x27abb7(_0x5194e9);const _0x29bbef=serializeExpandedRule(_0x5194e9,_0x4cc3b9),_0x54413c=_0x3c6b7f['get'](_0x29bbef);if(_0x54413c&&_0x54413c['length']>0x0){const _0x21c96e=_0x327203[_0x39df6e(0x239)](_0x29bbef)||0x0,_0x4ff1ea=_0x54413c[_0x21c96e]||_0x54413c[_0x54413c[_0x39df6e(0x1f4)]-0x1];_0x327203[_0x39df6e(0x21b)](_0x29bbef,_0x21c96e+0x1),_0x1900c5=_0x4ff1ea,_0x13de0d[_0x39df6e(0x218)](_0x1900c5),_0x565804[_0x39df6e(0x21b)](_0x2b5984,_0x1900c5);const _0x1fb98b=await resolveRuleSegmentRefs(_0x5194e9,async _0x41dc25=>{const _0x5d603c=_0x39df6e,_0x1c9694=_0x565804['get'](_0x41dc25);if(_0x1c9694)return _0x1c9694;const _0x366d86=await _0x5484d9['resolveSegment'](_0x41dc25);return _0x366d86[_0x5d603c(0x26e)];});_0x1f1590={'description':_0x3bee38[_0x39df6e(0x23e)],'rule':_0x1fb98b};}else{const _0x82a6eb=_0x45cbae[_0x39df6e(0x239)](_0x29bbef);if(_0x82a6eb)_0x1900c5=_0x82a6eb,_0x565804[_0x39df6e(0x21b)](_0x2b5984,_0x1900c5);else{if(_0x112aa1){let _0x283185=_0x112aa1,_0x21bf8b=0x2;while(_0x13de0d[_0x39df6e(0x1d5)](_0x283185)||_0x4bbae4[_0x39df6e(0x1d5)](_0x283185)){_0x283185=_0x112aa1+'_'+_0x21bf8b,_0x21bf8b++;}_0x13de0d[_0x39df6e(0x218)](_0x283185),_0x1900c5=_0x283185;}_0x565804['set'](_0x2b5984,_0x1900c5),_0x45cbae['set'](_0x29bbef,_0x1900c5);const _0x22ec3e=await resolveRuleSegmentRefs(_0x5194e9,async _0x172a59=>{const _0x448abf=_0x39df6e,_0x58b92b=_0x565804[_0x448abf(0x239)](_0x172a59);if(_0x58b92b)return _0x58b92b;const _0x867c25=await _0x5484d9[_0x448abf(0x229)](_0x172a59);return _0x867c25['name'];});_0x1f1590={'description':_0x3bee38[_0x39df6e(0x23e)],'rule':_0x22ec3e};}}}return{'name':_0x1900c5,'isJourneyLocal':_0x1d7f9c,'definition':_0x1f1590};}catch(_0x37062a){return logger['debug'](_0x39df6e(0x25c)+_0x2b5984+':\x20'+_0x37062a),{'name':_0x2b5984,'isJourneyLocal':![]};}},'resolveActivation':async _0x57ab07=>{const _0x257636=a142_0x3bff,_0x59ca3f=_0x1cc531[_0x257636(0x239)](_0x57ab07);if(_0x59ca3f!==undefined)return{'name':_0x59ca3f,'isJourneyLocal':!![]};try{let _0x2d44d0=_0x107666?.[_0x257636(0x239)](_0x57ab07);!_0x2d44d0&&(_0x2d44d0=await _0x3a9e98['journey'][_0x257636(0x1c1)](_0x181843,_0x57ab07));const _0x3c7539=_0x2d44d0['attributes'][_0x257636(0x25f)]['name']||_0x57ab07,_0x2c3129=sanitizeYamlKey(_0x3c7539)||_0x257636(0x29d)+_0x57ab07,_0x235c17=_0x2c3129;_0x1cc531[_0x257636(0x21b)](_0x57ab07,_0x235c17);const _0x30002e=journeyActivationStepToYaml(_0x2d44d0,_0xa22d7b,_0x32bf2d);return{'name':_0x235c17,'isJourneyLocal':!![],'definition':_0x30002e};}catch(_0x53d189){return logger['debug'](_0x257636(0x1f8)+_0x57ab07+':\x20'+_0x53d189),{'name':_0x57ab07,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x34df31,_0x19d8ef)=>resolveJumpTarget(_0x34df31,_0x19d8ef,_0x42312d,async _0x5b0b31=>{const _0x416ae0=a142_0x3bff,_0x1e9cd7=_0x2568e4?.[_0x416ae0(0x239)](_0x5b0b31);if(_0x1e9cd7)return _0x1e9cd7;return _0x3a9e98[_0x416ae0(0x292)][_0x416ae0(0x1e8)](_0x5b0b31);})};return _0x5484d9=_0x33368c,_0x33368c;},_0x2f3876=async _0x347a81=>{const _0x4a186f=a142_0x3bff,{collectSegmentIdsFromJourneyApi:_0x691994}=await import(_0x4a186f(0x223)),{batchAsync:_0x3df0a2}=await import('../../utils/async.js'),_0x499c51=new Set();for(const _0x174f64 of _0x347a81){let _0xa4dddc=_0x2568e4?.['get'](_0x174f64);!_0xa4dddc&&(_0xa4dddc=await _0x3a9e98['journey'][_0x4a186f(0x1e8)](_0x174f64));const _0x18fc1f=_0x691994(_0xa4dddc);for(const _0x1c5d2b of _0x18fc1f){_0x499c51[_0x4a186f(0x218)](_0x1c5d2b);}}let _0x2f39dd=Array[_0x4a186f(0x246)](_0x499c51);while(_0x2f39dd[_0x4a186f(0x1f4)]>0x0){const _0x479fa2=_0x2f39dd[_0x4a186f(0x29e)](_0x40c743=>!_0x270b2e[_0x4a186f(0x1d5)](_0x40c743));if(_0x479fa2[_0x4a186f(0x1f4)]===0x0)break;const _0x553a1e=await _0x3df0a2(_0x479fa2,async _0xcacf25=>{const _0x264aac=_0x4a186f;_0x270b2e[_0x264aac(0x218)](_0xcacf25);const _0x5c05eb=await fetchSegment(_0x3a9e98,_0x29f84a,_0xcacf25,_0x387cab);if(!_0x5c05eb)return null;return{'segmentId':_0xcacf25,'segment':_0x5c05eb};},0xa),_0x4c29bd=new Set();for(const _0x5d2b3f of _0x553a1e){if(!_0x5d2b3f?.[_0x4a186f(0x1c7)]?.[_0x4a186f(0x2a2)])continue;const _0x3e1296=apiRuleToYaml(_0x5d2b3f[_0x4a186f(0x1c7)]['rule']);_0x4cc3b9[_0x4a186f(0x21b)](_0x5d2b3f[_0x4a186f(0x221)],_0x3e1296);const _0x4467bc=collectSegmentRefsFromRule(_0x3e1296);for(const _0x1c00d3 of _0x4467bc){!_0x270b2e['has'](_0x1c00d3)&&_0x4c29bd[_0x4a186f(0x218)](_0x1c00d3);}}_0x2f39dd=Array[_0x4a186f(0x246)](_0x4c29bd);}};return{'createYamlContext':_0x568907,'prefetchJourneySegments':_0x2f3876};}export async function executePushSegments(_0x515cf4,_0x85c758,_0x3178e4,_0x264d2e,_0x3aa130){const _0xeb6e8f=a142_0x3ef9cf,{segmentDefToCreateRequest:_0x5a61e0,segmentDefToUpdateRequest:_0x37b3a8}=await import(_0xeb6e8f(0x201)),_0x4fb077=_0x3178e4[_0xeb6e8f(0x27f)],_0x94706f=0x5,_0xfa4156=async _0x34e0f1=>{const _0x38c83d=_0xeb6e8f,_0x1c3d45=_0x34e0f1[_0x38c83d(0x1ba)]?_0x4fb077['get'](_0x34e0f1[_0x38c83d(0x1ba)]):undefined;let _0x5e0f50;const _0x45559f={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x1edce6=_0x34e0f1[_0x38c83d(0x24a)];if(_0x34e0f1['yamlConfig'][_0x38c83d(0x2a2)]){const _0x5e4513=createSegmentIdResolver(_0x3178e4['segmentNameToId'],_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]),_0x4dabe3=await resolveRuleSegmentIds(_0x34e0f1['yamlConfig'][_0x38c83d(0x2a2)],_0x5e4513);_0x1edce6={..._0x34e0f1['yamlConfig'],'rule':_0x4dabe3};}try{if(_0x34e0f1[_0x38c83d(0x279)]){_0x3aa130[_0x38c83d(0x228)]?.({'type':'segment_creating','name':_0x34e0f1['yamlConfig'][_0x38c83d(0x26e)]});const _0x53edf4=_0x5a61e0(_0x1edce6,_0x1c3d45),_0x3f7a25=await _0x3aa130[_0x38c83d(0x235)](_0x38c83d(0x295)+_0x34e0f1[_0x38c83d(0x24a)]['name']+_0x38c83d(0x1a9),()=>_0x515cf4[_0x38c83d(0x1c7)][_0x38c83d(0x1cb)](_0x264d2e[_0x38c83d(0x23b)],_0x53edf4));_0x5e0f50=_0x3f7a25[_0x38c83d(0x261)]['id'],_0x3178e4['segmentNameToId'][_0x38c83d(0x21b)](_0x34e0f1['yamlConfig']['name'],_0x5e0f50),_0x45559f[_0x38c83d(0x29f)]={'name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)],'id':_0x5e0f50},_0x3aa130[_0x38c83d(0x228)]?.({'type':_0x38c83d(0x254),'name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)],'segmentId':_0x5e0f50}),_0x3aa130[_0x38c83d(0x1f3)]?.(_0x38c83d(0x237)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+'\x27'),_0x45559f[_0x38c83d(0x1e7)]=0x1;}else{if(_0x34e0f1[_0x38c83d(0x1e3)]){_0x3aa130['onProgress']?.({'type':'segment_updating','name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]});const _0xc0bcc=_0x37b3a8(_0x1edce6);_0x1c3d45!==_0x34e0f1[_0x38c83d(0x1b9)]?.[_0x38c83d(0x1d4)]&&(_0xc0bcc[_0x38c83d(0x1d4)]=_0x1c3d45?parseInt(_0x1c3d45,0xa):undefined),await _0x3aa130[_0x38c83d(0x235)](_0x38c83d(0x1af)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+_0x38c83d(0x1a9),()=>_0x515cf4[_0x38c83d(0x1c7)][_0x38c83d(0x200)](_0x264d2e[_0x38c83d(0x23b)],_0x34e0f1[_0x38c83d(0x1b9)]['id'],_0xc0bcc)),_0x5e0f50=_0x34e0f1[_0x38c83d(0x1b9)]['id'],_0x3aa130[_0x38c83d(0x228)]?.({'type':_0x38c83d(0x273),'name':_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]}),_0x3aa130['logSuccess']?.(_0x38c83d(0x1dd)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+'\x27'),_0x45559f[_0x38c83d(0x1b5)]=0x1;}else _0x5e0f50=_0x34e0f1[_0x38c83d(0x1b9)]['id'];}}catch(_0x13fc7a){const _0x25479d=isHttp400Error(_0x13fc7a),_0x223b43=_0x25479d?ErrorCode[_0x38c83d(0x220)]:ErrorCode[_0x38c83d(0x299)],_0x86cb0b=getErrorMessage(_0x13fc7a);throw new SDKError(_0x223b43,_0x38c83d(0x230)+(_0x34e0f1['isNew']?_0x38c83d(0x28b):_0x38c83d(0x26c))+_0x38c83d(0x26f)+_0x34e0f1[_0x38c83d(0x27a)]+_0x38c83d(0x225)+_0x86cb0b,_0x13fc7a);}try{const _0x38767a=await syncActivationsForSegment(_0x515cf4,_0x264d2e[_0x38c83d(0x23b)],_0x5e0f50,_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)],_0x34e0f1[_0x38c83d(0x1b4)],_0x3aa130,_0x34e0f1['absolutePath']);_0x45559f[_0x38c83d(0x2a4)]=_0x38767a;}catch(_0x453449){if(_0x453449 instanceof SDKError)throw _0x453449;throw new SDKError(ErrorCode[_0x38c83d(0x214)],_0x38c83d(0x290)+_0x34e0f1[_0x38c83d(0x24a)][_0x38c83d(0x26e)]+_0x38c83d(0x256)+_0x34e0f1[_0x38c83d(0x27a)]+_0x38c83d(0x225)+getErrorMessage(_0x453449),_0x453449);}return _0x45559f;},_0x101e57=await batchAsync(_0x85c758,_0xfa4156,_0x94706f),_0x282c8d={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5c20dc of _0x101e57){_0x282c8d['created']+=_0x5c20dc[_0xeb6e8f(0x1e7)],_0x282c8d[_0xeb6e8f(0x1b5)]+=_0x5c20dc[_0xeb6e8f(0x1b5)],_0x5c20dc[_0xeb6e8f(0x29f)]&&_0x282c8d[_0xeb6e8f(0x249)][_0xeb6e8f(0x21b)](_0x5c20dc['createdSegmentId'][_0xeb6e8f(0x26e)],_0x5c20dc[_0xeb6e8f(0x29f)]['id']),_0x282c8d[_0xeb6e8f(0x2a4)][_0xeb6e8f(0x1e7)]+=_0x5c20dc[_0xeb6e8f(0x2a4)][_0xeb6e8f(0x1e7)],_0x282c8d['activations'][_0xeb6e8f(0x1b5)]+=_0x5c20dc[_0xeb6e8f(0x2a4)]['updated'],_0x282c8d['activations'][_0xeb6e8f(0x22a)]+=_0x5c20dc[_0xeb6e8f(0x2a4)][_0xeb6e8f(0x22a)];}return _0x282c8d;}async function syncActivationsForSegment(_0x5d3f3d,_0x19e6eb,_0x3f6b7b,_0xa4f5bd,_0x59d10d,_0x10e1d9,_0x3ceb17){const _0x259b75=a142_0x3ef9cf,_0x29be11={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x361c6a of _0x59d10d){try{if(_0x361c6a[_0x259b75(0x21a)]===_0x259b75(0x28b)&&_0x361c6a[_0x259b75(0x22f)])_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x2a1),'segmentName':_0xa4f5bd,'activationName':_0x361c6a['name']}),await _0x10e1d9[_0x259b75(0x235)](_0x259b75(0x252)+_0x361c6a[_0x259b75(0x26e)]+_0x259b75(0x1a9),()=>_0x5d3f3d['segment']['createActivation'](_0x19e6eb,_0x3f6b7b,_0x361c6a[_0x259b75(0x22f)])),_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x1bc),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),_0x10e1d9[_0x259b75(0x1f3)]?.(_0x259b75(0x204)+_0x361c6a[_0x259b75(0x26e)]+'\x27'),_0x29be11[_0x259b75(0x1e7)]++;else{if(_0x361c6a['type']===_0x259b75(0x26c)&&_0x361c6a[_0x259b75(0x22f)]&&_0x361c6a[_0x259b75(0x1cc)])_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x1b6),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),await _0x10e1d9['withProgress'](_0x259b75(0x1b0)+_0x361c6a[_0x259b75(0x26e)]+_0x259b75(0x1a9),()=>_0x5d3f3d[_0x259b75(0x1c7)][_0x259b75(0x25d)](_0x19e6eb,_0x3f6b7b,_0x361c6a[_0x259b75(0x1cc)]['id'],_0x361c6a[_0x259b75(0x22f)])),_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x250),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),_0x10e1d9[_0x259b75(0x1f3)]?.(_0x259b75(0x259)+_0x361c6a[_0x259b75(0x26e)]+'\x27'),_0x29be11['updated']++;else _0x361c6a[_0x259b75(0x21a)]==='delete'&&_0x361c6a[_0x259b75(0x1cc)]&&(_0x10e1d9['onProgress']?.({'type':_0x259b75(0x1cd),'segmentName':_0xa4f5bd,'activationName':_0x361c6a[_0x259b75(0x26e)]}),await _0x10e1d9[_0x259b75(0x235)]('Deleting\x20activation\x20\x27'+_0x361c6a['name']+'\x27...',()=>_0x5d3f3d[_0x259b75(0x1c7)][_0x259b75(0x1a7)](_0x19e6eb,_0x3f6b7b,_0x361c6a[_0x259b75(0x1cc)]['id'])),_0x10e1d9[_0x259b75(0x228)]?.({'type':_0x259b75(0x289),'segmentName':_0xa4f5bd,'activationName':_0x361c6a['name']}),_0x10e1d9[_0x259b75(0x1c9)]?.(_0x259b75(0x1fa)+_0x361c6a[_0x259b75(0x26e)]+'\x27'),_0x29be11[_0x259b75(0x22a)]++);}}catch(_0x45391b){const _0x1b4077=isHttp400Error(_0x45391b),_0x360f5e=_0x1b4077?ErrorCode[_0x259b75(0x244)]:ErrorCode[_0x259b75(0x214)],_0xd2b069=getErrorMessage(_0x45391b);throw new SDKError(_0x360f5e,'Failed\x20to\x20'+_0x361c6a[_0x259b75(0x21a)]+_0x259b75(0x28a)+_0x361c6a[_0x259b75(0x26e)]+'\x27\x20from\x20file:\x20'+_0x3ceb17+_0x259b75(0x225)+_0xd2b069,_0x45391b);}}return _0x29be11;}export async function executePushFolders(_0x3dc75c,_0x1c4e58,_0x724a67,_0x1c7c56,_0xef1eb0){const _0x4a80c1=a142_0x3ef9cf,_0x2137d8=new Map(_0x724a67),_0x37e1f6=sortFoldersByDepth(_0x1c4e58);for(const _0x28c332 of _0x37e1f6){const _0x37eea9=_0x28c332[_0x4a80c1(0x1ce)]('/'),_0x4d7014=_0x37eea9[_0x37eea9[_0x4a80c1(0x1f4)]-0x1],_0x8fe0b9=_0x37eea9[_0x4a80c1(0x212)](0x0,-0x1)[_0x4a80c1(0x271)]('/'),_0x24fd31=_0x2137d8[_0x4a80c1(0x239)](_0x8fe0b9);_0xef1eb0[_0x4a80c1(0x228)]?.({'type':'folder_creating','folder':_0x28c332});const _0x2eca18={'name':_0x4d7014,'parentFolderId':_0x24fd31},_0x39be64=await _0xef1eb0[_0x4a80c1(0x235)](_0x4a80c1(0x291)+_0x28c332+'\x27...',()=>_0x3dc75c[_0x4a80c1(0x1c7)][_0x4a80c1(0x1f0)](_0x1c7c56[_0x4a80c1(0x23b)],_0x2eca18));_0x2137d8['set'](_0x28c332,_0x39be64[_0x4a80c1(0x261)]['id']),_0xef1eb0['onProgress']?.({'type':_0x4a80c1(0x283),'folder':_0x28c332,'folderId':_0x39be64[_0x4a80c1(0x261)]['id']}),_0xef1eb0['logInfo']?.('Created\x20folder\x20\x27'+_0x28c332+'\x27');}return _0x2137d8;}export async function executePushSegmentDeletions(_0x5abd9e,_0x371803,_0x130695){const _0x326e08=a142_0x3ef9cf;if(_0x371803[_0x326e08(0x1f4)]===0x0)return 0x0;const {batchAsync:_0x3f6c82}=await import(_0x326e08(0x22d)),_0xb7b576=0x5,_0xa3c567=await _0x3f6c82(_0x371803,async _0x8dafe5=>{const _0x446ace=_0x326e08;return _0x130695['onProgress']?.({'type':'segment_deleting','name':_0x8dafe5[_0x446ace(0x26e)]}),await _0x5abd9e[_0x446ace(0x1c7)][_0x446ace(0x274)](_0x8dafe5['id']),_0x130695[_0x446ace(0x228)]?.({'type':'segment_deleted','name':_0x8dafe5['name']}),_0x130695[_0x446ace(0x1c9)]?.(_0x446ace(0x219)+_0x8dafe5['name']+'\x27'),0x1;},_0xb7b576);return _0xa3c567[_0x326e08(0x1b2)]((_0x13a7d0,_0x12cf1f)=>_0x13a7d0+_0x12cf1f,0x0);}export async function executePushJourneys(_0x39c8cf,_0x411c9f,_0x3e4b9e,_0x157f70,_0x10d8fc){const _0x1561fa=a142_0x3ef9cf,{journeyDefToRequest:_0x4ed490}=await import(_0x1561fa(0x223)),{activationDefToCreateRequest:_0x2dca40,yamlRuleToApi:_0x2723c6,validateSegmentRule:_0x470ef6}=await import(_0x1561fa(0x201)),_0x5209c9={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5ee96e=new Map(_0x3e4b9e[_0x1561fa(0x1fc)]),_0x269afd=0x5;for(let _0x1274b2=0x0;_0x1274b2<_0x411c9f[_0x1561fa(0x1f4)];_0x1274b2+=_0x269afd){const _0x2e70eb=_0x411c9f['slice'](_0x1274b2,_0x1274b2+_0x269afd),_0x46c3ac=await Promise[_0x1561fa(0x20f)](_0x2e70eb[_0x1561fa(0x209)](async _0xba54b6=>{const _0x19ed66=_0x1561fa;if(!_0xba54b6[_0x19ed66(0x279)]&&!_0xba54b6[_0x19ed66(0x1e3)])return{'action':_0x19ed66(0x1c5),'name':_0xba54b6[_0x19ed66(0x24a)][_0x19ed66(0x26e)],'journeyId':_0xba54b6['existingJourney']?.['id']};const _0x30af03=_0xba54b6[_0x19ed66(0x1ba)]?_0x3e4b9e['folderPathToId'][_0x19ed66(0x239)](_0xba54b6[_0x19ed66(0x1ba)]):undefined;_0x10d8fc[_0x19ed66(0x228)]?.({'type':_0xba54b6[_0x19ed66(0x279)]?'journey_creating':_0x19ed66(0x1a8),'name':_0xba54b6[_0x19ed66(0x24a)]['name']});try{const _0x56a322=await executeSingleJourneyPush(_0x39c8cf,_0xba54b6,{..._0x3e4b9e,'segmentNameToId':_0x5ee96e},{'parentId':_0x157f70[_0x19ed66(0x23b)],'rootFolderId':_0x157f70[_0x19ed66(0x2a3)],'folderId':_0x30af03,'verbose':_0x157f70[_0x19ed66(0x234)]},_0x10d8fc,{'journeyDefToRequest':_0x4ed490,'activationDefToCreateRequest':_0x2dca40,'yamlRuleToApi':_0x2723c6,'validateSegmentRule':_0x470ef6});for(const [_0x25f90e,_0x5e540b]of _0x56a322['embeddedSegmentNameToId']){_0x5ee96e[_0x19ed66(0x21b)](_0x25f90e,_0x5e540b),_0x5209c9[_0x19ed66(0x26a)][_0x19ed66(0x21b)](_0x25f90e,_0x5e540b);}if(_0x56a322[_0x19ed66(0x255)]==='created')_0x10d8fc['onProgress']?.({'type':_0x19ed66(0x281),'name':_0xba54b6[_0x19ed66(0x24a)]['name'],'journeyId':_0x56a322[_0x19ed66(0x215)]}),_0x10d8fc[_0x19ed66(0x1f3)]?.(_0x19ed66(0x1c0)+_0xba54b6['yamlConfig'][_0x19ed66(0x26e)]+'\x27'),_0x5209c9[_0x19ed66(0x1e7)]++;else _0x56a322[_0x19ed66(0x255)]===_0x19ed66(0x1b5)&&(_0x10d8fc[_0x19ed66(0x228)]?.({'type':_0x19ed66(0x1c3),'name':_0xba54b6[_0x19ed66(0x24a)][_0x19ed66(0x26e)]}),_0x10d8fc[_0x19ed66(0x1f3)]?.(_0x19ed66(0x20a)+_0xba54b6[_0x19ed66(0x24a)][_0x19ed66(0x26e)]+'\x27'),_0x5209c9[_0x19ed66(0x1b5)]++);return{'action':_0x56a322[_0x19ed66(0x255)],'name':_0xba54b6[_0x19ed66(0x24a)]['name'],'journeyId':_0x56a322[_0x19ed66(0x215)]};}catch(_0x50b348){const _0x42fd14=isHttp400Error(_0x50b348),_0x1bd7fe=_0x42fd14?ErrorCode[_0x19ed66(0x258)]:ErrorCode[_0x19ed66(0x1b1)],_0x32da06=getErrorMessage(_0x50b348);throw new SDKError(_0x1bd7fe,_0x19ed66(0x230)+(_0xba54b6['isNew']?_0x19ed66(0x28b):_0x19ed66(0x26c))+_0x19ed66(0x1ff)+_0xba54b6['absolutePath']+_0x19ed66(0x225)+_0x32da06,_0x50b348);}}));_0x5209c9[_0x1561fa(0x27c)][_0x1561fa(0x1a4)](..._0x46c3ac);}return _0x5209c9;}async function matchExistingJourneySegments(_0x48d0cd,_0x29d426,_0x455e1d,_0x1944d9,_0x5d923e){const _0x86a001=a142_0x3ef9cf;if(!_0x29d426[_0x86a001(0x1f1)]||!_0x29d426[_0x86a001(0x24a)][_0x86a001(0x25b)])return;const _0x4cedb0=new Map(),_0x8c0ad4=new Set();for(const _0x1f4500 of Object[_0x86a001(0x294)](_0x29d426[_0x86a001(0x24a)]['segments'])){const _0x4bc281=generateDeterministicJourneySegmentName(_0x29d426[_0x86a001(0x24a)][_0x86a001(0x26e)],_0x1f4500);_0x4cedb0['set'](_0x4bc281,_0x1f4500),_0x8c0ad4[_0x86a001(0x218)](_0x1f4500);}const _0x2d66fa=[],_0x3dabfe=collectSegmentIdsFromJourneyApi(_0x29d426[_0x86a001(0x1f1)]);for(const _0x32bf43 of _0x3dabfe){const _0x512019=await fetchSegment(_0x48d0cd,_0x455e1d,_0x32bf43,_0x1944d9);if(!_0x512019?.[_0x86a001(0x26e)])continue;const _0x474985=_0x4cedb0['get'](_0x512019['name']);_0x474985?(_0x5d923e['set'](_0x474985,_0x32bf43),_0x8c0ad4[_0x86a001(0x1f9)](_0x474985)):_0x2d66fa[_0x86a001(0x1a4)]({'id':_0x32bf43,'seg':_0x512019});}if(_0x8c0ad4[_0x86a001(0x227)]>0x0&&_0x2d66fa[_0x86a001(0x1f4)]>0x0){const {localExpandedRuleToNames:_0x5ee4bf}=buildLocalExpandedRuleMappings(_0x29d426['yamlConfig']),_0x3158ca=new Map();for(const {id:_0x5ee772,seg:_0x1df42b}of _0x2d66fa){if(_0x1df42b[_0x86a001(0x2a2)]){const _0x366d75=apiRuleToYaml(_0x1df42b[_0x86a001(0x2a2)]);_0x3158ca[_0x86a001(0x21b)](_0x5ee772,_0x366d75);}}for(const {id:_0x3bce3c,seg:_0xf47c5f}of _0x2d66fa){if(!_0xf47c5f[_0x86a001(0x2a2)])continue;const _0x5892a1=_0x3158ca[_0x86a001(0x239)](_0x3bce3c);if(!_0x5892a1)continue;const _0x327850=serializeExpandedRule(_0x5892a1,_0x3158ca),_0xfdd2=_0x5ee4bf['get'](_0x327850);if(_0xfdd2){const _0x31a12a=_0xfdd2['find'](_0x520372=>_0x8c0ad4['has'](_0x520372));_0x31a12a&&(_0x5d923e['set'](_0x31a12a,_0x3bce3c),_0x8c0ad4[_0x86a001(0x1f9)](_0x31a12a),logger[_0x86a001(0x270)]('Matched\x20server\x20segment\x20\x27'+_0xf47c5f[_0x86a001(0x26e)]+'\x27\x20to\x20local\x20\x27'+_0x31a12a+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x2cabea,_0x26a4e7,_0x16c207,_0x3127b6,_0x5c90a6,_0x1c341a){const _0x41c72f=a142_0x3ef9cf,{journeyDefToRequest:_0x1bb1d9,activationDefToCreateRequest:_0x454e50,yamlRuleToApi:_0x4893e3,validateSegmentRule:_0x24b7c5}=_0x1c341a,_0x314f02=new Map(),_0x20f161=new Map();recoverSegmentIdsFromPushRecovery(_0x26a4e7,_0x314f02,_0x16c207[_0x41c72f(0x1fc)]);const _0xc7d9c8=new Map(),_0x24c57a=new Map(),_0x41c48e=new Map();let _0x46abb7;const _0x5bdaa1=async()=>{const _0x295e91=_0x41c72f;if(_0x46abb7)return;_0x46abb7=new Map();if(!_0x26a4e7['existingJourney'])return;const _0x58779e=await _0x2cabea[_0x295e91(0x292)][_0x295e91(0x28f)](_0x26a4e7['existingJourney']['id']);for(const _0x1763a5 of _0x58779e){const _0x484f32=journeyActivationStepToYaml(_0x1763a5,_0x16c207[_0x295e91(0x298)],_0x16c207[_0x295e91(0x1aa)]),_0x8dab28=activationSignature(_0x484f32);!_0x46abb7['has'](_0x8dab28)&&_0x46abb7['set'](_0x8dab28,_0x1763a5['id']),_0x484f32['name']&&_0x20f161['set'](_0x484f32[_0x295e91(0x26e)],_0x1763a5['id']);}};await matchExistingJourneySegments(_0x2cabea,_0x26a4e7,_0x3127b6['parentId'],_0x16c207[_0x41c72f(0x222)],_0x16c207['segmentNameToId']);const _0x331143={'resolveSegmentId':async _0x27242b=>{const _0x31e0a4=_0x41c72f,_0x5e5bb8=_0x16c207[_0x31e0a4(0x1fc)][_0x31e0a4(0x239)](_0x27242b);if(!_0x5e5bb8)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x27242b+_0x31e0a4(0x1a5)+_0x26a4e7['yamlConfig'][_0x31e0a4(0x26e)]+')');return _0x5e5bb8;},'resolveEmbeddedSegmentId':async(_0x30363c,_0x1ec0be)=>{const _0xabfca8=_0x41c72f,_0x24c569=_0x16c207['segmentNameToId'][_0xabfca8(0x239)](_0x30363c);if(_0x24c569)return _0x24c569;const _0x592181=_0x16c207[_0xabfca8(0x222)][_0xabfca8(0x1d9)](_0x46abea=>_0x46abea[_0xabfca8(0x26e)]===_0x30363c);if(_0x592181)return _0x16c207['segmentNameToId']['set'](_0x30363c,_0x592181['id']),_0x592181['id'];if(_0x26a4e7[_0xabfca8(0x279)]){const {stageName:_0x26c2f5,criteriaName:_0x5cba0f}=findSegmentCriteriaLocation(_0x26a4e7[_0xabfca8(0x24a)],_0x30363c);return _0x24b7c5(_0x30363c,_0x1ec0be[_0xabfca8(0x2a2)]),_0x24c57a[_0xabfca8(0x21b)](_0x30363c,{'definition':_0x1ec0be,'stageName':_0x26c2f5,'criteriaName':_0x5cba0f}),createPendingSegmentId(_0x30363c);}const _0x5d9804=_0x26a4e7[_0xabfca8(0x1f1)]?.['id'];if(!_0x5d9804)throw new SDKError(ErrorCode[_0xabfca8(0x23f)],_0xabfca8(0x1ee));const _0x1b1400=_0xc7d9c8[_0xabfca8(0x239)](_0x30363c);if(_0x1b1400)return _0x1b1400;const _0x43c190=((async()=>{const _0xcd0e0b=_0xabfca8;_0x24b7c5(_0x30363c,_0x1ec0be[_0xcd0e0b(0x2a2)]);const _0x202343=generateDeterministicJourneySegmentName(_0x26a4e7['yamlConfig']['name'],_0x30363c),_0x46d78c=_0x16c207[_0xcd0e0b(0x222)]['find'](_0xf6b213=>_0xf6b213[_0xcd0e0b(0x26e)]===_0x202343),_0x509757=createSegmentIdResolver(_0x16c207['segmentNameToId'],_0x30363c),_0xf1b700=await resolveRuleSegmentIds(_0x1ec0be[_0xcd0e0b(0x2a2)],_0x509757);let _0x3b09a4;return _0x46d78c?(await _0x2cabea[_0xcd0e0b(0x1c7)][_0xcd0e0b(0x200)](_0x3127b6[_0xcd0e0b(0x23b)],_0x46d78c['id'],{'description':_0x1ec0be[_0xcd0e0b(0x23e)]||_0xcd0e0b(0x1f5)+_0x30363c,'rule':_0x4893e3(_0xf1b700,!![]),'countPopulation':!![]}),_0x3b09a4=_0x46d78c['id'],saveSegmentToPushRecovery(_0x26a4e7[_0xcd0e0b(0x27a)],_0x26a4e7[_0xcd0e0b(0x24a)][_0xcd0e0b(0x26e)],_0x30363c,{'segmentId':_0x3b09a4,'uniqueServerName':_0x202343,'createdAt':new Date()[_0xcd0e0b(0x213)]()})):_0x3b09a4=await createOrRecoverEmbeddedSegment(_0x2cabea,_0x26a4e7,{'localName':_0x30363c,'uniqueSegmentName':_0x202343,'description':_0x1ec0be[_0xcd0e0b(0x23e)]||_0xcd0e0b(0x1f5)+_0x30363c,'journeyId':_0x5d9804,'resolvedRule':_0xf1b700,'parentId':_0x3127b6[_0xcd0e0b(0x23b)],'folderId':_0x3127b6[_0xcd0e0b(0x2a3)]||''},_0x4893e3),_0x16c207['segmentNameToId'][_0xcd0e0b(0x21b)](_0x30363c,_0x3b09a4),_0x314f02[_0xcd0e0b(0x21b)](_0x30363c,_0x3b09a4),_0x3b09a4;})());_0xc7d9c8['set'](_0x30363c,_0x43c190);try{return await _0x43c190;}finally{_0xc7d9c8[_0xabfca8(0x1f9)](_0x30363c);}},'resolveActivationId':async _0x1e6c4e=>{const _0x16fded=_0x41c72f,_0x517921=_0x20f161['get'](_0x1e6c4e);if(_0x517921)return _0x517921;if(_0x26a4e7[_0x16fded(0x1f1)]){await _0x5bdaa1();const _0x39817c=_0x20f161['get'](_0x1e6c4e);if(_0x39817c)return _0x39817c;}throw new SDKError(ErrorCode[_0x16fded(0x260)],_0x16fded(0x1c4)+_0x1e6c4e+'\x20(referenced\x20in\x20journey\x20'+_0x26a4e7[_0x16fded(0x24a)][_0x16fded(0x26e)]+_0x16fded(0x257)+_0x16fded(0x263));},'resolveEmbeddedActivationId':async(_0x4ec618,_0x2bde49)=>{const _0x1fe719=_0x41c72f,_0x287781=_0x20f161[_0x1fe719(0x239)](_0x4ec618);if(_0x287781)return _0x287781;if(_0x26a4e7[_0x1fe719(0x279)])return _0x41c48e[_0x1fe719(0x21b)](_0x4ec618,_0x2bde49),createPendingActivationId(_0x4ec618);if(_0x26a4e7['existingJourney']){await _0x5bdaa1();const _0x34f922=_0x20f161[_0x1fe719(0x239)](_0x2bde49['name']);if(_0x34f922)return _0x20f161[_0x1fe719(0x21b)](_0x4ec618,_0x34f922),_0x34f922;const _0x47513d=activationSignature(_0x2bde49),_0x3b3246=_0x46abb7?.[_0x1fe719(0x239)](_0x47513d);if(_0x3b3246)return _0x20f161[_0x1fe719(0x21b)](_0x4ec618,_0x3b3246),_0x3b3246;const _0x374d7b=await _0x454e50(_0x2bde49,_0x16c207[_0x1fe719(0x28d)]),_0x5615da={..._0x374d7b,..._0x2bde49[_0x1fe719(0x297)]!==undefined&&{'runAfterJourneyRefresh':_0x2bde49[_0x1fe719(0x297)]}},_0x2ad5da=await _0x2cabea[_0x1fe719(0x292)][_0x1fe719(0x29b)](_0x26a4e7[_0x1fe719(0x1f1)]['id'],_0x5615da);return _0x20f161[_0x1fe719(0x21b)](_0x4ec618,_0x2ad5da['id']),_0x2ad5da['id'];}throw new SDKError(ErrorCode[_0x1fe719(0x23f)],_0x1fe719(0x27d));},'resolveJourneyId':async _0x5ee2df=>{const _0x5cd087=_0x41c72f;try{return await _0x2cabea[_0x5cd087(0x292)]['resolveJourneyId'](_0x3127b6[_0x5cd087(0x23b)],_0x5ee2df);}catch(_0x443ca2){throw new SDKError(ErrorCode['NOT_FOUND'],_0x5cd087(0x23d)+_0x5ee2df+_0x5cd087(0x247)+_0x26a4e7[_0x5cd087(0x24a)][_0x5cd087(0x26e)]+'\x27)',_0x443ca2);}},'resolveStageId':async(_0x198bf1,_0x3a13e1)=>{const _0x2b7e37=_0x41c72f,_0x2cebf4=await _0x2cabea[_0x2b7e37(0x292)][_0x2b7e37(0x1e8)](_0x198bf1),_0x3d4f89=_0x2cebf4[_0x2b7e37(0x1fe)][_0x2b7e37(0x21f)][_0x2b7e37(0x1d9)](_0x46d7db=>_0x46d7db[_0x2b7e37(0x26e)][_0x2b7e37(0x24b)]()===_0x3a13e1[_0x2b7e37(0x24b)]());if(!_0x3d4f89?.['id'])throw new SDKError(ErrorCode[_0x2b7e37(0x260)],_0x2b7e37(0x1c8)+_0x3a13e1+_0x2b7e37(0x1ef)+(_0x2cebf4[_0x2b7e37(0x1fe)][_0x2b7e37(0x1b8)]||_0x2cebf4[_0x2b7e37(0x1fe)][_0x2b7e37(0x26e)])+'\x27');return _0x3d4f89['id'];}},_0x2b3b34=await _0x1bb1d9(_0x26a4e7[_0x41c72f(0x24a)],_0x3127b6[_0x41c72f(0x23b)],_0x331143),_0x21a3d0=_0x3127b6[_0x41c72f(0x25e)]||_0x3127b6[_0x41c72f(0x2a3)];_0x21a3d0&&(_0x2b3b34[_0x41c72f(0x1f6)]={'parentFolder':{'data':{'id':_0x21a3d0,'type':_0x41c72f(0x284)}}});if(_0x26a4e7['isNew']){if(_0x24c57a[_0x41c72f(0x227)]>0x0||_0x41c48e[_0x41c72f(0x227)]>0x0)return await executeThreeStepJourneyCreate(_0x2cabea,_0x26a4e7,_0x2b3b34,{'pendingEmbeddedSegments':_0x24c57a,'pendingEmbeddedActivations':_0x41c48e,'embeddedSegmentNameToId':_0x314f02,'journeyActivationNameToId':_0x20f161},{..._0x3127b6,'effectiveFolderId':_0x21a3d0},_0x16c207,_0x5c90a6,_0x1c341a);else{ensureJourneyDefaults(_0x2b3b34[_0x41c72f(0x1fe)]);const _0x564046=await _0x2cabea[_0x41c72f(0x292)]['create'](_0x2b3b34);return deletePushRecovery(_0x26a4e7['absolutePath']),{'action':'created','journeyId':_0x564046['id'],'embeddedSegmentNameToId':_0x314f02};}}else{if(_0x26a4e7[_0x41c72f(0x1e3)]&&_0x26a4e7['existingJourney']){_0x2b3b34['id']=_0x26a4e7['existingJourney']['id'];const _0x1b6571=_0x2b3b34[_0x41c72f(0x1fe)];_0x26a4e7[_0x41c72f(0x1f1)][_0x41c72f(0x1fe)]?.['journeyBundleName']&&(_0x1b6571[_0x41c72f(0x1b8)]=_0x26a4e7['existingJourney'][_0x41c72f(0x1fe)][_0x41c72f(0x1b8)]);const _0x2cfb2b=_0x26a4e7['existingJourney'][_0x41c72f(0x1fe)]?.['journeyStages'];return _0x2cfb2b&&_0x2b3b34[_0x41c72f(0x1fe)][_0x41c72f(0x21f)]&&injectExistingStageIds(_0x2b3b34['attributes'][_0x41c72f(0x21f)],_0x2cfb2b),ensureJourneyDefaults(_0x1b6571),await _0x2cabea['journey']['update'](_0x26a4e7[_0x41c72f(0x1f1)]['id'],_0x2b3b34),deletePushRecovery(_0x26a4e7['absolutePath']),{'action':_0x41c72f(0x1b5),'journeyId':_0x26a4e7[_0x41c72f(0x1f1)]['id'],'embeddedSegmentNameToId':_0x314f02};}}return deletePushRecovery(_0x26a4e7[_0x41c72f(0x27a)]),{'action':_0x41c72f(0x1c5),'journeyId':_0x26a4e7[_0x41c72f(0x1f1)]?.['id'],'embeddedSegmentNameToId':_0x314f02};}function findSegmentCriteriaLocation(_0x8e14f8,_0x4d815){const _0x1b6966=a142_0x3ef9cf,_0x4eb3b1=_0x8e14f8['stages']||_0x8e14f8[_0x1b6966(0x2a6)]?.[0x0]?.[_0x1b6966(0x1fd)]||[];let _0x2dfdc8=_0x1b6966(0x24e),_0x94c08f=_0x4d815;const _0x33350a=_0x8e14f8[_0x1b6966(0x269)]||_0x8e14f8[_0x1b6966(0x2a6)]?.[0x0]?.['goal'];if(_0x33350a?.[_0x1b6966(0x1c7)]===_0x4d815)return{'stageName':_0x1b6966(0x269),'criteriaName':_0x33350a[_0x1b6966(0x26e)]||_0x4d815};_0x28eae6:for(const _0x5c06d5 of _0x4eb3b1){if(_0x5c06d5[_0x1b6966(0x28e)]?.[_0x1b6966(0x1c7)]===_0x4d815){_0x2dfdc8=_0x5c06d5[_0x1b6966(0x26e)],_0x94c08f=_0x5c06d5['entry_criteria'][_0x1b6966(0x26e)]||_0x4d815;break;}if(_0x5c06d5[_0x1b6966(0x1a6)])for(const _0x22eef7 of _0x5c06d5['steps']){if(_0x22eef7[_0x1b6966(0x21a)]==='decision_point'&&_0x22eef7[_0x1b6966(0x1c6)]?.[_0x1b6966(0x245)])for(const _0x46c1e5 of _0x22eef7[_0x1b6966(0x1c6)][_0x1b6966(0x245)]){if(_0x46c1e5['segment']===_0x4d815){_0x2dfdc8=_0x5c06d5['name'],_0x94c08f=_0x46c1e5['name']||_0x4d815;break _0x28eae6;}}}}return{'stageName':_0x2dfdc8,'criteriaName':_0x94c08f};}async function executeThreeStepJourneyCreate(_0x1f968d,_0x16419c,_0x2db39b,_0x45ecc5,_0x350a61,_0x1d7529,_0x3598cf,_0x3c4ece){const _0x8d9cc1=a142_0x3ef9cf,{activationDefToCreateRequest:_0x471e03,yamlRuleToApi:_0x336715}=_0x3c4ece,{pendingEmbeddedSegments:_0xc2fb0d,pendingEmbeddedActivations:_0x1ab618,embeddedSegmentNameToId:_0x34af2c}=_0x45ecc5,_0x1c5b81=JSON[_0x8d9cc1(0x1dc)](JSON['stringify'](_0x2db39b));ensureJourneyDefaults(_0x1c5b81[_0x8d9cc1(0x1fe)]),stripPendingIds(_0x1c5b81);const _0x4c4ba7=await _0x1f968d[_0x8d9cc1(0x292)][_0x8d9cc1(0x28b)](_0x1c5b81),_0x33abf7=_0x4c4ba7['id'],_0x3286e4=new Map();for(const _0x4a73ce of _0x4c4ba7[_0x8d9cc1(0x1fe)][_0x8d9cc1(0x21f)]){_0x3286e4[_0x8d9cc1(0x21b)](_0x4a73ce['name'][_0x8d9cc1(0x24b)](),_0x4a73ce['id']);}recoverSegmentIdsFromPushRecovery(_0x16419c,_0x34af2c,_0x1d7529[_0x8d9cc1(0x1fc)]);for(const [_0x22dbaa,{definition:_0x253027}]of _0xc2fb0d){if(_0x34af2c[_0x8d9cc1(0x1d5)](_0x22dbaa)){_0x3598cf[_0x8d9cc1(0x228)]?.({'type':_0x8d9cc1(0x1e5),'journeyName':_0x16419c[_0x8d9cc1(0x24a)][_0x8d9cc1(0x26e)],'segmentName':_0x22dbaa});continue;}const _0x199a39=generateDeterministicJourneySegmentName(_0x16419c[_0x8d9cc1(0x24a)][_0x8d9cc1(0x26e)],_0x22dbaa);_0x3598cf[_0x8d9cc1(0x228)]?.({'type':'embedded_segment_creating','journeyName':_0x16419c['yamlConfig'][_0x8d9cc1(0x26e)],'segmentName':_0x22dbaa});const _0x3e7307=createSegmentIdResolver(_0x1d7529['segmentNameToId'],_0x22dbaa),_0x3c4098=await resolveRuleSegmentIds(_0x253027[_0x8d9cc1(0x2a2)],_0x3e7307),_0x4f784c=await createOrRecoverEmbeddedSegment(_0x1f968d,_0x16419c,{'localName':_0x22dbaa,'uniqueSegmentName':_0x199a39,'description':_0x253027[_0x8d9cc1(0x23e)]||_0x8d9cc1(0x1f5)+_0x22dbaa,'journeyId':_0x33abf7,'resolvedRule':_0x3c4098,'parentId':_0x350a61['parentId'],'folderId':_0x350a61['effectiveFolderId']||''},_0x336715);_0x34af2c[_0x8d9cc1(0x21b)](_0x22dbaa,_0x4f784c),_0x1d7529[_0x8d9cc1(0x1fc)][_0x8d9cc1(0x21b)](_0x22dbaa,_0x4f784c),_0x3598cf[_0x8d9cc1(0x228)]?.({'type':'embedded_segment_created','journeyName':_0x16419c[_0x8d9cc1(0x24a)][_0x8d9cc1(0x26e)],'segmentName':_0x22dbaa});}const _0x3221f4=new Map();for(const [_0x222694,_0x32302b]of _0x1ab618){_0x3598cf[_0x8d9cc1(0x228)]?.({'type':_0x8d9cc1(0x1ae),'journeyName':_0x16419c['yamlConfig'][_0x8d9cc1(0x26e)],'activationName':_0x222694});const _0x465c69=await _0x471e03(_0x32302b,_0x1d7529[_0x8d9cc1(0x28d)]),_0x38ed47={..._0x465c69,..._0x32302b[_0x8d9cc1(0x297)]!==undefined&&{'runAfterJourneyRefresh':_0x32302b['run_after_journey_refresh']}},_0x44be69=await _0x1f968d[_0x8d9cc1(0x292)][_0x8d9cc1(0x29b)](_0x33abf7,_0x38ed47);_0x3221f4[_0x8d9cc1(0x21b)](_0x222694,_0x44be69['id']),_0x45ecc5[_0x8d9cc1(0x1bf)]['set'](_0x222694,_0x44be69['id']),_0x3598cf[_0x8d9cc1(0x228)]?.({'type':_0x8d9cc1(0x1be),'journeyName':_0x16419c[_0x8d9cc1(0x24a)]['name'],'activationName':_0x222694});}const _0x590b19=JSON[_0x8d9cc1(0x1dc)](JSON[_0x8d9cc1(0x216)](_0x2db39b));return _0x590b19['id']=_0x33abf7,ensureJourneyDefaults(_0x590b19[_0x8d9cc1(0x1fe)]),resolvePendingIdsInRequest(_0x590b19,_0x2db39b,_0x3286e4,_0x34af2c,_0x3221f4,_0x3598cf),await _0x1f968d[_0x8d9cc1(0x292)][_0x8d9cc1(0x26c)](_0x33abf7,_0x590b19),deletePushRecovery(_0x16419c['absolutePath']),{'action':'created','journeyId':_0x33abf7,'embeddedSegmentNameToId':_0x34af2c};}export function stripWaitStepPendingIds(_0x225598){const _0x450c5d=a142_0x3ef9cf,_0x1b3b6a=_0x225598['conditionSegmentId']&&isPendingSegmentId(_0x225598[_0x450c5d(0x29a)]),_0x38c9ba=_0x225598[_0x450c5d(0x282)]?.[_0x450c5d(0x243)](_0x502d2e=>_0x502d2e[_0x450c5d(0x221)]&&isPendingSegmentId(_0x502d2e[_0x450c5d(0x221)]));(_0x1b3b6a||_0x38c9ba)&&(_0x225598[_0x450c5d(0x262)]='Duration',_0x225598[_0x450c5d(0x22e)]=0x1,_0x225598['waitStepUnit']=_0x450c5d(0x208),delete _0x225598[_0x450c5d(0x29a)],delete _0x225598[_0x450c5d(0x211)],delete _0x225598[_0x450c5d(0x1c2)],delete _0x225598[_0x450c5d(0x282)]);}export function resolveWaitStepPendingIds(_0x78135e,_0x11c531,_0x383f7f,_0xe1b83a){const _0x5e9149=a142_0x3ef9cf;if(_0x11c531[_0x5e9149(0x29a)]&&isPendingSegmentId(_0x11c531[_0x5e9149(0x29a)])){const _0x158253=_0x383f7f(_0x11c531[_0x5e9149(0x29a)],_0x5e9149(0x20c)+_0xe1b83a+_0x5e9149(0x264));_0x158253&&(_0x78135e[_0x5e9149(0x262)]='Condition',_0x78135e[_0x5e9149(0x29a)]=_0x158253,delete _0x78135e[_0x5e9149(0x22e)],delete _0x78135e[_0x5e9149(0x2a7)],_0x11c531[_0x5e9149(0x211)]!==undefined&&(_0x78135e[_0x5e9149(0x211)]=_0x11c531[_0x5e9149(0x211)]),_0x11c531[_0x5e9149(0x1c2)]&&(_0x78135e['conditionTimeoutUnit']=_0x11c531[_0x5e9149(0x1c2)]));}if(_0x11c531[_0x5e9149(0x282)]){const _0x3515ff=_0x11c531[_0x5e9149(0x282)]['some'](_0x27aa4f=>_0x27aa4f[_0x5e9149(0x221)]&&isPendingSegmentId(_0x27aa4f['segmentId']));if(_0x3515ff){const _0x4461d8=_0x11c531[_0x5e9149(0x282)][_0x5e9149(0x209)](_0x44b248=>{const _0x48abaf=_0x5e9149;if(_0x44b248['segmentId']&&isPendingSegmentId(_0x44b248[_0x48abaf(0x221)])){const _0x258c92=_0x383f7f(_0x44b248[_0x48abaf(0x221)],'stage\x20\x27'+_0xe1b83a+_0x48abaf(0x264));return{..._0x44b248,'segmentId':_0x258c92||_0x44b248[_0x48abaf(0x221)]};}return{..._0x44b248};});_0x78135e[_0x5e9149(0x262)]='Condition',_0x78135e[_0x5e9149(0x282)]=_0x4461d8,delete _0x78135e[_0x5e9149(0x22e)],delete _0x78135e['waitStepUnit'],delete _0x78135e[_0x5e9149(0x29a)],delete _0x78135e[_0x5e9149(0x211)],delete _0x78135e[_0x5e9149(0x1c2)];}}}function stripPendingIds(_0x4a925c){const _0x582a94=a142_0x3ef9cf;_0x4a925c['attributes']['goal']?.[_0x582a94(0x221)]&&isPendingSegmentId(_0x4a925c[_0x582a94(0x1fe)][_0x582a94(0x269)][_0x582a94(0x221)])&&delete _0x4a925c[_0x582a94(0x1fe)][_0x582a94(0x269)];for(const _0x19ae9f of _0x4a925c['attributes'][_0x582a94(0x21f)]||[]){_0x19ae9f['entryCriteria']?.[_0x582a94(0x221)]&&isPendingSegmentId(_0x19ae9f['entryCriteria'][_0x582a94(0x221)])&&delete _0x19ae9f[_0x582a94(0x20e)];_0x19ae9f[_0x582a94(0x236)]?.[_0x582a94(0x221)]&&isPendingSegmentId(_0x19ae9f['milestone']['segmentId'])&&delete _0x19ae9f[_0x582a94(0x236)];_0x19ae9f['exitCriterias']&&(_0x19ae9f[_0x582a94(0x1ad)]=_0x19ae9f[_0x582a94(0x1ad)][_0x582a94(0x29e)](_0x461d66=>!_0x461d66['segmentId']||!isPendingSegmentId(_0x461d66[_0x582a94(0x221)])));if(_0x19ae9f[_0x582a94(0x1a6)])for(const _0x4405e0 of Object[_0x582a94(0x294)](_0x19ae9f['steps'])){const _0x594ea1=_0x19ae9f[_0x582a94(0x1a6)][_0x4405e0];_0x594ea1[_0x582a94(0x21a)]==='Activation'&&_0x594ea1[_0x582a94(0x20d)]&&isPendingActivationId(_0x594ea1[_0x582a94(0x20d)])&&(_0x594ea1[_0x582a94(0x20d)]='');if(_0x594ea1[_0x582a94(0x21a)]==='DecisionPoint'&&_0x594ea1['branches'])for(const _0x11cb78 of _0x594ea1[_0x582a94(0x245)]){_0x11cb78[_0x582a94(0x221)]&&isPendingSegmentId(_0x11cb78[_0x582a94(0x221)])&&(_0x11cb78[_0x582a94(0x221)]='');}_0x594ea1['type']===_0x582a94(0x276)&&stripWaitStepPendingIds(_0x594ea1);}}}function resolvePendingIdsInRequest(_0x28a5b7,_0x510f82,_0x50325b,_0x49a709,_0x317a4c,_0x2ba210){const _0x3fc064=a142_0x3ef9cf,_0x13f962=(_0x521d79,_0x530d60)=>{const _0x2156b8=a142_0x3bff;if(!isPendingSegmentId(_0x521d79))return _0x521d79;const _0x4e683a=extractPendingSegmentName(_0x521d79),_0x3313db=_0x49a709['get'](_0x4e683a);return!_0x3313db&&_0x2ba210['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x4e683a+_0x2156b8(0x206)+_0x530d60),_0x3313db;};if(_0x28a5b7['attributes'][_0x3fc064(0x269)]?.['segmentId']&&isPendingSegmentId(_0x28a5b7[_0x3fc064(0x1fe)]['goal']['segmentId'])){const _0x2e6ab0=_0x13f962(_0x28a5b7[_0x3fc064(0x1fe)]['goal'][_0x3fc064(0x221)],'goal\x20criteria');_0x2e6ab0&&(_0x28a5b7[_0x3fc064(0x1fe)][_0x3fc064(0x269)][_0x3fc064(0x221)]=_0x2e6ab0);}for(const _0x5bd20f of _0x28a5b7[_0x3fc064(0x1fe)][_0x3fc064(0x21f)]||[]){const _0x3d0baf=_0x50325b[_0x3fc064(0x239)](_0x5bd20f[_0x3fc064(0x26e)]['toLowerCase']());_0x3d0baf&&(_0x5bd20f['id']=_0x3d0baf);if(_0x5bd20f['entryCriteria']?.[_0x3fc064(0x221)]&&isPendingSegmentId(_0x5bd20f[_0x3fc064(0x20e)]['segmentId'])){const _0x13b3a9=_0x13f962(_0x5bd20f['entryCriteria'][_0x3fc064(0x221)],'stage\x20\x27'+_0x5bd20f[_0x3fc064(0x26e)]+'\x27\x20entry\x20criteria');_0x13b3a9&&(_0x5bd20f['entryCriteria'][_0x3fc064(0x221)]=_0x13b3a9);}if(_0x5bd20f[_0x3fc064(0x1ad)])for(const _0x55f958 of _0x5bd20f[_0x3fc064(0x1ad)]){if(_0x55f958['segmentId']&&isPendingSegmentId(_0x55f958['segmentId'])){const _0x12318b=_0x13f962(_0x55f958['segmentId'],'stage\x20\x27'+_0x5bd20f['name']+_0x3fc064(0x24f));_0x12318b&&(_0x55f958[_0x3fc064(0x221)]=_0x12318b);}}if(_0x5bd20f[_0x3fc064(0x236)]?.[_0x3fc064(0x221)]&&isPendingSegmentId(_0x5bd20f[_0x3fc064(0x236)]['segmentId'])){const _0x4a8dfb=_0x13f962(_0x5bd20f[_0x3fc064(0x236)][_0x3fc064(0x221)],_0x3fc064(0x20c)+_0x5bd20f[_0x3fc064(0x26e)]+'\x27\x20milestone');_0x4a8dfb&&(_0x5bd20f['milestone'][_0x3fc064(0x221)]=_0x4a8dfb);}if(_0x5bd20f['steps']){const _0x215284=_0x13dcf7=>_0x510f82[_0x3fc064(0x1fe)][_0x3fc064(0x21f)]?.[_0x3fc064(0x1d9)](_0x3c8b48=>_0x3c8b48[_0x3fc064(0x26e)][_0x3fc064(0x24b)]()===_0x5bd20f[_0x3fc064(0x26e)]['toLowerCase']())?.[_0x3fc064(0x1a6)]?.[_0x13dcf7];for(const _0x561bee of Object[_0x3fc064(0x294)](_0x5bd20f['steps'])){const _0xf81985=_0x5bd20f[_0x3fc064(0x1a6)][_0x561bee],_0x1c5022=_0x215284(_0x561bee);if(_0xf81985[_0x3fc064(0x21a)]===_0x3fc064(0x1e9)&&_0xf81985[_0x3fc064(0x20d)]&&(isPendingActivationId(_0xf81985['journeyActivationStepId'])||_0xf81985[_0x3fc064(0x20d)]==='')){if(_0x1c5022?.['journeyActivationStepId']&&isPendingActivationId(_0x1c5022['journeyActivationStepId'])){const _0x3a6a60=extractPendingActivationName(_0x1c5022['journeyActivationStepId']),_0x451da7=_0x317a4c[_0x3fc064(0x239)](_0x3a6a60);_0x451da7&&(_0xf81985[_0x3fc064(0x20d)]=_0x451da7);}}if(_0xf81985['type']===_0x3fc064(0x26b)&&_0xf81985['branches']&&_0x1c5022?.[_0x3fc064(0x245)])for(let _0x5170b7=0x0;_0x5170b7<_0xf81985['branches'][_0x3fc064(0x1f4)];_0x5170b7++){const _0x52e6f5=_0xf81985[_0x3fc064(0x245)][_0x5170b7],_0x10e105=_0x1c5022[_0x3fc064(0x245)][_0x5170b7];if(_0x10e105?.['segmentId']&&isPendingSegmentId(_0x10e105['segmentId'])){const _0x1db6a0=_0x13f962(_0x10e105[_0x3fc064(0x221)],'stage\x20\x27'+_0x5bd20f[_0x3fc064(0x26e)]+_0x3fc064(0x21c)+(_0x52e6f5[_0x3fc064(0x26e)]||_0x5170b7)+'\x27');_0x1db6a0&&(_0x52e6f5[_0x3fc064(0x221)]=_0x1db6a0);}}_0xf81985[_0x3fc064(0x21a)]===_0x3fc064(0x276)&&_0x1c5022?.[_0x3fc064(0x21a)]===_0x3fc064(0x276)&&resolveWaitStepPendingIds(_0xf81985,_0x1c5022,_0x13f962,_0x5bd20f[_0x3fc064(0x26e)]);}}}}
|
|
1
|
+
const a142_0x469651=a142_0x3aac;(function(_0x53595a,_0x4fe9bd){const _0x4e0a4e=a142_0x3aac,_0xb5a311=_0x53595a();while(!![]){try{const _0x39b7dc=-parseInt(_0x4e0a4e(0x1df))/0x1+parseInt(_0x4e0a4e(0x173))/0x2+-parseInt(_0x4e0a4e(0x1fe))/0x3+parseInt(_0x4e0a4e(0x114))/0x4*(parseInt(_0x4e0a4e(0x199))/0x5)+parseInt(_0x4e0a4e(0x202))/0x6*(parseInt(_0x4e0a4e(0x1a4))/0x7)+parseInt(_0x4e0a4e(0x129))/0x8*(-parseInt(_0x4e0a4e(0x1b7))/0x9)+-parseInt(_0x4e0a4e(0x12f))/0xa*(-parseInt(_0x4e0a4e(0x11a))/0xb);if(_0x39b7dc===_0x4fe9bd)break;else _0xb5a311['push'](_0xb5a311['shift']());}catch(_0x4041d1){_0xb5a311['push'](_0xb5a311['shift']());}}}(a142_0x5e0e,0x6534c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x469651(0x146));export const PENDING_SEGMENT_PREFIX=a142_0x469651(0x124);export const PENDING_ACTIVATION_PREFIX=a142_0x469651(0x12a);export function createPendingSegmentId(_0x2d1baa){return''+PENDING_SEGMENT_PREFIX+_0x2d1baa+'__';}export function isPendingSegmentId(_0x99468){const _0x1470a2=a142_0x469651;return _0x99468[_0x1470a2(0x1b4)](PENDING_SEGMENT_PREFIX)&&!_0x99468[_0x1470a2(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x457c7e){const _0x3140cc=a142_0x469651;return _0x457c7e[_0x3140cc(0x12c)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xbff275){return''+PENDING_ACTIVATION_PREFIX+_0xbff275+'__';}export function isPendingActivationId(_0x4299ce){const _0xd4ec53=a142_0x469651;return _0x4299ce[_0xd4ec53(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x55149c){return _0x55149c['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x9cb6fc,_0x526ada){const _0x526705=a142_0x469651,_0x4aa2f7=_0x9cb6fc+'::'+(_0x526ada['trim']()||'segment'),_0x2c6838=createHash(_0x526705(0x13d))['update'](_0x4aa2f7)[_0x526705(0x1a8)](_0x526705(0x156))['slice'](0x0,0xc);return _0x526705(0x145)+_0x2c6838;}export function ensureJourneyDefaults(_0x52250c){const _0x3435be=a142_0x469651;!_0x52250c[_0x3435be(0x1dc)]&&(_0x52250c[_0x3435be(0x1dc)]=''),!_0x52250c[_0x3435be(0x1f7)]&&(_0x52250c[_0x3435be(0x1f7)]='draft');}export function injectExistingStageIds(_0x87730a,_0x4c119f){const _0x4513d2=a142_0x469651,_0x522e90=new Map(_0x4c119f['map'](_0x401e62=>[_0x401e62['name'],_0x401e62['id']]));for(const _0x24dfec of _0x87730a){if(!_0x24dfec['id']){const _0x5a251b=_0x522e90[_0x4513d2(0x15d)](_0x24dfec[_0x4513d2(0x169)]);_0x5a251b&&(_0x24dfec['id']=_0x5a251b);}}}export function resolveTDFolderPath(_0x201672,_0x4e6d0f,_0x54b0a0){const _0x6e57a4=a142_0x469651;if(!_0x4e6d0f)return _0x201672;if(_0x201672===_0x54b0a0||_0x201672[_0x6e57a4(0x1b4)](_0x54b0a0+'/'))return _0x201672;return _0x201672?_0x54b0a0+'/'+_0x201672:_0x54b0a0;}export function addFoldersToCreate(_0xa103c1,_0x421e89,_0x13cb67){const _0x5439e7=a142_0x469651;if(!_0xa103c1)return;if(_0x421e89[_0x5439e7(0x1b3)](_0xa103c1))return;const _0x3292c7=_0xa103c1['split']('/');let _0x2676cd='';for(const _0x4243fe of _0x3292c7){_0x2676cd=_0x2676cd?_0x2676cd+'/'+_0x4243fe:_0x4243fe,!_0x421e89[_0x5439e7(0x1b3)](_0x2676cd)&&_0x13cb67[_0x5439e7(0x1f4)](_0x2676cd);}}export function sortFoldersByDepth(_0x5a77fc){const _0x23bcdf=a142_0x469651;return[..._0x5a77fc][_0x23bcdf(0x113)]((_0x4601ab,_0x576c21)=>{const _0x277e8d=_0x23bcdf,_0x473a42=(_0x4601ab[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)],_0xe81cdd=(_0x576c21[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)];return _0x473a42-_0xe81cdd;});}import*as a142_0x324021 from'yaml';import{readFileSync}from'fs';import a142_0x2c8ea3 from'path';import{isJourneyDef,parseYamlString as a142_0x505a2c,toYamlString as a142_0x334139,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(_0x1e8ec7){const _0x31f81a=a142_0x469651;if(Array[_0x31f81a(0x18f)](_0x1e8ec7))return'['+_0x1e8ec7['map'](_0xb831da=>stableStringify(_0xb831da))['join'](',')+']';if(_0x1e8ec7&&typeof _0x1e8ec7==='object'){const _0x2ddb71=_0x1e8ec7,_0x4c95e8=Object[_0x31f81a(0x11f)](_0x2ddb71)[_0x31f81a(0x113)](),_0x1b85dd=_0x4c95e8[_0x31f81a(0x1a9)](_0x58f209=>'\x22'+_0x58f209+'\x22:'+stableStringify(_0x2ddb71[_0x58f209]));return'{'+_0x1b85dd[_0x31f81a(0x1c0)](',')+'}';}const _0x4a1151=JSON[_0x31f81a(0x11b)](_0x1e8ec7);return _0x4a1151===undefined?_0x31f81a(0x1b5):_0x4a1151;}function activationSignature(_0x3b51a0){const _0x35acec=a142_0x469651,_0x135c79={'connection':_0x3b51a0[_0x35acec(0x120)],..._0x3b51a0[_0x35acec(0x134)]!==undefined&&{'all_columns':_0x3b51a0['all_columns']},..._0x3b51a0[_0x35acec(0x203)]!==undefined&&{'columns':_0x3b51a0['columns']},..._0x3b51a0[_0x35acec(0x192)]!==undefined&&{'behavior':_0x3b51a0[_0x35acec(0x192)]},..._0x3b51a0[_0x35acec(0x1ee)]!==undefined&&{'schedule':_0x3b51a0[_0x35acec(0x1ee)]},..._0x3b51a0[_0x35acec(0x161)]!==undefined&&{'notification':_0x3b51a0[_0x35acec(0x161)]},..._0x3b51a0[_0x35acec(0x16d)]!==undefined&&{'connector_config':_0x3b51a0[_0x35acec(0x16d)]},..._0x3b51a0[_0x35acec(0x153)]!==undefined&&{'activation_template_id':_0x3b51a0[_0x35acec(0x153)]}};return stableStringify(_0x135c79);}async function fetchSegment(_0x2ad254,_0x493897,_0x4a8295,_0x15de74){const _0x53cdcc=a142_0x469651,_0x2a7a5a=_0x15de74?.[_0x53cdcc(0x13c)](_0x211e00=>_0x211e00['id']===_0x4a8295);if(_0x2a7a5a)return _0x2a7a5a;try{return await _0x2ad254[_0x53cdcc(0x1c9)]['getSegment'](_0x493897,_0x4a8295);}catch(_0x2cfcc7){logger[_0x53cdcc(0x140)]('getSegment\x20failed\x20for\x20'+_0x4a8295+_0x53cdcc(0x20a)+_0x2cfcc7);try{return await _0x2ad254['segment'][_0x53cdcc(0x11e)](_0x4a8295);}catch(_0x40890e){return logger[_0x53cdcc(0x140)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x4a8295+':\x20'+_0x40890e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x46b289,_0x5121f5,_0x3d4d7c){const _0x2359a5=a142_0x469651,_0x4e13b9=readPushRecovery(_0x46b289[_0x2359a5(0x135)]);if(_0x4e13b9?.['journeyName']===_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)])for(const [_0x47aa4c,_0x37297d]of Object[_0x2359a5(0x188)](_0x4e13b9[_0x2359a5(0x208)])){const _0x532e45=generateDeterministicJourneySegmentName(_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)],_0x47aa4c);_0x37297d[_0x2359a5(0x1de)]===_0x532e45&&(_0x5121f5['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]),_0x3d4d7c['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]));}}async function createOrRecoverEmbeddedSegment(_0xf58401,_0x538207,_0x5cb579,_0xbc80db){const _0x4d9aa8=a142_0x469651;let _0x3078b8;try{_0x3078b8=await _0xf58401[_0x4d9aa8(0x1c9)][_0x4d9aa8(0x159)]({'name':_0x5cb579[_0x4d9aa8(0x16c)],'description':_0x5cb579['description'],'journeyId':_0x5cb579[_0x4d9aa8(0x175)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![],'parentFolderId':_0x5cb579[_0x4d9aa8(0x11d)],'audienceId':_0x5cb579['parentId']});}catch(_0x37e0e7){const _0x4ee024=_0x37e0e7 instanceof Error&&_0x37e0e7[_0x4d9aa8(0x1e1)][_0x4d9aa8(0x171)](_0x4d9aa8(0x1b6));if(_0x4ee024){const _0x4bdd4f=readPushRecovery(_0x538207[_0x4d9aa8(0x135)]),_0xb80682=_0x4bdd4f?.[_0x4d9aa8(0x1bc)]===_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)]?_0x4bdd4f['segments'][_0x5cb579[_0x4d9aa8(0x1e2)]]:undefined;if(_0xb80682?.['uniqueServerName']===_0x5cb579[_0x4d9aa8(0x16c)])await _0xf58401['segment'][_0x4d9aa8(0x142)](_0x5cb579[_0x4d9aa8(0x1e9)],_0xb80682[_0x4d9aa8(0x207)],{'description':_0x5cb579[_0x4d9aa8(0x1dc)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![]}),_0x3078b8=_0xb80682[_0x4d9aa8(0x207)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d9aa8(0x182)+_0x5cb579[_0x4d9aa8(0x1e2)]+_0x4d9aa8(0x14a)+(_0x4d9aa8(0x215)+_0x538207['absolutePath']['replace'](/([^/]+)$/,_0x4d9aa8(0x1e6))+')\x20')+_0x4d9aa8(0x138),_0x37e0e7);}else throw _0x37e0e7;}return saveSegmentToPushRecovery(_0x538207['absolutePath'],_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)],_0x5cb579[_0x4d9aa8(0x1e2)],{'segmentId':_0x3078b8,'uniqueServerName':_0x5cb579[_0x4d9aa8(0x16c)],'createdAt':new Date()[_0x4d9aa8(0x1cc)]()}),_0x3078b8;}export async function prepareSegmentFiles(_0x2d8bd4,_0x45294d,_0x5c0f99,_0x165bce,_0x3b66ef){const _0x452590=a142_0x469651,{activationDefToCreateRequest:_0x5013ce}=await import('./child-segment-yaml.js'),_0x4ee814=[],_0x1254dd=new Set();for(const {yamlConfig:_0x22a55b,folderPath:_0x22ebde,sourcePath:_0x433a7b}of _0x2d8bd4){const _0x4bc02b=resolveTDFolderPath(_0x22ebde,_0x165bce,_0x3b66ef),_0x58a46c=_0x4bc02b+':'+_0x22a55b[_0x452590(0x169)],_0x471731=_0x45294d['segmentByFolderAndName']['get'](_0x58a46c),_0x4c7d1c=_0x471731?_0x45294d[_0x452590(0x1fd)][_0x452590(0x15d)](_0x471731['id'])||[]:[];addFoldersToCreate(_0x4bc02b,_0x45294d[_0x452590(0x168)],_0x1254dd);const _0x5c3994=calculateActivationActions(_0x22a55b[_0x452590(0x116)]||[],_0x4c7d1c,_0x45294d[_0x452590(0x12e)],_0x45294d['connectionIdToNameMap']);for(const _0x585941 of _0x5c3994){(_0x585941[_0x452590(0x17d)]===_0x452590(0x1be)||_0x585941['type']===_0x452590(0x1c7))&&_0x585941[_0x452590(0x1d9)]&&(_0x585941[_0x452590(0x128)]=await _0x5013ce(_0x585941[_0x452590(0x1d9)],_0x5c0f99));}const _0x90ac8=calculateSegmentDiff(_0x22a55b,_0x471731,_0x4c7d1c,_0x45294d['idToEmailMap'],_0x45294d['connectionIdToNameMap']);_0x4ee814[_0x452590(0x1cf)]({'relativePath':_0x22a55b['name'],'absolutePath':_0x433a7b,'yamlConfig':_0x22a55b,'folderPath':_0x4bc02b,'existingSegment':_0x471731,'existingActivations':_0x4c7d1c,'isNew':_0x90ac8[_0x452590(0x213)],'hasChanges':_0x90ac8[_0x452590(0x1c6)],'diff':_0x90ac8[_0x452590(0x12d)],'activationActions':_0x5c3994});}return{'segmentFiles':_0x4ee814,'foldersToCreate':_0x1254dd};}export async function prepareJourneyFiles(_0x3b6c77,_0x5075a6,_0x3958e4,_0x4cc364){const _0x106524=a142_0x469651,_0x2ca9a9=[],_0x5488da=new Set();for(const {yamlConfig:_0x5c5e19,folderPath:_0x24796b,sourcePath:_0x21ca79}of _0x3b6c77){const _0x25889b=resolveTDFolderPath(_0x24796b,_0x3958e4,_0x4cc364),_0xb69cd4=_0x25889b+':'+_0x5c5e19[_0x106524(0x169)],_0x325800=_0x5075a6['journeyBundlesByFolderAndName'][_0x106524(0x15d)](_0xb69cd4);let _0x39c8bc,_0x7deaa;if(_0x325800&&_0x325800['length']>0x0){const _0x4739a0=buildLocalExpandedRuleMappings(_0x5c5e19),{createYamlContext:_0x18e3dc,prefetchJourneySegments:_0x57d5fa}=createPushYamlContextForBundle(_0x5075a6[_0x106524(0x167)],_0x5075a6['parentId'],_0x5075a6[_0x106524(0x127)],_0x4739a0,_0x5075a6[_0x106524(0x12e)],_0x5075a6['connectionIdToNameMap'],_0x5075a6[_0x106524(0x160)],_0x5075a6[_0x106524(0x18e)]);await _0x57d5fa(_0x325800[_0x106524(0x1a9)](_0x2d9ac4=>_0x2d9ac4['id']));const _0x324d8b=await _0x5075a6[_0x106524(0x167)][_0x106524(0x130)][_0x106524(0x148)](_0x325800[0x0][_0x106524(0x1f0)]),_0xc801f2=hasMultipleVersions(_0x5c5e19),_0x544971=async _0x570b6e=>{const _0x340b3c=_0x106524,_0x497fee=_0x5075a6[_0x340b3c(0x18e)]?.[_0x340b3c(0x15d)](_0x570b6e);if(_0x497fee)return _0x497fee;return _0x5075a6[_0x340b3c(0x1f5)]({'journeyId':_0x570b6e,'journeyName':_0x5c5e19['name'],'isMultiVersion':_0x325800[_0x340b3c(0x163)]>0x1});};if(_0xc801f2&&_0x325800[_0x106524(0x163)]>0x1){const _0x2b169e=[];for(const _0x2d17f3 of _0x325800){const _0xc9f8a8=_0x2d17f3['versionNumber']||0x1;_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19['name']+'\x20v'+_0xc9f8a8);const _0x1792e9=await _0x544971(_0x2d17f3['id']),_0x3c0584=_0x18e3dc(_0x2d17f3['id']),_0x1d9732=await journeyResponseToDef(_0x1792e9,_0x3c0584);_0x2b169e[_0x106524(0x1cf)]({'item':_0x2d17f3,'yaml':_0x1d9732});}const _0x3834be=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef(_0x2b169e,_0x3834be,_0x324d8b);const _0x4a8064=Math[_0x106524(0x185)](..._0x2b169e[_0x106524(0x1a9)](_0x3e6061=>_0x3e6061[_0x106524(0x122)][_0x106524(0x166)]||0x0)),_0xd05f73=_0x325800[_0x106524(0x13c)](_0x35ef17=>(_0x35ef17[_0x106524(0x166)]||0x0)===_0x4a8064);_0xd05f73&&(_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)](_0x106524(0x1a3)+_0x5c5e19[_0x106524(0x169)]+'\x20v'+_0x4a8064),_0x39c8bc=await _0x544971(_0xd05f73['id']));}else{const _0x154689=_0x325800[_0x325800[_0x106524(0x163)]-0x1];_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19[_0x106524(0x169)]),_0x39c8bc=await _0x544971(_0x154689['id']);const _0x20f47c=_0x18e3dc(_0x154689['id']),_0x4a5b8e=await journeyResponseToDef(_0x39c8bc,_0x20f47c),_0x2b57b0=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef([{'item':_0x154689,'yaml':_0x4a5b8e}],_0x2b57b0,_0x324d8b);}}addFoldersToCreate(_0x25889b,_0x5075a6['folderPathToId'],_0x5488da);const _0x52618a=calculateJourneyDiff(_0x5c5e19,_0x7deaa);_0x2ca9a9[_0x106524(0x1cf)]({'relativePath':_0x5c5e19['name'],'absolutePath':_0x21ca79,'yamlConfig':_0x5c5e19,'folderPath':_0x25889b,'existingJourney':_0x39c8bc,'isNew':_0x52618a[_0x106524(0x213)],'hasChanges':_0x52618a[_0x106524(0x1c6)],'diff':_0x52618a[_0x106524(0x12d)]});}return{'journeyFiles':_0x2ca9a9,'foldersToCreate':_0x5488da};}export function calculateActivationActions(_0x4f9d71,_0x462ce2,_0x252036,_0x37055d){const _0x3b6e67=a142_0x469651,_0x598f2d=[],_0x46f5c1=new Map();for(const _0x525988 of _0x462ce2){_0x46f5c1[_0x3b6e67(0x17c)](_0x525988['name'],_0x525988);}const _0x3e0321=new Map();for(const _0x89a0fd of _0x4f9d71){_0x3e0321['set'](_0x89a0fd[_0x3b6e67(0x169)],_0x89a0fd);}for(const _0x48c086 of _0x4f9d71){const _0x23781e=_0x46f5c1[_0x3b6e67(0x15d)](_0x48c086[_0x3b6e67(0x169)]);if(!_0x23781e)_0x598f2d[_0x3b6e67(0x1cf)]({'type':'create','name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086});else{const _0x34edb3=activationResponseToDef(_0x23781e,_0x252036,_0x37055d),_0x230884=a142_0x324021[_0x3b6e67(0x11b)](_0x34edb3),_0x42b268=a142_0x324021[_0x3b6e67(0x11b)](_0x48c086);_0x230884!==_0x42b268&&_0x598f2d[_0x3b6e67(0x1cf)]({'type':_0x3b6e67(0x1c7),'name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086,'existingActivation':_0x23781e});}}for(const _0x4e3948 of _0x462ce2){!_0x3e0321[_0x3b6e67(0x1b3)](_0x4e3948[_0x3b6e67(0x169)])&&_0x598f2d['push']({'type':_0x3b6e67(0x1dd),'name':_0x4e3948[_0x3b6e67(0x169)],'existingActivation':_0x4e3948});}return _0x598f2d;}function calculateYamlDiff(_0x20a9e5,_0x1029fe){if(_0x1029fe){const _0x525da6=generateDiff(_0x1029fe,_0x20a9e5),_0x1841e0=hasChanges(_0x525da6);return{'isNew':![],'hasChanges':_0x1841e0,'diff':_0x1841e0?formatDiffWithColors(_0x525da6):undefined};}const _0x29c07c=generateDiff('',_0x20a9e5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x29c07c)};}export function calculateSegmentDiff(_0x21a487,_0x231fc8,_0x524287,_0x33638a,_0x1d02f0){const _0xadea68=segmentToYamlString(_0x21a487),_0x4aca86=_0x231fc8?segmentToYamlString(segmentWithActivationsToYaml(_0x231fc8,_0x524287,undefined,_0x33638a,_0x1d02f0)):undefined;return calculateYamlDiff(_0xadea68,_0x4aca86);}export function calculateJourneyDiff(_0x44228e,_0x524437){const _0x4b1f49=normalizeJourneyDef(_0x44228e,_0x44228e),_0x42049a=a142_0x334139(_0x4b1f49),_0x123ad1=_0x524437?a142_0x334139(normalizeJourneyDef(_0x524437,_0x44228e)):undefined;return calculateYamlDiff(_0x42049a,_0x123ad1);}export function findSegmentsToDelete(_0x46f04a,_0x1a7a7d,_0x53772a,_0x35a555,_0xd4a685){const _0x20f763=a142_0x469651,_0x3ec932=new Set();for(const {yamlConfig:_0x4b9ad9,folderPath:_0x279c36}of _0x1a7a7d){_0x3ec932['add'](_0x279c36+':'+_0x4b9ad9[_0x20f763(0x169)]);}return _0x46f04a['filter'](_0x5974c8=>{const _0x150ad9=_0x20f763,_0x3e006c=_0x5974c8[_0x150ad9(0x1eb)]?_0x53772a['get'](_0x5974c8[_0x150ad9(0x1eb)]['toString']())||'':'',_0x4205d8=_0x3e006c+':'+_0x5974c8[_0x150ad9(0x169)];if(_0x3ec932[_0x150ad9(0x1b3)](_0x4205d8))return![];if(_0xd4a685)return _0x3e006c===_0x35a555||_0x3e006c[_0x150ad9(0x1b4)](_0x35a555+'/');return!![];});}export function findJourneysToDelete(_0x6af268,_0x52d09f,_0x513c6c,_0x3c9091,_0x3d143f){const _0x3710ef=a142_0x469651,_0xde9ae4=new Set();for(const {yamlConfig:_0x4987a2,folderPath:_0x7f70b1}of _0x52d09f){_0xde9ae4[_0x3710ef(0x1f4)](_0x7f70b1+':'+_0x4987a2['name']);}return _0x6af268[_0x3710ef(0x19c)](_0x13e0da=>{const _0x1f28bc=_0x3710ef,_0x5b1ffb=_0x13e0da[_0x1f28bc(0x11d)]?_0x513c6c[_0x1f28bc(0x15d)](_0x13e0da[_0x1f28bc(0x11d)])||'':'',_0xc042d6=_0x5b1ffb+':'+_0x13e0da[_0x1f28bc(0x17e)];if(_0xde9ae4['has'](_0xc042d6))return![];if(_0x3d143f)return _0x5b1ffb===_0x3c9091||_0x5b1ffb[_0x1f28bc(0x1b4)](_0x3c9091+'/');return!![];});}export function buildSegmentLookupMap(_0x59fc59,_0x5c97f6){const _0x335145=a142_0x469651,_0x11c99b=new Map();for(const _0xf1bbfe of _0x59fc59){const _0x3bff59=_0xf1bbfe[_0x335145(0x1eb)]?_0x5c97f6[_0x335145(0x15d)](_0xf1bbfe[_0x335145(0x1eb)]['toString']())||'':'',_0x4391b6=_0x3bff59+':'+_0xf1bbfe[_0x335145(0x169)];_0x11c99b[_0x335145(0x17c)](_0x4391b6,_0xf1bbfe);}return _0x11c99b;}export function buildSegmentNameToIdMap(_0x54930b){const _0x371868=a142_0x469651,_0x54095e=new Map();for(const _0x4500cb of _0x54930b){_0x54095e[_0x371868(0x17c)](_0x4500cb[_0x371868(0x169)],_0x4500cb['id']);}return _0x54095e;}export function buildJourneyBundleLookupMap(_0x421f9b,_0x1d7d1f){const _0xef661e=a142_0x469651,_0x5d6a08=new Map();for(const _0x46db5f of _0x421f9b){const _0x3c5443=_0x46db5f[_0xef661e(0x11d)]?_0x1d7d1f[_0xef661e(0x15d)](_0x46db5f[_0xef661e(0x11d)])||'':'',_0x4b1859=_0x3c5443+':'+_0x46db5f[_0xef661e(0x17e)];!_0x5d6a08[_0xef661e(0x1b3)](_0x4b1859)&&_0x5d6a08[_0xef661e(0x17c)](_0x4b1859,[]),_0x5d6a08[_0xef661e(0x15d)](_0x4b1859)[_0xef661e(0x1cf)](_0x46db5f);}for(const _0x4db898 of _0x5d6a08[_0xef661e(0x20f)]()){_0x4db898['sort']((_0x2c2d72,_0x2cc121)=>(_0x2c2d72['versionNumber']||0x0)-(_0x2cc121[_0xef661e(0x166)]||0x0));}return _0x5d6a08;}export function collectFoldersToCreate(_0xae2e3e,_0x4afc32){const _0xc3a7c8=a142_0x469651,_0x287181=new Set();for(const _0x1e8bfe of _0xae2e3e){if(!_0x1e8bfe)continue;if(_0x4afc32['has'](_0x1e8bfe))continue;const _0x3cc8a6=_0x1e8bfe[_0xc3a7c8(0x214)]('/');let _0x38b027='';for(const _0x4120c0 of _0x3cc8a6){_0x38b027=_0x38b027?_0x38b027+'/'+_0x4120c0:_0x4120c0,!_0x4afc32[_0xc3a7c8(0x1b3)](_0x38b027)&&_0x287181[_0xc3a7c8(0x1f4)](_0x38b027);}}return _0x287181;}export function parseAndClassifyYamlFiles(_0x326afa,_0x381af3,_0x6fddb8){const _0x5adc3f=a142_0x469651,_0x12a801=[],_0x6ef763=[];for(const _0x2f3bbd of _0x326afa){const _0x362c75=a142_0x2c8ea3[_0x5adc3f(0x1b0)](_0x381af3,a142_0x2c8ea3['dirname'](_0x2f3bbd)),_0x5ebeba=_0x362c75==='.'?'':_0x362c75,_0x558b06=readFileSync(_0x2f3bbd,_0x5adc3f(0x1d8)),_0x39224b=a142_0x324021['parse'](_0x558b06);if(isJourneyDef(_0x39224b)){const _0x13140f=a142_0x505a2c(_0x558b06);_0x6ef763['push']({'yamlConfig':_0x13140f,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}else{if(!_0x6fddb8?.[_0x5adc3f(0x152)]){const _0x392247=parseSegmentYamlFile(_0x558b06),_0x27ff97=normalizeChildSegmentYaml(_0x392247);_0x12a801[_0x5adc3f(0x1cf)]({'yamlConfig':_0x27ff97,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}}}return{'segments':_0x12a801,'journeys':_0x6ef763};}export function validateParsedFiles(_0x43e818,_0x7b9ef){const _0x1eba61=a142_0x469651,_0x192146=[];for(const {yamlConfig:_0x5b93df,sourcePath:_0x1b63e8}of _0x43e818[_0x1eba61(0x208)]){const _0x3fe749=readFileSync(_0x1b63e8,_0x1eba61(0x1d8)),_0x2ce464=a142_0x324021[_0x1eba61(0x1c4)](_0x3fe749),_0x1f6ad5=validateSegmentDef(_0x5b93df,{'source':_0x3fe749,'document':_0x2ce464},{'skipSchema':!![]});if(!_0x1f6ad5[_0x1eba61(0x1d2)]){const _0xd0add8=a142_0x2c8ea3['relative'](_0x7b9ef,_0x1b63e8);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0xd0add8,'source':_0x3fe749,'result':_0x1f6ad5,'isJourney':![]});}}for(const {yamlConfig:_0x44cb1e,sourcePath:_0x299f46}of _0x43e818[_0x1eba61(0x1e5)]){const _0x38b827=readFileSync(_0x299f46,_0x1eba61(0x1d8)),_0x410a1f=a142_0x324021[_0x1eba61(0x1c4)](_0x38b827),_0x13e245=validateJourneyDef(_0x44cb1e,{'source':_0x38b827,'document':_0x410a1f},{'skipSchema':!![]});if(!_0x13e245[_0x1eba61(0x1d2)]){const _0x222797=a142_0x2c8ea3['relative'](_0x7b9ef,_0x299f46);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0x222797,'source':_0x38b827,'result':_0x13e245,'isJourney':!![]});}}return _0x192146;}export function formatValidationErrors(_0x2af6fd){const _0x433bc9=a142_0x469651,_0x293541=[];for(const {filePath:_0x157f3d,source:_0x4eb649,result:_0x50f282,isJourney:_0x25b0c5}of _0x2af6fd){const _0x15a52a=_0x25b0c5?_0x433bc9(0x130):_0x433bc9(0x1c9);_0x293541[_0x433bc9(0x1cf)]('\x0a'+_0x157f3d+'\x20('+_0x15a52a+'):\x20'+_0x50f282['errors'][_0x433bc9(0x163)]+'\x20error(s)'),_0x293541[_0x433bc9(0x1cf)](formatValidationResult(_0x50f282,_0x4eb649,_0x157f3d));}return _0x293541[_0x433bc9(0x1c0)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x37f0e7){const _0xed1367=a142_0x469651,_0x46e995=new Set(),_0x444d25=new Map(),_0x53632b=collectSegmentUsageCounts(_0x37f0e7);if(_0x37f0e7[_0xed1367(0x208)])for(const [_0x597538,_0xe0555d]of Object[_0xed1367(0x188)](_0x37f0e7[_0xed1367(0x208)])){_0x46e995[_0xed1367(0x1f4)](_0x597538);if(_0xe0555d[_0xed1367(0x1a0)]){const _0xad3e48=yamlRuleToApi(_0xe0555d['rule']),_0x5a377c=apiRuleToYaml(_0xad3e48);_0x444d25[_0xed1367(0x17c)](_0x597538,_0x5a377c);}}const _0x7b6306=new Map();let _0xf67142=0x0;for(const [_0x509f62,_0x1e4c93]of _0x444d25){const _0xa9ad5c=serializeExpandedRule(_0x1e4c93,_0x444d25),_0x26b8cf=_0x7b6306[_0xed1367(0x15d)](_0xa9ad5c)||[];_0x26b8cf[_0xed1367(0x1cf)]({'name':_0x509f62,'index':_0xf67142}),_0x7b6306['set'](_0xa9ad5c,_0x26b8cf),_0xf67142++;}const _0xcc7199=new Map();for(const [_0x55e698,_0x34b681]of _0x7b6306){const _0x14d6f1=_0x34b681[_0xed1367(0x19b)]()[_0xed1367(0x113)]((_0x5c1483,_0x2f3576)=>{const _0x50e278=_0xed1367,_0x37a616=_0x53632b[_0x50e278(0x15d)](_0x5c1483[_0x50e278(0x169)])||0x0,_0x474aea=_0x53632b['get'](_0x2f3576[_0x50e278(0x169)])||0x0;if(_0x37a616!==_0x474aea)return _0x474aea-_0x37a616;return _0x5c1483['index']-_0x2f3576[_0x50e278(0x123)];})[_0xed1367(0x1a9)](_0x14c017=>_0x14c017['name']),_0x222b82=[];for(const _0x3cf16b of _0x14d6f1){const _0x4147fc=_0x53632b[_0xed1367(0x15d)](_0x3cf16b)||0x0,_0x1427cd=Math[_0xed1367(0x185)](_0x4147fc,0x1);for(let _0x2b4596=0x0;_0x2b4596<_0x1427cd;_0x2b4596++){_0x222b82['push'](_0x3cf16b);}}_0xcc7199['set'](_0x55e698,_0x222b82);}return{'existingLocalSegmentNames':_0x46e995,'localSegmentRules':_0x444d25,'localExpandedRuleToNames':_0xcc7199};}export function createSegmentIdResolver(_0x574a46,_0x3e0d8d){return async _0x28699f=>{const _0x312993=a142_0x3aac,_0x370d22=_0x574a46[_0x312993(0x15d)](_0x28699f);if(!_0x370d22)throw new SDKError(ErrorCode[_0x312993(0x212)],_0x312993(0x1d1)+_0x28699f+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x3e0d8d+'\x27)');return _0x370d22;};}export function extractRootFolderId(_0x581a07){const _0xcd6592=a142_0x469651;return _0x581a07['relationships']?.[_0xcd6592(0x1a5)]?.[_0xcd6592(0x143)]?.['id']||_0x581a07['relationships']?.[_0xcd6592(0x1ae)]?.[_0xcd6592(0x143)]?.['id'];}export function buildConnectionMaps(_0x3a1f34){const _0x43a9da=a142_0x469651,_0x2acb0d=new Map(),_0x2b0171=new Map(),_0x2d3ceb=new Map();for(const _0x5260d3 of _0x3a1f34){_0x2acb0d[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],parseInt(_0x5260d3['id'],0xa)),_0x2b0171[_0x43a9da(0x17c)](_0x5260d3['id'],_0x5260d3['name']),_0x2d3ceb[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],_0x5260d3[_0x43a9da(0x17d)]);}return{'nameToId':_0x2acb0d,'idToName':_0x2b0171,'nameToType':_0x2d3ceb};}export function calculatePushStats(_0x26ab9f,_0x4e96cb,_0x34715e,_0x41448f,_0x3f56de,_0x235c62,_0x584868){const _0x3040ff=a142_0x469651,_0x384ec1=_0x26ab9f[_0x3040ff(0x19c)](_0x272fda=>_0x272fda[_0x3040ff(0x213)]),_0x691cf6=_0x26ab9f[_0x3040ff(0x19c)](_0x2197bf=>!_0x2197bf[_0x3040ff(0x213)]&&_0x2197bf[_0x3040ff(0x1c6)]),_0x4ac0ef=_0x26ab9f[_0x3040ff(0x19c)](_0x4d99e2=>!_0x4d99e2[_0x3040ff(0x213)]&&!_0x4d99e2[_0x3040ff(0x1c6)]),_0x547d2f=_0x235c62?_0x41448f:[],_0x39f31a=_0x4e96cb[_0x3040ff(0x19c)](_0x4a5558=>_0x4a5558[_0x3040ff(0x213)]),_0x542821=_0x4e96cb[_0x3040ff(0x19c)](_0x4bc055=>!_0x4bc055[_0x3040ff(0x213)]&&_0x4bc055[_0x3040ff(0x1c6)]),_0x39c178=_0x4e96cb[_0x3040ff(0x19c)](_0xf9e720=>!_0xf9e720[_0x3040ff(0x213)]&&!_0xf9e720['hasChanges']),_0x16c463=_0x235c62?_0x3f56de:[],_0x41f170=_0x26ab9f[_0x3040ff(0x1e7)](_0x5ca6fb=>_0x5ca6fb['activationActions']),_0x5f7727=_0x41f170[_0x3040ff(0x19c)](_0x159048=>_0x159048['type']==='create'),_0x431eb4=_0x41f170[_0x3040ff(0x19c)](_0x321cd6=>_0x321cd6['type']==='update'),_0x6d0d46=_0x41f170['filter'](_0xa7661b=>_0xa7661b[_0x3040ff(0x17d)]===_0x3040ff(0x1dd)),_0x5e7049=Array[_0x3040ff(0x1c2)](_0x34715e)[_0x3040ff(0x113)](),_0x23996f=_0x584868?![]:_0x384ec1[_0x3040ff(0x163)]>0x0||_0x691cf6[_0x3040ff(0x163)]>0x0||_0x547d2f[_0x3040ff(0x163)]>0x0,_0x5188c2=_0x39f31a[_0x3040ff(0x163)]>0x0||_0x542821[_0x3040ff(0x163)]>0x0||_0x16c463[_0x3040ff(0x163)]>0x0,_0x2a1db7=_0x584868?![]:_0x41f170['length']>0x0,_0x45e8dc=_0x5e7049['length']>0x0;return{'segments':{'new':_0x384ec1,'changed':_0x691cf6,'unchanged':_0x4ac0ef,'toDelete':_0x547d2f},'journeys':{'new':_0x39f31a,'changed':_0x542821,'unchanged':_0x39c178,'toDelete':_0x16c463},'activations':{'all':_0x41f170,'toCreate':_0x5f7727,'toUpdate':_0x431eb4,'toDelete':_0x6d0d46},'folders':{'toCreate':_0x5e7049},'counts':{'segments':{'new':_0x384ec1[_0x3040ff(0x163)],'changed':_0x691cf6[_0x3040ff(0x163)],'unchanged':_0x4ac0ef[_0x3040ff(0x163)],'toDelete':_0x547d2f[_0x3040ff(0x163)]},'journeys':{'new':_0x39f31a[_0x3040ff(0x163)],'changed':_0x542821['length'],'unchanged':_0x39c178[_0x3040ff(0x163)],'toDelete':_0x16c463['length']},'activations':{'create':_0x5f7727[_0x3040ff(0x163)],'update':_0x431eb4[_0x3040ff(0x163)],'delete':_0x6d0d46[_0x3040ff(0x163)]},'folders':_0x5e7049[_0x3040ff(0x163)]},'hasChanges':_0x23996f||_0x5188c2||_0x2a1db7||_0x45e8dc};}export async function buildPushExecutionContext(_0x4ff57d,_0x241dc8,_0x3ddbbe,_0x5a029a,_0x558d97,_0xa7a9f9){const _0x4f1539=a142_0x469651,_0x4dacc3=extractRootFolderId(_0x3ddbbe),{pathToId:_0xd0618b,idToPath:_0x213072}=buildFolderMaps(_0x558d97),_0x580208=buildSegmentNameToIdMap(_0x5a029a),_0x2a47f8=new Map(),{batchAsync:_0x10a276}=await import(_0x4f1539(0x162)),[_0x3cf348,_0x585819]=await Promise[_0x4f1539(0x14f)]([_0x4ff57d[_0x4f1539(0x121)]['buildUserMaps'](),_0x4ff57d[_0x4f1539(0x120)][_0x4f1539(0x1d0)](),((async()=>{const _0x26b2f3=_0x4f1539;!_0xa7a9f9&&_0x5a029a[_0x26b2f3(0x163)]>0x0&&await _0x10a276(_0x5a029a,async _0x4a3b28=>{const _0x418baa=_0x26b2f3,_0x5b63cf=await _0x4ff57d[_0x418baa(0x1c9)]['listActivations'](_0x241dc8,_0x4a3b28['id']);_0x2a47f8[_0x418baa(0x17c)](_0x4a3b28['id'],_0x5b63cf);});})())]),{emailToId:_0xc7fe42,idToEmail:_0x36fb6b}=_0x3cf348,_0x57b654=buildConnectionMaps(_0x585819);return{'rootFolderId':_0x4dacc3,'folderPathToId':_0xd0618b,'folderIdToPath':_0x213072,'segmentNameToId':_0x580208,'activationsBySegmentId':_0x2a47f8,'emailToIdMap':_0xc7fe42,'idToEmailMap':_0x36fb6b,'connectionNameToIdMap':_0x57b654[_0x4f1539(0x179)],'connectionIdToNameMap':_0x57b654[_0x4f1539(0x136)],'connectionNameToTypeMap':_0x57b654[_0x4f1539(0x165)]};}export function createPushYamlContextForBundle(_0x52e753,_0x44f456,_0x13a2c9,_0x414b2b,_0x1f3450,_0x4cd951,_0x214826,_0x4d07dc){const {existingLocalSegmentNames:_0x346be9,localExpandedRuleToNames:_0x3f390e}=_0x414b2b,_0x546a05=new Set(),_0x35701f=new Map(),_0xd610d3=new Map(),_0x5b151b=new Map(),_0x336fac=createJumpTargetCache(),_0x399272=new Map(),_0x503a8f=new Map(),_0x2a8c0f=new Set();let _0x37966e;const _0xcf52e6=_0x142f40=>{const _0x473d05={'resolveSegment':async _0x4a9420=>{const _0x594161=a142_0x3aac,_0x12746a=_0x5b151b[_0x594161(0x15d)](_0x4a9420);if(_0x12746a!==undefined)return{'name':_0x12746a,'isJourneyLocal':!![]};try{const _0x2340f4=await fetchSegment(_0x52e753,_0x44f456,_0x4a9420,_0x13a2c9);if(!_0x2340f4)throw new Error(_0x594161(0x20c));const _0x3c5d0c=generateJourneyLocalName(_0x2340f4['name']),_0x12c74d=_0x2340f4['kind']===SEGMENT_KIND_JOURNEY&&_0x3c5d0c!==undefined;let _0x3173cf=_0x2340f4[_0x594161(0x169)],_0x25d86a;if(_0x12c74d&&_0x2340f4[_0x594161(0x1a0)]){const _0x281677=apiRuleToYaml(_0x2340f4[_0x594161(0x1a0)]);_0x503a8f[_0x594161(0x17c)](_0x4a9420,_0x281677);const _0x2a9c2f=async _0x27691e=>{const _0x2179bf=_0x594161,_0x5e5325=collectSegmentRefsFromRule(_0x27691e);for(const _0x10c832 of _0x5e5325){if(!_0x503a8f[_0x2179bf(0x1b3)](_0x10c832))try{const _0x3ed453=await fetchSegment(_0x52e753,_0x44f456,_0x10c832,_0x13a2c9);if(_0x3ed453?.[_0x2179bf(0x1a0)]){const _0xc1dbc0=apiRuleToYaml(_0x3ed453[_0x2179bf(0x1a0)]);_0x503a8f[_0x2179bf(0x17c)](_0x10c832,_0xc1dbc0),await _0x2a9c2f(_0xc1dbc0);}}catch(_0x204b8d){logger[_0x2179bf(0x140)](_0x2179bf(0x201)+_0x10c832+':\x20'+_0x204b8d);}}};await _0x2a9c2f(_0x281677);const _0x157668=serializeExpandedRule(_0x281677,_0x503a8f),_0x2d87a1=_0x3f390e['get'](_0x157668);if(_0x2d87a1&&_0x2d87a1[_0x594161(0x163)]>0x0){const _0x3bcfb1=_0x35701f[_0x594161(0x15d)](_0x157668)||0x0,_0x40d99c=_0x2d87a1[_0x3bcfb1]||_0x2d87a1[_0x2d87a1[_0x594161(0x163)]-0x1];_0x35701f['set'](_0x157668,_0x3bcfb1+0x1),_0x3173cf=_0x40d99c,_0x546a05['add'](_0x3173cf),_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf);const _0x2947e7=await resolveRuleSegmentRefs(_0x281677,async _0x26d491=>{const _0x43e65d=_0x594161,_0x3fe8f6=_0x5b151b['get'](_0x26d491);if(_0x3fe8f6)return _0x3fe8f6;const _0x717791=await _0x37966e['resolveSegment'](_0x26d491);return _0x717791[_0x43e65d(0x169)];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x2947e7};}else{const _0x2eb804=_0x399272[_0x594161(0x15d)](_0x157668);if(_0x2eb804)_0x3173cf=_0x2eb804,_0x5b151b['set'](_0x4a9420,_0x3173cf);else{if(_0x3c5d0c){let _0x21985c=_0x3c5d0c,_0x9997ba=0x2;while(_0x546a05[_0x594161(0x1b3)](_0x21985c)||_0x346be9[_0x594161(0x1b3)](_0x21985c)){_0x21985c=_0x3c5d0c+'_'+_0x9997ba,_0x9997ba++;}_0x546a05[_0x594161(0x1f4)](_0x21985c),_0x3173cf=_0x21985c;}_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf),_0x399272[_0x594161(0x17c)](_0x157668,_0x3173cf);const _0x59ad22=await resolveRuleSegmentRefs(_0x281677,async _0x24bdf=>{const _0x965c41=_0x594161,_0x46c29a=_0x5b151b[_0x965c41(0x15d)](_0x24bdf);if(_0x46c29a)return _0x46c29a;const _0x21c1d8=await _0x37966e[_0x965c41(0x118)](_0x24bdf);return _0x21c1d8['name'];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x59ad22};}}}return{'name':_0x3173cf,'isJourneyLocal':_0x12c74d,'definition':_0x25d86a};}catch(_0x5a8361){return logger[_0x594161(0x140)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4a9420+':\x20'+_0x5a8361),{'name':_0x4a9420,'isJourneyLocal':![]};}},'resolveActivation':async _0x40c177=>{const _0x4bf2ad=a142_0x3aac,_0x48ccd3=_0xd610d3[_0x4bf2ad(0x15d)](_0x40c177);if(_0x48ccd3!==undefined)return{'name':_0x48ccd3,'isJourneyLocal':!![]};try{let _0x5a75f9=_0x214826?.[_0x4bf2ad(0x15d)](_0x40c177);!_0x5a75f9&&(_0x5a75f9=await _0x52e753[_0x4bf2ad(0x130)][_0x4bf2ad(0x15f)](_0x142f40,_0x40c177));const _0x5ec464=_0x5a75f9[_0x4bf2ad(0x1ab)][_0x4bf2ad(0x144)][_0x4bf2ad(0x169)]||_0x40c177,_0x118e32=sanitizeYamlKey(_0x5ec464)||_0x4bf2ad(0x1c1)+_0x40c177,_0x2df384=_0x118e32;_0xd610d3[_0x4bf2ad(0x17c)](_0x40c177,_0x2df384);const _0x35e11e=journeyActivationStepToYaml(_0x5a75f9,_0x1f3450,_0x4cd951);return{'name':_0x2df384,'isJourneyLocal':!![],'definition':_0x35e11e};}catch(_0x20f0c4){return logger[_0x4bf2ad(0x140)](_0x4bf2ad(0x18d)+_0x40c177+':\x20'+_0x20f0c4),{'name':_0x40c177,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xa2fef0,_0x1e1347)=>resolveJumpTarget(_0xa2fef0,_0x1e1347,_0x336fac,async _0x11572d=>{const _0x8ab498=a142_0x3aac,_0xd811be=_0x4d07dc?.[_0x8ab498(0x15d)](_0x11572d);if(_0xd811be)return _0xd811be;return _0x52e753[_0x8ab498(0x130)][_0x8ab498(0x190)](_0x11572d);})};return _0x37966e=_0x473d05,_0x473d05;},_0x79b02=async _0x210c0f=>{const _0x3fbefe=a142_0x3aac,{collectSegmentIdsFromJourneyApi:_0x1f0f74}=await import('./journey-yaml.js'),{batchAsync:_0xdae00b}=await import(_0x3fbefe(0x162)),_0x3e4eef=new Set();for(const _0x57a561 of _0x210c0f){let _0x260a6e=_0x4d07dc?.['get'](_0x57a561);!_0x260a6e&&(_0x260a6e=await _0x52e753[_0x3fbefe(0x130)][_0x3fbefe(0x190)](_0x57a561));const _0x1691a8=_0x1f0f74(_0x260a6e);for(const _0xc6ab13 of _0x1691a8){_0x3e4eef[_0x3fbefe(0x1f4)](_0xc6ab13);}}let _0x45b591=Array[_0x3fbefe(0x1c2)](_0x3e4eef);while(_0x45b591[_0x3fbefe(0x163)]>0x0){const _0x2e227b=_0x45b591[_0x3fbefe(0x19c)](_0x5eb641=>!_0x2a8c0f[_0x3fbefe(0x1b3)](_0x5eb641));if(_0x2e227b['length']===0x0)break;const _0x2a2b42=await _0xdae00b(_0x2e227b,async _0x3a0484=>{const _0x4886e2=_0x3fbefe;_0x2a8c0f[_0x4886e2(0x1f4)](_0x3a0484);const _0x3e3850=await fetchSegment(_0x52e753,_0x44f456,_0x3a0484,_0x13a2c9);if(!_0x3e3850)return null;return{'segmentId':_0x3a0484,'segment':_0x3e3850};},0xa),_0x323a25=new Set();for(const _0x8c1c5f of _0x2a2b42){if(!_0x8c1c5f?.[_0x3fbefe(0x1c9)]?.[_0x3fbefe(0x1a0)])continue;const _0x1adf6e=apiRuleToYaml(_0x8c1c5f[_0x3fbefe(0x1c9)][_0x3fbefe(0x1a0)]);_0x503a8f['set'](_0x8c1c5f[_0x3fbefe(0x207)],_0x1adf6e);const _0x13aefb=collectSegmentRefsFromRule(_0x1adf6e);for(const _0x5f29ee of _0x13aefb){!_0x2a8c0f['has'](_0x5f29ee)&&_0x323a25[_0x3fbefe(0x1f4)](_0x5f29ee);}}_0x45b591=Array['from'](_0x323a25);}};return{'createYamlContext':_0xcf52e6,'prefetchJourneySegments':_0x79b02};}export async function executePushSegments(_0x102277,_0x3b5718,_0x50abbd,_0x527134,_0x58999a){const _0x210b15=a142_0x469651,{segmentDefToCreateRequest:_0x462cb7,segmentDefToUpdateRequest:_0xb84c38}=await import(_0x210b15(0x119)),_0x43f3cf=_0x50abbd[_0x210b15(0x168)],_0x24c29c=0x5,_0x5708eb=async _0x59feb2=>{const _0x3a30b0=_0x210b15,_0x33e088=_0x59feb2['folderPath']?_0x43f3cf[_0x3a30b0(0x15d)](_0x59feb2[_0x3a30b0(0x183)]):undefined;let _0x5b0f72;const _0x39b8f6={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x19415e=_0x59feb2[_0x3a30b0(0x1b1)];if(_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x1a0)]){const _0x10c21f=createSegmentIdResolver(_0x50abbd['segmentNameToId'],_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]),_0x24a674=await resolveRuleSegmentIds(_0x59feb2['yamlConfig']['rule'],_0x10c21f);_0x19415e={..._0x59feb2[_0x3a30b0(0x1b1)],'rule':_0x24a674};}try{if(_0x59feb2[_0x3a30b0(0x213)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ba),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]});const _0x418813=_0x462cb7(_0x19415e,_0x33e088),_0x347d16=await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x115)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x15e),()=>_0x102277['segment'][_0x3a30b0(0x1d3)](_0x527134['parentId'],_0x418813));_0x5b0f72=_0x347d16[_0x3a30b0(0x143)]['id'],_0x50abbd[_0x3a30b0(0x176)][_0x3a30b0(0x17c)](_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],_0x5b0f72),_0x39b8f6[_0x3a30b0(0x172)]={'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'id':_0x5b0f72},_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x11c),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'segmentId':_0x5b0f72}),_0x58999a['logSuccess']?.(_0x3a30b0(0x197)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x147)]=0x1;}else{if(_0x59feb2[_0x3a30b0(0x1c6)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ec),'name':_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]});const _0x17de15=_0xb84c38(_0x19415e);_0x33e088!==_0x59feb2[_0x3a30b0(0x16e)]?.[_0x3a30b0(0x1eb)]&&(_0x17de15['segmentFolderId']=_0x33e088?parseInt(_0x33e088,0xa):undefined),await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x1bf)+_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]+'\x27...',()=>_0x102277[_0x3a30b0(0x1c9)]['updateSegmentById'](_0x527134[_0x3a30b0(0x1e9)],_0x59feb2[_0x3a30b0(0x16e)]['id'],_0x17de15)),_0x5b0f72=_0x59feb2['existingSegment']['id'],_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x14b),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]}),_0x58999a['logSuccess']?.(_0x3a30b0(0x125)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x1ea)]=0x1;}else _0x5b0f72=_0x59feb2[_0x3a30b0(0x16e)]['id'];}}catch(_0xbf39bb){const _0x5c8039=isHttp400Error(_0xbf39bb),_0x5c7bb=_0x5c8039?ErrorCode[_0x3a30b0(0x211)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x117fdd=getErrorMessage(_0xbf39bb);throw new SDKError(_0x5c7bb,_0x3a30b0(0x139)+(_0x59feb2['isNew']?'create':_0x3a30b0(0x1c7))+_0x3a30b0(0x1fa)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+_0x117fdd,_0xbf39bb);}try{const _0x35a56e=await syncActivationsForSegment(_0x102277,_0x527134[_0x3a30b0(0x1e9)],_0x5b0f72,_0x59feb2['yamlConfig'][_0x3a30b0(0x169)],_0x59feb2[_0x3a30b0(0x1f9)],_0x58999a,_0x59feb2[_0x3a30b0(0x135)]);_0x39b8f6[_0x3a30b0(0x116)]=_0x35a56e;}catch(_0x312482){if(_0x312482 instanceof SDKError)throw _0x312482;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x158)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+getErrorMessage(_0x312482),_0x312482);}return _0x39b8f6;},_0x141130=await batchAsync(_0x3b5718,_0x5708eb,_0x24c29c),_0x215be9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x24b0d5 of _0x141130){_0x215be9[_0x210b15(0x147)]+=_0x24b0d5[_0x210b15(0x147)],_0x215be9[_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x1ea)],_0x24b0d5['createdSegmentId']&&_0x215be9[_0x210b15(0x150)][_0x210b15(0x17c)](_0x24b0d5['createdSegmentId'][_0x210b15(0x169)],_0x24b0d5[_0x210b15(0x172)]['id']),_0x215be9[_0x210b15(0x116)][_0x210b15(0x147)]+=_0x24b0d5['activations'][_0x210b15(0x147)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x116)][_0x210b15(0x1ea)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x13e)]+=_0x24b0d5[_0x210b15(0x116)]['deleted'];}return _0x215be9;}async function syncActivationsForSegment(_0x41cd76,_0xd63a9f,_0x139df7,_0x2e08a5,_0x343277,_0x31b436,_0x2d600b){const _0x5a3acd=a142_0x469651,_0x56f907={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x403f46 of _0x343277){try{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1be)&&_0x403f46[_0x5a3acd(0x128)])_0x31b436['onProgress']?.({'type':_0x5a3acd(0x170),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1e0)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)][_0x5a3acd(0x198)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x151),'segmentName':_0x2e08a5,'activationName':_0x403f46['name']}),_0x31b436[_0x5a3acd(0x13f)]?.(_0x5a3acd(0x1f6)+_0x403f46[_0x5a3acd(0x169)]+'\x27'),_0x56f907['created']++;else{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1c7)&&_0x403f46[_0x5a3acd(0x128)]&&_0x403f46['existingActivation'])_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x141),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x126)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)]['updateActivation'](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'],_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x16b),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logSuccess']?.(_0x5a3acd(0x194)+_0x403f46['name']+'\x27'),_0x56f907['updated']++;else _0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1dd)&&_0x403f46[_0x5a3acd(0x19a)]&&(_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x20d),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1a7)+_0x403f46['name']+_0x5a3acd(0x15e),()=>_0x41cd76['segment'][_0x5a3acd(0x20b)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x131),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logDeleted']?.(_0x5a3acd(0x1d4)+_0x403f46['name']+'\x27'),_0x56f907[_0x5a3acd(0x13e)]++);}}catch(_0xec65ef){const _0x59ebe0=isHttp400Error(_0xec65ef),_0x2dc913=_0x59ebe0?ErrorCode[_0x5a3acd(0x1f3)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x26dc05=getErrorMessage(_0xec65ef);throw new SDKError(_0x2dc913,'Failed\x20to\x20'+_0x403f46[_0x5a3acd(0x17d)]+'\x20activation\x20\x27'+_0x403f46[_0x5a3acd(0x169)]+'\x27\x20from\x20file:\x20'+_0x2d600b+'\x0a\x20\x20'+_0x26dc05,_0xec65ef);}}return _0x56f907;}export async function executePushFolders(_0x78b3ac,_0x5e3c42,_0x2f1e2d,_0x28998e,_0x4874ba){const _0x31fcdb=a142_0x469651,_0x29b49e=new Map(_0x2f1e2d),_0x1bb309=sortFoldersByDepth(_0x5e3c42);for(const _0x2b1c90 of _0x1bb309){const _0x3f15d4=_0x2b1c90[_0x31fcdb(0x214)]('/'),_0x803694=_0x3f15d4[_0x3f15d4['length']-0x1],_0x317a9f=_0x3f15d4[_0x31fcdb(0x19b)](0x0,-0x1)[_0x31fcdb(0x1c0)]('/'),_0x50eda4=_0x29b49e[_0x31fcdb(0x15d)](_0x317a9f);_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ef),'folder':_0x2b1c90});const _0x1e1675={'name':_0x803694,'parentFolderId':_0x50eda4},_0x549fb1=await _0x4874ba['withProgress'](_0x31fcdb(0x186)+_0x2b1c90+_0x31fcdb(0x15e),()=>_0x78b3ac[_0x31fcdb(0x1c9)]['createFolder'](_0x28998e[_0x31fcdb(0x1e9)],_0x1e1675));_0x29b49e[_0x31fcdb(0x17c)](_0x2b1c90,_0x549fb1[_0x31fcdb(0x143)]['id']),_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ff),'folder':_0x2b1c90,'folderId':_0x549fb1[_0x31fcdb(0x143)]['id']}),_0x4874ba[_0x31fcdb(0x1e3)]?.(_0x31fcdb(0x1fc)+_0x2b1c90+'\x27');}return _0x29b49e;}export async function executePushSegmentDeletions(_0x22170f,_0x15ee79,_0x19ec0b){const _0x2d1ddb=a142_0x469651;if(_0x15ee79[_0x2d1ddb(0x163)]===0x0)return 0x0;const {batchAsync:_0x341c17}=await import('../../utils/async.js'),_0x4b3198=0x5,_0x40dbac=await _0x341c17(_0x15ee79,async _0x13176b=>{const _0x319caf=_0x2d1ddb;return _0x19ec0b[_0x319caf(0x189)]?.({'type':'segment_deleting','name':_0x13176b[_0x319caf(0x169)]}),await _0x22170f[_0x319caf(0x1c9)][_0x319caf(0x1cb)](_0x13176b['id']),_0x19ec0b[_0x319caf(0x189)]?.({'type':_0x319caf(0x1c8),'name':_0x13176b[_0x319caf(0x169)]}),_0x19ec0b[_0x319caf(0x1d7)]?.(_0x319caf(0x19d)+_0x13176b['name']+'\x27'),0x1;},_0x4b3198);return _0x40dbac['reduce']((_0xf9c909,_0xa28a33)=>_0xf9c909+_0xa28a33,0x0);}export async function executePushJourneys(_0x465a1f,_0x3819f2,_0x57f1c5,_0x559fed,_0x22d484){const _0x117db9=a142_0x469651,{journeyDefToRequest:_0x441766}=await import(_0x117db9(0x1a2)),{activationDefToCreateRequest:_0x5c83b0,yamlRuleToApi:_0x2b70c6,validateSegmentRule:_0x476e99}=await import(_0x117db9(0x119)),_0x908a3d={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2578c0=new Map(_0x57f1c5[_0x117db9(0x176)]),_0x36af2b=0x5;for(let _0x2bc760=0x0;_0x2bc760<_0x3819f2[_0x117db9(0x163)];_0x2bc760+=_0x36af2b){const _0x2310a0=_0x3819f2[_0x117db9(0x19b)](_0x2bc760,_0x2bc760+_0x36af2b),_0x1bb139=await Promise[_0x117db9(0x14f)](_0x2310a0['map'](async _0x940c30=>{const _0x1fc042=_0x117db9;if(!_0x940c30[_0x1fc042(0x213)]&&!_0x940c30[_0x1fc042(0x1c6)])return{'action':_0x1fc042(0x117),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x940c30[_0x1fc042(0x1ce)]?.['id']};const _0x17669e=_0x940c30[_0x1fc042(0x183)]?_0x57f1c5[_0x1fc042(0x168)]['get'](_0x940c30['folderPath']):undefined;_0x22d484[_0x1fc042(0x189)]?.({'type':_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1b2):_0x1fc042(0x1a6),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]});try{const _0x55884e=await executeSingleJourneyPush(_0x465a1f,_0x940c30,{..._0x57f1c5,'segmentNameToId':_0x2578c0},{'parentId':_0x559fed[_0x1fc042(0x1e9)],'rootFolderId':_0x559fed[_0x1fc042(0x19e)],'folderId':_0x17669e,'verbose':_0x559fed[_0x1fc042(0x1e8)]},_0x22d484,{'journeyDefToRequest':_0x441766,'activationDefToCreateRequest':_0x5c83b0,'yamlRuleToApi':_0x2b70c6,'validateSegmentRule':_0x476e99});for(const [_0x58d672,_0x4af458]of _0x55884e[_0x1fc042(0x209)]){_0x2578c0['set'](_0x58d672,_0x4af458),_0x908a3d[_0x1fc042(0x209)]['set'](_0x58d672,_0x4af458);}if(_0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x147))_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x20e),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x55884e[_0x1fc042(0x175)]}),_0x22d484['logSuccess']?.(_0x1fc042(0x1bd)+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x147)]++;else _0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x1ea)&&(_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x18c),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]}),_0x22d484[_0x1fc042(0x13f)]?.('Updated\x20journey\x20\x27'+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x1ea)]++);return{'action':_0x55884e[_0x1fc042(0x1d6)],'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)],'journeyId':_0x55884e[_0x1fc042(0x175)]};}catch(_0x58f887){const _0x1d697d=isHttp400Error(_0x58f887),_0x1dd67d=_0x1d697d?ErrorCode[_0x1fc042(0x15b)]:ErrorCode[_0x1fc042(0x1fb)],_0x365785=getErrorMessage(_0x58f887);throw new SDKError(_0x1dd67d,_0x1fc042(0x139)+(_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1be):'update')+_0x1fc042(0x16f)+_0x940c30[_0x1fc042(0x135)]+_0x1fc042(0x216)+_0x365785,_0x58f887);}}));_0x908a3d[_0x117db9(0x205)]['push'](..._0x1bb139);}return _0x908a3d;}function a142_0x5e0e(){const _0x25158c=['push','list','Segment\x20not\x20found:\x20','valid','createSegment','Deleted\x20activation\x20\x27','toLowerCase','action','logDeleted','utf-8','yamlActivation','withProgress','Activation','description','delete','uniqueServerName','651783QIlbTg','Creating\x20activation\x20\x27','message','localName','logInfo','entry_criteria','journeys','.$1.push-recovery.json','flatMap','verbose','parentId','updated','segmentFolderId','segment_updating','connectionIdToNameMap','schedule','folder_creating','journeyBundleId','relationships','DecisionPoint','ACTIVATION_SYNTAX_ERROR','add','fetchJourney','Created\x20activation\x20\x27','state','match','activationActions','\x20segment\x20from\x20file:\x20','JOURNEY_UPDATE_ERROR','Created\x20folder\x20\x27','activationsBySegmentId','1341150QahPEo','folder_created','run_after_journey_refresh','Failed\x20to\x20fetch\x20referenced\x20segment\x20','36sMAWPn','columns','Matched\x20server\x20segment\x20\x27','results','journeyStages','segmentId','segments','embeddedSegmentNameToId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','deleteActivation','Segment\x20not\x20found','activation_deleting','journey_created','values','stages','SEGMENT_SYNTAX_ERROR','SEGMENT_NOT_FOUND','isNew','split','Delete\x20the\x20push\x20recovery\x20file\x20(','\x0a\x20\x20','NOT_FOUND','Activation\x20not\x20found:\x20','sort','1173260LSxdtC','Creating\x20segment\x20\x27','activations','unchanged','resolveSegment','./child-segment-yaml.js','3058xuRnuk','stringify','segment_created','folderId','getSegmentEntity','keys','connection','user','item','index','__pending_','Updated\x20segment\x20\x27','Updating\x20activation\x20\x27','existingSegments','validatedRequest','104lCWlXq','__pending_act_','conditionTimeoutDuration','replace','diff','idToEmailMap','26880luKBBE','journey','activation_deleted','parse','\x27\x20decision\x20point\x20branch\x20\x27','all_columns','absolutePath','idToName','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','and\x20the\x20server\x20segment,\x20then\x20retry.','Failed\x20to\x20','INTERNAL','entryCriteria','find','sha1','deleted','logSuccess','debug','activation_updating','updateSegmentById','data','activationParams','journey_entry_criteria_','tdx.sdk.push-workflow','created','getLatestJourneyId','stage\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_updated','\x27\x20milestone','\x27\x20not\x20found\x20in\x20journey\x20\x27','Entry\x20criteria:\x20','all','createdSegmentIds','activation_created','skipSegments','activation_template_id','goal','branches','hex','\x27\x20exit\x20criteria','\x27\x20from\x20file:\x20','createJourneySegment','size','JOURNEY_SYNTAX_ERROR','entry','get','\x27...','getActivation','activationStepsById','notification','../../utils/async.js','length','Condition','nameToType','versionNumber','deps','folderPathToId','name','waitStepType','activation_updated','uniqueSegmentName','connector_config','existingSegment','\x20journey\x20from\x20file:\x20','activation_creating','includes','createdSegmentId','145192eliHSl','milestone','journeyId','segmentNameToId','\x27\x20wait\x20condition','waitStep','nameToId','embedded_segment_created','\x27\x20to\x20local\x20\x27','set','type','journeyBundleName','\x20(referenced\x20in\x20journey\x20','day','\x27\x20for\x20','Embedded\x20segment\x20\x27','folderPath','goal\x20criteria','max','Creating\x20folder\x20\x27','progress','entries','onProgress','embedded_segment_creating','with','journey_updated','Failed\x20to\x20resolve\x20activation\x20','journeyById','isArray','getJourney','Stage\x20\x27','behavior','activationContext','Updated\x20activation\x20\x27','listActivations','journeyActivationStepId','Created\x20segment\x20\x27','createActivation','10iCkJqs','existingActivation','slice','filter','Deleted\x20segment\x20\x27','rootFolderId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','rule','decision_point','./journey-yaml.js','Fetching\x20','394891pjvbxw','parentSegmentFolder','journey_updating','Deleting\x20activation\x20\x27','digest','map','conditionSegmentId','attributes','conditionTimeoutUnit','conditions','parentFolder','waitStepUnit','relative','yamlConfig','journey_creating','has','startsWith','null','Name\x20has\x20already\x20been\x20taken','160335owsVRQ','WaitStep','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','segment_creating','steps','journeyName','Created\x20journey\x20\x27','create','Updating\x20segment\x20\x27','join','activation_','from','exitCriterias','parseDocument','some','hasChanges','update','segment_deleted','segment','resolvedRule','deleteSegment','toISOString','Journey\x20\x27','existingJourney'];a142_0x5e0e=function(){return _0x25158c;};return a142_0x5e0e();}async function matchExistingJourneySegments(_0xacf75e,_0x5d2b72,_0x3d6e70,_0x1ad67f,_0x551aa4){const _0x20dd8f=a142_0x469651;if(!_0x5d2b72[_0x20dd8f(0x1ce)]||!_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x208)])return;const _0x3e2036=new Map(),_0x4c512f=new Set();for(const _0x2b4555 of Object[_0x20dd8f(0x11f)](_0x5d2b72['yamlConfig']['segments'])){const _0x5659a5=generateDeterministicJourneySegmentName(_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x169)],_0x2b4555);_0x3e2036[_0x20dd8f(0x17c)](_0x5659a5,_0x2b4555),_0x4c512f[_0x20dd8f(0x1f4)](_0x2b4555);}const _0x96a302=[],_0xd2ef4d=collectSegmentIdsFromJourneyApi(_0x5d2b72[_0x20dd8f(0x1ce)]);for(const _0x28d909 of _0xd2ef4d){const _0x503c95=await fetchSegment(_0xacf75e,_0x3d6e70,_0x28d909,_0x1ad67f);if(!_0x503c95?.['name'])continue;const _0x4cccc7=_0x3e2036[_0x20dd8f(0x15d)](_0x503c95[_0x20dd8f(0x169)]);_0x4cccc7?(_0x551aa4[_0x20dd8f(0x17c)](_0x4cccc7,_0x28d909),_0x4c512f[_0x20dd8f(0x1dd)](_0x4cccc7)):_0x96a302['push']({'id':_0x28d909,'seg':_0x503c95});}if(_0x4c512f[_0x20dd8f(0x15a)]>0x0&&_0x96a302['length']>0x0){const {localExpandedRuleToNames:_0x40339d}=buildLocalExpandedRuleMappings(_0x5d2b72['yamlConfig']),_0x3cc84d=new Map();for(const {id:_0x986fa7,seg:_0x420576}of _0x96a302){if(_0x420576[_0x20dd8f(0x1a0)]){const _0x55c860=apiRuleToYaml(_0x420576[_0x20dd8f(0x1a0)]);_0x3cc84d['set'](_0x986fa7,_0x55c860);}}for(const {id:_0x2ca11b,seg:_0xbded35}of _0x96a302){if(!_0xbded35[_0x20dd8f(0x1a0)])continue;const _0x297c62=_0x3cc84d['get'](_0x2ca11b);if(!_0x297c62)continue;const _0x402a2a=serializeExpandedRule(_0x297c62,_0x3cc84d),_0x2aad22=_0x40339d[_0x20dd8f(0x15d)](_0x402a2a);if(_0x2aad22){const _0x54f287=_0x2aad22[_0x20dd8f(0x13c)](_0x338ea2=>_0x4c512f['has'](_0x338ea2));_0x54f287&&(_0x551aa4['set'](_0x54f287,_0x2ca11b),_0x4c512f[_0x20dd8f(0x1dd)](_0x54f287),logger[_0x20dd8f(0x140)](_0x20dd8f(0x204)+_0xbded35['name']+_0x20dd8f(0x17b)+_0x54f287+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x5208b1,_0xc79c30,_0x56c4a5,_0x31089b,_0xadf956,_0x89e34){const _0x5c31f1=a142_0x469651,{journeyDefToRequest:_0x80555,activationDefToCreateRequest:_0x2d280b,yamlRuleToApi:_0x3f5555,validateSegmentRule:_0x25cc2a}=_0x89e34,_0x3c572f=new Map(),_0x134d4f=new Map();recoverSegmentIdsFromPushRecovery(_0xc79c30,_0x3c572f,_0x56c4a5[_0x5c31f1(0x176)]);const _0x30a32b=new Map(),_0x588975=new Map(),_0x3d79d1=new Map();let _0x48fadc;const _0x20e9cc=async()=>{const _0x51a6b4=_0x5c31f1;if(_0x48fadc)return;_0x48fadc=new Map();if(!_0xc79c30['existingJourney'])return;const _0x3951b0=await _0x5208b1[_0x51a6b4(0x130)][_0x51a6b4(0x195)](_0xc79c30[_0x51a6b4(0x1ce)]['id']);for(const _0x93e678 of _0x3951b0){const _0x1754ff=journeyActivationStepToYaml(_0x93e678,_0x56c4a5[_0x51a6b4(0x12e)],_0x56c4a5[_0x51a6b4(0x1ed)]),_0x92e7d4=activationSignature(_0x1754ff);!_0x48fadc[_0x51a6b4(0x1b3)](_0x92e7d4)&&_0x48fadc[_0x51a6b4(0x17c)](_0x92e7d4,_0x93e678['id']),_0x1754ff['name']&&_0x134d4f[_0x51a6b4(0x17c)](_0x1754ff['name'],_0x93e678['id']);}};await matchExistingJourneySegments(_0x5208b1,_0xc79c30,_0x31089b[_0x5c31f1(0x1e9)],_0x56c4a5[_0x5c31f1(0x127)],_0x56c4a5[_0x5c31f1(0x176)]);const _0x5ef7b5={'resolveSegmentId':async _0x49f5bb=>{const _0x10be93=_0x5c31f1,_0x46f6fe=_0x56c4a5[_0x10be93(0x176)][_0x10be93(0x15d)](_0x49f5bb);if(!_0x46f6fe)throw new SDKError(ErrorCode[_0x10be93(0x212)],_0x10be93(0x1d1)+_0x49f5bb+_0x10be93(0x17f)+_0xc79c30[_0x10be93(0x1b1)][_0x10be93(0x169)]+')');return _0x46f6fe;},'resolveEmbeddedSegmentId':async(_0x2e684d,_0x4d343c)=>{const _0x2eaaf1=_0x5c31f1,_0x151146=_0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x15d)](_0x2e684d);if(_0x151146)return _0x151146;const _0x5b5ef3=_0x56c4a5[_0x2eaaf1(0x127)]['find'](_0x244848=>_0x244848[_0x2eaaf1(0x169)]===_0x2e684d);if(_0x5b5ef3)return _0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x17c)](_0x2e684d,_0x5b5ef3['id']),_0x5b5ef3['id'];if(_0xc79c30['isNew']){const {stageName:_0x41f0c5,criteriaName:_0x1748d1}=findSegmentCriteriaLocation(_0xc79c30[_0x2eaaf1(0x1b1)],_0x2e684d);return _0x25cc2a(_0x2e684d,_0x4d343c[_0x2eaaf1(0x1a0)]),_0x588975[_0x2eaaf1(0x17c)](_0x2e684d,{'definition':_0x4d343c,'stageName':_0x41f0c5,'criteriaName':_0x1748d1}),createPendingSegmentId(_0x2e684d);}const _0x3c86b2=_0xc79c30[_0x2eaaf1(0x1ce)]?.['id'];if(!_0x3c86b2)throw new SDKError(ErrorCode[_0x2eaaf1(0x13a)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x300292=_0x30a32b[_0x2eaaf1(0x15d)](_0x2e684d);if(_0x300292)return _0x300292;const _0x1a3d4a=((async()=>{const _0x4ad744=_0x2eaaf1;_0x25cc2a(_0x2e684d,_0x4d343c['rule']);const _0x4b4c99=generateDeterministicJourneySegmentName(_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d),_0xcbca0a=_0x56c4a5[_0x4ad744(0x127)][_0x4ad744(0x13c)](_0x249f59=>_0x249f59[_0x4ad744(0x169)]===_0x4b4c99),_0x24c567=createSegmentIdResolver(_0x56c4a5['segmentNameToId'],_0x2e684d),_0xe3d121=await resolveRuleSegmentIds(_0x4d343c[_0x4ad744(0x1a0)],_0x24c567);let _0x320e40;return _0xcbca0a?(await _0x5208b1['segment'][_0x4ad744(0x142)](_0x31089b[_0x4ad744(0x1e9)],_0xcbca0a['id'],{'description':_0x4d343c[_0x4ad744(0x1dc)]||'Entry\x20criteria:\x20'+_0x2e684d,'rule':_0x3f5555(_0xe3d121,!![]),'countPopulation':!![]}),_0x320e40=_0xcbca0a['id'],saveSegmentToPushRecovery(_0xc79c30['absolutePath'],_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d,{'segmentId':_0x320e40,'uniqueServerName':_0x4b4c99,'createdAt':new Date()['toISOString']()})):_0x320e40=await createOrRecoverEmbeddedSegment(_0x5208b1,_0xc79c30,{'localName':_0x2e684d,'uniqueSegmentName':_0x4b4c99,'description':_0x4d343c[_0x4ad744(0x1dc)]||_0x4ad744(0x14e)+_0x2e684d,'journeyId':_0x3c86b2,'resolvedRule':_0xe3d121,'parentId':_0x31089b[_0x4ad744(0x1e9)],'folderId':_0x31089b[_0x4ad744(0x19e)]||''},_0x3f5555),_0x56c4a5['segmentNameToId'][_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x3c572f[_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x320e40;})());_0x30a32b[_0x2eaaf1(0x17c)](_0x2e684d,_0x1a3d4a);try{return await _0x1a3d4a;}finally{_0x30a32b['delete'](_0x2e684d);}},'resolveActivationId':async _0x556c26=>{const _0x440125=_0x5c31f1,_0xd04d3d=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0xd04d3d)return _0xd04d3d;if(_0xc79c30[_0x440125(0x1ce)]){await _0x20e9cc();const _0x5c20a9=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0x5c20a9)return _0x5c20a9;}throw new SDKError(ErrorCode[_0x440125(0x217)],_0x440125(0x112)+_0x556c26+_0x440125(0x17f)+_0xc79c30['yamlConfig'][_0x440125(0x169)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3f008,_0x3ba41d)=>{const _0x7fc5be=_0x5c31f1,_0x302501=_0x134d4f[_0x7fc5be(0x15d)](_0x3f008);if(_0x302501)return _0x302501;if(_0xc79c30[_0x7fc5be(0x213)])return _0x3d79d1[_0x7fc5be(0x17c)](_0x3f008,_0x3ba41d),createPendingActivationId(_0x3f008);if(_0xc79c30[_0x7fc5be(0x1ce)]){await _0x20e9cc();const _0x4fa23e=_0x134d4f[_0x7fc5be(0x15d)](_0x3ba41d[_0x7fc5be(0x169)]);if(_0x4fa23e)return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x4fa23e),_0x4fa23e;const _0x170f1d=activationSignature(_0x3ba41d),_0x39cfef=_0x48fadc?.['get'](_0x170f1d);if(_0x39cfef)return _0x134d4f['set'](_0x3f008,_0x39cfef),_0x39cfef;const _0x44e295=await _0x2d280b(_0x3ba41d,_0x56c4a5[_0x7fc5be(0x193)]),_0xbf2f4c={..._0x44e295,..._0x3ba41d[_0x7fc5be(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x3ba41d[_0x7fc5be(0x200)]}},_0x1efc2a=await _0x5208b1[_0x7fc5be(0x130)][_0x7fc5be(0x198)](_0xc79c30[_0x7fc5be(0x1ce)]['id'],_0xbf2f4c);return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x1efc2a['id']),_0x1efc2a['id'];}throw new SDKError(ErrorCode[_0x7fc5be(0x13a)],_0x7fc5be(0x137));},'resolveJourneyId':async _0x17928f=>{const _0x8f1720=_0x5c31f1;try{return await _0x5208b1[_0x8f1720(0x130)]['resolveJourneyId'](_0x31089b[_0x8f1720(0x1e9)],_0x17928f);}catch(_0xd1bea){throw new SDKError(ErrorCode[_0x8f1720(0x217)],_0x8f1720(0x1cd)+_0x17928f+_0x8f1720(0x1b9)+_0xc79c30[_0x8f1720(0x1b1)][_0x8f1720(0x169)]+'\x27)',_0xd1bea);}},'resolveStageId':async(_0x61ca62,_0x18509a)=>{const _0x1cef65=_0x5c31f1,_0x5df8b1=await _0x5208b1[_0x1cef65(0x130)]['getJourney'](_0x61ca62),_0x38996f=_0x5df8b1['attributes']['journeyStages'][_0x1cef65(0x13c)](_0x473b11=>_0x473b11['name'][_0x1cef65(0x1d5)]()===_0x18509a[_0x1cef65(0x1d5)]());if(!_0x38996f?.['id'])throw new SDKError(ErrorCode[_0x1cef65(0x217)],_0x1cef65(0x191)+_0x18509a+_0x1cef65(0x14d)+(_0x5df8b1[_0x1cef65(0x1ab)][_0x1cef65(0x17e)]||_0x5df8b1[_0x1cef65(0x1ab)]['name'])+'\x27');return _0x38996f['id'];}},_0x1ef27e=await _0x80555(_0xc79c30[_0x5c31f1(0x1b1)],_0x31089b[_0x5c31f1(0x1e9)],_0x5ef7b5),_0xf53c10=_0x31089b[_0x5c31f1(0x11d)]||_0x31089b[_0x5c31f1(0x19e)];_0xf53c10&&(_0x1ef27e[_0x5c31f1(0x1f1)]={'parentFolder':{'data':{'id':_0xf53c10,'type':'folder'}}});if(_0xc79c30[_0x5c31f1(0x213)]){if(_0x588975[_0x5c31f1(0x15a)]>0x0||_0x3d79d1[_0x5c31f1(0x15a)]>0x0)return await executeThreeStepJourneyCreate(_0x5208b1,_0xc79c30,_0x1ef27e,{'pendingEmbeddedSegments':_0x588975,'pendingEmbeddedActivations':_0x3d79d1,'embeddedSegmentNameToId':_0x3c572f,'journeyActivationNameToId':_0x134d4f},{..._0x31089b,'effectiveFolderId':_0xf53c10},_0x56c4a5,_0xadf956,_0x89e34);else{ensureJourneyDefaults(_0x1ef27e[_0x5c31f1(0x1ab)]);const _0x4c571d=await _0x5208b1[_0x5c31f1(0x130)][_0x5c31f1(0x1be)](_0x1ef27e);return deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x147),'journeyId':_0x4c571d['id'],'embeddedSegmentNameToId':_0x3c572f};}}else{if(_0xc79c30[_0x5c31f1(0x1c6)]&&_0xc79c30[_0x5c31f1(0x1ce)]){_0x1ef27e['id']=_0xc79c30['existingJourney']['id'];const _0x128fe6=_0x1ef27e[_0x5c31f1(0x1ab)];_0xc79c30['existingJourney'][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x17e)]&&(_0x128fe6[_0x5c31f1(0x17e)]=_0xc79c30['existingJourney']['attributes'][_0x5c31f1(0x17e)]);const _0x3e4fac=_0xc79c30[_0x5c31f1(0x1ce)][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x206)];return _0x3e4fac&&_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)]&&injectExistingStageIds(_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)],_0x3e4fac),ensureJourneyDefaults(_0x128fe6),await _0x5208b1[_0x5c31f1(0x130)]['update'](_0xc79c30[_0x5c31f1(0x1ce)]['id'],_0x1ef27e),deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x1ea),'journeyId':_0xc79c30['existingJourney']['id'],'embeddedSegmentNameToId':_0x3c572f};}}return deletePushRecovery(_0xc79c30['absolutePath']),{'action':_0x5c31f1(0x117),'journeyId':_0xc79c30[_0x5c31f1(0x1ce)]?.['id'],'embeddedSegmentNameToId':_0x3c572f};}function findSegmentCriteriaLocation(_0x43f4e6,_0x134e2c){const _0x391154=a142_0x469651,_0x65b639=_0x43f4e6[_0x391154(0x210)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.['stages']||[];let _0x474a9a=_0x391154(0x15c),_0x4551bb=_0x134e2c;const _0xd4dc28=_0x43f4e6[_0x391154(0x154)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.[_0x391154(0x154)];if(_0xd4dc28?.[_0x391154(0x1c9)]===_0x134e2c)return{'stageName':_0x391154(0x154),'criteriaName':_0xd4dc28[_0x391154(0x169)]||_0x134e2c};_0x40ad69:for(const _0x3074f0 of _0x65b639){if(_0x3074f0[_0x391154(0x1e4)]?.[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0['name'],_0x4551bb=_0x3074f0['entry_criteria'][_0x391154(0x169)]||_0x134e2c;break;}if(_0x3074f0['steps'])for(const _0x526134 of _0x3074f0[_0x391154(0x1bb)]){if(_0x526134['type']===_0x391154(0x1a1)&&_0x526134['with']?.[_0x391154(0x155)])for(const _0x3b2417 of _0x526134[_0x391154(0x18b)][_0x391154(0x155)]){if(_0x3b2417[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0[_0x391154(0x169)],_0x4551bb=_0x3b2417['name']||_0x134e2c;break _0x40ad69;}}}}return{'stageName':_0x474a9a,'criteriaName':_0x4551bb};}async function executeThreeStepJourneyCreate(_0x3dc8e3,_0x1a7c1c,_0x570033,_0x5d5e55,_0x2fea0f,_0x531a4c,_0x34cf38,_0x4ccb75){const _0xd9d129=a142_0x469651,{activationDefToCreateRequest:_0x4de568,yamlRuleToApi:_0x5be04c}=_0x4ccb75,{pendingEmbeddedSegments:_0x4cd59b,pendingEmbeddedActivations:_0x477c39,embeddedSegmentNameToId:_0x4c4771}=_0x5d5e55,_0x42aefa=JSON['parse'](JSON[_0xd9d129(0x11b)](_0x570033));ensureJourneyDefaults(_0x42aefa[_0xd9d129(0x1ab)]),stripPendingIds(_0x42aefa);const _0x56c634=await _0x3dc8e3['journey'][_0xd9d129(0x1be)](_0x42aefa),_0x129956=_0x56c634['id'],_0x373a04=new Map();for(const _0x29e8ae of _0x56c634[_0xd9d129(0x1ab)]['journeyStages']){_0x373a04[_0xd9d129(0x17c)](_0x29e8ae[_0xd9d129(0x169)][_0xd9d129(0x1d5)](),_0x29e8ae['id']);}recoverSegmentIdsFromPushRecovery(_0x1a7c1c,_0x4c4771,_0x531a4c['segmentNameToId']);for(const [_0x37a118,{definition:_0x5de882}]of _0x4cd59b){if(_0x4c4771[_0xd9d129(0x1b3)](_0x37a118)){_0x34cf38['onProgress']?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'segmentName':_0x37a118});continue;}const _0x5395f4=generateDeterministicJourneySegmentName(_0x1a7c1c['yamlConfig'][_0xd9d129(0x169)],_0x37a118);_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x18a),'journeyName':_0x1a7c1c['yamlConfig']['name'],'segmentName':_0x37a118});const _0x337c50=createSegmentIdResolver(_0x531a4c[_0xd9d129(0x176)],_0x37a118),_0x2acf27=await resolveRuleSegmentIds(_0x5de882[_0xd9d129(0x1a0)],_0x337c50),_0x581d99=await createOrRecoverEmbeddedSegment(_0x3dc8e3,_0x1a7c1c,{'localName':_0x37a118,'uniqueSegmentName':_0x5395f4,'description':_0x5de882[_0xd9d129(0x1dc)]||'Entry\x20criteria:\x20'+_0x37a118,'journeyId':_0x129956,'resolvedRule':_0x2acf27,'parentId':_0x2fea0f[_0xd9d129(0x1e9)],'folderId':_0x2fea0f['effectiveFolderId']||''},_0x5be04c);_0x4c4771[_0xd9d129(0x17c)](_0x37a118,_0x581d99),_0x531a4c[_0xd9d129(0x176)]['set'](_0x37a118,_0x581d99),_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'segmentName':_0x37a118});}const _0x216d96=new Map();for(const [_0x5c6194,_0x307c72]of _0x477c39){_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_creating','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'activationName':_0x5c6194});const _0x4fccfa=await _0x4de568(_0x307c72,_0x531a4c[_0xd9d129(0x193)]),_0x1b7974={..._0x4fccfa,..._0x307c72[_0xd9d129(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x307c72[_0xd9d129(0x200)]}},_0xca1eb5=await _0x3dc8e3[_0xd9d129(0x130)][_0xd9d129(0x198)](_0x129956,_0x1b7974);_0x216d96[_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x5d5e55['journeyActivationNameToId'][_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_created','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'activationName':_0x5c6194});}const _0x7fccc7=JSON[_0xd9d129(0x132)](JSON[_0xd9d129(0x11b)](_0x570033));return _0x7fccc7['id']=_0x129956,ensureJourneyDefaults(_0x7fccc7[_0xd9d129(0x1ab)]),resolvePendingIdsInRequest(_0x7fccc7,_0x570033,_0x373a04,_0x4c4771,_0x216d96,_0x34cf38),await _0x3dc8e3['journey'][_0xd9d129(0x1c7)](_0x129956,_0x7fccc7),deletePushRecovery(_0x1a7c1c[_0xd9d129(0x135)]),{'action':_0xd9d129(0x147),'journeyId':_0x129956,'embeddedSegmentNameToId':_0x4c4771};}export function stripWaitStepPendingIds(_0x3bc1a0){const _0x5202d9=a142_0x469651,_0x1b8348=_0x3bc1a0[_0x5202d9(0x1aa)]&&isPendingSegmentId(_0x3bc1a0[_0x5202d9(0x1aa)]),_0x507871=_0x3bc1a0[_0x5202d9(0x1ad)]?.[_0x5202d9(0x1c5)](_0x58b6a0=>_0x58b6a0[_0x5202d9(0x207)]&&isPendingSegmentId(_0x58b6a0['segmentId']));(_0x1b8348||_0x507871)&&(_0x3bc1a0[_0x5202d9(0x16a)]='Duration',_0x3bc1a0[_0x5202d9(0x178)]=0x1,_0x3bc1a0[_0x5202d9(0x1af)]=_0x5202d9(0x180),delete _0x3bc1a0['conditionSegmentId'],delete _0x3bc1a0['conditionTimeoutDuration'],delete _0x3bc1a0[_0x5202d9(0x1ac)],delete _0x3bc1a0[_0x5202d9(0x1ad)]);}function a142_0x3aac(_0x2b98f2,_0x3c4d93){_0x2b98f2=_0x2b98f2-0x112;const _0x5e0eb0=a142_0x5e0e();let _0x3aac58=_0x5e0eb0[_0x2b98f2];return _0x3aac58;}export function resolveWaitStepPendingIds(_0x314f77,_0x42675c,_0x3e68ad,_0x4266a5){const _0xe8a821=a142_0x469651;if(_0x42675c[_0xe8a821(0x1aa)]&&isPendingSegmentId(_0x42675c[_0xe8a821(0x1aa)])){const _0x267553=_0x3e68ad(_0x42675c['conditionSegmentId'],_0xe8a821(0x149)+_0x4266a5+_0xe8a821(0x177));_0x267553&&(_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1aa)]=_0x267553,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77['waitStepUnit'],_0x42675c[_0xe8a821(0x12b)]!==undefined&&(_0x314f77[_0xe8a821(0x12b)]=_0x42675c['conditionTimeoutDuration']),_0x42675c[_0xe8a821(0x1ac)]&&(_0x314f77[_0xe8a821(0x1ac)]=_0x42675c[_0xe8a821(0x1ac)]));}if(_0x42675c[_0xe8a821(0x1ad)]){const _0x59fa05=_0x42675c['conditions'][_0xe8a821(0x1c5)](_0x428f88=>_0x428f88[_0xe8a821(0x207)]&&isPendingSegmentId(_0x428f88[_0xe8a821(0x207)]));if(_0x59fa05){const _0x422f46=_0x42675c['conditions'][_0xe8a821(0x1a9)](_0x5b9ad3=>{const _0x476360=_0xe8a821;if(_0x5b9ad3['segmentId']&&isPendingSegmentId(_0x5b9ad3['segmentId'])){const _0x40a4a=_0x3e68ad(_0x5b9ad3[_0x476360(0x207)],'stage\x20\x27'+_0x4266a5+_0x476360(0x177));return{..._0x5b9ad3,'segmentId':_0x40a4a||_0x5b9ad3[_0x476360(0x207)]};}return{..._0x5b9ad3};});_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1ad)]=_0x422f46,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77[_0xe8a821(0x1af)],delete _0x314f77[_0xe8a821(0x1aa)],delete _0x314f77[_0xe8a821(0x12b)],delete _0x314f77[_0xe8a821(0x1ac)];}}}function stripPendingIds(_0x162071){const _0x4ee1a5=a142_0x469651;_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)][_0x4ee1a5(0x207)])&&delete _0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)];for(const _0x1c7d14 of _0x162071['attributes'][_0x4ee1a5(0x206)]||[]){_0x1c7d14[_0x4ee1a5(0x13b)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x13b)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x13b)];_0x1c7d14[_0x4ee1a5(0x174)]?.['segmentId']&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x174)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x174)];_0x1c7d14[_0x4ee1a5(0x1c3)]&&(_0x1c7d14['exitCriterias']=_0x1c7d14[_0x4ee1a5(0x1c3)][_0x4ee1a5(0x19c)](_0x18687f=>!_0x18687f['segmentId']||!isPendingSegmentId(_0x18687f[_0x4ee1a5(0x207)])));if(_0x1c7d14[_0x4ee1a5(0x1bb)])for(const _0x25ce59 of Object['keys'](_0x1c7d14[_0x4ee1a5(0x1bb)])){const _0x5e0c80=_0x1c7d14[_0x4ee1a5(0x1bb)][_0x25ce59];_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1db)&&_0x5e0c80['journeyActivationStepId']&&isPendingActivationId(_0x5e0c80[_0x4ee1a5(0x196)])&&(_0x5e0c80[_0x4ee1a5(0x196)]='');if(_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1f2)&&_0x5e0c80['branches'])for(const _0x215704 of _0x5e0c80[_0x4ee1a5(0x155)]){_0x215704['segmentId']&&isPendingSegmentId(_0x215704[_0x4ee1a5(0x207)])&&(_0x215704[_0x4ee1a5(0x207)]='');}_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1b8)&&stripWaitStepPendingIds(_0x5e0c80);}}}function resolvePendingIdsInRequest(_0x59eb7e,_0x72bd,_0x292a9a,_0x826b22,_0x323967,_0x487459){const _0x552240=a142_0x469651,_0x333cfa=(_0x563959,_0x41cdf8)=>{const _0x57e520=a142_0x3aac;if(!isPendingSegmentId(_0x563959))return _0x563959;const _0x452bac=extractPendingSegmentName(_0x563959),_0x46251c=_0x826b22[_0x57e520(0x15d)](_0x452bac);return!_0x46251c&&_0x487459['logWarning']?.(_0x57e520(0x19f)+_0x452bac+_0x57e520(0x181)+_0x41cdf8),_0x46251c;};if(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)]?.['segmentId']&&isPendingSegmentId(_0x59eb7e[_0x552240(0x1ab)]['goal'][_0x552240(0x207)])){const _0x187bc5=_0x333cfa(_0x59eb7e['attributes'][_0x552240(0x154)][_0x552240(0x207)],_0x552240(0x184));_0x187bc5&&(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)][_0x552240(0x207)]=_0x187bc5);}for(const _0x570098 of _0x59eb7e[_0x552240(0x1ab)]['journeyStages']||[]){const _0x5ed57e=_0x292a9a['get'](_0x570098['name'][_0x552240(0x1d5)]());_0x5ed57e&&(_0x570098['id']=_0x5ed57e);if(_0x570098[_0x552240(0x13b)]?.[_0x552240(0x207)]&&isPendingSegmentId(_0x570098[_0x552240(0x13b)][_0x552240(0x207)])){const _0x5e4f10=_0x333cfa(_0x570098['entryCriteria'][_0x552240(0x207)],'stage\x20\x27'+_0x570098['name']+'\x27\x20entry\x20criteria');_0x5e4f10&&(_0x570098[_0x552240(0x13b)][_0x552240(0x207)]=_0x5e4f10);}if(_0x570098['exitCriterias'])for(const _0x410532 of _0x570098['exitCriterias']){if(_0x410532[_0x552240(0x207)]&&isPendingSegmentId(_0x410532[_0x552240(0x207)])){const _0x4c7336=_0x333cfa(_0x410532[_0x552240(0x207)],'stage\x20\x27'+_0x570098[_0x552240(0x169)]+_0x552240(0x157));_0x4c7336&&(_0x410532[_0x552240(0x207)]=_0x4c7336);}}if(_0x570098[_0x552240(0x174)]?.['segmentId']&&isPendingSegmentId(_0x570098['milestone']['segmentId'])){const _0x5beb82=_0x333cfa(_0x570098[_0x552240(0x174)]['segmentId'],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x14c));_0x5beb82&&(_0x570098[_0x552240(0x174)]['segmentId']=_0x5beb82);}if(_0x570098[_0x552240(0x1bb)]){const _0x6767cc=_0x550e46=>_0x72bd[_0x552240(0x1ab)][_0x552240(0x206)]?.[_0x552240(0x13c)](_0x1a58c0=>_0x1a58c0[_0x552240(0x169)][_0x552240(0x1d5)]()===_0x570098[_0x552240(0x169)][_0x552240(0x1d5)]())?.[_0x552240(0x1bb)]?.[_0x550e46];for(const _0x164f60 of Object[_0x552240(0x11f)](_0x570098[_0x552240(0x1bb)])){const _0x3cd428=_0x570098[_0x552240(0x1bb)][_0x164f60],_0x32ac7f=_0x6767cc(_0x164f60);if(_0x3cd428['type']==='Activation'&&_0x3cd428['journeyActivationStepId']&&(isPendingActivationId(_0x3cd428[_0x552240(0x196)])||_0x3cd428[_0x552240(0x196)]==='')){if(_0x32ac7f?.[_0x552240(0x196)]&&isPendingActivationId(_0x32ac7f[_0x552240(0x196)])){const _0x23360b=extractPendingActivationName(_0x32ac7f[_0x552240(0x196)]),_0x1ce41c=_0x323967['get'](_0x23360b);_0x1ce41c&&(_0x3cd428[_0x552240(0x196)]=_0x1ce41c);}}if(_0x3cd428[_0x552240(0x17d)]===_0x552240(0x1f2)&&_0x3cd428['branches']&&_0x32ac7f?.[_0x552240(0x155)])for(let _0x6b6d59=0x0;_0x6b6d59<_0x3cd428[_0x552240(0x155)][_0x552240(0x163)];_0x6b6d59++){const _0x1d2b86=_0x3cd428[_0x552240(0x155)][_0x6b6d59],_0x4e23bb=_0x32ac7f['branches'][_0x6b6d59];if(_0x4e23bb?.[_0x552240(0x207)]&&isPendingSegmentId(_0x4e23bb[_0x552240(0x207)])){const _0xd2b383=_0x333cfa(_0x4e23bb[_0x552240(0x207)],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x133)+(_0x1d2b86[_0x552240(0x169)]||_0x6b6d59)+'\x27');_0xd2b383&&(_0x1d2b86[_0x552240(0x207)]=_0xd2b383);}}_0x3cd428['type']===_0x552240(0x1b8)&&_0x32ac7f?.[_0x552240(0x17d)]==='WaitStep'&&resolveWaitStepPendingIds(_0x3cd428,_0x32ac7f,_0x333cfa,_0x570098['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a143_0x54e1(_0x4da9ec,_0x2a9330){_0x4da9ec=_0x4da9ec-0xc3;const _0x57ddd7=a143_0x57dd();let _0x54e15c=_0x57ddd7[_0x4da9ec];return _0x54e15c;}(function(_0xba1141,_0x4e504c){const _0x49783b=a143_0x54e1,_0x13ad42=_0xba1141();while(!![]){try{const _0x4064f3=-parseInt(_0x49783b(0xd1))/0x1*(-parseInt(_0x49783b(0xc6))/0x2)+parseInt(_0x49783b(0xc4))/0x3*(parseInt(_0x49783b(0xce))/0x4)+-parseInt(_0x49783b(0xc9))/0x5+-parseInt(_0x49783b(0xcd))/0x6*(parseInt(_0x49783b(0xcb))/0x7)+-parseInt(_0x49783b(0xd2))/0x8+parseInt(_0x49783b(0xcc))/0x9+parseInt(_0x49783b(0xca))/0xa;if(_0x4064f3===_0x4e504c)break;else _0x13ad42['push'](_0x13ad42['shift']());}catch(_0x43424e){_0x13ad42['push'](_0x13ad42['shift']());}}}(a143_0x57dd,0x94ac2));function a143_0x57dd(){const _0xab8ebf=['has','add','2482410XFglEU','3430560pAtyYQ','4087489Eohzhc','8646129acNPGs','6xEdFqo','1170164SfICVR','set','name','505pwKrwj','8898200BzJbhb','parentFolderId','12hEfHiy','get','1298aFZaSQ'];a143_0x57dd=function(){return _0xab8ebf;};return a143_0x57dd();}export function buildFolderIdToPathMap(_0x3a7e0d){const _0x22f533=a143_0x54e1,_0x5d578f=new Map(),_0x417fe6=new Map();for(const _0x5b63b9 of _0x3a7e0d){_0x417fe6[_0x22f533(0xcf)](_0x5b63b9['id'],_0x5b63b9);}const _0x43483e=new Set();for(const _0x3e2896 of _0x3a7e0d){!_0x3e2896[_0x22f533(0xc3)]&&_0x43483e[_0x22f533(0xc8)](_0x3e2896['id']);}function _0x2791d2(_0x2a1a94){const _0x3e2297=_0x22f533;if(_0x5d578f['has'](_0x2a1a94['id']))return _0x5d578f[_0x3e2297(0xc5)](_0x2a1a94['id']);if(_0x43483e[_0x3e2297(0xc7)](_0x2a1a94['id']))return _0x5d578f['set'](_0x2a1a94['id'],''),'';if(_0x2a1a94[_0x3e2297(0xc3)]){const _0x1f5b10=_0x417fe6[_0x3e2297(0xc5)](_0x2a1a94[_0x3e2297(0xc3)]);if(_0x1f5b10){const _0x37a1be=_0x2791d2(_0x1f5b10),_0x422052=_0x37a1be?_0x37a1be+'/'+_0x2a1a94[_0x3e2297(0xd0)]:_0x2a1a94[_0x3e2297(0xd0)];return _0x5d578f[_0x3e2297(0xcf)](_0x2a1a94['id'],_0x422052),_0x422052;}}const _0x1631f0=_0x2a1a94[_0x3e2297(0xd0)];return _0x5d578f[_0x3e2297(0xcf)](_0x2a1a94['id'],_0x1631f0),_0x1631f0;}for(const _0x34d997 of _0x3a7e0d){_0x2791d2(_0x34d997);}return _0x5d578f;}export function buildFolderPathToIdMap(_0x3c4dd8){const _0x12131b=a143_0x54e1,_0x5263af=new Map(),_0x52dcb0=new Map();for(const _0xa0d6af of _0x3c4dd8){_0x52dcb0[_0x12131b(0xcf)](_0xa0d6af['id'],_0xa0d6af);}const _0x164ce8=new Set();for(const _0x4708d0 of _0x3c4dd8){!_0x4708d0[_0x12131b(0xc3)]&&_0x164ce8['add'](_0x4708d0['id']);}function _0x134528(_0xbc3d63){const _0x4d00ea=_0x12131b;if(_0x164ce8[_0x4d00ea(0xc7)](_0xbc3d63['id']))return'';if(_0xbc3d63[_0x4d00ea(0xc3)]){const _0x16a0e3=_0x52dcb0['get'](_0xbc3d63['parentFolderId']);if(_0x16a0e3){const _0x5983d7=_0x134528(_0x16a0e3);return _0x5983d7?_0x5983d7+'/'+_0xbc3d63[_0x4d00ea(0xd0)]:_0xbc3d63[_0x4d00ea(0xd0)];}}return _0xbc3d63['name'];}for(const _0x572355 of _0x3c4dd8){const _0x51f74a=_0x134528(_0x572355);_0x5263af[_0x12131b(0xcf)](_0x51f74a,_0x572355['id']);}return _0x5263af;}export function buildFolderMaps(_0x3ff2dd){const _0x236238=a143_0x54e1,_0x2af94d=buildFolderIdToPathMap(_0x3ff2dd),_0x3c1205=new Map();for(const [_0x129358,_0x2ba121]of _0x2af94d){_0x3c1205[_0x236238(0xcf)](_0x2ba121,_0x129358);}return{'idToPath':_0x2af94d,'pathToId':_0x3c1205};}export function getFolderPath(_0x335d64,_0x4bf948){const _0x387de7=a143_0x54e1;if(!_0x335d64)return'';return _0x4bf948[_0x387de7(0xc5)](_0x335d64)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x694631,_0x2d97af){const _0x5dda67=a144_0x3c03,_0x2d59bc=_0x694631();while(!![]){try{const _0x54809b=-parseInt(_0x5dda67(0x98))/0x1*(-parseInt(_0x5dda67(0x73))/0x2)+-parseInt(_0x5dda67(0x82))/0x3*(-parseInt(_0x5dda67(0x74))/0x4)+parseInt(_0x5dda67(0x87))/0x5*(parseInt(_0x5dda67(0x99))/0x6)+parseInt(_0x5dda67(0x7a))/0x7+-parseInt(_0x5dda67(0x91))/0x8+-parseInt(_0x5dda67(0x80))/0x9+parseInt(_0x5dda67(0x7c))/0xa*(-parseInt(_0x5dda67(0x8a))/0xb);if(_0x54809b===_0x2d97af)break;else _0x2d59bc['push'](_0x2d59bc['shift']());}catch(_0x31fc37){_0x2d59bc['push'](_0x2d59bc['shift']());}}}(a144_0x3de9,0x34c4a));import a144_0x3bbd29 from'path';import{parse as a144_0x3c12f0}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x1f6e36){const _0x217084=a144_0x3c03;if(!_0x1f6e36||_0x1f6e36[_0x217084(0x7f)]()==='')throw new Error(_0x217084(0x97));const _0x538a3d=_0x1f6e36[_0x217084(0x7f)]();if(_0x538a3d==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x1f6e36};const _0x108735=_0x538a3d[_0x217084(0x93)]('/')?_0x538a3d[_0x217084(0x89)](0x1):_0x538a3d,_0x3b64b4=_0x108735['split']('/')[_0x217084(0x78)](_0x496186=>_0x496186!=='');if(_0x3b64b4[_0x217084(0x9b)]===0x0)throw new Error(_0x217084(0x83));const _0x21c38c=_0x538a3d['startsWith']('/')||!isRelativePathSegment(_0x3b64b4[0x0]);for(const _0xdf891 of _0x3b64b4){validatePathSegment(_0xdf891);}return{'segments':_0x3b64b4,'isAbsolute':_0x21c38c,'raw':_0x1f6e36};}function a144_0x3de9(){const _0x23e9e9=['6XMDjVC','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','exists','parse','journey','10tpIZbK','pop','substring','4110227yOeegQ','type','readFile','resolve','Relative\x20path\x20cannot\x20be\x20empty','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','33912lXuweG','Path\x20segment\x20cannot\x20be\x20empty','startsWith','tdx.json','No\x20tdx.json\x20found\x20for\x20file:\x20','push','Path\x20cannot\x20be\x20empty','378413jbvZmW','823002ZoHUbY','.yml','length','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','raw','join','isAbsolute','parent_segment','2ydHrer','504440vxTEBu','dirname','Cannot\x20navigate\x20above\x20root','relative','filter','File\x20not\x20found:\x20','2139123tVgwrj','segments','20VkjNWO','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','.yaml','trim','2185785nqLbVM','endsWith'];a144_0x3de9=function(){return _0x23e9e9;};return a144_0x3de9();}function isRelativePathSegment(_0xa77d8d){return _0xa77d8d==='.'||_0xa77d8d==='..';}function a144_0x3c03(_0x1a70f8,_0x458cec){_0x1a70f8=_0x1a70f8-0x6f;const _0x3de902=a144_0x3de9();let _0x3c0373=_0x3de902[_0x1a70f8];return _0x3c0373;}function validatePathSegment(_0x19546f){const _0x35b843=a144_0x3c03;if(_0x19546f==='')throw new Error(_0x35b843(0x92));if(_0x19546f==='.'||_0x19546f==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x19546f))throw new Error(_0x35b843(0x8f)+_0x19546f);if(_0x19546f!==_0x19546f[_0x35b843(0x7f)]()){}}export function validatePath(_0x520f7d){const _0x36af3a=a144_0x3c03;if(_0x520f7d['segments'][_0x36af3a(0x9b)]===0x0&&!_0x520f7d['isAbsolute'])throw new Error(_0x36af3a(0x8e));if(_0x520f7d[_0x36af3a(0x71)]){if(_0x520f7d[_0x36af3a(0x7b)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x342562=0x0;for(const _0xfa79a2 of _0x520f7d[_0x36af3a(0x7b)]){if(_0xfa79a2==='..'){if(_0x342562===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x342562--;}else _0xfa79a2!=='.'&&_0x342562++;}}}export function joinPaths(_0x273b1c,_0x2f54c0){const _0x3b9d48=a144_0x3c03;if(!_0x273b1c||_0x273b1c==='/')return _0x2f54c0;if(!_0x2f54c0||_0x2f54c0==='.')return _0x273b1c;if(_0x2f54c0[_0x3b9d48(0x93)]('/'))return _0x2f54c0;const _0x3fcc65=parsePath(_0x273b1c),_0x1ec047=parsePath(_0x2f54c0),_0x2bc7c8=[..._0x3fcc65[_0x3b9d48(0x7b)]];for(const _0x3fe649 of _0x1ec047[_0x3b9d48(0x7b)]){if(_0x3fe649==='.')continue;else{if(_0x3fe649==='..'){if(_0x2bc7c8[_0x3b9d48(0x9b)]===0x0)throw new Error(_0x3b9d48(0x76));_0x2bc7c8[_0x3b9d48(0x88)]();}else _0x2bc7c8[_0x3b9d48(0x96)](_0x3fe649);}}const _0x339708=_0x2bc7c8['join']('/');return _0x3fcc65[_0x3b9d48(0x6f)][_0x3b9d48(0x93)]('/')?'/'+_0x339708:_0x339708;}export function normalizePath(_0x3acee3){const _0x5100ac=a144_0x3c03,_0x1d2892=parsePath(_0x3acee3),_0x52e015=[];for(const _0x33268b of _0x1d2892[_0x5100ac(0x7b)]){if(_0x33268b==='.')continue;else{if(_0x33268b==='..'){if(_0x52e015[_0x5100ac(0x9b)]===0x0){if(_0x1d2892[_0x5100ac(0x71)])throw new Error(_0x5100ac(0x76));_0x52e015[_0x5100ac(0x96)]('..');}else _0x52e015[_0x52e015[_0x5100ac(0x9b)]-0x1]==='..'?_0x52e015[_0x5100ac(0x96)]('..'):_0x52e015[_0x5100ac(0x88)]();}else _0x52e015[_0x5100ac(0x96)](_0x33268b);}}if(_0x52e015[_0x5100ac(0x9b)]===0x0)return _0x1d2892[_0x5100ac(0x71)]?'/':'.';const _0x542ed4=_0x52e015['join']('/');return _0x1d2892[_0x5100ac(0x6f)][_0x5100ac(0x93)]('/')?'/'+_0x542ed4:_0x542ed4;}export function getParentPath(_0x2c06d9){const _0x337e98=a144_0x3c03,_0x43daae=parsePath(_0x2c06d9);if(_0x43daae[_0x337e98(0x7b)][_0x337e98(0x9b)]<=0x1)return'/';const _0x48e127=_0x43daae[_0x337e98(0x7b)]['slice'](0x0,-0x1)[_0x337e98(0x70)]('/');return _0x43daae[_0x337e98(0x6f)][_0x337e98(0x93)]('/')?'/'+_0x48e127:_0x48e127;}export function getBaseName(_0x30548a){const _0x4017a1=a144_0x3c03,_0x4b4244=parsePath(_0x30548a);return _0x4b4244[_0x4017a1(0x7b)][_0x4b4244[_0x4017a1(0x7b)][_0x4017a1(0x9b)]-0x1]||'';}export function isChildPath(_0x1df960,_0x5738ce){const _0x3944e5=a144_0x3c03,_0x4a537=parsePath(_0x1df960),_0x288da6=parsePath(_0x5738ce);if(_0x4a537[_0x3944e5(0x7b)][_0x3944e5(0x9b)]<=_0x288da6[_0x3944e5(0x7b)][_0x3944e5(0x9b)])return![];for(let _0x382f63=0x0;_0x382f63<_0x288da6[_0x3944e5(0x7b)][_0x3944e5(0x9b)];_0x382f63++){if(_0x4a537[_0x3944e5(0x7b)][_0x382f63]!==_0x288da6['segments'][_0x382f63])return![];}return!![];}export function splitPath(_0x516f7a){const _0x5084e4=a144_0x3c03,_0x1028bb=parsePath(_0x516f7a);if(_0x1028bb[_0x5084e4(0x7b)]['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x1028bb[_0x5084e4(0x7b)][_0x5084e4(0x9b)]===0x1)return{'parent':_0x1028bb[_0x5084e4(0x7b)][0x0]};return{'parent':_0x1028bb['segments'][0x0],'child':_0x1028bb[_0x5084e4(0x7b)]['slice'](0x1)[_0x5084e4(0x70)]('/')};}export function isYamlFilePath(_0xa37ac8){const _0x4e112d=a144_0x3c03;return _0xa37ac8['endsWith'](_0x4e112d(0x9a))||_0xa37ac8[_0x4e112d(0x81)](_0x4e112d(0x7e));}export async function resolveYamlFilePath(_0x5f5622,_0x118ceb=nodeFileSystem){const _0x5e4e3e=a144_0x3c03,_0x5e0809=a144_0x3bbd29[_0x5e4e3e(0x8d)](_0x5f5622);if(!await _0x118ceb[_0x5e4e3e(0x84)](_0x5e0809))throw new Error(_0x5e4e3e(0x79)+_0x5f5622);let _0x33328e=a144_0x3bbd29['dirname'](_0x5e0809),_0x13d295=null,_0x19082b=null;const _0x39084d=a144_0x3bbd29[_0x5e4e3e(0x85)](_0x33328e)['root'];while(_0x33328e!==_0x39084d){const _0x2d9562=a144_0x3bbd29[_0x5e4e3e(0x70)](_0x33328e,_0x5e4e3e(0x94));if(await _0x118ceb[_0x5e4e3e(0x84)](_0x2d9562)){_0x13d295=_0x2d9562,_0x19082b=_0x33328e;break;}_0x33328e=a144_0x3bbd29[_0x5e4e3e(0x75)](_0x33328e);}if(!_0x13d295||!_0x19082b)throw new Error(_0x5e4e3e(0x95)+_0x5f5622+'\x0a'+_0x5e4e3e(0x9c));const _0x4d5d2e=await _0x118ceb[_0x5e4e3e(0x8c)](_0x13d295),_0x27f305=JSON['parse'](_0x4d5d2e),_0x357a18=_0x27f305[_0x5e4e3e(0x72)];if(!_0x357a18)throw new Error(_0x5e4e3e(0x90));const _0x439c33=await _0x118ceb[_0x5e4e3e(0x8c)](_0x5e0809),_0x1d73ea=a144_0x3c12f0(_0x439c33),_0x549718=_0x1d73ea['name'];if(!_0x549718)throw new Error(_0x5e4e3e(0x7d)+_0x5f5622);const _0x2b429b=_0x1d73ea[_0x5e4e3e(0x8b)]===_0x5e4e3e(0x86)?_0x5e4e3e(0x86):'segment',_0x54b0f9=a144_0x3bbd29[_0x5e4e3e(0x77)](_0x19082b,_0x5e0809),_0x425dfe=a144_0x3bbd29['dirname'](_0x54b0f9),_0x4ab2d9=_0x425dfe==='.'?'':_0x425dfe['replace'](/\\/g,'/'),_0x2d5030=_0x4ab2d9?_0x357a18+'/'+_0x4ab2d9+'/'+_0x549718:_0x357a18+'/'+_0x549718;return{'parentSegment':_0x357a18,'segmentName':_0x549718,'folderPath':_0x4ab2d9,'fullPath':_0x2d5030,'resourceType':_0x2b429b,'content':_0x439c33};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e51ab,_0x3be020){const _0x299d79=a145_0x4769,_0xc4eb98=_0x4e51ab();while(!![]){try{const _0x2a32e1=parseInt(_0x299d79(0x1ef))/0x1+-parseInt(_0x299d79(0x1f1))/0x2*(parseInt(_0x299d79(0x1f2))/0x3)+parseInt(_0x299d79(0x1e5))/0x4+parseInt(_0x299d79(0x1e6))/0x5+parseInt(_0x299d79(0x1f0))/0x6*(parseInt(_0x299d79(0x1ee))/0x7)+parseInt(_0x299d79(0x1ed))/0x8*(parseInt(_0x299d79(0x1ea))/0x9)+-parseInt(_0x299d79(0x1e8))/0xa*(parseInt(_0x299d79(0x1f3))/0xb);if(_0x2a32e1===_0x3be020)break;else _0xc4eb98['push'](_0xc4eb98['shift']());}catch(_0x5b5957){_0xc4eb98['push'](_0xc4eb98['shift']());}}}(a145_0x3308,0xb8f32));export function parseSegmentRef(_0x3aec31){const _0x5ddd4=a145_0x4769,_0x556ac6=_0x3aec31[_0x5ddd4(0x1ec)]('/');if(_0x556ac6===-0x1)return{'parentId':_0x3aec31};if(_0x556ac6===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x3aec31+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x23447f=_0x3aec31[_0x5ddd4(0x1e9)](0x0,_0x556ac6),_0x4dc3ab=_0x3aec31[_0x5ddd4(0x1e9)](_0x556ac6+0x1);if(_0x4dc3ab==='')throw new Error(_0x5ddd4(0x1e7)+_0x3aec31+_0x5ddd4(0x1eb));return{'parentId':_0x23447f,'childId':_0x4dc3ab};}function a145_0x4769(_0x25d77e,_0x5ec459){_0x25d77e=_0x25d77e-0x1e5;const _0x33080b=a145_0x3308();let _0x47696a=_0x33080b[_0x25d77e];return _0x47696a;}function a145_0x3308(){const _0x4703bb=['1088098LMnTCZ','3TsdKTs','121649mPGizM','5900512OrvVQy','6928520QqXlzi','Invalid\x20segment\x20reference\x20format:\x20','3170CEJugZ','substring','9sHgDIn','.\x20Child\x20name\x20cannot\x20be\x20empty','indexOf','1385768jqdqPH','14CbLkeT','1222841FcjUUj','1651236AqPCcy'];a145_0x3308=function(){return _0x4703bb;};return a145_0x3308();}
|