@treasuredata/tdx 2026.3.50 → 2026.3.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts +1 -0
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +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.d.ts +21 -4
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a151_0x3dca48=a151_0x1b24;(function(_0x276571,_0xae9608){const _0x4ef68e=a151_0x1b24,_0x5bbf98=_0x276571();while(!![]){try{const _0x40b406=-parseInt(_0x4ef68e(0x200))/0x1*(-parseInt(_0x4ef68e(0x224))/0x2)+parseInt(_0x4ef68e(0x197))/0x3*(-parseInt(_0x4ef68e(0x16f))/0x4)+parseInt(_0x4ef68e(0x1d8))/0x5*(parseInt(_0x4ef68e(0x17f))/0x6)+-parseInt(_0x4ef68e(0x1a1))/0x7+parseInt(_0x4ef68e(0x1b1))/0x8*(parseInt(_0x4ef68e(0x190))/0x9)+-parseInt(_0x4ef68e(0x1da))/0xa*(-parseInt(_0x4ef68e(0x1f0))/0xb)+-parseInt(_0x4ef68e(0x15f))/0xc;if(_0x40b406===_0xae9608)break;else _0x5bbf98['push'](_0x5bbf98['shift']());}catch(_0x6ac668){_0x5bbf98['push'](_0x5bbf98['shift']());}}}(a151_0x4fc4,0x7706c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x3dca48(0x202));export const PENDING_SEGMENT_PREFIX=a151_0x3dca48(0x134);export const PENDING_ACTIVATION_PREFIX=a151_0x3dca48(0x1fe);export function createPendingSegmentId(_0x495bbb){return''+PENDING_SEGMENT_PREFIX+_0x495bbb+'__';}export function isPendingSegmentId(_0x480a7c){const _0x5b2aaa=a151_0x3dca48;return _0x480a7c[_0x5b2aaa(0x1fb)](PENDING_SEGMENT_PREFIX)&&!_0x480a7c['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x2e8005){const _0x13991a=a151_0x3dca48;return _0x2e8005[_0x13991a(0x161)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3004d5){return''+PENDING_ACTIVATION_PREFIX+_0x3004d5+'__';}export function isPendingActivationId(_0x463056){const _0xe875ee=a151_0x3dca48;return _0x463056[_0xe875ee(0x1fb)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xe56a64){const _0xcc03be=a151_0x3dca48;return _0xe56a64[_0xcc03be(0x161)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x28805f,_0x528547){const _0x337f6b=a151_0x3dca48,_0x2564ad=_0x28805f+'::'+(_0x528547[_0x337f6b(0x189)]()||_0x337f6b(0x1b6)),_0x5a1353=createHash(_0x337f6b(0x238))['update'](_0x2564ad)[_0x337f6b(0x171)](_0x337f6b(0x20e))[_0x337f6b(0x1c3)](0x0,0xc);return _0x337f6b(0x166)+_0x5a1353;}function a151_0x1b24(_0x1f1c79,_0x48c14e){_0x1f1c79=_0x1f1c79-0x133;const _0x4fc478=a151_0x4fc4();let _0x1b24ca=_0x4fc478[_0x1f1c79];return _0x1b24ca;}export function ensureJourneyDefaults(_0x4eac32){const _0x59f255=a151_0x3dca48;!_0x4eac32['description']&&(_0x4eac32['description']=''),!_0x4eac32[_0x59f255(0x239)]&&(_0x4eac32[_0x59f255(0x239)]=_0x59f255(0x1be));}export function injectExistingStageIds(_0x53eef2,_0x1c119f){const _0xa1782f=a151_0x3dca48,_0x4014e5=new Map(_0x1c119f[_0xa1782f(0x237)](_0x3df6f7=>[_0x3df6f7[_0xa1782f(0x1a5)],_0x3df6f7['id']]));for(const _0x46c813 of _0x53eef2){if(!_0x46c813['id']){const _0xf4d631=_0x4014e5['get'](_0x46c813['name']);_0xf4d631&&(_0x46c813['id']=_0xf4d631);}}}export function resolveTDFolderPath(_0x1333a4,_0x4867ed,_0x538940){if(!_0x4867ed)return _0x1333a4;if(_0x1333a4===_0x538940||_0x1333a4['startsWith'](_0x538940+'/'))return _0x1333a4;return _0x1333a4?_0x538940+'/'+_0x1333a4:_0x538940;}export function addFoldersToCreate(_0x517d9f,_0x2ce997,_0x13aa0a){const _0x11f107=a151_0x3dca48;if(!_0x517d9f)return;if(_0x2ce997[_0x11f107(0x232)](_0x517d9f))return;const _0x196c3e=_0x517d9f[_0x11f107(0x1d3)]('/');let _0x4fb439='';for(const _0x35d31a of _0x196c3e){_0x4fb439=_0x4fb439?_0x4fb439+'/'+_0x35d31a:_0x35d31a,!_0x2ce997[_0x11f107(0x232)](_0x4fb439)&&_0x13aa0a[_0x11f107(0x158)](_0x4fb439);}}export function sortFoldersByDepth(_0x1fe3e8){const _0x30a8ce=a151_0x3dca48;return[..._0x1fe3e8][_0x30a8ce(0x1e0)]((_0x5bc1bd,_0x290056)=>{const _0x550b67=_0x30a8ce,_0x418a86=(_0x5bc1bd[_0x550b67(0x19d)](/\//g)||[])[_0x550b67(0x14a)],_0x4f7270=(_0x290056[_0x550b67(0x19d)](/\//g)||[])[_0x550b67(0x14a)];return _0x418a86-_0x4f7270;});}import*as a151_0x2931b5 from'yaml';import{readFileSync}from'fs';import a151_0x38937e from'path';import{isJourneyDef,parseYamlString as a151_0x1f20c,toYamlString as a151_0x290451,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(_0xac3b01){const _0x5ec7e0=a151_0x3dca48;if(Array[_0x5ec7e0(0x162)](_0xac3b01))return'['+_0xac3b01[_0x5ec7e0(0x237)](_0x23a435=>stableStringify(_0x23a435))[_0x5ec7e0(0x1b5)](',')+']';if(_0xac3b01&&typeof _0xac3b01===_0x5ec7e0(0x15d)){const _0x16ce4d=_0xac3b01,_0x25c5e7=Object[_0x5ec7e0(0x143)](_0x16ce4d)['sort'](),_0x7628cf=_0x25c5e7[_0x5ec7e0(0x237)](_0x53a662=>'\x22'+_0x53a662+'\x22:'+stableStringify(_0x16ce4d[_0x53a662]));return'{'+_0x7628cf[_0x5ec7e0(0x1b5)](',')+'}';}const _0x48d8fa=JSON[_0x5ec7e0(0x1eb)](_0xac3b01);return _0x48d8fa===undefined?_0x5ec7e0(0x157):_0x48d8fa;}function activationSignature(_0x3c8acc){const _0x50163a=a151_0x3dca48,_0xc3a648={'connection':_0x3c8acc[_0x50163a(0x231)],..._0x3c8acc['all_columns']!==undefined&&{'all_columns':_0x3c8acc['all_columns']},..._0x3c8acc[_0x50163a(0x141)]!==undefined&&{'columns':_0x3c8acc[_0x50163a(0x141)]},..._0x3c8acc[_0x50163a(0x142)]!==undefined&&{'behavior':_0x3c8acc[_0x50163a(0x142)]},..._0x3c8acc[_0x50163a(0x17e)]!==undefined&&{'schedule':_0x3c8acc[_0x50163a(0x17e)]},..._0x3c8acc['notification']!==undefined&&{'notification':_0x3c8acc['notification']},..._0x3c8acc[_0x50163a(0x13f)]!==undefined&&{'connector_config':_0x3c8acc[_0x50163a(0x13f)]},..._0x3c8acc[_0x50163a(0x221)]!==undefined&&{'activation_template_id':_0x3c8acc[_0x50163a(0x221)]}};return stableStringify(_0xc3a648);}async function fetchSegment(_0x68bf8d,_0x1b138a,_0x2211e5,_0x4d7dda){const _0x1a263d=a151_0x3dca48,_0x57d73f=_0x4d7dda?.['find'](_0x1b84de=>_0x1b84de['id']===_0x2211e5);if(_0x57d73f)return _0x57d73f;try{return await _0x68bf8d[_0x1a263d(0x1b6)]['getSegment'](_0x1b138a,_0x2211e5);}catch(_0x4374b4){logger[_0x1a263d(0x1d5)](_0x1a263d(0x1a0)+_0x2211e5+_0x1a263d(0x181)+_0x4374b4);try{return await _0x68bf8d[_0x1a263d(0x1b6)][_0x1a263d(0x133)](_0x2211e5);}catch(_0x3bab4b){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x2211e5+':\x20'+_0x3bab4b),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3ba76e,_0x3abc22,_0x4d5d25){const _0x545289=a151_0x3dca48,_0x588d08=readPushRecovery(_0x3ba76e[_0x545289(0x155)]);if(_0x588d08?.[_0x545289(0x1d2)]===_0x3ba76e[_0x545289(0x1f3)][_0x545289(0x1a5)])for(const [_0x47744c,_0x463d05]of Object['entries'](_0x588d08['segments'])){const _0x32af33=generateDeterministicJourneySegmentName(_0x3ba76e['yamlConfig'][_0x545289(0x1a5)],_0x47744c);_0x463d05['uniqueServerName']===_0x32af33&&(_0x3abc22[_0x545289(0x153)](_0x47744c,_0x463d05[_0x545289(0x1f5)]),_0x4d5d25['set'](_0x47744c,_0x463d05['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x20d1b0,_0x22bd83,_0x8363ac,_0x1a5c26){const _0x59baa4=a151_0x3dca48;let _0x17697d;try{_0x17697d=await _0x20d1b0['segment'][_0x59baa4(0x210)]({'name':_0x8363ac[_0x59baa4(0x1f6)],'description':_0x8363ac['description'],'journeyId':_0x8363ac['journeyId'],'rule':_0x1a5c26(_0x8363ac[_0x59baa4(0x188)],!![]),'countPopulation':!![],'parentFolderId':_0x8363ac[_0x59baa4(0x18c)],'audienceId':_0x8363ac[_0x59baa4(0x1cf)]});}catch(_0x5e8cff){const _0x127912=_0x5e8cff instanceof Error&&_0x5e8cff[_0x59baa4(0x1e6)][_0x59baa4(0x136)]('Name\x20has\x20already\x20been\x20taken');if(_0x127912){const _0x5393e5=readPushRecovery(_0x22bd83[_0x59baa4(0x155)]),_0x26e52a=_0x5393e5?.[_0x59baa4(0x1d2)]===_0x22bd83['yamlConfig'][_0x59baa4(0x1a5)]?_0x5393e5[_0x59baa4(0x18a)][_0x8363ac['localName']]:undefined;if(_0x26e52a?.[_0x59baa4(0x23c)]===_0x8363ac[_0x59baa4(0x1f6)])await _0x20d1b0[_0x59baa4(0x1b6)][_0x59baa4(0x1c6)](_0x8363ac['parentId'],_0x26e52a[_0x59baa4(0x1f5)],{'description':_0x8363ac[_0x59baa4(0x13b)],'rule':_0x1a5c26(_0x8363ac[_0x59baa4(0x188)],!![]),'countPopulation':!![]}),_0x17697d=_0x26e52a['segmentId'];else throw new SDKError(ErrorCode[_0x59baa4(0x1e4)],_0x59baa4(0x226)+_0x8363ac[_0x59baa4(0x137)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x59baa4(0x1ad)+_0x22bd83['absolutePath'][_0x59baa4(0x161)](/([^/]+)$/,_0x59baa4(0x235))+')\x20')+_0x59baa4(0x1c9),_0x5e8cff);}else throw _0x5e8cff;}return saveSegmentToPushRecovery(_0x22bd83['absolutePath'],_0x22bd83[_0x59baa4(0x1f3)]['name'],_0x8363ac[_0x59baa4(0x137)],{'segmentId':_0x17697d,'uniqueServerName':_0x8363ac[_0x59baa4(0x1f6)],'createdAt':new Date()['toISOString']()}),_0x17697d;}export async function prepareSegmentFiles(_0x55cc4b,_0x4f9a7b,_0x3cc1aa,_0xf772b9,_0x3b58b9){const _0x57e5cc=a151_0x3dca48,{activationDefToCreateRequest:_0x411978}=await import(_0x57e5cc(0x1a8)),_0x48dc8c=[],_0x48f5bd=new Set();for(const {yamlConfig:_0x5baf2f,folderPath:_0x3b9377,sourcePath:_0x5711d2}of _0x55cc4b){const _0x509274=resolveTDFolderPath(_0x3b9377,_0xf772b9,_0x3b58b9),_0x2876e6=_0x509274+':'+_0x5baf2f[_0x57e5cc(0x1a5)],_0xae3d51=_0x4f9a7b['segmentByFolderAndName'][_0x57e5cc(0x1aa)](_0x2876e6),_0x471a52=_0xae3d51?_0x4f9a7b[_0x57e5cc(0x21b)][_0x57e5cc(0x1aa)](_0xae3d51['id'])||[]:[];addFoldersToCreate(_0x509274,_0x4f9a7b[_0x57e5cc(0x20b)],_0x48f5bd);const _0x474f62=calculateActivationActions(_0x5baf2f[_0x57e5cc(0x20d)]||[],_0x471a52,_0x4f9a7b[_0x57e5cc(0x1d9)],_0x4f9a7b[_0x57e5cc(0x1e1)]);for(const _0xcaf7e3 of _0x474f62){(_0xcaf7e3[_0x57e5cc(0x1ed)]===_0x57e5cc(0x1ac)||_0xcaf7e3['type']===_0x57e5cc(0x219))&&_0xcaf7e3['yamlActivation']&&(_0xcaf7e3[_0x57e5cc(0x16c)]=await _0x411978(_0xcaf7e3['yamlActivation'],_0x3cc1aa));}const _0x420f96=calculateSegmentDiff(_0x5baf2f,_0xae3d51,_0x471a52,_0x4f9a7b[_0x57e5cc(0x1d9)],_0x4f9a7b['connectionIdToNameMap']);_0x48dc8c[_0x57e5cc(0x19b)]({'relativePath':_0x5baf2f['name'],'absolutePath':_0x5711d2,'yamlConfig':_0x5baf2f,'folderPath':_0x509274,'existingSegment':_0xae3d51,'existingActivations':_0x471a52,'isNew':_0x420f96[_0x57e5cc(0x1ff)],'hasChanges':_0x420f96[_0x57e5cc(0x19c)],'diff':_0x420f96[_0x57e5cc(0x1e7)],'activationActions':_0x474f62});}return{'segmentFiles':_0x48dc8c,'foldersToCreate':_0x48f5bd};}export async function prepareJourneyFiles(_0x502536,_0x56a045,_0x4d78d0,_0x58090e){const _0x2bfb91=a151_0x3dca48,_0x56a00a=[],_0x47fd9e=new Set();for(const {yamlConfig:_0x34c17f,folderPath:_0x32254d,sourcePath:_0x1d91ca}of _0x502536){const _0x1e7cb1=resolveTDFolderPath(_0x32254d,_0x4d78d0,_0x58090e),_0x112e63=_0x1e7cb1+':'+_0x34c17f[_0x2bfb91(0x1a5)],_0x1fb185=_0x56a045[_0x2bfb91(0x1a2)][_0x2bfb91(0x1aa)](_0x112e63);let _0x28eb79,_0x56bba2;if(_0x1fb185&&_0x1fb185[_0x2bfb91(0x14a)]>0x0){const _0x1a87c1=buildLocalExpandedRuleMappings(_0x34c17f),{createYamlContext:_0x2c9cd5,prefetchJourneySegments:_0x272d90}=createPushYamlContextForBundle(_0x56a045['deps'],_0x56a045[_0x2bfb91(0x1cf)],_0x56a045[_0x2bfb91(0x192)],_0x1a87c1,_0x56a045[_0x2bfb91(0x1d9)],_0x56a045[_0x2bfb91(0x1e1)],_0x56a045[_0x2bfb91(0x228)],_0x56a045[_0x2bfb91(0x241)]);await _0x272d90(_0x1fb185['map'](_0x5706ee=>_0x5706ee['id']));const _0x6c7d59=await _0x56a045[_0x2bfb91(0x1f4)][_0x2bfb91(0x229)][_0x2bfb91(0x140)](_0x1fb185[0x0][_0x2bfb91(0x1e9)]),_0x2f1a0a=hasMultipleVersions(_0x34c17f),_0x4520e2=async _0x241655=>{const _0xa8606f=_0x2bfb91,_0x18c016=_0x56a045[_0xa8606f(0x241)]?.['get'](_0x241655);if(_0x18c016)return _0x18c016;return _0x56a045[_0xa8606f(0x1bf)]({'journeyId':_0x241655,'journeyName':_0x34c17f['name'],'isMultiVersion':_0x1fb185[_0xa8606f(0x14a)]>0x1});};if(_0x2f1a0a&&_0x1fb185['length']>0x1){const _0x182b8c=[];for(const _0x50d20d of _0x1fb185){const _0x2a2181=_0x50d20d['versionNumber']||0x1;_0x56a045[_0x2bfb91(0x1fd)]?.[_0x2bfb91(0x219)](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]+'\x20v'+_0x2a2181);const _0x3c3e9b=await _0x4520e2(_0x50d20d['id']),_0x239463=_0x2c9cd5(_0x50d20d['id']),_0x322ca0=await journeyResponseToDef(_0x3c3e9b,_0x239463);_0x182b8c['push']({'item':_0x50d20d,'yaml':_0x322ca0});}const _0xf63960=buildLocalRuleToNameMappingFromJourney(_0x34c17f);_0x56bba2=buildMergedJourneyDef(_0x182b8c,_0xf63960,_0x6c7d59);const _0x5d0dc0=Math[_0x2bfb91(0x18d)](..._0x182b8c[_0x2bfb91(0x237)](_0x1ab94a=>_0x1ab94a[_0x2bfb91(0x167)][_0x2bfb91(0x242)]||0x0)),_0x429d49=_0x1fb185['find'](_0x5e2ef3=>(_0x5e2ef3[_0x2bfb91(0x242)]||0x0)===_0x5d0dc0);_0x429d49&&(_0x56a045[_0x2bfb91(0x1fd)]?.['update'](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]+'\x20v'+_0x5d0dc0),_0x28eb79=await _0x4520e2(_0x429d49['id']));}else{const _0x1d291e=_0x1fb185[_0x1fb185[_0x2bfb91(0x14a)]-0x1];_0x56a045['progress']?.[_0x2bfb91(0x219)](_0x2bfb91(0x163)+_0x34c17f[_0x2bfb91(0x1a5)]),_0x28eb79=await _0x4520e2(_0x1d291e['id']);const _0x1d40f8=_0x2c9cd5(_0x1d291e['id']),_0x5733d2=await journeyResponseToDef(_0x28eb79,_0x1d40f8),_0xfd1772=buildLocalRuleToNameMappingFromJourney(_0x34c17f);_0x56bba2=buildMergedJourneyDef([{'item':_0x1d291e,'yaml':_0x5733d2}],_0xfd1772,_0x6c7d59);}}addFoldersToCreate(_0x1e7cb1,_0x56a045[_0x2bfb91(0x20b)],_0x47fd9e);const _0x577df6=calculateJourneyDiff(_0x34c17f,_0x56bba2);_0x56a00a['push']({'relativePath':_0x34c17f[_0x2bfb91(0x1a5)],'absolutePath':_0x1d91ca,'yamlConfig':_0x34c17f,'folderPath':_0x1e7cb1,'existingJourney':_0x28eb79,'isNew':_0x577df6[_0x2bfb91(0x1ff)],'hasChanges':_0x577df6[_0x2bfb91(0x19c)],'diff':_0x577df6[_0x2bfb91(0x1e7)]});}return{'journeyFiles':_0x56a00a,'foldersToCreate':_0x47fd9e};}export function calculateActivationActions(_0xd564fb,_0x63121f,_0xa416fe,_0x249fb9){const _0x411388=a151_0x3dca48,_0x5e29a6=[],_0x15a792=new Map();for(const _0x4a662e of _0x63121f){_0x15a792[_0x411388(0x153)](_0x4a662e['name'],_0x4a662e);}const _0x42dc9e=new Map();for(const _0x440221 of _0xd564fb){_0x42dc9e[_0x411388(0x153)](_0x440221['name'],_0x440221);}for(const _0x2ca367 of _0xd564fb){const _0x1a5b70=_0x15a792[_0x411388(0x1aa)](_0x2ca367[_0x411388(0x1a5)]);if(!_0x1a5b70)_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x1ac),'name':_0x2ca367['name'],'yamlActivation':_0x2ca367});else{const _0x2fd4f4=activationResponseToDef(_0x1a5b70,_0xa416fe,_0x249fb9),_0x472752=a151_0x2931b5[_0x411388(0x1eb)](_0x2fd4f4),_0x3b428a=a151_0x2931b5[_0x411388(0x1eb)](_0x2ca367);_0x472752!==_0x3b428a&&_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x219),'name':_0x2ca367['name'],'yamlActivation':_0x2ca367,'existingActivation':_0x1a5b70});}}for(const _0x3fd6e3 of _0x63121f){!_0x42dc9e[_0x411388(0x232)](_0x3fd6e3[_0x411388(0x1a5)])&&_0x5e29a6[_0x411388(0x19b)]({'type':_0x411388(0x13d),'name':_0x3fd6e3[_0x411388(0x1a5)],'existingActivation':_0x3fd6e3});}return _0x5e29a6;}function calculateYamlDiff(_0x31f3e5,_0x48b3af){if(_0x48b3af){const _0xbf0aef=generateDiff(_0x48b3af,_0x31f3e5),_0x4732fd=hasChanges(_0xbf0aef);return{'isNew':![],'hasChanges':_0x4732fd,'diff':_0x4732fd?formatDiffWithColors(_0xbf0aef):undefined};}const _0x2e7373=generateDiff('',_0x31f3e5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2e7373)};}export function calculateSegmentDiff(_0x1ebf9c,_0x42e376,_0x43cc81,_0x137cba,_0x361031){const _0x3082c2=segmentToYamlString(_0x1ebf9c),_0x11fb41=_0x42e376?segmentToYamlString(segmentWithActivationsToYaml(_0x42e376,_0x43cc81,undefined,_0x137cba,_0x361031)):undefined;return calculateYamlDiff(_0x3082c2,_0x11fb41);}export function calculateJourneyDiff(_0x46bc43,_0x56dea3){const _0x22c06e=normalizeJourneyDef(_0x46bc43,_0x46bc43),_0x1f5817=a151_0x290451(_0x22c06e),_0x5d5f81=_0x56dea3?a151_0x290451(normalizeJourneyDef(_0x56dea3,_0x46bc43)):undefined;return calculateYamlDiff(_0x1f5817,_0x5d5f81);}export function findSegmentsToDelete(_0x3df532,_0x100da5,_0x3cc047,_0x5dfbfa,_0x3fd8f8){const _0xeae45f=a151_0x3dca48,_0xcce7da=new Set();for(const {yamlConfig:_0x3e8b48,folderPath:_0x4d0884}of _0x100da5){_0xcce7da['add'](_0x4d0884+':'+_0x3e8b48[_0xeae45f(0x1a5)]);}return _0x3df532[_0xeae45f(0x1f1)](_0x6faee1=>{const _0x24a512=_0xeae45f,_0x10fc9d=_0x6faee1[_0x24a512(0x17c)]?_0x3cc047[_0x24a512(0x1aa)](_0x6faee1['segmentFolderId']['toString']())||'':'',_0x5cd46b=_0x10fc9d+':'+_0x6faee1[_0x24a512(0x1a5)];if(_0xcce7da[_0x24a512(0x232)](_0x5cd46b))return![];if(_0x3fd8f8)return _0x10fc9d===_0x5dfbfa||_0x10fc9d[_0x24a512(0x1fb)](_0x5dfbfa+'/');return!![];});}export function findJourneysToDelete(_0x43cd30,_0x536e1c,_0x5ed8b6,_0xba4ece,_0x566dbc){const _0x514e0a=a151_0x3dca48,_0x20cd02=new Set();for(const {yamlConfig:_0x4a1541,folderPath:_0x493b51}of _0x536e1c){_0x20cd02[_0x514e0a(0x158)](_0x493b51+':'+_0x4a1541['name']);}return _0x43cd30['filter'](_0x2dc986=>{const _0x191c0a=_0x514e0a,_0x53b679=_0x2dc986[_0x191c0a(0x18c)]?_0x5ed8b6[_0x191c0a(0x1aa)](_0x2dc986[_0x191c0a(0x18c)])||'':'',_0x512f25=_0x53b679+':'+_0x2dc986['journeyBundleName'];if(_0x20cd02[_0x191c0a(0x232)](_0x512f25))return![];if(_0x566dbc)return _0x53b679===_0xba4ece||_0x53b679[_0x191c0a(0x1fb)](_0xba4ece+'/');return!![];});}export function buildSegmentLookupMap(_0x1c1373,_0x1c0b8d){const _0x49ff21=a151_0x3dca48,_0x5ce5da=new Map();for(const _0x12335e of _0x1c1373){const _0x27b48b=_0x12335e[_0x49ff21(0x17c)]?_0x1c0b8d[_0x49ff21(0x1aa)](_0x12335e['segmentFolderId'][_0x49ff21(0x1b9)]())||'':'',_0x3e5556=_0x27b48b+':'+_0x12335e[_0x49ff21(0x1a5)];_0x5ce5da['set'](_0x3e5556,_0x12335e);}return _0x5ce5da;}export function buildSegmentNameToIdMap(_0x71b7f4){const _0x2ebf65=a151_0x3dca48,_0x1159d1=new Map();for(const _0x704d82 of _0x71b7f4){_0x1159d1[_0x2ebf65(0x153)](_0x704d82[_0x2ebf65(0x1a5)],_0x704d82['id']);}return _0x1159d1;}export function buildJourneyBundleLookupMap(_0x53abcd,_0x42a387){const _0x5951c4=a151_0x3dca48,_0x172225=new Map();for(const _0x4a0fc8 of _0x53abcd){const _0x4044ef=_0x4a0fc8[_0x5951c4(0x18c)]?_0x42a387[_0x5951c4(0x1aa)](_0x4a0fc8[_0x5951c4(0x18c)])||'':'',_0x103131=_0x4044ef+':'+_0x4a0fc8['journeyBundleName'];!_0x172225[_0x5951c4(0x232)](_0x103131)&&_0x172225['set'](_0x103131,[]),_0x172225[_0x5951c4(0x1aa)](_0x103131)['push'](_0x4a0fc8);}for(const _0x8e2f66 of _0x172225[_0x5951c4(0x23b)]()){_0x8e2f66[_0x5951c4(0x1e0)]((_0x411f88,_0x305e68)=>(_0x411f88['versionNumber']||0x0)-(_0x305e68[_0x5951c4(0x242)]||0x0));}return _0x172225;}export function collectFoldersToCreate(_0x152f17,_0x48578f){const _0x1e1007=a151_0x3dca48,_0x4176aa=new Set();for(const _0xc12643 of _0x152f17){if(!_0xc12643)continue;if(_0x48578f[_0x1e1007(0x232)](_0xc12643))continue;const _0x18c950=_0xc12643[_0x1e1007(0x1d3)]('/');let _0x2b6240='';for(const _0x44235a of _0x18c950){_0x2b6240=_0x2b6240?_0x2b6240+'/'+_0x44235a:_0x44235a,!_0x48578f[_0x1e1007(0x232)](_0x2b6240)&&_0x4176aa[_0x1e1007(0x158)](_0x2b6240);}}return _0x4176aa;}function a151_0x4fc4(){const _0x42efe5=['logSuccess','\x27\x20decision\x20point\x20branch\x20\x27','flatMap','created','journeyById','versionNumber','getSegmentEntity','__pending_','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','includes','localName','conditions','dirname','embedded_segment_created','description','conditionSegmentId','delete','onProgress','connector_config','getLatestJourneyId','columns','behavior','keys','nameToId','some','embedded_segment_creating','segment_updating','activation_','results','length','journeyActivationNameToId','deleteActivation','unchanged','idToName','Updated\x20journey\x20\x27','journeyActivationStepId','skipSegments','segmentNameToId','set','SEGMENT_SYNTAX_ERROR','absolutePath','Deleted\x20activation\x20\x27','null','add','Activation\x20not\x20found:\x20','kind','logDeleted','nameToType','object','activationContext','15826356HrZbqI','Created\x20journey\x20\x27','replace','isArray','Fetching\x20','updated','createActivation','journey_entry_criteria_','item','journeyId','getJourney','existingActivation','deleteSegment','validatedRequest','Entry\x20criteria:\x20','\x20error(s)','4HwEtae','steps','digest','activation_created','entry','relationships','all','createFolder','Failed\x20to\x20resolve\x20activation\x20','index','activation_deleting','):\x20','existingJourney','segmentFolderId','activation_updated','schedule','23190BkHVNa','INTERNAL',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','\x20(referenced\x20in\x20journey\x20','waitStep','Stage\x20\x27','Duration','toISOString','data','resolvedRule','trim','segments','getActivation','folderId','max','Deleted\x20segment\x20\x27','entryCriteria','9OaYwzY','Creating\x20segment\x20\x27','existingSegments','rootFolderId','relative','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','utf-8','447357Vduqlu','Updated\x20activation\x20\x27','\x27\x20for\x20','user','push','hasChanges','match','Condition','Failed\x20to\x20fetch\x20referenced\x20segment\x20','getSegment\x20failed\x20for\x20','2967153jWNPCJ','journeyBundlesByFolderAndName','size','createdSegmentId','name','\x20journey\x20from\x20file:\x20','\x27\x20from\x20file:\x20','./child-segment-yaml.js','deleted','get','errors','create','Delete\x20the\x20push\x20recovery\x20file\x20(','waitStepUnit','run_after_journey_refresh','\x0a\x20\x20','6785816MfNkBJ','embedded_activation_created','entry_criteria','waitStepType','join','segment','resolveSegment','journey_created','toString','withProgress','\x20activation\x20\x27','\x27\x20wait\x20condition','activation_updating','draft','fetchJourney','parentFolder','stage\x20\x27','existingSegment','slice','journeyStages','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','updateSegmentById','\x27\x20exit\x20criteria','Updated\x20segment\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','ACTIVATION_UPDATE_ERROR','embedded_activation_creating','activationParams','stages','exitCriterias','parentId','Creating\x20folder\x20\x27','Created\x20activation\x20\x27','journeyName','split','Segment\x20not\x20found:\x20','debug','list','logInfo','315OlZsJA','idToEmailMap','6830PqGLCo','conditionTimeoutUnit','reduce','with','parse','conditionTimeoutDuration','sort','connectionIdToNameMap','\x27\x20not\x20found\x20in\x20journey\x20\x27','segment_creating','SEGMENT_UPDATE_ERROR','verbose','message','diff','journeys','journeyBundleId','createSegment','stringify','attributes','type','ACTIVATION_SYNTAX_ERROR','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','5357UoNTLm','filter','WaitStep','yamlConfig','deps','segmentId','uniqueSegmentName','\x20segment\x20from\x20file:\x20','Segment\x20not\x20found','Matched\x20server\x20segment\x20\x27','\x27\x20entry\x20criteria','startsWith','activation_deleted','progress','__pending_act_','isNew','6367DkhexU','journey_creating','tdx.sdk.push-workflow','toLowerCase','folder_created','find','\x27\x20by\x20rule\x20content','valid','segment_deleting','Created\x20folder\x20\x27','parentSegmentFolder','folderPathToId','parseDocument','activations','hex','Activation','createJourneySegment','segment_deleted',').\x20','buildUserMaps','rule','\x27...','folderPath','resolveJourneyId','action','update','journeyBundleName','activationsBySegmentId','decision_point','Failed\x20to\x20resolve\x20segment\x20','journey_updated','Updating\x20segment\x20\x27','DecisionPoint','activation_template_id','updateActivation','embeddedSegmentNameToId','300wMEyMY','segment_created','Embedded\x20segment\x20\x27','from','activationStepsById','journey','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','SEGMENT_NOT_FOUND','../../utils/async.js','activationActions','./journey-yaml.js','Failed\x20to\x20','goal','connection','has','Deleting\x20activation\x20\x27','branches','.$1.push-recovery.json','effectiveFolderId','map','sha1','state','milestone','values','uniqueServerName'];a151_0x4fc4=function(){return _0x42efe5;};return a151_0x4fc4();}export function parseAndClassifyYamlFiles(_0xc54357,_0x283789,_0x45aa13){const _0x42924f=a151_0x3dca48,_0x9fc425=[],_0x1ce793=[];for(const _0xac5b7c of _0xc54357){const _0x5c39d9=a151_0x38937e[_0x42924f(0x194)](_0x283789,a151_0x38937e[_0x42924f(0x139)](_0xac5b7c)),_0x2bbf1b=_0x5c39d9==='.'?'':_0x5c39d9,_0x5cbbed=readFileSync(_0xac5b7c,_0x42924f(0x196)),_0x15029c=a151_0x2931b5['parse'](_0x5cbbed);if(isJourneyDef(_0x15029c)){const _0x2789b8=a151_0x1f20c(_0x5cbbed);_0x1ce793['push']({'yamlConfig':_0x2789b8,'folderPath':_0x2bbf1b,'sourcePath':_0xac5b7c});}else{if(!_0x45aa13?.[_0x42924f(0x151)]){const _0x254b69=parseSegmentYamlFile(_0x5cbbed),_0x72ac82=normalizeChildSegmentYaml(_0x254b69);_0x9fc425[_0x42924f(0x19b)]({'yamlConfig':_0x72ac82,'folderPath':_0x2bbf1b,'sourcePath':_0xac5b7c});}}}return{'segments':_0x9fc425,'journeys':_0x1ce793};}export function validateParsedFiles(_0x7d84ff,_0x4996c0){const _0x2ae70c=a151_0x3dca48,_0x490818=[];for(const {yamlConfig:_0x3b59d6,sourcePath:_0x230459}of _0x7d84ff['segments']){const _0x884093=readFileSync(_0x230459,_0x2ae70c(0x196)),_0xcef6e0=a151_0x2931b5[_0x2ae70c(0x20c)](_0x884093),_0x4a7d0=validateSegmentDef(_0x3b59d6,{'source':_0x884093,'document':_0xcef6e0},{'skipSchema':!![]});if(!_0x4a7d0[_0x2ae70c(0x207)]){const _0x236a58=a151_0x38937e[_0x2ae70c(0x194)](_0x4996c0,_0x230459);_0x490818[_0x2ae70c(0x19b)]({'filePath':_0x236a58,'source':_0x884093,'result':_0x4a7d0,'isJourney':![]});}}for(const {yamlConfig:_0x209bb9,sourcePath:_0x26a476}of _0x7d84ff[_0x2ae70c(0x1e8)]){const _0x2215e2=readFileSync(_0x26a476,_0x2ae70c(0x196)),_0x4a6488=a151_0x2931b5[_0x2ae70c(0x20c)](_0x2215e2),_0x583fbc=validateJourneyDef(_0x209bb9,{'source':_0x2215e2,'document':_0x4a6488},{'skipSchema':!![]});if(!_0x583fbc[_0x2ae70c(0x207)]){const _0x285ae1=a151_0x38937e[_0x2ae70c(0x194)](_0x4996c0,_0x26a476);_0x490818[_0x2ae70c(0x19b)]({'filePath':_0x285ae1,'source':_0x2215e2,'result':_0x583fbc,'isJourney':!![]});}}return _0x490818;}export function formatValidationErrors(_0x31dca3){const _0x41c2f5=a151_0x3dca48,_0x17e62e=[];for(const {filePath:_0x1da823,source:_0xdcca98,result:_0x33b642,isJourney:_0x5e7476}of _0x31dca3){const _0x55b25a=_0x5e7476?_0x41c2f5(0x229):_0x41c2f5(0x1b6);_0x17e62e[_0x41c2f5(0x19b)]('\x0a'+_0x1da823+'\x20('+_0x55b25a+_0x41c2f5(0x17a)+_0x33b642[_0x41c2f5(0x1ab)]['length']+_0x41c2f5(0x16e)),_0x17e62e[_0x41c2f5(0x19b)](formatValidationResult(_0x33b642,_0xdcca98,_0x1da823));}return _0x17e62e[_0x41c2f5(0x1b5)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x48a3ad){const _0x25e2a3=a151_0x3dca48,_0xb3f72c=new Set(),_0x3a4674=new Map(),_0x36f210=collectSegmentUsageCounts(_0x48a3ad);if(_0x48a3ad[_0x25e2a3(0x18a)])for(const [_0x29e925,_0x58f9b6]of Object['entries'](_0x48a3ad[_0x25e2a3(0x18a)])){_0xb3f72c[_0x25e2a3(0x158)](_0x29e925);if(_0x58f9b6[_0x25e2a3(0x214)]){const _0x42db2c=yamlRuleToApi(_0x58f9b6[_0x25e2a3(0x214)]),_0x1d586f=apiRuleToYaml(_0x42db2c);_0x3a4674['set'](_0x29e925,_0x1d586f);}}const _0x3a1d41=new Map();let _0x5af6c7=0x0;for(const [_0x5e5ce9,_0x1ea9ad]of _0x3a4674){const _0x258bc6=serializeExpandedRule(_0x1ea9ad,_0x3a4674),_0x432ed2=_0x3a1d41['get'](_0x258bc6)||[];_0x432ed2[_0x25e2a3(0x19b)]({'name':_0x5e5ce9,'index':_0x5af6c7}),_0x3a1d41['set'](_0x258bc6,_0x432ed2),_0x5af6c7++;}const _0x13c52d=new Map();for(const [_0x5cb3a4,_0x456768]of _0x3a1d41){const _0x28d60e=_0x456768['slice']()[_0x25e2a3(0x1e0)]((_0x33995d,_0x24950b)=>{const _0x513bd2=_0x25e2a3,_0x321715=_0x36f210[_0x513bd2(0x1aa)](_0x33995d[_0x513bd2(0x1a5)])||0x0,_0xea091f=_0x36f210[_0x513bd2(0x1aa)](_0x24950b[_0x513bd2(0x1a5)])||0x0;if(_0x321715!==_0xea091f)return _0xea091f-_0x321715;return _0x33995d[_0x513bd2(0x178)]-_0x24950b[_0x513bd2(0x178)];})[_0x25e2a3(0x237)](_0x4c4090=>_0x4c4090['name']),_0x3961ec=[];for(const _0x411f81 of _0x28d60e){const _0x35e9ef=_0x36f210[_0x25e2a3(0x1aa)](_0x411f81)||0x0,_0x2d9be0=Math['max'](_0x35e9ef,0x1);for(let _0x16ef2c=0x0;_0x16ef2c<_0x2d9be0;_0x16ef2c++){_0x3961ec[_0x25e2a3(0x19b)](_0x411f81);}}_0x13c52d['set'](_0x5cb3a4,_0x3961ec);}return{'existingLocalSegmentNames':_0xb3f72c,'localSegmentRules':_0x3a4674,'localExpandedRuleToNames':_0x13c52d};}export function createSegmentIdResolver(_0x4d514b,_0x4df41d){return async _0x1fd123=>{const _0xdb2207=a151_0x1b24,_0x1865f8=_0x4d514b['get'](_0x1fd123);if(!_0x1865f8)throw new SDKError(ErrorCode[_0xdb2207(0x22b)],_0xdb2207(0x1d4)+_0x1fd123+_0xdb2207(0x195)+_0x4df41d+'\x27)');return _0x1865f8;};}export function extractRootFolderId(_0x24801b){const _0x57e7d4=a151_0x3dca48;return _0x24801b['relationships']?.[_0x57e7d4(0x20a)]?.[_0x57e7d4(0x187)]?.['id']||_0x24801b['relationships']?.[_0x57e7d4(0x1c0)]?.['data']?.['id'];}export function buildConnectionMaps(_0xbc87e1){const _0x3d497d=a151_0x3dca48,_0x55bb40=new Map(),_0x22b5cf=new Map(),_0x85ac71=new Map();for(const _0x494a57 of _0xbc87e1){_0x55bb40['set'](_0x494a57['name'],parseInt(_0x494a57['id'],0xa)),_0x22b5cf['set'](_0x494a57['id'],_0x494a57[_0x3d497d(0x1a5)]),_0x85ac71[_0x3d497d(0x153)](_0x494a57[_0x3d497d(0x1a5)],_0x494a57[_0x3d497d(0x1ed)]);}return{'nameToId':_0x55bb40,'idToName':_0x22b5cf,'nameToType':_0x85ac71};}export function calculatePushStats(_0x10e260,_0x5247c5,_0x12f293,_0x11d4a1,_0x45cbae,_0x30442e,_0x571759){const _0x5cf736=a151_0x3dca48,_0x180ade=_0x10e260[_0x5cf736(0x1f1)](_0x787e1f=>_0x787e1f[_0x5cf736(0x1ff)]),_0xdddd91=_0x10e260[_0x5cf736(0x1f1)](_0x43685d=>!_0x43685d[_0x5cf736(0x1ff)]&&_0x43685d['hasChanges']),_0xb1d50d=_0x10e260['filter'](_0x599ff8=>!_0x599ff8['isNew']&&!_0x599ff8[_0x5cf736(0x19c)]),_0x320822=_0x30442e?_0x11d4a1:[],_0x2de646=_0x5247c5[_0x5cf736(0x1f1)](_0x33a463=>_0x33a463[_0x5cf736(0x1ff)]),_0x57810a=_0x5247c5[_0x5cf736(0x1f1)](_0x370d23=>!_0x370d23['isNew']&&_0x370d23[_0x5cf736(0x19c)]),_0x460f55=_0x5247c5['filter'](_0x478144=>!_0x478144[_0x5cf736(0x1ff)]&&!_0x478144[_0x5cf736(0x19c)]),_0x26eaeb=_0x30442e?_0x45cbae:[],_0x528344=_0x10e260[_0x5cf736(0x23f)](_0x44385c=>_0x44385c[_0x5cf736(0x22d)]),_0x2b7315=_0x528344[_0x5cf736(0x1f1)](_0x5d1133=>_0x5d1133[_0x5cf736(0x1ed)]===_0x5cf736(0x1ac)),_0x57d97d=_0x528344[_0x5cf736(0x1f1)](_0x2c801a=>_0x2c801a[_0x5cf736(0x1ed)]===_0x5cf736(0x219)),_0x3665e0=_0x528344[_0x5cf736(0x1f1)](_0xd21027=>_0xd21027[_0x5cf736(0x1ed)]==='delete'),_0x1b70d6=Array[_0x5cf736(0x227)](_0x12f293)[_0x5cf736(0x1e0)](),_0xb260e9=_0x571759?![]:_0x180ade[_0x5cf736(0x14a)]>0x0||_0xdddd91[_0x5cf736(0x14a)]>0x0||_0x320822[_0x5cf736(0x14a)]>0x0,_0x471b93=_0x2de646['length']>0x0||_0x57810a['length']>0x0||_0x26eaeb[_0x5cf736(0x14a)]>0x0,_0x35ce2c=_0x571759?![]:_0x528344[_0x5cf736(0x14a)]>0x0,_0x22f0b0=_0x1b70d6['length']>0x0;return{'segments':{'new':_0x180ade,'changed':_0xdddd91,'unchanged':_0xb1d50d,'toDelete':_0x320822},'journeys':{'new':_0x2de646,'changed':_0x57810a,'unchanged':_0x460f55,'toDelete':_0x26eaeb},'activations':{'all':_0x528344,'toCreate':_0x2b7315,'toUpdate':_0x57d97d,'toDelete':_0x3665e0},'folders':{'toCreate':_0x1b70d6},'counts':{'segments':{'new':_0x180ade[_0x5cf736(0x14a)],'changed':_0xdddd91[_0x5cf736(0x14a)],'unchanged':_0xb1d50d[_0x5cf736(0x14a)],'toDelete':_0x320822[_0x5cf736(0x14a)]},'journeys':{'new':_0x2de646[_0x5cf736(0x14a)],'changed':_0x57810a['length'],'unchanged':_0x460f55['length'],'toDelete':_0x26eaeb[_0x5cf736(0x14a)]},'activations':{'create':_0x2b7315[_0x5cf736(0x14a)],'update':_0x57d97d[_0x5cf736(0x14a)],'delete':_0x3665e0[_0x5cf736(0x14a)]},'folders':_0x1b70d6[_0x5cf736(0x14a)]},'hasChanges':_0xb260e9||_0x471b93||_0x35ce2c||_0x22f0b0};}export async function buildPushExecutionContext(_0x560401,_0x26b117,_0x3ea727,_0x3b9bab,_0x22765c,_0x48c2a8){const _0x23f235=a151_0x3dca48,_0x10a3ef=extractRootFolderId(_0x3ea727),{pathToId:_0x12ce25,idToPath:_0x546db8}=buildFolderMaps(_0x22765c),_0x36b12b=buildSegmentNameToIdMap(_0x3b9bab),_0x3a8555=new Map(),{batchAsync:_0x5f0eb9}=await import(_0x23f235(0x22c)),[_0x277e79,_0x4bd1f8]=await Promise[_0x23f235(0x175)]([_0x560401[_0x23f235(0x19a)][_0x23f235(0x213)](),_0x560401[_0x23f235(0x231)][_0x23f235(0x1d6)](),((async()=>{const _0x2545c7=_0x23f235;!_0x48c2a8&&_0x3b9bab[_0x2545c7(0x14a)]>0x0&&await _0x5f0eb9(_0x3b9bab,async _0x356ccf=>{const _0x32e3f2=_0x2545c7,_0xf2ec06=await _0x560401['segment']['listActivations'](_0x26b117,_0x356ccf['id']);_0x3a8555[_0x32e3f2(0x153)](_0x356ccf['id'],_0xf2ec06);});})())]),{emailToId:_0x1529c1,idToEmail:_0x4a8402}=_0x277e79,_0x2a523f=buildConnectionMaps(_0x4bd1f8);return{'rootFolderId':_0x10a3ef,'folderPathToId':_0x12ce25,'folderIdToPath':_0x546db8,'segmentNameToId':_0x36b12b,'activationsBySegmentId':_0x3a8555,'emailToIdMap':_0x1529c1,'idToEmailMap':_0x4a8402,'connectionNameToIdMap':_0x2a523f[_0x23f235(0x144)],'connectionIdToNameMap':_0x2a523f[_0x23f235(0x14e)],'connectionNameToTypeMap':_0x2a523f[_0x23f235(0x15c)]};}export function createPushYamlContextForBundle(_0x42fe70,_0x34d3b2,_0x5cc2fc,_0x294136,_0x2bd79c,_0x3e6161,_0x5e7dfc,_0x256a1a){const {existingLocalSegmentNames:_0xa30759,localExpandedRuleToNames:_0x15172d}=_0x294136,_0x90f283=new Set(),_0x29b9f6=new Map(),_0xa1e6d2=new Map(),_0x557b45=new Map(),_0x5ae371=createJumpTargetCache(),_0x4517da=new Map(),_0x454ff0=new Map(),_0x2c9cf0=new Set();let _0x575070;const _0x58713b=_0x1545c1=>{const _0x2586e9={'resolveSegment':async _0x29a2ff=>{const _0x243c3a=a151_0x1b24,_0x2370c2=_0x557b45['get'](_0x29a2ff);if(_0x2370c2!==undefined)return{'name':_0x2370c2,'isJourneyLocal':!![]};try{const _0x1d65cd=await fetchSegment(_0x42fe70,_0x34d3b2,_0x29a2ff,_0x5cc2fc);if(!_0x1d65cd)throw new Error(_0x243c3a(0x1f8));const _0x4bc1a7=generateJourneyLocalName(_0x1d65cd[_0x243c3a(0x1a5)]),_0x112bb7=_0x1d65cd[_0x243c3a(0x15a)]===SEGMENT_KIND_JOURNEY&&_0x4bc1a7!==undefined;let _0x20dfab=_0x1d65cd['name'],_0x399223;if(_0x112bb7&&_0x1d65cd[_0x243c3a(0x214)]){const _0x383af0=apiRuleToYaml(_0x1d65cd[_0x243c3a(0x214)]);_0x454ff0['set'](_0x29a2ff,_0x383af0);const _0x59d6e3=async _0x54bc19=>{const _0x2d4ed9=_0x243c3a,_0x8eac36=collectSegmentRefsFromRule(_0x54bc19);for(const _0xb140f6 of _0x8eac36){if(!_0x454ff0[_0x2d4ed9(0x232)](_0xb140f6))try{const _0x4ca77c=await fetchSegment(_0x42fe70,_0x34d3b2,_0xb140f6,_0x5cc2fc);if(_0x4ca77c?.['rule']){const _0x28a7e7=apiRuleToYaml(_0x4ca77c[_0x2d4ed9(0x214)]);_0x454ff0['set'](_0xb140f6,_0x28a7e7),await _0x59d6e3(_0x28a7e7);}}catch(_0x3905a4){logger['debug'](_0x2d4ed9(0x19f)+_0xb140f6+':\x20'+_0x3905a4);}}};await _0x59d6e3(_0x383af0);const _0x274005=serializeExpandedRule(_0x383af0,_0x454ff0),_0x5b560f=_0x15172d[_0x243c3a(0x1aa)](_0x274005);if(_0x5b560f&&_0x5b560f['length']>0x0){const _0xbeef08=_0x29b9f6[_0x243c3a(0x1aa)](_0x274005)||0x0,_0x28a7ba=_0x5b560f[_0xbeef08]||_0x5b560f[_0x5b560f[_0x243c3a(0x14a)]-0x1];_0x29b9f6[_0x243c3a(0x153)](_0x274005,_0xbeef08+0x1),_0x20dfab=_0x28a7ba,_0x90f283[_0x243c3a(0x158)](_0x20dfab),_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab);const _0x5dc018=await resolveRuleSegmentRefs(_0x383af0,async _0x3919f6=>{const _0x19fa74=_0x243c3a,_0x2a548d=_0x557b45[_0x19fa74(0x1aa)](_0x3919f6);if(_0x2a548d)return _0x2a548d;const _0x48c867=await _0x575070[_0x19fa74(0x1b7)](_0x3919f6);return _0x48c867[_0x19fa74(0x1a5)];});_0x399223={'description':_0x1d65cd[_0x243c3a(0x13b)],'rule':_0x5dc018};}else{const _0x33c549=_0x4517da[_0x243c3a(0x1aa)](_0x274005);if(_0x33c549)_0x20dfab=_0x33c549,_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab);else{if(_0x4bc1a7){let _0xb13d1c=_0x4bc1a7,_0x29bc7f=0x2;while(_0x90f283[_0x243c3a(0x232)](_0xb13d1c)||_0xa30759[_0x243c3a(0x232)](_0xb13d1c)){_0xb13d1c=_0x4bc1a7+'_'+_0x29bc7f,_0x29bc7f++;}_0x90f283['add'](_0xb13d1c),_0x20dfab=_0xb13d1c;}_0x557b45[_0x243c3a(0x153)](_0x29a2ff,_0x20dfab),_0x4517da[_0x243c3a(0x153)](_0x274005,_0x20dfab);const _0x19514e=await resolveRuleSegmentRefs(_0x383af0,async _0x5320df=>{const _0x53f9d8=_0x243c3a,_0x9bebb4=_0x557b45[_0x53f9d8(0x1aa)](_0x5320df);if(_0x9bebb4)return _0x9bebb4;const _0x2cd45a=await _0x575070[_0x53f9d8(0x1b7)](_0x5320df);return _0x2cd45a[_0x53f9d8(0x1a5)];});_0x399223={'description':_0x1d65cd[_0x243c3a(0x13b)],'rule':_0x19514e};}}}return{'name':_0x20dfab,'isJourneyLocal':_0x112bb7,'definition':_0x399223};}catch(_0x429464){return logger[_0x243c3a(0x1d5)](_0x243c3a(0x21d)+_0x29a2ff+':\x20'+_0x429464),{'name':_0x29a2ff,'isJourneyLocal':![]};}},'resolveActivation':async _0x43e1ef=>{const _0x433c84=a151_0x1b24,_0x1d84c0=_0xa1e6d2[_0x433c84(0x1aa)](_0x43e1ef);if(_0x1d84c0!==undefined)return{'name':_0x1d84c0,'isJourneyLocal':!![]};try{let _0x4ae26e=_0x5e7dfc?.[_0x433c84(0x1aa)](_0x43e1ef);!_0x4ae26e&&(_0x4ae26e=await _0x42fe70[_0x433c84(0x229)][_0x433c84(0x18b)](_0x1545c1,_0x43e1ef));const _0x37ed4a=_0x4ae26e['attributes'][_0x433c84(0x1cc)][_0x433c84(0x1a5)]||_0x43e1ef,_0x3d4df9=sanitizeYamlKey(_0x37ed4a)||_0x433c84(0x148)+_0x43e1ef,_0x48e9cb=_0x3d4df9;_0xa1e6d2['set'](_0x43e1ef,_0x48e9cb);const _0xa390a4=journeyActivationStepToYaml(_0x4ae26e,_0x2bd79c,_0x3e6161);return{'name':_0x48e9cb,'isJourneyLocal':!![],'definition':_0xa390a4};}catch(_0xcefd14){return logger[_0x433c84(0x1d5)](_0x433c84(0x177)+_0x43e1ef+':\x20'+_0xcefd14),{'name':_0x43e1ef,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1a7458,_0x430156)=>resolveJumpTarget(_0x1a7458,_0x430156,_0x5ae371,async _0x462d33=>{const _0x3bbcba=a151_0x1b24,_0x4198e3=_0x256a1a?.[_0x3bbcba(0x1aa)](_0x462d33);if(_0x4198e3)return _0x4198e3;return _0x42fe70[_0x3bbcba(0x229)][_0x3bbcba(0x169)](_0x462d33);})};return _0x575070=_0x2586e9,_0x2586e9;},_0x3c09ca=async _0x4e40f0=>{const _0x52b17a=a151_0x1b24,{collectSegmentIdsFromJourneyApi:_0xe5f7ca}=await import(_0x52b17a(0x22e)),{batchAsync:_0x389cfe}=await import(_0x52b17a(0x22c)),_0x47243f=new Set();for(const _0x3a9f03 of _0x4e40f0){let _0x4cb90a=_0x256a1a?.[_0x52b17a(0x1aa)](_0x3a9f03);!_0x4cb90a&&(_0x4cb90a=await _0x42fe70[_0x52b17a(0x229)][_0x52b17a(0x169)](_0x3a9f03));const _0x58f55e=_0xe5f7ca(_0x4cb90a);for(const _0xba5027 of _0x58f55e){_0x47243f[_0x52b17a(0x158)](_0xba5027);}}let _0x5412ad=Array[_0x52b17a(0x227)](_0x47243f);while(_0x5412ad[_0x52b17a(0x14a)]>0x0){const _0x11b6ea=_0x5412ad[_0x52b17a(0x1f1)](_0x4f2579=>!_0x2c9cf0[_0x52b17a(0x232)](_0x4f2579));if(_0x11b6ea[_0x52b17a(0x14a)]===0x0)break;const _0xd54d06=await _0x389cfe(_0x11b6ea,async _0x45e79f=>{_0x2c9cf0['add'](_0x45e79f);const _0x3323e2=await fetchSegment(_0x42fe70,_0x34d3b2,_0x45e79f,_0x5cc2fc);if(!_0x3323e2)return null;return{'segmentId':_0x45e79f,'segment':_0x3323e2};},0xa),_0x4e4633=new Set();for(const _0x3cf0b4 of _0xd54d06){if(!_0x3cf0b4?.[_0x52b17a(0x1b6)]?.[_0x52b17a(0x214)])continue;const _0x17a842=apiRuleToYaml(_0x3cf0b4[_0x52b17a(0x1b6)][_0x52b17a(0x214)]);_0x454ff0[_0x52b17a(0x153)](_0x3cf0b4['segmentId'],_0x17a842);const _0x31a6d6=collectSegmentRefsFromRule(_0x17a842);for(const _0x54906d of _0x31a6d6){!_0x2c9cf0[_0x52b17a(0x232)](_0x54906d)&&_0x4e4633[_0x52b17a(0x158)](_0x54906d);}}_0x5412ad=Array[_0x52b17a(0x227)](_0x4e4633);}};return{'createYamlContext':_0x58713b,'prefetchJourneySegments':_0x3c09ca};}export async function executePushSegments(_0x1c639b,_0x2fd7f9,_0x273b0e,_0x105280,_0x2bb0a5){const _0x4f5173=a151_0x3dca48,{segmentDefToCreateRequest:_0x1495d2,segmentDefToUpdateRequest:_0x1f564a}=await import(_0x4f5173(0x1a8)),_0x3a9af6=_0x273b0e[_0x4f5173(0x20b)],_0x54438d=0x5,_0x2389c8=async _0x5a202e=>{const _0x57841e=_0x4f5173,_0x191adf=_0x5a202e[_0x57841e(0x216)]?_0x3a9af6[_0x57841e(0x1aa)](_0x5a202e[_0x57841e(0x216)]):undefined;let _0x4274c4;const _0x5a1d7c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x26cee9=_0x5a202e[_0x57841e(0x1f3)];if(_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x214)]){const _0x303c14=createSegmentIdResolver(_0x273b0e['segmentNameToId'],_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]),_0x3bb1dc=await resolveRuleSegmentIds(_0x5a202e['yamlConfig'][_0x57841e(0x214)],_0x303c14);_0x26cee9={..._0x5a202e[_0x57841e(0x1f3)],'rule':_0x3bb1dc};}try{if(_0x5a202e[_0x57841e(0x1ff)]){_0x2bb0a5['onProgress']?.({'type':_0x57841e(0x1e3),'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]});const _0x383b2a=_0x1495d2(_0x26cee9,_0x191adf),_0xab3038=await _0x2bb0a5['withProgress'](_0x57841e(0x191)+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+_0x57841e(0x215),()=>_0x1c639b[_0x57841e(0x1b6)][_0x57841e(0x1ea)](_0x105280[_0x57841e(0x1cf)],_0x383b2a));_0x4274c4=_0xab3038[_0x57841e(0x187)]['id'],_0x273b0e[_0x57841e(0x152)]['set'](_0x5a202e[_0x57841e(0x1f3)]['name'],_0x4274c4),_0x5a1d7c[_0x57841e(0x1a4)]={'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)],'id':_0x4274c4},_0x2bb0a5[_0x57841e(0x13e)]?.({'type':_0x57841e(0x225),'name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)],'segmentId':_0x4274c4}),_0x2bb0a5['logSuccess']?.('Created\x20segment\x20\x27'+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+'\x27'),_0x5a1d7c[_0x57841e(0x240)]=0x1;}else{if(_0x5a202e[_0x57841e(0x19c)]){_0x2bb0a5['onProgress']?.({'type':_0x57841e(0x147),'name':_0x5a202e[_0x57841e(0x1f3)]['name']});const _0xd78cf8=_0x1f564a(_0x26cee9);_0x191adf!==_0x5a202e[_0x57841e(0x1c2)]?.[_0x57841e(0x17c)]&&(_0xd78cf8[_0x57841e(0x17c)]=_0x191adf?parseInt(_0x191adf,0xa):undefined),await _0x2bb0a5[_0x57841e(0x1ba)](_0x57841e(0x21f)+_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]+_0x57841e(0x215),()=>_0x1c639b['segment'][_0x57841e(0x1c6)](_0x105280[_0x57841e(0x1cf)],_0x5a202e[_0x57841e(0x1c2)]['id'],_0xd78cf8)),_0x4274c4=_0x5a202e['existingSegment']['id'],_0x2bb0a5['onProgress']?.({'type':'segment_updated','name':_0x5a202e[_0x57841e(0x1f3)][_0x57841e(0x1a5)]}),_0x2bb0a5[_0x57841e(0x23d)]?.(_0x57841e(0x1c8)+_0x5a202e['yamlConfig']['name']+'\x27'),_0x5a1d7c['updated']=0x1;}else _0x4274c4=_0x5a202e['existingSegment']['id'];}}catch(_0x5056c4){const _0x4f2864=isHttp400Error(_0x5056c4),_0x99113a=_0x4f2864?ErrorCode[_0x57841e(0x154)]:ErrorCode[_0x57841e(0x1e4)],_0x3d3ef5=getErrorMessage(_0x5056c4);throw new SDKError(_0x99113a,_0x57841e(0x22f)+(_0x5a202e[_0x57841e(0x1ff)]?_0x57841e(0x1ac):_0x57841e(0x219))+_0x57841e(0x1f7)+_0x5a202e[_0x57841e(0x155)]+'\x0a\x20\x20'+_0x3d3ef5,_0x5056c4);}try{const _0x278fdd=await syncActivationsForSegment(_0x1c639b,_0x105280[_0x57841e(0x1cf)],_0x4274c4,_0x5a202e[_0x57841e(0x1f3)]['name'],_0x5a202e[_0x57841e(0x22d)],_0x2bb0a5,_0x5a202e['absolutePath']);_0x5a1d7c[_0x57841e(0x20d)]=_0x278fdd;}catch(_0x16f85b){if(_0x16f85b instanceof SDKError)throw _0x16f85b;throw new SDKError(ErrorCode[_0x57841e(0x1ca)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x5a202e['yamlConfig'][_0x57841e(0x1a5)]+_0x57841e(0x1a7)+_0x5a202e['absolutePath']+_0x57841e(0x1b0)+getErrorMessage(_0x16f85b),_0x16f85b);}return _0x5a1d7c;},_0x58bddb=await batchAsync(_0x2fd7f9,_0x2389c8,_0x54438d),_0x454e53={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1a5839 of _0x58bddb){_0x454e53[_0x4f5173(0x240)]+=_0x1a5839['created'],_0x454e53[_0x4f5173(0x164)]+=_0x1a5839[_0x4f5173(0x164)],_0x1a5839[_0x4f5173(0x1a4)]&&_0x454e53['createdSegmentIds'][_0x4f5173(0x153)](_0x1a5839[_0x4f5173(0x1a4)][_0x4f5173(0x1a5)],_0x1a5839[_0x4f5173(0x1a4)]['id']),_0x454e53['activations'][_0x4f5173(0x240)]+=_0x1a5839[_0x4f5173(0x20d)]['created'],_0x454e53[_0x4f5173(0x20d)][_0x4f5173(0x164)]+=_0x1a5839['activations'][_0x4f5173(0x164)],_0x454e53[_0x4f5173(0x20d)][_0x4f5173(0x1a9)]+=_0x1a5839['activations'][_0x4f5173(0x1a9)];}return _0x454e53;}async function syncActivationsForSegment(_0x282aac,_0xeb8277,_0xf14a6e,_0x59286c,_0x88186f,_0x2d6df1,_0x5b2211){const _0x165d29=a151_0x3dca48,_0x5751f8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x474053 of _0x88186f){try{if(_0x474053[_0x165d29(0x1ed)]==='create'&&_0x474053[_0x165d29(0x16c)])_0x2d6df1[_0x165d29(0x13e)]?.({'type':'activation_creating','segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),await _0x2d6df1[_0x165d29(0x1ba)]('Creating\x20activation\x20\x27'+_0x474053['name']+_0x165d29(0x215),()=>_0x282aac['segment'][_0x165d29(0x165)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16c)])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x172),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),_0x2d6df1[_0x165d29(0x23d)]?.(_0x165d29(0x1d1)+_0x474053['name']+'\x27'),_0x5751f8['created']++;else{if(_0x474053[_0x165d29(0x1ed)]===_0x165d29(0x219)&&_0x474053[_0x165d29(0x16c)]&&_0x474053[_0x165d29(0x16a)])_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x1bd),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),await _0x2d6df1[_0x165d29(0x1ba)]('Updating\x20activation\x20\x27'+_0x474053[_0x165d29(0x1a5)]+_0x165d29(0x215),()=>_0x282aac[_0x165d29(0x1b6)][_0x165d29(0x222)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16a)]['id'],_0x474053[_0x165d29(0x16c)])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x17d),'segmentName':_0x59286c,'activationName':_0x474053[_0x165d29(0x1a5)]}),_0x2d6df1['logSuccess']?.(_0x165d29(0x198)+_0x474053['name']+'\x27'),_0x5751f8[_0x165d29(0x164)]++;else _0x474053[_0x165d29(0x1ed)]===_0x165d29(0x13d)&&_0x474053[_0x165d29(0x16a)]&&(_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x179),'segmentName':_0x59286c,'activationName':_0x474053['name']}),await _0x2d6df1[_0x165d29(0x1ba)](_0x165d29(0x233)+_0x474053['name']+'\x27...',()=>_0x282aac['segment'][_0x165d29(0x14c)](_0xeb8277,_0xf14a6e,_0x474053[_0x165d29(0x16a)]['id'])),_0x2d6df1[_0x165d29(0x13e)]?.({'type':_0x165d29(0x1fc),'segmentName':_0x59286c,'activationName':_0x474053['name']}),_0x2d6df1[_0x165d29(0x15b)]?.(_0x165d29(0x156)+_0x474053[_0x165d29(0x1a5)]+'\x27'),_0x5751f8[_0x165d29(0x1a9)]++);}}catch(_0x13b7d1){const _0x22c695=isHttp400Error(_0x13b7d1),_0x19df42=_0x22c695?ErrorCode[_0x165d29(0x1ee)]:ErrorCode[_0x165d29(0x1ca)],_0x5a273a=getErrorMessage(_0x13b7d1);throw new SDKError(_0x19df42,_0x165d29(0x22f)+_0x474053[_0x165d29(0x1ed)]+_0x165d29(0x1bb)+_0x474053['name']+_0x165d29(0x1a7)+_0x5b2211+_0x165d29(0x1b0)+_0x5a273a,_0x13b7d1);}}return _0x5751f8;}export async function executePushFolders(_0x4618b3,_0x5cd86c,_0x5e1984,_0x431aa8,_0x4a0ee8){const _0x4f8784=a151_0x3dca48,_0x320e99=new Map(_0x5e1984),_0x4980f2=sortFoldersByDepth(_0x5cd86c);for(const _0x5599ad of _0x4980f2){const _0x2e91a1=_0x5599ad['split']('/'),_0x246119=_0x2e91a1[_0x2e91a1[_0x4f8784(0x14a)]-0x1],_0x3f3bc0=_0x2e91a1[_0x4f8784(0x1c3)](0x0,-0x1)[_0x4f8784(0x1b5)]('/'),_0x59a230=_0x320e99[_0x4f8784(0x1aa)](_0x3f3bc0);_0x4a0ee8[_0x4f8784(0x13e)]?.({'type':'folder_creating','folder':_0x5599ad});const _0xf36e2a={'name':_0x246119,'parentFolderId':_0x59a230},_0x31f017=await _0x4a0ee8[_0x4f8784(0x1ba)](_0x4f8784(0x1d0)+_0x5599ad+_0x4f8784(0x215),()=>_0x4618b3[_0x4f8784(0x1b6)][_0x4f8784(0x176)](_0x431aa8['parentId'],_0xf36e2a));_0x320e99[_0x4f8784(0x153)](_0x5599ad,_0x31f017[_0x4f8784(0x187)]['id']),_0x4a0ee8['onProgress']?.({'type':_0x4f8784(0x204),'folder':_0x5599ad,'folderId':_0x31f017[_0x4f8784(0x187)]['id']}),_0x4a0ee8[_0x4f8784(0x1d7)]?.(_0x4f8784(0x209)+_0x5599ad+'\x27');}return _0x320e99;}export async function executePushSegmentDeletions(_0xf124e0,_0x5e5018,_0x40dbb6){const _0x508a2f=a151_0x3dca48;if(_0x5e5018[_0x508a2f(0x14a)]===0x0)return 0x0;const {batchAsync:_0x5446f0}=await import(_0x508a2f(0x22c)),_0x4a1497=0x5,_0x20fd3e=await _0x5446f0(_0x5e5018,async _0x5a82ba=>{const _0x2442b8=_0x508a2f;return _0x40dbb6[_0x2442b8(0x13e)]?.({'type':_0x2442b8(0x208),'name':_0x5a82ba[_0x2442b8(0x1a5)]}),await _0xf124e0['segment'][_0x2442b8(0x16b)](_0x5a82ba['id']),_0x40dbb6[_0x2442b8(0x13e)]?.({'type':_0x2442b8(0x211),'name':_0x5a82ba['name']}),_0x40dbb6[_0x2442b8(0x15b)]?.(_0x2442b8(0x18e)+_0x5a82ba[_0x2442b8(0x1a5)]+'\x27'),0x1;},_0x4a1497);return _0x20fd3e[_0x508a2f(0x1dc)]((_0x5635d3,_0x35e544)=>_0x5635d3+_0x35e544,0x0);}export async function executePushJourneys(_0x4730a5,_0x358775,_0x594005,_0x355ccb,_0x1c41ae){const _0x255fa3=a151_0x3dca48,{journeyDefToRequest:_0x4469a1}=await import(_0x255fa3(0x22e)),{activationDefToCreateRequest:_0x2c3d5f,yamlRuleToApi:_0x5025c6,validateSegmentRule:_0x10f576}=await import(_0x255fa3(0x1a8)),_0x41d17b={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x56d6b6=new Map(_0x594005[_0x255fa3(0x152)]),_0x36a7b0=0x5;for(let _0xbe8b50=0x0;_0xbe8b50<_0x358775['length'];_0xbe8b50+=_0x36a7b0){const _0x383327=_0x358775[_0x255fa3(0x1c3)](_0xbe8b50,_0xbe8b50+_0x36a7b0),_0x5aebdb=await Promise[_0x255fa3(0x175)](_0x383327[_0x255fa3(0x237)](async _0x5620e9=>{const _0x3aa06d=_0x255fa3;if(!_0x5620e9[_0x3aa06d(0x1ff)]&&!_0x5620e9['hasChanges'])return{'action':'unchanged','name':_0x5620e9[_0x3aa06d(0x1f3)]['name'],'journeyId':_0x5620e9[_0x3aa06d(0x17b)]?.['id']};const _0x478fd7=_0x5620e9[_0x3aa06d(0x216)]?_0x594005[_0x3aa06d(0x20b)][_0x3aa06d(0x1aa)](_0x5620e9[_0x3aa06d(0x216)]):undefined;_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x5620e9[_0x3aa06d(0x1ff)]?_0x3aa06d(0x201):'journey_updating','name':_0x5620e9['yamlConfig']['name']});try{const _0x3199bb=await executeSingleJourneyPush(_0x4730a5,_0x5620e9,{..._0x594005,'segmentNameToId':_0x56d6b6},{'parentId':_0x355ccb['parentId'],'rootFolderId':_0x355ccb['rootFolderId'],'folderId':_0x478fd7,'verbose':_0x355ccb[_0x3aa06d(0x1e5)]},_0x1c41ae,{'journeyDefToRequest':_0x4469a1,'activationDefToCreateRequest':_0x2c3d5f,'yamlRuleToApi':_0x5025c6,'validateSegmentRule':_0x10f576});for(const [_0x56fa05,_0x11f695]of _0x3199bb[_0x3aa06d(0x223)]){_0x56d6b6[_0x3aa06d(0x153)](_0x56fa05,_0x11f695),_0x41d17b['embeddedSegmentNameToId']['set'](_0x56fa05,_0x11f695);}if(_0x3199bb[_0x3aa06d(0x218)]==='created')_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x3aa06d(0x1b8),'name':_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)],'journeyId':_0x3199bb[_0x3aa06d(0x168)]}),_0x1c41ae['logSuccess']?.(_0x3aa06d(0x160)+_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]+'\x27'),_0x41d17b[_0x3aa06d(0x240)]++;else _0x3199bb[_0x3aa06d(0x218)]===_0x3aa06d(0x164)&&(_0x1c41ae[_0x3aa06d(0x13e)]?.({'type':_0x3aa06d(0x21e),'name':_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]}),_0x1c41ae['logSuccess']?.(_0x3aa06d(0x14f)+_0x5620e9[_0x3aa06d(0x1f3)][_0x3aa06d(0x1a5)]+'\x27'),_0x41d17b['updated']++);return{'action':_0x3199bb['action'],'name':_0x5620e9['yamlConfig'][_0x3aa06d(0x1a5)],'journeyId':_0x3199bb[_0x3aa06d(0x168)]};}catch(_0x154d51){const _0x4748e2=isHttp400Error(_0x154d51),_0xdc8a0d=_0x4748e2?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x214e72=getErrorMessage(_0x154d51);throw new SDKError(_0xdc8a0d,'Failed\x20to\x20'+(_0x5620e9[_0x3aa06d(0x1ff)]?_0x3aa06d(0x1ac):_0x3aa06d(0x219))+_0x3aa06d(0x1a6)+_0x5620e9[_0x3aa06d(0x155)]+_0x3aa06d(0x1b0)+_0x214e72,_0x154d51);}}));_0x41d17b[_0x255fa3(0x149)][_0x255fa3(0x19b)](..._0x5aebdb);}return _0x41d17b;}async function matchExistingJourneySegments(_0x50d340,_0x444cf1,_0x26f9e0,_0x31e173,_0x1231e8){const _0x428222=a151_0x3dca48;if(!_0x444cf1[_0x428222(0x17b)]||!_0x444cf1[_0x428222(0x1f3)][_0x428222(0x18a)])return;const _0xb96477=new Map(),_0x31321e=new Set();for(const _0x39284c of Object['keys'](_0x444cf1[_0x428222(0x1f3)][_0x428222(0x18a)])){const _0x9fded8=generateDeterministicJourneySegmentName(_0x444cf1[_0x428222(0x1f3)][_0x428222(0x1a5)],_0x39284c);_0xb96477['set'](_0x9fded8,_0x39284c),_0x31321e[_0x428222(0x158)](_0x39284c);}const _0x5509fc=[],_0x394abb=collectSegmentIdsFromJourneyApi(_0x444cf1[_0x428222(0x17b)]);for(const _0x26fe96 of _0x394abb){const _0x136374=await fetchSegment(_0x50d340,_0x26f9e0,_0x26fe96,_0x31e173);if(!_0x136374?.[_0x428222(0x1a5)])continue;const _0x331568=_0xb96477[_0x428222(0x1aa)](_0x136374['name']);_0x331568?(_0x1231e8[_0x428222(0x153)](_0x331568,_0x26fe96),_0x31321e['delete'](_0x331568)):_0x5509fc[_0x428222(0x19b)]({'id':_0x26fe96,'seg':_0x136374});}if(_0x31321e[_0x428222(0x1a3)]>0x0&&_0x5509fc[_0x428222(0x14a)]>0x0){const {localExpandedRuleToNames:_0x2636bc}=buildLocalExpandedRuleMappings(_0x444cf1['yamlConfig']),_0x222fb3=new Map();for(const {id:_0x30e5ea,seg:_0x85fa97}of _0x5509fc){if(_0x85fa97[_0x428222(0x214)]){const _0x51b80a=apiRuleToYaml(_0x85fa97[_0x428222(0x214)]);_0x222fb3[_0x428222(0x153)](_0x30e5ea,_0x51b80a);}}for(const {id:_0x227634,seg:_0x315db5}of _0x5509fc){if(!_0x315db5[_0x428222(0x214)])continue;const _0x19ac0e=_0x222fb3[_0x428222(0x1aa)](_0x227634);if(!_0x19ac0e)continue;const _0x262cc8=serializeExpandedRule(_0x19ac0e,_0x222fb3),_0x5ab154=_0x2636bc[_0x428222(0x1aa)](_0x262cc8);if(_0x5ab154){const _0x3ecad0=_0x5ab154[_0x428222(0x205)](_0x6d2a27=>_0x31321e['has'](_0x6d2a27));_0x3ecad0&&(_0x1231e8[_0x428222(0x153)](_0x3ecad0,_0x227634),_0x31321e[_0x428222(0x13d)](_0x3ecad0),logger[_0x428222(0x1d5)](_0x428222(0x1f9)+_0x315db5['name']+'\x27\x20to\x20local\x20\x27'+_0x3ecad0+_0x428222(0x206)));}}}}async function executeSingleJourneyPush(_0x119c0f,_0x1e4ddc,_0x5a1851,_0x7fbbe1,_0x3acb96,_0x10472c){const _0x2ad734=a151_0x3dca48,{journeyDefToRequest:_0x4e41ff,activationDefToCreateRequest:_0x468f52,yamlRuleToApi:_0x482ec4,validateSegmentRule:_0x208c8a}=_0x10472c,_0x119567=new Map(),_0x22a395=new Map();recoverSegmentIdsFromPushRecovery(_0x1e4ddc,_0x119567,_0x5a1851[_0x2ad734(0x152)]);const _0x268fd9=new Map(),_0x498038=new Map(),_0xcb306a=new Map();let _0x1e09cc;const _0x3d3536=async()=>{const _0x217ee4=_0x2ad734;if(_0x1e09cc)return;_0x1e09cc=new Map();if(!_0x1e4ddc[_0x217ee4(0x17b)])return;const _0x2c2ef8=await _0x119c0f[_0x217ee4(0x229)]['listActivations'](_0x1e4ddc['existingJourney']['id']);for(const _0x123299 of _0x2c2ef8){const _0x13e780=journeyActivationStepToYaml(_0x123299,_0x5a1851[_0x217ee4(0x1d9)],_0x5a1851[_0x217ee4(0x1e1)]),_0xbcdecb=activationSignature(_0x13e780);!_0x1e09cc[_0x217ee4(0x232)](_0xbcdecb)&&_0x1e09cc[_0x217ee4(0x153)](_0xbcdecb,_0x123299['id']),_0x13e780[_0x217ee4(0x1a5)]&&_0x22a395[_0x217ee4(0x153)](_0x13e780[_0x217ee4(0x1a5)],_0x123299['id']);}};await matchExistingJourneySegments(_0x119c0f,_0x1e4ddc,_0x7fbbe1[_0x2ad734(0x1cf)],_0x5a1851[_0x2ad734(0x192)],_0x5a1851[_0x2ad734(0x152)]);const _0x30580d={'resolveSegmentId':async _0x216354=>{const _0x4d70e4=_0x2ad734,_0x270c0c=_0x5a1851[_0x4d70e4(0x152)][_0x4d70e4(0x1aa)](_0x216354);if(!_0x270c0c)throw new SDKError(ErrorCode[_0x4d70e4(0x22b)],_0x4d70e4(0x1d4)+_0x216354+_0x4d70e4(0x182)+_0x1e4ddc[_0x4d70e4(0x1f3)][_0x4d70e4(0x1a5)]+')');return _0x270c0c;},'resolveEmbeddedSegmentId':async(_0x550b64,_0x404e39)=>{const _0xc65688=_0x2ad734,_0xff8830=_0x5a1851[_0xc65688(0x152)][_0xc65688(0x1aa)](_0x550b64);if(_0xff8830)return _0xff8830;const _0x10bfb8=_0x5a1851[_0xc65688(0x192)][_0xc65688(0x205)](_0x4ee694=>_0x4ee694['name']===_0x550b64);if(_0x10bfb8)return _0x5a1851[_0xc65688(0x152)][_0xc65688(0x153)](_0x550b64,_0x10bfb8['id']),_0x10bfb8['id'];if(_0x1e4ddc['isNew']){const {stageName:_0x1de239,criteriaName:_0x4cbe90}=findSegmentCriteriaLocation(_0x1e4ddc['yamlConfig'],_0x550b64);return _0x208c8a(_0x550b64,_0x404e39['rule']),_0x498038['set'](_0x550b64,{'definition':_0x404e39,'stageName':_0x1de239,'criteriaName':_0x4cbe90}),createPendingSegmentId(_0x550b64);}const _0x452a78=_0x1e4ddc[_0xc65688(0x17b)]?.['id'];if(!_0x452a78)throw new SDKError(ErrorCode[_0xc65688(0x180)],_0xc65688(0x135));const _0xfbcaf=_0x268fd9['get'](_0x550b64);if(_0xfbcaf)return _0xfbcaf;const _0x27ae87=((async()=>{const _0x5da21e=_0xc65688;_0x208c8a(_0x550b64,_0x404e39['rule']);const _0x21942d=generateDeterministicJourneySegmentName(_0x1e4ddc[_0x5da21e(0x1f3)][_0x5da21e(0x1a5)],_0x550b64),_0x163559=_0x5a1851['existingSegments'][_0x5da21e(0x205)](_0xc38bdf=>_0xc38bdf[_0x5da21e(0x1a5)]===_0x21942d),_0x351b67=createSegmentIdResolver(_0x5a1851[_0x5da21e(0x152)],_0x550b64),_0x9baf72=await resolveRuleSegmentIds(_0x404e39[_0x5da21e(0x214)],_0x351b67);let _0x1a381b;return _0x163559?(await _0x119c0f['segment'][_0x5da21e(0x1c6)](_0x7fbbe1[_0x5da21e(0x1cf)],_0x163559['id'],{'description':_0x404e39['description']||'Entry\x20criteria:\x20'+_0x550b64,'rule':_0x482ec4(_0x9baf72),'countPopulation':!![]}),_0x1a381b=_0x163559['id'],saveSegmentToPushRecovery(_0x1e4ddc['absolutePath'],_0x1e4ddc[_0x5da21e(0x1f3)][_0x5da21e(0x1a5)],_0x550b64,{'segmentId':_0x1a381b,'uniqueServerName':_0x21942d,'createdAt':new Date()[_0x5da21e(0x186)]()})):_0x1a381b=await createOrRecoverEmbeddedSegment(_0x119c0f,_0x1e4ddc,{'localName':_0x550b64,'uniqueSegmentName':_0x21942d,'description':_0x404e39[_0x5da21e(0x13b)]||_0x5da21e(0x16d)+_0x550b64,'journeyId':_0x452a78,'resolvedRule':_0x9baf72,'parentId':_0x7fbbe1['parentId'],'folderId':_0x7fbbe1[_0x5da21e(0x193)]||''},_0x482ec4),_0x5a1851[_0x5da21e(0x152)][_0x5da21e(0x153)](_0x550b64,_0x1a381b),_0x119567[_0x5da21e(0x153)](_0x550b64,_0x1a381b),_0x1a381b;})());_0x268fd9[_0xc65688(0x153)](_0x550b64,_0x27ae87);try{return await _0x27ae87;}finally{_0x268fd9[_0xc65688(0x13d)](_0x550b64);}},'resolveActivationId':async _0xa8a360=>{const _0x282350=_0x2ad734,_0x44d447=_0x22a395['get'](_0xa8a360);if(_0x44d447)return _0x44d447;if(_0x1e4ddc['existingJourney']){await _0x3d3536();const _0xc285b3=_0x22a395[_0x282350(0x1aa)](_0xa8a360);if(_0xc285b3)return _0xc285b3;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x282350(0x159)+_0xa8a360+_0x282350(0x182)+_0x1e4ddc[_0x282350(0x1f3)]['name']+_0x282350(0x212)+_0x282350(0x22a));},'resolveEmbeddedActivationId':async(_0x8fc52c,_0x332cdd)=>{const _0x3d4d7a=_0x2ad734,_0x2526ea=_0x22a395[_0x3d4d7a(0x1aa)](_0x8fc52c);if(_0x2526ea)return _0x2526ea;if(_0x1e4ddc[_0x3d4d7a(0x1ff)])return _0xcb306a[_0x3d4d7a(0x153)](_0x8fc52c,_0x332cdd),createPendingActivationId(_0x8fc52c);if(_0x1e4ddc[_0x3d4d7a(0x17b)]){await _0x3d3536();const _0x2b35e9=_0x22a395[_0x3d4d7a(0x1aa)](_0x332cdd['name']);if(_0x2b35e9)return _0x22a395['set'](_0x8fc52c,_0x2b35e9),_0x2b35e9;const _0x3675a9=activationSignature(_0x332cdd),_0x42ab04=_0x1e09cc?.[_0x3d4d7a(0x1aa)](_0x3675a9);if(_0x42ab04)return _0x22a395[_0x3d4d7a(0x153)](_0x8fc52c,_0x42ab04),_0x42ab04;const _0x34196f=await _0x468f52(_0x332cdd,_0x5a1851[_0x3d4d7a(0x15e)]),_0x5c2a35={..._0x34196f,..._0x332cdd['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x332cdd[_0x3d4d7a(0x1af)]}},_0x25928=await _0x119c0f['journey'][_0x3d4d7a(0x165)](_0x1e4ddc[_0x3d4d7a(0x17b)]['id'],_0x5c2a35);return _0x22a395[_0x3d4d7a(0x153)](_0x8fc52c,_0x25928['id']),_0x25928['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0xc1fab1=>{const _0x48788b=_0x2ad734;try{return await _0x119c0f['journey'][_0x48788b(0x217)](_0x7fbbe1[_0x48788b(0x1cf)],_0xc1fab1);}catch(_0x261187){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0xc1fab1+_0x48788b(0x1c5)+_0x1e4ddc[_0x48788b(0x1f3)][_0x48788b(0x1a5)]+'\x27)',_0x261187);}},'resolveStageId':async(_0x2e6757,_0x156276)=>{const _0x5ca0ee=_0x2ad734,_0x3b0979=await _0x119c0f[_0x5ca0ee(0x229)][_0x5ca0ee(0x169)](_0x2e6757),_0x54bded=_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x1c4)][_0x5ca0ee(0x205)](_0x2dca54=>_0x2dca54['name']['toLowerCase']()===_0x156276[_0x5ca0ee(0x203)]());if(!_0x54bded?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x5ca0ee(0x184)+_0x156276+_0x5ca0ee(0x1e2)+(_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x21a)]||_0x3b0979[_0x5ca0ee(0x1ec)][_0x5ca0ee(0x1a5)])+'\x27');return _0x54bded['id'];}},_0x3e2acd=await _0x4e41ff(_0x1e4ddc[_0x2ad734(0x1f3)],_0x7fbbe1['parentId'],_0x30580d),_0x2ac688=_0x7fbbe1[_0x2ad734(0x18c)]||_0x7fbbe1[_0x2ad734(0x193)];_0x2ac688&&(_0x3e2acd[_0x2ad734(0x174)]={'parentFolder':{'data':{'id':_0x2ac688,'type':'folder'}}});if(_0x1e4ddc[_0x2ad734(0x1ff)]){if(_0x498038[_0x2ad734(0x1a3)]>0x0||_0xcb306a[_0x2ad734(0x1a3)]>0x0)return await executeThreeStepJourneyCreate(_0x119c0f,_0x1e4ddc,_0x3e2acd,{'pendingEmbeddedSegments':_0x498038,'pendingEmbeddedActivations':_0xcb306a,'embeddedSegmentNameToId':_0x119567,'journeyActivationNameToId':_0x22a395},{..._0x7fbbe1,'effectiveFolderId':_0x2ac688},_0x5a1851,_0x3acb96,_0x10472c);else{ensureJourneyDefaults(_0x3e2acd['attributes']);const _0x43d136=await _0x119c0f[_0x2ad734(0x229)][_0x2ad734(0x1ac)](_0x3e2acd);return deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':'created','journeyId':_0x43d136['id'],'embeddedSegmentNameToId':_0x119567};}}else{if(_0x1e4ddc[_0x2ad734(0x19c)]&&_0x1e4ddc['existingJourney']){_0x3e2acd['id']=_0x1e4ddc['existingJourney']['id'];const _0x5ab40c=_0x3e2acd[_0x2ad734(0x1ec)];_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]?.[_0x2ad734(0x21a)]&&(_0x5ab40c[_0x2ad734(0x21a)]=_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]['journeyBundleName']);const _0x508ccf=_0x1e4ddc[_0x2ad734(0x17b)][_0x2ad734(0x1ec)]?.[_0x2ad734(0x1c4)];return _0x508ccf&&_0x3e2acd['attributes'][_0x2ad734(0x1c4)]&&injectExistingStageIds(_0x3e2acd[_0x2ad734(0x1ec)]['journeyStages'],_0x508ccf),ensureJourneyDefaults(_0x5ab40c),await _0x119c0f['journey'][_0x2ad734(0x219)](_0x1e4ddc[_0x2ad734(0x17b)]['id'],_0x3e2acd),deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':_0x2ad734(0x164),'journeyId':_0x1e4ddc[_0x2ad734(0x17b)]['id'],'embeddedSegmentNameToId':_0x119567};}}return deletePushRecovery(_0x1e4ddc[_0x2ad734(0x155)]),{'action':_0x2ad734(0x14d),'journeyId':_0x1e4ddc[_0x2ad734(0x17b)]?.['id'],'embeddedSegmentNameToId':_0x119567};}function findSegmentCriteriaLocation(_0x844b00,_0x3af8a5){const _0xad1b9=a151_0x3dca48,_0x3780ee=_0x844b00[_0xad1b9(0x1cd)]||_0x844b00[_0xad1b9(0x1e8)]?.[0x0]?.['stages']||[];let _0x5a0dc7=_0xad1b9(0x173),_0x3f3f89=_0x3af8a5;const _0x57c7c5=_0x844b00[_0xad1b9(0x230)]||_0x844b00[_0xad1b9(0x1e8)]?.[0x0]?.[_0xad1b9(0x230)];if(_0x57c7c5?.['segment']===_0x3af8a5)return{'stageName':'goal','criteriaName':_0x57c7c5[_0xad1b9(0x1a5)]||_0x3af8a5};_0x2e4642:for(const _0x435f70 of _0x3780ee){if(_0x435f70['entry_criteria']?.[_0xad1b9(0x1b6)]===_0x3af8a5){_0x5a0dc7=_0x435f70[_0xad1b9(0x1a5)],_0x3f3f89=_0x435f70[_0xad1b9(0x1b3)][_0xad1b9(0x1a5)]||_0x3af8a5;break;}if(_0x435f70[_0xad1b9(0x170)])for(const _0x5e142f of _0x435f70['steps']){if(_0x5e142f[_0xad1b9(0x1ed)]===_0xad1b9(0x21c)&&_0x5e142f[_0xad1b9(0x1dd)]?.[_0xad1b9(0x234)])for(const _0x2e4e88 of _0x5e142f['with']['branches']){if(_0x2e4e88['segment']===_0x3af8a5){_0x5a0dc7=_0x435f70[_0xad1b9(0x1a5)],_0x3f3f89=_0x2e4e88[_0xad1b9(0x1a5)]||_0x3af8a5;break _0x2e4642;}}}}return{'stageName':_0x5a0dc7,'criteriaName':_0x3f3f89};}async function executeThreeStepJourneyCreate(_0x1cd8f3,_0x4ed854,_0x2c221e,_0x30db65,_0x33f64d,_0x13d81c,_0x131dc4,_0x2b78e7){const _0x4d8b07=a151_0x3dca48,{activationDefToCreateRequest:_0xb4d1ac,yamlRuleToApi:_0x4ea1e6}=_0x2b78e7,{pendingEmbeddedSegments:_0x4df3c1,pendingEmbeddedActivations:_0x4abe42,embeddedSegmentNameToId:_0x4c87fc}=_0x30db65,_0x10d8c3=JSON[_0x4d8b07(0x1de)](JSON['stringify'](_0x2c221e));ensureJourneyDefaults(_0x10d8c3[_0x4d8b07(0x1ec)]),stripPendingIds(_0x10d8c3);const _0xfc9d44=await _0x1cd8f3[_0x4d8b07(0x229)]['create'](_0x10d8c3),_0x568c36=_0xfc9d44['id'],_0x1008b5=new Map();for(const _0x5008eb of _0xfc9d44[_0x4d8b07(0x1ec)][_0x4d8b07(0x1c4)]){_0x1008b5[_0x4d8b07(0x153)](_0x5008eb[_0x4d8b07(0x1a5)]['toLowerCase'](),_0x5008eb['id']);}recoverSegmentIdsFromPushRecovery(_0x4ed854,_0x4c87fc,_0x13d81c[_0x4d8b07(0x152)]);for(const [_0x535637,{definition:_0x2bdf82}]of _0x4df3c1){if(_0x4c87fc[_0x4d8b07(0x232)](_0x535637)){_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x13a),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});continue;}const _0x54c19e=generateDeterministicJourneySegmentName(_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],_0x535637);_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x146),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});const _0x22ed5f=createSegmentIdResolver(_0x13d81c['segmentNameToId'],_0x535637),_0x1d8b67=await resolveRuleSegmentIds(_0x2bdf82[_0x4d8b07(0x214)],_0x22ed5f),_0x2e2d29=await createOrRecoverEmbeddedSegment(_0x1cd8f3,_0x4ed854,{'localName':_0x535637,'uniqueSegmentName':_0x54c19e,'description':_0x2bdf82['description']||'Entry\x20criteria:\x20'+_0x535637,'journeyId':_0x568c36,'resolvedRule':_0x1d8b67,'parentId':_0x33f64d[_0x4d8b07(0x1cf)],'folderId':_0x33f64d[_0x4d8b07(0x236)]||''},_0x4ea1e6);_0x4c87fc[_0x4d8b07(0x153)](_0x535637,_0x2e2d29),_0x13d81c['segmentNameToId'][_0x4d8b07(0x153)](_0x535637,_0x2e2d29),_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x13a),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'segmentName':_0x535637});}const _0x5f5b16=new Map();for(const [_0x4fbeed,_0x2dbd47]of _0x4abe42){_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x1cb),'journeyName':_0x4ed854['yamlConfig'][_0x4d8b07(0x1a5)],'activationName':_0x4fbeed});const _0x52b063=await _0xb4d1ac(_0x2dbd47,_0x13d81c['activationContext']),_0x194247={..._0x52b063,..._0x2dbd47[_0x4d8b07(0x1af)]!==undefined&&{'runAfterJourneyRefresh':_0x2dbd47[_0x4d8b07(0x1af)]}},_0x2bdc0c=await _0x1cd8f3[_0x4d8b07(0x229)][_0x4d8b07(0x165)](_0x568c36,_0x194247);_0x5f5b16[_0x4d8b07(0x153)](_0x4fbeed,_0x2bdc0c['id']),_0x30db65[_0x4d8b07(0x14b)][_0x4d8b07(0x153)](_0x4fbeed,_0x2bdc0c['id']),_0x131dc4[_0x4d8b07(0x13e)]?.({'type':_0x4d8b07(0x1b2),'journeyName':_0x4ed854[_0x4d8b07(0x1f3)][_0x4d8b07(0x1a5)],'activationName':_0x4fbeed});}const _0x2364fd=JSON[_0x4d8b07(0x1de)](JSON[_0x4d8b07(0x1eb)](_0x2c221e));return _0x2364fd['id']=_0x568c36,ensureJourneyDefaults(_0x2364fd[_0x4d8b07(0x1ec)]),resolvePendingIdsInRequest(_0x2364fd,_0x2c221e,_0x1008b5,_0x4c87fc,_0x5f5b16,_0x131dc4),await _0x1cd8f3[_0x4d8b07(0x229)]['update'](_0x568c36,_0x2364fd),deletePushRecovery(_0x4ed854[_0x4d8b07(0x155)]),{'action':'created','journeyId':_0x568c36,'embeddedSegmentNameToId':_0x4c87fc};}export function stripWaitStepPendingIds(_0x16c3e1){const _0x168dc7=a151_0x3dca48,_0x2408b5=_0x16c3e1[_0x168dc7(0x13c)]&&isPendingSegmentId(_0x16c3e1['conditionSegmentId']),_0x59113f=_0x16c3e1[_0x168dc7(0x138)]?.[_0x168dc7(0x145)](_0x2170cf=>_0x2170cf[_0x168dc7(0x1f5)]&&isPendingSegmentId(_0x2170cf[_0x168dc7(0x1f5)]));(_0x2408b5||_0x59113f)&&(_0x16c3e1['waitStepType']=_0x168dc7(0x185),_0x16c3e1[_0x168dc7(0x183)]=0x1,_0x16c3e1[_0x168dc7(0x1ae)]='day',delete _0x16c3e1[_0x168dc7(0x13c)],delete _0x16c3e1[_0x168dc7(0x1df)],delete _0x16c3e1['conditionTimeoutUnit'],delete _0x16c3e1[_0x168dc7(0x138)]);}export function resolveWaitStepPendingIds(_0x24f568,_0x1bdd0e,_0x417fff,_0x53118e){const _0x125730=a151_0x3dca48;if(_0x1bdd0e[_0x125730(0x13c)]&&isPendingSegmentId(_0x1bdd0e[_0x125730(0x13c)])){const _0x4ee527=_0x417fff(_0x1bdd0e[_0x125730(0x13c)],_0x125730(0x1c1)+_0x53118e+_0x125730(0x1bc));_0x4ee527&&(_0x24f568[_0x125730(0x1b4)]='Condition',_0x24f568[_0x125730(0x13c)]=_0x4ee527,delete _0x24f568[_0x125730(0x183)],delete _0x24f568['waitStepUnit'],_0x1bdd0e[_0x125730(0x1df)]!==undefined&&(_0x24f568[_0x125730(0x1df)]=_0x1bdd0e[_0x125730(0x1df)]),_0x1bdd0e['conditionTimeoutUnit']&&(_0x24f568[_0x125730(0x1db)]=_0x1bdd0e['conditionTimeoutUnit']));}if(_0x1bdd0e[_0x125730(0x138)]){const _0x42c2c8=_0x1bdd0e[_0x125730(0x138)]['some'](_0x305992=>_0x305992[_0x125730(0x1f5)]&&isPendingSegmentId(_0x305992[_0x125730(0x1f5)]));if(_0x42c2c8){const _0x4136f1=_0x1bdd0e[_0x125730(0x138)][_0x125730(0x237)](_0x241ce5=>{const _0x56afbb=_0x125730;if(_0x241ce5[_0x56afbb(0x1f5)]&&isPendingSegmentId(_0x241ce5['segmentId'])){const _0x589b2f=_0x417fff(_0x241ce5['segmentId'],_0x56afbb(0x1c1)+_0x53118e+_0x56afbb(0x1bc));return{..._0x241ce5,'segmentId':_0x589b2f||_0x241ce5[_0x56afbb(0x1f5)]};}return{..._0x241ce5};});_0x24f568[_0x125730(0x1b4)]=_0x125730(0x19e),_0x24f568[_0x125730(0x138)]=_0x4136f1,delete _0x24f568['waitStep'],delete _0x24f568[_0x125730(0x1ae)],delete _0x24f568['conditionSegmentId'],delete _0x24f568[_0x125730(0x1df)],delete _0x24f568[_0x125730(0x1db)];}}}function stripPendingIds(_0x37cc64){const _0x2cd91f=a151_0x3dca48;_0x37cc64[_0x2cd91f(0x1ec)][_0x2cd91f(0x230)]?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0x37cc64['attributes'][_0x2cd91f(0x230)][_0x2cd91f(0x1f5)])&&delete _0x37cc64[_0x2cd91f(0x1ec)][_0x2cd91f(0x230)];for(const _0xa93c1f of _0x37cc64[_0x2cd91f(0x1ec)]['journeyStages']||[]){_0xa93c1f[_0x2cd91f(0x18f)]?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0xa93c1f[_0x2cd91f(0x18f)][_0x2cd91f(0x1f5)])&&delete _0xa93c1f['entryCriteria'];_0xa93c1f['milestone']?.[_0x2cd91f(0x1f5)]&&isPendingSegmentId(_0xa93c1f[_0x2cd91f(0x23a)][_0x2cd91f(0x1f5)])&&delete _0xa93c1f[_0x2cd91f(0x23a)];_0xa93c1f['exitCriterias']&&(_0xa93c1f[_0x2cd91f(0x1ce)]=_0xa93c1f['exitCriterias']['filter'](_0x7a8288=>!_0x7a8288[_0x2cd91f(0x1f5)]||!isPendingSegmentId(_0x7a8288['segmentId'])));if(_0xa93c1f['steps'])for(const _0x5b510d of Object[_0x2cd91f(0x143)](_0xa93c1f[_0x2cd91f(0x170)])){const _0x292b67=_0xa93c1f['steps'][_0x5b510d];_0x292b67[_0x2cd91f(0x1ed)]===_0x2cd91f(0x20f)&&_0x292b67[_0x2cd91f(0x150)]&&isPendingActivationId(_0x292b67[_0x2cd91f(0x150)])&&(_0x292b67[_0x2cd91f(0x150)]='');if(_0x292b67[_0x2cd91f(0x1ed)]===_0x2cd91f(0x220)&&_0x292b67[_0x2cd91f(0x234)])for(const _0x1bf9b1 of _0x292b67[_0x2cd91f(0x234)]){_0x1bf9b1['segmentId']&&isPendingSegmentId(_0x1bf9b1[_0x2cd91f(0x1f5)])&&(_0x1bf9b1[_0x2cd91f(0x1f5)]='');}_0x292b67[_0x2cd91f(0x1ed)]==='WaitStep'&&stripWaitStepPendingIds(_0x292b67);}}}function resolvePendingIdsInRequest(_0x52c8b5,_0x56f466,_0x520d0d,_0x4c22c5,_0x442902,_0x2088de){const _0x3a73d2=a151_0x3dca48,_0x23be1b=(_0x370db2,_0x2be263)=>{const _0x529786=a151_0x1b24;if(!isPendingSegmentId(_0x370db2))return _0x370db2;const _0xb5a485=extractPendingSegmentName(_0x370db2),_0x49b4c1=_0x4c22c5['get'](_0xb5a485);return!_0x49b4c1&&_0x2088de['logWarning']?.(_0x529786(0x1ef)+_0xb5a485+_0x529786(0x199)+_0x2be263),_0x49b4c1;};if(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]['segmentId'])){const _0x21cbac=_0x23be1b(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)]['segmentId'],'goal\x20criteria');_0x21cbac&&(_0x52c8b5[_0x3a73d2(0x1ec)][_0x3a73d2(0x230)][_0x3a73d2(0x1f5)]=_0x21cbac);}for(const _0x5577a6 of _0x52c8b5['attributes'][_0x3a73d2(0x1c4)]||[]){const _0x54e643=_0x520d0d[_0x3a73d2(0x1aa)](_0x5577a6[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]());_0x54e643&&(_0x5577a6['id']=_0x54e643);if(_0x5577a6['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)])){const _0x31d421=_0x23be1b(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+_0x3a73d2(0x1fa));_0x31d421&&(_0x5577a6[_0x3a73d2(0x18f)][_0x3a73d2(0x1f5)]=_0x31d421);}if(_0x5577a6['exitCriterias'])for(const _0x10b884 of _0x5577a6[_0x3a73d2(0x1ce)]){if(_0x10b884['segmentId']&&isPendingSegmentId(_0x10b884[_0x3a73d2(0x1f5)])){const _0xe6b311=_0x23be1b(_0x10b884[_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+_0x3a73d2(0x1c7));_0xe6b311&&(_0x10b884[_0x3a73d2(0x1f5)]=_0xe6b311);}}if(_0x5577a6[_0x3a73d2(0x23a)]?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x5577a6['milestone']['segmentId'])){const _0x58cabb=_0x23be1b(_0x5577a6[_0x3a73d2(0x23a)][_0x3a73d2(0x1f5)],_0x3a73d2(0x1c1)+_0x5577a6['name']+'\x27\x20milestone');_0x58cabb&&(_0x5577a6[_0x3a73d2(0x23a)]['segmentId']=_0x58cabb);}if(_0x5577a6[_0x3a73d2(0x170)]){const _0x3676cf=_0x2f9b93=>_0x56f466[_0x3a73d2(0x1ec)]['journeyStages']?.[_0x3a73d2(0x205)](_0x4b7a41=>_0x4b7a41[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]()===_0x5577a6[_0x3a73d2(0x1a5)][_0x3a73d2(0x203)]())?.['steps']?.[_0x2f9b93];for(const _0x7d038a of Object[_0x3a73d2(0x143)](_0x5577a6[_0x3a73d2(0x170)])){const _0x40c647=_0x5577a6[_0x3a73d2(0x170)][_0x7d038a],_0x10b4b6=_0x3676cf(_0x7d038a);if(_0x40c647[_0x3a73d2(0x1ed)]==='Activation'&&_0x40c647[_0x3a73d2(0x150)]&&(isPendingActivationId(_0x40c647[_0x3a73d2(0x150)])||_0x40c647[_0x3a73d2(0x150)]==='')){if(_0x10b4b6?.['journeyActivationStepId']&&isPendingActivationId(_0x10b4b6[_0x3a73d2(0x150)])){const _0x2990df=extractPendingActivationName(_0x10b4b6['journeyActivationStepId']),_0x234ecb=_0x442902[_0x3a73d2(0x1aa)](_0x2990df);_0x234ecb&&(_0x40c647[_0x3a73d2(0x150)]=_0x234ecb);}}if(_0x40c647['type']===_0x3a73d2(0x220)&&_0x40c647[_0x3a73d2(0x234)]&&_0x10b4b6?.[_0x3a73d2(0x234)])for(let _0x8f0ebf=0x0;_0x8f0ebf<_0x40c647[_0x3a73d2(0x234)][_0x3a73d2(0x14a)];_0x8f0ebf++){const _0x111c38=_0x40c647[_0x3a73d2(0x234)][_0x8f0ebf],_0x40bb82=_0x10b4b6[_0x3a73d2(0x234)][_0x8f0ebf];if(_0x40bb82?.[_0x3a73d2(0x1f5)]&&isPendingSegmentId(_0x40bb82[_0x3a73d2(0x1f5)])){const _0x2c7de3=_0x23be1b(_0x40bb82['segmentId'],_0x3a73d2(0x1c1)+_0x5577a6[_0x3a73d2(0x1a5)]+_0x3a73d2(0x23e)+(_0x111c38[_0x3a73d2(0x1a5)]||_0x8f0ebf)+'\x27');_0x2c7de3&&(_0x111c38['segmentId']=_0x2c7de3);}}_0x40c647[_0x3a73d2(0x1ed)]===_0x3a73d2(0x1f2)&&_0x10b4b6?.['type']===_0x3a73d2(0x1f2)&&resolveWaitStepPendingIds(_0x40c647,_0x10b4b6,_0x23be1b,_0x5577a6['name']);}}}}
|
|
1
|
+
const a151_0x2ed631=a151_0x5571;(function(_0x15ff81,_0x25ac25){const _0x39ec80=a151_0x5571,_0x2eee15=_0x15ff81();while(!![]){try{const _0xe5b872=parseInt(_0x39ec80(0x1fb))/0x1+parseInt(_0x39ec80(0x1c6))/0x2*(-parseInt(_0x39ec80(0x1c2))/0x3)+-parseInt(_0x39ec80(0x134))/0x4*(-parseInt(_0x39ec80(0x11e))/0x5)+-parseInt(_0x39ec80(0x186))/0x6*(parseInt(_0x39ec80(0x129))/0x7)+parseInt(_0x39ec80(0x20d))/0x8+parseInt(_0x39ec80(0x17f))/0x9*(-parseInt(_0x39ec80(0x11c))/0xa)+parseInt(_0x39ec80(0x1ff))/0xb*(parseInt(_0x39ec80(0x20a))/0xc);if(_0xe5b872===_0x25ac25)break;else _0x2eee15['push'](_0x2eee15['shift']());}catch(_0x1010f4){_0x2eee15['push'](_0x2eee15['shift']());}}}(a151_0x57e9,0xbee3e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x2ed631(0x14b));export const PENDING_SEGMENT_PREFIX=a151_0x2ed631(0x1a1);export const PENDING_ACTIVATION_PREFIX=a151_0x2ed631(0x13a);export function createPendingSegmentId(_0x2b4643){return''+PENDING_SEGMENT_PREFIX+_0x2b4643+'__';}export function isPendingSegmentId(_0x1e6863){const _0x58f24a=a151_0x2ed631;return _0x1e6863[_0x58f24a(0x131)](PENDING_SEGMENT_PREFIX)&&!_0x1e6863[_0x58f24a(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x58d5da){return _0x58d5da['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x26d196){return''+PENDING_ACTIVATION_PREFIX+_0x26d196+'__';}export function isPendingActivationId(_0x32eefe){const _0x6d57cb=a151_0x2ed631;return _0x32eefe[_0x6d57cb(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x29ae6c){const _0x30283c=a151_0x2ed631;return _0x29ae6c[_0x30283c(0x18d)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5d01fa,_0x20a553){const _0x4402f3=a151_0x2ed631,_0x40f5b3=_0x5d01fa+'::'+(_0x20a553[_0x4402f3(0x130)]()||_0x4402f3(0x1b9)),_0x1859f5=createHash(_0x4402f3(0x1d5))['update'](_0x40f5b3)[_0x4402f3(0x219)](_0x4402f3(0x19d))[_0x4402f3(0x205)](0x0,0xc);return'journey_entry_criteria_'+_0x1859f5;}export function ensureJourneyDefaults(_0x2fe0fd){const _0x556c87=a151_0x2ed631;!_0x2fe0fd['description']&&(_0x2fe0fd['description']=''),!_0x2fe0fd[_0x556c87(0x1f8)]&&(_0x2fe0fd[_0x556c87(0x1f8)]=_0x556c87(0x172));}export function injectExistingStageIds(_0x53fc21,_0x36e427){const _0x374c5d=a151_0x2ed631,_0x35e8be=new Map(_0x36e427[_0x374c5d(0x191)](_0x385314=>[_0x385314[_0x374c5d(0x17c)],_0x385314['id']]));for(const _0x7cecef of _0x53fc21){if(!_0x7cecef['id']){const _0x521094=_0x35e8be[_0x374c5d(0x1ac)](_0x7cecef[_0x374c5d(0x17c)]);_0x521094&&(_0x7cecef['id']=_0x521094);}}}export function resolveTDFolderPath(_0x4e9b29,_0x15637e,_0x3e6048){const _0x45193e=a151_0x2ed631;if(!_0x15637e)return _0x4e9b29;if(_0x4e9b29===_0x3e6048||_0x4e9b29[_0x45193e(0x131)](_0x3e6048+'/'))return _0x4e9b29;return _0x4e9b29?_0x3e6048+'/'+_0x4e9b29:_0x3e6048;}export function addFoldersToCreate(_0x4966e0,_0xe2255e,_0x299980){const _0x3874e7=a151_0x2ed631;if(!_0x4966e0)return;if(_0xe2255e[_0x3874e7(0x1b5)](_0x4966e0))return;const _0x13255b=_0x4966e0[_0x3874e7(0x13c)]('/');let _0x101902='';for(const _0xd1e9c2 of _0x13255b){_0x101902=_0x101902?_0x101902+'/'+_0xd1e9c2:_0xd1e9c2,!_0xe2255e['has'](_0x101902)&&_0x299980['add'](_0x101902);}}export function sortFoldersByDepth(_0x1c3e13){return[..._0x1c3e13]['sort']((_0x4157f5,_0x17e89d)=>{const _0x1c90f2=a151_0x5571,_0x2c4ee3=(_0x4157f5['match'](/\//g)||[])[_0x1c90f2(0x165)],_0x1d6802=(_0x17e89d[_0x1c90f2(0x187)](/\//g)||[])[_0x1c90f2(0x165)];return _0x2c4ee3-_0x1d6802;});}import*as a151_0x297b00 from'yaml';import{readFileSync}from'fs';import a151_0x574767 from'path';import{isJourneyDef,parseYamlString as a151_0x113781,toYamlString as a151_0x36b8c4,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x346c3a){const _0xf72f14=a151_0x2ed631;if(Array[_0xf72f14(0x20f)](_0x346c3a))return'['+_0x346c3a[_0xf72f14(0x191)](_0x543cb0=>stableStringify(_0x543cb0))[_0xf72f14(0x1fe)](',')+']';if(_0x346c3a&&typeof _0x346c3a==='object'){const _0x254d7e=_0x346c3a,_0x1da62d=Object[_0xf72f14(0x197)](_0x254d7e)[_0xf72f14(0x158)](),_0x39879d=_0x1da62d[_0xf72f14(0x191)](_0xb4e890=>'\x22'+_0xb4e890+'\x22:'+stableStringify(_0x254d7e[_0xb4e890]));return'{'+_0x39879d['join'](',')+'}';}const _0x6e9829=JSON[_0xf72f14(0x14e)](_0x346c3a);return _0x6e9829===undefined?_0xf72f14(0x1bc):_0x6e9829;}function activationSignature(_0x1bc8ca){const _0x2f0cc5=a151_0x2ed631,_0x4ef6b1={'connection':_0x1bc8ca[_0x2f0cc5(0x153)],..._0x1bc8ca[_0x2f0cc5(0x1a4)]!==undefined&&{'all_columns':_0x1bc8ca[_0x2f0cc5(0x1a4)]},..._0x1bc8ca[_0x2f0cc5(0x155)]!==undefined&&{'columns':_0x1bc8ca[_0x2f0cc5(0x155)]},..._0x1bc8ca[_0x2f0cc5(0x170)]!==undefined&&{'behavior':_0x1bc8ca['behavior']},..._0x1bc8ca[_0x2f0cc5(0x142)]!==undefined&&{'schedule':_0x1bc8ca[_0x2f0cc5(0x142)]},..._0x1bc8ca['notification']!==undefined&&{'notification':_0x1bc8ca[_0x2f0cc5(0x163)]},..._0x1bc8ca[_0x2f0cc5(0x1ea)]!==undefined&&{'connector_config':_0x1bc8ca[_0x2f0cc5(0x1ea)]},..._0x1bc8ca[_0x2f0cc5(0x174)]!==undefined&&{'activation_template_id':_0x1bc8ca[_0x2f0cc5(0x174)]}};return stableStringify(_0x4ef6b1);}async function fetchSegment(_0x27e776,_0x4d2044,_0x333e8a,_0x571bef){const _0x1d26ec=a151_0x2ed631,_0x5dc1ac=_0x571bef?.[_0x1d26ec(0x1bb)](_0x499d1c=>_0x499d1c['id']===_0x333e8a);if(_0x5dc1ac)return _0x5dc1ac;try{return await _0x27e776[_0x1d26ec(0x1b9)]['getSegment'](_0x4d2044,_0x333e8a);}catch(_0x530167){logger['debug']('getSegment\x20failed\x20for\x20'+_0x333e8a+_0x1d26ec(0x188)+_0x530167);try{return await _0x27e776[_0x1d26ec(0x1b9)][_0x1d26ec(0x1b1)](_0x333e8a);}catch(_0x323ef7){return logger[_0x1d26ec(0x12c)](_0x1d26ec(0x177)+_0x333e8a+':\x20'+_0x323ef7),null;}}}function a151_0x57e9(){const _0x5830de=['Failed\x20to\x20fetch\x20referenced\x20segment\x20','results','logSuccess','includes','\x27\x20for\x20','Activation','behavior','logDeleted','draft','activationContext','activation_template_id','Condition','updateActivation','getSegmentEntity\x20also\x20failed\x20for\x20','milestone','update','Updating\x20segment\x20\x27','activation_deleted','name','connectionIdToNameMap','stage\x20\x27','9yjkNYT','unchanged','toLowerCase','Created\x20folder\x20\x27','onProgress','segment_creating','\x27\x20entry\x20criteria','83574apEpAj','match',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','conditionTimeoutDuration','segments','kind','Failed\x20to\x20','replace','journeyActivationNameToId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x27\x20exit\x20criteria','map','action','segmentNameToId','journeyName','uniqueSegmentName','segmentFolderId','keys','rule','max','attributes','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','list','hex','deps','./journey-yaml.js','\x27\x20not\x20found\x20in\x20journey\x20\x27','__pending_','activations','toISOString','all_columns','Delete\x20the\x20push\x20recovery\x20file\x20(','item','JOURNEY_SYNTAX_ERROR','relative','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','waitStepType','index','get','Deleting\x20activation\x20\x27','progress','entries','Segment\x20not\x20found:\x20','getSegmentEntity','deleteSegment','deleteActivation','Created\x20journey\x20\x27','has','SEGMENT_SYNTAX_ERROR','createActivation','journey','segment','journey_updated','find','null','existingActivation','activation_deleting','stages','nameToType','absolutePath','42XCuikz','Updated\x20activation\x20\x27','\x27\x20milestone','user','167988gnxSsp','set','hasChanges','fetchJourney','localName','idToName','activationStepsById','description','createJourneySegment','activation_updating','add','conditionTimeoutUnit','uniqueServerName','push','idToEmailMap','sha1','INTERNAL','deleted','isNew','rootFolderId','parseDocument','updateSegmentById','delete','Failed\x20to\x20resolve\x20activation\x20','segment_deleting','updated','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','Updated\x20journey\x20\x27','entryCriteria','Stage\x20\x27','embedded_segment_creating','Journey\x20\x27','size','with','\x20error(s)','run_after_journey_refresh','connector_config','embedded_activation_created','decision_point','getActivation','existingSegment','activationParams','conditionSegmentId','activationActions','entry','effectiveFolderId','buildUserMaps','journeyBundleName','Fetching\x20','embeddedSegmentNameToId','state','journeyStages','journeyBundlesByFolderAndName','1317053YSDqkh','journey_creating','filter','join','1265bseRiT','Updated\x20segment\x20\x27','segment_created','skipSegments','segmentId','message','slice','./child-segment-yaml.js','journeyId','createdSegmentId','../../utils/async.js','169500oHNZea','versionNumber','values','7294712xloHcQ','validatedRequest','isArray','Creating\x20activation\x20\x27','parse','some','createSegment','from','exitCriterias','\x20(referenced\x20in\x20journey\x20','journey_created','branches','digest','all','segmentByFolderAndName','Name\x20has\x20already\x20been\x20taken','SEGMENT_NOT_FOUND','12337860OIvDlN','journeyActivationStepId','35ecVOVj','utf-8','resolveSegment','logInfo','relationships','yamlActivation','valid','data','steps','folderPathToId','NOT_FOUND','658ZPfymN','WaitStep','ACTIVATION_UPDATE_ERROR','debug','existingJourney','and\x20the\x20server\x20segment,\x20then\x20retry.','conditions','trim','startsWith','createFolder','segment_deleted','370084QySbBy','withProgress','yamlConfig','folderId','type','Embedded\x20segment\x20\x27','__pending_act_','folderPath','split','journeys','resolvedRule','goal\x20criteria','\x27...','errors','schedule','Created\x20segment\x20\x27','created','flatMap','\x0a\x20\x20','create','dirname','Deleted\x20activation\x20\x27','journeyById','tdx.sdk.push-workflow','\x20segment\x20from\x20file:\x20','Duration','stringify','\x27\x20from\x20file:\x20','Activation\x20not\x20found:\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','diff','connection','waitStep','columns','.$1.push-recovery.json','activation_updated','sort','Segment\x20not\x20found','existingSegments','DecisionPoint','getJourney','JOURNEY_UPDATE_ERROR','entry_criteria','toString','\x27\x20wait\x20condition','goal','listActivations','notification','parentId','length','waitStepUnit','journey_updating','createdSegmentIds','logWarning'];a151_0x57e9=function(){return _0x5830de;};return a151_0x57e9();}function recoverSegmentIdsFromPushRecovery(_0x24b910,_0x54cc76,_0x52af92){const _0x4ddee4=a151_0x2ed631,_0x1a9033=readPushRecovery(_0x24b910[_0x4ddee4(0x1c1)]);if(_0x1a9033?.[_0x4ddee4(0x194)]===_0x24b910[_0x4ddee4(0x136)][_0x4ddee4(0x17c)])for(const [_0x477445,_0x3274af]of Object[_0x4ddee4(0x1af)](_0x1a9033[_0x4ddee4(0x18a)])){const _0x280fdd=generateDeterministicJourneySegmentName(_0x24b910[_0x4ddee4(0x136)][_0x4ddee4(0x17c)],_0x477445);_0x3274af[_0x4ddee4(0x1d2)]===_0x280fdd&&(_0x54cc76[_0x4ddee4(0x1c7)](_0x477445,_0x3274af[_0x4ddee4(0x203)]),_0x52af92[_0x4ddee4(0x1c7)](_0x477445,_0x3274af[_0x4ddee4(0x203)]));}}async function createOrRecoverEmbeddedSegment(_0x1ebaf7,_0x182a3a,_0x4841e1,_0x3add28){const _0x4d0d26=a151_0x2ed631;let _0xc522d9;try{_0xc522d9=await _0x1ebaf7[_0x4d0d26(0x1b9)][_0x4d0d26(0x1ce)]({'name':_0x4841e1['uniqueSegmentName'],'description':_0x4841e1[_0x4d0d26(0x1cd)],'journeyId':_0x4841e1[_0x4d0d26(0x207)],'rule':_0x3add28(_0x4841e1[_0x4d0d26(0x13e)],!![]),'countPopulation':!![],'parentFolderId':_0x4841e1[_0x4d0d26(0x137)],'audienceId':_0x4841e1[_0x4d0d26(0x164)]});}catch(_0x22ff7d){const _0x1fdc21=_0x22ff7d instanceof Error&&_0x22ff7d[_0x4d0d26(0x204)][_0x4d0d26(0x16d)](_0x4d0d26(0x11a));if(_0x1fdc21){const _0x21c3fb=readPushRecovery(_0x182a3a[_0x4d0d26(0x1c1)]),_0x579864=_0x21c3fb?.['journeyName']===_0x182a3a[_0x4d0d26(0x136)][_0x4d0d26(0x17c)]?_0x21c3fb[_0x4d0d26(0x18a)][_0x4841e1[_0x4d0d26(0x1ca)]]:undefined;if(_0x579864?.['uniqueServerName']===_0x4841e1[_0x4d0d26(0x195)])await _0x1ebaf7[_0x4d0d26(0x1b9)][_0x4d0d26(0x1db)](_0x4841e1[_0x4d0d26(0x164)],_0x579864[_0x4d0d26(0x203)],{'description':_0x4841e1[_0x4d0d26(0x1cd)],'rule':_0x3add28(_0x4841e1[_0x4d0d26(0x13e)],!![]),'countPopulation':!![]}),_0xc522d9=_0x579864[_0x4d0d26(0x203)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d0d26(0x139)+_0x4841e1[_0x4d0d26(0x1ca)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x4d0d26(0x1a5)+_0x182a3a[_0x4d0d26(0x1c1)]['replace'](/([^/]+)$/,_0x4d0d26(0x156))+')\x20')+_0x4d0d26(0x12e),_0x22ff7d);}else throw _0x22ff7d;}return saveSegmentToPushRecovery(_0x182a3a[_0x4d0d26(0x1c1)],_0x182a3a[_0x4d0d26(0x136)][_0x4d0d26(0x17c)],_0x4841e1['localName'],{'segmentId':_0xc522d9,'uniqueServerName':_0x4841e1[_0x4d0d26(0x195)],'createdAt':new Date()[_0x4d0d26(0x1a3)]()}),_0xc522d9;}export async function prepareSegmentFiles(_0x59f9ad,_0x4a8dce,_0x10a497,_0x95d730,_0x5919e0){const _0x582caa=a151_0x2ed631,{activationDefToCreateRequest:_0x3d5fe3}=await import('./child-segment-yaml.js'),_0x340951=[],_0x273fa4=new Set();for(const {yamlConfig:_0x4c39e4,folderPath:_0x2f9c94,sourcePath:_0x23e426}of _0x59f9ad){const _0x1223c2=resolveTDFolderPath(_0x2f9c94,_0x95d730,_0x5919e0),_0x286172=_0x1223c2+':'+_0x4c39e4[_0x582caa(0x17c)],_0x5217a0=_0x4a8dce[_0x582caa(0x119)][_0x582caa(0x1ac)](_0x286172),_0x1f8da2=_0x5217a0?_0x4a8dce['activationsBySegmentId'][_0x582caa(0x1ac)](_0x5217a0['id'])||[]:[];addFoldersToCreate(_0x1223c2,_0x4a8dce[_0x582caa(0x127)],_0x273fa4);const _0x1a03e7=calculateActivationActions(_0x4c39e4[_0x582caa(0x1a2)]||[],_0x1f8da2,_0x4a8dce[_0x582caa(0x1d4)],_0x4a8dce[_0x582caa(0x17d)]);for(const _0x30bef4 of _0x1a03e7){(_0x30bef4[_0x582caa(0x138)]==='create'||_0x30bef4[_0x582caa(0x138)]===_0x582caa(0x179))&&_0x30bef4[_0x582caa(0x123)]&&(_0x30bef4['validatedRequest']=await _0x3d5fe3(_0x30bef4[_0x582caa(0x123)],_0x10a497));}const _0x28f254=calculateSegmentDiff(_0x4c39e4,_0x5217a0,_0x1f8da2,_0x4a8dce[_0x582caa(0x1d4)],_0x4a8dce[_0x582caa(0x17d)]);_0x340951['push']({'relativePath':_0x4c39e4[_0x582caa(0x17c)],'absolutePath':_0x23e426,'yamlConfig':_0x4c39e4,'folderPath':_0x1223c2,'existingSegment':_0x5217a0,'existingActivations':_0x1f8da2,'isNew':_0x28f254[_0x582caa(0x1d8)],'hasChanges':_0x28f254[_0x582caa(0x1c8)],'diff':_0x28f254[_0x582caa(0x152)],'activationActions':_0x1a03e7});}return{'segmentFiles':_0x340951,'foldersToCreate':_0x273fa4};}export async function prepareJourneyFiles(_0x2a48b6,_0x36b31,_0x16cb24,_0xa4e5d1){const _0x39c10a=a151_0x2ed631,_0x45c740=[],_0x53ff2=new Set();for(const {yamlConfig:_0x4a115a,folderPath:_0x2aff95,sourcePath:_0x2bb4c9}of _0x2a48b6){const _0x2bde7a=resolveTDFolderPath(_0x2aff95,_0x16cb24,_0xa4e5d1),_0x694535=_0x2bde7a+':'+_0x4a115a[_0x39c10a(0x17c)],_0x249d94=_0x36b31[_0x39c10a(0x1fa)][_0x39c10a(0x1ac)](_0x694535);let _0x53172f,_0x552416;if(_0x249d94&&_0x249d94[_0x39c10a(0x165)]>0x0){const _0x4e767e=buildLocalExpandedRuleMappings(_0x4a115a),{createYamlContext:_0xbcf750,prefetchJourneySegments:_0x6a6db5}=createPushYamlContextForBundle(_0x36b31[_0x39c10a(0x19e)],_0x36b31[_0x39c10a(0x164)],_0x36b31[_0x39c10a(0x15a)],_0x4e767e,_0x36b31[_0x39c10a(0x1d4)],_0x36b31[_0x39c10a(0x17d)],_0x36b31[_0x39c10a(0x1cc)],_0x36b31['journeyById']);await _0x6a6db5(_0x249d94[_0x39c10a(0x191)](_0x570bac=>_0x570bac['id']));const _0x171515=await _0x36b31[_0x39c10a(0x19e)][_0x39c10a(0x1b8)]['getLatestJourneyId'](_0x249d94[0x0]['journeyBundleId']),_0xdffef3=hasMultipleVersions(_0x4a115a),_0x42b92d=async _0x22c5c5=>{const _0x3981dd=_0x39c10a,_0x56d36c=_0x36b31[_0x3981dd(0x14a)]?.[_0x3981dd(0x1ac)](_0x22c5c5);if(_0x56d36c)return _0x56d36c;return _0x36b31[_0x3981dd(0x1c9)]({'journeyId':_0x22c5c5,'journeyName':_0x4a115a[_0x3981dd(0x17c)],'isMultiVersion':_0x249d94['length']>0x1});};if(_0xdffef3&&_0x249d94[_0x39c10a(0x165)]>0x1){const _0x2fbfd4=[];for(const _0x5bcf93 of _0x249d94){const _0x319bca=_0x5bcf93[_0x39c10a(0x20b)]||0x1;_0x36b31[_0x39c10a(0x1ae)]?.[_0x39c10a(0x179)]('Fetching\x20'+_0x4a115a[_0x39c10a(0x17c)]+'\x20v'+_0x319bca);const _0x5e1a46=await _0x42b92d(_0x5bcf93['id']),_0x871183=_0xbcf750(_0x5bcf93['id']),_0x2a3301=await journeyResponseToDef(_0x5e1a46,_0x871183);_0x2fbfd4['push']({'item':_0x5bcf93,'yaml':_0x2a3301});}const _0x3f47bf=buildLocalRuleToNameMappingFromJourney(_0x4a115a);_0x552416=buildMergedJourneyDef(_0x2fbfd4,_0x3f47bf,_0x171515);const _0x86571c=Math[_0x39c10a(0x199)](..._0x2fbfd4['map'](_0x8cf8f8=>_0x8cf8f8[_0x39c10a(0x1a6)][_0x39c10a(0x20b)]||0x0)),_0xc4f526=_0x249d94[_0x39c10a(0x1bb)](_0x24a703=>(_0x24a703[_0x39c10a(0x20b)]||0x0)===_0x86571c);_0xc4f526&&(_0x36b31[_0x39c10a(0x1ae)]?.['update'](_0x39c10a(0x1f6)+_0x4a115a[_0x39c10a(0x17c)]+'\x20v'+_0x86571c),_0x53172f=await _0x42b92d(_0xc4f526['id']));}else{const _0x2d53e1=_0x249d94[_0x249d94[_0x39c10a(0x165)]-0x1];_0x36b31[_0x39c10a(0x1ae)]?.[_0x39c10a(0x179)](_0x39c10a(0x1f6)+_0x4a115a[_0x39c10a(0x17c)]),_0x53172f=await _0x42b92d(_0x2d53e1['id']);const _0x133205=_0xbcf750(_0x2d53e1['id']),_0x373723=await journeyResponseToDef(_0x53172f,_0x133205),_0x13f1a5=buildLocalRuleToNameMappingFromJourney(_0x4a115a);_0x552416=buildMergedJourneyDef([{'item':_0x2d53e1,'yaml':_0x373723}],_0x13f1a5,_0x171515);}}addFoldersToCreate(_0x2bde7a,_0x36b31[_0x39c10a(0x127)],_0x53ff2);const _0xd271c0=calculateJourneyDiff(_0x4a115a,_0x552416);_0x45c740['push']({'relativePath':_0x4a115a[_0x39c10a(0x17c)],'absolutePath':_0x2bb4c9,'yamlConfig':_0x4a115a,'folderPath':_0x2bde7a,'existingJourney':_0x53172f,'isNew':_0xd271c0[_0x39c10a(0x1d8)],'hasChanges':_0xd271c0[_0x39c10a(0x1c8)],'diff':_0xd271c0[_0x39c10a(0x152)]});}return{'journeyFiles':_0x45c740,'foldersToCreate':_0x53ff2};}export function calculateActivationActions(_0x8b54f0,_0x540a86,_0x118dce,_0x40e9c9){const _0x808a8d=a151_0x2ed631,_0x13279c=[],_0xa649b3=new Map();for(const _0x2c85f9 of _0x540a86){_0xa649b3[_0x808a8d(0x1c7)](_0x2c85f9[_0x808a8d(0x17c)],_0x2c85f9);}const _0x2156ed=new Map();for(const _0x20ae84 of _0x8b54f0){_0x2156ed[_0x808a8d(0x1c7)](_0x20ae84[_0x808a8d(0x17c)],_0x20ae84);}for(const _0x108b0f of _0x8b54f0){const _0x1edbd6=_0xa649b3[_0x808a8d(0x1ac)](_0x108b0f[_0x808a8d(0x17c)]);if(!_0x1edbd6)_0x13279c['push']({'type':'create','name':_0x108b0f[_0x808a8d(0x17c)],'yamlActivation':_0x108b0f});else{const _0x201dd0=activationResponseToDef(_0x1edbd6,_0x118dce,_0x40e9c9),_0x37625b=a151_0x297b00[_0x808a8d(0x14e)](_0x201dd0),_0x76e01b=a151_0x297b00['stringify'](_0x108b0f);_0x37625b!==_0x76e01b&&_0x13279c[_0x808a8d(0x1d3)]({'type':'update','name':_0x108b0f[_0x808a8d(0x17c)],'yamlActivation':_0x108b0f,'existingActivation':_0x1edbd6});}}for(const _0x4604ec of _0x540a86){!_0x2156ed['has'](_0x4604ec[_0x808a8d(0x17c)])&&_0x13279c[_0x808a8d(0x1d3)]({'type':_0x808a8d(0x1dc),'name':_0x4604ec['name'],'existingActivation':_0x4604ec});}return _0x13279c;}function calculateYamlDiff(_0x302849,_0x224e8a){if(_0x224e8a){const _0x16a1e3=generateDiff(_0x224e8a,_0x302849),_0x5bfb69=hasChanges(_0x16a1e3);return{'isNew':![],'hasChanges':_0x5bfb69,'diff':_0x5bfb69?formatDiffWithColors(_0x16a1e3):undefined};}const _0x4c48ff=generateDiff('',_0x302849);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4c48ff)};}export function calculateSegmentDiff(_0x12c0b9,_0x584882,_0x256da3,_0x2e079b,_0x63787d){const _0x5d3eef=segmentToYamlString(_0x12c0b9),_0x1864b1=_0x584882?segmentToYamlString(segmentWithActivationsToYaml(_0x584882,_0x256da3,undefined,_0x2e079b,_0x63787d)):undefined;return calculateYamlDiff(_0x5d3eef,_0x1864b1);}export function calculateJourneyDiff(_0x5c7e30,_0x57ffac){const _0x5b8698=normalizeJourneyDef(_0x5c7e30,_0x5c7e30),_0x39f9a4=a151_0x36b8c4(_0x5b8698),_0x11d74f=_0x57ffac?a151_0x36b8c4(normalizeJourneyDef(_0x57ffac,_0x5c7e30)):undefined;return calculateYamlDiff(_0x39f9a4,_0x11d74f);}export function findSegmentsToDelete(_0x21c5e7,_0x990404,_0x43c47c,_0x500744,_0x54b5dd){const _0x50db7c=a151_0x2ed631,_0x3ca8f3=new Set();for(const {yamlConfig:_0x912767,folderPath:_0x23042d}of _0x990404){_0x3ca8f3[_0x50db7c(0x1d0)](_0x23042d+':'+_0x912767[_0x50db7c(0x17c)]);}return _0x21c5e7[_0x50db7c(0x1fd)](_0x4cc135=>{const _0x8e9872=_0x50db7c,_0x34b983=_0x4cc135['segmentFolderId']?_0x43c47c[_0x8e9872(0x1ac)](_0x4cc135[_0x8e9872(0x196)][_0x8e9872(0x15f)]())||'':'',_0x3822d9=_0x34b983+':'+_0x4cc135[_0x8e9872(0x17c)];if(_0x3ca8f3[_0x8e9872(0x1b5)](_0x3822d9))return![];if(_0x54b5dd)return _0x34b983===_0x500744||_0x34b983[_0x8e9872(0x131)](_0x500744+'/');return!![];});}export function findJourneysToDelete(_0x159f5d,_0x4eb97c,_0x1f79fb,_0x1463fa,_0x2293b0){const _0x3e4f35=a151_0x2ed631,_0x4421db=new Set();for(const {yamlConfig:_0x4019f6,folderPath:_0x28cea3}of _0x4eb97c){_0x4421db[_0x3e4f35(0x1d0)](_0x28cea3+':'+_0x4019f6[_0x3e4f35(0x17c)]);}return _0x159f5d[_0x3e4f35(0x1fd)](_0x1f0a6b=>{const _0xe8742f=_0x3e4f35,_0x347e58=_0x1f0a6b[_0xe8742f(0x137)]?_0x1f79fb[_0xe8742f(0x1ac)](_0x1f0a6b[_0xe8742f(0x137)])||'':'',_0x44cebf=_0x347e58+':'+_0x1f0a6b[_0xe8742f(0x1f5)];if(_0x4421db[_0xe8742f(0x1b5)](_0x44cebf))return![];if(_0x2293b0)return _0x347e58===_0x1463fa||_0x347e58[_0xe8742f(0x131)](_0x1463fa+'/');return!![];});}export function buildSegmentLookupMap(_0x1b0ad7,_0x25c34d){const _0x38ee93=a151_0x2ed631,_0x3ca578=new Map();for(const _0xe68f06 of _0x1b0ad7){const _0x46ac6e=_0xe68f06[_0x38ee93(0x196)]?_0x25c34d[_0x38ee93(0x1ac)](_0xe68f06[_0x38ee93(0x196)][_0x38ee93(0x15f)]())||'':'',_0x5cf094=_0x46ac6e+':'+_0xe68f06['name'];_0x3ca578[_0x38ee93(0x1c7)](_0x5cf094,_0xe68f06);}return _0x3ca578;}export function buildSegmentNameToIdMap(_0x161e52){const _0x3873a0=a151_0x2ed631,_0x1d337d=new Map();for(const _0x45412b of _0x161e52){_0x1d337d[_0x3873a0(0x1c7)](_0x45412b[_0x3873a0(0x17c)],_0x45412b['id']);}return _0x1d337d;}export function buildJourneyBundleLookupMap(_0x1ffaba,_0x269870){const _0x581508=a151_0x2ed631,_0x3d46ae=new Map();for(const _0x52ef3d of _0x1ffaba){const _0x475d03=_0x52ef3d['folderId']?_0x269870[_0x581508(0x1ac)](_0x52ef3d['folderId'])||'':'',_0xef90a6=_0x475d03+':'+_0x52ef3d[_0x581508(0x1f5)];!_0x3d46ae[_0x581508(0x1b5)](_0xef90a6)&&_0x3d46ae[_0x581508(0x1c7)](_0xef90a6,[]),_0x3d46ae[_0x581508(0x1ac)](_0xef90a6)[_0x581508(0x1d3)](_0x52ef3d);}for(const _0x26e9ce of _0x3d46ae[_0x581508(0x20c)]()){_0x26e9ce[_0x581508(0x158)]((_0x54a9dc,_0x5cfd3d)=>(_0x54a9dc[_0x581508(0x20b)]||0x0)-(_0x5cfd3d[_0x581508(0x20b)]||0x0));}return _0x3d46ae;}export function collectFoldersToCreate(_0x24ae42,_0x539892){const _0x125d72=a151_0x2ed631,_0x4ec3dd=new Set();for(const _0x5b3e58 of _0x24ae42){if(!_0x5b3e58)continue;if(_0x539892['has'](_0x5b3e58))continue;const _0x4ee328=_0x5b3e58[_0x125d72(0x13c)]('/');let _0x290726='';for(const _0x5cd5ed of _0x4ee328){_0x290726=_0x290726?_0x290726+'/'+_0x5cd5ed:_0x5cd5ed,!_0x539892[_0x125d72(0x1b5)](_0x290726)&&_0x4ec3dd[_0x125d72(0x1d0)](_0x290726);}}return _0x4ec3dd;}export function parseAndClassifyYamlFiles(_0x427b1e,_0x127057,_0xe41897){const _0x4dffca=a151_0x2ed631,_0x5845de=[],_0x8312e3=[];for(const _0x52efb1 of _0x427b1e){const _0x1de631=a151_0x574767['relative'](_0x127057,a151_0x574767[_0x4dffca(0x148)](_0x52efb1)),_0x5792bb=_0x1de631==='.'?'':_0x1de631,_0x2113ab=readFileSync(_0x52efb1,_0x4dffca(0x11f)),_0x2a6b69=a151_0x297b00[_0x4dffca(0x211)](_0x2113ab);if(isJourneyDef(_0x2a6b69)){const _0x36bf0b=a151_0x113781(_0x2113ab);_0x8312e3[_0x4dffca(0x1d3)]({'yamlConfig':_0x36bf0b,'folderPath':_0x5792bb,'sourcePath':_0x52efb1});}else{if(!_0xe41897?.[_0x4dffca(0x202)]){const _0x29e4d5=parseSegmentYamlFile(_0x2113ab),_0x2d5a2e=normalizeChildSegmentYaml(_0x29e4d5);_0x5845de['push']({'yamlConfig':_0x2d5a2e,'folderPath':_0x5792bb,'sourcePath':_0x52efb1});}}}return{'segments':_0x5845de,'journeys':_0x8312e3};}export function validateParsedFiles(_0x7b7d3b,_0x18e957){const _0x45a981=a151_0x2ed631,_0x389ca8=[];for(const {yamlConfig:_0x258af3,sourcePath:_0xf6eb66}of _0x7b7d3b[_0x45a981(0x18a)]){const _0x5eb3dd=readFileSync(_0xf6eb66,_0x45a981(0x11f)),_0xe1a7f7=a151_0x297b00[_0x45a981(0x1da)](_0x5eb3dd),_0x183d9a=validateSegmentDef(_0x258af3,{'source':_0x5eb3dd,'document':_0xe1a7f7},{'skipSchema':!![]});if(!_0x183d9a['valid']){const _0x19ca19=a151_0x574767[_0x45a981(0x1a8)](_0x18e957,_0xf6eb66);_0x389ca8[_0x45a981(0x1d3)]({'filePath':_0x19ca19,'source':_0x5eb3dd,'result':_0x183d9a,'isJourney':![]});}}for(const {yamlConfig:_0x40ace5,sourcePath:_0x3239e2}of _0x7b7d3b[_0x45a981(0x13d)]){const _0x573ffe=readFileSync(_0x3239e2,'utf-8'),_0x467229=a151_0x297b00[_0x45a981(0x1da)](_0x573ffe),_0x36ee0a=validateJourneyDef(_0x40ace5,{'source':_0x573ffe,'document':_0x467229},{'skipSchema':!![]});if(!_0x36ee0a[_0x45a981(0x124)]){const _0x57aa66=a151_0x574767[_0x45a981(0x1a8)](_0x18e957,_0x3239e2);_0x389ca8[_0x45a981(0x1d3)]({'filePath':_0x57aa66,'source':_0x573ffe,'result':_0x36ee0a,'isJourney':!![]});}}return _0x389ca8;}export function formatValidationErrors(_0x566e1d){const _0x40a403=a151_0x2ed631,_0x5aaad4=[];for(const {filePath:_0x1c3446,source:_0x47e6ad,result:_0x2866b0,isJourney:_0x356113}of _0x566e1d){const _0x2de036=_0x356113?'journey':_0x40a403(0x1b9);_0x5aaad4[_0x40a403(0x1d3)]('\x0a'+_0x1c3446+'\x20('+_0x2de036+'):\x20'+_0x2866b0[_0x40a403(0x141)][_0x40a403(0x165)]+_0x40a403(0x1e8)),_0x5aaad4['push'](formatValidationResult(_0x2866b0,_0x47e6ad,_0x1c3446));}return _0x5aaad4[_0x40a403(0x1fe)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x12416d){const _0xf889bf=a151_0x2ed631,_0x1d20ba=new Set(),_0x3f790e=new Map(),_0x16358e=collectSegmentUsageCounts(_0x12416d);if(_0x12416d[_0xf889bf(0x18a)])for(const [_0x14c876,_0x56be3d]of Object[_0xf889bf(0x1af)](_0x12416d['segments'])){_0x1d20ba[_0xf889bf(0x1d0)](_0x14c876);if(_0x56be3d['rule']){const _0x382f67=yamlRuleToApi(_0x56be3d[_0xf889bf(0x198)]),_0x473c9e=apiRuleToYaml(_0x382f67);_0x3f790e['set'](_0x14c876,_0x473c9e);}}const _0x3adf48=new Map();let _0x1a9fe9=0x0;for(const [_0x4d1f71,_0x19d353]of _0x3f790e){const _0xd76c31=serializeExpandedRule(_0x19d353,_0x3f790e),_0xf2e8a5=_0x3adf48[_0xf889bf(0x1ac)](_0xd76c31)||[];_0xf2e8a5[_0xf889bf(0x1d3)]({'name':_0x4d1f71,'index':_0x1a9fe9}),_0x3adf48['set'](_0xd76c31,_0xf2e8a5),_0x1a9fe9++;}const _0x4262dd=new Map();for(const [_0x2f5617,_0xd66136]of _0x3adf48){const _0x48891e=_0xd66136['slice']()['sort']((_0x5373b8,_0x316075)=>{const _0x5a9d4a=_0xf889bf,_0x227ab6=_0x16358e[_0x5a9d4a(0x1ac)](_0x5373b8[_0x5a9d4a(0x17c)])||0x0,_0x48ab8f=_0x16358e[_0x5a9d4a(0x1ac)](_0x316075[_0x5a9d4a(0x17c)])||0x0;if(_0x227ab6!==_0x48ab8f)return _0x48ab8f-_0x227ab6;return _0x5373b8[_0x5a9d4a(0x1ab)]-_0x316075['index'];})['map'](_0x5a4bb0=>_0x5a4bb0['name']),_0xa62346=[];for(const _0x4370e8 of _0x48891e){const _0x166541=_0x16358e['get'](_0x4370e8)||0x0,_0x773030=Math['max'](_0x166541,0x1);for(let _0x39147d=0x0;_0x39147d<_0x773030;_0x39147d++){_0xa62346['push'](_0x4370e8);}}_0x4262dd['set'](_0x2f5617,_0xa62346);}return{'existingLocalSegmentNames':_0x1d20ba,'localSegmentRules':_0x3f790e,'localExpandedRuleToNames':_0x4262dd};}export function createSegmentIdResolver(_0x33ec95,_0x10abf0){return async _0x40cb58=>{const _0x262b1a=a151_0x5571,_0x4904b4=_0x33ec95[_0x262b1a(0x1ac)](_0x40cb58);if(!_0x4904b4)throw new SDKError(ErrorCode[_0x262b1a(0x11b)],_0x262b1a(0x1b0)+_0x40cb58+_0x262b1a(0x18f)+_0x10abf0+'\x27)');return _0x4904b4;};}export function extractRootFolderId(_0x476ae3){const _0x3ed872=a151_0x2ed631;return _0x476ae3[_0x3ed872(0x122)]?.['parentSegmentFolder']?.[_0x3ed872(0x125)]?.['id']||_0x476ae3['relationships']?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x21afdb){const _0x2cd698=a151_0x2ed631,_0x4217a9=new Map(),_0x19e6e3=new Map(),_0x21d40f=new Map();for(const _0x32074c of _0x21afdb){_0x4217a9['set'](_0x32074c['name'],parseInt(_0x32074c['id'],0xa)),_0x19e6e3[_0x2cd698(0x1c7)](_0x32074c['id'],_0x32074c['name']),_0x21d40f['set'](_0x32074c[_0x2cd698(0x17c)],_0x32074c[_0x2cd698(0x138)]);}return{'nameToId':_0x4217a9,'idToName':_0x19e6e3,'nameToType':_0x21d40f};}export function calculatePushStats(_0x45e112,_0x2df80b,_0x2b6208,_0x4154cf,_0x1023c5,_0x45ca86,_0xfd19de){const _0x313153=a151_0x2ed631,_0x246ec0=_0x45e112[_0x313153(0x1fd)](_0x36dcf0=>_0x36dcf0[_0x313153(0x1d8)]),_0x1d8728=_0x45e112[_0x313153(0x1fd)](_0x3f6fc3=>!_0x3f6fc3[_0x313153(0x1d8)]&&_0x3f6fc3[_0x313153(0x1c8)]),_0x4c9029=_0x45e112['filter'](_0x1fd1db=>!_0x1fd1db['isNew']&&!_0x1fd1db['hasChanges']),_0x2edc6b=_0x45ca86?_0x4154cf:[],_0x43dceb=_0x2df80b[_0x313153(0x1fd)](_0x387d6a=>_0x387d6a[_0x313153(0x1d8)]),_0x1aefe6=_0x2df80b[_0x313153(0x1fd)](_0x171c04=>!_0x171c04['isNew']&&_0x171c04[_0x313153(0x1c8)]),_0x2fef08=_0x2df80b[_0x313153(0x1fd)](_0x3728b4=>!_0x3728b4[_0x313153(0x1d8)]&&!_0x3728b4[_0x313153(0x1c8)]),_0x5da51d=_0x45ca86?_0x1023c5:[],_0x102e06=_0x45e112[_0x313153(0x145)](_0x4a2015=>_0x4a2015['activationActions']),_0x4e0ae7=_0x102e06[_0x313153(0x1fd)](_0x3faae4=>_0x3faae4[_0x313153(0x138)]==='create'),_0x4c73db=_0x102e06[_0x313153(0x1fd)](_0x19b308=>_0x19b308['type']==='update'),_0x512d18=_0x102e06['filter'](_0x1347c1=>_0x1347c1[_0x313153(0x138)]===_0x313153(0x1dc)),_0x17af76=Array[_0x313153(0x214)](_0x2b6208)['sort'](),_0x3ace40=_0xfd19de?![]:_0x246ec0[_0x313153(0x165)]>0x0||_0x1d8728['length']>0x0||_0x2edc6b[_0x313153(0x165)]>0x0,_0x5826ae=_0x43dceb[_0x313153(0x165)]>0x0||_0x1aefe6[_0x313153(0x165)]>0x0||_0x5da51d[_0x313153(0x165)]>0x0,_0x3e72da=_0xfd19de?![]:_0x102e06[_0x313153(0x165)]>0x0,_0x18284d=_0x17af76[_0x313153(0x165)]>0x0;return{'segments':{'new':_0x246ec0,'changed':_0x1d8728,'unchanged':_0x4c9029,'toDelete':_0x2edc6b},'journeys':{'new':_0x43dceb,'changed':_0x1aefe6,'unchanged':_0x2fef08,'toDelete':_0x5da51d},'activations':{'all':_0x102e06,'toCreate':_0x4e0ae7,'toUpdate':_0x4c73db,'toDelete':_0x512d18},'folders':{'toCreate':_0x17af76},'counts':{'segments':{'new':_0x246ec0[_0x313153(0x165)],'changed':_0x1d8728[_0x313153(0x165)],'unchanged':_0x4c9029[_0x313153(0x165)],'toDelete':_0x2edc6b[_0x313153(0x165)]},'journeys':{'new':_0x43dceb[_0x313153(0x165)],'changed':_0x1aefe6['length'],'unchanged':_0x2fef08[_0x313153(0x165)],'toDelete':_0x5da51d['length']},'activations':{'create':_0x4e0ae7[_0x313153(0x165)],'update':_0x4c73db[_0x313153(0x165)],'delete':_0x512d18[_0x313153(0x165)]},'folders':_0x17af76['length']},'hasChanges':_0x3ace40||_0x5826ae||_0x3e72da||_0x18284d};}export async function buildPushExecutionContext(_0xf7cf59,_0x40b8ac,_0x3ef58d,_0x2b9457,_0x50f31b,_0x4a863d){const _0x1b01c4=a151_0x2ed631,_0x7a7e75=extractRootFolderId(_0x3ef58d),{pathToId:_0x232120,idToPath:_0x3d4062}=buildFolderMaps(_0x50f31b),_0x4d4929=buildSegmentNameToIdMap(_0x2b9457),_0x5c3bd1=new Map(),{batchAsync:_0x18b441}=await import('../../utils/async.js'),[_0x201195,_0x332130]=await Promise[_0x1b01c4(0x21a)]([_0xf7cf59[_0x1b01c4(0x1c5)][_0x1b01c4(0x1f4)](),_0xf7cf59[_0x1b01c4(0x153)][_0x1b01c4(0x19c)](),((async()=>{!_0x4a863d&&_0x2b9457['length']>0x0&&await _0x18b441(_0x2b9457,async _0x3fccd7=>{const _0x34a4ca=a151_0x5571,_0x137c68=await _0xf7cf59['segment'][_0x34a4ca(0x162)](_0x40b8ac,_0x3fccd7['id']);_0x5c3bd1[_0x34a4ca(0x1c7)](_0x3fccd7['id'],_0x137c68);});})())]),{emailToId:_0xd263d0,idToEmail:_0x3121db}=_0x201195,_0x18586f=buildConnectionMaps(_0x332130);return{'rootFolderId':_0x7a7e75,'folderPathToId':_0x232120,'folderIdToPath':_0x3d4062,'segmentNameToId':_0x4d4929,'activationsBySegmentId':_0x5c3bd1,'emailToIdMap':_0xd263d0,'idToEmailMap':_0x3121db,'connectionNameToIdMap':_0x18586f['nameToId'],'connectionIdToNameMap':_0x18586f[_0x1b01c4(0x1cb)],'connectionNameToTypeMap':_0x18586f[_0x1b01c4(0x1c0)]};}export function createPushYamlContextForBundle(_0x1022d2,_0x794a7c,_0x2d26c2,_0x38d14f,_0x143c4d,_0x1d87d9,_0x2bf539,_0x2c47e5){const {existingLocalSegmentNames:_0x19f1a2,localExpandedRuleToNames:_0x4fe20a}=_0x38d14f,_0x3855ce=new Set(),_0x32a436=new Map(),_0x5eb49a=new Map(),_0x438468=new Map(),_0x1adc80=createJumpTargetCache(),_0x1ddbfb=new Map(),_0x22e1de=new Map(),_0xa15816=new Set();let _0x5f09d2;const _0x15e0df=_0x2be064=>{const _0x1ec486={'resolveSegment':async _0x1741c8=>{const _0x486226=a151_0x5571,_0x1bb184=_0x438468[_0x486226(0x1ac)](_0x1741c8);if(_0x1bb184!==undefined)return{'name':_0x1bb184,'isJourneyLocal':!![]};try{const _0x5a4ebf=await fetchSegment(_0x1022d2,_0x794a7c,_0x1741c8,_0x2d26c2);if(!_0x5a4ebf)throw new Error(_0x486226(0x159));const _0xf898ae=generateJourneyLocalName(_0x5a4ebf[_0x486226(0x17c)]),_0xf3a1e8=_0x5a4ebf[_0x486226(0x18b)]===SEGMENT_KIND_JOURNEY&&_0xf898ae!==undefined;let _0x4cd8fa=_0x5a4ebf[_0x486226(0x17c)],_0x3e6524;if(_0xf3a1e8&&_0x5a4ebf[_0x486226(0x198)]){const _0x280e91=apiRuleToYaml(_0x5a4ebf[_0x486226(0x198)]);_0x22e1de['set'](_0x1741c8,_0x280e91);const _0x45d433=async _0x279203=>{const _0x768a05=_0x486226,_0x414f4c=collectSegmentRefsFromRule(_0x279203);for(const _0x4e363d of _0x414f4c){if(!_0x22e1de['has'](_0x4e363d))try{const _0x3beb47=await fetchSegment(_0x1022d2,_0x794a7c,_0x4e363d,_0x2d26c2);if(_0x3beb47?.[_0x768a05(0x198)]){const _0x3863a0=apiRuleToYaml(_0x3beb47[_0x768a05(0x198)]);_0x22e1de['set'](_0x4e363d,_0x3863a0),await _0x45d433(_0x3863a0);}}catch(_0x27e75b){logger[_0x768a05(0x12c)](_0x768a05(0x16a)+_0x4e363d+':\x20'+_0x27e75b);}}};await _0x45d433(_0x280e91);const _0x46f4a2=serializeExpandedRule(_0x280e91,_0x22e1de),_0xc090e8=_0x4fe20a['get'](_0x46f4a2);if(_0xc090e8&&_0xc090e8[_0x486226(0x165)]>0x0){const _0x538d8c=_0x32a436['get'](_0x46f4a2)||0x0,_0x2fd593=_0xc090e8[_0x538d8c]||_0xc090e8[_0xc090e8['length']-0x1];_0x32a436['set'](_0x46f4a2,_0x538d8c+0x1),_0x4cd8fa=_0x2fd593,_0x3855ce[_0x486226(0x1d0)](_0x4cd8fa),_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa);const _0x4129ac=await resolveRuleSegmentRefs(_0x280e91,async _0x399d7f=>{const _0x55fa53=_0x486226,_0x40df80=_0x438468[_0x55fa53(0x1ac)](_0x399d7f);if(_0x40df80)return _0x40df80;const _0x18f31c=await _0x5f09d2[_0x55fa53(0x120)](_0x399d7f);return _0x18f31c[_0x55fa53(0x17c)];});_0x3e6524={'description':_0x5a4ebf[_0x486226(0x1cd)],'rule':_0x4129ac};}else{const _0x3d4687=_0x1ddbfb[_0x486226(0x1ac)](_0x46f4a2);if(_0x3d4687)_0x4cd8fa=_0x3d4687,_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa);else{if(_0xf898ae){let _0x52c363=_0xf898ae,_0x2ade41=0x2;while(_0x3855ce[_0x486226(0x1b5)](_0x52c363)||_0x19f1a2[_0x486226(0x1b5)](_0x52c363)){_0x52c363=_0xf898ae+'_'+_0x2ade41,_0x2ade41++;}_0x3855ce[_0x486226(0x1d0)](_0x52c363),_0x4cd8fa=_0x52c363;}_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa),_0x1ddbfb[_0x486226(0x1c7)](_0x46f4a2,_0x4cd8fa);const _0x53adde=await resolveRuleSegmentRefs(_0x280e91,async _0x276742=>{const _0x255669=_0x486226,_0x2323de=_0x438468[_0x255669(0x1ac)](_0x276742);if(_0x2323de)return _0x2323de;const _0x5e108a=await _0x5f09d2[_0x255669(0x120)](_0x276742);return _0x5e108a[_0x255669(0x17c)];});_0x3e6524={'description':_0x5a4ebf[_0x486226(0x1cd)],'rule':_0x53adde};}}}return{'name':_0x4cd8fa,'isJourneyLocal':_0xf3a1e8,'definition':_0x3e6524};}catch(_0x4e56a4){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x1741c8+':\x20'+_0x4e56a4),{'name':_0x1741c8,'isJourneyLocal':![]};}},'resolveActivation':async _0x136af2=>{const _0x2f9f30=a151_0x5571,_0x347859=_0x5eb49a['get'](_0x136af2);if(_0x347859!==undefined)return{'name':_0x347859,'isJourneyLocal':!![]};try{let _0x9ab250=_0x2bf539?.[_0x2f9f30(0x1ac)](_0x136af2);!_0x9ab250&&(_0x9ab250=await _0x1022d2[_0x2f9f30(0x1b8)][_0x2f9f30(0x1ed)](_0x2be064,_0x136af2));const _0x5cd42c=_0x9ab250['attributes'][_0x2f9f30(0x1ef)][_0x2f9f30(0x17c)]||_0x136af2,_0x63ea06=sanitizeYamlKey(_0x5cd42c)||'activation_'+_0x136af2,_0x3f9dcf=_0x63ea06;_0x5eb49a['set'](_0x136af2,_0x3f9dcf);const _0x11e345=journeyActivationStepToYaml(_0x9ab250,_0x143c4d,_0x1d87d9);return{'name':_0x3f9dcf,'isJourneyLocal':!![],'definition':_0x11e345};}catch(_0x5b0ff7){return logger[_0x2f9f30(0x12c)](_0x2f9f30(0x1dd)+_0x136af2+':\x20'+_0x5b0ff7),{'name':_0x136af2,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x427047,_0x4f981a)=>resolveJumpTarget(_0x427047,_0x4f981a,_0x1adc80,async _0x745737=>{const _0x9c739d=a151_0x5571,_0x4bf129=_0x2c47e5?.[_0x9c739d(0x1ac)](_0x745737);if(_0x4bf129)return _0x4bf129;return _0x1022d2[_0x9c739d(0x1b8)]['getJourney'](_0x745737);})};return _0x5f09d2=_0x1ec486,_0x1ec486;},_0x36e05b=async _0xcd9fdf=>{const _0x23c55d=a151_0x5571,{collectSegmentIdsFromJourneyApi:_0xe59013}=await import(_0x23c55d(0x19f)),{batchAsync:_0x171271}=await import(_0x23c55d(0x209)),_0x31ec36=new Set();for(const _0x2595cc of _0xcd9fdf){let _0x10f0b7=_0x2c47e5?.[_0x23c55d(0x1ac)](_0x2595cc);!_0x10f0b7&&(_0x10f0b7=await _0x1022d2[_0x23c55d(0x1b8)]['getJourney'](_0x2595cc));const _0x4272ad=_0xe59013(_0x10f0b7);for(const _0x1fdb41 of _0x4272ad){_0x31ec36[_0x23c55d(0x1d0)](_0x1fdb41);}}let _0x39b309=Array[_0x23c55d(0x214)](_0x31ec36);while(_0x39b309['length']>0x0){const _0x13e1c0=_0x39b309[_0x23c55d(0x1fd)](_0x3a959b=>!_0xa15816['has'](_0x3a959b));if(_0x13e1c0[_0x23c55d(0x165)]===0x0)break;const _0x4c12ef=await _0x171271(_0x13e1c0,async _0x18514b=>{_0xa15816['add'](_0x18514b);const _0x3da569=await fetchSegment(_0x1022d2,_0x794a7c,_0x18514b,_0x2d26c2);if(!_0x3da569)return null;return{'segmentId':_0x18514b,'segment':_0x3da569};},0xa),_0x5850d9=new Set();for(const _0x4a40d8 of _0x4c12ef){if(!_0x4a40d8?.[_0x23c55d(0x1b9)]?.['rule'])continue;const _0x2a7d4d=apiRuleToYaml(_0x4a40d8[_0x23c55d(0x1b9)]['rule']);_0x22e1de['set'](_0x4a40d8[_0x23c55d(0x203)],_0x2a7d4d);const _0x2ea7cf=collectSegmentRefsFromRule(_0x2a7d4d);for(const _0x122e16 of _0x2ea7cf){!_0xa15816[_0x23c55d(0x1b5)](_0x122e16)&&_0x5850d9[_0x23c55d(0x1d0)](_0x122e16);}}_0x39b309=Array[_0x23c55d(0x214)](_0x5850d9);}};return{'createYamlContext':_0x15e0df,'prefetchJourneySegments':_0x36e05b};}function a151_0x5571(_0x435bae,_0x3498b3){_0x435bae=_0x435bae-0x119;const _0x57e949=a151_0x57e9();let _0x5571b1=_0x57e949[_0x435bae];return _0x5571b1;}export async function executePushSegments(_0x46a32f,_0x554e08,_0x433c67,_0x5d62f9,_0xc5a0a9){const _0x3b7195=a151_0x2ed631,{segmentDefToCreateRequest:_0x5e105d,segmentDefToUpdateRequest:_0x3b096e}=await import('./child-segment-yaml.js'),_0x4c868d=_0x433c67[_0x3b7195(0x127)],_0x14e563=0x5,_0x5cb856=async _0x14383c=>{const _0x57b048=_0x3b7195,_0x1b21b1=_0x14383c['folderPath']?_0x4c868d[_0x57b048(0x1ac)](_0x14383c[_0x57b048(0x13b)]):undefined;let _0x4a0d86;const _0x158b92={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x34dc21=_0x14383c[_0x57b048(0x136)];if(_0x14383c[_0x57b048(0x136)][_0x57b048(0x198)]){const _0x2ad9ac=createSegmentIdResolver(_0x433c67[_0x57b048(0x193)],_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]),_0x30a875=await resolveRuleSegmentIds(_0x14383c[_0x57b048(0x136)]['rule'],_0x2ad9ac);_0x34dc21={..._0x14383c[_0x57b048(0x136)],'rule':_0x30a875};}try{if(_0x14383c[_0x57b048(0x1d8)]){_0xc5a0a9[_0x57b048(0x183)]?.({'type':_0x57b048(0x184),'name':_0x14383c['yamlConfig'][_0x57b048(0x17c)]});const _0x52a033=_0x5e105d(_0x34dc21,_0x1b21b1),_0x3904d6=await _0xc5a0a9[_0x57b048(0x135)]('Creating\x20segment\x20\x27'+_0x14383c['yamlConfig'][_0x57b048(0x17c)]+_0x57b048(0x140),()=>_0x46a32f['segment'][_0x57b048(0x213)](_0x5d62f9['parentId'],_0x52a033));_0x4a0d86=_0x3904d6[_0x57b048(0x125)]['id'],_0x433c67[_0x57b048(0x193)][_0x57b048(0x1c7)](_0x14383c['yamlConfig'][_0x57b048(0x17c)],_0x4a0d86),_0x158b92[_0x57b048(0x208)]={'name':_0x14383c[_0x57b048(0x136)]['name'],'id':_0x4a0d86},_0xc5a0a9[_0x57b048(0x183)]?.({'type':_0x57b048(0x201),'name':_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)],'segmentId':_0x4a0d86}),_0xc5a0a9[_0x57b048(0x16c)]?.(_0x57b048(0x143)+_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]+'\x27'),_0x158b92[_0x57b048(0x144)]=0x1;}else{if(_0x14383c[_0x57b048(0x1c8)]){_0xc5a0a9[_0x57b048(0x183)]?.({'type':'segment_updating','name':_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]});const _0x2b9176=_0x3b096e(_0x34dc21);_0x1b21b1!==_0x14383c[_0x57b048(0x1ee)]?.[_0x57b048(0x196)]&&(_0x2b9176[_0x57b048(0x196)]=_0x1b21b1?parseInt(_0x1b21b1,0xa):undefined),await _0xc5a0a9[_0x57b048(0x135)](_0x57b048(0x17a)+_0x14383c[_0x57b048(0x136)]['name']+_0x57b048(0x140),()=>_0x46a32f['segment']['updateSegmentById'](_0x5d62f9[_0x57b048(0x164)],_0x14383c['existingSegment']['id'],_0x2b9176)),_0x4a0d86=_0x14383c[_0x57b048(0x1ee)]['id'],_0xc5a0a9['onProgress']?.({'type':'segment_updated','name':_0x14383c['yamlConfig'][_0x57b048(0x17c)]}),_0xc5a0a9['logSuccess']?.(_0x57b048(0x200)+_0x14383c[_0x57b048(0x136)]['name']+'\x27'),_0x158b92['updated']=0x1;}else _0x4a0d86=_0x14383c[_0x57b048(0x1ee)]['id'];}}catch(_0xdfcc0d){const _0x2670cc=isHttp400Error(_0xdfcc0d),_0x4ddfb0=_0x2670cc?ErrorCode[_0x57b048(0x1b6)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5ba558=getErrorMessage(_0xdfcc0d);throw new SDKError(_0x4ddfb0,_0x57b048(0x18c)+(_0x14383c[_0x57b048(0x1d8)]?_0x57b048(0x147):_0x57b048(0x179))+_0x57b048(0x14c)+_0x14383c[_0x57b048(0x1c1)]+_0x57b048(0x146)+_0x5ba558,_0xdfcc0d);}try{const _0x10ba1f=await syncActivationsForSegment(_0x46a32f,_0x5d62f9[_0x57b048(0x164)],_0x4a0d86,_0x14383c['yamlConfig'][_0x57b048(0x17c)],_0x14383c[_0x57b048(0x1f1)],_0xc5a0a9,_0x14383c[_0x57b048(0x1c1)]);_0x158b92[_0x57b048(0x1a2)]=_0x10ba1f;}catch(_0x5431f6){if(_0x5431f6 instanceof SDKError)throw _0x5431f6;throw new SDKError(ErrorCode[_0x57b048(0x12b)],_0x57b048(0x1a9)+_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]+_0x57b048(0x14f)+_0x14383c[_0x57b048(0x1c1)]+_0x57b048(0x146)+getErrorMessage(_0x5431f6),_0x5431f6);}return _0x158b92;},_0x50375f=await batchAsync(_0x554e08,_0x5cb856,_0x14e563),_0x96d0f6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xa0c286 of _0x50375f){_0x96d0f6['created']+=_0xa0c286['created'],_0x96d0f6['updated']+=_0xa0c286[_0x3b7195(0x1df)],_0xa0c286[_0x3b7195(0x208)]&&_0x96d0f6[_0x3b7195(0x168)]['set'](_0xa0c286[_0x3b7195(0x208)][_0x3b7195(0x17c)],_0xa0c286['createdSegmentId']['id']),_0x96d0f6[_0x3b7195(0x1a2)][_0x3b7195(0x144)]+=_0xa0c286[_0x3b7195(0x1a2)]['created'],_0x96d0f6[_0x3b7195(0x1a2)][_0x3b7195(0x1df)]+=_0xa0c286[_0x3b7195(0x1a2)]['updated'],_0x96d0f6['activations'][_0x3b7195(0x1d7)]+=_0xa0c286[_0x3b7195(0x1a2)][_0x3b7195(0x1d7)];}return _0x96d0f6;}async function syncActivationsForSegment(_0xd23319,_0x4b395c,_0x429ae0,_0x5849b3,_0x3ac4bb,_0x58f05f,_0x3abea6){const _0x1a03b1=a151_0x2ed631,_0x269f52={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x56bc91 of _0x3ac4bb){try{if(_0x56bc91[_0x1a03b1(0x138)]===_0x1a03b1(0x147)&&_0x56bc91[_0x1a03b1(0x20e)])_0x58f05f[_0x1a03b1(0x183)]?.({'type':'activation_creating','segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f['withProgress'](_0x1a03b1(0x210)+_0x56bc91['name']+'\x27...',()=>_0xd23319[_0x1a03b1(0x1b9)][_0x1a03b1(0x1b7)](_0x4b395c,_0x429ae0,_0x56bc91[_0x1a03b1(0x20e)])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':'activation_created','segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),_0x58f05f[_0x1a03b1(0x16c)]?.('Created\x20activation\x20\x27'+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x144)]++;else{if(_0x56bc91[_0x1a03b1(0x138)]===_0x1a03b1(0x179)&&_0x56bc91[_0x1a03b1(0x20e)]&&_0x56bc91[_0x1a03b1(0x1bd)])_0x58f05f['onProgress']?.({'type':_0x1a03b1(0x1cf),'segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f[_0x1a03b1(0x135)]('Updating\x20activation\x20\x27'+_0x56bc91['name']+_0x1a03b1(0x140),()=>_0xd23319['segment'][_0x1a03b1(0x176)](_0x4b395c,_0x429ae0,_0x56bc91['existingActivation']['id'],_0x56bc91['validatedRequest'])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':_0x1a03b1(0x157),'segmentName':_0x5849b3,'activationName':_0x56bc91['name']}),_0x58f05f['logSuccess']?.(_0x1a03b1(0x1c3)+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x1df)]++;else _0x56bc91['type']===_0x1a03b1(0x1dc)&&_0x56bc91['existingActivation']&&(_0x58f05f['onProgress']?.({'type':_0x1a03b1(0x1be),'segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f[_0x1a03b1(0x135)](_0x1a03b1(0x1ad)+_0x56bc91['name']+_0x1a03b1(0x140),()=>_0xd23319[_0x1a03b1(0x1b9)][_0x1a03b1(0x1b3)](_0x4b395c,_0x429ae0,_0x56bc91[_0x1a03b1(0x1bd)]['id'])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':_0x1a03b1(0x17b),'segmentName':_0x5849b3,'activationName':_0x56bc91['name']}),_0x58f05f[_0x1a03b1(0x171)]?.(_0x1a03b1(0x149)+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x1d7)]++);}}catch(_0x18b926){const _0x8cad0c=isHttp400Error(_0x18b926),_0xecf1=_0x8cad0c?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x1a03b1(0x12b)],_0x1f2802=getErrorMessage(_0x18b926);throw new SDKError(_0xecf1,'Failed\x20to\x20'+_0x56bc91[_0x1a03b1(0x138)]+'\x20activation\x20\x27'+_0x56bc91[_0x1a03b1(0x17c)]+'\x27\x20from\x20file:\x20'+_0x3abea6+_0x1a03b1(0x146)+_0x1f2802,_0x18b926);}}return _0x269f52;}export async function executePushFolders(_0x6d3318,_0x4158af,_0x30ce96,_0x30d60c,_0x107224){const _0x2500d3=a151_0x2ed631,_0x28247d=new Map(_0x30ce96),_0x2602ab=sortFoldersByDepth(_0x4158af);for(const _0x38773b of _0x2602ab){const _0x5ca5d1=_0x38773b['split']('/'),_0x1a07c2=_0x5ca5d1[_0x5ca5d1['length']-0x1],_0x1fa6ab=_0x5ca5d1[_0x2500d3(0x205)](0x0,-0x1)['join']('/'),_0x19c3ac=_0x28247d[_0x2500d3(0x1ac)](_0x1fa6ab);_0x107224['onProgress']?.({'type':'folder_creating','folder':_0x38773b});const _0x4c9446={'name':_0x1a07c2,'parentFolderId':_0x19c3ac},_0x4c0b96=await _0x107224[_0x2500d3(0x135)]('Creating\x20folder\x20\x27'+_0x38773b+'\x27...',()=>_0x6d3318[_0x2500d3(0x1b9)][_0x2500d3(0x132)](_0x30d60c[_0x2500d3(0x164)],_0x4c9446));_0x28247d[_0x2500d3(0x1c7)](_0x38773b,_0x4c0b96[_0x2500d3(0x125)]['id']),_0x107224['onProgress']?.({'type':'folder_created','folder':_0x38773b,'folderId':_0x4c0b96[_0x2500d3(0x125)]['id']}),_0x107224[_0x2500d3(0x121)]?.(_0x2500d3(0x182)+_0x38773b+'\x27');}return _0x28247d;}export async function executePushSegmentDeletions(_0x5c4533,_0x2ff78a,_0x103b47){const _0x2ddb29=a151_0x2ed631;if(_0x2ff78a['length']===0x0)return 0x0;const {batchAsync:_0x403150}=await import(_0x2ddb29(0x209)),_0x33e37c=0x5,_0x5b239d=await _0x403150(_0x2ff78a,async _0x2909f8=>{const _0x560f9e=_0x2ddb29;return _0x103b47[_0x560f9e(0x183)]?.({'type':_0x560f9e(0x1de),'name':_0x2909f8[_0x560f9e(0x17c)]}),await _0x5c4533[_0x560f9e(0x1b9)][_0x560f9e(0x1b2)](_0x2909f8['id']),_0x103b47[_0x560f9e(0x183)]?.({'type':_0x560f9e(0x133),'name':_0x2909f8[_0x560f9e(0x17c)]}),_0x103b47['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x2909f8[_0x560f9e(0x17c)]+'\x27'),0x1;},_0x33e37c);return _0x5b239d['reduce']((_0x9add38,_0x23ecdd)=>_0x9add38+_0x23ecdd,0x0);}export async function executePushJourneys(_0xe47cfc,_0x490f00,_0x2975dd,_0x26c1a3,_0x5864f9){const _0x23f154=a151_0x2ed631,{journeyDefToRequest:_0xce5484}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x334f44,yamlRuleToApi:_0x1ed9ed,validateSegmentRule:_0x5ca3b9}=await import(_0x23f154(0x206)),_0x298e4e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x31ae97=new Map(_0x2975dd[_0x23f154(0x193)]),_0x1dd85=0x5;for(let _0x1e5dfc=0x0;_0x1e5dfc<_0x490f00['length'];_0x1e5dfc+=_0x1dd85){const _0x5efbd2=_0x490f00[_0x23f154(0x205)](_0x1e5dfc,_0x1e5dfc+_0x1dd85),_0x43eb5e=await Promise[_0x23f154(0x21a)](_0x5efbd2['map'](async _0x129da4=>{const _0x4ad4dc=_0x23f154;if(!_0x129da4[_0x4ad4dc(0x1d8)]&&!_0x129da4['hasChanges'])return{'action':_0x4ad4dc(0x180),'name':_0x129da4[_0x4ad4dc(0x136)][_0x4ad4dc(0x17c)],'journeyId':_0x129da4[_0x4ad4dc(0x12d)]?.['id']};const _0x5913d1=_0x129da4[_0x4ad4dc(0x13b)]?_0x2975dd[_0x4ad4dc(0x127)][_0x4ad4dc(0x1ac)](_0x129da4[_0x4ad4dc(0x13b)]):undefined;_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x129da4[_0x4ad4dc(0x1d8)]?_0x4ad4dc(0x1fc):_0x4ad4dc(0x167),'name':_0x129da4[_0x4ad4dc(0x136)][_0x4ad4dc(0x17c)]});try{const _0x53546e=await executeSingleJourneyPush(_0xe47cfc,_0x129da4,{..._0x2975dd,'segmentNameToId':_0x31ae97},{'parentId':_0x26c1a3[_0x4ad4dc(0x164)],'rootFolderId':_0x26c1a3[_0x4ad4dc(0x1d9)],'folderId':_0x5913d1,'verbose':_0x26c1a3['verbose']},_0x5864f9,{'journeyDefToRequest':_0xce5484,'activationDefToCreateRequest':_0x334f44,'yamlRuleToApi':_0x1ed9ed,'validateSegmentRule':_0x5ca3b9});for(const [_0x20592f,_0x217ee5]of _0x53546e[_0x4ad4dc(0x1f7)]){_0x31ae97[_0x4ad4dc(0x1c7)](_0x20592f,_0x217ee5),_0x298e4e['embeddedSegmentNameToId'][_0x4ad4dc(0x1c7)](_0x20592f,_0x217ee5);}if(_0x53546e[_0x4ad4dc(0x192)]==='created')_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x4ad4dc(0x217),'name':_0x129da4['yamlConfig'][_0x4ad4dc(0x17c)],'journeyId':_0x53546e[_0x4ad4dc(0x207)]}),_0x5864f9['logSuccess']?.(_0x4ad4dc(0x1b4)+_0x129da4['yamlConfig'][_0x4ad4dc(0x17c)]+'\x27'),_0x298e4e[_0x4ad4dc(0x144)]++;else _0x53546e[_0x4ad4dc(0x192)]===_0x4ad4dc(0x1df)&&(_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x4ad4dc(0x1ba),'name':_0x129da4[_0x4ad4dc(0x136)]['name']}),_0x5864f9['logSuccess']?.(_0x4ad4dc(0x1e1)+_0x129da4['yamlConfig']['name']+'\x27'),_0x298e4e[_0x4ad4dc(0x1df)]++);return{'action':_0x53546e['action'],'name':_0x129da4[_0x4ad4dc(0x136)]['name'],'journeyId':_0x53546e[_0x4ad4dc(0x207)]};}catch(_0x2fa96f){const _0x571878=isHttp400Error(_0x2fa96f),_0x18c3a7=_0x571878?ErrorCode[_0x4ad4dc(0x1a7)]:ErrorCode[_0x4ad4dc(0x15d)],_0x1ffe64=getErrorMessage(_0x2fa96f);throw new SDKError(_0x18c3a7,_0x4ad4dc(0x18c)+(_0x129da4[_0x4ad4dc(0x1d8)]?_0x4ad4dc(0x147):_0x4ad4dc(0x179))+'\x20journey\x20from\x20file:\x20'+_0x129da4[_0x4ad4dc(0x1c1)]+_0x4ad4dc(0x146)+_0x1ffe64,_0x2fa96f);}}));_0x298e4e[_0x23f154(0x16b)][_0x23f154(0x1d3)](..._0x43eb5e);}return _0x298e4e;}async function matchExistingJourneySegments(_0x5f4ce5,_0x22283f,_0x2256e3,_0x3e7261,_0x2c19fa){const _0x94c663=a151_0x2ed631;if(!_0x22283f['existingJourney']||!_0x22283f[_0x94c663(0x136)][_0x94c663(0x18a)])return;const _0x5229c1=new Map(),_0x490cf4=new Set();for(const _0x70dd3 of Object[_0x94c663(0x197)](_0x22283f[_0x94c663(0x136)][_0x94c663(0x18a)])){const _0x4a3326=generateDeterministicJourneySegmentName(_0x22283f[_0x94c663(0x136)]['name'],_0x70dd3);_0x5229c1['set'](_0x4a3326,_0x70dd3),_0x490cf4[_0x94c663(0x1d0)](_0x70dd3);}const _0x4227bf=[],_0x56ef56=collectSegmentIdsFromJourneyApi(_0x22283f[_0x94c663(0x12d)]);for(const _0x20768e of _0x56ef56){const _0x3667c1=await fetchSegment(_0x5f4ce5,_0x2256e3,_0x20768e,_0x3e7261);if(!_0x3667c1?.[_0x94c663(0x17c)])continue;const _0x28b8b0=_0x5229c1[_0x94c663(0x1ac)](_0x3667c1['name']);_0x28b8b0?(_0x2c19fa[_0x94c663(0x1c7)](_0x28b8b0,_0x20768e),_0x490cf4[_0x94c663(0x1dc)](_0x28b8b0)):_0x4227bf[_0x94c663(0x1d3)]({'id':_0x20768e,'seg':_0x3667c1});}if(_0x490cf4[_0x94c663(0x1e6)]>0x0&&_0x4227bf[_0x94c663(0x165)]>0x0){const {localExpandedRuleToNames:_0x2b4287}=buildLocalExpandedRuleMappings(_0x22283f[_0x94c663(0x136)]),_0x7d4a96=new Map();for(const {id:_0x1740c4,seg:_0xdfe171}of _0x4227bf){if(_0xdfe171['rule']){const _0x4f1a41=apiRuleToYaml(_0xdfe171[_0x94c663(0x198)]);_0x7d4a96[_0x94c663(0x1c7)](_0x1740c4,_0x4f1a41);}}for(const {id:_0x4383a5,seg:_0x374102}of _0x4227bf){if(!_0x374102[_0x94c663(0x198)])continue;const _0x20d669=_0x7d4a96[_0x94c663(0x1ac)](_0x4383a5);if(!_0x20d669)continue;const _0x298117=serializeExpandedRule(_0x20d669,_0x7d4a96),_0x437786=_0x2b4287['get'](_0x298117);if(_0x437786){const _0x28b5cf=_0x437786['find'](_0x40be57=>_0x490cf4[_0x94c663(0x1b5)](_0x40be57));_0x28b5cf&&(_0x2c19fa[_0x94c663(0x1c7)](_0x28b5cf,_0x4383a5),_0x490cf4[_0x94c663(0x1dc)](_0x28b5cf),logger[_0x94c663(0x12c)]('Matched\x20server\x20segment\x20\x27'+_0x374102[_0x94c663(0x17c)]+'\x27\x20to\x20local\x20\x27'+_0x28b5cf+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x537236,_0x34d171,_0x220ff7,_0x422ca9,_0x5a8284,_0x5679b9){const _0x48c7e7=a151_0x2ed631,{journeyDefToRequest:_0x3e538f,activationDefToCreateRequest:_0x4cc8d5,yamlRuleToApi:_0x1541c0,validateSegmentRule:_0x3630a8}=_0x5679b9,_0x16ccb2=new Map(),_0x32f1c4=new Map();recoverSegmentIdsFromPushRecovery(_0x34d171,_0x16ccb2,_0x220ff7['segmentNameToId']);const _0x35b10e=new Map(),_0x4135f6=new Map(),_0x45885b=new Map();let _0x20134b;const _0x301659=async()=>{const _0x415c91=a151_0x5571;if(_0x20134b)return;_0x20134b=new Map();if(!_0x34d171[_0x415c91(0x12d)])return;const _0x1c9a5c=await _0x537236[_0x415c91(0x1b8)][_0x415c91(0x162)](_0x34d171['existingJourney']['id']);for(const _0xe531c3 of _0x1c9a5c){const _0xe8416c=journeyActivationStepToYaml(_0xe531c3,_0x220ff7[_0x415c91(0x1d4)],_0x220ff7['connectionIdToNameMap']),_0x1abc94=activationSignature(_0xe8416c);!_0x20134b['has'](_0x1abc94)&&_0x20134b[_0x415c91(0x1c7)](_0x1abc94,_0xe531c3['id']),_0xe8416c[_0x415c91(0x17c)]&&_0x32f1c4[_0x415c91(0x1c7)](_0xe8416c[_0x415c91(0x17c)],_0xe531c3['id']);}};await matchExistingJourneySegments(_0x537236,_0x34d171,_0x422ca9[_0x48c7e7(0x164)],_0x220ff7[_0x48c7e7(0x15a)],_0x220ff7['segmentNameToId']);const _0x53c8af={'resolveSegmentId':async _0x1ca163=>{const _0x4b1452=_0x48c7e7,_0x301def=_0x220ff7['segmentNameToId'][_0x4b1452(0x1ac)](_0x1ca163);if(!_0x301def)throw new SDKError(ErrorCode[_0x4b1452(0x11b)],_0x4b1452(0x1b0)+_0x1ca163+_0x4b1452(0x216)+_0x34d171['yamlConfig']['name']+')');return _0x301def;},'resolveEmbeddedSegmentId':async(_0x46d688,_0x1a3fd7)=>{const _0x228db8=_0x48c7e7,_0x495fe8=_0x220ff7[_0x228db8(0x193)]['get'](_0x46d688);if(_0x495fe8)return _0x495fe8;const _0x2cef47=_0x220ff7[_0x228db8(0x15a)]['find'](_0x23cf89=>_0x23cf89[_0x228db8(0x17c)]===_0x46d688);if(_0x2cef47)return _0x220ff7[_0x228db8(0x193)]['set'](_0x46d688,_0x2cef47['id']),_0x2cef47['id'];if(_0x34d171[_0x228db8(0x1d8)]){const {stageName:_0x4a3d0c,criteriaName:_0x5df7bd}=findSegmentCriteriaLocation(_0x34d171[_0x228db8(0x136)],_0x46d688);return _0x3630a8(_0x46d688,_0x1a3fd7[_0x228db8(0x198)]),_0x4135f6['set'](_0x46d688,{'definition':_0x1a3fd7,'stageName':_0x4a3d0c,'criteriaName':_0x5df7bd}),createPendingSegmentId(_0x46d688);}const _0x774b19=_0x34d171[_0x228db8(0x12d)]?.['id'];if(!_0x774b19)throw new SDKError(ErrorCode['INTERNAL'],_0x228db8(0x151));const _0x29bdf7=_0x35b10e['get'](_0x46d688);if(_0x29bdf7)return _0x29bdf7;const _0x472ac4=((async()=>{const _0xfc6bde=_0x228db8;_0x3630a8(_0x46d688,_0x1a3fd7[_0xfc6bde(0x198)]);const _0x5c840c=generateDeterministicJourneySegmentName(_0x34d171[_0xfc6bde(0x136)][_0xfc6bde(0x17c)],_0x46d688),_0xb3b29a=_0x220ff7[_0xfc6bde(0x15a)][_0xfc6bde(0x1bb)](_0x483453=>_0x483453[_0xfc6bde(0x17c)]===_0x5c840c),_0x2a7893=createSegmentIdResolver(_0x220ff7[_0xfc6bde(0x193)],_0x46d688),_0x426fe2=await resolveRuleSegmentIds(_0x1a3fd7[_0xfc6bde(0x198)],_0x2a7893);let _0x9adde6;return _0xb3b29a?(await _0x537236['segment'][_0xfc6bde(0x1db)](_0x422ca9[_0xfc6bde(0x164)],_0xb3b29a['id'],{'description':_0x1a3fd7[_0xfc6bde(0x1cd)]||'Entry\x20criteria:\x20'+_0x46d688,'rule':_0x1541c0(_0x426fe2),'countPopulation':!![]}),_0x9adde6=_0xb3b29a['id'],saveSegmentToPushRecovery(_0x34d171[_0xfc6bde(0x1c1)],_0x34d171[_0xfc6bde(0x136)][_0xfc6bde(0x17c)],_0x46d688,{'segmentId':_0x9adde6,'uniqueServerName':_0x5c840c,'createdAt':new Date()[_0xfc6bde(0x1a3)]()})):_0x9adde6=await createOrRecoverEmbeddedSegment(_0x537236,_0x34d171,{'localName':_0x46d688,'uniqueSegmentName':_0x5c840c,'description':_0x1a3fd7[_0xfc6bde(0x1cd)]||'Entry\x20criteria:\x20'+_0x46d688,'journeyId':_0x774b19,'resolvedRule':_0x426fe2,'parentId':_0x422ca9[_0xfc6bde(0x164)],'folderId':_0x422ca9[_0xfc6bde(0x1d9)]||''},_0x1541c0),_0x220ff7['segmentNameToId'][_0xfc6bde(0x1c7)](_0x46d688,_0x9adde6),_0x16ccb2[_0xfc6bde(0x1c7)](_0x46d688,_0x9adde6),_0x9adde6;})());_0x35b10e[_0x228db8(0x1c7)](_0x46d688,_0x472ac4);try{return await _0x472ac4;}finally{_0x35b10e[_0x228db8(0x1dc)](_0x46d688);}},'resolveActivationId':async _0x21520f=>{const _0x4831c9=_0x48c7e7,_0x5077e6=_0x32f1c4[_0x4831c9(0x1ac)](_0x21520f);if(_0x5077e6)return _0x5077e6;if(_0x34d171['existingJourney']){await _0x301659();const _0x35de51=_0x32f1c4['get'](_0x21520f);if(_0x35de51)return _0x35de51;}throw new SDKError(ErrorCode[_0x4831c9(0x128)],_0x4831c9(0x150)+_0x21520f+_0x4831c9(0x216)+_0x34d171[_0x4831c9(0x136)][_0x4831c9(0x17c)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x4cff6d,_0x19c60a)=>{const _0x5a3f86=_0x48c7e7,_0x58d8d4=_0x32f1c4['get'](_0x4cff6d);if(_0x58d8d4)return _0x58d8d4;if(_0x34d171[_0x5a3f86(0x1d8)])return _0x45885b['set'](_0x4cff6d,_0x19c60a),createPendingActivationId(_0x4cff6d);if(_0x34d171[_0x5a3f86(0x12d)]){await _0x301659();const _0x3396b2=_0x32f1c4[_0x5a3f86(0x1ac)](_0x19c60a['name']);if(_0x3396b2)return _0x32f1c4[_0x5a3f86(0x1c7)](_0x4cff6d,_0x3396b2),_0x3396b2;const _0x1ede47=activationSignature(_0x19c60a),_0x1bacd3=_0x20134b?.[_0x5a3f86(0x1ac)](_0x1ede47);if(_0x1bacd3)return _0x32f1c4[_0x5a3f86(0x1c7)](_0x4cff6d,_0x1bacd3),_0x1bacd3;const _0x2e0640=await _0x4cc8d5(_0x19c60a,_0x220ff7['activationContext']),_0x19bff3={..._0x2e0640,..._0x19c60a[_0x5a3f86(0x1e9)]!==undefined&&{'runAfterJourneyRefresh':_0x19c60a[_0x5a3f86(0x1e9)]}},_0x1bded7=await _0x537236['journey'][_0x5a3f86(0x1b7)](_0x34d171['existingJourney']['id'],_0x19bff3);return _0x32f1c4['set'](_0x4cff6d,_0x1bded7['id']),_0x1bded7['id'];}throw new SDKError(ErrorCode[_0x5a3f86(0x1d6)],_0x5a3f86(0x19b));},'resolveJourneyId':async _0x379acb=>{const _0x38d891=_0x48c7e7;try{return await _0x537236[_0x38d891(0x1b8)]['resolveJourneyId'](_0x422ca9[_0x38d891(0x164)],_0x379acb);}catch(_0x5634a4){throw new SDKError(ErrorCode[_0x38d891(0x128)],_0x38d891(0x1e5)+_0x379acb+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x34d171[_0x38d891(0x136)][_0x38d891(0x17c)]+'\x27)',_0x5634a4);}},'resolveStageId':async(_0x33e789,_0x43ec22)=>{const _0x3bb523=_0x48c7e7,_0x3b0e87=await _0x537236[_0x3bb523(0x1b8)][_0x3bb523(0x15c)](_0x33e789),_0x58800e=_0x3b0e87[_0x3bb523(0x19a)][_0x3bb523(0x1f9)][_0x3bb523(0x1bb)](_0x582cf5=>_0x582cf5[_0x3bb523(0x17c)]['toLowerCase']()===_0x43ec22['toLowerCase']());if(!_0x58800e?.['id'])throw new SDKError(ErrorCode[_0x3bb523(0x128)],_0x3bb523(0x1e3)+_0x43ec22+_0x3bb523(0x1a0)+(_0x3b0e87[_0x3bb523(0x19a)][_0x3bb523(0x1f5)]||_0x3b0e87[_0x3bb523(0x19a)]['name'])+'\x27');return _0x58800e['id'];}},_0x301eb7=await _0x3e538f(_0x34d171[_0x48c7e7(0x136)],_0x422ca9[_0x48c7e7(0x164)],_0x53c8af),_0x57a0c6=_0x422ca9[_0x48c7e7(0x137)]||_0x422ca9['rootFolderId'];_0x57a0c6&&(_0x301eb7['relationships']={'parentFolder':{'data':{'id':_0x57a0c6,'type':'folder'}}});if(_0x34d171[_0x48c7e7(0x1d8)]){if(_0x4135f6['size']>0x0||_0x45885b[_0x48c7e7(0x1e6)]>0x0)return await executeThreeStepJourneyCreate(_0x537236,_0x34d171,_0x301eb7,{'pendingEmbeddedSegments':_0x4135f6,'pendingEmbeddedActivations':_0x45885b,'embeddedSegmentNameToId':_0x16ccb2,'journeyActivationNameToId':_0x32f1c4},{..._0x422ca9,'effectiveFolderId':_0x57a0c6},_0x220ff7,_0x5a8284,_0x5679b9);else{ensureJourneyDefaults(_0x301eb7[_0x48c7e7(0x19a)]);const _0x53421f=await _0x537236[_0x48c7e7(0x1b8)][_0x48c7e7(0x147)](_0x301eb7);return deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x144),'journeyId':_0x53421f['id'],'embeddedSegmentNameToId':_0x16ccb2};}}else{if(_0x34d171[_0x48c7e7(0x1c8)]&&_0x34d171[_0x48c7e7(0x12d)]){_0x301eb7['id']=_0x34d171[_0x48c7e7(0x12d)]['id'];const _0x3d9d15=_0x301eb7[_0x48c7e7(0x19a)];_0x34d171[_0x48c7e7(0x12d)][_0x48c7e7(0x19a)]?.['journeyBundleName']&&(_0x3d9d15[_0x48c7e7(0x1f5)]=_0x34d171[_0x48c7e7(0x12d)][_0x48c7e7(0x19a)][_0x48c7e7(0x1f5)]);const _0x56ffbf=_0x34d171['existingJourney'][_0x48c7e7(0x19a)]?.[_0x48c7e7(0x1f9)];return _0x56ffbf&&_0x301eb7['attributes'][_0x48c7e7(0x1f9)]&&injectExistingStageIds(_0x301eb7[_0x48c7e7(0x19a)][_0x48c7e7(0x1f9)],_0x56ffbf),ensureJourneyDefaults(_0x3d9d15),await _0x537236[_0x48c7e7(0x1b8)][_0x48c7e7(0x179)](_0x34d171[_0x48c7e7(0x12d)]['id'],_0x301eb7),deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x1df),'journeyId':_0x34d171[_0x48c7e7(0x12d)]['id'],'embeddedSegmentNameToId':_0x16ccb2};}}return deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x180),'journeyId':_0x34d171[_0x48c7e7(0x12d)]?.['id'],'embeddedSegmentNameToId':_0x16ccb2};}function findSegmentCriteriaLocation(_0x38c756,_0x41c589){const _0x4a565e=a151_0x2ed631,_0x323cae=_0x38c756[_0x4a565e(0x1bf)]||_0x38c756[_0x4a565e(0x13d)]?.[0x0]?.['stages']||[];let _0x563214=_0x4a565e(0x1f2),_0x57211e=_0x41c589;const _0x5c0e9a=_0x38c756[_0x4a565e(0x161)]||_0x38c756['journeys']?.[0x0]?.[_0x4a565e(0x161)];if(_0x5c0e9a?.[_0x4a565e(0x1b9)]===_0x41c589)return{'stageName':_0x4a565e(0x161),'criteriaName':_0x5c0e9a[_0x4a565e(0x17c)]||_0x41c589};_0x27a884:for(const _0x182e3b of _0x323cae){if(_0x182e3b[_0x4a565e(0x15e)]?.[_0x4a565e(0x1b9)]===_0x41c589){_0x563214=_0x182e3b[_0x4a565e(0x17c)],_0x57211e=_0x182e3b['entry_criteria']['name']||_0x41c589;break;}if(_0x182e3b[_0x4a565e(0x126)])for(const _0xd00d9 of _0x182e3b[_0x4a565e(0x126)]){if(_0xd00d9[_0x4a565e(0x138)]===_0x4a565e(0x1ec)&&_0xd00d9[_0x4a565e(0x1e7)]?.[_0x4a565e(0x218)])for(const _0x5df5e4 of _0xd00d9['with'][_0x4a565e(0x218)]){if(_0x5df5e4[_0x4a565e(0x1b9)]===_0x41c589){_0x563214=_0x182e3b[_0x4a565e(0x17c)],_0x57211e=_0x5df5e4[_0x4a565e(0x17c)]||_0x41c589;break _0x27a884;}}}}return{'stageName':_0x563214,'criteriaName':_0x57211e};}async function executeThreeStepJourneyCreate(_0x52cb0a,_0x197d67,_0x554939,_0x2192de,_0x119e53,_0x183304,_0x275d61,_0x265587){const _0x5d629a=a151_0x2ed631,{activationDefToCreateRequest:_0x44564b,yamlRuleToApi:_0x56630e}=_0x265587,{pendingEmbeddedSegments:_0xb4d881,pendingEmbeddedActivations:_0x7a3894,embeddedSegmentNameToId:_0x455533}=_0x2192de,_0x51a0d3=JSON['parse'](JSON[_0x5d629a(0x14e)](_0x554939));ensureJourneyDefaults(_0x51a0d3[_0x5d629a(0x19a)]),stripPendingIds(_0x51a0d3);const _0x48699c=await _0x52cb0a[_0x5d629a(0x1b8)][_0x5d629a(0x147)](_0x51a0d3),_0x4df3d3=_0x48699c['id'],_0x33b663=new Map();for(const _0x176a21 of _0x48699c[_0x5d629a(0x19a)][_0x5d629a(0x1f9)]){_0x33b663[_0x5d629a(0x1c7)](_0x176a21[_0x5d629a(0x17c)]['toLowerCase'](),_0x176a21['id']);}recoverSegmentIdsFromPushRecovery(_0x197d67,_0x455533,_0x183304[_0x5d629a(0x193)]);for(const [_0x43a0e9,{definition:_0x37ae3c}]of _0xb4d881){if(_0x455533[_0x5d629a(0x1b5)](_0x43a0e9)){_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_segment_created','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'segmentName':_0x43a0e9});continue;}const _0x4bf79c=generateDeterministicJourneySegmentName(_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],_0x43a0e9);_0x275d61['onProgress']?.({'type':_0x5d629a(0x1e4),'journeyName':_0x197d67['yamlConfig']['name'],'segmentName':_0x43a0e9});const _0x3107e4=createSegmentIdResolver(_0x183304[_0x5d629a(0x193)],_0x43a0e9),_0x30c314=await resolveRuleSegmentIds(_0x37ae3c[_0x5d629a(0x198)],_0x3107e4),_0x4dfb97=await createOrRecoverEmbeddedSegment(_0x52cb0a,_0x197d67,{'localName':_0x43a0e9,'uniqueSegmentName':_0x4bf79c,'description':_0x37ae3c[_0x5d629a(0x1cd)]||'Entry\x20criteria:\x20'+_0x43a0e9,'journeyId':_0x4df3d3,'resolvedRule':_0x30c314,'parentId':_0x119e53[_0x5d629a(0x164)],'folderId':_0x119e53[_0x5d629a(0x1f3)]||''},_0x56630e);_0x455533[_0x5d629a(0x1c7)](_0x43a0e9,_0x4dfb97),_0x183304[_0x5d629a(0x193)][_0x5d629a(0x1c7)](_0x43a0e9,_0x4dfb97),_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_segment_created','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'segmentName':_0x43a0e9});}const _0x7f4b0c=new Map();for(const [_0xdd1f10,_0x535bec]of _0x7a3894){_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_activation_creating','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'activationName':_0xdd1f10});const _0x149f22=await _0x44564b(_0x535bec,_0x183304[_0x5d629a(0x173)]),_0x48d0fb={..._0x149f22,..._0x535bec[_0x5d629a(0x1e9)]!==undefined&&{'runAfterJourneyRefresh':_0x535bec['run_after_journey_refresh']}},_0x345bd0=await _0x52cb0a['journey'][_0x5d629a(0x1b7)](_0x4df3d3,_0x48d0fb);_0x7f4b0c[_0x5d629a(0x1c7)](_0xdd1f10,_0x345bd0['id']),_0x2192de[_0x5d629a(0x18e)][_0x5d629a(0x1c7)](_0xdd1f10,_0x345bd0['id']),_0x275d61['onProgress']?.({'type':_0x5d629a(0x1eb),'journeyName':_0x197d67[_0x5d629a(0x136)]['name'],'activationName':_0xdd1f10});}const _0x493091=JSON[_0x5d629a(0x211)](JSON['stringify'](_0x554939));return _0x493091['id']=_0x4df3d3,ensureJourneyDefaults(_0x493091[_0x5d629a(0x19a)]),resolvePendingIdsInRequest(_0x493091,_0x554939,_0x33b663,_0x455533,_0x7f4b0c,_0x275d61),await _0x52cb0a[_0x5d629a(0x1b8)]['update'](_0x4df3d3,_0x493091),deletePushRecovery(_0x197d67[_0x5d629a(0x1c1)]),{'action':_0x5d629a(0x144),'journeyId':_0x4df3d3,'embeddedSegmentNameToId':_0x455533};}export function stripWaitStepPendingIds(_0x434072){const _0x4f2ba6=a151_0x2ed631,_0x4da19a=_0x434072[_0x4f2ba6(0x1f0)]&&isPendingSegmentId(_0x434072[_0x4f2ba6(0x1f0)]),_0x33c94d=_0x434072['conditions']?.[_0x4f2ba6(0x212)](_0x59238a=>_0x59238a[_0x4f2ba6(0x203)]&&isPendingSegmentId(_0x59238a[_0x4f2ba6(0x203)]));(_0x4da19a||_0x33c94d)&&(_0x434072[_0x4f2ba6(0x1aa)]=_0x4f2ba6(0x14d),_0x434072[_0x4f2ba6(0x154)]=0x1,_0x434072['waitStepUnit']='day',delete _0x434072[_0x4f2ba6(0x1f0)],delete _0x434072[_0x4f2ba6(0x189)],delete _0x434072[_0x4f2ba6(0x1d1)],delete _0x434072[_0x4f2ba6(0x12f)]);}export function resolveWaitStepPendingIds(_0x5e07d4,_0x483815,_0x1ef3f9,_0x2aa9c4){const _0x2a2021=a151_0x2ed631;if(_0x483815[_0x2a2021(0x1f0)]&&isPendingSegmentId(_0x483815[_0x2a2021(0x1f0)])){const _0x3ef526=_0x1ef3f9(_0x483815[_0x2a2021(0x1f0)],_0x2a2021(0x17e)+_0x2aa9c4+'\x27\x20wait\x20condition');_0x3ef526&&(_0x5e07d4['waitStepType']=_0x2a2021(0x175),_0x5e07d4[_0x2a2021(0x1f0)]=_0x3ef526,delete _0x5e07d4[_0x2a2021(0x154)],delete _0x5e07d4[_0x2a2021(0x166)],_0x483815['conditionTimeoutDuration']!==undefined&&(_0x5e07d4[_0x2a2021(0x189)]=_0x483815[_0x2a2021(0x189)]),_0x483815[_0x2a2021(0x1d1)]&&(_0x5e07d4[_0x2a2021(0x1d1)]=_0x483815[_0x2a2021(0x1d1)]));}if(_0x483815[_0x2a2021(0x12f)]){const _0x3cd373=_0x483815[_0x2a2021(0x12f)]['some'](_0x1645a8=>_0x1645a8[_0x2a2021(0x203)]&&isPendingSegmentId(_0x1645a8[_0x2a2021(0x203)]));if(_0x3cd373){const _0x4f3f22=_0x483815[_0x2a2021(0x12f)][_0x2a2021(0x191)](_0x2fd311=>{const _0x47aa65=_0x2a2021;if(_0x2fd311[_0x47aa65(0x203)]&&isPendingSegmentId(_0x2fd311[_0x47aa65(0x203)])){const _0x169a29=_0x1ef3f9(_0x2fd311['segmentId'],'stage\x20\x27'+_0x2aa9c4+_0x47aa65(0x160));return{..._0x2fd311,'segmentId':_0x169a29||_0x2fd311['segmentId']};}return{..._0x2fd311};});_0x5e07d4[_0x2a2021(0x1aa)]=_0x2a2021(0x175),_0x5e07d4[_0x2a2021(0x12f)]=_0x4f3f22,delete _0x5e07d4[_0x2a2021(0x154)],delete _0x5e07d4[_0x2a2021(0x166)],delete _0x5e07d4[_0x2a2021(0x1f0)],delete _0x5e07d4[_0x2a2021(0x189)],delete _0x5e07d4[_0x2a2021(0x1d1)];}}}function stripPendingIds(_0x539281){const _0x59a86a=a151_0x2ed631;_0x539281[_0x59a86a(0x19a)]['goal']?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x539281['attributes'][_0x59a86a(0x161)][_0x59a86a(0x203)])&&delete _0x539281['attributes'][_0x59a86a(0x161)];for(const _0x13c905 of _0x539281['attributes'][_0x59a86a(0x1f9)]||[]){_0x13c905['entryCriteria']?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x13c905['entryCriteria']['segmentId'])&&delete _0x13c905[_0x59a86a(0x1e2)];_0x13c905[_0x59a86a(0x178)]?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x13c905['milestone'][_0x59a86a(0x203)])&&delete _0x13c905['milestone'];_0x13c905[_0x59a86a(0x215)]&&(_0x13c905[_0x59a86a(0x215)]=_0x13c905[_0x59a86a(0x215)][_0x59a86a(0x1fd)](_0x1f00ee=>!_0x1f00ee['segmentId']||!isPendingSegmentId(_0x1f00ee[_0x59a86a(0x203)])));if(_0x13c905[_0x59a86a(0x126)])for(const _0x3b9501 of Object[_0x59a86a(0x197)](_0x13c905['steps'])){const _0xc41b20=_0x13c905[_0x59a86a(0x126)][_0x3b9501];_0xc41b20[_0x59a86a(0x138)]===_0x59a86a(0x16f)&&_0xc41b20[_0x59a86a(0x11d)]&&isPendingActivationId(_0xc41b20['journeyActivationStepId'])&&(_0xc41b20['journeyActivationStepId']='');if(_0xc41b20['type']==='DecisionPoint'&&_0xc41b20[_0x59a86a(0x218)])for(const _0x26bf25 of _0xc41b20[_0x59a86a(0x218)]){_0x26bf25[_0x59a86a(0x203)]&&isPendingSegmentId(_0x26bf25[_0x59a86a(0x203)])&&(_0x26bf25[_0x59a86a(0x203)]='');}_0xc41b20['type']===_0x59a86a(0x12a)&&stripWaitStepPendingIds(_0xc41b20);}}}function resolvePendingIdsInRequest(_0x4eb0d4,_0x415623,_0x5c8a21,_0x984de7,_0x2eec32,_0x13e45f){const _0x4a13d0=a151_0x2ed631,_0x126a7d=(_0x2ff15b,_0x188495)=>{const _0x4ac046=a151_0x5571;if(!isPendingSegmentId(_0x2ff15b))return _0x2ff15b;const _0x4aef56=extractPendingSegmentName(_0x2ff15b),_0x57b424=_0x984de7[_0x4ac046(0x1ac)](_0x4aef56);return!_0x57b424&&_0x13e45f[_0x4ac046(0x169)]?.(_0x4ac046(0x1e0)+_0x4aef56+_0x4ac046(0x16e)+_0x188495),_0x57b424;};if(_0x4eb0d4['attributes'][_0x4a13d0(0x161)]?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x161)][_0x4a13d0(0x203)])){const _0x432496=_0x126a7d(_0x4eb0d4['attributes'][_0x4a13d0(0x161)]['segmentId'],_0x4a13d0(0x13f));_0x432496&&(_0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x161)]['segmentId']=_0x432496);}for(const _0x31e6ae of _0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x1f9)]||[]){const _0x30d0a9=_0x5c8a21[_0x4a13d0(0x1ac)](_0x31e6ae[_0x4a13d0(0x17c)][_0x4a13d0(0x181)]());_0x30d0a9&&(_0x31e6ae['id']=_0x30d0a9);if(_0x31e6ae[_0x4a13d0(0x1e2)]?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x31e6ae[_0x4a13d0(0x1e2)][_0x4a13d0(0x203)])){const _0x235ea5=_0x126a7d(_0x31e6ae['entryCriteria']['segmentId'],'stage\x20\x27'+_0x31e6ae[_0x4a13d0(0x17c)]+_0x4a13d0(0x185));_0x235ea5&&(_0x31e6ae['entryCriteria']['segmentId']=_0x235ea5);}if(_0x31e6ae['exitCriterias'])for(const _0x16c810 of _0x31e6ae[_0x4a13d0(0x215)]){if(_0x16c810[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x16c810[_0x4a13d0(0x203)])){const _0x279e4a=_0x126a7d(_0x16c810[_0x4a13d0(0x203)],_0x4a13d0(0x17e)+_0x31e6ae[_0x4a13d0(0x17c)]+_0x4a13d0(0x190));_0x279e4a&&(_0x16c810[_0x4a13d0(0x203)]=_0x279e4a);}}if(_0x31e6ae[_0x4a13d0(0x178)]?.['segmentId']&&isPendingSegmentId(_0x31e6ae[_0x4a13d0(0x178)]['segmentId'])){const _0x301c18=_0x126a7d(_0x31e6ae['milestone'][_0x4a13d0(0x203)],_0x4a13d0(0x17e)+_0x31e6ae['name']+_0x4a13d0(0x1c4));_0x301c18&&(_0x31e6ae['milestone'][_0x4a13d0(0x203)]=_0x301c18);}if(_0x31e6ae[_0x4a13d0(0x126)]){const _0x12b5fa=_0x9a48ef=>_0x415623['attributes'][_0x4a13d0(0x1f9)]?.[_0x4a13d0(0x1bb)](_0x69ba31=>_0x69ba31['name']['toLowerCase']()===_0x31e6ae[_0x4a13d0(0x17c)][_0x4a13d0(0x181)]())?.[_0x4a13d0(0x126)]?.[_0x9a48ef];for(const _0x3e28e7 of Object[_0x4a13d0(0x197)](_0x31e6ae[_0x4a13d0(0x126)])){const _0x410b02=_0x31e6ae['steps'][_0x3e28e7],_0x3f8d3a=_0x12b5fa(_0x3e28e7);if(_0x410b02['type']==='Activation'&&_0x410b02[_0x4a13d0(0x11d)]&&(isPendingActivationId(_0x410b02[_0x4a13d0(0x11d)])||_0x410b02['journeyActivationStepId']==='')){if(_0x3f8d3a?.[_0x4a13d0(0x11d)]&&isPendingActivationId(_0x3f8d3a['journeyActivationStepId'])){const _0x1e5df1=extractPendingActivationName(_0x3f8d3a[_0x4a13d0(0x11d)]),_0xae5b23=_0x2eec32['get'](_0x1e5df1);_0xae5b23&&(_0x410b02[_0x4a13d0(0x11d)]=_0xae5b23);}}if(_0x410b02[_0x4a13d0(0x138)]===_0x4a13d0(0x15b)&&_0x410b02['branches']&&_0x3f8d3a?.[_0x4a13d0(0x218)])for(let _0x2d380c=0x0;_0x2d380c<_0x410b02[_0x4a13d0(0x218)][_0x4a13d0(0x165)];_0x2d380c++){const _0xc67fd7=_0x410b02[_0x4a13d0(0x218)][_0x2d380c],_0x4c9efe=_0x3f8d3a[_0x4a13d0(0x218)][_0x2d380c];if(_0x4c9efe?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x4c9efe['segmentId'])){const _0x32b7ef=_0x126a7d(_0x4c9efe[_0x4a13d0(0x203)],'stage\x20\x27'+_0x31e6ae['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0xc67fd7[_0x4a13d0(0x17c)]||_0x2d380c)+'\x27');_0x32b7ef&&(_0xc67fd7[_0x4a13d0(0x203)]=_0x32b7ef);}}_0x410b02[_0x4a13d0(0x138)]===_0x4a13d0(0x12a)&&_0x3f8d3a?.[_0x4a13d0(0x138)]===_0x4a13d0(0x12a)&&resolveWaitStepPendingIds(_0x410b02,_0x3f8d3a,_0x126a7d,_0x31e6ae['name']);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x23130e,_0x1261be){const _0x366f94=a152_0x4978,_0x565aed=_0x23130e();while(!![]){try{const _0x51696d=parseInt(_0x366f94(0xba))/0x1+parseInt(_0x366f94(0xbf))/0x2+parseInt(_0x366f94(0xc3))/0x3*(parseInt(_0x366f94(0xc1))/0x4)+parseInt(_0x366f94(0xc8))/0x5+-parseInt(_0x366f94(0xb9))/0x6*(-parseInt(_0x366f94(0xbc))/0x7)+-parseInt(_0x366f94(0xbb))/0x8*(-parseInt(_0x366f94(0xc6))/0x9)+-parseInt(_0x366f94(0xc7))/0xa;if(_0x51696d===_0x1261be)break;else _0x565aed['push'](_0x565aed['shift']());}catch(_0x5ecdfd){_0x565aed['push'](_0x565aed['shift']());}}}(a152_0x388a,0xcecff));function a152_0x4978(_0x485786,_0x2c8a90){_0x485786=_0x485786-0xb9;const _0x388ab3=a152_0x388a();let _0x4978d7=_0x388ab3[_0x485786];return _0x4978d7;}export function buildFolderIdToPathMap(_0x573869){const _0x573404=a152_0x4978,_0x47b199=new Map(),_0x50c3dc=new Map();for(const _0x7873be of _0x573869){_0x50c3dc[_0x573404(0xbe)](_0x7873be['id'],_0x7873be);}const _0x387ef3=new Set();for(const _0x570d83 of _0x573869){!_0x570d83[_0x573404(0xc0)]&&_0x387ef3[_0x573404(0xc2)](_0x570d83['id']);}function _0x315bb1(_0x43d00b){const _0x521ee6=_0x573404;if(_0x47b199[_0x521ee6(0xc4)](_0x43d00b['id']))return _0x47b199[_0x521ee6(0xc5)](_0x43d00b['id']);if(_0x387ef3['has'](_0x43d00b['id']))return _0x47b199[_0x521ee6(0xbe)](_0x43d00b['id'],''),'';if(_0x43d00b[_0x521ee6(0xc0)]){const _0x19555d=_0x50c3dc[_0x521ee6(0xc5)](_0x43d00b[_0x521ee6(0xc0)]);if(_0x19555d){const _0x36ccea=_0x315bb1(_0x19555d),_0x25c44c=_0x36ccea?_0x36ccea+'/'+_0x43d00b[_0x521ee6(0xbd)]:_0x43d00b[_0x521ee6(0xbd)];return _0x47b199[_0x521ee6(0xbe)](_0x43d00b['id'],_0x25c44c),_0x25c44c;}}const _0x1e07a6=_0x43d00b[_0x521ee6(0xbd)];return _0x47b199[_0x521ee6(0xbe)](_0x43d00b['id'],_0x1e07a6),_0x1e07a6;}for(const _0x49e97e of _0x573869){_0x315bb1(_0x49e97e);}return _0x47b199;}export function buildFolderPathToIdMap(_0x1d5a09){const _0x3f89a0=a152_0x4978,_0x39228a=new Map(),_0xbb9908=new Map();for(const _0x387176 of _0x1d5a09){_0xbb9908[_0x3f89a0(0xbe)](_0x387176['id'],_0x387176);}const _0x521d4e=new Set();for(const _0x1e2aa7 of _0x1d5a09){!_0x1e2aa7[_0x3f89a0(0xc0)]&&_0x521d4e[_0x3f89a0(0xc2)](_0x1e2aa7['id']);}function _0x1b04e9(_0x2c98be){const _0x37a844=_0x3f89a0;if(_0x521d4e[_0x37a844(0xc4)](_0x2c98be['id']))return'';if(_0x2c98be[_0x37a844(0xc0)]){const _0x57ce0a=_0xbb9908[_0x37a844(0xc5)](_0x2c98be[_0x37a844(0xc0)]);if(_0x57ce0a){const _0x340eee=_0x1b04e9(_0x57ce0a);return _0x340eee?_0x340eee+'/'+_0x2c98be[_0x37a844(0xbd)]:_0x2c98be['name'];}}return _0x2c98be[_0x37a844(0xbd)];}for(const _0xe4c1cd of _0x1d5a09){const _0xe68a8e=_0x1b04e9(_0xe4c1cd);_0x39228a[_0x3f89a0(0xbe)](_0xe68a8e,_0xe4c1cd['id']);}return _0x39228a;}export function buildFolderMaps(_0x3a44f9){const _0x181903=a152_0x4978,_0xd0158=buildFolderIdToPathMap(_0x3a44f9),_0x245c2d=new Map();for(const [_0x472d36,_0x527b50]of _0xd0158){_0x245c2d[_0x181903(0xbe)](_0x527b50,_0x472d36);}return{'idToPath':_0xd0158,'pathToId':_0x245c2d};}function a152_0x388a(){const _0x37d29e=['42388hGoumu','add','3KzqIXu','has','get','1346382gvwGZi','40126940IdwvFh','6913995KJOjYX','894xyaRPG','1283061zgaOjb','40XynEwi','27594PfWUjJ','name','set','1695984lifqmf','parentFolderId'];a152_0x388a=function(){return _0x37d29e;};return a152_0x388a();}export function getFolderPath(_0x3201e2,_0x3559b0){if(!_0x3201e2)return'';return _0x3559b0['get'](_0x3201e2)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f52a8,_0x3f1c03){const _0x4fd0c0=a153_0x5878,_0x4b5074=_0x4f52a8();while(!![]){try{const _0x155a17=parseInt(_0x4fd0c0(0xa7))/0x1*(-parseInt(_0x4fd0c0(0xc6))/0x2)+-parseInt(_0x4fd0c0(0xc7))/0x3*(parseInt(_0x4fd0c0(0xb8))/0x4)+-parseInt(_0x4fd0c0(0xab))/0x5*(-parseInt(_0x4fd0c0(0xb4))/0x6)+-parseInt(_0x4fd0c0(0xc8))/0x7*(parseInt(_0x4fd0c0(0xbc))/0x8)+-parseInt(_0x4fd0c0(0xbe))/0x9*(parseInt(_0x4fd0c0(0xbf))/0xa)+-parseInt(_0x4fd0c0(0xc9))/0xb+parseInt(_0x4fd0c0(0xcb))/0xc;if(_0x155a17===_0x3f1c03)break;else _0x4b5074['push'](_0x4b5074['shift']());}catch(_0x8074a9){_0x4b5074['push'](_0x4b5074['shift']());}}}(a153_0x105d,0xa43a5));import a153_0x45711a from'path';import{parse as a153_0x27bc5c}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x4f6df5){const _0x39391e=a153_0x5878;if(!_0x4f6df5||_0x4f6df5[_0x39391e(0xc5)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x125b83=_0x4f6df5[_0x39391e(0xc5)]();if(_0x125b83==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x4f6df5};const _0xa263f=_0x125b83[_0x39391e(0xc2)]('/')?_0x125b83[_0x39391e(0xb7)](0x1):_0x125b83,_0x14ed8d=_0xa263f[_0x39391e(0xb3)]('/')['filter'](_0x2785ed=>_0x2785ed!=='');if(_0x14ed8d['length']===0x0)throw new Error(_0x39391e(0xb9));const _0x37028f=_0x125b83['startsWith']('/')||!isRelativePathSegment(_0x14ed8d[0x0]);for(const _0x594d25 of _0x14ed8d){validatePathSegment(_0x594d25);}return{'segments':_0x14ed8d,'isAbsolute':_0x37028f,'raw':_0x4f6df5};}function isRelativePathSegment(_0x4613f7){return _0x4613f7==='.'||_0x4613f7==='..';}function validatePathSegment(_0x25eba0){const _0x461218=a153_0x5878;if(_0x25eba0==='')throw new Error(_0x461218(0xad));if(_0x25eba0==='.'||_0x25eba0==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x25eba0))throw new Error('Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20'+_0x25eba0);if(_0x25eba0!==_0x25eba0[_0x461218(0xc5)]()){}}export function validatePath(_0x4d3f18){const _0x5076fe=a153_0x5878;if(_0x4d3f18[_0x5076fe(0xce)][_0x5076fe(0xb0)]===0x0&&!_0x4d3f18[_0x5076fe(0xa9)])throw new Error(_0x5076fe(0xa4));if(_0x4d3f18[_0x5076fe(0xa9)]){if(_0x4d3f18[_0x5076fe(0xce)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x401cfe=0x0;for(const _0x52e386 of _0x4d3f18['segments']){if(_0x52e386==='..'){if(_0x401cfe===0x0)throw new Error(_0x5076fe(0xba));_0x401cfe--;}else _0x52e386!=='.'&&_0x401cfe++;}}}export function joinPaths(_0x235160,_0x78c85e){const _0x12109c=a153_0x5878;if(!_0x235160||_0x235160==='/')return _0x78c85e;if(!_0x78c85e||_0x78c85e==='.')return _0x235160;if(_0x78c85e['startsWith']('/'))return _0x78c85e;const _0x5815b6=parsePath(_0x235160),_0x56b07c=parsePath(_0x78c85e),_0x228c8d=[..._0x5815b6[_0x12109c(0xce)]];for(const _0x2de28c of _0x56b07c[_0x12109c(0xce)]){if(_0x2de28c==='.')continue;else{if(_0x2de28c==='..'){if(_0x228c8d[_0x12109c(0xb0)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x228c8d[_0x12109c(0xc3)]();}else _0x228c8d[_0x12109c(0xa5)](_0x2de28c);}}const _0x3123d3=_0x228c8d[_0x12109c(0xc0)]('/');return _0x5815b6['raw'][_0x12109c(0xc2)]('/')?'/'+_0x3123d3:_0x3123d3;}function a153_0x105d(){const _0x1377a6=['pop','journey','trim','1099210XJreEj','183TvXZut','938TVpMUI','7206991tnvUjA','segment','51070668vGMZHC','dirname','slice','segments','Cannot\x20split\x20empty\x20path','Relative\x20path\x20cannot\x20be\x20empty','push','type','2QEHqfl','resolve','isAbsolute','No\x20tdx.json\x20found\x20for\x20file:\x20','2669055bQPMRE','root','Path\x20segment\x20cannot\x20be\x20empty','endsWith','parse','length','readFile','raw','split','6FPtgQP','Cannot\x20navigate\x20above\x20root','name','substring','25780kDEBCI','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','Path\x20attempts\x20to\x20navigate\x20above\x20root','.yml','72456kszuFD','exists','531NaJRuo','128110OCukAN','join','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','startsWith'];a153_0x105d=function(){return _0x1377a6;};return a153_0x105d();}export function normalizePath(_0x376e27){const _0x1ac715=a153_0x5878,_0x38863f=parsePath(_0x376e27),_0x229a3e=[];for(const _0x1e1a65 of _0x38863f[_0x1ac715(0xce)]){if(_0x1e1a65==='.')continue;else{if(_0x1e1a65==='..'){if(_0x229a3e[_0x1ac715(0xb0)]===0x0){if(_0x38863f[_0x1ac715(0xa9)])throw new Error(_0x1ac715(0xb5));_0x229a3e[_0x1ac715(0xa5)]('..');}else _0x229a3e[_0x229a3e[_0x1ac715(0xb0)]-0x1]==='..'?_0x229a3e['push']('..'):_0x229a3e[_0x1ac715(0xc3)]();}else _0x229a3e[_0x1ac715(0xa5)](_0x1e1a65);}}if(_0x229a3e[_0x1ac715(0xb0)]===0x0)return _0x38863f[_0x1ac715(0xa9)]?'/':'.';const _0xdd845b=_0x229a3e[_0x1ac715(0xc0)]('/');return _0x38863f[_0x1ac715(0xb2)][_0x1ac715(0xc2)]('/')?'/'+_0xdd845b:_0xdd845b;}export function getParentPath(_0x1335eb){const _0x154a29=a153_0x5878,_0x6f2961=parsePath(_0x1335eb);if(_0x6f2961[_0x154a29(0xce)][_0x154a29(0xb0)]<=0x1)return'/';const _0x30de70=_0x6f2961[_0x154a29(0xce)][_0x154a29(0xcd)](0x0,-0x1)['join']('/');return _0x6f2961['raw'][_0x154a29(0xc2)]('/')?'/'+_0x30de70:_0x30de70;}function a153_0x5878(_0x1edabf,_0x2d092d){_0x1edabf=_0x1edabf-0xa3;const _0x105dda=a153_0x105d();let _0x5878a2=_0x105dda[_0x1edabf];return _0x5878a2;}export function getBaseName(_0x513514){const _0x331c1c=a153_0x5878,_0xe0865b=parsePath(_0x513514);return _0xe0865b[_0x331c1c(0xce)][_0xe0865b[_0x331c1c(0xce)][_0x331c1c(0xb0)]-0x1]||'';}export function isChildPath(_0x13fe43,_0x231000){const _0x374764=a153_0x5878,_0x200241=parsePath(_0x13fe43),_0x24c8a2=parsePath(_0x231000);if(_0x200241[_0x374764(0xce)][_0x374764(0xb0)]<=_0x24c8a2['segments'][_0x374764(0xb0)])return![];for(let _0x7b8810=0x0;_0x7b8810<_0x24c8a2[_0x374764(0xce)][_0x374764(0xb0)];_0x7b8810++){if(_0x200241['segments'][_0x7b8810]!==_0x24c8a2[_0x374764(0xce)][_0x7b8810])return![];}return!![];}export function splitPath(_0x17056a){const _0x3102a8=a153_0x5878,_0x3c790a=parsePath(_0x17056a);if(_0x3c790a[_0x3102a8(0xce)]['length']===0x0)throw new Error(_0x3102a8(0xa3));if(_0x3c790a['segments']['length']===0x1)return{'parent':_0x3c790a['segments'][0x0]};return{'parent':_0x3c790a['segments'][0x0],'child':_0x3c790a[_0x3102a8(0xce)][_0x3102a8(0xcd)](0x1)[_0x3102a8(0xc0)]('/')};}export function isYamlFilePath(_0x1f1eb2){const _0x32b585=a153_0x5878;return _0x1f1eb2[_0x32b585(0xae)](_0x32b585(0xbb))||_0x1f1eb2[_0x32b585(0xae)]('.yaml');}export async function resolveYamlFilePath(_0x1b1665,_0x3dc2b8=nodeFileSystem){const _0x1f98b5=a153_0x5878,_0x2d988f=a153_0x45711a[_0x1f98b5(0xa8)](_0x1b1665);if(!await _0x3dc2b8[_0x1f98b5(0xbd)](_0x2d988f))throw new Error('File\x20not\x20found:\x20'+_0x1b1665);let _0x29442c=a153_0x45711a['dirname'](_0x2d988f),_0x2095ee=null,_0x47ea5a=null;const _0x201747=a153_0x45711a[_0x1f98b5(0xaf)](_0x29442c)[_0x1f98b5(0xac)];while(_0x29442c!==_0x201747){const _0x2b7b52=a153_0x45711a[_0x1f98b5(0xc0)](_0x29442c,'tdx.json');if(await _0x3dc2b8['exists'](_0x2b7b52)){_0x2095ee=_0x2b7b52,_0x47ea5a=_0x29442c;break;}_0x29442c=a153_0x45711a[_0x1f98b5(0xcc)](_0x29442c);}if(!_0x2095ee||!_0x47ea5a)throw new Error(_0x1f98b5(0xaa)+_0x1b1665+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x35a21a=await _0x3dc2b8['readFile'](_0x2095ee),_0x1a22eb=JSON['parse'](_0x35a21a),_0x3c9783=_0x1a22eb['parent_segment'];if(!_0x3c9783)throw new Error(_0x1f98b5(0xc1));const _0x323458=await _0x3dc2b8[_0x1f98b5(0xb1)](_0x2d988f),_0x43ae6f=a153_0x27bc5c(_0x323458),_0x38dc4f=_0x43ae6f[_0x1f98b5(0xb6)];if(!_0x38dc4f)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x1b1665);const _0x57e5ee=_0x43ae6f[_0x1f98b5(0xa6)]===_0x1f98b5(0xc4)?'journey':_0x1f98b5(0xca),_0x2f157a=a153_0x45711a['relative'](_0x47ea5a,_0x2d988f),_0x5c9282=a153_0x45711a[_0x1f98b5(0xcc)](_0x2f157a),_0x5b5294=_0x5c9282==='.'?'':_0x5c9282['replace'](/\\/g,'/'),_0x504491=_0x5b5294?_0x3c9783+'/'+_0x5b5294+'/'+_0x38dc4f:_0x3c9783+'/'+_0x38dc4f;return{'parentSegment':_0x3c9783,'segmentName':_0x38dc4f,'folderPath':_0x5b5294,'fullPath':_0x504491,'resourceType':_0x57e5ee,'content':_0x323458};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a154_0x3c9b(_0x42a953,_0x551841){_0x42a953=_0x42a953-0x1af;const _0x120113=a154_0x1201();let _0x3c9bee=_0x120113[_0x42a953];return _0x3c9bee;}function a154_0x1201(){const _0x4677e1=['.\x20Child\x20name\x20cannot\x20be\x20empty','47896Qpiomm','64VnhqEA','75940zpzKvZ','substring','indexOf','Invalid\x20segment\x20reference\x20format:\x20','29XVSGyb','2198958IWrlPk','387hyfeiT','24869860XSXWLK','6063516lVvBkI','39906ZCbKrG','6561751yMRulC'];a154_0x1201=function(){return _0x4677e1;};return a154_0x1201();}(function(_0x560471,_0x1e8bae){const _0x8c3aeb=a154_0x3c9b,_0xc9377f=_0x560471();while(!![]){try{const _0x3b266f=parseInt(_0x8c3aeb(0x1b7))/0x1*(-parseInt(_0x8c3aeb(0x1bc))/0x2)+-parseInt(_0x8c3aeb(0x1b8))/0x3+-parseInt(_0x8c3aeb(0x1b2))/0x4*(parseInt(_0x8c3aeb(0x1b3))/0x5)+-parseInt(_0x8c3aeb(0x1bb))/0x6+parseInt(_0x8c3aeb(0x1af))/0x7+-parseInt(_0x8c3aeb(0x1b1))/0x8*(parseInt(_0x8c3aeb(0x1b9))/0x9)+parseInt(_0x8c3aeb(0x1ba))/0xa;if(_0x3b266f===_0x1e8bae)break;else _0xc9377f['push'](_0xc9377f['shift']());}catch(_0x566b71){_0xc9377f['push'](_0xc9377f['shift']());}}}(a154_0x1201,0x92e79));export function parseSegmentRef(_0x5c667){const _0xf66324=a154_0x3c9b,_0x12b168=_0x5c667[_0xf66324(0x1b5)]('/');if(_0x12b168===-0x1)return{'parentId':_0x5c667};if(_0x12b168===0x0)throw new Error(_0xf66324(0x1b6)+_0x5c667+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x5b7951=_0x5c667[_0xf66324(0x1b4)](0x0,_0x12b168),_0x1f85ef=_0x5c667[_0xf66324(0x1b4)](_0x12b168+0x1);if(_0x1f85ef==='')throw new Error(_0xf66324(0x1b6)+_0x5c667+_0xf66324(0x1b0));return{'parentId':_0x5b7951,'childId':_0x1f85ef};}
|