@treasuredata/tdx 2026.3.19 → 2026.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/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.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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/segment-validator.js.map +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/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a139_0x3153(_0x56c118,_0x31f67c){_0x56c118=_0x56c118-0x1bd;const _0x5d6ecf=a139_0x5d6e();let _0x3153c4=_0x5d6ecf[_0x56c118];return _0x3153c4;}(function(_0xbf3c1b,_0x2f1d8e){const _0x5c07b4=a139_0x3153,_0x376403=_0xbf3c1b();while(!![]){try{const _0x4fb029=-parseInt(_0x5c07b4(0x1d1))/0x1*(parseInt(_0x5c07b4(0x1cb))/0x2)+parseInt(_0x5c07b4(0x1be))/0x3*(parseInt(_0x5c07b4(0x1d3))/0x4)+-parseInt(_0x5c07b4(0x1cc))/0x5*(-parseInt(_0x5c07b4(0x1cd))/0x6)+-parseInt(_0x5c07b4(0x1d9))/0x7+-parseInt(_0x5c07b4(0x1ce))/0x8*(parseInt(_0x5c07b4(0x1c3))/0x9)+-parseInt(_0x5c07b4(0x1da))/0xa*(-parseInt(_0x5c07b4(0x1c1))/0xb)+-parseInt(_0x5c07b4(0x1d0))/0xc*(-parseInt(_0x5c07b4(0x1c5))/0xd);if(_0x4fb029===_0x2f1d8e)break;else _0x376403['push'](_0x376403['shift']());}catch(_0x5a7992){_0x376403['push'](_0x376403['shift']());}}}(a139_0x5d6e,0x1ac3a));function a139_0x5d6e(){const _0x4e68fe=['124046SwBvfr','parse','segments','journeyName','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','.tmp','20CTVgNd','45byVWFB','133314RrUZoK','368tLqmNy','.push-recovery.json','276nMSgQq','9799jHiQky','string','716cjNiwD','join','utf-8','basename','dirname','debug','770273MEBYhL','50kwVSOZ','toISOString','267gYNewk','code','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','144617nOtHNQ','stringify','35892tYuiwZ','warn'];a139_0x5d6e=function(){return _0x4e68fe;};return a139_0x5d6e();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x26e96f from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x1bbafd){const _0x3bb21e=a139_0x3153,_0x597f80=a139_0x26e96f[_0x3bb21e(0x1d7)](_0x1bbafd),_0x530d83=a139_0x26e96f[_0x3bb21e(0x1d6)](_0x1bbafd);return a139_0x26e96f[_0x3bb21e(0x1d4)](_0x597f80,'.'+_0x530d83+_0x3bb21e(0x1cf));}export function readPushRecovery(_0x5dac52){const _0xd6861a=a139_0x3153,_0xeed22b=getPushRecoveryPath(_0x5dac52);if(!existsSync(_0xeed22b))return undefined;try{const _0x5876fe=readFileSync(_0xeed22b,_0xd6861a(0x1d5)),_0x1755c6=JSON[_0xd6861a(0x1c6)](_0x5876fe);if(_0x1755c6?.['version']!==0x1||typeof _0x1755c6[_0xd6861a(0x1c8)]!==_0xd6861a(0x1d2))return undefined;return _0x1755c6;}catch(_0xb45071){return _0xb45071 instanceof SyntaxError?logger[_0xd6861a(0x1d8)](_0xd6861a(0x1c0)+_0xb45071):logger[_0xd6861a(0x1c4)](_0xd6861a(0x1c9)+_0xb45071),undefined;}}export function writePushRecovery(_0x2ad128,_0x48474a){const _0x5a8e58=a139_0x3153,_0x1413f0=getPushRecoveryPath(_0x2ad128),_0x2e89e8=_0x1413f0+_0x5a8e58(0x1ca);writeFileSync(_0x2e89e8,JSON[_0x5a8e58(0x1c2)](_0x48474a,null,0x2)+'\x0a',_0x5a8e58(0x1d5)),renameSync(_0x2e89e8,_0x1413f0);}export function deletePushRecovery(_0x24431d){const _0x5dd447=a139_0x3153,_0x336036=getPushRecoveryPath(_0x24431d);try{unlinkSync(_0x336036);}catch(_0x122236){_0x122236[_0x5dd447(0x1bf)]!=='ENOENT'&&logger[_0x5dd447(0x1d8)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x122236);}}export function saveSegmentToPushRecovery(_0x4c063c,_0x4f10c6,_0x4d62c8,_0x409cc6){const _0x5d1d88=a139_0x3153,_0x457893=readPushRecovery(_0x4c063c),_0x767b52=_0x457893?.[_0x5d1d88(0x1c8)]===_0x4f10c6?{..._0x457893,'updatedAt':new Date()[_0x5d1d88(0x1bd)]()}:{'version':0x1,'journeyName':_0x4f10c6,'updatedAt':new Date()[_0x5d1d88(0x1bd)](),'segments':{}};_0x767b52[_0x5d1d88(0x1c7)][_0x4d62c8]=_0x409cc6,writePushRecovery(_0x4c063c,_0x767b52);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x1bbbd8=a140_0xf1db;(function(_0x1906e6,_0x4d155a){const _0x5574f7=a140_0xf1db,_0x16f9ad=_0x1906e6();while(!![]){try{const _0x394ce4=-parseInt(_0x5574f7(0x287))/0x1*(parseInt(_0x5574f7(0x2bd))/0x2)+parseInt(_0x5574f7(0x1d6))/0x3*(-parseInt(_0x5574f7(0x2be))/0x4)+-parseInt(_0x5574f7(0x285))/0x5*(-parseInt(_0x5574f7(0x2b1))/0x6)+-parseInt(_0x5574f7(0x260))/0x7*(-parseInt(_0x5574f7(0x1d5))/0x8)+parseInt(_0x5574f7(0x24d))/0x9*(parseInt(_0x5574f7(0x224))/0xa)+parseInt(_0x5574f7(0x20a))/0xb+parseInt(_0x5574f7(0x1d3))/0xc*(-parseInt(_0x5574f7(0x223))/0xd);if(_0x394ce4===_0x4d155a)break;else _0x16f9ad['push'](_0x16f9ad['shift']());}catch(_0xaa43d){_0x16f9ad['push'](_0x16f9ad['shift']());}}}(a140_0x168c,0xd04d3));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x1bbbd8(0x24a));export const PENDING_SEGMENT_PREFIX=a140_0x1bbbd8(0x22e);export const PENDING_ACTIVATION_PREFIX=a140_0x1bbbd8(0x261);export function createPendingSegmentId(_0x48a980){return''+PENDING_SEGMENT_PREFIX+_0x48a980+'__';}export function isPendingSegmentId(_0x2ff5be){const _0x4a6ef8=a140_0x1bbbd8;return _0x2ff5be[_0x4a6ef8(0x259)](PENDING_SEGMENT_PREFIX)&&!_0x2ff5be['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x49767c){const _0x76b2e6=a140_0x1bbbd8;return _0x49767c[_0x76b2e6(0x21a)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5ebe24){return''+PENDING_ACTIVATION_PREFIX+_0x5ebe24+'__';}export function isPendingActivationId(_0x3c43f5){return _0x3c43f5['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x584fb9){const _0x49fafb=a140_0x1bbbd8;return _0x584fb9[_0x49fafb(0x21a)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4b679a,_0x69f542){const _0x5924c2=a140_0x1bbbd8,_0x505232=_0x4b679a+'::'+(_0x69f542['trim']()||_0x5924c2(0x2b6)),_0x142fb1=createHash(_0x5924c2(0x2ac))[_0x5924c2(0x1f5)](_0x505232)[_0x5924c2(0x2b5)](_0x5924c2(0x1ee))[_0x5924c2(0x29e)](0x0,0xc);return _0x5924c2(0x1d0)+_0x142fb1;}export function ensureJourneyDefaults(_0x170b1c){const _0x3f1327=a140_0x1bbbd8;!_0x170b1c['description']&&(_0x170b1c['description']=''),!_0x170b1c[_0x3f1327(0x29b)]&&(_0x170b1c['state']=_0x3f1327(0x1cf));}export function injectExistingStageIds(_0x25f619,_0x46eb07){const _0x51b9e6=a140_0x1bbbd8,_0x188e82=new Map(_0x46eb07['map'](_0x20d920=>[_0x20d920[_0x51b9e6(0x25d)],_0x20d920['id']]));for(const _0x3743d6 of _0x25f619){if(!_0x3743d6['id']){const _0x573172=_0x188e82[_0x51b9e6(0x22f)](_0x3743d6[_0x51b9e6(0x25d)]);_0x573172&&(_0x3743d6['id']=_0x573172);}}}export function resolveTDFolderPath(_0x55b708,_0x16a85a,_0x41f813){const _0x1f2959=a140_0x1bbbd8;if(!_0x16a85a)return _0x55b708;if(_0x55b708===_0x41f813||_0x55b708[_0x1f2959(0x259)](_0x41f813+'/'))return _0x55b708;return _0x55b708?_0x41f813+'/'+_0x55b708:_0x41f813;}export function addFoldersToCreate(_0x2622d5,_0x220d0e,_0x1090ea){const _0x4872f9=a140_0x1bbbd8;if(!_0x2622d5)return;if(_0x220d0e[_0x4872f9(0x240)](_0x2622d5))return;const _0x53f10d=_0x2622d5[_0x4872f9(0x29f)]('/');let _0x34957d='';for(const _0x562018 of _0x53f10d){_0x34957d=_0x34957d?_0x34957d+'/'+_0x562018:_0x562018,!_0x220d0e[_0x4872f9(0x240)](_0x34957d)&&_0x1090ea['add'](_0x34957d);}}export function sortFoldersByDepth(_0x3722c2){const _0x40ddad=a140_0x1bbbd8;return[..._0x3722c2][_0x40ddad(0x2ce)]((_0xad35bb,_0x2861ed)=>{const _0x1af6e6=_0x40ddad,_0x3f5d54=(_0xad35bb[_0x1af6e6(0x1d2)](/\//g)||[])[_0x1af6e6(0x2ab)],_0x29da17=(_0x2861ed['match'](/\//g)||[])[_0x1af6e6(0x2ab)];return _0x3f5d54-_0x29da17;});}import*as a140_0x45ca55 from'yaml';import{readFileSync}from'fs';import a140_0x3cbe56 from'path';import{isJourneyDef,parseYamlString as a140_0xcad34d,toYamlString as a140_0x44fad2,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(_0x3885c3){const _0x2f0b4e=a140_0x1bbbd8;if(Array[_0x2f0b4e(0x2ca)](_0x3885c3))return'['+_0x3885c3['map'](_0x3b5b3e=>stableStringify(_0x3b5b3e))[_0x2f0b4e(0x295)](',')+']';if(_0x3885c3&&typeof _0x3885c3===_0x2f0b4e(0x1f6)){const _0x8ca77c=_0x3885c3,_0xad86e1=Object['keys'](_0x8ca77c)[_0x2f0b4e(0x2ce)](),_0x25b427=_0xad86e1[_0x2f0b4e(0x2bc)](_0x1c2346=>'\x22'+_0x1c2346+'\x22:'+stableStringify(_0x8ca77c[_0x1c2346]));return'{'+_0x25b427['join'](',')+'}';}const _0x497a53=JSON['stringify'](_0x3885c3);return _0x497a53===undefined?_0x2f0b4e(0x1e2):_0x497a53;}function activationSignature(_0xbf5c7d){const _0x4091ab=a140_0x1bbbd8,_0x282650={'connection':_0xbf5c7d[_0x4091ab(0x2a9)],..._0xbf5c7d[_0x4091ab(0x250)]!==undefined&&{'all_columns':_0xbf5c7d[_0x4091ab(0x250)]},..._0xbf5c7d[_0x4091ab(0x2bb)]!==undefined&&{'columns':_0xbf5c7d['columns']},..._0xbf5c7d[_0x4091ab(0x280)]!==undefined&&{'behavior':_0xbf5c7d[_0x4091ab(0x280)]},..._0xbf5c7d[_0x4091ab(0x288)]!==undefined&&{'schedule':_0xbf5c7d[_0x4091ab(0x288)]},..._0xbf5c7d[_0x4091ab(0x28e)]!==undefined&&{'notification':_0xbf5c7d[_0x4091ab(0x28e)]},..._0xbf5c7d['connector_config']!==undefined&&{'connector_config':_0xbf5c7d[_0x4091ab(0x2af)]},..._0xbf5c7d[_0x4091ab(0x257)]!==undefined&&{'activation_template_id':_0xbf5c7d['activation_template_id']}};return stableStringify(_0x282650);}async function fetchSegment(_0x2bf968,_0x2f4f9d,_0x14ad5a,_0x1a3b51){const _0x3c2bdc=a140_0x1bbbd8,_0x272dac=_0x1a3b51?.['find'](_0x4cf62b=>_0x4cf62b['id']===_0x14ad5a);if(_0x272dac)return _0x272dac;try{return await _0x2bf968['segment'][_0x3c2bdc(0x1fe)](_0x2f4f9d,_0x14ad5a);}catch(_0x20fde0){logger['debug'](_0x3c2bdc(0x22b)+_0x14ad5a+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x20fde0);try{return await _0x2bf968['segment']['getSegmentEntity'](_0x14ad5a);}catch(_0x1f20a8){return logger[_0x3c2bdc(0x2a0)](_0x3c2bdc(0x299)+_0x14ad5a+':\x20'+_0x1f20a8),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2e2424,_0x3288f5,_0x1ff0d8){const _0x20c7ca=a140_0x1bbbd8,_0xf1ec8d=readPushRecovery(_0x2e2424[_0x20c7ca(0x28a)]);if(_0xf1ec8d?.['journeyName']===_0x2e2424['yamlConfig'][_0x20c7ca(0x25d)])for(const [_0x448998,_0x1906ef]of Object['entries'](_0xf1ec8d[_0x20c7ca(0x1df)])){const _0x43b8e4=generateDeterministicJourneySegmentName(_0x2e2424[_0x20c7ca(0x244)][_0x20c7ca(0x25d)],_0x448998);_0x1906ef[_0x20c7ca(0x209)]===_0x43b8e4&&(_0x3288f5[_0x20c7ca(0x1ff)](_0x448998,_0x1906ef[_0x20c7ca(0x1f2)]),_0x1ff0d8['set'](_0x448998,_0x1906ef[_0x20c7ca(0x1f2)]));}}async function createOrRecoverEmbeddedSegment(_0x2912ee,_0x5f5504,_0x37596b,_0x16f395){const _0x4fbfe0=a140_0x1bbbd8;let _0x446f4b;try{_0x446f4b=await _0x2912ee['segment'][_0x4fbfe0(0x1d4)]({'name':_0x37596b[_0x4fbfe0(0x296)],'description':_0x37596b[_0x4fbfe0(0x251)],'journeyId':_0x37596b[_0x4fbfe0(0x1f8)],'rule':_0x16f395(_0x37596b[_0x4fbfe0(0x1e5)],!![]),'countPopulation':!![],'parentFolderId':_0x37596b[_0x4fbfe0(0x1e1)],'audienceId':_0x37596b['parentId']});}catch(_0x3d5d4b){const _0x1d2f83=_0x3d5d4b instanceof Error&&_0x3d5d4b[_0x4fbfe0(0x1e3)][_0x4fbfe0(0x1f4)]('Name\x20has\x20already\x20been\x20taken');if(_0x1d2f83){const _0x24d0c3=readPushRecovery(_0x5f5504[_0x4fbfe0(0x28a)]),_0x25c108=_0x24d0c3?.['journeyName']===_0x5f5504[_0x4fbfe0(0x244)][_0x4fbfe0(0x25d)]?_0x24d0c3['segments'][_0x37596b['localName']]:undefined;if(_0x25c108?.[_0x4fbfe0(0x209)]===_0x37596b[_0x4fbfe0(0x296)])await _0x2912ee[_0x4fbfe0(0x2b6)][_0x4fbfe0(0x1ef)](_0x37596b['parentId'],_0x25c108['segmentId'],{'description':_0x37596b[_0x4fbfe0(0x251)],'rule':_0x16f395(_0x37596b[_0x4fbfe0(0x1e5)],!![]),'countPopulation':!![]}),_0x446f4b=_0x25c108['segmentId'];else throw new SDKError(ErrorCode[_0x4fbfe0(0x214)],_0x4fbfe0(0x270)+_0x37596b[_0x4fbfe0(0x21c)]+_0x4fbfe0(0x2a4)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x5f5504[_0x4fbfe0(0x28a)][_0x4fbfe0(0x21a)](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x4fbfe0(0x2a8),_0x3d5d4b);}else throw _0x3d5d4b;}return saveSegmentToPushRecovery(_0x5f5504[_0x4fbfe0(0x28a)],_0x5f5504['yamlConfig'][_0x4fbfe0(0x25d)],_0x37596b[_0x4fbfe0(0x21c)],{'segmentId':_0x446f4b,'uniqueServerName':_0x37596b[_0x4fbfe0(0x296)],'createdAt':new Date()[_0x4fbfe0(0x246)]()}),_0x446f4b;}export async function prepareSegmentFiles(_0x581750,_0x40edbd,_0x24b55e,_0x5e94fb,_0x3a1a49){const _0x55f0ec=a140_0x1bbbd8,{activationDefToCreateRequest:_0x4a9429}=await import(_0x55f0ec(0x297)),_0x20a2c5=[],_0x4a6063=new Set();for(const {yamlConfig:_0x3493fb,folderPath:_0x14f27f,sourcePath:_0x507917}of _0x581750){const _0x361b32=resolveTDFolderPath(_0x14f27f,_0x5e94fb,_0x3a1a49),_0xb82410=_0x361b32+':'+_0x3493fb[_0x55f0ec(0x25d)],_0x3e1958=_0x40edbd[_0x55f0ec(0x2a2)][_0x55f0ec(0x22f)](_0xb82410),_0x2b1090=_0x3e1958?_0x40edbd['activationsBySegmentId'][_0x55f0ec(0x22f)](_0x3e1958['id'])||[]:[];addFoldersToCreate(_0x361b32,_0x40edbd[_0x55f0ec(0x2b3)],_0x4a6063);const _0x1d5bfd=calculateActivationActions(_0x3493fb[_0x55f0ec(0x2c9)]||[],_0x2b1090,_0x40edbd[_0x55f0ec(0x29d)],_0x40edbd['connectionIdToNameMap']);for(const _0x1d3d7d of _0x1d5bfd){(_0x1d3d7d[_0x55f0ec(0x29a)]===_0x55f0ec(0x218)||_0x1d3d7d[_0x55f0ec(0x29a)]==='update')&&_0x1d3d7d[_0x55f0ec(0x212)]&&(_0x1d3d7d[_0x55f0ec(0x2c5)]=await _0x4a9429(_0x1d3d7d[_0x55f0ec(0x212)],_0x24b55e));}const _0x37055c=calculateSegmentDiff(_0x3493fb,_0x3e1958,_0x2b1090,_0x40edbd[_0x55f0ec(0x29d)],_0x40edbd['connectionIdToNameMap']);_0x20a2c5[_0x55f0ec(0x2d0)]({'relativePath':_0x3493fb[_0x55f0ec(0x25d)],'absolutePath':_0x507917,'yamlConfig':_0x3493fb,'folderPath':_0x361b32,'existingSegment':_0x3e1958,'existingActivations':_0x2b1090,'isNew':_0x37055c[_0x55f0ec(0x237)],'hasChanges':_0x37055c[_0x55f0ec(0x2cc)],'diff':_0x37055c[_0x55f0ec(0x26f)],'activationActions':_0x1d5bfd});}return{'segmentFiles':_0x20a2c5,'foldersToCreate':_0x4a6063};}export async function prepareJourneyFiles(_0x46a45c,_0x54f5a0,_0x3e73d7,_0x2199ee){const _0x4dc5a6=a140_0x1bbbd8,_0x1eed8d=[],_0x4b2307=new Set();for(const {yamlConfig:_0x13a0ed,folderPath:_0x31dc83,sourcePath:_0x10a1e1}of _0x46a45c){const _0x1bd1d4=resolveTDFolderPath(_0x31dc83,_0x3e73d7,_0x2199ee),_0x30d6f7=_0x1bd1d4+':'+_0x13a0ed[_0x4dc5a6(0x25d)],_0x12a353=_0x54f5a0[_0x4dc5a6(0x245)]['get'](_0x30d6f7);let _0x3c8174,_0x35d0f2;if(_0x12a353&&_0x12a353[_0x4dc5a6(0x2ab)]>0x0){const _0x473d79=buildLocalExpandedRuleMappings(_0x13a0ed),{createYamlContext:_0x16cb6e,prefetchJourneySegments:_0x13a7dd}=createPushYamlContextForBundle(_0x54f5a0[_0x4dc5a6(0x2c4)],_0x54f5a0['parentId'],_0x54f5a0['existingSegments'],_0x473d79,_0x54f5a0[_0x4dc5a6(0x29d)],_0x54f5a0[_0x4dc5a6(0x282)],_0x54f5a0[_0x4dc5a6(0x20d)],_0x54f5a0['journeyById']);await _0x13a7dd(_0x12a353['map'](_0x206a92=>_0x206a92['id']));const _0xcb9613=await _0x54f5a0[_0x4dc5a6(0x2c4)][_0x4dc5a6(0x226)][_0x4dc5a6(0x216)](_0x12a353[0x0][_0x4dc5a6(0x23e)]),_0xacc485=hasMultipleVersions(_0x13a0ed),_0x1c767f=async _0xa100be=>{const _0x232ed9=_0x4dc5a6,_0x389b8d=_0x54f5a0['journeyById']?.[_0x232ed9(0x22f)](_0xa100be);if(_0x389b8d)return _0x389b8d;return _0x54f5a0[_0x232ed9(0x2c1)]({'journeyId':_0xa100be,'journeyName':_0x13a0ed[_0x232ed9(0x25d)],'isMultiVersion':_0x12a353[_0x232ed9(0x2ab)]>0x1});};if(_0xacc485&&_0x12a353['length']>0x1){const _0x2a7600=[];for(const _0x407931 of _0x12a353){const _0x45819f=_0x407931[_0x4dc5a6(0x264)]||0x1;_0x54f5a0[_0x4dc5a6(0x25f)]?.[_0x4dc5a6(0x1f5)](_0x4dc5a6(0x291)+_0x13a0ed[_0x4dc5a6(0x25d)]+'\x20v'+_0x45819f);const _0x2da5a0=await _0x1c767f(_0x407931['id']),_0x286fd0=_0x16cb6e(_0x407931['id']),_0x12f7b9=await journeyResponseToDef(_0x2da5a0,_0x286fd0);_0x2a7600[_0x4dc5a6(0x2d0)]({'item':_0x407931,'yaml':_0x12f7b9});}const _0x3207cf=buildLocalRuleToNameMappingFromJourney(_0x13a0ed);_0x35d0f2=buildMergedJourneyDef(_0x2a7600,_0x3207cf,_0xcb9613);const _0x2b4f3a=Math[_0x4dc5a6(0x1f9)](..._0x2a7600[_0x4dc5a6(0x2bc)](_0xa60ec9=>_0xa60ec9[_0x4dc5a6(0x265)]['versionNumber']||0x0)),_0x215986=_0x12a353['find'](_0x5a5165=>(_0x5a5165['versionNumber']||0x0)===_0x2b4f3a);_0x215986&&(_0x54f5a0['progress']?.['update']('Fetching\x20'+_0x13a0ed[_0x4dc5a6(0x25d)]+'\x20v'+_0x2b4f3a),_0x3c8174=await _0x1c767f(_0x215986['id']));}else{const _0x2d098e=_0x12a353[_0x12a353[_0x4dc5a6(0x2ab)]-0x1];_0x54f5a0[_0x4dc5a6(0x25f)]?.[_0x4dc5a6(0x1f5)](_0x4dc5a6(0x291)+_0x13a0ed[_0x4dc5a6(0x25d)]),_0x3c8174=await _0x1c767f(_0x2d098e['id']);const _0x4bab59=_0x16cb6e(_0x2d098e['id']),_0x28172d=await journeyResponseToDef(_0x3c8174,_0x4bab59),_0x54dca1=buildLocalRuleToNameMappingFromJourney(_0x13a0ed);_0x35d0f2=buildMergedJourneyDef([{'item':_0x2d098e,'yaml':_0x28172d}],_0x54dca1,_0xcb9613);}}addFoldersToCreate(_0x1bd1d4,_0x54f5a0[_0x4dc5a6(0x2b3)],_0x4b2307);const _0x4a41dd=calculateJourneyDiff(_0x13a0ed,_0x35d0f2);_0x1eed8d[_0x4dc5a6(0x2d0)]({'relativePath':_0x13a0ed[_0x4dc5a6(0x25d)],'absolutePath':_0x10a1e1,'yamlConfig':_0x13a0ed,'folderPath':_0x1bd1d4,'existingJourney':_0x3c8174,'isNew':_0x4a41dd['isNew'],'hasChanges':_0x4a41dd[_0x4dc5a6(0x2cc)],'diff':_0x4a41dd[_0x4dc5a6(0x26f)]});}return{'journeyFiles':_0x1eed8d,'foldersToCreate':_0x4b2307};}export function calculateActivationActions(_0x118780,_0x3fc171,_0x5e4d37,_0x132d1d){const _0x5f4d17=a140_0x1bbbd8,_0x2d9e51=[],_0x4729f0=new Map();for(const _0x3e8251 of _0x3fc171){_0x4729f0[_0x5f4d17(0x1ff)](_0x3e8251[_0x5f4d17(0x25d)],_0x3e8251);}const _0x2ccd5d=new Map();for(const _0x39218b of _0x118780){_0x2ccd5d['set'](_0x39218b[_0x5f4d17(0x25d)],_0x39218b);}for(const _0x28d133 of _0x118780){const _0x1d388a=_0x4729f0['get'](_0x28d133['name']);if(!_0x1d388a)_0x2d9e51[_0x5f4d17(0x2d0)]({'type':_0x5f4d17(0x218),'name':_0x28d133['name'],'yamlActivation':_0x28d133});else{const _0x30184b=activationResponseToDef(_0x1d388a,_0x5e4d37,_0x132d1d),_0xdcdbbe=a140_0x45ca55[_0x5f4d17(0x202)](_0x30184b),_0x1471ca=a140_0x45ca55['stringify'](_0x28d133);_0xdcdbbe!==_0x1471ca&&_0x2d9e51[_0x5f4d17(0x2d0)]({'type':_0x5f4d17(0x1f5),'name':_0x28d133[_0x5f4d17(0x25d)],'yamlActivation':_0x28d133,'existingActivation':_0x1d388a});}}for(const _0x4c70e5 of _0x3fc171){!_0x2ccd5d[_0x5f4d17(0x240)](_0x4c70e5[_0x5f4d17(0x25d)])&&_0x2d9e51[_0x5f4d17(0x2d0)]({'type':'delete','name':_0x4c70e5[_0x5f4d17(0x25d)],'existingActivation':_0x4c70e5});}return _0x2d9e51;}function calculateYamlDiff(_0x182251,_0x51e8e1){if(_0x51e8e1){const _0x348e05=generateDiff(_0x51e8e1,_0x182251),_0x26aeca=hasChanges(_0x348e05);return{'isNew':![],'hasChanges':_0x26aeca,'diff':_0x26aeca?formatDiffWithColors(_0x348e05):undefined};}const _0x53ebd3=generateDiff('',_0x182251);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x53ebd3)};}export function calculateSegmentDiff(_0x167ce5,_0x3e55bd,_0x64194a,_0x41140d,_0x1ff87d){const _0xfb397a=segmentToYamlString(_0x167ce5),_0x461f5c=_0x3e55bd?segmentToYamlString(segmentWithActivationsToYaml(_0x3e55bd,_0x64194a,undefined,_0x41140d,_0x1ff87d)):undefined;return calculateYamlDiff(_0xfb397a,_0x461f5c);}export function calculateJourneyDiff(_0x38cada,_0xad0814){const _0x4c1323=normalizeJourneyDef(_0x38cada,_0x38cada),_0x32c1e5=a140_0x44fad2(_0x4c1323),_0x5ecbbd=_0xad0814?a140_0x44fad2(normalizeJourneyDef(_0xad0814,_0x38cada)):undefined;return calculateYamlDiff(_0x32c1e5,_0x5ecbbd);}export function findSegmentsToDelete(_0x521340,_0x20092b,_0x2f5bef,_0x270b99,_0x4cd929){const _0x57ded6=a140_0x1bbbd8,_0x32aea7=new Set();for(const {yamlConfig:_0x37489c,folderPath:_0x3e643c}of _0x20092b){_0x32aea7[_0x57ded6(0x241)](_0x3e643c+':'+_0x37489c['name']);}return _0x521340[_0x57ded6(0x1d7)](_0x99ab53=>{const _0x3d9705=_0x57ded6,_0x4aad89=_0x99ab53[_0x3d9705(0x210)]?_0x2f5bef[_0x3d9705(0x22f)](_0x99ab53['segmentFolderId'][_0x3d9705(0x1eb)]())||'':'',_0x49868f=_0x4aad89+':'+_0x99ab53[_0x3d9705(0x25d)];if(_0x32aea7[_0x3d9705(0x240)](_0x49868f))return![];if(_0x4cd929)return _0x4aad89===_0x270b99||_0x4aad89[_0x3d9705(0x259)](_0x270b99+'/');return!![];});}export function findJourneysToDelete(_0x3f2673,_0x59af3e,_0x3f1765,_0x6e5f1f,_0x9976ff){const _0x36fa92=new Set();for(const {yamlConfig:_0x41b182,folderPath:_0x231228}of _0x59af3e){_0x36fa92['add'](_0x231228+':'+_0x41b182['name']);}return _0x3f2673['filter'](_0x18a516=>{const _0x4c132e=a140_0xf1db,_0x3f81a3=_0x18a516[_0x4c132e(0x1e1)]?_0x3f1765[_0x4c132e(0x22f)](_0x18a516['folderId'])||'':'',_0x1d6084=_0x3f81a3+':'+_0x18a516[_0x4c132e(0x2a1)];if(_0x36fa92[_0x4c132e(0x240)](_0x1d6084))return![];if(_0x9976ff)return _0x3f81a3===_0x6e5f1f||_0x3f81a3[_0x4c132e(0x259)](_0x6e5f1f+'/');return!![];});}export function buildSegmentLookupMap(_0x391f14,_0x26e5e7){const _0x4b0171=a140_0x1bbbd8,_0x5152ac=new Map();for(const _0x8831dd of _0x391f14){const _0x5005ad=_0x8831dd[_0x4b0171(0x210)]?_0x26e5e7[_0x4b0171(0x22f)](_0x8831dd[_0x4b0171(0x210)][_0x4b0171(0x1eb)]())||'':'',_0x2a3610=_0x5005ad+':'+_0x8831dd[_0x4b0171(0x25d)];_0x5152ac[_0x4b0171(0x1ff)](_0x2a3610,_0x8831dd);}return _0x5152ac;}function a140_0x168c(){const _0x1ead97=['activation_updating','\x20segment\x20from\x20file:\x20','ACTIVATION_UPDATE_ERROR','\x27\x20not\x20found\x20in\x20journey\x20\x27','utf-8','exitCriterias','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','isNew','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','logDeleted','conditionTimeoutDuration','segment_creating','segment_deleted','Creating\x20segment\x20\x27','journeyBundleId','SEGMENT_NOT_FOUND','has','add','segment_deleting','results','yamlConfig','journeyBundlesByFolderAndName','toISOString','Segment\x20not\x20found:\x20','activationContext','WaitStep','tdx.sdk.push-workflow','deleteActivation','Updated\x20activation\x20\x27','153OospHa','stages','parseDocument','all_columns','description','segmentNameToId','JOURNEY_SYNTAX_ERROR','existingJourney','stage\x20\x27','withProgress','activation_template_id','conditionTimeoutUnit','startsWith','journey_created','relationships','Failed\x20to\x20','name','embedded_activation_creating','progress','1857359JJWfKe','__pending_act_','toLowerCase','journey_updating','versionNumber','item','\x20(referenced\x20in\x20journey\x20','dirname','folder_creating','activationParams','reduce','parentId','\x0a\x20\x20','\x20error(s)','getJourney','diff','Embedded\x20segment\x20\x27','\x27\x20by\x20rule\x20content','steps','NOT_FOUND','find','entryCriteria','entry_criteria','activation_deleted','embeddedSegmentNameToId','Duration','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','delete','created','activation_updated','logSuccess','all','behavior','decision_point','connectionIdToNameMap','listActivations','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','424685LuUAkb','Failed\x20to\x20resolve\x20activation\x20','193vAOWMG','schedule','waitStepType','absolutePath','folderPath','./journey-yaml.js','Created\x20activation\x20\x27','notification','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','Fetching\x20','DecisionPoint','entry','folder','join','uniqueSegmentName','./child-segment-yaml.js','Deleting\x20activation\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','type','state','getActivation','idToEmailMap','slice','split','debug','journeyBundleName','segmentByFolderAndName','createdSegmentId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','goal','Updated\x20segment\x20\x27','Deleted\x20segment\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','connection','run_after_journey_refresh','length','sha1','existingActivation','Condition','connector_config','buildUserMaps','72eLMDOw','waitStepUnit','folderPathToId','embedded_segment_creating','digest','segment','updated','journeys','onProgress','day','columns','map','14218iqUwJv','540wBlanD','journeyActivationStepId','\x27\x20wait\x20condition','fetchJourney','goal\x20criteria','logInfo','deps','validatedRequest','from','\x20activation\x20\x27','milestone','activations','isArray','action','hasChanges','journeyStages','sort','Created\x20folder\x20\x27','push','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x20journey\x20from\x20file:\x20','\x27...','rootFolderId','some','draft','journey_entry_criteria_','valid','match','48Xsgjdz','createJourneySegment','16FEBgHK','10509UuSGDB','filter','existingSegment','user','Creating\x20folder\x20\x27','branches','Stage\x20\x27','data','segment_updated','segments','Updating\x20segment\x20\x27','folderId','null','message','deleteSegment','resolvedRule','resolveSegment','waitStep','createActivation','segment_updating','with','toString','\x27\x20milestone','Created\x20journey\x20\x27','hex','updateSegmentById','\x27\x20entry\x20criteria','index','segmentId','relative','includes','update','object','nameToId','journeyId','max','../../utils/async.js','\x27\x20for\x20','createdSegmentIds','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','getSegment','set','idToName','unchanged','stringify','flatMap','updateActivation','size','conditions','\x27\x20to\x20local\x20\x27','embedded_segment_created','uniqueServerName','16596833gMJJrK','activation_deleting','journeyActivationNameToId','activationStepsById','\x27\x20from\x20file:\x20','parse','segmentFolderId','attributes','yamlActivation','Failed\x20to\x20resolve\x20segment\x20','SEGMENT_UPDATE_ERROR','segment_created','getLatestJourneyId','rule','create','Activation','replace','kind','localName','createFolder','deleted','INTERNAL','Creating\x20activation\x20\x27','Journey\x20\x27','existingSegments','2585388UnrkOZ','255840bsoXvl','conditionSegmentId','journey','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Updated\x20journey\x20\x27','entries','Updating\x20activation\x20\x27','getSegment\x20failed\x20for\x20','activation_created','nameToType','__pending_','get'];a140_0x168c=function(){return _0x1ead97;};return a140_0x168c();}export function buildSegmentNameToIdMap(_0x44208a){const _0x452395=a140_0x1bbbd8,_0x6af492=new Map();for(const _0xa076d1 of _0x44208a){_0x6af492[_0x452395(0x1ff)](_0xa076d1['name'],_0xa076d1['id']);}return _0x6af492;}export function buildJourneyBundleLookupMap(_0x337836,_0x1437f8){const _0x479293=a140_0x1bbbd8,_0x3d9fb9=new Map();for(const _0x3344fb of _0x337836){const _0x44ec66=_0x3344fb[_0x479293(0x1e1)]?_0x1437f8['get'](_0x3344fb[_0x479293(0x1e1)])||'':'',_0x3abdb6=_0x44ec66+':'+_0x3344fb[_0x479293(0x2a1)];!_0x3d9fb9[_0x479293(0x240)](_0x3abdb6)&&_0x3d9fb9[_0x479293(0x1ff)](_0x3abdb6,[]),_0x3d9fb9[_0x479293(0x22f)](_0x3abdb6)[_0x479293(0x2d0)](_0x3344fb);}for(const _0x4fc046 of _0x3d9fb9['values']()){_0x4fc046['sort']((_0x27bf65,_0x91aa96)=>(_0x27bf65[_0x479293(0x264)]||0x0)-(_0x91aa96['versionNumber']||0x0));}return _0x3d9fb9;}export function collectFoldersToCreate(_0x93390e,_0xd2b50a){const _0x1a035f=a140_0x1bbbd8,_0xb6a569=new Set();for(const _0x2295d3 of _0x93390e){if(!_0x2295d3)continue;if(_0xd2b50a['has'](_0x2295d3))continue;const _0x2365f0=_0x2295d3[_0x1a035f(0x29f)]('/');let _0x7f9ba7='';for(const _0x2ecda8 of _0x2365f0){_0x7f9ba7=_0x7f9ba7?_0x7f9ba7+'/'+_0x2ecda8:_0x2ecda8,!_0xd2b50a[_0x1a035f(0x240)](_0x7f9ba7)&&_0xb6a569[_0x1a035f(0x241)](_0x7f9ba7);}}return _0xb6a569;}export function parseAndClassifyYamlFiles(_0x15a8be,_0x4f5b5a,_0x4b5111){const _0xeed0f2=a140_0x1bbbd8,_0x68d9ec=[],_0x619bfd=[];for(const _0x182d6f of _0x15a8be){const _0x36f8ce=a140_0x3cbe56[_0xeed0f2(0x1f3)](_0x4f5b5a,a140_0x3cbe56[_0xeed0f2(0x267)](_0x182d6f)),_0x3e3620=_0x36f8ce==='.'?'':_0x36f8ce,_0x4d100c=readFileSync(_0x182d6f,'utf-8'),_0x39ed4a=a140_0x45ca55[_0xeed0f2(0x20f)](_0x4d100c);if(isJourneyDef(_0x39ed4a)){const _0x256440=a140_0xcad34d(_0x4d100c);_0x619bfd['push']({'yamlConfig':_0x256440,'folderPath':_0x3e3620,'sourcePath':_0x182d6f});}else{if(!_0x4b5111?.['skipSegments']){const _0x3e4971=parseSegmentYamlFile(_0x4d100c),_0x256da7=normalizeChildSegmentYaml(_0x3e4971);_0x68d9ec['push']({'yamlConfig':_0x256da7,'folderPath':_0x3e3620,'sourcePath':_0x182d6f});}}}return{'segments':_0x68d9ec,'journeys':_0x619bfd};}export function validateParsedFiles(_0x459d08,_0x17e63b){const _0x4832ea=a140_0x1bbbd8,_0x162171=[];for(const {yamlConfig:_0x4e68dd,sourcePath:_0x2773b0}of _0x459d08[_0x4832ea(0x1df)]){const _0x3151c2=readFileSync(_0x2773b0,'utf-8'),_0x237fee=a140_0x45ca55['parseDocument'](_0x3151c2),_0x43afaf=validateSegmentDef(_0x4e68dd,{'source':_0x3151c2,'document':_0x237fee},{'skipSchema':!![]});if(!_0x43afaf[_0x4832ea(0x1d1)]){const _0x2d9496=a140_0x3cbe56[_0x4832ea(0x1f3)](_0x17e63b,_0x2773b0);_0x162171[_0x4832ea(0x2d0)]({'filePath':_0x2d9496,'source':_0x3151c2,'result':_0x43afaf,'isJourney':![]});}}for(const {yamlConfig:_0x4e8488,sourcePath:_0x444e2f}of _0x459d08[_0x4832ea(0x2b8)]){const _0x57004b=readFileSync(_0x444e2f,_0x4832ea(0x234)),_0x3585ba=a140_0x45ca55[_0x4832ea(0x24f)](_0x57004b),_0x5635ee=validateJourneyDef(_0x4e8488,{'source':_0x57004b,'document':_0x3585ba},{'skipSchema':!![]});if(!_0x5635ee['valid']){const _0x24d35e=a140_0x3cbe56['relative'](_0x17e63b,_0x444e2f);_0x162171[_0x4832ea(0x2d0)]({'filePath':_0x24d35e,'source':_0x57004b,'result':_0x5635ee,'isJourney':!![]});}}return _0x162171;}export function formatValidationErrors(_0x120a9b){const _0x1838d7=a140_0x1bbbd8,_0x42b130=[];for(const {filePath:_0x18d961,source:_0x1ec987,result:_0x40c6bc,isJourney:_0x1df3f9}of _0x120a9b){const _0xec5ef5=_0x1df3f9?_0x1838d7(0x226):'segment';_0x42b130[_0x1838d7(0x2d0)]('\x0a'+_0x18d961+'\x20('+_0xec5ef5+'):\x20'+_0x40c6bc['errors'][_0x1838d7(0x2ab)]+_0x1838d7(0x26d)),_0x42b130[_0x1838d7(0x2d0)](formatValidationResult(_0x40c6bc,_0x1ec987,_0x18d961));}return _0x42b130[_0x1838d7(0x295)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x36a635){const _0x36ea00=a140_0x1bbbd8,_0x795039=new Set(),_0x3de310=new Map(),_0x400f56=collectSegmentUsageCounts(_0x36a635);if(_0x36a635[_0x36ea00(0x1df)])for(const [_0x348321,_0x42ced9]of Object[_0x36ea00(0x229)](_0x36a635[_0x36ea00(0x1df)])){_0x795039[_0x36ea00(0x241)](_0x348321);if(_0x42ced9[_0x36ea00(0x217)]){const _0x2d429b=yamlRuleToApi(_0x42ced9[_0x36ea00(0x217)]),_0x59ec91=apiRuleToYaml(_0x2d429b);_0x3de310[_0x36ea00(0x1ff)](_0x348321,_0x59ec91);}}const _0x2ebfe1=new Map();let _0xc20a23=0x0;for(const [_0x50ca45,_0x3d5f47]of _0x3de310){const _0x42fc59=serializeExpandedRule(_0x3d5f47,_0x3de310),_0x4334a7=_0x2ebfe1['get'](_0x42fc59)||[];_0x4334a7[_0x36ea00(0x2d0)]({'name':_0x50ca45,'index':_0xc20a23}),_0x2ebfe1['set'](_0x42fc59,_0x4334a7),_0xc20a23++;}const _0x467cd8=new Map();for(const [_0x2c2161,_0x183492]of _0x2ebfe1){const _0x4a3983=_0x183492[_0x36ea00(0x29e)]()[_0x36ea00(0x2ce)]((_0x15601a,_0x5bac55)=>{const _0x1c2b51=_0x36ea00,_0xb7b418=_0x400f56[_0x1c2b51(0x22f)](_0x15601a['name'])||0x0,_0x1bba9f=_0x400f56['get'](_0x5bac55[_0x1c2b51(0x25d)])||0x0;if(_0xb7b418!==_0x1bba9f)return _0x1bba9f-_0xb7b418;return _0x15601a[_0x1c2b51(0x1f1)]-_0x5bac55[_0x1c2b51(0x1f1)];})[_0x36ea00(0x2bc)](_0x23daa6=>_0x23daa6[_0x36ea00(0x25d)]),_0x5316d1=[];for(const _0x1c8540 of _0x4a3983){const _0x2963d4=_0x400f56[_0x36ea00(0x22f)](_0x1c8540)||0x0,_0x15fd52=Math[_0x36ea00(0x1f9)](_0x2963d4,0x1);for(let _0xb57f5=0x0;_0xb57f5<_0x15fd52;_0xb57f5++){_0x5316d1['push'](_0x1c8540);}}_0x467cd8[_0x36ea00(0x1ff)](_0x2c2161,_0x5316d1);}return{'existingLocalSegmentNames':_0x795039,'localSegmentRules':_0x3de310,'localExpandedRuleToNames':_0x467cd8};}export function createSegmentIdResolver(_0x1cc8a0,_0x3e75ab){return async _0x2af139=>{const _0x163a54=a140_0xf1db,_0x3a9f26=_0x1cc8a0[_0x163a54(0x22f)](_0x2af139);if(!_0x3a9f26)throw new SDKError(ErrorCode[_0x163a54(0x23f)],_0x163a54(0x247)+_0x2af139+_0x163a54(0x284)+_0x3e75ab+'\x27)');return _0x3a9f26;};}export function extractRootFolderId(_0x17e059){const _0x1a2a52=a140_0x1bbbd8;return _0x17e059['relationships']?.['parentSegmentFolder']?.[_0x1a2a52(0x1dd)]?.['id']||_0x17e059['relationships']?.['parentFolder']?.[_0x1a2a52(0x1dd)]?.['id'];}export function buildConnectionMaps(_0x5ae523){const _0x1eb3fa=a140_0x1bbbd8,_0x53e3d8=new Map(),_0x2307da=new Map(),_0x425d40=new Map();for(const _0x48229b of _0x5ae523){_0x53e3d8[_0x1eb3fa(0x1ff)](_0x48229b[_0x1eb3fa(0x25d)],parseInt(_0x48229b['id'],0xa)),_0x2307da[_0x1eb3fa(0x1ff)](_0x48229b['id'],_0x48229b[_0x1eb3fa(0x25d)]),_0x425d40[_0x1eb3fa(0x1ff)](_0x48229b[_0x1eb3fa(0x25d)],_0x48229b[_0x1eb3fa(0x29a)]);}return{'nameToId':_0x53e3d8,'idToName':_0x2307da,'nameToType':_0x425d40};}export function calculatePushStats(_0x2fcc7d,_0x2c8569,_0x35d047,_0x42e169,_0x2b1ec1,_0x329087,_0x24764a){const _0x3af1ce=a140_0x1bbbd8,_0x16a6a9=_0x2fcc7d['filter'](_0xd1d7f4=>_0xd1d7f4[_0x3af1ce(0x237)]),_0x1a0bcc=_0x2fcc7d[_0x3af1ce(0x1d7)](_0x3b060e=>!_0x3b060e[_0x3af1ce(0x237)]&&_0x3b060e[_0x3af1ce(0x2cc)]),_0x223d0d=_0x2fcc7d[_0x3af1ce(0x1d7)](_0x2c04e6=>!_0x2c04e6[_0x3af1ce(0x237)]&&!_0x2c04e6['hasChanges']),_0x38b3fe=_0x329087?_0x42e169:[],_0x2ed5d3=_0x2c8569['filter'](_0x4e41bb=>_0x4e41bb[_0x3af1ce(0x237)]),_0xd888cc=_0x2c8569[_0x3af1ce(0x1d7)](_0x3d4ee7=>!_0x3d4ee7[_0x3af1ce(0x237)]&&_0x3d4ee7['hasChanges']),_0x47d74f=_0x2c8569[_0x3af1ce(0x1d7)](_0x327103=>!_0x327103['isNew']&&!_0x327103[_0x3af1ce(0x2cc)]),_0x49433a=_0x329087?_0x2b1ec1:[],_0x3b8779=_0x2fcc7d[_0x3af1ce(0x203)](_0x25aade=>_0x25aade['activationActions']),_0xe5831b=_0x3b8779['filter'](_0x3a0fe9=>_0x3a0fe9[_0x3af1ce(0x29a)]===_0x3af1ce(0x218)),_0x3da134=_0x3b8779[_0x3af1ce(0x1d7)](_0x17b745=>_0x17b745[_0x3af1ce(0x29a)]===_0x3af1ce(0x1f5)),_0x35d052=_0x3b8779[_0x3af1ce(0x1d7)](_0x1bef3e=>_0x1bef3e[_0x3af1ce(0x29a)]===_0x3af1ce(0x27b)),_0x3085d1=Array['from'](_0x35d047)[_0x3af1ce(0x2ce)](),_0x1af4f5=_0x24764a?![]:_0x16a6a9['length']>0x0||_0x1a0bcc[_0x3af1ce(0x2ab)]>0x0||_0x38b3fe[_0x3af1ce(0x2ab)]>0x0,_0x370fdf=_0x2ed5d3[_0x3af1ce(0x2ab)]>0x0||_0xd888cc[_0x3af1ce(0x2ab)]>0x0||_0x49433a[_0x3af1ce(0x2ab)]>0x0,_0x3d4af6=_0x24764a?![]:_0x3b8779[_0x3af1ce(0x2ab)]>0x0,_0x2fa621=_0x3085d1[_0x3af1ce(0x2ab)]>0x0;return{'segments':{'new':_0x16a6a9,'changed':_0x1a0bcc,'unchanged':_0x223d0d,'toDelete':_0x38b3fe},'journeys':{'new':_0x2ed5d3,'changed':_0xd888cc,'unchanged':_0x47d74f,'toDelete':_0x49433a},'activations':{'all':_0x3b8779,'toCreate':_0xe5831b,'toUpdate':_0x3da134,'toDelete':_0x35d052},'folders':{'toCreate':_0x3085d1},'counts':{'segments':{'new':_0x16a6a9[_0x3af1ce(0x2ab)],'changed':_0x1a0bcc[_0x3af1ce(0x2ab)],'unchanged':_0x223d0d['length'],'toDelete':_0x38b3fe['length']},'journeys':{'new':_0x2ed5d3[_0x3af1ce(0x2ab)],'changed':_0xd888cc[_0x3af1ce(0x2ab)],'unchanged':_0x47d74f['length'],'toDelete':_0x49433a[_0x3af1ce(0x2ab)]},'activations':{'create':_0xe5831b[_0x3af1ce(0x2ab)],'update':_0x3da134[_0x3af1ce(0x2ab)],'delete':_0x35d052[_0x3af1ce(0x2ab)]},'folders':_0x3085d1[_0x3af1ce(0x2ab)]},'hasChanges':_0x1af4f5||_0x370fdf||_0x3d4af6||_0x2fa621};}export async function buildPushExecutionContext(_0x359330,_0x239105,_0x364d3f,_0xb1311c,_0x2b1cd9,_0x25d27b){const _0x541397=a140_0x1bbbd8,_0x275d3e=extractRootFolderId(_0x364d3f),{pathToId:_0x1b3992,idToPath:_0x214bb6}=buildFolderMaps(_0x2b1cd9),_0x241565=buildSegmentNameToIdMap(_0xb1311c),_0x13827f=new Map(),{batchAsync:_0x3fddbc}=await import(_0x541397(0x1fa)),[_0x4ec6b0,_0x4de603]=await Promise[_0x541397(0x27f)]([_0x359330[_0x541397(0x1d9)][_0x541397(0x2b0)](),_0x359330[_0x541397(0x2a9)]['list'](),((async()=>{const _0x5a3e1a=_0x541397;!_0x25d27b&&_0xb1311c[_0x5a3e1a(0x2ab)]>0x0&&await _0x3fddbc(_0xb1311c,async _0x8690e1=>{const _0x76e636=await _0x359330['segment']['listActivations'](_0x239105,_0x8690e1['id']);_0x13827f['set'](_0x8690e1['id'],_0x76e636);});})())]),{emailToId:_0x2f0b41,idToEmail:_0x247e48}=_0x4ec6b0,_0x36a4ab=buildConnectionMaps(_0x4de603);return{'rootFolderId':_0x275d3e,'folderPathToId':_0x1b3992,'folderIdToPath':_0x214bb6,'segmentNameToId':_0x241565,'activationsBySegmentId':_0x13827f,'emailToIdMap':_0x2f0b41,'idToEmailMap':_0x247e48,'connectionNameToIdMap':_0x36a4ab[_0x541397(0x1f7)],'connectionIdToNameMap':_0x36a4ab[_0x541397(0x200)],'connectionNameToTypeMap':_0x36a4ab[_0x541397(0x22d)]};}export function createPushYamlContextForBundle(_0x2dd83b,_0x225dc,_0x292a49,_0x5e6cd9,_0x2e8799,_0x1bd3b3,_0x45ccd5,_0x30a335){const {existingLocalSegmentNames:_0x28567f,localExpandedRuleToNames:_0x4dc2f4}=_0x5e6cd9,_0x27d2bd=new Set(),_0x535842=new Map(),_0x4f8d78=new Map(),_0x1356ce=new Map(),_0x46d5e3=createJumpTargetCache(),_0x14ad6b=new Map(),_0xbfaf03=new Map(),_0x555ed2=new Set();let _0x4be5bc;const _0x36b0b5=_0x5bf07f=>{const _0x153c16={'resolveSegment':async _0x3936ed=>{const _0x4e01ea=a140_0xf1db,_0xef0396=_0x1356ce['get'](_0x3936ed);if(_0xef0396!==undefined)return{'name':_0xef0396,'isJourneyLocal':!![]};try{const _0x3a8a78=await fetchSegment(_0x2dd83b,_0x225dc,_0x3936ed,_0x292a49);if(!_0x3a8a78)throw new Error('Segment\x20not\x20found');const _0x1c6622=generateJourneyLocalName(_0x3a8a78[_0x4e01ea(0x25d)]),_0x369c12=_0x3a8a78[_0x4e01ea(0x21b)]===SEGMENT_KIND_JOURNEY&&_0x1c6622!==undefined;let _0x3b193b=_0x3a8a78['name'],_0x285774;if(_0x369c12&&_0x3a8a78[_0x4e01ea(0x217)]){const _0x3470d9=apiRuleToYaml(_0x3a8a78[_0x4e01ea(0x217)]);_0xbfaf03['set'](_0x3936ed,_0x3470d9);const _0x69b57d=async _0x8d3064=>{const _0x2736b7=_0x4e01ea,_0x878158=collectSegmentRefsFromRule(_0x8d3064);for(const _0x3fced1 of _0x878158){if(!_0xbfaf03['has'](_0x3fced1))try{const _0x1d9656=await fetchSegment(_0x2dd83b,_0x225dc,_0x3fced1,_0x292a49);if(_0x1d9656?.['rule']){const _0x48eeb1=apiRuleToYaml(_0x1d9656[_0x2736b7(0x217)]);_0xbfaf03[_0x2736b7(0x1ff)](_0x3fced1,_0x48eeb1),await _0x69b57d(_0x48eeb1);}}catch(_0x38064b){logger[_0x2736b7(0x2a0)](_0x2736b7(0x2d1)+_0x3fced1+':\x20'+_0x38064b);}}};await _0x69b57d(_0x3470d9);const _0x526d50=serializeExpandedRule(_0x3470d9,_0xbfaf03),_0x352a3b=_0x4dc2f4[_0x4e01ea(0x22f)](_0x526d50);if(_0x352a3b&&_0x352a3b['length']>0x0){const _0x4cb5a0=_0x535842['get'](_0x526d50)||0x0,_0x116769=_0x352a3b[_0x4cb5a0]||_0x352a3b[_0x352a3b[_0x4e01ea(0x2ab)]-0x1];_0x535842[_0x4e01ea(0x1ff)](_0x526d50,_0x4cb5a0+0x1),_0x3b193b=_0x116769,_0x27d2bd[_0x4e01ea(0x241)](_0x3b193b),_0x1356ce[_0x4e01ea(0x1ff)](_0x3936ed,_0x3b193b);const _0x15f7a5=await resolveRuleSegmentRefs(_0x3470d9,async _0x4c3b5e=>{const _0x244dae=_0x4e01ea,_0x4de1f8=_0x1356ce['get'](_0x4c3b5e);if(_0x4de1f8)return _0x4de1f8;const _0x2153b9=await _0x4be5bc[_0x244dae(0x1e6)](_0x4c3b5e);return _0x2153b9[_0x244dae(0x25d)];});_0x285774={'description':_0x3a8a78[_0x4e01ea(0x251)],'rule':_0x15f7a5};}else{const _0xc05d10=_0x14ad6b[_0x4e01ea(0x22f)](_0x526d50);if(_0xc05d10)_0x3b193b=_0xc05d10,_0x1356ce[_0x4e01ea(0x1ff)](_0x3936ed,_0x3b193b);else{if(_0x1c6622){let _0x6c2ed3=_0x1c6622,_0x374e35=0x2;while(_0x27d2bd[_0x4e01ea(0x240)](_0x6c2ed3)||_0x28567f[_0x4e01ea(0x240)](_0x6c2ed3)){_0x6c2ed3=_0x1c6622+'_'+_0x374e35,_0x374e35++;}_0x27d2bd[_0x4e01ea(0x241)](_0x6c2ed3),_0x3b193b=_0x6c2ed3;}_0x1356ce[_0x4e01ea(0x1ff)](_0x3936ed,_0x3b193b),_0x14ad6b[_0x4e01ea(0x1ff)](_0x526d50,_0x3b193b);const _0x4dffff=await resolveRuleSegmentRefs(_0x3470d9,async _0xac445e=>{const _0x42fb1e=_0x4e01ea,_0x4f8b97=_0x1356ce[_0x42fb1e(0x22f)](_0xac445e);if(_0x4f8b97)return _0x4f8b97;const _0x40f0d1=await _0x4be5bc[_0x42fb1e(0x1e6)](_0xac445e);return _0x40f0d1[_0x42fb1e(0x25d)];});_0x285774={'description':_0x3a8a78[_0x4e01ea(0x251)],'rule':_0x4dffff};}}}return{'name':_0x3b193b,'isJourneyLocal':_0x369c12,'definition':_0x285774};}catch(_0xe56cbc){return logger[_0x4e01ea(0x2a0)](_0x4e01ea(0x213)+_0x3936ed+':\x20'+_0xe56cbc),{'name':_0x3936ed,'isJourneyLocal':![]};}},'resolveActivation':async _0x594514=>{const _0x3d73cb=a140_0xf1db,_0x1b43f8=_0x4f8d78[_0x3d73cb(0x22f)](_0x594514);if(_0x1b43f8!==undefined)return{'name':_0x1b43f8,'isJourneyLocal':!![]};try{let _0x36ae1c=_0x45ccd5?.[_0x3d73cb(0x22f)](_0x594514);!_0x36ae1c&&(_0x36ae1c=await _0x2dd83b[_0x3d73cb(0x226)][_0x3d73cb(0x29c)](_0x5bf07f,_0x594514));const _0x51b391=_0x36ae1c['attributes'][_0x3d73cb(0x269)]['name']||_0x594514,_0x52716b=sanitizeYamlKey(_0x51b391)||'activation_'+_0x594514,_0x296111=_0x52716b;_0x4f8d78[_0x3d73cb(0x1ff)](_0x594514,_0x296111);const _0x20565f=journeyActivationStepToYaml(_0x36ae1c,_0x2e8799,_0x1bd3b3);return{'name':_0x296111,'isJourneyLocal':!![],'definition':_0x20565f};}catch(_0x255e86){return logger[_0x3d73cb(0x2a0)](_0x3d73cb(0x286)+_0x594514+':\x20'+_0x255e86),{'name':_0x594514,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5a227c,_0x402a0a)=>resolveJumpTarget(_0x5a227c,_0x402a0a,_0x46d5e3,async _0x1fa066=>{const _0x469c00=a140_0xf1db,_0x2a9b10=_0x30a335?.[_0x469c00(0x22f)](_0x1fa066);if(_0x2a9b10)return _0x2a9b10;return _0x2dd83b[_0x469c00(0x226)][_0x469c00(0x26e)](_0x1fa066);})};return _0x4be5bc=_0x153c16,_0x153c16;},_0x5ca0dc=async _0x2474e2=>{const _0x198c58=a140_0xf1db,{collectSegmentIdsFromJourneyApi:_0x517638}=await import(_0x198c58(0x28c)),{batchAsync:_0x40fa20}=await import(_0x198c58(0x1fa)),_0x369ce9=new Set();for(const _0x5e29a3 of _0x2474e2){let _0x32a058=_0x30a335?.[_0x198c58(0x22f)](_0x5e29a3);!_0x32a058&&(_0x32a058=await _0x2dd83b['journey'][_0x198c58(0x26e)](_0x5e29a3));const _0x2b973f=_0x517638(_0x32a058);for(const _0x57e1e6 of _0x2b973f){_0x369ce9[_0x198c58(0x241)](_0x57e1e6);}}let _0x51218e=Array[_0x198c58(0x2c6)](_0x369ce9);while(_0x51218e[_0x198c58(0x2ab)]>0x0){const _0x4af95e=_0x51218e[_0x198c58(0x1d7)](_0x465f97=>!_0x555ed2['has'](_0x465f97));if(_0x4af95e[_0x198c58(0x2ab)]===0x0)break;const _0x7821dd=await _0x40fa20(_0x4af95e,async _0x1e5611=>{const _0x1e9383=_0x198c58;_0x555ed2[_0x1e9383(0x241)](_0x1e5611);const _0xf1db5e=await fetchSegment(_0x2dd83b,_0x225dc,_0x1e5611,_0x292a49);if(!_0xf1db5e)return null;return{'segmentId':_0x1e5611,'segment':_0xf1db5e};},0xa),_0x2c0b57=new Set();for(const _0x5e61a7 of _0x7821dd){if(!_0x5e61a7?.[_0x198c58(0x2b6)]?.[_0x198c58(0x217)])continue;const _0x5a3ce3=apiRuleToYaml(_0x5e61a7['segment'][_0x198c58(0x217)]);_0xbfaf03[_0x198c58(0x1ff)](_0x5e61a7[_0x198c58(0x1f2)],_0x5a3ce3);const _0x2dd99f=collectSegmentRefsFromRule(_0x5a3ce3);for(const _0x35f7a4 of _0x2dd99f){!_0x555ed2[_0x198c58(0x240)](_0x35f7a4)&&_0x2c0b57['add'](_0x35f7a4);}}_0x51218e=Array['from'](_0x2c0b57);}};return{'createYamlContext':_0x36b0b5,'prefetchJourneySegments':_0x5ca0dc};}export async function executePushSegments(_0x27e822,_0x184948,_0x49ed02,_0x1ef4ab,_0x37394c){const _0x4be7cb=a140_0x1bbbd8,{segmentDefToCreateRequest:_0x5be997,segmentDefToUpdateRequest:_0x38b8e6}=await import(_0x4be7cb(0x297)),_0x9aa2fb=_0x49ed02['folderPathToId'],_0xbb628d=0x5,_0x333e02=async _0x2cfe01=>{const _0x2cf34e=_0x4be7cb,_0x4dfc32=_0x2cfe01['folderPath']?_0x9aa2fb[_0x2cf34e(0x22f)](_0x2cfe01[_0x2cf34e(0x28b)]):undefined;let _0x2ee60c;const _0x3dca96={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x151f62=_0x2cfe01[_0x2cf34e(0x244)];if(_0x2cfe01[_0x2cf34e(0x244)]['rule']){const _0x545c7a=createSegmentIdResolver(_0x49ed02[_0x2cf34e(0x252)],_0x2cfe01[_0x2cf34e(0x244)]['name']),_0xba4238=await resolveRuleSegmentIds(_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x217)],_0x545c7a);_0x151f62={..._0x2cfe01[_0x2cf34e(0x244)],'rule':_0xba4238};}try{if(_0x2cfe01[_0x2cf34e(0x237)]){_0x37394c[_0x2cf34e(0x2b9)]?.({'type':_0x2cf34e(0x23b),'name':_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]});const _0x385cb1=_0x5be997(_0x151f62,_0x4dfc32),_0x5d1137=await _0x37394c[_0x2cf34e(0x256)](_0x2cf34e(0x23d)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+_0x2cf34e(0x2d3),()=>_0x27e822['segment']['createSegment'](_0x1ef4ab['parentId'],_0x385cb1));_0x2ee60c=_0x5d1137['data']['id'],_0x49ed02['segmentNameToId'][_0x2cf34e(0x1ff)](_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)],_0x2ee60c),_0x3dca96[_0x2cf34e(0x2a3)]={'name':_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)],'id':_0x2ee60c},_0x37394c[_0x2cf34e(0x2b9)]?.({'type':_0x2cf34e(0x215),'name':_0x2cfe01['yamlConfig'][_0x2cf34e(0x25d)],'segmentId':_0x2ee60c}),_0x37394c[_0x2cf34e(0x27e)]?.('Created\x20segment\x20\x27'+_0x2cfe01['yamlConfig']['name']+'\x27'),_0x3dca96[_0x2cf34e(0x27c)]=0x1;}else{if(_0x2cfe01['hasChanges']){_0x37394c[_0x2cf34e(0x2b9)]?.({'type':_0x2cf34e(0x1e9),'name':_0x2cfe01['yamlConfig']['name']});const _0x4ab524=_0x38b8e6(_0x151f62);_0x4dfc32!==_0x2cfe01[_0x2cf34e(0x1d8)]?.[_0x2cf34e(0x210)]&&(_0x4ab524[_0x2cf34e(0x210)]=_0x4dfc32?parseInt(_0x4dfc32,0xa):undefined),await _0x37394c[_0x2cf34e(0x256)](_0x2cf34e(0x1e0)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+'\x27...',()=>_0x27e822[_0x2cf34e(0x2b6)]['updateSegmentById'](_0x1ef4ab[_0x2cf34e(0x26b)],_0x2cfe01[_0x2cf34e(0x1d8)]['id'],_0x4ab524)),_0x2ee60c=_0x2cfe01[_0x2cf34e(0x1d8)]['id'],_0x37394c['onProgress']?.({'type':_0x2cf34e(0x1de),'name':_0x2cfe01[_0x2cf34e(0x244)]['name']}),_0x37394c[_0x2cf34e(0x27e)]?.(_0x2cf34e(0x2a6)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+'\x27'),_0x3dca96[_0x2cf34e(0x2b7)]=0x1;}else _0x2ee60c=_0x2cfe01['existingSegment']['id'];}}catch(_0x11742e){const _0x3908ef=isHttp400Error(_0x11742e),_0x35d6e6=_0x3908ef?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x39bc3d=getErrorMessage(_0x11742e);throw new SDKError(_0x35d6e6,_0x2cf34e(0x25c)+(_0x2cfe01[_0x2cf34e(0x237)]?'create':_0x2cf34e(0x1f5))+_0x2cf34e(0x231)+_0x2cfe01[_0x2cf34e(0x28a)]+_0x2cf34e(0x26c)+_0x39bc3d,_0x11742e);}try{const _0x668e48=await syncActivationsForSegment(_0x27e822,_0x1ef4ab[_0x2cf34e(0x26b)],_0x2ee60c,_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)],_0x2cfe01['activationActions'],_0x37394c,_0x2cfe01[_0x2cf34e(0x28a)]);_0x3dca96[_0x2cf34e(0x2c9)]=_0x668e48;}catch(_0x38f779){if(_0x38f779 instanceof SDKError)throw _0x38f779;throw new SDKError(ErrorCode[_0x2cf34e(0x232)],_0x2cf34e(0x28f)+_0x2cfe01[_0x2cf34e(0x244)][_0x2cf34e(0x25d)]+'\x27\x20from\x20file:\x20'+_0x2cfe01['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x38f779),_0x38f779);}return _0x3dca96;},_0x1e81cb=await batchAsync(_0x184948,_0x333e02,_0xbb628d),_0x22c1e2={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2efd15 of _0x1e81cb){_0x22c1e2['created']+=_0x2efd15['created'],_0x22c1e2['updated']+=_0x2efd15[_0x4be7cb(0x2b7)],_0x2efd15['createdSegmentId']&&_0x22c1e2[_0x4be7cb(0x1fc)][_0x4be7cb(0x1ff)](_0x2efd15[_0x4be7cb(0x2a3)]['name'],_0x2efd15[_0x4be7cb(0x2a3)]['id']),_0x22c1e2[_0x4be7cb(0x2c9)][_0x4be7cb(0x27c)]+=_0x2efd15[_0x4be7cb(0x2c9)]['created'],_0x22c1e2[_0x4be7cb(0x2c9)][_0x4be7cb(0x2b7)]+=_0x2efd15[_0x4be7cb(0x2c9)][_0x4be7cb(0x2b7)],_0x22c1e2[_0x4be7cb(0x2c9)][_0x4be7cb(0x21e)]+=_0x2efd15[_0x4be7cb(0x2c9)][_0x4be7cb(0x21e)];}return _0x22c1e2;}async function syncActivationsForSegment(_0x22fe7f,_0x2ab97e,_0x1fd993,_0x342b09,_0x2613e7,_0x50655b,_0x21827e){const _0x275c87=a140_0x1bbbd8,_0x14ec5a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x53d66d of _0x2613e7){try{if(_0x53d66d[_0x275c87(0x29a)]===_0x275c87(0x218)&&_0x53d66d[_0x275c87(0x2c5)])_0x50655b[_0x275c87(0x2b9)]?.({'type':'activation_creating','segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),await _0x50655b[_0x275c87(0x256)](_0x275c87(0x220)+_0x53d66d['name']+_0x275c87(0x2d3),()=>_0x22fe7f[_0x275c87(0x2b6)]['createActivation'](_0x2ab97e,_0x1fd993,_0x53d66d[_0x275c87(0x2c5)])),_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x22c),'segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),_0x50655b[_0x275c87(0x27e)]?.(_0x275c87(0x28d)+_0x53d66d['name']+'\x27'),_0x14ec5a[_0x275c87(0x27c)]++;else{if(_0x53d66d['type']===_0x275c87(0x1f5)&&_0x53d66d[_0x275c87(0x2c5)]&&_0x53d66d[_0x275c87(0x2ad)])_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x230),'segmentName':_0x342b09,'activationName':_0x53d66d['name']}),await _0x50655b['withProgress'](_0x275c87(0x22a)+_0x53d66d[_0x275c87(0x25d)]+_0x275c87(0x2d3),()=>_0x22fe7f[_0x275c87(0x2b6)][_0x275c87(0x204)](_0x2ab97e,_0x1fd993,_0x53d66d[_0x275c87(0x2ad)]['id'],_0x53d66d[_0x275c87(0x2c5)])),_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x27d),'segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),_0x50655b[_0x275c87(0x27e)]?.(_0x275c87(0x24c)+_0x53d66d[_0x275c87(0x25d)]+'\x27'),_0x14ec5a['updated']++;else _0x53d66d[_0x275c87(0x29a)]===_0x275c87(0x27b)&&_0x53d66d['existingActivation']&&(_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x20b),'segmentName':_0x342b09,'activationName':_0x53d66d['name']}),await _0x50655b[_0x275c87(0x256)](_0x275c87(0x298)+_0x53d66d['name']+_0x275c87(0x2d3),()=>_0x22fe7f[_0x275c87(0x2b6)][_0x275c87(0x24b)](_0x2ab97e,_0x1fd993,_0x53d66d[_0x275c87(0x2ad)]['id'])),_0x50655b[_0x275c87(0x2b9)]?.({'type':_0x275c87(0x277),'segmentName':_0x342b09,'activationName':_0x53d66d[_0x275c87(0x25d)]}),_0x50655b[_0x275c87(0x239)]?.('Deleted\x20activation\x20\x27'+_0x53d66d['name']+'\x27'),_0x14ec5a[_0x275c87(0x21e)]++);}}catch(_0x28b855){const _0x39ddf8=isHttp400Error(_0x28b855),_0x30a498=_0x39ddf8?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x275c87(0x232)],_0x1ba433=getErrorMessage(_0x28b855);throw new SDKError(_0x30a498,_0x275c87(0x25c)+_0x53d66d[_0x275c87(0x29a)]+_0x275c87(0x2c7)+_0x53d66d['name']+_0x275c87(0x20e)+_0x21827e+_0x275c87(0x26c)+_0x1ba433,_0x28b855);}}return _0x14ec5a;}export async function executePushFolders(_0x30b714,_0x5d8a4e,_0x328d7b,_0x376f18,_0x329691){const _0x4dce3b=a140_0x1bbbd8,_0x495e80=new Map(_0x328d7b),_0x3dbb2e=sortFoldersByDepth(_0x5d8a4e);for(const _0x249e58 of _0x3dbb2e){const _0x172e87=_0x249e58['split']('/'),_0x58bb02=_0x172e87[_0x172e87[_0x4dce3b(0x2ab)]-0x1],_0x2fd338=_0x172e87[_0x4dce3b(0x29e)](0x0,-0x1)['join']('/'),_0x411243=_0x495e80[_0x4dce3b(0x22f)](_0x2fd338);_0x329691[_0x4dce3b(0x2b9)]?.({'type':_0x4dce3b(0x268),'folder':_0x249e58});const _0x3c8ef5={'name':_0x58bb02,'parentFolderId':_0x411243},_0x50d546=await _0x329691['withProgress'](_0x4dce3b(0x1da)+_0x249e58+'\x27...',()=>_0x30b714['segment'][_0x4dce3b(0x21d)](_0x376f18[_0x4dce3b(0x26b)],_0x3c8ef5));_0x495e80[_0x4dce3b(0x1ff)](_0x249e58,_0x50d546[_0x4dce3b(0x1dd)]['id']),_0x329691['onProgress']?.({'type':'folder_created','folder':_0x249e58,'folderId':_0x50d546[_0x4dce3b(0x1dd)]['id']}),_0x329691[_0x4dce3b(0x2c3)]?.(_0x4dce3b(0x2cf)+_0x249e58+'\x27');}return _0x495e80;}function a140_0xf1db(_0x5c3c91,_0x45ef78){_0x5c3c91=_0x5c3c91-0x1cf;const _0x168c33=a140_0x168c();let _0xf1db88=_0x168c33[_0x5c3c91];return _0xf1db88;}export async function executePushSegmentDeletions(_0x2a394f,_0x251349,_0x230f7a){const _0x1deafd=a140_0x1bbbd8;if(_0x251349['length']===0x0)return 0x0;const {batchAsync:_0x27ac2b}=await import(_0x1deafd(0x1fa)),_0x465c73=0x5,_0x54ca83=await _0x27ac2b(_0x251349,async _0x252a42=>{const _0x4f3096=_0x1deafd;return _0x230f7a[_0x4f3096(0x2b9)]?.({'type':_0x4f3096(0x242),'name':_0x252a42[_0x4f3096(0x25d)]}),await _0x2a394f[_0x4f3096(0x2b6)][_0x4f3096(0x1e4)](_0x252a42['id']),_0x230f7a['onProgress']?.({'type':_0x4f3096(0x23c),'name':_0x252a42[_0x4f3096(0x25d)]}),_0x230f7a[_0x4f3096(0x239)]?.(_0x4f3096(0x2a7)+_0x252a42[_0x4f3096(0x25d)]+'\x27'),0x1;},_0x465c73);return _0x54ca83[_0x1deafd(0x26a)]((_0x36d3a1,_0x4f14b7)=>_0x36d3a1+_0x4f14b7,0x0);}export async function executePushJourneys(_0x404b0c,_0x39a6c5,_0x265670,_0x52aa3b,_0x5985cb){const _0x1afead=a140_0x1bbbd8,{journeyDefToRequest:_0x173c4e}=await import(_0x1afead(0x28c)),{activationDefToCreateRequest:_0x3ae558,yamlRuleToApi:_0x1debc5,validateSegmentRule:_0xc406b}=await import(_0x1afead(0x297)),_0x5c1336={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x8b0ac5=new Map(_0x265670[_0x1afead(0x252)]),_0x464237=0x5;for(let _0x2bbf61=0x0;_0x2bbf61<_0x39a6c5[_0x1afead(0x2ab)];_0x2bbf61+=_0x464237){const _0x58be47=_0x39a6c5[_0x1afead(0x29e)](_0x2bbf61,_0x2bbf61+_0x464237),_0x48f040=await Promise[_0x1afead(0x27f)](_0x58be47[_0x1afead(0x2bc)](async _0x3bb235=>{const _0x462a3a=_0x1afead;if(!_0x3bb235[_0x462a3a(0x237)]&&!_0x3bb235[_0x462a3a(0x2cc)])return{'action':'unchanged','name':_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)],'journeyId':_0x3bb235[_0x462a3a(0x254)]?.['id']};const _0x458aae=_0x3bb235[_0x462a3a(0x28b)]?_0x265670[_0x462a3a(0x2b3)]['get'](_0x3bb235[_0x462a3a(0x28b)]):undefined;_0x5985cb[_0x462a3a(0x2b9)]?.({'type':_0x3bb235[_0x462a3a(0x237)]?'journey_creating':_0x462a3a(0x263),'name':_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]});try{const _0x2cc0a1=await executeSingleJourneyPush(_0x404b0c,_0x3bb235,{..._0x265670,'segmentNameToId':_0x8b0ac5},{'parentId':_0x52aa3b['parentId'],'rootFolderId':_0x52aa3b[_0x462a3a(0x2d4)],'folderId':_0x458aae,'verbose':_0x52aa3b['verbose']},_0x5985cb,{'journeyDefToRequest':_0x173c4e,'activationDefToCreateRequest':_0x3ae558,'yamlRuleToApi':_0x1debc5,'validateSegmentRule':_0xc406b});for(const [_0x1841f8,_0x269010]of _0x2cc0a1[_0x462a3a(0x278)]){_0x8b0ac5[_0x462a3a(0x1ff)](_0x1841f8,_0x269010),_0x5c1336['embeddedSegmentNameToId']['set'](_0x1841f8,_0x269010);}if(_0x2cc0a1['action']===_0x462a3a(0x27c))_0x5985cb[_0x462a3a(0x2b9)]?.({'type':_0x462a3a(0x25a),'name':_0x3bb235['yamlConfig'][_0x462a3a(0x25d)],'journeyId':_0x2cc0a1[_0x462a3a(0x1f8)]}),_0x5985cb[_0x462a3a(0x27e)]?.(_0x462a3a(0x1ed)+_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]+'\x27'),_0x5c1336[_0x462a3a(0x27c)]++;else _0x2cc0a1[_0x462a3a(0x2cb)]===_0x462a3a(0x2b7)&&(_0x5985cb[_0x462a3a(0x2b9)]?.({'type':'journey_updated','name':_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]}),_0x5985cb[_0x462a3a(0x27e)]?.(_0x462a3a(0x228)+_0x3bb235[_0x462a3a(0x244)][_0x462a3a(0x25d)]+'\x27'),_0x5c1336[_0x462a3a(0x2b7)]++);return{'action':_0x2cc0a1[_0x462a3a(0x2cb)],'name':_0x3bb235[_0x462a3a(0x244)]['name'],'journeyId':_0x2cc0a1[_0x462a3a(0x1f8)]};}catch(_0x228e44){const _0x2e212b=isHttp400Error(_0x228e44),_0x2cc750=_0x2e212b?ErrorCode[_0x462a3a(0x253)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x1da824=getErrorMessage(_0x228e44);throw new SDKError(_0x2cc750,_0x462a3a(0x25c)+(_0x3bb235[_0x462a3a(0x237)]?_0x462a3a(0x218):_0x462a3a(0x1f5))+_0x462a3a(0x2d2)+_0x3bb235[_0x462a3a(0x28a)]+_0x462a3a(0x26c)+_0x1da824,_0x228e44);}}));_0x5c1336[_0x1afead(0x243)][_0x1afead(0x2d0)](..._0x48f040);}return _0x5c1336;}async function matchExistingJourneySegments(_0x15a79b,_0x182509,_0x3634f7,_0x38d96d,_0x4b5d1f){const _0x5943ce=a140_0x1bbbd8;if(!_0x182509['existingJourney']||!_0x182509[_0x5943ce(0x244)][_0x5943ce(0x1df)])return;const _0x117ad3=new Map(),_0x2f0acc=new Set();for(const _0x548743 of Object['keys'](_0x182509[_0x5943ce(0x244)]['segments'])){const _0x1085a3=generateDeterministicJourneySegmentName(_0x182509['yamlConfig'][_0x5943ce(0x25d)],_0x548743);_0x117ad3[_0x5943ce(0x1ff)](_0x1085a3,_0x548743),_0x2f0acc[_0x5943ce(0x241)](_0x548743);}const _0x5bda4e=[],_0x2d0122=collectSegmentIdsFromJourneyApi(_0x182509[_0x5943ce(0x254)]);for(const _0xd613ab of _0x2d0122){const _0x22c05a=await fetchSegment(_0x15a79b,_0x3634f7,_0xd613ab,_0x38d96d);if(!_0x22c05a?.['name'])continue;const _0x4837ac=_0x117ad3['get'](_0x22c05a[_0x5943ce(0x25d)]);_0x4837ac?(_0x4b5d1f[_0x5943ce(0x1ff)](_0x4837ac,_0xd613ab),_0x2f0acc[_0x5943ce(0x27b)](_0x4837ac)):_0x5bda4e[_0x5943ce(0x2d0)]({'id':_0xd613ab,'seg':_0x22c05a});}if(_0x2f0acc['size']>0x0&&_0x5bda4e[_0x5943ce(0x2ab)]>0x0){const {localExpandedRuleToNames:_0x3c1d64}=buildLocalExpandedRuleMappings(_0x182509['yamlConfig']),_0x2de985=new Map();for(const {id:_0x4441c5,seg:_0x19b970}of _0x5bda4e){if(_0x19b970[_0x5943ce(0x217)]){const _0x46ab54=apiRuleToYaml(_0x19b970[_0x5943ce(0x217)]);_0x2de985['set'](_0x4441c5,_0x46ab54);}}for(const {id:_0x4c4e46,seg:_0x2a7d16}of _0x5bda4e){if(!_0x2a7d16[_0x5943ce(0x217)])continue;const _0x437423=_0x2de985[_0x5943ce(0x22f)](_0x4c4e46);if(!_0x437423)continue;const _0x37ef10=serializeExpandedRule(_0x437423,_0x2de985),_0x1f6618=_0x3c1d64[_0x5943ce(0x22f)](_0x37ef10);if(_0x1f6618){const _0x2ad0c1=_0x1f6618['find'](_0x21f9f6=>_0x2f0acc[_0x5943ce(0x240)](_0x21f9f6));_0x2ad0c1&&(_0x4b5d1f['set'](_0x2ad0c1,_0x4c4e46),_0x2f0acc['delete'](_0x2ad0c1),logger[_0x5943ce(0x2a0)]('Matched\x20server\x20segment\x20\x27'+_0x2a7d16[_0x5943ce(0x25d)]+_0x5943ce(0x207)+_0x2ad0c1+_0x5943ce(0x271)));}}}}async function executeSingleJourneyPush(_0x429f84,_0x36cdcf,_0x279613,_0x3bfa88,_0x2dcbf4,_0x55a916){const _0x4b0ebc=a140_0x1bbbd8,{journeyDefToRequest:_0x32e268,activationDefToCreateRequest:_0x29d677,yamlRuleToApi:_0x41502d,validateSegmentRule:_0x552214}=_0x55a916,_0x3fe16d=new Map(),_0x2a61ba=new Map();recoverSegmentIdsFromPushRecovery(_0x36cdcf,_0x3fe16d,_0x279613[_0x4b0ebc(0x252)]);const _0x575052=new Map(),_0x575268=new Map(),_0x45b158=new Map();let _0x91b795;const _0x1332d6=async()=>{const _0x15dcbb=_0x4b0ebc;if(_0x91b795)return;_0x91b795=new Map();if(!_0x36cdcf['existingJourney'])return;const _0x1400c5=await _0x429f84[_0x15dcbb(0x226)][_0x15dcbb(0x283)](_0x36cdcf['existingJourney']['id']);for(const _0x2052d0 of _0x1400c5){const _0x275d90=journeyActivationStepToYaml(_0x2052d0,_0x279613[_0x15dcbb(0x29d)],_0x279613[_0x15dcbb(0x282)]),_0x191d76=activationSignature(_0x275d90);!_0x91b795[_0x15dcbb(0x240)](_0x191d76)&&_0x91b795[_0x15dcbb(0x1ff)](_0x191d76,_0x2052d0['id']),_0x275d90['name']&&_0x2a61ba[_0x15dcbb(0x1ff)](_0x275d90[_0x15dcbb(0x25d)],_0x2052d0['id']);}};await matchExistingJourneySegments(_0x429f84,_0x36cdcf,_0x3bfa88['parentId'],_0x279613[_0x4b0ebc(0x222)],_0x279613['segmentNameToId']);const _0x403240={'resolveSegmentId':async _0x4d37d1=>{const _0x5dc30b=_0x4b0ebc,_0x572367=_0x279613['segmentNameToId'][_0x5dc30b(0x22f)](_0x4d37d1);if(!_0x572367)throw new SDKError(ErrorCode[_0x5dc30b(0x23f)],'Segment\x20not\x20found:\x20'+_0x4d37d1+_0x5dc30b(0x266)+_0x36cdcf[_0x5dc30b(0x244)][_0x5dc30b(0x25d)]+')');return _0x572367;},'resolveEmbeddedSegmentId':async(_0x58f32f,_0x553854)=>{const _0x1010a0=_0x4b0ebc,_0x47e9b4=_0x279613[_0x1010a0(0x252)]['get'](_0x58f32f);if(_0x47e9b4)return _0x47e9b4;const _0xb6c6b6=_0x279613['existingSegments'][_0x1010a0(0x274)](_0x497b72=>_0x497b72[_0x1010a0(0x25d)]===_0x58f32f);if(_0xb6c6b6)return _0x279613['segmentNameToId']['set'](_0x58f32f,_0xb6c6b6['id']),_0xb6c6b6['id'];if(_0x36cdcf[_0x1010a0(0x237)]){const {stageName:_0x51e389,criteriaName:_0x3f1c9e}=findSegmentCriteriaLocation(_0x36cdcf[_0x1010a0(0x244)],_0x58f32f);return _0x552214(_0x58f32f,_0x553854[_0x1010a0(0x217)]),_0x575268[_0x1010a0(0x1ff)](_0x58f32f,{'definition':_0x553854,'stageName':_0x51e389,'criteriaName':_0x3f1c9e}),createPendingSegmentId(_0x58f32f);}const _0x2d0cf1=_0x36cdcf[_0x1010a0(0x254)]?.['id'];if(!_0x2d0cf1)throw new SDKError(ErrorCode[_0x1010a0(0x21f)],_0x1010a0(0x238));const _0x46e3ff=_0x575052[_0x1010a0(0x22f)](_0x58f32f);if(_0x46e3ff)return _0x46e3ff;const _0x382d79=((async()=>{const _0x1a0478=_0x1010a0;_0x552214(_0x58f32f,_0x553854[_0x1a0478(0x217)]);const _0x2c31b3=generateDeterministicJourneySegmentName(_0x36cdcf['yamlConfig'][_0x1a0478(0x25d)],_0x58f32f),_0x5d5c3a=_0x279613[_0x1a0478(0x222)]['find'](_0x3cab40=>_0x3cab40['name']===_0x2c31b3),_0x89891f=createSegmentIdResolver(_0x279613[_0x1a0478(0x252)],_0x58f32f),_0x208736=await resolveRuleSegmentIds(_0x553854['rule'],_0x89891f);let _0x1dbcc0;return _0x5d5c3a?(await _0x429f84['segment'][_0x1a0478(0x1ef)](_0x3bfa88['parentId'],_0x5d5c3a['id'],{'description':_0x553854[_0x1a0478(0x251)]||'Entry\x20criteria:\x20'+_0x58f32f,'rule':_0x41502d(_0x208736,!![]),'countPopulation':!![]}),_0x1dbcc0=_0x5d5c3a['id'],saveSegmentToPushRecovery(_0x36cdcf[_0x1a0478(0x28a)],_0x36cdcf[_0x1a0478(0x244)][_0x1a0478(0x25d)],_0x58f32f,{'segmentId':_0x1dbcc0,'uniqueServerName':_0x2c31b3,'createdAt':new Date()['toISOString']()})):_0x1dbcc0=await createOrRecoverEmbeddedSegment(_0x429f84,_0x36cdcf,{'localName':_0x58f32f,'uniqueSegmentName':_0x2c31b3,'description':_0x553854[_0x1a0478(0x251)]||'Entry\x20criteria:\x20'+_0x58f32f,'journeyId':_0x2d0cf1,'resolvedRule':_0x208736,'parentId':_0x3bfa88[_0x1a0478(0x26b)],'folderId':_0x3bfa88[_0x1a0478(0x2d4)]||''},_0x41502d),_0x279613['segmentNameToId']['set'](_0x58f32f,_0x1dbcc0),_0x3fe16d[_0x1a0478(0x1ff)](_0x58f32f,_0x1dbcc0),_0x1dbcc0;})());_0x575052[_0x1010a0(0x1ff)](_0x58f32f,_0x382d79);try{return await _0x382d79;}finally{_0x575052[_0x1010a0(0x27b)](_0x58f32f);}},'resolveActivationId':async _0x482632=>{const _0x3d0918=_0x4b0ebc,_0x4b9d98=_0x2a61ba[_0x3d0918(0x22f)](_0x482632);if(_0x4b9d98)return _0x4b9d98;if(_0x36cdcf[_0x3d0918(0x254)]){await _0x1332d6();const _0x1bc59b=_0x2a61ba[_0x3d0918(0x22f)](_0x482632);if(_0x1bc59b)return _0x1bc59b;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x482632+_0x3d0918(0x266)+_0x36cdcf[_0x3d0918(0x244)]['name']+').\x20'+_0x3d0918(0x1fd));},'resolveEmbeddedActivationId':async(_0x15be4a,_0x1e9d78)=>{const _0x3d38eb=_0x4b0ebc,_0x1af22b=_0x2a61ba[_0x3d38eb(0x22f)](_0x15be4a);if(_0x1af22b)return _0x1af22b;if(_0x36cdcf[_0x3d38eb(0x237)])return _0x45b158[_0x3d38eb(0x1ff)](_0x15be4a,_0x1e9d78),createPendingActivationId(_0x15be4a);if(_0x36cdcf['existingJourney']){await _0x1332d6();const _0x255fbb=_0x2a61ba[_0x3d38eb(0x22f)](_0x1e9d78[_0x3d38eb(0x25d)]);if(_0x255fbb)return _0x2a61ba['set'](_0x15be4a,_0x255fbb),_0x255fbb;const _0x3a3a72=activationSignature(_0x1e9d78),_0xaa4a33=_0x91b795?.[_0x3d38eb(0x22f)](_0x3a3a72);if(_0xaa4a33)return _0x2a61ba[_0x3d38eb(0x1ff)](_0x15be4a,_0xaa4a33),_0xaa4a33;const _0x4ce1d3=await _0x29d677(_0x1e9d78,_0x279613[_0x3d38eb(0x248)]),_0x1e0b7d={..._0x4ce1d3,..._0x1e9d78['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x1e9d78[_0x3d38eb(0x2aa)]}},_0x3aa251=await _0x429f84[_0x3d38eb(0x226)][_0x3d38eb(0x1e8)](_0x36cdcf[_0x3d38eb(0x254)]['id'],_0x1e0b7d);return _0x2a61ba[_0x3d38eb(0x1ff)](_0x15be4a,_0x3aa251['id']),_0x3aa251['id'];}throw new SDKError(ErrorCode[_0x3d38eb(0x21f)],_0x3d38eb(0x27a));},'resolveJourneyId':async _0x398666=>{const _0xc3f9bc=_0x4b0ebc;try{return await _0x429f84[_0xc3f9bc(0x226)]['resolveJourneyId'](_0x3bfa88[_0xc3f9bc(0x26b)],_0x398666);}catch(_0x23e4a7){throw new SDKError(ErrorCode[_0xc3f9bc(0x273)],_0xc3f9bc(0x221)+_0x398666+_0xc3f9bc(0x227)+_0x36cdcf[_0xc3f9bc(0x244)][_0xc3f9bc(0x25d)]+'\x27)',_0x23e4a7);}},'resolveStageId':async(_0x2fe658,_0x304490)=>{const _0x4b4818=_0x4b0ebc,_0x37a026=await _0x429f84[_0x4b4818(0x226)][_0x4b4818(0x26e)](_0x2fe658),_0xab04aa=_0x37a026['attributes']['journeyStages'][_0x4b4818(0x274)](_0x5f28ea=>_0x5f28ea['name'][_0x4b4818(0x262)]()===_0x304490[_0x4b4818(0x262)]());if(!_0xab04aa?.['id'])throw new SDKError(ErrorCode[_0x4b4818(0x273)],_0x4b4818(0x1dc)+_0x304490+_0x4b4818(0x233)+(_0x37a026[_0x4b4818(0x211)][_0x4b4818(0x2a1)]||_0x37a026[_0x4b4818(0x211)][_0x4b4818(0x25d)])+'\x27');return _0xab04aa['id'];}},_0x29d4ac=await _0x32e268(_0x36cdcf[_0x4b0ebc(0x244)],_0x3bfa88[_0x4b0ebc(0x26b)],_0x403240),_0x2e80e2=_0x3bfa88[_0x4b0ebc(0x1e1)]||_0x3bfa88['rootFolderId'];_0x2e80e2&&(_0x29d4ac[_0x4b0ebc(0x25b)]={'parentFolder':{'data':{'id':_0x2e80e2,'type':_0x4b0ebc(0x294)}}});if(_0x36cdcf[_0x4b0ebc(0x237)]){if(_0x575268['size']>0x0||_0x45b158[_0x4b0ebc(0x205)]>0x0)return await executeThreeStepJourneyCreate(_0x429f84,_0x36cdcf,_0x29d4ac,{'pendingEmbeddedSegments':_0x575268,'pendingEmbeddedActivations':_0x45b158,'embeddedSegmentNameToId':_0x3fe16d,'journeyActivationNameToId':_0x2a61ba},{..._0x3bfa88,'effectiveFolderId':_0x2e80e2},_0x279613,_0x2dcbf4,_0x55a916);else{ensureJourneyDefaults(_0x29d4ac['attributes']);const _0xcb7fbb=await _0x429f84[_0x4b0ebc(0x226)]['create'](_0x29d4ac);return deletePushRecovery(_0x36cdcf[_0x4b0ebc(0x28a)]),{'action':'created','journeyId':_0xcb7fbb['id'],'embeddedSegmentNameToId':_0x3fe16d};}}else{if(_0x36cdcf[_0x4b0ebc(0x2cc)]&&_0x36cdcf['existingJourney']){_0x29d4ac['id']=_0x36cdcf[_0x4b0ebc(0x254)]['id'];const _0x2ddb71=_0x29d4ac[_0x4b0ebc(0x211)];_0x36cdcf['existingJourney'][_0x4b0ebc(0x211)]?.[_0x4b0ebc(0x2a1)]&&(_0x2ddb71['journeyBundleName']=_0x36cdcf['existingJourney']['attributes'][_0x4b0ebc(0x2a1)]);const _0x51d99b=_0x36cdcf[_0x4b0ebc(0x254)]['attributes']?.['journeyStages'];return _0x51d99b&&_0x29d4ac[_0x4b0ebc(0x211)][_0x4b0ebc(0x2cd)]&&injectExistingStageIds(_0x29d4ac['attributes']['journeyStages'],_0x51d99b),ensureJourneyDefaults(_0x2ddb71),await _0x429f84[_0x4b0ebc(0x226)][_0x4b0ebc(0x1f5)](_0x36cdcf[_0x4b0ebc(0x254)]['id'],_0x29d4ac),deletePushRecovery(_0x36cdcf[_0x4b0ebc(0x28a)]),{'action':_0x4b0ebc(0x2b7),'journeyId':_0x36cdcf[_0x4b0ebc(0x254)]['id'],'embeddedSegmentNameToId':_0x3fe16d};}}return deletePushRecovery(_0x36cdcf[_0x4b0ebc(0x28a)]),{'action':_0x4b0ebc(0x201),'journeyId':_0x36cdcf[_0x4b0ebc(0x254)]?.['id'],'embeddedSegmentNameToId':_0x3fe16d};}function findSegmentCriteriaLocation(_0x21d5aa,_0xd5efb){const _0x49b5a9=a140_0x1bbbd8,_0x18da29=_0x21d5aa[_0x49b5a9(0x24e)]||_0x21d5aa[_0x49b5a9(0x2b8)]?.[0x0]?.['stages']||[];let _0x23223f=_0x49b5a9(0x293),_0x4c3e48=_0xd5efb;const _0x5f3d5f=_0x21d5aa[_0x49b5a9(0x2a5)]||_0x21d5aa[_0x49b5a9(0x2b8)]?.[0x0]?.['goal'];if(_0x5f3d5f?.[_0x49b5a9(0x2b6)]===_0xd5efb)return{'stageName':'goal','criteriaName':_0x5f3d5f[_0x49b5a9(0x25d)]||_0xd5efb};_0x596a45:for(const _0x222e5f of _0x18da29){if(_0x222e5f[_0x49b5a9(0x276)]?.[_0x49b5a9(0x2b6)]===_0xd5efb){_0x23223f=_0x222e5f[_0x49b5a9(0x25d)],_0x4c3e48=_0x222e5f[_0x49b5a9(0x276)][_0x49b5a9(0x25d)]||_0xd5efb;break;}if(_0x222e5f['steps'])for(const _0x115ede of _0x222e5f['steps']){if(_0x115ede[_0x49b5a9(0x29a)]===_0x49b5a9(0x281)&&_0x115ede[_0x49b5a9(0x1ea)]?.[_0x49b5a9(0x1db)])for(const _0x2d42e4 of _0x115ede[_0x49b5a9(0x1ea)][_0x49b5a9(0x1db)]){if(_0x2d42e4['segment']===_0xd5efb){_0x23223f=_0x222e5f[_0x49b5a9(0x25d)],_0x4c3e48=_0x2d42e4[_0x49b5a9(0x25d)]||_0xd5efb;break _0x596a45;}}}}return{'stageName':_0x23223f,'criteriaName':_0x4c3e48};}async function executeThreeStepJourneyCreate(_0x4249ea,_0x5a8dbb,_0x37af12,_0x595d59,_0x57ef3d,_0x571351,_0x3c305d,_0x13fdea){const _0x3c424e=a140_0x1bbbd8,{activationDefToCreateRequest:_0x525ebc,yamlRuleToApi:_0x27a7e5}=_0x13fdea,{pendingEmbeddedSegments:_0x53421d,pendingEmbeddedActivations:_0x2b8177,embeddedSegmentNameToId:_0x326307}=_0x595d59,_0x47080e=JSON['parse'](JSON[_0x3c424e(0x202)](_0x37af12));ensureJourneyDefaults(_0x47080e['attributes']),stripPendingIds(_0x47080e);const _0x5e46bb=await _0x4249ea[_0x3c424e(0x226)][_0x3c424e(0x218)](_0x47080e),_0x1dc6f5=_0x5e46bb['id'],_0x8a3a20=new Map();for(const _0x4a5e35 of _0x5e46bb['attributes'][_0x3c424e(0x2cd)]){_0x8a3a20['set'](_0x4a5e35[_0x3c424e(0x25d)][_0x3c424e(0x262)](),_0x4a5e35['id']);}recoverSegmentIdsFromPushRecovery(_0x5a8dbb,_0x326307,_0x571351[_0x3c424e(0x252)]);for(const [_0x35301a,{definition:_0x46a797}]of _0x53421d){if(_0x326307['has'](_0x35301a)){_0x3c305d[_0x3c424e(0x2b9)]?.({'type':_0x3c424e(0x208),'journeyName':_0x5a8dbb['yamlConfig']['name'],'segmentName':_0x35301a});continue;}const _0x1ee71c=generateDeterministicJourneySegmentName(_0x5a8dbb['yamlConfig'][_0x3c424e(0x25d)],_0x35301a);_0x3c305d['onProgress']?.({'type':_0x3c424e(0x2b4),'journeyName':_0x5a8dbb[_0x3c424e(0x244)]['name'],'segmentName':_0x35301a});const _0x3d6125=createSegmentIdResolver(_0x571351['segmentNameToId'],_0x35301a),_0x4db46e=await resolveRuleSegmentIds(_0x46a797['rule'],_0x3d6125),_0x203c21=await createOrRecoverEmbeddedSegment(_0x4249ea,_0x5a8dbb,{'localName':_0x35301a,'uniqueSegmentName':_0x1ee71c,'description':_0x46a797[_0x3c424e(0x251)]||'Entry\x20criteria:\x20'+_0x35301a,'journeyId':_0x1dc6f5,'resolvedRule':_0x4db46e,'parentId':_0x57ef3d['parentId'],'folderId':_0x57ef3d['effectiveFolderId']||''},_0x27a7e5);_0x326307[_0x3c424e(0x1ff)](_0x35301a,_0x203c21),_0x571351[_0x3c424e(0x252)][_0x3c424e(0x1ff)](_0x35301a,_0x203c21),_0x3c305d[_0x3c424e(0x2b9)]?.({'type':'embedded_segment_created','journeyName':_0x5a8dbb[_0x3c424e(0x244)][_0x3c424e(0x25d)],'segmentName':_0x35301a});}const _0x53964a=new Map();for(const [_0x191956,_0x26312f]of _0x2b8177){_0x3c305d['onProgress']?.({'type':_0x3c424e(0x25e),'journeyName':_0x5a8dbb[_0x3c424e(0x244)][_0x3c424e(0x25d)],'activationName':_0x191956});const _0x542863=await _0x525ebc(_0x26312f,_0x571351['activationContext']),_0x3ff372={..._0x542863,..._0x26312f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x26312f[_0x3c424e(0x2aa)]}},_0x476e94=await _0x4249ea[_0x3c424e(0x226)][_0x3c424e(0x1e8)](_0x1dc6f5,_0x3ff372);_0x53964a[_0x3c424e(0x1ff)](_0x191956,_0x476e94['id']),_0x595d59[_0x3c424e(0x20c)][_0x3c424e(0x1ff)](_0x191956,_0x476e94['id']),_0x3c305d['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x5a8dbb[_0x3c424e(0x244)][_0x3c424e(0x25d)],'activationName':_0x191956});}const _0x1fd057=JSON[_0x3c424e(0x20f)](JSON[_0x3c424e(0x202)](_0x37af12));return _0x1fd057['id']=_0x1dc6f5,ensureJourneyDefaults(_0x1fd057[_0x3c424e(0x211)]),resolvePendingIdsInRequest(_0x1fd057,_0x37af12,_0x8a3a20,_0x326307,_0x53964a,_0x3c305d),await _0x4249ea['journey'][_0x3c424e(0x1f5)](_0x1dc6f5,_0x1fd057),deletePushRecovery(_0x5a8dbb[_0x3c424e(0x28a)]),{'action':_0x3c424e(0x27c),'journeyId':_0x1dc6f5,'embeddedSegmentNameToId':_0x326307};}export function stripWaitStepPendingIds(_0x22d9f8){const _0x2dbe8e=a140_0x1bbbd8,_0xf1e333=_0x22d9f8[_0x2dbe8e(0x225)]&&isPendingSegmentId(_0x22d9f8[_0x2dbe8e(0x225)]),_0x48089d=_0x22d9f8[_0x2dbe8e(0x206)]?.[_0x2dbe8e(0x2d5)](_0x5c6b35=>_0x5c6b35[_0x2dbe8e(0x1f2)]&&isPendingSegmentId(_0x5c6b35[_0x2dbe8e(0x1f2)]));(_0xf1e333||_0x48089d)&&(_0x22d9f8[_0x2dbe8e(0x289)]=_0x2dbe8e(0x279),_0x22d9f8['waitStep']=0x1,_0x22d9f8['waitStepUnit']=_0x2dbe8e(0x2ba),delete _0x22d9f8['conditionSegmentId'],delete _0x22d9f8[_0x2dbe8e(0x23a)],delete _0x22d9f8['conditionTimeoutUnit'],delete _0x22d9f8['conditions']);}export function resolveWaitStepPendingIds(_0x55cfa8,_0x53a927,_0x407030,_0x41dc13){const _0x5b725b=a140_0x1bbbd8;if(_0x53a927[_0x5b725b(0x225)]&&isPendingSegmentId(_0x53a927['conditionSegmentId'])){const _0x43ccf5=_0x407030(_0x53a927[_0x5b725b(0x225)],_0x5b725b(0x255)+_0x41dc13+'\x27\x20wait\x20condition');_0x43ccf5&&(_0x55cfa8[_0x5b725b(0x289)]='Condition',_0x55cfa8[_0x5b725b(0x225)]=_0x43ccf5,delete _0x55cfa8[_0x5b725b(0x1e7)],delete _0x55cfa8[_0x5b725b(0x2b2)],_0x53a927[_0x5b725b(0x23a)]!==undefined&&(_0x55cfa8['conditionTimeoutDuration']=_0x53a927[_0x5b725b(0x23a)]),_0x53a927[_0x5b725b(0x258)]&&(_0x55cfa8['conditionTimeoutUnit']=_0x53a927[_0x5b725b(0x258)]));}if(_0x53a927[_0x5b725b(0x206)]){const _0x2caede=_0x53a927['conditions'][_0x5b725b(0x2d5)](_0x4f77ee=>_0x4f77ee[_0x5b725b(0x1f2)]&&isPendingSegmentId(_0x4f77ee[_0x5b725b(0x1f2)]));if(_0x2caede){const _0x1af247=_0x53a927[_0x5b725b(0x206)]['map'](_0x27fa9f=>{const _0x43eba4=_0x5b725b;if(_0x27fa9f[_0x43eba4(0x1f2)]&&isPendingSegmentId(_0x27fa9f[_0x43eba4(0x1f2)])){const _0x383dec=_0x407030(_0x27fa9f[_0x43eba4(0x1f2)],_0x43eba4(0x255)+_0x41dc13+_0x43eba4(0x2c0));return{..._0x27fa9f,'segmentId':_0x383dec||_0x27fa9f['segmentId']};}return{..._0x27fa9f};});_0x55cfa8[_0x5b725b(0x289)]=_0x5b725b(0x2ae),_0x55cfa8[_0x5b725b(0x206)]=_0x1af247,delete _0x55cfa8['waitStep'],delete _0x55cfa8[_0x5b725b(0x2b2)],delete _0x55cfa8['conditionSegmentId'],delete _0x55cfa8[_0x5b725b(0x23a)],delete _0x55cfa8['conditionTimeoutUnit'];}}}function stripPendingIds(_0x320ab3){const _0xc44e31=a140_0x1bbbd8;_0x320ab3[_0xc44e31(0x211)][_0xc44e31(0x2a5)]?.[_0xc44e31(0x1f2)]&&isPendingSegmentId(_0x320ab3[_0xc44e31(0x211)][_0xc44e31(0x2a5)]['segmentId'])&&delete _0x320ab3['attributes']['goal'];for(const _0x980eff of _0x320ab3['attributes']['journeyStages']||[]){_0x980eff[_0xc44e31(0x275)]?.[_0xc44e31(0x1f2)]&&isPendingSegmentId(_0x980eff[_0xc44e31(0x275)][_0xc44e31(0x1f2)])&&delete _0x980eff[_0xc44e31(0x275)];_0x980eff['milestone']?.[_0xc44e31(0x1f2)]&&isPendingSegmentId(_0x980eff[_0xc44e31(0x2c8)][_0xc44e31(0x1f2)])&&delete _0x980eff[_0xc44e31(0x2c8)];_0x980eff['exitCriterias']&&(_0x980eff[_0xc44e31(0x235)]=_0x980eff[_0xc44e31(0x235)]['filter'](_0x2b4baf=>!_0x2b4baf['segmentId']||!isPendingSegmentId(_0x2b4baf[_0xc44e31(0x1f2)])));if(_0x980eff[_0xc44e31(0x272)])for(const _0x565ed6 of Object['keys'](_0x980eff[_0xc44e31(0x272)])){const _0x376440=_0x980eff[_0xc44e31(0x272)][_0x565ed6];_0x376440[_0xc44e31(0x29a)]===_0xc44e31(0x219)&&_0x376440[_0xc44e31(0x2bf)]&&isPendingActivationId(_0x376440['journeyActivationStepId'])&&(_0x376440[_0xc44e31(0x2bf)]='');if(_0x376440[_0xc44e31(0x29a)]===_0xc44e31(0x292)&&_0x376440[_0xc44e31(0x1db)])for(const _0x175345 of _0x376440[_0xc44e31(0x1db)]){_0x175345['segmentId']&&isPendingSegmentId(_0x175345[_0xc44e31(0x1f2)])&&(_0x175345[_0xc44e31(0x1f2)]='');}_0x376440['type']==='WaitStep'&&stripWaitStepPendingIds(_0x376440);}}}function resolvePendingIdsInRequest(_0x1e786a,_0x43f6d9,_0x57997b,_0x526f9f,_0x3a8887,_0x48e421){const _0x273087=a140_0x1bbbd8,_0x43603d=(_0x3ad2ef,_0x2a10d7)=>{const _0x2ee5f6=a140_0xf1db;if(!isPendingSegmentId(_0x3ad2ef))return _0x3ad2ef;const _0x4469d0=extractPendingSegmentName(_0x3ad2ef),_0x250343=_0x526f9f[_0x2ee5f6(0x22f)](_0x4469d0);return!_0x250343&&_0x48e421['logWarning']?.(_0x2ee5f6(0x236)+_0x4469d0+_0x2ee5f6(0x1fb)+_0x2a10d7),_0x250343;};if(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)]?.[_0x273087(0x1f2)]&&isPendingSegmentId(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)][_0x273087(0x1f2)])){const _0x5cf8f1=_0x43603d(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)][_0x273087(0x1f2)],_0x273087(0x2c2));_0x5cf8f1&&(_0x1e786a[_0x273087(0x211)][_0x273087(0x2a5)][_0x273087(0x1f2)]=_0x5cf8f1);}for(const _0x2288bb of _0x1e786a['attributes'][_0x273087(0x2cd)]||[]){const _0x56756b=_0x57997b['get'](_0x2288bb[_0x273087(0x25d)][_0x273087(0x262)]());_0x56756b&&(_0x2288bb['id']=_0x56756b);if(_0x2288bb[_0x273087(0x275)]?.['segmentId']&&isPendingSegmentId(_0x2288bb[_0x273087(0x275)][_0x273087(0x1f2)])){const _0x334862=_0x43603d(_0x2288bb[_0x273087(0x275)][_0x273087(0x1f2)],_0x273087(0x255)+_0x2288bb['name']+_0x273087(0x1f0));_0x334862&&(_0x2288bb[_0x273087(0x275)][_0x273087(0x1f2)]=_0x334862);}if(_0x2288bb[_0x273087(0x235)])for(const _0x399b29 of _0x2288bb[_0x273087(0x235)]){if(_0x399b29['segmentId']&&isPendingSegmentId(_0x399b29[_0x273087(0x1f2)])){const _0x4b5b82=_0x43603d(_0x399b29[_0x273087(0x1f2)],_0x273087(0x255)+_0x2288bb[_0x273087(0x25d)]+'\x27\x20exit\x20criteria');_0x4b5b82&&(_0x399b29[_0x273087(0x1f2)]=_0x4b5b82);}}if(_0x2288bb[_0x273087(0x2c8)]?.[_0x273087(0x1f2)]&&isPendingSegmentId(_0x2288bb['milestone']['segmentId'])){const _0x53e47e=_0x43603d(_0x2288bb[_0x273087(0x2c8)][_0x273087(0x1f2)],'stage\x20\x27'+_0x2288bb[_0x273087(0x25d)]+_0x273087(0x1ec));_0x53e47e&&(_0x2288bb[_0x273087(0x2c8)][_0x273087(0x1f2)]=_0x53e47e);}if(_0x2288bb[_0x273087(0x272)]){const _0x3558ff=_0x27be1c=>_0x43f6d9[_0x273087(0x211)]['journeyStages']?.[_0x273087(0x274)](_0x171e2f=>_0x171e2f['name'][_0x273087(0x262)]()===_0x2288bb[_0x273087(0x25d)]['toLowerCase']())?.[_0x273087(0x272)]?.[_0x27be1c];for(const _0x3cf9cd of Object['keys'](_0x2288bb[_0x273087(0x272)])){const _0x2a5304=_0x2288bb[_0x273087(0x272)][_0x3cf9cd],_0x5b354a=_0x3558ff(_0x3cf9cd);if(_0x2a5304[_0x273087(0x29a)]===_0x273087(0x219)&&_0x2a5304[_0x273087(0x2bf)]&&(isPendingActivationId(_0x2a5304[_0x273087(0x2bf)])||_0x2a5304[_0x273087(0x2bf)]==='')){if(_0x5b354a?.[_0x273087(0x2bf)]&&isPendingActivationId(_0x5b354a[_0x273087(0x2bf)])){const _0x4b2e42=extractPendingActivationName(_0x5b354a['journeyActivationStepId']),_0x2afd1f=_0x3a8887[_0x273087(0x22f)](_0x4b2e42);_0x2afd1f&&(_0x2a5304[_0x273087(0x2bf)]=_0x2afd1f);}}if(_0x2a5304[_0x273087(0x29a)]===_0x273087(0x292)&&_0x2a5304[_0x273087(0x1db)]&&_0x5b354a?.[_0x273087(0x1db)])for(let _0x376c75=0x0;_0x376c75<_0x2a5304[_0x273087(0x1db)]['length'];_0x376c75++){const _0x5bc990=_0x2a5304[_0x273087(0x1db)][_0x376c75],_0x2a58f0=_0x5b354a[_0x273087(0x1db)][_0x376c75];if(_0x2a58f0?.[_0x273087(0x1f2)]&&isPendingSegmentId(_0x2a58f0[_0x273087(0x1f2)])){const _0x3164fc=_0x43603d(_0x2a58f0[_0x273087(0x1f2)],_0x273087(0x255)+_0x2288bb['name']+_0x273087(0x290)+(_0x5bc990['name']||_0x376c75)+'\x27');_0x3164fc&&(_0x5bc990[_0x273087(0x1f2)]=_0x3164fc);}}_0x2a5304[_0x273087(0x29a)]===_0x273087(0x249)&&_0x5b354a?.[_0x273087(0x29a)]===_0x273087(0x249)&&resolveWaitStepPendingIds(_0x2a5304,_0x5b354a,_0x43603d,_0x2288bb[_0x273087(0x25d)]);}}}}
|
|
1
|
+
const a140_0x2bcd56=a140_0x275f;(function(_0x1633c1,_0x1be4f3){const _0x3dbe66=a140_0x275f,_0xf416a2=_0x1633c1();while(!![]){try{const _0xe11502=parseInt(_0x3dbe66(0x21f))/0x1*(-parseInt(_0x3dbe66(0x223))/0x2)+parseInt(_0x3dbe66(0x16a))/0x3+parseInt(_0x3dbe66(0x14b))/0x4*(parseInt(_0x3dbe66(0x1c0))/0x5)+-parseInt(_0x3dbe66(0x171))/0x6+parseInt(_0x3dbe66(0x1f7))/0x7*(parseInt(_0x3dbe66(0x144))/0x8)+-parseInt(_0x3dbe66(0x1ee))/0x9*(parseInt(_0x3dbe66(0x19b))/0xa)+parseInt(_0x3dbe66(0x1a0))/0xb;if(_0xe11502===_0x1be4f3)break;else _0xf416a2['push'](_0xf416a2['shift']());}catch(_0x1b3131){_0xf416a2['push'](_0xf416a2['shift']());}}}(a140_0x4a99,0x61e66));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x2bcd56(0x179));export const PENDING_SEGMENT_PREFIX=a140_0x2bcd56(0x226);export const PENDING_ACTIVATION_PREFIX=a140_0x2bcd56(0x16b);export function createPendingSegmentId(_0x581d58){return''+PENDING_SEGMENT_PREFIX+_0x581d58+'__';}export function isPendingSegmentId(_0x14f772){const _0x48685b=a140_0x2bcd56;return _0x14f772[_0x48685b(0x145)](PENDING_SEGMENT_PREFIX)&&!_0x14f772[_0x48685b(0x145)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0xea3d4b){const _0x145fc8=a140_0x2bcd56;return _0xea3d4b[_0x145fc8(0x235)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x2325ae){return''+PENDING_ACTIVATION_PREFIX+_0x2325ae+'__';}export function isPendingActivationId(_0x407fa8){const _0xbc5d7c=a140_0x2bcd56;return _0x407fa8[_0xbc5d7c(0x145)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xe9d50){return _0xe9d50['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5c91b6,_0x577f64){const _0x335e15=a140_0x2bcd56,_0x2781d2=_0x5c91b6+'::'+(_0x577f64['trim']()||_0x335e15(0x169)),_0x32bead=createHash(_0x335e15(0x20a))[_0x335e15(0x1d5)](_0x2781d2)[_0x335e15(0x207)](_0x335e15(0x1f2))[_0x335e15(0x18c)](0x0,0xc);return _0x335e15(0x1ab)+_0x32bead;}export function ensureJourneyDefaults(_0x2189e0){const _0x455247=a140_0x2bcd56;!_0x2189e0[_0x455247(0x1ad)]&&(_0x2189e0[_0x455247(0x1ad)]=''),!_0x2189e0[_0x455247(0x150)]&&(_0x2189e0[_0x455247(0x150)]=_0x455247(0x13f));}export function injectExistingStageIds(_0x1ef27a,_0x1cffd6){const _0x126d7f=a140_0x2bcd56,_0x5859c5=new Map(_0x1cffd6[_0x126d7f(0x185)](_0x1e8ec3=>[_0x1e8ec3[_0x126d7f(0x141)],_0x1e8ec3['id']]));for(const _0xb1a958 of _0x1ef27a){if(!_0xb1a958['id']){const _0x4a1a54=_0x5859c5[_0x126d7f(0x195)](_0xb1a958[_0x126d7f(0x141)]);_0x4a1a54&&(_0xb1a958['id']=_0x4a1a54);}}}function a140_0x275f(_0x4165d6,_0x2d9359){_0x4165d6=_0x4165d6-0x13e;const _0x4a99fc=a140_0x4a99();let _0x275f8c=_0x4a99fc[_0x4165d6];return _0x275f8c;}export function resolveTDFolderPath(_0x15d5f6,_0x37f119,_0x26cbca){if(!_0x37f119)return _0x15d5f6;if(_0x15d5f6===_0x26cbca||_0x15d5f6['startsWith'](_0x26cbca+'/'))return _0x15d5f6;return _0x15d5f6?_0x26cbca+'/'+_0x15d5f6:_0x26cbca;}export function addFoldersToCreate(_0x2d6763,_0x55015c,_0x29a9c7){const _0x236869=a140_0x2bcd56;if(!_0x2d6763)return;if(_0x55015c[_0x236869(0x15b)](_0x2d6763))return;const _0x48a660=_0x2d6763[_0x236869(0x180)]('/');let _0x3b5825='';for(const _0xcb25d2 of _0x48a660){_0x3b5825=_0x3b5825?_0x3b5825+'/'+_0xcb25d2:_0xcb25d2,!_0x55015c[_0x236869(0x15b)](_0x3b5825)&&_0x29a9c7[_0x236869(0x192)](_0x3b5825);}}export function sortFoldersByDepth(_0x3724b1){const _0x52452e=a140_0x2bcd56;return[..._0x3724b1][_0x52452e(0x160)]((_0x6316c2,_0x1e0ac8)=>{const _0x1c8020=_0x52452e,_0x1cb1f7=(_0x6316c2[_0x1c8020(0x170)](/\//g)||[])[_0x1c8020(0x1eb)],_0x1d0ebc=(_0x1e0ac8[_0x1c8020(0x170)](/\//g)||[])['length'];return _0x1cb1f7-_0x1d0ebc;});}import*as a140_0x3404f8 from'yaml';import{readFileSync}from'fs';import a140_0x4533d9 from'path';import{isJourneyDef,parseYamlString as a140_0x388d86,toYamlString as a140_0x26ca9c,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(_0xe01c33){const _0x2ef001=a140_0x2bcd56;if(Array['isArray'](_0xe01c33))return'['+_0xe01c33[_0x2ef001(0x185)](_0x17513a=>stableStringify(_0x17513a))[_0x2ef001(0x15d)](',')+']';if(_0xe01c33&&typeof _0xe01c33===_0x2ef001(0x1da)){const _0x5c3ce0=_0xe01c33,_0x58e220=Object['keys'](_0x5c3ce0)['sort'](),_0x1b91b2=_0x58e220[_0x2ef001(0x185)](_0x555201=>'\x22'+_0x555201+'\x22:'+stableStringify(_0x5c3ce0[_0x555201]));return'{'+_0x1b91b2[_0x2ef001(0x15d)](',')+'}';}const _0x30f3e1=JSON[_0x2ef001(0x1f0)](_0xe01c33);return _0x30f3e1===undefined?_0x2ef001(0x1a4):_0x30f3e1;}function activationSignature(_0x5cb0d2){const _0x108b93=a140_0x2bcd56,_0x4be7b8={'connection':_0x5cb0d2[_0x108b93(0x1ea)],..._0x5cb0d2[_0x108b93(0x1d1)]!==undefined&&{'all_columns':_0x5cb0d2[_0x108b93(0x1d1)]},..._0x5cb0d2['columns']!==undefined&&{'columns':_0x5cb0d2['columns']},..._0x5cb0d2[_0x108b93(0x1a9)]!==undefined&&{'behavior':_0x5cb0d2[_0x108b93(0x1a9)]},..._0x5cb0d2['schedule']!==undefined&&{'schedule':_0x5cb0d2[_0x108b93(0x1ae)]},..._0x5cb0d2[_0x108b93(0x17c)]!==undefined&&{'notification':_0x5cb0d2['notification']},..._0x5cb0d2[_0x108b93(0x1cf)]!==undefined&&{'connector_config':_0x5cb0d2[_0x108b93(0x1cf)]},..._0x5cb0d2[_0x108b93(0x21a)]!==undefined&&{'activation_template_id':_0x5cb0d2['activation_template_id']}};return stableStringify(_0x4be7b8);}async function fetchSegment(_0x277cce,_0x50db1b,_0x361ccf,_0xa86aeb){const _0xd33ef4=a140_0x2bcd56,_0x5024d8=_0xa86aeb?.[_0xd33ef4(0x1f9)](_0x1e0ad7=>_0x1e0ad7['id']===_0x361ccf);if(_0x5024d8)return _0x5024d8;try{return await _0x277cce[_0xd33ef4(0x169)][_0xd33ef4(0x148)](_0x50db1b,_0x361ccf);}catch(_0x3254ca){logger['debug']('getSegment\x20failed\x20for\x20'+_0x361ccf+_0xd33ef4(0x1ff)+_0x3254ca);try{return await _0x277cce[_0xd33ef4(0x169)][_0xd33ef4(0x23a)](_0x361ccf);}catch(_0x36e2de){return logger['debug'](_0xd33ef4(0x18f)+_0x361ccf+':\x20'+_0x36e2de),null;}}}function recoverSegmentIdsFromPushRecovery(_0xbacbab,_0x142e16,_0x5e2843){const _0x46459e=a140_0x2bcd56,_0x220c76=readPushRecovery(_0xbacbab['absolutePath']);if(_0x220c76?.['journeyName']===_0xbacbab[_0x46459e(0x1b2)][_0x46459e(0x141)])for(const [_0x4700db,_0x27ccb9]of Object[_0x46459e(0x1b3)](_0x220c76[_0x46459e(0x188)])){const _0x4f6f37=generateDeterministicJourneySegmentName(_0xbacbab['yamlConfig'][_0x46459e(0x141)],_0x4700db);_0x27ccb9[_0x46459e(0x1c9)]===_0x4f6f37&&(_0x142e16[_0x46459e(0x19e)](_0x4700db,_0x27ccb9['segmentId']),_0x5e2843[_0x46459e(0x19e)](_0x4700db,_0x27ccb9[_0x46459e(0x149)]));}}async function createOrRecoverEmbeddedSegment(_0x5d803e,_0x4b44b0,_0x33f670,_0x1619a2){const _0x4082f5=a140_0x2bcd56;let _0x4adbf6;try{_0x4adbf6=await _0x5d803e[_0x4082f5(0x169)][_0x4082f5(0x22a)]({'name':_0x33f670[_0x4082f5(0x1e1)],'description':_0x33f670[_0x4082f5(0x1ad)],'journeyId':_0x33f670[_0x4082f5(0x1bf)],'rule':_0x1619a2(_0x33f670['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x33f670[_0x4082f5(0x229)],'audienceId':_0x33f670[_0x4082f5(0x200)]});}catch(_0x1409cd){const _0x403ffc=_0x1409cd instanceof Error&&_0x1409cd[_0x4082f5(0x21e)][_0x4082f5(0x14a)](_0x4082f5(0x1b0));if(_0x403ffc){const _0x1de811=readPushRecovery(_0x4b44b0[_0x4082f5(0x16c)]),_0x51f36a=_0x1de811?.[_0x4082f5(0x1aa)]===_0x4b44b0['yamlConfig'][_0x4082f5(0x141)]?_0x1de811[_0x4082f5(0x188)][_0x33f670[_0x4082f5(0x154)]]:undefined;if(_0x51f36a?.[_0x4082f5(0x1c9)]===_0x33f670[_0x4082f5(0x1e1)])await _0x5d803e[_0x4082f5(0x169)]['updateSegmentById'](_0x33f670[_0x4082f5(0x200)],_0x51f36a[_0x4082f5(0x149)],{'description':_0x33f670['description'],'rule':_0x1619a2(_0x33f670[_0x4082f5(0x17e)],!![]),'countPopulation':!![]}),_0x4adbf6=_0x51f36a[_0x4082f5(0x149)];else throw new SDKError(ErrorCode[_0x4082f5(0x1c6)],_0x4082f5(0x183)+_0x33f670['localName']+_0x4082f5(0x17f)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x4b44b0[_0x4082f5(0x16c)][_0x4082f5(0x235)](/([^/]+)$/,_0x4082f5(0x1fb))+')\x20')+_0x4082f5(0x146),_0x1409cd);}else throw _0x1409cd;}return saveSegmentToPushRecovery(_0x4b44b0[_0x4082f5(0x16c)],_0x4b44b0[_0x4082f5(0x1b2)][_0x4082f5(0x141)],_0x33f670[_0x4082f5(0x154)],{'segmentId':_0x4adbf6,'uniqueServerName':_0x33f670[_0x4082f5(0x1e1)],'createdAt':new Date()[_0x4082f5(0x174)]()}),_0x4adbf6;}export async function prepareSegmentFiles(_0x49fd55,_0xbb7c19,_0x41081b,_0x399437,_0x1e396d){const _0x5679e7=a140_0x2bcd56,{activationDefToCreateRequest:_0x30c16a}=await import('./child-segment-yaml.js'),_0x4777ba=[],_0x252e01=new Set();for(const {yamlConfig:_0x43f0ed,folderPath:_0x48b923,sourcePath:_0x4b549e}of _0x49fd55){const _0x421651=resolveTDFolderPath(_0x48b923,_0x399437,_0x1e396d),_0x33ba46=_0x421651+':'+_0x43f0ed[_0x5679e7(0x141)],_0x5e5b3b=_0xbb7c19[_0x5679e7(0x1c1)][_0x5679e7(0x195)](_0x33ba46),_0x331a9c=_0x5e5b3b?_0xbb7c19[_0x5679e7(0x23f)]['get'](_0x5e5b3b['id'])||[]:[];addFoldersToCreate(_0x421651,_0xbb7c19[_0x5679e7(0x23e)],_0x252e01);const _0x256a23=calculateActivationActions(_0x43f0ed[_0x5679e7(0x161)]||[],_0x331a9c,_0xbb7c19[_0x5679e7(0x18a)],_0xbb7c19[_0x5679e7(0x177)]);for(const _0x4d70fb of _0x256a23){(_0x4d70fb[_0x5679e7(0x20c)]===_0x5679e7(0x172)||_0x4d70fb['type']===_0x5679e7(0x1d5))&&_0x4d70fb[_0x5679e7(0x1a1)]&&(_0x4d70fb[_0x5679e7(0x157)]=await _0x30c16a(_0x4d70fb[_0x5679e7(0x1a1)],_0x41081b));}const _0x58ec34=calculateSegmentDiff(_0x43f0ed,_0x5e5b3b,_0x331a9c,_0xbb7c19[_0x5679e7(0x18a)],_0xbb7c19[_0x5679e7(0x177)]);_0x4777ba['push']({'relativePath':_0x43f0ed[_0x5679e7(0x141)],'absolutePath':_0x4b549e,'yamlConfig':_0x43f0ed,'folderPath':_0x421651,'existingSegment':_0x5e5b3b,'existingActivations':_0x331a9c,'isNew':_0x58ec34[_0x5679e7(0x1cd)],'hasChanges':_0x58ec34[_0x5679e7(0x21c)],'diff':_0x58ec34[_0x5679e7(0x204)],'activationActions':_0x256a23});}return{'segmentFiles':_0x4777ba,'foldersToCreate':_0x252e01};}export async function prepareJourneyFiles(_0x11d784,_0x7180df,_0x116eb3,_0x13c831){const _0xf131f5=a140_0x2bcd56,_0x127c9e=[],_0x10f437=new Set();for(const {yamlConfig:_0x54370b,folderPath:_0x430091,sourcePath:_0x31e868}of _0x11d784){const _0x2eda22=resolveTDFolderPath(_0x430091,_0x116eb3,_0x13c831),_0x14ffd8=_0x2eda22+':'+_0x54370b[_0xf131f5(0x141)],_0x5e278e=_0x7180df[_0xf131f5(0x142)][_0xf131f5(0x195)](_0x14ffd8);let _0x5d891c,_0x1a2bc4;if(_0x5e278e&&_0x5e278e['length']>0x0){const _0x574a97=buildLocalExpandedRuleMappings(_0x54370b),{createYamlContext:_0x1024f4,prefetchJourneySegments:_0x37b332}=createPushYamlContextForBundle(_0x7180df['deps'],_0x7180df[_0xf131f5(0x200)],_0x7180df[_0xf131f5(0x1b7)],_0x574a97,_0x7180df[_0xf131f5(0x18a)],_0x7180df[_0xf131f5(0x177)],_0x7180df['activationStepsById'],_0x7180df[_0xf131f5(0x193)]);await _0x37b332(_0x5e278e[_0xf131f5(0x185)](_0x3b31e2=>_0x3b31e2['id']));const _0x27f28a=await _0x7180df[_0xf131f5(0x230)][_0xf131f5(0x1f4)][_0xf131f5(0x1fa)](_0x5e278e[0x0][_0xf131f5(0x166)]),_0x23fd6d=hasMultipleVersions(_0x54370b),_0x4288c9=async _0x48f6c4=>{const _0xec63e=_0xf131f5,_0x284293=_0x7180df[_0xec63e(0x193)]?.[_0xec63e(0x195)](_0x48f6c4);if(_0x284293)return _0x284293;return _0x7180df['fetchJourney']({'journeyId':_0x48f6c4,'journeyName':_0x54370b[_0xec63e(0x141)],'isMultiVersion':_0x5e278e['length']>0x1});};if(_0x23fd6d&&_0x5e278e[_0xf131f5(0x1eb)]>0x1){const _0x52cc9c=[];for(const _0x27c4d6 of _0x5e278e){const _0xc594c=_0x27c4d6[_0xf131f5(0x1d7)]||0x1;_0x7180df[_0xf131f5(0x1a5)]?.[_0xf131f5(0x1d5)]('Fetching\x20'+_0x54370b['name']+'\x20v'+_0xc594c);const _0x13be23=await _0x4288c9(_0x27c4d6['id']),_0x3d34f5=_0x1024f4(_0x27c4d6['id']),_0x5e2779=await journeyResponseToDef(_0x13be23,_0x3d34f5);_0x52cc9c[_0xf131f5(0x19d)]({'item':_0x27c4d6,'yaml':_0x5e2779});}const _0xa08c61=buildLocalRuleToNameMappingFromJourney(_0x54370b);_0x1a2bc4=buildMergedJourneyDef(_0x52cc9c,_0xa08c61,_0x27f28a);const _0x2e1009=Math['max'](..._0x52cc9c[_0xf131f5(0x185)](_0x1c1133=>_0x1c1133[_0xf131f5(0x187)][_0xf131f5(0x1d7)]||0x0)),_0x4b914c=_0x5e278e[_0xf131f5(0x1f9)](_0x3a3e92=>(_0x3a3e92[_0xf131f5(0x1d7)]||0x0)===_0x2e1009);_0x4b914c&&(_0x7180df[_0xf131f5(0x1a5)]?.[_0xf131f5(0x1d5)](_0xf131f5(0x1ba)+_0x54370b[_0xf131f5(0x141)]+'\x20v'+_0x2e1009),_0x5d891c=await _0x4288c9(_0x4b914c['id']));}else{const _0x16aedd=_0x5e278e[_0x5e278e[_0xf131f5(0x1eb)]-0x1];_0x7180df[_0xf131f5(0x1a5)]?.[_0xf131f5(0x1d5)](_0xf131f5(0x1ba)+_0x54370b[_0xf131f5(0x141)]),_0x5d891c=await _0x4288c9(_0x16aedd['id']);const _0x4da8d2=_0x1024f4(_0x16aedd['id']),_0x1fe267=await journeyResponseToDef(_0x5d891c,_0x4da8d2),_0xb69451=buildLocalRuleToNameMappingFromJourney(_0x54370b);_0x1a2bc4=buildMergedJourneyDef([{'item':_0x16aedd,'yaml':_0x1fe267}],_0xb69451,_0x27f28a);}}addFoldersToCreate(_0x2eda22,_0x7180df[_0xf131f5(0x23e)],_0x10f437);const _0x2eb69a=calculateJourneyDiff(_0x54370b,_0x1a2bc4);_0x127c9e[_0xf131f5(0x19d)]({'relativePath':_0x54370b[_0xf131f5(0x141)],'absolutePath':_0x31e868,'yamlConfig':_0x54370b,'folderPath':_0x2eda22,'existingJourney':_0x5d891c,'isNew':_0x2eb69a['isNew'],'hasChanges':_0x2eb69a[_0xf131f5(0x21c)],'diff':_0x2eb69a[_0xf131f5(0x204)]});}return{'journeyFiles':_0x127c9e,'foldersToCreate':_0x10f437};}export function calculateActivationActions(_0x41952d,_0xb2d13f,_0x1b465b,_0x149f38){const _0x443068=a140_0x2bcd56,_0x231ea3=[],_0x41bd5d=new Map();for(const _0x75075b of _0xb2d13f){_0x41bd5d[_0x443068(0x19e)](_0x75075b[_0x443068(0x141)],_0x75075b);}const _0x5a69d9=new Map();for(const _0x179893 of _0x41952d){_0x5a69d9[_0x443068(0x19e)](_0x179893[_0x443068(0x141)],_0x179893);}for(const _0x422290 of _0x41952d){const _0x166491=_0x41bd5d[_0x443068(0x195)](_0x422290[_0x443068(0x141)]);if(!_0x166491)_0x231ea3[_0x443068(0x19d)]({'type':_0x443068(0x172),'name':_0x422290[_0x443068(0x141)],'yamlActivation':_0x422290});else{const _0x2d717f=activationResponseToDef(_0x166491,_0x1b465b,_0x149f38),_0x2e4802=a140_0x3404f8[_0x443068(0x1f0)](_0x2d717f),_0xb856a9=a140_0x3404f8[_0x443068(0x1f0)](_0x422290);_0x2e4802!==_0xb856a9&&_0x231ea3['push']({'type':_0x443068(0x1d5),'name':_0x422290[_0x443068(0x141)],'yamlActivation':_0x422290,'existingActivation':_0x166491});}}for(const _0x3301f2 of _0xb2d13f){!_0x5a69d9[_0x443068(0x15b)](_0x3301f2['name'])&&_0x231ea3['push']({'type':_0x443068(0x167),'name':_0x3301f2[_0x443068(0x141)],'existingActivation':_0x3301f2});}return _0x231ea3;}function calculateYamlDiff(_0x59127d,_0x46b1c9){if(_0x46b1c9){const _0x327a7a=generateDiff(_0x46b1c9,_0x59127d),_0x2a9901=hasChanges(_0x327a7a);return{'isNew':![],'hasChanges':_0x2a9901,'diff':_0x2a9901?formatDiffWithColors(_0x327a7a):undefined};}const _0x567e67=generateDiff('',_0x59127d);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x567e67)};}export function calculateSegmentDiff(_0x2fa4b8,_0x598e76,_0x4f0e09,_0x3819c0,_0x174611){const _0x1f570a=segmentToYamlString(_0x2fa4b8),_0xde3604=_0x598e76?segmentToYamlString(segmentWithActivationsToYaml(_0x598e76,_0x4f0e09,undefined,_0x3819c0,_0x174611)):undefined;return calculateYamlDiff(_0x1f570a,_0xde3604);}export function calculateJourneyDiff(_0x13436a,_0x2357cd){const _0x1091ad=normalizeJourneyDef(_0x13436a,_0x13436a),_0x50b266=a140_0x26ca9c(_0x1091ad),_0x3f1440=_0x2357cd?a140_0x26ca9c(normalizeJourneyDef(_0x2357cd,_0x13436a)):undefined;return calculateYamlDiff(_0x50b266,_0x3f1440);}export function findSegmentsToDelete(_0x2a82fc,_0x4356f6,_0x144671,_0x3e3293,_0x30178d){const _0x1079c3=a140_0x2bcd56,_0x29e219=new Set();for(const {yamlConfig:_0x1c4d84,folderPath:_0x34a4bf}of _0x4356f6){_0x29e219[_0x1079c3(0x192)](_0x34a4bf+':'+_0x1c4d84['name']);}return _0x2a82fc[_0x1079c3(0x238)](_0x42cecf=>{const _0x19954c=_0x1079c3,_0x3ac842=_0x42cecf[_0x19954c(0x210)]?_0x144671[_0x19954c(0x195)](_0x42cecf[_0x19954c(0x210)]['toString']())||'':'',_0x225c57=_0x3ac842+':'+_0x42cecf[_0x19954c(0x141)];if(_0x29e219[_0x19954c(0x15b)](_0x225c57))return![];if(_0x30178d)return _0x3ac842===_0x3e3293||_0x3ac842[_0x19954c(0x145)](_0x3e3293+'/');return!![];});}export function findJourneysToDelete(_0x5b2545,_0x28252f,_0x5c2fac,_0x2e704c,_0xff9cfb){const _0x2357ba=a140_0x2bcd56,_0x3615ab=new Set();for(const {yamlConfig:_0x5f3e52,folderPath:_0x4f8fdc}of _0x28252f){_0x3615ab[_0x2357ba(0x192)](_0x4f8fdc+':'+_0x5f3e52[_0x2357ba(0x141)]);}return _0x5b2545[_0x2357ba(0x238)](_0x285115=>{const _0x55622f=_0x2357ba,_0x993a88=_0x285115[_0x55622f(0x229)]?_0x5c2fac['get'](_0x285115[_0x55622f(0x229)])||'':'',_0x33b130=_0x993a88+':'+_0x285115[_0x55622f(0x220)];if(_0x3615ab[_0x55622f(0x15b)](_0x33b130))return![];if(_0xff9cfb)return _0x993a88===_0x2e704c||_0x993a88[_0x55622f(0x145)](_0x2e704c+'/');return!![];});}export function buildSegmentLookupMap(_0x489c6f,_0x47abe5){const _0x2223f3=a140_0x2bcd56,_0x5be2ff=new Map();for(const _0x5cbcbe of _0x489c6f){const _0x3e69da=_0x5cbcbe[_0x2223f3(0x210)]?_0x47abe5[_0x2223f3(0x195)](_0x5cbcbe['segmentFolderId'][_0x2223f3(0x1e9)]())||'':'',_0x186788=_0x3e69da+':'+_0x5cbcbe[_0x2223f3(0x141)];_0x5be2ff[_0x2223f3(0x19e)](_0x186788,_0x5cbcbe);}return _0x5be2ff;}export function buildSegmentNameToIdMap(_0x46123){const _0x463ec7=a140_0x2bcd56,_0x29e02e=new Map();for(const _0x5bc145 of _0x46123){_0x29e02e[_0x463ec7(0x19e)](_0x5bc145[_0x463ec7(0x141)],_0x5bc145['id']);}return _0x29e02e;}export function buildJourneyBundleLookupMap(_0xb52f89,_0x45c5f4){const _0x208672=a140_0x2bcd56,_0x18d68f=new Map();for(const _0x8192d6 of _0xb52f89){const _0x3c039e=_0x8192d6[_0x208672(0x229)]?_0x45c5f4[_0x208672(0x195)](_0x8192d6['folderId'])||'':'',_0x32bf5e=_0x3c039e+':'+_0x8192d6[_0x208672(0x220)];!_0x18d68f[_0x208672(0x15b)](_0x32bf5e)&&_0x18d68f[_0x208672(0x19e)](_0x32bf5e,[]),_0x18d68f['get'](_0x32bf5e)[_0x208672(0x19d)](_0x8192d6);}for(const _0x3fd53c of _0x18d68f[_0x208672(0x19c)]()){_0x3fd53c['sort']((_0x51c11,_0x21e57c)=>(_0x51c11[_0x208672(0x1d7)]||0x0)-(_0x21e57c['versionNumber']||0x0));}return _0x18d68f;}export function collectFoldersToCreate(_0x3be38a,_0x346e6f){const _0x3e894b=a140_0x2bcd56,_0x30a02a=new Set();for(const _0x3d41b6 of _0x3be38a){if(!_0x3d41b6)continue;if(_0x346e6f['has'](_0x3d41b6))continue;const _0x2d2e21=_0x3d41b6[_0x3e894b(0x180)]('/');let _0xf0b343='';for(const _0x40d62c of _0x2d2e21){_0xf0b343=_0xf0b343?_0xf0b343+'/'+_0x40d62c:_0x40d62c,!_0x346e6f['has'](_0xf0b343)&&_0x30a02a[_0x3e894b(0x192)](_0xf0b343);}}return _0x30a02a;}export function parseAndClassifyYamlFiles(_0x5557bd,_0x5a85f2,_0x3cbbd5){const _0x4c0fc7=a140_0x2bcd56,_0x18b67c=[],_0x66eefb=[];for(const _0x44c217 of _0x5557bd){const _0x56c9c0=a140_0x4533d9[_0x4c0fc7(0x152)](_0x5a85f2,a140_0x4533d9[_0x4c0fc7(0x214)](_0x44c217)),_0x2b8718=_0x56c9c0==='.'?'':_0x56c9c0,_0x30b59c=readFileSync(_0x44c217,_0x4c0fc7(0x1be)),_0x36950b=a140_0x3404f8[_0x4c0fc7(0x1ef)](_0x30b59c);if(isJourneyDef(_0x36950b)){const _0x4fe776=a140_0x388d86(_0x30b59c);_0x66eefb[_0x4c0fc7(0x19d)]({'yamlConfig':_0x4fe776,'folderPath':_0x2b8718,'sourcePath':_0x44c217});}else{if(!_0x3cbbd5?.[_0x4c0fc7(0x1d0)]){const _0x4faa81=parseSegmentYamlFile(_0x30b59c),_0x348278=normalizeChildSegmentYaml(_0x4faa81);_0x18b67c[_0x4c0fc7(0x19d)]({'yamlConfig':_0x348278,'folderPath':_0x2b8718,'sourcePath':_0x44c217});}}}return{'segments':_0x18b67c,'journeys':_0x66eefb};}export function validateParsedFiles(_0x1d763e,_0x43f3ed){const _0x5f206b=a140_0x2bcd56,_0x200e01=[];for(const {yamlConfig:_0x3f7062,sourcePath:_0x297b59}of _0x1d763e[_0x5f206b(0x188)]){const _0x52830a=readFileSync(_0x297b59,'utf-8'),_0x2a4978=a140_0x3404f8['parseDocument'](_0x52830a),_0x1de571=validateSegmentDef(_0x3f7062,{'source':_0x52830a,'document':_0x2a4978},{'skipSchema':!![]});if(!_0x1de571[_0x5f206b(0x1cc)]){const _0x442193=a140_0x4533d9[_0x5f206b(0x152)](_0x43f3ed,_0x297b59);_0x200e01[_0x5f206b(0x19d)]({'filePath':_0x442193,'source':_0x52830a,'result':_0x1de571,'isJourney':![]});}}for(const {yamlConfig:_0x2c1b47,sourcePath:_0xd7cf57}of _0x1d763e['journeys']){const _0x19664b=readFileSync(_0xd7cf57,'utf-8'),_0x4551d7=a140_0x3404f8[_0x5f206b(0x20f)](_0x19664b),_0x1253ab=validateJourneyDef(_0x2c1b47,{'source':_0x19664b,'document':_0x4551d7},{'skipSchema':!![]});if(!_0x1253ab[_0x5f206b(0x1cc)]){const _0x605657=a140_0x4533d9[_0x5f206b(0x152)](_0x43f3ed,_0xd7cf57);_0x200e01[_0x5f206b(0x19d)]({'filePath':_0x605657,'source':_0x19664b,'result':_0x1253ab,'isJourney':!![]});}}return _0x200e01;}export function formatValidationErrors(_0x7da5a0){const _0x4808f0=a140_0x2bcd56,_0x5cc365=[];for(const {filePath:_0x2b1da3,source:_0x3ba2b5,result:_0x38fe70,isJourney:_0x5ed265}of _0x7da5a0){const _0x3e4e81=_0x5ed265?'journey':_0x4808f0(0x169);_0x5cc365[_0x4808f0(0x19d)]('\x0a'+_0x2b1da3+'\x20('+_0x3e4e81+'):\x20'+_0x38fe70[_0x4808f0(0x1f8)][_0x4808f0(0x1eb)]+_0x4808f0(0x212)),_0x5cc365[_0x4808f0(0x19d)](formatValidationResult(_0x38fe70,_0x3ba2b5,_0x2b1da3));}return _0x5cc365[_0x4808f0(0x15d)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x504e73){const _0x5429e0=a140_0x2bcd56,_0x3fd340=new Set(),_0x5d0097=new Map(),_0x5884ac=collectSegmentUsageCounts(_0x504e73);if(_0x504e73[_0x5429e0(0x188)])for(const [_0x504d1d,_0x4e08c0]of Object[_0x5429e0(0x1b3)](_0x504e73[_0x5429e0(0x188)])){_0x3fd340['add'](_0x504d1d);if(_0x4e08c0['rule']){const _0x5abd49=yamlRuleToApi(_0x4e08c0[_0x5429e0(0x156)]),_0x2c8797=apiRuleToYaml(_0x5abd49);_0x5d0097[_0x5429e0(0x19e)](_0x504d1d,_0x2c8797);}}const _0x17b02d=new Map();let _0x576562=0x0;for(const [_0x592e45,_0x1ae8e0]of _0x5d0097){const _0x49c3e3=serializeExpandedRule(_0x1ae8e0,_0x5d0097),_0x260ef5=_0x17b02d[_0x5429e0(0x195)](_0x49c3e3)||[];_0x260ef5['push']({'name':_0x592e45,'index':_0x576562}),_0x17b02d[_0x5429e0(0x19e)](_0x49c3e3,_0x260ef5),_0x576562++;}const _0x20060f=new Map();for(const [_0x208211,_0x56ca84]of _0x17b02d){const _0x1afc60=_0x56ca84[_0x5429e0(0x18c)]()[_0x5429e0(0x160)]((_0x2d9190,_0x2a0804)=>{const _0x753236=_0x5429e0,_0x2b6b0e=_0x5884ac[_0x753236(0x195)](_0x2d9190[_0x753236(0x141)])||0x0,_0x4c1e7b=_0x5884ac[_0x753236(0x195)](_0x2a0804[_0x753236(0x141)])||0x0;if(_0x2b6b0e!==_0x4c1e7b)return _0x4c1e7b-_0x2b6b0e;return _0x2d9190[_0x753236(0x13e)]-_0x2a0804[_0x753236(0x13e)];})[_0x5429e0(0x185)](_0x49ab43=>_0x49ab43[_0x5429e0(0x141)]),_0x43477a=[];for(const _0x4fec0b of _0x1afc60){const _0x50661a=_0x5884ac['get'](_0x4fec0b)||0x0,_0x29f65a=Math[_0x5429e0(0x21d)](_0x50661a,0x1);for(let _0x46a4e4=0x0;_0x46a4e4<_0x29f65a;_0x46a4e4++){_0x43477a[_0x5429e0(0x19d)](_0x4fec0b);}}_0x20060f[_0x5429e0(0x19e)](_0x208211,_0x43477a);}return{'existingLocalSegmentNames':_0x3fd340,'localSegmentRules':_0x5d0097,'localExpandedRuleToNames':_0x20060f};}export function createSegmentIdResolver(_0x387e6c,_0x5d46e9){return async _0x278ad7=>{const _0x385f88=a140_0x275f,_0x1459a3=_0x387e6c[_0x385f88(0x195)](_0x278ad7);if(!_0x1459a3)throw new SDKError(ErrorCode[_0x385f88(0x14c)],_0x385f88(0x1dc)+_0x278ad7+_0x385f88(0x203)+_0x5d46e9+'\x27)');return _0x1459a3;};}export function extractRootFolderId(_0x4c68cd){const _0x4815dc=a140_0x2bcd56;return _0x4c68cd[_0x4815dc(0x232)]?.[_0x4815dc(0x211)]?.[_0x4815dc(0x236)]?.['id']||_0x4c68cd[_0x4815dc(0x232)]?.[_0x4815dc(0x197)]?.[_0x4815dc(0x236)]?.['id'];}export function buildConnectionMaps(_0x36d9fa){const _0x4d2e99=a140_0x2bcd56,_0x5cd4cf=new Map(),_0xc201c4=new Map(),_0x237684=new Map();for(const _0x55c701 of _0x36d9fa){_0x5cd4cf['set'](_0x55c701[_0x4d2e99(0x141)],parseInt(_0x55c701['id'],0xa)),_0xc201c4[_0x4d2e99(0x19e)](_0x55c701['id'],_0x55c701[_0x4d2e99(0x141)]),_0x237684[_0x4d2e99(0x19e)](_0x55c701[_0x4d2e99(0x141)],_0x55c701[_0x4d2e99(0x20c)]);}return{'nameToId':_0x5cd4cf,'idToName':_0xc201c4,'nameToType':_0x237684};}function a140_0x4a99(){const _0x23c7bf=['Activation\x20not\x20found:\x20','branches','uniqueServerName','activationContext','embedded_activation_creating','valid','isNew','action','connector_config','skipSegments','all_columns','steps','activationParams','WaitStep','update','getJourney','versionNumber',').\x20','flatMap','object','updated','Segment\x20not\x20found:\x20','activation_','conditionTimeoutUnit','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','\x27\x20by\x20rule\x20content','uniqueSegmentName','\x0a\x20\x20','updateSegmentById','conditionTimeoutDuration','\x27\x20wait\x20condition','\x20(referenced\x20in\x20journey\x20','DecisionPoint','Created\x20journey\x20\x27','toString','connection','length','conditions','deleteSegment','470412mcoedL','parse','stringify','results','hex','embeddedSegmentNameToId','journey','withProgress','decision_point','532yiFzqh','errors','find','getLatestJourneyId','.$1.push-recovery.json','\x27\x20not\x20found\x20in\x20journey\x20\x27','entry','logDeleted',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','parentId','\x27\x20to\x20local\x20\x27','logWarning','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','diff','Creating\x20activation\x20\x27','segment_created','digest','list','./child-segment-yaml.js','sha1','existingSegment','type','exitCriterias','segmentNameToId','parseDocument','segmentFolderId','parentSegmentFolder','\x20error(s)','deleted','dirname','verbose','activation_deleting','logInfo','resolveJourneyId','some','activation_template_id','Condition','hasChanges','max','message','2yOgSyf','journeyBundleName','debug','journey_creating','371534rCdrWR','createdSegmentId','embedded_segment_creating','__pending_','./journey-yaml.js','logSuccess','folderId','createJourneySegment','folder','folderPath','Duration','createdSegmentIds','\x27\x20from\x20file:\x20','deps','NOT_FOUND','relationships','stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','replace','data','Created\x20folder\x20\x27','filter','SEGMENT_SYNTAX_ERROR','getSegmentEntity','\x27...','activation_creating','toLowerCase','folderPathToId','activationsBySegmentId','waitStepUnit','Updating\x20activation\x20\x27','idToName','from','ACTIVATION_SYNTAX_ERROR','index','draft','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','name','journeyBundlesByFolderAndName','onProgress','61768nwaJrp','startsWith','and\x20the\x20server\x20segment,\x20then\x20retry.','stages','getSegment','segmentId','includes','20EMjWby','SEGMENT_NOT_FOUND','listActivations','\x20segment\x20from\x20file:\x20','createFolder','state','\x27\x20for\x20','relative','getActivation','localName','Updating\x20segment\x20\x27','rule','validatedRequest','\x20activation\x20\x27','resolveSegment','journeyActivationStepId','has','all','join','rootFolderId','journeyStages','sort','activations','Creating\x20segment\x20\x27','../../utils/async.js','embedded_activation_created','existingJourney','journeyBundleId','delete','Updated\x20activation\x20\x27','segment','1031379KRpwtN','__pending_act_','absolutePath','goal\x20criteria','milestone','\x20journey\x20from\x20file:\x20','match','1465482RmTRRc','create','Updated\x20journey\x20\x27','toISOString','segment_creating','deleteActivation','connectionIdToNameMap','unchanged','tdx.sdk.push-workflow','Created\x20activation\x20\x27','entryCriteria','notification','createSegment','resolvedRule','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','split','Entry\x20criteria:\x20','journey_updated','Embedded\x20segment\x20\x27','goal','map','waitStepType','item','segments','segment_updating','idToEmailMap','Matched\x20server\x20segment\x20\x27','slice','embedded_segment_created','Segment\x20not\x20found','getSegmentEntity\x20also\x20failed\x20for\x20','nameToType','activation_updated','add','journeyById','Failed\x20to\x20','get','waitStep','parentFolder','journeyActivationNameToId','reduce','attributes','110fnIjBQ','values','push','set','keys','4885243PLkJVx','yamlActivation','existingActivation','size','null','progress','run_after_journey_refresh','INTERNAL','\x27\x20milestone','behavior','journeyName','journey_entry_criteria_','conditionSegmentId','description','schedule','ACTIVATION_UPDATE_ERROR','Name\x20has\x20already\x20been\x20taken','\x27\x20entry\x20criteria','yamlConfig','entries','kind','buildUserMaps','Activation','existingSegments','createActivation','activationActions','Fetching\x20','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','with','Deleting\x20activation\x20\x27','utf-8','journeyId','217025PFNKEf','segmentByFolderAndName','activation_created','created','segment_deleting','folder_created','SEGMENT_UPDATE_ERROR'];a140_0x4a99=function(){return _0x23c7bf;};return a140_0x4a99();}export function calculatePushStats(_0x146572,_0x469188,_0x57b3a8,_0x3fdc3f,_0x2e399c,_0x53c831,_0x50dcdc){const _0x2f950e=a140_0x2bcd56,_0x7e98c4=_0x146572['filter'](_0x13048e=>_0x13048e[_0x2f950e(0x1cd)]),_0x1b8717=_0x146572[_0x2f950e(0x238)](_0x2800a6=>!_0x2800a6[_0x2f950e(0x1cd)]&&_0x2800a6[_0x2f950e(0x21c)]),_0x5ae196=_0x146572['filter'](_0x37f936=>!_0x37f936['isNew']&&!_0x37f936[_0x2f950e(0x21c)]),_0x349e6d=_0x53c831?_0x3fdc3f:[],_0x4a9011=_0x469188[_0x2f950e(0x238)](_0x333e43=>_0x333e43[_0x2f950e(0x1cd)]),_0x11a173=_0x469188['filter'](_0x40489a=>!_0x40489a[_0x2f950e(0x1cd)]&&_0x40489a[_0x2f950e(0x21c)]),_0x2f28db=_0x469188[_0x2f950e(0x238)](_0x13cf56=>!_0x13cf56[_0x2f950e(0x1cd)]&&!_0x13cf56[_0x2f950e(0x21c)]),_0x304ad7=_0x53c831?_0x2e399c:[],_0x44a298=_0x146572[_0x2f950e(0x1d9)](_0x3556d8=>_0x3556d8[_0x2f950e(0x1b9)]),_0xd9565b=_0x44a298['filter'](_0x270d7f=>_0x270d7f['type']==='create'),_0x1b6d47=_0x44a298[_0x2f950e(0x238)](_0x27cfa0=>_0x27cfa0[_0x2f950e(0x20c)]===_0x2f950e(0x1d5)),_0x5690f0=_0x44a298['filter'](_0x426532=>_0x426532[_0x2f950e(0x20c)]==='delete'),_0x38081e=Array[_0x2f950e(0x243)](_0x57b3a8)[_0x2f950e(0x160)](),_0x4b9f23=_0x50dcdc?![]:_0x7e98c4[_0x2f950e(0x1eb)]>0x0||_0x1b8717[_0x2f950e(0x1eb)]>0x0||_0x349e6d['length']>0x0,_0x1d77ae=_0x4a9011[_0x2f950e(0x1eb)]>0x0||_0x11a173['length']>0x0||_0x304ad7['length']>0x0,_0x5ca393=_0x50dcdc?![]:_0x44a298[_0x2f950e(0x1eb)]>0x0,_0x29a447=_0x38081e['length']>0x0;return{'segments':{'new':_0x7e98c4,'changed':_0x1b8717,'unchanged':_0x5ae196,'toDelete':_0x349e6d},'journeys':{'new':_0x4a9011,'changed':_0x11a173,'unchanged':_0x2f28db,'toDelete':_0x304ad7},'activations':{'all':_0x44a298,'toCreate':_0xd9565b,'toUpdate':_0x1b6d47,'toDelete':_0x5690f0},'folders':{'toCreate':_0x38081e},'counts':{'segments':{'new':_0x7e98c4[_0x2f950e(0x1eb)],'changed':_0x1b8717[_0x2f950e(0x1eb)],'unchanged':_0x5ae196[_0x2f950e(0x1eb)],'toDelete':_0x349e6d['length']},'journeys':{'new':_0x4a9011[_0x2f950e(0x1eb)],'changed':_0x11a173[_0x2f950e(0x1eb)],'unchanged':_0x2f28db[_0x2f950e(0x1eb)],'toDelete':_0x304ad7[_0x2f950e(0x1eb)]},'activations':{'create':_0xd9565b[_0x2f950e(0x1eb)],'update':_0x1b6d47[_0x2f950e(0x1eb)],'delete':_0x5690f0['length']},'folders':_0x38081e[_0x2f950e(0x1eb)]},'hasChanges':_0x4b9f23||_0x1d77ae||_0x5ca393||_0x29a447};}export async function buildPushExecutionContext(_0x358c90,_0x1f9710,_0xa43b1e,_0x510a20,_0x2b6ebc,_0x42da28){const _0x938511=a140_0x2bcd56,_0x36e082=extractRootFolderId(_0xa43b1e),{pathToId:_0x20d1a7,idToPath:_0x552676}=buildFolderMaps(_0x2b6ebc),_0x5bc952=buildSegmentNameToIdMap(_0x510a20),_0x31ba0d=new Map(),{batchAsync:_0x34932e}=await import(_0x938511(0x163)),[_0x1c6062,_0x4cde4d]=await Promise[_0x938511(0x15c)]([_0x358c90['user'][_0x938511(0x1b5)](),_0x358c90[_0x938511(0x1ea)][_0x938511(0x208)](),((async()=>{const _0x56daa5=_0x938511;!_0x42da28&&_0x510a20[_0x56daa5(0x1eb)]>0x0&&await _0x34932e(_0x510a20,async _0x47f8ad=>{const _0x45be26=await _0x358c90['segment']['listActivations'](_0x1f9710,_0x47f8ad['id']);_0x31ba0d['set'](_0x47f8ad['id'],_0x45be26);});})())]),{emailToId:_0x2d0877,idToEmail:_0x25d695}=_0x1c6062,_0x2c2617=buildConnectionMaps(_0x4cde4d);return{'rootFolderId':_0x36e082,'folderPathToId':_0x20d1a7,'folderIdToPath':_0x552676,'segmentNameToId':_0x5bc952,'activationsBySegmentId':_0x31ba0d,'emailToIdMap':_0x2d0877,'idToEmailMap':_0x25d695,'connectionNameToIdMap':_0x2c2617['nameToId'],'connectionIdToNameMap':_0x2c2617[_0x938511(0x242)],'connectionNameToTypeMap':_0x2c2617[_0x938511(0x190)]};}export function createPushYamlContextForBundle(_0x473c98,_0xc93761,_0x4a34fa,_0x5d51c2,_0xb47c02,_0x518353,_0x5b1113,_0x84244c){const {existingLocalSegmentNames:_0x2a61cc,localExpandedRuleToNames:_0x165be8}=_0x5d51c2,_0x788d=new Set(),_0x19e026=new Map(),_0x1989b4=new Map(),_0x466ff3=new Map(),_0x259092=createJumpTargetCache(),_0xbd2f80=new Map(),_0x1f4d21=new Map(),_0x20d14f=new Set();let _0xc289bd;const _0x3394da=_0x45bc05=>{const _0x545973={'resolveSegment':async _0x4b5ed8=>{const _0x5af5f6=a140_0x275f,_0x5b26ff=_0x466ff3['get'](_0x4b5ed8);if(_0x5b26ff!==undefined)return{'name':_0x5b26ff,'isJourneyLocal':!![]};try{const _0x493610=await fetchSegment(_0x473c98,_0xc93761,_0x4b5ed8,_0x4a34fa);if(!_0x493610)throw new Error(_0x5af5f6(0x18e));const _0xd51846=generateJourneyLocalName(_0x493610['name']),_0x142e47=_0x493610[_0x5af5f6(0x1b4)]===SEGMENT_KIND_JOURNEY&&_0xd51846!==undefined;let _0x358c57=_0x493610[_0x5af5f6(0x141)],_0x15b3d4;if(_0x142e47&&_0x493610[_0x5af5f6(0x156)]){const _0x1a286f=apiRuleToYaml(_0x493610[_0x5af5f6(0x156)]);_0x1f4d21[_0x5af5f6(0x19e)](_0x4b5ed8,_0x1a286f);const _0x3075a7=async _0x2b8c38=>{const _0x2faf25=_0x5af5f6,_0x245fb8=collectSegmentRefsFromRule(_0x2b8c38);for(const _0x494673 of _0x245fb8){if(!_0x1f4d21['has'](_0x494673))try{const _0x2d0b3f=await fetchSegment(_0x473c98,_0xc93761,_0x494673,_0x4a34fa);if(_0x2d0b3f?.[_0x2faf25(0x156)]){const _0x134fc5=apiRuleToYaml(_0x2d0b3f['rule']);_0x1f4d21[_0x2faf25(0x19e)](_0x494673,_0x134fc5),await _0x3075a7(_0x134fc5);}}catch(_0x56c06c){logger[_0x2faf25(0x221)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x494673+':\x20'+_0x56c06c);}}};await _0x3075a7(_0x1a286f);const _0x5c825f=serializeExpandedRule(_0x1a286f,_0x1f4d21),_0x160f5c=_0x165be8['get'](_0x5c825f);if(_0x160f5c&&_0x160f5c['length']>0x0){const _0x1f0503=_0x19e026['get'](_0x5c825f)||0x0,_0x4236fd=_0x160f5c[_0x1f0503]||_0x160f5c[_0x160f5c[_0x5af5f6(0x1eb)]-0x1];_0x19e026['set'](_0x5c825f,_0x1f0503+0x1),_0x358c57=_0x4236fd,_0x788d[_0x5af5f6(0x192)](_0x358c57),_0x466ff3[_0x5af5f6(0x19e)](_0x4b5ed8,_0x358c57);const _0x58376a=await resolveRuleSegmentRefs(_0x1a286f,async _0x10a2ce=>{const _0x3f5039=_0x5af5f6,_0x35b5e9=_0x466ff3[_0x3f5039(0x195)](_0x10a2ce);if(_0x35b5e9)return _0x35b5e9;const _0x4e93f1=await _0xc289bd[_0x3f5039(0x159)](_0x10a2ce);return _0x4e93f1[_0x3f5039(0x141)];});_0x15b3d4={'description':_0x493610['description'],'rule':_0x58376a};}else{const _0x4907e3=_0xbd2f80[_0x5af5f6(0x195)](_0x5c825f);if(_0x4907e3)_0x358c57=_0x4907e3,_0x466ff3['set'](_0x4b5ed8,_0x358c57);else{if(_0xd51846){let _0x440c57=_0xd51846,_0x4eef75=0x2;while(_0x788d[_0x5af5f6(0x15b)](_0x440c57)||_0x2a61cc[_0x5af5f6(0x15b)](_0x440c57)){_0x440c57=_0xd51846+'_'+_0x4eef75,_0x4eef75++;}_0x788d[_0x5af5f6(0x192)](_0x440c57),_0x358c57=_0x440c57;}_0x466ff3[_0x5af5f6(0x19e)](_0x4b5ed8,_0x358c57),_0xbd2f80[_0x5af5f6(0x19e)](_0x5c825f,_0x358c57);const _0x4969ea=await resolveRuleSegmentRefs(_0x1a286f,async _0x2dc3f1=>{const _0x2b0e96=_0x5af5f6,_0x2b9e78=_0x466ff3[_0x2b0e96(0x195)](_0x2dc3f1);if(_0x2b9e78)return _0x2b9e78;const _0x1b2fd0=await _0xc289bd['resolveSegment'](_0x2dc3f1);return _0x1b2fd0[_0x2b0e96(0x141)];});_0x15b3d4={'description':_0x493610[_0x5af5f6(0x1ad)],'rule':_0x4969ea};}}}return{'name':_0x358c57,'isJourneyLocal':_0x142e47,'definition':_0x15b3d4};}catch(_0x2ba0d5){return logger[_0x5af5f6(0x221)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4b5ed8+':\x20'+_0x2ba0d5),{'name':_0x4b5ed8,'isJourneyLocal':![]};}},'resolveActivation':async _0x5154f4=>{const _0x4b0750=a140_0x275f,_0x4ca7db=_0x1989b4[_0x4b0750(0x195)](_0x5154f4);if(_0x4ca7db!==undefined)return{'name':_0x4ca7db,'isJourneyLocal':!![]};try{let _0x2bc24f=_0x5b1113?.[_0x4b0750(0x195)](_0x5154f4);!_0x2bc24f&&(_0x2bc24f=await _0x473c98[_0x4b0750(0x1f4)][_0x4b0750(0x153)](_0x45bc05,_0x5154f4));const _0x3910f1=_0x2bc24f['attributes'][_0x4b0750(0x1d3)][_0x4b0750(0x141)]||_0x5154f4,_0x4d1a12=sanitizeYamlKey(_0x3910f1)||_0x4b0750(0x1dd)+_0x5154f4,_0x52b296=_0x4d1a12;_0x1989b4[_0x4b0750(0x19e)](_0x5154f4,_0x52b296);const _0x3010a1=journeyActivationStepToYaml(_0x2bc24f,_0xb47c02,_0x518353);return{'name':_0x52b296,'isJourneyLocal':!![],'definition':_0x3010a1};}catch(_0x54bb62){return logger[_0x4b0750(0x221)]('Failed\x20to\x20resolve\x20activation\x20'+_0x5154f4+':\x20'+_0x54bb62),{'name':_0x5154f4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4b7a54,_0x417d16)=>resolveJumpTarget(_0x4b7a54,_0x417d16,_0x259092,async _0x23846e=>{const _0x3730b4=a140_0x275f,_0x425783=_0x84244c?.[_0x3730b4(0x195)](_0x23846e);if(_0x425783)return _0x425783;return _0x473c98['journey'][_0x3730b4(0x1d6)](_0x23846e);})};return _0xc289bd=_0x545973,_0x545973;},_0x58f274=async _0x2e0aa9=>{const _0x31fef5=a140_0x275f,{collectSegmentIdsFromJourneyApi:_0x2914cb}=await import(_0x31fef5(0x227)),{batchAsync:_0x3e4eb0}=await import(_0x31fef5(0x163)),_0xb94efe=new Set();for(const _0x28e696 of _0x2e0aa9){let _0x399c7d=_0x84244c?.['get'](_0x28e696);!_0x399c7d&&(_0x399c7d=await _0x473c98[_0x31fef5(0x1f4)]['getJourney'](_0x28e696));const _0x3b87ef=_0x2914cb(_0x399c7d);for(const _0x2c9e1a of _0x3b87ef){_0xb94efe[_0x31fef5(0x192)](_0x2c9e1a);}}let _0xc24500=Array[_0x31fef5(0x243)](_0xb94efe);while(_0xc24500[_0x31fef5(0x1eb)]>0x0){const _0x4f7bb2=_0xc24500[_0x31fef5(0x238)](_0x24e483=>!_0x20d14f[_0x31fef5(0x15b)](_0x24e483));if(_0x4f7bb2[_0x31fef5(0x1eb)]===0x0)break;const _0x557d72=await _0x3e4eb0(_0x4f7bb2,async _0x1f87bd=>{_0x20d14f['add'](_0x1f87bd);const _0x311f9d=await fetchSegment(_0x473c98,_0xc93761,_0x1f87bd,_0x4a34fa);if(!_0x311f9d)return null;return{'segmentId':_0x1f87bd,'segment':_0x311f9d};},0xa),_0x7d0794=new Set();for(const _0x4926f0 of _0x557d72){if(!_0x4926f0?.[_0x31fef5(0x169)]?.[_0x31fef5(0x156)])continue;const _0x351213=apiRuleToYaml(_0x4926f0['segment'][_0x31fef5(0x156)]);_0x1f4d21[_0x31fef5(0x19e)](_0x4926f0[_0x31fef5(0x149)],_0x351213);const _0x2c5e1a=collectSegmentRefsFromRule(_0x351213);for(const _0xaad08a of _0x2c5e1a){!_0x20d14f['has'](_0xaad08a)&&_0x7d0794['add'](_0xaad08a);}}_0xc24500=Array['from'](_0x7d0794);}};return{'createYamlContext':_0x3394da,'prefetchJourneySegments':_0x58f274};}export async function executePushSegments(_0x2fcdd8,_0x5de0cf,_0x8617d5,_0x59390a,_0x374c3a){const _0x570023=a140_0x2bcd56,{segmentDefToCreateRequest:_0x3087cd,segmentDefToUpdateRequest:_0x52366d}=await import(_0x570023(0x209)),_0x46bb67=_0x8617d5['folderPathToId'],_0x2ee73c=0x5,_0x234f46=async _0x4c0a73=>{const _0x4a31ad=_0x570023,_0x250dc3=_0x4c0a73[_0x4a31ad(0x22c)]?_0x46bb67[_0x4a31ad(0x195)](_0x4c0a73[_0x4a31ad(0x22c)]):undefined;let _0x50178a;const _0x219e33={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x161853=_0x4c0a73[_0x4a31ad(0x1b2)];if(_0x4c0a73[_0x4a31ad(0x1b2)]['rule']){const _0x293536=createSegmentIdResolver(_0x8617d5[_0x4a31ad(0x20e)],_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]),_0xa1a510=await resolveRuleSegmentIds(_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x156)],_0x293536);_0x161853={..._0x4c0a73[_0x4a31ad(0x1b2)],'rule':_0xa1a510};}try{if(_0x4c0a73[_0x4a31ad(0x1cd)]){_0x374c3a[_0x4a31ad(0x143)]?.({'type':_0x4a31ad(0x175),'name':_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]});const _0x316e91=_0x3087cd(_0x161853,_0x250dc3),_0x15719a=await _0x374c3a['withProgress'](_0x4a31ad(0x162)+_0x4c0a73['yamlConfig'][_0x4a31ad(0x141)]+_0x4a31ad(0x23b),()=>_0x2fcdd8['segment'][_0x4a31ad(0x17d)](_0x59390a['parentId'],_0x316e91));_0x50178a=_0x15719a[_0x4a31ad(0x236)]['id'],_0x8617d5[_0x4a31ad(0x20e)][_0x4a31ad(0x19e)](_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)],_0x50178a),_0x219e33['createdSegmentId']={'name':_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)],'id':_0x50178a},_0x374c3a[_0x4a31ad(0x143)]?.({'type':_0x4a31ad(0x206),'name':_0x4c0a73['yamlConfig']['name'],'segmentId':_0x50178a}),_0x374c3a[_0x4a31ad(0x228)]?.('Created\x20segment\x20\x27'+_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]+'\x27'),_0x219e33[_0x4a31ad(0x1c3)]=0x1;}else{if(_0x4c0a73[_0x4a31ad(0x21c)]){_0x374c3a[_0x4a31ad(0x143)]?.({'type':_0x4a31ad(0x189),'name':_0x4c0a73['yamlConfig'][_0x4a31ad(0x141)]});const _0x5941bc=_0x52366d(_0x161853);_0x250dc3!==_0x4c0a73[_0x4a31ad(0x20b)]?.['segmentFolderId']&&(_0x5941bc[_0x4a31ad(0x210)]=_0x250dc3?parseInt(_0x250dc3,0xa):undefined),await _0x374c3a['withProgress'](_0x4a31ad(0x155)+_0x4c0a73['yamlConfig'][_0x4a31ad(0x141)]+'\x27...',()=>_0x2fcdd8[_0x4a31ad(0x169)][_0x4a31ad(0x1e3)](_0x59390a[_0x4a31ad(0x200)],_0x4c0a73[_0x4a31ad(0x20b)]['id'],_0x5941bc)),_0x50178a=_0x4c0a73[_0x4a31ad(0x20b)]['id'],_0x374c3a[_0x4a31ad(0x143)]?.({'type':'segment_updated','name':_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]}),_0x374c3a[_0x4a31ad(0x228)]?.('Updated\x20segment\x20\x27'+_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]+'\x27'),_0x219e33[_0x4a31ad(0x1db)]=0x1;}else _0x50178a=_0x4c0a73[_0x4a31ad(0x20b)]['id'];}}catch(_0x4169b1){const _0x349133=isHttp400Error(_0x4169b1),_0x323618=_0x349133?ErrorCode[_0x4a31ad(0x239)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0xd91881=getErrorMessage(_0x4169b1);throw new SDKError(_0x323618,'Failed\x20to\x20'+(_0x4c0a73[_0x4a31ad(0x1cd)]?_0x4a31ad(0x172):_0x4a31ad(0x1d5))+_0x4a31ad(0x14e)+_0x4c0a73[_0x4a31ad(0x16c)]+_0x4a31ad(0x1e2)+_0xd91881,_0x4169b1);}try{const _0x303995=await syncActivationsForSegment(_0x2fcdd8,_0x59390a[_0x4a31ad(0x200)],_0x50178a,_0x4c0a73[_0x4a31ad(0x1b2)]['name'],_0x4c0a73[_0x4a31ad(0x1b9)],_0x374c3a,_0x4c0a73[_0x4a31ad(0x16c)]);_0x219e33[_0x4a31ad(0x161)]=_0x303995;}catch(_0x237402){if(_0x237402 instanceof SDKError)throw _0x237402;throw new SDKError(ErrorCode[_0x4a31ad(0x1af)],_0x4a31ad(0x234)+_0x4c0a73[_0x4a31ad(0x1b2)][_0x4a31ad(0x141)]+_0x4a31ad(0x22f)+_0x4c0a73[_0x4a31ad(0x16c)]+_0x4a31ad(0x1e2)+getErrorMessage(_0x237402),_0x237402);}return _0x219e33;},_0x162fb4=await batchAsync(_0x5de0cf,_0x234f46,_0x2ee73c),_0x87c7c3={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3b72b8 of _0x162fb4){_0x87c7c3[_0x570023(0x1c3)]+=_0x3b72b8[_0x570023(0x1c3)],_0x87c7c3[_0x570023(0x1db)]+=_0x3b72b8[_0x570023(0x1db)],_0x3b72b8[_0x570023(0x224)]&&_0x87c7c3[_0x570023(0x22e)]['set'](_0x3b72b8[_0x570023(0x224)][_0x570023(0x141)],_0x3b72b8['createdSegmentId']['id']),_0x87c7c3[_0x570023(0x161)][_0x570023(0x1c3)]+=_0x3b72b8[_0x570023(0x161)][_0x570023(0x1c3)],_0x87c7c3[_0x570023(0x161)]['updated']+=_0x3b72b8[_0x570023(0x161)][_0x570023(0x1db)],_0x87c7c3['activations']['deleted']+=_0x3b72b8[_0x570023(0x161)][_0x570023(0x213)];}return _0x87c7c3;}async function syncActivationsForSegment(_0x911773,_0x4420d0,_0x25250d,_0x2ba399,_0x557198,_0x7aca9,_0xce03ad){const _0x457631=a140_0x2bcd56,_0x377253={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x305135 of _0x557198){try{if(_0x305135[_0x457631(0x20c)]==='create'&&_0x305135[_0x457631(0x157)])_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x23c),'segmentName':_0x2ba399,'activationName':_0x305135['name']}),await _0x7aca9[_0x457631(0x1f5)](_0x457631(0x205)+_0x305135[_0x457631(0x141)]+_0x457631(0x23b),()=>_0x911773[_0x457631(0x169)][_0x457631(0x1b8)](_0x4420d0,_0x25250d,_0x305135[_0x457631(0x157)])),_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x1c2),'segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),_0x7aca9[_0x457631(0x228)]?.(_0x457631(0x17a)+_0x305135[_0x457631(0x141)]+'\x27'),_0x377253[_0x457631(0x1c3)]++;else{if(_0x305135[_0x457631(0x20c)]===_0x457631(0x1d5)&&_0x305135['validatedRequest']&&_0x305135[_0x457631(0x1a2)])_0x7aca9[_0x457631(0x143)]?.({'type':'activation_updating','segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),await _0x7aca9[_0x457631(0x1f5)](_0x457631(0x241)+_0x305135['name']+_0x457631(0x23b),()=>_0x911773[_0x457631(0x169)]['updateActivation'](_0x4420d0,_0x25250d,_0x305135[_0x457631(0x1a2)]['id'],_0x305135[_0x457631(0x157)])),_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x191),'segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),_0x7aca9['logSuccess']?.(_0x457631(0x168)+_0x305135['name']+'\x27'),_0x377253[_0x457631(0x1db)]++;else _0x305135[_0x457631(0x20c)]==='delete'&&_0x305135[_0x457631(0x1a2)]&&(_0x7aca9[_0x457631(0x143)]?.({'type':_0x457631(0x216),'segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),await _0x7aca9[_0x457631(0x1f5)](_0x457631(0x1bd)+_0x305135[_0x457631(0x141)]+'\x27...',()=>_0x911773['segment'][_0x457631(0x176)](_0x4420d0,_0x25250d,_0x305135[_0x457631(0x1a2)]['id'])),_0x7aca9[_0x457631(0x143)]?.({'type':'activation_deleted','segmentName':_0x2ba399,'activationName':_0x305135[_0x457631(0x141)]}),_0x7aca9[_0x457631(0x1fe)]?.('Deleted\x20activation\x20\x27'+_0x305135[_0x457631(0x141)]+'\x27'),_0x377253[_0x457631(0x213)]++);}}catch(_0x50ba49){const _0x43ab59=isHttp400Error(_0x50ba49),_0x3ad22c=_0x43ab59?ErrorCode[_0x457631(0x244)]:ErrorCode[_0x457631(0x1af)],_0x75d1ba=getErrorMessage(_0x50ba49);throw new SDKError(_0x3ad22c,_0x457631(0x194)+_0x305135['type']+_0x457631(0x158)+_0x305135[_0x457631(0x141)]+'\x27\x20from\x20file:\x20'+_0xce03ad+_0x457631(0x1e2)+_0x75d1ba,_0x50ba49);}}return _0x377253;}export async function executePushFolders(_0x4a9da0,_0x3e6b76,_0x200012,_0x5b5174,_0x34e611){const _0x2280e8=a140_0x2bcd56,_0x271faa=new Map(_0x200012),_0x86af21=sortFoldersByDepth(_0x3e6b76);for(const _0xa187cd of _0x86af21){const _0x1d5700=_0xa187cd[_0x2280e8(0x180)]('/'),_0x5dbb85=_0x1d5700[_0x1d5700[_0x2280e8(0x1eb)]-0x1],_0x32816c=_0x1d5700[_0x2280e8(0x18c)](0x0,-0x1)[_0x2280e8(0x15d)]('/'),_0x3a04a9=_0x271faa[_0x2280e8(0x195)](_0x32816c);_0x34e611[_0x2280e8(0x143)]?.({'type':'folder_creating','folder':_0xa187cd});const _0xfdb2b8={'name':_0x5dbb85,'parentFolderId':_0x3a04a9},_0x159c26=await _0x34e611[_0x2280e8(0x1f5)]('Creating\x20folder\x20\x27'+_0xa187cd+_0x2280e8(0x23b),()=>_0x4a9da0[_0x2280e8(0x169)][_0x2280e8(0x14f)](_0x5b5174[_0x2280e8(0x200)],_0xfdb2b8));_0x271faa[_0x2280e8(0x19e)](_0xa187cd,_0x159c26[_0x2280e8(0x236)]['id']),_0x34e611[_0x2280e8(0x143)]?.({'type':_0x2280e8(0x1c5),'folder':_0xa187cd,'folderId':_0x159c26[_0x2280e8(0x236)]['id']}),_0x34e611[_0x2280e8(0x217)]?.(_0x2280e8(0x237)+_0xa187cd+'\x27');}return _0x271faa;}export async function executePushSegmentDeletions(_0x30da5e,_0x339a16,_0x1b8cda){const _0x46ec06=a140_0x2bcd56;if(_0x339a16[_0x46ec06(0x1eb)]===0x0)return 0x0;const {batchAsync:_0x47e1dd}=await import(_0x46ec06(0x163)),_0x28db0e=0x5,_0x5e2185=await _0x47e1dd(_0x339a16,async _0x1c9e4b=>{const _0xc81bb5=_0x46ec06;return _0x1b8cda[_0xc81bb5(0x143)]?.({'type':_0xc81bb5(0x1c4),'name':_0x1c9e4b[_0xc81bb5(0x141)]}),await _0x30da5e[_0xc81bb5(0x169)][_0xc81bb5(0x1ed)](_0x1c9e4b['id']),_0x1b8cda[_0xc81bb5(0x143)]?.({'type':'segment_deleted','name':_0x1c9e4b['name']}),_0x1b8cda[_0xc81bb5(0x1fe)]?.('Deleted\x20segment\x20\x27'+_0x1c9e4b['name']+'\x27'),0x1;},_0x28db0e);return _0x5e2185[_0x46ec06(0x199)]((_0x20126c,_0x1eae37)=>_0x20126c+_0x1eae37,0x0);}export async function executePushJourneys(_0x43c3b6,_0x2b89f6,_0x443d8b,_0x2b88bb,_0x5e9fb3){const _0x539e54=a140_0x2bcd56,{journeyDefToRequest:_0x4263a1}=await import(_0x539e54(0x227)),{activationDefToCreateRequest:_0x112d8b,yamlRuleToApi:_0x5f3279,validateSegmentRule:_0x1c3b50}=await import(_0x539e54(0x209)),_0xce6d95={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x3bf5d9=new Map(_0x443d8b[_0x539e54(0x20e)]),_0x11a98b=0x5;for(let _0x4faf4c=0x0;_0x4faf4c<_0x2b89f6[_0x539e54(0x1eb)];_0x4faf4c+=_0x11a98b){const _0x5be7a1=_0x2b89f6[_0x539e54(0x18c)](_0x4faf4c,_0x4faf4c+_0x11a98b),_0x424f0d=await Promise['all'](_0x5be7a1[_0x539e54(0x185)](async _0x88803b=>{const _0x516310=_0x539e54;if(!_0x88803b[_0x516310(0x1cd)]&&!_0x88803b[_0x516310(0x21c)])return{'action':_0x516310(0x178),'name':_0x88803b['yamlConfig']['name'],'journeyId':_0x88803b[_0x516310(0x165)]?.['id']};const _0x3652c4=_0x88803b['folderPath']?_0x443d8b['folderPathToId'][_0x516310(0x195)](_0x88803b['folderPath']):undefined;_0x5e9fb3[_0x516310(0x143)]?.({'type':_0x88803b[_0x516310(0x1cd)]?_0x516310(0x222):'journey_updating','name':_0x88803b['yamlConfig']['name']});try{const _0x5ede50=await executeSingleJourneyPush(_0x43c3b6,_0x88803b,{..._0x443d8b,'segmentNameToId':_0x3bf5d9},{'parentId':_0x2b88bb['parentId'],'rootFolderId':_0x2b88bb['rootFolderId'],'folderId':_0x3652c4,'verbose':_0x2b88bb[_0x516310(0x215)]},_0x5e9fb3,{'journeyDefToRequest':_0x4263a1,'activationDefToCreateRequest':_0x112d8b,'yamlRuleToApi':_0x5f3279,'validateSegmentRule':_0x1c3b50});for(const [_0x19c69b,_0x1623d8]of _0x5ede50[_0x516310(0x1f3)]){_0x3bf5d9[_0x516310(0x19e)](_0x19c69b,_0x1623d8),_0xce6d95[_0x516310(0x1f3)][_0x516310(0x19e)](_0x19c69b,_0x1623d8);}if(_0x5ede50[_0x516310(0x1ce)]===_0x516310(0x1c3))_0x5e9fb3[_0x516310(0x143)]?.({'type':'journey_created','name':_0x88803b['yamlConfig']['name'],'journeyId':_0x5ede50['journeyId']}),_0x5e9fb3[_0x516310(0x228)]?.(_0x516310(0x1e8)+_0x88803b['yamlConfig'][_0x516310(0x141)]+'\x27'),_0xce6d95[_0x516310(0x1c3)]++;else _0x5ede50[_0x516310(0x1ce)]===_0x516310(0x1db)&&(_0x5e9fb3[_0x516310(0x143)]?.({'type':_0x516310(0x182),'name':_0x88803b[_0x516310(0x1b2)][_0x516310(0x141)]}),_0x5e9fb3['logSuccess']?.(_0x516310(0x173)+_0x88803b['yamlConfig'][_0x516310(0x141)]+'\x27'),_0xce6d95['updated']++);return{'action':_0x5ede50[_0x516310(0x1ce)],'name':_0x88803b['yamlConfig'][_0x516310(0x141)],'journeyId':_0x5ede50['journeyId']};}catch(_0xf09d30){const _0x1d2b65=isHttp400Error(_0xf09d30),_0x2e71c2=_0x1d2b65?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0xfcdb15=getErrorMessage(_0xf09d30);throw new SDKError(_0x2e71c2,_0x516310(0x194)+(_0x88803b[_0x516310(0x1cd)]?_0x516310(0x172):_0x516310(0x1d5))+_0x516310(0x16f)+_0x88803b[_0x516310(0x16c)]+_0x516310(0x1e2)+_0xfcdb15,_0xf09d30);}}));_0xce6d95[_0x539e54(0x1f1)]['push'](..._0x424f0d);}return _0xce6d95;}async function matchExistingJourneySegments(_0x11a0db,_0x2480c3,_0x4a0f0b,_0x40948f,_0x59bc83){const _0x2810a8=a140_0x2bcd56;if(!_0x2480c3['existingJourney']||!_0x2480c3[_0x2810a8(0x1b2)]['segments'])return;const _0x204a94=new Map(),_0x209ce7=new Set();for(const _0x450b9e of Object[_0x2810a8(0x19f)](_0x2480c3[_0x2810a8(0x1b2)][_0x2810a8(0x188)])){const _0x43586b=generateDeterministicJourneySegmentName(_0x2480c3['yamlConfig'][_0x2810a8(0x141)],_0x450b9e);_0x204a94['set'](_0x43586b,_0x450b9e),_0x209ce7[_0x2810a8(0x192)](_0x450b9e);}const _0x1fade3=[],_0x32e590=collectSegmentIdsFromJourneyApi(_0x2480c3[_0x2810a8(0x165)]);for(const _0x16f995 of _0x32e590){const _0x42ec00=await fetchSegment(_0x11a0db,_0x4a0f0b,_0x16f995,_0x40948f);if(!_0x42ec00?.[_0x2810a8(0x141)])continue;const _0x1cdf69=_0x204a94[_0x2810a8(0x195)](_0x42ec00[_0x2810a8(0x141)]);_0x1cdf69?(_0x59bc83[_0x2810a8(0x19e)](_0x1cdf69,_0x16f995),_0x209ce7[_0x2810a8(0x167)](_0x1cdf69)):_0x1fade3[_0x2810a8(0x19d)]({'id':_0x16f995,'seg':_0x42ec00});}if(_0x209ce7[_0x2810a8(0x1a3)]>0x0&&_0x1fade3[_0x2810a8(0x1eb)]>0x0){const {localExpandedRuleToNames:_0x2fab6f}=buildLocalExpandedRuleMappings(_0x2480c3[_0x2810a8(0x1b2)]),_0x4f40c8=new Map();for(const {id:_0x7bb351,seg:_0xf18985}of _0x1fade3){if(_0xf18985[_0x2810a8(0x156)]){const _0x2133b1=apiRuleToYaml(_0xf18985[_0x2810a8(0x156)]);_0x4f40c8[_0x2810a8(0x19e)](_0x7bb351,_0x2133b1);}}for(const {id:_0x12d3a4,seg:_0x5bf033}of _0x1fade3){if(!_0x5bf033['rule'])continue;const _0x50a3d2=_0x4f40c8[_0x2810a8(0x195)](_0x12d3a4);if(!_0x50a3d2)continue;const _0x3d3a91=serializeExpandedRule(_0x50a3d2,_0x4f40c8),_0x3a2e80=_0x2fab6f[_0x2810a8(0x195)](_0x3d3a91);if(_0x3a2e80){const _0x25a779=_0x3a2e80[_0x2810a8(0x1f9)](_0x5b503b=>_0x209ce7[_0x2810a8(0x15b)](_0x5b503b));_0x25a779&&(_0x59bc83[_0x2810a8(0x19e)](_0x25a779,_0x12d3a4),_0x209ce7['delete'](_0x25a779),logger[_0x2810a8(0x221)](_0x2810a8(0x18b)+_0x5bf033[_0x2810a8(0x141)]+_0x2810a8(0x201)+_0x25a779+_0x2810a8(0x1e0)));}}}}async function executeSingleJourneyPush(_0x2c6d96,_0xe83972,_0xeca2af,_0xcff551,_0xc3e81e,_0x206dd8){const _0x3281a1=a140_0x2bcd56,{journeyDefToRequest:_0x1ec4b7,activationDefToCreateRequest:_0x1f3103,yamlRuleToApi:_0x31bf63,validateSegmentRule:_0x499d2d}=_0x206dd8,_0x4a1e56=new Map(),_0x3178e4=new Map();recoverSegmentIdsFromPushRecovery(_0xe83972,_0x4a1e56,_0xeca2af[_0x3281a1(0x20e)]);const _0x6f4918=new Map(),_0x2d7258=new Map(),_0x49f0ea=new Map();let _0x19a5ab;const _0x39bcab=async()=>{const _0x4522bb=_0x3281a1;if(_0x19a5ab)return;_0x19a5ab=new Map();if(!_0xe83972[_0x4522bb(0x165)])return;const _0x54c943=await _0x2c6d96[_0x4522bb(0x1f4)][_0x4522bb(0x14d)](_0xe83972[_0x4522bb(0x165)]['id']);for(const _0x1a8d24 of _0x54c943){const _0x5efc34=journeyActivationStepToYaml(_0x1a8d24,_0xeca2af['idToEmailMap'],_0xeca2af['connectionIdToNameMap']),_0x8dd77a=activationSignature(_0x5efc34);!_0x19a5ab['has'](_0x8dd77a)&&_0x19a5ab[_0x4522bb(0x19e)](_0x8dd77a,_0x1a8d24['id']),_0x5efc34[_0x4522bb(0x141)]&&_0x3178e4[_0x4522bb(0x19e)](_0x5efc34[_0x4522bb(0x141)],_0x1a8d24['id']);}};await matchExistingJourneySegments(_0x2c6d96,_0xe83972,_0xcff551['parentId'],_0xeca2af[_0x3281a1(0x1b7)],_0xeca2af[_0x3281a1(0x20e)]);const _0x17d04a={'resolveSegmentId':async _0xc8a4a2=>{const _0x6f28a6=_0x3281a1,_0x55b6a4=_0xeca2af[_0x6f28a6(0x20e)][_0x6f28a6(0x195)](_0xc8a4a2);if(!_0x55b6a4)throw new SDKError(ErrorCode[_0x6f28a6(0x14c)],'Segment\x20not\x20found:\x20'+_0xc8a4a2+'\x20(referenced\x20in\x20journey\x20'+_0xe83972['yamlConfig']['name']+')');return _0x55b6a4;},'resolveEmbeddedSegmentId':async(_0x2a25cc,_0x1b3396)=>{const _0x50052b=_0x3281a1,_0x776c80=_0xeca2af[_0x50052b(0x20e)]['get'](_0x2a25cc);if(_0x776c80)return _0x776c80;const _0x1152b9=_0xeca2af[_0x50052b(0x1b7)][_0x50052b(0x1f9)](_0x3bd519=>_0x3bd519[_0x50052b(0x141)]===_0x2a25cc);if(_0x1152b9)return _0xeca2af[_0x50052b(0x20e)][_0x50052b(0x19e)](_0x2a25cc,_0x1152b9['id']),_0x1152b9['id'];if(_0xe83972['isNew']){const {stageName:_0x13d0a0,criteriaName:_0x1bd2b5}=findSegmentCriteriaLocation(_0xe83972['yamlConfig'],_0x2a25cc);return _0x499d2d(_0x2a25cc,_0x1b3396[_0x50052b(0x156)]),_0x2d7258[_0x50052b(0x19e)](_0x2a25cc,{'definition':_0x1b3396,'stageName':_0x13d0a0,'criteriaName':_0x1bd2b5}),createPendingSegmentId(_0x2a25cc);}const _0x532790=_0xe83972[_0x50052b(0x165)]?.['id'];if(!_0x532790)throw new SDKError(ErrorCode[_0x50052b(0x1a7)],_0x50052b(0x140));const _0x1cc478=_0x6f4918[_0x50052b(0x195)](_0x2a25cc);if(_0x1cc478)return _0x1cc478;const _0x229397=((async()=>{const _0xb1d713=_0x50052b;_0x499d2d(_0x2a25cc,_0x1b3396['rule']);const _0x27ee7b=generateDeterministicJourneySegmentName(_0xe83972[_0xb1d713(0x1b2)][_0xb1d713(0x141)],_0x2a25cc),_0x3ed2d9=_0xeca2af['existingSegments'][_0xb1d713(0x1f9)](_0x1a0fcc=>_0x1a0fcc[_0xb1d713(0x141)]===_0x27ee7b),_0x48571f=createSegmentIdResolver(_0xeca2af[_0xb1d713(0x20e)],_0x2a25cc),_0xcfe9af=await resolveRuleSegmentIds(_0x1b3396[_0xb1d713(0x156)],_0x48571f);let _0x3eee6d;return _0x3ed2d9?(await _0x2c6d96['segment']['updateSegmentById'](_0xcff551[_0xb1d713(0x200)],_0x3ed2d9['id'],{'description':_0x1b3396[_0xb1d713(0x1ad)]||_0xb1d713(0x181)+_0x2a25cc,'rule':_0x31bf63(_0xcfe9af,!![]),'countPopulation':!![]}),_0x3eee6d=_0x3ed2d9['id'],saveSegmentToPushRecovery(_0xe83972['absolutePath'],_0xe83972['yamlConfig'][_0xb1d713(0x141)],_0x2a25cc,{'segmentId':_0x3eee6d,'uniqueServerName':_0x27ee7b,'createdAt':new Date()[_0xb1d713(0x174)]()})):_0x3eee6d=await createOrRecoverEmbeddedSegment(_0x2c6d96,_0xe83972,{'localName':_0x2a25cc,'uniqueSegmentName':_0x27ee7b,'description':_0x1b3396[_0xb1d713(0x1ad)]||_0xb1d713(0x181)+_0x2a25cc,'journeyId':_0x532790,'resolvedRule':_0xcfe9af,'parentId':_0xcff551[_0xb1d713(0x200)],'folderId':_0xcff551['rootFolderId']||''},_0x31bf63),_0xeca2af[_0xb1d713(0x20e)][_0xb1d713(0x19e)](_0x2a25cc,_0x3eee6d),_0x4a1e56[_0xb1d713(0x19e)](_0x2a25cc,_0x3eee6d),_0x3eee6d;})());_0x6f4918[_0x50052b(0x19e)](_0x2a25cc,_0x229397);try{return await _0x229397;}finally{_0x6f4918['delete'](_0x2a25cc);}},'resolveActivationId':async _0x175bd4=>{const _0x538d97=_0x3281a1,_0x49825c=_0x3178e4[_0x538d97(0x195)](_0x175bd4);if(_0x49825c)return _0x49825c;if(_0xe83972[_0x538d97(0x165)]){await _0x39bcab();const _0x2ff560=_0x3178e4[_0x538d97(0x195)](_0x175bd4);if(_0x2ff560)return _0x2ff560;}throw new SDKError(ErrorCode[_0x538d97(0x231)],_0x538d97(0x1c7)+_0x175bd4+_0x538d97(0x1e6)+_0xe83972[_0x538d97(0x1b2)][_0x538d97(0x141)]+_0x538d97(0x1d8)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x525ddd,_0x22f19e)=>{const _0x3e99f9=_0x3281a1,_0x158588=_0x3178e4['get'](_0x525ddd);if(_0x158588)return _0x158588;if(_0xe83972[_0x3e99f9(0x1cd)])return _0x49f0ea[_0x3e99f9(0x19e)](_0x525ddd,_0x22f19e),createPendingActivationId(_0x525ddd);if(_0xe83972['existingJourney']){await _0x39bcab();const _0x42ed6b=_0x3178e4[_0x3e99f9(0x195)](_0x22f19e[_0x3e99f9(0x141)]);if(_0x42ed6b)return _0x3178e4[_0x3e99f9(0x19e)](_0x525ddd,_0x42ed6b),_0x42ed6b;const _0x4ba0d2=activationSignature(_0x22f19e),_0x729bde=_0x19a5ab?.[_0x3e99f9(0x195)](_0x4ba0d2);if(_0x729bde)return _0x3178e4[_0x3e99f9(0x19e)](_0x525ddd,_0x729bde),_0x729bde;const _0x40df85=await _0x1f3103(_0x22f19e,_0xeca2af[_0x3e99f9(0x1ca)]),_0x29d95f={..._0x40df85,..._0x22f19e[_0x3e99f9(0x1a6)]!==undefined&&{'runAfterJourneyRefresh':_0x22f19e[_0x3e99f9(0x1a6)]}},_0x534c48=await _0x2c6d96[_0x3e99f9(0x1f4)][_0x3e99f9(0x1b8)](_0xe83972[_0x3e99f9(0x165)]['id'],_0x29d95f);return _0x3178e4[_0x3e99f9(0x19e)](_0x525ddd,_0x534c48['id']),_0x534c48['id'];}throw new SDKError(ErrorCode[_0x3e99f9(0x1a7)],_0x3e99f9(0x1df));},'resolveJourneyId':async _0x30b72f=>{const _0x51b739=_0x3281a1;try{return await _0x2c6d96[_0x51b739(0x1f4)][_0x51b739(0x218)](_0xcff551[_0x51b739(0x200)],_0x30b72f);}catch(_0x5ab9c7){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x30b72f+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0xe83972[_0x51b739(0x1b2)][_0x51b739(0x141)]+'\x27)',_0x5ab9c7);}},'resolveStageId':async(_0x1f89ea,_0x2cfa1b)=>{const _0x88ab48=_0x3281a1,_0x51ddd9=await _0x2c6d96[_0x88ab48(0x1f4)][_0x88ab48(0x1d6)](_0x1f89ea),_0x499b2c=_0x51ddd9[_0x88ab48(0x19a)][_0x88ab48(0x15f)][_0x88ab48(0x1f9)](_0x160856=>_0x160856[_0x88ab48(0x141)][_0x88ab48(0x23d)]()===_0x2cfa1b['toLowerCase']());if(!_0x499b2c?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x2cfa1b+_0x88ab48(0x1fc)+(_0x51ddd9['attributes'][_0x88ab48(0x220)]||_0x51ddd9[_0x88ab48(0x19a)][_0x88ab48(0x141)])+'\x27');return _0x499b2c['id'];}},_0x5cd4f2=await _0x1ec4b7(_0xe83972[_0x3281a1(0x1b2)],_0xcff551[_0x3281a1(0x200)],_0x17d04a),_0x23fb8f=_0xcff551[_0x3281a1(0x229)]||_0xcff551[_0x3281a1(0x15e)];_0x23fb8f&&(_0x5cd4f2[_0x3281a1(0x232)]={'parentFolder':{'data':{'id':_0x23fb8f,'type':_0x3281a1(0x22b)}}});if(_0xe83972['isNew']){if(_0x2d7258[_0x3281a1(0x1a3)]>0x0||_0x49f0ea[_0x3281a1(0x1a3)]>0x0)return await executeThreeStepJourneyCreate(_0x2c6d96,_0xe83972,_0x5cd4f2,{'pendingEmbeddedSegments':_0x2d7258,'pendingEmbeddedActivations':_0x49f0ea,'embeddedSegmentNameToId':_0x4a1e56,'journeyActivationNameToId':_0x3178e4},{..._0xcff551,'effectiveFolderId':_0x23fb8f},_0xeca2af,_0xc3e81e,_0x206dd8);else{ensureJourneyDefaults(_0x5cd4f2[_0x3281a1(0x19a)]);const _0x4f9f75=await _0x2c6d96[_0x3281a1(0x1f4)][_0x3281a1(0x172)](_0x5cd4f2);return deletePushRecovery(_0xe83972['absolutePath']),{'action':_0x3281a1(0x1c3),'journeyId':_0x4f9f75['id'],'embeddedSegmentNameToId':_0x4a1e56};}}else{if(_0xe83972[_0x3281a1(0x21c)]&&_0xe83972[_0x3281a1(0x165)]){_0x5cd4f2['id']=_0xe83972[_0x3281a1(0x165)]['id'];const _0x2edf79=_0x5cd4f2[_0x3281a1(0x19a)];_0xe83972[_0x3281a1(0x165)][_0x3281a1(0x19a)]?.[_0x3281a1(0x220)]&&(_0x2edf79[_0x3281a1(0x220)]=_0xe83972[_0x3281a1(0x165)][_0x3281a1(0x19a)][_0x3281a1(0x220)]);const _0x392ac9=_0xe83972['existingJourney'][_0x3281a1(0x19a)]?.[_0x3281a1(0x15f)];return _0x392ac9&&_0x5cd4f2['attributes']['journeyStages']&&injectExistingStageIds(_0x5cd4f2[_0x3281a1(0x19a)][_0x3281a1(0x15f)],_0x392ac9),ensureJourneyDefaults(_0x2edf79),await _0x2c6d96['journey']['update'](_0xe83972[_0x3281a1(0x165)]['id'],_0x5cd4f2),deletePushRecovery(_0xe83972[_0x3281a1(0x16c)]),{'action':_0x3281a1(0x1db),'journeyId':_0xe83972[_0x3281a1(0x165)]['id'],'embeddedSegmentNameToId':_0x4a1e56};}}return deletePushRecovery(_0xe83972[_0x3281a1(0x16c)]),{'action':_0x3281a1(0x178),'journeyId':_0xe83972[_0x3281a1(0x165)]?.['id'],'embeddedSegmentNameToId':_0x4a1e56};}function findSegmentCriteriaLocation(_0x4aa158,_0x1dda76){const _0x14a5bc=a140_0x2bcd56,_0x38a5f9=_0x4aa158[_0x14a5bc(0x147)]||_0x4aa158['journeys']?.[0x0]?.[_0x14a5bc(0x147)]||[];let _0xde77c9=_0x14a5bc(0x1fd),_0x333c22=_0x1dda76;const _0xb48d92=_0x4aa158[_0x14a5bc(0x184)]||_0x4aa158['journeys']?.[0x0]?.['goal'];if(_0xb48d92?.['segment']===_0x1dda76)return{'stageName':'goal','criteriaName':_0xb48d92[_0x14a5bc(0x141)]||_0x1dda76};_0x7a8dc7:for(const _0x4f10ef of _0x38a5f9){if(_0x4f10ef['entry_criteria']?.[_0x14a5bc(0x169)]===_0x1dda76){_0xde77c9=_0x4f10ef[_0x14a5bc(0x141)],_0x333c22=_0x4f10ef['entry_criteria'][_0x14a5bc(0x141)]||_0x1dda76;break;}if(_0x4f10ef['steps'])for(const _0x3a1c30 of _0x4f10ef[_0x14a5bc(0x1d2)]){if(_0x3a1c30[_0x14a5bc(0x20c)]===_0x14a5bc(0x1f6)&&_0x3a1c30[_0x14a5bc(0x1bc)]?.[_0x14a5bc(0x1c8)])for(const _0x45c8eb of _0x3a1c30[_0x14a5bc(0x1bc)][_0x14a5bc(0x1c8)]){if(_0x45c8eb[_0x14a5bc(0x169)]===_0x1dda76){_0xde77c9=_0x4f10ef[_0x14a5bc(0x141)],_0x333c22=_0x45c8eb[_0x14a5bc(0x141)]||_0x1dda76;break _0x7a8dc7;}}}}return{'stageName':_0xde77c9,'criteriaName':_0x333c22};}async function executeThreeStepJourneyCreate(_0x3da9a9,_0x3279f3,_0x589401,_0x1c7d7a,_0x232682,_0x572eee,_0x42796a,_0x39f29d){const _0x15b8bb=a140_0x2bcd56,{activationDefToCreateRequest:_0x3e803a,yamlRuleToApi:_0x501ffa}=_0x39f29d,{pendingEmbeddedSegments:_0x42ced2,pendingEmbeddedActivations:_0x203893,embeddedSegmentNameToId:_0x395c89}=_0x1c7d7a,_0x2cf12b=JSON[_0x15b8bb(0x1ef)](JSON[_0x15b8bb(0x1f0)](_0x589401));ensureJourneyDefaults(_0x2cf12b[_0x15b8bb(0x19a)]),stripPendingIds(_0x2cf12b);const _0x554985=await _0x3da9a9[_0x15b8bb(0x1f4)][_0x15b8bb(0x172)](_0x2cf12b),_0x6863be=_0x554985['id'],_0x38b977=new Map();for(const _0x11368d of _0x554985['attributes'][_0x15b8bb(0x15f)]){_0x38b977[_0x15b8bb(0x19e)](_0x11368d[_0x15b8bb(0x141)][_0x15b8bb(0x23d)](),_0x11368d['id']);}recoverSegmentIdsFromPushRecovery(_0x3279f3,_0x395c89,_0x572eee['segmentNameToId']);for(const [_0x1dc4f6,{definition:_0x150915}]of _0x42ced2){if(_0x395c89['has'](_0x1dc4f6)){_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x18d),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'segmentName':_0x1dc4f6});continue;}const _0x27d573=generateDeterministicJourneySegmentName(_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],_0x1dc4f6);_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x225),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'segmentName':_0x1dc4f6});const _0x53aa89=createSegmentIdResolver(_0x572eee[_0x15b8bb(0x20e)],_0x1dc4f6),_0x2b90b5=await resolveRuleSegmentIds(_0x150915['rule'],_0x53aa89),_0x9b20a0=await createOrRecoverEmbeddedSegment(_0x3da9a9,_0x3279f3,{'localName':_0x1dc4f6,'uniqueSegmentName':_0x27d573,'description':_0x150915['description']||_0x15b8bb(0x181)+_0x1dc4f6,'journeyId':_0x6863be,'resolvedRule':_0x2b90b5,'parentId':_0x232682['parentId'],'folderId':_0x232682['effectiveFolderId']||''},_0x501ffa);_0x395c89[_0x15b8bb(0x19e)](_0x1dc4f6,_0x9b20a0),_0x572eee[_0x15b8bb(0x20e)]['set'](_0x1dc4f6,_0x9b20a0),_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x18d),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'segmentName':_0x1dc4f6});}const _0x48c637=new Map();for(const [_0x28431f,_0x425d34]of _0x203893){_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x1cb),'journeyName':_0x3279f3[_0x15b8bb(0x1b2)][_0x15b8bb(0x141)],'activationName':_0x28431f});const _0x9e2fde=await _0x3e803a(_0x425d34,_0x572eee[_0x15b8bb(0x1ca)]),_0x3804bb={..._0x9e2fde,..._0x425d34[_0x15b8bb(0x1a6)]!==undefined&&{'runAfterJourneyRefresh':_0x425d34[_0x15b8bb(0x1a6)]}},_0x3d7d8e=await _0x3da9a9[_0x15b8bb(0x1f4)][_0x15b8bb(0x1b8)](_0x6863be,_0x3804bb);_0x48c637[_0x15b8bb(0x19e)](_0x28431f,_0x3d7d8e['id']),_0x1c7d7a[_0x15b8bb(0x198)][_0x15b8bb(0x19e)](_0x28431f,_0x3d7d8e['id']),_0x42796a[_0x15b8bb(0x143)]?.({'type':_0x15b8bb(0x164),'journeyName':_0x3279f3['yamlConfig'][_0x15b8bb(0x141)],'activationName':_0x28431f});}const _0x132bd7=JSON['parse'](JSON['stringify'](_0x589401));return _0x132bd7['id']=_0x6863be,ensureJourneyDefaults(_0x132bd7[_0x15b8bb(0x19a)]),resolvePendingIdsInRequest(_0x132bd7,_0x589401,_0x38b977,_0x395c89,_0x48c637,_0x42796a),await _0x3da9a9[_0x15b8bb(0x1f4)][_0x15b8bb(0x1d5)](_0x6863be,_0x132bd7),deletePushRecovery(_0x3279f3['absolutePath']),{'action':_0x15b8bb(0x1c3),'journeyId':_0x6863be,'embeddedSegmentNameToId':_0x395c89};}export function stripWaitStepPendingIds(_0x3d97e6){const _0x336ebd=a140_0x2bcd56,_0x11db10=_0x3d97e6[_0x336ebd(0x1ac)]&&isPendingSegmentId(_0x3d97e6['conditionSegmentId']),_0x5add43=_0x3d97e6[_0x336ebd(0x1ec)]?.['some'](_0x1118af=>_0x1118af[_0x336ebd(0x149)]&&isPendingSegmentId(_0x1118af[_0x336ebd(0x149)]));(_0x11db10||_0x5add43)&&(_0x3d97e6[_0x336ebd(0x186)]=_0x336ebd(0x22d),_0x3d97e6[_0x336ebd(0x196)]=0x1,_0x3d97e6['waitStepUnit']='day',delete _0x3d97e6[_0x336ebd(0x1ac)],delete _0x3d97e6[_0x336ebd(0x1e4)],delete _0x3d97e6[_0x336ebd(0x1de)],delete _0x3d97e6[_0x336ebd(0x1ec)]);}export function resolveWaitStepPendingIds(_0x5f00f8,_0x5babb5,_0x35231d,_0x5dde92){const _0x38f8fd=a140_0x2bcd56;if(_0x5babb5[_0x38f8fd(0x1ac)]&&isPendingSegmentId(_0x5babb5[_0x38f8fd(0x1ac)])){const _0x4218f7=_0x35231d(_0x5babb5[_0x38f8fd(0x1ac)],'stage\x20\x27'+_0x5dde92+_0x38f8fd(0x1e5));_0x4218f7&&(_0x5f00f8[_0x38f8fd(0x186)]=_0x38f8fd(0x21b),_0x5f00f8['conditionSegmentId']=_0x4218f7,delete _0x5f00f8[_0x38f8fd(0x196)],delete _0x5f00f8[_0x38f8fd(0x240)],_0x5babb5[_0x38f8fd(0x1e4)]!==undefined&&(_0x5f00f8['conditionTimeoutDuration']=_0x5babb5[_0x38f8fd(0x1e4)]),_0x5babb5['conditionTimeoutUnit']&&(_0x5f00f8[_0x38f8fd(0x1de)]=_0x5babb5['conditionTimeoutUnit']));}if(_0x5babb5['conditions']){const _0x322930=_0x5babb5[_0x38f8fd(0x1ec)][_0x38f8fd(0x219)](_0x138096=>_0x138096[_0x38f8fd(0x149)]&&isPendingSegmentId(_0x138096[_0x38f8fd(0x149)]));if(_0x322930){const _0xd820cf=_0x5babb5[_0x38f8fd(0x1ec)][_0x38f8fd(0x185)](_0x5cd46d=>{const _0x30eb75=_0x38f8fd;if(_0x5cd46d[_0x30eb75(0x149)]&&isPendingSegmentId(_0x5cd46d[_0x30eb75(0x149)])){const _0x5da7f4=_0x35231d(_0x5cd46d[_0x30eb75(0x149)],_0x30eb75(0x233)+_0x5dde92+_0x30eb75(0x1e5));return{..._0x5cd46d,'segmentId':_0x5da7f4||_0x5cd46d['segmentId']};}return{..._0x5cd46d};});_0x5f00f8[_0x38f8fd(0x186)]=_0x38f8fd(0x21b),_0x5f00f8[_0x38f8fd(0x1ec)]=_0xd820cf,delete _0x5f00f8[_0x38f8fd(0x196)],delete _0x5f00f8['waitStepUnit'],delete _0x5f00f8[_0x38f8fd(0x1ac)],delete _0x5f00f8['conditionTimeoutDuration'],delete _0x5f00f8[_0x38f8fd(0x1de)];}}}function stripPendingIds(_0x52ef84){const _0xe747ae=a140_0x2bcd56;_0x52ef84[_0xe747ae(0x19a)]['goal']?.[_0xe747ae(0x149)]&&isPendingSegmentId(_0x52ef84[_0xe747ae(0x19a)][_0xe747ae(0x184)]['segmentId'])&&delete _0x52ef84[_0xe747ae(0x19a)][_0xe747ae(0x184)];for(const _0x9304d9 of _0x52ef84[_0xe747ae(0x19a)]['journeyStages']||[]){_0x9304d9[_0xe747ae(0x17b)]?.[_0xe747ae(0x149)]&&isPendingSegmentId(_0x9304d9[_0xe747ae(0x17b)][_0xe747ae(0x149)])&&delete _0x9304d9['entryCriteria'];_0x9304d9['milestone']?.[_0xe747ae(0x149)]&&isPendingSegmentId(_0x9304d9['milestone']['segmentId'])&&delete _0x9304d9[_0xe747ae(0x16e)];_0x9304d9[_0xe747ae(0x20d)]&&(_0x9304d9[_0xe747ae(0x20d)]=_0x9304d9['exitCriterias'][_0xe747ae(0x238)](_0x45ae7c=>!_0x45ae7c['segmentId']||!isPendingSegmentId(_0x45ae7c[_0xe747ae(0x149)])));if(_0x9304d9[_0xe747ae(0x1d2)])for(const _0x50e2d9 of Object['keys'](_0x9304d9[_0xe747ae(0x1d2)])){const _0x5915a2=_0x9304d9['steps'][_0x50e2d9];_0x5915a2[_0xe747ae(0x20c)]==='Activation'&&_0x5915a2[_0xe747ae(0x15a)]&&isPendingActivationId(_0x5915a2['journeyActivationStepId'])&&(_0x5915a2[_0xe747ae(0x15a)]='');if(_0x5915a2[_0xe747ae(0x20c)]===_0xe747ae(0x1e7)&&_0x5915a2[_0xe747ae(0x1c8)])for(const _0x1a972a of _0x5915a2[_0xe747ae(0x1c8)]){_0x1a972a['segmentId']&&isPendingSegmentId(_0x1a972a['segmentId'])&&(_0x1a972a['segmentId']='');}_0x5915a2[_0xe747ae(0x20c)]===_0xe747ae(0x1d4)&&stripWaitStepPendingIds(_0x5915a2);}}}function resolvePendingIdsInRequest(_0x77528f,_0x1d4ec2,_0x55086f,_0x179ad5,_0x26e1bc,_0x202914){const _0x255dbf=a140_0x2bcd56,_0x105568=(_0xfa9f03,_0x4350b7)=>{const _0x4f79e4=a140_0x275f;if(!isPendingSegmentId(_0xfa9f03))return _0xfa9f03;const _0x2f1d8c=extractPendingSegmentName(_0xfa9f03),_0x4ae419=_0x179ad5['get'](_0x2f1d8c);return!_0x4ae419&&_0x202914[_0x4f79e4(0x202)]?.(_0x4f79e4(0x1bb)+_0x2f1d8c+_0x4f79e4(0x151)+_0x4350b7),_0x4ae419;};if(_0x77528f['attributes'][_0x255dbf(0x184)]?.[_0x255dbf(0x149)]&&isPendingSegmentId(_0x77528f['attributes'][_0x255dbf(0x184)]['segmentId'])){const _0x138a60=_0x105568(_0x77528f[_0x255dbf(0x19a)][_0x255dbf(0x184)]['segmentId'],_0x255dbf(0x16d));_0x138a60&&(_0x77528f[_0x255dbf(0x19a)][_0x255dbf(0x184)]['segmentId']=_0x138a60);}for(const _0x280a5f of _0x77528f[_0x255dbf(0x19a)][_0x255dbf(0x15f)]||[]){const _0xe2754b=_0x55086f[_0x255dbf(0x195)](_0x280a5f['name'][_0x255dbf(0x23d)]());_0xe2754b&&(_0x280a5f['id']=_0xe2754b);if(_0x280a5f[_0x255dbf(0x17b)]?.['segmentId']&&isPendingSegmentId(_0x280a5f['entryCriteria'][_0x255dbf(0x149)])){const _0x460ee0=_0x105568(_0x280a5f[_0x255dbf(0x17b)][_0x255dbf(0x149)],_0x255dbf(0x233)+_0x280a5f[_0x255dbf(0x141)]+_0x255dbf(0x1b1));_0x460ee0&&(_0x280a5f[_0x255dbf(0x17b)]['segmentId']=_0x460ee0);}if(_0x280a5f[_0x255dbf(0x20d)])for(const _0x3bd0df of _0x280a5f['exitCriterias']){if(_0x3bd0df[_0x255dbf(0x149)]&&isPendingSegmentId(_0x3bd0df[_0x255dbf(0x149)])){const _0x2c4173=_0x105568(_0x3bd0df[_0x255dbf(0x149)],_0x255dbf(0x233)+_0x280a5f['name']+'\x27\x20exit\x20criteria');_0x2c4173&&(_0x3bd0df['segmentId']=_0x2c4173);}}if(_0x280a5f['milestone']?.[_0x255dbf(0x149)]&&isPendingSegmentId(_0x280a5f[_0x255dbf(0x16e)][_0x255dbf(0x149)])){const _0x4e20f0=_0x105568(_0x280a5f[_0x255dbf(0x16e)][_0x255dbf(0x149)],_0x255dbf(0x233)+_0x280a5f[_0x255dbf(0x141)]+_0x255dbf(0x1a8));_0x4e20f0&&(_0x280a5f[_0x255dbf(0x16e)]['segmentId']=_0x4e20f0);}if(_0x280a5f[_0x255dbf(0x1d2)]){const _0x5c01a6=_0x4460bd=>_0x1d4ec2[_0x255dbf(0x19a)]['journeyStages']?.[_0x255dbf(0x1f9)](_0x2359a8=>_0x2359a8[_0x255dbf(0x141)][_0x255dbf(0x23d)]()===_0x280a5f['name'][_0x255dbf(0x23d)]())?.[_0x255dbf(0x1d2)]?.[_0x4460bd];for(const _0x7cf702 of Object[_0x255dbf(0x19f)](_0x280a5f[_0x255dbf(0x1d2)])){const _0x47b592=_0x280a5f['steps'][_0x7cf702],_0x1c1619=_0x5c01a6(_0x7cf702);if(_0x47b592[_0x255dbf(0x20c)]===_0x255dbf(0x1b6)&&_0x47b592[_0x255dbf(0x15a)]&&(isPendingActivationId(_0x47b592[_0x255dbf(0x15a)])||_0x47b592[_0x255dbf(0x15a)]==='')){if(_0x1c1619?.[_0x255dbf(0x15a)]&&isPendingActivationId(_0x1c1619[_0x255dbf(0x15a)])){const _0x14db5f=extractPendingActivationName(_0x1c1619[_0x255dbf(0x15a)]),_0x441187=_0x26e1bc[_0x255dbf(0x195)](_0x14db5f);_0x441187&&(_0x47b592[_0x255dbf(0x15a)]=_0x441187);}}if(_0x47b592['type']===_0x255dbf(0x1e7)&&_0x47b592[_0x255dbf(0x1c8)]&&_0x1c1619?.[_0x255dbf(0x1c8)])for(let _0x427715=0x0;_0x427715<_0x47b592[_0x255dbf(0x1c8)]['length'];_0x427715++){const _0x259557=_0x47b592[_0x255dbf(0x1c8)][_0x427715],_0x295c39=_0x1c1619['branches'][_0x427715];if(_0x295c39?.[_0x255dbf(0x149)]&&isPendingSegmentId(_0x295c39[_0x255dbf(0x149)])){const _0x1480ad=_0x105568(_0x295c39['segmentId'],'stage\x20\x27'+_0x280a5f['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x259557[_0x255dbf(0x141)]||_0x427715)+'\x27');_0x1480ad&&(_0x259557[_0x255dbf(0x149)]=_0x1480ad);}}_0x47b592['type']==='WaitStep'&&_0x1c1619?.[_0x255dbf(0x20c)]===_0x255dbf(0x1d4)&&resolveWaitStepPendingIds(_0x47b592,_0x1c1619,_0x105568,_0x280a5f[_0x255dbf(0x141)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5dbaa4,_0x317a90){const _0x1658d4=a141_0x3a25,_0x4e3e2a=_0x5dbaa4();while(!![]){try{const _0x30aaa7=parseInt(_0x1658d4(0x17d))/0x1+-parseInt(_0x1658d4(0x17f))/0x2*(parseInt(_0x1658d4(0x17e))/0x3)+-parseInt(_0x1658d4(0x17c))/0x4*(parseInt(_0x1658d4(0x176))/0x5)+parseInt(_0x1658d4(0x17b))/0x6*(parseInt(_0x1658d4(0x184))/0x7)+parseInt(_0x1658d4(0x178))/0x8*(parseInt(_0x1658d4(0x177))/0x9)+-parseInt(_0x1658d4(0x181))/0xa+parseInt(_0x1658d4(0x185))/0xb;if(_0x30aaa7===_0x317a90)break;else _0x4e3e2a['push'](_0x4e3e2a['shift']());}catch(_0x40518e){_0x4e3e2a['push'](_0x4e3e2a['shift']());}}}(a141_0xdb91,0x7975e));function a141_0x3a25(_0xb0b1d9,_0x4c3928){_0xb0b1d9=_0xb0b1d9-0x176;const _0xdb9117=a141_0xdb91();let _0x3a25c0=_0xdb9117[_0xb0b1d9];return _0x3a25c0;}export function buildFolderIdToPathMap(_0x49ab88){const _0x197c8e=a141_0x3a25,_0x100ac0=new Map(),_0x3702ff=new Map();for(const _0x4e94df of _0x49ab88){_0x3702ff[_0x197c8e(0x179)](_0x4e94df['id'],_0x4e94df);}const _0xbb5564=new Set();for(const _0x267d5e of _0x49ab88){!_0x267d5e[_0x197c8e(0x186)]&&_0xbb5564['add'](_0x267d5e['id']);}function _0x10391e(_0x468e08){const _0x12c1da=_0x197c8e;if(_0x100ac0['has'](_0x468e08['id']))return _0x100ac0['get'](_0x468e08['id']);if(_0xbb5564[_0x12c1da(0x17a)](_0x468e08['id']))return _0x100ac0[_0x12c1da(0x179)](_0x468e08['id'],''),'';if(_0x468e08[_0x12c1da(0x186)]){const _0x1cc16f=_0x3702ff['get'](_0x468e08[_0x12c1da(0x186)]);if(_0x1cc16f){const _0x1b3e63=_0x10391e(_0x1cc16f),_0x3505c0=_0x1b3e63?_0x1b3e63+'/'+_0x468e08[_0x12c1da(0x182)]:_0x468e08[_0x12c1da(0x182)];return _0x100ac0[_0x12c1da(0x179)](_0x468e08['id'],_0x3505c0),_0x3505c0;}}const _0x338835=_0x468e08['name'];return _0x100ac0[_0x12c1da(0x179)](_0x468e08['id'],_0x338835),_0x338835;}for(const _0x417688 of _0x49ab88){_0x10391e(_0x417688);}return _0x100ac0;}export function buildFolderPathToIdMap(_0x2fad46){const _0x499ca4=a141_0x3a25,_0x4df4bd=new Map(),_0x272013=new Map();for(const _0x370377 of _0x2fad46){_0x272013[_0x499ca4(0x179)](_0x370377['id'],_0x370377);}const _0xd228ea=new Set();for(const _0x2c9a12 of _0x2fad46){!_0x2c9a12[_0x499ca4(0x186)]&&_0xd228ea[_0x499ca4(0x183)](_0x2c9a12['id']);}function _0xd70b(_0xa2a7f2){const _0x228597=_0x499ca4;if(_0xd228ea[_0x228597(0x17a)](_0xa2a7f2['id']))return'';if(_0xa2a7f2[_0x228597(0x186)]){const _0xb05136=_0x272013[_0x228597(0x180)](_0xa2a7f2[_0x228597(0x186)]);if(_0xb05136){const _0x1589a0=_0xd70b(_0xb05136);return _0x1589a0?_0x1589a0+'/'+_0xa2a7f2[_0x228597(0x182)]:_0xa2a7f2['name'];}}return _0xa2a7f2['name'];}for(const _0x2b2332 of _0x2fad46){const _0x4d0666=_0xd70b(_0x2b2332);_0x4df4bd[_0x499ca4(0x179)](_0x4d0666,_0x2b2332['id']);}return _0x4df4bd;}function a141_0xdb91(){const _0x2881cc=['10947761WYOlvb','parentFolderId','205ISWvtg','380223GvlkHJ','32QmaiRF','set','has','16494bixlEC','50156rcAWVl','407790dilqib','283914lpzVjv','12KPEJqA','get','4022010dEimkV','name','add','1043MyXdhk'];a141_0xdb91=function(){return _0x2881cc;};return a141_0xdb91();}export function buildFolderMaps(_0x1bfab9){const _0x55ac06=buildFolderIdToPathMap(_0x1bfab9),_0x205764=new Map();for(const [_0x46df65,_0xfc3f8a]of _0x55ac06){_0x205764['set'](_0xfc3f8a,_0x46df65);}return{'idToPath':_0x55ac06,'pathToId':_0x205764};}export function getFolderPath(_0x388f5c,_0x738004){const _0x20b03b=a141_0x3a25;if(!_0x388f5c)return'';return _0x738004[_0x20b03b(0x180)](_0x388f5c)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5ce5fd,_0x120717){const _0x5571f1=a142_0x5d42,_0x45d0cf=_0x5ce5fd();while(!![]){try{const _0x52e5bd=parseInt(_0x5571f1(0x1ef))/0x1*(-parseInt(_0x5571f1(0x20e))/0x2)+-parseInt(_0x5571f1(0x1f0))/0x3+-parseInt(_0x5571f1(0x1ee))/0x4*(parseInt(_0x5571f1(0x1fa))/0x5)+parseInt(_0x5571f1(0x216))/0x6+-parseInt(_0x5571f1(0x218))/0x7+parseInt(_0x5571f1(0x1fd))/0x8*(parseInt(_0x5571f1(0x208))/0x9)+parseInt(_0x5571f1(0x1f3))/0xa*(parseInt(_0x5571f1(0x214))/0xb);if(_0x52e5bd===_0x120717)break;else _0x45d0cf['push'](_0x45d0cf['shift']());}catch(_0x49f04e){_0x45d0cf['push'](_0x45d0cf['shift']());}}}(a142_0x9ca3,0x3a872));import a142_0x282c3c from'path';import{parse as a142_0x31ae3e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x8cefe0){const _0x3b267a=a142_0x5d42;if(!_0x8cefe0||_0x8cefe0[_0x3b267a(0x217)]()==='')throw new Error(_0x3b267a(0x201));const _0x5d4dcf=_0x8cefe0[_0x3b267a(0x217)]();if(_0x5d4dcf==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x8cefe0};const _0x148064=_0x5d4dcf[_0x3b267a(0x203)]('/')?_0x5d4dcf['substring'](0x1):_0x5d4dcf,_0x3b7094=_0x148064['split']('/')['filter'](_0x67781b=>_0x67781b!=='');if(_0x3b7094[_0x3b267a(0x20c)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x3d9bab=_0x5d4dcf[_0x3b267a(0x203)]('/')||!isRelativePathSegment(_0x3b7094[0x0]);for(const _0x5dd255 of _0x3b7094){validatePathSegment(_0x5dd255);}return{'segments':_0x3b7094,'isAbsolute':_0x3d9bab,'raw':_0x8cefe0};}function isRelativePathSegment(_0x4860d4){return _0x4860d4==='.'||_0x4860d4==='..';}function validatePathSegment(_0x36ff42){const _0x53de52=a142_0x5d42;if(_0x36ff42==='')throw new Error(_0x53de52(0x1fc));if(_0x36ff42==='.'||_0x36ff42==='..')return;if(/[\x00-\x1F\x7F]/[_0x53de52(0x206)](_0x36ff42))throw new Error(_0x53de52(0x211)+_0x36ff42);if(_0x36ff42!==_0x36ff42['trim']()){}}export function validatePath(_0x949655){const _0x14d4d2=a142_0x5d42;if(_0x949655['segments']['length']===0x0&&!_0x949655['isAbsolute'])throw new Error(_0x14d4d2(0x21a));if(_0x949655[_0x14d4d2(0x1f8)]){if(_0x949655[_0x14d4d2(0x204)][0x0]==='..')throw new Error(_0x14d4d2(0x21c));let _0xa37bc9=0x0;for(const _0x20d3c4 of _0x949655[_0x14d4d2(0x204)]){if(_0x20d3c4==='..'){if(_0xa37bc9===0x0)throw new Error(_0x14d4d2(0x1f5));_0xa37bc9--;}else _0x20d3c4!=='.'&&_0xa37bc9++;}}}export function joinPaths(_0x39d890,_0x1f262f){const _0x2ebd12=a142_0x5d42;if(!_0x39d890||_0x39d890==='/')return _0x1f262f;if(!_0x1f262f||_0x1f262f==='.')return _0x39d890;if(_0x1f262f[_0x2ebd12(0x203)]('/'))return _0x1f262f;const _0x2d56ef=parsePath(_0x39d890),_0x140b4d=parsePath(_0x1f262f),_0x1b2301=[..._0x2d56ef[_0x2ebd12(0x204)]];for(const _0x37adff of _0x140b4d[_0x2ebd12(0x204)]){if(_0x37adff==='.')continue;else{if(_0x37adff==='..'){if(_0x1b2301['length']===0x0)throw new Error(_0x2ebd12(0x20b));_0x1b2301[_0x2ebd12(0x1f2)]();}else _0x1b2301[_0x2ebd12(0x1fe)](_0x37adff);}}const _0x2770e4=_0x1b2301[_0x2ebd12(0x219)]('/');return _0x2d56ef['raw']['startsWith']('/')?'/'+_0x2770e4:_0x2770e4;}export function normalizePath(_0x17abfc){const _0x15ae7d=a142_0x5d42,_0x105a68=parsePath(_0x17abfc),_0x574dc2=[];for(const _0x2031ee of _0x105a68['segments']){if(_0x2031ee==='.')continue;else{if(_0x2031ee==='..'){if(_0x574dc2[_0x15ae7d(0x20c)]===0x0){if(_0x105a68[_0x15ae7d(0x1f8)])throw new Error(_0x15ae7d(0x20b));_0x574dc2[_0x15ae7d(0x1fe)]('..');}else _0x574dc2[_0x574dc2[_0x15ae7d(0x20c)]-0x1]==='..'?_0x574dc2[_0x15ae7d(0x1fe)]('..'):_0x574dc2['pop']();}else _0x574dc2[_0x15ae7d(0x1fe)](_0x2031ee);}}if(_0x574dc2[_0x15ae7d(0x20c)]===0x0)return _0x105a68[_0x15ae7d(0x1f8)]?'/':'.';const _0x259114=_0x574dc2['join']('/');return _0x105a68[_0x15ae7d(0x20f)]['startsWith']('/')?'/'+_0x259114:_0x259114;}export function getParentPath(_0x4c0bf4){const _0x3bfdb4=a142_0x5d42,_0x2c876f=parsePath(_0x4c0bf4);if(_0x2c876f[_0x3bfdb4(0x204)]['length']<=0x1)return'/';const _0x225def=_0x2c876f[_0x3bfdb4(0x204)]['slice'](0x0,-0x1)[_0x3bfdb4(0x219)]('/');return _0x2c876f['raw'][_0x3bfdb4(0x203)]('/')?'/'+_0x225def:_0x225def;}export function getBaseName(_0x3e926b){const _0x2e7824=a142_0x5d42,_0x120140=parsePath(_0x3e926b);return _0x120140[_0x2e7824(0x204)][_0x120140[_0x2e7824(0x204)][_0x2e7824(0x20c)]-0x1]||'';}function a142_0x5d42(_0x508945,_0x509716){_0x508945=_0x508945-0x1ed;const _0x9ca3c=a142_0x9ca3();let _0x5d420a=_0x9ca3c[_0x508945];return _0x5d420a;}export function isChildPath(_0x413654,_0x27ebed){const _0x1771ad=a142_0x5d42,_0xfecad=parsePath(_0x413654),_0x1996b6=parsePath(_0x27ebed);if(_0xfecad[_0x1771ad(0x204)][_0x1771ad(0x20c)]<=_0x1996b6[_0x1771ad(0x204)]['length'])return![];for(let _0x27101f=0x0;_0x27101f<_0x1996b6[_0x1771ad(0x204)][_0x1771ad(0x20c)];_0x27101f++){if(_0xfecad[_0x1771ad(0x204)][_0x27101f]!==_0x1996b6[_0x1771ad(0x204)][_0x27101f])return![];}return!![];}export function splitPath(_0x57e701){const _0x20a8d6=a142_0x5d42,_0x154315=parsePath(_0x57e701);if(_0x154315[_0x20a8d6(0x204)][_0x20a8d6(0x20c)]===0x0)throw new Error(_0x20a8d6(0x213));if(_0x154315[_0x20a8d6(0x204)][_0x20a8d6(0x20c)]===0x1)return{'parent':_0x154315['segments'][0x0]};return{'parent':_0x154315[_0x20a8d6(0x204)][0x0],'child':_0x154315[_0x20a8d6(0x204)]['slice'](0x1)[_0x20a8d6(0x219)]('/')};}function a142_0x9ca3(){const _0xdb4739=['startsWith','segments','name','test','endsWith','45BGklCR','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','root','Cannot\x20navigate\x20above\x20root','length','replace','402958xCFCpw','raw','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','parent_segment','Cannot\x20split\x20empty\x20path','77352vYjeew','segment','332220xvGRtj','trim','3300696MdJrvM','join','Relative\x20path\x20cannot\x20be\x20empty','readFile','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parse','292FiZKTx','2uAwsVq','357741YTwwTN','exists','pop','1770slSdVm','type','Path\x20attempts\x20to\x20navigate\x20above\x20root','No\x20tdx.json\x20found\x20for\x20file:\x20','relative','isAbsolute','journey','32760xoVBKE','tdx.json','Path\x20segment\x20cannot\x20be\x20empty','658760qRphvJ','push','dirname','.yml','Path\x20cannot\x20be\x20empty','File\x20not\x20found:\x20'];a142_0x9ca3=function(){return _0xdb4739;};return a142_0x9ca3();}export function isYamlFilePath(_0x3d7a3c){const _0x1906fb=a142_0x5d42;return _0x3d7a3c[_0x1906fb(0x207)](_0x1906fb(0x200))||_0x3d7a3c[_0x1906fb(0x207)]('.yaml');}export async function resolveYamlFilePath(_0x1798e7,_0x432faa=nodeFileSystem){const _0x22a1ce=a142_0x5d42,_0x5019b2=a142_0x282c3c['resolve'](_0x1798e7);if(!await _0x432faa['exists'](_0x5019b2))throw new Error(_0x22a1ce(0x202)+_0x1798e7);let _0x1e8751=a142_0x282c3c[_0x22a1ce(0x1ff)](_0x5019b2),_0x91b74=null,_0x24086f=null;const _0x286f91=a142_0x282c3c[_0x22a1ce(0x1ed)](_0x1e8751)[_0x22a1ce(0x20a)];while(_0x1e8751!==_0x286f91){const _0x1e3bd4=a142_0x282c3c[_0x22a1ce(0x219)](_0x1e8751,_0x22a1ce(0x1fb));if(await _0x432faa[_0x22a1ce(0x1f1)](_0x1e3bd4)){_0x91b74=_0x1e3bd4,_0x24086f=_0x1e8751;break;}_0x1e8751=a142_0x282c3c[_0x22a1ce(0x1ff)](_0x1e8751);}if(!_0x91b74||!_0x24086f)throw new Error(_0x22a1ce(0x1f6)+_0x1798e7+'\x0a'+_0x22a1ce(0x210));const _0x16e6d7=await _0x432faa[_0x22a1ce(0x21b)](_0x91b74),_0x15f98c=JSON[_0x22a1ce(0x1ed)](_0x16e6d7),_0x4f0650=_0x15f98c[_0x22a1ce(0x212)];if(!_0x4f0650)throw new Error(_0x22a1ce(0x209));const _0x30551d=await _0x432faa['readFile'](_0x5019b2),_0x48bfa6=a142_0x31ae3e(_0x30551d),_0xf9b9ef=_0x48bfa6[_0x22a1ce(0x205)];if(!_0xf9b9ef)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x1798e7);const _0xfea5fc=_0x48bfa6[_0x22a1ce(0x1f4)]===_0x22a1ce(0x1f9)?_0x22a1ce(0x1f9):_0x22a1ce(0x215),_0x272348=a142_0x282c3c[_0x22a1ce(0x1f7)](_0x24086f,_0x5019b2),_0x4d459b=a142_0x282c3c['dirname'](_0x272348),_0x377e18=_0x4d459b==='.'?'':_0x4d459b[_0x22a1ce(0x20d)](/\\/g,'/'),_0x117cad=_0x377e18?_0x4f0650+'/'+_0x377e18+'/'+_0xf9b9ef:_0x4f0650+'/'+_0xf9b9ef;return{'parentSegment':_0x4f0650,'segmentName':_0xf9b9ef,'folderPath':_0x377e18,'fullPath':_0x117cad,'resourceType':_0xfea5fc,'content':_0x30551d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x54ac09,_0x362afe){const _0x509b3c=a143_0x5821,_0x5057d1=_0x54ac09();while(!![]){try{const _0x84cbe1=parseInt(_0x509b3c(0x174))/0x1*(parseInt(_0x509b3c(0x178))/0x2)+parseInt(_0x509b3c(0x180))/0x3*(-parseInt(_0x509b3c(0x17f))/0x4)+parseInt(_0x509b3c(0x176))/0x5+parseInt(_0x509b3c(0x172))/0x6+parseInt(_0x509b3c(0x173))/0x7*(-parseInt(_0x509b3c(0x17b))/0x8)+-parseInt(_0x509b3c(0x17a))/0x9+-parseInt(_0x509b3c(0x17d))/0xa*(-parseInt(_0x509b3c(0x17c))/0xb);if(_0x84cbe1===_0x362afe)break;else _0x5057d1['push'](_0x5057d1['shift']());}catch(_0xdcd0c8){_0x5057d1['push'](_0x5057d1['shift']());}}}(a143_0x4177,0x66db2));function a143_0x5821(_0x28b541,_0x17cb86){_0x28b541=_0x28b541-0x172;const _0x417740=a143_0x4177();let _0x5821bf=_0x417740[_0x28b541];return _0x5821bf;}export function parseSegmentRef(_0x2dcda0){const _0x5414a6=a143_0x5821,_0x2750e4=_0x2dcda0[_0x5414a6(0x175)]('/');if(_0x2750e4===-0x1)return{'parentId':_0x2dcda0};if(_0x2750e4===0x0)throw new Error(_0x5414a6(0x179)+_0x2dcda0+_0x5414a6(0x17e));const _0x30fac3=_0x2dcda0[_0x5414a6(0x177)](0x0,_0x2750e4),_0x4b33b6=_0x2dcda0[_0x5414a6(0x177)](_0x2750e4+0x1);if(_0x4b33b6==='')throw new Error(_0x5414a6(0x179)+_0x2dcda0+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x30fac3,'childId':_0x4b33b6};}function a143_0x4177(){const _0x4d319d=['287iyoRAk','191hvJCMs','indexOf','2200930fmpdCo','substring','3666amFYTs','Invalid\x20segment\x20reference\x20format:\x20','3038175XgkXbj','20392ASyYWl','33ZLffOm','428020nbkrbI','.\x20Parent\x20name\x20cannot\x20be\x20empty','1353584xnmKve','3JHsEpC','1698498QMNocl'];a143_0x4177=function(){return _0x4d319d;};return a143_0x4177();}
|