@treasuredata/tdx 2026.3.51 → 2026.3.52
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/work-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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.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.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.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/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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
|
-
const a151_0x2ed631=a151_0x5571;(function(_0x15ff81,_0x25ac25){const _0x39ec80=a151_0x5571,_0x2eee15=_0x15ff81();while(!![]){try{const _0xe5b872=parseInt(_0x39ec80(0x1fb))/0x1+parseInt(_0x39ec80(0x1c6))/0x2*(-parseInt(_0x39ec80(0x1c2))/0x3)+-parseInt(_0x39ec80(0x134))/0x4*(-parseInt(_0x39ec80(0x11e))/0x5)+-parseInt(_0x39ec80(0x186))/0x6*(parseInt(_0x39ec80(0x129))/0x7)+parseInt(_0x39ec80(0x20d))/0x8+parseInt(_0x39ec80(0x17f))/0x9*(-parseInt(_0x39ec80(0x11c))/0xa)+parseInt(_0x39ec80(0x1ff))/0xb*(parseInt(_0x39ec80(0x20a))/0xc);if(_0xe5b872===_0x25ac25)break;else _0x2eee15['push'](_0x2eee15['shift']());}catch(_0x1010f4){_0x2eee15['push'](_0x2eee15['shift']());}}}(a151_0x57e9,0xbee3e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x2ed631(0x14b));export const PENDING_SEGMENT_PREFIX=a151_0x2ed631(0x1a1);export const PENDING_ACTIVATION_PREFIX=a151_0x2ed631(0x13a);export function createPendingSegmentId(_0x2b4643){return''+PENDING_SEGMENT_PREFIX+_0x2b4643+'__';}export function isPendingSegmentId(_0x1e6863){const _0x58f24a=a151_0x2ed631;return _0x1e6863[_0x58f24a(0x131)](PENDING_SEGMENT_PREFIX)&&!_0x1e6863[_0x58f24a(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x58d5da){return _0x58d5da['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x26d196){return''+PENDING_ACTIVATION_PREFIX+_0x26d196+'__';}export function isPendingActivationId(_0x32eefe){const _0x6d57cb=a151_0x2ed631;return _0x32eefe[_0x6d57cb(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x29ae6c){const _0x30283c=a151_0x2ed631;return _0x29ae6c[_0x30283c(0x18d)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5d01fa,_0x20a553){const _0x4402f3=a151_0x2ed631,_0x40f5b3=_0x5d01fa+'::'+(_0x20a553[_0x4402f3(0x130)]()||_0x4402f3(0x1b9)),_0x1859f5=createHash(_0x4402f3(0x1d5))['update'](_0x40f5b3)[_0x4402f3(0x219)](_0x4402f3(0x19d))[_0x4402f3(0x205)](0x0,0xc);return'journey_entry_criteria_'+_0x1859f5;}export function ensureJourneyDefaults(_0x2fe0fd){const _0x556c87=a151_0x2ed631;!_0x2fe0fd['description']&&(_0x2fe0fd['description']=''),!_0x2fe0fd[_0x556c87(0x1f8)]&&(_0x2fe0fd[_0x556c87(0x1f8)]=_0x556c87(0x172));}export function injectExistingStageIds(_0x53fc21,_0x36e427){const _0x374c5d=a151_0x2ed631,_0x35e8be=new Map(_0x36e427[_0x374c5d(0x191)](_0x385314=>[_0x385314[_0x374c5d(0x17c)],_0x385314['id']]));for(const _0x7cecef of _0x53fc21){if(!_0x7cecef['id']){const _0x521094=_0x35e8be[_0x374c5d(0x1ac)](_0x7cecef[_0x374c5d(0x17c)]);_0x521094&&(_0x7cecef['id']=_0x521094);}}}export function resolveTDFolderPath(_0x4e9b29,_0x15637e,_0x3e6048){const _0x45193e=a151_0x2ed631;if(!_0x15637e)return _0x4e9b29;if(_0x4e9b29===_0x3e6048||_0x4e9b29[_0x45193e(0x131)](_0x3e6048+'/'))return _0x4e9b29;return _0x4e9b29?_0x3e6048+'/'+_0x4e9b29:_0x3e6048;}export function addFoldersToCreate(_0x4966e0,_0xe2255e,_0x299980){const _0x3874e7=a151_0x2ed631;if(!_0x4966e0)return;if(_0xe2255e[_0x3874e7(0x1b5)](_0x4966e0))return;const _0x13255b=_0x4966e0[_0x3874e7(0x13c)]('/');let _0x101902='';for(const _0xd1e9c2 of _0x13255b){_0x101902=_0x101902?_0x101902+'/'+_0xd1e9c2:_0xd1e9c2,!_0xe2255e['has'](_0x101902)&&_0x299980['add'](_0x101902);}}export function sortFoldersByDepth(_0x1c3e13){return[..._0x1c3e13]['sort']((_0x4157f5,_0x17e89d)=>{const _0x1c90f2=a151_0x5571,_0x2c4ee3=(_0x4157f5['match'](/\//g)||[])[_0x1c90f2(0x165)],_0x1d6802=(_0x17e89d[_0x1c90f2(0x187)](/\//g)||[])[_0x1c90f2(0x165)];return _0x2c4ee3-_0x1d6802;});}import*as a151_0x297b00 from'yaml';import{readFileSync}from'fs';import a151_0x574767 from'path';import{isJourneyDef,parseYamlString as a151_0x113781,toYamlString as a151_0x36b8c4,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(_0x346c3a){const _0xf72f14=a151_0x2ed631;if(Array[_0xf72f14(0x20f)](_0x346c3a))return'['+_0x346c3a[_0xf72f14(0x191)](_0x543cb0=>stableStringify(_0x543cb0))[_0xf72f14(0x1fe)](',')+']';if(_0x346c3a&&typeof _0x346c3a==='object'){const _0x254d7e=_0x346c3a,_0x1da62d=Object[_0xf72f14(0x197)](_0x254d7e)[_0xf72f14(0x158)](),_0x39879d=_0x1da62d[_0xf72f14(0x191)](_0xb4e890=>'\x22'+_0xb4e890+'\x22:'+stableStringify(_0x254d7e[_0xb4e890]));return'{'+_0x39879d['join'](',')+'}';}const _0x6e9829=JSON[_0xf72f14(0x14e)](_0x346c3a);return _0x6e9829===undefined?_0xf72f14(0x1bc):_0x6e9829;}function activationSignature(_0x1bc8ca){const _0x2f0cc5=a151_0x2ed631,_0x4ef6b1={'connection':_0x1bc8ca[_0x2f0cc5(0x153)],..._0x1bc8ca[_0x2f0cc5(0x1a4)]!==undefined&&{'all_columns':_0x1bc8ca[_0x2f0cc5(0x1a4)]},..._0x1bc8ca[_0x2f0cc5(0x155)]!==undefined&&{'columns':_0x1bc8ca[_0x2f0cc5(0x155)]},..._0x1bc8ca[_0x2f0cc5(0x170)]!==undefined&&{'behavior':_0x1bc8ca['behavior']},..._0x1bc8ca[_0x2f0cc5(0x142)]!==undefined&&{'schedule':_0x1bc8ca[_0x2f0cc5(0x142)]},..._0x1bc8ca['notification']!==undefined&&{'notification':_0x1bc8ca[_0x2f0cc5(0x163)]},..._0x1bc8ca[_0x2f0cc5(0x1ea)]!==undefined&&{'connector_config':_0x1bc8ca[_0x2f0cc5(0x1ea)]},..._0x1bc8ca[_0x2f0cc5(0x174)]!==undefined&&{'activation_template_id':_0x1bc8ca[_0x2f0cc5(0x174)]}};return stableStringify(_0x4ef6b1);}async function fetchSegment(_0x27e776,_0x4d2044,_0x333e8a,_0x571bef){const _0x1d26ec=a151_0x2ed631,_0x5dc1ac=_0x571bef?.[_0x1d26ec(0x1bb)](_0x499d1c=>_0x499d1c['id']===_0x333e8a);if(_0x5dc1ac)return _0x5dc1ac;try{return await _0x27e776[_0x1d26ec(0x1b9)]['getSegment'](_0x4d2044,_0x333e8a);}catch(_0x530167){logger['debug']('getSegment\x20failed\x20for\x20'+_0x333e8a+_0x1d26ec(0x188)+_0x530167);try{return await _0x27e776[_0x1d26ec(0x1b9)][_0x1d26ec(0x1b1)](_0x333e8a);}catch(_0x323ef7){return logger[_0x1d26ec(0x12c)](_0x1d26ec(0x177)+_0x333e8a+':\x20'+_0x323ef7),null;}}}function a151_0x57e9(){const _0x5830de=['Failed\x20to\x20fetch\x20referenced\x20segment\x20','results','logSuccess','includes','\x27\x20for\x20','Activation','behavior','logDeleted','draft','activationContext','activation_template_id','Condition','updateActivation','getSegmentEntity\x20also\x20failed\x20for\x20','milestone','update','Updating\x20segment\x20\x27','activation_deleted','name','connectionIdToNameMap','stage\x20\x27','9yjkNYT','unchanged','toLowerCase','Created\x20folder\x20\x27','onProgress','segment_creating','\x27\x20entry\x20criteria','83574apEpAj','match',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','conditionTimeoutDuration','segments','kind','Failed\x20to\x20','replace','journeyActivationNameToId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x27\x20exit\x20criteria','map','action','segmentNameToId','journeyName','uniqueSegmentName','segmentFolderId','keys','rule','max','attributes','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','list','hex','deps','./journey-yaml.js','\x27\x20not\x20found\x20in\x20journey\x20\x27','__pending_','activations','toISOString','all_columns','Delete\x20the\x20push\x20recovery\x20file\x20(','item','JOURNEY_SYNTAX_ERROR','relative','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','waitStepType','index','get','Deleting\x20activation\x20\x27','progress','entries','Segment\x20not\x20found:\x20','getSegmentEntity','deleteSegment','deleteActivation','Created\x20journey\x20\x27','has','SEGMENT_SYNTAX_ERROR','createActivation','journey','segment','journey_updated','find','null','existingActivation','activation_deleting','stages','nameToType','absolutePath','42XCuikz','Updated\x20activation\x20\x27','\x27\x20milestone','user','167988gnxSsp','set','hasChanges','fetchJourney','localName','idToName','activationStepsById','description','createJourneySegment','activation_updating','add','conditionTimeoutUnit','uniqueServerName','push','idToEmailMap','sha1','INTERNAL','deleted','isNew','rootFolderId','parseDocument','updateSegmentById','delete','Failed\x20to\x20resolve\x20activation\x20','segment_deleting','updated','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','Updated\x20journey\x20\x27','entryCriteria','Stage\x20\x27','embedded_segment_creating','Journey\x20\x27','size','with','\x20error(s)','run_after_journey_refresh','connector_config','embedded_activation_created','decision_point','getActivation','existingSegment','activationParams','conditionSegmentId','activationActions','entry','effectiveFolderId','buildUserMaps','journeyBundleName','Fetching\x20','embeddedSegmentNameToId','state','journeyStages','journeyBundlesByFolderAndName','1317053YSDqkh','journey_creating','filter','join','1265bseRiT','Updated\x20segment\x20\x27','segment_created','skipSegments','segmentId','message','slice','./child-segment-yaml.js','journeyId','createdSegmentId','../../utils/async.js','169500oHNZea','versionNumber','values','7294712xloHcQ','validatedRequest','isArray','Creating\x20activation\x20\x27','parse','some','createSegment','from','exitCriterias','\x20(referenced\x20in\x20journey\x20','journey_created','branches','digest','all','segmentByFolderAndName','Name\x20has\x20already\x20been\x20taken','SEGMENT_NOT_FOUND','12337860OIvDlN','journeyActivationStepId','35ecVOVj','utf-8','resolveSegment','logInfo','relationships','yamlActivation','valid','data','steps','folderPathToId','NOT_FOUND','658ZPfymN','WaitStep','ACTIVATION_UPDATE_ERROR','debug','existingJourney','and\x20the\x20server\x20segment,\x20then\x20retry.','conditions','trim','startsWith','createFolder','segment_deleted','370084QySbBy','withProgress','yamlConfig','folderId','type','Embedded\x20segment\x20\x27','__pending_act_','folderPath','split','journeys','resolvedRule','goal\x20criteria','\x27...','errors','schedule','Created\x20segment\x20\x27','created','flatMap','\x0a\x20\x20','create','dirname','Deleted\x20activation\x20\x27','journeyById','tdx.sdk.push-workflow','\x20segment\x20from\x20file:\x20','Duration','stringify','\x27\x20from\x20file:\x20','Activation\x20not\x20found:\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','diff','connection','waitStep','columns','.$1.push-recovery.json','activation_updated','sort','Segment\x20not\x20found','existingSegments','DecisionPoint','getJourney','JOURNEY_UPDATE_ERROR','entry_criteria','toString','\x27\x20wait\x20condition','goal','listActivations','notification','parentId','length','waitStepUnit','journey_updating','createdSegmentIds','logWarning'];a151_0x57e9=function(){return _0x5830de;};return a151_0x57e9();}function recoverSegmentIdsFromPushRecovery(_0x24b910,_0x54cc76,_0x52af92){const _0x4ddee4=a151_0x2ed631,_0x1a9033=readPushRecovery(_0x24b910[_0x4ddee4(0x1c1)]);if(_0x1a9033?.[_0x4ddee4(0x194)]===_0x24b910[_0x4ddee4(0x136)][_0x4ddee4(0x17c)])for(const [_0x477445,_0x3274af]of Object[_0x4ddee4(0x1af)](_0x1a9033[_0x4ddee4(0x18a)])){const _0x280fdd=generateDeterministicJourneySegmentName(_0x24b910[_0x4ddee4(0x136)][_0x4ddee4(0x17c)],_0x477445);_0x3274af[_0x4ddee4(0x1d2)]===_0x280fdd&&(_0x54cc76[_0x4ddee4(0x1c7)](_0x477445,_0x3274af[_0x4ddee4(0x203)]),_0x52af92[_0x4ddee4(0x1c7)](_0x477445,_0x3274af[_0x4ddee4(0x203)]));}}async function createOrRecoverEmbeddedSegment(_0x1ebaf7,_0x182a3a,_0x4841e1,_0x3add28){const _0x4d0d26=a151_0x2ed631;let _0xc522d9;try{_0xc522d9=await _0x1ebaf7[_0x4d0d26(0x1b9)][_0x4d0d26(0x1ce)]({'name':_0x4841e1['uniqueSegmentName'],'description':_0x4841e1[_0x4d0d26(0x1cd)],'journeyId':_0x4841e1[_0x4d0d26(0x207)],'rule':_0x3add28(_0x4841e1[_0x4d0d26(0x13e)],!![]),'countPopulation':!![],'parentFolderId':_0x4841e1[_0x4d0d26(0x137)],'audienceId':_0x4841e1[_0x4d0d26(0x164)]});}catch(_0x22ff7d){const _0x1fdc21=_0x22ff7d instanceof Error&&_0x22ff7d[_0x4d0d26(0x204)][_0x4d0d26(0x16d)](_0x4d0d26(0x11a));if(_0x1fdc21){const _0x21c3fb=readPushRecovery(_0x182a3a[_0x4d0d26(0x1c1)]),_0x579864=_0x21c3fb?.['journeyName']===_0x182a3a[_0x4d0d26(0x136)][_0x4d0d26(0x17c)]?_0x21c3fb[_0x4d0d26(0x18a)][_0x4841e1[_0x4d0d26(0x1ca)]]:undefined;if(_0x579864?.['uniqueServerName']===_0x4841e1[_0x4d0d26(0x195)])await _0x1ebaf7[_0x4d0d26(0x1b9)][_0x4d0d26(0x1db)](_0x4841e1[_0x4d0d26(0x164)],_0x579864[_0x4d0d26(0x203)],{'description':_0x4841e1[_0x4d0d26(0x1cd)],'rule':_0x3add28(_0x4841e1[_0x4d0d26(0x13e)],!![]),'countPopulation':!![]}),_0xc522d9=_0x579864[_0x4d0d26(0x203)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d0d26(0x139)+_0x4841e1[_0x4d0d26(0x1ca)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x4d0d26(0x1a5)+_0x182a3a[_0x4d0d26(0x1c1)]['replace'](/([^/]+)$/,_0x4d0d26(0x156))+')\x20')+_0x4d0d26(0x12e),_0x22ff7d);}else throw _0x22ff7d;}return saveSegmentToPushRecovery(_0x182a3a[_0x4d0d26(0x1c1)],_0x182a3a[_0x4d0d26(0x136)][_0x4d0d26(0x17c)],_0x4841e1['localName'],{'segmentId':_0xc522d9,'uniqueServerName':_0x4841e1[_0x4d0d26(0x195)],'createdAt':new Date()[_0x4d0d26(0x1a3)]()}),_0xc522d9;}export async function prepareSegmentFiles(_0x59f9ad,_0x4a8dce,_0x10a497,_0x95d730,_0x5919e0){const _0x582caa=a151_0x2ed631,{activationDefToCreateRequest:_0x3d5fe3}=await import('./child-segment-yaml.js'),_0x340951=[],_0x273fa4=new Set();for(const {yamlConfig:_0x4c39e4,folderPath:_0x2f9c94,sourcePath:_0x23e426}of _0x59f9ad){const _0x1223c2=resolveTDFolderPath(_0x2f9c94,_0x95d730,_0x5919e0),_0x286172=_0x1223c2+':'+_0x4c39e4[_0x582caa(0x17c)],_0x5217a0=_0x4a8dce[_0x582caa(0x119)][_0x582caa(0x1ac)](_0x286172),_0x1f8da2=_0x5217a0?_0x4a8dce['activationsBySegmentId'][_0x582caa(0x1ac)](_0x5217a0['id'])||[]:[];addFoldersToCreate(_0x1223c2,_0x4a8dce[_0x582caa(0x127)],_0x273fa4);const _0x1a03e7=calculateActivationActions(_0x4c39e4[_0x582caa(0x1a2)]||[],_0x1f8da2,_0x4a8dce[_0x582caa(0x1d4)],_0x4a8dce[_0x582caa(0x17d)]);for(const _0x30bef4 of _0x1a03e7){(_0x30bef4[_0x582caa(0x138)]==='create'||_0x30bef4[_0x582caa(0x138)]===_0x582caa(0x179))&&_0x30bef4[_0x582caa(0x123)]&&(_0x30bef4['validatedRequest']=await _0x3d5fe3(_0x30bef4[_0x582caa(0x123)],_0x10a497));}const _0x28f254=calculateSegmentDiff(_0x4c39e4,_0x5217a0,_0x1f8da2,_0x4a8dce[_0x582caa(0x1d4)],_0x4a8dce[_0x582caa(0x17d)]);_0x340951['push']({'relativePath':_0x4c39e4[_0x582caa(0x17c)],'absolutePath':_0x23e426,'yamlConfig':_0x4c39e4,'folderPath':_0x1223c2,'existingSegment':_0x5217a0,'existingActivations':_0x1f8da2,'isNew':_0x28f254[_0x582caa(0x1d8)],'hasChanges':_0x28f254[_0x582caa(0x1c8)],'diff':_0x28f254[_0x582caa(0x152)],'activationActions':_0x1a03e7});}return{'segmentFiles':_0x340951,'foldersToCreate':_0x273fa4};}export async function prepareJourneyFiles(_0x2a48b6,_0x36b31,_0x16cb24,_0xa4e5d1){const _0x39c10a=a151_0x2ed631,_0x45c740=[],_0x53ff2=new Set();for(const {yamlConfig:_0x4a115a,folderPath:_0x2aff95,sourcePath:_0x2bb4c9}of _0x2a48b6){const _0x2bde7a=resolveTDFolderPath(_0x2aff95,_0x16cb24,_0xa4e5d1),_0x694535=_0x2bde7a+':'+_0x4a115a[_0x39c10a(0x17c)],_0x249d94=_0x36b31[_0x39c10a(0x1fa)][_0x39c10a(0x1ac)](_0x694535);let _0x53172f,_0x552416;if(_0x249d94&&_0x249d94[_0x39c10a(0x165)]>0x0){const _0x4e767e=buildLocalExpandedRuleMappings(_0x4a115a),{createYamlContext:_0xbcf750,prefetchJourneySegments:_0x6a6db5}=createPushYamlContextForBundle(_0x36b31[_0x39c10a(0x19e)],_0x36b31[_0x39c10a(0x164)],_0x36b31[_0x39c10a(0x15a)],_0x4e767e,_0x36b31[_0x39c10a(0x1d4)],_0x36b31[_0x39c10a(0x17d)],_0x36b31[_0x39c10a(0x1cc)],_0x36b31['journeyById']);await _0x6a6db5(_0x249d94[_0x39c10a(0x191)](_0x570bac=>_0x570bac['id']));const _0x171515=await _0x36b31[_0x39c10a(0x19e)][_0x39c10a(0x1b8)]['getLatestJourneyId'](_0x249d94[0x0]['journeyBundleId']),_0xdffef3=hasMultipleVersions(_0x4a115a),_0x42b92d=async _0x22c5c5=>{const _0x3981dd=_0x39c10a,_0x56d36c=_0x36b31[_0x3981dd(0x14a)]?.[_0x3981dd(0x1ac)](_0x22c5c5);if(_0x56d36c)return _0x56d36c;return _0x36b31[_0x3981dd(0x1c9)]({'journeyId':_0x22c5c5,'journeyName':_0x4a115a[_0x3981dd(0x17c)],'isMultiVersion':_0x249d94['length']>0x1});};if(_0xdffef3&&_0x249d94[_0x39c10a(0x165)]>0x1){const _0x2fbfd4=[];for(const _0x5bcf93 of _0x249d94){const _0x319bca=_0x5bcf93[_0x39c10a(0x20b)]||0x1;_0x36b31[_0x39c10a(0x1ae)]?.[_0x39c10a(0x179)]('Fetching\x20'+_0x4a115a[_0x39c10a(0x17c)]+'\x20v'+_0x319bca);const _0x5e1a46=await _0x42b92d(_0x5bcf93['id']),_0x871183=_0xbcf750(_0x5bcf93['id']),_0x2a3301=await journeyResponseToDef(_0x5e1a46,_0x871183);_0x2fbfd4['push']({'item':_0x5bcf93,'yaml':_0x2a3301});}const _0x3f47bf=buildLocalRuleToNameMappingFromJourney(_0x4a115a);_0x552416=buildMergedJourneyDef(_0x2fbfd4,_0x3f47bf,_0x171515);const _0x86571c=Math[_0x39c10a(0x199)](..._0x2fbfd4['map'](_0x8cf8f8=>_0x8cf8f8[_0x39c10a(0x1a6)][_0x39c10a(0x20b)]||0x0)),_0xc4f526=_0x249d94[_0x39c10a(0x1bb)](_0x24a703=>(_0x24a703[_0x39c10a(0x20b)]||0x0)===_0x86571c);_0xc4f526&&(_0x36b31[_0x39c10a(0x1ae)]?.['update'](_0x39c10a(0x1f6)+_0x4a115a[_0x39c10a(0x17c)]+'\x20v'+_0x86571c),_0x53172f=await _0x42b92d(_0xc4f526['id']));}else{const _0x2d53e1=_0x249d94[_0x249d94[_0x39c10a(0x165)]-0x1];_0x36b31[_0x39c10a(0x1ae)]?.[_0x39c10a(0x179)](_0x39c10a(0x1f6)+_0x4a115a[_0x39c10a(0x17c)]),_0x53172f=await _0x42b92d(_0x2d53e1['id']);const _0x133205=_0xbcf750(_0x2d53e1['id']),_0x373723=await journeyResponseToDef(_0x53172f,_0x133205),_0x13f1a5=buildLocalRuleToNameMappingFromJourney(_0x4a115a);_0x552416=buildMergedJourneyDef([{'item':_0x2d53e1,'yaml':_0x373723}],_0x13f1a5,_0x171515);}}addFoldersToCreate(_0x2bde7a,_0x36b31[_0x39c10a(0x127)],_0x53ff2);const _0xd271c0=calculateJourneyDiff(_0x4a115a,_0x552416);_0x45c740['push']({'relativePath':_0x4a115a[_0x39c10a(0x17c)],'absolutePath':_0x2bb4c9,'yamlConfig':_0x4a115a,'folderPath':_0x2bde7a,'existingJourney':_0x53172f,'isNew':_0xd271c0[_0x39c10a(0x1d8)],'hasChanges':_0xd271c0[_0x39c10a(0x1c8)],'diff':_0xd271c0[_0x39c10a(0x152)]});}return{'journeyFiles':_0x45c740,'foldersToCreate':_0x53ff2};}export function calculateActivationActions(_0x8b54f0,_0x540a86,_0x118dce,_0x40e9c9){const _0x808a8d=a151_0x2ed631,_0x13279c=[],_0xa649b3=new Map();for(const _0x2c85f9 of _0x540a86){_0xa649b3[_0x808a8d(0x1c7)](_0x2c85f9[_0x808a8d(0x17c)],_0x2c85f9);}const _0x2156ed=new Map();for(const _0x20ae84 of _0x8b54f0){_0x2156ed[_0x808a8d(0x1c7)](_0x20ae84[_0x808a8d(0x17c)],_0x20ae84);}for(const _0x108b0f of _0x8b54f0){const _0x1edbd6=_0xa649b3[_0x808a8d(0x1ac)](_0x108b0f[_0x808a8d(0x17c)]);if(!_0x1edbd6)_0x13279c['push']({'type':'create','name':_0x108b0f[_0x808a8d(0x17c)],'yamlActivation':_0x108b0f});else{const _0x201dd0=activationResponseToDef(_0x1edbd6,_0x118dce,_0x40e9c9),_0x37625b=a151_0x297b00[_0x808a8d(0x14e)](_0x201dd0),_0x76e01b=a151_0x297b00['stringify'](_0x108b0f);_0x37625b!==_0x76e01b&&_0x13279c[_0x808a8d(0x1d3)]({'type':'update','name':_0x108b0f[_0x808a8d(0x17c)],'yamlActivation':_0x108b0f,'existingActivation':_0x1edbd6});}}for(const _0x4604ec of _0x540a86){!_0x2156ed['has'](_0x4604ec[_0x808a8d(0x17c)])&&_0x13279c[_0x808a8d(0x1d3)]({'type':_0x808a8d(0x1dc),'name':_0x4604ec['name'],'existingActivation':_0x4604ec});}return _0x13279c;}function calculateYamlDiff(_0x302849,_0x224e8a){if(_0x224e8a){const _0x16a1e3=generateDiff(_0x224e8a,_0x302849),_0x5bfb69=hasChanges(_0x16a1e3);return{'isNew':![],'hasChanges':_0x5bfb69,'diff':_0x5bfb69?formatDiffWithColors(_0x16a1e3):undefined};}const _0x4c48ff=generateDiff('',_0x302849);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4c48ff)};}export function calculateSegmentDiff(_0x12c0b9,_0x584882,_0x256da3,_0x2e079b,_0x63787d){const _0x5d3eef=segmentToYamlString(_0x12c0b9),_0x1864b1=_0x584882?segmentToYamlString(segmentWithActivationsToYaml(_0x584882,_0x256da3,undefined,_0x2e079b,_0x63787d)):undefined;return calculateYamlDiff(_0x5d3eef,_0x1864b1);}export function calculateJourneyDiff(_0x5c7e30,_0x57ffac){const _0x5b8698=normalizeJourneyDef(_0x5c7e30,_0x5c7e30),_0x39f9a4=a151_0x36b8c4(_0x5b8698),_0x11d74f=_0x57ffac?a151_0x36b8c4(normalizeJourneyDef(_0x57ffac,_0x5c7e30)):undefined;return calculateYamlDiff(_0x39f9a4,_0x11d74f);}export function findSegmentsToDelete(_0x21c5e7,_0x990404,_0x43c47c,_0x500744,_0x54b5dd){const _0x50db7c=a151_0x2ed631,_0x3ca8f3=new Set();for(const {yamlConfig:_0x912767,folderPath:_0x23042d}of _0x990404){_0x3ca8f3[_0x50db7c(0x1d0)](_0x23042d+':'+_0x912767[_0x50db7c(0x17c)]);}return _0x21c5e7[_0x50db7c(0x1fd)](_0x4cc135=>{const _0x8e9872=_0x50db7c,_0x34b983=_0x4cc135['segmentFolderId']?_0x43c47c[_0x8e9872(0x1ac)](_0x4cc135[_0x8e9872(0x196)][_0x8e9872(0x15f)]())||'':'',_0x3822d9=_0x34b983+':'+_0x4cc135[_0x8e9872(0x17c)];if(_0x3ca8f3[_0x8e9872(0x1b5)](_0x3822d9))return![];if(_0x54b5dd)return _0x34b983===_0x500744||_0x34b983[_0x8e9872(0x131)](_0x500744+'/');return!![];});}export function findJourneysToDelete(_0x159f5d,_0x4eb97c,_0x1f79fb,_0x1463fa,_0x2293b0){const _0x3e4f35=a151_0x2ed631,_0x4421db=new Set();for(const {yamlConfig:_0x4019f6,folderPath:_0x28cea3}of _0x4eb97c){_0x4421db[_0x3e4f35(0x1d0)](_0x28cea3+':'+_0x4019f6[_0x3e4f35(0x17c)]);}return _0x159f5d[_0x3e4f35(0x1fd)](_0x1f0a6b=>{const _0xe8742f=_0x3e4f35,_0x347e58=_0x1f0a6b[_0xe8742f(0x137)]?_0x1f79fb[_0xe8742f(0x1ac)](_0x1f0a6b[_0xe8742f(0x137)])||'':'',_0x44cebf=_0x347e58+':'+_0x1f0a6b[_0xe8742f(0x1f5)];if(_0x4421db[_0xe8742f(0x1b5)](_0x44cebf))return![];if(_0x2293b0)return _0x347e58===_0x1463fa||_0x347e58[_0xe8742f(0x131)](_0x1463fa+'/');return!![];});}export function buildSegmentLookupMap(_0x1b0ad7,_0x25c34d){const _0x38ee93=a151_0x2ed631,_0x3ca578=new Map();for(const _0xe68f06 of _0x1b0ad7){const _0x46ac6e=_0xe68f06[_0x38ee93(0x196)]?_0x25c34d[_0x38ee93(0x1ac)](_0xe68f06[_0x38ee93(0x196)][_0x38ee93(0x15f)]())||'':'',_0x5cf094=_0x46ac6e+':'+_0xe68f06['name'];_0x3ca578[_0x38ee93(0x1c7)](_0x5cf094,_0xe68f06);}return _0x3ca578;}export function buildSegmentNameToIdMap(_0x161e52){const _0x3873a0=a151_0x2ed631,_0x1d337d=new Map();for(const _0x45412b of _0x161e52){_0x1d337d[_0x3873a0(0x1c7)](_0x45412b[_0x3873a0(0x17c)],_0x45412b['id']);}return _0x1d337d;}export function buildJourneyBundleLookupMap(_0x1ffaba,_0x269870){const _0x581508=a151_0x2ed631,_0x3d46ae=new Map();for(const _0x52ef3d of _0x1ffaba){const _0x475d03=_0x52ef3d['folderId']?_0x269870[_0x581508(0x1ac)](_0x52ef3d['folderId'])||'':'',_0xef90a6=_0x475d03+':'+_0x52ef3d[_0x581508(0x1f5)];!_0x3d46ae[_0x581508(0x1b5)](_0xef90a6)&&_0x3d46ae[_0x581508(0x1c7)](_0xef90a6,[]),_0x3d46ae[_0x581508(0x1ac)](_0xef90a6)[_0x581508(0x1d3)](_0x52ef3d);}for(const _0x26e9ce of _0x3d46ae[_0x581508(0x20c)]()){_0x26e9ce[_0x581508(0x158)]((_0x54a9dc,_0x5cfd3d)=>(_0x54a9dc[_0x581508(0x20b)]||0x0)-(_0x5cfd3d[_0x581508(0x20b)]||0x0));}return _0x3d46ae;}export function collectFoldersToCreate(_0x24ae42,_0x539892){const _0x125d72=a151_0x2ed631,_0x4ec3dd=new Set();for(const _0x5b3e58 of _0x24ae42){if(!_0x5b3e58)continue;if(_0x539892['has'](_0x5b3e58))continue;const _0x4ee328=_0x5b3e58[_0x125d72(0x13c)]('/');let _0x290726='';for(const _0x5cd5ed of _0x4ee328){_0x290726=_0x290726?_0x290726+'/'+_0x5cd5ed:_0x5cd5ed,!_0x539892[_0x125d72(0x1b5)](_0x290726)&&_0x4ec3dd[_0x125d72(0x1d0)](_0x290726);}}return _0x4ec3dd;}export function parseAndClassifyYamlFiles(_0x427b1e,_0x127057,_0xe41897){const _0x4dffca=a151_0x2ed631,_0x5845de=[],_0x8312e3=[];for(const _0x52efb1 of _0x427b1e){const _0x1de631=a151_0x574767['relative'](_0x127057,a151_0x574767[_0x4dffca(0x148)](_0x52efb1)),_0x5792bb=_0x1de631==='.'?'':_0x1de631,_0x2113ab=readFileSync(_0x52efb1,_0x4dffca(0x11f)),_0x2a6b69=a151_0x297b00[_0x4dffca(0x211)](_0x2113ab);if(isJourneyDef(_0x2a6b69)){const _0x36bf0b=a151_0x113781(_0x2113ab);_0x8312e3[_0x4dffca(0x1d3)]({'yamlConfig':_0x36bf0b,'folderPath':_0x5792bb,'sourcePath':_0x52efb1});}else{if(!_0xe41897?.[_0x4dffca(0x202)]){const _0x29e4d5=parseSegmentYamlFile(_0x2113ab),_0x2d5a2e=normalizeChildSegmentYaml(_0x29e4d5);_0x5845de['push']({'yamlConfig':_0x2d5a2e,'folderPath':_0x5792bb,'sourcePath':_0x52efb1});}}}return{'segments':_0x5845de,'journeys':_0x8312e3};}export function validateParsedFiles(_0x7b7d3b,_0x18e957){const _0x45a981=a151_0x2ed631,_0x389ca8=[];for(const {yamlConfig:_0x258af3,sourcePath:_0xf6eb66}of _0x7b7d3b[_0x45a981(0x18a)]){const _0x5eb3dd=readFileSync(_0xf6eb66,_0x45a981(0x11f)),_0xe1a7f7=a151_0x297b00[_0x45a981(0x1da)](_0x5eb3dd),_0x183d9a=validateSegmentDef(_0x258af3,{'source':_0x5eb3dd,'document':_0xe1a7f7},{'skipSchema':!![]});if(!_0x183d9a['valid']){const _0x19ca19=a151_0x574767[_0x45a981(0x1a8)](_0x18e957,_0xf6eb66);_0x389ca8[_0x45a981(0x1d3)]({'filePath':_0x19ca19,'source':_0x5eb3dd,'result':_0x183d9a,'isJourney':![]});}}for(const {yamlConfig:_0x40ace5,sourcePath:_0x3239e2}of _0x7b7d3b[_0x45a981(0x13d)]){const _0x573ffe=readFileSync(_0x3239e2,'utf-8'),_0x467229=a151_0x297b00[_0x45a981(0x1da)](_0x573ffe),_0x36ee0a=validateJourneyDef(_0x40ace5,{'source':_0x573ffe,'document':_0x467229},{'skipSchema':!![]});if(!_0x36ee0a[_0x45a981(0x124)]){const _0x57aa66=a151_0x574767[_0x45a981(0x1a8)](_0x18e957,_0x3239e2);_0x389ca8[_0x45a981(0x1d3)]({'filePath':_0x57aa66,'source':_0x573ffe,'result':_0x36ee0a,'isJourney':!![]});}}return _0x389ca8;}export function formatValidationErrors(_0x566e1d){const _0x40a403=a151_0x2ed631,_0x5aaad4=[];for(const {filePath:_0x1c3446,source:_0x47e6ad,result:_0x2866b0,isJourney:_0x356113}of _0x566e1d){const _0x2de036=_0x356113?'journey':_0x40a403(0x1b9);_0x5aaad4[_0x40a403(0x1d3)]('\x0a'+_0x1c3446+'\x20('+_0x2de036+'):\x20'+_0x2866b0[_0x40a403(0x141)][_0x40a403(0x165)]+_0x40a403(0x1e8)),_0x5aaad4['push'](formatValidationResult(_0x2866b0,_0x47e6ad,_0x1c3446));}return _0x5aaad4[_0x40a403(0x1fe)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x12416d){const _0xf889bf=a151_0x2ed631,_0x1d20ba=new Set(),_0x3f790e=new Map(),_0x16358e=collectSegmentUsageCounts(_0x12416d);if(_0x12416d[_0xf889bf(0x18a)])for(const [_0x14c876,_0x56be3d]of Object[_0xf889bf(0x1af)](_0x12416d['segments'])){_0x1d20ba[_0xf889bf(0x1d0)](_0x14c876);if(_0x56be3d['rule']){const _0x382f67=yamlRuleToApi(_0x56be3d[_0xf889bf(0x198)]),_0x473c9e=apiRuleToYaml(_0x382f67);_0x3f790e['set'](_0x14c876,_0x473c9e);}}const _0x3adf48=new Map();let _0x1a9fe9=0x0;for(const [_0x4d1f71,_0x19d353]of _0x3f790e){const _0xd76c31=serializeExpandedRule(_0x19d353,_0x3f790e),_0xf2e8a5=_0x3adf48[_0xf889bf(0x1ac)](_0xd76c31)||[];_0xf2e8a5[_0xf889bf(0x1d3)]({'name':_0x4d1f71,'index':_0x1a9fe9}),_0x3adf48['set'](_0xd76c31,_0xf2e8a5),_0x1a9fe9++;}const _0x4262dd=new Map();for(const [_0x2f5617,_0xd66136]of _0x3adf48){const _0x48891e=_0xd66136['slice']()['sort']((_0x5373b8,_0x316075)=>{const _0x5a9d4a=_0xf889bf,_0x227ab6=_0x16358e[_0x5a9d4a(0x1ac)](_0x5373b8[_0x5a9d4a(0x17c)])||0x0,_0x48ab8f=_0x16358e[_0x5a9d4a(0x1ac)](_0x316075[_0x5a9d4a(0x17c)])||0x0;if(_0x227ab6!==_0x48ab8f)return _0x48ab8f-_0x227ab6;return _0x5373b8[_0x5a9d4a(0x1ab)]-_0x316075['index'];})['map'](_0x5a4bb0=>_0x5a4bb0['name']),_0xa62346=[];for(const _0x4370e8 of _0x48891e){const _0x166541=_0x16358e['get'](_0x4370e8)||0x0,_0x773030=Math['max'](_0x166541,0x1);for(let _0x39147d=0x0;_0x39147d<_0x773030;_0x39147d++){_0xa62346['push'](_0x4370e8);}}_0x4262dd['set'](_0x2f5617,_0xa62346);}return{'existingLocalSegmentNames':_0x1d20ba,'localSegmentRules':_0x3f790e,'localExpandedRuleToNames':_0x4262dd};}export function createSegmentIdResolver(_0x33ec95,_0x10abf0){return async _0x40cb58=>{const _0x262b1a=a151_0x5571,_0x4904b4=_0x33ec95[_0x262b1a(0x1ac)](_0x40cb58);if(!_0x4904b4)throw new SDKError(ErrorCode[_0x262b1a(0x11b)],_0x262b1a(0x1b0)+_0x40cb58+_0x262b1a(0x18f)+_0x10abf0+'\x27)');return _0x4904b4;};}export function extractRootFolderId(_0x476ae3){const _0x3ed872=a151_0x2ed631;return _0x476ae3[_0x3ed872(0x122)]?.['parentSegmentFolder']?.[_0x3ed872(0x125)]?.['id']||_0x476ae3['relationships']?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x21afdb){const _0x2cd698=a151_0x2ed631,_0x4217a9=new Map(),_0x19e6e3=new Map(),_0x21d40f=new Map();for(const _0x32074c of _0x21afdb){_0x4217a9['set'](_0x32074c['name'],parseInt(_0x32074c['id'],0xa)),_0x19e6e3[_0x2cd698(0x1c7)](_0x32074c['id'],_0x32074c['name']),_0x21d40f['set'](_0x32074c[_0x2cd698(0x17c)],_0x32074c[_0x2cd698(0x138)]);}return{'nameToId':_0x4217a9,'idToName':_0x19e6e3,'nameToType':_0x21d40f};}export function calculatePushStats(_0x45e112,_0x2df80b,_0x2b6208,_0x4154cf,_0x1023c5,_0x45ca86,_0xfd19de){const _0x313153=a151_0x2ed631,_0x246ec0=_0x45e112[_0x313153(0x1fd)](_0x36dcf0=>_0x36dcf0[_0x313153(0x1d8)]),_0x1d8728=_0x45e112[_0x313153(0x1fd)](_0x3f6fc3=>!_0x3f6fc3[_0x313153(0x1d8)]&&_0x3f6fc3[_0x313153(0x1c8)]),_0x4c9029=_0x45e112['filter'](_0x1fd1db=>!_0x1fd1db['isNew']&&!_0x1fd1db['hasChanges']),_0x2edc6b=_0x45ca86?_0x4154cf:[],_0x43dceb=_0x2df80b[_0x313153(0x1fd)](_0x387d6a=>_0x387d6a[_0x313153(0x1d8)]),_0x1aefe6=_0x2df80b[_0x313153(0x1fd)](_0x171c04=>!_0x171c04['isNew']&&_0x171c04[_0x313153(0x1c8)]),_0x2fef08=_0x2df80b[_0x313153(0x1fd)](_0x3728b4=>!_0x3728b4[_0x313153(0x1d8)]&&!_0x3728b4[_0x313153(0x1c8)]),_0x5da51d=_0x45ca86?_0x1023c5:[],_0x102e06=_0x45e112[_0x313153(0x145)](_0x4a2015=>_0x4a2015['activationActions']),_0x4e0ae7=_0x102e06[_0x313153(0x1fd)](_0x3faae4=>_0x3faae4[_0x313153(0x138)]==='create'),_0x4c73db=_0x102e06[_0x313153(0x1fd)](_0x19b308=>_0x19b308['type']==='update'),_0x512d18=_0x102e06['filter'](_0x1347c1=>_0x1347c1[_0x313153(0x138)]===_0x313153(0x1dc)),_0x17af76=Array[_0x313153(0x214)](_0x2b6208)['sort'](),_0x3ace40=_0xfd19de?![]:_0x246ec0[_0x313153(0x165)]>0x0||_0x1d8728['length']>0x0||_0x2edc6b[_0x313153(0x165)]>0x0,_0x5826ae=_0x43dceb[_0x313153(0x165)]>0x0||_0x1aefe6[_0x313153(0x165)]>0x0||_0x5da51d[_0x313153(0x165)]>0x0,_0x3e72da=_0xfd19de?![]:_0x102e06[_0x313153(0x165)]>0x0,_0x18284d=_0x17af76[_0x313153(0x165)]>0x0;return{'segments':{'new':_0x246ec0,'changed':_0x1d8728,'unchanged':_0x4c9029,'toDelete':_0x2edc6b},'journeys':{'new':_0x43dceb,'changed':_0x1aefe6,'unchanged':_0x2fef08,'toDelete':_0x5da51d},'activations':{'all':_0x102e06,'toCreate':_0x4e0ae7,'toUpdate':_0x4c73db,'toDelete':_0x512d18},'folders':{'toCreate':_0x17af76},'counts':{'segments':{'new':_0x246ec0[_0x313153(0x165)],'changed':_0x1d8728[_0x313153(0x165)],'unchanged':_0x4c9029[_0x313153(0x165)],'toDelete':_0x2edc6b[_0x313153(0x165)]},'journeys':{'new':_0x43dceb[_0x313153(0x165)],'changed':_0x1aefe6['length'],'unchanged':_0x2fef08[_0x313153(0x165)],'toDelete':_0x5da51d['length']},'activations':{'create':_0x4e0ae7[_0x313153(0x165)],'update':_0x4c73db[_0x313153(0x165)],'delete':_0x512d18[_0x313153(0x165)]},'folders':_0x17af76['length']},'hasChanges':_0x3ace40||_0x5826ae||_0x3e72da||_0x18284d};}export async function buildPushExecutionContext(_0xf7cf59,_0x40b8ac,_0x3ef58d,_0x2b9457,_0x50f31b,_0x4a863d){const _0x1b01c4=a151_0x2ed631,_0x7a7e75=extractRootFolderId(_0x3ef58d),{pathToId:_0x232120,idToPath:_0x3d4062}=buildFolderMaps(_0x50f31b),_0x4d4929=buildSegmentNameToIdMap(_0x2b9457),_0x5c3bd1=new Map(),{batchAsync:_0x18b441}=await import('../../utils/async.js'),[_0x201195,_0x332130]=await Promise[_0x1b01c4(0x21a)]([_0xf7cf59[_0x1b01c4(0x1c5)][_0x1b01c4(0x1f4)](),_0xf7cf59[_0x1b01c4(0x153)][_0x1b01c4(0x19c)](),((async()=>{!_0x4a863d&&_0x2b9457['length']>0x0&&await _0x18b441(_0x2b9457,async _0x3fccd7=>{const _0x34a4ca=a151_0x5571,_0x137c68=await _0xf7cf59['segment'][_0x34a4ca(0x162)](_0x40b8ac,_0x3fccd7['id']);_0x5c3bd1[_0x34a4ca(0x1c7)](_0x3fccd7['id'],_0x137c68);});})())]),{emailToId:_0xd263d0,idToEmail:_0x3121db}=_0x201195,_0x18586f=buildConnectionMaps(_0x332130);return{'rootFolderId':_0x7a7e75,'folderPathToId':_0x232120,'folderIdToPath':_0x3d4062,'segmentNameToId':_0x4d4929,'activationsBySegmentId':_0x5c3bd1,'emailToIdMap':_0xd263d0,'idToEmailMap':_0x3121db,'connectionNameToIdMap':_0x18586f['nameToId'],'connectionIdToNameMap':_0x18586f[_0x1b01c4(0x1cb)],'connectionNameToTypeMap':_0x18586f[_0x1b01c4(0x1c0)]};}export function createPushYamlContextForBundle(_0x1022d2,_0x794a7c,_0x2d26c2,_0x38d14f,_0x143c4d,_0x1d87d9,_0x2bf539,_0x2c47e5){const {existingLocalSegmentNames:_0x19f1a2,localExpandedRuleToNames:_0x4fe20a}=_0x38d14f,_0x3855ce=new Set(),_0x32a436=new Map(),_0x5eb49a=new Map(),_0x438468=new Map(),_0x1adc80=createJumpTargetCache(),_0x1ddbfb=new Map(),_0x22e1de=new Map(),_0xa15816=new Set();let _0x5f09d2;const _0x15e0df=_0x2be064=>{const _0x1ec486={'resolveSegment':async _0x1741c8=>{const _0x486226=a151_0x5571,_0x1bb184=_0x438468[_0x486226(0x1ac)](_0x1741c8);if(_0x1bb184!==undefined)return{'name':_0x1bb184,'isJourneyLocal':!![]};try{const _0x5a4ebf=await fetchSegment(_0x1022d2,_0x794a7c,_0x1741c8,_0x2d26c2);if(!_0x5a4ebf)throw new Error(_0x486226(0x159));const _0xf898ae=generateJourneyLocalName(_0x5a4ebf[_0x486226(0x17c)]),_0xf3a1e8=_0x5a4ebf[_0x486226(0x18b)]===SEGMENT_KIND_JOURNEY&&_0xf898ae!==undefined;let _0x4cd8fa=_0x5a4ebf[_0x486226(0x17c)],_0x3e6524;if(_0xf3a1e8&&_0x5a4ebf[_0x486226(0x198)]){const _0x280e91=apiRuleToYaml(_0x5a4ebf[_0x486226(0x198)]);_0x22e1de['set'](_0x1741c8,_0x280e91);const _0x45d433=async _0x279203=>{const _0x768a05=_0x486226,_0x414f4c=collectSegmentRefsFromRule(_0x279203);for(const _0x4e363d of _0x414f4c){if(!_0x22e1de['has'](_0x4e363d))try{const _0x3beb47=await fetchSegment(_0x1022d2,_0x794a7c,_0x4e363d,_0x2d26c2);if(_0x3beb47?.[_0x768a05(0x198)]){const _0x3863a0=apiRuleToYaml(_0x3beb47[_0x768a05(0x198)]);_0x22e1de['set'](_0x4e363d,_0x3863a0),await _0x45d433(_0x3863a0);}}catch(_0x27e75b){logger[_0x768a05(0x12c)](_0x768a05(0x16a)+_0x4e363d+':\x20'+_0x27e75b);}}};await _0x45d433(_0x280e91);const _0x46f4a2=serializeExpandedRule(_0x280e91,_0x22e1de),_0xc090e8=_0x4fe20a['get'](_0x46f4a2);if(_0xc090e8&&_0xc090e8[_0x486226(0x165)]>0x0){const _0x538d8c=_0x32a436['get'](_0x46f4a2)||0x0,_0x2fd593=_0xc090e8[_0x538d8c]||_0xc090e8[_0xc090e8['length']-0x1];_0x32a436['set'](_0x46f4a2,_0x538d8c+0x1),_0x4cd8fa=_0x2fd593,_0x3855ce[_0x486226(0x1d0)](_0x4cd8fa),_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa);const _0x4129ac=await resolveRuleSegmentRefs(_0x280e91,async _0x399d7f=>{const _0x55fa53=_0x486226,_0x40df80=_0x438468[_0x55fa53(0x1ac)](_0x399d7f);if(_0x40df80)return _0x40df80;const _0x18f31c=await _0x5f09d2[_0x55fa53(0x120)](_0x399d7f);return _0x18f31c[_0x55fa53(0x17c)];});_0x3e6524={'description':_0x5a4ebf[_0x486226(0x1cd)],'rule':_0x4129ac};}else{const _0x3d4687=_0x1ddbfb[_0x486226(0x1ac)](_0x46f4a2);if(_0x3d4687)_0x4cd8fa=_0x3d4687,_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa);else{if(_0xf898ae){let _0x52c363=_0xf898ae,_0x2ade41=0x2;while(_0x3855ce[_0x486226(0x1b5)](_0x52c363)||_0x19f1a2[_0x486226(0x1b5)](_0x52c363)){_0x52c363=_0xf898ae+'_'+_0x2ade41,_0x2ade41++;}_0x3855ce[_0x486226(0x1d0)](_0x52c363),_0x4cd8fa=_0x52c363;}_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa),_0x1ddbfb[_0x486226(0x1c7)](_0x46f4a2,_0x4cd8fa);const _0x53adde=await resolveRuleSegmentRefs(_0x280e91,async _0x276742=>{const _0x255669=_0x486226,_0x2323de=_0x438468[_0x255669(0x1ac)](_0x276742);if(_0x2323de)return _0x2323de;const _0x5e108a=await _0x5f09d2[_0x255669(0x120)](_0x276742);return _0x5e108a[_0x255669(0x17c)];});_0x3e6524={'description':_0x5a4ebf[_0x486226(0x1cd)],'rule':_0x53adde};}}}return{'name':_0x4cd8fa,'isJourneyLocal':_0xf3a1e8,'definition':_0x3e6524};}catch(_0x4e56a4){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x1741c8+':\x20'+_0x4e56a4),{'name':_0x1741c8,'isJourneyLocal':![]};}},'resolveActivation':async _0x136af2=>{const _0x2f9f30=a151_0x5571,_0x347859=_0x5eb49a['get'](_0x136af2);if(_0x347859!==undefined)return{'name':_0x347859,'isJourneyLocal':!![]};try{let _0x9ab250=_0x2bf539?.[_0x2f9f30(0x1ac)](_0x136af2);!_0x9ab250&&(_0x9ab250=await _0x1022d2[_0x2f9f30(0x1b8)][_0x2f9f30(0x1ed)](_0x2be064,_0x136af2));const _0x5cd42c=_0x9ab250['attributes'][_0x2f9f30(0x1ef)][_0x2f9f30(0x17c)]||_0x136af2,_0x63ea06=sanitizeYamlKey(_0x5cd42c)||'activation_'+_0x136af2,_0x3f9dcf=_0x63ea06;_0x5eb49a['set'](_0x136af2,_0x3f9dcf);const _0x11e345=journeyActivationStepToYaml(_0x9ab250,_0x143c4d,_0x1d87d9);return{'name':_0x3f9dcf,'isJourneyLocal':!![],'definition':_0x11e345};}catch(_0x5b0ff7){return logger[_0x2f9f30(0x12c)](_0x2f9f30(0x1dd)+_0x136af2+':\x20'+_0x5b0ff7),{'name':_0x136af2,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x427047,_0x4f981a)=>resolveJumpTarget(_0x427047,_0x4f981a,_0x1adc80,async _0x745737=>{const _0x9c739d=a151_0x5571,_0x4bf129=_0x2c47e5?.[_0x9c739d(0x1ac)](_0x745737);if(_0x4bf129)return _0x4bf129;return _0x1022d2[_0x9c739d(0x1b8)]['getJourney'](_0x745737);})};return _0x5f09d2=_0x1ec486,_0x1ec486;},_0x36e05b=async _0xcd9fdf=>{const _0x23c55d=a151_0x5571,{collectSegmentIdsFromJourneyApi:_0xe59013}=await import(_0x23c55d(0x19f)),{batchAsync:_0x171271}=await import(_0x23c55d(0x209)),_0x31ec36=new Set();for(const _0x2595cc of _0xcd9fdf){let _0x10f0b7=_0x2c47e5?.[_0x23c55d(0x1ac)](_0x2595cc);!_0x10f0b7&&(_0x10f0b7=await _0x1022d2[_0x23c55d(0x1b8)]['getJourney'](_0x2595cc));const _0x4272ad=_0xe59013(_0x10f0b7);for(const _0x1fdb41 of _0x4272ad){_0x31ec36[_0x23c55d(0x1d0)](_0x1fdb41);}}let _0x39b309=Array[_0x23c55d(0x214)](_0x31ec36);while(_0x39b309['length']>0x0){const _0x13e1c0=_0x39b309[_0x23c55d(0x1fd)](_0x3a959b=>!_0xa15816['has'](_0x3a959b));if(_0x13e1c0[_0x23c55d(0x165)]===0x0)break;const _0x4c12ef=await _0x171271(_0x13e1c0,async _0x18514b=>{_0xa15816['add'](_0x18514b);const _0x3da569=await fetchSegment(_0x1022d2,_0x794a7c,_0x18514b,_0x2d26c2);if(!_0x3da569)return null;return{'segmentId':_0x18514b,'segment':_0x3da569};},0xa),_0x5850d9=new Set();for(const _0x4a40d8 of _0x4c12ef){if(!_0x4a40d8?.[_0x23c55d(0x1b9)]?.['rule'])continue;const _0x2a7d4d=apiRuleToYaml(_0x4a40d8[_0x23c55d(0x1b9)]['rule']);_0x22e1de['set'](_0x4a40d8[_0x23c55d(0x203)],_0x2a7d4d);const _0x2ea7cf=collectSegmentRefsFromRule(_0x2a7d4d);for(const _0x122e16 of _0x2ea7cf){!_0xa15816[_0x23c55d(0x1b5)](_0x122e16)&&_0x5850d9[_0x23c55d(0x1d0)](_0x122e16);}}_0x39b309=Array[_0x23c55d(0x214)](_0x5850d9);}};return{'createYamlContext':_0x15e0df,'prefetchJourneySegments':_0x36e05b};}function a151_0x5571(_0x435bae,_0x3498b3){_0x435bae=_0x435bae-0x119;const _0x57e949=a151_0x57e9();let _0x5571b1=_0x57e949[_0x435bae];return _0x5571b1;}export async function executePushSegments(_0x46a32f,_0x554e08,_0x433c67,_0x5d62f9,_0xc5a0a9){const _0x3b7195=a151_0x2ed631,{segmentDefToCreateRequest:_0x5e105d,segmentDefToUpdateRequest:_0x3b096e}=await import('./child-segment-yaml.js'),_0x4c868d=_0x433c67[_0x3b7195(0x127)],_0x14e563=0x5,_0x5cb856=async _0x14383c=>{const _0x57b048=_0x3b7195,_0x1b21b1=_0x14383c['folderPath']?_0x4c868d[_0x57b048(0x1ac)](_0x14383c[_0x57b048(0x13b)]):undefined;let _0x4a0d86;const _0x158b92={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x34dc21=_0x14383c[_0x57b048(0x136)];if(_0x14383c[_0x57b048(0x136)][_0x57b048(0x198)]){const _0x2ad9ac=createSegmentIdResolver(_0x433c67[_0x57b048(0x193)],_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]),_0x30a875=await resolveRuleSegmentIds(_0x14383c[_0x57b048(0x136)]['rule'],_0x2ad9ac);_0x34dc21={..._0x14383c[_0x57b048(0x136)],'rule':_0x30a875};}try{if(_0x14383c[_0x57b048(0x1d8)]){_0xc5a0a9[_0x57b048(0x183)]?.({'type':_0x57b048(0x184),'name':_0x14383c['yamlConfig'][_0x57b048(0x17c)]});const _0x52a033=_0x5e105d(_0x34dc21,_0x1b21b1),_0x3904d6=await _0xc5a0a9[_0x57b048(0x135)]('Creating\x20segment\x20\x27'+_0x14383c['yamlConfig'][_0x57b048(0x17c)]+_0x57b048(0x140),()=>_0x46a32f['segment'][_0x57b048(0x213)](_0x5d62f9['parentId'],_0x52a033));_0x4a0d86=_0x3904d6[_0x57b048(0x125)]['id'],_0x433c67[_0x57b048(0x193)][_0x57b048(0x1c7)](_0x14383c['yamlConfig'][_0x57b048(0x17c)],_0x4a0d86),_0x158b92[_0x57b048(0x208)]={'name':_0x14383c[_0x57b048(0x136)]['name'],'id':_0x4a0d86},_0xc5a0a9[_0x57b048(0x183)]?.({'type':_0x57b048(0x201),'name':_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)],'segmentId':_0x4a0d86}),_0xc5a0a9[_0x57b048(0x16c)]?.(_0x57b048(0x143)+_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]+'\x27'),_0x158b92[_0x57b048(0x144)]=0x1;}else{if(_0x14383c[_0x57b048(0x1c8)]){_0xc5a0a9[_0x57b048(0x183)]?.({'type':'segment_updating','name':_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]});const _0x2b9176=_0x3b096e(_0x34dc21);_0x1b21b1!==_0x14383c[_0x57b048(0x1ee)]?.[_0x57b048(0x196)]&&(_0x2b9176[_0x57b048(0x196)]=_0x1b21b1?parseInt(_0x1b21b1,0xa):undefined),await _0xc5a0a9[_0x57b048(0x135)](_0x57b048(0x17a)+_0x14383c[_0x57b048(0x136)]['name']+_0x57b048(0x140),()=>_0x46a32f['segment']['updateSegmentById'](_0x5d62f9[_0x57b048(0x164)],_0x14383c['existingSegment']['id'],_0x2b9176)),_0x4a0d86=_0x14383c[_0x57b048(0x1ee)]['id'],_0xc5a0a9['onProgress']?.({'type':'segment_updated','name':_0x14383c['yamlConfig'][_0x57b048(0x17c)]}),_0xc5a0a9['logSuccess']?.(_0x57b048(0x200)+_0x14383c[_0x57b048(0x136)]['name']+'\x27'),_0x158b92['updated']=0x1;}else _0x4a0d86=_0x14383c[_0x57b048(0x1ee)]['id'];}}catch(_0xdfcc0d){const _0x2670cc=isHttp400Error(_0xdfcc0d),_0x4ddfb0=_0x2670cc?ErrorCode[_0x57b048(0x1b6)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5ba558=getErrorMessage(_0xdfcc0d);throw new SDKError(_0x4ddfb0,_0x57b048(0x18c)+(_0x14383c[_0x57b048(0x1d8)]?_0x57b048(0x147):_0x57b048(0x179))+_0x57b048(0x14c)+_0x14383c[_0x57b048(0x1c1)]+_0x57b048(0x146)+_0x5ba558,_0xdfcc0d);}try{const _0x10ba1f=await syncActivationsForSegment(_0x46a32f,_0x5d62f9[_0x57b048(0x164)],_0x4a0d86,_0x14383c['yamlConfig'][_0x57b048(0x17c)],_0x14383c[_0x57b048(0x1f1)],_0xc5a0a9,_0x14383c[_0x57b048(0x1c1)]);_0x158b92[_0x57b048(0x1a2)]=_0x10ba1f;}catch(_0x5431f6){if(_0x5431f6 instanceof SDKError)throw _0x5431f6;throw new SDKError(ErrorCode[_0x57b048(0x12b)],_0x57b048(0x1a9)+_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]+_0x57b048(0x14f)+_0x14383c[_0x57b048(0x1c1)]+_0x57b048(0x146)+getErrorMessage(_0x5431f6),_0x5431f6);}return _0x158b92;},_0x50375f=await batchAsync(_0x554e08,_0x5cb856,_0x14e563),_0x96d0f6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xa0c286 of _0x50375f){_0x96d0f6['created']+=_0xa0c286['created'],_0x96d0f6['updated']+=_0xa0c286[_0x3b7195(0x1df)],_0xa0c286[_0x3b7195(0x208)]&&_0x96d0f6[_0x3b7195(0x168)]['set'](_0xa0c286[_0x3b7195(0x208)][_0x3b7195(0x17c)],_0xa0c286['createdSegmentId']['id']),_0x96d0f6[_0x3b7195(0x1a2)][_0x3b7195(0x144)]+=_0xa0c286[_0x3b7195(0x1a2)]['created'],_0x96d0f6[_0x3b7195(0x1a2)][_0x3b7195(0x1df)]+=_0xa0c286[_0x3b7195(0x1a2)]['updated'],_0x96d0f6['activations'][_0x3b7195(0x1d7)]+=_0xa0c286[_0x3b7195(0x1a2)][_0x3b7195(0x1d7)];}return _0x96d0f6;}async function syncActivationsForSegment(_0xd23319,_0x4b395c,_0x429ae0,_0x5849b3,_0x3ac4bb,_0x58f05f,_0x3abea6){const _0x1a03b1=a151_0x2ed631,_0x269f52={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x56bc91 of _0x3ac4bb){try{if(_0x56bc91[_0x1a03b1(0x138)]===_0x1a03b1(0x147)&&_0x56bc91[_0x1a03b1(0x20e)])_0x58f05f[_0x1a03b1(0x183)]?.({'type':'activation_creating','segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f['withProgress'](_0x1a03b1(0x210)+_0x56bc91['name']+'\x27...',()=>_0xd23319[_0x1a03b1(0x1b9)][_0x1a03b1(0x1b7)](_0x4b395c,_0x429ae0,_0x56bc91[_0x1a03b1(0x20e)])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':'activation_created','segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),_0x58f05f[_0x1a03b1(0x16c)]?.('Created\x20activation\x20\x27'+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x144)]++;else{if(_0x56bc91[_0x1a03b1(0x138)]===_0x1a03b1(0x179)&&_0x56bc91[_0x1a03b1(0x20e)]&&_0x56bc91[_0x1a03b1(0x1bd)])_0x58f05f['onProgress']?.({'type':_0x1a03b1(0x1cf),'segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f[_0x1a03b1(0x135)]('Updating\x20activation\x20\x27'+_0x56bc91['name']+_0x1a03b1(0x140),()=>_0xd23319['segment'][_0x1a03b1(0x176)](_0x4b395c,_0x429ae0,_0x56bc91['existingActivation']['id'],_0x56bc91['validatedRequest'])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':_0x1a03b1(0x157),'segmentName':_0x5849b3,'activationName':_0x56bc91['name']}),_0x58f05f['logSuccess']?.(_0x1a03b1(0x1c3)+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x1df)]++;else _0x56bc91['type']===_0x1a03b1(0x1dc)&&_0x56bc91['existingActivation']&&(_0x58f05f['onProgress']?.({'type':_0x1a03b1(0x1be),'segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f[_0x1a03b1(0x135)](_0x1a03b1(0x1ad)+_0x56bc91['name']+_0x1a03b1(0x140),()=>_0xd23319[_0x1a03b1(0x1b9)][_0x1a03b1(0x1b3)](_0x4b395c,_0x429ae0,_0x56bc91[_0x1a03b1(0x1bd)]['id'])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':_0x1a03b1(0x17b),'segmentName':_0x5849b3,'activationName':_0x56bc91['name']}),_0x58f05f[_0x1a03b1(0x171)]?.(_0x1a03b1(0x149)+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x1d7)]++);}}catch(_0x18b926){const _0x8cad0c=isHttp400Error(_0x18b926),_0xecf1=_0x8cad0c?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x1a03b1(0x12b)],_0x1f2802=getErrorMessage(_0x18b926);throw new SDKError(_0xecf1,'Failed\x20to\x20'+_0x56bc91[_0x1a03b1(0x138)]+'\x20activation\x20\x27'+_0x56bc91[_0x1a03b1(0x17c)]+'\x27\x20from\x20file:\x20'+_0x3abea6+_0x1a03b1(0x146)+_0x1f2802,_0x18b926);}}return _0x269f52;}export async function executePushFolders(_0x6d3318,_0x4158af,_0x30ce96,_0x30d60c,_0x107224){const _0x2500d3=a151_0x2ed631,_0x28247d=new Map(_0x30ce96),_0x2602ab=sortFoldersByDepth(_0x4158af);for(const _0x38773b of _0x2602ab){const _0x5ca5d1=_0x38773b['split']('/'),_0x1a07c2=_0x5ca5d1[_0x5ca5d1['length']-0x1],_0x1fa6ab=_0x5ca5d1[_0x2500d3(0x205)](0x0,-0x1)['join']('/'),_0x19c3ac=_0x28247d[_0x2500d3(0x1ac)](_0x1fa6ab);_0x107224['onProgress']?.({'type':'folder_creating','folder':_0x38773b});const _0x4c9446={'name':_0x1a07c2,'parentFolderId':_0x19c3ac},_0x4c0b96=await _0x107224[_0x2500d3(0x135)]('Creating\x20folder\x20\x27'+_0x38773b+'\x27...',()=>_0x6d3318[_0x2500d3(0x1b9)][_0x2500d3(0x132)](_0x30d60c[_0x2500d3(0x164)],_0x4c9446));_0x28247d[_0x2500d3(0x1c7)](_0x38773b,_0x4c0b96[_0x2500d3(0x125)]['id']),_0x107224['onProgress']?.({'type':'folder_created','folder':_0x38773b,'folderId':_0x4c0b96[_0x2500d3(0x125)]['id']}),_0x107224[_0x2500d3(0x121)]?.(_0x2500d3(0x182)+_0x38773b+'\x27');}return _0x28247d;}export async function executePushSegmentDeletions(_0x5c4533,_0x2ff78a,_0x103b47){const _0x2ddb29=a151_0x2ed631;if(_0x2ff78a['length']===0x0)return 0x0;const {batchAsync:_0x403150}=await import(_0x2ddb29(0x209)),_0x33e37c=0x5,_0x5b239d=await _0x403150(_0x2ff78a,async _0x2909f8=>{const _0x560f9e=_0x2ddb29;return _0x103b47[_0x560f9e(0x183)]?.({'type':_0x560f9e(0x1de),'name':_0x2909f8[_0x560f9e(0x17c)]}),await _0x5c4533[_0x560f9e(0x1b9)][_0x560f9e(0x1b2)](_0x2909f8['id']),_0x103b47[_0x560f9e(0x183)]?.({'type':_0x560f9e(0x133),'name':_0x2909f8[_0x560f9e(0x17c)]}),_0x103b47['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x2909f8[_0x560f9e(0x17c)]+'\x27'),0x1;},_0x33e37c);return _0x5b239d['reduce']((_0x9add38,_0x23ecdd)=>_0x9add38+_0x23ecdd,0x0);}export async function executePushJourneys(_0xe47cfc,_0x490f00,_0x2975dd,_0x26c1a3,_0x5864f9){const _0x23f154=a151_0x2ed631,{journeyDefToRequest:_0xce5484}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x334f44,yamlRuleToApi:_0x1ed9ed,validateSegmentRule:_0x5ca3b9}=await import(_0x23f154(0x206)),_0x298e4e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x31ae97=new Map(_0x2975dd[_0x23f154(0x193)]),_0x1dd85=0x5;for(let _0x1e5dfc=0x0;_0x1e5dfc<_0x490f00['length'];_0x1e5dfc+=_0x1dd85){const _0x5efbd2=_0x490f00[_0x23f154(0x205)](_0x1e5dfc,_0x1e5dfc+_0x1dd85),_0x43eb5e=await Promise[_0x23f154(0x21a)](_0x5efbd2['map'](async _0x129da4=>{const _0x4ad4dc=_0x23f154;if(!_0x129da4[_0x4ad4dc(0x1d8)]&&!_0x129da4['hasChanges'])return{'action':_0x4ad4dc(0x180),'name':_0x129da4[_0x4ad4dc(0x136)][_0x4ad4dc(0x17c)],'journeyId':_0x129da4[_0x4ad4dc(0x12d)]?.['id']};const _0x5913d1=_0x129da4[_0x4ad4dc(0x13b)]?_0x2975dd[_0x4ad4dc(0x127)][_0x4ad4dc(0x1ac)](_0x129da4[_0x4ad4dc(0x13b)]):undefined;_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x129da4[_0x4ad4dc(0x1d8)]?_0x4ad4dc(0x1fc):_0x4ad4dc(0x167),'name':_0x129da4[_0x4ad4dc(0x136)][_0x4ad4dc(0x17c)]});try{const _0x53546e=await executeSingleJourneyPush(_0xe47cfc,_0x129da4,{..._0x2975dd,'segmentNameToId':_0x31ae97},{'parentId':_0x26c1a3[_0x4ad4dc(0x164)],'rootFolderId':_0x26c1a3[_0x4ad4dc(0x1d9)],'folderId':_0x5913d1,'verbose':_0x26c1a3['verbose']},_0x5864f9,{'journeyDefToRequest':_0xce5484,'activationDefToCreateRequest':_0x334f44,'yamlRuleToApi':_0x1ed9ed,'validateSegmentRule':_0x5ca3b9});for(const [_0x20592f,_0x217ee5]of _0x53546e[_0x4ad4dc(0x1f7)]){_0x31ae97[_0x4ad4dc(0x1c7)](_0x20592f,_0x217ee5),_0x298e4e['embeddedSegmentNameToId'][_0x4ad4dc(0x1c7)](_0x20592f,_0x217ee5);}if(_0x53546e[_0x4ad4dc(0x192)]==='created')_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x4ad4dc(0x217),'name':_0x129da4['yamlConfig'][_0x4ad4dc(0x17c)],'journeyId':_0x53546e[_0x4ad4dc(0x207)]}),_0x5864f9['logSuccess']?.(_0x4ad4dc(0x1b4)+_0x129da4['yamlConfig'][_0x4ad4dc(0x17c)]+'\x27'),_0x298e4e[_0x4ad4dc(0x144)]++;else _0x53546e[_0x4ad4dc(0x192)]===_0x4ad4dc(0x1df)&&(_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x4ad4dc(0x1ba),'name':_0x129da4[_0x4ad4dc(0x136)]['name']}),_0x5864f9['logSuccess']?.(_0x4ad4dc(0x1e1)+_0x129da4['yamlConfig']['name']+'\x27'),_0x298e4e[_0x4ad4dc(0x1df)]++);return{'action':_0x53546e['action'],'name':_0x129da4[_0x4ad4dc(0x136)]['name'],'journeyId':_0x53546e[_0x4ad4dc(0x207)]};}catch(_0x2fa96f){const _0x571878=isHttp400Error(_0x2fa96f),_0x18c3a7=_0x571878?ErrorCode[_0x4ad4dc(0x1a7)]:ErrorCode[_0x4ad4dc(0x15d)],_0x1ffe64=getErrorMessage(_0x2fa96f);throw new SDKError(_0x18c3a7,_0x4ad4dc(0x18c)+(_0x129da4[_0x4ad4dc(0x1d8)]?_0x4ad4dc(0x147):_0x4ad4dc(0x179))+'\x20journey\x20from\x20file:\x20'+_0x129da4[_0x4ad4dc(0x1c1)]+_0x4ad4dc(0x146)+_0x1ffe64,_0x2fa96f);}}));_0x298e4e[_0x23f154(0x16b)][_0x23f154(0x1d3)](..._0x43eb5e);}return _0x298e4e;}async function matchExistingJourneySegments(_0x5f4ce5,_0x22283f,_0x2256e3,_0x3e7261,_0x2c19fa){const _0x94c663=a151_0x2ed631;if(!_0x22283f['existingJourney']||!_0x22283f[_0x94c663(0x136)][_0x94c663(0x18a)])return;const _0x5229c1=new Map(),_0x490cf4=new Set();for(const _0x70dd3 of Object[_0x94c663(0x197)](_0x22283f[_0x94c663(0x136)][_0x94c663(0x18a)])){const _0x4a3326=generateDeterministicJourneySegmentName(_0x22283f[_0x94c663(0x136)]['name'],_0x70dd3);_0x5229c1['set'](_0x4a3326,_0x70dd3),_0x490cf4[_0x94c663(0x1d0)](_0x70dd3);}const _0x4227bf=[],_0x56ef56=collectSegmentIdsFromJourneyApi(_0x22283f[_0x94c663(0x12d)]);for(const _0x20768e of _0x56ef56){const _0x3667c1=await fetchSegment(_0x5f4ce5,_0x2256e3,_0x20768e,_0x3e7261);if(!_0x3667c1?.[_0x94c663(0x17c)])continue;const _0x28b8b0=_0x5229c1[_0x94c663(0x1ac)](_0x3667c1['name']);_0x28b8b0?(_0x2c19fa[_0x94c663(0x1c7)](_0x28b8b0,_0x20768e),_0x490cf4[_0x94c663(0x1dc)](_0x28b8b0)):_0x4227bf[_0x94c663(0x1d3)]({'id':_0x20768e,'seg':_0x3667c1});}if(_0x490cf4[_0x94c663(0x1e6)]>0x0&&_0x4227bf[_0x94c663(0x165)]>0x0){const {localExpandedRuleToNames:_0x2b4287}=buildLocalExpandedRuleMappings(_0x22283f[_0x94c663(0x136)]),_0x7d4a96=new Map();for(const {id:_0x1740c4,seg:_0xdfe171}of _0x4227bf){if(_0xdfe171['rule']){const _0x4f1a41=apiRuleToYaml(_0xdfe171[_0x94c663(0x198)]);_0x7d4a96[_0x94c663(0x1c7)](_0x1740c4,_0x4f1a41);}}for(const {id:_0x4383a5,seg:_0x374102}of _0x4227bf){if(!_0x374102[_0x94c663(0x198)])continue;const _0x20d669=_0x7d4a96[_0x94c663(0x1ac)](_0x4383a5);if(!_0x20d669)continue;const _0x298117=serializeExpandedRule(_0x20d669,_0x7d4a96),_0x437786=_0x2b4287['get'](_0x298117);if(_0x437786){const _0x28b5cf=_0x437786['find'](_0x40be57=>_0x490cf4[_0x94c663(0x1b5)](_0x40be57));_0x28b5cf&&(_0x2c19fa[_0x94c663(0x1c7)](_0x28b5cf,_0x4383a5),_0x490cf4[_0x94c663(0x1dc)](_0x28b5cf),logger[_0x94c663(0x12c)]('Matched\x20server\x20segment\x20\x27'+_0x374102[_0x94c663(0x17c)]+'\x27\x20to\x20local\x20\x27'+_0x28b5cf+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x537236,_0x34d171,_0x220ff7,_0x422ca9,_0x5a8284,_0x5679b9){const _0x48c7e7=a151_0x2ed631,{journeyDefToRequest:_0x3e538f,activationDefToCreateRequest:_0x4cc8d5,yamlRuleToApi:_0x1541c0,validateSegmentRule:_0x3630a8}=_0x5679b9,_0x16ccb2=new Map(),_0x32f1c4=new Map();recoverSegmentIdsFromPushRecovery(_0x34d171,_0x16ccb2,_0x220ff7['segmentNameToId']);const _0x35b10e=new Map(),_0x4135f6=new Map(),_0x45885b=new Map();let _0x20134b;const _0x301659=async()=>{const _0x415c91=a151_0x5571;if(_0x20134b)return;_0x20134b=new Map();if(!_0x34d171[_0x415c91(0x12d)])return;const _0x1c9a5c=await _0x537236[_0x415c91(0x1b8)][_0x415c91(0x162)](_0x34d171['existingJourney']['id']);for(const _0xe531c3 of _0x1c9a5c){const _0xe8416c=journeyActivationStepToYaml(_0xe531c3,_0x220ff7[_0x415c91(0x1d4)],_0x220ff7['connectionIdToNameMap']),_0x1abc94=activationSignature(_0xe8416c);!_0x20134b['has'](_0x1abc94)&&_0x20134b[_0x415c91(0x1c7)](_0x1abc94,_0xe531c3['id']),_0xe8416c[_0x415c91(0x17c)]&&_0x32f1c4[_0x415c91(0x1c7)](_0xe8416c[_0x415c91(0x17c)],_0xe531c3['id']);}};await matchExistingJourneySegments(_0x537236,_0x34d171,_0x422ca9[_0x48c7e7(0x164)],_0x220ff7[_0x48c7e7(0x15a)],_0x220ff7['segmentNameToId']);const _0x53c8af={'resolveSegmentId':async _0x1ca163=>{const _0x4b1452=_0x48c7e7,_0x301def=_0x220ff7['segmentNameToId'][_0x4b1452(0x1ac)](_0x1ca163);if(!_0x301def)throw new SDKError(ErrorCode[_0x4b1452(0x11b)],_0x4b1452(0x1b0)+_0x1ca163+_0x4b1452(0x216)+_0x34d171['yamlConfig']['name']+')');return _0x301def;},'resolveEmbeddedSegmentId':async(_0x46d688,_0x1a3fd7)=>{const _0x228db8=_0x48c7e7,_0x495fe8=_0x220ff7[_0x228db8(0x193)]['get'](_0x46d688);if(_0x495fe8)return _0x495fe8;const _0x2cef47=_0x220ff7[_0x228db8(0x15a)]['find'](_0x23cf89=>_0x23cf89[_0x228db8(0x17c)]===_0x46d688);if(_0x2cef47)return _0x220ff7[_0x228db8(0x193)]['set'](_0x46d688,_0x2cef47['id']),_0x2cef47['id'];if(_0x34d171[_0x228db8(0x1d8)]){const {stageName:_0x4a3d0c,criteriaName:_0x5df7bd}=findSegmentCriteriaLocation(_0x34d171[_0x228db8(0x136)],_0x46d688);return _0x3630a8(_0x46d688,_0x1a3fd7[_0x228db8(0x198)]),_0x4135f6['set'](_0x46d688,{'definition':_0x1a3fd7,'stageName':_0x4a3d0c,'criteriaName':_0x5df7bd}),createPendingSegmentId(_0x46d688);}const _0x774b19=_0x34d171[_0x228db8(0x12d)]?.['id'];if(!_0x774b19)throw new SDKError(ErrorCode['INTERNAL'],_0x228db8(0x151));const _0x29bdf7=_0x35b10e['get'](_0x46d688);if(_0x29bdf7)return _0x29bdf7;const _0x472ac4=((async()=>{const _0xfc6bde=_0x228db8;_0x3630a8(_0x46d688,_0x1a3fd7[_0xfc6bde(0x198)]);const _0x5c840c=generateDeterministicJourneySegmentName(_0x34d171[_0xfc6bde(0x136)][_0xfc6bde(0x17c)],_0x46d688),_0xb3b29a=_0x220ff7[_0xfc6bde(0x15a)][_0xfc6bde(0x1bb)](_0x483453=>_0x483453[_0xfc6bde(0x17c)]===_0x5c840c),_0x2a7893=createSegmentIdResolver(_0x220ff7[_0xfc6bde(0x193)],_0x46d688),_0x426fe2=await resolveRuleSegmentIds(_0x1a3fd7[_0xfc6bde(0x198)],_0x2a7893);let _0x9adde6;return _0xb3b29a?(await _0x537236['segment'][_0xfc6bde(0x1db)](_0x422ca9[_0xfc6bde(0x164)],_0xb3b29a['id'],{'description':_0x1a3fd7[_0xfc6bde(0x1cd)]||'Entry\x20criteria:\x20'+_0x46d688,'rule':_0x1541c0(_0x426fe2),'countPopulation':!![]}),_0x9adde6=_0xb3b29a['id'],saveSegmentToPushRecovery(_0x34d171[_0xfc6bde(0x1c1)],_0x34d171[_0xfc6bde(0x136)][_0xfc6bde(0x17c)],_0x46d688,{'segmentId':_0x9adde6,'uniqueServerName':_0x5c840c,'createdAt':new Date()[_0xfc6bde(0x1a3)]()})):_0x9adde6=await createOrRecoverEmbeddedSegment(_0x537236,_0x34d171,{'localName':_0x46d688,'uniqueSegmentName':_0x5c840c,'description':_0x1a3fd7[_0xfc6bde(0x1cd)]||'Entry\x20criteria:\x20'+_0x46d688,'journeyId':_0x774b19,'resolvedRule':_0x426fe2,'parentId':_0x422ca9[_0xfc6bde(0x164)],'folderId':_0x422ca9[_0xfc6bde(0x1d9)]||''},_0x1541c0),_0x220ff7['segmentNameToId'][_0xfc6bde(0x1c7)](_0x46d688,_0x9adde6),_0x16ccb2[_0xfc6bde(0x1c7)](_0x46d688,_0x9adde6),_0x9adde6;})());_0x35b10e[_0x228db8(0x1c7)](_0x46d688,_0x472ac4);try{return await _0x472ac4;}finally{_0x35b10e[_0x228db8(0x1dc)](_0x46d688);}},'resolveActivationId':async _0x21520f=>{const _0x4831c9=_0x48c7e7,_0x5077e6=_0x32f1c4[_0x4831c9(0x1ac)](_0x21520f);if(_0x5077e6)return _0x5077e6;if(_0x34d171['existingJourney']){await _0x301659();const _0x35de51=_0x32f1c4['get'](_0x21520f);if(_0x35de51)return _0x35de51;}throw new SDKError(ErrorCode[_0x4831c9(0x128)],_0x4831c9(0x150)+_0x21520f+_0x4831c9(0x216)+_0x34d171[_0x4831c9(0x136)][_0x4831c9(0x17c)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x4cff6d,_0x19c60a)=>{const _0x5a3f86=_0x48c7e7,_0x58d8d4=_0x32f1c4['get'](_0x4cff6d);if(_0x58d8d4)return _0x58d8d4;if(_0x34d171[_0x5a3f86(0x1d8)])return _0x45885b['set'](_0x4cff6d,_0x19c60a),createPendingActivationId(_0x4cff6d);if(_0x34d171[_0x5a3f86(0x12d)]){await _0x301659();const _0x3396b2=_0x32f1c4[_0x5a3f86(0x1ac)](_0x19c60a['name']);if(_0x3396b2)return _0x32f1c4[_0x5a3f86(0x1c7)](_0x4cff6d,_0x3396b2),_0x3396b2;const _0x1ede47=activationSignature(_0x19c60a),_0x1bacd3=_0x20134b?.[_0x5a3f86(0x1ac)](_0x1ede47);if(_0x1bacd3)return _0x32f1c4[_0x5a3f86(0x1c7)](_0x4cff6d,_0x1bacd3),_0x1bacd3;const _0x2e0640=await _0x4cc8d5(_0x19c60a,_0x220ff7['activationContext']),_0x19bff3={..._0x2e0640,..._0x19c60a[_0x5a3f86(0x1e9)]!==undefined&&{'runAfterJourneyRefresh':_0x19c60a[_0x5a3f86(0x1e9)]}},_0x1bded7=await _0x537236['journey'][_0x5a3f86(0x1b7)](_0x34d171['existingJourney']['id'],_0x19bff3);return _0x32f1c4['set'](_0x4cff6d,_0x1bded7['id']),_0x1bded7['id'];}throw new SDKError(ErrorCode[_0x5a3f86(0x1d6)],_0x5a3f86(0x19b));},'resolveJourneyId':async _0x379acb=>{const _0x38d891=_0x48c7e7;try{return await _0x537236[_0x38d891(0x1b8)]['resolveJourneyId'](_0x422ca9[_0x38d891(0x164)],_0x379acb);}catch(_0x5634a4){throw new SDKError(ErrorCode[_0x38d891(0x128)],_0x38d891(0x1e5)+_0x379acb+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x34d171[_0x38d891(0x136)][_0x38d891(0x17c)]+'\x27)',_0x5634a4);}},'resolveStageId':async(_0x33e789,_0x43ec22)=>{const _0x3bb523=_0x48c7e7,_0x3b0e87=await _0x537236[_0x3bb523(0x1b8)][_0x3bb523(0x15c)](_0x33e789),_0x58800e=_0x3b0e87[_0x3bb523(0x19a)][_0x3bb523(0x1f9)][_0x3bb523(0x1bb)](_0x582cf5=>_0x582cf5[_0x3bb523(0x17c)]['toLowerCase']()===_0x43ec22['toLowerCase']());if(!_0x58800e?.['id'])throw new SDKError(ErrorCode[_0x3bb523(0x128)],_0x3bb523(0x1e3)+_0x43ec22+_0x3bb523(0x1a0)+(_0x3b0e87[_0x3bb523(0x19a)][_0x3bb523(0x1f5)]||_0x3b0e87[_0x3bb523(0x19a)]['name'])+'\x27');return _0x58800e['id'];}},_0x301eb7=await _0x3e538f(_0x34d171[_0x48c7e7(0x136)],_0x422ca9[_0x48c7e7(0x164)],_0x53c8af),_0x57a0c6=_0x422ca9[_0x48c7e7(0x137)]||_0x422ca9['rootFolderId'];_0x57a0c6&&(_0x301eb7['relationships']={'parentFolder':{'data':{'id':_0x57a0c6,'type':'folder'}}});if(_0x34d171[_0x48c7e7(0x1d8)]){if(_0x4135f6['size']>0x0||_0x45885b[_0x48c7e7(0x1e6)]>0x0)return await executeThreeStepJourneyCreate(_0x537236,_0x34d171,_0x301eb7,{'pendingEmbeddedSegments':_0x4135f6,'pendingEmbeddedActivations':_0x45885b,'embeddedSegmentNameToId':_0x16ccb2,'journeyActivationNameToId':_0x32f1c4},{..._0x422ca9,'effectiveFolderId':_0x57a0c6},_0x220ff7,_0x5a8284,_0x5679b9);else{ensureJourneyDefaults(_0x301eb7[_0x48c7e7(0x19a)]);const _0x53421f=await _0x537236[_0x48c7e7(0x1b8)][_0x48c7e7(0x147)](_0x301eb7);return deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x144),'journeyId':_0x53421f['id'],'embeddedSegmentNameToId':_0x16ccb2};}}else{if(_0x34d171[_0x48c7e7(0x1c8)]&&_0x34d171[_0x48c7e7(0x12d)]){_0x301eb7['id']=_0x34d171[_0x48c7e7(0x12d)]['id'];const _0x3d9d15=_0x301eb7[_0x48c7e7(0x19a)];_0x34d171[_0x48c7e7(0x12d)][_0x48c7e7(0x19a)]?.['journeyBundleName']&&(_0x3d9d15[_0x48c7e7(0x1f5)]=_0x34d171[_0x48c7e7(0x12d)][_0x48c7e7(0x19a)][_0x48c7e7(0x1f5)]);const _0x56ffbf=_0x34d171['existingJourney'][_0x48c7e7(0x19a)]?.[_0x48c7e7(0x1f9)];return _0x56ffbf&&_0x301eb7['attributes'][_0x48c7e7(0x1f9)]&&injectExistingStageIds(_0x301eb7[_0x48c7e7(0x19a)][_0x48c7e7(0x1f9)],_0x56ffbf),ensureJourneyDefaults(_0x3d9d15),await _0x537236[_0x48c7e7(0x1b8)][_0x48c7e7(0x179)](_0x34d171[_0x48c7e7(0x12d)]['id'],_0x301eb7),deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x1df),'journeyId':_0x34d171[_0x48c7e7(0x12d)]['id'],'embeddedSegmentNameToId':_0x16ccb2};}}return deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x180),'journeyId':_0x34d171[_0x48c7e7(0x12d)]?.['id'],'embeddedSegmentNameToId':_0x16ccb2};}function findSegmentCriteriaLocation(_0x38c756,_0x41c589){const _0x4a565e=a151_0x2ed631,_0x323cae=_0x38c756[_0x4a565e(0x1bf)]||_0x38c756[_0x4a565e(0x13d)]?.[0x0]?.['stages']||[];let _0x563214=_0x4a565e(0x1f2),_0x57211e=_0x41c589;const _0x5c0e9a=_0x38c756[_0x4a565e(0x161)]||_0x38c756['journeys']?.[0x0]?.[_0x4a565e(0x161)];if(_0x5c0e9a?.[_0x4a565e(0x1b9)]===_0x41c589)return{'stageName':_0x4a565e(0x161),'criteriaName':_0x5c0e9a[_0x4a565e(0x17c)]||_0x41c589};_0x27a884:for(const _0x182e3b of _0x323cae){if(_0x182e3b[_0x4a565e(0x15e)]?.[_0x4a565e(0x1b9)]===_0x41c589){_0x563214=_0x182e3b[_0x4a565e(0x17c)],_0x57211e=_0x182e3b['entry_criteria']['name']||_0x41c589;break;}if(_0x182e3b[_0x4a565e(0x126)])for(const _0xd00d9 of _0x182e3b[_0x4a565e(0x126)]){if(_0xd00d9[_0x4a565e(0x138)]===_0x4a565e(0x1ec)&&_0xd00d9[_0x4a565e(0x1e7)]?.[_0x4a565e(0x218)])for(const _0x5df5e4 of _0xd00d9['with'][_0x4a565e(0x218)]){if(_0x5df5e4[_0x4a565e(0x1b9)]===_0x41c589){_0x563214=_0x182e3b[_0x4a565e(0x17c)],_0x57211e=_0x5df5e4[_0x4a565e(0x17c)]||_0x41c589;break _0x27a884;}}}}return{'stageName':_0x563214,'criteriaName':_0x57211e};}async function executeThreeStepJourneyCreate(_0x52cb0a,_0x197d67,_0x554939,_0x2192de,_0x119e53,_0x183304,_0x275d61,_0x265587){const _0x5d629a=a151_0x2ed631,{activationDefToCreateRequest:_0x44564b,yamlRuleToApi:_0x56630e}=_0x265587,{pendingEmbeddedSegments:_0xb4d881,pendingEmbeddedActivations:_0x7a3894,embeddedSegmentNameToId:_0x455533}=_0x2192de,_0x51a0d3=JSON['parse'](JSON[_0x5d629a(0x14e)](_0x554939));ensureJourneyDefaults(_0x51a0d3[_0x5d629a(0x19a)]),stripPendingIds(_0x51a0d3);const _0x48699c=await _0x52cb0a[_0x5d629a(0x1b8)][_0x5d629a(0x147)](_0x51a0d3),_0x4df3d3=_0x48699c['id'],_0x33b663=new Map();for(const _0x176a21 of _0x48699c[_0x5d629a(0x19a)][_0x5d629a(0x1f9)]){_0x33b663[_0x5d629a(0x1c7)](_0x176a21[_0x5d629a(0x17c)]['toLowerCase'](),_0x176a21['id']);}recoverSegmentIdsFromPushRecovery(_0x197d67,_0x455533,_0x183304[_0x5d629a(0x193)]);for(const [_0x43a0e9,{definition:_0x37ae3c}]of _0xb4d881){if(_0x455533[_0x5d629a(0x1b5)](_0x43a0e9)){_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_segment_created','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'segmentName':_0x43a0e9});continue;}const _0x4bf79c=generateDeterministicJourneySegmentName(_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],_0x43a0e9);_0x275d61['onProgress']?.({'type':_0x5d629a(0x1e4),'journeyName':_0x197d67['yamlConfig']['name'],'segmentName':_0x43a0e9});const _0x3107e4=createSegmentIdResolver(_0x183304[_0x5d629a(0x193)],_0x43a0e9),_0x30c314=await resolveRuleSegmentIds(_0x37ae3c[_0x5d629a(0x198)],_0x3107e4),_0x4dfb97=await createOrRecoverEmbeddedSegment(_0x52cb0a,_0x197d67,{'localName':_0x43a0e9,'uniqueSegmentName':_0x4bf79c,'description':_0x37ae3c[_0x5d629a(0x1cd)]||'Entry\x20criteria:\x20'+_0x43a0e9,'journeyId':_0x4df3d3,'resolvedRule':_0x30c314,'parentId':_0x119e53[_0x5d629a(0x164)],'folderId':_0x119e53[_0x5d629a(0x1f3)]||''},_0x56630e);_0x455533[_0x5d629a(0x1c7)](_0x43a0e9,_0x4dfb97),_0x183304[_0x5d629a(0x193)][_0x5d629a(0x1c7)](_0x43a0e9,_0x4dfb97),_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_segment_created','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'segmentName':_0x43a0e9});}const _0x7f4b0c=new Map();for(const [_0xdd1f10,_0x535bec]of _0x7a3894){_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_activation_creating','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'activationName':_0xdd1f10});const _0x149f22=await _0x44564b(_0x535bec,_0x183304[_0x5d629a(0x173)]),_0x48d0fb={..._0x149f22,..._0x535bec[_0x5d629a(0x1e9)]!==undefined&&{'runAfterJourneyRefresh':_0x535bec['run_after_journey_refresh']}},_0x345bd0=await _0x52cb0a['journey'][_0x5d629a(0x1b7)](_0x4df3d3,_0x48d0fb);_0x7f4b0c[_0x5d629a(0x1c7)](_0xdd1f10,_0x345bd0['id']),_0x2192de[_0x5d629a(0x18e)][_0x5d629a(0x1c7)](_0xdd1f10,_0x345bd0['id']),_0x275d61['onProgress']?.({'type':_0x5d629a(0x1eb),'journeyName':_0x197d67[_0x5d629a(0x136)]['name'],'activationName':_0xdd1f10});}const _0x493091=JSON[_0x5d629a(0x211)](JSON['stringify'](_0x554939));return _0x493091['id']=_0x4df3d3,ensureJourneyDefaults(_0x493091[_0x5d629a(0x19a)]),resolvePendingIdsInRequest(_0x493091,_0x554939,_0x33b663,_0x455533,_0x7f4b0c,_0x275d61),await _0x52cb0a[_0x5d629a(0x1b8)]['update'](_0x4df3d3,_0x493091),deletePushRecovery(_0x197d67[_0x5d629a(0x1c1)]),{'action':_0x5d629a(0x144),'journeyId':_0x4df3d3,'embeddedSegmentNameToId':_0x455533};}export function stripWaitStepPendingIds(_0x434072){const _0x4f2ba6=a151_0x2ed631,_0x4da19a=_0x434072[_0x4f2ba6(0x1f0)]&&isPendingSegmentId(_0x434072[_0x4f2ba6(0x1f0)]),_0x33c94d=_0x434072['conditions']?.[_0x4f2ba6(0x212)](_0x59238a=>_0x59238a[_0x4f2ba6(0x203)]&&isPendingSegmentId(_0x59238a[_0x4f2ba6(0x203)]));(_0x4da19a||_0x33c94d)&&(_0x434072[_0x4f2ba6(0x1aa)]=_0x4f2ba6(0x14d),_0x434072[_0x4f2ba6(0x154)]=0x1,_0x434072['waitStepUnit']='day',delete _0x434072[_0x4f2ba6(0x1f0)],delete _0x434072[_0x4f2ba6(0x189)],delete _0x434072[_0x4f2ba6(0x1d1)],delete _0x434072[_0x4f2ba6(0x12f)]);}export function resolveWaitStepPendingIds(_0x5e07d4,_0x483815,_0x1ef3f9,_0x2aa9c4){const _0x2a2021=a151_0x2ed631;if(_0x483815[_0x2a2021(0x1f0)]&&isPendingSegmentId(_0x483815[_0x2a2021(0x1f0)])){const _0x3ef526=_0x1ef3f9(_0x483815[_0x2a2021(0x1f0)],_0x2a2021(0x17e)+_0x2aa9c4+'\x27\x20wait\x20condition');_0x3ef526&&(_0x5e07d4['waitStepType']=_0x2a2021(0x175),_0x5e07d4[_0x2a2021(0x1f0)]=_0x3ef526,delete _0x5e07d4[_0x2a2021(0x154)],delete _0x5e07d4[_0x2a2021(0x166)],_0x483815['conditionTimeoutDuration']!==undefined&&(_0x5e07d4[_0x2a2021(0x189)]=_0x483815[_0x2a2021(0x189)]),_0x483815[_0x2a2021(0x1d1)]&&(_0x5e07d4[_0x2a2021(0x1d1)]=_0x483815[_0x2a2021(0x1d1)]));}if(_0x483815[_0x2a2021(0x12f)]){const _0x3cd373=_0x483815[_0x2a2021(0x12f)]['some'](_0x1645a8=>_0x1645a8[_0x2a2021(0x203)]&&isPendingSegmentId(_0x1645a8[_0x2a2021(0x203)]));if(_0x3cd373){const _0x4f3f22=_0x483815[_0x2a2021(0x12f)][_0x2a2021(0x191)](_0x2fd311=>{const _0x47aa65=_0x2a2021;if(_0x2fd311[_0x47aa65(0x203)]&&isPendingSegmentId(_0x2fd311[_0x47aa65(0x203)])){const _0x169a29=_0x1ef3f9(_0x2fd311['segmentId'],'stage\x20\x27'+_0x2aa9c4+_0x47aa65(0x160));return{..._0x2fd311,'segmentId':_0x169a29||_0x2fd311['segmentId']};}return{..._0x2fd311};});_0x5e07d4[_0x2a2021(0x1aa)]=_0x2a2021(0x175),_0x5e07d4[_0x2a2021(0x12f)]=_0x4f3f22,delete _0x5e07d4[_0x2a2021(0x154)],delete _0x5e07d4[_0x2a2021(0x166)],delete _0x5e07d4[_0x2a2021(0x1f0)],delete _0x5e07d4[_0x2a2021(0x189)],delete _0x5e07d4[_0x2a2021(0x1d1)];}}}function stripPendingIds(_0x539281){const _0x59a86a=a151_0x2ed631;_0x539281[_0x59a86a(0x19a)]['goal']?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x539281['attributes'][_0x59a86a(0x161)][_0x59a86a(0x203)])&&delete _0x539281['attributes'][_0x59a86a(0x161)];for(const _0x13c905 of _0x539281['attributes'][_0x59a86a(0x1f9)]||[]){_0x13c905['entryCriteria']?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x13c905['entryCriteria']['segmentId'])&&delete _0x13c905[_0x59a86a(0x1e2)];_0x13c905[_0x59a86a(0x178)]?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x13c905['milestone'][_0x59a86a(0x203)])&&delete _0x13c905['milestone'];_0x13c905[_0x59a86a(0x215)]&&(_0x13c905[_0x59a86a(0x215)]=_0x13c905[_0x59a86a(0x215)][_0x59a86a(0x1fd)](_0x1f00ee=>!_0x1f00ee['segmentId']||!isPendingSegmentId(_0x1f00ee[_0x59a86a(0x203)])));if(_0x13c905[_0x59a86a(0x126)])for(const _0x3b9501 of Object[_0x59a86a(0x197)](_0x13c905['steps'])){const _0xc41b20=_0x13c905[_0x59a86a(0x126)][_0x3b9501];_0xc41b20[_0x59a86a(0x138)]===_0x59a86a(0x16f)&&_0xc41b20[_0x59a86a(0x11d)]&&isPendingActivationId(_0xc41b20['journeyActivationStepId'])&&(_0xc41b20['journeyActivationStepId']='');if(_0xc41b20['type']==='DecisionPoint'&&_0xc41b20[_0x59a86a(0x218)])for(const _0x26bf25 of _0xc41b20[_0x59a86a(0x218)]){_0x26bf25[_0x59a86a(0x203)]&&isPendingSegmentId(_0x26bf25[_0x59a86a(0x203)])&&(_0x26bf25[_0x59a86a(0x203)]='');}_0xc41b20['type']===_0x59a86a(0x12a)&&stripWaitStepPendingIds(_0xc41b20);}}}function resolvePendingIdsInRequest(_0x4eb0d4,_0x415623,_0x5c8a21,_0x984de7,_0x2eec32,_0x13e45f){const _0x4a13d0=a151_0x2ed631,_0x126a7d=(_0x2ff15b,_0x188495)=>{const _0x4ac046=a151_0x5571;if(!isPendingSegmentId(_0x2ff15b))return _0x2ff15b;const _0x4aef56=extractPendingSegmentName(_0x2ff15b),_0x57b424=_0x984de7[_0x4ac046(0x1ac)](_0x4aef56);return!_0x57b424&&_0x13e45f[_0x4ac046(0x169)]?.(_0x4ac046(0x1e0)+_0x4aef56+_0x4ac046(0x16e)+_0x188495),_0x57b424;};if(_0x4eb0d4['attributes'][_0x4a13d0(0x161)]?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x161)][_0x4a13d0(0x203)])){const _0x432496=_0x126a7d(_0x4eb0d4['attributes'][_0x4a13d0(0x161)]['segmentId'],_0x4a13d0(0x13f));_0x432496&&(_0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x161)]['segmentId']=_0x432496);}for(const _0x31e6ae of _0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x1f9)]||[]){const _0x30d0a9=_0x5c8a21[_0x4a13d0(0x1ac)](_0x31e6ae[_0x4a13d0(0x17c)][_0x4a13d0(0x181)]());_0x30d0a9&&(_0x31e6ae['id']=_0x30d0a9);if(_0x31e6ae[_0x4a13d0(0x1e2)]?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x31e6ae[_0x4a13d0(0x1e2)][_0x4a13d0(0x203)])){const _0x235ea5=_0x126a7d(_0x31e6ae['entryCriteria']['segmentId'],'stage\x20\x27'+_0x31e6ae[_0x4a13d0(0x17c)]+_0x4a13d0(0x185));_0x235ea5&&(_0x31e6ae['entryCriteria']['segmentId']=_0x235ea5);}if(_0x31e6ae['exitCriterias'])for(const _0x16c810 of _0x31e6ae[_0x4a13d0(0x215)]){if(_0x16c810[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x16c810[_0x4a13d0(0x203)])){const _0x279e4a=_0x126a7d(_0x16c810[_0x4a13d0(0x203)],_0x4a13d0(0x17e)+_0x31e6ae[_0x4a13d0(0x17c)]+_0x4a13d0(0x190));_0x279e4a&&(_0x16c810[_0x4a13d0(0x203)]=_0x279e4a);}}if(_0x31e6ae[_0x4a13d0(0x178)]?.['segmentId']&&isPendingSegmentId(_0x31e6ae[_0x4a13d0(0x178)]['segmentId'])){const _0x301c18=_0x126a7d(_0x31e6ae['milestone'][_0x4a13d0(0x203)],_0x4a13d0(0x17e)+_0x31e6ae['name']+_0x4a13d0(0x1c4));_0x301c18&&(_0x31e6ae['milestone'][_0x4a13d0(0x203)]=_0x301c18);}if(_0x31e6ae[_0x4a13d0(0x126)]){const _0x12b5fa=_0x9a48ef=>_0x415623['attributes'][_0x4a13d0(0x1f9)]?.[_0x4a13d0(0x1bb)](_0x69ba31=>_0x69ba31['name']['toLowerCase']()===_0x31e6ae[_0x4a13d0(0x17c)][_0x4a13d0(0x181)]())?.[_0x4a13d0(0x126)]?.[_0x9a48ef];for(const _0x3e28e7 of Object[_0x4a13d0(0x197)](_0x31e6ae[_0x4a13d0(0x126)])){const _0x410b02=_0x31e6ae['steps'][_0x3e28e7],_0x3f8d3a=_0x12b5fa(_0x3e28e7);if(_0x410b02['type']==='Activation'&&_0x410b02[_0x4a13d0(0x11d)]&&(isPendingActivationId(_0x410b02[_0x4a13d0(0x11d)])||_0x410b02['journeyActivationStepId']==='')){if(_0x3f8d3a?.[_0x4a13d0(0x11d)]&&isPendingActivationId(_0x3f8d3a['journeyActivationStepId'])){const _0x1e5df1=extractPendingActivationName(_0x3f8d3a[_0x4a13d0(0x11d)]),_0xae5b23=_0x2eec32['get'](_0x1e5df1);_0xae5b23&&(_0x410b02[_0x4a13d0(0x11d)]=_0xae5b23);}}if(_0x410b02[_0x4a13d0(0x138)]===_0x4a13d0(0x15b)&&_0x410b02['branches']&&_0x3f8d3a?.[_0x4a13d0(0x218)])for(let _0x2d380c=0x0;_0x2d380c<_0x410b02[_0x4a13d0(0x218)][_0x4a13d0(0x165)];_0x2d380c++){const _0xc67fd7=_0x410b02[_0x4a13d0(0x218)][_0x2d380c],_0x4c9efe=_0x3f8d3a[_0x4a13d0(0x218)][_0x2d380c];if(_0x4c9efe?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x4c9efe['segmentId'])){const _0x32b7ef=_0x126a7d(_0x4c9efe[_0x4a13d0(0x203)],'stage\x20\x27'+_0x31e6ae['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0xc67fd7[_0x4a13d0(0x17c)]||_0x2d380c)+'\x27');_0x32b7ef&&(_0xc67fd7[_0x4a13d0(0x203)]=_0x32b7ef);}}_0x410b02[_0x4a13d0(0x138)]===_0x4a13d0(0x12a)&&_0x3f8d3a?.[_0x4a13d0(0x138)]===_0x4a13d0(0x12a)&&resolveWaitStepPendingIds(_0x410b02,_0x3f8d3a,_0x126a7d,_0x31e6ae['name']);}}}}
|
|
1
|
+
const a151_0x35cf28=a151_0xb026;(function(_0x36d25d,_0x2b9d4d){const _0x4791e7=a151_0xb026,_0x462be2=_0x36d25d();while(!![]){try{const _0x34f885=-parseInt(_0x4791e7(0x125))/0x1+-parseInt(_0x4791e7(0x15e))/0x2+-parseInt(_0x4791e7(0x13d))/0x3*(parseInt(_0x4791e7(0x112))/0x4)+-parseInt(_0x4791e7(0x1b2))/0x5*(parseInt(_0x4791e7(0x1e5))/0x6)+parseInt(_0x4791e7(0x19a))/0x7*(-parseInt(_0x4791e7(0x191))/0x8)+parseInt(_0x4791e7(0x1bf))/0x9*(-parseInt(_0x4791e7(0x1a8))/0xa)+-parseInt(_0x4791e7(0x14a))/0xb*(-parseInt(_0x4791e7(0xfb))/0xc);if(_0x34f885===_0x2b9d4d)break;else _0x462be2['push'](_0x462be2['shift']());}catch(_0x3027d4){_0x462be2['push'](_0x462be2['shift']());}}}(a151_0x1f65,0x87f66));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');function a151_0x1f65(){const _0x450e77=['create','connectionIdToNameMap','segmentNameToId','add','connection','activation_template_id','message','goal\x20criteria','\x27\x20entry\x20criteria','rule','80MraCsS','trim','behavior','\x27\x20from\x20file:\x20',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','stages','updateSegmentById','conditionTimeoutDuration','SEGMENT_NOT_FOUND','87927ZNzxEx','push','Created\x20folder\x20\x27','notification','segment_updated','createActivation','yamlConfig','Entry\x20criteria:\x20','\x20journey\x20from\x20file:\x20','schedule','\x27\x20exit\x20criteria','journeyActivationNameToId','waitStepType','idToEmailMap','4011790vACPCg','conditionSegmentId','slice','segment','Deleted\x20segment\x20\x27','entry','verbose','\x27\x20milestone','updateActivation','journeyActivationStepId','695ZTebvY','createdSegmentId','buildUserMaps','./child-segment-yaml.js','results','deleteActivation','\x27\x20wait\x20condition','decision_point','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','existingSegments','valid','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Creating\x20activation\x20\x27','9PiJZzS','Matched\x20server\x20segment\x20\x27','\x20error(s)','journeyBundlesByFolderAndName','stringify','uniqueServerName','embeddedSegmentNameToId','null','state','fetchJourney','diff','activation_updating','isNew','\x20(referenced\x20in\x20journey\x20','waitStep','nameToId','validatedRequest','Name\x20has\x20already\x20been\x20taken','Updating\x20activation\x20\x27','DecisionPoint','existingJourney','rootFolderId','unchanged','activationParams','journey_created','activation_updated','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','activation_created','\x20segment\x20from\x20file:\x20','draft','join','Failed\x20to\x20fetch\x20referenced\x20segment\x20','all_columns','embedded_segment_creating','entries','journeys','entry_criteria','some','23514uDwWqR','waitStepUnit','logSuccess','length','createJourneySegment','parentSegmentFolder','toString','data','folder','createSegment','embedded_activation_creating','update','digest','INTERNAL','idToName','activationsBySegmentId','milestone','Journey\x20\x27','Fetching\x20','flatMap','Creating\x20segment\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','parentId','stage\x20\x27','journey_entry_criteria_','max','yamlActivation','set','\x27\x20for\x20','getSegment\x20failed\x20for\x20','effectiveFolderId','localName','ACTIVATION_UPDATE_ERROR','17225760PClGkk','./journey-yaml.js','with','parse','Delete\x20the\x20push\x20recovery\x20file\x20(','Segment\x20not\x20found:\x20','Activation','WaitStep','created','Failed\x20to\x20','from','reduce','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','goal','conditionTimeoutUnit','filter','list','\x27\x20decision\x20point\x20branch\x20\x27','embedded_segment_created','exitCriterias','attributes','journeyById','activationActions','2564780MYhKdP','SEGMENT_UPDATE_ERROR','toLowerCase','Created\x20journey\x20\x27','activations','delete','Deleted\x20activation\x20\x27','columns','journey_updating','uniqueSegmentName','versionNumber','resolveSegment','getSegment','../../utils/async.js','segmentByFolderAndName','SEGMENT_SYNTAX_ERROR','nameToType','deps','activationContext','223827lrGBCX','Embedded\x20segment\x20\x27','.$1.push-recovery.json','Segment\x20not\x20found','listActivations','journeyId','description','user','\x27...','Condition','index','folderPathToId','onProgress','utf-8','segment_deleted','Activation\x20not\x20found:\x20','branches','segments','errors','progress','embedded_activation_created','segment_deleting','match','segmentId','3sRUrmk','dirname','entryCriteria',').\x20','segmentFolderId','Failed\x20to\x20resolve\x20segment\x20','conditions','JOURNEY_SYNTAX_ERROR','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_creating','__pending_','withProgress','journey','22AmYegB','keys','has','logInfo','get','sha1','existingActivation','resolveJourneyId','type','debug','getLatestJourneyId','folder_created','all','split','activationStepsById','Updated\x20activation\x20\x27','NOT_FOUND','name','toISOString','item','755012NHVfwf','folderId','activation_','Deleting\x20activation\x20\x27','journeyStages','find','and\x20the\x20server\x20segment,\x20then\x20retry.','action','activation_deleted','parseDocument','hasChanges','absolutePath','logWarning','map','parentFolder','getActivation','\x0a\x20\x20','getSegmentEntity','):\x20','journeyName','getJourney','existingSegment','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','includes','deleted','folderPath','updated','journeyBundleName','sort','run_after_journey_refresh','logDeleted','steps','relative','journeyBundleId','size','startsWith','relationships','connector_config','replace','isArray','Created\x20segment\x20\x27'];a151_0x1f65=function(){return _0x450e77;};return a151_0x1f65();}export const PENDING_SEGMENT_PREFIX=a151_0x35cf28(0x147);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x40dfa3){return''+PENDING_SEGMENT_PREFIX+_0x40dfa3+'__';}export function isPendingSegmentId(_0x2fac80){const _0x5d93cf=a151_0x35cf28;return _0x2fac80[_0x5d93cf(0x181)](PENDING_SEGMENT_PREFIX)&&!_0x2fac80[_0x5d93cf(0x181)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x350625){const _0x256f50=a151_0x35cf28;return _0x350625[_0x256f50(0x184)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x389850){return''+PENDING_ACTIVATION_PREFIX+_0x389850+'__';}export function isPendingActivationId(_0x40e166){const _0x492303=a151_0x35cf28;return _0x40e166[_0x492303(0x181)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x177784){const _0x561d0b=a151_0x35cf28;return _0x177784[_0x561d0b(0x184)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4e035a,_0x251e9f){const _0x30168b=a151_0x35cf28,_0x3a4239=_0x4e035a+'::'+(_0x251e9f[_0x30168b(0x192)]()||_0x30168b(0x1ab)),_0xd2a668=createHash(_0x30168b(0x14f))[_0x30168b(0xe5)](_0x3a4239)[_0x30168b(0xe6)]('hex')[_0x30168b(0x1aa)](0x0,0xc);return _0x30168b(0xf2)+_0xd2a668;}export function ensureJourneyDefaults(_0xb98890){const _0x2cf647=a151_0x35cf28;!_0xb98890['description']&&(_0xb98890[_0x2cf647(0x12b)]=''),!_0xb98890[_0x2cf647(0x1c7)]&&(_0xb98890[_0x2cf647(0x1c7)]=_0x2cf647(0x1dc));}export function injectExistingStageIds(_0x3100f8,_0x43c884){const _0x40d5fe=a151_0x35cf28,_0x5541c6=new Map(_0x43c884[_0x40d5fe(0x16b)](_0x5d0eea=>[_0x5d0eea[_0x40d5fe(0x15b)],_0x5d0eea['id']]));for(const _0x461e69 of _0x3100f8){if(!_0x461e69['id']){const _0x27e858=_0x5541c6[_0x40d5fe(0x14e)](_0x461e69['name']);_0x27e858&&(_0x461e69['id']=_0x27e858);}}}export function resolveTDFolderPath(_0x5983d9,_0x5957ee,_0xe08e00){if(!_0x5957ee)return _0x5983d9;if(_0x5983d9===_0xe08e00||_0x5983d9['startsWith'](_0xe08e00+'/'))return _0x5983d9;return _0x5983d9?_0xe08e00+'/'+_0x5983d9:_0xe08e00;}export function addFoldersToCreate(_0x1c1acd,_0xaaa19c,_0x222231){const _0x220899=a151_0x35cf28;if(!_0x1c1acd)return;if(_0xaaa19c['has'](_0x1c1acd))return;const _0x38bf9b=_0x1c1acd[_0x220899(0x157)]('/');let _0x4aacd0='';for(const _0x4d386e of _0x38bf9b){_0x4aacd0=_0x4aacd0?_0x4aacd0+'/'+_0x4d386e:_0x4d386e,!_0xaaa19c['has'](_0x4aacd0)&&_0x222231[_0x220899(0x18a)](_0x4aacd0);}}export function sortFoldersByDepth(_0x1255a4){const _0x1fc478=a151_0x35cf28;return[..._0x1255a4][_0x1fc478(0x17a)]((_0x410d75,_0x283bbd)=>{const _0x194004=_0x1fc478,_0x1c272b=(_0x410d75['match'](/\//g)||[])[_0x194004(0x1e8)],_0x58355f=(_0x283bbd[_0x194004(0x13b)](/\//g)||[])[_0x194004(0x1e8)];return _0x1c272b-_0x58355f;});}import*as a151_0x2b4032 from'yaml';import{readFileSync}from'fs';import a151_0x5f3456 from'path';import{isJourneyDef,parseYamlString as a151_0xcaeed4,toYamlString as a151_0x1864f0,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(_0x8d22d3){const _0x505706=a151_0x35cf28;if(Array[_0x505706(0x185)](_0x8d22d3))return'['+_0x8d22d3[_0x505706(0x16b)](_0x708631=>stableStringify(_0x708631))['join'](',')+']';if(_0x8d22d3&&typeof _0x8d22d3==='object'){const _0x350f1a=_0x8d22d3,_0x51174a=Object['keys'](_0x350f1a)[_0x505706(0x17a)](),_0x147ae0=_0x51174a[_0x505706(0x16b)](_0x492e72=>'\x22'+_0x492e72+'\x22:'+stableStringify(_0x350f1a[_0x492e72]));return'{'+_0x147ae0['join'](',')+'}';}const _0x51f122=JSON['stringify'](_0x8d22d3);return _0x51f122===undefined?_0x505706(0x1c6):_0x51f122;}function activationSignature(_0x375106){const _0x383cf7=a151_0x35cf28,_0x55acbb={'connection':_0x375106[_0x383cf7(0x18b)],..._0x375106[_0x383cf7(0x1df)]!==undefined&&{'all_columns':_0x375106[_0x383cf7(0x1df)]},..._0x375106['columns']!==undefined&&{'columns':_0x375106[_0x383cf7(0x119)]},..._0x375106[_0x383cf7(0x193)]!==undefined&&{'behavior':_0x375106['behavior']},..._0x375106[_0x383cf7(0x1a3)]!==undefined&&{'schedule':_0x375106[_0x383cf7(0x1a3)]},..._0x375106[_0x383cf7(0x19d)]!==undefined&&{'notification':_0x375106['notification']},..._0x375106[_0x383cf7(0x183)]!==undefined&&{'connector_config':_0x375106[_0x383cf7(0x183)]},..._0x375106['activation_template_id']!==undefined&&{'activation_template_id':_0x375106[_0x383cf7(0x18c)]}};return stableStringify(_0x55acbb);}async function fetchSegment(_0x59252c,_0x33d36d,_0x5d8624,_0x1bb926){const _0x165266=a151_0x35cf28,_0x1408f4=_0x1bb926?.[_0x165266(0x163)](_0x8feda4=>_0x8feda4['id']===_0x5d8624);if(_0x1408f4)return _0x1408f4;try{return await _0x59252c['segment'][_0x165266(0x11e)](_0x33d36d,_0x5d8624);}catch(_0xa783ab){logger[_0x165266(0x153)](_0x165266(0xf7)+_0x5d8624+_0x165266(0x195)+_0xa783ab);try{return await _0x59252c['segment'][_0x165266(0x16f)](_0x5d8624);}catch(_0xb9faa7){return logger[_0x165266(0x153)](_0x165266(0xef)+_0x5d8624+':\x20'+_0xb9faa7),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5ea338,_0x24777a,_0x6901ee){const _0x524669=a151_0x35cf28,_0xac53be=readPushRecovery(_0x5ea338[_0x524669(0x169)]);if(_0xac53be?.[_0x524669(0x171)]===_0x5ea338[_0x524669(0x1a0)]['name'])for(const [_0x26b812,_0x54643f]of Object[_0x524669(0x1e1)](_0xac53be['segments'])){const _0x5ba234=generateDeterministicJourneySegmentName(_0x5ea338[_0x524669(0x1a0)][_0x524669(0x15b)],_0x26b812);_0x54643f[_0x524669(0x1c4)]===_0x5ba234&&(_0x24777a[_0x524669(0xf5)](_0x26b812,_0x54643f[_0x524669(0x13c)]),_0x6901ee['set'](_0x26b812,_0x54643f[_0x524669(0x13c)]));}}async function createOrRecoverEmbeddedSegment(_0x433471,_0xb186f0,_0xe8d3f9,_0x498131){const _0x3885a4=a151_0x35cf28;let _0x5d5dab;try{_0x5d5dab=await _0x433471[_0x3885a4(0x1ab)][_0x3885a4(0x1e9)]({'name':_0xe8d3f9[_0x3885a4(0x11b)],'description':_0xe8d3f9[_0x3885a4(0x12b)],'journeyId':_0xe8d3f9['journeyId'],'rule':_0x498131(_0xe8d3f9['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0xe8d3f9['folderId'],'audienceId':_0xe8d3f9[_0x3885a4(0xf0)]});}catch(_0x5674a4){const _0x3d96a8=_0x5674a4 instanceof Error&&_0x5674a4[_0x3885a4(0x18d)][_0x3885a4(0x175)](_0x3885a4(0x1d0));if(_0x3d96a8){const _0x4af536=readPushRecovery(_0xb186f0['absolutePath']),_0x717ac4=_0x4af536?.[_0x3885a4(0x171)]===_0xb186f0['yamlConfig'][_0x3885a4(0x15b)]?_0x4af536[_0x3885a4(0x136)][_0xe8d3f9[_0x3885a4(0xf9)]]:undefined;if(_0x717ac4?.[_0x3885a4(0x1c4)]===_0xe8d3f9[_0x3885a4(0x11b)])await _0x433471[_0x3885a4(0x1ab)]['updateSegmentById'](_0xe8d3f9[_0x3885a4(0xf0)],_0x717ac4['segmentId'],{'description':_0xe8d3f9[_0x3885a4(0x12b)],'rule':_0x498131(_0xe8d3f9['resolvedRule'],!![]),'countPopulation':!![]}),_0x5d5dab=_0x717ac4[_0x3885a4(0x13c)];else throw new SDKError(ErrorCode[_0x3885a4(0x113)],_0x3885a4(0x126)+_0xe8d3f9[_0x3885a4(0xf9)]+_0x3885a4(0x145)+(_0x3885a4(0xff)+_0xb186f0[_0x3885a4(0x169)][_0x3885a4(0x184)](/([^/]+)$/,_0x3885a4(0x127))+')\x20')+_0x3885a4(0x164),_0x5674a4);}else throw _0x5674a4;}return saveSegmentToPushRecovery(_0xb186f0['absolutePath'],_0xb186f0[_0x3885a4(0x1a0)][_0x3885a4(0x15b)],_0xe8d3f9['localName'],{'segmentId':_0x5d5dab,'uniqueServerName':_0xe8d3f9['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x5d5dab;}export async function prepareSegmentFiles(_0x5865a7,_0x1415f9,_0x1aff97,_0x51c6a2,_0x1bb82c){const _0x271683=a151_0x35cf28,{activationDefToCreateRequest:_0x55f25e}=await import(_0x271683(0x1b5)),_0x5af5d2=[],_0x6124ef=new Set();for(const {yamlConfig:_0x27c2f1,folderPath:_0x4d6292,sourcePath:_0x225302}of _0x5865a7){const _0x2bc96d=resolveTDFolderPath(_0x4d6292,_0x51c6a2,_0x1bb82c),_0x8088cf=_0x2bc96d+':'+_0x27c2f1[_0x271683(0x15b)],_0x40cc22=_0x1415f9[_0x271683(0x120)][_0x271683(0x14e)](_0x8088cf),_0x1b4627=_0x40cc22?_0x1415f9[_0x271683(0xe9)][_0x271683(0x14e)](_0x40cc22['id'])||[]:[];addFoldersToCreate(_0x2bc96d,_0x1415f9[_0x271683(0x130)],_0x6124ef);const _0xb9bc37=calculateActivationActions(_0x27c2f1[_0x271683(0x116)]||[],_0x1b4627,_0x1415f9[_0x271683(0x1a7)],_0x1415f9[_0x271683(0x188)]);for(const _0x3acee2 of _0xb9bc37){(_0x3acee2[_0x271683(0x152)]===_0x271683(0x187)||_0x3acee2['type']===_0x271683(0xe5))&&_0x3acee2['yamlActivation']&&(_0x3acee2[_0x271683(0x1cf)]=await _0x55f25e(_0x3acee2[_0x271683(0xf4)],_0x1aff97));}const _0x490c13=calculateSegmentDiff(_0x27c2f1,_0x40cc22,_0x1b4627,_0x1415f9['idToEmailMap'],_0x1415f9[_0x271683(0x188)]);_0x5af5d2[_0x271683(0x19b)]({'relativePath':_0x27c2f1['name'],'absolutePath':_0x225302,'yamlConfig':_0x27c2f1,'folderPath':_0x2bc96d,'existingSegment':_0x40cc22,'existingActivations':_0x1b4627,'isNew':_0x490c13['isNew'],'hasChanges':_0x490c13[_0x271683(0x168)],'diff':_0x490c13[_0x271683(0x1c9)],'activationActions':_0xb9bc37});}return{'segmentFiles':_0x5af5d2,'foldersToCreate':_0x6124ef};}export async function prepareJourneyFiles(_0x179056,_0x57eaba,_0x3a6c1,_0x1fdc46){const _0x7f4f78=a151_0x35cf28,_0x3965a6=[],_0x2d0dcf=new Set();for(const {yamlConfig:_0xd2f47a,folderPath:_0x5d3da9,sourcePath:_0x2cda5d}of _0x179056){const _0x54e319=resolveTDFolderPath(_0x5d3da9,_0x3a6c1,_0x1fdc46),_0x49b0d3=_0x54e319+':'+_0xd2f47a[_0x7f4f78(0x15b)],_0x259d39=_0x57eaba[_0x7f4f78(0x1c2)][_0x7f4f78(0x14e)](_0x49b0d3);let _0x52baf0,_0x2d851e;if(_0x259d39&&_0x259d39[_0x7f4f78(0x1e8)]>0x0){const _0xa064cd=buildLocalExpandedRuleMappings(_0xd2f47a),{createYamlContext:_0x4f0ee3,prefetchJourneySegments:_0x3f44d6}=createPushYamlContextForBundle(_0x57eaba['deps'],_0x57eaba['parentId'],_0x57eaba[_0x7f4f78(0x1bb)],_0xa064cd,_0x57eaba[_0x7f4f78(0x1a7)],_0x57eaba[_0x7f4f78(0x188)],_0x57eaba[_0x7f4f78(0x158)],_0x57eaba['journeyById']);await _0x3f44d6(_0x259d39[_0x7f4f78(0x16b)](_0x25b377=>_0x25b377['id']));const _0x375828=await _0x57eaba[_0x7f4f78(0x123)][_0x7f4f78(0x149)][_0x7f4f78(0x154)](_0x259d39[0x0][_0x7f4f78(0x17f)]),_0x1e6a80=hasMultipleVersions(_0xd2f47a),_0x3bbe1e=async _0x520ed3=>{const _0x204c21=_0x7f4f78,_0x52d234=_0x57eaba[_0x204c21(0x110)]?.[_0x204c21(0x14e)](_0x520ed3);if(_0x52d234)return _0x52d234;return _0x57eaba[_0x204c21(0x1c8)]({'journeyId':_0x520ed3,'journeyName':_0xd2f47a['name'],'isMultiVersion':_0x259d39[_0x204c21(0x1e8)]>0x1});};if(_0x1e6a80&&_0x259d39[_0x7f4f78(0x1e8)]>0x1){const _0x18ef8a=[];for(const _0x166641 of _0x259d39){const _0x235255=_0x166641[_0x7f4f78(0x11c)]||0x1;_0x57eaba[_0x7f4f78(0x138)]?.[_0x7f4f78(0xe5)](_0x7f4f78(0xec)+_0xd2f47a[_0x7f4f78(0x15b)]+'\x20v'+_0x235255);const _0x3421c9=await _0x3bbe1e(_0x166641['id']),_0x1b7c80=_0x4f0ee3(_0x166641['id']),_0x488d34=await journeyResponseToDef(_0x3421c9,_0x1b7c80);_0x18ef8a[_0x7f4f78(0x19b)]({'item':_0x166641,'yaml':_0x488d34});}const _0x3d5432=buildLocalRuleToNameMappingFromJourney(_0xd2f47a);_0x2d851e=buildMergedJourneyDef(_0x18ef8a,_0x3d5432,_0x375828);const _0x28ee57=Math[_0x7f4f78(0xf3)](..._0x18ef8a['map'](_0x649049=>_0x649049[_0x7f4f78(0x15d)]['versionNumber']||0x0)),_0x5e92aa=_0x259d39[_0x7f4f78(0x163)](_0x49d988=>(_0x49d988[_0x7f4f78(0x11c)]||0x0)===_0x28ee57);_0x5e92aa&&(_0x57eaba[_0x7f4f78(0x138)]?.[_0x7f4f78(0xe5)](_0x7f4f78(0xec)+_0xd2f47a[_0x7f4f78(0x15b)]+'\x20v'+_0x28ee57),_0x52baf0=await _0x3bbe1e(_0x5e92aa['id']));}else{const _0x36abce=_0x259d39[_0x259d39[_0x7f4f78(0x1e8)]-0x1];_0x57eaba[_0x7f4f78(0x138)]?.['update']('Fetching\x20'+_0xd2f47a[_0x7f4f78(0x15b)]),_0x52baf0=await _0x3bbe1e(_0x36abce['id']);const _0x3a1c7e=_0x4f0ee3(_0x36abce['id']),_0x3942b4=await journeyResponseToDef(_0x52baf0,_0x3a1c7e),_0x3b6357=buildLocalRuleToNameMappingFromJourney(_0xd2f47a);_0x2d851e=buildMergedJourneyDef([{'item':_0x36abce,'yaml':_0x3942b4}],_0x3b6357,_0x375828);}}addFoldersToCreate(_0x54e319,_0x57eaba[_0x7f4f78(0x130)],_0x2d0dcf);const _0x214368=calculateJourneyDiff(_0xd2f47a,_0x2d851e);_0x3965a6['push']({'relativePath':_0xd2f47a[_0x7f4f78(0x15b)],'absolutePath':_0x2cda5d,'yamlConfig':_0xd2f47a,'folderPath':_0x54e319,'existingJourney':_0x52baf0,'isNew':_0x214368[_0x7f4f78(0x1cb)],'hasChanges':_0x214368['hasChanges'],'diff':_0x214368[_0x7f4f78(0x1c9)]});}return{'journeyFiles':_0x3965a6,'foldersToCreate':_0x2d0dcf};}export function calculateActivationActions(_0x1a32b1,_0x58d241,_0x21decd,_0x3906ef){const _0x1cb022=a151_0x35cf28,_0x1b8cdb=[],_0x3dfbf8=new Map();for(const _0x9833d5 of _0x58d241){_0x3dfbf8[_0x1cb022(0xf5)](_0x9833d5[_0x1cb022(0x15b)],_0x9833d5);}const _0x172f74=new Map();for(const _0x51bf97 of _0x1a32b1){_0x172f74[_0x1cb022(0xf5)](_0x51bf97['name'],_0x51bf97);}for(const _0x3bf7f6 of _0x1a32b1){const _0x4f6307=_0x3dfbf8[_0x1cb022(0x14e)](_0x3bf7f6[_0x1cb022(0x15b)]);if(!_0x4f6307)_0x1b8cdb['push']({'type':_0x1cb022(0x187),'name':_0x3bf7f6[_0x1cb022(0x15b)],'yamlActivation':_0x3bf7f6});else{const _0x26bed3=activationResponseToDef(_0x4f6307,_0x21decd,_0x3906ef),_0xc564a7=a151_0x2b4032[_0x1cb022(0x1c3)](_0x26bed3),_0x2a9617=a151_0x2b4032[_0x1cb022(0x1c3)](_0x3bf7f6);_0xc564a7!==_0x2a9617&&_0x1b8cdb['push']({'type':_0x1cb022(0xe5),'name':_0x3bf7f6[_0x1cb022(0x15b)],'yamlActivation':_0x3bf7f6,'existingActivation':_0x4f6307});}}for(const _0x2e5fe5 of _0x58d241){!_0x172f74[_0x1cb022(0x14c)](_0x2e5fe5['name'])&&_0x1b8cdb[_0x1cb022(0x19b)]({'type':'delete','name':_0x2e5fe5['name'],'existingActivation':_0x2e5fe5});}return _0x1b8cdb;}function a151_0xb026(_0x4a732b,_0x52c64e){_0x4a732b=_0x4a732b-0xe2;const _0x1f652b=a151_0x1f65();let _0xb026f2=_0x1f652b[_0x4a732b];return _0xb026f2;}function calculateYamlDiff(_0x272e67,_0x3ff6f9){if(_0x3ff6f9){const _0x1a8aed=generateDiff(_0x3ff6f9,_0x272e67),_0x4d2e68=hasChanges(_0x1a8aed);return{'isNew':![],'hasChanges':_0x4d2e68,'diff':_0x4d2e68?formatDiffWithColors(_0x1a8aed):undefined};}const _0x136a79=generateDiff('',_0x272e67);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x136a79)};}export function calculateSegmentDiff(_0x494441,_0x378b10,_0x12deac,_0x320342,_0x121d12){const _0x384af2=segmentToYamlString(_0x494441),_0x204f68=_0x378b10?segmentToYamlString(segmentWithActivationsToYaml(_0x378b10,_0x12deac,undefined,_0x320342,_0x121d12)):undefined;return calculateYamlDiff(_0x384af2,_0x204f68);}export function calculateJourneyDiff(_0x4b885e,_0x587eb9){const _0x7599e0=normalizeJourneyDef(_0x4b885e,_0x4b885e),_0x270783=a151_0x1864f0(_0x7599e0),_0x4d9f3e=_0x587eb9?a151_0x1864f0(normalizeJourneyDef(_0x587eb9,_0x4b885e)):undefined;return calculateYamlDiff(_0x270783,_0x4d9f3e);}export function findSegmentsToDelete(_0x1f3a95,_0x222918,_0x445719,_0x3d7d4e,_0x3e6bb3){const _0x5b1a64=a151_0x35cf28,_0x2cf424=new Set();for(const {yamlConfig:_0x3dafa5,folderPath:_0x2aa540}of _0x222918){_0x2cf424[_0x5b1a64(0x18a)](_0x2aa540+':'+_0x3dafa5['name']);}return _0x1f3a95['filter'](_0x5be694=>{const _0x48b590=_0x5b1a64,_0x4a5ff5=_0x5be694[_0x48b590(0x141)]?_0x445719[_0x48b590(0x14e)](_0x5be694[_0x48b590(0x141)][_0x48b590(0x1eb)]())||'':'',_0x288eab=_0x4a5ff5+':'+_0x5be694[_0x48b590(0x15b)];if(_0x2cf424[_0x48b590(0x14c)](_0x288eab))return![];if(_0x3e6bb3)return _0x4a5ff5===_0x3d7d4e||_0x4a5ff5[_0x48b590(0x181)](_0x3d7d4e+'/');return!![];});}export function findJourneysToDelete(_0x5c8850,_0x41aedb,_0x57d5bd,_0x5c237c,_0xb40f1c){const _0xc3b658=a151_0x35cf28,_0x33536a=new Set();for(const {yamlConfig:_0xaf455d,folderPath:_0xb17a5f}of _0x41aedb){_0x33536a[_0xc3b658(0x18a)](_0xb17a5f+':'+_0xaf455d[_0xc3b658(0x15b)]);}return _0x5c8850['filter'](_0x3cbbc2=>{const _0x22b242=_0xc3b658,_0x340b33=_0x3cbbc2[_0x22b242(0x15f)]?_0x57d5bd['get'](_0x3cbbc2['folderId'])||'':'',_0x5e891f=_0x340b33+':'+_0x3cbbc2[_0x22b242(0x179)];if(_0x33536a[_0x22b242(0x14c)](_0x5e891f))return![];if(_0xb40f1c)return _0x340b33===_0x5c237c||_0x340b33['startsWith'](_0x5c237c+'/');return!![];});}export function buildSegmentLookupMap(_0x425424,_0x18e5b5){const _0x1405ff=a151_0x35cf28,_0x33750=new Map();for(const _0x52dcf5 of _0x425424){const _0x584ba5=_0x52dcf5[_0x1405ff(0x141)]?_0x18e5b5[_0x1405ff(0x14e)](_0x52dcf5[_0x1405ff(0x141)][_0x1405ff(0x1eb)]())||'':'',_0x5c055f=_0x584ba5+':'+_0x52dcf5[_0x1405ff(0x15b)];_0x33750['set'](_0x5c055f,_0x52dcf5);}return _0x33750;}export function buildSegmentNameToIdMap(_0x52108c){const _0x994583=a151_0x35cf28,_0x1a1cb6=new Map();for(const _0x412eac of _0x52108c){_0x1a1cb6['set'](_0x412eac[_0x994583(0x15b)],_0x412eac['id']);}return _0x1a1cb6;}export function buildJourneyBundleLookupMap(_0x413da5,_0x440b93){const _0x25bb3b=a151_0x35cf28,_0x59a879=new Map();for(const _0x5e26d5 of _0x413da5){const _0xbdfff9=_0x5e26d5[_0x25bb3b(0x15f)]?_0x440b93[_0x25bb3b(0x14e)](_0x5e26d5['folderId'])||'':'',_0x3a10c5=_0xbdfff9+':'+_0x5e26d5['journeyBundleName'];!_0x59a879[_0x25bb3b(0x14c)](_0x3a10c5)&&_0x59a879[_0x25bb3b(0xf5)](_0x3a10c5,[]),_0x59a879[_0x25bb3b(0x14e)](_0x3a10c5)[_0x25bb3b(0x19b)](_0x5e26d5);}for(const _0x507d98 of _0x59a879['values']()){_0x507d98[_0x25bb3b(0x17a)]((_0x7c629d,_0x412fc1)=>(_0x7c629d[_0x25bb3b(0x11c)]||0x0)-(_0x412fc1[_0x25bb3b(0x11c)]||0x0));}return _0x59a879;}export function collectFoldersToCreate(_0x5d01c1,_0x5a6cc1){const _0x33aa94=a151_0x35cf28,_0x3c6afa=new Set();for(const _0x53ebf3 of _0x5d01c1){if(!_0x53ebf3)continue;if(_0x5a6cc1[_0x33aa94(0x14c)](_0x53ebf3))continue;const _0x3c5926=_0x53ebf3[_0x33aa94(0x157)]('/');let _0x9569a3='';for(const _0x1eea4d of _0x3c5926){_0x9569a3=_0x9569a3?_0x9569a3+'/'+_0x1eea4d:_0x1eea4d,!_0x5a6cc1[_0x33aa94(0x14c)](_0x9569a3)&&_0x3c6afa['add'](_0x9569a3);}}return _0x3c6afa;}export function parseAndClassifyYamlFiles(_0x4268af,_0x296a64,_0xce9d6e){const _0x1315fb=a151_0x35cf28,_0x2a7b5b=[],_0x157cd0=[];for(const _0x590ad5 of _0x4268af){const _0x2446cb=a151_0x5f3456[_0x1315fb(0x17e)](_0x296a64,a151_0x5f3456[_0x1315fb(0x13e)](_0x590ad5)),_0x54dcf8=_0x2446cb==='.'?'':_0x2446cb,_0x3593d0=readFileSync(_0x590ad5,_0x1315fb(0x132)),_0x30a90f=a151_0x2b4032[_0x1315fb(0xfe)](_0x3593d0);if(isJourneyDef(_0x30a90f)){const _0x16bb28=a151_0xcaeed4(_0x3593d0);_0x157cd0[_0x1315fb(0x19b)]({'yamlConfig':_0x16bb28,'folderPath':_0x54dcf8,'sourcePath':_0x590ad5});}else{if(!_0xce9d6e?.['skipSegments']){const _0x51217b=parseSegmentYamlFile(_0x3593d0),_0x353e35=normalizeChildSegmentYaml(_0x51217b);_0x2a7b5b[_0x1315fb(0x19b)]({'yamlConfig':_0x353e35,'folderPath':_0x54dcf8,'sourcePath':_0x590ad5});}}}return{'segments':_0x2a7b5b,'journeys':_0x157cd0};}export function validateParsedFiles(_0x1b4e69,_0x4e0ca4){const _0x419408=a151_0x35cf28,_0x43cb1b=[];for(const {yamlConfig:_0x4249dc,sourcePath:_0x3abb8d}of _0x1b4e69['segments']){const _0x46bdb0=readFileSync(_0x3abb8d,_0x419408(0x132)),_0x32722a=a151_0x2b4032[_0x419408(0x167)](_0x46bdb0),_0x11fda4=validateSegmentDef(_0x4249dc,{'source':_0x46bdb0,'document':_0x32722a},{'skipSchema':!![]});if(!_0x11fda4[_0x419408(0x1bc)]){const _0x15464c=a151_0x5f3456[_0x419408(0x17e)](_0x4e0ca4,_0x3abb8d);_0x43cb1b[_0x419408(0x19b)]({'filePath':_0x15464c,'source':_0x46bdb0,'result':_0x11fda4,'isJourney':![]});}}for(const {yamlConfig:_0x4a1b9e,sourcePath:_0x2ffc3b}of _0x1b4e69[_0x419408(0x1e2)]){const _0x169acf=readFileSync(_0x2ffc3b,_0x419408(0x132)),_0x255d28=a151_0x2b4032[_0x419408(0x167)](_0x169acf),_0x1ea208=validateJourneyDef(_0x4a1b9e,{'source':_0x169acf,'document':_0x255d28},{'skipSchema':!![]});if(!_0x1ea208[_0x419408(0x1bc)]){const _0x3c8249=a151_0x5f3456[_0x419408(0x17e)](_0x4e0ca4,_0x2ffc3b);_0x43cb1b['push']({'filePath':_0x3c8249,'source':_0x169acf,'result':_0x1ea208,'isJourney':!![]});}}return _0x43cb1b;}export function formatValidationErrors(_0x185f7f){const _0x4bc7bf=a151_0x35cf28,_0x1d968f=[];for(const {filePath:_0x550f24,source:_0x24814b,result:_0x35e47d,isJourney:_0xe8bd2b}of _0x185f7f){const _0x2c89f7=_0xe8bd2b?_0x4bc7bf(0x149):_0x4bc7bf(0x1ab);_0x1d968f[_0x4bc7bf(0x19b)]('\x0a'+_0x550f24+'\x20('+_0x2c89f7+_0x4bc7bf(0x170)+_0x35e47d[_0x4bc7bf(0x137)]['length']+_0x4bc7bf(0x1c1)),_0x1d968f['push'](formatValidationResult(_0x35e47d,_0x24814b,_0x550f24));}return _0x1d968f[_0x4bc7bf(0x1dd)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2d268b){const _0x38ea6c=a151_0x35cf28,_0x3d17ca=new Set(),_0x380e01=new Map(),_0x18f4ff=collectSegmentUsageCounts(_0x2d268b);if(_0x2d268b[_0x38ea6c(0x136)])for(const [_0xb585de,_0x3b4eba]of Object['entries'](_0x2d268b[_0x38ea6c(0x136)])){_0x3d17ca[_0x38ea6c(0x18a)](_0xb585de);if(_0x3b4eba['rule']){const _0xb204a3=yamlRuleToApi(_0x3b4eba['rule']),_0x468c8a=apiRuleToYaml(_0xb204a3);_0x380e01[_0x38ea6c(0xf5)](_0xb585de,_0x468c8a);}}const _0x29d1e5=new Map();let _0x3e6624=0x0;for(const [_0x5312ce,_0x39d9b8]of _0x380e01){const _0x2193b8=serializeExpandedRule(_0x39d9b8,_0x380e01),_0x2ce099=_0x29d1e5[_0x38ea6c(0x14e)](_0x2193b8)||[];_0x2ce099[_0x38ea6c(0x19b)]({'name':_0x5312ce,'index':_0x3e6624}),_0x29d1e5['set'](_0x2193b8,_0x2ce099),_0x3e6624++;}const _0x20a64e=new Map();for(const [_0x2048e8,_0x1d11a5]of _0x29d1e5){const _0x4cd2a9=_0x1d11a5['slice']()[_0x38ea6c(0x17a)]((_0x53cc47,_0x3ac8c8)=>{const _0x419b85=_0x38ea6c,_0x5b5296=_0x18f4ff[_0x419b85(0x14e)](_0x53cc47[_0x419b85(0x15b)])||0x0,_0x2e6102=_0x18f4ff[_0x419b85(0x14e)](_0x3ac8c8['name'])||0x0;if(_0x5b5296!==_0x2e6102)return _0x2e6102-_0x5b5296;return _0x53cc47['index']-_0x3ac8c8[_0x419b85(0x12f)];})[_0x38ea6c(0x16b)](_0x4d840d=>_0x4d840d[_0x38ea6c(0x15b)]),_0x480a7a=[];for(const _0x495f72 of _0x4cd2a9){const _0x8b3f43=_0x18f4ff[_0x38ea6c(0x14e)](_0x495f72)||0x0,_0x14663e=Math[_0x38ea6c(0xf3)](_0x8b3f43,0x1);for(let _0x115d03=0x0;_0x115d03<_0x14663e;_0x115d03++){_0x480a7a[_0x38ea6c(0x19b)](_0x495f72);}}_0x20a64e[_0x38ea6c(0xf5)](_0x2048e8,_0x480a7a);}return{'existingLocalSegmentNames':_0x3d17ca,'localSegmentRules':_0x380e01,'localExpandedRuleToNames':_0x20a64e};}export function createSegmentIdResolver(_0x4034b9,_0x349e46){return async _0x19fb33=>{const _0x1a3a2a=a151_0xb026,_0x4a1749=_0x4034b9[_0x1a3a2a(0x14e)](_0x19fb33);if(!_0x4a1749)throw new SDKError(ErrorCode[_0x1a3a2a(0x199)],_0x1a3a2a(0x100)+_0x19fb33+_0x1a3a2a(0x1ba)+_0x349e46+'\x27)');return _0x4a1749;};}export function extractRootFolderId(_0x4291da){const _0x417bf8=a151_0x35cf28;return _0x4291da[_0x417bf8(0x182)]?.[_0x417bf8(0x1ea)]?.[_0x417bf8(0x1ec)]?.['id']||_0x4291da[_0x417bf8(0x182)]?.[_0x417bf8(0x16c)]?.[_0x417bf8(0x1ec)]?.['id'];}export function buildConnectionMaps(_0x2fd884){const _0x50ccea=a151_0x35cf28,_0x1cc437=new Map(),_0x3c8c1c=new Map(),_0x3f8855=new Map();for(const _0x319a34 of _0x2fd884){_0x1cc437[_0x50ccea(0xf5)](_0x319a34[_0x50ccea(0x15b)],parseInt(_0x319a34['id'],0xa)),_0x3c8c1c['set'](_0x319a34['id'],_0x319a34[_0x50ccea(0x15b)]),_0x3f8855['set'](_0x319a34['name'],_0x319a34['type']);}return{'nameToId':_0x1cc437,'idToName':_0x3c8c1c,'nameToType':_0x3f8855};}export function calculatePushStats(_0x5f00f5,_0xe1f663,_0x3532ab,_0x11ddd1,_0x1a0349,_0x44ca1c,_0x4ff27a){const _0x51f60d=a151_0x35cf28,_0x3066b9=_0x5f00f5[_0x51f60d(0x10a)](_0x5ee28f=>_0x5ee28f[_0x51f60d(0x1cb)]),_0x3543e3=_0x5f00f5[_0x51f60d(0x10a)](_0x3802ad=>!_0x3802ad[_0x51f60d(0x1cb)]&&_0x3802ad[_0x51f60d(0x168)]),_0x200d09=_0x5f00f5['filter'](_0x1adbc3=>!_0x1adbc3[_0x51f60d(0x1cb)]&&!_0x1adbc3['hasChanges']),_0x3bfb7d=_0x44ca1c?_0x11ddd1:[],_0x3f80d3=_0xe1f663['filter'](_0xb0f7a2=>_0xb0f7a2['isNew']),_0x47c07b=_0xe1f663[_0x51f60d(0x10a)](_0x1cba3f=>!_0x1cba3f[_0x51f60d(0x1cb)]&&_0x1cba3f[_0x51f60d(0x168)]),_0x44a578=_0xe1f663[_0x51f60d(0x10a)](_0x5a0422=>!_0x5a0422[_0x51f60d(0x1cb)]&&!_0x5a0422['hasChanges']),_0x1c6aa7=_0x44ca1c?_0x1a0349:[],_0x2bbd16=_0x5f00f5[_0x51f60d(0xed)](_0x3f11b4=>_0x3f11b4[_0x51f60d(0x111)]),_0x45866e=_0x2bbd16[_0x51f60d(0x10a)](_0x1696ce=>_0x1696ce[_0x51f60d(0x152)]===_0x51f60d(0x187)),_0x5d60b7=_0x2bbd16[_0x51f60d(0x10a)](_0x4fcfa6=>_0x4fcfa6[_0x51f60d(0x152)]==='update'),_0x419188=_0x2bbd16[_0x51f60d(0x10a)](_0x9ad505=>_0x9ad505[_0x51f60d(0x152)]==='delete'),_0x44784a=Array[_0x51f60d(0x105)](_0x3532ab)[_0x51f60d(0x17a)](),_0x212845=_0x4ff27a?![]:_0x3066b9['length']>0x0||_0x3543e3[_0x51f60d(0x1e8)]>0x0||_0x3bfb7d[_0x51f60d(0x1e8)]>0x0,_0x1e7604=_0x3f80d3['length']>0x0||_0x47c07b[_0x51f60d(0x1e8)]>0x0||_0x1c6aa7[_0x51f60d(0x1e8)]>0x0,_0x218fc2=_0x4ff27a?![]:_0x2bbd16[_0x51f60d(0x1e8)]>0x0,_0x1915a7=_0x44784a[_0x51f60d(0x1e8)]>0x0;return{'segments':{'new':_0x3066b9,'changed':_0x3543e3,'unchanged':_0x200d09,'toDelete':_0x3bfb7d},'journeys':{'new':_0x3f80d3,'changed':_0x47c07b,'unchanged':_0x44a578,'toDelete':_0x1c6aa7},'activations':{'all':_0x2bbd16,'toCreate':_0x45866e,'toUpdate':_0x5d60b7,'toDelete':_0x419188},'folders':{'toCreate':_0x44784a},'counts':{'segments':{'new':_0x3066b9[_0x51f60d(0x1e8)],'changed':_0x3543e3[_0x51f60d(0x1e8)],'unchanged':_0x200d09[_0x51f60d(0x1e8)],'toDelete':_0x3bfb7d[_0x51f60d(0x1e8)]},'journeys':{'new':_0x3f80d3['length'],'changed':_0x47c07b[_0x51f60d(0x1e8)],'unchanged':_0x44a578[_0x51f60d(0x1e8)],'toDelete':_0x1c6aa7[_0x51f60d(0x1e8)]},'activations':{'create':_0x45866e[_0x51f60d(0x1e8)],'update':_0x5d60b7[_0x51f60d(0x1e8)],'delete':_0x419188[_0x51f60d(0x1e8)]},'folders':_0x44784a[_0x51f60d(0x1e8)]},'hasChanges':_0x212845||_0x1e7604||_0x218fc2||_0x1915a7};}export async function buildPushExecutionContext(_0x4acef6,_0x3390f9,_0x18a8fc,_0x544d47,_0x287a96,_0x639403){const _0x255f8=a151_0x35cf28,_0x255f44=extractRootFolderId(_0x18a8fc),{pathToId:_0x4d2f6c,idToPath:_0x53bce1}=buildFolderMaps(_0x287a96),_0x138c0f=buildSegmentNameToIdMap(_0x544d47),_0x35ae94=new Map(),{batchAsync:_0x372bf1}=await import(_0x255f8(0x11f)),[_0x32b7d0,_0x2f5363]=await Promise[_0x255f8(0x156)]([_0x4acef6[_0x255f8(0x12c)][_0x255f8(0x1b4)](),_0x4acef6[_0x255f8(0x18b)][_0x255f8(0x10b)](),((async()=>{const _0xa29ff9=_0x255f8;!_0x639403&&_0x544d47[_0xa29ff9(0x1e8)]>0x0&&await _0x372bf1(_0x544d47,async _0x38f311=>{const _0x28253e=_0xa29ff9,_0x90c9d5=await _0x4acef6[_0x28253e(0x1ab)][_0x28253e(0x129)](_0x3390f9,_0x38f311['id']);_0x35ae94[_0x28253e(0xf5)](_0x38f311['id'],_0x90c9d5);});})())]),{emailToId:_0x150631,idToEmail:_0x5cf1a5}=_0x32b7d0,_0x5c507f=buildConnectionMaps(_0x2f5363);return{'rootFolderId':_0x255f44,'folderPathToId':_0x4d2f6c,'folderIdToPath':_0x53bce1,'segmentNameToId':_0x138c0f,'activationsBySegmentId':_0x35ae94,'emailToIdMap':_0x150631,'idToEmailMap':_0x5cf1a5,'connectionNameToIdMap':_0x5c507f[_0x255f8(0x1ce)],'connectionIdToNameMap':_0x5c507f[_0x255f8(0xe8)],'connectionNameToTypeMap':_0x5c507f[_0x255f8(0x122)]};}export function createPushYamlContextForBundle(_0x1f02a5,_0x433ad8,_0x548bc3,_0x57bcdd,_0xb33365,_0x9c0130,_0x4e708a,_0x3cb814){const {existingLocalSegmentNames:_0x832647,localExpandedRuleToNames:_0x30f306}=_0x57bcdd,_0x1c956b=new Set(),_0x38f4be=new Map(),_0xe99928=new Map(),_0x5f2861=new Map(),_0x487f63=createJumpTargetCache(),_0x525779=new Map(),_0x267ccf=new Map(),_0x1a2418=new Set();let _0x4eb650;const _0x3e43d8=_0x52c540=>{const _0x131eca={'resolveSegment':async _0x3c2449=>{const _0x2518a1=a151_0xb026,_0x5944ad=_0x5f2861[_0x2518a1(0x14e)](_0x3c2449);if(_0x5944ad!==undefined)return{'name':_0x5944ad,'isJourneyLocal':!![]};try{const _0x14bfaa=await fetchSegment(_0x1f02a5,_0x433ad8,_0x3c2449,_0x548bc3);if(!_0x14bfaa)throw new Error(_0x2518a1(0x128));const _0x37db3a=generateJourneyLocalName(_0x14bfaa[_0x2518a1(0x15b)]),_0x2325e9=_0x14bfaa['kind']===SEGMENT_KIND_JOURNEY&&_0x37db3a!==undefined;let _0x576868=_0x14bfaa[_0x2518a1(0x15b)],_0x131951;if(_0x2325e9&&_0x14bfaa[_0x2518a1(0x190)]){const _0x5a766c=apiRuleToYaml(_0x14bfaa[_0x2518a1(0x190)]);_0x267ccf['set'](_0x3c2449,_0x5a766c);const _0x2315ca=async _0x2a1c74=>{const _0x3d3e11=_0x2518a1,_0x45d0b6=collectSegmentRefsFromRule(_0x2a1c74);for(const _0x2e5298 of _0x45d0b6){if(!_0x267ccf[_0x3d3e11(0x14c)](_0x2e5298))try{const _0x46371d=await fetchSegment(_0x1f02a5,_0x433ad8,_0x2e5298,_0x548bc3);if(_0x46371d?.[_0x3d3e11(0x190)]){const _0x5a5151=apiRuleToYaml(_0x46371d[_0x3d3e11(0x190)]);_0x267ccf['set'](_0x2e5298,_0x5a5151),await _0x2315ca(_0x5a5151);}}catch(_0x4a4cb3){logger[_0x3d3e11(0x153)](_0x3d3e11(0x1de)+_0x2e5298+':\x20'+_0x4a4cb3);}}};await _0x2315ca(_0x5a766c);const _0xbbaa2f=serializeExpandedRule(_0x5a766c,_0x267ccf),_0x29b25b=_0x30f306['get'](_0xbbaa2f);if(_0x29b25b&&_0x29b25b['length']>0x0){const _0x43c9b9=_0x38f4be[_0x2518a1(0x14e)](_0xbbaa2f)||0x0,_0x1a5662=_0x29b25b[_0x43c9b9]||_0x29b25b[_0x29b25b[_0x2518a1(0x1e8)]-0x1];_0x38f4be[_0x2518a1(0xf5)](_0xbbaa2f,_0x43c9b9+0x1),_0x576868=_0x1a5662,_0x1c956b[_0x2518a1(0x18a)](_0x576868),_0x5f2861[_0x2518a1(0xf5)](_0x3c2449,_0x576868);const _0x29c25a=await resolveRuleSegmentRefs(_0x5a766c,async _0x2ef6f9=>{const _0x32b676=_0x2518a1,_0x31b4b2=_0x5f2861[_0x32b676(0x14e)](_0x2ef6f9);if(_0x31b4b2)return _0x31b4b2;const _0x4bac1e=await _0x4eb650[_0x32b676(0x11d)](_0x2ef6f9);return _0x4bac1e['name'];});_0x131951={'description':_0x14bfaa['description'],'rule':_0x29c25a};}else{const _0xe2c49f=_0x525779[_0x2518a1(0x14e)](_0xbbaa2f);if(_0xe2c49f)_0x576868=_0xe2c49f,_0x5f2861['set'](_0x3c2449,_0x576868);else{if(_0x37db3a){let _0x257332=_0x37db3a,_0x3f4952=0x2;while(_0x1c956b[_0x2518a1(0x14c)](_0x257332)||_0x832647[_0x2518a1(0x14c)](_0x257332)){_0x257332=_0x37db3a+'_'+_0x3f4952,_0x3f4952++;}_0x1c956b[_0x2518a1(0x18a)](_0x257332),_0x576868=_0x257332;}_0x5f2861[_0x2518a1(0xf5)](_0x3c2449,_0x576868),_0x525779['set'](_0xbbaa2f,_0x576868);const _0x2ae6e1=await resolveRuleSegmentRefs(_0x5a766c,async _0x4c57cc=>{const _0x3cfbec=_0x2518a1,_0xac7cf1=_0x5f2861[_0x3cfbec(0x14e)](_0x4c57cc);if(_0xac7cf1)return _0xac7cf1;const _0x56b277=await _0x4eb650[_0x3cfbec(0x11d)](_0x4c57cc);return _0x56b277[_0x3cfbec(0x15b)];});_0x131951={'description':_0x14bfaa[_0x2518a1(0x12b)],'rule':_0x2ae6e1};}}}return{'name':_0x576868,'isJourneyLocal':_0x2325e9,'definition':_0x131951};}catch(_0x452b8a){return logger[_0x2518a1(0x153)](_0x2518a1(0x142)+_0x3c2449+':\x20'+_0x452b8a),{'name':_0x3c2449,'isJourneyLocal':![]};}},'resolveActivation':async _0x299a93=>{const _0x76feb6=a151_0xb026,_0x432a19=_0xe99928[_0x76feb6(0x14e)](_0x299a93);if(_0x432a19!==undefined)return{'name':_0x432a19,'isJourneyLocal':!![]};try{let _0x35b9f9=_0x4e708a?.[_0x76feb6(0x14e)](_0x299a93);!_0x35b9f9&&(_0x35b9f9=await _0x1f02a5[_0x76feb6(0x149)][_0x76feb6(0x16d)](_0x52c540,_0x299a93));const _0xca774a=_0x35b9f9['attributes'][_0x76feb6(0x1d6)]['name']||_0x299a93,_0x855448=sanitizeYamlKey(_0xca774a)||_0x76feb6(0x160)+_0x299a93,_0x4d0747=_0x855448;_0xe99928[_0x76feb6(0xf5)](_0x299a93,_0x4d0747);const _0x53a041=journeyActivationStepToYaml(_0x35b9f9,_0xb33365,_0x9c0130);return{'name':_0x4d0747,'isJourneyLocal':!![],'definition':_0x53a041};}catch(_0x179661){return logger[_0x76feb6(0x153)]('Failed\x20to\x20resolve\x20activation\x20'+_0x299a93+':\x20'+_0x179661),{'name':_0x299a93,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2c99d5,_0x43b0fe)=>resolveJumpTarget(_0x2c99d5,_0x43b0fe,_0x487f63,async _0x53808c=>{const _0x496035=a151_0xb026,_0x5d2e8e=_0x3cb814?.[_0x496035(0x14e)](_0x53808c);if(_0x5d2e8e)return _0x5d2e8e;return _0x1f02a5[_0x496035(0x149)]['getJourney'](_0x53808c);})};return _0x4eb650=_0x131eca,_0x131eca;},_0x38c06b=async _0x1a3006=>{const _0x254880=a151_0xb026,{collectSegmentIdsFromJourneyApi:_0x3b2710}=await import(_0x254880(0xfc)),{batchAsync:_0x570e15}=await import(_0x254880(0x11f)),_0x512a69=new Set();for(const _0x5025ef of _0x1a3006){let _0x5b51b1=_0x3cb814?.[_0x254880(0x14e)](_0x5025ef);!_0x5b51b1&&(_0x5b51b1=await _0x1f02a5[_0x254880(0x149)]['getJourney'](_0x5025ef));const _0x291241=_0x3b2710(_0x5b51b1);for(const _0x4502f6 of _0x291241){_0x512a69[_0x254880(0x18a)](_0x4502f6);}}let _0x276f7b=Array['from'](_0x512a69);while(_0x276f7b['length']>0x0){const _0x2ab455=_0x276f7b[_0x254880(0x10a)](_0x337415=>!_0x1a2418[_0x254880(0x14c)](_0x337415));if(_0x2ab455['length']===0x0)break;const _0xeb39b8=await _0x570e15(_0x2ab455,async _0x64c20f=>{const _0x32ac25=_0x254880;_0x1a2418[_0x32ac25(0x18a)](_0x64c20f);const _0x38f6b8=await fetchSegment(_0x1f02a5,_0x433ad8,_0x64c20f,_0x548bc3);if(!_0x38f6b8)return null;return{'segmentId':_0x64c20f,'segment':_0x38f6b8};},0xa),_0x47985b=new Set();for(const _0x2fd0ba of _0xeb39b8){if(!_0x2fd0ba?.[_0x254880(0x1ab)]?.['rule'])continue;const _0x2bdd97=apiRuleToYaml(_0x2fd0ba[_0x254880(0x1ab)][_0x254880(0x190)]);_0x267ccf['set'](_0x2fd0ba[_0x254880(0x13c)],_0x2bdd97);const _0x6df5ab=collectSegmentRefsFromRule(_0x2bdd97);for(const _0x7bfff5 of _0x6df5ab){!_0x1a2418['has'](_0x7bfff5)&&_0x47985b[_0x254880(0x18a)](_0x7bfff5);}}_0x276f7b=Array[_0x254880(0x105)](_0x47985b);}};return{'createYamlContext':_0x3e43d8,'prefetchJourneySegments':_0x38c06b};}export async function executePushSegments(_0x2e0934,_0x7c97a5,_0x4c2aae,_0x1e409a,_0x1fe5bd){const _0x4079ca=a151_0x35cf28,{segmentDefToCreateRequest:_0x22fa38,segmentDefToUpdateRequest:_0x124b2b}=await import(_0x4079ca(0x1b5)),_0x228fa3=_0x4c2aae['folderPathToId'],_0x1ee0be=0x5,_0xb6fbec=async _0x36576c=>{const _0x3df497=_0x4079ca,_0x45b213=_0x36576c[_0x3df497(0x177)]?_0x228fa3[_0x3df497(0x14e)](_0x36576c[_0x3df497(0x177)]):undefined;let _0x3a0048;const _0x26c4d6={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x52daee=_0x36576c['yamlConfig'];if(_0x36576c[_0x3df497(0x1a0)]['rule']){const _0x25de34=createSegmentIdResolver(_0x4c2aae['segmentNameToId'],_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]),_0x230f7e=await resolveRuleSegmentIds(_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x190)],_0x25de34);_0x52daee={..._0x36576c[_0x3df497(0x1a0)],'rule':_0x230f7e};}try{if(_0x36576c[_0x3df497(0x1cb)]){_0x1fe5bd['onProgress']?.({'type':_0x3df497(0x146),'name':_0x36576c[_0x3df497(0x1a0)]['name']});const _0x266a65=_0x22fa38(_0x52daee,_0x45b213),_0x3286b6=await _0x1fe5bd[_0x3df497(0x148)](_0x3df497(0xee)+_0x36576c['yamlConfig'][_0x3df497(0x15b)]+'\x27...',()=>_0x2e0934['segment'][_0x3df497(0xe3)](_0x1e409a['parentId'],_0x266a65));_0x3a0048=_0x3286b6['data']['id'],_0x4c2aae[_0x3df497(0x189)]['set'](_0x36576c['yamlConfig'][_0x3df497(0x15b)],_0x3a0048),_0x26c4d6[_0x3df497(0x1b3)]={'name':_0x36576c['yamlConfig'][_0x3df497(0x15b)],'id':_0x3a0048},_0x1fe5bd[_0x3df497(0x131)]?.({'type':'segment_created','name':_0x36576c[_0x3df497(0x1a0)]['name'],'segmentId':_0x3a0048}),_0x1fe5bd[_0x3df497(0x1e7)]?.(_0x3df497(0x186)+_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]+'\x27'),_0x26c4d6[_0x3df497(0x103)]=0x1;}else{if(_0x36576c[_0x3df497(0x168)]){_0x1fe5bd[_0x3df497(0x131)]?.({'type':'segment_updating','name':_0x36576c['yamlConfig'][_0x3df497(0x15b)]});const _0x5cadb4=_0x124b2b(_0x52daee);_0x45b213!==_0x36576c[_0x3df497(0x173)]?.['segmentFolderId']&&(_0x5cadb4[_0x3df497(0x141)]=_0x45b213?parseInt(_0x45b213,0xa):undefined),await _0x1fe5bd[_0x3df497(0x148)]('Updating\x20segment\x20\x27'+_0x36576c['yamlConfig']['name']+_0x3df497(0x12d),()=>_0x2e0934[_0x3df497(0x1ab)][_0x3df497(0x197)](_0x1e409a[_0x3df497(0xf0)],_0x36576c[_0x3df497(0x173)]['id'],_0x5cadb4)),_0x3a0048=_0x36576c[_0x3df497(0x173)]['id'],_0x1fe5bd[_0x3df497(0x131)]?.({'type':_0x3df497(0x19e),'name':_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]}),_0x1fe5bd[_0x3df497(0x1e7)]?.('Updated\x20segment\x20\x27'+_0x36576c['yamlConfig'][_0x3df497(0x15b)]+'\x27'),_0x26c4d6[_0x3df497(0x178)]=0x1;}else _0x3a0048=_0x36576c['existingSegment']['id'];}}catch(_0x3aaa41){const _0x44138b=isHttp400Error(_0x3aaa41),_0x4b7771=_0x44138b?ErrorCode[_0x3df497(0x121)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x29734e=getErrorMessage(_0x3aaa41);throw new SDKError(_0x4b7771,_0x3df497(0x104)+(_0x36576c[_0x3df497(0x1cb)]?_0x3df497(0x187):_0x3df497(0xe5))+_0x3df497(0x1db)+_0x36576c[_0x3df497(0x169)]+_0x3df497(0x16e)+_0x29734e,_0x3aaa41);}try{const _0x18af35=await syncActivationsForSegment(_0x2e0934,_0x1e409a[_0x3df497(0xf0)],_0x3a0048,_0x36576c['yamlConfig'][_0x3df497(0x15b)],_0x36576c[_0x3df497(0x111)],_0x1fe5bd,_0x36576c[_0x3df497(0x169)]);_0x26c4d6[_0x3df497(0x116)]=_0x18af35;}catch(_0x381139){if(_0x381139 instanceof SDKError)throw _0x381139;throw new SDKError(ErrorCode[_0x3df497(0xfa)],_0x3df497(0x174)+_0x36576c[_0x3df497(0x1a0)][_0x3df497(0x15b)]+'\x27\x20from\x20file:\x20'+_0x36576c[_0x3df497(0x169)]+_0x3df497(0x16e)+getErrorMessage(_0x381139),_0x381139);}return _0x26c4d6;},_0x518117=await batchAsync(_0x7c97a5,_0xb6fbec,_0x1ee0be),_0x3f5a1={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x55d653 of _0x518117){_0x3f5a1[_0x4079ca(0x103)]+=_0x55d653[_0x4079ca(0x103)],_0x3f5a1[_0x4079ca(0x178)]+=_0x55d653[_0x4079ca(0x178)],_0x55d653['createdSegmentId']&&_0x3f5a1['createdSegmentIds'][_0x4079ca(0xf5)](_0x55d653[_0x4079ca(0x1b3)][_0x4079ca(0x15b)],_0x55d653[_0x4079ca(0x1b3)]['id']),_0x3f5a1[_0x4079ca(0x116)][_0x4079ca(0x103)]+=_0x55d653['activations']['created'],_0x3f5a1['activations'][_0x4079ca(0x178)]+=_0x55d653[_0x4079ca(0x116)][_0x4079ca(0x178)],_0x3f5a1[_0x4079ca(0x116)][_0x4079ca(0x176)]+=_0x55d653[_0x4079ca(0x116)]['deleted'];}return _0x3f5a1;}async function syncActivationsForSegment(_0x288ea2,_0x3e5c0a,_0x31d7b2,_0x295d50,_0xe4c019,_0xede866,_0x300aa3){const _0x3e35ea=a151_0x35cf28,_0x318981={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2d9b24 of _0xe4c019){try{if(_0x2d9b24['type']==='create'&&_0x2d9b24['validatedRequest'])_0xede866[_0x3e35ea(0x131)]?.({'type':'activation_creating','segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),await _0xede866[_0x3e35ea(0x148)](_0x3e35ea(0x1be)+_0x2d9b24[_0x3e35ea(0x15b)]+_0x3e35ea(0x12d),()=>_0x288ea2[_0x3e35ea(0x1ab)][_0x3e35ea(0x19f)](_0x3e5c0a,_0x31d7b2,_0x2d9b24[_0x3e35ea(0x1cf)])),_0xede866['onProgress']?.({'type':_0x3e35ea(0x1da),'segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),_0xede866[_0x3e35ea(0x1e7)]?.('Created\x20activation\x20\x27'+_0x2d9b24[_0x3e35ea(0x15b)]+'\x27'),_0x318981['created']++;else{if(_0x2d9b24[_0x3e35ea(0x152)]===_0x3e35ea(0xe5)&&_0x2d9b24[_0x3e35ea(0x1cf)]&&_0x2d9b24[_0x3e35ea(0x150)])_0xede866['onProgress']?.({'type':_0x3e35ea(0x1ca),'segmentName':_0x295d50,'activationName':_0x2d9b24['name']}),await _0xede866[_0x3e35ea(0x148)](_0x3e35ea(0x1d1)+_0x2d9b24[_0x3e35ea(0x15b)]+_0x3e35ea(0x12d),()=>_0x288ea2[_0x3e35ea(0x1ab)][_0x3e35ea(0x1b0)](_0x3e5c0a,_0x31d7b2,_0x2d9b24['existingActivation']['id'],_0x2d9b24[_0x3e35ea(0x1cf)])),_0xede866[_0x3e35ea(0x131)]?.({'type':_0x3e35ea(0x1d8),'segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),_0xede866[_0x3e35ea(0x1e7)]?.(_0x3e35ea(0x159)+_0x2d9b24[_0x3e35ea(0x15b)]+'\x27'),_0x318981[_0x3e35ea(0x178)]++;else _0x2d9b24[_0x3e35ea(0x152)]===_0x3e35ea(0x117)&&_0x2d9b24['existingActivation']&&(_0xede866[_0x3e35ea(0x131)]?.({'type':'activation_deleting','segmentName':_0x295d50,'activationName':_0x2d9b24['name']}),await _0xede866[_0x3e35ea(0x148)](_0x3e35ea(0x161)+_0x2d9b24['name']+_0x3e35ea(0x12d),()=>_0x288ea2['segment'][_0x3e35ea(0x1b7)](_0x3e5c0a,_0x31d7b2,_0x2d9b24[_0x3e35ea(0x150)]['id'])),_0xede866[_0x3e35ea(0x131)]?.({'type':_0x3e35ea(0x166),'segmentName':_0x295d50,'activationName':_0x2d9b24[_0x3e35ea(0x15b)]}),_0xede866['logDeleted']?.(_0x3e35ea(0x118)+_0x2d9b24['name']+'\x27'),_0x318981[_0x3e35ea(0x176)]++);}}catch(_0x1cf3b5){const _0xc09605=isHttp400Error(_0x1cf3b5),_0x5b4630=_0xc09605?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x3e35ea(0xfa)],_0x3614f7=getErrorMessage(_0x1cf3b5);throw new SDKError(_0x5b4630,_0x3e35ea(0x104)+_0x2d9b24['type']+'\x20activation\x20\x27'+_0x2d9b24[_0x3e35ea(0x15b)]+_0x3e35ea(0x194)+_0x300aa3+_0x3e35ea(0x16e)+_0x3614f7,_0x1cf3b5);}}return _0x318981;}export async function executePushFolders(_0x3fcfee,_0x12bf8d,_0x1e0686,_0x1e41d3,_0x4b30ce){const _0x35c88c=a151_0x35cf28,_0x57ef5c=new Map(_0x1e0686),_0x5bc955=sortFoldersByDepth(_0x12bf8d);for(const _0x2354c8 of _0x5bc955){const _0x4b7a8f=_0x2354c8['split']('/'),_0xb33d27=_0x4b7a8f[_0x4b7a8f[_0x35c88c(0x1e8)]-0x1],_0x3ef5d3=_0x4b7a8f[_0x35c88c(0x1aa)](0x0,-0x1)['join']('/'),_0x3eda0a=_0x57ef5c[_0x35c88c(0x14e)](_0x3ef5d3);_0x4b30ce['onProgress']?.({'type':'folder_creating','folder':_0x2354c8});const _0x220c1c={'name':_0xb33d27,'parentFolderId':_0x3eda0a},_0xe02179=await _0x4b30ce[_0x35c88c(0x148)]('Creating\x20folder\x20\x27'+_0x2354c8+_0x35c88c(0x12d),()=>_0x3fcfee[_0x35c88c(0x1ab)]['createFolder'](_0x1e41d3['parentId'],_0x220c1c));_0x57ef5c[_0x35c88c(0xf5)](_0x2354c8,_0xe02179[_0x35c88c(0x1ec)]['id']),_0x4b30ce['onProgress']?.({'type':_0x35c88c(0x155),'folder':_0x2354c8,'folderId':_0xe02179['data']['id']}),_0x4b30ce[_0x35c88c(0x14d)]?.(_0x35c88c(0x19c)+_0x2354c8+'\x27');}return _0x57ef5c;}export async function executePushSegmentDeletions(_0x1d60b9,_0x2e0c13,_0x10a68c){const _0x14360a=a151_0x35cf28;if(_0x2e0c13[_0x14360a(0x1e8)]===0x0)return 0x0;const {batchAsync:_0x47e120}=await import(_0x14360a(0x11f)),_0xe99f3b=0x5,_0x56e64b=await _0x47e120(_0x2e0c13,async _0x1814b2=>{const _0x259b16=_0x14360a;return _0x10a68c[_0x259b16(0x131)]?.({'type':_0x259b16(0x13a),'name':_0x1814b2[_0x259b16(0x15b)]}),await _0x1d60b9[_0x259b16(0x1ab)]['deleteSegment'](_0x1814b2['id']),_0x10a68c[_0x259b16(0x131)]?.({'type':_0x259b16(0x133),'name':_0x1814b2[_0x259b16(0x15b)]}),_0x10a68c[_0x259b16(0x17c)]?.(_0x259b16(0x1ac)+_0x1814b2[_0x259b16(0x15b)]+'\x27'),0x1;},_0xe99f3b);return _0x56e64b[_0x14360a(0x106)]((_0x1c4688,_0x7f6c4)=>_0x1c4688+_0x7f6c4,0x0);}export async function executePushJourneys(_0x5e52d5,_0x10d542,_0x2c2a93,_0x4b1927,_0x2dc92f){const _0x222c3e=a151_0x35cf28,{journeyDefToRequest:_0x372c16}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x40ded6,yamlRuleToApi:_0x461104,validateSegmentRule:_0x2f89ce}=await import(_0x222c3e(0x1b5)),_0x226047={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x43f3a7=new Map(_0x2c2a93[_0x222c3e(0x189)]),_0x111ede=0x5;for(let _0x41fe09=0x0;_0x41fe09<_0x10d542[_0x222c3e(0x1e8)];_0x41fe09+=_0x111ede){const _0x2ac508=_0x10d542[_0x222c3e(0x1aa)](_0x41fe09,_0x41fe09+_0x111ede),_0x4d224b=await Promise[_0x222c3e(0x156)](_0x2ac508['map'](async _0x566a35=>{const _0x565b5d=_0x222c3e;if(!_0x566a35[_0x565b5d(0x1cb)]&&!_0x566a35[_0x565b5d(0x168)])return{'action':_0x565b5d(0x1d5),'name':_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)],'journeyId':_0x566a35[_0x565b5d(0x1d3)]?.['id']};const _0xe6c583=_0x566a35[_0x565b5d(0x177)]?_0x2c2a93[_0x565b5d(0x130)]['get'](_0x566a35[_0x565b5d(0x177)]):undefined;_0x2dc92f[_0x565b5d(0x131)]?.({'type':_0x566a35[_0x565b5d(0x1cb)]?'journey_creating':_0x565b5d(0x11a),'name':_0x566a35['yamlConfig'][_0x565b5d(0x15b)]});try{const _0x546f5c=await executeSingleJourneyPush(_0x5e52d5,_0x566a35,{..._0x2c2a93,'segmentNameToId':_0x43f3a7},{'parentId':_0x4b1927[_0x565b5d(0xf0)],'rootFolderId':_0x4b1927[_0x565b5d(0x1d4)],'folderId':_0xe6c583,'verbose':_0x4b1927[_0x565b5d(0x1ae)]},_0x2dc92f,{'journeyDefToRequest':_0x372c16,'activationDefToCreateRequest':_0x40ded6,'yamlRuleToApi':_0x461104,'validateSegmentRule':_0x2f89ce});for(const [_0x56460e,_0x48ea8]of _0x546f5c['embeddedSegmentNameToId']){_0x43f3a7[_0x565b5d(0xf5)](_0x56460e,_0x48ea8),_0x226047[_0x565b5d(0x1c5)][_0x565b5d(0xf5)](_0x56460e,_0x48ea8);}if(_0x546f5c[_0x565b5d(0x165)]===_0x565b5d(0x103))_0x2dc92f[_0x565b5d(0x131)]?.({'type':_0x565b5d(0x1d7),'name':_0x566a35['yamlConfig'][_0x565b5d(0x15b)],'journeyId':_0x546f5c['journeyId']}),_0x2dc92f['logSuccess']?.(_0x565b5d(0x115)+_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)]+'\x27'),_0x226047[_0x565b5d(0x103)]++;else _0x546f5c[_0x565b5d(0x165)]===_0x565b5d(0x178)&&(_0x2dc92f['onProgress']?.({'type':'journey_updated','name':_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)]}),_0x2dc92f[_0x565b5d(0x1e7)]?.('Updated\x20journey\x20\x27'+_0x566a35[_0x565b5d(0x1a0)]['name']+'\x27'),_0x226047[_0x565b5d(0x178)]++);return{'action':_0x546f5c['action'],'name':_0x566a35[_0x565b5d(0x1a0)][_0x565b5d(0x15b)],'journeyId':_0x546f5c[_0x565b5d(0x12a)]};}catch(_0xefe8e5){const _0x2d2825=isHttp400Error(_0xefe8e5),_0x21f309=_0x2d2825?ErrorCode[_0x565b5d(0x144)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4405e8=getErrorMessage(_0xefe8e5);throw new SDKError(_0x21f309,_0x565b5d(0x104)+(_0x566a35[_0x565b5d(0x1cb)]?'create':_0x565b5d(0xe5))+_0x565b5d(0x1a2)+_0x566a35[_0x565b5d(0x169)]+_0x565b5d(0x16e)+_0x4405e8,_0xefe8e5);}}));_0x226047[_0x222c3e(0x1b6)]['push'](..._0x4d224b);}return _0x226047;}async function matchExistingJourneySegments(_0x465a64,_0x23aeb7,_0x4079fb,_0x2de972,_0x33c4b1){const _0xacb9b3=a151_0x35cf28;if(!_0x23aeb7[_0xacb9b3(0x1d3)]||!_0x23aeb7[_0xacb9b3(0x1a0)][_0xacb9b3(0x136)])return;const _0x37ec87=new Map(),_0x508a5e=new Set();for(const _0x36fcea of Object['keys'](_0x23aeb7[_0xacb9b3(0x1a0)][_0xacb9b3(0x136)])){const _0x284a03=generateDeterministicJourneySegmentName(_0x23aeb7[_0xacb9b3(0x1a0)][_0xacb9b3(0x15b)],_0x36fcea);_0x37ec87[_0xacb9b3(0xf5)](_0x284a03,_0x36fcea),_0x508a5e['add'](_0x36fcea);}const _0x4b7c3c=[],_0x3ce6e2=collectSegmentIdsFromJourneyApi(_0x23aeb7[_0xacb9b3(0x1d3)]);for(const _0x32489c of _0x3ce6e2){const _0x31406d=await fetchSegment(_0x465a64,_0x4079fb,_0x32489c,_0x2de972);if(!_0x31406d?.[_0xacb9b3(0x15b)])continue;const _0x316adf=_0x37ec87['get'](_0x31406d[_0xacb9b3(0x15b)]);_0x316adf?(_0x33c4b1[_0xacb9b3(0xf5)](_0x316adf,_0x32489c),_0x508a5e[_0xacb9b3(0x117)](_0x316adf)):_0x4b7c3c[_0xacb9b3(0x19b)]({'id':_0x32489c,'seg':_0x31406d});}if(_0x508a5e[_0xacb9b3(0x180)]>0x0&&_0x4b7c3c[_0xacb9b3(0x1e8)]>0x0){const {localExpandedRuleToNames:_0x549eac}=buildLocalExpandedRuleMappings(_0x23aeb7['yamlConfig']),_0x2bf8f1=new Map();for(const {id:_0x397f95,seg:_0x4d698f}of _0x4b7c3c){if(_0x4d698f[_0xacb9b3(0x190)]){const _0x4d848e=apiRuleToYaml(_0x4d698f['rule']);_0x2bf8f1[_0xacb9b3(0xf5)](_0x397f95,_0x4d848e);}}for(const {id:_0xe55cfb,seg:_0x2fdffb}of _0x4b7c3c){if(!_0x2fdffb[_0xacb9b3(0x190)])continue;const _0x8c2545=_0x2bf8f1[_0xacb9b3(0x14e)](_0xe55cfb);if(!_0x8c2545)continue;const _0x582114=serializeExpandedRule(_0x8c2545,_0x2bf8f1),_0x91e873=_0x549eac[_0xacb9b3(0x14e)](_0x582114);if(_0x91e873){const _0xac968d=_0x91e873[_0xacb9b3(0x163)](_0x4f49c3=>_0x508a5e['has'](_0x4f49c3));_0xac968d&&(_0x33c4b1[_0xacb9b3(0xf5)](_0xac968d,_0xe55cfb),_0x508a5e[_0xacb9b3(0x117)](_0xac968d),logger[_0xacb9b3(0x153)](_0xacb9b3(0x1c0)+_0x2fdffb[_0xacb9b3(0x15b)]+'\x27\x20to\x20local\x20\x27'+_0xac968d+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x9930dc,_0x3a1541,_0x171946,_0x30b6bd,_0x42b394,_0xbedebc){const _0x384465=a151_0x35cf28,{journeyDefToRequest:_0x48c1b6,activationDefToCreateRequest:_0x56719f,yamlRuleToApi:_0x4084a6,validateSegmentRule:_0x1ab6fe}=_0xbedebc,_0x408245=new Map(),_0x1e761c=new Map();recoverSegmentIdsFromPushRecovery(_0x3a1541,_0x408245,_0x171946['segmentNameToId']);const _0x566bf4=new Map(),_0xe6a6f7=new Map(),_0xce4147=new Map();let _0x334663;const _0x21fbb4=async()=>{const _0x31ba89=a151_0xb026;if(_0x334663)return;_0x334663=new Map();if(!_0x3a1541[_0x31ba89(0x1d3)])return;const _0x51e471=await _0x9930dc[_0x31ba89(0x149)][_0x31ba89(0x129)](_0x3a1541['existingJourney']['id']);for(const _0x30a945 of _0x51e471){const _0x476835=journeyActivationStepToYaml(_0x30a945,_0x171946[_0x31ba89(0x1a7)],_0x171946['connectionIdToNameMap']),_0x5084a0=activationSignature(_0x476835);!_0x334663[_0x31ba89(0x14c)](_0x5084a0)&&_0x334663[_0x31ba89(0xf5)](_0x5084a0,_0x30a945['id']),_0x476835[_0x31ba89(0x15b)]&&_0x1e761c[_0x31ba89(0xf5)](_0x476835['name'],_0x30a945['id']);}};await matchExistingJourneySegments(_0x9930dc,_0x3a1541,_0x30b6bd[_0x384465(0xf0)],_0x171946[_0x384465(0x1bb)],_0x171946[_0x384465(0x189)]);const _0x20aa71={'resolveSegmentId':async _0x34a369=>{const _0x8ba902=_0x384465,_0x21e5d4=_0x171946[_0x8ba902(0x189)][_0x8ba902(0x14e)](_0x34a369);if(!_0x21e5d4)throw new SDKError(ErrorCode[_0x8ba902(0x199)],_0x8ba902(0x100)+_0x34a369+_0x8ba902(0x1cc)+_0x3a1541['yamlConfig'][_0x8ba902(0x15b)]+')');return _0x21e5d4;},'resolveEmbeddedSegmentId':async(_0x463137,_0x178394)=>{const _0x29fee1=_0x384465,_0x14cc1d=_0x171946[_0x29fee1(0x189)][_0x29fee1(0x14e)](_0x463137);if(_0x14cc1d)return _0x14cc1d;const _0xe032e=_0x171946[_0x29fee1(0x1bb)]['find'](_0x2c127f=>_0x2c127f[_0x29fee1(0x15b)]===_0x463137);if(_0xe032e)return _0x171946[_0x29fee1(0x189)][_0x29fee1(0xf5)](_0x463137,_0xe032e['id']),_0xe032e['id'];if(_0x3a1541[_0x29fee1(0x1cb)]){const {stageName:_0x38e923,criteriaName:_0x5bf170}=findSegmentCriteriaLocation(_0x3a1541[_0x29fee1(0x1a0)],_0x463137);return _0x1ab6fe(_0x463137,_0x178394['rule']),_0xe6a6f7[_0x29fee1(0xf5)](_0x463137,{'definition':_0x178394,'stageName':_0x38e923,'criteriaName':_0x5bf170}),createPendingSegmentId(_0x463137);}const _0x566329=_0x3a1541[_0x29fee1(0x1d3)]?.['id'];if(!_0x566329)throw new SDKError(ErrorCode[_0x29fee1(0xe7)],_0x29fee1(0x1d9));const _0x127052=_0x566bf4[_0x29fee1(0x14e)](_0x463137);if(_0x127052)return _0x127052;const _0x4a95e8=((async()=>{const _0x76eac1=_0x29fee1;_0x1ab6fe(_0x463137,_0x178394[_0x76eac1(0x190)]);const _0x4cd91f=generateDeterministicJourneySegmentName(_0x3a1541['yamlConfig']['name'],_0x463137),_0x204384=_0x171946['existingSegments'][_0x76eac1(0x163)](_0x263e79=>_0x263e79[_0x76eac1(0x15b)]===_0x4cd91f),_0x213913=createSegmentIdResolver(_0x171946['segmentNameToId'],_0x463137),_0x9656ba=await resolveRuleSegmentIds(_0x178394['rule'],_0x213913);let _0x3a17eb;return _0x204384?(await _0x9930dc[_0x76eac1(0x1ab)][_0x76eac1(0x197)](_0x30b6bd['parentId'],_0x204384['id'],{'description':_0x178394[_0x76eac1(0x12b)]||_0x76eac1(0x1a1)+_0x463137,'rule':_0x4084a6(_0x9656ba),'countPopulation':!![]}),_0x3a17eb=_0x204384['id'],saveSegmentToPushRecovery(_0x3a1541[_0x76eac1(0x169)],_0x3a1541[_0x76eac1(0x1a0)]['name'],_0x463137,{'segmentId':_0x3a17eb,'uniqueServerName':_0x4cd91f,'createdAt':new Date()[_0x76eac1(0x15c)]()})):_0x3a17eb=await createOrRecoverEmbeddedSegment(_0x9930dc,_0x3a1541,{'localName':_0x463137,'uniqueSegmentName':_0x4cd91f,'description':_0x178394[_0x76eac1(0x12b)]||_0x76eac1(0x1a1)+_0x463137,'journeyId':_0x566329,'resolvedRule':_0x9656ba,'parentId':_0x30b6bd[_0x76eac1(0xf0)],'folderId':_0x30b6bd[_0x76eac1(0x1d4)]||''},_0x4084a6),_0x171946['segmentNameToId']['set'](_0x463137,_0x3a17eb),_0x408245[_0x76eac1(0xf5)](_0x463137,_0x3a17eb),_0x3a17eb;})());_0x566bf4['set'](_0x463137,_0x4a95e8);try{return await _0x4a95e8;}finally{_0x566bf4[_0x29fee1(0x117)](_0x463137);}},'resolveActivationId':async _0x30b4c6=>{const _0x14de7c=_0x384465,_0x54eed2=_0x1e761c[_0x14de7c(0x14e)](_0x30b4c6);if(_0x54eed2)return _0x54eed2;if(_0x3a1541['existingJourney']){await _0x21fbb4();const _0x515adc=_0x1e761c['get'](_0x30b4c6);if(_0x515adc)return _0x515adc;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x14de7c(0x134)+_0x30b4c6+_0x14de7c(0x1cc)+_0x3a1541[_0x14de7c(0x1a0)]['name']+_0x14de7c(0x140)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x13e39c,_0x406bf5)=>{const _0x54e874=_0x384465,_0x1deb44=_0x1e761c[_0x54e874(0x14e)](_0x13e39c);if(_0x1deb44)return _0x1deb44;if(_0x3a1541['isNew'])return _0xce4147[_0x54e874(0xf5)](_0x13e39c,_0x406bf5),createPendingActivationId(_0x13e39c);if(_0x3a1541['existingJourney']){await _0x21fbb4();const _0x1a613d=_0x1e761c[_0x54e874(0x14e)](_0x406bf5[_0x54e874(0x15b)]);if(_0x1a613d)return _0x1e761c[_0x54e874(0xf5)](_0x13e39c,_0x1a613d),_0x1a613d;const _0x3fa8b3=activationSignature(_0x406bf5),_0x3c457a=_0x334663?.['get'](_0x3fa8b3);if(_0x3c457a)return _0x1e761c[_0x54e874(0xf5)](_0x13e39c,_0x3c457a),_0x3c457a;const _0x3b67f5=await _0x56719f(_0x406bf5,_0x171946[_0x54e874(0x124)]),_0xbaf6e6={..._0x3b67f5,..._0x406bf5[_0x54e874(0x17b)]!==undefined&&{'runAfterJourneyRefresh':_0x406bf5[_0x54e874(0x17b)]}},_0x15cd5e=await _0x9930dc[_0x54e874(0x149)]['createActivation'](_0x3a1541[_0x54e874(0x1d3)]['id'],_0xbaf6e6);return _0x1e761c[_0x54e874(0xf5)](_0x13e39c,_0x15cd5e['id']),_0x15cd5e['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x54e874(0x1bd));},'resolveJourneyId':async _0x4c3ef2=>{const _0x5596c4=_0x384465;try{return await _0x9930dc['journey'][_0x5596c4(0x151)](_0x30b6bd['parentId'],_0x4c3ef2);}catch(_0x37ad7e){throw new SDKError(ErrorCode[_0x5596c4(0x15a)],_0x5596c4(0xeb)+_0x4c3ef2+_0x5596c4(0x107)+_0x3a1541['yamlConfig'][_0x5596c4(0x15b)]+'\x27)',_0x37ad7e);}},'resolveStageId':async(_0x862226,_0x109d3c)=>{const _0x576c37=_0x384465,_0xb6d6ee=await _0x9930dc[_0x576c37(0x149)][_0x576c37(0x172)](_0x862226),_0x19dd66=_0xb6d6ee['attributes']['journeyStages']['find'](_0xd3c2bf=>_0xd3c2bf[_0x576c37(0x15b)][_0x576c37(0x114)]()===_0x109d3c[_0x576c37(0x114)]());if(!_0x19dd66?.['id'])throw new SDKError(ErrorCode[_0x576c37(0x15a)],'Stage\x20\x27'+_0x109d3c+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xb6d6ee[_0x576c37(0x10f)][_0x576c37(0x179)]||_0xb6d6ee['attributes'][_0x576c37(0x15b)])+'\x27');return _0x19dd66['id'];}},_0x3d550c=await _0x48c1b6(_0x3a1541['yamlConfig'],_0x30b6bd['parentId'],_0x20aa71),_0x110662=_0x30b6bd['folderId']||_0x30b6bd[_0x384465(0x1d4)];_0x110662&&(_0x3d550c[_0x384465(0x182)]={'parentFolder':{'data':{'id':_0x110662,'type':_0x384465(0xe2)}}});if(_0x3a1541['isNew']){if(_0xe6a6f7[_0x384465(0x180)]>0x0||_0xce4147['size']>0x0)return await executeThreeStepJourneyCreate(_0x9930dc,_0x3a1541,_0x3d550c,{'pendingEmbeddedSegments':_0xe6a6f7,'pendingEmbeddedActivations':_0xce4147,'embeddedSegmentNameToId':_0x408245,'journeyActivationNameToId':_0x1e761c},{..._0x30b6bd,'effectiveFolderId':_0x110662},_0x171946,_0x42b394,_0xbedebc);else{ensureJourneyDefaults(_0x3d550c[_0x384465(0x10f)]);const _0x5ec7a7=await _0x9930dc[_0x384465(0x149)][_0x384465(0x187)](_0x3d550c);return deletePushRecovery(_0x3a1541[_0x384465(0x169)]),{'action':'created','journeyId':_0x5ec7a7['id'],'embeddedSegmentNameToId':_0x408245};}}else{if(_0x3a1541[_0x384465(0x168)]&&_0x3a1541['existingJourney']){_0x3d550c['id']=_0x3a1541[_0x384465(0x1d3)]['id'];const _0xf589e1=_0x3d550c[_0x384465(0x10f)];_0x3a1541['existingJourney'][_0x384465(0x10f)]?.[_0x384465(0x179)]&&(_0xf589e1[_0x384465(0x179)]=_0x3a1541[_0x384465(0x1d3)][_0x384465(0x10f)][_0x384465(0x179)]);const _0x598cb0=_0x3a1541[_0x384465(0x1d3)][_0x384465(0x10f)]?.[_0x384465(0x162)];return _0x598cb0&&_0x3d550c[_0x384465(0x10f)][_0x384465(0x162)]&&injectExistingStageIds(_0x3d550c[_0x384465(0x10f)][_0x384465(0x162)],_0x598cb0),ensureJourneyDefaults(_0xf589e1),await _0x9930dc[_0x384465(0x149)][_0x384465(0xe5)](_0x3a1541[_0x384465(0x1d3)]['id'],_0x3d550c),deletePushRecovery(_0x3a1541[_0x384465(0x169)]),{'action':_0x384465(0x178),'journeyId':_0x3a1541['existingJourney']['id'],'embeddedSegmentNameToId':_0x408245};}}return deletePushRecovery(_0x3a1541[_0x384465(0x169)]),{'action':'unchanged','journeyId':_0x3a1541[_0x384465(0x1d3)]?.['id'],'embeddedSegmentNameToId':_0x408245};}function findSegmentCriteriaLocation(_0x25e62e,_0x4346ab){const _0x5d5c0f=a151_0x35cf28,_0x5c7b3e=_0x25e62e[_0x5d5c0f(0x196)]||_0x25e62e[_0x5d5c0f(0x1e2)]?.[0x0]?.['stages']||[];let _0x267e93=_0x5d5c0f(0x1ad),_0x31b1aa=_0x4346ab;const _0x2ff89c=_0x25e62e['goal']||_0x25e62e['journeys']?.[0x0]?.[_0x5d5c0f(0x108)];if(_0x2ff89c?.['segment']===_0x4346ab)return{'stageName':_0x5d5c0f(0x108),'criteriaName':_0x2ff89c[_0x5d5c0f(0x15b)]||_0x4346ab};_0x59162:for(const _0x35c619 of _0x5c7b3e){if(_0x35c619[_0x5d5c0f(0x1e3)]?.[_0x5d5c0f(0x1ab)]===_0x4346ab){_0x267e93=_0x35c619[_0x5d5c0f(0x15b)],_0x31b1aa=_0x35c619['entry_criteria'][_0x5d5c0f(0x15b)]||_0x4346ab;break;}if(_0x35c619[_0x5d5c0f(0x17d)])for(const _0x1ba5bf of _0x35c619['steps']){if(_0x1ba5bf[_0x5d5c0f(0x152)]===_0x5d5c0f(0x1b9)&&_0x1ba5bf[_0x5d5c0f(0xfd)]?.[_0x5d5c0f(0x135)])for(const _0x1946bc of _0x1ba5bf[_0x5d5c0f(0xfd)][_0x5d5c0f(0x135)]){if(_0x1946bc[_0x5d5c0f(0x1ab)]===_0x4346ab){_0x267e93=_0x35c619[_0x5d5c0f(0x15b)],_0x31b1aa=_0x1946bc['name']||_0x4346ab;break _0x59162;}}}}return{'stageName':_0x267e93,'criteriaName':_0x31b1aa};}async function executeThreeStepJourneyCreate(_0x230b48,_0x2de0d8,_0x1509e7,_0x587bf8,_0x54f982,_0x46ff13,_0x1e26f1,_0x4543d0){const _0x2e0aca=a151_0x35cf28,{activationDefToCreateRequest:_0x48a298,yamlRuleToApi:_0x349116}=_0x4543d0,{pendingEmbeddedSegments:_0x509377,pendingEmbeddedActivations:_0x460a9d,embeddedSegmentNameToId:_0xc0b489}=_0x587bf8,_0x1f56ff=JSON[_0x2e0aca(0xfe)](JSON[_0x2e0aca(0x1c3)](_0x1509e7));ensureJourneyDefaults(_0x1f56ff['attributes']),stripPendingIds(_0x1f56ff);const _0x25e204=await _0x230b48[_0x2e0aca(0x149)][_0x2e0aca(0x187)](_0x1f56ff),_0x195a5e=_0x25e204['id'],_0x5a0ccb=new Map();for(const _0x41c2f3 of _0x25e204[_0x2e0aca(0x10f)][_0x2e0aca(0x162)]){_0x5a0ccb[_0x2e0aca(0xf5)](_0x41c2f3['name']['toLowerCase'](),_0x41c2f3['id']);}recoverSegmentIdsFromPushRecovery(_0x2de0d8,_0xc0b489,_0x46ff13[_0x2e0aca(0x189)]);for(const [_0x50e41e,{definition:_0x31a17a}]of _0x509377){if(_0xc0b489[_0x2e0aca(0x14c)](_0x50e41e)){_0x1e26f1[_0x2e0aca(0x131)]?.({'type':_0x2e0aca(0x10d),'journeyName':_0x2de0d8['yamlConfig']['name'],'segmentName':_0x50e41e});continue;}const _0x39cb83=generateDeterministicJourneySegmentName(_0x2de0d8['yamlConfig']['name'],_0x50e41e);_0x1e26f1[_0x2e0aca(0x131)]?.({'type':_0x2e0aca(0x1e0),'journeyName':_0x2de0d8['yamlConfig'][_0x2e0aca(0x15b)],'segmentName':_0x50e41e});const _0x2c1cd6=createSegmentIdResolver(_0x46ff13[_0x2e0aca(0x189)],_0x50e41e),_0x11b7c1=await resolveRuleSegmentIds(_0x31a17a[_0x2e0aca(0x190)],_0x2c1cd6),_0xab8a40=await createOrRecoverEmbeddedSegment(_0x230b48,_0x2de0d8,{'localName':_0x50e41e,'uniqueSegmentName':_0x39cb83,'description':_0x31a17a[_0x2e0aca(0x12b)]||_0x2e0aca(0x1a1)+_0x50e41e,'journeyId':_0x195a5e,'resolvedRule':_0x11b7c1,'parentId':_0x54f982[_0x2e0aca(0xf0)],'folderId':_0x54f982[_0x2e0aca(0xf8)]||''},_0x349116);_0xc0b489[_0x2e0aca(0xf5)](_0x50e41e,_0xab8a40),_0x46ff13[_0x2e0aca(0x189)][_0x2e0aca(0xf5)](_0x50e41e,_0xab8a40),_0x1e26f1[_0x2e0aca(0x131)]?.({'type':'embedded_segment_created','journeyName':_0x2de0d8[_0x2e0aca(0x1a0)][_0x2e0aca(0x15b)],'segmentName':_0x50e41e});}const _0x1cd786=new Map();for(const [_0x109068,_0x1681af]of _0x460a9d){_0x1e26f1[_0x2e0aca(0x131)]?.({'type':_0x2e0aca(0xe4),'journeyName':_0x2de0d8['yamlConfig'][_0x2e0aca(0x15b)],'activationName':_0x109068});const _0x42951e=await _0x48a298(_0x1681af,_0x46ff13[_0x2e0aca(0x124)]),_0x402f17={..._0x42951e,..._0x1681af[_0x2e0aca(0x17b)]!==undefined&&{'runAfterJourneyRefresh':_0x1681af[_0x2e0aca(0x17b)]}},_0x462144=await _0x230b48[_0x2e0aca(0x149)][_0x2e0aca(0x19f)](_0x195a5e,_0x402f17);_0x1cd786[_0x2e0aca(0xf5)](_0x109068,_0x462144['id']),_0x587bf8[_0x2e0aca(0x1a5)]['set'](_0x109068,_0x462144['id']),_0x1e26f1['onProgress']?.({'type':_0x2e0aca(0x139),'journeyName':_0x2de0d8[_0x2e0aca(0x1a0)][_0x2e0aca(0x15b)],'activationName':_0x109068});}const _0x371f4d=JSON[_0x2e0aca(0xfe)](JSON[_0x2e0aca(0x1c3)](_0x1509e7));return _0x371f4d['id']=_0x195a5e,ensureJourneyDefaults(_0x371f4d[_0x2e0aca(0x10f)]),resolvePendingIdsInRequest(_0x371f4d,_0x1509e7,_0x5a0ccb,_0xc0b489,_0x1cd786,_0x1e26f1),await _0x230b48[_0x2e0aca(0x149)]['update'](_0x195a5e,_0x371f4d),deletePushRecovery(_0x2de0d8[_0x2e0aca(0x169)]),{'action':_0x2e0aca(0x103),'journeyId':_0x195a5e,'embeddedSegmentNameToId':_0xc0b489};}export function stripWaitStepPendingIds(_0x4f2cb5){const _0x71238f=a151_0x35cf28,_0x3afd62=_0x4f2cb5[_0x71238f(0x1a9)]&&isPendingSegmentId(_0x4f2cb5[_0x71238f(0x1a9)]),_0x6e98f4=_0x4f2cb5['conditions']?.[_0x71238f(0x1e4)](_0x1543e1=>_0x1543e1[_0x71238f(0x13c)]&&isPendingSegmentId(_0x1543e1[_0x71238f(0x13c)]));(_0x3afd62||_0x6e98f4)&&(_0x4f2cb5[_0x71238f(0x1a6)]='Duration',_0x4f2cb5[_0x71238f(0x1cd)]=0x1,_0x4f2cb5[_0x71238f(0x1e6)]='day',delete _0x4f2cb5[_0x71238f(0x1a9)],delete _0x4f2cb5[_0x71238f(0x198)],delete _0x4f2cb5[_0x71238f(0x109)],delete _0x4f2cb5['conditions']);}export function resolveWaitStepPendingIds(_0x17de2e,_0x5c6877,_0x2f49de,_0xe832cf){const _0x3df8fc=a151_0x35cf28;if(_0x5c6877['conditionSegmentId']&&isPendingSegmentId(_0x5c6877[_0x3df8fc(0x1a9)])){const _0x2ab6c1=_0x2f49de(_0x5c6877[_0x3df8fc(0x1a9)],_0x3df8fc(0xf1)+_0xe832cf+_0x3df8fc(0x1b8));_0x2ab6c1&&(_0x17de2e[_0x3df8fc(0x1a6)]=_0x3df8fc(0x12e),_0x17de2e[_0x3df8fc(0x1a9)]=_0x2ab6c1,delete _0x17de2e['waitStep'],delete _0x17de2e[_0x3df8fc(0x1e6)],_0x5c6877['conditionTimeoutDuration']!==undefined&&(_0x17de2e[_0x3df8fc(0x198)]=_0x5c6877['conditionTimeoutDuration']),_0x5c6877[_0x3df8fc(0x109)]&&(_0x17de2e[_0x3df8fc(0x109)]=_0x5c6877[_0x3df8fc(0x109)]));}if(_0x5c6877[_0x3df8fc(0x143)]){const _0x49bdaa=_0x5c6877[_0x3df8fc(0x143)]['some'](_0x3739fd=>_0x3739fd['segmentId']&&isPendingSegmentId(_0x3739fd[_0x3df8fc(0x13c)]));if(_0x49bdaa){const _0x2acfdb=_0x5c6877[_0x3df8fc(0x143)][_0x3df8fc(0x16b)](_0x42095c=>{const _0x58b33b=_0x3df8fc;if(_0x42095c[_0x58b33b(0x13c)]&&isPendingSegmentId(_0x42095c[_0x58b33b(0x13c)])){const _0xbd7734=_0x2f49de(_0x42095c['segmentId'],_0x58b33b(0xf1)+_0xe832cf+_0x58b33b(0x1b8));return{..._0x42095c,'segmentId':_0xbd7734||_0x42095c[_0x58b33b(0x13c)]};}return{..._0x42095c};});_0x17de2e[_0x3df8fc(0x1a6)]=_0x3df8fc(0x12e),_0x17de2e[_0x3df8fc(0x143)]=_0x2acfdb,delete _0x17de2e[_0x3df8fc(0x1cd)],delete _0x17de2e[_0x3df8fc(0x1e6)],delete _0x17de2e[_0x3df8fc(0x1a9)],delete _0x17de2e[_0x3df8fc(0x198)],delete _0x17de2e[_0x3df8fc(0x109)];}}}function stripPendingIds(_0x2e4b18){const _0x4d82e0=a151_0x35cf28;_0x2e4b18[_0x4d82e0(0x10f)]['goal']?.[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x2e4b18[_0x4d82e0(0x10f)][_0x4d82e0(0x108)][_0x4d82e0(0x13c)])&&delete _0x2e4b18['attributes'][_0x4d82e0(0x108)];for(const _0x22a9d4 of _0x2e4b18[_0x4d82e0(0x10f)][_0x4d82e0(0x162)]||[]){_0x22a9d4[_0x4d82e0(0x13f)]?.[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x22a9d4[_0x4d82e0(0x13f)]['segmentId'])&&delete _0x22a9d4[_0x4d82e0(0x13f)];_0x22a9d4[_0x4d82e0(0xea)]?.[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x22a9d4[_0x4d82e0(0xea)][_0x4d82e0(0x13c)])&&delete _0x22a9d4['milestone'];_0x22a9d4[_0x4d82e0(0x10e)]&&(_0x22a9d4[_0x4d82e0(0x10e)]=_0x22a9d4[_0x4d82e0(0x10e)][_0x4d82e0(0x10a)](_0x6cdf5c=>!_0x6cdf5c['segmentId']||!isPendingSegmentId(_0x6cdf5c[_0x4d82e0(0x13c)])));if(_0x22a9d4['steps'])for(const _0x61656 of Object[_0x4d82e0(0x14b)](_0x22a9d4[_0x4d82e0(0x17d)])){const _0x471f92=_0x22a9d4[_0x4d82e0(0x17d)][_0x61656];_0x471f92[_0x4d82e0(0x152)]===_0x4d82e0(0x101)&&_0x471f92['journeyActivationStepId']&&isPendingActivationId(_0x471f92['journeyActivationStepId'])&&(_0x471f92['journeyActivationStepId']='');if(_0x471f92[_0x4d82e0(0x152)]===_0x4d82e0(0x1d2)&&_0x471f92[_0x4d82e0(0x135)])for(const _0x502038 of _0x471f92['branches']){_0x502038[_0x4d82e0(0x13c)]&&isPendingSegmentId(_0x502038[_0x4d82e0(0x13c)])&&(_0x502038[_0x4d82e0(0x13c)]='');}_0x471f92[_0x4d82e0(0x152)]===_0x4d82e0(0x102)&&stripWaitStepPendingIds(_0x471f92);}}}function resolvePendingIdsInRequest(_0xba4aa,_0x2f76a9,_0x9722d0,_0x4222d0,_0x5735a2,_0x177103){const _0x5f1a64=a151_0x35cf28,_0x1446d2=(_0x49ac70,_0x4a5b18)=>{const _0x143a19=a151_0xb026;if(!isPendingSegmentId(_0x49ac70))return _0x49ac70;const _0x58fdf8=extractPendingSegmentName(_0x49ac70),_0x4390d9=_0x4222d0[_0x143a19(0x14e)](_0x58fdf8);return!_0x4390d9&&_0x177103[_0x143a19(0x16a)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x58fdf8+_0x143a19(0xf6)+_0x4a5b18),_0x4390d9;};if(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)]?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)][_0x5f1a64(0x13c)])){const _0x4e9f43=_0x1446d2(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)][_0x5f1a64(0x13c)],_0x5f1a64(0x18e));_0x4e9f43&&(_0xba4aa[_0x5f1a64(0x10f)][_0x5f1a64(0x108)]['segmentId']=_0x4e9f43);}for(const _0x27b973 of _0xba4aa[_0x5f1a64(0x10f)]['journeyStages']||[]){const _0x1ddc22=_0x9722d0[_0x5f1a64(0x14e)](_0x27b973[_0x5f1a64(0x15b)]['toLowerCase']());_0x1ddc22&&(_0x27b973['id']=_0x1ddc22);if(_0x27b973[_0x5f1a64(0x13f)]?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x27b973[_0x5f1a64(0x13f)][_0x5f1a64(0x13c)])){const _0x4bc17a=_0x1446d2(_0x27b973[_0x5f1a64(0x13f)][_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973[_0x5f1a64(0x15b)]+_0x5f1a64(0x18f));_0x4bc17a&&(_0x27b973[_0x5f1a64(0x13f)][_0x5f1a64(0x13c)]=_0x4bc17a);}if(_0x27b973[_0x5f1a64(0x10e)])for(const _0x4e2933 of _0x27b973[_0x5f1a64(0x10e)]){if(_0x4e2933[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x4e2933[_0x5f1a64(0x13c)])){const _0x4916ca=_0x1446d2(_0x4e2933[_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973[_0x5f1a64(0x15b)]+_0x5f1a64(0x1a4));_0x4916ca&&(_0x4e2933[_0x5f1a64(0x13c)]=_0x4916ca);}}if(_0x27b973[_0x5f1a64(0xea)]?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x27b973['milestone'][_0x5f1a64(0x13c)])){const _0x47c610=_0x1446d2(_0x27b973['milestone'][_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973[_0x5f1a64(0x15b)]+_0x5f1a64(0x1af));_0x47c610&&(_0x27b973[_0x5f1a64(0xea)][_0x5f1a64(0x13c)]=_0x47c610);}if(_0x27b973['steps']){const _0x338084=_0x16c0d0=>_0x2f76a9[_0x5f1a64(0x10f)]['journeyStages']?.[_0x5f1a64(0x163)](_0x290eb3=>_0x290eb3[_0x5f1a64(0x15b)][_0x5f1a64(0x114)]()===_0x27b973[_0x5f1a64(0x15b)]['toLowerCase']())?.[_0x5f1a64(0x17d)]?.[_0x16c0d0];for(const _0x39b398 of Object[_0x5f1a64(0x14b)](_0x27b973[_0x5f1a64(0x17d)])){const _0x88789d=_0x27b973[_0x5f1a64(0x17d)][_0x39b398],_0x58f07b=_0x338084(_0x39b398);if(_0x88789d[_0x5f1a64(0x152)]==='Activation'&&_0x88789d[_0x5f1a64(0x1b1)]&&(isPendingActivationId(_0x88789d['journeyActivationStepId'])||_0x88789d['journeyActivationStepId']==='')){if(_0x58f07b?.[_0x5f1a64(0x1b1)]&&isPendingActivationId(_0x58f07b[_0x5f1a64(0x1b1)])){const _0x42de87=extractPendingActivationName(_0x58f07b[_0x5f1a64(0x1b1)]),_0x40d631=_0x5735a2[_0x5f1a64(0x14e)](_0x42de87);_0x40d631&&(_0x88789d[_0x5f1a64(0x1b1)]=_0x40d631);}}if(_0x88789d[_0x5f1a64(0x152)]===_0x5f1a64(0x1d2)&&_0x88789d[_0x5f1a64(0x135)]&&_0x58f07b?.['branches'])for(let _0x194fc0=0x0;_0x194fc0<_0x88789d[_0x5f1a64(0x135)][_0x5f1a64(0x1e8)];_0x194fc0++){const _0x1d8ac3=_0x88789d[_0x5f1a64(0x135)][_0x194fc0],_0x1eb473=_0x58f07b[_0x5f1a64(0x135)][_0x194fc0];if(_0x1eb473?.[_0x5f1a64(0x13c)]&&isPendingSegmentId(_0x1eb473[_0x5f1a64(0x13c)])){const _0x5063de=_0x1446d2(_0x1eb473[_0x5f1a64(0x13c)],_0x5f1a64(0xf1)+_0x27b973['name']+_0x5f1a64(0x10c)+(_0x1d8ac3[_0x5f1a64(0x15b)]||_0x194fc0)+'\x27');_0x5063de&&(_0x1d8ac3['segmentId']=_0x5063de);}}_0x88789d[_0x5f1a64(0x152)]===_0x5f1a64(0x102)&&_0x58f07b?.[_0x5f1a64(0x152)]===_0x5f1a64(0x102)&&resolveWaitStepPendingIds(_0x88789d,_0x58f07b,_0x1446d2,_0x27b973[_0x5f1a64(0x15b)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x403b0b,_0x3bc720){const _0x32fd28=a152_0xccbb,_0x84cee=_0x403b0b();while(!![]){try{const _0x1b9fbf=parseInt(_0x32fd28(0xea))/0x1+-parseInt(_0x32fd28(0xf2))/0x2+parseInt(_0x32fd28(0xf1))/0x3+-parseInt(_0x32fd28(0xf6))/0x4*(parseInt(_0x32fd28(0xef))/0x5)+-parseInt(_0x32fd28(0xf3))/0x6+-parseInt(_0x32fd28(0xec))/0x7*(parseInt(_0x32fd28(0xed))/0x8)+-parseInt(_0x32fd28(0xf0))/0x9*(-parseInt(_0x32fd28(0xee))/0xa);if(_0x1b9fbf===_0x3bc720)break;else _0x84cee['push'](_0x84cee['shift']());}catch(_0x56e5e3){_0x84cee['push'](_0x84cee['shift']());}}}(a152_0x519c,0x9071b));function a152_0xccbb(_0x275600,_0x33713e){_0x275600=_0x275600-0xe9;const _0x519c8a=a152_0x519c();let _0xccbb61=_0x519c8a[_0x275600];return _0xccbb61;}export function buildFolderIdToPathMap(_0x3cf89f){const _0x390b33=a152_0xccbb,_0x59dbf3=new Map(),_0x1cde6a=new Map();for(const _0x5d1861 of _0x3cf89f){_0x1cde6a['set'](_0x5d1861['id'],_0x5d1861);}const _0xfc5396=new Set();for(const _0x409f66 of _0x3cf89f){!_0x409f66[_0x390b33(0xf8)]&&_0xfc5396[_0x390b33(0xe9)](_0x409f66['id']);}function _0x561eed(_0xeca2c1){const _0x1d68b5=_0x390b33;if(_0x59dbf3[_0x1d68b5(0xf5)](_0xeca2c1['id']))return _0x59dbf3[_0x1d68b5(0xeb)](_0xeca2c1['id']);if(_0xfc5396['has'](_0xeca2c1['id']))return _0x59dbf3[_0x1d68b5(0xf7)](_0xeca2c1['id'],''),'';if(_0xeca2c1[_0x1d68b5(0xf8)]){const _0x20fb81=_0x1cde6a[_0x1d68b5(0xeb)](_0xeca2c1[_0x1d68b5(0xf8)]);if(_0x20fb81){const _0x48dee9=_0x561eed(_0x20fb81),_0x223700=_0x48dee9?_0x48dee9+'/'+_0xeca2c1['name']:_0xeca2c1[_0x1d68b5(0xf4)];return _0x59dbf3[_0x1d68b5(0xf7)](_0xeca2c1['id'],_0x223700),_0x223700;}}const _0x37ec92=_0xeca2c1[_0x1d68b5(0xf4)];return _0x59dbf3[_0x1d68b5(0xf7)](_0xeca2c1['id'],_0x37ec92),_0x37ec92;}for(const _0x4b4bc1 of _0x3cf89f){_0x561eed(_0x4b4bc1);}return _0x59dbf3;}export function buildFolderPathToIdMap(_0xcc6fcf){const _0x3565d1=a152_0xccbb,_0x546a20=new Map(),_0x1ef776=new Map();for(const _0x262c9c of _0xcc6fcf){_0x1ef776[_0x3565d1(0xf7)](_0x262c9c['id'],_0x262c9c);}const _0x3ff6fa=new Set();for(const _0xd261be of _0xcc6fcf){!_0xd261be[_0x3565d1(0xf8)]&&_0x3ff6fa[_0x3565d1(0xe9)](_0xd261be['id']);}function _0x1786e4(_0x2c0b6f){const _0x3ddc32=_0x3565d1;if(_0x3ff6fa[_0x3ddc32(0xf5)](_0x2c0b6f['id']))return'';if(_0x2c0b6f[_0x3ddc32(0xf8)]){const _0x587f1f=_0x1ef776[_0x3ddc32(0xeb)](_0x2c0b6f[_0x3ddc32(0xf8)]);if(_0x587f1f){const _0x9f06a=_0x1786e4(_0x587f1f);return _0x9f06a?_0x9f06a+'/'+_0x2c0b6f[_0x3ddc32(0xf4)]:_0x2c0b6f[_0x3ddc32(0xf4)];}}return _0x2c0b6f[_0x3ddc32(0xf4)];}for(const _0x3588a5 of _0xcc6fcf){const _0x50e38c=_0x1786e4(_0x3588a5);_0x546a20[_0x3565d1(0xf7)](_0x50e38c,_0x3588a5['id']);}return _0x546a20;}export function buildFolderMaps(_0x9fe40c){const _0x30baea=a152_0xccbb,_0x490c89=buildFolderIdToPathMap(_0x9fe40c),_0xe7a5cb=new Map();for(const [_0x21dbb3,_0x4ab088]of _0x490c89){_0xe7a5cb[_0x30baea(0xf7)](_0x4ab088,_0x21dbb3);}return{'idToPath':_0x490c89,'pathToId':_0xe7a5cb};}function a152_0x519c(){const _0x60c4be=['8wJRtjK','80UfzBxi','5apvzUh','1794501njXBMm','3027570YaKphc','628418ZryMdV','4896456TVwexm','name','has','3402548EMKVBJ','set','parentFolderId','add','374044xcUfeV','get','2840467szlLfq'];a152_0x519c=function(){return _0x60c4be;};return a152_0x519c();}export function getFolderPath(_0x25e6c1,_0x484ed8){const _0x2e6703=a152_0xccbb;if(!_0x25e6c1)return'';return _0x484ed8[_0x2e6703(0xeb)](_0x25e6c1)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5aa60e,_0x1a3e1b){const _0xe16c3b=a153_0xad7b,_0x376d84=_0x5aa60e();while(!![]){try{const _0x2cff12=parseInt(_0xe16c3b(0x15b))/0x1+-parseInt(_0xe16c3b(0x155))/0x2*(-parseInt(_0xe16c3b(0x170))/0x3)+parseInt(_0xe16c3b(0x164))/0x4*(parseInt(_0xe16c3b(0x17d))/0x5)+-parseInt(_0xe16c3b(0x17e))/0x6*(-parseInt(_0xe16c3b(0x178))/0x7)+-parseInt(_0xe16c3b(0x15f))/0x8+-parseInt(_0xe16c3b(0x15a))/0x9*(parseInt(_0xe16c3b(0x175))/0xa)+parseInt(_0xe16c3b(0x158))/0xb*(-parseInt(_0xe16c3b(0x181))/0xc);if(_0x2cff12===_0x1a3e1b)break;else _0x376d84['push'](_0x376d84['shift']());}catch(_0x19e2ad){_0x376d84['push'](_0x376d84['shift']());}}}(a153_0x5018,0x40570));import a153_0x13f611 from'path';import{parse as a153_0x337491}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x308d01){const _0x2b5888=a153_0xad7b;if(!_0x308d01||_0x308d01['trim']()==='')throw new Error(_0x2b5888(0x16f));const _0x2c528b=_0x308d01[_0x2b5888(0x179)]();if(_0x2c528b==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x308d01};const _0x502c60=_0x2c528b[_0x2b5888(0x16e)]('/')?_0x2c528b['substring'](0x1):_0x2c528b,_0x231576=_0x502c60['split']('/')[_0x2b5888(0x163)](_0x282dff=>_0x282dff!=='');if(_0x231576[_0x2b5888(0x172)]===0x0)throw new Error(_0x2b5888(0x17b));const _0x39b579=_0x2c528b[_0x2b5888(0x16e)]('/')||!isRelativePathSegment(_0x231576[0x0]);for(const _0x2dc3a7 of _0x231576){validatePathSegment(_0x2dc3a7);}return{'segments':_0x231576,'isAbsolute':_0x39b579,'raw':_0x308d01};}function a153_0xad7b(_0xc13eea,_0x48cdd4){_0xc13eea=_0xc13eea-0x14f;const _0x501898=a153_0x5018();let _0xad7ba3=_0x501898[_0xc13eea];return _0xad7ba3;}function isRelativePathSegment(_0x5b23e3){return _0x5b23e3==='.'||_0x5b23e3==='..';}function validatePathSegment(_0x3edc3e){const _0x468514=a153_0xad7b;if(_0x3edc3e==='')throw new Error(_0x468514(0x162));if(_0x3edc3e==='.'||_0x3edc3e==='..')return;if(/[\x00-\x1F\x7F]/[_0x468514(0x173)](_0x3edc3e))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x3edc3e);if(_0x3edc3e!==_0x3edc3e[_0x468514(0x179)]()){}}export function validatePath(_0x19b07a){const _0x309dfe=a153_0xad7b;if(_0x19b07a['segments'][_0x309dfe(0x172)]===0x0&&!_0x19b07a[_0x309dfe(0x16b)])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x19b07a[_0x309dfe(0x16b)]){if(_0x19b07a[_0x309dfe(0x174)][0x0]==='..')throw new Error(_0x309dfe(0x151));let _0x1c45b3=0x0;for(const _0x5b1520 of _0x19b07a[_0x309dfe(0x174)]){if(_0x5b1520==='..'){if(_0x1c45b3===0x0)throw new Error(_0x309dfe(0x154));_0x1c45b3--;}else _0x5b1520!=='.'&&_0x1c45b3++;}}}function a153_0x5018(){const _0x5bc8c6=['Path\x20segment\x20cannot\x20be\x20empty','filter','12MMVGVC','push','slice','dirname','resolve','journey','pop','isAbsolute','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','File\x20not\x20found:\x20','startsWith','Path\x20cannot\x20be\x20empty','690420CcKmWU','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','length','test','segments','30XVKphX','exists','Cannot\x20navigate\x20above\x20root','745563KhSvGR','trim','name','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','readFile','129485smmmdQ','6oweyAX','join','replace','12KaQDox','parent_segment','segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','.yml','Path\x20attempts\x20to\x20navigate\x20above\x20root','4FHBSoC','raw','root','567556gebwEl','relative','679689pWXdEj','32942bXJKPR','No\x20tdx.json\x20found\x20for\x20file:\x20','endsWith','parse','1085816SWOtXf','.yaml','Cannot\x20split\x20empty\x20path'];a153_0x5018=function(){return _0x5bc8c6;};return a153_0x5018();}export function joinPaths(_0xb87fb7,_0x3979c4){const _0x1b7310=a153_0xad7b;if(!_0xb87fb7||_0xb87fb7==='/')return _0x3979c4;if(!_0x3979c4||_0x3979c4==='.')return _0xb87fb7;if(_0x3979c4[_0x1b7310(0x16e)]('/'))return _0x3979c4;const _0x1327a4=parsePath(_0xb87fb7),_0x1854b6=parsePath(_0x3979c4),_0xb1e63d=[..._0x1327a4[_0x1b7310(0x174)]];for(const _0x21a059 of _0x1854b6[_0x1b7310(0x174)]){if(_0x21a059==='.')continue;else{if(_0x21a059==='..'){if(_0xb1e63d[_0x1b7310(0x172)]===0x0)throw new Error(_0x1b7310(0x177));_0xb1e63d[_0x1b7310(0x16a)]();}else _0xb1e63d[_0x1b7310(0x165)](_0x21a059);}}const _0x3b60fa=_0xb1e63d[_0x1b7310(0x17f)]('/');return _0x1327a4[_0x1b7310(0x156)]['startsWith']('/')?'/'+_0x3b60fa:_0x3b60fa;}export function normalizePath(_0x5422ce){const _0x197a51=a153_0xad7b,_0x5422d9=parsePath(_0x5422ce),_0x114c77=[];for(const _0xa6892b of _0x5422d9['segments']){if(_0xa6892b==='.')continue;else{if(_0xa6892b==='..'){if(_0x114c77[_0x197a51(0x172)]===0x0){if(_0x5422d9['isAbsolute'])throw new Error(_0x197a51(0x177));_0x114c77[_0x197a51(0x165)]('..');}else _0x114c77[_0x114c77['length']-0x1]==='..'?_0x114c77[_0x197a51(0x165)]('..'):_0x114c77[_0x197a51(0x16a)]();}else _0x114c77['push'](_0xa6892b);}}if(_0x114c77[_0x197a51(0x172)]===0x0)return _0x5422d9[_0x197a51(0x16b)]?'/':'.';const _0xd4b7b9=_0x114c77[_0x197a51(0x17f)]('/');return _0x5422d9['raw']['startsWith']('/')?'/'+_0xd4b7b9:_0xd4b7b9;}export function getParentPath(_0x4c1f9d){const _0x5de7df=a153_0xad7b,_0x504146=parsePath(_0x4c1f9d);if(_0x504146[_0x5de7df(0x174)][_0x5de7df(0x172)]<=0x1)return'/';const _0x3308e3=_0x504146[_0x5de7df(0x174)][_0x5de7df(0x166)](0x0,-0x1)[_0x5de7df(0x17f)]('/');return _0x504146[_0x5de7df(0x156)]['startsWith']('/')?'/'+_0x3308e3:_0x3308e3;}export function getBaseName(_0x2e258f){const _0x158d8a=a153_0xad7b,_0x562fee=parsePath(_0x2e258f);return _0x562fee[_0x158d8a(0x174)][_0x562fee[_0x158d8a(0x174)][_0x158d8a(0x172)]-0x1]||'';}export function isChildPath(_0xb8cc81,_0x583570){const _0x40e2aa=a153_0xad7b,_0x4baad6=parsePath(_0xb8cc81),_0x5028cc=parsePath(_0x583570);if(_0x4baad6[_0x40e2aa(0x174)][_0x40e2aa(0x172)]<=_0x5028cc[_0x40e2aa(0x174)][_0x40e2aa(0x172)])return![];for(let _0x92d73f=0x0;_0x92d73f<_0x5028cc['segments']['length'];_0x92d73f++){if(_0x4baad6[_0x40e2aa(0x174)][_0x92d73f]!==_0x5028cc['segments'][_0x92d73f])return![];}return!![];}export function splitPath(_0x5164c6){const _0x4192fb=a153_0xad7b,_0x29927f=parsePath(_0x5164c6);if(_0x29927f[_0x4192fb(0x174)]['length']===0x0)throw new Error(_0x4192fb(0x161));if(_0x29927f['segments'][_0x4192fb(0x172)]===0x1)return{'parent':_0x29927f['segments'][0x0]};return{'parent':_0x29927f[_0x4192fb(0x174)][0x0],'child':_0x29927f['segments'][_0x4192fb(0x166)](0x1)[_0x4192fb(0x17f)]('/')};}export function isYamlFilePath(_0x23463e){const _0xf584c8=a153_0xad7b;return _0x23463e[_0xf584c8(0x15d)](_0xf584c8(0x153))||_0x23463e[_0xf584c8(0x15d)](_0xf584c8(0x160));}export async function resolveYamlFilePath(_0x2627f8,_0x15f250=nodeFileSystem){const _0x42ad2b=a153_0xad7b,_0x420238=a153_0x13f611[_0x42ad2b(0x168)](_0x2627f8);if(!await _0x15f250[_0x42ad2b(0x176)](_0x420238))throw new Error(_0x42ad2b(0x16d)+_0x2627f8);let _0x2d7f72=a153_0x13f611[_0x42ad2b(0x167)](_0x420238),_0x3bdd44=null,_0x312131=null;const _0x2b2954=a153_0x13f611[_0x42ad2b(0x15e)](_0x2d7f72)[_0x42ad2b(0x157)];while(_0x2d7f72!==_0x2b2954){const _0x54bdfd=a153_0x13f611[_0x42ad2b(0x17f)](_0x2d7f72,'tdx.json');if(await _0x15f250[_0x42ad2b(0x176)](_0x54bdfd)){_0x3bdd44=_0x54bdfd,_0x312131=_0x2d7f72;break;}_0x2d7f72=a153_0x13f611['dirname'](_0x2d7f72);}if(!_0x3bdd44||!_0x312131)throw new Error(_0x42ad2b(0x15c)+_0x2627f8+'\x0a'+_0x42ad2b(0x16c));const _0x376792=await _0x15f250[_0x42ad2b(0x17c)](_0x3bdd44),_0x49329d=JSON[_0x42ad2b(0x15e)](_0x376792),_0x1825bf=_0x49329d[_0x42ad2b(0x14f)];if(!_0x1825bf)throw new Error(_0x42ad2b(0x152));const _0x32b62a=await _0x15f250['readFile'](_0x420238),_0x3349f3=a153_0x337491(_0x32b62a),_0x43787e=_0x3349f3[_0x42ad2b(0x17a)];if(!_0x43787e)throw new Error(_0x42ad2b(0x171)+_0x2627f8);const _0x23011f=_0x3349f3['type']===_0x42ad2b(0x169)?_0x42ad2b(0x169):_0x42ad2b(0x150),_0x1dc2f5=a153_0x13f611[_0x42ad2b(0x159)](_0x312131,_0x420238),_0x2618f7=a153_0x13f611[_0x42ad2b(0x167)](_0x1dc2f5),_0x5e3685=_0x2618f7==='.'?'':_0x2618f7[_0x42ad2b(0x180)](/\\/g,'/'),_0x2d9357=_0x5e3685?_0x1825bf+'/'+_0x5e3685+'/'+_0x43787e:_0x1825bf+'/'+_0x43787e;return{'parentSegment':_0x1825bf,'segmentName':_0x43787e,'folderPath':_0x5e3685,'fullPath':_0x2d9357,'resourceType':_0x23011f,'content':_0x32b62a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x223a9a,_0x48628d){const _0x160a15=a154_0x2c07,_0x23932=_0x223a9a();while(!![]){try{const _0x547c5c=-parseInt(_0x160a15(0xfb))/0x1+parseInt(_0x160a15(0xfe))/0x2*(-parseInt(_0x160a15(0x100))/0x3)+parseInt(_0x160a15(0x107))/0x4+parseInt(_0x160a15(0x101))/0x5+parseInt(_0x160a15(0x102))/0x6*(parseInt(_0x160a15(0x103))/0x7)+parseInt(_0x160a15(0x104))/0x8+parseInt(_0x160a15(0xfc))/0x9;if(_0x547c5c===_0x48628d)break;else _0x23932['push'](_0x23932['shift']());}catch(_0x27d929){_0x23932['push'](_0x23932['shift']());}}}(a154_0x1c6b,0xc6945));function a154_0x2c07(_0x382b40,_0x14faf9){_0x382b40=_0x382b40-0xfb;const _0x1c6b9f=a154_0x1c6b();let _0x2c07a4=_0x1c6b9f[_0x382b40];return _0x2c07a4;}export function parseSegmentRef(_0x181b92){const _0x5dd1af=a154_0x2c07,_0x49fc0c=_0x181b92[_0x5dd1af(0x106)]('/');if(_0x49fc0c===-0x1)return{'parentId':_0x181b92};if(_0x49fc0c===0x0)throw new Error(_0x5dd1af(0x105)+_0x181b92+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x3cd28d=_0x181b92['substring'](0x0,_0x49fc0c),_0x23bca1=_0x181b92[_0x5dd1af(0xff)](_0x49fc0c+0x1);if(_0x23bca1==='')throw new Error(_0x5dd1af(0x105)+_0x181b92+_0x5dd1af(0xfd));return{'parentId':_0x3cd28d,'childId':_0x23bca1};}function a154_0x1c6b(){const _0x22f1a6=['713860BAeETA','3174180OytbVe','14kveBbv','4256112FrDUWg','Invalid\x20segment\x20reference\x20format:\x20','indexOf','252836oEMZCJ','1617303zYHEmG','12271896ivYTkP','.\x20Child\x20name\x20cannot\x20be\x20empty','290jPgYkX','substring','15081shtXzK'];a154_0x1c6b=function(){return _0x22f1a6;};return a154_0x1c6b();}
|