@treasuredata/tdx 2026.3.14 → 2026.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.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
|
-
(function(
|
|
1
|
+
(function(_0x55ffdb,_0xb63f1c){const _0x3267f0=a139_0x270e,_0x33e946=_0x55ffdb();while(!![]){try{const _0x532393=-parseInt(_0x3267f0(0x1ed))/0x1*(parseInt(_0x3267f0(0x1e8))/0x2)+-parseInt(_0x3267f0(0x1f7))/0x3+parseInt(_0x3267f0(0x1f0))/0x4+parseInt(_0x3267f0(0x1e4))/0x5+parseInt(_0x3267f0(0x1f8))/0x6+-parseInt(_0x3267f0(0x1e7))/0x7+parseInt(_0x3267f0(0x1f5))/0x8;if(_0x532393===_0xb63f1c)break;else _0x33e946['push'](_0x33e946['shift']());}catch(_0x147f87){_0x33e946['push'](_0x33e946['shift']());}}}(a139_0x21c2,0x7efb5));function a139_0x21c2(){const _0x5c1b8e=['toISOString','5609737OGQpAx','8pdPbvC','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','.tmp','utf-8','ENOENT','23431yxUrix','stringify','version','1072868SXYpjN','string','basename','warn','journeyName','5222120JBvQBa','debug','2175678foOmxx','1167690nzmSvi','join','.push-recovery.json','dirname','5124305iULtsp','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'];a139_0x21c2=function(){return _0x5c1b8e;};return a139_0x21c2();}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a139_0x3de3c9 from'path';function a139_0x270e(_0x2bddb8,_0x1645eb){_0x2bddb8=_0x2bddb8-0x1e4;const _0x21c280=a139_0x21c2();let _0x270e6e=_0x21c280[_0x2bddb8];return _0x270e6e;}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x1c071d){const _0x3b0825=a139_0x270e,_0x3cde6f=a139_0x3de3c9[_0x3b0825(0x1fb)](_0x1c071d),_0x21ae18=a139_0x3de3c9[_0x3b0825(0x1f2)](_0x1c071d);return a139_0x3de3c9[_0x3b0825(0x1f9)](_0x3cde6f,'.'+_0x21ae18+_0x3b0825(0x1fa));}export function readPushRecovery(_0x4854a3){const _0x3a6b73=a139_0x270e,_0x4dbdc0=getPushRecoveryPath(_0x4854a3);if(!existsSync(_0x4dbdc0))return undefined;try{const _0x2ed927=readFileSync(_0x4dbdc0,_0x3a6b73(0x1eb)),_0x33e74c=JSON['parse'](_0x2ed927);if(_0x33e74c?.[_0x3a6b73(0x1ef)]!==0x1||typeof _0x33e74c[_0x3a6b73(0x1f4)]!==_0x3a6b73(0x1f1))return undefined;return _0x33e74c;}catch(_0x477c6f){return _0x477c6f instanceof SyntaxError?logger[_0x3a6b73(0x1f6)](_0x3a6b73(0x1e9)+_0x477c6f):logger[_0x3a6b73(0x1f3)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x477c6f),undefined;}}export function writePushRecovery(_0x28dd5e,_0x3dfcab){const _0x5eb314=a139_0x270e,_0x258f2f=getPushRecoveryPath(_0x28dd5e),_0x5a6fc2=_0x258f2f+_0x5eb314(0x1ea);writeFileSync(_0x5a6fc2,JSON[_0x5eb314(0x1ee)](_0x3dfcab,null,0x2)+'\x0a',_0x5eb314(0x1eb)),renameSync(_0x5a6fc2,_0x258f2f);}export function deletePushRecovery(_0x3d0ddb){const _0x3d167f=a139_0x270e,_0x207757=getPushRecoveryPath(_0x3d0ddb);try{unlinkSync(_0x207757);}catch(_0x1b2cc7){_0x1b2cc7['code']!==_0x3d167f(0x1ec)&&logger[_0x3d167f(0x1f6)](_0x3d167f(0x1e5)+_0x1b2cc7);}}export function saveSegmentToPushRecovery(_0xd25763,_0xe3455e,_0x19d2a0,_0x4510c7){const _0x9173f9=a139_0x270e,_0x5f38a1=readPushRecovery(_0xd25763),_0x277f9a=_0x5f38a1?.[_0x9173f9(0x1f4)]===_0xe3455e?{..._0x5f38a1,'updatedAt':new Date()[_0x9173f9(0x1e6)]()}:{'version':0x1,'journeyName':_0xe3455e,'updatedAt':new Date()[_0x9173f9(0x1e6)](),'segments':{}};_0x277f9a['segments'][_0x19d2a0]=_0x4510c7,writePushRecovery(_0xd25763,_0x277f9a);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x164c64=a140_0x2294;(function(_0x2f05e8,_0x230f96){const _0x3c7f97=a140_0x2294,_0x47f860=_0x2f05e8();while(!![]){try{const _0x3b2160=-parseInt(_0x3c7f97(0x213))/0x1+-parseInt(_0x3c7f97(0x23a))/0x2*(parseInt(_0x3c7f97(0x2af))/0x3)+parseInt(_0x3c7f97(0x2a5))/0x4+parseInt(_0x3c7f97(0x20e))/0x5*(parseInt(_0x3c7f97(0x201))/0x6)+parseInt(_0x3c7f97(0x1c0))/0x7+parseInt(_0x3c7f97(0x2a9))/0x8*(-parseInt(_0x3c7f97(0x233))/0x9)+parseInt(_0x3c7f97(0x23e))/0xa*(parseInt(_0x3c7f97(0x21c))/0xb);if(_0x3b2160===_0x230f96)break;else _0x47f860['push'](_0x47f860['shift']());}catch(_0x29d798){_0x47f860['push'](_0x47f860['shift']());}}}(a140_0x1beb,0x47f8b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x164c64(0x29f));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a140_0x164c64(0x1cb);export function createPendingSegmentId(_0x22d490){return''+PENDING_SEGMENT_PREFIX+_0x22d490+'__';}export function isPendingSegmentId(_0x5ea5f5){const _0x5b408a=a140_0x164c64;return _0x5ea5f5[_0x5b408a(0x29d)](PENDING_SEGMENT_PREFIX)&&!_0x5ea5f5[_0x5b408a(0x29d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x48f6a1){const _0x2b8cd=a140_0x164c64;return _0x48f6a1[_0x2b8cd(0x297)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x548b67){return''+PENDING_ACTIVATION_PREFIX+_0x548b67+'__';}export function isPendingActivationId(_0x57d6b8){const _0x2ef091=a140_0x164c64;return _0x57d6b8[_0x2ef091(0x29d)](PENDING_ACTIVATION_PREFIX);}function a140_0x2294(_0x20d1c9,_0x3f358d){_0x20d1c9=_0x20d1c9-0x1bb;const _0x1beb94=a140_0x1beb();let _0x229455=_0x1beb94[_0x20d1c9];return _0x229455;}export function extractPendingActivationName(_0x19e13a){const _0x530b1c=a140_0x164c64;return _0x19e13a[_0x530b1c(0x297)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x4762ac,_0x4de5f4){const _0x142828=a140_0x164c64,_0x213439=_0x4762ac+'::'+(_0x4de5f4['trim']()||_0x142828(0x1be)),_0x5d790e=createHash(_0x142828(0x259))[_0x142828(0x248)](_0x213439)['digest'](_0x142828(0x243))[_0x142828(0x2ad)](0x0,0xc);return _0x142828(0x236)+_0x5d790e;}export function ensureJourneyDefaults(_0x29bb0a){const _0x252c0e=a140_0x164c64;!_0x29bb0a[_0x252c0e(0x272)]&&(_0x29bb0a['description']=''),!_0x29bb0a['state']&&(_0x29bb0a[_0x252c0e(0x1eb)]=_0x252c0e(0x255));}export function injectExistingStageIds(_0x4e5819,_0x583b8b){const _0x1d67f7=a140_0x164c64,_0x27f1a8=new Map(_0x583b8b[_0x1d67f7(0x207)](_0x21a08d=>[_0x21a08d['name'],_0x21a08d['id']]));for(const _0x4fc8c3 of _0x4e5819){if(!_0x4fc8c3['id']){const _0x58bbfb=_0x27f1a8[_0x1d67f7(0x24d)](_0x4fc8c3[_0x1d67f7(0x1c9)]);_0x58bbfb&&(_0x4fc8c3['id']=_0x58bbfb);}}}export function resolveTDFolderPath(_0x386d99,_0x57c35d,_0x31f6e7){const _0x1c7618=a140_0x164c64;if(!_0x57c35d)return _0x386d99;if(_0x386d99===_0x31f6e7||_0x386d99[_0x1c7618(0x29d)](_0x31f6e7+'/'))return _0x386d99;return _0x386d99?_0x31f6e7+'/'+_0x386d99:_0x31f6e7;}export function addFoldersToCreate(_0x414dc0,_0x55cdc8,_0x3c8d4e){const _0x51b20d=a140_0x164c64;if(!_0x414dc0)return;if(_0x55cdc8['has'](_0x414dc0))return;const _0x5062bd=_0x414dc0[_0x51b20d(0x285)]('/');let _0x44c649='';for(const _0x11bb8f of _0x5062bd){_0x44c649=_0x44c649?_0x44c649+'/'+_0x11bb8f:_0x11bb8f,!_0x55cdc8[_0x51b20d(0x253)](_0x44c649)&&_0x3c8d4e[_0x51b20d(0x2a4)](_0x44c649);}}export function sortFoldersByDepth(_0x5bac1a){const _0x1ac303=a140_0x164c64;return[..._0x5bac1a][_0x1ac303(0x273)]((_0x594b1e,_0x2eb9a0)=>{const _0x4ce2e8=_0x1ac303,_0x1ca18b=(_0x594b1e['match'](/\//g)||[])[_0x4ce2e8(0x1e6)],_0x13df22=(_0x2eb9a0[_0x4ce2e8(0x26d)](/\//g)||[])[_0x4ce2e8(0x1e6)];return _0x1ca18b-_0x13df22;});}import*as a140_0x5b7330 from'yaml';import{readFileSync}from'fs';import a140_0x3e131c from'path';import{isJourneyDef,parseYamlString as a140_0x138f6e,toYamlString as a140_0x48c97f,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(_0x30a2a7){const _0x480e2d=a140_0x164c64;if(Array[_0x480e2d(0x24b)](_0x30a2a7))return'['+_0x30a2a7[_0x480e2d(0x207)](_0x516827=>stableStringify(_0x516827))[_0x480e2d(0x1ea)](',')+']';if(_0x30a2a7&&typeof _0x30a2a7==='object'){const _0x5a7107=_0x30a2a7,_0x11528f=Object[_0x480e2d(0x238)](_0x5a7107)[_0x480e2d(0x273)](),_0x4e1036=_0x11528f[_0x480e2d(0x207)](_0x4806c5=>'\x22'+_0x4806c5+'\x22:'+stableStringify(_0x5a7107[_0x4806c5]));return'{'+_0x4e1036[_0x480e2d(0x1ea)](',')+'}';}const _0x187b62=JSON[_0x480e2d(0x27b)](_0x30a2a7);return _0x187b62===undefined?_0x480e2d(0x1c8):_0x187b62;}function activationSignature(_0x22c67c){const _0x3c92b9=a140_0x164c64,_0x2e93b6={'connection':_0x22c67c[_0x3c92b9(0x262)],..._0x22c67c['all_columns']!==undefined&&{'all_columns':_0x22c67c['all_columns']},..._0x22c67c['columns']!==undefined&&{'columns':_0x22c67c['columns']},..._0x22c67c[_0x3c92b9(0x295)]!==undefined&&{'behavior':_0x22c67c[_0x3c92b9(0x295)]},..._0x22c67c[_0x3c92b9(0x268)]!==undefined&&{'schedule':_0x22c67c[_0x3c92b9(0x268)]},..._0x22c67c[_0x3c92b9(0x1fb)]!==undefined&&{'notification':_0x22c67c['notification']},..._0x22c67c[_0x3c92b9(0x21e)]!==undefined&&{'connector_config':_0x22c67c[_0x3c92b9(0x21e)]},..._0x22c67c[_0x3c92b9(0x2b2)]!==undefined&&{'activation_template_id':_0x22c67c[_0x3c92b9(0x2b2)]}};return stableStringify(_0x2e93b6);}async function fetchSegment(_0x2b3e31,_0x27eae3,_0x2c5d81,_0x313c63){const _0x5866c1=a140_0x164c64,_0x492c8e=_0x313c63?.['find'](_0x296d31=>_0x296d31['id']===_0x2c5d81);if(_0x492c8e)return _0x492c8e;try{return await _0x2b3e31[_0x5866c1(0x1be)][_0x5866c1(0x24e)](_0x27eae3,_0x2c5d81);}catch(_0x2172cd){logger[_0x5866c1(0x249)](_0x5866c1(0x2b5)+_0x2c5d81+',\x20falling\x20back\x20to\x20getSegmentEntity:\x20'+_0x2172cd);try{return await _0x2b3e31[_0x5866c1(0x1be)][_0x5866c1(0x2a6)](_0x2c5d81);}catch(_0x4e944d){return logger[_0x5866c1(0x249)](_0x5866c1(0x27f)+_0x2c5d81+':\x20'+_0x4e944d),null;}}}function recoverSegmentIdsFromPushRecovery(_0x409d2a,_0x1d0b12,_0x4fe27b){const _0x5b36b3=a140_0x164c64,_0x13d4a2=readPushRecovery(_0x409d2a[_0x5b36b3(0x1bb)]);if(_0x13d4a2?.[_0x5b36b3(0x1db)]===_0x409d2a[_0x5b36b3(0x221)][_0x5b36b3(0x1c9)])for(const [_0x5d502a,_0x3ae036]of Object['entries'](_0x13d4a2['segments'])){const _0x17b267=generateDeterministicJourneySegmentName(_0x409d2a[_0x5b36b3(0x221)]['name'],_0x5d502a);_0x3ae036[_0x5b36b3(0x208)]===_0x17b267&&(_0x1d0b12[_0x5b36b3(0x1cc)](_0x5d502a,_0x3ae036['segmentId']),_0x4fe27b[_0x5b36b3(0x1cc)](_0x5d502a,_0x3ae036['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x132ba0,_0x2dc294,_0x492d92,_0x12a472){const _0x319b14=a140_0x164c64;let _0x469b10;try{_0x469b10=await _0x132ba0[_0x319b14(0x1be)]['createJourneySegment']({'name':_0x492d92[_0x319b14(0x2ae)],'description':_0x492d92[_0x319b14(0x272)],'journeyId':_0x492d92['journeyId'],'rule':_0x12a472(_0x492d92[_0x319b14(0x2aa)],!![]),'countPopulation':!![],'parentFolderId':_0x492d92[_0x319b14(0x2ab)],'audienceId':_0x492d92[_0x319b14(0x20b)]});}catch(_0x312fe4){const _0x260c4e=_0x312fe4 instanceof Error&&_0x312fe4[_0x319b14(0x240)]['includes'](_0x319b14(0x293));if(_0x260c4e){const _0x49b6ae=readPushRecovery(_0x2dc294[_0x319b14(0x1bb)]),_0x5f06c2=_0x49b6ae?.['journeyName']===_0x2dc294['yamlConfig'][_0x319b14(0x1c9)]?_0x49b6ae[_0x319b14(0x23d)][_0x492d92[_0x319b14(0x21f)]]:undefined;if(_0x5f06c2?.[_0x319b14(0x208)]===_0x492d92[_0x319b14(0x2ae)])await _0x132ba0['segment'][_0x319b14(0x261)](_0x492d92[_0x319b14(0x20b)],_0x5f06c2[_0x319b14(0x279)],{'description':_0x492d92['description'],'rule':_0x12a472(_0x492d92[_0x319b14(0x2aa)],!![]),'countPopulation':!![]}),_0x469b10=_0x5f06c2['segmentId'];else throw new SDKError(ErrorCode[_0x319b14(0x1d0)],_0x319b14(0x1d9)+_0x492d92['localName']+_0x319b14(0x25d)+(_0x319b14(0x265)+_0x2dc294[_0x319b14(0x1bb)][_0x319b14(0x297)](/([^/]+)$/,_0x319b14(0x2b7))+')\x20')+_0x319b14(0x2a0),_0x312fe4);}else throw _0x312fe4;}return saveSegmentToPushRecovery(_0x2dc294[_0x319b14(0x1bb)],_0x2dc294[_0x319b14(0x221)][_0x319b14(0x1c9)],_0x492d92[_0x319b14(0x21f)],{'segmentId':_0x469b10,'uniqueServerName':_0x492d92['uniqueSegmentName'],'createdAt':new Date()[_0x319b14(0x292)]()}),_0x469b10;}export async function prepareSegmentFiles(_0x272b99,_0x45e695,_0x11f11f,_0x32353e,_0x37cdb2){const _0x1558f0=a140_0x164c64,{activationDefToCreateRequest:_0x10d51a}=await import(_0x1558f0(0x294)),_0x5aebb3=[],_0x448995=new Set();for(const {yamlConfig:_0xc22779,folderPath:_0x73e54b,sourcePath:_0x236b0b}of _0x272b99){const _0x4f348c=resolveTDFolderPath(_0x73e54b,_0x32353e,_0x37cdb2),_0x4215f1=_0x4f348c+':'+_0xc22779['name'],_0x1cd09f=_0x45e695[_0x1558f0(0x1ff)][_0x1558f0(0x24d)](_0x4215f1),_0x36c6aa=_0x1cd09f?_0x45e695[_0x1558f0(0x22e)][_0x1558f0(0x24d)](_0x1cd09f['id'])||[]:[];addFoldersToCreate(_0x4f348c,_0x45e695[_0x1558f0(0x1f1)],_0x448995);const _0x245e80=calculateActivationActions(_0xc22779['activations']||[],_0x36c6aa,_0x45e695['idToEmailMap'],_0x45e695['connectionIdToNameMap']);for(const _0xcd043 of _0x245e80){(_0xcd043[_0x1558f0(0x25e)]===_0x1558f0(0x1f4)||_0xcd043[_0x1558f0(0x25e)]===_0x1558f0(0x248))&&_0xcd043['yamlActivation']&&(_0xcd043[_0x1558f0(0x28f)]=await _0x10d51a(_0xcd043[_0x1558f0(0x206)],_0x11f11f));}const _0x43fbe3=calculateSegmentDiff(_0xc22779,_0x1cd09f,_0x36c6aa,_0x45e695[_0x1558f0(0x2b8)],_0x45e695[_0x1558f0(0x20a)]);_0x5aebb3[_0x1558f0(0x1e1)]({'relativePath':_0xc22779[_0x1558f0(0x1c9)],'absolutePath':_0x236b0b,'yamlConfig':_0xc22779,'folderPath':_0x4f348c,'existingSegment':_0x1cd09f,'existingActivations':_0x36c6aa,'isNew':_0x43fbe3['isNew'],'hasChanges':_0x43fbe3[_0x1558f0(0x1cd)],'diff':_0x43fbe3[_0x1558f0(0x251)],'activationActions':_0x245e80});}return{'segmentFiles':_0x5aebb3,'foldersToCreate':_0x448995};}export async function prepareJourneyFiles(_0x12d10f,_0x50cc5b,_0x1102d2,_0x27d1d9){const _0x565e14=a140_0x164c64,_0x42851b=[],_0x19350f=new Set();for(const {yamlConfig:_0x326e7d,folderPath:_0xb5b753,sourcePath:_0x1d5476}of _0x12d10f){const _0xcdb257=resolveTDFolderPath(_0xb5b753,_0x1102d2,_0x27d1d9),_0x3adc34=_0xcdb257+':'+_0x326e7d['name'],_0x2f99a8=_0x50cc5b[_0x565e14(0x2a8)]['get'](_0x3adc34);let _0x1a44c5,_0x2bcd7c;if(_0x2f99a8&&_0x2f99a8[_0x565e14(0x1e6)]>0x0){const _0x18b21c=buildLocalExpandedRuleMappings(_0x326e7d),{createYamlContext:_0x29a71c,prefetchJourneySegments:_0x386990}=createPushYamlContextForBundle(_0x50cc5b[_0x565e14(0x267)],_0x50cc5b['parentId'],_0x50cc5b['existingSegments'],_0x18b21c,_0x50cc5b[_0x565e14(0x2b8)],_0x50cc5b[_0x565e14(0x20a)],_0x50cc5b[_0x565e14(0x252)],_0x50cc5b['journeyById']);await _0x386990(_0x2f99a8[_0x565e14(0x207)](_0x4ebf5a=>_0x4ebf5a['id']));const _0x15372e=await _0x50cc5b[_0x565e14(0x267)]['journey'][_0x565e14(0x234)](_0x2f99a8[0x0][_0x565e14(0x269)]),_0x19b8e3=hasMultipleVersions(_0x326e7d),_0x10be58=async _0x24afd8=>{const _0xadf8f8=_0x565e14,_0x2031b0=_0x50cc5b[_0xadf8f8(0x2a7)]?.[_0xadf8f8(0x24d)](_0x24afd8);if(_0x2031b0)return _0x2031b0;return _0x50cc5b[_0xadf8f8(0x2c0)]({'journeyId':_0x24afd8,'journeyName':_0x326e7d[_0xadf8f8(0x1c9)],'isMultiVersion':_0x2f99a8[_0xadf8f8(0x1e6)]>0x1});};if(_0x19b8e3&&_0x2f99a8['length']>0x1){const _0x2f284a=[];for(const _0x29cd58 of _0x2f99a8){const _0x14a673=_0x29cd58[_0x565e14(0x2c2)]||0x1;_0x50cc5b[_0x565e14(0x250)]?.['update'](_0x565e14(0x276)+_0x326e7d['name']+'\x20v'+_0x14a673);const _0x430e8f=await _0x10be58(_0x29cd58['id']),_0x16f4bc=_0x29a71c(_0x29cd58['id']),_0x1b936d=await journeyResponseToDef(_0x430e8f,_0x16f4bc);_0x2f284a[_0x565e14(0x1e1)]({'item':_0x29cd58,'yaml':_0x1b936d});}const _0x2f0220=buildLocalRuleToNameMappingFromJourney(_0x326e7d);_0x2bcd7c=buildMergedJourneyDef(_0x2f284a,_0x2f0220,_0x15372e);const _0x5d063e=Math[_0x565e14(0x2c1)](..._0x2f284a[_0x565e14(0x207)](_0x31456c=>_0x31456c['item'][_0x565e14(0x2c2)]||0x0)),_0x19adea=_0x2f99a8[_0x565e14(0x271)](_0x1cdacf=>(_0x1cdacf[_0x565e14(0x2c2)]||0x0)===_0x5d063e);_0x19adea&&(_0x50cc5b[_0x565e14(0x250)]?.[_0x565e14(0x248)](_0x565e14(0x276)+_0x326e7d[_0x565e14(0x1c9)]+'\x20v'+_0x5d063e),_0x1a44c5=await _0x10be58(_0x19adea['id']));}else{const _0x1c1370=_0x2f99a8[_0x2f99a8[_0x565e14(0x1e6)]-0x1];_0x50cc5b[_0x565e14(0x250)]?.[_0x565e14(0x248)](_0x565e14(0x276)+_0x326e7d['name']),_0x1a44c5=await _0x10be58(_0x1c1370['id']);const _0x4125b1=_0x29a71c(_0x1c1370['id']),_0x5b7c6c=await journeyResponseToDef(_0x1a44c5,_0x4125b1),_0x4f03c1=buildLocalRuleToNameMappingFromJourney(_0x326e7d);_0x2bcd7c=buildMergedJourneyDef([{'item':_0x1c1370,'yaml':_0x5b7c6c}],_0x4f03c1,_0x15372e);}}addFoldersToCreate(_0xcdb257,_0x50cc5b['folderPathToId'],_0x19350f);const _0x454852=calculateJourneyDiff(_0x326e7d,_0x2bcd7c);_0x42851b['push']({'relativePath':_0x326e7d[_0x565e14(0x1c9)],'absolutePath':_0x1d5476,'yamlConfig':_0x326e7d,'folderPath':_0xcdb257,'existingJourney':_0x1a44c5,'isNew':_0x454852[_0x565e14(0x1da)],'hasChanges':_0x454852[_0x565e14(0x1cd)],'diff':_0x454852[_0x565e14(0x251)]});}return{'journeyFiles':_0x42851b,'foldersToCreate':_0x19350f};}export function calculateActivationActions(_0x13ee90,_0x40f06f,_0x12e8e0,_0x51e9c0){const _0x7b5d86=a140_0x164c64,_0x1a7ff2=[],_0x3f02e6=new Map();for(const _0x1e62fb of _0x40f06f){_0x3f02e6[_0x7b5d86(0x1cc)](_0x1e62fb['name'],_0x1e62fb);}const _0x4fc3d6=new Map();for(const _0x3b2e56 of _0x13ee90){_0x4fc3d6['set'](_0x3b2e56['name'],_0x3b2e56);}for(const _0x129192 of _0x13ee90){const _0xb844d3=_0x3f02e6['get'](_0x129192[_0x7b5d86(0x1c9)]);if(!_0xb844d3)_0x1a7ff2[_0x7b5d86(0x1e1)]({'type':_0x7b5d86(0x1f4),'name':_0x129192[_0x7b5d86(0x1c9)],'yamlActivation':_0x129192});else{const _0x260efa=activationResponseToDef(_0xb844d3,_0x12e8e0,_0x51e9c0),_0x5947dc=a140_0x5b7330[_0x7b5d86(0x27b)](_0x260efa),_0x42d63c=a140_0x5b7330['stringify'](_0x129192);_0x5947dc!==_0x42d63c&&_0x1a7ff2[_0x7b5d86(0x1e1)]({'type':_0x7b5d86(0x248),'name':_0x129192[_0x7b5d86(0x1c9)],'yamlActivation':_0x129192,'existingActivation':_0xb844d3});}}for(const _0x5767a0 of _0x40f06f){!_0x4fc3d6['has'](_0x5767a0[_0x7b5d86(0x1c9)])&&_0x1a7ff2[_0x7b5d86(0x1e1)]({'type':_0x7b5d86(0x1f2),'name':_0x5767a0[_0x7b5d86(0x1c9)],'existingActivation':_0x5767a0});}return _0x1a7ff2;}function calculateYamlDiff(_0x4c6ce0,_0x45f3db){if(_0x45f3db){const _0x5a7068=generateDiff(_0x45f3db,_0x4c6ce0),_0x39f9f2=hasChanges(_0x5a7068);return{'isNew':![],'hasChanges':_0x39f9f2,'diff':_0x39f9f2?formatDiffWithColors(_0x5a7068):undefined};}const _0x227abc=generateDiff('',_0x4c6ce0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x227abc)};}export function calculateSegmentDiff(_0x1efd42,_0x5cb51a,_0x241e88,_0x280202,_0x2b6292){const _0x2eb10f=segmentToYamlString(_0x1efd42),_0x5508cc=_0x5cb51a?segmentToYamlString(segmentWithActivationsToYaml(_0x5cb51a,_0x241e88,undefined,_0x280202,_0x2b6292)):undefined;return calculateYamlDiff(_0x2eb10f,_0x5508cc);}export function calculateJourneyDiff(_0x250ac8,_0x52dbaa){const _0x664a91=normalizeJourneyDef(_0x250ac8,_0x250ac8),_0x184066=a140_0x48c97f(_0x664a91),_0x31b81d=_0x52dbaa?a140_0x48c97f(normalizeJourneyDef(_0x52dbaa,_0x250ac8)):undefined;return calculateYamlDiff(_0x184066,_0x31b81d);}export function findSegmentsToDelete(_0x3d5414,_0x2eea7b,_0x4e4a48,_0x4a29f3,_0x126980){const _0x26b1f4=a140_0x164c64,_0x39e94e=new Set();for(const {yamlConfig:_0x173f06,folderPath:_0x2a28b5}of _0x2eea7b){_0x39e94e['add'](_0x2a28b5+':'+_0x173f06['name']);}return _0x3d5414[_0x26b1f4(0x204)](_0x2f2eea=>{const _0x360e9b=_0x26b1f4,_0x2ada8e=_0x2f2eea[_0x360e9b(0x1de)]?_0x4e4a48['get'](_0x2f2eea[_0x360e9b(0x1de)][_0x360e9b(0x1c4)]())||'':'',_0x176428=_0x2ada8e+':'+_0x2f2eea['name'];if(_0x39e94e[_0x360e9b(0x253)](_0x176428))return![];if(_0x126980)return _0x2ada8e===_0x4a29f3||_0x2ada8e[_0x360e9b(0x29d)](_0x4a29f3+'/');return!![];});}export function findJourneysToDelete(_0x53bddc,_0x855a81,_0xf5610f,_0x2dcb64,_0x212a6f){const _0xd1ec55=a140_0x164c64,_0x18a435=new Set();for(const {yamlConfig:_0x3ef29b,folderPath:_0x3a8904}of _0x855a81){_0x18a435[_0xd1ec55(0x2a4)](_0x3a8904+':'+_0x3ef29b[_0xd1ec55(0x1c9)]);}return _0x53bddc['filter'](_0x125517=>{const _0x34da35=_0xd1ec55,_0x39f060=_0x125517[_0x34da35(0x2ab)]?_0xf5610f['get'](_0x125517[_0x34da35(0x2ab)])||'':'',_0x4211b9=_0x39f060+':'+_0x125517[_0x34da35(0x225)];if(_0x18a435[_0x34da35(0x253)](_0x4211b9))return![];if(_0x212a6f)return _0x39f060===_0x2dcb64||_0x39f060['startsWith'](_0x2dcb64+'/');return!![];});}export function buildSegmentLookupMap(_0x228db6,_0x13d161){const _0x5b960f=a140_0x164c64,_0x139e17=new Map();for(const _0x5b3ed0 of _0x228db6){const _0x402ecb=_0x5b3ed0['segmentFolderId']?_0x13d161['get'](_0x5b3ed0[_0x5b960f(0x1de)]['toString']())||'':'',_0x52c5aa=_0x402ecb+':'+_0x5b3ed0[_0x5b960f(0x1c9)];_0x139e17[_0x5b960f(0x1cc)](_0x52c5aa,_0x5b3ed0);}return _0x139e17;}export function buildSegmentNameToIdMap(_0x2f89d4){const _0x29cc6d=a140_0x164c64,_0x1a25ad=new Map();for(const _0x4ff230 of _0x2f89d4){_0x1a25ad[_0x29cc6d(0x1cc)](_0x4ff230[_0x29cc6d(0x1c9)],_0x4ff230['id']);}return _0x1a25ad;}export function buildJourneyBundleLookupMap(_0x41e4a1,_0x49094f){const _0x407541=a140_0x164c64,_0x244721=new Map();for(const _0x56bed5 of _0x41e4a1){const _0x2bb0a2=_0x56bed5['folderId']?_0x49094f[_0x407541(0x24d)](_0x56bed5[_0x407541(0x2ab)])||'':'',_0x207cc4=_0x2bb0a2+':'+_0x56bed5[_0x407541(0x225)];!_0x244721[_0x407541(0x253)](_0x207cc4)&&_0x244721[_0x407541(0x1cc)](_0x207cc4,[]),_0x244721[_0x407541(0x24d)](_0x207cc4)[_0x407541(0x1e1)](_0x56bed5);}for(const _0x1e66f4 of _0x244721[_0x407541(0x1d6)]()){_0x1e66f4[_0x407541(0x273)]((_0x26033f,_0x1e1eec)=>(_0x26033f[_0x407541(0x2c2)]||0x0)-(_0x1e1eec[_0x407541(0x2c2)]||0x0));}return _0x244721;}function a140_0x1beb(){const _0x5f5296=['entry_criteria','isArray','withProgress','get','getSegment','entryCriteria','progress','diff','activationStepsById','has','data','draft','Segment\x20not\x20found','goal','effectiveFolderId','sha1','Updated\x20activation\x20\x27','createdSegmentId','resolveJourneyId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','type','existingActivation','activation_updating','updateSegmentById','connection','journey_updating','Stage\x20\x27','Delete\x20the\x20push\x20recovery\x20file\x20(','segment_created','deps','schedule','journeyBundleId','\x20error(s)','steps','Failed\x20to\x20resolve\x20segment\x20','match','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','journeyActivationNameToId','conditionTimeoutUnit','find','description','sort','logDeleted','Failed\x20to\x20','Fetching\x20','folder','logInfo','segmentId','Creating\x20activation\x20\x27','stringify','):\x20','embedded_activation_creating','activation_creating','getSegmentEntity\x20also\x20failed\x20for\x20','\x27\x20wait\x20condition','activation_','\x27\x20from\x20file:\x20','JOURNEY_SYNTAX_ERROR','results','split','relationships','toLowerCase','valid','segment_deleting','dirname','\x20segment\x20from\x20file:\x20','stage\x20\x27','createActivation','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','validatedRequest','deleted','all','toISOString','Name\x20has\x20already\x20been\x20taken','./child-segment-yaml.js','behavior','deleteActivation','replace','\x27\x20exit\x20criteria','deleteSegment','journeyActivationStepId','\x27\x20entry\x20criteria','SEGMENT_SYNTAX_ERROR','startsWith','activations','tdx.sdk.push-workflow','and\x20the\x20server\x20segment,\x20then\x20retry.','with','run_after_journey_refresh','folder_creating','add','1470240mHFjtu','getSegmentEntity','journeyById','journeyBundlesByFolderAndName','5208AJSxwZ','resolvedRule','folderId','Updated\x20segment\x20\x27','slice','uniqueSegmentName','6987qltsTP','logSuccess','existingJourney','activation_template_id','getJourney','Updated\x20journey\x20\x27','getSegment\x20failed\x20for\x20','branches','.$1.push-recovery.json','idToEmailMap','conditionTimeoutDuration','activationParams','rootFolderId','activationContext','skipSegments','folder_created','day','fetchJourney','max','versionNumber','Deleting\x20activation\x20\x27','absolutePath','embedded_activation_created','Created\x20segment\x20\x27','segment','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','2854019kDSpmQ','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','journey','toString','Deleted\x20activation\x20\x27','milestone','\x20journey\x20from\x20file:\x20','null','name','Updating\x20activation\x20\x27','__pending_act_','set','hasChanges','entry','parentSegmentFolder','SEGMENT_UPDATE_ERROR','idToName','onProgress','WaitStep','segmentNameToId','some','values','INTERNAL','NOT_FOUND','Embedded\x20segment\x20\x27','isNew','journeyName','waitStep','relative','segmentFolderId','ACTIVATION_UPDATE_ERROR','journey_creating','push','list','\x27\x20by\x20rule\x20content','exitCriterias','verbose','length','\x20activation\x20\x27','./journey-yaml.js','attributes','join','state','listActivations','index','Segment\x20not\x20found:\x20','buildUserMaps','waitStepType','folderPathToId','delete','segment_updating','create','updated','journeyId','reduce','embedded_segment_creating','conditions','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','notification','action','Matched\x20server\x20segment\x20\x27','activation_created','segmentByFolderAndName','segment_deleted','114wIBlVP','conditionSegmentId','Creating\x20segment\x20\x27','filter','journeys','yamlActivation','map','uniqueServerName','\x0a\x20\x20','connectionIdToNameMap','parentId','parse','\x27...','89230zRYrBt','resolveSegment','rule','\x20(referenced\x20in\x20journey\x20','getActivation','374996AfGpqm','entries','parseDocument','from','../../utils/async.js','Condition','\x27\x20for\x20','existingSegment','\x27\x20decision\x20point\x20branch\x20\x27','2471392vHbsZb','DecisionPoint','connector_config','localName','segment_creating','yamlConfig','stages','Entry\x20criteria:\x20','goal\x20criteria','journeyBundleName','Activation\x20not\x20found:\x20','waitStepUnit','SEGMENT_NOT_FOUND','\x27\x20to\x20local\x20\x27','decision_point','Activation','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','embeddedSegmentNameToId','activationsBySegmentId','Journey\x20\x27','embedded_segment_created','size','unchanged','3231QqrqFB','getLatestJourneyId','Failed\x20to\x20resolve\x20activation\x20','journey_entry_criteria_','nameToId','keys','folderPath','374FqXaRk','created','journey_updated','segments','10gdRhCt','existingSegments','message','Duration','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','hex','utf-8','nameToType','errors','journeyStages','update','debug'];a140_0x1beb=function(){return _0x5f5296;};return a140_0x1beb();}export function collectFoldersToCreate(_0x244251,_0x35bc99){const _0x4e013b=a140_0x164c64,_0x22b0a8=new Set();for(const _0x21b5e6 of _0x244251){if(!_0x21b5e6)continue;if(_0x35bc99[_0x4e013b(0x253)](_0x21b5e6))continue;const _0x1c38e3=_0x21b5e6[_0x4e013b(0x285)]('/');let _0x13d9ed='';for(const _0x27ff82 of _0x1c38e3){_0x13d9ed=_0x13d9ed?_0x13d9ed+'/'+_0x27ff82:_0x27ff82,!_0x35bc99[_0x4e013b(0x253)](_0x13d9ed)&&_0x22b0a8[_0x4e013b(0x2a4)](_0x13d9ed);}}return _0x22b0a8;}export function parseAndClassifyYamlFiles(_0x473e0e,_0x17ae47,_0x2d2eaa){const _0x9665d4=a140_0x164c64,_0x3c18c2=[],_0x1735a6=[];for(const _0x2cb45c of _0x473e0e){const _0x39b99d=a140_0x3e131c[_0x9665d4(0x1dd)](_0x17ae47,a140_0x3e131c[_0x9665d4(0x28a)](_0x2cb45c)),_0x8ea561=_0x39b99d==='.'?'':_0x39b99d,_0xa2c3c=readFileSync(_0x2cb45c,_0x9665d4(0x244)),_0x302bcf=a140_0x5b7330[_0x9665d4(0x20c)](_0xa2c3c);if(isJourneyDef(_0x302bcf)){const _0x287d29=a140_0x138f6e(_0xa2c3c);_0x1735a6[_0x9665d4(0x1e1)]({'yamlConfig':_0x287d29,'folderPath':_0x8ea561,'sourcePath':_0x2cb45c});}else{if(!_0x2d2eaa?.[_0x9665d4(0x2bd)]){const _0x318b34=parseSegmentYamlFile(_0xa2c3c),_0x29d7bb=normalizeChildSegmentYaml(_0x318b34);_0x3c18c2[_0x9665d4(0x1e1)]({'yamlConfig':_0x29d7bb,'folderPath':_0x8ea561,'sourcePath':_0x2cb45c});}}}return{'segments':_0x3c18c2,'journeys':_0x1735a6};}export function validateParsedFiles(_0x566716,_0x3fb5f3){const _0x33711c=a140_0x164c64,_0x2d60d0=[];for(const {yamlConfig:_0x5e1595,sourcePath:_0xa739b}of _0x566716[_0x33711c(0x23d)]){const _0x116cbf=readFileSync(_0xa739b,_0x33711c(0x244)),_0xaf75c9=a140_0x5b7330['parseDocument'](_0x116cbf),_0x2d9967=validateSegmentDef(_0x5e1595,{'source':_0x116cbf,'document':_0xaf75c9},{'skipSchema':!![]});if(!_0x2d9967[_0x33711c(0x288)]){const _0xbcefe=a140_0x3e131c['relative'](_0x3fb5f3,_0xa739b);_0x2d60d0['push']({'filePath':_0xbcefe,'source':_0x116cbf,'result':_0x2d9967,'isJourney':![]});}}for(const {yamlConfig:_0x5c43b6,sourcePath:_0x179128}of _0x566716[_0x33711c(0x205)]){const _0x3b3506=readFileSync(_0x179128,_0x33711c(0x244)),_0x34af8d=a140_0x5b7330[_0x33711c(0x215)](_0x3b3506),_0x2d4d73=validateJourneyDef(_0x5c43b6,{'source':_0x3b3506,'document':_0x34af8d},{'skipSchema':!![]});if(!_0x2d4d73[_0x33711c(0x288)]){const _0x1447e5=a140_0x3e131c[_0x33711c(0x1dd)](_0x3fb5f3,_0x179128);_0x2d60d0[_0x33711c(0x1e1)]({'filePath':_0x1447e5,'source':_0x3b3506,'result':_0x2d4d73,'isJourney':!![]});}}return _0x2d60d0;}export function formatValidationErrors(_0x460025){const _0x19d118=a140_0x164c64,_0x31a508=[];for(const {filePath:_0x368fd0,source:_0x37f8a1,result:_0x17e1f8,isJourney:_0x5b471f}of _0x460025){const _0x474cca=_0x5b471f?_0x19d118(0x1c3):_0x19d118(0x1be);_0x31a508[_0x19d118(0x1e1)]('\x0a'+_0x368fd0+'\x20('+_0x474cca+_0x19d118(0x27c)+_0x17e1f8[_0x19d118(0x246)][_0x19d118(0x1e6)]+_0x19d118(0x26a)),_0x31a508[_0x19d118(0x1e1)](formatValidationResult(_0x17e1f8,_0x37f8a1,_0x368fd0));}return _0x31a508[_0x19d118(0x1ea)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x120cb4){const _0x1219bb=a140_0x164c64,_0x469c7b=new Set(),_0x976852=new Map(),_0x38e945=collectSegmentUsageCounts(_0x120cb4);if(_0x120cb4[_0x1219bb(0x23d)])for(const [_0x4634ef,_0x5f5d24]of Object[_0x1219bb(0x214)](_0x120cb4['segments'])){_0x469c7b[_0x1219bb(0x2a4)](_0x4634ef);if(_0x5f5d24[_0x1219bb(0x210)]){const _0x35a169=yamlRuleToApi(_0x5f5d24[_0x1219bb(0x210)]),_0x2cc2f2=apiRuleToYaml(_0x35a169);_0x976852[_0x1219bb(0x1cc)](_0x4634ef,_0x2cc2f2);}}const _0x36eb60=new Map();let _0x4936e6=0x0;for(const [_0x7585f3,_0x53e40a]of _0x976852){const _0x5b44b0=serializeExpandedRule(_0x53e40a,_0x976852),_0x3b6d74=_0x36eb60[_0x1219bb(0x24d)](_0x5b44b0)||[];_0x3b6d74['push']({'name':_0x7585f3,'index':_0x4936e6}),_0x36eb60[_0x1219bb(0x1cc)](_0x5b44b0,_0x3b6d74),_0x4936e6++;}const _0x4bb234=new Map();for(const [_0x5093f3,_0x590405]of _0x36eb60){const _0x6d365c=_0x590405[_0x1219bb(0x2ad)]()[_0x1219bb(0x273)]((_0x37d8de,_0x48a3ca)=>{const _0x226d9f=_0x1219bb,_0x12cdfc=_0x38e945['get'](_0x37d8de[_0x226d9f(0x1c9)])||0x0,_0x47be63=_0x38e945[_0x226d9f(0x24d)](_0x48a3ca[_0x226d9f(0x1c9)])||0x0;if(_0x12cdfc!==_0x47be63)return _0x47be63-_0x12cdfc;return _0x37d8de[_0x226d9f(0x1ed)]-_0x48a3ca['index'];})[_0x1219bb(0x207)](_0x1360be=>_0x1360be[_0x1219bb(0x1c9)]),_0x55313d=[];for(const _0x4546d5 of _0x6d365c){const _0x2e6ac6=_0x38e945['get'](_0x4546d5)||0x0,_0x12e72a=Math['max'](_0x2e6ac6,0x1);for(let _0x4322f1=0x0;_0x4322f1<_0x12e72a;_0x4322f1++){_0x55313d['push'](_0x4546d5);}}_0x4bb234['set'](_0x5093f3,_0x55313d);}return{'existingLocalSegmentNames':_0x469c7b,'localSegmentRules':_0x976852,'localExpandedRuleToNames':_0x4bb234};}export function createSegmentIdResolver(_0x4ff3f0,_0x4fec22){return async _0x17d7ec=>{const _0x27e8cd=a140_0x2294,_0x58016a=_0x4ff3f0['get'](_0x17d7ec);if(!_0x58016a)throw new SDKError(ErrorCode[_0x27e8cd(0x228)],_0x27e8cd(0x1ee)+_0x17d7ec+_0x27e8cd(0x1fa)+_0x4fec22+'\x27)');return _0x58016a;};}export function extractRootFolderId(_0x5cbec2){const _0x5dc993=a140_0x164c64;return _0x5cbec2[_0x5dc993(0x286)]?.[_0x5dc993(0x1cf)]?.[_0x5dc993(0x254)]?.['id']||_0x5cbec2[_0x5dc993(0x286)]?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x16caaf){const _0xca33ba=a140_0x164c64,_0x56d7ff=new Map(),_0x5b580a=new Map(),_0x41eb9b=new Map();for(const _0x15d0b2 of _0x16caaf){_0x56d7ff[_0xca33ba(0x1cc)](_0x15d0b2[_0xca33ba(0x1c9)],parseInt(_0x15d0b2['id'],0xa)),_0x5b580a[_0xca33ba(0x1cc)](_0x15d0b2['id'],_0x15d0b2[_0xca33ba(0x1c9)]),_0x41eb9b[_0xca33ba(0x1cc)](_0x15d0b2[_0xca33ba(0x1c9)],_0x15d0b2['type']);}return{'nameToId':_0x56d7ff,'idToName':_0x5b580a,'nameToType':_0x41eb9b};}export function calculatePushStats(_0x4686d7,_0xe05afc,_0x212c62,_0x4b229c,_0x5bde1f,_0x57935f,_0x889b86){const _0x64881f=a140_0x164c64,_0x58b2ba=_0x4686d7[_0x64881f(0x204)](_0x325718=>_0x325718[_0x64881f(0x1da)]),_0x2c6338=_0x4686d7[_0x64881f(0x204)](_0x35af95=>!_0x35af95['isNew']&&_0x35af95[_0x64881f(0x1cd)]),_0x52120d=_0x4686d7[_0x64881f(0x204)](_0x376a81=>!_0x376a81[_0x64881f(0x1da)]&&!_0x376a81[_0x64881f(0x1cd)]),_0x4f1bdf=_0x57935f?_0x4b229c:[],_0x103375=_0xe05afc[_0x64881f(0x204)](_0x597c73=>_0x597c73[_0x64881f(0x1da)]),_0x26672e=_0xe05afc[_0x64881f(0x204)](_0x2f615d=>!_0x2f615d[_0x64881f(0x1da)]&&_0x2f615d[_0x64881f(0x1cd)]),_0x2f71ac=_0xe05afc[_0x64881f(0x204)](_0x31b7d8=>!_0x31b7d8['isNew']&&!_0x31b7d8[_0x64881f(0x1cd)]),_0x3e2a88=_0x57935f?_0x5bde1f:[],_0x496938=_0x4686d7['flatMap'](_0x59ef42=>_0x59ef42['activationActions']),_0x4e6005=_0x496938['filter'](_0x122d1e=>_0x122d1e[_0x64881f(0x25e)]===_0x64881f(0x1f4)),_0x4ed051=_0x496938[_0x64881f(0x204)](_0x5735ba=>_0x5735ba[_0x64881f(0x25e)]===_0x64881f(0x248)),_0x2c1c4b=_0x496938[_0x64881f(0x204)](_0x4b060b=>_0x4b060b[_0x64881f(0x25e)]===_0x64881f(0x1f2)),_0x230d24=Array['from'](_0x212c62)[_0x64881f(0x273)](),_0x4f6f0d=_0x889b86?![]:_0x58b2ba['length']>0x0||_0x2c6338[_0x64881f(0x1e6)]>0x0||_0x4f1bdf[_0x64881f(0x1e6)]>0x0,_0x43e074=_0x103375[_0x64881f(0x1e6)]>0x0||_0x26672e['length']>0x0||_0x3e2a88[_0x64881f(0x1e6)]>0x0,_0x4b7559=_0x889b86?![]:_0x496938[_0x64881f(0x1e6)]>0x0,_0x300db2=_0x230d24[_0x64881f(0x1e6)]>0x0;return{'segments':{'new':_0x58b2ba,'changed':_0x2c6338,'unchanged':_0x52120d,'toDelete':_0x4f1bdf},'journeys':{'new':_0x103375,'changed':_0x26672e,'unchanged':_0x2f71ac,'toDelete':_0x3e2a88},'activations':{'all':_0x496938,'toCreate':_0x4e6005,'toUpdate':_0x4ed051,'toDelete':_0x2c1c4b},'folders':{'toCreate':_0x230d24},'counts':{'segments':{'new':_0x58b2ba[_0x64881f(0x1e6)],'changed':_0x2c6338[_0x64881f(0x1e6)],'unchanged':_0x52120d['length'],'toDelete':_0x4f1bdf[_0x64881f(0x1e6)]},'journeys':{'new':_0x103375[_0x64881f(0x1e6)],'changed':_0x26672e[_0x64881f(0x1e6)],'unchanged':_0x2f71ac['length'],'toDelete':_0x3e2a88[_0x64881f(0x1e6)]},'activations':{'create':_0x4e6005['length'],'update':_0x4ed051[_0x64881f(0x1e6)],'delete':_0x2c1c4b[_0x64881f(0x1e6)]},'folders':_0x230d24['length']},'hasChanges':_0x4f6f0d||_0x43e074||_0x4b7559||_0x300db2};}export async function buildPushExecutionContext(_0x39f084,_0x2cbe96,_0x27d135,_0x4c1d9f,_0x5c96d5,_0x33b686){const _0x2c8c14=a140_0x164c64,_0x5aa0fe=extractRootFolderId(_0x27d135),{pathToId:_0x428628,idToPath:_0x1dec46}=buildFolderMaps(_0x5c96d5),_0x4f4170=buildSegmentNameToIdMap(_0x4c1d9f),_0x5e108d=new Map(),{batchAsync:_0x3e7199}=await import(_0x2c8c14(0x217)),[_0x5d3642,_0xa1b303]=await Promise[_0x2c8c14(0x291)]([_0x39f084['user'][_0x2c8c14(0x1ef)](),_0x39f084['connection'][_0x2c8c14(0x1e2)](),((async()=>{!_0x33b686&&_0x4c1d9f['length']>0x0&&await _0x3e7199(_0x4c1d9f,async _0x4d0b77=>{const _0x1a4f68=a140_0x2294,_0x27ef1e=await _0x39f084[_0x1a4f68(0x1be)][_0x1a4f68(0x1ec)](_0x2cbe96,_0x4d0b77['id']);_0x5e108d['set'](_0x4d0b77['id'],_0x27ef1e);});})())]),{emailToId:_0x4c2e32,idToEmail:_0x68d7b6}=_0x5d3642,_0x159877=buildConnectionMaps(_0xa1b303);return{'rootFolderId':_0x5aa0fe,'folderPathToId':_0x428628,'folderIdToPath':_0x1dec46,'segmentNameToId':_0x4f4170,'activationsBySegmentId':_0x5e108d,'emailToIdMap':_0x4c2e32,'idToEmailMap':_0x68d7b6,'connectionNameToIdMap':_0x159877[_0x2c8c14(0x237)],'connectionIdToNameMap':_0x159877[_0x2c8c14(0x1d1)],'connectionNameToTypeMap':_0x159877[_0x2c8c14(0x245)]};}export function createPushYamlContextForBundle(_0x4d2a07,_0x1d3963,_0x4bff36,_0x19f425,_0x498878,_0x23a565,_0x34c2ca,_0x222f26){const {existingLocalSegmentNames:_0x14bbfa,localExpandedRuleToNames:_0x46d578}=_0x19f425,_0x552684=new Set(),_0x22e651=new Map(),_0x4881bd=new Map(),_0x511ff0=new Map(),_0xf0c62c=createJumpTargetCache(),_0x257476=new Map(),_0x2a67b5=new Map(),_0x757c46=new Set();let _0x4c447f;const _0x3fad34=_0x391d41=>{const _0xaf042e={'resolveSegment':async _0x550ad6=>{const _0x3d2a0e=a140_0x2294,_0xd45dec=_0x511ff0[_0x3d2a0e(0x24d)](_0x550ad6);if(_0xd45dec!==undefined)return{'name':_0xd45dec,'isJourneyLocal':!![]};try{const _0x5d6e9d=await fetchSegment(_0x4d2a07,_0x1d3963,_0x550ad6,_0x4bff36);if(!_0x5d6e9d)throw new Error(_0x3d2a0e(0x256));const _0x3bebfe=generateJourneyLocalName(_0x5d6e9d[_0x3d2a0e(0x1c9)]),_0x4c0b2f=_0x5d6e9d['kind']===SEGMENT_KIND_JOURNEY&&_0x3bebfe!==undefined;let _0xb973f7=_0x5d6e9d[_0x3d2a0e(0x1c9)],_0x30036c;if(_0x4c0b2f&&_0x5d6e9d[_0x3d2a0e(0x210)]){const _0xc8cefd=apiRuleToYaml(_0x5d6e9d['rule']);_0x2a67b5['set'](_0x550ad6,_0xc8cefd);const _0x4063a1=async _0x142f75=>{const _0x3f687f=_0x3d2a0e,_0x277543=collectSegmentRefsFromRule(_0x142f75);for(const _0x322658 of _0x277543){if(!_0x2a67b5[_0x3f687f(0x253)](_0x322658))try{const _0x1ce0ad=await fetchSegment(_0x4d2a07,_0x1d3963,_0x322658,_0x4bff36);if(_0x1ce0ad?.[_0x3f687f(0x210)]){const _0x126660=apiRuleToYaml(_0x1ce0ad[_0x3f687f(0x210)]);_0x2a67b5['set'](_0x322658,_0x126660),await _0x4063a1(_0x126660);}}catch(_0x55f8f5){logger[_0x3f687f(0x249)](_0x3f687f(0x1c1)+_0x322658+':\x20'+_0x55f8f5);}}};await _0x4063a1(_0xc8cefd);const _0x4af1e5=serializeExpandedRule(_0xc8cefd,_0x2a67b5),_0x3627bc=_0x46d578[_0x3d2a0e(0x24d)](_0x4af1e5);if(_0x3627bc&&_0x3627bc['length']>0x0){const _0x748e69=_0x22e651[_0x3d2a0e(0x24d)](_0x4af1e5)||0x0,_0x4a109d=_0x3627bc[_0x748e69]||_0x3627bc[_0x3627bc['length']-0x1];_0x22e651[_0x3d2a0e(0x1cc)](_0x4af1e5,_0x748e69+0x1),_0xb973f7=_0x4a109d,_0x552684[_0x3d2a0e(0x2a4)](_0xb973f7),_0x511ff0[_0x3d2a0e(0x1cc)](_0x550ad6,_0xb973f7);const _0x4cf34c=await resolveRuleSegmentRefs(_0xc8cefd,async _0x4b007a=>{const _0xd201da=_0x3d2a0e,_0x1f2cac=_0x511ff0[_0xd201da(0x24d)](_0x4b007a);if(_0x1f2cac)return _0x1f2cac;const _0x3d1652=await _0x4c447f[_0xd201da(0x20f)](_0x4b007a);return _0x3d1652[_0xd201da(0x1c9)];});_0x30036c={'description':_0x5d6e9d[_0x3d2a0e(0x272)],'rule':_0x4cf34c};}else{const _0x392b52=_0x257476['get'](_0x4af1e5);if(_0x392b52)_0xb973f7=_0x392b52,_0x511ff0[_0x3d2a0e(0x1cc)](_0x550ad6,_0xb973f7);else{if(_0x3bebfe){let _0x205145=_0x3bebfe,_0x108c25=0x2;while(_0x552684['has'](_0x205145)||_0x14bbfa[_0x3d2a0e(0x253)](_0x205145)){_0x205145=_0x3bebfe+'_'+_0x108c25,_0x108c25++;}_0x552684[_0x3d2a0e(0x2a4)](_0x205145),_0xb973f7=_0x205145;}_0x511ff0[_0x3d2a0e(0x1cc)](_0x550ad6,_0xb973f7),_0x257476[_0x3d2a0e(0x1cc)](_0x4af1e5,_0xb973f7);const _0x11bb13=await resolveRuleSegmentRefs(_0xc8cefd,async _0x51d79b=>{const _0x102a46=_0x3d2a0e,_0x45ba6a=_0x511ff0[_0x102a46(0x24d)](_0x51d79b);if(_0x45ba6a)return _0x45ba6a;const _0x5ddc44=await _0x4c447f[_0x102a46(0x20f)](_0x51d79b);return _0x5ddc44[_0x102a46(0x1c9)];});_0x30036c={'description':_0x5d6e9d['description'],'rule':_0x11bb13};}}}return{'name':_0xb973f7,'isJourneyLocal':_0x4c0b2f,'definition':_0x30036c};}catch(_0x36544e){return logger[_0x3d2a0e(0x249)](_0x3d2a0e(0x26c)+_0x550ad6+':\x20'+_0x36544e),{'name':_0x550ad6,'isJourneyLocal':![]};}},'resolveActivation':async _0x27d5f1=>{const _0x3ed9ef=a140_0x2294,_0x171693=_0x4881bd['get'](_0x27d5f1);if(_0x171693!==undefined)return{'name':_0x171693,'isJourneyLocal':!![]};try{let _0x3c1e8b=_0x34c2ca?.[_0x3ed9ef(0x24d)](_0x27d5f1);!_0x3c1e8b&&(_0x3c1e8b=await _0x4d2a07[_0x3ed9ef(0x1c3)][_0x3ed9ef(0x212)](_0x391d41,_0x27d5f1));const _0xd45107=_0x3c1e8b[_0x3ed9ef(0x1e9)][_0x3ed9ef(0x2ba)]['name']||_0x27d5f1,_0x48bb3a=sanitizeYamlKey(_0xd45107)||_0x3ed9ef(0x281)+_0x27d5f1,_0x12ceaa=_0x48bb3a;_0x4881bd[_0x3ed9ef(0x1cc)](_0x27d5f1,_0x12ceaa);const _0xce9de3=journeyActivationStepToYaml(_0x3c1e8b,_0x498878,_0x23a565);return{'name':_0x12ceaa,'isJourneyLocal':!![],'definition':_0xce9de3};}catch(_0x5d0b54){return logger[_0x3ed9ef(0x249)](_0x3ed9ef(0x235)+_0x27d5f1+':\x20'+_0x5d0b54),{'name':_0x27d5f1,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x464a8f,_0x29a80a)=>resolveJumpTarget(_0x464a8f,_0x29a80a,_0xf0c62c,async _0x1e6ff0=>{const _0x48eb90=a140_0x2294,_0x4bf357=_0x222f26?.[_0x48eb90(0x24d)](_0x1e6ff0);if(_0x4bf357)return _0x4bf357;return _0x4d2a07[_0x48eb90(0x1c3)][_0x48eb90(0x2b3)](_0x1e6ff0);})};return _0x4c447f=_0xaf042e,_0xaf042e;},_0x5b3cb8=async _0x46ddd0=>{const _0x53ac98=a140_0x2294,{collectSegmentIdsFromJourneyApi:_0xa9b021}=await import(_0x53ac98(0x1e8)),{batchAsync:_0xca88a4}=await import(_0x53ac98(0x217)),_0x54d31b=new Set();for(const _0x2fc6f1 of _0x46ddd0){let _0x50ab63=_0x222f26?.[_0x53ac98(0x24d)](_0x2fc6f1);!_0x50ab63&&(_0x50ab63=await _0x4d2a07[_0x53ac98(0x1c3)][_0x53ac98(0x2b3)](_0x2fc6f1));const _0x5d2703=_0xa9b021(_0x50ab63);for(const _0x2da818 of _0x5d2703){_0x54d31b[_0x53ac98(0x2a4)](_0x2da818);}}let _0x20e864=Array[_0x53ac98(0x216)](_0x54d31b);while(_0x20e864['length']>0x0){const _0x2e50ae=_0x20e864['filter'](_0x5cea54=>!_0x757c46[_0x53ac98(0x253)](_0x5cea54));if(_0x2e50ae['length']===0x0)break;const _0x2f8d68=await _0xca88a4(_0x2e50ae,async _0x4bc3b7=>{const _0x46800e=_0x53ac98;_0x757c46[_0x46800e(0x2a4)](_0x4bc3b7);const _0x47e1c3=await fetchSegment(_0x4d2a07,_0x1d3963,_0x4bc3b7,_0x4bff36);if(!_0x47e1c3)return null;return{'segmentId':_0x4bc3b7,'segment':_0x47e1c3};},0xa),_0x3e7d7a=new Set();for(const _0x65216f of _0x2f8d68){if(!_0x65216f?.[_0x53ac98(0x1be)]?.[_0x53ac98(0x210)])continue;const _0x42bdc4=apiRuleToYaml(_0x65216f[_0x53ac98(0x1be)][_0x53ac98(0x210)]);_0x2a67b5['set'](_0x65216f[_0x53ac98(0x279)],_0x42bdc4);const _0x2ae422=collectSegmentRefsFromRule(_0x42bdc4);for(const _0x1478e6 of _0x2ae422){!_0x757c46[_0x53ac98(0x253)](_0x1478e6)&&_0x3e7d7a[_0x53ac98(0x2a4)](_0x1478e6);}}_0x20e864=Array['from'](_0x3e7d7a);}};return{'createYamlContext':_0x3fad34,'prefetchJourneySegments':_0x5b3cb8};}export async function executePushSegments(_0x3aee1b,_0x2866c8,_0x3c8e18,_0x3e7469,_0x19e8fd){const _0x54f2a7=a140_0x164c64,{segmentDefToCreateRequest:_0x4a2143,segmentDefToUpdateRequest:_0x308abd}=await import(_0x54f2a7(0x294)),_0x57db82=_0x3c8e18[_0x54f2a7(0x1f1)],_0x460b23=0x5,_0x38a5d1=async _0x12e3b5=>{const _0x48bbcb=_0x54f2a7,_0x587052=_0x12e3b5[_0x48bbcb(0x239)]?_0x57db82[_0x48bbcb(0x24d)](_0x12e3b5[_0x48bbcb(0x239)]):undefined;let _0x474edc;const _0x51f6b1={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0xc981cb=_0x12e3b5[_0x48bbcb(0x221)];if(_0x12e3b5['yamlConfig']['rule']){const _0x4792e0=createSegmentIdResolver(_0x3c8e18[_0x48bbcb(0x1d4)],_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]),_0x1c10c5=await resolveRuleSegmentIds(_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x210)],_0x4792e0);_0xc981cb={..._0x12e3b5[_0x48bbcb(0x221)],'rule':_0x1c10c5};}try{if(_0x12e3b5[_0x48bbcb(0x1da)]){_0x19e8fd['onProgress']?.({'type':_0x48bbcb(0x220),'name':_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]});const _0x2510e7=_0x4a2143(_0xc981cb,_0x587052),_0x4d7e24=await _0x19e8fd[_0x48bbcb(0x24c)](_0x48bbcb(0x203)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+_0x48bbcb(0x20d),()=>_0x3aee1b['segment']['createSegment'](_0x3e7469['parentId'],_0x2510e7));_0x474edc=_0x4d7e24[_0x48bbcb(0x254)]['id'],_0x3c8e18[_0x48bbcb(0x1d4)][_0x48bbcb(0x1cc)](_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)],_0x474edc),_0x51f6b1['createdSegmentId']={'name':_0x12e3b5[_0x48bbcb(0x221)]['name'],'id':_0x474edc},_0x19e8fd[_0x48bbcb(0x1d2)]?.({'type':_0x48bbcb(0x266),'name':_0x12e3b5['yamlConfig']['name'],'segmentId':_0x474edc}),_0x19e8fd[_0x48bbcb(0x2b0)]?.(_0x48bbcb(0x1bd)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+'\x27'),_0x51f6b1[_0x48bbcb(0x23b)]=0x1;}else{if(_0x12e3b5[_0x48bbcb(0x1cd)]){_0x19e8fd[_0x48bbcb(0x1d2)]?.({'type':_0x48bbcb(0x1f3),'name':_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]});const _0x1cc504=_0x308abd(_0xc981cb);_0x587052!==_0x12e3b5[_0x48bbcb(0x21a)]?.[_0x48bbcb(0x1de)]&&(_0x1cc504[_0x48bbcb(0x1de)]=_0x587052?parseInt(_0x587052,0xa):undefined),await _0x19e8fd[_0x48bbcb(0x24c)]('Updating\x20segment\x20\x27'+_0x12e3b5['yamlConfig']['name']+_0x48bbcb(0x20d),()=>_0x3aee1b['segment'][_0x48bbcb(0x261)](_0x3e7469[_0x48bbcb(0x20b)],_0x12e3b5[_0x48bbcb(0x21a)]['id'],_0x1cc504)),_0x474edc=_0x12e3b5[_0x48bbcb(0x21a)]['id'],_0x19e8fd[_0x48bbcb(0x1d2)]?.({'type':'segment_updated','name':_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]}),_0x19e8fd['logSuccess']?.(_0x48bbcb(0x2ac)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+'\x27'),_0x51f6b1['updated']=0x1;}else _0x474edc=_0x12e3b5[_0x48bbcb(0x21a)]['id'];}}catch(_0x2b3a3d){const _0x61b722=isHttp400Error(_0x2b3a3d),_0x507053=_0x61b722?ErrorCode[_0x48bbcb(0x29c)]:ErrorCode[_0x48bbcb(0x1d0)],_0x54b617=getErrorMessage(_0x2b3a3d);throw new SDKError(_0x507053,_0x48bbcb(0x275)+(_0x12e3b5[_0x48bbcb(0x1da)]?_0x48bbcb(0x1f4):_0x48bbcb(0x248))+_0x48bbcb(0x28b)+_0x12e3b5[_0x48bbcb(0x1bb)]+'\x0a\x20\x20'+_0x54b617,_0x2b3a3d);}try{const _0x2f47eb=await syncActivationsForSegment(_0x3aee1b,_0x3e7469[_0x48bbcb(0x20b)],_0x474edc,_0x12e3b5['yamlConfig']['name'],_0x12e3b5['activationActions'],_0x19e8fd,_0x12e3b5['absolutePath']);_0x51f6b1[_0x48bbcb(0x29e)]=_0x2f47eb;}catch(_0x4531ba){if(_0x4531ba instanceof SDKError)throw _0x4531ba;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x48bbcb(0x28e)+_0x12e3b5[_0x48bbcb(0x221)][_0x48bbcb(0x1c9)]+'\x27\x20from\x20file:\x20'+_0x12e3b5[_0x48bbcb(0x1bb)]+'\x0a\x20\x20'+getErrorMessage(_0x4531ba),_0x4531ba);}return _0x51f6b1;},_0x66dfcf=await batchAsync(_0x2866c8,_0x38a5d1,_0x460b23),_0x1b1250={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xe499b1 of _0x66dfcf){_0x1b1250['created']+=_0xe499b1['created'],_0x1b1250[_0x54f2a7(0x1f5)]+=_0xe499b1[_0x54f2a7(0x1f5)],_0xe499b1['createdSegmentId']&&_0x1b1250['createdSegmentIds'][_0x54f2a7(0x1cc)](_0xe499b1['createdSegmentId'][_0x54f2a7(0x1c9)],_0xe499b1[_0x54f2a7(0x25b)]['id']),_0x1b1250['activations'][_0x54f2a7(0x23b)]+=_0xe499b1[_0x54f2a7(0x29e)]['created'],_0x1b1250[_0x54f2a7(0x29e)]['updated']+=_0xe499b1[_0x54f2a7(0x29e)][_0x54f2a7(0x1f5)],_0x1b1250['activations'][_0x54f2a7(0x290)]+=_0xe499b1[_0x54f2a7(0x29e)][_0x54f2a7(0x290)];}return _0x1b1250;}async function syncActivationsForSegment(_0x5becd2,_0x379ab0,_0x1f914f,_0x26510f,_0x2042d9,_0x311069,_0x1ab2f3){const _0x31bd34=a140_0x164c64,_0x404c40={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x17003d of _0x2042d9){try{if(_0x17003d['type']==='create'&&_0x17003d[_0x31bd34(0x28f)])_0x311069[_0x31bd34(0x1d2)]?.({'type':_0x31bd34(0x27e),'segmentName':_0x26510f,'activationName':_0x17003d['name']}),await _0x311069[_0x31bd34(0x24c)](_0x31bd34(0x27a)+_0x17003d[_0x31bd34(0x1c9)]+_0x31bd34(0x20d),()=>_0x5becd2[_0x31bd34(0x1be)]['createActivation'](_0x379ab0,_0x1f914f,_0x17003d['validatedRequest'])),_0x311069['onProgress']?.({'type':_0x31bd34(0x1fe),'segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),_0x311069[_0x31bd34(0x2b0)]?.('Created\x20activation\x20\x27'+_0x17003d['name']+'\x27'),_0x404c40['created']++;else{if(_0x17003d[_0x31bd34(0x25e)]===_0x31bd34(0x248)&&_0x17003d[_0x31bd34(0x28f)]&&_0x17003d[_0x31bd34(0x25f)])_0x311069['onProgress']?.({'type':_0x31bd34(0x260),'segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),await _0x311069[_0x31bd34(0x24c)](_0x31bd34(0x1ca)+_0x17003d[_0x31bd34(0x1c9)]+_0x31bd34(0x20d),()=>_0x5becd2[_0x31bd34(0x1be)]['updateActivation'](_0x379ab0,_0x1f914f,_0x17003d[_0x31bd34(0x25f)]['id'],_0x17003d[_0x31bd34(0x28f)])),_0x311069[_0x31bd34(0x1d2)]?.({'type':'activation_updated','segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),_0x311069['logSuccess']?.(_0x31bd34(0x25a)+_0x17003d[_0x31bd34(0x1c9)]+'\x27'),_0x404c40['updated']++;else _0x17003d[_0x31bd34(0x25e)]===_0x31bd34(0x1f2)&&_0x17003d['existingActivation']&&(_0x311069[_0x31bd34(0x1d2)]?.({'type':'activation_deleting','segmentName':_0x26510f,'activationName':_0x17003d['name']}),await _0x311069['withProgress'](_0x31bd34(0x2c3)+_0x17003d[_0x31bd34(0x1c9)]+'\x27...',()=>_0x5becd2[_0x31bd34(0x1be)][_0x31bd34(0x296)](_0x379ab0,_0x1f914f,_0x17003d[_0x31bd34(0x25f)]['id'])),_0x311069[_0x31bd34(0x1d2)]?.({'type':'activation_deleted','segmentName':_0x26510f,'activationName':_0x17003d[_0x31bd34(0x1c9)]}),_0x311069[_0x31bd34(0x274)]?.(_0x31bd34(0x1c5)+_0x17003d[_0x31bd34(0x1c9)]+'\x27'),_0x404c40['deleted']++);}}catch(_0x2e8ba0){const _0x4e6092=isHttp400Error(_0x2e8ba0),_0x17da9f=_0x4e6092?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x31bd34(0x1df)],_0x476ad6=getErrorMessage(_0x2e8ba0);throw new SDKError(_0x17da9f,_0x31bd34(0x275)+_0x17003d['type']+_0x31bd34(0x1e7)+_0x17003d['name']+_0x31bd34(0x282)+_0x1ab2f3+_0x31bd34(0x209)+_0x476ad6,_0x2e8ba0);}}return _0x404c40;}export async function executePushFolders(_0x55d353,_0x5f3090,_0x2c8d6d,_0x33944f,_0x265f6d){const _0x3a7758=a140_0x164c64,_0x3e112d=new Map(_0x2c8d6d),_0x30ff0e=sortFoldersByDepth(_0x5f3090);for(const _0x38d02e of _0x30ff0e){const _0x4a3fff=_0x38d02e[_0x3a7758(0x285)]('/'),_0x176087=_0x4a3fff[_0x4a3fff['length']-0x1],_0x5e0c07=_0x4a3fff['slice'](0x0,-0x1)['join']('/'),_0x42b004=_0x3e112d[_0x3a7758(0x24d)](_0x5e0c07);_0x265f6d[_0x3a7758(0x1d2)]?.({'type':_0x3a7758(0x2a3),'folder':_0x38d02e});const _0x279795={'name':_0x176087,'parentFolderId':_0x42b004},_0x305333=await _0x265f6d[_0x3a7758(0x24c)]('Creating\x20folder\x20\x27'+_0x38d02e+_0x3a7758(0x20d),()=>_0x55d353['segment']['createFolder'](_0x33944f['parentId'],_0x279795));_0x3e112d[_0x3a7758(0x1cc)](_0x38d02e,_0x305333[_0x3a7758(0x254)]['id']),_0x265f6d[_0x3a7758(0x1d2)]?.({'type':_0x3a7758(0x2be),'folder':_0x38d02e,'folderId':_0x305333[_0x3a7758(0x254)]['id']}),_0x265f6d[_0x3a7758(0x278)]?.('Created\x20folder\x20\x27'+_0x38d02e+'\x27');}return _0x3e112d;}export async function executePushSegmentDeletions(_0x524702,_0x5887f2,_0x2b7953){const _0x4c5d50=a140_0x164c64;if(_0x5887f2[_0x4c5d50(0x1e6)]===0x0)return 0x0;const {batchAsync:_0x1a9b2e}=await import('../../utils/async.js'),_0x4ac3db=0x5,_0x279027=await _0x1a9b2e(_0x5887f2,async _0x207d62=>{const _0x82ee18=_0x4c5d50;return _0x2b7953['onProgress']?.({'type':_0x82ee18(0x289),'name':_0x207d62[_0x82ee18(0x1c9)]}),await _0x524702[_0x82ee18(0x1be)][_0x82ee18(0x299)](_0x207d62['id']),_0x2b7953[_0x82ee18(0x1d2)]?.({'type':_0x82ee18(0x200),'name':_0x207d62[_0x82ee18(0x1c9)]}),_0x2b7953[_0x82ee18(0x274)]?.('Deleted\x20segment\x20\x27'+_0x207d62[_0x82ee18(0x1c9)]+'\x27'),0x1;},_0x4ac3db);return _0x279027[_0x4c5d50(0x1f7)]((_0x235d6a,_0x47bb70)=>_0x235d6a+_0x47bb70,0x0);}export async function executePushJourneys(_0x31115c,_0x34b3ed,_0x500fd2,_0x58f668,_0x1bbec6){const _0x8b584c=a140_0x164c64,{journeyDefToRequest:_0x1441e5}=await import(_0x8b584c(0x1e8)),{activationDefToCreateRequest:_0x1ce11f,yamlRuleToApi:_0x3ef54f,validateSegmentRule:_0x549d95}=await import('./child-segment-yaml.js'),_0x14ea79={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x22df12=new Map(_0x500fd2[_0x8b584c(0x1d4)]),_0x5bfd6b=0x5;for(let _0x345dfc=0x0;_0x345dfc<_0x34b3ed['length'];_0x345dfc+=_0x5bfd6b){const _0x16a28d=_0x34b3ed['slice'](_0x345dfc,_0x345dfc+_0x5bfd6b),_0x2b791a=await Promise[_0x8b584c(0x291)](_0x16a28d['map'](async _0x5a8827=>{const _0x4e2621=_0x8b584c;if(!_0x5a8827[_0x4e2621(0x1da)]&&!_0x5a8827[_0x4e2621(0x1cd)])return{'action':'unchanged','name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)],'journeyId':_0x5a8827[_0x4e2621(0x2b1)]?.['id']};const _0x222fcb=_0x5a8827[_0x4e2621(0x239)]?_0x500fd2['folderPathToId']['get'](_0x5a8827[_0x4e2621(0x239)]):undefined;_0x1bbec6[_0x4e2621(0x1d2)]?.({'type':_0x5a8827[_0x4e2621(0x1da)]?_0x4e2621(0x1e0):_0x4e2621(0x263),'name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]});try{const _0x1c9745=await executeSingleJourneyPush(_0x31115c,_0x5a8827,{..._0x500fd2,'segmentNameToId':_0x22df12},{'parentId':_0x58f668[_0x4e2621(0x20b)],'rootFolderId':_0x58f668[_0x4e2621(0x2bb)],'folderId':_0x222fcb,'verbose':_0x58f668[_0x4e2621(0x1e5)]},_0x1bbec6,{'journeyDefToRequest':_0x1441e5,'activationDefToCreateRequest':_0x1ce11f,'yamlRuleToApi':_0x3ef54f,'validateSegmentRule':_0x549d95});for(const [_0x504910,_0x2954ce]of _0x1c9745[_0x4e2621(0x22d)]){_0x22df12[_0x4e2621(0x1cc)](_0x504910,_0x2954ce),_0x14ea79['embeddedSegmentNameToId'][_0x4e2621(0x1cc)](_0x504910,_0x2954ce);}if(_0x1c9745[_0x4e2621(0x1fc)]===_0x4e2621(0x23b))_0x1bbec6['onProgress']?.({'type':'journey_created','name':_0x5a8827['yamlConfig']['name'],'journeyId':_0x1c9745[_0x4e2621(0x1f6)]}),_0x1bbec6[_0x4e2621(0x2b0)]?.('Created\x20journey\x20\x27'+_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]+'\x27'),_0x14ea79['created']++;else _0x1c9745[_0x4e2621(0x1fc)]===_0x4e2621(0x1f5)&&(_0x1bbec6[_0x4e2621(0x1d2)]?.({'type':_0x4e2621(0x23c),'name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]}),_0x1bbec6[_0x4e2621(0x2b0)]?.(_0x4e2621(0x2b4)+_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)]+'\x27'),_0x14ea79['updated']++);return{'action':_0x1c9745['action'],'name':_0x5a8827[_0x4e2621(0x221)][_0x4e2621(0x1c9)],'journeyId':_0x1c9745['journeyId']};}catch(_0x3d7a3b){const _0x28bc0f=isHttp400Error(_0x3d7a3b),_0x82e846=_0x28bc0f?ErrorCode[_0x4e2621(0x283)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x4e73a4=getErrorMessage(_0x3d7a3b);throw new SDKError(_0x82e846,_0x4e2621(0x275)+(_0x5a8827['isNew']?'create':_0x4e2621(0x248))+_0x4e2621(0x1c7)+_0x5a8827[_0x4e2621(0x1bb)]+_0x4e2621(0x209)+_0x4e73a4,_0x3d7a3b);}}));_0x14ea79[_0x8b584c(0x284)][_0x8b584c(0x1e1)](..._0x2b791a);}return _0x14ea79;}async function matchExistingJourneySegments(_0x25a151,_0x5a8a8d,_0x5f2931,_0x3a3461,_0x245156){const _0x641045=a140_0x164c64;if(!_0x5a8a8d[_0x641045(0x2b1)]||!_0x5a8a8d[_0x641045(0x221)][_0x641045(0x23d)])return;const _0x4e216d=new Map(),_0x164b86=new Set();for(const _0xaf5e0c of Object[_0x641045(0x238)](_0x5a8a8d[_0x641045(0x221)][_0x641045(0x23d)])){const _0xdb652c=generateDeterministicJourneySegmentName(_0x5a8a8d[_0x641045(0x221)][_0x641045(0x1c9)],_0xaf5e0c);_0x4e216d[_0x641045(0x1cc)](_0xdb652c,_0xaf5e0c),_0x164b86[_0x641045(0x2a4)](_0xaf5e0c);}const _0xebb6ea=[],_0x3071ce=collectSegmentIdsFromJourneyApi(_0x5a8a8d[_0x641045(0x2b1)]);for(const _0x5a1c49 of _0x3071ce){const _0x2f85dc=await fetchSegment(_0x25a151,_0x5f2931,_0x5a1c49,_0x3a3461);if(!_0x2f85dc?.[_0x641045(0x1c9)])continue;const _0x10d1bd=_0x4e216d[_0x641045(0x24d)](_0x2f85dc[_0x641045(0x1c9)]);_0x10d1bd?(_0x245156[_0x641045(0x1cc)](_0x10d1bd,_0x5a1c49),_0x164b86[_0x641045(0x1f2)](_0x10d1bd)):_0xebb6ea[_0x641045(0x1e1)]({'id':_0x5a1c49,'seg':_0x2f85dc});}if(_0x164b86[_0x641045(0x231)]>0x0&&_0xebb6ea[_0x641045(0x1e6)]>0x0){const {localExpandedRuleToNames:_0x2c7b8d}=buildLocalExpandedRuleMappings(_0x5a8a8d[_0x641045(0x221)]),_0x1fde4c=new Map();for(const {id:_0x4ec257,seg:_0xef9b73}of _0xebb6ea){if(_0xef9b73['rule']){const _0xabc8b3=apiRuleToYaml(_0xef9b73[_0x641045(0x210)]);_0x1fde4c[_0x641045(0x1cc)](_0x4ec257,_0xabc8b3);}}for(const {id:_0x44cdef,seg:_0x1ec45f}of _0xebb6ea){if(!_0x1ec45f[_0x641045(0x210)])continue;const _0x1388a2=_0x1fde4c[_0x641045(0x24d)](_0x44cdef);if(!_0x1388a2)continue;const _0x27dcc1=serializeExpandedRule(_0x1388a2,_0x1fde4c),_0x37ad28=_0x2c7b8d[_0x641045(0x24d)](_0x27dcc1);if(_0x37ad28){const _0x366e02=_0x37ad28['find'](_0x37f5ff=>_0x164b86[_0x641045(0x253)](_0x37f5ff));_0x366e02&&(_0x245156['set'](_0x366e02,_0x44cdef),_0x164b86[_0x641045(0x1f2)](_0x366e02),logger[_0x641045(0x249)](_0x641045(0x1fd)+_0x1ec45f[_0x641045(0x1c9)]+_0x641045(0x229)+_0x366e02+_0x641045(0x1e3)));}}}}async function executeSingleJourneyPush(_0x587ebe,_0x302ad6,_0x49590b,_0x29fec0,_0x464fea,_0x16a080){const _0x24c773=a140_0x164c64,{journeyDefToRequest:_0x16cb70,activationDefToCreateRequest:_0x58e9ce,yamlRuleToApi:_0x546d2e,validateSegmentRule:_0xd991c4}=_0x16a080,_0x5c9d7a=new Map(),_0x4a8191=new Map();recoverSegmentIdsFromPushRecovery(_0x302ad6,_0x5c9d7a,_0x49590b[_0x24c773(0x1d4)]);const _0x2e1cd9=new Map(),_0x2bc51e=new Map(),_0x7c2038=new Map();let _0x1409d1;const _0x18edb8=async()=>{const _0xb2d71=_0x24c773;if(_0x1409d1)return;_0x1409d1=new Map();if(!_0x302ad6[_0xb2d71(0x2b1)])return;const _0xe604ed=await _0x587ebe[_0xb2d71(0x1c3)]['listActivations'](_0x302ad6[_0xb2d71(0x2b1)]['id']);for(const _0x2064e9 of _0xe604ed){const _0x1d7c5a=journeyActivationStepToYaml(_0x2064e9,_0x49590b[_0xb2d71(0x2b8)],_0x49590b[_0xb2d71(0x20a)]),_0x331d3d=activationSignature(_0x1d7c5a);!_0x1409d1[_0xb2d71(0x253)](_0x331d3d)&&_0x1409d1[_0xb2d71(0x1cc)](_0x331d3d,_0x2064e9['id']),_0x1d7c5a['name']&&_0x4a8191[_0xb2d71(0x1cc)](_0x1d7c5a[_0xb2d71(0x1c9)],_0x2064e9['id']);}};await matchExistingJourneySegments(_0x587ebe,_0x302ad6,_0x29fec0[_0x24c773(0x20b)],_0x49590b[_0x24c773(0x23f)],_0x49590b[_0x24c773(0x1d4)]);const _0x59917f={'resolveSegmentId':async _0x1b3f32=>{const _0x338b24=_0x24c773,_0x931e6e=_0x49590b['segmentNameToId'][_0x338b24(0x24d)](_0x1b3f32);if(!_0x931e6e)throw new SDKError(ErrorCode[_0x338b24(0x228)],_0x338b24(0x1ee)+_0x1b3f32+_0x338b24(0x211)+_0x302ad6[_0x338b24(0x221)][_0x338b24(0x1c9)]+')');return _0x931e6e;},'resolveEmbeddedSegmentId':async(_0x27254c,_0x1e7e82)=>{const _0x3058c3=_0x24c773,_0x2d2fea=_0x49590b[_0x3058c3(0x1d4)][_0x3058c3(0x24d)](_0x27254c);if(_0x2d2fea)return _0x2d2fea;const _0x353668=_0x49590b['existingSegments'][_0x3058c3(0x271)](_0x3f7c2a=>_0x3f7c2a[_0x3058c3(0x1c9)]===_0x27254c);if(_0x353668)return _0x49590b[_0x3058c3(0x1d4)][_0x3058c3(0x1cc)](_0x27254c,_0x353668['id']),_0x353668['id'];if(_0x302ad6['isNew']){const {stageName:_0x178831,criteriaName:_0x540a57}=findSegmentCriteriaLocation(_0x302ad6[_0x3058c3(0x221)],_0x27254c);return _0xd991c4(_0x27254c,_0x1e7e82['rule']),_0x2bc51e['set'](_0x27254c,{'definition':_0x1e7e82,'stageName':_0x178831,'criteriaName':_0x540a57}),createPendingSegmentId(_0x27254c);}const _0x2a32d1=_0x302ad6[_0x3058c3(0x2b1)]?.['id'];if(!_0x2a32d1)throw new SDKError(ErrorCode['INTERNAL'],_0x3058c3(0x1bf));const _0xd32cae=_0x2e1cd9[_0x3058c3(0x24d)](_0x27254c);if(_0xd32cae)return _0xd32cae;const _0x254b1d=((async()=>{const _0x545d83=_0x3058c3;_0xd991c4(_0x27254c,_0x1e7e82['rule']);const _0xc6a83d=generateDeterministicJourneySegmentName(_0x302ad6[_0x545d83(0x221)][_0x545d83(0x1c9)],_0x27254c),_0x30bfd0=_0x49590b[_0x545d83(0x23f)][_0x545d83(0x271)](_0x8d6d9a=>_0x8d6d9a[_0x545d83(0x1c9)]===_0xc6a83d),_0x5f1cd1=createSegmentIdResolver(_0x49590b[_0x545d83(0x1d4)],_0x27254c),_0x31a44f=await resolveRuleSegmentIds(_0x1e7e82[_0x545d83(0x210)],_0x5f1cd1);let _0x26bddf;return _0x30bfd0?(await _0x587ebe[_0x545d83(0x1be)][_0x545d83(0x261)](_0x29fec0[_0x545d83(0x20b)],_0x30bfd0['id'],{'description':_0x1e7e82[_0x545d83(0x272)]||_0x545d83(0x223)+_0x27254c,'rule':_0x546d2e(_0x31a44f,!![]),'countPopulation':!![]}),_0x26bddf=_0x30bfd0['id'],saveSegmentToPushRecovery(_0x302ad6[_0x545d83(0x1bb)],_0x302ad6[_0x545d83(0x221)][_0x545d83(0x1c9)],_0x27254c,{'segmentId':_0x26bddf,'uniqueServerName':_0xc6a83d,'createdAt':new Date()[_0x545d83(0x292)]()})):_0x26bddf=await createOrRecoverEmbeddedSegment(_0x587ebe,_0x302ad6,{'localName':_0x27254c,'uniqueSegmentName':_0xc6a83d,'description':_0x1e7e82['description']||_0x545d83(0x223)+_0x27254c,'journeyId':_0x2a32d1,'resolvedRule':_0x31a44f,'parentId':_0x29fec0[_0x545d83(0x20b)],'folderId':_0x29fec0[_0x545d83(0x2bb)]||''},_0x546d2e),_0x49590b[_0x545d83(0x1d4)]['set'](_0x27254c,_0x26bddf),_0x5c9d7a[_0x545d83(0x1cc)](_0x27254c,_0x26bddf),_0x26bddf;})());_0x2e1cd9[_0x3058c3(0x1cc)](_0x27254c,_0x254b1d);try{return await _0x254b1d;}finally{_0x2e1cd9[_0x3058c3(0x1f2)](_0x27254c);}},'resolveActivationId':async _0x4563cf=>{const _0x3a714e=_0x24c773,_0x4785e0=_0x4a8191[_0x3a714e(0x24d)](_0x4563cf);if(_0x4785e0)return _0x4785e0;if(_0x302ad6[_0x3a714e(0x2b1)]){await _0x18edb8();const _0x442cc8=_0x4a8191[_0x3a714e(0x24d)](_0x4563cf);if(_0x442cc8)return _0x442cc8;}throw new SDKError(ErrorCode[_0x3a714e(0x1d8)],_0x3a714e(0x226)+_0x4563cf+_0x3a714e(0x211)+_0x302ad6[_0x3a714e(0x221)][_0x3a714e(0x1c9)]+').\x20'+_0x3a714e(0x26e));},'resolveEmbeddedActivationId':async(_0xc966f4,_0x14a42d)=>{const _0x510321=_0x24c773,_0x11b3ac=_0x4a8191[_0x510321(0x24d)](_0xc966f4);if(_0x11b3ac)return _0x11b3ac;if(_0x302ad6['isNew'])return _0x7c2038[_0x510321(0x1cc)](_0xc966f4,_0x14a42d),createPendingActivationId(_0xc966f4);if(_0x302ad6[_0x510321(0x2b1)]){await _0x18edb8();const _0x136b98=_0x4a8191[_0x510321(0x24d)](_0x14a42d['name']);if(_0x136b98)return _0x4a8191[_0x510321(0x1cc)](_0xc966f4,_0x136b98),_0x136b98;const _0x1de494=activationSignature(_0x14a42d),_0x544b8f=_0x1409d1?.[_0x510321(0x24d)](_0x1de494);if(_0x544b8f)return _0x4a8191[_0x510321(0x1cc)](_0xc966f4,_0x544b8f),_0x544b8f;const _0x3ffc3b=await _0x58e9ce(_0x14a42d,_0x49590b[_0x510321(0x2bc)]),_0x25e171={..._0x3ffc3b,..._0x14a42d[_0x510321(0x2a2)]!==undefined&&{'runAfterJourneyRefresh':_0x14a42d[_0x510321(0x2a2)]}},_0x82aab=await _0x587ebe[_0x510321(0x1c3)][_0x510321(0x28d)](_0x302ad6[_0x510321(0x2b1)]['id'],_0x25e171);return _0x4a8191[_0x510321(0x1cc)](_0xc966f4,_0x82aab['id']),_0x82aab['id'];}throw new SDKError(ErrorCode[_0x510321(0x1d7)],_0x510321(0x242));},'resolveJourneyId':async _0x213948=>{const _0x47bf4e=_0x24c773;try{return await _0x587ebe[_0x47bf4e(0x1c3)][_0x47bf4e(0x25c)](_0x29fec0[_0x47bf4e(0x20b)],_0x213948);}catch(_0x7a2c48){throw new SDKError(ErrorCode[_0x47bf4e(0x1d8)],_0x47bf4e(0x22f)+_0x213948+_0x47bf4e(0x1c2)+_0x302ad6[_0x47bf4e(0x221)][_0x47bf4e(0x1c9)]+'\x27)',_0x7a2c48);}},'resolveStageId':async(_0x549a97,_0x110b23)=>{const _0x566fd3=_0x24c773,_0x1b141c=await _0x587ebe['journey'][_0x566fd3(0x2b3)](_0x549a97),_0x505261=_0x1b141c[_0x566fd3(0x1e9)]['journeyStages']['find'](_0x3ede2d=>_0x3ede2d[_0x566fd3(0x1c9)][_0x566fd3(0x287)]()===_0x110b23[_0x566fd3(0x287)]());if(!_0x505261?.['id'])throw new SDKError(ErrorCode[_0x566fd3(0x1d8)],_0x566fd3(0x264)+_0x110b23+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x1b141c[_0x566fd3(0x1e9)][_0x566fd3(0x225)]||_0x1b141c[_0x566fd3(0x1e9)][_0x566fd3(0x1c9)])+'\x27');return _0x505261['id'];}},_0x15c539=await _0x16cb70(_0x302ad6[_0x24c773(0x221)],_0x29fec0['parentId'],_0x59917f),_0x41445d=_0x29fec0[_0x24c773(0x2ab)]||_0x29fec0['rootFolderId'];_0x41445d&&(_0x15c539[_0x24c773(0x286)]={'parentFolder':{'data':{'id':_0x41445d,'type':_0x24c773(0x277)}}});if(_0x302ad6[_0x24c773(0x1da)]){if(_0x2bc51e[_0x24c773(0x231)]>0x0||_0x7c2038[_0x24c773(0x231)]>0x0)return await executeThreeStepJourneyCreate(_0x587ebe,_0x302ad6,_0x15c539,{'pendingEmbeddedSegments':_0x2bc51e,'pendingEmbeddedActivations':_0x7c2038,'embeddedSegmentNameToId':_0x5c9d7a,'journeyActivationNameToId':_0x4a8191},{..._0x29fec0,'effectiveFolderId':_0x41445d},_0x49590b,_0x464fea,_0x16a080);else{ensureJourneyDefaults(_0x15c539[_0x24c773(0x1e9)]);const _0xaec86b=await _0x587ebe['journey'][_0x24c773(0x1f4)](_0x15c539);return deletePushRecovery(_0x302ad6[_0x24c773(0x1bb)]),{'action':_0x24c773(0x23b),'journeyId':_0xaec86b['id'],'embeddedSegmentNameToId':_0x5c9d7a};}}else{if(_0x302ad6[_0x24c773(0x1cd)]&&_0x302ad6[_0x24c773(0x2b1)]){_0x15c539['id']=_0x302ad6[_0x24c773(0x2b1)]['id'];const _0x2d865=_0x15c539[_0x24c773(0x1e9)];_0x302ad6[_0x24c773(0x2b1)][_0x24c773(0x1e9)]?.['journeyBundleName']&&(_0x2d865[_0x24c773(0x225)]=_0x302ad6['existingJourney'][_0x24c773(0x1e9)][_0x24c773(0x225)]);const _0x1a1268=_0x302ad6[_0x24c773(0x2b1)][_0x24c773(0x1e9)]?.[_0x24c773(0x247)];return _0x1a1268&&_0x15c539[_0x24c773(0x1e9)][_0x24c773(0x247)]&&injectExistingStageIds(_0x15c539[_0x24c773(0x1e9)][_0x24c773(0x247)],_0x1a1268),ensureJourneyDefaults(_0x2d865),await _0x587ebe[_0x24c773(0x1c3)][_0x24c773(0x248)](_0x302ad6[_0x24c773(0x2b1)]['id'],_0x15c539),deletePushRecovery(_0x302ad6[_0x24c773(0x1bb)]),{'action':_0x24c773(0x1f5),'journeyId':_0x302ad6[_0x24c773(0x2b1)]['id'],'embeddedSegmentNameToId':_0x5c9d7a};}}return deletePushRecovery(_0x302ad6['absolutePath']),{'action':_0x24c773(0x232),'journeyId':_0x302ad6[_0x24c773(0x2b1)]?.['id'],'embeddedSegmentNameToId':_0x5c9d7a};}function findSegmentCriteriaLocation(_0x289d1e,_0x3c5d7d){const _0x38bf4f=a140_0x164c64,_0x527b05=_0x289d1e[_0x38bf4f(0x222)]||_0x289d1e[_0x38bf4f(0x205)]?.[0x0]?.['stages']||[];let _0x294331=_0x38bf4f(0x1ce),_0x2bfcaa=_0x3c5d7d;const _0x589d80=_0x289d1e[_0x38bf4f(0x257)]||_0x289d1e['journeys']?.[0x0]?.[_0x38bf4f(0x257)];if(_0x589d80?.['segment']===_0x3c5d7d)return{'stageName':'goal','criteriaName':_0x589d80[_0x38bf4f(0x1c9)]||_0x3c5d7d};_0x2a2648:for(const _0x290cd4 of _0x527b05){if(_0x290cd4[_0x38bf4f(0x24a)]?.[_0x38bf4f(0x1be)]===_0x3c5d7d){_0x294331=_0x290cd4[_0x38bf4f(0x1c9)],_0x2bfcaa=_0x290cd4[_0x38bf4f(0x24a)]['name']||_0x3c5d7d;break;}if(_0x290cd4[_0x38bf4f(0x26b)])for(const _0x4b547c of _0x290cd4['steps']){if(_0x4b547c[_0x38bf4f(0x25e)]===_0x38bf4f(0x22a)&&_0x4b547c[_0x38bf4f(0x2a1)]?.[_0x38bf4f(0x2b6)])for(const _0x16e85c of _0x4b547c['with']['branches']){if(_0x16e85c[_0x38bf4f(0x1be)]===_0x3c5d7d){_0x294331=_0x290cd4[_0x38bf4f(0x1c9)],_0x2bfcaa=_0x16e85c[_0x38bf4f(0x1c9)]||_0x3c5d7d;break _0x2a2648;}}}}return{'stageName':_0x294331,'criteriaName':_0x2bfcaa};}async function executeThreeStepJourneyCreate(_0x4d449a,_0x446a59,_0x4731e0,_0x349992,_0x2ce902,_0xc0d4c5,_0x8efb7d,_0x5bf150){const _0x45f37a=a140_0x164c64,{activationDefToCreateRequest:_0x2c246c,yamlRuleToApi:_0x57f525}=_0x5bf150,{pendingEmbeddedSegments:_0x27c58f,pendingEmbeddedActivations:_0x28bb30,embeddedSegmentNameToId:_0x528d53}=_0x349992,_0x4f0c2b=JSON['parse'](JSON[_0x45f37a(0x27b)](_0x4731e0));ensureJourneyDefaults(_0x4f0c2b[_0x45f37a(0x1e9)]),stripPendingIds(_0x4f0c2b);const _0x1b4c0d=await _0x4d449a[_0x45f37a(0x1c3)][_0x45f37a(0x1f4)](_0x4f0c2b),_0x3253e9=_0x1b4c0d['id'],_0x3946ac=new Map();for(const _0x257860 of _0x1b4c0d[_0x45f37a(0x1e9)][_0x45f37a(0x247)]){_0x3946ac[_0x45f37a(0x1cc)](_0x257860[_0x45f37a(0x1c9)][_0x45f37a(0x287)](),_0x257860['id']);}recoverSegmentIdsFromPushRecovery(_0x446a59,_0x528d53,_0xc0d4c5[_0x45f37a(0x1d4)]);for(const [_0x209969,{definition:_0x11630e}]of _0x27c58f){if(_0x528d53['has'](_0x209969)){_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x230),'journeyName':_0x446a59[_0x45f37a(0x221)]['name'],'segmentName':_0x209969});continue;}const _0x34e899=generateDeterministicJourneySegmentName(_0x446a59['yamlConfig'][_0x45f37a(0x1c9)],_0x209969);_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x1f8),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'segmentName':_0x209969});const _0x5e92b0=createSegmentIdResolver(_0xc0d4c5[_0x45f37a(0x1d4)],_0x209969),_0x23bb04=await resolveRuleSegmentIds(_0x11630e['rule'],_0x5e92b0),_0x46f5f3=await createOrRecoverEmbeddedSegment(_0x4d449a,_0x446a59,{'localName':_0x209969,'uniqueSegmentName':_0x34e899,'description':_0x11630e[_0x45f37a(0x272)]||'Entry\x20criteria:\x20'+_0x209969,'journeyId':_0x3253e9,'resolvedRule':_0x23bb04,'parentId':_0x2ce902[_0x45f37a(0x20b)],'folderId':_0x2ce902[_0x45f37a(0x258)]||''},_0x57f525);_0x528d53[_0x45f37a(0x1cc)](_0x209969,_0x46f5f3),_0xc0d4c5['segmentNameToId'][_0x45f37a(0x1cc)](_0x209969,_0x46f5f3),_0x8efb7d['onProgress']?.({'type':_0x45f37a(0x230),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'segmentName':_0x209969});}const _0x38e409=new Map();for(const [_0x255120,_0x41c630]of _0x28bb30){_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x27d),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'activationName':_0x255120});const _0x5e5542=await _0x2c246c(_0x41c630,_0xc0d4c5[_0x45f37a(0x2bc)]),_0x42324e={..._0x5e5542,..._0x41c630['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x41c630['run_after_journey_refresh']}},_0x55eef1=await _0x4d449a[_0x45f37a(0x1c3)][_0x45f37a(0x28d)](_0x3253e9,_0x42324e);_0x38e409[_0x45f37a(0x1cc)](_0x255120,_0x55eef1['id']),_0x349992[_0x45f37a(0x26f)][_0x45f37a(0x1cc)](_0x255120,_0x55eef1['id']),_0x8efb7d[_0x45f37a(0x1d2)]?.({'type':_0x45f37a(0x1bc),'journeyName':_0x446a59[_0x45f37a(0x221)][_0x45f37a(0x1c9)],'activationName':_0x255120});}const _0x5edf58=JSON[_0x45f37a(0x20c)](JSON[_0x45f37a(0x27b)](_0x4731e0));return _0x5edf58['id']=_0x3253e9,ensureJourneyDefaults(_0x5edf58['attributes']),resolvePendingIdsInRequest(_0x5edf58,_0x4731e0,_0x3946ac,_0x528d53,_0x38e409,_0x8efb7d),await _0x4d449a[_0x45f37a(0x1c3)][_0x45f37a(0x248)](_0x3253e9,_0x5edf58),deletePushRecovery(_0x446a59[_0x45f37a(0x1bb)]),{'action':_0x45f37a(0x23b),'journeyId':_0x3253e9,'embeddedSegmentNameToId':_0x528d53};}export function stripWaitStepPendingIds(_0x211c79){const _0x4be00d=a140_0x164c64,_0x57e97d=_0x211c79[_0x4be00d(0x202)]&&isPendingSegmentId(_0x211c79[_0x4be00d(0x202)]),_0x35c42c=_0x211c79['conditions']?.[_0x4be00d(0x1d5)](_0x40f440=>_0x40f440[_0x4be00d(0x279)]&&isPendingSegmentId(_0x40f440[_0x4be00d(0x279)]));(_0x57e97d||_0x35c42c)&&(_0x211c79[_0x4be00d(0x1f0)]=_0x4be00d(0x241),_0x211c79[_0x4be00d(0x1dc)]=0x1,_0x211c79['waitStepUnit']=_0x4be00d(0x2bf),delete _0x211c79[_0x4be00d(0x202)],delete _0x211c79[_0x4be00d(0x2b9)],delete _0x211c79['conditionTimeoutUnit'],delete _0x211c79[_0x4be00d(0x1f9)]);}export function resolveWaitStepPendingIds(_0x1dffb,_0xaa4df5,_0x1025a7,_0x16b434){const _0x51d753=a140_0x164c64;if(_0xaa4df5[_0x51d753(0x202)]&&isPendingSegmentId(_0xaa4df5['conditionSegmentId'])){const _0x33effb=_0x1025a7(_0xaa4df5[_0x51d753(0x202)],_0x51d753(0x28c)+_0x16b434+_0x51d753(0x280));_0x33effb&&(_0x1dffb[_0x51d753(0x1f0)]='Condition',_0x1dffb[_0x51d753(0x202)]=_0x33effb,delete _0x1dffb[_0x51d753(0x1dc)],delete _0x1dffb[_0x51d753(0x227)],_0xaa4df5[_0x51d753(0x2b9)]!==undefined&&(_0x1dffb[_0x51d753(0x2b9)]=_0xaa4df5[_0x51d753(0x2b9)]),_0xaa4df5['conditionTimeoutUnit']&&(_0x1dffb[_0x51d753(0x270)]=_0xaa4df5[_0x51d753(0x270)]));}if(_0xaa4df5[_0x51d753(0x1f9)]){const _0x1dd4d9=_0xaa4df5['conditions'][_0x51d753(0x1d5)](_0x25aa3b=>_0x25aa3b[_0x51d753(0x279)]&&isPendingSegmentId(_0x25aa3b[_0x51d753(0x279)]));if(_0x1dd4d9){const _0x1fa5c9=_0xaa4df5[_0x51d753(0x1f9)][_0x51d753(0x207)](_0x464336=>{const _0xc4c986=_0x51d753;if(_0x464336[_0xc4c986(0x279)]&&isPendingSegmentId(_0x464336['segmentId'])){const _0x573628=_0x1025a7(_0x464336[_0xc4c986(0x279)],'stage\x20\x27'+_0x16b434+_0xc4c986(0x280));return{..._0x464336,'segmentId':_0x573628||_0x464336[_0xc4c986(0x279)]};}return{..._0x464336};});_0x1dffb[_0x51d753(0x1f0)]=_0x51d753(0x218),_0x1dffb['conditions']=_0x1fa5c9,delete _0x1dffb[_0x51d753(0x1dc)],delete _0x1dffb[_0x51d753(0x227)],delete _0x1dffb['conditionSegmentId'],delete _0x1dffb[_0x51d753(0x2b9)],delete _0x1dffb[_0x51d753(0x270)];}}}function stripPendingIds(_0x286f11){const _0x27c6b1=a140_0x164c64;_0x286f11[_0x27c6b1(0x1e9)][_0x27c6b1(0x257)]?.[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x286f11['attributes']['goal'][_0x27c6b1(0x279)])&&delete _0x286f11['attributes'][_0x27c6b1(0x257)];for(const _0x2a2361 of _0x286f11['attributes'][_0x27c6b1(0x247)]||[]){_0x2a2361[_0x27c6b1(0x24f)]?.[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x2a2361[_0x27c6b1(0x24f)][_0x27c6b1(0x279)])&&delete _0x2a2361[_0x27c6b1(0x24f)];_0x2a2361[_0x27c6b1(0x1c6)]?.[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x2a2361['milestone'][_0x27c6b1(0x279)])&&delete _0x2a2361['milestone'];_0x2a2361[_0x27c6b1(0x1e4)]&&(_0x2a2361[_0x27c6b1(0x1e4)]=_0x2a2361[_0x27c6b1(0x1e4)][_0x27c6b1(0x204)](_0x5d0f41=>!_0x5d0f41[_0x27c6b1(0x279)]||!isPendingSegmentId(_0x5d0f41[_0x27c6b1(0x279)])));if(_0x2a2361[_0x27c6b1(0x26b)])for(const _0x9e8b59 of Object[_0x27c6b1(0x238)](_0x2a2361['steps'])){const _0x21254b=_0x2a2361[_0x27c6b1(0x26b)][_0x9e8b59];_0x21254b[_0x27c6b1(0x25e)]===_0x27c6b1(0x22b)&&_0x21254b[_0x27c6b1(0x29a)]&&isPendingActivationId(_0x21254b['journeyActivationStepId'])&&(_0x21254b[_0x27c6b1(0x29a)]='');if(_0x21254b[_0x27c6b1(0x25e)]===_0x27c6b1(0x21d)&&_0x21254b[_0x27c6b1(0x2b6)])for(const _0x2b6d7f of _0x21254b[_0x27c6b1(0x2b6)]){_0x2b6d7f[_0x27c6b1(0x279)]&&isPendingSegmentId(_0x2b6d7f[_0x27c6b1(0x279)])&&(_0x2b6d7f['segmentId']='');}_0x21254b['type']==='WaitStep'&&stripWaitStepPendingIds(_0x21254b);}}}function resolvePendingIdsInRequest(_0x53426a,_0x3e28d1,_0xe121e8,_0xef9b04,_0x5d13cc,_0x3dcc66){const _0x3bbc34=a140_0x164c64,_0x567d99=(_0x179edd,_0x162c33)=>{const _0x3ab9a0=a140_0x2294;if(!isPendingSegmentId(_0x179edd))return _0x179edd;const _0x11a715=extractPendingSegmentName(_0x179edd),_0x56d271=_0xef9b04[_0x3ab9a0(0x24d)](_0x11a715);return!_0x56d271&&_0x3dcc66['logWarning']?.(_0x3ab9a0(0x22c)+_0x11a715+_0x3ab9a0(0x219)+_0x162c33),_0x56d271;};if(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)]?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)][_0x3bbc34(0x279)])){const _0x2ae460=_0x567d99(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)][_0x3bbc34(0x279)],_0x3bbc34(0x224));_0x2ae460&&(_0x53426a[_0x3bbc34(0x1e9)][_0x3bbc34(0x257)]['segmentId']=_0x2ae460);}for(const _0x1a3f00 of _0x53426a['attributes'][_0x3bbc34(0x247)]||[]){const _0x286152=_0xe121e8[_0x3bbc34(0x24d)](_0x1a3f00[_0x3bbc34(0x1c9)][_0x3bbc34(0x287)]());_0x286152&&(_0x1a3f00['id']=_0x286152);if(_0x1a3f00[_0x3bbc34(0x24f)]?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x1a3f00[_0x3bbc34(0x24f)][_0x3bbc34(0x279)])){const _0x14d52e=_0x567d99(_0x1a3f00[_0x3bbc34(0x24f)][_0x3bbc34(0x279)],'stage\x20\x27'+_0x1a3f00[_0x3bbc34(0x1c9)]+_0x3bbc34(0x29b));_0x14d52e&&(_0x1a3f00[_0x3bbc34(0x24f)][_0x3bbc34(0x279)]=_0x14d52e);}if(_0x1a3f00['exitCriterias'])for(const _0x54043e of _0x1a3f00[_0x3bbc34(0x1e4)]){if(_0x54043e[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x54043e['segmentId'])){const _0x5d6e4e=_0x567d99(_0x54043e['segmentId'],'stage\x20\x27'+_0x1a3f00['name']+_0x3bbc34(0x298));_0x5d6e4e&&(_0x54043e['segmentId']=_0x5d6e4e);}}if(_0x1a3f00[_0x3bbc34(0x1c6)]?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x1a3f00[_0x3bbc34(0x1c6)][_0x3bbc34(0x279)])){const _0x1513e1=_0x567d99(_0x1a3f00[_0x3bbc34(0x1c6)][_0x3bbc34(0x279)],_0x3bbc34(0x28c)+_0x1a3f00['name']+'\x27\x20milestone');_0x1513e1&&(_0x1a3f00[_0x3bbc34(0x1c6)][_0x3bbc34(0x279)]=_0x1513e1);}if(_0x1a3f00[_0x3bbc34(0x26b)]){const _0xbbbf3c=_0x560155=>_0x3e28d1[_0x3bbc34(0x1e9)]['journeyStages']?.['find'](_0x3a7a8e=>_0x3a7a8e[_0x3bbc34(0x1c9)][_0x3bbc34(0x287)]()===_0x1a3f00[_0x3bbc34(0x1c9)]['toLowerCase']())?.['steps']?.[_0x560155];for(const _0x4a6a2c of Object['keys'](_0x1a3f00[_0x3bbc34(0x26b)])){const _0x431a3e=_0x1a3f00[_0x3bbc34(0x26b)][_0x4a6a2c],_0x11daed=_0xbbbf3c(_0x4a6a2c);if(_0x431a3e['type']==='Activation'&&_0x431a3e[_0x3bbc34(0x29a)]&&(isPendingActivationId(_0x431a3e['journeyActivationStepId'])||_0x431a3e[_0x3bbc34(0x29a)]==='')){if(_0x11daed?.[_0x3bbc34(0x29a)]&&isPendingActivationId(_0x11daed[_0x3bbc34(0x29a)])){const _0x368386=extractPendingActivationName(_0x11daed[_0x3bbc34(0x29a)]),_0x4b3c88=_0x5d13cc['get'](_0x368386);_0x4b3c88&&(_0x431a3e[_0x3bbc34(0x29a)]=_0x4b3c88);}}if(_0x431a3e['type']==='DecisionPoint'&&_0x431a3e[_0x3bbc34(0x2b6)]&&_0x11daed?.[_0x3bbc34(0x2b6)])for(let _0x5d525d=0x0;_0x5d525d<_0x431a3e['branches'][_0x3bbc34(0x1e6)];_0x5d525d++){const _0x4cdb83=_0x431a3e[_0x3bbc34(0x2b6)][_0x5d525d],_0x1ca288=_0x11daed[_0x3bbc34(0x2b6)][_0x5d525d];if(_0x1ca288?.[_0x3bbc34(0x279)]&&isPendingSegmentId(_0x1ca288[_0x3bbc34(0x279)])){const _0x5e87ac=_0x567d99(_0x1ca288[_0x3bbc34(0x279)],'stage\x20\x27'+_0x1a3f00['name']+_0x3bbc34(0x21b)+(_0x4cdb83[_0x3bbc34(0x1c9)]||_0x5d525d)+'\x27');_0x5e87ac&&(_0x4cdb83[_0x3bbc34(0x279)]=_0x5e87ac);}}_0x431a3e[_0x3bbc34(0x25e)]===_0x3bbc34(0x1d3)&&_0x11daed?.[_0x3bbc34(0x25e)]==='WaitStep'&&resolveWaitStepPendingIds(_0x431a3e,_0x11daed,_0x567d99,_0x1a3f00[_0x3bbc34(0x1c9)]);}}}}
|
|
1
|
+
const a140_0x374048=a140_0x2c7d;(function(_0x21e175,_0x5865a2){const _0x2e2ffb=a140_0x2c7d,_0x2bd042=_0x21e175();while(!![]){try{const _0x5aef74=-parseInt(_0x2e2ffb(0x1d8))/0x1+parseInt(_0x2e2ffb(0x164))/0x2+-parseInt(_0x2e2ffb(0x1de))/0x3+-parseInt(_0x2e2ffb(0x230))/0x4*(-parseInt(_0x2e2ffb(0x21a))/0x5)+-parseInt(_0x2e2ffb(0x233))/0x6+parseInt(_0x2e2ffb(0x221))/0x7+-parseInt(_0x2e2ffb(0x200))/0x8*(parseInt(_0x2e2ffb(0x154))/0x9);if(_0x5aef74===_0x5865a2)break;else _0x2bd042['push'](_0x2bd042['shift']());}catch(_0x3ab103){_0x2bd042['push'](_0x2bd042['shift']());}}}(a140_0x2544,0x56698));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a140_0x374048(0x1cb));export const PENDING_SEGMENT_PREFIX=a140_0x374048(0x1a8);export const PENDING_ACTIVATION_PREFIX=a140_0x374048(0x190);export function createPendingSegmentId(_0x3adffd){return''+PENDING_SEGMENT_PREFIX+_0x3adffd+'__';}export function isPendingSegmentId(_0xa0b652){const _0x333615=a140_0x374048;return _0xa0b652[_0x333615(0x234)](PENDING_SEGMENT_PREFIX)&&!_0xa0b652['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1a50be){const _0x27be2f=a140_0x374048;return _0x1a50be[_0x27be2f(0x202)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x50c777){return''+PENDING_ACTIVATION_PREFIX+_0x50c777+'__';}export function isPendingActivationId(_0x3f0cc6){const _0x484d7f=a140_0x374048;return _0x3f0cc6[_0x484d7f(0x234)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4f4870){const _0xb9b8e2=a140_0x374048;return _0x4f4870[_0xb9b8e2(0x202)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x54ed6c,_0x5f5c4a){const _0x3a6f2e=a140_0x374048,_0x1d77c9=_0x54ed6c+'::'+(_0x5f5c4a[_0x3a6f2e(0x170)]()||_0x3a6f2e(0x1aa)),_0x357cdb=createHash(_0x3a6f2e(0x191))[_0x3a6f2e(0x177)](_0x1d77c9)['digest'](_0x3a6f2e(0x22b))[_0x3a6f2e(0x189)](0x0,0xc);return _0x3a6f2e(0x1dd)+_0x357cdb;}export function ensureJourneyDefaults(_0x41c742){const _0x31e8a9=a140_0x374048;!_0x41c742[_0x31e8a9(0x1f9)]&&(_0x41c742[_0x31e8a9(0x1f9)]=''),!_0x41c742['state']&&(_0x41c742[_0x31e8a9(0x1ba)]=_0x31e8a9(0x167));}export function injectExistingStageIds(_0x1b51a0,_0x5bb971){const _0x33b647=a140_0x374048,_0x4b3bdc=new Map(_0x5bb971[_0x33b647(0x197)](_0x36038b=>[_0x36038b[_0x33b647(0x1f7)],_0x36038b['id']]));for(const _0x1f97b9 of _0x1b51a0){if(!_0x1f97b9['id']){const _0x2fcd36=_0x4b3bdc['get'](_0x1f97b9[_0x33b647(0x1f7)]);_0x2fcd36&&(_0x1f97b9['id']=_0x2fcd36);}}}export function resolveTDFolderPath(_0x2e9770,_0x3b6591,_0xa41fe){if(!_0x3b6591)return _0x2e9770;if(_0x2e9770===_0xa41fe||_0x2e9770['startsWith'](_0xa41fe+'/'))return _0x2e9770;return _0x2e9770?_0xa41fe+'/'+_0x2e9770:_0xa41fe;}export function addFoldersToCreate(_0x5816,_0x5efbf3,_0x4390db){const _0x100dd3=a140_0x374048;if(!_0x5816)return;if(_0x5efbf3['has'](_0x5816))return;const _0x3dd886=_0x5816[_0x100dd3(0x1a4)]('/');let _0x52f2e1='';for(const _0x3fd2e1 of _0x3dd886){_0x52f2e1=_0x52f2e1?_0x52f2e1+'/'+_0x3fd2e1:_0x3fd2e1,!_0x5efbf3[_0x100dd3(0x204)](_0x52f2e1)&&_0x4390db[_0x100dd3(0x231)](_0x52f2e1);}}export function sortFoldersByDepth(_0x5b50ea){const _0x4a4845=a140_0x374048;return[..._0x5b50ea][_0x4a4845(0x19c)]((_0x1a40b3,_0x2c97d8)=>{const _0x2d9789=_0x4a4845,_0x97c6e4=(_0x1a40b3[_0x2d9789(0x192)](/\//g)||[])[_0x2d9789(0x175)],_0x886e71=(_0x2c97d8[_0x2d9789(0x192)](/\//g)||[])[_0x2d9789(0x175)];return _0x97c6e4-_0x886e71;});}import*as a140_0x3d0ce6 from'yaml';import{readFileSync}from'fs';import a140_0x20c889 from'path';import{isJourneyDef,parseYamlString as a140_0x5503f4,toYamlString as a140_0x4660f1,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';function a140_0x2544(){const _0x15be30=['\x27...','741160ieXJRO','existingActivation','create','index','stringify','segment_updating','Created\x20journey\x20\x27','1641444JfkhGB','exitCriterias','embeddedSegmentNameToId','getSegmentEntity','entries','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','toLowerCase','yamlActivation','buildUserMaps','withProgress','hex','SEGMENT_NOT_FOUND','folder_creating','entry','\x0a\x20\x20','16ZuhbGu','add','connection','3487848xyVEBB','startsWith','object','getSegment\x20failed\x20for\x20','yamlConfig','Delete\x20the\x20push\x20recovery\x20file\x20(','journeyBundleName','listActivations','segmentId','notification','getSegment','activation_deleting','createSegment','parseDocument','segmentNameToId','versionNumber','./child-segment-yaml.js','null','logWarning','segmentByFolderAndName','columns','debug','createdSegmentIds','from','waitStepType','list','Journey\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','segment_deleting','SEGMENT_UPDATE_ERROR','deleted','all_columns','parentId','\x20journey\x20from\x20file:\x20','Created\x20segment\x20\x27','\x27\x20entry\x20criteria','createdSegmentId','Segment\x20not\x20found:\x20','3897sRkYAu','Creating\x20segment\x20\x27','Updated\x20activation\x20\x27','deleteSegment','ACTIVATION_UPDATE_ERROR','unchanged','valid','dirname','getLatestJourneyId','segmentFolderId','journeyId','logInfo','Failed\x20to\x20','uniqueServerName','relationships','idToEmailMap','1106046GtlTEA','conditionTimeoutDuration','Matched\x20server\x20segment\x20\x27','draft','filter','connectionIdToNameMap','activation_creating','createActivation','activationStepsById','folder','reduce','\x20segment\x20from\x20file:\x20','trim','journeyById','idToName','stages','activationsBySegmentId','length','user','update','existingSegments','journey_created','rule','\x27\x20by\x20rule\x20content','updateActivation','behavior','resolveSegment','segment_creating','segment_created','updated','embedded_activation_creating','NOT_FOUND','journeyActivationStepId','\x27\x20exit\x20criteria','embedded_segment_created','folderPathToId','segment_updated','slice','goal\x20criteria','activationContext','values','\x27\x20wait\x20condition','parentFolder','journeyBundleId','__pending_act_','sha1','match','nameToId','createJourneySegment','hasChanges','\x27\x20to\x20local\x20\x27','map','journeyBundlesByFolderAndName','updateSegmentById','):\x20','Updating\x20activation\x20\x27','sort','journeyName','stage\x20\x27','getSegmentEntity\x20also\x20failed\x20for\x20','rootFolderId','toString','parse','size','split','folderId','activations','find','__pending_','conditionSegmentId','segment','\x20(referenced\x20in\x20journey\x20','Fetching\x20','attributes','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','push','isNew','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Failed\x20to\x20resolve\x20activation\x20','toISOString','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','max','keys','folder_created','and\x20the\x20server\x20segment,\x20then\x20retry.','state','verbose','nameToType','journey_updated','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Failed\x20to\x20resolve\x20segment\x20','steps','journey_updating','DecisionPoint','delete','INTERNAL','journey_creating','set','conditionTimeoutUnit','journeyStages','journeys','validatedRequest','tdx.sdk.push-workflow','logDeleted','run_after_journey_refresh','Segment\x20not\x20found','activationActions','onProgress','relative','entryCriteria','Deleted\x20activation\x20\x27','message','createFolder','Creating\x20folder\x20\x27','./journey-yaml.js','228494bMbrPa','join','Created\x20activation\x20\x27','waitStepUnit','schedule','journey_entry_criteria_','147378hiemgS','data','activation_','existingJourney','\x27\x20for\x20','segment_deleted','Created\x20folder\x20\x27','segments','Updated\x20journey\x20\x27','../../utils/async.js','utf-8',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','getJourney','Stage\x20\x27','isArray','uniqueSegmentName','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','activationParams','type','WaitStep','deps','Deleting\x20activation\x20\x27','Condition','conditions','item','name',').\x20','description','deleteActivation','action','Activation','activation_created','Creating\x20activation\x20\x27','journey','3096waTiwR','Entry\x20criteria:\x20','replace','get','has','entry_criteria','Embedded\x20segment\x20\x27','\x20error(s)','folderPath','resolvedRule','goal','branches','created','Activation\x20not\x20found:\x20','\x27\x20decision\x20point\x20branch\x20\x27','logSuccess','some','absolutePath','journeyActivationNameToId','embedded_segment_creating','progress','milestone','existingSegment','waitStep','localName'];a140_0x2544=function(){return _0x15be30;};return a140_0x2544();}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(_0x3d7fd6){const _0x13ae6e=a140_0x374048;if(Array[_0x13ae6e(0x1ec)](_0x3d7fd6))return'['+_0x3d7fd6[_0x13ae6e(0x197)](_0xf0080d=>stableStringify(_0xf0080d))['join'](',')+']';if(_0x3d7fd6&&typeof _0x3d7fd6===_0x13ae6e(0x235)){const _0x4a8719=_0x3d7fd6,_0x105c64=Object[_0x13ae6e(0x1b7)](_0x4a8719)[_0x13ae6e(0x19c)](),_0x4fabd9=_0x105c64[_0x13ae6e(0x197)](_0x270dba=>'\x22'+_0x270dba+'\x22:'+stableStringify(_0x4a8719[_0x270dba]));return'{'+_0x4fabd9[_0x13ae6e(0x1d9)](',')+'}';}const _0x3d9d10=JSON['stringify'](_0x3d7fd6);return _0x3d9d10===undefined?_0x13ae6e(0x13f):_0x3d9d10;}function activationSignature(_0x2cf556){const _0x4ec948=a140_0x374048,_0x29483a={'connection':_0x2cf556[_0x4ec948(0x232)],..._0x2cf556[_0x4ec948(0x14d)]!==undefined&&{'all_columns':_0x2cf556[_0x4ec948(0x14d)]},..._0x2cf556[_0x4ec948(0x142)]!==undefined&&{'columns':_0x2cf556['columns']},..._0x2cf556[_0x4ec948(0x17d)]!==undefined&&{'behavior':_0x2cf556[_0x4ec948(0x17d)]},..._0x2cf556[_0x4ec948(0x1dc)]!==undefined&&{'schedule':_0x2cf556['schedule']},..._0x2cf556[_0x4ec948(0x23c)]!==undefined&&{'notification':_0x2cf556[_0x4ec948(0x23c)]},..._0x2cf556['connector_config']!==undefined&&{'connector_config':_0x2cf556['connector_config']},..._0x2cf556['activation_template_id']!==undefined&&{'activation_template_id':_0x2cf556['activation_template_id']}};return stableStringify(_0x29483a);}async function fetchSegment(_0x2f1d15,_0x4e99db,_0x438651,_0x56366f){const _0x68aafe=a140_0x374048,_0x316e0b=_0x56366f?.[_0x68aafe(0x1a7)](_0x597340=>_0x597340['id']===_0x438651);if(_0x316e0b)return _0x316e0b;try{return await _0x2f1d15[_0x68aafe(0x1aa)][_0x68aafe(0x23d)](_0x4e99db,_0x438651);}catch(_0x491351){logger[_0x68aafe(0x143)](_0x68aafe(0x236)+_0x438651+_0x68aafe(0x1e9)+_0x491351);try{return await _0x2f1d15[_0x68aafe(0x1aa)][_0x68aafe(0x224)](_0x438651);}catch(_0x4186e0){return logger[_0x68aafe(0x143)](_0x68aafe(0x19f)+_0x438651+':\x20'+_0x4186e0),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5a9ced,_0x360254,_0x3c8349){const _0x43fd89=a140_0x374048,_0x47b5e1=readPushRecovery(_0x5a9ced[_0x43fd89(0x211)]);if(_0x47b5e1?.['journeyName']===_0x5a9ced['yamlConfig']['name'])for(const [_0x2bff25,_0x96f308]of Object[_0x43fd89(0x225)](_0x47b5e1['segments'])){const _0x8dc3a7=generateDeterministicJourneySegmentName(_0x5a9ced[_0x43fd89(0x237)][_0x43fd89(0x1f7)],_0x2bff25);_0x96f308[_0x43fd89(0x161)]===_0x8dc3a7&&(_0x360254[_0x43fd89(0x1c6)](_0x2bff25,_0x96f308[_0x43fd89(0x23b)]),_0x3c8349['set'](_0x2bff25,_0x96f308[_0x43fd89(0x23b)]));}}async function createOrRecoverEmbeddedSegment(_0x3fb5cd,_0x5ccd87,_0x3b1e19,_0x19f341){const _0x23f721=a140_0x374048;let _0x30bb6b;try{_0x30bb6b=await _0x3fb5cd[_0x23f721(0x1aa)][_0x23f721(0x194)]({'name':_0x3b1e19[_0x23f721(0x1ed)],'description':_0x3b1e19[_0x23f721(0x1f9)],'journeyId':_0x3b1e19[_0x23f721(0x15e)],'rule':_0x19f341(_0x3b1e19['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x3b1e19[_0x23f721(0x1a5)],'audienceId':_0x3b1e19[_0x23f721(0x14e)]});}catch(_0x29675f){const _0x18d8a0=_0x29675f instanceof Error&&_0x29675f[_0x23f721(0x1d4)]['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x18d8a0){const _0x5040d6=readPushRecovery(_0x5ccd87[_0x23f721(0x211)]),_0x534797=_0x5040d6?.[_0x23f721(0x19d)]===_0x5ccd87[_0x23f721(0x237)][_0x23f721(0x1f7)]?_0x5040d6[_0x23f721(0x1e5)][_0x3b1e19[_0x23f721(0x218)]]:undefined;if(_0x534797?.[_0x23f721(0x161)]===_0x3b1e19['uniqueSegmentName'])await _0x3fb5cd[_0x23f721(0x1aa)][_0x23f721(0x199)](_0x3b1e19['parentId'],_0x534797[_0x23f721(0x23b)],{'description':_0x3b1e19[_0x23f721(0x1f9)],'rule':_0x19f341(_0x3b1e19[_0x23f721(0x209)],!![]),'countPopulation':!![]}),_0x30bb6b=_0x534797[_0x23f721(0x23b)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x23f721(0x206)+_0x3b1e19[_0x23f721(0x218)]+_0x23f721(0x1be)+(_0x23f721(0x238)+_0x5ccd87[_0x23f721(0x211)]['replace'](/([^/]+)$/,'.$1.push-recovery.json')+')\x20')+_0x23f721(0x1b9),_0x29675f);}else throw _0x29675f;}return saveSegmentToPushRecovery(_0x5ccd87[_0x23f721(0x211)],_0x5ccd87['yamlConfig'][_0x23f721(0x1f7)],_0x3b1e19[_0x23f721(0x218)],{'segmentId':_0x30bb6b,'uniqueServerName':_0x3b1e19[_0x23f721(0x1ed)],'createdAt':new Date()[_0x23f721(0x1b4)]()}),_0x30bb6b;}export async function prepareSegmentFiles(_0x426204,_0x3ff695,_0x29c521,_0x422133,_0x32e543){const _0x5b1ae0=a140_0x374048,{activationDefToCreateRequest:_0x21be86}=await import(_0x5b1ae0(0x13e)),_0x609745=[],_0x9d4d9=new Set();for(const {yamlConfig:_0x21ddf3,folderPath:_0x305803,sourcePath:_0x180bc8}of _0x426204){const _0x1cebdf=resolveTDFolderPath(_0x305803,_0x422133,_0x32e543),_0xc93fbe=_0x1cebdf+':'+_0x21ddf3[_0x5b1ae0(0x1f7)],_0x4846f7=_0x3ff695[_0x5b1ae0(0x141)]['get'](_0xc93fbe),_0x8f360b=_0x4846f7?_0x3ff695[_0x5b1ae0(0x174)][_0x5b1ae0(0x203)](_0x4846f7['id'])||[]:[];addFoldersToCreate(_0x1cebdf,_0x3ff695['folderPathToId'],_0x9d4d9);const _0x2513d8=calculateActivationActions(_0x21ddf3[_0x5b1ae0(0x1a6)]||[],_0x8f360b,_0x3ff695['idToEmailMap'],_0x3ff695[_0x5b1ae0(0x169)]);for(const _0x2bde9c of _0x2513d8){(_0x2bde9c[_0x5b1ae0(0x1f0)]===_0x5b1ae0(0x21c)||_0x2bde9c[_0x5b1ae0(0x1f0)]==='update')&&_0x2bde9c['yamlActivation']&&(_0x2bde9c['validatedRequest']=await _0x21be86(_0x2bde9c[_0x5b1ae0(0x228)],_0x29c521));}const _0x339d40=calculateSegmentDiff(_0x21ddf3,_0x4846f7,_0x8f360b,_0x3ff695[_0x5b1ae0(0x163)],_0x3ff695['connectionIdToNameMap']);_0x609745[_0x5b1ae0(0x1b0)]({'relativePath':_0x21ddf3['name'],'absolutePath':_0x180bc8,'yamlConfig':_0x21ddf3,'folderPath':_0x1cebdf,'existingSegment':_0x4846f7,'existingActivations':_0x8f360b,'isNew':_0x339d40[_0x5b1ae0(0x1b1)],'hasChanges':_0x339d40[_0x5b1ae0(0x195)],'diff':_0x339d40['diff'],'activationActions':_0x2513d8});}return{'segmentFiles':_0x609745,'foldersToCreate':_0x9d4d9};}export async function prepareJourneyFiles(_0x5ec2e9,_0x18ebb0,_0x252a93,_0x1f6625){const _0x23918c=a140_0x374048,_0x56cc95=[],_0x5cf9ff=new Set();for(const {yamlConfig:_0x3137f5,folderPath:_0x2fbf89,sourcePath:_0x526fb2}of _0x5ec2e9){const _0x4057db=resolveTDFolderPath(_0x2fbf89,_0x252a93,_0x1f6625),_0x117d96=_0x4057db+':'+_0x3137f5[_0x23918c(0x1f7)],_0x32f84e=_0x18ebb0[_0x23918c(0x198)][_0x23918c(0x203)](_0x117d96);let _0x3f2b82,_0x1f0617;if(_0x32f84e&&_0x32f84e['length']>0x0){const _0x119789=buildLocalExpandedRuleMappings(_0x3137f5),{createYamlContext:_0x2b1a07,prefetchJourneySegments:_0x1e94e1}=createPushYamlContextForBundle(_0x18ebb0[_0x23918c(0x1f2)],_0x18ebb0['parentId'],_0x18ebb0[_0x23918c(0x178)],_0x119789,_0x18ebb0[_0x23918c(0x163)],_0x18ebb0[_0x23918c(0x169)],_0x18ebb0[_0x23918c(0x16c)],_0x18ebb0[_0x23918c(0x171)]);await _0x1e94e1(_0x32f84e[_0x23918c(0x197)](_0x194d3a=>_0x194d3a['id']));const _0x5ef035=await _0x18ebb0[_0x23918c(0x1f2)][_0x23918c(0x1ff)][_0x23918c(0x15c)](_0x32f84e[0x0][_0x23918c(0x18f)]),_0x4af39e=hasMultipleVersions(_0x3137f5),_0x300952=async _0xf2ca1c=>{const _0x3a722e=_0x23918c,_0x1e9f33=_0x18ebb0[_0x3a722e(0x171)]?.[_0x3a722e(0x203)](_0xf2ca1c);if(_0x1e9f33)return _0x1e9f33;return _0x18ebb0['fetchJourney']({'journeyId':_0xf2ca1c,'journeyName':_0x3137f5[_0x3a722e(0x1f7)],'isMultiVersion':_0x32f84e[_0x3a722e(0x175)]>0x1});};if(_0x4af39e&&_0x32f84e[_0x23918c(0x175)]>0x1){const _0x43c293=[];for(const _0x3ef09e of _0x32f84e){const _0x337fff=_0x3ef09e[_0x23918c(0x13d)]||0x1;_0x18ebb0[_0x23918c(0x214)]?.[_0x23918c(0x177)](_0x23918c(0x1ac)+_0x3137f5[_0x23918c(0x1f7)]+'\x20v'+_0x337fff);const _0xd3df68=await _0x300952(_0x3ef09e['id']),_0x11623b=_0x2b1a07(_0x3ef09e['id']),_0x447d21=await journeyResponseToDef(_0xd3df68,_0x11623b);_0x43c293[_0x23918c(0x1b0)]({'item':_0x3ef09e,'yaml':_0x447d21});}const _0x338a2a=buildLocalRuleToNameMappingFromJourney(_0x3137f5);_0x1f0617=buildMergedJourneyDef(_0x43c293,_0x338a2a,_0x5ef035);const _0x5d09e3=Math['max'](..._0x43c293[_0x23918c(0x197)](_0x4bca72=>_0x4bca72[_0x23918c(0x1f6)][_0x23918c(0x13d)]||0x0)),_0x2abc5d=_0x32f84e['find'](_0x419c93=>(_0x419c93[_0x23918c(0x13d)]||0x0)===_0x5d09e3);_0x2abc5d&&(_0x18ebb0[_0x23918c(0x214)]?.[_0x23918c(0x177)](_0x23918c(0x1ac)+_0x3137f5['name']+'\x20v'+_0x5d09e3),_0x3f2b82=await _0x300952(_0x2abc5d['id']));}else{const _0x3765dc=_0x32f84e[_0x32f84e[_0x23918c(0x175)]-0x1];_0x18ebb0[_0x23918c(0x214)]?.[_0x23918c(0x177)]('Fetching\x20'+_0x3137f5[_0x23918c(0x1f7)]),_0x3f2b82=await _0x300952(_0x3765dc['id']);const _0x37837=_0x2b1a07(_0x3765dc['id']),_0x12b4d7=await journeyResponseToDef(_0x3f2b82,_0x37837),_0x1eb122=buildLocalRuleToNameMappingFromJourney(_0x3137f5);_0x1f0617=buildMergedJourneyDef([{'item':_0x3765dc,'yaml':_0x12b4d7}],_0x1eb122,_0x5ef035);}}addFoldersToCreate(_0x4057db,_0x18ebb0[_0x23918c(0x187)],_0x5cf9ff);const _0x2f6399=calculateJourneyDiff(_0x3137f5,_0x1f0617);_0x56cc95['push']({'relativePath':_0x3137f5[_0x23918c(0x1f7)],'absolutePath':_0x526fb2,'yamlConfig':_0x3137f5,'folderPath':_0x4057db,'existingJourney':_0x3f2b82,'isNew':_0x2f6399[_0x23918c(0x1b1)],'hasChanges':_0x2f6399[_0x23918c(0x195)],'diff':_0x2f6399['diff']});}return{'journeyFiles':_0x56cc95,'foldersToCreate':_0x5cf9ff};}export function calculateActivationActions(_0x261fe6,_0x3d590c,_0x801d5d,_0xced7f6){const _0x33e477=a140_0x374048,_0x218da9=[],_0x482fa7=new Map();for(const _0x49745f of _0x3d590c){_0x482fa7[_0x33e477(0x1c6)](_0x49745f[_0x33e477(0x1f7)],_0x49745f);}const _0x9ede6a=new Map();for(const _0x6626d of _0x261fe6){_0x9ede6a[_0x33e477(0x1c6)](_0x6626d[_0x33e477(0x1f7)],_0x6626d);}for(const _0x597e81 of _0x261fe6){const _0x2028a4=_0x482fa7['get'](_0x597e81[_0x33e477(0x1f7)]);if(!_0x2028a4)_0x218da9[_0x33e477(0x1b0)]({'type':'create','name':_0x597e81[_0x33e477(0x1f7)],'yamlActivation':_0x597e81});else{const _0x12a2e4=activationResponseToDef(_0x2028a4,_0x801d5d,_0xced7f6),_0x5131d1=a140_0x3d0ce6['stringify'](_0x12a2e4),_0x556926=a140_0x3d0ce6[_0x33e477(0x21e)](_0x597e81);_0x5131d1!==_0x556926&&_0x218da9[_0x33e477(0x1b0)]({'type':_0x33e477(0x177),'name':_0x597e81[_0x33e477(0x1f7)],'yamlActivation':_0x597e81,'existingActivation':_0x2028a4});}}for(const _0x21ea94 of _0x3d590c){!_0x9ede6a[_0x33e477(0x204)](_0x21ea94[_0x33e477(0x1f7)])&&_0x218da9[_0x33e477(0x1b0)]({'type':_0x33e477(0x1c3),'name':_0x21ea94['name'],'existingActivation':_0x21ea94});}return _0x218da9;}function calculateYamlDiff(_0x4b29c2,_0x2f06b1){if(_0x2f06b1){const _0x2a01ef=generateDiff(_0x2f06b1,_0x4b29c2),_0x163c37=hasChanges(_0x2a01ef);return{'isNew':![],'hasChanges':_0x163c37,'diff':_0x163c37?formatDiffWithColors(_0x2a01ef):undefined};}const _0xb7125b=generateDiff('',_0x4b29c2);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb7125b)};}export function calculateSegmentDiff(_0x37154e,_0x50deca,_0x3cf8b4,_0x16948b,_0x25f23e){const _0x40d361=segmentToYamlString(_0x37154e),_0x3929af=_0x50deca?segmentToYamlString(segmentWithActivationsToYaml(_0x50deca,_0x3cf8b4,undefined,_0x16948b,_0x25f23e)):undefined;return calculateYamlDiff(_0x40d361,_0x3929af);}export function calculateJourneyDiff(_0x1da856,_0x1bb35c){const _0x226337=normalizeJourneyDef(_0x1da856,_0x1da856),_0x47e156=a140_0x4660f1(_0x226337),_0x943a63=_0x1bb35c?a140_0x4660f1(normalizeJourneyDef(_0x1bb35c,_0x1da856)):undefined;return calculateYamlDiff(_0x47e156,_0x943a63);}export function findSegmentsToDelete(_0x4a7395,_0x3162b6,_0x341e42,_0x241e51,_0xd9540d){const _0x39a78d=a140_0x374048,_0x503918=new Set();for(const {yamlConfig:_0x54fefe,folderPath:_0x2985c1}of _0x3162b6){_0x503918[_0x39a78d(0x231)](_0x2985c1+':'+_0x54fefe[_0x39a78d(0x1f7)]);}return _0x4a7395['filter'](_0x5ee197=>{const _0x120749=_0x39a78d,_0x4e006b=_0x5ee197[_0x120749(0x15d)]?_0x341e42[_0x120749(0x203)](_0x5ee197[_0x120749(0x15d)]['toString']())||'':'',_0x329ed7=_0x4e006b+':'+_0x5ee197[_0x120749(0x1f7)];if(_0x503918[_0x120749(0x204)](_0x329ed7))return![];if(_0xd9540d)return _0x4e006b===_0x241e51||_0x4e006b[_0x120749(0x234)](_0x241e51+'/');return!![];});}export function findJourneysToDelete(_0x434026,_0x557aee,_0x48714a,_0x252120,_0x5ec023){const _0x46a7e7=a140_0x374048,_0x4926fb=new Set();for(const {yamlConfig:_0x1af39c,folderPath:_0x13595c}of _0x557aee){_0x4926fb[_0x46a7e7(0x231)](_0x13595c+':'+_0x1af39c[_0x46a7e7(0x1f7)]);}return _0x434026[_0x46a7e7(0x168)](_0x54671a=>{const _0x14682c=_0x46a7e7,_0x59b2f1=_0x54671a[_0x14682c(0x1a5)]?_0x48714a[_0x14682c(0x203)](_0x54671a['folderId'])||'':'',_0x2a5fb0=_0x59b2f1+':'+_0x54671a[_0x14682c(0x239)];if(_0x4926fb['has'](_0x2a5fb0))return![];if(_0x5ec023)return _0x59b2f1===_0x252120||_0x59b2f1[_0x14682c(0x234)](_0x252120+'/');return!![];});}export function buildSegmentLookupMap(_0x49f75d,_0x77fe91){const _0xc243fc=a140_0x374048,_0x2f243d=new Map();for(const _0x1ff315 of _0x49f75d){const _0x210050=_0x1ff315[_0xc243fc(0x15d)]?_0x77fe91[_0xc243fc(0x203)](_0x1ff315[_0xc243fc(0x15d)][_0xc243fc(0x1a1)]())||'':'',_0x4906d7=_0x210050+':'+_0x1ff315[_0xc243fc(0x1f7)];_0x2f243d['set'](_0x4906d7,_0x1ff315);}return _0x2f243d;}export function buildSegmentNameToIdMap(_0x1d7cfe){const _0x214d0b=a140_0x374048,_0x2a4fee=new Map();for(const _0x13d42f of _0x1d7cfe){_0x2a4fee[_0x214d0b(0x1c6)](_0x13d42f[_0x214d0b(0x1f7)],_0x13d42f['id']);}return _0x2a4fee;}export function buildJourneyBundleLookupMap(_0x3c52de,_0x25f5f8){const _0xf193cb=a140_0x374048,_0x616b5f=new Map();for(const _0x5cbde8 of _0x3c52de){const _0x214b26=_0x5cbde8[_0xf193cb(0x1a5)]?_0x25f5f8['get'](_0x5cbde8[_0xf193cb(0x1a5)])||'':'',_0x54c0c3=_0x214b26+':'+_0x5cbde8[_0xf193cb(0x239)];!_0x616b5f['has'](_0x54c0c3)&&_0x616b5f[_0xf193cb(0x1c6)](_0x54c0c3,[]),_0x616b5f[_0xf193cb(0x203)](_0x54c0c3)[_0xf193cb(0x1b0)](_0x5cbde8);}for(const _0x36a8b4 of _0x616b5f[_0xf193cb(0x18c)]()){_0x36a8b4[_0xf193cb(0x19c)]((_0x3609ca,_0x40b118)=>(_0x3609ca[_0xf193cb(0x13d)]||0x0)-(_0x40b118[_0xf193cb(0x13d)]||0x0));}return _0x616b5f;}export function collectFoldersToCreate(_0x39de9b,_0x636136){const _0x495be3=a140_0x374048,_0x19fc88=new Set();for(const _0x24f6e8 of _0x39de9b){if(!_0x24f6e8)continue;if(_0x636136[_0x495be3(0x204)](_0x24f6e8))continue;const _0x4cd2c5=_0x24f6e8['split']('/');let _0x2ef937='';for(const _0x3d42a9 of _0x4cd2c5){_0x2ef937=_0x2ef937?_0x2ef937+'/'+_0x3d42a9:_0x3d42a9,!_0x636136['has'](_0x2ef937)&&_0x19fc88['add'](_0x2ef937);}}return _0x19fc88;}export function parseAndClassifyYamlFiles(_0x684455,_0x25a548,_0xf510d){const _0x282121=a140_0x374048,_0x2a1366=[],_0x26cffc=[];for(const _0x30855a of _0x684455){const _0x427efc=a140_0x20c889[_0x282121(0x1d1)](_0x25a548,a140_0x20c889[_0x282121(0x15b)](_0x30855a)),_0x521104=_0x427efc==='.'?'':_0x427efc,_0x271a8d=readFileSync(_0x30855a,_0x282121(0x1e8)),_0x3ec4c7=a140_0x3d0ce6['parse'](_0x271a8d);if(isJourneyDef(_0x3ec4c7)){const _0x51f8a8=a140_0x5503f4(_0x271a8d);_0x26cffc['push']({'yamlConfig':_0x51f8a8,'folderPath':_0x521104,'sourcePath':_0x30855a});}else{if(!_0xf510d?.['skipSegments']){const _0x44f387=parseSegmentYamlFile(_0x271a8d),_0x394629=normalizeChildSegmentYaml(_0x44f387);_0x2a1366[_0x282121(0x1b0)]({'yamlConfig':_0x394629,'folderPath':_0x521104,'sourcePath':_0x30855a});}}}return{'segments':_0x2a1366,'journeys':_0x26cffc};}export function validateParsedFiles(_0x282a56,_0x5785dc){const _0x4e5e34=a140_0x374048,_0x176a31=[];for(const {yamlConfig:_0x120e0f,sourcePath:_0x4b15bf}of _0x282a56[_0x4e5e34(0x1e5)]){const _0x524edf=readFileSync(_0x4b15bf,'utf-8'),_0x42540d=a140_0x3d0ce6[_0x4e5e34(0x13b)](_0x524edf),_0x1d369a=validateSegmentDef(_0x120e0f,{'source':_0x524edf,'document':_0x42540d},{'skipSchema':!![]});if(!_0x1d369a[_0x4e5e34(0x15a)]){const _0x4b05b0=a140_0x20c889[_0x4e5e34(0x1d1)](_0x5785dc,_0x4b15bf);_0x176a31[_0x4e5e34(0x1b0)]({'filePath':_0x4b05b0,'source':_0x524edf,'result':_0x1d369a,'isJourney':![]});}}for(const {yamlConfig:_0x43e49a,sourcePath:_0x2fe883}of _0x282a56[_0x4e5e34(0x1c9)]){const _0x32477c=readFileSync(_0x2fe883,_0x4e5e34(0x1e8)),_0x5cb7dd=a140_0x3d0ce6[_0x4e5e34(0x13b)](_0x32477c),_0x467b27=validateJourneyDef(_0x43e49a,{'source':_0x32477c,'document':_0x5cb7dd},{'skipSchema':!![]});if(!_0x467b27[_0x4e5e34(0x15a)]){const _0x274954=a140_0x20c889[_0x4e5e34(0x1d1)](_0x5785dc,_0x2fe883);_0x176a31[_0x4e5e34(0x1b0)]({'filePath':_0x274954,'source':_0x32477c,'result':_0x467b27,'isJourney':!![]});}}return _0x176a31;}export function formatValidationErrors(_0x235193){const _0x581eac=a140_0x374048,_0x5cc7e6=[];for(const {filePath:_0x35aa31,source:_0x5b8516,result:_0x3f0be2,isJourney:_0x14a17c}of _0x235193){const _0x7b5444=_0x14a17c?_0x581eac(0x1ff):_0x581eac(0x1aa);_0x5cc7e6['push']('\x0a'+_0x35aa31+'\x20('+_0x7b5444+_0x581eac(0x19a)+_0x3f0be2['errors'][_0x581eac(0x175)]+_0x581eac(0x207)),_0x5cc7e6[_0x581eac(0x1b0)](formatValidationResult(_0x3f0be2,_0x5b8516,_0x35aa31));}return _0x5cc7e6[_0x581eac(0x1d9)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x2443ff){const _0x49f5bd=a140_0x374048,_0x3bcf4f=new Set(),_0x3227f5=new Map(),_0x439ff4=collectSegmentUsageCounts(_0x2443ff);if(_0x2443ff[_0x49f5bd(0x1e5)])for(const [_0x252379,_0x357ab5]of Object[_0x49f5bd(0x225)](_0x2443ff[_0x49f5bd(0x1e5)])){_0x3bcf4f[_0x49f5bd(0x231)](_0x252379);if(_0x357ab5[_0x49f5bd(0x17a)]){const _0x3bd080=yamlRuleToApi(_0x357ab5[_0x49f5bd(0x17a)]),_0x3cd8aa=apiRuleToYaml(_0x3bd080);_0x3227f5[_0x49f5bd(0x1c6)](_0x252379,_0x3cd8aa);}}const _0x27d197=new Map();let _0x23d5b3=0x0;for(const [_0x234b1f,_0x55aa7e]of _0x3227f5){const _0x155b6a=serializeExpandedRule(_0x55aa7e,_0x3227f5),_0x3dd754=_0x27d197['get'](_0x155b6a)||[];_0x3dd754[_0x49f5bd(0x1b0)]({'name':_0x234b1f,'index':_0x23d5b3}),_0x27d197[_0x49f5bd(0x1c6)](_0x155b6a,_0x3dd754),_0x23d5b3++;}const _0x4eb854=new Map();for(const [_0x9c3a7b,_0x22780c]of _0x27d197){const _0x30a00a=_0x22780c[_0x49f5bd(0x189)]()[_0x49f5bd(0x19c)]((_0x1fadd6,_0x520729)=>{const _0x1f2e67=_0x49f5bd,_0x486c53=_0x439ff4[_0x1f2e67(0x203)](_0x1fadd6[_0x1f2e67(0x1f7)])||0x0,_0x2395d0=_0x439ff4[_0x1f2e67(0x203)](_0x520729[_0x1f2e67(0x1f7)])||0x0;if(_0x486c53!==_0x2395d0)return _0x2395d0-_0x486c53;return _0x1fadd6[_0x1f2e67(0x21d)]-_0x520729[_0x1f2e67(0x21d)];})[_0x49f5bd(0x197)](_0x2520e4=>_0x2520e4[_0x49f5bd(0x1f7)]),_0x3046ff=[];for(const _0xc81f2b of _0x30a00a){const _0x323f70=_0x439ff4[_0x49f5bd(0x203)](_0xc81f2b)||0x0,_0x44292e=Math[_0x49f5bd(0x1b6)](_0x323f70,0x1);for(let _0x36ca50=0x0;_0x36ca50<_0x44292e;_0x36ca50++){_0x3046ff['push'](_0xc81f2b);}}_0x4eb854[_0x49f5bd(0x1c6)](_0x9c3a7b,_0x3046ff);}return{'existingLocalSegmentNames':_0x3bcf4f,'localSegmentRules':_0x3227f5,'localExpandedRuleToNames':_0x4eb854};}export function createSegmentIdResolver(_0x200979,_0x383f0a){return async _0x3afa24=>{const _0x2aa8d5=a140_0x2c7d,_0x2cbfe6=_0x200979[_0x2aa8d5(0x203)](_0x3afa24);if(!_0x2cbfe6)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x3afa24+_0x2aa8d5(0x149)+_0x383f0a+'\x27)');return _0x2cbfe6;};}export function extractRootFolderId(_0x20d8e2){const _0x3669b3=a140_0x374048;return _0x20d8e2[_0x3669b3(0x162)]?.['parentSegmentFolder']?.[_0x3669b3(0x1df)]?.['id']||_0x20d8e2['relationships']?.[_0x3669b3(0x18e)]?.[_0x3669b3(0x1df)]?.['id'];}export function buildConnectionMaps(_0x3ea5f2){const _0x645c54=a140_0x374048,_0x29485e=new Map(),_0x5ec770=new Map(),_0x212b1c=new Map();for(const _0x420b49 of _0x3ea5f2){_0x29485e[_0x645c54(0x1c6)](_0x420b49[_0x645c54(0x1f7)],parseInt(_0x420b49['id'],0xa)),_0x5ec770['set'](_0x420b49['id'],_0x420b49[_0x645c54(0x1f7)]),_0x212b1c['set'](_0x420b49[_0x645c54(0x1f7)],_0x420b49[_0x645c54(0x1f0)]);}return{'nameToId':_0x29485e,'idToName':_0x5ec770,'nameToType':_0x212b1c};}export function calculatePushStats(_0x1a8a66,_0xee56cf,_0x56c361,_0x31bf29,_0x1ba9d6,_0x51939d,_0x206189){const _0x1c805b=a140_0x374048,_0x1374a6=_0x1a8a66['filter'](_0x1e3087=>_0x1e3087[_0x1c805b(0x1b1)]),_0x333697=_0x1a8a66['filter'](_0x439022=>!_0x439022[_0x1c805b(0x1b1)]&&_0x439022[_0x1c805b(0x195)]),_0x29eb00=_0x1a8a66[_0x1c805b(0x168)](_0x22a325=>!_0x22a325['isNew']&&!_0x22a325[_0x1c805b(0x195)]),_0x53178b=_0x51939d?_0x31bf29:[],_0x284ea2=_0xee56cf[_0x1c805b(0x168)](_0x3d7323=>_0x3d7323[_0x1c805b(0x1b1)]),_0x4680a6=_0xee56cf[_0x1c805b(0x168)](_0x12b254=>!_0x12b254[_0x1c805b(0x1b1)]&&_0x12b254['hasChanges']),_0x56a3c5=_0xee56cf[_0x1c805b(0x168)](_0x4fda2c=>!_0x4fda2c[_0x1c805b(0x1b1)]&&!_0x4fda2c[_0x1c805b(0x195)]),_0x2ea624=_0x51939d?_0x1ba9d6:[],_0x4e128a=_0x1a8a66['flatMap'](_0xa0d89b=>_0xa0d89b[_0x1c805b(0x1cf)]),_0x4833bb=_0x4e128a[_0x1c805b(0x168)](_0xe999cd=>_0xe999cd[_0x1c805b(0x1f0)]===_0x1c805b(0x21c)),_0x38b8f7=_0x4e128a[_0x1c805b(0x168)](_0xdb5229=>_0xdb5229[_0x1c805b(0x1f0)]===_0x1c805b(0x177)),_0x38f169=_0x4e128a['filter'](_0x3bc38b=>_0x3bc38b[_0x1c805b(0x1f0)]===_0x1c805b(0x1c3)),_0x3bedc5=Array[_0x1c805b(0x145)](_0x56c361)['sort'](),_0x40ecfe=_0x206189?![]:_0x1374a6[_0x1c805b(0x175)]>0x0||_0x333697[_0x1c805b(0x175)]>0x0||_0x53178b[_0x1c805b(0x175)]>0x0,_0x1be1c2=_0x284ea2[_0x1c805b(0x175)]>0x0||_0x4680a6[_0x1c805b(0x175)]>0x0||_0x2ea624[_0x1c805b(0x175)]>0x0,_0x43822b=_0x206189?![]:_0x4e128a[_0x1c805b(0x175)]>0x0,_0x4fbc64=_0x3bedc5[_0x1c805b(0x175)]>0x0;return{'segments':{'new':_0x1374a6,'changed':_0x333697,'unchanged':_0x29eb00,'toDelete':_0x53178b},'journeys':{'new':_0x284ea2,'changed':_0x4680a6,'unchanged':_0x56a3c5,'toDelete':_0x2ea624},'activations':{'all':_0x4e128a,'toCreate':_0x4833bb,'toUpdate':_0x38b8f7,'toDelete':_0x38f169},'folders':{'toCreate':_0x3bedc5},'counts':{'segments':{'new':_0x1374a6['length'],'changed':_0x333697[_0x1c805b(0x175)],'unchanged':_0x29eb00[_0x1c805b(0x175)],'toDelete':_0x53178b[_0x1c805b(0x175)]},'journeys':{'new':_0x284ea2[_0x1c805b(0x175)],'changed':_0x4680a6[_0x1c805b(0x175)],'unchanged':_0x56a3c5[_0x1c805b(0x175)],'toDelete':_0x2ea624[_0x1c805b(0x175)]},'activations':{'create':_0x4833bb[_0x1c805b(0x175)],'update':_0x38b8f7[_0x1c805b(0x175)],'delete':_0x38f169[_0x1c805b(0x175)]},'folders':_0x3bedc5[_0x1c805b(0x175)]},'hasChanges':_0x40ecfe||_0x1be1c2||_0x43822b||_0x4fbc64};}export async function buildPushExecutionContext(_0x52a34e,_0x364fe4,_0x525bd0,_0xe017c4,_0x352403,_0x4faa33){const _0x59b332=a140_0x374048,_0x5dbed5=extractRootFolderId(_0x525bd0),{pathToId:_0x11eddc,idToPath:_0x448951}=buildFolderMaps(_0x352403),_0x3b770e=buildSegmentNameToIdMap(_0xe017c4),_0x4d9902=new Map(),{batchAsync:_0x59e9a2}=await import('../../utils/async.js'),[_0x1d9c9a,_0x1743ad]=await Promise['all']([_0x52a34e[_0x59b332(0x176)][_0x59b332(0x229)](),_0x52a34e['connection'][_0x59b332(0x147)](),((async()=>{const _0x179482=_0x59b332;!_0x4faa33&&_0xe017c4[_0x179482(0x175)]>0x0&&await _0x59e9a2(_0xe017c4,async _0x12e7cd=>{const _0x268fd5=_0x179482,_0x23a5e1=await _0x52a34e['segment'][_0x268fd5(0x23a)](_0x364fe4,_0x12e7cd['id']);_0x4d9902[_0x268fd5(0x1c6)](_0x12e7cd['id'],_0x23a5e1);});})())]),{emailToId:_0x2d0a79,idToEmail:_0x41baef}=_0x1d9c9a,_0x52a755=buildConnectionMaps(_0x1743ad);return{'rootFolderId':_0x5dbed5,'folderPathToId':_0x11eddc,'folderIdToPath':_0x448951,'segmentNameToId':_0x3b770e,'activationsBySegmentId':_0x4d9902,'emailToIdMap':_0x2d0a79,'idToEmailMap':_0x41baef,'connectionNameToIdMap':_0x52a755[_0x59b332(0x193)],'connectionIdToNameMap':_0x52a755[_0x59b332(0x172)],'connectionNameToTypeMap':_0x52a755[_0x59b332(0x1bc)]};}export function createPushYamlContextForBundle(_0x117cb2,_0x25ec05,_0x1c6f76,_0x5416a4,_0x223c27,_0x362c25,_0x47e3b4,_0xbe639a){const {existingLocalSegmentNames:_0x51fc5e,localExpandedRuleToNames:_0x1b17b2}=_0x5416a4,_0x54734d=new Set(),_0x5bdaa9=new Map(),_0x4cdc01=new Map(),_0x2406a2=new Map(),_0x4677d7=createJumpTargetCache(),_0x58abd0=new Map(),_0x57a262=new Map(),_0x1fa78f=new Set();let _0x511ac8;const _0x32f504=_0x3a0d96=>{const _0x5c1e88={'resolveSegment':async _0x2ac73b=>{const _0x3c7b01=a140_0x2c7d,_0x40853b=_0x2406a2['get'](_0x2ac73b);if(_0x40853b!==undefined)return{'name':_0x40853b,'isJourneyLocal':!![]};try{const _0x371439=await fetchSegment(_0x117cb2,_0x25ec05,_0x2ac73b,_0x1c6f76);if(!_0x371439)throw new Error(_0x3c7b01(0x1ce));const _0x73cc59=generateJourneyLocalName(_0x371439['name']),_0xbbac38=_0x371439['kind']===SEGMENT_KIND_JOURNEY&&_0x73cc59!==undefined;let _0x59b56b=_0x371439[_0x3c7b01(0x1f7)],_0x5a3264;if(_0xbbac38&&_0x371439[_0x3c7b01(0x17a)]){const _0x145a79=apiRuleToYaml(_0x371439[_0x3c7b01(0x17a)]);_0x57a262[_0x3c7b01(0x1c6)](_0x2ac73b,_0x145a79);const _0x4e9d48=async _0x30fdcf=>{const _0x9383a7=_0x3c7b01,_0x541c11=collectSegmentRefsFromRule(_0x30fdcf);for(const _0x1db131 of _0x541c11){if(!_0x57a262[_0x9383a7(0x204)](_0x1db131))try{const _0x18a633=await fetchSegment(_0x117cb2,_0x25ec05,_0x1db131,_0x1c6f76);if(_0x18a633?.[_0x9383a7(0x17a)]){const _0x35ac0a=apiRuleToYaml(_0x18a633[_0x9383a7(0x17a)]);_0x57a262[_0x9383a7(0x1c6)](_0x1db131,_0x35ac0a),await _0x4e9d48(_0x35ac0a);}}catch(_0x15a334){logger[_0x9383a7(0x143)](_0x9383a7(0x1ae)+_0x1db131+':\x20'+_0x15a334);}}};await _0x4e9d48(_0x145a79);const _0x2993df=serializeExpandedRule(_0x145a79,_0x57a262),_0x585849=_0x1b17b2[_0x3c7b01(0x203)](_0x2993df);if(_0x585849&&_0x585849[_0x3c7b01(0x175)]>0x0){const _0x46049e=_0x5bdaa9['get'](_0x2993df)||0x0,_0x3db60a=_0x585849[_0x46049e]||_0x585849[_0x585849[_0x3c7b01(0x175)]-0x1];_0x5bdaa9[_0x3c7b01(0x1c6)](_0x2993df,_0x46049e+0x1),_0x59b56b=_0x3db60a,_0x54734d[_0x3c7b01(0x231)](_0x59b56b),_0x2406a2['set'](_0x2ac73b,_0x59b56b);const _0x59ea56=await resolveRuleSegmentRefs(_0x145a79,async _0x33d4cb=>{const _0x148061=_0x3c7b01,_0x417f15=_0x2406a2[_0x148061(0x203)](_0x33d4cb);if(_0x417f15)return _0x417f15;const _0x33ff9f=await _0x511ac8['resolveSegment'](_0x33d4cb);return _0x33ff9f[_0x148061(0x1f7)];});_0x5a3264={'description':_0x371439[_0x3c7b01(0x1f9)],'rule':_0x59ea56};}else{const _0x4d7a2e=_0x58abd0[_0x3c7b01(0x203)](_0x2993df);if(_0x4d7a2e)_0x59b56b=_0x4d7a2e,_0x2406a2[_0x3c7b01(0x1c6)](_0x2ac73b,_0x59b56b);else{if(_0x73cc59){let _0x320d42=_0x73cc59,_0x9f3089=0x2;while(_0x54734d['has'](_0x320d42)||_0x51fc5e['has'](_0x320d42)){_0x320d42=_0x73cc59+'_'+_0x9f3089,_0x9f3089++;}_0x54734d[_0x3c7b01(0x231)](_0x320d42),_0x59b56b=_0x320d42;}_0x2406a2[_0x3c7b01(0x1c6)](_0x2ac73b,_0x59b56b),_0x58abd0[_0x3c7b01(0x1c6)](_0x2993df,_0x59b56b);const _0x5ba6a3=await resolveRuleSegmentRefs(_0x145a79,async _0xe5d6e8=>{const _0x521ceb=_0x3c7b01,_0x5ab73c=_0x2406a2[_0x521ceb(0x203)](_0xe5d6e8);if(_0x5ab73c)return _0x5ab73c;const _0x1b69e7=await _0x511ac8[_0x521ceb(0x17e)](_0xe5d6e8);return _0x1b69e7[_0x521ceb(0x1f7)];});_0x5a3264={'description':_0x371439['description'],'rule':_0x5ba6a3};}}}return{'name':_0x59b56b,'isJourneyLocal':_0xbbac38,'definition':_0x5a3264};}catch(_0x78fec8){return logger[_0x3c7b01(0x143)](_0x3c7b01(0x1bf)+_0x2ac73b+':\x20'+_0x78fec8),{'name':_0x2ac73b,'isJourneyLocal':![]};}},'resolveActivation':async _0x2dafd2=>{const _0xa48519=a140_0x2c7d,_0x4cd42b=_0x4cdc01[_0xa48519(0x203)](_0x2dafd2);if(_0x4cd42b!==undefined)return{'name':_0x4cd42b,'isJourneyLocal':!![]};try{let _0x5c155f=_0x47e3b4?.[_0xa48519(0x203)](_0x2dafd2);!_0x5c155f&&(_0x5c155f=await _0x117cb2[_0xa48519(0x1ff)]['getActivation'](_0x3a0d96,_0x2dafd2));const _0xde9547=_0x5c155f[_0xa48519(0x1ad)][_0xa48519(0x1ef)][_0xa48519(0x1f7)]||_0x2dafd2,_0x4b448c=sanitizeYamlKey(_0xde9547)||_0xa48519(0x1e0)+_0x2dafd2,_0x113deb=_0x4b448c;_0x4cdc01[_0xa48519(0x1c6)](_0x2dafd2,_0x113deb);const _0xf45495=journeyActivationStepToYaml(_0x5c155f,_0x223c27,_0x362c25);return{'name':_0x113deb,'isJourneyLocal':!![],'definition':_0xf45495};}catch(_0x4f872d){return logger[_0xa48519(0x143)](_0xa48519(0x1b3)+_0x2dafd2+':\x20'+_0x4f872d),{'name':_0x2dafd2,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x59c2ee,_0x41db34)=>resolveJumpTarget(_0x59c2ee,_0x41db34,_0x4677d7,async _0x140b47=>{const _0x2103f2=a140_0x2c7d,_0xd4a605=_0xbe639a?.[_0x2103f2(0x203)](_0x140b47);if(_0xd4a605)return _0xd4a605;return _0x117cb2['journey'][_0x2103f2(0x1ea)](_0x140b47);})};return _0x511ac8=_0x5c1e88,_0x5c1e88;},_0x36a665=async _0x379d1a=>{const _0x30e0be=a140_0x2c7d,{collectSegmentIdsFromJourneyApi:_0x3a8b7b}=await import(_0x30e0be(0x1d7)),{batchAsync:_0x3817ad}=await import(_0x30e0be(0x1e7)),_0x1d2181=new Set();for(const _0x2a53ac of _0x379d1a){let _0x3dad95=_0xbe639a?.[_0x30e0be(0x203)](_0x2a53ac);!_0x3dad95&&(_0x3dad95=await _0x117cb2[_0x30e0be(0x1ff)]['getJourney'](_0x2a53ac));const _0x1c85af=_0x3a8b7b(_0x3dad95);for(const _0x1ce4f8 of _0x1c85af){_0x1d2181[_0x30e0be(0x231)](_0x1ce4f8);}}let _0xbbe421=Array[_0x30e0be(0x145)](_0x1d2181);while(_0xbbe421[_0x30e0be(0x175)]>0x0){const _0x5f3f9a=_0xbbe421[_0x30e0be(0x168)](_0x724418=>!_0x1fa78f[_0x30e0be(0x204)](_0x724418));if(_0x5f3f9a['length']===0x0)break;const _0x41a00d=await _0x3817ad(_0x5f3f9a,async _0x148925=>{const _0x2b5304=_0x30e0be;_0x1fa78f[_0x2b5304(0x231)](_0x148925);const _0x148eeb=await fetchSegment(_0x117cb2,_0x25ec05,_0x148925,_0x1c6f76);if(!_0x148eeb)return null;return{'segmentId':_0x148925,'segment':_0x148eeb};},0xa),_0x19d6bb=new Set();for(const _0x6cee2b of _0x41a00d){if(!_0x6cee2b?.['segment']?.[_0x30e0be(0x17a)])continue;const _0x424e0a=apiRuleToYaml(_0x6cee2b[_0x30e0be(0x1aa)]['rule']);_0x57a262[_0x30e0be(0x1c6)](_0x6cee2b['segmentId'],_0x424e0a);const _0x52fda6=collectSegmentRefsFromRule(_0x424e0a);for(const _0x948cd4 of _0x52fda6){!_0x1fa78f['has'](_0x948cd4)&&_0x19d6bb[_0x30e0be(0x231)](_0x948cd4);}}_0xbbe421=Array[_0x30e0be(0x145)](_0x19d6bb);}};return{'createYamlContext':_0x32f504,'prefetchJourneySegments':_0x36a665};}export async function executePushSegments(_0x480cb4,_0x2c5a25,_0x590af8,_0x42b847,_0x1194c5){const _0x90b380=a140_0x374048,{segmentDefToCreateRequest:_0x49bce6,segmentDefToUpdateRequest:_0x199acc}=await import(_0x90b380(0x13e)),_0x35609b=_0x590af8[_0x90b380(0x187)],_0x15c104=0x5,_0x44876f=async _0x485e45=>{const _0x1a327f=_0x90b380,_0x56f5e2=_0x485e45[_0x1a327f(0x208)]?_0x35609b[_0x1a327f(0x203)](_0x485e45[_0x1a327f(0x208)]):undefined;let _0xa2f7f6;const _0x439ef2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x45978f=_0x485e45['yamlConfig'];if(_0x485e45[_0x1a327f(0x237)]['rule']){const _0x33447e=createSegmentIdResolver(_0x590af8[_0x1a327f(0x13c)],_0x485e45[_0x1a327f(0x237)]['name']),_0x2632fe=await resolveRuleSegmentIds(_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x17a)],_0x33447e);_0x45978f={..._0x485e45[_0x1a327f(0x237)],'rule':_0x2632fe};}try{if(_0x485e45[_0x1a327f(0x1b1)]){_0x1194c5[_0x1a327f(0x1d0)]?.({'type':_0x1a327f(0x17f),'name':_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]});const _0x32add1=_0x49bce6(_0x45978f,_0x56f5e2),_0x2a7a6e=await _0x1194c5[_0x1a327f(0x22a)](_0x1a327f(0x155)+_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]+_0x1a327f(0x219),()=>_0x480cb4['segment'][_0x1a327f(0x13a)](_0x42b847['parentId'],_0x32add1));_0xa2f7f6=_0x2a7a6e['data']['id'],_0x590af8[_0x1a327f(0x13c)][_0x1a327f(0x1c6)](_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)],_0xa2f7f6),_0x439ef2['createdSegmentId']={'name':_0x485e45[_0x1a327f(0x237)]['name'],'id':_0xa2f7f6},_0x1194c5['onProgress']?.({'type':_0x1a327f(0x180),'name':_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)],'segmentId':_0xa2f7f6}),_0x1194c5['logSuccess']?.(_0x1a327f(0x150)+_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]+'\x27'),_0x439ef2[_0x1a327f(0x20c)]=0x1;}else{if(_0x485e45['hasChanges']){_0x1194c5[_0x1a327f(0x1d0)]?.({'type':_0x1a327f(0x21f),'name':_0x485e45[_0x1a327f(0x237)][_0x1a327f(0x1f7)]});const _0x12273d=_0x199acc(_0x45978f);_0x56f5e2!==_0x485e45[_0x1a327f(0x216)]?.[_0x1a327f(0x15d)]&&(_0x12273d['segmentFolderId']=_0x56f5e2?parseInt(_0x56f5e2,0xa):undefined),await _0x1194c5[_0x1a327f(0x22a)]('Updating\x20segment\x20\x27'+_0x485e45[_0x1a327f(0x237)]['name']+_0x1a327f(0x219),()=>_0x480cb4[_0x1a327f(0x1aa)][_0x1a327f(0x199)](_0x42b847[_0x1a327f(0x14e)],_0x485e45[_0x1a327f(0x216)]['id'],_0x12273d)),_0xa2f7f6=_0x485e45[_0x1a327f(0x216)]['id'],_0x1194c5[_0x1a327f(0x1d0)]?.({'type':_0x1a327f(0x188),'name':_0x485e45[_0x1a327f(0x237)]['name']}),_0x1194c5[_0x1a327f(0x20f)]?.('Updated\x20segment\x20\x27'+_0x485e45['yamlConfig'][_0x1a327f(0x1f7)]+'\x27'),_0x439ef2[_0x1a327f(0x181)]=0x1;}else _0xa2f7f6=_0x485e45[_0x1a327f(0x216)]['id'];}}catch(_0x511676){const _0x1deed5=isHttp400Error(_0x511676),_0xccf91f=_0x1deed5?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1a327f(0x14b)],_0x16fea5=getErrorMessage(_0x511676);throw new SDKError(_0xccf91f,'Failed\x20to\x20'+(_0x485e45['isNew']?_0x1a327f(0x21c):_0x1a327f(0x177))+_0x1a327f(0x16f)+_0x485e45[_0x1a327f(0x211)]+_0x1a327f(0x22f)+_0x16fea5,_0x511676);}try{const _0x4cc573=await syncActivationsForSegment(_0x480cb4,_0x42b847[_0x1a327f(0x14e)],_0xa2f7f6,_0x485e45[_0x1a327f(0x237)]['name'],_0x485e45[_0x1a327f(0x1cf)],_0x1194c5,_0x485e45[_0x1a327f(0x211)]);_0x439ef2[_0x1a327f(0x1a6)]=_0x4cc573;}catch(_0xee44da){if(_0xee44da instanceof SDKError)throw _0xee44da;throw new SDKError(ErrorCode[_0x1a327f(0x158)],_0x1a327f(0x1b5)+_0x485e45[_0x1a327f(0x237)]['name']+'\x27\x20from\x20file:\x20'+_0x485e45[_0x1a327f(0x211)]+_0x1a327f(0x22f)+getErrorMessage(_0xee44da),_0xee44da);}return _0x439ef2;},_0x6e26e4=await batchAsync(_0x2c5a25,_0x44876f,_0x15c104),_0x343bc6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x540989 of _0x6e26e4){_0x343bc6[_0x90b380(0x20c)]+=_0x540989['created'],_0x343bc6[_0x90b380(0x181)]+=_0x540989[_0x90b380(0x181)],_0x540989[_0x90b380(0x152)]&&_0x343bc6[_0x90b380(0x144)]['set'](_0x540989[_0x90b380(0x152)][_0x90b380(0x1f7)],_0x540989['createdSegmentId']['id']),_0x343bc6[_0x90b380(0x1a6)][_0x90b380(0x20c)]+=_0x540989[_0x90b380(0x1a6)][_0x90b380(0x20c)],_0x343bc6['activations'][_0x90b380(0x181)]+=_0x540989[_0x90b380(0x1a6)][_0x90b380(0x181)],_0x343bc6[_0x90b380(0x1a6)][_0x90b380(0x14c)]+=_0x540989[_0x90b380(0x1a6)][_0x90b380(0x14c)];}return _0x343bc6;}async function syncActivationsForSegment(_0x50a653,_0x11462e,_0x4dd2ef,_0x2b5049,_0x5ecaab,_0x5a5071,_0x6ec8ed){const _0x4859e4=a140_0x374048,_0x431535={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x24f70e of _0x5ecaab){try{if(_0x24f70e['type']==='create'&&_0x24f70e['validatedRequest'])_0x5a5071['onProgress']?.({'type':_0x4859e4(0x16a),'segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),await _0x5a5071[_0x4859e4(0x22a)](_0x4859e4(0x1fe)+_0x24f70e['name']+_0x4859e4(0x219),()=>_0x50a653['segment'][_0x4859e4(0x16b)](_0x11462e,_0x4dd2ef,_0x24f70e['validatedRequest'])),_0x5a5071[_0x4859e4(0x1d0)]?.({'type':_0x4859e4(0x1fd),'segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),_0x5a5071[_0x4859e4(0x20f)]?.(_0x4859e4(0x1da)+_0x24f70e['name']+'\x27'),_0x431535['created']++;else{if(_0x24f70e['type']===_0x4859e4(0x177)&&_0x24f70e[_0x4859e4(0x1ca)]&&_0x24f70e['existingActivation'])_0x5a5071['onProgress']?.({'type':'activation_updating','segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),await _0x5a5071[_0x4859e4(0x22a)](_0x4859e4(0x19b)+_0x24f70e[_0x4859e4(0x1f7)]+'\x27...',()=>_0x50a653['segment'][_0x4859e4(0x17c)](_0x11462e,_0x4dd2ef,_0x24f70e[_0x4859e4(0x21b)]['id'],_0x24f70e['validatedRequest'])),_0x5a5071[_0x4859e4(0x1d0)]?.({'type':'activation_updated','segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),_0x5a5071[_0x4859e4(0x20f)]?.(_0x4859e4(0x156)+_0x24f70e[_0x4859e4(0x1f7)]+'\x27'),_0x431535[_0x4859e4(0x181)]++;else _0x24f70e[_0x4859e4(0x1f0)]===_0x4859e4(0x1c3)&&_0x24f70e['existingActivation']&&(_0x5a5071[_0x4859e4(0x1d0)]?.({'type':_0x4859e4(0x23e),'segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),await _0x5a5071['withProgress'](_0x4859e4(0x1f3)+_0x24f70e[_0x4859e4(0x1f7)]+_0x4859e4(0x219),()=>_0x50a653['segment'][_0x4859e4(0x1fa)](_0x11462e,_0x4dd2ef,_0x24f70e[_0x4859e4(0x21b)]['id'])),_0x5a5071['onProgress']?.({'type':'activation_deleted','segmentName':_0x2b5049,'activationName':_0x24f70e[_0x4859e4(0x1f7)]}),_0x5a5071[_0x4859e4(0x1cc)]?.(_0x4859e4(0x1d3)+_0x24f70e[_0x4859e4(0x1f7)]+'\x27'),_0x431535['deleted']++);}}catch(_0x161076){const _0x875aaf=isHttp400Error(_0x161076),_0x2ab60c=_0x875aaf?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x28eb34=getErrorMessage(_0x161076);throw new SDKError(_0x2ab60c,_0x4859e4(0x160)+_0x24f70e[_0x4859e4(0x1f0)]+'\x20activation\x20\x27'+_0x24f70e[_0x4859e4(0x1f7)]+'\x27\x20from\x20file:\x20'+_0x6ec8ed+'\x0a\x20\x20'+_0x28eb34,_0x161076);}}return _0x431535;}export async function executePushFolders(_0x1bbf63,_0x130a38,_0xd9120b,_0x3bf1b6,_0x1005fd){const _0x264621=a140_0x374048,_0x35e8e5=new Map(_0xd9120b),_0x5cdee3=sortFoldersByDepth(_0x130a38);for(const _0x5de327 of _0x5cdee3){const _0x196bcd=_0x5de327[_0x264621(0x1a4)]('/'),_0x53e6d4=_0x196bcd[_0x196bcd[_0x264621(0x175)]-0x1],_0x461068=_0x196bcd[_0x264621(0x189)](0x0,-0x1)[_0x264621(0x1d9)]('/'),_0x31d79b=_0x35e8e5[_0x264621(0x203)](_0x461068);_0x1005fd[_0x264621(0x1d0)]?.({'type':_0x264621(0x22d),'folder':_0x5de327});const _0x40a2da={'name':_0x53e6d4,'parentFolderId':_0x31d79b},_0xb30d02=await _0x1005fd[_0x264621(0x22a)](_0x264621(0x1d6)+_0x5de327+_0x264621(0x219),()=>_0x1bbf63[_0x264621(0x1aa)][_0x264621(0x1d5)](_0x3bf1b6['parentId'],_0x40a2da));_0x35e8e5[_0x264621(0x1c6)](_0x5de327,_0xb30d02['data']['id']),_0x1005fd[_0x264621(0x1d0)]?.({'type':_0x264621(0x1b8),'folder':_0x5de327,'folderId':_0xb30d02[_0x264621(0x1df)]['id']}),_0x1005fd[_0x264621(0x15f)]?.(_0x264621(0x1e4)+_0x5de327+'\x27');}return _0x35e8e5;}export async function executePushSegmentDeletions(_0x5097aa,_0x40ff21,_0x2271b5){const _0x29f2db=a140_0x374048;if(_0x40ff21[_0x29f2db(0x175)]===0x0)return 0x0;const {batchAsync:_0x13d21c}=await import('../../utils/async.js'),_0x108353=0x5,_0x487d0d=await _0x13d21c(_0x40ff21,async _0x5bd455=>{const _0x40cba4=_0x29f2db;return _0x2271b5[_0x40cba4(0x1d0)]?.({'type':_0x40cba4(0x14a),'name':_0x5bd455[_0x40cba4(0x1f7)]}),await _0x5097aa[_0x40cba4(0x1aa)][_0x40cba4(0x157)](_0x5bd455['id']),_0x2271b5[_0x40cba4(0x1d0)]?.({'type':_0x40cba4(0x1e3),'name':_0x5bd455[_0x40cba4(0x1f7)]}),_0x2271b5[_0x40cba4(0x1cc)]?.('Deleted\x20segment\x20\x27'+_0x5bd455['name']+'\x27'),0x1;},_0x108353);return _0x487d0d[_0x29f2db(0x16e)]((_0x571668,_0xf4c39b)=>_0x571668+_0xf4c39b,0x0);}export async function executePushJourneys(_0x3cca25,_0x29df09,_0x514b91,_0x7b5b20,_0x430d87){const _0x4a90c7=a140_0x374048,{journeyDefToRequest:_0x51587e}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x453151,yamlRuleToApi:_0x35e9d1,validateSegmentRule:_0x55b58d}=await import(_0x4a90c7(0x13e)),_0x1d88dd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x52c6c0=new Map(_0x514b91[_0x4a90c7(0x13c)]),_0x195c0f=0x5;for(let _0x33bf7e=0x0;_0x33bf7e<_0x29df09[_0x4a90c7(0x175)];_0x33bf7e+=_0x195c0f){const _0x144412=_0x29df09['slice'](_0x33bf7e,_0x33bf7e+_0x195c0f),_0x43be00=await Promise['all'](_0x144412[_0x4a90c7(0x197)](async _0x27102b=>{const _0x2c30fb=_0x4a90c7;if(!_0x27102b[_0x2c30fb(0x1b1)]&&!_0x27102b[_0x2c30fb(0x195)])return{'action':_0x2c30fb(0x159),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)],'journeyId':_0x27102b[_0x2c30fb(0x1e1)]?.['id']};const _0x3bec50=_0x27102b[_0x2c30fb(0x208)]?_0x514b91[_0x2c30fb(0x187)][_0x2c30fb(0x203)](_0x27102b[_0x2c30fb(0x208)]):undefined;_0x430d87['onProgress']?.({'type':_0x27102b[_0x2c30fb(0x1b1)]?_0x2c30fb(0x1c5):_0x2c30fb(0x1c1),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)]});try{const _0x3a218b=await executeSingleJourneyPush(_0x3cca25,_0x27102b,{..._0x514b91,'segmentNameToId':_0x52c6c0},{'parentId':_0x7b5b20['parentId'],'rootFolderId':_0x7b5b20[_0x2c30fb(0x1a0)],'folderId':_0x3bec50,'verbose':_0x7b5b20[_0x2c30fb(0x1bb)]},_0x430d87,{'journeyDefToRequest':_0x51587e,'activationDefToCreateRequest':_0x453151,'yamlRuleToApi':_0x35e9d1,'validateSegmentRule':_0x55b58d});for(const [_0x287951,_0x4b9148]of _0x3a218b[_0x2c30fb(0x223)]){_0x52c6c0[_0x2c30fb(0x1c6)](_0x287951,_0x4b9148),_0x1d88dd[_0x2c30fb(0x223)]['set'](_0x287951,_0x4b9148);}if(_0x3a218b['action']===_0x2c30fb(0x20c))_0x430d87[_0x2c30fb(0x1d0)]?.({'type':_0x2c30fb(0x179),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)],'journeyId':_0x3a218b[_0x2c30fb(0x15e)]}),_0x430d87[_0x2c30fb(0x20f)]?.(_0x2c30fb(0x220)+_0x27102b['yamlConfig'][_0x2c30fb(0x1f7)]+'\x27'),_0x1d88dd['created']++;else _0x3a218b[_0x2c30fb(0x1fb)]===_0x2c30fb(0x181)&&(_0x430d87[_0x2c30fb(0x1d0)]?.({'type':_0x2c30fb(0x1bd),'name':_0x27102b[_0x2c30fb(0x237)][_0x2c30fb(0x1f7)]}),_0x430d87[_0x2c30fb(0x20f)]?.(_0x2c30fb(0x1e6)+_0x27102b['yamlConfig'][_0x2c30fb(0x1f7)]+'\x27'),_0x1d88dd[_0x2c30fb(0x181)]++);return{'action':_0x3a218b[_0x2c30fb(0x1fb)],'name':_0x27102b[_0x2c30fb(0x237)]['name'],'journeyId':_0x3a218b[_0x2c30fb(0x15e)]};}catch(_0x27daae){const _0x41505f=isHttp400Error(_0x27daae),_0x45218f=_0x41505f?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x323830=getErrorMessage(_0x27daae);throw new SDKError(_0x45218f,_0x2c30fb(0x160)+(_0x27102b[_0x2c30fb(0x1b1)]?_0x2c30fb(0x21c):_0x2c30fb(0x177))+_0x2c30fb(0x14f)+_0x27102b[_0x2c30fb(0x211)]+'\x0a\x20\x20'+_0x323830,_0x27daae);}}));_0x1d88dd['results']['push'](..._0x43be00);}return _0x1d88dd;}async function matchExistingJourneySegments(_0x59311d,_0x2193ae,_0x154883,_0x3c2ce9,_0x12ae4a){const _0x2e5540=a140_0x374048;if(!_0x2193ae[_0x2e5540(0x1e1)]||!_0x2193ae[_0x2e5540(0x237)][_0x2e5540(0x1e5)])return;const _0x11781d=new Map(),_0x49dea9=new Set();for(const _0x393fed of Object[_0x2e5540(0x1b7)](_0x2193ae['yamlConfig'][_0x2e5540(0x1e5)])){const _0x2ebf3e=generateDeterministicJourneySegmentName(_0x2193ae[_0x2e5540(0x237)][_0x2e5540(0x1f7)],_0x393fed);_0x11781d[_0x2e5540(0x1c6)](_0x2ebf3e,_0x393fed),_0x49dea9[_0x2e5540(0x231)](_0x393fed);}const _0x3c6445=[],_0x339f4a=collectSegmentIdsFromJourneyApi(_0x2193ae[_0x2e5540(0x1e1)]);for(const _0x16bb6d of _0x339f4a){const _0xb71a60=await fetchSegment(_0x59311d,_0x154883,_0x16bb6d,_0x3c2ce9);if(!_0xb71a60?.[_0x2e5540(0x1f7)])continue;const _0x513ec8=_0x11781d[_0x2e5540(0x203)](_0xb71a60[_0x2e5540(0x1f7)]);_0x513ec8?(_0x12ae4a['set'](_0x513ec8,_0x16bb6d),_0x49dea9[_0x2e5540(0x1c3)](_0x513ec8)):_0x3c6445['push']({'id':_0x16bb6d,'seg':_0xb71a60});}if(_0x49dea9[_0x2e5540(0x1a3)]>0x0&&_0x3c6445[_0x2e5540(0x175)]>0x0){const {localExpandedRuleToNames:_0xf70652}=buildLocalExpandedRuleMappings(_0x2193ae[_0x2e5540(0x237)]),_0x109c0d=new Map();for(const {id:_0x428bbe,seg:_0x18b3d3}of _0x3c6445){if(_0x18b3d3['rule']){const _0x516b08=apiRuleToYaml(_0x18b3d3[_0x2e5540(0x17a)]);_0x109c0d[_0x2e5540(0x1c6)](_0x428bbe,_0x516b08);}}for(const {id:_0x25654e,seg:_0xc08d64}of _0x3c6445){if(!_0xc08d64['rule'])continue;const _0x54bab2=_0x109c0d[_0x2e5540(0x203)](_0x25654e);if(!_0x54bab2)continue;const _0x13c0e2=serializeExpandedRule(_0x54bab2,_0x109c0d),_0x3a3ec7=_0xf70652[_0x2e5540(0x203)](_0x13c0e2);if(_0x3a3ec7){const _0xa440a6=_0x3a3ec7[_0x2e5540(0x1a7)](_0x170033=>_0x49dea9[_0x2e5540(0x204)](_0x170033));_0xa440a6&&(_0x12ae4a[_0x2e5540(0x1c6)](_0xa440a6,_0x25654e),_0x49dea9[_0x2e5540(0x1c3)](_0xa440a6),logger[_0x2e5540(0x143)](_0x2e5540(0x166)+_0xc08d64['name']+_0x2e5540(0x196)+_0xa440a6+_0x2e5540(0x17b)));}}}}function a140_0x2c7d(_0x4c11ac,_0x4ec5dd){_0x4c11ac=_0x4c11ac-0x13a;const _0x254443=a140_0x2544();let _0x2c7da2=_0x254443[_0x4c11ac];return _0x2c7da2;}async function executeSingleJourneyPush(_0x13cc12,_0x160d39,_0x16f2d4,_0x295221,_0x22f807,_0x5377bc){const _0x230af2=a140_0x374048,{journeyDefToRequest:_0x229b6b,activationDefToCreateRequest:_0x5f59bf,yamlRuleToApi:_0x132c37,validateSegmentRule:_0x3aa75d}=_0x5377bc,_0x30c5a9=new Map(),_0x358f8c=new Map();recoverSegmentIdsFromPushRecovery(_0x160d39,_0x30c5a9,_0x16f2d4[_0x230af2(0x13c)]);const _0xcd23cd=new Map(),_0x1d747e=new Map(),_0x28e330=new Map();let _0x505a0f;const _0x36bc7c=async()=>{const _0x54b9b6=_0x230af2;if(_0x505a0f)return;_0x505a0f=new Map();if(!_0x160d39['existingJourney'])return;const _0x565160=await _0x13cc12[_0x54b9b6(0x1ff)][_0x54b9b6(0x23a)](_0x160d39['existingJourney']['id']);for(const _0x10dcba of _0x565160){const _0x19d0ee=journeyActivationStepToYaml(_0x10dcba,_0x16f2d4[_0x54b9b6(0x163)],_0x16f2d4[_0x54b9b6(0x169)]),_0x111c4b=activationSignature(_0x19d0ee);!_0x505a0f[_0x54b9b6(0x204)](_0x111c4b)&&_0x505a0f[_0x54b9b6(0x1c6)](_0x111c4b,_0x10dcba['id']),_0x19d0ee[_0x54b9b6(0x1f7)]&&_0x358f8c[_0x54b9b6(0x1c6)](_0x19d0ee[_0x54b9b6(0x1f7)],_0x10dcba['id']);}};await matchExistingJourneySegments(_0x13cc12,_0x160d39,_0x295221[_0x230af2(0x14e)],_0x16f2d4['existingSegments'],_0x16f2d4[_0x230af2(0x13c)]);const _0x554675={'resolveSegmentId':async _0x195fce=>{const _0x3946d1=_0x230af2,_0x47b611=_0x16f2d4[_0x3946d1(0x13c)][_0x3946d1(0x203)](_0x195fce);if(!_0x47b611)throw new SDKError(ErrorCode[_0x3946d1(0x22c)],_0x3946d1(0x153)+_0x195fce+_0x3946d1(0x1ab)+_0x160d39['yamlConfig'][_0x3946d1(0x1f7)]+')');return _0x47b611;},'resolveEmbeddedSegmentId':async(_0x179009,_0x4addb5)=>{const _0x26aa9a=_0x230af2,_0xa49b3d=_0x16f2d4['segmentNameToId'][_0x26aa9a(0x203)](_0x179009);if(_0xa49b3d)return _0xa49b3d;const _0x2dc68c=_0x16f2d4[_0x26aa9a(0x178)][_0x26aa9a(0x1a7)](_0x16d44f=>_0x16d44f[_0x26aa9a(0x1f7)]===_0x179009);if(_0x2dc68c)return _0x16f2d4[_0x26aa9a(0x13c)][_0x26aa9a(0x1c6)](_0x179009,_0x2dc68c['id']),_0x2dc68c['id'];if(_0x160d39[_0x26aa9a(0x1b1)]){const {stageName:_0x1ed8a1,criteriaName:_0x4f0f8a}=findSegmentCriteriaLocation(_0x160d39[_0x26aa9a(0x237)],_0x179009);return _0x3aa75d(_0x179009,_0x4addb5[_0x26aa9a(0x17a)]),_0x1d747e[_0x26aa9a(0x1c6)](_0x179009,{'definition':_0x4addb5,'stageName':_0x1ed8a1,'criteriaName':_0x4f0f8a}),createPendingSegmentId(_0x179009);}const _0x26a7ff=_0x160d39[_0x26aa9a(0x1e1)]?.['id'];if(!_0x26a7ff)throw new SDKError(ErrorCode['INTERNAL'],_0x26aa9a(0x1b2));const _0x3b9716=_0xcd23cd[_0x26aa9a(0x203)](_0x179009);if(_0x3b9716)return _0x3b9716;const _0x313732=((async()=>{const _0x10713d=_0x26aa9a;_0x3aa75d(_0x179009,_0x4addb5[_0x10713d(0x17a)]);const _0x1fd6e0=generateDeterministicJourneySegmentName(_0x160d39[_0x10713d(0x237)][_0x10713d(0x1f7)],_0x179009),_0x39e2d5=_0x16f2d4[_0x10713d(0x178)]['find'](_0x4cd5e1=>_0x4cd5e1[_0x10713d(0x1f7)]===_0x1fd6e0),_0x155694=createSegmentIdResolver(_0x16f2d4[_0x10713d(0x13c)],_0x179009),_0x3c5c65=await resolveRuleSegmentIds(_0x4addb5[_0x10713d(0x17a)],_0x155694);let _0x56aefe;return _0x39e2d5?(await _0x13cc12['segment']['updateSegmentById'](_0x295221[_0x10713d(0x14e)],_0x39e2d5['id'],{'description':_0x4addb5['description']||'Entry\x20criteria:\x20'+_0x179009,'rule':_0x132c37(_0x3c5c65,!![]),'countPopulation':!![]}),_0x56aefe=_0x39e2d5['id'],saveSegmentToPushRecovery(_0x160d39['absolutePath'],_0x160d39[_0x10713d(0x237)][_0x10713d(0x1f7)],_0x179009,{'segmentId':_0x56aefe,'uniqueServerName':_0x1fd6e0,'createdAt':new Date()[_0x10713d(0x1b4)]()})):_0x56aefe=await createOrRecoverEmbeddedSegment(_0x13cc12,_0x160d39,{'localName':_0x179009,'uniqueSegmentName':_0x1fd6e0,'description':_0x4addb5['description']||'Entry\x20criteria:\x20'+_0x179009,'journeyId':_0x26a7ff,'resolvedRule':_0x3c5c65,'parentId':_0x295221[_0x10713d(0x14e)],'folderId':_0x295221[_0x10713d(0x1a0)]||''},_0x132c37),_0x16f2d4['segmentNameToId']['set'](_0x179009,_0x56aefe),_0x30c5a9[_0x10713d(0x1c6)](_0x179009,_0x56aefe),_0x56aefe;})());_0xcd23cd[_0x26aa9a(0x1c6)](_0x179009,_0x313732);try{return await _0x313732;}finally{_0xcd23cd['delete'](_0x179009);}},'resolveActivationId':async _0x2e28cb=>{const _0x2c0824=_0x230af2,_0x3cbaf2=_0x358f8c['get'](_0x2e28cb);if(_0x3cbaf2)return _0x3cbaf2;if(_0x160d39[_0x2c0824(0x1e1)]){await _0x36bc7c();const _0x50749c=_0x358f8c[_0x2c0824(0x203)](_0x2e28cb);if(_0x50749c)return _0x50749c;}throw new SDKError(ErrorCode[_0x2c0824(0x183)],_0x2c0824(0x20d)+_0x2e28cb+_0x2c0824(0x1ab)+_0x160d39[_0x2c0824(0x237)][_0x2c0824(0x1f7)]+_0x2c0824(0x1f8)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x21979,_0x28e9c3)=>{const _0x1e1f3b=_0x230af2,_0x445175=_0x358f8c['get'](_0x21979);if(_0x445175)return _0x445175;if(_0x160d39[_0x1e1f3b(0x1b1)])return _0x28e330['set'](_0x21979,_0x28e9c3),createPendingActivationId(_0x21979);if(_0x160d39[_0x1e1f3b(0x1e1)]){await _0x36bc7c();const _0x3279e4=_0x358f8c['get'](_0x28e9c3[_0x1e1f3b(0x1f7)]);if(_0x3279e4)return _0x358f8c['set'](_0x21979,_0x3279e4),_0x3279e4;const _0x56a279=activationSignature(_0x28e9c3),_0x6d275f=_0x505a0f?.[_0x1e1f3b(0x203)](_0x56a279);if(_0x6d275f)return _0x358f8c[_0x1e1f3b(0x1c6)](_0x21979,_0x6d275f),_0x6d275f;const _0xf8fd6d=await _0x5f59bf(_0x28e9c3,_0x16f2d4['activationContext']),_0x547380={..._0xf8fd6d,..._0x28e9c3['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x28e9c3[_0x1e1f3b(0x1cd)]}},_0x1027e5=await _0x13cc12[_0x1e1f3b(0x1ff)]['createActivation'](_0x160d39['existingJourney']['id'],_0x547380);return _0x358f8c[_0x1e1f3b(0x1c6)](_0x21979,_0x1027e5['id']),_0x1027e5['id'];}throw new SDKError(ErrorCode[_0x1e1f3b(0x1c4)],_0x1e1f3b(0x226));},'resolveJourneyId':async _0x5a22df=>{const _0x5da779=_0x230af2;try{return await _0x13cc12['journey']['resolveJourneyId'](_0x295221[_0x5da779(0x14e)],_0x5a22df);}catch(_0x8bbb3){throw new SDKError(ErrorCode[_0x5da779(0x183)],_0x5da779(0x148)+_0x5a22df+_0x5da779(0x1ee)+_0x160d39[_0x5da779(0x237)][_0x5da779(0x1f7)]+'\x27)',_0x8bbb3);}},'resolveStageId':async(_0x684a4f,_0x12be0f)=>{const _0x4d9865=_0x230af2,_0x2da047=await _0x13cc12[_0x4d9865(0x1ff)][_0x4d9865(0x1ea)](_0x684a4f),_0x2d7b29=_0x2da047['attributes'][_0x4d9865(0x1c8)][_0x4d9865(0x1a7)](_0x48f0c1=>_0x48f0c1[_0x4d9865(0x1f7)][_0x4d9865(0x227)]()===_0x12be0f[_0x4d9865(0x227)]());if(!_0x2d7b29?.['id'])throw new SDKError(ErrorCode[_0x4d9865(0x183)],_0x4d9865(0x1eb)+_0x12be0f+_0x4d9865(0x1af)+(_0x2da047[_0x4d9865(0x1ad)][_0x4d9865(0x239)]||_0x2da047['attributes'][_0x4d9865(0x1f7)])+'\x27');return _0x2d7b29['id'];}},_0x4e167a=await _0x229b6b(_0x160d39[_0x230af2(0x237)],_0x295221['parentId'],_0x554675),_0x275c0c=_0x295221[_0x230af2(0x1a5)]||_0x295221[_0x230af2(0x1a0)];_0x275c0c&&(_0x4e167a[_0x230af2(0x162)]={'parentFolder':{'data':{'id':_0x275c0c,'type':_0x230af2(0x16d)}}});if(_0x160d39[_0x230af2(0x1b1)]){if(_0x1d747e[_0x230af2(0x1a3)]>0x0||_0x28e330[_0x230af2(0x1a3)]>0x0)return await executeThreeStepJourneyCreate(_0x13cc12,_0x160d39,_0x4e167a,{'pendingEmbeddedSegments':_0x1d747e,'pendingEmbeddedActivations':_0x28e330,'embeddedSegmentNameToId':_0x30c5a9,'journeyActivationNameToId':_0x358f8c},{..._0x295221,'effectiveFolderId':_0x275c0c},_0x16f2d4,_0x22f807,_0x5377bc);else{ensureJourneyDefaults(_0x4e167a['attributes']);const _0xe675dd=await _0x13cc12[_0x230af2(0x1ff)][_0x230af2(0x21c)](_0x4e167a);return deletePushRecovery(_0x160d39[_0x230af2(0x211)]),{'action':'created','journeyId':_0xe675dd['id'],'embeddedSegmentNameToId':_0x30c5a9};}}else{if(_0x160d39['hasChanges']&&_0x160d39[_0x230af2(0x1e1)]){_0x4e167a['id']=_0x160d39['existingJourney']['id'];const _0x4c1697=_0x4e167a[_0x230af2(0x1ad)];_0x160d39['existingJourney'][_0x230af2(0x1ad)]?.['journeyBundleName']&&(_0x4c1697[_0x230af2(0x239)]=_0x160d39[_0x230af2(0x1e1)][_0x230af2(0x1ad)][_0x230af2(0x239)]);const _0x4aa795=_0x160d39[_0x230af2(0x1e1)][_0x230af2(0x1ad)]?.['journeyStages'];return _0x4aa795&&_0x4e167a[_0x230af2(0x1ad)][_0x230af2(0x1c8)]&&injectExistingStageIds(_0x4e167a[_0x230af2(0x1ad)]['journeyStages'],_0x4aa795),ensureJourneyDefaults(_0x4c1697),await _0x13cc12['journey']['update'](_0x160d39[_0x230af2(0x1e1)]['id'],_0x4e167a),deletePushRecovery(_0x160d39['absolutePath']),{'action':_0x230af2(0x181),'journeyId':_0x160d39[_0x230af2(0x1e1)]['id'],'embeddedSegmentNameToId':_0x30c5a9};}}return deletePushRecovery(_0x160d39['absolutePath']),{'action':'unchanged','journeyId':_0x160d39[_0x230af2(0x1e1)]?.['id'],'embeddedSegmentNameToId':_0x30c5a9};}function findSegmentCriteriaLocation(_0x1028cc,_0x18367f){const _0x5184f9=a140_0x374048,_0x13efdd=_0x1028cc[_0x5184f9(0x173)]||_0x1028cc['journeys']?.[0x0]?.[_0x5184f9(0x173)]||[];let _0x2662a4=_0x5184f9(0x22e),_0x3eb3c9=_0x18367f;const _0x2eba3d=_0x1028cc[_0x5184f9(0x20a)]||_0x1028cc['journeys']?.[0x0]?.[_0x5184f9(0x20a)];if(_0x2eba3d?.[_0x5184f9(0x1aa)]===_0x18367f)return{'stageName':_0x5184f9(0x20a),'criteriaName':_0x2eba3d[_0x5184f9(0x1f7)]||_0x18367f};_0x4afe44:for(const _0xceba9e of _0x13efdd){if(_0xceba9e[_0x5184f9(0x205)]?.[_0x5184f9(0x1aa)]===_0x18367f){_0x2662a4=_0xceba9e[_0x5184f9(0x1f7)],_0x3eb3c9=_0xceba9e[_0x5184f9(0x205)][_0x5184f9(0x1f7)]||_0x18367f;break;}if(_0xceba9e['steps'])for(const _0x1626bf of _0xceba9e['steps']){if(_0x1626bf[_0x5184f9(0x1f0)]==='decision_point'&&_0x1626bf['with']?.['branches'])for(const _0x136c28 of _0x1626bf['with'][_0x5184f9(0x20b)]){if(_0x136c28[_0x5184f9(0x1aa)]===_0x18367f){_0x2662a4=_0xceba9e[_0x5184f9(0x1f7)],_0x3eb3c9=_0x136c28[_0x5184f9(0x1f7)]||_0x18367f;break _0x4afe44;}}}}return{'stageName':_0x2662a4,'criteriaName':_0x3eb3c9};}async function executeThreeStepJourneyCreate(_0x3eb271,_0x15792b,_0x582a4f,_0x411df8,_0x4cb216,_0x42b3a4,_0x592693,_0x474b2a){const _0x3f4621=a140_0x374048,{activationDefToCreateRequest:_0x1338d6,yamlRuleToApi:_0xd70d07}=_0x474b2a,{pendingEmbeddedSegments:_0x43a538,pendingEmbeddedActivations:_0x23d37c,embeddedSegmentNameToId:_0x4f2ef0}=_0x411df8,_0x51b9a5=JSON[_0x3f4621(0x1a2)](JSON['stringify'](_0x582a4f));ensureJourneyDefaults(_0x51b9a5[_0x3f4621(0x1ad)]),stripPendingIds(_0x51b9a5);const _0x538ae7=await _0x3eb271[_0x3f4621(0x1ff)][_0x3f4621(0x21c)](_0x51b9a5),_0x456423=_0x538ae7['id'],_0x83766b=new Map();for(const _0x56659a of _0x538ae7[_0x3f4621(0x1ad)][_0x3f4621(0x1c8)]){_0x83766b[_0x3f4621(0x1c6)](_0x56659a[_0x3f4621(0x1f7)][_0x3f4621(0x227)](),_0x56659a['id']);}recoverSegmentIdsFromPushRecovery(_0x15792b,_0x4f2ef0,_0x42b3a4[_0x3f4621(0x13c)]);for(const [_0x2aab1e,{definition:_0x46955c}]of _0x43a538){if(_0x4f2ef0[_0x3f4621(0x204)](_0x2aab1e)){_0x592693[_0x3f4621(0x1d0)]?.({'type':_0x3f4621(0x186),'journeyName':_0x15792b['yamlConfig']['name'],'segmentName':_0x2aab1e});continue;}const _0x4b9c63=generateDeterministicJourneySegmentName(_0x15792b['yamlConfig'][_0x3f4621(0x1f7)],_0x2aab1e);_0x592693['onProgress']?.({'type':_0x3f4621(0x213),'journeyName':_0x15792b[_0x3f4621(0x237)][_0x3f4621(0x1f7)],'segmentName':_0x2aab1e});const _0x13681e=createSegmentIdResolver(_0x42b3a4[_0x3f4621(0x13c)],_0x2aab1e),_0x1e8013=await resolveRuleSegmentIds(_0x46955c[_0x3f4621(0x17a)],_0x13681e),_0x12df92=await createOrRecoverEmbeddedSegment(_0x3eb271,_0x15792b,{'localName':_0x2aab1e,'uniqueSegmentName':_0x4b9c63,'description':_0x46955c[_0x3f4621(0x1f9)]||_0x3f4621(0x201)+_0x2aab1e,'journeyId':_0x456423,'resolvedRule':_0x1e8013,'parentId':_0x4cb216[_0x3f4621(0x14e)],'folderId':_0x4cb216['effectiveFolderId']||''},_0xd70d07);_0x4f2ef0[_0x3f4621(0x1c6)](_0x2aab1e,_0x12df92),_0x42b3a4['segmentNameToId'][_0x3f4621(0x1c6)](_0x2aab1e,_0x12df92),_0x592693['onProgress']?.({'type':_0x3f4621(0x186),'journeyName':_0x15792b['yamlConfig'][_0x3f4621(0x1f7)],'segmentName':_0x2aab1e});}const _0x2dd3df=new Map();for(const [_0x2cdc4a,_0x2e6e1a]of _0x23d37c){_0x592693[_0x3f4621(0x1d0)]?.({'type':_0x3f4621(0x182),'journeyName':_0x15792b[_0x3f4621(0x237)][_0x3f4621(0x1f7)],'activationName':_0x2cdc4a});const _0x527b48=await _0x1338d6(_0x2e6e1a,_0x42b3a4[_0x3f4621(0x18b)]),_0x1789b7={..._0x527b48,..._0x2e6e1a['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x2e6e1a[_0x3f4621(0x1cd)]}},_0x1e54b2=await _0x3eb271[_0x3f4621(0x1ff)]['createActivation'](_0x456423,_0x1789b7);_0x2dd3df[_0x3f4621(0x1c6)](_0x2cdc4a,_0x1e54b2['id']),_0x411df8[_0x3f4621(0x212)]['set'](_0x2cdc4a,_0x1e54b2['id']),_0x592693[_0x3f4621(0x1d0)]?.({'type':'embedded_activation_created','journeyName':_0x15792b[_0x3f4621(0x237)][_0x3f4621(0x1f7)],'activationName':_0x2cdc4a});}const _0x579d13=JSON['parse'](JSON[_0x3f4621(0x21e)](_0x582a4f));return _0x579d13['id']=_0x456423,ensureJourneyDefaults(_0x579d13[_0x3f4621(0x1ad)]),resolvePendingIdsInRequest(_0x579d13,_0x582a4f,_0x83766b,_0x4f2ef0,_0x2dd3df,_0x592693),await _0x3eb271[_0x3f4621(0x1ff)][_0x3f4621(0x177)](_0x456423,_0x579d13),deletePushRecovery(_0x15792b['absolutePath']),{'action':_0x3f4621(0x20c),'journeyId':_0x456423,'embeddedSegmentNameToId':_0x4f2ef0};}export function stripWaitStepPendingIds(_0xb8d5aa){const _0x37b63e=a140_0x374048,_0x25c368=_0xb8d5aa[_0x37b63e(0x1a9)]&&isPendingSegmentId(_0xb8d5aa['conditionSegmentId']),_0x612f3f=_0xb8d5aa[_0x37b63e(0x1f5)]?.[_0x37b63e(0x210)](_0x2216b2=>_0x2216b2[_0x37b63e(0x23b)]&&isPendingSegmentId(_0x2216b2[_0x37b63e(0x23b)]));(_0x25c368||_0x612f3f)&&(_0xb8d5aa[_0x37b63e(0x146)]='Duration',_0xb8d5aa['waitStep']=0x1,_0xb8d5aa[_0x37b63e(0x1db)]='day',delete _0xb8d5aa['conditionSegmentId'],delete _0xb8d5aa[_0x37b63e(0x165)],delete _0xb8d5aa[_0x37b63e(0x1c7)],delete _0xb8d5aa[_0x37b63e(0x1f5)]);}export function resolveWaitStepPendingIds(_0xfbed7f,_0x94821e,_0x58d4ec,_0x68c26a){const _0x52114f=a140_0x374048;if(_0x94821e[_0x52114f(0x1a9)]&&isPendingSegmentId(_0x94821e[_0x52114f(0x1a9)])){const _0x5178f9=_0x58d4ec(_0x94821e[_0x52114f(0x1a9)],_0x52114f(0x19e)+_0x68c26a+_0x52114f(0x18d));_0x5178f9&&(_0xfbed7f['waitStepType']=_0x52114f(0x1f4),_0xfbed7f[_0x52114f(0x1a9)]=_0x5178f9,delete _0xfbed7f[_0x52114f(0x217)],delete _0xfbed7f[_0x52114f(0x1db)],_0x94821e['conditionTimeoutDuration']!==undefined&&(_0xfbed7f['conditionTimeoutDuration']=_0x94821e['conditionTimeoutDuration']),_0x94821e[_0x52114f(0x1c7)]&&(_0xfbed7f[_0x52114f(0x1c7)]=_0x94821e[_0x52114f(0x1c7)]));}if(_0x94821e['conditions']){const _0x42dfaf=_0x94821e[_0x52114f(0x1f5)][_0x52114f(0x210)](_0x157e22=>_0x157e22[_0x52114f(0x23b)]&&isPendingSegmentId(_0x157e22[_0x52114f(0x23b)]));if(_0x42dfaf){const _0x1d2935=_0x94821e['conditions']['map'](_0x5d3f10=>{const _0xef9ed=_0x52114f;if(_0x5d3f10[_0xef9ed(0x23b)]&&isPendingSegmentId(_0x5d3f10['segmentId'])){const _0x3551e5=_0x58d4ec(_0x5d3f10['segmentId'],_0xef9ed(0x19e)+_0x68c26a+'\x27\x20wait\x20condition');return{..._0x5d3f10,'segmentId':_0x3551e5||_0x5d3f10[_0xef9ed(0x23b)]};}return{..._0x5d3f10};});_0xfbed7f['waitStepType']=_0x52114f(0x1f4),_0xfbed7f[_0x52114f(0x1f5)]=_0x1d2935,delete _0xfbed7f[_0x52114f(0x217)],delete _0xfbed7f[_0x52114f(0x1db)],delete _0xfbed7f[_0x52114f(0x1a9)],delete _0xfbed7f[_0x52114f(0x165)],delete _0xfbed7f[_0x52114f(0x1c7)];}}}function stripPendingIds(_0x300f13){const _0x3a81a3=a140_0x374048;_0x300f13[_0x3a81a3(0x1ad)][_0x3a81a3(0x20a)]?.['segmentId']&&isPendingSegmentId(_0x300f13[_0x3a81a3(0x1ad)][_0x3a81a3(0x20a)][_0x3a81a3(0x23b)])&&delete _0x300f13[_0x3a81a3(0x1ad)]['goal'];for(const _0x36f7a6 of _0x300f13[_0x3a81a3(0x1ad)][_0x3a81a3(0x1c8)]||[]){_0x36f7a6[_0x3a81a3(0x1d2)]?.[_0x3a81a3(0x23b)]&&isPendingSegmentId(_0x36f7a6[_0x3a81a3(0x1d2)][_0x3a81a3(0x23b)])&&delete _0x36f7a6[_0x3a81a3(0x1d2)];_0x36f7a6[_0x3a81a3(0x215)]?.[_0x3a81a3(0x23b)]&&isPendingSegmentId(_0x36f7a6['milestone'][_0x3a81a3(0x23b)])&&delete _0x36f7a6[_0x3a81a3(0x215)];_0x36f7a6['exitCriterias']&&(_0x36f7a6[_0x3a81a3(0x222)]=_0x36f7a6[_0x3a81a3(0x222)][_0x3a81a3(0x168)](_0x5989d4=>!_0x5989d4[_0x3a81a3(0x23b)]||!isPendingSegmentId(_0x5989d4[_0x3a81a3(0x23b)])));if(_0x36f7a6[_0x3a81a3(0x1c0)])for(const _0x77e731 of Object['keys'](_0x36f7a6[_0x3a81a3(0x1c0)])){const _0x579a82=_0x36f7a6['steps'][_0x77e731];_0x579a82[_0x3a81a3(0x1f0)]===_0x3a81a3(0x1fc)&&_0x579a82[_0x3a81a3(0x184)]&&isPendingActivationId(_0x579a82['journeyActivationStepId'])&&(_0x579a82['journeyActivationStepId']='');if(_0x579a82['type']===_0x3a81a3(0x1c2)&&_0x579a82[_0x3a81a3(0x20b)])for(const _0xbff252 of _0x579a82[_0x3a81a3(0x20b)]){_0xbff252[_0x3a81a3(0x23b)]&&isPendingSegmentId(_0xbff252[_0x3a81a3(0x23b)])&&(_0xbff252[_0x3a81a3(0x23b)]='');}_0x579a82[_0x3a81a3(0x1f0)]===_0x3a81a3(0x1f1)&&stripWaitStepPendingIds(_0x579a82);}}}function resolvePendingIdsInRequest(_0x5f4014,_0x30ea3a,_0x219b0a,_0x22c71d,_0x1236cf,_0x4119ba){const _0x1f500a=a140_0x374048,_0x2e2518=(_0x2e722d,_0x2a2ee0)=>{const _0x5a91a1=a140_0x2c7d;if(!isPendingSegmentId(_0x2e722d))return _0x2e722d;const _0x2d7255=extractPendingSegmentName(_0x2e722d),_0x178c42=_0x22c71d[_0x5a91a1(0x203)](_0x2d7255);return!_0x178c42&&_0x4119ba[_0x5a91a1(0x140)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x2d7255+_0x5a91a1(0x1e2)+_0x2a2ee0),_0x178c42;};if(_0x5f4014[_0x1f500a(0x1ad)][_0x1f500a(0x20a)]?.[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x5f4014['attributes']['goal'][_0x1f500a(0x23b)])){const _0xe8d8ea=_0x2e2518(_0x5f4014[_0x1f500a(0x1ad)]['goal']['segmentId'],_0x1f500a(0x18a));_0xe8d8ea&&(_0x5f4014[_0x1f500a(0x1ad)][_0x1f500a(0x20a)][_0x1f500a(0x23b)]=_0xe8d8ea);}for(const _0x5c5e2e of _0x5f4014[_0x1f500a(0x1ad)][_0x1f500a(0x1c8)]||[]){const _0x344242=_0x219b0a['get'](_0x5c5e2e[_0x1f500a(0x1f7)]['toLowerCase']());_0x344242&&(_0x5c5e2e['id']=_0x344242);if(_0x5c5e2e[_0x1f500a(0x1d2)]?.[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x5c5e2e['entryCriteria'][_0x1f500a(0x23b)])){const _0x159536=_0x2e2518(_0x5c5e2e[_0x1f500a(0x1d2)][_0x1f500a(0x23b)],'stage\x20\x27'+_0x5c5e2e[_0x1f500a(0x1f7)]+_0x1f500a(0x151));_0x159536&&(_0x5c5e2e['entryCriteria'][_0x1f500a(0x23b)]=_0x159536);}if(_0x5c5e2e[_0x1f500a(0x222)])for(const _0x1e36ff of _0x5c5e2e['exitCriterias']){if(_0x1e36ff[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x1e36ff[_0x1f500a(0x23b)])){const _0x542324=_0x2e2518(_0x1e36ff[_0x1f500a(0x23b)],_0x1f500a(0x19e)+_0x5c5e2e['name']+_0x1f500a(0x185));_0x542324&&(_0x1e36ff[_0x1f500a(0x23b)]=_0x542324);}}if(_0x5c5e2e['milestone']?.[_0x1f500a(0x23b)]&&isPendingSegmentId(_0x5c5e2e['milestone'][_0x1f500a(0x23b)])){const _0x32a225=_0x2e2518(_0x5c5e2e[_0x1f500a(0x215)][_0x1f500a(0x23b)],_0x1f500a(0x19e)+_0x5c5e2e[_0x1f500a(0x1f7)]+'\x27\x20milestone');_0x32a225&&(_0x5c5e2e[_0x1f500a(0x215)]['segmentId']=_0x32a225);}if(_0x5c5e2e['steps']){const _0x48a940=_0x209bbf=>_0x30ea3a[_0x1f500a(0x1ad)][_0x1f500a(0x1c8)]?.[_0x1f500a(0x1a7)](_0x526d08=>_0x526d08[_0x1f500a(0x1f7)][_0x1f500a(0x227)]()===_0x5c5e2e[_0x1f500a(0x1f7)][_0x1f500a(0x227)]())?.[_0x1f500a(0x1c0)]?.[_0x209bbf];for(const _0x2c76cf of Object[_0x1f500a(0x1b7)](_0x5c5e2e[_0x1f500a(0x1c0)])){const _0x1fa260=_0x5c5e2e[_0x1f500a(0x1c0)][_0x2c76cf],_0x41c1c1=_0x48a940(_0x2c76cf);if(_0x1fa260[_0x1f500a(0x1f0)]===_0x1f500a(0x1fc)&&_0x1fa260[_0x1f500a(0x184)]&&(isPendingActivationId(_0x1fa260[_0x1f500a(0x184)])||_0x1fa260['journeyActivationStepId']==='')){if(_0x41c1c1?.[_0x1f500a(0x184)]&&isPendingActivationId(_0x41c1c1[_0x1f500a(0x184)])){const _0x187b74=extractPendingActivationName(_0x41c1c1[_0x1f500a(0x184)]),_0x2d1290=_0x1236cf[_0x1f500a(0x203)](_0x187b74);_0x2d1290&&(_0x1fa260['journeyActivationStepId']=_0x2d1290);}}if(_0x1fa260[_0x1f500a(0x1f0)]==='DecisionPoint'&&_0x1fa260[_0x1f500a(0x20b)]&&_0x41c1c1?.[_0x1f500a(0x20b)])for(let _0x47ce7d=0x0;_0x47ce7d<_0x1fa260[_0x1f500a(0x20b)][_0x1f500a(0x175)];_0x47ce7d++){const _0x48f7bd=_0x1fa260[_0x1f500a(0x20b)][_0x47ce7d],_0x28fdae=_0x41c1c1[_0x1f500a(0x20b)][_0x47ce7d];if(_0x28fdae?.['segmentId']&&isPendingSegmentId(_0x28fdae[_0x1f500a(0x23b)])){const _0x5b14e5=_0x2e2518(_0x28fdae[_0x1f500a(0x23b)],_0x1f500a(0x19e)+_0x5c5e2e['name']+_0x1f500a(0x20e)+(_0x48f7bd[_0x1f500a(0x1f7)]||_0x47ce7d)+'\x27');_0x5b14e5&&(_0x48f7bd['segmentId']=_0x5b14e5);}}_0x1fa260[_0x1f500a(0x1f0)]===_0x1f500a(0x1f1)&&_0x41c1c1?.['type']==='WaitStep'&&resolveWaitStepPendingIds(_0x1fa260,_0x41c1c1,_0x2e2518,_0x5c5e2e['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xa121f0,_0x5dfd03){const _0xc7ee7d=a141_0x2f40,_0x4f6df2=_0xa121f0();while(!![]){try{const _0x5189f4=-parseInt(_0xc7ee7d(0xd2))/0x1*(parseInt(_0xc7ee7d(0xd7))/0x2)+parseInt(_0xc7ee7d(0xd4))/0x3*(-parseInt(_0xc7ee7d(0xce))/0x4)+parseInt(_0xc7ee7d(0xda))/0x5+-parseInt(_0xc7ee7d(0xd0))/0x6+-parseInt(_0xc7ee7d(0xd1))/0x7*(parseInt(_0xc7ee7d(0xd8))/0x8)+-parseInt(_0xc7ee7d(0xd6))/0x9*(parseInt(_0xc7ee7d(0xdc))/0xa)+parseInt(_0xc7ee7d(0xcd))/0xb;if(_0x5189f4===_0x5dfd03)break;else _0x4f6df2['push'](_0x4f6df2['shift']());}catch(_0x1e931e){_0x4f6df2['push'](_0x4f6df2['shift']());}}}(a141_0x4960,0x7613f));export function buildFolderIdToPathMap(_0x4e7481){const _0x14058e=a141_0x2f40,_0x38a855=new Map(),_0x5a4cb7=new Map();for(const _0x2d0b85 of _0x4e7481){_0x5a4cb7[_0x14058e(0xdb)](_0x2d0b85['id'],_0x2d0b85);}const _0x5087a2=new Set();for(const _0x368e35 of _0x4e7481){!_0x368e35[_0x14058e(0xd9)]&&_0x5087a2[_0x14058e(0xcc)](_0x368e35['id']);}function _0x10673a(_0x221ced){const _0x261567=_0x14058e;if(_0x38a855[_0x261567(0xd3)](_0x221ced['id']))return _0x38a855['get'](_0x221ced['id']);if(_0x5087a2[_0x261567(0xd3)](_0x221ced['id']))return _0x38a855[_0x261567(0xdb)](_0x221ced['id'],''),'';if(_0x221ced[_0x261567(0xd9)]){const _0x469faf=_0x5a4cb7['get'](_0x221ced['parentFolderId']);if(_0x469faf){const _0x158c07=_0x10673a(_0x469faf),_0x30b5dc=_0x158c07?_0x158c07+'/'+_0x221ced[_0x261567(0xd5)]:_0x221ced[_0x261567(0xd5)];return _0x38a855[_0x261567(0xdb)](_0x221ced['id'],_0x30b5dc),_0x30b5dc;}}const _0x447042=_0x221ced[_0x261567(0xd5)];return _0x38a855[_0x261567(0xdb)](_0x221ced['id'],_0x447042),_0x447042;}for(const _0x305b10 of _0x4e7481){_0x10673a(_0x305b10);}return _0x38a855;}export function buildFolderPathToIdMap(_0x238b66){const _0xa7d0d8=a141_0x2f40,_0x323307=new Map(),_0x26156d=new Map();for(const _0x9077e of _0x238b66){_0x26156d[_0xa7d0d8(0xdb)](_0x9077e['id'],_0x9077e);}const _0x47da3b=new Set();for(const _0xdeeac6 of _0x238b66){!_0xdeeac6[_0xa7d0d8(0xd9)]&&_0x47da3b['add'](_0xdeeac6['id']);}function _0x5d31b4(_0x1c156b){const _0x1e24f1=_0xa7d0d8;if(_0x47da3b['has'](_0x1c156b['id']))return'';if(_0x1c156b[_0x1e24f1(0xd9)]){const _0x29f103=_0x26156d['get'](_0x1c156b[_0x1e24f1(0xd9)]);if(_0x29f103){const _0x48f6b5=_0x5d31b4(_0x29f103);return _0x48f6b5?_0x48f6b5+'/'+_0x1c156b[_0x1e24f1(0xd5)]:_0x1c156b[_0x1e24f1(0xd5)];}}return _0x1c156b[_0x1e24f1(0xd5)];}for(const _0x15ed44 of _0x238b66){const _0x5d11a6=_0x5d31b4(_0x15ed44);_0x323307['set'](_0x5d11a6,_0x15ed44['id']);}return _0x323307;}function a141_0x2f40(_0x139372,_0x37a776){_0x139372=_0x139372-0xcc;const _0x496025=a141_0x4960();let _0x2f40f2=_0x496025[_0x139372];return _0x2f40f2;}export function buildFolderMaps(_0x993516){const _0x25c795=a141_0x2f40,_0x3e5ca2=buildFolderIdToPathMap(_0x993516),_0x4cd6f1=new Map();for(const [_0x44c578,_0x15ed0e]of _0x3e5ca2){_0x4cd6f1[_0x25c795(0xdb)](_0x15ed0e,_0x44c578);}return{'idToPath':_0x3e5ca2,'pathToId':_0x4cd6f1};}export function getFolderPath(_0x1d8a1d,_0x462b45){const _0x25ddb1=a141_0x2f40;if(!_0x1d8a1d)return'';return _0x462b45[_0x25ddb1(0xcf)](_0x1d8a1d)??'';}function a141_0x4960(){const _0x3c4f69=['3647960JzzMse','set','4870gXeCfm','add','28212492rtXULM','922788iCmLLn','get','2624898cGKyCP','29771XlaFMc','1699JjlWxJ','has','6HjQNgN','name','17118SRSECF','254eHRGVz','1448WniNge','parentFolderId'];a141_0x4960=function(){return _0x3c4f69;};return a141_0x4960();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x22fd64,_0xd05e54){const _0x38506c=a142_0x1808,_0x31e788=_0x22fd64();while(!![]){try{const _0x101b23=-parseInt(_0x38506c(0x19e))/0x1*(parseInt(_0x38506c(0x19a))/0x2)+parseInt(_0x38506c(0x198))/0x3+-parseInt(_0x38506c(0x1b1))/0x4*(parseInt(_0x38506c(0x1c1))/0x5)+parseInt(_0x38506c(0x192))/0x6+parseInt(_0x38506c(0x1b8))/0x7+parseInt(_0x38506c(0x1b7))/0x8+parseInt(_0x38506c(0x19c))/0x9*(-parseInt(_0x38506c(0x191))/0xa);if(_0x101b23===_0xd05e54)break;else _0x31e788['push'](_0x31e788['shift']());}catch(_0x33891a){_0x31e788['push'](_0x31e788['shift']());}}}(a142_0x22b5,0x18750));import a142_0x337b63 from'path';import{parse as a142_0x3280b8}from'yaml';function a142_0x1808(_0x65d2f1,_0x148815){_0x65d2f1=_0x65d2f1-0x18f;const _0x22b50b=a142_0x22b5();let _0x180866=_0x22b50b[_0x65d2f1];return _0x180866;}function a142_0x22b5(){const _0x108eee=['Cannot\x20split\x20empty\x20path','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','4gCcqYl','slice','name','relative','parent_segment','.yaml','1441416iWAEJt','876001PQGNZY','isAbsolute','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','Path\x20segment\x20cannot\x20be\x20empty','pop','No\x20tdx.json\x20found\x20for\x20file:\x20','journey','exists','type','888715VKjpOS','Cannot\x20navigate\x20above\x20root','trim','length','3370pOgawh','468354Zgayyt','filter','Relative\x20path\x20cannot\x20be\x20empty','Path\x20attempts\x20to\x20navigate\x20above\x20root','endsWith','.yml','532806ISFbqY','parse','1726xRNtNH','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','6822LWCCGd','segments','32rmJNxC','substring','segment','root','startsWith','replace','dirname','test','split','Path\x20cannot\x20be\x20empty','raw','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','readFile','push','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','join','resolve'];a142_0x22b5=function(){return _0x108eee;};return a142_0x22b5();}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x17477c){const _0x180a31=a142_0x1808;if(!_0x17477c||_0x17477c[_0x180a31(0x18f)]()==='')throw new Error(_0x180a31(0x1a7));const _0x39e5db=_0x17477c[_0x180a31(0x18f)]();if(_0x39e5db==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x17477c};const _0x496f0f=_0x39e5db[_0x180a31(0x1a2)]('/')?_0x39e5db[_0x180a31(0x19f)](0x1):_0x39e5db,_0x2896e0=_0x496f0f[_0x180a31(0x1a6)]('/')[_0x180a31(0x193)](_0x334cf6=>_0x334cf6!=='');if(_0x2896e0[_0x180a31(0x190)]===0x0)throw new Error(_0x180a31(0x1b0));const _0x267e98=_0x39e5db[_0x180a31(0x1a2)]('/')||!isRelativePathSegment(_0x2896e0[0x0]);for(const _0xf49390 of _0x2896e0){validatePathSegment(_0xf49390);}return{'segments':_0x2896e0,'isAbsolute':_0x267e98,'raw':_0x17477c};}function isRelativePathSegment(_0x4f62ad){return _0x4f62ad==='.'||_0x4f62ad==='..';}function validatePathSegment(_0x1ba178){const _0x4f0817=a142_0x1808;if(_0x1ba178==='')throw new Error(_0x4f0817(0x1bb));if(_0x1ba178==='.'||_0x1ba178==='..')return;if(/[\x00-\x1F\x7F]/[_0x4f0817(0x1a5)](_0x1ba178))throw new Error(_0x4f0817(0x1a9)+_0x1ba178);if(_0x1ba178!==_0x1ba178[_0x4f0817(0x18f)]()){}}export function validatePath(_0x5298e1){const _0x3ed34b=a142_0x1808;if(_0x5298e1[_0x3ed34b(0x19d)][_0x3ed34b(0x190)]===0x0&&!_0x5298e1[_0x3ed34b(0x1b9)])throw new Error(_0x3ed34b(0x194));if(_0x5298e1[_0x3ed34b(0x1b9)]){if(_0x5298e1['segments'][0x0]==='..')throw new Error(_0x3ed34b(0x1ba));let _0x302a01=0x0;for(const _0x56f7c4 of _0x5298e1[_0x3ed34b(0x19d)]){if(_0x56f7c4==='..'){if(_0x302a01===0x0)throw new Error(_0x3ed34b(0x195));_0x302a01--;}else _0x56f7c4!=='.'&&_0x302a01++;}}}export function joinPaths(_0x486dce,_0x3163c4){const _0x413fb3=a142_0x1808;if(!_0x486dce||_0x486dce==='/')return _0x3163c4;if(!_0x3163c4||_0x3163c4==='.')return _0x486dce;if(_0x3163c4['startsWith']('/'))return _0x3163c4;const _0x2fae59=parsePath(_0x486dce),_0x1c079c=parsePath(_0x3163c4),_0x3a2bc1=[..._0x2fae59[_0x413fb3(0x19d)]];for(const _0x417611 of _0x1c079c[_0x413fb3(0x19d)]){if(_0x417611==='.')continue;else{if(_0x417611==='..'){if(_0x3a2bc1[_0x413fb3(0x190)]===0x0)throw new Error(_0x413fb3(0x1c2));_0x3a2bc1[_0x413fb3(0x1bc)]();}else _0x3a2bc1[_0x413fb3(0x1ab)](_0x417611);}}const _0x54d538=_0x3a2bc1[_0x413fb3(0x1ad)]('/');return _0x2fae59[_0x413fb3(0x1a8)][_0x413fb3(0x1a2)]('/')?'/'+_0x54d538:_0x54d538;}export function normalizePath(_0x31802d){const _0x469dd9=a142_0x1808,_0x240043=parsePath(_0x31802d),_0x2d86b2=[];for(const _0x471ea7 of _0x240043[_0x469dd9(0x19d)]){if(_0x471ea7==='.')continue;else{if(_0x471ea7==='..'){if(_0x2d86b2['length']===0x0){if(_0x240043['isAbsolute'])throw new Error(_0x469dd9(0x1c2));_0x2d86b2[_0x469dd9(0x1ab)]('..');}else _0x2d86b2[_0x2d86b2[_0x469dd9(0x190)]-0x1]==='..'?_0x2d86b2[_0x469dd9(0x1ab)]('..'):_0x2d86b2[_0x469dd9(0x1bc)]();}else _0x2d86b2[_0x469dd9(0x1ab)](_0x471ea7);}}if(_0x2d86b2[_0x469dd9(0x190)]===0x0)return _0x240043[_0x469dd9(0x1b9)]?'/':'.';const _0x23be90=_0x2d86b2['join']('/');return _0x240043['raw']['startsWith']('/')?'/'+_0x23be90:_0x23be90;}export function getParentPath(_0x11e61a){const _0x3f7ae=a142_0x1808,_0x373ead=parsePath(_0x11e61a);if(_0x373ead['segments'][_0x3f7ae(0x190)]<=0x1)return'/';const _0x451b9f=_0x373ead[_0x3f7ae(0x19d)]['slice'](0x0,-0x1)[_0x3f7ae(0x1ad)]('/');return _0x373ead[_0x3f7ae(0x1a8)]['startsWith']('/')?'/'+_0x451b9f:_0x451b9f;}export function getBaseName(_0x425a12){const _0x1cb479=a142_0x1808,_0x14d305=parsePath(_0x425a12);return _0x14d305[_0x1cb479(0x19d)][_0x14d305['segments'][_0x1cb479(0x190)]-0x1]||'';}export function isChildPath(_0x390db7,_0x5b38ea){const _0x378262=a142_0x1808,_0x252690=parsePath(_0x390db7),_0x39b6bf=parsePath(_0x5b38ea);if(_0x252690[_0x378262(0x19d)][_0x378262(0x190)]<=_0x39b6bf[_0x378262(0x19d)][_0x378262(0x190)])return![];for(let _0x43e4ed=0x0;_0x43e4ed<_0x39b6bf[_0x378262(0x19d)][_0x378262(0x190)];_0x43e4ed++){if(_0x252690[_0x378262(0x19d)][_0x43e4ed]!==_0x39b6bf[_0x378262(0x19d)][_0x43e4ed])return![];}return!![];}export function splitPath(_0x131afc){const _0x9e6c4e=a142_0x1808,_0x35df23=parsePath(_0x131afc);if(_0x35df23[_0x9e6c4e(0x19d)][_0x9e6c4e(0x190)]===0x0)throw new Error(_0x9e6c4e(0x1af));if(_0x35df23[_0x9e6c4e(0x19d)][_0x9e6c4e(0x190)]===0x1)return{'parent':_0x35df23[_0x9e6c4e(0x19d)][0x0]};return{'parent':_0x35df23[_0x9e6c4e(0x19d)][0x0],'child':_0x35df23[_0x9e6c4e(0x19d)][_0x9e6c4e(0x1b2)](0x1)[_0x9e6c4e(0x1ad)]('/')};}export function isYamlFilePath(_0x267788){const _0x58a566=a142_0x1808;return _0x267788[_0x58a566(0x196)](_0x58a566(0x197))||_0x267788[_0x58a566(0x196)](_0x58a566(0x1b6));}export async function resolveYamlFilePath(_0x19538c,_0x59c889=nodeFileSystem){const _0x1f80b4=a142_0x1808,_0x2dec04=a142_0x337b63[_0x1f80b4(0x1ae)](_0x19538c);if(!await _0x59c889[_0x1f80b4(0x1bf)](_0x2dec04))throw new Error('File\x20not\x20found:\x20'+_0x19538c);let _0x2952db=a142_0x337b63[_0x1f80b4(0x1a4)](_0x2dec04),_0x487574=null,_0x40fcdf=null;const _0x49f4c6=a142_0x337b63[_0x1f80b4(0x199)](_0x2952db)[_0x1f80b4(0x1a1)];while(_0x2952db!==_0x49f4c6){const _0x23ad63=a142_0x337b63[_0x1f80b4(0x1ad)](_0x2952db,'tdx.json');if(await _0x59c889[_0x1f80b4(0x1bf)](_0x23ad63)){_0x487574=_0x23ad63,_0x40fcdf=_0x2952db;break;}_0x2952db=a142_0x337b63[_0x1f80b4(0x1a4)](_0x2952db);}if(!_0x487574||!_0x40fcdf)throw new Error(_0x1f80b4(0x1bd)+_0x19538c+'\x0a'+_0x1f80b4(0x1ac));const _0x3e5732=await _0x59c889[_0x1f80b4(0x1aa)](_0x487574),_0x25891e=JSON[_0x1f80b4(0x199)](_0x3e5732),_0x182feb=_0x25891e[_0x1f80b4(0x1b5)];if(!_0x182feb)throw new Error(_0x1f80b4(0x19b));const _0x8a4308=await _0x59c889[_0x1f80b4(0x1aa)](_0x2dec04),_0x4ea419=a142_0x3280b8(_0x8a4308),_0x44b992=_0x4ea419[_0x1f80b4(0x1b3)];if(!_0x44b992)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x19538c);const _0x53b23b=_0x4ea419[_0x1f80b4(0x1c0)]==='journey'?_0x1f80b4(0x1be):_0x1f80b4(0x1a0),_0x2dde04=a142_0x337b63[_0x1f80b4(0x1b4)](_0x40fcdf,_0x2dec04),_0x5cec1a=a142_0x337b63[_0x1f80b4(0x1a4)](_0x2dde04),_0x5d53c7=_0x5cec1a==='.'?'':_0x5cec1a[_0x1f80b4(0x1a3)](/\\/g,'/'),_0x2d1db5=_0x5d53c7?_0x182feb+'/'+_0x5d53c7+'/'+_0x44b992:_0x182feb+'/'+_0x44b992;return{'parentSegment':_0x182feb,'segmentName':_0x44b992,'folderPath':_0x5d53c7,'fullPath':_0x2d1db5,'resourceType':_0x53b23b,'content':_0x8a4308};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x158f85,_0x21858a){const _0x406cda=a143_0x41ec,_0x2d060b=_0x158f85();while(!![]){try{const _0x219f6d=-parseInt(_0x406cda(0x91))/0x1*(parseInt(_0x406cda(0x90))/0x2)+-parseInt(_0x406cda(0x87))/0x3*(-parseInt(_0x406cda(0x8e))/0x4)+parseInt(_0x406cda(0x86))/0x5+-parseInt(_0x406cda(0x83))/0x6*(-parseInt(_0x406cda(0x85))/0x7)+-parseInt(_0x406cda(0x89))/0x8*(parseInt(_0x406cda(0x8a))/0x9)+-parseInt(_0x406cda(0x8b))/0xa+-parseInt(_0x406cda(0x88))/0xb;if(_0x219f6d===_0x21858a)break;else _0x2d060b['push'](_0x2d060b['shift']());}catch(_0x274006){_0x2d060b['push'](_0x2d060b['shift']());}}}(a143_0x4570,0xf3805));export function parseSegmentRef(_0x1a3865){const _0x372dd0=a143_0x41ec,_0x598a63=_0x1a3865[_0x372dd0(0x84)]('/');if(_0x598a63===-0x1)return{'parentId':_0x1a3865};if(_0x598a63===0x0)throw new Error(_0x372dd0(0x8d)+_0x1a3865+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x33ec34=_0x1a3865[_0x372dd0(0x8c)](0x0,_0x598a63),_0x478d32=_0x1a3865[_0x372dd0(0x8c)](_0x598a63+0x1);if(_0x478d32==='')throw new Error(_0x372dd0(0x8d)+_0x1a3865+_0x372dd0(0x8f));return{'parentId':_0x33ec34,'childId':_0x478d32};}function a143_0x41ec(_0x249fc3,_0x58acfd){_0x249fc3=_0x249fc3-0x83;const _0x45700b=a143_0x4570();let _0x41ecf2=_0x45700b[_0x249fc3];return _0x41ecf2;}function a143_0x4570(){const _0x451c46=['6738460TkjiUe','3RYjaLD','382371tZhlHy','15592sJNFMZ','5373LjGhXL','1732930UampuY','substring','Invalid\x20segment\x20reference\x20format:\x20','5467556KVaIGS','.\x20Child\x20name\x20cannot\x20be\x20empty','710164ruMedy','2zsbUUH','6tELiUt','indexOf','2551997jGpZJD'];a143_0x4570=function(){return _0x451c46;};return a143_0x4570();}
|