@treasuredata/tdx 0.26.5 → 0.26.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.d.ts.map +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/job-command.js.map +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/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/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/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.d.ts +14 -37
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +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.d.ts +82 -0
- package/dist/sdk/agent/tool-target-registry.d.ts.map +1 -0
- package/dist/sdk/agent/tool-target-registry.js +1 -0
- package/dist/sdk/agent/tool-target-registry.js.map +1 -0
- package/dist/sdk/agent/types/agent-def.d.ts +3 -2
- package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +20 -0
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.d.ts +2 -2
- package/dist/sdk/client/td-api-client.d.ts.map +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/td-api-client.js.map +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.d.ts +1 -1
- package/dist/sdk/job.d.ts.map +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/job.js.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +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/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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/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/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/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/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a114_0x2facc4=a114_0xa69d;(function(_0x1d80ae,_0x2d9fe2){const _0x1180e4=a114_0xa69d,_0x3b1785=_0x1d80ae();while(!![]){try{const _0x4ec04e=parseInt(_0x1180e4(0xf0))/0x1+parseInt(_0x1180e4(0xfa))/0x2*(-parseInt(_0x1180e4(0xe4))/0x3)+parseInt(_0x1180e4(0x179))/0x4*(-parseInt(_0x1180e4(0x1ac))/0x5)+-parseInt(_0x1180e4(0xdf))/0x6+-parseInt(_0x1180e4(0x180))/0x7*(parseInt(_0x1180e4(0x1b6))/0x8)+-parseInt(_0x1180e4(0x181))/0x9*(parseInt(_0x1180e4(0x170))/0xa)+parseInt(_0x1180e4(0xd7))/0xb;if(_0x4ec04e===_0x2d9fe2)break;else _0x3b1785['push'](_0x3b1785['shift']());}catch(_0x56e0b9){_0x3b1785['push'](_0x3b1785['shift']());}}}(a114_0x7284,0x7a7a2));import{createHash}from'crypto';function a114_0xa69d(_0x33e9f5,_0x7a28c3){_0x33e9f5=_0x33e9f5-0xb4;const _0x728486=a114_0x7284();let _0xa69d39=_0x728486[_0x33e9f5];return _0xa69d39;}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a114_0x2facc4(0xde));export const PENDING_SEGMENT_PREFIX=a114_0x2facc4(0x192);export const PENDING_ACTIVATION_PREFIX=a114_0x2facc4(0xcf);export function createPendingSegmentId(_0x2d5ff6){return''+PENDING_SEGMENT_PREFIX+_0x2d5ff6+'__';}export function isPendingSegmentId(_0x51bf38){const _0x3c0930=a114_0x2facc4;return _0x51bf38[_0x3c0930(0x17d)](PENDING_SEGMENT_PREFIX)&&!_0x51bf38[_0x3c0930(0x17d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1606c0){const _0x185852=a114_0x2facc4;return _0x1606c0[_0x185852(0x182)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x51dcfa){return''+PENDING_ACTIVATION_PREFIX+_0x51dcfa+'__';}export function isPendingActivationId(_0xc66c5d){const _0x399425=a114_0x2facc4;return _0xc66c5d[_0x399425(0x17d)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x289eae){const _0x4f5941=a114_0x2facc4;return _0x289eae[_0x4f5941(0x182)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1c59da,_0x5df021){const _0x57a0dc=a114_0x2facc4,_0x11ab6a=_0x1c59da+'::'+(_0x5df021[_0x57a0dc(0x185)]()||_0x57a0dc(0x1a5)),_0x338c0f=createHash('sha1')['update'](_0x11ab6a)[_0x57a0dc(0x138)](_0x57a0dc(0x1a1))[_0x57a0dc(0x148)](0x0,0xc);return _0x57a0dc(0x186)+_0x338c0f;}export function ensureJourneyDefaults(_0x56c9e8){const _0x2afb49=a114_0x2facc4;!_0x56c9e8[_0x2afb49(0x110)]&&(_0x56c9e8[_0x2afb49(0x110)]=''),!_0x56c9e8['state']&&(_0x56c9e8[_0x2afb49(0xf5)]=_0x2afb49(0x10d));}export function resolveTDFolderPath(_0x4010b0,_0x306766,_0x3d5762){const _0x45a511=a114_0x2facc4;if(!_0x306766)return _0x4010b0;if(_0x4010b0===_0x3d5762||_0x4010b0[_0x45a511(0x17d)](_0x3d5762+'/'))return _0x4010b0;return _0x4010b0?_0x3d5762+'/'+_0x4010b0:_0x3d5762;}export function addFoldersToCreate(_0xdee51c,_0x2caa75,_0x3afa48){const _0xa993ad=a114_0x2facc4;if(!_0xdee51c)return;if(_0x2caa75[_0xa993ad(0x14a)](_0xdee51c))return;const _0x11f3eb=_0xdee51c['split']('/');let _0x5790a3='';for(const _0x5bcd9e of _0x11f3eb){_0x5790a3=_0x5790a3?_0x5790a3+'/'+_0x5bcd9e:_0x5bcd9e,!_0x2caa75[_0xa993ad(0x14a)](_0x5790a3)&&_0x3afa48[_0xa993ad(0xc2)](_0x5790a3);}}import*as a114_0x5eca73 from'yaml';import{readFileSync}from'fs';import a114_0x52197e from'path';import{isJourneyDef,parseYamlString as a114_0x127bdb,toYamlString as a114_0x5ebc8a,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(_0x90de3e){const _0x18e02c=a114_0x2facc4;if(Array[_0x18e02c(0xb7)](_0x90de3e))return'['+_0x90de3e[_0x18e02c(0x1b7)](_0x29b19b=>stableStringify(_0x29b19b))['join'](',')+']';if(_0x90de3e&&typeof _0x90de3e===_0x18e02c(0x113)){const _0x3ebf09=_0x90de3e,_0x5643e2=Object['keys'](_0x3ebf09)[_0x18e02c(0xf1)](),_0xdf4e68=_0x5643e2[_0x18e02c(0x1b7)](_0x135c34=>'\x22'+_0x135c34+'\x22:'+stableStringify(_0x3ebf09[_0x135c34]));return'{'+_0xdf4e68[_0x18e02c(0x10b)](',')+'}';}const _0x38b572=JSON[_0x18e02c(0xdd)](_0x90de3e);return _0x38b572===undefined?_0x18e02c(0xc8):_0x38b572;}function activationSignature(_0x2ee2d2){const _0xbf8ea4=a114_0x2facc4,_0x289725={'connection':_0x2ee2d2[_0xbf8ea4(0xf4)],..._0x2ee2d2[_0xbf8ea4(0x171)]!==undefined&&{'all_columns':_0x2ee2d2[_0xbf8ea4(0x171)]},..._0x2ee2d2[_0xbf8ea4(0x142)]!==undefined&&{'columns':_0x2ee2d2[_0xbf8ea4(0x142)]},..._0x2ee2d2[_0xbf8ea4(0x162)]!==undefined&&{'behavior':_0x2ee2d2['behavior']},..._0x2ee2d2['schedule']!==undefined&&{'schedule':_0x2ee2d2[_0xbf8ea4(0x155)]},..._0x2ee2d2[_0xbf8ea4(0xd9)]!==undefined&&{'notification':_0x2ee2d2[_0xbf8ea4(0xd9)]},..._0x2ee2d2[_0xbf8ea4(0xcb)]!==undefined&&{'connector_config':_0x2ee2d2[_0xbf8ea4(0xcb)]},..._0x2ee2d2[_0xbf8ea4(0x14d)]!==undefined&&{'activation_template_id':_0x2ee2d2[_0xbf8ea4(0x14d)]}};return stableStringify(_0x289725);}async function fetchSegment(_0xe7f121,_0x3806b4,_0x40d7ee,_0x42ed95){const _0x474c14=a114_0x2facc4,_0x4f010d=_0x42ed95?.[_0x474c14(0x103)](_0x11a24f=>_0x11a24f['id']===_0x40d7ee);if(_0x4f010d)return _0x4f010d;try{return await _0xe7f121[_0x474c14(0x1a5)][_0x474c14(0xc4)](_0x3806b4,_0x40d7ee);}catch(_0x1f03b4){logger[_0x474c14(0xc1)](_0x474c14(0x19f)+_0x40d7ee+_0x474c14(0xe9)+_0x1f03b4);try{return await _0xe7f121[_0x474c14(0x1a5)]['getSegmentEntity'](_0x40d7ee);}catch(_0x25a275){return logger[_0x474c14(0xc1)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x40d7ee+':\x20'+_0x25a275),null;}}}function recoverSegmentIdsFromPushRecovery(_0x41cde3,_0x1f98e3,_0x13c2e2){const _0x2e8f06=a114_0x2facc4,_0xef4546=readPushRecovery(_0x41cde3[_0x2e8f06(0x120)]);if(_0xef4546?.[_0x2e8f06(0xbe)]===_0x41cde3[_0x2e8f06(0x17f)][_0x2e8f06(0x12a)])for(const [_0x362a35,_0x57920f]of Object[_0x2e8f06(0x13e)](_0xef4546[_0x2e8f06(0xba)])){const _0x393025=generateDeterministicJourneySegmentName(_0x41cde3[_0x2e8f06(0x17f)][_0x2e8f06(0x12a)],_0x362a35);_0x57920f[_0x2e8f06(0x114)]===_0x393025&&(_0x1f98e3[_0x2e8f06(0x124)](_0x362a35,_0x57920f[_0x2e8f06(0x1b1)]),_0x13c2e2['set'](_0x362a35,_0x57920f[_0x2e8f06(0x1b1)]));}}async function createOrRecoverEmbeddedSegment(_0x438f90,_0x5d0ae6,_0x89cc12,_0x4b6beb){const _0x11ee8f=a114_0x2facc4;let _0x88191b;try{_0x88191b=await _0x438f90['segment'][_0x11ee8f(0x14e)]({'name':_0x89cc12[_0x11ee8f(0xcd)],'description':_0x89cc12[_0x11ee8f(0x110)],'journeyId':_0x89cc12[_0x11ee8f(0x1a9)],'rule':_0x4b6beb(_0x89cc12['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x89cc12['folderId'],'audienceId':_0x89cc12[_0x11ee8f(0x102)]});}catch(_0x1ece6b){const _0x53d893=_0x1ece6b instanceof Error&&_0x1ece6b['message'][_0x11ee8f(0xb4)](_0x11ee8f(0x126));if(_0x53d893){const _0x345094=readPushRecovery(_0x5d0ae6['absolutePath']),_0x4ce04e=_0x345094?.[_0x11ee8f(0xbe)]===_0x5d0ae6['yamlConfig'][_0x11ee8f(0x12a)]?_0x345094[_0x11ee8f(0xba)][_0x89cc12[_0x11ee8f(0x14b)]]:undefined;if(_0x4ce04e?.[_0x11ee8f(0x114)]===_0x89cc12[_0x11ee8f(0xcd)])await _0x438f90[_0x11ee8f(0x1a5)][_0x11ee8f(0x15a)](_0x89cc12[_0x11ee8f(0x102)],_0x4ce04e['segmentId'],{'description':_0x89cc12[_0x11ee8f(0x110)],'rule':_0x4b6beb(_0x89cc12[_0x11ee8f(0xef)],!![]),'countPopulation':!![]}),_0x88191b=_0x4ce04e[_0x11ee8f(0x1b1)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x11ee8f(0xc7)+_0x89cc12[_0x11ee8f(0x14b)]+_0x11ee8f(0x198)+(_0x11ee8f(0x131)+_0x5d0ae6[_0x11ee8f(0x120)][_0x11ee8f(0x182)](/([^/]+)$/,_0x11ee8f(0x109))+')\x20')+_0x11ee8f(0xc6),_0x1ece6b);}else throw _0x1ece6b;}return saveSegmentToPushRecovery(_0x5d0ae6[_0x11ee8f(0x120)],_0x5d0ae6[_0x11ee8f(0x17f)][_0x11ee8f(0x12a)],_0x89cc12[_0x11ee8f(0x14b)],{'segmentId':_0x88191b,'uniqueServerName':_0x89cc12['uniqueSegmentName'],'createdAt':new Date()[_0x11ee8f(0x147)]()}),_0x88191b;}export async function prepareSegmentFiles(_0x3812a0,_0x32f944,_0x58c837,_0x5b4c14,_0x3bc86f){const _0x1cb4ed=a114_0x2facc4,{activationDefToCreateRequest:_0x298117}=await import('./child-segment-yaml.js'),_0x172a76=[],_0x52249e=new Set();for(const {yamlConfig:_0x43c438,folderPath:_0x4d70ed,sourcePath:_0x59e0dd}of _0x3812a0){const _0x4abd75=resolveTDFolderPath(_0x4d70ed,_0x5b4c14,_0x3bc86f),_0x5a3c0d=_0x4abd75+':'+_0x43c438['name'],_0x165878=_0x32f944[_0x1cb4ed(0x1a3)][_0x1cb4ed(0x105)](_0x5a3c0d),_0x1708ae=_0x165878?_0x32f944[_0x1cb4ed(0x139)][_0x1cb4ed(0x105)](_0x165878['id'])||[]:[];addFoldersToCreate(_0x4abd75,_0x32f944[_0x1cb4ed(0x11c)],_0x52249e);const _0x4b633d=calculateActivationActions(_0x43c438[_0x1cb4ed(0xbd)]||[],_0x1708ae,_0x32f944[_0x1cb4ed(0xb9)],_0x32f944[_0x1cb4ed(0xcc)]);for(const _0x202f09 of _0x4b633d){(_0x202f09[_0x1cb4ed(0x160)]==='create'||_0x202f09[_0x1cb4ed(0x160)]===_0x1cb4ed(0x1ba))&&_0x202f09[_0x1cb4ed(0x129)]&&(_0x202f09[_0x1cb4ed(0xc9)]=await _0x298117(_0x202f09[_0x1cb4ed(0x129)],_0x58c837));}const _0x37f39c=calculateSegmentDiff(_0x43c438,_0x165878,_0x1708ae,_0x32f944['idToEmailMap'],_0x32f944[_0x1cb4ed(0xcc)]);_0x172a76[_0x1cb4ed(0x1a4)]({'relativePath':_0x43c438[_0x1cb4ed(0x12a)],'absolutePath':_0x59e0dd,'yamlConfig':_0x43c438,'folderPath':_0x4abd75,'existingSegment':_0x165878,'existingActivations':_0x1708ae,'isNew':_0x37f39c[_0x1cb4ed(0x19b)],'hasChanges':_0x37f39c['hasChanges'],'diff':_0x37f39c[_0x1cb4ed(0x127)],'activationActions':_0x4b633d});}return{'segmentFiles':_0x172a76,'foldersToCreate':_0x52249e};}export async function prepareJourneyFiles(_0x34cad8,_0x3274a4,_0x2a1c9e,_0x4b8f27){const _0xf51887=a114_0x2facc4,_0xbdfbf2=[],_0x2e4b2c=new Set();for(const {yamlConfig:_0xee7b5,folderPath:_0x194142,sourcePath:_0x4ff733}of _0x34cad8){const _0x51edcd=resolveTDFolderPath(_0x194142,_0x2a1c9e,_0x4b8f27),_0x2d2c07=_0x51edcd+':'+_0xee7b5[_0xf51887(0x12a)],_0x3dba8e=_0x3274a4[_0xf51887(0xd1)][_0xf51887(0x105)](_0x2d2c07);let _0x52f8f9,_0x2605dc;if(_0x3dba8e&&_0x3dba8e['length']>0x0){const _0x41a7f7=buildLocalExpandedRuleMappings(_0xee7b5),{createYamlContext:_0x29c8f2,prefetchJourneySegments:_0x4eafc5}=createPushYamlContextForBundle(_0x3274a4[_0xf51887(0x19a)],_0x3274a4[_0xf51887(0x102)],_0x3274a4[_0xf51887(0x118)],_0x41a7f7,_0x3274a4[_0xf51887(0xb9)],_0x3274a4['connectionIdToNameMap'],_0x3274a4[_0xf51887(0xb5)],_0x3274a4[_0xf51887(0x14f)]);await _0x4eafc5(_0x3dba8e[_0xf51887(0x1b7)](_0x370507=>_0x370507['id']));const _0x57db38=hasMultipleVersions(_0xee7b5),_0x2fd611=async _0x4435ce=>{const _0x3a27bb=_0xf51887,_0x52e037=_0x3274a4[_0x3a27bb(0x14f)]?.['get'](_0x4435ce);if(_0x52e037)return _0x52e037;return _0x3274a4[_0x3a27bb(0xea)]({'journeyId':_0x4435ce,'journeyName':_0xee7b5[_0x3a27bb(0x12a)],'isMultiVersion':_0x3dba8e[_0x3a27bb(0x145)]>0x1});};if(_0x57db38&&_0x3dba8e[_0xf51887(0x145)]>0x1){const _0x31ea7c=[];for(const _0x120426 of _0x3dba8e){const _0x3d949e=_0x120426['versionNumber']||0x1;_0x3274a4[_0xf51887(0xf2)]?.[_0xf51887(0x1ba)](_0xf51887(0xd5)+_0xee7b5[_0xf51887(0x12a)]+'\x20v'+_0x3d949e);const _0x2950bd=await _0x2fd611(_0x120426['id']),_0x1027d7=_0x29c8f2(_0x120426['id']),_0x426530=await journeyResponseToDef(_0x2950bd,_0x1027d7);_0x31ea7c[_0xf51887(0x1a4)]({'item':_0x120426,'yaml':_0x426530});}const _0x5a5fb5=buildLocalRuleToNameMappingFromJourney(_0xee7b5);_0x2605dc=buildMergedJourneyDef(_0x31ea7c,_0x5a5fb5);const _0x27bfea=Math[_0xf51887(0xeb)](..._0x31ea7c[_0xf51887(0x1b7)](_0xb82b34=>_0xb82b34[_0xf51887(0x1b8)]['versionNumber']||0x0)),_0x36e7b4=_0x3dba8e[_0xf51887(0x103)](_0x28729f=>(_0x28729f[_0xf51887(0x1a7)]||0x0)===_0x27bfea);_0x36e7b4&&(_0x3274a4[_0xf51887(0xf2)]?.[_0xf51887(0x1ba)]('Fetching\x20'+_0xee7b5[_0xf51887(0x12a)]+'\x20v'+_0x27bfea),_0x52f8f9=await _0x2fd611(_0x36e7b4['id']));}else{const _0x49bc80=_0x3dba8e[_0x3dba8e['length']-0x1];_0x3274a4[_0xf51887(0xf2)]?.[_0xf51887(0x1ba)](_0xf51887(0xd5)+_0xee7b5['name']),_0x52f8f9=await _0x2fd611(_0x49bc80['id']);const _0x542b48=_0x29c8f2(_0x49bc80['id']),_0x2c3aee=await journeyResponseToDef(_0x52f8f9,_0x542b48),_0x6bbe4a=buildLocalRuleToNameMappingFromJourney(_0xee7b5);_0x2605dc=buildMergedJourneyDef([{'item':_0x49bc80,'yaml':_0x2c3aee}],_0x6bbe4a);}}addFoldersToCreate(_0x51edcd,_0x3274a4[_0xf51887(0x11c)],_0x2e4b2c);const _0x398f3b=calculateJourneyDiff(_0xee7b5,_0x2605dc);_0xbdfbf2[_0xf51887(0x1a4)]({'relativePath':_0xee7b5['name'],'absolutePath':_0x4ff733,'yamlConfig':_0xee7b5,'folderPath':_0x51edcd,'existingJourney':_0x52f8f9,'isNew':_0x398f3b['isNew'],'hasChanges':_0x398f3b['hasChanges'],'diff':_0x398f3b['diff']});}return{'journeyFiles':_0xbdfbf2,'foldersToCreate':_0x2e4b2c};}export function calculateActivationActions(_0x30f711,_0x36bf95,_0xa50371,_0x4d9fb3){const _0xb57607=a114_0x2facc4,_0x3cf916=[],_0xd2130b=new Map();for(const _0x2292ce of _0x36bf95){_0xd2130b[_0xb57607(0x124)](_0x2292ce[_0xb57607(0x12a)],_0x2292ce);}const _0x152112=new Map();for(const _0x15dcd9 of _0x30f711){_0x152112[_0xb57607(0x124)](_0x15dcd9['name'],_0x15dcd9);}for(const _0x2bf1b2 of _0x30f711){const _0x3f3ae5=_0xd2130b[_0xb57607(0x105)](_0x2bf1b2[_0xb57607(0x12a)]);if(!_0x3f3ae5)_0x3cf916[_0xb57607(0x1a4)]({'type':'create','name':_0x2bf1b2[_0xb57607(0x12a)],'yamlActivation':_0x2bf1b2});else{const _0x430fc3=activationResponseToDef(_0x3f3ae5,_0xa50371,_0x4d9fb3),_0x456e9f=a114_0x5eca73[_0xb57607(0xdd)](_0x430fc3),_0x229a2a=a114_0x5eca73['stringify'](_0x2bf1b2);_0x456e9f!==_0x229a2a&&_0x3cf916[_0xb57607(0x1a4)]({'type':'update','name':_0x2bf1b2[_0xb57607(0x12a)],'yamlActivation':_0x2bf1b2,'existingActivation':_0x3f3ae5});}}for(const _0x2d0454 of _0x36bf95){!_0x152112[_0xb57607(0x14a)](_0x2d0454[_0xb57607(0x12a)])&&_0x3cf916['push']({'type':'delete','name':_0x2d0454[_0xb57607(0x12a)],'existingActivation':_0x2d0454});}return _0x3cf916;}function calculateYamlDiff(_0x321183,_0x14a50f){if(_0x14a50f){const _0xfad945=generateDiff(_0x14a50f,_0x321183),_0x376ba5=hasChanges(_0xfad945);return{'isNew':![],'hasChanges':_0x376ba5,'diff':_0x376ba5?formatDiffWithColors(_0xfad945):undefined};}const _0x1fa8b0=generateDiff('',_0x321183);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x1fa8b0)};}export function calculateSegmentDiff(_0x5a2dcc,_0x3fbd82,_0x31d7d8,_0x5e242f,_0x4a4a75){const _0x524293=segmentToYamlString(_0x5a2dcc),_0x1348f4=_0x3fbd82?segmentToYamlString(segmentWithActivationsToYaml(_0x3fbd82,_0x31d7d8,undefined,_0x5e242f,_0x4a4a75)):undefined;return calculateYamlDiff(_0x524293,_0x1348f4);}export function calculateJourneyDiff(_0x4d7747,_0x18bcc4){const _0x412c33=normalizeJourneyDef(_0x4d7747,_0x4d7747),_0x58ceee=a114_0x5ebc8a(_0x412c33),_0x13b345=_0x18bcc4?a114_0x5ebc8a(normalizeJourneyDef(_0x18bcc4,_0x4d7747)):undefined;return calculateYamlDiff(_0x58ceee,_0x13b345);}export function findSegmentsToDelete(_0x43a86e,_0x41525f,_0xceee37,_0x2600cb,_0x118a66){const _0xfde15=a114_0x2facc4,_0x572a88=new Set();for(const {yamlConfig:_0x5ed8ee,folderPath:_0x243b9d}of _0x41525f){_0x572a88['add'](_0x243b9d+':'+_0x5ed8ee[_0xfde15(0x12a)]);}return _0x43a86e[_0xfde15(0x11a)](_0x9d74b4=>{const _0x12825b=_0xfde15,_0x3d9804=_0x9d74b4[_0x12825b(0x1b4)]?_0xceee37[_0x12825b(0x105)](_0x9d74b4[_0x12825b(0x1b4)][_0x12825b(0x1ad)]())||'':'',_0x26582f=_0x3d9804+':'+_0x9d74b4[_0x12825b(0x12a)];if(_0x572a88[_0x12825b(0x14a)](_0x26582f))return![];if(_0x118a66)return _0x3d9804===_0x2600cb||_0x3d9804[_0x12825b(0x17d)](_0x2600cb+'/');return!![];});}export function findJourneysToDelete(_0x52ae68,_0x4cdcad,_0x1233c0,_0x50bff3,_0x332976){const _0x12e10b=a114_0x2facc4,_0x250cbc=new Set();for(const {yamlConfig:_0xd68161,folderPath:_0x59793b}of _0x4cdcad){_0x250cbc[_0x12e10b(0xc2)](_0x59793b+':'+_0xd68161[_0x12e10b(0x12a)]);}return _0x52ae68[_0x12e10b(0x11a)](_0x24977c=>{const _0x163205=_0x12e10b,_0x55bbdf=_0x24977c[_0x163205(0x1ab)]?_0x1233c0[_0x163205(0x105)](_0x24977c[_0x163205(0x1ab)])||'':'',_0xa559e1=_0x55bbdf+':'+_0x24977c[_0x163205(0x119)];if(_0x250cbc[_0x163205(0x14a)](_0xa559e1))return![];if(_0x332976)return _0x55bbdf===_0x50bff3||_0x55bbdf[_0x163205(0x17d)](_0x50bff3+'/');return!![];});}export function buildSegmentLookupMap(_0x50b796,_0x11b08b){const _0xb923bc=a114_0x2facc4,_0x5557a0=new Map();for(const _0x14d003 of _0x50b796){const _0x577ddf=_0x14d003['segmentFolderId']?_0x11b08b[_0xb923bc(0x105)](_0x14d003[_0xb923bc(0x1b4)][_0xb923bc(0x1ad)]())||'':'',_0xa5eb7=_0x577ddf+':'+_0x14d003[_0xb923bc(0x12a)];_0x5557a0[_0xb923bc(0x124)](_0xa5eb7,_0x14d003);}return _0x5557a0;}export function buildSegmentNameToIdMap(_0x56cf5e){const _0x127780=a114_0x2facc4,_0x155a40=new Map();for(const _0x7291bf of _0x56cf5e){_0x155a40[_0x127780(0x124)](_0x7291bf[_0x127780(0x12a)],_0x7291bf['id']);}return _0x155a40;}export function buildJourneyBundleLookupMap(_0x5831d7,_0xfda803){const _0x4a3185=a114_0x2facc4,_0x4674c8=new Map();for(const _0x39d7ee of _0x5831d7){const _0x1c3e6e=_0x39d7ee[_0x4a3185(0x1ab)]?_0xfda803[_0x4a3185(0x105)](_0x39d7ee[_0x4a3185(0x1ab)])||'':'',_0x316d36=_0x1c3e6e+':'+_0x39d7ee[_0x4a3185(0x119)];!_0x4674c8['has'](_0x316d36)&&_0x4674c8[_0x4a3185(0x124)](_0x316d36,[]),_0x4674c8[_0x4a3185(0x105)](_0x316d36)[_0x4a3185(0x1a4)](_0x39d7ee);}for(const _0x1c2ff0 of _0x4674c8[_0x4a3185(0x16f)]()){_0x1c2ff0[_0x4a3185(0xf1)]((_0x1c29f0,_0x5f34a1)=>(_0x1c29f0[_0x4a3185(0x1a7)]||0x0)-(_0x5f34a1[_0x4a3185(0x1a7)]||0x0));}return _0x4674c8;}export function collectFoldersToCreate(_0x1e6997,_0xa52110){const _0x283dd5=a114_0x2facc4,_0x3d780b=new Set();for(const _0x3447b9 of _0x1e6997){if(!_0x3447b9)continue;if(_0xa52110[_0x283dd5(0x14a)](_0x3447b9))continue;const _0x507575=_0x3447b9[_0x283dd5(0x165)]('/');let _0x213d0f='';for(const _0x5a66d4 of _0x507575){_0x213d0f=_0x213d0f?_0x213d0f+'/'+_0x5a66d4:_0x5a66d4,!_0xa52110[_0x283dd5(0x14a)](_0x213d0f)&&_0x3d780b['add'](_0x213d0f);}}return _0x3d780b;}export function parseAndClassifyYamlFiles(_0x4ccdec,_0x529eb6,_0x900092){const _0x13a5c1=a114_0x2facc4,_0x3dd983=[],_0x13c91b=[];for(const _0x4178a7 of _0x4ccdec){const _0x1fe04f=a114_0x52197e['relative'](_0x529eb6,a114_0x52197e[_0x13a5c1(0x188)](_0x4178a7)),_0x1d2834=_0x1fe04f==='.'?'':_0x1fe04f,_0xa18f55=readFileSync(_0x4178a7,_0x13a5c1(0x184)),_0x2425c3=a114_0x5eca73[_0x13a5c1(0x189)](_0xa18f55);if(isJourneyDef(_0x2425c3)){const _0x34c43c=a114_0x127bdb(_0xa18f55);_0x13c91b[_0x13a5c1(0x1a4)]({'yamlConfig':_0x34c43c,'folderPath':_0x1d2834,'sourcePath':_0x4178a7});}else{if(!_0x900092?.[_0x13a5c1(0xb6)]){const _0x2affbb=parseSegmentYamlFile(_0xa18f55),_0x4ec33b=normalizeChildSegmentYaml(_0x2affbb);_0x3dd983['push']({'yamlConfig':_0x4ec33b,'folderPath':_0x1d2834,'sourcePath':_0x4178a7});}}}return{'segments':_0x3dd983,'journeys':_0x13c91b};}function a114_0x7284(){const _0x28dd94=['conditionTimeoutDuration','segmentId','conditionTimeoutUnit','Creating\x20folder\x20\x27','segmentFolderId','goal','28712jCUnvd','map','item','\x27\x20exit\x20criteria','update','\x20(referenced\x20in\x20journey\x20','includes','activationStepsById','skipSegments','isArray','JOURNEY_UPDATE_ERROR','idToEmailMap','segments','\x0a\x20\x20','embedded_activation_created','activations','journeyName','Deleted\x20segment\x20\x27','parseDocument','debug','add','activationActions','getSegment','Deleting\x20activation\x20\x27','and\x20the\x20server\x20segment,\x20then\x20retry.','Embedded\x20segment\x20\x27','null','validatedRequest','user','connector_config','connectionIdToNameMap','uniqueSegmentName','waitStepType','__pending_act_','logSuccess','journeyBundlesByFolderAndName','Updating\x20activation\x20\x27','goal\x20criteria','waitStep','Fetching\x20','activationParams','24292730tVHeHH','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','notification','delete','Created\x20folder\x20\x27','Updated\x20segment\x20\x27','stringify','tdx.sdk.push-workflow','3391260tiaqaB','relative','DecisionPoint','from','embedded_activation_creating','345jPeojY','SEGMENT_SYNTAX_ERROR','effectiveFolderId','decision_point','Created\x20segment\x20\x27',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','fetchJourney','max','activation_','entryCriteria','Created\x20activation\x20\x27','resolvedRule','740594SWPeZM','sort','progress','logWarning','connection','state','conditionSegmentId','action','../../utils/async.js','some','5818mEERcP','folderPath','journeyActivationStepId','segment_deleting','Segment\x20not\x20found:\x20','\x27\x20wait\x20condition','run_after_journey_refresh','Creating\x20activation\x20\x27','parentId','find','hasChanges','get','Created\x20journey\x20\x27','nameToId','segment_creating','.$1.push-recovery.json','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','join','deleted','draft','entry_criteria','with','description','errors','activation_updated','object','uniqueServerName','\x20journey\x20from\x20file:\x20','segment_deleted','WaitStep','existingSegments','journeyBundleName','filter','updated','folderPathToId','listActivations','activation_deleting','createActivation','absolutePath','index','size','activationContext','set','attributes','Name\x20has\x20already\x20been\x20taken','diff','folder','yamlActivation','name','idToName','logDeleted','\x27...','\x20activation\x20\x27','embeddedSegmentNameToId','journey','Delete\x20the\x20push\x20recovery\x20file\x20(','entry','reduce','Condition','nameToType','activation_creating','deleteActivation','digest','activationsBySegmentId','SEGMENT_UPDATE_ERROR','stage\x20\x27','branches','\x27\x20milestone','entries','Activation\x20not\x20found:\x20','Failed\x20to\x20fetch\x20referenced\x20segment\x20','Failed\x20to\x20resolve\x20activation\x20','columns','create','Creating\x20segment\x20\x27','length','valid','toISOString','slice','./journey-yaml.js','has','localName','Duration','activation_template_id','createJourneySegment','journeyById','journeyStages','NOT_FOUND','deleteSegment','Updated\x20activation\x20\x27','\x27\x20not\x20found\x20in\x20journey\x20\x27','schedule','existingActivation','getJourney','verbose','Activation','updateSegmentById','resolveJourneyId','rule','Journey\x20\x27','relationships','activation_deleted','type','withProgress','behavior','embedded_segment_created','journey_updated','split','milestone','rootFolderId','segmentNameToId','waitStepUnit','createFolder','createdSegmentId','ACTIVATION_UPDATE_ERROR','\x20segment\x20from\x20file:\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','values','249420bQlXgT','all_columns','Entry\x20criteria:\x20','):\x20','all','logInfo','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','SEGMENT_NOT_FOUND','stages','2511944VtfaSp','steps','Failed\x20to\x20','toLowerCase','startsWith','./child-segment-yaml.js','yamlConfig','91cGcWHc','315kTuTcU','replace','embedded_segment_creating','utf-8','trim','journey_entry_criteria_','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','dirname','parse','unchanged','journey_created','conditions','Updating\x20segment\x20\x27','journey_creating','folder_creating','activation_updating','exitCriterias','__pending_','JOURNEY_SYNTAX_ERROR','existingSegment','resolveSegment','parentSegmentFolder','created','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','updateActivation','deps','isNew','ACTIVATION_SYNTAX_ERROR','onProgress','segment_updated','getSegment\x20failed\x20for\x20',').\x20','hex','journeys','segmentByFolderAndName','push','segment','\x27\x20from\x20file:\x20','versionNumber','existingJourney','journeyId','keys','folderId','5glZbEW','toString','data','flatMap'];a114_0x7284=function(){return _0x28dd94;};return a114_0x7284();}export function validateParsedFiles(_0x3de5ed,_0x54eda3){const _0x56b82a=a114_0x2facc4,_0x1b6d53=[];for(const {yamlConfig:_0x20b146,sourcePath:_0x1f0bd3}of _0x3de5ed[_0x56b82a(0xba)]){const _0x21268e=readFileSync(_0x1f0bd3,_0x56b82a(0x184)),_0x2c9e85=a114_0x5eca73['parseDocument'](_0x21268e),_0x31d73b=validateSegmentDef(_0x20b146,{'source':_0x21268e,'document':_0x2c9e85});if(!_0x31d73b[_0x56b82a(0x146)]){const _0x2074a2=a114_0x52197e[_0x56b82a(0xe0)](_0x54eda3,_0x1f0bd3);_0x1b6d53[_0x56b82a(0x1a4)]({'filePath':_0x2074a2,'source':_0x21268e,'result':_0x31d73b,'isJourney':![]});}}for(const {yamlConfig:_0x1692c4,sourcePath:_0x598afb}of _0x3de5ed[_0x56b82a(0x1a2)]){const _0x5d18b6=readFileSync(_0x598afb,_0x56b82a(0x184)),_0x17019c=a114_0x5eca73[_0x56b82a(0xc0)](_0x5d18b6),_0x5404d5=validateJourneyDef(_0x1692c4,{'source':_0x5d18b6,'document':_0x17019c});if(!_0x5404d5[_0x56b82a(0x146)]){const _0x422ba8=a114_0x52197e[_0x56b82a(0xe0)](_0x54eda3,_0x598afb);_0x1b6d53[_0x56b82a(0x1a4)]({'filePath':_0x422ba8,'source':_0x5d18b6,'result':_0x5404d5,'isJourney':!![]});}}return _0x1b6d53;}export function formatValidationErrors(_0x456ad4){const _0x35f2df=a114_0x2facc4,_0x8ab01e=[];for(const {filePath:_0x3f4326,source:_0x4c2ae7,result:_0x34abce,isJourney:_0x1eed6b}of _0x456ad4){const _0x196bf4=_0x1eed6b?_0x35f2df(0x130):_0x35f2df(0x1a5);_0x8ab01e[_0x35f2df(0x1a4)]('\x0a'+_0x3f4326+'\x20('+_0x196bf4+_0x35f2df(0x173)+_0x34abce[_0x35f2df(0x111)][_0x35f2df(0x145)]+'\x20error(s)'),_0x8ab01e['push'](formatValidationResult(_0x34abce,_0x4c2ae7,_0x3f4326));}return _0x8ab01e[_0x35f2df(0x10b)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x35a731){const _0x106a54=a114_0x2facc4,_0x486b7b=new Set(),_0x5d1519=new Map(),_0x48f7ac=collectSegmentUsageCounts(_0x35a731);if(_0x35a731[_0x106a54(0xba)])for(const [_0x155e64,_0x2e465d]of Object[_0x106a54(0x13e)](_0x35a731['segments'])){_0x486b7b[_0x106a54(0xc2)](_0x155e64);if(_0x2e465d[_0x106a54(0x15c)]){const _0x588745=yamlRuleToApi(_0x2e465d[_0x106a54(0x15c)]),_0x3c3da8=apiRuleToYaml(_0x588745);_0x5d1519[_0x106a54(0x124)](_0x155e64,_0x3c3da8);}}const _0x165e42=new Map();let _0x425767=0x0;for(const [_0x324579,_0x395219]of _0x5d1519){const _0x3983f6=serializeExpandedRule(_0x395219,_0x5d1519),_0x431a72=_0x165e42[_0x106a54(0x105)](_0x3983f6)||[];_0x431a72[_0x106a54(0x1a4)]({'name':_0x324579,'index':_0x425767}),_0x165e42['set'](_0x3983f6,_0x431a72),_0x425767++;}const _0x142b8b=new Map();for(const [_0x25528e,_0x2e2766]of _0x165e42){const _0x2605a5=_0x2e2766[_0x106a54(0x148)]()[_0x106a54(0xf1)]((_0x40a69d,_0x348999)=>{const _0x484d94=_0x106a54,_0x4fbd61=_0x48f7ac[_0x484d94(0x105)](_0x40a69d['name'])||0x0,_0x4299d1=_0x48f7ac[_0x484d94(0x105)](_0x348999['name'])||0x0;if(_0x4fbd61!==_0x4299d1)return _0x4299d1-_0x4fbd61;return _0x40a69d[_0x484d94(0x121)]-_0x348999[_0x484d94(0x121)];})[_0x106a54(0x1b7)](_0x57fb63=>_0x57fb63[_0x106a54(0x12a)]),_0x48a9c6=[];for(const _0x3dc90a of _0x2605a5){const _0x1d5aa3=_0x48f7ac['get'](_0x3dc90a)||0x0,_0x30c362=Math[_0x106a54(0xeb)](_0x1d5aa3,0x1);for(let _0x3e9acf=0x0;_0x3e9acf<_0x30c362;_0x3e9acf++){_0x48a9c6['push'](_0x3dc90a);}}_0x142b8b['set'](_0x25528e,_0x48a9c6);}return{'existingLocalSegmentNames':_0x486b7b,'localSegmentRules':_0x5d1519,'localExpandedRuleToNames':_0x142b8b};}export function createSegmentIdResolver(_0x27095c,_0x1fe067){return async _0x496aae=>{const _0x3d4a0c=a114_0xa69d,_0x4eb76d=_0x27095c[_0x3d4a0c(0x105)](_0x496aae);if(!_0x4eb76d)throw new SDKError(ErrorCode[_0x3d4a0c(0x177)],_0x3d4a0c(0xfe)+_0x496aae+_0x3d4a0c(0x176)+_0x1fe067+'\x27)');return _0x4eb76d;};}export function extractRootFolderId(_0x9fc716){const _0x41d5c0=a114_0x2facc4;return _0x9fc716[_0x41d5c0(0x15e)]?.[_0x41d5c0(0x196)]?.[_0x41d5c0(0x1ae)]?.['id']||_0x9fc716[_0x41d5c0(0x15e)]?.['parentFolder']?.[_0x41d5c0(0x1ae)]?.['id'];}export function buildConnectionMaps(_0x4f4aec){const _0x33064b=a114_0x2facc4,_0x737220=new Map(),_0x2094f3=new Map(),_0x20e02f=new Map();for(const _0x58ee6f of _0x4f4aec){_0x737220[_0x33064b(0x124)](_0x58ee6f['name'],parseInt(_0x58ee6f['id'],0xa)),_0x2094f3['set'](_0x58ee6f['id'],_0x58ee6f['name']),_0x20e02f[_0x33064b(0x124)](_0x58ee6f[_0x33064b(0x12a)],_0x58ee6f[_0x33064b(0x160)]);}return{'nameToId':_0x737220,'idToName':_0x2094f3,'nameToType':_0x20e02f};}export function calculatePushStats(_0x44f385,_0x568855,_0x575773,_0x591857,_0x5ad4b,_0x5cb4b1,_0xd01c84){const _0x5e6a9b=a114_0x2facc4,_0x5e61d5=_0x44f385[_0x5e6a9b(0x11a)](_0x4e56e3=>_0x4e56e3[_0x5e6a9b(0x19b)]),_0x2b8086=_0x44f385[_0x5e6a9b(0x11a)](_0x120123=>!_0x120123[_0x5e6a9b(0x19b)]&&_0x120123[_0x5e6a9b(0x104)]),_0x51c925=_0x44f385[_0x5e6a9b(0x11a)](_0x32defb=>!_0x32defb[_0x5e6a9b(0x19b)]&&!_0x32defb[_0x5e6a9b(0x104)]),_0x4dd617=_0x5cb4b1?_0x591857:[],_0x1bf900=_0x568855[_0x5e6a9b(0x11a)](_0x2fc269=>_0x2fc269['isNew']),_0x5337ef=_0x568855[_0x5e6a9b(0x11a)](_0x3c4344=>!_0x3c4344['isNew']&&_0x3c4344[_0x5e6a9b(0x104)]),_0x51fcc9=_0x568855['filter'](_0x22e4b2=>!_0x22e4b2[_0x5e6a9b(0x19b)]&&!_0x22e4b2['hasChanges']),_0x2f805d=_0x5cb4b1?_0x5ad4b:[],_0x37b957=_0x44f385[_0x5e6a9b(0x1af)](_0x423ec6=>_0x423ec6[_0x5e6a9b(0xc3)]),_0x46e11f=_0x37b957[_0x5e6a9b(0x11a)](_0x5bcac8=>_0x5bcac8[_0x5e6a9b(0x160)]==='create'),_0x5d9ab9=_0x37b957[_0x5e6a9b(0x11a)](_0x43c606=>_0x43c606[_0x5e6a9b(0x160)]===_0x5e6a9b(0x1ba)),_0x39ff79=_0x37b957[_0x5e6a9b(0x11a)](_0x4bf0a1=>_0x4bf0a1[_0x5e6a9b(0x160)]===_0x5e6a9b(0xda)),_0x2f8bd0=Array[_0x5e6a9b(0xe2)](_0x575773)[_0x5e6a9b(0xf1)](),_0x1652c9=_0xd01c84?![]:_0x5e61d5[_0x5e6a9b(0x145)]>0x0||_0x2b8086['length']>0x0||_0x4dd617[_0x5e6a9b(0x145)]>0x0,_0x5c75e=_0x1bf900[_0x5e6a9b(0x145)]>0x0||_0x5337ef[_0x5e6a9b(0x145)]>0x0||_0x2f805d[_0x5e6a9b(0x145)]>0x0,_0xd4d78d=_0xd01c84?![]:_0x37b957[_0x5e6a9b(0x145)]>0x0,_0x110b06=_0x2f8bd0[_0x5e6a9b(0x145)]>0x0;return{'segments':{'new':_0x5e61d5,'changed':_0x2b8086,'unchanged':_0x51c925,'toDelete':_0x4dd617},'journeys':{'new':_0x1bf900,'changed':_0x5337ef,'unchanged':_0x51fcc9,'toDelete':_0x2f805d},'activations':{'all':_0x37b957,'toCreate':_0x46e11f,'toUpdate':_0x5d9ab9,'toDelete':_0x39ff79},'folders':{'toCreate':_0x2f8bd0},'counts':{'segments':{'new':_0x5e61d5['length'],'changed':_0x2b8086['length'],'unchanged':_0x51c925[_0x5e6a9b(0x145)],'toDelete':_0x4dd617[_0x5e6a9b(0x145)]},'journeys':{'new':_0x1bf900['length'],'changed':_0x5337ef[_0x5e6a9b(0x145)],'unchanged':_0x51fcc9[_0x5e6a9b(0x145)],'toDelete':_0x2f805d['length']},'activations':{'create':_0x46e11f['length'],'update':_0x5d9ab9[_0x5e6a9b(0x145)],'delete':_0x39ff79[_0x5e6a9b(0x145)]},'folders':_0x2f8bd0[_0x5e6a9b(0x145)]},'hasChanges':_0x1652c9||_0x5c75e||_0xd4d78d||_0x110b06};}export async function buildPushExecutionContext(_0x4e2c74,_0x41c516,_0x484342,_0x13135d,_0x10ced2,_0x22e9aa){const _0x207f91=a114_0x2facc4,_0x29eafe=extractRootFolderId(_0x484342),{pathToId:_0x47db98,idToPath:_0x9bddbb}=buildFolderMaps(_0x10ced2),_0x55a435=buildSegmentNameToIdMap(_0x13135d),_0x2bb14d=new Map(),{batchAsync:_0x4ab4b8}=await import(_0x207f91(0xf8)),[_0x1f7941,_0xbb92db]=await Promise[_0x207f91(0x174)]([_0x4e2c74[_0x207f91(0xca)]['buildUserMaps'](),_0x4e2c74[_0x207f91(0xf4)]['list'](),((async()=>{const _0x5f1052=_0x207f91;!_0x22e9aa&&_0x13135d[_0x5f1052(0x145)]>0x0&&await _0x4ab4b8(_0x13135d,async _0x19065b=>{const _0x2a1564=_0x5f1052,_0x1439b5=await _0x4e2c74['segment'][_0x2a1564(0x11d)](_0x41c516,_0x19065b['id']);_0x2bb14d[_0x2a1564(0x124)](_0x19065b['id'],_0x1439b5);});})())]),{emailToId:_0x4381aa,idToEmail:_0x3259eb}=_0x1f7941,_0x9fd165=buildConnectionMaps(_0xbb92db);return{'rootFolderId':_0x29eafe,'folderPathToId':_0x47db98,'folderIdToPath':_0x9bddbb,'segmentNameToId':_0x55a435,'activationsBySegmentId':_0x2bb14d,'emailToIdMap':_0x4381aa,'idToEmailMap':_0x3259eb,'connectionNameToIdMap':_0x9fd165[_0x207f91(0x107)],'connectionIdToNameMap':_0x9fd165[_0x207f91(0x12b)],'connectionNameToTypeMap':_0x9fd165[_0x207f91(0x135)]};}export function createPushYamlContextForBundle(_0x316505,_0x3c1aee,_0x39b8b1,_0x51a876,_0x4a9c74,_0x3dadeb,_0x3d2117,_0x48bf8c){const {existingLocalSegmentNames:_0x581e8d,localExpandedRuleToNames:_0x4c43ea}=_0x51a876,_0x168f69=new Set(),_0x1fbe41=new Map(),_0x110ffb=new Map(),_0x5bfc53=new Map(),_0x31ae2a=createJumpTargetCache(),_0x3e32ad=new Map(),_0x303db7=new Map(),_0x5c2b3f=new Set();let _0x8b92c;const _0x45c49b=_0x4b1d0c=>{const _0x4d6f0b={'resolveSegment':async _0x4c8706=>{const _0x1fe9da=a114_0xa69d,_0x4ea64a=_0x5bfc53[_0x1fe9da(0x105)](_0x4c8706);if(_0x4ea64a!==undefined)return{'name':_0x4ea64a,'isJourneyLocal':!![]};try{const _0x4cf6a8=await fetchSegment(_0x316505,_0x3c1aee,_0x4c8706,_0x39b8b1);if(!_0x4cf6a8)throw new Error('Segment\x20not\x20found');const _0x3a5b51=generateJourneyLocalName(_0x4cf6a8['name']),_0x43d0c2=_0x4cf6a8['kind']===SEGMENT_KIND_JOURNEY&&_0x3a5b51!==undefined;let _0x507b0c=_0x4cf6a8[_0x1fe9da(0x12a)],_0x34a8ce;if(_0x43d0c2&&_0x4cf6a8[_0x1fe9da(0x15c)]){const _0x381687=apiRuleToYaml(_0x4cf6a8[_0x1fe9da(0x15c)]);_0x303db7[_0x1fe9da(0x124)](_0x4c8706,_0x381687);const _0x361c3e=async _0x2056a5=>{const _0x2f2805=_0x1fe9da,_0x4d868f=collectSegmentRefsFromRule(_0x2056a5);for(const _0x3bb3a0 of _0x4d868f){if(!_0x303db7[_0x2f2805(0x14a)](_0x3bb3a0))try{const _0x213b6c=await fetchSegment(_0x316505,_0x3c1aee,_0x3bb3a0,_0x39b8b1);if(_0x213b6c?.[_0x2f2805(0x15c)]){const _0x2296c7=apiRuleToYaml(_0x213b6c[_0x2f2805(0x15c)]);_0x303db7['set'](_0x3bb3a0,_0x2296c7),await _0x361c3e(_0x2296c7);}}catch(_0xce6e2e){logger[_0x2f2805(0xc1)](_0x2f2805(0x140)+_0x3bb3a0+':\x20'+_0xce6e2e);}}};await _0x361c3e(_0x381687);const _0x5f3f34=serializeExpandedRule(_0x381687,_0x303db7),_0xa3f5c4=_0x4c43ea[_0x1fe9da(0x105)](_0x5f3f34);if(_0xa3f5c4&&_0xa3f5c4['length']>0x0){const _0x2681df=_0x1fbe41[_0x1fe9da(0x105)](_0x5f3f34)||0x0,_0x5b3f73=_0xa3f5c4[_0x2681df]||_0xa3f5c4[_0xa3f5c4[_0x1fe9da(0x145)]-0x1];_0x1fbe41[_0x1fe9da(0x124)](_0x5f3f34,_0x2681df+0x1),_0x507b0c=_0x5b3f73,_0x168f69[_0x1fe9da(0xc2)](_0x507b0c),_0x5bfc53[_0x1fe9da(0x124)](_0x4c8706,_0x507b0c);const _0x33d83b=await resolveRuleSegmentRefs(_0x381687,async _0x45d315=>{const _0x195f79=_0x1fe9da,_0x29d495=_0x5bfc53[_0x195f79(0x105)](_0x45d315);if(_0x29d495)return _0x29d495;const _0x6db8c3=await _0x8b92c[_0x195f79(0x195)](_0x45d315);return _0x6db8c3['name'];});_0x34a8ce={'description':_0x4cf6a8[_0x1fe9da(0x110)],'rule':_0x33d83b};}else{const _0x24513b=_0x3e32ad['get'](_0x5f3f34);if(_0x24513b)_0x507b0c=_0x24513b,_0x5bfc53['set'](_0x4c8706,_0x507b0c);else{if(_0x3a5b51){let _0x4e51fa=_0x3a5b51,_0x4abd9a=0x2;while(_0x168f69[_0x1fe9da(0x14a)](_0x4e51fa)||_0x581e8d['has'](_0x4e51fa)){_0x4e51fa=_0x3a5b51+'_'+_0x4abd9a,_0x4abd9a++;}_0x168f69[_0x1fe9da(0xc2)](_0x4e51fa),_0x507b0c=_0x4e51fa;}_0x5bfc53[_0x1fe9da(0x124)](_0x4c8706,_0x507b0c),_0x3e32ad[_0x1fe9da(0x124)](_0x5f3f34,_0x507b0c);const _0x3df523=await resolveRuleSegmentRefs(_0x381687,async _0x10e19e=>{const _0x151934=_0x1fe9da,_0xda3b31=_0x5bfc53['get'](_0x10e19e);if(_0xda3b31)return _0xda3b31;const _0x565fe1=await _0x8b92c[_0x151934(0x195)](_0x10e19e);return _0x565fe1[_0x151934(0x12a)];});_0x34a8ce={'description':_0x4cf6a8['description'],'rule':_0x3df523};}}}return{'name':_0x507b0c,'isJourneyLocal':_0x43d0c2,'definition':_0x34a8ce};}catch(_0xce24d8){return logger[_0x1fe9da(0xc1)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4c8706+':\x20'+_0xce24d8),{'name':_0x4c8706,'isJourneyLocal':![]};}},'resolveActivation':async _0x5ae814=>{const _0x50ac47=a114_0xa69d,_0x1d923b=_0x110ffb[_0x50ac47(0x105)](_0x5ae814);if(_0x1d923b!==undefined)return{'name':_0x1d923b,'isJourneyLocal':!![]};try{let _0x3a0aef=_0x3d2117?.[_0x50ac47(0x105)](_0x5ae814);!_0x3a0aef&&(_0x3a0aef=await _0x316505[_0x50ac47(0x130)]['getActivation'](_0x4b1d0c,_0x5ae814));const _0x369439=_0x3a0aef[_0x50ac47(0x125)][_0x50ac47(0xd6)][_0x50ac47(0x12a)]||_0x5ae814,_0x14c3a0=sanitizeYamlKey(_0x369439)||_0x50ac47(0xec)+_0x5ae814,_0x9bf4ca=_0x14c3a0;_0x110ffb[_0x50ac47(0x124)](_0x5ae814,_0x9bf4ca);const _0x55e6f7=journeyActivationStepToYaml(_0x3a0aef,_0x4a9c74,_0x3dadeb);return{'name':_0x9bf4ca,'isJourneyLocal':!![],'definition':_0x55e6f7};}catch(_0x4d8e4c){return logger[_0x50ac47(0xc1)](_0x50ac47(0x141)+_0x5ae814+':\x20'+_0x4d8e4c),{'name':_0x5ae814,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x290d1c,_0x1f0fd6)=>resolveJumpTarget(_0x290d1c,_0x1f0fd6,_0x31ae2a,async _0x36e9cf=>{const _0x33b1f5=a114_0xa69d,_0x3a664b=_0x48bf8c?.[_0x33b1f5(0x105)](_0x36e9cf);if(_0x3a664b)return _0x3a664b;return _0x316505[_0x33b1f5(0x130)][_0x33b1f5(0x157)](_0x36e9cf);})};return _0x8b92c=_0x4d6f0b,_0x4d6f0b;},_0x41c9ff=async _0x5bddd5=>{const _0x1b1bf8=a114_0xa69d,{collectSegmentIdsFromJourneyApi:_0x13c638}=await import(_0x1b1bf8(0x149)),{batchAsync:_0xac2d75}=await import(_0x1b1bf8(0xf8)),_0x1b892b=new Set();for(const _0x8744b3 of _0x5bddd5){let _0x205413=_0x48bf8c?.[_0x1b1bf8(0x105)](_0x8744b3);!_0x205413&&(_0x205413=await _0x316505['journey']['getJourney'](_0x8744b3));const _0x19a499=_0x13c638(_0x205413);for(const _0x4e5664 of _0x19a499){_0x1b892b[_0x1b1bf8(0xc2)](_0x4e5664);}}let _0x58df7b=Array[_0x1b1bf8(0xe2)](_0x1b892b);while(_0x58df7b['length']>0x0){const _0x4b7963=_0x58df7b[_0x1b1bf8(0x11a)](_0x4432a5=>!_0x5c2b3f['has'](_0x4432a5));if(_0x4b7963['length']===0x0)break;const _0x2ebf1e=await _0xac2d75(_0x4b7963,async _0x194d5f=>{const _0x1d871a=_0x1b1bf8;_0x5c2b3f[_0x1d871a(0xc2)](_0x194d5f);const _0x3ad191=await fetchSegment(_0x316505,_0x3c1aee,_0x194d5f,_0x39b8b1);if(!_0x3ad191)return null;return{'segmentId':_0x194d5f,'segment':_0x3ad191};},0xa),_0x332a2b=new Set();for(const _0x1b356a of _0x2ebf1e){if(!_0x1b356a?.[_0x1b1bf8(0x1a5)]?.[_0x1b1bf8(0x15c)])continue;const _0x591ac7=apiRuleToYaml(_0x1b356a[_0x1b1bf8(0x1a5)][_0x1b1bf8(0x15c)]);_0x303db7[_0x1b1bf8(0x124)](_0x1b356a['segmentId'],_0x591ac7);const _0x10cba0=collectSegmentRefsFromRule(_0x591ac7);for(const _0x3b2906 of _0x10cba0){!_0x5c2b3f[_0x1b1bf8(0x14a)](_0x3b2906)&&_0x332a2b[_0x1b1bf8(0xc2)](_0x3b2906);}}_0x58df7b=Array[_0x1b1bf8(0xe2)](_0x332a2b);}};return{'createYamlContext':_0x45c49b,'prefetchJourneySegments':_0x41c9ff};}export async function executePushSegments(_0x84cff6,_0x49b4d0,_0x3eecba,_0x4680a2,_0x226b3d){const _0x5cf4c4=a114_0x2facc4,{segmentDefToCreateRequest:_0x1ca904,segmentDefToUpdateRequest:_0x252ad2}=await import(_0x5cf4c4(0x17e)),_0x6c4fa0=_0x3eecba[_0x5cf4c4(0x11c)],_0x5f180b=0x5,_0x1ad9ec=async _0x47e96c=>{const _0x5dd084=_0x5cf4c4,_0x28c319=_0x47e96c[_0x5dd084(0xfb)]?_0x6c4fa0[_0x5dd084(0x105)](_0x47e96c[_0x5dd084(0xfb)]):undefined;let _0xe807da;const _0xa87b04={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x47e96c[_0x5dd084(0x19b)]){_0x226b3d[_0x5dd084(0x19d)]?.({'type':_0x5dd084(0x108),'name':_0x47e96c[_0x5dd084(0x17f)][_0x5dd084(0x12a)]});const _0x1b00b4=_0x1ca904(_0x47e96c[_0x5dd084(0x17f)],_0x28c319),_0xb68f6f=await _0x226b3d[_0x5dd084(0x161)](_0x5dd084(0x144)+_0x47e96c[_0x5dd084(0x17f)][_0x5dd084(0x12a)]+_0x5dd084(0x12d),()=>_0x84cff6['segment']['createSegment'](_0x4680a2[_0x5dd084(0x102)],_0x1b00b4));_0xe807da=_0xb68f6f[_0x5dd084(0x1ae)]['id'],_0xa87b04[_0x5dd084(0x16b)]={'name':_0x47e96c[_0x5dd084(0x17f)][_0x5dd084(0x12a)],'id':_0xe807da},_0x226b3d[_0x5dd084(0x19d)]?.({'type':'segment_created','name':_0x47e96c['yamlConfig'][_0x5dd084(0x12a)],'segmentId':_0xe807da}),_0x226b3d[_0x5dd084(0xd0)]?.(_0x5dd084(0xe8)+_0x47e96c[_0x5dd084(0x17f)][_0x5dd084(0x12a)]+'\x27'),_0xa87b04['created']=0x1;}else{if(_0x47e96c[_0x5dd084(0x104)]){_0x226b3d[_0x5dd084(0x19d)]?.({'type':'segment_updating','name':_0x47e96c[_0x5dd084(0x17f)][_0x5dd084(0x12a)]});const _0x2b5c6f=_0x252ad2(_0x47e96c[_0x5dd084(0x17f)]);_0x28c319!==_0x47e96c[_0x5dd084(0x194)]?.['segmentFolderId']&&(_0x2b5c6f[_0x5dd084(0x1b4)]=_0x28c319?parseInt(_0x28c319,0xa):undefined),await _0x226b3d[_0x5dd084(0x161)](_0x5dd084(0x18d)+_0x47e96c['yamlConfig']['name']+'\x27...',()=>_0x84cff6['segment'][_0x5dd084(0x15a)](_0x4680a2['parentId'],_0x47e96c[_0x5dd084(0x194)]['id'],_0x2b5c6f)),_0xe807da=_0x47e96c[_0x5dd084(0x194)]['id'],_0x226b3d[_0x5dd084(0x19d)]?.({'type':_0x5dd084(0x19e),'name':_0x47e96c[_0x5dd084(0x17f)]['name']}),_0x226b3d[_0x5dd084(0xd0)]?.(_0x5dd084(0xdc)+_0x47e96c['yamlConfig'][_0x5dd084(0x12a)]+'\x27'),_0xa87b04[_0x5dd084(0x11b)]=0x1;}else _0xe807da=_0x47e96c['existingSegment']['id'];}}catch(_0x3375fe){const _0x4a69c7=isHttp400Error(_0x3375fe),_0x3fce11=_0x4a69c7?ErrorCode[_0x5dd084(0xe5)]:ErrorCode[_0x5dd084(0x13a)],_0x22a4b1=getErrorMessage(_0x3375fe);throw new SDKError(_0x3fce11,_0x5dd084(0x17b)+(_0x47e96c[_0x5dd084(0x19b)]?_0x5dd084(0x143):_0x5dd084(0x1ba))+_0x5dd084(0x16d)+_0x47e96c[_0x5dd084(0x120)]+_0x5dd084(0xbb)+_0x22a4b1,_0x3375fe);}try{const _0x2666af=await syncActivationsForSegment(_0x84cff6,_0x4680a2['parentId'],_0xe807da,_0x47e96c[_0x5dd084(0x17f)][_0x5dd084(0x12a)],_0x47e96c['activationActions'],_0x226b3d,_0x47e96c[_0x5dd084(0x120)]);_0xa87b04[_0x5dd084(0xbd)]=_0x2666af;}catch(_0x15a79a){if(_0x15a79a instanceof SDKError)throw _0x15a79a;throw new SDKError(ErrorCode[_0x5dd084(0x16c)],_0x5dd084(0xd8)+_0x47e96c[_0x5dd084(0x17f)][_0x5dd084(0x12a)]+_0x5dd084(0x1a6)+_0x47e96c[_0x5dd084(0x120)]+_0x5dd084(0xbb)+getErrorMessage(_0x15a79a),_0x15a79a);}return _0xa87b04;},_0x5754ee=await batchAsync(_0x49b4d0,_0x1ad9ec,_0x5f180b),_0x39e20f={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x4016f1 of _0x5754ee){_0x39e20f[_0x5cf4c4(0x197)]+=_0x4016f1[_0x5cf4c4(0x197)],_0x39e20f[_0x5cf4c4(0x11b)]+=_0x4016f1[_0x5cf4c4(0x11b)],_0x4016f1[_0x5cf4c4(0x16b)]&&_0x39e20f['createdSegmentIds'][_0x5cf4c4(0x124)](_0x4016f1[_0x5cf4c4(0x16b)]['name'],_0x4016f1[_0x5cf4c4(0x16b)]['id']),_0x39e20f[_0x5cf4c4(0xbd)][_0x5cf4c4(0x197)]+=_0x4016f1[_0x5cf4c4(0xbd)][_0x5cf4c4(0x197)],_0x39e20f[_0x5cf4c4(0xbd)]['updated']+=_0x4016f1[_0x5cf4c4(0xbd)]['updated'],_0x39e20f[_0x5cf4c4(0xbd)]['deleted']+=_0x4016f1[_0x5cf4c4(0xbd)][_0x5cf4c4(0x10c)];}return _0x39e20f;}async function syncActivationsForSegment(_0x3b651b,_0x3a8e63,_0x2ebea2,_0x1f90f7,_0x2197a5,_0x3d816a,_0x1dc264){const _0x4ab6af=a114_0x2facc4,_0x2972d2={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x18fbd2 of _0x2197a5){try{if(_0x18fbd2[_0x4ab6af(0x160)]===_0x4ab6af(0x143)&&_0x18fbd2['validatedRequest'])_0x3d816a[_0x4ab6af(0x19d)]?.({'type':_0x4ab6af(0x136),'segmentName':_0x1f90f7,'activationName':_0x18fbd2['name']}),await _0x3d816a['withProgress'](_0x4ab6af(0x101)+_0x18fbd2[_0x4ab6af(0x12a)]+_0x4ab6af(0x12d),()=>_0x3b651b[_0x4ab6af(0x1a5)][_0x4ab6af(0x11f)](_0x3a8e63,_0x2ebea2,_0x18fbd2[_0x4ab6af(0xc9)])),_0x3d816a[_0x4ab6af(0x19d)]?.({'type':'activation_created','segmentName':_0x1f90f7,'activationName':_0x18fbd2['name']}),_0x3d816a[_0x4ab6af(0xd0)]?.(_0x4ab6af(0xee)+_0x18fbd2[_0x4ab6af(0x12a)]+'\x27'),_0x2972d2[_0x4ab6af(0x197)]++;else{if(_0x18fbd2['type']===_0x4ab6af(0x1ba)&&_0x18fbd2['validatedRequest']&&_0x18fbd2[_0x4ab6af(0x156)])_0x3d816a[_0x4ab6af(0x19d)]?.({'type':_0x4ab6af(0x190),'segmentName':_0x1f90f7,'activationName':_0x18fbd2['name']}),await _0x3d816a[_0x4ab6af(0x161)](_0x4ab6af(0xd2)+_0x18fbd2['name']+'\x27...',()=>_0x3b651b['segment'][_0x4ab6af(0x199)](_0x3a8e63,_0x2ebea2,_0x18fbd2[_0x4ab6af(0x156)]['id'],_0x18fbd2[_0x4ab6af(0xc9)])),_0x3d816a[_0x4ab6af(0x19d)]?.({'type':_0x4ab6af(0x112),'segmentName':_0x1f90f7,'activationName':_0x18fbd2[_0x4ab6af(0x12a)]}),_0x3d816a['logSuccess']?.(_0x4ab6af(0x153)+_0x18fbd2[_0x4ab6af(0x12a)]+'\x27'),_0x2972d2['updated']++;else _0x18fbd2[_0x4ab6af(0x160)]===_0x4ab6af(0xda)&&_0x18fbd2[_0x4ab6af(0x156)]&&(_0x3d816a['onProgress']?.({'type':_0x4ab6af(0x11e),'segmentName':_0x1f90f7,'activationName':_0x18fbd2[_0x4ab6af(0x12a)]}),await _0x3d816a['withProgress'](_0x4ab6af(0xc5)+_0x18fbd2[_0x4ab6af(0x12a)]+_0x4ab6af(0x12d),()=>_0x3b651b[_0x4ab6af(0x1a5)][_0x4ab6af(0x137)](_0x3a8e63,_0x2ebea2,_0x18fbd2[_0x4ab6af(0x156)]['id'])),_0x3d816a[_0x4ab6af(0x19d)]?.({'type':_0x4ab6af(0x15f),'segmentName':_0x1f90f7,'activationName':_0x18fbd2[_0x4ab6af(0x12a)]}),_0x3d816a[_0x4ab6af(0x12c)]?.('Deleted\x20activation\x20\x27'+_0x18fbd2['name']+'\x27'),_0x2972d2[_0x4ab6af(0x10c)]++);}}catch(_0x2dfa5a){const _0x3777ee=isHttp400Error(_0x2dfa5a),_0x1f0953=_0x3777ee?ErrorCode[_0x4ab6af(0x19c)]:ErrorCode[_0x4ab6af(0x16c)],_0x373619=getErrorMessage(_0x2dfa5a);throw new SDKError(_0x1f0953,_0x4ab6af(0x17b)+_0x18fbd2[_0x4ab6af(0x160)]+_0x4ab6af(0x12e)+_0x18fbd2[_0x4ab6af(0x12a)]+_0x4ab6af(0x1a6)+_0x1dc264+'\x0a\x20\x20'+_0x373619,_0x2dfa5a);}}return _0x2972d2;}export async function executePushFolders(_0x1ef8b8,_0x4f95bf,_0x3af16e,_0x1637fc,_0x3474a2){const _0x3242c9=a114_0x2facc4,_0x15baac=new Map(_0x3af16e);for(const _0x14a822 of _0x4f95bf){const _0xfeddff=_0x14a822['split']('/'),_0x1b921a=_0xfeddff[_0xfeddff[_0x3242c9(0x145)]-0x1],_0x469941=_0xfeddff[_0x3242c9(0x148)](0x0,-0x1)[_0x3242c9(0x10b)]('/'),_0x26ca8=_0x15baac[_0x3242c9(0x105)](_0x469941);_0x3474a2[_0x3242c9(0x19d)]?.({'type':_0x3242c9(0x18f),'folder':_0x14a822});const _0x28db96={'name':_0x1b921a,'parentFolderId':_0x26ca8},_0x145978=await _0x3474a2[_0x3242c9(0x161)](_0x3242c9(0x1b3)+_0x14a822+'\x27...',()=>_0x1ef8b8[_0x3242c9(0x1a5)][_0x3242c9(0x16a)](_0x1637fc[_0x3242c9(0x102)],_0x28db96));_0x15baac[_0x3242c9(0x124)](_0x14a822,_0x145978[_0x3242c9(0x1ae)]['id']),_0x3474a2[_0x3242c9(0x19d)]?.({'type':'folder_created','folder':_0x14a822,'folderId':_0x145978[_0x3242c9(0x1ae)]['id']}),_0x3474a2[_0x3242c9(0x175)]?.(_0x3242c9(0xdb)+_0x14a822+'\x27');}return _0x15baac;}export async function executePushSegmentDeletions(_0xa1c7b,_0x158269,_0xd761bb){const _0xe33470=a114_0x2facc4;if(_0x158269[_0xe33470(0x145)]===0x0)return 0x0;const {batchAsync:_0x2882c8}=await import(_0xe33470(0xf8)),_0x34d116=0x5,_0x31bc96=await _0x2882c8(_0x158269,async _0x2c8835=>{const _0x9e65fc=_0xe33470;return _0xd761bb[_0x9e65fc(0x19d)]?.({'type':_0x9e65fc(0xfd),'name':_0x2c8835[_0x9e65fc(0x12a)]}),await _0xa1c7b['segment'][_0x9e65fc(0x152)](_0x2c8835['id']),_0xd761bb[_0x9e65fc(0x19d)]?.({'type':_0x9e65fc(0x116),'name':_0x2c8835[_0x9e65fc(0x12a)]}),_0xd761bb[_0x9e65fc(0x12c)]?.(_0x9e65fc(0xbf)+_0x2c8835[_0x9e65fc(0x12a)]+'\x27'),0x1;},_0x34d116);return _0x31bc96[_0xe33470(0x133)]((_0x5ce1ad,_0x4490b7)=>_0x5ce1ad+_0x4490b7,0x0);}export async function executePushJourneys(_0xbeeb87,_0x137a40,_0x2e3bed,_0x455378,_0x3a887e){const _0x588e07=a114_0x2facc4,{journeyDefToRequest:_0x23d3b3}=await import(_0x588e07(0x149)),{activationDefToCreateRequest:_0x119790,yamlRuleToApi:_0x5d32f7,validateSegmentRule:_0x40e71a}=await import('./child-segment-yaml.js'),_0xdce56={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x44bbf7=new Map(_0x2e3bed[_0x588e07(0x168)]),_0x1ef52b=0x5;for(let _0x317a14=0x0;_0x317a14<_0x137a40['length'];_0x317a14+=_0x1ef52b){const _0xe7d967=_0x137a40[_0x588e07(0x148)](_0x317a14,_0x317a14+_0x1ef52b),_0x4906cd=await Promise[_0x588e07(0x174)](_0xe7d967[_0x588e07(0x1b7)](async _0x5531f8=>{const _0x1ad27f=_0x588e07;if(!_0x5531f8[_0x1ad27f(0x19b)]&&!_0x5531f8['hasChanges'])return{'action':_0x1ad27f(0x18a),'name':_0x5531f8[_0x1ad27f(0x17f)]['name'],'journeyId':_0x5531f8['existingJourney']?.['id']};const _0x5955b2=_0x5531f8['folderPath']?_0x2e3bed[_0x1ad27f(0x11c)]['get'](_0x5531f8[_0x1ad27f(0xfb)]):undefined;_0x3a887e['onProgress']?.({'type':_0x5531f8['isNew']?_0x1ad27f(0x18e):'journey_updating','name':_0x5531f8[_0x1ad27f(0x17f)][_0x1ad27f(0x12a)]});try{const _0x35d4f6=await executeSingleJourneyPush(_0xbeeb87,_0x5531f8,{..._0x2e3bed,'segmentNameToId':_0x44bbf7},{'parentId':_0x455378[_0x1ad27f(0x102)],'rootFolderId':_0x455378[_0x1ad27f(0x167)],'folderId':_0x5955b2,'verbose':_0x455378[_0x1ad27f(0x158)]},_0x3a887e,{'journeyDefToRequest':_0x23d3b3,'activationDefToCreateRequest':_0x119790,'yamlRuleToApi':_0x5d32f7,'validateSegmentRule':_0x40e71a});for(const [_0x5df3ff,_0x22fc08]of _0x35d4f6[_0x1ad27f(0x12f)]){_0x44bbf7[_0x1ad27f(0x124)](_0x5df3ff,_0x22fc08),_0xdce56[_0x1ad27f(0x12f)][_0x1ad27f(0x124)](_0x5df3ff,_0x22fc08);}if(_0x35d4f6['action']===_0x1ad27f(0x197))_0x3a887e[_0x1ad27f(0x19d)]?.({'type':_0x1ad27f(0x18b),'name':_0x5531f8[_0x1ad27f(0x17f)][_0x1ad27f(0x12a)],'journeyId':_0x35d4f6['journeyId']}),_0x3a887e[_0x1ad27f(0xd0)]?.(_0x1ad27f(0x106)+_0x5531f8['yamlConfig'][_0x1ad27f(0x12a)]+'\x27'),_0xdce56['created']++;else _0x35d4f6['action']===_0x1ad27f(0x11b)&&(_0x3a887e[_0x1ad27f(0x19d)]?.({'type':_0x1ad27f(0x164),'name':_0x5531f8['yamlConfig'][_0x1ad27f(0x12a)]}),_0x3a887e[_0x1ad27f(0xd0)]?.('Updated\x20journey\x20\x27'+_0x5531f8[_0x1ad27f(0x17f)][_0x1ad27f(0x12a)]+'\x27'),_0xdce56[_0x1ad27f(0x11b)]++);return{'action':_0x35d4f6[_0x1ad27f(0xf7)],'name':_0x5531f8[_0x1ad27f(0x17f)]['name'],'journeyId':_0x35d4f6['journeyId']};}catch(_0x1eeac8){const _0x3e8eb1=isHttp400Error(_0x1eeac8),_0x268166=_0x3e8eb1?ErrorCode[_0x1ad27f(0x193)]:ErrorCode[_0x1ad27f(0xb8)],_0x5603cb=getErrorMessage(_0x1eeac8);throw new SDKError(_0x268166,_0x1ad27f(0x17b)+(_0x5531f8[_0x1ad27f(0x19b)]?_0x1ad27f(0x143):_0x1ad27f(0x1ba))+_0x1ad27f(0x115)+_0x5531f8[_0x1ad27f(0x120)]+_0x1ad27f(0xbb)+_0x5603cb,_0x1eeac8);}}));_0xdce56['results'][_0x588e07(0x1a4)](..._0x4906cd);}return _0xdce56;}async function matchExistingJourneySegments(_0x4c15b5,_0x504db2,_0x10a578,_0x2b727b,_0x3392e5){const _0x575c8c=a114_0x2facc4;if(!_0x504db2[_0x575c8c(0x1a8)]||!_0x504db2[_0x575c8c(0x17f)][_0x575c8c(0xba)])return;const _0x115226=new Map();for(const _0x3d9052 of Object[_0x575c8c(0x1aa)](_0x504db2['yamlConfig']['segments'])){const _0x4ffe1c=generateDeterministicJourneySegmentName(_0x504db2[_0x575c8c(0x17f)][_0x575c8c(0x12a)],_0x3d9052);_0x115226[_0x575c8c(0x124)](_0x4ffe1c,_0x3d9052);}const _0x1fb887=collectSegmentIdsFromJourneyApi(_0x504db2[_0x575c8c(0x1a8)]);for(const _0x362c60 of _0x1fb887){const _0x218ea1=await fetchSegment(_0x4c15b5,_0x10a578,_0x362c60,_0x2b727b);if(!_0x218ea1?.[_0x575c8c(0x12a)])continue;const _0xaf0d72=_0x115226[_0x575c8c(0x105)](_0x218ea1['name']);_0xaf0d72&&_0x3392e5[_0x575c8c(0x124)](_0xaf0d72,_0x362c60);}}async function executeSingleJourneyPush(_0x281f1c,_0x116ad7,_0x3af5,_0x2ac87b,_0x20e967,_0x3e49e6){const _0x10daa9=a114_0x2facc4,{journeyDefToRequest:_0x281f55,activationDefToCreateRequest:_0x1c6b5e,yamlRuleToApi:_0x30b8e0,validateSegmentRule:_0x269dd8}=_0x3e49e6,_0x163d18=new Map(),_0x5b3b3=new Map();recoverSegmentIdsFromPushRecovery(_0x116ad7,_0x163d18,_0x3af5[_0x10daa9(0x168)]);const _0x32bc6e=new Map(),_0x8aa6de=new Map(),_0x4fb4ae=new Map();let _0x5e825b;const _0x1c5d0d=async()=>{const _0x6565db=_0x10daa9;if(_0x5e825b)return;_0x5e825b=new Map();if(!_0x116ad7[_0x6565db(0x1a8)])return;const _0x29dd12=await _0x281f1c[_0x6565db(0x130)][_0x6565db(0x11d)](_0x116ad7[_0x6565db(0x1a8)]['id']);for(const _0x5870d0 of _0x29dd12){const _0x1081ff=journeyActivationStepToYaml(_0x5870d0,_0x3af5[_0x6565db(0xb9)],_0x3af5['connectionIdToNameMap']),_0x375255=activationSignature(_0x1081ff);!_0x5e825b['has'](_0x375255)&&_0x5e825b[_0x6565db(0x124)](_0x375255,_0x5870d0['id']),_0x1081ff[_0x6565db(0x12a)]&&_0x5b3b3[_0x6565db(0x124)](_0x1081ff[_0x6565db(0x12a)],_0x5870d0['id']);}};await matchExistingJourneySegments(_0x281f1c,_0x116ad7,_0x2ac87b['parentId'],_0x3af5[_0x10daa9(0x118)],_0x3af5[_0x10daa9(0x168)]);const _0x237a5e={'resolveSegmentId':async _0x2fa43b=>{const _0x3cdd03=_0x10daa9,_0x533009=_0x3af5['segmentNameToId'][_0x3cdd03(0x105)](_0x2fa43b);if(!_0x533009)throw new SDKError(ErrorCode[_0x3cdd03(0x177)],_0x3cdd03(0xfe)+_0x2fa43b+_0x3cdd03(0x1bb)+_0x116ad7[_0x3cdd03(0x17f)][_0x3cdd03(0x12a)]+')');return _0x533009;},'resolveEmbeddedSegmentId':async(_0x10f5a4,_0x339fee)=>{const _0x70d96f=_0x10daa9,_0x3613f9=_0x3af5[_0x70d96f(0x168)]['get'](_0x10f5a4);if(_0x3613f9)return _0x3613f9;const _0x3d6da7=_0x3af5[_0x70d96f(0x118)][_0x70d96f(0x103)](_0x49b3ed=>_0x49b3ed[_0x70d96f(0x12a)]===_0x10f5a4);if(_0x3d6da7)return _0x3af5[_0x70d96f(0x168)]['set'](_0x10f5a4,_0x3d6da7['id']),_0x3d6da7['id'];if(_0x116ad7[_0x70d96f(0x19b)]){const {stageName:_0x1a8c76,criteriaName:_0x1ecb3a}=findSegmentCriteriaLocation(_0x116ad7[_0x70d96f(0x17f)],_0x10f5a4);return _0x269dd8(_0x10f5a4,_0x339fee['rule']),_0x8aa6de[_0x70d96f(0x124)](_0x10f5a4,{'definition':_0x339fee,'stageName':_0x1a8c76,'criteriaName':_0x1ecb3a}),createPendingSegmentId(_0x10f5a4);}const _0x45f165=_0x116ad7[_0x70d96f(0x1a8)]?.['id'];if(!_0x45f165)throw new SDKError(ErrorCode['INTERNAL'],_0x70d96f(0x16e));const _0x46643e=_0x32bc6e[_0x70d96f(0x105)](_0x10f5a4);if(_0x46643e)return _0x46643e;const _0x10d3e4=((async()=>{const _0x48d485=_0x70d96f;_0x269dd8(_0x10f5a4,_0x339fee['rule']);const _0x9144c4=generateDeterministicJourneySegmentName(_0x116ad7[_0x48d485(0x17f)][_0x48d485(0x12a)],_0x10f5a4),_0x289924=_0x3af5[_0x48d485(0x118)][_0x48d485(0x103)](_0x4d1508=>_0x4d1508[_0x48d485(0x12a)]===_0x9144c4),_0x2245c1=createSegmentIdResolver(_0x3af5[_0x48d485(0x168)],_0x10f5a4),_0xff2c43=await resolveRuleSegmentIds(_0x339fee[_0x48d485(0x15c)],_0x2245c1);let _0x40f896;return _0x289924?(await _0x281f1c['segment']['updateSegmentById'](_0x2ac87b[_0x48d485(0x102)],_0x289924['id'],{'description':_0x339fee[_0x48d485(0x110)]||'Entry\x20criteria:\x20'+_0x10f5a4,'rule':_0x30b8e0(_0xff2c43,!![]),'countPopulation':!![]}),_0x40f896=_0x289924['id'],saveSegmentToPushRecovery(_0x116ad7[_0x48d485(0x120)],_0x116ad7[_0x48d485(0x17f)][_0x48d485(0x12a)],_0x10f5a4,{'segmentId':_0x40f896,'uniqueServerName':_0x9144c4,'createdAt':new Date()['toISOString']()})):_0x40f896=await createOrRecoverEmbeddedSegment(_0x281f1c,_0x116ad7,{'localName':_0x10f5a4,'uniqueSegmentName':_0x9144c4,'description':_0x339fee[_0x48d485(0x110)]||_0x48d485(0x172)+_0x10f5a4,'journeyId':_0x45f165,'resolvedRule':_0xff2c43,'parentId':_0x2ac87b[_0x48d485(0x102)],'folderId':_0x2ac87b[_0x48d485(0x167)]||''},_0x30b8e0),_0x3af5[_0x48d485(0x168)][_0x48d485(0x124)](_0x10f5a4,_0x40f896),_0x163d18[_0x48d485(0x124)](_0x10f5a4,_0x40f896),_0x40f896;})());_0x32bc6e[_0x70d96f(0x124)](_0x10f5a4,_0x10d3e4);try{return await _0x10d3e4;}finally{_0x32bc6e[_0x70d96f(0xda)](_0x10f5a4);}},'resolveActivationId':async _0x406a45=>{const _0x29b6c3=_0x10daa9,_0xb5e0b1=_0x5b3b3[_0x29b6c3(0x105)](_0x406a45);if(_0xb5e0b1)return _0xb5e0b1;if(_0x116ad7[_0x29b6c3(0x1a8)]){await _0x1c5d0d();const _0x1fce1f=_0x5b3b3[_0x29b6c3(0x105)](_0x406a45);if(_0x1fce1f)return _0x1fce1f;}throw new SDKError(ErrorCode[_0x29b6c3(0x151)],_0x29b6c3(0x13f)+_0x406a45+_0x29b6c3(0x1bb)+_0x116ad7[_0x29b6c3(0x17f)]['name']+_0x29b6c3(0x1a0)+_0x29b6c3(0x187));},'resolveEmbeddedActivationId':async(_0xc15f4e,_0x181dcb)=>{const _0x14196a=_0x10daa9,_0x38207b=_0x5b3b3[_0x14196a(0x105)](_0xc15f4e);if(_0x38207b)return _0x38207b;if(_0x116ad7[_0x14196a(0x19b)])return _0x4fb4ae[_0x14196a(0x124)](_0xc15f4e,_0x181dcb),createPendingActivationId(_0xc15f4e);if(_0x116ad7[_0x14196a(0x1a8)]){await _0x1c5d0d();const _0x52242b=_0x5b3b3[_0x14196a(0x105)](_0x181dcb[_0x14196a(0x12a)]);if(_0x52242b)return _0x5b3b3['set'](_0xc15f4e,_0x52242b),_0x52242b;const _0x1d7cc4=activationSignature(_0x181dcb),_0x592618=_0x5e825b?.[_0x14196a(0x105)](_0x1d7cc4);if(_0x592618)return _0x5b3b3[_0x14196a(0x124)](_0xc15f4e,_0x592618),_0x592618;const _0x1577f6=await _0x1c6b5e(_0x181dcb,_0x3af5[_0x14196a(0x123)]),_0x4396b1={..._0x1577f6,..._0x181dcb['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x181dcb['run_after_journey_refresh']}},_0x3f762d=await _0x281f1c[_0x14196a(0x130)]['createActivation'](_0x116ad7[_0x14196a(0x1a8)]['id'],_0x4396b1);return _0x5b3b3[_0x14196a(0x124)](_0xc15f4e,_0x3f762d['id']),_0x3f762d['id'];}throw new SDKError(ErrorCode['INTERNAL'],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x300f36=>{const _0x120daa=_0x10daa9;try{return await _0x281f1c[_0x120daa(0x130)][_0x120daa(0x15b)](_0x2ac87b['parentId'],_0x300f36);}catch(_0x4527be){throw new SDKError(ErrorCode[_0x120daa(0x151)],_0x120daa(0x15d)+_0x300f36+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x116ad7[_0x120daa(0x17f)][_0x120daa(0x12a)]+'\x27)',_0x4527be);}},'resolveStageId':async(_0x4e6f23,_0x4e807c)=>{const _0x2d7c4c=_0x10daa9,_0x43d869=await _0x281f1c[_0x2d7c4c(0x130)]['getJourney'](_0x4e6f23),_0x50349e=_0x43d869[_0x2d7c4c(0x125)][_0x2d7c4c(0x150)][_0x2d7c4c(0x103)](_0x578966=>_0x578966[_0x2d7c4c(0x12a)][_0x2d7c4c(0x17c)]()===_0x4e807c['toLowerCase']());if(!_0x50349e?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x4e807c+_0x2d7c4c(0x154)+(_0x43d869[_0x2d7c4c(0x125)]['journeyBundleName']||_0x43d869['attributes']['name'])+'\x27');return _0x50349e['id'];}},_0x344c2a=await _0x281f55(_0x116ad7[_0x10daa9(0x17f)],_0x2ac87b[_0x10daa9(0x102)],_0x237a5e),_0xc9f97d=_0x2ac87b['folderId']||_0x2ac87b[_0x10daa9(0x167)];_0xc9f97d&&(_0x344c2a[_0x10daa9(0x15e)]={'parentFolder':{'data':{'id':_0xc9f97d,'type':_0x10daa9(0x128)}}});if(_0x116ad7['isNew']){if(_0x8aa6de[_0x10daa9(0x122)]>0x0||_0x4fb4ae['size']>0x0)return await executeThreeStepJourneyCreate(_0x281f1c,_0x116ad7,_0x344c2a,{'pendingEmbeddedSegments':_0x8aa6de,'pendingEmbeddedActivations':_0x4fb4ae,'embeddedSegmentNameToId':_0x163d18,'journeyActivationNameToId':_0x5b3b3},{..._0x2ac87b,'effectiveFolderId':_0xc9f97d},_0x3af5,_0x20e967,_0x3e49e6);else{ensureJourneyDefaults(_0x344c2a[_0x10daa9(0x125)]);const _0x5bea01=await _0x281f1c[_0x10daa9(0x130)][_0x10daa9(0x143)](_0x344c2a);return deletePushRecovery(_0x116ad7['absolutePath']),{'action':_0x10daa9(0x197),'journeyId':_0x5bea01['id'],'embeddedSegmentNameToId':_0x163d18};}}else{if(_0x116ad7['hasChanges']&&_0x116ad7[_0x10daa9(0x1a8)])return ensureJourneyDefaults(_0x344c2a[_0x10daa9(0x125)]),await _0x281f1c[_0x10daa9(0x130)][_0x10daa9(0x1ba)](_0x116ad7[_0x10daa9(0x1a8)]['id'],_0x344c2a),deletePushRecovery(_0x116ad7['absolutePath']),{'action':_0x10daa9(0x11b),'journeyId':_0x116ad7[_0x10daa9(0x1a8)]['id'],'embeddedSegmentNameToId':_0x163d18};}return deletePushRecovery(_0x116ad7[_0x10daa9(0x120)]),{'action':_0x10daa9(0x18a),'journeyId':_0x116ad7[_0x10daa9(0x1a8)]?.['id'],'embeddedSegmentNameToId':_0x163d18};}function findSegmentCriteriaLocation(_0x58b11d,_0x23f4f4){const _0x38d3f7=a114_0x2facc4,_0x2dc1fa=_0x58b11d[_0x38d3f7(0x178)]||_0x58b11d['journeys']?.[0x0]?.['stages']||[];let _0x1916a0=_0x38d3f7(0x132),_0x1d263b=_0x23f4f4;const _0x2be2f4=_0x58b11d['goal']||_0x58b11d['journeys']?.[0x0]?.[_0x38d3f7(0x1b5)];if(_0x2be2f4?.[_0x38d3f7(0x1a5)]===_0x23f4f4)return{'stageName':'goal','criteriaName':_0x2be2f4['name']||_0x23f4f4};_0x4dcb5f:for(const _0x48d0e7 of _0x2dc1fa){if(_0x48d0e7[_0x38d3f7(0x10e)]?.[_0x38d3f7(0x1a5)]===_0x23f4f4){_0x1916a0=_0x48d0e7[_0x38d3f7(0x12a)],_0x1d263b=_0x48d0e7[_0x38d3f7(0x10e)][_0x38d3f7(0x12a)]||_0x23f4f4;break;}if(_0x48d0e7[_0x38d3f7(0x17a)])for(const _0x33312f of _0x48d0e7[_0x38d3f7(0x17a)]){if(_0x33312f['type']===_0x38d3f7(0xe7)&&_0x33312f[_0x38d3f7(0x10f)]?.[_0x38d3f7(0x13c)])for(const _0x2372f6 of _0x33312f[_0x38d3f7(0x10f)][_0x38d3f7(0x13c)]){if(_0x2372f6[_0x38d3f7(0x1a5)]===_0x23f4f4){_0x1916a0=_0x48d0e7['name'],_0x1d263b=_0x2372f6['name']||_0x23f4f4;break _0x4dcb5f;}}}}return{'stageName':_0x1916a0,'criteriaName':_0x1d263b};}async function executeThreeStepJourneyCreate(_0x444e30,_0x61f9de,_0x3d095f,_0x38eff8,_0x125b2f,_0x103c6c,_0x55d878,_0x201daa){const _0x2c45ea=a114_0x2facc4,{activationDefToCreateRequest:_0xd9fbbc,yamlRuleToApi:_0x50de2f}=_0x201daa,{pendingEmbeddedSegments:_0x2e76e2,pendingEmbeddedActivations:_0xe6caac,embeddedSegmentNameToId:_0xf78496}=_0x38eff8,_0xa6f27d=JSON[_0x2c45ea(0x189)](JSON[_0x2c45ea(0xdd)](_0x3d095f));ensureJourneyDefaults(_0xa6f27d[_0x2c45ea(0x125)]),stripPendingIds(_0xa6f27d);const _0x20082e=await _0x444e30['journey'][_0x2c45ea(0x143)](_0xa6f27d),_0x2ce071=_0x20082e['id'],_0x1d0600=new Map();for(const _0xc69727 of _0x20082e[_0x2c45ea(0x125)][_0x2c45ea(0x150)]){_0x1d0600[_0x2c45ea(0x124)](_0xc69727[_0x2c45ea(0x12a)][_0x2c45ea(0x17c)](),_0xc69727['id']);}recoverSegmentIdsFromPushRecovery(_0x61f9de,_0xf78496,_0x103c6c[_0x2c45ea(0x168)]);for(const [_0x53cdd6,{definition:_0x628090}]of _0x2e76e2){if(_0xf78496['has'](_0x53cdd6)){_0x55d878[_0x2c45ea(0x19d)]?.({'type':_0x2c45ea(0x163),'journeyName':_0x61f9de[_0x2c45ea(0x17f)][_0x2c45ea(0x12a)],'segmentName':_0x53cdd6});continue;}const _0x1a5463=generateDeterministicJourneySegmentName(_0x61f9de['yamlConfig'][_0x2c45ea(0x12a)],_0x53cdd6);_0x55d878['onProgress']?.({'type':_0x2c45ea(0x183),'journeyName':_0x61f9de['yamlConfig'][_0x2c45ea(0x12a)],'segmentName':_0x53cdd6});const _0x51f87b=createSegmentIdResolver(_0x103c6c['segmentNameToId'],_0x53cdd6),_0x33b2bc=await resolveRuleSegmentIds(_0x628090[_0x2c45ea(0x15c)],_0x51f87b),_0x1c219e=await createOrRecoverEmbeddedSegment(_0x444e30,_0x61f9de,{'localName':_0x53cdd6,'uniqueSegmentName':_0x1a5463,'description':_0x628090[_0x2c45ea(0x110)]||_0x2c45ea(0x172)+_0x53cdd6,'journeyId':_0x2ce071,'resolvedRule':_0x33b2bc,'parentId':_0x125b2f[_0x2c45ea(0x102)],'folderId':_0x125b2f[_0x2c45ea(0xe6)]||''},_0x50de2f);_0xf78496[_0x2c45ea(0x124)](_0x53cdd6,_0x1c219e),_0x103c6c[_0x2c45ea(0x168)][_0x2c45ea(0x124)](_0x53cdd6,_0x1c219e),_0x55d878[_0x2c45ea(0x19d)]?.({'type':_0x2c45ea(0x163),'journeyName':_0x61f9de['yamlConfig'][_0x2c45ea(0x12a)],'segmentName':_0x53cdd6});}const _0x17204a=new Map();for(const [_0x55edf2,_0x209d60]of _0xe6caac){_0x55d878[_0x2c45ea(0x19d)]?.({'type':_0x2c45ea(0xe3),'journeyName':_0x61f9de[_0x2c45ea(0x17f)][_0x2c45ea(0x12a)],'activationName':_0x55edf2});const _0x30da6b=await _0xd9fbbc(_0x209d60,_0x103c6c['activationContext']),_0xdcf25b={..._0x30da6b,..._0x209d60[_0x2c45ea(0x100)]!==undefined&&{'runAfterJourneyRefresh':_0x209d60['run_after_journey_refresh']}},_0x5aa48f=await _0x444e30[_0x2c45ea(0x130)][_0x2c45ea(0x11f)](_0x2ce071,_0xdcf25b);_0x17204a[_0x2c45ea(0x124)](_0x55edf2,_0x5aa48f['id']),_0x38eff8['journeyActivationNameToId'][_0x2c45ea(0x124)](_0x55edf2,_0x5aa48f['id']),_0x55d878['onProgress']?.({'type':_0x2c45ea(0xbc),'journeyName':_0x61f9de[_0x2c45ea(0x17f)][_0x2c45ea(0x12a)],'activationName':_0x55edf2});}const _0x1c2364=JSON[_0x2c45ea(0x189)](JSON[_0x2c45ea(0xdd)](_0x3d095f));return _0x1c2364['id']=_0x2ce071,ensureJourneyDefaults(_0x1c2364[_0x2c45ea(0x125)]),resolvePendingIdsInRequest(_0x1c2364,_0x3d095f,_0x1d0600,_0xf78496,_0x17204a,_0x55d878),await _0x444e30['journey'][_0x2c45ea(0x1ba)](_0x2ce071,_0x1c2364),deletePushRecovery(_0x61f9de[_0x2c45ea(0x120)]),{'action':'created','journeyId':_0x2ce071,'embeddedSegmentNameToId':_0xf78496};}export function stripWaitStepPendingIds(_0x2e9479){const _0x4317d1=a114_0x2facc4,_0x361e66=_0x2e9479[_0x4317d1(0xf6)]&&isPendingSegmentId(_0x2e9479[_0x4317d1(0xf6)]),_0x500fb6=_0x2e9479[_0x4317d1(0x18c)]?.[_0x4317d1(0xf9)](_0x35a08d=>_0x35a08d[_0x4317d1(0x1b1)]&&isPendingSegmentId(_0x35a08d[_0x4317d1(0x1b1)]));(_0x361e66||_0x500fb6)&&(_0x2e9479[_0x4317d1(0xce)]=_0x4317d1(0x14c),_0x2e9479['waitStep']=0x1,_0x2e9479[_0x4317d1(0x169)]='day',delete _0x2e9479[_0x4317d1(0xf6)],delete _0x2e9479[_0x4317d1(0x1b0)],delete _0x2e9479['conditionTimeoutUnit'],delete _0x2e9479[_0x4317d1(0x18c)]);}export function resolveWaitStepPendingIds(_0x2c5522,_0x4e10c0,_0x54c713,_0x584e53){const _0x2e40d2=a114_0x2facc4;if(_0x4e10c0[_0x2e40d2(0xf6)]&&isPendingSegmentId(_0x4e10c0[_0x2e40d2(0xf6)])){const _0x337c31=_0x54c713(_0x4e10c0[_0x2e40d2(0xf6)],_0x2e40d2(0x13b)+_0x584e53+'\x27\x20wait\x20condition');_0x337c31&&(_0x2c5522[_0x2e40d2(0xce)]=_0x2e40d2(0x134),_0x2c5522[_0x2e40d2(0xf6)]=_0x337c31,delete _0x2c5522[_0x2e40d2(0xd4)],delete _0x2c5522[_0x2e40d2(0x169)],_0x4e10c0[_0x2e40d2(0x1b0)]!==undefined&&(_0x2c5522[_0x2e40d2(0x1b0)]=_0x4e10c0[_0x2e40d2(0x1b0)]),_0x4e10c0[_0x2e40d2(0x1b2)]&&(_0x2c5522[_0x2e40d2(0x1b2)]=_0x4e10c0[_0x2e40d2(0x1b2)]));}if(_0x4e10c0[_0x2e40d2(0x18c)]){const _0x3e1c3a=_0x4e10c0[_0x2e40d2(0x18c)]['some'](_0x4c2316=>_0x4c2316[_0x2e40d2(0x1b1)]&&isPendingSegmentId(_0x4c2316[_0x2e40d2(0x1b1)]));if(_0x3e1c3a){const _0x55eaf9=_0x4e10c0[_0x2e40d2(0x18c)][_0x2e40d2(0x1b7)](_0x4dc444=>{const _0x2b82b9=_0x2e40d2;if(_0x4dc444[_0x2b82b9(0x1b1)]&&isPendingSegmentId(_0x4dc444[_0x2b82b9(0x1b1)])){const _0x2e6e6b=_0x54c713(_0x4dc444[_0x2b82b9(0x1b1)],'stage\x20\x27'+_0x584e53+_0x2b82b9(0xff));return{..._0x4dc444,'segmentId':_0x2e6e6b||_0x4dc444[_0x2b82b9(0x1b1)]};}return{..._0x4dc444};});_0x2c5522[_0x2e40d2(0xce)]='Condition',_0x2c5522[_0x2e40d2(0x18c)]=_0x55eaf9,delete _0x2c5522[_0x2e40d2(0xd4)],delete _0x2c5522[_0x2e40d2(0x169)],delete _0x2c5522[_0x2e40d2(0xf6)],delete _0x2c5522['conditionTimeoutDuration'],delete _0x2c5522[_0x2e40d2(0x1b2)];}}}function stripPendingIds(_0x343de4){const _0xe0e813=a114_0x2facc4;_0x343de4[_0xe0e813(0x125)][_0xe0e813(0x1b5)]?.['segmentId']&&isPendingSegmentId(_0x343de4[_0xe0e813(0x125)]['goal'][_0xe0e813(0x1b1)])&&delete _0x343de4['attributes'][_0xe0e813(0x1b5)];for(const _0x1f8ce7 of _0x343de4['attributes'][_0xe0e813(0x150)]||[]){_0x1f8ce7[_0xe0e813(0xed)]?.[_0xe0e813(0x1b1)]&&isPendingSegmentId(_0x1f8ce7[_0xe0e813(0xed)][_0xe0e813(0x1b1)])&&delete _0x1f8ce7[_0xe0e813(0xed)];_0x1f8ce7[_0xe0e813(0x166)]?.['segmentId']&&isPendingSegmentId(_0x1f8ce7[_0xe0e813(0x166)]['segmentId'])&&delete _0x1f8ce7['milestone'];_0x1f8ce7[_0xe0e813(0x191)]&&(_0x1f8ce7[_0xe0e813(0x191)]=_0x1f8ce7[_0xe0e813(0x191)][_0xe0e813(0x11a)](_0x29fe5b=>!_0x29fe5b[_0xe0e813(0x1b1)]||!isPendingSegmentId(_0x29fe5b[_0xe0e813(0x1b1)])));if(_0x1f8ce7[_0xe0e813(0x17a)])for(const _0x3ed470 of Object[_0xe0e813(0x1aa)](_0x1f8ce7[_0xe0e813(0x17a)])){const _0x27682a=_0x1f8ce7['steps'][_0x3ed470];_0x27682a['type']===_0xe0e813(0x159)&&_0x27682a[_0xe0e813(0xfc)]&&isPendingActivationId(_0x27682a[_0xe0e813(0xfc)])&&(_0x27682a[_0xe0e813(0xfc)]='');if(_0x27682a[_0xe0e813(0x160)]===_0xe0e813(0xe1)&&_0x27682a[_0xe0e813(0x13c)])for(const _0xb43d7e of _0x27682a['branches']){_0xb43d7e[_0xe0e813(0x1b1)]&&isPendingSegmentId(_0xb43d7e[_0xe0e813(0x1b1)])&&(_0xb43d7e[_0xe0e813(0x1b1)]='');}_0x27682a[_0xe0e813(0x160)]===_0xe0e813(0x117)&&stripWaitStepPendingIds(_0x27682a);}}}function resolvePendingIdsInRequest(_0x2bfa65,_0xd161ed,_0x33d67c,_0x104916,_0x411fc3,_0x4f9ae0){const _0x2bbb61=a114_0x2facc4,_0x57aa50=(_0x594cb1,_0x48100c)=>{const _0x1270fd=a114_0xa69d;if(!isPendingSegmentId(_0x594cb1))return _0x594cb1;const _0xcb59e6=extractPendingSegmentName(_0x594cb1),_0xafcb78=_0x104916[_0x1270fd(0x105)](_0xcb59e6);return!_0xafcb78&&_0x4f9ae0[_0x1270fd(0xf3)]?.(_0x1270fd(0x10a)+_0xcb59e6+'\x27\x20for\x20'+_0x48100c),_0xafcb78;};if(_0x2bfa65[_0x2bbb61(0x125)][_0x2bbb61(0x1b5)]?.[_0x2bbb61(0x1b1)]&&isPendingSegmentId(_0x2bfa65[_0x2bbb61(0x125)][_0x2bbb61(0x1b5)][_0x2bbb61(0x1b1)])){const _0x2b74da=_0x57aa50(_0x2bfa65[_0x2bbb61(0x125)][_0x2bbb61(0x1b5)][_0x2bbb61(0x1b1)],_0x2bbb61(0xd3));_0x2b74da&&(_0x2bfa65[_0x2bbb61(0x125)][_0x2bbb61(0x1b5)][_0x2bbb61(0x1b1)]=_0x2b74da);}for(const _0xabed3f of _0x2bfa65[_0x2bbb61(0x125)][_0x2bbb61(0x150)]||[]){const _0x5f2f1f=_0x33d67c[_0x2bbb61(0x105)](_0xabed3f[_0x2bbb61(0x12a)]['toLowerCase']());_0x5f2f1f&&(_0xabed3f['id']=_0x5f2f1f);if(_0xabed3f[_0x2bbb61(0xed)]?.[_0x2bbb61(0x1b1)]&&isPendingSegmentId(_0xabed3f[_0x2bbb61(0xed)][_0x2bbb61(0x1b1)])){const _0x29ca24=_0x57aa50(_0xabed3f[_0x2bbb61(0xed)]['segmentId'],'stage\x20\x27'+_0xabed3f[_0x2bbb61(0x12a)]+'\x27\x20entry\x20criteria');_0x29ca24&&(_0xabed3f[_0x2bbb61(0xed)][_0x2bbb61(0x1b1)]=_0x29ca24);}if(_0xabed3f[_0x2bbb61(0x191)])for(const _0x2c1702 of _0xabed3f[_0x2bbb61(0x191)]){if(_0x2c1702[_0x2bbb61(0x1b1)]&&isPendingSegmentId(_0x2c1702[_0x2bbb61(0x1b1)])){const _0x421484=_0x57aa50(_0x2c1702[_0x2bbb61(0x1b1)],_0x2bbb61(0x13b)+_0xabed3f[_0x2bbb61(0x12a)]+_0x2bbb61(0x1b9));_0x421484&&(_0x2c1702[_0x2bbb61(0x1b1)]=_0x421484);}}if(_0xabed3f[_0x2bbb61(0x166)]?.['segmentId']&&isPendingSegmentId(_0xabed3f[_0x2bbb61(0x166)][_0x2bbb61(0x1b1)])){const _0x31e024=_0x57aa50(_0xabed3f[_0x2bbb61(0x166)][_0x2bbb61(0x1b1)],'stage\x20\x27'+_0xabed3f[_0x2bbb61(0x12a)]+_0x2bbb61(0x13d));_0x31e024&&(_0xabed3f[_0x2bbb61(0x166)]['segmentId']=_0x31e024);}if(_0xabed3f['steps']){const _0x415eec=_0x1e3380=>_0xd161ed['attributes'][_0x2bbb61(0x150)]?.[_0x2bbb61(0x103)](_0x527b3b=>_0x527b3b[_0x2bbb61(0x12a)][_0x2bbb61(0x17c)]()===_0xabed3f[_0x2bbb61(0x12a)]['toLowerCase']())?.[_0x2bbb61(0x17a)]?.[_0x1e3380];for(const _0x2bd3bf of Object[_0x2bbb61(0x1aa)](_0xabed3f[_0x2bbb61(0x17a)])){const _0xee351d=_0xabed3f['steps'][_0x2bd3bf],_0x2311c8=_0x415eec(_0x2bd3bf);if(_0xee351d[_0x2bbb61(0x160)]===_0x2bbb61(0x159)&&_0xee351d[_0x2bbb61(0xfc)]&&(isPendingActivationId(_0xee351d[_0x2bbb61(0xfc)])||_0xee351d['journeyActivationStepId']==='')){if(_0x2311c8?.[_0x2bbb61(0xfc)]&&isPendingActivationId(_0x2311c8[_0x2bbb61(0xfc)])){const _0x1a1676=extractPendingActivationName(_0x2311c8[_0x2bbb61(0xfc)]),_0x5b9318=_0x411fc3[_0x2bbb61(0x105)](_0x1a1676);_0x5b9318&&(_0xee351d['journeyActivationStepId']=_0x5b9318);}}if(_0xee351d[_0x2bbb61(0x160)]===_0x2bbb61(0xe1)&&_0xee351d[_0x2bbb61(0x13c)]&&_0x2311c8?.[_0x2bbb61(0x13c)])for(let _0x51357e=0x0;_0x51357e<_0xee351d['branches'][_0x2bbb61(0x145)];_0x51357e++){const _0xdfdfd0=_0xee351d[_0x2bbb61(0x13c)][_0x51357e],_0xca33fc=_0x2311c8['branches'][_0x51357e];if(_0xca33fc?.['segmentId']&&isPendingSegmentId(_0xca33fc[_0x2bbb61(0x1b1)])){const _0x2cbdcb=_0x57aa50(_0xca33fc['segmentId'],_0x2bbb61(0x13b)+_0xabed3f[_0x2bbb61(0x12a)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0xdfdfd0[_0x2bbb61(0x12a)]||_0x51357e)+'\x27');_0x2cbdcb&&(_0xdfdfd0['segmentId']=_0x2cbdcb);}}_0xee351d[_0x2bbb61(0x160)]===_0x2bbb61(0x117)&&_0x2311c8?.[_0x2bbb61(0x160)]==='WaitStep'&&resolveWaitStepPendingIds(_0xee351d,_0x2311c8,_0x57aa50,_0xabed3f[_0x2bbb61(0x12a)]);}}}}
|
|
1
|
+
const a115_0x188509=a115_0x4469;(function(_0xa29033,_0x918927){const _0x5d0404=a115_0x4469,_0x4a7094=_0xa29033();while(!![]){try{const _0x7d9971=-parseInt(_0x5d0404(0x1b2))/0x1+-parseInt(_0x5d0404(0x1f9))/0x2+-parseInt(_0x5d0404(0x21f))/0x3+-parseInt(_0x5d0404(0x212))/0x4*(-parseInt(_0x5d0404(0x285))/0x5)+parseInt(_0x5d0404(0x213))/0x6+-parseInt(_0x5d0404(0x228))/0x7*(parseInt(_0x5d0404(0x276))/0x8)+parseInt(_0x5d0404(0x22a))/0x9;if(_0x7d9971===_0x918927)break;else _0x4a7094['push'](_0x4a7094['shift']());}catch(_0x28cb47){_0x4a7094['push'](_0x4a7094['shift']());}}}(a115_0x35b7,0x643b8));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a115_0x188509(0x21c));export const PENDING_SEGMENT_PREFIX=a115_0x188509(0x1c5);export const PENDING_ACTIVATION_PREFIX=a115_0x188509(0x1b4);export function createPendingSegmentId(_0x3dce9e){return''+PENDING_SEGMENT_PREFIX+_0x3dce9e+'__';}export function isPendingSegmentId(_0x257c68){const _0x12f4f0=a115_0x188509;return _0x257c68[_0x12f4f0(0x263)](PENDING_SEGMENT_PREFIX)&&!_0x257c68[_0x12f4f0(0x263)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x5564cb){const _0x37ae88=a115_0x188509;return _0x5564cb[_0x37ae88(0x281)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x1a9cf8){return''+PENDING_ACTIVATION_PREFIX+_0x1a9cf8+'__';}export function isPendingActivationId(_0x3e9599){return _0x3e9599['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x233bcb){const _0x14cd61=a115_0x188509;return _0x233bcb[_0x14cd61(0x281)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x2d4e55,_0x54ca5b){const _0x2420cb=a115_0x188509,_0x413324=_0x2d4e55+'::'+(_0x54ca5b['trim']()||_0x2420cb(0x1db)),_0x3952e9=createHash('sha1')[_0x2420cb(0x289)](_0x413324)[_0x2420cb(0x1ef)]('hex')[_0x2420cb(0x238)](0x0,0xc);return _0x2420cb(0x1ca)+_0x3952e9;}export function ensureJourneyDefaults(_0x1e3dc3){const _0x156bb4=a115_0x188509;!_0x1e3dc3[_0x156bb4(0x1b7)]&&(_0x1e3dc3[_0x156bb4(0x1b7)]=''),!_0x1e3dc3['state']&&(_0x1e3dc3[_0x156bb4(0x28b)]=_0x156bb4(0x29b));}export function resolveTDFolderPath(_0x5cfa81,_0x2171fe,_0x3991e2){if(!_0x2171fe)return _0x5cfa81;if(_0x5cfa81===_0x3991e2||_0x5cfa81['startsWith'](_0x3991e2+'/'))return _0x5cfa81;return _0x5cfa81?_0x3991e2+'/'+_0x5cfa81:_0x3991e2;}export function addFoldersToCreate(_0x4ead26,_0x3c373b,_0x48855d){const _0x46a901=a115_0x188509;if(!_0x4ead26)return;if(_0x3c373b[_0x46a901(0x26e)](_0x4ead26))return;const _0x2a8e76=_0x4ead26[_0x46a901(0x216)]('/');let _0x69f20='';for(const _0x4f0bc3 of _0x2a8e76){_0x69f20=_0x69f20?_0x69f20+'/'+_0x4f0bc3:_0x4f0bc3,!_0x3c373b[_0x46a901(0x26e)](_0x69f20)&&_0x48855d[_0x46a901(0x29d)](_0x69f20);}}function a115_0x35b7(){const _0x563db4=['rootFolderId','milestone','segment_created','toISOString','segment_updated','uniqueSegmentName','embedded_activation_created','created','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x27\x20milestone','waitStepUnit','delete','Updated\x20journey\x20\x27','startsWith','message','deleted','relative','activations','idToEmailMap','Embedded\x20segment\x20\x27','segmentFolderId','Segment\x20not\x20found','hasChanges','\x20journey\x20from\x20file:\x20','has','SEGMENT_NOT_FOUND','folderPathToId','logDeleted','folderId','../../utils/async.js','notification','conditions','24nAPNqY','all_columns','waitStep','activation_updating','\x27\x20from\x20file:\x20','sort','buildUserMaps','Creating\x20segment\x20\x27','journey_updated','idToName','conditionTimeoutUnit','replace','connector_config','parse','Name\x20has\x20already\x20been\x20taken','695aquUhO','):\x20','map','getSegmentEntity\x20also\x20failed\x20for\x20','update','skipSegments','state','Journey\x20\x27','logWarning','object','updateSegmentById','effectiveFolderId','segmentId','NOT_FOUND','item','journeyBundleName','fetchJourney','index','reduce','with','diff','action','draft','getSegmentEntity','add','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','getActivation','deps','activation_creating','Failed\x20to\x20','activation_deleted','errors','.$1.push-recovery.json','run_after_journey_refresh','Activation','schedule','resolveSegment','size','\x20(referenced\x20in\x20journey\x20','activationActions','Created\x20segment\x20\x27','day','./journey-yaml.js','parseDocument','Creating\x20activation\x20\x27','createActivation','deleteActivation','columns','89229SSnUGV','existingSegment','__pending_act_','nameToId','list','description','null','./child-segment-yaml.js','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','segment_creating','journeyBundlesByFolderAndName','stringify','journeyName','conditionTimeoutDuration','goal','existingSegments','updateActivation','valid','existingActivation','__pending_','\x27\x20decision\x20point\x20branch\x20\x27','activation_','journeys','find','journey_entry_criteria_','uniqueServerName','Updated\x20activation\x20\x27','\x27\x20exit\x20criteria','logInfo','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','conditionSegmentId','some','parentSegmentFolder','segmentByFolderAndName','absolutePath','folderPath','behavior','steps','listActivations','journeyId','validatedRequest','segment','from','createdSegmentId','data','SEGMENT_SYNTAX_ERROR','get','Condition','entries','journey_created','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Deleted\x20segment\x20\x27','activation_created','branches','max','segment_deleted','activationContext','activation_template_id','create','resolveJourneyId','utf-8','digest','existingJourney','\x27\x20wait\x20condition','getSegment','exitCriterias','length','toLowerCase','unchanged','stage\x20\x27','journeyActivationStepId','618674XkyECY','\x27\x20for\x20','isArray','ACTIVATION_UPDATE_ERROR','Updating\x20activation\x20\x27','toString','attributes','relationships','Updated\x20segment\x20\x27','segments','Created\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','set','name','debug','journeyById','Updating\x20segment\x20\x27',').\x20','WaitStep','join','segment_updating','entryCriteria','Fetching\x20','parentId','yamlConfig','11292SAYrHM','3277410qtfZTz','folder_created','journey','split','journey_updating','activation_deleting','Deleted\x20activation\x20\x27','progress','folder_creating','tdx.sdk.push-workflow','isNew','withProgress','852606CboEzS','embedded_segment_creating','INTERNAL','embedded_segment_created','getJourney','logSuccess','journeyActivationNameToId','deleteSegment','resolvedRule','1627605oQvSHr','embeddedSegmentNameToId','7670097uvJPia','journey_creating','connection','\x27\x20entry\x20criteria','Failed\x20to\x20resolve\x20activation\x20','waitStepType','Created\x20journey\x20\x27','type','createFolder','keys','activation_updated','\x27...','segmentNameToId','filter','slice','decision_point','connectionIdToNameMap','goal\x20criteria','activationStepsById','onProgress','user','\x0a\x20\x20','\x20segment\x20from\x20file:\x20','yamlActivation','getSegment\x20failed\x20for\x20','updated','versionNumber','SEGMENT_UPDATE_ERROR','folder','kind','Creating\x20folder\x20\x27','createSegment',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','all','Entry\x20criteria:\x20','DecisionPoint','results','stages','Duration','rule','journeyStages','dirname','and\x20the\x20server\x20segment,\x20then\x20retry.','push'];a115_0x35b7=function(){return _0x563db4;};return a115_0x35b7();}import*as a115_0x535900 from'yaml';import{readFileSync}from'fs';import a115_0x435f13 from'path';import{isJourneyDef,parseYamlString as a115_0x3766b9,toYamlString as a115_0x2c6f0e,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(_0x564030){const _0x1692ee=a115_0x188509;if(Array[_0x1692ee(0x1fb)](_0x564030))return'['+_0x564030[_0x1692ee(0x287)](_0x4edfb6=>stableStringify(_0x4edfb6))[_0x1692ee(0x20c)](',')+']';if(_0x564030&&typeof _0x564030===_0x1692ee(0x28e)){const _0x25e16f=_0x564030,_0x5b61de=Object['keys'](_0x25e16f)[_0x1692ee(0x27b)](),_0x2e91f9=_0x5b61de[_0x1692ee(0x287)](_0x357d10=>'\x22'+_0x357d10+'\x22:'+stableStringify(_0x25e16f[_0x357d10]));return'{'+_0x2e91f9[_0x1692ee(0x20c)](',')+'}';}const _0x404a02=JSON[_0x1692ee(0x1bd)](_0x564030);return _0x404a02===undefined?_0x1692ee(0x1b8):_0x404a02;}function activationSignature(_0x5b001b){const _0x4df17f=a115_0x188509,_0x40cf8c={'connection':_0x5b001b[_0x4df17f(0x22c)],..._0x5b001b[_0x4df17f(0x277)]!==undefined&&{'all_columns':_0x5b001b[_0x4df17f(0x277)]},..._0x5b001b[_0x4df17f(0x1b1)]!==undefined&&{'columns':_0x5b001b['columns']},..._0x5b001b[_0x4df17f(0x1d6)]!==undefined&&{'behavior':_0x5b001b[_0x4df17f(0x1d6)]},..._0x5b001b[_0x4df17f(0x1a5)]!==undefined&&{'schedule':_0x5b001b[_0x4df17f(0x1a5)]},..._0x5b001b[_0x4df17f(0x274)]!==undefined&&{'notification':_0x5b001b['notification']},..._0x5b001b['connector_config']!==undefined&&{'connector_config':_0x5b001b[_0x4df17f(0x282)]},..._0x5b001b['activation_template_id']!==undefined&&{'activation_template_id':_0x5b001b[_0x4df17f(0x1eb)]}};return stableStringify(_0x40cf8c);}async function fetchSegment(_0x64e022,_0x413ebb,_0x299f9c,_0x13374a){const _0x59db66=a115_0x188509,_0x53b105=_0x13374a?.[_0x59db66(0x1c9)](_0x25bb95=>_0x25bb95['id']===_0x299f9c);if(_0x53b105)return _0x53b105;try{return await _0x64e022['segment'][_0x59db66(0x1f2)](_0x413ebb,_0x299f9c);}catch(_0x522ac7){logger[_0x59db66(0x207)](_0x59db66(0x242)+_0x299f9c+_0x59db66(0x24a)+_0x522ac7);try{return await _0x64e022[_0x59db66(0x1db)][_0x59db66(0x29c)](_0x299f9c);}catch(_0x316760){return logger['debug'](_0x59db66(0x288)+_0x299f9c+':\x20'+_0x316760),null;}}}function recoverSegmentIdsFromPushRecovery(_0xe900e0,_0x25a89e,_0x5ee377){const _0x283ac7=a115_0x188509,_0x7761e2=readPushRecovery(_0xe900e0[_0x283ac7(0x1d4)]);if(_0x7761e2?.['journeyName']===_0xe900e0['yamlConfig'][_0x283ac7(0x206)])for(const [_0x4ec5ff,_0x107f10]of Object[_0x283ac7(0x1e2)](_0x7761e2['segments'])){const _0x35cd8f=generateDeterministicJourneySegmentName(_0xe900e0[_0x283ac7(0x211)]['name'],_0x4ec5ff);_0x107f10[_0x283ac7(0x1cb)]===_0x35cd8f&&(_0x25a89e[_0x283ac7(0x205)](_0x4ec5ff,_0x107f10[_0x283ac7(0x291)]),_0x5ee377[_0x283ac7(0x205)](_0x4ec5ff,_0x107f10['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x46cb4f,_0x1b8e21,_0x589135,_0x437c07){const _0x679fe8=a115_0x188509;let _0x390433;try{_0x390433=await _0x46cb4f[_0x679fe8(0x1db)]['createJourneySegment']({'name':_0x589135[_0x679fe8(0x25b)],'description':_0x589135[_0x679fe8(0x1b7)],'journeyId':_0x589135[_0x679fe8(0x1d9)],'rule':_0x437c07(_0x589135['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0x589135[_0x679fe8(0x272)],'audienceId':_0x589135[_0x679fe8(0x210)]});}catch(_0x13e38b){const _0x1d9eea=_0x13e38b instanceof Error&&_0x13e38b[_0x679fe8(0x264)]['includes'](_0x679fe8(0x284));if(_0x1d9eea){const _0xfb2a85=readPushRecovery(_0x1b8e21[_0x679fe8(0x1d4)]),_0x144680=_0xfb2a85?.[_0x679fe8(0x1be)]===_0x1b8e21['yamlConfig'][_0x679fe8(0x206)]?_0xfb2a85[_0x679fe8(0x202)][_0x589135['localName']]:undefined;if(_0x144680?.[_0x679fe8(0x1cb)]===_0x589135[_0x679fe8(0x25b)])await _0x46cb4f[_0x679fe8(0x1db)][_0x679fe8(0x28f)](_0x589135[_0x679fe8(0x210)],_0x144680[_0x679fe8(0x291)],{'description':_0x589135[_0x679fe8(0x1b7)],'rule':_0x437c07(_0x589135[_0x679fe8(0x227)],!![]),'countPopulation':!![]}),_0x390433=_0x144680[_0x679fe8(0x291)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x679fe8(0x269)+_0x589135['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x1b8e21['absolutePath'][_0x679fe8(0x281)](/([^/]+)$/,_0x679fe8(0x1a2))+')\x20')+_0x679fe8(0x254),_0x13e38b);}else throw _0x13e38b;}return saveSegmentToPushRecovery(_0x1b8e21[_0x679fe8(0x1d4)],_0x1b8e21[_0x679fe8(0x211)][_0x679fe8(0x206)],_0x589135['localName'],{'segmentId':_0x390433,'uniqueServerName':_0x589135[_0x679fe8(0x25b)],'createdAt':new Date()[_0x679fe8(0x259)]()}),_0x390433;}export async function prepareSegmentFiles(_0x5f1a1f,_0x597a89,_0x37da29,_0x51b6bc,_0x560723){const _0x215e86=a115_0x188509,{activationDefToCreateRequest:_0x3a356c}=await import(_0x215e86(0x1b9)),_0x706c17=[],_0xfd9ac8=new Set();for(const {yamlConfig:_0x2ee7f4,folderPath:_0x16c70d,sourcePath:_0x5118e0}of _0x5f1a1f){const _0xb3309a=resolveTDFolderPath(_0x16c70d,_0x51b6bc,_0x560723),_0x2f319a=_0xb3309a+':'+_0x2ee7f4[_0x215e86(0x206)],_0x433748=_0x597a89[_0x215e86(0x1d3)][_0x215e86(0x1e0)](_0x2f319a),_0x50b3b4=_0x433748?_0x597a89['activationsBySegmentId'][_0x215e86(0x1e0)](_0x433748['id'])||[]:[];addFoldersToCreate(_0xb3309a,_0x597a89[_0x215e86(0x270)],_0xfd9ac8);const _0x1c0c9f=calculateActivationActions(_0x2ee7f4[_0x215e86(0x267)]||[],_0x50b3b4,_0x597a89['idToEmailMap'],_0x597a89[_0x215e86(0x23a)]);for(const _0x4c2b84 of _0x1c0c9f){(_0x4c2b84[_0x215e86(0x231)]==='create'||_0x4c2b84[_0x215e86(0x231)]===_0x215e86(0x289))&&_0x4c2b84[_0x215e86(0x241)]&&(_0x4c2b84[_0x215e86(0x1da)]=await _0x3a356c(_0x4c2b84['yamlActivation'],_0x37da29));}const _0x5cd1ba=calculateSegmentDiff(_0x2ee7f4,_0x433748,_0x50b3b4,_0x597a89[_0x215e86(0x268)],_0x597a89['connectionIdToNameMap']);_0x706c17[_0x215e86(0x255)]({'relativePath':_0x2ee7f4[_0x215e86(0x206)],'absolutePath':_0x5118e0,'yamlConfig':_0x2ee7f4,'folderPath':_0xb3309a,'existingSegment':_0x433748,'existingActivations':_0x50b3b4,'isNew':_0x5cd1ba[_0x215e86(0x21d)],'hasChanges':_0x5cd1ba[_0x215e86(0x26c)],'diff':_0x5cd1ba[_0x215e86(0x299)],'activationActions':_0x1c0c9f});}return{'segmentFiles':_0x706c17,'foldersToCreate':_0xfd9ac8};}export async function prepareJourneyFiles(_0x9631d0,_0x857acb,_0x19c80b,_0x2d43c9){const _0x548886=a115_0x188509,_0x3883d5=[],_0x1dd584=new Set();for(const {yamlConfig:_0x45dc5d,folderPath:_0x38ba5d,sourcePath:_0x247db9}of _0x9631d0){const _0x1a8b91=resolveTDFolderPath(_0x38ba5d,_0x19c80b,_0x2d43c9),_0x4d76f6=_0x1a8b91+':'+_0x45dc5d[_0x548886(0x206)],_0x585fd1=_0x857acb[_0x548886(0x1bc)][_0x548886(0x1e0)](_0x4d76f6);let _0x265371,_0x2bcaf5;if(_0x585fd1&&_0x585fd1['length']>0x0){const _0xe013c8=buildLocalExpandedRuleMappings(_0x45dc5d),{createYamlContext:_0x1d8d75,prefetchJourneySegments:_0x18d6ff}=createPushYamlContextForBundle(_0x857acb[_0x548886(0x2a0)],_0x857acb[_0x548886(0x210)],_0x857acb[_0x548886(0x1c1)],_0xe013c8,_0x857acb[_0x548886(0x268)],_0x857acb['connectionIdToNameMap'],_0x857acb[_0x548886(0x23c)],_0x857acb[_0x548886(0x208)]);await _0x18d6ff(_0x585fd1['map'](_0x3fd3af=>_0x3fd3af['id']));const _0x3ebc35=hasMultipleVersions(_0x45dc5d),_0x30d777=async _0x58dd9c=>{const _0x4248fe=_0x548886,_0x260cd2=_0x857acb[_0x4248fe(0x208)]?.['get'](_0x58dd9c);if(_0x260cd2)return _0x260cd2;return _0x857acb[_0x4248fe(0x295)]({'journeyId':_0x58dd9c,'journeyName':_0x45dc5d[_0x4248fe(0x206)],'isMultiVersion':_0x585fd1[_0x4248fe(0x1f4)]>0x1});};if(_0x3ebc35&&_0x585fd1[_0x548886(0x1f4)]>0x1){const _0x2a53de=[];for(const _0x3efecd of _0x585fd1){const _0x508995=_0x3efecd[_0x548886(0x244)]||0x1;_0x857acb['progress']?.[_0x548886(0x289)](_0x548886(0x20f)+_0x45dc5d[_0x548886(0x206)]+'\x20v'+_0x508995);const _0x426b02=await _0x30d777(_0x3efecd['id']),_0x50db60=_0x1d8d75(_0x3efecd['id']),_0x181b39=await journeyResponseToDef(_0x426b02,_0x50db60);_0x2a53de[_0x548886(0x255)]({'item':_0x3efecd,'yaml':_0x181b39});}const _0x18456e=buildLocalRuleToNameMappingFromJourney(_0x45dc5d);_0x2bcaf5=buildMergedJourneyDef(_0x2a53de,_0x18456e);const _0x5bc789=Math[_0x548886(0x1e8)](..._0x2a53de[_0x548886(0x287)](_0x37c10f=>_0x37c10f[_0x548886(0x293)]['versionNumber']||0x0)),_0x532edb=_0x585fd1[_0x548886(0x1c9)](_0x380db5=>(_0x380db5['versionNumber']||0x0)===_0x5bc789);_0x532edb&&(_0x857acb[_0x548886(0x21a)]?.[_0x548886(0x289)]('Fetching\x20'+_0x45dc5d[_0x548886(0x206)]+'\x20v'+_0x5bc789),_0x265371=await _0x30d777(_0x532edb['id']));}else{const _0x3099b4=_0x585fd1[_0x585fd1[_0x548886(0x1f4)]-0x1];_0x857acb['progress']?.['update'](_0x548886(0x20f)+_0x45dc5d['name']),_0x265371=await _0x30d777(_0x3099b4['id']);const _0x3cd910=_0x1d8d75(_0x3099b4['id']),_0x5ab180=await journeyResponseToDef(_0x265371,_0x3cd910),_0x31daf1=buildLocalRuleToNameMappingFromJourney(_0x45dc5d);_0x2bcaf5=buildMergedJourneyDef([{'item':_0x3099b4,'yaml':_0x5ab180}],_0x31daf1);}}addFoldersToCreate(_0x1a8b91,_0x857acb['folderPathToId'],_0x1dd584);const _0x2c1226=calculateJourneyDiff(_0x45dc5d,_0x2bcaf5);_0x3883d5[_0x548886(0x255)]({'relativePath':_0x45dc5d[_0x548886(0x206)],'absolutePath':_0x247db9,'yamlConfig':_0x45dc5d,'folderPath':_0x1a8b91,'existingJourney':_0x265371,'isNew':_0x2c1226[_0x548886(0x21d)],'hasChanges':_0x2c1226['hasChanges'],'diff':_0x2c1226[_0x548886(0x299)]});}return{'journeyFiles':_0x3883d5,'foldersToCreate':_0x1dd584};}export function calculateActivationActions(_0x253d13,_0x86e5ba,_0x5f23b4,_0x4c549e){const _0x2a9dc2=a115_0x188509,_0x387f96=[],_0x4028f0=new Map();for(const _0x449b10 of _0x86e5ba){_0x4028f0[_0x2a9dc2(0x205)](_0x449b10['name'],_0x449b10);}const _0x2253f8=new Map();for(const _0x46378e of _0x253d13){_0x2253f8[_0x2a9dc2(0x205)](_0x46378e['name'],_0x46378e);}for(const _0x608ad1 of _0x253d13){const _0x53e6b3=_0x4028f0[_0x2a9dc2(0x1e0)](_0x608ad1['name']);if(!_0x53e6b3)_0x387f96[_0x2a9dc2(0x255)]({'type':_0x2a9dc2(0x1ec),'name':_0x608ad1[_0x2a9dc2(0x206)],'yamlActivation':_0x608ad1});else{const _0x5d460b=activationResponseToDef(_0x53e6b3,_0x5f23b4,_0x4c549e),_0x5aad05=a115_0x535900[_0x2a9dc2(0x1bd)](_0x5d460b),_0x65fcfc=a115_0x535900[_0x2a9dc2(0x1bd)](_0x608ad1);_0x5aad05!==_0x65fcfc&&_0x387f96['push']({'type':_0x2a9dc2(0x289),'name':_0x608ad1[_0x2a9dc2(0x206)],'yamlActivation':_0x608ad1,'existingActivation':_0x53e6b3});}}for(const _0xb6226d of _0x86e5ba){!_0x2253f8['has'](_0xb6226d[_0x2a9dc2(0x206)])&&_0x387f96[_0x2a9dc2(0x255)]({'type':_0x2a9dc2(0x261),'name':_0xb6226d[_0x2a9dc2(0x206)],'existingActivation':_0xb6226d});}return _0x387f96;}function calculateYamlDiff(_0x37543f,_0xb7bd9f){if(_0xb7bd9f){const _0x7a0cbd=generateDiff(_0xb7bd9f,_0x37543f),_0x3e20a2=hasChanges(_0x7a0cbd);return{'isNew':![],'hasChanges':_0x3e20a2,'diff':_0x3e20a2?formatDiffWithColors(_0x7a0cbd):undefined};}const _0x212eae=generateDiff('',_0x37543f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x212eae)};}export function calculateSegmentDiff(_0x10514a,_0x4223df,_0x1a46a1,_0x17e89e,_0x278732){const _0x4b1b71=segmentToYamlString(_0x10514a),_0x1e5ceb=_0x4223df?segmentToYamlString(segmentWithActivationsToYaml(_0x4223df,_0x1a46a1,undefined,_0x17e89e,_0x278732)):undefined;return calculateYamlDiff(_0x4b1b71,_0x1e5ceb);}export function calculateJourneyDiff(_0x27e4e1,_0x4aa3c8){const _0x3b5c21=normalizeJourneyDef(_0x27e4e1,_0x27e4e1),_0x4955aa=a115_0x2c6f0e(_0x3b5c21),_0x23831f=_0x4aa3c8?a115_0x2c6f0e(normalizeJourneyDef(_0x4aa3c8,_0x27e4e1)):undefined;return calculateYamlDiff(_0x4955aa,_0x23831f);}export function findSegmentsToDelete(_0x14f181,_0x26fbe5,_0x32523a,_0x3f76f6,_0x14d286){const _0x2f6c48=a115_0x188509,_0x11e301=new Set();for(const {yamlConfig:_0x1f5bfd,folderPath:_0x3b710c}of _0x26fbe5){_0x11e301[_0x2f6c48(0x29d)](_0x3b710c+':'+_0x1f5bfd[_0x2f6c48(0x206)]);}return _0x14f181[_0x2f6c48(0x237)](_0x195ebc=>{const _0x40d00a=_0x2f6c48,_0x49b371=_0x195ebc['segmentFolderId']?_0x32523a[_0x40d00a(0x1e0)](_0x195ebc[_0x40d00a(0x26a)][_0x40d00a(0x1fe)]())||'':'',_0x4f736f=_0x49b371+':'+_0x195ebc['name'];if(_0x11e301[_0x40d00a(0x26e)](_0x4f736f))return![];if(_0x14d286)return _0x49b371===_0x3f76f6||_0x49b371[_0x40d00a(0x263)](_0x3f76f6+'/');return!![];});}export function findJourneysToDelete(_0xacf26f,_0x1a4631,_0x2588d6,_0x164695,_0x468689){const _0x2a3e12=a115_0x188509,_0x1892ba=new Set();for(const {yamlConfig:_0x253428,folderPath:_0x44eab6}of _0x1a4631){_0x1892ba[_0x2a3e12(0x29d)](_0x44eab6+':'+_0x253428[_0x2a3e12(0x206)]);}return _0xacf26f['filter'](_0x2024a4=>{const _0x37de84=_0x2a3e12,_0x888e4a=_0x2024a4['folderId']?_0x2588d6[_0x37de84(0x1e0)](_0x2024a4['folderId'])||'':'',_0x438490=_0x888e4a+':'+_0x2024a4[_0x37de84(0x294)];if(_0x1892ba[_0x37de84(0x26e)](_0x438490))return![];if(_0x468689)return _0x888e4a===_0x164695||_0x888e4a[_0x37de84(0x263)](_0x164695+'/');return!![];});}export function buildSegmentLookupMap(_0x18aedc,_0x25618b){const _0x54c4f5=a115_0x188509,_0x2bd708=new Map();for(const _0x2efc86 of _0x18aedc){const _0x4cc389=_0x2efc86[_0x54c4f5(0x26a)]?_0x25618b[_0x54c4f5(0x1e0)](_0x2efc86[_0x54c4f5(0x26a)][_0x54c4f5(0x1fe)]())||'':'',_0x33cc58=_0x4cc389+':'+_0x2efc86[_0x54c4f5(0x206)];_0x2bd708[_0x54c4f5(0x205)](_0x33cc58,_0x2efc86);}return _0x2bd708;}export function buildSegmentNameToIdMap(_0x1b38d0){const _0xf90d36=a115_0x188509,_0x351690=new Map();for(const _0x1a8380 of _0x1b38d0){_0x351690[_0xf90d36(0x205)](_0x1a8380[_0xf90d36(0x206)],_0x1a8380['id']);}return _0x351690;}export function buildJourneyBundleLookupMap(_0x2e59c4,_0xb14731){const _0x6cc297=a115_0x188509,_0x4d2e55=new Map();for(const _0x3aacfa of _0x2e59c4){const _0x24dbf6=_0x3aacfa['folderId']?_0xb14731['get'](_0x3aacfa['folderId'])||'':'',_0x5112a3=_0x24dbf6+':'+_0x3aacfa[_0x6cc297(0x294)];!_0x4d2e55[_0x6cc297(0x26e)](_0x5112a3)&&_0x4d2e55[_0x6cc297(0x205)](_0x5112a3,[]),_0x4d2e55[_0x6cc297(0x1e0)](_0x5112a3)[_0x6cc297(0x255)](_0x3aacfa);}for(const _0x47ca8d of _0x4d2e55['values']()){_0x47ca8d['sort']((_0x2ad73d,_0x40f0cb)=>(_0x2ad73d['versionNumber']||0x0)-(_0x40f0cb[_0x6cc297(0x244)]||0x0));}return _0x4d2e55;}export function collectFoldersToCreate(_0xe5b249,_0x23a66b){const _0x4a928e=a115_0x188509,_0x2eddcc=new Set();for(const _0x8abe9b of _0xe5b249){if(!_0x8abe9b)continue;if(_0x23a66b[_0x4a928e(0x26e)](_0x8abe9b))continue;const _0x151054=_0x8abe9b['split']('/');let _0x308819='';for(const _0x42da83 of _0x151054){_0x308819=_0x308819?_0x308819+'/'+_0x42da83:_0x42da83,!_0x23a66b[_0x4a928e(0x26e)](_0x308819)&&_0x2eddcc[_0x4a928e(0x29d)](_0x308819);}}return _0x2eddcc;}export function parseAndClassifyYamlFiles(_0x43866a,_0x44e2cb,_0x26e9fd){const _0x26a098=a115_0x188509,_0xebd802=[],_0x4b166f=[];for(const _0x534387 of _0x43866a){const _0x47d57c=a115_0x435f13[_0x26a098(0x266)](_0x44e2cb,a115_0x435f13[_0x26a098(0x253)](_0x534387)),_0x1d6e5f=_0x47d57c==='.'?'':_0x47d57c,_0x9dc4ba=readFileSync(_0x534387,_0x26a098(0x1ee)),_0xf1e755=a115_0x535900[_0x26a098(0x283)](_0x9dc4ba);if(isJourneyDef(_0xf1e755)){const _0x5657db=a115_0x3766b9(_0x9dc4ba);_0x4b166f[_0x26a098(0x255)]({'yamlConfig':_0x5657db,'folderPath':_0x1d6e5f,'sourcePath':_0x534387});}else{if(!_0x26e9fd?.[_0x26a098(0x28a)]){const _0x91b7f0=parseSegmentYamlFile(_0x9dc4ba),_0x2004cd=normalizeChildSegmentYaml(_0x91b7f0);_0xebd802[_0x26a098(0x255)]({'yamlConfig':_0x2004cd,'folderPath':_0x1d6e5f,'sourcePath':_0x534387});}}}return{'segments':_0xebd802,'journeys':_0x4b166f};}export function validateParsedFiles(_0x16c51a,_0x40a861){const _0xed3292=a115_0x188509,_0x44ea91=[];for(const {yamlConfig:_0x3d8474,sourcePath:_0x7d6183}of _0x16c51a[_0xed3292(0x202)]){const _0x4ae17f=readFileSync(_0x7d6183,_0xed3292(0x1ee)),_0x5832fe=a115_0x535900[_0xed3292(0x1ad)](_0x4ae17f),_0x37010a=validateSegmentDef(_0x3d8474,{'source':_0x4ae17f,'document':_0x5832fe});if(!_0x37010a['valid']){const _0x302d14=a115_0x435f13[_0xed3292(0x266)](_0x40a861,_0x7d6183);_0x44ea91['push']({'filePath':_0x302d14,'source':_0x4ae17f,'result':_0x37010a,'isJourney':![]});}}for(const {yamlConfig:_0x9d0f16,sourcePath:_0x137645}of _0x16c51a[_0xed3292(0x1c8)]){const _0x2550ec=readFileSync(_0x137645,'utf-8'),_0x22b084=a115_0x535900[_0xed3292(0x1ad)](_0x2550ec),_0x51b797=validateJourneyDef(_0x9d0f16,{'source':_0x2550ec,'document':_0x22b084});if(!_0x51b797[_0xed3292(0x1c3)]){const _0xa0a4fd=a115_0x435f13[_0xed3292(0x266)](_0x40a861,_0x137645);_0x44ea91[_0xed3292(0x255)]({'filePath':_0xa0a4fd,'source':_0x2550ec,'result':_0x51b797,'isJourney':!![]});}}return _0x44ea91;}export function formatValidationErrors(_0x2e4707){const _0x403d2b=a115_0x188509,_0x24ec44=[];for(const {filePath:_0xfb7ad9,source:_0x32108e,result:_0x2c3bf0,isJourney:_0x4a5781}of _0x2e4707){const _0x34cda0=_0x4a5781?_0x403d2b(0x215):_0x403d2b(0x1db);_0x24ec44[_0x403d2b(0x255)]('\x0a'+_0xfb7ad9+'\x20('+_0x34cda0+_0x403d2b(0x286)+_0x2c3bf0[_0x403d2b(0x2a4)][_0x403d2b(0x1f4)]+'\x20error(s)'),_0x24ec44[_0x403d2b(0x255)](formatValidationResult(_0x2c3bf0,_0x32108e,_0xfb7ad9));}return _0x24ec44['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x4fb65e){const _0xe09df7=a115_0x188509,_0x38d864=new Set(),_0x2d4de0=new Map(),_0x3a6ec3=collectSegmentUsageCounts(_0x4fb65e);if(_0x4fb65e[_0xe09df7(0x202)])for(const [_0x3fce9b,_0x523241]of Object['entries'](_0x4fb65e['segments'])){_0x38d864[_0xe09df7(0x29d)](_0x3fce9b);if(_0x523241[_0xe09df7(0x251)]){const _0x1c37f4=yamlRuleToApi(_0x523241[_0xe09df7(0x251)]),_0x47d161=apiRuleToYaml(_0x1c37f4);_0x2d4de0[_0xe09df7(0x205)](_0x3fce9b,_0x47d161);}}const _0x1dcb44=new Map();let _0x1c9ab4=0x0;for(const [_0x4d160e,_0x29805b]of _0x2d4de0){const _0x458c49=serializeExpandedRule(_0x29805b,_0x2d4de0),_0xe39a2d=_0x1dcb44[_0xe09df7(0x1e0)](_0x458c49)||[];_0xe39a2d['push']({'name':_0x4d160e,'index':_0x1c9ab4}),_0x1dcb44[_0xe09df7(0x205)](_0x458c49,_0xe39a2d),_0x1c9ab4++;}const _0x6010c4=new Map();for(const [_0x33165d,_0x249165]of _0x1dcb44){const _0x2c716b=_0x249165[_0xe09df7(0x238)]()[_0xe09df7(0x27b)]((_0x47840e,_0x4d7061)=>{const _0x2635dc=_0xe09df7,_0x1bb065=_0x3a6ec3[_0x2635dc(0x1e0)](_0x47840e['name'])||0x0,_0x2a7be9=_0x3a6ec3[_0x2635dc(0x1e0)](_0x4d7061[_0x2635dc(0x206)])||0x0;if(_0x1bb065!==_0x2a7be9)return _0x2a7be9-_0x1bb065;return _0x47840e[_0x2635dc(0x296)]-_0x4d7061[_0x2635dc(0x296)];})[_0xe09df7(0x287)](_0x36ab61=>_0x36ab61[_0xe09df7(0x206)]),_0x1229d5=[];for(const _0x11878e of _0x2c716b){const _0x280217=_0x3a6ec3['get'](_0x11878e)||0x0,_0x371bc3=Math['max'](_0x280217,0x1);for(let _0x18fd98=0x0;_0x18fd98<_0x371bc3;_0x18fd98++){_0x1229d5[_0xe09df7(0x255)](_0x11878e);}}_0x6010c4[_0xe09df7(0x205)](_0x33165d,_0x1229d5);}return{'existingLocalSegmentNames':_0x38d864,'localSegmentRules':_0x2d4de0,'localExpandedRuleToNames':_0x6010c4};}export function createSegmentIdResolver(_0x4bdd7e,_0x39a0d7){return async _0x1652bb=>{const _0x4f5467=a115_0x4469,_0x5ae81b=_0x4bdd7e[_0x4f5467(0x1e0)](_0x1652bb);if(!_0x5ae81b)throw new SDKError(ErrorCode[_0x4f5467(0x26f)],'Segment\x20not\x20found:\x20'+_0x1652bb+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x39a0d7+'\x27)');return _0x5ae81b;};}export function extractRootFolderId(_0x48ae65){const _0x1a6318=a115_0x188509;return _0x48ae65[_0x1a6318(0x200)]?.[_0x1a6318(0x1d2)]?.[_0x1a6318(0x1de)]?.['id']||_0x48ae65['relationships']?.['parentFolder']?.[_0x1a6318(0x1de)]?.['id'];}export function buildConnectionMaps(_0x5333e1){const _0x40f361=a115_0x188509,_0xe8ef60=new Map(),_0x29a431=new Map(),_0x37f7a4=new Map();for(const _0x175fc2 of _0x5333e1){_0xe8ef60[_0x40f361(0x205)](_0x175fc2[_0x40f361(0x206)],parseInt(_0x175fc2['id'],0xa)),_0x29a431[_0x40f361(0x205)](_0x175fc2['id'],_0x175fc2[_0x40f361(0x206)]),_0x37f7a4[_0x40f361(0x205)](_0x175fc2[_0x40f361(0x206)],_0x175fc2[_0x40f361(0x231)]);}return{'nameToId':_0xe8ef60,'idToName':_0x29a431,'nameToType':_0x37f7a4};}export function calculatePushStats(_0x327692,_0x510c39,_0x1740a4,_0x46dc1e,_0x4cd5b8,_0x21274a,_0x4d4fb1){const _0x4aff35=a115_0x188509,_0x3a889e=_0x327692['filter'](_0x3e8ad9=>_0x3e8ad9['isNew']),_0x4c42fb=_0x327692[_0x4aff35(0x237)](_0x19d07f=>!_0x19d07f[_0x4aff35(0x21d)]&&_0x19d07f[_0x4aff35(0x26c)]),_0x4e6f65=_0x327692[_0x4aff35(0x237)](_0x3aad74=>!_0x3aad74[_0x4aff35(0x21d)]&&!_0x3aad74[_0x4aff35(0x26c)]),_0x24ba8f=_0x21274a?_0x46dc1e:[],_0x4e25a7=_0x510c39['filter'](_0x222dda=>_0x222dda[_0x4aff35(0x21d)]),_0x2a60e9=_0x510c39[_0x4aff35(0x237)](_0x1f3a37=>!_0x1f3a37['isNew']&&_0x1f3a37['hasChanges']),_0x240c3a=_0x510c39['filter'](_0x5f0bcc=>!_0x5f0bcc[_0x4aff35(0x21d)]&&!_0x5f0bcc[_0x4aff35(0x26c)]),_0xe7e4d8=_0x21274a?_0x4cd5b8:[],_0x211d48=_0x327692['flatMap'](_0x11a0d5=>_0x11a0d5[_0x4aff35(0x1a9)]),_0x1dae07=_0x211d48['filter'](_0x400e2b=>_0x400e2b[_0x4aff35(0x231)]===_0x4aff35(0x1ec)),_0x4a9003=_0x211d48[_0x4aff35(0x237)](_0x580ede=>_0x580ede[_0x4aff35(0x231)]===_0x4aff35(0x289)),_0x22072e=_0x211d48[_0x4aff35(0x237)](_0x20fccd=>_0x20fccd[_0x4aff35(0x231)]===_0x4aff35(0x261)),_0x465edd=Array[_0x4aff35(0x1dc)](_0x1740a4)[_0x4aff35(0x27b)](),_0x1c64c8=_0x4d4fb1?![]:_0x3a889e['length']>0x0||_0x4c42fb[_0x4aff35(0x1f4)]>0x0||_0x24ba8f[_0x4aff35(0x1f4)]>0x0,_0x27646d=_0x4e25a7[_0x4aff35(0x1f4)]>0x0||_0x2a60e9[_0x4aff35(0x1f4)]>0x0||_0xe7e4d8[_0x4aff35(0x1f4)]>0x0,_0x2c2ff5=_0x4d4fb1?![]:_0x211d48[_0x4aff35(0x1f4)]>0x0,_0x43e655=_0x465edd[_0x4aff35(0x1f4)]>0x0;return{'segments':{'new':_0x3a889e,'changed':_0x4c42fb,'unchanged':_0x4e6f65,'toDelete':_0x24ba8f},'journeys':{'new':_0x4e25a7,'changed':_0x2a60e9,'unchanged':_0x240c3a,'toDelete':_0xe7e4d8},'activations':{'all':_0x211d48,'toCreate':_0x1dae07,'toUpdate':_0x4a9003,'toDelete':_0x22072e},'folders':{'toCreate':_0x465edd},'counts':{'segments':{'new':_0x3a889e[_0x4aff35(0x1f4)],'changed':_0x4c42fb[_0x4aff35(0x1f4)],'unchanged':_0x4e6f65['length'],'toDelete':_0x24ba8f[_0x4aff35(0x1f4)]},'journeys':{'new':_0x4e25a7['length'],'changed':_0x2a60e9[_0x4aff35(0x1f4)],'unchanged':_0x240c3a[_0x4aff35(0x1f4)],'toDelete':_0xe7e4d8[_0x4aff35(0x1f4)]},'activations':{'create':_0x1dae07[_0x4aff35(0x1f4)],'update':_0x4a9003['length'],'delete':_0x22072e[_0x4aff35(0x1f4)]},'folders':_0x465edd[_0x4aff35(0x1f4)]},'hasChanges':_0x1c64c8||_0x27646d||_0x2c2ff5||_0x43e655};}export async function buildPushExecutionContext(_0x3f84c8,_0x30ec00,_0x288c1d,_0x361478,_0x2d206f,_0x534705){const _0x3abd23=a115_0x188509,_0x3b4e7e=extractRootFolderId(_0x288c1d),{pathToId:_0x42f1fb,idToPath:_0x48e5bb}=buildFolderMaps(_0x2d206f),_0x3ed63f=buildSegmentNameToIdMap(_0x361478),_0x4cdc25=new Map(),{batchAsync:_0x1486c1}=await import('../../utils/async.js'),[_0x16d8c1,_0x4eea0d]=await Promise[_0x3abd23(0x24b)]([_0x3f84c8[_0x3abd23(0x23e)][_0x3abd23(0x27c)](),_0x3f84c8[_0x3abd23(0x22c)][_0x3abd23(0x1b6)](),((async()=>{const _0x13fed4=_0x3abd23;!_0x534705&&_0x361478[_0x13fed4(0x1f4)]>0x0&&await _0x1486c1(_0x361478,async _0x552d87=>{const _0x13be2c=_0x13fed4,_0x583095=await _0x3f84c8[_0x13be2c(0x1db)][_0x13be2c(0x1d8)](_0x30ec00,_0x552d87['id']);_0x4cdc25[_0x13be2c(0x205)](_0x552d87['id'],_0x583095);});})())]),{emailToId:_0x495320,idToEmail:_0x385477}=_0x16d8c1,_0x546e0c=buildConnectionMaps(_0x4eea0d);return{'rootFolderId':_0x3b4e7e,'folderPathToId':_0x42f1fb,'folderIdToPath':_0x48e5bb,'segmentNameToId':_0x3ed63f,'activationsBySegmentId':_0x4cdc25,'emailToIdMap':_0x495320,'idToEmailMap':_0x385477,'connectionNameToIdMap':_0x546e0c[_0x3abd23(0x1b5)],'connectionIdToNameMap':_0x546e0c[_0x3abd23(0x27f)],'connectionNameToTypeMap':_0x546e0c['nameToType']};}export function createPushYamlContextForBundle(_0x56f358,_0x498a74,_0x1c1db3,_0x3e4895,_0x1cf097,_0x318e3b,_0x2d359d,_0x351e46){const {existingLocalSegmentNames:_0x4c7082,localExpandedRuleToNames:_0x579241}=_0x3e4895,_0x2e72ab=new Set(),_0x1629fd=new Map(),_0x4a97ea=new Map(),_0x196077=new Map(),_0x4ee473=createJumpTargetCache(),_0x1abb87=new Map(),_0x28f0c0=new Map(),_0x2c4205=new Set();let _0x4ede6c;const _0x571065=_0x32de10=>{const _0x368071={'resolveSegment':async _0x4e7c2c=>{const _0x5cdd16=a115_0x4469,_0x4ac1cb=_0x196077[_0x5cdd16(0x1e0)](_0x4e7c2c);if(_0x4ac1cb!==undefined)return{'name':_0x4ac1cb,'isJourneyLocal':!![]};try{const _0x3d18e4=await fetchSegment(_0x56f358,_0x498a74,_0x4e7c2c,_0x1c1db3);if(!_0x3d18e4)throw new Error(_0x5cdd16(0x26b));const _0x4ab0cc=generateJourneyLocalName(_0x3d18e4[_0x5cdd16(0x206)]),_0x175fcb=_0x3d18e4[_0x5cdd16(0x247)]===SEGMENT_KIND_JOURNEY&&_0x4ab0cc!==undefined;let _0x5507e4=_0x3d18e4[_0x5cdd16(0x206)],_0x314b49;if(_0x175fcb&&_0x3d18e4[_0x5cdd16(0x251)]){const _0x38025c=apiRuleToYaml(_0x3d18e4[_0x5cdd16(0x251)]);_0x28f0c0['set'](_0x4e7c2c,_0x38025c);const _0x14c801=async _0x53fb98=>{const _0x46ab5c=_0x5cdd16,_0x2b272d=collectSegmentRefsFromRule(_0x53fb98);for(const _0x3e34fa of _0x2b272d){if(!_0x28f0c0[_0x46ab5c(0x26e)](_0x3e34fa))try{const _0x4c697b=await fetchSegment(_0x56f358,_0x498a74,_0x3e34fa,_0x1c1db3);if(_0x4c697b?.['rule']){const _0x406a36=apiRuleToYaml(_0x4c697b[_0x46ab5c(0x251)]);_0x28f0c0[_0x46ab5c(0x205)](_0x3e34fa,_0x406a36),await _0x14c801(_0x406a36);}}catch(_0x5b4854){logger[_0x46ab5c(0x207)]('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x3e34fa+':\x20'+_0x5b4854);}}};await _0x14c801(_0x38025c);const _0x42b630=serializeExpandedRule(_0x38025c,_0x28f0c0),_0x25397a=_0x579241[_0x5cdd16(0x1e0)](_0x42b630);if(_0x25397a&&_0x25397a[_0x5cdd16(0x1f4)]>0x0){const _0x35a2a0=_0x1629fd[_0x5cdd16(0x1e0)](_0x42b630)||0x0,_0x282bfe=_0x25397a[_0x35a2a0]||_0x25397a[_0x25397a[_0x5cdd16(0x1f4)]-0x1];_0x1629fd[_0x5cdd16(0x205)](_0x42b630,_0x35a2a0+0x1),_0x5507e4=_0x282bfe,_0x2e72ab[_0x5cdd16(0x29d)](_0x5507e4),_0x196077[_0x5cdd16(0x205)](_0x4e7c2c,_0x5507e4);const _0x51c8ab=await resolveRuleSegmentRefs(_0x38025c,async _0xfeee3b=>{const _0x187eea=_0x5cdd16,_0x4cf04f=_0x196077[_0x187eea(0x1e0)](_0xfeee3b);if(_0x4cf04f)return _0x4cf04f;const _0x362fcf=await _0x4ede6c[_0x187eea(0x1a6)](_0xfeee3b);return _0x362fcf['name'];});_0x314b49={'description':_0x3d18e4[_0x5cdd16(0x1b7)],'rule':_0x51c8ab};}else{const _0x126664=_0x1abb87[_0x5cdd16(0x1e0)](_0x42b630);if(_0x126664)_0x5507e4=_0x126664,_0x196077[_0x5cdd16(0x205)](_0x4e7c2c,_0x5507e4);else{if(_0x4ab0cc){let _0x13f3af=_0x4ab0cc,_0x2302cc=0x2;while(_0x2e72ab[_0x5cdd16(0x26e)](_0x13f3af)||_0x4c7082[_0x5cdd16(0x26e)](_0x13f3af)){_0x13f3af=_0x4ab0cc+'_'+_0x2302cc,_0x2302cc++;}_0x2e72ab[_0x5cdd16(0x29d)](_0x13f3af),_0x5507e4=_0x13f3af;}_0x196077[_0x5cdd16(0x205)](_0x4e7c2c,_0x5507e4),_0x1abb87['set'](_0x42b630,_0x5507e4);const _0x497820=await resolveRuleSegmentRefs(_0x38025c,async _0x3bfb70=>{const _0x33d02=_0x5cdd16,_0x5669ee=_0x196077[_0x33d02(0x1e0)](_0x3bfb70);if(_0x5669ee)return _0x5669ee;const _0x491bbb=await _0x4ede6c[_0x33d02(0x1a6)](_0x3bfb70);return _0x491bbb[_0x33d02(0x206)];});_0x314b49={'description':_0x3d18e4['description'],'rule':_0x497820};}}}return{'name':_0x5507e4,'isJourneyLocal':_0x175fcb,'definition':_0x314b49};}catch(_0x24d466){return logger[_0x5cdd16(0x207)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4e7c2c+':\x20'+_0x24d466),{'name':_0x4e7c2c,'isJourneyLocal':![]};}},'resolveActivation':async _0x3f776e=>{const _0x2cb021=a115_0x4469,_0x36f84d=_0x4a97ea[_0x2cb021(0x1e0)](_0x3f776e);if(_0x36f84d!==undefined)return{'name':_0x36f84d,'isJourneyLocal':!![]};try{let _0xb30338=_0x2d359d?.[_0x2cb021(0x1e0)](_0x3f776e);!_0xb30338&&(_0xb30338=await _0x56f358[_0x2cb021(0x215)][_0x2cb021(0x29f)](_0x32de10,_0x3f776e));const _0x4ff9c7=_0xb30338[_0x2cb021(0x1ff)]['activationParams'][_0x2cb021(0x206)]||_0x3f776e,_0x4e9563=sanitizeYamlKey(_0x4ff9c7)||_0x2cb021(0x1c7)+_0x3f776e,_0x42bc6f=_0x4e9563;_0x4a97ea[_0x2cb021(0x205)](_0x3f776e,_0x42bc6f);const _0x5fbd13=journeyActivationStepToYaml(_0xb30338,_0x1cf097,_0x318e3b);return{'name':_0x42bc6f,'isJourneyLocal':!![],'definition':_0x5fbd13};}catch(_0xfedf81){return logger[_0x2cb021(0x207)](_0x2cb021(0x22e)+_0x3f776e+':\x20'+_0xfedf81),{'name':_0x3f776e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x342ecb,_0xd008be)=>resolveJumpTarget(_0x342ecb,_0xd008be,_0x4ee473,async _0x3d6cb8=>{const _0x289ac7=a115_0x4469,_0x3b1989=_0x351e46?.[_0x289ac7(0x1e0)](_0x3d6cb8);if(_0x3b1989)return _0x3b1989;return _0x56f358[_0x289ac7(0x215)][_0x289ac7(0x223)](_0x3d6cb8);})};return _0x4ede6c=_0x368071,_0x368071;},_0x31fbfb=async _0x23851a=>{const _0x1d3446=a115_0x4469,{collectSegmentIdsFromJourneyApi:_0x4e7096}=await import(_0x1d3446(0x1ac)),{batchAsync:_0x2f0353}=await import(_0x1d3446(0x273)),_0x21fef6=new Set();for(const _0x17807e of _0x23851a){let _0x3f978e=_0x351e46?.['get'](_0x17807e);!_0x3f978e&&(_0x3f978e=await _0x56f358[_0x1d3446(0x215)]['getJourney'](_0x17807e));const _0x4e4d46=_0x4e7096(_0x3f978e);for(const _0x389b87 of _0x4e4d46){_0x21fef6[_0x1d3446(0x29d)](_0x389b87);}}let _0x1be6f0=Array['from'](_0x21fef6);while(_0x1be6f0[_0x1d3446(0x1f4)]>0x0){const _0x5a4c03=_0x1be6f0['filter'](_0x21ac38=>!_0x2c4205[_0x1d3446(0x26e)](_0x21ac38));if(_0x5a4c03[_0x1d3446(0x1f4)]===0x0)break;const _0x4c5f1b=await _0x2f0353(_0x5a4c03,async _0x3d4448=>{_0x2c4205['add'](_0x3d4448);const _0x51c518=await fetchSegment(_0x56f358,_0x498a74,_0x3d4448,_0x1c1db3);if(!_0x51c518)return null;return{'segmentId':_0x3d4448,'segment':_0x51c518};},0xa),_0x5b529f=new Set();for(const _0x4d5c86 of _0x4c5f1b){if(!_0x4d5c86?.[_0x1d3446(0x1db)]?.['rule'])continue;const _0x4d0dcb=apiRuleToYaml(_0x4d5c86['segment'][_0x1d3446(0x251)]);_0x28f0c0[_0x1d3446(0x205)](_0x4d5c86[_0x1d3446(0x291)],_0x4d0dcb);const _0x2769a6=collectSegmentRefsFromRule(_0x4d0dcb);for(const _0x5f38a1 of _0x2769a6){!_0x2c4205['has'](_0x5f38a1)&&_0x5b529f['add'](_0x5f38a1);}}_0x1be6f0=Array['from'](_0x5b529f);}};return{'createYamlContext':_0x571065,'prefetchJourneySegments':_0x31fbfb};}export async function executePushSegments(_0x13a14f,_0xc302a5,_0x9f51e7,_0x505d2d,_0x16b376){const _0x273e9b=a115_0x188509,{segmentDefToCreateRequest:_0x50db3c,segmentDefToUpdateRequest:_0x37f5b1}=await import(_0x273e9b(0x1b9)),_0x26f9fd=_0x9f51e7['folderPathToId'],_0x3c7095=0x5,_0x291266=async _0x2fec78=>{const _0x1bb9ac=_0x273e9b,_0x2a8dfc=_0x2fec78[_0x1bb9ac(0x1d5)]?_0x26f9fd[_0x1bb9ac(0x1e0)](_0x2fec78['folderPath']):undefined;let _0x3a59a1;const _0x256276={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x2fec78[_0x1bb9ac(0x21d)]){_0x16b376[_0x1bb9ac(0x23d)]?.({'type':_0x1bb9ac(0x1bb),'name':_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)]});const _0x4c4722=_0x50db3c(_0x2fec78[_0x1bb9ac(0x211)],_0x2a8dfc),_0x3a7d53=await _0x16b376[_0x1bb9ac(0x21e)](_0x1bb9ac(0x27d)+_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)]+'\x27...',()=>_0x13a14f[_0x1bb9ac(0x1db)][_0x1bb9ac(0x249)](_0x505d2d[_0x1bb9ac(0x210)],_0x4c4722));_0x3a59a1=_0x3a7d53[_0x1bb9ac(0x1de)]['id'],_0x256276[_0x1bb9ac(0x1dd)]={'name':_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)],'id':_0x3a59a1},_0x16b376[_0x1bb9ac(0x23d)]?.({'type':_0x1bb9ac(0x258),'name':_0x2fec78['yamlConfig'][_0x1bb9ac(0x206)],'segmentId':_0x3a59a1}),_0x16b376['logSuccess']?.(_0x1bb9ac(0x1aa)+_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)]+'\x27'),_0x256276[_0x1bb9ac(0x25d)]=0x1;}else{if(_0x2fec78[_0x1bb9ac(0x26c)]){_0x16b376[_0x1bb9ac(0x23d)]?.({'type':_0x1bb9ac(0x20d),'name':_0x2fec78[_0x1bb9ac(0x211)]['name']});const _0x185a15=_0x37f5b1(_0x2fec78['yamlConfig']);_0x2a8dfc!==_0x2fec78['existingSegment']?.['segmentFolderId']&&(_0x185a15[_0x1bb9ac(0x26a)]=_0x2a8dfc?parseInt(_0x2a8dfc,0xa):undefined),await _0x16b376[_0x1bb9ac(0x21e)](_0x1bb9ac(0x209)+_0x2fec78[_0x1bb9ac(0x211)]['name']+_0x1bb9ac(0x235),()=>_0x13a14f[_0x1bb9ac(0x1db)][_0x1bb9ac(0x28f)](_0x505d2d[_0x1bb9ac(0x210)],_0x2fec78['existingSegment']['id'],_0x185a15)),_0x3a59a1=_0x2fec78[_0x1bb9ac(0x1b3)]['id'],_0x16b376[_0x1bb9ac(0x23d)]?.({'type':_0x1bb9ac(0x25a),'name':_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)]}),_0x16b376['logSuccess']?.(_0x1bb9ac(0x201)+_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)]+'\x27'),_0x256276[_0x1bb9ac(0x243)]=0x1;}else _0x3a59a1=_0x2fec78['existingSegment']['id'];}}catch(_0x91007f){const _0xd277ca=isHttp400Error(_0x91007f),_0x433ff0=_0xd277ca?ErrorCode[_0x1bb9ac(0x1df)]:ErrorCode[_0x1bb9ac(0x245)],_0x49bc9d=getErrorMessage(_0x91007f);throw new SDKError(_0x433ff0,'Failed\x20to\x20'+(_0x2fec78[_0x1bb9ac(0x21d)]?_0x1bb9ac(0x1ec):_0x1bb9ac(0x289))+_0x1bb9ac(0x240)+_0x2fec78[_0x1bb9ac(0x1d4)]+_0x1bb9ac(0x23f)+_0x49bc9d,_0x91007f);}try{const _0x1fafd0=await syncActivationsForSegment(_0x13a14f,_0x505d2d['parentId'],_0x3a59a1,_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)],_0x2fec78[_0x1bb9ac(0x1a9)],_0x16b376,_0x2fec78['absolutePath']);_0x256276[_0x1bb9ac(0x267)]=_0x1fafd0;}catch(_0x20bac4){if(_0x20bac4 instanceof SDKError)throw _0x20bac4;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x2fec78[_0x1bb9ac(0x211)][_0x1bb9ac(0x206)]+_0x1bb9ac(0x27a)+_0x2fec78['absolutePath']+_0x1bb9ac(0x23f)+getErrorMessage(_0x20bac4),_0x20bac4);}return _0x256276;},_0x3bc989=await batchAsync(_0xc302a5,_0x291266,_0x3c7095),_0x180a4b={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x557d5c of _0x3bc989){_0x180a4b[_0x273e9b(0x25d)]+=_0x557d5c[_0x273e9b(0x25d)],_0x180a4b[_0x273e9b(0x243)]+=_0x557d5c[_0x273e9b(0x243)],_0x557d5c['createdSegmentId']&&_0x180a4b['createdSegmentIds'][_0x273e9b(0x205)](_0x557d5c['createdSegmentId'][_0x273e9b(0x206)],_0x557d5c[_0x273e9b(0x1dd)]['id']),_0x180a4b[_0x273e9b(0x267)][_0x273e9b(0x25d)]+=_0x557d5c['activations'][_0x273e9b(0x25d)],_0x180a4b['activations'][_0x273e9b(0x243)]+=_0x557d5c[_0x273e9b(0x267)][_0x273e9b(0x243)],_0x180a4b['activations'][_0x273e9b(0x265)]+=_0x557d5c[_0x273e9b(0x267)][_0x273e9b(0x265)];}return _0x180a4b;}async function syncActivationsForSegment(_0x5b5d0b,_0x4c1a6c,_0x5c3237,_0x1970e8,_0x33c887,_0x5b450e,_0x2545ae){const _0x4dbd33=a115_0x188509,_0x14938b={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x35bf85 of _0x33c887){try{if(_0x35bf85[_0x4dbd33(0x231)]===_0x4dbd33(0x1ec)&&_0x35bf85['validatedRequest'])_0x5b450e[_0x4dbd33(0x23d)]?.({'type':_0x4dbd33(0x2a1),'segmentName':_0x1970e8,'activationName':_0x35bf85['name']}),await _0x5b450e[_0x4dbd33(0x21e)](_0x4dbd33(0x1ae)+_0x35bf85['name']+_0x4dbd33(0x235),()=>_0x5b5d0b[_0x4dbd33(0x1db)][_0x4dbd33(0x1af)](_0x4c1a6c,_0x5c3237,_0x35bf85['validatedRequest'])),_0x5b450e['onProgress']?.({'type':_0x4dbd33(0x1e6),'segmentName':_0x1970e8,'activationName':_0x35bf85[_0x4dbd33(0x206)]}),_0x5b450e['logSuccess']?.(_0x4dbd33(0x203)+_0x35bf85[_0x4dbd33(0x206)]+'\x27'),_0x14938b[_0x4dbd33(0x25d)]++;else{if(_0x35bf85[_0x4dbd33(0x231)]===_0x4dbd33(0x289)&&_0x35bf85[_0x4dbd33(0x1da)]&&_0x35bf85[_0x4dbd33(0x1c4)])_0x5b450e['onProgress']?.({'type':_0x4dbd33(0x279),'segmentName':_0x1970e8,'activationName':_0x35bf85['name']}),await _0x5b450e['withProgress'](_0x4dbd33(0x1fd)+_0x35bf85[_0x4dbd33(0x206)]+_0x4dbd33(0x235),()=>_0x5b5d0b['segment'][_0x4dbd33(0x1c2)](_0x4c1a6c,_0x5c3237,_0x35bf85[_0x4dbd33(0x1c4)]['id'],_0x35bf85[_0x4dbd33(0x1da)])),_0x5b450e['onProgress']?.({'type':_0x4dbd33(0x234),'segmentName':_0x1970e8,'activationName':_0x35bf85['name']}),_0x5b450e[_0x4dbd33(0x224)]?.(_0x4dbd33(0x1cc)+_0x35bf85[_0x4dbd33(0x206)]+'\x27'),_0x14938b['updated']++;else _0x35bf85[_0x4dbd33(0x231)]===_0x4dbd33(0x261)&&_0x35bf85[_0x4dbd33(0x1c4)]&&(_0x5b450e[_0x4dbd33(0x23d)]?.({'type':_0x4dbd33(0x218),'segmentName':_0x1970e8,'activationName':_0x35bf85['name']}),await _0x5b450e[_0x4dbd33(0x21e)]('Deleting\x20activation\x20\x27'+_0x35bf85[_0x4dbd33(0x206)]+_0x4dbd33(0x235),()=>_0x5b5d0b[_0x4dbd33(0x1db)][_0x4dbd33(0x1b0)](_0x4c1a6c,_0x5c3237,_0x35bf85['existingActivation']['id'])),_0x5b450e[_0x4dbd33(0x23d)]?.({'type':_0x4dbd33(0x2a3),'segmentName':_0x1970e8,'activationName':_0x35bf85[_0x4dbd33(0x206)]}),_0x5b450e[_0x4dbd33(0x271)]?.(_0x4dbd33(0x219)+_0x35bf85[_0x4dbd33(0x206)]+'\x27'),_0x14938b[_0x4dbd33(0x265)]++);}}catch(_0x156342){const _0x10a3bd=isHttp400Error(_0x156342),_0x2c3564=_0x10a3bd?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x4dbd33(0x1fc)],_0x1da81f=getErrorMessage(_0x156342);throw new SDKError(_0x2c3564,_0x4dbd33(0x2a2)+_0x35bf85['type']+'\x20activation\x20\x27'+_0x35bf85[_0x4dbd33(0x206)]+_0x4dbd33(0x27a)+_0x2545ae+'\x0a\x20\x20'+_0x1da81f,_0x156342);}}return _0x14938b;}function a115_0x4469(_0x46aa33,_0x3e652a){_0x46aa33=_0x46aa33-0x1a2;const _0x35b73e=a115_0x35b7();let _0x4469be=_0x35b73e[_0x46aa33];return _0x4469be;}export async function executePushFolders(_0x472956,_0x34835a,_0x326b94,_0x4e030c,_0x43cf4c){const _0x99265d=a115_0x188509,_0x54e0e8=new Map(_0x326b94);for(const _0xd60d72 of _0x34835a){const _0x532eb4=_0xd60d72[_0x99265d(0x216)]('/'),_0x6263b5=_0x532eb4[_0x532eb4[_0x99265d(0x1f4)]-0x1],_0x2faccf=_0x532eb4['slice'](0x0,-0x1)['join']('/'),_0x51d3b5=_0x54e0e8[_0x99265d(0x1e0)](_0x2faccf);_0x43cf4c[_0x99265d(0x23d)]?.({'type':_0x99265d(0x21b),'folder':_0xd60d72});const _0x4bf171={'name':_0x6263b5,'parentFolderId':_0x51d3b5},_0x16bf1c=await _0x43cf4c['withProgress'](_0x99265d(0x248)+_0xd60d72+_0x99265d(0x235),()=>_0x472956['segment'][_0x99265d(0x232)](_0x4e030c['parentId'],_0x4bf171));_0x54e0e8['set'](_0xd60d72,_0x16bf1c[_0x99265d(0x1de)]['id']),_0x43cf4c['onProgress']?.({'type':_0x99265d(0x214),'folder':_0xd60d72,'folderId':_0x16bf1c[_0x99265d(0x1de)]['id']}),_0x43cf4c[_0x99265d(0x1ce)]?.('Created\x20folder\x20\x27'+_0xd60d72+'\x27');}return _0x54e0e8;}export async function executePushSegmentDeletions(_0x38576f,_0x4c971f,_0x522a67){const _0x561b19=a115_0x188509;if(_0x4c971f[_0x561b19(0x1f4)]===0x0)return 0x0;const {batchAsync:_0x41f60c}=await import('../../utils/async.js'),_0x5687cc=0x5,_0x51e65c=await _0x41f60c(_0x4c971f,async _0x5b3daf=>{const _0x43027f=_0x561b19;return _0x522a67[_0x43027f(0x23d)]?.({'type':'segment_deleting','name':_0x5b3daf['name']}),await _0x38576f['segment'][_0x43027f(0x226)](_0x5b3daf['id']),_0x522a67[_0x43027f(0x23d)]?.({'type':_0x43027f(0x1e9),'name':_0x5b3daf['name']}),_0x522a67[_0x43027f(0x271)]?.(_0x43027f(0x1e5)+_0x5b3daf[_0x43027f(0x206)]+'\x27'),0x1;},_0x5687cc);return _0x51e65c[_0x561b19(0x297)]((_0x1ce6e0,_0x49e4ba)=>_0x1ce6e0+_0x49e4ba,0x0);}export async function executePushJourneys(_0x24b23f,_0x4ed379,_0x302e82,_0x2a57cb,_0x50605b){const _0x4fcc89=a115_0x188509,{journeyDefToRequest:_0x1aed4c}=await import(_0x4fcc89(0x1ac)),{activationDefToCreateRequest:_0x3af413,yamlRuleToApi:_0x4f954c,validateSegmentRule:_0x49a8aa}=await import(_0x4fcc89(0x1b9)),_0x25c0a5={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x31c5e7=new Map(_0x302e82[_0x4fcc89(0x236)]),_0x26c172=0x5;for(let _0xc89308=0x0;_0xc89308<_0x4ed379[_0x4fcc89(0x1f4)];_0xc89308+=_0x26c172){const _0x4f4f3b=_0x4ed379[_0x4fcc89(0x238)](_0xc89308,_0xc89308+_0x26c172),_0x4a3175=await Promise[_0x4fcc89(0x24b)](_0x4f4f3b[_0x4fcc89(0x287)](async _0x4f449b=>{const _0x380799=_0x4fcc89;if(!_0x4f449b[_0x380799(0x21d)]&&!_0x4f449b[_0x380799(0x26c)])return{'action':_0x380799(0x1f6),'name':_0x4f449b['yamlConfig'][_0x380799(0x206)],'journeyId':_0x4f449b[_0x380799(0x1f0)]?.['id']};const _0x219ac1=_0x4f449b[_0x380799(0x1d5)]?_0x302e82[_0x380799(0x270)]['get'](_0x4f449b[_0x380799(0x1d5)]):undefined;_0x50605b[_0x380799(0x23d)]?.({'type':_0x4f449b[_0x380799(0x21d)]?_0x380799(0x22b):_0x380799(0x217),'name':_0x4f449b['yamlConfig'][_0x380799(0x206)]});try{const _0x5c0f81=await executeSingleJourneyPush(_0x24b23f,_0x4f449b,{..._0x302e82,'segmentNameToId':_0x31c5e7},{'parentId':_0x2a57cb['parentId'],'rootFolderId':_0x2a57cb[_0x380799(0x256)],'folderId':_0x219ac1,'verbose':_0x2a57cb['verbose']},_0x50605b,{'journeyDefToRequest':_0x1aed4c,'activationDefToCreateRequest':_0x3af413,'yamlRuleToApi':_0x4f954c,'validateSegmentRule':_0x49a8aa});for(const [_0x1ebb69,_0x1cdcaa]of _0x5c0f81[_0x380799(0x229)]){_0x31c5e7['set'](_0x1ebb69,_0x1cdcaa),_0x25c0a5['embeddedSegmentNameToId'][_0x380799(0x205)](_0x1ebb69,_0x1cdcaa);}if(_0x5c0f81['action']===_0x380799(0x25d))_0x50605b[_0x380799(0x23d)]?.({'type':_0x380799(0x1e3),'name':_0x4f449b[_0x380799(0x211)][_0x380799(0x206)],'journeyId':_0x5c0f81['journeyId']}),_0x50605b['logSuccess']?.(_0x380799(0x230)+_0x4f449b[_0x380799(0x211)][_0x380799(0x206)]+'\x27'),_0x25c0a5[_0x380799(0x25d)]++;else _0x5c0f81[_0x380799(0x29a)]===_0x380799(0x243)&&(_0x50605b[_0x380799(0x23d)]?.({'type':_0x380799(0x27e),'name':_0x4f449b[_0x380799(0x211)][_0x380799(0x206)]}),_0x50605b[_0x380799(0x224)]?.(_0x380799(0x262)+_0x4f449b[_0x380799(0x211)][_0x380799(0x206)]+'\x27'),_0x25c0a5[_0x380799(0x243)]++);return{'action':_0x5c0f81[_0x380799(0x29a)],'name':_0x4f449b[_0x380799(0x211)]['name'],'journeyId':_0x5c0f81[_0x380799(0x1d9)]};}catch(_0x46a4bc){const _0x5227bf=isHttp400Error(_0x46a4bc),_0x519d7c=_0x5227bf?ErrorCode[_0x380799(0x204)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x568e72=getErrorMessage(_0x46a4bc);throw new SDKError(_0x519d7c,_0x380799(0x2a2)+(_0x4f449b['isNew']?_0x380799(0x1ec):'update')+_0x380799(0x26d)+_0x4f449b[_0x380799(0x1d4)]+_0x380799(0x23f)+_0x568e72,_0x46a4bc);}}));_0x25c0a5[_0x4fcc89(0x24e)][_0x4fcc89(0x255)](..._0x4a3175);}return _0x25c0a5;}async function matchExistingJourneySegments(_0x55cbcf,_0xf6d9b3,_0x239c17,_0x37d397,_0x3512c5){const _0x599a06=a115_0x188509;if(!_0xf6d9b3[_0x599a06(0x1f0)]||!_0xf6d9b3[_0x599a06(0x211)][_0x599a06(0x202)])return;const _0x43093f=new Map();for(const _0x510ab2 of Object[_0x599a06(0x233)](_0xf6d9b3[_0x599a06(0x211)][_0x599a06(0x202)])){const _0x32e622=generateDeterministicJourneySegmentName(_0xf6d9b3[_0x599a06(0x211)][_0x599a06(0x206)],_0x510ab2);_0x43093f[_0x599a06(0x205)](_0x32e622,_0x510ab2);}const _0x16d8a7=collectSegmentIdsFromJourneyApi(_0xf6d9b3[_0x599a06(0x1f0)]);for(const _0x341ca6 of _0x16d8a7){const _0x41e402=await fetchSegment(_0x55cbcf,_0x239c17,_0x341ca6,_0x37d397);if(!_0x41e402?.[_0x599a06(0x206)])continue;const _0x3ab2e1=_0x43093f['get'](_0x41e402[_0x599a06(0x206)]);_0x3ab2e1&&_0x3512c5[_0x599a06(0x205)](_0x3ab2e1,_0x341ca6);}}async function executeSingleJourneyPush(_0x4975d3,_0x362472,_0x5b7ae7,_0x129478,_0x16207b,_0x4b48f0){const _0x4c0062=a115_0x188509,{journeyDefToRequest:_0xc70d7f,activationDefToCreateRequest:_0x52b1c8,yamlRuleToApi:_0x48fdee,validateSegmentRule:_0xdcce11}=_0x4b48f0,_0x41b7ec=new Map(),_0x25b862=new Map();recoverSegmentIdsFromPushRecovery(_0x362472,_0x41b7ec,_0x5b7ae7[_0x4c0062(0x236)]);const _0x3ccc0c=new Map(),_0x7ff698=new Map(),_0x4ea0ec=new Map();let _0x3d0aa9;const _0x3797d4=async()=>{const _0xbabca8=_0x4c0062;if(_0x3d0aa9)return;_0x3d0aa9=new Map();if(!_0x362472['existingJourney'])return;const _0x14fca7=await _0x4975d3[_0xbabca8(0x215)][_0xbabca8(0x1d8)](_0x362472[_0xbabca8(0x1f0)]['id']);for(const _0x5df5ef of _0x14fca7){const _0x3b3169=journeyActivationStepToYaml(_0x5df5ef,_0x5b7ae7[_0xbabca8(0x268)],_0x5b7ae7[_0xbabca8(0x23a)]),_0x31433f=activationSignature(_0x3b3169);!_0x3d0aa9['has'](_0x31433f)&&_0x3d0aa9[_0xbabca8(0x205)](_0x31433f,_0x5df5ef['id']),_0x3b3169[_0xbabca8(0x206)]&&_0x25b862['set'](_0x3b3169[_0xbabca8(0x206)],_0x5df5ef['id']);}};await matchExistingJourneySegments(_0x4975d3,_0x362472,_0x129478[_0x4c0062(0x210)],_0x5b7ae7[_0x4c0062(0x1c1)],_0x5b7ae7[_0x4c0062(0x236)]);const _0x557924={'resolveSegmentId':async _0x203ea8=>{const _0x4b4d14=_0x4c0062,_0x5daf7e=_0x5b7ae7['segmentNameToId']['get'](_0x203ea8);if(!_0x5daf7e)throw new SDKError(ErrorCode[_0x4b4d14(0x26f)],'Segment\x20not\x20found:\x20'+_0x203ea8+_0x4b4d14(0x1a8)+_0x362472[_0x4b4d14(0x211)][_0x4b4d14(0x206)]+')');return _0x5daf7e;},'resolveEmbeddedSegmentId':async(_0x56a580,_0x52761b)=>{const _0x5c7616=_0x4c0062,_0x75903f=_0x5b7ae7['segmentNameToId'][_0x5c7616(0x1e0)](_0x56a580);if(_0x75903f)return _0x75903f;const _0x171674=_0x5b7ae7[_0x5c7616(0x1c1)][_0x5c7616(0x1c9)](_0x56155d=>_0x56155d[_0x5c7616(0x206)]===_0x56a580);if(_0x171674)return _0x5b7ae7[_0x5c7616(0x236)][_0x5c7616(0x205)](_0x56a580,_0x171674['id']),_0x171674['id'];if(_0x362472[_0x5c7616(0x21d)]){const {stageName:_0x4c83a5,criteriaName:_0x4443a8}=findSegmentCriteriaLocation(_0x362472[_0x5c7616(0x211)],_0x56a580);return _0xdcce11(_0x56a580,_0x52761b[_0x5c7616(0x251)]),_0x7ff698[_0x5c7616(0x205)](_0x56a580,{'definition':_0x52761b,'stageName':_0x4c83a5,'criteriaName':_0x4443a8}),createPendingSegmentId(_0x56a580);}const _0x229938=_0x362472[_0x5c7616(0x1f0)]?.['id'];if(!_0x229938)throw new SDKError(ErrorCode['INTERNAL'],_0x5c7616(0x1e4));const _0x1b0eab=_0x3ccc0c[_0x5c7616(0x1e0)](_0x56a580);if(_0x1b0eab)return _0x1b0eab;const _0xc00831=((async()=>{const _0x4e1b8a=_0x5c7616;_0xdcce11(_0x56a580,_0x52761b[_0x4e1b8a(0x251)]);const _0x2f21ac=generateDeterministicJourneySegmentName(_0x362472[_0x4e1b8a(0x211)][_0x4e1b8a(0x206)],_0x56a580),_0x1eb6d0=_0x5b7ae7[_0x4e1b8a(0x1c1)][_0x4e1b8a(0x1c9)](_0x1554d1=>_0x1554d1[_0x4e1b8a(0x206)]===_0x2f21ac),_0x4ebbf7=createSegmentIdResolver(_0x5b7ae7['segmentNameToId'],_0x56a580),_0x41742d=await resolveRuleSegmentIds(_0x52761b[_0x4e1b8a(0x251)],_0x4ebbf7);let _0x4a3414;return _0x1eb6d0?(await _0x4975d3['segment'][_0x4e1b8a(0x28f)](_0x129478[_0x4e1b8a(0x210)],_0x1eb6d0['id'],{'description':_0x52761b[_0x4e1b8a(0x1b7)]||_0x4e1b8a(0x24c)+_0x56a580,'rule':_0x48fdee(_0x41742d,!![]),'countPopulation':!![]}),_0x4a3414=_0x1eb6d0['id'],saveSegmentToPushRecovery(_0x362472['absolutePath'],_0x362472[_0x4e1b8a(0x211)]['name'],_0x56a580,{'segmentId':_0x4a3414,'uniqueServerName':_0x2f21ac,'createdAt':new Date()[_0x4e1b8a(0x259)]()})):_0x4a3414=await createOrRecoverEmbeddedSegment(_0x4975d3,_0x362472,{'localName':_0x56a580,'uniqueSegmentName':_0x2f21ac,'description':_0x52761b[_0x4e1b8a(0x1b7)]||_0x4e1b8a(0x24c)+_0x56a580,'journeyId':_0x229938,'resolvedRule':_0x41742d,'parentId':_0x129478['parentId'],'folderId':_0x129478[_0x4e1b8a(0x256)]||''},_0x48fdee),_0x5b7ae7[_0x4e1b8a(0x236)]['set'](_0x56a580,_0x4a3414),_0x41b7ec['set'](_0x56a580,_0x4a3414),_0x4a3414;})());_0x3ccc0c[_0x5c7616(0x205)](_0x56a580,_0xc00831);try{return await _0xc00831;}finally{_0x3ccc0c['delete'](_0x56a580);}},'resolveActivationId':async _0x57d7f9=>{const _0x1e7e04=_0x4c0062,_0xed421f=_0x25b862[_0x1e7e04(0x1e0)](_0x57d7f9);if(_0xed421f)return _0xed421f;if(_0x362472[_0x1e7e04(0x1f0)]){await _0x3797d4();const _0xb5a089=_0x25b862['get'](_0x57d7f9);if(_0xb5a089)return _0xb5a089;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x57d7f9+_0x1e7e04(0x1a8)+_0x362472[_0x1e7e04(0x211)]['name']+_0x1e7e04(0x20a)+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x18df79,_0x24fd5e)=>{const _0x4cf7af=_0x4c0062,_0x23864d=_0x25b862[_0x4cf7af(0x1e0)](_0x18df79);if(_0x23864d)return _0x23864d;if(_0x362472[_0x4cf7af(0x21d)])return _0x4ea0ec[_0x4cf7af(0x205)](_0x18df79,_0x24fd5e),createPendingActivationId(_0x18df79);if(_0x362472[_0x4cf7af(0x1f0)]){await _0x3797d4();const _0x5a6141=_0x25b862[_0x4cf7af(0x1e0)](_0x24fd5e[_0x4cf7af(0x206)]);if(_0x5a6141)return _0x25b862[_0x4cf7af(0x205)](_0x18df79,_0x5a6141),_0x5a6141;const _0x400874=activationSignature(_0x24fd5e),_0x50fa70=_0x3d0aa9?.[_0x4cf7af(0x1e0)](_0x400874);if(_0x50fa70)return _0x25b862[_0x4cf7af(0x205)](_0x18df79,_0x50fa70),_0x50fa70;const _0x396c1a=await _0x52b1c8(_0x24fd5e,_0x5b7ae7[_0x4cf7af(0x1ea)]),_0x4ac764={..._0x396c1a,..._0x24fd5e[_0x4cf7af(0x1a3)]!==undefined&&{'runAfterJourneyRefresh':_0x24fd5e[_0x4cf7af(0x1a3)]}},_0x18e9d4=await _0x4975d3[_0x4cf7af(0x215)][_0x4cf7af(0x1af)](_0x362472[_0x4cf7af(0x1f0)]['id'],_0x4ac764);return _0x25b862['set'](_0x18df79,_0x18e9d4['id']),_0x18e9d4['id'];}throw new SDKError(ErrorCode[_0x4cf7af(0x221)],_0x4cf7af(0x1cf));},'resolveJourneyId':async _0x2919f4=>{const _0x6c944a=_0x4c0062;try{return await _0x4975d3[_0x6c944a(0x215)][_0x6c944a(0x1ed)](_0x129478['parentId'],_0x2919f4);}catch(_0x59c1a3){throw new SDKError(ErrorCode['NOT_FOUND'],_0x6c944a(0x28c)+_0x2919f4+_0x6c944a(0x29e)+_0x362472['yamlConfig'][_0x6c944a(0x206)]+'\x27)',_0x59c1a3);}},'resolveStageId':async(_0x18ec0d,_0x316dd8)=>{const _0x1f9247=_0x4c0062,_0x243299=await _0x4975d3['journey'][_0x1f9247(0x223)](_0x18ec0d),_0x4be620=_0x243299[_0x1f9247(0x1ff)][_0x1f9247(0x252)][_0x1f9247(0x1c9)](_0x38a8ce=>_0x38a8ce['name']['toLowerCase']()===_0x316dd8[_0x1f9247(0x1f5)]());if(!_0x4be620?.['id'])throw new SDKError(ErrorCode[_0x1f9247(0x292)],'Stage\x20\x27'+_0x316dd8+_0x1f9247(0x25e)+(_0x243299[_0x1f9247(0x1ff)][_0x1f9247(0x294)]||_0x243299['attributes'][_0x1f9247(0x206)])+'\x27');return _0x4be620['id'];}},_0x1c31c2=await _0xc70d7f(_0x362472[_0x4c0062(0x211)],_0x129478[_0x4c0062(0x210)],_0x557924),_0x3c6127=_0x129478[_0x4c0062(0x272)]||_0x129478['rootFolderId'];_0x3c6127&&(_0x1c31c2[_0x4c0062(0x200)]={'parentFolder':{'data':{'id':_0x3c6127,'type':_0x4c0062(0x246)}}});if(_0x362472[_0x4c0062(0x21d)]){if(_0x7ff698['size']>0x0||_0x4ea0ec[_0x4c0062(0x1a7)]>0x0)return await executeThreeStepJourneyCreate(_0x4975d3,_0x362472,_0x1c31c2,{'pendingEmbeddedSegments':_0x7ff698,'pendingEmbeddedActivations':_0x4ea0ec,'embeddedSegmentNameToId':_0x41b7ec,'journeyActivationNameToId':_0x25b862},{..._0x129478,'effectiveFolderId':_0x3c6127},_0x5b7ae7,_0x16207b,_0x4b48f0);else{ensureJourneyDefaults(_0x1c31c2[_0x4c0062(0x1ff)]);const _0x5d3fd6=await _0x4975d3[_0x4c0062(0x215)][_0x4c0062(0x1ec)](_0x1c31c2);return deletePushRecovery(_0x362472[_0x4c0062(0x1d4)]),{'action':_0x4c0062(0x25d),'journeyId':_0x5d3fd6['id'],'embeddedSegmentNameToId':_0x41b7ec};}}else{if(_0x362472['hasChanges']&&_0x362472['existingJourney'])return ensureJourneyDefaults(_0x1c31c2[_0x4c0062(0x1ff)]),await _0x4975d3[_0x4c0062(0x215)]['update'](_0x362472['existingJourney']['id'],_0x1c31c2),deletePushRecovery(_0x362472[_0x4c0062(0x1d4)]),{'action':_0x4c0062(0x243),'journeyId':_0x362472[_0x4c0062(0x1f0)]['id'],'embeddedSegmentNameToId':_0x41b7ec};}return deletePushRecovery(_0x362472[_0x4c0062(0x1d4)]),{'action':_0x4c0062(0x1f6),'journeyId':_0x362472[_0x4c0062(0x1f0)]?.['id'],'embeddedSegmentNameToId':_0x41b7ec};}function findSegmentCriteriaLocation(_0x6b4221,_0x1e0b35){const _0x28f78e=a115_0x188509,_0x70d8e=_0x6b4221[_0x28f78e(0x24f)]||_0x6b4221['journeys']?.[0x0]?.[_0x28f78e(0x24f)]||[];let _0x239e93='entry',_0x3127ff=_0x1e0b35;const _0xeb8366=_0x6b4221[_0x28f78e(0x1c0)]||_0x6b4221[_0x28f78e(0x1c8)]?.[0x0]?.[_0x28f78e(0x1c0)];if(_0xeb8366?.[_0x28f78e(0x1db)]===_0x1e0b35)return{'stageName':_0x28f78e(0x1c0),'criteriaName':_0xeb8366[_0x28f78e(0x206)]||_0x1e0b35};_0x4373af:for(const _0x19b4e2 of _0x70d8e){if(_0x19b4e2['entry_criteria']?.[_0x28f78e(0x1db)]===_0x1e0b35){_0x239e93=_0x19b4e2[_0x28f78e(0x206)],_0x3127ff=_0x19b4e2['entry_criteria'][_0x28f78e(0x206)]||_0x1e0b35;break;}if(_0x19b4e2[_0x28f78e(0x1d7)])for(const _0x373675 of _0x19b4e2['steps']){if(_0x373675[_0x28f78e(0x231)]===_0x28f78e(0x239)&&_0x373675[_0x28f78e(0x298)]?.[_0x28f78e(0x1e7)])for(const _0x2bd711 of _0x373675[_0x28f78e(0x298)]['branches']){if(_0x2bd711['segment']===_0x1e0b35){_0x239e93=_0x19b4e2['name'],_0x3127ff=_0x2bd711[_0x28f78e(0x206)]||_0x1e0b35;break _0x4373af;}}}}return{'stageName':_0x239e93,'criteriaName':_0x3127ff};}async function executeThreeStepJourneyCreate(_0x2563e1,_0x1a8a3e,_0x27237f,_0x37fcf2,_0x359414,_0x2772f3,_0x4033f9,_0xae3569){const _0x2f297c=a115_0x188509,{activationDefToCreateRequest:_0x4ae0a3,yamlRuleToApi:_0x414fe3}=_0xae3569,{pendingEmbeddedSegments:_0x10e1a6,pendingEmbeddedActivations:_0x4850fc,embeddedSegmentNameToId:_0x4234e8}=_0x37fcf2,_0x52a00b=JSON['parse'](JSON[_0x2f297c(0x1bd)](_0x27237f));ensureJourneyDefaults(_0x52a00b[_0x2f297c(0x1ff)]),stripPendingIds(_0x52a00b);const _0x46957d=await _0x2563e1[_0x2f297c(0x215)][_0x2f297c(0x1ec)](_0x52a00b),_0x4413bf=_0x46957d['id'],_0x167b25=new Map();for(const _0x2b0a96 of _0x46957d[_0x2f297c(0x1ff)][_0x2f297c(0x252)]){_0x167b25[_0x2f297c(0x205)](_0x2b0a96[_0x2f297c(0x206)]['toLowerCase'](),_0x2b0a96['id']);}recoverSegmentIdsFromPushRecovery(_0x1a8a3e,_0x4234e8,_0x2772f3[_0x2f297c(0x236)]);for(const [_0x49a648,{definition:_0x48e5fa}]of _0x10e1a6){if(_0x4234e8['has'](_0x49a648)){_0x4033f9[_0x2f297c(0x23d)]?.({'type':_0x2f297c(0x222),'journeyName':_0x1a8a3e['yamlConfig']['name'],'segmentName':_0x49a648});continue;}const _0x1e9106=generateDeterministicJourneySegmentName(_0x1a8a3e['yamlConfig'][_0x2f297c(0x206)],_0x49a648);_0x4033f9[_0x2f297c(0x23d)]?.({'type':_0x2f297c(0x220),'journeyName':_0x1a8a3e['yamlConfig'][_0x2f297c(0x206)],'segmentName':_0x49a648});const _0x4add16=createSegmentIdResolver(_0x2772f3[_0x2f297c(0x236)],_0x49a648),_0x527277=await resolveRuleSegmentIds(_0x48e5fa[_0x2f297c(0x251)],_0x4add16),_0x243868=await createOrRecoverEmbeddedSegment(_0x2563e1,_0x1a8a3e,{'localName':_0x49a648,'uniqueSegmentName':_0x1e9106,'description':_0x48e5fa['description']||'Entry\x20criteria:\x20'+_0x49a648,'journeyId':_0x4413bf,'resolvedRule':_0x527277,'parentId':_0x359414[_0x2f297c(0x210)],'folderId':_0x359414[_0x2f297c(0x290)]||''},_0x414fe3);_0x4234e8[_0x2f297c(0x205)](_0x49a648,_0x243868),_0x2772f3[_0x2f297c(0x236)][_0x2f297c(0x205)](_0x49a648,_0x243868),_0x4033f9[_0x2f297c(0x23d)]?.({'type':_0x2f297c(0x222),'journeyName':_0x1a8a3e[_0x2f297c(0x211)][_0x2f297c(0x206)],'segmentName':_0x49a648});}const _0x503191=new Map();for(const [_0x1c2098,_0x5844d2]of _0x4850fc){_0x4033f9[_0x2f297c(0x23d)]?.({'type':'embedded_activation_creating','journeyName':_0x1a8a3e[_0x2f297c(0x211)][_0x2f297c(0x206)],'activationName':_0x1c2098});const _0xfb8b2e=await _0x4ae0a3(_0x5844d2,_0x2772f3[_0x2f297c(0x1ea)]),_0x39f93a={..._0xfb8b2e,..._0x5844d2[_0x2f297c(0x1a3)]!==undefined&&{'runAfterJourneyRefresh':_0x5844d2[_0x2f297c(0x1a3)]}},_0x45b171=await _0x2563e1[_0x2f297c(0x215)][_0x2f297c(0x1af)](_0x4413bf,_0x39f93a);_0x503191['set'](_0x1c2098,_0x45b171['id']),_0x37fcf2[_0x2f297c(0x225)][_0x2f297c(0x205)](_0x1c2098,_0x45b171['id']),_0x4033f9['onProgress']?.({'type':_0x2f297c(0x25c),'journeyName':_0x1a8a3e[_0x2f297c(0x211)][_0x2f297c(0x206)],'activationName':_0x1c2098});}const _0x121f6e=JSON[_0x2f297c(0x283)](JSON[_0x2f297c(0x1bd)](_0x27237f));return _0x121f6e['id']=_0x4413bf,ensureJourneyDefaults(_0x121f6e[_0x2f297c(0x1ff)]),resolvePendingIdsInRequest(_0x121f6e,_0x27237f,_0x167b25,_0x4234e8,_0x503191,_0x4033f9),await _0x2563e1[_0x2f297c(0x215)][_0x2f297c(0x289)](_0x4413bf,_0x121f6e),deletePushRecovery(_0x1a8a3e['absolutePath']),{'action':_0x2f297c(0x25d),'journeyId':_0x4413bf,'embeddedSegmentNameToId':_0x4234e8};}export function stripWaitStepPendingIds(_0x628060){const _0x29bd2c=a115_0x188509,_0x4c23fa=_0x628060[_0x29bd2c(0x1d0)]&&isPendingSegmentId(_0x628060[_0x29bd2c(0x1d0)]),_0x64a23a=_0x628060['conditions']?.[_0x29bd2c(0x1d1)](_0x179b61=>_0x179b61['segmentId']&&isPendingSegmentId(_0x179b61['segmentId']));(_0x4c23fa||_0x64a23a)&&(_0x628060[_0x29bd2c(0x22f)]=_0x29bd2c(0x250),_0x628060[_0x29bd2c(0x278)]=0x1,_0x628060[_0x29bd2c(0x260)]=_0x29bd2c(0x1ab),delete _0x628060[_0x29bd2c(0x1d0)],delete _0x628060['conditionTimeoutDuration'],delete _0x628060['conditionTimeoutUnit'],delete _0x628060[_0x29bd2c(0x275)]);}export function resolveWaitStepPendingIds(_0x20de75,_0x37a374,_0x17e957,_0xf1250c){const _0x2a1d69=a115_0x188509;if(_0x37a374[_0x2a1d69(0x1d0)]&&isPendingSegmentId(_0x37a374[_0x2a1d69(0x1d0)])){const _0x11ab3f=_0x17e957(_0x37a374['conditionSegmentId'],_0x2a1d69(0x1f7)+_0xf1250c+_0x2a1d69(0x1f1));_0x11ab3f&&(_0x20de75[_0x2a1d69(0x22f)]='Condition',_0x20de75[_0x2a1d69(0x1d0)]=_0x11ab3f,delete _0x20de75[_0x2a1d69(0x278)],delete _0x20de75[_0x2a1d69(0x260)],_0x37a374[_0x2a1d69(0x1bf)]!==undefined&&(_0x20de75[_0x2a1d69(0x1bf)]=_0x37a374[_0x2a1d69(0x1bf)]),_0x37a374['conditionTimeoutUnit']&&(_0x20de75['conditionTimeoutUnit']=_0x37a374['conditionTimeoutUnit']));}if(_0x37a374['conditions']){const _0xb2ba52=_0x37a374[_0x2a1d69(0x275)][_0x2a1d69(0x1d1)](_0x38fdcd=>_0x38fdcd['segmentId']&&isPendingSegmentId(_0x38fdcd[_0x2a1d69(0x291)]));if(_0xb2ba52){const _0x33de02=_0x37a374[_0x2a1d69(0x275)][_0x2a1d69(0x287)](_0x1166c0=>{const _0x4aaa21=_0x2a1d69;if(_0x1166c0['segmentId']&&isPendingSegmentId(_0x1166c0['segmentId'])){const _0x56b4bd=_0x17e957(_0x1166c0[_0x4aaa21(0x291)],'stage\x20\x27'+_0xf1250c+'\x27\x20wait\x20condition');return{..._0x1166c0,'segmentId':_0x56b4bd||_0x1166c0[_0x4aaa21(0x291)]};}return{..._0x1166c0};});_0x20de75[_0x2a1d69(0x22f)]=_0x2a1d69(0x1e1),_0x20de75[_0x2a1d69(0x275)]=_0x33de02,delete _0x20de75[_0x2a1d69(0x278)],delete _0x20de75[_0x2a1d69(0x260)],delete _0x20de75[_0x2a1d69(0x1d0)],delete _0x20de75[_0x2a1d69(0x1bf)],delete _0x20de75[_0x2a1d69(0x280)];}}}function stripPendingIds(_0x10c762){const _0x52274e=a115_0x188509;_0x10c762[_0x52274e(0x1ff)]['goal']?.[_0x52274e(0x291)]&&isPendingSegmentId(_0x10c762['attributes']['goal'][_0x52274e(0x291)])&&delete _0x10c762[_0x52274e(0x1ff)][_0x52274e(0x1c0)];for(const _0x1746f9 of _0x10c762[_0x52274e(0x1ff)][_0x52274e(0x252)]||[]){_0x1746f9[_0x52274e(0x20e)]?.[_0x52274e(0x291)]&&isPendingSegmentId(_0x1746f9[_0x52274e(0x20e)][_0x52274e(0x291)])&&delete _0x1746f9['entryCriteria'];_0x1746f9[_0x52274e(0x257)]?.[_0x52274e(0x291)]&&isPendingSegmentId(_0x1746f9['milestone'][_0x52274e(0x291)])&&delete _0x1746f9['milestone'];_0x1746f9[_0x52274e(0x1f3)]&&(_0x1746f9[_0x52274e(0x1f3)]=_0x1746f9[_0x52274e(0x1f3)][_0x52274e(0x237)](_0x1ae4ad=>!_0x1ae4ad[_0x52274e(0x291)]||!isPendingSegmentId(_0x1ae4ad[_0x52274e(0x291)])));if(_0x1746f9[_0x52274e(0x1d7)])for(const _0x1a1fd4 of Object['keys'](_0x1746f9[_0x52274e(0x1d7)])){const _0x500afd=_0x1746f9[_0x52274e(0x1d7)][_0x1a1fd4];_0x500afd[_0x52274e(0x231)]===_0x52274e(0x1a4)&&_0x500afd[_0x52274e(0x1f8)]&&isPendingActivationId(_0x500afd[_0x52274e(0x1f8)])&&(_0x500afd[_0x52274e(0x1f8)]='');if(_0x500afd[_0x52274e(0x231)]==='DecisionPoint'&&_0x500afd[_0x52274e(0x1e7)])for(const _0x5462d8 of _0x500afd['branches']){_0x5462d8[_0x52274e(0x291)]&&isPendingSegmentId(_0x5462d8[_0x52274e(0x291)])&&(_0x5462d8['segmentId']='');}_0x500afd['type']===_0x52274e(0x20b)&&stripWaitStepPendingIds(_0x500afd);}}}function resolvePendingIdsInRequest(_0x11c7e6,_0x180a01,_0xd4ce52,_0xf6d75,_0x321f09,_0x2de3ae){const _0x1b0a29=a115_0x188509,_0x5e061b=(_0x8533df,_0xdce9a1)=>{const _0x34eb56=a115_0x4469;if(!isPendingSegmentId(_0x8533df))return _0x8533df;const _0x56bd7c=extractPendingSegmentName(_0x8533df),_0x3ac14d=_0xf6d75[_0x34eb56(0x1e0)](_0x56bd7c);return!_0x3ac14d&&_0x2de3ae[_0x34eb56(0x28d)]?.(_0x34eb56(0x1ba)+_0x56bd7c+_0x34eb56(0x1fa)+_0xdce9a1),_0x3ac14d;};if(_0x11c7e6[_0x1b0a29(0x1ff)][_0x1b0a29(0x1c0)]?.['segmentId']&&isPendingSegmentId(_0x11c7e6[_0x1b0a29(0x1ff)][_0x1b0a29(0x1c0)][_0x1b0a29(0x291)])){const _0x31ff68=_0x5e061b(_0x11c7e6[_0x1b0a29(0x1ff)]['goal'][_0x1b0a29(0x291)],_0x1b0a29(0x23b));_0x31ff68&&(_0x11c7e6['attributes'][_0x1b0a29(0x1c0)][_0x1b0a29(0x291)]=_0x31ff68);}for(const _0x341e42 of _0x11c7e6[_0x1b0a29(0x1ff)][_0x1b0a29(0x252)]||[]){const _0x4c5b05=_0xd4ce52[_0x1b0a29(0x1e0)](_0x341e42[_0x1b0a29(0x206)][_0x1b0a29(0x1f5)]());_0x4c5b05&&(_0x341e42['id']=_0x4c5b05);if(_0x341e42[_0x1b0a29(0x20e)]?.[_0x1b0a29(0x291)]&&isPendingSegmentId(_0x341e42[_0x1b0a29(0x20e)][_0x1b0a29(0x291)])){const _0xf2d09b=_0x5e061b(_0x341e42[_0x1b0a29(0x20e)][_0x1b0a29(0x291)],'stage\x20\x27'+_0x341e42[_0x1b0a29(0x206)]+_0x1b0a29(0x22d));_0xf2d09b&&(_0x341e42[_0x1b0a29(0x20e)][_0x1b0a29(0x291)]=_0xf2d09b);}if(_0x341e42[_0x1b0a29(0x1f3)])for(const _0x5cf195 of _0x341e42['exitCriterias']){if(_0x5cf195['segmentId']&&isPendingSegmentId(_0x5cf195[_0x1b0a29(0x291)])){const _0x564bae=_0x5e061b(_0x5cf195['segmentId'],_0x1b0a29(0x1f7)+_0x341e42[_0x1b0a29(0x206)]+_0x1b0a29(0x1cd));_0x564bae&&(_0x5cf195[_0x1b0a29(0x291)]=_0x564bae);}}if(_0x341e42[_0x1b0a29(0x257)]?.[_0x1b0a29(0x291)]&&isPendingSegmentId(_0x341e42['milestone']['segmentId'])){const _0x5526d1=_0x5e061b(_0x341e42['milestone'][_0x1b0a29(0x291)],_0x1b0a29(0x1f7)+_0x341e42['name']+_0x1b0a29(0x25f));_0x5526d1&&(_0x341e42['milestone'][_0x1b0a29(0x291)]=_0x5526d1);}if(_0x341e42[_0x1b0a29(0x1d7)]){const _0x2e7eab=_0xa2b04e=>_0x180a01[_0x1b0a29(0x1ff)][_0x1b0a29(0x252)]?.[_0x1b0a29(0x1c9)](_0x2063d2=>_0x2063d2[_0x1b0a29(0x206)][_0x1b0a29(0x1f5)]()===_0x341e42[_0x1b0a29(0x206)]['toLowerCase']())?.[_0x1b0a29(0x1d7)]?.[_0xa2b04e];for(const _0xbc5812 of Object[_0x1b0a29(0x233)](_0x341e42[_0x1b0a29(0x1d7)])){const _0x309c5c=_0x341e42[_0x1b0a29(0x1d7)][_0xbc5812],_0x5883ca=_0x2e7eab(_0xbc5812);if(_0x309c5c[_0x1b0a29(0x231)]===_0x1b0a29(0x1a4)&&_0x309c5c['journeyActivationStepId']&&(isPendingActivationId(_0x309c5c[_0x1b0a29(0x1f8)])||_0x309c5c[_0x1b0a29(0x1f8)]==='')){if(_0x5883ca?.['journeyActivationStepId']&&isPendingActivationId(_0x5883ca[_0x1b0a29(0x1f8)])){const _0x1ca739=extractPendingActivationName(_0x5883ca['journeyActivationStepId']),_0x464a2f=_0x321f09['get'](_0x1ca739);_0x464a2f&&(_0x309c5c[_0x1b0a29(0x1f8)]=_0x464a2f);}}if(_0x309c5c[_0x1b0a29(0x231)]===_0x1b0a29(0x24d)&&_0x309c5c[_0x1b0a29(0x1e7)]&&_0x5883ca?.['branches'])for(let _0x45afb8=0x0;_0x45afb8<_0x309c5c[_0x1b0a29(0x1e7)]['length'];_0x45afb8++){const _0x492f86=_0x309c5c[_0x1b0a29(0x1e7)][_0x45afb8],_0x60def2=_0x5883ca[_0x1b0a29(0x1e7)][_0x45afb8];if(_0x60def2?.[_0x1b0a29(0x291)]&&isPendingSegmentId(_0x60def2[_0x1b0a29(0x291)])){const _0x195d35=_0x5e061b(_0x60def2[_0x1b0a29(0x291)],_0x1b0a29(0x1f7)+_0x341e42['name']+_0x1b0a29(0x1c6)+(_0x492f86[_0x1b0a29(0x206)]||_0x45afb8)+'\x27');_0x195d35&&(_0x492f86[_0x1b0a29(0x291)]=_0x195d35);}}_0x309c5c[_0x1b0a29(0x231)]===_0x1b0a29(0x20b)&&_0x5883ca?.[_0x1b0a29(0x231)]===_0x1b0a29(0x20b)&&resolveWaitStepPendingIds(_0x309c5c,_0x5883ca,_0x5e061b,_0x341e42[_0x1b0a29(0x206)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a116_0x504f(_0xe7fa5a,_0x592bf2){_0xe7fa5a=_0xe7fa5a-0xa0;const _0x343a2b=a116_0x343a();let _0x504f41=_0x343a2b[_0xe7fa5a];return _0x504f41;}function a116_0x343a(){const _0x3c5a24=['41060pTjpbW','22482jBjJFs','set','3540780EGZZcx','8iKewUh','get','parentFolderId','10106eTdKdt','131UZQsdp','4218039qYTBRI','add','has','3378960nVHMaJ','123JzRCSS','2240997UKHtVS','1162kEmbxg','name'];a116_0x343a=function(){return _0x3c5a24;};return a116_0x343a();}(function(_0x2e2d6a,_0x48c6d6){const _0x3acd28=a116_0x504f,_0x5285b6=_0x2e2d6a();while(!![]){try{const _0x49258c=-parseInt(_0x3acd28(0xaa))/0x1*(parseInt(_0x3acd28(0xa9))/0x2)+parseInt(_0x3acd28(0xaf))/0x3*(parseInt(_0x3acd28(0xa2))/0x4)+parseInt(_0x3acd28(0xa5))/0x5+-parseInt(_0x3acd28(0xa3))/0x6*(-parseInt(_0x3acd28(0xa0))/0x7)+-parseInt(_0x3acd28(0xa6))/0x8*(parseInt(_0x3acd28(0xab))/0x9)+-parseInt(_0x3acd28(0xae))/0xa+parseInt(_0x3acd28(0xb0))/0xb;if(_0x49258c===_0x48c6d6)break;else _0x5285b6['push'](_0x5285b6['shift']());}catch(_0x27a2ea){_0x5285b6['push'](_0x5285b6['shift']());}}}(a116_0x343a,0x76b60));export function buildFolderIdToPathMap(_0x4d120c){const _0x12550b=a116_0x504f,_0x4124b0=new Map(),_0x340ff7=new Map();for(const _0x2660fe of _0x4d120c){_0x340ff7[_0x12550b(0xa4)](_0x2660fe['id'],_0x2660fe);}const _0x4fcebf=new Set();for(const _0x476a1a of _0x4d120c){!_0x476a1a[_0x12550b(0xa8)]&&_0x4fcebf['add'](_0x476a1a['id']);}function _0x2dc793(_0x45df50){const _0x1eab02=_0x12550b;if(_0x4124b0[_0x1eab02(0xad)](_0x45df50['id']))return _0x4124b0[_0x1eab02(0xa7)](_0x45df50['id']);if(_0x4fcebf[_0x1eab02(0xad)](_0x45df50['id']))return _0x4124b0[_0x1eab02(0xa4)](_0x45df50['id'],''),'';if(_0x45df50[_0x1eab02(0xa8)]){const _0x209f1d=_0x340ff7[_0x1eab02(0xa7)](_0x45df50[_0x1eab02(0xa8)]);if(_0x209f1d){const _0x352149=_0x2dc793(_0x209f1d),_0xe74301=_0x352149?_0x352149+'/'+_0x45df50[_0x1eab02(0xa1)]:_0x45df50[_0x1eab02(0xa1)];return _0x4124b0['set'](_0x45df50['id'],_0xe74301),_0xe74301;}}const _0x1415b3=_0x45df50['name'];return _0x4124b0[_0x1eab02(0xa4)](_0x45df50['id'],_0x1415b3),_0x1415b3;}for(const _0x555ca2 of _0x4d120c){_0x2dc793(_0x555ca2);}return _0x4124b0;}export function buildFolderPathToIdMap(_0x40e79d){const _0x258b01=a116_0x504f,_0x5cac51=new Map(),_0x170374=new Map();for(const _0x5dbdad of _0x40e79d){_0x170374['set'](_0x5dbdad['id'],_0x5dbdad);}const _0x48f581=new Set();for(const _0x2e07fc of _0x40e79d){!_0x2e07fc[_0x258b01(0xa8)]&&_0x48f581[_0x258b01(0xac)](_0x2e07fc['id']);}function _0x171867(_0x5b74ae){const _0x4df2ec=_0x258b01;if(_0x48f581[_0x4df2ec(0xad)](_0x5b74ae['id']))return'';if(_0x5b74ae[_0x4df2ec(0xa8)]){const _0x3465fd=_0x170374['get'](_0x5b74ae[_0x4df2ec(0xa8)]);if(_0x3465fd){const _0x49eec5=_0x171867(_0x3465fd);return _0x49eec5?_0x49eec5+'/'+_0x5b74ae[_0x4df2ec(0xa1)]:_0x5b74ae[_0x4df2ec(0xa1)];}}return _0x5b74ae[_0x4df2ec(0xa1)];}for(const _0x5e7588 of _0x40e79d){const _0x11647e=_0x171867(_0x5e7588);_0x5cac51[_0x258b01(0xa4)](_0x11647e,_0x5e7588['id']);}return _0x5cac51;}export function buildFolderMaps(_0x2720bd){const _0x5c8985=buildFolderIdToPathMap(_0x2720bd),_0x23deed=new Map();for(const [_0x5d56ac,_0x2718dc]of _0x5c8985){_0x23deed['set'](_0x2718dc,_0x5d56ac);}return{'idToPath':_0x5c8985,'pathToId':_0x23deed};}export function getFolderPath(_0x1984b2,_0x35d6cd){const _0xc485f=a116_0x504f;if(!_0x1984b2)return'';return _0x35d6cd[_0xc485f(0xa7)](_0x1984b2)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x493485,_0x54ce0f){const _0x1b8b15=a117_0x532c,_0x3c4e84=_0x493485();while(!![]){try{const _0x4d44f8=parseInt(_0x1b8b15(0xd6))/0x1+-parseInt(_0x1b8b15(0xd4))/0x2+parseInt(_0x1b8b15(0xc1))/0x3+-parseInt(_0x1b8b15(0xb7))/0x4+-parseInt(_0x1b8b15(0xd8))/0x5*(-parseInt(_0x1b8b15(0xd3))/0x6)+-parseInt(_0x1b8b15(0xba))/0x7+parseInt(_0x1b8b15(0xd9))/0x8;if(_0x4d44f8===_0x54ce0f)break;else _0x3c4e84['push'](_0x3c4e84['shift']());}catch(_0x776469){_0x3c4e84['push'](_0x3c4e84['shift']());}}}(a117_0x4860,0x983d8));function a117_0x4860(){const _0x2638e3=['raw','8576120sGRAGX','type','split','slice','readFile','segment','replace','2856489rTXBUp','endsWith','startsWith','pop','test','join','File\x20not\x20found:\x20','resolve','root','journey','filter','.yaml','exists','parse','parent_segment','Path\x20attempts\x20to\x20navigate\x20above\x20root','push','length','169692qVWzbM','1877196TLFTZy','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','1121037JRMezh','Path\x20segment\x20cannot\x20be\x20empty','10MxHGVP','13673512APYKMT','trim','dirname','Cannot\x20navigate\x20above\x20root','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','segments','isAbsolute','4206476cWuydL','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field'];a117_0x4860=function(){return _0x2638e3;};return a117_0x4860();}import a117_0x22374c from'path';import{parse as a117_0x460075}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x24c705){const _0xb48401=a117_0x532c;if(!_0x24c705||_0x24c705[_0xb48401(0xda)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x397b37=_0x24c705['trim']();if(_0x397b37==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x24c705};const _0x41a9c6=_0x397b37[_0xb48401(0xc3)]('/')?_0x397b37['substring'](0x1):_0x397b37,_0x77f89d=_0x41a9c6[_0xb48401(0xbc)]('/')[_0xb48401(0xcb)](_0x2c1e3b=>_0x2c1e3b!=='');if(_0x77f89d[_0xb48401(0xd2)]===0x0)throw new Error('Path\x20must\x20contain\x20at\x20least\x20one\x20segment');const _0x125b20=_0x397b37['startsWith']('/')||!isRelativePathSegment(_0x77f89d[0x0]);for(const _0x5d0302 of _0x77f89d){validatePathSegment(_0x5d0302);}return{'segments':_0x77f89d,'isAbsolute':_0x125b20,'raw':_0x24c705};}function isRelativePathSegment(_0x5b532c){return _0x5b532c==='.'||_0x5b532c==='..';}function a117_0x532c(_0x56ffdc,_0x2fe3ca){_0x56ffdc=_0x56ffdc-0xb2;const _0x48608d=a117_0x4860();let _0x532c89=_0x48608d[_0x56ffdc];return _0x532c89;}function validatePathSegment(_0x55af04){const _0x27da71=a117_0x532c;if(_0x55af04==='')throw new Error(_0x27da71(0xd7));if(_0x55af04==='.'||_0x55af04==='..')return;if(/[\x00-\x1F\x7F]/[_0x27da71(0xc5)](_0x55af04))throw new Error(_0x27da71(0xb4)+_0x55af04);if(_0x55af04!==_0x55af04['trim']()){}}export function validatePath(_0x49921b){const _0x47d445=a117_0x532c;if(_0x49921b[_0x47d445(0xb5)][_0x47d445(0xd2)]===0x0&&!_0x49921b['isAbsolute'])throw new Error('Relative\x20path\x20cannot\x20be\x20empty');if(_0x49921b['isAbsolute']){if(_0x49921b[_0x47d445(0xb5)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x251bee=0x0;for(const _0x9cbdaa of _0x49921b[_0x47d445(0xb5)]){if(_0x9cbdaa==='..'){if(_0x251bee===0x0)throw new Error(_0x47d445(0xd0));_0x251bee--;}else _0x9cbdaa!=='.'&&_0x251bee++;}}}export function joinPaths(_0x3cff58,_0x5a67a3){const _0x5b505c=a117_0x532c;if(!_0x3cff58||_0x3cff58==='/')return _0x5a67a3;if(!_0x5a67a3||_0x5a67a3==='.')return _0x3cff58;if(_0x5a67a3[_0x5b505c(0xc3)]('/'))return _0x5a67a3;const _0x2e4988=parsePath(_0x3cff58),_0x3f6eaa=parsePath(_0x5a67a3),_0x5e45e1=[..._0x2e4988[_0x5b505c(0xb5)]];for(const _0x35d7f1 of _0x3f6eaa['segments']){if(_0x35d7f1==='.')continue;else{if(_0x35d7f1==='..'){if(_0x5e45e1[_0x5b505c(0xd2)]===0x0)throw new Error(_0x5b505c(0xb3));_0x5e45e1[_0x5b505c(0xc4)]();}else _0x5e45e1['push'](_0x35d7f1);}}const _0x5b7653=_0x5e45e1[_0x5b505c(0xc6)]('/');return _0x2e4988[_0x5b505c(0xb9)]['startsWith']('/')?'/'+_0x5b7653:_0x5b7653;}export function normalizePath(_0x267868){const _0x4b978c=a117_0x532c,_0x3e72be=parsePath(_0x267868),_0x597126=[];for(const _0x4e4a8f of _0x3e72be['segments']){if(_0x4e4a8f==='.')continue;else{if(_0x4e4a8f==='..'){if(_0x597126['length']===0x0){if(_0x3e72be[_0x4b978c(0xb6)])throw new Error(_0x4b978c(0xb3));_0x597126[_0x4b978c(0xd1)]('..');}else _0x597126[_0x597126[_0x4b978c(0xd2)]-0x1]==='..'?_0x597126[_0x4b978c(0xd1)]('..'):_0x597126['pop']();}else _0x597126[_0x4b978c(0xd1)](_0x4e4a8f);}}if(_0x597126['length']===0x0)return _0x3e72be['isAbsolute']?'/':'.';const _0xd02457=_0x597126[_0x4b978c(0xc6)]('/');return _0x3e72be[_0x4b978c(0xb9)][_0x4b978c(0xc3)]('/')?'/'+_0xd02457:_0xd02457;}export function getParentPath(_0x1208c8){const _0x3a02c4=a117_0x532c,_0x2cbea3=parsePath(_0x1208c8);if(_0x2cbea3[_0x3a02c4(0xb5)][_0x3a02c4(0xd2)]<=0x1)return'/';const _0x1094f0=_0x2cbea3['segments'][_0x3a02c4(0xbd)](0x0,-0x1)[_0x3a02c4(0xc6)]('/');return _0x2cbea3[_0x3a02c4(0xb9)][_0x3a02c4(0xc3)]('/')?'/'+_0x1094f0:_0x1094f0;}export function getBaseName(_0x50e289){const _0x102132=a117_0x532c,_0xddfed9=parsePath(_0x50e289);return _0xddfed9[_0x102132(0xb5)][_0xddfed9[_0x102132(0xb5)][_0x102132(0xd2)]-0x1]||'';}export function isChildPath(_0x4da50e,_0x3b3b30){const _0x572356=a117_0x532c,_0x56a2ef=parsePath(_0x4da50e),_0x53ebde=parsePath(_0x3b3b30);if(_0x56a2ef[_0x572356(0xb5)]['length']<=_0x53ebde[_0x572356(0xb5)][_0x572356(0xd2)])return![];for(let _0x1c52a7=0x0;_0x1c52a7<_0x53ebde[_0x572356(0xb5)]['length'];_0x1c52a7++){if(_0x56a2ef[_0x572356(0xb5)][_0x1c52a7]!==_0x53ebde[_0x572356(0xb5)][_0x1c52a7])return![];}return!![];}export function splitPath(_0x38731b){const _0x3edb19=a117_0x532c,_0x327107=parsePath(_0x38731b);if(_0x327107[_0x3edb19(0xb5)]['length']===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x327107[_0x3edb19(0xb5)][_0x3edb19(0xd2)]===0x1)return{'parent':_0x327107['segments'][0x0]};return{'parent':_0x327107['segments'][0x0],'child':_0x327107['segments'][_0x3edb19(0xbd)](0x1)[_0x3edb19(0xc6)]('/')};}export function isYamlFilePath(_0x1089c5){const _0x2f105d=a117_0x532c;return _0x1089c5['endsWith']('.yml')||_0x1089c5[_0x2f105d(0xc2)](_0x2f105d(0xcc));}export async function resolveYamlFilePath(_0xd5a5a7,_0x289ddd=nodeFileSystem){const _0x36f12b=a117_0x532c,_0x250396=a117_0x22374c[_0x36f12b(0xc8)](_0xd5a5a7);if(!await _0x289ddd[_0x36f12b(0xcd)](_0x250396))throw new Error(_0x36f12b(0xc7)+_0xd5a5a7);let _0x572110=a117_0x22374c[_0x36f12b(0xb2)](_0x250396),_0x4cc84c=null,_0xf2a6c9=null;const _0x2acb97=a117_0x22374c['parse'](_0x572110)[_0x36f12b(0xc9)];while(_0x572110!==_0x2acb97){const _0x5044ec=a117_0x22374c[_0x36f12b(0xc6)](_0x572110,'tdx.json');if(await _0x289ddd[_0x36f12b(0xcd)](_0x5044ec)){_0x4cc84c=_0x5044ec,_0xf2a6c9=_0x572110;break;}_0x572110=a117_0x22374c['dirname'](_0x572110);}if(!_0x4cc84c||!_0xf2a6c9)throw new Error('No\x20tdx.json\x20found\x20for\x20file:\x20'+_0xd5a5a7);const _0x4b153f=await _0x289ddd[_0x36f12b(0xbe)](_0x4cc84c),_0x1c4fca=JSON[_0x36f12b(0xce)](_0x4b153f),_0x554b87=_0x1c4fca[_0x36f12b(0xcf)];if(!_0x554b87)throw new Error(_0x36f12b(0xb8));const _0xb27fcc=await _0x289ddd[_0x36f12b(0xbe)](_0x250396),_0x2bf288=a117_0x460075(_0xb27fcc),_0x5f3e7c=_0x2bf288['name'];if(!_0x5f3e7c)throw new Error(_0x36f12b(0xd5)+_0xd5a5a7);const _0x251477=_0x2bf288[_0x36f12b(0xbb)]===_0x36f12b(0xca)?_0x36f12b(0xca):_0x36f12b(0xbf),_0x1226f2=a117_0x22374c['relative'](_0xf2a6c9,_0x250396),_0x2c1f0f=a117_0x22374c[_0x36f12b(0xb2)](_0x1226f2),_0x42aa50=_0x2c1f0f==='.'?'':_0x2c1f0f[_0x36f12b(0xc0)](/\\/g,'/'),_0x3b9828=_0x42aa50?_0x554b87+'/'+_0x42aa50+'/'+_0x5f3e7c:_0x554b87+'/'+_0x5f3e7c;return{'parentSegment':_0x554b87,'segmentName':_0x5f3e7c,'folderPath':_0x42aa50,'fullPath':_0x3b9828,'resourceType':_0x251477};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c262e,_0x4d8dc1){const _0x4c2285=a118_0x1c61,_0x169c67=_0x5c262e();while(!![]){try{const _0x42175f=parseInt(_0x4c2285(0x101))/0x1*(parseInt(_0x4c2285(0xf7))/0x2)+parseInt(_0x4c2285(0xfb))/0x3*(parseInt(_0x4c2285(0xfa))/0x4)+-parseInt(_0x4c2285(0xfd))/0x5+parseInt(_0x4c2285(0xf6))/0x6+parseInt(_0x4c2285(0xff))/0x7+parseInt(_0x4c2285(0xfe))/0x8+-parseInt(_0x4c2285(0x102))/0x9;if(_0x42175f===_0x4d8dc1)break;else _0x169c67['push'](_0x169c67['shift']());}catch(_0x1c91fc){_0x169c67['push'](_0x169c67['shift']());}}}(a118_0x4d63,0xae313));export function parseSegmentRef(_0x18126f){const _0x1ccb33=a118_0x1c61,_0x38065e=_0x18126f['indexOf']('/');if(_0x38065e===-0x1)return{'parentId':_0x18126f};if(_0x38065e===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x18126f+_0x1ccb33(0xfc));const _0x56c41b=_0x18126f[_0x1ccb33(0xf8)](0x0,_0x38065e),_0x7f52db=_0x18126f[_0x1ccb33(0xf8)](_0x38065e+0x1);if(_0x7f52db==='')throw new Error(_0x1ccb33(0x100)+_0x18126f+_0x1ccb33(0xf9));return{'parentId':_0x56c41b,'childId':_0x7f52db};}function a118_0x1c61(_0x4c4900,_0xa6f04){_0x4c4900=_0x4c4900-0xf6;const _0x4d630a=a118_0x4d63();let _0x1c61b3=_0x4d630a[_0x4c4900];return _0x1c61b3;}function a118_0x4d63(){const _0xf7e6ab=['5216720DpmDWI','3712863oEWrtV','Invalid\x20segment\x20reference\x20format:\x20','1KIZyhY','21509109yrOsTt','8092470sYCyNZ','297716nVZgUi','substring','.\x20Child\x20name\x20cannot\x20be\x20empty','144khxWxq','87348NctWaq','.\x20Parent\x20name\x20cannot\x20be\x20empty','3124430iUZSpB'];a118_0x4d63=function(){return _0xf7e6ab;};return a118_0x4d63();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e17af,_0xa5c2d4){const _0x1c78cf=a119_0x3948,_0x1c18ec=_0x4e17af();while(!![]){try{const _0x1dc6ed=-parseInt(_0x1c78cf(0x98))/0x1+parseInt(_0x1c78cf(0x69))/0x2*(-parseInt(_0x1c78cf(0x85))/0x3)+-parseInt(_0x1c78cf(0x89))/0x4+-parseInt(_0x1c78cf(0x80))/0x5+-parseInt(_0x1c78cf(0x79))/0x6+parseInt(_0x1c78cf(0x76))/0x7*(-parseInt(_0x1c78cf(0x86))/0x8)+parseInt(_0x1c78cf(0x8b))/0x9;if(_0x1dc6ed===_0xa5c2d4)break;else _0x1c18ec['push'](_0x1c18ec['shift']());}catch(_0xc405dc){_0x1c18ec['push'](_0x1c18ec['shift']());}}}(a119_0x5039,0xc2010));import a119_0x12a988 from'path';import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x58a10f){const _0x16ac61=a119_0x3948;return _0x58a10f[_0x16ac61(0x82)]!==_0x16ac61(0x88);}function a119_0x5039(){const _0xfca6e=['parent_segment','Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension','no_parent','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','context','134ZXGfBd','relative','segmentName','journey','cwd','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','join','extname','parse','parent_name','resourceType','message','scopedFolderPath','147jvziIs','basename','isFile','1455276lSzkaH','resolve','tdx.json','directory','trim','File\x20not\x20found','no_config','741300yHtcEV','dirname','type','startsWith','root','40470vXqnbz','409928ynAGJD','exists','error','4669500rTcYpO','match','39350754tcxMee','No\x20tdx.json\x20found\x20for\x20file:\x20','parentSegment','isDirectory','File\x20not\x20found:\x20','segment','replace','file','No\x20tdx.json\x20found','isScoped','file_not_found','stat','configDir','39594TXOtpB','Not\x20a\x20YAML\x20file:\x20','readFile','Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure','invalid_yaml','folderPath'];a119_0x5039=function(){return _0xfca6e;};return a119_0x5039();}export function isScopedResolution(_0x46de69){const _0x1fd017=a119_0x3948;return _0x46de69[_0x1fd017(0x82)]===_0x1fd017(0x7c)||_0x46de69[_0x1fd017(0x82)]==='file'||_0x46de69[_0x1fd017(0x82)]===_0x1fd017(0x68);}export function getScopedDetails(_0x44f00e){const _0x36e898=a119_0x3948;if(isScopedResolution(_0x44f00e))return{'isScoped':_0x44f00e['isScoped'],'scopedFolderPath':_0x44f00e[_0x36e898(0x75)]};return undefined;}function a119_0x3948(_0x10d057,_0x137745){_0x10d057=_0x10d057-0x65;const _0x5039f6=a119_0x5039();let _0x39484e=_0x5039f6[_0x10d057];return _0x39484e;}async function findTdxConfigAsync(_0x7c1675,_0x59f7f4){const _0xb34e2d=a119_0x3948;let _0x5dbe67=a119_0x12a988[_0xb34e2d(0x7a)](_0x7c1675);const _0x1e02d3=a119_0x12a988['parse'](_0x5dbe67)[_0xb34e2d(0x84)];while(_0x5dbe67!==_0x1e02d3){const _0x4e5049=a119_0x12a988[_0xb34e2d(0x6f)](_0x5dbe67,_0xb34e2d(0x7b));if(await _0x59f7f4[_0xb34e2d(0x87)](_0x4e5049))try{const _0x1fecc0=await _0x59f7f4[_0xb34e2d(0x9a)](_0x4e5049),_0x280b99=JSON[_0xb34e2d(0x71)](_0x1fecc0);if(_0x280b99[_0xb34e2d(0x9e)]&&typeof _0x280b99[_0xb34e2d(0x9e)]==='string')return{'configPath':_0x4e5049,'configDir':_0x5dbe67,'parentSegment':_0x280b99[_0xb34e2d(0x9e)]};}catch{}_0x5dbe67=a119_0x12a988['dirname'](_0x5dbe67);}return null;}function calculateScopedPath(_0x1276e2,_0x2fabbe){const _0x17f7b8=a119_0x3948,_0x17360=a119_0x12a988[_0x17f7b8(0x6a)](_0x2fabbe,_0x1276e2),_0x3de98c=_0x17360!==''&&_0x17360!=='.'&&!_0x17360[_0x17f7b8(0x83)]('..');return{'isScoped':_0x3de98c,'scopedFolderPath':_0x3de98c?_0x17360[_0x17f7b8(0x91)](/\\/g,'/'):''};}export async function resolveTarget(_0x306c99){const _0x3553cc=a119_0x3948,{arg:_0x582669,contextParent:_0x2d14dc,cwd:cwd=process[_0x3553cc(0x6d)](),fs:fs=nodeFileSystem}=_0x306c99;if(_0x582669&&isYamlFilePath(_0x582669))try{const _0x44fb28=await resolveYamlFilePath(_0x582669,fs),_0x40b481=a119_0x12a988[_0x3553cc(0x7a)](_0x582669),_0x53c942=a119_0x12a988[_0x3553cc(0x81)](_0x40b481),_0xdc4e05=await findTdxConfigAsync(_0x53c942,fs);if(!_0xdc4e05){if(_0x2d14dc){const _0x42d627=a119_0x12a988[_0x3553cc(0x81)](_0x40b481);return{'type':_0x3553cc(0x92),'parentName':_0x2d14dc,'targetDir':_0x42d627,'configRoot':_0x42d627,'filePath':_0x40b481,'resourceName':_0x44fb28['segmentName'],'folderPath':_0x44fb28[_0x3553cc(0x9d)],'resourceType':_0x44fb28[_0x3553cc(0x73)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x3553cc(0x88),'errorCode':'no_config','message':_0x3553cc(0x8c)+_0x582669,'arg':_0x582669,'helpText':_0x3553cc(0x67)};}const _0x6d75a=calculateScopedPath(_0x53c942,_0xdc4e05[_0x3553cc(0x97)]);return{'type':_0x3553cc(0x92),'parentName':_0xdc4e05[_0x3553cc(0x8d)],'targetDir':_0xdc4e05['configDir'],'configRoot':_0xdc4e05[_0x3553cc(0x97)],'filePath':_0x40b481,'resourceName':_0x44fb28[_0x3553cc(0x6b)],'folderPath':_0x44fb28[_0x3553cc(0x9d)],'resourceType':_0x44fb28['resourceType'],'isScoped':_0x6d75a['isScoped'],'scopedFolderPath':_0x6d75a[_0x3553cc(0x75)]};}catch(_0x3fcea6){const _0xc3a1a5=_0x3fcea6 instanceof Error?_0x3fcea6[_0x3553cc(0x74)]:String(_0x3fcea6);if(_0xc3a1a5['includes'](_0x3553cc(0x7e)))return{'type':'error','errorCode':_0x3553cc(0x95),'message':_0x3553cc(0x8f)+_0x582669,'arg':_0x582669};if(_0xc3a1a5['includes'](_0x3553cc(0x93))){if(_0x2d14dc){const _0x11731d=a119_0x12a988['resolve'](_0x582669);if(await fs[_0x3553cc(0x87)](_0x11731d)){const _0x40fa3a=a119_0x12a988[_0x3553cc(0x81)](_0x11731d),_0x1a6df5=await fs[_0x3553cc(0x9a)](_0x11731d),_0xd32383=_0x1a6df5[_0x3553cc(0x8a)](/^name:\s*["']?([^"'\n]+)["']?/m),_0x48271a=_0x1a6df5['match'](/^type:\s*["']?([^"'\n]+)["']?/m),_0x2ce946=_0xd32383?_0xd32383[0x1][_0x3553cc(0x7d)]():a119_0x12a988[_0x3553cc(0x77)](_0x582669,a119_0x12a988[_0x3553cc(0x70)](_0x582669)),_0x334cef=_0x48271a&&_0x48271a[0x1][_0x3553cc(0x7d)]()==='journey'?_0x3553cc(0x6c):_0x3553cc(0x90);return{'type':_0x3553cc(0x92),'parentName':_0x2d14dc,'targetDir':_0x40fa3a,'configRoot':_0x40fa3a,'filePath':_0x11731d,'resourceName':_0x2ce946,'folderPath':'','resourceType':_0x334cef,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x3553cc(0x88),'errorCode':_0x3553cc(0x7f),'message':_0x3553cc(0x8c)+_0x582669,'arg':_0x582669,'helpText':_0x3553cc(0x67)};}return{'type':_0x3553cc(0x88),'errorCode':_0x3553cc(0x9c),'message':_0xc3a1a5,'arg':_0x582669};}if(_0x582669){const _0x162e48=a119_0x12a988[_0x3553cc(0x7a)](cwd,_0x582669);let _0x4d23f3=null;try{_0x4d23f3=await fs[_0x3553cc(0x96)](_0x162e48);}catch{}if(_0x4d23f3?.[_0x3553cc(0x8e)]()){const _0x431514=await findTdxConfigAsync(_0x162e48,fs);if(_0x431514){const _0x14e546=calculateScopedPath(_0x162e48,_0x431514[_0x3553cc(0x97)]);return{'type':_0x3553cc(0x7c),'parentName':_0x431514['parentSegment'],'targetDir':_0x162e48,'configRoot':_0x431514[_0x3553cc(0x97)],'isScoped':_0x14e546[_0x3553cc(0x94)],'scopedFolderPath':_0x14e546[_0x3553cc(0x75)]};}if(_0x2d14dc)return{'type':_0x3553cc(0x7c),'parentName':_0x2d14dc,'targetDir':_0x162e48,'configRoot':_0x162e48,'isScoped':![],'scopedFolderPath':''};return{'type':_0x3553cc(0x88),'errorCode':_0x3553cc(0x7f),'message':_0x3553cc(0x6e)+_0x582669,'arg':_0x582669,'helpText':_0x3553cc(0x67)};}if(_0x4d23f3?.[_0x3553cc(0x78)]())return{'type':_0x3553cc(0x88),'errorCode':'invalid_yaml','message':_0x3553cc(0x99)+_0x582669,'arg':_0x582669,'helpText':_0x3553cc(0x65)};const _0x795e4c=sanitizeFileName(_0x582669),_0x53b992=getSegmentRootDir(_0x795e4c,cwd);return{'type':_0x3553cc(0x72),'parentName':_0x582669,'targetDir':_0x53b992,'configRoot':_0x53b992};}const _0x4bb888=await findTdxConfigAsync(cwd,fs);if(_0x4bb888){const _0x8899be=calculateScopedPath(cwd,_0x4bb888['configDir']);return{'type':_0x3553cc(0x68),'parentName':_0x4bb888[_0x3553cc(0x8d)],'targetDir':cwd,'configRoot':_0x4bb888['configDir'],'isScoped':_0x8899be[_0x3553cc(0x94)],'scopedFolderPath':_0x8899be[_0x3553cc(0x75)]};}if(_0x2d14dc){const _0x34db36=sanitizeFileName(_0x2d14dc),_0x36c25b=getSegmentRootDir(_0x34db36,cwd);return{'type':_0x3553cc(0x68),'parentName':_0x2d14dc,'targetDir':_0x36c25b,'configRoot':_0x36c25b,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x3553cc(0x88),'errorCode':_0x3553cc(0x66),'message':'Parent\x20segment\x20not\x20specified','helpText':_0x3553cc(0x9b)};}
|