@treasuredata/tdx 0.10.0 → 0.10.1
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 +2 -2
- 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/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-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/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-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/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/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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +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-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/cdp.d.ts +5 -2
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/workflow-utils.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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.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 a97_0x3d28bc=a97_0x5045;(function(_0x679b93,_0x11d485){const _0x509fe5=a97_0x5045,_0x1c2eae=_0x679b93();while(!![]){try{const _0x2d575b=parseInt(_0x509fe5(0x209))/0x1*(-parseInt(_0x509fe5(0x26c))/0x2)+-parseInt(_0x509fe5(0x25f))/0x3*(parseInt(_0x509fe5(0x1e6))/0x4)+parseInt(_0x509fe5(0x1e9))/0x5*(-parseInt(_0x509fe5(0x1d5))/0x6)+-parseInt(_0x509fe5(0x261))/0x7*(-parseInt(_0x509fe5(0x2a1))/0x8)+-parseInt(_0x509fe5(0x269))/0x9*(-parseInt(_0x509fe5(0x251))/0xa)+-parseInt(_0x509fe5(0x1bf))/0xb+parseInt(_0x509fe5(0x221))/0xc*(parseInt(_0x509fe5(0x20c))/0xd);if(_0x2d575b===_0x11d485)break;else _0x1c2eae['push'](_0x1c2eae['shift']());}catch(_0x3d036e){_0x1c2eae['push'](_0x1c2eae['shift']());}}}(a97_0x1717,0xc5e3f));import{createHash}from'crypto';function a97_0x5045(_0x25a6a3,_0xf2aa30){_0x25a6a3=_0x25a6a3-0x1bf;const _0x171775=a97_0x1717();let _0x504521=_0x171775[_0x25a6a3];return _0x504521;}export const PENDING_SEGMENT_PREFIX=a97_0x3d28bc(0x25c);export const PENDING_ACTIVATION_PREFIX=a97_0x3d28bc(0x24e);export function createPendingSegmentId(_0x7293da){return''+PENDING_SEGMENT_PREFIX+_0x7293da+'__';}export function isPendingSegmentId(_0x410a72){return _0x410a72['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x294516){const _0x23fc0d=a97_0x3d28bc;return _0x294516[_0x23fc0d(0x1d1)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xa4ade8){return''+PENDING_ACTIVATION_PREFIX+_0xa4ade8+'__';}export function isPendingActivationId(_0x2ae923){return _0x2ae923['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1aec06){return _0x1aec06['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x45baf1,_0x4bcde6){const _0x35d999=a97_0x3d28bc,_0x5918f7=_0x45baf1+'::'+(_0x4bcde6[_0x35d999(0x1d3)]()||_0x35d999(0x255)),_0x28b4e2=createHash(_0x35d999(0x21c))['update'](_0x5918f7)[_0x35d999(0x1c0)]('hex')[_0x35d999(0x1e0)](0x0,0xc);return _0x35d999(0x20a)+_0x28b4e2;}export function ensureJourneyDefaults(_0x3ba66a){const _0x4abfe1=a97_0x3d28bc;!_0x3ba66a[_0x4abfe1(0x29b)]&&(_0x3ba66a[_0x4abfe1(0x29b)]=''),!_0x3ba66a[_0x4abfe1(0x297)]&&(_0x3ba66a['state']=_0x4abfe1(0x1c2));}export function resolveTDFolderPath(_0x440568,_0x302418,_0x2a081d){const _0x3debbc=a97_0x3d28bc;if(!_0x302418)return _0x440568;if(_0x440568===_0x2a081d||_0x440568[_0x3debbc(0x1c1)](_0x2a081d+'/'))return _0x440568;return _0x440568?_0x2a081d+'/'+_0x440568:_0x2a081d;}export function addFoldersToCreate(_0x561195,_0x2d3187,_0x42e5a7){const _0x2e6263=a97_0x3d28bc;if(!_0x561195)return;if(_0x2d3187[_0x2e6263(0x20f)](_0x561195))return;const _0xfb1ccb=_0x561195[_0x2e6263(0x277)]('/');let _0x1864a8='';for(const _0x1f1829 of _0xfb1ccb){_0x1864a8=_0x1864a8?_0x1864a8+'/'+_0x1f1829:_0x1f1829,!_0x2d3187[_0x2e6263(0x20f)](_0x1864a8)&&_0x42e5a7[_0x2e6263(0x22e)](_0x1864a8);}}import*as a97_0xb38f62 from'yaml';import{readFileSync}from'fs';import a97_0x54bcec from'path';import{isJourneyDef,parseYamlString as a97_0x24d767,toYamlString as a97_0x12627c,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x1157bd){const _0x137a89=a97_0x3d28bc;if(Array[_0x137a89(0x27d)](_0x1157bd))return'['+_0x1157bd[_0x137a89(0x1f8)](_0xc6498c=>stableStringify(_0xc6498c))[_0x137a89(0x1f3)](',')+']';if(_0x1157bd&&typeof _0x1157bd===_0x137a89(0x1d8)){const _0x12633a=_0x1157bd,_0x352a2c=Object[_0x137a89(0x26e)](_0x12633a)[_0x137a89(0x26f)](),_0x59542b=_0x352a2c[_0x137a89(0x1f8)](_0x5de3c4=>'\x22'+_0x5de3c4+'\x22:'+stableStringify(_0x12633a[_0x5de3c4]));return'{'+_0x59542b[_0x137a89(0x1f3)](',')+'}';}const _0x4dc966=JSON[_0x137a89(0x1f1)](_0x1157bd);return _0x4dc966===undefined?_0x137a89(0x1da):_0x4dc966;}function activationSignature(_0x4204d9){const _0x250bdd=a97_0x3d28bc,_0x592dda={'connection':_0x4204d9[_0x250bdd(0x20e)],..._0x4204d9[_0x250bdd(0x23d)]!==undefined&&{'all_columns':_0x4204d9['all_columns']},..._0x4204d9['columns']!==undefined&&{'columns':_0x4204d9[_0x250bdd(0x26d)]},..._0x4204d9[_0x250bdd(0x28b)]!==undefined&&{'behavior':_0x4204d9[_0x250bdd(0x28b)]},..._0x4204d9['schedule']!==undefined&&{'schedule':_0x4204d9['schedule']},..._0x4204d9[_0x250bdd(0x293)]!==undefined&&{'notification':_0x4204d9['notification']},..._0x4204d9['connector_config']!==undefined&&{'connector_config':_0x4204d9[_0x250bdd(0x240)]},..._0x4204d9['activation_template_id']!==undefined&&{'activation_template_id':_0x4204d9[_0x250bdd(0x295)]}};return stableStringify(_0x592dda);}export async function prepareSegmentFiles(_0x2602ad,_0x230b3b,_0x2e804e,_0x4cdd70,_0x4e7fd0){const _0x4f1db4=a97_0x3d28bc,{activationDefToCreateRequest:_0x490a2d}=await import(_0x4f1db4(0x1fe)),_0x3f9e99=[],_0x5aa780=new Set();for(const {yamlConfig:_0x54a25b,folderPath:_0x4bc05e,sourcePath:_0x19c1f2}of _0x2602ad){const _0xc382ad=resolveTDFolderPath(_0x4bc05e,_0x4cdd70,_0x4e7fd0),_0x70dfe3=_0xc382ad+':'+_0x54a25b['name'],_0x4f58a6=_0x230b3b[_0x4f1db4(0x232)]['get'](_0x70dfe3),_0x2bfb41=_0x4f58a6?_0x230b3b[_0x4f1db4(0x1ef)][_0x4f1db4(0x272)](_0x4f58a6['id'])||[]:[];addFoldersToCreate(_0xc382ad,_0x230b3b[_0x4f1db4(0x25d)],_0x5aa780);const _0x570d62=calculateActivationActions(_0x54a25b[_0x4f1db4(0x1fa)]||[],_0x2bfb41,_0x230b3b[_0x4f1db4(0x215)],_0x230b3b[_0x4f1db4(0x244)]);for(const _0x2b6c07 of _0x570d62){(_0x2b6c07[_0x4f1db4(0x203)]===_0x4f1db4(0x275)||_0x2b6c07['type']===_0x4f1db4(0x1ff))&&_0x2b6c07[_0x4f1db4(0x1f2)]&&(_0x2b6c07[_0x4f1db4(0x25a)]=await _0x490a2d(_0x2b6c07[_0x4f1db4(0x1f2)],_0x2e804e));}const _0x2555b9=calculateSegmentDiff(_0x54a25b,_0x4f58a6,_0x2bfb41,_0x230b3b['idToEmailMap'],_0x230b3b['connectionIdToNameMap']);_0x3f9e99[_0x4f1db4(0x283)]({'relativePath':_0x54a25b['name'],'absolutePath':_0x19c1f2,'yamlConfig':_0x54a25b,'folderPath':_0xc382ad,'existingSegment':_0x4f58a6,'existingActivations':_0x2bfb41,'isNew':_0x2555b9[_0x4f1db4(0x25b)],'hasChanges':_0x2555b9[_0x4f1db4(0x204)],'diff':_0x2555b9[_0x4f1db4(0x274)],'activationActions':_0x570d62});}return{'segmentFiles':_0x3f9e99,'foldersToCreate':_0x5aa780};}export async function prepareJourneyFiles(_0x1da036,_0x1e36bf,_0x4b9d22,_0x4836c1){const _0x5798ea=a97_0x3d28bc,_0x274fe2=[],_0x5b38f0=new Set();for(const {yamlConfig:_0x10ca7f,folderPath:_0x5b655a,sourcePath:_0x25fc34}of _0x1da036){const _0x566ead=resolveTDFolderPath(_0x5b655a,_0x4b9d22,_0x4836c1),_0xdf80de=_0x566ead+':'+_0x10ca7f[_0x5798ea(0x21b)],_0x52375e=_0x1e36bf[_0x5798ea(0x1d7)]['get'](_0xdf80de);let _0x3d4fe6,_0x23ebd6;if(_0x52375e&&_0x52375e['length']>0x0){const _0x41821e=buildLocalExpandedRuleMappings(_0x10ca7f),{createYamlContext:_0x527716,prefetchJourneySegments:_0x592352}=createPushYamlContextForBundle(_0x1e36bf[_0x5798ea(0x267)],_0x1e36bf[_0x5798ea(0x282)],_0x1e36bf[_0x5798ea(0x234)],_0x41821e,_0x1e36bf[_0x5798ea(0x215)],_0x1e36bf[_0x5798ea(0x244)],_0x1e36bf[_0x5798ea(0x247)],_0x1e36bf['journeyById']);await _0x592352(_0x52375e[_0x5798ea(0x1f8)](_0x2fb6f8=>_0x2fb6f8['id']));const _0x5d900f=hasMultipleVersions(_0x10ca7f),_0x217e1f=async _0x53eb05=>{const _0x2c82da=_0x5798ea,_0x41981e=_0x1e36bf[_0x2c82da(0x210)]?.[_0x2c82da(0x272)](_0x53eb05);if(_0x41981e)return _0x41981e;return _0x1e36bf[_0x2c82da(0x256)]({'journeyId':_0x53eb05,'journeyName':_0x10ca7f[_0x2c82da(0x21b)],'isMultiVersion':_0x52375e[_0x2c82da(0x21a)]>0x1});};if(_0x5d900f&&_0x52375e[_0x5798ea(0x21a)]>0x1){const _0xa8ca39=[];for(const _0x42721c of _0x52375e){const _0x346640=_0x42721c[_0x5798ea(0x22c)]||0x1;_0x1e36bf[_0x5798ea(0x281)]?.[_0x5798ea(0x1ff)](_0x5798ea(0x286)+_0x10ca7f[_0x5798ea(0x21b)]+'\x20v'+_0x346640);const _0x56d7e9=await _0x217e1f(_0x42721c['id']),_0x194dca=_0x527716(_0x42721c['id']),_0x287f9a=await journeyResponseToDef(_0x56d7e9,_0x194dca);_0xa8ca39[_0x5798ea(0x283)]({'item':_0x42721c,'yaml':_0x287f9a});}const _0x342500=buildLocalRuleToNameMappingFromJourney(_0x10ca7f);_0x23ebd6=buildMergedJourneyDef(_0xa8ca39,_0x342500);const _0x33fc19=Math[_0x5798ea(0x2a4)](..._0xa8ca39['map'](_0x59c283=>_0x59c283[_0x5798ea(0x20d)]['versionNumber']||0x0)),_0x421398=_0x52375e['find'](_0x4e0eae=>(_0x4e0eae[_0x5798ea(0x22c)]||0x0)===_0x33fc19);_0x421398&&(_0x1e36bf['progress']?.['update'](_0x5798ea(0x286)+_0x10ca7f[_0x5798ea(0x21b)]+'\x20v'+_0x33fc19),_0x3d4fe6=await _0x217e1f(_0x421398['id']));}else{const _0xaf742f=_0x52375e[_0x52375e['length']-0x1];_0x1e36bf[_0x5798ea(0x281)]?.['update'](_0x5798ea(0x286)+_0x10ca7f[_0x5798ea(0x21b)]),_0x3d4fe6=await _0x217e1f(_0xaf742f['id']);const _0x580c74=_0x527716(_0xaf742f['id']),_0x32e71b=await journeyResponseToDef(_0x3d4fe6,_0x580c74),_0x3d92d0=buildLocalRuleToNameMappingFromJourney(_0x10ca7f);_0x23ebd6=buildMergedJourneyDef([{'item':_0xaf742f,'yaml':_0x32e71b}],_0x3d92d0);}}addFoldersToCreate(_0x566ead,_0x1e36bf[_0x5798ea(0x25d)],_0x5b38f0);const _0x253a68=calculateJourneyDiff(_0x10ca7f,_0x23ebd6);_0x274fe2[_0x5798ea(0x283)]({'relativePath':_0x10ca7f['name'],'absolutePath':_0x25fc34,'yamlConfig':_0x10ca7f,'folderPath':_0x566ead,'existingJourney':_0x3d4fe6,'isNew':_0x253a68[_0x5798ea(0x25b)],'hasChanges':_0x253a68[_0x5798ea(0x204)],'diff':_0x253a68[_0x5798ea(0x274)]});}return{'journeyFiles':_0x274fe2,'foldersToCreate':_0x5b38f0};}export function calculateActivationActions(_0x44d5a2,_0x52c12e,_0x38d35d,_0x30fd48){const _0x10f82f=a97_0x3d28bc,_0x49a6d4=[],_0x5ddca9=new Map();for(const _0x40a991 of _0x52c12e){_0x5ddca9['set'](_0x40a991[_0x10f82f(0x21b)],_0x40a991);}const _0x4b5302=new Map();for(const _0x3a3008 of _0x44d5a2){_0x4b5302['set'](_0x3a3008[_0x10f82f(0x21b)],_0x3a3008);}for(const _0x3b8328 of _0x44d5a2){const _0x4f76d0=_0x5ddca9[_0x10f82f(0x272)](_0x3b8328[_0x10f82f(0x21b)]);if(!_0x4f76d0)_0x49a6d4[_0x10f82f(0x283)]({'type':_0x10f82f(0x275),'name':_0x3b8328[_0x10f82f(0x21b)],'yamlActivation':_0x3b8328});else{const _0x142612=activationResponseToDef(_0x4f76d0,_0x38d35d,_0x30fd48),_0x218a13=a97_0xb38f62[_0x10f82f(0x1f1)](_0x142612),_0xa5357f=a97_0xb38f62['stringify'](_0x3b8328);_0x218a13!==_0xa5357f&&_0x49a6d4[_0x10f82f(0x283)]({'type':'update','name':_0x3b8328[_0x10f82f(0x21b)],'yamlActivation':_0x3b8328,'existingActivation':_0x4f76d0});}}for(const _0x3f0735 of _0x52c12e){!_0x4b5302[_0x10f82f(0x20f)](_0x3f0735[_0x10f82f(0x21b)])&&_0x49a6d4[_0x10f82f(0x283)]({'type':_0x10f82f(0x229),'name':_0x3f0735[_0x10f82f(0x21b)],'existingActivation':_0x3f0735});}return _0x49a6d4;}export function calculateSegmentDiff(_0x5914be,_0xaa2db6,_0x49e81c,_0x4a9158,_0x40d65d){const _0x16647a=segmentToYamlString(_0x5914be);if(_0xaa2db6){const _0x55c33c=segmentWithActivationsToYaml(_0xaa2db6,_0x49e81c,undefined,_0x4a9158,_0x40d65d),_0x4d3604=segmentToYamlString(_0x55c33c),_0x1d209c=generateDiff(_0x4d3604,_0x16647a),_0x5ef720=hasChanges(_0x1d209c);return{'isNew':![],'hasChanges':_0x5ef720,'diff':_0x5ef720?formatDiffWithColors(_0x1d209c):undefined};}const _0x4307ce=generateDiff('',_0x16647a);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4307ce)};}export function calculateJourneyDiff(_0x38f376,_0x2f0775){const _0x58c779=normalizeJourneyDef(_0x38f376,_0x38f376),_0x1cd1ac=a97_0x12627c(_0x58c779);if(_0x2f0775){const _0x54f5a2=normalizeJourneyDef(_0x2f0775,_0x38f376),_0x45ed7a=a97_0x12627c(_0x54f5a2),_0x6958e8=generateDiff(_0x45ed7a,_0x1cd1ac),_0x4720a0=hasChanges(_0x6958e8);return{'isNew':![],'hasChanges':_0x4720a0,'diff':_0x4720a0?formatDiffWithColors(_0x6958e8):undefined};}const _0x25bbc7=generateDiff('',_0x1cd1ac);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x25bbc7)};}export function findSegmentsToDelete(_0x52ba47,_0x23ca66,_0x3b24fd,_0x245a87,_0x59e08a){const _0x47e79f=a97_0x3d28bc,_0x43cce8=new Set();for(const {yamlConfig:_0xa7b1e0,folderPath:_0x590678}of _0x23ca66){_0x43cce8[_0x47e79f(0x22e)](_0x590678+':'+_0xa7b1e0['name']);}return _0x52ba47[_0x47e79f(0x25e)](_0x177d75=>{const _0x40b30a=_0x47e79f,_0x25a4b9=_0x177d75[_0x40b30a(0x1cb)]?_0x3b24fd[_0x40b30a(0x272)](_0x177d75[_0x40b30a(0x1cb)][_0x40b30a(0x252)]())||'':'',_0x3d46eb=_0x25a4b9+':'+_0x177d75[_0x40b30a(0x21b)];if(_0x43cce8[_0x40b30a(0x20f)](_0x3d46eb))return![];if(_0x59e08a)return _0x25a4b9===_0x245a87||_0x25a4b9[_0x40b30a(0x1c1)](_0x245a87+'/');return!![];});}export function findJourneysToDelete(_0x5cd527,_0x2d7493,_0x359f0a,_0x31f52c,_0x33a1b9){const _0x3a21df=a97_0x3d28bc,_0x1c4340=new Set();for(const {yamlConfig:_0x3010f1,folderPath:_0x403343}of _0x2d7493){_0x1c4340[_0x3a21df(0x22e)](_0x403343+':'+_0x3010f1[_0x3a21df(0x21b)]);}return _0x5cd527[_0x3a21df(0x25e)](_0x40de56=>{const _0x37f683=_0x3a21df,_0x36f0b6=_0x40de56[_0x37f683(0x259)]?_0x359f0a[_0x37f683(0x272)](_0x40de56[_0x37f683(0x259)])||'':'',_0x3b61f3=_0x36f0b6+':'+_0x40de56[_0x37f683(0x260)];if(_0x1c4340['has'](_0x3b61f3))return![];if(_0x33a1b9)return _0x36f0b6===_0x31f52c||_0x36f0b6[_0x37f683(0x1c1)](_0x31f52c+'/');return!![];});}export function buildSegmentLookupMap(_0x49a176,_0x2fef40){const _0x460000=a97_0x3d28bc,_0x5505e3=new Map();for(const _0x1d26fb of _0x49a176){const _0x131233=_0x1d26fb[_0x460000(0x1cb)]?_0x2fef40[_0x460000(0x272)](_0x1d26fb['segmentFolderId'][_0x460000(0x252)]())||'':'',_0x2fbf4c=_0x131233+':'+_0x1d26fb[_0x460000(0x21b)];_0x5505e3[_0x460000(0x207)](_0x2fbf4c,_0x1d26fb);}return _0x5505e3;}export function buildSegmentNameToIdMap(_0x2ab404){const _0x561c5e=a97_0x3d28bc,_0x3d50a0=new Map();for(const _0xcb048 of _0x2ab404){_0x3d50a0['set'](_0xcb048[_0x561c5e(0x21b)],_0xcb048['id']);}return _0x3d50a0;}export function buildJourneyBundleLookupMap(_0x293191,_0x27a1a1){const _0x42512a=a97_0x3d28bc,_0x181438=new Map();for(const _0x58635d of _0x293191){const _0x45be68=_0x58635d[_0x42512a(0x259)]?_0x27a1a1[_0x42512a(0x272)](_0x58635d[_0x42512a(0x259)])||'':'',_0x258eb3=_0x45be68+':'+_0x58635d[_0x42512a(0x260)];!_0x181438[_0x42512a(0x20f)](_0x258eb3)&&_0x181438[_0x42512a(0x207)](_0x258eb3,[]),_0x181438[_0x42512a(0x272)](_0x258eb3)[_0x42512a(0x283)](_0x58635d);}for(const _0x690095 of _0x181438[_0x42512a(0x29c)]()){_0x690095[_0x42512a(0x26f)]((_0x11a56e,_0x1ddfe0)=>(_0x11a56e[_0x42512a(0x22c)]||0x0)-(_0x1ddfe0[_0x42512a(0x22c)]||0x0));}return _0x181438;}export function collectFoldersToCreate(_0x515b83,_0x5a928a){const _0x642d78=a97_0x3d28bc,_0x264319=new Set();for(const _0x10a336 of _0x515b83){if(!_0x10a336)continue;if(_0x5a928a[_0x642d78(0x20f)](_0x10a336))continue;const _0x4ade40=_0x10a336[_0x642d78(0x277)]('/');let _0x224de2='';for(const _0x1d2262 of _0x4ade40){_0x224de2=_0x224de2?_0x224de2+'/'+_0x1d2262:_0x1d2262,!_0x5a928a['has'](_0x224de2)&&_0x264319[_0x642d78(0x22e)](_0x224de2);}}return _0x264319;}export function parseAndClassifyYamlFiles(_0x3a9e41,_0x2c5c9c,_0x30fed9){const _0x52d1e1=a97_0x3d28bc,_0x8b3a87=[],_0xdc0859=[];for(const _0x1b65ef of _0x3a9e41){const _0x3688ee=a97_0x54bcec[_0x52d1e1(0x1c4)](_0x2c5c9c,a97_0x54bcec[_0x52d1e1(0x1f5)](_0x1b65ef)),_0x5ca5ea=_0x3688ee==='.'?'':_0x3688ee,_0x180ea1=readFileSync(_0x1b65ef,_0x52d1e1(0x1de)),_0x4d425e=a97_0xb38f62[_0x52d1e1(0x258)](_0x180ea1);if(isJourneyDef(_0x4d425e)){const _0x15a26b=a97_0x24d767(_0x180ea1);_0xdc0859[_0x52d1e1(0x283)]({'yamlConfig':_0x15a26b,'folderPath':_0x5ca5ea,'sourcePath':_0x1b65ef});}else{if(!_0x30fed9?.[_0x52d1e1(0x212)]){const _0x10c377=parseSegmentYamlFile(_0x180ea1),_0x3447e5=normalizeChildSegmentYaml(_0x10c377);_0x8b3a87[_0x52d1e1(0x283)]({'yamlConfig':_0x3447e5,'folderPath':_0x5ca5ea,'sourcePath':_0x1b65ef});}}}return{'segments':_0x8b3a87,'journeys':_0xdc0859};}export function validateParsedFiles(_0x5743f6,_0x1d903a){const _0x38f9db=a97_0x3d28bc,_0x523a5d=[];for(const {yamlConfig:_0x5666e7,sourcePath:_0x4b5aac}of _0x5743f6[_0x38f9db(0x200)]){const _0x4f620f=readFileSync(_0x4b5aac,'utf-8'),_0x163bc9=a97_0xb38f62[_0x38f9db(0x2a5)](_0x4f620f),_0xde608e=validateSegmentDef(_0x5666e7,{'source':_0x4f620f,'document':_0x163bc9});if(!_0xde608e[_0x38f9db(0x264)]){const _0x30b11f=a97_0x54bcec[_0x38f9db(0x1c4)](_0x1d903a,_0x4b5aac);_0x523a5d[_0x38f9db(0x283)]({'filePath':_0x30b11f,'source':_0x4f620f,'result':_0xde608e,'isJourney':![]});}}for(const {yamlConfig:_0x4cb131,sourcePath:_0x18403d}of _0x5743f6[_0x38f9db(0x2a0)]){const _0x48d286=readFileSync(_0x18403d,_0x38f9db(0x1de)),_0x7e4702=a97_0xb38f62[_0x38f9db(0x2a5)](_0x48d286),_0x5336a9=validateJourneyDef(_0x4cb131,{'source':_0x48d286,'document':_0x7e4702});if(!_0x5336a9['valid']){const _0x355356=a97_0x54bcec['relative'](_0x1d903a,_0x18403d);_0x523a5d['push']({'filePath':_0x355356,'source':_0x48d286,'result':_0x5336a9,'isJourney':!![]});}}return _0x523a5d;}export function formatValidationErrors(_0x606033){const _0x144986=a97_0x3d28bc,_0x16f53b=[];for(const {filePath:_0x1eec35,source:_0x4d4415,result:_0x5cf3f0,isJourney:_0x3e6bff}of _0x606033){const _0x39a313=_0x3e6bff?_0x144986(0x23b):_0x144986(0x255);_0x16f53b[_0x144986(0x283)]('\x0a'+_0x1eec35+'\x20('+_0x39a313+_0x144986(0x2a7)+_0x5cf3f0['errors'][_0x144986(0x21a)]+_0x144986(0x296)),_0x16f53b[_0x144986(0x283)](formatValidationResult(_0x5cf3f0,_0x4d4415,_0x1eec35));}return _0x16f53b[_0x144986(0x1f3)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x372ae9){const _0xf67f89=a97_0x3d28bc,_0x5e0118=new Set(),_0xfaf9d9=new Map(),_0xf46155=collectSegmentUsageCounts(_0x372ae9);if(_0x372ae9[_0xf67f89(0x200)])for(const [_0x15f435,_0x16dfa0]of Object['entries'](_0x372ae9['segments'])){_0x5e0118[_0xf67f89(0x22e)](_0x15f435);if(_0x16dfa0[_0xf67f89(0x1c5)]){const _0x7bbfbf=yamlRuleToApi(_0x16dfa0['rule']),_0x2163f5=apiRuleToYaml(_0x7bbfbf);_0xfaf9d9['set'](_0x15f435,_0x2163f5);}}const _0x5e4eaf=new Map();let _0x51a298=0x0;for(const [_0x1d9618,_0x59674b]of _0xfaf9d9){const _0x473e0=serializeExpandedRule(_0x59674b,_0xfaf9d9),_0x3e8680=_0x5e4eaf[_0xf67f89(0x272)](_0x473e0)||[];_0x3e8680[_0xf67f89(0x283)]({'name':_0x1d9618,'index':_0x51a298}),_0x5e4eaf[_0xf67f89(0x207)](_0x473e0,_0x3e8680),_0x51a298++;}const _0x5bd88c=new Map();for(const [_0x2fa66d,_0x409a08]of _0x5e4eaf){const _0x298631=_0x409a08[_0xf67f89(0x1e0)]()['sort']((_0x2045fc,_0x13f62d)=>{const _0x16fec8=_0xf67f89,_0x334fe7=_0xf46155['get'](_0x2045fc[_0x16fec8(0x21b)])||0x0,_0x16a703=_0xf46155[_0x16fec8(0x272)](_0x13f62d['name'])||0x0;if(_0x334fe7!==_0x16a703)return _0x16a703-_0x334fe7;return _0x2045fc[_0x16fec8(0x1e2)]-_0x13f62d[_0x16fec8(0x1e2)];})[_0xf67f89(0x1f8)](_0xe15328=>_0xe15328[_0xf67f89(0x21b)]),_0x10f377=[];for(const _0x38dee1 of _0x298631){const _0x4d71af=_0xf46155['get'](_0x38dee1)||0x0,_0xd18c5e=Math['max'](_0x4d71af,0x1);for(let _0x1f960b=0x0;_0x1f960b<_0xd18c5e;_0x1f960b++){_0x10f377['push'](_0x38dee1);}}_0x5bd88c[_0xf67f89(0x207)](_0x2fa66d,_0x10f377);}return{'existingLocalSegmentNames':_0x5e0118,'localSegmentRules':_0xfaf9d9,'localExpandedRuleToNames':_0x5bd88c};}async function buildServerSegmentRuleMap(_0x38e11c,_0x496905,_0xc9165e,_0x382c8f){const _0x4b20fe=new Map(),_0x5afd10=new Set(),_0x48539e=async _0x2390b9=>{const _0x5bfdbd=a97_0x5045;if(_0x5afd10[_0x5bfdbd(0x20f)](_0x2390b9))return;_0x5afd10[_0x5bfdbd(0x22e)](_0x2390b9);let _0x9f808d=_0xc9165e[_0x5bfdbd(0x22d)](_0x4a7ee9=>_0x4a7ee9['id']===_0x2390b9);if(!_0x9f808d)try{_0x9f808d=await _0x38e11c['segment']['getSegment'](_0x496905,_0x2390b9);}catch{return;}if(!_0x9f808d?.['rule'])return;const _0x5df42e=apiRuleToYaml(_0x9f808d[_0x5bfdbd(0x1c5)]);_0x4b20fe[_0x5bfdbd(0x207)](_0x2390b9,_0x5df42e);const _0x587f24=collectSegmentRefsFromRule(_0x5df42e);for(const _0x39fd8e of _0x587f24){await _0x48539e(_0x39fd8e);}};for(const _0x1866f1 of _0x382c8f){await _0x48539e(_0x1866f1);}return _0x4b20fe;}export function createSegmentIdResolver(_0x2cf25e,_0x58766){return async _0xdfa381=>{const _0x247b50=a97_0x5045,_0x16986b=_0x2cf25e[_0x247b50(0x272)](_0xdfa381);if(!_0x16986b)throw new SDKError(ErrorCode[_0x247b50(0x27e)],_0x247b50(0x227)+_0xdfa381+_0x247b50(0x1f7)+_0x58766+'\x27)');return _0x16986b;};}export function extractRootFolderId(_0x498e04){const _0x1c6f6b=a97_0x3d28bc;return _0x498e04['relationships']?.[_0x1c6f6b(0x219)]?.[_0x1c6f6b(0x1ce)]?.['id']||_0x498e04[_0x1c6f6b(0x201)]?.[_0x1c6f6b(0x1eb)]?.[_0x1c6f6b(0x1ce)]?.['id'];}export function buildConnectionMaps(_0x1bdd5d){const _0x454bdf=a97_0x3d28bc,_0x1ae8cd=new Map(),_0x29f08c=new Map(),_0x1f2559=new Map();for(const _0x19dca9 of _0x1bdd5d){_0x1ae8cd[_0x454bdf(0x207)](_0x19dca9[_0x454bdf(0x21b)],parseInt(_0x19dca9['id'],0xa)),_0x29f08c[_0x454bdf(0x207)](_0x19dca9['id'],_0x19dca9[_0x454bdf(0x21b)]),_0x1f2559[_0x454bdf(0x207)](_0x19dca9[_0x454bdf(0x21b)],_0x19dca9[_0x454bdf(0x203)]);}return{'nameToId':_0x1ae8cd,'idToName':_0x29f08c,'nameToType':_0x1f2559};}export function calculatePushStats(_0x2659f1,_0x2f9f06,_0x8fea58,_0x4d44fd,_0x16f61d,_0x1e0edf,_0x54435a){const _0x25f020=a97_0x3d28bc,_0xb7c6d6=_0x2659f1[_0x25f020(0x25e)](_0x3c9114=>_0x3c9114['isNew']),_0xa7b2d6=_0x2659f1[_0x25f020(0x25e)](_0x449517=>!_0x449517['isNew']&&_0x449517[_0x25f020(0x204)]),_0x1fa415=_0x2659f1[_0x25f020(0x25e)](_0x2a3aef=>!_0x2a3aef[_0x25f020(0x25b)]&&!_0x2a3aef[_0x25f020(0x204)]),_0x51cb2d=_0x1e0edf?_0x4d44fd:[],_0x241ca3=_0x2f9f06[_0x25f020(0x25e)](_0x540375=>_0x540375[_0x25f020(0x25b)]),_0x1c212e=_0x2f9f06[_0x25f020(0x25e)](_0x285cae=>!_0x285cae[_0x25f020(0x25b)]&&_0x285cae['hasChanges']),_0x269f49=_0x2f9f06[_0x25f020(0x25e)](_0x25fb37=>!_0x25fb37[_0x25f020(0x25b)]&&!_0x25fb37[_0x25f020(0x204)]),_0x78c25c=_0x1e0edf?_0x16f61d:[],_0x1d10cd=_0x2659f1[_0x25f020(0x1c6)](_0x399842=>_0x399842[_0x25f020(0x1e3)]),_0x23d46d=_0x1d10cd['filter'](_0x120260=>_0x120260[_0x25f020(0x203)]===_0x25f020(0x275)),_0x26a794=_0x1d10cd[_0x25f020(0x25e)](_0x32f27b=>_0x32f27b[_0x25f020(0x203)]===_0x25f020(0x1ff)),_0x516ecf=_0x1d10cd[_0x25f020(0x25e)](_0x519c85=>_0x519c85['type']==='delete'),_0x26a56c=Array[_0x25f020(0x24b)](_0x8fea58)[_0x25f020(0x26f)](),_0xedf3c4=_0x54435a?![]:_0xb7c6d6[_0x25f020(0x21a)]>0x0||_0xa7b2d6[_0x25f020(0x21a)]>0x0||_0x51cb2d[_0x25f020(0x21a)]>0x0,_0x12b6f5=_0x241ca3['length']>0x0||_0x1c212e[_0x25f020(0x21a)]>0x0||_0x78c25c[_0x25f020(0x21a)]>0x0,_0x5828bc=_0x54435a?![]:_0x1d10cd[_0x25f020(0x21a)]>0x0,_0x41c49d=_0x26a56c[_0x25f020(0x21a)]>0x0;return{'segments':{'new':_0xb7c6d6,'changed':_0xa7b2d6,'unchanged':_0x1fa415,'toDelete':_0x51cb2d},'journeys':{'new':_0x241ca3,'changed':_0x1c212e,'unchanged':_0x269f49,'toDelete':_0x78c25c},'activations':{'all':_0x1d10cd,'toCreate':_0x23d46d,'toUpdate':_0x26a794,'toDelete':_0x516ecf},'folders':{'toCreate':_0x26a56c},'counts':{'segments':{'new':_0xb7c6d6[_0x25f020(0x21a)],'changed':_0xa7b2d6[_0x25f020(0x21a)],'unchanged':_0x1fa415['length'],'toDelete':_0x51cb2d[_0x25f020(0x21a)]},'journeys':{'new':_0x241ca3[_0x25f020(0x21a)],'changed':_0x1c212e[_0x25f020(0x21a)],'unchanged':_0x269f49['length'],'toDelete':_0x78c25c[_0x25f020(0x21a)]},'activations':{'create':_0x23d46d[_0x25f020(0x21a)],'update':_0x26a794[_0x25f020(0x21a)],'delete':_0x516ecf[_0x25f020(0x21a)]},'folders':_0x26a56c['length']},'hasChanges':_0xedf3c4||_0x12b6f5||_0x5828bc||_0x41c49d};}export async function buildPushExecutionContext(_0xcd74b0,_0x32f498,_0x13bcfe,_0x3a64d8,_0x44f48,_0x4b5f3f){const _0x1519d4=a97_0x3d28bc,_0x46b815=extractRootFolderId(_0x13bcfe),{pathToId:_0x3b420d,idToPath:_0x4e2dc0}=buildFolderMaps(_0x44f48),_0x31f9bd=buildSegmentNameToIdMap(_0x3a64d8),_0x48e74b=new Map(),{batchAsync:_0x5618e1}=await import(_0x1519d4(0x280)),[_0xa57bc2,_0x403537]=await Promise['all']([_0xcd74b0[_0x1519d4(0x1f4)][_0x1519d4(0x1df)](),_0xcd74b0[_0x1519d4(0x20e)][_0x1519d4(0x1fd)](),((async()=>{!_0x4b5f3f&&_0x3a64d8['length']>0x0&&await _0x5618e1(_0x3a64d8,async _0x556003=>{const _0x44c419=a97_0x5045,_0x45f62c=await _0xcd74b0['segment'][_0x44c419(0x278)](_0x32f498,_0x556003['id']);_0x48e74b['set'](_0x556003['id'],_0x45f62c);});})())]),{emailToId:_0x4b52f0,idToEmail:_0x4fe410}=_0xa57bc2,_0x158e7c=buildConnectionMaps(_0x403537);return{'rootFolderId':_0x46b815,'folderPathToId':_0x3b420d,'folderIdToPath':_0x4e2dc0,'segmentNameToId':_0x31f9bd,'activationsBySegmentId':_0x48e74b,'emailToIdMap':_0x4b52f0,'idToEmailMap':_0x4fe410,'connectionNameToIdMap':_0x158e7c['nameToId'],'connectionIdToNameMap':_0x158e7c[_0x1519d4(0x24d)],'connectionNameToTypeMap':_0x158e7c[_0x1519d4(0x1d2)]};}function a97_0x1717(){const _0x5432c8=['null','ACTIVATION_UPDATE_ERROR','activation_creating','logDeleted','utf-8','buildUserMaps','slice','SEGMENT_SYNTAX_ERROR','index','activationActions','Created\x20journey\x20\x27','embedded_segment_created','6158732MBGtLg','segment_created','\x27\x20from\x20file:\x20','35VdYrSI','localSegmentRules','parentFolder','updateActivation','folderPath',').\x20','activationsBySegmentId','Deleting\x20activation\x20\x27','stringify','yamlActivation','join','user','dirname','activationParams','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','map','\x27\x20exit\x20criteria','activations','Creating\x20activation\x20\x27','Entry\x20criteria:\x20','list','./child-segment-yaml.js','update','segments','relationships','segment_updated','type','hasChanges','Created\x20folder\x20\x27','with','set','effectiveFolderId','1FYCpaX','journey_entry_criteria_','segment_creating','273yuwMXd','item','connection','has','journeyById','absolutePath','skipSegments','journeyActivationNameToId','size','idToEmailMap','embedded_activation_created','Failed\x20to\x20','activation_','parentSegmentFolder','length','name','sha1','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x27\x20not\x20found\x20in\x20journey\x20\x27','withProgress','getJourney','2365992otMGXu','createActivation','decision_point','DecisionPoint','journeyStages','embeddedSegmentNameToId','Segment\x20not\x20found:\x20','journeyActivationStepId','delete','goal','NOT_FOUND','versionNumber','find','add','Activation','goal\x20criteria','logInfo','segmentByFolderAndName','branches','existingSegments','exitCriterias','existingSegment','activation_deleting','Stage\x20\x27','segmentId','deleted','journey','existingActivation','all_columns','\x20segment\x20from\x20file:\x20','attributes','connector_config','embedded_activation_creating','activationContext','steps','connectionIdToNameMap','\x20(referenced\x20in\x20journey\x20','deleteActivation','activationStepsById','stages','segment_deleted','entry','from','Updating\x20activation\x20\x27','idToName','__pending_act_','results','Creating\x20folder\x20\x27','193400IBlhvw','toString','reduce','all','segment','fetchJourney','folder_creating','parse','folderId','validatedRequest','isNew','__pending_','folderPathToId','filter','3SMpZVm','journeyBundleName','819098mOXgqx','JOURNEY_SYNTAX_ERROR','folder_created','valid','journeyId','kind','deps','rootFolderId','45MJaAvx','ACTIVATION_SYNTAX_ERROR','updateSegmentById','2160974VpnFCi','columns','keys','sort','getActivation','existingJourney','get','unchanged','diff','create','Journey\x20\x27','split','listActivations','\x0a\x20\x20','entryCriteria','\x27...','INTERNAL','isArray','SEGMENT_NOT_FOUND','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','../../utils/async.js','progress','parentId','push','stage\x20\x27','yamlConfig','Fetching\x20','./journey-yaml.js','embedded_segment_creating','entry_criteria','activation_updated','behavior','resolveSegment','Updated\x20activation\x20\x27','\x20journey\x20from\x20file:\x20','\x27\x20entry\x20criteria','logSuccess','created','onProgress','notification','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','activation_template_id','\x20error(s)','state','createJourneySegment','SEGMENT_UPDATE_ERROR','segment_updating','description','values','getSegment','updated','activation_deleted','journeys','40uXsOvn','createdSegmentId','toLowerCase','max','parseDocument','verbose','):\x20','10188915kPWvHr','digest','startsWith','draft','Created\x20segment\x20\x27','relative','rule','flatMap','createFolder','journey_updating','Deleted\x20segment\x20\x27','segmentNameToId','segmentFolderId','activation_updating','Activation\x20not\x20found:\x20','data','\x27\x20milestone','milestone','replace','nameToType','trim','JOURNEY_UPDATE_ERROR','398796UWHytO','Created\x20activation\x20\x27','journeyBundlesByFolderAndName','object','action'];a97_0x1717=function(){return _0x5432c8;};return a97_0x1717();}export function createPushYamlContextForBundle(_0x3e3215,_0x3addfb,_0x41d28b,_0x215154,_0x203812,_0x446d9a,_0x2608b5,_0x146eb5){const {existingLocalSegmentNames:_0x3b1f84,localExpandedRuleToNames:_0x24a2c2}=_0x215154,_0x4fed05=new Set(),_0x42b196=new Map(),_0x3ac27c=new Set(),_0x1d6eb5=new Map(),_0x4fd9a6=new Map(),_0x2660d=createJumpTargetCache(),_0x3822c0=new Map(),_0x25c83d=new Map(),_0x493765=new Set();let _0x114cd3;const _0x1bf838=_0x3985e9=>{const _0x3cfc3a={'resolveSegment':async _0x103c6c=>{const _0x265153=a97_0x5045,_0x1bd65d=_0x4fd9a6[_0x265153(0x272)](_0x103c6c);if(_0x1bd65d!==undefined)return{'name':_0x1bd65d,'isJourneyLocal':!![]};try{let _0x316ffb=_0x41d28b['find'](_0x4e5871=>_0x4e5871['id']===_0x103c6c);!_0x316ffb&&(_0x316ffb=await _0x3e3215[_0x265153(0x255)]['getSegment'](_0x3addfb,_0x103c6c));const _0x1bdf57=generateJourneyLocalName(_0x316ffb[_0x265153(0x21b)]),_0x509628=_0x316ffb[_0x265153(0x266)]===SEGMENT_KIND_JOURNEY&&_0x1bdf57!==undefined;let _0xb2ff9a=_0x316ffb[_0x265153(0x21b)],_0xdbc609;if(_0x509628&&_0x316ffb[_0x265153(0x1c5)]){const _0x354a8b=apiRuleToYaml(_0x316ffb[_0x265153(0x1c5)]);_0x25c83d[_0x265153(0x207)](_0x103c6c,_0x354a8b);const _0x10b5b1=async _0x6fc638=>{const _0x4b49e5=_0x265153,_0x856210=collectSegmentRefsFromRule(_0x6fc638);for(const _0x3539a4 of _0x856210){if(!_0x25c83d['has'](_0x3539a4))try{const _0x28d3c6=await _0x3e3215['segment'][_0x4b49e5(0x29d)](_0x3addfb,_0x3539a4);if(_0x28d3c6?.[_0x4b49e5(0x1c5)]){const _0x1ed9ce=apiRuleToYaml(_0x28d3c6[_0x4b49e5(0x1c5)]);_0x25c83d[_0x4b49e5(0x207)](_0x3539a4,_0x1ed9ce),await _0x10b5b1(_0x1ed9ce);}}catch{}}};await _0x10b5b1(_0x354a8b);const _0x48366e=serializeExpandedRule(_0x354a8b,_0x25c83d),_0x13aef9=_0x24a2c2[_0x265153(0x272)](_0x48366e);if(_0x13aef9&&_0x13aef9['length']>0x0){const _0x5004d3=_0x42b196[_0x265153(0x272)](_0x48366e)||0x0,_0x99e766=_0x13aef9[_0x5004d3]||_0x13aef9[_0x13aef9[_0x265153(0x21a)]-0x1];_0x42b196[_0x265153(0x207)](_0x48366e,_0x5004d3+0x1),_0xb2ff9a=_0x99e766,_0x4fed05['add'](_0xb2ff9a),_0x4fd9a6[_0x265153(0x207)](_0x103c6c,_0xb2ff9a);const _0x33f8b4=await resolveRuleSegmentRefs(_0x354a8b,async _0xd46035=>{const _0x5939f8=_0x265153,_0x430234=_0x4fd9a6['get'](_0xd46035);if(_0x430234)return _0x430234;const _0x11cafc=await _0x114cd3[_0x5939f8(0x28c)](_0xd46035);return _0x11cafc[_0x5939f8(0x21b)];});_0xdbc609={'description':_0x316ffb[_0x265153(0x29b)],'rule':_0x33f8b4};}else{const _0x4f985f=_0x3822c0[_0x265153(0x272)](_0x48366e);if(_0x4f985f)_0xb2ff9a=_0x4f985f,_0x4fd9a6[_0x265153(0x207)](_0x103c6c,_0xb2ff9a);else{if(_0x1bdf57){let _0x518375=_0x1bdf57,_0x4226c8=0x2;while(_0x4fed05[_0x265153(0x20f)](_0x518375)||_0x3b1f84['has'](_0x518375)){_0x518375=_0x1bdf57+'_'+_0x4226c8,_0x4226c8++;}_0x4fed05[_0x265153(0x22e)](_0x518375),_0xb2ff9a=_0x518375;}_0x4fd9a6[_0x265153(0x207)](_0x103c6c,_0xb2ff9a),_0x3822c0[_0x265153(0x207)](_0x48366e,_0xb2ff9a);const _0x25ede2=await resolveRuleSegmentRefs(_0x354a8b,async _0x2f1dee=>{const _0x356b7c=_0x265153,_0x310e03=_0x4fd9a6[_0x356b7c(0x272)](_0x2f1dee);if(_0x310e03)return _0x310e03;const _0x1cc49f=await _0x114cd3[_0x356b7c(0x28c)](_0x2f1dee);return _0x1cc49f[_0x356b7c(0x21b)];});_0xdbc609={'description':_0x316ffb[_0x265153(0x29b)],'rule':_0x25ede2};}}}return{'name':_0xb2ff9a,'isJourneyLocal':_0x509628,'definition':_0xdbc609};}catch{return{'name':_0x103c6c,'isJourneyLocal':![]};}},'resolveActivation':async _0x393f3f=>{const _0x5582fe=a97_0x5045,_0x595f8d=_0x1d6eb5[_0x5582fe(0x272)](_0x393f3f);if(_0x595f8d!==undefined)return{'name':_0x595f8d,'isJourneyLocal':!![]};try{let _0x5b2a08=_0x2608b5?.[_0x5582fe(0x272)](_0x393f3f);!_0x5b2a08&&(_0x5b2a08=await _0x3e3215[_0x5582fe(0x23b)][_0x5582fe(0x270)](_0x3985e9,_0x393f3f));const _0x2d59f5=_0x5b2a08[_0x5582fe(0x23f)][_0x5582fe(0x1f6)][_0x5582fe(0x21b)]||_0x393f3f,_0x31d81b=sanitizeYamlKey(_0x2d59f5)||_0x5582fe(0x218)+_0x393f3f;let _0x48a597=_0x31d81b,_0x379ec6=0x2;while(_0x3ac27c['has'](_0x48a597)){_0x48a597=_0x31d81b+'_'+_0x379ec6,_0x379ec6++;}_0x3ac27c[_0x5582fe(0x22e)](_0x48a597),_0x1d6eb5[_0x5582fe(0x207)](_0x393f3f,_0x48a597);const _0x16544f=journeyActivationStepToYaml(_0x5b2a08,_0x203812,_0x446d9a);return{'name':_0x48a597,'isJourneyLocal':!![],'definition':_0x16544f};}catch{return{'name':_0x393f3f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x45e69b,_0x3475c9)=>resolveJumpTarget(_0x45e69b,_0x3475c9,_0x2660d,async _0x4e259f=>{const _0x4232a2=a97_0x5045,_0x3518ce=_0x146eb5?.['get'](_0x4e259f);if(_0x3518ce)return _0x3518ce;return _0x3e3215['journey'][_0x4232a2(0x220)](_0x4e259f);})};return _0x114cd3=_0x3cfc3a,_0x3cfc3a;},_0x3b5b9b=async _0x26c7b6=>{const _0x28b24f=a97_0x5045,{collectSegmentIdsFromJourneyApi:_0x3b9347}=await import('./journey-yaml.js'),{batchAsync:_0x172936}=await import(_0x28b24f(0x280)),_0xf6d005=new Set();for(const _0x2f1130 of _0x26c7b6){let _0x29f6ca=_0x146eb5?.[_0x28b24f(0x272)](_0x2f1130);!_0x29f6ca&&(_0x29f6ca=await _0x3e3215[_0x28b24f(0x23b)][_0x28b24f(0x220)](_0x2f1130));const _0x48d2c2=_0x3b9347(_0x29f6ca);for(const _0x35aef9 of _0x48d2c2){_0xf6d005[_0x28b24f(0x22e)](_0x35aef9);}}let _0x5daa88=Array[_0x28b24f(0x24b)](_0xf6d005);while(_0x5daa88['length']>0x0){const _0x3da275=_0x5daa88['filter'](_0x2a9236=>!_0x493765[_0x28b24f(0x20f)](_0x2a9236));if(_0x3da275['length']===0x0)break;const _0x2e95ed=await _0x172936(_0x3da275,async _0x2f87a9=>{const _0x25232c=_0x28b24f;_0x493765[_0x25232c(0x22e)](_0x2f87a9);let _0x306f3d=_0x41d28b[_0x25232c(0x22d)](_0x38feb3=>_0x38feb3['id']===_0x2f87a9);if(!_0x306f3d)try{_0x306f3d=await _0x3e3215['segment']['getSegment'](_0x3addfb,_0x2f87a9);}catch{return null;}return{'segmentId':_0x2f87a9,'segment':_0x306f3d};},0xa),_0x59ae1b=new Set();for(const _0x2d853b of _0x2e95ed){if(!_0x2d853b?.[_0x28b24f(0x255)]?.[_0x28b24f(0x1c5)])continue;const _0x3eaa4d=apiRuleToYaml(_0x2d853b['segment']['rule']);_0x25c83d[_0x28b24f(0x207)](_0x2d853b['segmentId'],_0x3eaa4d);const _0x5fde5d=collectSegmentRefsFromRule(_0x3eaa4d);for(const _0x574f00 of _0x5fde5d){!_0x493765[_0x28b24f(0x20f)](_0x574f00)&&_0x59ae1b[_0x28b24f(0x22e)](_0x574f00);}}_0x5daa88=Array[_0x28b24f(0x24b)](_0x59ae1b);}};return{'createYamlContext':_0x1bf838,'prefetchJourneySegments':_0x3b5b9b};}export async function executePushSegments(_0x3a1f0d,_0x2e7942,_0x15184e,_0x8e7445,_0x565751){const _0x47a7a5=a97_0x3d28bc,{segmentDefToCreateRequest:_0x49df86,segmentDefToUpdateRequest:_0x12120c}=await import(_0x47a7a5(0x1fe)),_0x591f29=_0x15184e[_0x47a7a5(0x25d)],_0xdb45fc=0x5,_0x380b89=async _0x55e22b=>{const _0x142245=_0x47a7a5,_0x47199b=_0x55e22b[_0x142245(0x1ed)]?_0x591f29['get'](_0x55e22b[_0x142245(0x1ed)]):undefined;let _0x23930b;const _0x3d1ef6={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x55e22b[_0x142245(0x25b)]){_0x565751[_0x142245(0x292)]?.({'type':_0x142245(0x20b),'name':_0x55e22b[_0x142245(0x285)]['name']});const _0x1d9ef4=_0x49df86(_0x55e22b[_0x142245(0x285)],_0x47199b),_0x3704ae=await _0x565751[_0x142245(0x21f)]('Creating\x20segment\x20\x27'+_0x55e22b[_0x142245(0x285)]['name']+_0x142245(0x27b),()=>_0x3a1f0d[_0x142245(0x255)]['createSegment'](_0x8e7445[_0x142245(0x282)],_0x1d9ef4));_0x23930b=_0x3704ae['data']['id'],_0x3d1ef6[_0x142245(0x2a2)]={'name':_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)],'id':_0x23930b},_0x565751[_0x142245(0x292)]?.({'type':_0x142245(0x1e7),'name':_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)],'segmentId':_0x23930b}),_0x565751['logSuccess']?.(_0x142245(0x1c3)+_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)]+'\x27'),_0x3d1ef6[_0x142245(0x291)]=0x1;}else{if(_0x55e22b[_0x142245(0x204)]){_0x565751[_0x142245(0x292)]?.({'type':_0x142245(0x29a),'name':_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)]});const _0x3fd1dc=_0x12120c(_0x55e22b[_0x142245(0x285)]);_0x47199b!==_0x55e22b['existingSegment']?.[_0x142245(0x1cb)]&&(_0x3fd1dc[_0x142245(0x1cb)]=_0x47199b?parseInt(_0x47199b,0xa):undefined),await _0x565751[_0x142245(0x21f)]('Updating\x20segment\x20\x27'+_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)]+_0x142245(0x27b),()=>_0x3a1f0d['segment'][_0x142245(0x26b)](_0x8e7445[_0x142245(0x282)],_0x55e22b[_0x142245(0x236)]['id'],_0x3fd1dc)),_0x23930b=_0x55e22b[_0x142245(0x236)]['id'],_0x565751[_0x142245(0x292)]?.({'type':_0x142245(0x202),'name':_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)]}),_0x565751['logSuccess']?.('Updated\x20segment\x20\x27'+_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)]+'\x27'),_0x3d1ef6[_0x142245(0x29e)]=0x1;}else _0x23930b=_0x55e22b[_0x142245(0x236)]['id'];}}catch(_0x3e89bb){const _0x5de41b=isHttp400Error(_0x3e89bb),_0x5600d9=_0x5de41b?ErrorCode[_0x142245(0x1e1)]:ErrorCode[_0x142245(0x299)],_0x396d7a=getErrorMessage(_0x3e89bb);throw new SDKError(_0x5600d9,_0x142245(0x217)+(_0x55e22b['isNew']?'create':'update')+_0x142245(0x23e)+_0x55e22b[_0x142245(0x211)]+_0x142245(0x279)+_0x396d7a,_0x3e89bb);}try{const _0x49ab7a=await syncActivationsForSegment(_0x3a1f0d,_0x8e7445[_0x142245(0x282)],_0x23930b,_0x55e22b[_0x142245(0x285)][_0x142245(0x21b)],_0x55e22b[_0x142245(0x1e3)],_0x565751,_0x55e22b[_0x142245(0x211)]);_0x3d1ef6[_0x142245(0x1fa)]=_0x49ab7a;}catch(_0x23e721){if(_0x23e721 instanceof SDKError)throw _0x23e721;throw new SDKError(ErrorCode[_0x142245(0x1db)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x55e22b['yamlConfig'][_0x142245(0x21b)]+_0x142245(0x1e8)+_0x55e22b['absolutePath']+_0x142245(0x279)+getErrorMessage(_0x23e721),_0x23e721);}return _0x3d1ef6;},_0x38e6d5=await batchAsync(_0x2e7942,_0x380b89,_0xdb45fc),_0x1ed17f={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x12e733 of _0x38e6d5){_0x1ed17f['created']+=_0x12e733['created'],_0x1ed17f['updated']+=_0x12e733[_0x47a7a5(0x29e)],_0x12e733[_0x47a7a5(0x2a2)]&&_0x1ed17f['createdSegmentIds']['set'](_0x12e733[_0x47a7a5(0x2a2)][_0x47a7a5(0x21b)],_0x12e733[_0x47a7a5(0x2a2)]['id']),_0x1ed17f['activations'][_0x47a7a5(0x291)]+=_0x12e733[_0x47a7a5(0x1fa)][_0x47a7a5(0x291)],_0x1ed17f['activations'][_0x47a7a5(0x29e)]+=_0x12e733['activations'][_0x47a7a5(0x29e)],_0x1ed17f[_0x47a7a5(0x1fa)][_0x47a7a5(0x23a)]+=_0x12e733[_0x47a7a5(0x1fa)][_0x47a7a5(0x23a)];}return _0x1ed17f;}async function syncActivationsForSegment(_0x8b5625,_0x4d86c5,_0x562f83,_0x5af39c,_0x407cb8,_0x43d1f0,_0x3ff9a6){const _0x4d1a8d=a97_0x3d28bc,_0x38070a={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x27b567 of _0x407cb8){try{if(_0x27b567['type']==='create'&&_0x27b567[_0x4d1a8d(0x25a)])_0x43d1f0['onProgress']?.({'type':_0x4d1a8d(0x1dc),'segmentName':_0x5af39c,'activationName':_0x27b567[_0x4d1a8d(0x21b)]}),await _0x43d1f0['withProgress'](_0x4d1a8d(0x1fb)+_0x27b567[_0x4d1a8d(0x21b)]+'\x27...',()=>_0x8b5625[_0x4d1a8d(0x255)]['createActivation'](_0x4d86c5,_0x562f83,_0x27b567[_0x4d1a8d(0x25a)])),_0x43d1f0[_0x4d1a8d(0x292)]?.({'type':'activation_created','segmentName':_0x5af39c,'activationName':_0x27b567[_0x4d1a8d(0x21b)]}),_0x43d1f0[_0x4d1a8d(0x290)]?.(_0x4d1a8d(0x1d6)+_0x27b567[_0x4d1a8d(0x21b)]+'\x27'),_0x38070a[_0x4d1a8d(0x291)]++;else{if(_0x27b567['type']==='update'&&_0x27b567[_0x4d1a8d(0x25a)]&&_0x27b567[_0x4d1a8d(0x23c)])_0x43d1f0[_0x4d1a8d(0x292)]?.({'type':_0x4d1a8d(0x1cc),'segmentName':_0x5af39c,'activationName':_0x27b567[_0x4d1a8d(0x21b)]}),await _0x43d1f0[_0x4d1a8d(0x21f)](_0x4d1a8d(0x24c)+_0x27b567[_0x4d1a8d(0x21b)]+_0x4d1a8d(0x27b),()=>_0x8b5625[_0x4d1a8d(0x255)][_0x4d1a8d(0x1ec)](_0x4d86c5,_0x562f83,_0x27b567[_0x4d1a8d(0x23c)]['id'],_0x27b567[_0x4d1a8d(0x25a)])),_0x43d1f0[_0x4d1a8d(0x292)]?.({'type':_0x4d1a8d(0x28a),'segmentName':_0x5af39c,'activationName':_0x27b567['name']}),_0x43d1f0[_0x4d1a8d(0x290)]?.(_0x4d1a8d(0x28d)+_0x27b567[_0x4d1a8d(0x21b)]+'\x27'),_0x38070a[_0x4d1a8d(0x29e)]++;else _0x27b567['type']===_0x4d1a8d(0x229)&&_0x27b567['existingActivation']&&(_0x43d1f0[_0x4d1a8d(0x292)]?.({'type':_0x4d1a8d(0x237),'segmentName':_0x5af39c,'activationName':_0x27b567[_0x4d1a8d(0x21b)]}),await _0x43d1f0[_0x4d1a8d(0x21f)](_0x4d1a8d(0x1f0)+_0x27b567['name']+_0x4d1a8d(0x27b),()=>_0x8b5625[_0x4d1a8d(0x255)][_0x4d1a8d(0x246)](_0x4d86c5,_0x562f83,_0x27b567[_0x4d1a8d(0x23c)]['id'])),_0x43d1f0['onProgress']?.({'type':_0x4d1a8d(0x29f),'segmentName':_0x5af39c,'activationName':_0x27b567['name']}),_0x43d1f0[_0x4d1a8d(0x1dd)]?.('Deleted\x20activation\x20\x27'+_0x27b567[_0x4d1a8d(0x21b)]+'\x27'),_0x38070a[_0x4d1a8d(0x23a)]++);}}catch(_0x118483){const _0x53d13e=isHttp400Error(_0x118483),_0x5196c2=_0x53d13e?ErrorCode[_0x4d1a8d(0x26a)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x5619fd=getErrorMessage(_0x118483);throw new SDKError(_0x5196c2,_0x4d1a8d(0x217)+_0x27b567[_0x4d1a8d(0x203)]+'\x20activation\x20\x27'+_0x27b567[_0x4d1a8d(0x21b)]+_0x4d1a8d(0x1e8)+_0x3ff9a6+_0x4d1a8d(0x279)+_0x5619fd,_0x118483);}}return _0x38070a;}export async function executePushFolders(_0x2c700d,_0x265542,_0x5412e0,_0x4575ed,_0x1d3228){const _0x47f06e=a97_0x3d28bc,_0x4a1350=new Map(_0x5412e0);for(const _0x4e80b7 of _0x265542){const _0x5687d3=_0x4e80b7[_0x47f06e(0x277)]('/'),_0x5176d2=_0x5687d3[_0x5687d3[_0x47f06e(0x21a)]-0x1],_0x5a58a7=_0x5687d3['slice'](0x0,-0x1)[_0x47f06e(0x1f3)]('/'),_0x136e9b=_0x4a1350[_0x47f06e(0x272)](_0x5a58a7);_0x1d3228['onProgress']?.({'type':_0x47f06e(0x257),'folder':_0x4e80b7});const _0x199417={'name':_0x5176d2,'parentFolderId':_0x136e9b},_0x4abca5=await _0x1d3228[_0x47f06e(0x21f)](_0x47f06e(0x250)+_0x4e80b7+'\x27...',()=>_0x2c700d['segment'][_0x47f06e(0x1c7)](_0x4575ed['parentId'],_0x199417));_0x4a1350[_0x47f06e(0x207)](_0x4e80b7,_0x4abca5[_0x47f06e(0x1ce)]['id']),_0x1d3228[_0x47f06e(0x292)]?.({'type':_0x47f06e(0x263),'folder':_0x4e80b7,'folderId':_0x4abca5[_0x47f06e(0x1ce)]['id']}),_0x1d3228[_0x47f06e(0x231)]?.(_0x47f06e(0x205)+_0x4e80b7+'\x27');}return _0x4a1350;}export async function executePushSegmentDeletions(_0x3d6139,_0x12c14c,_0x40fe89){const _0x844fcf=a97_0x3d28bc;if(_0x12c14c[_0x844fcf(0x21a)]===0x0)return 0x0;const {batchAsync:_0x316cce}=await import('../../utils/async.js'),_0x235e89=0x5,_0x4c561c=await _0x316cce(_0x12c14c,async _0x26b9d0=>{const _0xee21d1=_0x844fcf;return _0x40fe89[_0xee21d1(0x292)]?.({'type':'segment_deleting','name':_0x26b9d0[_0xee21d1(0x21b)]}),await _0x3d6139[_0xee21d1(0x255)]['deleteSegment'](_0x26b9d0['id']),_0x40fe89[_0xee21d1(0x292)]?.({'type':_0xee21d1(0x249),'name':_0x26b9d0[_0xee21d1(0x21b)]}),_0x40fe89[_0xee21d1(0x1dd)]?.(_0xee21d1(0x1c9)+_0x26b9d0[_0xee21d1(0x21b)]+'\x27'),0x1;},_0x235e89);return _0x4c561c[_0x844fcf(0x253)]((_0x3e08db,_0x554402)=>_0x3e08db+_0x554402,0x0);}export async function executePushJourneys(_0xeb8a8,_0x57f2a1,_0x3fd302,_0xfd0e86,_0x3d1848){const _0x5004f8=a97_0x3d28bc,{journeyDefToRequest:_0x445336}=await import(_0x5004f8(0x287)),{activationDefToCreateRequest:_0x2ba15b,yamlRuleToApi:_0x14dfa0,validateSegmentRule:_0x45c814}=await import(_0x5004f8(0x1fe)),_0x439da5={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x77cb56=new Map(_0x3fd302[_0x5004f8(0x1ca)]),_0x51d8e6=0x5;for(let _0x50d672=0x0;_0x50d672<_0x57f2a1[_0x5004f8(0x21a)];_0x50d672+=_0x51d8e6){const _0x2e985a=_0x57f2a1['slice'](_0x50d672,_0x50d672+_0x51d8e6),_0x363d25=await Promise[_0x5004f8(0x254)](_0x2e985a[_0x5004f8(0x1f8)](async _0x18f2de=>{const _0x1e0102=_0x5004f8;if(!_0x18f2de[_0x1e0102(0x25b)]&&!_0x18f2de[_0x1e0102(0x204)])return{'action':'unchanged','name':_0x18f2de['yamlConfig'][_0x1e0102(0x21b)],'journeyId':_0x18f2de[_0x1e0102(0x271)]?.['id']};const _0x4f7e50=_0x18f2de[_0x1e0102(0x1ed)]?_0x3fd302[_0x1e0102(0x25d)][_0x1e0102(0x272)](_0x18f2de['folderPath']):undefined;_0x3d1848[_0x1e0102(0x292)]?.({'type':_0x18f2de[_0x1e0102(0x25b)]?'journey_creating':_0x1e0102(0x1c8),'name':_0x18f2de[_0x1e0102(0x285)]['name']});try{const _0xf4cd9b=await executeSingleJourneyPush(_0xeb8a8,_0x18f2de,{..._0x3fd302,'segmentNameToId':_0x77cb56},{'parentId':_0xfd0e86[_0x1e0102(0x282)],'rootFolderId':_0xfd0e86[_0x1e0102(0x268)],'folderId':_0x4f7e50,'verbose':_0xfd0e86[_0x1e0102(0x2a6)]},_0x3d1848,{'journeyDefToRequest':_0x445336,'activationDefToCreateRequest':_0x2ba15b,'yamlRuleToApi':_0x14dfa0,'validateSegmentRule':_0x45c814});for(const [_0x4fb75d,_0x5deddb]of _0xf4cd9b[_0x1e0102(0x226)]){_0x77cb56[_0x1e0102(0x207)](_0x4fb75d,_0x5deddb),_0x439da5[_0x1e0102(0x226)][_0x1e0102(0x207)](_0x4fb75d,_0x5deddb);}if(_0xf4cd9b[_0x1e0102(0x1d9)]===_0x1e0102(0x291))_0x3d1848[_0x1e0102(0x292)]?.({'type':'journey_created','name':_0x18f2de[_0x1e0102(0x285)]['name'],'journeyId':_0xf4cd9b[_0x1e0102(0x265)]}),_0x3d1848[_0x1e0102(0x290)]?.(_0x1e0102(0x1e4)+_0x18f2de[_0x1e0102(0x285)][_0x1e0102(0x21b)]+'\x27'),_0x439da5[_0x1e0102(0x291)]++;else _0xf4cd9b[_0x1e0102(0x1d9)]===_0x1e0102(0x29e)&&(_0x3d1848['onProgress']?.({'type':'journey_updated','name':_0x18f2de[_0x1e0102(0x285)][_0x1e0102(0x21b)]}),_0x3d1848['logSuccess']?.('Updated\x20journey\x20\x27'+_0x18f2de[_0x1e0102(0x285)][_0x1e0102(0x21b)]+'\x27'),_0x439da5['updated']++);return{'action':_0xf4cd9b[_0x1e0102(0x1d9)],'name':_0x18f2de[_0x1e0102(0x285)]['name'],'journeyId':_0xf4cd9b[_0x1e0102(0x265)]};}catch(_0x2b7a78){const _0x46ad1f=isHttp400Error(_0x2b7a78),_0x456dce=_0x46ad1f?ErrorCode[_0x1e0102(0x262)]:ErrorCode[_0x1e0102(0x1d4)],_0x35db3d=getErrorMessage(_0x2b7a78);throw new SDKError(_0x456dce,_0x1e0102(0x217)+(_0x18f2de[_0x1e0102(0x25b)]?_0x1e0102(0x275):'update')+_0x1e0102(0x28e)+_0x18f2de[_0x1e0102(0x211)]+_0x1e0102(0x279)+_0x35db3d,_0x2b7a78);}}));_0x439da5[_0x5004f8(0x24f)][_0x5004f8(0x283)](..._0x363d25);}return _0x439da5;}async function executeSingleJourneyPush(_0x2ee861,_0x56c9d3,_0x58f740,_0x3bd836,_0x5dd730,_0x12445d){const _0x25784f=a97_0x3d28bc,{journeyDefToRequest:_0x1c7104,activationDefToCreateRequest:_0x5c5934,yamlRuleToApi:_0x22d030,validateSegmentRule:_0x4f7fa9}=_0x12445d,_0x3f163e=new Map(),_0x29a497=new Map(),_0x59e8cc=new Map(),_0x4b55b8=new Map(),_0x4c64b6=new Map();let _0x13cc0b;const _0x2bd043=async()=>{const _0x17893=a97_0x5045;if(_0x13cc0b)return;_0x13cc0b=new Map();if(!_0x56c9d3[_0x17893(0x271)])return;const _0x3e2819=await _0x2ee861[_0x17893(0x23b)][_0x17893(0x278)](_0x56c9d3[_0x17893(0x271)]['id']);for(const _0x32a989 of _0x3e2819){const _0x5a6fb2=journeyActivationStepToYaml(_0x32a989,_0x58f740[_0x17893(0x215)],_0x58f740[_0x17893(0x244)]),_0x1da9d6=activationSignature(_0x5a6fb2);!_0x13cc0b[_0x17893(0x20f)](_0x1da9d6)&&_0x13cc0b[_0x17893(0x207)](_0x1da9d6,_0x32a989['id']),_0x5a6fb2[_0x17893(0x21b)]&&_0x29a497['set'](_0x5a6fb2[_0x17893(0x21b)],_0x32a989['id']);}};if(_0x56c9d3[_0x25784f(0x271)]&&_0x56c9d3[_0x25784f(0x285)][_0x25784f(0x200)]){const _0x48e0f8=buildLocalExpandedRuleMappings(_0x56c9d3[_0x25784f(0x285)]),_0x4fbb12=_0x48e0f8[_0x25784f(0x1ea)];if(_0x4fbb12[_0x25784f(0x214)]>0x0){const _0x297cb1=new Map();for(const [_0x4c404d,_0x3fadbc]of _0x4fbb12){const _0x531f01=serializeExpandedRule(_0x3fadbc,_0x4fbb12);_0x297cb1[_0x25784f(0x207)](_0x4c404d,_0x531f01);}const _0xdbe714=collectSegmentIdsFromJourneyApi(_0x56c9d3[_0x25784f(0x271)]);if(_0xdbe714[_0x25784f(0x214)]>0x0){const _0xc0a3ac=await buildServerSegmentRuleMap(_0x2ee861,_0x3bd836['parentId'],_0x58f740[_0x25784f(0x234)],_0xdbe714);if(_0xc0a3ac[_0x25784f(0x214)]>0x0){const _0x5c40d2=new Map();for(const [_0x463aa1,_0x4a9016]of _0xc0a3ac){const _0xa130e3=serializeExpandedRule(_0x4a9016,_0xc0a3ac);!_0x5c40d2['has'](_0xa130e3)&&_0x5c40d2[_0x25784f(0x207)](_0xa130e3,_0x463aa1);}for(const [_0x57fb96,_0x46ea18]of _0x297cb1){const _0x2d7b5e=_0x5c40d2['get'](_0x46ea18);_0x2d7b5e&&(_0x4c64b6[_0x25784f(0x207)](_0x57fb96,_0x2d7b5e),_0x58f740[_0x25784f(0x1ca)][_0x25784f(0x207)](_0x57fb96,_0x2d7b5e));}}}}}const _0x5385d4={'resolveSegmentId':async _0x4a1e65=>{const _0x1ba64b=_0x25784f,_0x2881fe=_0x58f740['segmentNameToId'][_0x1ba64b(0x272)](_0x4a1e65);if(!_0x2881fe)throw new SDKError(ErrorCode[_0x1ba64b(0x27e)],'Segment\x20not\x20found:\x20'+_0x4a1e65+_0x1ba64b(0x245)+_0x56c9d3[_0x1ba64b(0x285)][_0x1ba64b(0x21b)]+')');return _0x2881fe;},'resolveEmbeddedSegmentId':async(_0xabeac3,_0x1af8ce)=>{const _0xd0cf83=_0x25784f,_0x3981d9=_0x58f740['segmentNameToId'][_0xd0cf83(0x272)](_0xabeac3);if(_0x3981d9)return _0x3981d9;const _0x3b009e=_0x4c64b6[_0xd0cf83(0x272)](_0xabeac3);if(_0x3b009e)return _0x58f740['segmentNameToId'][_0xd0cf83(0x207)](_0xabeac3,_0x3b009e),_0x3b009e;const _0x5f3dd2=_0x58f740[_0xd0cf83(0x234)][_0xd0cf83(0x22d)](_0x33f6dc=>_0x33f6dc[_0xd0cf83(0x21b)]===_0xabeac3);if(_0x5f3dd2)return _0x58f740[_0xd0cf83(0x1ca)]['set'](_0xabeac3,_0x5f3dd2['id']),_0x5f3dd2['id'];if(_0x56c9d3[_0xd0cf83(0x25b)]){const {stageName:_0x48d161,criteriaName:_0x4c11ca}=findSegmentCriteriaLocation(_0x56c9d3[_0xd0cf83(0x285)],_0xabeac3);return _0x4f7fa9(_0xabeac3,_0x1af8ce[_0xd0cf83(0x1c5)]),_0x59e8cc[_0xd0cf83(0x207)](_0xabeac3,{'definition':_0x1af8ce,'stageName':_0x48d161,'criteriaName':_0x4c11ca}),createPendingSegmentId(_0xabeac3);}const _0x3b3311=_0x56c9d3[_0xd0cf83(0x271)]?.['id'];if(!_0x3b3311)throw new SDKError(ErrorCode['INTERNAL'],_0xd0cf83(0x21d));_0x4f7fa9(_0xabeac3,_0x1af8ce['rule']);const _0x205c93=generateDeterministicJourneySegmentName(_0x56c9d3[_0xd0cf83(0x285)][_0xd0cf83(0x21b)],_0xabeac3),_0x58b143=createSegmentIdResolver(_0x58f740['segmentNameToId'],_0xabeac3),_0x4e375a=await resolveRuleSegmentIds(_0x1af8ce[_0xd0cf83(0x1c5)],_0x58b143),_0x387bd1=await _0x2ee861[_0xd0cf83(0x255)][_0xd0cf83(0x298)]({'name':_0x205c93,'description':_0x1af8ce[_0xd0cf83(0x29b)]||_0xd0cf83(0x1fc)+_0xabeac3,'journeyId':_0x3b3311,'rule':_0x22d030(_0x4e375a,!![]),'countPopulation':!![],'parentFolderId':_0x3bd836['rootFolderId']||'','audienceId':_0x3bd836['parentId']});return _0x58f740[_0xd0cf83(0x1ca)][_0xd0cf83(0x207)](_0xabeac3,_0x387bd1),_0x3f163e[_0xd0cf83(0x207)](_0xabeac3,_0x387bd1),_0x387bd1;},'resolveActivationId':async _0x4b08eb=>{const _0x1a3a34=_0x25784f,_0x23fc63=_0x29a497[_0x1a3a34(0x272)](_0x4b08eb);if(_0x23fc63)return _0x23fc63;if(_0x56c9d3[_0x1a3a34(0x271)]){await _0x2bd043();const _0x371a3a=_0x29a497[_0x1a3a34(0x272)](_0x4b08eb);if(_0x371a3a)return _0x371a3a;}throw new SDKError(ErrorCode[_0x1a3a34(0x22b)],_0x1a3a34(0x1cd)+_0x4b08eb+_0x1a3a34(0x245)+_0x56c9d3['yamlConfig'][_0x1a3a34(0x21b)]+_0x1a3a34(0x1ee)+_0x1a3a34(0x27f));},'resolveEmbeddedActivationId':async(_0xf1ce68,_0xd0c650)=>{const _0x261155=_0x25784f,_0x5045e1=_0x29a497['get'](_0xf1ce68);if(_0x5045e1)return _0x5045e1;if(_0x56c9d3[_0x261155(0x25b)])return _0x4b55b8[_0x261155(0x207)](_0xf1ce68,_0xd0c650),createPendingActivationId(_0xf1ce68);if(_0x56c9d3['existingJourney']){await _0x2bd043();const _0x35d2f7=_0x29a497['get'](_0xd0c650[_0x261155(0x21b)]);if(_0x35d2f7)return _0x29a497[_0x261155(0x207)](_0xf1ce68,_0x35d2f7),_0x35d2f7;const _0x3cef97=activationSignature(_0xd0c650),_0x32e412=_0x13cc0b?.['get'](_0x3cef97);if(_0x32e412)return _0x29a497[_0x261155(0x207)](_0xf1ce68,_0x32e412),_0x32e412;const _0x3558ff=await _0x5c5934(_0xd0c650,_0x58f740['activationContext']),_0x34caa2=await _0x2ee861[_0x261155(0x23b)][_0x261155(0x222)](_0x56c9d3['existingJourney']['id'],_0x3558ff);return _0x29a497[_0x261155(0x207)](_0xf1ce68,_0x34caa2['id']),_0x34caa2['id'];}throw new SDKError(ErrorCode[_0x261155(0x27c)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x2cfa86=>{const _0x36b584=_0x25784f;try{return await _0x2ee861[_0x36b584(0x23b)]['resolveJourneyId'](_0x3bd836['parentId'],_0x2cfa86);}catch(_0x133149){throw new SDKError(ErrorCode[_0x36b584(0x22b)],_0x36b584(0x276)+_0x2cfa86+_0x36b584(0x294)+_0x56c9d3['yamlConfig'][_0x36b584(0x21b)]+'\x27)',_0x133149);}},'resolveStageId':async(_0x1db3cb,_0x29679c)=>{const _0x3cd552=_0x25784f,_0x4869c6=await _0x2ee861[_0x3cd552(0x23b)][_0x3cd552(0x220)](_0x1db3cb),_0xefc0e=_0x4869c6['attributes'][_0x3cd552(0x225)][_0x3cd552(0x22d)](_0x2ee1ae=>_0x2ee1ae[_0x3cd552(0x21b)][_0x3cd552(0x2a3)]()===_0x29679c[_0x3cd552(0x2a3)]());if(!_0xefc0e?.['id'])throw new SDKError(ErrorCode[_0x3cd552(0x22b)],_0x3cd552(0x238)+_0x29679c+_0x3cd552(0x21e)+(_0x4869c6[_0x3cd552(0x23f)][_0x3cd552(0x260)]||_0x4869c6[_0x3cd552(0x23f)][_0x3cd552(0x21b)])+'\x27');return _0xefc0e['id'];}},_0x5e784a=await _0x1c7104(_0x56c9d3[_0x25784f(0x285)],_0x3bd836[_0x25784f(0x282)],_0x5385d4),_0xc9cfd5=_0x3bd836[_0x25784f(0x259)]||_0x3bd836[_0x25784f(0x268)];_0xc9cfd5&&(_0x5e784a[_0x25784f(0x201)]={'parentFolder':{'data':{'id':_0xc9cfd5,'type':'folder'}}});if(_0x56c9d3[_0x25784f(0x25b)]){if(_0x59e8cc[_0x25784f(0x214)]>0x0||_0x4b55b8['size']>0x0)return await executeThreeStepJourneyCreate(_0x2ee861,_0x56c9d3,_0x5e784a,{'pendingEmbeddedSegments':_0x59e8cc,'pendingEmbeddedActivations':_0x4b55b8,'embeddedSegmentNameToId':_0x3f163e,'journeyActivationNameToId':_0x29a497},{..._0x3bd836,'effectiveFolderId':_0xc9cfd5},_0x58f740,_0x5dd730,_0x12445d);else{ensureJourneyDefaults(_0x5e784a[_0x25784f(0x23f)]);const _0x563786=await _0x2ee861[_0x25784f(0x23b)][_0x25784f(0x275)](_0x5e784a);return{'action':_0x25784f(0x291),'journeyId':_0x563786['id'],'embeddedSegmentNameToId':_0x3f163e};}}else{if(_0x56c9d3[_0x25784f(0x204)]&&_0x56c9d3[_0x25784f(0x271)])return ensureJourneyDefaults(_0x5e784a[_0x25784f(0x23f)]),await _0x2ee861[_0x25784f(0x23b)]['update'](_0x56c9d3[_0x25784f(0x271)]['id'],_0x5e784a),{'action':'updated','journeyId':_0x56c9d3['existingJourney']['id'],'embeddedSegmentNameToId':_0x3f163e};}return{'action':_0x25784f(0x273),'journeyId':_0x56c9d3['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x3f163e};}function findSegmentCriteriaLocation(_0x169ab6,_0x157d85){const _0x4410fb=a97_0x3d28bc,_0x4e1d9f=_0x169ab6[_0x4410fb(0x248)]||_0x169ab6[_0x4410fb(0x2a0)]?.[0x0]?.[_0x4410fb(0x248)]||[];let _0xfd98c0=_0x4410fb(0x24a),_0xac7e7f=_0x157d85;const _0x32b27f=_0x169ab6[_0x4410fb(0x22a)]||_0x169ab6[_0x4410fb(0x2a0)]?.[0x0]?.['goal'];if(_0x32b27f?.['segment']===_0x157d85)return{'stageName':_0x4410fb(0x22a),'criteriaName':_0x32b27f['name']||_0x157d85};_0x5df442:for(const _0x449342 of _0x4e1d9f){if(_0x449342[_0x4410fb(0x289)]?.[_0x4410fb(0x255)]===_0x157d85){_0xfd98c0=_0x449342[_0x4410fb(0x21b)],_0xac7e7f=_0x449342[_0x4410fb(0x289)][_0x4410fb(0x21b)]||_0x157d85;break;}if(_0x449342[_0x4410fb(0x243)])for(const _0x53438c of _0x449342[_0x4410fb(0x243)]){if(_0x53438c[_0x4410fb(0x203)]===_0x4410fb(0x223)&&_0x53438c[_0x4410fb(0x206)]?.[_0x4410fb(0x233)])for(const _0x5f16b3 of _0x53438c[_0x4410fb(0x206)][_0x4410fb(0x233)]){if(_0x5f16b3['segment']===_0x157d85){_0xfd98c0=_0x449342['name'],_0xac7e7f=_0x5f16b3['name']||_0x157d85;break _0x5df442;}}}}return{'stageName':_0xfd98c0,'criteriaName':_0xac7e7f};}async function executeThreeStepJourneyCreate(_0x5599e9,_0x2c3487,_0x106657,_0x355ce9,_0x5cb817,_0x1a4f43,_0x3660b9,_0x3d173a){const _0x40885f=a97_0x3d28bc,{activationDefToCreateRequest:_0x43e402,yamlRuleToApi:_0x4cde81}=_0x3d173a,{pendingEmbeddedSegments:_0x40abbb,pendingEmbeddedActivations:_0x4429c7,embeddedSegmentNameToId:_0x2803a4}=_0x355ce9,_0x416233=JSON[_0x40885f(0x258)](JSON[_0x40885f(0x1f1)](_0x106657));ensureJourneyDefaults(_0x416233[_0x40885f(0x23f)]),stripPendingIds(_0x416233);const _0x4fa92f=await _0x5599e9['journey'][_0x40885f(0x275)](_0x416233),_0x5bbb5c=_0x4fa92f['id'],_0x22a7ff=new Map();for(const _0x502e31 of _0x4fa92f['attributes'][_0x40885f(0x225)]){_0x22a7ff[_0x40885f(0x207)](_0x502e31[_0x40885f(0x21b)]['toLowerCase'](),_0x502e31['id']);}for(const [_0x418876,{definition:_0x34ba93}]of _0x40abbb){const _0x46fca9=generateDeterministicJourneySegmentName(_0x2c3487[_0x40885f(0x285)][_0x40885f(0x21b)],_0x418876);_0x3660b9[_0x40885f(0x292)]?.({'type':_0x40885f(0x288),'journeyName':_0x2c3487[_0x40885f(0x285)][_0x40885f(0x21b)],'segmentName':_0x418876});const _0x52a463=createSegmentIdResolver(_0x1a4f43[_0x40885f(0x1ca)],_0x418876),_0x560453=await resolveRuleSegmentIds(_0x34ba93[_0x40885f(0x1c5)],_0x52a463),_0x485f69=await _0x5599e9[_0x40885f(0x255)][_0x40885f(0x298)]({'name':_0x46fca9,'description':_0x34ba93[_0x40885f(0x29b)]||_0x40885f(0x1fc)+_0x418876,'journeyId':_0x5bbb5c,'rule':_0x4cde81(_0x560453,!![]),'countPopulation':!![],'parentFolderId':_0x5cb817[_0x40885f(0x208)]||'','audienceId':_0x5cb817[_0x40885f(0x282)]});_0x2803a4['set'](_0x418876,_0x485f69),_0x1a4f43[_0x40885f(0x1ca)][_0x40885f(0x207)](_0x418876,_0x485f69),_0x3660b9[_0x40885f(0x292)]?.({'type':_0x40885f(0x1e5),'journeyName':_0x2c3487[_0x40885f(0x285)]['name'],'segmentName':_0x418876});}const _0x130d89=new Map();for(const [_0x87e790,_0x23ff4c]of _0x4429c7){_0x3660b9[_0x40885f(0x292)]?.({'type':_0x40885f(0x241),'journeyName':_0x2c3487['yamlConfig'][_0x40885f(0x21b)],'activationName':_0x87e790});const _0x1a5129=await _0x43e402(_0x23ff4c,_0x1a4f43[_0x40885f(0x242)]),_0x383ee2=await _0x5599e9[_0x40885f(0x23b)][_0x40885f(0x222)](_0x5bbb5c,_0x1a5129);_0x130d89['set'](_0x87e790,_0x383ee2['id']),_0x355ce9[_0x40885f(0x213)][_0x40885f(0x207)](_0x87e790,_0x383ee2['id']),_0x3660b9['onProgress']?.({'type':_0x40885f(0x216),'journeyName':_0x2c3487[_0x40885f(0x285)]['name'],'activationName':_0x87e790});}const _0x581d0d=JSON[_0x40885f(0x258)](JSON[_0x40885f(0x1f1)](_0x106657));return _0x581d0d['id']=_0x5bbb5c,ensureJourneyDefaults(_0x581d0d[_0x40885f(0x23f)]),resolvePendingIdsInRequest(_0x581d0d,_0x106657,_0x22a7ff,_0x2803a4,_0x130d89,_0x3660b9),await _0x5599e9[_0x40885f(0x23b)][_0x40885f(0x1ff)](_0x5bbb5c,_0x581d0d),{'action':_0x40885f(0x291),'journeyId':_0x5bbb5c,'embeddedSegmentNameToId':_0x2803a4};}function stripPendingIds(_0x5ec8d5){const _0x2773d3=a97_0x3d28bc;for(const _0x2aeb90 of _0x5ec8d5[_0x2773d3(0x23f)][_0x2773d3(0x225)]||[]){_0x2aeb90[_0x2773d3(0x27a)]?.['segmentId']&&isPendingSegmentId(_0x2aeb90[_0x2773d3(0x27a)][_0x2773d3(0x239)])&&delete _0x2aeb90[_0x2773d3(0x27a)];if(_0x2aeb90['steps'])for(const _0x1140a1 of Object[_0x2773d3(0x26e)](_0x2aeb90['steps'])){const _0x4d8790=_0x2aeb90['steps'][_0x1140a1];_0x4d8790[_0x2773d3(0x203)]==='Activation'&&_0x4d8790[_0x2773d3(0x228)]&&isPendingActivationId(_0x4d8790[_0x2773d3(0x228)])&&(_0x4d8790[_0x2773d3(0x228)]='');if(_0x4d8790[_0x2773d3(0x203)]==='DecisionPoint'&&_0x4d8790[_0x2773d3(0x233)])for(const _0x54fe58 of _0x4d8790[_0x2773d3(0x233)]){_0x54fe58[_0x2773d3(0x239)]&&isPendingSegmentId(_0x54fe58[_0x2773d3(0x239)])&&(_0x54fe58[_0x2773d3(0x239)]='');}}}}function resolvePendingIdsInRequest(_0x366bcc,_0x12e6be,_0x4e60fe,_0x2d1e31,_0x15dd30,_0x137848){const _0x2f948b=a97_0x3d28bc,_0x37b22e=(_0x11e5f0,_0x4088d5)=>{if(!isPendingSegmentId(_0x11e5f0))return _0x11e5f0;const _0x128ebe=extractPendingSegmentName(_0x11e5f0),_0x5af7df=_0x2d1e31['get'](_0x128ebe);return!_0x5af7df&&_0x137848['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x128ebe+'\x27\x20for\x20'+_0x4088d5),_0x5af7df;};if(_0x366bcc[_0x2f948b(0x23f)][_0x2f948b(0x22a)]?.[_0x2f948b(0x239)]&&isPendingSegmentId(_0x366bcc[_0x2f948b(0x23f)][_0x2f948b(0x22a)][_0x2f948b(0x239)])){const _0x1ce30e=_0x37b22e(_0x366bcc['attributes']['goal'][_0x2f948b(0x239)],_0x2f948b(0x230));_0x1ce30e&&(_0x366bcc[_0x2f948b(0x23f)][_0x2f948b(0x22a)]['segmentId']=_0x1ce30e);}for(const _0x4006e4 of _0x366bcc[_0x2f948b(0x23f)][_0x2f948b(0x225)]||[]){const _0x5f1c27=_0x4e60fe['get'](_0x4006e4[_0x2f948b(0x21b)]['toLowerCase']());_0x5f1c27&&(_0x4006e4['id']=_0x5f1c27);if(_0x4006e4[_0x2f948b(0x27a)]?.[_0x2f948b(0x239)]&&isPendingSegmentId(_0x4006e4['entryCriteria']['segmentId'])){const _0x2fb2bf=_0x37b22e(_0x4006e4[_0x2f948b(0x27a)][_0x2f948b(0x239)],_0x2f948b(0x284)+_0x4006e4[_0x2f948b(0x21b)]+_0x2f948b(0x28f));_0x2fb2bf&&(_0x4006e4[_0x2f948b(0x27a)]['segmentId']=_0x2fb2bf);}if(_0x4006e4['exitCriterias'])for(const _0x39a8d2 of _0x4006e4[_0x2f948b(0x235)]){if(_0x39a8d2['segmentId']&&isPendingSegmentId(_0x39a8d2[_0x2f948b(0x239)])){const _0x76d465=_0x37b22e(_0x39a8d2[_0x2f948b(0x239)],_0x2f948b(0x284)+_0x4006e4['name']+_0x2f948b(0x1f9));_0x76d465&&(_0x39a8d2[_0x2f948b(0x239)]=_0x76d465);}}if(_0x4006e4[_0x2f948b(0x1d0)]?.[_0x2f948b(0x239)]&&isPendingSegmentId(_0x4006e4[_0x2f948b(0x1d0)][_0x2f948b(0x239)])){const _0x565037=_0x37b22e(_0x4006e4[_0x2f948b(0x1d0)][_0x2f948b(0x239)],_0x2f948b(0x284)+_0x4006e4['name']+_0x2f948b(0x1cf));_0x565037&&(_0x4006e4[_0x2f948b(0x1d0)][_0x2f948b(0x239)]=_0x565037);}if(_0x4006e4[_0x2f948b(0x243)]){const _0x2ad4a8=_0x2146ad=>_0x12e6be[_0x2f948b(0x23f)]['journeyStages'][_0x2f948b(0x22d)](_0x52d0d7=>_0x52d0d7[_0x2f948b(0x21b)][_0x2f948b(0x2a3)]()===_0x4006e4[_0x2f948b(0x21b)]['toLowerCase']())?.['steps']?.[_0x2146ad];for(const _0x99a6b6 of Object[_0x2f948b(0x26e)](_0x4006e4[_0x2f948b(0x243)])){const _0x2e1443=_0x4006e4[_0x2f948b(0x243)][_0x99a6b6],_0x39fe93=_0x2ad4a8(_0x99a6b6);if(_0x2e1443[_0x2f948b(0x203)]===_0x2f948b(0x22f)&&_0x2e1443[_0x2f948b(0x228)]&&(isPendingActivationId(_0x2e1443[_0x2f948b(0x228)])||_0x2e1443[_0x2f948b(0x228)]==='')){if(_0x39fe93?.[_0x2f948b(0x228)]&&isPendingActivationId(_0x39fe93[_0x2f948b(0x228)])){const _0x643cb=extractPendingActivationName(_0x39fe93[_0x2f948b(0x228)]),_0x16826a=_0x15dd30['get'](_0x643cb);_0x16826a&&(_0x2e1443[_0x2f948b(0x228)]=_0x16826a);}}if(_0x2e1443[_0x2f948b(0x203)]===_0x2f948b(0x224)&&_0x2e1443['branches']&&_0x39fe93?.[_0x2f948b(0x233)])for(let _0x3f735b=0x0;_0x3f735b<_0x2e1443['branches']['length'];_0x3f735b++){const _0x4003f5=_0x2e1443[_0x2f948b(0x233)][_0x3f735b],_0x141a13=_0x39fe93[_0x2f948b(0x233)][_0x3f735b];if(_0x141a13?.['segmentId']&&isPendingSegmentId(_0x141a13[_0x2f948b(0x239)])){const _0x17ff2d=_0x37b22e(_0x141a13[_0x2f948b(0x239)],'stage\x20\x27'+_0x4006e4[_0x2f948b(0x21b)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x4003f5[_0x2f948b(0x21b)]||_0x3f735b)+'\x27');_0x17ff2d&&(_0x4003f5[_0x2f948b(0x239)]=_0x17ff2d);}}}}}}
|
|
1
|
+
const a97_0x1ead5a=a97_0x5c6b;(function(_0x43da72,_0x506b8d){const _0x220327=a97_0x5c6b,_0x535949=_0x43da72();while(!![]){try{const _0x554606=parseInt(_0x220327(0x2a0))/0x1+parseInt(_0x220327(0x256))/0x2*(parseInt(_0x220327(0x1df))/0x3)+-parseInt(_0x220327(0x225))/0x4*(parseInt(_0x220327(0x212))/0x5)+parseInt(_0x220327(0x276))/0x6*(-parseInt(_0x220327(0x260))/0x7)+-parseInt(_0x220327(0x22d))/0x8+parseInt(_0x220327(0x1dd))/0x9*(parseInt(_0x220327(0x1f8))/0xa)+parseInt(_0x220327(0x216))/0xb;if(_0x554606===_0x506b8d)break;else _0x535949['push'](_0x535949['shift']());}catch(_0x8c7afd){_0x535949['push'](_0x535949['shift']());}}}(a97_0x526f,0xa9d80));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a97_0x1ead5a(0x207);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x26e76d){return''+PENDING_SEGMENT_PREFIX+_0x26e76d+'__';}export function isPendingSegmentId(_0x2eb297){const _0x43b9a4=a97_0x1ead5a;return _0x2eb297[_0x43b9a4(0x21d)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x497aba){const _0x4cf676=a97_0x1ead5a;return _0x497aba[_0x4cf676(0x261)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1b7cec){return''+PENDING_ACTIVATION_PREFIX+_0x1b7cec+'__';}export function isPendingActivationId(_0x261f3e){const _0x32b5ea=a97_0x1ead5a;return _0x261f3e[_0x32b5ea(0x21d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xc1ea8f){return _0xc1ea8f['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x3d09aa,_0x29bd61){const _0x2c8aba=a97_0x1ead5a,_0x568bf1=_0x3d09aa+'::'+(_0x29bd61['trim']()||_0x2c8aba(0x1f3)),_0x29de96=createHash('sha1')[_0x2c8aba(0x265)](_0x568bf1)[_0x2c8aba(0x264)]('hex')[_0x2c8aba(0x204)](0x0,0xc);return _0x2c8aba(0x1f9)+_0x29de96;}export function ensureJourneyDefaults(_0x1e6344){const _0x66a1ba=a97_0x1ead5a;!_0x1e6344[_0x66a1ba(0x237)]&&(_0x1e6344[_0x66a1ba(0x237)]=''),!_0x1e6344[_0x66a1ba(0x2aa)]&&(_0x1e6344['state']=_0x66a1ba(0x209));}export function resolveTDFolderPath(_0x2cbe0d,_0x4c7d89,_0xa98c47){const _0x3b45b9=a97_0x1ead5a;if(!_0x4c7d89)return _0x2cbe0d;if(_0x2cbe0d===_0xa98c47||_0x2cbe0d[_0x3b45b9(0x21d)](_0xa98c47+'/'))return _0x2cbe0d;return _0x2cbe0d?_0xa98c47+'/'+_0x2cbe0d:_0xa98c47;}export function addFoldersToCreate(_0x4cb9a3,_0xba7354,_0x6ad531){const _0x246de1=a97_0x1ead5a;if(!_0x4cb9a3)return;if(_0xba7354['has'](_0x4cb9a3))return;const _0x492273=_0x4cb9a3[_0x246de1(0x2a7)]('/');let _0x13793e='';for(const _0x469ec5 of _0x492273){_0x13793e=_0x13793e?_0x13793e+'/'+_0x469ec5:_0x469ec5,!_0xba7354['has'](_0x13793e)&&_0x6ad531[_0x246de1(0x29f)](_0x13793e);}}import*as a97_0x168e6b from'yaml';import{readFileSync}from'fs';import a97_0xb8b1c2 from'path';import{isJourneyDef,parseYamlString as a97_0x2d9e1f,toYamlString as a97_0x550ac8,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a97_0x5c6b(_0x17552e,_0x487b82){_0x17552e=_0x17552e-0x1cf;const _0x526fbc=a97_0x526f();let _0x5c6b24=_0x526fbc[_0x17552e];return _0x5c6b24;}import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x1e2a8f){const _0x30a266=a97_0x1ead5a;if(Array[_0x30a266(0x289)](_0x1e2a8f))return'['+_0x1e2a8f['map'](_0x1ccd98=>stableStringify(_0x1ccd98))[_0x30a266(0x1e8)](',')+']';if(_0x1e2a8f&&typeof _0x1e2a8f===_0x30a266(0x25c)){const _0x566d1b=_0x1e2a8f,_0x1e976c=Object[_0x30a266(0x254)](_0x566d1b)['sort'](),_0xce5f56=_0x1e976c['map'](_0x44e7d5=>'\x22'+_0x44e7d5+'\x22:'+stableStringify(_0x566d1b[_0x44e7d5]));return'{'+_0xce5f56[_0x30a266(0x1e8)](',')+'}';}const _0x20ec4c=JSON['stringify'](_0x1e2a8f);return _0x20ec4c===undefined?_0x30a266(0x26c):_0x20ec4c;}function activationSignature(_0x2537a6){const _0x5b14f7=a97_0x1ead5a,_0x1b8395={'connection':_0x2537a6[_0x5b14f7(0x22e)],..._0x2537a6[_0x5b14f7(0x29d)]!==undefined&&{'all_columns':_0x2537a6[_0x5b14f7(0x29d)]},..._0x2537a6[_0x5b14f7(0x245)]!==undefined&&{'columns':_0x2537a6[_0x5b14f7(0x245)]},..._0x2537a6[_0x5b14f7(0x20c)]!==undefined&&{'behavior':_0x2537a6[_0x5b14f7(0x20c)]},..._0x2537a6[_0x5b14f7(0x297)]!==undefined&&{'schedule':_0x2537a6[_0x5b14f7(0x297)]},..._0x2537a6[_0x5b14f7(0x1ec)]!==undefined&&{'notification':_0x2537a6[_0x5b14f7(0x1ec)]},..._0x2537a6['connector_config']!==undefined&&{'connector_config':_0x2537a6[_0x5b14f7(0x2ab)]},..._0x2537a6['activation_template_id']!==undefined&&{'activation_template_id':_0x2537a6[_0x5b14f7(0x1ee)]}};return stableStringify(_0x1b8395);}export async function prepareSegmentFiles(_0x3ed7ba,_0x2fe715,_0x3d3dba,_0x484415,_0x40c295){const _0x57b13f=a97_0x1ead5a,{activationDefToCreateRequest:_0x2cf873}=await import('./child-segment-yaml.js'),_0x227773=[],_0x5f0da4=new Set();for(const {yamlConfig:_0x447038,folderPath:_0x5e38b1,sourcePath:_0x252d74}of _0x3ed7ba){const _0x325b85=resolveTDFolderPath(_0x5e38b1,_0x484415,_0x40c295),_0x2ef13f=_0x325b85+':'+_0x447038['name'],_0x236bf0=_0x2fe715[_0x57b13f(0x220)]['get'](_0x2ef13f),_0xeab509=_0x236bf0?_0x2fe715[_0x57b13f(0x20d)]['get'](_0x236bf0['id'])||[]:[];addFoldersToCreate(_0x325b85,_0x2fe715[_0x57b13f(0x290)],_0x5f0da4);const _0x5731e0=calculateActivationActions(_0x447038[_0x57b13f(0x201)]||[],_0xeab509,_0x2fe715[_0x57b13f(0x234)],_0x2fe715['connectionIdToNameMap']);for(const _0x4e6091 of _0x5731e0){(_0x4e6091[_0x57b13f(0x20a)]===_0x57b13f(0x282)||_0x4e6091[_0x57b13f(0x20a)]==='update')&&_0x4e6091['yamlActivation']&&(_0x4e6091[_0x57b13f(0x203)]=await _0x2cf873(_0x4e6091[_0x57b13f(0x205)],_0x3d3dba));}const _0x19af32=calculateSegmentDiff(_0x447038,_0x236bf0,_0xeab509,_0x2fe715['idToEmailMap'],_0x2fe715[_0x57b13f(0x1d0)]);_0x227773[_0x57b13f(0x279)]({'relativePath':_0x447038['name'],'absolutePath':_0x252d74,'yamlConfig':_0x447038,'folderPath':_0x325b85,'existingSegment':_0x236bf0,'existingActivations':_0xeab509,'isNew':_0x19af32['isNew'],'hasChanges':_0x19af32[_0x57b13f(0x214)],'diff':_0x19af32[_0x57b13f(0x299)],'activationActions':_0x5731e0});}return{'segmentFiles':_0x227773,'foldersToCreate':_0x5f0da4};}export async function prepareJourneyFiles(_0x46b79a,_0x234353,_0x3c4389,_0x3b705a){const _0x4ce6fd=a97_0x1ead5a,_0x51c133=[],_0x282454=new Set();for(const {yamlConfig:_0x4b3ea9,folderPath:_0x56b48a,sourcePath:_0xbe5913}of _0x46b79a){const _0x5af5b8=resolveTDFolderPath(_0x56b48a,_0x3c4389,_0x3b705a),_0x58ad6d=_0x5af5b8+':'+_0x4b3ea9['name'],_0x188bcf=_0x234353[_0x4ce6fd(0x257)][_0x4ce6fd(0x26f)](_0x58ad6d);let _0xa301e0,_0x585116;if(_0x188bcf&&_0x188bcf['length']>0x0){const _0x26064f=buildLocalExpandedRuleMappings(_0x4b3ea9),{createYamlContext:_0x57cdd3,prefetchJourneySegments:_0x4eb70d}=createPushYamlContextForBundle(_0x234353[_0x4ce6fd(0x298)],_0x234353['parentId'],_0x234353[_0x4ce6fd(0x240)],_0x26064f,_0x234353[_0x4ce6fd(0x234)],_0x234353[_0x4ce6fd(0x1d0)],_0x234353['activationStepsById'],_0x234353['journeyById']);await _0x4eb70d(_0x188bcf[_0x4ce6fd(0x217)](_0x73d1ce=>_0x73d1ce['id']));const _0x37bf89=hasMultipleVersions(_0x4b3ea9),_0x5d6bcf=async _0x11fdf0=>{const _0x71583d=_0x4ce6fd,_0x281d99=_0x234353[_0x71583d(0x222)]?.['get'](_0x11fdf0);if(_0x281d99)return _0x281d99;return _0x234353[_0x71583d(0x1fc)]({'journeyId':_0x11fdf0,'journeyName':_0x4b3ea9['name'],'isMultiVersion':_0x188bcf[_0x71583d(0x284)]>0x1});};if(_0x37bf89&&_0x188bcf[_0x4ce6fd(0x284)]>0x1){const _0x464766=[];for(const _0x4fee4e of _0x188bcf){const _0x3b8dbf=_0x4fee4e['versionNumber']||0x1;_0x234353[_0x4ce6fd(0x1d1)]?.[_0x4ce6fd(0x265)](_0x4ce6fd(0x249)+_0x4b3ea9[_0x4ce6fd(0x2ac)]+'\x20v'+_0x3b8dbf);const _0x4c6947=await _0x5d6bcf(_0x4fee4e['id']),_0x1f4be7=_0x57cdd3(_0x4fee4e['id']),_0x461dc0=await journeyResponseToDef(_0x4c6947,_0x1f4be7);_0x464766[_0x4ce6fd(0x279)]({'item':_0x4fee4e,'yaml':_0x461dc0});}const _0x5511de=buildLocalRuleToNameMappingFromJourney(_0x4b3ea9);_0x585116=buildMergedJourneyDef(_0x464766,_0x5511de);const _0xc595b6=Math[_0x4ce6fd(0x1dc)](..._0x464766[_0x4ce6fd(0x217)](_0xbcceb0=>_0xbcceb0[_0x4ce6fd(0x263)][_0x4ce6fd(0x26b)]||0x0)),_0x11fe0f=_0x188bcf['find'](_0x2df830=>(_0x2df830['versionNumber']||0x0)===_0xc595b6);_0x11fe0f&&(_0x234353['progress']?.['update']('Fetching\x20'+_0x4b3ea9[_0x4ce6fd(0x2ac)]+'\x20v'+_0xc595b6),_0xa301e0=await _0x5d6bcf(_0x11fe0f['id']));}else{const _0x655e27=_0x188bcf[_0x188bcf[_0x4ce6fd(0x284)]-0x1];_0x234353[_0x4ce6fd(0x1d1)]?.[_0x4ce6fd(0x265)]('Fetching\x20'+_0x4b3ea9[_0x4ce6fd(0x2ac)]),_0xa301e0=await _0x5d6bcf(_0x655e27['id']);const _0x478cc4=_0x57cdd3(_0x655e27['id']),_0x19347f=await journeyResponseToDef(_0xa301e0,_0x478cc4),_0x20cb3c=buildLocalRuleToNameMappingFromJourney(_0x4b3ea9);_0x585116=buildMergedJourneyDef([{'item':_0x655e27,'yaml':_0x19347f}],_0x20cb3c);}}addFoldersToCreate(_0x5af5b8,_0x234353['folderPathToId'],_0x282454);const _0x242a0c=calculateJourneyDiff(_0x4b3ea9,_0x585116);_0x51c133[_0x4ce6fd(0x279)]({'relativePath':_0x4b3ea9[_0x4ce6fd(0x2ac)],'absolutePath':_0xbe5913,'yamlConfig':_0x4b3ea9,'folderPath':_0x5af5b8,'existingJourney':_0xa301e0,'isNew':_0x242a0c['isNew'],'hasChanges':_0x242a0c['hasChanges'],'diff':_0x242a0c[_0x4ce6fd(0x299)]});}return{'journeyFiles':_0x51c133,'foldersToCreate':_0x282454};}export function calculateActivationActions(_0x22c0e9,_0x536061,_0x2bbd07,_0x343e2c){const _0x38a259=a97_0x1ead5a,_0x432f9d=[],_0x1153d3=new Map();for(const _0x4e5abe of _0x536061){_0x1153d3['set'](_0x4e5abe['name'],_0x4e5abe);}const _0x3627f5=new Map();for(const _0x5aee6e of _0x22c0e9){_0x3627f5[_0x38a259(0x1e3)](_0x5aee6e[_0x38a259(0x2ac)],_0x5aee6e);}for(const _0x462d3e of _0x22c0e9){const _0x495b11=_0x1153d3[_0x38a259(0x26f)](_0x462d3e[_0x38a259(0x2ac)]);if(!_0x495b11)_0x432f9d[_0x38a259(0x279)]({'type':_0x38a259(0x282),'name':_0x462d3e[_0x38a259(0x2ac)],'yamlActivation':_0x462d3e});else{const _0x1f0f6c=activationResponseToDef(_0x495b11,_0x2bbd07,_0x343e2c),_0x3a45cb=a97_0x168e6b[_0x38a259(0x24d)](_0x1f0f6c),_0x3128cc=a97_0x168e6b[_0x38a259(0x24d)](_0x462d3e);_0x3a45cb!==_0x3128cc&&_0x432f9d['push']({'type':_0x38a259(0x265),'name':_0x462d3e[_0x38a259(0x2ac)],'yamlActivation':_0x462d3e,'existingActivation':_0x495b11});}}for(const _0x21352f of _0x536061){!_0x3627f5['has'](_0x21352f[_0x38a259(0x2ac)])&&_0x432f9d['push']({'type':_0x38a259(0x29e),'name':_0x21352f[_0x38a259(0x2ac)],'existingActivation':_0x21352f});}return _0x432f9d;}export function calculateSegmentDiff(_0x222d7b,_0x3c10ec,_0x115bed,_0x49f43b,_0xa83070){const _0x807709=segmentToYamlString(_0x222d7b);if(_0x3c10ec){const _0x1f3941=segmentWithActivationsToYaml(_0x3c10ec,_0x115bed,undefined,_0x49f43b,_0xa83070),_0x2415d4=segmentToYamlString(_0x1f3941),_0x5756b6=generateDiff(_0x2415d4,_0x807709),_0x3e6d35=hasChanges(_0x5756b6);return{'isNew':![],'hasChanges':_0x3e6d35,'diff':_0x3e6d35?formatDiffWithColors(_0x5756b6):undefined};}const _0x39c910=generateDiff('',_0x807709);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x39c910)};}export function calculateJourneyDiff(_0x29d55e,_0x5a3272){const _0x30c69e=normalizeJourneyDef(_0x29d55e,_0x29d55e),_0xd13af3=a97_0x550ac8(_0x30c69e);if(_0x5a3272){const _0x379fc3=normalizeJourneyDef(_0x5a3272,_0x29d55e),_0x4f1f67=a97_0x550ac8(_0x379fc3),_0x6b8f17=generateDiff(_0x4f1f67,_0xd13af3),_0x1b663e=hasChanges(_0x6b8f17);return{'isNew':![],'hasChanges':_0x1b663e,'diff':_0x1b663e?formatDiffWithColors(_0x6b8f17):undefined};}const _0x35f358=generateDiff('',_0xd13af3);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x35f358)};}export function findSegmentsToDelete(_0x389ec1,_0x4aad93,_0x12878a,_0x5e0180,_0x3d9f40){const _0x5665e6=a97_0x1ead5a,_0x56d013=new Set();for(const {yamlConfig:_0x1a5c39,folderPath:_0x123c40}of _0x4aad93){_0x56d013['add'](_0x123c40+':'+_0x1a5c39[_0x5665e6(0x2ac)]);}return _0x389ec1[_0x5665e6(0x28d)](_0x1c3bf4=>{const _0x8f8fc3=_0x5665e6,_0x3cd39f=_0x1c3bf4[_0x8f8fc3(0x286)]?_0x12878a[_0x8f8fc3(0x26f)](_0x1c3bf4['segmentFolderId'][_0x8f8fc3(0x232)]())||'':'',_0x33c0b6=_0x3cd39f+':'+_0x1c3bf4[_0x8f8fc3(0x2ac)];if(_0x56d013[_0x8f8fc3(0x293)](_0x33c0b6))return![];if(_0x3d9f40)return _0x3cd39f===_0x5e0180||_0x3cd39f['startsWith'](_0x5e0180+'/');return!![];});}export function findJourneysToDelete(_0x5d8e17,_0x1a8f54,_0x264893,_0x39d83b,_0x1f9a67){const _0x5069c3=a97_0x1ead5a,_0x397deb=new Set();for(const {yamlConfig:_0x1c3ddf,folderPath:_0x4a8429}of _0x1a8f54){_0x397deb[_0x5069c3(0x29f)](_0x4a8429+':'+_0x1c3ddf[_0x5069c3(0x2ac)]);}return _0x5d8e17[_0x5069c3(0x28d)](_0x20779b=>{const _0x1925e8=_0x5069c3,_0x2ba5c9=_0x20779b[_0x1925e8(0x267)]?_0x264893[_0x1925e8(0x26f)](_0x20779b[_0x1925e8(0x267)])||'':'',_0x1eaf6f=_0x2ba5c9+':'+_0x20779b[_0x1925e8(0x218)];if(_0x397deb['has'](_0x1eaf6f))return![];if(_0x1f9a67)return _0x2ba5c9===_0x39d83b||_0x2ba5c9['startsWith'](_0x39d83b+'/');return!![];});}export function buildSegmentLookupMap(_0x53170f,_0x25bd7f){const _0x587217=a97_0x1ead5a,_0x23157a=new Map();for(const _0x40fc6b of _0x53170f){const _0x5d8c2b=_0x40fc6b['segmentFolderId']?_0x25bd7f[_0x587217(0x26f)](_0x40fc6b[_0x587217(0x286)][_0x587217(0x232)]())||'':'',_0x1f40c4=_0x5d8c2b+':'+_0x40fc6b[_0x587217(0x2ac)];_0x23157a[_0x587217(0x1e3)](_0x1f40c4,_0x40fc6b);}return _0x23157a;}export function buildSegmentNameToIdMap(_0x3a6fb6){const _0x45e10b=a97_0x1ead5a,_0x1051b6=new Map();for(const _0x266781 of _0x3a6fb6){_0x1051b6[_0x45e10b(0x1e3)](_0x266781[_0x45e10b(0x2ac)],_0x266781['id']);}return _0x1051b6;}export function buildJourneyBundleLookupMap(_0x5edd89,_0x2eff2b){const _0xbaf431=a97_0x1ead5a,_0x502713=new Map();for(const _0x339dbc of _0x5edd89){const _0x505d5f=_0x339dbc['folderId']?_0x2eff2b[_0xbaf431(0x26f)](_0x339dbc[_0xbaf431(0x267)])||'':'',_0x2983c6=_0x505d5f+':'+_0x339dbc[_0xbaf431(0x218)];!_0x502713[_0xbaf431(0x293)](_0x2983c6)&&_0x502713['set'](_0x2983c6,[]),_0x502713[_0xbaf431(0x26f)](_0x2983c6)[_0xbaf431(0x279)](_0x339dbc);}for(const _0x2ef557 of _0x502713[_0xbaf431(0x22f)]()){_0x2ef557['sort']((_0x280056,_0x564901)=>(_0x280056[_0xbaf431(0x26b)]||0x0)-(_0x564901[_0xbaf431(0x26b)]||0x0));}return _0x502713;}export function collectFoldersToCreate(_0x3342f3,_0x4a41c9){const _0x2abaa9=a97_0x1ead5a,_0x304f6c=new Set();for(const _0x11280e of _0x3342f3){if(!_0x11280e)continue;if(_0x4a41c9['has'](_0x11280e))continue;const _0x321ac1=_0x11280e[_0x2abaa9(0x2a7)]('/');let _0x870674='';for(const _0x3e075f of _0x321ac1){_0x870674=_0x870674?_0x870674+'/'+_0x3e075f:_0x3e075f,!_0x4a41c9[_0x2abaa9(0x293)](_0x870674)&&_0x304f6c['add'](_0x870674);}}return _0x304f6c;}export function parseAndClassifyYamlFiles(_0x3c043c,_0x33e099,_0x5cd943){const _0x13b74f=a97_0x1ead5a,_0x17d918=[],_0x45cd8c=[];for(const _0x105faa of _0x3c043c){const _0x2898d2=a97_0xb8b1c2[_0x13b74f(0x287)](_0x33e099,a97_0xb8b1c2[_0x13b74f(0x288)](_0x105faa)),_0x378464=_0x2898d2==='.'?'':_0x2898d2,_0x413f66=readFileSync(_0x105faa,_0x13b74f(0x272)),_0x1d95b1=a97_0x168e6b['parse'](_0x413f66);if(isJourneyDef(_0x1d95b1)){const _0xf5b86a=a97_0x2d9e1f(_0x413f66);_0x45cd8c['push']({'yamlConfig':_0xf5b86a,'folderPath':_0x378464,'sourcePath':_0x105faa});}else{if(!_0x5cd943?.[_0x13b74f(0x22c)]){const _0x292203=parseSegmentYamlFile(_0x413f66),_0x3a570d=normalizeChildSegmentYaml(_0x292203);_0x17d918[_0x13b74f(0x279)]({'yamlConfig':_0x3a570d,'folderPath':_0x378464,'sourcePath':_0x105faa});}}}return{'segments':_0x17d918,'journeys':_0x45cd8c};}export function validateParsedFiles(_0x51ab54,_0x54420e){const _0x467c7e=a97_0x1ead5a,_0x500af8=[];for(const {yamlConfig:_0x5e8dfd,sourcePath:_0x38154f}of _0x51ab54[_0x467c7e(0x224)]){const _0x579f64=readFileSync(_0x38154f,_0x467c7e(0x272)),_0x37225b=a97_0x168e6b['parseDocument'](_0x579f64),_0x5100e9=validateSegmentDef(_0x5e8dfd,{'source':_0x579f64,'document':_0x37225b});if(!_0x5100e9[_0x467c7e(0x27c)]){const _0x2af8bc=a97_0xb8b1c2['relative'](_0x54420e,_0x38154f);_0x500af8[_0x467c7e(0x279)]({'filePath':_0x2af8bc,'source':_0x579f64,'result':_0x5100e9,'isJourney':![]});}}for(const {yamlConfig:_0x2c5c2b,sourcePath:_0xd446a4}of _0x51ab54[_0x467c7e(0x24f)]){const _0x1a8865=readFileSync(_0xd446a4,'utf-8'),_0x54b64e=a97_0x168e6b[_0x467c7e(0x242)](_0x1a8865),_0x5eb20a=validateJourneyDef(_0x2c5c2b,{'source':_0x1a8865,'document':_0x54b64e});if(!_0x5eb20a[_0x467c7e(0x27c)]){const _0x5ed1c5=a97_0xb8b1c2['relative'](_0x54420e,_0xd446a4);_0x500af8[_0x467c7e(0x279)]({'filePath':_0x5ed1c5,'source':_0x1a8865,'result':_0x5eb20a,'isJourney':!![]});}}return _0x500af8;}export function formatValidationErrors(_0x1c5e45){const _0x59b4a7=a97_0x1ead5a,_0x13425e=[];for(const {filePath:_0x164014,source:_0x24bd43,result:_0x362b42,isJourney:_0x3c1520}of _0x1c5e45){const _0x4eb049=_0x3c1520?_0x59b4a7(0x271):'segment';_0x13425e['push']('\x0a'+_0x164014+'\x20('+_0x4eb049+'):\x20'+_0x362b42['errors'][_0x59b4a7(0x284)]+'\x20error(s)'),_0x13425e[_0x59b4a7(0x279)](formatValidationResult(_0x362b42,_0x24bd43,_0x164014));}return _0x13425e[_0x59b4a7(0x1e8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x29a7e7){const _0xfc4889=a97_0x1ead5a,_0x5eeca7=new Set(),_0x442566=new Map(),_0x3ed5cd=collectSegmentUsageCounts(_0x29a7e7);if(_0x29a7e7[_0xfc4889(0x224)])for(const [_0x2f2310,_0x12cc03]of Object[_0xfc4889(0x1fa)](_0x29a7e7['segments'])){_0x5eeca7[_0xfc4889(0x29f)](_0x2f2310);if(_0x12cc03[_0xfc4889(0x28e)]){const _0xa9bbd2=yamlRuleToApi(_0x12cc03['rule']),_0x3ff3bc=apiRuleToYaml(_0xa9bbd2);_0x442566[_0xfc4889(0x1e3)](_0x2f2310,_0x3ff3bc);}}const _0x5ca1e8=new Map();let _0x4ee756=0x0;for(const [_0x3d02f8,_0xa48443]of _0x442566){const _0x2c3446=serializeExpandedRule(_0xa48443,_0x442566),_0x59293d=_0x5ca1e8[_0xfc4889(0x26f)](_0x2c3446)||[];_0x59293d[_0xfc4889(0x279)]({'name':_0x3d02f8,'index':_0x4ee756}),_0x5ca1e8['set'](_0x2c3446,_0x59293d),_0x4ee756++;}const _0x44abc6=new Map();for(const [_0x33c226,_0x2040f9]of _0x5ca1e8){const _0x96648d=_0x2040f9[_0xfc4889(0x204)]()['sort']((_0x208179,_0xb35e30)=>{const _0x3174cc=_0xfc4889,_0x14a064=_0x3ed5cd[_0x3174cc(0x26f)](_0x208179[_0x3174cc(0x2ac)])||0x0,_0x236262=_0x3ed5cd[_0x3174cc(0x26f)](_0xb35e30['name'])||0x0;if(_0x14a064!==_0x236262)return _0x236262-_0x14a064;return _0x208179[_0x3174cc(0x1ef)]-_0xb35e30[_0x3174cc(0x1ef)];})[_0xfc4889(0x217)](_0x54d9af=>_0x54d9af['name']),_0x1edb9d=[];for(const _0x3ffb58 of _0x96648d){const _0x44807a=_0x3ed5cd[_0xfc4889(0x26f)](_0x3ffb58)||0x0,_0x1b8321=Math['max'](_0x44807a,0x1);for(let _0x4bf7b5=0x0;_0x4bf7b5<_0x1b8321;_0x4bf7b5++){_0x1edb9d[_0xfc4889(0x279)](_0x3ffb58);}}_0x44abc6['set'](_0x33c226,_0x1edb9d);}return{'existingLocalSegmentNames':_0x5eeca7,'localSegmentRules':_0x442566,'localExpandedRuleToNames':_0x44abc6};}async function buildServerSegmentRuleMap(_0x333e6,_0x5a81e0,_0x3cac69,_0x1d1db5){const _0x513a4f=new Map(),_0x48029a=new Set(),_0x2bd3f8=async _0x1eb3f1=>{const _0x495d1f=a97_0x5c6b;if(_0x48029a[_0x495d1f(0x293)](_0x1eb3f1))return;_0x48029a[_0x495d1f(0x29f)](_0x1eb3f1);let _0x59f14c=_0x3cac69[_0x495d1f(0x1d3)](_0x324590=>_0x324590['id']===_0x1eb3f1);if(!_0x59f14c)try{_0x59f14c=await _0x333e6[_0x495d1f(0x1f3)][_0x495d1f(0x273)](_0x5a81e0,_0x1eb3f1);}catch{return;}if(!_0x59f14c?.[_0x495d1f(0x28e)])return;const _0x17cc35=apiRuleToYaml(_0x59f14c['rule']);_0x513a4f['set'](_0x1eb3f1,_0x17cc35);const _0x34395d=collectSegmentRefsFromRule(_0x17cc35);for(const _0x16f1a2 of _0x34395d){await _0x2bd3f8(_0x16f1a2);}};for(const _0xba207d of _0x1d1db5){await _0x2bd3f8(_0xba207d);}return _0x513a4f;}export function createSegmentIdResolver(_0x3a76ca,_0x30ec6d){return async _0x2e38f8=>{const _0xd5623d=a97_0x5c6b,_0x4deff3=_0x3a76ca[_0xd5623d(0x26f)](_0x2e38f8);if(!_0x4deff3)throw new SDKError(ErrorCode[_0xd5623d(0x1e5)],_0xd5623d(0x202)+_0x2e38f8+_0xd5623d(0x20f)+_0x30ec6d+'\x27)');return _0x4deff3;};}export function extractRootFolderId(_0x4132b8){const _0x4aac4e=a97_0x1ead5a;return _0x4132b8[_0x4aac4e(0x1d6)]?.[_0x4aac4e(0x1f7)]?.['data']?.['id']||_0x4132b8[_0x4aac4e(0x1d6)]?.[_0x4aac4e(0x22b)]?.[_0x4aac4e(0x23f)]?.['id'];}export function buildConnectionMaps(_0x1fc4bc){const _0x1ab8d7=a97_0x1ead5a,_0x500e31=new Map(),_0xc58a97=new Map(),_0x135075=new Map();for(const _0x3bc2c6 of _0x1fc4bc){_0x500e31[_0x1ab8d7(0x1e3)](_0x3bc2c6[_0x1ab8d7(0x2ac)],parseInt(_0x3bc2c6['id'],0xa)),_0xc58a97[_0x1ab8d7(0x1e3)](_0x3bc2c6['id'],_0x3bc2c6['name']),_0x135075[_0x1ab8d7(0x1e3)](_0x3bc2c6[_0x1ab8d7(0x2ac)],_0x3bc2c6[_0x1ab8d7(0x20a)]);}return{'nameToId':_0x500e31,'idToName':_0xc58a97,'nameToType':_0x135075};}export function calculatePushStats(_0xe606ea,_0xf6f9b,_0x19da9c,_0x52c8eb,_0x42ca50,_0xc9252b,_0x248dae){const _0x3b0546=a97_0x1ead5a,_0xf497be=_0xe606ea[_0x3b0546(0x28d)](_0x36c1b0=>_0x36c1b0[_0x3b0546(0x2a1)]),_0x196e13=_0xe606ea[_0x3b0546(0x28d)](_0x44c8ba=>!_0x44c8ba[_0x3b0546(0x2a1)]&&_0x44c8ba[_0x3b0546(0x214)]),_0x53f059=_0xe606ea[_0x3b0546(0x28d)](_0x2e36f3=>!_0x2e36f3[_0x3b0546(0x2a1)]&&!_0x2e36f3[_0x3b0546(0x214)]),_0x5690f1=_0xc9252b?_0x52c8eb:[],_0x30bce4=_0xf6f9b[_0x3b0546(0x28d)](_0x1fe232=>_0x1fe232[_0x3b0546(0x2a1)]),_0x3ad1d3=_0xf6f9b[_0x3b0546(0x28d)](_0x19035b=>!_0x19035b[_0x3b0546(0x2a1)]&&_0x19035b[_0x3b0546(0x214)]),_0x43a63b=_0xf6f9b[_0x3b0546(0x28d)](_0x3f5a9f=>!_0x3f5a9f['isNew']&&!_0x3f5a9f[_0x3b0546(0x214)]),_0x5509bb=_0xc9252b?_0x42ca50:[],_0x48e799=_0xe606ea[_0x3b0546(0x23c)](_0x51e906=>_0x51e906[_0x3b0546(0x228)]),_0x44352e=_0x48e799[_0x3b0546(0x28d)](_0x119d9e=>_0x119d9e[_0x3b0546(0x20a)]===_0x3b0546(0x282)),_0x470ead=_0x48e799[_0x3b0546(0x28d)](_0x3ef345=>_0x3ef345['type']===_0x3b0546(0x265)),_0x2ce21f=_0x48e799[_0x3b0546(0x28d)](_0x5af7ff=>_0x5af7ff['type']===_0x3b0546(0x29e)),_0x2f7e18=Array[_0x3b0546(0x266)](_0x19da9c)['sort'](),_0x3a3e3f=_0x248dae?![]:_0xf497be[_0x3b0546(0x284)]>0x0||_0x196e13[_0x3b0546(0x284)]>0x0||_0x5690f1[_0x3b0546(0x284)]>0x0,_0x261ca3=_0x30bce4['length']>0x0||_0x3ad1d3[_0x3b0546(0x284)]>0x0||_0x5509bb[_0x3b0546(0x284)]>0x0,_0x35912c=_0x248dae?![]:_0x48e799['length']>0x0,_0x382c0d=_0x2f7e18[_0x3b0546(0x284)]>0x0;return{'segments':{'new':_0xf497be,'changed':_0x196e13,'unchanged':_0x53f059,'toDelete':_0x5690f1},'journeys':{'new':_0x30bce4,'changed':_0x3ad1d3,'unchanged':_0x43a63b,'toDelete':_0x5509bb},'activations':{'all':_0x48e799,'toCreate':_0x44352e,'toUpdate':_0x470ead,'toDelete':_0x2ce21f},'folders':{'toCreate':_0x2f7e18},'counts':{'segments':{'new':_0xf497be[_0x3b0546(0x284)],'changed':_0x196e13['length'],'unchanged':_0x53f059[_0x3b0546(0x284)],'toDelete':_0x5690f1[_0x3b0546(0x284)]},'journeys':{'new':_0x30bce4[_0x3b0546(0x284)],'changed':_0x3ad1d3['length'],'unchanged':_0x43a63b[_0x3b0546(0x284)],'toDelete':_0x5509bb['length']},'activations':{'create':_0x44352e[_0x3b0546(0x284)],'update':_0x470ead[_0x3b0546(0x284)],'delete':_0x2ce21f[_0x3b0546(0x284)]},'folders':_0x2f7e18['length']},'hasChanges':_0x3a3e3f||_0x261ca3||_0x35912c||_0x382c0d};}export async function buildPushExecutionContext(_0x37d2e2,_0x10d5f4,_0x101313,_0x13f566,_0x1a7023,_0x589013){const _0x41ef27=a97_0x1ead5a,_0x228df2=extractRootFolderId(_0x101313),{pathToId:_0x103b58,idToPath:_0x2ebc29}=buildFolderMaps(_0x1a7023),_0x2f06aa=buildSegmentNameToIdMap(_0x13f566),_0x264520=new Map(),{batchAsync:_0x53b081}=await import('../../utils/async.js'),[_0x4849aa,_0x44cae0]=await Promise[_0x41ef27(0x274)]([_0x37d2e2[_0x41ef27(0x253)]['buildUserMaps'](),_0x37d2e2[_0x41ef27(0x22e)]['list'](),((async()=>{const _0x53aa09=_0x41ef27;!_0x589013&&_0x13f566[_0x53aa09(0x284)]>0x0&&await _0x53b081(_0x13f566,async _0x2399f4=>{const _0x3b7ed5=_0x53aa09,_0x20b6d5=await _0x37d2e2[_0x3b7ed5(0x1f3)]['listActivations'](_0x10d5f4,_0x2399f4['id']);_0x264520[_0x3b7ed5(0x1e3)](_0x2399f4['id'],_0x20b6d5);});})())]),{emailToId:_0x18577f,idToEmail:_0x30dacd}=_0x4849aa,_0x47252c=buildConnectionMaps(_0x44cae0);return{'rootFolderId':_0x228df2,'folderPathToId':_0x103b58,'folderIdToPath':_0x2ebc29,'segmentNameToId':_0x2f06aa,'activationsBySegmentId':_0x264520,'emailToIdMap':_0x18577f,'idToEmailMap':_0x30dacd,'connectionNameToIdMap':_0x47252c[_0x41ef27(0x1e7)],'connectionIdToNameMap':_0x47252c[_0x41ef27(0x2a3)],'connectionNameToTypeMap':_0x47252c['nameToType']};}export function createPushYamlContextForBundle(_0x2427e1,_0x2517c6,_0x40112e,_0x27f271,_0xa18c6c,_0x2d9179,_0x44ec34,_0x52de74){const {existingLocalSegmentNames:_0xd2ee1a,localExpandedRuleToNames:_0x532189}=_0x27f271,_0x450e73=new Set(),_0x1adbbd=new Map(),_0x206233=new Set(),_0x3d7909=new Map(),_0x31cf33=new Map(),_0x30a92c=createJumpTargetCache(),_0x112f49=new Map(),_0x5b3ef4=new Map(),_0x1b0b56=new Set();let _0x5573bb;const _0x4f9af1=_0x20fb75=>{const _0x21fdc1={'resolveSegment':async _0x38bb10=>{const _0xf9f97=a97_0x5c6b,_0x16a867=_0x31cf33[_0xf9f97(0x26f)](_0x38bb10);if(_0x16a867!==undefined)return{'name':_0x16a867,'isJourneyLocal':!![]};try{let _0x156648=_0x40112e[_0xf9f97(0x1d3)](_0x2ed4db=>_0x2ed4db['id']===_0x38bb10);!_0x156648&&(_0x156648=await _0x2427e1[_0xf9f97(0x1f3)][_0xf9f97(0x273)](_0x2517c6,_0x38bb10));const _0x211c33=generateJourneyLocalName(_0x156648[_0xf9f97(0x2ac)]),_0xbf2419=_0x156648[_0xf9f97(0x23b)]===SEGMENT_KIND_JOURNEY&&_0x211c33!==undefined;let _0x291ff1=_0x156648[_0xf9f97(0x2ac)],_0x11dc3b;if(_0xbf2419&&_0x156648[_0xf9f97(0x28e)]){const _0x4b07ee=apiRuleToYaml(_0x156648[_0xf9f97(0x28e)]);_0x5b3ef4[_0xf9f97(0x1e3)](_0x38bb10,_0x4b07ee);const _0xcc60c6=async _0x1a3ab0=>{const _0x5c9a7e=_0xf9f97,_0x5185c2=collectSegmentRefsFromRule(_0x1a3ab0);for(const _0x29d396 of _0x5185c2){if(!_0x5b3ef4[_0x5c9a7e(0x293)](_0x29d396))try{const _0x127efc=await _0x2427e1[_0x5c9a7e(0x1f3)][_0x5c9a7e(0x273)](_0x2517c6,_0x29d396);if(_0x127efc?.[_0x5c9a7e(0x28e)]){const _0x1a1640=apiRuleToYaml(_0x127efc[_0x5c9a7e(0x28e)]);_0x5b3ef4[_0x5c9a7e(0x1e3)](_0x29d396,_0x1a1640),await _0xcc60c6(_0x1a1640);}}catch{}}};await _0xcc60c6(_0x4b07ee);const _0x5387ed=serializeExpandedRule(_0x4b07ee,_0x5b3ef4),_0x57c169=_0x532189[_0xf9f97(0x26f)](_0x5387ed);if(_0x57c169&&_0x57c169['length']>0x0){const _0x3dc37f=_0x1adbbd[_0xf9f97(0x26f)](_0x5387ed)||0x0,_0x436dcc=_0x57c169[_0x3dc37f]||_0x57c169[_0x57c169[_0xf9f97(0x284)]-0x1];_0x1adbbd[_0xf9f97(0x1e3)](_0x5387ed,_0x3dc37f+0x1),_0x291ff1=_0x436dcc,_0x450e73[_0xf9f97(0x29f)](_0x291ff1),_0x31cf33[_0xf9f97(0x1e3)](_0x38bb10,_0x291ff1);const _0x164088=await resolveRuleSegmentRefs(_0x4b07ee,async _0x38c22e=>{const _0x2f7448=_0xf9f97,_0x5cd3f1=_0x31cf33[_0x2f7448(0x26f)](_0x38c22e);if(_0x5cd3f1)return _0x5cd3f1;const _0x34f61d=await _0x5573bb['resolveSegment'](_0x38c22e);return _0x34f61d[_0x2f7448(0x2ac)];});_0x11dc3b={'description':_0x156648['description'],'rule':_0x164088};}else{const _0x2b418f=_0x112f49['get'](_0x5387ed);if(_0x2b418f)_0x291ff1=_0x2b418f,_0x31cf33[_0xf9f97(0x1e3)](_0x38bb10,_0x291ff1);else{if(_0x211c33){let _0x3cfab6=_0x211c33,_0x48b4ad=0x2;while(_0x450e73[_0xf9f97(0x293)](_0x3cfab6)||_0xd2ee1a[_0xf9f97(0x293)](_0x3cfab6)){_0x3cfab6=_0x211c33+'_'+_0x48b4ad,_0x48b4ad++;}_0x450e73[_0xf9f97(0x29f)](_0x3cfab6),_0x291ff1=_0x3cfab6;}_0x31cf33[_0xf9f97(0x1e3)](_0x38bb10,_0x291ff1),_0x112f49['set'](_0x5387ed,_0x291ff1);const _0x539cc7=await resolveRuleSegmentRefs(_0x4b07ee,async _0x3796fe=>{const _0x3b9121=_0xf9f97,_0x3af292=_0x31cf33[_0x3b9121(0x26f)](_0x3796fe);if(_0x3af292)return _0x3af292;const _0x6b7d82=await _0x5573bb[_0x3b9121(0x2a2)](_0x3796fe);return _0x6b7d82[_0x3b9121(0x2ac)];});_0x11dc3b={'description':_0x156648[_0xf9f97(0x237)],'rule':_0x539cc7};}}}return{'name':_0x291ff1,'isJourneyLocal':_0xbf2419,'definition':_0x11dc3b};}catch{return{'name':_0x38bb10,'isJourneyLocal':![]};}},'resolveActivation':async _0x14ee7a=>{const _0x3984a5=a97_0x5c6b,_0x9d14a6=_0x3d7909[_0x3984a5(0x26f)](_0x14ee7a);if(_0x9d14a6!==undefined)return{'name':_0x9d14a6,'isJourneyLocal':!![]};try{let _0x300cb4=_0x44ec34?.['get'](_0x14ee7a);!_0x300cb4&&(_0x300cb4=await _0x2427e1[_0x3984a5(0x271)][_0x3984a5(0x28a)](_0x20fb75,_0x14ee7a));const _0x2e7be1=_0x300cb4[_0x3984a5(0x283)]['activationParams'][_0x3984a5(0x2ac)]||_0x14ee7a,_0x25b477=sanitizeYamlKey(_0x2e7be1)||_0x3984a5(0x244)+_0x14ee7a;let _0x9857f9=_0x25b477,_0x199160=0x2;while(_0x206233[_0x3984a5(0x293)](_0x9857f9)){_0x9857f9=_0x25b477+'_'+_0x199160,_0x199160++;}_0x206233[_0x3984a5(0x29f)](_0x9857f9),_0x3d7909['set'](_0x14ee7a,_0x9857f9);const _0x1d90a9=journeyActivationStepToYaml(_0x300cb4,_0xa18c6c,_0x2d9179);return{'name':_0x9857f9,'isJourneyLocal':!![],'definition':_0x1d90a9};}catch{return{'name':_0x14ee7a,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x121b21,_0x182229)=>resolveJumpTarget(_0x121b21,_0x182229,_0x30a92c,async _0x555ea2=>{const _0x3bbbcb=a97_0x5c6b,_0x49459d=_0x52de74?.[_0x3bbbcb(0x26f)](_0x555ea2);if(_0x49459d)return _0x49459d;return _0x2427e1['journey'][_0x3bbbcb(0x27e)](_0x555ea2);})};return _0x5573bb=_0x21fdc1,_0x21fdc1;},_0x509e92=async _0x5baa2b=>{const _0x5e95b1=a97_0x5c6b,{collectSegmentIdsFromJourneyApi:_0x14d6ec}=await import('./journey-yaml.js'),{batchAsync:_0x5c99d2}=await import(_0x5e95b1(0x255)),_0x45806d=new Set();for(const _0x952c2a of _0x5baa2b){let _0xb9a7b=_0x52de74?.['get'](_0x952c2a);!_0xb9a7b&&(_0xb9a7b=await _0x2427e1[_0x5e95b1(0x271)][_0x5e95b1(0x27e)](_0x952c2a));const _0x2625f7=_0x14d6ec(_0xb9a7b);for(const _0x4c60de of _0x2625f7){_0x45806d['add'](_0x4c60de);}}let _0xf628ea=Array[_0x5e95b1(0x266)](_0x45806d);while(_0xf628ea['length']>0x0){const _0x4b60fc=_0xf628ea['filter'](_0x47e75a=>!_0x1b0b56['has'](_0x47e75a));if(_0x4b60fc[_0x5e95b1(0x284)]===0x0)break;const _0x10be14=await _0x5c99d2(_0x4b60fc,async _0x41e528=>{const _0x28b522=_0x5e95b1;_0x1b0b56[_0x28b522(0x29f)](_0x41e528);let _0x4e01ea=_0x40112e[_0x28b522(0x1d3)](_0x53cf67=>_0x53cf67['id']===_0x41e528);if(!_0x4e01ea)try{_0x4e01ea=await _0x2427e1['segment'][_0x28b522(0x273)](_0x2517c6,_0x41e528);}catch{return null;}return{'segmentId':_0x41e528,'segment':_0x4e01ea};},0xa),_0xe1a029=new Set();for(const _0x5fa39a of _0x10be14){if(!_0x5fa39a?.[_0x5e95b1(0x1f3)]?.[_0x5e95b1(0x28e)])continue;const _0x314953=apiRuleToYaml(_0x5fa39a['segment'][_0x5e95b1(0x28e)]);_0x5b3ef4[_0x5e95b1(0x1e3)](_0x5fa39a[_0x5e95b1(0x229)],_0x314953);const _0x27775f=collectSegmentRefsFromRule(_0x314953);for(const _0x1d65a7 of _0x27775f){!_0x1b0b56[_0x5e95b1(0x293)](_0x1d65a7)&&_0xe1a029[_0x5e95b1(0x29f)](_0x1d65a7);}}_0xf628ea=Array[_0x5e95b1(0x266)](_0xe1a029);}};return{'createYamlContext':_0x4f9af1,'prefetchJourneySegments':_0x509e92};}export async function executePushSegments(_0x2d2aa6,_0xa7dd6f,_0x23822d,_0x30b02a,_0x25c82d){const _0x546394=a97_0x1ead5a,{segmentDefToCreateRequest:_0x457b6b,segmentDefToUpdateRequest:_0x3b8c1b}=await import(_0x546394(0x1f4)),_0x1a0736=_0x23822d[_0x546394(0x290)],_0x2ac118=0x5,_0x3e5738=async _0x46f63b=>{const _0x563e8e=_0x546394,_0x2d40be=_0x46f63b['folderPath']?_0x1a0736['get'](_0x46f63b[_0x563e8e(0x247)]):undefined;let _0x4a6949;const _0x54de8e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x46f63b['isNew']){_0x25c82d[_0x563e8e(0x1d5)]?.({'type':_0x563e8e(0x23d),'name':_0x46f63b['yamlConfig'][_0x563e8e(0x2ac)]});const _0x23f83c=_0x457b6b(_0x46f63b[_0x563e8e(0x270)],_0x2d40be),_0x4a95b3=await _0x25c82d[_0x563e8e(0x21f)](_0x563e8e(0x1f0)+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+_0x563e8e(0x24e),()=>_0x2d2aa6[_0x563e8e(0x1f3)][_0x563e8e(0x27b)](_0x30b02a['parentId'],_0x23f83c));_0x4a6949=_0x4a95b3[_0x563e8e(0x23f)]['id'],_0x54de8e[_0x563e8e(0x1e1)]={'name':_0x46f63b[_0x563e8e(0x270)]['name'],'id':_0x4a6949},_0x25c82d[_0x563e8e(0x1d5)]?.({'type':'segment_created','name':_0x46f63b[_0x563e8e(0x270)]['name'],'segmentId':_0x4a6949}),_0x25c82d[_0x563e8e(0x236)]?.('Created\x20segment\x20\x27'+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+'\x27'),_0x54de8e[_0x563e8e(0x219)]=0x1;}else{if(_0x46f63b[_0x563e8e(0x214)]){_0x25c82d[_0x563e8e(0x1d5)]?.({'type':'segment_updating','name':_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]});const _0x4c97d4=_0x3b8c1b(_0x46f63b[_0x563e8e(0x270)]);_0x2d40be!==_0x46f63b[_0x563e8e(0x1f5)]?.[_0x563e8e(0x286)]&&(_0x4c97d4[_0x563e8e(0x286)]=_0x2d40be?parseInt(_0x2d40be,0xa):undefined),await _0x25c82d['withProgress'](_0x563e8e(0x1d7)+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+_0x563e8e(0x24e),()=>_0x2d2aa6[_0x563e8e(0x1f3)]['updateSegmentById'](_0x30b02a[_0x563e8e(0x24c)],_0x46f63b[_0x563e8e(0x1f5)]['id'],_0x4c97d4)),_0x4a6949=_0x46f63b['existingSegment']['id'],_0x25c82d[_0x563e8e(0x1d5)]?.({'type':_0x563e8e(0x206),'name':_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]}),_0x25c82d[_0x563e8e(0x236)]?.(_0x563e8e(0x1e4)+_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)]+'\x27'),_0x54de8e[_0x563e8e(0x2af)]=0x1;}else _0x4a6949=_0x46f63b[_0x563e8e(0x1f5)]['id'];}}catch(_0x2262e4){const _0x173c2a=isHttp400Error(_0x2262e4),_0x196cf3=_0x173c2a?ErrorCode[_0x563e8e(0x1fe)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x30abcf=getErrorMessage(_0x2262e4);throw new SDKError(_0x196cf3,'Failed\x20to\x20'+(_0x46f63b[_0x563e8e(0x2a1)]?'create':_0x563e8e(0x265))+_0x563e8e(0x1db)+_0x46f63b['absolutePath']+_0x563e8e(0x294)+_0x30abcf,_0x2262e4);}try{const _0x58ed14=await syncActivationsForSegment(_0x2d2aa6,_0x30b02a[_0x563e8e(0x24c)],_0x4a6949,_0x46f63b[_0x563e8e(0x270)][_0x563e8e(0x2ac)],_0x46f63b[_0x563e8e(0x228)],_0x25c82d,_0x46f63b['absolutePath']);_0x54de8e[_0x563e8e(0x201)]=_0x58ed14;}catch(_0x16b65d){if(_0x16b65d instanceof SDKError)throw _0x16b65d;throw new SDKError(ErrorCode[_0x563e8e(0x200)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x46f63b['yamlConfig'][_0x563e8e(0x2ac)]+_0x563e8e(0x1eb)+_0x46f63b[_0x563e8e(0x21c)]+_0x563e8e(0x294)+getErrorMessage(_0x16b65d),_0x16b65d);}return _0x54de8e;},_0x36df99=await batchAsync(_0xa7dd6f,_0x3e5738,_0x2ac118),_0x4bbca0={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x588020 of _0x36df99){_0x4bbca0[_0x546394(0x219)]+=_0x588020[_0x546394(0x219)],_0x4bbca0['updated']+=_0x588020[_0x546394(0x2af)],_0x588020['createdSegmentId']&&_0x4bbca0[_0x546394(0x285)][_0x546394(0x1e3)](_0x588020[_0x546394(0x1e1)][_0x546394(0x2ac)],_0x588020[_0x546394(0x1e1)]['id']),_0x4bbca0[_0x546394(0x201)][_0x546394(0x219)]+=_0x588020[_0x546394(0x201)][_0x546394(0x219)],_0x4bbca0[_0x546394(0x201)]['updated']+=_0x588020[_0x546394(0x201)][_0x546394(0x2af)],_0x4bbca0['activations'][_0x546394(0x2a4)]+=_0x588020[_0x546394(0x201)][_0x546394(0x2a4)];}return _0x4bbca0;}async function syncActivationsForSegment(_0x166723,_0x3edeef,_0x1599cb,_0x3ebe72,_0x5ed1f5,_0x364f5d,_0x57de0b){const _0x3d088c=a97_0x1ead5a,_0xd1128b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5e1725 of _0x5ed1f5){try{if(_0x5e1725[_0x3d088c(0x20a)]==='create'&&_0x5e1725[_0x3d088c(0x203)])_0x364f5d['onProgress']?.({'type':'activation_creating','segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),await _0x364f5d['withProgress']('Creating\x20activation\x20\x27'+_0x5e1725[_0x3d088c(0x2ac)]+_0x3d088c(0x24e),()=>_0x166723[_0x3d088c(0x1f3)]['createActivation'](_0x3edeef,_0x1599cb,_0x5e1725[_0x3d088c(0x203)])),_0x364f5d['onProgress']?.({'type':_0x3d088c(0x1ed),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),_0x364f5d[_0x3d088c(0x236)]?.(_0x3d088c(0x26e)+_0x5e1725[_0x3d088c(0x2ac)]+'\x27'),_0xd1128b['created']++;else{if(_0x5e1725['type']===_0x3d088c(0x265)&&_0x5e1725['validatedRequest']&&_0x5e1725['existingActivation'])_0x364f5d[_0x3d088c(0x1d5)]?.({'type':'activation_updating','segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),await _0x364f5d[_0x3d088c(0x21f)](_0x3d088c(0x2a5)+_0x5e1725[_0x3d088c(0x2ac)]+_0x3d088c(0x24e),()=>_0x166723[_0x3d088c(0x1f3)][_0x3d088c(0x1e6)](_0x3edeef,_0x1599cb,_0x5e1725['existingActivation']['id'],_0x5e1725[_0x3d088c(0x203)])),_0x364f5d[_0x3d088c(0x1d5)]?.({'type':_0x3d088c(0x292),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),_0x364f5d[_0x3d088c(0x236)]?.('Updated\x20activation\x20\x27'+_0x5e1725['name']+'\x27'),_0xd1128b[_0x3d088c(0x2af)]++;else _0x5e1725[_0x3d088c(0x20a)]==='delete'&&_0x5e1725[_0x3d088c(0x246)]&&(_0x364f5d[_0x3d088c(0x1d5)]?.({'type':_0x3d088c(0x296),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),await _0x364f5d[_0x3d088c(0x21f)](_0x3d088c(0x28c)+_0x5e1725[_0x3d088c(0x2ac)]+_0x3d088c(0x24e),()=>_0x166723['segment'][_0x3d088c(0x275)](_0x3edeef,_0x1599cb,_0x5e1725[_0x3d088c(0x246)]['id'])),_0x364f5d[_0x3d088c(0x1d5)]?.({'type':_0x3d088c(0x1e2),'segmentName':_0x3ebe72,'activationName':_0x5e1725[_0x3d088c(0x2ac)]}),_0x364f5d[_0x3d088c(0x262)]?.('Deleted\x20activation\x20\x27'+_0x5e1725['name']+'\x27'),_0xd1128b['deleted']++);}}catch(_0x3cc70e){const _0x4a0a00=isHttp400Error(_0x3cc70e),_0x31ef83=_0x4a0a00?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x26e2e0=getErrorMessage(_0x3cc70e);throw new SDKError(_0x31ef83,'Failed\x20to\x20'+_0x5e1725[_0x3d088c(0x20a)]+_0x3d088c(0x26d)+_0x5e1725['name']+_0x3d088c(0x1eb)+_0x57de0b+_0x3d088c(0x294)+_0x26e2e0,_0x3cc70e);}}return _0xd1128b;}export async function executePushFolders(_0x26da7d,_0x371be3,_0x3c0e08,_0x4d42c3,_0x5e58a6){const _0x3436b1=a97_0x1ead5a,_0x4a753d=new Map(_0x3c0e08);for(const _0x48b678 of _0x371be3){const _0x1f766f=_0x48b678[_0x3436b1(0x2a7)]('/'),_0x3e57d9=_0x1f766f[_0x1f766f['length']-0x1],_0x154d22=_0x1f766f[_0x3436b1(0x204)](0x0,-0x1)[_0x3436b1(0x1e8)]('/'),_0x5bacd2=_0x4a753d['get'](_0x154d22);_0x5e58a6['onProgress']?.({'type':_0x3436b1(0x1ff),'folder':_0x48b678});const _0x4c9c03={'name':_0x3e57d9,'parentFolderId':_0x5bacd2},_0x389ed0=await _0x5e58a6['withProgress']('Creating\x20folder\x20\x27'+_0x48b678+_0x3436b1(0x24e),()=>_0x26da7d[_0x3436b1(0x1f3)]['createFolder'](_0x4d42c3[_0x3436b1(0x24c)],_0x4c9c03));_0x4a753d[_0x3436b1(0x1e3)](_0x48b678,_0x389ed0[_0x3436b1(0x23f)]['id']),_0x5e58a6[_0x3436b1(0x1d5)]?.({'type':_0x3436b1(0x241),'folder':_0x48b678,'folderId':_0x389ed0[_0x3436b1(0x23f)]['id']}),_0x5e58a6['logInfo']?.(_0x3436b1(0x258)+_0x48b678+'\x27');}return _0x4a753d;}export async function executePushSegmentDeletions(_0x24ce2b,_0x28cbbc,_0x1494d6){const _0x30ab5a=a97_0x1ead5a;if(_0x28cbbc['length']===0x0)return 0x0;const {batchAsync:_0x1bd8d8}=await import(_0x30ab5a(0x255)),_0x37ce92=0x5,_0x3f9e06=await _0x1bd8d8(_0x28cbbc,async _0x1fe85e=>{const _0x2d9809=_0x30ab5a;return _0x1494d6[_0x2d9809(0x1d5)]?.({'type':_0x2d9809(0x1f1),'name':_0x1fe85e[_0x2d9809(0x2ac)]}),await _0x24ce2b[_0x2d9809(0x1f3)][_0x2d9809(0x1de)](_0x1fe85e['id']),_0x1494d6[_0x2d9809(0x1d5)]?.({'type':_0x2d9809(0x1e0),'name':_0x1fe85e[_0x2d9809(0x2ac)]}),_0x1494d6[_0x2d9809(0x262)]?.(_0x2d9809(0x29b)+_0x1fe85e[_0x2d9809(0x2ac)]+'\x27'),0x1;},_0x37ce92);return _0x3f9e06[_0x30ab5a(0x1f6)]((_0x2e0bdf,_0x32f021)=>_0x2e0bdf+_0x32f021,0x0);}function a97_0x526f(){const _0x1d3ef6=['Updating\x20activation\x20\x27','Created\x20journey\x20\x27','split','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','createActivation','state','connector_config','name','journeyActivationStepId','toLowerCase','updated','Journey\x20\x27','connectionIdToNameMap','progress','NOT_FOUND','find','embeddedSegmentNameToId','onProgress','relationships','Updating\x20segment\x20\x27','with','segmentNameToId','journey_creating','\x20segment\x20from\x20file:\x20','max','7761753XAbtjN','deleteSegment','2196FswBHN','segment_deleted','createdSegmentId','activation_deleted','set','Updated\x20segment\x20\x27','SEGMENT_NOT_FOUND','updateActivation','nameToId','join','entryCriteria','effectiveFolderId','\x27\x20from\x20file:\x20','notification','activation_created','activation_template_id','index','Creating\x20segment\x20\x27','segment_deleting','Activation','segment','./child-segment-yaml.js','existingSegment','reduce','parentSegmentFolder','10pUszqN','journey_entry_criteria_','entries','includes','fetchJourney','unchanged','SEGMENT_SYNTAX_ERROR','folder_creating','ACTIVATION_UPDATE_ERROR','activations','Segment\x20not\x20found:\x20','validatedRequest','slice','yamlActivation','segment_updated','__pending_','decision_point','draft','type','listSegments','behavior','activationsBySegmentId','activationContext','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','branches','embedded_activation_created','95KNdwKP','stage\x20\x27','hasChanges','localSegmentRules','12357026IYXMeu','map','journeyBundleName','created','Failed\x20to\x20','INTERNAL','absolutePath','startsWith','resolveJourneyId','withProgress','segmentByFolderAndName','milestone','journeyById','verbose','segments','198784SPoSsU','journeyId','\x20(referenced\x20in\x20journey\x20','activationActions','segmentId','createJourneySegment','parentFolder','skipSegments','7947536ZzQnei','connection','values','folder','\x27\x20for\x20','toString','rootFolderId','idToEmailMap','updateSegmentById','logSuccess','description','exitCriterias','embedded_activation_creating','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','kind','flatMap','segment_creating','JOURNEY_SYNTAX_ERROR','data','existingSegments','folder_created','parseDocument','journeyActivationNameToId','activation_','columns','existingActivation','folderPath','journeyStages','Fetching\x20','\x27\x20milestone','JOURNEY_UPDATE_ERROR','parentId','stringify','\x27...','journeys','action','journey_updated','Entry\x20criteria:\x20','user','keys','../../utils/async.js','2166aAMQdG','journeyBundlesByFolderAndName','Created\x20folder\x20\x27','goal','listActivations','embedded_segment_creating','object','\x20journey\x20from\x20file:\x20','\x27\x20exit\x20criteria','results','43372hyEakw','replace','logDeleted','item','digest','update','from','folderId','message','existingJourney','\x27\x20entry\x20criteria','versionNumber','null','\x20activation\x20\x27','Created\x20activation\x20\x27','get','yamlConfig','journey','utf-8','getSegment','all','deleteActivation','1272cbkkaw','Name\x20has\x20already\x20been\x20taken','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','push','journey_updating','createSegment','valid','DecisionPoint','getJourney','entry_criteria','goal\x20criteria','parse','create','attributes','length','createdSegmentIds','segmentFolderId','relative','dirname','isArray','getActivation','steps','Deleting\x20activation\x20\x27','filter','rule','size','folderPathToId','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','activation_updated','has','\x0a\x20\x20','entry','activation_deleting','schedule','deps','diff','\x27\x20decision\x20point\x20branch\x20\x27','Deleted\x20segment\x20\x27','journey_created','all_columns','delete','add','1168359tdkJbk','isNew','resolveSegment','idToName','deleted'];a97_0x526f=function(){return _0x1d3ef6;};return a97_0x526f();}export async function executePushJourneys(_0x44c5fc,_0x3d6844,_0x5da6ff,_0xb2a523,_0x59087a){const _0x2abc32=a97_0x1ead5a,{journeyDefToRequest:_0xcd252e}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x29833d,yamlRuleToApi:_0x2a60c3,validateSegmentRule:_0xb68c97}=await import(_0x2abc32(0x1f4)),_0x4c5296={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x370bcb=new Map(_0x5da6ff['segmentNameToId']),_0xa5ea9a=0x5;for(let _0x2c7eb4=0x0;_0x2c7eb4<_0x3d6844[_0x2abc32(0x284)];_0x2c7eb4+=_0xa5ea9a){const _0x835734=_0x3d6844[_0x2abc32(0x204)](_0x2c7eb4,_0x2c7eb4+_0xa5ea9a),_0x1d77d7=await Promise[_0x2abc32(0x274)](_0x835734[_0x2abc32(0x217)](async _0x113376=>{const _0x2414cc=_0x2abc32;if(!_0x113376[_0x2414cc(0x2a1)]&&!_0x113376['hasChanges'])return{'action':_0x2414cc(0x1fd),'name':_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)],'journeyId':_0x113376[_0x2414cc(0x269)]?.['id']};const _0x1f2fcc=_0x113376[_0x2414cc(0x247)]?_0x5da6ff[_0x2414cc(0x290)][_0x2414cc(0x26f)](_0x113376[_0x2414cc(0x247)]):undefined;_0x59087a[_0x2414cc(0x1d5)]?.({'type':_0x113376[_0x2414cc(0x2a1)]?_0x2414cc(0x1da):_0x2414cc(0x27a),'name':_0x113376['yamlConfig'][_0x2414cc(0x2ac)]});try{const _0x1f0772=await executeSingleJourneyPush(_0x44c5fc,_0x113376,{..._0x5da6ff,'segmentNameToId':_0x370bcb},{'parentId':_0xb2a523[_0x2414cc(0x24c)],'rootFolderId':_0xb2a523[_0x2414cc(0x233)],'folderId':_0x1f2fcc,'verbose':_0xb2a523[_0x2414cc(0x223)]},_0x59087a,{'journeyDefToRequest':_0xcd252e,'activationDefToCreateRequest':_0x29833d,'yamlRuleToApi':_0x2a60c3,'validateSegmentRule':_0xb68c97});for(const [_0x21c38b,_0x20e638]of _0x1f0772['embeddedSegmentNameToId']){_0x370bcb['set'](_0x21c38b,_0x20e638),_0x4c5296[_0x2414cc(0x1d4)][_0x2414cc(0x1e3)](_0x21c38b,_0x20e638);}if(_0x1f0772['action']===_0x2414cc(0x219))_0x59087a[_0x2414cc(0x1d5)]?.({'type':_0x2414cc(0x29c),'name':_0x113376['yamlConfig'][_0x2414cc(0x2ac)],'journeyId':_0x1f0772[_0x2414cc(0x226)]}),_0x59087a[_0x2414cc(0x236)]?.(_0x2414cc(0x2a6)+_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)]+'\x27'),_0x4c5296[_0x2414cc(0x219)]++;else _0x1f0772[_0x2414cc(0x250)]==='updated'&&(_0x59087a[_0x2414cc(0x1d5)]?.({'type':_0x2414cc(0x251),'name':_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)]}),_0x59087a[_0x2414cc(0x236)]?.('Updated\x20journey\x20\x27'+_0x113376[_0x2414cc(0x270)][_0x2414cc(0x2ac)]+'\x27'),_0x4c5296[_0x2414cc(0x2af)]++);return{'action':_0x1f0772[_0x2414cc(0x250)],'name':_0x113376[_0x2414cc(0x270)]['name'],'journeyId':_0x1f0772['journeyId']};}catch(_0x3ec069){const _0x40bf01=isHttp400Error(_0x3ec069),_0x3c4204=_0x40bf01?ErrorCode[_0x2414cc(0x23e)]:ErrorCode[_0x2414cc(0x24b)],_0xd6868b=getErrorMessage(_0x3ec069);throw new SDKError(_0x3c4204,_0x2414cc(0x21a)+(_0x113376['isNew']?_0x2414cc(0x282):_0x2414cc(0x265))+_0x2414cc(0x25d)+_0x113376[_0x2414cc(0x21c)]+'\x0a\x20\x20'+_0xd6868b,_0x3ec069);}}));_0x4c5296[_0x2abc32(0x25f)][_0x2abc32(0x279)](..._0x1d77d7);}return _0x4c5296;}async function executeSingleJourneyPush(_0x1ae651,_0x1c163f,_0x55e341,_0x32d0da,_0x4e8d2c,_0xec5a15){const _0x55deaa=a97_0x1ead5a,{journeyDefToRequest:_0x25dc70,activationDefToCreateRequest:_0x5667b6,yamlRuleToApi:_0x4f4e6f,validateSegmentRule:_0x28ba31}=_0xec5a15,_0x24e104=new Map(),_0x4d0cec=new Map(),_0x332fae=new Map(),_0x643e8=new Map(),_0x1937d3=new Map();let _0x585e53;const _0x3138a1=async()=>{const _0x5d0a48=a97_0x5c6b;if(_0x585e53)return;_0x585e53=new Map();if(!_0x1c163f['existingJourney'])return;const _0x22538f=await _0x1ae651['journey'][_0x5d0a48(0x25a)](_0x1c163f['existingJourney']['id']);for(const _0x54c973 of _0x22538f){const _0x5aba7e=journeyActivationStepToYaml(_0x54c973,_0x55e341[_0x5d0a48(0x234)],_0x55e341[_0x5d0a48(0x1d0)]),_0xdeb086=activationSignature(_0x5aba7e);!_0x585e53[_0x5d0a48(0x293)](_0xdeb086)&&_0x585e53[_0x5d0a48(0x1e3)](_0xdeb086,_0x54c973['id']),_0x5aba7e[_0x5d0a48(0x2ac)]&&_0x4d0cec[_0x5d0a48(0x1e3)](_0x5aba7e[_0x5d0a48(0x2ac)],_0x54c973['id']);}};if(_0x1c163f['existingJourney']&&_0x1c163f[_0x55deaa(0x270)][_0x55deaa(0x224)]){const _0x5bb817=buildLocalExpandedRuleMappings(_0x1c163f[_0x55deaa(0x270)]),_0x3a40d9=_0x5bb817[_0x55deaa(0x215)];if(_0x3a40d9[_0x55deaa(0x28f)]>0x0){const _0x19ddfc=new Map();for(const [_0x309f3b,_0x2e122d]of _0x3a40d9){const _0x1110d9=serializeExpandedRule(_0x2e122d,_0x3a40d9);_0x19ddfc[_0x55deaa(0x1e3)](_0x309f3b,_0x1110d9);}const _0x41ec7a=collectSegmentIdsFromJourneyApi(_0x1c163f['existingJourney']);if(_0x41ec7a[_0x55deaa(0x28f)]>0x0){const _0x32a765=await buildServerSegmentRuleMap(_0x1ae651,_0x32d0da[_0x55deaa(0x24c)],_0x55e341[_0x55deaa(0x240)],_0x41ec7a);if(_0x32a765[_0x55deaa(0x28f)]>0x0){const _0x3fcc16=new Map();for(const [_0x446aec,_0x293741]of _0x32a765){const _0x5d797a=serializeExpandedRule(_0x293741,_0x32a765);!_0x3fcc16['has'](_0x5d797a)&&_0x3fcc16['set'](_0x5d797a,_0x446aec);}for(const [_0x2e2fbd,_0x398fff]of _0x19ddfc){const _0x10843f=_0x3fcc16[_0x55deaa(0x26f)](_0x398fff);_0x10843f&&(_0x1937d3[_0x55deaa(0x1e3)](_0x2e2fbd,_0x10843f),_0x55e341[_0x55deaa(0x1d9)][_0x55deaa(0x1e3)](_0x2e2fbd,_0x10843f));}}}}}const _0x5df866={'resolveSegmentId':async _0x26440d=>{const _0x508063=_0x55deaa,_0x433850=_0x55e341[_0x508063(0x1d9)][_0x508063(0x26f)](_0x26440d);if(!_0x433850)throw new SDKError(ErrorCode[_0x508063(0x1e5)],_0x508063(0x202)+_0x26440d+'\x20(referenced\x20in\x20journey\x20'+_0x1c163f['yamlConfig'][_0x508063(0x2ac)]+')');return _0x433850;},'resolveEmbeddedSegmentId':async(_0x5b4372,_0x57e8a9)=>{const _0xdbd445=_0x55deaa,_0x19c472=_0x55e341[_0xdbd445(0x1d9)]['get'](_0x5b4372);if(_0x19c472)return _0x19c472;const _0xb35bc2=_0x1937d3['get'](_0x5b4372);if(_0xb35bc2)return _0x55e341['segmentNameToId'][_0xdbd445(0x1e3)](_0x5b4372,_0xb35bc2),_0xb35bc2;const _0x33a323=_0x55e341[_0xdbd445(0x240)][_0xdbd445(0x1d3)](_0x344faf=>_0x344faf['name']===_0x5b4372);if(_0x33a323)return _0x55e341['segmentNameToId'][_0xdbd445(0x1e3)](_0x5b4372,_0x33a323['id']),_0x33a323['id'];if(_0x1c163f[_0xdbd445(0x2a1)]){const {stageName:_0x3e586c,criteriaName:_0x4b8c60}=findSegmentCriteriaLocation(_0x1c163f[_0xdbd445(0x270)],_0x5b4372);return _0x28ba31(_0x5b4372,_0x57e8a9[_0xdbd445(0x28e)]),_0x332fae[_0xdbd445(0x1e3)](_0x5b4372,{'definition':_0x57e8a9,'stageName':_0x3e586c,'criteriaName':_0x4b8c60}),createPendingSegmentId(_0x5b4372);}const _0x116647=_0x1c163f[_0xdbd445(0x269)]?.['id'];if(!_0x116647)throw new SDKError(ErrorCode[_0xdbd445(0x21b)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');_0x28ba31(_0x5b4372,_0x57e8a9['rule']);const _0x189ab8=generateDeterministicJourneySegmentName(_0x1c163f[_0xdbd445(0x270)][_0xdbd445(0x2ac)],_0x5b4372),_0x432463=_0x55e341[_0xdbd445(0x240)][_0xdbd445(0x1d3)](_0x15b468=>_0x15b468[_0xdbd445(0x2ac)]===_0x189ab8),_0x57df72=createSegmentIdResolver(_0x55e341['segmentNameToId'],_0x5b4372),_0x9b27c8=await resolveRuleSegmentIds(_0x57e8a9[_0xdbd445(0x28e)],_0x57df72);let _0x3beb62;if(_0x432463)await _0x1ae651[_0xdbd445(0x1f3)]['updateSegmentById'](_0x32d0da[_0xdbd445(0x24c)],_0x432463['id'],{'description':_0x57e8a9[_0xdbd445(0x237)]||_0xdbd445(0x252)+_0x5b4372,'rule':_0x4f4e6f(_0x9b27c8,!![]),'countPopulation':!![]}),_0x3beb62=_0x432463['id'];else try{_0x3beb62=await _0x1ae651['segment'][_0xdbd445(0x22a)]({'name':_0x189ab8,'description':_0x57e8a9['description']||_0xdbd445(0x252)+_0x5b4372,'journeyId':_0x116647,'rule':_0x4f4e6f(_0x9b27c8,!![]),'countPopulation':!![],'parentFolderId':_0x32d0da[_0xdbd445(0x233)]||'','audienceId':_0x32d0da[_0xdbd445(0x24c)]});}catch(_0x5733e0){const _0x7ce133=_0x5733e0 instanceof Error&&_0x5733e0[_0xdbd445(0x268)][_0xdbd445(0x1fb)](_0xdbd445(0x277));if(_0x7ce133){const _0x3d2d44=await _0x1ae651[_0xdbd445(0x1f3)][_0xdbd445(0x20b)](_0x32d0da[_0xdbd445(0x24c)]),_0x1a67c1=_0x3d2d44['find'](_0x9eb152=>_0x9eb152[_0xdbd445(0x2ac)]===_0x189ab8);if(_0x1a67c1)await _0x1ae651[_0xdbd445(0x1f3)][_0xdbd445(0x235)](_0x32d0da[_0xdbd445(0x24c)],_0x1a67c1['id'],{'description':_0x57e8a9[_0xdbd445(0x237)]||_0xdbd445(0x252)+_0x5b4372,'rule':_0x4f4e6f(_0x9b27c8,!![]),'countPopulation':!![]}),_0x3beb62=_0x1a67c1['id'];else throw _0x5733e0;}else throw _0x5733e0;}return _0x55e341['segmentNameToId'][_0xdbd445(0x1e3)](_0x5b4372,_0x3beb62),_0x24e104[_0xdbd445(0x1e3)](_0x5b4372,_0x3beb62),_0x3beb62;},'resolveActivationId':async _0x100332=>{const _0x384407=_0x55deaa,_0x5a6b1b=_0x4d0cec[_0x384407(0x26f)](_0x100332);if(_0x5a6b1b)return _0x5a6b1b;if(_0x1c163f[_0x384407(0x269)]){await _0x3138a1();const _0x476ea7=_0x4d0cec[_0x384407(0x26f)](_0x100332);if(_0x476ea7)return _0x476ea7;}throw new SDKError(ErrorCode[_0x384407(0x1d2)],'Activation\x20not\x20found:\x20'+_0x100332+_0x384407(0x227)+_0x1c163f[_0x384407(0x270)][_0x384407(0x2ac)]+').\x20'+_0x384407(0x23a));},'resolveEmbeddedActivationId':async(_0x16e08d,_0x599b93)=>{const _0x39a30a=_0x55deaa,_0x25125e=_0x4d0cec[_0x39a30a(0x26f)](_0x16e08d);if(_0x25125e)return _0x25125e;if(_0x1c163f[_0x39a30a(0x2a1)])return _0x643e8[_0x39a30a(0x1e3)](_0x16e08d,_0x599b93),createPendingActivationId(_0x16e08d);if(_0x1c163f[_0x39a30a(0x269)]){await _0x3138a1();const _0x10e723=_0x4d0cec[_0x39a30a(0x26f)](_0x599b93['name']);if(_0x10e723)return _0x4d0cec[_0x39a30a(0x1e3)](_0x16e08d,_0x10e723),_0x10e723;const _0x59de04=activationSignature(_0x599b93),_0xc53e05=_0x585e53?.[_0x39a30a(0x26f)](_0x59de04);if(_0xc53e05)return _0x4d0cec['set'](_0x16e08d,_0xc53e05),_0xc53e05;const _0x58d937=await _0x5667b6(_0x599b93,_0x55e341[_0x39a30a(0x20e)]),_0x38e4b1=await _0x1ae651[_0x39a30a(0x271)][_0x39a30a(0x2a9)](_0x1c163f[_0x39a30a(0x269)]['id'],_0x58d937);return _0x4d0cec['set'](_0x16e08d,_0x38e4b1['id']),_0x38e4b1['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x39a30a(0x291));},'resolveJourneyId':async _0x4259c9=>{const _0x13a11b=_0x55deaa;try{return await _0x1ae651[_0x13a11b(0x271)][_0x13a11b(0x21e)](_0x32d0da['parentId'],_0x4259c9);}catch(_0x54a377){throw new SDKError(ErrorCode[_0x13a11b(0x1d2)],_0x13a11b(0x1cf)+_0x4259c9+_0x13a11b(0x2a8)+_0x1c163f[_0x13a11b(0x270)][_0x13a11b(0x2ac)]+'\x27)',_0x54a377);}},'resolveStageId':async(_0x9a1c6b,_0x2b7911)=>{const _0x570167=_0x55deaa,_0x36c5ad=await _0x1ae651[_0x570167(0x271)][_0x570167(0x27e)](_0x9a1c6b),_0x30a8ad=_0x36c5ad['attributes'][_0x570167(0x248)]['find'](_0x28cd8e=>_0x28cd8e['name'][_0x570167(0x2ae)]()===_0x2b7911[_0x570167(0x2ae)]());if(!_0x30a8ad?.['id'])throw new SDKError(ErrorCode[_0x570167(0x1d2)],'Stage\x20\x27'+_0x2b7911+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x36c5ad[_0x570167(0x283)][_0x570167(0x218)]||_0x36c5ad[_0x570167(0x283)][_0x570167(0x2ac)])+'\x27');return _0x30a8ad['id'];}},_0x348acd=await _0x25dc70(_0x1c163f[_0x55deaa(0x270)],_0x32d0da[_0x55deaa(0x24c)],_0x5df866),_0x1276bc=_0x32d0da[_0x55deaa(0x267)]||_0x32d0da[_0x55deaa(0x233)];_0x1276bc&&(_0x348acd[_0x55deaa(0x1d6)]={'parentFolder':{'data':{'id':_0x1276bc,'type':_0x55deaa(0x230)}}});if(_0x1c163f[_0x55deaa(0x2a1)]){if(_0x332fae['size']>0x0||_0x643e8[_0x55deaa(0x28f)]>0x0)return await executeThreeStepJourneyCreate(_0x1ae651,_0x1c163f,_0x348acd,{'pendingEmbeddedSegments':_0x332fae,'pendingEmbeddedActivations':_0x643e8,'embeddedSegmentNameToId':_0x24e104,'journeyActivationNameToId':_0x4d0cec},{..._0x32d0da,'effectiveFolderId':_0x1276bc},_0x55e341,_0x4e8d2c,_0xec5a15);else{ensureJourneyDefaults(_0x348acd[_0x55deaa(0x283)]);const _0x4bb66b=await _0x1ae651['journey'][_0x55deaa(0x282)](_0x348acd);return{'action':_0x55deaa(0x219),'journeyId':_0x4bb66b['id'],'embeddedSegmentNameToId':_0x24e104};}}else{if(_0x1c163f['hasChanges']&&_0x1c163f[_0x55deaa(0x269)])return ensureJourneyDefaults(_0x348acd[_0x55deaa(0x283)]),await _0x1ae651[_0x55deaa(0x271)][_0x55deaa(0x265)](_0x1c163f[_0x55deaa(0x269)]['id'],_0x348acd),{'action':_0x55deaa(0x2af),'journeyId':_0x1c163f['existingJourney']['id'],'embeddedSegmentNameToId':_0x24e104};}return{'action':_0x55deaa(0x1fd),'journeyId':_0x1c163f[_0x55deaa(0x269)]?.['id'],'embeddedSegmentNameToId':_0x24e104};}function findSegmentCriteriaLocation(_0x354004,_0x57ffc2){const _0x41f1a6=a97_0x1ead5a,_0x4e819d=_0x354004['stages']||_0x354004[_0x41f1a6(0x24f)]?.[0x0]?.['stages']||[];let _0x20726e=_0x41f1a6(0x295),_0x4f81ef=_0x57ffc2;const _0x5438fe=_0x354004[_0x41f1a6(0x259)]||_0x354004[_0x41f1a6(0x24f)]?.[0x0]?.[_0x41f1a6(0x259)];if(_0x5438fe?.[_0x41f1a6(0x1f3)]===_0x57ffc2)return{'stageName':_0x41f1a6(0x259),'criteriaName':_0x5438fe['name']||_0x57ffc2};_0x4728e9:for(const _0x3b86d3 of _0x4e819d){if(_0x3b86d3[_0x41f1a6(0x27f)]?.['segment']===_0x57ffc2){_0x20726e=_0x3b86d3[_0x41f1a6(0x2ac)],_0x4f81ef=_0x3b86d3[_0x41f1a6(0x27f)][_0x41f1a6(0x2ac)]||_0x57ffc2;break;}if(_0x3b86d3[_0x41f1a6(0x28b)])for(const _0x51f4b2 of _0x3b86d3[_0x41f1a6(0x28b)]){if(_0x51f4b2[_0x41f1a6(0x20a)]===_0x41f1a6(0x208)&&_0x51f4b2[_0x41f1a6(0x1d8)]?.['branches'])for(const _0x5d5560 of _0x51f4b2[_0x41f1a6(0x1d8)]['branches']){if(_0x5d5560[_0x41f1a6(0x1f3)]===_0x57ffc2){_0x20726e=_0x3b86d3[_0x41f1a6(0x2ac)],_0x4f81ef=_0x5d5560[_0x41f1a6(0x2ac)]||_0x57ffc2;break _0x4728e9;}}}}return{'stageName':_0x20726e,'criteriaName':_0x4f81ef};}async function executeThreeStepJourneyCreate(_0x5cbec8,_0x5dd5e0,_0x5ccafb,_0x2ed942,_0xddcdf6,_0x2a633e,_0x15f308,_0x1621d9){const _0x1e7629=a97_0x1ead5a,{activationDefToCreateRequest:_0x9a0a74,yamlRuleToApi:_0x4ba149}=_0x1621d9,{pendingEmbeddedSegments:_0x687a5e,pendingEmbeddedActivations:_0x4e2e13,embeddedSegmentNameToId:_0x3505e4}=_0x2ed942,_0x470c27=JSON[_0x1e7629(0x281)](JSON[_0x1e7629(0x24d)](_0x5ccafb));ensureJourneyDefaults(_0x470c27[_0x1e7629(0x283)]),stripPendingIds(_0x470c27);const _0x463067=await _0x5cbec8[_0x1e7629(0x271)]['create'](_0x470c27),_0x547e4e=_0x463067['id'],_0x577a26=new Map();for(const _0x5aa09d of _0x463067[_0x1e7629(0x283)]['journeyStages']){_0x577a26[_0x1e7629(0x1e3)](_0x5aa09d[_0x1e7629(0x2ac)][_0x1e7629(0x2ae)](),_0x5aa09d['id']);}for(const [_0x1d7717,{definition:_0x4274c8}]of _0x687a5e){const _0x443b00=generateDeterministicJourneySegmentName(_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],_0x1d7717);_0x15f308[_0x1e7629(0x1d5)]?.({'type':_0x1e7629(0x25b),'journeyName':_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],'segmentName':_0x1d7717});const _0x8c6132=createSegmentIdResolver(_0x2a633e['segmentNameToId'],_0x1d7717),_0x314cf7=await resolveRuleSegmentIds(_0x4274c8[_0x1e7629(0x28e)],_0x8c6132),_0x3c3732=await _0x5cbec8[_0x1e7629(0x1f3)][_0x1e7629(0x22a)]({'name':_0x443b00,'description':_0x4274c8[_0x1e7629(0x237)]||_0x1e7629(0x252)+_0x1d7717,'journeyId':_0x547e4e,'rule':_0x4ba149(_0x314cf7,!![]),'countPopulation':!![],'parentFolderId':_0xddcdf6[_0x1e7629(0x1ea)]||'','audienceId':_0xddcdf6[_0x1e7629(0x24c)]});_0x3505e4[_0x1e7629(0x1e3)](_0x1d7717,_0x3c3732),_0x2a633e['segmentNameToId'][_0x1e7629(0x1e3)](_0x1d7717,_0x3c3732),_0x15f308[_0x1e7629(0x1d5)]?.({'type':'embedded_segment_created','journeyName':_0x5dd5e0[_0x1e7629(0x270)]['name'],'segmentName':_0x1d7717});}const _0x37f5d6=new Map();for(const [_0x4f7ac6,_0x3031ee]of _0x4e2e13){_0x15f308['onProgress']?.({'type':_0x1e7629(0x239),'journeyName':_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],'activationName':_0x4f7ac6});const _0x3b4f3b=await _0x9a0a74(_0x3031ee,_0x2a633e[_0x1e7629(0x20e)]),_0x2a139f=await _0x5cbec8[_0x1e7629(0x271)]['createActivation'](_0x547e4e,_0x3b4f3b);_0x37f5d6[_0x1e7629(0x1e3)](_0x4f7ac6,_0x2a139f['id']),_0x2ed942[_0x1e7629(0x243)][_0x1e7629(0x1e3)](_0x4f7ac6,_0x2a139f['id']),_0x15f308['onProgress']?.({'type':_0x1e7629(0x211),'journeyName':_0x5dd5e0[_0x1e7629(0x270)][_0x1e7629(0x2ac)],'activationName':_0x4f7ac6});}const _0x47211d=JSON[_0x1e7629(0x281)](JSON['stringify'](_0x5ccafb));return _0x47211d['id']=_0x547e4e,ensureJourneyDefaults(_0x47211d['attributes']),resolvePendingIdsInRequest(_0x47211d,_0x5ccafb,_0x577a26,_0x3505e4,_0x37f5d6,_0x15f308),await _0x5cbec8[_0x1e7629(0x271)][_0x1e7629(0x265)](_0x547e4e,_0x47211d),{'action':'created','journeyId':_0x547e4e,'embeddedSegmentNameToId':_0x3505e4};}function stripPendingIds(_0x532b57){const _0x114880=a97_0x1ead5a;for(const _0x52930a of _0x532b57[_0x114880(0x283)][_0x114880(0x248)]||[]){_0x52930a[_0x114880(0x1e9)]?.[_0x114880(0x229)]&&isPendingSegmentId(_0x52930a[_0x114880(0x1e9)][_0x114880(0x229)])&&delete _0x52930a[_0x114880(0x1e9)];if(_0x52930a[_0x114880(0x28b)])for(const _0x514a18 of Object['keys'](_0x52930a[_0x114880(0x28b)])){const _0x38cfc7=_0x52930a['steps'][_0x514a18];_0x38cfc7['type']===_0x114880(0x1f2)&&_0x38cfc7['journeyActivationStepId']&&isPendingActivationId(_0x38cfc7[_0x114880(0x2ad)])&&(_0x38cfc7[_0x114880(0x2ad)]='');if(_0x38cfc7[_0x114880(0x20a)]===_0x114880(0x27d)&&_0x38cfc7[_0x114880(0x210)])for(const _0xb0d518 of _0x38cfc7[_0x114880(0x210)]){_0xb0d518[_0x114880(0x229)]&&isPendingSegmentId(_0xb0d518[_0x114880(0x229)])&&(_0xb0d518[_0x114880(0x229)]='');}}}}function resolvePendingIdsInRequest(_0x500f4d,_0x49d4c8,_0x8ca504,_0x47bb91,_0x38b772,_0x42cd8){const _0x273d69=a97_0x1ead5a,_0x42db76=(_0x40aa78,_0x2fbcef)=>{const _0x38a0f2=a97_0x5c6b;if(!isPendingSegmentId(_0x40aa78))return _0x40aa78;const _0x24e5e5=extractPendingSegmentName(_0x40aa78),_0xd70e08=_0x47bb91['get'](_0x24e5e5);return!_0xd70e08&&_0x42cd8['logWarning']?.(_0x38a0f2(0x278)+_0x24e5e5+_0x38a0f2(0x231)+_0x2fbcef),_0xd70e08;};if(_0x500f4d[_0x273d69(0x283)][_0x273d69(0x259)]?.[_0x273d69(0x229)]&&isPendingSegmentId(_0x500f4d[_0x273d69(0x283)][_0x273d69(0x259)][_0x273d69(0x229)])){const _0x3275ed=_0x42db76(_0x500f4d[_0x273d69(0x283)]['goal'][_0x273d69(0x229)],_0x273d69(0x280));_0x3275ed&&(_0x500f4d[_0x273d69(0x283)][_0x273d69(0x259)][_0x273d69(0x229)]=_0x3275ed);}for(const _0x3b0164 of _0x500f4d[_0x273d69(0x283)]['journeyStages']||[]){const _0x1a9b88=_0x8ca504[_0x273d69(0x26f)](_0x3b0164[_0x273d69(0x2ac)][_0x273d69(0x2ae)]());_0x1a9b88&&(_0x3b0164['id']=_0x1a9b88);if(_0x3b0164[_0x273d69(0x1e9)]?.[_0x273d69(0x229)]&&isPendingSegmentId(_0x3b0164[_0x273d69(0x1e9)][_0x273d69(0x229)])){const _0x58be8d=_0x42db76(_0x3b0164[_0x273d69(0x1e9)][_0x273d69(0x229)],'stage\x20\x27'+_0x3b0164[_0x273d69(0x2ac)]+_0x273d69(0x26a));_0x58be8d&&(_0x3b0164[_0x273d69(0x1e9)]['segmentId']=_0x58be8d);}if(_0x3b0164[_0x273d69(0x238)])for(const _0x4d9c63 of _0x3b0164[_0x273d69(0x238)]){if(_0x4d9c63[_0x273d69(0x229)]&&isPendingSegmentId(_0x4d9c63[_0x273d69(0x229)])){const _0x459fb0=_0x42db76(_0x4d9c63[_0x273d69(0x229)],_0x273d69(0x213)+_0x3b0164['name']+_0x273d69(0x25e));_0x459fb0&&(_0x4d9c63[_0x273d69(0x229)]=_0x459fb0);}}if(_0x3b0164[_0x273d69(0x221)]?.['segmentId']&&isPendingSegmentId(_0x3b0164[_0x273d69(0x221)][_0x273d69(0x229)])){const _0x2a98ab=_0x42db76(_0x3b0164[_0x273d69(0x221)][_0x273d69(0x229)],_0x273d69(0x213)+_0x3b0164[_0x273d69(0x2ac)]+_0x273d69(0x24a));_0x2a98ab&&(_0x3b0164['milestone'][_0x273d69(0x229)]=_0x2a98ab);}if(_0x3b0164[_0x273d69(0x28b)]){const _0x1f6ac9=_0x5ea69f=>_0x49d4c8['attributes'][_0x273d69(0x248)]['find'](_0x1c78c5=>_0x1c78c5[_0x273d69(0x2ac)]['toLowerCase']()===_0x3b0164[_0x273d69(0x2ac)][_0x273d69(0x2ae)]())?.['steps']?.[_0x5ea69f];for(const _0x9878d2 of Object[_0x273d69(0x254)](_0x3b0164['steps'])){const _0x2c7f7c=_0x3b0164[_0x273d69(0x28b)][_0x9878d2],_0x3437f2=_0x1f6ac9(_0x9878d2);if(_0x2c7f7c[_0x273d69(0x20a)]===_0x273d69(0x1f2)&&_0x2c7f7c[_0x273d69(0x2ad)]&&(isPendingActivationId(_0x2c7f7c[_0x273d69(0x2ad)])||_0x2c7f7c[_0x273d69(0x2ad)]==='')){if(_0x3437f2?.['journeyActivationStepId']&&isPendingActivationId(_0x3437f2[_0x273d69(0x2ad)])){const _0x46bd3c=extractPendingActivationName(_0x3437f2[_0x273d69(0x2ad)]),_0x82b23d=_0x38b772[_0x273d69(0x26f)](_0x46bd3c);_0x82b23d&&(_0x2c7f7c[_0x273d69(0x2ad)]=_0x82b23d);}}if(_0x2c7f7c[_0x273d69(0x20a)]==='DecisionPoint'&&_0x2c7f7c[_0x273d69(0x210)]&&_0x3437f2?.[_0x273d69(0x210)])for(let _0xdca048=0x0;_0xdca048<_0x2c7f7c[_0x273d69(0x210)][_0x273d69(0x284)];_0xdca048++){const _0x5aba59=_0x2c7f7c[_0x273d69(0x210)][_0xdca048],_0x5107af=_0x3437f2['branches'][_0xdca048];if(_0x5107af?.[_0x273d69(0x229)]&&isPendingSegmentId(_0x5107af[_0x273d69(0x229)])){const _0x16d7be=_0x42db76(_0x5107af[_0x273d69(0x229)],_0x273d69(0x213)+_0x3b0164[_0x273d69(0x2ac)]+_0x273d69(0x29a)+(_0x5aba59[_0x273d69(0x2ac)]||_0xdca048)+'\x27');_0x16d7be&&(_0x5aba59[_0x273d69(0x229)]=_0x16d7be);}}}}}}
|