@treasuredata/tdx 2026.4.14 → 2026.4.16
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/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +30 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
const a152_0x4fdbc8=a152_0x43de;(function(_0x57bf6e,_0x42eee9){const _0x4f3827=a152_0x43de,_0x3f4a71=_0x57bf6e();while(!![]){try{const _0x5d6e54=-parseInt(_0x4f3827(0x1d6))/0x1*(-parseInt(_0x4f3827(0x228))/0x2)+-parseInt(_0x4f3827(0x19c))/0x3+-parseInt(_0x4f3827(0x192))/0x4*(-parseInt(_0x4f3827(0x1fa))/0x5)+parseInt(_0x4f3827(0x221))/0x6+parseInt(_0x4f3827(0x240))/0x7*(-parseInt(_0x4f3827(0x15e))/0x8)+parseInt(_0x4f3827(0x15b))/0x9*(-parseInt(_0x4f3827(0x1d8))/0xa)+parseInt(_0x4f3827(0x17b))/0xb;if(_0x5d6e54===_0x42eee9)break;else _0x3f4a71['push'](_0x3f4a71['shift']());}catch(_0x256b61){_0x3f4a71['push'](_0x3f4a71['shift']());}}}(a152_0x1807,0x28d0e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x4fdbc8(0x219));export const PENDING_SEGMENT_PREFIX=a152_0x4fdbc8(0x1e4);export const PENDING_ACTIVATION_PREFIX=a152_0x4fdbc8(0x1fd);export function createPendingSegmentId(_0x5edb86){return''+PENDING_SEGMENT_PREFIX+_0x5edb86+'__';}export function isPendingSegmentId(_0x49523d){const _0x159f8c=a152_0x4fdbc8;return _0x49523d[_0x159f8c(0x205)](PENDING_SEGMENT_PREFIX)&&!_0x49523d[_0x159f8c(0x205)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0xebd45f){return _0xebd45f['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x425cc6){return''+PENDING_ACTIVATION_PREFIX+_0x425cc6+'__';}export function isPendingActivationId(_0x5661ec){return _0x5661ec['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x27b201){const _0x1a69d7=a152_0x4fdbc8;return _0x27b201[_0x1a69d7(0x235)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3715eb,_0x5a4202){const _0x322ce3=a152_0x4fdbc8,_0x5ba9f7=_0x3715eb+'::'+(_0x5a4202[_0x322ce3(0x17d)]()||_0x322ce3(0x1b1)),_0x4ad482=createHash('sha1')[_0x322ce3(0x1d5)](_0x5ba9f7)[_0x322ce3(0x220)](_0x322ce3(0x1e9))[_0x322ce3(0x197)](0x0,0xc);return _0x322ce3(0x25e)+_0x4ad482;}export function ensureJourneyDefaults(_0x5a6b25){const _0x5bcfea=a152_0x4fdbc8;!_0x5a6b25['description']&&(_0x5a6b25[_0x5bcfea(0x1cf)]=''),!_0x5a6b25[_0x5bcfea(0x256)]&&(_0x5a6b25[_0x5bcfea(0x256)]=_0x5bcfea(0x16b));}export function injectExistingStageIds(_0x517662,_0x51d86f){const _0x58ee89=a152_0x4fdbc8,_0x23f651=new Map(_0x51d86f[_0x58ee89(0x23f)](_0x192f28=>[_0x192f28[_0x58ee89(0x1c3)],_0x192f28['id']]));for(const _0x3cacd0 of _0x517662){if(!_0x3cacd0['id']){const _0x5a4110=_0x23f651[_0x58ee89(0x177)](_0x3cacd0[_0x58ee89(0x1c3)]);_0x5a4110&&(_0x3cacd0['id']=_0x5a4110);}}}export function resolveTDFolderPath(_0x6ff81b,_0x1088f3,_0x1c047e){const _0x3029b4=a152_0x4fdbc8;if(!_0x1088f3)return _0x6ff81b;if(_0x6ff81b===_0x1c047e||_0x6ff81b[_0x3029b4(0x205)](_0x1c047e+'/'))return _0x6ff81b;return _0x6ff81b?_0x1c047e+'/'+_0x6ff81b:_0x1c047e;}export function addFoldersToCreate(_0x3d74ca,_0xc6e682,_0x423fe3){const _0x151d9f=a152_0x4fdbc8;if(!_0x3d74ca)return;if(_0xc6e682[_0x151d9f(0x18c)](_0x3d74ca))return;const _0x43759c=_0x3d74ca[_0x151d9f(0x1c8)]('/');let _0x4a4b97='';for(const _0x30fb44 of _0x43759c){_0x4a4b97=_0x4a4b97?_0x4a4b97+'/'+_0x30fb44:_0x30fb44,!_0xc6e682[_0x151d9f(0x18c)](_0x4a4b97)&&_0x423fe3[_0x151d9f(0x1fe)](_0x4a4b97);}}export function sortFoldersByDepth(_0x3ae7e1){return[..._0x3ae7e1]['sort']((_0x36bc86,_0x1e5a26)=>{const _0x1483fd=a152_0x43de,_0x8f8a42=(_0x36bc86['match'](/\//g)||[])[_0x1483fd(0x1a4)],_0x449b47=(_0x1e5a26[_0x1483fd(0x1b6)](/\//g)||[])[_0x1483fd(0x1a4)];return _0x8f8a42-_0x449b47;});}import*as a152_0xf6b755 from'yaml';import{readFileSync}from'fs';import a152_0x552734 from'path';import{isJourneyDef,parseYamlString as a152_0x41ddad,toYamlString as a152_0x597cc5,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';function a152_0x1807(){const _0x19f015=['match','conditionSegmentId','type','activation_deleted','uniqueServerName','journeyName','Activation\x20not\x20found:\x20','rule','activation_updating','activation_deleting','delete','segment_creating','INTERNAL','name','DecisionPoint','SEGMENT_SYNTAX_ERROR','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','Creating\x20activation\x20\x27','split','index','createdSegmentIds','parseDocument','parentId','WaitStep','all_columns','description','entry_criteria','\x27...','unchanged','Duration','behavior','update','7ekLUFy','columns','120WolwcX','schedule','Stage\x20\x27','deleteActivation','existingActivation','waitStepUnit','Deleted\x20segment\x20\x27','folder_creating','ACTIVATION_SYNTAX_ERROR','folderPathToId','goal\x20criteria','Created\x20segment\x20\x27','__pending_','folderId','\x27\x20to\x20local\x20\x27','SEGMENT_NOT_FOUND','):\x20','hex','SEGMENT_UPDATE_ERROR','Matched\x20server\x20segment\x20\x27','Updated\x20segment\x20\x27','attributes','journeys','absolutePath','existingSegment','max','\x20error(s)','connector_config','push','skipSegments','data','existingSegments','verbose','stage\x20\x27','1135yUVHPQ','updated','getSegment','__pending_act_','add','embeddedSegmentNameToId','\x27\x20exit\x20criteria','Updated\x20journey\x20\x27','user','NOT_FOUND','Segment\x20not\x20found:\x20','startsWith','waitStep','activationActions','\x20activation\x20\x27','Failed\x20to\x20fetch\x20referenced\x20segment\x20','effectiveFolderId','kind','Updating\x20activation\x20\x27','parse','\x20journey\x20from\x20file:\x20','idToName','stringify','./journey-yaml.js','yamlActivation','debug','\x27\x20wait\x20condition','journey_updating','resolvedRule','hasChanges','versionNumber','tdx.sdk.push-workflow','flatMap','folder_created','logDeleted','item','embedded_activation_creating','and\x20the\x20server\x20segment,\x20then\x20retry.','digest','47010aWyMYQ','activationContext','Journey\x20\x27','segmentFolderId','entries','\x27\x20for\x20','action','19634chPgca','Activation','createJourneySegment','Entry\x20criteria:\x20','deleted','decision_point','journey_creating','./child-segment-yaml.js','deleteSegment','parentSegmentFolder','activation_template_id','Fetching\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','replace','relationships','conditions','updateSegmentById','toString','stages','progress','journeyId','rootFolderId','Creating\x20segment\x20\x27','map','6405Nlyatw','all',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','existingJourney','created','message','valid','onProgress','\x27\x20from\x20file:\x20','journeyBundleId','Updating\x20segment\x20\x27','segmentId','segment_updating','deps','exitCriterias','parentFolder','journeyById','conditionTimeoutUnit','ACTIVATION_UPDATE_ERROR','.$1.push-recovery.json','journeyBundleName','connectionIdToNameMap','state','listActivations','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','createdSegmentId','getActivation','createSegment','conditionTimeoutDuration','withProgress','journey_entry_criteria_','idToEmailMap','Creating\x20folder\x20\x27','folderPath',').\x20','segment_deleted','create','journeyBundlesByFolderAndName','91566HdVLXQ','segments','embedded_segment_creating','96FluyJv','steps','logSuccess','dirname','\x27\x20decision\x20point\x20branch\x20\x27','activations','from','Embedded\x20segment\x20\x27','diff','notification','goal','\x27\x20by\x20rule\x20content','embedded_segment_created','draft','object','getSegmentEntity','day','\x27\x20milestone','journey','Delete\x20the\x20push\x20recovery\x20file\x20(','errors','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','journeyStages','Updated\x20activation\x20\x27','resolveJourneyId','get','validatedRequest','reduce','isNew','3411826ojmqFJ','Failed\x20to\x20resolve\x20activation\x20','trim','createActivation','milestone','nameToType','set','waitStepType','some','toISOString','connection','localName','logWarning','toLowerCase','\x20segment\x20from\x20file:\x20','Created\x20folder\x20\x27','yamlConfig','has','getLatestJourneyId','Failed\x20to\x20','list','with','\x27\x20entry\x20criteria','392sgfMjK','activation_','\x20(referenced\x20in\x20journey\x20','Created\x20journey\x20\x27','filter','slice','updateActivation','JOURNEY_UPDATE_ERROR','utf-8','entry','326148hqBeUY','\x0a\x20\x20','segmentNameToId','entryCriteria','Segment\x20not\x20found','relative','size','isArray','length','join','sort','find','segment_updated','activation_created','getJourney','resolveSegment','branches','../../utils/async.js','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','run_after_journey_refresh','JOURNEY_SYNTAX_ERROR','segment','keys','journey_created','journeyActivationStepId','nameToId'];a152_0x1807=function(){return _0x19f015;};return a152_0x1807();}function a152_0x43de(_0x5cc36e,_0x3fcc65){_0x5cc36e=_0x5cc36e-0x155;const _0x1807ac=a152_0x1807();let _0x43de6c=_0x1807ac[_0x5cc36e];return _0x43de6c;}import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x3fbffb){const _0x35defc=a152_0x4fdbc8;if(Array[_0x35defc(0x1a3)](_0x3fbffb))return'['+_0x3fbffb[_0x35defc(0x23f)](_0x46b37a=>stableStringify(_0x46b37a))[_0x35defc(0x1a5)](',')+']';if(_0x3fbffb&&typeof _0x3fbffb===_0x35defc(0x16c)){const _0x58f3ac=_0x3fbffb,_0x31a46f=Object['keys'](_0x58f3ac)['sort'](),_0x126681=_0x31a46f['map'](_0x320296=>'\x22'+_0x320296+'\x22:'+stableStringify(_0x58f3ac[_0x320296]));return'{'+_0x126681[_0x35defc(0x1a5)](',')+'}';}const _0x3b15d9=JSON[_0x35defc(0x210)](_0x3fbffb);return _0x3b15d9===undefined?'null':_0x3b15d9;}function activationSignature(_0x4e439f){const _0x3c8254=a152_0x4fdbc8,_0x4c1027={'connection':_0x4e439f[_0x3c8254(0x185)],..._0x4e439f[_0x3c8254(0x1ce)]!==undefined&&{'all_columns':_0x4e439f[_0x3c8254(0x1ce)]},..._0x4e439f[_0x3c8254(0x1d7)]!==undefined&&{'columns':_0x4e439f[_0x3c8254(0x1d7)]},..._0x4e439f[_0x3c8254(0x1d4)]!==undefined&&{'behavior':_0x4e439f[_0x3c8254(0x1d4)]},..._0x4e439f[_0x3c8254(0x1d9)]!==undefined&&{'schedule':_0x4e439f[_0x3c8254(0x1d9)]},..._0x4e439f[_0x3c8254(0x167)]!==undefined&&{'notification':_0x4e439f[_0x3c8254(0x167)]},..._0x4e439f[_0x3c8254(0x1f3)]!==undefined&&{'connector_config':_0x4e439f['connector_config']},..._0x4e439f[_0x3c8254(0x232)]!==undefined&&{'activation_template_id':_0x4e439f[_0x3c8254(0x232)]}};return stableStringify(_0x4c1027);}async function fetchSegment(_0x30a0e9,_0x55c489,_0x4ef737,_0x475e77){const _0x37bf3a=a152_0x4fdbc8,_0x5021da=_0x475e77?.['find'](_0x10e300=>_0x10e300['id']===_0x4ef737);if(_0x5021da)return _0x5021da;try{return await _0x30a0e9['segment'][_0x37bf3a(0x1fc)](_0x55c489,_0x4ef737);}catch(_0x34716f){logger[_0x37bf3a(0x213)]('getSegment\x20failed\x20for\x20'+_0x4ef737+_0x37bf3a(0x242)+_0x34716f);try{return await _0x30a0e9[_0x37bf3a(0x1b1)][_0x37bf3a(0x16d)](_0x4ef737);}catch(_0x314e3d){return logger['debug']('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x4ef737+':\x20'+_0x314e3d),null;}}}function recoverSegmentIdsFromPushRecovery(_0x10fdd8,_0xa83291,_0x2c4bb4){const _0x55fa2c=a152_0x4fdbc8,_0x59bef6=readPushRecovery(_0x10fdd8['absolutePath']);if(_0x59bef6?.[_0x55fa2c(0x1bb)]===_0x10fdd8[_0x55fa2c(0x18b)][_0x55fa2c(0x1c3)])for(const [_0x500f2d,_0x4be8b4]of Object[_0x55fa2c(0x225)](_0x59bef6[_0x55fa2c(0x15c)])){const _0x32bd2f=generateDeterministicJourneySegmentName(_0x10fdd8[_0x55fa2c(0x18b)][_0x55fa2c(0x1c3)],_0x500f2d);_0x4be8b4[_0x55fa2c(0x1ba)]===_0x32bd2f&&(_0xa83291['set'](_0x500f2d,_0x4be8b4[_0x55fa2c(0x24b)]),_0x2c4bb4[_0x55fa2c(0x181)](_0x500f2d,_0x4be8b4['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x57df9a,_0x1309ec,_0x480744,_0x56c277){const _0x2f66b6=a152_0x4fdbc8;let _0x4a0477;try{_0x4a0477=await _0x57df9a[_0x2f66b6(0x1b1)][_0x2f66b6(0x22a)]({'name':_0x480744['uniqueSegmentName'],'description':_0x480744[_0x2f66b6(0x1cf)],'journeyId':_0x480744[_0x2f66b6(0x23c)],'rule':_0x56c277(_0x480744[_0x2f66b6(0x216)],!![]),'countPopulation':!![],'parentFolderId':_0x480744[_0x2f66b6(0x1e5)],'audienceId':_0x480744[_0x2f66b6(0x1cc)]});}catch(_0x47b87c){const _0x11282f=_0x47b87c instanceof Error&&_0x47b87c[_0x2f66b6(0x245)]['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x11282f){const _0x2c0dfd=readPushRecovery(_0x1309ec[_0x2f66b6(0x1ef)]),_0x553fb3=_0x2c0dfd?.[_0x2f66b6(0x1bb)]===_0x1309ec['yamlConfig'][_0x2f66b6(0x1c3)]?_0x2c0dfd[_0x2f66b6(0x15c)][_0x480744[_0x2f66b6(0x186)]]:undefined;if(_0x553fb3?.['uniqueServerName']===_0x480744['uniqueSegmentName'])await _0x57df9a['segment']['updateSegmentById'](_0x480744['parentId'],_0x553fb3[_0x2f66b6(0x24b)],{'description':_0x480744[_0x2f66b6(0x1cf)],'rule':_0x56c277(_0x480744['resolvedRule'],!![]),'countPopulation':!![]}),_0x4a0477=_0x553fb3['segmentId'];else throw new SDKError(ErrorCode[_0x2f66b6(0x1ea)],_0x2f66b6(0x165)+_0x480744['localName']+_0x2f66b6(0x1c6)+(_0x2f66b6(0x171)+_0x1309ec[_0x2f66b6(0x1ef)][_0x2f66b6(0x235)](/([^/]+)$/,_0x2f66b6(0x253))+')\x20')+_0x2f66b6(0x21f),_0x47b87c);}else throw _0x47b87c;}return saveSegmentToPushRecovery(_0x1309ec[_0x2f66b6(0x1ef)],_0x1309ec[_0x2f66b6(0x18b)][_0x2f66b6(0x1c3)],_0x480744[_0x2f66b6(0x186)],{'segmentId':_0x4a0477,'uniqueServerName':_0x480744['uniqueSegmentName'],'createdAt':new Date()[_0x2f66b6(0x184)]()}),_0x4a0477;}export async function prepareSegmentFiles(_0x439fa1,_0x3900dc,_0x5b6984,_0x326fd1,_0x2a0108){const _0x4d430e=a152_0x4fdbc8,{activationDefToCreateRequest:_0x1e718a}=await import(_0x4d430e(0x22f)),_0x1d0cde=[],_0x3b425d=new Set();for(const {yamlConfig:_0x24a5b4,folderPath:_0x3cfc5d,sourcePath:_0xde61e5}of _0x439fa1){const _0x35b5af=resolveTDFolderPath(_0x3cfc5d,_0x326fd1,_0x2a0108),_0x44fb05=_0x35b5af+':'+_0x24a5b4['name'],_0x4dd6c6=_0x3900dc['segmentByFolderAndName'][_0x4d430e(0x177)](_0x44fb05),_0x37ae75=_0x4dd6c6?_0x3900dc['activationsBySegmentId'][_0x4d430e(0x177)](_0x4dd6c6['id'])||[]:[];addFoldersToCreate(_0x35b5af,_0x3900dc['folderPathToId'],_0x3b425d);const _0x5bdb78=calculateActivationActions(_0x24a5b4['activations']||[],_0x37ae75,_0x3900dc[_0x4d430e(0x25f)],_0x3900dc['connectionIdToNameMap']);for(const _0x54a5cf of _0x5bdb78){(_0x54a5cf['type']==='create'||_0x54a5cf[_0x4d430e(0x1b8)]==='update')&&_0x54a5cf[_0x4d430e(0x212)]&&(_0x54a5cf['validatedRequest']=await _0x1e718a(_0x54a5cf[_0x4d430e(0x212)],_0x5b6984));}const _0x30ab54=calculateSegmentDiff(_0x24a5b4,_0x4dd6c6,_0x37ae75,_0x3900dc[_0x4d430e(0x25f)],_0x3900dc[_0x4d430e(0x255)]);_0x1d0cde[_0x4d430e(0x1f4)]({'relativePath':_0x24a5b4[_0x4d430e(0x1c3)],'absolutePath':_0xde61e5,'yamlConfig':_0x24a5b4,'folderPath':_0x35b5af,'existingSegment':_0x4dd6c6,'existingActivations':_0x37ae75,'isNew':_0x30ab54[_0x4d430e(0x17a)],'hasChanges':_0x30ab54[_0x4d430e(0x217)],'diff':_0x30ab54['diff'],'activationActions':_0x5bdb78});}return{'segmentFiles':_0x1d0cde,'foldersToCreate':_0x3b425d};}export async function prepareJourneyFiles(_0x4fb673,_0x410e9a,_0x5c027e,_0x45b833){const _0x6f45fb=a152_0x4fdbc8,_0x2cb610=[],_0x23fb75=new Set();for(const {yamlConfig:_0x2fb401,folderPath:_0x2ec13b,sourcePath:_0x2341ff}of _0x4fb673){const _0x427324=resolveTDFolderPath(_0x2ec13b,_0x5c027e,_0x45b833),_0x5d4976=_0x427324+':'+_0x2fb401['name'],_0x1bedb6=_0x410e9a[_0x6f45fb(0x15a)][_0x6f45fb(0x177)](_0x5d4976);let _0x56aae7,_0x144b84;if(_0x1bedb6&&_0x1bedb6[_0x6f45fb(0x1a4)]>0x0){const _0x316c3e=buildLocalExpandedRuleMappings(_0x2fb401),{createYamlContext:_0x260005,prefetchJourneySegments:_0x3d3816}=createPushYamlContextForBundle(_0x410e9a['deps'],_0x410e9a['parentId'],_0x410e9a[_0x6f45fb(0x1f7)],_0x316c3e,_0x410e9a[_0x6f45fb(0x25f)],_0x410e9a[_0x6f45fb(0x255)],_0x410e9a['activationStepsById'],_0x410e9a[_0x6f45fb(0x250)]);await _0x3d3816(_0x1bedb6['map'](_0x7fceda=>_0x7fceda['id']));const _0xf75f78=await _0x410e9a[_0x6f45fb(0x24d)][_0x6f45fb(0x170)][_0x6f45fb(0x18d)](_0x1bedb6[0x0][_0x6f45fb(0x249)]),_0x267fec=hasMultipleVersions(_0x2fb401),_0x5b12c7=async _0x540862=>{const _0x590ac3=_0x6f45fb,_0x3f54c6=_0x410e9a[_0x590ac3(0x250)]?.[_0x590ac3(0x177)](_0x540862);if(_0x3f54c6)return _0x3f54c6;return _0x410e9a['fetchJourney']({'journeyId':_0x540862,'journeyName':_0x2fb401[_0x590ac3(0x1c3)],'isMultiVersion':_0x1bedb6[_0x590ac3(0x1a4)]>0x1});};if(_0x267fec&&_0x1bedb6[_0x6f45fb(0x1a4)]>0x1){const _0x288c1f=[];for(const _0x4e8b0a of _0x1bedb6){const _0x4fa8b7=_0x4e8b0a[_0x6f45fb(0x218)]||0x1;_0x410e9a[_0x6f45fb(0x23b)]?.['update'](_0x6f45fb(0x233)+_0x2fb401[_0x6f45fb(0x1c3)]+'\x20v'+_0x4fa8b7);const _0x1715ac=await _0x5b12c7(_0x4e8b0a['id']),_0x84c187=_0x260005(_0x4e8b0a['id']),_0x5633e2=await journeyResponseToDef(_0x1715ac,_0x84c187);_0x288c1f[_0x6f45fb(0x1f4)]({'item':_0x4e8b0a,'yaml':_0x5633e2});}const _0x57edd6=buildLocalRuleToNameMappingFromJourney(_0x2fb401);_0x144b84=buildMergedJourneyDef(_0x288c1f,_0x57edd6,_0xf75f78);const _0x21f87f=Math['max'](..._0x288c1f[_0x6f45fb(0x23f)](_0x1f572f=>_0x1f572f[_0x6f45fb(0x21d)]['versionNumber']||0x0)),_0x6252d7=_0x1bedb6[_0x6f45fb(0x1a7)](_0x167030=>(_0x167030[_0x6f45fb(0x218)]||0x0)===_0x21f87f);_0x6252d7&&(_0x410e9a[_0x6f45fb(0x23b)]?.['update'](_0x6f45fb(0x233)+_0x2fb401['name']+'\x20v'+_0x21f87f),_0x56aae7=await _0x5b12c7(_0x6252d7['id']));}else{const _0x270518=_0x1bedb6[_0x1bedb6[_0x6f45fb(0x1a4)]-0x1];_0x410e9a[_0x6f45fb(0x23b)]?.['update']('Fetching\x20'+_0x2fb401[_0x6f45fb(0x1c3)]),_0x56aae7=await _0x5b12c7(_0x270518['id']);const _0x43adc0=_0x260005(_0x270518['id']),_0x42da3d=await journeyResponseToDef(_0x56aae7,_0x43adc0),_0x109db9=buildLocalRuleToNameMappingFromJourney(_0x2fb401);_0x144b84=buildMergedJourneyDef([{'item':_0x270518,'yaml':_0x42da3d}],_0x109db9,_0xf75f78);}}addFoldersToCreate(_0x427324,_0x410e9a[_0x6f45fb(0x1e1)],_0x23fb75);const _0x3e2dd9=calculateJourneyDiff(_0x2fb401,_0x144b84);_0x2cb610[_0x6f45fb(0x1f4)]({'relativePath':_0x2fb401[_0x6f45fb(0x1c3)],'absolutePath':_0x2341ff,'yamlConfig':_0x2fb401,'folderPath':_0x427324,'existingJourney':_0x56aae7,'isNew':_0x3e2dd9[_0x6f45fb(0x17a)],'hasChanges':_0x3e2dd9['hasChanges'],'diff':_0x3e2dd9[_0x6f45fb(0x166)]});}return{'journeyFiles':_0x2cb610,'foldersToCreate':_0x23fb75};}export function calculateActivationActions(_0x2ad2ab,_0x3d92e4,_0x5cdc9f,_0x5b72de){const _0x2c1058=a152_0x4fdbc8,_0x57f8e9=[],_0x49a282=new Map();for(const _0xdb3714 of _0x3d92e4){_0x49a282['set'](_0xdb3714[_0x2c1058(0x1c3)],_0xdb3714);}const _0x14e3bb=new Map();for(const _0x8071af of _0x2ad2ab){_0x14e3bb[_0x2c1058(0x181)](_0x8071af[_0x2c1058(0x1c3)],_0x8071af);}for(const _0x491e8a of _0x2ad2ab){const _0x430e60=_0x49a282[_0x2c1058(0x177)](_0x491e8a['name']);if(!_0x430e60)_0x57f8e9[_0x2c1058(0x1f4)]({'type':_0x2c1058(0x159),'name':_0x491e8a[_0x2c1058(0x1c3)],'yamlActivation':_0x491e8a});else{const _0x3381be=activationResponseToDef(_0x430e60,_0x5cdc9f,_0x5b72de),_0x2816db=a152_0xf6b755['stringify'](_0x3381be),_0x1888ac=a152_0xf6b755[_0x2c1058(0x210)](_0x491e8a);_0x2816db!==_0x1888ac&&_0x57f8e9[_0x2c1058(0x1f4)]({'type':_0x2c1058(0x1d5),'name':_0x491e8a[_0x2c1058(0x1c3)],'yamlActivation':_0x491e8a,'existingActivation':_0x430e60});}}for(const _0x35344f of _0x3d92e4){!_0x14e3bb[_0x2c1058(0x18c)](_0x35344f[_0x2c1058(0x1c3)])&&_0x57f8e9[_0x2c1058(0x1f4)]({'type':_0x2c1058(0x1c0),'name':_0x35344f[_0x2c1058(0x1c3)],'existingActivation':_0x35344f});}return _0x57f8e9;}function calculateYamlDiff(_0x2b85c6,_0x2618e3){if(_0x2618e3){const _0x229709=generateDiff(_0x2618e3,_0x2b85c6),_0x1dd202=hasChanges(_0x229709);return{'isNew':![],'hasChanges':_0x1dd202,'diff':_0x1dd202?formatDiffWithColors(_0x229709):undefined};}const _0x2f4960=generateDiff('',_0x2b85c6);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2f4960)};}export function calculateSegmentDiff(_0x4bd490,_0x425e13,_0x541f20,_0x22c60d,_0x50b5c2){const _0x4ef9a6=segmentToYamlString(_0x4bd490),_0x402dd1=_0x425e13?segmentToYamlString(segmentWithActivationsToYaml(_0x425e13,_0x541f20,undefined,_0x22c60d,_0x50b5c2)):undefined;return calculateYamlDiff(_0x4ef9a6,_0x402dd1);}export function calculateJourneyDiff(_0x334149,_0x4782f5){const _0x51e27f=normalizeJourneyDef(_0x334149,_0x334149),_0x3d3b0b=a152_0x597cc5(_0x51e27f),_0x26c8ac=_0x4782f5?a152_0x597cc5(normalizeJourneyDef(_0x4782f5,_0x334149)):undefined;return calculateYamlDiff(_0x3d3b0b,_0x26c8ac);}export function findSegmentsToDelete(_0x187bb2,_0xee2649,_0x210058,_0x2ed1c9,_0x2e9f92){const _0x34e75e=a152_0x4fdbc8,_0x1c61af=new Set();for(const {yamlConfig:_0x4c23bf,folderPath:_0x36d521}of _0xee2649){_0x1c61af[_0x34e75e(0x1fe)](_0x36d521+':'+_0x4c23bf['name']);}return _0x187bb2[_0x34e75e(0x196)](_0x307718=>{const _0x4a4809=_0x34e75e,_0x28944b=_0x307718[_0x4a4809(0x224)]?_0x210058['get'](_0x307718['segmentFolderId'][_0x4a4809(0x239)]())||'':'',_0x4e0b78=_0x28944b+':'+_0x307718['name'];if(_0x1c61af['has'](_0x4e0b78))return![];if(_0x2e9f92)return _0x28944b===_0x2ed1c9||_0x28944b[_0x4a4809(0x205)](_0x2ed1c9+'/');return!![];});}export function findJourneysToDelete(_0x135761,_0x390e4c,_0xb80af9,_0x3e019d,_0xe7594){const _0x4dfb00=a152_0x4fdbc8,_0xa84a89=new Set();for(const {yamlConfig:_0xd72cdd,folderPath:_0x4fb72b}of _0x390e4c){_0xa84a89[_0x4dfb00(0x1fe)](_0x4fb72b+':'+_0xd72cdd[_0x4dfb00(0x1c3)]);}return _0x135761[_0x4dfb00(0x196)](_0x2cce64=>{const _0x31d483=_0x4dfb00,_0x299298=_0x2cce64[_0x31d483(0x1e5)]?_0xb80af9[_0x31d483(0x177)](_0x2cce64[_0x31d483(0x1e5)])||'':'',_0x846786=_0x299298+':'+_0x2cce64[_0x31d483(0x254)];if(_0xa84a89[_0x31d483(0x18c)](_0x846786))return![];if(_0xe7594)return _0x299298===_0x3e019d||_0x299298[_0x31d483(0x205)](_0x3e019d+'/');return!![];});}export function buildSegmentLookupMap(_0x5088d4,_0x134546){const _0x3d19a8=a152_0x4fdbc8,_0x1c70c4=new Map();for(const _0x5399a5 of _0x5088d4){const _0x226004=_0x5399a5[_0x3d19a8(0x224)]?_0x134546[_0x3d19a8(0x177)](_0x5399a5[_0x3d19a8(0x224)][_0x3d19a8(0x239)]())||'':'',_0x7e9954=_0x226004+':'+_0x5399a5['name'];_0x1c70c4['set'](_0x7e9954,_0x5399a5);}return _0x1c70c4;}export function buildSegmentNameToIdMap(_0x2db1c4){const _0x421956=a152_0x4fdbc8,_0x16ebaa=new Map();for(const _0x3cdda2 of _0x2db1c4){_0x16ebaa[_0x421956(0x181)](_0x3cdda2[_0x421956(0x1c3)],_0x3cdda2['id']);}return _0x16ebaa;}export function buildJourneyBundleLookupMap(_0x50220c,_0x59e259){const _0x8c47f2=a152_0x4fdbc8,_0x92a941=new Map();for(const _0x10c2b0 of _0x50220c){const _0xb3db68=_0x10c2b0[_0x8c47f2(0x1e5)]?_0x59e259['get'](_0x10c2b0[_0x8c47f2(0x1e5)])||'':'',_0x2f9ba1=_0xb3db68+':'+_0x10c2b0[_0x8c47f2(0x254)];!_0x92a941['has'](_0x2f9ba1)&&_0x92a941[_0x8c47f2(0x181)](_0x2f9ba1,[]),_0x92a941[_0x8c47f2(0x177)](_0x2f9ba1)[_0x8c47f2(0x1f4)](_0x10c2b0);}for(const _0x1ee03f of _0x92a941['values']()){_0x1ee03f[_0x8c47f2(0x1a6)]((_0x161ab8,_0x32e2da)=>(_0x161ab8[_0x8c47f2(0x218)]||0x0)-(_0x32e2da[_0x8c47f2(0x218)]||0x0));}return _0x92a941;}export function collectFoldersToCreate(_0x5e11fc,_0x2ac604){const _0x228469=a152_0x4fdbc8,_0x3cda1e=new Set();for(const _0x1d99e4 of _0x5e11fc){if(!_0x1d99e4)continue;if(_0x2ac604[_0x228469(0x18c)](_0x1d99e4))continue;const _0x4496b0=_0x1d99e4[_0x228469(0x1c8)]('/');let _0x145f0c='';for(const _0x5cef7a of _0x4496b0){_0x145f0c=_0x145f0c?_0x145f0c+'/'+_0x5cef7a:_0x5cef7a,!_0x2ac604[_0x228469(0x18c)](_0x145f0c)&&_0x3cda1e[_0x228469(0x1fe)](_0x145f0c);}}return _0x3cda1e;}export function parseAndClassifyYamlFiles(_0x1aad48,_0x26ff83,_0x49db41){const _0x29789b=a152_0x4fdbc8,_0x3695b9=[],_0xe17382=[];for(const _0x2e8ddb of _0x1aad48){const _0x409e24=a152_0x552734[_0x29789b(0x1a1)](_0x26ff83,a152_0x552734[_0x29789b(0x161)](_0x2e8ddb)),_0x4a2d45=_0x409e24==='.'?'':_0x409e24[_0x29789b(0x235)](/\\/g,'/'),_0x44ea4d=readFileSync(_0x2e8ddb,_0x29789b(0x19a)),_0x528242=a152_0xf6b755['parse'](_0x44ea4d);if(isJourneyDef(_0x528242)){const _0x4ea303=a152_0x41ddad(_0x44ea4d);_0xe17382['push']({'yamlConfig':_0x4ea303,'folderPath':_0x4a2d45,'sourcePath':_0x2e8ddb});}else{if(!_0x49db41?.[_0x29789b(0x1f5)]){const _0x36eb45=parseSegmentYamlFile(_0x44ea4d),_0x112898=normalizeChildSegmentYaml(_0x36eb45);_0x3695b9[_0x29789b(0x1f4)]({'yamlConfig':_0x112898,'folderPath':_0x4a2d45,'sourcePath':_0x2e8ddb});}}}return{'segments':_0x3695b9,'journeys':_0xe17382};}export function validateParsedFiles(_0x4f2758,_0x159c91){const _0x4325c3=a152_0x4fdbc8,_0xd3743f=[];for(const {yamlConfig:_0x16a752,sourcePath:_0xd01d05}of _0x4f2758[_0x4325c3(0x15c)]){const _0x4af187=readFileSync(_0xd01d05,_0x4325c3(0x19a)),_0x1818bf=a152_0xf6b755[_0x4325c3(0x1cb)](_0x4af187),_0x45a537=validateSegmentDef(_0x16a752,{'source':_0x4af187,'document':_0x1818bf},{'skipSchema':!![]});if(!_0x45a537['valid']){const _0x5de394=a152_0x552734['relative'](_0x159c91,_0xd01d05);_0xd3743f[_0x4325c3(0x1f4)]({'filePath':_0x5de394,'source':_0x4af187,'result':_0x45a537,'isJourney':![]});}}for(const {yamlConfig:_0x3a1035,sourcePath:_0x460296}of _0x4f2758[_0x4325c3(0x1ee)]){const _0xc6ca97=readFileSync(_0x460296,_0x4325c3(0x19a)),_0x1c6734=a152_0xf6b755[_0x4325c3(0x1cb)](_0xc6ca97),_0x40bc17=validateJourneyDef(_0x3a1035,{'source':_0xc6ca97,'document':_0x1c6734},{'skipSchema':!![]});if(!_0x40bc17[_0x4325c3(0x246)]){const _0x42165e=a152_0x552734[_0x4325c3(0x1a1)](_0x159c91,_0x460296);_0xd3743f[_0x4325c3(0x1f4)]({'filePath':_0x42165e,'source':_0xc6ca97,'result':_0x40bc17,'isJourney':!![]});}}return _0xd3743f;}export function formatValidationErrors(_0x19180f){const _0x382698=a152_0x4fdbc8,_0x1e5a73=[];for(const {filePath:_0x167ad1,source:_0x196575,result:_0x5e9223,isJourney:_0x157b21}of _0x19180f){const _0x444bfa=_0x157b21?_0x382698(0x170):_0x382698(0x1b1);_0x1e5a73[_0x382698(0x1f4)]('\x0a'+_0x167ad1+'\x20('+_0x444bfa+_0x382698(0x1e8)+_0x5e9223[_0x382698(0x172)]['length']+_0x382698(0x1f2)),_0x1e5a73[_0x382698(0x1f4)](formatValidationResult(_0x5e9223,_0x196575,_0x167ad1));}return _0x1e5a73[_0x382698(0x1a5)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x33ce00){const _0x51e670=a152_0x4fdbc8,_0x24e6fd=new Set(),_0x1f4a00=new Map(),_0x156075=collectSegmentUsageCounts(_0x33ce00);if(_0x33ce00[_0x51e670(0x15c)])for(const [_0x2abfd9,_0x26036b]of Object[_0x51e670(0x225)](_0x33ce00[_0x51e670(0x15c)])){_0x24e6fd['add'](_0x2abfd9);if(_0x26036b[_0x51e670(0x1bd)]){const _0x5d1814=yamlRuleToApi(_0x26036b[_0x51e670(0x1bd)]),_0x41e282=apiRuleToYaml(_0x5d1814);_0x1f4a00['set'](_0x2abfd9,_0x41e282);}}const _0x50cde4=new Map();let _0x7be26d=0x0;for(const [_0x27419e,_0x26fb66]of _0x1f4a00){const _0x5dd0fa=serializeExpandedRule(_0x26fb66,_0x1f4a00),_0x7c072e=_0x50cde4['get'](_0x5dd0fa)||[];_0x7c072e[_0x51e670(0x1f4)]({'name':_0x27419e,'index':_0x7be26d}),_0x50cde4['set'](_0x5dd0fa,_0x7c072e),_0x7be26d++;}const _0x29398d=new Map();for(const [_0x4b7c65,_0x2dbbab]of _0x50cde4){const _0x2c6193=_0x2dbbab['slice']()[_0x51e670(0x1a6)]((_0x3f1227,_0x1e59f9)=>{const _0x2f2265=_0x51e670,_0x429117=_0x156075[_0x2f2265(0x177)](_0x3f1227[_0x2f2265(0x1c3)])||0x0,_0x16ec37=_0x156075[_0x2f2265(0x177)](_0x1e59f9[_0x2f2265(0x1c3)])||0x0;if(_0x429117!==_0x16ec37)return _0x16ec37-_0x429117;return _0x3f1227[_0x2f2265(0x1c9)]-_0x1e59f9[_0x2f2265(0x1c9)];})[_0x51e670(0x23f)](_0x3ff576=>_0x3ff576[_0x51e670(0x1c3)]),_0x5ed9e3=[];for(const _0x125032 of _0x2c6193){const _0x3b67bb=_0x156075[_0x51e670(0x177)](_0x125032)||0x0,_0x182e25=Math[_0x51e670(0x1f1)](_0x3b67bb,0x1);for(let _0x4413fe=0x0;_0x4413fe<_0x182e25;_0x4413fe++){_0x5ed9e3[_0x51e670(0x1f4)](_0x125032);}}_0x29398d[_0x51e670(0x181)](_0x4b7c65,_0x5ed9e3);}return{'existingLocalSegmentNames':_0x24e6fd,'localSegmentRules':_0x1f4a00,'localExpandedRuleToNames':_0x29398d};}export function createSegmentIdResolver(_0xe39c54,_0x4da999){return async _0x3438c5=>{const _0x58b2b8=a152_0x43de,_0x52e8c2=_0xe39c54[_0x58b2b8(0x177)](_0x3438c5);if(!_0x52e8c2)throw new SDKError(ErrorCode[_0x58b2b8(0x1e7)],_0x58b2b8(0x204)+_0x3438c5+_0x58b2b8(0x1ae)+_0x4da999+'\x27)');return _0x52e8c2;};}export function extractRootFolderId(_0x4c1bbf){const _0x367d2b=a152_0x4fdbc8;return _0x4c1bbf[_0x367d2b(0x236)]?.[_0x367d2b(0x231)]?.[_0x367d2b(0x1f6)]?.['id']||_0x4c1bbf[_0x367d2b(0x236)]?.[_0x367d2b(0x24f)]?.[_0x367d2b(0x1f6)]?.['id'];}export function buildConnectionMaps(_0x3afc7a){const _0x3da616=a152_0x4fdbc8,_0x1d1ae7=new Map(),_0x52e9e9=new Map(),_0x3b94f9=new Map();for(const _0x550c91 of _0x3afc7a){_0x1d1ae7[_0x3da616(0x181)](_0x550c91[_0x3da616(0x1c3)],parseInt(_0x550c91['id'],0xa)),_0x52e9e9[_0x3da616(0x181)](_0x550c91['id'],_0x550c91[_0x3da616(0x1c3)]),_0x3b94f9[_0x3da616(0x181)](_0x550c91[_0x3da616(0x1c3)],_0x550c91[_0x3da616(0x1b8)]);}return{'nameToId':_0x1d1ae7,'idToName':_0x52e9e9,'nameToType':_0x3b94f9};}export function calculatePushStats(_0x27472f,_0x37764a,_0x4eb3c9,_0x4c2235,_0x546a06,_0x3e39f8,_0x303fc7){const _0x3afc00=a152_0x4fdbc8,_0x4bc737=_0x27472f[_0x3afc00(0x196)](_0x183ef4=>_0x183ef4[_0x3afc00(0x17a)]),_0x39c5d4=_0x27472f[_0x3afc00(0x196)](_0x37cd97=>!_0x37cd97[_0x3afc00(0x17a)]&&_0x37cd97['hasChanges']),_0x337347=_0x27472f['filter'](_0x3996d8=>!_0x3996d8[_0x3afc00(0x17a)]&&!_0x3996d8[_0x3afc00(0x217)]),_0x5cda4f=_0x3e39f8?_0x4c2235:[],_0x1316f3=_0x37764a[_0x3afc00(0x196)](_0x42a348=>_0x42a348[_0x3afc00(0x17a)]),_0x1a77fe=_0x37764a['filter'](_0x41dce0=>!_0x41dce0[_0x3afc00(0x17a)]&&_0x41dce0[_0x3afc00(0x217)]),_0x2c6f50=_0x37764a[_0x3afc00(0x196)](_0x23e69b=>!_0x23e69b[_0x3afc00(0x17a)]&&!_0x23e69b[_0x3afc00(0x217)]),_0x4c8f2c=_0x3e39f8?_0x546a06:[],_0xd5ef37=_0x27472f[_0x3afc00(0x21a)](_0x512275=>_0x512275[_0x3afc00(0x207)]),_0x2182d3=_0xd5ef37[_0x3afc00(0x196)](_0x711fba=>_0x711fba[_0x3afc00(0x1b8)]==='create'),_0x35b600=_0xd5ef37['filter'](_0x5020d5=>_0x5020d5['type']==='update'),_0x5b3fc3=_0xd5ef37[_0x3afc00(0x196)](_0xd02215=>_0xd02215[_0x3afc00(0x1b8)]===_0x3afc00(0x1c0)),_0x1ad17d=Array[_0x3afc00(0x164)](_0x4eb3c9)[_0x3afc00(0x1a6)](),_0x50eba9=_0x303fc7?![]:_0x4bc737[_0x3afc00(0x1a4)]>0x0||_0x39c5d4[_0x3afc00(0x1a4)]>0x0||_0x5cda4f[_0x3afc00(0x1a4)]>0x0,_0x4f5d63=_0x1316f3[_0x3afc00(0x1a4)]>0x0||_0x1a77fe[_0x3afc00(0x1a4)]>0x0||_0x4c8f2c[_0x3afc00(0x1a4)]>0x0,_0x2bd9d0=_0x303fc7?![]:_0xd5ef37[_0x3afc00(0x1a4)]>0x0,_0x24617c=_0x1ad17d[_0x3afc00(0x1a4)]>0x0;return{'segments':{'new':_0x4bc737,'changed':_0x39c5d4,'unchanged':_0x337347,'toDelete':_0x5cda4f},'journeys':{'new':_0x1316f3,'changed':_0x1a77fe,'unchanged':_0x2c6f50,'toDelete':_0x4c8f2c},'activations':{'all':_0xd5ef37,'toCreate':_0x2182d3,'toUpdate':_0x35b600,'toDelete':_0x5b3fc3},'folders':{'toCreate':_0x1ad17d},'counts':{'segments':{'new':_0x4bc737['length'],'changed':_0x39c5d4[_0x3afc00(0x1a4)],'unchanged':_0x337347[_0x3afc00(0x1a4)],'toDelete':_0x5cda4f[_0x3afc00(0x1a4)]},'journeys':{'new':_0x1316f3[_0x3afc00(0x1a4)],'changed':_0x1a77fe[_0x3afc00(0x1a4)],'unchanged':_0x2c6f50[_0x3afc00(0x1a4)],'toDelete':_0x4c8f2c[_0x3afc00(0x1a4)]},'activations':{'create':_0x2182d3[_0x3afc00(0x1a4)],'update':_0x35b600[_0x3afc00(0x1a4)],'delete':_0x5b3fc3[_0x3afc00(0x1a4)]},'folders':_0x1ad17d[_0x3afc00(0x1a4)]},'hasChanges':_0x50eba9||_0x4f5d63||_0x2bd9d0||_0x24617c};}export async function buildPushExecutionContext(_0x2c2691,_0xf02872,_0x119f26,_0x2eb0e1,_0x2f75d2,_0x4e24c1){const _0x5160c7=a152_0x4fdbc8,_0x4897e2=extractRootFolderId(_0x119f26),{pathToId:_0x2e183e,idToPath:_0x1f39da}=buildFolderMaps(_0x2f75d2),_0x210920=buildSegmentNameToIdMap(_0x2eb0e1),_0x47b7e7=new Map(),{batchAsync:_0x474845}=await import(_0x5160c7(0x1ad)),[_0x32e0ac,_0x2f07ce]=await Promise['all']([_0x2c2691[_0x5160c7(0x202)]['buildUserMaps'](),_0x2c2691[_0x5160c7(0x185)][_0x5160c7(0x18f)](),((async()=>{!_0x4e24c1&&_0x2eb0e1['length']>0x0&&await _0x474845(_0x2eb0e1,async _0x1bbeaf=>{const _0x51306d=a152_0x43de,_0x4e9d6c=await _0x2c2691[_0x51306d(0x1b1)][_0x51306d(0x257)](_0xf02872,_0x1bbeaf['id']);_0x47b7e7[_0x51306d(0x181)](_0x1bbeaf['id'],_0x4e9d6c);});})())]),{emailToId:_0x32178f,idToEmail:_0x5e7544}=_0x32e0ac,_0x92b6bb=buildConnectionMaps(_0x2f07ce);return{'rootFolderId':_0x4897e2,'folderPathToId':_0x2e183e,'folderIdToPath':_0x1f39da,'segmentNameToId':_0x210920,'activationsBySegmentId':_0x47b7e7,'emailToIdMap':_0x32178f,'idToEmailMap':_0x5e7544,'connectionNameToIdMap':_0x92b6bb[_0x5160c7(0x1b5)],'connectionIdToNameMap':_0x92b6bb[_0x5160c7(0x20f)],'connectionNameToTypeMap':_0x92b6bb[_0x5160c7(0x180)]};}export function createPushYamlContextForBundle(_0x19281d,_0x17a94d,_0x8c4b9a,_0x5ba874,_0x134625,_0x27b5fa,_0x595a03,_0x3f7c5c){const {existingLocalSegmentNames:_0x1da1b5,localExpandedRuleToNames:_0x4bce87}=_0x5ba874,_0x1d9745=new Set(),_0x57a6b4=new Map(),_0x3a5ef5=new Map(),_0x69f383=new Map(),_0x46eb37=createJumpTargetCache(),_0x165332=new Map(),_0x1aa30f=new Map(),_0x4b15ce=new Set();let _0x3dfbc1;const _0x524995=_0x19d8b0=>{const _0x41f886={'resolveSegment':async _0x3a3465=>{const _0x30f4c5=a152_0x43de,_0x23c8af=_0x69f383['get'](_0x3a3465);if(_0x23c8af!==undefined)return{'name':_0x23c8af,'isJourneyLocal':!![]};try{const _0x3957a6=await fetchSegment(_0x19281d,_0x17a94d,_0x3a3465,_0x8c4b9a);if(!_0x3957a6)throw new Error(_0x30f4c5(0x1a0));const _0x3dfe7d=generateJourneyLocalName(_0x3957a6[_0x30f4c5(0x1c3)]),_0x4f74a6=_0x3957a6[_0x30f4c5(0x20b)]===SEGMENT_KIND_JOURNEY&&_0x3dfe7d!==undefined;let _0x20ce28=_0x3957a6[_0x30f4c5(0x1c3)],_0x4a23fa;if(_0x4f74a6&&_0x3957a6['rule']){const _0x4e8695=apiRuleToYaml(_0x3957a6[_0x30f4c5(0x1bd)]);_0x1aa30f[_0x30f4c5(0x181)](_0x3a3465,_0x4e8695);const _0x4dd3b1=async _0x1f5878=>{const _0x50324b=_0x30f4c5,_0x11f3e6=collectSegmentRefsFromRule(_0x1f5878);for(const _0x3fc26a of _0x11f3e6){if(!_0x1aa30f[_0x50324b(0x18c)](_0x3fc26a))try{const _0x5d8e19=await fetchSegment(_0x19281d,_0x17a94d,_0x3fc26a,_0x8c4b9a);if(_0x5d8e19?.[_0x50324b(0x1bd)]){const _0x20c1f4=apiRuleToYaml(_0x5d8e19['rule']);_0x1aa30f[_0x50324b(0x181)](_0x3fc26a,_0x20c1f4),await _0x4dd3b1(_0x20c1f4);}}catch(_0x5b0857){logger[_0x50324b(0x213)](_0x50324b(0x209)+_0x3fc26a+':\x20'+_0x5b0857);}}};await _0x4dd3b1(_0x4e8695);const _0x1f7356=serializeExpandedRule(_0x4e8695,_0x1aa30f),_0x449073=_0x4bce87[_0x30f4c5(0x177)](_0x1f7356);if(_0x449073&&_0x449073[_0x30f4c5(0x1a4)]>0x0){const _0x557cea=_0x57a6b4[_0x30f4c5(0x177)](_0x1f7356)||0x0,_0x15d342=_0x449073[_0x557cea]||_0x449073[_0x449073['length']-0x1];_0x57a6b4[_0x30f4c5(0x181)](_0x1f7356,_0x557cea+0x1),_0x20ce28=_0x15d342,_0x1d9745[_0x30f4c5(0x1fe)](_0x20ce28),_0x69f383['set'](_0x3a3465,_0x20ce28);const _0x49bce6=await resolveRuleSegmentRefs(_0x4e8695,async _0x2678d8=>{const _0x5adae7=_0x30f4c5,_0x13863a=_0x69f383['get'](_0x2678d8);if(_0x13863a)return _0x13863a;const _0x39958d=await _0x3dfbc1[_0x5adae7(0x1ab)](_0x2678d8);return _0x39958d['name'];});_0x4a23fa={'description':_0x3957a6[_0x30f4c5(0x1cf)],'rule':_0x49bce6};}else{const _0xadfb8e=_0x165332[_0x30f4c5(0x177)](_0x1f7356);if(_0xadfb8e)_0x20ce28=_0xadfb8e,_0x69f383[_0x30f4c5(0x181)](_0x3a3465,_0x20ce28);else{if(_0x3dfe7d){let _0x5c41cf=_0x3dfe7d,_0xc9620f=0x2;while(_0x1d9745['has'](_0x5c41cf)||_0x1da1b5[_0x30f4c5(0x18c)](_0x5c41cf)){_0x5c41cf=_0x3dfe7d+'_'+_0xc9620f,_0xc9620f++;}_0x1d9745['add'](_0x5c41cf),_0x20ce28=_0x5c41cf;}_0x69f383[_0x30f4c5(0x181)](_0x3a3465,_0x20ce28),_0x165332['set'](_0x1f7356,_0x20ce28);const _0x3e991d=await resolveRuleSegmentRefs(_0x4e8695,async _0x21c469=>{const _0x345b97=_0x30f4c5,_0x4e0456=_0x69f383[_0x345b97(0x177)](_0x21c469);if(_0x4e0456)return _0x4e0456;const _0x249a43=await _0x3dfbc1[_0x345b97(0x1ab)](_0x21c469);return _0x249a43[_0x345b97(0x1c3)];});_0x4a23fa={'description':_0x3957a6['description'],'rule':_0x3e991d};}}}return{'name':_0x20ce28,'isJourneyLocal':_0x4f74a6,'definition':_0x4a23fa};}catch(_0x2bce0d){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x3a3465+':\x20'+_0x2bce0d),{'name':_0x3a3465,'isJourneyLocal':![]};}},'resolveActivation':async _0x513e34=>{const _0x2609b5=a152_0x43de,_0x5a7e89=_0x3a5ef5['get'](_0x513e34);if(_0x5a7e89!==undefined)return{'name':_0x5a7e89,'isJourneyLocal':!![]};try{let _0x3f6f05=_0x595a03?.[_0x2609b5(0x177)](_0x513e34);!_0x3f6f05&&(_0x3f6f05=await _0x19281d[_0x2609b5(0x170)][_0x2609b5(0x25a)](_0x19d8b0,_0x513e34));const _0x3ecb7f=_0x3f6f05[_0x2609b5(0x1ed)]['activationParams'][_0x2609b5(0x1c3)]||_0x513e34,_0x409cbe=sanitizeYamlKey(_0x3ecb7f)||_0x2609b5(0x193)+_0x513e34,_0x4b6e92=_0x409cbe;_0x3a5ef5['set'](_0x513e34,_0x4b6e92);const _0x3b689b=journeyActivationStepToYaml(_0x3f6f05,_0x134625,_0x27b5fa);return{'name':_0x4b6e92,'isJourneyLocal':!![],'definition':_0x3b689b};}catch(_0x275356){return logger[_0x2609b5(0x213)](_0x2609b5(0x17c)+_0x513e34+':\x20'+_0x275356),{'name':_0x513e34,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5bae05,_0x873503)=>resolveJumpTarget(_0x5bae05,_0x873503,_0x46eb37,async _0x2f83c2=>{const _0xd8c3ed=a152_0x43de,_0x272f61=_0x3f7c5c?.['get'](_0x2f83c2);if(_0x272f61)return _0x272f61;return _0x19281d[_0xd8c3ed(0x170)]['getJourney'](_0x2f83c2);})};return _0x3dfbc1=_0x41f886,_0x41f886;},_0x5c46ec=async _0x2873b9=>{const _0x52d5ff=a152_0x43de,{collectSegmentIdsFromJourneyApi:_0x1b42dc}=await import(_0x52d5ff(0x211)),{batchAsync:_0xfe5733}=await import(_0x52d5ff(0x1ad)),_0x3acfdd=new Set();for(const _0x50ea0b of _0x2873b9){let _0xd0d1b2=_0x3f7c5c?.[_0x52d5ff(0x177)](_0x50ea0b);!_0xd0d1b2&&(_0xd0d1b2=await _0x19281d[_0x52d5ff(0x170)][_0x52d5ff(0x1aa)](_0x50ea0b));const _0x508e47=_0x1b42dc(_0xd0d1b2);for(const _0x2c3651 of _0x508e47){_0x3acfdd['add'](_0x2c3651);}}let _0x801450=Array['from'](_0x3acfdd);while(_0x801450['length']>0x0){const _0x52f6ef=_0x801450[_0x52d5ff(0x196)](_0x136f4c=>!_0x4b15ce['has'](_0x136f4c));if(_0x52f6ef[_0x52d5ff(0x1a4)]===0x0)break;const _0x576234=await _0xfe5733(_0x52f6ef,async _0x5b157d=>{_0x4b15ce['add'](_0x5b157d);const _0x572d9b=await fetchSegment(_0x19281d,_0x17a94d,_0x5b157d,_0x8c4b9a);if(!_0x572d9b)return null;return{'segmentId':_0x5b157d,'segment':_0x572d9b};},0xa),_0x4f6a54=new Set();for(const _0x2746a4 of _0x576234){if(!_0x2746a4?.[_0x52d5ff(0x1b1)]?.[_0x52d5ff(0x1bd)])continue;const _0x31f5b4=apiRuleToYaml(_0x2746a4[_0x52d5ff(0x1b1)][_0x52d5ff(0x1bd)]);_0x1aa30f[_0x52d5ff(0x181)](_0x2746a4['segmentId'],_0x31f5b4);const _0x2b10ec=collectSegmentRefsFromRule(_0x31f5b4);for(const _0x16b0e0 of _0x2b10ec){!_0x4b15ce[_0x52d5ff(0x18c)](_0x16b0e0)&&_0x4f6a54['add'](_0x16b0e0);}}_0x801450=Array[_0x52d5ff(0x164)](_0x4f6a54);}};return{'createYamlContext':_0x524995,'prefetchJourneySegments':_0x5c46ec};}export async function executePushSegments(_0x22bd98,_0x5728c9,_0x5e8203,_0x3bf1a6,_0x560b25){const _0x4bb4fd=a152_0x4fdbc8,{segmentDefToCreateRequest:_0x373f75,segmentDefToUpdateRequest:_0x2a6d6b}=await import(_0x4bb4fd(0x22f)),_0x4114d4=_0x5e8203['folderPathToId'],_0x3c9560=0x5,_0x559025=async _0x42950f=>{const _0x49e414=_0x4bb4fd,_0x406c69=_0x42950f[_0x49e414(0x156)]?_0x4114d4['get'](_0x42950f[_0x49e414(0x156)]):undefined;let _0x314fba;const _0x3a9885={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x991086=_0x42950f[_0x49e414(0x18b)];if(_0x42950f[_0x49e414(0x18b)][_0x49e414(0x1bd)]){const _0x5f1f17=createSegmentIdResolver(_0x5e8203[_0x49e414(0x19e)],_0x42950f['yamlConfig'][_0x49e414(0x1c3)]),_0x5dc9b4=await resolveRuleSegmentIds(_0x42950f[_0x49e414(0x18b)]['rule'],_0x5f1f17);_0x991086={..._0x42950f['yamlConfig'],'rule':_0x5dc9b4};}try{if(_0x42950f[_0x49e414(0x17a)]){_0x560b25[_0x49e414(0x247)]?.({'type':_0x49e414(0x1c1),'name':_0x42950f['yamlConfig'][_0x49e414(0x1c3)]});const _0x60b98=_0x373f75(_0x991086,_0x406c69),_0x489096=await _0x560b25[_0x49e414(0x25d)](_0x49e414(0x23e)+_0x42950f[_0x49e414(0x18b)][_0x49e414(0x1c3)]+'\x27...',()=>_0x22bd98['segment'][_0x49e414(0x25b)](_0x3bf1a6[_0x49e414(0x1cc)],_0x60b98));_0x314fba=_0x489096[_0x49e414(0x1f6)]['id'],_0x5e8203[_0x49e414(0x19e)]['set'](_0x42950f[_0x49e414(0x18b)][_0x49e414(0x1c3)],_0x314fba),_0x3a9885['createdSegmentId']={'name':_0x42950f[_0x49e414(0x18b)][_0x49e414(0x1c3)],'id':_0x314fba},_0x560b25[_0x49e414(0x247)]?.({'type':'segment_created','name':_0x42950f[_0x49e414(0x18b)][_0x49e414(0x1c3)],'segmentId':_0x314fba}),_0x560b25[_0x49e414(0x160)]?.(_0x49e414(0x1e3)+_0x42950f['yamlConfig'][_0x49e414(0x1c3)]+'\x27'),_0x3a9885['created']=0x1;}else{if(_0x42950f[_0x49e414(0x217)]){_0x560b25[_0x49e414(0x247)]?.({'type':_0x49e414(0x24c),'name':_0x42950f[_0x49e414(0x18b)]['name']});const _0x234fec=_0x2a6d6b(_0x991086);_0x406c69!==_0x42950f[_0x49e414(0x1f0)]?.['segmentFolderId']&&(_0x234fec[_0x49e414(0x224)]=_0x406c69?parseInt(_0x406c69,0xa):undefined),await _0x560b25[_0x49e414(0x25d)](_0x49e414(0x24a)+_0x42950f[_0x49e414(0x18b)][_0x49e414(0x1c3)]+_0x49e414(0x1d1),()=>_0x22bd98['segment'][_0x49e414(0x238)](_0x3bf1a6[_0x49e414(0x1cc)],_0x42950f['existingSegment']['id'],_0x234fec)),_0x314fba=_0x42950f['existingSegment']['id'],_0x560b25[_0x49e414(0x247)]?.({'type':_0x49e414(0x1a8),'name':_0x42950f[_0x49e414(0x18b)][_0x49e414(0x1c3)]}),_0x560b25[_0x49e414(0x160)]?.(_0x49e414(0x1ec)+_0x42950f['yamlConfig'][_0x49e414(0x1c3)]+'\x27'),_0x3a9885[_0x49e414(0x1fb)]=0x1;}else _0x314fba=_0x42950f[_0x49e414(0x1f0)]['id'];}}catch(_0x5c75fc){const _0xe8e97=isHttp400Error(_0x5c75fc),_0x1bd17d=_0xe8e97?ErrorCode[_0x49e414(0x1c5)]:ErrorCode[_0x49e414(0x1ea)],_0x517ff9=getErrorMessage(_0x5c75fc);throw new SDKError(_0x1bd17d,_0x49e414(0x18e)+(_0x42950f['isNew']?_0x49e414(0x159):'update')+_0x49e414(0x189)+_0x42950f[_0x49e414(0x1ef)]+'\x0a\x20\x20'+_0x517ff9,_0x5c75fc);}try{const _0x28344c=await syncActivationsForSegment(_0x22bd98,_0x3bf1a6[_0x49e414(0x1cc)],_0x314fba,_0x42950f[_0x49e414(0x18b)]['name'],_0x42950f[_0x49e414(0x207)],_0x560b25,_0x42950f[_0x49e414(0x1ef)]);_0x3a9885[_0x49e414(0x163)]=_0x28344c;}catch(_0x5bb342){if(_0x5bb342 instanceof SDKError)throw _0x5bb342;throw new SDKError(ErrorCode[_0x49e414(0x252)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x42950f['yamlConfig'][_0x49e414(0x1c3)]+_0x49e414(0x248)+_0x42950f[_0x49e414(0x1ef)]+'\x0a\x20\x20'+getErrorMessage(_0x5bb342),_0x5bb342);}return _0x3a9885;},_0x1c1ffc=await batchAsync(_0x5728c9,_0x559025,_0x3c9560),_0x5836bb={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5a5f1b of _0x1c1ffc){_0x5836bb[_0x4bb4fd(0x244)]+=_0x5a5f1b['created'],_0x5836bb[_0x4bb4fd(0x1fb)]+=_0x5a5f1b[_0x4bb4fd(0x1fb)],_0x5a5f1b['createdSegmentId']&&_0x5836bb[_0x4bb4fd(0x1ca)][_0x4bb4fd(0x181)](_0x5a5f1b[_0x4bb4fd(0x259)][_0x4bb4fd(0x1c3)],_0x5a5f1b[_0x4bb4fd(0x259)]['id']),_0x5836bb['activations'][_0x4bb4fd(0x244)]+=_0x5a5f1b[_0x4bb4fd(0x163)][_0x4bb4fd(0x244)],_0x5836bb[_0x4bb4fd(0x163)][_0x4bb4fd(0x1fb)]+=_0x5a5f1b[_0x4bb4fd(0x163)]['updated'],_0x5836bb[_0x4bb4fd(0x163)][_0x4bb4fd(0x22c)]+=_0x5a5f1b['activations'][_0x4bb4fd(0x22c)];}return _0x5836bb;}async function syncActivationsForSegment(_0x33d5d5,_0x21dd13,_0x4aacaf,_0x48421e,_0x5e91b5,_0x59003b,_0x2e063c){const _0x1ac17e=a152_0x4fdbc8,_0x37825d={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2e02df of _0x5e91b5){try{if(_0x2e02df[_0x1ac17e(0x1b8)]===_0x1ac17e(0x159)&&_0x2e02df['validatedRequest'])_0x59003b[_0x1ac17e(0x247)]?.({'type':'activation_creating','segmentName':_0x48421e,'activationName':_0x2e02df['name']}),await _0x59003b['withProgress'](_0x1ac17e(0x1c7)+_0x2e02df[_0x1ac17e(0x1c3)]+'\x27...',()=>_0x33d5d5[_0x1ac17e(0x1b1)]['createActivation'](_0x21dd13,_0x4aacaf,_0x2e02df[_0x1ac17e(0x178)])),_0x59003b[_0x1ac17e(0x247)]?.({'type':_0x1ac17e(0x1a9),'segmentName':_0x48421e,'activationName':_0x2e02df[_0x1ac17e(0x1c3)]}),_0x59003b[_0x1ac17e(0x160)]?.('Created\x20activation\x20\x27'+_0x2e02df[_0x1ac17e(0x1c3)]+'\x27'),_0x37825d[_0x1ac17e(0x244)]++;else{if(_0x2e02df[_0x1ac17e(0x1b8)]===_0x1ac17e(0x1d5)&&_0x2e02df[_0x1ac17e(0x178)]&&_0x2e02df[_0x1ac17e(0x1dc)])_0x59003b[_0x1ac17e(0x247)]?.({'type':_0x1ac17e(0x1be),'segmentName':_0x48421e,'activationName':_0x2e02df[_0x1ac17e(0x1c3)]}),await _0x59003b[_0x1ac17e(0x25d)](_0x1ac17e(0x20c)+_0x2e02df[_0x1ac17e(0x1c3)]+'\x27...',()=>_0x33d5d5[_0x1ac17e(0x1b1)][_0x1ac17e(0x198)](_0x21dd13,_0x4aacaf,_0x2e02df[_0x1ac17e(0x1dc)]['id'],_0x2e02df[_0x1ac17e(0x178)])),_0x59003b[_0x1ac17e(0x247)]?.({'type':'activation_updated','segmentName':_0x48421e,'activationName':_0x2e02df['name']}),_0x59003b[_0x1ac17e(0x160)]?.(_0x1ac17e(0x175)+_0x2e02df['name']+'\x27'),_0x37825d[_0x1ac17e(0x1fb)]++;else _0x2e02df[_0x1ac17e(0x1b8)]==='delete'&&_0x2e02df[_0x1ac17e(0x1dc)]&&(_0x59003b[_0x1ac17e(0x247)]?.({'type':_0x1ac17e(0x1bf),'segmentName':_0x48421e,'activationName':_0x2e02df[_0x1ac17e(0x1c3)]}),await _0x59003b[_0x1ac17e(0x25d)]('Deleting\x20activation\x20\x27'+_0x2e02df[_0x1ac17e(0x1c3)]+_0x1ac17e(0x1d1),()=>_0x33d5d5['segment'][_0x1ac17e(0x1db)](_0x21dd13,_0x4aacaf,_0x2e02df[_0x1ac17e(0x1dc)]['id'])),_0x59003b[_0x1ac17e(0x247)]?.({'type':_0x1ac17e(0x1b9),'segmentName':_0x48421e,'activationName':_0x2e02df[_0x1ac17e(0x1c3)]}),_0x59003b['logDeleted']?.('Deleted\x20activation\x20\x27'+_0x2e02df[_0x1ac17e(0x1c3)]+'\x27'),_0x37825d['deleted']++);}}catch(_0x4e79f1){const _0x21395e=isHttp400Error(_0x4e79f1),_0x36ceb8=_0x21395e?ErrorCode[_0x1ac17e(0x1e0)]:ErrorCode[_0x1ac17e(0x252)],_0x2ac930=getErrorMessage(_0x4e79f1);throw new SDKError(_0x36ceb8,'Failed\x20to\x20'+_0x2e02df[_0x1ac17e(0x1b8)]+_0x1ac17e(0x208)+_0x2e02df[_0x1ac17e(0x1c3)]+_0x1ac17e(0x248)+_0x2e063c+_0x1ac17e(0x19d)+_0x2ac930,_0x4e79f1);}}return _0x37825d;}export async function executePushFolders(_0xa24897,_0x387bf1,_0x2e85e4,_0x5b9cc1,_0x459892){const _0x328bec=a152_0x4fdbc8,_0x4446d7=new Map(_0x2e85e4),_0x2d3274=sortFoldersByDepth(_0x387bf1);for(const _0x308fff of _0x2d3274){const _0x1d7d0a=_0x308fff[_0x328bec(0x1c8)]('/'),_0x27090b=_0x1d7d0a[_0x1d7d0a['length']-0x1],_0x3bd46b=_0x1d7d0a['slice'](0x0,-0x1)['join']('/'),_0x41e237=_0x4446d7['get'](_0x3bd46b);_0x459892[_0x328bec(0x247)]?.({'type':_0x328bec(0x1df),'folder':_0x308fff});const _0x5ca2e1={'name':_0x27090b,'parentFolderId':_0x41e237},_0x3e6073=await _0x459892[_0x328bec(0x25d)](_0x328bec(0x155)+_0x308fff+_0x328bec(0x1d1),()=>_0xa24897['segment']['createFolder'](_0x5b9cc1['parentId'],_0x5ca2e1));_0x4446d7[_0x328bec(0x181)](_0x308fff,_0x3e6073[_0x328bec(0x1f6)]['id']),_0x459892['onProgress']?.({'type':_0x328bec(0x21b),'folder':_0x308fff,'folderId':_0x3e6073[_0x328bec(0x1f6)]['id']}),_0x459892['logInfo']?.(_0x328bec(0x18a)+_0x308fff+'\x27');}return _0x4446d7;}export async function executePushSegmentDeletions(_0x192e9d,_0x326435,_0x533f77){const _0x5aadbf=a152_0x4fdbc8;if(_0x326435[_0x5aadbf(0x1a4)]===0x0)return 0x0;const {batchAsync:_0x4085e6}=await import('../../utils/async.js'),_0x58ab31=0x5,_0x296881=await _0x4085e6(_0x326435,async _0xbc30a9=>{const _0x3c1f6e=_0x5aadbf;return _0x533f77[_0x3c1f6e(0x247)]?.({'type':'segment_deleting','name':_0xbc30a9[_0x3c1f6e(0x1c3)]}),await _0x192e9d[_0x3c1f6e(0x1b1)][_0x3c1f6e(0x230)](_0xbc30a9['id']),_0x533f77['onProgress']?.({'type':_0x3c1f6e(0x158),'name':_0xbc30a9['name']}),_0x533f77[_0x3c1f6e(0x21c)]?.(_0x3c1f6e(0x1de)+_0xbc30a9[_0x3c1f6e(0x1c3)]+'\x27'),0x1;},_0x58ab31);return _0x296881[_0x5aadbf(0x179)]((_0xc7d538,_0x4d35ed)=>_0xc7d538+_0x4d35ed,0x0);}export async function executePushJourneys(_0x3d5a70,_0x3a3bc0,_0x1890c3,_0x5a65f9,_0x3d3713){const _0x160cce=a152_0x4fdbc8,{journeyDefToRequest:_0xc9f627}=await import(_0x160cce(0x211)),{activationDefToCreateRequest:_0x1a1db6,yamlRuleToApi:_0x4e0467,validateSegmentRule:_0x103c17}=await import(_0x160cce(0x22f)),_0x5cf042={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x440c8d=new Map(_0x1890c3[_0x160cce(0x19e)]),_0x10303f=0x5;for(let _0x934d6d=0x0;_0x934d6d<_0x3a3bc0['length'];_0x934d6d+=_0x10303f){const _0xca29e=_0x3a3bc0[_0x160cce(0x197)](_0x934d6d,_0x934d6d+_0x10303f),_0xb30d0a=await Promise[_0x160cce(0x241)](_0xca29e[_0x160cce(0x23f)](async _0x275dab=>{const _0xdabce4=_0x160cce;if(!_0x275dab['isNew']&&!_0x275dab[_0xdabce4(0x217)])return{'action':'unchanged','name':_0x275dab['yamlConfig'][_0xdabce4(0x1c3)],'journeyId':_0x275dab[_0xdabce4(0x243)]?.['id']};const _0x18e33e=_0x275dab['folderPath']?_0x1890c3[_0xdabce4(0x1e1)][_0xdabce4(0x177)](_0x275dab[_0xdabce4(0x156)]):undefined;_0x3d3713['onProgress']?.({'type':_0x275dab[_0xdabce4(0x17a)]?_0xdabce4(0x22e):_0xdabce4(0x215),'name':_0x275dab[_0xdabce4(0x18b)][_0xdabce4(0x1c3)]});try{const _0x48e126=await executeSingleJourneyPush(_0x3d5a70,_0x275dab,{..._0x1890c3,'segmentNameToId':_0x440c8d},{'parentId':_0x5a65f9[_0xdabce4(0x1cc)],'rootFolderId':_0x5a65f9[_0xdabce4(0x23d)],'folderId':_0x18e33e,'verbose':_0x5a65f9[_0xdabce4(0x1f8)]},_0x3d3713,{'journeyDefToRequest':_0xc9f627,'activationDefToCreateRequest':_0x1a1db6,'yamlRuleToApi':_0x4e0467,'validateSegmentRule':_0x103c17});for(const [_0x135091,_0x491a02]of _0x48e126[_0xdabce4(0x1ff)]){_0x440c8d[_0xdabce4(0x181)](_0x135091,_0x491a02),_0x5cf042[_0xdabce4(0x1ff)][_0xdabce4(0x181)](_0x135091,_0x491a02);}if(_0x48e126[_0xdabce4(0x227)]===_0xdabce4(0x244))_0x3d3713[_0xdabce4(0x247)]?.({'type':_0xdabce4(0x1b3),'name':_0x275dab[_0xdabce4(0x18b)]['name'],'journeyId':_0x48e126[_0xdabce4(0x23c)]}),_0x3d3713[_0xdabce4(0x160)]?.(_0xdabce4(0x195)+_0x275dab[_0xdabce4(0x18b)][_0xdabce4(0x1c3)]+'\x27'),_0x5cf042[_0xdabce4(0x244)]++;else _0x48e126[_0xdabce4(0x227)]===_0xdabce4(0x1fb)&&(_0x3d3713[_0xdabce4(0x247)]?.({'type':'journey_updated','name':_0x275dab[_0xdabce4(0x18b)][_0xdabce4(0x1c3)]}),_0x3d3713[_0xdabce4(0x160)]?.(_0xdabce4(0x201)+_0x275dab[_0xdabce4(0x18b)][_0xdabce4(0x1c3)]+'\x27'),_0x5cf042['updated']++);return{'action':_0x48e126[_0xdabce4(0x227)],'name':_0x275dab[_0xdabce4(0x18b)][_0xdabce4(0x1c3)],'journeyId':_0x48e126['journeyId']};}catch(_0x1d3e46){const _0x4e8850=isHttp400Error(_0x1d3e46),_0x2f7e71=_0x4e8850?ErrorCode[_0xdabce4(0x1b0)]:ErrorCode[_0xdabce4(0x199)],_0x298c8a=getErrorMessage(_0x1d3e46);throw new SDKError(_0x2f7e71,'Failed\x20to\x20'+(_0x275dab[_0xdabce4(0x17a)]?'create':'update')+_0xdabce4(0x20e)+_0x275dab['absolutePath']+'\x0a\x20\x20'+_0x298c8a,_0x1d3e46);}}));_0x5cf042['results'][_0x160cce(0x1f4)](..._0xb30d0a);}return _0x5cf042;}async function matchExistingJourneySegments(_0x411c4b,_0x49e408,_0x5aab54,_0x40991f,_0x336b94){const _0x55f6a9=a152_0x4fdbc8;if(!_0x49e408[_0x55f6a9(0x243)]||!_0x49e408[_0x55f6a9(0x18b)][_0x55f6a9(0x15c)])return;const _0x152d18=new Map(),_0x14fdda=new Set();for(const _0x1001da of Object[_0x55f6a9(0x1b2)](_0x49e408[_0x55f6a9(0x18b)]['segments'])){const _0x3153dd=generateDeterministicJourneySegmentName(_0x49e408[_0x55f6a9(0x18b)]['name'],_0x1001da);_0x152d18[_0x55f6a9(0x181)](_0x3153dd,_0x1001da),_0x14fdda['add'](_0x1001da);}const _0xe7af36=[],_0x56bf4c=collectSegmentIdsFromJourneyApi(_0x49e408['existingJourney']);for(const _0x476691 of _0x56bf4c){const _0x51d5aa=await fetchSegment(_0x411c4b,_0x5aab54,_0x476691,_0x40991f);if(!_0x51d5aa?.[_0x55f6a9(0x1c3)])continue;const _0x4c5f20=_0x152d18[_0x55f6a9(0x177)](_0x51d5aa[_0x55f6a9(0x1c3)]);_0x4c5f20?(_0x336b94[_0x55f6a9(0x181)](_0x4c5f20,_0x476691),_0x14fdda[_0x55f6a9(0x1c0)](_0x4c5f20)):_0xe7af36[_0x55f6a9(0x1f4)]({'id':_0x476691,'seg':_0x51d5aa});}if(_0x14fdda['size']>0x0&&_0xe7af36['length']>0x0){const {localExpandedRuleToNames:_0x3e7e08}=buildLocalExpandedRuleMappings(_0x49e408[_0x55f6a9(0x18b)]),_0x945940=new Map();for(const {id:_0xe65f07,seg:_0x4af1ce}of _0xe7af36){if(_0x4af1ce['rule']){const _0x3b70d9=apiRuleToYaml(_0x4af1ce[_0x55f6a9(0x1bd)]);_0x945940[_0x55f6a9(0x181)](_0xe65f07,_0x3b70d9);}}for(const {id:_0x350499,seg:_0x14ce56}of _0xe7af36){if(!_0x14ce56[_0x55f6a9(0x1bd)])continue;const _0x5d10ee=_0x945940[_0x55f6a9(0x177)](_0x350499);if(!_0x5d10ee)continue;const _0x584af2=serializeExpandedRule(_0x5d10ee,_0x945940),_0x33e373=_0x3e7e08[_0x55f6a9(0x177)](_0x584af2);if(_0x33e373){const _0xc4610=_0x33e373['find'](_0x269f72=>_0x14fdda[_0x55f6a9(0x18c)](_0x269f72));_0xc4610&&(_0x336b94[_0x55f6a9(0x181)](_0xc4610,_0x350499),_0x14fdda['delete'](_0xc4610),logger[_0x55f6a9(0x213)](_0x55f6a9(0x1eb)+_0x14ce56[_0x55f6a9(0x1c3)]+_0x55f6a9(0x1e6)+_0xc4610+_0x55f6a9(0x169)));}}}}async function executeSingleJourneyPush(_0x51f4ac,_0x3af42c,_0x2f313b,_0x3f0e6c,_0x217204,_0x45fd7c){const _0xec6f68=a152_0x4fdbc8,{journeyDefToRequest:_0x595169,activationDefToCreateRequest:_0x999e5d,yamlRuleToApi:_0x49b000,validateSegmentRule:_0x2771c7}=_0x45fd7c,_0x210367=new Map(),_0x41d9f1=new Map();recoverSegmentIdsFromPushRecovery(_0x3af42c,_0x210367,_0x2f313b['segmentNameToId']);const _0x472f65=new Map(),_0x4fed0b=new Map(),_0x614049=new Map();let _0x256201;const _0x5d806b=async()=>{const _0x6b93f=a152_0x43de;if(_0x256201)return;_0x256201=new Map();if(!_0x3af42c['existingJourney'])return;const _0x438a71=await _0x51f4ac[_0x6b93f(0x170)][_0x6b93f(0x257)](_0x3af42c[_0x6b93f(0x243)]['id']);for(const _0x277100 of _0x438a71){const _0x2125be=journeyActivationStepToYaml(_0x277100,_0x2f313b['idToEmailMap'],_0x2f313b['connectionIdToNameMap']),_0x31decf=activationSignature(_0x2125be);!_0x256201['has'](_0x31decf)&&_0x256201['set'](_0x31decf,_0x277100['id']),_0x2125be[_0x6b93f(0x1c3)]&&_0x41d9f1[_0x6b93f(0x181)](_0x2125be[_0x6b93f(0x1c3)],_0x277100['id']);}};await matchExistingJourneySegments(_0x51f4ac,_0x3af42c,_0x3f0e6c[_0xec6f68(0x1cc)],_0x2f313b[_0xec6f68(0x1f7)],_0x2f313b[_0xec6f68(0x19e)]);const _0x5cba10={'resolveSegmentId':async _0x500e04=>{const _0x7d0d69=_0xec6f68,_0x53a9be=_0x2f313b[_0x7d0d69(0x19e)][_0x7d0d69(0x177)](_0x500e04);if(!_0x53a9be)throw new SDKError(ErrorCode[_0x7d0d69(0x1e7)],_0x7d0d69(0x204)+_0x500e04+_0x7d0d69(0x194)+_0x3af42c[_0x7d0d69(0x18b)]['name']+')');return _0x53a9be;},'resolveEmbeddedSegmentId':async(_0x34425b,_0x3ccea9)=>{const _0x58013f=_0xec6f68,_0xde5bf9=_0x2f313b[_0x58013f(0x19e)][_0x58013f(0x177)](_0x34425b);if(_0xde5bf9)return _0xde5bf9;const _0x3cb143=_0x2f313b[_0x58013f(0x1f7)][_0x58013f(0x1a7)](_0x15ddb6=>_0x15ddb6[_0x58013f(0x1c3)]===_0x34425b);if(_0x3cb143)return _0x2f313b['segmentNameToId'][_0x58013f(0x181)](_0x34425b,_0x3cb143['id']),_0x3cb143['id'];if(_0x3af42c[_0x58013f(0x17a)]){const {stageName:_0x3d5f64,criteriaName:_0x98bfb5}=findSegmentCriteriaLocation(_0x3af42c[_0x58013f(0x18b)],_0x34425b);return _0x2771c7(_0x34425b,_0x3ccea9[_0x58013f(0x1bd)]),_0x4fed0b['set'](_0x34425b,{'definition':_0x3ccea9,'stageName':_0x3d5f64,'criteriaName':_0x98bfb5}),createPendingSegmentId(_0x34425b);}const _0x1a01cc=_0x3af42c[_0x58013f(0x243)]?.['id'];if(!_0x1a01cc)throw new SDKError(ErrorCode[_0x58013f(0x1c2)],_0x58013f(0x258));const _0x164365=_0x472f65[_0x58013f(0x177)](_0x34425b);if(_0x164365)return _0x164365;const _0x542e6b=((async()=>{const _0x36ec17=_0x58013f;_0x2771c7(_0x34425b,_0x3ccea9[_0x36ec17(0x1bd)]);const _0x41c713=generateDeterministicJourneySegmentName(_0x3af42c[_0x36ec17(0x18b)][_0x36ec17(0x1c3)],_0x34425b),_0x238193=_0x2f313b['existingSegments']['find'](_0x334f15=>_0x334f15[_0x36ec17(0x1c3)]===_0x41c713),_0x542bba=createSegmentIdResolver(_0x2f313b[_0x36ec17(0x19e)],_0x34425b),_0x5b390e=await resolveRuleSegmentIds(_0x3ccea9[_0x36ec17(0x1bd)],_0x542bba);let _0x5b41f9;return _0x238193?(await _0x51f4ac[_0x36ec17(0x1b1)][_0x36ec17(0x238)](_0x3f0e6c[_0x36ec17(0x1cc)],_0x238193['id'],{'description':_0x3ccea9[_0x36ec17(0x1cf)]||_0x36ec17(0x22b)+_0x34425b,'rule':_0x49b000(_0x5b390e),'countPopulation':!![]}),_0x5b41f9=_0x238193['id'],saveSegmentToPushRecovery(_0x3af42c[_0x36ec17(0x1ef)],_0x3af42c[_0x36ec17(0x18b)]['name'],_0x34425b,{'segmentId':_0x5b41f9,'uniqueServerName':_0x41c713,'createdAt':new Date()[_0x36ec17(0x184)]()})):_0x5b41f9=await createOrRecoverEmbeddedSegment(_0x51f4ac,_0x3af42c,{'localName':_0x34425b,'uniqueSegmentName':_0x41c713,'description':_0x3ccea9[_0x36ec17(0x1cf)]||_0x36ec17(0x22b)+_0x34425b,'journeyId':_0x1a01cc,'resolvedRule':_0x5b390e,'parentId':_0x3f0e6c[_0x36ec17(0x1cc)],'folderId':_0x3f0e6c[_0x36ec17(0x23d)]||''},_0x49b000),_0x2f313b[_0x36ec17(0x19e)]['set'](_0x34425b,_0x5b41f9),_0x210367['set'](_0x34425b,_0x5b41f9),_0x5b41f9;})());_0x472f65[_0x58013f(0x181)](_0x34425b,_0x542e6b);try{return await _0x542e6b;}finally{_0x472f65[_0x58013f(0x1c0)](_0x34425b);}},'resolveActivationId':async _0x817dd3=>{const _0x116566=_0xec6f68,_0x2ac137=_0x41d9f1['get'](_0x817dd3);if(_0x2ac137)return _0x2ac137;if(_0x3af42c[_0x116566(0x243)]){await _0x5d806b();const _0x3c6b13=_0x41d9f1[_0x116566(0x177)](_0x817dd3);if(_0x3c6b13)return _0x3c6b13;}throw new SDKError(ErrorCode[_0x116566(0x203)],_0x116566(0x1bc)+_0x817dd3+_0x116566(0x194)+_0x3af42c['yamlConfig']['name']+_0x116566(0x157)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x1ca2a2,_0x30276f)=>{const _0x2dcf4c=_0xec6f68,_0x540d04=_0x41d9f1['get'](_0x1ca2a2);if(_0x540d04)return _0x540d04;if(_0x3af42c[_0x2dcf4c(0x17a)])return _0x614049[_0x2dcf4c(0x181)](_0x1ca2a2,_0x30276f),createPendingActivationId(_0x1ca2a2);if(_0x3af42c[_0x2dcf4c(0x243)]){await _0x5d806b();const _0xe41c4c=_0x41d9f1[_0x2dcf4c(0x177)](_0x30276f[_0x2dcf4c(0x1c3)]);if(_0xe41c4c)return _0x41d9f1[_0x2dcf4c(0x181)](_0x1ca2a2,_0xe41c4c),_0xe41c4c;const _0x245d75=activationSignature(_0x30276f),_0x13ea16=_0x256201?.[_0x2dcf4c(0x177)](_0x245d75);if(_0x13ea16)return _0x41d9f1[_0x2dcf4c(0x181)](_0x1ca2a2,_0x13ea16),_0x13ea16;const _0x511cd4=await _0x999e5d(_0x30276f,_0x2f313b[_0x2dcf4c(0x222)]),_0x42d59a={..._0x511cd4,..._0x30276f['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x30276f['run_after_journey_refresh']}},_0x454839=await _0x51f4ac[_0x2dcf4c(0x170)]['createActivation'](_0x3af42c[_0x2dcf4c(0x243)]['id'],_0x42d59a);return _0x41d9f1[_0x2dcf4c(0x181)](_0x1ca2a2,_0x454839['id']),_0x454839['id'];}throw new SDKError(ErrorCode[_0x2dcf4c(0x1c2)],_0x2dcf4c(0x173));},'resolveJourneyId':async _0x20b077=>{const _0x124d82=_0xec6f68;try{return await _0x51f4ac[_0x124d82(0x170)][_0x124d82(0x176)](_0x3f0e6c['parentId'],_0x20b077);}catch(_0x2b0ec8){throw new SDKError(ErrorCode[_0x124d82(0x203)],_0x124d82(0x223)+_0x20b077+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x3af42c['yamlConfig'][_0x124d82(0x1c3)]+'\x27)',_0x2b0ec8);}},'resolveStageId':async(_0x21a45c,_0x27fc3d)=>{const _0x1fb6e2=_0xec6f68,_0xe50f8f=await _0x51f4ac['journey'][_0x1fb6e2(0x1aa)](_0x21a45c),_0x306996=_0xe50f8f['attributes'][_0x1fb6e2(0x174)]['find'](_0x20b143=>_0x20b143[_0x1fb6e2(0x1c3)][_0x1fb6e2(0x188)]()===_0x27fc3d[_0x1fb6e2(0x188)]());if(!_0x306996?.['id'])throw new SDKError(ErrorCode[_0x1fb6e2(0x203)],_0x1fb6e2(0x1da)+_0x27fc3d+_0x1fb6e2(0x234)+(_0xe50f8f[_0x1fb6e2(0x1ed)][_0x1fb6e2(0x254)]||_0xe50f8f[_0x1fb6e2(0x1ed)][_0x1fb6e2(0x1c3)])+'\x27');return _0x306996['id'];}},_0x38ed7d=await _0x595169(_0x3af42c[_0xec6f68(0x18b)],_0x3f0e6c[_0xec6f68(0x1cc)],_0x5cba10),_0x5bee7d=_0x3f0e6c['folderId']||_0x3f0e6c[_0xec6f68(0x23d)];_0x5bee7d&&(_0x38ed7d['relationships']={'parentFolder':{'data':{'id':_0x5bee7d,'type':'folder'}}});if(_0x3af42c['isNew']){if(_0x4fed0b[_0xec6f68(0x1a2)]>0x0||_0x614049[_0xec6f68(0x1a2)]>0x0)return await executeThreeStepJourneyCreate(_0x51f4ac,_0x3af42c,_0x38ed7d,{'pendingEmbeddedSegments':_0x4fed0b,'pendingEmbeddedActivations':_0x614049,'embeddedSegmentNameToId':_0x210367,'journeyActivationNameToId':_0x41d9f1},{..._0x3f0e6c,'effectiveFolderId':_0x5bee7d},_0x2f313b,_0x217204,_0x45fd7c);else{ensureJourneyDefaults(_0x38ed7d[_0xec6f68(0x1ed)]);const _0x3898aa=await _0x51f4ac[_0xec6f68(0x170)]['create'](_0x38ed7d);return deletePushRecovery(_0x3af42c['absolutePath']),{'action':_0xec6f68(0x244),'journeyId':_0x3898aa['id'],'embeddedSegmentNameToId':_0x210367};}}else{if(_0x3af42c[_0xec6f68(0x217)]&&_0x3af42c[_0xec6f68(0x243)]){_0x38ed7d['id']=_0x3af42c['existingJourney']['id'];const _0x1ca65f=_0x38ed7d[_0xec6f68(0x1ed)];_0x3af42c[_0xec6f68(0x243)]['attributes']?.[_0xec6f68(0x254)]&&(_0x1ca65f[_0xec6f68(0x254)]=_0x3af42c[_0xec6f68(0x243)]['attributes'][_0xec6f68(0x254)]);const _0x159de5=_0x3af42c[_0xec6f68(0x243)][_0xec6f68(0x1ed)]?.[_0xec6f68(0x174)];return _0x159de5&&_0x38ed7d[_0xec6f68(0x1ed)][_0xec6f68(0x174)]&&injectExistingStageIds(_0x38ed7d[_0xec6f68(0x1ed)][_0xec6f68(0x174)],_0x159de5),ensureJourneyDefaults(_0x1ca65f),await _0x51f4ac[_0xec6f68(0x170)][_0xec6f68(0x1d5)](_0x3af42c[_0xec6f68(0x243)]['id'],_0x38ed7d),deletePushRecovery(_0x3af42c[_0xec6f68(0x1ef)]),{'action':'updated','journeyId':_0x3af42c[_0xec6f68(0x243)]['id'],'embeddedSegmentNameToId':_0x210367};}}return deletePushRecovery(_0x3af42c[_0xec6f68(0x1ef)]),{'action':_0xec6f68(0x1d2),'journeyId':_0x3af42c['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x210367};}function findSegmentCriteriaLocation(_0x466114,_0xdd1d7d){const _0x312c7b=a152_0x4fdbc8,_0x5c9ce3=_0x466114[_0x312c7b(0x23a)]||_0x466114[_0x312c7b(0x1ee)]?.[0x0]?.[_0x312c7b(0x23a)]||[];let _0x5edb60=_0x312c7b(0x19b),_0x575cc0=_0xdd1d7d;const _0x27b065=_0x466114[_0x312c7b(0x168)]||_0x466114[_0x312c7b(0x1ee)]?.[0x0]?.['goal'];if(_0x27b065?.['segment']===_0xdd1d7d)return{'stageName':_0x312c7b(0x168),'criteriaName':_0x27b065[_0x312c7b(0x1c3)]||_0xdd1d7d};_0x233e07:for(const _0x1e8732 of _0x5c9ce3){if(_0x1e8732[_0x312c7b(0x1d0)]?.[_0x312c7b(0x1b1)]===_0xdd1d7d){_0x5edb60=_0x1e8732[_0x312c7b(0x1c3)],_0x575cc0=_0x1e8732[_0x312c7b(0x1d0)][_0x312c7b(0x1c3)]||_0xdd1d7d;break;}if(_0x1e8732['steps'])for(const _0x34262b of _0x1e8732[_0x312c7b(0x15f)]){if(_0x34262b[_0x312c7b(0x1b8)]===_0x312c7b(0x22d)&&_0x34262b[_0x312c7b(0x190)]?.['branches'])for(const _0x25813a of _0x34262b[_0x312c7b(0x190)][_0x312c7b(0x1ac)]){if(_0x25813a[_0x312c7b(0x1b1)]===_0xdd1d7d){_0x5edb60=_0x1e8732['name'],_0x575cc0=_0x25813a[_0x312c7b(0x1c3)]||_0xdd1d7d;break _0x233e07;}}}}return{'stageName':_0x5edb60,'criteriaName':_0x575cc0};}async function executeThreeStepJourneyCreate(_0x472c3c,_0x150a2b,_0x4d0281,_0x381382,_0x1c05f0,_0x56cbeb,_0x3f067c,_0x10a173){const _0x12fb33=a152_0x4fdbc8,{activationDefToCreateRequest:_0x20e6a7,yamlRuleToApi:_0x28d2fa}=_0x10a173,{pendingEmbeddedSegments:_0x2d608e,pendingEmbeddedActivations:_0xf451e9,embeddedSegmentNameToId:_0x265699}=_0x381382,_0x564c77=JSON[_0x12fb33(0x20d)](JSON['stringify'](_0x4d0281));ensureJourneyDefaults(_0x564c77[_0x12fb33(0x1ed)]),stripPendingIds(_0x564c77);const _0x2b76cd=await _0x472c3c[_0x12fb33(0x170)][_0x12fb33(0x159)](_0x564c77),_0x153634=_0x2b76cd['id'],_0x407954=new Map();for(const _0x35243c of _0x2b76cd[_0x12fb33(0x1ed)][_0x12fb33(0x174)]){_0x407954['set'](_0x35243c['name'][_0x12fb33(0x188)](),_0x35243c['id']);}recoverSegmentIdsFromPushRecovery(_0x150a2b,_0x265699,_0x56cbeb['segmentNameToId']);for(const [_0x480042,{definition:_0x263df7}]of _0x2d608e){if(_0x265699[_0x12fb33(0x18c)](_0x480042)){_0x3f067c[_0x12fb33(0x247)]?.({'type':_0x12fb33(0x16a),'journeyName':_0x150a2b[_0x12fb33(0x18b)][_0x12fb33(0x1c3)],'segmentName':_0x480042});continue;}const _0x44be40=generateDeterministicJourneySegmentName(_0x150a2b[_0x12fb33(0x18b)]['name'],_0x480042);_0x3f067c[_0x12fb33(0x247)]?.({'type':_0x12fb33(0x15d),'journeyName':_0x150a2b[_0x12fb33(0x18b)][_0x12fb33(0x1c3)],'segmentName':_0x480042});const _0x50b1f4=createSegmentIdResolver(_0x56cbeb[_0x12fb33(0x19e)],_0x480042),_0x5c1505=await resolveRuleSegmentIds(_0x263df7['rule'],_0x50b1f4),_0x50e8ec=await createOrRecoverEmbeddedSegment(_0x472c3c,_0x150a2b,{'localName':_0x480042,'uniqueSegmentName':_0x44be40,'description':_0x263df7[_0x12fb33(0x1cf)]||_0x12fb33(0x22b)+_0x480042,'journeyId':_0x153634,'resolvedRule':_0x5c1505,'parentId':_0x1c05f0[_0x12fb33(0x1cc)],'folderId':_0x1c05f0[_0x12fb33(0x20a)]||''},_0x28d2fa);_0x265699['set'](_0x480042,_0x50e8ec),_0x56cbeb['segmentNameToId'][_0x12fb33(0x181)](_0x480042,_0x50e8ec),_0x3f067c[_0x12fb33(0x247)]?.({'type':_0x12fb33(0x16a),'journeyName':_0x150a2b[_0x12fb33(0x18b)][_0x12fb33(0x1c3)],'segmentName':_0x480042});}const _0x105487=new Map();for(const [_0x18ec6e,_0x15f7d5]of _0xf451e9){_0x3f067c[_0x12fb33(0x247)]?.({'type':_0x12fb33(0x21e),'journeyName':_0x150a2b[_0x12fb33(0x18b)][_0x12fb33(0x1c3)],'activationName':_0x18ec6e});const _0x3ca85e=await _0x20e6a7(_0x15f7d5,_0x56cbeb['activationContext']),_0x33ec8a={..._0x3ca85e,..._0x15f7d5[_0x12fb33(0x1af)]!==undefined&&{'runAfterJourneyRefresh':_0x15f7d5['run_after_journey_refresh']}},_0xbe465d=await _0x472c3c['journey'][_0x12fb33(0x17e)](_0x153634,_0x33ec8a);_0x105487[_0x12fb33(0x181)](_0x18ec6e,_0xbe465d['id']),_0x381382['journeyActivationNameToId'][_0x12fb33(0x181)](_0x18ec6e,_0xbe465d['id']),_0x3f067c[_0x12fb33(0x247)]?.({'type':'embedded_activation_created','journeyName':_0x150a2b[_0x12fb33(0x18b)][_0x12fb33(0x1c3)],'activationName':_0x18ec6e});}const _0x1d2c29=JSON[_0x12fb33(0x20d)](JSON[_0x12fb33(0x210)](_0x4d0281));return _0x1d2c29['id']=_0x153634,ensureJourneyDefaults(_0x1d2c29[_0x12fb33(0x1ed)]),resolvePendingIdsInRequest(_0x1d2c29,_0x4d0281,_0x407954,_0x265699,_0x105487,_0x3f067c),await _0x472c3c['journey'][_0x12fb33(0x1d5)](_0x153634,_0x1d2c29),deletePushRecovery(_0x150a2b[_0x12fb33(0x1ef)]),{'action':_0x12fb33(0x244),'journeyId':_0x153634,'embeddedSegmentNameToId':_0x265699};}export function stripWaitStepPendingIds(_0x1899da){const _0x37d7ae=a152_0x4fdbc8,_0x21ea84=_0x1899da[_0x37d7ae(0x1b7)]&&isPendingSegmentId(_0x1899da[_0x37d7ae(0x1b7)]),_0x2c137e=_0x1899da['conditions']?.[_0x37d7ae(0x183)](_0x2a02b2=>_0x2a02b2[_0x37d7ae(0x24b)]&&isPendingSegmentId(_0x2a02b2[_0x37d7ae(0x24b)]));(_0x21ea84||_0x2c137e)&&(_0x1899da['waitStepType']=_0x37d7ae(0x1d3),_0x1899da['waitStep']=0x1,_0x1899da[_0x37d7ae(0x1dd)]=_0x37d7ae(0x16e),delete _0x1899da[_0x37d7ae(0x1b7)],delete _0x1899da[_0x37d7ae(0x25c)],delete _0x1899da[_0x37d7ae(0x251)],delete _0x1899da[_0x37d7ae(0x237)]);}export function resolveWaitStepPendingIds(_0x45eb21,_0x267e5e,_0x53a2bd,_0x1dcbdf){const _0x57fa55=a152_0x4fdbc8;if(_0x267e5e['conditionSegmentId']&&isPendingSegmentId(_0x267e5e[_0x57fa55(0x1b7)])){const _0x55da8c=_0x53a2bd(_0x267e5e[_0x57fa55(0x1b7)],_0x57fa55(0x1f9)+_0x1dcbdf+_0x57fa55(0x214));_0x55da8c&&(_0x45eb21[_0x57fa55(0x182)]='Condition',_0x45eb21[_0x57fa55(0x1b7)]=_0x55da8c,delete _0x45eb21['waitStep'],delete _0x45eb21['waitStepUnit'],_0x267e5e['conditionTimeoutDuration']!==undefined&&(_0x45eb21['conditionTimeoutDuration']=_0x267e5e['conditionTimeoutDuration']),_0x267e5e[_0x57fa55(0x251)]&&(_0x45eb21[_0x57fa55(0x251)]=_0x267e5e[_0x57fa55(0x251)]));}if(_0x267e5e[_0x57fa55(0x237)]){const _0x1b7bda=_0x267e5e['conditions'][_0x57fa55(0x183)](_0x17b568=>_0x17b568['segmentId']&&isPendingSegmentId(_0x17b568[_0x57fa55(0x24b)]));if(_0x1b7bda){const _0x2824f6=_0x267e5e[_0x57fa55(0x237)][_0x57fa55(0x23f)](_0x5da401=>{const _0x3b4a2b=_0x57fa55;if(_0x5da401['segmentId']&&isPendingSegmentId(_0x5da401[_0x3b4a2b(0x24b)])){const _0x1ba1c9=_0x53a2bd(_0x5da401[_0x3b4a2b(0x24b)],_0x3b4a2b(0x1f9)+_0x1dcbdf+_0x3b4a2b(0x214));return{..._0x5da401,'segmentId':_0x1ba1c9||_0x5da401['segmentId']};}return{..._0x5da401};});_0x45eb21['waitStepType']='Condition',_0x45eb21[_0x57fa55(0x237)]=_0x2824f6,delete _0x45eb21[_0x57fa55(0x206)],delete _0x45eb21[_0x57fa55(0x1dd)],delete _0x45eb21['conditionSegmentId'],delete _0x45eb21['conditionTimeoutDuration'],delete _0x45eb21[_0x57fa55(0x251)];}}}function stripPendingIds(_0x30b9df){const _0x539c74=a152_0x4fdbc8;_0x30b9df[_0x539c74(0x1ed)][_0x539c74(0x168)]?.['segmentId']&&isPendingSegmentId(_0x30b9df['attributes'][_0x539c74(0x168)]['segmentId'])&&delete _0x30b9df['attributes'][_0x539c74(0x168)];for(const _0xd43d2b of _0x30b9df[_0x539c74(0x1ed)][_0x539c74(0x174)]||[]){_0xd43d2b[_0x539c74(0x19f)]?.['segmentId']&&isPendingSegmentId(_0xd43d2b[_0x539c74(0x19f)][_0x539c74(0x24b)])&&delete _0xd43d2b[_0x539c74(0x19f)];_0xd43d2b[_0x539c74(0x17f)]?.[_0x539c74(0x24b)]&&isPendingSegmentId(_0xd43d2b[_0x539c74(0x17f)][_0x539c74(0x24b)])&&delete _0xd43d2b[_0x539c74(0x17f)];_0xd43d2b[_0x539c74(0x24e)]&&(_0xd43d2b[_0x539c74(0x24e)]=_0xd43d2b[_0x539c74(0x24e)][_0x539c74(0x196)](_0x2ff39e=>!_0x2ff39e[_0x539c74(0x24b)]||!isPendingSegmentId(_0x2ff39e[_0x539c74(0x24b)])));if(_0xd43d2b[_0x539c74(0x15f)])for(const _0x187367 of Object['keys'](_0xd43d2b['steps'])){const _0x4ffd8a=_0xd43d2b['steps'][_0x187367];_0x4ffd8a[_0x539c74(0x1b8)]===_0x539c74(0x229)&&_0x4ffd8a[_0x539c74(0x1b4)]&&isPendingActivationId(_0x4ffd8a[_0x539c74(0x1b4)])&&(_0x4ffd8a['journeyActivationStepId']='');if(_0x4ffd8a[_0x539c74(0x1b8)]===_0x539c74(0x1c4)&&_0x4ffd8a[_0x539c74(0x1ac)])for(const _0x317f07 of _0x4ffd8a[_0x539c74(0x1ac)]){_0x317f07['segmentId']&&isPendingSegmentId(_0x317f07[_0x539c74(0x24b)])&&(_0x317f07[_0x539c74(0x24b)]='');}_0x4ffd8a[_0x539c74(0x1b8)]===_0x539c74(0x1cd)&&stripWaitStepPendingIds(_0x4ffd8a);}}}function resolvePendingIdsInRequest(_0x22f628,_0x34e7f6,_0x12d7c6,_0x19778f,_0x6d488f,_0xfa4949){const _0x1068a8=a152_0x4fdbc8,_0x4bf550=(_0x407bb5,_0x36ce43)=>{const _0x185a66=a152_0x43de;if(!isPendingSegmentId(_0x407bb5))return _0x407bb5;const _0x9a430c=extractPendingSegmentName(_0x407bb5),_0x3d1dfd=_0x19778f[_0x185a66(0x177)](_0x9a430c);return!_0x3d1dfd&&_0xfa4949[_0x185a66(0x187)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x9a430c+_0x185a66(0x226)+_0x36ce43),_0x3d1dfd;};if(_0x22f628['attributes'][_0x1068a8(0x168)]?.[_0x1068a8(0x24b)]&&isPendingSegmentId(_0x22f628[_0x1068a8(0x1ed)]['goal'][_0x1068a8(0x24b)])){const _0x17b477=_0x4bf550(_0x22f628[_0x1068a8(0x1ed)][_0x1068a8(0x168)][_0x1068a8(0x24b)],_0x1068a8(0x1e2));_0x17b477&&(_0x22f628['attributes'][_0x1068a8(0x168)][_0x1068a8(0x24b)]=_0x17b477);}for(const _0x581d30 of _0x22f628[_0x1068a8(0x1ed)][_0x1068a8(0x174)]||[]){const _0x2cf709=_0x12d7c6[_0x1068a8(0x177)](_0x581d30[_0x1068a8(0x1c3)]['toLowerCase']());_0x2cf709&&(_0x581d30['id']=_0x2cf709);if(_0x581d30['entryCriteria']?.[_0x1068a8(0x24b)]&&isPendingSegmentId(_0x581d30[_0x1068a8(0x19f)][_0x1068a8(0x24b)])){const _0x2fabfa=_0x4bf550(_0x581d30['entryCriteria']['segmentId'],_0x1068a8(0x1f9)+_0x581d30[_0x1068a8(0x1c3)]+_0x1068a8(0x191));_0x2fabfa&&(_0x581d30[_0x1068a8(0x19f)][_0x1068a8(0x24b)]=_0x2fabfa);}if(_0x581d30['exitCriterias'])for(const _0x249b05 of _0x581d30[_0x1068a8(0x24e)]){if(_0x249b05[_0x1068a8(0x24b)]&&isPendingSegmentId(_0x249b05[_0x1068a8(0x24b)])){const _0x122e14=_0x4bf550(_0x249b05[_0x1068a8(0x24b)],_0x1068a8(0x1f9)+_0x581d30[_0x1068a8(0x1c3)]+_0x1068a8(0x200));_0x122e14&&(_0x249b05[_0x1068a8(0x24b)]=_0x122e14);}}if(_0x581d30[_0x1068a8(0x17f)]?.[_0x1068a8(0x24b)]&&isPendingSegmentId(_0x581d30['milestone'][_0x1068a8(0x24b)])){const _0x2b5498=_0x4bf550(_0x581d30[_0x1068a8(0x17f)][_0x1068a8(0x24b)],_0x1068a8(0x1f9)+_0x581d30[_0x1068a8(0x1c3)]+_0x1068a8(0x16f));_0x2b5498&&(_0x581d30[_0x1068a8(0x17f)][_0x1068a8(0x24b)]=_0x2b5498);}if(_0x581d30['steps']){const _0x2f9e26=_0x10575d=>_0x34e7f6[_0x1068a8(0x1ed)]['journeyStages']?.['find'](_0x3b8e96=>_0x3b8e96[_0x1068a8(0x1c3)]['toLowerCase']()===_0x581d30[_0x1068a8(0x1c3)]['toLowerCase']())?.[_0x1068a8(0x15f)]?.[_0x10575d];for(const _0x39db4d of Object['keys'](_0x581d30[_0x1068a8(0x15f)])){const _0x320370=_0x581d30[_0x1068a8(0x15f)][_0x39db4d],_0x26053c=_0x2f9e26(_0x39db4d);if(_0x320370[_0x1068a8(0x1b8)]==='Activation'&&_0x320370[_0x1068a8(0x1b4)]&&(isPendingActivationId(_0x320370[_0x1068a8(0x1b4)])||_0x320370[_0x1068a8(0x1b4)]==='')){if(_0x26053c?.[_0x1068a8(0x1b4)]&&isPendingActivationId(_0x26053c[_0x1068a8(0x1b4)])){const _0x2a173=extractPendingActivationName(_0x26053c[_0x1068a8(0x1b4)]),_0x2258b0=_0x6d488f[_0x1068a8(0x177)](_0x2a173);_0x2258b0&&(_0x320370[_0x1068a8(0x1b4)]=_0x2258b0);}}if(_0x320370[_0x1068a8(0x1b8)]===_0x1068a8(0x1c4)&&_0x320370[_0x1068a8(0x1ac)]&&_0x26053c?.[_0x1068a8(0x1ac)])for(let _0x348dac=0x0;_0x348dac<_0x320370[_0x1068a8(0x1ac)][_0x1068a8(0x1a4)];_0x348dac++){const _0x2473b9=_0x320370['branches'][_0x348dac],_0x44a41c=_0x26053c[_0x1068a8(0x1ac)][_0x348dac];if(_0x44a41c?.[_0x1068a8(0x24b)]&&isPendingSegmentId(_0x44a41c[_0x1068a8(0x24b)])){const _0x4e931c=_0x4bf550(_0x44a41c[_0x1068a8(0x24b)],_0x1068a8(0x1f9)+_0x581d30[_0x1068a8(0x1c3)]+_0x1068a8(0x162)+(_0x2473b9[_0x1068a8(0x1c3)]||_0x348dac)+'\x27');_0x4e931c&&(_0x2473b9[_0x1068a8(0x24b)]=_0x4e931c);}}_0x320370[_0x1068a8(0x1b8)]==='WaitStep'&&_0x26053c?.[_0x1068a8(0x1b8)]===_0x1068a8(0x1cd)&&resolveWaitStepPendingIds(_0x320370,_0x26053c,_0x4bf550,_0x581d30[_0x1068a8(0x1c3)]);}}}}
|
|
1
|
+
const a152_0x5819a5=a152_0x3568;(function(_0x39876d,_0x377aaf){const _0x1a7e89=a152_0x3568,_0x52983b=_0x39876d();while(!![]){try{const _0x7b4e80=-parseInt(_0x1a7e89(0x1e1))/0x1*(-parseInt(_0x1a7e89(0x10c))/0x2)+-parseInt(_0x1a7e89(0x14b))/0x3*(parseInt(_0x1a7e89(0x1eb))/0x4)+parseInt(_0x1a7e89(0x132))/0x5+parseInt(_0x1a7e89(0x192))/0x6+parseInt(_0x1a7e89(0x120))/0x7*(-parseInt(_0x1a7e89(0x13a))/0x8)+-parseInt(_0x1a7e89(0x13f))/0x9*(parseInt(_0x1a7e89(0x13c))/0xa)+-parseInt(_0x1a7e89(0x1ef))/0xb*(-parseInt(_0x1a7e89(0x11b))/0xc);if(_0x7b4e80===_0x377aaf)break;else _0x52983b['push'](_0x52983b['shift']());}catch(_0x4819fc){_0x52983b['push'](_0x52983b['shift']());}}}(a152_0x1dcf,0x79394));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x5819a5(0x180));export const PENDING_SEGMENT_PREFIX=a152_0x5819a5(0x161);export const PENDING_ACTIVATION_PREFIX=a152_0x5819a5(0x1d1);export function createPendingSegmentId(_0x40e3e2){return''+PENDING_SEGMENT_PREFIX+_0x40e3e2+'__';}export function isPendingSegmentId(_0x1d070f){const _0x365bea=a152_0x5819a5;return _0x1d070f[_0x365bea(0x177)](PENDING_SEGMENT_PREFIX)&&!_0x1d070f[_0x365bea(0x177)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x56bb7e){return _0x56bb7e['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x48fea9){return''+PENDING_ACTIVATION_PREFIX+_0x48fea9+'__';}export function isPendingActivationId(_0xb96df9){const _0x25015a=a152_0x5819a5;return _0xb96df9[_0x25015a(0x177)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x4e82b2){const _0x4fc544=a152_0x5819a5;return _0x4e82b2[_0x4fc544(0x122)](/^__pending_act_(.+)__$/,'$1');}function a152_0x3568(_0x2970a2,_0x2ecdb5){_0x2970a2=_0x2970a2-0xfc;const _0x1dcf34=a152_0x1dcf();let _0x35684c=_0x1dcf34[_0x2970a2];return _0x35684c;}export function generateDeterministicJourneySegmentName(_0xf558f6,_0x1db505){const _0x17aae9=a152_0x5819a5,_0x4ad0da=_0xf558f6+'::'+(_0x1db505['trim']()||'segment'),_0xc4b295=createHash('sha1')[_0x17aae9(0x1bf)](_0x4ad0da)[_0x17aae9(0x19d)](_0x17aae9(0x136))['slice'](0x0,0xc);return'journey_entry_criteria_'+_0xc4b295;}export function ensureJourneyDefaults(_0x2daada){const _0x17c3e8=a152_0x5819a5;!_0x2daada[_0x17c3e8(0x197)]&&(_0x2daada[_0x17c3e8(0x197)]=''),!_0x2daada[_0x17c3e8(0x1cd)]&&(_0x2daada[_0x17c3e8(0x1cd)]=_0x17c3e8(0x191));}export function injectExistingStageIds(_0x2dbaa1,_0x41ce25){const _0xb06a08=a152_0x5819a5,_0x314a9c=new Map(_0x41ce25[_0xb06a08(0x1fc)](_0x322618=>[_0x322618[_0xb06a08(0x1a3)],_0x322618['id']]));for(const _0x4904a7 of _0x2dbaa1){if(!_0x4904a7['id']){const _0x3aa25b=_0x314a9c[_0xb06a08(0x1d9)](_0x4904a7[_0xb06a08(0x1a3)]);_0x3aa25b&&(_0x4904a7['id']=_0x3aa25b);}}}export function resolveTDFolderPath(_0x55fcc3,_0x424290,_0x210df1){if(!_0x424290)return _0x55fcc3;if(_0x55fcc3===_0x210df1||_0x55fcc3['startsWith'](_0x210df1+'/'))return _0x55fcc3;return _0x55fcc3?_0x210df1+'/'+_0x55fcc3:_0x210df1;}export function addFoldersToCreate(_0x506ba4,_0x2c5b3e,_0x1bd5db){const _0x426cfe=a152_0x5819a5;if(!_0x506ba4)return;if(_0x2c5b3e[_0x426cfe(0x1e3)](_0x506ba4))return;const _0x277135=_0x506ba4['split']('/');let _0x2626e1='';for(const _0x15e7b7 of _0x277135){_0x2626e1=_0x2626e1?_0x2626e1+'/'+_0x15e7b7:_0x15e7b7,!_0x2c5b3e[_0x426cfe(0x1e3)](_0x2626e1)&&_0x1bd5db[_0x426cfe(0x1ff)](_0x2626e1);}}export function sortFoldersByDepth(_0x2932c0){const _0x21ef0c=a152_0x5819a5;return[..._0x2932c0][_0x21ef0c(0x1c1)]((_0x13a78e,_0x52a5b8)=>{const _0x89ebf4=_0x21ef0c,_0x1e8201=(_0x13a78e[_0x89ebf4(0x1fb)](/\//g)||[])['length'],_0x4e93d3=(_0x52a5b8[_0x89ebf4(0x1fb)](/\//g)||[])[_0x89ebf4(0x19b)];return _0x1e8201-_0x4e93d3;});}import*as a152_0x27a142 from'yaml';import{readFileSync}from'fs';import a152_0x322d4e from'path';import{isJourneyDef,parseYamlString as a152_0x4dcb37,toYamlString as a152_0x42e94e,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x11a70d){const _0x2128d5=a152_0x5819a5;if(Array[_0x2128d5(0x102)](_0x11a70d))return'['+_0x11a70d['map'](_0x86d337=>stableStringify(_0x86d337))[_0x2128d5(0x110)](',')+']';if(_0x11a70d&&typeof _0x11a70d==='object'){const _0x590caf=_0x11a70d,_0x3d3137=Object[_0x2128d5(0x101)](_0x590caf)['sort'](),_0x2de351=_0x3d3137[_0x2128d5(0x1fc)](_0x48e7b7=>'\x22'+_0x48e7b7+'\x22:'+stableStringify(_0x590caf[_0x48e7b7]));return'{'+_0x2de351['join'](',')+'}';}const _0x5dcc40=JSON['stringify'](_0x11a70d);return _0x5dcc40===undefined?'null':_0x5dcc40;}function activationSignature(_0x58c309){const _0x2b3bc9=a152_0x5819a5,_0x5873c4={'connection':_0x58c309[_0x2b3bc9(0x205)],..._0x58c309[_0x2b3bc9(0x13b)]!==undefined&&{'all_columns':_0x58c309[_0x2b3bc9(0x13b)]},..._0x58c309[_0x2b3bc9(0x117)]!==undefined&&{'columns':_0x58c309[_0x2b3bc9(0x117)]},..._0x58c309[_0x2b3bc9(0x109)]!==undefined&&{'behavior':_0x58c309[_0x2b3bc9(0x109)]},..._0x58c309[_0x2b3bc9(0xfe)]!==undefined&&{'schedule':_0x58c309[_0x2b3bc9(0xfe)]},..._0x58c309[_0x2b3bc9(0x11e)]!==undefined&&{'notification':_0x58c309[_0x2b3bc9(0x11e)]},..._0x58c309[_0x2b3bc9(0x186)]!==undefined&&{'connector_config':_0x58c309[_0x2b3bc9(0x186)]},..._0x58c309[_0x2b3bc9(0x16f)]!==undefined&&{'activation_template_id':_0x58c309[_0x2b3bc9(0x16f)]}};return stableStringify(_0x5873c4);}async function fetchSegment(_0x442e91,_0x3d9fc9,_0x588605,_0x4dbf4f){const _0x176e9d=a152_0x5819a5,_0x5aacb5=_0x4dbf4f?.[_0x176e9d(0x133)](_0x13c7aa=>_0x13c7aa['id']===_0x588605);if(_0x5aacb5)return _0x5aacb5;try{return await _0x442e91[_0x176e9d(0x1c3)][_0x176e9d(0x18f)](_0x3d9fc9,_0x588605);}catch(_0x2f6759){logger[_0x176e9d(0x172)](_0x176e9d(0x130)+_0x588605+_0x176e9d(0x194)+_0x2f6759);try{return await _0x442e91[_0x176e9d(0x1c3)][_0x176e9d(0x15c)](_0x588605);}catch(_0x247b74){return logger[_0x176e9d(0x172)](_0x176e9d(0x175)+_0x588605+':\x20'+_0x247b74),null;}}}function recoverSegmentIdsFromPushRecovery(_0x368f29,_0x14551b,_0x361428){const _0xb4b01b=a152_0x5819a5,_0x7e0e4a=readPushRecovery(_0x368f29[_0xb4b01b(0x1af)]);if(_0x7e0e4a?.[_0xb4b01b(0x11f)]===_0x368f29[_0xb4b01b(0x108)]['name'])for(const [_0x4d605c,_0x35cdf3]of Object[_0xb4b01b(0x19f)](_0x7e0e4a['segments'])){const _0x5eeec8=generateDeterministicJourneySegmentName(_0x368f29[_0xb4b01b(0x108)][_0xb4b01b(0x1a3)],_0x4d605c);_0x35cdf3['uniqueServerName']===_0x5eeec8&&(_0x14551b['set'](_0x4d605c,_0x35cdf3[_0xb4b01b(0x15e)]),_0x361428[_0xb4b01b(0x1bb)](_0x4d605c,_0x35cdf3[_0xb4b01b(0x15e)]));}}async function createOrRecoverEmbeddedSegment(_0x549759,_0x2344ad,_0x23dbd1,_0x1e48e6){const _0x22df76=a152_0x5819a5;let _0x1712fc;try{_0x1712fc=await _0x549759[_0x22df76(0x1c3)][_0x22df76(0x1db)]({'name':_0x23dbd1[_0x22df76(0x165)],'description':_0x23dbd1[_0x22df76(0x197)],'journeyId':_0x23dbd1[_0x22df76(0x1e5)],'rule':_0x1e48e6(_0x23dbd1[_0x22df76(0x135)],!![]),'countPopulation':!![],'parentFolderId':_0x23dbd1[_0x22df76(0x164)],'audienceId':_0x23dbd1['parentId']});}catch(_0x35b172){const _0x32da9d=_0x35b172 instanceof Error&&_0x35b172[_0x22df76(0x1f0)][_0x22df76(0x1bd)]('Name\x20has\x20already\x20been\x20taken');if(_0x32da9d){const _0x37dcc3=readPushRecovery(_0x2344ad[_0x22df76(0x1af)]),_0x4a2f45=_0x37dcc3?.[_0x22df76(0x11f)]===_0x2344ad['yamlConfig'][_0x22df76(0x1a3)]?_0x37dcc3[_0x22df76(0x15f)][_0x23dbd1[_0x22df76(0x12c)]]:undefined;if(_0x4a2f45?.['uniqueServerName']===_0x23dbd1['uniqueSegmentName'])await _0x549759['segment']['updateSegmentById'](_0x23dbd1[_0x22df76(0x113)],_0x4a2f45[_0x22df76(0x15e)],{'description':_0x23dbd1[_0x22df76(0x197)],'rule':_0x1e48e6(_0x23dbd1[_0x22df76(0x135)],!![]),'countPopulation':!![]}),_0x1712fc=_0x4a2f45[_0x22df76(0x15e)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x22df76(0x181)+_0x23dbd1[_0x22df76(0x12c)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x22df76(0x190)+_0x2344ad['absolutePath']['replace'](/([^/]+)$/,_0x22df76(0x1e0))+')\x20')+_0x22df76(0x118),_0x35b172);}else throw _0x35b172;}return saveSegmentToPushRecovery(_0x2344ad[_0x22df76(0x1af)],_0x2344ad[_0x22df76(0x108)][_0x22df76(0x1a3)],_0x23dbd1['localName'],{'segmentId':_0x1712fc,'uniqueServerName':_0x23dbd1[_0x22df76(0x165)],'createdAt':new Date()['toISOString']()}),_0x1712fc;}export async function prepareSegmentFiles(_0x162f89,_0x3d3cbd,_0x169d72,_0x290a04,_0x73d90b){const _0x4b90e1=a152_0x5819a5,{activationDefToCreateRequest:_0x2b26c2}=await import(_0x4b90e1(0x1cf)),_0xecfd6f=[],_0x12aa76=new Set();for(const {yamlConfig:_0x1d6342,folderPath:_0x9a41e3,sourcePath:_0x2ad179}of _0x162f89){const _0x205efa=resolveTDFolderPath(_0x9a41e3,_0x290a04,_0x73d90b),_0x56eb8d=_0x205efa+':'+_0x1d6342[_0x4b90e1(0x1a3)],_0x183af2=_0x3d3cbd[_0x4b90e1(0x176)]['get'](_0x56eb8d),_0x1599d5=_0x183af2?_0x3d3cbd[_0x4b90e1(0x12b)]['get'](_0x183af2['id'])||[]:[];addFoldersToCreate(_0x205efa,_0x3d3cbd[_0x4b90e1(0x10d)],_0x12aa76);const _0x1c762d=calculateActivationActions(_0x1d6342[_0x4b90e1(0x15d)]||[],_0x1599d5,_0x3d3cbd[_0x4b90e1(0x10b)],_0x3d3cbd['connectionIdToNameMap']);for(const _0x354fe1 of _0x1c762d){(_0x354fe1[_0x4b90e1(0x150)]==='create'||_0x354fe1[_0x4b90e1(0x150)]===_0x4b90e1(0x1bf))&&_0x354fe1[_0x4b90e1(0x15b)]&&(_0x354fe1[_0x4b90e1(0x156)]=await _0x2b26c2(_0x354fe1[_0x4b90e1(0x15b)],_0x169d72));}const _0x2cfec1=calculateSegmentDiff(_0x1d6342,_0x183af2,_0x1599d5,_0x3d3cbd['idToEmailMap'],_0x3d3cbd[_0x4b90e1(0x1e6)]);_0xecfd6f['push']({'relativePath':_0x1d6342[_0x4b90e1(0x1a3)],'absolutePath':_0x2ad179,'yamlConfig':_0x1d6342,'folderPath':_0x205efa,'existingSegment':_0x183af2,'existingActivations':_0x1599d5,'isNew':_0x2cfec1[_0x4b90e1(0x198)],'hasChanges':_0x2cfec1[_0x4b90e1(0x1ee)],'diff':_0x2cfec1[_0x4b90e1(0x159)],'activationActions':_0x1c762d});}return{'segmentFiles':_0xecfd6f,'foldersToCreate':_0x12aa76};}export async function prepareJourneyFiles(_0x1de163,_0x41e037,_0x33ac2c,_0x16bf47){const _0x34ada3=a152_0x5819a5,_0x195b1c=[],_0x483056=new Set();for(const {yamlConfig:_0x6fe434,folderPath:_0x3684a2,sourcePath:_0x136441}of _0x1de163){const _0x51b6dd=resolveTDFolderPath(_0x3684a2,_0x33ac2c,_0x16bf47),_0x3422da=_0x51b6dd+':'+_0x6fe434[_0x34ada3(0x1a3)],_0x53b977=_0x41e037[_0x34ada3(0x1a0)][_0x34ada3(0x1d9)](_0x3422da);let _0x31104b,_0x32c98e;if(_0x53b977&&_0x53b977[_0x34ada3(0x19b)]>0x0){const _0x446cda=buildLocalExpandedRuleMappings(_0x6fe434),{createYamlContext:_0x4107b1,prefetchJourneySegments:_0xe83909}=createPushYamlContextForBundle(_0x41e037['deps'],_0x41e037[_0x34ada3(0x113)],_0x41e037[_0x34ada3(0x1e8)],_0x446cda,_0x41e037['idToEmailMap'],_0x41e037[_0x34ada3(0x1e6)],_0x41e037['activationStepsById'],_0x41e037[_0x34ada3(0x166)]);await _0xe83909(_0x53b977['map'](_0x347c7b=>_0x347c7b['id']));const _0x5f3020=await _0x41e037[_0x34ada3(0x182)][_0x34ada3(0x11c)][_0x34ada3(0x18c)](_0x53b977[0x0][_0x34ada3(0x171)]),_0x2ddf44=hasMultipleVersions(_0x6fe434),_0x5206dc=async _0x36ffa8=>{const _0x10ad40=_0x34ada3,_0x2a9945=_0x41e037[_0x10ad40(0x166)]?.[_0x10ad40(0x1d9)](_0x36ffa8);if(_0x2a9945)return _0x2a9945;return _0x41e037[_0x10ad40(0x12d)]({'journeyId':_0x36ffa8,'journeyName':_0x6fe434['name'],'isMultiVersion':_0x53b977[_0x10ad40(0x19b)]>0x1});};if(_0x2ddf44&&_0x53b977[_0x34ada3(0x19b)]>0x1){const _0x10f7a5=[];for(const _0x32ec5e of _0x53b977){const _0x4dc3e0=_0x32ec5e['versionNumber']||0x1;_0x41e037['progress']?.[_0x34ada3(0x1bf)](_0x34ada3(0x131)+_0x6fe434[_0x34ada3(0x1a3)]+'\x20v'+_0x4dc3e0);const _0x5e2716=await _0x5206dc(_0x32ec5e['id']),_0x15e54c=_0x4107b1(_0x32ec5e['id']),_0x3c5a63=await journeyResponseToDef(_0x5e2716,_0x15e54c);_0x10f7a5['push']({'item':_0x32ec5e,'yaml':_0x3c5a63});}const _0x20bd12=buildLocalRuleToNameMappingFromJourney(_0x6fe434);_0x32c98e=buildMergedJourneyDef(_0x10f7a5,_0x20bd12,_0x5f3020);const _0x300a16=Math[_0x34ada3(0x1b2)](..._0x10f7a5[_0x34ada3(0x1fc)](_0x43e390=>_0x43e390['item'][_0x34ada3(0x1c5)]||0x0)),_0x3f16d2=_0x53b977[_0x34ada3(0x133)](_0x40f216=>(_0x40f216[_0x34ada3(0x1c5)]||0x0)===_0x300a16);_0x3f16d2&&(_0x41e037[_0x34ada3(0x1e4)]?.[_0x34ada3(0x1bf)]('Fetching\x20'+_0x6fe434[_0x34ada3(0x1a3)]+'\x20v'+_0x300a16),_0x31104b=await _0x5206dc(_0x3f16d2['id']));}else{const _0x327e4a=_0x53b977[_0x53b977['length']-0x1];_0x41e037[_0x34ada3(0x1e4)]?.['update'](_0x34ada3(0x131)+_0x6fe434[_0x34ada3(0x1a3)]),_0x31104b=await _0x5206dc(_0x327e4a['id']);const _0x400060=_0x4107b1(_0x327e4a['id']),_0x15bc7d=await journeyResponseToDef(_0x31104b,_0x400060),_0x4838ff=buildLocalRuleToNameMappingFromJourney(_0x6fe434);_0x32c98e=buildMergedJourneyDef([{'item':_0x327e4a,'yaml':_0x15bc7d}],_0x4838ff,_0x5f3020);}}addFoldersToCreate(_0x51b6dd,_0x41e037[_0x34ada3(0x10d)],_0x483056);const _0x1b3004=calculateJourneyDiff(_0x6fe434,_0x32c98e);_0x195b1c[_0x34ada3(0x1b3)]({'relativePath':_0x6fe434[_0x34ada3(0x1a3)],'absolutePath':_0x136441,'yamlConfig':_0x6fe434,'folderPath':_0x51b6dd,'existingJourney':_0x31104b,'isNew':_0x1b3004[_0x34ada3(0x198)],'hasChanges':_0x1b3004[_0x34ada3(0x1ee)],'diff':_0x1b3004[_0x34ada3(0x159)]});}return{'journeyFiles':_0x195b1c,'foldersToCreate':_0x483056};}export function calculateActivationActions(_0x3d41ec,_0x3074d6,_0x496208,_0xc5f24b){const _0x1b7ad9=a152_0x5819a5,_0x41d19c=[],_0x286381=new Map();for(const _0x4b58d4 of _0x3074d6){_0x286381[_0x1b7ad9(0x1bb)](_0x4b58d4[_0x1b7ad9(0x1a3)],_0x4b58d4);}const _0x2b5d8b=new Map();for(const _0x40d14b of _0x3d41ec){_0x2b5d8b[_0x1b7ad9(0x1bb)](_0x40d14b[_0x1b7ad9(0x1a3)],_0x40d14b);}for(const _0x22672e of _0x3d41ec){const _0x2993c9=_0x286381[_0x1b7ad9(0x1d9)](_0x22672e[_0x1b7ad9(0x1a3)]);if(!_0x2993c9)_0x41d19c['push']({'type':_0x1b7ad9(0x105),'name':_0x22672e['name'],'yamlActivation':_0x22672e});else{const _0x1ccf01=activationResponseToDef(_0x2993c9,_0x496208,_0xc5f24b),_0x357fb9=a152_0x27a142[_0x1b7ad9(0x203)](_0x1ccf01),_0x2aff0a=a152_0x27a142[_0x1b7ad9(0x203)](_0x22672e);_0x357fb9!==_0x2aff0a&&_0x41d19c[_0x1b7ad9(0x1b3)]({'type':_0x1b7ad9(0x1bf),'name':_0x22672e[_0x1b7ad9(0x1a3)],'yamlActivation':_0x22672e,'existingActivation':_0x2993c9});}}for(const _0x1e23bc of _0x3074d6){!_0x2b5d8b['has'](_0x1e23bc[_0x1b7ad9(0x1a3)])&&_0x41d19c[_0x1b7ad9(0x1b3)]({'type':_0x1b7ad9(0x1d4),'name':_0x1e23bc['name'],'existingActivation':_0x1e23bc});}return _0x41d19c;}function a152_0x1dcf(){const _0x27f6f6=['activationsBySegmentId','localName','fetchJourney','exitCriterias','getActivation','getSegment\x20failed\x20for\x20','Fetching\x20','356325YeAmyF','find','onProgress','resolvedRule','hex','folder_creating','NOT_FOUND','activationContext','36552qbqMUv','all_columns','620710eRNpDO','createFolder','data','9BRoNnQ','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','logDeleted','\x20journey\x20from\x20file:\x20','activation_deleting','SEGMENT_UPDATE_ERROR','conditionSegmentId','\x20error(s)','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','existingSegment','\x27\x20by\x20rule\x20content','updated','95229eusnFB','embeddedSegmentNameToId','entryCriteria','filter','kind','type','valid','updateSegmentById','conditionTimeoutUnit','parentSegmentFolder','./journey-yaml.js','validatedRequest','toLowerCase','journeys','diff','segment_created','yamlActivation','getSegmentEntity','activations','segmentId','segments','created','__pending_','embedded_segment_created','logInfo','folderId','uniqueSegmentName','journeyById','INTERNAL','WaitStep','goal\x20criteria','utf-8','JOURNEY_SYNTAX_ERROR','Deleted\x20activation\x20\x27','createSegment','createdSegmentId','activation_template_id','ACTIVATION_SYNTAX_ERROR','journeyBundleId','debug','segment_deleting','Activation\x20not\x20found:\x20','getSegmentEntity\x20also\x20failed\x20for\x20','segmentByFolderAndName','startsWith','segmentFolderId','skipSegments','DecisionPoint','stages','split','parse','listActivations','\x27...','tdx.sdk.push-workflow','Embedded\x20segment\x20\x27','deps','relationships','deleteSegment','verbose','connector_config','entry','journey_created','waitStep','\x20segment\x20from\x20file:\x20','\x27\x20milestone','getLatestJourneyId','attributes','getJourney','getSegment','Delete\x20the\x20push\x20recovery\x20file\x20(','draft','4490490rkpOYw','errors',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','Condition','Matched\x20server\x20segment\x20\x27','description','isNew','\x0a\x20\x20','Updated\x20segment\x20\x27','length','journeyActivationStepId','digest','Stage\x20\x27','entries','journeyBundlesByFolderAndName','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','\x20activation\x20\x27','name','Segment\x20not\x20found','Creating\x20activation\x20\x27','segment_updated','results','milestone','Updating\x20activation\x20\x27','activationActions','segment_deleted','buildUserMaps','Failed\x20to\x20resolve\x20segment\x20','index','absolutePath','day','unchanged','max','push','JOURNEY_UPDATE_ERROR','logWarning','SEGMENT_SYNTAX_ERROR','nameToId','slice','updateActivation','folderPath','set','\x27\x20for\x20','includes','logSuccess','update','folder','sort','rootFolderId','segment','from','versionNumber','size','ACTIVATION_UPDATE_ERROR','\x20(referenced\x20in\x20journey\x20','rule','toString','Segment\x20not\x20found:\x20','Failed\x20to\x20fetch\x20referenced\x20segment\x20','state','deleted','./child-segment-yaml.js','Created\x20activation\x20\x27','__pending_act_',').\x20','activation_','delete','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','journeyBundleName','\x27\x20not\x20found\x20in\x20journey\x20\x27','goal','get','existingActivation','createJourneySegment','run_after_journey_refresh','resolveJourneyId','\x27\x20to\x20local\x20\x27','withProgress','.$1.push-recovery.json','147229QKjVJE','Deleting\x20activation\x20\x27','has','progress','journeyId','connectionIdToNameMap','Activation','existingSegments','journey_creating','embedded_activation_created','24uExCTy','activation_creating','branches','hasChanges','26708sojJpg','message','resolveSegment','Creating\x20folder\x20\x27','Failed\x20to\x20','action','parentFolder','idToName','journeyStages','activation_updating','steps','journey_updated','match','map','folder_created','Updated\x20activation\x20\x27','add','waitStepUnit','conditions','existingJourney','stringify','toISOString','connection','Failed\x20to\x20resolve\x20activation\x20','values','schedule','flatMap','Updated\x20journey\x20\x27','keys','isArray','../../utils/async.js','segment_updating','create','with','Duration','yamlConfig','behavior','SEGMENT_NOT_FOUND','idToEmailMap','2EnHcAz','folderPathToId','user','\x27\x20wait\x20condition','join','Deleted\x20segment\x20\x27','waitStepType','parentId','effectiveFolderId','\x27\x20from\x20file:\x20','segmentNameToId','columns','and\x20the\x20server\x20segment,\x20then\x20retry.','some','relative','2988AOQCkT','journey','activation_deleted','notification','journeyName','1260SHTJfF','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','replace','stage\x20\x27','createdSegmentIds','parseDocument','conditionTimeoutDuration','entry_criteria','Entry\x20criteria:\x20','Created\x20segment\x20\x27','nameToType'];a152_0x1dcf=function(){return _0x27f6f6;};return a152_0x1dcf();}function calculateYamlDiff(_0x3d4deb,_0x2c0314){if(_0x2c0314){const _0x4504fc=generateDiff(_0x2c0314,_0x3d4deb),_0x2df121=hasChanges(_0x4504fc);return{'isNew':![],'hasChanges':_0x2df121,'diff':_0x2df121?formatDiffWithColors(_0x4504fc):undefined};}const _0x1d3a8a=generateDiff('',_0x3d4deb);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1d3a8a)};}export function calculateSegmentDiff(_0x1f7779,_0x27d69e,_0x3fa1f2,_0x3c2b58,_0x5b2c35){const _0x8eb1a=segmentToYamlString(_0x1f7779),_0x52e348=_0x27d69e?segmentToYamlString(segmentWithActivationsToYaml(_0x27d69e,_0x3fa1f2,undefined,_0x3c2b58,_0x5b2c35)):undefined;return calculateYamlDiff(_0x8eb1a,_0x52e348);}export function calculateJourneyDiff(_0x4aa3d5,_0x3078df){const _0x116859=normalizeJourneyDef(_0x4aa3d5,_0x4aa3d5),_0x1cf5ac=a152_0x42e94e(_0x116859),_0x22edc0=_0x3078df?a152_0x42e94e(normalizeJourneyDef(_0x3078df,_0x4aa3d5)):undefined;return calculateYamlDiff(_0x1cf5ac,_0x22edc0);}export function findSegmentsToDelete(_0x20d0ed,_0x475730,_0x4eb715,_0x282d0c,_0x2074c9){const _0x3f6236=a152_0x5819a5,_0x35fbf5=new Set();for(const {yamlConfig:_0x3234d6,folderPath:_0x34f094}of _0x475730){_0x35fbf5[_0x3f6236(0x1ff)](_0x34f094+':'+_0x3234d6[_0x3f6236(0x1a3)]);}return _0x20d0ed[_0x3f6236(0x14e)](_0x4e1cb8=>{const _0xc9486f=_0x3f6236,_0x5e07d3=_0x4e1cb8[_0xc9486f(0x178)]?_0x4eb715[_0xc9486f(0x1d9)](_0x4e1cb8[_0xc9486f(0x178)][_0xc9486f(0x1ca)]())||'':'',_0x14dbc7=_0x5e07d3+':'+_0x4e1cb8[_0xc9486f(0x1a3)];if(_0x35fbf5[_0xc9486f(0x1e3)](_0x14dbc7))return![];if(_0x2074c9)return _0x5e07d3===_0x282d0c||_0x5e07d3[_0xc9486f(0x177)](_0x282d0c+'/');return!![];});}export function findJourneysToDelete(_0x16b009,_0x5664ee,_0x44b459,_0x441867,_0x216b08){const _0x46acc0=a152_0x5819a5,_0x484657=new Set();for(const {yamlConfig:_0x187a7a,folderPath:_0x59572f}of _0x5664ee){_0x484657[_0x46acc0(0x1ff)](_0x59572f+':'+_0x187a7a[_0x46acc0(0x1a3)]);}return _0x16b009['filter'](_0x52432d=>{const _0x455c2c=_0x46acc0,_0x307f32=_0x52432d['folderId']?_0x44b459[_0x455c2c(0x1d9)](_0x52432d[_0x455c2c(0x164)])||'':'',_0x4dacec=_0x307f32+':'+_0x52432d[_0x455c2c(0x1d6)];if(_0x484657[_0x455c2c(0x1e3)](_0x4dacec))return![];if(_0x216b08)return _0x307f32===_0x441867||_0x307f32[_0x455c2c(0x177)](_0x441867+'/');return!![];});}export function buildSegmentLookupMap(_0x4e2b3b,_0x6a64db){const _0x29ef83=a152_0x5819a5,_0x3ef1db=new Map();for(const _0x404181 of _0x4e2b3b){const _0x4941ab=_0x404181[_0x29ef83(0x178)]?_0x6a64db[_0x29ef83(0x1d9)](_0x404181[_0x29ef83(0x178)]['toString']())||'':'',_0xbf3690=_0x4941ab+':'+_0x404181[_0x29ef83(0x1a3)];_0x3ef1db[_0x29ef83(0x1bb)](_0xbf3690,_0x404181);}return _0x3ef1db;}export function buildSegmentNameToIdMap(_0x2db411){const _0xa41c41=a152_0x5819a5,_0x173da6=new Map();for(const _0x3f1c84 of _0x2db411){_0x173da6[_0xa41c41(0x1bb)](_0x3f1c84[_0xa41c41(0x1a3)],_0x3f1c84['id']);}return _0x173da6;}export function buildJourneyBundleLookupMap(_0x5009f2,_0xe95018){const _0x57a810=a152_0x5819a5,_0x5238f3=new Map();for(const _0x5bb903 of _0x5009f2){const _0x449fd9=_0x5bb903[_0x57a810(0x164)]?_0xe95018['get'](_0x5bb903[_0x57a810(0x164)])||'':'',_0xf9a326=_0x449fd9+':'+_0x5bb903[_0x57a810(0x1d6)];!_0x5238f3[_0x57a810(0x1e3)](_0xf9a326)&&_0x5238f3[_0x57a810(0x1bb)](_0xf9a326,[]),_0x5238f3['get'](_0xf9a326)[_0x57a810(0x1b3)](_0x5bb903);}for(const _0x4499c4 of _0x5238f3[_0x57a810(0xfd)]()){_0x4499c4[_0x57a810(0x1c1)]((_0x491f5a,_0x3af78f)=>(_0x491f5a[_0x57a810(0x1c5)]||0x0)-(_0x3af78f[_0x57a810(0x1c5)]||0x0));}return _0x5238f3;}export function collectFoldersToCreate(_0x99f8b6,_0x4babca){const _0x143b7f=a152_0x5819a5,_0x451c73=new Set();for(const _0x858a48 of _0x99f8b6){if(!_0x858a48)continue;if(_0x4babca[_0x143b7f(0x1e3)](_0x858a48))continue;const _0x5cf808=_0x858a48[_0x143b7f(0x17c)]('/');let _0x394cbb='';for(const _0x3bcf03 of _0x5cf808){_0x394cbb=_0x394cbb?_0x394cbb+'/'+_0x3bcf03:_0x3bcf03,!_0x4babca[_0x143b7f(0x1e3)](_0x394cbb)&&_0x451c73[_0x143b7f(0x1ff)](_0x394cbb);}}return _0x451c73;}export function parseAndClassifyYamlFiles(_0x398adc,_0x3257b3,_0x3c5f87){const _0x5eade3=a152_0x5819a5,_0x290941=[],_0x47f909=[];for(const _0x3a79e2 of _0x398adc){const _0x51325b=a152_0x322d4e[_0x5eade3(0x11a)](_0x3257b3,a152_0x322d4e['dirname'](_0x3a79e2)),_0x50c6d5=_0x51325b==='.'?'':_0x51325b[_0x5eade3(0x122)](/\\/g,'/'),_0x1ad21d=readFileSync(_0x3a79e2,_0x5eade3(0x16a)),_0x31a8c4=a152_0x27a142[_0x5eade3(0x17d)](_0x1ad21d);if(isJourneyDef(_0x31a8c4)){const _0x4f7117=a152_0x4dcb37(_0x1ad21d);_0x47f909[_0x5eade3(0x1b3)]({'yamlConfig':_0x4f7117,'folderPath':_0x50c6d5,'sourcePath':_0x3a79e2});}else{if(!_0x3c5f87?.[_0x5eade3(0x179)]){const _0x26c893=parseSegmentYamlFile(_0x1ad21d),_0x5d8edb=normalizeChildSegmentYaml(_0x26c893);_0x290941[_0x5eade3(0x1b3)]({'yamlConfig':_0x5d8edb,'folderPath':_0x50c6d5,'sourcePath':_0x3a79e2});}}}return{'segments':_0x290941,'journeys':_0x47f909};}export function validateParsedFiles(_0x1d23ef,_0x96aa00){const _0x46861f=a152_0x5819a5,_0x26b09f=[];for(const {yamlConfig:_0x5a5b3d,sourcePath:_0x557f11}of _0x1d23ef['segments']){const _0x1673db=readFileSync(_0x557f11,_0x46861f(0x16a)),_0x371b3b=a152_0x27a142[_0x46861f(0x125)](_0x1673db),_0x299f3a=validateSegmentDef(_0x5a5b3d,{'source':_0x1673db,'document':_0x371b3b},{'skipSchema':!![]});if(!_0x299f3a[_0x46861f(0x151)]){const _0x4e8c09=a152_0x322d4e[_0x46861f(0x11a)](_0x96aa00,_0x557f11);_0x26b09f[_0x46861f(0x1b3)]({'filePath':_0x4e8c09,'source':_0x1673db,'result':_0x299f3a,'isJourney':![]});}}for(const {yamlConfig:_0x2e89d8,sourcePath:_0x5325dc}of _0x1d23ef[_0x46861f(0x158)]){const _0x4bebff=readFileSync(_0x5325dc,_0x46861f(0x16a)),_0x14b864=a152_0x27a142[_0x46861f(0x125)](_0x4bebff),_0x1979c8=validateJourneyDef(_0x2e89d8,{'source':_0x4bebff,'document':_0x14b864},{'skipSchema':!![]});if(!_0x1979c8[_0x46861f(0x151)]){const _0x565698=a152_0x322d4e['relative'](_0x96aa00,_0x5325dc);_0x26b09f[_0x46861f(0x1b3)]({'filePath':_0x565698,'source':_0x4bebff,'result':_0x1979c8,'isJourney':!![]});}}return _0x26b09f;}export function formatValidationErrors(_0x9d57c6){const _0x1783f5=a152_0x5819a5,_0x1d9b3c=[];for(const {filePath:_0x3e8c0e,source:_0x26f374,result:_0x38f41b,isJourney:_0x9b5614}of _0x9d57c6){const _0x6ee21e=_0x9b5614?_0x1783f5(0x11c):_0x1783f5(0x1c3);_0x1d9b3c[_0x1783f5(0x1b3)]('\x0a'+_0x3e8c0e+'\x20('+_0x6ee21e+'):\x20'+_0x38f41b[_0x1783f5(0x193)][_0x1783f5(0x19b)]+_0x1783f5(0x146)),_0x1d9b3c[_0x1783f5(0x1b3)](formatValidationResult(_0x38f41b,_0x26f374,_0x3e8c0e));}return _0x1d9b3c[_0x1783f5(0x110)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x3d6b71){const _0x347cb1=a152_0x5819a5,_0x909f13=new Set(),_0x2e74c4=new Map(),_0x5e96f3=collectSegmentUsageCounts(_0x3d6b71);if(_0x3d6b71[_0x347cb1(0x15f)])for(const [_0xb6b668,_0x32fb14]of Object[_0x347cb1(0x19f)](_0x3d6b71['segments'])){_0x909f13['add'](_0xb6b668);if(_0x32fb14[_0x347cb1(0x1c9)]){const _0x1b74f9=yamlRuleToApi(_0x32fb14[_0x347cb1(0x1c9)]),_0x4723b4=apiRuleToYaml(_0x1b74f9);_0x2e74c4['set'](_0xb6b668,_0x4723b4);}}const _0x3c4122=new Map();let _0x25ea8d=0x0;for(const [_0x314ac0,_0x486058]of _0x2e74c4){const _0x6c8ae4=serializeExpandedRule(_0x486058,_0x2e74c4),_0x5d5edd=_0x3c4122[_0x347cb1(0x1d9)](_0x6c8ae4)||[];_0x5d5edd[_0x347cb1(0x1b3)]({'name':_0x314ac0,'index':_0x25ea8d}),_0x3c4122[_0x347cb1(0x1bb)](_0x6c8ae4,_0x5d5edd),_0x25ea8d++;}const _0x2b720d=new Map();for(const [_0x175c6f,_0x3cefd4]of _0x3c4122){const _0x162a15=_0x3cefd4[_0x347cb1(0x1b8)]()['sort']((_0x46f4ed,_0x91f6ff)=>{const _0x106cf8=_0x347cb1,_0x4cd305=_0x5e96f3[_0x106cf8(0x1d9)](_0x46f4ed[_0x106cf8(0x1a3)])||0x0,_0x478daa=_0x5e96f3[_0x106cf8(0x1d9)](_0x91f6ff['name'])||0x0;if(_0x4cd305!==_0x478daa)return _0x478daa-_0x4cd305;return _0x46f4ed['index']-_0x91f6ff[_0x106cf8(0x1ae)];})[_0x347cb1(0x1fc)](_0x325412=>_0x325412[_0x347cb1(0x1a3)]),_0x169a10=[];for(const _0x5baaa2 of _0x162a15){const _0xb796b1=_0x5e96f3[_0x347cb1(0x1d9)](_0x5baaa2)||0x0,_0x5dcfe0=Math['max'](_0xb796b1,0x1);for(let _0x532710=0x0;_0x532710<_0x5dcfe0;_0x532710++){_0x169a10[_0x347cb1(0x1b3)](_0x5baaa2);}}_0x2b720d[_0x347cb1(0x1bb)](_0x175c6f,_0x169a10);}return{'existingLocalSegmentNames':_0x909f13,'localSegmentRules':_0x2e74c4,'localExpandedRuleToNames':_0x2b720d};}export function createSegmentIdResolver(_0x2402c1,_0x38db44){return async _0x11f0a1=>{const _0x4032b2=a152_0x3568,_0xa4cfb0=_0x2402c1[_0x4032b2(0x1d9)](_0x11f0a1);if(!_0xa4cfb0)throw new SDKError(ErrorCode[_0x4032b2(0x10a)],_0x4032b2(0x1cb)+_0x11f0a1+_0x4032b2(0x140)+_0x38db44+'\x27)');return _0xa4cfb0;};}export function extractRootFolderId(_0x2067dc){const _0x4ad235=a152_0x5819a5;return _0x2067dc[_0x4ad235(0x183)]?.[_0x4ad235(0x154)]?.[_0x4ad235(0x13e)]?.['id']||_0x2067dc[_0x4ad235(0x183)]?.[_0x4ad235(0x1f5)]?.[_0x4ad235(0x13e)]?.['id'];}export function buildConnectionMaps(_0x5475e4){const _0x5dfa45=a152_0x5819a5,_0x581b0d=new Map(),_0x3124b9=new Map(),_0x1a0e80=new Map();for(const _0x516f0a of _0x5475e4){_0x581b0d[_0x5dfa45(0x1bb)](_0x516f0a['name'],parseInt(_0x516f0a['id'],0xa)),_0x3124b9[_0x5dfa45(0x1bb)](_0x516f0a['id'],_0x516f0a[_0x5dfa45(0x1a3)]),_0x1a0e80[_0x5dfa45(0x1bb)](_0x516f0a[_0x5dfa45(0x1a3)],_0x516f0a['type']);}return{'nameToId':_0x581b0d,'idToName':_0x3124b9,'nameToType':_0x1a0e80};}export function calculatePushStats(_0x3800a6,_0x46e9fd,_0x2794d7,_0xeb0632,_0x3ceb4c,_0x55804b,_0x922619){const _0x99ab84=a152_0x5819a5,_0xfa77fa=_0x3800a6['filter'](_0x2abed2=>_0x2abed2[_0x99ab84(0x198)]),_0x36816c=_0x3800a6[_0x99ab84(0x14e)](_0x3d554a=>!_0x3d554a[_0x99ab84(0x198)]&&_0x3d554a[_0x99ab84(0x1ee)]),_0x2d60c0=_0x3800a6['filter'](_0x1169b0=>!_0x1169b0['isNew']&&!_0x1169b0['hasChanges']),_0x5b8ffa=_0x55804b?_0xeb0632:[],_0x40914d=_0x46e9fd['filter'](_0x29f765=>_0x29f765[_0x99ab84(0x198)]),_0x540de7=_0x46e9fd[_0x99ab84(0x14e)](_0xa8f983=>!_0xa8f983[_0x99ab84(0x198)]&&_0xa8f983[_0x99ab84(0x1ee)]),_0xb693b3=_0x46e9fd['filter'](_0x28a75a=>!_0x28a75a[_0x99ab84(0x198)]&&!_0x28a75a[_0x99ab84(0x1ee)]),_0x518014=_0x55804b?_0x3ceb4c:[],_0x572818=_0x3800a6[_0x99ab84(0xff)](_0x457eb9=>_0x457eb9[_0x99ab84(0x1aa)]),_0x510232=_0x572818['filter'](_0x1cbf2f=>_0x1cbf2f[_0x99ab84(0x150)]===_0x99ab84(0x105)),_0x4c3375=_0x572818[_0x99ab84(0x14e)](_0x3f3740=>_0x3f3740[_0x99ab84(0x150)]===_0x99ab84(0x1bf)),_0x4f55d4=_0x572818[_0x99ab84(0x14e)](_0x2a6cd6=>_0x2a6cd6['type']===_0x99ab84(0x1d4)),_0x3e80f4=Array[_0x99ab84(0x1c4)](_0x2794d7)[_0x99ab84(0x1c1)](),_0x2987b8=_0x922619?![]:_0xfa77fa[_0x99ab84(0x19b)]>0x0||_0x36816c['length']>0x0||_0x5b8ffa[_0x99ab84(0x19b)]>0x0,_0xf1ea70=_0x40914d['length']>0x0||_0x540de7['length']>0x0||_0x518014[_0x99ab84(0x19b)]>0x0,_0x92a590=_0x922619?![]:_0x572818[_0x99ab84(0x19b)]>0x0,_0x3f8132=_0x3e80f4[_0x99ab84(0x19b)]>0x0;return{'segments':{'new':_0xfa77fa,'changed':_0x36816c,'unchanged':_0x2d60c0,'toDelete':_0x5b8ffa},'journeys':{'new':_0x40914d,'changed':_0x540de7,'unchanged':_0xb693b3,'toDelete':_0x518014},'activations':{'all':_0x572818,'toCreate':_0x510232,'toUpdate':_0x4c3375,'toDelete':_0x4f55d4},'folders':{'toCreate':_0x3e80f4},'counts':{'segments':{'new':_0xfa77fa['length'],'changed':_0x36816c['length'],'unchanged':_0x2d60c0[_0x99ab84(0x19b)],'toDelete':_0x5b8ffa['length']},'journeys':{'new':_0x40914d[_0x99ab84(0x19b)],'changed':_0x540de7['length'],'unchanged':_0xb693b3[_0x99ab84(0x19b)],'toDelete':_0x518014[_0x99ab84(0x19b)]},'activations':{'create':_0x510232[_0x99ab84(0x19b)],'update':_0x4c3375[_0x99ab84(0x19b)],'delete':_0x4f55d4[_0x99ab84(0x19b)]},'folders':_0x3e80f4[_0x99ab84(0x19b)]},'hasChanges':_0x2987b8||_0xf1ea70||_0x92a590||_0x3f8132};}export async function buildPushExecutionContext(_0x4a26dc,_0x33ecf5,_0x5ac49e,_0xce1f8e,_0x176864,_0x1cf480){const _0x3a8098=a152_0x5819a5,_0x3a9a53=extractRootFolderId(_0x5ac49e),{pathToId:_0x5b2e0c,idToPath:_0x5e041b}=buildFolderMaps(_0x176864),_0x3d0455=buildSegmentNameToIdMap(_0xce1f8e),_0x5021c5=new Map(),{batchAsync:_0x268b9d}=await import(_0x3a8098(0x103)),[_0x2dbf09,_0x5eee18]=await Promise['all']([_0x4a26dc[_0x3a8098(0x10e)][_0x3a8098(0x1ac)](),_0x4a26dc[_0x3a8098(0x205)]['list'](),((async()=>{!_0x1cf480&&_0xce1f8e['length']>0x0&&await _0x268b9d(_0xce1f8e,async _0x1827f7=>{const _0x356037=a152_0x3568,_0x5be3fd=await _0x4a26dc[_0x356037(0x1c3)]['listActivations'](_0x33ecf5,_0x1827f7['id']);_0x5021c5[_0x356037(0x1bb)](_0x1827f7['id'],_0x5be3fd);});})())]),{emailToId:_0x108694,idToEmail:_0x1a9d3a}=_0x2dbf09,_0x3ccf35=buildConnectionMaps(_0x5eee18);return{'rootFolderId':_0x3a9a53,'folderPathToId':_0x5b2e0c,'folderIdToPath':_0x5e041b,'segmentNameToId':_0x3d0455,'activationsBySegmentId':_0x5021c5,'emailToIdMap':_0x108694,'idToEmailMap':_0x1a9d3a,'connectionNameToIdMap':_0x3ccf35[_0x3a8098(0x1b7)],'connectionIdToNameMap':_0x3ccf35[_0x3a8098(0x1f6)],'connectionNameToTypeMap':_0x3ccf35[_0x3a8098(0x12a)]};}export function createPushYamlContextForBundle(_0x5b34be,_0x463748,_0x648b88,_0x4d07d4,_0x8060e8,_0x2cfb74,_0x45940d,_0x3486fe){const {existingLocalSegmentNames:_0x322364,localExpandedRuleToNames:_0x578720}=_0x4d07d4,_0x45a01f=new Set(),_0x29c382=new Map(),_0x10ff86=new Map(),_0x5b2a6a=new Map(),_0x10b0eb=createJumpTargetCache(),_0x15495b=new Map(),_0x1aca51=new Map(),_0xfc3c57=new Set();let _0x10a26d;const _0x3fb93f=_0x177cc8=>{const _0x4ba1fc={'resolveSegment':async _0x327c03=>{const _0x2680d8=a152_0x3568,_0x1ec6a6=_0x5b2a6a['get'](_0x327c03);if(_0x1ec6a6!==undefined)return{'name':_0x1ec6a6,'isJourneyLocal':!![]};try{const _0x2c236d=await fetchSegment(_0x5b34be,_0x463748,_0x327c03,_0x648b88);if(!_0x2c236d)throw new Error(_0x2680d8(0x1a4));const _0x447679=generateJourneyLocalName(_0x2c236d['name']),_0x2d9aed=_0x2c236d[_0x2680d8(0x14f)]===SEGMENT_KIND_JOURNEY&&_0x447679!==undefined;let _0x4ff6cd=_0x2c236d[_0x2680d8(0x1a3)],_0x5df95f;if(_0x2d9aed&&_0x2c236d[_0x2680d8(0x1c9)]){const _0x59eca2=apiRuleToYaml(_0x2c236d[_0x2680d8(0x1c9)]);_0x1aca51[_0x2680d8(0x1bb)](_0x327c03,_0x59eca2);const _0x22b931=async _0x5db334=>{const _0x10eff1=_0x2680d8,_0x4bbd6e=collectSegmentRefsFromRule(_0x5db334);for(const _0x8ff850 of _0x4bbd6e){if(!_0x1aca51[_0x10eff1(0x1e3)](_0x8ff850))try{const _0x173628=await fetchSegment(_0x5b34be,_0x463748,_0x8ff850,_0x648b88);if(_0x173628?.[_0x10eff1(0x1c9)]){const _0x3d3965=apiRuleToYaml(_0x173628[_0x10eff1(0x1c9)]);_0x1aca51[_0x10eff1(0x1bb)](_0x8ff850,_0x3d3965),await _0x22b931(_0x3d3965);}}catch(_0x33bbe5){logger['debug'](_0x10eff1(0x1cc)+_0x8ff850+':\x20'+_0x33bbe5);}}};await _0x22b931(_0x59eca2);const _0x4ea0ed=serializeExpandedRule(_0x59eca2,_0x1aca51),_0x88f9d6=_0x578720['get'](_0x4ea0ed);if(_0x88f9d6&&_0x88f9d6[_0x2680d8(0x19b)]>0x0){const _0x410229=_0x29c382['get'](_0x4ea0ed)||0x0,_0x510792=_0x88f9d6[_0x410229]||_0x88f9d6[_0x88f9d6[_0x2680d8(0x19b)]-0x1];_0x29c382[_0x2680d8(0x1bb)](_0x4ea0ed,_0x410229+0x1),_0x4ff6cd=_0x510792,_0x45a01f[_0x2680d8(0x1ff)](_0x4ff6cd),_0x5b2a6a[_0x2680d8(0x1bb)](_0x327c03,_0x4ff6cd);const _0x542ba0=await resolveRuleSegmentRefs(_0x59eca2,async _0x448e9d=>{const _0x450f53=_0x2680d8,_0x26de47=_0x5b2a6a['get'](_0x448e9d);if(_0x26de47)return _0x26de47;const _0x26e43d=await _0x10a26d[_0x450f53(0x1f1)](_0x448e9d);return _0x26e43d['name'];});_0x5df95f={'description':_0x2c236d['description'],'rule':_0x542ba0};}else{const _0x8674e9=_0x15495b['get'](_0x4ea0ed);if(_0x8674e9)_0x4ff6cd=_0x8674e9,_0x5b2a6a[_0x2680d8(0x1bb)](_0x327c03,_0x4ff6cd);else{if(_0x447679){let _0xbc7146=_0x447679,_0x36d870=0x2;while(_0x45a01f[_0x2680d8(0x1e3)](_0xbc7146)||_0x322364[_0x2680d8(0x1e3)](_0xbc7146)){_0xbc7146=_0x447679+'_'+_0x36d870,_0x36d870++;}_0x45a01f[_0x2680d8(0x1ff)](_0xbc7146),_0x4ff6cd=_0xbc7146;}_0x5b2a6a[_0x2680d8(0x1bb)](_0x327c03,_0x4ff6cd),_0x15495b['set'](_0x4ea0ed,_0x4ff6cd);const _0x5a09b3=await resolveRuleSegmentRefs(_0x59eca2,async _0x2ed47b=>{const _0x3318c7=_0x2680d8,_0x151326=_0x5b2a6a[_0x3318c7(0x1d9)](_0x2ed47b);if(_0x151326)return _0x151326;const _0x196bed=await _0x10a26d[_0x3318c7(0x1f1)](_0x2ed47b);return _0x196bed[_0x3318c7(0x1a3)];});_0x5df95f={'description':_0x2c236d[_0x2680d8(0x197)],'rule':_0x5a09b3};}}}return{'name':_0x4ff6cd,'isJourneyLocal':_0x2d9aed,'definition':_0x5df95f};}catch(_0x3b1d36){return logger['debug'](_0x2680d8(0x1ad)+_0x327c03+':\x20'+_0x3b1d36),{'name':_0x327c03,'isJourneyLocal':![]};}},'resolveActivation':async _0x520c81=>{const _0x411d1b=a152_0x3568,_0x4f0994=_0x10ff86[_0x411d1b(0x1d9)](_0x520c81);if(_0x4f0994!==undefined)return{'name':_0x4f0994,'isJourneyLocal':!![]};try{let _0x8a36ce=_0x45940d?.[_0x411d1b(0x1d9)](_0x520c81);!_0x8a36ce&&(_0x8a36ce=await _0x5b34be[_0x411d1b(0x11c)][_0x411d1b(0x12f)](_0x177cc8,_0x520c81));const _0x279712=_0x8a36ce[_0x411d1b(0x18d)]['activationParams']['name']||_0x520c81,_0x41fb8d=sanitizeYamlKey(_0x279712)||_0x411d1b(0x1d3)+_0x520c81,_0x460921=_0x41fb8d;_0x10ff86['set'](_0x520c81,_0x460921);const _0x2d4e40=journeyActivationStepToYaml(_0x8a36ce,_0x8060e8,_0x2cfb74);return{'name':_0x460921,'isJourneyLocal':!![],'definition':_0x2d4e40};}catch(_0x50a7eb){return logger['debug'](_0x411d1b(0xfc)+_0x520c81+':\x20'+_0x50a7eb),{'name':_0x520c81,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3800e2,_0x588f24)=>resolveJumpTarget(_0x3800e2,_0x588f24,_0x10b0eb,async _0x404dcf=>{const _0x78c98e=a152_0x3568,_0x43e0d9=_0x3486fe?.[_0x78c98e(0x1d9)](_0x404dcf);if(_0x43e0d9)return _0x43e0d9;return _0x5b34be[_0x78c98e(0x11c)][_0x78c98e(0x18e)](_0x404dcf);})};return _0x10a26d=_0x4ba1fc,_0x4ba1fc;},_0xbcd118=async _0x5d4dd0=>{const _0x4714e4=a152_0x3568,{collectSegmentIdsFromJourneyApi:_0x1add47}=await import('./journey-yaml.js'),{batchAsync:_0x1e90fc}=await import(_0x4714e4(0x103)),_0x38ef68=new Set();for(const _0x599a43 of _0x5d4dd0){let _0xf59d26=_0x3486fe?.[_0x4714e4(0x1d9)](_0x599a43);!_0xf59d26&&(_0xf59d26=await _0x5b34be['journey'][_0x4714e4(0x18e)](_0x599a43));const _0x3f9d09=_0x1add47(_0xf59d26);for(const _0x3a8724 of _0x3f9d09){_0x38ef68[_0x4714e4(0x1ff)](_0x3a8724);}}let _0x7a70d6=Array['from'](_0x38ef68);while(_0x7a70d6[_0x4714e4(0x19b)]>0x0){const _0x25d8eb=_0x7a70d6[_0x4714e4(0x14e)](_0x148ed2=>!_0xfc3c57[_0x4714e4(0x1e3)](_0x148ed2));if(_0x25d8eb['length']===0x0)break;const _0x5ee098=await _0x1e90fc(_0x25d8eb,async _0x491e65=>{const _0x301666=_0x4714e4;_0xfc3c57[_0x301666(0x1ff)](_0x491e65);const _0x3ed92e=await fetchSegment(_0x5b34be,_0x463748,_0x491e65,_0x648b88);if(!_0x3ed92e)return null;return{'segmentId':_0x491e65,'segment':_0x3ed92e};},0xa),_0x199c6a=new Set();for(const _0x383a0c of _0x5ee098){if(!_0x383a0c?.['segment']?.['rule'])continue;const _0x5246a6=apiRuleToYaml(_0x383a0c[_0x4714e4(0x1c3)]['rule']);_0x1aca51[_0x4714e4(0x1bb)](_0x383a0c['segmentId'],_0x5246a6);const _0x54f334=collectSegmentRefsFromRule(_0x5246a6);for(const _0x96a850 of _0x54f334){!_0xfc3c57[_0x4714e4(0x1e3)](_0x96a850)&&_0x199c6a[_0x4714e4(0x1ff)](_0x96a850);}}_0x7a70d6=Array[_0x4714e4(0x1c4)](_0x199c6a);}};return{'createYamlContext':_0x3fb93f,'prefetchJourneySegments':_0xbcd118};}export async function executePushSegments(_0x42d4bf,_0x27b3e9,_0x249c32,_0x51b61f,_0x2474e0){const _0x42c1dd=a152_0x5819a5,{segmentDefToCreateRequest:_0x47139a,segmentDefToUpdateRequest:_0xc9807b}=await import('./child-segment-yaml.js'),_0x4be8be=_0x249c32[_0x42c1dd(0x10d)],_0x4c44fc=0x5,_0x2efc47=async _0x4dd8df=>{const _0x5b17e5=_0x42c1dd,_0x57981e=_0x4dd8df['folderPath']?_0x4be8be[_0x5b17e5(0x1d9)](_0x4dd8df['folderPath']):undefined;let _0x742e02;const _0x3635b7={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x54d537=_0x4dd8df[_0x5b17e5(0x108)];if(_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1c9)]){const _0x59085d=createSegmentIdResolver(_0x249c32[_0x5b17e5(0x116)],_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)]),_0x567ffb=await resolveRuleSegmentIds(_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1c9)],_0x59085d);_0x54d537={..._0x4dd8df[_0x5b17e5(0x108)],'rule':_0x567ffb};}try{if(_0x4dd8df['isNew']){_0x2474e0['onProgress']?.({'type':'segment_creating','name':_0x4dd8df['yamlConfig']['name']});const _0x113224=_0x47139a(_0x54d537,_0x57981e),_0x21f1e3=await _0x2474e0['withProgress']('Creating\x20segment\x20\x27'+_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)]+_0x5b17e5(0x17f),()=>_0x42d4bf[_0x5b17e5(0x1c3)][_0x5b17e5(0x16d)](_0x51b61f[_0x5b17e5(0x113)],_0x113224));_0x742e02=_0x21f1e3['data']['id'],_0x249c32['segmentNameToId'][_0x5b17e5(0x1bb)](_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)],_0x742e02),_0x3635b7[_0x5b17e5(0x16e)]={'name':_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)],'id':_0x742e02},_0x2474e0[_0x5b17e5(0x134)]?.({'type':_0x5b17e5(0x15a),'name':_0x4dd8df[_0x5b17e5(0x108)]['name'],'segmentId':_0x742e02}),_0x2474e0[_0x5b17e5(0x1be)]?.(_0x5b17e5(0x129)+_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)]+'\x27'),_0x3635b7[_0x5b17e5(0x160)]=0x1;}else{if(_0x4dd8df[_0x5b17e5(0x1ee)]){_0x2474e0[_0x5b17e5(0x134)]?.({'type':_0x5b17e5(0x104),'name':_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)]});const _0x583985=_0xc9807b(_0x54d537);_0x57981e!==_0x4dd8df[_0x5b17e5(0x148)]?.[_0x5b17e5(0x178)]&&(_0x583985[_0x5b17e5(0x178)]=_0x57981e?parseInt(_0x57981e,0xa):undefined),await _0x2474e0[_0x5b17e5(0x1df)]('Updating\x20segment\x20\x27'+_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)]+'\x27...',()=>_0x42d4bf[_0x5b17e5(0x1c3)][_0x5b17e5(0x152)](_0x51b61f[_0x5b17e5(0x113)],_0x4dd8df['existingSegment']['id'],_0x583985)),_0x742e02=_0x4dd8df['existingSegment']['id'],_0x2474e0[_0x5b17e5(0x134)]?.({'type':_0x5b17e5(0x1a6),'name':_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)]}),_0x2474e0[_0x5b17e5(0x1be)]?.(_0x5b17e5(0x19a)+_0x4dd8df['yamlConfig'][_0x5b17e5(0x1a3)]+'\x27'),_0x3635b7[_0x5b17e5(0x14a)]=0x1;}else _0x742e02=_0x4dd8df[_0x5b17e5(0x148)]['id'];}}catch(_0x3aba3a){const _0x469928=isHttp400Error(_0x3aba3a),_0xa40190=_0x469928?ErrorCode[_0x5b17e5(0x1b6)]:ErrorCode[_0x5b17e5(0x144)],_0x1bc058=getErrorMessage(_0x3aba3a);throw new SDKError(_0xa40190,'Failed\x20to\x20'+(_0x4dd8df[_0x5b17e5(0x198)]?_0x5b17e5(0x105):_0x5b17e5(0x1bf))+_0x5b17e5(0x18a)+_0x4dd8df[_0x5b17e5(0x1af)]+_0x5b17e5(0x199)+_0x1bc058,_0x3aba3a);}try{const _0xcd4034=await syncActivationsForSegment(_0x42d4bf,_0x51b61f[_0x5b17e5(0x113)],_0x742e02,_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)],_0x4dd8df[_0x5b17e5(0x1aa)],_0x2474e0,_0x4dd8df[_0x5b17e5(0x1af)]);_0x3635b7[_0x5b17e5(0x15d)]=_0xcd4034;}catch(_0x3de731){if(_0x3de731 instanceof SDKError)throw _0x3de731;throw new SDKError(ErrorCode[_0x5b17e5(0x1c7)],_0x5b17e5(0x1a1)+_0x4dd8df[_0x5b17e5(0x108)][_0x5b17e5(0x1a3)]+'\x27\x20from\x20file:\x20'+_0x4dd8df[_0x5b17e5(0x1af)]+_0x5b17e5(0x199)+getErrorMessage(_0x3de731),_0x3de731);}return _0x3635b7;},_0x1e41be=await batchAsync(_0x27b3e9,_0x2efc47,_0x4c44fc),_0x4efdde={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x33796f of _0x1e41be){_0x4efdde[_0x42c1dd(0x160)]+=_0x33796f[_0x42c1dd(0x160)],_0x4efdde[_0x42c1dd(0x14a)]+=_0x33796f[_0x42c1dd(0x14a)],_0x33796f[_0x42c1dd(0x16e)]&&_0x4efdde[_0x42c1dd(0x124)][_0x42c1dd(0x1bb)](_0x33796f[_0x42c1dd(0x16e)]['name'],_0x33796f[_0x42c1dd(0x16e)]['id']),_0x4efdde[_0x42c1dd(0x15d)][_0x42c1dd(0x160)]+=_0x33796f['activations'][_0x42c1dd(0x160)],_0x4efdde[_0x42c1dd(0x15d)][_0x42c1dd(0x14a)]+=_0x33796f[_0x42c1dd(0x15d)]['updated'],_0x4efdde['activations']['deleted']+=_0x33796f[_0x42c1dd(0x15d)][_0x42c1dd(0x1ce)];}return _0x4efdde;}async function syncActivationsForSegment(_0x55925f,_0x1a9b97,_0x359527,_0x28ff6b,_0x5ed18b,_0x4acdde,_0x15cc77){const _0x58df93=a152_0x5819a5,_0x508501={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x88ce52 of _0x5ed18b){try{if(_0x88ce52['type']===_0x58df93(0x105)&&_0x88ce52[_0x58df93(0x156)])_0x4acdde[_0x58df93(0x134)]?.({'type':_0x58df93(0x1ec),'segmentName':_0x28ff6b,'activationName':_0x88ce52[_0x58df93(0x1a3)]}),await _0x4acdde[_0x58df93(0x1df)](_0x58df93(0x1a5)+_0x88ce52['name']+_0x58df93(0x17f),()=>_0x55925f['segment']['createActivation'](_0x1a9b97,_0x359527,_0x88ce52[_0x58df93(0x156)])),_0x4acdde['onProgress']?.({'type':'activation_created','segmentName':_0x28ff6b,'activationName':_0x88ce52[_0x58df93(0x1a3)]}),_0x4acdde[_0x58df93(0x1be)]?.(_0x58df93(0x1d0)+_0x88ce52['name']+'\x27'),_0x508501[_0x58df93(0x160)]++;else{if(_0x88ce52['type']===_0x58df93(0x1bf)&&_0x88ce52[_0x58df93(0x156)]&&_0x88ce52[_0x58df93(0x1da)])_0x4acdde[_0x58df93(0x134)]?.({'type':_0x58df93(0x1f8),'segmentName':_0x28ff6b,'activationName':_0x88ce52[_0x58df93(0x1a3)]}),await _0x4acdde[_0x58df93(0x1df)](_0x58df93(0x1a9)+_0x88ce52['name']+_0x58df93(0x17f),()=>_0x55925f[_0x58df93(0x1c3)][_0x58df93(0x1b9)](_0x1a9b97,_0x359527,_0x88ce52[_0x58df93(0x1da)]['id'],_0x88ce52['validatedRequest'])),_0x4acdde[_0x58df93(0x134)]?.({'type':'activation_updated','segmentName':_0x28ff6b,'activationName':_0x88ce52['name']}),_0x4acdde['logSuccess']?.(_0x58df93(0x1fe)+_0x88ce52[_0x58df93(0x1a3)]+'\x27'),_0x508501[_0x58df93(0x14a)]++;else _0x88ce52[_0x58df93(0x150)]===_0x58df93(0x1d4)&&_0x88ce52[_0x58df93(0x1da)]&&(_0x4acdde[_0x58df93(0x134)]?.({'type':_0x58df93(0x143),'segmentName':_0x28ff6b,'activationName':_0x88ce52[_0x58df93(0x1a3)]}),await _0x4acdde[_0x58df93(0x1df)](_0x58df93(0x1e2)+_0x88ce52[_0x58df93(0x1a3)]+_0x58df93(0x17f),()=>_0x55925f[_0x58df93(0x1c3)]['deleteActivation'](_0x1a9b97,_0x359527,_0x88ce52[_0x58df93(0x1da)]['id'])),_0x4acdde['onProgress']?.({'type':_0x58df93(0x11d),'segmentName':_0x28ff6b,'activationName':_0x88ce52[_0x58df93(0x1a3)]}),_0x4acdde[_0x58df93(0x141)]?.(_0x58df93(0x16c)+_0x88ce52['name']+'\x27'),_0x508501[_0x58df93(0x1ce)]++);}}catch(_0x4baa3a){const _0x3177d9=isHttp400Error(_0x4baa3a),_0x49e6fa=_0x3177d9?ErrorCode[_0x58df93(0x170)]:ErrorCode[_0x58df93(0x1c7)],_0x1b13c6=getErrorMessage(_0x4baa3a);throw new SDKError(_0x49e6fa,_0x58df93(0x1f3)+_0x88ce52[_0x58df93(0x150)]+_0x58df93(0x1a2)+_0x88ce52[_0x58df93(0x1a3)]+_0x58df93(0x115)+_0x15cc77+'\x0a\x20\x20'+_0x1b13c6,_0x4baa3a);}}return _0x508501;}export async function executePushFolders(_0x3f806b,_0x463da9,_0x4b733b,_0x512a4a,_0x5c2116){const _0xf3e3a2=a152_0x5819a5,_0x5773ee=new Map(_0x4b733b),_0xaf87ad=sortFoldersByDepth(_0x463da9);for(const _0x50f479 of _0xaf87ad){const _0x583496=_0x50f479[_0xf3e3a2(0x17c)]('/'),_0x455f1a=_0x583496[_0x583496['length']-0x1],_0x59214d=_0x583496[_0xf3e3a2(0x1b8)](0x0,-0x1)[_0xf3e3a2(0x110)]('/'),_0x38e7ee=_0x5773ee['get'](_0x59214d);_0x5c2116[_0xf3e3a2(0x134)]?.({'type':_0xf3e3a2(0x137),'folder':_0x50f479});const _0x538b23={'name':_0x455f1a,'parentFolderId':_0x38e7ee},_0x1eba68=await _0x5c2116[_0xf3e3a2(0x1df)](_0xf3e3a2(0x1f2)+_0x50f479+'\x27...',()=>_0x3f806b[_0xf3e3a2(0x1c3)][_0xf3e3a2(0x13d)](_0x512a4a[_0xf3e3a2(0x113)],_0x538b23));_0x5773ee[_0xf3e3a2(0x1bb)](_0x50f479,_0x1eba68[_0xf3e3a2(0x13e)]['id']),_0x5c2116[_0xf3e3a2(0x134)]?.({'type':_0xf3e3a2(0x1fd),'folder':_0x50f479,'folderId':_0x1eba68['data']['id']}),_0x5c2116[_0xf3e3a2(0x163)]?.('Created\x20folder\x20\x27'+_0x50f479+'\x27');}return _0x5773ee;}export async function executePushSegmentDeletions(_0x599717,_0x5740b8,_0x5f206e){const _0x2cc51d=a152_0x5819a5;if(_0x5740b8[_0x2cc51d(0x19b)]===0x0)return 0x0;const {batchAsync:_0x4ec129}=await import(_0x2cc51d(0x103)),_0x25d59e=0x5,_0x428033=await _0x4ec129(_0x5740b8,async _0x8437b0=>{const _0x41c0ce=_0x2cc51d;return _0x5f206e[_0x41c0ce(0x134)]?.({'type':_0x41c0ce(0x173),'name':_0x8437b0[_0x41c0ce(0x1a3)]}),await _0x599717[_0x41c0ce(0x1c3)][_0x41c0ce(0x184)](_0x8437b0['id']),_0x5f206e[_0x41c0ce(0x134)]?.({'type':_0x41c0ce(0x1ab),'name':_0x8437b0[_0x41c0ce(0x1a3)]}),_0x5f206e['logDeleted']?.(_0x41c0ce(0x111)+_0x8437b0['name']+'\x27'),0x1;},_0x25d59e);return _0x428033['reduce']((_0x418faa,_0x40c0aa)=>_0x418faa+_0x40c0aa,0x0);}export async function executePushJourneys(_0x28b61d,_0x3f59b3,_0x2e3106,_0x20318f,_0x307747){const _0x6223a=a152_0x5819a5,{journeyDefToRequest:_0x2e7ba6}=await import(_0x6223a(0x155)),{activationDefToCreateRequest:_0x45dc5c,yamlRuleToApi:_0x29107c,validateSegmentRule:_0x223329}=await import(_0x6223a(0x1cf)),_0x5cc2de={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x227da7=new Map(_0x2e3106[_0x6223a(0x116)]),_0x14c32b=0x5;for(let _0x4d6124=0x0;_0x4d6124<_0x3f59b3[_0x6223a(0x19b)];_0x4d6124+=_0x14c32b){const _0x18c145=_0x3f59b3[_0x6223a(0x1b8)](_0x4d6124,_0x4d6124+_0x14c32b),_0x2852cd=await Promise['all'](_0x18c145[_0x6223a(0x1fc)](async _0x5bfb7c=>{const _0x1dfb36=_0x6223a;if(!_0x5bfb7c['isNew']&&!_0x5bfb7c[_0x1dfb36(0x1ee)])return{'action':_0x1dfb36(0x1b1),'name':_0x5bfb7c[_0x1dfb36(0x108)][_0x1dfb36(0x1a3)],'journeyId':_0x5bfb7c['existingJourney']?.['id']};const _0x10fc93=_0x5bfb7c['folderPath']?_0x2e3106[_0x1dfb36(0x10d)][_0x1dfb36(0x1d9)](_0x5bfb7c[_0x1dfb36(0x1ba)]):undefined;_0x307747[_0x1dfb36(0x134)]?.({'type':_0x5bfb7c[_0x1dfb36(0x198)]?_0x1dfb36(0x1e9):'journey_updating','name':_0x5bfb7c[_0x1dfb36(0x108)]['name']});try{const _0x3b7900=await executeSingleJourneyPush(_0x28b61d,_0x5bfb7c,{..._0x2e3106,'segmentNameToId':_0x227da7},{'parentId':_0x20318f[_0x1dfb36(0x113)],'rootFolderId':_0x20318f['rootFolderId'],'folderId':_0x10fc93,'verbose':_0x20318f[_0x1dfb36(0x185)]},_0x307747,{'journeyDefToRequest':_0x2e7ba6,'activationDefToCreateRequest':_0x45dc5c,'yamlRuleToApi':_0x29107c,'validateSegmentRule':_0x223329});for(const [_0x447e5d,_0x18a638]of _0x3b7900['embeddedSegmentNameToId']){_0x227da7['set'](_0x447e5d,_0x18a638),_0x5cc2de[_0x1dfb36(0x14c)][_0x1dfb36(0x1bb)](_0x447e5d,_0x18a638);}if(_0x3b7900[_0x1dfb36(0x1f4)]===_0x1dfb36(0x160))_0x307747['onProgress']?.({'type':_0x1dfb36(0x188),'name':_0x5bfb7c[_0x1dfb36(0x108)][_0x1dfb36(0x1a3)],'journeyId':_0x3b7900[_0x1dfb36(0x1e5)]}),_0x307747['logSuccess']?.('Created\x20journey\x20\x27'+_0x5bfb7c[_0x1dfb36(0x108)][_0x1dfb36(0x1a3)]+'\x27'),_0x5cc2de['created']++;else _0x3b7900[_0x1dfb36(0x1f4)]===_0x1dfb36(0x14a)&&(_0x307747[_0x1dfb36(0x134)]?.({'type':_0x1dfb36(0x1fa),'name':_0x5bfb7c[_0x1dfb36(0x108)][_0x1dfb36(0x1a3)]}),_0x307747['logSuccess']?.(_0x1dfb36(0x100)+_0x5bfb7c['yamlConfig']['name']+'\x27'),_0x5cc2de[_0x1dfb36(0x14a)]++);return{'action':_0x3b7900['action'],'name':_0x5bfb7c[_0x1dfb36(0x108)][_0x1dfb36(0x1a3)],'journeyId':_0x3b7900['journeyId']};}catch(_0x599578){const _0x3bf86c=isHttp400Error(_0x599578),_0x4f2790=_0x3bf86c?ErrorCode[_0x1dfb36(0x16b)]:ErrorCode[_0x1dfb36(0x1b4)],_0x403343=getErrorMessage(_0x599578);throw new SDKError(_0x4f2790,_0x1dfb36(0x1f3)+(_0x5bfb7c[_0x1dfb36(0x198)]?_0x1dfb36(0x105):_0x1dfb36(0x1bf))+_0x1dfb36(0x142)+_0x5bfb7c[_0x1dfb36(0x1af)]+_0x1dfb36(0x199)+_0x403343,_0x599578);}}));_0x5cc2de[_0x6223a(0x1a7)]['push'](..._0x2852cd);}return _0x5cc2de;}async function matchExistingJourneySegments(_0x2ba6bc,_0x1e2309,_0x22fa8d,_0x5bd83b,_0x360f99){const _0x103b54=a152_0x5819a5;if(!_0x1e2309[_0x103b54(0x202)]||!_0x1e2309[_0x103b54(0x108)][_0x103b54(0x15f)])return;const _0x33ebaa=new Map(),_0x2e5c65=new Set();for(const _0x1afcd9 of Object[_0x103b54(0x101)](_0x1e2309[_0x103b54(0x108)][_0x103b54(0x15f)])){const _0x3e4289=generateDeterministicJourneySegmentName(_0x1e2309['yamlConfig'][_0x103b54(0x1a3)],_0x1afcd9);_0x33ebaa[_0x103b54(0x1bb)](_0x3e4289,_0x1afcd9),_0x2e5c65[_0x103b54(0x1ff)](_0x1afcd9);}const _0x5dad32=[],_0x3c1251=collectSegmentIdsFromJourneyApi(_0x1e2309[_0x103b54(0x202)]);for(const _0x24c0dc of _0x3c1251){const _0xe1c83f=await fetchSegment(_0x2ba6bc,_0x22fa8d,_0x24c0dc,_0x5bd83b);if(!_0xe1c83f?.['name'])continue;const _0x1c0300=_0x33ebaa[_0x103b54(0x1d9)](_0xe1c83f[_0x103b54(0x1a3)]);_0x1c0300?(_0x360f99[_0x103b54(0x1bb)](_0x1c0300,_0x24c0dc),_0x2e5c65[_0x103b54(0x1d4)](_0x1c0300)):_0x5dad32[_0x103b54(0x1b3)]({'id':_0x24c0dc,'seg':_0xe1c83f});}if(_0x2e5c65[_0x103b54(0x1c6)]>0x0&&_0x5dad32[_0x103b54(0x19b)]>0x0){const {localExpandedRuleToNames:_0x32c40c}=buildLocalExpandedRuleMappings(_0x1e2309['yamlConfig']),_0x4a8f1e=new Map();for(const {id:_0x2d8ac8,seg:_0x203cae}of _0x5dad32){if(_0x203cae[_0x103b54(0x1c9)]){const _0x54439a=apiRuleToYaml(_0x203cae[_0x103b54(0x1c9)]);_0x4a8f1e['set'](_0x2d8ac8,_0x54439a);}}for(const {id:_0x3794e0,seg:_0x4bc82d}of _0x5dad32){if(!_0x4bc82d[_0x103b54(0x1c9)])continue;const _0x723b56=_0x4a8f1e[_0x103b54(0x1d9)](_0x3794e0);if(!_0x723b56)continue;const _0x27951d=serializeExpandedRule(_0x723b56,_0x4a8f1e),_0x29a49b=_0x32c40c[_0x103b54(0x1d9)](_0x27951d);if(_0x29a49b){const _0x3442b6=_0x29a49b['find'](_0x50d673=>_0x2e5c65[_0x103b54(0x1e3)](_0x50d673));_0x3442b6&&(_0x360f99[_0x103b54(0x1bb)](_0x3442b6,_0x3794e0),_0x2e5c65['delete'](_0x3442b6),logger[_0x103b54(0x172)](_0x103b54(0x196)+_0x4bc82d[_0x103b54(0x1a3)]+_0x103b54(0x1de)+_0x3442b6+_0x103b54(0x149)));}}}}async function executeSingleJourneyPush(_0x34d3fb,_0x1306b5,_0x3cc288,_0x446a2a,_0xa5a9d1,_0x24f0f5){const _0x58a0bf=a152_0x5819a5,{journeyDefToRequest:_0x11055b,activationDefToCreateRequest:_0x451ee7,yamlRuleToApi:_0x5165cb,validateSegmentRule:_0x1428ce}=_0x24f0f5,_0x1819cc=new Map(),_0x5ccb45=new Map();recoverSegmentIdsFromPushRecovery(_0x1306b5,_0x1819cc,_0x3cc288[_0x58a0bf(0x116)]);const _0x572517=new Map(),_0x1919c2=new Map(),_0x4d77e9=new Map();let _0x1b4684;const _0x499694=async()=>{const _0x1e868e=_0x58a0bf;if(_0x1b4684)return;_0x1b4684=new Map();if(!_0x1306b5[_0x1e868e(0x202)])return;const _0x1c8fc5=await _0x34d3fb[_0x1e868e(0x11c)][_0x1e868e(0x17e)](_0x1306b5[_0x1e868e(0x202)]['id']);for(const _0x64c274 of _0x1c8fc5){const _0x199310=journeyActivationStepToYaml(_0x64c274,_0x3cc288[_0x1e868e(0x10b)],_0x3cc288['connectionIdToNameMap']),_0x1c676e=activationSignature(_0x199310);!_0x1b4684[_0x1e868e(0x1e3)](_0x1c676e)&&_0x1b4684[_0x1e868e(0x1bb)](_0x1c676e,_0x64c274['id']),_0x199310['name']&&_0x5ccb45[_0x1e868e(0x1bb)](_0x199310[_0x1e868e(0x1a3)],_0x64c274['id']);}};await matchExistingJourneySegments(_0x34d3fb,_0x1306b5,_0x446a2a[_0x58a0bf(0x113)],_0x3cc288[_0x58a0bf(0x1e8)],_0x3cc288[_0x58a0bf(0x116)]);const _0x54f213={'resolveSegmentId':async _0x31fe0c=>{const _0x2f8b26=_0x58a0bf,_0x4386cc=_0x3cc288[_0x2f8b26(0x116)][_0x2f8b26(0x1d9)](_0x31fe0c);if(!_0x4386cc)throw new SDKError(ErrorCode[_0x2f8b26(0x10a)],'Segment\x20not\x20found:\x20'+_0x31fe0c+_0x2f8b26(0x1c8)+_0x1306b5[_0x2f8b26(0x108)]['name']+')');return _0x4386cc;},'resolveEmbeddedSegmentId':async(_0x48b71d,_0x27cbec)=>{const _0x1e0dfb=_0x58a0bf,_0x43504b=_0x3cc288['segmentNameToId'][_0x1e0dfb(0x1d9)](_0x48b71d);if(_0x43504b)return _0x43504b;const _0x14c441=_0x3cc288[_0x1e0dfb(0x1e8)][_0x1e0dfb(0x133)](_0x17fe7f=>_0x17fe7f[_0x1e0dfb(0x1a3)]===_0x48b71d);if(_0x14c441)return _0x3cc288[_0x1e0dfb(0x116)]['set'](_0x48b71d,_0x14c441['id']),_0x14c441['id'];if(_0x1306b5[_0x1e0dfb(0x198)]){const {stageName:_0x47589a,criteriaName:_0x5095ec}=findSegmentCriteriaLocation(_0x1306b5['yamlConfig'],_0x48b71d);return _0x1428ce(_0x48b71d,_0x27cbec['rule']),_0x1919c2[_0x1e0dfb(0x1bb)](_0x48b71d,{'definition':_0x27cbec,'stageName':_0x47589a,'criteriaName':_0x5095ec}),createPendingSegmentId(_0x48b71d);}const _0x4b9813=_0x1306b5['existingJourney']?.['id'];if(!_0x4b9813)throw new SDKError(ErrorCode[_0x1e0dfb(0x167)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x588940=_0x572517[_0x1e0dfb(0x1d9)](_0x48b71d);if(_0x588940)return _0x588940;const _0x26cbd1=((async()=>{const _0x489b56=_0x1e0dfb;_0x1428ce(_0x48b71d,_0x27cbec['rule']);const _0x7d1e36=generateDeterministicJourneySegmentName(_0x1306b5['yamlConfig']['name'],_0x48b71d),_0x3705bc=_0x3cc288[_0x489b56(0x1e8)][_0x489b56(0x133)](_0x256df5=>_0x256df5['name']===_0x7d1e36),_0x31b06a=createSegmentIdResolver(_0x3cc288['segmentNameToId'],_0x48b71d),_0x1d8bca=await resolveRuleSegmentIds(_0x27cbec[_0x489b56(0x1c9)],_0x31b06a);let _0x2bb1c0;return _0x3705bc?(await _0x34d3fb[_0x489b56(0x1c3)][_0x489b56(0x152)](_0x446a2a[_0x489b56(0x113)],_0x3705bc['id'],{'description':_0x27cbec[_0x489b56(0x197)]||_0x489b56(0x128)+_0x48b71d,'rule':_0x5165cb(_0x1d8bca),'countPopulation':!![]}),_0x2bb1c0=_0x3705bc['id'],saveSegmentToPushRecovery(_0x1306b5['absolutePath'],_0x1306b5[_0x489b56(0x108)]['name'],_0x48b71d,{'segmentId':_0x2bb1c0,'uniqueServerName':_0x7d1e36,'createdAt':new Date()[_0x489b56(0x204)]()})):_0x2bb1c0=await createOrRecoverEmbeddedSegment(_0x34d3fb,_0x1306b5,{'localName':_0x48b71d,'uniqueSegmentName':_0x7d1e36,'description':_0x27cbec['description']||_0x489b56(0x128)+_0x48b71d,'journeyId':_0x4b9813,'resolvedRule':_0x1d8bca,'parentId':_0x446a2a[_0x489b56(0x113)],'folderId':_0x446a2a[_0x489b56(0x1c2)]||''},_0x5165cb),_0x3cc288[_0x489b56(0x116)]['set'](_0x48b71d,_0x2bb1c0),_0x1819cc[_0x489b56(0x1bb)](_0x48b71d,_0x2bb1c0),_0x2bb1c0;})());_0x572517[_0x1e0dfb(0x1bb)](_0x48b71d,_0x26cbd1);try{return await _0x26cbd1;}finally{_0x572517[_0x1e0dfb(0x1d4)](_0x48b71d);}},'resolveActivationId':async _0xb71d99=>{const _0x291b87=_0x58a0bf,_0x1bde22=_0x5ccb45['get'](_0xb71d99);if(_0x1bde22)return _0x1bde22;if(_0x1306b5[_0x291b87(0x202)]){await _0x499694();const _0x25e8ba=_0x5ccb45[_0x291b87(0x1d9)](_0xb71d99);if(_0x25e8ba)return _0x25e8ba;}throw new SDKError(ErrorCode[_0x291b87(0x138)],_0x291b87(0x174)+_0xb71d99+_0x291b87(0x1c8)+_0x1306b5[_0x291b87(0x108)][_0x291b87(0x1a3)]+_0x291b87(0x1d2)+_0x291b87(0x1d5));},'resolveEmbeddedActivationId':async(_0x10be0f,_0x213b57)=>{const _0x3a8681=_0x58a0bf,_0x200d7b=_0x5ccb45[_0x3a8681(0x1d9)](_0x10be0f);if(_0x200d7b)return _0x200d7b;if(_0x1306b5[_0x3a8681(0x198)])return _0x4d77e9[_0x3a8681(0x1bb)](_0x10be0f,_0x213b57),createPendingActivationId(_0x10be0f);if(_0x1306b5['existingJourney']){await _0x499694();const _0x2810b5=_0x5ccb45[_0x3a8681(0x1d9)](_0x213b57['name']);if(_0x2810b5)return _0x5ccb45[_0x3a8681(0x1bb)](_0x10be0f,_0x2810b5),_0x2810b5;const _0x398075=activationSignature(_0x213b57),_0x2e3589=_0x1b4684?.[_0x3a8681(0x1d9)](_0x398075);if(_0x2e3589)return _0x5ccb45[_0x3a8681(0x1bb)](_0x10be0f,_0x2e3589),_0x2e3589;const _0x336006=await _0x451ee7(_0x213b57,_0x3cc288[_0x3a8681(0x139)]),_0x4c9dca={..._0x336006,..._0x213b57['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x213b57['run_after_journey_refresh']}},_0x1e0365=await _0x34d3fb['journey']['createActivation'](_0x1306b5['existingJourney']['id'],_0x4c9dca);return _0x5ccb45[_0x3a8681(0x1bb)](_0x10be0f,_0x1e0365['id']),_0x1e0365['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x3a8681(0x147));},'resolveJourneyId':async _0xde296c=>{const _0x2b5d60=_0x58a0bf;try{return await _0x34d3fb[_0x2b5d60(0x11c)][_0x2b5d60(0x1dd)](_0x446a2a[_0x2b5d60(0x113)],_0xde296c);}catch(_0x25f1db){throw new SDKError(ErrorCode[_0x2b5d60(0x138)],'Journey\x20\x27'+_0xde296c+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x1306b5[_0x2b5d60(0x108)]['name']+'\x27)',_0x25f1db);}},'resolveStageId':async(_0x5147f4,_0x481b1c)=>{const _0x43a584=_0x58a0bf,_0x265717=await _0x34d3fb[_0x43a584(0x11c)][_0x43a584(0x18e)](_0x5147f4),_0x288325=_0x265717[_0x43a584(0x18d)]['journeyStages']['find'](_0x4f7775=>_0x4f7775[_0x43a584(0x1a3)][_0x43a584(0x157)]()===_0x481b1c['toLowerCase']());if(!_0x288325?.['id'])throw new SDKError(ErrorCode[_0x43a584(0x138)],_0x43a584(0x19e)+_0x481b1c+_0x43a584(0x1d7)+(_0x265717[_0x43a584(0x18d)]['journeyBundleName']||_0x265717[_0x43a584(0x18d)][_0x43a584(0x1a3)])+'\x27');return _0x288325['id'];}},_0x55d936=await _0x11055b(_0x1306b5[_0x58a0bf(0x108)],_0x446a2a[_0x58a0bf(0x113)],_0x54f213),_0x5345a8=_0x446a2a['folderId']||_0x446a2a['rootFolderId'];_0x5345a8&&(_0x55d936[_0x58a0bf(0x183)]={'parentFolder':{'data':{'id':_0x5345a8,'type':_0x58a0bf(0x1c0)}}});if(_0x1306b5[_0x58a0bf(0x198)]){if(_0x1919c2[_0x58a0bf(0x1c6)]>0x0||_0x4d77e9[_0x58a0bf(0x1c6)]>0x0)return await executeThreeStepJourneyCreate(_0x34d3fb,_0x1306b5,_0x55d936,{'pendingEmbeddedSegments':_0x1919c2,'pendingEmbeddedActivations':_0x4d77e9,'embeddedSegmentNameToId':_0x1819cc,'journeyActivationNameToId':_0x5ccb45},{..._0x446a2a,'effectiveFolderId':_0x5345a8},_0x3cc288,_0xa5a9d1,_0x24f0f5);else{ensureJourneyDefaults(_0x55d936[_0x58a0bf(0x18d)]);const _0x1eca4f=await _0x34d3fb[_0x58a0bf(0x11c)][_0x58a0bf(0x105)](_0x55d936);return deletePushRecovery(_0x1306b5[_0x58a0bf(0x1af)]),{'action':_0x58a0bf(0x160),'journeyId':_0x1eca4f['id'],'embeddedSegmentNameToId':_0x1819cc};}}else{if(_0x1306b5[_0x58a0bf(0x1ee)]&&_0x1306b5[_0x58a0bf(0x202)]){_0x55d936['id']=_0x1306b5[_0x58a0bf(0x202)]['id'];const _0x23019b=_0x55d936[_0x58a0bf(0x18d)];_0x1306b5[_0x58a0bf(0x202)][_0x58a0bf(0x18d)]?.[_0x58a0bf(0x1d6)]&&(_0x23019b[_0x58a0bf(0x1d6)]=_0x1306b5[_0x58a0bf(0x202)]['attributes'][_0x58a0bf(0x1d6)]);const _0x4f76e4=_0x1306b5[_0x58a0bf(0x202)][_0x58a0bf(0x18d)]?.['journeyStages'];return _0x4f76e4&&_0x55d936[_0x58a0bf(0x18d)][_0x58a0bf(0x1f7)]&&injectExistingStageIds(_0x55d936[_0x58a0bf(0x18d)]['journeyStages'],_0x4f76e4),ensureJourneyDefaults(_0x23019b),await _0x34d3fb[_0x58a0bf(0x11c)][_0x58a0bf(0x1bf)](_0x1306b5[_0x58a0bf(0x202)]['id'],_0x55d936),deletePushRecovery(_0x1306b5[_0x58a0bf(0x1af)]),{'action':'updated','journeyId':_0x1306b5['existingJourney']['id'],'embeddedSegmentNameToId':_0x1819cc};}}return deletePushRecovery(_0x1306b5[_0x58a0bf(0x1af)]),{'action':_0x58a0bf(0x1b1),'journeyId':_0x1306b5[_0x58a0bf(0x202)]?.['id'],'embeddedSegmentNameToId':_0x1819cc};}function findSegmentCriteriaLocation(_0x2eb7b4,_0x3ed476){const _0x162218=a152_0x5819a5,_0x281273=_0x2eb7b4['stages']||_0x2eb7b4[_0x162218(0x158)]?.[0x0]?.[_0x162218(0x17b)]||[];let _0xbe7a63=_0x162218(0x187),_0x38893e=_0x3ed476;const _0x28c7e9=_0x2eb7b4[_0x162218(0x1d8)]||_0x2eb7b4[_0x162218(0x158)]?.[0x0]?.[_0x162218(0x1d8)];if(_0x28c7e9?.[_0x162218(0x1c3)]===_0x3ed476)return{'stageName':_0x162218(0x1d8),'criteriaName':_0x28c7e9[_0x162218(0x1a3)]||_0x3ed476};_0x4cc72e:for(const _0x1a055f of _0x281273){if(_0x1a055f[_0x162218(0x127)]?.[_0x162218(0x1c3)]===_0x3ed476){_0xbe7a63=_0x1a055f['name'],_0x38893e=_0x1a055f[_0x162218(0x127)][_0x162218(0x1a3)]||_0x3ed476;break;}if(_0x1a055f['steps'])for(const _0x301e8d of _0x1a055f[_0x162218(0x1f9)]){if(_0x301e8d['type']==='decision_point'&&_0x301e8d[_0x162218(0x106)]?.[_0x162218(0x1ed)])for(const _0x14e038 of _0x301e8d[_0x162218(0x106)][_0x162218(0x1ed)]){if(_0x14e038['segment']===_0x3ed476){_0xbe7a63=_0x1a055f[_0x162218(0x1a3)],_0x38893e=_0x14e038[_0x162218(0x1a3)]||_0x3ed476;break _0x4cc72e;}}}}return{'stageName':_0xbe7a63,'criteriaName':_0x38893e};}async function executeThreeStepJourneyCreate(_0x2b9d3b,_0x116b54,_0xa5332,_0x4e7778,_0xdfad5d,_0x156e18,_0x13c04c,_0x7aec40){const _0x313065=a152_0x5819a5,{activationDefToCreateRequest:_0x4dc450,yamlRuleToApi:_0x1ca142}=_0x7aec40,{pendingEmbeddedSegments:_0x19ffdf,pendingEmbeddedActivations:_0x3d016a,embeddedSegmentNameToId:_0x1bbba4}=_0x4e7778,_0x1bf342=JSON[_0x313065(0x17d)](JSON['stringify'](_0xa5332));ensureJourneyDefaults(_0x1bf342['attributes']),stripPendingIds(_0x1bf342);const _0x3bb61c=await _0x2b9d3b[_0x313065(0x11c)][_0x313065(0x105)](_0x1bf342),_0x2cf44f=_0x3bb61c['id'],_0x7d463=new Map();for(const _0x3143ad of _0x3bb61c[_0x313065(0x18d)]['journeyStages']){_0x7d463[_0x313065(0x1bb)](_0x3143ad['name'][_0x313065(0x157)](),_0x3143ad['id']);}recoverSegmentIdsFromPushRecovery(_0x116b54,_0x1bbba4,_0x156e18[_0x313065(0x116)]);for(const [_0x18b768,{definition:_0x2b41d4}]of _0x19ffdf){if(_0x1bbba4[_0x313065(0x1e3)](_0x18b768)){_0x13c04c[_0x313065(0x134)]?.({'type':_0x313065(0x162),'journeyName':_0x116b54['yamlConfig'][_0x313065(0x1a3)],'segmentName':_0x18b768});continue;}const _0x220770=generateDeterministicJourneySegmentName(_0x116b54[_0x313065(0x108)][_0x313065(0x1a3)],_0x18b768);_0x13c04c[_0x313065(0x134)]?.({'type':'embedded_segment_creating','journeyName':_0x116b54[_0x313065(0x108)][_0x313065(0x1a3)],'segmentName':_0x18b768});const _0x535793=createSegmentIdResolver(_0x156e18[_0x313065(0x116)],_0x18b768),_0x51c31e=await resolveRuleSegmentIds(_0x2b41d4[_0x313065(0x1c9)],_0x535793),_0x28a2ec=await createOrRecoverEmbeddedSegment(_0x2b9d3b,_0x116b54,{'localName':_0x18b768,'uniqueSegmentName':_0x220770,'description':_0x2b41d4[_0x313065(0x197)]||'Entry\x20criteria:\x20'+_0x18b768,'journeyId':_0x2cf44f,'resolvedRule':_0x51c31e,'parentId':_0xdfad5d[_0x313065(0x113)],'folderId':_0xdfad5d[_0x313065(0x114)]||''},_0x1ca142);_0x1bbba4['set'](_0x18b768,_0x28a2ec),_0x156e18[_0x313065(0x116)][_0x313065(0x1bb)](_0x18b768,_0x28a2ec),_0x13c04c[_0x313065(0x134)]?.({'type':_0x313065(0x162),'journeyName':_0x116b54[_0x313065(0x108)][_0x313065(0x1a3)],'segmentName':_0x18b768});}const _0x1ca4ac=new Map();for(const [_0x597e77,_0x465520]of _0x3d016a){_0x13c04c['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x116b54[_0x313065(0x108)][_0x313065(0x1a3)],'activationName':_0x597e77});const _0x2c2980=await _0x4dc450(_0x465520,_0x156e18['activationContext']),_0x4c107a={..._0x2c2980,..._0x465520[_0x313065(0x1dc)]!==undefined&&{'runAfterJourneyRefresh':_0x465520['run_after_journey_refresh']}},_0x1e8a6d=await _0x2b9d3b[_0x313065(0x11c)]['createActivation'](_0x2cf44f,_0x4c107a);_0x1ca4ac['set'](_0x597e77,_0x1e8a6d['id']),_0x4e7778['journeyActivationNameToId'][_0x313065(0x1bb)](_0x597e77,_0x1e8a6d['id']),_0x13c04c[_0x313065(0x134)]?.({'type':_0x313065(0x1ea),'journeyName':_0x116b54['yamlConfig']['name'],'activationName':_0x597e77});}const _0x4abdba=JSON[_0x313065(0x17d)](JSON[_0x313065(0x203)](_0xa5332));return _0x4abdba['id']=_0x2cf44f,ensureJourneyDefaults(_0x4abdba['attributes']),resolvePendingIdsInRequest(_0x4abdba,_0xa5332,_0x7d463,_0x1bbba4,_0x1ca4ac,_0x13c04c),await _0x2b9d3b[_0x313065(0x11c)][_0x313065(0x1bf)](_0x2cf44f,_0x4abdba),deletePushRecovery(_0x116b54[_0x313065(0x1af)]),{'action':_0x313065(0x160),'journeyId':_0x2cf44f,'embeddedSegmentNameToId':_0x1bbba4};}export function stripWaitStepPendingIds(_0x5d7197){const _0x5a1c31=a152_0x5819a5,_0x1c365b=_0x5d7197['conditionSegmentId']&&isPendingSegmentId(_0x5d7197[_0x5a1c31(0x145)]),_0x34ac53=_0x5d7197['conditions']?.['some'](_0x54883a=>_0x54883a['segmentId']&&isPendingSegmentId(_0x54883a[_0x5a1c31(0x15e)]));(_0x1c365b||_0x34ac53)&&(_0x5d7197[_0x5a1c31(0x112)]=_0x5a1c31(0x107),_0x5d7197[_0x5a1c31(0x189)]=0x1,_0x5d7197[_0x5a1c31(0x200)]=_0x5a1c31(0x1b0),delete _0x5d7197[_0x5a1c31(0x145)],delete _0x5d7197[_0x5a1c31(0x126)],delete _0x5d7197['conditionTimeoutUnit'],delete _0x5d7197[_0x5a1c31(0x201)]);}export function resolveWaitStepPendingIds(_0x5879a8,_0x5d3936,_0xb92311,_0x5911bb){const _0x14772d=a152_0x5819a5;if(_0x5d3936[_0x14772d(0x145)]&&isPendingSegmentId(_0x5d3936[_0x14772d(0x145)])){const _0x2ea4b5=_0xb92311(_0x5d3936[_0x14772d(0x145)],_0x14772d(0x123)+_0x5911bb+_0x14772d(0x10f));_0x2ea4b5&&(_0x5879a8[_0x14772d(0x112)]=_0x14772d(0x195),_0x5879a8[_0x14772d(0x145)]=_0x2ea4b5,delete _0x5879a8[_0x14772d(0x189)],delete _0x5879a8[_0x14772d(0x200)],_0x5d3936[_0x14772d(0x126)]!==undefined&&(_0x5879a8[_0x14772d(0x126)]=_0x5d3936[_0x14772d(0x126)]),_0x5d3936['conditionTimeoutUnit']&&(_0x5879a8[_0x14772d(0x153)]=_0x5d3936['conditionTimeoutUnit']));}if(_0x5d3936['conditions']){const _0xa03f7c=_0x5d3936[_0x14772d(0x201)][_0x14772d(0x119)](_0x5ab514=>_0x5ab514[_0x14772d(0x15e)]&&isPendingSegmentId(_0x5ab514['segmentId']));if(_0xa03f7c){const _0x18a664=_0x5d3936[_0x14772d(0x201)][_0x14772d(0x1fc)](_0x5826ea=>{const _0x34685f=_0x14772d;if(_0x5826ea[_0x34685f(0x15e)]&&isPendingSegmentId(_0x5826ea[_0x34685f(0x15e)])){const _0x5d6935=_0xb92311(_0x5826ea[_0x34685f(0x15e)],_0x34685f(0x123)+_0x5911bb+_0x34685f(0x10f));return{..._0x5826ea,'segmentId':_0x5d6935||_0x5826ea[_0x34685f(0x15e)]};}return{..._0x5826ea};});_0x5879a8[_0x14772d(0x112)]=_0x14772d(0x195),_0x5879a8['conditions']=_0x18a664,delete _0x5879a8['waitStep'],delete _0x5879a8['waitStepUnit'],delete _0x5879a8['conditionSegmentId'],delete _0x5879a8[_0x14772d(0x126)],delete _0x5879a8['conditionTimeoutUnit'];}}}function stripPendingIds(_0x43b1a0){const _0x293f74=a152_0x5819a5;_0x43b1a0[_0x293f74(0x18d)][_0x293f74(0x1d8)]?.['segmentId']&&isPendingSegmentId(_0x43b1a0['attributes'][_0x293f74(0x1d8)][_0x293f74(0x15e)])&&delete _0x43b1a0['attributes'][_0x293f74(0x1d8)];for(const _0x4a125a of _0x43b1a0[_0x293f74(0x18d)][_0x293f74(0x1f7)]||[]){_0x4a125a[_0x293f74(0x14d)]?.['segmentId']&&isPendingSegmentId(_0x4a125a['entryCriteria'][_0x293f74(0x15e)])&&delete _0x4a125a[_0x293f74(0x14d)];_0x4a125a[_0x293f74(0x1a8)]?.[_0x293f74(0x15e)]&&isPendingSegmentId(_0x4a125a[_0x293f74(0x1a8)][_0x293f74(0x15e)])&&delete _0x4a125a['milestone'];_0x4a125a[_0x293f74(0x12e)]&&(_0x4a125a[_0x293f74(0x12e)]=_0x4a125a['exitCriterias'][_0x293f74(0x14e)](_0x389e3c=>!_0x389e3c['segmentId']||!isPendingSegmentId(_0x389e3c[_0x293f74(0x15e)])));if(_0x4a125a['steps'])for(const _0x511299 of Object[_0x293f74(0x101)](_0x4a125a[_0x293f74(0x1f9)])){const _0x411aaa=_0x4a125a[_0x293f74(0x1f9)][_0x511299];_0x411aaa[_0x293f74(0x150)]===_0x293f74(0x1e7)&&_0x411aaa['journeyActivationStepId']&&isPendingActivationId(_0x411aaa[_0x293f74(0x19c)])&&(_0x411aaa[_0x293f74(0x19c)]='');if(_0x411aaa[_0x293f74(0x150)]===_0x293f74(0x17a)&&_0x411aaa[_0x293f74(0x1ed)])for(const _0x57f6aa of _0x411aaa[_0x293f74(0x1ed)]){_0x57f6aa[_0x293f74(0x15e)]&&isPendingSegmentId(_0x57f6aa[_0x293f74(0x15e)])&&(_0x57f6aa[_0x293f74(0x15e)]='');}_0x411aaa[_0x293f74(0x150)]===_0x293f74(0x168)&&stripWaitStepPendingIds(_0x411aaa);}}}function resolvePendingIdsInRequest(_0x2f6dda,_0x532210,_0x3df986,_0x394b5a,_0xb8f5be,_0x43aad8){const _0x4c9297=a152_0x5819a5,_0x68fd6f=(_0x2e28cd,_0x45c894)=>{const _0x58d9a2=a152_0x3568;if(!isPendingSegmentId(_0x2e28cd))return _0x2e28cd;const _0x12e56d=extractPendingSegmentName(_0x2e28cd),_0x5a7643=_0x394b5a[_0x58d9a2(0x1d9)](_0x12e56d);return!_0x5a7643&&_0x43aad8[_0x58d9a2(0x1b5)]?.(_0x58d9a2(0x121)+_0x12e56d+_0x58d9a2(0x1bc)+_0x45c894),_0x5a7643;};if(_0x2f6dda['attributes'][_0x4c9297(0x1d8)]?.[_0x4c9297(0x15e)]&&isPendingSegmentId(_0x2f6dda[_0x4c9297(0x18d)]['goal'][_0x4c9297(0x15e)])){const _0x42f252=_0x68fd6f(_0x2f6dda['attributes']['goal'][_0x4c9297(0x15e)],_0x4c9297(0x169));_0x42f252&&(_0x2f6dda[_0x4c9297(0x18d)][_0x4c9297(0x1d8)][_0x4c9297(0x15e)]=_0x42f252);}for(const _0x2312bd of _0x2f6dda[_0x4c9297(0x18d)][_0x4c9297(0x1f7)]||[]){const _0x5c1689=_0x3df986[_0x4c9297(0x1d9)](_0x2312bd[_0x4c9297(0x1a3)][_0x4c9297(0x157)]());_0x5c1689&&(_0x2312bd['id']=_0x5c1689);if(_0x2312bd['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x2312bd[_0x4c9297(0x14d)]['segmentId'])){const _0x4b235c=_0x68fd6f(_0x2312bd['entryCriteria'][_0x4c9297(0x15e)],'stage\x20\x27'+_0x2312bd[_0x4c9297(0x1a3)]+'\x27\x20entry\x20criteria');_0x4b235c&&(_0x2312bd[_0x4c9297(0x14d)]['segmentId']=_0x4b235c);}if(_0x2312bd[_0x4c9297(0x12e)])for(const _0x4ad9f5 of _0x2312bd[_0x4c9297(0x12e)]){if(_0x4ad9f5['segmentId']&&isPendingSegmentId(_0x4ad9f5[_0x4c9297(0x15e)])){const _0x1b0483=_0x68fd6f(_0x4ad9f5['segmentId'],_0x4c9297(0x123)+_0x2312bd[_0x4c9297(0x1a3)]+'\x27\x20exit\x20criteria');_0x1b0483&&(_0x4ad9f5[_0x4c9297(0x15e)]=_0x1b0483);}}if(_0x2312bd['milestone']?.[_0x4c9297(0x15e)]&&isPendingSegmentId(_0x2312bd[_0x4c9297(0x1a8)][_0x4c9297(0x15e)])){const _0x1ed1cc=_0x68fd6f(_0x2312bd[_0x4c9297(0x1a8)]['segmentId'],_0x4c9297(0x123)+_0x2312bd['name']+_0x4c9297(0x18b));_0x1ed1cc&&(_0x2312bd[_0x4c9297(0x1a8)][_0x4c9297(0x15e)]=_0x1ed1cc);}if(_0x2312bd[_0x4c9297(0x1f9)]){const _0x11bea0=_0x4c599f=>_0x532210[_0x4c9297(0x18d)][_0x4c9297(0x1f7)]?.[_0x4c9297(0x133)](_0x3c23c9=>_0x3c23c9[_0x4c9297(0x1a3)]['toLowerCase']()===_0x2312bd[_0x4c9297(0x1a3)][_0x4c9297(0x157)]())?.[_0x4c9297(0x1f9)]?.[_0x4c599f];for(const _0x394045 of Object[_0x4c9297(0x101)](_0x2312bd[_0x4c9297(0x1f9)])){const _0xad694b=_0x2312bd[_0x4c9297(0x1f9)][_0x394045],_0x12eee3=_0x11bea0(_0x394045);if(_0xad694b[_0x4c9297(0x150)]===_0x4c9297(0x1e7)&&_0xad694b['journeyActivationStepId']&&(isPendingActivationId(_0xad694b[_0x4c9297(0x19c)])||_0xad694b[_0x4c9297(0x19c)]==='')){if(_0x12eee3?.['journeyActivationStepId']&&isPendingActivationId(_0x12eee3['journeyActivationStepId'])){const _0x3b79b2=extractPendingActivationName(_0x12eee3[_0x4c9297(0x19c)]),_0x52c8f5=_0xb8f5be[_0x4c9297(0x1d9)](_0x3b79b2);_0x52c8f5&&(_0xad694b[_0x4c9297(0x19c)]=_0x52c8f5);}}if(_0xad694b[_0x4c9297(0x150)]===_0x4c9297(0x17a)&&_0xad694b[_0x4c9297(0x1ed)]&&_0x12eee3?.[_0x4c9297(0x1ed)])for(let _0x369856=0x0;_0x369856<_0xad694b[_0x4c9297(0x1ed)][_0x4c9297(0x19b)];_0x369856++){const _0x40aa5f=_0xad694b['branches'][_0x369856],_0x3d3cc7=_0x12eee3[_0x4c9297(0x1ed)][_0x369856];if(_0x3d3cc7?.[_0x4c9297(0x15e)]&&isPendingSegmentId(_0x3d3cc7[_0x4c9297(0x15e)])){const _0x227a58=_0x68fd6f(_0x3d3cc7[_0x4c9297(0x15e)],'stage\x20\x27'+_0x2312bd[_0x4c9297(0x1a3)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x40aa5f[_0x4c9297(0x1a3)]||_0x369856)+'\x27');_0x227a58&&(_0x40aa5f[_0x4c9297(0x15e)]=_0x227a58);}}_0xad694b['type']===_0x4c9297(0x168)&&_0x12eee3?.[_0x4c9297(0x150)]===_0x4c9297(0x168)&&resolveWaitStepPendingIds(_0xad694b,_0x12eee3,_0x68fd6f,_0x2312bd[_0x4c9297(0x1a3)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3348c3,_0x4afb3e){const _0x12cbe0=a153_0x2377,_0x457b85=_0x3348c3();while(!![]){try{const _0x3a38bd=parseInt(_0x12cbe0(0x174))/0x1*(parseInt(_0x12cbe0(0x175))/0x2)+-parseInt(_0x12cbe0(0x16e))/0x3+-parseInt(_0x12cbe0(0x173))/0x4+parseInt(_0x12cbe0(0x166))/0x5+-parseInt(_0x12cbe0(0x172))/0x6*(parseInt(_0x12cbe0(0x16c))/0x7)+-parseInt(_0x12cbe0(0x169))/0x8*(parseInt(_0x12cbe0(0x171))/0x9)+-parseInt(_0x12cbe0(0x168))/0xa*(-parseInt(_0x12cbe0(0x16f))/0xb);if(_0x3a38bd===_0x4afb3e)break;else _0x457b85['push'](_0x457b85['shift']());}catch(_0x10b46f){_0x457b85['push'](_0x457b85['shift']());}}}(a153_0x497e,0x53edf));export function buildFolderIdToPathMap(_0x408088){const _0x2db9e2=a153_0x2377,_0xe0dddf=new Map(),_0x4163f5=new Map();for(const _0x4bb6a4 of _0x408088){_0x4163f5[_0x2db9e2(0x170)](_0x4bb6a4['id'],_0x4bb6a4);}const _0x32e537=new Set();for(const _0x329bc6 of _0x408088){!_0x329bc6[_0x2db9e2(0x16d)]&&_0x32e537[_0x2db9e2(0x167)](_0x329bc6['id']);}function _0x160786(_0x21b934){const _0x5b1f58=_0x2db9e2;if(_0xe0dddf[_0x5b1f58(0x176)](_0x21b934['id']))return _0xe0dddf[_0x5b1f58(0x16b)](_0x21b934['id']);if(_0x32e537[_0x5b1f58(0x176)](_0x21b934['id']))return _0xe0dddf[_0x5b1f58(0x170)](_0x21b934['id'],''),'';if(_0x21b934['parentFolderId']){const _0x77b61b=_0x4163f5[_0x5b1f58(0x16b)](_0x21b934[_0x5b1f58(0x16d)]);if(_0x77b61b){const _0x181b29=_0x160786(_0x77b61b),_0x5d6898=_0x181b29?_0x181b29+'/'+_0x21b934[_0x5b1f58(0x16a)]:_0x21b934[_0x5b1f58(0x16a)];return _0xe0dddf[_0x5b1f58(0x170)](_0x21b934['id'],_0x5d6898),_0x5d6898;}}const _0x63972a=_0x21b934['name'];return _0xe0dddf[_0x5b1f58(0x170)](_0x21b934['id'],_0x63972a),_0x63972a;}for(const _0x1abac6 of _0x408088){_0x160786(_0x1abac6);}return _0xe0dddf;}export function buildFolderPathToIdMap(_0x4aeee6){const _0x206a02=a153_0x2377,_0x56d8cf=new Map(),_0x1520fe=new Map();for(const _0xba4bcc of _0x4aeee6){_0x1520fe[_0x206a02(0x170)](_0xba4bcc['id'],_0xba4bcc);}const _0x571671=new Set();for(const _0x53df12 of _0x4aeee6){!_0x53df12[_0x206a02(0x16d)]&&_0x571671[_0x206a02(0x167)](_0x53df12['id']);}function _0x156a68(_0x35cef0){const _0x4c5947=_0x206a02;if(_0x571671[_0x4c5947(0x176)](_0x35cef0['id']))return'';if(_0x35cef0[_0x4c5947(0x16d)]){const _0x43c853=_0x1520fe[_0x4c5947(0x16b)](_0x35cef0[_0x4c5947(0x16d)]);if(_0x43c853){const _0x1c4b04=_0x156a68(_0x43c853);return _0x1c4b04?_0x1c4b04+'/'+_0x35cef0[_0x4c5947(0x16a)]:_0x35cef0[_0x4c5947(0x16a)];}}return _0x35cef0['name'];}for(const _0x42a224 of _0x4aeee6){const _0x1f2e3e=_0x156a68(_0x42a224);_0x56d8cf[_0x206a02(0x170)](_0x1f2e3e,_0x42a224['id']);}return _0x56d8cf;}function a153_0x497e(){const _0x43ee61=['11276397nAczME','set','140031YrQddY','542370uMDNMJ','385024HDrVYP','25TvqizG','3064yjhfpL','has','1715660ZEypOo','add','10LpYkVL','232eWxFrE','name','get','35mNdWqB','parentFolderId','190026SZdtfL'];a153_0x497e=function(){return _0x43ee61;};return a153_0x497e();}function a153_0x2377(_0x504eb6,_0x4557cb){_0x504eb6=_0x504eb6-0x166;const _0x497eb6=a153_0x497e();let _0x237776=_0x497eb6[_0x504eb6];return _0x237776;}export function buildFolderMaps(_0x23e49c){const _0x339a55=a153_0x2377,_0x22ea8d=buildFolderIdToPathMap(_0x23e49c),_0x3eec12=new Map();for(const [_0xf44e7,_0x481c8f]of _0x22ea8d){_0x3eec12[_0x339a55(0x170)](_0x481c8f,_0xf44e7);}return{'idToPath':_0x22ea8d,'pathToId':_0x3eec12};}export function getFolderPath(_0x2ffe45,_0x515060){const _0x51d708=a153_0x2377;if(!_0x2ffe45)return'';return _0x515060[_0x51d708(0x16b)](_0x2ffe45)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x21d07b,_0x2ee0aa){const _0x4f5232=a154_0x1e54,_0x5ae7e2=_0x21d07b();while(!![]){try{const _0x2a64cd=-parseInt(_0x4f5232(0x113))/0x1+parseInt(_0x4f5232(0x110))/0x2+parseInt(_0x4f5232(0xf9))/0x3*(parseInt(_0x4f5232(0xfd))/0x4)+-parseInt(_0x4f5232(0x112))/0x5+parseInt(_0x4f5232(0xfa))/0x6+-parseInt(_0x4f5232(0x11b))/0x7*(-parseInt(_0x4f5232(0x103))/0x8)+-parseInt(_0x4f5232(0x10d))/0x9;if(_0x2a64cd===_0x2ee0aa)break;else _0x5ae7e2['push'](_0x5ae7e2['shift']());}catch(_0x450548){_0x5ae7e2['push'](_0x5ae7e2['shift']());}}}(a154_0x5030,0x3a767));import a154_0x205fab from'path';import{parse as a154_0x4baf5b}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';function a154_0x5030(){const _0xdd4128=['replace','Relative\x20path\x20cannot\x20be\x20empty','segment','split','exists','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','1379VuXeom','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','name','resolve','trim','push','File\x20not\x20found:\x20','Cannot\x20navigate\x20above\x20root','relative','raw','Path\x20cannot\x20be\x20empty','No\x20tdx.json\x20found\x20for\x20file:\x20','journey','join','endsWith','3PfOTbt','2461158qqBJSn','parse','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','101804aiwygR','Cannot\x20split\x20empty\x20path','Path\x20segment\x20cannot\x20be\x20empty','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','tdx.json','Path\x20attempts\x20to\x20navigate\x20above\x20root','17944BblENv','readFile','slice','dirname','root','substring','startsWith','isAbsolute','parent_segment','pop','5434866YGNsGB','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','segments','769806DkOzuD','.yml','1759125hvUjUT','67256tXIdFR','length'];a154_0x5030=function(){return _0xdd4128;};return a154_0x5030();}export function parsePath(_0x36e470){const _0x1ab7bb=a154_0x1e54;if(!_0x36e470||_0x36e470['trim']()==='')throw new Error(_0x1ab7bb(0x125));const _0x5c3b4c=_0x36e470[_0x1ab7bb(0x11f)]();if(_0x5c3b4c==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x36e470};const _0x409491=_0x5c3b4c[_0x1ab7bb(0x109)]('/')?_0x5c3b4c[_0x1ab7bb(0x108)](0x1):_0x5c3b4c,_0x1fd295=_0x409491[_0x1ab7bb(0x118)]('/')['filter'](_0x20f078=>_0x20f078!=='');if(_0x1fd295['length']===0x0)throw new Error(_0x1ab7bb(0x10e));const _0x3df73e=_0x5c3b4c['startsWith']('/')||!isRelativePathSegment(_0x1fd295[0x0]);for(const _0x25b8ab of _0x1fd295){validatePathSegment(_0x25b8ab);}return{'segments':_0x1fd295,'isAbsolute':_0x3df73e,'raw':_0x36e470};}function isRelativePathSegment(_0x151dc4){return _0x151dc4==='.'||_0x151dc4==='..';}function validatePathSegment(_0x1c8f4a){const _0x238c10=a154_0x1e54;if(_0x1c8f4a==='')throw new Error(_0x238c10(0xff));if(_0x1c8f4a==='.'||_0x1c8f4a==='..')return;if(/[\x00-\x1F\x7F]/['test'](_0x1c8f4a))throw new Error(_0x238c10(0x11a)+_0x1c8f4a);if(_0x1c8f4a!==_0x1c8f4a['trim']()){}}export function validatePath(_0x24f5d0){const _0xb0d0f2=a154_0x1e54;if(_0x24f5d0[_0xb0d0f2(0x10f)][_0xb0d0f2(0x114)]===0x0&&!_0x24f5d0[_0xb0d0f2(0x10a)])throw new Error(_0xb0d0f2(0x116));if(_0x24f5d0[_0xb0d0f2(0x10a)]){if(_0x24f5d0['segments'][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0xe15a35=0x0;for(const _0x526157 of _0x24f5d0[_0xb0d0f2(0x10f)]){if(_0x526157==='..'){if(_0xe15a35===0x0)throw new Error(_0xb0d0f2(0x102));_0xe15a35--;}else _0x526157!=='.'&&_0xe15a35++;}}}export function joinPaths(_0x2d4863,_0x2bf870){const _0x3e2acc=a154_0x1e54;if(!_0x2d4863||_0x2d4863==='/')return _0x2bf870;if(!_0x2bf870||_0x2bf870==='.')return _0x2d4863;if(_0x2bf870['startsWith']('/'))return _0x2bf870;const _0x2a9fc1=parsePath(_0x2d4863),_0x32be50=parsePath(_0x2bf870),_0x420e14=[..._0x2a9fc1['segments']];for(const _0x30756c of _0x32be50['segments']){if(_0x30756c==='.')continue;else{if(_0x30756c==='..'){if(_0x420e14[_0x3e2acc(0x114)]===0x0)throw new Error(_0x3e2acc(0x122));_0x420e14['pop']();}else _0x420e14[_0x3e2acc(0x120)](_0x30756c);}}const _0xd1e7ce=_0x420e14[_0x3e2acc(0xf7)]('/');return _0x2a9fc1[_0x3e2acc(0x124)][_0x3e2acc(0x109)]('/')?'/'+_0xd1e7ce:_0xd1e7ce;}export function normalizePath(_0x317d2f){const _0x37c687=a154_0x1e54,_0x1f4498=parsePath(_0x317d2f),_0x5f598=[];for(const _0xdaff28 of _0x1f4498[_0x37c687(0x10f)]){if(_0xdaff28==='.')continue;else{if(_0xdaff28==='..'){if(_0x5f598[_0x37c687(0x114)]===0x0){if(_0x1f4498[_0x37c687(0x10a)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x5f598[_0x37c687(0x120)]('..');}else _0x5f598[_0x5f598[_0x37c687(0x114)]-0x1]==='..'?_0x5f598[_0x37c687(0x120)]('..'):_0x5f598[_0x37c687(0x10c)]();}else _0x5f598['push'](_0xdaff28);}}if(_0x5f598['length']===0x0)return _0x1f4498[_0x37c687(0x10a)]?'/':'.';const _0x2f6636=_0x5f598[_0x37c687(0xf7)]('/');return _0x1f4498[_0x37c687(0x124)]['startsWith']('/')?'/'+_0x2f6636:_0x2f6636;}export function getParentPath(_0xbd2ade){const _0x4771d9=a154_0x1e54,_0x292eaf=parsePath(_0xbd2ade);if(_0x292eaf['segments']['length']<=0x1)return'/';const _0x1f55a1=_0x292eaf[_0x4771d9(0x10f)][_0x4771d9(0x105)](0x0,-0x1)[_0x4771d9(0xf7)]('/');return _0x292eaf[_0x4771d9(0x124)][_0x4771d9(0x109)]('/')?'/'+_0x1f55a1:_0x1f55a1;}export function getBaseName(_0x2a5e87){const _0x514e66=a154_0x1e54,_0x32f344=parsePath(_0x2a5e87);return _0x32f344['segments'][_0x32f344[_0x514e66(0x10f)][_0x514e66(0x114)]-0x1]||'';}function a154_0x1e54(_0x2590b2,_0x12bf3f){_0x2590b2=_0x2590b2-0xf5;const _0x5030f1=a154_0x5030();let _0x1e5410=_0x5030f1[_0x2590b2];return _0x1e5410;}export function isChildPath(_0x527c75,_0xd89a08){const _0x57fee6=a154_0x1e54,_0x2df9bc=parsePath(_0x527c75),_0x18ec0e=parsePath(_0xd89a08);if(_0x2df9bc['segments'][_0x57fee6(0x114)]<=_0x18ec0e[_0x57fee6(0x10f)][_0x57fee6(0x114)])return![];for(let _0x539801=0x0;_0x539801<_0x18ec0e[_0x57fee6(0x10f)][_0x57fee6(0x114)];_0x539801++){if(_0x2df9bc[_0x57fee6(0x10f)][_0x539801]!==_0x18ec0e[_0x57fee6(0x10f)][_0x539801])return![];}return!![];}export function splitPath(_0x25d92a){const _0x143c96=a154_0x1e54,_0x5afc9c=parsePath(_0x25d92a);if(_0x5afc9c['segments'][_0x143c96(0x114)]===0x0)throw new Error(_0x143c96(0xfe));if(_0x5afc9c[_0x143c96(0x10f)][_0x143c96(0x114)]===0x1)return{'parent':_0x5afc9c[_0x143c96(0x10f)][0x0]};return{'parent':_0x5afc9c[_0x143c96(0x10f)][0x0],'child':_0x5afc9c[_0x143c96(0x10f)][_0x143c96(0x105)](0x1)[_0x143c96(0xf7)]('/')};}export function isYamlFilePath(_0x124fad){const _0x37cffc=a154_0x1e54;return _0x124fad[_0x37cffc(0xf8)](_0x37cffc(0x111))||_0x124fad['endsWith']('.yaml');}export async function resolveYamlFilePath(_0x994372,_0x364708=nodeFileSystem){const _0x4ae386=a154_0x1e54,_0x428bc7=a154_0x205fab[_0x4ae386(0x11e)](_0x994372);if(!await _0x364708[_0x4ae386(0x119)](_0x428bc7))throw new Error(_0x4ae386(0x121)+_0x994372);let _0x13eb2c=a154_0x205fab[_0x4ae386(0x106)](_0x428bc7),_0x407862=null,_0x550bc8=null;const _0x1c9878=a154_0x205fab[_0x4ae386(0xfb)](_0x13eb2c)[_0x4ae386(0x107)];while(_0x13eb2c!==_0x1c9878){const _0xfcf5bc=a154_0x205fab[_0x4ae386(0xf7)](_0x13eb2c,_0x4ae386(0x101));if(await _0x364708[_0x4ae386(0x119)](_0xfcf5bc)){_0x407862=_0xfcf5bc,_0x550bc8=_0x13eb2c;break;}_0x13eb2c=a154_0x205fab[_0x4ae386(0x106)](_0x13eb2c);}if(!_0x407862||!_0x550bc8)throw new Error(_0x4ae386(0xf5)+_0x994372+'\x0a'+_0x4ae386(0xfc));const _0x256c22=await _0x364708[_0x4ae386(0x104)](_0x407862),_0x1a757a=JSON[_0x4ae386(0xfb)](_0x256c22),_0x2d1d35=_0x1a757a[_0x4ae386(0x10b)];if(!_0x2d1d35)throw new Error(_0x4ae386(0x100));const _0xdcbc45=await _0x364708[_0x4ae386(0x104)](_0x428bc7),_0x568a81=a154_0x4baf5b(_0xdcbc45),_0x1162fa=_0x568a81[_0x4ae386(0x11d)];if(!_0x1162fa)throw new Error(_0x4ae386(0x11c)+_0x994372);const _0x1d9110=_0x568a81['type']===_0x4ae386(0xf6)?'journey':_0x4ae386(0x117),_0x249e4b=a154_0x205fab[_0x4ae386(0x123)](_0x550bc8,_0x428bc7),_0x3b0122=a154_0x205fab[_0x4ae386(0x106)](_0x249e4b),_0x38d5ac=_0x3b0122==='.'?'':_0x3b0122[_0x4ae386(0x115)](/\\/g,'/'),_0x10bf72=_0x38d5ac?_0x2d1d35+'/'+_0x38d5ac+'/'+_0x1162fa:_0x2d1d35+'/'+_0x1162fa;return{'parentSegment':_0x2d1d35,'segmentName':_0x1162fa,'folderPath':_0x38d5ac,'fullPath':_0x10bf72,'resourceType':_0x1d9110,'content':_0xdcbc45};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a155_0x3866(_0x49787f,_0xe368fc){_0x49787f=_0x49787f-0x16b;const _0x17a8e4=a155_0x17a8();let _0x3866e1=_0x17a8e4[_0x49787f];return _0x3866e1;}(function(_0x5c9d45,_0x460e26){const _0x202b75=a155_0x3866,_0x42680f=_0x5c9d45();while(!![]){try{const _0x1736c9=parseInt(_0x202b75(0x16d))/0x1+-parseInt(_0x202b75(0x171))/0x2*(parseInt(_0x202b75(0x175))/0x3)+parseInt(_0x202b75(0x173))/0x4+-parseInt(_0x202b75(0x16b))/0x5*(-parseInt(_0x202b75(0x172))/0x6)+parseInt(_0x202b75(0x16e))/0x7+parseInt(_0x202b75(0x16c))/0x8+-parseInt(_0x202b75(0x176))/0x9;if(_0x1736c9===_0x460e26)break;else _0x42680f['push'](_0x42680f['shift']());}catch(_0x3f1485){_0x42680f['push'](_0x42680f['shift']());}}}(a155_0x17a8,0x40d1f));export function parseSegmentRef(_0x4cec25){const _0x3aa231=a155_0x3866,_0x46a711=_0x4cec25['indexOf']('/');if(_0x46a711===-0x1)return{'parentId':_0x4cec25};if(_0x46a711===0x0)throw new Error(_0x3aa231(0x16f)+_0x4cec25+_0x3aa231(0x170));const _0x5d87e2=_0x4cec25[_0x3aa231(0x174)](0x0,_0x46a711),_0x1a3465=_0x4cec25[_0x3aa231(0x174)](_0x46a711+0x1);if(_0x1a3465==='')throw new Error(_0x3aa231(0x16f)+_0x4cec25+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x5d87e2,'childId':_0x1a3465};}function a155_0x17a8(){const _0x152a28=['54005YcSjUY','1050752QAXiEy','226890swGYHv','2317833xbgTDr','Invalid\x20segment\x20reference\x20format:\x20','.\x20Parent\x20name\x20cannot\x20be\x20empty','4NFjAjb','6pOiFBr','2110116dWQCzb','substring','653241ezrkek','4740174LtZtti'];a155_0x17a8=function(){return _0x152a28;};return a155_0x17a8();}
|