@treasuredata/tdx 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/api-command.js.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +1 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/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/profile-command.d.ts +3 -4
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +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/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +2 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +86 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -0
- package/dist/proxy/passthrough-server.js +1 -0
- package/dist/proxy/passthrough-server.js.map +1 -0
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +99 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -0
- package/dist/proxy/sse-usage-parser.js +1 -0
- package/dist/proxy/sse-usage-parser.js.map +1 -0
- 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.d.ts +5 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/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/index.d.ts +1 -1
- package/dist/sdk/types/index.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/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js.map +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.d.ts +60 -0
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +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 +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a98_0x545ff9=a98_0x1668;(function(_0x5cbce2,_0x3695ce){const _0x368ae2=a98_0x1668,_0x461531=_0x5cbce2();while(!![]){try{const _0x555eab=parseInt(_0x368ae2(0x201))/0x1*(parseInt(_0x368ae2(0x27c))/0x2)+parseInt(_0x368ae2(0x215))/0x3*(parseInt(_0x368ae2(0x1c0))/0x4)+parseInt(_0x368ae2(0x25d))/0x5+-parseInt(_0x368ae2(0x23c))/0x6+-parseInt(_0x368ae2(0x25f))/0x7+-parseInt(_0x368ae2(0x1e8))/0x8*(parseInt(_0x368ae2(0x220))/0x9)+-parseInt(_0x368ae2(0x1df))/0xa;if(_0x555eab===_0x3695ce)break;else _0x461531['push'](_0x461531['shift']());}catch(_0x4b5bc6){_0x461531['push'](_0x461531['shift']());}}}(a98_0x3634,0xe48a2));function a98_0x1668(_0x21142c,_0x279883){_0x21142c=_0x21142c-0x1ab;const _0x3634b6=a98_0x3634();let _0x16680b=_0x3634b6[_0x21142c];return _0x16680b;}import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a98_0x545ff9(0x225);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4a3209){return''+PENDING_SEGMENT_PREFIX+_0x4a3209+'__';}export function isPendingSegmentId(_0x5f2603){const _0x1a98d1=a98_0x545ff9;return _0x5f2603[_0x1a98d1(0x1cc)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x1618d6){const _0x344d8c=a98_0x545ff9;return _0x1618d6[_0x344d8c(0x237)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5876dc){return''+PENDING_ACTIVATION_PREFIX+_0x5876dc+'__';}export function isPendingActivationId(_0x53a585){const _0x3cb3f1=a98_0x545ff9;return _0x53a585[_0x3cb3f1(0x1cc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x19fea5){const _0xd635d6=a98_0x545ff9;return _0x19fea5[_0xd635d6(0x237)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x45e7ca,_0x5b3d6e){const _0x3a9698=a98_0x545ff9,_0x3793ae=_0x45e7ca+'::'+(_0x5b3d6e['trim']()||'segment'),_0x3eb22b=createHash(_0x3a9698(0x260))[_0x3a9698(0x203)](_0x3793ae)[_0x3a9698(0x261)]('hex')[_0x3a9698(0x26d)](0x0,0xc);return _0x3a9698(0x27a)+_0x3eb22b;}export function ensureJourneyDefaults(_0x24dcf5){const _0x3a694d=a98_0x545ff9;!_0x24dcf5[_0x3a694d(0x247)]&&(_0x24dcf5[_0x3a694d(0x247)]=''),!_0x24dcf5['state']&&(_0x24dcf5['state']='draft');}export function resolveTDFolderPath(_0x4b0350,_0x4380f6,_0x1a3324){if(!_0x4380f6)return _0x4b0350;if(_0x4b0350===_0x1a3324||_0x4b0350['startsWith'](_0x1a3324+'/'))return _0x4b0350;return _0x4b0350?_0x1a3324+'/'+_0x4b0350:_0x1a3324;}export function addFoldersToCreate(_0x456867,_0x5a3012,_0x3e2f5a){const _0x5559e6=a98_0x545ff9;if(!_0x456867)return;if(_0x5a3012[_0x5559e6(0x1f0)](_0x456867))return;const _0x54e9ba=_0x456867[_0x5559e6(0x1ce)]('/');let _0x478fae='';for(const _0x255ee3 of _0x54e9ba){_0x478fae=_0x478fae?_0x478fae+'/'+_0x255ee3:_0x255ee3,!_0x5a3012[_0x5559e6(0x1f0)](_0x478fae)&&_0x3e2f5a[_0x5559e6(0x23e)](_0x478fae);}}import*as a98_0x1fee7e from'yaml';import{readFileSync}from'fs';import a98_0x4a9171 from'path';import{isJourneyDef,parseYamlString as a98_0x13dd3b,toYamlString as a98_0x4774d0,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(_0x49b1db){const _0xd8a1b=a98_0x545ff9;if(Array[_0xd8a1b(0x20c)](_0x49b1db))return'['+_0x49b1db[_0xd8a1b(0x1bf)](_0x2f718d=>stableStringify(_0x2f718d))[_0xd8a1b(0x254)](',')+']';if(_0x49b1db&&typeof _0x49b1db==='object'){const _0x4165b1=_0x49b1db,_0x1425ff=Object[_0xd8a1b(0x228)](_0x4165b1)['sort'](),_0x4df573=_0x1425ff[_0xd8a1b(0x1bf)](_0x58e50a=>'\x22'+_0x58e50a+'\x22:'+stableStringify(_0x4165b1[_0x58e50a]));return'{'+_0x4df573[_0xd8a1b(0x254)](',')+'}';}const _0xb0ec35=JSON[_0xd8a1b(0x1b9)](_0x49b1db);return _0xb0ec35===undefined?'null':_0xb0ec35;}function activationSignature(_0x20783d){const _0x408bc7=a98_0x545ff9,_0x58fb3c={'connection':_0x20783d[_0x408bc7(0x213)],..._0x20783d['all_columns']!==undefined&&{'all_columns':_0x20783d[_0x408bc7(0x21f)]},..._0x20783d[_0x408bc7(0x21b)]!==undefined&&{'columns':_0x20783d['columns']},..._0x20783d['behavior']!==undefined&&{'behavior':_0x20783d['behavior']},..._0x20783d[_0x408bc7(0x1e6)]!==undefined&&{'schedule':_0x20783d[_0x408bc7(0x1e6)]},..._0x20783d[_0x408bc7(0x1d0)]!==undefined&&{'notification':_0x20783d[_0x408bc7(0x1d0)]},..._0x20783d[_0x408bc7(0x1b1)]!==undefined&&{'connector_config':_0x20783d['connector_config']},..._0x20783d['activation_template_id']!==undefined&&{'activation_template_id':_0x20783d[_0x408bc7(0x23d)]}};return stableStringify(_0x58fb3c);}export async function prepareSegmentFiles(_0x380f12,_0xf2dd12,_0x2d3c1c,_0x1e3a3e,_0x36873a){const _0x50988e=a98_0x545ff9,{activationDefToCreateRequest:_0x260dfd}=await import(_0x50988e(0x22f)),_0xfefd4a=[],_0x18c5cd=new Set();for(const {yamlConfig:_0x625ca7,folderPath:_0x25f21f,sourcePath:_0x278c5d}of _0x380f12){const _0x2174bc=resolveTDFolderPath(_0x25f21f,_0x1e3a3e,_0x36873a),_0x18736e=_0x2174bc+':'+_0x625ca7[_0x50988e(0x1e7)],_0x359101=_0xf2dd12['segmentByFolderAndName'][_0x50988e(0x1ad)](_0x18736e),_0x1927b1=_0x359101?_0xf2dd12[_0x50988e(0x1f6)]['get'](_0x359101['id'])||[]:[];addFoldersToCreate(_0x2174bc,_0xf2dd12[_0x50988e(0x1c7)],_0x18c5cd);const _0x25bf1b=calculateActivationActions(_0x625ca7[_0x50988e(0x245)]||[],_0x1927b1,_0xf2dd12[_0x50988e(0x1e5)],_0xf2dd12[_0x50988e(0x253)]);for(const _0x558756 of _0x25bf1b){(_0x558756[_0x50988e(0x1ef)]==='create'||_0x558756[_0x50988e(0x1ef)]===_0x50988e(0x203))&&_0x558756[_0x50988e(0x238)]&&(_0x558756[_0x50988e(0x281)]=await _0x260dfd(_0x558756[_0x50988e(0x238)],_0x2d3c1c));}const _0x322f3e=calculateSegmentDiff(_0x625ca7,_0x359101,_0x1927b1,_0xf2dd12[_0x50988e(0x1e5)],_0xf2dd12['connectionIdToNameMap']);_0xfefd4a[_0x50988e(0x277)]({'relativePath':_0x625ca7[_0x50988e(0x1e7)],'absolutePath':_0x278c5d,'yamlConfig':_0x625ca7,'folderPath':_0x2174bc,'existingSegment':_0x359101,'existingActivations':_0x1927b1,'isNew':_0x322f3e[_0x50988e(0x1e0)],'hasChanges':_0x322f3e['hasChanges'],'diff':_0x322f3e['diff'],'activationActions':_0x25bf1b});}return{'segmentFiles':_0xfefd4a,'foldersToCreate':_0x18c5cd};}export async function prepareJourneyFiles(_0x206c76,_0x4566b2,_0x4ceb89,_0x521ba1){const _0x2cb74e=a98_0x545ff9,_0x78b25b=[],_0x2933c6=new Set();for(const {yamlConfig:_0x3a5e3c,folderPath:_0x145240,sourcePath:_0x483d9b}of _0x206c76){const _0x5bd4c8=resolveTDFolderPath(_0x145240,_0x4ceb89,_0x521ba1),_0x26094c=_0x5bd4c8+':'+_0x3a5e3c[_0x2cb74e(0x1e7)],_0x5c3f84=_0x4566b2['journeyBundlesByFolderAndName'][_0x2cb74e(0x1ad)](_0x26094c);let _0x250b21,_0x466e28;if(_0x5c3f84&&_0x5c3f84[_0x2cb74e(0x226)]>0x0){const _0x518a1c=buildLocalExpandedRuleMappings(_0x3a5e3c),{createYamlContext:_0x35a34a,prefetchJourneySegments:_0xf9eaab}=createPushYamlContextForBundle(_0x4566b2[_0x2cb74e(0x1d8)],_0x4566b2[_0x2cb74e(0x231)],_0x4566b2[_0x2cb74e(0x24f)],_0x518a1c,_0x4566b2[_0x2cb74e(0x1e5)],_0x4566b2['connectionIdToNameMap'],_0x4566b2[_0x2cb74e(0x289)],_0x4566b2['journeyById']);await _0xf9eaab(_0x5c3f84[_0x2cb74e(0x1bf)](_0xee6b69=>_0xee6b69['id']));const _0x582cc0=hasMultipleVersions(_0x3a5e3c),_0x5d5f93=async _0x252c25=>{const _0x366c91=_0x2cb74e,_0xace943=_0x4566b2[_0x366c91(0x1c2)]?.['get'](_0x252c25);if(_0xace943)return _0xace943;return _0x4566b2[_0x366c91(0x1ba)]({'journeyId':_0x252c25,'journeyName':_0x3a5e3c[_0x366c91(0x1e7)],'isMultiVersion':_0x5c3f84[_0x366c91(0x226)]>0x1});};if(_0x582cc0&&_0x5c3f84[_0x2cb74e(0x226)]>0x1){const _0x25a2ea=[];for(const _0xc8832 of _0x5c3f84){const _0x4dc2b4=_0xc8832['versionNumber']||0x1;_0x4566b2[_0x2cb74e(0x246)]?.[_0x2cb74e(0x203)](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]+'\x20v'+_0x4dc2b4);const _0x10c506=await _0x5d5f93(_0xc8832['id']),_0x271050=_0x35a34a(_0xc8832['id']),_0x35637c=await journeyResponseToDef(_0x10c506,_0x271050);_0x25a2ea[_0x2cb74e(0x277)]({'item':_0xc8832,'yaml':_0x35637c});}const _0xe01b6a=buildLocalRuleToNameMappingFromJourney(_0x3a5e3c);_0x466e28=buildMergedJourneyDef(_0x25a2ea,_0xe01b6a);const _0x5861c1=Math[_0x2cb74e(0x234)](..._0x25a2ea[_0x2cb74e(0x1bf)](_0x4e167b=>_0x4e167b[_0x2cb74e(0x285)][_0x2cb74e(0x233)]||0x0)),_0x97753d=_0x5c3f84[_0x2cb74e(0x284)](_0x1b4f76=>(_0x1b4f76[_0x2cb74e(0x233)]||0x0)===_0x5861c1);_0x97753d&&(_0x4566b2[_0x2cb74e(0x246)]?.['update'](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]+'\x20v'+_0x5861c1),_0x250b21=await _0x5d5f93(_0x97753d['id']));}else{const _0x5d6569=_0x5c3f84[_0x5c3f84[_0x2cb74e(0x226)]-0x1];_0x4566b2[_0x2cb74e(0x246)]?.[_0x2cb74e(0x203)](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]),_0x250b21=await _0x5d5f93(_0x5d6569['id']);const _0x44f48b=_0x35a34a(_0x5d6569['id']),_0x258f80=await journeyResponseToDef(_0x250b21,_0x44f48b),_0x2bf4d1=buildLocalRuleToNameMappingFromJourney(_0x3a5e3c);_0x466e28=buildMergedJourneyDef([{'item':_0x5d6569,'yaml':_0x258f80}],_0x2bf4d1);}}addFoldersToCreate(_0x5bd4c8,_0x4566b2[_0x2cb74e(0x1c7)],_0x2933c6);const _0x2e456c=calculateJourneyDiff(_0x3a5e3c,_0x466e28);_0x78b25b[_0x2cb74e(0x277)]({'relativePath':_0x3a5e3c['name'],'absolutePath':_0x483d9b,'yamlConfig':_0x3a5e3c,'folderPath':_0x5bd4c8,'existingJourney':_0x250b21,'isNew':_0x2e456c['isNew'],'hasChanges':_0x2e456c[_0x2cb74e(0x1d4)],'diff':_0x2e456c[_0x2cb74e(0x24a)]});}return{'journeyFiles':_0x78b25b,'foldersToCreate':_0x2933c6};}export function calculateActivationActions(_0x3ccd10,_0x415286,_0x31a9c8,_0x48e22f){const _0x4fd9a5=a98_0x545ff9,_0x555781=[],_0x4e3ff7=new Map();for(const _0x9504ee of _0x415286){_0x4e3ff7[_0x4fd9a5(0x22b)](_0x9504ee[_0x4fd9a5(0x1e7)],_0x9504ee);}const _0x8d481f=new Map();for(const _0x30444a of _0x3ccd10){_0x8d481f[_0x4fd9a5(0x22b)](_0x30444a[_0x4fd9a5(0x1e7)],_0x30444a);}for(const _0x13fa34 of _0x3ccd10){const _0x4e3025=_0x4e3ff7[_0x4fd9a5(0x1ad)](_0x13fa34[_0x4fd9a5(0x1e7)]);if(!_0x4e3025)_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x270),'name':_0x13fa34[_0x4fd9a5(0x1e7)],'yamlActivation':_0x13fa34});else{const _0x41744c=activationResponseToDef(_0x4e3025,_0x31a9c8,_0x48e22f),_0x281436=a98_0x1fee7e[_0x4fd9a5(0x1b9)](_0x41744c),_0xf6962d=a98_0x1fee7e[_0x4fd9a5(0x1b9)](_0x13fa34);_0x281436!==_0xf6962d&&_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x203),'name':_0x13fa34[_0x4fd9a5(0x1e7)],'yamlActivation':_0x13fa34,'existingActivation':_0x4e3025});}}for(const _0x2aef59 of _0x415286){!_0x8d481f['has'](_0x2aef59['name'])&&_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x1c4),'name':_0x2aef59['name'],'existingActivation':_0x2aef59});}return _0x555781;}export function calculateSegmentDiff(_0x4668b4,_0x45e8e4,_0x4f502c,_0x96fca7,_0x4b6191){const _0x46c81f=segmentToYamlString(_0x4668b4);if(_0x45e8e4){const _0x596197=segmentWithActivationsToYaml(_0x45e8e4,_0x4f502c,undefined,_0x96fca7,_0x4b6191),_0x51004b=segmentToYamlString(_0x596197),_0x3384bd=generateDiff(_0x51004b,_0x46c81f),_0x45c540=hasChanges(_0x3384bd);return{'isNew':![],'hasChanges':_0x45c540,'diff':_0x45c540?formatDiffWithColors(_0x3384bd):undefined};}const _0x3292a1=generateDiff('',_0x46c81f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3292a1)};}export function calculateJourneyDiff(_0x26c8bd,_0x339806){const _0x310348=normalizeJourneyDef(_0x26c8bd,_0x26c8bd),_0x565cec=a98_0x4774d0(_0x310348);if(_0x339806){const _0x21a38e=normalizeJourneyDef(_0x339806,_0x26c8bd),_0x40de8b=a98_0x4774d0(_0x21a38e),_0x47d85c=generateDiff(_0x40de8b,_0x565cec),_0x254db3=hasChanges(_0x47d85c);return{'isNew':![],'hasChanges':_0x254db3,'diff':_0x254db3?formatDiffWithColors(_0x47d85c):undefined};}const _0x12eccb=generateDiff('',_0x565cec);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x12eccb)};}export function findSegmentsToDelete(_0x24f3aa,_0x5106b8,_0x47ca97,_0x154c59,_0x263b0d){const _0xd1f56=a98_0x545ff9,_0x5f164b=new Set();for(const {yamlConfig:_0x42cd13,folderPath:_0x4c489d}of _0x5106b8){_0x5f164b[_0xd1f56(0x23e)](_0x4c489d+':'+_0x42cd13['name']);}return _0x24f3aa['filter'](_0x481b80=>{const _0x40da34=_0xd1f56,_0x5c3148=_0x481b80[_0x40da34(0x22e)]?_0x47ca97[_0x40da34(0x1ad)](_0x481b80[_0x40da34(0x22e)][_0x40da34(0x1f2)]())||'':'',_0x4b7ae3=_0x5c3148+':'+_0x481b80[_0x40da34(0x1e7)];if(_0x5f164b[_0x40da34(0x1f0)](_0x4b7ae3))return![];if(_0x263b0d)return _0x5c3148===_0x154c59||_0x5c3148['startsWith'](_0x154c59+'/');return!![];});}export function findJourneysToDelete(_0xef9ae1,_0x391d7b,_0x19dc2a,_0x561d3d,_0x45d3e4){const _0xa1e6a7=a98_0x545ff9,_0x5acbac=new Set();for(const {yamlConfig:_0x31de67,folderPath:_0x43569b}of _0x391d7b){_0x5acbac[_0xa1e6a7(0x23e)](_0x43569b+':'+_0x31de67['name']);}return _0xef9ae1[_0xa1e6a7(0x20e)](_0x5ebdf1=>{const _0x374b62=_0xa1e6a7,_0x80abc6=_0x5ebdf1[_0x374b62(0x257)]?_0x19dc2a[_0x374b62(0x1ad)](_0x5ebdf1[_0x374b62(0x257)])||'':'',_0x9b2aec=_0x80abc6+':'+_0x5ebdf1['journeyBundleName'];if(_0x5acbac['has'](_0x9b2aec))return![];if(_0x45d3e4)return _0x80abc6===_0x561d3d||_0x80abc6[_0x374b62(0x1cc)](_0x561d3d+'/');return!![];});}export function buildSegmentLookupMap(_0x26bbc7,_0x65e4a){const _0x1d87c4=a98_0x545ff9,_0x53ba6a=new Map();for(const _0x20be35 of _0x26bbc7){const _0x32388b=_0x20be35['segmentFolderId']?_0x65e4a['get'](_0x20be35['segmentFolderId']['toString']())||'':'',_0x145c8e=_0x32388b+':'+_0x20be35[_0x1d87c4(0x1e7)];_0x53ba6a['set'](_0x145c8e,_0x20be35);}return _0x53ba6a;}export function buildSegmentNameToIdMap(_0x1d1b18){const _0x214b89=a98_0x545ff9,_0xc9246=new Map();for(const _0x1ea982 of _0x1d1b18){_0xc9246[_0x214b89(0x22b)](_0x1ea982[_0x214b89(0x1e7)],_0x1ea982['id']);}return _0xc9246;}export function buildJourneyBundleLookupMap(_0x7280aa,_0x50a519){const _0x43da6d=a98_0x545ff9,_0x2844fd=new Map();for(const _0x25a428 of _0x7280aa){const _0x2ed6d5=_0x25a428[_0x43da6d(0x257)]?_0x50a519['get'](_0x25a428[_0x43da6d(0x257)])||'':'',_0x10cd5f=_0x2ed6d5+':'+_0x25a428[_0x43da6d(0x274)];!_0x2844fd[_0x43da6d(0x1f0)](_0x10cd5f)&&_0x2844fd[_0x43da6d(0x22b)](_0x10cd5f,[]),_0x2844fd[_0x43da6d(0x1ad)](_0x10cd5f)['push'](_0x25a428);}for(const _0x30b540 of _0x2844fd[_0x43da6d(0x1d1)]()){_0x30b540[_0x43da6d(0x26e)]((_0x1bb756,_0x1065f)=>(_0x1bb756[_0x43da6d(0x233)]||0x0)-(_0x1065f[_0x43da6d(0x233)]||0x0));}return _0x2844fd;}export function collectFoldersToCreate(_0x5a3812,_0x5b3f95){const _0xf17fb0=a98_0x545ff9,_0x476971=new Set();for(const _0x594c00 of _0x5a3812){if(!_0x594c00)continue;if(_0x5b3f95[_0xf17fb0(0x1f0)](_0x594c00))continue;const _0x2ff654=_0x594c00[_0xf17fb0(0x1ce)]('/');let _0x2ab68d='';for(const _0x31a1d7 of _0x2ff654){_0x2ab68d=_0x2ab68d?_0x2ab68d+'/'+_0x31a1d7:_0x31a1d7,!_0x5b3f95['has'](_0x2ab68d)&&_0x476971[_0xf17fb0(0x23e)](_0x2ab68d);}}return _0x476971;}export function parseAndClassifyYamlFiles(_0xa5741,_0x43f4ad,_0xbd5073){const _0x1aec9b=a98_0x545ff9,_0x1b5269=[],_0x33e675=[];for(const _0x3de1fd of _0xa5741){const _0x214b5c=a98_0x4a9171[_0x1aec9b(0x1ea)](_0x43f4ad,a98_0x4a9171[_0x1aec9b(0x1d5)](_0x3de1fd)),_0xefd256=_0x214b5c==='.'?'':_0x214b5c,_0x24f98a=readFileSync(_0x3de1fd,'utf-8'),_0x5306e9=a98_0x1fee7e[_0x1aec9b(0x255)](_0x24f98a);if(isJourneyDef(_0x5306e9)){const _0x40e151=a98_0x13dd3b(_0x24f98a);_0x33e675[_0x1aec9b(0x277)]({'yamlConfig':_0x40e151,'folderPath':_0xefd256,'sourcePath':_0x3de1fd});}else{if(!_0xbd5073?.[_0x1aec9b(0x200)]){const _0x31ac2c=parseSegmentYamlFile(_0x24f98a),_0x439ba1=normalizeChildSegmentYaml(_0x31ac2c);_0x1b5269[_0x1aec9b(0x277)]({'yamlConfig':_0x439ba1,'folderPath':_0xefd256,'sourcePath':_0x3de1fd});}}}return{'segments':_0x1b5269,'journeys':_0x33e675};}function a98_0x3634(){const _0x62ff44=['find','item','\x27\x20from\x20file:\x20','getJourney','with','activationStepsById','parseDocument','WaitStep','\x27\x20milestone','size','get','onProgress','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','all','connector_config','getSegment','user','attributes','INTERNAL','\x27...','message','activation_updating','stringify','fetchJourney','withProgress','Segment\x20not\x20found:\x20','resolveJourneyId','ACTIVATION_UPDATE_ERROR','map','105724famhpc','activationContext','journeyById','\x20(referenced\x20in\x20journey\x20','delete','kind','Created\x20journey\x20\x27','folderPathToId','activation_created','parentFolder','segmentNameToId','journey_created','startsWith','embedded_activation_created','split','flatMap','notification','values','listSegments','decision_point','hasChanges','dirname','journeyStages','stage\x20\x27','deps','createdSegmentId','nameToId','embeddedSegmentNameToId','segmentId','logSuccess','DecisionPoint','4930700LcQCdk','isNew','reduce','utf-8','createdSegmentIds','goal','idToEmailMap','schedule','name','10358312PHBUEz','createJourneySegment','relative','Created\x20activation\x20\x27','segment_deleted','absolutePath','action','type','has','entryCriteria','toString','results','stages','idToName','activationsBySegmentId','created','activation_deleted','segment_deleting','verbose','segment','Activation','toLowerCase','embedded_activation_creating','existingJourney','skipSegments','26kCGxUi','activationActions','update','embedded_segment_creating','activation_creating','journeyActivationNameToId','journeys','journeyId','Deleted\x20segment\x20\x27','deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','isArray','valid','filter','\x27\x20entry\x20criteria','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','entry_criteria','journey','connection','existingActivation','6BkGhjb','createFolder','index','JOURNEY_SYNTAX_ERROR','Fetching\x20','\x20error(s)','columns','Updating\x20activation\x20\x27','Creating\x20activation\x20\x27','exitCriterias','all_columns','9crOnWT','segment_updated','journeyActivationStepId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','deleteActivation','__pending_','length','logDeleted','keys','segment_updating','includes','set','./journey-yaml.js','Created\x20segment\x20\x27','segmentFolderId','./child-segment-yaml.js','entries','parentId','Updated\x20journey\x20\x27','versionNumber','max','resolveSegment','data','replace','yamlActivation','localSegmentRules','\x27\x20wait\x20condition',').\x20','1322166BBaoEl','activation_template_id','add','milestone','Stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','waitCondition','SEGMENT_SYNTAX_ERROR','activations','progress','description','folderPath','from','diff','createActivation','NOT_FOUND','segment_created','existingSegment','existingSegments','listActivations','Deleted\x20activation\x20\x27','updated','connectionIdToNameMap','join','parse','rootFolderId','folderId','steps','\x27\x20exit\x20criteria','SEGMENT_NOT_FOUND','\x0a\x20\x20','list','6626680DoLygD','\x20activation\x20\x27','367752tckRvG','sha1','digest','\x20journey\x20from\x20file:\x20','folder','updateActivation','yamlConfig','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','segments','Creating\x20segment\x20\x27','activation_','unchanged','Updated\x20segment\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','slice','sort','../../utils/async.js','create','errors','Entry\x20criteria:\x20','Failed\x20to\x20','journeyBundleName','\x27\x20for\x20','buildUserMaps','push','SEGMENT_UPDATE_ERROR','Activation\x20not\x20found:\x20','journey_entry_criteria_','activation_deleting','124512oHsDPI','journey_updating','\x20segment\x20from\x20file:\x20','rule','relationships','validatedRequest','getActivation','branches'];a98_0x3634=function(){return _0x62ff44;};return a98_0x3634();}export function validateParsedFiles(_0x49c9bc,_0x52a4cb){const _0x227e38=a98_0x545ff9,_0x535ffc=[];for(const {yamlConfig:_0x2b323b,sourcePath:_0x1535ba}of _0x49c9bc[_0x227e38(0x267)]){const _0x2af58c=readFileSync(_0x1535ba,_0x227e38(0x1e2)),_0x1f39ec=a98_0x1fee7e[_0x227e38(0x28a)](_0x2af58c),_0x2f9eb5=validateSegmentDef(_0x2b323b,{'source':_0x2af58c,'document':_0x1f39ec});if(!_0x2f9eb5[_0x227e38(0x20d)]){const _0x5a9b3c=a98_0x4a9171[_0x227e38(0x1ea)](_0x52a4cb,_0x1535ba);_0x535ffc[_0x227e38(0x277)]({'filePath':_0x5a9b3c,'source':_0x2af58c,'result':_0x2f9eb5,'isJourney':![]});}}for(const {yamlConfig:_0x4e70fd,sourcePath:_0x4f1bc4}of _0x49c9bc['journeys']){const _0x532ecc=readFileSync(_0x4f1bc4,_0x227e38(0x1e2)),_0x2546df=a98_0x1fee7e[_0x227e38(0x28a)](_0x532ecc),_0x2e857c=validateJourneyDef(_0x4e70fd,{'source':_0x532ecc,'document':_0x2546df});if(!_0x2e857c[_0x227e38(0x20d)]){const _0x5b1fa4=a98_0x4a9171[_0x227e38(0x1ea)](_0x52a4cb,_0x4f1bc4);_0x535ffc[_0x227e38(0x277)]({'filePath':_0x5b1fa4,'source':_0x532ecc,'result':_0x2e857c,'isJourney':!![]});}}return _0x535ffc;}export function formatValidationErrors(_0x3ff87d){const _0x5cf9d0=a98_0x545ff9,_0x5af0ec=[];for(const {filePath:_0x31272a,source:_0x215ab2,result:_0x3ae9dc,isJourney:_0x386cad}of _0x3ff87d){const _0x38ad3c=_0x386cad?_0x5cf9d0(0x212):_0x5cf9d0(0x1fb);_0x5af0ec[_0x5cf9d0(0x277)]('\x0a'+_0x31272a+'\x20('+_0x38ad3c+'):\x20'+_0x3ae9dc[_0x5cf9d0(0x271)][_0x5cf9d0(0x226)]+_0x5cf9d0(0x21a)),_0x5af0ec[_0x5cf9d0(0x277)](formatValidationResult(_0x3ae9dc,_0x215ab2,_0x31272a));}return _0x5af0ec[_0x5cf9d0(0x254)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x3fdec0){const _0x20459b=a98_0x545ff9,_0x267993=new Set(),_0x58ea11=new Map(),_0x2434b7=collectSegmentUsageCounts(_0x3fdec0);if(_0x3fdec0[_0x20459b(0x267)])for(const [_0x3fb1b7,_0x2cf66c]of Object[_0x20459b(0x230)](_0x3fdec0[_0x20459b(0x267)])){_0x267993['add'](_0x3fb1b7);if(_0x2cf66c[_0x20459b(0x27f)]){const _0x4f6ab5=yamlRuleToApi(_0x2cf66c[_0x20459b(0x27f)]),_0x15a6d4=apiRuleToYaml(_0x4f6ab5);_0x58ea11[_0x20459b(0x22b)](_0x3fb1b7,_0x15a6d4);}}const _0x4057c4=new Map();let _0x472a08=0x0;for(const [_0x5a9bc6,_0x2091ca]of _0x58ea11){const _0x2b6f66=serializeExpandedRule(_0x2091ca,_0x58ea11),_0x4b212e=_0x4057c4[_0x20459b(0x1ad)](_0x2b6f66)||[];_0x4b212e[_0x20459b(0x277)]({'name':_0x5a9bc6,'index':_0x472a08}),_0x4057c4[_0x20459b(0x22b)](_0x2b6f66,_0x4b212e),_0x472a08++;}const _0x40a066=new Map();for(const [_0xa9dfef,_0x8e4507]of _0x4057c4){const _0x1dca06=_0x8e4507['slice']()[_0x20459b(0x26e)]((_0x11b04c,_0x2063b4)=>{const _0x2687a7=_0x20459b,_0x1f4a3f=_0x2434b7[_0x2687a7(0x1ad)](_0x11b04c[_0x2687a7(0x1e7)])||0x0,_0x801395=_0x2434b7[_0x2687a7(0x1ad)](_0x2063b4[_0x2687a7(0x1e7)])||0x0;if(_0x1f4a3f!==_0x801395)return _0x801395-_0x1f4a3f;return _0x11b04c[_0x2687a7(0x217)]-_0x2063b4[_0x2687a7(0x217)];})[_0x20459b(0x1bf)](_0x3a0d93=>_0x3a0d93[_0x20459b(0x1e7)]),_0x5e1c23=[];for(const _0x4fde36 of _0x1dca06){const _0x4dedbc=_0x2434b7[_0x20459b(0x1ad)](_0x4fde36)||0x0,_0x7e7e3f=Math[_0x20459b(0x234)](_0x4dedbc,0x1);for(let _0x3bbfd5=0x0;_0x3bbfd5<_0x7e7e3f;_0x3bbfd5++){_0x5e1c23[_0x20459b(0x277)](_0x4fde36);}}_0x40a066[_0x20459b(0x22b)](_0xa9dfef,_0x5e1c23);}return{'existingLocalSegmentNames':_0x267993,'localSegmentRules':_0x58ea11,'localExpandedRuleToNames':_0x40a066};}async function buildServerSegmentRuleMap(_0x2a9ccf,_0x1bc91b,_0xafc8b6,_0x4be332){const _0x122085=new Map(),_0x40bc1b=new Set(),_0x25b757=async _0x2481b9=>{const _0x1f0e8d=a98_0x1668;if(_0x40bc1b['has'](_0x2481b9))return;_0x40bc1b[_0x1f0e8d(0x23e)](_0x2481b9);let _0x3e186a=_0xafc8b6[_0x1f0e8d(0x284)](_0x17d374=>_0x17d374['id']===_0x2481b9);if(!_0x3e186a)try{_0x3e186a=await _0x2a9ccf[_0x1f0e8d(0x1fb)][_0x1f0e8d(0x1b2)](_0x1bc91b,_0x2481b9);}catch{return;}if(!_0x3e186a?.['rule'])return;const _0x191991=apiRuleToYaml(_0x3e186a[_0x1f0e8d(0x27f)]);_0x122085[_0x1f0e8d(0x22b)](_0x2481b9,_0x191991);const _0x3e582f=collectSegmentRefsFromRule(_0x191991);for(const _0x44d007 of _0x3e582f){await _0x25b757(_0x44d007);}};for(const _0x41b856 of _0x4be332){await _0x25b757(_0x41b856);}return _0x122085;}export function createSegmentIdResolver(_0x2fd889,_0x34824f){return async _0x977483=>{const _0x371d8b=a98_0x1668,_0x2b00f9=_0x2fd889[_0x371d8b(0x1ad)](_0x977483);if(!_0x2b00f9)throw new SDKError(ErrorCode[_0x371d8b(0x25a)],_0x371d8b(0x1bc)+_0x977483+_0x371d8b(0x223)+_0x34824f+'\x27)');return _0x2b00f9;};}export function extractRootFolderId(_0x1611a9){const _0x55f7b9=a98_0x545ff9;return _0x1611a9[_0x55f7b9(0x280)]?.['parentSegmentFolder']?.[_0x55f7b9(0x236)]?.['id']||_0x1611a9[_0x55f7b9(0x280)]?.[_0x55f7b9(0x1c9)]?.[_0x55f7b9(0x236)]?.['id'];}export function buildConnectionMaps(_0x1b2118){const _0x27ac87=a98_0x545ff9,_0x148946=new Map(),_0x4ca259=new Map(),_0x23b7e9=new Map();for(const _0x3cde4e of _0x1b2118){_0x148946[_0x27ac87(0x22b)](_0x3cde4e['name'],parseInt(_0x3cde4e['id'],0xa)),_0x4ca259[_0x27ac87(0x22b)](_0x3cde4e['id'],_0x3cde4e['name']),_0x23b7e9[_0x27ac87(0x22b)](_0x3cde4e['name'],_0x3cde4e['type']);}return{'nameToId':_0x148946,'idToName':_0x4ca259,'nameToType':_0x23b7e9};}export function calculatePushStats(_0x4e3a51,_0x51c8b6,_0x4f2a28,_0x4d2304,_0x570445,_0x23dd10,_0x10140b){const _0x361deb=a98_0x545ff9,_0x499926=_0x4e3a51[_0x361deb(0x20e)](_0x589817=>_0x589817[_0x361deb(0x1e0)]),_0x30660b=_0x4e3a51['filter'](_0x54bbd3=>!_0x54bbd3['isNew']&&_0x54bbd3[_0x361deb(0x1d4)]),_0x158eed=_0x4e3a51['filter'](_0x46d1e0=>!_0x46d1e0[_0x361deb(0x1e0)]&&!_0x46d1e0[_0x361deb(0x1d4)]),_0x2621ce=_0x23dd10?_0x4d2304:[],_0x1d2557=_0x51c8b6[_0x361deb(0x20e)](_0x353544=>_0x353544[_0x361deb(0x1e0)]),_0x525a36=_0x51c8b6[_0x361deb(0x20e)](_0x39e23b=>!_0x39e23b[_0x361deb(0x1e0)]&&_0x39e23b['hasChanges']),_0x83b237=_0x51c8b6[_0x361deb(0x20e)](_0x65adf6=>!_0x65adf6[_0x361deb(0x1e0)]&&!_0x65adf6[_0x361deb(0x1d4)]),_0x490e8d=_0x23dd10?_0x570445:[],_0x23bff4=_0x4e3a51[_0x361deb(0x1cf)](_0x27584f=>_0x27584f[_0x361deb(0x202)]),_0x2c032b=_0x23bff4[_0x361deb(0x20e)](_0x28be89=>_0x28be89['type']===_0x361deb(0x270)),_0x4a0d0c=_0x23bff4[_0x361deb(0x20e)](_0x4bbd42=>_0x4bbd42['type']===_0x361deb(0x203)),_0x288e17=_0x23bff4[_0x361deb(0x20e)](_0x147226=>_0x147226[_0x361deb(0x1ef)]==='delete'),_0x30382d=Array[_0x361deb(0x249)](_0x4f2a28)[_0x361deb(0x26e)](),_0x127173=_0x10140b?![]:_0x499926[_0x361deb(0x226)]>0x0||_0x30660b[_0x361deb(0x226)]>0x0||_0x2621ce[_0x361deb(0x226)]>0x0,_0x365b6f=_0x1d2557[_0x361deb(0x226)]>0x0||_0x525a36[_0x361deb(0x226)]>0x0||_0x490e8d[_0x361deb(0x226)]>0x0,_0x13f146=_0x10140b?![]:_0x23bff4[_0x361deb(0x226)]>0x0,_0x36cfbf=_0x30382d[_0x361deb(0x226)]>0x0;return{'segments':{'new':_0x499926,'changed':_0x30660b,'unchanged':_0x158eed,'toDelete':_0x2621ce},'journeys':{'new':_0x1d2557,'changed':_0x525a36,'unchanged':_0x83b237,'toDelete':_0x490e8d},'activations':{'all':_0x23bff4,'toCreate':_0x2c032b,'toUpdate':_0x4a0d0c,'toDelete':_0x288e17},'folders':{'toCreate':_0x30382d},'counts':{'segments':{'new':_0x499926[_0x361deb(0x226)],'changed':_0x30660b['length'],'unchanged':_0x158eed[_0x361deb(0x226)],'toDelete':_0x2621ce[_0x361deb(0x226)]},'journeys':{'new':_0x1d2557[_0x361deb(0x226)],'changed':_0x525a36['length'],'unchanged':_0x83b237[_0x361deb(0x226)],'toDelete':_0x490e8d[_0x361deb(0x226)]},'activations':{'create':_0x2c032b[_0x361deb(0x226)],'update':_0x4a0d0c[_0x361deb(0x226)],'delete':_0x288e17['length']},'folders':_0x30382d[_0x361deb(0x226)]},'hasChanges':_0x127173||_0x365b6f||_0x13f146||_0x36cfbf};}export async function buildPushExecutionContext(_0x44379d,_0x5d77fa,_0xb12d65,_0xe614,_0x2dab5a,_0x3e7e4e){const _0x1c91bb=a98_0x545ff9,_0x1e349a=extractRootFolderId(_0xb12d65),{pathToId:_0x5e822a,idToPath:_0xbbbde9}=buildFolderMaps(_0x2dab5a),_0x43aa75=buildSegmentNameToIdMap(_0xe614),_0x500fbe=new Map(),{batchAsync:_0x2e9eed}=await import(_0x1c91bb(0x26f)),[_0x3f6361,_0x414754]=await Promise[_0x1c91bb(0x1b0)]([_0x44379d[_0x1c91bb(0x1b3)][_0x1c91bb(0x276)](),_0x44379d[_0x1c91bb(0x213)][_0x1c91bb(0x25c)](),((async()=>{const _0x37141c=_0x1c91bb;!_0x3e7e4e&&_0xe614[_0x37141c(0x226)]>0x0&&await _0x2e9eed(_0xe614,async _0x456ae4=>{const _0x5a95ff=_0x37141c,_0x36c486=await _0x44379d['segment'][_0x5a95ff(0x250)](_0x5d77fa,_0x456ae4['id']);_0x500fbe[_0x5a95ff(0x22b)](_0x456ae4['id'],_0x36c486);});})())]),{emailToId:_0xb7e373,idToEmail:_0x100513}=_0x3f6361,_0x10e053=buildConnectionMaps(_0x414754);return{'rootFolderId':_0x1e349a,'folderPathToId':_0x5e822a,'folderIdToPath':_0xbbbde9,'segmentNameToId':_0x43aa75,'activationsBySegmentId':_0x500fbe,'emailToIdMap':_0xb7e373,'idToEmailMap':_0x100513,'connectionNameToIdMap':_0x10e053[_0x1c91bb(0x1da)],'connectionIdToNameMap':_0x10e053[_0x1c91bb(0x1f5)],'connectionNameToTypeMap':_0x10e053['nameToType']};}export function createPushYamlContextForBundle(_0x3d98d8,_0x4c53d8,_0x1ec99,_0x57ca5e,_0x33ac29,_0x593ff9,_0x5b8800,_0x52f52d){const {existingLocalSegmentNames:_0x449527,localExpandedRuleToNames:_0x343bcd}=_0x57ca5e,_0x105d27=new Set(),_0x388c28=new Map(),_0x3494e6=new Map(),_0x3fb7bd=new Map(),_0x5c716c=createJumpTargetCache(),_0x388c10=new Map(),_0xf5c451=new Map(),_0x3388db=new Set();let _0x20d9f1;const _0x50cfb9=_0x51f9eb=>{const _0x409040={'resolveSegment':async _0x5f34f6=>{const _0x254813=a98_0x1668,_0xc5e67d=_0x3fb7bd[_0x254813(0x1ad)](_0x5f34f6);if(_0xc5e67d!==undefined)return{'name':_0xc5e67d,'isJourneyLocal':!![]};try{let _0x3e44fe=_0x1ec99[_0x254813(0x284)](_0x42a2a8=>_0x42a2a8['id']===_0x5f34f6);!_0x3e44fe&&(_0x3e44fe=await _0x3d98d8['segment'][_0x254813(0x1b2)](_0x4c53d8,_0x5f34f6));const _0x32719e=generateJourneyLocalName(_0x3e44fe[_0x254813(0x1e7)]),_0x3f18c0=_0x3e44fe[_0x254813(0x1c5)]===SEGMENT_KIND_JOURNEY&&_0x32719e!==undefined;let _0x5deb07=_0x3e44fe['name'],_0x5a3393;if(_0x3f18c0&&_0x3e44fe[_0x254813(0x27f)]){const _0x569773=apiRuleToYaml(_0x3e44fe[_0x254813(0x27f)]);_0xf5c451[_0x254813(0x22b)](_0x5f34f6,_0x569773);const _0x228e8a=async _0x3ce2ae=>{const _0x1e5604=_0x254813,_0x243de5=collectSegmentRefsFromRule(_0x3ce2ae);for(const _0xc981f1 of _0x243de5){if(!_0xf5c451[_0x1e5604(0x1f0)](_0xc981f1))try{const _0x3b00e4=await _0x3d98d8[_0x1e5604(0x1fb)][_0x1e5604(0x1b2)](_0x4c53d8,_0xc981f1);if(_0x3b00e4?.['rule']){const _0x368117=apiRuleToYaml(_0x3b00e4[_0x1e5604(0x27f)]);_0xf5c451[_0x1e5604(0x22b)](_0xc981f1,_0x368117),await _0x228e8a(_0x368117);}}catch{}}};await _0x228e8a(_0x569773);const _0x2ac18=serializeExpandedRule(_0x569773,_0xf5c451),_0x1cab83=_0x343bcd['get'](_0x2ac18);if(_0x1cab83&&_0x1cab83['length']>0x0){const _0x17cfdb=_0x388c28[_0x254813(0x1ad)](_0x2ac18)||0x0,_0x5bccbc=_0x1cab83[_0x17cfdb]||_0x1cab83[_0x1cab83['length']-0x1];_0x388c28[_0x254813(0x22b)](_0x2ac18,_0x17cfdb+0x1),_0x5deb07=_0x5bccbc,_0x105d27['add'](_0x5deb07),_0x3fb7bd[_0x254813(0x22b)](_0x5f34f6,_0x5deb07);const _0x1f5955=await resolveRuleSegmentRefs(_0x569773,async _0x44669a=>{const _0x53b99e=_0x254813,_0x4b0146=_0x3fb7bd[_0x53b99e(0x1ad)](_0x44669a);if(_0x4b0146)return _0x4b0146;const _0x435760=await _0x20d9f1[_0x53b99e(0x235)](_0x44669a);return _0x435760['name'];});_0x5a3393={'description':_0x3e44fe['description'],'rule':_0x1f5955};}else{const _0x154851=_0x388c10[_0x254813(0x1ad)](_0x2ac18);if(_0x154851)_0x5deb07=_0x154851,_0x3fb7bd[_0x254813(0x22b)](_0x5f34f6,_0x5deb07);else{if(_0x32719e){let _0x2784ce=_0x32719e,_0x4d0483=0x2;while(_0x105d27[_0x254813(0x1f0)](_0x2784ce)||_0x449527[_0x254813(0x1f0)](_0x2784ce)){_0x2784ce=_0x32719e+'_'+_0x4d0483,_0x4d0483++;}_0x105d27['add'](_0x2784ce),_0x5deb07=_0x2784ce;}_0x3fb7bd['set'](_0x5f34f6,_0x5deb07),_0x388c10[_0x254813(0x22b)](_0x2ac18,_0x5deb07);const _0x4fe7c7=await resolveRuleSegmentRefs(_0x569773,async _0x2ff80f=>{const _0x48db2f=_0x254813,_0xd6488f=_0x3fb7bd['get'](_0x2ff80f);if(_0xd6488f)return _0xd6488f;const _0x3b8198=await _0x20d9f1[_0x48db2f(0x235)](_0x2ff80f);return _0x3b8198['name'];});_0x5a3393={'description':_0x3e44fe[_0x254813(0x247)],'rule':_0x4fe7c7};}}}return{'name':_0x5deb07,'isJourneyLocal':_0x3f18c0,'definition':_0x5a3393};}catch{return{'name':_0x5f34f6,'isJourneyLocal':![]};}},'resolveActivation':async _0x1450e5=>{const _0x45a83a=a98_0x1668,_0x4850a6=_0x3494e6[_0x45a83a(0x1ad)](_0x1450e5);if(_0x4850a6!==undefined)return{'name':_0x4850a6,'isJourneyLocal':!![]};try{let _0x17ed4a=_0x5b8800?.[_0x45a83a(0x1ad)](_0x1450e5);!_0x17ed4a&&(_0x17ed4a=await _0x3d98d8[_0x45a83a(0x212)][_0x45a83a(0x282)](_0x51f9eb,_0x1450e5));const _0x2abfae=_0x17ed4a[_0x45a83a(0x1b4)]['activationParams'][_0x45a83a(0x1e7)]||_0x1450e5,_0x3d2bc5=sanitizeYamlKey(_0x2abfae)||_0x45a83a(0x269)+_0x1450e5,_0x4e6028=_0x3d2bc5;_0x3494e6[_0x45a83a(0x22b)](_0x1450e5,_0x4e6028);const _0x5c19ac=journeyActivationStepToYaml(_0x17ed4a,_0x33ac29,_0x593ff9);return{'name':_0x4e6028,'isJourneyLocal':!![],'definition':_0x5c19ac};}catch{return{'name':_0x1450e5,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5a1efc,_0x2add03)=>resolveJumpTarget(_0x5a1efc,_0x2add03,_0x5c716c,async _0xd6e0c9=>{const _0x331f58=a98_0x1668,_0x5ce015=_0x52f52d?.[_0x331f58(0x1ad)](_0xd6e0c9);if(_0x5ce015)return _0x5ce015;return _0x3d98d8[_0x331f58(0x212)]['getJourney'](_0xd6e0c9);})};return _0x20d9f1=_0x409040,_0x409040;},_0x5b3d6d=async _0x87a9b4=>{const _0x2d3af7=a98_0x1668,{collectSegmentIdsFromJourneyApi:_0x4fb92d}=await import(_0x2d3af7(0x22c)),{batchAsync:_0xd6b6c2}=await import('../../utils/async.js'),_0x34cc6f=new Set();for(const _0x2c033d of _0x87a9b4){let _0x1b3c7d=_0x52f52d?.[_0x2d3af7(0x1ad)](_0x2c033d);!_0x1b3c7d&&(_0x1b3c7d=await _0x3d98d8['journey'][_0x2d3af7(0x287)](_0x2c033d));const _0x1a5c81=_0x4fb92d(_0x1b3c7d);for(const _0x5d0e07 of _0x1a5c81){_0x34cc6f[_0x2d3af7(0x23e)](_0x5d0e07);}}let _0x37230e=Array['from'](_0x34cc6f);while(_0x37230e[_0x2d3af7(0x226)]>0x0){const _0x427c2f=_0x37230e[_0x2d3af7(0x20e)](_0x55f80e=>!_0x3388db[_0x2d3af7(0x1f0)](_0x55f80e));if(_0x427c2f[_0x2d3af7(0x226)]===0x0)break;const _0x3b558a=await _0xd6b6c2(_0x427c2f,async _0x494387=>{const _0x5c74d2=_0x2d3af7;_0x3388db['add'](_0x494387);let _0x15c931=_0x1ec99[_0x5c74d2(0x284)](_0x2f4f2c=>_0x2f4f2c['id']===_0x494387);if(!_0x15c931)try{_0x15c931=await _0x3d98d8['segment'][_0x5c74d2(0x1b2)](_0x4c53d8,_0x494387);}catch{return null;}return{'segmentId':_0x494387,'segment':_0x15c931};},0xa),_0x118ca9=new Set();for(const _0x25b324 of _0x3b558a){if(!_0x25b324?.['segment']?.[_0x2d3af7(0x27f)])continue;const _0x788389=apiRuleToYaml(_0x25b324[_0x2d3af7(0x1fb)]['rule']);_0xf5c451[_0x2d3af7(0x22b)](_0x25b324[_0x2d3af7(0x1dc)],_0x788389);const _0x2be5fa=collectSegmentRefsFromRule(_0x788389);for(const _0x448911 of _0x2be5fa){!_0x3388db[_0x2d3af7(0x1f0)](_0x448911)&&_0x118ca9[_0x2d3af7(0x23e)](_0x448911);}}_0x37230e=Array[_0x2d3af7(0x249)](_0x118ca9);}};return{'createYamlContext':_0x50cfb9,'prefetchJourneySegments':_0x5b3d6d};}export async function executePushSegments(_0x5cb398,_0x2e5ba1,_0x141042,_0x15258b,_0x592bee){const _0x38421b=a98_0x545ff9,{segmentDefToCreateRequest:_0x1a6cae,segmentDefToUpdateRequest:_0x5e9545}=await import(_0x38421b(0x22f)),_0x378f77=_0x141042['folderPathToId'],_0x318d85=0x5,_0x2eae01=async _0x47d65d=>{const _0x4b55b3=_0x38421b,_0x50352e=_0x47d65d[_0x4b55b3(0x248)]?_0x378f77[_0x4b55b3(0x1ad)](_0x47d65d[_0x4b55b3(0x248)]):undefined;let _0x45ae72;const _0x5de558={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x47d65d['isNew']){_0x592bee[_0x4b55b3(0x1ae)]?.({'type':'segment_creating','name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]});const _0x39c9d0=_0x1a6cae(_0x47d65d['yamlConfig'],_0x50352e),_0x6c44b9=await _0x592bee['withProgress'](_0x4b55b3(0x268)+_0x47d65d[_0x4b55b3(0x265)]['name']+_0x4b55b3(0x1b6),()=>_0x5cb398['segment'][_0x4b55b3(0x242)](_0x15258b['parentId'],_0x39c9d0));_0x45ae72=_0x6c44b9['data']['id'],_0x5de558[_0x4b55b3(0x1d9)]={'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],'id':_0x45ae72},_0x592bee['onProgress']?.({'type':_0x4b55b3(0x24d),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],'segmentId':_0x45ae72}),_0x592bee['logSuccess']?.(_0x4b55b3(0x22d)+_0x47d65d[_0x4b55b3(0x265)]['name']+'\x27'),_0x5de558[_0x4b55b3(0x1f7)]=0x1;}else{if(_0x47d65d[_0x4b55b3(0x1d4)]){_0x592bee[_0x4b55b3(0x1ae)]?.({'type':_0x4b55b3(0x229),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]});const _0x1facf4=_0x5e9545(_0x47d65d[_0x4b55b3(0x265)]);_0x50352e!==_0x47d65d[_0x4b55b3(0x24e)]?.[_0x4b55b3(0x22e)]&&(_0x1facf4[_0x4b55b3(0x22e)]=_0x50352e?parseInt(_0x50352e,0xa):undefined),await _0x592bee[_0x4b55b3(0x1bb)]('Updating\x20segment\x20\x27'+_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]+_0x4b55b3(0x1b6),()=>_0x5cb398['segment']['updateSegmentById'](_0x15258b[_0x4b55b3(0x231)],_0x47d65d['existingSegment']['id'],_0x1facf4)),_0x45ae72=_0x47d65d['existingSegment']['id'],_0x592bee[_0x4b55b3(0x1ae)]?.({'type':_0x4b55b3(0x221),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]}),_0x592bee[_0x4b55b3(0x1dd)]?.(_0x4b55b3(0x26b)+_0x47d65d[_0x4b55b3(0x265)]['name']+'\x27'),_0x5de558[_0x4b55b3(0x252)]=0x1;}else _0x45ae72=_0x47d65d[_0x4b55b3(0x24e)]['id'];}}catch(_0xbb29d1){const _0xb0546e=isHttp400Error(_0xbb29d1),_0x2b390d=_0xb0546e?ErrorCode[_0x4b55b3(0x244)]:ErrorCode[_0x4b55b3(0x278)],_0x4446ab=getErrorMessage(_0xbb29d1);throw new SDKError(_0x2b390d,_0x4b55b3(0x273)+(_0x47d65d[_0x4b55b3(0x1e0)]?_0x4b55b3(0x270):_0x4b55b3(0x203))+_0x4b55b3(0x27e)+_0x47d65d[_0x4b55b3(0x1ed)]+_0x4b55b3(0x25b)+_0x4446ab,_0xbb29d1);}try{const _0x4a7589=await syncActivationsForSegment(_0x5cb398,_0x15258b[_0x4b55b3(0x231)],_0x45ae72,_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],_0x47d65d[_0x4b55b3(0x202)],_0x592bee,_0x47d65d[_0x4b55b3(0x1ed)]);_0x5de558[_0x4b55b3(0x245)]=_0x4a7589;}catch(_0x2c3488){if(_0x2c3488 instanceof SDKError)throw _0x2c3488;throw new SDKError(ErrorCode[_0x4b55b3(0x1be)],_0x4b55b3(0x241)+_0x47d65d['yamlConfig'][_0x4b55b3(0x1e7)]+'\x27\x20from\x20file:\x20'+_0x47d65d['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x2c3488),_0x2c3488);}return _0x5de558;},_0x3f8163=await batchAsync(_0x2e5ba1,_0x2eae01,_0x318d85),_0x2250f7={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5e9c33 of _0x3f8163){_0x2250f7['created']+=_0x5e9c33['created'],_0x2250f7[_0x38421b(0x252)]+=_0x5e9c33[_0x38421b(0x252)],_0x5e9c33[_0x38421b(0x1d9)]&&_0x2250f7[_0x38421b(0x1e3)]['set'](_0x5e9c33['createdSegmentId'][_0x38421b(0x1e7)],_0x5e9c33[_0x38421b(0x1d9)]['id']),_0x2250f7[_0x38421b(0x245)][_0x38421b(0x1f7)]+=_0x5e9c33[_0x38421b(0x245)]['created'],_0x2250f7[_0x38421b(0x245)][_0x38421b(0x252)]+=_0x5e9c33['activations'][_0x38421b(0x252)],_0x2250f7[_0x38421b(0x245)][_0x38421b(0x20a)]+=_0x5e9c33['activations'][_0x38421b(0x20a)];}return _0x2250f7;}async function syncActivationsForSegment(_0x459475,_0x199cd0,_0x1379d3,_0x401402,_0x19f926,_0x5c2438,_0x26e7ac){const _0x7e8658=a98_0x545ff9,_0x399e8f={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4d5c80 of _0x19f926){try{if(_0x4d5c80['type']===_0x7e8658(0x270)&&_0x4d5c80['validatedRequest'])_0x5c2438['onProgress']?.({'type':_0x7e8658(0x205),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)](_0x7e8658(0x21d)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x24b)](_0x199cd0,_0x1379d3,_0x4d5c80['validatedRequest'])),_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1c8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438[_0x7e8658(0x1dd)]?.(_0x7e8658(0x1eb)+_0x4d5c80[_0x7e8658(0x1e7)]+'\x27'),_0x399e8f[_0x7e8658(0x1f7)]++;else{if(_0x4d5c80[_0x7e8658(0x1ef)]==='update'&&_0x4d5c80[_0x7e8658(0x281)]&&_0x4d5c80[_0x7e8658(0x214)])_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1b8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)](_0x7e8658(0x21c)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x264)](_0x199cd0,_0x1379d3,_0x4d5c80[_0x7e8658(0x214)]['id'],_0x4d5c80[_0x7e8658(0x281)])),_0x5c2438['onProgress']?.({'type':'activation_updated','segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438[_0x7e8658(0x1dd)]?.('Updated\x20activation\x20\x27'+_0x4d5c80['name']+'\x27'),_0x399e8f[_0x7e8658(0x252)]++;else _0x4d5c80['type']===_0x7e8658(0x1c4)&&_0x4d5c80['existingActivation']&&(_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x27b),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)]('Deleting\x20activation\x20\x27'+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x224)](_0x199cd0,_0x1379d3,_0x4d5c80[_0x7e8658(0x214)]['id'])),_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1f8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438['logDeleted']?.(_0x7e8658(0x251)+_0x4d5c80[_0x7e8658(0x1e7)]+'\x27'),_0x399e8f[_0x7e8658(0x20a)]++);}}catch(_0xa1cc86){const _0x1fc165=isHttp400Error(_0xa1cc86),_0x126880=_0x1fc165?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3df723=getErrorMessage(_0xa1cc86);throw new SDKError(_0x126880,_0x7e8658(0x273)+_0x4d5c80['type']+_0x7e8658(0x25e)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x286)+_0x26e7ac+_0x7e8658(0x25b)+_0x3df723,_0xa1cc86);}}return _0x399e8f;}export async function executePushFolders(_0x2a6bd7,_0x1f6d8d,_0x5663df,_0x1d1992,_0x5cce4f){const _0xb295d8=a98_0x545ff9,_0x41dc18=new Map(_0x5663df);for(const _0x3195d0 of _0x1f6d8d){const _0x369543=_0x3195d0[_0xb295d8(0x1ce)]('/'),_0x2528cd=_0x369543[_0x369543['length']-0x1],_0x5dd12f=_0x369543[_0xb295d8(0x26d)](0x0,-0x1)[_0xb295d8(0x254)]('/'),_0x30db51=_0x41dc18[_0xb295d8(0x1ad)](_0x5dd12f);_0x5cce4f['onProgress']?.({'type':'folder_creating','folder':_0x3195d0});const _0x48a8fd={'name':_0x2528cd,'parentFolderId':_0x30db51},_0x4e832b=await _0x5cce4f[_0xb295d8(0x1bb)]('Creating\x20folder\x20\x27'+_0x3195d0+_0xb295d8(0x1b6),()=>_0x2a6bd7[_0xb295d8(0x1fb)][_0xb295d8(0x216)](_0x1d1992[_0xb295d8(0x231)],_0x48a8fd));_0x41dc18['set'](_0x3195d0,_0x4e832b[_0xb295d8(0x236)]['id']),_0x5cce4f[_0xb295d8(0x1ae)]?.({'type':'folder_created','folder':_0x3195d0,'folderId':_0x4e832b[_0xb295d8(0x236)]['id']}),_0x5cce4f['logInfo']?.('Created\x20folder\x20\x27'+_0x3195d0+'\x27');}return _0x41dc18;}export async function executePushSegmentDeletions(_0x9cbdb0,_0x58f029,_0x4e08a8){const _0x4b0bc4=a98_0x545ff9;if(_0x58f029['length']===0x0)return 0x0;const {batchAsync:_0x157747}=await import(_0x4b0bc4(0x26f)),_0x1f4530=0x5,_0x17721d=await _0x157747(_0x58f029,async _0x188b01=>{const _0x2479dd=_0x4b0bc4;return _0x4e08a8['onProgress']?.({'type':_0x2479dd(0x1f9),'name':_0x188b01[_0x2479dd(0x1e7)]}),await _0x9cbdb0[_0x2479dd(0x1fb)]['deleteSegment'](_0x188b01['id']),_0x4e08a8[_0x2479dd(0x1ae)]?.({'type':_0x2479dd(0x1ec),'name':_0x188b01['name']}),_0x4e08a8[_0x2479dd(0x227)]?.(_0x2479dd(0x209)+_0x188b01[_0x2479dd(0x1e7)]+'\x27'),0x1;},_0x1f4530);return _0x17721d[_0x4b0bc4(0x1e1)]((_0x518562,_0x38df0a)=>_0x518562+_0x38df0a,0x0);}export async function executePushJourneys(_0x2e5819,_0x18c266,_0x2ca293,_0x4a700c,_0x44dd8f){const _0x362eca=a98_0x545ff9,{journeyDefToRequest:_0x1ed69b}=await import(_0x362eca(0x22c)),{activationDefToCreateRequest:_0x4e4f1f,yamlRuleToApi:_0x575318,validateSegmentRule:_0x665502}=await import(_0x362eca(0x22f)),_0x450256={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x249fb3=new Map(_0x2ca293[_0x362eca(0x1ca)]),_0x5da4e4=0x5;for(let _0x40b369=0x0;_0x40b369<_0x18c266['length'];_0x40b369+=_0x5da4e4){const _0x5aa9b6=_0x18c266[_0x362eca(0x26d)](_0x40b369,_0x40b369+_0x5da4e4),_0xfa43f3=await Promise[_0x362eca(0x1b0)](_0x5aa9b6[_0x362eca(0x1bf)](async _0x37643d=>{const _0x4c3b1f=_0x362eca;if(!_0x37643d[_0x4c3b1f(0x1e0)]&&!_0x37643d[_0x4c3b1f(0x1d4)])return{'action':'unchanged','name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)],'journeyId':_0x37643d[_0x4c3b1f(0x1ff)]?.['id']};const _0x18d52d=_0x37643d[_0x4c3b1f(0x248)]?_0x2ca293[_0x4c3b1f(0x1c7)]['get'](_0x37643d[_0x4c3b1f(0x248)]):undefined;_0x44dd8f['onProgress']?.({'type':_0x37643d[_0x4c3b1f(0x1e0)]?'journey_creating':_0x4c3b1f(0x27d),'name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]});try{const _0x4cb435=await executeSingleJourneyPush(_0x2e5819,_0x37643d,{..._0x2ca293,'segmentNameToId':_0x249fb3},{'parentId':_0x4a700c['parentId'],'rootFolderId':_0x4a700c[_0x4c3b1f(0x256)],'folderId':_0x18d52d,'verbose':_0x4a700c[_0x4c3b1f(0x1fa)]},_0x44dd8f,{'journeyDefToRequest':_0x1ed69b,'activationDefToCreateRequest':_0x4e4f1f,'yamlRuleToApi':_0x575318,'validateSegmentRule':_0x665502});for(const [_0x32225c,_0x2ddb1f]of _0x4cb435['embeddedSegmentNameToId']){_0x249fb3[_0x4c3b1f(0x22b)](_0x32225c,_0x2ddb1f),_0x450256[_0x4c3b1f(0x1db)][_0x4c3b1f(0x22b)](_0x32225c,_0x2ddb1f);}if(_0x4cb435[_0x4c3b1f(0x1ee)]===_0x4c3b1f(0x1f7))_0x44dd8f[_0x4c3b1f(0x1ae)]?.({'type':_0x4c3b1f(0x1cb),'name':_0x37643d['yamlConfig'][_0x4c3b1f(0x1e7)],'journeyId':_0x4cb435[_0x4c3b1f(0x208)]}),_0x44dd8f[_0x4c3b1f(0x1dd)]?.(_0x4c3b1f(0x1c6)+_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]+'\x27'),_0x450256[_0x4c3b1f(0x1f7)]++;else _0x4cb435[_0x4c3b1f(0x1ee)]===_0x4c3b1f(0x252)&&(_0x44dd8f[_0x4c3b1f(0x1ae)]?.({'type':'journey_updated','name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]}),_0x44dd8f[_0x4c3b1f(0x1dd)]?.(_0x4c3b1f(0x232)+_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]+'\x27'),_0x450256['updated']++);return{'action':_0x4cb435[_0x4c3b1f(0x1ee)],'name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)],'journeyId':_0x4cb435[_0x4c3b1f(0x208)]};}catch(_0x5f05f7){const _0x46bee0=isHttp400Error(_0x5f05f7),_0x5476fa=_0x46bee0?ErrorCode[_0x4c3b1f(0x218)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2ab0c8=getErrorMessage(_0x5f05f7);throw new SDKError(_0x5476fa,_0x4c3b1f(0x273)+(_0x37643d[_0x4c3b1f(0x1e0)]?_0x4c3b1f(0x270):_0x4c3b1f(0x203))+_0x4c3b1f(0x262)+_0x37643d[_0x4c3b1f(0x1ed)]+_0x4c3b1f(0x25b)+_0x2ab0c8,_0x5f05f7);}}));_0x450256[_0x362eca(0x1f3)][_0x362eca(0x277)](..._0xfa43f3);}return _0x450256;}async function executeSingleJourneyPush(_0x4dc700,_0x4d803e,_0x4154f8,_0xf7b9ef,_0x12c454,_0x5d4516){const _0x50cc66=a98_0x545ff9,{journeyDefToRequest:_0x4555ff,activationDefToCreateRequest:_0x189100,yamlRuleToApi:_0xec6ccc,validateSegmentRule:_0x152641}=_0x5d4516,_0x16366c=new Map(),_0x325639=new Map(),_0x482da5=new Map(),_0x2b1d33=new Map(),_0x355ca3=new Map();let _0x1a5a97;const _0x2f5440=async()=>{const _0x3a3728=a98_0x1668;if(_0x1a5a97)return;_0x1a5a97=new Map();if(!_0x4d803e[_0x3a3728(0x1ff)])return;const _0x33c222=await _0x4dc700['journey'][_0x3a3728(0x250)](_0x4d803e[_0x3a3728(0x1ff)]['id']);for(const _0x4835a8 of _0x33c222){const _0x39d16d=journeyActivationStepToYaml(_0x4835a8,_0x4154f8[_0x3a3728(0x1e5)],_0x4154f8[_0x3a3728(0x253)]),_0x4b7936=activationSignature(_0x39d16d);!_0x1a5a97[_0x3a3728(0x1f0)](_0x4b7936)&&_0x1a5a97[_0x3a3728(0x22b)](_0x4b7936,_0x4835a8['id']),_0x39d16d[_0x3a3728(0x1e7)]&&_0x325639['set'](_0x39d16d[_0x3a3728(0x1e7)],_0x4835a8['id']);}};if(_0x4d803e[_0x50cc66(0x1ff)]&&_0x4d803e[_0x50cc66(0x265)][_0x50cc66(0x267)]){const _0x8b42f9=buildLocalExpandedRuleMappings(_0x4d803e['yamlConfig']),_0x41512b=_0x8b42f9[_0x50cc66(0x239)];if(_0x41512b['size']>0x0){const _0x5c3f52=new Map();for(const [_0x4fc331,_0x14f965]of _0x41512b){const _0x6ff573=serializeExpandedRule(_0x14f965,_0x41512b);_0x5c3f52[_0x50cc66(0x22b)](_0x4fc331,_0x6ff573);}const _0x20f501=collectSegmentIdsFromJourneyApi(_0x4d803e[_0x50cc66(0x1ff)]);if(_0x20f501['size']>0x0){const _0x393ccc=await buildServerSegmentRuleMap(_0x4dc700,_0xf7b9ef[_0x50cc66(0x231)],_0x4154f8[_0x50cc66(0x24f)],_0x20f501);if(_0x393ccc[_0x50cc66(0x1ac)]>0x0){const _0x1b68f5=new Map();for(const [_0x1bccd7,_0x460993]of _0x393ccc){const _0x1341e0=serializeExpandedRule(_0x460993,_0x393ccc);!_0x1b68f5[_0x50cc66(0x1f0)](_0x1341e0)&&_0x1b68f5[_0x50cc66(0x22b)](_0x1341e0,_0x1bccd7);}for(const [_0x4d4cef,_0x5237f8]of _0x5c3f52){const _0x1ed86a=_0x1b68f5[_0x50cc66(0x1ad)](_0x5237f8);_0x1ed86a&&(_0x355ca3[_0x50cc66(0x22b)](_0x4d4cef,_0x1ed86a),_0x4154f8['segmentNameToId'][_0x50cc66(0x22b)](_0x4d4cef,_0x1ed86a));}}}}}const _0x18743d={'resolveSegmentId':async _0x456f50=>{const _0x1a6018=_0x50cc66,_0x38635d=_0x4154f8[_0x1a6018(0x1ca)][_0x1a6018(0x1ad)](_0x456f50);if(!_0x38635d)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1a6018(0x1bc)+_0x456f50+_0x1a6018(0x1c3)+_0x4d803e[_0x1a6018(0x265)][_0x1a6018(0x1e7)]+')');return _0x38635d;},'resolveEmbeddedSegmentId':async(_0x26f94b,_0x3371a3)=>{const _0x3e641b=_0x50cc66,_0x2757f9=_0x4154f8['segmentNameToId'][_0x3e641b(0x1ad)](_0x26f94b);if(_0x2757f9)return _0x2757f9;const _0x41e09e=_0x355ca3['get'](_0x26f94b);if(_0x41e09e)return _0x4154f8[_0x3e641b(0x1ca)]['set'](_0x26f94b,_0x41e09e),_0x41e09e;const _0x13a71b=_0x4154f8[_0x3e641b(0x24f)][_0x3e641b(0x284)](_0x2c77fb=>_0x2c77fb[_0x3e641b(0x1e7)]===_0x26f94b);if(_0x13a71b)return _0x4154f8['segmentNameToId'][_0x3e641b(0x22b)](_0x26f94b,_0x13a71b['id']),_0x13a71b['id'];if(_0x4d803e[_0x3e641b(0x1e0)]){const {stageName:_0x2df014,criteriaName:_0x235e1c}=findSegmentCriteriaLocation(_0x4d803e[_0x3e641b(0x265)],_0x26f94b);return _0x152641(_0x26f94b,_0x3371a3[_0x3e641b(0x27f)]),_0x482da5[_0x3e641b(0x22b)](_0x26f94b,{'definition':_0x3371a3,'stageName':_0x2df014,'criteriaName':_0x235e1c}),createPendingSegmentId(_0x26f94b);}const _0x2af282=_0x4d803e[_0x3e641b(0x1ff)]?.['id'];if(!_0x2af282)throw new SDKError(ErrorCode[_0x3e641b(0x1b5)],_0x3e641b(0x266));_0x152641(_0x26f94b,_0x3371a3['rule']);const _0x47c6ac=generateDeterministicJourneySegmentName(_0x4d803e[_0x3e641b(0x265)][_0x3e641b(0x1e7)],_0x26f94b),_0x2cf793=_0x4154f8[_0x3e641b(0x24f)][_0x3e641b(0x284)](_0x312e9a=>_0x312e9a[_0x3e641b(0x1e7)]===_0x47c6ac),_0x110baa=createSegmentIdResolver(_0x4154f8['segmentNameToId'],_0x26f94b),_0x30e5d5=await resolveRuleSegmentIds(_0x3371a3[_0x3e641b(0x27f)],_0x110baa);let _0x1021e5;if(_0x2cf793)await _0x4dc700[_0x3e641b(0x1fb)]['updateSegmentById'](_0xf7b9ef[_0x3e641b(0x231)],_0x2cf793['id'],{'description':_0x3371a3[_0x3e641b(0x247)]||_0x3e641b(0x272)+_0x26f94b,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![]}),_0x1021e5=_0x2cf793['id'];else try{_0x1021e5=await _0x4dc700[_0x3e641b(0x1fb)][_0x3e641b(0x1e9)]({'name':_0x47c6ac,'description':_0x3371a3[_0x3e641b(0x247)]||'Entry\x20criteria:\x20'+_0x26f94b,'journeyId':_0x2af282,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![],'parentFolderId':_0xf7b9ef['rootFolderId']||'','audienceId':_0xf7b9ef[_0x3e641b(0x231)]});}catch(_0x8e882b){const _0x4f179c=_0x8e882b instanceof Error&&_0x8e882b[_0x3e641b(0x1b7)][_0x3e641b(0x22a)]('Name\x20has\x20already\x20been\x20taken');if(_0x4f179c){const _0xfd3b68=await _0x4dc700[_0x3e641b(0x1fb)][_0x3e641b(0x1d2)](_0xf7b9ef['parentId']),_0x35051c=_0xfd3b68[_0x3e641b(0x284)](_0x5be499=>_0x5be499[_0x3e641b(0x1e7)]===_0x47c6ac);if(_0x35051c)await _0x4dc700[_0x3e641b(0x1fb)]['updateSegmentById'](_0xf7b9ef[_0x3e641b(0x231)],_0x35051c['id'],{'description':_0x3371a3[_0x3e641b(0x247)]||'Entry\x20criteria:\x20'+_0x26f94b,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![]}),_0x1021e5=_0x35051c['id'];else throw _0x8e882b;}else throw _0x8e882b;}return _0x4154f8['segmentNameToId'][_0x3e641b(0x22b)](_0x26f94b,_0x1021e5),_0x16366c['set'](_0x26f94b,_0x1021e5),_0x1021e5;},'resolveActivationId':async _0x53fe85=>{const _0x3602f4=_0x50cc66,_0x380daa=_0x325639['get'](_0x53fe85);if(_0x380daa)return _0x380daa;if(_0x4d803e[_0x3602f4(0x1ff)]){await _0x2f5440();const _0x21a89e=_0x325639[_0x3602f4(0x1ad)](_0x53fe85);if(_0x21a89e)return _0x21a89e;}throw new SDKError(ErrorCode[_0x3602f4(0x24c)],_0x3602f4(0x279)+_0x53fe85+_0x3602f4(0x1c3)+_0x4d803e[_0x3602f4(0x265)]['name']+_0x3602f4(0x23b)+_0x3602f4(0x1af));},'resolveEmbeddedActivationId':async(_0x334b10,_0x433060)=>{const _0x26040d=_0x50cc66,_0x4c5358=_0x325639[_0x26040d(0x1ad)](_0x334b10);if(_0x4c5358)return _0x4c5358;if(_0x4d803e[_0x26040d(0x1e0)])return _0x2b1d33[_0x26040d(0x22b)](_0x334b10,_0x433060),createPendingActivationId(_0x334b10);if(_0x4d803e['existingJourney']){await _0x2f5440();const _0x529ee7=_0x325639['get'](_0x433060[_0x26040d(0x1e7)]);if(_0x529ee7)return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x529ee7),_0x529ee7;const _0xbd0871=activationSignature(_0x433060),_0x22b745=_0x1a5a97?.['get'](_0xbd0871);if(_0x22b745)return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x22b745),_0x22b745;const _0x37a5c9=await _0x189100(_0x433060,_0x4154f8[_0x26040d(0x1c1)]),_0x4dd77f=await _0x4dc700[_0x26040d(0x212)]['createActivation'](_0x4d803e[_0x26040d(0x1ff)]['id'],_0x37a5c9);return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x4dd77f['id']),_0x4dd77f['id'];}throw new SDKError(ErrorCode[_0x26040d(0x1b5)],_0x26040d(0x20b));},'resolveJourneyId':async _0x9b8e07=>{const _0x51c2c1=_0x50cc66;try{return await _0x4dc700[_0x51c2c1(0x212)][_0x51c2c1(0x1bd)](_0xf7b9ef[_0x51c2c1(0x231)],_0x9b8e07);}catch(_0x4651b9){throw new SDKError(ErrorCode[_0x51c2c1(0x24c)],'Journey\x20\x27'+_0x9b8e07+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x4d803e[_0x51c2c1(0x265)][_0x51c2c1(0x1e7)]+'\x27)',_0x4651b9);}},'resolveStageId':async(_0x8937dc,_0x18261f)=>{const _0x291b34=_0x50cc66,_0x3bcdf3=await _0x4dc700[_0x291b34(0x212)]['getJourney'](_0x8937dc),_0x184b9b=_0x3bcdf3[_0x291b34(0x1b4)][_0x291b34(0x1d6)]['find'](_0xee530c=>_0xee530c[_0x291b34(0x1e7)][_0x291b34(0x1fd)]()===_0x18261f['toLowerCase']());if(!_0x184b9b?.['id'])throw new SDKError(ErrorCode[_0x291b34(0x24c)],_0x291b34(0x240)+_0x18261f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3bcdf3['attributes'][_0x291b34(0x274)]||_0x3bcdf3['attributes']['name'])+'\x27');return _0x184b9b['id'];}},_0x19fcb9=await _0x4555ff(_0x4d803e['yamlConfig'],_0xf7b9ef[_0x50cc66(0x231)],_0x18743d),_0x485973=_0xf7b9ef[_0x50cc66(0x257)]||_0xf7b9ef[_0x50cc66(0x256)];_0x485973&&(_0x19fcb9[_0x50cc66(0x280)]={'parentFolder':{'data':{'id':_0x485973,'type':_0x50cc66(0x263)}}});if(_0x4d803e['isNew']){if(_0x482da5[_0x50cc66(0x1ac)]>0x0||_0x2b1d33['size']>0x0)return await executeThreeStepJourneyCreate(_0x4dc700,_0x4d803e,_0x19fcb9,{'pendingEmbeddedSegments':_0x482da5,'pendingEmbeddedActivations':_0x2b1d33,'embeddedSegmentNameToId':_0x16366c,'journeyActivationNameToId':_0x325639},{..._0xf7b9ef,'effectiveFolderId':_0x485973},_0x4154f8,_0x12c454,_0x5d4516);else{ensureJourneyDefaults(_0x19fcb9[_0x50cc66(0x1b4)]);const _0x28b970=await _0x4dc700[_0x50cc66(0x212)]['create'](_0x19fcb9);return{'action':_0x50cc66(0x1f7),'journeyId':_0x28b970['id'],'embeddedSegmentNameToId':_0x16366c};}}else{if(_0x4d803e[_0x50cc66(0x1d4)]&&_0x4d803e['existingJourney'])return ensureJourneyDefaults(_0x19fcb9[_0x50cc66(0x1b4)]),await _0x4dc700[_0x50cc66(0x212)][_0x50cc66(0x203)](_0x4d803e['existingJourney']['id'],_0x19fcb9),{'action':_0x50cc66(0x252),'journeyId':_0x4d803e['existingJourney']['id'],'embeddedSegmentNameToId':_0x16366c};}return{'action':_0x50cc66(0x26a),'journeyId':_0x4d803e['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x16366c};}function findSegmentCriteriaLocation(_0x3b89d9,_0x640b6c){const _0x5b8dbe=a98_0x545ff9,_0x5d0840=_0x3b89d9[_0x5b8dbe(0x1f4)]||_0x3b89d9[_0x5b8dbe(0x207)]?.[0x0]?.['stages']||[];let _0x258e77='entry',_0x4ff962=_0x640b6c;const _0x41bba4=_0x3b89d9['goal']||_0x3b89d9[_0x5b8dbe(0x207)]?.[0x0]?.[_0x5b8dbe(0x1e4)];if(_0x41bba4?.['segment']===_0x640b6c)return{'stageName':_0x5b8dbe(0x1e4),'criteriaName':_0x41bba4[_0x5b8dbe(0x1e7)]||_0x640b6c};_0x485a27:for(const _0x289101 of _0x5d0840){if(_0x289101[_0x5b8dbe(0x211)]?.[_0x5b8dbe(0x1fb)]===_0x640b6c){_0x258e77=_0x289101['name'],_0x4ff962=_0x289101['entry_criteria'][_0x5b8dbe(0x1e7)]||_0x640b6c;break;}if(_0x289101[_0x5b8dbe(0x258)])for(const _0x5dc7b0 of _0x289101[_0x5b8dbe(0x258)]){if(_0x5dc7b0['type']===_0x5b8dbe(0x1d3)&&_0x5dc7b0[_0x5b8dbe(0x288)]?.['branches'])for(const _0x1c2e25 of _0x5dc7b0['with']['branches']){if(_0x1c2e25[_0x5b8dbe(0x1fb)]===_0x640b6c){_0x258e77=_0x289101[_0x5b8dbe(0x1e7)],_0x4ff962=_0x1c2e25[_0x5b8dbe(0x1e7)]||_0x640b6c;break _0x485a27;}}}}return{'stageName':_0x258e77,'criteriaName':_0x4ff962};}async function executeThreeStepJourneyCreate(_0x2a6d9e,_0xf9109,_0x53458f,_0x2b815c,_0x494dd4,_0x853d14,_0x55c907,_0x37e882){const _0x579343=a98_0x545ff9,{activationDefToCreateRequest:_0x2c33f2,yamlRuleToApi:_0x83b3be}=_0x37e882,{pendingEmbeddedSegments:_0x4519e2,pendingEmbeddedActivations:_0x5e3711,embeddedSegmentNameToId:_0x2cacca}=_0x2b815c,_0x254034=JSON['parse'](JSON['stringify'](_0x53458f));ensureJourneyDefaults(_0x254034['attributes']),stripPendingIds(_0x254034);const _0x14e589=await _0x2a6d9e['journey']['create'](_0x254034),_0x1a484e=_0x14e589['id'],_0x5119ba=new Map();for(const _0x58bfe8 of _0x14e589[_0x579343(0x1b4)]['journeyStages']){_0x5119ba[_0x579343(0x22b)](_0x58bfe8[_0x579343(0x1e7)][_0x579343(0x1fd)](),_0x58bfe8['id']);}for(const [_0x20cc5d,{definition:_0x10ad78}]of _0x4519e2){const _0x33935b=generateDeterministicJourneySegmentName(_0xf9109[_0x579343(0x265)]['name'],_0x20cc5d);_0x55c907[_0x579343(0x1ae)]?.({'type':_0x579343(0x204),'journeyName':_0xf9109[_0x579343(0x265)]['name'],'segmentName':_0x20cc5d});const _0x532ec0=createSegmentIdResolver(_0x853d14[_0x579343(0x1ca)],_0x20cc5d),_0x349ca1=await resolveRuleSegmentIds(_0x10ad78[_0x579343(0x27f)],_0x532ec0),_0x5d2cbf=await _0x2a6d9e['segment'][_0x579343(0x1e9)]({'name':_0x33935b,'description':_0x10ad78[_0x579343(0x247)]||_0x579343(0x272)+_0x20cc5d,'journeyId':_0x1a484e,'rule':_0x83b3be(_0x349ca1,!![]),'countPopulation':!![],'parentFolderId':_0x494dd4['effectiveFolderId']||'','audienceId':_0x494dd4['parentId']});_0x2cacca[_0x579343(0x22b)](_0x20cc5d,_0x5d2cbf),_0x853d14[_0x579343(0x1ca)][_0x579343(0x22b)](_0x20cc5d,_0x5d2cbf),_0x55c907[_0x579343(0x1ae)]?.({'type':'embedded_segment_created','journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'segmentName':_0x20cc5d});}const _0x58e004=new Map();for(const [_0x4d8100,_0x243562]of _0x5e3711){_0x55c907['onProgress']?.({'type':_0x579343(0x1fe),'journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'activationName':_0x4d8100});const _0x4fe0e1=await _0x2c33f2(_0x243562,_0x853d14[_0x579343(0x1c1)]),_0x5be152=await _0x2a6d9e['journey'][_0x579343(0x24b)](_0x1a484e,_0x4fe0e1);_0x58e004[_0x579343(0x22b)](_0x4d8100,_0x5be152['id']),_0x2b815c[_0x579343(0x206)][_0x579343(0x22b)](_0x4d8100,_0x5be152['id']),_0x55c907[_0x579343(0x1ae)]?.({'type':_0x579343(0x1cd),'journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'activationName':_0x4d8100});}const _0x599f96=JSON[_0x579343(0x255)](JSON[_0x579343(0x1b9)](_0x53458f));return _0x599f96['id']=_0x1a484e,ensureJourneyDefaults(_0x599f96[_0x579343(0x1b4)]),resolvePendingIdsInRequest(_0x599f96,_0x53458f,_0x5119ba,_0x2cacca,_0x58e004,_0x55c907),await _0x2a6d9e['journey'][_0x579343(0x203)](_0x1a484e,_0x599f96),{'action':_0x579343(0x1f7),'journeyId':_0x1a484e,'embeddedSegmentNameToId':_0x2cacca};}function stripPendingIds(_0x43e81b){const _0x21e4b7=a98_0x545ff9;for(const _0x4a499f of _0x43e81b[_0x21e4b7(0x1b4)][_0x21e4b7(0x1d6)]||[]){_0x4a499f['entryCriteria']?.[_0x21e4b7(0x1dc)]&&isPendingSegmentId(_0x4a499f[_0x21e4b7(0x1f1)]['segmentId'])&&delete _0x4a499f[_0x21e4b7(0x1f1)];if(_0x4a499f['steps'])for(const _0x4102dd of Object[_0x21e4b7(0x228)](_0x4a499f['steps'])){const _0x2f8f9f=_0x4a499f[_0x21e4b7(0x258)][_0x4102dd];_0x2f8f9f[_0x21e4b7(0x1ef)]==='Activation'&&_0x2f8f9f[_0x21e4b7(0x222)]&&isPendingActivationId(_0x2f8f9f['journeyActivationStepId'])&&(_0x2f8f9f[_0x21e4b7(0x222)]='');if(_0x2f8f9f[_0x21e4b7(0x1ef)]===_0x21e4b7(0x1de)&&_0x2f8f9f['branches'])for(const _0x4dfce0 of _0x2f8f9f['branches']){_0x4dfce0['segmentId']&&isPendingSegmentId(_0x4dfce0[_0x21e4b7(0x1dc)])&&(_0x4dfce0[_0x21e4b7(0x1dc)]='');}_0x2f8f9f[_0x21e4b7(0x1ef)]===_0x21e4b7(0x28b)&&_0x2f8f9f['waitCondition']?.[_0x21e4b7(0x1dc)]&&isPendingSegmentId(_0x2f8f9f['waitCondition'][_0x21e4b7(0x1dc)])&&(_0x2f8f9f[_0x21e4b7(0x243)][_0x21e4b7(0x1dc)]='');}}}function resolvePendingIdsInRequest(_0x144dc5,_0xcfc61,_0x101fa9,_0x3cce76,_0x18938d,_0x40764e){const _0x314451=a98_0x545ff9,_0x437160=(_0x51dc05,_0x939822)=>{const _0x4f121a=a98_0x1668;if(!isPendingSegmentId(_0x51dc05))return _0x51dc05;const _0x2d38cc=extractPendingSegmentName(_0x51dc05),_0x17218a=_0x3cce76['get'](_0x2d38cc);return!_0x17218a&&_0x40764e['logWarning']?.(_0x4f121a(0x210)+_0x2d38cc+_0x4f121a(0x275)+_0x939822),_0x17218a;};if(_0x144dc5[_0x314451(0x1b4)]['goal']?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x144dc5[_0x314451(0x1b4)][_0x314451(0x1e4)]['segmentId'])){const _0x3e922c=_0x437160(_0x144dc5[_0x314451(0x1b4)][_0x314451(0x1e4)][_0x314451(0x1dc)],'goal\x20criteria');_0x3e922c&&(_0x144dc5[_0x314451(0x1b4)]['goal'][_0x314451(0x1dc)]=_0x3e922c);}for(const _0x570f7d of _0x144dc5[_0x314451(0x1b4)]['journeyStages']||[]){const _0x13325c=_0x101fa9[_0x314451(0x1ad)](_0x570f7d[_0x314451(0x1e7)][_0x314451(0x1fd)]());_0x13325c&&(_0x570f7d['id']=_0x13325c);if(_0x570f7d[_0x314451(0x1f1)]?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x570f7d['entryCriteria'][_0x314451(0x1dc)])){const _0x9940d7=_0x437160(_0x570f7d['entryCriteria']['segmentId'],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x20f));_0x9940d7&&(_0x570f7d[_0x314451(0x1f1)][_0x314451(0x1dc)]=_0x9940d7);}if(_0x570f7d[_0x314451(0x21e)])for(const _0x32d488 of _0x570f7d[_0x314451(0x21e)]){if(_0x32d488[_0x314451(0x1dc)]&&isPendingSegmentId(_0x32d488[_0x314451(0x1dc)])){const _0xa29267=_0x437160(_0x32d488[_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d['name']+_0x314451(0x259));_0xa29267&&(_0x32d488['segmentId']=_0xa29267);}}if(_0x570f7d['milestone']?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x570f7d[_0x314451(0x23f)]['segmentId'])){const _0x4fa705=_0x437160(_0x570f7d['milestone'][_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x1ab));_0x4fa705&&(_0x570f7d[_0x314451(0x23f)][_0x314451(0x1dc)]=_0x4fa705);}if(_0x570f7d[_0x314451(0x258)]){const _0x2e82b6=_0x304c7f=>_0xcfc61[_0x314451(0x1b4)][_0x314451(0x1d6)][_0x314451(0x284)](_0x464ada=>_0x464ada[_0x314451(0x1e7)][_0x314451(0x1fd)]()===_0x570f7d[_0x314451(0x1e7)]['toLowerCase']())?.[_0x314451(0x258)]?.[_0x304c7f];for(const _0x4b273b of Object[_0x314451(0x228)](_0x570f7d['steps'])){const _0x3f79ac=_0x570f7d['steps'][_0x4b273b],_0x5494ff=_0x2e82b6(_0x4b273b);if(_0x3f79ac['type']===_0x314451(0x1fc)&&_0x3f79ac[_0x314451(0x222)]&&(isPendingActivationId(_0x3f79ac[_0x314451(0x222)])||_0x3f79ac[_0x314451(0x222)]==='')){if(_0x5494ff?.['journeyActivationStepId']&&isPendingActivationId(_0x5494ff['journeyActivationStepId'])){const _0x5e16ec=extractPendingActivationName(_0x5494ff[_0x314451(0x222)]),_0xb33432=_0x18938d[_0x314451(0x1ad)](_0x5e16ec);_0xb33432&&(_0x3f79ac[_0x314451(0x222)]=_0xb33432);}}if(_0x3f79ac[_0x314451(0x1ef)]===_0x314451(0x1de)&&_0x3f79ac[_0x314451(0x283)]&&_0x5494ff?.[_0x314451(0x283)])for(let _0x95f5d5=0x0;_0x95f5d5<_0x3f79ac[_0x314451(0x283)][_0x314451(0x226)];_0x95f5d5++){const _0x230a89=_0x3f79ac[_0x314451(0x283)][_0x95f5d5],_0x3c6506=_0x5494ff[_0x314451(0x283)][_0x95f5d5];if(_0x3c6506?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x3c6506[_0x314451(0x1dc)])){const _0x2524b2=_0x437160(_0x3c6506[_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x26c)+(_0x230a89['name']||_0x95f5d5)+'\x27');_0x2524b2&&(_0x230a89[_0x314451(0x1dc)]=_0x2524b2);}}if(_0x3f79ac[_0x314451(0x1ef)]===_0x314451(0x28b)&&_0x3f79ac[_0x314451(0x243)]?.[_0x314451(0x1dc)]&&_0x5494ff?.[_0x314451(0x243)]?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x5494ff[_0x314451(0x243)][_0x314451(0x1dc)])){const _0x189833=_0x437160(_0x5494ff[_0x314451(0x243)][_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x23a));_0x189833&&(_0x3f79ac[_0x314451(0x243)]['segmentId']=_0x189833);}}}}}
|
|
1
|
+
function a100_0x5482(_0x2b5ddd,_0x2e8470){_0x2b5ddd=_0x2b5ddd-0xd2;const _0x303639=a100_0x3036();let _0x54823e=_0x303639[_0x2b5ddd];return _0x54823e;}const a100_0x525e79=a100_0x5482;(function(_0x16ffb5,_0x599daa){const _0x57d061=a100_0x5482,_0x18fd95=_0x16ffb5();while(!![]){try{const _0x2a2121=parseInt(_0x57d061(0x158))/0x1*(parseInt(_0x57d061(0x111))/0x2)+-parseInt(_0x57d061(0xe7))/0x3*(parseInt(_0x57d061(0x133))/0x4)+parseInt(_0x57d061(0x132))/0x5+-parseInt(_0x57d061(0x173))/0x6+-parseInt(_0x57d061(0x121))/0x7*(parseInt(_0x57d061(0xee))/0x8)+parseInt(_0x57d061(0x194))/0x9*(parseInt(_0x57d061(0xfc))/0xa)+parseInt(_0x57d061(0x191))/0xb*(parseInt(_0x57d061(0x190))/0xc);if(_0x2a2121===_0x599daa)break;else _0x18fd95['push'](_0x18fd95['shift']());}catch(_0xe22a48){_0x18fd95['push'](_0x18fd95['shift']());}}}(a100_0x3036,0xcd4f4));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a100_0x525e79(0x119);export const PENDING_ACTIVATION_PREFIX=a100_0x525e79(0xe5);export function createPendingSegmentId(_0x18d795){return''+PENDING_SEGMENT_PREFIX+_0x18d795+'__';}export function isPendingSegmentId(_0x3d087d){const _0x2f1faa=a100_0x525e79;return _0x3d087d[_0x2f1faa(0x16b)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x5483ec){const _0x5c20f5=a100_0x525e79;return _0x5483ec[_0x5c20f5(0x105)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x32f828){return''+PENDING_ACTIVATION_PREFIX+_0x32f828+'__';}export function isPendingActivationId(_0x48fd25){const _0x5dca6a=a100_0x525e79;return _0x48fd25[_0x5dca6a(0x16b)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x522beb){return _0x522beb['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x2a8d2e,_0x119216){const _0x3aa9e2=a100_0x525e79,_0x3e69c8=_0x2a8d2e+'::'+(_0x119216[_0x3aa9e2(0x126)]()||_0x3aa9e2(0x157)),_0x89a486=createHash(_0x3aa9e2(0xde))[_0x3aa9e2(0x168)](_0x3e69c8)[_0x3aa9e2(0x169)]('hex')['slice'](0x0,0xc);return _0x3aa9e2(0xf0)+_0x89a486;}export function ensureJourneyDefaults(_0x2f1642){const _0xa09752=a100_0x525e79;!_0x2f1642[_0xa09752(0x124)]&&(_0x2f1642[_0xa09752(0x124)]=''),!_0x2f1642[_0xa09752(0x128)]&&(_0x2f1642[_0xa09752(0x128)]=_0xa09752(0x184));}export function resolveTDFolderPath(_0x2dff36,_0x3f8d72,_0x5cc9fa){const _0x1cfd7a=a100_0x525e79;if(!_0x3f8d72)return _0x2dff36;if(_0x2dff36===_0x5cc9fa||_0x2dff36[_0x1cfd7a(0x16b)](_0x5cc9fa+'/'))return _0x2dff36;return _0x2dff36?_0x5cc9fa+'/'+_0x2dff36:_0x5cc9fa;}export function addFoldersToCreate(_0x44c058,_0x37e8df,_0x17e130){const _0xcc2941=a100_0x525e79;if(!_0x44c058)return;if(_0x37e8df[_0xcc2941(0x18b)](_0x44c058))return;const _0x32f5f0=_0x44c058['split']('/');let _0x34b49a='';for(const _0x13e957 of _0x32f5f0){_0x34b49a=_0x34b49a?_0x34b49a+'/'+_0x13e957:_0x13e957,!_0x37e8df[_0xcc2941(0x18b)](_0x34b49a)&&_0x17e130[_0xcc2941(0x125)](_0x34b49a);}}import*as a100_0x931458 from'yaml';import{readFileSync}from'fs';import a100_0x2084fa from'path';import{isJourneyDef,parseYamlString as a100_0x327f5d,toYamlString as a100_0x1a6bed,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(_0x28d5b6){const _0x45158d=a100_0x525e79;if(Array[_0x45158d(0xda)](_0x28d5b6))return'['+_0x28d5b6[_0x45158d(0x199)](_0x1aee53=>stableStringify(_0x1aee53))[_0x45158d(0x149)](',')+']';if(_0x28d5b6&&typeof _0x28d5b6===_0x45158d(0x103)){const _0x36c571=_0x28d5b6,_0x4c4d74=Object[_0x45158d(0x12e)](_0x36c571)[_0x45158d(0xe4)](),_0x16d5ea=_0x4c4d74[_0x45158d(0x199)](_0x4139a9=>'\x22'+_0x4139a9+'\x22:'+stableStringify(_0x36c571[_0x4139a9]));return'{'+_0x16d5ea[_0x45158d(0x149)](',')+'}';}const _0x464166=JSON[_0x45158d(0x11e)](_0x28d5b6);return _0x464166===undefined?'null':_0x464166;}function activationSignature(_0x35cc8d){const _0x41d854=a100_0x525e79,_0x2c1fd7={'connection':_0x35cc8d['connection'],..._0x35cc8d['all_columns']!==undefined&&{'all_columns':_0x35cc8d[_0x41d854(0xef)]},..._0x35cc8d[_0x41d854(0x186)]!==undefined&&{'columns':_0x35cc8d['columns']},..._0x35cc8d[_0x41d854(0xec)]!==undefined&&{'behavior':_0x35cc8d['behavior']},..._0x35cc8d[_0x41d854(0x198)]!==undefined&&{'schedule':_0x35cc8d[_0x41d854(0x198)]},..._0x35cc8d[_0x41d854(0x11d)]!==undefined&&{'notification':_0x35cc8d[_0x41d854(0x11d)]},..._0x35cc8d[_0x41d854(0x139)]!==undefined&&{'connector_config':_0x35cc8d['connector_config']},..._0x35cc8d['activation_template_id']!==undefined&&{'activation_template_id':_0x35cc8d[_0x41d854(0x13c)]}};return stableStringify(_0x2c1fd7);}export async function prepareSegmentFiles(_0x5754ec,_0x546c1d,_0x2e171a,_0x944466,_0x3ec9e3){const _0x3a08d6=a100_0x525e79,{activationDefToCreateRequest:_0x42e80a}=await import('./child-segment-yaml.js'),_0x4ad9af=[],_0x2f95b5=new Set();for(const {yamlConfig:_0x1031db,folderPath:_0x2ed790,sourcePath:_0x3b34e9}of _0x5754ec){const _0xe67444=resolveTDFolderPath(_0x2ed790,_0x944466,_0x3ec9e3),_0x35a61a=_0xe67444+':'+_0x1031db[_0x3a08d6(0x16d)],_0x4e4531=_0x546c1d[_0x3a08d6(0x14e)][_0x3a08d6(0x1ae)](_0x35a61a),_0x14f5fb=_0x4e4531?_0x546c1d[_0x3a08d6(0x17f)][_0x3a08d6(0x1ae)](_0x4e4531['id'])||[]:[];addFoldersToCreate(_0xe67444,_0x546c1d[_0x3a08d6(0x175)],_0x2f95b5);const _0x299249=calculateActivationActions(_0x1031db[_0x3a08d6(0x177)]||[],_0x14f5fb,_0x546c1d['idToEmailMap'],_0x546c1d['connectionIdToNameMap']);for(const _0x1e861f of _0x299249){(_0x1e861f[_0x3a08d6(0x183)]===_0x3a08d6(0x17a)||_0x1e861f[_0x3a08d6(0x183)]===_0x3a08d6(0x168))&&_0x1e861f[_0x3a08d6(0x109)]&&(_0x1e861f['validatedRequest']=await _0x42e80a(_0x1e861f[_0x3a08d6(0x109)],_0x2e171a));}const _0x45fa84=calculateSegmentDiff(_0x1031db,_0x4e4531,_0x14f5fb,_0x546c1d[_0x3a08d6(0x112)],_0x546c1d['connectionIdToNameMap']);_0x4ad9af[_0x3a08d6(0xdf)]({'relativePath':_0x1031db['name'],'absolutePath':_0x3b34e9,'yamlConfig':_0x1031db,'folderPath':_0xe67444,'existingSegment':_0x4e4531,'existingActivations':_0x14f5fb,'isNew':_0x45fa84[_0x3a08d6(0x185)],'hasChanges':_0x45fa84[_0x3a08d6(0x15d)],'diff':_0x45fa84[_0x3a08d6(0xfd)],'activationActions':_0x299249});}return{'segmentFiles':_0x4ad9af,'foldersToCreate':_0x2f95b5};}export async function prepareJourneyFiles(_0x128d22,_0x37eaa8,_0x4e9b41,_0x37b092){const _0x3ab91a=a100_0x525e79,_0x593e73=[],_0x1267cb=new Set();for(const {yamlConfig:_0x5409a2,folderPath:_0x10c385,sourcePath:_0x303bb6}of _0x128d22){const _0x16a0b8=resolveTDFolderPath(_0x10c385,_0x4e9b41,_0x37b092),_0x1fb673=_0x16a0b8+':'+_0x5409a2[_0x3ab91a(0x16d)],_0x411147=_0x37eaa8['journeyBundlesByFolderAndName'][_0x3ab91a(0x1ae)](_0x1fb673);let _0x7994b4,_0x2aac0c;if(_0x411147&&_0x411147[_0x3ab91a(0x104)]>0x0){const _0x4b258b=buildLocalExpandedRuleMappings(_0x5409a2),{createYamlContext:_0x10cc0,prefetchJourneySegments:_0x39fa8b}=createPushYamlContextForBundle(_0x37eaa8[_0x3ab91a(0x156)],_0x37eaa8['parentId'],_0x37eaa8[_0x3ab91a(0x1a8)],_0x4b258b,_0x37eaa8[_0x3ab91a(0x112)],_0x37eaa8[_0x3ab91a(0x166)],_0x37eaa8[_0x3ab91a(0x1a4)],_0x37eaa8[_0x3ab91a(0xe3)]);await _0x39fa8b(_0x411147['map'](_0x44a59b=>_0x44a59b['id']));const _0x1eee00=hasMultipleVersions(_0x5409a2),_0x266d35=async _0x3bbef3=>{const _0x3a1bc7=_0x3ab91a,_0x4dd789=_0x37eaa8[_0x3a1bc7(0xe3)]?.[_0x3a1bc7(0x1ae)](_0x3bbef3);if(_0x4dd789)return _0x4dd789;return _0x37eaa8[_0x3a1bc7(0x13b)]({'journeyId':_0x3bbef3,'journeyName':_0x5409a2[_0x3a1bc7(0x16d)],'isMultiVersion':_0x411147[_0x3a1bc7(0x104)]>0x1});};if(_0x1eee00&&_0x411147[_0x3ab91a(0x104)]>0x1){const _0x2e2375=[];for(const _0xe33e81 of _0x411147){const _0x3b0bc1=_0xe33e81[_0x3ab91a(0x182)]||0x1;_0x37eaa8['progress']?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2[_0x3ab91a(0x16d)]+'\x20v'+_0x3b0bc1);const _0x23d069=await _0x266d35(_0xe33e81['id']),_0x46d73a=_0x10cc0(_0xe33e81['id']),_0x203955=await journeyResponseToDef(_0x23d069,_0x46d73a);_0x2e2375[_0x3ab91a(0xdf)]({'item':_0xe33e81,'yaml':_0x203955});}const _0x145c16=buildLocalRuleToNameMappingFromJourney(_0x5409a2);_0x2aac0c=buildMergedJourneyDef(_0x2e2375,_0x145c16);const _0x549b48=Math[_0x3ab91a(0x159)](..._0x2e2375['map'](_0x1e6021=>_0x1e6021[_0x3ab91a(0x12f)][_0x3ab91a(0x182)]||0x0)),_0x30fc21=_0x411147[_0x3ab91a(0x14d)](_0x16ed85=>(_0x16ed85[_0x3ab91a(0x182)]||0x0)===_0x549b48);_0x30fc21&&(_0x37eaa8['progress']?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2[_0x3ab91a(0x16d)]+'\x20v'+_0x549b48),_0x7994b4=await _0x266d35(_0x30fc21['id']));}else{const _0x206ad8=_0x411147[_0x411147[_0x3ab91a(0x104)]-0x1];_0x37eaa8[_0x3ab91a(0xd8)]?.[_0x3ab91a(0x168)](_0x3ab91a(0x10a)+_0x5409a2['name']),_0x7994b4=await _0x266d35(_0x206ad8['id']);const _0x46cca5=_0x10cc0(_0x206ad8['id']),_0x1cad5d=await journeyResponseToDef(_0x7994b4,_0x46cca5),_0x5ed5e7=buildLocalRuleToNameMappingFromJourney(_0x5409a2);_0x2aac0c=buildMergedJourneyDef([{'item':_0x206ad8,'yaml':_0x1cad5d}],_0x5ed5e7);}}addFoldersToCreate(_0x16a0b8,_0x37eaa8[_0x3ab91a(0x175)],_0x1267cb);const _0x5d6cca=calculateJourneyDiff(_0x5409a2,_0x2aac0c);_0x593e73[_0x3ab91a(0xdf)]({'relativePath':_0x5409a2[_0x3ab91a(0x16d)],'absolutePath':_0x303bb6,'yamlConfig':_0x5409a2,'folderPath':_0x16a0b8,'existingJourney':_0x7994b4,'isNew':_0x5d6cca[_0x3ab91a(0x185)],'hasChanges':_0x5d6cca[_0x3ab91a(0x15d)],'diff':_0x5d6cca[_0x3ab91a(0xfd)]});}return{'journeyFiles':_0x593e73,'foldersToCreate':_0x1267cb};}export function calculateActivationActions(_0x5d8861,_0x503c43,_0x23117b,_0x41c063){const _0x437156=a100_0x525e79,_0x5915d9=[],_0x4838a9=new Map();for(const _0x34ed37 of _0x503c43){_0x4838a9[_0x437156(0x189)](_0x34ed37[_0x437156(0x16d)],_0x34ed37);}const _0x4fc992=new Map();for(const _0xb8d755 of _0x5d8861){_0x4fc992[_0x437156(0x189)](_0xb8d755[_0x437156(0x16d)],_0xb8d755);}for(const _0x5cced1 of _0x5d8861){const _0x17cffd=_0x4838a9[_0x437156(0x1ae)](_0x5cced1['name']);if(!_0x17cffd)_0x5915d9[_0x437156(0xdf)]({'type':'create','name':_0x5cced1[_0x437156(0x16d)],'yamlActivation':_0x5cced1});else{const _0x4c2ba0=activationResponseToDef(_0x17cffd,_0x23117b,_0x41c063),_0x56d836=a100_0x931458[_0x437156(0x11e)](_0x4c2ba0),_0x5f476c=a100_0x931458['stringify'](_0x5cced1);_0x56d836!==_0x5f476c&&_0x5915d9[_0x437156(0xdf)]({'type':_0x437156(0x168),'name':_0x5cced1[_0x437156(0x16d)],'yamlActivation':_0x5cced1,'existingActivation':_0x17cffd});}}for(const _0x4284bd of _0x503c43){!_0x4fc992['has'](_0x4284bd[_0x437156(0x16d)])&&_0x5915d9['push']({'type':_0x437156(0x19b),'name':_0x4284bd[_0x437156(0x16d)],'existingActivation':_0x4284bd});}return _0x5915d9;}export function calculateSegmentDiff(_0x1c08e2,_0x4bd2e0,_0x360760,_0xaf1777,_0x1df965){const _0x4f85b8=segmentToYamlString(_0x1c08e2);if(_0x4bd2e0){const _0x1507d2=segmentWithActivationsToYaml(_0x4bd2e0,_0x360760,undefined,_0xaf1777,_0x1df965),_0x532bcb=segmentToYamlString(_0x1507d2),_0x542b78=generateDiff(_0x532bcb,_0x4f85b8),_0x4f3c6c=hasChanges(_0x542b78);return{'isNew':![],'hasChanges':_0x4f3c6c,'diff':_0x4f3c6c?formatDiffWithColors(_0x542b78):undefined};}const _0x5cc04f=generateDiff('',_0x4f85b8);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5cc04f)};}export function calculateJourneyDiff(_0x1a3b41,_0x4e6dd6){const _0x11cd57=normalizeJourneyDef(_0x1a3b41,_0x1a3b41),_0x2dbd26=a100_0x1a6bed(_0x11cd57);if(_0x4e6dd6){const _0x261b26=normalizeJourneyDef(_0x4e6dd6,_0x1a3b41),_0xdb2e9d=a100_0x1a6bed(_0x261b26),_0xed77c7=generateDiff(_0xdb2e9d,_0x2dbd26),_0x4bdd52=hasChanges(_0xed77c7);return{'isNew':![],'hasChanges':_0x4bdd52,'diff':_0x4bdd52?formatDiffWithColors(_0xed77c7):undefined};}const _0x1903b4=generateDiff('',_0x2dbd26);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1903b4)};}export function findSegmentsToDelete(_0x4b4bd5,_0x274d4f,_0x558c6e,_0xcdbf8e,_0x3f10e4){const _0x183c2b=a100_0x525e79,_0x95dfc5=new Set();for(const {yamlConfig:_0x494b4e,folderPath:_0x3846c5}of _0x274d4f){_0x95dfc5[_0x183c2b(0x125)](_0x3846c5+':'+_0x494b4e[_0x183c2b(0x16d)]);}return _0x4b4bd5[_0x183c2b(0x1a0)](_0x402c17=>{const _0x5dc0e0=_0x183c2b,_0x1d6c77=_0x402c17[_0x5dc0e0(0xd2)]?_0x558c6e['get'](_0x402c17[_0x5dc0e0(0xd2)]['toString']())||'':'',_0xa15a8c=_0x1d6c77+':'+_0x402c17[_0x5dc0e0(0x16d)];if(_0x95dfc5['has'](_0xa15a8c))return![];if(_0x3f10e4)return _0x1d6c77===_0xcdbf8e||_0x1d6c77[_0x5dc0e0(0x16b)](_0xcdbf8e+'/');return!![];});}export function findJourneysToDelete(_0x4c2fb4,_0x21a99e,_0x29a3d9,_0x5da7c6,_0x171fc9){const _0x5d139d=a100_0x525e79,_0x11aa89=new Set();for(const {yamlConfig:_0x25f686,folderPath:_0x14fa38}of _0x21a99e){_0x11aa89[_0x5d139d(0x125)](_0x14fa38+':'+_0x25f686[_0x5d139d(0x16d)]);}return _0x4c2fb4[_0x5d139d(0x1a0)](_0x2109e8=>{const _0x3d4207=_0x5d139d,_0xae1dfd=_0x2109e8[_0x3d4207(0x12d)]?_0x29a3d9[_0x3d4207(0x1ae)](_0x2109e8[_0x3d4207(0x12d)])||'':'',_0x517dc6=_0xae1dfd+':'+_0x2109e8[_0x3d4207(0x1a7)];if(_0x11aa89['has'](_0x517dc6))return![];if(_0x171fc9)return _0xae1dfd===_0x5da7c6||_0xae1dfd[_0x3d4207(0x16b)](_0x5da7c6+'/');return!![];});}export function buildSegmentLookupMap(_0xa4a6fc,_0x18b863){const _0xcdbfe9=a100_0x525e79,_0x54d575=new Map();for(const _0x21645b of _0xa4a6fc){const _0x247821=_0x21645b[_0xcdbfe9(0xd2)]?_0x18b863[_0xcdbfe9(0x1ae)](_0x21645b[_0xcdbfe9(0xd2)][_0xcdbfe9(0x138)]())||'':'',_0x53e8de=_0x247821+':'+_0x21645b[_0xcdbfe9(0x16d)];_0x54d575[_0xcdbfe9(0x189)](_0x53e8de,_0x21645b);}return _0x54d575;}export function buildSegmentNameToIdMap(_0x1e88d3){const _0x384a20=a100_0x525e79,_0x2a2388=new Map();for(const _0x195a76 of _0x1e88d3){_0x2a2388['set'](_0x195a76[_0x384a20(0x16d)],_0x195a76['id']);}return _0x2a2388;}export function buildJourneyBundleLookupMap(_0x36a567,_0x10e86a){const _0x4036c7=a100_0x525e79,_0x29ecb8=new Map();for(const _0x3652a8 of _0x36a567){const _0x310fe3=_0x3652a8['folderId']?_0x10e86a[_0x4036c7(0x1ae)](_0x3652a8['folderId'])||'':'',_0x41f32e=_0x310fe3+':'+_0x3652a8[_0x4036c7(0x1a7)];!_0x29ecb8['has'](_0x41f32e)&&_0x29ecb8[_0x4036c7(0x189)](_0x41f32e,[]),_0x29ecb8[_0x4036c7(0x1ae)](_0x41f32e)[_0x4036c7(0xdf)](_0x3652a8);}for(const _0x4b2df3 of _0x29ecb8['values']()){_0x4b2df3['sort']((_0x1ff893,_0x3d161c)=>(_0x1ff893[_0x4036c7(0x182)]||0x0)-(_0x3d161c[_0x4036c7(0x182)]||0x0));}return _0x29ecb8;}export function collectFoldersToCreate(_0x18a59b,_0x30c2be){const _0x1a2cf2=a100_0x525e79,_0x56c818=new Set();for(const _0x1275c3 of _0x18a59b){if(!_0x1275c3)continue;if(_0x30c2be[_0x1a2cf2(0x18b)](_0x1275c3))continue;const _0x100560=_0x1275c3[_0x1a2cf2(0x1a9)]('/');let _0xaaa542='';for(const _0x7552ec of _0x100560){_0xaaa542=_0xaaa542?_0xaaa542+'/'+_0x7552ec:_0x7552ec,!_0x30c2be[_0x1a2cf2(0x18b)](_0xaaa542)&&_0x56c818['add'](_0xaaa542);}}return _0x56c818;}export function parseAndClassifyYamlFiles(_0x1c048e,_0x13b4dc,_0x382e42){const _0x2a93f8=a100_0x525e79,_0x5ada6a=[],_0x1e035d=[];for(const _0x1cfdb3 of _0x1c048e){const _0xdad03c=a100_0x2084fa[_0x2a93f8(0x14f)](_0x13b4dc,a100_0x2084fa[_0x2a93f8(0x16f)](_0x1cfdb3)),_0x14d5a8=_0xdad03c==='.'?'':_0xdad03c,_0xc545ac=readFileSync(_0x1cfdb3,'utf-8'),_0x352fbd=a100_0x931458[_0x2a93f8(0xed)](_0xc545ac);if(isJourneyDef(_0x352fbd)){const _0x1f1745=a100_0x327f5d(_0xc545ac);_0x1e035d[_0x2a93f8(0xdf)]({'yamlConfig':_0x1f1745,'folderPath':_0x14d5a8,'sourcePath':_0x1cfdb3});}else{if(!_0x382e42?.[_0x2a93f8(0xf6)]){const _0x2835f4=parseSegmentYamlFile(_0xc545ac),_0x3cdee3=normalizeChildSegmentYaml(_0x2835f4);_0x5ada6a[_0x2a93f8(0xdf)]({'yamlConfig':_0x3cdee3,'folderPath':_0x14d5a8,'sourcePath':_0x1cfdb3});}}}return{'segments':_0x5ada6a,'journeys':_0x1e035d};}function a100_0x3036(){const _0x35373b=['Updated\x20journey\x20\x27','create','\x27\x20exit\x20criteria','yamlConfig','JOURNEY_SYNTAX_ERROR','Updated\x20activation\x20\x27','activationsBySegmentId','existingActivation','JOURNEY_UPDATE_ERROR','versionNumber','type','draft','isNew','columns','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','attributes','set','embeddedSegmentNameToId','has','milestone','updated','createdSegmentId','valid','9536856TuGRiG','22chfOek','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','198zReAln','segment_updated','activation_updated','localSegmentRules','schedule','map','onProgress','delete','Activation\x20not\x20found:\x20','logInfo','\x27\x20from\x20file:\x20','journeyActivationStepId','filter','activation_deleting','Entry\x20criteria:\x20','activation_created','activationStepsById','activationContext','rule','journeyBundleName','existingSegments','split','existingJourney','Created\x20folder\x20\x27','Activation','NOT_FOUND','get','segmentFolderId','journey_created','with','activation_deleted','\x27...','withProgress','progress','stage\x20\x27','isArray','idToName','./child-segment-yaml.js','slice','sha1','push','unchanged','journeyId','createJourneySegment','journeyById','sort','__pending_act_','listActivations','9RFUSOY','\x20error(s)','reduce','Name\x20has\x20already\x20been\x20taken','ACTIVATION_UPDATE_ERROR','behavior','parse','48VtGsFg','all_columns','journey_entry_criteria_','\x0a\x20\x20','folder_created','absolutePath','parseDocument','deleteSegment','skipSegments','updateSegmentById','SEGMENT_SYNTAX_ERROR','segment_created','entryCriteria','action','625460UchlrO','diff','resolveSegment','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','created','flatMap','../../utils/async.js','object','length','replace','Deleting\x20activation\x20\x27','entry_criteria','stages','yamlActivation','Fetching\x20','Stage\x20\x27','all','listSegments','journeys','journey_creating','createActivation','387062idDULY','idToEmailMap','./journey-yaml.js','activationParams','segments','segment_deleted','\x27\x20decision\x20point\x20branch\x20\x27','verbose','__pending_','SEGMENT_NOT_FOUND','activation_','activation_updating','notification','stringify','logSuccess','parentId','1692131lOcMfo','validatedRequest','journeyStages','description','add','trim','toLowerCase','state','segmentId','index','segment_updating','relationships','folderId','keys','item','from','createdSegmentIds','5580320OzljGY','1789884diIJQx','utf-8','getJourney','createFolder','goal','toString','connector_config','journey','fetchJourney','activation_template_id','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','kind','\x27\x20wait\x20condition','user','Creating\x20activation\x20\x27','Failed\x20to\x20','Deleted\x20activation\x20\x27','\x20activation\x20\x27','steps','folderPath','WaitStep','DecisionPoint','join','\x20(referenced\x20in\x20journey\x20','Updated\x20segment\x20\x27','errors','find','segmentByFolderAndName','relative','segmentNameToId','deleted','folder_creating','Created\x20segment\x20\x27','existingSegment','ACTIVATION_SYNTAX_ERROR','deps','segment','5MPjMHd','max','activationActions','size','goal\x20criteria','hasChanges','decision_point','segment_deleting','includes','embedded_activation_creating','rootFolderId','SEGMENT_UPDATE_ERROR','getSegment','\x27\x20not\x20found\x20in\x20journey\x20\x27','connectionIdToNameMap','waitCondition','update','digest','Created\x20activation\x20\x27','startsWith','exitCriterias','name','branches','dirname','Segment\x20not\x20found:\x20','data','embedded_segment_created','8492688CPGinD','embedded_segment_creating','folderPathToId','folder','activations','embedded_activation_created'];a100_0x3036=function(){return _0x35373b;};return a100_0x3036();}export function validateParsedFiles(_0x34859a,_0x4eed29){const _0x5c15e1=a100_0x525e79,_0x326c49=[];for(const {yamlConfig:_0x2c6600,sourcePath:_0x3b7cae}of _0x34859a[_0x5c15e1(0x115)]){const _0x43dd52=readFileSync(_0x3b7cae,_0x5c15e1(0x134)),_0x2934b3=a100_0x931458[_0x5c15e1(0xf4)](_0x43dd52),_0x4d269c=validateSegmentDef(_0x2c6600,{'source':_0x43dd52,'document':_0x2934b3});if(!_0x4d269c['valid']){const _0x234267=a100_0x2084fa[_0x5c15e1(0x14f)](_0x4eed29,_0x3b7cae);_0x326c49[_0x5c15e1(0xdf)]({'filePath':_0x234267,'source':_0x43dd52,'result':_0x4d269c,'isJourney':![]});}}for(const {yamlConfig:_0x577c84,sourcePath:_0x252ade}of _0x34859a[_0x5c15e1(0x10e)]){const _0x1e3cc8=readFileSync(_0x252ade,_0x5c15e1(0x134)),_0x3d56d0=a100_0x931458[_0x5c15e1(0xf4)](_0x1e3cc8),_0x472909=validateJourneyDef(_0x577c84,{'source':_0x1e3cc8,'document':_0x3d56d0});if(!_0x472909[_0x5c15e1(0x18f)]){const _0x2b83fa=a100_0x2084fa[_0x5c15e1(0x14f)](_0x4eed29,_0x252ade);_0x326c49[_0x5c15e1(0xdf)]({'filePath':_0x2b83fa,'source':_0x1e3cc8,'result':_0x472909,'isJourney':!![]});}}return _0x326c49;}export function formatValidationErrors(_0x20d56e){const _0x1b660e=a100_0x525e79,_0x44cb10=[];for(const {filePath:_0x2244e0,source:_0x5a82d3,result:_0x5bc00f,isJourney:_0x4bde6e}of _0x20d56e){const _0x5cbea6=_0x4bde6e?_0x1b660e(0x13a):_0x1b660e(0x157);_0x44cb10[_0x1b660e(0xdf)]('\x0a'+_0x2244e0+'\x20('+_0x5cbea6+'):\x20'+_0x5bc00f[_0x1b660e(0x14c)]['length']+_0x1b660e(0xe8)),_0x44cb10[_0x1b660e(0xdf)](formatValidationResult(_0x5bc00f,_0x5a82d3,_0x2244e0));}return _0x44cb10[_0x1b660e(0x149)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x896a93){const _0x261736=a100_0x525e79,_0x2ee704=new Set(),_0x4b140b=new Map(),_0x4552f1=collectSegmentUsageCounts(_0x896a93);if(_0x896a93['segments'])for(const [_0x453843,_0x3e4f41]of Object['entries'](_0x896a93[_0x261736(0x115)])){_0x2ee704[_0x261736(0x125)](_0x453843);if(_0x3e4f41[_0x261736(0x1a6)]){const _0x274596=yamlRuleToApi(_0x3e4f41[_0x261736(0x1a6)]),_0xf672f6=apiRuleToYaml(_0x274596);_0x4b140b['set'](_0x453843,_0xf672f6);}}const _0xa320a5=new Map();let _0x5ae64a=0x0;for(const [_0x1405e0,_0x2e74d7]of _0x4b140b){const _0x29e473=serializeExpandedRule(_0x2e74d7,_0x4b140b),_0x513775=_0xa320a5[_0x261736(0x1ae)](_0x29e473)||[];_0x513775[_0x261736(0xdf)]({'name':_0x1405e0,'index':_0x5ae64a}),_0xa320a5[_0x261736(0x189)](_0x29e473,_0x513775),_0x5ae64a++;}const _0x475378=new Map();for(const [_0x2bd85b,_0x470eab]of _0xa320a5){const _0x3dc562=_0x470eab[_0x261736(0xdd)]()[_0x261736(0xe4)]((_0x225ba9,_0x2b22a1)=>{const _0x49915a=_0x261736,_0x29bf57=_0x4552f1[_0x49915a(0x1ae)](_0x225ba9[_0x49915a(0x16d)])||0x0,_0x450793=_0x4552f1['get'](_0x2b22a1[_0x49915a(0x16d)])||0x0;if(_0x29bf57!==_0x450793)return _0x450793-_0x29bf57;return _0x225ba9[_0x49915a(0x12a)]-_0x2b22a1[_0x49915a(0x12a)];})[_0x261736(0x199)](_0x28e9fa=>_0x28e9fa['name']),_0x325124=[];for(const _0x3c75cd of _0x3dc562){const _0x3d191e=_0x4552f1['get'](_0x3c75cd)||0x0,_0x2221b4=Math[_0x261736(0x159)](_0x3d191e,0x1);for(let _0x14f857=0x0;_0x14f857<_0x2221b4;_0x14f857++){_0x325124[_0x261736(0xdf)](_0x3c75cd);}}_0x475378[_0x261736(0x189)](_0x2bd85b,_0x325124);}return{'existingLocalSegmentNames':_0x2ee704,'localSegmentRules':_0x4b140b,'localExpandedRuleToNames':_0x475378};}async function buildServerSegmentRuleMap(_0x444b34,_0x226033,_0x83d741,_0x3a333e){const _0x547284=new Map(),_0x282dd1=new Set(),_0x380802=async _0x53ebba=>{const _0x571640=a100_0x5482;if(_0x282dd1[_0x571640(0x18b)](_0x53ebba))return;_0x282dd1[_0x571640(0x125)](_0x53ebba);let _0x30d03d=_0x83d741[_0x571640(0x14d)](_0x527f14=>_0x527f14['id']===_0x53ebba);if(!_0x30d03d)try{_0x30d03d=await _0x444b34[_0x571640(0x157)][_0x571640(0x164)](_0x226033,_0x53ebba);}catch{return;}if(!_0x30d03d?.[_0x571640(0x1a6)])return;const _0x1b39fa=apiRuleToYaml(_0x30d03d['rule']);_0x547284[_0x571640(0x189)](_0x53ebba,_0x1b39fa);const _0x16d739=collectSegmentRefsFromRule(_0x1b39fa);for(const _0x5c8f34 of _0x16d739){await _0x380802(_0x5c8f34);}};for(const _0x57bda8 of _0x3a333e){await _0x380802(_0x57bda8);}return _0x547284;}export function createSegmentIdResolver(_0x55447b,_0x16b080){return async _0x507166=>{const _0x4aec09=a100_0x5482,_0x42e78f=_0x55447b[_0x4aec09(0x1ae)](_0x507166);if(!_0x42e78f)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x4aec09(0x170)+_0x507166+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x16b080+'\x27)');return _0x42e78f;};}export function extractRootFolderId(_0x33758b){const _0x549b88=a100_0x525e79;return _0x33758b[_0x549b88(0x12c)]?.['parentSegmentFolder']?.[_0x549b88(0x171)]?.['id']||_0x33758b[_0x549b88(0x12c)]?.['parentFolder']?.[_0x549b88(0x171)]?.['id'];}export function buildConnectionMaps(_0x540ed1){const _0x21d67d=a100_0x525e79,_0x2b1dc2=new Map(),_0x232c6b=new Map(),_0x6e6906=new Map();for(const _0x5bfcb6 of _0x540ed1){_0x2b1dc2[_0x21d67d(0x189)](_0x5bfcb6[_0x21d67d(0x16d)],parseInt(_0x5bfcb6['id'],0xa)),_0x232c6b[_0x21d67d(0x189)](_0x5bfcb6['id'],_0x5bfcb6[_0x21d67d(0x16d)]),_0x6e6906['set'](_0x5bfcb6['name'],_0x5bfcb6['type']);}return{'nameToId':_0x2b1dc2,'idToName':_0x232c6b,'nameToType':_0x6e6906};}export function calculatePushStats(_0x5e1278,_0x69da60,_0x3aad73,_0x4f5ca4,_0x455bc5,_0x2e122b,_0x56a64e){const _0x62a650=a100_0x525e79,_0x50ba74=_0x5e1278[_0x62a650(0x1a0)](_0x2f72f7=>_0x2f72f7[_0x62a650(0x185)]),_0x54a8e6=_0x5e1278[_0x62a650(0x1a0)](_0x513b74=>!_0x513b74[_0x62a650(0x185)]&&_0x513b74[_0x62a650(0x15d)]),_0x4044fa=_0x5e1278[_0x62a650(0x1a0)](_0x492bda=>!_0x492bda['isNew']&&!_0x492bda[_0x62a650(0x15d)]),_0x56cff1=_0x2e122b?_0x4f5ca4:[],_0x360727=_0x69da60['filter'](_0x4bf905=>_0x4bf905['isNew']),_0x464992=_0x69da60[_0x62a650(0x1a0)](_0x5cfb1e=>!_0x5cfb1e[_0x62a650(0x185)]&&_0x5cfb1e[_0x62a650(0x15d)]),_0x127b9f=_0x69da60[_0x62a650(0x1a0)](_0xd19c70=>!_0xd19c70[_0x62a650(0x185)]&&!_0xd19c70['hasChanges']),_0x17b469=_0x2e122b?_0x455bc5:[],_0xdbcaf5=_0x5e1278[_0x62a650(0x101)](_0x19262d=>_0x19262d[_0x62a650(0x15a)]),_0x2947ef=_0xdbcaf5[_0x62a650(0x1a0)](_0x1a1e25=>_0x1a1e25[_0x62a650(0x183)]===_0x62a650(0x17a)),_0x4a324e=_0xdbcaf5['filter'](_0x3e0c0b=>_0x3e0c0b[_0x62a650(0x183)]===_0x62a650(0x168)),_0x1094d9=_0xdbcaf5[_0x62a650(0x1a0)](_0x17976a=>_0x17976a[_0x62a650(0x183)]===_0x62a650(0x19b)),_0x329f4f=Array[_0x62a650(0x130)](_0x3aad73)[_0x62a650(0xe4)](),_0x5055c9=_0x56a64e?![]:_0x50ba74[_0x62a650(0x104)]>0x0||_0x54a8e6[_0x62a650(0x104)]>0x0||_0x56cff1['length']>0x0,_0x4c8093=_0x360727[_0x62a650(0x104)]>0x0||_0x464992[_0x62a650(0x104)]>0x0||_0x17b469[_0x62a650(0x104)]>0x0,_0x3df273=_0x56a64e?![]:_0xdbcaf5[_0x62a650(0x104)]>0x0,_0x20a4f6=_0x329f4f[_0x62a650(0x104)]>0x0;return{'segments':{'new':_0x50ba74,'changed':_0x54a8e6,'unchanged':_0x4044fa,'toDelete':_0x56cff1},'journeys':{'new':_0x360727,'changed':_0x464992,'unchanged':_0x127b9f,'toDelete':_0x17b469},'activations':{'all':_0xdbcaf5,'toCreate':_0x2947ef,'toUpdate':_0x4a324e,'toDelete':_0x1094d9},'folders':{'toCreate':_0x329f4f},'counts':{'segments':{'new':_0x50ba74[_0x62a650(0x104)],'changed':_0x54a8e6[_0x62a650(0x104)],'unchanged':_0x4044fa['length'],'toDelete':_0x56cff1['length']},'journeys':{'new':_0x360727[_0x62a650(0x104)],'changed':_0x464992[_0x62a650(0x104)],'unchanged':_0x127b9f[_0x62a650(0x104)],'toDelete':_0x17b469[_0x62a650(0x104)]},'activations':{'create':_0x2947ef['length'],'update':_0x4a324e[_0x62a650(0x104)],'delete':_0x1094d9[_0x62a650(0x104)]},'folders':_0x329f4f[_0x62a650(0x104)]},'hasChanges':_0x5055c9||_0x4c8093||_0x3df273||_0x20a4f6};}export async function buildPushExecutionContext(_0x2785d9,_0x456852,_0x5cc423,_0x17352b,_0x383f0f,_0x2938f1){const _0x5b5eb8=a100_0x525e79,_0x39c77a=extractRootFolderId(_0x5cc423),{pathToId:_0x11c7dd,idToPath:_0x3fa7bc}=buildFolderMaps(_0x383f0f),_0x102357=buildSegmentNameToIdMap(_0x17352b),_0x35a61d=new Map(),{batchAsync:_0x4a31a7}=await import(_0x5b5eb8(0x102)),[_0x9d51e7,_0x4e0983]=await Promise['all']([_0x2785d9[_0x5b5eb8(0x140)]['buildUserMaps'](),_0x2785d9['connection']['list'](),((async()=>{const _0x579d4e=_0x5b5eb8;!_0x2938f1&&_0x17352b[_0x579d4e(0x104)]>0x0&&await _0x4a31a7(_0x17352b,async _0x18f59a=>{const _0x148d07=_0x579d4e,_0x9b28aa=await _0x2785d9['segment'][_0x148d07(0xe6)](_0x456852,_0x18f59a['id']);_0x35a61d[_0x148d07(0x189)](_0x18f59a['id'],_0x9b28aa);});})())]),{emailToId:_0xc8d2c9,idToEmail:_0x585bb7}=_0x9d51e7,_0x48dd6d=buildConnectionMaps(_0x4e0983);return{'rootFolderId':_0x39c77a,'folderPathToId':_0x11c7dd,'folderIdToPath':_0x3fa7bc,'segmentNameToId':_0x102357,'activationsBySegmentId':_0x35a61d,'emailToIdMap':_0xc8d2c9,'idToEmailMap':_0x585bb7,'connectionNameToIdMap':_0x48dd6d['nameToId'],'connectionIdToNameMap':_0x48dd6d[_0x5b5eb8(0xdb)],'connectionNameToTypeMap':_0x48dd6d['nameToType']};}export function createPushYamlContextForBundle(_0xf9d3c1,_0x53503b,_0x219d99,_0xf64c5a,_0x5e80f8,_0x24bf33,_0xc02559,_0x30892c){const {existingLocalSegmentNames:_0xab8ea2,localExpandedRuleToNames:_0x460b6f}=_0xf64c5a,_0x3fcc29=new Set(),_0x1912df=new Map(),_0x3d9fa1=new Map(),_0x5506ac=new Map(),_0x5f339d=createJumpTargetCache(),_0x5ce158=new Map(),_0x4c962a=new Map(),_0x20285c=new Set();let _0x253a32;const _0xf38a44=_0x146b22=>{const _0x466c72={'resolveSegment':async _0x4c7abe=>{const _0x246f53=a100_0x5482,_0x1cebbb=_0x5506ac[_0x246f53(0x1ae)](_0x4c7abe);if(_0x1cebbb!==undefined)return{'name':_0x1cebbb,'isJourneyLocal':!![]};try{let _0x385133=_0x219d99[_0x246f53(0x14d)](_0x58917b=>_0x58917b['id']===_0x4c7abe);!_0x385133&&(_0x385133=await _0xf9d3c1[_0x246f53(0x157)][_0x246f53(0x164)](_0x53503b,_0x4c7abe));const _0x42f5ae=generateJourneyLocalName(_0x385133[_0x246f53(0x16d)]),_0x472802=_0x385133[_0x246f53(0x13e)]===SEGMENT_KIND_JOURNEY&&_0x42f5ae!==undefined;let _0x4972bb=_0x385133[_0x246f53(0x16d)],_0x3ec765;if(_0x472802&&_0x385133['rule']){const _0x1a924e=apiRuleToYaml(_0x385133[_0x246f53(0x1a6)]);_0x4c962a[_0x246f53(0x189)](_0x4c7abe,_0x1a924e);const _0x10c194=async _0x1b327c=>{const _0x492017=_0x246f53,_0x57747c=collectSegmentRefsFromRule(_0x1b327c);for(const _0x12e8ca of _0x57747c){if(!_0x4c962a[_0x492017(0x18b)](_0x12e8ca))try{const _0x11a3c9=await _0xf9d3c1[_0x492017(0x157)][_0x492017(0x164)](_0x53503b,_0x12e8ca);if(_0x11a3c9?.[_0x492017(0x1a6)]){const _0x184aaa=apiRuleToYaml(_0x11a3c9[_0x492017(0x1a6)]);_0x4c962a[_0x492017(0x189)](_0x12e8ca,_0x184aaa),await _0x10c194(_0x184aaa);}}catch{}}};await _0x10c194(_0x1a924e);const _0x228fb4=serializeExpandedRule(_0x1a924e,_0x4c962a),_0x259378=_0x460b6f[_0x246f53(0x1ae)](_0x228fb4);if(_0x259378&&_0x259378['length']>0x0){const _0x4f4a93=_0x1912df[_0x246f53(0x1ae)](_0x228fb4)||0x0,_0x277bbd=_0x259378[_0x4f4a93]||_0x259378[_0x259378[_0x246f53(0x104)]-0x1];_0x1912df['set'](_0x228fb4,_0x4f4a93+0x1),_0x4972bb=_0x277bbd,_0x3fcc29[_0x246f53(0x125)](_0x4972bb),_0x5506ac['set'](_0x4c7abe,_0x4972bb);const _0x115fa6=await resolveRuleSegmentRefs(_0x1a924e,async _0x506c5e=>{const _0x3ca9d5=_0x246f53,_0x523139=_0x5506ac[_0x3ca9d5(0x1ae)](_0x506c5e);if(_0x523139)return _0x523139;const _0x324081=await _0x253a32[_0x3ca9d5(0xfe)](_0x506c5e);return _0x324081['name'];});_0x3ec765={'description':_0x385133['description'],'rule':_0x115fa6};}else{const _0xd23d96=_0x5ce158[_0x246f53(0x1ae)](_0x228fb4);if(_0xd23d96)_0x4972bb=_0xd23d96,_0x5506ac[_0x246f53(0x189)](_0x4c7abe,_0x4972bb);else{if(_0x42f5ae){let _0x3ad1ea=_0x42f5ae,_0x26908a=0x2;while(_0x3fcc29[_0x246f53(0x18b)](_0x3ad1ea)||_0xab8ea2[_0x246f53(0x18b)](_0x3ad1ea)){_0x3ad1ea=_0x42f5ae+'_'+_0x26908a,_0x26908a++;}_0x3fcc29[_0x246f53(0x125)](_0x3ad1ea),_0x4972bb=_0x3ad1ea;}_0x5506ac[_0x246f53(0x189)](_0x4c7abe,_0x4972bb),_0x5ce158['set'](_0x228fb4,_0x4972bb);const _0x2e38d=await resolveRuleSegmentRefs(_0x1a924e,async _0x321f94=>{const _0xd34ef7=_0x246f53,_0x43bf7e=_0x5506ac[_0xd34ef7(0x1ae)](_0x321f94);if(_0x43bf7e)return _0x43bf7e;const _0x89e588=await _0x253a32[_0xd34ef7(0xfe)](_0x321f94);return _0x89e588[_0xd34ef7(0x16d)];});_0x3ec765={'description':_0x385133['description'],'rule':_0x2e38d};}}}return{'name':_0x4972bb,'isJourneyLocal':_0x472802,'definition':_0x3ec765};}catch{return{'name':_0x4c7abe,'isJourneyLocal':![]};}},'resolveActivation':async _0xa3390c=>{const _0x3d4a19=a100_0x5482,_0x5d62f7=_0x3d9fa1[_0x3d4a19(0x1ae)](_0xa3390c);if(_0x5d62f7!==undefined)return{'name':_0x5d62f7,'isJourneyLocal':!![]};try{let _0x5e860b=_0xc02559?.[_0x3d4a19(0x1ae)](_0xa3390c);!_0x5e860b&&(_0x5e860b=await _0xf9d3c1[_0x3d4a19(0x13a)]['getActivation'](_0x146b22,_0xa3390c));const _0x32cc06=_0x5e860b['attributes'][_0x3d4a19(0x114)][_0x3d4a19(0x16d)]||_0xa3390c,_0x885914=sanitizeYamlKey(_0x32cc06)||_0x3d4a19(0x11b)+_0xa3390c,_0x4d53b4=_0x885914;_0x3d9fa1['set'](_0xa3390c,_0x4d53b4);const _0xbc4ed5=journeyActivationStepToYaml(_0x5e860b,_0x5e80f8,_0x24bf33);return{'name':_0x4d53b4,'isJourneyLocal':!![],'definition':_0xbc4ed5};}catch{return{'name':_0xa3390c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1f4ff5,_0x28717f)=>resolveJumpTarget(_0x1f4ff5,_0x28717f,_0x5f339d,async _0x13b8b1=>{const _0x257076=a100_0x5482,_0x41c847=_0x30892c?.['get'](_0x13b8b1);if(_0x41c847)return _0x41c847;return _0xf9d3c1[_0x257076(0x13a)][_0x257076(0x135)](_0x13b8b1);})};return _0x253a32=_0x466c72,_0x466c72;},_0x201824=async _0x53f578=>{const _0x41978f=a100_0x5482,{collectSegmentIdsFromJourneyApi:_0x272b33}=await import(_0x41978f(0x113)),{batchAsync:_0x1b82b7}=await import(_0x41978f(0x102)),_0x5dddee=new Set();for(const _0x2f70f7 of _0x53f578){let _0x35c2af=_0x30892c?.[_0x41978f(0x1ae)](_0x2f70f7);!_0x35c2af&&(_0x35c2af=await _0xf9d3c1[_0x41978f(0x13a)]['getJourney'](_0x2f70f7));const _0xea52e6=_0x272b33(_0x35c2af);for(const _0x8f235b of _0xea52e6){_0x5dddee[_0x41978f(0x125)](_0x8f235b);}}let _0x411fe0=Array[_0x41978f(0x130)](_0x5dddee);while(_0x411fe0['length']>0x0){const _0x548d04=_0x411fe0[_0x41978f(0x1a0)](_0x549511=>!_0x20285c[_0x41978f(0x18b)](_0x549511));if(_0x548d04['length']===0x0)break;const _0x2008ea=await _0x1b82b7(_0x548d04,async _0x2b6a19=>{const _0x43e72d=_0x41978f;_0x20285c['add'](_0x2b6a19);let _0x3cad5c=_0x219d99[_0x43e72d(0x14d)](_0x346b11=>_0x346b11['id']===_0x2b6a19);if(!_0x3cad5c)try{_0x3cad5c=await _0xf9d3c1['segment'][_0x43e72d(0x164)](_0x53503b,_0x2b6a19);}catch{return null;}return{'segmentId':_0x2b6a19,'segment':_0x3cad5c};},0xa),_0x12c7b7=new Set();for(const _0xaae5aa of _0x2008ea){if(!_0xaae5aa?.['segment']?.[_0x41978f(0x1a6)])continue;const _0x3ef3c7=apiRuleToYaml(_0xaae5aa[_0x41978f(0x157)][_0x41978f(0x1a6)]);_0x4c962a[_0x41978f(0x189)](_0xaae5aa[_0x41978f(0x129)],_0x3ef3c7);const _0x594be1=collectSegmentRefsFromRule(_0x3ef3c7);for(const _0x1d5cc3 of _0x594be1){!_0x20285c[_0x41978f(0x18b)](_0x1d5cc3)&&_0x12c7b7[_0x41978f(0x125)](_0x1d5cc3);}}_0x411fe0=Array[_0x41978f(0x130)](_0x12c7b7);}};return{'createYamlContext':_0xf38a44,'prefetchJourneySegments':_0x201824};}export async function executePushSegments(_0x33a856,_0x4f4689,_0x15619d,_0x4a33e8,_0x46bcf2){const _0x39d023=a100_0x525e79,{segmentDefToCreateRequest:_0x582056,segmentDefToUpdateRequest:_0x6c6d51}=await import(_0x39d023(0xdc)),_0x1b280b=_0x15619d[_0x39d023(0x175)],_0x3fe5fd=0x5,_0x5520a8=async _0x41a07b=>{const _0x44848c=_0x39d023,_0x2107e8=_0x41a07b[_0x44848c(0x146)]?_0x1b280b[_0x44848c(0x1ae)](_0x41a07b[_0x44848c(0x146)]):undefined;let _0x42d9ca;const _0x22adaf={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x41a07b[_0x44848c(0x185)]){_0x46bcf2[_0x44848c(0x19a)]?.({'type':'segment_creating','name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]});const _0x111782=_0x582056(_0x41a07b['yamlConfig'],_0x2107e8),_0x2eb3a7=await _0x46bcf2[_0x44848c(0xd7)]('Creating\x20segment\x20\x27'+_0x41a07b['yamlConfig']['name']+_0x44848c(0xd6),()=>_0x33a856[_0x44848c(0x157)][_0x44848c(0x193)](_0x4a33e8[_0x44848c(0x120)],_0x111782));_0x42d9ca=_0x2eb3a7[_0x44848c(0x171)]['id'],_0x22adaf[_0x44848c(0x18e)]={'name':_0x41a07b['yamlConfig'][_0x44848c(0x16d)],'id':_0x42d9ca},_0x46bcf2['onProgress']?.({'type':_0x44848c(0xf9),'name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)],'segmentId':_0x42d9ca}),_0x46bcf2['logSuccess']?.(_0x44848c(0x153)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+'\x27'),_0x22adaf['created']=0x1;}else{if(_0x41a07b[_0x44848c(0x15d)]){_0x46bcf2[_0x44848c(0x19a)]?.({'type':_0x44848c(0x12b),'name':_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]});const _0x1bb628=_0x6c6d51(_0x41a07b[_0x44848c(0x17c)]);_0x2107e8!==_0x41a07b['existingSegment']?.[_0x44848c(0xd2)]&&(_0x1bb628[_0x44848c(0xd2)]=_0x2107e8?parseInt(_0x2107e8,0xa):undefined),await _0x46bcf2[_0x44848c(0xd7)]('Updating\x20segment\x20\x27'+_0x41a07b['yamlConfig'][_0x44848c(0x16d)]+_0x44848c(0xd6),()=>_0x33a856[_0x44848c(0x157)][_0x44848c(0xf7)](_0x4a33e8[_0x44848c(0x120)],_0x41a07b[_0x44848c(0x154)]['id'],_0x1bb628)),_0x42d9ca=_0x41a07b[_0x44848c(0x154)]['id'],_0x46bcf2[_0x44848c(0x19a)]?.({'type':_0x44848c(0x195),'name':_0x41a07b['yamlConfig']['name']}),_0x46bcf2[_0x44848c(0x11f)]?.(_0x44848c(0x14b)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+'\x27'),_0x22adaf[_0x44848c(0x18d)]=0x1;}else _0x42d9ca=_0x41a07b[_0x44848c(0x154)]['id'];}}catch(_0x49f2ec){const _0x755011=isHttp400Error(_0x49f2ec),_0x4b4767=_0x755011?ErrorCode[_0x44848c(0xf8)]:ErrorCode[_0x44848c(0x163)],_0x38d38=getErrorMessage(_0x49f2ec);throw new SDKError(_0x4b4767,_0x44848c(0x142)+(_0x41a07b[_0x44848c(0x185)]?_0x44848c(0x17a):'update')+'\x20segment\x20from\x20file:\x20'+_0x41a07b[_0x44848c(0xf3)]+_0x44848c(0xf1)+_0x38d38,_0x49f2ec);}try{const _0x13e9f5=await syncActivationsForSegment(_0x33a856,_0x4a33e8[_0x44848c(0x120)],_0x42d9ca,_0x41a07b['yamlConfig'][_0x44848c(0x16d)],_0x41a07b['activationActions'],_0x46bcf2,_0x41a07b['absolutePath']);_0x22adaf[_0x44848c(0x177)]=_0x13e9f5;}catch(_0x30c533){if(_0x30c533 instanceof SDKError)throw _0x30c533;throw new SDKError(ErrorCode[_0x44848c(0xeb)],_0x44848c(0x192)+_0x41a07b[_0x44848c(0x17c)][_0x44848c(0x16d)]+_0x44848c(0x19e)+_0x41a07b[_0x44848c(0xf3)]+'\x0a\x20\x20'+getErrorMessage(_0x30c533),_0x30c533);}return _0x22adaf;},_0x404c5e=await batchAsync(_0x4f4689,_0x5520a8,_0x3fe5fd),_0x14c97f={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x47e7c0 of _0x404c5e){_0x14c97f[_0x39d023(0x100)]+=_0x47e7c0['created'],_0x14c97f[_0x39d023(0x18d)]+=_0x47e7c0[_0x39d023(0x18d)],_0x47e7c0['createdSegmentId']&&_0x14c97f[_0x39d023(0x131)]['set'](_0x47e7c0[_0x39d023(0x18e)][_0x39d023(0x16d)],_0x47e7c0[_0x39d023(0x18e)]['id']),_0x14c97f[_0x39d023(0x177)][_0x39d023(0x100)]+=_0x47e7c0[_0x39d023(0x177)][_0x39d023(0x100)],_0x14c97f[_0x39d023(0x177)][_0x39d023(0x18d)]+=_0x47e7c0[_0x39d023(0x177)][_0x39d023(0x18d)],_0x14c97f['activations'][_0x39d023(0x151)]+=_0x47e7c0['activations'][_0x39d023(0x151)];}return _0x14c97f;}async function syncActivationsForSegment(_0x425eb2,_0x25f04f,_0x5c9770,_0x42f779,_0x5b6548,_0x3a9ea5,_0x12a678){const _0x3e2c4b=a100_0x525e79,_0x1f6f3d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4f7b88 of _0x5b6548){try{if(_0x4f7b88[_0x3e2c4b(0x183)]==='create'&&_0x4f7b88['validatedRequest'])_0x3a9ea5['onProgress']?.({'type':'activation_creating','segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5['withProgress'](_0x3e2c4b(0x141)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2[_0x3e2c4b(0x157)][_0x3e2c4b(0x110)](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x122)])),_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x1a3),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),_0x3a9ea5[_0x3e2c4b(0x11f)]?.(_0x3e2c4b(0x16a)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x100)]++;else{if(_0x4f7b88[_0x3e2c4b(0x183)]==='update'&&_0x4f7b88[_0x3e2c4b(0x122)]&&_0x4f7b88[_0x3e2c4b(0x180)])_0x3a9ea5[_0x3e2c4b(0x19a)]?.({'type':_0x3e2c4b(0x11c),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5[_0x3e2c4b(0xd7)]('Updating\x20activation\x20\x27'+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2[_0x3e2c4b(0x157)]['updateActivation'](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x180)]['id'],_0x4f7b88[_0x3e2c4b(0x122)])),_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x196),'segmentName':_0x42f779,'activationName':_0x4f7b88['name']}),_0x3a9ea5[_0x3e2c4b(0x11f)]?.(_0x3e2c4b(0x17e)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x18d)]++;else _0x4f7b88['type']===_0x3e2c4b(0x19b)&&_0x4f7b88[_0x3e2c4b(0x180)]&&(_0x3a9ea5['onProgress']?.({'type':_0x3e2c4b(0x1a1),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),await _0x3a9ea5[_0x3e2c4b(0xd7)](_0x3e2c4b(0x106)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27...',()=>_0x425eb2['segment']['deleteActivation'](_0x25f04f,_0x5c9770,_0x4f7b88[_0x3e2c4b(0x180)]['id'])),_0x3a9ea5[_0x3e2c4b(0x19a)]?.({'type':_0x3e2c4b(0xd5),'segmentName':_0x42f779,'activationName':_0x4f7b88[_0x3e2c4b(0x16d)]}),_0x3a9ea5['logDeleted']?.(_0x3e2c4b(0x143)+_0x4f7b88[_0x3e2c4b(0x16d)]+'\x27'),_0x1f6f3d[_0x3e2c4b(0x151)]++);}}catch(_0xd366f8){const _0x228ca2=isHttp400Error(_0xd366f8),_0x1f664=_0x228ca2?ErrorCode[_0x3e2c4b(0x155)]:ErrorCode[_0x3e2c4b(0xeb)],_0x5ca2c3=getErrorMessage(_0xd366f8);throw new SDKError(_0x1f664,_0x3e2c4b(0x142)+_0x4f7b88[_0x3e2c4b(0x183)]+_0x3e2c4b(0x144)+_0x4f7b88['name']+_0x3e2c4b(0x19e)+_0x12a678+_0x3e2c4b(0xf1)+_0x5ca2c3,_0xd366f8);}}return _0x1f6f3d;}export async function executePushFolders(_0x41c210,_0x5166f4,_0x29cf6,_0x565200,_0x1e000f){const _0x11e0bd=a100_0x525e79,_0x3e1cb7=new Map(_0x29cf6);for(const _0x524721 of _0x5166f4){const _0x3e2d13=_0x524721[_0x11e0bd(0x1a9)]('/'),_0x1688f8=_0x3e2d13[_0x3e2d13[_0x11e0bd(0x104)]-0x1],_0xeb1aa1=_0x3e2d13['slice'](0x0,-0x1)['join']('/'),_0x2a8e94=_0x3e1cb7['get'](_0xeb1aa1);_0x1e000f[_0x11e0bd(0x19a)]?.({'type':_0x11e0bd(0x152),'folder':_0x524721});const _0x14cd1b={'name':_0x1688f8,'parentFolderId':_0x2a8e94},_0xd23d06=await _0x1e000f['withProgress']('Creating\x20folder\x20\x27'+_0x524721+_0x11e0bd(0xd6),()=>_0x41c210[_0x11e0bd(0x157)][_0x11e0bd(0x136)](_0x565200['parentId'],_0x14cd1b));_0x3e1cb7[_0x11e0bd(0x189)](_0x524721,_0xd23d06[_0x11e0bd(0x171)]['id']),_0x1e000f[_0x11e0bd(0x19a)]?.({'type':_0x11e0bd(0xf2),'folder':_0x524721,'folderId':_0xd23d06[_0x11e0bd(0x171)]['id']}),_0x1e000f[_0x11e0bd(0x19d)]?.(_0x11e0bd(0x1ab)+_0x524721+'\x27');}return _0x3e1cb7;}export async function executePushSegmentDeletions(_0x4a8e2b,_0x75a350,_0xcd8135){const _0x1aadf6=a100_0x525e79;if(_0x75a350[_0x1aadf6(0x104)]===0x0)return 0x0;const {batchAsync:_0x4bac86}=await import(_0x1aadf6(0x102)),_0x2d1220=0x5,_0x4ccc2a=await _0x4bac86(_0x75a350,async _0x5f30de=>{const _0x2c6f95=_0x1aadf6;return _0xcd8135['onProgress']?.({'type':_0x2c6f95(0x15f),'name':_0x5f30de['name']}),await _0x4a8e2b[_0x2c6f95(0x157)][_0x2c6f95(0xf5)](_0x5f30de['id']),_0xcd8135[_0x2c6f95(0x19a)]?.({'type':_0x2c6f95(0x116),'name':_0x5f30de[_0x2c6f95(0x16d)]}),_0xcd8135['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x5f30de['name']+'\x27'),0x1;},_0x2d1220);return _0x4ccc2a[_0x1aadf6(0xe9)]((_0x468268,_0x2533bb)=>_0x468268+_0x2533bb,0x0);}export async function executePushJourneys(_0x261a14,_0x354e3f,_0x589f09,_0x1faede,_0x173b93){const _0x29455d=a100_0x525e79,{journeyDefToRequest:_0x363fd7}=await import(_0x29455d(0x113)),{activationDefToCreateRequest:_0x240a49,yamlRuleToApi:_0x37de6c,validateSegmentRule:_0x3537b9}=await import(_0x29455d(0xdc)),_0x301a05={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x232db8=new Map(_0x589f09[_0x29455d(0x150)]),_0x456248=0x5;for(let _0x1d52ff=0x0;_0x1d52ff<_0x354e3f['length'];_0x1d52ff+=_0x456248){const _0x5912f5=_0x354e3f[_0x29455d(0xdd)](_0x1d52ff,_0x1d52ff+_0x456248),_0x35afd1=await Promise[_0x29455d(0x10c)](_0x5912f5['map'](async _0x2adb3c=>{const _0xc0b6c3=_0x29455d;if(!_0x2adb3c[_0xc0b6c3(0x185)]&&!_0x2adb3c['hasChanges'])return{'action':_0xc0b6c3(0xe0),'name':_0x2adb3c[_0xc0b6c3(0x17c)][_0xc0b6c3(0x16d)],'journeyId':_0x2adb3c['existingJourney']?.['id']};const _0x3c3f5b=_0x2adb3c[_0xc0b6c3(0x146)]?_0x589f09[_0xc0b6c3(0x175)][_0xc0b6c3(0x1ae)](_0x2adb3c[_0xc0b6c3(0x146)]):undefined;_0x173b93['onProgress']?.({'type':_0x2adb3c[_0xc0b6c3(0x185)]?_0xc0b6c3(0x10f):'journey_updating','name':_0x2adb3c['yamlConfig'][_0xc0b6c3(0x16d)]});try{const _0x380ed4=await executeSingleJourneyPush(_0x261a14,_0x2adb3c,{..._0x589f09,'segmentNameToId':_0x232db8},{'parentId':_0x1faede[_0xc0b6c3(0x120)],'rootFolderId':_0x1faede[_0xc0b6c3(0x162)],'folderId':_0x3c3f5b,'verbose':_0x1faede[_0xc0b6c3(0x118)]},_0x173b93,{'journeyDefToRequest':_0x363fd7,'activationDefToCreateRequest':_0x240a49,'yamlRuleToApi':_0x37de6c,'validateSegmentRule':_0x3537b9});for(const [_0x51892a,_0x2a2644]of _0x380ed4[_0xc0b6c3(0x18a)]){_0x232db8[_0xc0b6c3(0x189)](_0x51892a,_0x2a2644),_0x301a05[_0xc0b6c3(0x18a)][_0xc0b6c3(0x189)](_0x51892a,_0x2a2644);}if(_0x380ed4[_0xc0b6c3(0xfb)]===_0xc0b6c3(0x100))_0x173b93[_0xc0b6c3(0x19a)]?.({'type':_0xc0b6c3(0xd3),'name':_0x2adb3c[_0xc0b6c3(0x17c)]['name'],'journeyId':_0x380ed4[_0xc0b6c3(0xe1)]}),_0x173b93[_0xc0b6c3(0x11f)]?.('Created\x20journey\x20\x27'+_0x2adb3c[_0xc0b6c3(0x17c)]['name']+'\x27'),_0x301a05[_0xc0b6c3(0x100)]++;else _0x380ed4[_0xc0b6c3(0xfb)]===_0xc0b6c3(0x18d)&&(_0x173b93[_0xc0b6c3(0x19a)]?.({'type':'journey_updated','name':_0x2adb3c[_0xc0b6c3(0x17c)]['name']}),_0x173b93[_0xc0b6c3(0x11f)]?.(_0xc0b6c3(0x179)+_0x2adb3c[_0xc0b6c3(0x17c)][_0xc0b6c3(0x16d)]+'\x27'),_0x301a05[_0xc0b6c3(0x18d)]++);return{'action':_0x380ed4[_0xc0b6c3(0xfb)],'name':_0x2adb3c[_0xc0b6c3(0x17c)]['name'],'journeyId':_0x380ed4[_0xc0b6c3(0xe1)]};}catch(_0x427744){const _0x2b1492=isHttp400Error(_0x427744),_0x36ea7f=_0x2b1492?ErrorCode[_0xc0b6c3(0x17d)]:ErrorCode[_0xc0b6c3(0x181)],_0x4c884b=getErrorMessage(_0x427744);throw new SDKError(_0x36ea7f,_0xc0b6c3(0x142)+(_0x2adb3c[_0xc0b6c3(0x185)]?_0xc0b6c3(0x17a):_0xc0b6c3(0x168))+'\x20journey\x20from\x20file:\x20'+_0x2adb3c['absolutePath']+'\x0a\x20\x20'+_0x4c884b,_0x427744);}}));_0x301a05['results']['push'](..._0x35afd1);}return _0x301a05;}async function executeSingleJourneyPush(_0x5a54ca,_0x5de177,_0x478e01,_0x26cc52,_0x3e9efb,_0x514bb5){const _0x333814=a100_0x525e79,{journeyDefToRequest:_0x197285,activationDefToCreateRequest:_0x26908c,yamlRuleToApi:_0x3de5bc,validateSegmentRule:_0x341873}=_0x514bb5,_0xb3e0e3=new Map(),_0x13ef7a=new Map(),_0x50db20=new Map(),_0x5c6300=new Map(),_0x564f4b=new Map();let _0x30e351;const _0x222af5=async()=>{const _0x1be8d3=a100_0x5482;if(_0x30e351)return;_0x30e351=new Map();if(!_0x5de177[_0x1be8d3(0x1aa)])return;const _0x43afc9=await _0x5a54ca[_0x1be8d3(0x13a)][_0x1be8d3(0xe6)](_0x5de177['existingJourney']['id']);for(const _0x78b496 of _0x43afc9){const _0x417848=journeyActivationStepToYaml(_0x78b496,_0x478e01[_0x1be8d3(0x112)],_0x478e01['connectionIdToNameMap']),_0x4dcc7a=activationSignature(_0x417848);!_0x30e351[_0x1be8d3(0x18b)](_0x4dcc7a)&&_0x30e351['set'](_0x4dcc7a,_0x78b496['id']),_0x417848[_0x1be8d3(0x16d)]&&_0x13ef7a[_0x1be8d3(0x189)](_0x417848[_0x1be8d3(0x16d)],_0x78b496['id']);}};if(_0x5de177['existingJourney']&&_0x5de177[_0x333814(0x17c)][_0x333814(0x115)]){const _0x50bf35=buildLocalExpandedRuleMappings(_0x5de177[_0x333814(0x17c)]),_0x57cafc=_0x50bf35[_0x333814(0x197)];if(_0x57cafc[_0x333814(0x15b)]>0x0){const _0x5bbae0=new Map();for(const [_0x27c57d,_0x38a7ab]of _0x57cafc){const _0x5e4d0d=serializeExpandedRule(_0x38a7ab,_0x57cafc);_0x5bbae0[_0x333814(0x189)](_0x27c57d,_0x5e4d0d);}const _0x25b252=collectSegmentIdsFromJourneyApi(_0x5de177[_0x333814(0x1aa)]);if(_0x25b252[_0x333814(0x15b)]>0x0){const _0x1c6317=await buildServerSegmentRuleMap(_0x5a54ca,_0x26cc52[_0x333814(0x120)],_0x478e01[_0x333814(0x1a8)],_0x25b252);if(_0x1c6317[_0x333814(0x15b)]>0x0){const _0x5b5604=new Map();for(const [_0x415ed0,_0x4a4eee]of _0x1c6317){const _0x420bf9=serializeExpandedRule(_0x4a4eee,_0x1c6317);!_0x5b5604[_0x333814(0x18b)](_0x420bf9)&&_0x5b5604[_0x333814(0x189)](_0x420bf9,_0x415ed0);}for(const [_0x25dcb1,_0x28e14c]of _0x5bbae0){const _0x24188e=_0x5b5604[_0x333814(0x1ae)](_0x28e14c);_0x24188e&&(_0x564f4b[_0x333814(0x189)](_0x25dcb1,_0x24188e),_0x478e01[_0x333814(0x150)][_0x333814(0x189)](_0x25dcb1,_0x24188e));}}}}}const _0x2ebb38={'resolveSegmentId':async _0x5bfd24=>{const _0x27ade3=_0x333814,_0x2a4d4c=_0x478e01[_0x27ade3(0x150)][_0x27ade3(0x1ae)](_0x5bfd24);if(!_0x2a4d4c)throw new SDKError(ErrorCode[_0x27ade3(0x11a)],_0x27ade3(0x170)+_0x5bfd24+'\x20(referenced\x20in\x20journey\x20'+_0x5de177[_0x27ade3(0x17c)]['name']+')');return _0x2a4d4c;},'resolveEmbeddedSegmentId':async(_0x29e9db,_0x509f48)=>{const _0x399fe9=_0x333814,_0x3be3b8=_0x478e01[_0x399fe9(0x150)]['get'](_0x29e9db);if(_0x3be3b8)return _0x3be3b8;const _0x2dbc44=_0x564f4b[_0x399fe9(0x1ae)](_0x29e9db);if(_0x2dbc44)return _0x478e01[_0x399fe9(0x150)]['set'](_0x29e9db,_0x2dbc44),_0x2dbc44;const _0x4c6b5c=_0x478e01[_0x399fe9(0x1a8)][_0x399fe9(0x14d)](_0x3b8f55=>_0x3b8f55[_0x399fe9(0x16d)]===_0x29e9db);if(_0x4c6b5c)return _0x478e01[_0x399fe9(0x150)][_0x399fe9(0x189)](_0x29e9db,_0x4c6b5c['id']),_0x4c6b5c['id'];if(_0x5de177[_0x399fe9(0x185)]){const {stageName:_0x341367,criteriaName:_0x1690ef}=findSegmentCriteriaLocation(_0x5de177[_0x399fe9(0x17c)],_0x29e9db);return _0x341873(_0x29e9db,_0x509f48[_0x399fe9(0x1a6)]),_0x50db20[_0x399fe9(0x189)](_0x29e9db,{'definition':_0x509f48,'stageName':_0x341367,'criteriaName':_0x1690ef}),createPendingSegmentId(_0x29e9db);}const _0x1bd2d2=_0x5de177[_0x399fe9(0x1aa)]?.['id'];if(!_0x1bd2d2)throw new SDKError(ErrorCode['INTERNAL'],_0x399fe9(0x13d));_0x341873(_0x29e9db,_0x509f48[_0x399fe9(0x1a6)]);const _0xca50d1=generateDeterministicJourneySegmentName(_0x5de177[_0x399fe9(0x17c)][_0x399fe9(0x16d)],_0x29e9db),_0x413741=_0x478e01['existingSegments'][_0x399fe9(0x14d)](_0x3e539a=>_0x3e539a['name']===_0xca50d1),_0x53bd81=createSegmentIdResolver(_0x478e01['segmentNameToId'],_0x29e9db),_0x1d4564=await resolveRuleSegmentIds(_0x509f48[_0x399fe9(0x1a6)],_0x53bd81);let _0x112a05;if(_0x413741)await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xf7)](_0x26cc52[_0x399fe9(0x120)],_0x413741['id'],{'description':_0x509f48[_0x399fe9(0x124)]||'Entry\x20criteria:\x20'+_0x29e9db,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![]}),_0x112a05=_0x413741['id'];else try{_0x112a05=await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xe2)]({'name':_0xca50d1,'description':_0x509f48[_0x399fe9(0x124)]||_0x399fe9(0x1a2)+_0x29e9db,'journeyId':_0x1bd2d2,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![],'parentFolderId':_0x26cc52[_0x399fe9(0x162)]||'','audienceId':_0x26cc52[_0x399fe9(0x120)]});}catch(_0x1b21d4){const _0x2fc96b=_0x1b21d4 instanceof Error&&_0x1b21d4['message'][_0x399fe9(0x160)](_0x399fe9(0xea));if(_0x2fc96b){const _0xaf6ef9=await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0x10d)](_0x26cc52[_0x399fe9(0x120)]),_0x3541ac=_0xaf6ef9[_0x399fe9(0x14d)](_0x363f98=>_0x363f98[_0x399fe9(0x16d)]===_0xca50d1);if(_0x3541ac)await _0x5a54ca[_0x399fe9(0x157)][_0x399fe9(0xf7)](_0x26cc52['parentId'],_0x3541ac['id'],{'description':_0x509f48[_0x399fe9(0x124)]||_0x399fe9(0x1a2)+_0x29e9db,'rule':_0x3de5bc(_0x1d4564,!![]),'countPopulation':!![]}),_0x112a05=_0x3541ac['id'];else throw _0x1b21d4;}else throw _0x1b21d4;}return _0x478e01[_0x399fe9(0x150)]['set'](_0x29e9db,_0x112a05),_0xb3e0e3[_0x399fe9(0x189)](_0x29e9db,_0x112a05),_0x112a05;},'resolveActivationId':async _0x4e588c=>{const _0x3d3406=_0x333814,_0x2c5bce=_0x13ef7a[_0x3d3406(0x1ae)](_0x4e588c);if(_0x2c5bce)return _0x2c5bce;if(_0x5de177[_0x3d3406(0x1aa)]){await _0x222af5();const _0x45426f=_0x13ef7a[_0x3d3406(0x1ae)](_0x4e588c);if(_0x45426f)return _0x45426f;}throw new SDKError(ErrorCode[_0x3d3406(0x1ad)],_0x3d3406(0x19c)+_0x4e588c+_0x3d3406(0x14a)+_0x5de177[_0x3d3406(0x17c)][_0x3d3406(0x16d)]+').\x20'+_0x3d3406(0x187));},'resolveEmbeddedActivationId':async(_0x944b24,_0x1c274e)=>{const _0x47f86d=_0x333814,_0x5e0c5d=_0x13ef7a[_0x47f86d(0x1ae)](_0x944b24);if(_0x5e0c5d)return _0x5e0c5d;if(_0x5de177[_0x47f86d(0x185)])return _0x5c6300['set'](_0x944b24,_0x1c274e),createPendingActivationId(_0x944b24);if(_0x5de177['existingJourney']){await _0x222af5();const _0x5f4c70=_0x13ef7a[_0x47f86d(0x1ae)](_0x1c274e[_0x47f86d(0x16d)]);if(_0x5f4c70)return _0x13ef7a[_0x47f86d(0x189)](_0x944b24,_0x5f4c70),_0x5f4c70;const _0x4dcbab=activationSignature(_0x1c274e),_0x8fbc=_0x30e351?.[_0x47f86d(0x1ae)](_0x4dcbab);if(_0x8fbc)return _0x13ef7a['set'](_0x944b24,_0x8fbc),_0x8fbc;const _0x2b455e=await _0x26908c(_0x1c274e,_0x478e01[_0x47f86d(0x1a5)]),_0x4feeee=await _0x5a54ca[_0x47f86d(0x13a)][_0x47f86d(0x110)](_0x5de177['existingJourney']['id'],_0x2b455e);return _0x13ef7a[_0x47f86d(0x189)](_0x944b24,_0x4feeee['id']),_0x4feeee['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x47f86d(0xff));},'resolveJourneyId':async _0x26d048=>{const _0x539416=_0x333814;try{return await _0x5a54ca[_0x539416(0x13a)]['resolveJourneyId'](_0x26cc52[_0x539416(0x120)],_0x26d048);}catch(_0x24bfa4){throw new SDKError(ErrorCode[_0x539416(0x1ad)],'Journey\x20\x27'+_0x26d048+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x5de177[_0x539416(0x17c)][_0x539416(0x16d)]+'\x27)',_0x24bfa4);}},'resolveStageId':async(_0x31711d,_0x1255ea)=>{const _0x509040=_0x333814,_0x588e0b=await _0x5a54ca['journey'][_0x509040(0x135)](_0x31711d),_0x1806f8=_0x588e0b['attributes']['journeyStages']['find'](_0x137f31=>_0x137f31[_0x509040(0x16d)]['toLowerCase']()===_0x1255ea[_0x509040(0x127)]());if(!_0x1806f8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x509040(0x10b)+_0x1255ea+_0x509040(0x165)+(_0x588e0b['attributes'][_0x509040(0x1a7)]||_0x588e0b[_0x509040(0x188)][_0x509040(0x16d)])+'\x27');return _0x1806f8['id'];}},_0x732590=await _0x197285(_0x5de177[_0x333814(0x17c)],_0x26cc52[_0x333814(0x120)],_0x2ebb38),_0x3cdb36=_0x26cc52[_0x333814(0x12d)]||_0x26cc52['rootFolderId'];_0x3cdb36&&(_0x732590[_0x333814(0x12c)]={'parentFolder':{'data':{'id':_0x3cdb36,'type':_0x333814(0x176)}}});if(_0x5de177[_0x333814(0x185)]){if(_0x50db20[_0x333814(0x15b)]>0x0||_0x5c6300['size']>0x0)return await executeThreeStepJourneyCreate(_0x5a54ca,_0x5de177,_0x732590,{'pendingEmbeddedSegments':_0x50db20,'pendingEmbeddedActivations':_0x5c6300,'embeddedSegmentNameToId':_0xb3e0e3,'journeyActivationNameToId':_0x13ef7a},{..._0x26cc52,'effectiveFolderId':_0x3cdb36},_0x478e01,_0x3e9efb,_0x514bb5);else{ensureJourneyDefaults(_0x732590['attributes']);const _0x4c231a=await _0x5a54ca['journey'][_0x333814(0x17a)](_0x732590);return{'action':_0x333814(0x100),'journeyId':_0x4c231a['id'],'embeddedSegmentNameToId':_0xb3e0e3};}}else{if(_0x5de177[_0x333814(0x15d)]&&_0x5de177['existingJourney'])return ensureJourneyDefaults(_0x732590[_0x333814(0x188)]),await _0x5a54ca[_0x333814(0x13a)][_0x333814(0x168)](_0x5de177[_0x333814(0x1aa)]['id'],_0x732590),{'action':_0x333814(0x18d),'journeyId':_0x5de177[_0x333814(0x1aa)]['id'],'embeddedSegmentNameToId':_0xb3e0e3};}return{'action':_0x333814(0xe0),'journeyId':_0x5de177[_0x333814(0x1aa)]?.['id'],'embeddedSegmentNameToId':_0xb3e0e3};}function findSegmentCriteriaLocation(_0x2db317,_0x101330){const _0x1e9a0e=a100_0x525e79,_0x48cae7=_0x2db317[_0x1e9a0e(0x108)]||_0x2db317[_0x1e9a0e(0x10e)]?.[0x0]?.[_0x1e9a0e(0x108)]||[];let _0x41842f='entry',_0x2570f7=_0x101330;const _0x510cb1=_0x2db317[_0x1e9a0e(0x137)]||_0x2db317[_0x1e9a0e(0x10e)]?.[0x0]?.['goal'];if(_0x510cb1?.[_0x1e9a0e(0x157)]===_0x101330)return{'stageName':_0x1e9a0e(0x137),'criteriaName':_0x510cb1[_0x1e9a0e(0x16d)]||_0x101330};_0x598dad:for(const _0x323739 of _0x48cae7){if(_0x323739[_0x1e9a0e(0x107)]?.[_0x1e9a0e(0x157)]===_0x101330){_0x41842f=_0x323739['name'],_0x2570f7=_0x323739[_0x1e9a0e(0x107)][_0x1e9a0e(0x16d)]||_0x101330;break;}if(_0x323739[_0x1e9a0e(0x145)])for(const _0xb45c2d of _0x323739[_0x1e9a0e(0x145)]){if(_0xb45c2d[_0x1e9a0e(0x183)]===_0x1e9a0e(0x15e)&&_0xb45c2d[_0x1e9a0e(0xd4)]?.['branches'])for(const _0x11d510 of _0xb45c2d[_0x1e9a0e(0xd4)][_0x1e9a0e(0x16e)]){if(_0x11d510[_0x1e9a0e(0x157)]===_0x101330){_0x41842f=_0x323739[_0x1e9a0e(0x16d)],_0x2570f7=_0x11d510[_0x1e9a0e(0x16d)]||_0x101330;break _0x598dad;}}}}return{'stageName':_0x41842f,'criteriaName':_0x2570f7};}async function executeThreeStepJourneyCreate(_0x59a3d2,_0x3d8161,_0x420794,_0x5ba96a,_0x2a1e72,_0x5c327b,_0x52c9bf,_0x31d19){const _0x11e3fa=a100_0x525e79,{activationDefToCreateRequest:_0x5961a6,yamlRuleToApi:_0x3cdce0}=_0x31d19,{pendingEmbeddedSegments:_0x57d281,pendingEmbeddedActivations:_0x437ee1,embeddedSegmentNameToId:_0x5b8d6b}=_0x5ba96a,_0x34cc2d=JSON[_0x11e3fa(0xed)](JSON['stringify'](_0x420794));ensureJourneyDefaults(_0x34cc2d[_0x11e3fa(0x188)]),stripPendingIds(_0x34cc2d);const _0x52fb6a=await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x17a)](_0x34cc2d),_0x92734b=_0x52fb6a['id'],_0xcc5d62=new Map();for(const _0x343cc6 of _0x52fb6a[_0x11e3fa(0x188)][_0x11e3fa(0x123)]){_0xcc5d62[_0x11e3fa(0x189)](_0x343cc6[_0x11e3fa(0x16d)]['toLowerCase'](),_0x343cc6['id']);}for(const [_0x576a65,{definition:_0x2b4fa3}]of _0x57d281){const _0x331947=generateDeterministicJourneySegmentName(_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],_0x576a65);_0x52c9bf['onProgress']?.({'type':_0x11e3fa(0x174),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'segmentName':_0x576a65});const _0x2aeaf8=createSegmentIdResolver(_0x5c327b[_0x11e3fa(0x150)],_0x576a65),_0xdbebcc=await resolveRuleSegmentIds(_0x2b4fa3[_0x11e3fa(0x1a6)],_0x2aeaf8),_0x59be01=await _0x59a3d2[_0x11e3fa(0x157)][_0x11e3fa(0xe2)]({'name':_0x331947,'description':_0x2b4fa3[_0x11e3fa(0x124)]||_0x11e3fa(0x1a2)+_0x576a65,'journeyId':_0x92734b,'rule':_0x3cdce0(_0xdbebcc,!![]),'countPopulation':!![],'parentFolderId':_0x2a1e72['effectiveFolderId']||'','audienceId':_0x2a1e72[_0x11e3fa(0x120)]});_0x5b8d6b[_0x11e3fa(0x189)](_0x576a65,_0x59be01),_0x5c327b[_0x11e3fa(0x150)][_0x11e3fa(0x189)](_0x576a65,_0x59be01),_0x52c9bf[_0x11e3fa(0x19a)]?.({'type':_0x11e3fa(0x172),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'segmentName':_0x576a65});}const _0x362ad5=new Map();for(const [_0x3cfb33,_0x479d64]of _0x437ee1){_0x52c9bf[_0x11e3fa(0x19a)]?.({'type':_0x11e3fa(0x161),'journeyName':_0x3d8161['yamlConfig'][_0x11e3fa(0x16d)],'activationName':_0x3cfb33});const _0x3e5f58=await _0x5961a6(_0x479d64,_0x5c327b['activationContext']),_0x43c4c0=await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x110)](_0x92734b,_0x3e5f58);_0x362ad5['set'](_0x3cfb33,_0x43c4c0['id']),_0x5ba96a['journeyActivationNameToId'][_0x11e3fa(0x189)](_0x3cfb33,_0x43c4c0['id']),_0x52c9bf['onProgress']?.({'type':_0x11e3fa(0x178),'journeyName':_0x3d8161[_0x11e3fa(0x17c)][_0x11e3fa(0x16d)],'activationName':_0x3cfb33});}const _0x123f31=JSON[_0x11e3fa(0xed)](JSON[_0x11e3fa(0x11e)](_0x420794));return _0x123f31['id']=_0x92734b,ensureJourneyDefaults(_0x123f31[_0x11e3fa(0x188)]),resolvePendingIdsInRequest(_0x123f31,_0x420794,_0xcc5d62,_0x5b8d6b,_0x362ad5,_0x52c9bf),await _0x59a3d2[_0x11e3fa(0x13a)][_0x11e3fa(0x168)](_0x92734b,_0x123f31),{'action':_0x11e3fa(0x100),'journeyId':_0x92734b,'embeddedSegmentNameToId':_0x5b8d6b};}function stripPendingIds(_0x3fcf7c){const _0x574771=a100_0x525e79;for(const _0x54deed of _0x3fcf7c[_0x574771(0x188)][_0x574771(0x123)]||[]){_0x54deed[_0x574771(0xfa)]?.[_0x574771(0x129)]&&isPendingSegmentId(_0x54deed[_0x574771(0xfa)]['segmentId'])&&delete _0x54deed[_0x574771(0xfa)];if(_0x54deed['steps'])for(const _0xed99c of Object[_0x574771(0x12e)](_0x54deed[_0x574771(0x145)])){const _0x3fd71d=_0x54deed[_0x574771(0x145)][_0xed99c];_0x3fd71d['type']==='Activation'&&_0x3fd71d[_0x574771(0x19f)]&&isPendingActivationId(_0x3fd71d['journeyActivationStepId'])&&(_0x3fd71d[_0x574771(0x19f)]='');if(_0x3fd71d[_0x574771(0x183)]===_0x574771(0x148)&&_0x3fd71d[_0x574771(0x16e)])for(const _0x2c68fc of _0x3fd71d[_0x574771(0x16e)]){_0x2c68fc[_0x574771(0x129)]&&isPendingSegmentId(_0x2c68fc[_0x574771(0x129)])&&(_0x2c68fc['segmentId']='');}_0x3fd71d['type']===_0x574771(0x147)&&_0x3fd71d[_0x574771(0x167)]?.[_0x574771(0x129)]&&isPendingSegmentId(_0x3fd71d[_0x574771(0x167)][_0x574771(0x129)])&&(_0x3fd71d[_0x574771(0x167)][_0x574771(0x129)]='');}}}function resolvePendingIdsInRequest(_0x2c80e3,_0x49067a,_0x13ec4a,_0x1f013c,_0x2de1ec,_0x465285){const _0x207ddf=a100_0x525e79,_0x444d5b=(_0x456ab0,_0x417e69)=>{const _0x481913=a100_0x5482;if(!isPendingSegmentId(_0x456ab0))return _0x456ab0;const _0x5018f9=extractPendingSegmentName(_0x456ab0),_0xe85ae2=_0x1f013c[_0x481913(0x1ae)](_0x5018f9);return!_0xe85ae2&&_0x465285['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x5018f9+'\x27\x20for\x20'+_0x417e69),_0xe85ae2;};if(_0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x137)]?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x137)][_0x207ddf(0x129)])){const _0x389c0d=_0x444d5b(_0x2c80e3['attributes'][_0x207ddf(0x137)][_0x207ddf(0x129)],_0x207ddf(0x15c));_0x389c0d&&(_0x2c80e3['attributes']['goal'][_0x207ddf(0x129)]=_0x389c0d);}for(const _0xadc552 of _0x2c80e3[_0x207ddf(0x188)][_0x207ddf(0x123)]||[]){const _0x2b31c2=_0x13ec4a['get'](_0xadc552[_0x207ddf(0x16d)][_0x207ddf(0x127)]());_0x2b31c2&&(_0xadc552['id']=_0x2b31c2);if(_0xadc552['entryCriteria']?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0xadc552[_0x207ddf(0xfa)]['segmentId'])){const _0x16647e=_0x444d5b(_0xadc552['entryCriteria'][_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+'\x27\x20entry\x20criteria');_0x16647e&&(_0xadc552[_0x207ddf(0xfa)]['segmentId']=_0x16647e);}if(_0xadc552['exitCriterias'])for(const _0xbe1c07 of _0xadc552[_0x207ddf(0x16c)]){if(_0xbe1c07[_0x207ddf(0x129)]&&isPendingSegmentId(_0xbe1c07[_0x207ddf(0x129)])){const _0x2f9c1c=_0x444d5b(_0xbe1c07['segmentId'],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x17b));_0x2f9c1c&&(_0xbe1c07[_0x207ddf(0x129)]=_0x2f9c1c);}}if(_0xadc552[_0x207ddf(0x18c)]?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0xadc552[_0x207ddf(0x18c)][_0x207ddf(0x129)])){const _0x242561=_0x444d5b(_0xadc552['milestone'][_0x207ddf(0x129)],'stage\x20\x27'+_0xadc552[_0x207ddf(0x16d)]+'\x27\x20milestone');_0x242561&&(_0xadc552[_0x207ddf(0x18c)][_0x207ddf(0x129)]=_0x242561);}if(_0xadc552[_0x207ddf(0x145)]){const _0x1954cd=_0x24f5ff=>_0x49067a[_0x207ddf(0x188)][_0x207ddf(0x123)][_0x207ddf(0x14d)](_0x4e6d76=>_0x4e6d76[_0x207ddf(0x16d)][_0x207ddf(0x127)]()===_0xadc552[_0x207ddf(0x16d)][_0x207ddf(0x127)]())?.[_0x207ddf(0x145)]?.[_0x24f5ff];for(const _0x2941d1 of Object[_0x207ddf(0x12e)](_0xadc552['steps'])){const _0x938b15=_0xadc552[_0x207ddf(0x145)][_0x2941d1],_0x188965=_0x1954cd(_0x2941d1);if(_0x938b15['type']===_0x207ddf(0x1ac)&&_0x938b15['journeyActivationStepId']&&(isPendingActivationId(_0x938b15['journeyActivationStepId'])||_0x938b15[_0x207ddf(0x19f)]==='')){if(_0x188965?.[_0x207ddf(0x19f)]&&isPendingActivationId(_0x188965[_0x207ddf(0x19f)])){const _0x2d47a9=extractPendingActivationName(_0x188965[_0x207ddf(0x19f)]),_0x34318a=_0x2de1ec[_0x207ddf(0x1ae)](_0x2d47a9);_0x34318a&&(_0x938b15[_0x207ddf(0x19f)]=_0x34318a);}}if(_0x938b15[_0x207ddf(0x183)]===_0x207ddf(0x148)&&_0x938b15['branches']&&_0x188965?.[_0x207ddf(0x16e)])for(let _0x400a2b=0x0;_0x400a2b<_0x938b15[_0x207ddf(0x16e)][_0x207ddf(0x104)];_0x400a2b++){const _0x4415fb=_0x938b15[_0x207ddf(0x16e)][_0x400a2b],_0x2a9ddb=_0x188965[_0x207ddf(0x16e)][_0x400a2b];if(_0x2a9ddb?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x2a9ddb[_0x207ddf(0x129)])){const _0x349071=_0x444d5b(_0x2a9ddb[_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x117)+(_0x4415fb[_0x207ddf(0x16d)]||_0x400a2b)+'\x27');_0x349071&&(_0x4415fb[_0x207ddf(0x129)]=_0x349071);}}if(_0x938b15[_0x207ddf(0x183)]===_0x207ddf(0x147)&&_0x938b15['waitCondition']?.[_0x207ddf(0x129)]&&_0x188965?.['waitCondition']?.[_0x207ddf(0x129)]&&isPendingSegmentId(_0x188965[_0x207ddf(0x167)][_0x207ddf(0x129)])){const _0x191a25=_0x444d5b(_0x188965[_0x207ddf(0x167)][_0x207ddf(0x129)],_0x207ddf(0xd9)+_0xadc552[_0x207ddf(0x16d)]+_0x207ddf(0x13f));_0x191a25&&(_0x938b15[_0x207ddf(0x167)]['segmentId']=_0x191a25);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x17fdfd,_0x55b7eb){const _0x6104a5=a101_0x4a4d,_0x31c32f=_0x17fdfd();while(!![]){try{const _0xa8ce8=parseInt(_0x6104a5(0xa5))/0x1+-parseInt(_0x6104a5(0x99))/0x2*(-parseInt(_0x6104a5(0xa3))/0x3)+parseInt(_0x6104a5(0xa6))/0x4+-parseInt(_0x6104a5(0x9e))/0x5+-parseInt(_0x6104a5(0x9d))/0x6+-parseInt(_0x6104a5(0x9a))/0x7+-parseInt(_0x6104a5(0xa1))/0x8*(-parseInt(_0x6104a5(0xa4))/0x9);if(_0xa8ce8===_0x55b7eb)break;else _0x31c32f['push'](_0x31c32f['shift']());}catch(_0x267a9e){_0x31c32f['push'](_0x31c32f['shift']());}}}(a101_0x307b,0xca6a4));function a101_0x307b(){const _0x2ea3b2=['910556vfuaZR','4865496UnEXlI','parentFolderId','24974jpImgY','4955027unHVww','set','has','7917588ftoZoM','2033850kxrZXO','get','add','3996432fjcUMe','name','153xucXoc','9LviQfZ'];a101_0x307b=function(){return _0x2ea3b2;};return a101_0x307b();}export function buildFolderIdToPathMap(_0x256850){const _0x5c18c9=a101_0x4a4d,_0x4a37c4=new Map(),_0x1033c4=new Map();for(const _0xde9d76 of _0x256850){_0x1033c4[_0x5c18c9(0x9b)](_0xde9d76['id'],_0xde9d76);}const _0x2e66b7=new Set();for(const _0x14d583 of _0x256850){!_0x14d583[_0x5c18c9(0x98)]&&_0x2e66b7[_0x5c18c9(0xa0)](_0x14d583['id']);}function _0x45e08f(_0x18a03f){const _0x2c5655=_0x5c18c9;if(_0x4a37c4['has'](_0x18a03f['id']))return _0x4a37c4['get'](_0x18a03f['id']);if(_0x2e66b7[_0x2c5655(0x9c)](_0x18a03f['id']))return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],''),'';if(_0x18a03f[_0x2c5655(0x98)]){const _0x42c98b=_0x1033c4[_0x2c5655(0x9f)](_0x18a03f['parentFolderId']);if(_0x42c98b){const _0x55b72a=_0x45e08f(_0x42c98b),_0xd075a1=_0x55b72a?_0x55b72a+'/'+_0x18a03f[_0x2c5655(0xa2)]:_0x18a03f[_0x2c5655(0xa2)];return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],_0xd075a1),_0xd075a1;}}const _0x5823f8=_0x18a03f[_0x2c5655(0xa2)];return _0x4a37c4[_0x2c5655(0x9b)](_0x18a03f['id'],_0x5823f8),_0x5823f8;}for(const _0x443830 of _0x256850){_0x45e08f(_0x443830);}return _0x4a37c4;}function a101_0x4a4d(_0xd32013,_0x28bab4){_0xd32013=_0xd32013-0x98;const _0x307bb9=a101_0x307b();let _0x4a4d0e=_0x307bb9[_0xd32013];return _0x4a4d0e;}export function buildFolderPathToIdMap(_0x95f2be){const _0x24afdc=a101_0x4a4d,_0x3c0a51=new Map(),_0x183a0d=new Map();for(const _0x581d0d of _0x95f2be){_0x183a0d['set'](_0x581d0d['id'],_0x581d0d);}const _0x2a3ff8=new Set();for(const _0x80d749 of _0x95f2be){!_0x80d749[_0x24afdc(0x98)]&&_0x2a3ff8[_0x24afdc(0xa0)](_0x80d749['id']);}function _0x5ed6c6(_0xa7cf44){const _0x35c96f=_0x24afdc;if(_0x2a3ff8['has'](_0xa7cf44['id']))return'';if(_0xa7cf44[_0x35c96f(0x98)]){const _0x18f88e=_0x183a0d[_0x35c96f(0x9f)](_0xa7cf44[_0x35c96f(0x98)]);if(_0x18f88e){const _0x3dec75=_0x5ed6c6(_0x18f88e);return _0x3dec75?_0x3dec75+'/'+_0xa7cf44[_0x35c96f(0xa2)]:_0xa7cf44[_0x35c96f(0xa2)];}}return _0xa7cf44[_0x35c96f(0xa2)];}for(const _0x2bd5e3 of _0x95f2be){const _0x30f6b6=_0x5ed6c6(_0x2bd5e3);_0x3c0a51[_0x24afdc(0x9b)](_0x30f6b6,_0x2bd5e3['id']);}return _0x3c0a51;}export function buildFolderMaps(_0x1de4be){const _0x12cacd=a101_0x4a4d,_0x224e45=buildFolderIdToPathMap(_0x1de4be),_0x2b3c67=new Map();for(const [_0x12d4c5,_0x4d6f04]of _0x224e45){_0x2b3c67[_0x12cacd(0x9b)](_0x4d6f04,_0x12d4c5);}return{'idToPath':_0x224e45,'pathToId':_0x2b3c67};}export function getFolderPath(_0x10ec00,_0x453bd1){if(!_0x10ec00)return'';return _0x453bd1['get'](_0x10ec00)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8ea438,_0x415762){const _0x1b35d6=a102_0x16b8,_0x1dcd9c=_0x8ea438();while(!![]){try{const _0x2aef0e=parseInt(_0x1b35d6(0x196))/0x1*(parseInt(_0x1b35d6(0x1ac))/0x2)+-parseInt(_0x1b35d6(0x1b0))/0x3+-parseInt(_0x1b35d6(0x19d))/0x4+-parseInt(_0x1b35d6(0x1a9))/0x5*(parseInt(_0x1b35d6(0x197))/0x6)+parseInt(_0x1b35d6(0x1aa))/0x7*(-parseInt(_0x1b35d6(0x1a7))/0x8)+parseInt(_0x1b35d6(0x1b4))/0x9+parseInt(_0x1b35d6(0x193))/0xa*(parseInt(_0x1b35d6(0x1bf))/0xb);if(_0x2aef0e===_0x415762)break;else _0x1dcd9c['push'](_0x1dcd9c['shift']());}catch(_0x3ccf1d){_0x1dcd9c['push'](_0x1dcd9c['shift']());}}}(a102_0x569f,0x71f8e));import a102_0x2cf6d2 from'path';import{parse as a102_0x33ad7e}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x706630){const _0x49c209=a102_0x16b8;if(!_0x706630||_0x706630[_0x49c209(0x1b1)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x539ff4=_0x706630['trim']();if(_0x539ff4==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x706630};const _0x41bdfe=_0x539ff4['startsWith']('/')?_0x539ff4[_0x49c209(0x194)](0x1):_0x539ff4,_0x4deb63=_0x41bdfe[_0x49c209(0x1b3)]('/')[_0x49c209(0x1b2)](_0x3aacde=>_0x3aacde!=='');if(_0x4deb63[_0x49c209(0x1b7)]===0x0)throw new Error(_0x49c209(0x199));const _0x326f6d=_0x539ff4['startsWith']('/')||!isRelativePathSegment(_0x4deb63[0x0]);for(const _0x4bbf36 of _0x4deb63){validatePathSegment(_0x4bbf36);}return{'segments':_0x4deb63,'isAbsolute':_0x326f6d,'raw':_0x706630};}function isRelativePathSegment(_0x152926){return _0x152926==='.'||_0x152926==='..';}function validatePathSegment(_0x4831e9){const _0xfa6ec2=a102_0x16b8;if(_0x4831e9==='')throw new Error(_0xfa6ec2(0x1ba));if(_0x4831e9==='.'||_0x4831e9==='..')return;if(/[\x00-\x1F\x7F]/[_0xfa6ec2(0x19f)](_0x4831e9))throw new Error(_0xfa6ec2(0x195)+_0x4831e9);if(_0x4831e9!==_0x4831e9[_0xfa6ec2(0x1b1)]()){}}export function validatePath(_0x56d513){const _0x5ecc92=a102_0x16b8;if(_0x56d513[_0x5ecc92(0x1b6)]['length']===0x0&&!_0x56d513['isAbsolute'])throw new Error(_0x5ecc92(0x19c));if(_0x56d513['isAbsolute']){if(_0x56d513['segments'][0x0]==='..')throw new Error(_0x5ecc92(0x1a5));let _0x4474cb=0x0;for(const _0x4af7f8 of _0x56d513[_0x5ecc92(0x1b6)]){if(_0x4af7f8==='..'){if(_0x4474cb===0x0)throw new Error(_0x5ecc92(0x1ab));_0x4474cb--;}else _0x4af7f8!=='.'&&_0x4474cb++;}}}export function joinPaths(_0xc386eb,_0x3787a2){const _0x2f2b27=a102_0x16b8;if(!_0xc386eb||_0xc386eb==='/')return _0x3787a2;if(!_0x3787a2||_0x3787a2==='.')return _0xc386eb;if(_0x3787a2[_0x2f2b27(0x1bb)]('/'))return _0x3787a2;const _0x478b15=parsePath(_0xc386eb),_0x5afc61=parsePath(_0x3787a2),_0x544e12=[..._0x478b15[_0x2f2b27(0x1b6)]];for(const _0x1de7cb of _0x5afc61[_0x2f2b27(0x1b6)]){if(_0x1de7cb==='.')continue;else{if(_0x1de7cb==='..'){if(_0x544e12[_0x2f2b27(0x1b7)]===0x0)throw new Error(_0x2f2b27(0x1ae));_0x544e12[_0x2f2b27(0x1bc)]();}else _0x544e12['push'](_0x1de7cb);}}const _0x45fbfd=_0x544e12[_0x2f2b27(0x1b8)]('/');return _0x478b15[_0x2f2b27(0x1c2)]['startsWith']('/')?'/'+_0x45fbfd:_0x45fbfd;}export function normalizePath(_0x16c4ea){const _0x1aa507=a102_0x16b8,_0x313cd1=parsePath(_0x16c4ea),_0x4c1086=[];for(const _0x53db95 of _0x313cd1[_0x1aa507(0x1b6)]){if(_0x53db95==='.')continue;else{if(_0x53db95==='..'){if(_0x4c1086[_0x1aa507(0x1b7)]===0x0){if(_0x313cd1[_0x1aa507(0x1a6)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x4c1086[_0x1aa507(0x1a1)]('..');}else _0x4c1086[_0x4c1086['length']-0x1]==='..'?_0x4c1086['push']('..'):_0x4c1086['pop']();}else _0x4c1086[_0x1aa507(0x1a1)](_0x53db95);}}if(_0x4c1086[_0x1aa507(0x1b7)]===0x0)return _0x313cd1[_0x1aa507(0x1a6)]?'/':'.';const _0x48b7a1=_0x4c1086[_0x1aa507(0x1b8)]('/');return _0x313cd1[_0x1aa507(0x1c2)][_0x1aa507(0x1bb)]('/')?'/'+_0x48b7a1:_0x48b7a1;}export function getParentPath(_0x341466){const _0x237808=a102_0x16b8,_0x244808=parsePath(_0x341466);if(_0x244808[_0x237808(0x1b6)][_0x237808(0x1b7)]<=0x1)return'/';const _0x1d2232=_0x244808[_0x237808(0x1b6)][_0x237808(0x1af)](0x0,-0x1)['join']('/');return _0x244808[_0x237808(0x1c2)][_0x237808(0x1bb)]('/')?'/'+_0x1d2232:_0x1d2232;}export function getBaseName(_0x2e9740){const _0x240a7a=a102_0x16b8,_0x23c7bb=parsePath(_0x2e9740);return _0x23c7bb[_0x240a7a(0x1b6)][_0x23c7bb['segments'][_0x240a7a(0x1b7)]-0x1]||'';}function a102_0x569f(){const _0x38ac78=['endsWith','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','raw','.yml','20auHvOl','substring','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','603854ZpqgiS','36XZLEGh','segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','resolve','relative','Relative\x20path\x20cannot\x20be\x20empty','1542368lkfwex','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','test','root','push','Cannot\x20split\x20empty\x20path','exists','parent_segment','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','isAbsolute','66024DVlnaE','parse','499265UrWMUv','203MFausi','Path\x20attempts\x20to\x20navigate\x20above\x20root','2JiBWmf','name','Cannot\x20navigate\x20above\x20root','slice','151227yXoIEE','trim','filter','split','1335834RSlEWl','dirname','segments','length','join','readFile','Path\x20segment\x20cannot\x20be\x20empty','startsWith','pop','tdx.json','replace','5439533VCKwHx'];a102_0x569f=function(){return _0x38ac78;};return a102_0x569f();}function a102_0x16b8(_0x1428ce,_0x162930){_0x1428ce=_0x1428ce-0x192;const _0x569f6f=a102_0x569f();let _0x16b865=_0x569f6f[_0x1428ce];return _0x16b865;}export function isChildPath(_0x13521d,_0x52a73f){const _0x47ad6a=a102_0x16b8,_0x2eeb26=parsePath(_0x13521d),_0x31510c=parsePath(_0x52a73f);if(_0x2eeb26['segments'][_0x47ad6a(0x1b7)]<=_0x31510c[_0x47ad6a(0x1b6)][_0x47ad6a(0x1b7)])return![];for(let _0x44833e=0x0;_0x44833e<_0x31510c['segments'][_0x47ad6a(0x1b7)];_0x44833e++){if(_0x2eeb26[_0x47ad6a(0x1b6)][_0x44833e]!==_0x31510c[_0x47ad6a(0x1b6)][_0x44833e])return![];}return!![];}export function splitPath(_0x3091ae){const _0x422caa=a102_0x16b8,_0x4cd71b=parsePath(_0x3091ae);if(_0x4cd71b[_0x422caa(0x1b6)][_0x422caa(0x1b7)]===0x0)throw new Error(_0x422caa(0x1a2));if(_0x4cd71b[_0x422caa(0x1b6)]['length']===0x1)return{'parent':_0x4cd71b[_0x422caa(0x1b6)][0x0]};return{'parent':_0x4cd71b[_0x422caa(0x1b6)][0x0],'child':_0x4cd71b['segments'][_0x422caa(0x1af)](0x1)['join']('/')};}export function isYamlFilePath(_0x2692c4){const _0x118ba6=a102_0x16b8;return _0x2692c4[_0x118ba6(0x1c0)](_0x118ba6(0x192))||_0x2692c4[_0x118ba6(0x1c0)]('.yaml');}export async function resolveYamlFilePath(_0x11ea28,_0x49f4e8=nodeFileSystem){const _0x2794ed=a102_0x16b8,_0x3d5a9d=a102_0x2cf6d2[_0x2794ed(0x19a)](_0x11ea28);if(!await _0x49f4e8[_0x2794ed(0x1a3)](_0x3d5a9d))throw new Error('File\x20not\x20found:\x20'+_0x11ea28);let _0x5479c9=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x3d5a9d),_0xd2a5ae=null,_0x1dd5d3=null;const _0x43038e=a102_0x2cf6d2[_0x2794ed(0x1a8)](_0x5479c9)[_0x2794ed(0x1a0)];while(_0x5479c9!==_0x43038e){const _0x45bd13=a102_0x2cf6d2['join'](_0x5479c9,_0x2794ed(0x1bd));if(await _0x49f4e8[_0x2794ed(0x1a3)](_0x45bd13)){_0xd2a5ae=_0x45bd13,_0x1dd5d3=_0x5479c9;break;}_0x5479c9=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x5479c9);}if(!_0xd2a5ae||!_0x1dd5d3)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x11ea28);const _0x3bf96e=await _0x49f4e8['readFile'](_0xd2a5ae),_0x4f19db=JSON[_0x2794ed(0x1a8)](_0x3bf96e),_0xe899cb=_0x4f19db[_0x2794ed(0x1a4)];if(!_0xe899cb)throw new Error(_0x2794ed(0x1c1));const _0x487af4=await _0x49f4e8[_0x2794ed(0x1b9)](_0x3d5a9d),_0x38769c=a102_0x33ad7e(_0x487af4),_0x153f38=_0x38769c[_0x2794ed(0x1ad)];if(!_0x153f38)throw new Error(_0x2794ed(0x19e)+_0x11ea28);const _0x38696e=_0x38769c['type']==='journey'?'journey':_0x2794ed(0x198),_0x173d9e=a102_0x2cf6d2[_0x2794ed(0x19b)](_0x1dd5d3,_0x3d5a9d),_0x295ca3=a102_0x2cf6d2[_0x2794ed(0x1b5)](_0x173d9e),_0x1bc695=_0x295ca3==='.'?'':_0x295ca3[_0x2794ed(0x1be)](/\\/g,'/'),_0x41506a=_0x1bc695?_0xe899cb+'/'+_0x1bc695+'/'+_0x153f38:_0xe899cb+'/'+_0x153f38;return{'parentSegment':_0xe899cb,'segmentName':_0x153f38,'folderPath':_0x1bc695,'fullPath':_0x41506a,'resourceType':_0x38696e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x179ebe,_0x2f29ed){const _0x2110f0=a103_0x8119,_0x4f9352=_0x179ebe();while(!![]){try{const _0x21d37a=parseInt(_0x2110f0(0x103))/0x1*(parseInt(_0x2110f0(0xfa))/0x2)+-parseInt(_0x2110f0(0xf7))/0x3+-parseInt(_0x2110f0(0x102))/0x4+parseInt(_0x2110f0(0xf9))/0x5*(-parseInt(_0x2110f0(0xfe))/0x6)+parseInt(_0x2110f0(0xfd))/0x7*(-parseInt(_0x2110f0(0xf5))/0x8)+parseInt(_0x2110f0(0xf3))/0x9*(-parseInt(_0x2110f0(0x100))/0xa)+-parseInt(_0x2110f0(0xfc))/0xb*(-parseInt(_0x2110f0(0xff))/0xc);if(_0x21d37a===_0x2f29ed)break;else _0x4f9352['push'](_0x4f9352['shift']());}catch(_0x1f9813){_0x4f9352['push'](_0x4f9352['shift']());}}}(a103_0x133f,0x6438b));function a103_0x8119(_0xdd00e9,_0x36f573){_0xdd00e9=_0xdd00e9-0xf3;const _0x133f97=a103_0x133f();let _0x811919=_0x133f97[_0xdd00e9];return _0x811919;}function a103_0x133f(){const _0x1c6a05=['substring','3734320URkMlN','.\x20Parent\x20name\x20cannot\x20be\x20empty','1243452XXvQqF','indexOf','37275mjUXNK','2EVkZZY','Invalid\x20segment\x20reference\x20format:\x20','22329901lPAXgX','7DeuFee','468EAMUrt','12nfGeqI','10WErRLD','.\x20Child\x20name\x20cannot\x20be\x20empty','2913912VDObzi','633409ERZolR','554859LbzAsi'];a103_0x133f=function(){return _0x1c6a05;};return a103_0x133f();}export function parseSegmentRef(_0xf98a9d){const _0xb46775=a103_0x8119,_0x1b6098=_0xf98a9d[_0xb46775(0xf8)]('/');if(_0x1b6098===-0x1)return{'parentId':_0xf98a9d};if(_0x1b6098===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0xf98a9d+_0xb46775(0xf6));const _0x1a769f=_0xf98a9d[_0xb46775(0xf4)](0x0,_0x1b6098),_0xe09ccd=_0xf98a9d[_0xb46775(0xf4)](_0x1b6098+0x1);if(_0xe09ccd==='')throw new Error(_0xb46775(0xfb)+_0xf98a9d+_0xb46775(0x101));return{'parentId':_0x1a769f,'childId':_0xe09ccd};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d816a,_0x3d6542){const _0x44c5db=a104_0x578b,_0x2bebb9=_0x2d816a();while(!![]){try{const _0x38001b=parseInt(_0x44c5db(0xe5))/0x1*(-parseInt(_0x44c5db(0xc3))/0x2)+-parseInt(_0x44c5db(0xbc))/0x3*(-parseInt(_0x44c5db(0xb9))/0x4)+parseInt(_0x44c5db(0xb8))/0x5*(-parseInt(_0x44c5db(0xe0))/0x6)+parseInt(_0x44c5db(0xd7))/0x7+parseInt(_0x44c5db(0xdb))/0x8+parseInt(_0x44c5db(0xdc))/0x9+-parseInt(_0x44c5db(0xbf))/0xa;if(_0x38001b===_0x3d6542)break;else _0x2bebb9['push'](_0x2bebb9['shift']());}catch(_0x1cc33d){_0x2bebb9['push'](_0x2bebb9['shift']());}}}(a104_0x179f,0xce02d));import a104_0xf064be from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x3f8b79){return _0x3f8b79['type']!=='error';}function a104_0x578b(_0x5adac1,_0xbb9f6e){_0x5adac1=_0x5adac1-0xb4;const _0x179fda=a104_0x179f();let _0x578b48=_0x179fda[_0x5adac1];return _0x578b48;}export function isScopedResolution(_0x3547ca){const _0x463c9d=a104_0x578b;return _0x3547ca[_0x463c9d(0xcf)]===_0x463c9d(0xe8)||_0x3547ca[_0x463c9d(0xcf)]===_0x463c9d(0xbb)||_0x3547ca[_0x463c9d(0xcf)]==='context';}export function getScopedDetails(_0x3e4a9f){const _0x15e90f=a104_0x578b;if(isScopedResolution(_0x3e4a9f))return{'isScoped':_0x3e4a9f['isScoped'],'scopedFolderPath':_0x3e4a9f[_0x15e90f(0xc1)]};return undefined;}async function findTdxConfigAsync(_0x230bb1,_0x1a76e4){const _0x534b06=a104_0x578b;let _0xab1683=a104_0xf064be[_0x534b06(0xb6)](_0x230bb1);const _0x43e87c=a104_0xf064be['parse'](_0xab1683)['root'];while(_0xab1683!==_0x43e87c){const _0x3a613d=a104_0xf064be[_0x534b06(0xc4)](_0xab1683,'tdx.json');if(await _0x1a76e4[_0x534b06(0xd5)](_0x3a613d))try{const _0x2c4a02=await _0x1a76e4['readFile'](_0x3a613d),_0x129335=JSON[_0x534b06(0xc5)](_0x2c4a02);if(_0x129335['parent_segment']&&typeof _0x129335['parent_segment']==='string')return{'configPath':_0x3a613d,'configDir':_0xab1683,'parentSegment':_0x129335['parent_segment']};}catch{}_0xab1683=a104_0xf064be['dirname'](_0xab1683);}return null;}function calculateScopedPath(_0x398e21,_0x3dade8){const _0x4deb16=a104_0x578b,_0x18bb49=a104_0xf064be['relative'](_0x3dade8,_0x398e21),_0x2f092f=_0x18bb49!==''&&_0x18bb49!=='.'&&!_0x18bb49[_0x4deb16(0xea)]('..');return{'isScoped':_0x2f092f,'scopedFolderPath':_0x2f092f?_0x18bb49[_0x4deb16(0xca)](/\\/g,'/'):''};}function a104_0x179f(){const _0x2e9b8e=['exists','error','11090380SWDPiX','No\x20tdx.json\x20found\x20for\x20file:\x20','parent_name','File\x20not\x20found:\x20','9506928BiOppk','13858542oKSFtJ','context','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','No\x20tdx.json\x20found','6mIxINN','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','resourceType','basename','journey','9137vIbXXi','isFile','match','directory','includes','startsWith','invalid_yaml','dirname','segment','resolve','File\x20not\x20found','8108140jQdEIJ','6113732jIJkmp','extname','file','3atWSwX','cwd','Not\x20a\x20YAML\x20file:\x20','18496490MxzuEu','trim','scopedFolderPath','folderPath','334LLnAMu','join','parse','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentSegment','isDirectory','replace','configDir','readFile','segmentName','file_not_found','type','no_config','Parent\x20segment\x20not\x20specified','stat','isScoped','message'];a104_0x179f=function(){return _0x2e9b8e;};return a104_0x179f();}export async function resolveTarget(_0x2038af){const _0x217dc2=a104_0x578b,{arg:_0x5e89fc,contextParent:_0xcfcfae,cwd:cwd=process[_0x217dc2(0xbd)](),fs:fs=nodeFileSystem}=_0x2038af;if(_0x5e89fc&&isYamlFilePath(_0x5e89fc))try{const _0x472ea6=await resolveYamlFilePath(_0x5e89fc,fs),_0x3cc29c=a104_0xf064be['resolve'](_0x5e89fc),_0x57b46f=a104_0xf064be[_0x217dc2(0xb4)](_0x3cc29c),_0x3a472e=await findTdxConfigAsync(_0x57b46f,fs);if(!_0x3a472e){if(_0xcfcfae){const _0x4b5bd0=a104_0xf064be['dirname'](_0x3cc29c);return{'type':_0x217dc2(0xbb),'parentName':_0xcfcfae,'targetDir':_0x4b5bd0,'configRoot':_0x4b5bd0,'filePath':_0x3cc29c,'resourceName':_0x472ea6[_0x217dc2(0xcd)],'folderPath':_0x472ea6[_0x217dc2(0xc2)],'resourceType':_0x472ea6[_0x217dc2(0xe2)],'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':_0x217dc2(0xd0),'message':_0x217dc2(0xd8)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}const _0x5d8dde=calculateScopedPath(_0x57b46f,_0x3a472e[_0x217dc2(0xcb)]);return{'type':'file','parentName':_0x3a472e[_0x217dc2(0xc8)],'targetDir':_0x3a472e[_0x217dc2(0xcb)],'configRoot':_0x3a472e['configDir'],'filePath':_0x3cc29c,'resourceName':_0x472ea6[_0x217dc2(0xcd)],'folderPath':_0x472ea6['folderPath'],'resourceType':_0x472ea6[_0x217dc2(0xe2)],'isScoped':_0x5d8dde[_0x217dc2(0xd3)],'scopedFolderPath':_0x5d8dde[_0x217dc2(0xc1)]};}catch(_0x410cbb){const _0x28aa7b=_0x410cbb instanceof Error?_0x410cbb[_0x217dc2(0xd4)]:String(_0x410cbb);if(_0x28aa7b[_0x217dc2(0xe9)](_0x217dc2(0xb7)))return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xce),'message':_0x217dc2(0xda)+_0x5e89fc,'arg':_0x5e89fc};if(_0x28aa7b[_0x217dc2(0xe9)](_0x217dc2(0xdf))){if(_0xcfcfae){const _0x351ea8=a104_0xf064be[_0x217dc2(0xb6)](_0x5e89fc);if(await fs['exists'](_0x351ea8)){const _0x1e20ba=a104_0xf064be[_0x217dc2(0xb4)](_0x351ea8),_0x5ef000=await fs[_0x217dc2(0xcc)](_0x351ea8),_0x3bb633=_0x5ef000['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x19eba4=_0x5ef000[_0x217dc2(0xe7)](/^type:\s*["']?([^"'\n]+)["']?/m),_0xb51e44=_0x3bb633?_0x3bb633[0x1]['trim']():a104_0xf064be[_0x217dc2(0xe3)](_0x5e89fc,a104_0xf064be[_0x217dc2(0xba)](_0x5e89fc)),_0x51cf49=_0x19eba4&&_0x19eba4[0x1][_0x217dc2(0xc0)]()===_0x217dc2(0xe4)?'journey':_0x217dc2(0xb5);return{'type':_0x217dc2(0xbb),'parentName':_0xcfcfae,'targetDir':_0x1e20ba,'configRoot':_0x1e20ba,'filePath':_0x351ea8,'resourceName':_0xb51e44,'folderPath':'','resourceType':_0x51cf49,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xd0),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xeb),'message':_0x28aa7b,'arg':_0x5e89fc};}if(_0x5e89fc){const _0x1a6326=a104_0xf064be[_0x217dc2(0xb6)](cwd,_0x5e89fc);let _0x2640d0=null;try{_0x2640d0=await fs[_0x217dc2(0xd2)](_0x1a6326);}catch{}if(_0x2640d0?.[_0x217dc2(0xc9)]()){const _0x381b8e=await findTdxConfigAsync(_0x1a6326,fs);if(_0x381b8e){const _0x4a0e74=calculateScopedPath(_0x1a6326,_0x381b8e[_0x217dc2(0xcb)]);return{'type':'directory','parentName':_0x381b8e['parentSegment'],'targetDir':_0x1a6326,'configRoot':_0x381b8e[_0x217dc2(0xcb)],'isScoped':_0x4a0e74[_0x217dc2(0xd3)],'scopedFolderPath':_0x4a0e74[_0x217dc2(0xc1)]};}if(_0xcfcfae)return{'type':_0x217dc2(0xe8),'parentName':_0xcfcfae,'targetDir':_0x1a6326,'configRoot':_0x1a6326,'isScoped':![],'scopedFolderPath':''};return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xd0),'message':_0x217dc2(0xc7)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xde)};}if(_0x2640d0?.[_0x217dc2(0xe6)]())return{'type':_0x217dc2(0xd6),'errorCode':_0x217dc2(0xeb),'message':_0x217dc2(0xbe)+_0x5e89fc,'arg':_0x5e89fc,'helpText':_0x217dc2(0xc6)};const _0x19c8a5=sanitizeFileName(_0x5e89fc),_0x18a0f5=getSegmentRootDir(_0x19c8a5,cwd);return{'type':_0x217dc2(0xd9),'parentName':_0x5e89fc,'targetDir':_0x18a0f5,'configRoot':_0x18a0f5};}const _0x477ca3=await findTdxConfigAsync(cwd,fs);if(_0x477ca3){const _0x4e0404=calculateScopedPath(cwd,_0x477ca3['configDir']);return{'type':_0x217dc2(0xdd),'parentName':_0x477ca3[_0x217dc2(0xc8)],'targetDir':cwd,'configRoot':_0x477ca3[_0x217dc2(0xcb)],'isScoped':_0x4e0404[_0x217dc2(0xd3)],'scopedFolderPath':_0x4e0404[_0x217dc2(0xc1)]};}if(_0xcfcfae){const _0x532f91=sanitizeFileName(_0xcfcfae),_0x21c6da=getSegmentRootDir(_0x532f91,cwd);return{'type':_0x217dc2(0xdd),'parentName':_0xcfcfae,'targetDir':_0x21c6da,'configRoot':_0x21c6da,'isScoped':![],'scopedFolderPath':''};}return{'type':'error','errorCode':'no_parent','message':_0x217dc2(0xd1),'helpText':_0x217dc2(0xe1)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a105_0x250f50=a105_0xf7ea;function a105_0x4f72(){const _0x394fe5=['186FNizGl','join','resolve','parse','cwd','root','parent_segment','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','752159FSBLDE','tdx.json','91085uNoAjQ','12343200UDVUqI','156062dsWWri','Invalid\x20tdx.json:\x20expected\x20object','10842671DWabGy','string','relative','3787636MhrmiK','14509080IuDtlJ','startsWith','replace','Invalid\x20JSON\x20in\x20','segments','dirname','object','9JUuBqQ'];a105_0x4f72=function(){return _0x394fe5;};return a105_0x4f72();}(function(_0x363740,_0x5aad0a){const _0xbaa576=a105_0xf7ea,_0x1c2eb9=_0x363740();while(!![]){try{const _0x5c2449=parseInt(_0xbaa576(0x7d))/0x1+-parseInt(_0xbaa576(0x81))/0x2*(-parseInt(_0xbaa576(0x74))/0x3)+parseInt(_0xbaa576(0x86))/0x4+parseInt(_0xbaa576(0x7f))/0x5*(parseInt(_0xbaa576(0x75))/0x6)+-parseInt(_0xbaa576(0x83))/0x7+parseInt(_0xbaa576(0x80))/0x8+-parseInt(_0xbaa576(0x87))/0x9;if(_0x5c2449===_0x5aad0a)break;else _0x1c2eb9['push'](_0x1c2eb9['shift']());}catch(_0x933e7e){_0x1c2eb9['push'](_0x1c2eb9['shift']());}}}(a105_0x4f72,0xd6c63));import{existsSync,readFileSync}from'fs';import a105_0x15b02b from'path';const TDX_CONFIG_FILE=a105_0x250f50(0x7e),SEGMENTS_DIR=a105_0x250f50(0x71);export function findTdxConfigPath(_0x12b74d=process[a105_0x250f50(0x79)]()){const _0x5d9fac=a105_0x250f50;let _0x3ecac3=a105_0x15b02b[_0x5d9fac(0x77)](_0x12b74d);const _0x27f128=a105_0x15b02b[_0x5d9fac(0x78)](_0x3ecac3)[_0x5d9fac(0x7a)];while(_0x3ecac3!==_0x27f128){const _0x51fd60=a105_0x15b02b['join'](_0x3ecac3,TDX_CONFIG_FILE);if(existsSync(_0x51fd60))return _0x51fd60;_0x3ecac3=a105_0x15b02b[_0x5d9fac(0x72)](_0x3ecac3);}return null;}export function loadTdxConfig(_0x3df654){const _0x33f4ea=a105_0x250f50,_0x24330a=readFileSync(_0x3df654,'utf-8');let _0x13f5d4;try{_0x13f5d4=JSON[_0x33f4ea(0x78)](_0x24330a);}catch{throw new Error(_0x33f4ea(0x70)+_0x3df654);}if(!_0x13f5d4||typeof _0x13f5d4!==_0x33f4ea(0x73))throw new Error(_0x33f4ea(0x82));const _0x1f5015=_0x13f5d4;if(!_0x1f5015[_0x33f4ea(0x7b)]||typeof _0x1f5015[_0x33f4ea(0x7b)]!==_0x33f4ea(0x84))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x1f5015['parent_segment']};}export function findTdxConfig(_0x145364=process['cwd']()){const _0x351787=a105_0x250f50,_0x58e593=findTdxConfigPath(_0x145364);if(!_0x58e593)throw new Error(_0x351787(0x7c));const _0x2841e6=loadTdxConfig(_0x58e593),_0x1db334=a105_0x15b02b[_0x351787(0x72)](_0x58e593);return{'config':_0x2841e6,'configPath':_0x58e593,'configDir':_0x1db334};}export function tryFindTdxConfig(_0x4ae7d5){try{return findTdxConfig(_0x4ae7d5);}catch{return null;}}export function getSegmentRootDir(_0x54dcb6,_0x2e5f56=process[a105_0x250f50(0x79)]()){const _0x2109a9=a105_0x250f50;return a105_0x15b02b[_0x2109a9(0x76)](_0x2e5f56,SEGMENTS_DIR,_0x54dcb6);}export function getTdxConfigPath(_0x20d090,_0x230166=process[a105_0x250f50(0x79)]()){const _0xc8300c=a105_0x250f50;return a105_0x15b02b[_0xc8300c(0x76)](getSegmentRootDir(_0x20d090,_0x230166),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x2765f0,_0x11ebad){const _0x58555e=a105_0x250f50,_0x40fd3a=a105_0x15b02b[_0x58555e(0x77)](_0x2765f0),_0x455786=a105_0x15b02b[_0x58555e(0x85)](_0x11ebad,_0x40fd3a);if(_0x455786[_0x58555e(0x6e)]('..'))return'';return _0x455786;}export function localPathToTdFolderPath(_0x1dafbf){const _0x425abc=a105_0x250f50,_0x13583e=a105_0x15b02b[_0x425abc(0x72)](_0x1dafbf);if(_0x13583e==='.'||_0x13583e==='')return'';return _0x13583e[_0x425abc(0x6f)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x3d93db,_0x2fe3a1){const _0x468cae=a105_0x250f50;if(!_0x3d93db)return _0x2fe3a1;return a105_0x15b02b[_0x468cae(0x76)](_0x2fe3a1,_0x3d93db);}function a105_0xf7ea(_0x228c83,_0x923f75){_0x228c83=_0x228c83-0x6e;const _0x4f72c9=a105_0x4f72();let _0xf7ea05=_0x4f72c9[_0x228c83];return _0xf7ea05;}export function createTdxConfigContent(_0x489862){const _0x50cb8a={'parent_segment':_0x489862};return JSON['stringify'](_0x50cb8a,null,0x2)+'\x0a';}
|