@treasuredata/tdx 0.16.1 → 0.16.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.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/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/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +19 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/types.d.ts +26 -0
- package/dist/sdk/claude-agent/types.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.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.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.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a119_0x43758d=a119_0x1c83;(function(_0x5371eb,_0x139dbc){const _0x4e0e36=a119_0x1c83,_0x3caa8e=_0x5371eb();while(!![]){try{const _0x545999=parseInt(_0x4e0e36(0x194))/0x1*(-parseInt(_0x4e0e36(0x17b))/0x2)+-parseInt(_0x4e0e36(0x10d))/0x3*(-parseInt(_0x4e0e36(0x181))/0x4)+-parseInt(_0x4e0e36(0x14e))/0x5*(-parseInt(_0x4e0e36(0x127))/0x6)+-parseInt(_0x4e0e36(0xde))/0x7+parseInt(_0x4e0e36(0x19c))/0x8*(-parseInt(_0x4e0e36(0xe1))/0x9)+parseInt(_0x4e0e36(0x10a))/0xa+-parseInt(_0x4e0e36(0xed))/0xb;if(_0x545999===_0x139dbc)break;else _0x3caa8e['push'](_0x3caa8e['shift']());}catch(_0x25c13d){_0x3caa8e['push'](_0x3caa8e['shift']());}}}(a119_0x4aa5,0xd624c));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a119_0x43758d(0xf2);export const PENDING_ACTIVATION_PREFIX=a119_0x43758d(0x14f);export function createPendingSegmentId(_0x5c5ba3){return''+PENDING_SEGMENT_PREFIX+_0x5c5ba3+'__';}export function isPendingSegmentId(_0x33ce94){const _0x3a3428=a119_0x43758d;return _0x33ce94[_0x3a3428(0x137)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x4154b8){const _0x4ad54d=a119_0x43758d;return _0x4154b8[_0x4ad54d(0xc3)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x6ae26d){return''+PENDING_ACTIVATION_PREFIX+_0x6ae26d+'__';}export function isPendingActivationId(_0x30e3c9){const _0x3b7773=a119_0x43758d;return _0x30e3c9[_0x3b7773(0x137)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x254dec){return _0x254dec['replace'](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x10fa1e,_0xdc6c81){const _0x1c10f4=a119_0x43758d,_0x562521=_0x10fa1e+'::'+(_0xdc6c81[_0x1c10f4(0x100)]()||'segment'),_0x4ad597=createHash(_0x1c10f4(0x193))[_0x1c10f4(0x13c)](_0x562521)[_0x1c10f4(0xf7)](_0x1c10f4(0xf0))[_0x1c10f4(0x129)](0x0,0xc);return _0x1c10f4(0x119)+_0x4ad597;}export function ensureJourneyDefaults(_0x1d20b8){const _0x4df925=a119_0x43758d;!_0x1d20b8[_0x4df925(0x11a)]&&(_0x1d20b8[_0x4df925(0x11a)]=''),!_0x1d20b8['state']&&(_0x1d20b8[_0x4df925(0xd4)]=_0x4df925(0x1a1));}export function resolveTDFolderPath(_0x3e4cb5,_0x174eb5,_0xbae588){const _0x5f1856=a119_0x43758d;if(!_0x174eb5)return _0x3e4cb5;if(_0x3e4cb5===_0xbae588||_0x3e4cb5[_0x5f1856(0x137)](_0xbae588+'/'))return _0x3e4cb5;return _0x3e4cb5?_0xbae588+'/'+_0x3e4cb5:_0xbae588;}function a119_0x4aa5(){const _0x4cc967=['validatedRequest','state','map','max','../../utils/async.js','list','embeddedSegmentNameToId','connector_config','utf-8','parentId','folder','9887724SUzZGK','index','Fetching\x20','18LlMsrH','isNew','Updated\x20activation\x20\x27','createSegment','connection','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','segmentNameToId','from','includes','rule','idToName','embedded_segment_created','225346UaaWxS','activationActions','deleteActivation','hex','message','__pending_','withProgress','all_columns','segment_deleted','embedded_activation_creating','digest','join','journeyBundlesByFolderAndName','journeyActivationStepId','item','embedded_activation_created','JOURNEY_UPDATE_ERROR','deleteSegment','Created\x20activation\x20\x27','trim','parentFolder','existingSegment','dirname','entry','relationships','segment_creating','split','onProgress','Activation','12697650EFnYvF','existingSegments','Journey\x20\x27','3rAgnvu','ACTIVATION_UPDATE_ERROR','valid','Entry\x20criteria:\x20','parseDocument','hasChanges','set','existingActivation','getJourney','relative','rootFolderId','./child-segment-yaml.js','journey_entry_criteria_','description','listSegments','verbose','resolveSegment','goal\x20criteria','data','updated','type','activationsBySegmentId','\x27\x20not\x20found\x20in\x20journey\x20\x27','isArray','attributes','skipSegments','2130zSHseG','activation_template_id','slice','kind','segment','unchanged','DecisionPoint','localSegmentRules','segmentByFolderAndName','action','getSegment','connectionIdToNameMap','add','logInfo','updateActivation','reduce','startsWith','errors','listActivations','yamlActivation','get','update','NOT_FOUND','Created\x20journey\x20\x27','segment_deleting','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','branches','Name\x20has\x20already\x20been\x20taken','createJourneySegment','stringify','milestone','segmentFolderId','\x20journey\x20from\x20file:\x20','folderPathToId','entryCriteria','journeyId','createActivation','\x20error(s)','SEGMENT_NOT_FOUND','300BYnamd','__pending_act_','activation_deleted','steps','yamlConfig','deleted','Segment\x20not\x20found:\x20','journeys','activations','folder_created','INTERNAL','activation_created','object','waitCondition','created','buildUserMaps','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','idToEmailMap','segmentId','Failed\x20to\x20','embedded_segment_creating','goal','null','Deleting\x20activation\x20\x27','delete','Updating\x20activation\x20\x27','journeyStages','Updated\x20segment\x20\x27','results','\x20(referenced\x20in\x20journey\x20','Updated\x20journey\x20\x27','segments','\x0a\x20\x20','\x27\x20for\x20','absolutePath','diff','schedule','with','create','\x27...','Creating\x20folder\x20\x27','activationContext','activation_updating','filter','progress','10550GnCfQK','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','entries','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Created\x20folder\x20\x27','\x27\x20entry\x20criteria','6223424LaWhVu','updateSegmentById','values','Creating\x20segment\x20\x27','activationParams','journeyBundleName','folderPath','toString','sort','ACTIVATION_SYNTAX_ERROR','Deleted\x20activation\x20\x27','toLowerCase','find','length','name','createdSegmentIds','journey_updated','exitCriterias','sha1','67qhTeeF','Stage\x20\x27','\x27\x20milestone','journeyActivationNameToId','parse','deps','./journey-yaml.js','flatMap','733384WPyjvS','WaitStep','entry_criteria','\x27\x20from\x20file:\x20','journey','draft','JOURNEY_SYNTAX_ERROR','stage\x20\x27','versionNumber','journeyById','createFolder','logDeleted','replace','logSuccess','\x27\x20decision\x20point\x20branch\x20\x27','Activation\x20not\x20found:\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','push','effectiveFolderId','existingJourney','folderId','notification','segment_updating','has','keys','stages','size','createdSegmentId'];a119_0x4aa5=function(){return _0x4cc967;};return a119_0x4aa5();}export function addFoldersToCreate(_0x5b2066,_0x5edfa3,_0x176936){const _0xef86a=a119_0x43758d;if(!_0x5b2066)return;if(_0x5edfa3[_0xef86a(0xce)](_0x5b2066))return;const _0x479652=_0x5b2066[_0xef86a(0x107)]('/');let _0x5ae71c='';for(const _0x2c5446 of _0x479652){_0x5ae71c=_0x5ae71c?_0x5ae71c+'/'+_0x2c5446:_0x2c5446,!_0x5edfa3[_0xef86a(0xce)](_0x5ae71c)&&_0x176936['add'](_0x5ae71c);}}import*as a119_0x5c0b2d from'yaml';import{readFileSync}from'fs';import a119_0x2cece5 from'path';import{isJourneyDef,parseYamlString as a119_0xff0061,toYamlString as a119_0x4bcb51,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(_0x3e3232){const _0x414375=a119_0x43758d;if(Array[_0x414375(0x124)](_0x3e3232))return'['+_0x3e3232[_0x414375(0xd5)](_0x371586=>stableStringify(_0x371586))[_0x414375(0xf8)](',')+']';if(_0x3e3232&&typeof _0x3e3232===_0x414375(0x15a)){const _0xe8b8ee=_0x3e3232,_0x4d8643=Object['keys'](_0xe8b8ee)[_0x414375(0x189)](),_0x2c8ce0=_0x4d8643[_0x414375(0xd5)](_0x17d14c=>'\x22'+_0x17d14c+'\x22:'+stableStringify(_0xe8b8ee[_0x17d14c]));return'{'+_0x2c8ce0['join'](',')+'}';}const _0x75f375=JSON[_0x414375(0x144)](_0x3e3232);return _0x75f375===undefined?_0x414375(0x164):_0x75f375;}function activationSignature(_0x413f85){const _0x4fc03d=a119_0x43758d,_0x11b8c6={'connection':_0x413f85[_0x4fc03d(0xe5)],..._0x413f85[_0x4fc03d(0xf4)]!==undefined&&{'all_columns':_0x413f85[_0x4fc03d(0xf4)]},..._0x413f85['columns']!==undefined&&{'columns':_0x413f85['columns']},..._0x413f85['behavior']!==undefined&&{'behavior':_0x413f85['behavior']},..._0x413f85[_0x4fc03d(0x172)]!==undefined&&{'schedule':_0x413f85[_0x4fc03d(0x172)]},..._0x413f85[_0x4fc03d(0xcc)]!==undefined&&{'notification':_0x413f85[_0x4fc03d(0xcc)]},..._0x413f85[_0x4fc03d(0xda)]!==undefined&&{'connector_config':_0x413f85['connector_config']},..._0x413f85[_0x4fc03d(0x128)]!==undefined&&{'activation_template_id':_0x413f85['activation_template_id']}};return stableStringify(_0x11b8c6);}export async function prepareSegmentFiles(_0x1d35a4,_0x557960,_0x3139c9,_0x3d65f0,_0x5d25c9){const _0x394fca=a119_0x43758d,{activationDefToCreateRequest:_0x4eb392}=await import(_0x394fca(0x118)),_0x37e10a=[],_0x45f386=new Set();for(const {yamlConfig:_0x4caf9b,folderPath:_0x4d8c62,sourcePath:_0x13832f}of _0x1d35a4){const _0x1bbb32=resolveTDFolderPath(_0x4d8c62,_0x3d65f0,_0x5d25c9),_0x1a02bf=_0x1bbb32+':'+_0x4caf9b[_0x394fca(0x18f)],_0x2b55f1=_0x557960[_0x394fca(0x12f)]['get'](_0x1a02bf),_0x28af00=_0x2b55f1?_0x557960[_0x394fca(0x122)][_0x394fca(0x13b)](_0x2b55f1['id'])||[]:[];addFoldersToCreate(_0x1bbb32,_0x557960[_0x394fca(0x148)],_0x45f386);const _0x466da2=calculateActivationActions(_0x4caf9b[_0x394fca(0x156)]||[],_0x28af00,_0x557960['idToEmailMap'],_0x557960['connectionIdToNameMap']);for(const _0x505a4d of _0x466da2){(_0x505a4d[_0x394fca(0x121)]==='create'||_0x505a4d[_0x394fca(0x121)]===_0x394fca(0x13c))&&_0x505a4d[_0x394fca(0x13a)]&&(_0x505a4d[_0x394fca(0xd3)]=await _0x4eb392(_0x505a4d[_0x394fca(0x13a)],_0x3139c9));}const _0x5f42b6=calculateSegmentDiff(_0x4caf9b,_0x2b55f1,_0x28af00,_0x557960[_0x394fca(0x15f)],_0x557960['connectionIdToNameMap']);_0x37e10a[_0x394fca(0xc8)]({'relativePath':_0x4caf9b['name'],'absolutePath':_0x13832f,'yamlConfig':_0x4caf9b,'folderPath':_0x1bbb32,'existingSegment':_0x2b55f1,'existingActivations':_0x28af00,'isNew':_0x5f42b6[_0x394fca(0xe2)],'hasChanges':_0x5f42b6['hasChanges'],'diff':_0x5f42b6[_0x394fca(0x171)],'activationActions':_0x466da2});}return{'segmentFiles':_0x37e10a,'foldersToCreate':_0x45f386};}export async function prepareJourneyFiles(_0x1f4217,_0x3d2d12,_0x3e2dc3,_0x459978){const _0xe52374=a119_0x43758d,_0x264a83=[],_0x38544b=new Set();for(const {yamlConfig:_0x4f33c2,folderPath:_0x354120,sourcePath:_0x1c36ec}of _0x1f4217){const _0xd98116=resolveTDFolderPath(_0x354120,_0x3e2dc3,_0x459978),_0x46d93b=_0xd98116+':'+_0x4f33c2['name'],_0x2b46be=_0x3d2d12[_0xe52374(0xf9)][_0xe52374(0x13b)](_0x46d93b);let _0x1ae2d9,_0x23b5f6;if(_0x2b46be&&_0x2b46be[_0xe52374(0x18e)]>0x0){const _0x2c545f=buildLocalExpandedRuleMappings(_0x4f33c2),{createYamlContext:_0x40639c,prefetchJourneySegments:_0x40388e}=createPushYamlContextForBundle(_0x3d2d12[_0xe52374(0x199)],_0x3d2d12['parentId'],_0x3d2d12[_0xe52374(0x10b)],_0x2c545f,_0x3d2d12['idToEmailMap'],_0x3d2d12[_0xe52374(0x132)],_0x3d2d12['activationStepsById'],_0x3d2d12[_0xe52374(0xc0)]);await _0x40388e(_0x2b46be['map'](_0x29f6c0=>_0x29f6c0['id']));const _0x306488=hasMultipleVersions(_0x4f33c2),_0x2261c5=async _0x3fd66b=>{const _0x29ee8c=_0xe52374,_0x5159a4=_0x3d2d12['journeyById']?.['get'](_0x3fd66b);if(_0x5159a4)return _0x5159a4;return _0x3d2d12['fetchJourney']({'journeyId':_0x3fd66b,'journeyName':_0x4f33c2[_0x29ee8c(0x18f)],'isMultiVersion':_0x2b46be[_0x29ee8c(0x18e)]>0x1});};if(_0x306488&&_0x2b46be[_0xe52374(0x18e)]>0x1){const _0x5d2b80=[];for(const _0x18edf6 of _0x2b46be){const _0x165dee=_0x18edf6['versionNumber']||0x1;_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)]('Fetching\x20'+_0x4f33c2[_0xe52374(0x18f)]+'\x20v'+_0x165dee);const _0x515b03=await _0x2261c5(_0x18edf6['id']),_0x4d4eef=_0x40639c(_0x18edf6['id']),_0x29862e=await journeyResponseToDef(_0x515b03,_0x4d4eef);_0x5d2b80['push']({'item':_0x18edf6,'yaml':_0x29862e});}const _0x78b12b=buildLocalRuleToNameMappingFromJourney(_0x4f33c2);_0x23b5f6=buildMergedJourneyDef(_0x5d2b80,_0x78b12b);const _0x48dde8=Math[_0xe52374(0xd6)](..._0x5d2b80[_0xe52374(0xd5)](_0x100e87=>_0x100e87[_0xe52374(0xfb)][_0xe52374(0xbf)]||0x0)),_0x14db93=_0x2b46be[_0xe52374(0x18d)](_0xb59c8=>(_0xb59c8[_0xe52374(0xbf)]||0x0)===_0x48dde8);_0x14db93&&(_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)]('Fetching\x20'+_0x4f33c2[_0xe52374(0x18f)]+'\x20v'+_0x48dde8),_0x1ae2d9=await _0x2261c5(_0x14db93['id']));}else{const _0x288250=_0x2b46be[_0x2b46be[_0xe52374(0x18e)]-0x1];_0x3d2d12[_0xe52374(0x17a)]?.[_0xe52374(0x13c)](_0xe52374(0xe0)+_0x4f33c2[_0xe52374(0x18f)]),_0x1ae2d9=await _0x2261c5(_0x288250['id']);const _0x4775d0=_0x40639c(_0x288250['id']),_0x5e9e99=await journeyResponseToDef(_0x1ae2d9,_0x4775d0),_0x2da7bf=buildLocalRuleToNameMappingFromJourney(_0x4f33c2);_0x23b5f6=buildMergedJourneyDef([{'item':_0x288250,'yaml':_0x5e9e99}],_0x2da7bf);}}addFoldersToCreate(_0xd98116,_0x3d2d12[_0xe52374(0x148)],_0x38544b);const _0x3d1049=calculateJourneyDiff(_0x4f33c2,_0x23b5f6);_0x264a83[_0xe52374(0xc8)]({'relativePath':_0x4f33c2['name'],'absolutePath':_0x1c36ec,'yamlConfig':_0x4f33c2,'folderPath':_0xd98116,'existingJourney':_0x1ae2d9,'isNew':_0x3d1049[_0xe52374(0xe2)],'hasChanges':_0x3d1049['hasChanges'],'diff':_0x3d1049[_0xe52374(0x171)]});}return{'journeyFiles':_0x264a83,'foldersToCreate':_0x38544b};}export function calculateActivationActions(_0x5f230a,_0x38f1c6,_0x27d5af,_0x120530){const _0x3cd34f=a119_0x43758d,_0x176839=[],_0x359b98=new Map();for(const _0x4d8724 of _0x38f1c6){_0x359b98[_0x3cd34f(0x113)](_0x4d8724[_0x3cd34f(0x18f)],_0x4d8724);}const _0x41af6a=new Map();for(const _0x1d8acc of _0x5f230a){_0x41af6a['set'](_0x1d8acc[_0x3cd34f(0x18f)],_0x1d8acc);}for(const _0xdf784a of _0x5f230a){const _0x53a55b=_0x359b98['get'](_0xdf784a[_0x3cd34f(0x18f)]);if(!_0x53a55b)_0x176839['push']({'type':_0x3cd34f(0x174),'name':_0xdf784a[_0x3cd34f(0x18f)],'yamlActivation':_0xdf784a});else{const _0x592b18=activationResponseToDef(_0x53a55b,_0x27d5af,_0x120530),_0x3236e1=a119_0x5c0b2d['stringify'](_0x592b18),_0x4729e6=a119_0x5c0b2d[_0x3cd34f(0x144)](_0xdf784a);_0x3236e1!==_0x4729e6&&_0x176839[_0x3cd34f(0xc8)]({'type':_0x3cd34f(0x13c),'name':_0xdf784a['name'],'yamlActivation':_0xdf784a,'existingActivation':_0x53a55b});}}for(const _0x1268ee of _0x38f1c6){!_0x41af6a[_0x3cd34f(0xce)](_0x1268ee[_0x3cd34f(0x18f)])&&_0x176839[_0x3cd34f(0xc8)]({'type':_0x3cd34f(0x166),'name':_0x1268ee[_0x3cd34f(0x18f)],'existingActivation':_0x1268ee});}return _0x176839;}function a119_0x1c83(_0x3ba591,_0x1cdbd2){_0x3ba591=_0x3ba591-0xbf;const _0x4aa56a=a119_0x4aa5();let _0x1c8364=_0x4aa56a[_0x3ba591];return _0x1c8364;}export function calculateSegmentDiff(_0x28ca5e,_0x54f441,_0x1992ca,_0x3955e7,_0x5c3c97){const _0x156b1e=segmentToYamlString(_0x28ca5e);if(_0x54f441){const _0x31a155=segmentWithActivationsToYaml(_0x54f441,_0x1992ca,undefined,_0x3955e7,_0x5c3c97),_0xb6a3e5=segmentToYamlString(_0x31a155),_0x5b14e1=generateDiff(_0xb6a3e5,_0x156b1e),_0x9a5086=hasChanges(_0x5b14e1);return{'isNew':![],'hasChanges':_0x9a5086,'diff':_0x9a5086?formatDiffWithColors(_0x5b14e1):undefined};}const _0x43be64=generateDiff('',_0x156b1e);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x43be64)};}export function calculateJourneyDiff(_0x756645,_0x3e278c){const _0x5c96e3=normalizeJourneyDef(_0x756645,_0x756645),_0x58cf24=a119_0x4bcb51(_0x5c96e3);if(_0x3e278c){const _0x45bd7d=normalizeJourneyDef(_0x3e278c,_0x756645),_0x453b95=a119_0x4bcb51(_0x45bd7d),_0x57fdd0=generateDiff(_0x453b95,_0x58cf24),_0x57e64e=hasChanges(_0x57fdd0);return{'isNew':![],'hasChanges':_0x57e64e,'diff':_0x57e64e?formatDiffWithColors(_0x57fdd0):undefined};}const _0x5b3d4c=generateDiff('',_0x58cf24);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5b3d4c)};}export function findSegmentsToDelete(_0x33caaf,_0x2a4876,_0x26d6f8,_0x90f26e,_0x3d323b){const _0x177a6a=a119_0x43758d,_0x4c1f3c=new Set();for(const {yamlConfig:_0x4cd442,folderPath:_0x4f2c01}of _0x2a4876){_0x4c1f3c['add'](_0x4f2c01+':'+_0x4cd442[_0x177a6a(0x18f)]);}return _0x33caaf[_0x177a6a(0x179)](_0x4e5207=>{const _0x1a7de2=_0x177a6a,_0xb9d4ff=_0x4e5207['segmentFolderId']?_0x26d6f8[_0x1a7de2(0x13b)](_0x4e5207['segmentFolderId']['toString']())||'':'',_0x54eb84=_0xb9d4ff+':'+_0x4e5207[_0x1a7de2(0x18f)];if(_0x4c1f3c[_0x1a7de2(0xce)](_0x54eb84))return![];if(_0x3d323b)return _0xb9d4ff===_0x90f26e||_0xb9d4ff['startsWith'](_0x90f26e+'/');return!![];});}export function findJourneysToDelete(_0xa2cece,_0x43a0d,_0x4cc233,_0x24b2d6,_0x3f1a00){const _0x3d8abd=a119_0x43758d,_0x2ebec9=new Set();for(const {yamlConfig:_0x40e483,folderPath:_0x3c97b4}of _0x43a0d){_0x2ebec9[_0x3d8abd(0x133)](_0x3c97b4+':'+_0x40e483[_0x3d8abd(0x18f)]);}return _0xa2cece[_0x3d8abd(0x179)](_0x595059=>{const _0x54b5ca=_0x3d8abd,_0x38674b=_0x595059[_0x54b5ca(0xcb)]?_0x4cc233['get'](_0x595059[_0x54b5ca(0xcb)])||'':'',_0x2532de=_0x38674b+':'+_0x595059[_0x54b5ca(0x186)];if(_0x2ebec9[_0x54b5ca(0xce)](_0x2532de))return![];if(_0x3f1a00)return _0x38674b===_0x24b2d6||_0x38674b[_0x54b5ca(0x137)](_0x24b2d6+'/');return!![];});}export function buildSegmentLookupMap(_0x2736ab,_0x66276f){const _0xa2b81c=a119_0x43758d,_0x1cb0f1=new Map();for(const _0x2a5c33 of _0x2736ab){const _0x208237=_0x2a5c33[_0xa2b81c(0x146)]?_0x66276f[_0xa2b81c(0x13b)](_0x2a5c33[_0xa2b81c(0x146)][_0xa2b81c(0x188)]())||'':'',_0x44c3a7=_0x208237+':'+_0x2a5c33['name'];_0x1cb0f1['set'](_0x44c3a7,_0x2a5c33);}return _0x1cb0f1;}export function buildSegmentNameToIdMap(_0x1d2397){const _0x1ef8fa=a119_0x43758d,_0xe607d2=new Map();for(const _0x29295d of _0x1d2397){_0xe607d2['set'](_0x29295d[_0x1ef8fa(0x18f)],_0x29295d['id']);}return _0xe607d2;}export function buildJourneyBundleLookupMap(_0x40d74b,_0x51cdf5){const _0x632930=a119_0x43758d,_0x316ca8=new Map();for(const _0x16e8cf of _0x40d74b){const _0x6bc672=_0x16e8cf['folderId']?_0x51cdf5[_0x632930(0x13b)](_0x16e8cf[_0x632930(0xcb)])||'':'',_0x1e385f=_0x6bc672+':'+_0x16e8cf[_0x632930(0x186)];!_0x316ca8['has'](_0x1e385f)&&_0x316ca8[_0x632930(0x113)](_0x1e385f,[]),_0x316ca8[_0x632930(0x13b)](_0x1e385f)[_0x632930(0xc8)](_0x16e8cf);}for(const _0x363be1 of _0x316ca8[_0x632930(0x183)]()){_0x363be1[_0x632930(0x189)]((_0x5e07e0,_0x464c5b)=>(_0x5e07e0[_0x632930(0xbf)]||0x0)-(_0x464c5b[_0x632930(0xbf)]||0x0));}return _0x316ca8;}export function collectFoldersToCreate(_0x67d722,_0x854845){const _0x3bf94b=a119_0x43758d,_0x2f3c7c=new Set();for(const _0x5b041b of _0x67d722){if(!_0x5b041b)continue;if(_0x854845['has'](_0x5b041b))continue;const _0x59131d=_0x5b041b[_0x3bf94b(0x107)]('/');let _0xce9c93='';for(const _0xcc84e0 of _0x59131d){_0xce9c93=_0xce9c93?_0xce9c93+'/'+_0xcc84e0:_0xcc84e0,!_0x854845[_0x3bf94b(0xce)](_0xce9c93)&&_0x2f3c7c[_0x3bf94b(0x133)](_0xce9c93);}}return _0x2f3c7c;}export function parseAndClassifyYamlFiles(_0x1ee5b5,_0x3a1f4f,_0x18b64c){const _0x4203c9=a119_0x43758d,_0xba0262=[],_0x383fbf=[];for(const _0x56cae1 of _0x1ee5b5){const _0x3d5e82=a119_0x2cece5[_0x4203c9(0x116)](_0x3a1f4f,a119_0x2cece5[_0x4203c9(0x103)](_0x56cae1)),_0x49b183=_0x3d5e82==='.'?'':_0x3d5e82,_0x359eca=readFileSync(_0x56cae1,_0x4203c9(0xdb)),_0x1569cb=a119_0x5c0b2d[_0x4203c9(0x198)](_0x359eca);if(isJourneyDef(_0x1569cb)){const _0x4af9bf=a119_0xff0061(_0x359eca);_0x383fbf[_0x4203c9(0xc8)]({'yamlConfig':_0x4af9bf,'folderPath':_0x49b183,'sourcePath':_0x56cae1});}else{if(!_0x18b64c?.[_0x4203c9(0x126)]){const _0x367f8f=parseSegmentYamlFile(_0x359eca),_0x2a657f=normalizeChildSegmentYaml(_0x367f8f);_0xba0262[_0x4203c9(0xc8)]({'yamlConfig':_0x2a657f,'folderPath':_0x49b183,'sourcePath':_0x56cae1});}}}return{'segments':_0xba0262,'journeys':_0x383fbf};}export function validateParsedFiles(_0x2a73d8,_0x4143ad){const _0x4c3901=a119_0x43758d,_0x58025f=[];for(const {yamlConfig:_0x195025,sourcePath:_0xaf27ef}of _0x2a73d8[_0x4c3901(0x16d)]){const _0x32e898=readFileSync(_0xaf27ef,_0x4c3901(0xdb)),_0x266b9d=a119_0x5c0b2d[_0x4c3901(0x111)](_0x32e898),_0x26c238=validateSegmentDef(_0x195025,{'source':_0x32e898,'document':_0x266b9d});if(!_0x26c238[_0x4c3901(0x10f)]){const _0x231230=a119_0x2cece5['relative'](_0x4143ad,_0xaf27ef);_0x58025f[_0x4c3901(0xc8)]({'filePath':_0x231230,'source':_0x32e898,'result':_0x26c238,'isJourney':![]});}}for(const {yamlConfig:_0x33861f,sourcePath:_0x5b8046}of _0x2a73d8[_0x4c3901(0x155)]){const _0x2511a0=readFileSync(_0x5b8046,_0x4c3901(0xdb)),_0x2d2302=a119_0x5c0b2d[_0x4c3901(0x111)](_0x2511a0),_0x2e29f4=validateJourneyDef(_0x33861f,{'source':_0x2511a0,'document':_0x2d2302});if(!_0x2e29f4['valid']){const _0x1e193e=a119_0x2cece5[_0x4c3901(0x116)](_0x4143ad,_0x5b8046);_0x58025f[_0x4c3901(0xc8)]({'filePath':_0x1e193e,'source':_0x2511a0,'result':_0x2e29f4,'isJourney':!![]});}}return _0x58025f;}export function formatValidationErrors(_0x113d64){const _0x3b7ca6=a119_0x43758d,_0x14f593=[];for(const {filePath:_0x5df5fe,source:_0xaba232,result:_0x255fee,isJourney:_0x2c954e}of _0x113d64){const _0x1180a7=_0x2c954e?_0x3b7ca6(0x1a0):'segment';_0x14f593[_0x3b7ca6(0xc8)]('\x0a'+_0x5df5fe+'\x20('+_0x1180a7+'):\x20'+_0x255fee[_0x3b7ca6(0x138)]['length']+_0x3b7ca6(0x14c)),_0x14f593[_0x3b7ca6(0xc8)](formatValidationResult(_0x255fee,_0xaba232,_0x5df5fe));}return _0x14f593[_0x3b7ca6(0xf8)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x49c47f){const _0x549a4d=a119_0x43758d,_0x369379=new Set(),_0x4fe455=new Map(),_0x34ec7d=collectSegmentUsageCounts(_0x49c47f);if(_0x49c47f[_0x549a4d(0x16d)])for(const [_0x53e61b,_0x3cb4b6]of Object[_0x549a4d(0x17d)](_0x49c47f[_0x549a4d(0x16d)])){_0x369379[_0x549a4d(0x133)](_0x53e61b);if(_0x3cb4b6[_0x549a4d(0xea)]){const _0x59004e=yamlRuleToApi(_0x3cb4b6[_0x549a4d(0xea)]),_0x4f4d12=apiRuleToYaml(_0x59004e);_0x4fe455[_0x549a4d(0x113)](_0x53e61b,_0x4f4d12);}}const _0x56900b=new Map();let _0x12f29f=0x0;for(const [_0x592a2c,_0x4c54df]of _0x4fe455){const _0x184951=serializeExpandedRule(_0x4c54df,_0x4fe455),_0x41bbb3=_0x56900b['get'](_0x184951)||[];_0x41bbb3[_0x549a4d(0xc8)]({'name':_0x592a2c,'index':_0x12f29f}),_0x56900b[_0x549a4d(0x113)](_0x184951,_0x41bbb3),_0x12f29f++;}const _0x376d0b=new Map();for(const [_0xe79a16,_0x14e1a9]of _0x56900b){const _0x527596=_0x14e1a9['slice']()[_0x549a4d(0x189)]((_0x59c6b3,_0x475429)=>{const _0x1a31f9=_0x549a4d,_0x236bdb=_0x34ec7d[_0x1a31f9(0x13b)](_0x59c6b3[_0x1a31f9(0x18f)])||0x0,_0x11cf4d=_0x34ec7d[_0x1a31f9(0x13b)](_0x475429[_0x1a31f9(0x18f)])||0x0;if(_0x236bdb!==_0x11cf4d)return _0x11cf4d-_0x236bdb;return _0x59c6b3['index']-_0x475429[_0x1a31f9(0xdf)];})['map'](_0x3ca10c=>_0x3ca10c[_0x549a4d(0x18f)]),_0x8957a5=[];for(const _0x57b932 of _0x527596){const _0x2f3e8e=_0x34ec7d[_0x549a4d(0x13b)](_0x57b932)||0x0,_0x571b5b=Math[_0x549a4d(0xd6)](_0x2f3e8e,0x1);for(let _0x4444a4=0x0;_0x4444a4<_0x571b5b;_0x4444a4++){_0x8957a5['push'](_0x57b932);}}_0x376d0b[_0x549a4d(0x113)](_0xe79a16,_0x8957a5);}return{'existingLocalSegmentNames':_0x369379,'localSegmentRules':_0x4fe455,'localExpandedRuleToNames':_0x376d0b};}async function buildServerSegmentRuleMap(_0x2310c6,_0x1f5e3d,_0x45ea89,_0x2e861e){const _0x3a9268=new Map(),_0x5281e2=new Set(),_0x23718b=async _0x1aa2c7=>{const _0x302c2c=a119_0x1c83;if(_0x5281e2['has'](_0x1aa2c7))return;_0x5281e2[_0x302c2c(0x133)](_0x1aa2c7);let _0x196321=_0x45ea89[_0x302c2c(0x18d)](_0x36d15c=>_0x36d15c['id']===_0x1aa2c7);if(!_0x196321)try{_0x196321=await _0x2310c6[_0x302c2c(0x12b)][_0x302c2c(0x131)](_0x1f5e3d,_0x1aa2c7);}catch{return;}if(!_0x196321?.['rule'])return;const _0x259bf6=apiRuleToYaml(_0x196321[_0x302c2c(0xea)]);_0x3a9268[_0x302c2c(0x113)](_0x1aa2c7,_0x259bf6);const _0x5586db=collectSegmentRefsFromRule(_0x259bf6);for(const _0x4fb34d of _0x5586db){await _0x23718b(_0x4fb34d);}};for(const _0x2d7925 of _0x2e861e){await _0x23718b(_0x2d7925);}return _0x3a9268;}export function createSegmentIdResolver(_0x5b551e,_0x50277c){return async _0x511611=>{const _0x24c6cf=a119_0x1c83,_0x48d783=_0x5b551e[_0x24c6cf(0x13b)](_0x511611);if(!_0x48d783)throw new SDKError(ErrorCode[_0x24c6cf(0x14d)],_0x24c6cf(0x154)+_0x511611+_0x24c6cf(0x17e)+_0x50277c+'\x27)');return _0x48d783;};}export function extractRootFolderId(_0x275dd7){const _0x5e9a39=a119_0x43758d;return _0x275dd7[_0x5e9a39(0x105)]?.['parentSegmentFolder']?.[_0x5e9a39(0x11f)]?.['id']||_0x275dd7[_0x5e9a39(0x105)]?.[_0x5e9a39(0x101)]?.['data']?.['id'];}export function buildConnectionMaps(_0x54db24){const _0x1a3546=a119_0x43758d,_0x5e67a4=new Map(),_0x39f82c=new Map(),_0x4d62f0=new Map();for(const _0xce9a40 of _0x54db24){_0x5e67a4[_0x1a3546(0x113)](_0xce9a40[_0x1a3546(0x18f)],parseInt(_0xce9a40['id'],0xa)),_0x39f82c['set'](_0xce9a40['id'],_0xce9a40[_0x1a3546(0x18f)]),_0x4d62f0[_0x1a3546(0x113)](_0xce9a40[_0x1a3546(0x18f)],_0xce9a40[_0x1a3546(0x121)]);}return{'nameToId':_0x5e67a4,'idToName':_0x39f82c,'nameToType':_0x4d62f0};}export function calculatePushStats(_0x1969a8,_0x41ae4c,_0x95f914,_0x4174d3,_0x1147d6,_0x22e699,_0x3befab){const _0x1efe1c=a119_0x43758d,_0x3c9679=_0x1969a8[_0x1efe1c(0x179)](_0x21e323=>_0x21e323[_0x1efe1c(0xe2)]),_0x21c7b4=_0x1969a8['filter'](_0x2a29e4=>!_0x2a29e4['isNew']&&_0x2a29e4['hasChanges']),_0x313cf0=_0x1969a8['filter'](_0x38d1fd=>!_0x38d1fd[_0x1efe1c(0xe2)]&&!_0x38d1fd[_0x1efe1c(0x112)]),_0x3345aa=_0x22e699?_0x4174d3:[],_0x2d7c15=_0x41ae4c[_0x1efe1c(0x179)](_0x3e6ea7=>_0x3e6ea7[_0x1efe1c(0xe2)]),_0x1f3765=_0x41ae4c['filter'](_0xfea02=>!_0xfea02[_0x1efe1c(0xe2)]&&_0xfea02['hasChanges']),_0x9d0177=_0x41ae4c[_0x1efe1c(0x179)](_0x3229a4=>!_0x3229a4['isNew']&&!_0x3229a4[_0x1efe1c(0x112)]),_0x4431df=_0x22e699?_0x1147d6:[],_0x341937=_0x1969a8[_0x1efe1c(0x19b)](_0x2446b8=>_0x2446b8[_0x1efe1c(0xee)]),_0x1002d8=_0x341937[_0x1efe1c(0x179)](_0x21511e=>_0x21511e['type']===_0x1efe1c(0x174)),_0x37ff3b=_0x341937[_0x1efe1c(0x179)](_0x5b0777=>_0x5b0777['type']===_0x1efe1c(0x13c)),_0x55bd29=_0x341937[_0x1efe1c(0x179)](_0x2feda2=>_0x2feda2[_0x1efe1c(0x121)]===_0x1efe1c(0x166)),_0x717f22=Array[_0x1efe1c(0xe8)](_0x95f914)[_0x1efe1c(0x189)](),_0x4d5e01=_0x3befab?![]:_0x3c9679['length']>0x0||_0x21c7b4[_0x1efe1c(0x18e)]>0x0||_0x3345aa[_0x1efe1c(0x18e)]>0x0,_0x139c12=_0x2d7c15[_0x1efe1c(0x18e)]>0x0||_0x1f3765[_0x1efe1c(0x18e)]>0x0||_0x4431df[_0x1efe1c(0x18e)]>0x0,_0x2d0b30=_0x3befab?![]:_0x341937[_0x1efe1c(0x18e)]>0x0,_0x5916ed=_0x717f22[_0x1efe1c(0x18e)]>0x0;return{'segments':{'new':_0x3c9679,'changed':_0x21c7b4,'unchanged':_0x313cf0,'toDelete':_0x3345aa},'journeys':{'new':_0x2d7c15,'changed':_0x1f3765,'unchanged':_0x9d0177,'toDelete':_0x4431df},'activations':{'all':_0x341937,'toCreate':_0x1002d8,'toUpdate':_0x37ff3b,'toDelete':_0x55bd29},'folders':{'toCreate':_0x717f22},'counts':{'segments':{'new':_0x3c9679['length'],'changed':_0x21c7b4['length'],'unchanged':_0x313cf0[_0x1efe1c(0x18e)],'toDelete':_0x3345aa[_0x1efe1c(0x18e)]},'journeys':{'new':_0x2d7c15['length'],'changed':_0x1f3765['length'],'unchanged':_0x9d0177[_0x1efe1c(0x18e)],'toDelete':_0x4431df[_0x1efe1c(0x18e)]},'activations':{'create':_0x1002d8[_0x1efe1c(0x18e)],'update':_0x37ff3b[_0x1efe1c(0x18e)],'delete':_0x55bd29[_0x1efe1c(0x18e)]},'folders':_0x717f22['length']},'hasChanges':_0x4d5e01||_0x139c12||_0x2d0b30||_0x5916ed};}export async function buildPushExecutionContext(_0x42e8e8,_0x348b7a,_0x33c1a3,_0x14f13d,_0x42cbfd,_0x1290b6){const _0x1de224=a119_0x43758d,_0x48c011=extractRootFolderId(_0x33c1a3),{pathToId:_0x4b45dd,idToPath:_0x519586}=buildFolderMaps(_0x42cbfd),_0x2d3d0c=buildSegmentNameToIdMap(_0x14f13d),_0x293f3b=new Map(),{batchAsync:_0x1397c6}=await import(_0x1de224(0xd7)),[_0x26236e,_0xa320ac]=await Promise['all']([_0x42e8e8['user'][_0x1de224(0x15d)](),_0x42e8e8[_0x1de224(0xe5)][_0x1de224(0xd8)](),((async()=>{const _0x1b0481=_0x1de224;!_0x1290b6&&_0x14f13d[_0x1b0481(0x18e)]>0x0&&await _0x1397c6(_0x14f13d,async _0x42fc3c=>{const _0x20bfdd=_0x1b0481,_0x1546bb=await _0x42e8e8[_0x20bfdd(0x12b)][_0x20bfdd(0x139)](_0x348b7a,_0x42fc3c['id']);_0x293f3b[_0x20bfdd(0x113)](_0x42fc3c['id'],_0x1546bb);});})())]),{emailToId:_0x45666d,idToEmail:_0x25f2ec}=_0x26236e,_0x237a21=buildConnectionMaps(_0xa320ac);return{'rootFolderId':_0x48c011,'folderPathToId':_0x4b45dd,'folderIdToPath':_0x519586,'segmentNameToId':_0x2d3d0c,'activationsBySegmentId':_0x293f3b,'emailToIdMap':_0x45666d,'idToEmailMap':_0x25f2ec,'connectionNameToIdMap':_0x237a21['nameToId'],'connectionIdToNameMap':_0x237a21[_0x1de224(0xeb)],'connectionNameToTypeMap':_0x237a21['nameToType']};}export function createPushYamlContextForBundle(_0x15e6b2,_0x2301fd,_0x51173c,_0x571226,_0x898ed1,_0x2193a1,_0x32cb4b,_0x23bec4){const {existingLocalSegmentNames:_0xeb4943,localExpandedRuleToNames:_0x546b40}=_0x571226,_0x12b2bf=new Set(),_0x1f1f63=new Map(),_0x6a9af4=new Map(),_0x1e6c12=new Map(),_0x32e37a=createJumpTargetCache(),_0x2d2d60=new Map(),_0xcede78=new Map(),_0x1593f0=new Set();let _0x1d8bdd;const _0x3193e8=_0xf9c7f=>{const _0x24258a={'resolveSegment':async _0x477600=>{const _0x22af92=a119_0x1c83,_0x36dd52=_0x1e6c12[_0x22af92(0x13b)](_0x477600);if(_0x36dd52!==undefined)return{'name':_0x36dd52,'isJourneyLocal':!![]};try{let _0x57c53f=_0x51173c[_0x22af92(0x18d)](_0x4aae93=>_0x4aae93['id']===_0x477600);!_0x57c53f&&(_0x57c53f=await _0x15e6b2[_0x22af92(0x12b)][_0x22af92(0x131)](_0x2301fd,_0x477600));const _0x419f79=generateJourneyLocalName(_0x57c53f[_0x22af92(0x18f)]),_0x27d51d=_0x57c53f[_0x22af92(0x12a)]===SEGMENT_KIND_JOURNEY&&_0x419f79!==undefined;let _0xc0df=_0x57c53f[_0x22af92(0x18f)],_0x7c707f;if(_0x27d51d&&_0x57c53f['rule']){const _0x1dd539=apiRuleToYaml(_0x57c53f['rule']);_0xcede78['set'](_0x477600,_0x1dd539);const _0x17a1dd=async _0x1d928f=>{const _0x30a0f1=_0x22af92,_0x1a9e09=collectSegmentRefsFromRule(_0x1d928f);for(const _0x4a7eb0 of _0x1a9e09){if(!_0xcede78[_0x30a0f1(0xce)](_0x4a7eb0))try{const _0x3580f4=await _0x15e6b2[_0x30a0f1(0x12b)][_0x30a0f1(0x131)](_0x2301fd,_0x4a7eb0);if(_0x3580f4?.[_0x30a0f1(0xea)]){const _0x5cd357=apiRuleToYaml(_0x3580f4[_0x30a0f1(0xea)]);_0xcede78['set'](_0x4a7eb0,_0x5cd357),await _0x17a1dd(_0x5cd357);}}catch{}}};await _0x17a1dd(_0x1dd539);const _0x11513c=serializeExpandedRule(_0x1dd539,_0xcede78),_0x2f1b05=_0x546b40[_0x22af92(0x13b)](_0x11513c);if(_0x2f1b05&&_0x2f1b05[_0x22af92(0x18e)]>0x0){const _0x5bed9a=_0x1f1f63[_0x22af92(0x13b)](_0x11513c)||0x0,_0x1d937e=_0x2f1b05[_0x5bed9a]||_0x2f1b05[_0x2f1b05[_0x22af92(0x18e)]-0x1];_0x1f1f63[_0x22af92(0x113)](_0x11513c,_0x5bed9a+0x1),_0xc0df=_0x1d937e,_0x12b2bf[_0x22af92(0x133)](_0xc0df),_0x1e6c12[_0x22af92(0x113)](_0x477600,_0xc0df);const _0x126cd7=await resolveRuleSegmentRefs(_0x1dd539,async _0x27871b=>{const _0x307aa5=_0x22af92,_0x1039b3=_0x1e6c12['get'](_0x27871b);if(_0x1039b3)return _0x1039b3;const _0x270389=await _0x1d8bdd[_0x307aa5(0x11d)](_0x27871b);return _0x270389[_0x307aa5(0x18f)];});_0x7c707f={'description':_0x57c53f[_0x22af92(0x11a)],'rule':_0x126cd7};}else{const _0x5be40b=_0x2d2d60[_0x22af92(0x13b)](_0x11513c);if(_0x5be40b)_0xc0df=_0x5be40b,_0x1e6c12[_0x22af92(0x113)](_0x477600,_0xc0df);else{if(_0x419f79){let _0x16cccb=_0x419f79,_0x97c4b5=0x2;while(_0x12b2bf['has'](_0x16cccb)||_0xeb4943[_0x22af92(0xce)](_0x16cccb)){_0x16cccb=_0x419f79+'_'+_0x97c4b5,_0x97c4b5++;}_0x12b2bf['add'](_0x16cccb),_0xc0df=_0x16cccb;}_0x1e6c12['set'](_0x477600,_0xc0df),_0x2d2d60[_0x22af92(0x113)](_0x11513c,_0xc0df);const _0x267b67=await resolveRuleSegmentRefs(_0x1dd539,async _0xf94fe2=>{const _0x34bf90=_0x22af92,_0x54b1c9=_0x1e6c12[_0x34bf90(0x13b)](_0xf94fe2);if(_0x54b1c9)return _0x54b1c9;const _0x455aae=await _0x1d8bdd[_0x34bf90(0x11d)](_0xf94fe2);return _0x455aae[_0x34bf90(0x18f)];});_0x7c707f={'description':_0x57c53f[_0x22af92(0x11a)],'rule':_0x267b67};}}}return{'name':_0xc0df,'isJourneyLocal':_0x27d51d,'definition':_0x7c707f};}catch{return{'name':_0x477600,'isJourneyLocal':![]};}},'resolveActivation':async _0x4f2d1e=>{const _0x13a2c0=a119_0x1c83,_0x32bb66=_0x6a9af4[_0x13a2c0(0x13b)](_0x4f2d1e);if(_0x32bb66!==undefined)return{'name':_0x32bb66,'isJourneyLocal':!![]};try{let _0x125199=_0x32cb4b?.['get'](_0x4f2d1e);!_0x125199&&(_0x125199=await _0x15e6b2[_0x13a2c0(0x1a0)]['getActivation'](_0xf9c7f,_0x4f2d1e));const _0x1bb0e7=_0x125199[_0x13a2c0(0x125)][_0x13a2c0(0x185)][_0x13a2c0(0x18f)]||_0x4f2d1e,_0x3accf1=sanitizeYamlKey(_0x1bb0e7)||'activation_'+_0x4f2d1e,_0x30017f=_0x3accf1;_0x6a9af4[_0x13a2c0(0x113)](_0x4f2d1e,_0x30017f);const _0x736b8d=journeyActivationStepToYaml(_0x125199,_0x898ed1,_0x2193a1);return{'name':_0x30017f,'isJourneyLocal':!![],'definition':_0x736b8d};}catch{return{'name':_0x4f2d1e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x41cf87,_0x4f0a9d)=>resolveJumpTarget(_0x41cf87,_0x4f0a9d,_0x32e37a,async _0x5c8453=>{const _0x23fbe6=a119_0x1c83,_0x25e811=_0x23bec4?.[_0x23fbe6(0x13b)](_0x5c8453);if(_0x25e811)return _0x25e811;return _0x15e6b2[_0x23fbe6(0x1a0)]['getJourney'](_0x5c8453);})};return _0x1d8bdd=_0x24258a,_0x24258a;},_0x4e6479=async _0x27a919=>{const _0x4bb712=a119_0x1c83,{collectSegmentIdsFromJourneyApi:_0x42f1c9}=await import(_0x4bb712(0x19a)),{batchAsync:_0x3056e5}=await import('../../utils/async.js'),_0x5509bc=new Set();for(const _0x1d2067 of _0x27a919){let _0x2c24de=_0x23bec4?.[_0x4bb712(0x13b)](_0x1d2067);!_0x2c24de&&(_0x2c24de=await _0x15e6b2['journey'][_0x4bb712(0x115)](_0x1d2067));const _0x7dae=_0x42f1c9(_0x2c24de);for(const _0x43a697 of _0x7dae){_0x5509bc['add'](_0x43a697);}}let _0x554aba=Array[_0x4bb712(0xe8)](_0x5509bc);while(_0x554aba['length']>0x0){const _0x4d92df=_0x554aba['filter'](_0x3be8c7=>!_0x1593f0[_0x4bb712(0xce)](_0x3be8c7));if(_0x4d92df[_0x4bb712(0x18e)]===0x0)break;const _0xf94756=await _0x3056e5(_0x4d92df,async _0x173a6a=>{const _0x212fa1=_0x4bb712;_0x1593f0[_0x212fa1(0x133)](_0x173a6a);let _0x3cbcc0=_0x51173c[_0x212fa1(0x18d)](_0x2515ee=>_0x2515ee['id']===_0x173a6a);if(!_0x3cbcc0)try{_0x3cbcc0=await _0x15e6b2[_0x212fa1(0x12b)][_0x212fa1(0x131)](_0x2301fd,_0x173a6a);}catch{return null;}return{'segmentId':_0x173a6a,'segment':_0x3cbcc0};},0xa),_0x2cbc0b=new Set();for(const _0x259f30 of _0xf94756){if(!_0x259f30?.[_0x4bb712(0x12b)]?.[_0x4bb712(0xea)])continue;const _0x3d4a97=apiRuleToYaml(_0x259f30['segment'][_0x4bb712(0xea)]);_0xcede78[_0x4bb712(0x113)](_0x259f30[_0x4bb712(0x160)],_0x3d4a97);const _0x2c83fb=collectSegmentRefsFromRule(_0x3d4a97);for(const _0x4289db of _0x2c83fb){!_0x1593f0[_0x4bb712(0xce)](_0x4289db)&&_0x2cbc0b[_0x4bb712(0x133)](_0x4289db);}}_0x554aba=Array[_0x4bb712(0xe8)](_0x2cbc0b);}};return{'createYamlContext':_0x3193e8,'prefetchJourneySegments':_0x4e6479};}export async function executePushSegments(_0x20ede2,_0x2c3e3a,_0x49bbe2,_0x10aecd,_0x39805a){const _0x1d2575=a119_0x43758d,{segmentDefToCreateRequest:_0x16e030,segmentDefToUpdateRequest:_0x1d7a3d}=await import(_0x1d2575(0x118)),_0x5dff40=_0x49bbe2[_0x1d2575(0x148)],_0xaf298a=0x5,_0x4b9dd0=async _0x22502f=>{const _0x158159=_0x1d2575,_0x544a2c=_0x22502f['folderPath']?_0x5dff40[_0x158159(0x13b)](_0x22502f[_0x158159(0x187)]):undefined;let _0x43336b;const _0x18ebb7={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x22502f[_0x158159(0xe2)]){_0x39805a[_0x158159(0x108)]?.({'type':_0x158159(0x106),'name':_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]});const _0x3391cc=_0x16e030(_0x22502f[_0x158159(0x152)],_0x544a2c),_0x551ce8=await _0x39805a[_0x158159(0xf3)](_0x158159(0x184)+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27...',()=>_0x20ede2[_0x158159(0x12b)][_0x158159(0xe4)](_0x10aecd[_0x158159(0xdc)],_0x3391cc));_0x43336b=_0x551ce8['data']['id'],_0x18ebb7['createdSegmentId']={'name':_0x22502f[_0x158159(0x152)]['name'],'id':_0x43336b},_0x39805a['onProgress']?.({'type':'segment_created','name':_0x22502f[_0x158159(0x152)]['name'],'segmentId':_0x43336b}),_0x39805a[_0x158159(0xc4)]?.('Created\x20segment\x20\x27'+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27'),_0x18ebb7[_0x158159(0x15c)]=0x1;}else{if(_0x22502f['hasChanges']){_0x39805a[_0x158159(0x108)]?.({'type':_0x158159(0xcd),'name':_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]});const _0x4fd16d=_0x1d7a3d(_0x22502f[_0x158159(0x152)]);_0x544a2c!==_0x22502f[_0x158159(0x102)]?.[_0x158159(0x146)]&&(_0x4fd16d[_0x158159(0x146)]=_0x544a2c?parseInt(_0x544a2c,0xa):undefined),await _0x39805a[_0x158159(0xf3)]('Updating\x20segment\x20\x27'+_0x22502f['yamlConfig'][_0x158159(0x18f)]+_0x158159(0x175),()=>_0x20ede2[_0x158159(0x12b)][_0x158159(0x182)](_0x10aecd[_0x158159(0xdc)],_0x22502f[_0x158159(0x102)]['id'],_0x4fd16d)),_0x43336b=_0x22502f[_0x158159(0x102)]['id'],_0x39805a[_0x158159(0x108)]?.({'type':'segment_updated','name':_0x22502f[_0x158159(0x152)]['name']}),_0x39805a[_0x158159(0xc4)]?.(_0x158159(0x169)+_0x22502f[_0x158159(0x152)][_0x158159(0x18f)]+'\x27'),_0x18ebb7['updated']=0x1;}else _0x43336b=_0x22502f[_0x158159(0x102)]['id'];}}catch(_0x2ce552){const _0x55c1b7=isHttp400Error(_0x2ce552),_0x3490d7=_0x55c1b7?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x226ee8=getErrorMessage(_0x2ce552);throw new SDKError(_0x3490d7,'Failed\x20to\x20'+(_0x22502f[_0x158159(0xe2)]?_0x158159(0x174):_0x158159(0x13c))+'\x20segment\x20from\x20file:\x20'+_0x22502f[_0x158159(0x170)]+_0x158159(0x16e)+_0x226ee8,_0x2ce552);}try{const _0x549c0e=await syncActivationsForSegment(_0x20ede2,_0x10aecd['parentId'],_0x43336b,_0x22502f['yamlConfig'][_0x158159(0x18f)],_0x22502f[_0x158159(0xee)],_0x39805a,_0x22502f[_0x158159(0x170)]);_0x18ebb7[_0x158159(0x156)]=_0x549c0e;}catch(_0x4ebeaa){if(_0x4ebeaa instanceof SDKError)throw _0x4ebeaa;throw new SDKError(ErrorCode[_0x158159(0x10e)],_0x158159(0xe6)+_0x22502f[_0x158159(0x152)]['name']+_0x158159(0x19f)+_0x22502f['absolutePath']+_0x158159(0x16e)+getErrorMessage(_0x4ebeaa),_0x4ebeaa);}return _0x18ebb7;},_0x36ecea=await batchAsync(_0x2c3e3a,_0x4b9dd0,_0xaf298a),_0x2ddeab={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5c7fea of _0x36ecea){_0x2ddeab[_0x1d2575(0x15c)]+=_0x5c7fea[_0x1d2575(0x15c)],_0x2ddeab[_0x1d2575(0x120)]+=_0x5c7fea[_0x1d2575(0x120)],_0x5c7fea['createdSegmentId']&&_0x2ddeab[_0x1d2575(0x190)][_0x1d2575(0x113)](_0x5c7fea[_0x1d2575(0xd2)][_0x1d2575(0x18f)],_0x5c7fea['createdSegmentId']['id']),_0x2ddeab[_0x1d2575(0x156)][_0x1d2575(0x15c)]+=_0x5c7fea['activations'][_0x1d2575(0x15c)],_0x2ddeab[_0x1d2575(0x156)]['updated']+=_0x5c7fea['activations'][_0x1d2575(0x120)],_0x2ddeab['activations'][_0x1d2575(0x153)]+=_0x5c7fea[_0x1d2575(0x156)][_0x1d2575(0x153)];}return _0x2ddeab;}async function syncActivationsForSegment(_0x4d4eaa,_0x1815f0,_0x388242,_0x5dcad3,_0x318b1d,_0x50a865,_0x1675bb){const _0xd8a467=a119_0x43758d,_0x19a0b7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x6605df of _0x318b1d){try{if(_0x6605df['type']===_0xd8a467(0x174)&&_0x6605df[_0xd8a467(0xd3)])_0x50a865['onProgress']?.({'type':'activation_creating','segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),await _0x50a865[_0xd8a467(0xf3)]('Creating\x20activation\x20\x27'+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x175),()=>_0x4d4eaa[_0xd8a467(0x12b)][_0xd8a467(0x14b)](_0x1815f0,_0x388242,_0x6605df[_0xd8a467(0xd3)])),_0x50a865[_0xd8a467(0x108)]?.({'type':_0xd8a467(0x159),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc4)]?.(_0xd8a467(0xff)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7[_0xd8a467(0x15c)]++;else{if(_0x6605df[_0xd8a467(0x121)]===_0xd8a467(0x13c)&&_0x6605df[_0xd8a467(0xd3)]&&_0x6605df[_0xd8a467(0x114)])_0x50a865['onProgress']?.({'type':_0xd8a467(0x178),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),await _0x50a865[_0xd8a467(0xf3)](_0xd8a467(0x167)+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x175),()=>_0x4d4eaa[_0xd8a467(0x12b)][_0xd8a467(0x135)](_0x1815f0,_0x388242,_0x6605df['existingActivation']['id'],_0x6605df[_0xd8a467(0xd3)])),_0x50a865[_0xd8a467(0x108)]?.({'type':'activation_updated','segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc4)]?.(_0xd8a467(0xe3)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7['updated']++;else _0x6605df['type']===_0xd8a467(0x166)&&_0x6605df[_0xd8a467(0x114)]&&(_0x50a865[_0xd8a467(0x108)]?.({'type':'activation_deleting','segmentName':_0x5dcad3,'activationName':_0x6605df['name']}),await _0x50a865[_0xd8a467(0xf3)](_0xd8a467(0x165)+_0x6605df['name']+'\x27...',()=>_0x4d4eaa['segment'][_0xd8a467(0xef)](_0x1815f0,_0x388242,_0x6605df[_0xd8a467(0x114)]['id'])),_0x50a865[_0xd8a467(0x108)]?.({'type':_0xd8a467(0x150),'segmentName':_0x5dcad3,'activationName':_0x6605df[_0xd8a467(0x18f)]}),_0x50a865[_0xd8a467(0xc2)]?.(_0xd8a467(0x18b)+_0x6605df[_0xd8a467(0x18f)]+'\x27'),_0x19a0b7[_0xd8a467(0x153)]++);}}catch(_0x87d773){const _0x283472=isHttp400Error(_0x87d773),_0x1baf0b=_0x283472?ErrorCode[_0xd8a467(0x18a)]:ErrorCode[_0xd8a467(0x10e)],_0x342bf3=getErrorMessage(_0x87d773);throw new SDKError(_0x1baf0b,_0xd8a467(0x161)+_0x6605df[_0xd8a467(0x121)]+'\x20activation\x20\x27'+_0x6605df[_0xd8a467(0x18f)]+_0xd8a467(0x19f)+_0x1675bb+_0xd8a467(0x16e)+_0x342bf3,_0x87d773);}}return _0x19a0b7;}export async function executePushFolders(_0x29d616,_0x488ac2,_0x390827,_0x3835b9,_0x1689b5){const _0x2691c7=a119_0x43758d,_0x43e518=new Map(_0x390827);for(const _0x117528 of _0x488ac2){const _0x548dc4=_0x117528[_0x2691c7(0x107)]('/'),_0x3f31ce=_0x548dc4[_0x548dc4[_0x2691c7(0x18e)]-0x1],_0x146753=_0x548dc4[_0x2691c7(0x129)](0x0,-0x1)[_0x2691c7(0xf8)]('/'),_0x9586f=_0x43e518['get'](_0x146753);_0x1689b5[_0x2691c7(0x108)]?.({'type':'folder_creating','folder':_0x117528});const _0x327e78={'name':_0x3f31ce,'parentFolderId':_0x9586f},_0x429aa6=await _0x1689b5[_0x2691c7(0xf3)](_0x2691c7(0x176)+_0x117528+_0x2691c7(0x175),()=>_0x29d616['segment'][_0x2691c7(0xc1)](_0x3835b9[_0x2691c7(0xdc)],_0x327e78));_0x43e518['set'](_0x117528,_0x429aa6[_0x2691c7(0x11f)]['id']),_0x1689b5[_0x2691c7(0x108)]?.({'type':_0x2691c7(0x157),'folder':_0x117528,'folderId':_0x429aa6[_0x2691c7(0x11f)]['id']}),_0x1689b5[_0x2691c7(0x134)]?.(_0x2691c7(0x17f)+_0x117528+'\x27');}return _0x43e518;}export async function executePushSegmentDeletions(_0x3362db,_0x1deaf6,_0x4e4182){const _0x97646d=a119_0x43758d;if(_0x1deaf6[_0x97646d(0x18e)]===0x0)return 0x0;const {batchAsync:_0x12ac5b}=await import(_0x97646d(0xd7)),_0x49fcf8=0x5,_0x10ea73=await _0x12ac5b(_0x1deaf6,async _0xb4c8e8=>{const _0x419498=_0x97646d;return _0x4e4182[_0x419498(0x108)]?.({'type':_0x419498(0x13f),'name':_0xb4c8e8['name']}),await _0x3362db[_0x419498(0x12b)][_0x419498(0xfe)](_0xb4c8e8['id']),_0x4e4182[_0x419498(0x108)]?.({'type':_0x419498(0xf5),'name':_0xb4c8e8['name']}),_0x4e4182[_0x419498(0xc2)]?.('Deleted\x20segment\x20\x27'+_0xb4c8e8[_0x419498(0x18f)]+'\x27'),0x1;},_0x49fcf8);return _0x10ea73[_0x97646d(0x136)]((_0x98658,_0x114b0c)=>_0x98658+_0x114b0c,0x0);}export async function executePushJourneys(_0x31575f,_0x4e3120,_0xee3e3a,_0x184379,_0x1a368c){const _0x2178a9=a119_0x43758d,{journeyDefToRequest:_0x67097c}=await import(_0x2178a9(0x19a)),{activationDefToCreateRequest:_0x5de3d0,yamlRuleToApi:_0x2d3f50,validateSegmentRule:_0x4ac4cd}=await import(_0x2178a9(0x118)),_0x481ffd={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x96491b=new Map(_0xee3e3a[_0x2178a9(0xe7)]),_0x748a68=0x5;for(let _0x376c18=0x0;_0x376c18<_0x4e3120['length'];_0x376c18+=_0x748a68){const _0x9d6e96=_0x4e3120[_0x2178a9(0x129)](_0x376c18,_0x376c18+_0x748a68),_0x5d3a91=await Promise['all'](_0x9d6e96['map'](async _0x114992=>{const _0x58800d=_0x2178a9;if(!_0x114992['isNew']&&!_0x114992['hasChanges'])return{'action':'unchanged','name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x114992[_0x58800d(0xca)]?.['id']};const _0x1aac0e=_0x114992['folderPath']?_0xee3e3a[_0x58800d(0x148)][_0x58800d(0x13b)](_0x114992[_0x58800d(0x187)]):undefined;_0x1a368c[_0x58800d(0x108)]?.({'type':_0x114992['isNew']?'journey_creating':'journey_updating','name':_0x114992['yamlConfig'][_0x58800d(0x18f)]});try{const _0x39deac=await executeSingleJourneyPush(_0x31575f,_0x114992,{..._0xee3e3a,'segmentNameToId':_0x96491b},{'parentId':_0x184379['parentId'],'rootFolderId':_0x184379[_0x58800d(0x117)],'folderId':_0x1aac0e,'verbose':_0x184379[_0x58800d(0x11c)]},_0x1a368c,{'journeyDefToRequest':_0x67097c,'activationDefToCreateRequest':_0x5de3d0,'yamlRuleToApi':_0x2d3f50,'validateSegmentRule':_0x4ac4cd});for(const [_0x271f28,_0x5b18d2]of _0x39deac[_0x58800d(0xd9)]){_0x96491b['set'](_0x271f28,_0x5b18d2),_0x481ffd[_0x58800d(0xd9)]['set'](_0x271f28,_0x5b18d2);}if(_0x39deac['action']===_0x58800d(0x15c))_0x1a368c['onProgress']?.({'type':'journey_created','name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x39deac[_0x58800d(0x14a)]}),_0x1a368c[_0x58800d(0xc4)]?.(_0x58800d(0x13e)+_0x114992[_0x58800d(0x152)]['name']+'\x27'),_0x481ffd[_0x58800d(0x15c)]++;else _0x39deac[_0x58800d(0x130)]===_0x58800d(0x120)&&(_0x1a368c[_0x58800d(0x108)]?.({'type':_0x58800d(0x191),'name':_0x114992['yamlConfig']['name']}),_0x1a368c['logSuccess']?.(_0x58800d(0x16c)+_0x114992['yamlConfig']['name']+'\x27'),_0x481ffd[_0x58800d(0x120)]++);return{'action':_0x39deac['action'],'name':_0x114992[_0x58800d(0x152)][_0x58800d(0x18f)],'journeyId':_0x39deac[_0x58800d(0x14a)]};}catch(_0x57ab4d){const _0x2a3c26=isHttp400Error(_0x57ab4d),_0x1362db=_0x2a3c26?ErrorCode[_0x58800d(0x1a2)]:ErrorCode[_0x58800d(0xfd)],_0x591274=getErrorMessage(_0x57ab4d);throw new SDKError(_0x1362db,_0x58800d(0x161)+(_0x114992[_0x58800d(0xe2)]?_0x58800d(0x174):_0x58800d(0x13c))+_0x58800d(0x147)+_0x114992[_0x58800d(0x170)]+'\x0a\x20\x20'+_0x591274,_0x57ab4d);}}));_0x481ffd[_0x2178a9(0x16a)][_0x2178a9(0xc8)](..._0x5d3a91);}return _0x481ffd;}async function executeSingleJourneyPush(_0x511993,_0x1ca6f9,_0x2565a4,_0x6d88d1,_0x1b6963,_0x40b998){const _0x5d3215=a119_0x43758d,{journeyDefToRequest:_0x43019d,activationDefToCreateRequest:_0x13a9c9,yamlRuleToApi:_0x4ad144,validateSegmentRule:_0x1c53e2}=_0x40b998,_0x10020a=new Map(),_0x10d667=new Map(),_0x283085=new Map(),_0x1c7694=new Map(),_0x40f193=new Map();let _0x25e585;const _0x5a321e=async()=>{const _0x3ec7f8=a119_0x1c83;if(_0x25e585)return;_0x25e585=new Map();if(!_0x1ca6f9['existingJourney'])return;const _0x4935b0=await _0x511993['journey']['listActivations'](_0x1ca6f9[_0x3ec7f8(0xca)]['id']);for(const _0x304d4c of _0x4935b0){const _0x18736d=journeyActivationStepToYaml(_0x304d4c,_0x2565a4['idToEmailMap'],_0x2565a4[_0x3ec7f8(0x132)]),_0x1404d8=activationSignature(_0x18736d);!_0x25e585['has'](_0x1404d8)&&_0x25e585['set'](_0x1404d8,_0x304d4c['id']),_0x18736d[_0x3ec7f8(0x18f)]&&_0x10d667['set'](_0x18736d[_0x3ec7f8(0x18f)],_0x304d4c['id']);}};if(_0x1ca6f9[_0x5d3215(0xca)]&&_0x1ca6f9[_0x5d3215(0x152)]['segments']){const _0xd72da5=buildLocalExpandedRuleMappings(_0x1ca6f9[_0x5d3215(0x152)]),_0x495661=_0xd72da5[_0x5d3215(0x12e)];if(_0x495661[_0x5d3215(0xd1)]>0x0){const _0x51acfc=new Map();for(const [_0x5e11ca,_0x31b7e0]of _0x495661){const _0x1ff5da=serializeExpandedRule(_0x31b7e0,_0x495661);_0x51acfc[_0x5d3215(0x113)](_0x5e11ca,_0x1ff5da);}const _0x33cd73=collectSegmentIdsFromJourneyApi(_0x1ca6f9[_0x5d3215(0xca)]);if(_0x33cd73[_0x5d3215(0xd1)]>0x0){const _0x56c2c4=await buildServerSegmentRuleMap(_0x511993,_0x6d88d1[_0x5d3215(0xdc)],_0x2565a4[_0x5d3215(0x10b)],_0x33cd73);if(_0x56c2c4[_0x5d3215(0xd1)]>0x0){const _0x33a92f=new Map();for(const [_0x59e2dc,_0xacc1c8]of _0x56c2c4){const _0xf9cfdf=serializeExpandedRule(_0xacc1c8,_0x56c2c4);!_0x33a92f[_0x5d3215(0xce)](_0xf9cfdf)&&_0x33a92f[_0x5d3215(0x113)](_0xf9cfdf,_0x59e2dc);}for(const [_0xe391d7,_0x8c58a]of _0x51acfc){const _0x36f6aa=_0x33a92f['get'](_0x8c58a);_0x36f6aa&&(_0x40f193[_0x5d3215(0x113)](_0xe391d7,_0x36f6aa),_0x2565a4[_0x5d3215(0xe7)]['set'](_0xe391d7,_0x36f6aa));}}}}}const _0x38629a={'resolveSegmentId':async _0x3386df=>{const _0x3337a5=_0x5d3215,_0x42a4f1=_0x2565a4[_0x3337a5(0xe7)][_0x3337a5(0x13b)](_0x3386df);if(!_0x42a4f1)throw new SDKError(ErrorCode[_0x3337a5(0x14d)],_0x3337a5(0x154)+_0x3386df+_0x3337a5(0x16b)+_0x1ca6f9[_0x3337a5(0x152)][_0x3337a5(0x18f)]+')');return _0x42a4f1;},'resolveEmbeddedSegmentId':async(_0x2de0fb,_0x15c308)=>{const _0x22c931=_0x5d3215,_0x38fdcc=_0x2565a4[_0x22c931(0xe7)][_0x22c931(0x13b)](_0x2de0fb);if(_0x38fdcc)return _0x38fdcc;const _0x5993e5=_0x40f193[_0x22c931(0x13b)](_0x2de0fb);if(_0x5993e5)return _0x2565a4[_0x22c931(0xe7)][_0x22c931(0x113)](_0x2de0fb,_0x5993e5),_0x5993e5;const _0xebf4b2=_0x2565a4['existingSegments'][_0x22c931(0x18d)](_0x4e86a7=>_0x4e86a7['name']===_0x2de0fb);if(_0xebf4b2)return _0x2565a4[_0x22c931(0xe7)][_0x22c931(0x113)](_0x2de0fb,_0xebf4b2['id']),_0xebf4b2['id'];if(_0x1ca6f9[_0x22c931(0xe2)]){const {stageName:_0x36e8e3,criteriaName:_0x5639c3}=findSegmentCriteriaLocation(_0x1ca6f9['yamlConfig'],_0x2de0fb);return _0x1c53e2(_0x2de0fb,_0x15c308[_0x22c931(0xea)]),_0x283085[_0x22c931(0x113)](_0x2de0fb,{'definition':_0x15c308,'stageName':_0x36e8e3,'criteriaName':_0x5639c3}),createPendingSegmentId(_0x2de0fb);}const _0x359a31=_0x1ca6f9[_0x22c931(0xca)]?.['id'];if(!_0x359a31)throw new SDKError(ErrorCode[_0x22c931(0x158)],_0x22c931(0x15e));_0x1c53e2(_0x2de0fb,_0x15c308[_0x22c931(0xea)]);const _0x176bfa=generateDeterministicJourneySegmentName(_0x1ca6f9['yamlConfig'][_0x22c931(0x18f)],_0x2de0fb),_0x2ba379=_0x2565a4[_0x22c931(0x10b)][_0x22c931(0x18d)](_0x52e61c=>_0x52e61c['name']===_0x176bfa),_0x28f2c4=createSegmentIdResolver(_0x2565a4[_0x22c931(0xe7)],_0x2de0fb),_0x26616b=await resolveRuleSegmentIds(_0x15c308[_0x22c931(0xea)],_0x28f2c4);let _0x4f952a;if(_0x2ba379)await _0x511993[_0x22c931(0x12b)][_0x22c931(0x182)](_0x6d88d1[_0x22c931(0xdc)],_0x2ba379['id'],{'description':_0x15c308['description']||_0x22c931(0x110)+_0x2de0fb,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![]}),_0x4f952a=_0x2ba379['id'];else try{_0x4f952a=await _0x511993[_0x22c931(0x12b)][_0x22c931(0x143)]({'name':_0x176bfa,'description':_0x15c308[_0x22c931(0x11a)]||_0x22c931(0x110)+_0x2de0fb,'journeyId':_0x359a31,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![],'parentFolderId':_0x6d88d1['rootFolderId']||'','audienceId':_0x6d88d1[_0x22c931(0xdc)]});}catch(_0x5c0802){const _0x5385de=_0x5c0802 instanceof Error&&_0x5c0802[_0x22c931(0xf1)][_0x22c931(0xe9)](_0x22c931(0x142));if(_0x5385de){const _0x34bd74=await _0x511993[_0x22c931(0x12b)][_0x22c931(0x11b)](_0x6d88d1[_0x22c931(0xdc)]),_0x39a6d4=_0x34bd74['find'](_0x476aed=>_0x476aed[_0x22c931(0x18f)]===_0x176bfa);if(_0x39a6d4)await _0x511993[_0x22c931(0x12b)][_0x22c931(0x182)](_0x6d88d1['parentId'],_0x39a6d4['id'],{'description':_0x15c308[_0x22c931(0x11a)]||_0x22c931(0x110)+_0x2de0fb,'rule':_0x4ad144(_0x26616b,!![]),'countPopulation':!![]}),_0x4f952a=_0x39a6d4['id'];else throw _0x5c0802;}else throw _0x5c0802;}return _0x2565a4[_0x22c931(0xe7)]['set'](_0x2de0fb,_0x4f952a),_0x10020a[_0x22c931(0x113)](_0x2de0fb,_0x4f952a),_0x4f952a;},'resolveActivationId':async _0xc8ea7e=>{const _0x512862=_0x5d3215,_0x36b5cd=_0x10d667[_0x512862(0x13b)](_0xc8ea7e);if(_0x36b5cd)return _0x36b5cd;if(_0x1ca6f9['existingJourney']){await _0x5a321e();const _0x47719b=_0x10d667[_0x512862(0x13b)](_0xc8ea7e);if(_0x47719b)return _0x47719b;}throw new SDKError(ErrorCode[_0x512862(0x13d)],_0x512862(0xc6)+_0xc8ea7e+_0x512862(0x16b)+_0x1ca6f9[_0x512862(0x152)][_0x512862(0x18f)]+').\x20'+_0x512862(0x17c));},'resolveEmbeddedActivationId':async(_0x4cf26e,_0x1ac26e)=>{const _0x24ee75=_0x5d3215,_0x5c608d=_0x10d667[_0x24ee75(0x13b)](_0x4cf26e);if(_0x5c608d)return _0x5c608d;if(_0x1ca6f9[_0x24ee75(0xe2)])return _0x1c7694[_0x24ee75(0x113)](_0x4cf26e,_0x1ac26e),createPendingActivationId(_0x4cf26e);if(_0x1ca6f9[_0x24ee75(0xca)]){await _0x5a321e();const _0x593018=_0x10d667[_0x24ee75(0x13b)](_0x1ac26e[_0x24ee75(0x18f)]);if(_0x593018)return _0x10d667[_0x24ee75(0x113)](_0x4cf26e,_0x593018),_0x593018;const _0x4bf7be=activationSignature(_0x1ac26e),_0x27eed2=_0x25e585?.[_0x24ee75(0x13b)](_0x4bf7be);if(_0x27eed2)return _0x10d667['set'](_0x4cf26e,_0x27eed2),_0x27eed2;const _0x499a51=await _0x13a9c9(_0x1ac26e,_0x2565a4[_0x24ee75(0x177)]),_0x531eba=await _0x511993['journey'][_0x24ee75(0x14b)](_0x1ca6f9[_0x24ee75(0xca)]['id'],_0x499a51);return _0x10d667[_0x24ee75(0x113)](_0x4cf26e,_0x531eba['id']),_0x531eba['id'];}throw new SDKError(ErrorCode[_0x24ee75(0x158)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x47bb26=>{const _0x49764f=_0x5d3215;try{return await _0x511993[_0x49764f(0x1a0)]['resolveJourneyId'](_0x6d88d1[_0x49764f(0xdc)],_0x47bb26);}catch(_0x488ecf){throw new SDKError(ErrorCode[_0x49764f(0x13d)],_0x49764f(0x10c)+_0x47bb26+_0x49764f(0xc7)+_0x1ca6f9[_0x49764f(0x152)][_0x49764f(0x18f)]+'\x27)',_0x488ecf);}},'resolveStageId':async(_0x598cff,_0x94efcc)=>{const _0x590cfc=_0x5d3215,_0x532620=await _0x511993[_0x590cfc(0x1a0)][_0x590cfc(0x115)](_0x598cff),_0x255fc8=_0x532620[_0x590cfc(0x125)]['journeyStages'][_0x590cfc(0x18d)](_0x5610f8=>_0x5610f8['name']['toLowerCase']()===_0x94efcc[_0x590cfc(0x18c)]());if(!_0x255fc8?.['id'])throw new SDKError(ErrorCode[_0x590cfc(0x13d)],_0x590cfc(0x195)+_0x94efcc+_0x590cfc(0x123)+(_0x532620[_0x590cfc(0x125)][_0x590cfc(0x186)]||_0x532620[_0x590cfc(0x125)][_0x590cfc(0x18f)])+'\x27');return _0x255fc8['id'];}},_0x2a3994=await _0x43019d(_0x1ca6f9[_0x5d3215(0x152)],_0x6d88d1[_0x5d3215(0xdc)],_0x38629a),_0x1cbd91=_0x6d88d1[_0x5d3215(0xcb)]||_0x6d88d1[_0x5d3215(0x117)];_0x1cbd91&&(_0x2a3994['relationships']={'parentFolder':{'data':{'id':_0x1cbd91,'type':_0x5d3215(0xdd)}}});if(_0x1ca6f9['isNew']){if(_0x283085[_0x5d3215(0xd1)]>0x0||_0x1c7694['size']>0x0)return await executeThreeStepJourneyCreate(_0x511993,_0x1ca6f9,_0x2a3994,{'pendingEmbeddedSegments':_0x283085,'pendingEmbeddedActivations':_0x1c7694,'embeddedSegmentNameToId':_0x10020a,'journeyActivationNameToId':_0x10d667},{..._0x6d88d1,'effectiveFolderId':_0x1cbd91},_0x2565a4,_0x1b6963,_0x40b998);else{ensureJourneyDefaults(_0x2a3994[_0x5d3215(0x125)]);const _0x49f59a=await _0x511993[_0x5d3215(0x1a0)][_0x5d3215(0x174)](_0x2a3994);return{'action':_0x5d3215(0x15c),'journeyId':_0x49f59a['id'],'embeddedSegmentNameToId':_0x10020a};}}else{if(_0x1ca6f9[_0x5d3215(0x112)]&&_0x1ca6f9['existingJourney'])return ensureJourneyDefaults(_0x2a3994['attributes']),await _0x511993[_0x5d3215(0x1a0)][_0x5d3215(0x13c)](_0x1ca6f9[_0x5d3215(0xca)]['id'],_0x2a3994),{'action':_0x5d3215(0x120),'journeyId':_0x1ca6f9['existingJourney']['id'],'embeddedSegmentNameToId':_0x10020a};}return{'action':_0x5d3215(0x12c),'journeyId':_0x1ca6f9['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x10020a};}function findSegmentCriteriaLocation(_0x39814c,_0x5c63bb){const _0x5ef1c1=a119_0x43758d,_0x4d259f=_0x39814c[_0x5ef1c1(0xd0)]||_0x39814c[_0x5ef1c1(0x155)]?.[0x0]?.[_0x5ef1c1(0xd0)]||[];let _0x26114f=_0x5ef1c1(0x104),_0x5dcbdd=_0x5c63bb;const _0x104a6f=_0x39814c[_0x5ef1c1(0x163)]||_0x39814c[_0x5ef1c1(0x155)]?.[0x0]?.[_0x5ef1c1(0x163)];if(_0x104a6f?.['segment']===_0x5c63bb)return{'stageName':'goal','criteriaName':_0x104a6f['name']||_0x5c63bb};_0x5c6647:for(const _0x270a01 of _0x4d259f){if(_0x270a01[_0x5ef1c1(0x19e)]?.['segment']===_0x5c63bb){_0x26114f=_0x270a01[_0x5ef1c1(0x18f)],_0x5dcbdd=_0x270a01[_0x5ef1c1(0x19e)][_0x5ef1c1(0x18f)]||_0x5c63bb;break;}if(_0x270a01[_0x5ef1c1(0x151)])for(const _0x179644 of _0x270a01[_0x5ef1c1(0x151)]){if(_0x179644['type']==='decision_point'&&_0x179644[_0x5ef1c1(0x173)]?.[_0x5ef1c1(0x141)])for(const _0x144f44 of _0x179644['with'][_0x5ef1c1(0x141)]){if(_0x144f44[_0x5ef1c1(0x12b)]===_0x5c63bb){_0x26114f=_0x270a01[_0x5ef1c1(0x18f)],_0x5dcbdd=_0x144f44[_0x5ef1c1(0x18f)]||_0x5c63bb;break _0x5c6647;}}}}return{'stageName':_0x26114f,'criteriaName':_0x5dcbdd};}async function executeThreeStepJourneyCreate(_0x2b548d,_0x9cf8f9,_0x24184d,_0x1e15b3,_0x23df1e,_0x16f27a,_0x317e54,_0x53226a){const _0x1a44f2=a119_0x43758d,{activationDefToCreateRequest:_0x26d1e8,yamlRuleToApi:_0x228c48}=_0x53226a,{pendingEmbeddedSegments:_0x22299b,pendingEmbeddedActivations:_0x24e6f2,embeddedSegmentNameToId:_0x2b757f}=_0x1e15b3,_0xb1b1e2=JSON[_0x1a44f2(0x198)](JSON[_0x1a44f2(0x144)](_0x24184d));ensureJourneyDefaults(_0xb1b1e2[_0x1a44f2(0x125)]),stripPendingIds(_0xb1b1e2);const _0x27dacd=await _0x2b548d[_0x1a44f2(0x1a0)][_0x1a44f2(0x174)](_0xb1b1e2),_0x397483=_0x27dacd['id'],_0x1420e0=new Map();for(const _0x368789 of _0x27dacd[_0x1a44f2(0x125)][_0x1a44f2(0x168)]){_0x1420e0[_0x1a44f2(0x113)](_0x368789[_0x1a44f2(0x18f)][_0x1a44f2(0x18c)](),_0x368789['id']);}for(const [_0x435597,{definition:_0x44d6f4}]of _0x22299b){const _0x232df2=generateDeterministicJourneySegmentName(_0x9cf8f9[_0x1a44f2(0x152)]['name'],_0x435597);_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0x162),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'segmentName':_0x435597});const _0xff672a=createSegmentIdResolver(_0x16f27a['segmentNameToId'],_0x435597),_0x50f3e0=await resolveRuleSegmentIds(_0x44d6f4[_0x1a44f2(0xea)],_0xff672a),_0x2fd3ef=await _0x2b548d['segment'][_0x1a44f2(0x143)]({'name':_0x232df2,'description':_0x44d6f4[_0x1a44f2(0x11a)]||_0x1a44f2(0x110)+_0x435597,'journeyId':_0x397483,'rule':_0x228c48(_0x50f3e0,!![]),'countPopulation':!![],'parentFolderId':_0x23df1e[_0x1a44f2(0xc9)]||'','audienceId':_0x23df1e[_0x1a44f2(0xdc)]});_0x2b757f[_0x1a44f2(0x113)](_0x435597,_0x2fd3ef),_0x16f27a[_0x1a44f2(0xe7)][_0x1a44f2(0x113)](_0x435597,_0x2fd3ef),_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0xec),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'segmentName':_0x435597});}const _0xe2dcd2=new Map();for(const [_0x35c5b3,_0x2033b2]of _0x24e6f2){_0x317e54[_0x1a44f2(0x108)]?.({'type':_0x1a44f2(0xf6),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'activationName':_0x35c5b3});const _0x25f75a=await _0x26d1e8(_0x2033b2,_0x16f27a[_0x1a44f2(0x177)]),_0x5172ed=await _0x2b548d[_0x1a44f2(0x1a0)]['createActivation'](_0x397483,_0x25f75a);_0xe2dcd2[_0x1a44f2(0x113)](_0x35c5b3,_0x5172ed['id']),_0x1e15b3[_0x1a44f2(0x197)][_0x1a44f2(0x113)](_0x35c5b3,_0x5172ed['id']),_0x317e54['onProgress']?.({'type':_0x1a44f2(0xfc),'journeyName':_0x9cf8f9[_0x1a44f2(0x152)][_0x1a44f2(0x18f)],'activationName':_0x35c5b3});}const _0x3649f8=JSON['parse'](JSON[_0x1a44f2(0x144)](_0x24184d));return _0x3649f8['id']=_0x397483,ensureJourneyDefaults(_0x3649f8[_0x1a44f2(0x125)]),resolvePendingIdsInRequest(_0x3649f8,_0x24184d,_0x1420e0,_0x2b757f,_0xe2dcd2,_0x317e54),await _0x2b548d[_0x1a44f2(0x1a0)]['update'](_0x397483,_0x3649f8),{'action':_0x1a44f2(0x15c),'journeyId':_0x397483,'embeddedSegmentNameToId':_0x2b757f};}function stripPendingIds(_0x18d90b){const _0xb3c4af=a119_0x43758d;for(const _0x373f06 of _0x18d90b['attributes'][_0xb3c4af(0x168)]||[]){_0x373f06[_0xb3c4af(0x149)]?.[_0xb3c4af(0x160)]&&isPendingSegmentId(_0x373f06['entryCriteria']['segmentId'])&&delete _0x373f06[_0xb3c4af(0x149)];if(_0x373f06[_0xb3c4af(0x151)])for(const _0x5bfa17 of Object[_0xb3c4af(0xcf)](_0x373f06[_0xb3c4af(0x151)])){const _0x3e9a86=_0x373f06[_0xb3c4af(0x151)][_0x5bfa17];_0x3e9a86['type']===_0xb3c4af(0x109)&&_0x3e9a86[_0xb3c4af(0xfa)]&&isPendingActivationId(_0x3e9a86['journeyActivationStepId'])&&(_0x3e9a86[_0xb3c4af(0xfa)]='');if(_0x3e9a86[_0xb3c4af(0x121)]===_0xb3c4af(0x12d)&&_0x3e9a86[_0xb3c4af(0x141)])for(const _0x5676ae of _0x3e9a86[_0xb3c4af(0x141)]){_0x5676ae[_0xb3c4af(0x160)]&&isPendingSegmentId(_0x5676ae[_0xb3c4af(0x160)])&&(_0x5676ae['segmentId']='');}_0x3e9a86[_0xb3c4af(0x121)]===_0xb3c4af(0x19d)&&_0x3e9a86[_0xb3c4af(0x15b)]?.['segmentId']&&isPendingSegmentId(_0x3e9a86[_0xb3c4af(0x15b)][_0xb3c4af(0x160)])&&(_0x3e9a86['waitCondition'][_0xb3c4af(0x160)]='');}}}function resolvePendingIdsInRequest(_0x1f49af,_0x355214,_0x382ed1,_0x2afef3,_0x14c4d1,_0x1a98e3){const _0x241b27=a119_0x43758d,_0xae4814=(_0x421096,_0x2ae4d0)=>{const _0x44c2c4=a119_0x1c83;if(!isPendingSegmentId(_0x421096))return _0x421096;const _0x304b6c=extractPendingSegmentName(_0x421096),_0x177514=_0x2afef3['get'](_0x304b6c);return!_0x177514&&_0x1a98e3['logWarning']?.(_0x44c2c4(0x140)+_0x304b6c+_0x44c2c4(0x16f)+_0x2ae4d0),_0x177514;};if(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)][_0x241b27(0x160)])){const _0x39adaf=_0xae4814(_0x1f49af[_0x241b27(0x125)][_0x241b27(0x163)]['segmentId'],_0x241b27(0x11e));_0x39adaf&&(_0x1f49af[_0x241b27(0x125)]['goal']['segmentId']=_0x39adaf);}for(const _0xd31562 of _0x1f49af[_0x241b27(0x125)][_0x241b27(0x168)]||[]){const _0xe61d89=_0x382ed1[_0x241b27(0x13b)](_0xd31562[_0x241b27(0x18f)][_0x241b27(0x18c)]());_0xe61d89&&(_0xd31562['id']=_0xe61d89);if(_0xd31562[_0x241b27(0x149)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0xd31562[_0x241b27(0x149)][_0x241b27(0x160)])){const _0x2b4af8=_0xae4814(_0xd31562['entryCriteria'][_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0x180));_0x2b4af8&&(_0xd31562[_0x241b27(0x149)][_0x241b27(0x160)]=_0x2b4af8);}if(_0xd31562['exitCriterias'])for(const _0x3537c1 of _0xd31562[_0x241b27(0x192)]){if(_0x3537c1[_0x241b27(0x160)]&&isPendingSegmentId(_0x3537c1['segmentId'])){const _0x2b645a=_0xae4814(_0x3537c1['segmentId'],_0x241b27(0x1a3)+_0xd31562['name']+'\x27\x20exit\x20criteria');_0x2b645a&&(_0x3537c1[_0x241b27(0x160)]=_0x2b645a);}}if(_0xd31562[_0x241b27(0x145)]?.['segmentId']&&isPendingSegmentId(_0xd31562[_0x241b27(0x145)][_0x241b27(0x160)])){const _0x43d995=_0xae4814(_0xd31562[_0x241b27(0x145)][_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0x196));_0x43d995&&(_0xd31562[_0x241b27(0x145)]['segmentId']=_0x43d995);}if(_0xd31562['steps']){const _0x3f3e76=_0x4bcaab=>_0x355214[_0x241b27(0x125)][_0x241b27(0x168)][_0x241b27(0x18d)](_0x474180=>_0x474180[_0x241b27(0x18f)]['toLowerCase']()===_0xd31562[_0x241b27(0x18f)][_0x241b27(0x18c)]())?.[_0x241b27(0x151)]?.[_0x4bcaab];for(const _0x832613 of Object['keys'](_0xd31562['steps'])){const _0x328c52=_0xd31562[_0x241b27(0x151)][_0x832613],_0x11ff1f=_0x3f3e76(_0x832613);if(_0x328c52[_0x241b27(0x121)]===_0x241b27(0x109)&&_0x328c52[_0x241b27(0xfa)]&&(isPendingActivationId(_0x328c52[_0x241b27(0xfa)])||_0x328c52[_0x241b27(0xfa)]==='')){if(_0x11ff1f?.[_0x241b27(0xfa)]&&isPendingActivationId(_0x11ff1f[_0x241b27(0xfa)])){const _0x1380b8=extractPendingActivationName(_0x11ff1f[_0x241b27(0xfa)]),_0x4d9fa2=_0x14c4d1[_0x241b27(0x13b)](_0x1380b8);_0x4d9fa2&&(_0x328c52[_0x241b27(0xfa)]=_0x4d9fa2);}}if(_0x328c52[_0x241b27(0x121)]==='DecisionPoint'&&_0x328c52[_0x241b27(0x141)]&&_0x11ff1f?.['branches'])for(let _0x4f3b32=0x0;_0x4f3b32<_0x328c52[_0x241b27(0x141)][_0x241b27(0x18e)];_0x4f3b32++){const _0x4b4c4d=_0x328c52[_0x241b27(0x141)][_0x4f3b32],_0x476551=_0x11ff1f[_0x241b27(0x141)][_0x4f3b32];if(_0x476551?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x476551[_0x241b27(0x160)])){const _0x59e172=_0xae4814(_0x476551[_0x241b27(0x160)],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+_0x241b27(0xc5)+(_0x4b4c4d[_0x241b27(0x18f)]||_0x4f3b32)+'\x27');_0x59e172&&(_0x4b4c4d[_0x241b27(0x160)]=_0x59e172);}}if(_0x328c52['type']===_0x241b27(0x19d)&&_0x328c52[_0x241b27(0x15b)]?.[_0x241b27(0x160)]&&_0x11ff1f?.[_0x241b27(0x15b)]?.[_0x241b27(0x160)]&&isPendingSegmentId(_0x11ff1f[_0x241b27(0x15b)][_0x241b27(0x160)])){const _0x11e46b=_0xae4814(_0x11ff1f[_0x241b27(0x15b)]['segmentId'],_0x241b27(0x1a3)+_0xd31562[_0x241b27(0x18f)]+'\x27\x20wait\x20condition');_0x11e46b&&(_0x328c52[_0x241b27(0x15b)][_0x241b27(0x160)]=_0x11e46b);}}}}}
|
|
1
|
+
const a119_0x4f28a3=a119_0x2c28;(function(_0x1ac8d2,_0x4419b4){const _0x2971e7=a119_0x2c28,_0x1fd95a=_0x1ac8d2();while(!![]){try{const _0x54524f=parseInt(_0x2971e7(0x112))/0x1*(parseInt(_0x2971e7(0x163))/0x2)+parseInt(_0x2971e7(0x10d))/0x3*(-parseInt(_0x2971e7(0x12b))/0x4)+-parseInt(_0x2971e7(0x19b))/0x5+-parseInt(_0x2971e7(0x18a))/0x6*(parseInt(_0x2971e7(0x1a9))/0x7)+parseInt(_0x2971e7(0x113))/0x8*(-parseInt(_0x2971e7(0x17e))/0x9)+-parseInt(_0x2971e7(0xfc))/0xa+parseInt(_0x2971e7(0x1d8))/0xb*(parseInt(_0x2971e7(0x1c4))/0xc);if(_0x54524f===_0x4419b4)break;else _0x1fd95a['push'](_0x1fd95a['shift']());}catch(_0x499882){_0x1fd95a['push'](_0x1fd95a['shift']());}}}(a119_0x3fb9,0x1f599));import{createHash}from'crypto';function a119_0x2c28(_0x337935,_0x426d38){_0x337935=_0x337935-0xf9;const _0x3fb9ef=a119_0x3fb9();let _0x2c28bf=_0x3fb9ef[_0x337935];return _0x2c28bf;}export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a119_0x4f28a3(0x10f);export function createPendingSegmentId(_0x1b70ae){return''+PENDING_SEGMENT_PREFIX+_0x1b70ae+'__';}export function isPendingSegmentId(_0x2b2496){const _0x41783c=a119_0x4f28a3;return _0x2b2496[_0x41783c(0x1a2)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x53b6bf){const _0x487ec1=a119_0x4f28a3;return _0x53b6bf[_0x487ec1(0x153)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x300e08){return''+PENDING_ACTIVATION_PREFIX+_0x300e08+'__';}export function isPendingActivationId(_0x2e4155){return _0x2e4155['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1c41a9){const _0x4e9d2e=a119_0x4f28a3;return _0x1c41a9[_0x4e9d2e(0x153)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x308e29,_0x3dbccc){const _0x5cc778=a119_0x4f28a3,_0x58276c=_0x308e29+'::'+(_0x3dbccc['trim']()||_0x5cc778(0x132)),_0x395b99=createHash(_0x5cc778(0x1da))[_0x5cc778(0x197)](_0x58276c)['digest'](_0x5cc778(0x178))[_0x5cc778(0x166)](0x0,0xc);return _0x5cc778(0x1c5)+_0x395b99;}function a119_0x3fb9(){const _0x28d6e0=['JOURNEY_UPDATE_ERROR','activationParams','journey_updating','effectiveFolderId','reduce','message','Created\x20segment\x20\x27','object','hex','createFolder','updateActivation','all','Creating\x20segment\x20\x27','push','1214631cUJOtg','Created\x20activation\x20\x27','createdSegmentId','\x27\x20decision\x20point\x20branch\x20\x27','validatedRequest','journey','folderPath','Updated\x20activation\x20\x27','listSegments','idToName','Updating\x20activation\x20\x27','activations','198102lOXuJH','stringify','SEGMENT_UPDATE_ERROR','draft','diff','connection','deleteActivation','notification','activationContext','\x20journey\x20from\x20file:\x20','description','hasChanges','existingSegments','update','NOT_FOUND','user','utf-8','1255960FXzNem','idToEmailMap','isNew','\x27\x20exit\x20criteria','absolutePath','listActivations','size','startsWith','activation_created','yamlConfig','existingActivation','Creating\x20folder\x20\x27','from','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','21JYiwzb','connector_config','buildUserMaps','segment_updated','embedded_segment_creating','\x27\x20for\x20','\x20(referenced\x20in\x20journey\x20','columns','journeyId','existingJourney','folderPathToId','activation_updated','\x27...','results','schedule','\x20activation\x20\x27','relationships','activation_deleting','createJourneySegment','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','\x20segment\x20from\x20file:\x20','unchanged','decision_point','split','deleteSegment','):\x20','embeddedSegmentNameToId','90924biZHHI','journey_entry_criteria_','type','segmentNameToId','Fetching\x20','logDeleted','errors','goal\x20criteria','resolveJourneyId','SEGMENT_SYNTAX_ERROR','SEGMENT_NOT_FOUND','with','segmentFolderId','entryCriteria','find','yamlActivation','parentSegmentFolder','folderId','withProgress','flatMap','1243mgsRUt','localSegmentRules','sha1','create','Activation',').\x20','logWarning','activation_updating','goal','nameToId','createActivation','Updated\x20journey\x20\x27','segments','delete','segment_deleted','updateSegmentById','relative','journeyBundleName','1493390mvxLWj','ACTIVATION_SYNTAX_ERROR','rootFolderId','Segment\x20not\x20found:\x20','stage\x20\x27','nameToType','set','./child-segment-yaml.js','Updated\x20segment\x20\x27','\x27\x20wait\x20condition','getJourney','Deleting\x20activation\x20\x27','updated','Failed\x20to\x20','folder','INTERNAL','getSegment','222luykde','progress','__pending_act_','parseDocument','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','130747Ksrnqc','8secBVN','dirname','kind','activation_template_id','versionNumber','../../utils/async.js','parentId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','behavior','journeys','parentFolder','add','get','embedded_activation_created','journeyById','toLowerCase','rule','created','milestone','activationActions','\x0a\x20\x20','data','length','createSegment','12108FiCZUH','join','max','entry','Updating\x20segment\x20\x27','embedded_segment_created','existingSegment','segment','parse','map','connectionIdToNameMap','onProgress','journeyStages','resolveSegment','segmentId','deleted','name','list','activationStepsById','segment_updating','Entry\x20criteria:\x20','fetchJourney','all_columns','includes','exitCriterias','ACTIVATION_UPDATE_ERROR','logSuccess','Stage\x20\x27','keys','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','segment_creating','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','JOURNEY_SYNTAX_ERROR','action','./journey-yaml.js','toString','Created\x20folder\x20\x27','Journey\x20\x27','item','journeyActivationStepId','replace','steps','has','attributes','null','logInfo','stages','filter','sort','index','getActivation','segment_created','WaitStep','activation_','Deleted\x20activation\x20\x27','activation_creating','2txEiio','\x20error(s)','\x27\x20from\x20file:\x20','slice','\x27\x20entry\x20criteria','waitCondition','state','entry_criteria','Deleted\x20segment\x20\x27','journey_created','values','branches','segment_deleting'];a119_0x3fb9=function(){return _0x28d6e0;};return a119_0x3fb9();}export function ensureJourneyDefaults(_0x2e7b8a){const _0x1d1419=a119_0x4f28a3;!_0x2e7b8a[_0x1d1419(0x194)]&&(_0x2e7b8a['description']=''),!_0x2e7b8a['state']&&(_0x2e7b8a[_0x1d1419(0x169)]=_0x1d1419(0x18d));}export function resolveTDFolderPath(_0x3989b7,_0x2cd0d2,_0x134a70){if(!_0x2cd0d2)return _0x3989b7;if(_0x3989b7===_0x134a70||_0x3989b7['startsWith'](_0x134a70+'/'))return _0x3989b7;return _0x3989b7?_0x134a70+'/'+_0x3989b7:_0x134a70;}export function addFoldersToCreate(_0x1a88b0,_0x215d56,_0x2a6350){const _0x60ea06=a119_0x4f28a3;if(!_0x1a88b0)return;if(_0x215d56['has'](_0x1a88b0))return;const _0x4ee948=_0x1a88b0[_0x60ea06(0x1c0)]('/');let _0x17bcd4='';for(const _0x10f254 of _0x4ee948){_0x17bcd4=_0x17bcd4?_0x17bcd4+'/'+_0x10f254:_0x10f254,!_0x215d56[_0x60ea06(0x155)](_0x17bcd4)&&_0x2a6350[_0x60ea06(0x11e)](_0x17bcd4);}}import*as a119_0x122c73 from'yaml';import{readFileSync}from'fs';import a119_0xbbf4fa from'path';import{isJourneyDef,parseYamlString as a119_0x4ff776,toYamlString as a119_0x17b759,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(_0xe7dd5e){const _0x73f413=a119_0x4f28a3;if(Array['isArray'](_0xe7dd5e))return'['+_0xe7dd5e['map'](_0x1cf660=>stableStringify(_0x1cf660))[_0x73f413(0x12c)](',')+']';if(_0xe7dd5e&&typeof _0xe7dd5e===_0x73f413(0x177)){const _0x11ea5e=_0xe7dd5e,_0x28c972=Object[_0x73f413(0x147)](_0x11ea5e)[_0x73f413(0x15b)](),_0x17935a=_0x28c972[_0x73f413(0x134)](_0x5532ee=>'\x22'+_0x5532ee+'\x22:'+stableStringify(_0x11ea5e[_0x5532ee]));return'{'+_0x17935a['join'](',')+'}';}const _0x564eab=JSON['stringify'](_0xe7dd5e);return _0x564eab===undefined?_0x73f413(0x157):_0x564eab;}function activationSignature(_0xf53ff){const _0x20096a=a119_0x4f28a3,_0x494966={'connection':_0xf53ff[_0x20096a(0x18f)],..._0xf53ff[_0x20096a(0x141)]!==undefined&&{'all_columns':_0xf53ff[_0x20096a(0x141)]},..._0xf53ff[_0x20096a(0x1b0)]!==undefined&&{'columns':_0xf53ff[_0x20096a(0x1b0)]},..._0xf53ff[_0x20096a(0x11b)]!==undefined&&{'behavior':_0xf53ff[_0x20096a(0x11b)]},..._0xf53ff['schedule']!==undefined&&{'schedule':_0xf53ff[_0x20096a(0x1b7)]},..._0xf53ff['notification']!==undefined&&{'notification':_0xf53ff[_0x20096a(0x191)]},..._0xf53ff[_0x20096a(0x1aa)]!==undefined&&{'connector_config':_0xf53ff[_0x20096a(0x1aa)]},..._0xf53ff['activation_template_id']!==undefined&&{'activation_template_id':_0xf53ff[_0x20096a(0x116)]}};return stableStringify(_0x494966);}export async function prepareSegmentFiles(_0x25772e,_0x4d6961,_0x5025d5,_0x79648a,_0x4002ec){const _0x535784=a119_0x4f28a3,{activationDefToCreateRequest:_0x2ec800}=await import(_0x535784(0x103)),_0x2b1a8a=[],_0x2bf3d8=new Set();for(const {yamlConfig:_0x2fb6e9,folderPath:_0x18f592,sourcePath:_0xb8885e}of _0x25772e){const _0x51e93f=resolveTDFolderPath(_0x18f592,_0x79648a,_0x4002ec),_0x565b6e=_0x51e93f+':'+_0x2fb6e9[_0x535784(0x13b)],_0x335d32=_0x4d6961['segmentByFolderAndName']['get'](_0x565b6e),_0x5dbd5f=_0x335d32?_0x4d6961['activationsBySegmentId'][_0x535784(0x11f)](_0x335d32['id'])||[]:[];addFoldersToCreate(_0x51e93f,_0x4d6961[_0x535784(0x1b3)],_0x2bf3d8);const _0x3eafa6=calculateActivationActions(_0x2fb6e9['activations']||[],_0x5dbd5f,_0x4d6961[_0x535784(0x19c)],_0x4d6961[_0x535784(0x135)]);for(const _0x1f6cc3 of _0x3eafa6){(_0x1f6cc3[_0x535784(0x1c6)]===_0x535784(0x1db)||_0x1f6cc3[_0x535784(0x1c6)]===_0x535784(0x197))&&_0x1f6cc3[_0x535784(0x1d3)]&&(_0x1f6cc3[_0x535784(0x182)]=await _0x2ec800(_0x1f6cc3[_0x535784(0x1d3)],_0x5025d5));}const _0x4c8ca1=calculateSegmentDiff(_0x2fb6e9,_0x335d32,_0x5dbd5f,_0x4d6961['idToEmailMap'],_0x4d6961[_0x535784(0x135)]);_0x2b1a8a[_0x535784(0x17d)]({'relativePath':_0x2fb6e9[_0x535784(0x13b)],'absolutePath':_0xb8885e,'yamlConfig':_0x2fb6e9,'folderPath':_0x51e93f,'existingSegment':_0x335d32,'existingActivations':_0x5dbd5f,'isNew':_0x4c8ca1[_0x535784(0x19d)],'hasChanges':_0x4c8ca1[_0x535784(0x195)],'diff':_0x4c8ca1['diff'],'activationActions':_0x3eafa6});}return{'segmentFiles':_0x2b1a8a,'foldersToCreate':_0x2bf3d8};}export async function prepareJourneyFiles(_0x26c77c,_0x477b31,_0x3b0391,_0x3fac89){const _0x35dcc0=a119_0x4f28a3,_0x3ca5d0=[],_0x166be7=new Set();for(const {yamlConfig:_0x535ae1,folderPath:_0x5087b6,sourcePath:_0x44db6b}of _0x26c77c){const _0x705d2c=resolveTDFolderPath(_0x5087b6,_0x3b0391,_0x3fac89),_0x13b508=_0x705d2c+':'+_0x535ae1['name'],_0x410c13=_0x477b31['journeyBundlesByFolderAndName']['get'](_0x13b508);let _0x4acdec,_0xc11524;if(_0x410c13&&_0x410c13['length']>0x0){const _0x5c6266=buildLocalExpandedRuleMappings(_0x535ae1),{createYamlContext:_0x5daeda,prefetchJourneySegments:_0x2fce36}=createPushYamlContextForBundle(_0x477b31['deps'],_0x477b31[_0x35dcc0(0x119)],_0x477b31[_0x35dcc0(0x196)],_0x5c6266,_0x477b31[_0x35dcc0(0x19c)],_0x477b31[_0x35dcc0(0x135)],_0x477b31[_0x35dcc0(0x13d)],_0x477b31[_0x35dcc0(0x121)]);await _0x2fce36(_0x410c13[_0x35dcc0(0x134)](_0x70e4af=>_0x70e4af['id']));const _0x331e69=hasMultipleVersions(_0x535ae1),_0x5946e2=async _0x383b68=>{const _0xe1bf=_0x35dcc0,_0x3faf9e=_0x477b31[_0xe1bf(0x121)]?.[_0xe1bf(0x11f)](_0x383b68);if(_0x3faf9e)return _0x3faf9e;return _0x477b31[_0xe1bf(0x140)]({'journeyId':_0x383b68,'journeyName':_0x535ae1['name'],'isMultiVersion':_0x410c13[_0xe1bf(0x129)]>0x1});};if(_0x331e69&&_0x410c13[_0x35dcc0(0x129)]>0x1){const _0x2e48e6=[];for(const _0x493f22 of _0x410c13){const _0x50f549=_0x493f22[_0x35dcc0(0x117)]||0x1;_0x477b31['progress']?.[_0x35dcc0(0x197)](_0x35dcc0(0x1c8)+_0x535ae1[_0x35dcc0(0x13b)]+'\x20v'+_0x50f549);const _0x4c9e5c=await _0x5946e2(_0x493f22['id']),_0x553de6=_0x5daeda(_0x493f22['id']),_0x4a487c=await journeyResponseToDef(_0x4c9e5c,_0x553de6);_0x2e48e6[_0x35dcc0(0x17d)]({'item':_0x493f22,'yaml':_0x4a487c});}const _0x2859d8=buildLocalRuleToNameMappingFromJourney(_0x535ae1);_0xc11524=buildMergedJourneyDef(_0x2e48e6,_0x2859d8);const _0x185633=Math[_0x35dcc0(0x12d)](..._0x2e48e6['map'](_0x5604e6=>_0x5604e6[_0x35dcc0(0x151)][_0x35dcc0(0x117)]||0x0)),_0x10b89c=_0x410c13[_0x35dcc0(0x1d2)](_0x592dcd=>(_0x592dcd[_0x35dcc0(0x117)]||0x0)===_0x185633);_0x10b89c&&(_0x477b31[_0x35dcc0(0x10e)]?.[_0x35dcc0(0x197)](_0x35dcc0(0x1c8)+_0x535ae1[_0x35dcc0(0x13b)]+'\x20v'+_0x185633),_0x4acdec=await _0x5946e2(_0x10b89c['id']));}else{const _0x386fc2=_0x410c13[_0x410c13['length']-0x1];_0x477b31[_0x35dcc0(0x10e)]?.['update'](_0x35dcc0(0x1c8)+_0x535ae1['name']),_0x4acdec=await _0x5946e2(_0x386fc2['id']);const _0x1b5864=_0x5daeda(_0x386fc2['id']),_0x37603a=await journeyResponseToDef(_0x4acdec,_0x1b5864),_0x204356=buildLocalRuleToNameMappingFromJourney(_0x535ae1);_0xc11524=buildMergedJourneyDef([{'item':_0x386fc2,'yaml':_0x37603a}],_0x204356);}}addFoldersToCreate(_0x705d2c,_0x477b31[_0x35dcc0(0x1b3)],_0x166be7);const _0x410293=calculateJourneyDiff(_0x535ae1,_0xc11524);_0x3ca5d0[_0x35dcc0(0x17d)]({'relativePath':_0x535ae1[_0x35dcc0(0x13b)],'absolutePath':_0x44db6b,'yamlConfig':_0x535ae1,'folderPath':_0x705d2c,'existingJourney':_0x4acdec,'isNew':_0x410293[_0x35dcc0(0x19d)],'hasChanges':_0x410293['hasChanges'],'diff':_0x410293[_0x35dcc0(0x18e)]});}return{'journeyFiles':_0x3ca5d0,'foldersToCreate':_0x166be7};}export function calculateActivationActions(_0x60cc2d,_0x530959,_0x31ff2b,_0x4a7147){const _0x5c0b7d=a119_0x4f28a3,_0x5a193a=[],_0x2c89dd=new Map();for(const _0x53d134 of _0x530959){_0x2c89dd[_0x5c0b7d(0x102)](_0x53d134[_0x5c0b7d(0x13b)],_0x53d134);}const _0xa01e5b=new Map();for(const _0x3d1c68 of _0x60cc2d){_0xa01e5b[_0x5c0b7d(0x102)](_0x3d1c68[_0x5c0b7d(0x13b)],_0x3d1c68);}for(const _0x50364a of _0x60cc2d){const _0x1c20e2=_0x2c89dd[_0x5c0b7d(0x11f)](_0x50364a[_0x5c0b7d(0x13b)]);if(!_0x1c20e2)_0x5a193a['push']({'type':_0x5c0b7d(0x1db),'name':_0x50364a[_0x5c0b7d(0x13b)],'yamlActivation':_0x50364a});else{const _0x3ea77f=activationResponseToDef(_0x1c20e2,_0x31ff2b,_0x4a7147),_0x5ef6bc=a119_0x122c73[_0x5c0b7d(0x18b)](_0x3ea77f),_0x4f21c0=a119_0x122c73[_0x5c0b7d(0x18b)](_0x50364a);_0x5ef6bc!==_0x4f21c0&&_0x5a193a[_0x5c0b7d(0x17d)]({'type':_0x5c0b7d(0x197),'name':_0x50364a[_0x5c0b7d(0x13b)],'yamlActivation':_0x50364a,'existingActivation':_0x1c20e2});}}for(const _0x39dc1c of _0x530959){!_0xa01e5b['has'](_0x39dc1c[_0x5c0b7d(0x13b)])&&_0x5a193a[_0x5c0b7d(0x17d)]({'type':'delete','name':_0x39dc1c[_0x5c0b7d(0x13b)],'existingActivation':_0x39dc1c});}return _0x5a193a;}export function calculateSegmentDiff(_0x4d7fb9,_0x4deddc,_0x8953f3,_0x37dd3c,_0x5c5c94){const _0x36c3d0=segmentToYamlString(_0x4d7fb9);if(_0x4deddc){const _0x4c0c6b=segmentWithActivationsToYaml(_0x4deddc,_0x8953f3,undefined,_0x37dd3c,_0x5c5c94),_0x411edd=segmentToYamlString(_0x4c0c6b),_0x12e701=generateDiff(_0x411edd,_0x36c3d0),_0x23f98b=hasChanges(_0x12e701);return{'isNew':![],'hasChanges':_0x23f98b,'diff':_0x23f98b?formatDiffWithColors(_0x12e701):undefined};}const _0x58535=generateDiff('',_0x36c3d0);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x58535)};}export function calculateJourneyDiff(_0x3b5334,_0x145e02){const _0x20eb08=normalizeJourneyDef(_0x3b5334,_0x3b5334),_0x486b57=a119_0x17b759(_0x20eb08);if(_0x145e02){const _0x33186e=normalizeJourneyDef(_0x145e02,_0x3b5334),_0x4ab7e0=a119_0x17b759(_0x33186e),_0x36481b=generateDiff(_0x4ab7e0,_0x486b57),_0x1cad6c=hasChanges(_0x36481b);return{'isNew':![],'hasChanges':_0x1cad6c,'diff':_0x1cad6c?formatDiffWithColors(_0x36481b):undefined};}const _0x5c2c7e=generateDiff('',_0x486b57);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5c2c7e)};}export function findSegmentsToDelete(_0x117534,_0x55fdf8,_0x1e92ad,_0x57bdd5,_0x410a45){const _0xf61762=a119_0x4f28a3,_0x31b270=new Set();for(const {yamlConfig:_0x1848fd,folderPath:_0x5b08de}of _0x55fdf8){_0x31b270[_0xf61762(0x11e)](_0x5b08de+':'+_0x1848fd[_0xf61762(0x13b)]);}return _0x117534['filter'](_0x344bb5=>{const _0x22667d=_0xf61762,_0x454c3b=_0x344bb5['segmentFolderId']?_0x1e92ad[_0x22667d(0x11f)](_0x344bb5[_0x22667d(0x1d0)][_0x22667d(0x14e)]())||'':'',_0x5f046f=_0x454c3b+':'+_0x344bb5[_0x22667d(0x13b)];if(_0x31b270[_0x22667d(0x155)](_0x5f046f))return![];if(_0x410a45)return _0x454c3b===_0x57bdd5||_0x454c3b[_0x22667d(0x1a2)](_0x57bdd5+'/');return!![];});}export function findJourneysToDelete(_0x2f5e2a,_0x5ed978,_0x2b5876,_0x21a27c,_0x33ebe5){const _0x332a49=a119_0x4f28a3,_0x4f95a1=new Set();for(const {yamlConfig:_0x34602c,folderPath:_0x242985}of _0x5ed978){_0x4f95a1['add'](_0x242985+':'+_0x34602c[_0x332a49(0x13b)]);}return _0x2f5e2a['filter'](_0x1d08a0=>{const _0x2243d9=_0x332a49,_0x3355d4=_0x1d08a0[_0x2243d9(0x1d5)]?_0x2b5876['get'](_0x1d08a0[_0x2243d9(0x1d5)])||'':'',_0xca3b16=_0x3355d4+':'+_0x1d08a0[_0x2243d9(0xfb)];if(_0x4f95a1[_0x2243d9(0x155)](_0xca3b16))return![];if(_0x33ebe5)return _0x3355d4===_0x21a27c||_0x3355d4[_0x2243d9(0x1a2)](_0x21a27c+'/');return!![];});}export function buildSegmentLookupMap(_0x57e966,_0x26f6d3){const _0xbf075f=a119_0x4f28a3,_0x134fcd=new Map();for(const _0x27620b of _0x57e966){const _0x152323=_0x27620b[_0xbf075f(0x1d0)]?_0x26f6d3['get'](_0x27620b['segmentFolderId'][_0xbf075f(0x14e)]())||'':'',_0x3ae5c1=_0x152323+':'+_0x27620b[_0xbf075f(0x13b)];_0x134fcd[_0xbf075f(0x102)](_0x3ae5c1,_0x27620b);}return _0x134fcd;}export function buildSegmentNameToIdMap(_0x314717){const _0x4b9e72=a119_0x4f28a3,_0x53b06f=new Map();for(const _0x11499c of _0x314717){_0x53b06f['set'](_0x11499c[_0x4b9e72(0x13b)],_0x11499c['id']);}return _0x53b06f;}export function buildJourneyBundleLookupMap(_0x460476,_0x2016c0){const _0xc24c69=a119_0x4f28a3,_0x1df086=new Map();for(const _0x47d125 of _0x460476){const _0x381b39=_0x47d125['folderId']?_0x2016c0[_0xc24c69(0x11f)](_0x47d125[_0xc24c69(0x1d5)])||'':'',_0x2b081d=_0x381b39+':'+_0x47d125[_0xc24c69(0xfb)];!_0x1df086[_0xc24c69(0x155)](_0x2b081d)&&_0x1df086[_0xc24c69(0x102)](_0x2b081d,[]),_0x1df086[_0xc24c69(0x11f)](_0x2b081d)['push'](_0x47d125);}for(const _0x30ca5f of _0x1df086[_0xc24c69(0x16d)]()){_0x30ca5f[_0xc24c69(0x15b)]((_0x50ba85,_0x403030)=>(_0x50ba85['versionNumber']||0x0)-(_0x403030[_0xc24c69(0x117)]||0x0));}return _0x1df086;}export function collectFoldersToCreate(_0x127b54,_0x400cf9){const _0x111db5=a119_0x4f28a3,_0x31e057=new Set();for(const _0x5c81e3 of _0x127b54){if(!_0x5c81e3)continue;if(_0x400cf9[_0x111db5(0x155)](_0x5c81e3))continue;const _0x2f9830=_0x5c81e3[_0x111db5(0x1c0)]('/');let _0x3b5409='';for(const _0x2a4835 of _0x2f9830){_0x3b5409=_0x3b5409?_0x3b5409+'/'+_0x2a4835:_0x2a4835,!_0x400cf9[_0x111db5(0x155)](_0x3b5409)&&_0x31e057['add'](_0x3b5409);}}return _0x31e057;}export function parseAndClassifyYamlFiles(_0x33383b,_0x71cac6,_0x2c7f93){const _0x4e6a62=a119_0x4f28a3,_0x15e0b8=[],_0x46dbd6=[];for(const _0x589e16 of _0x33383b){const _0x4730aa=a119_0xbbf4fa[_0x4e6a62(0xfa)](_0x71cac6,a119_0xbbf4fa[_0x4e6a62(0x114)](_0x589e16)),_0x58578b=_0x4730aa==='.'?'':_0x4730aa,_0x56a9d1=readFileSync(_0x589e16,_0x4e6a62(0x19a)),_0x796c3c=a119_0x122c73[_0x4e6a62(0x133)](_0x56a9d1);if(isJourneyDef(_0x796c3c)){const _0x3ffbc9=a119_0x4ff776(_0x56a9d1);_0x46dbd6[_0x4e6a62(0x17d)]({'yamlConfig':_0x3ffbc9,'folderPath':_0x58578b,'sourcePath':_0x589e16});}else{if(!_0x2c7f93?.['skipSegments']){const _0x4dc758=parseSegmentYamlFile(_0x56a9d1),_0x1c9c4c=normalizeChildSegmentYaml(_0x4dc758);_0x15e0b8['push']({'yamlConfig':_0x1c9c4c,'folderPath':_0x58578b,'sourcePath':_0x589e16});}}}return{'segments':_0x15e0b8,'journeys':_0x46dbd6};}export function validateParsedFiles(_0xe19b33,_0x35c662){const _0x34a252=a119_0x4f28a3,_0x2a0e7b=[];for(const {yamlConfig:_0x247990,sourcePath:_0x325bb6}of _0xe19b33['segments']){const _0x4c6356=readFileSync(_0x325bb6,_0x34a252(0x19a)),_0xb7048f=a119_0x122c73[_0x34a252(0x110)](_0x4c6356),_0x123707=validateSegmentDef(_0x247990,{'source':_0x4c6356,'document':_0xb7048f});if(!_0x123707['valid']){const _0x4f5339=a119_0xbbf4fa['relative'](_0x35c662,_0x325bb6);_0x2a0e7b[_0x34a252(0x17d)]({'filePath':_0x4f5339,'source':_0x4c6356,'result':_0x123707,'isJourney':![]});}}for(const {yamlConfig:_0x5773eb,sourcePath:_0x2552fe}of _0xe19b33[_0x34a252(0x11c)]){const _0x20b75=readFileSync(_0x2552fe,_0x34a252(0x19a)),_0x445989=a119_0x122c73[_0x34a252(0x110)](_0x20b75),_0x372136=validateJourneyDef(_0x5773eb,{'source':_0x20b75,'document':_0x445989});if(!_0x372136['valid']){const _0x3bbae3=a119_0xbbf4fa[_0x34a252(0xfa)](_0x35c662,_0x2552fe);_0x2a0e7b[_0x34a252(0x17d)]({'filePath':_0x3bbae3,'source':_0x20b75,'result':_0x372136,'isJourney':!![]});}}return _0x2a0e7b;}export function formatValidationErrors(_0x451126){const _0x12aebf=a119_0x4f28a3,_0x3f7446=[];for(const {filePath:_0x5acb45,source:_0xdd7399,result:_0x3e87f3,isJourney:_0x3a4360}of _0x451126){const _0x47c26c=_0x3a4360?'journey':_0x12aebf(0x132);_0x3f7446[_0x12aebf(0x17d)]('\x0a'+_0x5acb45+'\x20('+_0x47c26c+_0x12aebf(0x1c2)+_0x3e87f3[_0x12aebf(0x1ca)][_0x12aebf(0x129)]+_0x12aebf(0x164)),_0x3f7446[_0x12aebf(0x17d)](formatValidationResult(_0x3e87f3,_0xdd7399,_0x5acb45));}return _0x3f7446[_0x12aebf(0x12c)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4fe29c){const _0xc71780=a119_0x4f28a3,_0x3a422a=new Set(),_0xa6a0bb=new Map(),_0x31074c=collectSegmentUsageCounts(_0x4fe29c);if(_0x4fe29c[_0xc71780(0x1e4)])for(const [_0x185fc2,_0x39b2c3]of Object['entries'](_0x4fe29c[_0xc71780(0x1e4)])){_0x3a422a[_0xc71780(0x11e)](_0x185fc2);if(_0x39b2c3[_0xc71780(0x123)]){const _0x291a08=yamlRuleToApi(_0x39b2c3[_0xc71780(0x123)]),_0xe2bf88=apiRuleToYaml(_0x291a08);_0xa6a0bb[_0xc71780(0x102)](_0x185fc2,_0xe2bf88);}}const _0x40eb2a=new Map();let _0x37d6e3=0x0;for(const [_0x55a89a,_0x387388]of _0xa6a0bb){const _0x2a0ba6=serializeExpandedRule(_0x387388,_0xa6a0bb),_0x94df38=_0x40eb2a[_0xc71780(0x11f)](_0x2a0ba6)||[];_0x94df38['push']({'name':_0x55a89a,'index':_0x37d6e3}),_0x40eb2a[_0xc71780(0x102)](_0x2a0ba6,_0x94df38),_0x37d6e3++;}const _0x357d9c=new Map();for(const [_0x43e442,_0x51e736]of _0x40eb2a){const _0x419db8=_0x51e736[_0xc71780(0x166)]()['sort']((_0x3ed0d7,_0x5febf1)=>{const _0x1fe316=_0xc71780,_0x3d05e8=_0x31074c[_0x1fe316(0x11f)](_0x3ed0d7['name'])||0x0,_0x272089=_0x31074c[_0x1fe316(0x11f)](_0x5febf1[_0x1fe316(0x13b)])||0x0;if(_0x3d05e8!==_0x272089)return _0x272089-_0x3d05e8;return _0x3ed0d7[_0x1fe316(0x15c)]-_0x5febf1[_0x1fe316(0x15c)];})[_0xc71780(0x134)](_0x534d55=>_0x534d55[_0xc71780(0x13b)]),_0x51cf08=[];for(const _0x39f7c1 of _0x419db8){const _0x1a286d=_0x31074c[_0xc71780(0x11f)](_0x39f7c1)||0x0,_0x201b35=Math['max'](_0x1a286d,0x1);for(let _0x29adf1=0x0;_0x29adf1<_0x201b35;_0x29adf1++){_0x51cf08['push'](_0x39f7c1);}}_0x357d9c['set'](_0x43e442,_0x51cf08);}return{'existingLocalSegmentNames':_0x3a422a,'localSegmentRules':_0xa6a0bb,'localExpandedRuleToNames':_0x357d9c};}async function buildServerSegmentRuleMap(_0x5473be,_0x286295,_0x420af3,_0x34a5e1){const _0x4c2bd0=new Map(),_0xa7cfee=new Set(),_0x58c850=async _0x5ddf22=>{const _0x4d2026=a119_0x2c28;if(_0xa7cfee[_0x4d2026(0x155)](_0x5ddf22))return;_0xa7cfee[_0x4d2026(0x11e)](_0x5ddf22);let _0xcc8ca3=_0x420af3[_0x4d2026(0x1d2)](_0x132f5c=>_0x132f5c['id']===_0x5ddf22);if(!_0xcc8ca3)try{_0xcc8ca3=await _0x5473be[_0x4d2026(0x132)][_0x4d2026(0x10c)](_0x286295,_0x5ddf22);}catch{return;}if(!_0xcc8ca3?.['rule'])return;const _0x3c55ae=apiRuleToYaml(_0xcc8ca3[_0x4d2026(0x123)]);_0x4c2bd0[_0x4d2026(0x102)](_0x5ddf22,_0x3c55ae);const _0x25c7ea=collectSegmentRefsFromRule(_0x3c55ae);for(const _0x534012 of _0x25c7ea){await _0x58c850(_0x534012);}};for(const _0x5575c8 of _0x34a5e1){await _0x58c850(_0x5575c8);}return _0x4c2bd0;}export function createSegmentIdResolver(_0x339d1a,_0xd1ef36){return async _0x5cfb5b=>{const _0x277c16=a119_0x2c28,_0x519287=_0x339d1a['get'](_0x5cfb5b);if(!_0x519287)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x277c16(0xff)+_0x5cfb5b+_0x277c16(0x11a)+_0xd1ef36+'\x27)');return _0x519287;};}export function extractRootFolderId(_0x414444){const _0xf2e5d3=a119_0x4f28a3;return _0x414444[_0xf2e5d3(0x1b9)]?.[_0xf2e5d3(0x1d4)]?.[_0xf2e5d3(0x128)]?.['id']||_0x414444[_0xf2e5d3(0x1b9)]?.[_0xf2e5d3(0x11d)]?.[_0xf2e5d3(0x128)]?.['id'];}export function buildConnectionMaps(_0x1b3881){const _0x4e9626=a119_0x4f28a3,_0x2094b0=new Map(),_0x3aa3dc=new Map(),_0x5e5417=new Map();for(const _0x589c0d of _0x1b3881){_0x2094b0[_0x4e9626(0x102)](_0x589c0d[_0x4e9626(0x13b)],parseInt(_0x589c0d['id'],0xa)),_0x3aa3dc[_0x4e9626(0x102)](_0x589c0d['id'],_0x589c0d[_0x4e9626(0x13b)]),_0x5e5417[_0x4e9626(0x102)](_0x589c0d['name'],_0x589c0d[_0x4e9626(0x1c6)]);}return{'nameToId':_0x2094b0,'idToName':_0x3aa3dc,'nameToType':_0x5e5417};}export function calculatePushStats(_0x331cdc,_0x4b78f2,_0x4b56e7,_0x9fefad,_0x31dbb8,_0x35b438,_0x39a44f){const _0x3a7bf9=a119_0x4f28a3,_0x78905a=_0x331cdc['filter'](_0xc61514=>_0xc61514[_0x3a7bf9(0x19d)]),_0x28a447=_0x331cdc[_0x3a7bf9(0x15a)](_0x44d1f4=>!_0x44d1f4[_0x3a7bf9(0x19d)]&&_0x44d1f4['hasChanges']),_0x7d23d8=_0x331cdc[_0x3a7bf9(0x15a)](_0x7df72e=>!_0x7df72e[_0x3a7bf9(0x19d)]&&!_0x7df72e[_0x3a7bf9(0x195)]),_0x57b16a=_0x35b438?_0x9fefad:[],_0x2e74cd=_0x4b78f2[_0x3a7bf9(0x15a)](_0x3fe0b1=>_0x3fe0b1['isNew']),_0x2dfdfd=_0x4b78f2[_0x3a7bf9(0x15a)](_0x5534dd=>!_0x5534dd[_0x3a7bf9(0x19d)]&&_0x5534dd[_0x3a7bf9(0x195)]),_0x5c6ff9=_0x4b78f2[_0x3a7bf9(0x15a)](_0x46ab05=>!_0x46ab05[_0x3a7bf9(0x19d)]&&!_0x46ab05[_0x3a7bf9(0x195)]),_0x33b547=_0x35b438?_0x31dbb8:[],_0x230ba7=_0x331cdc[_0x3a7bf9(0x1d7)](_0x305823=>_0x305823[_0x3a7bf9(0x126)]),_0x45be7b=_0x230ba7[_0x3a7bf9(0x15a)](_0x5c57af=>_0x5c57af[_0x3a7bf9(0x1c6)]===_0x3a7bf9(0x1db)),_0x4564ad=_0x230ba7['filter'](_0x22f95c=>_0x22f95c[_0x3a7bf9(0x1c6)]===_0x3a7bf9(0x197)),_0x17ce55=_0x230ba7['filter'](_0x1a4195=>_0x1a4195[_0x3a7bf9(0x1c6)]===_0x3a7bf9(0x1e5)),_0x710224=Array[_0x3a7bf9(0x1a7)](_0x4b56e7)[_0x3a7bf9(0x15b)](),_0x27d19b=_0x39a44f?![]:_0x78905a[_0x3a7bf9(0x129)]>0x0||_0x28a447[_0x3a7bf9(0x129)]>0x0||_0x57b16a['length']>0x0,_0x565e90=_0x2e74cd['length']>0x0||_0x2dfdfd[_0x3a7bf9(0x129)]>0x0||_0x33b547[_0x3a7bf9(0x129)]>0x0,_0x149dd9=_0x39a44f?![]:_0x230ba7[_0x3a7bf9(0x129)]>0x0,_0x10d6b3=_0x710224[_0x3a7bf9(0x129)]>0x0;return{'segments':{'new':_0x78905a,'changed':_0x28a447,'unchanged':_0x7d23d8,'toDelete':_0x57b16a},'journeys':{'new':_0x2e74cd,'changed':_0x2dfdfd,'unchanged':_0x5c6ff9,'toDelete':_0x33b547},'activations':{'all':_0x230ba7,'toCreate':_0x45be7b,'toUpdate':_0x4564ad,'toDelete':_0x17ce55},'folders':{'toCreate':_0x710224},'counts':{'segments':{'new':_0x78905a[_0x3a7bf9(0x129)],'changed':_0x28a447['length'],'unchanged':_0x7d23d8['length'],'toDelete':_0x57b16a[_0x3a7bf9(0x129)]},'journeys':{'new':_0x2e74cd[_0x3a7bf9(0x129)],'changed':_0x2dfdfd[_0x3a7bf9(0x129)],'unchanged':_0x5c6ff9[_0x3a7bf9(0x129)],'toDelete':_0x33b547[_0x3a7bf9(0x129)]},'activations':{'create':_0x45be7b[_0x3a7bf9(0x129)],'update':_0x4564ad[_0x3a7bf9(0x129)],'delete':_0x17ce55['length']},'folders':_0x710224[_0x3a7bf9(0x129)]},'hasChanges':_0x27d19b||_0x565e90||_0x149dd9||_0x10d6b3};}export async function buildPushExecutionContext(_0x55675f,_0xbe9078,_0x226389,_0xd6cdf6,_0xe58f7,_0x5b0c9a){const _0x2aa2cf=a119_0x4f28a3,_0x4ed21c=extractRootFolderId(_0x226389),{pathToId:_0x1a314b,idToPath:_0x3e289e}=buildFolderMaps(_0xe58f7),_0x5c2f07=buildSegmentNameToIdMap(_0xd6cdf6),_0x5c9814=new Map(),{batchAsync:_0x11d99e}=await import(_0x2aa2cf(0x118)),[_0x3645d6,_0x47dd32]=await Promise['all']([_0x55675f[_0x2aa2cf(0x199)][_0x2aa2cf(0x1ab)](),_0x55675f[_0x2aa2cf(0x18f)][_0x2aa2cf(0x13c)](),((async()=>{const _0x29d525=_0x2aa2cf;!_0x5b0c9a&&_0xd6cdf6[_0x29d525(0x129)]>0x0&&await _0x11d99e(_0xd6cdf6,async _0x109176=>{const _0x51d749=_0x29d525,_0x3c7008=await _0x55675f[_0x51d749(0x132)]['listActivations'](_0xbe9078,_0x109176['id']);_0x5c9814[_0x51d749(0x102)](_0x109176['id'],_0x3c7008);});})())]),{emailToId:_0x13c413,idToEmail:_0x40acfa}=_0x3645d6,_0x5a099e=buildConnectionMaps(_0x47dd32);return{'rootFolderId':_0x4ed21c,'folderPathToId':_0x1a314b,'folderIdToPath':_0x3e289e,'segmentNameToId':_0x5c2f07,'activationsBySegmentId':_0x5c9814,'emailToIdMap':_0x13c413,'idToEmailMap':_0x40acfa,'connectionNameToIdMap':_0x5a099e[_0x2aa2cf(0x1e1)],'connectionIdToNameMap':_0x5a099e[_0x2aa2cf(0x187)],'connectionNameToTypeMap':_0x5a099e[_0x2aa2cf(0x101)]};}export function createPushYamlContextForBundle(_0x5766eb,_0x354b52,_0x3cbbe2,_0xc72f42,_0x2af621,_0x21f959,_0x30c3dd,_0x1df004){const {existingLocalSegmentNames:_0x20f9b9,localExpandedRuleToNames:_0x9c2959}=_0xc72f42,_0x596f60=new Set(),_0x2aa40f=new Map(),_0x4e6e39=new Map(),_0x1d8430=new Map(),_0x4373ec=createJumpTargetCache(),_0x545388=new Map(),_0x4504fd=new Map(),_0x39e357=new Set();let _0x2269f9;const _0x141cda=_0x11f6bd=>{const _0x2a8783={'resolveSegment':async _0x206467=>{const _0x1ba7ce=a119_0x2c28,_0x3cf7d1=_0x1d8430[_0x1ba7ce(0x11f)](_0x206467);if(_0x3cf7d1!==undefined)return{'name':_0x3cf7d1,'isJourneyLocal':!![]};try{let _0x596509=_0x3cbbe2[_0x1ba7ce(0x1d2)](_0x3d8faf=>_0x3d8faf['id']===_0x206467);!_0x596509&&(_0x596509=await _0x5766eb[_0x1ba7ce(0x132)][_0x1ba7ce(0x10c)](_0x354b52,_0x206467));const _0x96ab7e=generateJourneyLocalName(_0x596509[_0x1ba7ce(0x13b)]),_0x26f7d1=_0x596509[_0x1ba7ce(0x115)]===SEGMENT_KIND_JOURNEY&&_0x96ab7e!==undefined;let _0x27b433=_0x596509[_0x1ba7ce(0x13b)],_0x4129c5;if(_0x26f7d1&&_0x596509['rule']){const _0x39e583=apiRuleToYaml(_0x596509['rule']);_0x4504fd[_0x1ba7ce(0x102)](_0x206467,_0x39e583);const _0x34492a=async _0x58e216=>{const _0x53936d=_0x1ba7ce,_0x2acbf1=collectSegmentRefsFromRule(_0x58e216);for(const _0x321651 of _0x2acbf1){if(!_0x4504fd[_0x53936d(0x155)](_0x321651))try{const _0x4f0f18=await _0x5766eb[_0x53936d(0x132)][_0x53936d(0x10c)](_0x354b52,_0x321651);if(_0x4f0f18?.[_0x53936d(0x123)]){const _0x15d011=apiRuleToYaml(_0x4f0f18[_0x53936d(0x123)]);_0x4504fd[_0x53936d(0x102)](_0x321651,_0x15d011),await _0x34492a(_0x15d011);}}catch{}}};await _0x34492a(_0x39e583);const _0x1e6478=serializeExpandedRule(_0x39e583,_0x4504fd),_0x4bdffd=_0x9c2959[_0x1ba7ce(0x11f)](_0x1e6478);if(_0x4bdffd&&_0x4bdffd[_0x1ba7ce(0x129)]>0x0){const _0x259e6b=_0x2aa40f[_0x1ba7ce(0x11f)](_0x1e6478)||0x0,_0x169926=_0x4bdffd[_0x259e6b]||_0x4bdffd[_0x4bdffd['length']-0x1];_0x2aa40f[_0x1ba7ce(0x102)](_0x1e6478,_0x259e6b+0x1),_0x27b433=_0x169926,_0x596f60[_0x1ba7ce(0x11e)](_0x27b433),_0x1d8430[_0x1ba7ce(0x102)](_0x206467,_0x27b433);const _0x25a188=await resolveRuleSegmentRefs(_0x39e583,async _0x44dbc4=>{const _0x2f9655=_0x1ba7ce,_0x266149=_0x1d8430[_0x2f9655(0x11f)](_0x44dbc4);if(_0x266149)return _0x266149;const _0x489e88=await _0x2269f9[_0x2f9655(0x138)](_0x44dbc4);return _0x489e88[_0x2f9655(0x13b)];});_0x4129c5={'description':_0x596509[_0x1ba7ce(0x194)],'rule':_0x25a188};}else{const _0xeafb47=_0x545388['get'](_0x1e6478);if(_0xeafb47)_0x27b433=_0xeafb47,_0x1d8430[_0x1ba7ce(0x102)](_0x206467,_0x27b433);else{if(_0x96ab7e){let _0x1f1a38=_0x96ab7e,_0x54921=0x2;while(_0x596f60['has'](_0x1f1a38)||_0x20f9b9[_0x1ba7ce(0x155)](_0x1f1a38)){_0x1f1a38=_0x96ab7e+'_'+_0x54921,_0x54921++;}_0x596f60[_0x1ba7ce(0x11e)](_0x1f1a38),_0x27b433=_0x1f1a38;}_0x1d8430['set'](_0x206467,_0x27b433),_0x545388[_0x1ba7ce(0x102)](_0x1e6478,_0x27b433);const _0x16ec01=await resolveRuleSegmentRefs(_0x39e583,async _0x9db26a=>{const _0x1c14b0=_0x1ba7ce,_0x2ad618=_0x1d8430['get'](_0x9db26a);if(_0x2ad618)return _0x2ad618;const _0x58620a=await _0x2269f9[_0x1c14b0(0x138)](_0x9db26a);return _0x58620a[_0x1c14b0(0x13b)];});_0x4129c5={'description':_0x596509[_0x1ba7ce(0x194)],'rule':_0x16ec01};}}}return{'name':_0x27b433,'isJourneyLocal':_0x26f7d1,'definition':_0x4129c5};}catch{return{'name':_0x206467,'isJourneyLocal':![]};}},'resolveActivation':async _0x10a8ec=>{const _0x1ecb2e=a119_0x2c28,_0xd64e8e=_0x4e6e39[_0x1ecb2e(0x11f)](_0x10a8ec);if(_0xd64e8e!==undefined)return{'name':_0xd64e8e,'isJourneyLocal':!![]};try{let _0x2a7887=_0x30c3dd?.[_0x1ecb2e(0x11f)](_0x10a8ec);!_0x2a7887&&(_0x2a7887=await _0x5766eb[_0x1ecb2e(0x183)][_0x1ecb2e(0x15d)](_0x11f6bd,_0x10a8ec));const _0x325a20=_0x2a7887[_0x1ecb2e(0x156)][_0x1ecb2e(0x171)]['name']||_0x10a8ec,_0x4874b1=sanitizeYamlKey(_0x325a20)||_0x1ecb2e(0x160)+_0x10a8ec,_0x1a6026=_0x4874b1;_0x4e6e39['set'](_0x10a8ec,_0x1a6026);const _0x53b610=journeyActivationStepToYaml(_0x2a7887,_0x2af621,_0x21f959);return{'name':_0x1a6026,'isJourneyLocal':!![],'definition':_0x53b610};}catch{return{'name':_0x10a8ec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2f309e,_0x1d8f1b)=>resolveJumpTarget(_0x2f309e,_0x1d8f1b,_0x4373ec,async _0x77e1e2=>{const _0x32d57e=a119_0x2c28,_0x2b57d7=_0x1df004?.[_0x32d57e(0x11f)](_0x77e1e2);if(_0x2b57d7)return _0x2b57d7;return _0x5766eb[_0x32d57e(0x183)][_0x32d57e(0x106)](_0x77e1e2);})};return _0x2269f9=_0x2a8783,_0x2a8783;},_0x57d5bb=async _0x6c8efb=>{const _0x68008a=a119_0x2c28,{collectSegmentIdsFromJourneyApi:_0x5a3832}=await import('./journey-yaml.js'),{batchAsync:_0x2511ae}=await import(_0x68008a(0x118)),_0x1996de=new Set();for(const _0x57a6c3 of _0x6c8efb){let _0xc76d12=_0x1df004?.[_0x68008a(0x11f)](_0x57a6c3);!_0xc76d12&&(_0xc76d12=await _0x5766eb['journey'][_0x68008a(0x106)](_0x57a6c3));const _0xb66cbe=_0x5a3832(_0xc76d12);for(const _0x2a9fff of _0xb66cbe){_0x1996de[_0x68008a(0x11e)](_0x2a9fff);}}let _0x29b572=Array[_0x68008a(0x1a7)](_0x1996de);while(_0x29b572[_0x68008a(0x129)]>0x0){const _0x4188d6=_0x29b572[_0x68008a(0x15a)](_0x288bea=>!_0x39e357['has'](_0x288bea));if(_0x4188d6[_0x68008a(0x129)]===0x0)break;const _0x5b25fd=await _0x2511ae(_0x4188d6,async _0x34f0c7=>{const _0x4c2246=_0x68008a;_0x39e357['add'](_0x34f0c7);let _0x4e373b=_0x3cbbe2[_0x4c2246(0x1d2)](_0xef8fa=>_0xef8fa['id']===_0x34f0c7);if(!_0x4e373b)try{_0x4e373b=await _0x5766eb['segment'][_0x4c2246(0x10c)](_0x354b52,_0x34f0c7);}catch{return null;}return{'segmentId':_0x34f0c7,'segment':_0x4e373b};},0xa),_0x4750e5=new Set();for(const _0x5cd471 of _0x5b25fd){if(!_0x5cd471?.[_0x68008a(0x132)]?.[_0x68008a(0x123)])continue;const _0x2de31e=apiRuleToYaml(_0x5cd471['segment']['rule']);_0x4504fd[_0x68008a(0x102)](_0x5cd471[_0x68008a(0x139)],_0x2de31e);const _0x262175=collectSegmentRefsFromRule(_0x2de31e);for(const _0x5b3de2 of _0x262175){!_0x39e357[_0x68008a(0x155)](_0x5b3de2)&&_0x4750e5[_0x68008a(0x11e)](_0x5b3de2);}}_0x29b572=Array[_0x68008a(0x1a7)](_0x4750e5);}};return{'createYamlContext':_0x141cda,'prefetchJourneySegments':_0x57d5bb};}export async function executePushSegments(_0x552b14,_0x34a8fb,_0x200998,_0x5409d,_0x5211b7){const _0x1eaa72=a119_0x4f28a3,{segmentDefToCreateRequest:_0x18dffd,segmentDefToUpdateRequest:_0x5759ee}=await import('./child-segment-yaml.js'),_0x5441a9=_0x200998['folderPathToId'],_0x16f2bd=0x5,_0x566803=async _0x2bf6d3=>{const _0x10bf6d=a119_0x2c28,_0x3f5c74=_0x2bf6d3[_0x10bf6d(0x184)]?_0x5441a9[_0x10bf6d(0x11f)](_0x2bf6d3[_0x10bf6d(0x184)]):undefined;let _0x45cff7;const _0x5c5eb5={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2bf6d3[_0x10bf6d(0x19d)]){_0x5211b7[_0x10bf6d(0x136)]?.({'type':_0x10bf6d(0x149),'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]});const _0x42c7df=_0x18dffd(_0x2bf6d3[_0x10bf6d(0x1a4)],_0x3f5c74),_0x16b209=await _0x5211b7['withProgress'](_0x10bf6d(0x17c)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+'\x27...',()=>_0x552b14['segment'][_0x10bf6d(0x12a)](_0x5409d[_0x10bf6d(0x119)],_0x42c7df));_0x45cff7=_0x16b209[_0x10bf6d(0x128)]['id'],_0x5c5eb5['createdSegmentId']={'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)],'id':_0x45cff7},_0x5211b7[_0x10bf6d(0x136)]?.({'type':_0x10bf6d(0x15e),'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)],'segmentId':_0x45cff7}),_0x5211b7[_0x10bf6d(0x145)]?.(_0x10bf6d(0x176)+_0x2bf6d3[_0x10bf6d(0x1a4)]['name']+'\x27'),_0x5c5eb5[_0x10bf6d(0x124)]=0x1;}else{if(_0x2bf6d3[_0x10bf6d(0x195)]){_0x5211b7[_0x10bf6d(0x136)]?.({'type':_0x10bf6d(0x13e),'name':_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]});const _0x3dd09d=_0x5759ee(_0x2bf6d3[_0x10bf6d(0x1a4)]);_0x3f5c74!==_0x2bf6d3[_0x10bf6d(0x131)]?.[_0x10bf6d(0x1d0)]&&(_0x3dd09d[_0x10bf6d(0x1d0)]=_0x3f5c74?parseInt(_0x3f5c74,0xa):undefined),await _0x5211b7[_0x10bf6d(0x1d6)](_0x10bf6d(0x12f)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+'\x27...',()=>_0x552b14[_0x10bf6d(0x132)][_0x10bf6d(0xf9)](_0x5409d[_0x10bf6d(0x119)],_0x2bf6d3[_0x10bf6d(0x131)]['id'],_0x3dd09d)),_0x45cff7=_0x2bf6d3[_0x10bf6d(0x131)]['id'],_0x5211b7['onProgress']?.({'type':_0x10bf6d(0x1ac),'name':_0x2bf6d3[_0x10bf6d(0x1a4)]['name']}),_0x5211b7['logSuccess']?.(_0x10bf6d(0x104)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+'\x27'),_0x5c5eb5[_0x10bf6d(0x108)]=0x1;}else _0x45cff7=_0x2bf6d3[_0x10bf6d(0x131)]['id'];}}catch(_0x2e7939){const _0x313d4d=isHttp400Error(_0x2e7939),_0x16c5ef=_0x313d4d?ErrorCode[_0x10bf6d(0x1cd)]:ErrorCode[_0x10bf6d(0x18c)],_0xc4dfd5=getErrorMessage(_0x2e7939);throw new SDKError(_0x16c5ef,_0x10bf6d(0x109)+(_0x2bf6d3[_0x10bf6d(0x19d)]?_0x10bf6d(0x1db):_0x10bf6d(0x197))+_0x10bf6d(0x1bd)+_0x2bf6d3[_0x10bf6d(0x19f)]+'\x0a\x20\x20'+_0xc4dfd5,_0x2e7939);}try{const _0x42d34c=await syncActivationsForSegment(_0x552b14,_0x5409d['parentId'],_0x45cff7,_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)],_0x2bf6d3[_0x10bf6d(0x126)],_0x5211b7,_0x2bf6d3[_0x10bf6d(0x19f)]);_0x5c5eb5['activations']=_0x42d34c;}catch(_0x513552){if(_0x513552 instanceof SDKError)throw _0x513552;throw new SDKError(ErrorCode[_0x10bf6d(0x144)],_0x10bf6d(0x111)+_0x2bf6d3[_0x10bf6d(0x1a4)][_0x10bf6d(0x13b)]+_0x10bf6d(0x165)+_0x2bf6d3['absolutePath']+_0x10bf6d(0x127)+getErrorMessage(_0x513552),_0x513552);}return _0x5c5eb5;},_0xd8a3ef=await batchAsync(_0x34a8fb,_0x566803,_0x16f2bd),_0xdbabf8={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2b4f15 of _0xd8a3ef){_0xdbabf8['created']+=_0x2b4f15[_0x1eaa72(0x124)],_0xdbabf8[_0x1eaa72(0x108)]+=_0x2b4f15[_0x1eaa72(0x108)],_0x2b4f15[_0x1eaa72(0x180)]&&_0xdbabf8['createdSegmentIds'][_0x1eaa72(0x102)](_0x2b4f15[_0x1eaa72(0x180)][_0x1eaa72(0x13b)],_0x2b4f15[_0x1eaa72(0x180)]['id']),_0xdbabf8[_0x1eaa72(0x189)][_0x1eaa72(0x124)]+=_0x2b4f15['activations'][_0x1eaa72(0x124)],_0xdbabf8['activations'][_0x1eaa72(0x108)]+=_0x2b4f15['activations']['updated'],_0xdbabf8[_0x1eaa72(0x189)][_0x1eaa72(0x13a)]+=_0x2b4f15[_0x1eaa72(0x189)][_0x1eaa72(0x13a)];}return _0xdbabf8;}async function syncActivationsForSegment(_0x4bd4ef,_0x578348,_0x2cd111,_0x65f92b,_0x564b65,_0x1407fd,_0x19130e){const _0x306fbd=a119_0x4f28a3,_0x2d7129={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x1dabd9 of _0x564b65){try{if(_0x1dabd9[_0x306fbd(0x1c6)]===_0x306fbd(0x1db)&&_0x1dabd9[_0x306fbd(0x182)])_0x1407fd['onProgress']?.({'type':_0x306fbd(0x162),'segmentName':_0x65f92b,'activationName':_0x1dabd9['name']}),await _0x1407fd['withProgress']('Creating\x20activation\x20\x27'+_0x1dabd9[_0x306fbd(0x13b)]+'\x27...',()=>_0x4bd4ef[_0x306fbd(0x132)]['createActivation'](_0x578348,_0x2cd111,_0x1dabd9[_0x306fbd(0x182)])),_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1a3),'segmentName':_0x65f92b,'activationName':_0x1dabd9['name']}),_0x1407fd[_0x306fbd(0x145)]?.(_0x306fbd(0x17f)+_0x1dabd9[_0x306fbd(0x13b)]+'\x27'),_0x2d7129[_0x306fbd(0x124)]++;else{if(_0x1dabd9['type']===_0x306fbd(0x197)&&_0x1dabd9[_0x306fbd(0x182)]&&_0x1dabd9[_0x306fbd(0x1a5)])_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1df),'segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),await _0x1407fd[_0x306fbd(0x1d6)](_0x306fbd(0x188)+_0x1dabd9[_0x306fbd(0x13b)]+_0x306fbd(0x1b5),()=>_0x4bd4ef[_0x306fbd(0x132)][_0x306fbd(0x17a)](_0x578348,_0x2cd111,_0x1dabd9['existingActivation']['id'],_0x1dabd9[_0x306fbd(0x182)])),_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1b4),'segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),_0x1407fd[_0x306fbd(0x145)]?.(_0x306fbd(0x185)+_0x1dabd9['name']+'\x27'),_0x2d7129['updated']++;else _0x1dabd9[_0x306fbd(0x1c6)]===_0x306fbd(0x1e5)&&_0x1dabd9[_0x306fbd(0x1a5)]&&(_0x1407fd[_0x306fbd(0x136)]?.({'type':_0x306fbd(0x1ba),'segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),await _0x1407fd[_0x306fbd(0x1d6)](_0x306fbd(0x107)+_0x1dabd9[_0x306fbd(0x13b)]+_0x306fbd(0x1b5),()=>_0x4bd4ef[_0x306fbd(0x132)][_0x306fbd(0x190)](_0x578348,_0x2cd111,_0x1dabd9['existingActivation']['id'])),_0x1407fd['onProgress']?.({'type':'activation_deleted','segmentName':_0x65f92b,'activationName':_0x1dabd9[_0x306fbd(0x13b)]}),_0x1407fd[_0x306fbd(0x1c9)]?.(_0x306fbd(0x161)+_0x1dabd9[_0x306fbd(0x13b)]+'\x27'),_0x2d7129[_0x306fbd(0x13a)]++);}}catch(_0x3f8d3f){const _0x4014c5=isHttp400Error(_0x3f8d3f),_0x45eff6=_0x4014c5?ErrorCode[_0x306fbd(0xfd)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0xa0ce19=getErrorMessage(_0x3f8d3f);throw new SDKError(_0x45eff6,_0x306fbd(0x109)+_0x1dabd9[_0x306fbd(0x1c6)]+_0x306fbd(0x1b8)+_0x1dabd9[_0x306fbd(0x13b)]+_0x306fbd(0x165)+_0x19130e+_0x306fbd(0x127)+_0xa0ce19,_0x3f8d3f);}}return _0x2d7129;}export async function executePushFolders(_0x12ddf7,_0x2dab6c,_0x500d59,_0x2972d1,_0x56ee4d){const _0x4f59ff=a119_0x4f28a3,_0x38ad35=new Map(_0x500d59);for(const _0xe97eed of _0x2dab6c){const _0x4b142b=_0xe97eed[_0x4f59ff(0x1c0)]('/'),_0x3e97c0=_0x4b142b[_0x4b142b[_0x4f59ff(0x129)]-0x1],_0x415d1c=_0x4b142b[_0x4f59ff(0x166)](0x0,-0x1)['join']('/'),_0x9e4c1f=_0x38ad35['get'](_0x415d1c);_0x56ee4d['onProgress']?.({'type':'folder_creating','folder':_0xe97eed});const _0x38b602={'name':_0x3e97c0,'parentFolderId':_0x9e4c1f},_0x268382=await _0x56ee4d[_0x4f59ff(0x1d6)](_0x4f59ff(0x1a6)+_0xe97eed+_0x4f59ff(0x1b5),()=>_0x12ddf7['segment'][_0x4f59ff(0x179)](_0x2972d1[_0x4f59ff(0x119)],_0x38b602));_0x38ad35[_0x4f59ff(0x102)](_0xe97eed,_0x268382[_0x4f59ff(0x128)]['id']),_0x56ee4d[_0x4f59ff(0x136)]?.({'type':'folder_created','folder':_0xe97eed,'folderId':_0x268382[_0x4f59ff(0x128)]['id']}),_0x56ee4d[_0x4f59ff(0x158)]?.(_0x4f59ff(0x14f)+_0xe97eed+'\x27');}return _0x38ad35;}export async function executePushSegmentDeletions(_0x3c07bd,_0x5788e1,_0x3394ea){const _0x43071a=a119_0x4f28a3;if(_0x5788e1['length']===0x0)return 0x0;const {batchAsync:_0x2dbcee}=await import(_0x43071a(0x118)),_0x4a48fe=0x5,_0x21b8f2=await _0x2dbcee(_0x5788e1,async _0xf6e0b1=>{const _0x12ff78=_0x43071a;return _0x3394ea['onProgress']?.({'type':_0x12ff78(0x16f),'name':_0xf6e0b1[_0x12ff78(0x13b)]}),await _0x3c07bd[_0x12ff78(0x132)][_0x12ff78(0x1c1)](_0xf6e0b1['id']),_0x3394ea[_0x12ff78(0x136)]?.({'type':_0x12ff78(0x1e6),'name':_0xf6e0b1[_0x12ff78(0x13b)]}),_0x3394ea[_0x12ff78(0x1c9)]?.(_0x12ff78(0x16b)+_0xf6e0b1[_0x12ff78(0x13b)]+'\x27'),0x1;},_0x4a48fe);return _0x21b8f2[_0x43071a(0x174)]((_0x41fc3d,_0x503f27)=>_0x41fc3d+_0x503f27,0x0);}export async function executePushJourneys(_0x1d8358,_0x466a8c,_0x128931,_0xbbaa83,_0x2c3322){const _0x31d0bf=a119_0x4f28a3,{journeyDefToRequest:_0x8f4a92}=await import(_0x31d0bf(0x14d)),{activationDefToCreateRequest:_0x5b436a,yamlRuleToApi:_0x29e49b,validateSegmentRule:_0x4beec9}=await import(_0x31d0bf(0x103)),_0x353e44={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x431a67=new Map(_0x128931[_0x31d0bf(0x1c7)]),_0x9e758f=0x5;for(let _0xe46b7=0x0;_0xe46b7<_0x466a8c[_0x31d0bf(0x129)];_0xe46b7+=_0x9e758f){const _0x173bdd=_0x466a8c[_0x31d0bf(0x166)](_0xe46b7,_0xe46b7+_0x9e758f),_0x33e89a=await Promise[_0x31d0bf(0x17b)](_0x173bdd['map'](async _0x38ffb6=>{const _0x382cb5=_0x31d0bf;if(!_0x38ffb6[_0x382cb5(0x19d)]&&!_0x38ffb6[_0x382cb5(0x195)])return{'action':_0x382cb5(0x1be),'name':_0x38ffb6['yamlConfig']['name'],'journeyId':_0x38ffb6[_0x382cb5(0x1b2)]?.['id']};const _0x389ce6=_0x38ffb6[_0x382cb5(0x184)]?_0x128931[_0x382cb5(0x1b3)][_0x382cb5(0x11f)](_0x38ffb6[_0x382cb5(0x184)]):undefined;_0x2c3322[_0x382cb5(0x136)]?.({'type':_0x38ffb6[_0x382cb5(0x19d)]?'journey_creating':_0x382cb5(0x172),'name':_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)]});try{const _0x4014f3=await executeSingleJourneyPush(_0x1d8358,_0x38ffb6,{..._0x128931,'segmentNameToId':_0x431a67},{'parentId':_0xbbaa83[_0x382cb5(0x119)],'rootFolderId':_0xbbaa83['rootFolderId'],'folderId':_0x389ce6,'verbose':_0xbbaa83['verbose']},_0x2c3322,{'journeyDefToRequest':_0x8f4a92,'activationDefToCreateRequest':_0x5b436a,'yamlRuleToApi':_0x29e49b,'validateSegmentRule':_0x4beec9});for(const [_0x470076,_0x45f6da]of _0x4014f3[_0x382cb5(0x1c3)]){_0x431a67['set'](_0x470076,_0x45f6da),_0x353e44[_0x382cb5(0x1c3)]['set'](_0x470076,_0x45f6da);}if(_0x4014f3[_0x382cb5(0x14c)]===_0x382cb5(0x124))_0x2c3322[_0x382cb5(0x136)]?.({'type':_0x382cb5(0x16c),'name':_0x38ffb6['yamlConfig'][_0x382cb5(0x13b)],'journeyId':_0x4014f3[_0x382cb5(0x1b1)]}),_0x2c3322['logSuccess']?.('Created\x20journey\x20\x27'+_0x38ffb6['yamlConfig'][_0x382cb5(0x13b)]+'\x27'),_0x353e44[_0x382cb5(0x124)]++;else _0x4014f3[_0x382cb5(0x14c)]===_0x382cb5(0x108)&&(_0x2c3322[_0x382cb5(0x136)]?.({'type':'journey_updated','name':_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)]}),_0x2c3322['logSuccess']?.(_0x382cb5(0x1e3)+_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)]+'\x27'),_0x353e44['updated']++);return{'action':_0x4014f3['action'],'name':_0x38ffb6[_0x382cb5(0x1a4)][_0x382cb5(0x13b)],'journeyId':_0x4014f3['journeyId']};}catch(_0x5c5806){const _0x3b2fbb=isHttp400Error(_0x5c5806),_0x3e6513=_0x3b2fbb?ErrorCode[_0x382cb5(0x14b)]:ErrorCode[_0x382cb5(0x170)],_0x7173de=getErrorMessage(_0x5c5806);throw new SDKError(_0x3e6513,_0x382cb5(0x109)+(_0x38ffb6[_0x382cb5(0x19d)]?'create':_0x382cb5(0x197))+_0x382cb5(0x193)+_0x38ffb6[_0x382cb5(0x19f)]+_0x382cb5(0x127)+_0x7173de,_0x5c5806);}}));_0x353e44[_0x31d0bf(0x1b6)]['push'](..._0x33e89a);}return _0x353e44;}async function executeSingleJourneyPush(_0x56e878,_0x2455da,_0x254f18,_0x195c95,_0x1cbff3,_0x45edbf){const _0x470eb7=a119_0x4f28a3,{journeyDefToRequest:_0x53c3f2,activationDefToCreateRequest:_0x18cda2,yamlRuleToApi:_0x54dcdf,validateSegmentRule:_0x78428}=_0x45edbf,_0x168d60=new Map(),_0x3175c1=new Map(),_0x2d4f3f=new Map(),_0x28df19=new Map(),_0x353796=new Map();let _0x255bec;const _0x49bef1=async()=>{const _0x1f2f87=a119_0x2c28;if(_0x255bec)return;_0x255bec=new Map();if(!_0x2455da['existingJourney'])return;const _0x300435=await _0x56e878[_0x1f2f87(0x183)][_0x1f2f87(0x1a0)](_0x2455da['existingJourney']['id']);for(const _0x11777e of _0x300435){const _0x22e7a1=journeyActivationStepToYaml(_0x11777e,_0x254f18[_0x1f2f87(0x19c)],_0x254f18[_0x1f2f87(0x135)]),_0x54ea33=activationSignature(_0x22e7a1);!_0x255bec[_0x1f2f87(0x155)](_0x54ea33)&&_0x255bec[_0x1f2f87(0x102)](_0x54ea33,_0x11777e['id']),_0x22e7a1[_0x1f2f87(0x13b)]&&_0x3175c1['set'](_0x22e7a1['name'],_0x11777e['id']);}};if(_0x2455da[_0x470eb7(0x1b2)]&&_0x2455da[_0x470eb7(0x1a4)][_0x470eb7(0x1e4)]){const _0x35cd68=buildLocalExpandedRuleMappings(_0x2455da[_0x470eb7(0x1a4)]),_0x1af5c1=_0x35cd68[_0x470eb7(0x1d9)];if(_0x1af5c1[_0x470eb7(0x1a1)]>0x0){const _0x1bd7a6=new Map();for(const [_0x3a27d8,_0x1c8ea1]of _0x1af5c1){const _0x54594a=serializeExpandedRule(_0x1c8ea1,_0x1af5c1);_0x1bd7a6['set'](_0x3a27d8,_0x54594a);}const _0x46532b=collectSegmentIdsFromJourneyApi(_0x2455da[_0x470eb7(0x1b2)]);if(_0x46532b[_0x470eb7(0x1a1)]>0x0){const _0xfd76a3=await buildServerSegmentRuleMap(_0x56e878,_0x195c95['parentId'],_0x254f18['existingSegments'],_0x46532b);if(_0xfd76a3['size']>0x0){const _0x50798a=new Map();for(const [_0x2b087b,_0x49e300]of _0xfd76a3){const _0x366cfb=serializeExpandedRule(_0x49e300,_0xfd76a3);!_0x50798a[_0x470eb7(0x155)](_0x366cfb)&&_0x50798a['set'](_0x366cfb,_0x2b087b);}for(const [_0x572f1e,_0x4e8b15]of _0x1bd7a6){const _0x5d8b21=_0x50798a[_0x470eb7(0x11f)](_0x4e8b15);_0x5d8b21&&(_0x353796[_0x470eb7(0x102)](_0x572f1e,_0x5d8b21),_0x254f18['segmentNameToId'][_0x470eb7(0x102)](_0x572f1e,_0x5d8b21));}}}}}const _0x1ba95f={'resolveSegmentId':async _0x383f3d=>{const _0x9c5f6c=_0x470eb7,_0x458c91=_0x254f18['segmentNameToId'][_0x9c5f6c(0x11f)](_0x383f3d);if(!_0x458c91)throw new SDKError(ErrorCode[_0x9c5f6c(0x1ce)],_0x9c5f6c(0xff)+_0x383f3d+'\x20(referenced\x20in\x20journey\x20'+_0x2455da[_0x9c5f6c(0x1a4)]['name']+')');return _0x458c91;},'resolveEmbeddedSegmentId':async(_0x6d1635,_0x5a9bd4)=>{const _0x5c4291=_0x470eb7,_0x3350f3=_0x254f18[_0x5c4291(0x1c7)][_0x5c4291(0x11f)](_0x6d1635);if(_0x3350f3)return _0x3350f3;const _0x32f7f7=_0x353796['get'](_0x6d1635);if(_0x32f7f7)return _0x254f18[_0x5c4291(0x1c7)][_0x5c4291(0x102)](_0x6d1635,_0x32f7f7),_0x32f7f7;const _0x40df14=_0x254f18[_0x5c4291(0x196)][_0x5c4291(0x1d2)](_0x10084a=>_0x10084a[_0x5c4291(0x13b)]===_0x6d1635);if(_0x40df14)return _0x254f18[_0x5c4291(0x1c7)]['set'](_0x6d1635,_0x40df14['id']),_0x40df14['id'];if(_0x2455da[_0x5c4291(0x19d)]){const {stageName:_0x408890,criteriaName:_0x41bfa0}=findSegmentCriteriaLocation(_0x2455da[_0x5c4291(0x1a4)],_0x6d1635);return _0x78428(_0x6d1635,_0x5a9bd4[_0x5c4291(0x123)]),_0x2d4f3f[_0x5c4291(0x102)](_0x6d1635,{'definition':_0x5a9bd4,'stageName':_0x408890,'criteriaName':_0x41bfa0}),createPendingSegmentId(_0x6d1635);}const _0x2ed946=_0x2455da['existingJourney']?.['id'];if(!_0x2ed946)throw new SDKError(ErrorCode[_0x5c4291(0x10b)],_0x5c4291(0x14a));_0x78428(_0x6d1635,_0x5a9bd4['rule']);const _0x5cb1c3=generateDeterministicJourneySegmentName(_0x2455da[_0x5c4291(0x1a4)][_0x5c4291(0x13b)],_0x6d1635),_0x79a898=_0x254f18[_0x5c4291(0x196)]['find'](_0x5c42ce=>_0x5c42ce[_0x5c4291(0x13b)]===_0x5cb1c3),_0x39271f=createSegmentIdResolver(_0x254f18[_0x5c4291(0x1c7)],_0x6d1635),_0x286220=await resolveRuleSegmentIds(_0x5a9bd4[_0x5c4291(0x123)],_0x39271f);let _0x3c86d4;if(_0x79a898)await _0x56e878['segment']['updateSegmentById'](_0x195c95[_0x5c4291(0x119)],_0x79a898['id'],{'description':_0x5a9bd4[_0x5c4291(0x194)]||_0x5c4291(0x13f)+_0x6d1635,'rule':_0x54dcdf(_0x286220,!![]),'countPopulation':!![]}),_0x3c86d4=_0x79a898['id'];else try{_0x3c86d4=await _0x56e878[_0x5c4291(0x132)][_0x5c4291(0x1bb)]({'name':_0x5cb1c3,'description':_0x5a9bd4[_0x5c4291(0x194)]||_0x5c4291(0x13f)+_0x6d1635,'journeyId':_0x2ed946,'rule':_0x54dcdf(_0x286220,!![]),'countPopulation':!![],'parentFolderId':_0x195c95[_0x5c4291(0xfe)]||'','audienceId':_0x195c95[_0x5c4291(0x119)]});}catch(_0x374065){const _0x3c99f3=_0x374065 instanceof Error&&_0x374065[_0x5c4291(0x175)][_0x5c4291(0x142)]('Name\x20has\x20already\x20been\x20taken');if(_0x3c99f3){const _0x22813f=await _0x56e878['segment'][_0x5c4291(0x186)](_0x195c95[_0x5c4291(0x119)]),_0x38c9fc=_0x22813f['find'](_0x538c69=>_0x538c69['name']===_0x5cb1c3);if(_0x38c9fc)await _0x56e878[_0x5c4291(0x132)][_0x5c4291(0xf9)](_0x195c95[_0x5c4291(0x119)],_0x38c9fc['id'],{'description':_0x5a9bd4[_0x5c4291(0x194)]||_0x5c4291(0x13f)+_0x6d1635,'rule':_0x54dcdf(_0x286220,!![]),'countPopulation':!![]}),_0x3c86d4=_0x38c9fc['id'];else throw _0x374065;}else throw _0x374065;}return _0x254f18[_0x5c4291(0x1c7)][_0x5c4291(0x102)](_0x6d1635,_0x3c86d4),_0x168d60[_0x5c4291(0x102)](_0x6d1635,_0x3c86d4),_0x3c86d4;},'resolveActivationId':async _0x424027=>{const _0x4137e7=_0x470eb7,_0x5e6c5f=_0x3175c1[_0x4137e7(0x11f)](_0x424027);if(_0x5e6c5f)return _0x5e6c5f;if(_0x2455da['existingJourney']){await _0x49bef1();const _0x58d214=_0x3175c1['get'](_0x424027);if(_0x58d214)return _0x58d214;}throw new SDKError(ErrorCode[_0x4137e7(0x198)],'Activation\x20not\x20found:\x20'+_0x424027+_0x4137e7(0x1af)+_0x2455da[_0x4137e7(0x1a4)][_0x4137e7(0x13b)]+_0x4137e7(0x1dd)+_0x4137e7(0x148));},'resolveEmbeddedActivationId':async(_0x3a8246,_0x349671)=>{const _0x4850e1=_0x470eb7,_0x14eb89=_0x3175c1[_0x4850e1(0x11f)](_0x3a8246);if(_0x14eb89)return _0x14eb89;if(_0x2455da['isNew'])return _0x28df19[_0x4850e1(0x102)](_0x3a8246,_0x349671),createPendingActivationId(_0x3a8246);if(_0x2455da[_0x4850e1(0x1b2)]){await _0x49bef1();const _0x22937b=_0x3175c1[_0x4850e1(0x11f)](_0x349671['name']);if(_0x22937b)return _0x3175c1[_0x4850e1(0x102)](_0x3a8246,_0x22937b),_0x22937b;const _0x293cae=activationSignature(_0x349671),_0x27aac2=_0x255bec?.[_0x4850e1(0x11f)](_0x293cae);if(_0x27aac2)return _0x3175c1['set'](_0x3a8246,_0x27aac2),_0x27aac2;const _0x425ccf=await _0x18cda2(_0x349671,_0x254f18[_0x4850e1(0x192)]),_0x2e6556=await _0x56e878['journey'][_0x4850e1(0x1e2)](_0x2455da[_0x4850e1(0x1b2)]['id'],_0x425ccf);return _0x3175c1[_0x4850e1(0x102)](_0x3a8246,_0x2e6556['id']),_0x2e6556['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x36ce92=>{const _0x498c40=_0x470eb7;try{return await _0x56e878['journey'][_0x498c40(0x1cc)](_0x195c95[_0x498c40(0x119)],_0x36ce92);}catch(_0x2dd682){throw new SDKError(ErrorCode[_0x498c40(0x198)],_0x498c40(0x150)+_0x36ce92+_0x498c40(0x1a8)+_0x2455da['yamlConfig']['name']+'\x27)',_0x2dd682);}},'resolveStageId':async(_0x113d7c,_0x4c6a2e)=>{const _0x19b8c9=_0x470eb7,_0xa9d301=await _0x56e878[_0x19b8c9(0x183)][_0x19b8c9(0x106)](_0x113d7c),_0x5a1fb9=_0xa9d301['attributes']['journeyStages'][_0x19b8c9(0x1d2)](_0x5e5aaa=>_0x5e5aaa[_0x19b8c9(0x13b)][_0x19b8c9(0x122)]()===_0x4c6a2e['toLowerCase']());if(!_0x5a1fb9?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x19b8c9(0x146)+_0x4c6a2e+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0xa9d301[_0x19b8c9(0x156)][_0x19b8c9(0xfb)]||_0xa9d301[_0x19b8c9(0x156)]['name'])+'\x27');return _0x5a1fb9['id'];}},_0xc1da0a=await _0x53c3f2(_0x2455da[_0x470eb7(0x1a4)],_0x195c95[_0x470eb7(0x119)],_0x1ba95f),_0x3295b4=_0x195c95['folderId']||_0x195c95[_0x470eb7(0xfe)];_0x3295b4&&(_0xc1da0a[_0x470eb7(0x1b9)]={'parentFolder':{'data':{'id':_0x3295b4,'type':_0x470eb7(0x10a)}}});if(_0x2455da[_0x470eb7(0x19d)]){if(_0x2d4f3f[_0x470eb7(0x1a1)]>0x0||_0x28df19[_0x470eb7(0x1a1)]>0x0)return await executeThreeStepJourneyCreate(_0x56e878,_0x2455da,_0xc1da0a,{'pendingEmbeddedSegments':_0x2d4f3f,'pendingEmbeddedActivations':_0x28df19,'embeddedSegmentNameToId':_0x168d60,'journeyActivationNameToId':_0x3175c1},{..._0x195c95,'effectiveFolderId':_0x3295b4},_0x254f18,_0x1cbff3,_0x45edbf);else{ensureJourneyDefaults(_0xc1da0a[_0x470eb7(0x156)]);const _0x555ff8=await _0x56e878[_0x470eb7(0x183)][_0x470eb7(0x1db)](_0xc1da0a);return{'action':_0x470eb7(0x124),'journeyId':_0x555ff8['id'],'embeddedSegmentNameToId':_0x168d60};}}else{if(_0x2455da['hasChanges']&&_0x2455da['existingJourney'])return ensureJourneyDefaults(_0xc1da0a[_0x470eb7(0x156)]),await _0x56e878[_0x470eb7(0x183)][_0x470eb7(0x197)](_0x2455da['existingJourney']['id'],_0xc1da0a),{'action':'updated','journeyId':_0x2455da[_0x470eb7(0x1b2)]['id'],'embeddedSegmentNameToId':_0x168d60};}return{'action':_0x470eb7(0x1be),'journeyId':_0x2455da[_0x470eb7(0x1b2)]?.['id'],'embeddedSegmentNameToId':_0x168d60};}function findSegmentCriteriaLocation(_0x2a080e,_0x1b9967){const _0x4e9714=a119_0x4f28a3,_0x3b54dd=_0x2a080e[_0x4e9714(0x159)]||_0x2a080e[_0x4e9714(0x11c)]?.[0x0]?.['stages']||[];let _0x37bc67=_0x4e9714(0x12e),_0x6dfdcb=_0x1b9967;const _0x28a153=_0x2a080e['goal']||_0x2a080e[_0x4e9714(0x11c)]?.[0x0]?.[_0x4e9714(0x1e0)];if(_0x28a153?.[_0x4e9714(0x132)]===_0x1b9967)return{'stageName':'goal','criteriaName':_0x28a153['name']||_0x1b9967};_0x22b783:for(const _0x1f620e of _0x3b54dd){if(_0x1f620e['entry_criteria']?.[_0x4e9714(0x132)]===_0x1b9967){_0x37bc67=_0x1f620e[_0x4e9714(0x13b)],_0x6dfdcb=_0x1f620e[_0x4e9714(0x16a)][_0x4e9714(0x13b)]||_0x1b9967;break;}if(_0x1f620e[_0x4e9714(0x154)])for(const _0x350b9a of _0x1f620e[_0x4e9714(0x154)]){if(_0x350b9a[_0x4e9714(0x1c6)]===_0x4e9714(0x1bf)&&_0x350b9a[_0x4e9714(0x1cf)]?.[_0x4e9714(0x16e)])for(const _0x434b0a of _0x350b9a[_0x4e9714(0x1cf)]['branches']){if(_0x434b0a['segment']===_0x1b9967){_0x37bc67=_0x1f620e[_0x4e9714(0x13b)],_0x6dfdcb=_0x434b0a['name']||_0x1b9967;break _0x22b783;}}}}return{'stageName':_0x37bc67,'criteriaName':_0x6dfdcb};}async function executeThreeStepJourneyCreate(_0x17ee19,_0x318927,_0x1aaeec,_0x2b70be,_0x3980fa,_0x16eabd,_0x34ddb2,_0x35e8d0){const _0x16fdd9=a119_0x4f28a3,{activationDefToCreateRequest:_0x4878d6,yamlRuleToApi:_0xb3cc2e}=_0x35e8d0,{pendingEmbeddedSegments:_0x85c537,pendingEmbeddedActivations:_0x3620b8,embeddedSegmentNameToId:_0xc44fed}=_0x2b70be,_0x45ae09=JSON['parse'](JSON[_0x16fdd9(0x18b)](_0x1aaeec));ensureJourneyDefaults(_0x45ae09[_0x16fdd9(0x156)]),stripPendingIds(_0x45ae09);const _0x3ff7e6=await _0x17ee19[_0x16fdd9(0x183)][_0x16fdd9(0x1db)](_0x45ae09),_0x497d85=_0x3ff7e6['id'],_0x3b731c=new Map();for(const _0x137773 of _0x3ff7e6['attributes'][_0x16fdd9(0x137)]){_0x3b731c['set'](_0x137773[_0x16fdd9(0x13b)][_0x16fdd9(0x122)](),_0x137773['id']);}for(const [_0x5f1e99,{definition:_0x5a2bcd}]of _0x85c537){const _0x2f9823=generateDeterministicJourneySegmentName(_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],_0x5f1e99);_0x34ddb2['onProgress']?.({'type':_0x16fdd9(0x1ad),'journeyName':_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],'segmentName':_0x5f1e99});const _0x51f774=createSegmentIdResolver(_0x16eabd[_0x16fdd9(0x1c7)],_0x5f1e99),_0x47ca9d=await resolveRuleSegmentIds(_0x5a2bcd[_0x16fdd9(0x123)],_0x51f774),_0x156478=await _0x17ee19[_0x16fdd9(0x132)][_0x16fdd9(0x1bb)]({'name':_0x2f9823,'description':_0x5a2bcd[_0x16fdd9(0x194)]||_0x16fdd9(0x13f)+_0x5f1e99,'journeyId':_0x497d85,'rule':_0xb3cc2e(_0x47ca9d,!![]),'countPopulation':!![],'parentFolderId':_0x3980fa[_0x16fdd9(0x173)]||'','audienceId':_0x3980fa[_0x16fdd9(0x119)]});_0xc44fed[_0x16fdd9(0x102)](_0x5f1e99,_0x156478),_0x16eabd[_0x16fdd9(0x1c7)]['set'](_0x5f1e99,_0x156478),_0x34ddb2[_0x16fdd9(0x136)]?.({'type':_0x16fdd9(0x130),'journeyName':_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],'segmentName':_0x5f1e99});}const _0x12818b=new Map();for(const [_0x4676c4,_0x229df5]of _0x3620b8){_0x34ddb2['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x318927['yamlConfig'][_0x16fdd9(0x13b)],'activationName':_0x4676c4});const _0x45dd68=await _0x4878d6(_0x229df5,_0x16eabd[_0x16fdd9(0x192)]),_0x471e26=await _0x17ee19['journey'][_0x16fdd9(0x1e2)](_0x497d85,_0x45dd68);_0x12818b[_0x16fdd9(0x102)](_0x4676c4,_0x471e26['id']),_0x2b70be['journeyActivationNameToId'][_0x16fdd9(0x102)](_0x4676c4,_0x471e26['id']),_0x34ddb2[_0x16fdd9(0x136)]?.({'type':_0x16fdd9(0x120),'journeyName':_0x318927[_0x16fdd9(0x1a4)][_0x16fdd9(0x13b)],'activationName':_0x4676c4});}const _0x403bc7=JSON[_0x16fdd9(0x133)](JSON[_0x16fdd9(0x18b)](_0x1aaeec));return _0x403bc7['id']=_0x497d85,ensureJourneyDefaults(_0x403bc7[_0x16fdd9(0x156)]),resolvePendingIdsInRequest(_0x403bc7,_0x1aaeec,_0x3b731c,_0xc44fed,_0x12818b,_0x34ddb2),await _0x17ee19[_0x16fdd9(0x183)][_0x16fdd9(0x197)](_0x497d85,_0x403bc7),{'action':_0x16fdd9(0x124),'journeyId':_0x497d85,'embeddedSegmentNameToId':_0xc44fed};}function stripPendingIds(_0x3b516f){const _0x2144d6=a119_0x4f28a3;for(const _0x5a1d3c of _0x3b516f[_0x2144d6(0x156)][_0x2144d6(0x137)]||[]){_0x5a1d3c['entryCriteria']?.[_0x2144d6(0x139)]&&isPendingSegmentId(_0x5a1d3c[_0x2144d6(0x1d1)]['segmentId'])&&delete _0x5a1d3c[_0x2144d6(0x1d1)];if(_0x5a1d3c['steps'])for(const _0xfb017f of Object[_0x2144d6(0x147)](_0x5a1d3c[_0x2144d6(0x154)])){const _0x4cfad2=_0x5a1d3c[_0x2144d6(0x154)][_0xfb017f];_0x4cfad2['type']===_0x2144d6(0x1dc)&&_0x4cfad2[_0x2144d6(0x152)]&&isPendingActivationId(_0x4cfad2[_0x2144d6(0x152)])&&(_0x4cfad2['journeyActivationStepId']='');if(_0x4cfad2['type']==='DecisionPoint'&&_0x4cfad2[_0x2144d6(0x16e)])for(const _0x4ef901 of _0x4cfad2[_0x2144d6(0x16e)]){_0x4ef901[_0x2144d6(0x139)]&&isPendingSegmentId(_0x4ef901[_0x2144d6(0x139)])&&(_0x4ef901['segmentId']='');}_0x4cfad2[_0x2144d6(0x1c6)]===_0x2144d6(0x15f)&&_0x4cfad2[_0x2144d6(0x168)]?.['segmentId']&&isPendingSegmentId(_0x4cfad2['waitCondition'][_0x2144d6(0x139)])&&(_0x4cfad2[_0x2144d6(0x168)][_0x2144d6(0x139)]='');}}}function resolvePendingIdsInRequest(_0x12df44,_0x5742cb,_0x3ae61c,_0xc9aae0,_0xb64173,_0xc5714c){const _0x29adc9=a119_0x4f28a3,_0x5bfed4=(_0x3eff7d,_0x462eca)=>{const _0xf998bc=a119_0x2c28;if(!isPendingSegmentId(_0x3eff7d))return _0x3eff7d;const _0x565e5f=extractPendingSegmentName(_0x3eff7d),_0x2c9560=_0xc9aae0['get'](_0x565e5f);return!_0x2c9560&&_0xc5714c[_0xf998bc(0x1de)]?.(_0xf998bc(0x1bc)+_0x565e5f+_0xf998bc(0x1ae)+_0x462eca),_0x2c9560;};if(_0x12df44['attributes'][_0x29adc9(0x1e0)]?.['segmentId']&&isPendingSegmentId(_0x12df44[_0x29adc9(0x156)][_0x29adc9(0x1e0)][_0x29adc9(0x139)])){const _0x5dfdaa=_0x5bfed4(_0x12df44[_0x29adc9(0x156)][_0x29adc9(0x1e0)]['segmentId'],_0x29adc9(0x1cb));_0x5dfdaa&&(_0x12df44[_0x29adc9(0x156)]['goal'][_0x29adc9(0x139)]=_0x5dfdaa);}for(const _0x1c91f4 of _0x12df44[_0x29adc9(0x156)][_0x29adc9(0x137)]||[]){const _0x4b2e58=_0x3ae61c[_0x29adc9(0x11f)](_0x1c91f4[_0x29adc9(0x13b)][_0x29adc9(0x122)]());_0x4b2e58&&(_0x1c91f4['id']=_0x4b2e58);if(_0x1c91f4[_0x29adc9(0x1d1)]?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x1c91f4[_0x29adc9(0x1d1)][_0x29adc9(0x139)])){const _0x1fb221=_0x5bfed4(_0x1c91f4[_0x29adc9(0x1d1)]['segmentId'],'stage\x20\x27'+_0x1c91f4['name']+_0x29adc9(0x167));_0x1fb221&&(_0x1c91f4[_0x29adc9(0x1d1)][_0x29adc9(0x139)]=_0x1fb221);}if(_0x1c91f4[_0x29adc9(0x143)])for(const _0x48629d of _0x1c91f4[_0x29adc9(0x143)]){if(_0x48629d[_0x29adc9(0x139)]&&isPendingSegmentId(_0x48629d['segmentId'])){const _0x26ee2c=_0x5bfed4(_0x48629d['segmentId'],'stage\x20\x27'+_0x1c91f4[_0x29adc9(0x13b)]+_0x29adc9(0x19e));_0x26ee2c&&(_0x48629d[_0x29adc9(0x139)]=_0x26ee2c);}}if(_0x1c91f4['milestone']?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x1c91f4[_0x29adc9(0x125)][_0x29adc9(0x139)])){const _0x3fabca=_0x5bfed4(_0x1c91f4['milestone']['segmentId'],_0x29adc9(0x100)+_0x1c91f4['name']+'\x27\x20milestone');_0x3fabca&&(_0x1c91f4[_0x29adc9(0x125)]['segmentId']=_0x3fabca);}if(_0x1c91f4[_0x29adc9(0x154)]){const _0x316526=_0x32f95f=>_0x5742cb['attributes'][_0x29adc9(0x137)][_0x29adc9(0x1d2)](_0x206014=>_0x206014['name']['toLowerCase']()===_0x1c91f4[_0x29adc9(0x13b)][_0x29adc9(0x122)]())?.[_0x29adc9(0x154)]?.[_0x32f95f];for(const _0x5861ab of Object['keys'](_0x1c91f4[_0x29adc9(0x154)])){const _0x41c9e2=_0x1c91f4[_0x29adc9(0x154)][_0x5861ab],_0x172da9=_0x316526(_0x5861ab);if(_0x41c9e2[_0x29adc9(0x1c6)]==='Activation'&&_0x41c9e2[_0x29adc9(0x152)]&&(isPendingActivationId(_0x41c9e2[_0x29adc9(0x152)])||_0x41c9e2[_0x29adc9(0x152)]==='')){if(_0x172da9?.[_0x29adc9(0x152)]&&isPendingActivationId(_0x172da9[_0x29adc9(0x152)])){const _0x5d397f=extractPendingActivationName(_0x172da9[_0x29adc9(0x152)]),_0x4890a0=_0xb64173[_0x29adc9(0x11f)](_0x5d397f);_0x4890a0&&(_0x41c9e2['journeyActivationStepId']=_0x4890a0);}}if(_0x41c9e2[_0x29adc9(0x1c6)]==='DecisionPoint'&&_0x41c9e2[_0x29adc9(0x16e)]&&_0x172da9?.['branches'])for(let _0x2e147e=0x0;_0x2e147e<_0x41c9e2[_0x29adc9(0x16e)][_0x29adc9(0x129)];_0x2e147e++){const _0x1f74cc=_0x41c9e2['branches'][_0x2e147e],_0x2d7226=_0x172da9[_0x29adc9(0x16e)][_0x2e147e];if(_0x2d7226?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x2d7226['segmentId'])){const _0x447027=_0x5bfed4(_0x2d7226[_0x29adc9(0x139)],_0x29adc9(0x100)+_0x1c91f4['name']+_0x29adc9(0x181)+(_0x1f74cc[_0x29adc9(0x13b)]||_0x2e147e)+'\x27');_0x447027&&(_0x1f74cc['segmentId']=_0x447027);}}if(_0x41c9e2[_0x29adc9(0x1c6)]===_0x29adc9(0x15f)&&_0x41c9e2[_0x29adc9(0x168)]?.[_0x29adc9(0x139)]&&_0x172da9?.[_0x29adc9(0x168)]?.[_0x29adc9(0x139)]&&isPendingSegmentId(_0x172da9[_0x29adc9(0x168)]['segmentId'])){const _0x2ef2f6=_0x5bfed4(_0x172da9[_0x29adc9(0x168)]['segmentId'],_0x29adc9(0x100)+_0x1c91f4[_0x29adc9(0x13b)]+_0x29adc9(0x105));_0x2ef2f6&&(_0x41c9e2[_0x29adc9(0x168)][_0x29adc9(0x139)]=_0x2ef2f6);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x574c8a,_0x276c2c){const _0x454fa8=a120_0x3833,_0x4b4c5c=_0x574c8a();while(!![]){try{const _0x276669=-parseInt(_0x454fa8(0x1ac))/0x1*(-parseInt(_0x454fa8(0x1a3))/0x2)+parseInt(_0x454fa8(0x1a5))/0x3*(-parseInt(_0x454fa8(0x1af))/0x4)+-parseInt(_0x454fa8(0x1a9))/0x5*(parseInt(_0x454fa8(0x1a7))/0x6)+parseInt(_0x454fa8(0x1ae))/0x7*(parseInt(_0x454fa8(0x1a4))/0x8)+-parseInt(_0x454fa8(0x1b0))/0x9*(-parseInt(_0x454fa8(0x1b5))/0xa)+-parseInt(_0x454fa8(0x1a8))/0xb+-parseInt(_0x454fa8(0x1ab))/0xc*(parseInt(_0x454fa8(0x1b2))/0xd);if(_0x276669===_0x276c2c)break;else _0x4b4c5c['push'](_0x4b4c5c['shift']());}catch(_0x1c680c){_0x4b4c5c['push'](_0x4b4c5c['shift']());}}}(a120_0x4a4b,0x23460));export function buildFolderIdToPathMap(_0xf3e73){const _0x1c0a93=a120_0x3833,_0x462761=new Map(),_0x5bb96=new Map();for(const _0x41983a of _0xf3e73){_0x5bb96[_0x1c0a93(0x1a6)](_0x41983a['id'],_0x41983a);}const _0x3a9ba8=new Set();for(const _0x427b78 of _0xf3e73){!_0x427b78[_0x1c0a93(0x1b3)]&&_0x3a9ba8[_0x1c0a93(0x1b4)](_0x427b78['id']);}function _0x6d0a8c(_0x2fa1){const _0x233e78=_0x1c0a93;if(_0x462761[_0x233e78(0x1ad)](_0x2fa1['id']))return _0x462761[_0x233e78(0x1aa)](_0x2fa1['id']);if(_0x3a9ba8[_0x233e78(0x1ad)](_0x2fa1['id']))return _0x462761['set'](_0x2fa1['id'],''),'';if(_0x2fa1[_0x233e78(0x1b3)]){const _0x4aefc4=_0x5bb96[_0x233e78(0x1aa)](_0x2fa1['parentFolderId']);if(_0x4aefc4){const _0x30dd98=_0x6d0a8c(_0x4aefc4),_0x1e8603=_0x30dd98?_0x30dd98+'/'+_0x2fa1[_0x233e78(0x1b1)]:_0x2fa1[_0x233e78(0x1b1)];return _0x462761[_0x233e78(0x1a6)](_0x2fa1['id'],_0x1e8603),_0x1e8603;}}const _0x489ba8=_0x2fa1[_0x233e78(0x1b1)];return _0x462761[_0x233e78(0x1a6)](_0x2fa1['id'],_0x489ba8),_0x489ba8;}for(const _0x393848 of _0xf3e73){_0x6d0a8c(_0x393848);}return _0x462761;}function a120_0x3833(_0x412de7,_0x423928){_0x412de7=_0x412de7-0x1a3;const _0x4a4bd7=a120_0x4a4b();let _0x3833d1=_0x4a4bd7[_0x412de7];return _0x3833d1;}export function buildFolderPathToIdMap(_0x444403){const _0x1b7a3b=a120_0x3833,_0x52a296=new Map(),_0x241c58=new Map();for(const _0x2695d6 of _0x444403){_0x241c58[_0x1b7a3b(0x1a6)](_0x2695d6['id'],_0x2695d6);}const _0x34e870=new Set();for(const _0x3745b6 of _0x444403){!_0x3745b6[_0x1b7a3b(0x1b3)]&&_0x34e870['add'](_0x3745b6['id']);}function _0x2a6de5(_0x4de55a){const _0x481c62=_0x1b7a3b;if(_0x34e870['has'](_0x4de55a['id']))return'';if(_0x4de55a['parentFolderId']){const _0x4433ab=_0x241c58[_0x481c62(0x1aa)](_0x4de55a[_0x481c62(0x1b3)]);if(_0x4433ab){const _0x528c5f=_0x2a6de5(_0x4433ab);return _0x528c5f?_0x528c5f+'/'+_0x4de55a[_0x481c62(0x1b1)]:_0x4de55a['name'];}}return _0x4de55a[_0x481c62(0x1b1)];}for(const _0x426013 of _0x444403){const _0x4654ef=_0x2a6de5(_0x426013);_0x52a296[_0x1b7a3b(0x1a6)](_0x4654ef,_0x426013['id']);}return _0x52a296;}export function buildFolderMaps(_0xa76e0d){const _0x54cf21=a120_0x3833,_0xa7aaca=buildFolderIdToPathMap(_0xa76e0d),_0x16b684=new Map();for(const [_0x14aae3,_0xcc2b26]of _0xa7aaca){_0x16b684[_0x54cf21(0x1a6)](_0xcc2b26,_0x14aae3);}return{'idToPath':_0xa7aaca,'pathToId':_0x16b684};}function a120_0x4a4b(){const _0x5b5647=['1182NMaxuK','2163678bwPBlb','40gqkFZx','get','17412XfWlMj','58rMFwhV','has','492198lCJLPR','296ghoDAe','581481rNvTDP','name','26uThJaj','parentFolderId','add','40EUZapE','8552AvWtKW','8rkPOVE','9369qFZhSA','set'];a120_0x4a4b=function(){return _0x5b5647;};return a120_0x4a4b();}export function getFolderPath(_0x5c8a9b,_0x2e9d02){if(!_0x5c8a9b)return'';return _0x2e9d02['get'](_0x5c8a9b)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x56a5af,_0x4c9d6a){const _0x5f4ab6=a121_0x3223,_0x5c0e2f=_0x56a5af();while(!![]){try{const _0x5ee2c0=parseInt(_0x5f4ab6(0x1b2))/0x1*(parseInt(_0x5f4ab6(0x1be))/0x2)+parseInt(_0x5f4ab6(0x1b4))/0x3*(parseInt(_0x5f4ab6(0x18c))/0x4)+-parseInt(_0x5f4ab6(0x1bc))/0x5*(parseInt(_0x5f4ab6(0x196))/0x6)+parseInt(_0x5f4ab6(0x1a8))/0x7*(-parseInt(_0x5f4ab6(0x1ad))/0x8)+parseInt(_0x5f4ab6(0x1bb))/0x9*(parseInt(_0x5f4ab6(0x18b))/0xa)+-parseInt(_0x5f4ab6(0x1b9))/0xb*(parseInt(_0x5f4ab6(0x191))/0xc)+-parseInt(_0x5f4ab6(0x195))/0xd*(-parseInt(_0x5f4ab6(0x19f))/0xe);if(_0x5ee2c0===_0x4c9d6a)break;else _0x5c0e2f['push'](_0x5c0e2f['shift']());}catch(_0x37f412){_0x5c0e2f['push'](_0x5c0e2f['shift']());}}}(a121_0x38d9,0xe3886));import a121_0x4fca57 from'path';function a121_0x38d9(){const _0x20e313=['segment','.yaml','15613frJqyV','12OxdBGv','resolve','Relative\x20path\x20cannot\x20be\x20empty','join','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','tdx.json','Path\x20attempts\x20to\x20navigate\x20above\x20root','segments','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','7042YQrOWJ','raw','push','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','parse','replace','name','Cannot\x20split\x20empty\x20path','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','140sSTrkn','test','Path\x20segment\x20cannot\x20be\x20empty','relative','isAbsolute','600536thJxxc','substring','pop','trim','startsWith','65SutTIo','type','66IojGmH','exists','filter','Path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','9790OvUZbm','dirname','424314BmTGbN','803905TbArkq','split','40678UdpzBS','journey','.yml','230AmbcPO','257580JJNqLi','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','length','slice','22548OGdtYA','readFile'];a121_0x38d9=function(){return _0x20e313;};return a121_0x38d9();}import{parse as a121_0x2b24e9}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x313ac4){const _0x18ca14=a121_0x3223;if(!_0x313ac4||_0x313ac4[_0x18ca14(0x1b0)]()==='')throw new Error(_0x18ca14(0x1b7));const _0x3152c5=_0x313ac4[_0x18ca14(0x1b0)]();if(_0x3152c5==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x313ac4};const _0x94503a=_0x3152c5['startsWith']('/')?_0x3152c5[_0x18ca14(0x1ae)](0x1):_0x3152c5,_0x54bb43=_0x94503a[_0x18ca14(0x1bd)]('/')[_0x18ca14(0x1b6)](_0x399d5e=>_0x399d5e!=='');if(_0x54bb43[_0x18ca14(0x18f)]===0x0)throw new Error(_0x18ca14(0x19e));const _0x2c1443=_0x3152c5['startsWith']('/')||!isRelativePathSegment(_0x54bb43[0x0]);for(const _0x32ee98 of _0x54bb43){validatePathSegment(_0x32ee98);}return{'segments':_0x54bb43,'isAbsolute':_0x2c1443,'raw':_0x313ac4};}function isRelativePathSegment(_0xa462f7){return _0xa462f7==='.'||_0xa462f7==='..';}function validatePathSegment(_0x313f7c){const _0x1b865d=a121_0x3223;if(_0x313f7c==='')throw new Error(_0x1b865d(0x1aa));if(_0x313f7c==='.'||_0x313f7c==='..')return;if(/[\x00-\x1F\x7F]/[_0x1b865d(0x1a9)](_0x313f7c))throw new Error(_0x1b865d(0x18e)+_0x313f7c);if(_0x313f7c!==_0x313f7c[_0x1b865d(0x1b0)]()){}}export function validatePath(_0x33e4eb){const _0xeb92e8=a121_0x3223;if(_0x33e4eb[_0xeb92e8(0x19d)][_0xeb92e8(0x18f)]===0x0&&!_0x33e4eb['isAbsolute'])throw new Error(_0xeb92e8(0x198));if(_0x33e4eb[_0xeb92e8(0x1ac)]){if(_0x33e4eb[_0xeb92e8(0x19d)][0x0]==='..')throw new Error(_0xeb92e8(0x1a2));let _0x356e40=0x0;for(const _0x38a8b1 of _0x33e4eb[_0xeb92e8(0x19d)]){if(_0x38a8b1==='..'){if(_0x356e40===0x0)throw new Error(_0xeb92e8(0x19c));_0x356e40--;}else _0x38a8b1!=='.'&&_0x356e40++;}}}export function joinPaths(_0x361bf,_0x206be1){const _0x2dd7aa=a121_0x3223;if(!_0x361bf||_0x361bf==='/')return _0x206be1;if(!_0x206be1||_0x206be1==='.')return _0x361bf;if(_0x206be1[_0x2dd7aa(0x1b1)]('/'))return _0x206be1;const _0x1fbc3f=parsePath(_0x361bf),_0x5727fa=parsePath(_0x206be1),_0x105cad=[..._0x1fbc3f[_0x2dd7aa(0x19d)]];for(const _0x57e046 of _0x5727fa[_0x2dd7aa(0x19d)]){if(_0x57e046==='.')continue;else{if(_0x57e046==='..'){if(_0x105cad['length']===0x0)throw new Error(_0x2dd7aa(0x1b8));_0x105cad[_0x2dd7aa(0x1af)]();}else _0x105cad[_0x2dd7aa(0x1a1)](_0x57e046);}}const _0x1625e8=_0x105cad[_0x2dd7aa(0x199)]('/');return _0x1fbc3f[_0x2dd7aa(0x1a0)]['startsWith']('/')?'/'+_0x1625e8:_0x1625e8;}export function normalizePath(_0x3c8edb){const _0x3abd38=a121_0x3223,_0x447f12=parsePath(_0x3c8edb),_0x35de24=[];for(const _0x58e57f of _0x447f12['segments']){if(_0x58e57f==='.')continue;else{if(_0x58e57f==='..'){if(_0x35de24[_0x3abd38(0x18f)]===0x0){if(_0x447f12[_0x3abd38(0x1ac)])throw new Error(_0x3abd38(0x1b8));_0x35de24[_0x3abd38(0x1a1)]('..');}else _0x35de24[_0x35de24[_0x3abd38(0x18f)]-0x1]==='..'?_0x35de24[_0x3abd38(0x1a1)]('..'):_0x35de24[_0x3abd38(0x1af)]();}else _0x35de24[_0x3abd38(0x1a1)](_0x58e57f);}}if(_0x35de24['length']===0x0)return _0x447f12[_0x3abd38(0x1ac)]?'/':'.';const _0x37d617=_0x35de24[_0x3abd38(0x199)]('/');return _0x447f12[_0x3abd38(0x1a0)]['startsWith']('/')?'/'+_0x37d617:_0x37d617;}function a121_0x3223(_0x10d421,_0xbc134a){_0x10d421=_0x10d421-0x189;const _0x38d907=a121_0x38d9();let _0x3223da=_0x38d907[_0x10d421];return _0x3223da;}export function getParentPath(_0x3e846b){const _0x4f5324=a121_0x3223,_0x473cd2=parsePath(_0x3e846b);if(_0x473cd2[_0x4f5324(0x19d)][_0x4f5324(0x18f)]<=0x1)return'/';const _0x4e974a=_0x473cd2[_0x4f5324(0x19d)][_0x4f5324(0x190)](0x0,-0x1)[_0x4f5324(0x199)]('/');return _0x473cd2[_0x4f5324(0x1a0)]['startsWith']('/')?'/'+_0x4e974a:_0x4e974a;}export function getBaseName(_0x300a1c){const _0x3cd322=a121_0x3223,_0xdfe036=parsePath(_0x300a1c);return _0xdfe036[_0x3cd322(0x19d)][_0xdfe036['segments'][_0x3cd322(0x18f)]-0x1]||'';}export function isChildPath(_0x1eb4eb,_0x5295ac){const _0x594392=a121_0x3223,_0x4670dc=parsePath(_0x1eb4eb),_0x2b0650=parsePath(_0x5295ac);if(_0x4670dc[_0x594392(0x19d)][_0x594392(0x18f)]<=_0x2b0650[_0x594392(0x19d)][_0x594392(0x18f)])return![];for(let _0x4ba508=0x0;_0x4ba508<_0x2b0650['segments'][_0x594392(0x18f)];_0x4ba508++){if(_0x4670dc[_0x594392(0x19d)][_0x4ba508]!==_0x2b0650[_0x594392(0x19d)][_0x4ba508])return![];}return!![];}export function splitPath(_0x3967f0){const _0x5db01c=a121_0x3223,_0x51f026=parsePath(_0x3967f0);if(_0x51f026['segments'][_0x5db01c(0x18f)]===0x0)throw new Error(_0x5db01c(0x1a6));if(_0x51f026[_0x5db01c(0x19d)][_0x5db01c(0x18f)]===0x1)return{'parent':_0x51f026['segments'][0x0]};return{'parent':_0x51f026[_0x5db01c(0x19d)][0x0],'child':_0x51f026[_0x5db01c(0x19d)]['slice'](0x1)['join']('/')};}export function isYamlFilePath(_0x58d649){const _0x13ddf1=a121_0x3223;return _0x58d649['endsWith'](_0x13ddf1(0x18a))||_0x58d649['endsWith'](_0x13ddf1(0x194));}export async function resolveYamlFilePath(_0x3c10b6,_0x39f097=nodeFileSystem){const _0x4eaefe=a121_0x3223,_0x86fc60=a121_0x4fca57[_0x4eaefe(0x197)](_0x3c10b6);if(!await _0x39f097['exists'](_0x86fc60))throw new Error('File\x20not\x20found:\x20'+_0x3c10b6);let _0x4eb272=a121_0x4fca57[_0x4eaefe(0x1ba)](_0x86fc60),_0x4005a2=null,_0x355323=null;const _0x150b01=a121_0x4fca57['parse'](_0x4eb272)['root'];while(_0x4eb272!==_0x150b01){const _0x227f16=a121_0x4fca57[_0x4eaefe(0x199)](_0x4eb272,_0x4eaefe(0x19b));if(await _0x39f097[_0x4eaefe(0x1b5)](_0x227f16)){_0x4005a2=_0x227f16,_0x355323=_0x4eb272;break;}_0x4eb272=a121_0x4fca57[_0x4eaefe(0x1ba)](_0x4eb272);}if(!_0x4005a2||!_0x355323)throw new Error(_0x4eaefe(0x18d)+_0x3c10b6);const _0x2f8b48=await _0x39f097[_0x4eaefe(0x192)](_0x4005a2),_0x59500f=JSON[_0x4eaefe(0x1a3)](_0x2f8b48),_0x57f5bb=_0x59500f['parent_segment'];if(!_0x57f5bb)throw new Error(_0x4eaefe(0x1a7));const _0x5b0b63=await _0x39f097[_0x4eaefe(0x192)](_0x86fc60),_0x334a6=a121_0x2b24e9(_0x5b0b63),_0x5f5a59=_0x334a6[_0x4eaefe(0x1a5)];if(!_0x5f5a59)throw new Error(_0x4eaefe(0x19a)+_0x3c10b6);const _0xf4d429=_0x334a6[_0x4eaefe(0x1b3)]===_0x4eaefe(0x189)?_0x4eaefe(0x189):_0x4eaefe(0x193),_0x439f00=a121_0x4fca57[_0x4eaefe(0x1ab)](_0x355323,_0x86fc60),_0x54dd7f=a121_0x4fca57[_0x4eaefe(0x1ba)](_0x439f00),_0x4b0990=_0x54dd7f==='.'?'':_0x54dd7f[_0x4eaefe(0x1a4)](/\\/g,'/'),_0x429fa3=_0x4b0990?_0x57f5bb+'/'+_0x4b0990+'/'+_0x5f5a59:_0x57f5bb+'/'+_0x5f5a59;return{'parentSegment':_0x57f5bb,'segmentName':_0x5f5a59,'folderPath':_0x4b0990,'fullPath':_0x429fa3,'resourceType':_0xf4d429};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5ce4c1,_0x2a67e9){const _0x27bfaa=a122_0x216f,_0x49fb9e=_0x5ce4c1();while(!![]){try{const _0x37dc56=parseInt(_0x27bfaa(0x176))/0x1*(-parseInt(_0x27bfaa(0x17c))/0x2)+-parseInt(_0x27bfaa(0x17a))/0x3*(-parseInt(_0x27bfaa(0x17d))/0x4)+parseInt(_0x27bfaa(0x17e))/0x5+parseInt(_0x27bfaa(0x177))/0x6*(-parseInt(_0x27bfaa(0x181))/0x7)+parseInt(_0x27bfaa(0x17f))/0x8+parseInt(_0x27bfaa(0x180))/0x9+parseInt(_0x27bfaa(0x17b))/0xa;if(_0x37dc56===_0x2a67e9)break;else _0x49fb9e['push'](_0x49fb9e['shift']());}catch(_0x129d0e){_0x49fb9e['push'](_0x49fb9e['shift']());}}}(a122_0x1465,0x1c5b4));function a122_0x216f(_0x995575,_0x37e55f){_0x995575=_0x995575-0x176;const _0x1465ae=a122_0x1465();let _0x216fe2=_0x1465ae[_0x995575];return _0x216fe2;}export function parseSegmentRef(_0x1ba550){const _0x553bcc=a122_0x216f,_0x27bb66=_0x1ba550[_0x553bcc(0x178)]('/');if(_0x27bb66===-0x1)return{'parentId':_0x1ba550};if(_0x27bb66===0x0)throw new Error(_0x553bcc(0x182)+_0x1ba550+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0xeb29aa=_0x1ba550[_0x553bcc(0x179)](0x0,_0x27bb66),_0x523150=_0x1ba550[_0x553bcc(0x179)](_0x27bb66+0x1);if(_0x523150==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1ba550+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0xeb29aa,'childId':_0x523150};}function a122_0x1465(){const _0x610b97=['20020PckSmc','20660bJNUJA','926832Vxoqpg','374121toVEUA','7syvYvU','Invalid\x20segment\x20reference\x20format:\x20','52382VZLWgP','273534ZmggQh','indexOf','substring','87AUGcvn','645650lkYoKG','8izlvSN'];a122_0x1465=function(){return _0x610b97;};return a122_0x1465();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd576ac,_0x384b13){const _0x75125b=a123_0x3d21,_0x34df70=_0xd576ac();while(!![]){try{const _0x4140b4=parseInt(_0x75125b(0x15c))/0x1+-parseInt(_0x75125b(0x155))/0x2*(parseInt(_0x75125b(0x167))/0x3)+-parseInt(_0x75125b(0x16b))/0x4*(-parseInt(_0x75125b(0x185))/0x5)+-parseInt(_0x75125b(0x17b))/0x6+-parseInt(_0x75125b(0x159))/0x7*(-parseInt(_0x75125b(0x16f))/0x8)+parseInt(_0x75125b(0x171))/0x9+-parseInt(_0x75125b(0x14f))/0xa*(parseInt(_0x75125b(0x16c))/0xb);if(_0x4140b4===_0x384b13)break;else _0x34df70['push'](_0x34df70['shift']());}catch(_0x146c1d){_0x34df70['push'](_0x34df70['shift']());}}}(a123_0x1ab0,0xb4969));function a123_0x3d21(_0x4d3361,_0x36f713){_0x4d3361=_0x4d3361-0x14e;const _0x1ab0f0=a123_0x1ab0();let _0x3d21f3=_0x1ab0f0[_0x4d3361];return _0x3d21f3;}import a123_0x5be149 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(_0x26bbd8){const _0x5123ed=a123_0x3d21;return _0x26bbd8[_0x5123ed(0x158)]!==_0x5123ed(0x166);}export function isScopedResolution(_0x2d6c3f){const _0x2c15c8=a123_0x3d21;return _0x2d6c3f[_0x2c15c8(0x158)]===_0x2c15c8(0x16e)||_0x2d6c3f[_0x2c15c8(0x158)]===_0x2c15c8(0x17f)||_0x2d6c3f[_0x2c15c8(0x158)]===_0x2c15c8(0x170);}export function getScopedDetails(_0xf63b57){const _0x224c19=a123_0x3d21;if(isScopedResolution(_0xf63b57))return{'isScoped':_0xf63b57['isScoped'],'scopedFolderPath':_0xf63b57[_0x224c19(0x15f)]};return undefined;}function a123_0x1ab0(){const _0x3165db=['File\x20not\x20found','join','journey','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','resolve','699698VEQxGc','cwd','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','type','1638YRBcps','stat','parent_segment','632910hKgnJB','trim','isFile','scopedFolderPath','message','parse','resourceType','exists','root','isScoped','error','3PWOLDX','startsWith','readFile','string','686300LMMBnv','1113827jIOcXK','relative','directory','8112MCNwKA','context','11435283faGkav','isDirectory','Parent\x20segment\x20not\x20specified','no_config','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','configDir','dirname','extname','tdx.json','segmentName','6408690JAFkAQ','No\x20tdx.json\x20found\x20for\x20file:\x20','segment','folderPath','file','replace','No\x20tdx.json\x20found','parentSegment','no_parent','file_not_found','30srUzvv','invalid_yaml','match','100RbUoDM'];a123_0x1ab0=function(){return _0x3165db;};return a123_0x1ab0();}async function findTdxConfigAsync(_0x4f2b01,_0x512f34){const _0x15dc72=a123_0x3d21;let _0x57d3aa=a123_0x5be149[_0x15dc72(0x154)](_0x4f2b01);const _0x114161=a123_0x5be149[_0x15dc72(0x161)](_0x57d3aa)[_0x15dc72(0x164)];while(_0x57d3aa!==_0x114161){const _0x504d35=a123_0x5be149[_0x15dc72(0x151)](_0x57d3aa,_0x15dc72(0x179));if(await _0x512f34[_0x15dc72(0x163)](_0x504d35))try{const _0xc7f3cf=await _0x512f34['readFile'](_0x504d35),_0x44871d=JSON[_0x15dc72(0x161)](_0xc7f3cf);if(_0x44871d['parent_segment']&&typeof _0x44871d[_0x15dc72(0x15b)]===_0x15dc72(0x16a))return{'configPath':_0x504d35,'configDir':_0x57d3aa,'parentSegment':_0x44871d[_0x15dc72(0x15b)]};}catch{}_0x57d3aa=a123_0x5be149[_0x15dc72(0x177)](_0x57d3aa);}return null;}function calculateScopedPath(_0x3c0c59,_0x3df03d){const _0x1ef9c7=a123_0x3d21,_0x45b5a5=a123_0x5be149[_0x1ef9c7(0x16d)](_0x3df03d,_0x3c0c59),_0x366ecc=_0x45b5a5!==''&&_0x45b5a5!=='.'&&!_0x45b5a5[_0x1ef9c7(0x168)]('..');return{'isScoped':_0x366ecc,'scopedFolderPath':_0x366ecc?_0x45b5a5[_0x1ef9c7(0x180)](/\\/g,'/'):''};}export async function resolveTarget(_0x2648ea){const _0x46586d=a123_0x3d21,{arg:_0x30f7b2,contextParent:_0x2966e2,cwd:cwd=process[_0x46586d(0x156)](),fs:fs=nodeFileSystem}=_0x2648ea;if(_0x30f7b2&&isYamlFilePath(_0x30f7b2))try{const _0x34dd3d=await resolveYamlFilePath(_0x30f7b2,fs),_0x5c1e53=a123_0x5be149['resolve'](_0x30f7b2),_0x496e1f=a123_0x5be149[_0x46586d(0x177)](_0x5c1e53),_0x15a120=await findTdxConfigAsync(_0x496e1f,fs);if(!_0x15a120){if(_0x2966e2){const _0x29f4e3=a123_0x5be149[_0x46586d(0x177)](_0x5c1e53);return{'type':_0x46586d(0x17f),'parentName':_0x2966e2,'targetDir':_0x29f4e3,'configRoot':_0x29f4e3,'filePath':_0x5c1e53,'resourceName':_0x34dd3d[_0x46586d(0x17a)],'folderPath':_0x34dd3d[_0x46586d(0x17e)],'resourceType':_0x34dd3d['resourceType'],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x174),'message':_0x46586d(0x17c)+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x175)};}const _0x5e0910=calculateScopedPath(_0x496e1f,_0x15a120[_0x46586d(0x176)]);return{'type':_0x46586d(0x17f),'parentName':_0x15a120[_0x46586d(0x182)],'targetDir':_0x15a120[_0x46586d(0x176)],'configRoot':_0x15a120[_0x46586d(0x176)],'filePath':_0x5c1e53,'resourceName':_0x34dd3d['segmentName'],'folderPath':_0x34dd3d['folderPath'],'resourceType':_0x34dd3d[_0x46586d(0x162)],'isScoped':_0x5e0910[_0x46586d(0x165)],'scopedFolderPath':_0x5e0910[_0x46586d(0x15f)]};}catch(_0xd02985){const _0x1a7dd1=_0xd02985 instanceof Error?_0xd02985[_0x46586d(0x160)]:String(_0xd02985);if(_0x1a7dd1['includes'](_0x46586d(0x150)))return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x184),'message':'File\x20not\x20found:\x20'+_0x30f7b2,'arg':_0x30f7b2};if(_0x1a7dd1['includes'](_0x46586d(0x181))){if(_0x2966e2){const _0x149337=a123_0x5be149['resolve'](_0x30f7b2);if(await fs['exists'](_0x149337)){const _0x15380c=a123_0x5be149[_0x46586d(0x177)](_0x149337),_0x8df884=await fs[_0x46586d(0x169)](_0x149337),_0x45c02b=_0x8df884[_0x46586d(0x14e)](/^name:\s*["']?([^"'\n]+)["']?/m),_0xaafe08=_0x8df884[_0x46586d(0x14e)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x1a79ce=_0x45c02b?_0x45c02b[0x1][_0x46586d(0x15d)]():a123_0x5be149['basename'](_0x30f7b2,a123_0x5be149[_0x46586d(0x178)](_0x30f7b2)),_0x107c48=_0xaafe08&&_0xaafe08[0x1][_0x46586d(0x15d)]()===_0x46586d(0x152)?_0x46586d(0x152):_0x46586d(0x17d);return{'type':_0x46586d(0x17f),'parentName':_0x2966e2,'targetDir':_0x15380c,'configRoot':_0x15380c,'filePath':_0x149337,'resourceName':_0x1a79ce,'folderPath':'','resourceType':_0x107c48,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x174),'message':_0x46586d(0x17c)+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x175)};}return{'type':'error','errorCode':_0x46586d(0x186),'message':_0x1a7dd1,'arg':_0x30f7b2};}if(_0x30f7b2){const _0xa1309=a123_0x5be149[_0x46586d(0x154)](cwd,_0x30f7b2);let _0x1ea6c8=null;try{_0x1ea6c8=await fs[_0x46586d(0x15a)](_0xa1309);}catch{}if(_0x1ea6c8?.[_0x46586d(0x172)]()){const _0x35b086=await findTdxConfigAsync(_0xa1309,fs);if(_0x35b086){const _0x5eb49a=calculateScopedPath(_0xa1309,_0x35b086[_0x46586d(0x176)]);return{'type':_0x46586d(0x16e),'parentName':_0x35b086[_0x46586d(0x182)],'targetDir':_0xa1309,'configRoot':_0x35b086['configDir'],'isScoped':_0x5eb49a['isScoped'],'scopedFolderPath':_0x5eb49a[_0x46586d(0x15f)]};}if(_0x2966e2)return{'type':_0x46586d(0x16e),'parentName':_0x2966e2,'targetDir':_0xa1309,'configRoot':_0xa1309,'isScoped':![],'scopedFolderPath':''};return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x174),'message':'No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x175)};}if(_0x1ea6c8?.[_0x46586d(0x15e)]())return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x186),'message':'Not\x20a\x20YAML\x20file:\x20'+_0x30f7b2,'arg':_0x30f7b2,'helpText':_0x46586d(0x153)};const _0x13cddd=sanitizeFileName(_0x30f7b2),_0x3ef6c6=getSegmentRootDir(_0x13cddd,cwd);return{'type':'parent_name','parentName':_0x30f7b2,'targetDir':_0x3ef6c6,'configRoot':_0x3ef6c6};}const _0x320e69=await findTdxConfigAsync(cwd,fs);if(_0x320e69){const _0x4c9c0f=calculateScopedPath(cwd,_0x320e69[_0x46586d(0x176)]);return{'type':_0x46586d(0x170),'parentName':_0x320e69[_0x46586d(0x182)],'targetDir':cwd,'configRoot':_0x320e69[_0x46586d(0x176)],'isScoped':_0x4c9c0f[_0x46586d(0x165)],'scopedFolderPath':_0x4c9c0f[_0x46586d(0x15f)]};}if(_0x2966e2){const _0x4fd3f3=sanitizeFileName(_0x2966e2),_0x4f84d1=getSegmentRootDir(_0x4fd3f3,cwd);return{'type':'context','parentName':_0x2966e2,'targetDir':_0x4f84d1,'configRoot':_0x4f84d1,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x46586d(0x166),'errorCode':_0x46586d(0x183),'message':_0x46586d(0x173),'helpText':_0x46586d(0x157)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a124_0x1eb463=a124_0x4991;(function(_0x4fac38,_0x18e845){const _0x44dda0=a124_0x4991,_0x50b5b0=_0x4fac38();while(!![]){try{const _0x925bf1=parseInt(_0x44dda0(0x156))/0x1+-parseInt(_0x44dda0(0x153))/0x2+-parseInt(_0x44dda0(0x14d))/0x3+parseInt(_0x44dda0(0x14e))/0x4+-parseInt(_0x44dda0(0x152))/0x5+-parseInt(_0x44dda0(0x159))/0x6*(parseInt(_0x44dda0(0x164))/0x7)+parseInt(_0x44dda0(0x15d))/0x8;if(_0x925bf1===_0x18e845)break;else _0x50b5b0['push'](_0x50b5b0['shift']());}catch(_0x156b3f){_0x50b5b0['push'](_0x50b5b0['shift']());}}}(a124_0x44fa,0x947f8));import{existsSync,readFileSync}from'fs';import a124_0x13c159 from'path';function a124_0x4991(_0x2c1b58,_0x4a8f30){_0x2c1b58=_0x2c1b58-0x14d;const _0x44fa8e=a124_0x44fa();let _0x4991f1=_0x44fa8e[_0x2c1b58];return _0x4991f1;}function a124_0x44fa(){const _0x214193=['startsWith','parse','3265598NTathq','1251783jjlKlM','1719816EcKzmH','stringify','segments','parent_segment','742005OopoOQ','1143890ZjFoGC','object','relative','1001802Gnhrjz','tdx.json','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','6PSpgDJ','Invalid\x20tdx.json:\x20expected\x20object','dirname','utf-8','6244904FVdBvi','root','cwd','resolve','join'];a124_0x44fa=function(){return _0x214193;};return a124_0x44fa();}const TDX_CONFIG_FILE=a124_0x1eb463(0x157),SEGMENTS_DIR=a124_0x1eb463(0x150);export function findTdxConfigPath(_0x1a2d0a=process[a124_0x1eb463(0x15f)]()){const _0x24b02=a124_0x1eb463;let _0x17eaef=a124_0x13c159[_0x24b02(0x160)](_0x1a2d0a);const _0x23772d=a124_0x13c159[_0x24b02(0x163)](_0x17eaef)[_0x24b02(0x15e)];while(_0x17eaef!==_0x23772d){const _0x182b30=a124_0x13c159[_0x24b02(0x161)](_0x17eaef,TDX_CONFIG_FILE);if(existsSync(_0x182b30))return _0x182b30;_0x17eaef=a124_0x13c159[_0x24b02(0x15b)](_0x17eaef);}return null;}export function loadTdxConfig(_0x303462){const _0x2defad=a124_0x1eb463,_0x1da075=readFileSync(_0x303462,_0x2defad(0x15c));let _0xe6c51a;try{_0xe6c51a=JSON[_0x2defad(0x163)](_0x1da075);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x303462);}if(!_0xe6c51a||typeof _0xe6c51a!==_0x2defad(0x154))throw new Error(_0x2defad(0x15a));const _0x58e795=_0xe6c51a;if(!_0x58e795[_0x2defad(0x151)]||typeof _0x58e795['parent_segment']!=='string')throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field');return{'parent_segment':_0x58e795[_0x2defad(0x151)]};}export function findTdxConfig(_0x36477b=process['cwd']()){const _0xeb39ea=a124_0x1eb463,_0x349111=findTdxConfigPath(_0x36477b);if(!_0x349111)throw new Error(_0xeb39ea(0x158));const _0x27cca8=loadTdxConfig(_0x349111),_0x2bacda=a124_0x13c159[_0xeb39ea(0x15b)](_0x349111);return{'config':_0x27cca8,'configPath':_0x349111,'configDir':_0x2bacda};}export function tryFindTdxConfig(_0x45ed95){try{return findTdxConfig(_0x45ed95);}catch{return null;}}export function getSegmentRootDir(_0x4fa82e,_0x370e0e=process[a124_0x1eb463(0x15f)]()){const _0x4e6b33=a124_0x1eb463;return a124_0x13c159[_0x4e6b33(0x161)](_0x370e0e,SEGMENTS_DIR,_0x4fa82e);}export function getTdxConfigPath(_0x295a12,_0x153ead=process[a124_0x1eb463(0x15f)]()){const _0x32159d=a124_0x1eb463;return a124_0x13c159[_0x32159d(0x161)](getSegmentRootDir(_0x295a12,_0x153ead),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x5ac194,_0x53af57){const _0x11691b=a124_0x1eb463,_0x492ffa=a124_0x13c159['resolve'](_0x5ac194),_0x3a59cf=a124_0x13c159[_0x11691b(0x155)](_0x53af57,_0x492ffa);if(_0x3a59cf[_0x11691b(0x162)]('..'))return'';return _0x3a59cf;}export function localPathToTdFolderPath(_0x44c481){const _0x514bc4=a124_0x1eb463,_0x49e9a2=a124_0x13c159[_0x514bc4(0x15b)](_0x44c481);if(_0x49e9a2==='.'||_0x49e9a2==='')return'';return _0x49e9a2['replace'](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x160c1f,_0x2a93e7){if(!_0x160c1f)return _0x2a93e7;return a124_0x13c159['join'](_0x2a93e7,_0x160c1f);}export function createTdxConfigContent(_0x2b2401){const _0x1769b1=a124_0x1eb463,_0x54a0a9={'parent_segment':_0x2b2401};return JSON[_0x1769b1(0x14f)](_0x54a0a9,null,0x2)+'\x0a';}
|