@treasuredata/tdx 2026.3.51 → 2026.3.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +2 -0
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.d.ts +50 -0
- package/dist/mcp/tools/work-create-item.d.ts.map +1 -0
- package/dist/mcp/tools/work-create-item.js +1 -0
- package/dist/mcp/tools/work-create-item.js.map +1 -0
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +15 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +14 -2
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a151_0x2ed631=a151_0x5571;(function(_0x15ff81,_0x25ac25){const _0x39ec80=a151_0x5571,_0x2eee15=_0x15ff81();while(!![]){try{const _0xe5b872=parseInt(_0x39ec80(0x1fb))/0x1+parseInt(_0x39ec80(0x1c6))/0x2*(-parseInt(_0x39ec80(0x1c2))/0x3)+-parseInt(_0x39ec80(0x134))/0x4*(-parseInt(_0x39ec80(0x11e))/0x5)+-parseInt(_0x39ec80(0x186))/0x6*(parseInt(_0x39ec80(0x129))/0x7)+parseInt(_0x39ec80(0x20d))/0x8+parseInt(_0x39ec80(0x17f))/0x9*(-parseInt(_0x39ec80(0x11c))/0xa)+parseInt(_0x39ec80(0x1ff))/0xb*(parseInt(_0x39ec80(0x20a))/0xc);if(_0xe5b872===_0x25ac25)break;else _0x2eee15['push'](_0x2eee15['shift']());}catch(_0x1010f4){_0x2eee15['push'](_0x2eee15['shift']());}}}(a151_0x57e9,0xbee3e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x2ed631(0x14b));export const PENDING_SEGMENT_PREFIX=a151_0x2ed631(0x1a1);export const PENDING_ACTIVATION_PREFIX=a151_0x2ed631(0x13a);export function createPendingSegmentId(_0x2b4643){return''+PENDING_SEGMENT_PREFIX+_0x2b4643+'__';}export function isPendingSegmentId(_0x1e6863){const _0x58f24a=a151_0x2ed631;return _0x1e6863[_0x58f24a(0x131)](PENDING_SEGMENT_PREFIX)&&!_0x1e6863[_0x58f24a(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x58d5da){return _0x58d5da['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x26d196){return''+PENDING_ACTIVATION_PREFIX+_0x26d196+'__';}export function isPendingActivationId(_0x32eefe){const _0x6d57cb=a151_0x2ed631;return _0x32eefe[_0x6d57cb(0x131)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x29ae6c){const _0x30283c=a151_0x2ed631;return _0x29ae6c[_0x30283c(0x18d)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x5d01fa,_0x20a553){const _0x4402f3=a151_0x2ed631,_0x40f5b3=_0x5d01fa+'::'+(_0x20a553[_0x4402f3(0x130)]()||_0x4402f3(0x1b9)),_0x1859f5=createHash(_0x4402f3(0x1d5))['update'](_0x40f5b3)[_0x4402f3(0x219)](_0x4402f3(0x19d))[_0x4402f3(0x205)](0x0,0xc);return'journey_entry_criteria_'+_0x1859f5;}export function ensureJourneyDefaults(_0x2fe0fd){const _0x556c87=a151_0x2ed631;!_0x2fe0fd['description']&&(_0x2fe0fd['description']=''),!_0x2fe0fd[_0x556c87(0x1f8)]&&(_0x2fe0fd[_0x556c87(0x1f8)]=_0x556c87(0x172));}export function injectExistingStageIds(_0x53fc21,_0x36e427){const _0x374c5d=a151_0x2ed631,_0x35e8be=new Map(_0x36e427[_0x374c5d(0x191)](_0x385314=>[_0x385314[_0x374c5d(0x17c)],_0x385314['id']]));for(const _0x7cecef of _0x53fc21){if(!_0x7cecef['id']){const _0x521094=_0x35e8be[_0x374c5d(0x1ac)](_0x7cecef[_0x374c5d(0x17c)]);_0x521094&&(_0x7cecef['id']=_0x521094);}}}export function resolveTDFolderPath(_0x4e9b29,_0x15637e,_0x3e6048){const _0x45193e=a151_0x2ed631;if(!_0x15637e)return _0x4e9b29;if(_0x4e9b29===_0x3e6048||_0x4e9b29[_0x45193e(0x131)](_0x3e6048+'/'))return _0x4e9b29;return _0x4e9b29?_0x3e6048+'/'+_0x4e9b29:_0x3e6048;}export function addFoldersToCreate(_0x4966e0,_0xe2255e,_0x299980){const _0x3874e7=a151_0x2ed631;if(!_0x4966e0)return;if(_0xe2255e[_0x3874e7(0x1b5)](_0x4966e0))return;const _0x13255b=_0x4966e0[_0x3874e7(0x13c)]('/');let _0x101902='';for(const _0xd1e9c2 of _0x13255b){_0x101902=_0x101902?_0x101902+'/'+_0xd1e9c2:_0xd1e9c2,!_0xe2255e['has'](_0x101902)&&_0x299980['add'](_0x101902);}}export function sortFoldersByDepth(_0x1c3e13){return[..._0x1c3e13]['sort']((_0x4157f5,_0x17e89d)=>{const _0x1c90f2=a151_0x5571,_0x2c4ee3=(_0x4157f5['match'](/\//g)||[])[_0x1c90f2(0x165)],_0x1d6802=(_0x17e89d[_0x1c90f2(0x187)](/\//g)||[])[_0x1c90f2(0x165)];return _0x2c4ee3-_0x1d6802;});}import*as a151_0x297b00 from'yaml';import{readFileSync}from'fs';import a151_0x574767 from'path';import{isJourneyDef,parseYamlString as a151_0x113781,toYamlString as a151_0x36b8c4,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(_0x346c3a){const _0xf72f14=a151_0x2ed631;if(Array[_0xf72f14(0x20f)](_0x346c3a))return'['+_0x346c3a[_0xf72f14(0x191)](_0x543cb0=>stableStringify(_0x543cb0))[_0xf72f14(0x1fe)](',')+']';if(_0x346c3a&&typeof _0x346c3a==='object'){const _0x254d7e=_0x346c3a,_0x1da62d=Object[_0xf72f14(0x197)](_0x254d7e)[_0xf72f14(0x158)](),_0x39879d=_0x1da62d[_0xf72f14(0x191)](_0xb4e890=>'\x22'+_0xb4e890+'\x22:'+stableStringify(_0x254d7e[_0xb4e890]));return'{'+_0x39879d['join'](',')+'}';}const _0x6e9829=JSON[_0xf72f14(0x14e)](_0x346c3a);return _0x6e9829===undefined?_0xf72f14(0x1bc):_0x6e9829;}function activationSignature(_0x1bc8ca){const _0x2f0cc5=a151_0x2ed631,_0x4ef6b1={'connection':_0x1bc8ca[_0x2f0cc5(0x153)],..._0x1bc8ca[_0x2f0cc5(0x1a4)]!==undefined&&{'all_columns':_0x1bc8ca[_0x2f0cc5(0x1a4)]},..._0x1bc8ca[_0x2f0cc5(0x155)]!==undefined&&{'columns':_0x1bc8ca[_0x2f0cc5(0x155)]},..._0x1bc8ca[_0x2f0cc5(0x170)]!==undefined&&{'behavior':_0x1bc8ca['behavior']},..._0x1bc8ca[_0x2f0cc5(0x142)]!==undefined&&{'schedule':_0x1bc8ca[_0x2f0cc5(0x142)]},..._0x1bc8ca['notification']!==undefined&&{'notification':_0x1bc8ca[_0x2f0cc5(0x163)]},..._0x1bc8ca[_0x2f0cc5(0x1ea)]!==undefined&&{'connector_config':_0x1bc8ca[_0x2f0cc5(0x1ea)]},..._0x1bc8ca[_0x2f0cc5(0x174)]!==undefined&&{'activation_template_id':_0x1bc8ca[_0x2f0cc5(0x174)]}};return stableStringify(_0x4ef6b1);}async function fetchSegment(_0x27e776,_0x4d2044,_0x333e8a,_0x571bef){const _0x1d26ec=a151_0x2ed631,_0x5dc1ac=_0x571bef?.[_0x1d26ec(0x1bb)](_0x499d1c=>_0x499d1c['id']===_0x333e8a);if(_0x5dc1ac)return _0x5dc1ac;try{return await _0x27e776[_0x1d26ec(0x1b9)]['getSegment'](_0x4d2044,_0x333e8a);}catch(_0x530167){logger['debug']('getSegment\x20failed\x20for\x20'+_0x333e8a+_0x1d26ec(0x188)+_0x530167);try{return await _0x27e776[_0x1d26ec(0x1b9)][_0x1d26ec(0x1b1)](_0x333e8a);}catch(_0x323ef7){return logger[_0x1d26ec(0x12c)](_0x1d26ec(0x177)+_0x333e8a+':\x20'+_0x323ef7),null;}}}function a151_0x57e9(){const _0x5830de=['Failed\x20to\x20fetch\x20referenced\x20segment\x20','results','logSuccess','includes','\x27\x20for\x20','Activation','behavior','logDeleted','draft','activationContext','activation_template_id','Condition','updateActivation','getSegmentEntity\x20also\x20failed\x20for\x20','milestone','update','Updating\x20segment\x20\x27','activation_deleted','name','connectionIdToNameMap','stage\x20\x27','9yjkNYT','unchanged','toLowerCase','Created\x20folder\x20\x27','onProgress','segment_creating','\x27\x20entry\x20criteria','83574apEpAj','match',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','conditionTimeoutDuration','segments','kind','Failed\x20to\x20','replace','journeyActivationNameToId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','\x27\x20exit\x20criteria','map','action','segmentNameToId','journeyName','uniqueSegmentName','segmentFolderId','keys','rule','max','attributes','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','list','hex','deps','./journey-yaml.js','\x27\x20not\x20found\x20in\x20journey\x20\x27','__pending_','activations','toISOString','all_columns','Delete\x20the\x20push\x20recovery\x20file\x20(','item','JOURNEY_SYNTAX_ERROR','relative','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','waitStepType','index','get','Deleting\x20activation\x20\x27','progress','entries','Segment\x20not\x20found:\x20','getSegmentEntity','deleteSegment','deleteActivation','Created\x20journey\x20\x27','has','SEGMENT_SYNTAX_ERROR','createActivation','journey','segment','journey_updated','find','null','existingActivation','activation_deleting','stages','nameToType','absolutePath','42XCuikz','Updated\x20activation\x20\x27','\x27\x20milestone','user','167988gnxSsp','set','hasChanges','fetchJourney','localName','idToName','activationStepsById','description','createJourneySegment','activation_updating','add','conditionTimeoutUnit','uniqueServerName','push','idToEmailMap','sha1','INTERNAL','deleted','isNew','rootFolderId','parseDocument','updateSegmentById','delete','Failed\x20to\x20resolve\x20activation\x20','segment_deleting','updated','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','Updated\x20journey\x20\x27','entryCriteria','Stage\x20\x27','embedded_segment_creating','Journey\x20\x27','size','with','\x20error(s)','run_after_journey_refresh','connector_config','embedded_activation_created','decision_point','getActivation','existingSegment','activationParams','conditionSegmentId','activationActions','entry','effectiveFolderId','buildUserMaps','journeyBundleName','Fetching\x20','embeddedSegmentNameToId','state','journeyStages','journeyBundlesByFolderAndName','1317053YSDqkh','journey_creating','filter','join','1265bseRiT','Updated\x20segment\x20\x27','segment_created','skipSegments','segmentId','message','slice','./child-segment-yaml.js','journeyId','createdSegmentId','../../utils/async.js','169500oHNZea','versionNumber','values','7294712xloHcQ','validatedRequest','isArray','Creating\x20activation\x20\x27','parse','some','createSegment','from','exitCriterias','\x20(referenced\x20in\x20journey\x20','journey_created','branches','digest','all','segmentByFolderAndName','Name\x20has\x20already\x20been\x20taken','SEGMENT_NOT_FOUND','12337860OIvDlN','journeyActivationStepId','35ecVOVj','utf-8','resolveSegment','logInfo','relationships','yamlActivation','valid','data','steps','folderPathToId','NOT_FOUND','658ZPfymN','WaitStep','ACTIVATION_UPDATE_ERROR','debug','existingJourney','and\x20the\x20server\x20segment,\x20then\x20retry.','conditions','trim','startsWith','createFolder','segment_deleted','370084QySbBy','withProgress','yamlConfig','folderId','type','Embedded\x20segment\x20\x27','__pending_act_','folderPath','split','journeys','resolvedRule','goal\x20criteria','\x27...','errors','schedule','Created\x20segment\x20\x27','created','flatMap','\x0a\x20\x20','create','dirname','Deleted\x20activation\x20\x27','journeyById','tdx.sdk.push-workflow','\x20segment\x20from\x20file:\x20','Duration','stringify','\x27\x20from\x20file:\x20','Activation\x20not\x20found:\x20','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','diff','connection','waitStep','columns','.$1.push-recovery.json','activation_updated','sort','Segment\x20not\x20found','existingSegments','DecisionPoint','getJourney','JOURNEY_UPDATE_ERROR','entry_criteria','toString','\x27\x20wait\x20condition','goal','listActivations','notification','parentId','length','waitStepUnit','journey_updating','createdSegmentIds','logWarning'];a151_0x57e9=function(){return _0x5830de;};return a151_0x57e9();}function recoverSegmentIdsFromPushRecovery(_0x24b910,_0x54cc76,_0x52af92){const _0x4ddee4=a151_0x2ed631,_0x1a9033=readPushRecovery(_0x24b910[_0x4ddee4(0x1c1)]);if(_0x1a9033?.[_0x4ddee4(0x194)]===_0x24b910[_0x4ddee4(0x136)][_0x4ddee4(0x17c)])for(const [_0x477445,_0x3274af]of Object[_0x4ddee4(0x1af)](_0x1a9033[_0x4ddee4(0x18a)])){const _0x280fdd=generateDeterministicJourneySegmentName(_0x24b910[_0x4ddee4(0x136)][_0x4ddee4(0x17c)],_0x477445);_0x3274af[_0x4ddee4(0x1d2)]===_0x280fdd&&(_0x54cc76[_0x4ddee4(0x1c7)](_0x477445,_0x3274af[_0x4ddee4(0x203)]),_0x52af92[_0x4ddee4(0x1c7)](_0x477445,_0x3274af[_0x4ddee4(0x203)]));}}async function createOrRecoverEmbeddedSegment(_0x1ebaf7,_0x182a3a,_0x4841e1,_0x3add28){const _0x4d0d26=a151_0x2ed631;let _0xc522d9;try{_0xc522d9=await _0x1ebaf7[_0x4d0d26(0x1b9)][_0x4d0d26(0x1ce)]({'name':_0x4841e1['uniqueSegmentName'],'description':_0x4841e1[_0x4d0d26(0x1cd)],'journeyId':_0x4841e1[_0x4d0d26(0x207)],'rule':_0x3add28(_0x4841e1[_0x4d0d26(0x13e)],!![]),'countPopulation':!![],'parentFolderId':_0x4841e1[_0x4d0d26(0x137)],'audienceId':_0x4841e1[_0x4d0d26(0x164)]});}catch(_0x22ff7d){const _0x1fdc21=_0x22ff7d instanceof Error&&_0x22ff7d[_0x4d0d26(0x204)][_0x4d0d26(0x16d)](_0x4d0d26(0x11a));if(_0x1fdc21){const _0x21c3fb=readPushRecovery(_0x182a3a[_0x4d0d26(0x1c1)]),_0x579864=_0x21c3fb?.['journeyName']===_0x182a3a[_0x4d0d26(0x136)][_0x4d0d26(0x17c)]?_0x21c3fb[_0x4d0d26(0x18a)][_0x4841e1[_0x4d0d26(0x1ca)]]:undefined;if(_0x579864?.['uniqueServerName']===_0x4841e1[_0x4d0d26(0x195)])await _0x1ebaf7[_0x4d0d26(0x1b9)][_0x4d0d26(0x1db)](_0x4841e1[_0x4d0d26(0x164)],_0x579864[_0x4d0d26(0x203)],{'description':_0x4841e1[_0x4d0d26(0x1cd)],'rule':_0x3add28(_0x4841e1[_0x4d0d26(0x13e)],!![]),'countPopulation':!![]}),_0xc522d9=_0x579864[_0x4d0d26(0x203)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d0d26(0x139)+_0x4841e1[_0x4d0d26(0x1ca)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x4d0d26(0x1a5)+_0x182a3a[_0x4d0d26(0x1c1)]['replace'](/([^/]+)$/,_0x4d0d26(0x156))+')\x20')+_0x4d0d26(0x12e),_0x22ff7d);}else throw _0x22ff7d;}return saveSegmentToPushRecovery(_0x182a3a[_0x4d0d26(0x1c1)],_0x182a3a[_0x4d0d26(0x136)][_0x4d0d26(0x17c)],_0x4841e1['localName'],{'segmentId':_0xc522d9,'uniqueServerName':_0x4841e1[_0x4d0d26(0x195)],'createdAt':new Date()[_0x4d0d26(0x1a3)]()}),_0xc522d9;}export async function prepareSegmentFiles(_0x59f9ad,_0x4a8dce,_0x10a497,_0x95d730,_0x5919e0){const _0x582caa=a151_0x2ed631,{activationDefToCreateRequest:_0x3d5fe3}=await import('./child-segment-yaml.js'),_0x340951=[],_0x273fa4=new Set();for(const {yamlConfig:_0x4c39e4,folderPath:_0x2f9c94,sourcePath:_0x23e426}of _0x59f9ad){const _0x1223c2=resolveTDFolderPath(_0x2f9c94,_0x95d730,_0x5919e0),_0x286172=_0x1223c2+':'+_0x4c39e4[_0x582caa(0x17c)],_0x5217a0=_0x4a8dce[_0x582caa(0x119)][_0x582caa(0x1ac)](_0x286172),_0x1f8da2=_0x5217a0?_0x4a8dce['activationsBySegmentId'][_0x582caa(0x1ac)](_0x5217a0['id'])||[]:[];addFoldersToCreate(_0x1223c2,_0x4a8dce[_0x582caa(0x127)],_0x273fa4);const _0x1a03e7=calculateActivationActions(_0x4c39e4[_0x582caa(0x1a2)]||[],_0x1f8da2,_0x4a8dce[_0x582caa(0x1d4)],_0x4a8dce[_0x582caa(0x17d)]);for(const _0x30bef4 of _0x1a03e7){(_0x30bef4[_0x582caa(0x138)]==='create'||_0x30bef4[_0x582caa(0x138)]===_0x582caa(0x179))&&_0x30bef4[_0x582caa(0x123)]&&(_0x30bef4['validatedRequest']=await _0x3d5fe3(_0x30bef4[_0x582caa(0x123)],_0x10a497));}const _0x28f254=calculateSegmentDiff(_0x4c39e4,_0x5217a0,_0x1f8da2,_0x4a8dce[_0x582caa(0x1d4)],_0x4a8dce[_0x582caa(0x17d)]);_0x340951['push']({'relativePath':_0x4c39e4[_0x582caa(0x17c)],'absolutePath':_0x23e426,'yamlConfig':_0x4c39e4,'folderPath':_0x1223c2,'existingSegment':_0x5217a0,'existingActivations':_0x1f8da2,'isNew':_0x28f254[_0x582caa(0x1d8)],'hasChanges':_0x28f254[_0x582caa(0x1c8)],'diff':_0x28f254[_0x582caa(0x152)],'activationActions':_0x1a03e7});}return{'segmentFiles':_0x340951,'foldersToCreate':_0x273fa4};}export async function prepareJourneyFiles(_0x2a48b6,_0x36b31,_0x16cb24,_0xa4e5d1){const _0x39c10a=a151_0x2ed631,_0x45c740=[],_0x53ff2=new Set();for(const {yamlConfig:_0x4a115a,folderPath:_0x2aff95,sourcePath:_0x2bb4c9}of _0x2a48b6){const _0x2bde7a=resolveTDFolderPath(_0x2aff95,_0x16cb24,_0xa4e5d1),_0x694535=_0x2bde7a+':'+_0x4a115a[_0x39c10a(0x17c)],_0x249d94=_0x36b31[_0x39c10a(0x1fa)][_0x39c10a(0x1ac)](_0x694535);let _0x53172f,_0x552416;if(_0x249d94&&_0x249d94[_0x39c10a(0x165)]>0x0){const _0x4e767e=buildLocalExpandedRuleMappings(_0x4a115a),{createYamlContext:_0xbcf750,prefetchJourneySegments:_0x6a6db5}=createPushYamlContextForBundle(_0x36b31[_0x39c10a(0x19e)],_0x36b31[_0x39c10a(0x164)],_0x36b31[_0x39c10a(0x15a)],_0x4e767e,_0x36b31[_0x39c10a(0x1d4)],_0x36b31[_0x39c10a(0x17d)],_0x36b31[_0x39c10a(0x1cc)],_0x36b31['journeyById']);await _0x6a6db5(_0x249d94[_0x39c10a(0x191)](_0x570bac=>_0x570bac['id']));const _0x171515=await _0x36b31[_0x39c10a(0x19e)][_0x39c10a(0x1b8)]['getLatestJourneyId'](_0x249d94[0x0]['journeyBundleId']),_0xdffef3=hasMultipleVersions(_0x4a115a),_0x42b92d=async _0x22c5c5=>{const _0x3981dd=_0x39c10a,_0x56d36c=_0x36b31[_0x3981dd(0x14a)]?.[_0x3981dd(0x1ac)](_0x22c5c5);if(_0x56d36c)return _0x56d36c;return _0x36b31[_0x3981dd(0x1c9)]({'journeyId':_0x22c5c5,'journeyName':_0x4a115a[_0x3981dd(0x17c)],'isMultiVersion':_0x249d94['length']>0x1});};if(_0xdffef3&&_0x249d94[_0x39c10a(0x165)]>0x1){const _0x2fbfd4=[];for(const _0x5bcf93 of _0x249d94){const _0x319bca=_0x5bcf93[_0x39c10a(0x20b)]||0x1;_0x36b31[_0x39c10a(0x1ae)]?.[_0x39c10a(0x179)]('Fetching\x20'+_0x4a115a[_0x39c10a(0x17c)]+'\x20v'+_0x319bca);const _0x5e1a46=await _0x42b92d(_0x5bcf93['id']),_0x871183=_0xbcf750(_0x5bcf93['id']),_0x2a3301=await journeyResponseToDef(_0x5e1a46,_0x871183);_0x2fbfd4['push']({'item':_0x5bcf93,'yaml':_0x2a3301});}const _0x3f47bf=buildLocalRuleToNameMappingFromJourney(_0x4a115a);_0x552416=buildMergedJourneyDef(_0x2fbfd4,_0x3f47bf,_0x171515);const _0x86571c=Math[_0x39c10a(0x199)](..._0x2fbfd4['map'](_0x8cf8f8=>_0x8cf8f8[_0x39c10a(0x1a6)][_0x39c10a(0x20b)]||0x0)),_0xc4f526=_0x249d94[_0x39c10a(0x1bb)](_0x24a703=>(_0x24a703[_0x39c10a(0x20b)]||0x0)===_0x86571c);_0xc4f526&&(_0x36b31[_0x39c10a(0x1ae)]?.['update'](_0x39c10a(0x1f6)+_0x4a115a[_0x39c10a(0x17c)]+'\x20v'+_0x86571c),_0x53172f=await _0x42b92d(_0xc4f526['id']));}else{const _0x2d53e1=_0x249d94[_0x249d94[_0x39c10a(0x165)]-0x1];_0x36b31[_0x39c10a(0x1ae)]?.[_0x39c10a(0x179)](_0x39c10a(0x1f6)+_0x4a115a[_0x39c10a(0x17c)]),_0x53172f=await _0x42b92d(_0x2d53e1['id']);const _0x133205=_0xbcf750(_0x2d53e1['id']),_0x373723=await journeyResponseToDef(_0x53172f,_0x133205),_0x13f1a5=buildLocalRuleToNameMappingFromJourney(_0x4a115a);_0x552416=buildMergedJourneyDef([{'item':_0x2d53e1,'yaml':_0x373723}],_0x13f1a5,_0x171515);}}addFoldersToCreate(_0x2bde7a,_0x36b31[_0x39c10a(0x127)],_0x53ff2);const _0xd271c0=calculateJourneyDiff(_0x4a115a,_0x552416);_0x45c740['push']({'relativePath':_0x4a115a[_0x39c10a(0x17c)],'absolutePath':_0x2bb4c9,'yamlConfig':_0x4a115a,'folderPath':_0x2bde7a,'existingJourney':_0x53172f,'isNew':_0xd271c0[_0x39c10a(0x1d8)],'hasChanges':_0xd271c0[_0x39c10a(0x1c8)],'diff':_0xd271c0[_0x39c10a(0x152)]});}return{'journeyFiles':_0x45c740,'foldersToCreate':_0x53ff2};}export function calculateActivationActions(_0x8b54f0,_0x540a86,_0x118dce,_0x40e9c9){const _0x808a8d=a151_0x2ed631,_0x13279c=[],_0xa649b3=new Map();for(const _0x2c85f9 of _0x540a86){_0xa649b3[_0x808a8d(0x1c7)](_0x2c85f9[_0x808a8d(0x17c)],_0x2c85f9);}const _0x2156ed=new Map();for(const _0x20ae84 of _0x8b54f0){_0x2156ed[_0x808a8d(0x1c7)](_0x20ae84[_0x808a8d(0x17c)],_0x20ae84);}for(const _0x108b0f of _0x8b54f0){const _0x1edbd6=_0xa649b3[_0x808a8d(0x1ac)](_0x108b0f[_0x808a8d(0x17c)]);if(!_0x1edbd6)_0x13279c['push']({'type':'create','name':_0x108b0f[_0x808a8d(0x17c)],'yamlActivation':_0x108b0f});else{const _0x201dd0=activationResponseToDef(_0x1edbd6,_0x118dce,_0x40e9c9),_0x37625b=a151_0x297b00[_0x808a8d(0x14e)](_0x201dd0),_0x76e01b=a151_0x297b00['stringify'](_0x108b0f);_0x37625b!==_0x76e01b&&_0x13279c[_0x808a8d(0x1d3)]({'type':'update','name':_0x108b0f[_0x808a8d(0x17c)],'yamlActivation':_0x108b0f,'existingActivation':_0x1edbd6});}}for(const _0x4604ec of _0x540a86){!_0x2156ed['has'](_0x4604ec[_0x808a8d(0x17c)])&&_0x13279c[_0x808a8d(0x1d3)]({'type':_0x808a8d(0x1dc),'name':_0x4604ec['name'],'existingActivation':_0x4604ec});}return _0x13279c;}function calculateYamlDiff(_0x302849,_0x224e8a){if(_0x224e8a){const _0x16a1e3=generateDiff(_0x224e8a,_0x302849),_0x5bfb69=hasChanges(_0x16a1e3);return{'isNew':![],'hasChanges':_0x5bfb69,'diff':_0x5bfb69?formatDiffWithColors(_0x16a1e3):undefined};}const _0x4c48ff=generateDiff('',_0x302849);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4c48ff)};}export function calculateSegmentDiff(_0x12c0b9,_0x584882,_0x256da3,_0x2e079b,_0x63787d){const _0x5d3eef=segmentToYamlString(_0x12c0b9),_0x1864b1=_0x584882?segmentToYamlString(segmentWithActivationsToYaml(_0x584882,_0x256da3,undefined,_0x2e079b,_0x63787d)):undefined;return calculateYamlDiff(_0x5d3eef,_0x1864b1);}export function calculateJourneyDiff(_0x5c7e30,_0x57ffac){const _0x5b8698=normalizeJourneyDef(_0x5c7e30,_0x5c7e30),_0x39f9a4=a151_0x36b8c4(_0x5b8698),_0x11d74f=_0x57ffac?a151_0x36b8c4(normalizeJourneyDef(_0x57ffac,_0x5c7e30)):undefined;return calculateYamlDiff(_0x39f9a4,_0x11d74f);}export function findSegmentsToDelete(_0x21c5e7,_0x990404,_0x43c47c,_0x500744,_0x54b5dd){const _0x50db7c=a151_0x2ed631,_0x3ca8f3=new Set();for(const {yamlConfig:_0x912767,folderPath:_0x23042d}of _0x990404){_0x3ca8f3[_0x50db7c(0x1d0)](_0x23042d+':'+_0x912767[_0x50db7c(0x17c)]);}return _0x21c5e7[_0x50db7c(0x1fd)](_0x4cc135=>{const _0x8e9872=_0x50db7c,_0x34b983=_0x4cc135['segmentFolderId']?_0x43c47c[_0x8e9872(0x1ac)](_0x4cc135[_0x8e9872(0x196)][_0x8e9872(0x15f)]())||'':'',_0x3822d9=_0x34b983+':'+_0x4cc135[_0x8e9872(0x17c)];if(_0x3ca8f3[_0x8e9872(0x1b5)](_0x3822d9))return![];if(_0x54b5dd)return _0x34b983===_0x500744||_0x34b983[_0x8e9872(0x131)](_0x500744+'/');return!![];});}export function findJourneysToDelete(_0x159f5d,_0x4eb97c,_0x1f79fb,_0x1463fa,_0x2293b0){const _0x3e4f35=a151_0x2ed631,_0x4421db=new Set();for(const {yamlConfig:_0x4019f6,folderPath:_0x28cea3}of _0x4eb97c){_0x4421db[_0x3e4f35(0x1d0)](_0x28cea3+':'+_0x4019f6[_0x3e4f35(0x17c)]);}return _0x159f5d[_0x3e4f35(0x1fd)](_0x1f0a6b=>{const _0xe8742f=_0x3e4f35,_0x347e58=_0x1f0a6b[_0xe8742f(0x137)]?_0x1f79fb[_0xe8742f(0x1ac)](_0x1f0a6b[_0xe8742f(0x137)])||'':'',_0x44cebf=_0x347e58+':'+_0x1f0a6b[_0xe8742f(0x1f5)];if(_0x4421db[_0xe8742f(0x1b5)](_0x44cebf))return![];if(_0x2293b0)return _0x347e58===_0x1463fa||_0x347e58[_0xe8742f(0x131)](_0x1463fa+'/');return!![];});}export function buildSegmentLookupMap(_0x1b0ad7,_0x25c34d){const _0x38ee93=a151_0x2ed631,_0x3ca578=new Map();for(const _0xe68f06 of _0x1b0ad7){const _0x46ac6e=_0xe68f06[_0x38ee93(0x196)]?_0x25c34d[_0x38ee93(0x1ac)](_0xe68f06[_0x38ee93(0x196)][_0x38ee93(0x15f)]())||'':'',_0x5cf094=_0x46ac6e+':'+_0xe68f06['name'];_0x3ca578[_0x38ee93(0x1c7)](_0x5cf094,_0xe68f06);}return _0x3ca578;}export function buildSegmentNameToIdMap(_0x161e52){const _0x3873a0=a151_0x2ed631,_0x1d337d=new Map();for(const _0x45412b of _0x161e52){_0x1d337d[_0x3873a0(0x1c7)](_0x45412b[_0x3873a0(0x17c)],_0x45412b['id']);}return _0x1d337d;}export function buildJourneyBundleLookupMap(_0x1ffaba,_0x269870){const _0x581508=a151_0x2ed631,_0x3d46ae=new Map();for(const _0x52ef3d of _0x1ffaba){const _0x475d03=_0x52ef3d['folderId']?_0x269870[_0x581508(0x1ac)](_0x52ef3d['folderId'])||'':'',_0xef90a6=_0x475d03+':'+_0x52ef3d[_0x581508(0x1f5)];!_0x3d46ae[_0x581508(0x1b5)](_0xef90a6)&&_0x3d46ae[_0x581508(0x1c7)](_0xef90a6,[]),_0x3d46ae[_0x581508(0x1ac)](_0xef90a6)[_0x581508(0x1d3)](_0x52ef3d);}for(const _0x26e9ce of _0x3d46ae[_0x581508(0x20c)]()){_0x26e9ce[_0x581508(0x158)]((_0x54a9dc,_0x5cfd3d)=>(_0x54a9dc[_0x581508(0x20b)]||0x0)-(_0x5cfd3d[_0x581508(0x20b)]||0x0));}return _0x3d46ae;}export function collectFoldersToCreate(_0x24ae42,_0x539892){const _0x125d72=a151_0x2ed631,_0x4ec3dd=new Set();for(const _0x5b3e58 of _0x24ae42){if(!_0x5b3e58)continue;if(_0x539892['has'](_0x5b3e58))continue;const _0x4ee328=_0x5b3e58[_0x125d72(0x13c)]('/');let _0x290726='';for(const _0x5cd5ed of _0x4ee328){_0x290726=_0x290726?_0x290726+'/'+_0x5cd5ed:_0x5cd5ed,!_0x539892[_0x125d72(0x1b5)](_0x290726)&&_0x4ec3dd[_0x125d72(0x1d0)](_0x290726);}}return _0x4ec3dd;}export function parseAndClassifyYamlFiles(_0x427b1e,_0x127057,_0xe41897){const _0x4dffca=a151_0x2ed631,_0x5845de=[],_0x8312e3=[];for(const _0x52efb1 of _0x427b1e){const _0x1de631=a151_0x574767['relative'](_0x127057,a151_0x574767[_0x4dffca(0x148)](_0x52efb1)),_0x5792bb=_0x1de631==='.'?'':_0x1de631,_0x2113ab=readFileSync(_0x52efb1,_0x4dffca(0x11f)),_0x2a6b69=a151_0x297b00[_0x4dffca(0x211)](_0x2113ab);if(isJourneyDef(_0x2a6b69)){const _0x36bf0b=a151_0x113781(_0x2113ab);_0x8312e3[_0x4dffca(0x1d3)]({'yamlConfig':_0x36bf0b,'folderPath':_0x5792bb,'sourcePath':_0x52efb1});}else{if(!_0xe41897?.[_0x4dffca(0x202)]){const _0x29e4d5=parseSegmentYamlFile(_0x2113ab),_0x2d5a2e=normalizeChildSegmentYaml(_0x29e4d5);_0x5845de['push']({'yamlConfig':_0x2d5a2e,'folderPath':_0x5792bb,'sourcePath':_0x52efb1});}}}return{'segments':_0x5845de,'journeys':_0x8312e3};}export function validateParsedFiles(_0x7b7d3b,_0x18e957){const _0x45a981=a151_0x2ed631,_0x389ca8=[];for(const {yamlConfig:_0x258af3,sourcePath:_0xf6eb66}of _0x7b7d3b[_0x45a981(0x18a)]){const _0x5eb3dd=readFileSync(_0xf6eb66,_0x45a981(0x11f)),_0xe1a7f7=a151_0x297b00[_0x45a981(0x1da)](_0x5eb3dd),_0x183d9a=validateSegmentDef(_0x258af3,{'source':_0x5eb3dd,'document':_0xe1a7f7},{'skipSchema':!![]});if(!_0x183d9a['valid']){const _0x19ca19=a151_0x574767[_0x45a981(0x1a8)](_0x18e957,_0xf6eb66);_0x389ca8[_0x45a981(0x1d3)]({'filePath':_0x19ca19,'source':_0x5eb3dd,'result':_0x183d9a,'isJourney':![]});}}for(const {yamlConfig:_0x40ace5,sourcePath:_0x3239e2}of _0x7b7d3b[_0x45a981(0x13d)]){const _0x573ffe=readFileSync(_0x3239e2,'utf-8'),_0x467229=a151_0x297b00[_0x45a981(0x1da)](_0x573ffe),_0x36ee0a=validateJourneyDef(_0x40ace5,{'source':_0x573ffe,'document':_0x467229},{'skipSchema':!![]});if(!_0x36ee0a[_0x45a981(0x124)]){const _0x57aa66=a151_0x574767[_0x45a981(0x1a8)](_0x18e957,_0x3239e2);_0x389ca8[_0x45a981(0x1d3)]({'filePath':_0x57aa66,'source':_0x573ffe,'result':_0x36ee0a,'isJourney':!![]});}}return _0x389ca8;}export function formatValidationErrors(_0x566e1d){const _0x40a403=a151_0x2ed631,_0x5aaad4=[];for(const {filePath:_0x1c3446,source:_0x47e6ad,result:_0x2866b0,isJourney:_0x356113}of _0x566e1d){const _0x2de036=_0x356113?'journey':_0x40a403(0x1b9);_0x5aaad4[_0x40a403(0x1d3)]('\x0a'+_0x1c3446+'\x20('+_0x2de036+'):\x20'+_0x2866b0[_0x40a403(0x141)][_0x40a403(0x165)]+_0x40a403(0x1e8)),_0x5aaad4['push'](formatValidationResult(_0x2866b0,_0x47e6ad,_0x1c3446));}return _0x5aaad4[_0x40a403(0x1fe)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x12416d){const _0xf889bf=a151_0x2ed631,_0x1d20ba=new Set(),_0x3f790e=new Map(),_0x16358e=collectSegmentUsageCounts(_0x12416d);if(_0x12416d[_0xf889bf(0x18a)])for(const [_0x14c876,_0x56be3d]of Object[_0xf889bf(0x1af)](_0x12416d['segments'])){_0x1d20ba[_0xf889bf(0x1d0)](_0x14c876);if(_0x56be3d['rule']){const _0x382f67=yamlRuleToApi(_0x56be3d[_0xf889bf(0x198)]),_0x473c9e=apiRuleToYaml(_0x382f67);_0x3f790e['set'](_0x14c876,_0x473c9e);}}const _0x3adf48=new Map();let _0x1a9fe9=0x0;for(const [_0x4d1f71,_0x19d353]of _0x3f790e){const _0xd76c31=serializeExpandedRule(_0x19d353,_0x3f790e),_0xf2e8a5=_0x3adf48[_0xf889bf(0x1ac)](_0xd76c31)||[];_0xf2e8a5[_0xf889bf(0x1d3)]({'name':_0x4d1f71,'index':_0x1a9fe9}),_0x3adf48['set'](_0xd76c31,_0xf2e8a5),_0x1a9fe9++;}const _0x4262dd=new Map();for(const [_0x2f5617,_0xd66136]of _0x3adf48){const _0x48891e=_0xd66136['slice']()['sort']((_0x5373b8,_0x316075)=>{const _0x5a9d4a=_0xf889bf,_0x227ab6=_0x16358e[_0x5a9d4a(0x1ac)](_0x5373b8[_0x5a9d4a(0x17c)])||0x0,_0x48ab8f=_0x16358e[_0x5a9d4a(0x1ac)](_0x316075[_0x5a9d4a(0x17c)])||0x0;if(_0x227ab6!==_0x48ab8f)return _0x48ab8f-_0x227ab6;return _0x5373b8[_0x5a9d4a(0x1ab)]-_0x316075['index'];})['map'](_0x5a4bb0=>_0x5a4bb0['name']),_0xa62346=[];for(const _0x4370e8 of _0x48891e){const _0x166541=_0x16358e['get'](_0x4370e8)||0x0,_0x773030=Math['max'](_0x166541,0x1);for(let _0x39147d=0x0;_0x39147d<_0x773030;_0x39147d++){_0xa62346['push'](_0x4370e8);}}_0x4262dd['set'](_0x2f5617,_0xa62346);}return{'existingLocalSegmentNames':_0x1d20ba,'localSegmentRules':_0x3f790e,'localExpandedRuleToNames':_0x4262dd};}export function createSegmentIdResolver(_0x33ec95,_0x10abf0){return async _0x40cb58=>{const _0x262b1a=a151_0x5571,_0x4904b4=_0x33ec95[_0x262b1a(0x1ac)](_0x40cb58);if(!_0x4904b4)throw new SDKError(ErrorCode[_0x262b1a(0x11b)],_0x262b1a(0x1b0)+_0x40cb58+_0x262b1a(0x18f)+_0x10abf0+'\x27)');return _0x4904b4;};}export function extractRootFolderId(_0x476ae3){const _0x3ed872=a151_0x2ed631;return _0x476ae3[_0x3ed872(0x122)]?.['parentSegmentFolder']?.[_0x3ed872(0x125)]?.['id']||_0x476ae3['relationships']?.['parentFolder']?.['data']?.['id'];}export function buildConnectionMaps(_0x21afdb){const _0x2cd698=a151_0x2ed631,_0x4217a9=new Map(),_0x19e6e3=new Map(),_0x21d40f=new Map();for(const _0x32074c of _0x21afdb){_0x4217a9['set'](_0x32074c['name'],parseInt(_0x32074c['id'],0xa)),_0x19e6e3[_0x2cd698(0x1c7)](_0x32074c['id'],_0x32074c['name']),_0x21d40f['set'](_0x32074c[_0x2cd698(0x17c)],_0x32074c[_0x2cd698(0x138)]);}return{'nameToId':_0x4217a9,'idToName':_0x19e6e3,'nameToType':_0x21d40f};}export function calculatePushStats(_0x45e112,_0x2df80b,_0x2b6208,_0x4154cf,_0x1023c5,_0x45ca86,_0xfd19de){const _0x313153=a151_0x2ed631,_0x246ec0=_0x45e112[_0x313153(0x1fd)](_0x36dcf0=>_0x36dcf0[_0x313153(0x1d8)]),_0x1d8728=_0x45e112[_0x313153(0x1fd)](_0x3f6fc3=>!_0x3f6fc3[_0x313153(0x1d8)]&&_0x3f6fc3[_0x313153(0x1c8)]),_0x4c9029=_0x45e112['filter'](_0x1fd1db=>!_0x1fd1db['isNew']&&!_0x1fd1db['hasChanges']),_0x2edc6b=_0x45ca86?_0x4154cf:[],_0x43dceb=_0x2df80b[_0x313153(0x1fd)](_0x387d6a=>_0x387d6a[_0x313153(0x1d8)]),_0x1aefe6=_0x2df80b[_0x313153(0x1fd)](_0x171c04=>!_0x171c04['isNew']&&_0x171c04[_0x313153(0x1c8)]),_0x2fef08=_0x2df80b[_0x313153(0x1fd)](_0x3728b4=>!_0x3728b4[_0x313153(0x1d8)]&&!_0x3728b4[_0x313153(0x1c8)]),_0x5da51d=_0x45ca86?_0x1023c5:[],_0x102e06=_0x45e112[_0x313153(0x145)](_0x4a2015=>_0x4a2015['activationActions']),_0x4e0ae7=_0x102e06[_0x313153(0x1fd)](_0x3faae4=>_0x3faae4[_0x313153(0x138)]==='create'),_0x4c73db=_0x102e06[_0x313153(0x1fd)](_0x19b308=>_0x19b308['type']==='update'),_0x512d18=_0x102e06['filter'](_0x1347c1=>_0x1347c1[_0x313153(0x138)]===_0x313153(0x1dc)),_0x17af76=Array[_0x313153(0x214)](_0x2b6208)['sort'](),_0x3ace40=_0xfd19de?![]:_0x246ec0[_0x313153(0x165)]>0x0||_0x1d8728['length']>0x0||_0x2edc6b[_0x313153(0x165)]>0x0,_0x5826ae=_0x43dceb[_0x313153(0x165)]>0x0||_0x1aefe6[_0x313153(0x165)]>0x0||_0x5da51d[_0x313153(0x165)]>0x0,_0x3e72da=_0xfd19de?![]:_0x102e06[_0x313153(0x165)]>0x0,_0x18284d=_0x17af76[_0x313153(0x165)]>0x0;return{'segments':{'new':_0x246ec0,'changed':_0x1d8728,'unchanged':_0x4c9029,'toDelete':_0x2edc6b},'journeys':{'new':_0x43dceb,'changed':_0x1aefe6,'unchanged':_0x2fef08,'toDelete':_0x5da51d},'activations':{'all':_0x102e06,'toCreate':_0x4e0ae7,'toUpdate':_0x4c73db,'toDelete':_0x512d18},'folders':{'toCreate':_0x17af76},'counts':{'segments':{'new':_0x246ec0[_0x313153(0x165)],'changed':_0x1d8728[_0x313153(0x165)],'unchanged':_0x4c9029[_0x313153(0x165)],'toDelete':_0x2edc6b[_0x313153(0x165)]},'journeys':{'new':_0x43dceb[_0x313153(0x165)],'changed':_0x1aefe6['length'],'unchanged':_0x2fef08[_0x313153(0x165)],'toDelete':_0x5da51d['length']},'activations':{'create':_0x4e0ae7[_0x313153(0x165)],'update':_0x4c73db[_0x313153(0x165)],'delete':_0x512d18[_0x313153(0x165)]},'folders':_0x17af76['length']},'hasChanges':_0x3ace40||_0x5826ae||_0x3e72da||_0x18284d};}export async function buildPushExecutionContext(_0xf7cf59,_0x40b8ac,_0x3ef58d,_0x2b9457,_0x50f31b,_0x4a863d){const _0x1b01c4=a151_0x2ed631,_0x7a7e75=extractRootFolderId(_0x3ef58d),{pathToId:_0x232120,idToPath:_0x3d4062}=buildFolderMaps(_0x50f31b),_0x4d4929=buildSegmentNameToIdMap(_0x2b9457),_0x5c3bd1=new Map(),{batchAsync:_0x18b441}=await import('../../utils/async.js'),[_0x201195,_0x332130]=await Promise[_0x1b01c4(0x21a)]([_0xf7cf59[_0x1b01c4(0x1c5)][_0x1b01c4(0x1f4)](),_0xf7cf59[_0x1b01c4(0x153)][_0x1b01c4(0x19c)](),((async()=>{!_0x4a863d&&_0x2b9457['length']>0x0&&await _0x18b441(_0x2b9457,async _0x3fccd7=>{const _0x34a4ca=a151_0x5571,_0x137c68=await _0xf7cf59['segment'][_0x34a4ca(0x162)](_0x40b8ac,_0x3fccd7['id']);_0x5c3bd1[_0x34a4ca(0x1c7)](_0x3fccd7['id'],_0x137c68);});})())]),{emailToId:_0xd263d0,idToEmail:_0x3121db}=_0x201195,_0x18586f=buildConnectionMaps(_0x332130);return{'rootFolderId':_0x7a7e75,'folderPathToId':_0x232120,'folderIdToPath':_0x3d4062,'segmentNameToId':_0x4d4929,'activationsBySegmentId':_0x5c3bd1,'emailToIdMap':_0xd263d0,'idToEmailMap':_0x3121db,'connectionNameToIdMap':_0x18586f['nameToId'],'connectionIdToNameMap':_0x18586f[_0x1b01c4(0x1cb)],'connectionNameToTypeMap':_0x18586f[_0x1b01c4(0x1c0)]};}export function createPushYamlContextForBundle(_0x1022d2,_0x794a7c,_0x2d26c2,_0x38d14f,_0x143c4d,_0x1d87d9,_0x2bf539,_0x2c47e5){const {existingLocalSegmentNames:_0x19f1a2,localExpandedRuleToNames:_0x4fe20a}=_0x38d14f,_0x3855ce=new Set(),_0x32a436=new Map(),_0x5eb49a=new Map(),_0x438468=new Map(),_0x1adc80=createJumpTargetCache(),_0x1ddbfb=new Map(),_0x22e1de=new Map(),_0xa15816=new Set();let _0x5f09d2;const _0x15e0df=_0x2be064=>{const _0x1ec486={'resolveSegment':async _0x1741c8=>{const _0x486226=a151_0x5571,_0x1bb184=_0x438468[_0x486226(0x1ac)](_0x1741c8);if(_0x1bb184!==undefined)return{'name':_0x1bb184,'isJourneyLocal':!![]};try{const _0x5a4ebf=await fetchSegment(_0x1022d2,_0x794a7c,_0x1741c8,_0x2d26c2);if(!_0x5a4ebf)throw new Error(_0x486226(0x159));const _0xf898ae=generateJourneyLocalName(_0x5a4ebf[_0x486226(0x17c)]),_0xf3a1e8=_0x5a4ebf[_0x486226(0x18b)]===SEGMENT_KIND_JOURNEY&&_0xf898ae!==undefined;let _0x4cd8fa=_0x5a4ebf[_0x486226(0x17c)],_0x3e6524;if(_0xf3a1e8&&_0x5a4ebf[_0x486226(0x198)]){const _0x280e91=apiRuleToYaml(_0x5a4ebf[_0x486226(0x198)]);_0x22e1de['set'](_0x1741c8,_0x280e91);const _0x45d433=async _0x279203=>{const _0x768a05=_0x486226,_0x414f4c=collectSegmentRefsFromRule(_0x279203);for(const _0x4e363d of _0x414f4c){if(!_0x22e1de['has'](_0x4e363d))try{const _0x3beb47=await fetchSegment(_0x1022d2,_0x794a7c,_0x4e363d,_0x2d26c2);if(_0x3beb47?.[_0x768a05(0x198)]){const _0x3863a0=apiRuleToYaml(_0x3beb47[_0x768a05(0x198)]);_0x22e1de['set'](_0x4e363d,_0x3863a0),await _0x45d433(_0x3863a0);}}catch(_0x27e75b){logger[_0x768a05(0x12c)](_0x768a05(0x16a)+_0x4e363d+':\x20'+_0x27e75b);}}};await _0x45d433(_0x280e91);const _0x46f4a2=serializeExpandedRule(_0x280e91,_0x22e1de),_0xc090e8=_0x4fe20a['get'](_0x46f4a2);if(_0xc090e8&&_0xc090e8[_0x486226(0x165)]>0x0){const _0x538d8c=_0x32a436['get'](_0x46f4a2)||0x0,_0x2fd593=_0xc090e8[_0x538d8c]||_0xc090e8[_0xc090e8['length']-0x1];_0x32a436['set'](_0x46f4a2,_0x538d8c+0x1),_0x4cd8fa=_0x2fd593,_0x3855ce[_0x486226(0x1d0)](_0x4cd8fa),_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa);const _0x4129ac=await resolveRuleSegmentRefs(_0x280e91,async _0x399d7f=>{const _0x55fa53=_0x486226,_0x40df80=_0x438468[_0x55fa53(0x1ac)](_0x399d7f);if(_0x40df80)return _0x40df80;const _0x18f31c=await _0x5f09d2[_0x55fa53(0x120)](_0x399d7f);return _0x18f31c[_0x55fa53(0x17c)];});_0x3e6524={'description':_0x5a4ebf[_0x486226(0x1cd)],'rule':_0x4129ac};}else{const _0x3d4687=_0x1ddbfb[_0x486226(0x1ac)](_0x46f4a2);if(_0x3d4687)_0x4cd8fa=_0x3d4687,_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa);else{if(_0xf898ae){let _0x52c363=_0xf898ae,_0x2ade41=0x2;while(_0x3855ce[_0x486226(0x1b5)](_0x52c363)||_0x19f1a2[_0x486226(0x1b5)](_0x52c363)){_0x52c363=_0xf898ae+'_'+_0x2ade41,_0x2ade41++;}_0x3855ce[_0x486226(0x1d0)](_0x52c363),_0x4cd8fa=_0x52c363;}_0x438468[_0x486226(0x1c7)](_0x1741c8,_0x4cd8fa),_0x1ddbfb[_0x486226(0x1c7)](_0x46f4a2,_0x4cd8fa);const _0x53adde=await resolveRuleSegmentRefs(_0x280e91,async _0x276742=>{const _0x255669=_0x486226,_0x2323de=_0x438468[_0x255669(0x1ac)](_0x276742);if(_0x2323de)return _0x2323de;const _0x5e108a=await _0x5f09d2[_0x255669(0x120)](_0x276742);return _0x5e108a[_0x255669(0x17c)];});_0x3e6524={'description':_0x5a4ebf[_0x486226(0x1cd)],'rule':_0x53adde};}}}return{'name':_0x4cd8fa,'isJourneyLocal':_0xf3a1e8,'definition':_0x3e6524};}catch(_0x4e56a4){return logger['debug']('Failed\x20to\x20resolve\x20segment\x20'+_0x1741c8+':\x20'+_0x4e56a4),{'name':_0x1741c8,'isJourneyLocal':![]};}},'resolveActivation':async _0x136af2=>{const _0x2f9f30=a151_0x5571,_0x347859=_0x5eb49a['get'](_0x136af2);if(_0x347859!==undefined)return{'name':_0x347859,'isJourneyLocal':!![]};try{let _0x9ab250=_0x2bf539?.[_0x2f9f30(0x1ac)](_0x136af2);!_0x9ab250&&(_0x9ab250=await _0x1022d2[_0x2f9f30(0x1b8)][_0x2f9f30(0x1ed)](_0x2be064,_0x136af2));const _0x5cd42c=_0x9ab250['attributes'][_0x2f9f30(0x1ef)][_0x2f9f30(0x17c)]||_0x136af2,_0x63ea06=sanitizeYamlKey(_0x5cd42c)||'activation_'+_0x136af2,_0x3f9dcf=_0x63ea06;_0x5eb49a['set'](_0x136af2,_0x3f9dcf);const _0x11e345=journeyActivationStepToYaml(_0x9ab250,_0x143c4d,_0x1d87d9);return{'name':_0x3f9dcf,'isJourneyLocal':!![],'definition':_0x11e345};}catch(_0x5b0ff7){return logger[_0x2f9f30(0x12c)](_0x2f9f30(0x1dd)+_0x136af2+':\x20'+_0x5b0ff7),{'name':_0x136af2,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x427047,_0x4f981a)=>resolveJumpTarget(_0x427047,_0x4f981a,_0x1adc80,async _0x745737=>{const _0x9c739d=a151_0x5571,_0x4bf129=_0x2c47e5?.[_0x9c739d(0x1ac)](_0x745737);if(_0x4bf129)return _0x4bf129;return _0x1022d2[_0x9c739d(0x1b8)]['getJourney'](_0x745737);})};return _0x5f09d2=_0x1ec486,_0x1ec486;},_0x36e05b=async _0xcd9fdf=>{const _0x23c55d=a151_0x5571,{collectSegmentIdsFromJourneyApi:_0xe59013}=await import(_0x23c55d(0x19f)),{batchAsync:_0x171271}=await import(_0x23c55d(0x209)),_0x31ec36=new Set();for(const _0x2595cc of _0xcd9fdf){let _0x10f0b7=_0x2c47e5?.[_0x23c55d(0x1ac)](_0x2595cc);!_0x10f0b7&&(_0x10f0b7=await _0x1022d2[_0x23c55d(0x1b8)]['getJourney'](_0x2595cc));const _0x4272ad=_0xe59013(_0x10f0b7);for(const _0x1fdb41 of _0x4272ad){_0x31ec36[_0x23c55d(0x1d0)](_0x1fdb41);}}let _0x39b309=Array[_0x23c55d(0x214)](_0x31ec36);while(_0x39b309['length']>0x0){const _0x13e1c0=_0x39b309[_0x23c55d(0x1fd)](_0x3a959b=>!_0xa15816['has'](_0x3a959b));if(_0x13e1c0[_0x23c55d(0x165)]===0x0)break;const _0x4c12ef=await _0x171271(_0x13e1c0,async _0x18514b=>{_0xa15816['add'](_0x18514b);const _0x3da569=await fetchSegment(_0x1022d2,_0x794a7c,_0x18514b,_0x2d26c2);if(!_0x3da569)return null;return{'segmentId':_0x18514b,'segment':_0x3da569};},0xa),_0x5850d9=new Set();for(const _0x4a40d8 of _0x4c12ef){if(!_0x4a40d8?.[_0x23c55d(0x1b9)]?.['rule'])continue;const _0x2a7d4d=apiRuleToYaml(_0x4a40d8[_0x23c55d(0x1b9)]['rule']);_0x22e1de['set'](_0x4a40d8[_0x23c55d(0x203)],_0x2a7d4d);const _0x2ea7cf=collectSegmentRefsFromRule(_0x2a7d4d);for(const _0x122e16 of _0x2ea7cf){!_0xa15816[_0x23c55d(0x1b5)](_0x122e16)&&_0x5850d9[_0x23c55d(0x1d0)](_0x122e16);}}_0x39b309=Array[_0x23c55d(0x214)](_0x5850d9);}};return{'createYamlContext':_0x15e0df,'prefetchJourneySegments':_0x36e05b};}function a151_0x5571(_0x435bae,_0x3498b3){_0x435bae=_0x435bae-0x119;const _0x57e949=a151_0x57e9();let _0x5571b1=_0x57e949[_0x435bae];return _0x5571b1;}export async function executePushSegments(_0x46a32f,_0x554e08,_0x433c67,_0x5d62f9,_0xc5a0a9){const _0x3b7195=a151_0x2ed631,{segmentDefToCreateRequest:_0x5e105d,segmentDefToUpdateRequest:_0x3b096e}=await import('./child-segment-yaml.js'),_0x4c868d=_0x433c67[_0x3b7195(0x127)],_0x14e563=0x5,_0x5cb856=async _0x14383c=>{const _0x57b048=_0x3b7195,_0x1b21b1=_0x14383c['folderPath']?_0x4c868d[_0x57b048(0x1ac)](_0x14383c[_0x57b048(0x13b)]):undefined;let _0x4a0d86;const _0x158b92={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x34dc21=_0x14383c[_0x57b048(0x136)];if(_0x14383c[_0x57b048(0x136)][_0x57b048(0x198)]){const _0x2ad9ac=createSegmentIdResolver(_0x433c67[_0x57b048(0x193)],_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]),_0x30a875=await resolveRuleSegmentIds(_0x14383c[_0x57b048(0x136)]['rule'],_0x2ad9ac);_0x34dc21={..._0x14383c[_0x57b048(0x136)],'rule':_0x30a875};}try{if(_0x14383c[_0x57b048(0x1d8)]){_0xc5a0a9[_0x57b048(0x183)]?.({'type':_0x57b048(0x184),'name':_0x14383c['yamlConfig'][_0x57b048(0x17c)]});const _0x52a033=_0x5e105d(_0x34dc21,_0x1b21b1),_0x3904d6=await _0xc5a0a9[_0x57b048(0x135)]('Creating\x20segment\x20\x27'+_0x14383c['yamlConfig'][_0x57b048(0x17c)]+_0x57b048(0x140),()=>_0x46a32f['segment'][_0x57b048(0x213)](_0x5d62f9['parentId'],_0x52a033));_0x4a0d86=_0x3904d6[_0x57b048(0x125)]['id'],_0x433c67[_0x57b048(0x193)][_0x57b048(0x1c7)](_0x14383c['yamlConfig'][_0x57b048(0x17c)],_0x4a0d86),_0x158b92[_0x57b048(0x208)]={'name':_0x14383c[_0x57b048(0x136)]['name'],'id':_0x4a0d86},_0xc5a0a9[_0x57b048(0x183)]?.({'type':_0x57b048(0x201),'name':_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)],'segmentId':_0x4a0d86}),_0xc5a0a9[_0x57b048(0x16c)]?.(_0x57b048(0x143)+_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]+'\x27'),_0x158b92[_0x57b048(0x144)]=0x1;}else{if(_0x14383c[_0x57b048(0x1c8)]){_0xc5a0a9[_0x57b048(0x183)]?.({'type':'segment_updating','name':_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]});const _0x2b9176=_0x3b096e(_0x34dc21);_0x1b21b1!==_0x14383c[_0x57b048(0x1ee)]?.[_0x57b048(0x196)]&&(_0x2b9176[_0x57b048(0x196)]=_0x1b21b1?parseInt(_0x1b21b1,0xa):undefined),await _0xc5a0a9[_0x57b048(0x135)](_0x57b048(0x17a)+_0x14383c[_0x57b048(0x136)]['name']+_0x57b048(0x140),()=>_0x46a32f['segment']['updateSegmentById'](_0x5d62f9[_0x57b048(0x164)],_0x14383c['existingSegment']['id'],_0x2b9176)),_0x4a0d86=_0x14383c[_0x57b048(0x1ee)]['id'],_0xc5a0a9['onProgress']?.({'type':'segment_updated','name':_0x14383c['yamlConfig'][_0x57b048(0x17c)]}),_0xc5a0a9['logSuccess']?.(_0x57b048(0x200)+_0x14383c[_0x57b048(0x136)]['name']+'\x27'),_0x158b92['updated']=0x1;}else _0x4a0d86=_0x14383c[_0x57b048(0x1ee)]['id'];}}catch(_0xdfcc0d){const _0x2670cc=isHttp400Error(_0xdfcc0d),_0x4ddfb0=_0x2670cc?ErrorCode[_0x57b048(0x1b6)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x5ba558=getErrorMessage(_0xdfcc0d);throw new SDKError(_0x4ddfb0,_0x57b048(0x18c)+(_0x14383c[_0x57b048(0x1d8)]?_0x57b048(0x147):_0x57b048(0x179))+_0x57b048(0x14c)+_0x14383c[_0x57b048(0x1c1)]+_0x57b048(0x146)+_0x5ba558,_0xdfcc0d);}try{const _0x10ba1f=await syncActivationsForSegment(_0x46a32f,_0x5d62f9[_0x57b048(0x164)],_0x4a0d86,_0x14383c['yamlConfig'][_0x57b048(0x17c)],_0x14383c[_0x57b048(0x1f1)],_0xc5a0a9,_0x14383c[_0x57b048(0x1c1)]);_0x158b92[_0x57b048(0x1a2)]=_0x10ba1f;}catch(_0x5431f6){if(_0x5431f6 instanceof SDKError)throw _0x5431f6;throw new SDKError(ErrorCode[_0x57b048(0x12b)],_0x57b048(0x1a9)+_0x14383c[_0x57b048(0x136)][_0x57b048(0x17c)]+_0x57b048(0x14f)+_0x14383c[_0x57b048(0x1c1)]+_0x57b048(0x146)+getErrorMessage(_0x5431f6),_0x5431f6);}return _0x158b92;},_0x50375f=await batchAsync(_0x554e08,_0x5cb856,_0x14e563),_0x96d0f6={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0xa0c286 of _0x50375f){_0x96d0f6['created']+=_0xa0c286['created'],_0x96d0f6['updated']+=_0xa0c286[_0x3b7195(0x1df)],_0xa0c286[_0x3b7195(0x208)]&&_0x96d0f6[_0x3b7195(0x168)]['set'](_0xa0c286[_0x3b7195(0x208)][_0x3b7195(0x17c)],_0xa0c286['createdSegmentId']['id']),_0x96d0f6[_0x3b7195(0x1a2)][_0x3b7195(0x144)]+=_0xa0c286[_0x3b7195(0x1a2)]['created'],_0x96d0f6[_0x3b7195(0x1a2)][_0x3b7195(0x1df)]+=_0xa0c286[_0x3b7195(0x1a2)]['updated'],_0x96d0f6['activations'][_0x3b7195(0x1d7)]+=_0xa0c286[_0x3b7195(0x1a2)][_0x3b7195(0x1d7)];}return _0x96d0f6;}async function syncActivationsForSegment(_0xd23319,_0x4b395c,_0x429ae0,_0x5849b3,_0x3ac4bb,_0x58f05f,_0x3abea6){const _0x1a03b1=a151_0x2ed631,_0x269f52={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x56bc91 of _0x3ac4bb){try{if(_0x56bc91[_0x1a03b1(0x138)]===_0x1a03b1(0x147)&&_0x56bc91[_0x1a03b1(0x20e)])_0x58f05f[_0x1a03b1(0x183)]?.({'type':'activation_creating','segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f['withProgress'](_0x1a03b1(0x210)+_0x56bc91['name']+'\x27...',()=>_0xd23319[_0x1a03b1(0x1b9)][_0x1a03b1(0x1b7)](_0x4b395c,_0x429ae0,_0x56bc91[_0x1a03b1(0x20e)])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':'activation_created','segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),_0x58f05f[_0x1a03b1(0x16c)]?.('Created\x20activation\x20\x27'+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x144)]++;else{if(_0x56bc91[_0x1a03b1(0x138)]===_0x1a03b1(0x179)&&_0x56bc91[_0x1a03b1(0x20e)]&&_0x56bc91[_0x1a03b1(0x1bd)])_0x58f05f['onProgress']?.({'type':_0x1a03b1(0x1cf),'segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f[_0x1a03b1(0x135)]('Updating\x20activation\x20\x27'+_0x56bc91['name']+_0x1a03b1(0x140),()=>_0xd23319['segment'][_0x1a03b1(0x176)](_0x4b395c,_0x429ae0,_0x56bc91['existingActivation']['id'],_0x56bc91['validatedRequest'])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':_0x1a03b1(0x157),'segmentName':_0x5849b3,'activationName':_0x56bc91['name']}),_0x58f05f['logSuccess']?.(_0x1a03b1(0x1c3)+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x1df)]++;else _0x56bc91['type']===_0x1a03b1(0x1dc)&&_0x56bc91['existingActivation']&&(_0x58f05f['onProgress']?.({'type':_0x1a03b1(0x1be),'segmentName':_0x5849b3,'activationName':_0x56bc91[_0x1a03b1(0x17c)]}),await _0x58f05f[_0x1a03b1(0x135)](_0x1a03b1(0x1ad)+_0x56bc91['name']+_0x1a03b1(0x140),()=>_0xd23319[_0x1a03b1(0x1b9)][_0x1a03b1(0x1b3)](_0x4b395c,_0x429ae0,_0x56bc91[_0x1a03b1(0x1bd)]['id'])),_0x58f05f[_0x1a03b1(0x183)]?.({'type':_0x1a03b1(0x17b),'segmentName':_0x5849b3,'activationName':_0x56bc91['name']}),_0x58f05f[_0x1a03b1(0x171)]?.(_0x1a03b1(0x149)+_0x56bc91[_0x1a03b1(0x17c)]+'\x27'),_0x269f52[_0x1a03b1(0x1d7)]++);}}catch(_0x18b926){const _0x8cad0c=isHttp400Error(_0x18b926),_0xecf1=_0x8cad0c?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0x1a03b1(0x12b)],_0x1f2802=getErrorMessage(_0x18b926);throw new SDKError(_0xecf1,'Failed\x20to\x20'+_0x56bc91[_0x1a03b1(0x138)]+'\x20activation\x20\x27'+_0x56bc91[_0x1a03b1(0x17c)]+'\x27\x20from\x20file:\x20'+_0x3abea6+_0x1a03b1(0x146)+_0x1f2802,_0x18b926);}}return _0x269f52;}export async function executePushFolders(_0x6d3318,_0x4158af,_0x30ce96,_0x30d60c,_0x107224){const _0x2500d3=a151_0x2ed631,_0x28247d=new Map(_0x30ce96),_0x2602ab=sortFoldersByDepth(_0x4158af);for(const _0x38773b of _0x2602ab){const _0x5ca5d1=_0x38773b['split']('/'),_0x1a07c2=_0x5ca5d1[_0x5ca5d1['length']-0x1],_0x1fa6ab=_0x5ca5d1[_0x2500d3(0x205)](0x0,-0x1)['join']('/'),_0x19c3ac=_0x28247d[_0x2500d3(0x1ac)](_0x1fa6ab);_0x107224['onProgress']?.({'type':'folder_creating','folder':_0x38773b});const _0x4c9446={'name':_0x1a07c2,'parentFolderId':_0x19c3ac},_0x4c0b96=await _0x107224[_0x2500d3(0x135)]('Creating\x20folder\x20\x27'+_0x38773b+'\x27...',()=>_0x6d3318[_0x2500d3(0x1b9)][_0x2500d3(0x132)](_0x30d60c[_0x2500d3(0x164)],_0x4c9446));_0x28247d[_0x2500d3(0x1c7)](_0x38773b,_0x4c0b96[_0x2500d3(0x125)]['id']),_0x107224['onProgress']?.({'type':'folder_created','folder':_0x38773b,'folderId':_0x4c0b96[_0x2500d3(0x125)]['id']}),_0x107224[_0x2500d3(0x121)]?.(_0x2500d3(0x182)+_0x38773b+'\x27');}return _0x28247d;}export async function executePushSegmentDeletions(_0x5c4533,_0x2ff78a,_0x103b47){const _0x2ddb29=a151_0x2ed631;if(_0x2ff78a['length']===0x0)return 0x0;const {batchAsync:_0x403150}=await import(_0x2ddb29(0x209)),_0x33e37c=0x5,_0x5b239d=await _0x403150(_0x2ff78a,async _0x2909f8=>{const _0x560f9e=_0x2ddb29;return _0x103b47[_0x560f9e(0x183)]?.({'type':_0x560f9e(0x1de),'name':_0x2909f8[_0x560f9e(0x17c)]}),await _0x5c4533[_0x560f9e(0x1b9)][_0x560f9e(0x1b2)](_0x2909f8['id']),_0x103b47[_0x560f9e(0x183)]?.({'type':_0x560f9e(0x133),'name':_0x2909f8[_0x560f9e(0x17c)]}),_0x103b47['logDeleted']?.('Deleted\x20segment\x20\x27'+_0x2909f8[_0x560f9e(0x17c)]+'\x27'),0x1;},_0x33e37c);return _0x5b239d['reduce']((_0x9add38,_0x23ecdd)=>_0x9add38+_0x23ecdd,0x0);}export async function executePushJourneys(_0xe47cfc,_0x490f00,_0x2975dd,_0x26c1a3,_0x5864f9){const _0x23f154=a151_0x2ed631,{journeyDefToRequest:_0xce5484}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x334f44,yamlRuleToApi:_0x1ed9ed,validateSegmentRule:_0x5ca3b9}=await import(_0x23f154(0x206)),_0x298e4e={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x31ae97=new Map(_0x2975dd[_0x23f154(0x193)]),_0x1dd85=0x5;for(let _0x1e5dfc=0x0;_0x1e5dfc<_0x490f00['length'];_0x1e5dfc+=_0x1dd85){const _0x5efbd2=_0x490f00[_0x23f154(0x205)](_0x1e5dfc,_0x1e5dfc+_0x1dd85),_0x43eb5e=await Promise[_0x23f154(0x21a)](_0x5efbd2['map'](async _0x129da4=>{const _0x4ad4dc=_0x23f154;if(!_0x129da4[_0x4ad4dc(0x1d8)]&&!_0x129da4['hasChanges'])return{'action':_0x4ad4dc(0x180),'name':_0x129da4[_0x4ad4dc(0x136)][_0x4ad4dc(0x17c)],'journeyId':_0x129da4[_0x4ad4dc(0x12d)]?.['id']};const _0x5913d1=_0x129da4[_0x4ad4dc(0x13b)]?_0x2975dd[_0x4ad4dc(0x127)][_0x4ad4dc(0x1ac)](_0x129da4[_0x4ad4dc(0x13b)]):undefined;_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x129da4[_0x4ad4dc(0x1d8)]?_0x4ad4dc(0x1fc):_0x4ad4dc(0x167),'name':_0x129da4[_0x4ad4dc(0x136)][_0x4ad4dc(0x17c)]});try{const _0x53546e=await executeSingleJourneyPush(_0xe47cfc,_0x129da4,{..._0x2975dd,'segmentNameToId':_0x31ae97},{'parentId':_0x26c1a3[_0x4ad4dc(0x164)],'rootFolderId':_0x26c1a3[_0x4ad4dc(0x1d9)],'folderId':_0x5913d1,'verbose':_0x26c1a3['verbose']},_0x5864f9,{'journeyDefToRequest':_0xce5484,'activationDefToCreateRequest':_0x334f44,'yamlRuleToApi':_0x1ed9ed,'validateSegmentRule':_0x5ca3b9});for(const [_0x20592f,_0x217ee5]of _0x53546e[_0x4ad4dc(0x1f7)]){_0x31ae97[_0x4ad4dc(0x1c7)](_0x20592f,_0x217ee5),_0x298e4e['embeddedSegmentNameToId'][_0x4ad4dc(0x1c7)](_0x20592f,_0x217ee5);}if(_0x53546e[_0x4ad4dc(0x192)]==='created')_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x4ad4dc(0x217),'name':_0x129da4['yamlConfig'][_0x4ad4dc(0x17c)],'journeyId':_0x53546e[_0x4ad4dc(0x207)]}),_0x5864f9['logSuccess']?.(_0x4ad4dc(0x1b4)+_0x129da4['yamlConfig'][_0x4ad4dc(0x17c)]+'\x27'),_0x298e4e[_0x4ad4dc(0x144)]++;else _0x53546e[_0x4ad4dc(0x192)]===_0x4ad4dc(0x1df)&&(_0x5864f9[_0x4ad4dc(0x183)]?.({'type':_0x4ad4dc(0x1ba),'name':_0x129da4[_0x4ad4dc(0x136)]['name']}),_0x5864f9['logSuccess']?.(_0x4ad4dc(0x1e1)+_0x129da4['yamlConfig']['name']+'\x27'),_0x298e4e[_0x4ad4dc(0x1df)]++);return{'action':_0x53546e['action'],'name':_0x129da4[_0x4ad4dc(0x136)]['name'],'journeyId':_0x53546e[_0x4ad4dc(0x207)]};}catch(_0x2fa96f){const _0x571878=isHttp400Error(_0x2fa96f),_0x18c3a7=_0x571878?ErrorCode[_0x4ad4dc(0x1a7)]:ErrorCode[_0x4ad4dc(0x15d)],_0x1ffe64=getErrorMessage(_0x2fa96f);throw new SDKError(_0x18c3a7,_0x4ad4dc(0x18c)+(_0x129da4[_0x4ad4dc(0x1d8)]?_0x4ad4dc(0x147):_0x4ad4dc(0x179))+'\x20journey\x20from\x20file:\x20'+_0x129da4[_0x4ad4dc(0x1c1)]+_0x4ad4dc(0x146)+_0x1ffe64,_0x2fa96f);}}));_0x298e4e[_0x23f154(0x16b)][_0x23f154(0x1d3)](..._0x43eb5e);}return _0x298e4e;}async function matchExistingJourneySegments(_0x5f4ce5,_0x22283f,_0x2256e3,_0x3e7261,_0x2c19fa){const _0x94c663=a151_0x2ed631;if(!_0x22283f['existingJourney']||!_0x22283f[_0x94c663(0x136)][_0x94c663(0x18a)])return;const _0x5229c1=new Map(),_0x490cf4=new Set();for(const _0x70dd3 of Object[_0x94c663(0x197)](_0x22283f[_0x94c663(0x136)][_0x94c663(0x18a)])){const _0x4a3326=generateDeterministicJourneySegmentName(_0x22283f[_0x94c663(0x136)]['name'],_0x70dd3);_0x5229c1['set'](_0x4a3326,_0x70dd3),_0x490cf4[_0x94c663(0x1d0)](_0x70dd3);}const _0x4227bf=[],_0x56ef56=collectSegmentIdsFromJourneyApi(_0x22283f[_0x94c663(0x12d)]);for(const _0x20768e of _0x56ef56){const _0x3667c1=await fetchSegment(_0x5f4ce5,_0x2256e3,_0x20768e,_0x3e7261);if(!_0x3667c1?.[_0x94c663(0x17c)])continue;const _0x28b8b0=_0x5229c1[_0x94c663(0x1ac)](_0x3667c1['name']);_0x28b8b0?(_0x2c19fa[_0x94c663(0x1c7)](_0x28b8b0,_0x20768e),_0x490cf4[_0x94c663(0x1dc)](_0x28b8b0)):_0x4227bf[_0x94c663(0x1d3)]({'id':_0x20768e,'seg':_0x3667c1});}if(_0x490cf4[_0x94c663(0x1e6)]>0x0&&_0x4227bf[_0x94c663(0x165)]>0x0){const {localExpandedRuleToNames:_0x2b4287}=buildLocalExpandedRuleMappings(_0x22283f[_0x94c663(0x136)]),_0x7d4a96=new Map();for(const {id:_0x1740c4,seg:_0xdfe171}of _0x4227bf){if(_0xdfe171['rule']){const _0x4f1a41=apiRuleToYaml(_0xdfe171[_0x94c663(0x198)]);_0x7d4a96[_0x94c663(0x1c7)](_0x1740c4,_0x4f1a41);}}for(const {id:_0x4383a5,seg:_0x374102}of _0x4227bf){if(!_0x374102[_0x94c663(0x198)])continue;const _0x20d669=_0x7d4a96[_0x94c663(0x1ac)](_0x4383a5);if(!_0x20d669)continue;const _0x298117=serializeExpandedRule(_0x20d669,_0x7d4a96),_0x437786=_0x2b4287['get'](_0x298117);if(_0x437786){const _0x28b5cf=_0x437786['find'](_0x40be57=>_0x490cf4[_0x94c663(0x1b5)](_0x40be57));_0x28b5cf&&(_0x2c19fa[_0x94c663(0x1c7)](_0x28b5cf,_0x4383a5),_0x490cf4[_0x94c663(0x1dc)](_0x28b5cf),logger[_0x94c663(0x12c)]('Matched\x20server\x20segment\x20\x27'+_0x374102[_0x94c663(0x17c)]+'\x27\x20to\x20local\x20\x27'+_0x28b5cf+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x537236,_0x34d171,_0x220ff7,_0x422ca9,_0x5a8284,_0x5679b9){const _0x48c7e7=a151_0x2ed631,{journeyDefToRequest:_0x3e538f,activationDefToCreateRequest:_0x4cc8d5,yamlRuleToApi:_0x1541c0,validateSegmentRule:_0x3630a8}=_0x5679b9,_0x16ccb2=new Map(),_0x32f1c4=new Map();recoverSegmentIdsFromPushRecovery(_0x34d171,_0x16ccb2,_0x220ff7['segmentNameToId']);const _0x35b10e=new Map(),_0x4135f6=new Map(),_0x45885b=new Map();let _0x20134b;const _0x301659=async()=>{const _0x415c91=a151_0x5571;if(_0x20134b)return;_0x20134b=new Map();if(!_0x34d171[_0x415c91(0x12d)])return;const _0x1c9a5c=await _0x537236[_0x415c91(0x1b8)][_0x415c91(0x162)](_0x34d171['existingJourney']['id']);for(const _0xe531c3 of _0x1c9a5c){const _0xe8416c=journeyActivationStepToYaml(_0xe531c3,_0x220ff7[_0x415c91(0x1d4)],_0x220ff7['connectionIdToNameMap']),_0x1abc94=activationSignature(_0xe8416c);!_0x20134b['has'](_0x1abc94)&&_0x20134b[_0x415c91(0x1c7)](_0x1abc94,_0xe531c3['id']),_0xe8416c[_0x415c91(0x17c)]&&_0x32f1c4[_0x415c91(0x1c7)](_0xe8416c[_0x415c91(0x17c)],_0xe531c3['id']);}};await matchExistingJourneySegments(_0x537236,_0x34d171,_0x422ca9[_0x48c7e7(0x164)],_0x220ff7[_0x48c7e7(0x15a)],_0x220ff7['segmentNameToId']);const _0x53c8af={'resolveSegmentId':async _0x1ca163=>{const _0x4b1452=_0x48c7e7,_0x301def=_0x220ff7['segmentNameToId'][_0x4b1452(0x1ac)](_0x1ca163);if(!_0x301def)throw new SDKError(ErrorCode[_0x4b1452(0x11b)],_0x4b1452(0x1b0)+_0x1ca163+_0x4b1452(0x216)+_0x34d171['yamlConfig']['name']+')');return _0x301def;},'resolveEmbeddedSegmentId':async(_0x46d688,_0x1a3fd7)=>{const _0x228db8=_0x48c7e7,_0x495fe8=_0x220ff7[_0x228db8(0x193)]['get'](_0x46d688);if(_0x495fe8)return _0x495fe8;const _0x2cef47=_0x220ff7[_0x228db8(0x15a)]['find'](_0x23cf89=>_0x23cf89[_0x228db8(0x17c)]===_0x46d688);if(_0x2cef47)return _0x220ff7[_0x228db8(0x193)]['set'](_0x46d688,_0x2cef47['id']),_0x2cef47['id'];if(_0x34d171[_0x228db8(0x1d8)]){const {stageName:_0x4a3d0c,criteriaName:_0x5df7bd}=findSegmentCriteriaLocation(_0x34d171[_0x228db8(0x136)],_0x46d688);return _0x3630a8(_0x46d688,_0x1a3fd7[_0x228db8(0x198)]),_0x4135f6['set'](_0x46d688,{'definition':_0x1a3fd7,'stageName':_0x4a3d0c,'criteriaName':_0x5df7bd}),createPendingSegmentId(_0x46d688);}const _0x774b19=_0x34d171[_0x228db8(0x12d)]?.['id'];if(!_0x774b19)throw new SDKError(ErrorCode['INTERNAL'],_0x228db8(0x151));const _0x29bdf7=_0x35b10e['get'](_0x46d688);if(_0x29bdf7)return _0x29bdf7;const _0x472ac4=((async()=>{const _0xfc6bde=_0x228db8;_0x3630a8(_0x46d688,_0x1a3fd7[_0xfc6bde(0x198)]);const _0x5c840c=generateDeterministicJourneySegmentName(_0x34d171[_0xfc6bde(0x136)][_0xfc6bde(0x17c)],_0x46d688),_0xb3b29a=_0x220ff7[_0xfc6bde(0x15a)][_0xfc6bde(0x1bb)](_0x483453=>_0x483453[_0xfc6bde(0x17c)]===_0x5c840c),_0x2a7893=createSegmentIdResolver(_0x220ff7[_0xfc6bde(0x193)],_0x46d688),_0x426fe2=await resolveRuleSegmentIds(_0x1a3fd7[_0xfc6bde(0x198)],_0x2a7893);let _0x9adde6;return _0xb3b29a?(await _0x537236['segment'][_0xfc6bde(0x1db)](_0x422ca9[_0xfc6bde(0x164)],_0xb3b29a['id'],{'description':_0x1a3fd7[_0xfc6bde(0x1cd)]||'Entry\x20criteria:\x20'+_0x46d688,'rule':_0x1541c0(_0x426fe2),'countPopulation':!![]}),_0x9adde6=_0xb3b29a['id'],saveSegmentToPushRecovery(_0x34d171[_0xfc6bde(0x1c1)],_0x34d171[_0xfc6bde(0x136)][_0xfc6bde(0x17c)],_0x46d688,{'segmentId':_0x9adde6,'uniqueServerName':_0x5c840c,'createdAt':new Date()[_0xfc6bde(0x1a3)]()})):_0x9adde6=await createOrRecoverEmbeddedSegment(_0x537236,_0x34d171,{'localName':_0x46d688,'uniqueSegmentName':_0x5c840c,'description':_0x1a3fd7[_0xfc6bde(0x1cd)]||'Entry\x20criteria:\x20'+_0x46d688,'journeyId':_0x774b19,'resolvedRule':_0x426fe2,'parentId':_0x422ca9[_0xfc6bde(0x164)],'folderId':_0x422ca9[_0xfc6bde(0x1d9)]||''},_0x1541c0),_0x220ff7['segmentNameToId'][_0xfc6bde(0x1c7)](_0x46d688,_0x9adde6),_0x16ccb2[_0xfc6bde(0x1c7)](_0x46d688,_0x9adde6),_0x9adde6;})());_0x35b10e[_0x228db8(0x1c7)](_0x46d688,_0x472ac4);try{return await _0x472ac4;}finally{_0x35b10e[_0x228db8(0x1dc)](_0x46d688);}},'resolveActivationId':async _0x21520f=>{const _0x4831c9=_0x48c7e7,_0x5077e6=_0x32f1c4[_0x4831c9(0x1ac)](_0x21520f);if(_0x5077e6)return _0x5077e6;if(_0x34d171['existingJourney']){await _0x301659();const _0x35de51=_0x32f1c4['get'](_0x21520f);if(_0x35de51)return _0x35de51;}throw new SDKError(ErrorCode[_0x4831c9(0x128)],_0x4831c9(0x150)+_0x21520f+_0x4831c9(0x216)+_0x34d171[_0x4831c9(0x136)][_0x4831c9(0x17c)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x4cff6d,_0x19c60a)=>{const _0x5a3f86=_0x48c7e7,_0x58d8d4=_0x32f1c4['get'](_0x4cff6d);if(_0x58d8d4)return _0x58d8d4;if(_0x34d171[_0x5a3f86(0x1d8)])return _0x45885b['set'](_0x4cff6d,_0x19c60a),createPendingActivationId(_0x4cff6d);if(_0x34d171[_0x5a3f86(0x12d)]){await _0x301659();const _0x3396b2=_0x32f1c4[_0x5a3f86(0x1ac)](_0x19c60a['name']);if(_0x3396b2)return _0x32f1c4[_0x5a3f86(0x1c7)](_0x4cff6d,_0x3396b2),_0x3396b2;const _0x1ede47=activationSignature(_0x19c60a),_0x1bacd3=_0x20134b?.[_0x5a3f86(0x1ac)](_0x1ede47);if(_0x1bacd3)return _0x32f1c4[_0x5a3f86(0x1c7)](_0x4cff6d,_0x1bacd3),_0x1bacd3;const _0x2e0640=await _0x4cc8d5(_0x19c60a,_0x220ff7['activationContext']),_0x19bff3={..._0x2e0640,..._0x19c60a[_0x5a3f86(0x1e9)]!==undefined&&{'runAfterJourneyRefresh':_0x19c60a[_0x5a3f86(0x1e9)]}},_0x1bded7=await _0x537236['journey'][_0x5a3f86(0x1b7)](_0x34d171['existingJourney']['id'],_0x19bff3);return _0x32f1c4['set'](_0x4cff6d,_0x1bded7['id']),_0x1bded7['id'];}throw new SDKError(ErrorCode[_0x5a3f86(0x1d6)],_0x5a3f86(0x19b));},'resolveJourneyId':async _0x379acb=>{const _0x38d891=_0x48c7e7;try{return await _0x537236[_0x38d891(0x1b8)]['resolveJourneyId'](_0x422ca9[_0x38d891(0x164)],_0x379acb);}catch(_0x5634a4){throw new SDKError(ErrorCode[_0x38d891(0x128)],_0x38d891(0x1e5)+_0x379acb+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x34d171[_0x38d891(0x136)][_0x38d891(0x17c)]+'\x27)',_0x5634a4);}},'resolveStageId':async(_0x33e789,_0x43ec22)=>{const _0x3bb523=_0x48c7e7,_0x3b0e87=await _0x537236[_0x3bb523(0x1b8)][_0x3bb523(0x15c)](_0x33e789),_0x58800e=_0x3b0e87[_0x3bb523(0x19a)][_0x3bb523(0x1f9)][_0x3bb523(0x1bb)](_0x582cf5=>_0x582cf5[_0x3bb523(0x17c)]['toLowerCase']()===_0x43ec22['toLowerCase']());if(!_0x58800e?.['id'])throw new SDKError(ErrorCode[_0x3bb523(0x128)],_0x3bb523(0x1e3)+_0x43ec22+_0x3bb523(0x1a0)+(_0x3b0e87[_0x3bb523(0x19a)][_0x3bb523(0x1f5)]||_0x3b0e87[_0x3bb523(0x19a)]['name'])+'\x27');return _0x58800e['id'];}},_0x301eb7=await _0x3e538f(_0x34d171[_0x48c7e7(0x136)],_0x422ca9[_0x48c7e7(0x164)],_0x53c8af),_0x57a0c6=_0x422ca9[_0x48c7e7(0x137)]||_0x422ca9['rootFolderId'];_0x57a0c6&&(_0x301eb7['relationships']={'parentFolder':{'data':{'id':_0x57a0c6,'type':'folder'}}});if(_0x34d171[_0x48c7e7(0x1d8)]){if(_0x4135f6['size']>0x0||_0x45885b[_0x48c7e7(0x1e6)]>0x0)return await executeThreeStepJourneyCreate(_0x537236,_0x34d171,_0x301eb7,{'pendingEmbeddedSegments':_0x4135f6,'pendingEmbeddedActivations':_0x45885b,'embeddedSegmentNameToId':_0x16ccb2,'journeyActivationNameToId':_0x32f1c4},{..._0x422ca9,'effectiveFolderId':_0x57a0c6},_0x220ff7,_0x5a8284,_0x5679b9);else{ensureJourneyDefaults(_0x301eb7[_0x48c7e7(0x19a)]);const _0x53421f=await _0x537236[_0x48c7e7(0x1b8)][_0x48c7e7(0x147)](_0x301eb7);return deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x144),'journeyId':_0x53421f['id'],'embeddedSegmentNameToId':_0x16ccb2};}}else{if(_0x34d171[_0x48c7e7(0x1c8)]&&_0x34d171[_0x48c7e7(0x12d)]){_0x301eb7['id']=_0x34d171[_0x48c7e7(0x12d)]['id'];const _0x3d9d15=_0x301eb7[_0x48c7e7(0x19a)];_0x34d171[_0x48c7e7(0x12d)][_0x48c7e7(0x19a)]?.['journeyBundleName']&&(_0x3d9d15[_0x48c7e7(0x1f5)]=_0x34d171[_0x48c7e7(0x12d)][_0x48c7e7(0x19a)][_0x48c7e7(0x1f5)]);const _0x56ffbf=_0x34d171['existingJourney'][_0x48c7e7(0x19a)]?.[_0x48c7e7(0x1f9)];return _0x56ffbf&&_0x301eb7['attributes'][_0x48c7e7(0x1f9)]&&injectExistingStageIds(_0x301eb7[_0x48c7e7(0x19a)][_0x48c7e7(0x1f9)],_0x56ffbf),ensureJourneyDefaults(_0x3d9d15),await _0x537236[_0x48c7e7(0x1b8)][_0x48c7e7(0x179)](_0x34d171[_0x48c7e7(0x12d)]['id'],_0x301eb7),deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x1df),'journeyId':_0x34d171[_0x48c7e7(0x12d)]['id'],'embeddedSegmentNameToId':_0x16ccb2};}}return deletePushRecovery(_0x34d171[_0x48c7e7(0x1c1)]),{'action':_0x48c7e7(0x180),'journeyId':_0x34d171[_0x48c7e7(0x12d)]?.['id'],'embeddedSegmentNameToId':_0x16ccb2};}function findSegmentCriteriaLocation(_0x38c756,_0x41c589){const _0x4a565e=a151_0x2ed631,_0x323cae=_0x38c756[_0x4a565e(0x1bf)]||_0x38c756[_0x4a565e(0x13d)]?.[0x0]?.['stages']||[];let _0x563214=_0x4a565e(0x1f2),_0x57211e=_0x41c589;const _0x5c0e9a=_0x38c756[_0x4a565e(0x161)]||_0x38c756['journeys']?.[0x0]?.[_0x4a565e(0x161)];if(_0x5c0e9a?.[_0x4a565e(0x1b9)]===_0x41c589)return{'stageName':_0x4a565e(0x161),'criteriaName':_0x5c0e9a[_0x4a565e(0x17c)]||_0x41c589};_0x27a884:for(const _0x182e3b of _0x323cae){if(_0x182e3b[_0x4a565e(0x15e)]?.[_0x4a565e(0x1b9)]===_0x41c589){_0x563214=_0x182e3b[_0x4a565e(0x17c)],_0x57211e=_0x182e3b['entry_criteria']['name']||_0x41c589;break;}if(_0x182e3b[_0x4a565e(0x126)])for(const _0xd00d9 of _0x182e3b[_0x4a565e(0x126)]){if(_0xd00d9[_0x4a565e(0x138)]===_0x4a565e(0x1ec)&&_0xd00d9[_0x4a565e(0x1e7)]?.[_0x4a565e(0x218)])for(const _0x5df5e4 of _0xd00d9['with'][_0x4a565e(0x218)]){if(_0x5df5e4[_0x4a565e(0x1b9)]===_0x41c589){_0x563214=_0x182e3b[_0x4a565e(0x17c)],_0x57211e=_0x5df5e4[_0x4a565e(0x17c)]||_0x41c589;break _0x27a884;}}}}return{'stageName':_0x563214,'criteriaName':_0x57211e};}async function executeThreeStepJourneyCreate(_0x52cb0a,_0x197d67,_0x554939,_0x2192de,_0x119e53,_0x183304,_0x275d61,_0x265587){const _0x5d629a=a151_0x2ed631,{activationDefToCreateRequest:_0x44564b,yamlRuleToApi:_0x56630e}=_0x265587,{pendingEmbeddedSegments:_0xb4d881,pendingEmbeddedActivations:_0x7a3894,embeddedSegmentNameToId:_0x455533}=_0x2192de,_0x51a0d3=JSON['parse'](JSON[_0x5d629a(0x14e)](_0x554939));ensureJourneyDefaults(_0x51a0d3[_0x5d629a(0x19a)]),stripPendingIds(_0x51a0d3);const _0x48699c=await _0x52cb0a[_0x5d629a(0x1b8)][_0x5d629a(0x147)](_0x51a0d3),_0x4df3d3=_0x48699c['id'],_0x33b663=new Map();for(const _0x176a21 of _0x48699c[_0x5d629a(0x19a)][_0x5d629a(0x1f9)]){_0x33b663[_0x5d629a(0x1c7)](_0x176a21[_0x5d629a(0x17c)]['toLowerCase'](),_0x176a21['id']);}recoverSegmentIdsFromPushRecovery(_0x197d67,_0x455533,_0x183304[_0x5d629a(0x193)]);for(const [_0x43a0e9,{definition:_0x37ae3c}]of _0xb4d881){if(_0x455533[_0x5d629a(0x1b5)](_0x43a0e9)){_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_segment_created','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'segmentName':_0x43a0e9});continue;}const _0x4bf79c=generateDeterministicJourneySegmentName(_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],_0x43a0e9);_0x275d61['onProgress']?.({'type':_0x5d629a(0x1e4),'journeyName':_0x197d67['yamlConfig']['name'],'segmentName':_0x43a0e9});const _0x3107e4=createSegmentIdResolver(_0x183304[_0x5d629a(0x193)],_0x43a0e9),_0x30c314=await resolveRuleSegmentIds(_0x37ae3c[_0x5d629a(0x198)],_0x3107e4),_0x4dfb97=await createOrRecoverEmbeddedSegment(_0x52cb0a,_0x197d67,{'localName':_0x43a0e9,'uniqueSegmentName':_0x4bf79c,'description':_0x37ae3c[_0x5d629a(0x1cd)]||'Entry\x20criteria:\x20'+_0x43a0e9,'journeyId':_0x4df3d3,'resolvedRule':_0x30c314,'parentId':_0x119e53[_0x5d629a(0x164)],'folderId':_0x119e53[_0x5d629a(0x1f3)]||''},_0x56630e);_0x455533[_0x5d629a(0x1c7)](_0x43a0e9,_0x4dfb97),_0x183304[_0x5d629a(0x193)][_0x5d629a(0x1c7)](_0x43a0e9,_0x4dfb97),_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_segment_created','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'segmentName':_0x43a0e9});}const _0x7f4b0c=new Map();for(const [_0xdd1f10,_0x535bec]of _0x7a3894){_0x275d61[_0x5d629a(0x183)]?.({'type':'embedded_activation_creating','journeyName':_0x197d67[_0x5d629a(0x136)][_0x5d629a(0x17c)],'activationName':_0xdd1f10});const _0x149f22=await _0x44564b(_0x535bec,_0x183304[_0x5d629a(0x173)]),_0x48d0fb={..._0x149f22,..._0x535bec[_0x5d629a(0x1e9)]!==undefined&&{'runAfterJourneyRefresh':_0x535bec['run_after_journey_refresh']}},_0x345bd0=await _0x52cb0a['journey'][_0x5d629a(0x1b7)](_0x4df3d3,_0x48d0fb);_0x7f4b0c[_0x5d629a(0x1c7)](_0xdd1f10,_0x345bd0['id']),_0x2192de[_0x5d629a(0x18e)][_0x5d629a(0x1c7)](_0xdd1f10,_0x345bd0['id']),_0x275d61['onProgress']?.({'type':_0x5d629a(0x1eb),'journeyName':_0x197d67[_0x5d629a(0x136)]['name'],'activationName':_0xdd1f10});}const _0x493091=JSON[_0x5d629a(0x211)](JSON['stringify'](_0x554939));return _0x493091['id']=_0x4df3d3,ensureJourneyDefaults(_0x493091[_0x5d629a(0x19a)]),resolvePendingIdsInRequest(_0x493091,_0x554939,_0x33b663,_0x455533,_0x7f4b0c,_0x275d61),await _0x52cb0a[_0x5d629a(0x1b8)]['update'](_0x4df3d3,_0x493091),deletePushRecovery(_0x197d67[_0x5d629a(0x1c1)]),{'action':_0x5d629a(0x144),'journeyId':_0x4df3d3,'embeddedSegmentNameToId':_0x455533};}export function stripWaitStepPendingIds(_0x434072){const _0x4f2ba6=a151_0x2ed631,_0x4da19a=_0x434072[_0x4f2ba6(0x1f0)]&&isPendingSegmentId(_0x434072[_0x4f2ba6(0x1f0)]),_0x33c94d=_0x434072['conditions']?.[_0x4f2ba6(0x212)](_0x59238a=>_0x59238a[_0x4f2ba6(0x203)]&&isPendingSegmentId(_0x59238a[_0x4f2ba6(0x203)]));(_0x4da19a||_0x33c94d)&&(_0x434072[_0x4f2ba6(0x1aa)]=_0x4f2ba6(0x14d),_0x434072[_0x4f2ba6(0x154)]=0x1,_0x434072['waitStepUnit']='day',delete _0x434072[_0x4f2ba6(0x1f0)],delete _0x434072[_0x4f2ba6(0x189)],delete _0x434072[_0x4f2ba6(0x1d1)],delete _0x434072[_0x4f2ba6(0x12f)]);}export function resolveWaitStepPendingIds(_0x5e07d4,_0x483815,_0x1ef3f9,_0x2aa9c4){const _0x2a2021=a151_0x2ed631;if(_0x483815[_0x2a2021(0x1f0)]&&isPendingSegmentId(_0x483815[_0x2a2021(0x1f0)])){const _0x3ef526=_0x1ef3f9(_0x483815[_0x2a2021(0x1f0)],_0x2a2021(0x17e)+_0x2aa9c4+'\x27\x20wait\x20condition');_0x3ef526&&(_0x5e07d4['waitStepType']=_0x2a2021(0x175),_0x5e07d4[_0x2a2021(0x1f0)]=_0x3ef526,delete _0x5e07d4[_0x2a2021(0x154)],delete _0x5e07d4[_0x2a2021(0x166)],_0x483815['conditionTimeoutDuration']!==undefined&&(_0x5e07d4[_0x2a2021(0x189)]=_0x483815[_0x2a2021(0x189)]),_0x483815[_0x2a2021(0x1d1)]&&(_0x5e07d4[_0x2a2021(0x1d1)]=_0x483815[_0x2a2021(0x1d1)]));}if(_0x483815[_0x2a2021(0x12f)]){const _0x3cd373=_0x483815[_0x2a2021(0x12f)]['some'](_0x1645a8=>_0x1645a8[_0x2a2021(0x203)]&&isPendingSegmentId(_0x1645a8[_0x2a2021(0x203)]));if(_0x3cd373){const _0x4f3f22=_0x483815[_0x2a2021(0x12f)][_0x2a2021(0x191)](_0x2fd311=>{const _0x47aa65=_0x2a2021;if(_0x2fd311[_0x47aa65(0x203)]&&isPendingSegmentId(_0x2fd311[_0x47aa65(0x203)])){const _0x169a29=_0x1ef3f9(_0x2fd311['segmentId'],'stage\x20\x27'+_0x2aa9c4+_0x47aa65(0x160));return{..._0x2fd311,'segmentId':_0x169a29||_0x2fd311['segmentId']};}return{..._0x2fd311};});_0x5e07d4[_0x2a2021(0x1aa)]=_0x2a2021(0x175),_0x5e07d4[_0x2a2021(0x12f)]=_0x4f3f22,delete _0x5e07d4[_0x2a2021(0x154)],delete _0x5e07d4[_0x2a2021(0x166)],delete _0x5e07d4[_0x2a2021(0x1f0)],delete _0x5e07d4[_0x2a2021(0x189)],delete _0x5e07d4[_0x2a2021(0x1d1)];}}}function stripPendingIds(_0x539281){const _0x59a86a=a151_0x2ed631;_0x539281[_0x59a86a(0x19a)]['goal']?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x539281['attributes'][_0x59a86a(0x161)][_0x59a86a(0x203)])&&delete _0x539281['attributes'][_0x59a86a(0x161)];for(const _0x13c905 of _0x539281['attributes'][_0x59a86a(0x1f9)]||[]){_0x13c905['entryCriteria']?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x13c905['entryCriteria']['segmentId'])&&delete _0x13c905[_0x59a86a(0x1e2)];_0x13c905[_0x59a86a(0x178)]?.[_0x59a86a(0x203)]&&isPendingSegmentId(_0x13c905['milestone'][_0x59a86a(0x203)])&&delete _0x13c905['milestone'];_0x13c905[_0x59a86a(0x215)]&&(_0x13c905[_0x59a86a(0x215)]=_0x13c905[_0x59a86a(0x215)][_0x59a86a(0x1fd)](_0x1f00ee=>!_0x1f00ee['segmentId']||!isPendingSegmentId(_0x1f00ee[_0x59a86a(0x203)])));if(_0x13c905[_0x59a86a(0x126)])for(const _0x3b9501 of Object[_0x59a86a(0x197)](_0x13c905['steps'])){const _0xc41b20=_0x13c905[_0x59a86a(0x126)][_0x3b9501];_0xc41b20[_0x59a86a(0x138)]===_0x59a86a(0x16f)&&_0xc41b20[_0x59a86a(0x11d)]&&isPendingActivationId(_0xc41b20['journeyActivationStepId'])&&(_0xc41b20['journeyActivationStepId']='');if(_0xc41b20['type']==='DecisionPoint'&&_0xc41b20[_0x59a86a(0x218)])for(const _0x26bf25 of _0xc41b20[_0x59a86a(0x218)]){_0x26bf25[_0x59a86a(0x203)]&&isPendingSegmentId(_0x26bf25[_0x59a86a(0x203)])&&(_0x26bf25[_0x59a86a(0x203)]='');}_0xc41b20['type']===_0x59a86a(0x12a)&&stripWaitStepPendingIds(_0xc41b20);}}}function resolvePendingIdsInRequest(_0x4eb0d4,_0x415623,_0x5c8a21,_0x984de7,_0x2eec32,_0x13e45f){const _0x4a13d0=a151_0x2ed631,_0x126a7d=(_0x2ff15b,_0x188495)=>{const _0x4ac046=a151_0x5571;if(!isPendingSegmentId(_0x2ff15b))return _0x2ff15b;const _0x4aef56=extractPendingSegmentName(_0x2ff15b),_0x57b424=_0x984de7[_0x4ac046(0x1ac)](_0x4aef56);return!_0x57b424&&_0x13e45f[_0x4ac046(0x169)]?.(_0x4ac046(0x1e0)+_0x4aef56+_0x4ac046(0x16e)+_0x188495),_0x57b424;};if(_0x4eb0d4['attributes'][_0x4a13d0(0x161)]?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x161)][_0x4a13d0(0x203)])){const _0x432496=_0x126a7d(_0x4eb0d4['attributes'][_0x4a13d0(0x161)]['segmentId'],_0x4a13d0(0x13f));_0x432496&&(_0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x161)]['segmentId']=_0x432496);}for(const _0x31e6ae of _0x4eb0d4[_0x4a13d0(0x19a)][_0x4a13d0(0x1f9)]||[]){const _0x30d0a9=_0x5c8a21[_0x4a13d0(0x1ac)](_0x31e6ae[_0x4a13d0(0x17c)][_0x4a13d0(0x181)]());_0x30d0a9&&(_0x31e6ae['id']=_0x30d0a9);if(_0x31e6ae[_0x4a13d0(0x1e2)]?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x31e6ae[_0x4a13d0(0x1e2)][_0x4a13d0(0x203)])){const _0x235ea5=_0x126a7d(_0x31e6ae['entryCriteria']['segmentId'],'stage\x20\x27'+_0x31e6ae[_0x4a13d0(0x17c)]+_0x4a13d0(0x185));_0x235ea5&&(_0x31e6ae['entryCriteria']['segmentId']=_0x235ea5);}if(_0x31e6ae['exitCriterias'])for(const _0x16c810 of _0x31e6ae[_0x4a13d0(0x215)]){if(_0x16c810[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x16c810[_0x4a13d0(0x203)])){const _0x279e4a=_0x126a7d(_0x16c810[_0x4a13d0(0x203)],_0x4a13d0(0x17e)+_0x31e6ae[_0x4a13d0(0x17c)]+_0x4a13d0(0x190));_0x279e4a&&(_0x16c810[_0x4a13d0(0x203)]=_0x279e4a);}}if(_0x31e6ae[_0x4a13d0(0x178)]?.['segmentId']&&isPendingSegmentId(_0x31e6ae[_0x4a13d0(0x178)]['segmentId'])){const _0x301c18=_0x126a7d(_0x31e6ae['milestone'][_0x4a13d0(0x203)],_0x4a13d0(0x17e)+_0x31e6ae['name']+_0x4a13d0(0x1c4));_0x301c18&&(_0x31e6ae['milestone'][_0x4a13d0(0x203)]=_0x301c18);}if(_0x31e6ae[_0x4a13d0(0x126)]){const _0x12b5fa=_0x9a48ef=>_0x415623['attributes'][_0x4a13d0(0x1f9)]?.[_0x4a13d0(0x1bb)](_0x69ba31=>_0x69ba31['name']['toLowerCase']()===_0x31e6ae[_0x4a13d0(0x17c)][_0x4a13d0(0x181)]())?.[_0x4a13d0(0x126)]?.[_0x9a48ef];for(const _0x3e28e7 of Object[_0x4a13d0(0x197)](_0x31e6ae[_0x4a13d0(0x126)])){const _0x410b02=_0x31e6ae['steps'][_0x3e28e7],_0x3f8d3a=_0x12b5fa(_0x3e28e7);if(_0x410b02['type']==='Activation'&&_0x410b02[_0x4a13d0(0x11d)]&&(isPendingActivationId(_0x410b02[_0x4a13d0(0x11d)])||_0x410b02['journeyActivationStepId']==='')){if(_0x3f8d3a?.[_0x4a13d0(0x11d)]&&isPendingActivationId(_0x3f8d3a['journeyActivationStepId'])){const _0x1e5df1=extractPendingActivationName(_0x3f8d3a[_0x4a13d0(0x11d)]),_0xae5b23=_0x2eec32['get'](_0x1e5df1);_0xae5b23&&(_0x410b02[_0x4a13d0(0x11d)]=_0xae5b23);}}if(_0x410b02[_0x4a13d0(0x138)]===_0x4a13d0(0x15b)&&_0x410b02['branches']&&_0x3f8d3a?.[_0x4a13d0(0x218)])for(let _0x2d380c=0x0;_0x2d380c<_0x410b02[_0x4a13d0(0x218)][_0x4a13d0(0x165)];_0x2d380c++){const _0xc67fd7=_0x410b02[_0x4a13d0(0x218)][_0x2d380c],_0x4c9efe=_0x3f8d3a[_0x4a13d0(0x218)][_0x2d380c];if(_0x4c9efe?.[_0x4a13d0(0x203)]&&isPendingSegmentId(_0x4c9efe['segmentId'])){const _0x32b7ef=_0x126a7d(_0x4c9efe[_0x4a13d0(0x203)],'stage\x20\x27'+_0x31e6ae['name']+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0xc67fd7[_0x4a13d0(0x17c)]||_0x2d380c)+'\x27');_0x32b7ef&&(_0xc67fd7[_0x4a13d0(0x203)]=_0x32b7ef);}}_0x410b02[_0x4a13d0(0x138)]===_0x4a13d0(0x12a)&&_0x3f8d3a?.[_0x4a13d0(0x138)]===_0x4a13d0(0x12a)&&resolveWaitStepPendingIds(_0x410b02,_0x3f8d3a,_0x126a7d,_0x31e6ae['name']);}}}}
|
|
1
|
+
const a152_0x451377=a152_0x18a7;(function(_0x5b21b3,_0x55c3b4){const _0x3f28bc=a152_0x18a7,_0x360796=_0x5b21b3();while(!![]){try{const _0x24432a=-parseInt(_0x3f28bc(0xfa))/0x1*(parseInt(_0x3f28bc(0x167))/0x2)+parseInt(_0x3f28bc(0x148))/0x3*(-parseInt(_0x3f28bc(0x1bb))/0x4)+-parseInt(_0x3f28bc(0xc6))/0x5+parseInt(_0x3f28bc(0x1b6))/0x6*(-parseInt(_0x3f28bc(0x19f))/0x7)+parseInt(_0x3f28bc(0x15b))/0x8*(parseInt(_0x3f28bc(0x10a))/0x9)+-parseInt(_0x3f28bc(0xf4))/0xa*(parseInt(_0x3f28bc(0xd6))/0xb)+parseInt(_0x3f28bc(0x14a))/0xc;if(_0x24432a===_0x55c3b4)break;else _0x360796['push'](_0x360796['shift']());}catch(_0x53d5d9){_0x360796['push'](_0x360796['shift']());}}}(a152_0x2189,0x9d946));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a152_0x451377(0x12d));export const PENDING_SEGMENT_PREFIX=a152_0x451377(0x118);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4619a4){return''+PENDING_SEGMENT_PREFIX+_0x4619a4+'__';}function a152_0x2189(){const _0x3fc77f=['Updating\x20activation\x20\x27','Failed\x20to\x20resolve\x20segment\x20','__pending_','notification','create','Segment\x20not\x20found','columns','draft','withProgress','all','all_columns','activation_creating','nameToType','WaitStep','logSuccess','\x20(referenced\x20in\x20journey\x20','getSegment','\x20segment\x20from\x20file:\x20','activation_','deps','conditionTimeoutDuration','Creating\x20segment\x20\x27','segmentFolderId','tdx.sdk.push-workflow','state','get','NOT_FOUND','../../utils/async.js','Entry\x20criteria:\x20','journeyBundleName','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','type','split','unchanged','uniqueServerName','and\x20the\x20server\x20segment,\x20then\x20retry.','\x27\x20entry\x20criteria','\x27\x20milestone','idToEmailMap','activationContext','versionNumber','\x20activation\x20\x27','errors','skipSegments','relative','journeyId','Delete\x20the\x20push\x20recovery\x20file\x20(','set','deleteActivation','stringify','723kmAdkP','conditionSegmentId','31287072LmViiU','some','updated','deleted','exitCriterias','yamlConfig','existingJourney','branches','Failed\x20to\x20resolve\x20activation\x20','Deleted\x20segment\x20\x27','journeyActivationStepId','listActivations','SEGMENT_NOT_FOUND','digest','activation_deleting','results',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','8uQunPk','waitStep','journey','slice','segment_created','list','user','createdSegmentIds','entry','folder','\x27\x20wait\x20condition','folderId','2FREAyH','startsWith','flatMap','rootFolderId','createdSegmentId','length','onProgress','attributes','folder_creating','size','index','segments','parentFolder','valid','push','update','journey_created','updateActivation','Fetching\x20','SEGMENT_UPDATE_ERROR','message','createSegment','includes','debug','journeys','segmentNameToId','./child-segment-yaml.js','embedded_activation_created','resolvedRule','Segment\x20not\x20found:\x20','max','null','Embedded\x20segment\x20\x27','journeyById','existingSegment','toString','segment_deleted','ACTIVATION_SYNTAX_ERROR','utf-8','folderPath','parse','createFolder','journeyName','segment','uniqueSegmentName','conditionTimeoutUnit','conditions','createActivation','Activation\x20not\x20found:\x20','filter','steps','segmentId','rule','match','createJourneySegment','find','239351AdIYHo','created','parseDocument','getJourney','activation_template_id','run_after_journey_refresh','activation_updated','absolutePath','Journey\x20\x27','validatedRequest','.$1.push-recovery.json','has','\x27\x20not\x20found\x20in\x20journey\x20\x27','behavior','Created\x20activation\x20\x27','localName','goal\x20criteria','\x27\x20decision\x20point\x20branch\x20\x27','map','\x20journey\x20from\x20file:\x20','object','action','resolveJourneyId','24iFdbeT','JOURNEY_SYNTAX_ERROR','name','stage\x20\x27','connection','6928QSNtcZ','journeyBundleId','description','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','waitStepType','embeddedSegmentNameToId','\x0a\x20\x20','connector_config','\x27\x20from\x20file:\x20','fetchJourney','Failed\x20to\x20','folderPathToId','diff','):\x20','values','existingSegments','Updating\x20segment\x20\x27','milestone','4910105tskYUo','idToName','ACTIVATION_UPDATE_ERROR','add','toLowerCase','join','Created\x20journey\x20\x27','stages','journeyStages','sort','kind','logWarning','entries','journey_creating','DecisionPoint','keys','607343XhfVTa','activationStepsById','isNew','getSegment\x20failed\x20for\x20','hex','existingActivation','logDeleted','Updated\x20segment\x20\x27','Updated\x20journey\x20\x27','logInfo',').\x20','activationActions','Condition','progress','Matched\x20server\x20segment\x20\x27','connectionIdToNameMap','\x27...','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','updateSegmentById','buildUserMaps','decision_point','journeyActivationNameToId','embedded_segment_creating','activationParams','Duration','./journey-yaml.js','INTERNAL','getActivation','sha1','170kOXFem','parentId','segment_deleting','delete','journey_updated','activation_created','609551ZOrBmG','Activation','verbose','toISOString','entryCriteria','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','entry_criteria','trim','\x27\x20exit\x20criteria','Failed\x20to\x20fetch\x20referenced\x20segment\x20','data','yamlActivation','segment_updating','dirname','journey_updating','relationships','10103103ovFmSG','resolveSegment','effectiveFolderId','activations','segment_creating','hasChanges','from','Deleted\x20activation\x20\x27','Name\x20has\x20already\x20been\x20taken','goal','Updated\x20activation\x20\x27','nameToId'];a152_0x2189=function(){return _0x3fc77f;};return a152_0x2189();}export function isPendingSegmentId(_0x2a3a43){const _0x16a8e4=a152_0x451377;return _0x2a3a43[_0x16a8e4(0x168)](PENDING_SEGMENT_PREFIX)&&!_0x2a3a43['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x3cce03){return _0x3cce03['replace'](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5593b2){return''+PENDING_ACTIVATION_PREFIX+_0x5593b2+'__';}export function isPendingActivationId(_0x351b34){const _0x49525b=a152_0x451377;return _0x351b34[_0x49525b(0x168)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xb45536){return _0xb45536['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x962963,_0x552223){const _0x1e0d67=a152_0x451377,_0x50ebae=_0x962963+'::'+(_0x552223[_0x1e0d67(0x101)]()||_0x1e0d67(0x192)),_0x523774=createHash(_0x1e0d67(0xf3))['update'](_0x50ebae)[_0x1e0d67(0x157)](_0x1e0d67(0xda))['slice'](0x0,0xc);return'journey_entry_criteria_'+_0x523774;}export function ensureJourneyDefaults(_0x166d33){const _0x57003c=a152_0x451377;!_0x166d33[_0x57003c(0x1bd)]&&(_0x166d33[_0x57003c(0x1bd)]=''),!_0x166d33[_0x57003c(0x12e)]&&(_0x166d33[_0x57003c(0x12e)]=_0x57003c(0x11d));}export function injectExistingStageIds(_0x3c5281,_0x21783c){const _0x5e5257=a152_0x451377,_0x31b36b=new Map(_0x21783c[_0x5e5257(0x1b1)](_0x2d8645=>[_0x2d8645[_0x5e5257(0x1b8)],_0x2d8645['id']]));for(const _0x18a8d3 of _0x3c5281){if(!_0x18a8d3['id']){const _0x4691b3=_0x31b36b[_0x5e5257(0x12f)](_0x18a8d3[_0x5e5257(0x1b8)]);_0x4691b3&&(_0x18a8d3['id']=_0x4691b3);}}}export function resolveTDFolderPath(_0x5ee177,_0x323b8f,_0x4f1a97){const _0x44cdc3=a152_0x451377;if(!_0x323b8f)return _0x5ee177;if(_0x5ee177===_0x4f1a97||_0x5ee177[_0x44cdc3(0x168)](_0x4f1a97+'/'))return _0x5ee177;return _0x5ee177?_0x4f1a97+'/'+_0x5ee177:_0x4f1a97;}export function addFoldersToCreate(_0x12d967,_0x4d05d2,_0x3a584a){const _0x2c6224=a152_0x451377;if(!_0x12d967)return;if(_0x4d05d2[_0x2c6224(0x1aa)](_0x12d967))return;const _0x36a59a=_0x12d967[_0x2c6224(0x136)]('/');let _0x3ed343='';for(const _0xdf607b of _0x36a59a){_0x3ed343=_0x3ed343?_0x3ed343+'/'+_0xdf607b:_0xdf607b,!_0x4d05d2[_0x2c6224(0x1aa)](_0x3ed343)&&_0x3a584a[_0x2c6224(0xc9)](_0x3ed343);}}export function sortFoldersByDepth(_0x5a5abb){const _0x2ab33=a152_0x451377;return[..._0x5a5abb][_0x2ab33(0xcf)]((_0x1d3e71,_0x5d7c15)=>{const _0x52b3a7=_0x2ab33,_0x35c98c=(_0x1d3e71[_0x52b3a7(0x19c)](/\//g)||[])[_0x52b3a7(0x16c)],_0x44f95d=(_0x5d7c15['match'](/\//g)||[])['length'];return _0x35c98c-_0x44f95d;});}import*as a152_0x4a5dd5 from'yaml';import{readFileSync}from'fs';import a152_0x219797 from'path';import{isJourneyDef,parseYamlString as a152_0x3920c3,toYamlString as a152_0x32ba86,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(_0x1be58b){const _0x3e98b9=a152_0x451377;if(Array['isArray'](_0x1be58b))return'['+_0x1be58b[_0x3e98b9(0x1b1)](_0x357d55=>stableStringify(_0x357d55))['join'](',')+']';if(_0x1be58b&&typeof _0x1be58b===_0x3e98b9(0x1b3)){const _0x436ab8=_0x1be58b,_0x2cabb8=Object['keys'](_0x436ab8)['sort'](),_0x33aae8=_0x2cabb8['map'](_0x9c1a7b=>'\x22'+_0x9c1a7b+'\x22:'+stableStringify(_0x436ab8[_0x9c1a7b]));return'{'+_0x33aae8[_0x3e98b9(0xcb)](',')+'}';}const _0x45c3aa=JSON[_0x3e98b9(0x147)](_0x1be58b);return _0x45c3aa===undefined?_0x3e98b9(0x186):_0x45c3aa;}function activationSignature(_0x29f432){const _0xccf062=a152_0x451377,_0x2e8434={'connection':_0x29f432[_0xccf062(0x1ba)],..._0x29f432[_0xccf062(0x120)]!==undefined&&{'all_columns':_0x29f432[_0xccf062(0x120)]},..._0x29f432[_0xccf062(0x11c)]!==undefined&&{'columns':_0x29f432[_0xccf062(0x11c)]},..._0x29f432[_0xccf062(0x1ac)]!==undefined&&{'behavior':_0x29f432[_0xccf062(0x1ac)]},..._0x29f432['schedule']!==undefined&&{'schedule':_0x29f432['schedule']},..._0x29f432[_0xccf062(0x119)]!==undefined&&{'notification':_0x29f432[_0xccf062(0x119)]},..._0x29f432['connector_config']!==undefined&&{'connector_config':_0x29f432[_0xccf062(0xbb)]},..._0x29f432['activation_template_id']!==undefined&&{'activation_template_id':_0x29f432[_0xccf062(0x1a3)]}};return stableStringify(_0x2e8434);}async function fetchSegment(_0x3480ac,_0x3adc53,_0x3a8f64,_0x4d0ec9){const _0x362c37=a152_0x451377,_0x1376be=_0x4d0ec9?.[_0x362c37(0x19e)](_0x1b50a5=>_0x1b50a5['id']===_0x3a8f64);if(_0x1376be)return _0x1376be;try{return await _0x3480ac[_0x362c37(0x192)][_0x362c37(0x126)](_0x3adc53,_0x3a8f64);}catch(_0x5537f3){logger['debug'](_0x362c37(0xd9)+_0x3a8f64+_0x362c37(0x15a)+_0x5537f3);try{return await _0x3480ac[_0x362c37(0x192)]['getSegmentEntity'](_0x3a8f64);}catch(_0xbc5b95){return logger[_0x362c37(0x17e)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x3a8f64+':\x20'+_0xbc5b95),null;}}}function recoverSegmentIdsFromPushRecovery(_0x49683f,_0x2c9f39,_0x5270fa){const _0x36ec7d=a152_0x451377,_0x20d919=readPushRecovery(_0x49683f['absolutePath']);if(_0x20d919?.[_0x36ec7d(0x191)]===_0x49683f[_0x36ec7d(0x14f)][_0x36ec7d(0x1b8)])for(const [_0xde4967,_0x2a04f1]of Object[_0x36ec7d(0xd2)](_0x20d919['segments'])){const _0x2829b9=generateDeterministicJourneySegmentName(_0x49683f[_0x36ec7d(0x14f)][_0x36ec7d(0x1b8)],_0xde4967);_0x2a04f1[_0x36ec7d(0x138)]===_0x2829b9&&(_0x2c9f39['set'](_0xde4967,_0x2a04f1['segmentId']),_0x5270fa[_0x36ec7d(0x145)](_0xde4967,_0x2a04f1['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x44df82,_0x20cccb,_0x28b075,_0x530a8a){const _0x1c36bb=a152_0x451377;let _0x4aa966;try{_0x4aa966=await _0x44df82[_0x1c36bb(0x192)][_0x1c36bb(0x19d)]({'name':_0x28b075[_0x1c36bb(0x193)],'description':_0x28b075[_0x1c36bb(0x1bd)],'journeyId':_0x28b075[_0x1c36bb(0x143)],'rule':_0x530a8a(_0x28b075[_0x1c36bb(0x183)],!![]),'countPopulation':!![],'parentFolderId':_0x28b075[_0x1c36bb(0x166)],'audienceId':_0x28b075[_0x1c36bb(0xf5)]});}catch(_0x29f156){const _0x44b94e=_0x29f156 instanceof Error&&_0x29f156[_0x1c36bb(0x17b)][_0x1c36bb(0x17d)](_0x1c36bb(0x112));if(_0x44b94e){const _0x5e6ad0=readPushRecovery(_0x20cccb['absolutePath']),_0x506832=_0x5e6ad0?.[_0x1c36bb(0x191)]===_0x20cccb[_0x1c36bb(0x14f)][_0x1c36bb(0x1b8)]?_0x5e6ad0[_0x1c36bb(0x172)][_0x28b075[_0x1c36bb(0x1ae)]]:undefined;if(_0x506832?.[_0x1c36bb(0x138)]===_0x28b075['uniqueSegmentName'])await _0x44df82[_0x1c36bb(0x192)][_0x1c36bb(0xe9)](_0x28b075[_0x1c36bb(0xf5)],_0x506832[_0x1c36bb(0x19a)],{'description':_0x28b075['description'],'rule':_0x530a8a(_0x28b075[_0x1c36bb(0x183)],!![]),'countPopulation':!![]}),_0x4aa966=_0x506832[_0x1c36bb(0x19a)];else throw new SDKError(ErrorCode[_0x1c36bb(0x17a)],_0x1c36bb(0x187)+_0x28b075['localName']+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x1c36bb(0x144)+_0x20cccb[_0x1c36bb(0x1a6)]['replace'](/([^/]+)$/,_0x1c36bb(0x1a9))+')\x20')+_0x1c36bb(0x139),_0x29f156);}else throw _0x29f156;}return saveSegmentToPushRecovery(_0x20cccb[_0x1c36bb(0x1a6)],_0x20cccb[_0x1c36bb(0x14f)][_0x1c36bb(0x1b8)],_0x28b075[_0x1c36bb(0x1ae)],{'segmentId':_0x4aa966,'uniqueServerName':_0x28b075[_0x1c36bb(0x193)],'createdAt':new Date()[_0x1c36bb(0xfd)]()}),_0x4aa966;}export async function prepareSegmentFiles(_0x94a004,_0x46aa7d,_0x2d40e7,_0xcdae52,_0x45de64){const _0x579c7f=a152_0x451377,{activationDefToCreateRequest:_0x5466fc}=await import(_0x579c7f(0x181)),_0x485840=[],_0x1496a4=new Set();for(const {yamlConfig:_0x544524,folderPath:_0x3e008d,sourcePath:_0xef59c3}of _0x94a004){const _0x12c8b2=resolveTDFolderPath(_0x3e008d,_0xcdae52,_0x45de64),_0x7edf4b=_0x12c8b2+':'+_0x544524[_0x579c7f(0x1b8)],_0x372c61=_0x46aa7d['segmentByFolderAndName']['get'](_0x7edf4b),_0x1f591a=_0x372c61?_0x46aa7d['activationsBySegmentId'][_0x579c7f(0x12f)](_0x372c61['id'])||[]:[];addFoldersToCreate(_0x12c8b2,_0x46aa7d['folderPathToId'],_0x1496a4);const _0x232331=calculateActivationActions(_0x544524[_0x579c7f(0x10d)]||[],_0x1f591a,_0x46aa7d['idToEmailMap'],_0x46aa7d[_0x579c7f(0xe5)]);for(const _0x3833d0 of _0x232331){(_0x3833d0[_0x579c7f(0x135)]===_0x579c7f(0x11a)||_0x3833d0[_0x579c7f(0x135)]===_0x579c7f(0x176))&&_0x3833d0[_0x579c7f(0x105)]&&(_0x3833d0['validatedRequest']=await _0x5466fc(_0x3833d0[_0x579c7f(0x105)],_0x2d40e7));}const _0x58ed62=calculateSegmentDiff(_0x544524,_0x372c61,_0x1f591a,_0x46aa7d[_0x579c7f(0x13c)],_0x46aa7d['connectionIdToNameMap']);_0x485840[_0x579c7f(0x175)]({'relativePath':_0x544524[_0x579c7f(0x1b8)],'absolutePath':_0xef59c3,'yamlConfig':_0x544524,'folderPath':_0x12c8b2,'existingSegment':_0x372c61,'existingActivations':_0x1f591a,'isNew':_0x58ed62['isNew'],'hasChanges':_0x58ed62['hasChanges'],'diff':_0x58ed62['diff'],'activationActions':_0x232331});}return{'segmentFiles':_0x485840,'foldersToCreate':_0x1496a4};}export async function prepareJourneyFiles(_0x1d1766,_0x591021,_0x170067,_0x50bfe2){const _0x290454=a152_0x451377,_0x25878d=[],_0x472c6b=new Set();for(const {yamlConfig:_0x3055ba,folderPath:_0x41b40e,sourcePath:_0x3e8eee}of _0x1d1766){const _0x3b15a2=resolveTDFolderPath(_0x41b40e,_0x170067,_0x50bfe2),_0x2a0ccc=_0x3b15a2+':'+_0x3055ba['name'],_0x7b1fee=_0x591021['journeyBundlesByFolderAndName'][_0x290454(0x12f)](_0x2a0ccc);let _0x3af42e,_0xa25960;if(_0x7b1fee&&_0x7b1fee[_0x290454(0x16c)]>0x0){const _0x86d9c=buildLocalExpandedRuleMappings(_0x3055ba),{createYamlContext:_0x4b14b4,prefetchJourneySegments:_0x3d3909}=createPushYamlContextForBundle(_0x591021[_0x290454(0x129)],_0x591021['parentId'],_0x591021['existingSegments'],_0x86d9c,_0x591021['idToEmailMap'],_0x591021[_0x290454(0xe5)],_0x591021[_0x290454(0xd7)],_0x591021['journeyById']);await _0x3d3909(_0x7b1fee[_0x290454(0x1b1)](_0x11f0fb=>_0x11f0fb['id']));const _0x42dda5=await _0x591021['deps'][_0x290454(0x15d)]['getLatestJourneyId'](_0x7b1fee[0x0][_0x290454(0x1bc)]),_0x4aba50=hasMultipleVersions(_0x3055ba),_0x5a8b4d=async _0x5ebdd8=>{const _0x50462d=_0x290454,_0x1323c8=_0x591021[_0x50462d(0x188)]?.['get'](_0x5ebdd8);if(_0x1323c8)return _0x1323c8;return _0x591021[_0x50462d(0xbd)]({'journeyId':_0x5ebdd8,'journeyName':_0x3055ba[_0x50462d(0x1b8)],'isMultiVersion':_0x7b1fee[_0x50462d(0x16c)]>0x1});};if(_0x4aba50&&_0x7b1fee[_0x290454(0x16c)]>0x1){const _0x10bb5e=[];for(const _0x2b0d36 of _0x7b1fee){const _0x5bbe34=_0x2b0d36[_0x290454(0x13e)]||0x1;_0x591021['progress']?.[_0x290454(0x176)](_0x290454(0x179)+_0x3055ba[_0x290454(0x1b8)]+'\x20v'+_0x5bbe34);const _0x4fc820=await _0x5a8b4d(_0x2b0d36['id']),_0x3a4fcc=_0x4b14b4(_0x2b0d36['id']),_0x4776ca=await journeyResponseToDef(_0x4fc820,_0x3a4fcc);_0x10bb5e[_0x290454(0x175)]({'item':_0x2b0d36,'yaml':_0x4776ca});}const _0x42433=buildLocalRuleToNameMappingFromJourney(_0x3055ba);_0xa25960=buildMergedJourneyDef(_0x10bb5e,_0x42433,_0x42dda5);const _0x20baab=Math[_0x290454(0x185)](..._0x10bb5e[_0x290454(0x1b1)](_0x51c901=>_0x51c901['item'][_0x290454(0x13e)]||0x0)),_0x2256fa=_0x7b1fee[_0x290454(0x19e)](_0x744971=>(_0x744971[_0x290454(0x13e)]||0x0)===_0x20baab);_0x2256fa&&(_0x591021['progress']?.[_0x290454(0x176)](_0x290454(0x179)+_0x3055ba[_0x290454(0x1b8)]+'\x20v'+_0x20baab),_0x3af42e=await _0x5a8b4d(_0x2256fa['id']));}else{const _0xaea7df=_0x7b1fee[_0x7b1fee['length']-0x1];_0x591021[_0x290454(0xe3)]?.[_0x290454(0x176)](_0x290454(0x179)+_0x3055ba['name']),_0x3af42e=await _0x5a8b4d(_0xaea7df['id']);const _0x2d4f02=_0x4b14b4(_0xaea7df['id']),_0x12d815=await journeyResponseToDef(_0x3af42e,_0x2d4f02),_0x5a8b9b=buildLocalRuleToNameMappingFromJourney(_0x3055ba);_0xa25960=buildMergedJourneyDef([{'item':_0xaea7df,'yaml':_0x12d815}],_0x5a8b9b,_0x42dda5);}}addFoldersToCreate(_0x3b15a2,_0x591021[_0x290454(0xbf)],_0x472c6b);const _0x118217=calculateJourneyDiff(_0x3055ba,_0xa25960);_0x25878d[_0x290454(0x175)]({'relativePath':_0x3055ba['name'],'absolutePath':_0x3e8eee,'yamlConfig':_0x3055ba,'folderPath':_0x3b15a2,'existingJourney':_0x3af42e,'isNew':_0x118217[_0x290454(0xd8)],'hasChanges':_0x118217[_0x290454(0x10f)],'diff':_0x118217[_0x290454(0xc0)]});}return{'journeyFiles':_0x25878d,'foldersToCreate':_0x472c6b};}function a152_0x18a7(_0x222b6a,_0x43679f){_0x222b6a=_0x222b6a-0xb8;const _0x2189cf=a152_0x2189();let _0x18a7a9=_0x2189cf[_0x222b6a];return _0x18a7a9;}export function calculateActivationActions(_0x1ebdcf,_0x769ca4,_0x544de1,_0x2977b7){const _0x1a53e9=a152_0x451377,_0x4302d8=[],_0x111553=new Map();for(const _0x1394a4 of _0x769ca4){_0x111553[_0x1a53e9(0x145)](_0x1394a4[_0x1a53e9(0x1b8)],_0x1394a4);}const _0xd3020d=new Map();for(const _0x43b2e1 of _0x1ebdcf){_0xd3020d[_0x1a53e9(0x145)](_0x43b2e1['name'],_0x43b2e1);}for(const _0x38845b of _0x1ebdcf){const _0x24ec2c=_0x111553['get'](_0x38845b[_0x1a53e9(0x1b8)]);if(!_0x24ec2c)_0x4302d8[_0x1a53e9(0x175)]({'type':'create','name':_0x38845b['name'],'yamlActivation':_0x38845b});else{const _0x340a95=activationResponseToDef(_0x24ec2c,_0x544de1,_0x2977b7),_0x48b6a4=a152_0x4a5dd5[_0x1a53e9(0x147)](_0x340a95),_0x7686ec=a152_0x4a5dd5[_0x1a53e9(0x147)](_0x38845b);_0x48b6a4!==_0x7686ec&&_0x4302d8[_0x1a53e9(0x175)]({'type':_0x1a53e9(0x176),'name':_0x38845b[_0x1a53e9(0x1b8)],'yamlActivation':_0x38845b,'existingActivation':_0x24ec2c});}}for(const _0x4df230 of _0x769ca4){!_0xd3020d[_0x1a53e9(0x1aa)](_0x4df230['name'])&&_0x4302d8[_0x1a53e9(0x175)]({'type':_0x1a53e9(0xf7),'name':_0x4df230['name'],'existingActivation':_0x4df230});}return _0x4302d8;}function calculateYamlDiff(_0x29c014,_0x53ce09){if(_0x53ce09){const _0x2c5e13=generateDiff(_0x53ce09,_0x29c014),_0x529642=hasChanges(_0x2c5e13);return{'isNew':![],'hasChanges':_0x529642,'diff':_0x529642?formatDiffWithColors(_0x2c5e13):undefined};}const _0xffc45=generateDiff('',_0x29c014);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xffc45)};}export function calculateSegmentDiff(_0x404155,_0x5617cd,_0x357d04,_0x4cd10e,_0x100694){const _0xa8a061=segmentToYamlString(_0x404155),_0x4ae82f=_0x5617cd?segmentToYamlString(segmentWithActivationsToYaml(_0x5617cd,_0x357d04,undefined,_0x4cd10e,_0x100694)):undefined;return calculateYamlDiff(_0xa8a061,_0x4ae82f);}export function calculateJourneyDiff(_0x182fb7,_0x340a24){const _0x4ca93e=normalizeJourneyDef(_0x182fb7,_0x182fb7),_0x1e2e2b=a152_0x32ba86(_0x4ca93e),_0x23d3e4=_0x340a24?a152_0x32ba86(normalizeJourneyDef(_0x340a24,_0x182fb7)):undefined;return calculateYamlDiff(_0x1e2e2b,_0x23d3e4);}export function findSegmentsToDelete(_0x45a409,_0x29eb2d,_0x59e44d,_0x30009f,_0x4cf1c2){const _0x2d5ea8=a152_0x451377,_0x456c2f=new Set();for(const {yamlConfig:_0x3347d2,folderPath:_0x3a9c5e}of _0x29eb2d){_0x456c2f[_0x2d5ea8(0xc9)](_0x3a9c5e+':'+_0x3347d2[_0x2d5ea8(0x1b8)]);}return _0x45a409[_0x2d5ea8(0x198)](_0x2dcd64=>{const _0x39c651=_0x2d5ea8,_0x1fbf72=_0x2dcd64[_0x39c651(0x12c)]?_0x59e44d[_0x39c651(0x12f)](_0x2dcd64[_0x39c651(0x12c)][_0x39c651(0x18a)]())||'':'',_0x147f7b=_0x1fbf72+':'+_0x2dcd64['name'];if(_0x456c2f[_0x39c651(0x1aa)](_0x147f7b))return![];if(_0x4cf1c2)return _0x1fbf72===_0x30009f||_0x1fbf72[_0x39c651(0x168)](_0x30009f+'/');return!![];});}export function findJourneysToDelete(_0x23ec0b,_0x575c14,_0x107f82,_0x575008,_0x43fc34){const _0x2e275f=a152_0x451377,_0x20b308=new Set();for(const {yamlConfig:_0x49b328,folderPath:_0x193328}of _0x575c14){_0x20b308[_0x2e275f(0xc9)](_0x193328+':'+_0x49b328[_0x2e275f(0x1b8)]);}return _0x23ec0b[_0x2e275f(0x198)](_0x29f883=>{const _0xb4e416=_0x2e275f,_0x3d7f0b=_0x29f883[_0xb4e416(0x166)]?_0x107f82[_0xb4e416(0x12f)](_0x29f883[_0xb4e416(0x166)])||'':'',_0x2f40d0=_0x3d7f0b+':'+_0x29f883[_0xb4e416(0x133)];if(_0x20b308['has'](_0x2f40d0))return![];if(_0x43fc34)return _0x3d7f0b===_0x575008||_0x3d7f0b[_0xb4e416(0x168)](_0x575008+'/');return!![];});}export function buildSegmentLookupMap(_0x22811b,_0x2f3823){const _0x2b6eea=a152_0x451377,_0x7bf1f4=new Map();for(const _0x3f26dd of _0x22811b){const _0x2e8ce5=_0x3f26dd[_0x2b6eea(0x12c)]?_0x2f3823[_0x2b6eea(0x12f)](_0x3f26dd[_0x2b6eea(0x12c)]['toString']())||'':'',_0x1d31b4=_0x2e8ce5+':'+_0x3f26dd[_0x2b6eea(0x1b8)];_0x7bf1f4[_0x2b6eea(0x145)](_0x1d31b4,_0x3f26dd);}return _0x7bf1f4;}export function buildSegmentNameToIdMap(_0x1e14e3){const _0x1046a6=a152_0x451377,_0xc2d140=new Map();for(const _0x3661e5 of _0x1e14e3){_0xc2d140['set'](_0x3661e5[_0x1046a6(0x1b8)],_0x3661e5['id']);}return _0xc2d140;}export function buildJourneyBundleLookupMap(_0x31ef1b,_0x43c7f7){const _0x57b4bf=a152_0x451377,_0x490862=new Map();for(const _0x474d42 of _0x31ef1b){const _0xcbf6ca=_0x474d42['folderId']?_0x43c7f7['get'](_0x474d42[_0x57b4bf(0x166)])||'':'',_0x745a8e=_0xcbf6ca+':'+_0x474d42[_0x57b4bf(0x133)];!_0x490862[_0x57b4bf(0x1aa)](_0x745a8e)&&_0x490862['set'](_0x745a8e,[]),_0x490862[_0x57b4bf(0x12f)](_0x745a8e)[_0x57b4bf(0x175)](_0x474d42);}for(const _0xcac887 of _0x490862[_0x57b4bf(0xc2)]()){_0xcac887[_0x57b4bf(0xcf)]((_0x20424f,_0x39cfcb)=>(_0x20424f['versionNumber']||0x0)-(_0x39cfcb['versionNumber']||0x0));}return _0x490862;}export function collectFoldersToCreate(_0x262918,_0x502c23){const _0x5a0634=a152_0x451377,_0x119b4b=new Set();for(const _0xa900e4 of _0x262918){if(!_0xa900e4)continue;if(_0x502c23[_0x5a0634(0x1aa)](_0xa900e4))continue;const _0x23103f=_0xa900e4[_0x5a0634(0x136)]('/');let _0x30a2fd='';for(const _0x2c31 of _0x23103f){_0x30a2fd=_0x30a2fd?_0x30a2fd+'/'+_0x2c31:_0x2c31,!_0x502c23['has'](_0x30a2fd)&&_0x119b4b[_0x5a0634(0xc9)](_0x30a2fd);}}return _0x119b4b;}export function parseAndClassifyYamlFiles(_0x4c5694,_0x6c186,_0x55aaa4){const _0x11d8ef=a152_0x451377,_0x214905=[],_0x1d2d29=[];for(const _0x36e488 of _0x4c5694){const _0x944fdc=a152_0x219797['relative'](_0x6c186,a152_0x219797[_0x11d8ef(0x107)](_0x36e488)),_0x8b53b2=_0x944fdc==='.'?'':_0x944fdc,_0x40c1f2=readFileSync(_0x36e488,'utf-8'),_0x47bbd4=a152_0x4a5dd5[_0x11d8ef(0x18f)](_0x40c1f2);if(isJourneyDef(_0x47bbd4)){const _0xeb359=a152_0x3920c3(_0x40c1f2);_0x1d2d29[_0x11d8ef(0x175)]({'yamlConfig':_0xeb359,'folderPath':_0x8b53b2,'sourcePath':_0x36e488});}else{if(!_0x55aaa4?.[_0x11d8ef(0x141)]){const _0x138af3=parseSegmentYamlFile(_0x40c1f2),_0x4ac252=normalizeChildSegmentYaml(_0x138af3);_0x214905[_0x11d8ef(0x175)]({'yamlConfig':_0x4ac252,'folderPath':_0x8b53b2,'sourcePath':_0x36e488});}}}return{'segments':_0x214905,'journeys':_0x1d2d29};}export function validateParsedFiles(_0x21c3a0,_0x298a28){const _0x24a5a0=a152_0x451377,_0x2658b3=[];for(const {yamlConfig:_0x48bf8b,sourcePath:_0x1247f9}of _0x21c3a0[_0x24a5a0(0x172)]){const _0x4ed216=readFileSync(_0x1247f9,_0x24a5a0(0x18d)),_0x58fec7=a152_0x4a5dd5[_0x24a5a0(0x1a1)](_0x4ed216),_0x4abf14=validateSegmentDef(_0x48bf8b,{'source':_0x4ed216,'document':_0x58fec7},{'skipSchema':!![]});if(!_0x4abf14[_0x24a5a0(0x174)]){const _0x1ae8d7=a152_0x219797[_0x24a5a0(0x142)](_0x298a28,_0x1247f9);_0x2658b3[_0x24a5a0(0x175)]({'filePath':_0x1ae8d7,'source':_0x4ed216,'result':_0x4abf14,'isJourney':![]});}}for(const {yamlConfig:_0x53fb1b,sourcePath:_0x205957}of _0x21c3a0[_0x24a5a0(0x17f)]){const _0x386987=readFileSync(_0x205957,_0x24a5a0(0x18d)),_0xea18a5=a152_0x4a5dd5['parseDocument'](_0x386987),_0x4b483f=validateJourneyDef(_0x53fb1b,{'source':_0x386987,'document':_0xea18a5},{'skipSchema':!![]});if(!_0x4b483f[_0x24a5a0(0x174)]){const _0x36c150=a152_0x219797[_0x24a5a0(0x142)](_0x298a28,_0x205957);_0x2658b3[_0x24a5a0(0x175)]({'filePath':_0x36c150,'source':_0x386987,'result':_0x4b483f,'isJourney':!![]});}}return _0x2658b3;}export function formatValidationErrors(_0x186006){const _0x409c78=a152_0x451377,_0x14985b=[];for(const {filePath:_0x48f03f,source:_0xf3a1b5,result:_0x436bc1,isJourney:_0x48bfdf}of _0x186006){const _0x131f66=_0x48bfdf?'journey':'segment';_0x14985b['push']('\x0a'+_0x48f03f+'\x20('+_0x131f66+_0x409c78(0xc1)+_0x436bc1[_0x409c78(0x140)][_0x409c78(0x16c)]+'\x20error(s)'),_0x14985b['push'](formatValidationResult(_0x436bc1,_0xf3a1b5,_0x48f03f));}return _0x14985b[_0x409c78(0xcb)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x16976a){const _0x47e50c=a152_0x451377,_0x17de09=new Set(),_0x447097=new Map(),_0x4016ed=collectSegmentUsageCounts(_0x16976a);if(_0x16976a[_0x47e50c(0x172)])for(const [_0x407aa9,_0x29a0f1]of Object[_0x47e50c(0xd2)](_0x16976a[_0x47e50c(0x172)])){_0x17de09[_0x47e50c(0xc9)](_0x407aa9);if(_0x29a0f1[_0x47e50c(0x19b)]){const _0x766a9d=yamlRuleToApi(_0x29a0f1[_0x47e50c(0x19b)]),_0x587eb5=apiRuleToYaml(_0x766a9d);_0x447097['set'](_0x407aa9,_0x587eb5);}}const _0x1e0e6d=new Map();let _0x4a8b9f=0x0;for(const [_0x6c9d00,_0x5eae8e]of _0x447097){const _0x2f90b4=serializeExpandedRule(_0x5eae8e,_0x447097),_0x3fd303=_0x1e0e6d[_0x47e50c(0x12f)](_0x2f90b4)||[];_0x3fd303[_0x47e50c(0x175)]({'name':_0x6c9d00,'index':_0x4a8b9f}),_0x1e0e6d['set'](_0x2f90b4,_0x3fd303),_0x4a8b9f++;}const _0x4314e6=new Map();for(const [_0x5479a3,_0xc46974]of _0x1e0e6d){const _0x246b38=_0xc46974[_0x47e50c(0x15e)]()[_0x47e50c(0xcf)]((_0x13103,_0x58470c)=>{const _0x25f615=_0x47e50c,_0x98afce=_0x4016ed['get'](_0x13103[_0x25f615(0x1b8)])||0x0,_0x45036a=_0x4016ed['get'](_0x58470c[_0x25f615(0x1b8)])||0x0;if(_0x98afce!==_0x45036a)return _0x45036a-_0x98afce;return _0x13103[_0x25f615(0x171)]-_0x58470c['index'];})[_0x47e50c(0x1b1)](_0x17f8bd=>_0x17f8bd[_0x47e50c(0x1b8)]),_0x1833af=[];for(const _0x245876 of _0x246b38){const _0x451931=_0x4016ed[_0x47e50c(0x12f)](_0x245876)||0x0,_0x27b9ab=Math[_0x47e50c(0x185)](_0x451931,0x1);for(let _0x14d259=0x0;_0x14d259<_0x27b9ab;_0x14d259++){_0x1833af[_0x47e50c(0x175)](_0x245876);}}_0x4314e6[_0x47e50c(0x145)](_0x5479a3,_0x1833af);}return{'existingLocalSegmentNames':_0x17de09,'localSegmentRules':_0x447097,'localExpandedRuleToNames':_0x4314e6};}export function createSegmentIdResolver(_0x423c1a,_0x2c53ab){return async _0x3585bc=>{const _0x3eb6f1=a152_0x18a7,_0x4ce11f=_0x423c1a[_0x3eb6f1(0x12f)](_0x3585bc);if(!_0x4ce11f)throw new SDKError(ErrorCode[_0x3eb6f1(0x156)],_0x3eb6f1(0x184)+_0x3585bc+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x2c53ab+'\x27)');return _0x4ce11f;};}export function extractRootFolderId(_0x3432c3){const _0xe77d12=a152_0x451377;return _0x3432c3[_0xe77d12(0x109)]?.['parentSegmentFolder']?.[_0xe77d12(0x104)]?.['id']||_0x3432c3[_0xe77d12(0x109)]?.[_0xe77d12(0x173)]?.[_0xe77d12(0x104)]?.['id'];}export function buildConnectionMaps(_0x2a8183){const _0x404120=a152_0x451377,_0x88d23e=new Map(),_0x4dd71b=new Map(),_0x41ccd9=new Map();for(const _0x4f49c6 of _0x2a8183){_0x88d23e[_0x404120(0x145)](_0x4f49c6[_0x404120(0x1b8)],parseInt(_0x4f49c6['id'],0xa)),_0x4dd71b[_0x404120(0x145)](_0x4f49c6['id'],_0x4f49c6[_0x404120(0x1b8)]),_0x41ccd9[_0x404120(0x145)](_0x4f49c6['name'],_0x4f49c6['type']);}return{'nameToId':_0x88d23e,'idToName':_0x4dd71b,'nameToType':_0x41ccd9};}export function calculatePushStats(_0x1116b9,_0x490d7b,_0x33b8bb,_0x43d7b8,_0x46ae82,_0x1abdf8,_0xfe097f){const _0x50ce1a=a152_0x451377,_0xd14f68=_0x1116b9[_0x50ce1a(0x198)](_0x12ed44=>_0x12ed44[_0x50ce1a(0xd8)]),_0x1a1fd0=_0x1116b9[_0x50ce1a(0x198)](_0x539ddf=>!_0x539ddf[_0x50ce1a(0xd8)]&&_0x539ddf[_0x50ce1a(0x10f)]),_0x37ce2c=_0x1116b9[_0x50ce1a(0x198)](_0x4d0d82=>!_0x4d0d82[_0x50ce1a(0xd8)]&&!_0x4d0d82[_0x50ce1a(0x10f)]),_0x1516d=_0x1abdf8?_0x43d7b8:[],_0x4cde36=_0x490d7b[_0x50ce1a(0x198)](_0x2d14d6=>_0x2d14d6[_0x50ce1a(0xd8)]),_0x3d2ea6=_0x490d7b['filter'](_0x21eb33=>!_0x21eb33[_0x50ce1a(0xd8)]&&_0x21eb33['hasChanges']),_0x462253=_0x490d7b[_0x50ce1a(0x198)](_0x4dd8aa=>!_0x4dd8aa[_0x50ce1a(0xd8)]&&!_0x4dd8aa[_0x50ce1a(0x10f)]),_0x40187b=_0x1abdf8?_0x46ae82:[],_0x9c877=_0x1116b9[_0x50ce1a(0x169)](_0x1f7f2b=>_0x1f7f2b[_0x50ce1a(0xe1)]),_0x57885a=_0x9c877[_0x50ce1a(0x198)](_0x23c43b=>_0x23c43b['type']===_0x50ce1a(0x11a)),_0x267780=_0x9c877[_0x50ce1a(0x198)](_0x13a84f=>_0x13a84f[_0x50ce1a(0x135)]==='update'),_0xbe38a2=_0x9c877[_0x50ce1a(0x198)](_0x541d8b=>_0x541d8b[_0x50ce1a(0x135)]===_0x50ce1a(0xf7)),_0x23a213=Array[_0x50ce1a(0x110)](_0x33b8bb)['sort'](),_0x5405c4=_0xfe097f?![]:_0xd14f68[_0x50ce1a(0x16c)]>0x0||_0x1a1fd0['length']>0x0||_0x1516d[_0x50ce1a(0x16c)]>0x0,_0x48253a=_0x4cde36[_0x50ce1a(0x16c)]>0x0||_0x3d2ea6[_0x50ce1a(0x16c)]>0x0||_0x40187b['length']>0x0,_0x13f6af=_0xfe097f?![]:_0x9c877['length']>0x0,_0x4981da=_0x23a213[_0x50ce1a(0x16c)]>0x0;return{'segments':{'new':_0xd14f68,'changed':_0x1a1fd0,'unchanged':_0x37ce2c,'toDelete':_0x1516d},'journeys':{'new':_0x4cde36,'changed':_0x3d2ea6,'unchanged':_0x462253,'toDelete':_0x40187b},'activations':{'all':_0x9c877,'toCreate':_0x57885a,'toUpdate':_0x267780,'toDelete':_0xbe38a2},'folders':{'toCreate':_0x23a213},'counts':{'segments':{'new':_0xd14f68[_0x50ce1a(0x16c)],'changed':_0x1a1fd0[_0x50ce1a(0x16c)],'unchanged':_0x37ce2c['length'],'toDelete':_0x1516d[_0x50ce1a(0x16c)]},'journeys':{'new':_0x4cde36['length'],'changed':_0x3d2ea6[_0x50ce1a(0x16c)],'unchanged':_0x462253['length'],'toDelete':_0x40187b['length']},'activations':{'create':_0x57885a[_0x50ce1a(0x16c)],'update':_0x267780[_0x50ce1a(0x16c)],'delete':_0xbe38a2[_0x50ce1a(0x16c)]},'folders':_0x23a213[_0x50ce1a(0x16c)]},'hasChanges':_0x5405c4||_0x48253a||_0x13f6af||_0x4981da};}export async function buildPushExecutionContext(_0x4b3031,_0x2d2322,_0xad3ee3,_0x4765de,_0x2105f8,_0x5da02b){const _0x3edf32=a152_0x451377,_0x11a490=extractRootFolderId(_0xad3ee3),{pathToId:_0x301967,idToPath:_0xe56ecb}=buildFolderMaps(_0x2105f8),_0x37fb26=buildSegmentNameToIdMap(_0x4765de),_0x21983a=new Map(),{batchAsync:_0x26a1a8}=await import(_0x3edf32(0x131)),[_0x5121fe,_0x5873da]=await Promise['all']([_0x4b3031[_0x3edf32(0x161)][_0x3edf32(0xea)](),_0x4b3031['connection'][_0x3edf32(0x160)](),((async()=>{const _0x4028ee=_0x3edf32;!_0x5da02b&&_0x4765de[_0x4028ee(0x16c)]>0x0&&await _0x26a1a8(_0x4765de,async _0x4baab6=>{const _0x33e4b3=_0x4028ee,_0xcadb6f=await _0x4b3031[_0x33e4b3(0x192)]['listActivations'](_0x2d2322,_0x4baab6['id']);_0x21983a[_0x33e4b3(0x145)](_0x4baab6['id'],_0xcadb6f);});})())]),{emailToId:_0x387f2d,idToEmail:_0x4af57c}=_0x5121fe,_0x1c5e5d=buildConnectionMaps(_0x5873da);return{'rootFolderId':_0x11a490,'folderPathToId':_0x301967,'folderIdToPath':_0xe56ecb,'segmentNameToId':_0x37fb26,'activationsBySegmentId':_0x21983a,'emailToIdMap':_0x387f2d,'idToEmailMap':_0x4af57c,'connectionNameToIdMap':_0x1c5e5d[_0x3edf32(0x115)],'connectionIdToNameMap':_0x1c5e5d[_0x3edf32(0xc7)],'connectionNameToTypeMap':_0x1c5e5d[_0x3edf32(0x122)]};}export function createPushYamlContextForBundle(_0x2aa7ef,_0x1111e6,_0x3751e5,_0x4cc1ee,_0x25ff4d,_0x3a8b54,_0x9bb907,_0x3f9e22){const {existingLocalSegmentNames:_0x348cf8,localExpandedRuleToNames:_0x4cb442}=_0x4cc1ee,_0x44c344=new Set(),_0x432d79=new Map(),_0x178ab6=new Map(),_0x47d7ce=new Map(),_0x37684c=createJumpTargetCache(),_0x4c421f=new Map(),_0x4a6230=new Map(),_0x4cbda0=new Set();let _0x54ef60;const _0x221fbb=_0x25df16=>{const _0x13a04d={'resolveSegment':async _0x2e8b80=>{const _0x11a51b=a152_0x18a7,_0xcda15f=_0x47d7ce[_0x11a51b(0x12f)](_0x2e8b80);if(_0xcda15f!==undefined)return{'name':_0xcda15f,'isJourneyLocal':!![]};try{const _0x3b9992=await fetchSegment(_0x2aa7ef,_0x1111e6,_0x2e8b80,_0x3751e5);if(!_0x3b9992)throw new Error(_0x11a51b(0x11b));const _0x2903a6=generateJourneyLocalName(_0x3b9992[_0x11a51b(0x1b8)]),_0x18483c=_0x3b9992[_0x11a51b(0xd0)]===SEGMENT_KIND_JOURNEY&&_0x2903a6!==undefined;let _0x3ef84f=_0x3b9992[_0x11a51b(0x1b8)],_0x446665;if(_0x18483c&&_0x3b9992[_0x11a51b(0x19b)]){const _0x216177=apiRuleToYaml(_0x3b9992[_0x11a51b(0x19b)]);_0x4a6230[_0x11a51b(0x145)](_0x2e8b80,_0x216177);const _0x144aa1=async _0x1a2088=>{const _0x16a7cc=_0x11a51b,_0x39431f=collectSegmentRefsFromRule(_0x1a2088);for(const _0x282eb4 of _0x39431f){if(!_0x4a6230[_0x16a7cc(0x1aa)](_0x282eb4))try{const _0x2910c=await fetchSegment(_0x2aa7ef,_0x1111e6,_0x282eb4,_0x3751e5);if(_0x2910c?.[_0x16a7cc(0x19b)]){const _0x37c337=apiRuleToYaml(_0x2910c['rule']);_0x4a6230[_0x16a7cc(0x145)](_0x282eb4,_0x37c337),await _0x144aa1(_0x37c337);}}catch(_0x4cea9b){logger['debug'](_0x16a7cc(0x103)+_0x282eb4+':\x20'+_0x4cea9b);}}};await _0x144aa1(_0x216177);const _0x24ef6b=serializeExpandedRule(_0x216177,_0x4a6230),_0xd3d01=_0x4cb442[_0x11a51b(0x12f)](_0x24ef6b);if(_0xd3d01&&_0xd3d01['length']>0x0){const _0x70adb0=_0x432d79[_0x11a51b(0x12f)](_0x24ef6b)||0x0,_0x65c6c1=_0xd3d01[_0x70adb0]||_0xd3d01[_0xd3d01['length']-0x1];_0x432d79['set'](_0x24ef6b,_0x70adb0+0x1),_0x3ef84f=_0x65c6c1,_0x44c344[_0x11a51b(0xc9)](_0x3ef84f),_0x47d7ce[_0x11a51b(0x145)](_0x2e8b80,_0x3ef84f);const _0xd86813=await resolveRuleSegmentRefs(_0x216177,async _0x587b5c=>{const _0x11bf10=_0x11a51b,_0x5a48e3=_0x47d7ce[_0x11bf10(0x12f)](_0x587b5c);if(_0x5a48e3)return _0x5a48e3;const _0x498da6=await _0x54ef60[_0x11bf10(0x10b)](_0x587b5c);return _0x498da6['name'];});_0x446665={'description':_0x3b9992[_0x11a51b(0x1bd)],'rule':_0xd86813};}else{const _0x3015cf=_0x4c421f[_0x11a51b(0x12f)](_0x24ef6b);if(_0x3015cf)_0x3ef84f=_0x3015cf,_0x47d7ce['set'](_0x2e8b80,_0x3ef84f);else{if(_0x2903a6){let _0x266cf8=_0x2903a6,_0x19b405=0x2;while(_0x44c344['has'](_0x266cf8)||_0x348cf8[_0x11a51b(0x1aa)](_0x266cf8)){_0x266cf8=_0x2903a6+'_'+_0x19b405,_0x19b405++;}_0x44c344[_0x11a51b(0xc9)](_0x266cf8),_0x3ef84f=_0x266cf8;}_0x47d7ce['set'](_0x2e8b80,_0x3ef84f),_0x4c421f[_0x11a51b(0x145)](_0x24ef6b,_0x3ef84f);const _0x732115=await resolveRuleSegmentRefs(_0x216177,async _0x5db139=>{const _0x4d86a6=_0x11a51b,_0xa75b4c=_0x47d7ce[_0x4d86a6(0x12f)](_0x5db139);if(_0xa75b4c)return _0xa75b4c;const _0x2e66c5=await _0x54ef60[_0x4d86a6(0x10b)](_0x5db139);return _0x2e66c5[_0x4d86a6(0x1b8)];});_0x446665={'description':_0x3b9992[_0x11a51b(0x1bd)],'rule':_0x732115};}}}return{'name':_0x3ef84f,'isJourneyLocal':_0x18483c,'definition':_0x446665};}catch(_0x38c60e){return logger[_0x11a51b(0x17e)](_0x11a51b(0x117)+_0x2e8b80+':\x20'+_0x38c60e),{'name':_0x2e8b80,'isJourneyLocal':![]};}},'resolveActivation':async _0x569241=>{const _0xd56154=a152_0x18a7,_0x10633a=_0x178ab6[_0xd56154(0x12f)](_0x569241);if(_0x10633a!==undefined)return{'name':_0x10633a,'isJourneyLocal':!![]};try{let _0x24d222=_0x9bb907?.[_0xd56154(0x12f)](_0x569241);!_0x24d222&&(_0x24d222=await _0x2aa7ef[_0xd56154(0x15d)][_0xd56154(0xf2)](_0x25df16,_0x569241));const _0x1126f6=_0x24d222[_0xd56154(0x16e)][_0xd56154(0xee)][_0xd56154(0x1b8)]||_0x569241,_0x2895bb=sanitizeYamlKey(_0x1126f6)||_0xd56154(0x128)+_0x569241,_0x1616cf=_0x2895bb;_0x178ab6[_0xd56154(0x145)](_0x569241,_0x1616cf);const _0x480626=journeyActivationStepToYaml(_0x24d222,_0x25ff4d,_0x3a8b54);return{'name':_0x1616cf,'isJourneyLocal':!![],'definition':_0x480626};}catch(_0x103a77){return logger[_0xd56154(0x17e)](_0xd56154(0x152)+_0x569241+':\x20'+_0x103a77),{'name':_0x569241,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5159bf,_0x4a9ac6)=>resolveJumpTarget(_0x5159bf,_0x4a9ac6,_0x37684c,async _0x2f8e1c=>{const _0x76c58d=a152_0x18a7,_0x5cafae=_0x3f9e22?.[_0x76c58d(0x12f)](_0x2f8e1c);if(_0x5cafae)return _0x5cafae;return _0x2aa7ef[_0x76c58d(0x15d)][_0x76c58d(0x1a2)](_0x2f8e1c);})};return _0x54ef60=_0x13a04d,_0x13a04d;},_0x3cb698=async _0x1e8b90=>{const _0x3a7288=a152_0x18a7,{collectSegmentIdsFromJourneyApi:_0x56bb6f}=await import(_0x3a7288(0xf0)),{batchAsync:_0x19d225}=await import(_0x3a7288(0x131)),_0x485127=new Set();for(const _0x32d704 of _0x1e8b90){let _0x2fd1a8=_0x3f9e22?.[_0x3a7288(0x12f)](_0x32d704);!_0x2fd1a8&&(_0x2fd1a8=await _0x2aa7ef['journey'][_0x3a7288(0x1a2)](_0x32d704));const _0x103bc4=_0x56bb6f(_0x2fd1a8);for(const _0xc79f82 of _0x103bc4){_0x485127[_0x3a7288(0xc9)](_0xc79f82);}}let _0x137fff=Array[_0x3a7288(0x110)](_0x485127);while(_0x137fff[_0x3a7288(0x16c)]>0x0){const _0x1a0d4b=_0x137fff['filter'](_0x582cc6=>!_0x4cbda0[_0x3a7288(0x1aa)](_0x582cc6));if(_0x1a0d4b[_0x3a7288(0x16c)]===0x0)break;const _0x471854=await _0x19d225(_0x1a0d4b,async _0x5802a7=>{const _0x4cb048=_0x3a7288;_0x4cbda0[_0x4cb048(0xc9)](_0x5802a7);const _0x4d421f=await fetchSegment(_0x2aa7ef,_0x1111e6,_0x5802a7,_0x3751e5);if(!_0x4d421f)return null;return{'segmentId':_0x5802a7,'segment':_0x4d421f};},0xa),_0x43cc41=new Set();for(const _0xb8a994 of _0x471854){if(!_0xb8a994?.[_0x3a7288(0x192)]?.[_0x3a7288(0x19b)])continue;const _0x15493e=apiRuleToYaml(_0xb8a994[_0x3a7288(0x192)]['rule']);_0x4a6230[_0x3a7288(0x145)](_0xb8a994['segmentId'],_0x15493e);const _0x3ef1ba=collectSegmentRefsFromRule(_0x15493e);for(const _0x336886 of _0x3ef1ba){!_0x4cbda0[_0x3a7288(0x1aa)](_0x336886)&&_0x43cc41[_0x3a7288(0xc9)](_0x336886);}}_0x137fff=Array[_0x3a7288(0x110)](_0x43cc41);}};return{'createYamlContext':_0x221fbb,'prefetchJourneySegments':_0x3cb698};}export async function executePushSegments(_0x5da40c,_0x1eb7e7,_0x33c350,_0x57346a,_0x1d12eb){const _0x154c2c=a152_0x451377,{segmentDefToCreateRequest:_0x5ea9f6,segmentDefToUpdateRequest:_0x5eff48}=await import(_0x154c2c(0x181)),_0x4fd61a=_0x33c350[_0x154c2c(0xbf)],_0x4f2fb2=0x5,_0x295c6f=async _0x401656=>{const _0x1f85d0=_0x154c2c,_0x5b522a=_0x401656[_0x1f85d0(0x18e)]?_0x4fd61a[_0x1f85d0(0x12f)](_0x401656[_0x1f85d0(0x18e)]):undefined;let _0xb6384c;const _0x36e9d7={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x373d9a=_0x401656[_0x1f85d0(0x14f)];if(_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x19b)]){const _0x532df7=createSegmentIdResolver(_0x33c350[_0x1f85d0(0x180)],_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)]),_0x5d7867=await resolveRuleSegmentIds(_0x401656[_0x1f85d0(0x14f)]['rule'],_0x532df7);_0x373d9a={..._0x401656['yamlConfig'],'rule':_0x5d7867};}try{if(_0x401656[_0x1f85d0(0xd8)]){_0x1d12eb['onProgress']?.({'type':_0x1f85d0(0x10e),'name':_0x401656[_0x1f85d0(0x14f)]['name']});const _0x50da3b=_0x5ea9f6(_0x373d9a,_0x5b522a),_0x5a4955=await _0x1d12eb[_0x1f85d0(0x11e)](_0x1f85d0(0x12b)+_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)]+_0x1f85d0(0xe6),()=>_0x5da40c['segment'][_0x1f85d0(0x17c)](_0x57346a[_0x1f85d0(0xf5)],_0x50da3b));_0xb6384c=_0x5a4955[_0x1f85d0(0x104)]['id'],_0x33c350[_0x1f85d0(0x180)][_0x1f85d0(0x145)](_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)],_0xb6384c),_0x36e9d7['createdSegmentId']={'name':_0x401656['yamlConfig']['name'],'id':_0xb6384c},_0x1d12eb[_0x1f85d0(0x16d)]?.({'type':_0x1f85d0(0x15f),'name':_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)],'segmentId':_0xb6384c}),_0x1d12eb[_0x1f85d0(0x124)]?.('Created\x20segment\x20\x27'+_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)]+'\x27'),_0x36e9d7['created']=0x1;}else{if(_0x401656[_0x1f85d0(0x10f)]){_0x1d12eb[_0x1f85d0(0x16d)]?.({'type':_0x1f85d0(0x106),'name':_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)]});const _0x5d10fc=_0x5eff48(_0x373d9a);_0x5b522a!==_0x401656[_0x1f85d0(0x189)]?.[_0x1f85d0(0x12c)]&&(_0x5d10fc[_0x1f85d0(0x12c)]=_0x5b522a?parseInt(_0x5b522a,0xa):undefined),await _0x1d12eb[_0x1f85d0(0x11e)](_0x1f85d0(0xc4)+_0x401656[_0x1f85d0(0x14f)]['name']+_0x1f85d0(0xe6),()=>_0x5da40c[_0x1f85d0(0x192)][_0x1f85d0(0xe9)](_0x57346a[_0x1f85d0(0xf5)],_0x401656[_0x1f85d0(0x189)]['id'],_0x5d10fc)),_0xb6384c=_0x401656[_0x1f85d0(0x189)]['id'],_0x1d12eb['onProgress']?.({'type':'segment_updated','name':_0x401656['yamlConfig']['name']}),_0x1d12eb[_0x1f85d0(0x124)]?.(_0x1f85d0(0xdd)+_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)]+'\x27'),_0x36e9d7[_0x1f85d0(0x14c)]=0x1;}else _0xb6384c=_0x401656['existingSegment']['id'];}}catch(_0x107245){const _0x316af6=isHttp400Error(_0x107245),_0x5eafe=_0x316af6?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode[_0x1f85d0(0x17a)],_0x15b246=getErrorMessage(_0x107245);throw new SDKError(_0x5eafe,_0x1f85d0(0xbe)+(_0x401656[_0x1f85d0(0xd8)]?_0x1f85d0(0x11a):_0x1f85d0(0x176))+_0x1f85d0(0x127)+_0x401656['absolutePath']+_0x1f85d0(0xba)+_0x15b246,_0x107245);}try{const _0xb4644f=await syncActivationsForSegment(_0x5da40c,_0x57346a[_0x1f85d0(0xf5)],_0xb6384c,_0x401656[_0x1f85d0(0x14f)][_0x1f85d0(0x1b8)],_0x401656[_0x1f85d0(0xe1)],_0x1d12eb,_0x401656[_0x1f85d0(0x1a6)]);_0x36e9d7[_0x1f85d0(0x10d)]=_0xb4644f;}catch(_0x66e376){if(_0x66e376 instanceof SDKError)throw _0x66e376;throw new SDKError(ErrorCode[_0x1f85d0(0xc8)],_0x1f85d0(0x134)+_0x401656['yamlConfig'][_0x1f85d0(0x1b8)]+_0x1f85d0(0xbc)+_0x401656[_0x1f85d0(0x1a6)]+_0x1f85d0(0xba)+getErrorMessage(_0x66e376),_0x66e376);}return _0x36e9d7;},_0xd0b692=await batchAsync(_0x1eb7e7,_0x295c6f,_0x4f2fb2),_0x3499b4={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x484095 of _0xd0b692){_0x3499b4[_0x154c2c(0x1a0)]+=_0x484095['created'],_0x3499b4[_0x154c2c(0x14c)]+=_0x484095['updated'],_0x484095[_0x154c2c(0x16b)]&&_0x3499b4[_0x154c2c(0x162)][_0x154c2c(0x145)](_0x484095['createdSegmentId']['name'],_0x484095[_0x154c2c(0x16b)]['id']),_0x3499b4[_0x154c2c(0x10d)][_0x154c2c(0x1a0)]+=_0x484095[_0x154c2c(0x10d)][_0x154c2c(0x1a0)],_0x3499b4[_0x154c2c(0x10d)]['updated']+=_0x484095['activations'][_0x154c2c(0x14c)],_0x3499b4[_0x154c2c(0x10d)][_0x154c2c(0x14d)]+=_0x484095[_0x154c2c(0x10d)]['deleted'];}return _0x3499b4;}async function syncActivationsForSegment(_0x581bcd,_0x1dbef7,_0x5a7a67,_0x414027,_0x552561,_0x7ab587,_0x5ea5b8){const _0x214b44=a152_0x451377,_0x13c9c8={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3fa2ca of _0x552561){try{if(_0x3fa2ca[_0x214b44(0x135)]==='create'&&_0x3fa2ca[_0x214b44(0x1a8)])_0x7ab587[_0x214b44(0x16d)]?.({'type':_0x214b44(0x121),'segmentName':_0x414027,'activationName':_0x3fa2ca[_0x214b44(0x1b8)]}),await _0x7ab587[_0x214b44(0x11e)]('Creating\x20activation\x20\x27'+_0x3fa2ca['name']+_0x214b44(0xe6),()=>_0x581bcd[_0x214b44(0x192)][_0x214b44(0x196)](_0x1dbef7,_0x5a7a67,_0x3fa2ca[_0x214b44(0x1a8)])),_0x7ab587[_0x214b44(0x16d)]?.({'type':_0x214b44(0xf9),'segmentName':_0x414027,'activationName':_0x3fa2ca[_0x214b44(0x1b8)]}),_0x7ab587[_0x214b44(0x124)]?.(_0x214b44(0x1ad)+_0x3fa2ca[_0x214b44(0x1b8)]+'\x27'),_0x13c9c8['created']++;else{if(_0x3fa2ca['type']===_0x214b44(0x176)&&_0x3fa2ca[_0x214b44(0x1a8)]&&_0x3fa2ca[_0x214b44(0xdb)])_0x7ab587[_0x214b44(0x16d)]?.({'type':'activation_updating','segmentName':_0x414027,'activationName':_0x3fa2ca['name']}),await _0x7ab587['withProgress'](_0x214b44(0x116)+_0x3fa2ca[_0x214b44(0x1b8)]+_0x214b44(0xe6),()=>_0x581bcd[_0x214b44(0x192)][_0x214b44(0x178)](_0x1dbef7,_0x5a7a67,_0x3fa2ca[_0x214b44(0xdb)]['id'],_0x3fa2ca[_0x214b44(0x1a8)])),_0x7ab587[_0x214b44(0x16d)]?.({'type':_0x214b44(0x1a5),'segmentName':_0x414027,'activationName':_0x3fa2ca['name']}),_0x7ab587['logSuccess']?.(_0x214b44(0x114)+_0x3fa2ca[_0x214b44(0x1b8)]+'\x27'),_0x13c9c8['updated']++;else _0x3fa2ca[_0x214b44(0x135)]===_0x214b44(0xf7)&&_0x3fa2ca[_0x214b44(0xdb)]&&(_0x7ab587['onProgress']?.({'type':_0x214b44(0x158),'segmentName':_0x414027,'activationName':_0x3fa2ca[_0x214b44(0x1b8)]}),await _0x7ab587[_0x214b44(0x11e)]('Deleting\x20activation\x20\x27'+_0x3fa2ca[_0x214b44(0x1b8)]+_0x214b44(0xe6),()=>_0x581bcd[_0x214b44(0x192)][_0x214b44(0x146)](_0x1dbef7,_0x5a7a67,_0x3fa2ca[_0x214b44(0xdb)]['id'])),_0x7ab587[_0x214b44(0x16d)]?.({'type':'activation_deleted','segmentName':_0x414027,'activationName':_0x3fa2ca[_0x214b44(0x1b8)]}),_0x7ab587[_0x214b44(0xdc)]?.(_0x214b44(0x111)+_0x3fa2ca[_0x214b44(0x1b8)]+'\x27'),_0x13c9c8['deleted']++);}}catch(_0x3c6a7d){const _0x5966ba=isHttp400Error(_0x3c6a7d),_0x3da5d3=_0x5966ba?ErrorCode[_0x214b44(0x18c)]:ErrorCode[_0x214b44(0xc8)],_0x45e401=getErrorMessage(_0x3c6a7d);throw new SDKError(_0x3da5d3,_0x214b44(0xbe)+_0x3fa2ca[_0x214b44(0x135)]+_0x214b44(0x13f)+_0x3fa2ca[_0x214b44(0x1b8)]+_0x214b44(0xbc)+_0x5ea5b8+_0x214b44(0xba)+_0x45e401,_0x3c6a7d);}}return _0x13c9c8;}export async function executePushFolders(_0xb9ff12,_0x3c6cd0,_0x1dce38,_0x1cce3e,_0x16eae7){const _0x212698=a152_0x451377,_0xf9270f=new Map(_0x1dce38),_0x18c8be=sortFoldersByDepth(_0x3c6cd0);for(const _0x41ab93 of _0x18c8be){const _0x385479=_0x41ab93[_0x212698(0x136)]('/'),_0x4ea5ef=_0x385479[_0x385479[_0x212698(0x16c)]-0x1],_0x39183c=_0x385479[_0x212698(0x15e)](0x0,-0x1)[_0x212698(0xcb)]('/'),_0x2847cf=_0xf9270f[_0x212698(0x12f)](_0x39183c);_0x16eae7[_0x212698(0x16d)]?.({'type':_0x212698(0x16f),'folder':_0x41ab93});const _0x1c0924={'name':_0x4ea5ef,'parentFolderId':_0x2847cf},_0x1c6e10=await _0x16eae7[_0x212698(0x11e)]('Creating\x20folder\x20\x27'+_0x41ab93+_0x212698(0xe6),()=>_0xb9ff12[_0x212698(0x192)][_0x212698(0x190)](_0x1cce3e['parentId'],_0x1c0924));_0xf9270f[_0x212698(0x145)](_0x41ab93,_0x1c6e10[_0x212698(0x104)]['id']),_0x16eae7['onProgress']?.({'type':'folder_created','folder':_0x41ab93,'folderId':_0x1c6e10[_0x212698(0x104)]['id']}),_0x16eae7[_0x212698(0xdf)]?.('Created\x20folder\x20\x27'+_0x41ab93+'\x27');}return _0xf9270f;}export async function executePushSegmentDeletions(_0x57eb8e,_0x287538,_0x5814cc){const _0x10fd24=a152_0x451377;if(_0x287538[_0x10fd24(0x16c)]===0x0)return 0x0;const {batchAsync:_0x435ccb}=await import(_0x10fd24(0x131)),_0x557e34=0x5,_0x354f56=await _0x435ccb(_0x287538,async _0x61513e=>{const _0x54edfd=_0x10fd24;return _0x5814cc['onProgress']?.({'type':_0x54edfd(0xf6),'name':_0x61513e[_0x54edfd(0x1b8)]}),await _0x57eb8e[_0x54edfd(0x192)]['deleteSegment'](_0x61513e['id']),_0x5814cc[_0x54edfd(0x16d)]?.({'type':_0x54edfd(0x18b),'name':_0x61513e[_0x54edfd(0x1b8)]}),_0x5814cc[_0x54edfd(0xdc)]?.(_0x54edfd(0x153)+_0x61513e['name']+'\x27'),0x1;},_0x557e34);return _0x354f56['reduce']((_0x189f5b,_0x4b1407)=>_0x189f5b+_0x4b1407,0x0);}export async function executePushJourneys(_0x40402e,_0x22adef,_0x2710b0,_0x35794f,_0x23327b){const _0x5d3752=a152_0x451377,{journeyDefToRequest:_0x4c81b2}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x274ea4,yamlRuleToApi:_0x5525d4,validateSegmentRule:_0x121469}=await import(_0x5d3752(0x181)),_0x3a7862={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x1b65fe=new Map(_0x2710b0[_0x5d3752(0x180)]),_0x37facc=0x5;for(let _0x42ebff=0x0;_0x42ebff<_0x22adef[_0x5d3752(0x16c)];_0x42ebff+=_0x37facc){const _0x25ad4d=_0x22adef[_0x5d3752(0x15e)](_0x42ebff,_0x42ebff+_0x37facc),_0x4398c1=await Promise[_0x5d3752(0x11f)](_0x25ad4d[_0x5d3752(0x1b1)](async _0x54efdc=>{const _0x4dff5a=_0x5d3752;if(!_0x54efdc[_0x4dff5a(0xd8)]&&!_0x54efdc[_0x4dff5a(0x10f)])return{'action':_0x4dff5a(0x137),'name':_0x54efdc[_0x4dff5a(0x14f)][_0x4dff5a(0x1b8)],'journeyId':_0x54efdc[_0x4dff5a(0x150)]?.['id']};const _0x288142=_0x54efdc[_0x4dff5a(0x18e)]?_0x2710b0['folderPathToId']['get'](_0x54efdc[_0x4dff5a(0x18e)]):undefined;_0x23327b[_0x4dff5a(0x16d)]?.({'type':_0x54efdc[_0x4dff5a(0xd8)]?_0x4dff5a(0xd3):_0x4dff5a(0x108),'name':_0x54efdc['yamlConfig'][_0x4dff5a(0x1b8)]});try{const _0x2ee1d7=await executeSingleJourneyPush(_0x40402e,_0x54efdc,{..._0x2710b0,'segmentNameToId':_0x1b65fe},{'parentId':_0x35794f['parentId'],'rootFolderId':_0x35794f[_0x4dff5a(0x16a)],'folderId':_0x288142,'verbose':_0x35794f[_0x4dff5a(0xfc)]},_0x23327b,{'journeyDefToRequest':_0x4c81b2,'activationDefToCreateRequest':_0x274ea4,'yamlRuleToApi':_0x5525d4,'validateSegmentRule':_0x121469});for(const [_0x140bbf,_0x15aaa7]of _0x2ee1d7['embeddedSegmentNameToId']){_0x1b65fe[_0x4dff5a(0x145)](_0x140bbf,_0x15aaa7),_0x3a7862[_0x4dff5a(0xb9)][_0x4dff5a(0x145)](_0x140bbf,_0x15aaa7);}if(_0x2ee1d7[_0x4dff5a(0x1b4)]===_0x4dff5a(0x1a0))_0x23327b[_0x4dff5a(0x16d)]?.({'type':_0x4dff5a(0x177),'name':_0x54efdc['yamlConfig'][_0x4dff5a(0x1b8)],'journeyId':_0x2ee1d7[_0x4dff5a(0x143)]}),_0x23327b[_0x4dff5a(0x124)]?.(_0x4dff5a(0xcc)+_0x54efdc['yamlConfig'][_0x4dff5a(0x1b8)]+'\x27'),_0x3a7862['created']++;else _0x2ee1d7['action']===_0x4dff5a(0x14c)&&(_0x23327b[_0x4dff5a(0x16d)]?.({'type':_0x4dff5a(0xf8),'name':_0x54efdc['yamlConfig'][_0x4dff5a(0x1b8)]}),_0x23327b[_0x4dff5a(0x124)]?.(_0x4dff5a(0xde)+_0x54efdc[_0x4dff5a(0x14f)][_0x4dff5a(0x1b8)]+'\x27'),_0x3a7862[_0x4dff5a(0x14c)]++);return{'action':_0x2ee1d7['action'],'name':_0x54efdc[_0x4dff5a(0x14f)][_0x4dff5a(0x1b8)],'journeyId':_0x2ee1d7[_0x4dff5a(0x143)]};}catch(_0x468bda){const _0x91705d=isHttp400Error(_0x468bda),_0xa726e9=_0x91705d?ErrorCode[_0x4dff5a(0x1b7)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x1f259b=getErrorMessage(_0x468bda);throw new SDKError(_0xa726e9,_0x4dff5a(0xbe)+(_0x54efdc[_0x4dff5a(0xd8)]?_0x4dff5a(0x11a):'update')+_0x4dff5a(0x1b2)+_0x54efdc[_0x4dff5a(0x1a6)]+_0x4dff5a(0xba)+_0x1f259b,_0x468bda);}}));_0x3a7862[_0x5d3752(0x159)][_0x5d3752(0x175)](..._0x4398c1);}return _0x3a7862;}async function matchExistingJourneySegments(_0x1964ff,_0x1ecb3c,_0xe4a751,_0x2e84c2,_0x2606bf){const _0x23f4fe=a152_0x451377;if(!_0x1ecb3c[_0x23f4fe(0x150)]||!_0x1ecb3c[_0x23f4fe(0x14f)]['segments'])return;const _0x2fb390=new Map(),_0x126b31=new Set();for(const _0x4d6606 of Object[_0x23f4fe(0xd5)](_0x1ecb3c['yamlConfig']['segments'])){const _0xd626e=generateDeterministicJourneySegmentName(_0x1ecb3c['yamlConfig'][_0x23f4fe(0x1b8)],_0x4d6606);_0x2fb390[_0x23f4fe(0x145)](_0xd626e,_0x4d6606),_0x126b31[_0x23f4fe(0xc9)](_0x4d6606);}const _0x22c5b6=[],_0x55f983=collectSegmentIdsFromJourneyApi(_0x1ecb3c[_0x23f4fe(0x150)]);for(const _0x2cc22c of _0x55f983){const _0x28e3a2=await fetchSegment(_0x1964ff,_0xe4a751,_0x2cc22c,_0x2e84c2);if(!_0x28e3a2?.[_0x23f4fe(0x1b8)])continue;const _0x17436b=_0x2fb390['get'](_0x28e3a2[_0x23f4fe(0x1b8)]);_0x17436b?(_0x2606bf[_0x23f4fe(0x145)](_0x17436b,_0x2cc22c),_0x126b31[_0x23f4fe(0xf7)](_0x17436b)):_0x22c5b6['push']({'id':_0x2cc22c,'seg':_0x28e3a2});}if(_0x126b31[_0x23f4fe(0x170)]>0x0&&_0x22c5b6[_0x23f4fe(0x16c)]>0x0){const {localExpandedRuleToNames:_0x31c0d9}=buildLocalExpandedRuleMappings(_0x1ecb3c[_0x23f4fe(0x14f)]),_0x2cdaf9=new Map();for(const {id:_0x466811,seg:_0x4ab4b0}of _0x22c5b6){if(_0x4ab4b0[_0x23f4fe(0x19b)]){const _0x85ee06=apiRuleToYaml(_0x4ab4b0[_0x23f4fe(0x19b)]);_0x2cdaf9['set'](_0x466811,_0x85ee06);}}for(const {id:_0x5ce056,seg:_0x4f8e42}of _0x22c5b6){if(!_0x4f8e42[_0x23f4fe(0x19b)])continue;const _0x385ede=_0x2cdaf9[_0x23f4fe(0x12f)](_0x5ce056);if(!_0x385ede)continue;const _0x1041dd=serializeExpandedRule(_0x385ede,_0x2cdaf9),_0x487ce0=_0x31c0d9[_0x23f4fe(0x12f)](_0x1041dd);if(_0x487ce0){const _0x4e16eb=_0x487ce0[_0x23f4fe(0x19e)](_0x393eb1=>_0x126b31[_0x23f4fe(0x1aa)](_0x393eb1));_0x4e16eb&&(_0x2606bf[_0x23f4fe(0x145)](_0x4e16eb,_0x5ce056),_0x126b31[_0x23f4fe(0xf7)](_0x4e16eb),logger['debug'](_0x23f4fe(0xe4)+_0x4f8e42['name']+'\x27\x20to\x20local\x20\x27'+_0x4e16eb+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x4398a1,_0xc35544,_0x157dae,_0x195980,_0x13b059,_0x57b5ba){const _0x7caa69=a152_0x451377,{journeyDefToRequest:_0x1115ed,activationDefToCreateRequest:_0x5672eb,yamlRuleToApi:_0x26006a,validateSegmentRule:_0x164266}=_0x57b5ba,_0x36b426=new Map(),_0x325528=new Map();recoverSegmentIdsFromPushRecovery(_0xc35544,_0x36b426,_0x157dae[_0x7caa69(0x180)]);const _0xbc9801=new Map(),_0x57cc24=new Map(),_0x179408=new Map();let _0x3275ea;const _0x2fe011=async()=>{const _0x12061c=_0x7caa69;if(_0x3275ea)return;_0x3275ea=new Map();if(!_0xc35544[_0x12061c(0x150)])return;const _0x20c722=await _0x4398a1[_0x12061c(0x15d)][_0x12061c(0x155)](_0xc35544[_0x12061c(0x150)]['id']);for(const _0x54b5f2 of _0x20c722){const _0x44685d=journeyActivationStepToYaml(_0x54b5f2,_0x157dae[_0x12061c(0x13c)],_0x157dae[_0x12061c(0xe5)]),_0x1e6861=activationSignature(_0x44685d);!_0x3275ea[_0x12061c(0x1aa)](_0x1e6861)&&_0x3275ea['set'](_0x1e6861,_0x54b5f2['id']),_0x44685d[_0x12061c(0x1b8)]&&_0x325528[_0x12061c(0x145)](_0x44685d[_0x12061c(0x1b8)],_0x54b5f2['id']);}};await matchExistingJourneySegments(_0x4398a1,_0xc35544,_0x195980['parentId'],_0x157dae[_0x7caa69(0xc3)],_0x157dae['segmentNameToId']);const _0x2624b0={'resolveSegmentId':async _0xdfa4f3=>{const _0x16aa6d=_0x7caa69,_0x43aa89=_0x157dae[_0x16aa6d(0x180)]['get'](_0xdfa4f3);if(!_0x43aa89)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x16aa6d(0x184)+_0xdfa4f3+_0x16aa6d(0x125)+_0xc35544[_0x16aa6d(0x14f)]['name']+')');return _0x43aa89;},'resolveEmbeddedSegmentId':async(_0x388ac0,_0x4b9d1f)=>{const _0x5a0611=_0x7caa69,_0x5c6e44=_0x157dae[_0x5a0611(0x180)][_0x5a0611(0x12f)](_0x388ac0);if(_0x5c6e44)return _0x5c6e44;const _0xef0953=_0x157dae['existingSegments'][_0x5a0611(0x19e)](_0x4ab999=>_0x4ab999[_0x5a0611(0x1b8)]===_0x388ac0);if(_0xef0953)return _0x157dae['segmentNameToId'][_0x5a0611(0x145)](_0x388ac0,_0xef0953['id']),_0xef0953['id'];if(_0xc35544[_0x5a0611(0xd8)]){const {stageName:_0x5aaa94,criteriaName:_0x3a3b30}=findSegmentCriteriaLocation(_0xc35544[_0x5a0611(0x14f)],_0x388ac0);return _0x164266(_0x388ac0,_0x4b9d1f[_0x5a0611(0x19b)]),_0x57cc24[_0x5a0611(0x145)](_0x388ac0,{'definition':_0x4b9d1f,'stageName':_0x5aaa94,'criteriaName':_0x3a3b30}),createPendingSegmentId(_0x388ac0);}const _0x390d27=_0xc35544[_0x5a0611(0x150)]?.['id'];if(!_0x390d27)throw new SDKError(ErrorCode['INTERNAL'],_0x5a0611(0x1be));const _0x403c94=_0xbc9801[_0x5a0611(0x12f)](_0x388ac0);if(_0x403c94)return _0x403c94;const _0xd2d038=((async()=>{const _0x206a34=_0x5a0611;_0x164266(_0x388ac0,_0x4b9d1f['rule']);const _0xe85876=generateDeterministicJourneySegmentName(_0xc35544['yamlConfig']['name'],_0x388ac0),_0x4d317c=_0x157dae[_0x206a34(0xc3)][_0x206a34(0x19e)](_0x404847=>_0x404847[_0x206a34(0x1b8)]===_0xe85876),_0x3d94b4=createSegmentIdResolver(_0x157dae[_0x206a34(0x180)],_0x388ac0),_0x2d7a35=await resolveRuleSegmentIds(_0x4b9d1f[_0x206a34(0x19b)],_0x3d94b4);let _0x33d69d;return _0x4d317c?(await _0x4398a1[_0x206a34(0x192)][_0x206a34(0xe9)](_0x195980['parentId'],_0x4d317c['id'],{'description':_0x4b9d1f[_0x206a34(0x1bd)]||_0x206a34(0x132)+_0x388ac0,'rule':_0x26006a(_0x2d7a35),'countPopulation':!![]}),_0x33d69d=_0x4d317c['id'],saveSegmentToPushRecovery(_0xc35544[_0x206a34(0x1a6)],_0xc35544[_0x206a34(0x14f)][_0x206a34(0x1b8)],_0x388ac0,{'segmentId':_0x33d69d,'uniqueServerName':_0xe85876,'createdAt':new Date()[_0x206a34(0xfd)]()})):_0x33d69d=await createOrRecoverEmbeddedSegment(_0x4398a1,_0xc35544,{'localName':_0x388ac0,'uniqueSegmentName':_0xe85876,'description':_0x4b9d1f[_0x206a34(0x1bd)]||_0x206a34(0x132)+_0x388ac0,'journeyId':_0x390d27,'resolvedRule':_0x2d7a35,'parentId':_0x195980[_0x206a34(0xf5)],'folderId':_0x195980[_0x206a34(0x16a)]||''},_0x26006a),_0x157dae[_0x206a34(0x180)][_0x206a34(0x145)](_0x388ac0,_0x33d69d),_0x36b426['set'](_0x388ac0,_0x33d69d),_0x33d69d;})());_0xbc9801[_0x5a0611(0x145)](_0x388ac0,_0xd2d038);try{return await _0xd2d038;}finally{_0xbc9801[_0x5a0611(0xf7)](_0x388ac0);}},'resolveActivationId':async _0x2e3d98=>{const _0x3a4cdd=_0x7caa69,_0x376c85=_0x325528[_0x3a4cdd(0x12f)](_0x2e3d98);if(_0x376c85)return _0x376c85;if(_0xc35544['existingJourney']){await _0x2fe011();const _0x184f64=_0x325528['get'](_0x2e3d98);if(_0x184f64)return _0x184f64;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x3a4cdd(0x197)+_0x2e3d98+_0x3a4cdd(0x125)+_0xc35544[_0x3a4cdd(0x14f)][_0x3a4cdd(0x1b8)]+_0x3a4cdd(0xe0)+_0x3a4cdd(0xe8));},'resolveEmbeddedActivationId':async(_0x59189b,_0x112580)=>{const _0x40f024=_0x7caa69,_0x23318c=_0x325528[_0x40f024(0x12f)](_0x59189b);if(_0x23318c)return _0x23318c;if(_0xc35544[_0x40f024(0xd8)])return _0x179408['set'](_0x59189b,_0x112580),createPendingActivationId(_0x59189b);if(_0xc35544[_0x40f024(0x150)]){await _0x2fe011();const _0x172c73=_0x325528['get'](_0x112580[_0x40f024(0x1b8)]);if(_0x172c73)return _0x325528['set'](_0x59189b,_0x172c73),_0x172c73;const _0x43c173=activationSignature(_0x112580),_0x22c757=_0x3275ea?.[_0x40f024(0x12f)](_0x43c173);if(_0x22c757)return _0x325528[_0x40f024(0x145)](_0x59189b,_0x22c757),_0x22c757;const _0x1d4a49=await _0x5672eb(_0x112580,_0x157dae[_0x40f024(0x13d)]),_0x11621f={..._0x1d4a49,..._0x112580['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x112580[_0x40f024(0x1a4)]}},_0x50f003=await _0x4398a1[_0x40f024(0x15d)][_0x40f024(0x196)](_0xc35544[_0x40f024(0x150)]['id'],_0x11621f);return _0x325528['set'](_0x59189b,_0x50f003['id']),_0x50f003['id'];}throw new SDKError(ErrorCode[_0x40f024(0xf1)],_0x40f024(0xe7));},'resolveJourneyId':async _0x5e16b9=>{const _0x10e5ff=_0x7caa69;try{return await _0x4398a1[_0x10e5ff(0x15d)][_0x10e5ff(0x1b5)](_0x195980['parentId'],_0x5e16b9);}catch(_0x356228){throw new SDKError(ErrorCode[_0x10e5ff(0x130)],_0x10e5ff(0x1a7)+_0x5e16b9+_0x10e5ff(0xff)+_0xc35544[_0x10e5ff(0x14f)][_0x10e5ff(0x1b8)]+'\x27)',_0x356228);}},'resolveStageId':async(_0x4b417a,_0x5be60c)=>{const _0x5dba8e=_0x7caa69,_0x241806=await _0x4398a1['journey']['getJourney'](_0x4b417a),_0x1e5ed=_0x241806[_0x5dba8e(0x16e)][_0x5dba8e(0xce)][_0x5dba8e(0x19e)](_0x542ba4=>_0x542ba4[_0x5dba8e(0x1b8)][_0x5dba8e(0xca)]()===_0x5be60c['toLowerCase']());if(!_0x1e5ed?.['id'])throw new SDKError(ErrorCode[_0x5dba8e(0x130)],'Stage\x20\x27'+_0x5be60c+_0x5dba8e(0x1ab)+(_0x241806[_0x5dba8e(0x16e)][_0x5dba8e(0x133)]||_0x241806['attributes']['name'])+'\x27');return _0x1e5ed['id'];}},_0x4cc7d4=await _0x1115ed(_0xc35544[_0x7caa69(0x14f)],_0x195980[_0x7caa69(0xf5)],_0x2624b0),_0x4f332f=_0x195980[_0x7caa69(0x166)]||_0x195980[_0x7caa69(0x16a)];_0x4f332f&&(_0x4cc7d4['relationships']={'parentFolder':{'data':{'id':_0x4f332f,'type':_0x7caa69(0x164)}}});if(_0xc35544[_0x7caa69(0xd8)]){if(_0x57cc24['size']>0x0||_0x179408[_0x7caa69(0x170)]>0x0)return await executeThreeStepJourneyCreate(_0x4398a1,_0xc35544,_0x4cc7d4,{'pendingEmbeddedSegments':_0x57cc24,'pendingEmbeddedActivations':_0x179408,'embeddedSegmentNameToId':_0x36b426,'journeyActivationNameToId':_0x325528},{..._0x195980,'effectiveFolderId':_0x4f332f},_0x157dae,_0x13b059,_0x57b5ba);else{ensureJourneyDefaults(_0x4cc7d4[_0x7caa69(0x16e)]);const _0x42f956=await _0x4398a1['journey']['create'](_0x4cc7d4);return deletePushRecovery(_0xc35544[_0x7caa69(0x1a6)]),{'action':_0x7caa69(0x1a0),'journeyId':_0x42f956['id'],'embeddedSegmentNameToId':_0x36b426};}}else{if(_0xc35544[_0x7caa69(0x10f)]&&_0xc35544[_0x7caa69(0x150)]){_0x4cc7d4['id']=_0xc35544[_0x7caa69(0x150)]['id'];const _0x41a804=_0x4cc7d4[_0x7caa69(0x16e)];_0xc35544[_0x7caa69(0x150)]['attributes']?.['journeyBundleName']&&(_0x41a804[_0x7caa69(0x133)]=_0xc35544['existingJourney']['attributes'][_0x7caa69(0x133)]);const _0x5807d7=_0xc35544[_0x7caa69(0x150)][_0x7caa69(0x16e)]?.['journeyStages'];return _0x5807d7&&_0x4cc7d4[_0x7caa69(0x16e)]['journeyStages']&&injectExistingStageIds(_0x4cc7d4[_0x7caa69(0x16e)][_0x7caa69(0xce)],_0x5807d7),ensureJourneyDefaults(_0x41a804),await _0x4398a1[_0x7caa69(0x15d)][_0x7caa69(0x176)](_0xc35544[_0x7caa69(0x150)]['id'],_0x4cc7d4),deletePushRecovery(_0xc35544['absolutePath']),{'action':_0x7caa69(0x14c),'journeyId':_0xc35544[_0x7caa69(0x150)]['id'],'embeddedSegmentNameToId':_0x36b426};}}return deletePushRecovery(_0xc35544[_0x7caa69(0x1a6)]),{'action':_0x7caa69(0x137),'journeyId':_0xc35544[_0x7caa69(0x150)]?.['id'],'embeddedSegmentNameToId':_0x36b426};}function findSegmentCriteriaLocation(_0x3c41f0,_0xe74268){const _0x2ce5ce=a152_0x451377,_0x1ff4d1=_0x3c41f0['stages']||_0x3c41f0['journeys']?.[0x0]?.[_0x2ce5ce(0xcd)]||[];let _0x356be9=_0x2ce5ce(0x163),_0x317532=_0xe74268;const _0x16617f=_0x3c41f0[_0x2ce5ce(0x113)]||_0x3c41f0[_0x2ce5ce(0x17f)]?.[0x0]?.[_0x2ce5ce(0x113)];if(_0x16617f?.['segment']===_0xe74268)return{'stageName':_0x2ce5ce(0x113),'criteriaName':_0x16617f[_0x2ce5ce(0x1b8)]||_0xe74268};_0x3b78c5:for(const _0x4a551d of _0x1ff4d1){if(_0x4a551d[_0x2ce5ce(0x100)]?.['segment']===_0xe74268){_0x356be9=_0x4a551d[_0x2ce5ce(0x1b8)],_0x317532=_0x4a551d[_0x2ce5ce(0x100)]['name']||_0xe74268;break;}if(_0x4a551d[_0x2ce5ce(0x199)])for(const _0x49a0b8 of _0x4a551d[_0x2ce5ce(0x199)]){if(_0x49a0b8[_0x2ce5ce(0x135)]===_0x2ce5ce(0xeb)&&_0x49a0b8['with']?.[_0x2ce5ce(0x151)])for(const _0x3cbb5d of _0x49a0b8['with'][_0x2ce5ce(0x151)]){if(_0x3cbb5d['segment']===_0xe74268){_0x356be9=_0x4a551d[_0x2ce5ce(0x1b8)],_0x317532=_0x3cbb5d[_0x2ce5ce(0x1b8)]||_0xe74268;break _0x3b78c5;}}}}return{'stageName':_0x356be9,'criteriaName':_0x317532};}async function executeThreeStepJourneyCreate(_0x395aae,_0x35742b,_0x5eeabb,_0x500e02,_0x2c3231,_0x56293d,_0x361533,_0x145cc9){const _0x5ea9cb=a152_0x451377,{activationDefToCreateRequest:_0x97e0d3,yamlRuleToApi:_0xd0ae64}=_0x145cc9,{pendingEmbeddedSegments:_0xf9d08c,pendingEmbeddedActivations:_0x50bc42,embeddedSegmentNameToId:_0x416117}=_0x500e02,_0x4d9a36=JSON[_0x5ea9cb(0x18f)](JSON[_0x5ea9cb(0x147)](_0x5eeabb));ensureJourneyDefaults(_0x4d9a36[_0x5ea9cb(0x16e)]),stripPendingIds(_0x4d9a36);const _0x40db70=await _0x395aae[_0x5ea9cb(0x15d)]['create'](_0x4d9a36),_0x201419=_0x40db70['id'],_0x5636e6=new Map();for(const _0x44fe47 of _0x40db70[_0x5ea9cb(0x16e)]['journeyStages']){_0x5636e6[_0x5ea9cb(0x145)](_0x44fe47[_0x5ea9cb(0x1b8)][_0x5ea9cb(0xca)](),_0x44fe47['id']);}recoverSegmentIdsFromPushRecovery(_0x35742b,_0x416117,_0x56293d[_0x5ea9cb(0x180)]);for(const [_0xa770b9,{definition:_0x358084}]of _0xf9d08c){if(_0x416117['has'](_0xa770b9)){_0x361533['onProgress']?.({'type':'embedded_segment_created','journeyName':_0x35742b[_0x5ea9cb(0x14f)][_0x5ea9cb(0x1b8)],'segmentName':_0xa770b9});continue;}const _0x3610ca=generateDeterministicJourneySegmentName(_0x35742b[_0x5ea9cb(0x14f)]['name'],_0xa770b9);_0x361533[_0x5ea9cb(0x16d)]?.({'type':_0x5ea9cb(0xed),'journeyName':_0x35742b[_0x5ea9cb(0x14f)][_0x5ea9cb(0x1b8)],'segmentName':_0xa770b9});const _0x353306=createSegmentIdResolver(_0x56293d['segmentNameToId'],_0xa770b9),_0x3c543b=await resolveRuleSegmentIds(_0x358084[_0x5ea9cb(0x19b)],_0x353306),_0x92bbf1=await createOrRecoverEmbeddedSegment(_0x395aae,_0x35742b,{'localName':_0xa770b9,'uniqueSegmentName':_0x3610ca,'description':_0x358084[_0x5ea9cb(0x1bd)]||_0x5ea9cb(0x132)+_0xa770b9,'journeyId':_0x201419,'resolvedRule':_0x3c543b,'parentId':_0x2c3231[_0x5ea9cb(0xf5)],'folderId':_0x2c3231[_0x5ea9cb(0x10c)]||''},_0xd0ae64);_0x416117['set'](_0xa770b9,_0x92bbf1),_0x56293d[_0x5ea9cb(0x180)][_0x5ea9cb(0x145)](_0xa770b9,_0x92bbf1),_0x361533[_0x5ea9cb(0x16d)]?.({'type':'embedded_segment_created','journeyName':_0x35742b['yamlConfig'][_0x5ea9cb(0x1b8)],'segmentName':_0xa770b9});}const _0x32b218=new Map();for(const [_0x42d697,_0x4b11a1]of _0x50bc42){_0x361533[_0x5ea9cb(0x16d)]?.({'type':'embedded_activation_creating','journeyName':_0x35742b[_0x5ea9cb(0x14f)][_0x5ea9cb(0x1b8)],'activationName':_0x42d697});const _0x35f9b7=await _0x97e0d3(_0x4b11a1,_0x56293d[_0x5ea9cb(0x13d)]),_0x2da7c4={..._0x35f9b7,..._0x4b11a1['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x4b11a1[_0x5ea9cb(0x1a4)]}},_0x2828e8=await _0x395aae[_0x5ea9cb(0x15d)][_0x5ea9cb(0x196)](_0x201419,_0x2da7c4);_0x32b218['set'](_0x42d697,_0x2828e8['id']),_0x500e02[_0x5ea9cb(0xec)][_0x5ea9cb(0x145)](_0x42d697,_0x2828e8['id']),_0x361533['onProgress']?.({'type':_0x5ea9cb(0x182),'journeyName':_0x35742b[_0x5ea9cb(0x14f)][_0x5ea9cb(0x1b8)],'activationName':_0x42d697});}const _0x19ae81=JSON[_0x5ea9cb(0x18f)](JSON[_0x5ea9cb(0x147)](_0x5eeabb));return _0x19ae81['id']=_0x201419,ensureJourneyDefaults(_0x19ae81[_0x5ea9cb(0x16e)]),resolvePendingIdsInRequest(_0x19ae81,_0x5eeabb,_0x5636e6,_0x416117,_0x32b218,_0x361533),await _0x395aae['journey'][_0x5ea9cb(0x176)](_0x201419,_0x19ae81),deletePushRecovery(_0x35742b[_0x5ea9cb(0x1a6)]),{'action':'created','journeyId':_0x201419,'embeddedSegmentNameToId':_0x416117};}export function stripWaitStepPendingIds(_0xcc8418){const _0x516a13=a152_0x451377,_0x3ffabf=_0xcc8418[_0x516a13(0x149)]&&isPendingSegmentId(_0xcc8418['conditionSegmentId']),_0x65916a=_0xcc8418[_0x516a13(0x195)]?.[_0x516a13(0x14b)](_0x19f1d2=>_0x19f1d2[_0x516a13(0x19a)]&&isPendingSegmentId(_0x19f1d2['segmentId']));(_0x3ffabf||_0x65916a)&&(_0xcc8418[_0x516a13(0xb8)]=_0x516a13(0xef),_0xcc8418[_0x516a13(0x15c)]=0x1,_0xcc8418['waitStepUnit']='day',delete _0xcc8418['conditionSegmentId'],delete _0xcc8418[_0x516a13(0x12a)],delete _0xcc8418[_0x516a13(0x194)],delete _0xcc8418[_0x516a13(0x195)]);}export function resolveWaitStepPendingIds(_0x4ff3f4,_0x59bea1,_0x29ed99,_0x3fa1d2){const _0x2ceed1=a152_0x451377;if(_0x59bea1[_0x2ceed1(0x149)]&&isPendingSegmentId(_0x59bea1[_0x2ceed1(0x149)])){const _0x39ad53=_0x29ed99(_0x59bea1[_0x2ceed1(0x149)],_0x2ceed1(0x1b9)+_0x3fa1d2+_0x2ceed1(0x165));_0x39ad53&&(_0x4ff3f4[_0x2ceed1(0xb8)]=_0x2ceed1(0xe2),_0x4ff3f4[_0x2ceed1(0x149)]=_0x39ad53,delete _0x4ff3f4['waitStep'],delete _0x4ff3f4['waitStepUnit'],_0x59bea1['conditionTimeoutDuration']!==undefined&&(_0x4ff3f4[_0x2ceed1(0x12a)]=_0x59bea1[_0x2ceed1(0x12a)]),_0x59bea1['conditionTimeoutUnit']&&(_0x4ff3f4[_0x2ceed1(0x194)]=_0x59bea1[_0x2ceed1(0x194)]));}if(_0x59bea1[_0x2ceed1(0x195)]){const _0xa4f67b=_0x59bea1['conditions'][_0x2ceed1(0x14b)](_0x4be41d=>_0x4be41d[_0x2ceed1(0x19a)]&&isPendingSegmentId(_0x4be41d[_0x2ceed1(0x19a)]));if(_0xa4f67b){const _0x2c6fd6=_0x59bea1[_0x2ceed1(0x195)][_0x2ceed1(0x1b1)](_0x27c1a3=>{const _0x169a4a=_0x2ceed1;if(_0x27c1a3[_0x169a4a(0x19a)]&&isPendingSegmentId(_0x27c1a3[_0x169a4a(0x19a)])){const _0x52b211=_0x29ed99(_0x27c1a3[_0x169a4a(0x19a)],_0x169a4a(0x1b9)+_0x3fa1d2+'\x27\x20wait\x20condition');return{..._0x27c1a3,'segmentId':_0x52b211||_0x27c1a3[_0x169a4a(0x19a)]};}return{..._0x27c1a3};});_0x4ff3f4[_0x2ceed1(0xb8)]=_0x2ceed1(0xe2),_0x4ff3f4['conditions']=_0x2c6fd6,delete _0x4ff3f4[_0x2ceed1(0x15c)],delete _0x4ff3f4['waitStepUnit'],delete _0x4ff3f4['conditionSegmentId'],delete _0x4ff3f4[_0x2ceed1(0x12a)],delete _0x4ff3f4[_0x2ceed1(0x194)];}}}function stripPendingIds(_0x5a523d){const _0x41cb24=a152_0x451377;_0x5a523d[_0x41cb24(0x16e)][_0x41cb24(0x113)]?.[_0x41cb24(0x19a)]&&isPendingSegmentId(_0x5a523d['attributes']['goal'][_0x41cb24(0x19a)])&&delete _0x5a523d[_0x41cb24(0x16e)][_0x41cb24(0x113)];for(const _0x2d632c of _0x5a523d[_0x41cb24(0x16e)][_0x41cb24(0xce)]||[]){_0x2d632c[_0x41cb24(0xfe)]?.[_0x41cb24(0x19a)]&&isPendingSegmentId(_0x2d632c[_0x41cb24(0xfe)][_0x41cb24(0x19a)])&&delete _0x2d632c[_0x41cb24(0xfe)];_0x2d632c[_0x41cb24(0xc5)]?.[_0x41cb24(0x19a)]&&isPendingSegmentId(_0x2d632c[_0x41cb24(0xc5)][_0x41cb24(0x19a)])&&delete _0x2d632c[_0x41cb24(0xc5)];_0x2d632c['exitCriterias']&&(_0x2d632c[_0x41cb24(0x14e)]=_0x2d632c['exitCriterias'][_0x41cb24(0x198)](_0x5b6b43=>!_0x5b6b43[_0x41cb24(0x19a)]||!isPendingSegmentId(_0x5b6b43[_0x41cb24(0x19a)])));if(_0x2d632c[_0x41cb24(0x199)])for(const _0x5ad6b0 of Object['keys'](_0x2d632c['steps'])){const _0x123b37=_0x2d632c['steps'][_0x5ad6b0];_0x123b37['type']==='Activation'&&_0x123b37[_0x41cb24(0x154)]&&isPendingActivationId(_0x123b37['journeyActivationStepId'])&&(_0x123b37[_0x41cb24(0x154)]='');if(_0x123b37[_0x41cb24(0x135)]===_0x41cb24(0xd4)&&_0x123b37[_0x41cb24(0x151)])for(const _0x27d210 of _0x123b37[_0x41cb24(0x151)]){_0x27d210[_0x41cb24(0x19a)]&&isPendingSegmentId(_0x27d210[_0x41cb24(0x19a)])&&(_0x27d210[_0x41cb24(0x19a)]='');}_0x123b37[_0x41cb24(0x135)]===_0x41cb24(0x123)&&stripWaitStepPendingIds(_0x123b37);}}}function resolvePendingIdsInRequest(_0x50394a,_0x34e332,_0x4d0293,_0x47af2a,_0x9947b3,_0x25bd32){const _0x2687af=a152_0x451377,_0x4ee162=(_0x17c3e2,_0x5a9e0a)=>{const _0x2c27ac=a152_0x18a7;if(!isPendingSegmentId(_0x17c3e2))return _0x17c3e2;const _0x1d2d46=extractPendingSegmentName(_0x17c3e2),_0x4dc30a=_0x47af2a['get'](_0x1d2d46);return!_0x4dc30a&&_0x25bd32[_0x2c27ac(0xd1)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x1d2d46+'\x27\x20for\x20'+_0x5a9e0a),_0x4dc30a;};if(_0x50394a[_0x2687af(0x16e)][_0x2687af(0x113)]?.['segmentId']&&isPendingSegmentId(_0x50394a[_0x2687af(0x16e)][_0x2687af(0x113)][_0x2687af(0x19a)])){const _0x2d9d6f=_0x4ee162(_0x50394a[_0x2687af(0x16e)]['goal'][_0x2687af(0x19a)],_0x2687af(0x1af));_0x2d9d6f&&(_0x50394a[_0x2687af(0x16e)][_0x2687af(0x113)][_0x2687af(0x19a)]=_0x2d9d6f);}for(const _0x2438e0 of _0x50394a[_0x2687af(0x16e)][_0x2687af(0xce)]||[]){const _0x34e2e4=_0x4d0293[_0x2687af(0x12f)](_0x2438e0['name'][_0x2687af(0xca)]());_0x34e2e4&&(_0x2438e0['id']=_0x34e2e4);if(_0x2438e0[_0x2687af(0xfe)]?.[_0x2687af(0x19a)]&&isPendingSegmentId(_0x2438e0[_0x2687af(0xfe)]['segmentId'])){const _0x51216a=_0x4ee162(_0x2438e0['entryCriteria'][_0x2687af(0x19a)],_0x2687af(0x1b9)+_0x2438e0[_0x2687af(0x1b8)]+_0x2687af(0x13a));_0x51216a&&(_0x2438e0[_0x2687af(0xfe)]['segmentId']=_0x51216a);}if(_0x2438e0['exitCriterias'])for(const _0x4b5d41 of _0x2438e0[_0x2687af(0x14e)]){if(_0x4b5d41[_0x2687af(0x19a)]&&isPendingSegmentId(_0x4b5d41[_0x2687af(0x19a)])){const _0x45af52=_0x4ee162(_0x4b5d41[_0x2687af(0x19a)],_0x2687af(0x1b9)+_0x2438e0[_0x2687af(0x1b8)]+_0x2687af(0x102));_0x45af52&&(_0x4b5d41['segmentId']=_0x45af52);}}if(_0x2438e0[_0x2687af(0xc5)]?.[_0x2687af(0x19a)]&&isPendingSegmentId(_0x2438e0[_0x2687af(0xc5)][_0x2687af(0x19a)])){const _0x16fef9=_0x4ee162(_0x2438e0[_0x2687af(0xc5)][_0x2687af(0x19a)],_0x2687af(0x1b9)+_0x2438e0[_0x2687af(0x1b8)]+_0x2687af(0x13b));_0x16fef9&&(_0x2438e0[_0x2687af(0xc5)][_0x2687af(0x19a)]=_0x16fef9);}if(_0x2438e0['steps']){const _0x41f2cb=_0xf330c=>_0x34e332[_0x2687af(0x16e)][_0x2687af(0xce)]?.[_0x2687af(0x19e)](_0x5d975b=>_0x5d975b['name']['toLowerCase']()===_0x2438e0[_0x2687af(0x1b8)][_0x2687af(0xca)]())?.[_0x2687af(0x199)]?.[_0xf330c];for(const _0x1f2eeb of Object[_0x2687af(0xd5)](_0x2438e0[_0x2687af(0x199)])){const _0x4ab7e1=_0x2438e0['steps'][_0x1f2eeb],_0x17eabf=_0x41f2cb(_0x1f2eeb);if(_0x4ab7e1[_0x2687af(0x135)]===_0x2687af(0xfb)&&_0x4ab7e1['journeyActivationStepId']&&(isPendingActivationId(_0x4ab7e1['journeyActivationStepId'])||_0x4ab7e1[_0x2687af(0x154)]==='')){if(_0x17eabf?.['journeyActivationStepId']&&isPendingActivationId(_0x17eabf['journeyActivationStepId'])){const _0xce9893=extractPendingActivationName(_0x17eabf['journeyActivationStepId']),_0x50aa6b=_0x9947b3[_0x2687af(0x12f)](_0xce9893);_0x50aa6b&&(_0x4ab7e1[_0x2687af(0x154)]=_0x50aa6b);}}if(_0x4ab7e1[_0x2687af(0x135)]===_0x2687af(0xd4)&&_0x4ab7e1[_0x2687af(0x151)]&&_0x17eabf?.[_0x2687af(0x151)])for(let _0x286d5f=0x0;_0x286d5f<_0x4ab7e1[_0x2687af(0x151)][_0x2687af(0x16c)];_0x286d5f++){const _0x36f33c=_0x4ab7e1[_0x2687af(0x151)][_0x286d5f],_0x139248=_0x17eabf['branches'][_0x286d5f];if(_0x139248?.[_0x2687af(0x19a)]&&isPendingSegmentId(_0x139248[_0x2687af(0x19a)])){const _0xc67c8e=_0x4ee162(_0x139248[_0x2687af(0x19a)],_0x2687af(0x1b9)+_0x2438e0[_0x2687af(0x1b8)]+_0x2687af(0x1b0)+(_0x36f33c[_0x2687af(0x1b8)]||_0x286d5f)+'\x27');_0xc67c8e&&(_0x36f33c[_0x2687af(0x19a)]=_0xc67c8e);}}_0x4ab7e1[_0x2687af(0x135)]===_0x2687af(0x123)&&_0x17eabf?.[_0x2687af(0x135)]===_0x2687af(0x123)&&resolveWaitStepPendingIds(_0x4ab7e1,_0x17eabf,_0x4ee162,_0x2438e0[_0x2687af(0x1b8)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a153_0x5b64(){const _0x732074=['1cFeKIt','898930fPUjqi','28DbucGO','name','parentFolderId','901926pcepGx','get','14128IViKEC','85MnwUqR','12UMpbxV','252krKoRa','has','1692414yUNkLu','set','141028PrsTfN','add','7563270VJJmvH','2726614ibAOqN'];a153_0x5b64=function(){return _0x732074;};return a153_0x5b64();}(function(_0x577692,_0x3b74f5){const _0x352dbb=a153_0x5520,_0x24f86c=_0x577692();while(!![]){try{const _0x1c89bd=parseInt(_0x352dbb(0x142))/0x1*(-parseInt(_0x352dbb(0x131))/0x2)+parseInt(_0x352dbb(0x13c))/0x3+-parseInt(_0x352dbb(0x13e))/0x4*(parseInt(_0x352dbb(0x138))/0x5)+-parseInt(_0x352dbb(0x135))/0x6*(-parseInt(_0x352dbb(0x132))/0x7)+parseInt(_0x352dbb(0x137))/0x8*(-parseInt(_0x352dbb(0x13a))/0x9)+parseInt(_0x352dbb(0x140))/0xa+-parseInt(_0x352dbb(0x141))/0xb*(parseInt(_0x352dbb(0x139))/0xc);if(_0x1c89bd===_0x3b74f5)break;else _0x24f86c['push'](_0x24f86c['shift']());}catch(_0x40cded){_0x24f86c['push'](_0x24f86c['shift']());}}}(a153_0x5b64,0x8c869));export function buildFolderIdToPathMap(_0xa0305d){const _0x1199cd=a153_0x5520,_0xcfafc8=new Map(),_0x1f86d0=new Map();for(const _0x2446c6 of _0xa0305d){_0x1f86d0[_0x1199cd(0x13d)](_0x2446c6['id'],_0x2446c6);}const _0x1c19fc=new Set();for(const _0x3d68c5 of _0xa0305d){!_0x3d68c5[_0x1199cd(0x134)]&&_0x1c19fc[_0x1199cd(0x13f)](_0x3d68c5['id']);}function _0x22b37c(_0x1069ab){const _0xb76b53=_0x1199cd;if(_0xcfafc8[_0xb76b53(0x13b)](_0x1069ab['id']))return _0xcfafc8[_0xb76b53(0x136)](_0x1069ab['id']);if(_0x1c19fc[_0xb76b53(0x13b)](_0x1069ab['id']))return _0xcfafc8['set'](_0x1069ab['id'],''),'';if(_0x1069ab['parentFolderId']){const _0x44ad99=_0x1f86d0[_0xb76b53(0x136)](_0x1069ab[_0xb76b53(0x134)]);if(_0x44ad99){const _0x528f92=_0x22b37c(_0x44ad99),_0x11b508=_0x528f92?_0x528f92+'/'+_0x1069ab[_0xb76b53(0x133)]:_0x1069ab[_0xb76b53(0x133)];return _0xcfafc8['set'](_0x1069ab['id'],_0x11b508),_0x11b508;}}const _0x41a478=_0x1069ab[_0xb76b53(0x133)];return _0xcfafc8[_0xb76b53(0x13d)](_0x1069ab['id'],_0x41a478),_0x41a478;}for(const _0x281ca7 of _0xa0305d){_0x22b37c(_0x281ca7);}return _0xcfafc8;}export function buildFolderPathToIdMap(_0x305be4){const _0x3eacda=a153_0x5520,_0x125161=new Map(),_0x12d15d=new Map();for(const _0x108ddb of _0x305be4){_0x12d15d[_0x3eacda(0x13d)](_0x108ddb['id'],_0x108ddb);}const _0x22a593=new Set();for(const _0x410143 of _0x305be4){!_0x410143[_0x3eacda(0x134)]&&_0x22a593[_0x3eacda(0x13f)](_0x410143['id']);}function _0x387393(_0x39d21c){const _0x382ec2=_0x3eacda;if(_0x22a593['has'](_0x39d21c['id']))return'';if(_0x39d21c['parentFolderId']){const _0x427a7c=_0x12d15d['get'](_0x39d21c[_0x382ec2(0x134)]);if(_0x427a7c){const _0x4feba1=_0x387393(_0x427a7c);return _0x4feba1?_0x4feba1+'/'+_0x39d21c[_0x382ec2(0x133)]:_0x39d21c[_0x382ec2(0x133)];}}return _0x39d21c[_0x382ec2(0x133)];}for(const _0x1745d4 of _0x305be4){const _0xdae9a3=_0x387393(_0x1745d4);_0x125161['set'](_0xdae9a3,_0x1745d4['id']);}return _0x125161;}export function buildFolderMaps(_0x218726){const _0xb5ccae=buildFolderIdToPathMap(_0x218726),_0x1b5223=new Map();for(const [_0x40cf1b,_0x5cde58]of _0xb5ccae){_0x1b5223['set'](_0x5cde58,_0x40cf1b);}return{'idToPath':_0xb5ccae,'pathToId':_0x1b5223};}function a153_0x5520(_0xb9f124,_0x2d4d5d){_0xb9f124=_0xb9f124-0x131;const _0x5b64dd=a153_0x5b64();let _0x552029=_0x5b64dd[_0xb9f124];return _0x552029;}export function getFolderPath(_0x34ecf1,_0x59cdea){const _0x1f576a=a153_0x5520;if(!_0x34ecf1)return'';return _0x59cdea[_0x1f576a(0x136)](_0x34ecf1)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4221ed,_0x2602a0){const _0x430feb=a154_0x12cb,_0x55668c=_0x4221ed();while(!![]){try{const _0x2146dd=parseInt(_0x430feb(0x157))/0x1*(parseInt(_0x430feb(0x15e))/0x2)+-parseInt(_0x430feb(0x163))/0x3*(parseInt(_0x430feb(0x16c))/0x4)+parseInt(_0x430feb(0x156))/0x5*(parseInt(_0x430feb(0x162))/0x6)+-parseInt(_0x430feb(0x170))/0x7*(-parseInt(_0x430feb(0x17a))/0x8)+parseInt(_0x430feb(0x17d))/0x9*(parseInt(_0x430feb(0x16e))/0xa)+parseInt(_0x430feb(0x155))/0xb+-parseInt(_0x430feb(0x167))/0xc;if(_0x2146dd===_0x2602a0)break;else _0x55668c['push'](_0x55668c['shift']());}catch(_0x4f7e0e){_0x55668c['push'](_0x55668c['shift']());}}}(a154_0x25d9,0x1ea84));import a154_0x39b86e from'path';import{parse as a154_0xe966bf}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x18d6d3){const _0x4028fd=a154_0x12cb;if(!_0x18d6d3||_0x18d6d3['trim']()==='')throw new Error(_0x4028fd(0x165));const _0x11cd98=_0x18d6d3[_0x4028fd(0x164)]();if(_0x11cd98==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x18d6d3};const _0x45e3e1=_0x11cd98[_0x4028fd(0x176)]('/')?_0x11cd98['substring'](0x1):_0x11cd98,_0x460371=_0x45e3e1['split']('/')['filter'](_0x2c8223=>_0x2c8223!=='');if(_0x460371['length']===0x0)throw new Error(_0x4028fd(0x15c));const _0x4a388a=_0x11cd98[_0x4028fd(0x176)]('/')||!isRelativePathSegment(_0x460371[0x0]);for(const _0x2a5f05 of _0x460371){validatePathSegment(_0x2a5f05);}return{'segments':_0x460371,'isAbsolute':_0x4a388a,'raw':_0x18d6d3};}function isRelativePathSegment(_0x161de5){return _0x161de5==='.'||_0x161de5==='..';}function validatePathSegment(_0x52d6be){const _0x4d01e0=a154_0x12cb;if(_0x52d6be==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x52d6be==='.'||_0x52d6be==='..')return;if(/[\x00-\x1F\x7F]/[_0x4d01e0(0x15f)](_0x52d6be))throw new Error(_0x4d01e0(0x175)+_0x52d6be);if(_0x52d6be!==_0x52d6be['trim']()){}}export function validatePath(_0x3d80b5){const _0x5c649f=a154_0x12cb;if(_0x3d80b5[_0x5c649f(0x159)]['length']===0x0&&!_0x3d80b5[_0x5c649f(0x158)])throw new Error(_0x5c649f(0x16f));if(_0x3d80b5[_0x5c649f(0x158)]){if(_0x3d80b5[_0x5c649f(0x159)][0x0]==='..')throw new Error(_0x5c649f(0x171));let _0x4034a8=0x0;for(const _0x2bc7df of _0x3d80b5[_0x5c649f(0x159)]){if(_0x2bc7df==='..'){if(_0x4034a8===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x4034a8--;}else _0x2bc7df!=='.'&&_0x4034a8++;}}}export function joinPaths(_0x571528,_0x4d5dc2){const _0x3b04da=a154_0x12cb;if(!_0x571528||_0x571528==='/')return _0x4d5dc2;if(!_0x4d5dc2||_0x4d5dc2==='.')return _0x571528;if(_0x4d5dc2[_0x3b04da(0x176)]('/'))return _0x4d5dc2;const _0xbd15c0=parsePath(_0x571528),_0x415056=parsePath(_0x4d5dc2),_0x5c982a=[..._0xbd15c0['segments']];for(const _0x24f2c0 of _0x415056[_0x3b04da(0x159)]){if(_0x24f2c0==='.')continue;else{if(_0x24f2c0==='..'){if(_0x5c982a[_0x3b04da(0x16d)]===0x0)throw new Error(_0x3b04da(0x17e));_0x5c982a[_0x3b04da(0x17f)]();}else _0x5c982a['push'](_0x24f2c0);}}const _0x23ecfc=_0x5c982a[_0x3b04da(0x178)]('/');return _0xbd15c0[_0x3b04da(0x179)]['startsWith']('/')?'/'+_0x23ecfc:_0x23ecfc;}export function normalizePath(_0x57cf9d){const _0x3e8462=a154_0x12cb,_0x285589=parsePath(_0x57cf9d),_0x1d5b25=[];for(const _0x2b93e6 of _0x285589[_0x3e8462(0x159)]){if(_0x2b93e6==='.')continue;else{if(_0x2b93e6==='..'){if(_0x1d5b25['length']===0x0){if(_0x285589['isAbsolute'])throw new Error(_0x3e8462(0x17e));_0x1d5b25[_0x3e8462(0x160)]('..');}else _0x1d5b25[_0x1d5b25[_0x3e8462(0x16d)]-0x1]==='..'?_0x1d5b25[_0x3e8462(0x160)]('..'):_0x1d5b25[_0x3e8462(0x17f)]();}else _0x1d5b25[_0x3e8462(0x160)](_0x2b93e6);}}if(_0x1d5b25[_0x3e8462(0x16d)]===0x0)return _0x285589[_0x3e8462(0x158)]?'/':'.';const _0x26e593=_0x1d5b25[_0x3e8462(0x178)]('/');return _0x285589[_0x3e8462(0x179)]['startsWith']('/')?'/'+_0x26e593:_0x26e593;}export function getParentPath(_0x51efa6){const _0x3cdb6e=a154_0x12cb,_0x3415cb=parsePath(_0x51efa6);if(_0x3415cb['segments'][_0x3cdb6e(0x16d)]<=0x1)return'/';const _0x2f91ae=_0x3415cb['segments']['slice'](0x0,-0x1)[_0x3cdb6e(0x178)]('/');return _0x3415cb[_0x3cdb6e(0x179)][_0x3cdb6e(0x176)]('/')?'/'+_0x2f91ae:_0x2f91ae;}function a154_0x25d9(){const _0x44b922=['parent_segment','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','.yml','6bTvakX','test','push','journey','3924zAXCPv','15jiTJpG','trim','Path\x20cannot\x20be\x20empty','slice','3827316yWacJP','name','exists','readFile','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','93100JXryka','length','1130vJqgpc','Relative\x20path\x20cannot\x20be\x20empty','7ZDlYFd','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','tdx.json','dirname','endsWith','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','startsWith','No\x20tdx.json\x20found\x20for\x20file:\x20','join','raw','1565016mSxYvp','segment','Cannot\x20split\x20empty\x20path','1989QJRXNt','Cannot\x20navigate\x20above\x20root','pop','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','357885igbqyj','495XqzMTM','81003TaPpgv','isAbsolute','segments','root'];a154_0x25d9=function(){return _0x44b922;};return a154_0x25d9();}export function getBaseName(_0x27d625){const _0x36be4d=a154_0x12cb,_0x406789=parsePath(_0x27d625);return _0x406789[_0x36be4d(0x159)][_0x406789['segments']['length']-0x1]||'';}export function isChildPath(_0x82fc3d,_0xc1e716){const _0xcb8b0=a154_0x12cb,_0xb9fdd7=parsePath(_0x82fc3d),_0x3d40ef=parsePath(_0xc1e716);if(_0xb9fdd7[_0xcb8b0(0x159)][_0xcb8b0(0x16d)]<=_0x3d40ef[_0xcb8b0(0x159)][_0xcb8b0(0x16d)])return![];for(let _0x36d742=0x0;_0x36d742<_0x3d40ef['segments'][_0xcb8b0(0x16d)];_0x36d742++){if(_0xb9fdd7['segments'][_0x36d742]!==_0x3d40ef[_0xcb8b0(0x159)][_0x36d742])return![];}return!![];}export function splitPath(_0x163e7a){const _0x3a1f94=a154_0x12cb,_0x5968ec=parsePath(_0x163e7a);if(_0x5968ec['segments'][_0x3a1f94(0x16d)]===0x0)throw new Error(_0x3a1f94(0x17c));if(_0x5968ec['segments'][_0x3a1f94(0x16d)]===0x1)return{'parent':_0x5968ec[_0x3a1f94(0x159)][0x0]};return{'parent':_0x5968ec[_0x3a1f94(0x159)][0x0],'child':_0x5968ec[_0x3a1f94(0x159)][_0x3a1f94(0x166)](0x1)[_0x3a1f94(0x178)]('/')};}export function isYamlFilePath(_0x3efff3){const _0x3ba94c=a154_0x12cb;return _0x3efff3[_0x3ba94c(0x174)](_0x3ba94c(0x15d))||_0x3efff3[_0x3ba94c(0x174)]('.yaml');}function a154_0x12cb(_0x3b44ca,_0x5ee33d){_0x3b44ca=_0x3b44ca-0x154;const _0x25d961=a154_0x25d9();let _0x12cb20=_0x25d961[_0x3b44ca];return _0x12cb20;}export async function resolveYamlFilePath(_0x38cc66,_0x102c9b=nodeFileSystem){const _0x291d75=a154_0x12cb,_0x271265=a154_0x39b86e['resolve'](_0x38cc66);if(!await _0x102c9b[_0x291d75(0x169)](_0x271265))throw new Error('File\x20not\x20found:\x20'+_0x38cc66);let _0x51d876=a154_0x39b86e[_0x291d75(0x173)](_0x271265),_0xce3b27=null,_0x23840f=null;const _0x115e5b=a154_0x39b86e['parse'](_0x51d876)[_0x291d75(0x15a)];while(_0x51d876!==_0x115e5b){const _0x53ec85=a154_0x39b86e[_0x291d75(0x178)](_0x51d876,_0x291d75(0x172));if(await _0x102c9b[_0x291d75(0x169)](_0x53ec85)){_0xce3b27=_0x53ec85,_0x23840f=_0x51d876;break;}_0x51d876=a154_0x39b86e[_0x291d75(0x173)](_0x51d876);}if(!_0xce3b27||!_0x23840f)throw new Error(_0x291d75(0x177)+_0x38cc66+'\x0a'+_0x291d75(0x154));const _0x1db33e=await _0x102c9b[_0x291d75(0x16a)](_0xce3b27),_0xbf14e2=JSON['parse'](_0x1db33e),_0x110118=_0xbf14e2[_0x291d75(0x15b)];if(!_0x110118)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x42f089=await _0x102c9b[_0x291d75(0x16a)](_0x271265),_0x4903a0=a154_0xe966bf(_0x42f089),_0x22dccb=_0x4903a0[_0x291d75(0x168)];if(!_0x22dccb)throw new Error(_0x291d75(0x16b)+_0x38cc66);const _0x34b16c=_0x4903a0['type']===_0x291d75(0x161)?_0x291d75(0x161):_0x291d75(0x17b),_0x47cb61=a154_0x39b86e['relative'](_0x23840f,_0x271265),_0x28da8f=a154_0x39b86e[_0x291d75(0x173)](_0x47cb61),_0x2c1e6e=_0x28da8f==='.'?'':_0x28da8f['replace'](/\\/g,'/'),_0x4ffa3d=_0x2c1e6e?_0x110118+'/'+_0x2c1e6e+'/'+_0x22dccb:_0x110118+'/'+_0x22dccb;return{'parentSegment':_0x110118,'segmentName':_0x22dccb,'folderPath':_0x2c1e6e,'fullPath':_0x4ffa3d,'resourceType':_0x34b16c,'content':_0x42f089};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a155_0x5bc4(){const _0x54ec23=['20kSMFVO','474087OZxTxD','35vNakMw','substring','.\x20Parent\x20name\x20cannot\x20be\x20empty','1120040hYyPDK','351116NpdWmF','Invalid\x20segment\x20reference\x20format:\x20','21135897mebexE','1116510hrQJgv','741791nfgpFv','.\x20Child\x20name\x20cannot\x20be\x20empty','1584805wFOQQa'];a155_0x5bc4=function(){return _0x54ec23;};return a155_0x5bc4();}function a155_0x5528(_0x5e41c9,_0x435832){_0x5e41c9=_0x5e41c9-0xd5;const _0x5bc499=a155_0x5bc4();let _0x55280b=_0x5bc499[_0x5e41c9];return _0x55280b;}(function(_0x13b0fb,_0x1ef6a4){const _0x40b045=a155_0x5528,_0x288a16=_0x13b0fb();while(!![]){try{const _0x30320b=-parseInt(_0x40b045(0xe1))/0x1+parseInt(_0x40b045(0xdd))/0x2+-parseInt(_0x40b045(0xd8))/0x3*(parseInt(_0x40b045(0xd7))/0x4)+parseInt(_0x40b045(0xd6))/0x5+-parseInt(_0x40b045(0xe0))/0x6+parseInt(_0x40b045(0xd9))/0x7*(-parseInt(_0x40b045(0xdc))/0x8)+parseInt(_0x40b045(0xdf))/0x9;if(_0x30320b===_0x1ef6a4)break;else _0x288a16['push'](_0x288a16['shift']());}catch(_0x1a8347){_0x288a16['push'](_0x288a16['shift']());}}}(a155_0x5bc4,0x673fa));export function parseSegmentRef(_0x29a5d4){const _0x2a48e9=a155_0x5528,_0x1fd6bc=_0x29a5d4['indexOf']('/');if(_0x1fd6bc===-0x1)return{'parentId':_0x29a5d4};if(_0x1fd6bc===0x0)throw new Error(_0x2a48e9(0xde)+_0x29a5d4+_0x2a48e9(0xdb));const _0x483fa9=_0x29a5d4['substring'](0x0,_0x1fd6bc),_0x182194=_0x29a5d4[_0x2a48e9(0xda)](_0x1fd6bc+0x1);if(_0x182194==='')throw new Error(_0x2a48e9(0xde)+_0x29a5d4+_0x2a48e9(0xd5));return{'parentId':_0x483fa9,'childId':_0x182194};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a156_0x220c(){const _0x11a908=['skipSchema','endsWith','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','Attribute\x20\x27','safeParse','.source','error','invalid_value','5aFicFe','1793580UiuMJh','attribute','1227770fVcJMG','EMPTY_ATTRIBUTE','MISSING_BETWEEN_BOUNDS','\x27\x20with\x20attribute\x20\x27','map','.attribute','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','filter','.segment','length','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','level','params','Behavior','path','type','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','message','issues','MISSING_NAME','custom','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','push','match','rule','14JreeOK','.type','rule.type','arrayMatching','name','warning','4955864ylxRsR','EMPTY_CONDITIONS','INVALID_RULE_TYPE','.conditions','document','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','.operator.type','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','SEGMENT_SCHEMA_ERROR','3512136TNRgSr','NESTED_CONDITION_GROUP','source','813211Eadhca','INVALID_OPERATOR_TYPE','Behavior\x20source\x20\x27','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','198IyDzdr','BEHAVIOR_SOURCE_MISSING_FILTER','MISSING_SEGMENT_REFERENCE','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','validationCode','4833618MwWaiY','1751036kxuGuE','conditions','data','code','MISSING_OPERATOR_VALUE','includes','.conditions[','MISSING_TIME_UNIT','success'];a156_0x220c=function(){return _0x11a908;};return a156_0x220c();}(function(_0x534f91,_0x193ebe){const _0x43d3b7=a156_0x357f,_0x5a5de1=_0x534f91();while(!![]){try{const _0x11731b=-parseInt(_0x43d3b7(0x107))/0x1+parseInt(_0x43d3b7(0x111))/0x2+parseInt(_0x43d3b7(0x123))/0x3+parseInt(_0x43d3b7(0xfb))/0x4*(-parseInt(_0x43d3b7(0x122))/0x5)+-parseInt(_0x43d3b7(0x110))/0x6*(parseInt(_0x43d3b7(0xf5))/0x7)+parseInt(_0x43d3b7(0x104))/0x8+-parseInt(_0x43d3b7(0x10b))/0x9*(-parseInt(_0x43d3b7(0x125))/0xa);if(_0x11731b===_0x193ebe)break;else _0x5a5de1['push'](_0x5a5de1['shift']());}catch(_0x327048){_0x5a5de1['push'](_0x5a5de1['shift']());}}}(a156_0x220c,0xe7f5a));function a156_0x357f(_0x537ce2,_0x5860d5){_0x537ce2=_0x537ce2-0xef;const _0x220c8d=a156_0x220c();let _0x357fd7=_0x220c8d[_0x537ce2];return _0x357fd7;}import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x1b1f5a,_0x25c622={},_0x2e6687={}){const _0x27a686=a156_0x357f;if(_0x2e6687[_0x27a686(0x11a)])return runSemanticChecks(_0x1b1f5a,_0x25c622);const _0x2bc94=SegmentDefSchema[_0x27a686(0x11e)](_0x1b1f5a);if(_0x2bc94[_0x27a686(0x119)])return runSemanticChecks(_0x2bc94[_0x27a686(0x113)],_0x25c622);return zodErrorsToValidationResult(_0x2bc94['error'],_0x25c622);}export function validateRuleDef(_0x682835,_0x199331,_0x573c07){const _0x2d9e8a=a156_0x357f;if(!_0x682835)return[];const _0x414752=RuleDefSchema['safeParse'](_0x682835);if(_0x414752['success'])return checkRule(_0x414752[_0x2d9e8a(0x113)],_0x199331,_0x573c07);const _0x328572=flattenZodIssues(_0x414752['error'][_0x2d9e8a(0x137)]);return _0x328572[_0x2d9e8a(0x129)](_0x862f09=>{const _0x46f1c8=_0x2d9e8a,_0x2d6ec0=formatZodPath(_0x862f09[_0x46f1c8(0x133)]),_0x539044=_0x2d6ec0?_0x199331+'.'+_0x2d6ec0:_0x199331,_0x223f9c=mapZodIssueToCode(_0x862f09,_0x2d6ec0),_0x1e81a7=getLocationFromPath(_0x573c07[_0x46f1c8(0xff)],_0x573c07[_0x46f1c8(0x106)],pathToArray(_0x539044));return{'level':_0x46f1c8(0x120),'path':_0x539044,'code':_0x223f9c,'message':_0x862f09[_0x46f1c8(0x136)],..._0x1e81a7&&{'location':_0x1e81a7}};});}function zodErrorsToValidationResult(_0x481c12,_0xf0dfd0){const _0xc454a=a156_0x357f,_0x1d7694=flattenZodIssues(_0x481c12[_0xc454a(0x137)]),_0x5bf916=_0x1d7694[_0xc454a(0x129)](_0x23487e=>{const _0x20963f=_0xc454a,_0xb56a2c=formatZodPath(_0x23487e[_0x20963f(0x133)]),_0x58682e=mapZodIssueToCode(_0x23487e,_0xb56a2c),_0x2810bd=getLocationFromPath(_0xf0dfd0[_0x20963f(0xff)],_0xf0dfd0[_0x20963f(0x106)],_0x23487e[_0x20963f(0x133)][_0x20963f(0x129)](_0x4a5319=>typeof _0x4a5319==='symbol'?String(_0x4a5319):_0x4a5319));return{'level':_0x20963f(0x120),'path':_0xb56a2c,'code':_0x58682e,'message':_0x23487e[_0x20963f(0x136)],..._0x2810bd&&{'location':_0x2810bd}};});return{'valid':![],'errors':_0x5bf916,'warnings':[]};}function mapZodIssueToCode(_0x5a61b2,_0x4e14ca){const _0x1caeca=a156_0x357f,_0x56512f=_0x5a61b2['code']===_0x1caeca(0xf0)?_0x5a61b2[_0x1caeca(0x131)]:undefined;if(_0x4e14ca===_0x1caeca(0xf9))return _0x1caeca(0xef);if(_0x4e14ca===_0x1caeca(0xf7)||_0x4e14ca['endsWith'](_0x1caeca(0xf6))){if(_0x5a61b2[_0x1caeca(0x114)]===_0x1caeca(0x121)){if(_0x4e14ca===_0x1caeca(0xf7)||_0x4e14ca[_0x1caeca(0xf3)](/\.conditions\[\d+\]\.type$/))return _0x1caeca(0xfd);}}if(_0x4e14ca[_0x1caeca(0x11b)](_0x1caeca(0x101)))return _0x1caeca(0x108);if(_0x4e14ca[_0x1caeca(0x11b)]('.operator.value'))return _0x1caeca(0x115);if(_0x56512f?.['validationCode']==='MISSING_BETWEEN_BOUNDS')return _0x1caeca(0x127);if(_0x56512f?.[_0x1caeca(0x10f)]===_0x1caeca(0x118))return _0x1caeca(0x118);if(_0x4e14ca[_0x1caeca(0x11b)](_0x1caeca(0xfe))||_0x4e14ca===_0x1caeca(0x112))return'MISSING_CONDITIONS';if(_0x4e14ca[_0x1caeca(0x116)](_0x1caeca(0xf8)))return'INVALID_ARRAY_MATCHING';if(_0x4e14ca['endsWith'](_0x1caeca(0x12d)))return _0x1caeca(0x10d);return _0x1caeca(0x103);}function runSemanticChecks(_0x1ad1d6,_0x1727ec){const _0x44ccd1=a156_0x357f,_0x2e1793=[];_0x1ad1d6[_0x44ccd1(0xf4)]&&_0x2e1793[_0x44ccd1(0xf2)](...checkRule(_0x1ad1d6[_0x44ccd1(0xf4)],_0x44ccd1(0xf4),_0x1727ec));const _0x37ba8c=_0x2e1793[_0x44ccd1(0x12c)](_0x4d7cbe=>_0x4d7cbe[_0x44ccd1(0x130)]===_0x44ccd1(0x120)),_0x5cf2bf=_0x2e1793['filter'](_0x56ad5a=>_0x56ad5a['level']===_0x44ccd1(0xfa));return{'valid':_0x37ba8c[_0x44ccd1(0x12e)]===0x0,'errors':_0x37ba8c,'warnings':_0x5cf2bf};}function checkRule(_0x58a3b8,_0x5ec7ea,_0x31a233){const _0x4cff03=a156_0x357f,_0x4a0e08=[];if(_0x58a3b8[_0x4cff03(0x112)][_0x4cff03(0x12e)]===0x0)return _0x4a0e08['push']({'level':_0x4cff03(0x120),'path':_0x5ec7ea+_0x4cff03(0xfe),'code':_0x4cff03(0xfc),'message':_0x4cff03(0x135),'location':getLocationFromPath(_0x31a233[_0x4cff03(0xff)],_0x31a233[_0x4cff03(0x106)],pathToArray(_0x5ec7ea+_0x4cff03(0xfe)))}),_0x4a0e08;return _0x4a0e08['push'](...checkConditions(_0x58a3b8[_0x4cff03(0x112)],_0x5ec7ea,_0x31a233)),_0x4a0e08;}function checkConditions(_0x584e78,_0x7ad27c,_0x260f8a){const _0x354e2b=a156_0x357f,_0x37e9c9=[];for(let _0x358892=0x0;_0x358892<_0x584e78['length'];_0x358892++){const _0x50cca8=_0x584e78[_0x358892],_0xcfebdf=_0x7ad27c+_0x354e2b(0x117)+_0x358892+']';_0x37e9c9[_0x354e2b(0xf2)](...checkCondition(_0x50cca8,_0xcfebdf,_0x260f8a));}return _0x37e9c9;}function checkCondition(_0x3e9e1d,_0x3fc554,_0x296942){const _0xe35093=a156_0x357f,_0x50ff36=[];if(_0x3e9e1d[_0xe35093(0x134)]==='And'||_0x3e9e1d[_0xe35093(0x134)]==='Or'){if(_0x3e9e1d['conditions'][_0xe35093(0x12e)]===0x0)_0x50ff36[_0xe35093(0xf2)]({'level':_0xe35093(0x120),'path':_0x3fc554+_0xe35093(0xfe),'code':'EMPTY_CONDITIONS','message':_0x3e9e1d['type']+_0xe35093(0x12f),'location':getLocationFromPath(_0x296942[_0xe35093(0xff)],_0x296942[_0xe35093(0x106)],pathToArray(_0x3fc554+'.conditions'))});else{const _0x3cee47=_0x3e9e1d['description']!==undefined;!_0x3cee47&&_0x50ff36[_0xe35093(0xf2)]({'level':_0xe35093(0xfa),'path':_0x3fc554,'code':_0xe35093(0x105),'message':_0x3e9e1d['type']+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+_0xe35093(0xf1)+_0xe35093(0x10e),'location':getLocationFromPath(_0x296942[_0xe35093(0xff)],_0x296942[_0xe35093(0x106)],pathToArray(_0x3fc554))}),_0x50ff36[_0xe35093(0xf2)](...checkConditions(_0x3e9e1d[_0xe35093(0x112)],_0x3fc554,_0x296942));}return _0x50ff36;}if(_0x3e9e1d[_0xe35093(0x134)]==='Value'||_0x3e9e1d[_0xe35093(0x134)]===_0xe35093(0x132)){const _0x312308=_0x3e9e1d,_0x56bd26=_0x312308['source'],_0x131934=_0x312308['aggregation'],_0x21a40d=_0x56bd26||_0x131934;(!_0x312308[_0xe35093(0x124)]||_0x312308[_0xe35093(0x124)]==='')&&(!_0x21a40d&&_0x50ff36[_0xe35093(0xf2)]({'level':_0xe35093(0x120),'path':_0x3fc554+'.attribute','code':_0xe35093(0x126),'message':'Attribute\x20name\x20cannot\x20be\x20empty','location':getLocationFromPath(_0x296942['document'],_0x296942[_0xe35093(0x106)],pathToArray(_0x3fc554+'.attribute'))}));_0x312308[_0xe35093(0x12c)]&&_0x50ff36[_0xe35093(0xf2)](...checkRule(_0x312308['filter'],_0x3fc554+'.filter',_0x296942));if(_0x312308[_0xe35093(0x106)]){const _0x520d7d=_0x312308[_0xe35093(0x124)]&&_0x312308[_0xe35093(0x124)]!=='';_0x520d7d&&!_0x312308[_0xe35093(0x12c)]&&_0x50ff36[_0xe35093(0xf2)]({'level':_0xe35093(0x120),'path':_0x3fc554+_0xe35093(0x11f),'code':_0xe35093(0x10c),'message':_0xe35093(0x109)+_0x312308['source']+_0xe35093(0x128)+_0x312308[_0xe35093(0x124)]+'\x27\x20'+_0xe35093(0x11c)+_0xe35093(0x10a)+_0xe35093(0x12b),'location':getLocationFromPath(_0x296942[_0xe35093(0xff)],_0x296942['source'],pathToArray(_0x3fc554+_0xe35093(0x11f)))}),_0x520d7d&&_0x312308[_0xe35093(0x12c)]&&_0x50ff36[_0xe35093(0xf2)]({'level':_0xe35093(0xfa),'path':_0x3fc554+_0xe35093(0x12a),'code':_0xe35093(0x100),'message':_0xe35093(0x11d)+_0x312308[_0xe35093(0x124)]+_0xe35093(0x102)+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x296942[_0xe35093(0xff)],_0x296942['source'],pathToArray(_0x3fc554+_0xe35093(0x12a)))});}}return _0x50ff36;}
|