@treasuredata/tdx 2026.3.26 → 2026.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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.d.ts +141 -2
- package/dist/commands/parent-segment-command.d.ts.map +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/parent-segment-command.js.map +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/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.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.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/client/cdp-api-client.d.ts +29 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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.d.ts +228 -0
- package/dist/sdk/personalization.d.ts.map +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/personalization.js.map +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.d.ts +57 -0
- package/dist/sdk/realtime.d.ts.map +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/realtime.js.map +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/cdp.d.ts +76 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/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/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 a142_0x469651=a142_0x3aac;(function(_0x53595a,_0x4fe9bd){const _0x4e0a4e=a142_0x3aac,_0xb5a311=_0x53595a();while(!![]){try{const _0x39b7dc=-parseInt(_0x4e0a4e(0x1df))/0x1+parseInt(_0x4e0a4e(0x173))/0x2+-parseInt(_0x4e0a4e(0x1fe))/0x3+parseInt(_0x4e0a4e(0x114))/0x4*(parseInt(_0x4e0a4e(0x199))/0x5)+parseInt(_0x4e0a4e(0x202))/0x6*(parseInt(_0x4e0a4e(0x1a4))/0x7)+parseInt(_0x4e0a4e(0x129))/0x8*(-parseInt(_0x4e0a4e(0x1b7))/0x9)+-parseInt(_0x4e0a4e(0x12f))/0xa*(-parseInt(_0x4e0a4e(0x11a))/0xb);if(_0x39b7dc===_0x4fe9bd)break;else _0xb5a311['push'](_0xb5a311['shift']());}catch(_0x4041d1){_0xb5a311['push'](_0xb5a311['shift']());}}}(a142_0x5e0e,0x6534c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x469651(0x146));export const PENDING_SEGMENT_PREFIX=a142_0x469651(0x124);export const PENDING_ACTIVATION_PREFIX=a142_0x469651(0x12a);export function createPendingSegmentId(_0x2d1baa){return''+PENDING_SEGMENT_PREFIX+_0x2d1baa+'__';}export function isPendingSegmentId(_0x99468){const _0x1470a2=a142_0x469651;return _0x99468[_0x1470a2(0x1b4)](PENDING_SEGMENT_PREFIX)&&!_0x99468[_0x1470a2(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x457c7e){const _0x3140cc=a142_0x469651;return _0x457c7e[_0x3140cc(0x12c)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0xbff275){return''+PENDING_ACTIVATION_PREFIX+_0xbff275+'__';}export function isPendingActivationId(_0x4299ce){const _0xd4ec53=a142_0x469651;return _0x4299ce[_0xd4ec53(0x1b4)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x55149c){return _0x55149c['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x9cb6fc,_0x526ada){const _0x526705=a142_0x469651,_0x4aa2f7=_0x9cb6fc+'::'+(_0x526ada['trim']()||'segment'),_0x2c6838=createHash(_0x526705(0x13d))['update'](_0x4aa2f7)[_0x526705(0x1a8)](_0x526705(0x156))['slice'](0x0,0xc);return _0x526705(0x145)+_0x2c6838;}export function ensureJourneyDefaults(_0x52250c){const _0x3435be=a142_0x469651;!_0x52250c[_0x3435be(0x1dc)]&&(_0x52250c[_0x3435be(0x1dc)]=''),!_0x52250c[_0x3435be(0x1f7)]&&(_0x52250c[_0x3435be(0x1f7)]='draft');}export function injectExistingStageIds(_0x87730a,_0x4c119f){const _0x4513d2=a142_0x469651,_0x522e90=new Map(_0x4c119f['map'](_0x401e62=>[_0x401e62['name'],_0x401e62['id']]));for(const _0x24dfec of _0x87730a){if(!_0x24dfec['id']){const _0x5a251b=_0x522e90[_0x4513d2(0x15d)](_0x24dfec[_0x4513d2(0x169)]);_0x5a251b&&(_0x24dfec['id']=_0x5a251b);}}}export function resolveTDFolderPath(_0x201672,_0x4e6d0f,_0x54b0a0){const _0x6e57a4=a142_0x469651;if(!_0x4e6d0f)return _0x201672;if(_0x201672===_0x54b0a0||_0x201672[_0x6e57a4(0x1b4)](_0x54b0a0+'/'))return _0x201672;return _0x201672?_0x54b0a0+'/'+_0x201672:_0x54b0a0;}export function addFoldersToCreate(_0xa103c1,_0x421e89,_0x13cb67){const _0x5439e7=a142_0x469651;if(!_0xa103c1)return;if(_0x421e89[_0x5439e7(0x1b3)](_0xa103c1))return;const _0x3292c7=_0xa103c1['split']('/');let _0x2676cd='';for(const _0x4243fe of _0x3292c7){_0x2676cd=_0x2676cd?_0x2676cd+'/'+_0x4243fe:_0x4243fe,!_0x421e89[_0x5439e7(0x1b3)](_0x2676cd)&&_0x13cb67[_0x5439e7(0x1f4)](_0x2676cd);}}export function sortFoldersByDepth(_0x5a77fc){const _0x23bcdf=a142_0x469651;return[..._0x5a77fc][_0x23bcdf(0x113)]((_0x4601ab,_0x576c21)=>{const _0x277e8d=_0x23bcdf,_0x473a42=(_0x4601ab[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)],_0xe81cdd=(_0x576c21[_0x277e8d(0x1f8)](/\//g)||[])[_0x277e8d(0x163)];return _0x473a42-_0xe81cdd;});}import*as a142_0x324021 from'yaml';import{readFileSync}from'fs';import a142_0x2c8ea3 from'path';import{isJourneyDef,parseYamlString as a142_0x505a2c,toYamlString as a142_0x334139,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(_0x1e8ec7){const _0x31f81a=a142_0x469651;if(Array[_0x31f81a(0x18f)](_0x1e8ec7))return'['+_0x1e8ec7['map'](_0xb831da=>stableStringify(_0xb831da))['join'](',')+']';if(_0x1e8ec7&&typeof _0x1e8ec7==='object'){const _0x2ddb71=_0x1e8ec7,_0x4c95e8=Object[_0x31f81a(0x11f)](_0x2ddb71)[_0x31f81a(0x113)](),_0x1b85dd=_0x4c95e8[_0x31f81a(0x1a9)](_0x58f209=>'\x22'+_0x58f209+'\x22:'+stableStringify(_0x2ddb71[_0x58f209]));return'{'+_0x1b85dd[_0x31f81a(0x1c0)](',')+'}';}const _0x4a1151=JSON[_0x31f81a(0x11b)](_0x1e8ec7);return _0x4a1151===undefined?_0x31f81a(0x1b5):_0x4a1151;}function activationSignature(_0x3b51a0){const _0x35acec=a142_0x469651,_0x135c79={'connection':_0x3b51a0[_0x35acec(0x120)],..._0x3b51a0[_0x35acec(0x134)]!==undefined&&{'all_columns':_0x3b51a0['all_columns']},..._0x3b51a0[_0x35acec(0x203)]!==undefined&&{'columns':_0x3b51a0['columns']},..._0x3b51a0[_0x35acec(0x192)]!==undefined&&{'behavior':_0x3b51a0[_0x35acec(0x192)]},..._0x3b51a0[_0x35acec(0x1ee)]!==undefined&&{'schedule':_0x3b51a0[_0x35acec(0x1ee)]},..._0x3b51a0[_0x35acec(0x161)]!==undefined&&{'notification':_0x3b51a0[_0x35acec(0x161)]},..._0x3b51a0[_0x35acec(0x16d)]!==undefined&&{'connector_config':_0x3b51a0[_0x35acec(0x16d)]},..._0x3b51a0[_0x35acec(0x153)]!==undefined&&{'activation_template_id':_0x3b51a0[_0x35acec(0x153)]}};return stableStringify(_0x135c79);}async function fetchSegment(_0x2ad254,_0x493897,_0x4a8295,_0x15de74){const _0x53cdcc=a142_0x469651,_0x2a7a5a=_0x15de74?.[_0x53cdcc(0x13c)](_0x211e00=>_0x211e00['id']===_0x4a8295);if(_0x2a7a5a)return _0x2a7a5a;try{return await _0x2ad254[_0x53cdcc(0x1c9)]['getSegment'](_0x493897,_0x4a8295);}catch(_0x2cfcc7){logger[_0x53cdcc(0x140)]('getSegment\x20failed\x20for\x20'+_0x4a8295+_0x53cdcc(0x20a)+_0x2cfcc7);try{return await _0x2ad254['segment'][_0x53cdcc(0x11e)](_0x4a8295);}catch(_0x40890e){return logger[_0x53cdcc(0x140)]('getSegmentEntity\x20also\x20failed\x20for\x20'+_0x4a8295+':\x20'+_0x40890e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x46b289,_0x5121f5,_0x3d4d7c){const _0x2359a5=a142_0x469651,_0x4e13b9=readPushRecovery(_0x46b289[_0x2359a5(0x135)]);if(_0x4e13b9?.['journeyName']===_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)])for(const [_0x47aa4c,_0x37297d]of Object[_0x2359a5(0x188)](_0x4e13b9[_0x2359a5(0x208)])){const _0x532e45=generateDeterministicJourneySegmentName(_0x46b289[_0x2359a5(0x1b1)][_0x2359a5(0x169)],_0x47aa4c);_0x37297d[_0x2359a5(0x1de)]===_0x532e45&&(_0x5121f5['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]),_0x3d4d7c['set'](_0x47aa4c,_0x37297d[_0x2359a5(0x207)]));}}async function createOrRecoverEmbeddedSegment(_0xf58401,_0x538207,_0x5cb579,_0xbc80db){const _0x4d9aa8=a142_0x469651;let _0x3078b8;try{_0x3078b8=await _0xf58401[_0x4d9aa8(0x1c9)][_0x4d9aa8(0x159)]({'name':_0x5cb579[_0x4d9aa8(0x16c)],'description':_0x5cb579['description'],'journeyId':_0x5cb579[_0x4d9aa8(0x175)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![],'parentFolderId':_0x5cb579[_0x4d9aa8(0x11d)],'audienceId':_0x5cb579['parentId']});}catch(_0x37e0e7){const _0x4ee024=_0x37e0e7 instanceof Error&&_0x37e0e7[_0x4d9aa8(0x1e1)][_0x4d9aa8(0x171)](_0x4d9aa8(0x1b6));if(_0x4ee024){const _0x4bdd4f=readPushRecovery(_0x538207[_0x4d9aa8(0x135)]),_0xb80682=_0x4bdd4f?.[_0x4d9aa8(0x1bc)]===_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)]?_0x4bdd4f['segments'][_0x5cb579[_0x4d9aa8(0x1e2)]]:undefined;if(_0xb80682?.['uniqueServerName']===_0x5cb579[_0x4d9aa8(0x16c)])await _0xf58401['segment'][_0x4d9aa8(0x142)](_0x5cb579[_0x4d9aa8(0x1e9)],_0xb80682[_0x4d9aa8(0x207)],{'description':_0x5cb579[_0x4d9aa8(0x1dc)],'rule':_0xbc80db(_0x5cb579[_0x4d9aa8(0x1ca)],!![]),'countPopulation':!![]}),_0x3078b8=_0xb80682[_0x4d9aa8(0x207)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x4d9aa8(0x182)+_0x5cb579[_0x4d9aa8(0x1e2)]+_0x4d9aa8(0x14a)+(_0x4d9aa8(0x215)+_0x538207['absolutePath']['replace'](/([^/]+)$/,_0x4d9aa8(0x1e6))+')\x20')+_0x4d9aa8(0x138),_0x37e0e7);}else throw _0x37e0e7;}return saveSegmentToPushRecovery(_0x538207['absolutePath'],_0x538207[_0x4d9aa8(0x1b1)][_0x4d9aa8(0x169)],_0x5cb579[_0x4d9aa8(0x1e2)],{'segmentId':_0x3078b8,'uniqueServerName':_0x5cb579[_0x4d9aa8(0x16c)],'createdAt':new Date()[_0x4d9aa8(0x1cc)]()}),_0x3078b8;}export async function prepareSegmentFiles(_0x2d8bd4,_0x45294d,_0x5c0f99,_0x165bce,_0x3b66ef){const _0x452590=a142_0x469651,{activationDefToCreateRequest:_0x5013ce}=await import('./child-segment-yaml.js'),_0x4ee814=[],_0x1254dd=new Set();for(const {yamlConfig:_0x22a55b,folderPath:_0x22ebde,sourcePath:_0x433a7b}of _0x2d8bd4){const _0x4bc02b=resolveTDFolderPath(_0x22ebde,_0x165bce,_0x3b66ef),_0x58a46c=_0x4bc02b+':'+_0x22a55b[_0x452590(0x169)],_0x471731=_0x45294d['segmentByFolderAndName']['get'](_0x58a46c),_0x4c7d1c=_0x471731?_0x45294d[_0x452590(0x1fd)][_0x452590(0x15d)](_0x471731['id'])||[]:[];addFoldersToCreate(_0x4bc02b,_0x45294d[_0x452590(0x168)],_0x1254dd);const _0x5c3994=calculateActivationActions(_0x22a55b[_0x452590(0x116)]||[],_0x4c7d1c,_0x45294d[_0x452590(0x12e)],_0x45294d['connectionIdToNameMap']);for(const _0x585941 of _0x5c3994){(_0x585941[_0x452590(0x17d)]===_0x452590(0x1be)||_0x585941['type']===_0x452590(0x1c7))&&_0x585941[_0x452590(0x1d9)]&&(_0x585941[_0x452590(0x128)]=await _0x5013ce(_0x585941[_0x452590(0x1d9)],_0x5c0f99));}const _0x90ac8=calculateSegmentDiff(_0x22a55b,_0x471731,_0x4c7d1c,_0x45294d['idToEmailMap'],_0x45294d['connectionIdToNameMap']);_0x4ee814[_0x452590(0x1cf)]({'relativePath':_0x22a55b['name'],'absolutePath':_0x433a7b,'yamlConfig':_0x22a55b,'folderPath':_0x4bc02b,'existingSegment':_0x471731,'existingActivations':_0x4c7d1c,'isNew':_0x90ac8[_0x452590(0x213)],'hasChanges':_0x90ac8[_0x452590(0x1c6)],'diff':_0x90ac8[_0x452590(0x12d)],'activationActions':_0x5c3994});}return{'segmentFiles':_0x4ee814,'foldersToCreate':_0x1254dd};}export async function prepareJourneyFiles(_0x3b6c77,_0x5075a6,_0x3958e4,_0x4cc364){const _0x106524=a142_0x469651,_0x2ca9a9=[],_0x5488da=new Set();for(const {yamlConfig:_0x5c5e19,folderPath:_0x24796b,sourcePath:_0x21ca79}of _0x3b6c77){const _0x25889b=resolveTDFolderPath(_0x24796b,_0x3958e4,_0x4cc364),_0xb69cd4=_0x25889b+':'+_0x5c5e19[_0x106524(0x169)],_0x325800=_0x5075a6['journeyBundlesByFolderAndName'][_0x106524(0x15d)](_0xb69cd4);let _0x39c8bc,_0x7deaa;if(_0x325800&&_0x325800['length']>0x0){const _0x4739a0=buildLocalExpandedRuleMappings(_0x5c5e19),{createYamlContext:_0x18e3dc,prefetchJourneySegments:_0x57d5fa}=createPushYamlContextForBundle(_0x5075a6[_0x106524(0x167)],_0x5075a6['parentId'],_0x5075a6[_0x106524(0x127)],_0x4739a0,_0x5075a6[_0x106524(0x12e)],_0x5075a6['connectionIdToNameMap'],_0x5075a6[_0x106524(0x160)],_0x5075a6[_0x106524(0x18e)]);await _0x57d5fa(_0x325800[_0x106524(0x1a9)](_0x2d9ac4=>_0x2d9ac4['id']));const _0x324d8b=await _0x5075a6[_0x106524(0x167)][_0x106524(0x130)][_0x106524(0x148)](_0x325800[0x0][_0x106524(0x1f0)]),_0xc801f2=hasMultipleVersions(_0x5c5e19),_0x544971=async _0x570b6e=>{const _0x340b3c=_0x106524,_0x497fee=_0x5075a6[_0x340b3c(0x18e)]?.[_0x340b3c(0x15d)](_0x570b6e);if(_0x497fee)return _0x497fee;return _0x5075a6[_0x340b3c(0x1f5)]({'journeyId':_0x570b6e,'journeyName':_0x5c5e19['name'],'isMultiVersion':_0x325800[_0x340b3c(0x163)]>0x1});};if(_0xc801f2&&_0x325800[_0x106524(0x163)]>0x1){const _0x2b169e=[];for(const _0x2d17f3 of _0x325800){const _0xc9f8a8=_0x2d17f3['versionNumber']||0x1;_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19['name']+'\x20v'+_0xc9f8a8);const _0x1792e9=await _0x544971(_0x2d17f3['id']),_0x3c0584=_0x18e3dc(_0x2d17f3['id']),_0x1d9732=await journeyResponseToDef(_0x1792e9,_0x3c0584);_0x2b169e[_0x106524(0x1cf)]({'item':_0x2d17f3,'yaml':_0x1d9732});}const _0x3834be=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef(_0x2b169e,_0x3834be,_0x324d8b);const _0x4a8064=Math[_0x106524(0x185)](..._0x2b169e[_0x106524(0x1a9)](_0x3e6061=>_0x3e6061[_0x106524(0x122)][_0x106524(0x166)]||0x0)),_0xd05f73=_0x325800[_0x106524(0x13c)](_0x35ef17=>(_0x35ef17[_0x106524(0x166)]||0x0)===_0x4a8064);_0xd05f73&&(_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)](_0x106524(0x1a3)+_0x5c5e19[_0x106524(0x169)]+'\x20v'+_0x4a8064),_0x39c8bc=await _0x544971(_0xd05f73['id']));}else{const _0x154689=_0x325800[_0x325800[_0x106524(0x163)]-0x1];_0x5075a6[_0x106524(0x187)]?.[_0x106524(0x1c7)]('Fetching\x20'+_0x5c5e19[_0x106524(0x169)]),_0x39c8bc=await _0x544971(_0x154689['id']);const _0x20f47c=_0x18e3dc(_0x154689['id']),_0x4a5b8e=await journeyResponseToDef(_0x39c8bc,_0x20f47c),_0x2b57b0=buildLocalRuleToNameMappingFromJourney(_0x5c5e19);_0x7deaa=buildMergedJourneyDef([{'item':_0x154689,'yaml':_0x4a5b8e}],_0x2b57b0,_0x324d8b);}}addFoldersToCreate(_0x25889b,_0x5075a6['folderPathToId'],_0x5488da);const _0x52618a=calculateJourneyDiff(_0x5c5e19,_0x7deaa);_0x2ca9a9[_0x106524(0x1cf)]({'relativePath':_0x5c5e19['name'],'absolutePath':_0x21ca79,'yamlConfig':_0x5c5e19,'folderPath':_0x25889b,'existingJourney':_0x39c8bc,'isNew':_0x52618a[_0x106524(0x213)],'hasChanges':_0x52618a[_0x106524(0x1c6)],'diff':_0x52618a[_0x106524(0x12d)]});}return{'journeyFiles':_0x2ca9a9,'foldersToCreate':_0x5488da};}export function calculateActivationActions(_0x4f9d71,_0x462ce2,_0x252036,_0x37055d){const _0x3b6e67=a142_0x469651,_0x598f2d=[],_0x46f5c1=new Map();for(const _0x525988 of _0x462ce2){_0x46f5c1[_0x3b6e67(0x17c)](_0x525988['name'],_0x525988);}const _0x3e0321=new Map();for(const _0x89a0fd of _0x4f9d71){_0x3e0321['set'](_0x89a0fd[_0x3b6e67(0x169)],_0x89a0fd);}for(const _0x48c086 of _0x4f9d71){const _0x23781e=_0x46f5c1[_0x3b6e67(0x15d)](_0x48c086[_0x3b6e67(0x169)]);if(!_0x23781e)_0x598f2d[_0x3b6e67(0x1cf)]({'type':'create','name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086});else{const _0x34edb3=activationResponseToDef(_0x23781e,_0x252036,_0x37055d),_0x230884=a142_0x324021[_0x3b6e67(0x11b)](_0x34edb3),_0x42b268=a142_0x324021[_0x3b6e67(0x11b)](_0x48c086);_0x230884!==_0x42b268&&_0x598f2d[_0x3b6e67(0x1cf)]({'type':_0x3b6e67(0x1c7),'name':_0x48c086[_0x3b6e67(0x169)],'yamlActivation':_0x48c086,'existingActivation':_0x23781e});}}for(const _0x4e3948 of _0x462ce2){!_0x3e0321[_0x3b6e67(0x1b3)](_0x4e3948[_0x3b6e67(0x169)])&&_0x598f2d['push']({'type':_0x3b6e67(0x1dd),'name':_0x4e3948[_0x3b6e67(0x169)],'existingActivation':_0x4e3948});}return _0x598f2d;}function calculateYamlDiff(_0x20a9e5,_0x1029fe){if(_0x1029fe){const _0x525da6=generateDiff(_0x1029fe,_0x20a9e5),_0x1841e0=hasChanges(_0x525da6);return{'isNew':![],'hasChanges':_0x1841e0,'diff':_0x1841e0?formatDiffWithColors(_0x525da6):undefined};}const _0x29c07c=generateDiff('',_0x20a9e5);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x29c07c)};}export function calculateSegmentDiff(_0x21a487,_0x231fc8,_0x524287,_0x33638a,_0x1d02f0){const _0xadea68=segmentToYamlString(_0x21a487),_0x4aca86=_0x231fc8?segmentToYamlString(segmentWithActivationsToYaml(_0x231fc8,_0x524287,undefined,_0x33638a,_0x1d02f0)):undefined;return calculateYamlDiff(_0xadea68,_0x4aca86);}export function calculateJourneyDiff(_0x44228e,_0x524437){const _0x4b1f49=normalizeJourneyDef(_0x44228e,_0x44228e),_0x42049a=a142_0x334139(_0x4b1f49),_0x123ad1=_0x524437?a142_0x334139(normalizeJourneyDef(_0x524437,_0x44228e)):undefined;return calculateYamlDiff(_0x42049a,_0x123ad1);}export function findSegmentsToDelete(_0x46f04a,_0x1a7a7d,_0x53772a,_0x35a555,_0xd4a685){const _0x20f763=a142_0x469651,_0x3ec932=new Set();for(const {yamlConfig:_0x4b9ad9,folderPath:_0x279c36}of _0x1a7a7d){_0x3ec932['add'](_0x279c36+':'+_0x4b9ad9[_0x20f763(0x169)]);}return _0x46f04a['filter'](_0x5974c8=>{const _0x150ad9=_0x20f763,_0x3e006c=_0x5974c8[_0x150ad9(0x1eb)]?_0x53772a['get'](_0x5974c8[_0x150ad9(0x1eb)]['toString']())||'':'',_0x4205d8=_0x3e006c+':'+_0x5974c8[_0x150ad9(0x169)];if(_0x3ec932[_0x150ad9(0x1b3)](_0x4205d8))return![];if(_0xd4a685)return _0x3e006c===_0x35a555||_0x3e006c[_0x150ad9(0x1b4)](_0x35a555+'/');return!![];});}export function findJourneysToDelete(_0x6af268,_0x52d09f,_0x513c6c,_0x3c9091,_0x3d143f){const _0x3710ef=a142_0x469651,_0xde9ae4=new Set();for(const {yamlConfig:_0x4987a2,folderPath:_0x7f70b1}of _0x52d09f){_0xde9ae4[_0x3710ef(0x1f4)](_0x7f70b1+':'+_0x4987a2['name']);}return _0x6af268[_0x3710ef(0x19c)](_0x13e0da=>{const _0x1f28bc=_0x3710ef,_0x5b1ffb=_0x13e0da[_0x1f28bc(0x11d)]?_0x513c6c[_0x1f28bc(0x15d)](_0x13e0da[_0x1f28bc(0x11d)])||'':'',_0xc042d6=_0x5b1ffb+':'+_0x13e0da[_0x1f28bc(0x17e)];if(_0xde9ae4['has'](_0xc042d6))return![];if(_0x3d143f)return _0x5b1ffb===_0x3c9091||_0x5b1ffb[_0x1f28bc(0x1b4)](_0x3c9091+'/');return!![];});}export function buildSegmentLookupMap(_0x59fc59,_0x5c97f6){const _0x335145=a142_0x469651,_0x11c99b=new Map();for(const _0xf1bbfe of _0x59fc59){const _0x3bff59=_0xf1bbfe[_0x335145(0x1eb)]?_0x5c97f6[_0x335145(0x15d)](_0xf1bbfe[_0x335145(0x1eb)]['toString']())||'':'',_0x4391b6=_0x3bff59+':'+_0xf1bbfe[_0x335145(0x169)];_0x11c99b[_0x335145(0x17c)](_0x4391b6,_0xf1bbfe);}return _0x11c99b;}export function buildSegmentNameToIdMap(_0x54930b){const _0x371868=a142_0x469651,_0x54095e=new Map();for(const _0x4500cb of _0x54930b){_0x54095e[_0x371868(0x17c)](_0x4500cb[_0x371868(0x169)],_0x4500cb['id']);}return _0x54095e;}export function buildJourneyBundleLookupMap(_0x421f9b,_0x1d7d1f){const _0xef661e=a142_0x469651,_0x5d6a08=new Map();for(const _0x46db5f of _0x421f9b){const _0x3c5443=_0x46db5f[_0xef661e(0x11d)]?_0x1d7d1f[_0xef661e(0x15d)](_0x46db5f[_0xef661e(0x11d)])||'':'',_0x4b1859=_0x3c5443+':'+_0x46db5f[_0xef661e(0x17e)];!_0x5d6a08[_0xef661e(0x1b3)](_0x4b1859)&&_0x5d6a08[_0xef661e(0x17c)](_0x4b1859,[]),_0x5d6a08[_0xef661e(0x15d)](_0x4b1859)[_0xef661e(0x1cf)](_0x46db5f);}for(const _0x4db898 of _0x5d6a08[_0xef661e(0x20f)]()){_0x4db898['sort']((_0x2c2d72,_0x2cc121)=>(_0x2c2d72['versionNumber']||0x0)-(_0x2cc121[_0xef661e(0x166)]||0x0));}return _0x5d6a08;}export function collectFoldersToCreate(_0xae2e3e,_0x4afc32){const _0xc3a7c8=a142_0x469651,_0x287181=new Set();for(const _0x1e8bfe of _0xae2e3e){if(!_0x1e8bfe)continue;if(_0x4afc32['has'](_0x1e8bfe))continue;const _0x3cc8a6=_0x1e8bfe[_0xc3a7c8(0x214)]('/');let _0x38b027='';for(const _0x4120c0 of _0x3cc8a6){_0x38b027=_0x38b027?_0x38b027+'/'+_0x4120c0:_0x4120c0,!_0x4afc32[_0xc3a7c8(0x1b3)](_0x38b027)&&_0x287181[_0xc3a7c8(0x1f4)](_0x38b027);}}return _0x287181;}export function parseAndClassifyYamlFiles(_0x326afa,_0x381af3,_0x6fddb8){const _0x5adc3f=a142_0x469651,_0x12a801=[],_0x6ef763=[];for(const _0x2f3bbd of _0x326afa){const _0x362c75=a142_0x2c8ea3[_0x5adc3f(0x1b0)](_0x381af3,a142_0x2c8ea3['dirname'](_0x2f3bbd)),_0x5ebeba=_0x362c75==='.'?'':_0x362c75,_0x558b06=readFileSync(_0x2f3bbd,_0x5adc3f(0x1d8)),_0x39224b=a142_0x324021['parse'](_0x558b06);if(isJourneyDef(_0x39224b)){const _0x13140f=a142_0x505a2c(_0x558b06);_0x6ef763['push']({'yamlConfig':_0x13140f,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}else{if(!_0x6fddb8?.[_0x5adc3f(0x152)]){const _0x392247=parseSegmentYamlFile(_0x558b06),_0x27ff97=normalizeChildSegmentYaml(_0x392247);_0x12a801[_0x5adc3f(0x1cf)]({'yamlConfig':_0x27ff97,'folderPath':_0x5ebeba,'sourcePath':_0x2f3bbd});}}}return{'segments':_0x12a801,'journeys':_0x6ef763};}export function validateParsedFiles(_0x43e818,_0x7b9ef){const _0x1eba61=a142_0x469651,_0x192146=[];for(const {yamlConfig:_0x5b93df,sourcePath:_0x1b63e8}of _0x43e818[_0x1eba61(0x208)]){const _0x3fe749=readFileSync(_0x1b63e8,_0x1eba61(0x1d8)),_0x2ce464=a142_0x324021[_0x1eba61(0x1c4)](_0x3fe749),_0x1f6ad5=validateSegmentDef(_0x5b93df,{'source':_0x3fe749,'document':_0x2ce464},{'skipSchema':!![]});if(!_0x1f6ad5[_0x1eba61(0x1d2)]){const _0xd0add8=a142_0x2c8ea3['relative'](_0x7b9ef,_0x1b63e8);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0xd0add8,'source':_0x3fe749,'result':_0x1f6ad5,'isJourney':![]});}}for(const {yamlConfig:_0x44cb1e,sourcePath:_0x299f46}of _0x43e818[_0x1eba61(0x1e5)]){const _0x38b827=readFileSync(_0x299f46,_0x1eba61(0x1d8)),_0x410a1f=a142_0x324021[_0x1eba61(0x1c4)](_0x38b827),_0x13e245=validateJourneyDef(_0x44cb1e,{'source':_0x38b827,'document':_0x410a1f},{'skipSchema':!![]});if(!_0x13e245[_0x1eba61(0x1d2)]){const _0x222797=a142_0x2c8ea3['relative'](_0x7b9ef,_0x299f46);_0x192146[_0x1eba61(0x1cf)]({'filePath':_0x222797,'source':_0x38b827,'result':_0x13e245,'isJourney':!![]});}}return _0x192146;}export function formatValidationErrors(_0x2af6fd){const _0x433bc9=a142_0x469651,_0x293541=[];for(const {filePath:_0x157f3d,source:_0x4eb649,result:_0x50f282,isJourney:_0x25b0c5}of _0x2af6fd){const _0x15a52a=_0x25b0c5?_0x433bc9(0x130):_0x433bc9(0x1c9);_0x293541[_0x433bc9(0x1cf)]('\x0a'+_0x157f3d+'\x20('+_0x15a52a+'):\x20'+_0x50f282['errors'][_0x433bc9(0x163)]+'\x20error(s)'),_0x293541[_0x433bc9(0x1cf)](formatValidationResult(_0x50f282,_0x4eb649,_0x157f3d));}return _0x293541[_0x433bc9(0x1c0)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x37f0e7){const _0xed1367=a142_0x469651,_0x46e995=new Set(),_0x444d25=new Map(),_0x53632b=collectSegmentUsageCounts(_0x37f0e7);if(_0x37f0e7[_0xed1367(0x208)])for(const [_0x597538,_0xe0555d]of Object[_0xed1367(0x188)](_0x37f0e7[_0xed1367(0x208)])){_0x46e995[_0xed1367(0x1f4)](_0x597538);if(_0xe0555d[_0xed1367(0x1a0)]){const _0xad3e48=yamlRuleToApi(_0xe0555d['rule']),_0x5a377c=apiRuleToYaml(_0xad3e48);_0x444d25[_0xed1367(0x17c)](_0x597538,_0x5a377c);}}const _0x7b6306=new Map();let _0xf67142=0x0;for(const [_0x509f62,_0x1e4c93]of _0x444d25){const _0xa9ad5c=serializeExpandedRule(_0x1e4c93,_0x444d25),_0x26b8cf=_0x7b6306[_0xed1367(0x15d)](_0xa9ad5c)||[];_0x26b8cf[_0xed1367(0x1cf)]({'name':_0x509f62,'index':_0xf67142}),_0x7b6306['set'](_0xa9ad5c,_0x26b8cf),_0xf67142++;}const _0xcc7199=new Map();for(const [_0x55e698,_0x34b681]of _0x7b6306){const _0x14d6f1=_0x34b681[_0xed1367(0x19b)]()[_0xed1367(0x113)]((_0x5c1483,_0x2f3576)=>{const _0x50e278=_0xed1367,_0x37a616=_0x53632b[_0x50e278(0x15d)](_0x5c1483[_0x50e278(0x169)])||0x0,_0x474aea=_0x53632b['get'](_0x2f3576[_0x50e278(0x169)])||0x0;if(_0x37a616!==_0x474aea)return _0x474aea-_0x37a616;return _0x5c1483['index']-_0x2f3576[_0x50e278(0x123)];})[_0xed1367(0x1a9)](_0x14c017=>_0x14c017['name']),_0x222b82=[];for(const _0x3cf16b of _0x14d6f1){const _0x4147fc=_0x53632b[_0xed1367(0x15d)](_0x3cf16b)||0x0,_0x1427cd=Math[_0xed1367(0x185)](_0x4147fc,0x1);for(let _0x2b4596=0x0;_0x2b4596<_0x1427cd;_0x2b4596++){_0x222b82['push'](_0x3cf16b);}}_0xcc7199['set'](_0x55e698,_0x222b82);}return{'existingLocalSegmentNames':_0x46e995,'localSegmentRules':_0x444d25,'localExpandedRuleToNames':_0xcc7199};}export function createSegmentIdResolver(_0x574a46,_0x3e0d8d){return async _0x28699f=>{const _0x312993=a142_0x3aac,_0x370d22=_0x574a46[_0x312993(0x15d)](_0x28699f);if(!_0x370d22)throw new SDKError(ErrorCode[_0x312993(0x212)],_0x312993(0x1d1)+_0x28699f+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x3e0d8d+'\x27)');return _0x370d22;};}export function extractRootFolderId(_0x581a07){const _0xcd6592=a142_0x469651;return _0x581a07['relationships']?.[_0xcd6592(0x1a5)]?.[_0xcd6592(0x143)]?.['id']||_0x581a07['relationships']?.[_0xcd6592(0x1ae)]?.[_0xcd6592(0x143)]?.['id'];}export function buildConnectionMaps(_0x3a1f34){const _0x43a9da=a142_0x469651,_0x2acb0d=new Map(),_0x2b0171=new Map(),_0x2d3ceb=new Map();for(const _0x5260d3 of _0x3a1f34){_0x2acb0d[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],parseInt(_0x5260d3['id'],0xa)),_0x2b0171[_0x43a9da(0x17c)](_0x5260d3['id'],_0x5260d3['name']),_0x2d3ceb[_0x43a9da(0x17c)](_0x5260d3[_0x43a9da(0x169)],_0x5260d3[_0x43a9da(0x17d)]);}return{'nameToId':_0x2acb0d,'idToName':_0x2b0171,'nameToType':_0x2d3ceb};}export function calculatePushStats(_0x26ab9f,_0x4e96cb,_0x34715e,_0x41448f,_0x3f56de,_0x235c62,_0x584868){const _0x3040ff=a142_0x469651,_0x384ec1=_0x26ab9f[_0x3040ff(0x19c)](_0x272fda=>_0x272fda[_0x3040ff(0x213)]),_0x691cf6=_0x26ab9f[_0x3040ff(0x19c)](_0x2197bf=>!_0x2197bf[_0x3040ff(0x213)]&&_0x2197bf[_0x3040ff(0x1c6)]),_0x4ac0ef=_0x26ab9f[_0x3040ff(0x19c)](_0x4d99e2=>!_0x4d99e2[_0x3040ff(0x213)]&&!_0x4d99e2[_0x3040ff(0x1c6)]),_0x547d2f=_0x235c62?_0x41448f:[],_0x39f31a=_0x4e96cb[_0x3040ff(0x19c)](_0x4a5558=>_0x4a5558[_0x3040ff(0x213)]),_0x542821=_0x4e96cb[_0x3040ff(0x19c)](_0x4bc055=>!_0x4bc055[_0x3040ff(0x213)]&&_0x4bc055[_0x3040ff(0x1c6)]),_0x39c178=_0x4e96cb[_0x3040ff(0x19c)](_0xf9e720=>!_0xf9e720[_0x3040ff(0x213)]&&!_0xf9e720['hasChanges']),_0x16c463=_0x235c62?_0x3f56de:[],_0x41f170=_0x26ab9f[_0x3040ff(0x1e7)](_0x5ca6fb=>_0x5ca6fb['activationActions']),_0x5f7727=_0x41f170[_0x3040ff(0x19c)](_0x159048=>_0x159048['type']==='create'),_0x431eb4=_0x41f170[_0x3040ff(0x19c)](_0x321cd6=>_0x321cd6['type']==='update'),_0x6d0d46=_0x41f170['filter'](_0xa7661b=>_0xa7661b[_0x3040ff(0x17d)]===_0x3040ff(0x1dd)),_0x5e7049=Array[_0x3040ff(0x1c2)](_0x34715e)[_0x3040ff(0x113)](),_0x23996f=_0x584868?![]:_0x384ec1[_0x3040ff(0x163)]>0x0||_0x691cf6[_0x3040ff(0x163)]>0x0||_0x547d2f[_0x3040ff(0x163)]>0x0,_0x5188c2=_0x39f31a[_0x3040ff(0x163)]>0x0||_0x542821[_0x3040ff(0x163)]>0x0||_0x16c463[_0x3040ff(0x163)]>0x0,_0x2a1db7=_0x584868?![]:_0x41f170['length']>0x0,_0x45e8dc=_0x5e7049['length']>0x0;return{'segments':{'new':_0x384ec1,'changed':_0x691cf6,'unchanged':_0x4ac0ef,'toDelete':_0x547d2f},'journeys':{'new':_0x39f31a,'changed':_0x542821,'unchanged':_0x39c178,'toDelete':_0x16c463},'activations':{'all':_0x41f170,'toCreate':_0x5f7727,'toUpdate':_0x431eb4,'toDelete':_0x6d0d46},'folders':{'toCreate':_0x5e7049},'counts':{'segments':{'new':_0x384ec1[_0x3040ff(0x163)],'changed':_0x691cf6[_0x3040ff(0x163)],'unchanged':_0x4ac0ef[_0x3040ff(0x163)],'toDelete':_0x547d2f[_0x3040ff(0x163)]},'journeys':{'new':_0x39f31a[_0x3040ff(0x163)],'changed':_0x542821['length'],'unchanged':_0x39c178[_0x3040ff(0x163)],'toDelete':_0x16c463['length']},'activations':{'create':_0x5f7727[_0x3040ff(0x163)],'update':_0x431eb4[_0x3040ff(0x163)],'delete':_0x6d0d46[_0x3040ff(0x163)]},'folders':_0x5e7049[_0x3040ff(0x163)]},'hasChanges':_0x23996f||_0x5188c2||_0x2a1db7||_0x45e8dc};}export async function buildPushExecutionContext(_0x4ff57d,_0x241dc8,_0x3ddbbe,_0x5a029a,_0x558d97,_0xa7a9f9){const _0x4f1539=a142_0x469651,_0x4dacc3=extractRootFolderId(_0x3ddbbe),{pathToId:_0xd0618b,idToPath:_0x213072}=buildFolderMaps(_0x558d97),_0x580208=buildSegmentNameToIdMap(_0x5a029a),_0x2a47f8=new Map(),{batchAsync:_0x10a276}=await import(_0x4f1539(0x162)),[_0x3cf348,_0x585819]=await Promise[_0x4f1539(0x14f)]([_0x4ff57d[_0x4f1539(0x121)]['buildUserMaps'](),_0x4ff57d[_0x4f1539(0x120)][_0x4f1539(0x1d0)](),((async()=>{const _0x26b2f3=_0x4f1539;!_0xa7a9f9&&_0x5a029a[_0x26b2f3(0x163)]>0x0&&await _0x10a276(_0x5a029a,async _0x4a3b28=>{const _0x418baa=_0x26b2f3,_0x5b63cf=await _0x4ff57d[_0x418baa(0x1c9)]['listActivations'](_0x241dc8,_0x4a3b28['id']);_0x2a47f8[_0x418baa(0x17c)](_0x4a3b28['id'],_0x5b63cf);});})())]),{emailToId:_0xc7fe42,idToEmail:_0x36fb6b}=_0x3cf348,_0x57b654=buildConnectionMaps(_0x585819);return{'rootFolderId':_0x4dacc3,'folderPathToId':_0xd0618b,'folderIdToPath':_0x213072,'segmentNameToId':_0x580208,'activationsBySegmentId':_0x2a47f8,'emailToIdMap':_0xc7fe42,'idToEmailMap':_0x36fb6b,'connectionNameToIdMap':_0x57b654[_0x4f1539(0x179)],'connectionIdToNameMap':_0x57b654[_0x4f1539(0x136)],'connectionNameToTypeMap':_0x57b654[_0x4f1539(0x165)]};}export function createPushYamlContextForBundle(_0x52e753,_0x44f456,_0x13a2c9,_0x414b2b,_0x1f3450,_0x4cd951,_0x214826,_0x4d07dc){const {existingLocalSegmentNames:_0x346be9,localExpandedRuleToNames:_0x3f390e}=_0x414b2b,_0x546a05=new Set(),_0x35701f=new Map(),_0xd610d3=new Map(),_0x5b151b=new Map(),_0x336fac=createJumpTargetCache(),_0x399272=new Map(),_0x503a8f=new Map(),_0x2a8c0f=new Set();let _0x37966e;const _0xcf52e6=_0x142f40=>{const _0x473d05={'resolveSegment':async _0x4a9420=>{const _0x594161=a142_0x3aac,_0x12746a=_0x5b151b[_0x594161(0x15d)](_0x4a9420);if(_0x12746a!==undefined)return{'name':_0x12746a,'isJourneyLocal':!![]};try{const _0x2340f4=await fetchSegment(_0x52e753,_0x44f456,_0x4a9420,_0x13a2c9);if(!_0x2340f4)throw new Error(_0x594161(0x20c));const _0x3c5d0c=generateJourneyLocalName(_0x2340f4['name']),_0x12c74d=_0x2340f4['kind']===SEGMENT_KIND_JOURNEY&&_0x3c5d0c!==undefined;let _0x3173cf=_0x2340f4[_0x594161(0x169)],_0x25d86a;if(_0x12c74d&&_0x2340f4[_0x594161(0x1a0)]){const _0x281677=apiRuleToYaml(_0x2340f4[_0x594161(0x1a0)]);_0x503a8f[_0x594161(0x17c)](_0x4a9420,_0x281677);const _0x2a9c2f=async _0x27691e=>{const _0x2179bf=_0x594161,_0x5e5325=collectSegmentRefsFromRule(_0x27691e);for(const _0x10c832 of _0x5e5325){if(!_0x503a8f[_0x2179bf(0x1b3)](_0x10c832))try{const _0x3ed453=await fetchSegment(_0x52e753,_0x44f456,_0x10c832,_0x13a2c9);if(_0x3ed453?.[_0x2179bf(0x1a0)]){const _0xc1dbc0=apiRuleToYaml(_0x3ed453[_0x2179bf(0x1a0)]);_0x503a8f[_0x2179bf(0x17c)](_0x10c832,_0xc1dbc0),await _0x2a9c2f(_0xc1dbc0);}}catch(_0x204b8d){logger[_0x2179bf(0x140)](_0x2179bf(0x201)+_0x10c832+':\x20'+_0x204b8d);}}};await _0x2a9c2f(_0x281677);const _0x157668=serializeExpandedRule(_0x281677,_0x503a8f),_0x2d87a1=_0x3f390e['get'](_0x157668);if(_0x2d87a1&&_0x2d87a1[_0x594161(0x163)]>0x0){const _0x3bcfb1=_0x35701f[_0x594161(0x15d)](_0x157668)||0x0,_0x40d99c=_0x2d87a1[_0x3bcfb1]||_0x2d87a1[_0x2d87a1[_0x594161(0x163)]-0x1];_0x35701f['set'](_0x157668,_0x3bcfb1+0x1),_0x3173cf=_0x40d99c,_0x546a05['add'](_0x3173cf),_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf);const _0x2947e7=await resolveRuleSegmentRefs(_0x281677,async _0x26d491=>{const _0x43e65d=_0x594161,_0x3fe8f6=_0x5b151b['get'](_0x26d491);if(_0x3fe8f6)return _0x3fe8f6;const _0x717791=await _0x37966e['resolveSegment'](_0x26d491);return _0x717791[_0x43e65d(0x169)];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x2947e7};}else{const _0x2eb804=_0x399272[_0x594161(0x15d)](_0x157668);if(_0x2eb804)_0x3173cf=_0x2eb804,_0x5b151b['set'](_0x4a9420,_0x3173cf);else{if(_0x3c5d0c){let _0x21985c=_0x3c5d0c,_0x9997ba=0x2;while(_0x546a05[_0x594161(0x1b3)](_0x21985c)||_0x346be9[_0x594161(0x1b3)](_0x21985c)){_0x21985c=_0x3c5d0c+'_'+_0x9997ba,_0x9997ba++;}_0x546a05[_0x594161(0x1f4)](_0x21985c),_0x3173cf=_0x21985c;}_0x5b151b[_0x594161(0x17c)](_0x4a9420,_0x3173cf),_0x399272[_0x594161(0x17c)](_0x157668,_0x3173cf);const _0x59ad22=await resolveRuleSegmentRefs(_0x281677,async _0x24bdf=>{const _0x965c41=_0x594161,_0x46c29a=_0x5b151b[_0x965c41(0x15d)](_0x24bdf);if(_0x46c29a)return _0x46c29a;const _0x21c1d8=await _0x37966e[_0x965c41(0x118)](_0x24bdf);return _0x21c1d8['name'];});_0x25d86a={'description':_0x2340f4[_0x594161(0x1dc)],'rule':_0x59ad22};}}}return{'name':_0x3173cf,'isJourneyLocal':_0x12c74d,'definition':_0x25d86a};}catch(_0x5a8361){return logger[_0x594161(0x140)]('Failed\x20to\x20resolve\x20segment\x20'+_0x4a9420+':\x20'+_0x5a8361),{'name':_0x4a9420,'isJourneyLocal':![]};}},'resolveActivation':async _0x40c177=>{const _0x4bf2ad=a142_0x3aac,_0x48ccd3=_0xd610d3[_0x4bf2ad(0x15d)](_0x40c177);if(_0x48ccd3!==undefined)return{'name':_0x48ccd3,'isJourneyLocal':!![]};try{let _0x5a75f9=_0x214826?.[_0x4bf2ad(0x15d)](_0x40c177);!_0x5a75f9&&(_0x5a75f9=await _0x52e753[_0x4bf2ad(0x130)][_0x4bf2ad(0x15f)](_0x142f40,_0x40c177));const _0x5ec464=_0x5a75f9[_0x4bf2ad(0x1ab)][_0x4bf2ad(0x144)][_0x4bf2ad(0x169)]||_0x40c177,_0x118e32=sanitizeYamlKey(_0x5ec464)||_0x4bf2ad(0x1c1)+_0x40c177,_0x2df384=_0x118e32;_0xd610d3[_0x4bf2ad(0x17c)](_0x40c177,_0x2df384);const _0x35e11e=journeyActivationStepToYaml(_0x5a75f9,_0x1f3450,_0x4cd951);return{'name':_0x2df384,'isJourneyLocal':!![],'definition':_0x35e11e};}catch(_0x20f0c4){return logger[_0x4bf2ad(0x140)](_0x4bf2ad(0x18d)+_0x40c177+':\x20'+_0x20f0c4),{'name':_0x40c177,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xa2fef0,_0x1e1347)=>resolveJumpTarget(_0xa2fef0,_0x1e1347,_0x336fac,async _0x11572d=>{const _0x8ab498=a142_0x3aac,_0xd811be=_0x4d07dc?.[_0x8ab498(0x15d)](_0x11572d);if(_0xd811be)return _0xd811be;return _0x52e753[_0x8ab498(0x130)][_0x8ab498(0x190)](_0x11572d);})};return _0x37966e=_0x473d05,_0x473d05;},_0x79b02=async _0x210c0f=>{const _0x3fbefe=a142_0x3aac,{collectSegmentIdsFromJourneyApi:_0x1f0f74}=await import('./journey-yaml.js'),{batchAsync:_0xdae00b}=await import(_0x3fbefe(0x162)),_0x3e4eef=new Set();for(const _0x57a561 of _0x210c0f){let _0x260a6e=_0x4d07dc?.['get'](_0x57a561);!_0x260a6e&&(_0x260a6e=await _0x52e753[_0x3fbefe(0x130)][_0x3fbefe(0x190)](_0x57a561));const _0x1691a8=_0x1f0f74(_0x260a6e);for(const _0xc6ab13 of _0x1691a8){_0x3e4eef[_0x3fbefe(0x1f4)](_0xc6ab13);}}let _0x45b591=Array[_0x3fbefe(0x1c2)](_0x3e4eef);while(_0x45b591[_0x3fbefe(0x163)]>0x0){const _0x2e227b=_0x45b591[_0x3fbefe(0x19c)](_0x5eb641=>!_0x2a8c0f[_0x3fbefe(0x1b3)](_0x5eb641));if(_0x2e227b['length']===0x0)break;const _0x2a2b42=await _0xdae00b(_0x2e227b,async _0x3a0484=>{const _0x4886e2=_0x3fbefe;_0x2a8c0f[_0x4886e2(0x1f4)](_0x3a0484);const _0x3e3850=await fetchSegment(_0x52e753,_0x44f456,_0x3a0484,_0x13a2c9);if(!_0x3e3850)return null;return{'segmentId':_0x3a0484,'segment':_0x3e3850};},0xa),_0x323a25=new Set();for(const _0x8c1c5f of _0x2a2b42){if(!_0x8c1c5f?.[_0x3fbefe(0x1c9)]?.[_0x3fbefe(0x1a0)])continue;const _0x1adf6e=apiRuleToYaml(_0x8c1c5f[_0x3fbefe(0x1c9)][_0x3fbefe(0x1a0)]);_0x503a8f['set'](_0x8c1c5f[_0x3fbefe(0x207)],_0x1adf6e);const _0x13aefb=collectSegmentRefsFromRule(_0x1adf6e);for(const _0x5f29ee of _0x13aefb){!_0x2a8c0f['has'](_0x5f29ee)&&_0x323a25[_0x3fbefe(0x1f4)](_0x5f29ee);}}_0x45b591=Array['from'](_0x323a25);}};return{'createYamlContext':_0xcf52e6,'prefetchJourneySegments':_0x79b02};}export async function executePushSegments(_0x102277,_0x3b5718,_0x50abbd,_0x527134,_0x58999a){const _0x210b15=a142_0x469651,{segmentDefToCreateRequest:_0x462cb7,segmentDefToUpdateRequest:_0xb84c38}=await import(_0x210b15(0x119)),_0x43f3cf=_0x50abbd[_0x210b15(0x168)],_0x24c29c=0x5,_0x5708eb=async _0x59feb2=>{const _0x3a30b0=_0x210b15,_0x33e088=_0x59feb2['folderPath']?_0x43f3cf[_0x3a30b0(0x15d)](_0x59feb2[_0x3a30b0(0x183)]):undefined;let _0x5b0f72;const _0x39b8f6={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x19415e=_0x59feb2[_0x3a30b0(0x1b1)];if(_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x1a0)]){const _0x10c21f=createSegmentIdResolver(_0x50abbd['segmentNameToId'],_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]),_0x24a674=await resolveRuleSegmentIds(_0x59feb2['yamlConfig']['rule'],_0x10c21f);_0x19415e={..._0x59feb2[_0x3a30b0(0x1b1)],'rule':_0x24a674};}try{if(_0x59feb2[_0x3a30b0(0x213)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ba),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]});const _0x418813=_0x462cb7(_0x19415e,_0x33e088),_0x347d16=await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x115)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x15e),()=>_0x102277['segment'][_0x3a30b0(0x1d3)](_0x527134['parentId'],_0x418813));_0x5b0f72=_0x347d16[_0x3a30b0(0x143)]['id'],_0x50abbd[_0x3a30b0(0x176)][_0x3a30b0(0x17c)](_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],_0x5b0f72),_0x39b8f6[_0x3a30b0(0x172)]={'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'id':_0x5b0f72},_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x11c),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)],'segmentId':_0x5b0f72}),_0x58999a['logSuccess']?.(_0x3a30b0(0x197)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x147)]=0x1;}else{if(_0x59feb2[_0x3a30b0(0x1c6)]){_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x1ec),'name':_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]});const _0x17de15=_0xb84c38(_0x19415e);_0x33e088!==_0x59feb2[_0x3a30b0(0x16e)]?.[_0x3a30b0(0x1eb)]&&(_0x17de15['segmentFolderId']=_0x33e088?parseInt(_0x33e088,0xa):undefined),await _0x58999a[_0x3a30b0(0x1da)](_0x3a30b0(0x1bf)+_0x59feb2['yamlConfig'][_0x3a30b0(0x169)]+'\x27...',()=>_0x102277[_0x3a30b0(0x1c9)]['updateSegmentById'](_0x527134[_0x3a30b0(0x1e9)],_0x59feb2[_0x3a30b0(0x16e)]['id'],_0x17de15)),_0x5b0f72=_0x59feb2['existingSegment']['id'],_0x58999a[_0x3a30b0(0x189)]?.({'type':_0x3a30b0(0x14b),'name':_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]}),_0x58999a['logSuccess']?.(_0x3a30b0(0x125)+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+'\x27'),_0x39b8f6[_0x3a30b0(0x1ea)]=0x1;}else _0x5b0f72=_0x59feb2[_0x3a30b0(0x16e)]['id'];}}catch(_0xbf39bb){const _0x5c8039=isHttp400Error(_0xbf39bb),_0x5c7bb=_0x5c8039?ErrorCode[_0x3a30b0(0x211)]:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x117fdd=getErrorMessage(_0xbf39bb);throw new SDKError(_0x5c7bb,_0x3a30b0(0x139)+(_0x59feb2['isNew']?'create':_0x3a30b0(0x1c7))+_0x3a30b0(0x1fa)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+_0x117fdd,_0xbf39bb);}try{const _0x35a56e=await syncActivationsForSegment(_0x102277,_0x527134[_0x3a30b0(0x1e9)],_0x5b0f72,_0x59feb2['yamlConfig'][_0x3a30b0(0x169)],_0x59feb2[_0x3a30b0(0x1f9)],_0x58999a,_0x59feb2[_0x3a30b0(0x135)]);_0x39b8f6[_0x3a30b0(0x116)]=_0x35a56e;}catch(_0x312482){if(_0x312482 instanceof SDKError)throw _0x312482;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x59feb2[_0x3a30b0(0x1b1)][_0x3a30b0(0x169)]+_0x3a30b0(0x158)+_0x59feb2[_0x3a30b0(0x135)]+_0x3a30b0(0x216)+getErrorMessage(_0x312482),_0x312482);}return _0x39b8f6;},_0x141130=await batchAsync(_0x3b5718,_0x5708eb,_0x24c29c),_0x215be9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x24b0d5 of _0x141130){_0x215be9[_0x210b15(0x147)]+=_0x24b0d5[_0x210b15(0x147)],_0x215be9[_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x1ea)],_0x24b0d5['createdSegmentId']&&_0x215be9[_0x210b15(0x150)][_0x210b15(0x17c)](_0x24b0d5['createdSegmentId'][_0x210b15(0x169)],_0x24b0d5[_0x210b15(0x172)]['id']),_0x215be9[_0x210b15(0x116)][_0x210b15(0x147)]+=_0x24b0d5['activations'][_0x210b15(0x147)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x1ea)]+=_0x24b0d5[_0x210b15(0x116)][_0x210b15(0x1ea)],_0x215be9[_0x210b15(0x116)][_0x210b15(0x13e)]+=_0x24b0d5[_0x210b15(0x116)]['deleted'];}return _0x215be9;}async function syncActivationsForSegment(_0x41cd76,_0xd63a9f,_0x139df7,_0x2e08a5,_0x343277,_0x31b436,_0x2d600b){const _0x5a3acd=a142_0x469651,_0x56f907={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x403f46 of _0x343277){try{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1be)&&_0x403f46[_0x5a3acd(0x128)])_0x31b436['onProgress']?.({'type':_0x5a3acd(0x170),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1e0)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)][_0x5a3acd(0x198)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x151),'segmentName':_0x2e08a5,'activationName':_0x403f46['name']}),_0x31b436[_0x5a3acd(0x13f)]?.(_0x5a3acd(0x1f6)+_0x403f46[_0x5a3acd(0x169)]+'\x27'),_0x56f907['created']++;else{if(_0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1c7)&&_0x403f46[_0x5a3acd(0x128)]&&_0x403f46['existingActivation'])_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x141),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x126)+_0x403f46[_0x5a3acd(0x169)]+_0x5a3acd(0x15e),()=>_0x41cd76[_0x5a3acd(0x1c9)]['updateActivation'](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'],_0x403f46[_0x5a3acd(0x128)])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x16b),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logSuccess']?.(_0x5a3acd(0x194)+_0x403f46['name']+'\x27'),_0x56f907['updated']++;else _0x403f46[_0x5a3acd(0x17d)]===_0x5a3acd(0x1dd)&&_0x403f46[_0x5a3acd(0x19a)]&&(_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x20d),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),await _0x31b436[_0x5a3acd(0x1da)](_0x5a3acd(0x1a7)+_0x403f46['name']+_0x5a3acd(0x15e),()=>_0x41cd76['segment'][_0x5a3acd(0x20b)](_0xd63a9f,_0x139df7,_0x403f46[_0x5a3acd(0x19a)]['id'])),_0x31b436[_0x5a3acd(0x189)]?.({'type':_0x5a3acd(0x131),'segmentName':_0x2e08a5,'activationName':_0x403f46[_0x5a3acd(0x169)]}),_0x31b436['logDeleted']?.(_0x5a3acd(0x1d4)+_0x403f46['name']+'\x27'),_0x56f907[_0x5a3acd(0x13e)]++);}}catch(_0xec65ef){const _0x59ebe0=isHttp400Error(_0xec65ef),_0x2dc913=_0x59ebe0?ErrorCode[_0x5a3acd(0x1f3)]:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x26dc05=getErrorMessage(_0xec65ef);throw new SDKError(_0x2dc913,'Failed\x20to\x20'+_0x403f46[_0x5a3acd(0x17d)]+'\x20activation\x20\x27'+_0x403f46[_0x5a3acd(0x169)]+'\x27\x20from\x20file:\x20'+_0x2d600b+'\x0a\x20\x20'+_0x26dc05,_0xec65ef);}}return _0x56f907;}export async function executePushFolders(_0x78b3ac,_0x5e3c42,_0x2f1e2d,_0x28998e,_0x4874ba){const _0x31fcdb=a142_0x469651,_0x29b49e=new Map(_0x2f1e2d),_0x1bb309=sortFoldersByDepth(_0x5e3c42);for(const _0x2b1c90 of _0x1bb309){const _0x3f15d4=_0x2b1c90[_0x31fcdb(0x214)]('/'),_0x803694=_0x3f15d4[_0x3f15d4['length']-0x1],_0x317a9f=_0x3f15d4[_0x31fcdb(0x19b)](0x0,-0x1)[_0x31fcdb(0x1c0)]('/'),_0x50eda4=_0x29b49e[_0x31fcdb(0x15d)](_0x317a9f);_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ef),'folder':_0x2b1c90});const _0x1e1675={'name':_0x803694,'parentFolderId':_0x50eda4},_0x549fb1=await _0x4874ba['withProgress'](_0x31fcdb(0x186)+_0x2b1c90+_0x31fcdb(0x15e),()=>_0x78b3ac[_0x31fcdb(0x1c9)]['createFolder'](_0x28998e[_0x31fcdb(0x1e9)],_0x1e1675));_0x29b49e[_0x31fcdb(0x17c)](_0x2b1c90,_0x549fb1[_0x31fcdb(0x143)]['id']),_0x4874ba[_0x31fcdb(0x189)]?.({'type':_0x31fcdb(0x1ff),'folder':_0x2b1c90,'folderId':_0x549fb1[_0x31fcdb(0x143)]['id']}),_0x4874ba[_0x31fcdb(0x1e3)]?.(_0x31fcdb(0x1fc)+_0x2b1c90+'\x27');}return _0x29b49e;}export async function executePushSegmentDeletions(_0x22170f,_0x15ee79,_0x19ec0b){const _0x2d1ddb=a142_0x469651;if(_0x15ee79[_0x2d1ddb(0x163)]===0x0)return 0x0;const {batchAsync:_0x341c17}=await import('../../utils/async.js'),_0x4b3198=0x5,_0x40dbac=await _0x341c17(_0x15ee79,async _0x13176b=>{const _0x319caf=_0x2d1ddb;return _0x19ec0b[_0x319caf(0x189)]?.({'type':'segment_deleting','name':_0x13176b[_0x319caf(0x169)]}),await _0x22170f[_0x319caf(0x1c9)][_0x319caf(0x1cb)](_0x13176b['id']),_0x19ec0b[_0x319caf(0x189)]?.({'type':_0x319caf(0x1c8),'name':_0x13176b[_0x319caf(0x169)]}),_0x19ec0b[_0x319caf(0x1d7)]?.(_0x319caf(0x19d)+_0x13176b['name']+'\x27'),0x1;},_0x4b3198);return _0x40dbac['reduce']((_0xf9c909,_0xa28a33)=>_0xf9c909+_0xa28a33,0x0);}export async function executePushJourneys(_0x465a1f,_0x3819f2,_0x57f1c5,_0x559fed,_0x22d484){const _0x117db9=a142_0x469651,{journeyDefToRequest:_0x441766}=await import(_0x117db9(0x1a2)),{activationDefToCreateRequest:_0x5c83b0,yamlRuleToApi:_0x2b70c6,validateSegmentRule:_0x476e99}=await import(_0x117db9(0x119)),_0x908a3d={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x2578c0=new Map(_0x57f1c5[_0x117db9(0x176)]),_0x36af2b=0x5;for(let _0x2bc760=0x0;_0x2bc760<_0x3819f2[_0x117db9(0x163)];_0x2bc760+=_0x36af2b){const _0x2310a0=_0x3819f2[_0x117db9(0x19b)](_0x2bc760,_0x2bc760+_0x36af2b),_0x1bb139=await Promise[_0x117db9(0x14f)](_0x2310a0['map'](async _0x940c30=>{const _0x1fc042=_0x117db9;if(!_0x940c30[_0x1fc042(0x213)]&&!_0x940c30[_0x1fc042(0x1c6)])return{'action':_0x1fc042(0x117),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x940c30[_0x1fc042(0x1ce)]?.['id']};const _0x17669e=_0x940c30[_0x1fc042(0x183)]?_0x57f1c5[_0x1fc042(0x168)]['get'](_0x940c30['folderPath']):undefined;_0x22d484[_0x1fc042(0x189)]?.({'type':_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1b2):_0x1fc042(0x1a6),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]});try{const _0x55884e=await executeSingleJourneyPush(_0x465a1f,_0x940c30,{..._0x57f1c5,'segmentNameToId':_0x2578c0},{'parentId':_0x559fed[_0x1fc042(0x1e9)],'rootFolderId':_0x559fed[_0x1fc042(0x19e)],'folderId':_0x17669e,'verbose':_0x559fed[_0x1fc042(0x1e8)]},_0x22d484,{'journeyDefToRequest':_0x441766,'activationDefToCreateRequest':_0x5c83b0,'yamlRuleToApi':_0x2b70c6,'validateSegmentRule':_0x476e99});for(const [_0x58d672,_0x4af458]of _0x55884e[_0x1fc042(0x209)]){_0x2578c0['set'](_0x58d672,_0x4af458),_0x908a3d[_0x1fc042(0x209)]['set'](_0x58d672,_0x4af458);}if(_0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x147))_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x20e),'name':_0x940c30[_0x1fc042(0x1b1)]['name'],'journeyId':_0x55884e[_0x1fc042(0x175)]}),_0x22d484['logSuccess']?.(_0x1fc042(0x1bd)+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x147)]++;else _0x55884e[_0x1fc042(0x1d6)]===_0x1fc042(0x1ea)&&(_0x22d484[_0x1fc042(0x189)]?.({'type':_0x1fc042(0x18c),'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)]}),_0x22d484[_0x1fc042(0x13f)]?.('Updated\x20journey\x20\x27'+_0x940c30['yamlConfig'][_0x1fc042(0x169)]+'\x27'),_0x908a3d[_0x1fc042(0x1ea)]++);return{'action':_0x55884e[_0x1fc042(0x1d6)],'name':_0x940c30[_0x1fc042(0x1b1)][_0x1fc042(0x169)],'journeyId':_0x55884e[_0x1fc042(0x175)]};}catch(_0x58f887){const _0x1d697d=isHttp400Error(_0x58f887),_0x1dd67d=_0x1d697d?ErrorCode[_0x1fc042(0x15b)]:ErrorCode[_0x1fc042(0x1fb)],_0x365785=getErrorMessage(_0x58f887);throw new SDKError(_0x1dd67d,_0x1fc042(0x139)+(_0x940c30[_0x1fc042(0x213)]?_0x1fc042(0x1be):'update')+_0x1fc042(0x16f)+_0x940c30[_0x1fc042(0x135)]+_0x1fc042(0x216)+_0x365785,_0x58f887);}}));_0x908a3d[_0x117db9(0x205)]['push'](..._0x1bb139);}return _0x908a3d;}function a142_0x5e0e(){const _0x25158c=['push','list','Segment\x20not\x20found:\x20','valid','createSegment','Deleted\x20activation\x20\x27','toLowerCase','action','logDeleted','utf-8','yamlActivation','withProgress','Activation','description','delete','uniqueServerName','651783QIlbTg','Creating\x20activation\x20\x27','message','localName','logInfo','entry_criteria','journeys','.$1.push-recovery.json','flatMap','verbose','parentId','updated','segmentFolderId','segment_updating','connectionIdToNameMap','schedule','folder_creating','journeyBundleId','relationships','DecisionPoint','ACTIVATION_SYNTAX_ERROR','add','fetchJourney','Created\x20activation\x20\x27','state','match','activationActions','\x20segment\x20from\x20file:\x20','JOURNEY_UPDATE_ERROR','Created\x20folder\x20\x27','activationsBySegmentId','1341150QahPEo','folder_created','run_after_journey_refresh','Failed\x20to\x20fetch\x20referenced\x20segment\x20','36sMAWPn','columns','Matched\x20server\x20segment\x20\x27','results','journeyStages','segmentId','segments','embeddedSegmentNameToId',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','deleteActivation','Segment\x20not\x20found','activation_deleting','journey_created','values','stages','SEGMENT_SYNTAX_ERROR','SEGMENT_NOT_FOUND','isNew','split','Delete\x20the\x20push\x20recovery\x20file\x20(','\x0a\x20\x20','NOT_FOUND','Activation\x20not\x20found:\x20','sort','1173260LSxdtC','Creating\x20segment\x20\x27','activations','unchanged','resolveSegment','./child-segment-yaml.js','3058xuRnuk','stringify','segment_created','folderId','getSegmentEntity','keys','connection','user','item','index','__pending_','Updated\x20segment\x20\x27','Updating\x20activation\x20\x27','existingSegments','validatedRequest','104lCWlXq','__pending_act_','conditionTimeoutDuration','replace','diff','idToEmailMap','26880luKBBE','journey','activation_deleted','parse','\x27\x20decision\x20point\x20branch\x20\x27','all_columns','absolutePath','idToName','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','and\x20the\x20server\x20segment,\x20then\x20retry.','Failed\x20to\x20','INTERNAL','entryCriteria','find','sha1','deleted','logSuccess','debug','activation_updating','updateSegmentById','data','activationParams','journey_entry_criteria_','tdx.sdk.push-workflow','created','getLatestJourneyId','stage\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','segment_updated','\x27\x20milestone','\x27\x20not\x20found\x20in\x20journey\x20\x27','Entry\x20criteria:\x20','all','createdSegmentIds','activation_created','skipSegments','activation_template_id','goal','branches','hex','\x27\x20exit\x20criteria','\x27\x20from\x20file:\x20','createJourneySegment','size','JOURNEY_SYNTAX_ERROR','entry','get','\x27...','getActivation','activationStepsById','notification','../../utils/async.js','length','Condition','nameToType','versionNumber','deps','folderPathToId','name','waitStepType','activation_updated','uniqueSegmentName','connector_config','existingSegment','\x20journey\x20from\x20file:\x20','activation_creating','includes','createdSegmentId','145192eliHSl','milestone','journeyId','segmentNameToId','\x27\x20wait\x20condition','waitStep','nameToId','embedded_segment_created','\x27\x20to\x20local\x20\x27','set','type','journeyBundleName','\x20(referenced\x20in\x20journey\x20','day','\x27\x20for\x20','Embedded\x20segment\x20\x27','folderPath','goal\x20criteria','max','Creating\x20folder\x20\x27','progress','entries','onProgress','embedded_segment_creating','with','journey_updated','Failed\x20to\x20resolve\x20activation\x20','journeyById','isArray','getJourney','Stage\x20\x27','behavior','activationContext','Updated\x20activation\x20\x27','listActivations','journeyActivationStepId','Created\x20segment\x20\x27','createActivation','10iCkJqs','existingActivation','slice','filter','Deleted\x20segment\x20\x27','rootFolderId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','rule','decision_point','./journey-yaml.js','Fetching\x20','394891pjvbxw','parentSegmentFolder','journey_updating','Deleting\x20activation\x20\x27','digest','map','conditionSegmentId','attributes','conditionTimeoutUnit','conditions','parentFolder','waitStepUnit','relative','yamlConfig','journey_creating','has','startsWith','null','Name\x20has\x20already\x20been\x20taken','160335owsVRQ','WaitStep','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','segment_creating','steps','journeyName','Created\x20journey\x20\x27','create','Updating\x20segment\x20\x27','join','activation_','from','exitCriterias','parseDocument','some','hasChanges','update','segment_deleted','segment','resolvedRule','deleteSegment','toISOString','Journey\x20\x27','existingJourney'];a142_0x5e0e=function(){return _0x25158c;};return a142_0x5e0e();}async function matchExistingJourneySegments(_0xacf75e,_0x5d2b72,_0x3d6e70,_0x1ad67f,_0x551aa4){const _0x20dd8f=a142_0x469651;if(!_0x5d2b72[_0x20dd8f(0x1ce)]||!_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x208)])return;const _0x3e2036=new Map(),_0x4c512f=new Set();for(const _0x2b4555 of Object[_0x20dd8f(0x11f)](_0x5d2b72['yamlConfig']['segments'])){const _0x5659a5=generateDeterministicJourneySegmentName(_0x5d2b72[_0x20dd8f(0x1b1)][_0x20dd8f(0x169)],_0x2b4555);_0x3e2036[_0x20dd8f(0x17c)](_0x5659a5,_0x2b4555),_0x4c512f[_0x20dd8f(0x1f4)](_0x2b4555);}const _0x96a302=[],_0xd2ef4d=collectSegmentIdsFromJourneyApi(_0x5d2b72[_0x20dd8f(0x1ce)]);for(const _0x28d909 of _0xd2ef4d){const _0x503c95=await fetchSegment(_0xacf75e,_0x3d6e70,_0x28d909,_0x1ad67f);if(!_0x503c95?.['name'])continue;const _0x4cccc7=_0x3e2036[_0x20dd8f(0x15d)](_0x503c95[_0x20dd8f(0x169)]);_0x4cccc7?(_0x551aa4[_0x20dd8f(0x17c)](_0x4cccc7,_0x28d909),_0x4c512f[_0x20dd8f(0x1dd)](_0x4cccc7)):_0x96a302['push']({'id':_0x28d909,'seg':_0x503c95});}if(_0x4c512f[_0x20dd8f(0x15a)]>0x0&&_0x96a302['length']>0x0){const {localExpandedRuleToNames:_0x40339d}=buildLocalExpandedRuleMappings(_0x5d2b72['yamlConfig']),_0x3cc84d=new Map();for(const {id:_0x986fa7,seg:_0x420576}of _0x96a302){if(_0x420576[_0x20dd8f(0x1a0)]){const _0x55c860=apiRuleToYaml(_0x420576[_0x20dd8f(0x1a0)]);_0x3cc84d['set'](_0x986fa7,_0x55c860);}}for(const {id:_0x2ca11b,seg:_0xbded35}of _0x96a302){if(!_0xbded35[_0x20dd8f(0x1a0)])continue;const _0x297c62=_0x3cc84d['get'](_0x2ca11b);if(!_0x297c62)continue;const _0x402a2a=serializeExpandedRule(_0x297c62,_0x3cc84d),_0x2aad22=_0x40339d[_0x20dd8f(0x15d)](_0x402a2a);if(_0x2aad22){const _0x54f287=_0x2aad22[_0x20dd8f(0x13c)](_0x338ea2=>_0x4c512f['has'](_0x338ea2));_0x54f287&&(_0x551aa4['set'](_0x54f287,_0x2ca11b),_0x4c512f[_0x20dd8f(0x1dd)](_0x54f287),logger[_0x20dd8f(0x140)](_0x20dd8f(0x204)+_0xbded35['name']+_0x20dd8f(0x17b)+_0x54f287+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x5208b1,_0xc79c30,_0x56c4a5,_0x31089b,_0xadf956,_0x89e34){const _0x5c31f1=a142_0x469651,{journeyDefToRequest:_0x80555,activationDefToCreateRequest:_0x2d280b,yamlRuleToApi:_0x3f5555,validateSegmentRule:_0x25cc2a}=_0x89e34,_0x3c572f=new Map(),_0x134d4f=new Map();recoverSegmentIdsFromPushRecovery(_0xc79c30,_0x3c572f,_0x56c4a5[_0x5c31f1(0x176)]);const _0x30a32b=new Map(),_0x588975=new Map(),_0x3d79d1=new Map();let _0x48fadc;const _0x20e9cc=async()=>{const _0x51a6b4=_0x5c31f1;if(_0x48fadc)return;_0x48fadc=new Map();if(!_0xc79c30['existingJourney'])return;const _0x3951b0=await _0x5208b1[_0x51a6b4(0x130)][_0x51a6b4(0x195)](_0xc79c30[_0x51a6b4(0x1ce)]['id']);for(const _0x93e678 of _0x3951b0){const _0x1754ff=journeyActivationStepToYaml(_0x93e678,_0x56c4a5[_0x51a6b4(0x12e)],_0x56c4a5[_0x51a6b4(0x1ed)]),_0x92e7d4=activationSignature(_0x1754ff);!_0x48fadc[_0x51a6b4(0x1b3)](_0x92e7d4)&&_0x48fadc[_0x51a6b4(0x17c)](_0x92e7d4,_0x93e678['id']),_0x1754ff['name']&&_0x134d4f[_0x51a6b4(0x17c)](_0x1754ff['name'],_0x93e678['id']);}};await matchExistingJourneySegments(_0x5208b1,_0xc79c30,_0x31089b[_0x5c31f1(0x1e9)],_0x56c4a5[_0x5c31f1(0x127)],_0x56c4a5[_0x5c31f1(0x176)]);const _0x5ef7b5={'resolveSegmentId':async _0x49f5bb=>{const _0x10be93=_0x5c31f1,_0x46f6fe=_0x56c4a5[_0x10be93(0x176)][_0x10be93(0x15d)](_0x49f5bb);if(!_0x46f6fe)throw new SDKError(ErrorCode[_0x10be93(0x212)],_0x10be93(0x1d1)+_0x49f5bb+_0x10be93(0x17f)+_0xc79c30[_0x10be93(0x1b1)][_0x10be93(0x169)]+')');return _0x46f6fe;},'resolveEmbeddedSegmentId':async(_0x2e684d,_0x4d343c)=>{const _0x2eaaf1=_0x5c31f1,_0x151146=_0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x15d)](_0x2e684d);if(_0x151146)return _0x151146;const _0x5b5ef3=_0x56c4a5[_0x2eaaf1(0x127)]['find'](_0x244848=>_0x244848[_0x2eaaf1(0x169)]===_0x2e684d);if(_0x5b5ef3)return _0x56c4a5[_0x2eaaf1(0x176)][_0x2eaaf1(0x17c)](_0x2e684d,_0x5b5ef3['id']),_0x5b5ef3['id'];if(_0xc79c30['isNew']){const {stageName:_0x41f0c5,criteriaName:_0x1748d1}=findSegmentCriteriaLocation(_0xc79c30[_0x2eaaf1(0x1b1)],_0x2e684d);return _0x25cc2a(_0x2e684d,_0x4d343c[_0x2eaaf1(0x1a0)]),_0x588975[_0x2eaaf1(0x17c)](_0x2e684d,{'definition':_0x4d343c,'stageName':_0x41f0c5,'criteriaName':_0x1748d1}),createPendingSegmentId(_0x2e684d);}const _0x3c86b2=_0xc79c30[_0x2eaaf1(0x1ce)]?.['id'];if(!_0x3c86b2)throw new SDKError(ErrorCode[_0x2eaaf1(0x13a)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x300292=_0x30a32b[_0x2eaaf1(0x15d)](_0x2e684d);if(_0x300292)return _0x300292;const _0x1a3d4a=((async()=>{const _0x4ad744=_0x2eaaf1;_0x25cc2a(_0x2e684d,_0x4d343c['rule']);const _0x4b4c99=generateDeterministicJourneySegmentName(_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d),_0xcbca0a=_0x56c4a5[_0x4ad744(0x127)][_0x4ad744(0x13c)](_0x249f59=>_0x249f59[_0x4ad744(0x169)]===_0x4b4c99),_0x24c567=createSegmentIdResolver(_0x56c4a5['segmentNameToId'],_0x2e684d),_0xe3d121=await resolveRuleSegmentIds(_0x4d343c[_0x4ad744(0x1a0)],_0x24c567);let _0x320e40;return _0xcbca0a?(await _0x5208b1['segment'][_0x4ad744(0x142)](_0x31089b[_0x4ad744(0x1e9)],_0xcbca0a['id'],{'description':_0x4d343c[_0x4ad744(0x1dc)]||'Entry\x20criteria:\x20'+_0x2e684d,'rule':_0x3f5555(_0xe3d121,!![]),'countPopulation':!![]}),_0x320e40=_0xcbca0a['id'],saveSegmentToPushRecovery(_0xc79c30['absolutePath'],_0xc79c30[_0x4ad744(0x1b1)][_0x4ad744(0x169)],_0x2e684d,{'segmentId':_0x320e40,'uniqueServerName':_0x4b4c99,'createdAt':new Date()['toISOString']()})):_0x320e40=await createOrRecoverEmbeddedSegment(_0x5208b1,_0xc79c30,{'localName':_0x2e684d,'uniqueSegmentName':_0x4b4c99,'description':_0x4d343c[_0x4ad744(0x1dc)]||_0x4ad744(0x14e)+_0x2e684d,'journeyId':_0x3c86b2,'resolvedRule':_0xe3d121,'parentId':_0x31089b[_0x4ad744(0x1e9)],'folderId':_0x31089b[_0x4ad744(0x19e)]||''},_0x3f5555),_0x56c4a5['segmentNameToId'][_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x3c572f[_0x4ad744(0x17c)](_0x2e684d,_0x320e40),_0x320e40;})());_0x30a32b[_0x2eaaf1(0x17c)](_0x2e684d,_0x1a3d4a);try{return await _0x1a3d4a;}finally{_0x30a32b['delete'](_0x2e684d);}},'resolveActivationId':async _0x556c26=>{const _0x440125=_0x5c31f1,_0xd04d3d=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0xd04d3d)return _0xd04d3d;if(_0xc79c30[_0x440125(0x1ce)]){await _0x20e9cc();const _0x5c20a9=_0x134d4f[_0x440125(0x15d)](_0x556c26);if(_0x5c20a9)return _0x5c20a9;}throw new SDKError(ErrorCode[_0x440125(0x217)],_0x440125(0x112)+_0x556c26+_0x440125(0x17f)+_0xc79c30['yamlConfig'][_0x440125(0x169)]+').\x20'+'Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.');},'resolveEmbeddedActivationId':async(_0x3f008,_0x3ba41d)=>{const _0x7fc5be=_0x5c31f1,_0x302501=_0x134d4f[_0x7fc5be(0x15d)](_0x3f008);if(_0x302501)return _0x302501;if(_0xc79c30[_0x7fc5be(0x213)])return _0x3d79d1[_0x7fc5be(0x17c)](_0x3f008,_0x3ba41d),createPendingActivationId(_0x3f008);if(_0xc79c30[_0x7fc5be(0x1ce)]){await _0x20e9cc();const _0x4fa23e=_0x134d4f[_0x7fc5be(0x15d)](_0x3ba41d[_0x7fc5be(0x169)]);if(_0x4fa23e)return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x4fa23e),_0x4fa23e;const _0x170f1d=activationSignature(_0x3ba41d),_0x39cfef=_0x48fadc?.['get'](_0x170f1d);if(_0x39cfef)return _0x134d4f['set'](_0x3f008,_0x39cfef),_0x39cfef;const _0x44e295=await _0x2d280b(_0x3ba41d,_0x56c4a5[_0x7fc5be(0x193)]),_0xbf2f4c={..._0x44e295,..._0x3ba41d[_0x7fc5be(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x3ba41d[_0x7fc5be(0x200)]}},_0x1efc2a=await _0x5208b1[_0x7fc5be(0x130)][_0x7fc5be(0x198)](_0xc79c30[_0x7fc5be(0x1ce)]['id'],_0xbf2f4c);return _0x134d4f[_0x7fc5be(0x17c)](_0x3f008,_0x1efc2a['id']),_0x1efc2a['id'];}throw new SDKError(ErrorCode[_0x7fc5be(0x13a)],_0x7fc5be(0x137));},'resolveJourneyId':async _0x17928f=>{const _0x8f1720=_0x5c31f1;try{return await _0x5208b1[_0x8f1720(0x130)]['resolveJourneyId'](_0x31089b[_0x8f1720(0x1e9)],_0x17928f);}catch(_0xd1bea){throw new SDKError(ErrorCode[_0x8f1720(0x217)],_0x8f1720(0x1cd)+_0x17928f+_0x8f1720(0x1b9)+_0xc79c30[_0x8f1720(0x1b1)][_0x8f1720(0x169)]+'\x27)',_0xd1bea);}},'resolveStageId':async(_0x61ca62,_0x18509a)=>{const _0x1cef65=_0x5c31f1,_0x5df8b1=await _0x5208b1[_0x1cef65(0x130)]['getJourney'](_0x61ca62),_0x38996f=_0x5df8b1['attributes']['journeyStages'][_0x1cef65(0x13c)](_0x473b11=>_0x473b11['name'][_0x1cef65(0x1d5)]()===_0x18509a[_0x1cef65(0x1d5)]());if(!_0x38996f?.['id'])throw new SDKError(ErrorCode[_0x1cef65(0x217)],_0x1cef65(0x191)+_0x18509a+_0x1cef65(0x14d)+(_0x5df8b1[_0x1cef65(0x1ab)][_0x1cef65(0x17e)]||_0x5df8b1[_0x1cef65(0x1ab)]['name'])+'\x27');return _0x38996f['id'];}},_0x1ef27e=await _0x80555(_0xc79c30[_0x5c31f1(0x1b1)],_0x31089b[_0x5c31f1(0x1e9)],_0x5ef7b5),_0xf53c10=_0x31089b[_0x5c31f1(0x11d)]||_0x31089b[_0x5c31f1(0x19e)];_0xf53c10&&(_0x1ef27e[_0x5c31f1(0x1f1)]={'parentFolder':{'data':{'id':_0xf53c10,'type':'folder'}}});if(_0xc79c30[_0x5c31f1(0x213)]){if(_0x588975[_0x5c31f1(0x15a)]>0x0||_0x3d79d1[_0x5c31f1(0x15a)]>0x0)return await executeThreeStepJourneyCreate(_0x5208b1,_0xc79c30,_0x1ef27e,{'pendingEmbeddedSegments':_0x588975,'pendingEmbeddedActivations':_0x3d79d1,'embeddedSegmentNameToId':_0x3c572f,'journeyActivationNameToId':_0x134d4f},{..._0x31089b,'effectiveFolderId':_0xf53c10},_0x56c4a5,_0xadf956,_0x89e34);else{ensureJourneyDefaults(_0x1ef27e[_0x5c31f1(0x1ab)]);const _0x4c571d=await _0x5208b1[_0x5c31f1(0x130)][_0x5c31f1(0x1be)](_0x1ef27e);return deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x147),'journeyId':_0x4c571d['id'],'embeddedSegmentNameToId':_0x3c572f};}}else{if(_0xc79c30[_0x5c31f1(0x1c6)]&&_0xc79c30[_0x5c31f1(0x1ce)]){_0x1ef27e['id']=_0xc79c30['existingJourney']['id'];const _0x128fe6=_0x1ef27e[_0x5c31f1(0x1ab)];_0xc79c30['existingJourney'][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x17e)]&&(_0x128fe6[_0x5c31f1(0x17e)]=_0xc79c30['existingJourney']['attributes'][_0x5c31f1(0x17e)]);const _0x3e4fac=_0xc79c30[_0x5c31f1(0x1ce)][_0x5c31f1(0x1ab)]?.[_0x5c31f1(0x206)];return _0x3e4fac&&_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)]&&injectExistingStageIds(_0x1ef27e[_0x5c31f1(0x1ab)][_0x5c31f1(0x206)],_0x3e4fac),ensureJourneyDefaults(_0x128fe6),await _0x5208b1[_0x5c31f1(0x130)]['update'](_0xc79c30[_0x5c31f1(0x1ce)]['id'],_0x1ef27e),deletePushRecovery(_0xc79c30[_0x5c31f1(0x135)]),{'action':_0x5c31f1(0x1ea),'journeyId':_0xc79c30['existingJourney']['id'],'embeddedSegmentNameToId':_0x3c572f};}}return deletePushRecovery(_0xc79c30['absolutePath']),{'action':_0x5c31f1(0x117),'journeyId':_0xc79c30[_0x5c31f1(0x1ce)]?.['id'],'embeddedSegmentNameToId':_0x3c572f};}function findSegmentCriteriaLocation(_0x43f4e6,_0x134e2c){const _0x391154=a142_0x469651,_0x65b639=_0x43f4e6[_0x391154(0x210)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.['stages']||[];let _0x474a9a=_0x391154(0x15c),_0x4551bb=_0x134e2c;const _0xd4dc28=_0x43f4e6[_0x391154(0x154)]||_0x43f4e6[_0x391154(0x1e5)]?.[0x0]?.[_0x391154(0x154)];if(_0xd4dc28?.[_0x391154(0x1c9)]===_0x134e2c)return{'stageName':_0x391154(0x154),'criteriaName':_0xd4dc28[_0x391154(0x169)]||_0x134e2c};_0x40ad69:for(const _0x3074f0 of _0x65b639){if(_0x3074f0[_0x391154(0x1e4)]?.[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0['name'],_0x4551bb=_0x3074f0['entry_criteria'][_0x391154(0x169)]||_0x134e2c;break;}if(_0x3074f0['steps'])for(const _0x526134 of _0x3074f0[_0x391154(0x1bb)]){if(_0x526134['type']===_0x391154(0x1a1)&&_0x526134['with']?.[_0x391154(0x155)])for(const _0x3b2417 of _0x526134[_0x391154(0x18b)][_0x391154(0x155)]){if(_0x3b2417[_0x391154(0x1c9)]===_0x134e2c){_0x474a9a=_0x3074f0[_0x391154(0x169)],_0x4551bb=_0x3b2417['name']||_0x134e2c;break _0x40ad69;}}}}return{'stageName':_0x474a9a,'criteriaName':_0x4551bb};}async function executeThreeStepJourneyCreate(_0x3dc8e3,_0x1a7c1c,_0x570033,_0x5d5e55,_0x2fea0f,_0x531a4c,_0x34cf38,_0x4ccb75){const _0xd9d129=a142_0x469651,{activationDefToCreateRequest:_0x4de568,yamlRuleToApi:_0x5be04c}=_0x4ccb75,{pendingEmbeddedSegments:_0x4cd59b,pendingEmbeddedActivations:_0x477c39,embeddedSegmentNameToId:_0x4c4771}=_0x5d5e55,_0x42aefa=JSON['parse'](JSON[_0xd9d129(0x11b)](_0x570033));ensureJourneyDefaults(_0x42aefa[_0xd9d129(0x1ab)]),stripPendingIds(_0x42aefa);const _0x56c634=await _0x3dc8e3['journey'][_0xd9d129(0x1be)](_0x42aefa),_0x129956=_0x56c634['id'],_0x373a04=new Map();for(const _0x29e8ae of _0x56c634[_0xd9d129(0x1ab)]['journeyStages']){_0x373a04[_0xd9d129(0x17c)](_0x29e8ae[_0xd9d129(0x169)][_0xd9d129(0x1d5)](),_0x29e8ae['id']);}recoverSegmentIdsFromPushRecovery(_0x1a7c1c,_0x4c4771,_0x531a4c['segmentNameToId']);for(const [_0x37a118,{definition:_0x5de882}]of _0x4cd59b){if(_0x4c4771[_0xd9d129(0x1b3)](_0x37a118)){_0x34cf38['onProgress']?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'segmentName':_0x37a118});continue;}const _0x5395f4=generateDeterministicJourneySegmentName(_0x1a7c1c['yamlConfig'][_0xd9d129(0x169)],_0x37a118);_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x18a),'journeyName':_0x1a7c1c['yamlConfig']['name'],'segmentName':_0x37a118});const _0x337c50=createSegmentIdResolver(_0x531a4c[_0xd9d129(0x176)],_0x37a118),_0x2acf27=await resolveRuleSegmentIds(_0x5de882[_0xd9d129(0x1a0)],_0x337c50),_0x581d99=await createOrRecoverEmbeddedSegment(_0x3dc8e3,_0x1a7c1c,{'localName':_0x37a118,'uniqueSegmentName':_0x5395f4,'description':_0x5de882[_0xd9d129(0x1dc)]||'Entry\x20criteria:\x20'+_0x37a118,'journeyId':_0x129956,'resolvedRule':_0x2acf27,'parentId':_0x2fea0f[_0xd9d129(0x1e9)],'folderId':_0x2fea0f['effectiveFolderId']||''},_0x5be04c);_0x4c4771[_0xd9d129(0x17c)](_0x37a118,_0x581d99),_0x531a4c[_0xd9d129(0x176)]['set'](_0x37a118,_0x581d99),_0x34cf38[_0xd9d129(0x189)]?.({'type':_0xd9d129(0x17a),'journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'segmentName':_0x37a118});}const _0x216d96=new Map();for(const [_0x5c6194,_0x307c72]of _0x477c39){_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_creating','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)]['name'],'activationName':_0x5c6194});const _0x4fccfa=await _0x4de568(_0x307c72,_0x531a4c[_0xd9d129(0x193)]),_0x1b7974={..._0x4fccfa,..._0x307c72[_0xd9d129(0x200)]!==undefined&&{'runAfterJourneyRefresh':_0x307c72[_0xd9d129(0x200)]}},_0xca1eb5=await _0x3dc8e3[_0xd9d129(0x130)][_0xd9d129(0x198)](_0x129956,_0x1b7974);_0x216d96[_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x5d5e55['journeyActivationNameToId'][_0xd9d129(0x17c)](_0x5c6194,_0xca1eb5['id']),_0x34cf38[_0xd9d129(0x189)]?.({'type':'embedded_activation_created','journeyName':_0x1a7c1c[_0xd9d129(0x1b1)][_0xd9d129(0x169)],'activationName':_0x5c6194});}const _0x7fccc7=JSON[_0xd9d129(0x132)](JSON[_0xd9d129(0x11b)](_0x570033));return _0x7fccc7['id']=_0x129956,ensureJourneyDefaults(_0x7fccc7[_0xd9d129(0x1ab)]),resolvePendingIdsInRequest(_0x7fccc7,_0x570033,_0x373a04,_0x4c4771,_0x216d96,_0x34cf38),await _0x3dc8e3['journey'][_0xd9d129(0x1c7)](_0x129956,_0x7fccc7),deletePushRecovery(_0x1a7c1c[_0xd9d129(0x135)]),{'action':_0xd9d129(0x147),'journeyId':_0x129956,'embeddedSegmentNameToId':_0x4c4771};}export function stripWaitStepPendingIds(_0x3bc1a0){const _0x5202d9=a142_0x469651,_0x1b8348=_0x3bc1a0[_0x5202d9(0x1aa)]&&isPendingSegmentId(_0x3bc1a0[_0x5202d9(0x1aa)]),_0x507871=_0x3bc1a0[_0x5202d9(0x1ad)]?.[_0x5202d9(0x1c5)](_0x58b6a0=>_0x58b6a0[_0x5202d9(0x207)]&&isPendingSegmentId(_0x58b6a0['segmentId']));(_0x1b8348||_0x507871)&&(_0x3bc1a0[_0x5202d9(0x16a)]='Duration',_0x3bc1a0[_0x5202d9(0x178)]=0x1,_0x3bc1a0[_0x5202d9(0x1af)]=_0x5202d9(0x180),delete _0x3bc1a0['conditionSegmentId'],delete _0x3bc1a0['conditionTimeoutDuration'],delete _0x3bc1a0[_0x5202d9(0x1ac)],delete _0x3bc1a0[_0x5202d9(0x1ad)]);}function a142_0x3aac(_0x2b98f2,_0x3c4d93){_0x2b98f2=_0x2b98f2-0x112;const _0x5e0eb0=a142_0x5e0e();let _0x3aac58=_0x5e0eb0[_0x2b98f2];return _0x3aac58;}export function resolveWaitStepPendingIds(_0x314f77,_0x42675c,_0x3e68ad,_0x4266a5){const _0xe8a821=a142_0x469651;if(_0x42675c[_0xe8a821(0x1aa)]&&isPendingSegmentId(_0x42675c[_0xe8a821(0x1aa)])){const _0x267553=_0x3e68ad(_0x42675c['conditionSegmentId'],_0xe8a821(0x149)+_0x4266a5+_0xe8a821(0x177));_0x267553&&(_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1aa)]=_0x267553,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77['waitStepUnit'],_0x42675c[_0xe8a821(0x12b)]!==undefined&&(_0x314f77[_0xe8a821(0x12b)]=_0x42675c['conditionTimeoutDuration']),_0x42675c[_0xe8a821(0x1ac)]&&(_0x314f77[_0xe8a821(0x1ac)]=_0x42675c[_0xe8a821(0x1ac)]));}if(_0x42675c[_0xe8a821(0x1ad)]){const _0x59fa05=_0x42675c['conditions'][_0xe8a821(0x1c5)](_0x428f88=>_0x428f88[_0xe8a821(0x207)]&&isPendingSegmentId(_0x428f88[_0xe8a821(0x207)]));if(_0x59fa05){const _0x422f46=_0x42675c['conditions'][_0xe8a821(0x1a9)](_0x5b9ad3=>{const _0x476360=_0xe8a821;if(_0x5b9ad3['segmentId']&&isPendingSegmentId(_0x5b9ad3['segmentId'])){const _0x40a4a=_0x3e68ad(_0x5b9ad3[_0x476360(0x207)],'stage\x20\x27'+_0x4266a5+_0x476360(0x177));return{..._0x5b9ad3,'segmentId':_0x40a4a||_0x5b9ad3[_0x476360(0x207)]};}return{..._0x5b9ad3};});_0x314f77[_0xe8a821(0x16a)]=_0xe8a821(0x164),_0x314f77[_0xe8a821(0x1ad)]=_0x422f46,delete _0x314f77[_0xe8a821(0x178)],delete _0x314f77[_0xe8a821(0x1af)],delete _0x314f77[_0xe8a821(0x1aa)],delete _0x314f77[_0xe8a821(0x12b)],delete _0x314f77[_0xe8a821(0x1ac)];}}}function stripPendingIds(_0x162071){const _0x4ee1a5=a142_0x469651;_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)][_0x4ee1a5(0x207)])&&delete _0x162071[_0x4ee1a5(0x1ab)][_0x4ee1a5(0x154)];for(const _0x1c7d14 of _0x162071['attributes'][_0x4ee1a5(0x206)]||[]){_0x1c7d14[_0x4ee1a5(0x13b)]?.[_0x4ee1a5(0x207)]&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x13b)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x13b)];_0x1c7d14[_0x4ee1a5(0x174)]?.['segmentId']&&isPendingSegmentId(_0x1c7d14[_0x4ee1a5(0x174)][_0x4ee1a5(0x207)])&&delete _0x1c7d14[_0x4ee1a5(0x174)];_0x1c7d14[_0x4ee1a5(0x1c3)]&&(_0x1c7d14['exitCriterias']=_0x1c7d14[_0x4ee1a5(0x1c3)][_0x4ee1a5(0x19c)](_0x18687f=>!_0x18687f['segmentId']||!isPendingSegmentId(_0x18687f[_0x4ee1a5(0x207)])));if(_0x1c7d14[_0x4ee1a5(0x1bb)])for(const _0x25ce59 of Object['keys'](_0x1c7d14[_0x4ee1a5(0x1bb)])){const _0x5e0c80=_0x1c7d14[_0x4ee1a5(0x1bb)][_0x25ce59];_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1db)&&_0x5e0c80['journeyActivationStepId']&&isPendingActivationId(_0x5e0c80[_0x4ee1a5(0x196)])&&(_0x5e0c80[_0x4ee1a5(0x196)]='');if(_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1f2)&&_0x5e0c80['branches'])for(const _0x215704 of _0x5e0c80[_0x4ee1a5(0x155)]){_0x215704['segmentId']&&isPendingSegmentId(_0x215704[_0x4ee1a5(0x207)])&&(_0x215704[_0x4ee1a5(0x207)]='');}_0x5e0c80[_0x4ee1a5(0x17d)]===_0x4ee1a5(0x1b8)&&stripWaitStepPendingIds(_0x5e0c80);}}}function resolvePendingIdsInRequest(_0x59eb7e,_0x72bd,_0x292a9a,_0x826b22,_0x323967,_0x487459){const _0x552240=a142_0x469651,_0x333cfa=(_0x563959,_0x41cdf8)=>{const _0x57e520=a142_0x3aac;if(!isPendingSegmentId(_0x563959))return _0x563959;const _0x452bac=extractPendingSegmentName(_0x563959),_0x46251c=_0x826b22[_0x57e520(0x15d)](_0x452bac);return!_0x46251c&&_0x487459['logWarning']?.(_0x57e520(0x19f)+_0x452bac+_0x57e520(0x181)+_0x41cdf8),_0x46251c;};if(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)]?.['segmentId']&&isPendingSegmentId(_0x59eb7e[_0x552240(0x1ab)]['goal'][_0x552240(0x207)])){const _0x187bc5=_0x333cfa(_0x59eb7e['attributes'][_0x552240(0x154)][_0x552240(0x207)],_0x552240(0x184));_0x187bc5&&(_0x59eb7e[_0x552240(0x1ab)][_0x552240(0x154)][_0x552240(0x207)]=_0x187bc5);}for(const _0x570098 of _0x59eb7e[_0x552240(0x1ab)]['journeyStages']||[]){const _0x5ed57e=_0x292a9a['get'](_0x570098['name'][_0x552240(0x1d5)]());_0x5ed57e&&(_0x570098['id']=_0x5ed57e);if(_0x570098[_0x552240(0x13b)]?.[_0x552240(0x207)]&&isPendingSegmentId(_0x570098[_0x552240(0x13b)][_0x552240(0x207)])){const _0x5e4f10=_0x333cfa(_0x570098['entryCriteria'][_0x552240(0x207)],'stage\x20\x27'+_0x570098['name']+'\x27\x20entry\x20criteria');_0x5e4f10&&(_0x570098[_0x552240(0x13b)][_0x552240(0x207)]=_0x5e4f10);}if(_0x570098['exitCriterias'])for(const _0x410532 of _0x570098['exitCriterias']){if(_0x410532[_0x552240(0x207)]&&isPendingSegmentId(_0x410532[_0x552240(0x207)])){const _0x4c7336=_0x333cfa(_0x410532[_0x552240(0x207)],'stage\x20\x27'+_0x570098[_0x552240(0x169)]+_0x552240(0x157));_0x4c7336&&(_0x410532[_0x552240(0x207)]=_0x4c7336);}}if(_0x570098[_0x552240(0x174)]?.['segmentId']&&isPendingSegmentId(_0x570098['milestone']['segmentId'])){const _0x5beb82=_0x333cfa(_0x570098[_0x552240(0x174)]['segmentId'],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x14c));_0x5beb82&&(_0x570098[_0x552240(0x174)]['segmentId']=_0x5beb82);}if(_0x570098[_0x552240(0x1bb)]){const _0x6767cc=_0x550e46=>_0x72bd[_0x552240(0x1ab)][_0x552240(0x206)]?.[_0x552240(0x13c)](_0x1a58c0=>_0x1a58c0[_0x552240(0x169)][_0x552240(0x1d5)]()===_0x570098[_0x552240(0x169)][_0x552240(0x1d5)]())?.[_0x552240(0x1bb)]?.[_0x550e46];for(const _0x164f60 of Object[_0x552240(0x11f)](_0x570098[_0x552240(0x1bb)])){const _0x3cd428=_0x570098[_0x552240(0x1bb)][_0x164f60],_0x32ac7f=_0x6767cc(_0x164f60);if(_0x3cd428['type']==='Activation'&&_0x3cd428['journeyActivationStepId']&&(isPendingActivationId(_0x3cd428[_0x552240(0x196)])||_0x3cd428[_0x552240(0x196)]==='')){if(_0x32ac7f?.[_0x552240(0x196)]&&isPendingActivationId(_0x32ac7f[_0x552240(0x196)])){const _0x23360b=extractPendingActivationName(_0x32ac7f[_0x552240(0x196)]),_0x1ce41c=_0x323967['get'](_0x23360b);_0x1ce41c&&(_0x3cd428[_0x552240(0x196)]=_0x1ce41c);}}if(_0x3cd428[_0x552240(0x17d)]===_0x552240(0x1f2)&&_0x3cd428['branches']&&_0x32ac7f?.[_0x552240(0x155)])for(let _0x6b6d59=0x0;_0x6b6d59<_0x3cd428[_0x552240(0x155)][_0x552240(0x163)];_0x6b6d59++){const _0x1d2b86=_0x3cd428[_0x552240(0x155)][_0x6b6d59],_0x4e23bb=_0x32ac7f['branches'][_0x6b6d59];if(_0x4e23bb?.[_0x552240(0x207)]&&isPendingSegmentId(_0x4e23bb[_0x552240(0x207)])){const _0xd2b383=_0x333cfa(_0x4e23bb[_0x552240(0x207)],_0x552240(0x149)+_0x570098[_0x552240(0x169)]+_0x552240(0x133)+(_0x1d2b86[_0x552240(0x169)]||_0x6b6d59)+'\x27');_0xd2b383&&(_0x1d2b86[_0x552240(0x207)]=_0xd2b383);}}_0x3cd428['type']===_0x552240(0x1b8)&&_0x32ac7f?.[_0x552240(0x17d)]==='WaitStep'&&resolveWaitStepPendingIds(_0x3cd428,_0x32ac7f,_0x333cfa,_0x570098['name']);}}}}
|
|
1
|
+
const a142_0x5b9def=a142_0x361a;(function(_0x35f6f5,_0x5c8d44){const _0x30be72=a142_0x361a,_0x2e27c0=_0x35f6f5();while(!![]){try{const _0x2c5395=parseInt(_0x30be72(0x1d0))/0x1+-parseInt(_0x30be72(0x18e))/0x2+-parseInt(_0x30be72(0x1bd))/0x3*(-parseInt(_0x30be72(0x209))/0x4)+-parseInt(_0x30be72(0x18c))/0x5*(-parseInt(_0x30be72(0x12f))/0x6)+-parseInt(_0x30be72(0x21a))/0x7+-parseInt(_0x30be72(0x1ae))/0x8+parseInt(_0x30be72(0x1e9))/0x9*(parseInt(_0x30be72(0x1f3))/0xa);if(_0x2c5395===_0x5c8d44)break;else _0x2e27c0['push'](_0x2e27c0['shift']());}catch(_0x58c4d5){_0x2e27c0['push'](_0x2e27c0['shift']());}}}(a142_0x3d03,0x3648b));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a142_0x5b9def(0x16a));export const PENDING_SEGMENT_PREFIX=a142_0x5b9def(0x220);export const PENDING_ACTIVATION_PREFIX=a142_0x5b9def(0x13f);export function createPendingSegmentId(_0x13c79b){return''+PENDING_SEGMENT_PREFIX+_0x13c79b+'__';}export function isPendingSegmentId(_0x4ad2d3){const _0x17661e=a142_0x5b9def;return _0x4ad2d3['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x4ad2d3[_0x17661e(0x1ff)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x1c511a){const _0x259067=a142_0x5b9def;return _0x1c511a[_0x259067(0x1d4)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x147ccf){return''+PENDING_ACTIVATION_PREFIX+_0x147ccf+'__';}function a142_0x361a(_0x14676b,_0x3c423f){_0x14676b=_0x14676b-0x124;const _0x3d033d=a142_0x3d03();let _0x361ab4=_0x3d033d[_0x14676b];return _0x361ab4;}export function isPendingActivationId(_0x3f432a){return _0x3f432a['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1f077a){const _0x2ad562=a142_0x5b9def;return _0x1f077a[_0x2ad562(0x1d4)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x3e2e21,_0x4e10bd){const _0x24ac83=a142_0x5b9def,_0x3b3f8a=_0x3e2e21+'::'+(_0x4e10bd[_0x24ac83(0x12b)]()||'segment'),_0x57a75c=createHash(_0x24ac83(0x21b))[_0x24ac83(0x1c3)](_0x3b3f8a)[_0x24ac83(0x142)]('hex')[_0x24ac83(0x12e)](0x0,0xc);return'journey_entry_criteria_'+_0x57a75c;}export function ensureJourneyDefaults(_0xd398f4){const _0x433b17=a142_0x5b9def;!_0xd398f4[_0x433b17(0x190)]&&(_0xd398f4[_0x433b17(0x190)]=''),!_0xd398f4[_0x433b17(0x179)]&&(_0xd398f4[_0x433b17(0x179)]=_0x433b17(0x124));}export function injectExistingStageIds(_0x1fd4be,_0x9a7690){const _0x32e889=a142_0x5b9def,_0x2f61fc=new Map(_0x9a7690[_0x32e889(0x17c)](_0x134f88=>[_0x134f88[_0x32e889(0x13e)],_0x134f88['id']]));for(const _0x1f1052 of _0x1fd4be){if(!_0x1f1052['id']){const _0x15d5f8=_0x2f61fc[_0x32e889(0x1b1)](_0x1f1052[_0x32e889(0x13e)]);_0x15d5f8&&(_0x1f1052['id']=_0x15d5f8);}}}export function resolveTDFolderPath(_0x446a17,_0x584c97,_0x3dee29){const _0xc653c6=a142_0x5b9def;if(!_0x584c97)return _0x446a17;if(_0x446a17===_0x3dee29||_0x446a17[_0xc653c6(0x1ff)](_0x3dee29+'/'))return _0x446a17;return _0x446a17?_0x3dee29+'/'+_0x446a17:_0x3dee29;}export function addFoldersToCreate(_0x101458,_0x2d9641,_0x2c0ea9){const _0x72b1ce=a142_0x5b9def;if(!_0x101458)return;if(_0x2d9641[_0x72b1ce(0x1da)](_0x101458))return;const _0x130e26=_0x101458[_0x72b1ce(0x208)]('/');let _0x1f1922='';for(const _0x1cdc1b of _0x130e26){_0x1f1922=_0x1f1922?_0x1f1922+'/'+_0x1cdc1b:_0x1cdc1b,!_0x2d9641['has'](_0x1f1922)&&_0x2c0ea9['add'](_0x1f1922);}}export function sortFoldersByDepth(_0x2c6f2e){const _0x53c4f9=a142_0x5b9def;return[..._0x2c6f2e][_0x53c4f9(0x1f8)]((_0x5ee70c,_0x257db8)=>{const _0x18671d=_0x53c4f9,_0x1bd985=(_0x5ee70c[_0x18671d(0x1e2)](/\//g)||[])['length'],_0x255b87=(_0x257db8['match'](/\//g)||[])[_0x18671d(0x164)];return _0x1bd985-_0x255b87;});}import*as a142_0x2bab56 from'yaml';import{readFileSync}from'fs';import a142_0x30beb9 from'path';import{isJourneyDef,parseYamlString as a142_0x2abc5a,toYamlString as a142_0x4333ae,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(_0x55f503){const _0x5e7762=a142_0x5b9def;if(Array['isArray'](_0x55f503))return'['+_0x55f503[_0x5e7762(0x17c)](_0x5ecf29=>stableStringify(_0x5ecf29))[_0x5e7762(0x1e3)](',')+']';if(_0x55f503&&typeof _0x55f503===_0x5e7762(0x180)){const _0xe7d24f=_0x55f503,_0x29c002=Object[_0x5e7762(0x205)](_0xe7d24f)[_0x5e7762(0x1f8)](),_0x45e906=_0x29c002[_0x5e7762(0x17c)](_0x392a45=>'\x22'+_0x392a45+'\x22:'+stableStringify(_0xe7d24f[_0x392a45]));return'{'+_0x45e906[_0x5e7762(0x1e3)](',')+'}';}const _0x49a21c=JSON[_0x5e7762(0x1dd)](_0x55f503);return _0x49a21c===undefined?'null':_0x49a21c;}function activationSignature(_0x230781){const _0x2c217b=a142_0x5b9def,_0x302f57={'connection':_0x230781[_0x2c217b(0x13c)],..._0x230781[_0x2c217b(0x174)]!==undefined&&{'all_columns':_0x230781['all_columns']},..._0x230781[_0x2c217b(0x1a1)]!==undefined&&{'columns':_0x230781[_0x2c217b(0x1a1)]},..._0x230781[_0x2c217b(0x224)]!==undefined&&{'behavior':_0x230781[_0x2c217b(0x224)]},..._0x230781[_0x2c217b(0x137)]!==undefined&&{'schedule':_0x230781['schedule']},..._0x230781[_0x2c217b(0x1dc)]!==undefined&&{'notification':_0x230781[_0x2c217b(0x1dc)]},..._0x230781[_0x2c217b(0x1f9)]!==undefined&&{'connector_config':_0x230781[_0x2c217b(0x1f9)]},..._0x230781[_0x2c217b(0x1e6)]!==undefined&&{'activation_template_id':_0x230781[_0x2c217b(0x1e6)]}};return stableStringify(_0x302f57);}async function fetchSegment(_0x80bf7f,_0x43343b,_0x474cca,_0x3004c0){const _0x33c67d=a142_0x5b9def,_0x109f71=_0x3004c0?.[_0x33c67d(0x1c5)](_0x2f9ea9=>_0x2f9ea9['id']===_0x474cca);if(_0x109f71)return _0x109f71;try{return await _0x80bf7f[_0x33c67d(0x162)][_0x33c67d(0x14d)](_0x43343b,_0x474cca);}catch(_0x158ade){logger[_0x33c67d(0x1c7)]('getSegment\x20failed\x20for\x20'+_0x474cca+_0x33c67d(0x1c0)+_0x158ade);try{return await _0x80bf7f[_0x33c67d(0x162)][_0x33c67d(0x1cc)](_0x474cca);}catch(_0x52055f){return logger[_0x33c67d(0x1c7)](_0x33c67d(0x1e5)+_0x474cca+':\x20'+_0x52055f),null;}}}function recoverSegmentIdsFromPushRecovery(_0x3792dc,_0x3a2b30,_0x4e76a9){const _0x2881f5=a142_0x5b9def,_0x56addc=readPushRecovery(_0x3792dc['absolutePath']);if(_0x56addc?.[_0x2881f5(0x183)]===_0x3792dc[_0x2881f5(0x219)][_0x2881f5(0x13e)])for(const [_0x105559,_0x2dc7e2]of Object[_0x2881f5(0x181)](_0x56addc[_0x2881f5(0x15b)])){const _0x1869a1=generateDeterministicJourneySegmentName(_0x3792dc[_0x2881f5(0x219)][_0x2881f5(0x13e)],_0x105559);_0x2dc7e2['uniqueServerName']===_0x1869a1&&(_0x3a2b30[_0x2881f5(0x204)](_0x105559,_0x2dc7e2[_0x2881f5(0x191)]),_0x4e76a9['set'](_0x105559,_0x2dc7e2[_0x2881f5(0x191)]));}}async function createOrRecoverEmbeddedSegment(_0xf91b10,_0x50ed06,_0x373a50,_0x3fc75c){const _0x2aa6f4=a142_0x5b9def;let _0x3d5b6a;try{_0x3d5b6a=await _0xf91b10[_0x2aa6f4(0x162)][_0x2aa6f4(0x196)]({'name':_0x373a50['uniqueSegmentName'],'description':_0x373a50[_0x2aa6f4(0x190)],'journeyId':_0x373a50[_0x2aa6f4(0x1b7)],'rule':_0x3fc75c(_0x373a50[_0x2aa6f4(0x1bc)],!![]),'countPopulation':!![],'parentFolderId':_0x373a50['folderId'],'audienceId':_0x373a50[_0x2aa6f4(0x13d)]});}catch(_0x5aaa61){const _0x1a9cea=_0x5aaa61 instanceof Error&&_0x5aaa61[_0x2aa6f4(0x18f)][_0x2aa6f4(0x16b)]('Name\x20has\x20already\x20been\x20taken');if(_0x1a9cea){const _0x4db459=readPushRecovery(_0x50ed06['absolutePath']),_0x24d5d5=_0x4db459?.[_0x2aa6f4(0x183)]===_0x50ed06[_0x2aa6f4(0x219)]['name']?_0x4db459[_0x2aa6f4(0x15b)][_0x373a50[_0x2aa6f4(0x1e4)]]:undefined;if(_0x24d5d5?.[_0x2aa6f4(0x201)]===_0x373a50[_0x2aa6f4(0x130)])await _0xf91b10[_0x2aa6f4(0x162)][_0x2aa6f4(0x1df)](_0x373a50['parentId'],_0x24d5d5[_0x2aa6f4(0x191)],{'description':_0x373a50['description'],'rule':_0x3fc75c(_0x373a50['resolvedRule'],!![]),'countPopulation':!![]}),_0x3d5b6a=_0x24d5d5[_0x2aa6f4(0x191)];else throw new SDKError(ErrorCode['SEGMENT_UPDATE_ERROR'],_0x2aa6f4(0x19a)+_0x373a50[_0x2aa6f4(0x1e4)]+_0x2aa6f4(0x15f)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x50ed06[_0x2aa6f4(0x156)]['replace'](/([^/]+)$/,_0x2aa6f4(0x195))+')\x20')+_0x2aa6f4(0x12d),_0x5aaa61);}else throw _0x5aaa61;}return saveSegmentToPushRecovery(_0x50ed06[_0x2aa6f4(0x156)],_0x50ed06[_0x2aa6f4(0x219)][_0x2aa6f4(0x13e)],_0x373a50[_0x2aa6f4(0x1e4)],{'segmentId':_0x3d5b6a,'uniqueServerName':_0x373a50[_0x2aa6f4(0x130)],'createdAt':new Date()[_0x2aa6f4(0x177)]()}),_0x3d5b6a;}export async function prepareSegmentFiles(_0x88ed8b,_0x13bb44,_0x1f028a,_0x47f0a9,_0x4bacac){const _0x22e14e=a142_0x5b9def,{activationDefToCreateRequest:_0x1d5db8}=await import('./child-segment-yaml.js'),_0x10a485=[],_0xe8566a=new Set();for(const {yamlConfig:_0x1bc3d5,folderPath:_0x461670,sourcePath:_0x59dc5e}of _0x88ed8b){const _0x4ff918=resolveTDFolderPath(_0x461670,_0x47f0a9,_0x4bacac),_0x4effad=_0x4ff918+':'+_0x1bc3d5[_0x22e14e(0x13e)],_0x200f5c=_0x13bb44['segmentByFolderAndName'][_0x22e14e(0x1b1)](_0x4effad),_0x531575=_0x200f5c?_0x13bb44['activationsBySegmentId'][_0x22e14e(0x1b1)](_0x200f5c['id'])||[]:[];addFoldersToCreate(_0x4ff918,_0x13bb44[_0x22e14e(0x1db)],_0xe8566a);const _0x1dcb74=calculateActivationActions(_0x1bc3d5[_0x22e14e(0x1d5)]||[],_0x531575,_0x13bb44[_0x22e14e(0x141)],_0x13bb44[_0x22e14e(0x1d9)]);for(const _0x123fba of _0x1dcb74){(_0x123fba[_0x22e14e(0x17b)]===_0x22e14e(0x1d1)||_0x123fba['type']===_0x22e14e(0x1c3))&&_0x123fba[_0x22e14e(0x12c)]&&(_0x123fba['validatedRequest']=await _0x1d5db8(_0x123fba[_0x22e14e(0x12c)],_0x1f028a));}const _0x53a5b8=calculateSegmentDiff(_0x1bc3d5,_0x200f5c,_0x531575,_0x13bb44[_0x22e14e(0x141)],_0x13bb44[_0x22e14e(0x1d9)]);_0x10a485[_0x22e14e(0x188)]({'relativePath':_0x1bc3d5['name'],'absolutePath':_0x59dc5e,'yamlConfig':_0x1bc3d5,'folderPath':_0x4ff918,'existingSegment':_0x200f5c,'existingActivations':_0x531575,'isNew':_0x53a5b8[_0x22e14e(0x1af)],'hasChanges':_0x53a5b8[_0x22e14e(0x161)],'diff':_0x53a5b8[_0x22e14e(0x21c)],'activationActions':_0x1dcb74});}return{'segmentFiles':_0x10a485,'foldersToCreate':_0xe8566a};}export async function prepareJourneyFiles(_0x65d119,_0x315c89,_0x287613,_0x197936){const _0x4d2c25=a142_0x5b9def,_0x1692d2=[],_0x1edd87=new Set();for(const {yamlConfig:_0x395f47,folderPath:_0x44cc5e,sourcePath:_0x2ca8e4}of _0x65d119){const _0x2fd61c=resolveTDFolderPath(_0x44cc5e,_0x287613,_0x197936),_0x2c65bf=_0x2fd61c+':'+_0x395f47[_0x4d2c25(0x13e)],_0x17ac1f=_0x315c89['journeyBundlesByFolderAndName'][_0x4d2c25(0x1b1)](_0x2c65bf);let _0x35c7c5,_0xdf7515;if(_0x17ac1f&&_0x17ac1f[_0x4d2c25(0x164)]>0x0){const _0x571047=buildLocalExpandedRuleMappings(_0x395f47),{createYamlContext:_0x31dea5,prefetchJourneySegments:_0xe318cf}=createPushYamlContextForBundle(_0x315c89[_0x4d2c25(0x160)],_0x315c89['parentId'],_0x315c89[_0x4d2c25(0x1ee)],_0x571047,_0x315c89[_0x4d2c25(0x141)],_0x315c89['connectionIdToNameMap'],_0x315c89[_0x4d2c25(0x1a7)],_0x315c89[_0x4d2c25(0x157)]);await _0xe318cf(_0x17ac1f['map'](_0x54b70e=>_0x54b70e['id']));const _0x2377ed=await _0x315c89[_0x4d2c25(0x160)]['journey'][_0x4d2c25(0x15d)](_0x17ac1f[0x0]['journeyBundleId']),_0x51b79a=hasMultipleVersions(_0x395f47),_0x38ad48=async _0x3f006b=>{const _0x38a26b=_0x4d2c25,_0x18ef7c=_0x315c89[_0x38a26b(0x157)]?.[_0x38a26b(0x1b1)](_0x3f006b);if(_0x18ef7c)return _0x18ef7c;return _0x315c89[_0x38a26b(0x136)]({'journeyId':_0x3f006b,'journeyName':_0x395f47['name'],'isMultiVersion':_0x17ac1f[_0x38a26b(0x164)]>0x1});};if(_0x51b79a&&_0x17ac1f[_0x4d2c25(0x164)]>0x1){const _0x415c0c=[];for(const _0xf10e02 of _0x17ac1f){const _0x3e6bac=_0xf10e02[_0x4d2c25(0x207)]||0x1;_0x315c89['progress']?.['update'](_0x4d2c25(0x1e1)+_0x395f47[_0x4d2c25(0x13e)]+'\x20v'+_0x3e6bac);const _0x75e628=await _0x38ad48(_0xf10e02['id']),_0x56b272=_0x31dea5(_0xf10e02['id']),_0x26fe83=await journeyResponseToDef(_0x75e628,_0x56b272);_0x415c0c[_0x4d2c25(0x188)]({'item':_0xf10e02,'yaml':_0x26fe83});}const _0x3e7f74=buildLocalRuleToNameMappingFromJourney(_0x395f47);_0xdf7515=buildMergedJourneyDef(_0x415c0c,_0x3e7f74,_0x2377ed);const _0x45add8=Math[_0x4d2c25(0x202)](..._0x415c0c[_0x4d2c25(0x17c)](_0x5aa5ca=>_0x5aa5ca[_0x4d2c25(0x18d)]['versionNumber']||0x0)),_0x3c8b98=_0x17ac1f[_0x4d2c25(0x1c5)](_0x33411b=>(_0x33411b[_0x4d2c25(0x207)]||0x0)===_0x45add8);_0x3c8b98&&(_0x315c89['progress']?.[_0x4d2c25(0x1c3)](_0x4d2c25(0x1e1)+_0x395f47['name']+'\x20v'+_0x45add8),_0x35c7c5=await _0x38ad48(_0x3c8b98['id']));}else{const _0x30caef=_0x17ac1f[_0x17ac1f[_0x4d2c25(0x164)]-0x1];_0x315c89['progress']?.[_0x4d2c25(0x1c3)](_0x4d2c25(0x1e1)+_0x395f47[_0x4d2c25(0x13e)]),_0x35c7c5=await _0x38ad48(_0x30caef['id']);const _0x5a970c=_0x31dea5(_0x30caef['id']),_0x1fcbcb=await journeyResponseToDef(_0x35c7c5,_0x5a970c),_0x383eb3=buildLocalRuleToNameMappingFromJourney(_0x395f47);_0xdf7515=buildMergedJourneyDef([{'item':_0x30caef,'yaml':_0x1fcbcb}],_0x383eb3,_0x2377ed);}}addFoldersToCreate(_0x2fd61c,_0x315c89[_0x4d2c25(0x1db)],_0x1edd87);const _0x26a831=calculateJourneyDiff(_0x395f47,_0xdf7515);_0x1692d2['push']({'relativePath':_0x395f47['name'],'absolutePath':_0x2ca8e4,'yamlConfig':_0x395f47,'folderPath':_0x2fd61c,'existingJourney':_0x35c7c5,'isNew':_0x26a831[_0x4d2c25(0x1af)],'hasChanges':_0x26a831[_0x4d2c25(0x161)],'diff':_0x26a831[_0x4d2c25(0x21c)]});}return{'journeyFiles':_0x1692d2,'foldersToCreate':_0x1edd87};}export function calculateActivationActions(_0x1f08d2,_0x12c859,_0x4a9b54,_0x9ec071){const _0x34ca93=a142_0x5b9def,_0x27b201=[],_0x49de1c=new Map();for(const _0xa68d91 of _0x12c859){_0x49de1c['set'](_0xa68d91[_0x34ca93(0x13e)],_0xa68d91);}const _0x437379=new Map();for(const _0x13c563 of _0x1f08d2){_0x437379['set'](_0x13c563[_0x34ca93(0x13e)],_0x13c563);}for(const _0x372e3f of _0x1f08d2){const _0x84158c=_0x49de1c[_0x34ca93(0x1b1)](_0x372e3f['name']);if(!_0x84158c)_0x27b201['push']({'type':_0x34ca93(0x1d1),'name':_0x372e3f[_0x34ca93(0x13e)],'yamlActivation':_0x372e3f});else{const _0xa86263=activationResponseToDef(_0x84158c,_0x4a9b54,_0x9ec071),_0x3825d5=a142_0x2bab56[_0x34ca93(0x1dd)](_0xa86263),_0x13f7d9=a142_0x2bab56['stringify'](_0x372e3f);_0x3825d5!==_0x13f7d9&&_0x27b201[_0x34ca93(0x188)]({'type':_0x34ca93(0x1c3),'name':_0x372e3f[_0x34ca93(0x13e)],'yamlActivation':_0x372e3f,'existingActivation':_0x84158c});}}for(const _0x3af0ee of _0x12c859){!_0x437379['has'](_0x3af0ee['name'])&&_0x27b201[_0x34ca93(0x188)]({'type':_0x34ca93(0x173),'name':_0x3af0ee[_0x34ca93(0x13e)],'existingActivation':_0x3af0ee});}return _0x27b201;}function calculateYamlDiff(_0x236765,_0x5a0d3d){if(_0x5a0d3d){const _0x1afd87=generateDiff(_0x5a0d3d,_0x236765),_0xc5d015=hasChanges(_0x1afd87);return{'isNew':![],'hasChanges':_0xc5d015,'diff':_0xc5d015?formatDiffWithColors(_0x1afd87):undefined};}const _0x27aeae=generateDiff('',_0x236765);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x27aeae)};}export function calculateSegmentDiff(_0x4d7bc8,_0x58053b,_0x16b6ff,_0x67574a,_0x2548aa){const _0x2ad68d=segmentToYamlString(_0x4d7bc8),_0x6c6041=_0x58053b?segmentToYamlString(segmentWithActivationsToYaml(_0x58053b,_0x16b6ff,undefined,_0x67574a,_0x2548aa)):undefined;return calculateYamlDiff(_0x2ad68d,_0x6c6041);}export function calculateJourneyDiff(_0x41c7c8,_0x2dba6a){const _0x246405=normalizeJourneyDef(_0x41c7c8,_0x41c7c8),_0x101253=a142_0x4333ae(_0x246405),_0x415cda=_0x2dba6a?a142_0x4333ae(normalizeJourneyDef(_0x2dba6a,_0x41c7c8)):undefined;return calculateYamlDiff(_0x101253,_0x415cda);}export function findSegmentsToDelete(_0x5c799c,_0x5a72fb,_0x5aab89,_0x51b98c,_0x4ae8d9){const _0x5ae967=a142_0x5b9def,_0x1949ae=new Set();for(const {yamlConfig:_0x1f2f61,folderPath:_0x48c3d8}of _0x5a72fb){_0x1949ae[_0x5ae967(0x128)](_0x48c3d8+':'+_0x1f2f61[_0x5ae967(0x13e)]);}return _0x5c799c[_0x5ae967(0x192)](_0x434755=>{const _0x308429=_0x5ae967,_0x2cc097=_0x434755['segmentFolderId']?_0x5aab89['get'](_0x434755[_0x308429(0x1d7)][_0x308429(0x1b0)]())||'':'',_0x598272=_0x2cc097+':'+_0x434755[_0x308429(0x13e)];if(_0x1949ae[_0x308429(0x1da)](_0x598272))return![];if(_0x4ae8d9)return _0x2cc097===_0x51b98c||_0x2cc097[_0x308429(0x1ff)](_0x51b98c+'/');return!![];});}export function findJourneysToDelete(_0x1da516,_0xae1b83,_0x2f0741,_0x4da8dd,_0x6bc7cc){const _0x3f899d=a142_0x5b9def,_0x180757=new Set();for(const {yamlConfig:_0x12ce42,folderPath:_0x1926d2}of _0xae1b83){_0x180757[_0x3f899d(0x128)](_0x1926d2+':'+_0x12ce42[_0x3f899d(0x13e)]);}return _0x1da516[_0x3f899d(0x192)](_0x4b7962=>{const _0x3111f2=_0x3f899d,_0x38a791=_0x4b7962[_0x3111f2(0x132)]?_0x2f0741['get'](_0x4b7962[_0x3111f2(0x132)])||'':'',_0x24d4df=_0x38a791+':'+_0x4b7962[_0x3111f2(0x1ab)];if(_0x180757[_0x3111f2(0x1da)](_0x24d4df))return![];if(_0x6bc7cc)return _0x38a791===_0x4da8dd||_0x38a791[_0x3111f2(0x1ff)](_0x4da8dd+'/');return!![];});}export function buildSegmentLookupMap(_0x45eaa1,_0x458082){const _0x59f084=a142_0x5b9def,_0x261bfe=new Map();for(const _0xb92f0c of _0x45eaa1){const _0x2c6753=_0xb92f0c[_0x59f084(0x1d7)]?_0x458082[_0x59f084(0x1b1)](_0xb92f0c['segmentFolderId']['toString']())||'':'',_0xa2622a=_0x2c6753+':'+_0xb92f0c[_0x59f084(0x13e)];_0x261bfe[_0x59f084(0x204)](_0xa2622a,_0xb92f0c);}return _0x261bfe;}export function buildSegmentNameToIdMap(_0x3882c3){const _0x343629=a142_0x5b9def,_0x580da6=new Map();for(const _0x2a9273 of _0x3882c3){_0x580da6[_0x343629(0x204)](_0x2a9273['name'],_0x2a9273['id']);}return _0x580da6;}export function buildJourneyBundleLookupMap(_0x1aa5c9,_0x20e6a0){const _0x5eb5b6=a142_0x5b9def,_0x23d9ea=new Map();for(const _0x361597 of _0x1aa5c9){const _0x42a0dc=_0x361597[_0x5eb5b6(0x132)]?_0x20e6a0[_0x5eb5b6(0x1b1)](_0x361597['folderId'])||'':'',_0x28d643=_0x42a0dc+':'+_0x361597[_0x5eb5b6(0x1ab)];!_0x23d9ea[_0x5eb5b6(0x1da)](_0x28d643)&&_0x23d9ea[_0x5eb5b6(0x204)](_0x28d643,[]),_0x23d9ea[_0x5eb5b6(0x1b1)](_0x28d643)[_0x5eb5b6(0x188)](_0x361597);}for(const _0x53abbc of _0x23d9ea[_0x5eb5b6(0x1d3)]()){_0x53abbc[_0x5eb5b6(0x1f8)]((_0xdc24c,_0x2979e3)=>(_0xdc24c[_0x5eb5b6(0x207)]||0x0)-(_0x2979e3[_0x5eb5b6(0x207)]||0x0));}return _0x23d9ea;}export function collectFoldersToCreate(_0x2e13cb,_0x1d7c24){const _0x121b64=a142_0x5b9def,_0xd5a9e1=new Set();for(const _0x5cb0ff of _0x2e13cb){if(!_0x5cb0ff)continue;if(_0x1d7c24['has'](_0x5cb0ff))continue;const _0x4578eb=_0x5cb0ff['split']('/');let _0x1374f0='';for(const _0xbcf442 of _0x4578eb){_0x1374f0=_0x1374f0?_0x1374f0+'/'+_0xbcf442:_0xbcf442,!_0x1d7c24[_0x121b64(0x1da)](_0x1374f0)&&_0xd5a9e1['add'](_0x1374f0);}}return _0xd5a9e1;}export function parseAndClassifyYamlFiles(_0x1e66b3,_0x62d109,_0x499880){const _0x50ddda=a142_0x5b9def,_0xbe5d2f=[],_0x2c7cc9=[];for(const _0x1e9bb9 of _0x1e66b3){const _0x5f5554=a142_0x30beb9[_0x50ddda(0x1f1)](_0x62d109,a142_0x30beb9[_0x50ddda(0x194)](_0x1e9bb9)),_0x1f2e24=_0x5f5554==='.'?'':_0x5f5554,_0x223582=readFileSync(_0x1e9bb9,_0x50ddda(0x19f)),_0x44d8e4=a142_0x2bab56[_0x50ddda(0x16f)](_0x223582);if(isJourneyDef(_0x44d8e4)){const _0x464146=a142_0x2abc5a(_0x223582);_0x2c7cc9['push']({'yamlConfig':_0x464146,'folderPath':_0x1f2e24,'sourcePath':_0x1e9bb9});}else{if(!_0x499880?.[_0x50ddda(0x1cd)]){const _0x4ccfa1=parseSegmentYamlFile(_0x223582),_0x460bd3=normalizeChildSegmentYaml(_0x4ccfa1);_0xbe5d2f[_0x50ddda(0x188)]({'yamlConfig':_0x460bd3,'folderPath':_0x1f2e24,'sourcePath':_0x1e9bb9});}}}return{'segments':_0xbe5d2f,'journeys':_0x2c7cc9};}export function validateParsedFiles(_0x303777,_0x3540d1){const _0x552525=a142_0x5b9def,_0x301380=[];for(const {yamlConfig:_0x5beddc,sourcePath:_0x1e330a}of _0x303777['segments']){const _0xd46d60=readFileSync(_0x1e330a,_0x552525(0x19f)),_0x4e78f9=a142_0x2bab56[_0x552525(0x17f)](_0xd46d60),_0x42aed3=validateSegmentDef(_0x5beddc,{'source':_0xd46d60,'document':_0x4e78f9},{'skipSchema':!![]});if(!_0x42aed3['valid']){const _0x44fbd4=a142_0x30beb9[_0x552525(0x1f1)](_0x3540d1,_0x1e330a);_0x301380['push']({'filePath':_0x44fbd4,'source':_0xd46d60,'result':_0x42aed3,'isJourney':![]});}}for(const {yamlConfig:_0x2323d8,sourcePath:_0x2148cf}of _0x303777[_0x552525(0x212)]){const _0x50776f=readFileSync(_0x2148cf,'utf-8'),_0x5ab2a1=a142_0x2bab56['parseDocument'](_0x50776f),_0x57a597=validateJourneyDef(_0x2323d8,{'source':_0x50776f,'document':_0x5ab2a1},{'skipSchema':!![]});if(!_0x57a597[_0x552525(0x1bf)]){const _0x3aee5a=a142_0x30beb9['relative'](_0x3540d1,_0x2148cf);_0x301380[_0x552525(0x188)]({'filePath':_0x3aee5a,'source':_0x50776f,'result':_0x57a597,'isJourney':!![]});}}return _0x301380;}export function formatValidationErrors(_0x382087){const _0x18896f=a142_0x5b9def,_0x3afa5a=[];for(const {filePath:_0x34ef0a,source:_0x3c023e,result:_0x2a6347,isJourney:_0x375476}of _0x382087){const _0x3983f5=_0x375476?_0x18896f(0x169):_0x18896f(0x162);_0x3afa5a[_0x18896f(0x188)]('\x0a'+_0x34ef0a+'\x20('+_0x3983f5+_0x18896f(0x211)+_0x2a6347[_0x18896f(0x171)][_0x18896f(0x164)]+'\x20error(s)'),_0x3afa5a['push'](formatValidationResult(_0x2a6347,_0x3c023e,_0x34ef0a));}return _0x3afa5a['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x21dc94){const _0x38658f=a142_0x5b9def,_0x69a2a7=new Set(),_0x1e5601=new Map(),_0x4b3956=collectSegmentUsageCounts(_0x21dc94);if(_0x21dc94[_0x38658f(0x15b)])for(const [_0x154936,_0x2912b0]of Object[_0x38658f(0x181)](_0x21dc94['segments'])){_0x69a2a7[_0x38658f(0x128)](_0x154936);if(_0x2912b0[_0x38658f(0x14c)]){const _0x5bcb2d=yamlRuleToApi(_0x2912b0[_0x38658f(0x14c)]),_0x6f17d8=apiRuleToYaml(_0x5bcb2d);_0x1e5601['set'](_0x154936,_0x6f17d8);}}const _0x2d8329=new Map();let _0x434541=0x0;for(const [_0x1f17e8,_0x38d99e]of _0x1e5601){const _0x357758=serializeExpandedRule(_0x38d99e,_0x1e5601),_0x3118ba=_0x2d8329[_0x38658f(0x1b1)](_0x357758)||[];_0x3118ba['push']({'name':_0x1f17e8,'index':_0x434541}),_0x2d8329[_0x38658f(0x204)](_0x357758,_0x3118ba),_0x434541++;}const _0x595cfe=new Map();for(const [_0x29e290,_0x387ca5]of _0x2d8329){const _0x20f580=_0x387ca5[_0x38658f(0x12e)]()[_0x38658f(0x1f8)]((_0x70acba,_0xd2598)=>{const _0x1581a2=_0x38658f,_0x3dc273=_0x4b3956[_0x1581a2(0x1b1)](_0x70acba[_0x1581a2(0x13e)])||0x0,_0x1747ca=_0x4b3956[_0x1581a2(0x1b1)](_0xd2598[_0x1581a2(0x13e)])||0x0;if(_0x3dc273!==_0x1747ca)return _0x1747ca-_0x3dc273;return _0x70acba[_0x1581a2(0x163)]-_0xd2598[_0x1581a2(0x163)];})[_0x38658f(0x17c)](_0x15404e=>_0x15404e['name']),_0x1d0c04=[];for(const _0x220a54 of _0x20f580){const _0x4a935c=_0x4b3956['get'](_0x220a54)||0x0,_0x2c6351=Math[_0x38658f(0x202)](_0x4a935c,0x1);for(let _0x48e2d3=0x0;_0x48e2d3<_0x2c6351;_0x48e2d3++){_0x1d0c04['push'](_0x220a54);}}_0x595cfe[_0x38658f(0x204)](_0x29e290,_0x1d0c04);}return{'existingLocalSegmentNames':_0x69a2a7,'localSegmentRules':_0x1e5601,'localExpandedRuleToNames':_0x595cfe};}function a142_0x3d03(){const _0x200918=['213UZpzkY','activationContext','valid',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','activationParams','day','update','some','find','\x27\x20decision\x20point\x20branch\x20\x27','debug','journey_creating','\x27\x20from\x20file:\x20','branches','\x27\x20milestone','getSegmentEntity','skipSegments','\x27\x20not\x20found\x20in\x20journey\x20\x27','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','239176BAuBFJ','create','INTERNAL','values','replace','activations','deleteSegment','segmentFolderId','Condition','connectionIdToNameMap','has','folderPathToId','notification','stringify','\x27\x20entry\x20criteria','updateSegmentById','entryCriteria','Fetching\x20','match','join','localName','getSegmentEntity\x20also\x20failed\x20for\x20','activation_template_id','goal\x20criteria','flatMap','20583MCeSyJ','Activation','withProgress','folder_created','Created\x20activation\x20\x27','existingSegments','run_after_journey_refresh','results','relative','JOURNEY_UPDATE_ERROR','2020jHfAQS','createFolder','exitCriterias','getActivation','journey_updating','sort','connector_config','created','Created\x20journey\x20\x27','reduce','\x27\x20for\x20','logDeleted','startsWith','deleted','uniqueServerName','max','kind','set','keys','\x20(referenced\x20in\x20journey\x20','versionNumber','split','2656nWcfkw','activation_deleted','segment_deleted','SEGMENT_SYNTAX_ERROR','Segment\x20not\x20found','JOURNEY_SYNTAX_ERROR','updated','\x20segment\x20from\x20file:\x20','):\x20','journeys','./journey-yaml.js','Updated\x20segment\x20\x27','waitStepType','createSegment','toLowerCase','WaitStep','yamlConfig','2118508NMszVS','sha1','diff','journeyStages','segmentNameToId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','__pending_','verbose','parentSegmentFolder','Duration','behavior','draft','logInfo','data','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','add','resolveSegment','journeyActivationNameToId','trim','yamlActivation','and\x20the\x20server\x20segment,\x20then\x20retry.','slice','3246aoUiLY','uniqueSegmentName','Entry\x20criteria:\x20','folderId','embedded_activation_creating','steps','createActivation','fetchJourney','schedule','createdSegmentId','journey_created','segment_creating','Failed\x20to\x20','connection','parentId','name','__pending_act_','Creating\x20segment\x20\x27','idToEmailMap','digest','\x0a\x20\x20','folder','activation_','embeddedSegmentNameToId','conditionTimeoutUnit','onProgress','activation_created','embedded_segment_created','segment_deleting','rule','getSegment','NOT_FOUND','stages','getJourney','milestone','size','\x27\x20exit\x20criteria','resolveJourneyId','logSuccess','absolutePath','journeyById','conditionSegmentId','ACTIVATION_UPDATE_ERROR','conditionTimeoutDuration','segments','existingActivation','getLatestJourneyId','Updating\x20segment\x20\x27','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','deps','hasChanges','segment','index','length','Created\x20segment\x20\x27','conditions','rootFolderId','waitStepUnit','journey','tdx.sdk.push-workflow','includes','Matched\x20server\x20segment\x20\x27','embedded_activation_created','SEGMENT_UPDATE_ERROR','parse','Creating\x20folder\x20\x27','errors','list','delete','all_columns','activationActions','with','toISOString','Creating\x20activation\x20\x27','state','Updated\x20journey\x20\x27','type','map','Deleted\x20activation\x20\x27','action','parseDocument','object','entries','\x27\x20to\x20local\x20\x27','journeyName','listActivations','ACTIVATION_SYNTAX_ERROR',').\x20','\x27\x20by\x20rule\x20content','push','embedded_segment_creating','attributes','../../utils/async.js','1055Jasgpy','item','161764yGaBQF','message','description','segmentId','filter','journey_updated','dirname','.$1.push-recovery.json','createJourneySegment','Created\x20folder\x20\x27','waitStep','from','Embedded\x20segment\x20\x27','existingJourney','\x27...','idToName','updateActivation','utf-8','Segment\x20not\x20found:\x20','columns','Updated\x20activation\x20\x27','validatedRequest','nameToId','relationships','stage\x20\x27','activationStepsById','\x27\x20wait\x20condition','DecisionPoint','activation_deleting','journeyBundleName','goal','existingSegment','2052576LFudxg','isNew','toString','get','deleteActivation','journeyActivationStepId','entry_criteria','Stage\x20\x27','createdSegmentIds','journeyId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','unchanged','Deleted\x20segment\x20\x27','folderPath','resolvedRule'];a142_0x3d03=function(){return _0x200918;};return a142_0x3d03();}export function createSegmentIdResolver(_0x58dff9,_0x17ddf3){return async _0x478668=>{const _0x4b5458=a142_0x361a,_0x267f0c=_0x58dff9[_0x4b5458(0x1b1)](_0x478668);if(!_0x267f0c)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x478668+_0x4b5458(0x21f)+_0x17ddf3+'\x27)');return _0x267f0c;};}export function extractRootFolderId(_0x34e8ca){const _0x5f34c9=a142_0x5b9def;return _0x34e8ca['relationships']?.[_0x5f34c9(0x222)]?.[_0x5f34c9(0x126)]?.['id']||_0x34e8ca[_0x5f34c9(0x1a5)]?.['parentFolder']?.[_0x5f34c9(0x126)]?.['id'];}export function buildConnectionMaps(_0x3c21b5){const _0x30513f=a142_0x5b9def,_0x3baa62=new Map(),_0x4770a7=new Map(),_0x3c08d0=new Map();for(const _0x8a28b3 of _0x3c21b5){_0x3baa62[_0x30513f(0x204)](_0x8a28b3[_0x30513f(0x13e)],parseInt(_0x8a28b3['id'],0xa)),_0x4770a7['set'](_0x8a28b3['id'],_0x8a28b3[_0x30513f(0x13e)]),_0x3c08d0[_0x30513f(0x204)](_0x8a28b3['name'],_0x8a28b3[_0x30513f(0x17b)]);}return{'nameToId':_0x3baa62,'idToName':_0x4770a7,'nameToType':_0x3c08d0};}export function calculatePushStats(_0xe93db,_0xb38064,_0x1b2d5b,_0x3146d5,_0x2da9b2,_0x24be96,_0x52b4b3){const _0x598222=a142_0x5b9def,_0x1a97a8=_0xe93db[_0x598222(0x192)](_0x132ba0=>_0x132ba0['isNew']),_0x1bdd93=_0xe93db[_0x598222(0x192)](_0x3dcac8=>!_0x3dcac8[_0x598222(0x1af)]&&_0x3dcac8[_0x598222(0x161)]),_0x4ff01d=_0xe93db[_0x598222(0x192)](_0x5d39d8=>!_0x5d39d8[_0x598222(0x1af)]&&!_0x5d39d8[_0x598222(0x161)]),_0x44fc87=_0x24be96?_0x3146d5:[],_0x428971=_0xb38064[_0x598222(0x192)](_0x8d6c12=>_0x8d6c12[_0x598222(0x1af)]),_0x3b5db0=_0xb38064[_0x598222(0x192)](_0x5e539b=>!_0x5e539b[_0x598222(0x1af)]&&_0x5e539b['hasChanges']),_0x32d691=_0xb38064['filter'](_0x105875=>!_0x105875[_0x598222(0x1af)]&&!_0x105875[_0x598222(0x161)]),_0x3a821c=_0x24be96?_0x2da9b2:[],_0x56e3be=_0xe93db[_0x598222(0x1e8)](_0x5abff6=>_0x5abff6[_0x598222(0x175)]),_0x24e705=_0x56e3be[_0x598222(0x192)](_0x2a4955=>_0x2a4955[_0x598222(0x17b)]==='create'),_0x103696=_0x56e3be[_0x598222(0x192)](_0x183580=>_0x183580[_0x598222(0x17b)]==='update'),_0x1e6ac8=_0x56e3be[_0x598222(0x192)](_0x16f664=>_0x16f664[_0x598222(0x17b)]===_0x598222(0x173)),_0x22d502=Array[_0x598222(0x199)](_0x1b2d5b)[_0x598222(0x1f8)](),_0x37367a=_0x52b4b3?![]:_0x1a97a8[_0x598222(0x164)]>0x0||_0x1bdd93[_0x598222(0x164)]>0x0||_0x44fc87[_0x598222(0x164)]>0x0,_0x65404e=_0x428971[_0x598222(0x164)]>0x0||_0x3b5db0[_0x598222(0x164)]>0x0||_0x3a821c['length']>0x0,_0x2f6f2c=_0x52b4b3?![]:_0x56e3be[_0x598222(0x164)]>0x0,_0x2d2286=_0x22d502['length']>0x0;return{'segments':{'new':_0x1a97a8,'changed':_0x1bdd93,'unchanged':_0x4ff01d,'toDelete':_0x44fc87},'journeys':{'new':_0x428971,'changed':_0x3b5db0,'unchanged':_0x32d691,'toDelete':_0x3a821c},'activations':{'all':_0x56e3be,'toCreate':_0x24e705,'toUpdate':_0x103696,'toDelete':_0x1e6ac8},'folders':{'toCreate':_0x22d502},'counts':{'segments':{'new':_0x1a97a8[_0x598222(0x164)],'changed':_0x1bdd93[_0x598222(0x164)],'unchanged':_0x4ff01d[_0x598222(0x164)],'toDelete':_0x44fc87[_0x598222(0x164)]},'journeys':{'new':_0x428971[_0x598222(0x164)],'changed':_0x3b5db0[_0x598222(0x164)],'unchanged':_0x32d691['length'],'toDelete':_0x3a821c[_0x598222(0x164)]},'activations':{'create':_0x24e705['length'],'update':_0x103696['length'],'delete':_0x1e6ac8['length']},'folders':_0x22d502[_0x598222(0x164)]},'hasChanges':_0x37367a||_0x65404e||_0x2f6f2c||_0x2d2286};}export async function buildPushExecutionContext(_0x17735f,_0x4fcf2a,_0x2d192c,_0x3a2946,_0x9349ef,_0x388ab2){const _0x87b22d=a142_0x5b9def,_0x50bdb9=extractRootFolderId(_0x2d192c),{pathToId:_0x24e3a3,idToPath:_0x24d90b}=buildFolderMaps(_0x9349ef),_0x5157de=buildSegmentNameToIdMap(_0x3a2946),_0x26ef8b=new Map(),{batchAsync:_0x47e665}=await import(_0x87b22d(0x18b)),[_0x2b6c79,_0x3d5a0b]=await Promise['all']([_0x17735f['user']['buildUserMaps'](),_0x17735f['connection'][_0x87b22d(0x172)](),((async()=>{const _0x386b6c=_0x87b22d;!_0x388ab2&&_0x3a2946[_0x386b6c(0x164)]>0x0&&await _0x47e665(_0x3a2946,async _0x4941e4=>{const _0x250a96=_0x386b6c,_0x67dd8f=await _0x17735f[_0x250a96(0x162)][_0x250a96(0x184)](_0x4fcf2a,_0x4941e4['id']);_0x26ef8b[_0x250a96(0x204)](_0x4941e4['id'],_0x67dd8f);});})())]),{emailToId:_0x16df21,idToEmail:_0x22659c}=_0x2b6c79,_0x54b829=buildConnectionMaps(_0x3d5a0b);return{'rootFolderId':_0x50bdb9,'folderPathToId':_0x24e3a3,'folderIdToPath':_0x24d90b,'segmentNameToId':_0x5157de,'activationsBySegmentId':_0x26ef8b,'emailToIdMap':_0x16df21,'idToEmailMap':_0x22659c,'connectionNameToIdMap':_0x54b829[_0x87b22d(0x1a4)],'connectionIdToNameMap':_0x54b829[_0x87b22d(0x19d)],'connectionNameToTypeMap':_0x54b829['nameToType']};}export function createPushYamlContextForBundle(_0xa7bf1,_0x2cd9ec,_0x230b87,_0x397bbf,_0x414c15,_0x5648ba,_0x509c10,_0x20e76c){const {existingLocalSegmentNames:_0x4a1a65,localExpandedRuleToNames:_0xf4c73a}=_0x397bbf,_0xa290e1=new Set(),_0x2a8e47=new Map(),_0x4ab824=new Map(),_0x258af5=new Map(),_0x9fb272=createJumpTargetCache(),_0x1fc254=new Map(),_0x4f1289=new Map(),_0x36a6bc=new Set();let _0xc18c34;const _0x2a1a55=_0x4081ac=>{const _0x29b8aa={'resolveSegment':async _0x599cf9=>{const _0x481030=a142_0x361a,_0x14bec7=_0x258af5['get'](_0x599cf9);if(_0x14bec7!==undefined)return{'name':_0x14bec7,'isJourneyLocal':!![]};try{const _0x162c61=await fetchSegment(_0xa7bf1,_0x2cd9ec,_0x599cf9,_0x230b87);if(!_0x162c61)throw new Error(_0x481030(0x20d));const _0x53a872=generateJourneyLocalName(_0x162c61[_0x481030(0x13e)]),_0x1c5d81=_0x162c61[_0x481030(0x203)]===SEGMENT_KIND_JOURNEY&&_0x53a872!==undefined;let _0x5e0a73=_0x162c61['name'],_0x4b7a91;if(_0x1c5d81&&_0x162c61['rule']){const _0x1f74da=apiRuleToYaml(_0x162c61[_0x481030(0x14c)]);_0x4f1289[_0x481030(0x204)](_0x599cf9,_0x1f74da);const _0x58187f=async _0x25f0db=>{const _0x3de00d=_0x481030,_0x72c375=collectSegmentRefsFromRule(_0x25f0db);for(const _0x319ba0 of _0x72c375){if(!_0x4f1289['has'](_0x319ba0))try{const _0x49d485=await fetchSegment(_0xa7bf1,_0x2cd9ec,_0x319ba0,_0x230b87);if(_0x49d485?.[_0x3de00d(0x14c)]){const _0x538d7e=apiRuleToYaml(_0x49d485['rule']);_0x4f1289[_0x3de00d(0x204)](_0x319ba0,_0x538d7e),await _0x58187f(_0x538d7e);}}catch(_0xacd245){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x319ba0+':\x20'+_0xacd245);}}};await _0x58187f(_0x1f74da);const _0x297e8b=serializeExpandedRule(_0x1f74da,_0x4f1289),_0x45ff5b=_0xf4c73a[_0x481030(0x1b1)](_0x297e8b);if(_0x45ff5b&&_0x45ff5b[_0x481030(0x164)]>0x0){const _0x21edd2=_0x2a8e47[_0x481030(0x1b1)](_0x297e8b)||0x0,_0x502978=_0x45ff5b[_0x21edd2]||_0x45ff5b[_0x45ff5b[_0x481030(0x164)]-0x1];_0x2a8e47[_0x481030(0x204)](_0x297e8b,_0x21edd2+0x1),_0x5e0a73=_0x502978,_0xa290e1[_0x481030(0x128)](_0x5e0a73),_0x258af5['set'](_0x599cf9,_0x5e0a73);const _0x57c73b=await resolveRuleSegmentRefs(_0x1f74da,async _0xfad175=>{const _0x46368c=_0x481030,_0x2cc824=_0x258af5[_0x46368c(0x1b1)](_0xfad175);if(_0x2cc824)return _0x2cc824;const _0x50feba=await _0xc18c34[_0x46368c(0x129)](_0xfad175);return _0x50feba[_0x46368c(0x13e)];});_0x4b7a91={'description':_0x162c61[_0x481030(0x190)],'rule':_0x57c73b};}else{const _0x5eb0e7=_0x1fc254[_0x481030(0x1b1)](_0x297e8b);if(_0x5eb0e7)_0x5e0a73=_0x5eb0e7,_0x258af5[_0x481030(0x204)](_0x599cf9,_0x5e0a73);else{if(_0x53a872){let _0x499af1=_0x53a872,_0x43fdac=0x2;while(_0xa290e1[_0x481030(0x1da)](_0x499af1)||_0x4a1a65[_0x481030(0x1da)](_0x499af1)){_0x499af1=_0x53a872+'_'+_0x43fdac,_0x43fdac++;}_0xa290e1[_0x481030(0x128)](_0x499af1),_0x5e0a73=_0x499af1;}_0x258af5[_0x481030(0x204)](_0x599cf9,_0x5e0a73),_0x1fc254[_0x481030(0x204)](_0x297e8b,_0x5e0a73);const _0x32bed2=await resolveRuleSegmentRefs(_0x1f74da,async _0x471d65=>{const _0x476c58=_0x481030,_0x262201=_0x258af5[_0x476c58(0x1b1)](_0x471d65);if(_0x262201)return _0x262201;const _0x1124e4=await _0xc18c34[_0x476c58(0x129)](_0x471d65);return _0x1124e4['name'];});_0x4b7a91={'description':_0x162c61[_0x481030(0x190)],'rule':_0x32bed2};}}}return{'name':_0x5e0a73,'isJourneyLocal':_0x1c5d81,'definition':_0x4b7a91};}catch(_0x314732){return logger[_0x481030(0x1c7)]('Failed\x20to\x20resolve\x20segment\x20'+_0x599cf9+':\x20'+_0x314732),{'name':_0x599cf9,'isJourneyLocal':![]};}},'resolveActivation':async _0x32f078=>{const _0x358bae=a142_0x361a,_0x1f4181=_0x4ab824[_0x358bae(0x1b1)](_0x32f078);if(_0x1f4181!==undefined)return{'name':_0x1f4181,'isJourneyLocal':!![]};try{let _0x4f15b3=_0x509c10?.[_0x358bae(0x1b1)](_0x32f078);!_0x4f15b3&&(_0x4f15b3=await _0xa7bf1[_0x358bae(0x169)][_0x358bae(0x1f6)](_0x4081ac,_0x32f078));const _0x4d5886=_0x4f15b3[_0x358bae(0x18a)][_0x358bae(0x1c1)][_0x358bae(0x13e)]||_0x32f078,_0x55a139=sanitizeYamlKey(_0x4d5886)||_0x358bae(0x145)+_0x32f078,_0x1976a3=_0x55a139;_0x4ab824[_0x358bae(0x204)](_0x32f078,_0x1976a3);const _0x125385=journeyActivationStepToYaml(_0x4f15b3,_0x414c15,_0x5648ba);return{'name':_0x1976a3,'isJourneyLocal':!![],'definition':_0x125385};}catch(_0x37d7f6){return logger['debug']('Failed\x20to\x20resolve\x20activation\x20'+_0x32f078+':\x20'+_0x37d7f6),{'name':_0x32f078,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x20e54c,_0x17369b)=>resolveJumpTarget(_0x20e54c,_0x17369b,_0x9fb272,async _0x26d12c=>{const _0x3b65c3=a142_0x361a,_0x1fee34=_0x20e76c?.[_0x3b65c3(0x1b1)](_0x26d12c);if(_0x1fee34)return _0x1fee34;return _0xa7bf1[_0x3b65c3(0x169)][_0x3b65c3(0x150)](_0x26d12c);})};return _0xc18c34=_0x29b8aa,_0x29b8aa;},_0x3e8e13=async _0x2f1c4c=>{const _0x1836e7=a142_0x361a,{collectSegmentIdsFromJourneyApi:_0x5744a6}=await import(_0x1836e7(0x213)),{batchAsync:_0x4f4aef}=await import(_0x1836e7(0x18b)),_0x256c51=new Set();for(const _0x400ad5 of _0x2f1c4c){let _0x4bafe2=_0x20e76c?.[_0x1836e7(0x1b1)](_0x400ad5);!_0x4bafe2&&(_0x4bafe2=await _0xa7bf1[_0x1836e7(0x169)][_0x1836e7(0x150)](_0x400ad5));const _0x508e90=_0x5744a6(_0x4bafe2);for(const _0x476035 of _0x508e90){_0x256c51[_0x1836e7(0x128)](_0x476035);}}let _0x1ee74f=Array[_0x1836e7(0x199)](_0x256c51);while(_0x1ee74f['length']>0x0){const _0x2f83b2=_0x1ee74f[_0x1836e7(0x192)](_0x39b3a5=>!_0x36a6bc[_0x1836e7(0x1da)](_0x39b3a5));if(_0x2f83b2[_0x1836e7(0x164)]===0x0)break;const _0x372698=await _0x4f4aef(_0x2f83b2,async _0x4973ed=>{const _0x4653df=_0x1836e7;_0x36a6bc[_0x4653df(0x128)](_0x4973ed);const _0x11aa5b=await fetchSegment(_0xa7bf1,_0x2cd9ec,_0x4973ed,_0x230b87);if(!_0x11aa5b)return null;return{'segmentId':_0x4973ed,'segment':_0x11aa5b};},0xa),_0x2018cf=new Set();for(const _0x5b05c0 of _0x372698){if(!_0x5b05c0?.[_0x1836e7(0x162)]?.[_0x1836e7(0x14c)])continue;const _0x8cc859=apiRuleToYaml(_0x5b05c0[_0x1836e7(0x162)][_0x1836e7(0x14c)]);_0x4f1289['set'](_0x5b05c0[_0x1836e7(0x191)],_0x8cc859);const _0x3acac9=collectSegmentRefsFromRule(_0x8cc859);for(const _0x4dad1a of _0x3acac9){!_0x36a6bc[_0x1836e7(0x1da)](_0x4dad1a)&&_0x2018cf[_0x1836e7(0x128)](_0x4dad1a);}}_0x1ee74f=Array[_0x1836e7(0x199)](_0x2018cf);}};return{'createYamlContext':_0x2a1a55,'prefetchJourneySegments':_0x3e8e13};}export async function executePushSegments(_0x2db69b,_0x40115f,_0x2aa1d1,_0x559fff,_0x589abb){const _0x2fc3b1=a142_0x5b9def,{segmentDefToCreateRequest:_0x2b342d,segmentDefToUpdateRequest:_0x45929b}=await import('./child-segment-yaml.js'),_0x2469b7=_0x2aa1d1[_0x2fc3b1(0x1db)],_0x46411f=0x5,_0x234530=async _0x19e058=>{const _0x564c78=_0x2fc3b1,_0xc03415=_0x19e058[_0x564c78(0x1bb)]?_0x2469b7[_0x564c78(0x1b1)](_0x19e058[_0x564c78(0x1bb)]):undefined;let _0x49f1af;const _0x565587={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x99d17b=_0x19e058[_0x564c78(0x219)];if(_0x19e058[_0x564c78(0x219)][_0x564c78(0x14c)]){const _0x3d170c=createSegmentIdResolver(_0x2aa1d1[_0x564c78(0x21e)],_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]),_0x4c628d=await resolveRuleSegmentIds(_0x19e058['yamlConfig'][_0x564c78(0x14c)],_0x3d170c);_0x99d17b={..._0x19e058[_0x564c78(0x219)],'rule':_0x4c628d};}try{if(_0x19e058[_0x564c78(0x1af)]){_0x589abb[_0x564c78(0x148)]?.({'type':_0x564c78(0x13a),'name':_0x19e058['yamlConfig']['name']});const _0x29a80e=_0x2b342d(_0x99d17b,_0xc03415),_0x33ece8=await _0x589abb[_0x564c78(0x1eb)](_0x564c78(0x140)+_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]+'\x27...',()=>_0x2db69b['segment'][_0x564c78(0x216)](_0x559fff['parentId'],_0x29a80e));_0x49f1af=_0x33ece8['data']['id'],_0x2aa1d1[_0x564c78(0x21e)][_0x564c78(0x204)](_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)],_0x49f1af),_0x565587[_0x564c78(0x138)]={'name':_0x19e058['yamlConfig'][_0x564c78(0x13e)],'id':_0x49f1af},_0x589abb[_0x564c78(0x148)]?.({'type':'segment_created','name':_0x19e058['yamlConfig'][_0x564c78(0x13e)],'segmentId':_0x49f1af}),_0x589abb[_0x564c78(0x155)]?.(_0x564c78(0x165)+_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]+'\x27'),_0x565587[_0x564c78(0x1fa)]=0x1;}else{if(_0x19e058['hasChanges']){_0x589abb[_0x564c78(0x148)]?.({'type':'segment_updating','name':_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]});const _0x22ed54=_0x45929b(_0x99d17b);_0xc03415!==_0x19e058[_0x564c78(0x1ad)]?.[_0x564c78(0x1d7)]&&(_0x22ed54['segmentFolderId']=_0xc03415?parseInt(_0xc03415,0xa):undefined),await _0x589abb[_0x564c78(0x1eb)](_0x564c78(0x15e)+_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]+_0x564c78(0x19c),()=>_0x2db69b['segment'][_0x564c78(0x1df)](_0x559fff[_0x564c78(0x13d)],_0x19e058[_0x564c78(0x1ad)]['id'],_0x22ed54)),_0x49f1af=_0x19e058[_0x564c78(0x1ad)]['id'],_0x589abb['onProgress']?.({'type':'segment_updated','name':_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)]}),_0x589abb['logSuccess']?.(_0x564c78(0x214)+_0x19e058['yamlConfig']['name']+'\x27'),_0x565587[_0x564c78(0x20f)]=0x1;}else _0x49f1af=_0x19e058[_0x564c78(0x1ad)]['id'];}}catch(_0x4efde8){const _0x45d614=isHttp400Error(_0x4efde8),_0x1e0b2d=_0x45d614?ErrorCode[_0x564c78(0x20c)]:ErrorCode[_0x564c78(0x16e)],_0x513398=getErrorMessage(_0x4efde8);throw new SDKError(_0x1e0b2d,'Failed\x20to\x20'+(_0x19e058[_0x564c78(0x1af)]?_0x564c78(0x1d1):_0x564c78(0x1c3))+_0x564c78(0x210)+_0x19e058[_0x564c78(0x156)]+_0x564c78(0x143)+_0x513398,_0x4efde8);}try{const _0x1bd399=await syncActivationsForSegment(_0x2db69b,_0x559fff[_0x564c78(0x13d)],_0x49f1af,_0x19e058[_0x564c78(0x219)][_0x564c78(0x13e)],_0x19e058[_0x564c78(0x175)],_0x589abb,_0x19e058['absolutePath']);_0x565587[_0x564c78(0x1d5)]=_0x1bd399;}catch(_0x448ade){if(_0x448ade instanceof SDKError)throw _0x448ade;throw new SDKError(ErrorCode[_0x564c78(0x159)],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x19e058['yamlConfig']['name']+_0x564c78(0x1c9)+_0x19e058[_0x564c78(0x156)]+_0x564c78(0x143)+getErrorMessage(_0x448ade),_0x448ade);}return _0x565587;},_0x44771e=await batchAsync(_0x40115f,_0x234530,_0x46411f),_0x2f2bd7={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x457462 of _0x44771e){_0x2f2bd7[_0x2fc3b1(0x1fa)]+=_0x457462[_0x2fc3b1(0x1fa)],_0x2f2bd7[_0x2fc3b1(0x20f)]+=_0x457462['updated'],_0x457462[_0x2fc3b1(0x138)]&&_0x2f2bd7[_0x2fc3b1(0x1b6)][_0x2fc3b1(0x204)](_0x457462[_0x2fc3b1(0x138)][_0x2fc3b1(0x13e)],_0x457462[_0x2fc3b1(0x138)]['id']),_0x2f2bd7[_0x2fc3b1(0x1d5)]['created']+=_0x457462[_0x2fc3b1(0x1d5)]['created'],_0x2f2bd7['activations'][_0x2fc3b1(0x20f)]+=_0x457462[_0x2fc3b1(0x1d5)]['updated'],_0x2f2bd7['activations'][_0x2fc3b1(0x200)]+=_0x457462['activations'][_0x2fc3b1(0x200)];}return _0x2f2bd7;}async function syncActivationsForSegment(_0x180cca,_0x15643a,_0x4b8441,_0x497751,_0x1401b8,_0x5391e8,_0x13395a){const _0x272d6f=a142_0x5b9def,_0x541fcb={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x28e38b of _0x1401b8){try{if(_0x28e38b['type']===_0x272d6f(0x1d1)&&_0x28e38b[_0x272d6f(0x1a3)])_0x5391e8[_0x272d6f(0x148)]?.({'type':'activation_creating','segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),await _0x5391e8[_0x272d6f(0x1eb)](_0x272d6f(0x178)+_0x28e38b[_0x272d6f(0x13e)]+_0x272d6f(0x19c),()=>_0x180cca[_0x272d6f(0x162)][_0x272d6f(0x135)](_0x15643a,_0x4b8441,_0x28e38b[_0x272d6f(0x1a3)])),_0x5391e8['onProgress']?.({'type':_0x272d6f(0x149),'segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),_0x5391e8[_0x272d6f(0x155)]?.(_0x272d6f(0x1ed)+_0x28e38b[_0x272d6f(0x13e)]+'\x27'),_0x541fcb['created']++;else{if(_0x28e38b[_0x272d6f(0x17b)]==='update'&&_0x28e38b[_0x272d6f(0x1a3)]&&_0x28e38b[_0x272d6f(0x15c)])_0x5391e8['onProgress']?.({'type':'activation_updating','segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),await _0x5391e8['withProgress']('Updating\x20activation\x20\x27'+_0x28e38b[_0x272d6f(0x13e)]+_0x272d6f(0x19c),()=>_0x180cca['segment'][_0x272d6f(0x19e)](_0x15643a,_0x4b8441,_0x28e38b[_0x272d6f(0x15c)]['id'],_0x28e38b[_0x272d6f(0x1a3)])),_0x5391e8['onProgress']?.({'type':'activation_updated','segmentName':_0x497751,'activationName':_0x28e38b['name']}),_0x5391e8[_0x272d6f(0x155)]?.(_0x272d6f(0x1a2)+_0x28e38b[_0x272d6f(0x13e)]+'\x27'),_0x541fcb[_0x272d6f(0x20f)]++;else _0x28e38b['type']===_0x272d6f(0x173)&&_0x28e38b[_0x272d6f(0x15c)]&&(_0x5391e8[_0x272d6f(0x148)]?.({'type':_0x272d6f(0x1aa),'segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),await _0x5391e8[_0x272d6f(0x1eb)]('Deleting\x20activation\x20\x27'+_0x28e38b['name']+_0x272d6f(0x19c),()=>_0x180cca[_0x272d6f(0x162)][_0x272d6f(0x1b2)](_0x15643a,_0x4b8441,_0x28e38b[_0x272d6f(0x15c)]['id'])),_0x5391e8['onProgress']?.({'type':_0x272d6f(0x20a),'segmentName':_0x497751,'activationName':_0x28e38b[_0x272d6f(0x13e)]}),_0x5391e8[_0x272d6f(0x1fe)]?.(_0x272d6f(0x17d)+_0x28e38b[_0x272d6f(0x13e)]+'\x27'),_0x541fcb[_0x272d6f(0x200)]++);}}catch(_0x34c63c){const _0x3804b4=isHttp400Error(_0x34c63c),_0x3f18d9=_0x3804b4?ErrorCode[_0x272d6f(0x185)]:ErrorCode[_0x272d6f(0x159)],_0x2c87ab=getErrorMessage(_0x34c63c);throw new SDKError(_0x3f18d9,'Failed\x20to\x20'+_0x28e38b['type']+'\x20activation\x20\x27'+_0x28e38b[_0x272d6f(0x13e)]+'\x27\x20from\x20file:\x20'+_0x13395a+_0x272d6f(0x143)+_0x2c87ab,_0x34c63c);}}return _0x541fcb;}export async function executePushFolders(_0x1a8917,_0x39202f,_0x6efc97,_0xaea03a,_0x213591){const _0x1910d8=a142_0x5b9def,_0x26d6bf=new Map(_0x6efc97),_0xbcf289=sortFoldersByDepth(_0x39202f);for(const _0x3225ba of _0xbcf289){const _0x109f61=_0x3225ba['split']('/'),_0xd0c45a=_0x109f61[_0x109f61[_0x1910d8(0x164)]-0x1],_0x59f2f7=_0x109f61[_0x1910d8(0x12e)](0x0,-0x1)[_0x1910d8(0x1e3)]('/'),_0x201eb9=_0x26d6bf['get'](_0x59f2f7);_0x213591[_0x1910d8(0x148)]?.({'type':'folder_creating','folder':_0x3225ba});const _0x21b5d8={'name':_0xd0c45a,'parentFolderId':_0x201eb9},_0x31bb8c=await _0x213591[_0x1910d8(0x1eb)](_0x1910d8(0x170)+_0x3225ba+_0x1910d8(0x19c),()=>_0x1a8917['segment'][_0x1910d8(0x1f4)](_0xaea03a['parentId'],_0x21b5d8));_0x26d6bf[_0x1910d8(0x204)](_0x3225ba,_0x31bb8c[_0x1910d8(0x126)]['id']),_0x213591[_0x1910d8(0x148)]?.({'type':_0x1910d8(0x1ec),'folder':_0x3225ba,'folderId':_0x31bb8c[_0x1910d8(0x126)]['id']}),_0x213591[_0x1910d8(0x125)]?.(_0x1910d8(0x197)+_0x3225ba+'\x27');}return _0x26d6bf;}export async function executePushSegmentDeletions(_0x3ac322,_0x563782,_0x5191a7){const _0x4c988f=a142_0x5b9def;if(_0x563782[_0x4c988f(0x164)]===0x0)return 0x0;const {batchAsync:_0x643a1b}=await import(_0x4c988f(0x18b)),_0x215d35=0x5,_0x4352d1=await _0x643a1b(_0x563782,async _0x4aa51f=>{const _0x32fef7=_0x4c988f;return _0x5191a7[_0x32fef7(0x148)]?.({'type':_0x32fef7(0x14b),'name':_0x4aa51f[_0x32fef7(0x13e)]}),await _0x3ac322['segment'][_0x32fef7(0x1d6)](_0x4aa51f['id']),_0x5191a7[_0x32fef7(0x148)]?.({'type':_0x32fef7(0x20b),'name':_0x4aa51f[_0x32fef7(0x13e)]}),_0x5191a7[_0x32fef7(0x1fe)]?.(_0x32fef7(0x1ba)+_0x4aa51f[_0x32fef7(0x13e)]+'\x27'),0x1;},_0x215d35);return _0x4352d1[_0x4c988f(0x1fc)]((_0x1653bd,_0x363db2)=>_0x1653bd+_0x363db2,0x0);}export async function executePushJourneys(_0x419963,_0x2e5393,_0x59aed5,_0x37d098,_0x4db60a){const _0x4063f4=a142_0x5b9def,{journeyDefToRequest:_0x2c7430}=await import(_0x4063f4(0x213)),{activationDefToCreateRequest:_0x1957a6,yamlRuleToApi:_0x39e886,validateSegmentRule:_0x2ad619}=await import('./child-segment-yaml.js'),_0x528f15={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x43c515=new Map(_0x59aed5[_0x4063f4(0x21e)]),_0x3f6c64=0x5;for(let _0x569a1c=0x0;_0x569a1c<_0x2e5393[_0x4063f4(0x164)];_0x569a1c+=_0x3f6c64){const _0x37f8d9=_0x2e5393[_0x4063f4(0x12e)](_0x569a1c,_0x569a1c+_0x3f6c64),_0x54125d=await Promise['all'](_0x37f8d9[_0x4063f4(0x17c)](async _0x51af5a=>{const _0x3202f0=_0x4063f4;if(!_0x51af5a['isNew']&&!_0x51af5a['hasChanges'])return{'action':'unchanged','name':_0x51af5a[_0x3202f0(0x219)]['name'],'journeyId':_0x51af5a[_0x3202f0(0x19b)]?.['id']};const _0x3ea679=_0x51af5a[_0x3202f0(0x1bb)]?_0x59aed5[_0x3202f0(0x1db)][_0x3202f0(0x1b1)](_0x51af5a[_0x3202f0(0x1bb)]):undefined;_0x4db60a[_0x3202f0(0x148)]?.({'type':_0x51af5a['isNew']?_0x3202f0(0x1c8):_0x3202f0(0x1f7),'name':_0x51af5a[_0x3202f0(0x219)][_0x3202f0(0x13e)]});try{const _0x5b7ab9=await executeSingleJourneyPush(_0x419963,_0x51af5a,{..._0x59aed5,'segmentNameToId':_0x43c515},{'parentId':_0x37d098['parentId'],'rootFolderId':_0x37d098[_0x3202f0(0x167)],'folderId':_0x3ea679,'verbose':_0x37d098[_0x3202f0(0x221)]},_0x4db60a,{'journeyDefToRequest':_0x2c7430,'activationDefToCreateRequest':_0x1957a6,'yamlRuleToApi':_0x39e886,'validateSegmentRule':_0x2ad619});for(const [_0x4ac0c6,_0x3e5b11]of _0x5b7ab9[_0x3202f0(0x146)]){_0x43c515[_0x3202f0(0x204)](_0x4ac0c6,_0x3e5b11),_0x528f15[_0x3202f0(0x146)]['set'](_0x4ac0c6,_0x3e5b11);}if(_0x5b7ab9[_0x3202f0(0x17e)]===_0x3202f0(0x1fa))_0x4db60a['onProgress']?.({'type':_0x3202f0(0x139),'name':_0x51af5a[_0x3202f0(0x219)][_0x3202f0(0x13e)],'journeyId':_0x5b7ab9[_0x3202f0(0x1b7)]}),_0x4db60a[_0x3202f0(0x155)]?.(_0x3202f0(0x1fb)+_0x51af5a[_0x3202f0(0x219)][_0x3202f0(0x13e)]+'\x27'),_0x528f15[_0x3202f0(0x1fa)]++;else _0x5b7ab9[_0x3202f0(0x17e)]===_0x3202f0(0x20f)&&(_0x4db60a[_0x3202f0(0x148)]?.({'type':_0x3202f0(0x193),'name':_0x51af5a[_0x3202f0(0x219)]['name']}),_0x4db60a['logSuccess']?.(_0x3202f0(0x17a)+_0x51af5a[_0x3202f0(0x219)]['name']+'\x27'),_0x528f15['updated']++);return{'action':_0x5b7ab9[_0x3202f0(0x17e)],'name':_0x51af5a['yamlConfig']['name'],'journeyId':_0x5b7ab9[_0x3202f0(0x1b7)]};}catch(_0x59a13d){const _0x294fe3=isHttp400Error(_0x59a13d),_0x65085d=_0x294fe3?ErrorCode[_0x3202f0(0x20e)]:ErrorCode[_0x3202f0(0x1f2)],_0x12898b=getErrorMessage(_0x59a13d);throw new SDKError(_0x65085d,_0x3202f0(0x13b)+(_0x51af5a['isNew']?_0x3202f0(0x1d1):_0x3202f0(0x1c3))+'\x20journey\x20from\x20file:\x20'+_0x51af5a[_0x3202f0(0x156)]+_0x3202f0(0x143)+_0x12898b,_0x59a13d);}}));_0x528f15[_0x4063f4(0x1f0)][_0x4063f4(0x188)](..._0x54125d);}return _0x528f15;}async function matchExistingJourneySegments(_0x187695,_0x42ad9d,_0x5264d0,_0x272e67,_0x6f0ef5){const _0x218112=a142_0x5b9def;if(!_0x42ad9d['existingJourney']||!_0x42ad9d[_0x218112(0x219)]['segments'])return;const _0x428f03=new Map(),_0x2ada2f=new Set();for(const _0x481345 of Object[_0x218112(0x205)](_0x42ad9d[_0x218112(0x219)][_0x218112(0x15b)])){const _0x174349=generateDeterministicJourneySegmentName(_0x42ad9d[_0x218112(0x219)]['name'],_0x481345);_0x428f03[_0x218112(0x204)](_0x174349,_0x481345),_0x2ada2f[_0x218112(0x128)](_0x481345);}const _0x5874f3=[],_0x46139e=collectSegmentIdsFromJourneyApi(_0x42ad9d[_0x218112(0x19b)]);for(const _0x320f22 of _0x46139e){const _0x1693b5=await fetchSegment(_0x187695,_0x5264d0,_0x320f22,_0x272e67);if(!_0x1693b5?.[_0x218112(0x13e)])continue;const _0x526211=_0x428f03[_0x218112(0x1b1)](_0x1693b5[_0x218112(0x13e)]);_0x526211?(_0x6f0ef5[_0x218112(0x204)](_0x526211,_0x320f22),_0x2ada2f['delete'](_0x526211)):_0x5874f3[_0x218112(0x188)]({'id':_0x320f22,'seg':_0x1693b5});}if(_0x2ada2f[_0x218112(0x152)]>0x0&&_0x5874f3[_0x218112(0x164)]>0x0){const {localExpandedRuleToNames:_0x2b3e2d}=buildLocalExpandedRuleMappings(_0x42ad9d[_0x218112(0x219)]),_0x247a44=new Map();for(const {id:_0x5a91ca,seg:_0x45b543}of _0x5874f3){if(_0x45b543[_0x218112(0x14c)]){const _0x3b2937=apiRuleToYaml(_0x45b543[_0x218112(0x14c)]);_0x247a44['set'](_0x5a91ca,_0x3b2937);}}for(const {id:_0x48f4f2,seg:_0x5e697f}of _0x5874f3){if(!_0x5e697f[_0x218112(0x14c)])continue;const _0x1de032=_0x247a44[_0x218112(0x1b1)](_0x48f4f2);if(!_0x1de032)continue;const _0x1a52f5=serializeExpandedRule(_0x1de032,_0x247a44),_0x2bc24c=_0x2b3e2d[_0x218112(0x1b1)](_0x1a52f5);if(_0x2bc24c){const _0x4fee32=_0x2bc24c[_0x218112(0x1c5)](_0x102a62=>_0x2ada2f['has'](_0x102a62));_0x4fee32&&(_0x6f0ef5[_0x218112(0x204)](_0x4fee32,_0x48f4f2),_0x2ada2f[_0x218112(0x173)](_0x4fee32),logger[_0x218112(0x1c7)](_0x218112(0x16c)+_0x5e697f[_0x218112(0x13e)]+_0x218112(0x182)+_0x4fee32+_0x218112(0x187)));}}}}async function executeSingleJourneyPush(_0x2395a0,_0x197416,_0x122c1d,_0x2edff7,_0x223588,_0x4c4a77){const _0x10b21c=a142_0x5b9def,{journeyDefToRequest:_0x2ec786,activationDefToCreateRequest:_0x396506,yamlRuleToApi:_0x21943c,validateSegmentRule:_0x38225c}=_0x4c4a77,_0x5b0685=new Map(),_0x13bbc8=new Map();recoverSegmentIdsFromPushRecovery(_0x197416,_0x5b0685,_0x122c1d[_0x10b21c(0x21e)]);const _0x44756b=new Map(),_0x4e1579=new Map(),_0x166001=new Map();let _0x1fa7f5;const _0x1e2806=async()=>{const _0xaa1403=_0x10b21c;if(_0x1fa7f5)return;_0x1fa7f5=new Map();if(!_0x197416[_0xaa1403(0x19b)])return;const _0x3bebbc=await _0x2395a0[_0xaa1403(0x169)][_0xaa1403(0x184)](_0x197416[_0xaa1403(0x19b)]['id']);for(const _0x2c902a of _0x3bebbc){const _0x7cc1f6=journeyActivationStepToYaml(_0x2c902a,_0x122c1d[_0xaa1403(0x141)],_0x122c1d['connectionIdToNameMap']),_0x2c4b1a=activationSignature(_0x7cc1f6);!_0x1fa7f5[_0xaa1403(0x1da)](_0x2c4b1a)&&_0x1fa7f5[_0xaa1403(0x204)](_0x2c4b1a,_0x2c902a['id']),_0x7cc1f6[_0xaa1403(0x13e)]&&_0x13bbc8['set'](_0x7cc1f6[_0xaa1403(0x13e)],_0x2c902a['id']);}};await matchExistingJourneySegments(_0x2395a0,_0x197416,_0x2edff7[_0x10b21c(0x13d)],_0x122c1d[_0x10b21c(0x1ee)],_0x122c1d[_0x10b21c(0x21e)]);const _0x2cc9ae={'resolveSegmentId':async _0x417922=>{const _0x5b8a97=_0x10b21c,_0x121936=_0x122c1d['segmentNameToId'][_0x5b8a97(0x1b1)](_0x417922);if(!_0x121936)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5b8a97(0x1a0)+_0x417922+'\x20(referenced\x20in\x20journey\x20'+_0x197416[_0x5b8a97(0x219)][_0x5b8a97(0x13e)]+')');return _0x121936;},'resolveEmbeddedSegmentId':async(_0x10f796,_0x1525cc)=>{const _0x1cbd3d=_0x10b21c,_0x1b4377=_0x122c1d[_0x1cbd3d(0x21e)][_0x1cbd3d(0x1b1)](_0x10f796);if(_0x1b4377)return _0x1b4377;const _0x26cb47=_0x122c1d[_0x1cbd3d(0x1ee)][_0x1cbd3d(0x1c5)](_0x2826bf=>_0x2826bf[_0x1cbd3d(0x13e)]===_0x10f796);if(_0x26cb47)return _0x122c1d[_0x1cbd3d(0x21e)]['set'](_0x10f796,_0x26cb47['id']),_0x26cb47['id'];if(_0x197416[_0x1cbd3d(0x1af)]){const {stageName:_0x467ed5,criteriaName:_0x30fd7f}=findSegmentCriteriaLocation(_0x197416[_0x1cbd3d(0x219)],_0x10f796);return _0x38225c(_0x10f796,_0x1525cc[_0x1cbd3d(0x14c)]),_0x4e1579['set'](_0x10f796,{'definition':_0x1525cc,'stageName':_0x467ed5,'criteriaName':_0x30fd7f}),createPendingSegmentId(_0x10f796);}const _0x239608=_0x197416[_0x1cbd3d(0x19b)]?.['id'];if(!_0x239608)throw new SDKError(ErrorCode[_0x1cbd3d(0x1d2)],'Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID');const _0x5bd33e=_0x44756b[_0x1cbd3d(0x1b1)](_0x10f796);if(_0x5bd33e)return _0x5bd33e;const _0x1ba79c=((async()=>{const _0x522c5b=_0x1cbd3d;_0x38225c(_0x10f796,_0x1525cc[_0x522c5b(0x14c)]);const _0x305d47=generateDeterministicJourneySegmentName(_0x197416['yamlConfig'][_0x522c5b(0x13e)],_0x10f796),_0x4c19d6=_0x122c1d[_0x522c5b(0x1ee)][_0x522c5b(0x1c5)](_0x4a0188=>_0x4a0188[_0x522c5b(0x13e)]===_0x305d47),_0x1b35c6=createSegmentIdResolver(_0x122c1d[_0x522c5b(0x21e)],_0x10f796),_0x290bdc=await resolveRuleSegmentIds(_0x1525cc[_0x522c5b(0x14c)],_0x1b35c6);let _0x2a00d4;return _0x4c19d6?(await _0x2395a0['segment'][_0x522c5b(0x1df)](_0x2edff7[_0x522c5b(0x13d)],_0x4c19d6['id'],{'description':_0x1525cc[_0x522c5b(0x190)]||_0x522c5b(0x131)+_0x10f796,'rule':_0x21943c(_0x290bdc,!![]),'countPopulation':!![]}),_0x2a00d4=_0x4c19d6['id'],saveSegmentToPushRecovery(_0x197416[_0x522c5b(0x156)],_0x197416[_0x522c5b(0x219)][_0x522c5b(0x13e)],_0x10f796,{'segmentId':_0x2a00d4,'uniqueServerName':_0x305d47,'createdAt':new Date()[_0x522c5b(0x177)]()})):_0x2a00d4=await createOrRecoverEmbeddedSegment(_0x2395a0,_0x197416,{'localName':_0x10f796,'uniqueSegmentName':_0x305d47,'description':_0x1525cc[_0x522c5b(0x190)]||_0x522c5b(0x131)+_0x10f796,'journeyId':_0x239608,'resolvedRule':_0x290bdc,'parentId':_0x2edff7['parentId'],'folderId':_0x2edff7[_0x522c5b(0x167)]||''},_0x21943c),_0x122c1d[_0x522c5b(0x21e)]['set'](_0x10f796,_0x2a00d4),_0x5b0685[_0x522c5b(0x204)](_0x10f796,_0x2a00d4),_0x2a00d4;})());_0x44756b['set'](_0x10f796,_0x1ba79c);try{return await _0x1ba79c;}finally{_0x44756b['delete'](_0x10f796);}},'resolveActivationId':async _0x1ffe38=>{const _0xa9b4e7=_0x10b21c,_0x215c43=_0x13bbc8[_0xa9b4e7(0x1b1)](_0x1ffe38);if(_0x215c43)return _0x215c43;if(_0x197416['existingJourney']){await _0x1e2806();const _0x17cc35=_0x13bbc8[_0xa9b4e7(0x1b1)](_0x1ffe38);if(_0x17cc35)return _0x17cc35;}throw new SDKError(ErrorCode[_0xa9b4e7(0x14e)],'Activation\x20not\x20found:\x20'+_0x1ffe38+_0xa9b4e7(0x206)+_0x197416[_0xa9b4e7(0x219)][_0xa9b4e7(0x13e)]+_0xa9b4e7(0x186)+_0xa9b4e7(0x1b8));},'resolveEmbeddedActivationId':async(_0x25e30f,_0x3f2b02)=>{const _0x7d805a=_0x10b21c,_0x52940d=_0x13bbc8['get'](_0x25e30f);if(_0x52940d)return _0x52940d;if(_0x197416[_0x7d805a(0x1af)])return _0x166001[_0x7d805a(0x204)](_0x25e30f,_0x3f2b02),createPendingActivationId(_0x25e30f);if(_0x197416['existingJourney']){await _0x1e2806();const _0x45cbe3=_0x13bbc8[_0x7d805a(0x1b1)](_0x3f2b02['name']);if(_0x45cbe3)return _0x13bbc8['set'](_0x25e30f,_0x45cbe3),_0x45cbe3;const _0x23580e=activationSignature(_0x3f2b02),_0x24384c=_0x1fa7f5?.[_0x7d805a(0x1b1)](_0x23580e);if(_0x24384c)return _0x13bbc8['set'](_0x25e30f,_0x24384c),_0x24384c;const _0x54f7cc=await _0x396506(_0x3f2b02,_0x122c1d['activationContext']),_0x5cf1bf={..._0x54f7cc,..._0x3f2b02[_0x7d805a(0x1ef)]!==undefined&&{'runAfterJourneyRefresh':_0x3f2b02[_0x7d805a(0x1ef)]}},_0xc6a545=await _0x2395a0[_0x7d805a(0x169)][_0x7d805a(0x135)](_0x197416[_0x7d805a(0x19b)]['id'],_0x5cf1bf);return _0x13bbc8[_0x7d805a(0x204)](_0x25e30f,_0xc6a545['id']),_0xc6a545['id'];}throw new SDKError(ErrorCode[_0x7d805a(0x1d2)],_0x7d805a(0x127));},'resolveJourneyId':async _0xb1ecd1=>{const _0x3bf19a=_0x10b21c;try{return await _0x2395a0['journey'][_0x3bf19a(0x154)](_0x2edff7['parentId'],_0xb1ecd1);}catch(_0x1ae32c){throw new SDKError(ErrorCode[_0x3bf19a(0x14e)],'Journey\x20\x27'+_0xb1ecd1+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x197416[_0x3bf19a(0x219)][_0x3bf19a(0x13e)]+'\x27)',_0x1ae32c);}},'resolveStageId':async(_0x3a3777,_0xbbf602)=>{const _0x227cec=_0x10b21c,_0xd3b5b0=await _0x2395a0['journey']['getJourney'](_0x3a3777),_0x7fe8f8=_0xd3b5b0[_0x227cec(0x18a)]['journeyStages'][_0x227cec(0x1c5)](_0x3e5ab0=>_0x3e5ab0[_0x227cec(0x13e)][_0x227cec(0x217)]()===_0xbbf602[_0x227cec(0x217)]());if(!_0x7fe8f8?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0x227cec(0x1b5)+_0xbbf602+_0x227cec(0x1ce)+(_0xd3b5b0['attributes']['journeyBundleName']||_0xd3b5b0[_0x227cec(0x18a)][_0x227cec(0x13e)])+'\x27');return _0x7fe8f8['id'];}},_0x2d60b5=await _0x2ec786(_0x197416[_0x10b21c(0x219)],_0x2edff7['parentId'],_0x2cc9ae),_0x2b7064=_0x2edff7[_0x10b21c(0x132)]||_0x2edff7['rootFolderId'];_0x2b7064&&(_0x2d60b5['relationships']={'parentFolder':{'data':{'id':_0x2b7064,'type':_0x10b21c(0x144)}}});if(_0x197416['isNew']){if(_0x4e1579['size']>0x0||_0x166001['size']>0x0)return await executeThreeStepJourneyCreate(_0x2395a0,_0x197416,_0x2d60b5,{'pendingEmbeddedSegments':_0x4e1579,'pendingEmbeddedActivations':_0x166001,'embeddedSegmentNameToId':_0x5b0685,'journeyActivationNameToId':_0x13bbc8},{..._0x2edff7,'effectiveFolderId':_0x2b7064},_0x122c1d,_0x223588,_0x4c4a77);else{ensureJourneyDefaults(_0x2d60b5[_0x10b21c(0x18a)]);const _0x2ccf71=await _0x2395a0['journey']['create'](_0x2d60b5);return deletePushRecovery(_0x197416['absolutePath']),{'action':'created','journeyId':_0x2ccf71['id'],'embeddedSegmentNameToId':_0x5b0685};}}else{if(_0x197416[_0x10b21c(0x161)]&&_0x197416[_0x10b21c(0x19b)]){_0x2d60b5['id']=_0x197416[_0x10b21c(0x19b)]['id'];const _0x4693b0=_0x2d60b5[_0x10b21c(0x18a)];_0x197416['existingJourney'][_0x10b21c(0x18a)]?.[_0x10b21c(0x1ab)]&&(_0x4693b0[_0x10b21c(0x1ab)]=_0x197416[_0x10b21c(0x19b)][_0x10b21c(0x18a)][_0x10b21c(0x1ab)]);const _0x203c97=_0x197416['existingJourney'][_0x10b21c(0x18a)]?.['journeyStages'];return _0x203c97&&_0x2d60b5[_0x10b21c(0x18a)][_0x10b21c(0x21d)]&&injectExistingStageIds(_0x2d60b5[_0x10b21c(0x18a)][_0x10b21c(0x21d)],_0x203c97),ensureJourneyDefaults(_0x4693b0),await _0x2395a0[_0x10b21c(0x169)][_0x10b21c(0x1c3)](_0x197416[_0x10b21c(0x19b)]['id'],_0x2d60b5),deletePushRecovery(_0x197416[_0x10b21c(0x156)]),{'action':_0x10b21c(0x20f),'journeyId':_0x197416['existingJourney']['id'],'embeddedSegmentNameToId':_0x5b0685};}}return deletePushRecovery(_0x197416[_0x10b21c(0x156)]),{'action':_0x10b21c(0x1b9),'journeyId':_0x197416['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x5b0685};}function findSegmentCriteriaLocation(_0x331046,_0x4b4a27){const _0x5821db=a142_0x5b9def,_0x6df35a=_0x331046[_0x5821db(0x14f)]||_0x331046[_0x5821db(0x212)]?.[0x0]?.[_0x5821db(0x14f)]||[];let _0x4596bd='entry',_0xa189e0=_0x4b4a27;const _0x2a2108=_0x331046[_0x5821db(0x1ac)]||_0x331046[_0x5821db(0x212)]?.[0x0]?.[_0x5821db(0x1ac)];if(_0x2a2108?.[_0x5821db(0x162)]===_0x4b4a27)return{'stageName':_0x5821db(0x1ac),'criteriaName':_0x2a2108[_0x5821db(0x13e)]||_0x4b4a27};_0x55cc6c:for(const _0x18bdcd of _0x6df35a){if(_0x18bdcd[_0x5821db(0x1b4)]?.[_0x5821db(0x162)]===_0x4b4a27){_0x4596bd=_0x18bdcd[_0x5821db(0x13e)],_0xa189e0=_0x18bdcd[_0x5821db(0x1b4)][_0x5821db(0x13e)]||_0x4b4a27;break;}if(_0x18bdcd[_0x5821db(0x134)])for(const _0x5e0703 of _0x18bdcd[_0x5821db(0x134)]){if(_0x5e0703['type']==='decision_point'&&_0x5e0703['with']?.['branches'])for(const _0x32276d of _0x5e0703[_0x5821db(0x176)][_0x5821db(0x1ca)]){if(_0x32276d['segment']===_0x4b4a27){_0x4596bd=_0x18bdcd[_0x5821db(0x13e)],_0xa189e0=_0x32276d[_0x5821db(0x13e)]||_0x4b4a27;break _0x55cc6c;}}}}return{'stageName':_0x4596bd,'criteriaName':_0xa189e0};}async function executeThreeStepJourneyCreate(_0x4f4cdb,_0x5c6863,_0x36999a,_0x353ed4,_0x1bc477,_0x2edfcd,_0x2f6630,_0x2b847e){const _0x380613=a142_0x5b9def,{activationDefToCreateRequest:_0x33925e,yamlRuleToApi:_0x5cf754}=_0x2b847e,{pendingEmbeddedSegments:_0x54fe25,pendingEmbeddedActivations:_0x67c8cf,embeddedSegmentNameToId:_0x52aa92}=_0x353ed4,_0x166a0e=JSON[_0x380613(0x16f)](JSON[_0x380613(0x1dd)](_0x36999a));ensureJourneyDefaults(_0x166a0e[_0x380613(0x18a)]),stripPendingIds(_0x166a0e);const _0x41aa9a=await _0x4f4cdb[_0x380613(0x169)][_0x380613(0x1d1)](_0x166a0e),_0x3c00d2=_0x41aa9a['id'],_0x1dd5f9=new Map();for(const _0x5d30c8 of _0x41aa9a[_0x380613(0x18a)][_0x380613(0x21d)]){_0x1dd5f9[_0x380613(0x204)](_0x5d30c8[_0x380613(0x13e)][_0x380613(0x217)](),_0x5d30c8['id']);}recoverSegmentIdsFromPushRecovery(_0x5c6863,_0x52aa92,_0x2edfcd[_0x380613(0x21e)]);for(const [_0x47125a,{definition:_0x4a4929}]of _0x54fe25){if(_0x52aa92[_0x380613(0x1da)](_0x47125a)){_0x2f6630[_0x380613(0x148)]?.({'type':_0x380613(0x14a),'journeyName':_0x5c6863[_0x380613(0x219)]['name'],'segmentName':_0x47125a});continue;}const _0x41d147=generateDeterministicJourneySegmentName(_0x5c6863[_0x380613(0x219)][_0x380613(0x13e)],_0x47125a);_0x2f6630['onProgress']?.({'type':_0x380613(0x189),'journeyName':_0x5c6863[_0x380613(0x219)][_0x380613(0x13e)],'segmentName':_0x47125a});const _0xc95687=createSegmentIdResolver(_0x2edfcd[_0x380613(0x21e)],_0x47125a),_0x2af6d1=await resolveRuleSegmentIds(_0x4a4929[_0x380613(0x14c)],_0xc95687),_0x5f4f4c=await createOrRecoverEmbeddedSegment(_0x4f4cdb,_0x5c6863,{'localName':_0x47125a,'uniqueSegmentName':_0x41d147,'description':_0x4a4929['description']||_0x380613(0x131)+_0x47125a,'journeyId':_0x3c00d2,'resolvedRule':_0x2af6d1,'parentId':_0x1bc477[_0x380613(0x13d)],'folderId':_0x1bc477['effectiveFolderId']||''},_0x5cf754);_0x52aa92[_0x380613(0x204)](_0x47125a,_0x5f4f4c),_0x2edfcd[_0x380613(0x21e)][_0x380613(0x204)](_0x47125a,_0x5f4f4c),_0x2f6630[_0x380613(0x148)]?.({'type':_0x380613(0x14a),'journeyName':_0x5c6863[_0x380613(0x219)][_0x380613(0x13e)],'segmentName':_0x47125a});}const _0x2b1eda=new Map();for(const [_0x36f324,_0x51ea75]of _0x67c8cf){_0x2f6630['onProgress']?.({'type':_0x380613(0x133),'journeyName':_0x5c6863['yamlConfig']['name'],'activationName':_0x36f324});const _0x18f507=await _0x33925e(_0x51ea75,_0x2edfcd[_0x380613(0x1be)]),_0x1e7539={..._0x18f507,..._0x51ea75[_0x380613(0x1ef)]!==undefined&&{'runAfterJourneyRefresh':_0x51ea75[_0x380613(0x1ef)]}},_0x4a2a1b=await _0x4f4cdb[_0x380613(0x169)][_0x380613(0x135)](_0x3c00d2,_0x1e7539);_0x2b1eda['set'](_0x36f324,_0x4a2a1b['id']),_0x353ed4[_0x380613(0x12a)][_0x380613(0x204)](_0x36f324,_0x4a2a1b['id']),_0x2f6630[_0x380613(0x148)]?.({'type':_0x380613(0x16d),'journeyName':_0x5c6863['yamlConfig'][_0x380613(0x13e)],'activationName':_0x36f324});}const _0x13079d=JSON[_0x380613(0x16f)](JSON[_0x380613(0x1dd)](_0x36999a));return _0x13079d['id']=_0x3c00d2,ensureJourneyDefaults(_0x13079d[_0x380613(0x18a)]),resolvePendingIdsInRequest(_0x13079d,_0x36999a,_0x1dd5f9,_0x52aa92,_0x2b1eda,_0x2f6630),await _0x4f4cdb[_0x380613(0x169)][_0x380613(0x1c3)](_0x3c00d2,_0x13079d),deletePushRecovery(_0x5c6863[_0x380613(0x156)]),{'action':_0x380613(0x1fa),'journeyId':_0x3c00d2,'embeddedSegmentNameToId':_0x52aa92};}export function stripWaitStepPendingIds(_0x18257c){const _0x20ecd5=a142_0x5b9def,_0x3f8914=_0x18257c[_0x20ecd5(0x158)]&&isPendingSegmentId(_0x18257c[_0x20ecd5(0x158)]),_0x540926=_0x18257c[_0x20ecd5(0x166)]?.['some'](_0x26f063=>_0x26f063[_0x20ecd5(0x191)]&&isPendingSegmentId(_0x26f063[_0x20ecd5(0x191)]));(_0x3f8914||_0x540926)&&(_0x18257c[_0x20ecd5(0x215)]=_0x20ecd5(0x223),_0x18257c[_0x20ecd5(0x198)]=0x1,_0x18257c[_0x20ecd5(0x168)]=_0x20ecd5(0x1c2),delete _0x18257c[_0x20ecd5(0x158)],delete _0x18257c[_0x20ecd5(0x15a)],delete _0x18257c['conditionTimeoutUnit'],delete _0x18257c['conditions']);}export function resolveWaitStepPendingIds(_0x111bbd,_0x56c280,_0x3019e6,_0x5df7da){const _0x17615e=a142_0x5b9def;if(_0x56c280[_0x17615e(0x158)]&&isPendingSegmentId(_0x56c280[_0x17615e(0x158)])){const _0x3a51e0=_0x3019e6(_0x56c280[_0x17615e(0x158)],'stage\x20\x27'+_0x5df7da+_0x17615e(0x1a8));_0x3a51e0&&(_0x111bbd[_0x17615e(0x215)]=_0x17615e(0x1d8),_0x111bbd[_0x17615e(0x158)]=_0x3a51e0,delete _0x111bbd[_0x17615e(0x198)],delete _0x111bbd[_0x17615e(0x168)],_0x56c280[_0x17615e(0x15a)]!==undefined&&(_0x111bbd[_0x17615e(0x15a)]=_0x56c280[_0x17615e(0x15a)]),_0x56c280[_0x17615e(0x147)]&&(_0x111bbd['conditionTimeoutUnit']=_0x56c280[_0x17615e(0x147)]));}if(_0x56c280[_0x17615e(0x166)]){const _0x18b282=_0x56c280[_0x17615e(0x166)][_0x17615e(0x1c4)](_0x23ce37=>_0x23ce37[_0x17615e(0x191)]&&isPendingSegmentId(_0x23ce37[_0x17615e(0x191)]));if(_0x18b282){const _0x5af847=_0x56c280[_0x17615e(0x166)][_0x17615e(0x17c)](_0x3c2039=>{const _0x486e39=_0x17615e;if(_0x3c2039[_0x486e39(0x191)]&&isPendingSegmentId(_0x3c2039[_0x486e39(0x191)])){const _0x1179a2=_0x3019e6(_0x3c2039['segmentId'],'stage\x20\x27'+_0x5df7da+_0x486e39(0x1a8));return{..._0x3c2039,'segmentId':_0x1179a2||_0x3c2039[_0x486e39(0x191)]};}return{..._0x3c2039};});_0x111bbd[_0x17615e(0x215)]=_0x17615e(0x1d8),_0x111bbd[_0x17615e(0x166)]=_0x5af847,delete _0x111bbd[_0x17615e(0x198)],delete _0x111bbd[_0x17615e(0x168)],delete _0x111bbd[_0x17615e(0x158)],delete _0x111bbd[_0x17615e(0x15a)],delete _0x111bbd[_0x17615e(0x147)];}}}function stripPendingIds(_0x45f013){const _0x38c017=a142_0x5b9def;_0x45f013[_0x38c017(0x18a)][_0x38c017(0x1ac)]?.[_0x38c017(0x191)]&&isPendingSegmentId(_0x45f013[_0x38c017(0x18a)][_0x38c017(0x1ac)]['segmentId'])&&delete _0x45f013[_0x38c017(0x18a)]['goal'];for(const _0x75fd7f of _0x45f013['attributes'][_0x38c017(0x21d)]||[]){_0x75fd7f[_0x38c017(0x1e0)]?.[_0x38c017(0x191)]&&isPendingSegmentId(_0x75fd7f[_0x38c017(0x1e0)][_0x38c017(0x191)])&&delete _0x75fd7f[_0x38c017(0x1e0)];_0x75fd7f['milestone']?.[_0x38c017(0x191)]&&isPendingSegmentId(_0x75fd7f[_0x38c017(0x151)][_0x38c017(0x191)])&&delete _0x75fd7f[_0x38c017(0x151)];_0x75fd7f['exitCriterias']&&(_0x75fd7f[_0x38c017(0x1f5)]=_0x75fd7f['exitCriterias'][_0x38c017(0x192)](_0x3f02a5=>!_0x3f02a5[_0x38c017(0x191)]||!isPendingSegmentId(_0x3f02a5['segmentId'])));if(_0x75fd7f[_0x38c017(0x134)])for(const _0x2ad080 of Object[_0x38c017(0x205)](_0x75fd7f[_0x38c017(0x134)])){const _0x416b52=_0x75fd7f[_0x38c017(0x134)][_0x2ad080];_0x416b52[_0x38c017(0x17b)]==='Activation'&&_0x416b52[_0x38c017(0x1b3)]&&isPendingActivationId(_0x416b52['journeyActivationStepId'])&&(_0x416b52[_0x38c017(0x1b3)]='');if(_0x416b52[_0x38c017(0x17b)]===_0x38c017(0x1a9)&&_0x416b52[_0x38c017(0x1ca)])for(const _0x51bfdd of _0x416b52['branches']){_0x51bfdd['segmentId']&&isPendingSegmentId(_0x51bfdd[_0x38c017(0x191)])&&(_0x51bfdd[_0x38c017(0x191)]='');}_0x416b52[_0x38c017(0x17b)]===_0x38c017(0x218)&&stripWaitStepPendingIds(_0x416b52);}}}function resolvePendingIdsInRequest(_0x58414b,_0x49a13a,_0x23e0e5,_0x426af9,_0x16cd4e,_0x51ad89){const _0x222cdb=a142_0x5b9def,_0x434695=(_0x1150cb,_0x4d8536)=>{const _0x311ac3=a142_0x361a;if(!isPendingSegmentId(_0x1150cb))return _0x1150cb;const _0x26ed78=extractPendingSegmentName(_0x1150cb),_0x577277=_0x426af9[_0x311ac3(0x1b1)](_0x26ed78);return!_0x577277&&_0x51ad89['logWarning']?.(_0x311ac3(0x1cf)+_0x26ed78+_0x311ac3(0x1fd)+_0x4d8536),_0x577277;};if(_0x58414b['attributes'][_0x222cdb(0x1ac)]?.['segmentId']&&isPendingSegmentId(_0x58414b[_0x222cdb(0x18a)][_0x222cdb(0x1ac)]['segmentId'])){const _0x3f88a8=_0x434695(_0x58414b[_0x222cdb(0x18a)][_0x222cdb(0x1ac)][_0x222cdb(0x191)],_0x222cdb(0x1e7));_0x3f88a8&&(_0x58414b[_0x222cdb(0x18a)][_0x222cdb(0x1ac)][_0x222cdb(0x191)]=_0x3f88a8);}for(const _0xe4817c of _0x58414b['attributes'][_0x222cdb(0x21d)]||[]){const _0x23371a=_0x23e0e5[_0x222cdb(0x1b1)](_0xe4817c['name'][_0x222cdb(0x217)]());_0x23371a&&(_0xe4817c['id']=_0x23371a);if(_0xe4817c[_0x222cdb(0x1e0)]?.[_0x222cdb(0x191)]&&isPendingSegmentId(_0xe4817c[_0x222cdb(0x1e0)]['segmentId'])){const _0x483a92=_0x434695(_0xe4817c['entryCriteria']['segmentId'],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x1de));_0x483a92&&(_0xe4817c[_0x222cdb(0x1e0)]['segmentId']=_0x483a92);}if(_0xe4817c[_0x222cdb(0x1f5)])for(const _0x198b35 of _0xe4817c[_0x222cdb(0x1f5)]){if(_0x198b35[_0x222cdb(0x191)]&&isPendingSegmentId(_0x198b35[_0x222cdb(0x191)])){const _0x57d80d=_0x434695(_0x198b35[_0x222cdb(0x191)],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x153));_0x57d80d&&(_0x198b35[_0x222cdb(0x191)]=_0x57d80d);}}if(_0xe4817c[_0x222cdb(0x151)]?.[_0x222cdb(0x191)]&&isPendingSegmentId(_0xe4817c[_0x222cdb(0x151)][_0x222cdb(0x191)])){const _0x1c810e=_0x434695(_0xe4817c[_0x222cdb(0x151)][_0x222cdb(0x191)],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x1cb));_0x1c810e&&(_0xe4817c[_0x222cdb(0x151)][_0x222cdb(0x191)]=_0x1c810e);}if(_0xe4817c[_0x222cdb(0x134)]){const _0x5afc04=_0x53f660=>_0x49a13a[_0x222cdb(0x18a)][_0x222cdb(0x21d)]?.[_0x222cdb(0x1c5)](_0x4b08a2=>_0x4b08a2[_0x222cdb(0x13e)][_0x222cdb(0x217)]()===_0xe4817c[_0x222cdb(0x13e)][_0x222cdb(0x217)]())?.['steps']?.[_0x53f660];for(const _0x51fe24 of Object['keys'](_0xe4817c['steps'])){const _0x405af3=_0xe4817c[_0x222cdb(0x134)][_0x51fe24],_0x67e4a2=_0x5afc04(_0x51fe24);if(_0x405af3[_0x222cdb(0x17b)]===_0x222cdb(0x1ea)&&_0x405af3[_0x222cdb(0x1b3)]&&(isPendingActivationId(_0x405af3['journeyActivationStepId'])||_0x405af3[_0x222cdb(0x1b3)]==='')){if(_0x67e4a2?.[_0x222cdb(0x1b3)]&&isPendingActivationId(_0x67e4a2[_0x222cdb(0x1b3)])){const _0x54f62c=extractPendingActivationName(_0x67e4a2[_0x222cdb(0x1b3)]),_0x18cf1a=_0x16cd4e[_0x222cdb(0x1b1)](_0x54f62c);_0x18cf1a&&(_0x405af3[_0x222cdb(0x1b3)]=_0x18cf1a);}}if(_0x405af3['type']==='DecisionPoint'&&_0x405af3[_0x222cdb(0x1ca)]&&_0x67e4a2?.['branches'])for(let _0x5f0550=0x0;_0x5f0550<_0x405af3['branches'][_0x222cdb(0x164)];_0x5f0550++){const _0x265c70=_0x405af3[_0x222cdb(0x1ca)][_0x5f0550],_0x1ef780=_0x67e4a2[_0x222cdb(0x1ca)][_0x5f0550];if(_0x1ef780?.[_0x222cdb(0x191)]&&isPendingSegmentId(_0x1ef780[_0x222cdb(0x191)])){const _0x59f397=_0x434695(_0x1ef780[_0x222cdb(0x191)],_0x222cdb(0x1a6)+_0xe4817c[_0x222cdb(0x13e)]+_0x222cdb(0x1c6)+(_0x265c70[_0x222cdb(0x13e)]||_0x5f0550)+'\x27');_0x59f397&&(_0x265c70[_0x222cdb(0x191)]=_0x59f397);}}_0x405af3[_0x222cdb(0x17b)]===_0x222cdb(0x218)&&_0x67e4a2?.[_0x222cdb(0x17b)]===_0x222cdb(0x218)&&resolveWaitStepPendingIds(_0x405af3,_0x67e4a2,_0x434695,_0xe4817c[_0x222cdb(0x13e)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xb6d4d7,_0x26c081){const _0x356984=a143_0xf61f,_0x33e0a6=_0xb6d4d7();while(!![]){try{const _0x59ea2a=-parseInt(_0x356984(0x130))/0x1*(parseInt(_0x356984(0x134))/0x2)+-parseInt(_0x356984(0x12d))/0x3*(-parseInt(_0x356984(0x12c))/0x4)+parseInt(_0x356984(0x127))/0x5+parseInt(_0x356984(0x133))/0x6+parseInt(_0x356984(0x12b))/0x7*(-parseInt(_0x356984(0x132))/0x8)+-parseInt(_0x356984(0x135))/0x9+-parseInt(_0x356984(0x12f))/0xa*(parseInt(_0x356984(0x137))/0xb);if(_0x59ea2a===_0x26c081)break;else _0x33e0a6['push'](_0x33e0a6['shift']());}catch(_0x181247){_0x33e0a6['push'](_0x33e0a6['shift']());}}}(a143_0x4824,0x9657a));export function buildFolderIdToPathMap(_0x3447d6){const _0x5012ea=a143_0xf61f,_0x580a7d=new Map(),_0x1ae0de=new Map();for(const _0x5dfffa of _0x3447d6){_0x1ae0de['set'](_0x5dfffa['id'],_0x5dfffa);}const _0x306695=new Set();for(const _0x38a065 of _0x3447d6){!_0x38a065[_0x5012ea(0x12e)]&&_0x306695[_0x5012ea(0x136)](_0x38a065['id']);}function _0x583353(_0x2d29a7){const _0x5c05e6=_0x5012ea;if(_0x580a7d[_0x5c05e6(0x128)](_0x2d29a7['id']))return _0x580a7d[_0x5c05e6(0x12a)](_0x2d29a7['id']);if(_0x306695[_0x5c05e6(0x128)](_0x2d29a7['id']))return _0x580a7d['set'](_0x2d29a7['id'],''),'';if(_0x2d29a7[_0x5c05e6(0x12e)]){const _0x10107f=_0x1ae0de['get'](_0x2d29a7[_0x5c05e6(0x12e)]);if(_0x10107f){const _0x7d8f75=_0x583353(_0x10107f),_0x4e137b=_0x7d8f75?_0x7d8f75+'/'+_0x2d29a7[_0x5c05e6(0x131)]:_0x2d29a7[_0x5c05e6(0x131)];return _0x580a7d[_0x5c05e6(0x129)](_0x2d29a7['id'],_0x4e137b),_0x4e137b;}}const _0x3b6ea0=_0x2d29a7[_0x5c05e6(0x131)];return _0x580a7d[_0x5c05e6(0x129)](_0x2d29a7['id'],_0x3b6ea0),_0x3b6ea0;}for(const _0x448378 of _0x3447d6){_0x583353(_0x448378);}return _0x580a7d;}function a143_0xf61f(_0x710418,_0x1bdcf2){_0x710418=_0x710418-0x127;const _0x4824bf=a143_0x4824();let _0xf61f54=_0x4824bf[_0x710418];return _0xf61f54;}function a143_0x4824(){const _0x31e2d4=['parentFolderId','30ktGMrw','32941NqNyyA','name','904KUPxSb','4670226pbPOst','6abBJBW','4228119BZqewl','add','2364923KVLyiI','3547370yGMxyt','has','set','get','15701ejbkhd','7508aEXHnN','951EjNHZX'];a143_0x4824=function(){return _0x31e2d4;};return a143_0x4824();}export function buildFolderPathToIdMap(_0x17d067){const _0x10378d=a143_0xf61f,_0x5bfa5d=new Map(),_0x176e0e=new Map();for(const _0x268aea of _0x17d067){_0x176e0e['set'](_0x268aea['id'],_0x268aea);}const _0x52a83f=new Set();for(const _0x2b129e of _0x17d067){!_0x2b129e[_0x10378d(0x12e)]&&_0x52a83f[_0x10378d(0x136)](_0x2b129e['id']);}function _0x219331(_0x42c47d){const _0x2b85f2=_0x10378d;if(_0x52a83f[_0x2b85f2(0x128)](_0x42c47d['id']))return'';if(_0x42c47d[_0x2b85f2(0x12e)]){const _0xb28a79=_0x176e0e[_0x2b85f2(0x12a)](_0x42c47d[_0x2b85f2(0x12e)]);if(_0xb28a79){const _0x8ffa7b=_0x219331(_0xb28a79);return _0x8ffa7b?_0x8ffa7b+'/'+_0x42c47d[_0x2b85f2(0x131)]:_0x42c47d[_0x2b85f2(0x131)];}}return _0x42c47d['name'];}for(const _0x324b10 of _0x17d067){const _0x26f560=_0x219331(_0x324b10);_0x5bfa5d[_0x10378d(0x129)](_0x26f560,_0x324b10['id']);}return _0x5bfa5d;}export function buildFolderMaps(_0x4f7134){const _0x302fed=a143_0xf61f,_0x2a7e73=buildFolderIdToPathMap(_0x4f7134),_0x14d693=new Map();for(const [_0x28ba3a,_0x2a56d2]of _0x2a7e73){_0x14d693[_0x302fed(0x129)](_0x2a56d2,_0x28ba3a);}return{'idToPath':_0x2a7e73,'pathToId':_0x14d693};}export function getFolderPath(_0x4119ac,_0xd02f30){const _0x43234a=a143_0xf61f;if(!_0x4119ac)return'';return _0xd02f30[_0x43234a(0x12a)](_0x4119ac)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x546336,_0x5c94d0){const _0x5bda56=a144_0x1a25,_0x398cfa=_0x546336();while(!![]){try{const _0x570194=-parseInt(_0x5bda56(0x129))/0x1+-parseInt(_0x5bda56(0x10e))/0x2*(-parseInt(_0x5bda56(0x108))/0x3)+-parseInt(_0x5bda56(0x110))/0x4*(parseInt(_0x5bda56(0x111))/0x5)+parseInt(_0x5bda56(0x107))/0x6*(-parseInt(_0x5bda56(0x125))/0x7)+-parseInt(_0x5bda56(0x116))/0x8+-parseInt(_0x5bda56(0x131))/0x9*(parseInt(_0x5bda56(0x113))/0xa)+parseInt(_0x5bda56(0x132))/0xb*(parseInt(_0x5bda56(0x10d))/0xc);if(_0x570194===_0x5c94d0)break;else _0x398cfa['push'](_0x398cfa['shift']());}catch(_0x9a7ef5){_0x398cfa['push'](_0x398cfa['shift']());}}}(a144_0x2b1f,0x394cd));function a144_0x2b1f(){const _0x5c9b63=['push','95358lRsOeS','21kpjoFJ','segment','No\x20tdx.json\x20found\x20for\x20file:\x20','length','exists','84WzDYyR','87254OVuLYB','replace','4hdnuou','2035080ixPGUM','Path\x20cannot\x20be\x20empty','310srXdRc','parse','root','2955824HjAcxb','Relative\x20path\x20cannot\x20be\x20empty','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20attempts\x20to\x20navigate\x20above\x20root','pop','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','journey','join','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','type','readFile','segments','filter','relative','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','77ylalkl','endsWith','.yaml','isAbsolute','174209mWyCWO','Cannot\x20navigate\x20above\x20root','parent_segment','tdx.json','name','.yml','dirname','test','4869TifIFD','1683957gRGFpr','trim','raw','startsWith','substring','split','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'];a144_0x2b1f=function(){return _0x5c9b63;};return a144_0x2b1f();}import a144_0x43ee37 from'path';import{parse as a144_0x34cf87}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x35360a){const _0x291512=a144_0x1a25;if(!_0x35360a||_0x35360a[_0x291512(0x100)]()==='')throw new Error(_0x291512(0x112));const _0x45ed56=_0x35360a[_0x291512(0x100)]();if(_0x45ed56==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x35360a};const _0x479b64=_0x45ed56[_0x291512(0x102)]('/')?_0x45ed56[_0x291512(0x103)](0x1):_0x45ed56,_0x16800c=_0x479b64[_0x291512(0x104)]('/')[_0x291512(0x122)](_0x459219=>_0x459219!=='');if(_0x16800c[_0x291512(0x10b)]===0x0)throw new Error(_0x291512(0x124));const _0x3ce212=_0x45ed56['startsWith']('/')||!isRelativePathSegment(_0x16800c[0x0]);for(const _0x3a5dbd of _0x16800c){validatePathSegment(_0x3a5dbd);}return{'segments':_0x16800c,'isAbsolute':_0x3ce212,'raw':_0x35360a};}function isRelativePathSegment(_0x305513){return _0x305513==='.'||_0x305513==='..';}function validatePathSegment(_0x231ba7){const _0x1a8a67=a144_0x1a25;if(_0x231ba7==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x231ba7==='.'||_0x231ba7==='..')return;if(/[\x00-\x1F\x7F]/[_0x1a8a67(0x130)](_0x231ba7))throw new Error(_0x1a8a67(0x11e)+_0x231ba7);if(_0x231ba7!==_0x231ba7[_0x1a8a67(0x100)]()){}}export function validatePath(_0x38892c){const _0x16cb7a=a144_0x1a25;if(_0x38892c[_0x16cb7a(0x121)]['length']===0x0&&!_0x38892c[_0x16cb7a(0x128)])throw new Error(_0x16cb7a(0x117));if(_0x38892c[_0x16cb7a(0x128)]){if(_0x38892c['segments'][0x0]==='..')throw new Error(_0x16cb7a(0x11b));let _0x12c8ca=0x0;for(const _0x587d6b of _0x38892c[_0x16cb7a(0x121)]){if(_0x587d6b==='..'){if(_0x12c8ca===0x0)throw new Error(_0x16cb7a(0x119));_0x12c8ca--;}else _0x587d6b!=='.'&&_0x12c8ca++;}}}export function joinPaths(_0x45a70b,_0x116084){const _0x9daa16=a144_0x1a25;if(!_0x45a70b||_0x45a70b==='/')return _0x116084;if(!_0x116084||_0x116084==='.')return _0x45a70b;if(_0x116084[_0x9daa16(0x102)]('/'))return _0x116084;const _0x13dfcc=parsePath(_0x45a70b),_0xd569f8=parsePath(_0x116084),_0x51807c=[..._0x13dfcc['segments']];for(const _0x3eb81d of _0xd569f8[_0x9daa16(0x121)]){if(_0x3eb81d==='.')continue;else{if(_0x3eb81d==='..'){if(_0x51807c['length']===0x0)throw new Error(_0x9daa16(0x12a));_0x51807c[_0x9daa16(0x11a)]();}else _0x51807c[_0x9daa16(0x106)](_0x3eb81d);}}const _0x4cb213=_0x51807c[_0x9daa16(0x11d)]('/');return _0x13dfcc[_0x9daa16(0x101)][_0x9daa16(0x102)]('/')?'/'+_0x4cb213:_0x4cb213;}function a144_0x1a25(_0x292ee2,_0x444df5){_0x292ee2=_0x292ee2-0x100;const _0x2b1fd0=a144_0x2b1f();let _0x1a25ed=_0x2b1fd0[_0x292ee2];return _0x1a25ed;}export function normalizePath(_0x3897f5){const _0x54ba71=a144_0x1a25,_0x33de84=parsePath(_0x3897f5),_0x5fc364=[];for(const _0x3f4d67 of _0x33de84[_0x54ba71(0x121)]){if(_0x3f4d67==='.')continue;else{if(_0x3f4d67==='..'){if(_0x5fc364[_0x54ba71(0x10b)]===0x0){if(_0x33de84[_0x54ba71(0x128)])throw new Error('Cannot\x20navigate\x20above\x20root');_0x5fc364['push']('..');}else _0x5fc364[_0x5fc364[_0x54ba71(0x10b)]-0x1]==='..'?_0x5fc364['push']('..'):_0x5fc364['pop']();}else _0x5fc364[_0x54ba71(0x106)](_0x3f4d67);}}if(_0x5fc364[_0x54ba71(0x10b)]===0x0)return _0x33de84[_0x54ba71(0x128)]?'/':'.';const _0x8a26f4=_0x5fc364[_0x54ba71(0x11d)]('/');return _0x33de84[_0x54ba71(0x101)][_0x54ba71(0x102)]('/')?'/'+_0x8a26f4:_0x8a26f4;}export function getParentPath(_0x3ac69f){const _0x15942d=a144_0x1a25,_0x6d0a78=parsePath(_0x3ac69f);if(_0x6d0a78[_0x15942d(0x121)]['length']<=0x1)return'/';const _0x1ac8e9=_0x6d0a78[_0x15942d(0x121)]['slice'](0x0,-0x1)[_0x15942d(0x11d)]('/');return _0x6d0a78['raw'][_0x15942d(0x102)]('/')?'/'+_0x1ac8e9:_0x1ac8e9;}export function getBaseName(_0x24eb17){const _0x4312bd=a144_0x1a25,_0x8d607a=parsePath(_0x24eb17);return _0x8d607a[_0x4312bd(0x121)][_0x8d607a[_0x4312bd(0x121)][_0x4312bd(0x10b)]-0x1]||'';}export function isChildPath(_0x142d68,_0x18ae45){const _0x426b1c=a144_0x1a25,_0x253da2=parsePath(_0x142d68),_0x285471=parsePath(_0x18ae45);if(_0x253da2[_0x426b1c(0x121)]['length']<=_0x285471[_0x426b1c(0x121)][_0x426b1c(0x10b)])return![];for(let _0x38dc04=0x0;_0x38dc04<_0x285471['segments'][_0x426b1c(0x10b)];_0x38dc04++){if(_0x253da2[_0x426b1c(0x121)][_0x38dc04]!==_0x285471['segments'][_0x38dc04])return![];}return!![];}export function splitPath(_0x23c838){const _0x43019f=a144_0x1a25,_0x318b29=parsePath(_0x23c838);if(_0x318b29[_0x43019f(0x121)][_0x43019f(0x10b)]===0x0)throw new Error('Cannot\x20split\x20empty\x20path');if(_0x318b29['segments'][_0x43019f(0x10b)]===0x1)return{'parent':_0x318b29[_0x43019f(0x121)][0x0]};return{'parent':_0x318b29[_0x43019f(0x121)][0x0],'child':_0x318b29[_0x43019f(0x121)]['slice'](0x1)[_0x43019f(0x11d)]('/')};}export function isYamlFilePath(_0x4e31ab){const _0x12219d=a144_0x1a25;return _0x4e31ab[_0x12219d(0x126)](_0x12219d(0x12e))||_0x4e31ab[_0x12219d(0x126)](_0x12219d(0x127));}export async function resolveYamlFilePath(_0x11a2d7,_0x4fcebf=nodeFileSystem){const _0xa7a68e=a144_0x1a25,_0x5e7bca=a144_0x43ee37['resolve'](_0x11a2d7);if(!await _0x4fcebf[_0xa7a68e(0x10c)](_0x5e7bca))throw new Error('File\x20not\x20found:\x20'+_0x11a2d7);let _0x2ad81b=a144_0x43ee37['dirname'](_0x5e7bca),_0x286447=null,_0x4ad788=null;const _0x5656db=a144_0x43ee37[_0xa7a68e(0x114)](_0x2ad81b)[_0xa7a68e(0x115)];while(_0x2ad81b!==_0x5656db){const _0x4b92dc=a144_0x43ee37[_0xa7a68e(0x11d)](_0x2ad81b,_0xa7a68e(0x12c));if(await _0x4fcebf[_0xa7a68e(0x10c)](_0x4b92dc)){_0x286447=_0x4b92dc,_0x4ad788=_0x2ad81b;break;}_0x2ad81b=a144_0x43ee37[_0xa7a68e(0x12f)](_0x2ad81b);}if(!_0x286447||!_0x4ad788)throw new Error(_0xa7a68e(0x10a)+_0x11a2d7+'\x0a'+_0xa7a68e(0x118));const _0xb626fc=await _0x4fcebf[_0xa7a68e(0x120)](_0x286447),_0x3a73c7=JSON[_0xa7a68e(0x114)](_0xb626fc),_0x135940=_0x3a73c7[_0xa7a68e(0x12b)];if(!_0x135940)throw new Error('Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field');const _0x44865b=await _0x4fcebf['readFile'](_0x5e7bca),_0x41398c=a144_0x34cf87(_0x44865b),_0x1ab8dd=_0x41398c[_0xa7a68e(0x12d)];if(!_0x1ab8dd)throw new Error(_0xa7a68e(0x105)+_0x11a2d7);const _0x5acfd7=_0x41398c[_0xa7a68e(0x11f)]===_0xa7a68e(0x11c)?_0xa7a68e(0x11c):_0xa7a68e(0x109),_0x79a4f7=a144_0x43ee37[_0xa7a68e(0x123)](_0x4ad788,_0x5e7bca),_0x104c19=a144_0x43ee37[_0xa7a68e(0x12f)](_0x79a4f7),_0x1497c7=_0x104c19==='.'?'':_0x104c19[_0xa7a68e(0x10f)](/\\/g,'/'),_0x526cb1=_0x1497c7?_0x135940+'/'+_0x1497c7+'/'+_0x1ab8dd:_0x135940+'/'+_0x1ab8dd;return{'parentSegment':_0x135940,'segmentName':_0x1ab8dd,'folderPath':_0x1497c7,'fullPath':_0x526cb1,'resourceType':_0x5acfd7,'content':_0x44865b};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a145_0x10ef(_0x5e47df,_0x33076f){_0x5e47df=_0x5e47df-0x1ca;const _0x1a5599=a145_0x1a55();let _0x10efda=_0x1a5599[_0x5e47df];return _0x10efda;}function a145_0x1a55(){const _0x2c448c=['Invalid\x20segment\x20reference\x20format:\x20','substring','123831zhevPW','.\x20Parent\x20name\x20cannot\x20be\x20empty','1100348CVyVYE','3462605CKiVnx','6490168xmxyvF','6HRlXLZ','2593948dFvurI','151501ZaPYyM','1202572JnkoxV','indexOf','.\x20Child\x20name\x20cannot\x20be\x20empty','9VDrRMZ'];a145_0x1a55=function(){return _0x2c448c;};return a145_0x1a55();}(function(_0x2c6004,_0x33f034){const _0x43be7d=a145_0x10ef,_0xc7a639=_0x2c6004();while(!![]){try{const _0x14cc8f=parseInt(_0x43be7d(0x1d4))/0x1+-parseInt(_0x43be7d(0x1cf))/0x2+-parseInt(_0x43be7d(0x1cd))/0x3+parseInt(_0x43be7d(0x1d5))/0x4+-parseInt(_0x43be7d(0x1d0))/0x5*(parseInt(_0x43be7d(0x1d2))/0x6)+parseInt(_0x43be7d(0x1d3))/0x7+-parseInt(_0x43be7d(0x1d1))/0x8*(-parseInt(_0x43be7d(0x1ca))/0x9);if(_0x14cc8f===_0x33f034)break;else _0xc7a639['push'](_0xc7a639['shift']());}catch(_0x9c9187){_0xc7a639['push'](_0xc7a639['shift']());}}}(a145_0x1a55,0x55737));export function parseSegmentRef(_0xdacbc){const _0x24db6e=a145_0x10ef,_0x1d074b=_0xdacbc[_0x24db6e(0x1d6)]('/');if(_0x1d074b===-0x1)return{'parentId':_0xdacbc};if(_0x1d074b===0x0)throw new Error(_0x24db6e(0x1cb)+_0xdacbc+_0x24db6e(0x1ce));const _0x15014e=_0xdacbc['substring'](0x0,_0x1d074b),_0x157dd5=_0xdacbc[_0x24db6e(0x1cc)](_0x1d074b+0x1);if(_0x157dd5==='')throw new Error(_0x24db6e(0x1cb)+_0xdacbc+_0x24db6e(0x1d7));return{'parentId':_0x15014e,'childId':_0x157dd5};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1232df,_0x1eba9e){const _0x400ae1=a146_0x3bd3,_0x18ffec=_0x1232df();while(!![]){try{const _0x393435=-parseInt(_0x400ae1(0xb8))/0x1+parseInt(_0x400ae1(0xc5))/0x2*(parseInt(_0x400ae1(0xc3))/0x3)+-parseInt(_0x400ae1(0xac))/0x4+parseInt(_0x400ae1(0xc1))/0x5+parseInt(_0x400ae1(0xce))/0x6+-parseInt(_0x400ae1(0xdb))/0x7*(-parseInt(_0x400ae1(0xb2))/0x8)+-parseInt(_0x400ae1(0xd1))/0x9;if(_0x393435===_0x1eba9e)break;else _0x18ffec['push'](_0x18ffec['shift']());}catch(_0xb09402){_0x18ffec['push'](_0x18ffec['shift']());}}}(a146_0x42e4,0x3398f));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x241711,_0xbbfdc6={},_0x4e9fb7={}){const _0x4621d1=a146_0x3bd3;if(_0x4e9fb7[_0x4621d1(0xc2)])return runSemanticChecks(_0x241711,_0xbbfdc6);const _0x513277=SegmentDefSchema[_0x4621d1(0xbd)](_0x241711);if(_0x513277[_0x4621d1(0xc9)])return runSemanticChecks(_0x513277['data'],_0xbbfdc6);return zodErrorsToValidationResult(_0x513277['error'],_0xbbfdc6);}export function validateRuleDef(_0x50da61,_0x3fb173,_0x254aa5){const _0x549ba1=a146_0x3bd3;if(!_0x50da61)return[];const _0x34db4b=RuleDefSchema[_0x549ba1(0xbd)](_0x50da61);if(_0x34db4b[_0x549ba1(0xc9)])return checkRule(_0x34db4b['data'],_0x3fb173,_0x254aa5);const _0x4aed6d=flattenZodIssues(_0x34db4b['error'][_0x549ba1(0xe8)]);return _0x4aed6d[_0x549ba1(0xe9)](_0x37ac28=>{const _0x2bb0c4=_0x549ba1,_0x3e93a9=formatZodPath(_0x37ac28[_0x2bb0c4(0xb0)]),_0x5d60e8=_0x3e93a9?_0x3fb173+'.'+_0x3e93a9:_0x3fb173,_0x417954=mapZodIssueToCode(_0x37ac28,_0x3e93a9),_0x283019=getLocationFromPath(_0x254aa5['document'],_0x254aa5[_0x2bb0c4(0xb4)],pathToArray(_0x5d60e8));return{'level':'error','path':_0x5d60e8,'code':_0x417954,'message':_0x37ac28[_0x2bb0c4(0xe5)],..._0x283019&&{'location':_0x283019}};});}function zodErrorsToValidationResult(_0x2c9c35,_0x2af881){const _0x5a238b=a146_0x3bd3,_0x24fd40=flattenZodIssues(_0x2c9c35[_0x5a238b(0xe8)]),_0x387b58=_0x24fd40[_0x5a238b(0xe9)](_0x334441=>{const _0x1e1a79=_0x5a238b,_0x593fa3=formatZodPath(_0x334441[_0x1e1a79(0xb0)]),_0x85b299=mapZodIssueToCode(_0x334441,_0x593fa3),_0x4a4009=getLocationFromPath(_0x2af881[_0x1e1a79(0xda)],_0x2af881[_0x1e1a79(0xb4)],_0x334441[_0x1e1a79(0xb0)][_0x1e1a79(0xe9)](_0x44ebac=>typeof _0x44ebac===_0x1e1a79(0xba)?String(_0x44ebac):_0x44ebac));return{'level':_0x1e1a79(0xbb),'path':_0x593fa3,'code':_0x85b299,'message':_0x334441[_0x1e1a79(0xe5)],..._0x4a4009&&{'location':_0x4a4009}};});return{'valid':![],'errors':_0x387b58,'warnings':[]};}function mapZodIssueToCode(_0x52c6ab,_0x210028){const _0x46017d=a146_0x3bd3,_0x362092=_0x52c6ab[_0x46017d(0xb3)]===_0x46017d(0xcf)?_0x52c6ab[_0x46017d(0xb6)]:undefined;if(_0x210028===_0x46017d(0xe4))return _0x46017d(0xd7);if(_0x210028===_0x46017d(0xc4)||_0x210028['endsWith']('.type')){if(_0x52c6ab[_0x46017d(0xb3)]===_0x46017d(0xae)){if(_0x210028===_0x46017d(0xc4)||_0x210028[_0x46017d(0xcc)](/\.conditions\[\d+\]\.type$/))return _0x46017d(0xc8);}}if(_0x210028['endsWith']('.operator.type'))return'INVALID_OPERATOR_TYPE';if(_0x210028[_0x46017d(0xc6)](_0x46017d(0xad)))return'MISSING_OPERATOR_VALUE';if(_0x362092?.['validationCode']===_0x46017d(0xe3))return _0x46017d(0xe3);if(_0x362092?.[_0x46017d(0xd8)]===_0x46017d(0xd6))return _0x46017d(0xd6);if(_0x210028[_0x46017d(0xc6)]('.conditions')||_0x210028===_0x46017d(0xc0))return'MISSING_CONDITIONS';if(_0x210028[_0x46017d(0xd9)](_0x46017d(0xcd)))return'INVALID_ARRAY_MATCHING';if(_0x210028[_0x46017d(0xc6)](_0x46017d(0xab)))return _0x46017d(0xca);return _0x46017d(0xb7);}function a146_0x3bd3(_0x2b3127,_0x3b631e){_0x2b3127=_0x2b3127-0xa8;const _0x42e451=a146_0x42e4();let _0x3bd39f=_0x42e451[_0x2b3127];return _0x3bd39f;}function runSemanticChecks(_0x361c30,_0x480ae0){const _0x550298=a146_0x3bd3,_0x434386=[];_0x361c30[_0x550298(0xcb)]&&_0x434386[_0x550298(0xdd)](...checkRule(_0x361c30['rule'],_0x550298(0xcb),_0x480ae0));const _0x4138c8=_0x434386['filter'](_0xad1251=>_0xad1251['level']==='error'),_0x77ec7d=_0x434386[_0x550298(0xc7)](_0x5a28ae=>_0x5a28ae['level']===_0x550298(0xd5));return{'valid':_0x4138c8[_0x550298(0xd4)]===0x0,'errors':_0x4138c8,'warnings':_0x77ec7d};}function checkRule(_0x556655,_0xa5b3f1,_0x4640c1){const _0x24f10f=a146_0x3bd3,_0x548a01=[];if(_0x556655['conditions']['length']===0x0)return _0x548a01[_0x24f10f(0xdd)]({'level':_0x24f10f(0xbb),'path':_0xa5b3f1+_0x24f10f(0xde),'code':_0x24f10f(0xd3),'message':_0x24f10f(0xd2),'location':getLocationFromPath(_0x4640c1[_0x24f10f(0xda)],_0x4640c1[_0x24f10f(0xb4)],pathToArray(_0xa5b3f1+'.conditions'))}),_0x548a01;return _0x548a01['push'](...checkConditions(_0x556655['conditions'],_0xa5b3f1,_0x4640c1)),_0x548a01;}function checkConditions(_0x264418,_0x507705,_0x502616){const _0x3eb3a6=[];for(let _0x43e1d2=0x0;_0x43e1d2<_0x264418['length'];_0x43e1d2++){const _0x16780b=_0x264418[_0x43e1d2],_0x4849bb=_0x507705+'.conditions['+_0x43e1d2+']';_0x3eb3a6['push'](...checkCondition(_0x16780b,_0x4849bb,_0x502616));}return _0x3eb3a6;}function checkCondition(_0x32aae6,_0x584722,_0x5c41c0){const _0x13601f=a146_0x3bd3,_0x5d245a=[];if(_0x32aae6[_0x13601f(0xe7)]===_0x13601f(0xe6)||_0x32aae6[_0x13601f(0xe7)]==='Or')return _0x32aae6['conditions'][_0x13601f(0xd4)]===0x0?_0x5d245a[_0x13601f(0xdd)]({'level':_0x13601f(0xbb),'path':_0x584722+_0x13601f(0xde),'code':_0x13601f(0xd3),'message':_0x32aae6[_0x13601f(0xe7)]+_0x13601f(0xbc),'location':getLocationFromPath(_0x5c41c0['document'],_0x5c41c0[_0x13601f(0xb4)],pathToArray(_0x584722+'.conditions'))}):(_0x5d245a[_0x13601f(0xdd)]({'level':_0x13601f(0xd5),'path':_0x584722,'code':_0x13601f(0xb1),'message':_0x32aae6[_0x13601f(0xe7)]+_0x13601f(0xdf)+_0x13601f(0xea)+_0x13601f(0xbe),'location':getLocationFromPath(_0x5c41c0['document'],_0x5c41c0['source'],pathToArray(_0x584722))}),_0x5d245a[_0x13601f(0xdd)](...checkConditions(_0x32aae6[_0x13601f(0xc0)],_0x584722,_0x5c41c0))),_0x5d245a;if(_0x32aae6['type']==='Value'||_0x32aae6[_0x13601f(0xe7)]===_0x13601f(0xe1)){const _0x4e7169=_0x32aae6,_0x404548=_0x4e7169[_0x13601f(0xb4)],_0x1f6656=_0x4e7169[_0x13601f(0xe0)],_0x14c7a2=_0x404548||_0x1f6656;(!_0x4e7169[_0x13601f(0xeb)]||_0x4e7169['attribute']==='')&&(!_0x14c7a2&&_0x5d245a[_0x13601f(0xdd)]({'level':'error','path':_0x584722+_0x13601f(0xaf),'code':_0x13601f(0xdc),'message':_0x13601f(0xe2),'location':getLocationFromPath(_0x5c41c0[_0x13601f(0xda)],_0x5c41c0[_0x13601f(0xb4)],pathToArray(_0x584722+_0x13601f(0xaf)))}));_0x4e7169['filter']&&_0x5d245a[_0x13601f(0xdd)](...checkRule(_0x4e7169['filter'],_0x584722+_0x13601f(0xaa),_0x5c41c0));if(_0x4e7169[_0x13601f(0xb4)]){const _0x558876=_0x4e7169[_0x13601f(0xeb)]&&_0x4e7169['attribute']!=='';_0x558876&&!_0x4e7169['filter']&&_0x5d245a[_0x13601f(0xdd)]({'level':_0x13601f(0xbb),'path':_0x584722+_0x13601f(0xb5),'code':'BEHAVIOR_SOURCE_MISSING_FILTER','message':_0x13601f(0xd0)+_0x4e7169[_0x13601f(0xb4)]+_0x13601f(0xbf)+_0x4e7169['attribute']+'\x27\x20'+_0x13601f(0xa8)+'the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20'+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x5c41c0[_0x13601f(0xda)],_0x5c41c0[_0x13601f(0xb4)],pathToArray(_0x584722+_0x13601f(0xb5)))}),_0x558876&&_0x4e7169[_0x13601f(0xc7)]&&_0x5d245a[_0x13601f(0xdd)]({'level':_0x13601f(0xd5),'path':_0x584722+_0x13601f(0xaf),'code':'BEHAVIOR_SOURCE_WITH_ATTRIBUTE','message':'Attribute\x20\x27'+_0x4e7169[_0x13601f(0xeb)]+_0x13601f(0xa9)+_0x13601f(0xb9),'location':getLocationFromPath(_0x5c41c0[_0x13601f(0xda)],_0x5c41c0[_0x13601f(0xb4)],pathToArray(_0x584722+'.attribute'))});}}return _0x5d245a;}function a146_0x42e4(){const _0x5d45e0=['4938eAxSEb','rule.type','72xlYNsR','endsWith','filter','INVALID_RULE_TYPE','success','MISSING_SEGMENT_REFERENCE','rule','match','arrayMatching','1489278TXzfhQ','custom','Behavior\x20source\x20\x27','72945XNjDSO','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','EMPTY_CONDITIONS','length','warning','MISSING_TIME_UNIT','MISSING_NAME','validationCode','includes','document','455IlPdzw','EMPTY_ATTRIBUTE','push','.conditions','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','aggregation','Behavior','Attribute\x20name\x20cannot\x20be\x20empty','MISSING_BETWEEN_BOUNDS','name','message','And','type','issues','map','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','attribute','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','.filter','.segment','875052FyKTjT','.operator.value','invalid_value','.attribute','path','NESTED_CONDITION_GROUP','34160QRgMMT','code','source','.source','params','SEGMENT_SCHEMA_ERROR','295365jpzHAE','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','symbol','error','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','safeParse','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','\x27\x20with\x20attribute\x20\x27','conditions','742785iXEkuA','skipSchema'];a146_0x42e4=function(){return _0x5d45e0;};return a146_0x42e4();}
|