@treasuredata/tdx 2026.3.22 → 2026.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.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
|
-
|
|
1
|
+
const a141_0x39b92e=a141_0x273c;(function(_0x57a756,_0x5e51cc){const _0x2d8732=a141_0x273c,_0x296052=_0x57a756();while(!![]){try{const _0x151e7d=-parseInt(_0x2d8732(0x146))/0x1+-parseInt(_0x2d8732(0x134))/0x2*(-parseInt(_0x2d8732(0x13a))/0x3)+parseInt(_0x2d8732(0x14c))/0x4*(parseInt(_0x2d8732(0x139))/0x5)+-parseInt(_0x2d8732(0x137))/0x6*(-parseInt(_0x2d8732(0x135))/0x7)+-parseInt(_0x2d8732(0x13f))/0x8+parseInt(_0x2d8732(0x13b))/0x9+parseInt(_0x2d8732(0x140))/0xa*(-parseInt(_0x2d8732(0x138))/0xb);if(_0x151e7d===_0x5e51cc)break;else _0x296052['push'](_0x296052['shift']());}catch(_0x364660){_0x296052['push'](_0x296052['shift']());}}}(a141_0x58c4,0x49296));function a141_0x58c4(){const _0x37fba2=['journeyName','parse','.push-recovery.json','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','1928056IUtRsv','tdx.sdk.push-recovery','ENOENT','dirname','segments','9700JoxJPt','21SUxzkH','code','937518DSsQop','3820388ctPPCY','5peEbho','30zEDFdd','3119742LQmBOO','toISOString','debug','.tmp','944480wXmuNJ','10LBdVDA','version','utf-8','warn','string','join','580873PxUzsG','stringify'];a141_0x58c4=function(){return _0x37fba2;};return a141_0x58c4();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a141_0x1836b7 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a141_0x39b92e(0x130));export function getPushRecoveryPath(_0x53894c){const _0xd700af=a141_0x39b92e,_0x1c4d40=a141_0x1836b7[_0xd700af(0x132)](_0x53894c),_0x406037=a141_0x1836b7['basename'](_0x53894c);return a141_0x1836b7[_0xd700af(0x145)](_0x1c4d40,'.'+_0x406037+_0xd700af(0x14a));}function a141_0x273c(_0x228ef0,_0x3aa800){_0x228ef0=_0x228ef0-0x130;const _0x58c404=a141_0x58c4();let _0x273c90=_0x58c404[_0x228ef0];return _0x273c90;}export function readPushRecovery(_0x5c7d90){const _0x569308=a141_0x39b92e,_0x671145=getPushRecoveryPath(_0x5c7d90);if(!existsSync(_0x671145))return undefined;try{const _0x65dd80=readFileSync(_0x671145,_0x569308(0x142)),_0x3f2a31=JSON[_0x569308(0x149)](_0x65dd80);if(_0x3f2a31?.[_0x569308(0x141)]!==0x1||typeof _0x3f2a31[_0x569308(0x148)]!==_0x569308(0x144))return undefined;return _0x3f2a31;}catch(_0x2154a4){return _0x2154a4 instanceof SyntaxError?logger[_0x569308(0x13d)](_0x569308(0x14b)+_0x2154a4):logger[_0x569308(0x143)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x2154a4),undefined;}}export function writePushRecovery(_0x1c84bb,_0x3075a2){const _0x536f25=a141_0x39b92e,_0xaa5ee6=getPushRecoveryPath(_0x1c84bb),_0x3d1c23=_0xaa5ee6+_0x536f25(0x13e);writeFileSync(_0x3d1c23,JSON[_0x536f25(0x147)](_0x3075a2,null,0x2)+'\x0a','utf-8'),renameSync(_0x3d1c23,_0xaa5ee6);}export function deletePushRecovery(_0x2510ec){const _0x557ceb=a141_0x39b92e,_0x62b188=getPushRecoveryPath(_0x2510ec);try{unlinkSync(_0x62b188);}catch(_0x1c4448){_0x1c4448[_0x557ceb(0x136)]!==_0x557ceb(0x131)&&logger[_0x557ceb(0x13d)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x1c4448);}}export function saveSegmentToPushRecovery(_0x5c16f5,_0xc07eea,_0x57ba64,_0x44bea3){const _0x79c99d=a141_0x39b92e,_0x2588fe=readPushRecovery(_0x5c16f5),_0x6d905a=_0x2588fe?.['journeyName']===_0xc07eea?{..._0x2588fe,'updatedAt':new Date()[_0x79c99d(0x13c)]()}:{'version':0x1,'journeyName':_0xc07eea,'updatedAt':new Date()[_0x79c99d(0x13c)](),'segments':{}};_0x6d905a[_0x79c99d(0x133)][_0x57ba64]=_0x44bea3,writePushRecovery(_0x5c16f5,_0x6d905a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a142_0x420e71=a142_0x1102;(function(_0x412528,_0x14e260){const _0xda0a69=a142_0x1102,_0x13b2dc=_0x412528();while(!![]){try{const _0x2f8ca4=-parseInt(_0xda0a69(0x11b))/0x1+-parseInt(_0xda0a69(0x14a))/0x2*(parseInt(_0xda0a69(0x15e))/0x3)+-parseInt(_0xda0a69(0x20d))/0x4+-parseInt(_0xda0a69(0x1f2))/0x5+-parseInt(_0xda0a69(0x18d))/0x6+parseInt(_0xda0a69(0x1df))/0x7*(-parseInt(_0xda0a69(0x175))/0x8)+parseInt(_0xda0a69(0x1a8))/0x9*(parseInt(_0xda0a69(0x204))/0xa);if(_0x2f8ca4===_0x14e260)break;else _0x13b2dc['push'](_0x13b2dc['shift']());}catch(_0xe291fb){_0x13b2dc['push'](_0x13b2dc['shift']());}}}(a142_0x161b,0xef82f));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a142_0x420e71(0x1ee);export function createPendingSegmentId(_0x20303d){return''+PENDING_SEGMENT_PREFIX+_0x20303d+'__';}export function isPendingSegmentId(_0x24dd54){const _0x3e4c87=a142_0x420e71;return _0x24dd54['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x24dd54[_0x3e4c87(0x194)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x54f6dc){const _0x3b57f7=a142_0x420e71;return _0x54f6dc[_0x3b57f7(0x1cc)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5316e2){return''+PENDING_ACTIVATION_PREFIX+_0x5316e2+'__';}export function isPendingActivationId(_0x2340e2){const _0x32978c=a142_0x420e71;return _0x2340e2[_0x32978c(0x194)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x486d67){const _0x246140=a142_0x420e71;return _0x486d67[_0x246140(0x1cc)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xd79b0e,_0x59e768){const _0x3ee0cd=a142_0x420e71,_0xdff49b=_0xd79b0e+'::'+(_0x59e768[_0x3ee0cd(0x145)]()||_0x3ee0cd(0x1e2)),_0xc48be0=createHash(_0x3ee0cd(0x191))['update'](_0xdff49b)[_0x3ee0cd(0x186)](_0x3ee0cd(0x140))[_0x3ee0cd(0x1ec)](0x0,0xc);return _0x3ee0cd(0x152)+_0xc48be0;}export function ensureJourneyDefaults(_0x52544b){const _0x22c2b5=a142_0x420e71;!_0x52544b[_0x22c2b5(0x131)]&&(_0x52544b['description']=''),!_0x52544b['state']&&(_0x52544b['state']=_0x22c2b5(0x1fa));}export function injectExistingStageIds(_0x1e11e4,_0x4dd1d3){const _0x13a950=a142_0x420e71,_0x108165=new Map(_0x4dd1d3['map'](_0x26a0d4=>[_0x26a0d4['name'],_0x26a0d4['id']]));for(const _0x5e29f8 of _0x1e11e4){if(!_0x5e29f8['id']){const _0x4cca69=_0x108165[_0x13a950(0x11c)](_0x5e29f8[_0x13a950(0x203)]);_0x4cca69&&(_0x5e29f8['id']=_0x4cca69);}}}export function resolveTDFolderPath(_0x3af5a9,_0x34c048,_0x10be1a){const _0x121700=a142_0x420e71;if(!_0x34c048)return _0x3af5a9;if(_0x3af5a9===_0x10be1a||_0x3af5a9[_0x121700(0x194)](_0x10be1a+'/'))return _0x3af5a9;return _0x3af5a9?_0x10be1a+'/'+_0x3af5a9:_0x10be1a;}export function addFoldersToCreate(_0x37db9b,_0x426229,_0x512c93){const _0x95c86c=a142_0x420e71;if(!_0x37db9b)return;if(_0x426229['has'](_0x37db9b))return;const _0x287c41=_0x37db9b[_0x95c86c(0x1c5)]('/');let _0x33bd92='';for(const _0x35faef of _0x287c41){_0x33bd92=_0x33bd92?_0x33bd92+'/'+_0x35faef:_0x35faef,!_0x426229['has'](_0x33bd92)&&_0x512c93[_0x95c86c(0x166)](_0x33bd92);}}export function sortFoldersByDepth(_0x12b25c){const _0x52ac1d=a142_0x420e71;return[..._0x12b25c][_0x52ac1d(0x1f4)]((_0x3841e0,_0x28c98e)=>{const _0x1fe76b=_0x52ac1d,_0x3c1630=(_0x3841e0[_0x1fe76b(0x1ad)](/\//g)||[])['length'],_0x355306=(_0x28c98e[_0x1fe76b(0x1ad)](/\//g)||[])['length'];return _0x3c1630-_0x355306;});}import*as a142_0x18c254 from'yaml';import{readFileSync}from'fs';import a142_0x30d89b from'path';import{isJourneyDef,parseYamlString as a142_0x55284e,toYamlString as a142_0x5bf15a,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(_0x474a1a){const _0x13ab0a=a142_0x420e71;if(Array[_0x13ab0a(0x12d)](_0x474a1a))return'['+_0x474a1a[_0x13ab0a(0x209)](_0xdf2a8=>stableStringify(_0xdf2a8))[_0x13ab0a(0x1f5)](',')+']';if(_0x474a1a&&typeof _0x474a1a==='object'){const _0xf212d6=_0x474a1a,_0x4412d2=Object[_0x13ab0a(0x14c)](_0xf212d6)[_0x13ab0a(0x1f4)](),_0x19e418=_0x4412d2[_0x13ab0a(0x209)](_0x5015e8=>'\x22'+_0x5015e8+'\x22:'+stableStringify(_0xf212d6[_0x5015e8]));return'{'+_0x19e418[_0x13ab0a(0x1f5)](',')+'}';}const _0x4a1959=JSON[_0x13ab0a(0x1e3)](_0x474a1a);return _0x4a1959===undefined?'null':_0x4a1959;}function activationSignature(_0x2a506f){const _0x523230=a142_0x420e71,_0x234edb={'connection':_0x2a506f[_0x523230(0x19d)],..._0x2a506f['all_columns']!==undefined&&{'all_columns':_0x2a506f['all_columns']},..._0x2a506f[_0x523230(0x127)]!==undefined&&{'columns':_0x2a506f['columns']},..._0x2a506f[_0x523230(0x1d7)]!==undefined&&{'behavior':_0x2a506f['behavior']},..._0x2a506f['schedule']!==undefined&&{'schedule':_0x2a506f[_0x523230(0x156)]},..._0x2a506f[_0x523230(0x183)]!==undefined&&{'notification':_0x2a506f[_0x523230(0x183)]},..._0x2a506f[_0x523230(0x1bd)]!==undefined&&{'connector_config':_0x2a506f[_0x523230(0x1bd)]},..._0x2a506f[_0x523230(0x178)]!==undefined&&{'activation_template_id':_0x2a506f[_0x523230(0x178)]}};return stableStringify(_0x234edb);}function a142_0x1102(_0x151eef,_0x36e3d8){_0x151eef=_0x151eef-0x117;const _0x161bb9=a142_0x161b();let _0x1102d4=_0x161bb9[_0x151eef];return _0x1102d4;}async function fetchSegment(_0x34198f,_0x548df9,_0x69a0fb,_0x52c659){const _0x48758d=a142_0x420e71,_0x32172a=_0x52c659?.[_0x48758d(0x172)](_0x1348cc=>_0x1348cc['id']===_0x69a0fb);if(_0x32172a)return _0x32172a;try{return await _0x34198f['segment'][_0x48758d(0x182)](_0x548df9,_0x69a0fb);}catch(_0x4c0502){logger[_0x48758d(0x1e7)](_0x48758d(0x144)+_0x69a0fb+_0x48758d(0x1a4)+_0x4c0502);try{return await _0x34198f[_0x48758d(0x1e2)]['getSegmentEntity'](_0x69a0fb);}catch(_0x51da59){return logger['debug'](_0x48758d(0x205)+_0x69a0fb+':\x20'+_0x51da59),null;}}}function recoverSegmentIdsFromPushRecovery(_0x57b4e8,_0x15aafa,_0x1e50c9){const _0x12517e=a142_0x420e71,_0x248559=readPushRecovery(_0x57b4e8[_0x12517e(0x180)]);if(_0x248559?.['journeyName']===_0x57b4e8[_0x12517e(0x159)][_0x12517e(0x203)])for(const [_0x4b2b90,_0x19fca5]of Object[_0x12517e(0x1ab)](_0x248559['segments'])){const _0x160bf3=generateDeterministicJourneySegmentName(_0x57b4e8[_0x12517e(0x159)][_0x12517e(0x203)],_0x4b2b90);_0x19fca5[_0x12517e(0x208)]===_0x160bf3&&(_0x15aafa[_0x12517e(0x1f9)](_0x4b2b90,_0x19fca5[_0x12517e(0x20a)]),_0x1e50c9[_0x12517e(0x1f9)](_0x4b2b90,_0x19fca5[_0x12517e(0x20a)]));}}async function createOrRecoverEmbeddedSegment(_0x9da904,_0x4e8111,_0x3e0fa7,_0x1e8fc1){const _0x1af0c6=a142_0x420e71;let _0x32ab69;try{_0x32ab69=await _0x9da904[_0x1af0c6(0x1e2)][_0x1af0c6(0x1b9)]({'name':_0x3e0fa7[_0x1af0c6(0x1bc)],'description':_0x3e0fa7[_0x1af0c6(0x131)],'journeyId':_0x3e0fa7[_0x1af0c6(0x147)],'rule':_0x1e8fc1(_0x3e0fa7[_0x1af0c6(0x1d5)],!![]),'countPopulation':!![],'parentFolderId':_0x3e0fa7[_0x1af0c6(0x201)],'audienceId':_0x3e0fa7[_0x1af0c6(0x1f3)]});}catch(_0x3a66e2){const _0x3d7b80=_0x3a66e2 instanceof Error&&_0x3a66e2[_0x1af0c6(0x1f1)][_0x1af0c6(0x14f)](_0x1af0c6(0x157));if(_0x3d7b80){const _0xb72998=readPushRecovery(_0x4e8111[_0x1af0c6(0x180)]),_0x1453a7=_0xb72998?.[_0x1af0c6(0x176)]===_0x4e8111[_0x1af0c6(0x159)][_0x1af0c6(0x203)]?_0xb72998[_0x1af0c6(0x19c)][_0x3e0fa7[_0x1af0c6(0x1aa)]]:undefined;if(_0x1453a7?.['uniqueServerName']===_0x3e0fa7[_0x1af0c6(0x1bc)])await _0x9da904[_0x1af0c6(0x1e2)][_0x1af0c6(0x177)](_0x3e0fa7[_0x1af0c6(0x1f3)],_0x1453a7['segmentId'],{'description':_0x3e0fa7[_0x1af0c6(0x131)],'rule':_0x1e8fc1(_0x3e0fa7[_0x1af0c6(0x1d5)],!![]),'countPopulation':!![]}),_0x32ab69=_0x1453a7['segmentId'];else throw new SDKError(ErrorCode[_0x1af0c6(0x1c9)],'Embedded\x20segment\x20\x27'+_0x3e0fa7['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x1af0c6(0x188)+_0x4e8111[_0x1af0c6(0x180)][_0x1af0c6(0x1cc)](/([^/]+)$/,_0x1af0c6(0x136))+')\x20')+_0x1af0c6(0x1ef),_0x3a66e2);}else throw _0x3a66e2;}return saveSegmentToPushRecovery(_0x4e8111['absolutePath'],_0x4e8111[_0x1af0c6(0x159)]['name'],_0x3e0fa7[_0x1af0c6(0x1aa)],{'segmentId':_0x32ab69,'uniqueServerName':_0x3e0fa7[_0x1af0c6(0x1bc)],'createdAt':new Date()[_0x1af0c6(0x11d)]()}),_0x32ab69;}export async function prepareSegmentFiles(_0x275009,_0x23adf5,_0x27bdbf,_0x41c317,_0x2963e3){const _0x53aeef=a142_0x420e71,{activationDefToCreateRequest:_0x34e1e1}=await import(_0x53aeef(0x125)),_0x347b81=[],_0x3df52f=new Set();for(const {yamlConfig:_0x3817e1,folderPath:_0x5956fe,sourcePath:_0x5cc731}of _0x275009){const _0x992707=resolveTDFolderPath(_0x5956fe,_0x41c317,_0x2963e3),_0x3a8a2a=_0x992707+':'+_0x3817e1['name'],_0x30a67d=_0x23adf5[_0x53aeef(0x17e)][_0x53aeef(0x11c)](_0x3a8a2a),_0x39138b=_0x30a67d?_0x23adf5[_0x53aeef(0x1d4)][_0x53aeef(0x11c)](_0x30a67d['id'])||[]:[];addFoldersToCreate(_0x992707,_0x23adf5['folderPathToId'],_0x3df52f);const _0xf8af33=calculateActivationActions(_0x3817e1[_0x53aeef(0x1fc)]||[],_0x39138b,_0x23adf5[_0x53aeef(0x143)],_0x23adf5['connectionIdToNameMap']);for(const _0x5817cb of _0xf8af33){(_0x5817cb[_0x53aeef(0x167)]===_0x53aeef(0x132)||_0x5817cb[_0x53aeef(0x167)]==='update')&&_0x5817cb[_0x53aeef(0x15c)]&&(_0x5817cb[_0x53aeef(0x169)]=await _0x34e1e1(_0x5817cb[_0x53aeef(0x15c)],_0x27bdbf));}const _0x11b30a=calculateSegmentDiff(_0x3817e1,_0x30a67d,_0x39138b,_0x23adf5['idToEmailMap'],_0x23adf5[_0x53aeef(0x1af)]);_0x347b81[_0x53aeef(0x170)]({'relativePath':_0x3817e1['name'],'absolutePath':_0x5cc731,'yamlConfig':_0x3817e1,'folderPath':_0x992707,'existingSegment':_0x30a67d,'existingActivations':_0x39138b,'isNew':_0x11b30a['isNew'],'hasChanges':_0x11b30a[_0x53aeef(0x1b0)],'diff':_0x11b30a[_0x53aeef(0x1c6)],'activationActions':_0xf8af33});}return{'segmentFiles':_0x347b81,'foldersToCreate':_0x3df52f};}export async function prepareJourneyFiles(_0x4108ed,_0x3b284d,_0x499695,_0x301b44){const _0x1c0912=a142_0x420e71,_0x24b412=[],_0x21c269=new Set();for(const {yamlConfig:_0xe8eff9,folderPath:_0x7f0ad0,sourcePath:_0x44eb82}of _0x4108ed){const _0x5a6d44=resolveTDFolderPath(_0x7f0ad0,_0x499695,_0x301b44),_0x57b6c3=_0x5a6d44+':'+_0xe8eff9['name'],_0x310d2b=_0x3b284d[_0x1c0912(0x18f)]['get'](_0x57b6c3);let _0x577ff1,_0x1ad54e;if(_0x310d2b&&_0x310d2b[_0x1c0912(0x118)]>0x0){const _0x155bc2=buildLocalExpandedRuleMappings(_0xe8eff9),{createYamlContext:_0x572ad4,prefetchJourneySegments:_0x112314}=createPushYamlContextForBundle(_0x3b284d[_0x1c0912(0x1e9)],_0x3b284d[_0x1c0912(0x1f3)],_0x3b284d[_0x1c0912(0x199)],_0x155bc2,_0x3b284d[_0x1c0912(0x143)],_0x3b284d[_0x1c0912(0x1af)],_0x3b284d[_0x1c0912(0x1fe)],_0x3b284d[_0x1c0912(0x189)]);await _0x112314(_0x310d2b['map'](_0x1e8582=>_0x1e8582['id']));const _0x57a8ae=await _0x3b284d['deps']['journey']['getLatestJourneyId'](_0x310d2b[0x0][_0x1c0912(0x1ac)]),_0x5ae37c=hasMultipleVersions(_0xe8eff9),_0x5ce0d1=async _0x5a6efa=>{const _0x3f160d=_0x1c0912,_0x55d19b=_0x3b284d[_0x3f160d(0x189)]?.[_0x3f160d(0x11c)](_0x5a6efa);if(_0x55d19b)return _0x55d19b;return _0x3b284d['fetchJourney']({'journeyId':_0x5a6efa,'journeyName':_0xe8eff9[_0x3f160d(0x203)],'isMultiVersion':_0x310d2b['length']>0x1});};if(_0x5ae37c&&_0x310d2b[_0x1c0912(0x118)]>0x1){const _0x4d4e73=[];for(const _0x135b3d of _0x310d2b){const _0x363905=_0x135b3d['versionNumber']||0x1;_0x3b284d[_0x1c0912(0x15f)]?.[_0x1c0912(0x192)](_0x1c0912(0x129)+_0xe8eff9[_0x1c0912(0x203)]+'\x20v'+_0x363905);const _0x457408=await _0x5ce0d1(_0x135b3d['id']),_0x349703=_0x572ad4(_0x135b3d['id']),_0x50964d=await journeyResponseToDef(_0x457408,_0x349703);_0x4d4e73[_0x1c0912(0x170)]({'item':_0x135b3d,'yaml':_0x50964d});}const _0xd98c6b=buildLocalRuleToNameMappingFromJourney(_0xe8eff9);_0x1ad54e=buildMergedJourneyDef(_0x4d4e73,_0xd98c6b,_0x57a8ae);const _0x1fcc14=Math[_0x1c0912(0x120)](..._0x4d4e73[_0x1c0912(0x209)](_0x5bd658=>_0x5bd658[_0x1c0912(0x207)]['versionNumber']||0x0)),_0x1960ec=_0x310d2b[_0x1c0912(0x172)](_0x1bf475=>(_0x1bf475[_0x1c0912(0x213)]||0x0)===_0x1fcc14);_0x1960ec&&(_0x3b284d[_0x1c0912(0x15f)]?.[_0x1c0912(0x192)](_0x1c0912(0x129)+_0xe8eff9['name']+'\x20v'+_0x1fcc14),_0x577ff1=await _0x5ce0d1(_0x1960ec['id']));}else{const _0x5e1083=_0x310d2b[_0x310d2b[_0x1c0912(0x118)]-0x1];_0x3b284d['progress']?.['update'](_0x1c0912(0x129)+_0xe8eff9[_0x1c0912(0x203)]),_0x577ff1=await _0x5ce0d1(_0x5e1083['id']);const _0x47eaf3=_0x572ad4(_0x5e1083['id']),_0x21681c=await journeyResponseToDef(_0x577ff1,_0x47eaf3),_0x5b7eee=buildLocalRuleToNameMappingFromJourney(_0xe8eff9);_0x1ad54e=buildMergedJourneyDef([{'item':_0x5e1083,'yaml':_0x21681c}],_0x5b7eee,_0x57a8ae);}}addFoldersToCreate(_0x5a6d44,_0x3b284d[_0x1c0912(0x1c1)],_0x21c269);const _0x17fd70=calculateJourneyDiff(_0xe8eff9,_0x1ad54e);_0x24b412[_0x1c0912(0x170)]({'relativePath':_0xe8eff9[_0x1c0912(0x203)],'absolutePath':_0x44eb82,'yamlConfig':_0xe8eff9,'folderPath':_0x5a6d44,'existingJourney':_0x577ff1,'isNew':_0x17fd70[_0x1c0912(0x1d1)],'hasChanges':_0x17fd70[_0x1c0912(0x1b0)],'diff':_0x17fd70[_0x1c0912(0x1c6)]});}return{'journeyFiles':_0x24b412,'foldersToCreate':_0x21c269};}export function calculateActivationActions(_0x124d60,_0x49003e,_0x379d09,_0x314395){const _0x3746ef=a142_0x420e71,_0xb54738=[],_0x1b87fa=new Map();for(const _0x2f19ab of _0x49003e){_0x1b87fa[_0x3746ef(0x1f9)](_0x2f19ab[_0x3746ef(0x203)],_0x2f19ab);}const _0x3e567f=new Map();for(const _0x435bd2 of _0x124d60){_0x3e567f['set'](_0x435bd2['name'],_0x435bd2);}for(const _0x497d61 of _0x124d60){const _0x4b78bd=_0x1b87fa[_0x3746ef(0x11c)](_0x497d61[_0x3746ef(0x203)]);if(!_0x4b78bd)_0xb54738[_0x3746ef(0x170)]({'type':'create','name':_0x497d61[_0x3746ef(0x203)],'yamlActivation':_0x497d61});else{const _0xdd389d=activationResponseToDef(_0x4b78bd,_0x379d09,_0x314395),_0x5230c7=a142_0x18c254[_0x3746ef(0x1e3)](_0xdd389d),_0x103c38=a142_0x18c254[_0x3746ef(0x1e3)](_0x497d61);_0x5230c7!==_0x103c38&&_0xb54738[_0x3746ef(0x170)]({'type':'update','name':_0x497d61['name'],'yamlActivation':_0x497d61,'existingActivation':_0x4b78bd});}}for(const _0x1f7ae3 of _0x49003e){!_0x3e567f[_0x3746ef(0x1c2)](_0x1f7ae3[_0x3746ef(0x203)])&&_0xb54738[_0x3746ef(0x170)]({'type':'delete','name':_0x1f7ae3[_0x3746ef(0x203)],'existingActivation':_0x1f7ae3});}return _0xb54738;}function calculateYamlDiff(_0x432b7c,_0x1cef0f){if(_0x1cef0f){const _0x41cc4d=generateDiff(_0x1cef0f,_0x432b7c),_0x16b638=hasChanges(_0x41cc4d);return{'isNew':![],'hasChanges':_0x16b638,'diff':_0x16b638?formatDiffWithColors(_0x41cc4d):undefined};}const _0x543922=generateDiff('',_0x432b7c);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x543922)};}export function calculateSegmentDiff(_0xe674d9,_0x1ec535,_0x205838,_0x28b631,_0x318be8){const _0x7b5755=segmentToYamlString(_0xe674d9),_0x2fd346=_0x1ec535?segmentToYamlString(segmentWithActivationsToYaml(_0x1ec535,_0x205838,undefined,_0x28b631,_0x318be8)):undefined;return calculateYamlDiff(_0x7b5755,_0x2fd346);}export function calculateJourneyDiff(_0x4f7a2f,_0x30f6f7){const _0x41228f=normalizeJourneyDef(_0x4f7a2f,_0x4f7a2f),_0x209803=a142_0x5bf15a(_0x41228f),_0x5e998d=_0x30f6f7?a142_0x5bf15a(normalizeJourneyDef(_0x30f6f7,_0x4f7a2f)):undefined;return calculateYamlDiff(_0x209803,_0x5e998d);}export function findSegmentsToDelete(_0x29e393,_0x4fb34c,_0x4d8684,_0x5af005,_0x1290d1){const _0x153c6f=a142_0x420e71,_0x520716=new Set();for(const {yamlConfig:_0x40bf20,folderPath:_0x558e33}of _0x4fb34c){_0x520716['add'](_0x558e33+':'+_0x40bf20[_0x153c6f(0x203)]);}return _0x29e393[_0x153c6f(0x1be)](_0x55432b=>{const _0x4ecc43=_0x153c6f,_0x22d995=_0x55432b[_0x4ecc43(0x18a)]?_0x4d8684[_0x4ecc43(0x11c)](_0x55432b[_0x4ecc43(0x18a)][_0x4ecc43(0x13f)]())||'':'',_0x474d0c=_0x22d995+':'+_0x55432b[_0x4ecc43(0x203)];if(_0x520716['has'](_0x474d0c))return![];if(_0x1290d1)return _0x22d995===_0x5af005||_0x22d995[_0x4ecc43(0x194)](_0x5af005+'/');return!![];});}export function findJourneysToDelete(_0x4aa63e,_0x4fa933,_0x3f864b,_0x12f492,_0x28253d){const _0x3136e7=a142_0x420e71,_0x52cb57=new Set();for(const {yamlConfig:_0x418a81,folderPath:_0x36c6a5}of _0x4fa933){_0x52cb57[_0x3136e7(0x166)](_0x36c6a5+':'+_0x418a81[_0x3136e7(0x203)]);}return _0x4aa63e[_0x3136e7(0x1be)](_0x1651f7=>{const _0x3c5311=_0x3136e7,_0x17b5d0=_0x1651f7[_0x3c5311(0x201)]?_0x3f864b[_0x3c5311(0x11c)](_0x1651f7[_0x3c5311(0x201)])||'':'',_0x3ea6b9=_0x17b5d0+':'+_0x1651f7['journeyBundleName'];if(_0x52cb57['has'](_0x3ea6b9))return![];if(_0x28253d)return _0x17b5d0===_0x12f492||_0x17b5d0[_0x3c5311(0x194)](_0x12f492+'/');return!![];});}export function buildSegmentLookupMap(_0x19b8b6,_0x648a2a){const _0xae3953=a142_0x420e71,_0x42b3cc=new Map();for(const _0x49211b of _0x19b8b6){const _0x3a8313=_0x49211b['segmentFolderId']?_0x648a2a[_0xae3953(0x11c)](_0x49211b[_0xae3953(0x18a)][_0xae3953(0x13f)]())||'':'',_0x289af3=_0x3a8313+':'+_0x49211b[_0xae3953(0x203)];_0x42b3cc[_0xae3953(0x1f9)](_0x289af3,_0x49211b);}return _0x42b3cc;}export function buildSegmentNameToIdMap(_0x5ba87f){const _0x2fcf0a=a142_0x420e71,_0x38b05a=new Map();for(const _0x46e8e2 of _0x5ba87f){_0x38b05a[_0x2fcf0a(0x1f9)](_0x46e8e2['name'],_0x46e8e2['id']);}return _0x38b05a;}export function buildJourneyBundleLookupMap(_0x6f9294,_0x2cfb69){const _0x3f5873=a142_0x420e71,_0x40c59a=new Map();for(const _0x378183 of _0x6f9294){const _0x1ad3c6=_0x378183['folderId']?_0x2cfb69[_0x3f5873(0x11c)](_0x378183[_0x3f5873(0x201)])||'':'',_0xbff86d=_0x1ad3c6+':'+_0x378183[_0x3f5873(0x117)];!_0x40c59a[_0x3f5873(0x1c2)](_0xbff86d)&&_0x40c59a['set'](_0xbff86d,[]),_0x40c59a['get'](_0xbff86d)[_0x3f5873(0x170)](_0x378183);}for(const _0x34b6ef of _0x40c59a[_0x3f5873(0x16b)]()){_0x34b6ef[_0x3f5873(0x1f4)]((_0x2a0e17,_0xa363f0)=>(_0x2a0e17[_0x3f5873(0x213)]||0x0)-(_0xa363f0['versionNumber']||0x0));}return _0x40c59a;}export function collectFoldersToCreate(_0x3c43e7,_0x1d2b63){const _0x4ee87f=a142_0x420e71,_0x425984=new Set();for(const _0x215196 of _0x3c43e7){if(!_0x215196)continue;if(_0x1d2b63[_0x4ee87f(0x1c2)](_0x215196))continue;const _0xae2b0f=_0x215196[_0x4ee87f(0x1c5)]('/');let _0xf6c544='';for(const _0xf768a3 of _0xae2b0f){_0xf6c544=_0xf6c544?_0xf6c544+'/'+_0xf768a3:_0xf768a3,!_0x1d2b63[_0x4ee87f(0x1c2)](_0xf6c544)&&_0x425984['add'](_0xf6c544);}}return _0x425984;}export function parseAndClassifyYamlFiles(_0x5981a9,_0x292858,_0x310d42){const _0x5ce327=a142_0x420e71,_0x22e90c=[],_0xde3586=[];for(const _0x2cad3a of _0x5981a9){const _0x21b4cd=a142_0x30d89b[_0x5ce327(0x1d9)](_0x292858,a142_0x30d89b[_0x5ce327(0x1dd)](_0x2cad3a)),_0x26c67d=_0x21b4cd==='.'?'':_0x21b4cd,_0x4b4873=readFileSync(_0x2cad3a,_0x5ce327(0x195)),_0x55cd4a=a142_0x18c254[_0x5ce327(0x1ff)](_0x4b4873);if(isJourneyDef(_0x55cd4a)){const _0x4ecbdd=a142_0x55284e(_0x4b4873);_0xde3586[_0x5ce327(0x170)]({'yamlConfig':_0x4ecbdd,'folderPath':_0x26c67d,'sourcePath':_0x2cad3a});}else{if(!_0x310d42?.[_0x5ce327(0x11a)]){const _0x631bed=parseSegmentYamlFile(_0x4b4873),_0x3dd1b2=normalizeChildSegmentYaml(_0x631bed);_0x22e90c[_0x5ce327(0x170)]({'yamlConfig':_0x3dd1b2,'folderPath':_0x26c67d,'sourcePath':_0x2cad3a});}}}return{'segments':_0x22e90c,'journeys':_0xde3586};}export function validateParsedFiles(_0x3cae3b,_0x17ded4){const _0x38d360=a142_0x420e71,_0x144459=[];for(const {yamlConfig:_0x44cd32,sourcePath:_0x1aaafa}of _0x3cae3b[_0x38d360(0x19c)]){const _0x31595=readFileSync(_0x1aaafa,'utf-8'),_0x2f8d2c=a142_0x18c254[_0x38d360(0x1ea)](_0x31595),_0x13e29a=validateSegmentDef(_0x44cd32,{'source':_0x31595,'document':_0x2f8d2c},{'skipSchema':!![]});if(!_0x13e29a[_0x38d360(0x1d3)]){const _0x3adc5f=a142_0x30d89b[_0x38d360(0x1d9)](_0x17ded4,_0x1aaafa);_0x144459[_0x38d360(0x170)]({'filePath':_0x3adc5f,'source':_0x31595,'result':_0x13e29a,'isJourney':![]});}}for(const {yamlConfig:_0x49c54d,sourcePath:_0x1ad2db}of _0x3cae3b[_0x38d360(0x12a)]){const _0x269f55=readFileSync(_0x1ad2db,_0x38d360(0x195)),_0x2ffda8=a142_0x18c254[_0x38d360(0x1ea)](_0x269f55),_0x21a236=validateJourneyDef(_0x49c54d,{'source':_0x269f55,'document':_0x2ffda8},{'skipSchema':!![]});if(!_0x21a236[_0x38d360(0x1d3)]){const _0x390c0a=a142_0x30d89b[_0x38d360(0x1d9)](_0x17ded4,_0x1ad2db);_0x144459[_0x38d360(0x170)]({'filePath':_0x390c0a,'source':_0x269f55,'result':_0x21a236,'isJourney':!![]});}}return _0x144459;}export function formatValidationErrors(_0x77af82){const _0x58ec7c=a142_0x420e71,_0x3d7050=[];for(const {filePath:_0x3e8b53,source:_0x327c9d,result:_0x9d1a7a,isJourney:_0x236dab}of _0x77af82){const _0x1a33b5=_0x236dab?_0x58ec7c(0x16c):_0x58ec7c(0x1e2);_0x3d7050[_0x58ec7c(0x170)]('\x0a'+_0x3e8b53+'\x20('+_0x1a33b5+_0x58ec7c(0x168)+_0x9d1a7a['errors'][_0x58ec7c(0x118)]+'\x20error(s)'),_0x3d7050[_0x58ec7c(0x170)](formatValidationResult(_0x9d1a7a,_0x327c9d,_0x3e8b53));}return _0x3d7050[_0x58ec7c(0x1f5)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x46ee7f){const _0x549132=a142_0x420e71,_0x12d77c=new Set(),_0x49fc7a=new Map(),_0x142176=collectSegmentUsageCounts(_0x46ee7f);if(_0x46ee7f[_0x549132(0x19c)])for(const [_0x14c1f4,_0x5cbe1e]of Object['entries'](_0x46ee7f['segments'])){_0x12d77c[_0x549132(0x166)](_0x14c1f4);if(_0x5cbe1e[_0x549132(0x196)]){const _0x220cba=yamlRuleToApi(_0x5cbe1e[_0x549132(0x196)]),_0x482c59=apiRuleToYaml(_0x220cba);_0x49fc7a[_0x549132(0x1f9)](_0x14c1f4,_0x482c59);}}const _0x481536=new Map();let _0x519f6f=0x0;for(const [_0x4bf0f1,_0x24f719]of _0x49fc7a){const _0x46388c=serializeExpandedRule(_0x24f719,_0x49fc7a),_0x33f3a5=_0x481536[_0x549132(0x11c)](_0x46388c)||[];_0x33f3a5[_0x549132(0x170)]({'name':_0x4bf0f1,'index':_0x519f6f}),_0x481536[_0x549132(0x1f9)](_0x46388c,_0x33f3a5),_0x519f6f++;}const _0x334485=new Map();for(const [_0x242b56,_0x2e4897]of _0x481536){const _0x2e48af=_0x2e4897[_0x549132(0x1ec)]()['sort']((_0x5bc85b,_0x58c88e)=>{const _0xc451c0=_0x549132,_0x238dd1=_0x142176[_0xc451c0(0x11c)](_0x5bc85b[_0xc451c0(0x203)])||0x0,_0x3824ae=_0x142176[_0xc451c0(0x11c)](_0x58c88e[_0xc451c0(0x203)])||0x0;if(_0x238dd1!==_0x3824ae)return _0x3824ae-_0x238dd1;return _0x5bc85b[_0xc451c0(0x1eb)]-_0x58c88e[_0xc451c0(0x1eb)];})[_0x549132(0x209)](_0x528699=>_0x528699[_0x549132(0x203)]),_0x46c31d=[];for(const _0x5ed4fa of _0x2e48af){const _0x13c7b5=_0x142176[_0x549132(0x11c)](_0x5ed4fa)||0x0,_0x3ff610=Math[_0x549132(0x120)](_0x13c7b5,0x1);for(let _0x2ae82f=0x0;_0x2ae82f<_0x3ff610;_0x2ae82f++){_0x46c31d[_0x549132(0x170)](_0x5ed4fa);}}_0x334485['set'](_0x242b56,_0x46c31d);}return{'existingLocalSegmentNames':_0x12d77c,'localSegmentRules':_0x49fc7a,'localExpandedRuleToNames':_0x334485};}export function createSegmentIdResolver(_0x370b7b,_0x4f68b3){return async _0x508a7a=>{const _0x37192a=a142_0x1102,_0x6b14c8=_0x370b7b[_0x37192a(0x11c)](_0x508a7a);if(!_0x6b14c8)throw new SDKError(ErrorCode[_0x37192a(0x1fb)],'Segment\x20not\x20found:\x20'+_0x508a7a+_0x37192a(0x155)+_0x4f68b3+'\x27)');return _0x6b14c8;};}export function extractRootFolderId(_0x27c454){const _0x1be72f=a142_0x420e71;return _0x27c454['relationships']?.['parentSegmentFolder']?.[_0x1be72f(0x19a)]?.['id']||_0x27c454['relationships']?.['parentFolder']?.[_0x1be72f(0x19a)]?.['id'];}export function buildConnectionMaps(_0x219058){const _0x22ac23=a142_0x420e71,_0x2f4ca6=new Map(),_0x5511b6=new Map(),_0x575155=new Map();for(const _0x19a682 of _0x219058){_0x2f4ca6['set'](_0x19a682[_0x22ac23(0x203)],parseInt(_0x19a682['id'],0xa)),_0x5511b6[_0x22ac23(0x1f9)](_0x19a682['id'],_0x19a682[_0x22ac23(0x203)]),_0x575155[_0x22ac23(0x1f9)](_0x19a682['name'],_0x19a682['type']);}return{'nameToId':_0x2f4ca6,'idToName':_0x5511b6,'nameToType':_0x575155};}export function calculatePushStats(_0x2ddb96,_0xc8951f,_0x3538d5,_0x401278,_0x1c2ea8,_0x2c08bd,_0x32ae63){const _0x1e02e2=a142_0x420e71,_0x506b42=_0x2ddb96[_0x1e02e2(0x1be)](_0x97c6fc=>_0x97c6fc[_0x1e02e2(0x1d1)]),_0x2eb955=_0x2ddb96[_0x1e02e2(0x1be)](_0x3b29ec=>!_0x3b29ec['isNew']&&_0x3b29ec[_0x1e02e2(0x1b0)]),_0x168c6e=_0x2ddb96[_0x1e02e2(0x1be)](_0x2f11a5=>!_0x2f11a5[_0x1e02e2(0x1d1)]&&!_0x2f11a5[_0x1e02e2(0x1b0)]),_0x1c8957=_0x2c08bd?_0x401278:[],_0x3cbb51=_0xc8951f[_0x1e02e2(0x1be)](_0x2cbe83=>_0x2cbe83[_0x1e02e2(0x1d1)]),_0x4cda5c=_0xc8951f[_0x1e02e2(0x1be)](_0x508e0d=>!_0x508e0d[_0x1e02e2(0x1d1)]&&_0x508e0d[_0x1e02e2(0x1b0)]),_0x379602=_0xc8951f[_0x1e02e2(0x1be)](_0x519b43=>!_0x519b43[_0x1e02e2(0x1d1)]&&!_0x519b43[_0x1e02e2(0x1b0)]),_0xf1a664=_0x2c08bd?_0x1c2ea8:[],_0x190d23=_0x2ddb96[_0x1e02e2(0x158)](_0x5af5c8=>_0x5af5c8[_0x1e02e2(0x11e)]),_0x2958df=_0x190d23[_0x1e02e2(0x1be)](_0x550e92=>_0x550e92['type']===_0x1e02e2(0x132)),_0x58205d=_0x190d23[_0x1e02e2(0x1be)](_0x5ba225=>_0x5ba225[_0x1e02e2(0x167)]===_0x1e02e2(0x192)),_0x3687a3=_0x190d23[_0x1e02e2(0x1be)](_0x2db4f5=>_0x2db4f5[_0x1e02e2(0x167)]===_0x1e02e2(0x20f)),_0x22d68f=Array[_0x1e02e2(0x1b3)](_0x3538d5)[_0x1e02e2(0x1f4)](),_0x5356c7=_0x32ae63?![]:_0x506b42[_0x1e02e2(0x118)]>0x0||_0x2eb955['length']>0x0||_0x1c8957[_0x1e02e2(0x118)]>0x0,_0x7a3071=_0x3cbb51['length']>0x0||_0x4cda5c[_0x1e02e2(0x118)]>0x0||_0xf1a664[_0x1e02e2(0x118)]>0x0,_0x52699d=_0x32ae63?![]:_0x190d23['length']>0x0,_0x71f945=_0x22d68f['length']>0x0;return{'segments':{'new':_0x506b42,'changed':_0x2eb955,'unchanged':_0x168c6e,'toDelete':_0x1c8957},'journeys':{'new':_0x3cbb51,'changed':_0x4cda5c,'unchanged':_0x379602,'toDelete':_0xf1a664},'activations':{'all':_0x190d23,'toCreate':_0x2958df,'toUpdate':_0x58205d,'toDelete':_0x3687a3},'folders':{'toCreate':_0x22d68f},'counts':{'segments':{'new':_0x506b42[_0x1e02e2(0x118)],'changed':_0x2eb955['length'],'unchanged':_0x168c6e[_0x1e02e2(0x118)],'toDelete':_0x1c8957[_0x1e02e2(0x118)]},'journeys':{'new':_0x3cbb51['length'],'changed':_0x4cda5c[_0x1e02e2(0x118)],'unchanged':_0x379602[_0x1e02e2(0x118)],'toDelete':_0xf1a664['length']},'activations':{'create':_0x2958df[_0x1e02e2(0x118)],'update':_0x58205d['length'],'delete':_0x3687a3[_0x1e02e2(0x118)]},'folders':_0x22d68f['length']},'hasChanges':_0x5356c7||_0x7a3071||_0x52699d||_0x71f945};}export async function buildPushExecutionContext(_0xc58d3e,_0x5a80d3,_0x4d52b1,_0x29f32d,_0x35e71a,_0x57b89a){const _0x1e4b26=a142_0x420e71,_0x1f4bb9=extractRootFolderId(_0x4d52b1),{pathToId:_0x23e7d1,idToPath:_0x35ba8d}=buildFolderMaps(_0x35e71a),_0xcd41dc=buildSegmentNameToIdMap(_0x29f32d),_0x4f649e=new Map(),{batchAsync:_0x156253}=await import(_0x1e4b26(0x202)),[_0x5096fd,_0x3821a0]=await Promise['all']([_0xc58d3e[_0x1e4b26(0x1a5)]['buildUserMaps'](),_0xc58d3e[_0x1e4b26(0x19d)]['list'](),((async()=>{const _0x3682a8=_0x1e4b26;!_0x57b89a&&_0x29f32d[_0x3682a8(0x118)]>0x0&&await _0x156253(_0x29f32d,async _0x25b514=>{const _0x24d266=_0x3682a8,_0x11ef3a=await _0xc58d3e[_0x24d266(0x1e2)]['listActivations'](_0x5a80d3,_0x25b514['id']);_0x4f649e[_0x24d266(0x1f9)](_0x25b514['id'],_0x11ef3a);});})())]),{emailToId:_0x3927d5,idToEmail:_0x54021d}=_0x5096fd,_0x138613=buildConnectionMaps(_0x3821a0);return{'rootFolderId':_0x1f4bb9,'folderPathToId':_0x23e7d1,'folderIdToPath':_0x35ba8d,'segmentNameToId':_0xcd41dc,'activationsBySegmentId':_0x4f649e,'emailToIdMap':_0x3927d5,'idToEmailMap':_0x54021d,'connectionNameToIdMap':_0x138613['nameToId'],'connectionIdToNameMap':_0x138613[_0x1e4b26(0x1dc)],'connectionNameToTypeMap':_0x138613[_0x1e4b26(0x1c4)]};}export function createPushYamlContextForBundle(_0x199562,_0x3b3a62,_0x3e5d17,_0x2faf51,_0x537bcc,_0x3eae36,_0x3022d9,_0x436d79){const {existingLocalSegmentNames:_0x184e5c,localExpandedRuleToNames:_0x1885f1}=_0x2faf51,_0x510201=new Set(),_0x565ab4=new Map(),_0x1d682a=new Map(),_0x5ec651=new Map(),_0x571870=createJumpTargetCache(),_0x2b4942=new Map(),_0x4a6533=new Map(),_0xa422d8=new Set();let _0x3d077b;const _0x43f900=_0x24f462=>{const _0x41f7a9={'resolveSegment':async _0x3acc42=>{const _0x4fb995=a142_0x1102,_0x36de97=_0x5ec651[_0x4fb995(0x11c)](_0x3acc42);if(_0x36de97!==undefined)return{'name':_0x36de97,'isJourneyLocal':!![]};try{const _0x3c67e0=await fetchSegment(_0x199562,_0x3b3a62,_0x3acc42,_0x3e5d17);if(!_0x3c67e0)throw new Error('Segment\x20not\x20found');const _0x42e16d=generateJourneyLocalName(_0x3c67e0[_0x4fb995(0x203)]),_0x3ccace=_0x3c67e0[_0x4fb995(0x18e)]===SEGMENT_KIND_JOURNEY&&_0x42e16d!==undefined;let _0x4c06a1=_0x3c67e0[_0x4fb995(0x203)],_0xb15bb6;if(_0x3ccace&&_0x3c67e0['rule']){const _0x31fe4d=apiRuleToYaml(_0x3c67e0[_0x4fb995(0x196)]);_0x4a6533[_0x4fb995(0x1f9)](_0x3acc42,_0x31fe4d);const _0x45ca7b=async _0x26394a=>{const _0x388d0c=_0x4fb995,_0x415c4b=collectSegmentRefsFromRule(_0x26394a);for(const _0xa2b10f of _0x415c4b){if(!_0x4a6533['has'](_0xa2b10f))try{const _0x4ae324=await fetchSegment(_0x199562,_0x3b3a62,_0xa2b10f,_0x3e5d17);if(_0x4ae324?.[_0x388d0c(0x196)]){const _0x3bc87a=apiRuleToYaml(_0x4ae324[_0x388d0c(0x196)]);_0x4a6533['set'](_0xa2b10f,_0x3bc87a),await _0x45ca7b(_0x3bc87a);}}catch(_0x3c66eb){logger['debug'](_0x388d0c(0x135)+_0xa2b10f+':\x20'+_0x3c66eb);}}};await _0x45ca7b(_0x31fe4d);const _0x78997f=serializeExpandedRule(_0x31fe4d,_0x4a6533),_0x456712=_0x1885f1[_0x4fb995(0x11c)](_0x78997f);if(_0x456712&&_0x456712['length']>0x0){const _0x5ace2f=_0x565ab4[_0x4fb995(0x11c)](_0x78997f)||0x0,_0x34a016=_0x456712[_0x5ace2f]||_0x456712[_0x456712[_0x4fb995(0x118)]-0x1];_0x565ab4[_0x4fb995(0x1f9)](_0x78997f,_0x5ace2f+0x1),_0x4c06a1=_0x34a016,_0x510201[_0x4fb995(0x166)](_0x4c06a1),_0x5ec651[_0x4fb995(0x1f9)](_0x3acc42,_0x4c06a1);const _0x1041d9=await resolveRuleSegmentRefs(_0x31fe4d,async _0x1a3044=>{const _0x58a924=_0x4fb995,_0x7cabad=_0x5ec651['get'](_0x1a3044);if(_0x7cabad)return _0x7cabad;const _0x5d0602=await _0x3d077b['resolveSegment'](_0x1a3044);return _0x5d0602[_0x58a924(0x203)];});_0xb15bb6={'description':_0x3c67e0['description'],'rule':_0x1041d9};}else{const _0x32396d=_0x2b4942['get'](_0x78997f);if(_0x32396d)_0x4c06a1=_0x32396d,_0x5ec651[_0x4fb995(0x1f9)](_0x3acc42,_0x4c06a1);else{if(_0x42e16d){let _0x235188=_0x42e16d,_0x3c18e3=0x2;while(_0x510201[_0x4fb995(0x1c2)](_0x235188)||_0x184e5c[_0x4fb995(0x1c2)](_0x235188)){_0x235188=_0x42e16d+'_'+_0x3c18e3,_0x3c18e3++;}_0x510201[_0x4fb995(0x166)](_0x235188),_0x4c06a1=_0x235188;}_0x5ec651[_0x4fb995(0x1f9)](_0x3acc42,_0x4c06a1),_0x2b4942['set'](_0x78997f,_0x4c06a1);const _0x4f3020=await resolveRuleSegmentRefs(_0x31fe4d,async _0x53ed38=>{const _0x126e1b=_0x4fb995,_0x1f2fda=_0x5ec651[_0x126e1b(0x11c)](_0x53ed38);if(_0x1f2fda)return _0x1f2fda;const _0x4b8de9=await _0x3d077b[_0x126e1b(0x119)](_0x53ed38);return _0x4b8de9[_0x126e1b(0x203)];});_0xb15bb6={'description':_0x3c67e0[_0x4fb995(0x131)],'rule':_0x4f3020};}}}return{'name':_0x4c06a1,'isJourneyLocal':_0x3ccace,'definition':_0xb15bb6};}catch(_0x571e87){return logger[_0x4fb995(0x1e7)]('Failed\x20to\x20resolve\x20segment\x20'+_0x3acc42+':\x20'+_0x571e87),{'name':_0x3acc42,'isJourneyLocal':![]};}},'resolveActivation':async _0x13dbcc=>{const _0x18aef3=a142_0x1102,_0x2f78d4=_0x1d682a[_0x18aef3(0x11c)](_0x13dbcc);if(_0x2f78d4!==undefined)return{'name':_0x2f78d4,'isJourneyLocal':!![]};try{let _0x5157ea=_0x3022d9?.[_0x18aef3(0x11c)](_0x13dbcc);!_0x5157ea&&(_0x5157ea=await _0x199562[_0x18aef3(0x16c)][_0x18aef3(0x1e0)](_0x24f462,_0x13dbcc));const _0x57c869=_0x5157ea[_0x18aef3(0x161)][_0x18aef3(0x153)][_0x18aef3(0x203)]||_0x13dbcc,_0x4fe737=sanitizeYamlKey(_0x57c869)||_0x18aef3(0x121)+_0x13dbcc,_0x2d3009=_0x4fe737;_0x1d682a[_0x18aef3(0x1f9)](_0x13dbcc,_0x2d3009);const _0x484ab2=journeyActivationStepToYaml(_0x5157ea,_0x537bcc,_0x3eae36);return{'name':_0x2d3009,'isJourneyLocal':!![],'definition':_0x484ab2};}catch(_0x529d25){return logger[_0x18aef3(0x1e7)](_0x18aef3(0x1e1)+_0x13dbcc+':\x20'+_0x529d25),{'name':_0x13dbcc,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4f1b4a,_0x400db8)=>resolveJumpTarget(_0x4f1b4a,_0x400db8,_0x571870,async _0x332ede=>{const _0x14cc02=a142_0x1102,_0x5e6d44=_0x436d79?.[_0x14cc02(0x11c)](_0x332ede);if(_0x5e6d44)return _0x5e6d44;return _0x199562[_0x14cc02(0x16c)][_0x14cc02(0x1db)](_0x332ede);})};return _0x3d077b=_0x41f7a9,_0x41f7a9;},_0x3cf66b=async _0x2f3b50=>{const _0x1d0213=a142_0x1102,{collectSegmentIdsFromJourneyApi:_0x12f729}=await import(_0x1d0213(0x15d)),{batchAsync:_0x2b97a6}=await import(_0x1d0213(0x202)),_0x18409b=new Set();for(const _0x3dbe24 of _0x2f3b50){let _0x2d5b08=_0x436d79?.[_0x1d0213(0x11c)](_0x3dbe24);!_0x2d5b08&&(_0x2d5b08=await _0x199562[_0x1d0213(0x16c)][_0x1d0213(0x1db)](_0x3dbe24));const _0x4ce878=_0x12f729(_0x2d5b08);for(const _0x167d64 of _0x4ce878){_0x18409b[_0x1d0213(0x166)](_0x167d64);}}let _0x5400bc=Array['from'](_0x18409b);while(_0x5400bc[_0x1d0213(0x118)]>0x0){const _0x115545=_0x5400bc['filter'](_0x554552=>!_0xa422d8[_0x1d0213(0x1c2)](_0x554552));if(_0x115545['length']===0x0)break;const _0x23f3cf=await _0x2b97a6(_0x115545,async _0x2f7934=>{const _0x168e2c=_0x1d0213;_0xa422d8[_0x168e2c(0x166)](_0x2f7934);const _0x20f44b=await fetchSegment(_0x199562,_0x3b3a62,_0x2f7934,_0x3e5d17);if(!_0x20f44b)return null;return{'segmentId':_0x2f7934,'segment':_0x20f44b};},0xa),_0x644e8e=new Set();for(const _0x3ad7b3 of _0x23f3cf){if(!_0x3ad7b3?.[_0x1d0213(0x1e2)]?.[_0x1d0213(0x196)])continue;const _0x3fd7c7=apiRuleToYaml(_0x3ad7b3['segment']['rule']);_0x4a6533[_0x1d0213(0x1f9)](_0x3ad7b3['segmentId'],_0x3fd7c7);const _0x2f11d9=collectSegmentRefsFromRule(_0x3fd7c7);for(const _0x546a67 of _0x2f11d9){!_0xa422d8[_0x1d0213(0x1c2)](_0x546a67)&&_0x644e8e[_0x1d0213(0x166)](_0x546a67);}}_0x5400bc=Array[_0x1d0213(0x1b3)](_0x644e8e);}};return{'createYamlContext':_0x43f900,'prefetchJourneySegments':_0x3cf66b};}export async function executePushSegments(_0x5787af,_0x1a3c54,_0x24466d,_0x38fece,_0x5741e0){const _0x2f0b67=a142_0x420e71,{segmentDefToCreateRequest:_0x11f3bb,segmentDefToUpdateRequest:_0x3b46cb}=await import(_0x2f0b67(0x125)),_0x52582e=_0x24466d['folderPathToId'],_0x4267f7=0x5,_0x52108e=async _0x30d372=>{const _0x4918c8=_0x2f0b67,_0x173cda=_0x30d372[_0x4918c8(0x134)]?_0x52582e[_0x4918c8(0x11c)](_0x30d372[_0x4918c8(0x134)]):undefined;let _0x423d7;const _0x248b5e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x38f2e3=_0x30d372['yamlConfig'];if(_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x196)]){const _0x1eea9a=createSegmentIdResolver(_0x24466d[_0x4918c8(0x212)],_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]),_0x56e3aa=await resolveRuleSegmentIds(_0x30d372[_0x4918c8(0x159)]['rule'],_0x1eea9a);_0x38f2e3={..._0x30d372[_0x4918c8(0x159)],'rule':_0x56e3aa};}try{if(_0x30d372['isNew']){_0x5741e0[_0x4918c8(0x1de)]?.({'type':_0x4918c8(0x1bb),'name':_0x30d372[_0x4918c8(0x159)]['name']});const _0x4071eb=_0x11f3bb(_0x38f2e3,_0x173cda),_0x29783e=await _0x5741e0[_0x4918c8(0x13e)](_0x4918c8(0x1ba)+_0x30d372['yamlConfig']['name']+_0x4918c8(0x215),()=>_0x5787af[_0x4918c8(0x1e2)][_0x4918c8(0x163)](_0x38fece[_0x4918c8(0x1f3)],_0x4071eb));_0x423d7=_0x29783e[_0x4918c8(0x19a)]['id'],_0x24466d[_0x4918c8(0x212)]['set'](_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)],_0x423d7),_0x248b5e[_0x4918c8(0x13d)]={'name':_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)],'id':_0x423d7},_0x5741e0['onProgress']?.({'type':_0x4918c8(0x1d2),'name':_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)],'segmentId':_0x423d7}),_0x5741e0[_0x4918c8(0x1d6)]?.('Created\x20segment\x20\x27'+_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]+'\x27'),_0x248b5e[_0x4918c8(0x1a3)]=0x1;}else{if(_0x30d372['hasChanges']){_0x5741e0[_0x4918c8(0x1de)]?.({'type':_0x4918c8(0x193),'name':_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]});const _0x17398a=_0x3b46cb(_0x38f2e3);_0x173cda!==_0x30d372['existingSegment']?.[_0x4918c8(0x18a)]&&(_0x17398a[_0x4918c8(0x18a)]=_0x173cda?parseInt(_0x173cda,0xa):undefined),await _0x5741e0[_0x4918c8(0x13e)](_0x4918c8(0x1b4)+_0x30d372[_0x4918c8(0x159)]['name']+_0x4918c8(0x215),()=>_0x5787af[_0x4918c8(0x1e2)][_0x4918c8(0x177)](_0x38fece[_0x4918c8(0x1f3)],_0x30d372['existingSegment']['id'],_0x17398a)),_0x423d7=_0x30d372[_0x4918c8(0x17c)]['id'],_0x5741e0[_0x4918c8(0x1de)]?.({'type':'segment_updated','name':_0x30d372['yamlConfig'][_0x4918c8(0x203)]}),_0x5741e0[_0x4918c8(0x1d6)]?.(_0x4918c8(0x14d)+_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]+'\x27'),_0x248b5e['updated']=0x1;}else _0x423d7=_0x30d372[_0x4918c8(0x17c)]['id'];}}catch(_0x22e377){const _0x3f2475=isHttp400Error(_0x22e377),_0x4ddfda=_0x3f2475?ErrorCode[_0x4918c8(0x13b)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x17c822=getErrorMessage(_0x22e377);throw new SDKError(_0x4ddfda,_0x4918c8(0x1d0)+(_0x30d372['isNew']?_0x4918c8(0x132):'update')+'\x20segment\x20from\x20file:\x20'+_0x30d372[_0x4918c8(0x180)]+_0x4918c8(0x187)+_0x17c822,_0x22e377);}try{const _0x8b8f24=await syncActivationsForSegment(_0x5787af,_0x38fece[_0x4918c8(0x1f3)],_0x423d7,_0x30d372[_0x4918c8(0x159)]['name'],_0x30d372[_0x4918c8(0x11e)],_0x5741e0,_0x30d372[_0x4918c8(0x180)]);_0x248b5e[_0x4918c8(0x1fc)]=_0x8b8f24;}catch(_0x12092d){if(_0x12092d instanceof SDKError)throw _0x12092d;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x4918c8(0x162)+_0x30d372[_0x4918c8(0x159)][_0x4918c8(0x203)]+_0x4918c8(0x154)+_0x30d372['absolutePath']+_0x4918c8(0x187)+getErrorMessage(_0x12092d),_0x12092d);}return _0x248b5e;},_0x578f61=await batchAsync(_0x1a3c54,_0x52108e,_0x4267f7),_0x158c91={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x358b3c of _0x578f61){_0x158c91[_0x2f0b67(0x1a3)]+=_0x358b3c['created'],_0x158c91[_0x2f0b67(0x20e)]+=_0x358b3c[_0x2f0b67(0x20e)],_0x358b3c[_0x2f0b67(0x13d)]&&_0x158c91[_0x2f0b67(0x130)]['set'](_0x358b3c[_0x2f0b67(0x13d)][_0x2f0b67(0x203)],_0x358b3c[_0x2f0b67(0x13d)]['id']),_0x158c91[_0x2f0b67(0x1fc)][_0x2f0b67(0x1a3)]+=_0x358b3c[_0x2f0b67(0x1fc)][_0x2f0b67(0x1a3)],_0x158c91[_0x2f0b67(0x1fc)][_0x2f0b67(0x20e)]+=_0x358b3c[_0x2f0b67(0x1fc)][_0x2f0b67(0x20e)],_0x158c91['activations']['deleted']+=_0x358b3c[_0x2f0b67(0x1fc)][_0x2f0b67(0x1c8)];}return _0x158c91;}async function syncActivationsForSegment(_0x3ef9fa,_0x8bbb0a,_0x5b7d20,_0x2c4179,_0x498142,_0x3f9ab8,_0x101a02){const _0x3b229c=a142_0x420e71,_0x1e1a93={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3d56bf of _0x498142){try{if(_0x3d56bf[_0x3b229c(0x167)]===_0x3b229c(0x132)&&_0x3d56bf[_0x3b229c(0x169)])_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x1c0),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),await _0x3f9ab8[_0x3b229c(0x13e)](_0x3b229c(0x1cb)+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x215),()=>_0x3ef9fa[_0x3b229c(0x1e2)][_0x3b229c(0x210)](_0x8bbb0a,_0x5b7d20,_0x3d56bf['validatedRequest'])),_0x3f9ab8['onProgress']?.({'type':_0x3b229c(0x1c3),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),_0x3f9ab8[_0x3b229c(0x1d6)]?.(_0x3b229c(0x1ca)+_0x3d56bf[_0x3b229c(0x203)]+'\x27'),_0x1e1a93[_0x3b229c(0x1a3)]++;else{if(_0x3d56bf[_0x3b229c(0x167)]===_0x3b229c(0x192)&&_0x3d56bf[_0x3b229c(0x169)]&&_0x3d56bf[_0x3b229c(0x137)])_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x1a1),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),await _0x3f9ab8[_0x3b229c(0x13e)]('Updating\x20activation\x20\x27'+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x215),()=>_0x3ef9fa['segment'][_0x3b229c(0x1cd)](_0x8bbb0a,_0x5b7d20,_0x3d56bf[_0x3b229c(0x137)]['id'],_0x3d56bf['validatedRequest'])),_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x211),'segmentName':_0x2c4179,'activationName':_0x3d56bf['name']}),_0x3f9ab8['logSuccess']?.(_0x3b229c(0x11f)+_0x3d56bf['name']+'\x27'),_0x1e1a93['updated']++;else _0x3d56bf[_0x3b229c(0x167)]==='delete'&&_0x3d56bf[_0x3b229c(0x137)]&&(_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x160),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),await _0x3f9ab8[_0x3b229c(0x13e)](_0x3b229c(0x139)+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x215),()=>_0x3ef9fa['segment'][_0x3b229c(0x14e)](_0x8bbb0a,_0x5b7d20,_0x3d56bf[_0x3b229c(0x137)]['id'])),_0x3f9ab8[_0x3b229c(0x1de)]?.({'type':_0x3b229c(0x1bf),'segmentName':_0x2c4179,'activationName':_0x3d56bf[_0x3b229c(0x203)]}),_0x3f9ab8[_0x3b229c(0x174)]?.(_0x3b229c(0x1ae)+_0x3d56bf[_0x3b229c(0x203)]+'\x27'),_0x1e1a93[_0x3b229c(0x1c8)]++);}}catch(_0x2dada6){const _0x36566b=isHttp400Error(_0x2dada6),_0x143366=_0x36566b?ErrorCode[_0x3b229c(0x138)]:ErrorCode[_0x3b229c(0x133)],_0x591904=getErrorMessage(_0x2dada6);throw new SDKError(_0x143366,_0x3b229c(0x1d0)+_0x3d56bf[_0x3b229c(0x167)]+'\x20activation\x20\x27'+_0x3d56bf[_0x3b229c(0x203)]+_0x3b229c(0x154)+_0x101a02+_0x3b229c(0x187)+_0x591904,_0x2dada6);}}return _0x1e1a93;}export async function executePushFolders(_0x593ffe,_0x23d6da,_0x25c5fc,_0xf3caa,_0xcd6d39){const _0xf24bd5=a142_0x420e71,_0x1f80a8=new Map(_0x25c5fc),_0x3346e9=sortFoldersByDepth(_0x23d6da);for(const _0x2430f3 of _0x3346e9){const _0x5de689=_0x2430f3[_0xf24bd5(0x1c5)]('/'),_0x5d2c8d=_0x5de689[_0x5de689['length']-0x1],_0x57d6a2=_0x5de689['slice'](0x0,-0x1)[_0xf24bd5(0x1f5)]('/'),_0x5b26c7=_0x1f80a8[_0xf24bd5(0x11c)](_0x57d6a2);_0xcd6d39[_0xf24bd5(0x1de)]?.({'type':_0xf24bd5(0x123),'folder':_0x2430f3});const _0x2ad23f={'name':_0x5d2c8d,'parentFolderId':_0x5b26c7},_0x1a22df=await _0xcd6d39[_0xf24bd5(0x13e)]('Creating\x20folder\x20\x27'+_0x2430f3+_0xf24bd5(0x215),()=>_0x593ffe[_0xf24bd5(0x1e2)][_0xf24bd5(0x122)](_0xf3caa[_0xf24bd5(0x1f3)],_0x2ad23f));_0x1f80a8[_0xf24bd5(0x1f9)](_0x2430f3,_0x1a22df['data']['id']),_0xcd6d39[_0xf24bd5(0x1de)]?.({'type':'folder_created','folder':_0x2430f3,'folderId':_0x1a22df[_0xf24bd5(0x19a)]['id']}),_0xcd6d39[_0xf24bd5(0x1a0)]?.('Created\x20folder\x20\x27'+_0x2430f3+'\x27');}return _0x1f80a8;}export async function executePushSegmentDeletions(_0x574146,_0x1cd00f,_0x367774){const _0x13556=a142_0x420e71;if(_0x1cd00f[_0x13556(0x118)]===0x0)return 0x0;const {batchAsync:_0x3eb2d6}=await import('../../utils/async.js'),_0x3cde0f=0x5,_0x241a02=await _0x3eb2d6(_0x1cd00f,async _0x119c79=>{const _0x4ceb5e=_0x13556;return _0x367774[_0x4ceb5e(0x1de)]?.({'type':_0x4ceb5e(0x1f6),'name':_0x119c79[_0x4ceb5e(0x203)]}),await _0x574146[_0x4ceb5e(0x1e2)][_0x4ceb5e(0x1e8)](_0x119c79['id']),_0x367774[_0x4ceb5e(0x1de)]?.({'type':_0x4ceb5e(0x16d),'name':_0x119c79['name']}),_0x367774[_0x4ceb5e(0x174)]?.(_0x4ceb5e(0x19e)+_0x119c79[_0x4ceb5e(0x203)]+'\x27'),0x1;},_0x3cde0f);return _0x241a02[_0x13556(0x18c)]((_0x45a277,_0x4c45d6)=>_0x45a277+_0x4c45d6,0x0);}export async function executePushJourneys(_0x4a7ab2,_0x4e2808,_0x27c811,_0x4271b0,_0x544948){const _0x176ea7=a142_0x420e71,{journeyDefToRequest:_0x11f858}=await import(_0x176ea7(0x15d)),{activationDefToCreateRequest:_0x8c7b03,yamlRuleToApi:_0xdfa3f0,validateSegmentRule:_0x1d0003}=await import(_0x176ea7(0x125)),_0x16aa18={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0xa6a5f8=new Map(_0x27c811[_0x176ea7(0x212)]),_0x2aac3a=0x5;for(let _0x14cd45=0x0;_0x14cd45<_0x4e2808[_0x176ea7(0x118)];_0x14cd45+=_0x2aac3a){const _0x4a4aba=_0x4e2808[_0x176ea7(0x1ec)](_0x14cd45,_0x14cd45+_0x2aac3a),_0x175fa6=await Promise['all'](_0x4a4aba[_0x176ea7(0x209)](async _0x72b4e5=>{const _0xe2c4b3=_0x176ea7;if(!_0x72b4e5[_0xe2c4b3(0x1d1)]&&!_0x72b4e5[_0xe2c4b3(0x1b0)])return{'action':_0xe2c4b3(0x149),'name':_0x72b4e5['yamlConfig'][_0xe2c4b3(0x203)],'journeyId':_0x72b4e5[_0xe2c4b3(0x1fd)]?.['id']};const _0x169a20=_0x72b4e5['folderPath']?_0x27c811[_0xe2c4b3(0x1c1)]['get'](_0x72b4e5[_0xe2c4b3(0x134)]):undefined;_0x544948['onProgress']?.({'type':_0x72b4e5[_0xe2c4b3(0x1d1)]?'journey_creating':'journey_updating','name':_0x72b4e5['yamlConfig']['name']});try{const _0x5ba374=await executeSingleJourneyPush(_0x4a7ab2,_0x72b4e5,{..._0x27c811,'segmentNameToId':_0xa6a5f8},{'parentId':_0x4271b0[_0xe2c4b3(0x1f3)],'rootFolderId':_0x4271b0[_0xe2c4b3(0x1b1)],'folderId':_0x169a20,'verbose':_0x4271b0['verbose']},_0x544948,{'journeyDefToRequest':_0x11f858,'activationDefToCreateRequest':_0x8c7b03,'yamlRuleToApi':_0xdfa3f0,'validateSegmentRule':_0x1d0003});for(const [_0x580f46,_0x2440e9]of _0x5ba374[_0xe2c4b3(0x1ce)]){_0xa6a5f8[_0xe2c4b3(0x1f9)](_0x580f46,_0x2440e9),_0x16aa18[_0xe2c4b3(0x1ce)]['set'](_0x580f46,_0x2440e9);}if(_0x5ba374[_0xe2c4b3(0x185)]===_0xe2c4b3(0x1a3))_0x544948['onProgress']?.({'type':_0xe2c4b3(0x1e5),'name':_0x72b4e5[_0xe2c4b3(0x159)]['name'],'journeyId':_0x5ba374[_0xe2c4b3(0x147)]}),_0x544948['logSuccess']?.(_0xe2c4b3(0x184)+_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)]+'\x27'),_0x16aa18[_0xe2c4b3(0x1a3)]++;else _0x5ba374[_0xe2c4b3(0x185)]===_0xe2c4b3(0x20e)&&(_0x544948[_0xe2c4b3(0x1de)]?.({'type':_0xe2c4b3(0x19f),'name':_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)]}),_0x544948['logSuccess']?.(_0xe2c4b3(0x1a7)+_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)]+'\x27'),_0x16aa18[_0xe2c4b3(0x20e)]++);return{'action':_0x5ba374['action'],'name':_0x72b4e5[_0xe2c4b3(0x159)][_0xe2c4b3(0x203)],'journeyId':_0x5ba374['journeyId']};}catch(_0x43f4c6){const _0x5121fa=isHttp400Error(_0x43f4c6),_0x1a8eba=_0x5121fa?ErrorCode[_0xe2c4b3(0x1a9)]:ErrorCode[_0xe2c4b3(0x13c)],_0x53e571=getErrorMessage(_0x43f4c6);throw new SDKError(_0x1a8eba,_0xe2c4b3(0x1d0)+(_0x72b4e5[_0xe2c4b3(0x1d1)]?_0xe2c4b3(0x132):_0xe2c4b3(0x192))+_0xe2c4b3(0x16f)+_0x72b4e5[_0xe2c4b3(0x180)]+_0xe2c4b3(0x187)+_0x53e571,_0x43f4c6);}}));_0x16aa18[_0x176ea7(0x1e6)]['push'](..._0x175fa6);}return _0x16aa18;}async function matchExistingJourneySegments(_0x29ac10,_0x4139df,_0x5f581c,_0x3a12c6,_0x265966){const _0x2f84e2=a142_0x420e71;if(!_0x4139df[_0x2f84e2(0x1fd)]||!_0x4139df[_0x2f84e2(0x159)][_0x2f84e2(0x19c)])return;const _0xb25962=new Map(),_0x557442=new Set();for(const _0x43bb24 of Object['keys'](_0x4139df[_0x2f84e2(0x159)][_0x2f84e2(0x19c)])){const _0x275516=generateDeterministicJourneySegmentName(_0x4139df[_0x2f84e2(0x159)][_0x2f84e2(0x203)],_0x43bb24);_0xb25962[_0x2f84e2(0x1f9)](_0x275516,_0x43bb24),_0x557442['add'](_0x43bb24);}const _0x5360c3=[],_0x4213bb=collectSegmentIdsFromJourneyApi(_0x4139df[_0x2f84e2(0x1fd)]);for(const _0x2485f3 of _0x4213bb){const _0x385ca7=await fetchSegment(_0x29ac10,_0x5f581c,_0x2485f3,_0x3a12c6);if(!_0x385ca7?.[_0x2f84e2(0x203)])continue;const _0x1a79e5=_0xb25962[_0x2f84e2(0x11c)](_0x385ca7[_0x2f84e2(0x203)]);_0x1a79e5?(_0x265966['set'](_0x1a79e5,_0x2485f3),_0x557442[_0x2f84e2(0x20f)](_0x1a79e5)):_0x5360c3[_0x2f84e2(0x170)]({'id':_0x2485f3,'seg':_0x385ca7});}if(_0x557442[_0x2f84e2(0x12c)]>0x0&&_0x5360c3[_0x2f84e2(0x118)]>0x0){const {localExpandedRuleToNames:_0x32454c}=buildLocalExpandedRuleMappings(_0x4139df['yamlConfig']),_0x1464c0=new Map();for(const {id:_0x42f8e2,seg:_0x14034b}of _0x5360c3){if(_0x14034b[_0x2f84e2(0x196)]){const _0x4feb49=apiRuleToYaml(_0x14034b['rule']);_0x1464c0[_0x2f84e2(0x1f9)](_0x42f8e2,_0x4feb49);}}for(const {id:_0x423596,seg:_0x5ec53c}of _0x5360c3){if(!_0x5ec53c['rule'])continue;const _0xba2cb0=_0x1464c0[_0x2f84e2(0x11c)](_0x423596);if(!_0xba2cb0)continue;const _0x4190a2=serializeExpandedRule(_0xba2cb0,_0x1464c0),_0xbbc2e9=_0x32454c[_0x2f84e2(0x11c)](_0x4190a2);if(_0xbbc2e9){const _0x56ef71=_0xbbc2e9[_0x2f84e2(0x172)](_0x344ac7=>_0x557442[_0x2f84e2(0x1c2)](_0x344ac7));_0x56ef71&&(_0x265966['set'](_0x56ef71,_0x423596),_0x557442['delete'](_0x56ef71),logger['debug'](_0x2f84e2(0x1f8)+_0x5ec53c[_0x2f84e2(0x203)]+_0x2f84e2(0x198)+_0x56ef71+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0xb6b45a,_0x5df031,_0x1152ec,_0x66ad3c,_0x221b81,_0x3f3bbd){const _0x24ec14=a142_0x420e71,{journeyDefToRequest:_0x22bdc5,activationDefToCreateRequest:_0x2d34c9,yamlRuleToApi:_0x1a0e1f,validateSegmentRule:_0x253f50}=_0x3f3bbd,_0x5a8eed=new Map(),_0x49bbda=new Map();recoverSegmentIdsFromPushRecovery(_0x5df031,_0x5a8eed,_0x1152ec[_0x24ec14(0x212)]);const _0x8e455d=new Map(),_0x36f8dd=new Map(),_0x55508f=new Map();let _0x47e46f;const _0x27890f=async()=>{const _0x158db4=_0x24ec14;if(_0x47e46f)return;_0x47e46f=new Map();if(!_0x5df031['existingJourney'])return;const _0xb1f328=await _0xb6b45a[_0x158db4(0x16c)][_0x158db4(0x17f)](_0x5df031['existingJourney']['id']);for(const _0x499a80 of _0xb1f328){const _0x29aa17=journeyActivationStepToYaml(_0x499a80,_0x1152ec[_0x158db4(0x143)],_0x1152ec[_0x158db4(0x1af)]),_0xc4195d=activationSignature(_0x29aa17);!_0x47e46f[_0x158db4(0x1c2)](_0xc4195d)&&_0x47e46f[_0x158db4(0x1f9)](_0xc4195d,_0x499a80['id']),_0x29aa17[_0x158db4(0x203)]&&_0x49bbda[_0x158db4(0x1f9)](_0x29aa17[_0x158db4(0x203)],_0x499a80['id']);}};await matchExistingJourneySegments(_0xb6b45a,_0x5df031,_0x66ad3c[_0x24ec14(0x1f3)],_0x1152ec[_0x24ec14(0x199)],_0x1152ec['segmentNameToId']);const _0x3de4e3={'resolveSegmentId':async _0x54a782=>{const _0xf48f4=_0x24ec14,_0x4b5ad2=_0x1152ec[_0xf48f4(0x212)][_0xf48f4(0x11c)](_0x54a782);if(!_0x4b5ad2)throw new SDKError(ErrorCode[_0xf48f4(0x1fb)],_0xf48f4(0x141)+_0x54a782+_0xf48f4(0x15b)+_0x5df031[_0xf48f4(0x159)][_0xf48f4(0x203)]+')');return _0x4b5ad2;},'resolveEmbeddedSegmentId':async(_0x35ced3,_0x4ae4f3)=>{const _0x51c2e6=_0x24ec14,_0x398e92=_0x1152ec[_0x51c2e6(0x212)]['get'](_0x35ced3);if(_0x398e92)return _0x398e92;const _0x252e82=_0x1152ec['existingSegments'][_0x51c2e6(0x172)](_0x1d812b=>_0x1d812b[_0x51c2e6(0x203)]===_0x35ced3);if(_0x252e82)return _0x1152ec[_0x51c2e6(0x212)]['set'](_0x35ced3,_0x252e82['id']),_0x252e82['id'];if(_0x5df031[_0x51c2e6(0x1d1)]){const {stageName:_0x55ecf5,criteriaName:_0x1371db}=findSegmentCriteriaLocation(_0x5df031[_0x51c2e6(0x159)],_0x35ced3);return _0x253f50(_0x35ced3,_0x4ae4f3[_0x51c2e6(0x196)]),_0x36f8dd['set'](_0x35ced3,{'definition':_0x4ae4f3,'stageName':_0x55ecf5,'criteriaName':_0x1371db}),createPendingSegmentId(_0x35ced3);}const _0x171848=_0x5df031[_0x51c2e6(0x1fd)]?.['id'];if(!_0x171848)throw new SDKError(ErrorCode['INTERNAL'],_0x51c2e6(0x164));const _0x394a39=_0x8e455d[_0x51c2e6(0x11c)](_0x35ced3);if(_0x394a39)return _0x394a39;const _0x540710=((async()=>{const _0x29f330=_0x51c2e6;_0x253f50(_0x35ced3,_0x4ae4f3['rule']);const _0x4cf12e=generateDeterministicJourneySegmentName(_0x5df031[_0x29f330(0x159)][_0x29f330(0x203)],_0x35ced3),_0x3b8d2e=_0x1152ec[_0x29f330(0x199)][_0x29f330(0x172)](_0x49efd7=>_0x49efd7[_0x29f330(0x203)]===_0x4cf12e),_0x5467ad=createSegmentIdResolver(_0x1152ec[_0x29f330(0x212)],_0x35ced3),_0x2a4921=await resolveRuleSegmentIds(_0x4ae4f3[_0x29f330(0x196)],_0x5467ad);let _0x374f18;return _0x3b8d2e?(await _0xb6b45a['segment'][_0x29f330(0x177)](_0x66ad3c[_0x29f330(0x1f3)],_0x3b8d2e['id'],{'description':_0x4ae4f3[_0x29f330(0x131)]||'Entry\x20criteria:\x20'+_0x35ced3,'rule':_0x1a0e1f(_0x2a4921,!![]),'countPopulation':!![]}),_0x374f18=_0x3b8d2e['id'],saveSegmentToPushRecovery(_0x5df031[_0x29f330(0x180)],_0x5df031[_0x29f330(0x159)][_0x29f330(0x203)],_0x35ced3,{'segmentId':_0x374f18,'uniqueServerName':_0x4cf12e,'createdAt':new Date()['toISOString']()})):_0x374f18=await createOrRecoverEmbeddedSegment(_0xb6b45a,_0x5df031,{'localName':_0x35ced3,'uniqueSegmentName':_0x4cf12e,'description':_0x4ae4f3['description']||_0x29f330(0x151)+_0x35ced3,'journeyId':_0x171848,'resolvedRule':_0x2a4921,'parentId':_0x66ad3c[_0x29f330(0x1f3)],'folderId':_0x66ad3c[_0x29f330(0x1b1)]||''},_0x1a0e1f),_0x1152ec['segmentNameToId'][_0x29f330(0x1f9)](_0x35ced3,_0x374f18),_0x5a8eed['set'](_0x35ced3,_0x374f18),_0x374f18;})());_0x8e455d['set'](_0x35ced3,_0x540710);try{return await _0x540710;}finally{_0x8e455d[_0x51c2e6(0x20f)](_0x35ced3);}},'resolveActivationId':async _0x510ead=>{const _0x115907=_0x24ec14,_0x58c8a8=_0x49bbda[_0x115907(0x11c)](_0x510ead);if(_0x58c8a8)return _0x58c8a8;if(_0x5df031[_0x115907(0x1fd)]){await _0x27890f();const _0xccbd0=_0x49bbda[_0x115907(0x11c)](_0x510ead);if(_0xccbd0)return _0xccbd0;}throw new SDKError(ErrorCode[_0x115907(0x1a2)],'Activation\x20not\x20found:\x20'+_0x510ead+_0x115907(0x15b)+_0x5df031[_0x115907(0x159)][_0x115907(0x203)]+_0x115907(0x1f0)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x52f4b8,_0x34e72e)=>{const _0x587eac=_0x24ec14,_0x1532cf=_0x49bbda[_0x587eac(0x11c)](_0x52f4b8);if(_0x1532cf)return _0x1532cf;if(_0x5df031[_0x587eac(0x1d1)])return _0x55508f[_0x587eac(0x1f9)](_0x52f4b8,_0x34e72e),createPendingActivationId(_0x52f4b8);if(_0x5df031[_0x587eac(0x1fd)]){await _0x27890f();const _0x1d2931=_0x49bbda['get'](_0x34e72e['name']);if(_0x1d2931)return _0x49bbda[_0x587eac(0x1f9)](_0x52f4b8,_0x1d2931),_0x1d2931;const _0x1a32e1=activationSignature(_0x34e72e),_0x491683=_0x47e46f?.[_0x587eac(0x11c)](_0x1a32e1);if(_0x491683)return _0x49bbda[_0x587eac(0x1f9)](_0x52f4b8,_0x491683),_0x491683;const _0x1bf069=await _0x2d34c9(_0x34e72e,_0x1152ec['activationContext']),_0x427c37={..._0x1bf069,..._0x34e72e[_0x587eac(0x16a)]!==undefined&&{'runAfterJourneyRefresh':_0x34e72e['run_after_journey_refresh']}},_0x58817a=await _0xb6b45a[_0x587eac(0x16c)][_0x587eac(0x210)](_0x5df031[_0x587eac(0x1fd)]['id'],_0x427c37);return _0x49bbda[_0x587eac(0x1f9)](_0x52f4b8,_0x58817a['id']),_0x58817a['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x1d2a50=>{const _0x1ab3cc=_0x24ec14;try{return await _0xb6b45a['journey'][_0x1ab3cc(0x171)](_0x66ad3c['parentId'],_0x1d2a50);}catch(_0x1a9fe8){throw new SDKError(ErrorCode[_0x1ab3cc(0x1a2)],_0x1ab3cc(0x128)+_0x1d2a50+_0x1ab3cc(0x20b)+_0x5df031[_0x1ab3cc(0x159)][_0x1ab3cc(0x203)]+'\x27)',_0x1a9fe8);}},'resolveStageId':async(_0x19a2b2,_0x3d8061)=>{const _0x107ee5=_0x24ec14,_0x3ea3ac=await _0xb6b45a['journey'][_0x107ee5(0x1db)](_0x19a2b2),_0x4182d5=_0x3ea3ac['attributes'][_0x107ee5(0x1b2)][_0x107ee5(0x172)](_0x4c39b3=>_0x4c39b3[_0x107ee5(0x203)][_0x107ee5(0x179)]()===_0x3d8061[_0x107ee5(0x179)]());if(!_0x4182d5?.['id'])throw new SDKError(ErrorCode[_0x107ee5(0x1a2)],_0x107ee5(0x19b)+_0x3d8061+_0x107ee5(0x190)+(_0x3ea3ac[_0x107ee5(0x161)]['journeyBundleName']||_0x3ea3ac[_0x107ee5(0x161)][_0x107ee5(0x203)])+'\x27');return _0x4182d5['id'];}},_0x1c54f9=await _0x22bdc5(_0x5df031[_0x24ec14(0x159)],_0x66ad3c['parentId'],_0x3de4e3),_0x13061e=_0x66ad3c[_0x24ec14(0x201)]||_0x66ad3c['rootFolderId'];_0x13061e&&(_0x1c54f9[_0x24ec14(0x13a)]={'parentFolder':{'data':{'id':_0x13061e,'type':'folder'}}});if(_0x5df031[_0x24ec14(0x1d1)]){if(_0x36f8dd['size']>0x0||_0x55508f[_0x24ec14(0x12c)]>0x0)return await executeThreeStepJourneyCreate(_0xb6b45a,_0x5df031,_0x1c54f9,{'pendingEmbeddedSegments':_0x36f8dd,'pendingEmbeddedActivations':_0x55508f,'embeddedSegmentNameToId':_0x5a8eed,'journeyActivationNameToId':_0x49bbda},{..._0x66ad3c,'effectiveFolderId':_0x13061e},_0x1152ec,_0x221b81,_0x3f3bbd);else{ensureJourneyDefaults(_0x1c54f9[_0x24ec14(0x161)]);const _0x314b3a=await _0xb6b45a[_0x24ec14(0x16c)][_0x24ec14(0x132)](_0x1c54f9);return deletePushRecovery(_0x5df031[_0x24ec14(0x180)]),{'action':'created','journeyId':_0x314b3a['id'],'embeddedSegmentNameToId':_0x5a8eed};}}else{if(_0x5df031['hasChanges']&&_0x5df031[_0x24ec14(0x1fd)]){_0x1c54f9['id']=_0x5df031[_0x24ec14(0x1fd)]['id'];const _0x4cdc00=_0x1c54f9[_0x24ec14(0x161)];_0x5df031['existingJourney'][_0x24ec14(0x161)]?.[_0x24ec14(0x117)]&&(_0x4cdc00[_0x24ec14(0x117)]=_0x5df031['existingJourney']['attributes'][_0x24ec14(0x117)]);const _0x2bdff2=_0x5df031[_0x24ec14(0x1fd)][_0x24ec14(0x161)]?.['journeyStages'];return _0x2bdff2&&_0x1c54f9[_0x24ec14(0x161)][_0x24ec14(0x1b2)]&&injectExistingStageIds(_0x1c54f9[_0x24ec14(0x161)]['journeyStages'],_0x2bdff2),ensureJourneyDefaults(_0x4cdc00),await _0xb6b45a['journey']['update'](_0x5df031['existingJourney']['id'],_0x1c54f9),deletePushRecovery(_0x5df031['absolutePath']),{'action':_0x24ec14(0x20e),'journeyId':_0x5df031[_0x24ec14(0x1fd)]['id'],'embeddedSegmentNameToId':_0x5a8eed};}}return deletePushRecovery(_0x5df031[_0x24ec14(0x180)]),{'action':_0x24ec14(0x149),'journeyId':_0x5df031[_0x24ec14(0x1fd)]?.['id'],'embeddedSegmentNameToId':_0x5a8eed};}function findSegmentCriteriaLocation(_0x42db25,_0x2c31b3){const _0x5a4cfd=a142_0x420e71,_0x194c03=_0x42db25[_0x5a4cfd(0x12b)]||_0x42db25[_0x5a4cfd(0x12a)]?.[0x0]?.[_0x5a4cfd(0x12b)]||[];let _0x4730e5=_0x5a4cfd(0x1b5),_0x1d0f08=_0x2c31b3;const _0x5bd7a1=_0x42db25[_0x5a4cfd(0x146)]||_0x42db25['journeys']?.[0x0]?.[_0x5a4cfd(0x146)];if(_0x5bd7a1?.[_0x5a4cfd(0x1e2)]===_0x2c31b3)return{'stageName':'goal','criteriaName':_0x5bd7a1['name']||_0x2c31b3};_0x7261ac:for(const _0x3cbe57 of _0x194c03){if(_0x3cbe57[_0x5a4cfd(0x214)]?.['segment']===_0x2c31b3){_0x4730e5=_0x3cbe57[_0x5a4cfd(0x203)],_0x1d0f08=_0x3cbe57[_0x5a4cfd(0x214)][_0x5a4cfd(0x203)]||_0x2c31b3;break;}if(_0x3cbe57[_0x5a4cfd(0x1da)])for(const _0x203023 of _0x3cbe57[_0x5a4cfd(0x1da)]){if(_0x203023[_0x5a4cfd(0x167)]==='decision_point'&&_0x203023['with']?.[_0x5a4cfd(0x1d8)])for(const _0x5e590d of _0x203023[_0x5a4cfd(0x200)][_0x5a4cfd(0x1d8)]){if(_0x5e590d[_0x5a4cfd(0x1e2)]===_0x2c31b3){_0x4730e5=_0x3cbe57[_0x5a4cfd(0x203)],_0x1d0f08=_0x5e590d[_0x5a4cfd(0x203)]||_0x2c31b3;break _0x7261ac;}}}}return{'stageName':_0x4730e5,'criteriaName':_0x1d0f08};}async function executeThreeStepJourneyCreate(_0x580b53,_0x118a21,_0x3f48b1,_0x134bb6,_0x51f307,_0x174d46,_0x28dfcd,_0x462b1c){const _0x17a593=a142_0x420e71,{activationDefToCreateRequest:_0x373a33,yamlRuleToApi:_0x26e149}=_0x462b1c,{pendingEmbeddedSegments:_0x2b87e7,pendingEmbeddedActivations:_0x1fc038,embeddedSegmentNameToId:_0x2bbef6}=_0x134bb6,_0x54f468=JSON[_0x17a593(0x1ff)](JSON[_0x17a593(0x1e3)](_0x3f48b1));ensureJourneyDefaults(_0x54f468['attributes']),stripPendingIds(_0x54f468);const _0x442803=await _0x580b53[_0x17a593(0x16c)][_0x17a593(0x132)](_0x54f468),_0x2639d3=_0x442803['id'],_0x5b0110=new Map();for(const _0x447cba of _0x442803[_0x17a593(0x161)]['journeyStages']){_0x5b0110[_0x17a593(0x1f9)](_0x447cba[_0x17a593(0x203)][_0x17a593(0x179)](),_0x447cba['id']);}recoverSegmentIdsFromPushRecovery(_0x118a21,_0x2bbef6,_0x174d46[_0x17a593(0x212)]);for(const [_0x29d810,{definition:_0x4bdc91}]of _0x2b87e7){if(_0x2bbef6[_0x17a593(0x1c2)](_0x29d810)){_0x28dfcd[_0x17a593(0x1de)]?.({'type':_0x17a593(0x12e),'journeyName':_0x118a21['yamlConfig'][_0x17a593(0x203)],'segmentName':_0x29d810});continue;}const _0x4f9a98=generateDeterministicJourneySegmentName(_0x118a21['yamlConfig']['name'],_0x29d810);_0x28dfcd['onProgress']?.({'type':_0x17a593(0x165),'journeyName':_0x118a21[_0x17a593(0x159)][_0x17a593(0x203)],'segmentName':_0x29d810});const _0x3a9da3=createSegmentIdResolver(_0x174d46[_0x17a593(0x212)],_0x29d810),_0x36debc=await resolveRuleSegmentIds(_0x4bdc91[_0x17a593(0x196)],_0x3a9da3),_0x2cc067=await createOrRecoverEmbeddedSegment(_0x580b53,_0x118a21,{'localName':_0x29d810,'uniqueSegmentName':_0x4f9a98,'description':_0x4bdc91['description']||'Entry\x20criteria:\x20'+_0x29d810,'journeyId':_0x2639d3,'resolvedRule':_0x36debc,'parentId':_0x51f307[_0x17a593(0x1f3)],'folderId':_0x51f307[_0x17a593(0x173)]||''},_0x26e149);_0x2bbef6[_0x17a593(0x1f9)](_0x29d810,_0x2cc067),_0x174d46[_0x17a593(0x212)][_0x17a593(0x1f9)](_0x29d810,_0x2cc067),_0x28dfcd['onProgress']?.({'type':_0x17a593(0x12e),'journeyName':_0x118a21[_0x17a593(0x159)]['name'],'segmentName':_0x29d810});}const _0x2fb20d=new Map();for(const [_0x54abd7,_0x44d8d3]of _0x1fc038){_0x28dfcd[_0x17a593(0x1de)]?.({'type':_0x17a593(0x1f7),'journeyName':_0x118a21[_0x17a593(0x159)][_0x17a593(0x203)],'activationName':_0x54abd7});const _0x1cc7c8=await _0x373a33(_0x44d8d3,_0x174d46[_0x17a593(0x1b8)]),_0x27e504={..._0x1cc7c8,..._0x44d8d3[_0x17a593(0x16a)]!==undefined&&{'runAfterJourneyRefresh':_0x44d8d3[_0x17a593(0x16a)]}},_0x4be451=await _0x580b53[_0x17a593(0x16c)][_0x17a593(0x210)](_0x2639d3,_0x27e504);_0x2fb20d[_0x17a593(0x1f9)](_0x54abd7,_0x4be451['id']),_0x134bb6[_0x17a593(0x17d)][_0x17a593(0x1f9)](_0x54abd7,_0x4be451['id']),_0x28dfcd[_0x17a593(0x1de)]?.({'type':_0x17a593(0x1a6),'journeyName':_0x118a21[_0x17a593(0x159)][_0x17a593(0x203)],'activationName':_0x54abd7});}const _0x3e57d1=JSON['parse'](JSON[_0x17a593(0x1e3)](_0x3f48b1));return _0x3e57d1['id']=_0x2639d3,ensureJourneyDefaults(_0x3e57d1[_0x17a593(0x161)]),resolvePendingIdsInRequest(_0x3e57d1,_0x3f48b1,_0x5b0110,_0x2bbef6,_0x2fb20d,_0x28dfcd),await _0x580b53['journey'][_0x17a593(0x192)](_0x2639d3,_0x3e57d1),deletePushRecovery(_0x118a21[_0x17a593(0x180)]),{'action':_0x17a593(0x1a3),'journeyId':_0x2639d3,'embeddedSegmentNameToId':_0x2bbef6};}export function stripWaitStepPendingIds(_0xa1fed5){const _0x243e83=a142_0x420e71,_0x59eddd=_0xa1fed5[_0x243e83(0x150)]&&isPendingSegmentId(_0xa1fed5[_0x243e83(0x150)]),_0x13f480=_0xa1fed5[_0x243e83(0x15a)]?.[_0x243e83(0x1b6)](_0x477a30=>_0x477a30[_0x243e83(0x20a)]&&isPendingSegmentId(_0x477a30[_0x243e83(0x20a)]));(_0x59eddd||_0x13f480)&&(_0xa1fed5[_0x243e83(0x1cf)]='Duration',_0xa1fed5['waitStep']=0x1,_0xa1fed5[_0x243e83(0x197)]='day',delete _0xa1fed5[_0x243e83(0x150)],delete _0xa1fed5[_0x243e83(0x17b)],delete _0xa1fed5[_0x243e83(0x1b7)],delete _0xa1fed5[_0x243e83(0x15a)]);}export function resolveWaitStepPendingIds(_0x3d2caa,_0x2c4a9b,_0x10c679,_0x541b18){const _0x1bf571=a142_0x420e71;if(_0x2c4a9b['conditionSegmentId']&&isPendingSegmentId(_0x2c4a9b['conditionSegmentId'])){const _0x15ff2d=_0x10c679(_0x2c4a9b[_0x1bf571(0x150)],'stage\x20\x27'+_0x541b18+'\x27\x20wait\x20condition');_0x15ff2d&&(_0x3d2caa[_0x1bf571(0x1cf)]=_0x1bf571(0x148),_0x3d2caa[_0x1bf571(0x150)]=_0x15ff2d,delete _0x3d2caa['waitStep'],delete _0x3d2caa[_0x1bf571(0x197)],_0x2c4a9b[_0x1bf571(0x17b)]!==undefined&&(_0x3d2caa[_0x1bf571(0x17b)]=_0x2c4a9b[_0x1bf571(0x17b)]),_0x2c4a9b['conditionTimeoutUnit']&&(_0x3d2caa['conditionTimeoutUnit']=_0x2c4a9b[_0x1bf571(0x1b7)]));}if(_0x2c4a9b[_0x1bf571(0x15a)]){const _0x4c0e78=_0x2c4a9b[_0x1bf571(0x15a)]['some'](_0x186e97=>_0x186e97['segmentId']&&isPendingSegmentId(_0x186e97[_0x1bf571(0x20a)]));if(_0x4c0e78){const _0x3b15e7=_0x2c4a9b[_0x1bf571(0x15a)][_0x1bf571(0x209)](_0x5c9676=>{const _0x4d9417=_0x1bf571;if(_0x5c9676[_0x4d9417(0x20a)]&&isPendingSegmentId(_0x5c9676['segmentId'])){const _0x455536=_0x10c679(_0x5c9676['segmentId'],_0x4d9417(0x20c)+_0x541b18+'\x27\x20wait\x20condition');return{..._0x5c9676,'segmentId':_0x455536||_0x5c9676[_0x4d9417(0x20a)]};}return{..._0x5c9676};});_0x3d2caa[_0x1bf571(0x1cf)]=_0x1bf571(0x148),_0x3d2caa[_0x1bf571(0x15a)]=_0x3b15e7,delete _0x3d2caa['waitStep'],delete _0x3d2caa[_0x1bf571(0x197)],delete _0x3d2caa[_0x1bf571(0x150)],delete _0x3d2caa[_0x1bf571(0x17b)],delete _0x3d2caa[_0x1bf571(0x1b7)];}}}function stripPendingIds(_0x41fde7){const _0x51312b=a142_0x420e71;_0x41fde7['attributes'][_0x51312b(0x146)]?.['segmentId']&&isPendingSegmentId(_0x41fde7[_0x51312b(0x161)][_0x51312b(0x146)][_0x51312b(0x20a)])&&delete _0x41fde7[_0x51312b(0x161)]['goal'];for(const _0xa32129 of _0x41fde7['attributes'][_0x51312b(0x1b2)]||[]){_0xa32129[_0x51312b(0x1ed)]?.[_0x51312b(0x20a)]&&isPendingSegmentId(_0xa32129[_0x51312b(0x1ed)][_0x51312b(0x20a)])&&delete _0xa32129['entryCriteria'];_0xa32129[_0x51312b(0x124)]?.[_0x51312b(0x20a)]&&isPendingSegmentId(_0xa32129[_0x51312b(0x124)][_0x51312b(0x20a)])&&delete _0xa32129[_0x51312b(0x124)];_0xa32129[_0x51312b(0x1c7)]&&(_0xa32129[_0x51312b(0x1c7)]=_0xa32129['exitCriterias'][_0x51312b(0x1be)](_0x53d1ee=>!_0x53d1ee['segmentId']||!isPendingSegmentId(_0x53d1ee[_0x51312b(0x20a)])));if(_0xa32129[_0x51312b(0x1da)])for(const _0x3ae480 of Object[_0x51312b(0x14c)](_0xa32129[_0x51312b(0x1da)])){const _0x8bbf0e=_0xa32129[_0x51312b(0x1da)][_0x3ae480];_0x8bbf0e[_0x51312b(0x167)]===_0x51312b(0x181)&&_0x8bbf0e['journeyActivationStepId']&&isPendingActivationId(_0x8bbf0e['journeyActivationStepId'])&&(_0x8bbf0e[_0x51312b(0x18b)]='');if(_0x8bbf0e[_0x51312b(0x167)]==='DecisionPoint'&&_0x8bbf0e['branches'])for(const _0xbd781 of _0x8bbf0e[_0x51312b(0x1d8)]){_0xbd781[_0x51312b(0x20a)]&&isPendingSegmentId(_0xbd781['segmentId'])&&(_0xbd781[_0x51312b(0x20a)]='');}_0x8bbf0e[_0x51312b(0x167)]==='WaitStep'&&stripWaitStepPendingIds(_0x8bbf0e);}}}function resolvePendingIdsInRequest(_0x583db0,_0x37031e,_0x5c56e8,_0x259704,_0x35b9d3,_0x1d57c5){const _0x4b32e3=a142_0x420e71,_0x1fdd07=(_0x36255d,_0x30e1f8)=>{const _0x2048c7=a142_0x1102;if(!isPendingSegmentId(_0x36255d))return _0x36255d;const _0x99bb6f=extractPendingSegmentName(_0x36255d),_0x2c2376=_0x259704[_0x2048c7(0x11c)](_0x99bb6f);return!_0x2c2376&&_0x1d57c5[_0x2048c7(0x126)]?.(_0x2048c7(0x14b)+_0x99bb6f+_0x2048c7(0x206)+_0x30e1f8),_0x2c2376;};if(_0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x146)]?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x583db0['attributes']['goal'][_0x4b32e3(0x20a)])){const _0x5deaed=_0x1fdd07(_0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x146)][_0x4b32e3(0x20a)],_0x4b32e3(0x142));_0x5deaed&&(_0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x146)][_0x4b32e3(0x20a)]=_0x5deaed);}for(const _0x2b4fd4 of _0x583db0[_0x4b32e3(0x161)][_0x4b32e3(0x1b2)]||[]){const _0x31702c=_0x5c56e8[_0x4b32e3(0x11c)](_0x2b4fd4[_0x4b32e3(0x203)]['toLowerCase']());_0x31702c&&(_0x2b4fd4['id']=_0x31702c);if(_0x2b4fd4['entryCriteria']?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2b4fd4['entryCriteria']['segmentId'])){const _0x202f69=_0x1fdd07(_0x2b4fd4[_0x4b32e3(0x1ed)][_0x4b32e3(0x20a)],_0x4b32e3(0x20c)+_0x2b4fd4[_0x4b32e3(0x203)]+_0x4b32e3(0x1e4));_0x202f69&&(_0x2b4fd4[_0x4b32e3(0x1ed)][_0x4b32e3(0x20a)]=_0x202f69);}if(_0x2b4fd4[_0x4b32e3(0x1c7)])for(const _0x2ee71c of _0x2b4fd4['exitCriterias']){if(_0x2ee71c[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2ee71c[_0x4b32e3(0x20a)])){const _0x5deb3a=_0x1fdd07(_0x2ee71c[_0x4b32e3(0x20a)],_0x4b32e3(0x20c)+_0x2b4fd4[_0x4b32e3(0x203)]+'\x27\x20exit\x20criteria');_0x5deb3a&&(_0x2ee71c[_0x4b32e3(0x20a)]=_0x5deb3a);}}if(_0x2b4fd4[_0x4b32e3(0x124)]?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2b4fd4[_0x4b32e3(0x124)]['segmentId'])){const _0x1bc653=_0x1fdd07(_0x2b4fd4['milestone'][_0x4b32e3(0x20a)],_0x4b32e3(0x20c)+_0x2b4fd4[_0x4b32e3(0x203)]+_0x4b32e3(0x17a));_0x1bc653&&(_0x2b4fd4['milestone'][_0x4b32e3(0x20a)]=_0x1bc653);}if(_0x2b4fd4[_0x4b32e3(0x1da)]){const _0x49d71e=_0x4b7998=>_0x37031e[_0x4b32e3(0x161)][_0x4b32e3(0x1b2)]?.[_0x4b32e3(0x172)](_0x2ce4ac=>_0x2ce4ac[_0x4b32e3(0x203)][_0x4b32e3(0x179)]()===_0x2b4fd4[_0x4b32e3(0x203)][_0x4b32e3(0x179)]())?.[_0x4b32e3(0x1da)]?.[_0x4b7998];for(const _0x367f89 of Object[_0x4b32e3(0x14c)](_0x2b4fd4[_0x4b32e3(0x1da)])){const _0x57b99c=_0x2b4fd4['steps'][_0x367f89],_0x5d1428=_0x49d71e(_0x367f89);if(_0x57b99c['type']===_0x4b32e3(0x181)&&_0x57b99c[_0x4b32e3(0x18b)]&&(isPendingActivationId(_0x57b99c[_0x4b32e3(0x18b)])||_0x57b99c[_0x4b32e3(0x18b)]==='')){if(_0x5d1428?.[_0x4b32e3(0x18b)]&&isPendingActivationId(_0x5d1428[_0x4b32e3(0x18b)])){const _0x200579=extractPendingActivationName(_0x5d1428[_0x4b32e3(0x18b)]),_0xbf1afc=_0x35b9d3[_0x4b32e3(0x11c)](_0x200579);_0xbf1afc&&(_0x57b99c[_0x4b32e3(0x18b)]=_0xbf1afc);}}if(_0x57b99c['type']===_0x4b32e3(0x16e)&&_0x57b99c[_0x4b32e3(0x1d8)]&&_0x5d1428?.['branches'])for(let _0x5f26c7=0x0;_0x5f26c7<_0x57b99c[_0x4b32e3(0x1d8)][_0x4b32e3(0x118)];_0x5f26c7++){const _0x2025ae=_0x57b99c[_0x4b32e3(0x1d8)][_0x5f26c7],_0x2e8f88=_0x5d1428[_0x4b32e3(0x1d8)][_0x5f26c7];if(_0x2e8f88?.[_0x4b32e3(0x20a)]&&isPendingSegmentId(_0x2e8f88['segmentId'])){const _0x16739c=_0x1fdd07(_0x2e8f88['segmentId'],'stage\x20\x27'+_0x2b4fd4['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2025ae['name']||_0x5f26c7)+'\x27');_0x16739c&&(_0x2025ae[_0x4b32e3(0x20a)]=_0x16739c);}}_0x57b99c['type']==='WaitStep'&&_0x5d1428?.[_0x4b32e3(0x167)]===_0x4b32e3(0x12f)&&resolveWaitStepPendingIds(_0x57b99c,_0x5d1428,_0x1fdd07,_0x2b4fd4['name']);}}}}function a142_0x161b(){const _0x3abbb1=['localName','entries','journeyBundleId','match','Deleted\x20activation\x20\x27','connectionIdToNameMap','hasChanges','rootFolderId','journeyStages','from','Updating\x20segment\x20\x27','entry','some','conditionTimeoutUnit','activationContext','createJourneySegment','Creating\x20segment\x20\x27','segment_creating','uniqueSegmentName','connector_config','filter','activation_deleted','activation_creating','folderPathToId','has','activation_created','nameToType','split','diff','exitCriterias','deleted','SEGMENT_UPDATE_ERROR','Created\x20activation\x20\x27','Creating\x20activation\x20\x27','replace','updateActivation','embeddedSegmentNameToId','waitStepType','Failed\x20to\x20','isNew','segment_created','valid','activationsBySegmentId','resolvedRule','logSuccess','behavior','branches','relative','steps','getJourney','idToName','dirname','onProgress','7ODXynN','getActivation','Failed\x20to\x20resolve\x20activation\x20','segment','stringify','\x27\x20entry\x20criteria','journey_created','results','debug','deleteSegment','deps','parseDocument','index','slice','entryCriteria','__pending_act_','and\x20the\x20server\x20segment,\x20then\x20retry.',').\x20','message','6919855TBFdrm','parentId','sort','join','segment_deleting','embedded_activation_creating','Matched\x20server\x20segment\x20\x27','set','draft','SEGMENT_NOT_FOUND','activations','existingJourney','activationStepsById','parse','with','folderId','../../utils/async.js','name','84610AyypRi','getSegmentEntity\x20also\x20failed\x20for\x20','\x27\x20for\x20','item','uniqueServerName','map','segmentId','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','stage\x20\x27','7595004IwaSFo','updated','delete','createActivation','activation_updated','segmentNameToId','versionNumber','entry_criteria','\x27...','journeyBundleName','length','resolveSegment','skipSegments','1882581PNIIWu','get','toISOString','activationActions','Updated\x20activation\x20\x27','max','activation_','createFolder','folder_creating','milestone','./child-segment-yaml.js','logWarning','columns','Journey\x20\x27','Fetching\x20','journeys','stages','size','isArray','embedded_segment_created','WaitStep','createdSegmentIds','description','create','ACTIVATION_UPDATE_ERROR','folderPath','Failed\x20to\x20fetch\x20referenced\x20segment\x20','.$1.push-recovery.json','existingActivation','ACTIVATION_SYNTAX_ERROR','Deleting\x20activation\x20\x27','relationships','SEGMENT_SYNTAX_ERROR','JOURNEY_UPDATE_ERROR','createdSegmentId','withProgress','toString','hex','Segment\x20not\x20found:\x20','goal\x20criteria','idToEmailMap','getSegment\x20failed\x20for\x20','trim','goal','journeyId','Condition','unchanged','52988BVbLvK','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','keys','Updated\x20segment\x20\x27','deleteActivation','includes','conditionSegmentId','Entry\x20criteria:\x20','journey_entry_criteria_','activationParams','\x27\x20from\x20file:\x20','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','schedule','Name\x20has\x20already\x20been\x20taken','flatMap','yamlConfig','conditions','\x20(referenced\x20in\x20journey\x20','yamlActivation','./journey-yaml.js','27WfEBqd','progress','activation_deleting','attributes','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','embedded_segment_creating','add','type','):\x20','validatedRequest','run_after_journey_refresh','values','journey','segment_deleted','DecisionPoint','\x20journey\x20from\x20file:\x20','push','resolveJourneyId','find','effectiveFolderId','logDeleted','8463704GCUyTe','journeyName','updateSegmentById','activation_template_id','toLowerCase','\x27\x20milestone','conditionTimeoutDuration','existingSegment','journeyActivationNameToId','segmentByFolderAndName','listActivations','absolutePath','Activation','getSegment','notification','Created\x20journey\x20\x27','action','digest','\x0a\x20\x20','Delete\x20the\x20push\x20recovery\x20file\x20(','journeyById','segmentFolderId','journeyActivationStepId','reduce','1439022pmeglM','kind','journeyBundlesByFolderAndName','\x27\x20not\x20found\x20in\x20journey\x20\x27','sha1','update','segment_updating','startsWith','utf-8','rule','waitStepUnit','\x27\x20to\x20local\x20\x27','existingSegments','data','Stage\x20\x27','segments','connection','Deleted\x20segment\x20\x27','journey_updated','logInfo','activation_updating','NOT_FOUND','created',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','user','embedded_activation_created','Updated\x20journey\x20\x27','8172cKaPDZ','JOURNEY_SYNTAX_ERROR'];a142_0x161b=function(){return _0x3abbb1;};return a142_0x161b();}
|
|
1
|
+
const a142_0x5a306c=a142_0x7272;(function(_0x11be6a,_0x4d1bcd){const _0x9ff299=a142_0x7272,_0x39bdc5=_0x11be6a();while(!![]){try{const _0x36bd22=-parseInt(_0x9ff299(0x20a))/0x1*(parseInt(_0x9ff299(0x1f8))/0x2)+-parseInt(_0x9ff299(0x284))/0x3+parseInt(_0x9ff299(0x214))/0x4*(parseInt(_0x9ff299(0x1bb))/0x5)+parseInt(_0x9ff299(0x2b6))/0x6*(-parseInt(_0x9ff299(0x280))/0x7)+parseInt(_0x9ff299(0x1e6))/0x8*(parseInt(_0x9ff299(0x257))/0x9)+-parseInt(_0x9ff299(0x22a))/0xa+parseInt(_0x9ff299(0x297))/0xb*(parseInt(_0x9ff299(0x1af))/0xc);if(_0x36bd22===_0x4d1bcd)break;else _0x39bdc5['push'](_0x39bdc5['shift']());}catch(_0x112d68){_0x39bdc5['push'](_0x39bdc5['shift']());}}}(a142_0x9770,0x361de));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x5a306c(0x1dd));export const PENDING_SEGMENT_PREFIX=a142_0x5a306c(0x28f);export const PENDING_ACTIVATION_PREFIX=a142_0x5a306c(0x286);export function createPendingSegmentId(_0x5e4778){return''+PENDING_SEGMENT_PREFIX+_0x5e4778+'__';}export function isPendingSegmentId(_0x3c4370){const _0x33efd3=a142_0x5a306c;return _0x3c4370[_0x33efd3(0x220)](PENDING_SEGMENT_PREFIX)&&!_0x3c4370['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x178cb3){const _0x47ed00=a142_0x5a306c;return _0x178cb3[_0x47ed00(0x291)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x44165e){return''+PENDING_ACTIVATION_PREFIX+_0x44165e+'__';}export function isPendingActivationId(_0x1f259d){const _0x4ebffd=a142_0x5a306c;return _0x1f259d[_0x4ebffd(0x220)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4d6349){const _0x2adfec=a142_0x5a306c;return _0x4d6349[_0x2adfec(0x291)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4ea77,_0x18356c){const _0x3f486c=a142_0x5a306c,_0x17a8aa=_0x4ea77+'::'+(_0x18356c[_0x3f486c(0x22e)]()||_0x3f486c(0x293)),_0x43c501=createHash(_0x3f486c(0x227))['update'](_0x17a8aa)[_0x3f486c(0x1b7)](_0x3f486c(0x1bd))[_0x3f486c(0x25f)](0x0,0xc);return'journey_entry_criteria_'+_0x43c501;}export function ensureJourneyDefaults(_0x2f66da){const _0x2921de=a142_0x5a306c;!_0x2f66da[_0x2921de(0x1ba)]&&(_0x2f66da[_0x2921de(0x1ba)]=''),!_0x2f66da['state']&&(_0x2f66da[_0x2921de(0x26c)]=_0x2921de(0x23a));}export function injectExistingStageIds(_0x14c97d,_0x5324ff){const _0x4a080c=a142_0x5a306c,_0x2d7ed4=new Map(_0x5324ff[_0x4a080c(0x26f)](_0x227008=>[_0x227008[_0x4a080c(0x279)],_0x227008['id']]));for(const _0x3911bb of _0x14c97d){if(!_0x3911bb['id']){const _0x148f8a=_0x2d7ed4[_0x4a080c(0x219)](_0x3911bb[_0x4a080c(0x279)]);_0x148f8a&&(_0x3911bb['id']=_0x148f8a);}}}export function resolveTDFolderPath(_0x439de5,_0x2877d6,_0x2c9326){const _0x217f0a=a142_0x5a306c;if(!_0x2877d6)return _0x439de5;if(_0x439de5===_0x2c9326||_0x439de5[_0x217f0a(0x220)](_0x2c9326+'/'))return _0x439de5;return _0x439de5?_0x2c9326+'/'+_0x439de5:_0x2c9326;}export function addFoldersToCreate(_0x12f1cf,_0x121be0,_0x4f841e){const _0xe9dcf3=a142_0x5a306c;if(!_0x12f1cf)return;if(_0x121be0[_0xe9dcf3(0x26b)](_0x12f1cf))return;const _0x164cf5=_0x12f1cf[_0xe9dcf3(0x215)]('/');let _0xe76417='';for(const _0x3dddb8 of _0x164cf5){_0xe76417=_0xe76417?_0xe76417+'/'+_0x3dddb8:_0x3dddb8,!_0x121be0[_0xe9dcf3(0x26b)](_0xe76417)&&_0x4f841e[_0xe9dcf3(0x1c8)](_0xe76417);}}function a142_0x9770(){const _0x21c190=['join','has','state','created','activation_updated','map','deleted','folder_creating','reduce','match','segments','Created\x20segment\x20\x27','Segment\x20not\x20found:\x20','activationStepsById','conditionTimeoutUnit','name','logDeleted','Failed\x20to\x20fetch\x20referenced\x20segment\x20','../../utils/async.js','segmentByFolderAndName','\x20segment\x20from\x20file:\x20','segment_creating','1441370BzjdoY','parse','Creating\x20segment\x20\x27','getJourney','1284984OiPFwf','exitCriterias','__pending_act_','logInfo','idToName','hasChanges','list','updated','decision_point','diff','and\x20the\x20server\x20segment,\x20then\x20retry.','__pending_','Segment\x20not\x20found','replace','isNew','segment','Created\x20journey\x20\x27','SEGMENT_NOT_FOUND','uniqueServerName','81587YEhnpE','data','connector_config','toString','getSegmentEntity\x20also\x20failed\x20for\x20','nameToType','journeyActivationNameToId','folder','toISOString','journeyBundlesByFolderAndName','SEGMENT_SYNTAX_ERROR','nameToId','logWarning','Updated\x20segment\x20\x27','createSegment','yamlActivation','getSegment\x20failed\x20for\x20','Failed\x20to\x20','embedded_activation_creating','rootFolderId','activation_template_id','rule','conditionSegmentId','Activation','branches','getSegment','stages','valid','segment_updated','entryCriteria','parentId','6eUlWeG','journeyById','):\x20','set','\x27...','folderId','from','1464WJwDQv','\x27\x20from\x20file:\x20','Entry\x20criteria:\x20','deleteActivation','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','behavior',').\x20','./child-segment-yaml.js','digest','item','Updated\x20activation\x20\x27','description','1355JlSoJY','type','hex','run_after_journey_refresh','toLowerCase','debug','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','existingSegments','updateActivation','resolveJourneyId','journeys','JOURNEY_SYNTAX_ERROR','skipSegments','add','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','includes','segmentFolderId','activationActions','activationContext','Creating\x20folder\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','entry_criteria','DecisionPoint','columns','Created\x20folder\x20\x27','journeyBundleId','verbose','activationParams','folderPathToId','createJourneySegment','NOT_FOUND','folder_created','conditionTimeoutDuration','waitStep','tdx.sdk.push-workflow','deps','max','journeyName','segment_deleted','\x0a\x20\x20','journey_creating','\x20journey\x20from\x20file:\x20','isArray','123992zNvbeG','journeyId','delete','entry','Matched\x20server\x20segment\x20\x27','index','Fetching\x20','schedule','updateSegmentById','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','waitStepUnit','existingSegment','Journey\x20\x27','folderPath','goal','Stage\x20\x27','createdSegmentId','versionNumber','160978OHNZSq','Deleted\x20activation\x20\x27','connection','Created\x20activation\x20\x27','withProgress','Updating\x20activation\x20\x27','existingActivation','activation_updating','\x27\x20to\x20local\x20\x27','activation_creating','relationships','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','values','journeyActivationStepId','Failed\x20to\x20resolve\x20activation\x20','segment_deleting','size','update','2NPPaTK','Name\x20has\x20already\x20been\x20taken',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','yamlConfig','journeyBundleName','waitStepType','flatMap','absolutePath','activations','.$1.push-recovery.json','1972XaptNN','split','find','ACTIVATION_UPDATE_ERROR','goal\x20criteria','get','keys','segmentId','segmentNameToId','conditions','JOURNEY_UPDATE_ERROR','journeyStages','startsWith','errors','deleteSegment','resolvedRule','utf-8','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','dirname','sha1','createdSegmentIds','all','370980EtCagR','length','buildUserMaps','activation_created','trim','INTERNAL','embedded_segment_created','message','localName','Condition','with','attributes','results','idToEmailMap','\x27\x20wait\x20condition','milestone','draft','onProgress','createActivation','progress','validatedRequest','effectiveFolderId','\x27\x20entry\x20criteria','sort','parentFolder','Embedded\x20segment\x20\x27','create','Creating\x20activation\x20\x27','relative','parseDocument','logSuccess','steps','\x20activation\x20\x27','null','listActivations','filter','connectionIdToNameMap','uniqueSegmentName','entries','SEGMENT_UPDATE_ERROR','embedded_activation_created','Updated\x20journey\x20\x27','stage\x20\x27','notification','existingJourney','9JgSSdq','\x27\x20by\x20rule\x20content','Failed\x20to\x20resolve\x20segment\x20','\x27\x20exit\x20criteria','stringify','embeddedSegmentNameToId','\x27\x20not\x20found\x20in\x20journey\x20\x27','push','slice','WaitStep','action','Updating\x20segment\x20\x27','resolveSegment','unchanged','\x27\x20milestone','./journey-yaml.js','getActivation','journey','some'];a142_0x9770=function(){return _0x21c190;};return a142_0x9770();}export function sortFoldersByDepth(_0x522e2a){const _0x100cf3=a142_0x5a306c;return[..._0x522e2a][_0x100cf3(0x241)]((_0x328ce6,_0x4fc185)=>{const _0x55193a=_0x100cf3,_0x21bd3f=(_0x328ce6[_0x55193a(0x273)](/\//g)||[])[_0x55193a(0x22b)],_0xe43ddf=(_0x4fc185[_0x55193a(0x273)](/\//g)||[])['length'];return _0x21bd3f-_0xe43ddf;});}import*as a142_0x2f4ea7 from'yaml';function a142_0x7272(_0x3ff13e,_0x1ad1c6){_0x3ff13e=_0x3ff13e-0x1aa;const _0x97708f=a142_0x9770();let _0x7272f9=_0x97708f[_0x3ff13e];return _0x7272f9;}import{readFileSync}from'fs';import a142_0x45daf7 from'path';import{isJourneyDef,parseYamlString as a142_0x26fe56,toYamlString as a142_0x564648,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(_0x46f9ed){const _0x22fff8=a142_0x5a306c;if(Array[_0x22fff8(0x1e5)](_0x46f9ed))return'['+_0x46f9ed[_0x22fff8(0x26f)](_0x63d0e2=>stableStringify(_0x63d0e2))[_0x22fff8(0x26a)](',')+']';if(_0x46f9ed&&typeof _0x46f9ed==='object'){const _0x5d7736=_0x46f9ed,_0x582bcf=Object[_0x22fff8(0x21a)](_0x5d7736)[_0x22fff8(0x241)](),_0x4e2928=_0x582bcf[_0x22fff8(0x26f)](_0x7f718=>'\x22'+_0x7f718+'\x22:'+stableStringify(_0x5d7736[_0x7f718]));return'{'+_0x4e2928[_0x22fff8(0x26a)](',')+'}';}const _0x12b837=JSON[_0x22fff8(0x25b)](_0x46f9ed);return _0x12b837===undefined?_0x22fff8(0x24b):_0x12b837;}function activationSignature(_0x5610f6){const _0x24e578=a142_0x5a306c,_0x25a7e2={'connection':_0x5610f6['connection'],..._0x5610f6['all_columns']!==undefined&&{'all_columns':_0x5610f6['all_columns']},..._0x5610f6[_0x24e578(0x1d2)]!==undefined&&{'columns':_0x5610f6[_0x24e578(0x1d2)]},..._0x5610f6[_0x24e578(0x1b4)]!==undefined&&{'behavior':_0x5610f6['behavior']},..._0x5610f6[_0x24e578(0x1ed)]!==undefined&&{'schedule':_0x5610f6[_0x24e578(0x1ed)]},..._0x5610f6[_0x24e578(0x255)]!==undefined&&{'notification':_0x5610f6['notification']},..._0x5610f6[_0x24e578(0x299)]!==undefined&&{'connector_config':_0x5610f6[_0x24e578(0x299)]},..._0x5610f6[_0x24e578(0x2ab)]!==undefined&&{'activation_template_id':_0x5610f6[_0x24e578(0x2ab)]}};return stableStringify(_0x25a7e2);}async function fetchSegment(_0x2457f7,_0x25c947,_0x30c755,_0x36d36b){const _0x2337d0=a142_0x5a306c,_0x4f2af3=_0x36d36b?.[_0x2337d0(0x216)](_0x4569f6=>_0x4569f6['id']===_0x30c755);if(_0x4f2af3)return _0x4f2af3;try{return await _0x2457f7[_0x2337d0(0x293)][_0x2337d0(0x2b0)](_0x25c947,_0x30c755);}catch(_0x36fdd4){logger['debug'](_0x2337d0(0x2a7)+_0x30c755+_0x2337d0(0x20c)+_0x36fdd4);try{return await _0x2457f7[_0x2337d0(0x293)]['getSegmentEntity'](_0x30c755);}catch(_0x2992f0){return logger[_0x2337d0(0x1c0)](_0x2337d0(0x29b)+_0x30c755+':\x20'+_0x2992f0),null;}}}function recoverSegmentIdsFromPushRecovery(_0x190052,_0x5983b3,_0x1d2de2){const _0x5e4fd7=a142_0x5a306c,_0x2a2bf0=readPushRecovery(_0x190052[_0x5e4fd7(0x211)]);if(_0x2a2bf0?.[_0x5e4fd7(0x1e0)]===_0x190052['yamlConfig']['name'])for(const [_0x600770,_0x18224d]of Object[_0x5e4fd7(0x250)](_0x2a2bf0['segments'])){const _0x26e2b1=generateDeterministicJourneySegmentName(_0x190052[_0x5e4fd7(0x20d)][_0x5e4fd7(0x279)],_0x600770);_0x18224d[_0x5e4fd7(0x296)]===_0x26e2b1&&(_0x5983b3[_0x5e4fd7(0x1ab)](_0x600770,_0x18224d[_0x5e4fd7(0x21b)]),_0x1d2de2[_0x5e4fd7(0x1ab)](_0x600770,_0x18224d[_0x5e4fd7(0x21b)]));}}async function createOrRecoverEmbeddedSegment(_0x4543a0,_0x686662,_0x3308b5,_0x5e43f1){const _0x279d9d=a142_0x5a306c;let _0x37a0a1;try{_0x37a0a1=await _0x4543a0[_0x279d9d(0x293)][_0x279d9d(0x1d8)]({'name':_0x3308b5['uniqueSegmentName'],'description':_0x3308b5[_0x279d9d(0x1ba)],'journeyId':_0x3308b5[_0x279d9d(0x1e7)],'rule':_0x5e43f1(_0x3308b5[_0x279d9d(0x223)],!![]),'countPopulation':!![],'parentFolderId':_0x3308b5['folderId'],'audienceId':_0x3308b5[_0x279d9d(0x2b5)]});}catch(_0x578e11){const _0x16dd1e=_0x578e11 instanceof Error&&_0x578e11[_0x279d9d(0x231)][_0x279d9d(0x1ca)](_0x279d9d(0x20b));if(_0x16dd1e){const _0x5a8fe7=readPushRecovery(_0x686662[_0x279d9d(0x211)]),_0x4225c8=_0x5a8fe7?.[_0x279d9d(0x1e0)]===_0x686662[_0x279d9d(0x20d)]['name']?_0x5a8fe7[_0x279d9d(0x274)][_0x3308b5[_0x279d9d(0x232)]]:undefined;if(_0x4225c8?.[_0x279d9d(0x296)]===_0x3308b5[_0x279d9d(0x24f)])await _0x4543a0[_0x279d9d(0x293)][_0x279d9d(0x1ee)](_0x3308b5[_0x279d9d(0x2b5)],_0x4225c8[_0x279d9d(0x21b)],{'description':_0x3308b5['description'],'rule':_0x5e43f1(_0x3308b5[_0x279d9d(0x223)],!![]),'countPopulation':!![]}),_0x37a0a1=_0x4225c8[_0x279d9d(0x21b)];else throw new SDKError(ErrorCode[_0x279d9d(0x251)],_0x279d9d(0x243)+_0x3308b5[_0x279d9d(0x232)]+_0x279d9d(0x1c1)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x686662['absolutePath'][_0x279d9d(0x291)](/([^/]+)$/,_0x279d9d(0x213))+')\x20')+_0x279d9d(0x28e),_0x578e11);}else throw _0x578e11;}return saveSegmentToPushRecovery(_0x686662[_0x279d9d(0x211)],_0x686662[_0x279d9d(0x20d)][_0x279d9d(0x279)],_0x3308b5['localName'],{'segmentId':_0x37a0a1,'uniqueServerName':_0x3308b5['uniqueSegmentName'],'createdAt':new Date()[_0x279d9d(0x29f)]()}),_0x37a0a1;}export async function prepareSegmentFiles(_0x373f01,_0x420385,_0x3b9702,_0x52087d,_0xafcdb3){const _0x54abf2=a142_0x5a306c,{activationDefToCreateRequest:_0x3207a0}=await import(_0x54abf2(0x1b6)),_0x692a3c=[],_0x3b5541=new Set();for(const {yamlConfig:_0x6469da,folderPath:_0x3bc138,sourcePath:_0x2a8fdd}of _0x373f01){const _0x23c85b=resolveTDFolderPath(_0x3bc138,_0x52087d,_0xafcdb3),_0x142ca5=_0x23c85b+':'+_0x6469da[_0x54abf2(0x279)],_0x554be1=_0x420385[_0x54abf2(0x27d)][_0x54abf2(0x219)](_0x142ca5),_0x52edbd=_0x554be1?_0x420385['activationsBySegmentId']['get'](_0x554be1['id'])||[]:[];addFoldersToCreate(_0x23c85b,_0x420385[_0x54abf2(0x1d7)],_0x3b5541);const _0x3db924=calculateActivationActions(_0x6469da[_0x54abf2(0x212)]||[],_0x52edbd,_0x420385[_0x54abf2(0x237)],_0x420385[_0x54abf2(0x24e)]);for(const _0x168a2a of _0x3db924){(_0x168a2a['type']===_0x54abf2(0x244)||_0x168a2a[_0x54abf2(0x1bc)]===_0x54abf2(0x209))&&_0x168a2a[_0x54abf2(0x2a6)]&&(_0x168a2a['validatedRequest']=await _0x3207a0(_0x168a2a['yamlActivation'],_0x3b9702));}const _0x350c00=calculateSegmentDiff(_0x6469da,_0x554be1,_0x52edbd,_0x420385[_0x54abf2(0x237)],_0x420385['connectionIdToNameMap']);_0x692a3c[_0x54abf2(0x25e)]({'relativePath':_0x6469da['name'],'absolutePath':_0x2a8fdd,'yamlConfig':_0x6469da,'folderPath':_0x23c85b,'existingSegment':_0x554be1,'existingActivations':_0x52edbd,'isNew':_0x350c00[_0x54abf2(0x292)],'hasChanges':_0x350c00[_0x54abf2(0x289)],'diff':_0x350c00[_0x54abf2(0x28d)],'activationActions':_0x3db924});}return{'segmentFiles':_0x692a3c,'foldersToCreate':_0x3b5541};}export async function prepareJourneyFiles(_0xf1d2d1,_0x5a21d3,_0x30a786,_0x169fad){const _0x4b2bd8=a142_0x5a306c,_0x4bbc43=[],_0x1d409a=new Set();for(const {yamlConfig:_0x204569,folderPath:_0x3ca2de,sourcePath:_0x46d807}of _0xf1d2d1){const _0xc33c4a=resolveTDFolderPath(_0x3ca2de,_0x30a786,_0x169fad),_0x2554bb=_0xc33c4a+':'+_0x204569[_0x4b2bd8(0x279)],_0x21124e=_0x5a21d3[_0x4b2bd8(0x2a0)][_0x4b2bd8(0x219)](_0x2554bb);let _0x2e1ec2,_0x174b14;if(_0x21124e&&_0x21124e[_0x4b2bd8(0x22b)]>0x0){const _0x367a3d=buildLocalExpandedRuleMappings(_0x204569),{createYamlContext:_0x57d692,prefetchJourneySegments:_0x5c0717}=createPushYamlContextForBundle(_0x5a21d3[_0x4b2bd8(0x1de)],_0x5a21d3[_0x4b2bd8(0x2b5)],_0x5a21d3[_0x4b2bd8(0x1c2)],_0x367a3d,_0x5a21d3['idToEmailMap'],_0x5a21d3[_0x4b2bd8(0x24e)],_0x5a21d3[_0x4b2bd8(0x277)],_0x5a21d3[_0x4b2bd8(0x2b7)]);await _0x5c0717(_0x21124e['map'](_0x3fa293=>_0x3fa293['id']));const _0x16dfb8=await _0x5a21d3[_0x4b2bd8(0x1de)]['journey']['getLatestJourneyId'](_0x21124e[0x0][_0x4b2bd8(0x1d4)]),_0x13dfcc=hasMultipleVersions(_0x204569),_0x2ab7d9=async _0x11b690=>{const _0x20ccc8=_0x4b2bd8,_0x562a6f=_0x5a21d3[_0x20ccc8(0x2b7)]?.[_0x20ccc8(0x219)](_0x11b690);if(_0x562a6f)return _0x562a6f;return _0x5a21d3['fetchJourney']({'journeyId':_0x11b690,'journeyName':_0x204569['name'],'isMultiVersion':_0x21124e[_0x20ccc8(0x22b)]>0x1});};if(_0x13dfcc&&_0x21124e[_0x4b2bd8(0x22b)]>0x1){const _0x5d0f39=[];for(const _0x1842e4 of _0x21124e){const _0x600190=_0x1842e4[_0x4b2bd8(0x1f7)]||0x1;_0x5a21d3[_0x4b2bd8(0x23d)]?.[_0x4b2bd8(0x209)](_0x4b2bd8(0x1ec)+_0x204569['name']+'\x20v'+_0x600190);const _0x5de595=await _0x2ab7d9(_0x1842e4['id']),_0x34a3d0=_0x57d692(_0x1842e4['id']),_0x435fe5=await journeyResponseToDef(_0x5de595,_0x34a3d0);_0x5d0f39['push']({'item':_0x1842e4,'yaml':_0x435fe5});}const _0x3b8751=buildLocalRuleToNameMappingFromJourney(_0x204569);_0x174b14=buildMergedJourneyDef(_0x5d0f39,_0x3b8751,_0x16dfb8);const _0x555d1f=Math[_0x4b2bd8(0x1df)](..._0x5d0f39[_0x4b2bd8(0x26f)](_0x33ddb6=>_0x33ddb6[_0x4b2bd8(0x1b8)][_0x4b2bd8(0x1f7)]||0x0)),_0x499b1f=_0x21124e[_0x4b2bd8(0x216)](_0x727b99=>(_0x727b99[_0x4b2bd8(0x1f7)]||0x0)===_0x555d1f);_0x499b1f&&(_0x5a21d3['progress']?.['update']('Fetching\x20'+_0x204569[_0x4b2bd8(0x279)]+'\x20v'+_0x555d1f),_0x2e1ec2=await _0x2ab7d9(_0x499b1f['id']));}else{const _0x22553d=_0x21124e[_0x21124e['length']-0x1];_0x5a21d3[_0x4b2bd8(0x23d)]?.[_0x4b2bd8(0x209)](_0x4b2bd8(0x1ec)+_0x204569[_0x4b2bd8(0x279)]),_0x2e1ec2=await _0x2ab7d9(_0x22553d['id']);const _0x538181=_0x57d692(_0x22553d['id']),_0x4049be=await journeyResponseToDef(_0x2e1ec2,_0x538181),_0x3ccf33=buildLocalRuleToNameMappingFromJourney(_0x204569);_0x174b14=buildMergedJourneyDef([{'item':_0x22553d,'yaml':_0x4049be}],_0x3ccf33,_0x16dfb8);}}addFoldersToCreate(_0xc33c4a,_0x5a21d3[_0x4b2bd8(0x1d7)],_0x1d409a);const _0x482e66=calculateJourneyDiff(_0x204569,_0x174b14);_0x4bbc43[_0x4b2bd8(0x25e)]({'relativePath':_0x204569[_0x4b2bd8(0x279)],'absolutePath':_0x46d807,'yamlConfig':_0x204569,'folderPath':_0xc33c4a,'existingJourney':_0x2e1ec2,'isNew':_0x482e66['isNew'],'hasChanges':_0x482e66[_0x4b2bd8(0x289)],'diff':_0x482e66[_0x4b2bd8(0x28d)]});}return{'journeyFiles':_0x4bbc43,'foldersToCreate':_0x1d409a};}export function calculateActivationActions(_0x1863c2,_0xa5ca35,_0x3bce3a,_0x152c9e){const _0xf1553a=a142_0x5a306c,_0x36c09e=[],_0x3513bc=new Map();for(const _0x338fa1 of _0xa5ca35){_0x3513bc[_0xf1553a(0x1ab)](_0x338fa1[_0xf1553a(0x279)],_0x338fa1);}const _0xea000b=new Map();for(const _0x307ea2 of _0x1863c2){_0xea000b[_0xf1553a(0x1ab)](_0x307ea2[_0xf1553a(0x279)],_0x307ea2);}for(const _0x5d711f of _0x1863c2){const _0x3ef883=_0x3513bc[_0xf1553a(0x219)](_0x5d711f[_0xf1553a(0x279)]);if(!_0x3ef883)_0x36c09e[_0xf1553a(0x25e)]({'type':_0xf1553a(0x244),'name':_0x5d711f['name'],'yamlActivation':_0x5d711f});else{const _0x524261=activationResponseToDef(_0x3ef883,_0x3bce3a,_0x152c9e),_0x1a0312=a142_0x2f4ea7[_0xf1553a(0x25b)](_0x524261),_0x162493=a142_0x2f4ea7[_0xf1553a(0x25b)](_0x5d711f);_0x1a0312!==_0x162493&&_0x36c09e[_0xf1553a(0x25e)]({'type':_0xf1553a(0x209),'name':_0x5d711f[_0xf1553a(0x279)],'yamlActivation':_0x5d711f,'existingActivation':_0x3ef883});}}for(const _0x3667b5 of _0xa5ca35){!_0xea000b[_0xf1553a(0x26b)](_0x3667b5[_0xf1553a(0x279)])&&_0x36c09e[_0xf1553a(0x25e)]({'type':_0xf1553a(0x1e8),'name':_0x3667b5[_0xf1553a(0x279)],'existingActivation':_0x3667b5});}return _0x36c09e;}function calculateYamlDiff(_0x6f2cb3,_0x3ac187){if(_0x3ac187){const _0x8ccc59=generateDiff(_0x3ac187,_0x6f2cb3),_0x6c4d15=hasChanges(_0x8ccc59);return{'isNew':![],'hasChanges':_0x6c4d15,'diff':_0x6c4d15?formatDiffWithColors(_0x8ccc59):undefined};}const _0x581cb4=generateDiff('',_0x6f2cb3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x581cb4)};}export function calculateSegmentDiff(_0x3308b8,_0x436cd7,_0x54b692,_0x46685e,_0x781a1c){const _0x56ceda=segmentToYamlString(_0x3308b8),_0x419aae=_0x436cd7?segmentToYamlString(segmentWithActivationsToYaml(_0x436cd7,_0x54b692,undefined,_0x46685e,_0x781a1c)):undefined;return calculateYamlDiff(_0x56ceda,_0x419aae);}export function calculateJourneyDiff(_0x38141c,_0x19ecdd){const _0x726fb9=normalizeJourneyDef(_0x38141c,_0x38141c),_0x5437bb=a142_0x564648(_0x726fb9),_0x2ce9ae=_0x19ecdd?a142_0x564648(normalizeJourneyDef(_0x19ecdd,_0x38141c)):undefined;return calculateYamlDiff(_0x5437bb,_0x2ce9ae);}export function findSegmentsToDelete(_0x4ff70b,_0xaf7751,_0x1ebae1,_0x1bca0e,_0x31e0c5){const _0xb4b4c=a142_0x5a306c,_0x114cbe=new Set();for(const {yamlConfig:_0x4f1ebb,folderPath:_0x366d23}of _0xaf7751){_0x114cbe[_0xb4b4c(0x1c8)](_0x366d23+':'+_0x4f1ebb[_0xb4b4c(0x279)]);}return _0x4ff70b[_0xb4b4c(0x24d)](_0xb912e6=>{const _0x39613d=_0xb4b4c,_0x582aab=_0xb912e6['segmentFolderId']?_0x1ebae1[_0x39613d(0x219)](_0xb912e6[_0x39613d(0x1cb)][_0x39613d(0x29a)]())||'':'',_0x5ad74b=_0x582aab+':'+_0xb912e6[_0x39613d(0x279)];if(_0x114cbe[_0x39613d(0x26b)](_0x5ad74b))return![];if(_0x31e0c5)return _0x582aab===_0x1bca0e||_0x582aab[_0x39613d(0x220)](_0x1bca0e+'/');return!![];});}export function findJourneysToDelete(_0x341b79,_0x2d59be,_0x1fc4f9,_0x7ac910,_0x55484f){const _0x5678d4=a142_0x5a306c,_0x575168=new Set();for(const {yamlConfig:_0x23c9c7,folderPath:_0x237152}of _0x2d59be){_0x575168['add'](_0x237152+':'+_0x23c9c7[_0x5678d4(0x279)]);}return _0x341b79[_0x5678d4(0x24d)](_0x1f5409=>{const _0x29bc3b=_0x5678d4,_0x385672=_0x1f5409[_0x29bc3b(0x1ad)]?_0x1fc4f9[_0x29bc3b(0x219)](_0x1f5409[_0x29bc3b(0x1ad)])||'':'',_0x229a74=_0x385672+':'+_0x1f5409[_0x29bc3b(0x20e)];if(_0x575168[_0x29bc3b(0x26b)](_0x229a74))return![];if(_0x55484f)return _0x385672===_0x7ac910||_0x385672[_0x29bc3b(0x220)](_0x7ac910+'/');return!![];});}export function buildSegmentLookupMap(_0x514864,_0x496a50){const _0x5a5e3e=a142_0x5a306c,_0x2bc6a6=new Map();for(const _0x21cfdc of _0x514864){const _0x2f2fd1=_0x21cfdc[_0x5a5e3e(0x1cb)]?_0x496a50['get'](_0x21cfdc[_0x5a5e3e(0x1cb)][_0x5a5e3e(0x29a)]())||'':'',_0x50a526=_0x2f2fd1+':'+_0x21cfdc[_0x5a5e3e(0x279)];_0x2bc6a6[_0x5a5e3e(0x1ab)](_0x50a526,_0x21cfdc);}return _0x2bc6a6;}export function buildSegmentNameToIdMap(_0x1f0cc1){const _0x48a55d=new Map();for(const _0x257968 of _0x1f0cc1){_0x48a55d['set'](_0x257968['name'],_0x257968['id']);}return _0x48a55d;}export function buildJourneyBundleLookupMap(_0x3442ad,_0x4976c2){const _0x1881b8=a142_0x5a306c,_0x34b47e=new Map();for(const _0x558a12 of _0x3442ad){const _0x47ce37=_0x558a12['folderId']?_0x4976c2[_0x1881b8(0x219)](_0x558a12[_0x1881b8(0x1ad)])||'':'',_0x5a0e4c=_0x47ce37+':'+_0x558a12['journeyBundleName'];!_0x34b47e[_0x1881b8(0x26b)](_0x5a0e4c)&&_0x34b47e['set'](_0x5a0e4c,[]),_0x34b47e[_0x1881b8(0x219)](_0x5a0e4c)['push'](_0x558a12);}for(const _0x563440 of _0x34b47e[_0x1881b8(0x204)]()){_0x563440[_0x1881b8(0x241)]((_0x486fef,_0x5429d7)=>(_0x486fef[_0x1881b8(0x1f7)]||0x0)-(_0x5429d7[_0x1881b8(0x1f7)]||0x0));}return _0x34b47e;}export function collectFoldersToCreate(_0x2d7fa8,_0x39a4f6){const _0x29ed85=a142_0x5a306c,_0x588bfd=new Set();for(const _0x5a6632 of _0x2d7fa8){if(!_0x5a6632)continue;if(_0x39a4f6['has'](_0x5a6632))continue;const _0xd8db6c=_0x5a6632[_0x29ed85(0x215)]('/');let _0x4f7a33='';for(const _0x412651 of _0xd8db6c){_0x4f7a33=_0x4f7a33?_0x4f7a33+'/'+_0x412651:_0x412651,!_0x39a4f6[_0x29ed85(0x26b)](_0x4f7a33)&&_0x588bfd['add'](_0x4f7a33);}}return _0x588bfd;}export function parseAndClassifyYamlFiles(_0x324f21,_0x1705fe,_0x3b3476){const _0x5e7b61=a142_0x5a306c,_0x35f450=[],_0x346899=[];for(const _0x6b0907 of _0x324f21){const _0x3e7054=a142_0x45daf7[_0x5e7b61(0x246)](_0x1705fe,a142_0x45daf7[_0x5e7b61(0x226)](_0x6b0907)),_0x2a622c=_0x3e7054==='.'?'':_0x3e7054,_0x17d768=readFileSync(_0x6b0907,_0x5e7b61(0x224)),_0x5bf7c4=a142_0x2f4ea7[_0x5e7b61(0x281)](_0x17d768);if(isJourneyDef(_0x5bf7c4)){const _0x37b3d4=a142_0x26fe56(_0x17d768);_0x346899['push']({'yamlConfig':_0x37b3d4,'folderPath':_0x2a622c,'sourcePath':_0x6b0907});}else{if(!_0x3b3476?.[_0x5e7b61(0x1c7)]){const _0xd6e78e=parseSegmentYamlFile(_0x17d768),_0x16d112=normalizeChildSegmentYaml(_0xd6e78e);_0x35f450[_0x5e7b61(0x25e)]({'yamlConfig':_0x16d112,'folderPath':_0x2a622c,'sourcePath':_0x6b0907});}}}return{'segments':_0x35f450,'journeys':_0x346899};}export function validateParsedFiles(_0x5cf580,_0x2cd217){const _0x4c30f6=a142_0x5a306c,_0x4ea173=[];for(const {yamlConfig:_0x8bca1c,sourcePath:_0x55fa15}of _0x5cf580['segments']){const _0x2d8c78=readFileSync(_0x55fa15,_0x4c30f6(0x224)),_0x3fec05=a142_0x2f4ea7[_0x4c30f6(0x247)](_0x2d8c78),_0x4de930=validateSegmentDef(_0x8bca1c,{'source':_0x2d8c78,'document':_0x3fec05},{'skipSchema':!![]});if(!_0x4de930[_0x4c30f6(0x2b2)]){const _0x2b4368=a142_0x45daf7[_0x4c30f6(0x246)](_0x2cd217,_0x55fa15);_0x4ea173['push']({'filePath':_0x2b4368,'source':_0x2d8c78,'result':_0x4de930,'isJourney':![]});}}for(const {yamlConfig:_0x1a4c96,sourcePath:_0x2bd0e3}of _0x5cf580[_0x4c30f6(0x1c5)]){const _0x6fa27c=readFileSync(_0x2bd0e3,_0x4c30f6(0x224)),_0x26d728=a142_0x2f4ea7[_0x4c30f6(0x247)](_0x6fa27c),_0x22553c=validateJourneyDef(_0x1a4c96,{'source':_0x6fa27c,'document':_0x26d728},{'skipSchema':!![]});if(!_0x22553c[_0x4c30f6(0x2b2)]){const _0x1a4ea6=a142_0x45daf7[_0x4c30f6(0x246)](_0x2cd217,_0x2bd0e3);_0x4ea173['push']({'filePath':_0x1a4ea6,'source':_0x6fa27c,'result':_0x22553c,'isJourney':!![]});}}return _0x4ea173;}export function formatValidationErrors(_0x4b9066){const _0x466d99=a142_0x5a306c,_0x30c560=[];for(const {filePath:_0x33082f,source:_0x26d3f7,result:_0x5c0e12,isJourney:_0x2edb3c}of _0x4b9066){const _0x2bff42=_0x2edb3c?_0x466d99(0x268):_0x466d99(0x293);_0x30c560[_0x466d99(0x25e)]('\x0a'+_0x33082f+'\x20('+_0x2bff42+_0x466d99(0x1aa)+_0x5c0e12[_0x466d99(0x221)][_0x466d99(0x22b)]+'\x20error(s)'),_0x30c560[_0x466d99(0x25e)](formatValidationResult(_0x5c0e12,_0x26d3f7,_0x33082f));}return _0x30c560[_0x466d99(0x26a)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x18a83e){const _0x53995d=a142_0x5a306c,_0x50c6e8=new Set(),_0x1f83d2=new Map(),_0x2e7ec1=collectSegmentUsageCounts(_0x18a83e);if(_0x18a83e[_0x53995d(0x274)])for(const [_0x5da4a0,_0x2db724]of Object[_0x53995d(0x250)](_0x18a83e[_0x53995d(0x274)])){_0x50c6e8[_0x53995d(0x1c8)](_0x5da4a0);if(_0x2db724[_0x53995d(0x2ac)]){const _0x14d798=yamlRuleToApi(_0x2db724[_0x53995d(0x2ac)]),_0x556fa2=apiRuleToYaml(_0x14d798);_0x1f83d2[_0x53995d(0x1ab)](_0x5da4a0,_0x556fa2);}}const _0x44860c=new Map();let _0xd01709=0x0;for(const [_0x599197,_0x8e4bf]of _0x1f83d2){const _0x383940=serializeExpandedRule(_0x8e4bf,_0x1f83d2),_0x546902=_0x44860c[_0x53995d(0x219)](_0x383940)||[];_0x546902['push']({'name':_0x599197,'index':_0xd01709}),_0x44860c['set'](_0x383940,_0x546902),_0xd01709++;}const _0x1d4508=new Map();for(const [_0xad914d,_0x64614f]of _0x44860c){const _0x20703a=_0x64614f[_0x53995d(0x25f)]()[_0x53995d(0x241)]((_0x3dbed6,_0x12569b)=>{const _0x3f7d75=_0x53995d,_0x16f233=_0x2e7ec1[_0x3f7d75(0x219)](_0x3dbed6[_0x3f7d75(0x279)])||0x0,_0x46d393=_0x2e7ec1['get'](_0x12569b[_0x3f7d75(0x279)])||0x0;if(_0x16f233!==_0x46d393)return _0x46d393-_0x16f233;return _0x3dbed6['index']-_0x12569b[_0x3f7d75(0x1eb)];})['map'](_0x57fffe=>_0x57fffe['name']),_0x1a08c8=[];for(const _0x374b90 of _0x20703a){const _0x5c01f2=_0x2e7ec1[_0x53995d(0x219)](_0x374b90)||0x0,_0x20f860=Math[_0x53995d(0x1df)](_0x5c01f2,0x1);for(let _0x4d1715=0x0;_0x4d1715<_0x20f860;_0x4d1715++){_0x1a08c8[_0x53995d(0x25e)](_0x374b90);}}_0x1d4508['set'](_0xad914d,_0x1a08c8);}return{'existingLocalSegmentNames':_0x50c6e8,'localSegmentRules':_0x1f83d2,'localExpandedRuleToNames':_0x1d4508};}export function createSegmentIdResolver(_0x257afa,_0x521f6d){return async _0x2c84ce=>{const _0x298469=a142_0x7272,_0x10d52a=_0x257afa[_0x298469(0x219)](_0x2c84ce);if(!_0x10d52a)throw new SDKError(ErrorCode[_0x298469(0x295)],'Segment\x20not\x20found:\x20'+_0x2c84ce+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x521f6d+'\x27)');return _0x10d52a;};}export function extractRootFolderId(_0x42a6cc){const _0x3f7c17=a142_0x5a306c;return _0x42a6cc[_0x3f7c17(0x202)]?.['parentSegmentFolder']?.[_0x3f7c17(0x298)]?.['id']||_0x42a6cc[_0x3f7c17(0x202)]?.[_0x3f7c17(0x242)]?.[_0x3f7c17(0x298)]?.['id'];}export function buildConnectionMaps(_0x61f1dc){const _0x43632d=a142_0x5a306c,_0x54daec=new Map(),_0x531876=new Map(),_0x290580=new Map();for(const _0x4a00a7 of _0x61f1dc){_0x54daec[_0x43632d(0x1ab)](_0x4a00a7[_0x43632d(0x279)],parseInt(_0x4a00a7['id'],0xa)),_0x531876['set'](_0x4a00a7['id'],_0x4a00a7[_0x43632d(0x279)]),_0x290580[_0x43632d(0x1ab)](_0x4a00a7['name'],_0x4a00a7['type']);}return{'nameToId':_0x54daec,'idToName':_0x531876,'nameToType':_0x290580};}export function calculatePushStats(_0x21ebae,_0xaa84a2,_0x3e0692,_0x5589d6,_0x502451,_0x4bc4ef,_0x29563e){const _0x4872de=a142_0x5a306c,_0x48fe53=_0x21ebae[_0x4872de(0x24d)](_0x3a5d8a=>_0x3a5d8a[_0x4872de(0x292)]),_0x538800=_0x21ebae[_0x4872de(0x24d)](_0x532dee=>!_0x532dee[_0x4872de(0x292)]&&_0x532dee[_0x4872de(0x289)]),_0x41b663=_0x21ebae['filter'](_0x1f25c3=>!_0x1f25c3[_0x4872de(0x292)]&&!_0x1f25c3['hasChanges']),_0x4d00ee=_0x4bc4ef?_0x5589d6:[],_0x36d25f=_0xaa84a2[_0x4872de(0x24d)](_0x4907dd=>_0x4907dd[_0x4872de(0x292)]),_0x59ad0a=_0xaa84a2[_0x4872de(0x24d)](_0x5823e4=>!_0x5823e4[_0x4872de(0x292)]&&_0x5823e4[_0x4872de(0x289)]),_0x10df1c=_0xaa84a2[_0x4872de(0x24d)](_0x41f6e8=>!_0x41f6e8[_0x4872de(0x292)]&&!_0x41f6e8['hasChanges']),_0x2a8261=_0x4bc4ef?_0x502451:[],_0xe4c381=_0x21ebae[_0x4872de(0x210)](_0x3dbbfd=>_0x3dbbfd['activationActions']),_0x522ff1=_0xe4c381['filter'](_0x5f0c09=>_0x5f0c09[_0x4872de(0x1bc)]==='create'),_0x536e56=_0xe4c381[_0x4872de(0x24d)](_0x3cf32e=>_0x3cf32e[_0x4872de(0x1bc)]===_0x4872de(0x209)),_0x38e6bf=_0xe4c381['filter'](_0x4b4522=>_0x4b4522[_0x4872de(0x1bc)]===_0x4872de(0x1e8)),_0x2016cd=Array[_0x4872de(0x1ae)](_0x3e0692)['sort'](),_0x5f2708=_0x29563e?![]:_0x48fe53[_0x4872de(0x22b)]>0x0||_0x538800[_0x4872de(0x22b)]>0x0||_0x4d00ee[_0x4872de(0x22b)]>0x0,_0x4f9fde=_0x36d25f[_0x4872de(0x22b)]>0x0||_0x59ad0a[_0x4872de(0x22b)]>0x0||_0x2a8261[_0x4872de(0x22b)]>0x0,_0x184720=_0x29563e?![]:_0xe4c381[_0x4872de(0x22b)]>0x0,_0x56c8ba=_0x2016cd[_0x4872de(0x22b)]>0x0;return{'segments':{'new':_0x48fe53,'changed':_0x538800,'unchanged':_0x41b663,'toDelete':_0x4d00ee},'journeys':{'new':_0x36d25f,'changed':_0x59ad0a,'unchanged':_0x10df1c,'toDelete':_0x2a8261},'activations':{'all':_0xe4c381,'toCreate':_0x522ff1,'toUpdate':_0x536e56,'toDelete':_0x38e6bf},'folders':{'toCreate':_0x2016cd},'counts':{'segments':{'new':_0x48fe53['length'],'changed':_0x538800['length'],'unchanged':_0x41b663['length'],'toDelete':_0x4d00ee['length']},'journeys':{'new':_0x36d25f['length'],'changed':_0x59ad0a[_0x4872de(0x22b)],'unchanged':_0x10df1c['length'],'toDelete':_0x2a8261[_0x4872de(0x22b)]},'activations':{'create':_0x522ff1[_0x4872de(0x22b)],'update':_0x536e56[_0x4872de(0x22b)],'delete':_0x38e6bf[_0x4872de(0x22b)]},'folders':_0x2016cd[_0x4872de(0x22b)]},'hasChanges':_0x5f2708||_0x4f9fde||_0x184720||_0x56c8ba};}export async function buildPushExecutionContext(_0x7166f9,_0xbcb80b,_0x43c71f,_0x4a131f,_0x2db60e,_0x535b5a){const _0x55850b=a142_0x5a306c,_0x39a91a=extractRootFolderId(_0x43c71f),{pathToId:_0x2323bf,idToPath:_0x4d22e6}=buildFolderMaps(_0x2db60e),_0x4e0220=buildSegmentNameToIdMap(_0x4a131f),_0x520ee9=new Map(),{batchAsync:_0x535e44}=await import(_0x55850b(0x27c)),[_0x168305,_0x5aa83d]=await Promise[_0x55850b(0x229)]([_0x7166f9['user'][_0x55850b(0x22c)](),_0x7166f9[_0x55850b(0x1fa)][_0x55850b(0x28a)](),((async()=>{!_0x535b5a&&_0x4a131f['length']>0x0&&await _0x535e44(_0x4a131f,async _0x4e7736=>{const _0x70257b=a142_0x7272,_0x2f4280=await _0x7166f9[_0x70257b(0x293)][_0x70257b(0x24c)](_0xbcb80b,_0x4e7736['id']);_0x520ee9[_0x70257b(0x1ab)](_0x4e7736['id'],_0x2f4280);});})())]),{emailToId:_0x5c2345,idToEmail:_0x4265b0}=_0x168305,_0x18c804=buildConnectionMaps(_0x5aa83d);return{'rootFolderId':_0x39a91a,'folderPathToId':_0x2323bf,'folderIdToPath':_0x4d22e6,'segmentNameToId':_0x4e0220,'activationsBySegmentId':_0x520ee9,'emailToIdMap':_0x5c2345,'idToEmailMap':_0x4265b0,'connectionNameToIdMap':_0x18c804[_0x55850b(0x2a2)],'connectionIdToNameMap':_0x18c804[_0x55850b(0x288)],'connectionNameToTypeMap':_0x18c804[_0x55850b(0x29c)]};}export function createPushYamlContextForBundle(_0x168ebf,_0x15d846,_0x249795,_0x5aa28b,_0xd35264,_0x2ab58d,_0x55e8e8,_0x4de4f9){const {existingLocalSegmentNames:_0x50c8db,localExpandedRuleToNames:_0x39a97e}=_0x5aa28b,_0x4c415a=new Set(),_0x1b591c=new Map(),_0x57909a=new Map(),_0x52cade=new Map(),_0x14cc1d=createJumpTargetCache(),_0x5313dc=new Map(),_0xcd687c=new Map(),_0x94a18c=new Set();let _0x18f02c;const _0xa2406=_0x180a5c=>{const _0x25ca33={'resolveSegment':async _0x2eb0ef=>{const _0x40bdbe=a142_0x7272,_0x54c653=_0x52cade[_0x40bdbe(0x219)](_0x2eb0ef);if(_0x54c653!==undefined)return{'name':_0x54c653,'isJourneyLocal':!![]};try{const _0x178d78=await fetchSegment(_0x168ebf,_0x15d846,_0x2eb0ef,_0x249795);if(!_0x178d78)throw new Error(_0x40bdbe(0x290));const _0x5ba408=generateJourneyLocalName(_0x178d78['name']),_0x41e071=_0x178d78['kind']===SEGMENT_KIND_JOURNEY&&_0x5ba408!==undefined;let _0x18d734=_0x178d78[_0x40bdbe(0x279)],_0x44f422;if(_0x41e071&&_0x178d78['rule']){const _0x16cdac=apiRuleToYaml(_0x178d78[_0x40bdbe(0x2ac)]);_0xcd687c['set'](_0x2eb0ef,_0x16cdac);const _0x1dc7a8=async _0x335d79=>{const _0x54ebb5=_0x40bdbe,_0xf929f3=collectSegmentRefsFromRule(_0x335d79);for(const _0x1bffbf of _0xf929f3){if(!_0xcd687c['has'](_0x1bffbf))try{const _0x5ae07d=await fetchSegment(_0x168ebf,_0x15d846,_0x1bffbf,_0x249795);if(_0x5ae07d?.[_0x54ebb5(0x2ac)]){const _0x2cda1f=apiRuleToYaml(_0x5ae07d[_0x54ebb5(0x2ac)]);_0xcd687c['set'](_0x1bffbf,_0x2cda1f),await _0x1dc7a8(_0x2cda1f);}}catch(_0x418d1d){logger[_0x54ebb5(0x1c0)](_0x54ebb5(0x27b)+_0x1bffbf+':\x20'+_0x418d1d);}}};await _0x1dc7a8(_0x16cdac);const _0x4c3e93=serializeExpandedRule(_0x16cdac,_0xcd687c),_0x524d86=_0x39a97e[_0x40bdbe(0x219)](_0x4c3e93);if(_0x524d86&&_0x524d86[_0x40bdbe(0x22b)]>0x0){const _0x57b49f=_0x1b591c[_0x40bdbe(0x219)](_0x4c3e93)||0x0,_0x501b32=_0x524d86[_0x57b49f]||_0x524d86[_0x524d86[_0x40bdbe(0x22b)]-0x1];_0x1b591c[_0x40bdbe(0x1ab)](_0x4c3e93,_0x57b49f+0x1),_0x18d734=_0x501b32,_0x4c415a[_0x40bdbe(0x1c8)](_0x18d734),_0x52cade[_0x40bdbe(0x1ab)](_0x2eb0ef,_0x18d734);const _0x85622b=await resolveRuleSegmentRefs(_0x16cdac,async _0x217e8a=>{const _0xf001fe=_0x40bdbe,_0x577461=_0x52cade[_0xf001fe(0x219)](_0x217e8a);if(_0x577461)return _0x577461;const _0x4467b9=await _0x18f02c[_0xf001fe(0x263)](_0x217e8a);return _0x4467b9[_0xf001fe(0x279)];});_0x44f422={'description':_0x178d78['description'],'rule':_0x85622b};}else{const _0x3149ec=_0x5313dc[_0x40bdbe(0x219)](_0x4c3e93);if(_0x3149ec)_0x18d734=_0x3149ec,_0x52cade[_0x40bdbe(0x1ab)](_0x2eb0ef,_0x18d734);else{if(_0x5ba408){let _0xca47e=_0x5ba408,_0x48f3d2=0x2;while(_0x4c415a['has'](_0xca47e)||_0x50c8db[_0x40bdbe(0x26b)](_0xca47e)){_0xca47e=_0x5ba408+'_'+_0x48f3d2,_0x48f3d2++;}_0x4c415a[_0x40bdbe(0x1c8)](_0xca47e),_0x18d734=_0xca47e;}_0x52cade[_0x40bdbe(0x1ab)](_0x2eb0ef,_0x18d734),_0x5313dc[_0x40bdbe(0x1ab)](_0x4c3e93,_0x18d734);const _0x46bebf=await resolveRuleSegmentRefs(_0x16cdac,async _0x4a7046=>{const _0x47a03d=_0x40bdbe,_0x411b31=_0x52cade['get'](_0x4a7046);if(_0x411b31)return _0x411b31;const _0x4f96d7=await _0x18f02c['resolveSegment'](_0x4a7046);return _0x4f96d7[_0x47a03d(0x279)];});_0x44f422={'description':_0x178d78['description'],'rule':_0x46bebf};}}}return{'name':_0x18d734,'isJourneyLocal':_0x41e071,'definition':_0x44f422};}catch(_0xaca879){return logger[_0x40bdbe(0x1c0)](_0x40bdbe(0x259)+_0x2eb0ef+':\x20'+_0xaca879),{'name':_0x2eb0ef,'isJourneyLocal':![]};}},'resolveActivation':async _0x1b34aa=>{const _0xd1ba67=a142_0x7272,_0x32d11d=_0x57909a['get'](_0x1b34aa);if(_0x32d11d!==undefined)return{'name':_0x32d11d,'isJourneyLocal':!![]};try{let _0x453985=_0x55e8e8?.[_0xd1ba67(0x219)](_0x1b34aa);!_0x453985&&(_0x453985=await _0x168ebf[_0xd1ba67(0x268)][_0xd1ba67(0x267)](_0x180a5c,_0x1b34aa));const _0x1f5272=_0x453985[_0xd1ba67(0x235)][_0xd1ba67(0x1d6)]['name']||_0x1b34aa,_0x1b48ab=sanitizeYamlKey(_0x1f5272)||'activation_'+_0x1b34aa,_0x103fcf=_0x1b48ab;_0x57909a[_0xd1ba67(0x1ab)](_0x1b34aa,_0x103fcf);const _0x26b6eb=journeyActivationStepToYaml(_0x453985,_0xd35264,_0x2ab58d);return{'name':_0x103fcf,'isJourneyLocal':!![],'definition':_0x26b6eb};}catch(_0x3cf270){return logger[_0xd1ba67(0x1c0)](_0xd1ba67(0x206)+_0x1b34aa+':\x20'+_0x3cf270),{'name':_0x1b34aa,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x17de77,_0x4fbb39)=>resolveJumpTarget(_0x17de77,_0x4fbb39,_0x14cc1d,async _0x4314f2=>{const _0x3e6fed=a142_0x7272,_0x3c5d30=_0x4de4f9?.['get'](_0x4314f2);if(_0x3c5d30)return _0x3c5d30;return _0x168ebf[_0x3e6fed(0x268)][_0x3e6fed(0x283)](_0x4314f2);})};return _0x18f02c=_0x25ca33,_0x25ca33;},_0x34d256=async _0xa1a51f=>{const _0x4acd99=a142_0x7272,{collectSegmentIdsFromJourneyApi:_0x4ada1e}=await import(_0x4acd99(0x266)),{batchAsync:_0xd28e7d}=await import('../../utils/async.js'),_0x56a1d6=new Set();for(const _0x1a7564 of _0xa1a51f){let _0x482ec2=_0x4de4f9?.[_0x4acd99(0x219)](_0x1a7564);!_0x482ec2&&(_0x482ec2=await _0x168ebf[_0x4acd99(0x268)][_0x4acd99(0x283)](_0x1a7564));const _0x17ffef=_0x4ada1e(_0x482ec2);for(const _0x17a7a7 of _0x17ffef){_0x56a1d6[_0x4acd99(0x1c8)](_0x17a7a7);}}let _0x346771=Array[_0x4acd99(0x1ae)](_0x56a1d6);while(_0x346771[_0x4acd99(0x22b)]>0x0){const _0x5b885e=_0x346771['filter'](_0x1f0bcf=>!_0x94a18c[_0x4acd99(0x26b)](_0x1f0bcf));if(_0x5b885e['length']===0x0)break;const _0x1fb634=await _0xd28e7d(_0x5b885e,async _0x59b727=>{const _0x31290b=_0x4acd99;_0x94a18c[_0x31290b(0x1c8)](_0x59b727);const _0x4ab05d=await fetchSegment(_0x168ebf,_0x15d846,_0x59b727,_0x249795);if(!_0x4ab05d)return null;return{'segmentId':_0x59b727,'segment':_0x4ab05d};},0xa),_0x163f6c=new Set();for(const _0x25f9c0 of _0x1fb634){if(!_0x25f9c0?.[_0x4acd99(0x293)]?.[_0x4acd99(0x2ac)])continue;const _0x3210de=apiRuleToYaml(_0x25f9c0[_0x4acd99(0x293)][_0x4acd99(0x2ac)]);_0xcd687c[_0x4acd99(0x1ab)](_0x25f9c0[_0x4acd99(0x21b)],_0x3210de);const _0x1e5d53=collectSegmentRefsFromRule(_0x3210de);for(const _0x25a92e of _0x1e5d53){!_0x94a18c['has'](_0x25a92e)&&_0x163f6c['add'](_0x25a92e);}}_0x346771=Array[_0x4acd99(0x1ae)](_0x163f6c);}};return{'createYamlContext':_0xa2406,'prefetchJourneySegments':_0x34d256};}export async function executePushSegments(_0x54f7fd,_0x331ee6,_0x532ab5,_0x1ee0bf,_0x203a75){const _0x524681=a142_0x5a306c,{segmentDefToCreateRequest:_0x5852ab,segmentDefToUpdateRequest:_0x46817b}=await import(_0x524681(0x1b6)),_0x3feaa1=_0x532ab5[_0x524681(0x1d7)],_0x57e9e6=0x5,_0x2a5666=async _0xa2b9df=>{const _0x3cec86=_0x524681,_0x170dbd=_0xa2b9df[_0x3cec86(0x1f3)]?_0x3feaa1['get'](_0xa2b9df['folderPath']):undefined;let _0x23a8df;const _0x4e2240={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x37e4d9=_0xa2b9df[_0x3cec86(0x20d)];if(_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x2ac)]){const _0x305b9c=createSegmentIdResolver(_0x532ab5[_0x3cec86(0x21c)],_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]),_0x56e2f1=await resolveRuleSegmentIds(_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x2ac)],_0x305b9c);_0x37e4d9={..._0xa2b9df[_0x3cec86(0x20d)],'rule':_0x56e2f1};}try{if(_0xa2b9df['isNew']){_0x203a75[_0x3cec86(0x23b)]?.({'type':_0x3cec86(0x27f),'name':_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]});const _0x22157c=_0x5852ab(_0x37e4d9,_0x170dbd),_0x2b84a1=await _0x203a75[_0x3cec86(0x1fc)](_0x3cec86(0x282)+_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]+'\x27...',()=>_0x54f7fd[_0x3cec86(0x293)][_0x3cec86(0x2a5)](_0x1ee0bf[_0x3cec86(0x2b5)],_0x22157c));_0x23a8df=_0x2b84a1[_0x3cec86(0x298)]['id'],_0x532ab5[_0x3cec86(0x21c)]['set'](_0xa2b9df['yamlConfig'][_0x3cec86(0x279)],_0x23a8df),_0x4e2240[_0x3cec86(0x1f6)]={'name':_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)],'id':_0x23a8df},_0x203a75['onProgress']?.({'type':'segment_created','name':_0xa2b9df['yamlConfig'][_0x3cec86(0x279)],'segmentId':_0x23a8df}),_0x203a75[_0x3cec86(0x248)]?.(_0x3cec86(0x275)+_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]+'\x27'),_0x4e2240[_0x3cec86(0x26d)]=0x1;}else{if(_0xa2b9df[_0x3cec86(0x289)]){_0x203a75[_0x3cec86(0x23b)]?.({'type':'segment_updating','name':_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]});const _0x50ffb7=_0x46817b(_0x37e4d9);_0x170dbd!==_0xa2b9df[_0x3cec86(0x1f1)]?.[_0x3cec86(0x1cb)]&&(_0x50ffb7['segmentFolderId']=_0x170dbd?parseInt(_0x170dbd,0xa):undefined),await _0x203a75[_0x3cec86(0x1fc)](_0x3cec86(0x262)+_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]+'\x27...',()=>_0x54f7fd['segment'][_0x3cec86(0x1ee)](_0x1ee0bf['parentId'],_0xa2b9df[_0x3cec86(0x1f1)]['id'],_0x50ffb7)),_0x23a8df=_0xa2b9df['existingSegment']['id'],_0x203a75[_0x3cec86(0x23b)]?.({'type':_0x3cec86(0x2b3),'name':_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]}),_0x203a75[_0x3cec86(0x248)]?.(_0x3cec86(0x2a4)+_0xa2b9df['yamlConfig'][_0x3cec86(0x279)]+'\x27'),_0x4e2240[_0x3cec86(0x28b)]=0x1;}else _0x23a8df=_0xa2b9df[_0x3cec86(0x1f1)]['id'];}}catch(_0xc51819){const _0x1e37c8=isHttp400Error(_0xc51819),_0x3cf8b3=_0x1e37c8?ErrorCode[_0x3cec86(0x2a1)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x3613e1=getErrorMessage(_0xc51819);throw new SDKError(_0x3cf8b3,_0x3cec86(0x2a8)+(_0xa2b9df['isNew']?_0x3cec86(0x244):_0x3cec86(0x209))+_0x3cec86(0x27e)+_0xa2b9df[_0x3cec86(0x211)]+_0x3cec86(0x1e2)+_0x3613e1,_0xc51819);}try{const _0x1dad4b=await syncActivationsForSegment(_0x54f7fd,_0x1ee0bf[_0x3cec86(0x2b5)],_0x23a8df,_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)],_0xa2b9df[_0x3cec86(0x1cc)],_0x203a75,_0xa2b9df[_0x3cec86(0x211)]);_0x4e2240[_0x3cec86(0x212)]=_0x1dad4b;}catch(_0x44fef0){if(_0x44fef0 instanceof SDKError)throw _0x44fef0;throw new SDKError(ErrorCode[_0x3cec86(0x217)],_0x3cec86(0x1b3)+_0xa2b9df[_0x3cec86(0x20d)][_0x3cec86(0x279)]+_0x3cec86(0x1b0)+_0xa2b9df[_0x3cec86(0x211)]+'\x0a\x20\x20'+getErrorMessage(_0x44fef0),_0x44fef0);}return _0x4e2240;},_0x178c08=await batchAsync(_0x331ee6,_0x2a5666,_0x57e9e6),_0x19a18e={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x20e46e of _0x178c08){_0x19a18e['created']+=_0x20e46e[_0x524681(0x26d)],_0x19a18e['updated']+=_0x20e46e[_0x524681(0x28b)],_0x20e46e[_0x524681(0x1f6)]&&_0x19a18e[_0x524681(0x228)][_0x524681(0x1ab)](_0x20e46e[_0x524681(0x1f6)][_0x524681(0x279)],_0x20e46e[_0x524681(0x1f6)]['id']),_0x19a18e[_0x524681(0x212)][_0x524681(0x26d)]+=_0x20e46e[_0x524681(0x212)][_0x524681(0x26d)],_0x19a18e['activations'][_0x524681(0x28b)]+=_0x20e46e[_0x524681(0x212)][_0x524681(0x28b)],_0x19a18e[_0x524681(0x212)][_0x524681(0x270)]+=_0x20e46e[_0x524681(0x212)][_0x524681(0x270)];}return _0x19a18e;}async function syncActivationsForSegment(_0x55343f,_0x36f8a5,_0x1f594a,_0x128923,_0x578f88,_0x4efab1,_0x4215fc){const _0x5461c8=a142_0x5a306c,_0x3ec185={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0xa89da9 of _0x578f88){try{if(_0xa89da9[_0x5461c8(0x1bc)]===_0x5461c8(0x244)&&_0xa89da9[_0x5461c8(0x23e)])_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x201),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),await _0x4efab1[_0x5461c8(0x1fc)](_0x5461c8(0x245)+_0xa89da9[_0x5461c8(0x279)]+_0x5461c8(0x1ac),()=>_0x55343f[_0x5461c8(0x293)][_0x5461c8(0x23c)](_0x36f8a5,_0x1f594a,_0xa89da9[_0x5461c8(0x23e)])),_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x22d),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),_0x4efab1[_0x5461c8(0x248)]?.(_0x5461c8(0x1fb)+_0xa89da9[_0x5461c8(0x279)]+'\x27'),_0x3ec185['created']++;else{if(_0xa89da9[_0x5461c8(0x1bc)]==='update'&&_0xa89da9['validatedRequest']&&_0xa89da9['existingActivation'])_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x1ff),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),await _0x4efab1[_0x5461c8(0x1fc)](_0x5461c8(0x1fd)+_0xa89da9['name']+_0x5461c8(0x1ac),()=>_0x55343f['segment'][_0x5461c8(0x1c3)](_0x36f8a5,_0x1f594a,_0xa89da9[_0x5461c8(0x1fe)]['id'],_0xa89da9[_0x5461c8(0x23e)])),_0x4efab1[_0x5461c8(0x23b)]?.({'type':_0x5461c8(0x26e),'segmentName':_0x128923,'activationName':_0xa89da9[_0x5461c8(0x279)]}),_0x4efab1['logSuccess']?.(_0x5461c8(0x1b9)+_0xa89da9['name']+'\x27'),_0x3ec185[_0x5461c8(0x28b)]++;else _0xa89da9[_0x5461c8(0x1bc)]==='delete'&&_0xa89da9['existingActivation']&&(_0x4efab1['onProgress']?.({'type':'activation_deleting','segmentName':_0x128923,'activationName':_0xa89da9['name']}),await _0x4efab1[_0x5461c8(0x1fc)]('Deleting\x20activation\x20\x27'+_0xa89da9[_0x5461c8(0x279)]+_0x5461c8(0x1ac),()=>_0x55343f['segment'][_0x5461c8(0x1b2)](_0x36f8a5,_0x1f594a,_0xa89da9[_0x5461c8(0x1fe)]['id'])),_0x4efab1[_0x5461c8(0x23b)]?.({'type':'activation_deleted','segmentName':_0x128923,'activationName':_0xa89da9['name']}),_0x4efab1[_0x5461c8(0x27a)]?.(_0x5461c8(0x1f9)+_0xa89da9[_0x5461c8(0x279)]+'\x27'),_0x3ec185[_0x5461c8(0x270)]++);}}catch(_0x639184){const _0x323c71=isHttp400Error(_0x639184),_0x222562=_0x323c71?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x76dd99=getErrorMessage(_0x639184);throw new SDKError(_0x222562,_0x5461c8(0x2a8)+_0xa89da9['type']+_0x5461c8(0x24a)+_0xa89da9[_0x5461c8(0x279)]+_0x5461c8(0x1b0)+_0x4215fc+'\x0a\x20\x20'+_0x76dd99,_0x639184);}}return _0x3ec185;}export async function executePushFolders(_0x1ee3de,_0x432e67,_0x313f51,_0x2450f2,_0x40f426){const _0x44b6ae=a142_0x5a306c,_0x4cdc30=new Map(_0x313f51),_0x53e781=sortFoldersByDepth(_0x432e67);for(const _0x548b15 of _0x53e781){const _0xdaa378=_0x548b15['split']('/'),_0x2cae8d=_0xdaa378[_0xdaa378[_0x44b6ae(0x22b)]-0x1],_0x98f1fa=_0xdaa378[_0x44b6ae(0x25f)](0x0,-0x1)[_0x44b6ae(0x26a)]('/'),_0x347f8c=_0x4cdc30[_0x44b6ae(0x219)](_0x98f1fa);_0x40f426['onProgress']?.({'type':_0x44b6ae(0x271),'folder':_0x548b15});const _0x2ffd59={'name':_0x2cae8d,'parentFolderId':_0x347f8c},_0x304984=await _0x40f426[_0x44b6ae(0x1fc)](_0x44b6ae(0x1ce)+_0x548b15+'\x27...',()=>_0x1ee3de[_0x44b6ae(0x293)]['createFolder'](_0x2450f2['parentId'],_0x2ffd59));_0x4cdc30['set'](_0x548b15,_0x304984['data']['id']),_0x40f426[_0x44b6ae(0x23b)]?.({'type':_0x44b6ae(0x1da),'folder':_0x548b15,'folderId':_0x304984[_0x44b6ae(0x298)]['id']}),_0x40f426[_0x44b6ae(0x287)]?.(_0x44b6ae(0x1d3)+_0x548b15+'\x27');}return _0x4cdc30;}export async function executePushSegmentDeletions(_0x17b8d1,_0x56494c,_0x534bd1){const _0x2bcb69=a142_0x5a306c;if(_0x56494c[_0x2bcb69(0x22b)]===0x0)return 0x0;const {batchAsync:_0x292003}=await import(_0x2bcb69(0x27c)),_0x23a56f=0x5,_0x4766e7=await _0x292003(_0x56494c,async _0x5e6b1a=>{const _0x171bab=_0x2bcb69;return _0x534bd1[_0x171bab(0x23b)]?.({'type':_0x171bab(0x207),'name':_0x5e6b1a[_0x171bab(0x279)]}),await _0x17b8d1[_0x171bab(0x293)][_0x171bab(0x222)](_0x5e6b1a['id']),_0x534bd1[_0x171bab(0x23b)]?.({'type':_0x171bab(0x1e1),'name':_0x5e6b1a[_0x171bab(0x279)]}),_0x534bd1[_0x171bab(0x27a)]?.('Deleted\x20segment\x20\x27'+_0x5e6b1a[_0x171bab(0x279)]+'\x27'),0x1;},_0x23a56f);return _0x4766e7[_0x2bcb69(0x272)]((_0x4f7c8b,_0x48a71e)=>_0x4f7c8b+_0x48a71e,0x0);}export async function executePushJourneys(_0x5cd9b2,_0x213369,_0x55b26d,_0x2bbe6b,_0x2ffd90){const _0x2bde97=a142_0x5a306c,{journeyDefToRequest:_0x411007}=await import(_0x2bde97(0x266)),{activationDefToCreateRequest:_0x2c3ac9,yamlRuleToApi:_0x283244,validateSegmentRule:_0x5e7b95}=await import(_0x2bde97(0x1b6)),_0x5c57a2={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x4d8251=new Map(_0x55b26d[_0x2bde97(0x21c)]),_0x395c30=0x5;for(let _0x46364c=0x0;_0x46364c<_0x213369[_0x2bde97(0x22b)];_0x46364c+=_0x395c30){const _0x50148a=_0x213369['slice'](_0x46364c,_0x46364c+_0x395c30),_0x577faa=await Promise[_0x2bde97(0x229)](_0x50148a[_0x2bde97(0x26f)](async _0x30f2f5=>{const _0x5c477a=_0x2bde97;if(!_0x30f2f5[_0x5c477a(0x292)]&&!_0x30f2f5[_0x5c477a(0x289)])return{'action':_0x5c477a(0x264),'name':_0x30f2f5['yamlConfig']['name'],'journeyId':_0x30f2f5[_0x5c477a(0x256)]?.['id']};const _0x394b66=_0x30f2f5[_0x5c477a(0x1f3)]?_0x55b26d[_0x5c477a(0x1d7)][_0x5c477a(0x219)](_0x30f2f5[_0x5c477a(0x1f3)]):undefined;_0x2ffd90[_0x5c477a(0x23b)]?.({'type':_0x30f2f5[_0x5c477a(0x292)]?_0x5c477a(0x1e3):'journey_updating','name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]});try{const _0x334b22=await executeSingleJourneyPush(_0x5cd9b2,_0x30f2f5,{..._0x55b26d,'segmentNameToId':_0x4d8251},{'parentId':_0x2bbe6b[_0x5c477a(0x2b5)],'rootFolderId':_0x2bbe6b[_0x5c477a(0x2aa)],'folderId':_0x394b66,'verbose':_0x2bbe6b[_0x5c477a(0x1d5)]},_0x2ffd90,{'journeyDefToRequest':_0x411007,'activationDefToCreateRequest':_0x2c3ac9,'yamlRuleToApi':_0x283244,'validateSegmentRule':_0x5e7b95});for(const [_0x3786b5,_0x3815a9]of _0x334b22[_0x5c477a(0x25c)]){_0x4d8251[_0x5c477a(0x1ab)](_0x3786b5,_0x3815a9),_0x5c57a2[_0x5c477a(0x25c)][_0x5c477a(0x1ab)](_0x3786b5,_0x3815a9);}if(_0x334b22[_0x5c477a(0x261)]===_0x5c477a(0x26d))_0x2ffd90[_0x5c477a(0x23b)]?.({'type':'journey_created','name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)],'journeyId':_0x334b22['journeyId']}),_0x2ffd90[_0x5c477a(0x248)]?.(_0x5c477a(0x294)+_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]+'\x27'),_0x5c57a2[_0x5c477a(0x26d)]++;else _0x334b22[_0x5c477a(0x261)]===_0x5c477a(0x28b)&&(_0x2ffd90['onProgress']?.({'type':'journey_updated','name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]}),_0x2ffd90[_0x5c477a(0x248)]?.(_0x5c477a(0x253)+_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)]+'\x27'),_0x5c57a2[_0x5c477a(0x28b)]++);return{'action':_0x334b22[_0x5c477a(0x261)],'name':_0x30f2f5[_0x5c477a(0x20d)][_0x5c477a(0x279)],'journeyId':_0x334b22['journeyId']};}catch(_0x437415){const _0x2a6ee9=isHttp400Error(_0x437415),_0x57c97d=_0x2a6ee9?ErrorCode[_0x5c477a(0x1c6)]:ErrorCode[_0x5c477a(0x21e)],_0x2e6ee1=getErrorMessage(_0x437415);throw new SDKError(_0x57c97d,_0x5c477a(0x2a8)+(_0x30f2f5[_0x5c477a(0x292)]?_0x5c477a(0x244):_0x5c477a(0x209))+_0x5c477a(0x1e4)+_0x30f2f5[_0x5c477a(0x211)]+_0x5c477a(0x1e2)+_0x2e6ee1,_0x437415);}}));_0x5c57a2[_0x2bde97(0x236)][_0x2bde97(0x25e)](..._0x577faa);}return _0x5c57a2;}async function matchExistingJourneySegments(_0x25b8d6,_0x44173d,_0x342fd5,_0x4c6dd4,_0x46c111){const _0x5e9559=a142_0x5a306c;if(!_0x44173d[_0x5e9559(0x256)]||!_0x44173d[_0x5e9559(0x20d)][_0x5e9559(0x274)])return;const _0x203aa4=new Map(),_0x5b5d87=new Set();for(const _0x3ddd1d of Object[_0x5e9559(0x21a)](_0x44173d[_0x5e9559(0x20d)][_0x5e9559(0x274)])){const _0x3498cb=generateDeterministicJourneySegmentName(_0x44173d[_0x5e9559(0x20d)]['name'],_0x3ddd1d);_0x203aa4[_0x5e9559(0x1ab)](_0x3498cb,_0x3ddd1d),_0x5b5d87['add'](_0x3ddd1d);}const _0x4c44e3=[],_0x315004=collectSegmentIdsFromJourneyApi(_0x44173d[_0x5e9559(0x256)]);for(const _0x33e9d8 of _0x315004){const _0x243bcf=await fetchSegment(_0x25b8d6,_0x342fd5,_0x33e9d8,_0x4c6dd4);if(!_0x243bcf?.[_0x5e9559(0x279)])continue;const _0x89685e=_0x203aa4[_0x5e9559(0x219)](_0x243bcf[_0x5e9559(0x279)]);_0x89685e?(_0x46c111[_0x5e9559(0x1ab)](_0x89685e,_0x33e9d8),_0x5b5d87['delete'](_0x89685e)):_0x4c44e3[_0x5e9559(0x25e)]({'id':_0x33e9d8,'seg':_0x243bcf});}if(_0x5b5d87[_0x5e9559(0x208)]>0x0&&_0x4c44e3[_0x5e9559(0x22b)]>0x0){const {localExpandedRuleToNames:_0x228fd0}=buildLocalExpandedRuleMappings(_0x44173d[_0x5e9559(0x20d)]),_0x25bc2f=new Map();for(const {id:_0x2dcf1b,seg:_0xf13506}of _0x4c44e3){if(_0xf13506[_0x5e9559(0x2ac)]){const _0x30680a=apiRuleToYaml(_0xf13506[_0x5e9559(0x2ac)]);_0x25bc2f[_0x5e9559(0x1ab)](_0x2dcf1b,_0x30680a);}}for(const {id:_0x15b6f5,seg:_0x32e59e}of _0x4c44e3){if(!_0x32e59e[_0x5e9559(0x2ac)])continue;const _0x773cd6=_0x25bc2f[_0x5e9559(0x219)](_0x15b6f5);if(!_0x773cd6)continue;const _0x31f5df=serializeExpandedRule(_0x773cd6,_0x25bc2f),_0x57b7ea=_0x228fd0[_0x5e9559(0x219)](_0x31f5df);if(_0x57b7ea){const _0xf0436f=_0x57b7ea[_0x5e9559(0x216)](_0x37efe4=>_0x5b5d87[_0x5e9559(0x26b)](_0x37efe4));_0xf0436f&&(_0x46c111[_0x5e9559(0x1ab)](_0xf0436f,_0x15b6f5),_0x5b5d87['delete'](_0xf0436f),logger[_0x5e9559(0x1c0)](_0x5e9559(0x1ea)+_0x32e59e[_0x5e9559(0x279)]+_0x5e9559(0x200)+_0xf0436f+_0x5e9559(0x258)));}}}}async function executeSingleJourneyPush(_0x469cd5,_0xed8866,_0xd380cd,_0x59a74c,_0x46f8be,_0xc0b28f){const _0x395fd4=a142_0x5a306c,{journeyDefToRequest:_0x3e4824,activationDefToCreateRequest:_0x492e4b,yamlRuleToApi:_0x173cce,validateSegmentRule:_0x5ed4b4}=_0xc0b28f,_0x4f0fcb=new Map(),_0x150810=new Map();recoverSegmentIdsFromPushRecovery(_0xed8866,_0x4f0fcb,_0xd380cd['segmentNameToId']);const _0x5dddb7=new Map(),_0x22020c=new Map(),_0x525947=new Map();let _0x99b9d1;const _0x5a0519=async()=>{const _0x3aaea0=a142_0x7272;if(_0x99b9d1)return;_0x99b9d1=new Map();if(!_0xed8866[_0x3aaea0(0x256)])return;const _0x5d44b5=await _0x469cd5['journey'][_0x3aaea0(0x24c)](_0xed8866[_0x3aaea0(0x256)]['id']);for(const _0x4b8a09 of _0x5d44b5){const _0x40256d=journeyActivationStepToYaml(_0x4b8a09,_0xd380cd['idToEmailMap'],_0xd380cd[_0x3aaea0(0x24e)]),_0x5f0c27=activationSignature(_0x40256d);!_0x99b9d1[_0x3aaea0(0x26b)](_0x5f0c27)&&_0x99b9d1[_0x3aaea0(0x1ab)](_0x5f0c27,_0x4b8a09['id']),_0x40256d['name']&&_0x150810[_0x3aaea0(0x1ab)](_0x40256d['name'],_0x4b8a09['id']);}};await matchExistingJourneySegments(_0x469cd5,_0xed8866,_0x59a74c[_0x395fd4(0x2b5)],_0xd380cd[_0x395fd4(0x1c2)],_0xd380cd[_0x395fd4(0x21c)]);const _0x473882={'resolveSegmentId':async _0x403950=>{const _0x1617f3=_0x395fd4,_0x187ef0=_0xd380cd[_0x1617f3(0x21c)][_0x1617f3(0x219)](_0x403950);if(!_0x187ef0)throw new SDKError(ErrorCode[_0x1617f3(0x295)],_0x1617f3(0x276)+_0x403950+'\x20(referenced\x20in\x20journey\x20'+_0xed8866[_0x1617f3(0x20d)][_0x1617f3(0x279)]+')');return _0x187ef0;},'resolveEmbeddedSegmentId':async(_0x5de2fe,_0x2b29c9)=>{const _0x29f0a4=_0x395fd4,_0x3df736=_0xd380cd['segmentNameToId']['get'](_0x5de2fe);if(_0x3df736)return _0x3df736;const _0x16c795=_0xd380cd[_0x29f0a4(0x1c2)][_0x29f0a4(0x216)](_0x2fd84f=>_0x2fd84f['name']===_0x5de2fe);if(_0x16c795)return _0xd380cd[_0x29f0a4(0x21c)]['set'](_0x5de2fe,_0x16c795['id']),_0x16c795['id'];if(_0xed8866['isNew']){const {stageName:_0x5c1e0c,criteriaName:_0x11276d}=findSegmentCriteriaLocation(_0xed8866[_0x29f0a4(0x20d)],_0x5de2fe);return _0x5ed4b4(_0x5de2fe,_0x2b29c9[_0x29f0a4(0x2ac)]),_0x22020c[_0x29f0a4(0x1ab)](_0x5de2fe,{'definition':_0x2b29c9,'stageName':_0x5c1e0c,'criteriaName':_0x11276d}),createPendingSegmentId(_0x5de2fe);}const _0x3bb3a5=_0xed8866[_0x29f0a4(0x256)]?.['id'];if(!_0x3bb3a5)throw new SDKError(ErrorCode[_0x29f0a4(0x22f)],_0x29f0a4(0x1cf));const _0x2c87c4=_0x5dddb7['get'](_0x5de2fe);if(_0x2c87c4)return _0x2c87c4;const _0x339150=((async()=>{const _0x5bccdb=_0x29f0a4;_0x5ed4b4(_0x5de2fe,_0x2b29c9['rule']);const _0x4f0f62=generateDeterministicJourneySegmentName(_0xed8866[_0x5bccdb(0x20d)][_0x5bccdb(0x279)],_0x5de2fe),_0x77c0ea=_0xd380cd[_0x5bccdb(0x1c2)][_0x5bccdb(0x216)](_0x27b25a=>_0x27b25a[_0x5bccdb(0x279)]===_0x4f0f62),_0x693feb=createSegmentIdResolver(_0xd380cd[_0x5bccdb(0x21c)],_0x5de2fe),_0x4d8542=await resolveRuleSegmentIds(_0x2b29c9['rule'],_0x693feb);let _0x4809da;return _0x77c0ea?(await _0x469cd5[_0x5bccdb(0x293)][_0x5bccdb(0x1ee)](_0x59a74c[_0x5bccdb(0x2b5)],_0x77c0ea['id'],{'description':_0x2b29c9[_0x5bccdb(0x1ba)]||_0x5bccdb(0x1b1)+_0x5de2fe,'rule':_0x173cce(_0x4d8542,!![]),'countPopulation':!![]}),_0x4809da=_0x77c0ea['id'],saveSegmentToPushRecovery(_0xed8866[_0x5bccdb(0x211)],_0xed8866[_0x5bccdb(0x20d)]['name'],_0x5de2fe,{'segmentId':_0x4809da,'uniqueServerName':_0x4f0f62,'createdAt':new Date()[_0x5bccdb(0x29f)]()})):_0x4809da=await createOrRecoverEmbeddedSegment(_0x469cd5,_0xed8866,{'localName':_0x5de2fe,'uniqueSegmentName':_0x4f0f62,'description':_0x2b29c9['description']||_0x5bccdb(0x1b1)+_0x5de2fe,'journeyId':_0x3bb3a5,'resolvedRule':_0x4d8542,'parentId':_0x59a74c['parentId'],'folderId':_0x59a74c['rootFolderId']||''},_0x173cce),_0xd380cd[_0x5bccdb(0x21c)][_0x5bccdb(0x1ab)](_0x5de2fe,_0x4809da),_0x4f0fcb[_0x5bccdb(0x1ab)](_0x5de2fe,_0x4809da),_0x4809da;})());_0x5dddb7[_0x29f0a4(0x1ab)](_0x5de2fe,_0x339150);try{return await _0x339150;}finally{_0x5dddb7[_0x29f0a4(0x1e8)](_0x5de2fe);}},'resolveActivationId':async _0x1f864c=>{const _0x3c3503=_0x395fd4,_0x444cd4=_0x150810['get'](_0x1f864c);if(_0x444cd4)return _0x444cd4;if(_0xed8866[_0x3c3503(0x256)]){await _0x5a0519();const _0x38a4f3=_0x150810[_0x3c3503(0x219)](_0x1f864c);if(_0x38a4f3)return _0x38a4f3;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x1f864c+'\x20(referenced\x20in\x20journey\x20'+_0xed8866['yamlConfig'][_0x3c3503(0x279)]+_0x3c3503(0x1b5)+_0x3c3503(0x203));},'resolveEmbeddedActivationId':async(_0x2264c1,_0x71819)=>{const _0x5a5ae9=_0x395fd4,_0x2def73=_0x150810['get'](_0x2264c1);if(_0x2def73)return _0x2def73;if(_0xed8866[_0x5a5ae9(0x292)])return _0x525947[_0x5a5ae9(0x1ab)](_0x2264c1,_0x71819),createPendingActivationId(_0x2264c1);if(_0xed8866['existingJourney']){await _0x5a0519();const _0x36e78e=_0x150810[_0x5a5ae9(0x219)](_0x71819['name']);if(_0x36e78e)return _0x150810['set'](_0x2264c1,_0x36e78e),_0x36e78e;const _0x3e745f=activationSignature(_0x71819),_0x49b7de=_0x99b9d1?.[_0x5a5ae9(0x219)](_0x3e745f);if(_0x49b7de)return _0x150810[_0x5a5ae9(0x1ab)](_0x2264c1,_0x49b7de),_0x49b7de;const _0x41ae00=await _0x492e4b(_0x71819,_0xd380cd[_0x5a5ae9(0x1cd)]),_0x4af30a={..._0x41ae00,..._0x71819['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x71819['run_after_journey_refresh']}},_0x2a3765=await _0x469cd5['journey'][_0x5a5ae9(0x23c)](_0xed8866[_0x5a5ae9(0x256)]['id'],_0x4af30a);return _0x150810[_0x5a5ae9(0x1ab)](_0x2264c1,_0x2a3765['id']),_0x2a3765['id'];}throw new SDKError(ErrorCode[_0x5a5ae9(0x22f)],_0x5a5ae9(0x1ef));},'resolveJourneyId':async _0x4d05b5=>{const _0x29a4ea=_0x395fd4;try{return await _0x469cd5[_0x29a4ea(0x268)][_0x29a4ea(0x1c4)](_0x59a74c['parentId'],_0x4d05b5);}catch(_0x3f4e53){throw new SDKError(ErrorCode['NOT_FOUND'],_0x29a4ea(0x1f2)+_0x4d05b5+_0x29a4ea(0x1c9)+_0xed8866[_0x29a4ea(0x20d)][_0x29a4ea(0x279)]+'\x27)',_0x3f4e53);}},'resolveStageId':async(_0x306bd9,_0x3eb23d)=>{const _0xb9af77=_0x395fd4,_0x1df470=await _0x469cd5[_0xb9af77(0x268)]['getJourney'](_0x306bd9),_0x149fa5=_0x1df470[_0xb9af77(0x235)][_0xb9af77(0x21f)][_0xb9af77(0x216)](_0x32b7ed=>_0x32b7ed['name'][_0xb9af77(0x1bf)]()===_0x3eb23d[_0xb9af77(0x1bf)]());if(!_0x149fa5?.['id'])throw new SDKError(ErrorCode[_0xb9af77(0x1d9)],_0xb9af77(0x1f5)+_0x3eb23d+_0xb9af77(0x25d)+(_0x1df470[_0xb9af77(0x235)]['journeyBundleName']||_0x1df470[_0xb9af77(0x235)][_0xb9af77(0x279)])+'\x27');return _0x149fa5['id'];}},_0x42c89c=await _0x3e4824(_0xed8866[_0x395fd4(0x20d)],_0x59a74c['parentId'],_0x473882),_0x4ceb27=_0x59a74c[_0x395fd4(0x1ad)]||_0x59a74c[_0x395fd4(0x2aa)];_0x4ceb27&&(_0x42c89c['relationships']={'parentFolder':{'data':{'id':_0x4ceb27,'type':_0x395fd4(0x29e)}}});if(_0xed8866['isNew']){if(_0x22020c[_0x395fd4(0x208)]>0x0||_0x525947['size']>0x0)return await executeThreeStepJourneyCreate(_0x469cd5,_0xed8866,_0x42c89c,{'pendingEmbeddedSegments':_0x22020c,'pendingEmbeddedActivations':_0x525947,'embeddedSegmentNameToId':_0x4f0fcb,'journeyActivationNameToId':_0x150810},{..._0x59a74c,'effectiveFolderId':_0x4ceb27},_0xd380cd,_0x46f8be,_0xc0b28f);else{ensureJourneyDefaults(_0x42c89c[_0x395fd4(0x235)]);const _0x23dbb7=await _0x469cd5['journey'][_0x395fd4(0x244)](_0x42c89c);return deletePushRecovery(_0xed8866[_0x395fd4(0x211)]),{'action':_0x395fd4(0x26d),'journeyId':_0x23dbb7['id'],'embeddedSegmentNameToId':_0x4f0fcb};}}else{if(_0xed8866['hasChanges']&&_0xed8866[_0x395fd4(0x256)]){_0x42c89c['id']=_0xed8866[_0x395fd4(0x256)]['id'];const _0x51ff19=_0x42c89c[_0x395fd4(0x235)];_0xed8866[_0x395fd4(0x256)][_0x395fd4(0x235)]?.[_0x395fd4(0x20e)]&&(_0x51ff19[_0x395fd4(0x20e)]=_0xed8866[_0x395fd4(0x256)]['attributes'][_0x395fd4(0x20e)]);const _0x243bf0=_0xed8866[_0x395fd4(0x256)][_0x395fd4(0x235)]?.[_0x395fd4(0x21f)];return _0x243bf0&&_0x42c89c['attributes']['journeyStages']&&injectExistingStageIds(_0x42c89c[_0x395fd4(0x235)]['journeyStages'],_0x243bf0),ensureJourneyDefaults(_0x51ff19),await _0x469cd5['journey']['update'](_0xed8866[_0x395fd4(0x256)]['id'],_0x42c89c),deletePushRecovery(_0xed8866[_0x395fd4(0x211)]),{'action':_0x395fd4(0x28b),'journeyId':_0xed8866[_0x395fd4(0x256)]['id'],'embeddedSegmentNameToId':_0x4f0fcb};}}return deletePushRecovery(_0xed8866[_0x395fd4(0x211)]),{'action':_0x395fd4(0x264),'journeyId':_0xed8866[_0x395fd4(0x256)]?.['id'],'embeddedSegmentNameToId':_0x4f0fcb};}function findSegmentCriteriaLocation(_0x2e7807,_0x1ec05a){const _0xc4b345=a142_0x5a306c,_0x36586d=_0x2e7807[_0xc4b345(0x2b1)]||_0x2e7807['journeys']?.[0x0]?.[_0xc4b345(0x2b1)]||[];let _0x5d0c47=_0xc4b345(0x1e9),_0xf583f6=_0x1ec05a;const _0x3573f6=_0x2e7807[_0xc4b345(0x1f4)]||_0x2e7807[_0xc4b345(0x1c5)]?.[0x0]?.[_0xc4b345(0x1f4)];if(_0x3573f6?.[_0xc4b345(0x293)]===_0x1ec05a)return{'stageName':_0xc4b345(0x1f4),'criteriaName':_0x3573f6['name']||_0x1ec05a};_0x33382c:for(const _0x575337 of _0x36586d){if(_0x575337['entry_criteria']?.[_0xc4b345(0x293)]===_0x1ec05a){_0x5d0c47=_0x575337[_0xc4b345(0x279)],_0xf583f6=_0x575337[_0xc4b345(0x1d0)][_0xc4b345(0x279)]||_0x1ec05a;break;}if(_0x575337[_0xc4b345(0x249)])for(const _0x136f5a of _0x575337[_0xc4b345(0x249)]){if(_0x136f5a[_0xc4b345(0x1bc)]===_0xc4b345(0x28c)&&_0x136f5a[_0xc4b345(0x234)]?.['branches'])for(const _0x59dcc5 of _0x136f5a['with'][_0xc4b345(0x2af)]){if(_0x59dcc5[_0xc4b345(0x293)]===_0x1ec05a){_0x5d0c47=_0x575337['name'],_0xf583f6=_0x59dcc5[_0xc4b345(0x279)]||_0x1ec05a;break _0x33382c;}}}}return{'stageName':_0x5d0c47,'criteriaName':_0xf583f6};}async function executeThreeStepJourneyCreate(_0x2891ad,_0x457760,_0x27a347,_0x4ef0c2,_0x7a5f41,_0x3ca15f,_0x5a408c,_0xce49bf){const _0x3422ef=a142_0x5a306c,{activationDefToCreateRequest:_0x2a392a,yamlRuleToApi:_0x222641}=_0xce49bf,{pendingEmbeddedSegments:_0x47ee2b,pendingEmbeddedActivations:_0x226a35,embeddedSegmentNameToId:_0x2ba869}=_0x4ef0c2,_0x2caddd=JSON['parse'](JSON[_0x3422ef(0x25b)](_0x27a347));ensureJourneyDefaults(_0x2caddd[_0x3422ef(0x235)]),stripPendingIds(_0x2caddd);const _0x91e7a=await _0x2891ad[_0x3422ef(0x268)][_0x3422ef(0x244)](_0x2caddd),_0x5239da=_0x91e7a['id'],_0x15c939=new Map();for(const _0x51e899 of _0x91e7a[_0x3422ef(0x235)]['journeyStages']){_0x15c939[_0x3422ef(0x1ab)](_0x51e899[_0x3422ef(0x279)][_0x3422ef(0x1bf)](),_0x51e899['id']);}recoverSegmentIdsFromPushRecovery(_0x457760,_0x2ba869,_0x3ca15f[_0x3422ef(0x21c)]);for(const [_0x37a80c,{definition:_0x31a9cc}]of _0x47ee2b){if(_0x2ba869['has'](_0x37a80c)){_0x5a408c[_0x3422ef(0x23b)]?.({'type':'embedded_segment_created','journeyName':_0x457760[_0x3422ef(0x20d)][_0x3422ef(0x279)],'segmentName':_0x37a80c});continue;}const _0x5baf36=generateDeterministicJourneySegmentName(_0x457760['yamlConfig']['name'],_0x37a80c);_0x5a408c[_0x3422ef(0x23b)]?.({'type':'embedded_segment_creating','journeyName':_0x457760[_0x3422ef(0x20d)]['name'],'segmentName':_0x37a80c});const _0x3a4cf0=createSegmentIdResolver(_0x3ca15f[_0x3422ef(0x21c)],_0x37a80c),_0x44fddf=await resolveRuleSegmentIds(_0x31a9cc[_0x3422ef(0x2ac)],_0x3a4cf0),_0x564b19=await createOrRecoverEmbeddedSegment(_0x2891ad,_0x457760,{'localName':_0x37a80c,'uniqueSegmentName':_0x5baf36,'description':_0x31a9cc[_0x3422ef(0x1ba)]||_0x3422ef(0x1b1)+_0x37a80c,'journeyId':_0x5239da,'resolvedRule':_0x44fddf,'parentId':_0x7a5f41[_0x3422ef(0x2b5)],'folderId':_0x7a5f41[_0x3422ef(0x23f)]||''},_0x222641);_0x2ba869['set'](_0x37a80c,_0x564b19),_0x3ca15f[_0x3422ef(0x21c)][_0x3422ef(0x1ab)](_0x37a80c,_0x564b19),_0x5a408c[_0x3422ef(0x23b)]?.({'type':_0x3422ef(0x230),'journeyName':_0x457760[_0x3422ef(0x20d)][_0x3422ef(0x279)],'segmentName':_0x37a80c});}const _0x4b4f1c=new Map();for(const [_0x5595ae,_0x160930]of _0x226a35){_0x5a408c[_0x3422ef(0x23b)]?.({'type':_0x3422ef(0x2a9),'journeyName':_0x457760['yamlConfig'][_0x3422ef(0x279)],'activationName':_0x5595ae});const _0x3a38d1=await _0x2a392a(_0x160930,_0x3ca15f[_0x3422ef(0x1cd)]),_0x1996a0={..._0x3a38d1,..._0x160930['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x160930[_0x3422ef(0x1be)]}},_0x43ef5d=await _0x2891ad[_0x3422ef(0x268)]['createActivation'](_0x5239da,_0x1996a0);_0x4b4f1c[_0x3422ef(0x1ab)](_0x5595ae,_0x43ef5d['id']),_0x4ef0c2[_0x3422ef(0x29d)]['set'](_0x5595ae,_0x43ef5d['id']),_0x5a408c['onProgress']?.({'type':_0x3422ef(0x252),'journeyName':_0x457760[_0x3422ef(0x20d)]['name'],'activationName':_0x5595ae});}const _0x537a25=JSON[_0x3422ef(0x281)](JSON['stringify'](_0x27a347));return _0x537a25['id']=_0x5239da,ensureJourneyDefaults(_0x537a25[_0x3422ef(0x235)]),resolvePendingIdsInRequest(_0x537a25,_0x27a347,_0x15c939,_0x2ba869,_0x4b4f1c,_0x5a408c),await _0x2891ad[_0x3422ef(0x268)][_0x3422ef(0x209)](_0x5239da,_0x537a25),deletePushRecovery(_0x457760[_0x3422ef(0x211)]),{'action':_0x3422ef(0x26d),'journeyId':_0x5239da,'embeddedSegmentNameToId':_0x2ba869};}export function stripWaitStepPendingIds(_0x5f39ee){const _0x58a702=a142_0x5a306c,_0x19d704=_0x5f39ee['conditionSegmentId']&&isPendingSegmentId(_0x5f39ee[_0x58a702(0x2ad)]),_0x215287=_0x5f39ee[_0x58a702(0x21d)]?.[_0x58a702(0x269)](_0x5b755d=>_0x5b755d[_0x58a702(0x21b)]&&isPendingSegmentId(_0x5b755d['segmentId']));(_0x19d704||_0x215287)&&(_0x5f39ee[_0x58a702(0x20f)]='Duration',_0x5f39ee[_0x58a702(0x1dc)]=0x1,_0x5f39ee[_0x58a702(0x1f0)]='day',delete _0x5f39ee[_0x58a702(0x2ad)],delete _0x5f39ee[_0x58a702(0x1db)],delete _0x5f39ee[_0x58a702(0x278)],delete _0x5f39ee['conditions']);}export function resolveWaitStepPendingIds(_0x4e4be2,_0x1c4d88,_0x229ccf,_0x87fa72){const _0x2a9ad2=a142_0x5a306c;if(_0x1c4d88['conditionSegmentId']&&isPendingSegmentId(_0x1c4d88[_0x2a9ad2(0x2ad)])){const _0x4c1841=_0x229ccf(_0x1c4d88[_0x2a9ad2(0x2ad)],_0x2a9ad2(0x254)+_0x87fa72+_0x2a9ad2(0x238));_0x4c1841&&(_0x4e4be2[_0x2a9ad2(0x20f)]=_0x2a9ad2(0x233),_0x4e4be2[_0x2a9ad2(0x2ad)]=_0x4c1841,delete _0x4e4be2[_0x2a9ad2(0x1dc)],delete _0x4e4be2[_0x2a9ad2(0x1f0)],_0x1c4d88['conditionTimeoutDuration']!==undefined&&(_0x4e4be2[_0x2a9ad2(0x1db)]=_0x1c4d88[_0x2a9ad2(0x1db)]),_0x1c4d88[_0x2a9ad2(0x278)]&&(_0x4e4be2[_0x2a9ad2(0x278)]=_0x1c4d88[_0x2a9ad2(0x278)]));}if(_0x1c4d88[_0x2a9ad2(0x21d)]){const _0x3d9dc1=_0x1c4d88[_0x2a9ad2(0x21d)][_0x2a9ad2(0x269)](_0x2f0cd2=>_0x2f0cd2[_0x2a9ad2(0x21b)]&&isPendingSegmentId(_0x2f0cd2[_0x2a9ad2(0x21b)]));if(_0x3d9dc1){const _0x5aabfa=_0x1c4d88[_0x2a9ad2(0x21d)][_0x2a9ad2(0x26f)](_0x26c61e=>{const _0x535f90=_0x2a9ad2;if(_0x26c61e[_0x535f90(0x21b)]&&isPendingSegmentId(_0x26c61e['segmentId'])){const _0x25c8ce=_0x229ccf(_0x26c61e[_0x535f90(0x21b)],_0x535f90(0x254)+_0x87fa72+_0x535f90(0x238));return{..._0x26c61e,'segmentId':_0x25c8ce||_0x26c61e[_0x535f90(0x21b)]};}return{..._0x26c61e};});_0x4e4be2[_0x2a9ad2(0x20f)]='Condition',_0x4e4be2[_0x2a9ad2(0x21d)]=_0x5aabfa,delete _0x4e4be2['waitStep'],delete _0x4e4be2[_0x2a9ad2(0x1f0)],delete _0x4e4be2[_0x2a9ad2(0x2ad)],delete _0x4e4be2[_0x2a9ad2(0x1db)],delete _0x4e4be2[_0x2a9ad2(0x278)];}}}function stripPendingIds(_0x4bb7db){const _0x557559=a142_0x5a306c;_0x4bb7db[_0x557559(0x235)][_0x557559(0x1f4)]?.[_0x557559(0x21b)]&&isPendingSegmentId(_0x4bb7db['attributes']['goal'][_0x557559(0x21b)])&&delete _0x4bb7db[_0x557559(0x235)][_0x557559(0x1f4)];for(const _0x4bba76 of _0x4bb7db[_0x557559(0x235)][_0x557559(0x21f)]||[]){_0x4bba76[_0x557559(0x2b4)]?.['segmentId']&&isPendingSegmentId(_0x4bba76['entryCriteria'][_0x557559(0x21b)])&&delete _0x4bba76[_0x557559(0x2b4)];_0x4bba76[_0x557559(0x239)]?.[_0x557559(0x21b)]&&isPendingSegmentId(_0x4bba76[_0x557559(0x239)][_0x557559(0x21b)])&&delete _0x4bba76[_0x557559(0x239)];_0x4bba76[_0x557559(0x285)]&&(_0x4bba76[_0x557559(0x285)]=_0x4bba76[_0x557559(0x285)]['filter'](_0x540d63=>!_0x540d63['segmentId']||!isPendingSegmentId(_0x540d63['segmentId'])));if(_0x4bba76[_0x557559(0x249)])for(const _0x24d2e5 of Object['keys'](_0x4bba76[_0x557559(0x249)])){const _0x626179=_0x4bba76[_0x557559(0x249)][_0x24d2e5];_0x626179['type']===_0x557559(0x2ae)&&_0x626179['journeyActivationStepId']&&isPendingActivationId(_0x626179[_0x557559(0x205)])&&(_0x626179['journeyActivationStepId']='');if(_0x626179[_0x557559(0x1bc)]===_0x557559(0x1d1)&&_0x626179[_0x557559(0x2af)])for(const _0x20aa26 of _0x626179['branches']){_0x20aa26[_0x557559(0x21b)]&&isPendingSegmentId(_0x20aa26[_0x557559(0x21b)])&&(_0x20aa26['segmentId']='');}_0x626179[_0x557559(0x1bc)]===_0x557559(0x260)&&stripWaitStepPendingIds(_0x626179);}}}function resolvePendingIdsInRequest(_0x3b7dd0,_0xfbe5bb,_0x3bd5b4,_0x4d99ea,_0x29ba1d,_0x57cffd){const _0x2a6324=a142_0x5a306c,_0x30df2f=(_0x54072f,_0x20a4dd)=>{const _0xa97faa=a142_0x7272;if(!isPendingSegmentId(_0x54072f))return _0x54072f;const _0x251981=extractPendingSegmentName(_0x54072f),_0x3fa3e9=_0x4d99ea['get'](_0x251981);return!_0x3fa3e9&&_0x57cffd[_0xa97faa(0x2a3)]?.(_0xa97faa(0x225)+_0x251981+'\x27\x20for\x20'+_0x20a4dd),_0x3fa3e9;};if(_0x3b7dd0[_0x2a6324(0x235)][_0x2a6324(0x1f4)]?.[_0x2a6324(0x21b)]&&isPendingSegmentId(_0x3b7dd0['attributes']['goal'][_0x2a6324(0x21b)])){const _0x543d8c=_0x30df2f(_0x3b7dd0[_0x2a6324(0x235)][_0x2a6324(0x1f4)][_0x2a6324(0x21b)],_0x2a6324(0x218));_0x543d8c&&(_0x3b7dd0[_0x2a6324(0x235)][_0x2a6324(0x1f4)][_0x2a6324(0x21b)]=_0x543d8c);}for(const _0x2d460e of _0x3b7dd0[_0x2a6324(0x235)]['journeyStages']||[]){const _0x2b7db3=_0x3bd5b4[_0x2a6324(0x219)](_0x2d460e[_0x2a6324(0x279)][_0x2a6324(0x1bf)]());_0x2b7db3&&(_0x2d460e['id']=_0x2b7db3);if(_0x2d460e['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x2d460e[_0x2a6324(0x2b4)][_0x2a6324(0x21b)])){const _0x1ff389=_0x30df2f(_0x2d460e[_0x2a6324(0x2b4)][_0x2a6324(0x21b)],_0x2a6324(0x254)+_0x2d460e['name']+_0x2a6324(0x240));_0x1ff389&&(_0x2d460e[_0x2a6324(0x2b4)][_0x2a6324(0x21b)]=_0x1ff389);}if(_0x2d460e[_0x2a6324(0x285)])for(const _0x1467f7 of _0x2d460e[_0x2a6324(0x285)]){if(_0x1467f7['segmentId']&&isPendingSegmentId(_0x1467f7[_0x2a6324(0x21b)])){const _0x5a8684=_0x30df2f(_0x1467f7['segmentId'],_0x2a6324(0x254)+_0x2d460e['name']+_0x2a6324(0x25a));_0x5a8684&&(_0x1467f7[_0x2a6324(0x21b)]=_0x5a8684);}}if(_0x2d460e[_0x2a6324(0x239)]?.[_0x2a6324(0x21b)]&&isPendingSegmentId(_0x2d460e[_0x2a6324(0x239)][_0x2a6324(0x21b)])){const _0x4e13b6=_0x30df2f(_0x2d460e[_0x2a6324(0x239)][_0x2a6324(0x21b)],_0x2a6324(0x254)+_0x2d460e[_0x2a6324(0x279)]+_0x2a6324(0x265));_0x4e13b6&&(_0x2d460e[_0x2a6324(0x239)][_0x2a6324(0x21b)]=_0x4e13b6);}if(_0x2d460e['steps']){const _0x2bc0f9=_0x2d665b=>_0xfbe5bb[_0x2a6324(0x235)][_0x2a6324(0x21f)]?.[_0x2a6324(0x216)](_0x24e1ea=>_0x24e1ea[_0x2a6324(0x279)][_0x2a6324(0x1bf)]()===_0x2d460e[_0x2a6324(0x279)][_0x2a6324(0x1bf)]())?.[_0x2a6324(0x249)]?.[_0x2d665b];for(const _0x3d7687 of Object[_0x2a6324(0x21a)](_0x2d460e[_0x2a6324(0x249)])){const _0x27ad85=_0x2d460e['steps'][_0x3d7687],_0x7858fa=_0x2bc0f9(_0x3d7687);if(_0x27ad85['type']==='Activation'&&_0x27ad85[_0x2a6324(0x205)]&&(isPendingActivationId(_0x27ad85[_0x2a6324(0x205)])||_0x27ad85[_0x2a6324(0x205)]==='')){if(_0x7858fa?.[_0x2a6324(0x205)]&&isPendingActivationId(_0x7858fa[_0x2a6324(0x205)])){const _0x56e80a=extractPendingActivationName(_0x7858fa['journeyActivationStepId']),_0x358071=_0x29ba1d[_0x2a6324(0x219)](_0x56e80a);_0x358071&&(_0x27ad85['journeyActivationStepId']=_0x358071);}}if(_0x27ad85[_0x2a6324(0x1bc)]===_0x2a6324(0x1d1)&&_0x27ad85['branches']&&_0x7858fa?.[_0x2a6324(0x2af)])for(let _0x15d39c=0x0;_0x15d39c<_0x27ad85['branches'][_0x2a6324(0x22b)];_0x15d39c++){const _0x347790=_0x27ad85['branches'][_0x15d39c],_0x46a819=_0x7858fa['branches'][_0x15d39c];if(_0x46a819?.['segmentId']&&isPendingSegmentId(_0x46a819[_0x2a6324(0x21b)])){const _0x26bdd6=_0x30df2f(_0x46a819[_0x2a6324(0x21b)],_0x2a6324(0x254)+_0x2d460e['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x347790[_0x2a6324(0x279)]||_0x15d39c)+'\x27');_0x26bdd6&&(_0x347790[_0x2a6324(0x21b)]=_0x26bdd6);}}_0x27ad85[_0x2a6324(0x1bc)]===_0x2a6324(0x260)&&_0x7858fa?.[_0x2a6324(0x1bc)]===_0x2a6324(0x260)&&resolveWaitStepPendingIds(_0x27ad85,_0x7858fa,_0x30df2f,_0x2d460e['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a143_0xf25e(){const _0x9ab127=['57328PUomdC','3376640feiQOL','name','741348Tftwgq','add','154ppPzPo','63CriMUr','252hcLwlw','1735610NZGvYW','2NPBAaC','5536996ljfWle','get','has','set','3MjTwXe','1262557VwxeRw','573023xHEEVz','parentFolderId'];a143_0xf25e=function(){return _0x9ab127;};return a143_0xf25e();}(function(_0x5a941f,_0x508e47){const _0x2e7166=a143_0x1f61,_0x5dcb9d=_0x5a941f();while(!![]){try{const _0xd1a66b=-parseInt(_0x2e7166(0xde))/0x1*(-parseInt(_0x2e7166(0xd8))/0x2)+parseInt(_0x2e7166(0xdd))/0x3*(-parseInt(_0x2e7166(0xd9))/0x4)+parseInt(_0x2e7166(0xd0))/0x5+-parseInt(_0x2e7166(0xd2))/0x6+parseInt(_0x2e7166(0xd4))/0x7*(parseInt(_0x2e7166(0xcf))/0x8)+parseInt(_0x2e7166(0xd5))/0x9*(parseInt(_0x2e7166(0xd7))/0xa)+parseInt(_0x2e7166(0xdf))/0xb*(-parseInt(_0x2e7166(0xd6))/0xc);if(_0xd1a66b===_0x508e47)break;else _0x5dcb9d['push'](_0x5dcb9d['shift']());}catch(_0xd6c7f1){_0x5dcb9d['push'](_0x5dcb9d['shift']());}}}(a143_0xf25e,0xad060));export function buildFolderIdToPathMap(_0x2362c7){const _0x1989f0=a143_0x1f61,_0x2bf920=new Map(),_0x1240ac=new Map();for(const _0x44682f of _0x2362c7){_0x1240ac[_0x1989f0(0xdc)](_0x44682f['id'],_0x44682f);}const _0x2fb18d=new Set();for(const _0x46a7ea of _0x2362c7){!_0x46a7ea[_0x1989f0(0xce)]&&_0x2fb18d[_0x1989f0(0xd3)](_0x46a7ea['id']);}function _0x4bae2f(_0x3a119f){const _0x112355=_0x1989f0;if(_0x2bf920[_0x112355(0xdb)](_0x3a119f['id']))return _0x2bf920['get'](_0x3a119f['id']);if(_0x2fb18d[_0x112355(0xdb)](_0x3a119f['id']))return _0x2bf920[_0x112355(0xdc)](_0x3a119f['id'],''),'';if(_0x3a119f['parentFolderId']){const _0x378868=_0x1240ac[_0x112355(0xda)](_0x3a119f[_0x112355(0xce)]);if(_0x378868){const _0x3392d3=_0x4bae2f(_0x378868),_0x161243=_0x3392d3?_0x3392d3+'/'+_0x3a119f[_0x112355(0xd1)]:_0x3a119f['name'];return _0x2bf920[_0x112355(0xdc)](_0x3a119f['id'],_0x161243),_0x161243;}}const _0xcaf201=_0x3a119f['name'];return _0x2bf920['set'](_0x3a119f['id'],_0xcaf201),_0xcaf201;}for(const _0x4ac935 of _0x2362c7){_0x4bae2f(_0x4ac935);}return _0x2bf920;}function a143_0x1f61(_0xe37503,_0x2a3af7){_0xe37503=_0xe37503-0xce;const _0xf25ef9=a143_0xf25e();let _0x1f61ef=_0xf25ef9[_0xe37503];return _0x1f61ef;}export function buildFolderPathToIdMap(_0x18af44){const _0x26f2be=a143_0x1f61,_0x21979a=new Map(),_0x338f76=new Map();for(const _0x36c12f of _0x18af44){_0x338f76[_0x26f2be(0xdc)](_0x36c12f['id'],_0x36c12f);}const _0x4f9960=new Set();for(const _0xac0462 of _0x18af44){!_0xac0462[_0x26f2be(0xce)]&&_0x4f9960['add'](_0xac0462['id']);}function _0x147765(_0x3737f1){const _0x3471a4=_0x26f2be;if(_0x4f9960[_0x3471a4(0xdb)](_0x3737f1['id']))return'';if(_0x3737f1[_0x3471a4(0xce)]){const _0xa7b2b2=_0x338f76[_0x3471a4(0xda)](_0x3737f1[_0x3471a4(0xce)]);if(_0xa7b2b2){const _0x11036f=_0x147765(_0xa7b2b2);return _0x11036f?_0x11036f+'/'+_0x3737f1['name']:_0x3737f1[_0x3471a4(0xd1)];}}return _0x3737f1[_0x3471a4(0xd1)];}for(const _0x267630 of _0x18af44){const _0x25bc73=_0x147765(_0x267630);_0x21979a[_0x26f2be(0xdc)](_0x25bc73,_0x267630['id']);}return _0x21979a;}export function buildFolderMaps(_0x3b3f90){const _0x494f04=a143_0x1f61,_0x36fce0=buildFolderIdToPathMap(_0x3b3f90),_0x18b0f2=new Map();for(const [_0x4efbe0,_0x3692ef]of _0x36fce0){_0x18b0f2[_0x494f04(0xdc)](_0x3692ef,_0x4efbe0);}return{'idToPath':_0x36fce0,'pathToId':_0x18b0f2};}export function getFolderPath(_0x103d47,_0x298623){const _0x3722e3=a143_0x1f61;if(!_0x103d47)return'';return _0x298623[_0x3722e3(0xda)](_0x103d47)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x276431,_0x2aab01){const _0x4c3d58=a144_0x59ed,_0x119a30=_0x276431();while(!![]){try{const _0x4384b8=-parseInt(_0x4c3d58(0x126))/0x1*(parseInt(_0x4c3d58(0x116))/0x2)+-parseInt(_0x4c3d58(0x130))/0x3+-parseInt(_0x4c3d58(0x106))/0x4*(parseInt(_0x4c3d58(0x10f))/0x5)+-parseInt(_0x4c3d58(0x127))/0x6*(-parseInt(_0x4c3d58(0x122))/0x7)+parseInt(_0x4c3d58(0xfe))/0x8+-parseInt(_0x4c3d58(0x10c))/0x9*(parseInt(_0x4c3d58(0x103))/0xa)+-parseInt(_0x4c3d58(0x124))/0xb*(-parseInt(_0x4c3d58(0x108))/0xc);if(_0x4384b8===_0x2aab01)break;else _0x119a30['push'](_0x119a30['shift']());}catch(_0x28c4f7){_0x119a30['push'](_0x119a30['shift']());}}}(a144_0x467f,0x1e12a));import a144_0x2057d8 from'path';import{parse as a144_0x1f43bc}from'yaml';function a144_0x467f(){const _0x22e15b=['Relative\x20path\x20cannot\x20be\x20empty','tdx.json','root','Cannot\x20split\x20empty\x20path','split','readFile','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','isAbsolute','parent_segment','parse','.yml','457863ZOpCys','.yaml','1905981OegSyY','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','974kJuDyw','6EUZNYL','Path\x20attempts\x20to\x20navigate\x20above\x20root','segments','exists','endsWith','Cannot\x20navigate\x20above\x20root','relative','pop','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','237852CPpIxd','No\x20tdx.json\x20found\x20for\x20file:\x20','1916648VFrGoi','raw','File\x20not\x20found:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','replace','1214430GkJkSF','startsWith','resolve','477992bqLJre','slice','24lDbBHF','type','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','trim','18obvxIh','journey','dirname','5sTehqQ','push','length','Path\x20cannot\x20be\x20empty','filter','join','name','178MyHxLO'];a144_0x467f=function(){return _0x22e15b;};return a144_0x467f();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x393664){const _0x229c0f=a144_0x59ed;if(!_0x393664||_0x393664[_0x229c0f(0x10b)]()==='')throw new Error(_0x229c0f(0x112));const _0x4b0a1a=_0x393664[_0x229c0f(0x10b)]();if(_0x4b0a1a==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x393664};const _0x39c952=_0x4b0a1a[_0x229c0f(0x104)]('/')?_0x4b0a1a['substring'](0x1):_0x4b0a1a,_0xad23f3=_0x39c952[_0x229c0f(0x11b)]('/')[_0x229c0f(0x113)](_0x5e8aef=>_0x5e8aef!=='');if(_0xad23f3[_0x229c0f(0x111)]===0x0)throw new Error(_0x229c0f(0x11d));const _0x5977db=_0x4b0a1a[_0x229c0f(0x104)]('/')||!isRelativePathSegment(_0xad23f3[0x0]);for(const _0x78388b of _0xad23f3){validatePathSegment(_0x78388b);}return{'segments':_0xad23f3,'isAbsolute':_0x5977db,'raw':_0x393664};}function isRelativePathSegment(_0x59399c){return _0x59399c==='.'||_0x59399c==='..';}function validatePathSegment(_0x1748b9){const _0x215041=a144_0x59ed;if(_0x1748b9==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x1748b9==='.'||_0x1748b9==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x1748b9))throw new Error(_0x215041(0x101)+_0x1748b9);if(_0x1748b9!==_0x1748b9[_0x215041(0x10b)]()){}}export function validatePath(_0x1a6768){const _0x1ad8a1=a144_0x59ed;if(_0x1a6768[_0x1ad8a1(0x129)][_0x1ad8a1(0x111)]===0x0&&!_0x1a6768[_0x1ad8a1(0x11e)])throw new Error(_0x1ad8a1(0x117));if(_0x1a6768[_0x1ad8a1(0x11e)]){if(_0x1a6768[_0x1ad8a1(0x129)][0x0]==='..')throw new Error(_0x1ad8a1(0x125));let _0x3dd9a5=0x0;for(const _0xcf3596 of _0x1a6768[_0x1ad8a1(0x129)]){if(_0xcf3596==='..'){if(_0x3dd9a5===0x0)throw new Error(_0x1ad8a1(0x128));_0x3dd9a5--;}else _0xcf3596!=='.'&&_0x3dd9a5++;}}}export function joinPaths(_0x485345,_0x14ae14){const _0x5e96ab=a144_0x59ed;if(!_0x485345||_0x485345==='/')return _0x14ae14;if(!_0x14ae14||_0x14ae14==='.')return _0x485345;if(_0x14ae14[_0x5e96ab(0x104)]('/'))return _0x14ae14;const _0x3e4b98=parsePath(_0x485345),_0x30cbfa=parsePath(_0x14ae14),_0x1c5e0e=[..._0x3e4b98[_0x5e96ab(0x129)]];for(const _0x38167d of _0x30cbfa[_0x5e96ab(0x129)]){if(_0x38167d==='.')continue;else{if(_0x38167d==='..'){if(_0x1c5e0e[_0x5e96ab(0x111)]===0x0)throw new Error(_0x5e96ab(0x12c));_0x1c5e0e[_0x5e96ab(0x12e)]();}else _0x1c5e0e[_0x5e96ab(0x110)](_0x38167d);}}const _0xad84f7=_0x1c5e0e[_0x5e96ab(0x114)]('/');return _0x3e4b98[_0x5e96ab(0xff)][_0x5e96ab(0x104)]('/')?'/'+_0xad84f7:_0xad84f7;}export function normalizePath(_0x395972){const _0x35a266=a144_0x59ed,_0x10f5f5=parsePath(_0x395972),_0x554a56=[];for(const _0x3c909e of _0x10f5f5[_0x35a266(0x129)]){if(_0x3c909e==='.')continue;else{if(_0x3c909e==='..'){if(_0x554a56['length']===0x0){if(_0x10f5f5[_0x35a266(0x11e)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x554a56[_0x35a266(0x110)]('..');}else _0x554a56[_0x554a56[_0x35a266(0x111)]-0x1]==='..'?_0x554a56[_0x35a266(0x110)]('..'):_0x554a56[_0x35a266(0x12e)]();}else _0x554a56['push'](_0x3c909e);}}if(_0x554a56[_0x35a266(0x111)]===0x0)return _0x10f5f5[_0x35a266(0x11e)]?'/':'.';const _0x4dbd8b=_0x554a56[_0x35a266(0x114)]('/');return _0x10f5f5[_0x35a266(0xff)]['startsWith']('/')?'/'+_0x4dbd8b:_0x4dbd8b;}export function getParentPath(_0x2d6902){const _0x107a2d=a144_0x59ed,_0x544be7=parsePath(_0x2d6902);if(_0x544be7[_0x107a2d(0x129)]['length']<=0x1)return'/';const _0x84baf0=_0x544be7[_0x107a2d(0x129)]['slice'](0x0,-0x1)[_0x107a2d(0x114)]('/');return _0x544be7[_0x107a2d(0xff)][_0x107a2d(0x104)]('/')?'/'+_0x84baf0:_0x84baf0;}export function getBaseName(_0x34a200){const _0x5ea2f2=a144_0x59ed,_0x8f4665=parsePath(_0x34a200);return _0x8f4665['segments'][_0x8f4665[_0x5ea2f2(0x129)][_0x5ea2f2(0x111)]-0x1]||'';}export function isChildPath(_0x3669f1,_0x2c8c45){const _0x436868=a144_0x59ed,_0x5c2c2d=parsePath(_0x3669f1),_0x139684=parsePath(_0x2c8c45);if(_0x5c2c2d[_0x436868(0x129)][_0x436868(0x111)]<=_0x139684[_0x436868(0x129)]['length'])return![];for(let _0xc7771b=0x0;_0xc7771b<_0x139684[_0x436868(0x129)]['length'];_0xc7771b++){if(_0x5c2c2d[_0x436868(0x129)][_0xc7771b]!==_0x139684[_0x436868(0x129)][_0xc7771b])return![];}return!![];}export function splitPath(_0x4d2131){const _0x2101b6=a144_0x59ed,_0xf931a=parsePath(_0x4d2131);if(_0xf931a[_0x2101b6(0x129)][_0x2101b6(0x111)]===0x0)throw new Error(_0x2101b6(0x11a));if(_0xf931a[_0x2101b6(0x129)][_0x2101b6(0x111)]===0x1)return{'parent':_0xf931a[_0x2101b6(0x129)][0x0]};return{'parent':_0xf931a['segments'][0x0],'child':_0xf931a[_0x2101b6(0x129)][_0x2101b6(0x107)](0x1)[_0x2101b6(0x114)]('/')};}function a144_0x59ed(_0x324562,_0x525450){_0x324562=_0x324562-0xfe;const _0x467f2a=a144_0x467f();let _0x59ed38=_0x467f2a[_0x324562];return _0x59ed38;}export function isYamlFilePath(_0x492c0c){const _0x5c7a57=a144_0x59ed;return _0x492c0c[_0x5c7a57(0x12b)](_0x5c7a57(0x121))||_0x492c0c[_0x5c7a57(0x12b)](_0x5c7a57(0x123));}export async function resolveYamlFilePath(_0x18f609,_0x7728c3=nodeFileSystem){const _0x2db9c5=a144_0x59ed,_0x150f4e=a144_0x2057d8[_0x2db9c5(0x105)](_0x18f609);if(!await _0x7728c3['exists'](_0x150f4e))throw new Error(_0x2db9c5(0x100)+_0x18f609);let _0x5dbf87=a144_0x2057d8[_0x2db9c5(0x10e)](_0x150f4e),_0x337a03=null,_0x270fab=null;const _0x43fed7=a144_0x2057d8[_0x2db9c5(0x120)](_0x5dbf87)[_0x2db9c5(0x119)];while(_0x5dbf87!==_0x43fed7){const _0x5332b1=a144_0x2057d8[_0x2db9c5(0x114)](_0x5dbf87,_0x2db9c5(0x118));if(await _0x7728c3[_0x2db9c5(0x12a)](_0x5332b1)){_0x337a03=_0x5332b1,_0x270fab=_0x5dbf87;break;}_0x5dbf87=a144_0x2057d8[_0x2db9c5(0x10e)](_0x5dbf87);}if(!_0x337a03||!_0x270fab)throw new Error(_0x2db9c5(0x131)+_0x18f609+'\x0a'+_0x2db9c5(0x12f));const _0x40ff51=await _0x7728c3[_0x2db9c5(0x11c)](_0x337a03),_0x21343=JSON[_0x2db9c5(0x120)](_0x40ff51),_0x5a82f1=_0x21343[_0x2db9c5(0x11f)];if(!_0x5a82f1)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x3f15ad=await _0x7728c3[_0x2db9c5(0x11c)](_0x150f4e),_0x3d3587=a144_0x1f43bc(_0x3f15ad),_0x37f7f5=_0x3d3587[_0x2db9c5(0x115)];if(!_0x37f7f5)throw new Error(_0x2db9c5(0x10a)+_0x18f609);const _0x2178c4=_0x3d3587[_0x2db9c5(0x109)]===_0x2db9c5(0x10d)?_0x2db9c5(0x10d):'segment',_0x54d2d3=a144_0x2057d8[_0x2db9c5(0x12d)](_0x270fab,_0x150f4e),_0x4cf0c4=a144_0x2057d8['dirname'](_0x54d2d3),_0x299b08=_0x4cf0c4==='.'?'':_0x4cf0c4[_0x2db9c5(0x102)](/\\/g,'/'),_0x418d8c=_0x299b08?_0x5a82f1+'/'+_0x299b08+'/'+_0x37f7f5:_0x5a82f1+'/'+_0x37f7f5;return{'parentSegment':_0x5a82f1,'segmentName':_0x37f7f5,'folderPath':_0x299b08,'fullPath':_0x418d8c,'resourceType':_0x2178c4,'content':_0x3f15ad};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a145_0x435b(){const _0x5d0245=['802732iUUpJS','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','13411125DRGyde','1064070FKPSHU','1231521ZvYoar','indexOf','724182kUGWGM','Invalid\x20segment\x20reference\x20format:\x20','8zkRNwS','2490628QuTWMZ','85UbKxEF','.\x20Child\x20name\x20cannot\x20be\x20empty','119764CbUZNy'];a145_0x435b=function(){return _0x5d0245;};return a145_0x435b();}function a145_0x39f3(_0x479c38,_0x4e7eae){_0x479c38=_0x479c38-0x130;const _0x435b8e=a145_0x435b();let _0x39f3e2=_0x435b8e[_0x479c38];return _0x39f3e2;}(function(_0x2d44b9,_0x474356){const _0x43a8a2=a145_0x39f3,_0x25f79e=_0x2d44b9();while(!![]){try{const _0x4f017c=parseInt(_0x43a8a2(0x135))/0x1+parseInt(_0x43a8a2(0x13c))/0x2+parseInt(_0x43a8a2(0x133))/0x3+-parseInt(_0x43a8a2(0x13b))/0x4*(-parseInt(_0x43a8a2(0x139))/0x5)+parseInt(_0x43a8a2(0x132))/0x6+parseInt(_0x43a8a2(0x138))/0x7*(-parseInt(_0x43a8a2(0x137))/0x8)+-parseInt(_0x43a8a2(0x131))/0x9;if(_0x4f017c===_0x474356)break;else _0x25f79e['push'](_0x25f79e['shift']());}catch(_0x4e1fc5){_0x25f79e['push'](_0x25f79e['shift']());}}}(a145_0x435b,0x5be94));export function parseSegmentRef(_0x3befd8){const _0x16e0f7=a145_0x39f3,_0x379ebd=_0x3befd8[_0x16e0f7(0x134)]('/');if(_0x379ebd===-0x1)return{'parentId':_0x3befd8};if(_0x379ebd===0x0)throw new Error(_0x16e0f7(0x136)+_0x3befd8+_0x16e0f7(0x130));const _0x266bc1=_0x3befd8[_0x16e0f7(0x13d)](0x0,_0x379ebd),_0x1a8fd1=_0x3befd8[_0x16e0f7(0x13d)](_0x379ebd+0x1);if(_0x1a8fd1==='')throw new Error(_0x16e0f7(0x136)+_0x3befd8+_0x16e0f7(0x13a));return{'parentId':_0x266bc1,'childId':_0x1a8fd1};}
|