@treasuredata/tdx 2026.4.8 → 2026.4.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.d.ts +2 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/access-tracker.js.map +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +52 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +16 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +3 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a152_0x25b4a3=a152_0x3f4b;(function(_0x3d1f4e,_0x4187fb){const _0x5cf14=a152_0x3f4b,_0x311839=_0x3d1f4e();while(!![]){try{const _0x298b23=parseInt(_0x5cf14(0x135))/0x1+-parseInt(_0x5cf14(0x165))/0x2+parseInt(_0x5cf14(0x141))/0x3+parseInt(_0x5cf14(0x172))/0x4+parseInt(_0x5cf14(0x1a8))/0x5+-parseInt(_0x5cf14(0x1e9))/0x6*(parseInt(_0x5cf14(0x18a))/0x7)+-parseInt(_0x5cf14(0x1f4))/0x8*(parseInt(_0x5cf14(0x155))/0x9);if(_0x298b23===_0x4187fb)break;else _0x311839['push'](_0x311839['shift']());}catch(_0x4bcd86){_0x311839['push'](_0x311839['shift']());}}}(a152_0x4463,0xe0363));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0x25b4a3(0x19c);export const PENDING_ACTIVATION_PREFIX=a152_0x25b4a3(0x14c);export function createPendingSegmentId(_0x25912a){return''+PENDING_SEGMENT_PREFIX+_0x25912a+'__';}export function isPendingSegmentId(_0x3bdd2b){return _0x3bdd2b['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x3bdd2b['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x57fb8a){const _0xc13ea1=a152_0x25b4a3;return _0x57fb8a[_0xc13ea1(0x113)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x178bfb){return''+PENDING_ACTIVATION_PREFIX+_0x178bfb+'__';}export function isPendingActivationId(_0x78482d){const _0x19d03e=a152_0x25b4a3;return _0x78482d[_0x19d03e(0x1fc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x117d2a){const _0x1d34b5=a152_0x25b4a3;return _0x117d2a[_0x1d34b5(0x113)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0xafaf94,_0x31c000){const _0x2af374=a152_0x25b4a3,_0x790ea6=_0xafaf94+'::'+(_0x31c000[_0x2af374(0x149)]()||'segment'),_0x8796d2=createHash('sha1')[_0x2af374(0x181)](_0x790ea6)[_0x2af374(0x1ea)](_0x2af374(0x1ed))[_0x2af374(0x197)](0x0,0xc);return'journey_entry_criteria_'+_0x8796d2;}export function ensureJourneyDefaults(_0x2c4af5){const _0x4aedde=a152_0x25b4a3;!_0x2c4af5['description']&&(_0x2c4af5[_0x4aedde(0x1b9)]=''),!_0x2c4af5['state']&&(_0x2c4af5['state']='draft');}export function injectExistingStageIds(_0x54e500,_0x445e21){const _0x454fe5=a152_0x25b4a3,_0x1d3dbe=new Map(_0x445e21[_0x454fe5(0x1e1)](_0x177da0=>[_0x177da0['name'],_0x177da0['id']]));for(const _0x5ccf92 of _0x54e500){if(!_0x5ccf92['id']){const _0x4cfacb=_0x1d3dbe[_0x454fe5(0x151)](_0x5ccf92['name']);_0x4cfacb&&(_0x5ccf92['id']=_0x4cfacb);}}}export function resolveTDFolderPath(_0x5bffc3,_0x4e1569,_0x38bea7){const _0x4b7654=a152_0x25b4a3;if(!_0x4e1569)return _0x5bffc3;if(_0x5bffc3===_0x38bea7||_0x5bffc3[_0x4b7654(0x1fc)](_0x38bea7+'/'))return _0x5bffc3;return _0x5bffc3?_0x38bea7+'/'+_0x5bffc3:_0x38bea7;}export function addFoldersToCreate(_0x3e0f92,_0x3f84be,_0x5b233c){const _0x543b1a=a152_0x25b4a3;if(!_0x3e0f92)return;if(_0x3f84be[_0x543b1a(0x12f)](_0x3e0f92))return;const _0x563903=_0x3e0f92[_0x543b1a(0x14d)]('/');let _0xe8b027='';for(const _0xaf4d5d of _0x563903){_0xe8b027=_0xe8b027?_0xe8b027+'/'+_0xaf4d5d:_0xaf4d5d,!_0x3f84be[_0x543b1a(0x12f)](_0xe8b027)&&_0x5b233c[_0x543b1a(0x1c5)](_0xe8b027);}}export function sortFoldersByDepth(_0x18e605){const _0x3f5ed8=a152_0x25b4a3;return[..._0x18e605][_0x3f5ed8(0x100)]((_0x31354f,_0x1c2ae0)=>{const _0x7dea2f=_0x3f5ed8,_0x25750f=(_0x31354f['match'](/\//g)||[])[_0x7dea2f(0x1d0)],_0x482eef=(_0x1c2ae0[_0x7dea2f(0x187)](/\//g)||[])[_0x7dea2f(0x1d0)];return _0x25750f-_0x482eef;});}import*as a152_0x19c01e from'yaml';import{readFileSync}from'fs';import a152_0x5c5da7 from'path';import{isJourneyDef,parseYamlString as a152_0x3b46a5,toYamlString as a152_0x9fc482,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';function a152_0x4463(){const _0x3d193d=['343DVqaaj','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','stringify','Creating\x20activation\x20\x27','item','getActivation','\x0a\x20\x20','Activation','folder','Creating\x20folder\x20\x27','resolveJourneyId','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','toLowerCase','slice','ACTIVATION_SYNTAX_ERROR','yamlConfig','kind','journeyBundleName','__pending_','conditionTimeoutDuration',').\x20','DecisionPoint','folderPathToId','user','utf-8','existingSegment','Fetching\x20','with','parse','action','6165835bEqewm','Embedded\x20segment\x20\x27','onProgress','some','\x27\x20from\x20file:\x20','existingActivation','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','name','rootFolderId','buildUserMaps','max','.$1.push-recovery.json','branches','idToEmailMap','resolveSegment','columns','description','NOT_FOUND','):\x20','parentFolder','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','parseDocument','activations','withProgress','Created\x20segment\x20\x27','activation_deleted','activation_template_id','segment','add','updateActivation','\x27\x20by\x20rule\x20content','size','Updated\x20segment\x20\x27','object','unchanged','debug','SEGMENT_UPDATE_ERROR','keys','milestone','length','notification','deps','errors','updated','relative','journey_created','journey_updated','steps','null','toString','activation_','parentSegmentFolder','activationContext','decision_point','createdSegmentId','Failed\x20to\x20fetch\x20referenced\x20segment\x20','map','logSuccess','getJourney','segments','journeyById','all','\x20activation\x20\x27','Updating\x20segment\x20\x27','690AkHEIM','digest','waitStepUnit','\x20(referenced\x20in\x20journey\x20','hex','Segment\x20not\x20found:\x20','updateSegmentById','activation_updated','folder_created','find','diff','11596496KPqAWk','entry','Failed\x20to\x20','resolvedRule','from','hasChanges','includes','\x27\x20for\x20','startsWith','segment_deleted','conditionTimeoutUnit','createdSegmentIds','existingSegments','journeyActivationStepId','\x27\x20entry\x20criteria','sort','stage\x20\x27','reduce','filter','nameToId','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','localName','deleteActivation','createSegment','deleteSegment','values','isArray','entries','logWarning','entryCriteria','uniqueSegmentName','waitStepType','../../utils/async.js','conditions','replace','type','exitCriterias','journeyName','SEGMENT_NOT_FOUND','yamlActivation','\x27\x20exit\x20criteria','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','attributes','index','validatedRequest','Failed\x20to\x20resolve\x20segment\x20','activation_updating','Duration','SEGMENT_SYNTAX_ERROR','goal','connection','activation_creating','activation_deleting','\x27\x20to\x20local\x20\x27','Condition','flatMap','embedded_activation_created','\x27...','segmentFolderId','versionNumber','delete','journeyActivationNameToId','has','list','getLatestJourneyId','Created\x20activation\x20\x27','journeyBundleId','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','774447IvxiLi','WaitStep','journeyStages','join','deleted','Entry\x20criteria:\x20','./child-segment-yaml.js','segment_creating','createFolder','JOURNEY_UPDATE_ERROR','idToName','Updating\x20activation\x20\x27','203406HPCmlK','Updated\x20activation\x20\x27','conditionSegmentId','\x20segment\x20from\x20file:\x20','parentId','create','journeys','skipSegments','trim','Deleted\x20segment\x20\x27','segmentNameToId','__pending_act_','split','./journey-yaml.js','message','uniqueServerName','get','stages','segmentId','results','9IHEVsw','activationStepsById','getSegmentEntity\x20also\x20failed\x20for\x20','behavior','INTERNAL','logDeleted','journey_updating','absolutePath','Updated\x20journey\x20\x27','Matched\x20server\x20segment\x20\x27','Created\x20folder\x20\x27','folderPath','journeyId','rule','dirname','folderId','1199358vhOFAg','segment_deleting','created','set','ACTIVATION_UPDATE_ERROR','embedded_segment_created','day','Deleting\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','goal\x20criteria','existingJourney','embeddedSegmentNameToId','listActivations','3591324WQrJhq','toISOString','journey','waitStep','run_after_journey_refresh','Activation\x20not\x20found:\x20','data','all_columns','\x27\x20not\x20found\x20in\x20journey\x20\x27','relationships','activation_created','push','Name\x20has\x20already\x20been\x20taken','\x20journey\x20from\x20file:\x20','valid','update','\x27\x20decision\x20point\x20branch\x20\x27','progress','getSegment\x20failed\x20for\x20','isNew','connectionIdToNameMap','match','schedule','createActivation'];a152_0x4463=function(){return _0x3d193d;};return a152_0x4463();}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(_0x4aff42){const _0x187143=a152_0x25b4a3;if(Array[_0x187143(0x10b)](_0x4aff42))return'['+_0x4aff42[_0x187143(0x1e1)](_0x54581b=>stableStringify(_0x54581b))[_0x187143(0x138)](',')+']';if(_0x4aff42&&typeof _0x4aff42===_0x187143(0x1ca)){const _0x28b957=_0x4aff42,_0x3b1899=Object[_0x187143(0x1ce)](_0x28b957)[_0x187143(0x100)](),_0x34b4c8=_0x3b1899[_0x187143(0x1e1)](_0x206b6a=>'\x22'+_0x206b6a+'\x22:'+stableStringify(_0x28b957[_0x206b6a]));return'{'+_0x34b4c8[_0x187143(0x138)](',')+'}';}const _0x2d2733=JSON[_0x187143(0x18c)](_0x4aff42);return _0x2d2733===undefined?_0x187143(0x1d9):_0x2d2733;}function activationSignature(_0x575304){const _0x474242=a152_0x25b4a3,_0x33c4b7={'connection':_0x575304[_0x474242(0x123)],..._0x575304[_0x474242(0x179)]!==undefined&&{'all_columns':_0x575304['all_columns']},..._0x575304[_0x474242(0x1b8)]!==undefined&&{'columns':_0x575304[_0x474242(0x1b8)]},..._0x575304[_0x474242(0x158)]!==undefined&&{'behavior':_0x575304[_0x474242(0x158)]},..._0x575304[_0x474242(0x188)]!==undefined&&{'schedule':_0x575304['schedule']},..._0x575304[_0x474242(0x1d1)]!==undefined&&{'notification':_0x575304[_0x474242(0x1d1)]},..._0x575304['connector_config']!==undefined&&{'connector_config':_0x575304['connector_config']},..._0x575304['activation_template_id']!==undefined&&{'activation_template_id':_0x575304[_0x474242(0x1c3)]}};return stableStringify(_0x33c4b7);}async function fetchSegment(_0x2ecc1f,_0x77c94e,_0x2abe3a,_0x2e41c6){const _0x375b29=a152_0x25b4a3,_0x54eb5e=_0x2e41c6?.[_0x375b29(0x1f2)](_0x23d90b=>_0x23d90b['id']===_0x2abe3a);if(_0x54eb5e)return _0x54eb5e;try{return await _0x2ecc1f[_0x375b29(0x1c4)]['getSegment'](_0x77c94e,_0x2abe3a);}catch(_0x5469e5){logger['debug'](_0x375b29(0x184)+_0x2abe3a+_0x375b29(0x1af)+_0x5469e5);try{return await _0x2ecc1f['segment']['getSegmentEntity'](_0x2abe3a);}catch(_0x24ff89){return logger[_0x375b29(0x1cc)](_0x375b29(0x157)+_0x2abe3a+':\x20'+_0x24ff89),null;}}}function recoverSegmentIdsFromPushRecovery(_0x22107b,_0x415b82,_0x8f41f8){const _0x1a11e7=a152_0x25b4a3,_0x434c71=readPushRecovery(_0x22107b['absolutePath']);if(_0x434c71?.['journeyName']===_0x22107b['yamlConfig'][_0x1a11e7(0x1b0)])for(const [_0x451bed,_0x4addb1]of Object['entries'](_0x434c71[_0x1a11e7(0x1e4)])){const _0x4be6c8=generateDeterministicJourneySegmentName(_0x22107b[_0x1a11e7(0x199)][_0x1a11e7(0x1b0)],_0x451bed);_0x4addb1[_0x1a11e7(0x150)]===_0x4be6c8&&(_0x415b82[_0x1a11e7(0x168)](_0x451bed,_0x4addb1['segmentId']),_0x8f41f8[_0x1a11e7(0x168)](_0x451bed,_0x4addb1[_0x1a11e7(0x153)]));}}async function createOrRecoverEmbeddedSegment(_0x5aee3d,_0x363b62,_0x4c9deb,_0x4a02ab){const _0x31ff63=a152_0x25b4a3;let _0x5d2384;try{_0x5d2384=await _0x5aee3d[_0x31ff63(0x1c4)]['createJourneySegment']({'name':_0x4c9deb['uniqueSegmentName'],'description':_0x4c9deb['description'],'journeyId':_0x4c9deb[_0x31ff63(0x161)],'rule':_0x4a02ab(_0x4c9deb[_0x31ff63(0x1f7)],!![]),'countPopulation':!![],'parentFolderId':_0x4c9deb[_0x31ff63(0x164)],'audienceId':_0x4c9deb[_0x31ff63(0x145)]});}catch(_0x192617){const _0x4bad63=_0x192617 instanceof Error&&_0x192617[_0x31ff63(0x14f)][_0x31ff63(0x1fa)](_0x31ff63(0x17e));if(_0x4bad63){const _0x326415=readPushRecovery(_0x363b62[_0x31ff63(0x15c)]),_0xc623cf=_0x326415?.[_0x31ff63(0x116)]===_0x363b62[_0x31ff63(0x199)]['name']?_0x326415['segments'][_0x4c9deb[_0x31ff63(0x106)]]:undefined;if(_0xc623cf?.[_0x31ff63(0x150)]===_0x4c9deb[_0x31ff63(0x10f)])await _0x5aee3d[_0x31ff63(0x1c4)][_0x31ff63(0x1ef)](_0x4c9deb[_0x31ff63(0x145)],_0xc623cf[_0x31ff63(0x153)],{'description':_0x4c9deb[_0x31ff63(0x1b9)],'rule':_0x4a02ab(_0x4c9deb[_0x31ff63(0x1f7)],!![]),'countPopulation':!![]}),_0x5d2384=_0xc623cf[_0x31ff63(0x153)];else throw new SDKError(ErrorCode[_0x31ff63(0x1cd)],_0x31ff63(0x1a9)+_0x4c9deb[_0x31ff63(0x106)]+_0x31ff63(0x105)+('Delete\x20the\x20push\x20recovery\x20file\x20('+_0x363b62[_0x31ff63(0x15c)]['replace'](/([^/]+)$/,_0x31ff63(0x1b4))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x192617);}else throw _0x192617;}return saveSegmentToPushRecovery(_0x363b62['absolutePath'],_0x363b62[_0x31ff63(0x199)]['name'],_0x4c9deb[_0x31ff63(0x106)],{'segmentId':_0x5d2384,'uniqueServerName':_0x4c9deb[_0x31ff63(0x10f)],'createdAt':new Date()[_0x31ff63(0x173)]()}),_0x5d2384;}export async function prepareSegmentFiles(_0x5ea516,_0x43de64,_0x1a70d4,_0x358c5f,_0x11ac84){const _0x4307e4=a152_0x25b4a3,{activationDefToCreateRequest:_0x5535a9}=await import('./child-segment-yaml.js'),_0x108e4f=[],_0x2a2e62=new Set();for(const {yamlConfig:_0x4a77a8,folderPath:_0x458902,sourcePath:_0x52d4f9}of _0x5ea516){const _0x1defa8=resolveTDFolderPath(_0x458902,_0x358c5f,_0x11ac84),_0x10d3bf=_0x1defa8+':'+_0x4a77a8[_0x4307e4(0x1b0)],_0x4f8a65=_0x43de64['segmentByFolderAndName']['get'](_0x10d3bf),_0x5c73eb=_0x4f8a65?_0x43de64['activationsBySegmentId'][_0x4307e4(0x151)](_0x4f8a65['id'])||[]:[];addFoldersToCreate(_0x1defa8,_0x43de64[_0x4307e4(0x1a0)],_0x2a2e62);const _0x261bb1=calculateActivationActions(_0x4a77a8[_0x4307e4(0x1bf)]||[],_0x5c73eb,_0x43de64[_0x4307e4(0x1b6)],_0x43de64[_0x4307e4(0x186)]);for(const _0x117a25 of _0x261bb1){(_0x117a25['type']===_0x4307e4(0x146)||_0x117a25[_0x4307e4(0x114)]===_0x4307e4(0x181))&&_0x117a25[_0x4307e4(0x118)]&&(_0x117a25[_0x4307e4(0x11d)]=await _0x5535a9(_0x117a25['yamlActivation'],_0x1a70d4));}const _0xe31b25=calculateSegmentDiff(_0x4a77a8,_0x4f8a65,_0x5c73eb,_0x43de64[_0x4307e4(0x1b6)],_0x43de64['connectionIdToNameMap']);_0x108e4f[_0x4307e4(0x17d)]({'relativePath':_0x4a77a8['name'],'absolutePath':_0x52d4f9,'yamlConfig':_0x4a77a8,'folderPath':_0x1defa8,'existingSegment':_0x4f8a65,'existingActivations':_0x5c73eb,'isNew':_0xe31b25[_0x4307e4(0x185)],'hasChanges':_0xe31b25[_0x4307e4(0x1f9)],'diff':_0xe31b25[_0x4307e4(0x1f3)],'activationActions':_0x261bb1});}return{'segmentFiles':_0x108e4f,'foldersToCreate':_0x2a2e62};}export async function prepareJourneyFiles(_0x442215,_0x1cbcec,_0x419c2e,_0x5481f2){const _0x56176a=a152_0x25b4a3,_0x22a535=[],_0xdc16dc=new Set();for(const {yamlConfig:_0x2f1da2,folderPath:_0x3e9c08,sourcePath:_0x11ce71}of _0x442215){const _0x14dc5f=resolveTDFolderPath(_0x3e9c08,_0x419c2e,_0x5481f2),_0x1b7740=_0x14dc5f+':'+_0x2f1da2['name'],_0x3fa0cc=_0x1cbcec['journeyBundlesByFolderAndName'][_0x56176a(0x151)](_0x1b7740);let _0x2c318e,_0x117e58;if(_0x3fa0cc&&_0x3fa0cc[_0x56176a(0x1d0)]>0x0){const _0x33eca2=buildLocalExpandedRuleMappings(_0x2f1da2),{createYamlContext:_0x234c91,prefetchJourneySegments:_0x126ae3}=createPushYamlContextForBundle(_0x1cbcec[_0x56176a(0x1d2)],_0x1cbcec[_0x56176a(0x145)],_0x1cbcec[_0x56176a(0x200)],_0x33eca2,_0x1cbcec[_0x56176a(0x1b6)],_0x1cbcec['connectionIdToNameMap'],_0x1cbcec[_0x56176a(0x156)],_0x1cbcec['journeyById']);await _0x126ae3(_0x3fa0cc[_0x56176a(0x1e1)](_0x2fc6a7=>_0x2fc6a7['id']));const _0x1994e6=await _0x1cbcec[_0x56176a(0x1d2)][_0x56176a(0x174)][_0x56176a(0x131)](_0x3fa0cc[0x0][_0x56176a(0x133)]),_0x5f2093=hasMultipleVersions(_0x2f1da2),_0x166533=async _0x2cb234=>{const _0x17ffff=_0x56176a,_0x52f9de=_0x1cbcec[_0x17ffff(0x1e5)]?.[_0x17ffff(0x151)](_0x2cb234);if(_0x52f9de)return _0x52f9de;return _0x1cbcec['fetchJourney']({'journeyId':_0x2cb234,'journeyName':_0x2f1da2[_0x17ffff(0x1b0)],'isMultiVersion':_0x3fa0cc[_0x17ffff(0x1d0)]>0x1});};if(_0x5f2093&&_0x3fa0cc[_0x56176a(0x1d0)]>0x1){const _0x4fdb56=[];for(const _0x3568c4 of _0x3fa0cc){const _0x3ef090=_0x3568c4[_0x56176a(0x12c)]||0x1;_0x1cbcec[_0x56176a(0x183)]?.[_0x56176a(0x181)]('Fetching\x20'+_0x2f1da2[_0x56176a(0x1b0)]+'\x20v'+_0x3ef090);const _0x4d2403=await _0x166533(_0x3568c4['id']),_0x90150f=_0x234c91(_0x3568c4['id']),_0x4d6373=await journeyResponseToDef(_0x4d2403,_0x90150f);_0x4fdb56['push']({'item':_0x3568c4,'yaml':_0x4d6373});}const _0x4c0812=buildLocalRuleToNameMappingFromJourney(_0x2f1da2);_0x117e58=buildMergedJourneyDef(_0x4fdb56,_0x4c0812,_0x1994e6);const _0x10683f=Math['max'](..._0x4fdb56['map'](_0x4943c3=>_0x4943c3[_0x56176a(0x18e)]['versionNumber']||0x0)),_0xe56e57=_0x3fa0cc[_0x56176a(0x1f2)](_0x4a768c=>(_0x4a768c[_0x56176a(0x12c)]||0x0)===_0x10683f);_0xe56e57&&(_0x1cbcec[_0x56176a(0x183)]?.['update'](_0x56176a(0x1a4)+_0x2f1da2[_0x56176a(0x1b0)]+'\x20v'+_0x10683f),_0x2c318e=await _0x166533(_0xe56e57['id']));}else{const _0x11318e=_0x3fa0cc[_0x3fa0cc[_0x56176a(0x1d0)]-0x1];_0x1cbcec[_0x56176a(0x183)]?.['update'](_0x56176a(0x1a4)+_0x2f1da2[_0x56176a(0x1b0)]),_0x2c318e=await _0x166533(_0x11318e['id']);const _0x295f73=_0x234c91(_0x11318e['id']),_0x42a2b1=await journeyResponseToDef(_0x2c318e,_0x295f73),_0x235dcd=buildLocalRuleToNameMappingFromJourney(_0x2f1da2);_0x117e58=buildMergedJourneyDef([{'item':_0x11318e,'yaml':_0x42a2b1}],_0x235dcd,_0x1994e6);}}addFoldersToCreate(_0x14dc5f,_0x1cbcec[_0x56176a(0x1a0)],_0xdc16dc);const _0x2a59e6=calculateJourneyDiff(_0x2f1da2,_0x117e58);_0x22a535[_0x56176a(0x17d)]({'relativePath':_0x2f1da2[_0x56176a(0x1b0)],'absolutePath':_0x11ce71,'yamlConfig':_0x2f1da2,'folderPath':_0x14dc5f,'existingJourney':_0x2c318e,'isNew':_0x2a59e6[_0x56176a(0x185)],'hasChanges':_0x2a59e6[_0x56176a(0x1f9)],'diff':_0x2a59e6['diff']});}return{'journeyFiles':_0x22a535,'foldersToCreate':_0xdc16dc};}export function calculateActivationActions(_0x1a903d,_0xa2e208,_0x230bb3,_0x101b1e){const _0x3eb76d=a152_0x25b4a3,_0x3a7df3=[],_0x20203c=new Map();for(const _0x2bb2f8 of _0xa2e208){_0x20203c[_0x3eb76d(0x168)](_0x2bb2f8['name'],_0x2bb2f8);}const _0x3e70af=new Map();for(const _0xaeeb74 of _0x1a903d){_0x3e70af[_0x3eb76d(0x168)](_0xaeeb74[_0x3eb76d(0x1b0)],_0xaeeb74);}for(const _0x1ac972 of _0x1a903d){const _0x57f410=_0x20203c['get'](_0x1ac972['name']);if(!_0x57f410)_0x3a7df3[_0x3eb76d(0x17d)]({'type':_0x3eb76d(0x146),'name':_0x1ac972[_0x3eb76d(0x1b0)],'yamlActivation':_0x1ac972});else{const _0x4210de=activationResponseToDef(_0x57f410,_0x230bb3,_0x101b1e),_0x359984=a152_0x19c01e['stringify'](_0x4210de),_0x5df32a=a152_0x19c01e[_0x3eb76d(0x18c)](_0x1ac972);_0x359984!==_0x5df32a&&_0x3a7df3[_0x3eb76d(0x17d)]({'type':_0x3eb76d(0x181),'name':_0x1ac972[_0x3eb76d(0x1b0)],'yamlActivation':_0x1ac972,'existingActivation':_0x57f410});}}for(const _0x5a9bd7 of _0xa2e208){!_0x3e70af[_0x3eb76d(0x12f)](_0x5a9bd7[_0x3eb76d(0x1b0)])&&_0x3a7df3[_0x3eb76d(0x17d)]({'type':_0x3eb76d(0x12d),'name':_0x5a9bd7[_0x3eb76d(0x1b0)],'existingActivation':_0x5a9bd7});}return _0x3a7df3;}function calculateYamlDiff(_0xdea87,_0x5c8aab){if(_0x5c8aab){const _0x4ee6b9=generateDiff(_0x5c8aab,_0xdea87),_0x24e8f6=hasChanges(_0x4ee6b9);return{'isNew':![],'hasChanges':_0x24e8f6,'diff':_0x24e8f6?formatDiffWithColors(_0x4ee6b9):undefined};}const _0x2554c9=generateDiff('',_0xdea87);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x2554c9)};}function a152_0x3f4b(_0x7b46a5,_0x859462){_0x7b46a5=_0x7b46a5-0xff;const _0x446374=a152_0x4463();let _0x3f4be2=_0x446374[_0x7b46a5];return _0x3f4be2;}export function calculateSegmentDiff(_0x3b7113,_0x5ad451,_0x161090,_0x4e8792,_0x2d4f74){const _0x3ee320=segmentToYamlString(_0x3b7113),_0x478b80=_0x5ad451?segmentToYamlString(segmentWithActivationsToYaml(_0x5ad451,_0x161090,undefined,_0x4e8792,_0x2d4f74)):undefined;return calculateYamlDiff(_0x3ee320,_0x478b80);}export function calculateJourneyDiff(_0x50db96,_0x302b53){const _0x353320=normalizeJourneyDef(_0x50db96,_0x50db96),_0x42c0ea=a152_0x9fc482(_0x353320),_0x3e2ff7=_0x302b53?a152_0x9fc482(normalizeJourneyDef(_0x302b53,_0x50db96)):undefined;return calculateYamlDiff(_0x42c0ea,_0x3e2ff7);}export function findSegmentsToDelete(_0x3dcb69,_0x289635,_0x544ac2,_0x5c59dc,_0x5b1688){const _0x5847ab=a152_0x25b4a3,_0x4f2025=new Set();for(const {yamlConfig:_0x2439a9,folderPath:_0x15c6b2}of _0x289635){_0x4f2025[_0x5847ab(0x1c5)](_0x15c6b2+':'+_0x2439a9[_0x5847ab(0x1b0)]);}return _0x3dcb69[_0x5847ab(0x103)](_0x33d51c=>{const _0x526621=_0x5847ab,_0x2e2aca=_0x33d51c[_0x526621(0x12b)]?_0x544ac2[_0x526621(0x151)](_0x33d51c[_0x526621(0x12b)][_0x526621(0x1da)]())||'':'',_0x440a8d=_0x2e2aca+':'+_0x33d51c[_0x526621(0x1b0)];if(_0x4f2025[_0x526621(0x12f)](_0x440a8d))return![];if(_0x5b1688)return _0x2e2aca===_0x5c59dc||_0x2e2aca[_0x526621(0x1fc)](_0x5c59dc+'/');return!![];});}export function findJourneysToDelete(_0x4cf26e,_0x2749e3,_0x32b442,_0x9cc7c0,_0xc9aaf2){const _0x20650e=a152_0x25b4a3,_0x1868e2=new Set();for(const {yamlConfig:_0x327b01,folderPath:_0x1ea087}of _0x2749e3){_0x1868e2[_0x20650e(0x1c5)](_0x1ea087+':'+_0x327b01['name']);}return _0x4cf26e[_0x20650e(0x103)](_0x1fa307=>{const _0x3d313b=_0x20650e,_0x34feba=_0x1fa307['folderId']?_0x32b442['get'](_0x1fa307[_0x3d313b(0x164)])||'':'',_0x2c157b=_0x34feba+':'+_0x1fa307[_0x3d313b(0x19b)];if(_0x1868e2[_0x3d313b(0x12f)](_0x2c157b))return![];if(_0xc9aaf2)return _0x34feba===_0x9cc7c0||_0x34feba['startsWith'](_0x9cc7c0+'/');return!![];});}export function buildSegmentLookupMap(_0xaa0d9d,_0x16600a){const _0x470e02=a152_0x25b4a3,_0x9e69c1=new Map();for(const _0x503141 of _0xaa0d9d){const _0x916ff=_0x503141['segmentFolderId']?_0x16600a[_0x470e02(0x151)](_0x503141[_0x470e02(0x12b)]['toString']())||'':'',_0x49eb80=_0x916ff+':'+_0x503141[_0x470e02(0x1b0)];_0x9e69c1[_0x470e02(0x168)](_0x49eb80,_0x503141);}return _0x9e69c1;}export function buildSegmentNameToIdMap(_0x2e7903){const _0x151500=a152_0x25b4a3,_0x3d3fb2=new Map();for(const _0x189007 of _0x2e7903){_0x3d3fb2[_0x151500(0x168)](_0x189007[_0x151500(0x1b0)],_0x189007['id']);}return _0x3d3fb2;}export function buildJourneyBundleLookupMap(_0x1887ea,_0x1d7310){const _0xcb2970=a152_0x25b4a3,_0x19a6d9=new Map();for(const _0x2833a8 of _0x1887ea){const _0x484404=_0x2833a8[_0xcb2970(0x164)]?_0x1d7310[_0xcb2970(0x151)](_0x2833a8['folderId'])||'':'',_0x208a96=_0x484404+':'+_0x2833a8[_0xcb2970(0x19b)];!_0x19a6d9[_0xcb2970(0x12f)](_0x208a96)&&_0x19a6d9[_0xcb2970(0x168)](_0x208a96,[]),_0x19a6d9[_0xcb2970(0x151)](_0x208a96)[_0xcb2970(0x17d)](_0x2833a8);}for(const _0x5d3cbd of _0x19a6d9[_0xcb2970(0x10a)]()){_0x5d3cbd['sort']((_0x5e1f6d,_0x3bd3bb)=>(_0x5e1f6d['versionNumber']||0x0)-(_0x3bd3bb[_0xcb2970(0x12c)]||0x0));}return _0x19a6d9;}export function collectFoldersToCreate(_0xd5ad37,_0x15b853){const _0x101cbd=a152_0x25b4a3,_0x3d1b90=new Set();for(const _0x11258c of _0xd5ad37){if(!_0x11258c)continue;if(_0x15b853['has'](_0x11258c))continue;const _0x273038=_0x11258c['split']('/');let _0x5b1a28='';for(const _0x46a902 of _0x273038){_0x5b1a28=_0x5b1a28?_0x5b1a28+'/'+_0x46a902:_0x46a902,!_0x15b853[_0x101cbd(0x12f)](_0x5b1a28)&&_0x3d1b90[_0x101cbd(0x1c5)](_0x5b1a28);}}return _0x3d1b90;}export function parseAndClassifyYamlFiles(_0x45f68b,_0x3982b1,_0x15cebe){const _0xb7423d=a152_0x25b4a3,_0x51c84f=[],_0x28865c=[];for(const _0x5a812c of _0x45f68b){const _0x4c8f8a=a152_0x5c5da7[_0xb7423d(0x1d5)](_0x3982b1,a152_0x5c5da7[_0xb7423d(0x163)](_0x5a812c)),_0x31a776=_0x4c8f8a==='.'?'':_0x4c8f8a[_0xb7423d(0x113)](/\\/g,'/'),_0x5d0132=readFileSync(_0x5a812c,_0xb7423d(0x1a2)),_0x317009=a152_0x19c01e[_0xb7423d(0x1a6)](_0x5d0132);if(isJourneyDef(_0x317009)){const _0xdc84e3=a152_0x3b46a5(_0x5d0132);_0x28865c[_0xb7423d(0x17d)]({'yamlConfig':_0xdc84e3,'folderPath':_0x31a776,'sourcePath':_0x5a812c});}else{if(!_0x15cebe?.[_0xb7423d(0x148)]){const _0x3dc6e4=parseSegmentYamlFile(_0x5d0132),_0x200fc4=normalizeChildSegmentYaml(_0x3dc6e4);_0x51c84f[_0xb7423d(0x17d)]({'yamlConfig':_0x200fc4,'folderPath':_0x31a776,'sourcePath':_0x5a812c});}}}return{'segments':_0x51c84f,'journeys':_0x28865c};}export function validateParsedFiles(_0xcb9e3a,_0x4d575d){const _0x5d5bfb=a152_0x25b4a3,_0x2644d3=[];for(const {yamlConfig:_0x3d3df7,sourcePath:_0x2cb0dd}of _0xcb9e3a[_0x5d5bfb(0x1e4)]){const _0x5445b7=readFileSync(_0x2cb0dd,'utf-8'),_0x479ec8=a152_0x19c01e['parseDocument'](_0x5445b7),_0x425642=validateSegmentDef(_0x3d3df7,{'source':_0x5445b7,'document':_0x479ec8},{'skipSchema':!![]});if(!_0x425642[_0x5d5bfb(0x180)]){const _0x3e3bed=a152_0x5c5da7[_0x5d5bfb(0x1d5)](_0x4d575d,_0x2cb0dd);_0x2644d3[_0x5d5bfb(0x17d)]({'filePath':_0x3e3bed,'source':_0x5445b7,'result':_0x425642,'isJourney':![]});}}for(const {yamlConfig:_0x549eb3,sourcePath:_0x4e6cbe}of _0xcb9e3a[_0x5d5bfb(0x147)]){const _0x154c4b=readFileSync(_0x4e6cbe,_0x5d5bfb(0x1a2)),_0x470f28=a152_0x19c01e[_0x5d5bfb(0x1be)](_0x154c4b),_0x9d45aa=validateJourneyDef(_0x549eb3,{'source':_0x154c4b,'document':_0x470f28},{'skipSchema':!![]});if(!_0x9d45aa[_0x5d5bfb(0x180)]){const _0x39f2e3=a152_0x5c5da7[_0x5d5bfb(0x1d5)](_0x4d575d,_0x4e6cbe);_0x2644d3['push']({'filePath':_0x39f2e3,'source':_0x154c4b,'result':_0x9d45aa,'isJourney':!![]});}}return _0x2644d3;}export function formatValidationErrors(_0x46138e){const _0x327259=a152_0x25b4a3,_0x51e383=[];for(const {filePath:_0x582040,source:_0x3dff4b,result:_0xcb42ba,isJourney:_0x46b37a}of _0x46138e){const _0x40616b=_0x46b37a?'journey':_0x327259(0x1c4);_0x51e383['push']('\x0a'+_0x582040+'\x20('+_0x40616b+_0x327259(0x1bb)+_0xcb42ba[_0x327259(0x1d3)][_0x327259(0x1d0)]+'\x20error(s)'),_0x51e383['push'](formatValidationResult(_0xcb42ba,_0x3dff4b,_0x582040));}return _0x51e383[_0x327259(0x138)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x455533){const _0x1c0265=a152_0x25b4a3,_0x505446=new Set(),_0x51ef14=new Map(),_0x4fff7f=collectSegmentUsageCounts(_0x455533);if(_0x455533[_0x1c0265(0x1e4)])for(const [_0x1329d4,_0x4ec525]of Object[_0x1c0265(0x10c)](_0x455533[_0x1c0265(0x1e4)])){_0x505446['add'](_0x1329d4);if(_0x4ec525[_0x1c0265(0x162)]){const _0x8b5b51=yamlRuleToApi(_0x4ec525[_0x1c0265(0x162)]),_0x333e01=apiRuleToYaml(_0x8b5b51);_0x51ef14[_0x1c0265(0x168)](_0x1329d4,_0x333e01);}}const _0x3a51ee=new Map();let _0x152966=0x0;for(const [_0x26b35e,_0x2a356a]of _0x51ef14){const _0xc82131=serializeExpandedRule(_0x2a356a,_0x51ef14),_0x292291=_0x3a51ee['get'](_0xc82131)||[];_0x292291[_0x1c0265(0x17d)]({'name':_0x26b35e,'index':_0x152966}),_0x3a51ee['set'](_0xc82131,_0x292291),_0x152966++;}const _0x55eb2c=new Map();for(const [_0x3c6e41,_0x25e055]of _0x3a51ee){const _0x305fbf=_0x25e055[_0x1c0265(0x197)]()[_0x1c0265(0x100)]((_0x564610,_0x998dbd)=>{const _0x300509=_0x1c0265,_0xf00862=_0x4fff7f[_0x300509(0x151)](_0x564610['name'])||0x0,_0x268a0e=_0x4fff7f[_0x300509(0x151)](_0x998dbd[_0x300509(0x1b0)])||0x0;if(_0xf00862!==_0x268a0e)return _0x268a0e-_0xf00862;return _0x564610[_0x300509(0x11c)]-_0x998dbd['index'];})['map'](_0xf86a0b=>_0xf86a0b[_0x1c0265(0x1b0)]),_0x39490f=[];for(const _0x2eed6b of _0x305fbf){const _0x335c42=_0x4fff7f[_0x1c0265(0x151)](_0x2eed6b)||0x0,_0x205ff3=Math[_0x1c0265(0x1b3)](_0x335c42,0x1);for(let _0x4f1da4=0x0;_0x4f1da4<_0x205ff3;_0x4f1da4++){_0x39490f[_0x1c0265(0x17d)](_0x2eed6b);}}_0x55eb2c[_0x1c0265(0x168)](_0x3c6e41,_0x39490f);}return{'existingLocalSegmentNames':_0x505446,'localSegmentRules':_0x51ef14,'localExpandedRuleToNames':_0x55eb2c};}export function createSegmentIdResolver(_0x1745ab,_0x416635){return async _0x352f97=>{const _0x1fe629=a152_0x3f4b,_0x1450ed=_0x1745ab[_0x1fe629(0x151)](_0x352f97);if(!_0x1450ed)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1fe629(0x1ee)+_0x352f97+_0x1fe629(0x18b)+_0x416635+'\x27)');return _0x1450ed;};}export function extractRootFolderId(_0xa5a856){const _0x83377f=a152_0x25b4a3;return _0xa5a856[_0x83377f(0x17b)]?.[_0x83377f(0x1dc)]?.[_0x83377f(0x178)]?.['id']||_0xa5a856[_0x83377f(0x17b)]?.[_0x83377f(0x1bc)]?.[_0x83377f(0x178)]?.['id'];}export function buildConnectionMaps(_0x46e27f){const _0x303de4=a152_0x25b4a3,_0x3c3dd5=new Map(),_0x223e10=new Map(),_0xca83b8=new Map();for(const _0x55ddde of _0x46e27f){_0x3c3dd5[_0x303de4(0x168)](_0x55ddde[_0x303de4(0x1b0)],parseInt(_0x55ddde['id'],0xa)),_0x223e10['set'](_0x55ddde['id'],_0x55ddde['name']),_0xca83b8[_0x303de4(0x168)](_0x55ddde[_0x303de4(0x1b0)],_0x55ddde[_0x303de4(0x114)]);}return{'nameToId':_0x3c3dd5,'idToName':_0x223e10,'nameToType':_0xca83b8};}export function calculatePushStats(_0xfe69c9,_0x2e6a0f,_0x39286b,_0x2e9a54,_0x4545b6,_0x1a921b,_0xb358d6){const _0x194222=a152_0x25b4a3,_0x34faab=_0xfe69c9[_0x194222(0x103)](_0x370979=>_0x370979[_0x194222(0x185)]),_0x5bcb27=_0xfe69c9['filter'](_0xdf0a9e=>!_0xdf0a9e[_0x194222(0x185)]&&_0xdf0a9e['hasChanges']),_0x213a97=_0xfe69c9[_0x194222(0x103)](_0x544583=>!_0x544583[_0x194222(0x185)]&&!_0x544583[_0x194222(0x1f9)]),_0x2339c0=_0x1a921b?_0x2e9a54:[],_0x3770a5=_0x2e6a0f[_0x194222(0x103)](_0x4435da=>_0x4435da[_0x194222(0x185)]),_0x3cd9b9=_0x2e6a0f['filter'](_0x557dad=>!_0x557dad[_0x194222(0x185)]&&_0x557dad[_0x194222(0x1f9)]),_0xa1eaf5=_0x2e6a0f[_0x194222(0x103)](_0x29123c=>!_0x29123c[_0x194222(0x185)]&&!_0x29123c['hasChanges']),_0x103206=_0x1a921b?_0x4545b6:[],_0x4eb9f0=_0xfe69c9[_0x194222(0x128)](_0x223cf7=>_0x223cf7['activationActions']),_0xbf8c0e=_0x4eb9f0[_0x194222(0x103)](_0x4ae39a=>_0x4ae39a[_0x194222(0x114)]===_0x194222(0x146)),_0x5be745=_0x4eb9f0['filter'](_0x555fde=>_0x555fde[_0x194222(0x114)]===_0x194222(0x181)),_0x5368c2=_0x4eb9f0[_0x194222(0x103)](_0x172a37=>_0x172a37[_0x194222(0x114)]===_0x194222(0x12d)),_0xcf1b81=Array[_0x194222(0x1f8)](_0x39286b)[_0x194222(0x100)](),_0x219bf5=_0xb358d6?![]:_0x34faab[_0x194222(0x1d0)]>0x0||_0x5bcb27[_0x194222(0x1d0)]>0x0||_0x2339c0[_0x194222(0x1d0)]>0x0,_0x5917f3=_0x3770a5['length']>0x0||_0x3cd9b9['length']>0x0||_0x103206[_0x194222(0x1d0)]>0x0,_0x15faca=_0xb358d6?![]:_0x4eb9f0[_0x194222(0x1d0)]>0x0,_0x24e329=_0xcf1b81['length']>0x0;return{'segments':{'new':_0x34faab,'changed':_0x5bcb27,'unchanged':_0x213a97,'toDelete':_0x2339c0},'journeys':{'new':_0x3770a5,'changed':_0x3cd9b9,'unchanged':_0xa1eaf5,'toDelete':_0x103206},'activations':{'all':_0x4eb9f0,'toCreate':_0xbf8c0e,'toUpdate':_0x5be745,'toDelete':_0x5368c2},'folders':{'toCreate':_0xcf1b81},'counts':{'segments':{'new':_0x34faab[_0x194222(0x1d0)],'changed':_0x5bcb27[_0x194222(0x1d0)],'unchanged':_0x213a97[_0x194222(0x1d0)],'toDelete':_0x2339c0[_0x194222(0x1d0)]},'journeys':{'new':_0x3770a5[_0x194222(0x1d0)],'changed':_0x3cd9b9[_0x194222(0x1d0)],'unchanged':_0xa1eaf5[_0x194222(0x1d0)],'toDelete':_0x103206[_0x194222(0x1d0)]},'activations':{'create':_0xbf8c0e[_0x194222(0x1d0)],'update':_0x5be745[_0x194222(0x1d0)],'delete':_0x5368c2[_0x194222(0x1d0)]},'folders':_0xcf1b81['length']},'hasChanges':_0x219bf5||_0x5917f3||_0x15faca||_0x24e329};}export async function buildPushExecutionContext(_0x44ea62,_0x711871,_0x2a42d4,_0x59dcac,_0x4f73f0,_0x509fad){const _0x1efda6=a152_0x25b4a3,_0x38347b=extractRootFolderId(_0x2a42d4),{pathToId:_0x1551c6,idToPath:_0x456b8e}=buildFolderMaps(_0x4f73f0),_0x3adc85=buildSegmentNameToIdMap(_0x59dcac),_0x406dd9=new Map(),{batchAsync:_0x3a6b4f}=await import('../../utils/async.js'),[_0x55e09e,_0x1bca7a]=await Promise[_0x1efda6(0x1e6)]([_0x44ea62[_0x1efda6(0x1a1)][_0x1efda6(0x1b2)](),_0x44ea62[_0x1efda6(0x123)][_0x1efda6(0x130)](),((async()=>{const _0x42018e=_0x1efda6;!_0x509fad&&_0x59dcac[_0x42018e(0x1d0)]>0x0&&await _0x3a6b4f(_0x59dcac,async _0x44dd0c=>{const _0x462d67=_0x42018e,_0x234e58=await _0x44ea62[_0x462d67(0x1c4)][_0x462d67(0x171)](_0x711871,_0x44dd0c['id']);_0x406dd9['set'](_0x44dd0c['id'],_0x234e58);});})())]),{emailToId:_0x2cf07a,idToEmail:_0x404385}=_0x55e09e,_0x2fe65f=buildConnectionMaps(_0x1bca7a);return{'rootFolderId':_0x38347b,'folderPathToId':_0x1551c6,'folderIdToPath':_0x456b8e,'segmentNameToId':_0x3adc85,'activationsBySegmentId':_0x406dd9,'emailToIdMap':_0x2cf07a,'idToEmailMap':_0x404385,'connectionNameToIdMap':_0x2fe65f[_0x1efda6(0x104)],'connectionIdToNameMap':_0x2fe65f[_0x1efda6(0x13f)],'connectionNameToTypeMap':_0x2fe65f['nameToType']};}export function createPushYamlContextForBundle(_0x508ccc,_0x220ff9,_0x3a695e,_0x86ac39,_0x36b2dd,_0x3c11e5,_0x428862,_0x4ab224){const {existingLocalSegmentNames:_0x1684b6,localExpandedRuleToNames:_0x1f4158}=_0x86ac39,_0xdc8eca=new Set(),_0x307e07=new Map(),_0x43899a=new Map(),_0x15c545=new Map(),_0x1b6141=createJumpTargetCache(),_0x4bcd4b=new Map(),_0x290e9b=new Map(),_0x260e83=new Set();let _0x57464f;const _0x15cc12=_0x2f9b7b=>{const _0x3b0580={'resolveSegment':async _0x4bff81=>{const _0x4ef71d=a152_0x3f4b,_0x15eced=_0x15c545['get'](_0x4bff81);if(_0x15eced!==undefined)return{'name':_0x15eced,'isJourneyLocal':!![]};try{const _0x4d2097=await fetchSegment(_0x508ccc,_0x220ff9,_0x4bff81,_0x3a695e);if(!_0x4d2097)throw new Error('Segment\x20not\x20found');const _0x3ed8e2=generateJourneyLocalName(_0x4d2097[_0x4ef71d(0x1b0)]),_0xb50200=_0x4d2097[_0x4ef71d(0x19a)]===SEGMENT_KIND_JOURNEY&&_0x3ed8e2!==undefined;let _0x4bc983=_0x4d2097['name'],_0x68e0d9;if(_0xb50200&&_0x4d2097['rule']){const _0x3fb695=apiRuleToYaml(_0x4d2097[_0x4ef71d(0x162)]);_0x290e9b[_0x4ef71d(0x168)](_0x4bff81,_0x3fb695);const _0x3118bd=async _0x343ea9=>{const _0x141569=_0x4ef71d,_0x1fa837=collectSegmentRefsFromRule(_0x343ea9);for(const _0x5db000 of _0x1fa837){if(!_0x290e9b[_0x141569(0x12f)](_0x5db000))try{const _0x520e59=await fetchSegment(_0x508ccc,_0x220ff9,_0x5db000,_0x3a695e);if(_0x520e59?.[_0x141569(0x162)]){const _0x8959e1=apiRuleToYaml(_0x520e59[_0x141569(0x162)]);_0x290e9b[_0x141569(0x168)](_0x5db000,_0x8959e1),await _0x3118bd(_0x8959e1);}}catch(_0x1958d8){logger['debug'](_0x141569(0x1e0)+_0x5db000+':\x20'+_0x1958d8);}}};await _0x3118bd(_0x3fb695);const _0x4eea98=serializeExpandedRule(_0x3fb695,_0x290e9b),_0x4f3b96=_0x1f4158[_0x4ef71d(0x151)](_0x4eea98);if(_0x4f3b96&&_0x4f3b96['length']>0x0){const _0x556e15=_0x307e07[_0x4ef71d(0x151)](_0x4eea98)||0x0,_0x21e16f=_0x4f3b96[_0x556e15]||_0x4f3b96[_0x4f3b96[_0x4ef71d(0x1d0)]-0x1];_0x307e07[_0x4ef71d(0x168)](_0x4eea98,_0x556e15+0x1),_0x4bc983=_0x21e16f,_0xdc8eca['add'](_0x4bc983),_0x15c545[_0x4ef71d(0x168)](_0x4bff81,_0x4bc983);const _0x5b8626=await resolveRuleSegmentRefs(_0x3fb695,async _0x257242=>{const _0x452c7d=_0x4ef71d,_0x12d310=_0x15c545[_0x452c7d(0x151)](_0x257242);if(_0x12d310)return _0x12d310;const _0x491a1e=await _0x57464f[_0x452c7d(0x1b7)](_0x257242);return _0x491a1e[_0x452c7d(0x1b0)];});_0x68e0d9={'description':_0x4d2097['description'],'rule':_0x5b8626};}else{const _0x183a80=_0x4bcd4b[_0x4ef71d(0x151)](_0x4eea98);if(_0x183a80)_0x4bc983=_0x183a80,_0x15c545[_0x4ef71d(0x168)](_0x4bff81,_0x4bc983);else{if(_0x3ed8e2){let _0x574d1b=_0x3ed8e2,_0x70ea83=0x2;while(_0xdc8eca[_0x4ef71d(0x12f)](_0x574d1b)||_0x1684b6['has'](_0x574d1b)){_0x574d1b=_0x3ed8e2+'_'+_0x70ea83,_0x70ea83++;}_0xdc8eca[_0x4ef71d(0x1c5)](_0x574d1b),_0x4bc983=_0x574d1b;}_0x15c545[_0x4ef71d(0x168)](_0x4bff81,_0x4bc983),_0x4bcd4b[_0x4ef71d(0x168)](_0x4eea98,_0x4bc983);const _0x1a3744=await resolveRuleSegmentRefs(_0x3fb695,async _0x5ef1f9=>{const _0x479564=_0x4ef71d,_0x1defdb=_0x15c545[_0x479564(0x151)](_0x5ef1f9);if(_0x1defdb)return _0x1defdb;const _0x4858f3=await _0x57464f[_0x479564(0x1b7)](_0x5ef1f9);return _0x4858f3[_0x479564(0x1b0)];});_0x68e0d9={'description':_0x4d2097[_0x4ef71d(0x1b9)],'rule':_0x1a3744};}}}return{'name':_0x4bc983,'isJourneyLocal':_0xb50200,'definition':_0x68e0d9};}catch(_0x22491d){return logger[_0x4ef71d(0x1cc)](_0x4ef71d(0x11e)+_0x4bff81+':\x20'+_0x22491d),{'name':_0x4bff81,'isJourneyLocal':![]};}},'resolveActivation':async _0x2617a6=>{const _0x66a7e5=a152_0x3f4b,_0x18f5a0=_0x43899a[_0x66a7e5(0x151)](_0x2617a6);if(_0x18f5a0!==undefined)return{'name':_0x18f5a0,'isJourneyLocal':!![]};try{let _0x273b53=_0x428862?.[_0x66a7e5(0x151)](_0x2617a6);!_0x273b53&&(_0x273b53=await _0x508ccc[_0x66a7e5(0x174)][_0x66a7e5(0x18f)](_0x2f9b7b,_0x2617a6));const _0x20866e=_0x273b53['attributes']['activationParams'][_0x66a7e5(0x1b0)]||_0x2617a6,_0x2badbf=sanitizeYamlKey(_0x20866e)||_0x66a7e5(0x1db)+_0x2617a6,_0x570d31=_0x2badbf;_0x43899a['set'](_0x2617a6,_0x570d31);const _0x78e362=journeyActivationStepToYaml(_0x273b53,_0x36b2dd,_0x3c11e5);return{'name':_0x570d31,'isJourneyLocal':!![],'definition':_0x78e362};}catch(_0x4deef7){return logger[_0x66a7e5(0x1cc)]('Failed\x20to\x20resolve\x20activation\x20'+_0x2617a6+':\x20'+_0x4deef7),{'name':_0x2617a6,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2da6d6,_0x16f55a)=>resolveJumpTarget(_0x2da6d6,_0x16f55a,_0x1b6141,async _0x3b00f6=>{const _0x3794ab=a152_0x3f4b,_0x172ddf=_0x4ab224?.[_0x3794ab(0x151)](_0x3b00f6);if(_0x172ddf)return _0x172ddf;return _0x508ccc[_0x3794ab(0x174)]['getJourney'](_0x3b00f6);})};return _0x57464f=_0x3b0580,_0x3b0580;},_0x49fee9=async _0x4974d9=>{const _0x1d3e29=a152_0x3f4b,{collectSegmentIdsFromJourneyApi:_0x4f90e0}=await import(_0x1d3e29(0x14e)),{batchAsync:_0x4c3da7}=await import(_0x1d3e29(0x111)),_0x37bf94=new Set();for(const _0x279586 of _0x4974d9){let _0x160bd8=_0x4ab224?.['get'](_0x279586);!_0x160bd8&&(_0x160bd8=await _0x508ccc[_0x1d3e29(0x174)][_0x1d3e29(0x1e3)](_0x279586));const _0x2a8310=_0x4f90e0(_0x160bd8);for(const _0x4b4511 of _0x2a8310){_0x37bf94[_0x1d3e29(0x1c5)](_0x4b4511);}}let _0x17ce1a=Array[_0x1d3e29(0x1f8)](_0x37bf94);while(_0x17ce1a[_0x1d3e29(0x1d0)]>0x0){const _0x54a3c6=_0x17ce1a[_0x1d3e29(0x103)](_0x418071=>!_0x260e83[_0x1d3e29(0x12f)](_0x418071));if(_0x54a3c6[_0x1d3e29(0x1d0)]===0x0)break;const _0x50fb4c=await _0x4c3da7(_0x54a3c6,async _0x22aeb9=>{_0x260e83['add'](_0x22aeb9);const _0x2c9fcf=await fetchSegment(_0x508ccc,_0x220ff9,_0x22aeb9,_0x3a695e);if(!_0x2c9fcf)return null;return{'segmentId':_0x22aeb9,'segment':_0x2c9fcf};},0xa),_0x305024=new Set();for(const _0x5ef99f of _0x50fb4c){if(!_0x5ef99f?.[_0x1d3e29(0x1c4)]?.[_0x1d3e29(0x162)])continue;const _0xb86270=apiRuleToYaml(_0x5ef99f[_0x1d3e29(0x1c4)][_0x1d3e29(0x162)]);_0x290e9b[_0x1d3e29(0x168)](_0x5ef99f[_0x1d3e29(0x153)],_0xb86270);const _0x1751e7=collectSegmentRefsFromRule(_0xb86270);for(const _0x2af9c4 of _0x1751e7){!_0x260e83[_0x1d3e29(0x12f)](_0x2af9c4)&&_0x305024['add'](_0x2af9c4);}}_0x17ce1a=Array['from'](_0x305024);}};return{'createYamlContext':_0x15cc12,'prefetchJourneySegments':_0x49fee9};}export async function executePushSegments(_0x472db3,_0x55e794,_0x422f8c,_0x2e560f,_0xf25fd3){const _0x1af19a=a152_0x25b4a3,{segmentDefToCreateRequest:_0x412e2d,segmentDefToUpdateRequest:_0x43ca78}=await import(_0x1af19a(0x13b)),_0x5baa7b=_0x422f8c['folderPathToId'],_0x5abf4a=0x5,_0x3e2f4f=async _0xfebeb=>{const _0x5f0b0f=_0x1af19a,_0x1c2a34=_0xfebeb['folderPath']?_0x5baa7b[_0x5f0b0f(0x151)](_0xfebeb[_0x5f0b0f(0x160)]):undefined;let _0x12f536;const _0x130e5a={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x33ca93=_0xfebeb[_0x5f0b0f(0x199)];if(_0xfebeb['yamlConfig']['rule']){const _0x471874=createSegmentIdResolver(_0x422f8c[_0x5f0b0f(0x14b)],_0xfebeb['yamlConfig'][_0x5f0b0f(0x1b0)]),_0x22a0ac=await resolveRuleSegmentIds(_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x162)],_0x471874);_0x33ca93={..._0xfebeb['yamlConfig'],'rule':_0x22a0ac};}try{if(_0xfebeb['isNew']){_0xf25fd3['onProgress']?.({'type':_0x5f0b0f(0x13c),'name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]});const _0x2672ed=_0x412e2d(_0x33ca93,_0x1c2a34),_0x26c9cf=await _0xf25fd3[_0x5f0b0f(0x1c0)]('Creating\x20segment\x20\x27'+_0xfebeb[_0x5f0b0f(0x199)]['name']+_0x5f0b0f(0x12a),()=>_0x472db3['segment'][_0x5f0b0f(0x108)](_0x2e560f[_0x5f0b0f(0x145)],_0x2672ed));_0x12f536=_0x26c9cf['data']['id'],_0x422f8c[_0x5f0b0f(0x14b)][_0x5f0b0f(0x168)](_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)],_0x12f536),_0x130e5a[_0x5f0b0f(0x1df)]={'name':_0xfebeb['yamlConfig']['name'],'id':_0x12f536},_0xf25fd3[_0x5f0b0f(0x1aa)]?.({'type':'segment_created','name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)],'segmentId':_0x12f536}),_0xf25fd3[_0x5f0b0f(0x1e2)]?.(_0x5f0b0f(0x1c1)+_0xfebeb['yamlConfig'][_0x5f0b0f(0x1b0)]+'\x27'),_0x130e5a[_0x5f0b0f(0x167)]=0x1;}else{if(_0xfebeb[_0x5f0b0f(0x1f9)]){_0xf25fd3[_0x5f0b0f(0x1aa)]?.({'type':'segment_updating','name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]});const _0x395b10=_0x43ca78(_0x33ca93);_0x1c2a34!==_0xfebeb[_0x5f0b0f(0x1a3)]?.[_0x5f0b0f(0x12b)]&&(_0x395b10['segmentFolderId']=_0x1c2a34?parseInt(_0x1c2a34,0xa):undefined),await _0xf25fd3[_0x5f0b0f(0x1c0)](_0x5f0b0f(0x1e8)+_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]+_0x5f0b0f(0x12a),()=>_0x472db3[_0x5f0b0f(0x1c4)][_0x5f0b0f(0x1ef)](_0x2e560f[_0x5f0b0f(0x145)],_0xfebeb[_0x5f0b0f(0x1a3)]['id'],_0x395b10)),_0x12f536=_0xfebeb[_0x5f0b0f(0x1a3)]['id'],_0xf25fd3['onProgress']?.({'type':'segment_updated','name':_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]}),_0xf25fd3['logSuccess']?.(_0x5f0b0f(0x1c9)+_0xfebeb[_0x5f0b0f(0x199)]['name']+'\x27'),_0x130e5a[_0x5f0b0f(0x1d4)]=0x1;}else _0x12f536=_0xfebeb['existingSegment']['id'];}}catch(_0x28698b){const _0x291457=isHttp400Error(_0x28698b),_0x3484d2=_0x291457?ErrorCode[_0x5f0b0f(0x121)]:ErrorCode[_0x5f0b0f(0x1cd)],_0x42db44=getErrorMessage(_0x28698b);throw new SDKError(_0x3484d2,_0x5f0b0f(0x1f6)+(_0xfebeb[_0x5f0b0f(0x185)]?'create':_0x5f0b0f(0x181))+_0x5f0b0f(0x144)+_0xfebeb[_0x5f0b0f(0x15c)]+_0x5f0b0f(0x190)+_0x42db44,_0x28698b);}try{const _0x48b93=await syncActivationsForSegment(_0x472db3,_0x2e560f[_0x5f0b0f(0x145)],_0x12f536,_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)],_0xfebeb['activationActions'],_0xf25fd3,_0xfebeb['absolutePath']);_0x130e5a[_0x5f0b0f(0x1bf)]=_0x48b93;}catch(_0x505fd4){if(_0x505fd4 instanceof SDKError)throw _0x505fd4;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0xfebeb[_0x5f0b0f(0x199)][_0x5f0b0f(0x1b0)]+'\x27\x20from\x20file:\x20'+_0xfebeb[_0x5f0b0f(0x15c)]+'\x0a\x20\x20'+getErrorMessage(_0x505fd4),_0x505fd4);}return _0x130e5a;},_0x52d5d2=await batchAsync(_0x55e794,_0x3e2f4f,_0x5abf4a),_0xd34c6e={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x49a27b of _0x52d5d2){_0xd34c6e['created']+=_0x49a27b[_0x1af19a(0x167)],_0xd34c6e[_0x1af19a(0x1d4)]+=_0x49a27b[_0x1af19a(0x1d4)],_0x49a27b[_0x1af19a(0x1df)]&&_0xd34c6e[_0x1af19a(0x1ff)][_0x1af19a(0x168)](_0x49a27b[_0x1af19a(0x1df)][_0x1af19a(0x1b0)],_0x49a27b[_0x1af19a(0x1df)]['id']),_0xd34c6e[_0x1af19a(0x1bf)][_0x1af19a(0x167)]+=_0x49a27b['activations'][_0x1af19a(0x167)],_0xd34c6e['activations']['updated']+=_0x49a27b[_0x1af19a(0x1bf)][_0x1af19a(0x1d4)],_0xd34c6e[_0x1af19a(0x1bf)][_0x1af19a(0x139)]+=_0x49a27b[_0x1af19a(0x1bf)][_0x1af19a(0x139)];}return _0xd34c6e;}async function syncActivationsForSegment(_0x395e79,_0x49b752,_0x165758,_0x1715c0,_0x696048,_0x131750,_0x3337a3){const _0x3c012b=a152_0x25b4a3,_0x4e0fbc={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x2251d3 of _0x696048){try{if(_0x2251d3[_0x3c012b(0x114)]===_0x3c012b(0x146)&&_0x2251d3[_0x3c012b(0x11d)])_0x131750[_0x3c012b(0x1aa)]?.({'type':_0x3c012b(0x124),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),await _0x131750[_0x3c012b(0x1c0)](_0x3c012b(0x18d)+_0x2251d3['name']+_0x3c012b(0x12a),()=>_0x395e79[_0x3c012b(0x1c4)][_0x3c012b(0x189)](_0x49b752,_0x165758,_0x2251d3[_0x3c012b(0x11d)])),_0x131750[_0x3c012b(0x1aa)]?.({'type':_0x3c012b(0x17c),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),_0x131750['logSuccess']?.(_0x3c012b(0x132)+_0x2251d3['name']+'\x27'),_0x4e0fbc[_0x3c012b(0x167)]++;else{if(_0x2251d3[_0x3c012b(0x114)]===_0x3c012b(0x181)&&_0x2251d3[_0x3c012b(0x11d)]&&_0x2251d3['existingActivation'])_0x131750[_0x3c012b(0x1aa)]?.({'type':_0x3c012b(0x11f),'segmentName':_0x1715c0,'activationName':_0x2251d3['name']}),await _0x131750['withProgress'](_0x3c012b(0x140)+_0x2251d3['name']+_0x3c012b(0x12a),()=>_0x395e79[_0x3c012b(0x1c4)][_0x3c012b(0x1c6)](_0x49b752,_0x165758,_0x2251d3['existingActivation']['id'],_0x2251d3[_0x3c012b(0x11d)])),_0x131750['onProgress']?.({'type':_0x3c012b(0x1f0),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),_0x131750['logSuccess']?.(_0x3c012b(0x142)+_0x2251d3[_0x3c012b(0x1b0)]+'\x27'),_0x4e0fbc[_0x3c012b(0x1d4)]++;else _0x2251d3[_0x3c012b(0x114)]===_0x3c012b(0x12d)&&_0x2251d3[_0x3c012b(0x1ad)]&&(_0x131750['onProgress']?.({'type':_0x3c012b(0x125),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),await _0x131750[_0x3c012b(0x1c0)](_0x3c012b(0x16c)+_0x2251d3[_0x3c012b(0x1b0)]+_0x3c012b(0x12a),()=>_0x395e79[_0x3c012b(0x1c4)][_0x3c012b(0x107)](_0x49b752,_0x165758,_0x2251d3['existingActivation']['id'])),_0x131750['onProgress']?.({'type':_0x3c012b(0x1c2),'segmentName':_0x1715c0,'activationName':_0x2251d3[_0x3c012b(0x1b0)]}),_0x131750[_0x3c012b(0x15a)]?.('Deleted\x20activation\x20\x27'+_0x2251d3[_0x3c012b(0x1b0)]+'\x27'),_0x4e0fbc[_0x3c012b(0x139)]++);}}catch(_0xa6830e){const _0x2b1e12=isHttp400Error(_0xa6830e),_0x57c578=_0x2b1e12?ErrorCode[_0x3c012b(0x198)]:ErrorCode[_0x3c012b(0x169)],_0x159040=getErrorMessage(_0xa6830e);throw new SDKError(_0x57c578,_0x3c012b(0x1f6)+_0x2251d3[_0x3c012b(0x114)]+_0x3c012b(0x1e7)+_0x2251d3[_0x3c012b(0x1b0)]+_0x3c012b(0x1ac)+_0x3337a3+_0x3c012b(0x190)+_0x159040,_0xa6830e);}}return _0x4e0fbc;}export async function executePushFolders(_0x57f89b,_0x150ef1,_0x432a41,_0x463f5d,_0x4705a1){const _0x2443ae=a152_0x25b4a3,_0x3a0719=new Map(_0x432a41),_0x495a1f=sortFoldersByDepth(_0x150ef1);for(const _0x24107f of _0x495a1f){const _0x482da4=_0x24107f['split']('/'),_0x49b09a=_0x482da4[_0x482da4[_0x2443ae(0x1d0)]-0x1],_0x5c6aac=_0x482da4['slice'](0x0,-0x1)[_0x2443ae(0x138)]('/'),_0x133887=_0x3a0719[_0x2443ae(0x151)](_0x5c6aac);_0x4705a1[_0x2443ae(0x1aa)]?.({'type':'folder_creating','folder':_0x24107f});const _0x4b4bdf={'name':_0x49b09a,'parentFolderId':_0x133887},_0x54195c=await _0x4705a1[_0x2443ae(0x1c0)](_0x2443ae(0x193)+_0x24107f+_0x2443ae(0x12a),()=>_0x57f89b[_0x2443ae(0x1c4)][_0x2443ae(0x13d)](_0x463f5d['parentId'],_0x4b4bdf));_0x3a0719[_0x2443ae(0x168)](_0x24107f,_0x54195c[_0x2443ae(0x178)]['id']),_0x4705a1['onProgress']?.({'type':_0x2443ae(0x1f1),'folder':_0x24107f,'folderId':_0x54195c[_0x2443ae(0x178)]['id']}),_0x4705a1['logInfo']?.(_0x2443ae(0x15f)+_0x24107f+'\x27');}return _0x3a0719;}export async function executePushSegmentDeletions(_0x11de7d,_0x384cd3,_0x14172){const _0x5dc686=a152_0x25b4a3;if(_0x384cd3[_0x5dc686(0x1d0)]===0x0)return 0x0;const {batchAsync:_0x4eb526}=await import(_0x5dc686(0x111)),_0x43c125=0x5,_0x23a40c=await _0x4eb526(_0x384cd3,async _0x64648d=>{const _0x75184f=_0x5dc686;return _0x14172[_0x75184f(0x1aa)]?.({'type':_0x75184f(0x166),'name':_0x64648d[_0x75184f(0x1b0)]}),await _0x11de7d[_0x75184f(0x1c4)][_0x75184f(0x109)](_0x64648d['id']),_0x14172[_0x75184f(0x1aa)]?.({'type':_0x75184f(0x1fd),'name':_0x64648d[_0x75184f(0x1b0)]}),_0x14172[_0x75184f(0x15a)]?.(_0x75184f(0x14a)+_0x64648d[_0x75184f(0x1b0)]+'\x27'),0x1;},_0x43c125);return _0x23a40c[_0x5dc686(0x102)]((_0x3e453c,_0x478869)=>_0x3e453c+_0x478869,0x0);}export async function executePushJourneys(_0x8a7412,_0x102a17,_0x375072,_0x594d87,_0x4493ae){const _0x508822=a152_0x25b4a3,{journeyDefToRequest:_0x5273ab}=await import(_0x508822(0x14e)),{activationDefToCreateRequest:_0x468079,yamlRuleToApi:_0x79ee72,validateSegmentRule:_0x201f91}=await import(_0x508822(0x13b)),_0x214de9={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x56f928=new Map(_0x375072[_0x508822(0x14b)]),_0x5b7cbf=0x5;for(let _0x2c06a1=0x0;_0x2c06a1<_0x102a17['length'];_0x2c06a1+=_0x5b7cbf){const _0x4aa195=_0x102a17[_0x508822(0x197)](_0x2c06a1,_0x2c06a1+_0x5b7cbf),_0x14d143=await Promise['all'](_0x4aa195[_0x508822(0x1e1)](async _0x7cfc26=>{const _0xd3aa6b=_0x508822;if(!_0x7cfc26[_0xd3aa6b(0x185)]&&!_0x7cfc26['hasChanges'])return{'action':_0xd3aa6b(0x1cb),'name':_0x7cfc26['yamlConfig']['name'],'journeyId':_0x7cfc26['existingJourney']?.['id']};const _0x1c5ba3=_0x7cfc26[_0xd3aa6b(0x160)]?_0x375072[_0xd3aa6b(0x1a0)][_0xd3aa6b(0x151)](_0x7cfc26[_0xd3aa6b(0x160)]):undefined;_0x4493ae[_0xd3aa6b(0x1aa)]?.({'type':_0x7cfc26['isNew']?'journey_creating':_0xd3aa6b(0x15b),'name':_0x7cfc26['yamlConfig']['name']});try{const _0x3bbd14=await executeSingleJourneyPush(_0x8a7412,_0x7cfc26,{..._0x375072,'segmentNameToId':_0x56f928},{'parentId':_0x594d87[_0xd3aa6b(0x145)],'rootFolderId':_0x594d87[_0xd3aa6b(0x1b1)],'folderId':_0x1c5ba3,'verbose':_0x594d87['verbose']},_0x4493ae,{'journeyDefToRequest':_0x5273ab,'activationDefToCreateRequest':_0x468079,'yamlRuleToApi':_0x79ee72,'validateSegmentRule':_0x201f91});for(const [_0x2d6fb6,_0x4f5eb1]of _0x3bbd14['embeddedSegmentNameToId']){_0x56f928[_0xd3aa6b(0x168)](_0x2d6fb6,_0x4f5eb1),_0x214de9[_0xd3aa6b(0x170)][_0xd3aa6b(0x168)](_0x2d6fb6,_0x4f5eb1);}if(_0x3bbd14[_0xd3aa6b(0x1a7)]===_0xd3aa6b(0x167))_0x4493ae[_0xd3aa6b(0x1aa)]?.({'type':_0xd3aa6b(0x1d6),'name':_0x7cfc26[_0xd3aa6b(0x199)][_0xd3aa6b(0x1b0)],'journeyId':_0x3bbd14['journeyId']}),_0x4493ae[_0xd3aa6b(0x1e2)]?.('Created\x20journey\x20\x27'+_0x7cfc26['yamlConfig'][_0xd3aa6b(0x1b0)]+'\x27'),_0x214de9[_0xd3aa6b(0x167)]++;else _0x3bbd14['action']===_0xd3aa6b(0x1d4)&&(_0x4493ae[_0xd3aa6b(0x1aa)]?.({'type':_0xd3aa6b(0x1d7),'name':_0x7cfc26[_0xd3aa6b(0x199)][_0xd3aa6b(0x1b0)]}),_0x4493ae[_0xd3aa6b(0x1e2)]?.(_0xd3aa6b(0x15d)+_0x7cfc26[_0xd3aa6b(0x199)]['name']+'\x27'),_0x214de9[_0xd3aa6b(0x1d4)]++);return{'action':_0x3bbd14['action'],'name':_0x7cfc26['yamlConfig'][_0xd3aa6b(0x1b0)],'journeyId':_0x3bbd14[_0xd3aa6b(0x161)]};}catch(_0x3ed8f5){const _0x1814b6=isHttp400Error(_0x3ed8f5),_0xa545b=_0x1814b6?ErrorCode[_0xd3aa6b(0x16d)]:ErrorCode[_0xd3aa6b(0x13e)],_0x6777c7=getErrorMessage(_0x3ed8f5);throw new SDKError(_0xa545b,_0xd3aa6b(0x1f6)+(_0x7cfc26[_0xd3aa6b(0x185)]?_0xd3aa6b(0x146):_0xd3aa6b(0x181))+_0xd3aa6b(0x17f)+_0x7cfc26['absolutePath']+_0xd3aa6b(0x190)+_0x6777c7,_0x3ed8f5);}}));_0x214de9[_0x508822(0x154)][_0x508822(0x17d)](..._0x14d143);}return _0x214de9;}async function matchExistingJourneySegments(_0x22f461,_0x34c071,_0x44f985,_0x19481c,_0x42ad69){const _0x26ef74=a152_0x25b4a3;if(!_0x34c071[_0x26ef74(0x16f)]||!_0x34c071['yamlConfig'][_0x26ef74(0x1e4)])return;const _0x29ef8c=new Map(),_0x464682=new Set();for(const _0x2287b7 of Object['keys'](_0x34c071[_0x26ef74(0x199)][_0x26ef74(0x1e4)])){const _0x25cec7=generateDeterministicJourneySegmentName(_0x34c071[_0x26ef74(0x199)][_0x26ef74(0x1b0)],_0x2287b7);_0x29ef8c[_0x26ef74(0x168)](_0x25cec7,_0x2287b7),_0x464682[_0x26ef74(0x1c5)](_0x2287b7);}const _0x5a2cb2=[],_0xab44d5=collectSegmentIdsFromJourneyApi(_0x34c071[_0x26ef74(0x16f)]);for(const _0x3e03fd of _0xab44d5){const _0x88b976=await fetchSegment(_0x22f461,_0x44f985,_0x3e03fd,_0x19481c);if(!_0x88b976?.[_0x26ef74(0x1b0)])continue;const _0x531369=_0x29ef8c[_0x26ef74(0x151)](_0x88b976['name']);_0x531369?(_0x42ad69[_0x26ef74(0x168)](_0x531369,_0x3e03fd),_0x464682['delete'](_0x531369)):_0x5a2cb2[_0x26ef74(0x17d)]({'id':_0x3e03fd,'seg':_0x88b976});}if(_0x464682['size']>0x0&&_0x5a2cb2[_0x26ef74(0x1d0)]>0x0){const {localExpandedRuleToNames:_0x3e8070}=buildLocalExpandedRuleMappings(_0x34c071[_0x26ef74(0x199)]),_0xd5ad3b=new Map();for(const {id:_0x309217,seg:_0x10d973}of _0x5a2cb2){if(_0x10d973[_0x26ef74(0x162)]){const _0x1b81b2=apiRuleToYaml(_0x10d973[_0x26ef74(0x162)]);_0xd5ad3b[_0x26ef74(0x168)](_0x309217,_0x1b81b2);}}for(const {id:_0x4fd53e,seg:_0xa4285}of _0x5a2cb2){if(!_0xa4285[_0x26ef74(0x162)])continue;const _0x33c1e4=_0xd5ad3b[_0x26ef74(0x151)](_0x4fd53e);if(!_0x33c1e4)continue;const _0x1e29cd=serializeExpandedRule(_0x33c1e4,_0xd5ad3b),_0x3515e3=_0x3e8070['get'](_0x1e29cd);if(_0x3515e3){const _0x28e6b8=_0x3515e3[_0x26ef74(0x1f2)](_0x61d7c6=>_0x464682[_0x26ef74(0x12f)](_0x61d7c6));_0x28e6b8&&(_0x42ad69[_0x26ef74(0x168)](_0x28e6b8,_0x4fd53e),_0x464682[_0x26ef74(0x12d)](_0x28e6b8),logger[_0x26ef74(0x1cc)](_0x26ef74(0x15e)+_0xa4285[_0x26ef74(0x1b0)]+_0x26ef74(0x126)+_0x28e6b8+_0x26ef74(0x1c7)));}}}}async function executeSingleJourneyPush(_0x2e54dd,_0x2d1040,_0x1ddf13,_0x231e3d,_0x2daaf3,_0x380f7e){const _0x1951b2=a152_0x25b4a3,{journeyDefToRequest:_0x1aa36d,activationDefToCreateRequest:_0x22549b,yamlRuleToApi:_0x34dbde,validateSegmentRule:_0x3c9b86}=_0x380f7e,_0x11c96e=new Map(),_0x2b386c=new Map();recoverSegmentIdsFromPushRecovery(_0x2d1040,_0x11c96e,_0x1ddf13['segmentNameToId']);const _0x2a879b=new Map(),_0x25e77d=new Map(),_0x23d12c=new Map();let _0x29e602;const _0x22aa48=async()=>{const _0x1ce5db=a152_0x3f4b;if(_0x29e602)return;_0x29e602=new Map();if(!_0x2d1040['existingJourney'])return;const _0x2fe54c=await _0x2e54dd[_0x1ce5db(0x174)][_0x1ce5db(0x171)](_0x2d1040[_0x1ce5db(0x16f)]['id']);for(const _0xc5c18e of _0x2fe54c){const _0x2a15b2=journeyActivationStepToYaml(_0xc5c18e,_0x1ddf13[_0x1ce5db(0x1b6)],_0x1ddf13[_0x1ce5db(0x186)]),_0xdcf943=activationSignature(_0x2a15b2);!_0x29e602[_0x1ce5db(0x12f)](_0xdcf943)&&_0x29e602['set'](_0xdcf943,_0xc5c18e['id']),_0x2a15b2[_0x1ce5db(0x1b0)]&&_0x2b386c[_0x1ce5db(0x168)](_0x2a15b2['name'],_0xc5c18e['id']);}};await matchExistingJourneySegments(_0x2e54dd,_0x2d1040,_0x231e3d['parentId'],_0x1ddf13[_0x1951b2(0x200)],_0x1ddf13[_0x1951b2(0x14b)]);const _0x1139f3={'resolveSegmentId':async _0x1937c6=>{const _0x1be4e2=_0x1951b2,_0x75e896=_0x1ddf13[_0x1be4e2(0x14b)]['get'](_0x1937c6);if(!_0x75e896)throw new SDKError(ErrorCode[_0x1be4e2(0x117)],_0x1be4e2(0x1ee)+_0x1937c6+_0x1be4e2(0x1ec)+_0x2d1040['yamlConfig']['name']+')');return _0x75e896;},'resolveEmbeddedSegmentId':async(_0x1d618a,_0xc9ee75)=>{const _0x53c9cb=_0x1951b2,_0x4e5a96=_0x1ddf13[_0x53c9cb(0x14b)][_0x53c9cb(0x151)](_0x1d618a);if(_0x4e5a96)return _0x4e5a96;const _0x5472e1=_0x1ddf13[_0x53c9cb(0x200)][_0x53c9cb(0x1f2)](_0x352fb1=>_0x352fb1[_0x53c9cb(0x1b0)]===_0x1d618a);if(_0x5472e1)return _0x1ddf13['segmentNameToId'][_0x53c9cb(0x168)](_0x1d618a,_0x5472e1['id']),_0x5472e1['id'];if(_0x2d1040[_0x53c9cb(0x185)]){const {stageName:_0x440e06,criteriaName:_0xe53756}=findSegmentCriteriaLocation(_0x2d1040[_0x53c9cb(0x199)],_0x1d618a);return _0x3c9b86(_0x1d618a,_0xc9ee75[_0x53c9cb(0x162)]),_0x25e77d[_0x53c9cb(0x168)](_0x1d618a,{'definition':_0xc9ee75,'stageName':_0x440e06,'criteriaName':_0xe53756}),createPendingSegmentId(_0x1d618a);}const _0x4d2ac7=_0x2d1040[_0x53c9cb(0x16f)]?.['id'];if(!_0x4d2ac7)throw new SDKError(ErrorCode['INTERNAL'],_0x53c9cb(0x11a));const _0x25f007=_0x2a879b[_0x53c9cb(0x151)](_0x1d618a);if(_0x25f007)return _0x25f007;const _0x3b5a27=((async()=>{const _0x1f85b6=_0x53c9cb;_0x3c9b86(_0x1d618a,_0xc9ee75['rule']);const _0x3c6d56=generateDeterministicJourneySegmentName(_0x2d1040['yamlConfig']['name'],_0x1d618a),_0x4e20a3=_0x1ddf13[_0x1f85b6(0x200)][_0x1f85b6(0x1f2)](_0x43a3a9=>_0x43a3a9[_0x1f85b6(0x1b0)]===_0x3c6d56),_0x2e0d50=createSegmentIdResolver(_0x1ddf13[_0x1f85b6(0x14b)],_0x1d618a),_0x10e695=await resolveRuleSegmentIds(_0xc9ee75[_0x1f85b6(0x162)],_0x2e0d50);let _0x25d0e8;return _0x4e20a3?(await _0x2e54dd[_0x1f85b6(0x1c4)][_0x1f85b6(0x1ef)](_0x231e3d[_0x1f85b6(0x145)],_0x4e20a3['id'],{'description':_0xc9ee75[_0x1f85b6(0x1b9)]||'Entry\x20criteria:\x20'+_0x1d618a,'rule':_0x34dbde(_0x10e695),'countPopulation':!![]}),_0x25d0e8=_0x4e20a3['id'],saveSegmentToPushRecovery(_0x2d1040[_0x1f85b6(0x15c)],_0x2d1040[_0x1f85b6(0x199)]['name'],_0x1d618a,{'segmentId':_0x25d0e8,'uniqueServerName':_0x3c6d56,'createdAt':new Date()[_0x1f85b6(0x173)]()})):_0x25d0e8=await createOrRecoverEmbeddedSegment(_0x2e54dd,_0x2d1040,{'localName':_0x1d618a,'uniqueSegmentName':_0x3c6d56,'description':_0xc9ee75[_0x1f85b6(0x1b9)]||_0x1f85b6(0x13a)+_0x1d618a,'journeyId':_0x4d2ac7,'resolvedRule':_0x10e695,'parentId':_0x231e3d['parentId'],'folderId':_0x231e3d[_0x1f85b6(0x1b1)]||''},_0x34dbde),_0x1ddf13[_0x1f85b6(0x14b)][_0x1f85b6(0x168)](_0x1d618a,_0x25d0e8),_0x11c96e['set'](_0x1d618a,_0x25d0e8),_0x25d0e8;})());_0x2a879b[_0x53c9cb(0x168)](_0x1d618a,_0x3b5a27);try{return await _0x3b5a27;}finally{_0x2a879b[_0x53c9cb(0x12d)](_0x1d618a);}},'resolveActivationId':async _0x4b27a6=>{const _0x279bb1=_0x1951b2,_0x5f491e=_0x2b386c[_0x279bb1(0x151)](_0x4b27a6);if(_0x5f491e)return _0x5f491e;if(_0x2d1040['existingJourney']){await _0x22aa48();const _0x10e727=_0x2b386c[_0x279bb1(0x151)](_0x4b27a6);if(_0x10e727)return _0x10e727;}throw new SDKError(ErrorCode[_0x279bb1(0x1ba)],_0x279bb1(0x177)+_0x4b27a6+_0x279bb1(0x1ec)+_0x2d1040[_0x279bb1(0x199)][_0x279bb1(0x1b0)]+_0x279bb1(0x19e)+_0x279bb1(0x134));},'resolveEmbeddedActivationId':async(_0x428735,_0x10c073)=>{const _0x3589ce=_0x1951b2,_0x366c78=_0x2b386c[_0x3589ce(0x151)](_0x428735);if(_0x366c78)return _0x366c78;if(_0x2d1040['isNew'])return _0x23d12c[_0x3589ce(0x168)](_0x428735,_0x10c073),createPendingActivationId(_0x428735);if(_0x2d1040['existingJourney']){await _0x22aa48();const _0x562135=_0x2b386c[_0x3589ce(0x151)](_0x10c073['name']);if(_0x562135)return _0x2b386c[_0x3589ce(0x168)](_0x428735,_0x562135),_0x562135;const _0x789906=activationSignature(_0x10c073),_0x39a590=_0x29e602?.[_0x3589ce(0x151)](_0x789906);if(_0x39a590)return _0x2b386c[_0x3589ce(0x168)](_0x428735,_0x39a590),_0x39a590;const _0x485fae=await _0x22549b(_0x10c073,_0x1ddf13[_0x3589ce(0x1dd)]),_0x16b9a3={..._0x485fae,..._0x10c073['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x10c073['run_after_journey_refresh']}},_0x3b70c8=await _0x2e54dd[_0x3589ce(0x174)][_0x3589ce(0x189)](_0x2d1040[_0x3589ce(0x16f)]['id'],_0x16b9a3);return _0x2b386c[_0x3589ce(0x168)](_0x428735,_0x3b70c8['id']),_0x3b70c8['id'];}throw new SDKError(ErrorCode[_0x3589ce(0x159)],_0x3589ce(0x1bd));},'resolveJourneyId':async _0x57c502=>{const _0x549945=_0x1951b2;try{return await _0x2e54dd[_0x549945(0x174)][_0x549945(0x194)](_0x231e3d['parentId'],_0x57c502);}catch(_0x4bcebe){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x57c502+_0x549945(0x1ae)+_0x2d1040[_0x549945(0x199)]['name']+'\x27)',_0x4bcebe);}},'resolveStageId':async(_0x4078cc,_0x5f23a6)=>{const _0x5189d7=_0x1951b2,_0x30083a=await _0x2e54dd[_0x5189d7(0x174)][_0x5189d7(0x1e3)](_0x4078cc),_0x2a7266=_0x30083a[_0x5189d7(0x11b)][_0x5189d7(0x137)]['find'](_0x799f7f=>_0x799f7f['name'][_0x5189d7(0x196)]()===_0x5f23a6[_0x5189d7(0x196)]());if(!_0x2a7266?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x5f23a6+_0x5189d7(0x17a)+(_0x30083a[_0x5189d7(0x11b)][_0x5189d7(0x19b)]||_0x30083a[_0x5189d7(0x11b)]['name'])+'\x27');return _0x2a7266['id'];}},_0x34e933=await _0x1aa36d(_0x2d1040[_0x1951b2(0x199)],_0x231e3d[_0x1951b2(0x145)],_0x1139f3),_0x467c20=_0x231e3d[_0x1951b2(0x164)]||_0x231e3d[_0x1951b2(0x1b1)];_0x467c20&&(_0x34e933[_0x1951b2(0x17b)]={'parentFolder':{'data':{'id':_0x467c20,'type':_0x1951b2(0x192)}}});if(_0x2d1040[_0x1951b2(0x185)]){if(_0x25e77d['size']>0x0||_0x23d12c[_0x1951b2(0x1c8)]>0x0)return await executeThreeStepJourneyCreate(_0x2e54dd,_0x2d1040,_0x34e933,{'pendingEmbeddedSegments':_0x25e77d,'pendingEmbeddedActivations':_0x23d12c,'embeddedSegmentNameToId':_0x11c96e,'journeyActivationNameToId':_0x2b386c},{..._0x231e3d,'effectiveFolderId':_0x467c20},_0x1ddf13,_0x2daaf3,_0x380f7e);else{ensureJourneyDefaults(_0x34e933[_0x1951b2(0x11b)]);const _0x1603fa=await _0x2e54dd[_0x1951b2(0x174)][_0x1951b2(0x146)](_0x34e933);return deletePushRecovery(_0x2d1040[_0x1951b2(0x15c)]),{'action':_0x1951b2(0x167),'journeyId':_0x1603fa['id'],'embeddedSegmentNameToId':_0x11c96e};}}else{if(_0x2d1040[_0x1951b2(0x1f9)]&&_0x2d1040[_0x1951b2(0x16f)]){_0x34e933['id']=_0x2d1040[_0x1951b2(0x16f)]['id'];const _0x4c5e54=_0x34e933[_0x1951b2(0x11b)];_0x2d1040[_0x1951b2(0x16f)][_0x1951b2(0x11b)]?.[_0x1951b2(0x19b)]&&(_0x4c5e54[_0x1951b2(0x19b)]=_0x2d1040['existingJourney'][_0x1951b2(0x11b)][_0x1951b2(0x19b)]);const _0x3c090c=_0x2d1040[_0x1951b2(0x16f)][_0x1951b2(0x11b)]?.['journeyStages'];return _0x3c090c&&_0x34e933[_0x1951b2(0x11b)][_0x1951b2(0x137)]&&injectExistingStageIds(_0x34e933['attributes'][_0x1951b2(0x137)],_0x3c090c),ensureJourneyDefaults(_0x4c5e54),await _0x2e54dd[_0x1951b2(0x174)]['update'](_0x2d1040[_0x1951b2(0x16f)]['id'],_0x34e933),deletePushRecovery(_0x2d1040[_0x1951b2(0x15c)]),{'action':'updated','journeyId':_0x2d1040[_0x1951b2(0x16f)]['id'],'embeddedSegmentNameToId':_0x11c96e};}}return deletePushRecovery(_0x2d1040[_0x1951b2(0x15c)]),{'action':_0x1951b2(0x1cb),'journeyId':_0x2d1040[_0x1951b2(0x16f)]?.['id'],'embeddedSegmentNameToId':_0x11c96e};}function findSegmentCriteriaLocation(_0x2549ac,_0x18bb8f){const _0x387ebe=a152_0x25b4a3,_0x3e5278=_0x2549ac[_0x387ebe(0x152)]||_0x2549ac[_0x387ebe(0x147)]?.[0x0]?.[_0x387ebe(0x152)]||[];let _0x3dac91=_0x387ebe(0x1f5),_0x1d51d2=_0x18bb8f;const _0x4c3125=_0x2549ac[_0x387ebe(0x122)]||_0x2549ac['journeys']?.[0x0]?.[_0x387ebe(0x122)];if(_0x4c3125?.['segment']===_0x18bb8f)return{'stageName':_0x387ebe(0x122),'criteriaName':_0x4c3125[_0x387ebe(0x1b0)]||_0x18bb8f};_0x153a32:for(const _0x310309 of _0x3e5278){if(_0x310309['entry_criteria']?.[_0x387ebe(0x1c4)]===_0x18bb8f){_0x3dac91=_0x310309['name'],_0x1d51d2=_0x310309['entry_criteria'][_0x387ebe(0x1b0)]||_0x18bb8f;break;}if(_0x310309[_0x387ebe(0x1d8)])for(const _0x5c3204 of _0x310309[_0x387ebe(0x1d8)]){if(_0x5c3204[_0x387ebe(0x114)]===_0x387ebe(0x1de)&&_0x5c3204[_0x387ebe(0x1a5)]?.[_0x387ebe(0x1b5)])for(const _0x174ea0 of _0x5c3204[_0x387ebe(0x1a5)]['branches']){if(_0x174ea0[_0x387ebe(0x1c4)]===_0x18bb8f){_0x3dac91=_0x310309[_0x387ebe(0x1b0)],_0x1d51d2=_0x174ea0['name']||_0x18bb8f;break _0x153a32;}}}}return{'stageName':_0x3dac91,'criteriaName':_0x1d51d2};}async function executeThreeStepJourneyCreate(_0x1b4084,_0x59e436,_0x697ce8,_0x345754,_0xce91c8,_0x2c3657,_0x2771ed,_0x1605f4){const _0x3f6be2=a152_0x25b4a3,{activationDefToCreateRequest:_0x311097,yamlRuleToApi:_0x8396f0}=_0x1605f4,{pendingEmbeddedSegments:_0xaccfa2,pendingEmbeddedActivations:_0x31f53f,embeddedSegmentNameToId:_0x1ac95f}=_0x345754,_0x8f56f1=JSON[_0x3f6be2(0x1a6)](JSON['stringify'](_0x697ce8));ensureJourneyDefaults(_0x8f56f1['attributes']),stripPendingIds(_0x8f56f1);const _0x45be82=await _0x1b4084[_0x3f6be2(0x174)][_0x3f6be2(0x146)](_0x8f56f1),_0x3c4af5=_0x45be82['id'],_0x53342a=new Map();for(const _0xc0d8f4 of _0x45be82[_0x3f6be2(0x11b)][_0x3f6be2(0x137)]){_0x53342a[_0x3f6be2(0x168)](_0xc0d8f4[_0x3f6be2(0x1b0)][_0x3f6be2(0x196)](),_0xc0d8f4['id']);}recoverSegmentIdsFromPushRecovery(_0x59e436,_0x1ac95f,_0x2c3657[_0x3f6be2(0x14b)]);for(const [_0x3d0184,{definition:_0x4ff48a}]of _0xaccfa2){if(_0x1ac95f[_0x3f6be2(0x12f)](_0x3d0184)){_0x2771ed['onProgress']?.({'type':_0x3f6be2(0x16a),'journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'segmentName':_0x3d0184});continue;}const _0x102df0=generateDeterministicJourneySegmentName(_0x59e436['yamlConfig']['name'],_0x3d0184);_0x2771ed[_0x3f6be2(0x1aa)]?.({'type':'embedded_segment_creating','journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'segmentName':_0x3d0184});const _0x30a41b=createSegmentIdResolver(_0x2c3657[_0x3f6be2(0x14b)],_0x3d0184),_0x1a0380=await resolveRuleSegmentIds(_0x4ff48a[_0x3f6be2(0x162)],_0x30a41b),_0x3cf726=await createOrRecoverEmbeddedSegment(_0x1b4084,_0x59e436,{'localName':_0x3d0184,'uniqueSegmentName':_0x102df0,'description':_0x4ff48a[_0x3f6be2(0x1b9)]||_0x3f6be2(0x13a)+_0x3d0184,'journeyId':_0x3c4af5,'resolvedRule':_0x1a0380,'parentId':_0xce91c8[_0x3f6be2(0x145)],'folderId':_0xce91c8['effectiveFolderId']||''},_0x8396f0);_0x1ac95f[_0x3f6be2(0x168)](_0x3d0184,_0x3cf726),_0x2c3657[_0x3f6be2(0x14b)][_0x3f6be2(0x168)](_0x3d0184,_0x3cf726),_0x2771ed[_0x3f6be2(0x1aa)]?.({'type':_0x3f6be2(0x16a),'journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'segmentName':_0x3d0184});}const _0x55e37c=new Map();for(const [_0x3cc059,_0x5831cd]of _0x31f53f){_0x2771ed['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x59e436[_0x3f6be2(0x199)][_0x3f6be2(0x1b0)],'activationName':_0x3cc059});const _0xf02cb5=await _0x311097(_0x5831cd,_0x2c3657[_0x3f6be2(0x1dd)]),_0x51dd9c={..._0xf02cb5,..._0x5831cd[_0x3f6be2(0x176)]!==undefined&&{'runAfterJourneyRefresh':_0x5831cd[_0x3f6be2(0x176)]}},_0x12ea42=await _0x1b4084['journey'][_0x3f6be2(0x189)](_0x3c4af5,_0x51dd9c);_0x55e37c[_0x3f6be2(0x168)](_0x3cc059,_0x12ea42['id']),_0x345754[_0x3f6be2(0x12e)][_0x3f6be2(0x168)](_0x3cc059,_0x12ea42['id']),_0x2771ed[_0x3f6be2(0x1aa)]?.({'type':_0x3f6be2(0x129),'journeyName':_0x59e436['yamlConfig'][_0x3f6be2(0x1b0)],'activationName':_0x3cc059});}const _0x17827f=JSON[_0x3f6be2(0x1a6)](JSON[_0x3f6be2(0x18c)](_0x697ce8));return _0x17827f['id']=_0x3c4af5,ensureJourneyDefaults(_0x17827f[_0x3f6be2(0x11b)]),resolvePendingIdsInRequest(_0x17827f,_0x697ce8,_0x53342a,_0x1ac95f,_0x55e37c,_0x2771ed),await _0x1b4084[_0x3f6be2(0x174)]['update'](_0x3c4af5,_0x17827f),deletePushRecovery(_0x59e436[_0x3f6be2(0x15c)]),{'action':'created','journeyId':_0x3c4af5,'embeddedSegmentNameToId':_0x1ac95f};}export function stripWaitStepPendingIds(_0xd1c05b){const _0x33b79e=a152_0x25b4a3,_0x11e38e=_0xd1c05b[_0x33b79e(0x143)]&&isPendingSegmentId(_0xd1c05b[_0x33b79e(0x143)]),_0x37b077=_0xd1c05b[_0x33b79e(0x112)]?.[_0x33b79e(0x1ab)](_0x4fba87=>_0x4fba87[_0x33b79e(0x153)]&&isPendingSegmentId(_0x4fba87[_0x33b79e(0x153)]));(_0x11e38e||_0x37b077)&&(_0xd1c05b['waitStepType']=_0x33b79e(0x120),_0xd1c05b[_0x33b79e(0x175)]=0x1,_0xd1c05b[_0x33b79e(0x1eb)]=_0x33b79e(0x16b),delete _0xd1c05b['conditionSegmentId'],delete _0xd1c05b[_0x33b79e(0x19d)],delete _0xd1c05b[_0x33b79e(0x1fe)],delete _0xd1c05b[_0x33b79e(0x112)]);}export function resolveWaitStepPendingIds(_0x3c0bb9,_0x4dc0f7,_0x308ccd,_0x2243d5){const _0x5e4cc5=a152_0x25b4a3;if(_0x4dc0f7[_0x5e4cc5(0x143)]&&isPendingSegmentId(_0x4dc0f7[_0x5e4cc5(0x143)])){const _0x3e9fca=_0x308ccd(_0x4dc0f7[_0x5e4cc5(0x143)],_0x5e4cc5(0x101)+_0x2243d5+'\x27\x20wait\x20condition');_0x3e9fca&&(_0x3c0bb9[_0x5e4cc5(0x110)]=_0x5e4cc5(0x127),_0x3c0bb9[_0x5e4cc5(0x143)]=_0x3e9fca,delete _0x3c0bb9['waitStep'],delete _0x3c0bb9[_0x5e4cc5(0x1eb)],_0x4dc0f7[_0x5e4cc5(0x19d)]!==undefined&&(_0x3c0bb9['conditionTimeoutDuration']=_0x4dc0f7[_0x5e4cc5(0x19d)]),_0x4dc0f7[_0x5e4cc5(0x1fe)]&&(_0x3c0bb9[_0x5e4cc5(0x1fe)]=_0x4dc0f7[_0x5e4cc5(0x1fe)]));}if(_0x4dc0f7[_0x5e4cc5(0x112)]){const _0x3acf4e=_0x4dc0f7[_0x5e4cc5(0x112)][_0x5e4cc5(0x1ab)](_0x4de8b7=>_0x4de8b7['segmentId']&&isPendingSegmentId(_0x4de8b7[_0x5e4cc5(0x153)]));if(_0x3acf4e){const _0xc287d6=_0x4dc0f7['conditions'][_0x5e4cc5(0x1e1)](_0x35ec12=>{const _0xd7f0b6=_0x5e4cc5;if(_0x35ec12[_0xd7f0b6(0x153)]&&isPendingSegmentId(_0x35ec12[_0xd7f0b6(0x153)])){const _0x27d320=_0x308ccd(_0x35ec12[_0xd7f0b6(0x153)],'stage\x20\x27'+_0x2243d5+'\x27\x20wait\x20condition');return{..._0x35ec12,'segmentId':_0x27d320||_0x35ec12['segmentId']};}return{..._0x35ec12};});_0x3c0bb9[_0x5e4cc5(0x110)]=_0x5e4cc5(0x127),_0x3c0bb9[_0x5e4cc5(0x112)]=_0xc287d6,delete _0x3c0bb9[_0x5e4cc5(0x175)],delete _0x3c0bb9['waitStepUnit'],delete _0x3c0bb9[_0x5e4cc5(0x143)],delete _0x3c0bb9['conditionTimeoutDuration'],delete _0x3c0bb9[_0x5e4cc5(0x1fe)];}}}function stripPendingIds(_0x5bc852){const _0x53d822=a152_0x25b4a3;_0x5bc852[_0x53d822(0x11b)][_0x53d822(0x122)]?.['segmentId']&&isPendingSegmentId(_0x5bc852['attributes'][_0x53d822(0x122)][_0x53d822(0x153)])&&delete _0x5bc852[_0x53d822(0x11b)][_0x53d822(0x122)];for(const _0xf436d4 of _0x5bc852[_0x53d822(0x11b)]['journeyStages']||[]){_0xf436d4[_0x53d822(0x10e)]?.['segmentId']&&isPendingSegmentId(_0xf436d4[_0x53d822(0x10e)]['segmentId'])&&delete _0xf436d4[_0x53d822(0x10e)];_0xf436d4[_0x53d822(0x1cf)]?.[_0x53d822(0x153)]&&isPendingSegmentId(_0xf436d4[_0x53d822(0x1cf)][_0x53d822(0x153)])&&delete _0xf436d4[_0x53d822(0x1cf)];_0xf436d4[_0x53d822(0x115)]&&(_0xf436d4[_0x53d822(0x115)]=_0xf436d4[_0x53d822(0x115)][_0x53d822(0x103)](_0x10547c=>!_0x10547c[_0x53d822(0x153)]||!isPendingSegmentId(_0x10547c['segmentId'])));if(_0xf436d4[_0x53d822(0x1d8)])for(const _0x30940d of Object['keys'](_0xf436d4['steps'])){const _0x539127=_0xf436d4['steps'][_0x30940d];_0x539127['type']===_0x53d822(0x191)&&_0x539127[_0x53d822(0x201)]&&isPendingActivationId(_0x539127[_0x53d822(0x201)])&&(_0x539127[_0x53d822(0x201)]='');if(_0x539127[_0x53d822(0x114)]==='DecisionPoint'&&_0x539127[_0x53d822(0x1b5)])for(const _0x5bd0f2 of _0x539127['branches']){_0x5bd0f2[_0x53d822(0x153)]&&isPendingSegmentId(_0x5bd0f2[_0x53d822(0x153)])&&(_0x5bd0f2[_0x53d822(0x153)]='');}_0x539127['type']==='WaitStep'&&stripWaitStepPendingIds(_0x539127);}}}function resolvePendingIdsInRequest(_0x41ce9c,_0x2a8d15,_0x2fbbc7,_0x77f9a6,_0x4432f3,_0x4a4735){const _0x3bd6c4=a152_0x25b4a3,_0x9fc26c=(_0x3d1cc8,_0x4a451d)=>{const _0x38d0d5=a152_0x3f4b;if(!isPendingSegmentId(_0x3d1cc8))return _0x3d1cc8;const _0x2d3eb6=extractPendingSegmentName(_0x3d1cc8),_0xc5db49=_0x77f9a6[_0x38d0d5(0x151)](_0x2d3eb6);return!_0xc5db49&&_0x4a4735[_0x38d0d5(0x10d)]?.(_0x38d0d5(0x195)+_0x2d3eb6+_0x38d0d5(0x1fb)+_0x4a451d),_0xc5db49;};if(_0x41ce9c[_0x3bd6c4(0x11b)][_0x3bd6c4(0x122)]?.[_0x3bd6c4(0x153)]&&isPendingSegmentId(_0x41ce9c[_0x3bd6c4(0x11b)][_0x3bd6c4(0x122)][_0x3bd6c4(0x153)])){const _0x26f5da=_0x9fc26c(_0x41ce9c['attributes'][_0x3bd6c4(0x122)][_0x3bd6c4(0x153)],_0x3bd6c4(0x16e));_0x26f5da&&(_0x41ce9c['attributes'][_0x3bd6c4(0x122)][_0x3bd6c4(0x153)]=_0x26f5da);}for(const _0x2d6f18 of _0x41ce9c[_0x3bd6c4(0x11b)][_0x3bd6c4(0x137)]||[]){const _0x5e558e=_0x2fbbc7[_0x3bd6c4(0x151)](_0x2d6f18[_0x3bd6c4(0x1b0)][_0x3bd6c4(0x196)]());_0x5e558e&&(_0x2d6f18['id']=_0x5e558e);if(_0x2d6f18[_0x3bd6c4(0x10e)]?.['segmentId']&&isPendingSegmentId(_0x2d6f18[_0x3bd6c4(0x10e)][_0x3bd6c4(0x153)])){const _0x439656=_0x9fc26c(_0x2d6f18[_0x3bd6c4(0x10e)][_0x3bd6c4(0x153)],_0x3bd6c4(0x101)+_0x2d6f18['name']+_0x3bd6c4(0xff));_0x439656&&(_0x2d6f18[_0x3bd6c4(0x10e)][_0x3bd6c4(0x153)]=_0x439656);}if(_0x2d6f18[_0x3bd6c4(0x115)])for(const _0x19c1f3 of _0x2d6f18['exitCriterias']){if(_0x19c1f3[_0x3bd6c4(0x153)]&&isPendingSegmentId(_0x19c1f3[_0x3bd6c4(0x153)])){const _0x331d7d=_0x9fc26c(_0x19c1f3[_0x3bd6c4(0x153)],'stage\x20\x27'+_0x2d6f18[_0x3bd6c4(0x1b0)]+_0x3bd6c4(0x119));_0x331d7d&&(_0x19c1f3[_0x3bd6c4(0x153)]=_0x331d7d);}}if(_0x2d6f18[_0x3bd6c4(0x1cf)]?.[_0x3bd6c4(0x153)]&&isPendingSegmentId(_0x2d6f18['milestone'][_0x3bd6c4(0x153)])){const _0x238160=_0x9fc26c(_0x2d6f18['milestone'][_0x3bd6c4(0x153)],_0x3bd6c4(0x101)+_0x2d6f18['name']+'\x27\x20milestone');_0x238160&&(_0x2d6f18[_0x3bd6c4(0x1cf)]['segmentId']=_0x238160);}if(_0x2d6f18[_0x3bd6c4(0x1d8)]){const _0x17ab4d=_0x480bee=>_0x2a8d15[_0x3bd6c4(0x11b)]['journeyStages']?.[_0x3bd6c4(0x1f2)](_0x355802=>_0x355802[_0x3bd6c4(0x1b0)][_0x3bd6c4(0x196)]()===_0x2d6f18[_0x3bd6c4(0x1b0)][_0x3bd6c4(0x196)]())?.[_0x3bd6c4(0x1d8)]?.[_0x480bee];for(const _0x5a0771 of Object['keys'](_0x2d6f18[_0x3bd6c4(0x1d8)])){const _0x1641de=_0x2d6f18[_0x3bd6c4(0x1d8)][_0x5a0771],_0x59dec6=_0x17ab4d(_0x5a0771);if(_0x1641de[_0x3bd6c4(0x114)]===_0x3bd6c4(0x191)&&_0x1641de[_0x3bd6c4(0x201)]&&(isPendingActivationId(_0x1641de[_0x3bd6c4(0x201)])||_0x1641de[_0x3bd6c4(0x201)]==='')){if(_0x59dec6?.[_0x3bd6c4(0x201)]&&isPendingActivationId(_0x59dec6[_0x3bd6c4(0x201)])){const _0x7ddf67=extractPendingActivationName(_0x59dec6[_0x3bd6c4(0x201)]),_0x7c538e=_0x4432f3[_0x3bd6c4(0x151)](_0x7ddf67);_0x7c538e&&(_0x1641de[_0x3bd6c4(0x201)]=_0x7c538e);}}if(_0x1641de['type']===_0x3bd6c4(0x19f)&&_0x1641de[_0x3bd6c4(0x1b5)]&&_0x59dec6?.['branches'])for(let _0x4518b3=0x0;_0x4518b3<_0x1641de[_0x3bd6c4(0x1b5)]['length'];_0x4518b3++){const _0x344851=_0x1641de[_0x3bd6c4(0x1b5)][_0x4518b3],_0x100e85=_0x59dec6['branches'][_0x4518b3];if(_0x100e85?.['segmentId']&&isPendingSegmentId(_0x100e85['segmentId'])){const _0x10d266=_0x9fc26c(_0x100e85[_0x3bd6c4(0x153)],_0x3bd6c4(0x101)+_0x2d6f18['name']+_0x3bd6c4(0x182)+(_0x344851[_0x3bd6c4(0x1b0)]||_0x4518b3)+'\x27');_0x10d266&&(_0x344851[_0x3bd6c4(0x153)]=_0x10d266);}}_0x1641de[_0x3bd6c4(0x114)]===_0x3bd6c4(0x136)&&_0x59dec6?.[_0x3bd6c4(0x114)]===_0x3bd6c4(0x136)&&resolveWaitStepPendingIds(_0x1641de,_0x59dec6,_0x9fc26c,_0x2d6f18[_0x3bd6c4(0x1b0)]);}}}}
|
|
1
|
+
const a152_0xd184d4=a152_0x2210;(function(_0x2b5654,_0x577280){const _0x2069ad=a152_0x2210,_0x4b0adb=_0x2b5654();while(!![]){try{const _0x75bedb=-parseInt(_0x2069ad(0x104))/0x1+-parseInt(_0x2069ad(0x11f))/0x2+-parseInt(_0x2069ad(0x1d6))/0x3*(parseInt(_0x2069ad(0x150))/0x4)+-parseInt(_0x2069ad(0x193))/0x5+-parseInt(_0x2069ad(0x1ae))/0x6*(-parseInt(_0x2069ad(0x1d7))/0x7)+parseInt(_0x2069ad(0x11b))/0x8+parseInt(_0x2069ad(0x1b7))/0x9;if(_0x75bedb===_0x577280)break;else _0x4b0adb['push'](_0x4b0adb['shift']());}catch(_0x1ef6c7){_0x4b0adb['push'](_0x4b0adb['shift']());}}}(a152_0x3907,0x9984c));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-workflow');export const PENDING_SEGMENT_PREFIX=a152_0xd184d4(0x126);export const PENDING_ACTIVATION_PREFIX=a152_0xd184d4(0x1d9);export function createPendingSegmentId(_0x272b50){return''+PENDING_SEGMENT_PREFIX+_0x272b50+'__';}export function isPendingSegmentId(_0x340cef){const _0x5bb866=a152_0xd184d4;return _0x340cef['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x340cef[_0x5bb866(0x12a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0xa34d91){const _0x5453ea=a152_0xd184d4;return _0xa34d91[_0x5453ea(0x1c2)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x2efe9a){return''+PENDING_ACTIVATION_PREFIX+_0x2efe9a+'__';}export function isPendingActivationId(_0x48ade3){const _0x4be14e=a152_0xd184d4;return _0x48ade3[_0x4be14e(0x12a)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x5627b0){const _0x4b83b1=a152_0xd184d4;return _0x5627b0[_0x4b83b1(0x1c2)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x181c69,_0x14663e){const _0x11cfc3=a152_0xd184d4,_0x27179f=_0x181c69+'::'+(_0x14663e[_0x11cfc3(0x154)]()||_0x11cfc3(0x109)),_0xcae514=createHash(_0x11cfc3(0x135))['update'](_0x27179f)[_0x11cfc3(0x11e)](_0x11cfc3(0x1ed))[_0x11cfc3(0x175)](0x0,0xc);return'journey_entry_criteria_'+_0xcae514;}export function ensureJourneyDefaults(_0x4ea397){const _0xb42c35=a152_0xd184d4;!_0x4ea397['description']&&(_0x4ea397[_0xb42c35(0x168)]=''),!_0x4ea397[_0xb42c35(0x139)]&&(_0x4ea397[_0xb42c35(0x139)]=_0xb42c35(0x10c));}export function injectExistingStageIds(_0xbe44bc,_0x2a32fe){const _0x332185=a152_0xd184d4,_0x491cfc=new Map(_0x2a32fe[_0x332185(0x1b6)](_0xc5c1a5=>[_0xc5c1a5['name'],_0xc5c1a5['id']]));for(const _0x32fee9 of _0xbe44bc){if(!_0x32fee9['id']){const _0x3edba1=_0x491cfc[_0x332185(0x181)](_0x32fee9['name']);_0x3edba1&&(_0x32fee9['id']=_0x3edba1);}}}export function resolveTDFolderPath(_0x286ae0,_0x297e59,_0x1da58e){const _0x980e1d=a152_0xd184d4;if(!_0x297e59)return _0x286ae0;if(_0x286ae0===_0x1da58e||_0x286ae0[_0x980e1d(0x12a)](_0x1da58e+'/'))return _0x286ae0;return _0x286ae0?_0x1da58e+'/'+_0x286ae0:_0x1da58e;}export function addFoldersToCreate(_0x33d631,_0x87c0b8,_0x4c9337){const _0x5503e2=a152_0xd184d4;if(!_0x33d631)return;if(_0x87c0b8[_0x5503e2(0x18e)](_0x33d631))return;const _0x2e90aa=_0x33d631['split']('/');let _0xc3dc08='';for(const _0x3b4142 of _0x2e90aa){_0xc3dc08=_0xc3dc08?_0xc3dc08+'/'+_0x3b4142:_0x3b4142,!_0x87c0b8[_0x5503e2(0x18e)](_0xc3dc08)&&_0x4c9337[_0x5503e2(0x1e4)](_0xc3dc08);}}export function sortFoldersByDepth(_0x25cd22){const _0xc4379=a152_0xd184d4;return[..._0x25cd22][_0xc4379(0x18d)]((_0x48ee71,_0x5352f0)=>{const _0xa0de62=_0xc4379,_0x2f203c=(_0x48ee71['match'](/\//g)||[])['length'],_0x2e476d=(_0x5352f0[_0xa0de62(0x177)](/\//g)||[])[_0xa0de62(0x169)];return _0x2f203c-_0x2e476d;});}import*as a152_0x2564d2 from'yaml';import{readFileSync}from'fs';import a152_0x430c61 from'path';import{isJourneyDef,parseYamlString as a152_0x52920e,toYamlString as a152_0x34e891,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(_0x38f7bb){const _0x242b20=a152_0xd184d4;if(Array[_0x242b20(0x1bb)](_0x38f7bb))return'['+_0x38f7bb['map'](_0x588b58=>stableStringify(_0x588b58))[_0x242b20(0x13b)](',')+']';if(_0x38f7bb&&typeof _0x38f7bb===_0x242b20(0x1d1)){const _0x52a74c=_0x38f7bb,_0x24226f=Object[_0x242b20(0x1a2)](_0x52a74c)[_0x242b20(0x18d)](),_0x3feba2=_0x24226f[_0x242b20(0x1b6)](_0x147195=>'\x22'+_0x147195+'\x22:'+stableStringify(_0x52a74c[_0x147195]));return'{'+_0x3feba2[_0x242b20(0x13b)](',')+'}';}const _0x1130d1=JSON[_0x242b20(0x142)](_0x38f7bb);return _0x1130d1===undefined?_0x242b20(0x1ba):_0x1130d1;}function activationSignature(_0x692b64){const _0x57c356=a152_0xd184d4,_0x817dd6={'connection':_0x692b64['connection'],..._0x692b64['all_columns']!==undefined&&{'all_columns':_0x692b64[_0x57c356(0x14e)]},..._0x692b64['columns']!==undefined&&{'columns':_0x692b64['columns']},..._0x692b64[_0x57c356(0x1f8)]!==undefined&&{'behavior':_0x692b64[_0x57c356(0x1f8)]},..._0x692b64[_0x57c356(0x11d)]!==undefined&&{'schedule':_0x692b64[_0x57c356(0x11d)]},..._0x692b64[_0x57c356(0x1c6)]!==undefined&&{'notification':_0x692b64[_0x57c356(0x1c6)]},..._0x692b64['connector_config']!==undefined&&{'connector_config':_0x692b64['connector_config']},..._0x692b64[_0x57c356(0x14c)]!==undefined&&{'activation_template_id':_0x692b64['activation_template_id']}};return stableStringify(_0x817dd6);}async function fetchSegment(_0xb26b5a,_0x44a854,_0x469d03,_0x168551){const _0x55a188=a152_0xd184d4,_0x5a66cf=_0x168551?.[_0x55a188(0x179)](_0x475640=>_0x475640['id']===_0x469d03);if(_0x5a66cf)return _0x5a66cf;try{return await _0xb26b5a[_0x55a188(0x109)][_0x55a188(0x13d)](_0x44a854,_0x469d03);}catch(_0xb2c80c){logger[_0x55a188(0x17c)]('getSegment\x20failed\x20for\x20'+_0x469d03+_0x55a188(0x1df)+_0xb2c80c);try{return await _0xb26b5a['segment'][_0x55a188(0x188)](_0x469d03);}catch(_0x3cb47c){return logger[_0x55a188(0x17c)](_0x55a188(0x1ce)+_0x469d03+':\x20'+_0x3cb47c),null;}}}function recoverSegmentIdsFromPushRecovery(_0x186d10,_0x2a5e2f,_0x3dd7a0){const _0x5a6919=a152_0xd184d4,_0x364b96=readPushRecovery(_0x186d10[_0x5a6919(0x10b)]);if(_0x364b96?.['journeyName']===_0x186d10[_0x5a6919(0x106)]['name'])for(const [_0x438ff9,_0x50c47b]of Object[_0x5a6919(0x1f1)](_0x364b96[_0x5a6919(0x17e)])){const _0x4c2a1d=generateDeterministicJourneySegmentName(_0x186d10['yamlConfig'][_0x5a6919(0x13a)],_0x438ff9);_0x50c47b[_0x5a6919(0x194)]===_0x4c2a1d&&(_0x2a5e2f[_0x5a6919(0x1e9)](_0x438ff9,_0x50c47b[_0x5a6919(0x18c)]),_0x3dd7a0[_0x5a6919(0x1e9)](_0x438ff9,_0x50c47b[_0x5a6919(0x18c)]));}}function a152_0x2210(_0x339565,_0x37c8b8){_0x339565=_0x339565-0x103;const _0x390710=a152_0x3907();let _0x221094=_0x390710[_0x339565];return _0x221094;}async function createOrRecoverEmbeddedSegment(_0x3127a6,_0x19faa8,_0x25ee72,_0x26bc66){const _0x79042b=a152_0xd184d4;let _0xad2855;try{_0xad2855=await _0x3127a6['segment']['createJourneySegment']({'name':_0x25ee72[_0x79042b(0x1a5)],'description':_0x25ee72[_0x79042b(0x168)],'journeyId':_0x25ee72[_0x79042b(0x1ee)],'rule':_0x26bc66(_0x25ee72[_0x79042b(0x1b9)],!![]),'countPopulation':!![],'parentFolderId':_0x25ee72['folderId'],'audienceId':_0x25ee72[_0x79042b(0x192)]});}catch(_0x1e81b7){const _0x4f7750=_0x1e81b7 instanceof Error&&_0x1e81b7[_0x79042b(0x189)][_0x79042b(0x20a)](_0x79042b(0x151));if(_0x4f7750){const _0x45e7e3=readPushRecovery(_0x19faa8[_0x79042b(0x10b)]),_0xb5cf7e=_0x45e7e3?.[_0x79042b(0x1ab)]===_0x19faa8[_0x79042b(0x106)][_0x79042b(0x13a)]?_0x45e7e3[_0x79042b(0x17e)][_0x25ee72['localName']]:undefined;if(_0xb5cf7e?.[_0x79042b(0x194)]===_0x25ee72[_0x79042b(0x1a5)])await _0x3127a6[_0x79042b(0x109)][_0x79042b(0x124)](_0x25ee72[_0x79042b(0x192)],_0xb5cf7e[_0x79042b(0x18c)],{'description':_0x25ee72[_0x79042b(0x168)],'rule':_0x26bc66(_0x25ee72[_0x79042b(0x1b9)],!![]),'countPopulation':!![]}),_0xad2855=_0xb5cf7e['segmentId'];else throw new SDKError(ErrorCode[_0x79042b(0x161)],_0x79042b(0x18f)+_0x25ee72[_0x79042b(0x205)]+_0x79042b(0x182)+(_0x79042b(0x207)+_0x19faa8['absolutePath'][_0x79042b(0x1c2)](/([^/]+)$/,_0x79042b(0x17a))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x1e81b7);}else throw _0x1e81b7;}return saveSegmentToPushRecovery(_0x19faa8[_0x79042b(0x10b)],_0x19faa8[_0x79042b(0x106)][_0x79042b(0x13a)],_0x25ee72[_0x79042b(0x205)],{'segmentId':_0xad2855,'uniqueServerName':_0x25ee72[_0x79042b(0x1a5)],'createdAt':new Date()[_0x79042b(0x15f)]()}),_0xad2855;}export async function prepareSegmentFiles(_0x546ccc,_0x327d32,_0x1dab39,_0x543381,_0x4b712e){const _0x3e2a92=a152_0xd184d4,{activationDefToCreateRequest:_0x50b7d3}=await import(_0x3e2a92(0x1cd)),_0x5eef19=[],_0x14f23e=new Set();for(const {yamlConfig:_0x4b33f9,folderPath:_0x2de1cf,sourcePath:_0x2a4d5c}of _0x546ccc){const _0x13048d=resolveTDFolderPath(_0x2de1cf,_0x543381,_0x4b712e),_0x1a5c6c=_0x13048d+':'+_0x4b33f9[_0x3e2a92(0x13a)],_0x36171b=_0x327d32[_0x3e2a92(0x105)][_0x3e2a92(0x181)](_0x1a5c6c),_0x37240a=_0x36171b?_0x327d32['activationsBySegmentId'][_0x3e2a92(0x181)](_0x36171b['id'])||[]:[];addFoldersToCreate(_0x13048d,_0x327d32[_0x3e2a92(0x1c4)],_0x14f23e);const _0x1d35bc=calculateActivationActions(_0x4b33f9[_0x3e2a92(0x1dd)]||[],_0x37240a,_0x327d32[_0x3e2a92(0x12c)],_0x327d32['connectionIdToNameMap']);for(const _0x579dac of _0x1d35bc){(_0x579dac[_0x3e2a92(0x1e5)]===_0x3e2a92(0x128)||_0x579dac[_0x3e2a92(0x1e5)]==='update')&&_0x579dac['yamlActivation']&&(_0x579dac[_0x3e2a92(0x1a9)]=await _0x50b7d3(_0x579dac[_0x3e2a92(0x16d)],_0x1dab39));}const _0x54c190=calculateSegmentDiff(_0x4b33f9,_0x36171b,_0x37240a,_0x327d32['idToEmailMap'],_0x327d32[_0x3e2a92(0x12e)]);_0x5eef19[_0x3e2a92(0x1f4)]({'relativePath':_0x4b33f9[_0x3e2a92(0x13a)],'absolutePath':_0x2a4d5c,'yamlConfig':_0x4b33f9,'folderPath':_0x13048d,'existingSegment':_0x36171b,'existingActivations':_0x37240a,'isNew':_0x54c190['isNew'],'hasChanges':_0x54c190[_0x3e2a92(0x1d2)],'diff':_0x54c190[_0x3e2a92(0x19c)],'activationActions':_0x1d35bc});}return{'segmentFiles':_0x5eef19,'foldersToCreate':_0x14f23e};}export async function prepareJourneyFiles(_0x5e27c4,_0x16625a,_0x258edf,_0x3367eb){const _0x364019=a152_0xd184d4,_0x3f7ccc=[],_0x5defd5=new Set();for(const {yamlConfig:_0x787083,folderPath:_0x419aef,sourcePath:_0x15e667}of _0x5e27c4){const _0x502480=resolveTDFolderPath(_0x419aef,_0x258edf,_0x3367eb),_0x319a1a=_0x502480+':'+_0x787083[_0x364019(0x13a)],_0x59e755=_0x16625a[_0x364019(0x155)][_0x364019(0x181)](_0x319a1a);let _0x5f2dc0,_0x5c390f;if(_0x59e755&&_0x59e755[_0x364019(0x169)]>0x0){const _0x5f3e3e=buildLocalExpandedRuleMappings(_0x787083),{createYamlContext:_0x2a1bbd,prefetchJourneySegments:_0x206d51}=createPushYamlContextForBundle(_0x16625a[_0x364019(0x146)],_0x16625a['parentId'],_0x16625a[_0x364019(0x140)],_0x5f3e3e,_0x16625a['idToEmailMap'],_0x16625a[_0x364019(0x12e)],_0x16625a[_0x364019(0x10e)],_0x16625a['journeyById']);await _0x206d51(_0x59e755[_0x364019(0x1b6)](_0xdbc058=>_0xdbc058['id']));const _0x2cb554=await _0x16625a['deps'][_0x364019(0x1d4)][_0x364019(0x148)](_0x59e755[0x0][_0x364019(0x10f)]),_0x6fbda8=hasMultipleVersions(_0x787083),_0x5044fe=async _0x11897b=>{const _0x390d13=_0x364019,_0x1a0801=_0x16625a[_0x390d13(0x1af)]?.[_0x390d13(0x181)](_0x11897b);if(_0x1a0801)return _0x1a0801;return _0x16625a[_0x390d13(0x1ca)]({'journeyId':_0x11897b,'journeyName':_0x787083[_0x390d13(0x13a)],'isMultiVersion':_0x59e755[_0x390d13(0x169)]>0x1});};if(_0x6fbda8&&_0x59e755[_0x364019(0x169)]>0x1){const _0x2a6550=[];for(const _0x574bfa of _0x59e755){const _0x57e7d5=_0x574bfa[_0x364019(0x1c8)]||0x1;_0x16625a[_0x364019(0x1fc)]?.[_0x364019(0x159)]('Fetching\x20'+_0x787083['name']+'\x20v'+_0x57e7d5);const _0x328627=await _0x5044fe(_0x574bfa['id']),_0x3f30dd=_0x2a1bbd(_0x574bfa['id']),_0x509fea=await journeyResponseToDef(_0x328627,_0x3f30dd);_0x2a6550[_0x364019(0x1f4)]({'item':_0x574bfa,'yaml':_0x509fea});}const _0x1b2ba0=buildLocalRuleToNameMappingFromJourney(_0x787083);_0x5c390f=buildMergedJourneyDef(_0x2a6550,_0x1b2ba0,_0x2cb554);const _0x5c2627=Math['max'](..._0x2a6550['map'](_0x474bd5=>_0x474bd5[_0x364019(0x15c)][_0x364019(0x1c8)]||0x0)),_0x36a40c=_0x59e755['find'](_0x158609=>(_0x158609[_0x364019(0x1c8)]||0x0)===_0x5c2627);_0x36a40c&&(_0x16625a[_0x364019(0x1fc)]?.[_0x364019(0x159)](_0x364019(0x1d0)+_0x787083[_0x364019(0x13a)]+'\x20v'+_0x5c2627),_0x5f2dc0=await _0x5044fe(_0x36a40c['id']));}else{const _0x23d675=_0x59e755[_0x59e755[_0x364019(0x169)]-0x1];_0x16625a[_0x364019(0x1fc)]?.[_0x364019(0x159)](_0x364019(0x1d0)+_0x787083[_0x364019(0x13a)]),_0x5f2dc0=await _0x5044fe(_0x23d675['id']);const _0x58d668=_0x2a1bbd(_0x23d675['id']),_0x34f2b4=await journeyResponseToDef(_0x5f2dc0,_0x58d668),_0xd2a02d=buildLocalRuleToNameMappingFromJourney(_0x787083);_0x5c390f=buildMergedJourneyDef([{'item':_0x23d675,'yaml':_0x34f2b4}],_0xd2a02d,_0x2cb554);}}addFoldersToCreate(_0x502480,_0x16625a[_0x364019(0x1c4)],_0x5defd5);const _0x1709ba=calculateJourneyDiff(_0x787083,_0x5c390f);_0x3f7ccc[_0x364019(0x1f4)]({'relativePath':_0x787083['name'],'absolutePath':_0x15e667,'yamlConfig':_0x787083,'folderPath':_0x502480,'existingJourney':_0x5f2dc0,'isNew':_0x1709ba[_0x364019(0x1da)],'hasChanges':_0x1709ba[_0x364019(0x1d2)],'diff':_0x1709ba[_0x364019(0x19c)]});}return{'journeyFiles':_0x3f7ccc,'foldersToCreate':_0x5defd5};}export function calculateActivationActions(_0x3ac590,_0x137a33,_0xbb8bde,_0x27d506){const _0x1d5643=a152_0xd184d4,_0x5406d0=[],_0xca9673=new Map();for(const _0x516726 of _0x137a33){_0xca9673[_0x1d5643(0x1e9)](_0x516726[_0x1d5643(0x13a)],_0x516726);}const _0x45c069=new Map();for(const _0x858639 of _0x3ac590){_0x45c069[_0x1d5643(0x1e9)](_0x858639[_0x1d5643(0x13a)],_0x858639);}for(const _0x43a2e7 of _0x3ac590){const _0x10ab7d=_0xca9673[_0x1d5643(0x181)](_0x43a2e7['name']);if(!_0x10ab7d)_0x5406d0[_0x1d5643(0x1f4)]({'type':'create','name':_0x43a2e7['name'],'yamlActivation':_0x43a2e7});else{const _0x3f1bb8=activationResponseToDef(_0x10ab7d,_0xbb8bde,_0x27d506),_0x3a515b=a152_0x2564d2['stringify'](_0x3f1bb8),_0x283205=a152_0x2564d2['stringify'](_0x43a2e7);_0x3a515b!==_0x283205&&_0x5406d0[_0x1d5643(0x1f4)]({'type':_0x1d5643(0x159),'name':_0x43a2e7['name'],'yamlActivation':_0x43a2e7,'existingActivation':_0x10ab7d});}}for(const _0x5921c8 of _0x137a33){!_0x45c069[_0x1d5643(0x18e)](_0x5921c8['name'])&&_0x5406d0[_0x1d5643(0x1f4)]({'type':'delete','name':_0x5921c8[_0x1d5643(0x13a)],'existingActivation':_0x5921c8});}return _0x5406d0;}function calculateYamlDiff(_0x32f74c,_0x338263){if(_0x338263){const _0x1f649b=generateDiff(_0x338263,_0x32f74c),_0xf4bd46=hasChanges(_0x1f649b);return{'isNew':![],'hasChanges':_0xf4bd46,'diff':_0xf4bd46?formatDiffWithColors(_0x1f649b):undefined};}const _0x5d8d88=generateDiff('',_0x32f74c);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5d8d88)};}export function calculateSegmentDiff(_0x13a527,_0x2fa690,_0x42c871,_0xcaa69,_0x599fac){const _0x78cebc=segmentToYamlString(_0x13a527),_0x12a255=_0x2fa690?segmentToYamlString(segmentWithActivationsToYaml(_0x2fa690,_0x42c871,undefined,_0xcaa69,_0x599fac)):undefined;return calculateYamlDiff(_0x78cebc,_0x12a255);}export function calculateJourneyDiff(_0x499796,_0x1939f2){const _0x4078d0=normalizeJourneyDef(_0x499796,_0x499796),_0x54c6ee=a152_0x34e891(_0x4078d0),_0x52ed0b=_0x1939f2?a152_0x34e891(normalizeJourneyDef(_0x1939f2,_0x499796)):undefined;return calculateYamlDiff(_0x54c6ee,_0x52ed0b);}export function findSegmentsToDelete(_0x1f22ae,_0x336be7,_0x3ee544,_0x33787d,_0x4f2d41){const _0x345c12=a152_0xd184d4,_0x7a9b27=new Set();for(const {yamlConfig:_0x59b031,folderPath:_0xcbd4d2}of _0x336be7){_0x7a9b27[_0x345c12(0x1e4)](_0xcbd4d2+':'+_0x59b031[_0x345c12(0x13a)]);}return _0x1f22ae[_0x345c12(0x206)](_0x496b13=>{const _0x420b55=_0x345c12,_0x411e67=_0x496b13[_0x420b55(0x160)]?_0x3ee544[_0x420b55(0x181)](_0x496b13[_0x420b55(0x160)][_0x420b55(0x1f5)]())||'':'',_0x2ab4af=_0x411e67+':'+_0x496b13[_0x420b55(0x13a)];if(_0x7a9b27[_0x420b55(0x18e)](_0x2ab4af))return![];if(_0x4f2d41)return _0x411e67===_0x33787d||_0x411e67[_0x420b55(0x12a)](_0x33787d+'/');return!![];});}export function findJourneysToDelete(_0x36eea0,_0x4cfc45,_0x13b5a9,_0x5842e6,_0x33bed2){const _0x3977bd=a152_0xd184d4,_0x109f83=new Set();for(const {yamlConfig:_0x412e7b,folderPath:_0x44b2f9}of _0x4cfc45){_0x109f83[_0x3977bd(0x1e4)](_0x44b2f9+':'+_0x412e7b[_0x3977bd(0x13a)]);}return _0x36eea0[_0x3977bd(0x206)](_0x140216=>{const _0x30e8b2=_0x3977bd,_0x295f58=_0x140216[_0x30e8b2(0x19a)]?_0x13b5a9[_0x30e8b2(0x181)](_0x140216[_0x30e8b2(0x19a)])||'':'',_0x45e169=_0x295f58+':'+_0x140216['journeyBundleName'];if(_0x109f83[_0x30e8b2(0x18e)](_0x45e169))return![];if(_0x33bed2)return _0x295f58===_0x5842e6||_0x295f58['startsWith'](_0x5842e6+'/');return!![];});}export function buildSegmentLookupMap(_0x1bb9d9,_0x3edb03){const _0x251c9e=a152_0xd184d4,_0x53a8e0=new Map();for(const _0x2faf2d of _0x1bb9d9){const _0x19d75b=_0x2faf2d[_0x251c9e(0x160)]?_0x3edb03['get'](_0x2faf2d['segmentFolderId'][_0x251c9e(0x1f5)]())||'':'',_0x4e4e7a=_0x19d75b+':'+_0x2faf2d[_0x251c9e(0x13a)];_0x53a8e0[_0x251c9e(0x1e9)](_0x4e4e7a,_0x2faf2d);}return _0x53a8e0;}export function buildSegmentNameToIdMap(_0x1575d0){const _0x547853=a152_0xd184d4,_0x41533e=new Map();for(const _0x2bcb22 of _0x1575d0){_0x41533e[_0x547853(0x1e9)](_0x2bcb22[_0x547853(0x13a)],_0x2bcb22['id']);}return _0x41533e;}export function buildJourneyBundleLookupMap(_0x2c507c,_0x40a707){const _0x3d15c3=a152_0xd184d4,_0x118ed3=new Map();for(const _0x29eff7 of _0x2c507c){const _0x3c4cda=_0x29eff7['folderId']?_0x40a707[_0x3d15c3(0x181)](_0x29eff7[_0x3d15c3(0x19a)])||'':'',_0x111a9c=_0x3c4cda+':'+_0x29eff7[_0x3d15c3(0x1a4)];!_0x118ed3['has'](_0x111a9c)&&_0x118ed3['set'](_0x111a9c,[]),_0x118ed3[_0x3d15c3(0x181)](_0x111a9c)[_0x3d15c3(0x1f4)](_0x29eff7);}for(const _0x280dde of _0x118ed3[_0x3d15c3(0x203)]()){_0x280dde[_0x3d15c3(0x18d)]((_0x3eee30,_0x52a4e0)=>(_0x3eee30['versionNumber']||0x0)-(_0x52a4e0[_0x3d15c3(0x1c8)]||0x0));}return _0x118ed3;}export function collectFoldersToCreate(_0x5bc891,_0x343538){const _0x4df34f=a152_0xd184d4,_0x4949ae=new Set();for(const _0x53c2ba of _0x5bc891){if(!_0x53c2ba)continue;if(_0x343538[_0x4df34f(0x18e)](_0x53c2ba))continue;const _0x48cc63=_0x53c2ba['split']('/');let _0xe18dfa='';for(const _0x471c35 of _0x48cc63){_0xe18dfa=_0xe18dfa?_0xe18dfa+'/'+_0x471c35:_0x471c35,!_0x343538[_0x4df34f(0x18e)](_0xe18dfa)&&_0x4949ae[_0x4df34f(0x1e4)](_0xe18dfa);}}return _0x4949ae;}export function parseAndClassifyYamlFiles(_0x1dadc4,_0xbc6e91,_0x261d80){const _0x7051aa=a152_0xd184d4,_0x4944df=[],_0x532101=[];for(const _0x3a2833 of _0x1dadc4){const _0x705419=a152_0x430c61['relative'](_0xbc6e91,a152_0x430c61[_0x7051aa(0x163)](_0x3a2833)),_0xfb92a7=_0x705419==='.'?'':_0x705419[_0x7051aa(0x1c2)](/\\/g,'/'),_0x491199=readFileSync(_0x3a2833,_0x7051aa(0x1ea)),_0x1539e9=a152_0x2564d2[_0x7051aa(0x111)](_0x491199);if(isJourneyDef(_0x1539e9)){const _0x3d2e48=a152_0x52920e(_0x491199);_0x532101['push']({'yamlConfig':_0x3d2e48,'folderPath':_0xfb92a7,'sourcePath':_0x3a2833});}else{if(!_0x261d80?.[_0x7051aa(0x13f)]){const _0x4e990e=parseSegmentYamlFile(_0x491199),_0x1fc00e=normalizeChildSegmentYaml(_0x4e990e);_0x4944df['push']({'yamlConfig':_0x1fc00e,'folderPath':_0xfb92a7,'sourcePath':_0x3a2833});}}}return{'segments':_0x4944df,'journeys':_0x532101};}export function validateParsedFiles(_0x36fccb,_0x5d753e){const _0xc40f22=a152_0xd184d4,_0x559670=[];for(const {yamlConfig:_0x19e4a8,sourcePath:_0x20e5be}of _0x36fccb[_0xc40f22(0x17e)]){const _0x184fc7=readFileSync(_0x20e5be,_0xc40f22(0x1ea)),_0x263107=a152_0x2564d2[_0xc40f22(0x195)](_0x184fc7),_0x1aed91=validateSegmentDef(_0x19e4a8,{'source':_0x184fc7,'document':_0x263107},{'skipSchema':!![]});if(!_0x1aed91['valid']){const _0x15a4de=a152_0x430c61['relative'](_0x5d753e,_0x20e5be);_0x559670[_0xc40f22(0x1f4)]({'filePath':_0x15a4de,'source':_0x184fc7,'result':_0x1aed91,'isJourney':![]});}}for(const {yamlConfig:_0x13381c,sourcePath:_0x53fdcb}of _0x36fccb[_0xc40f22(0x1a7)]){const _0x2fa315=readFileSync(_0x53fdcb,_0xc40f22(0x1ea)),_0xc1e4f2=a152_0x2564d2[_0xc40f22(0x195)](_0x2fa315),_0x579fba=validateJourneyDef(_0x13381c,{'source':_0x2fa315,'document':_0xc1e4f2},{'skipSchema':!![]});if(!_0x579fba[_0xc40f22(0x1fa)]){const _0x1c4435=a152_0x430c61['relative'](_0x5d753e,_0x53fdcb);_0x559670[_0xc40f22(0x1f4)]({'filePath':_0x1c4435,'source':_0x2fa315,'result':_0x579fba,'isJourney':!![]});}}return _0x559670;}export function formatValidationErrors(_0x2c1091){const _0x23d6c7=a152_0xd184d4,_0x48934c=[];for(const {filePath:_0x434827,source:_0x590af0,result:_0x233a49,isJourney:_0x5c180c}of _0x2c1091){const _0x15b7a7=_0x5c180c?'journey':_0x23d6c7(0x109);_0x48934c[_0x23d6c7(0x1f4)]('\x0a'+_0x434827+'\x20('+_0x15b7a7+_0x23d6c7(0x1cf)+_0x233a49[_0x23d6c7(0x1f2)][_0x23d6c7(0x169)]+'\x20error(s)'),_0x48934c[_0x23d6c7(0x1f4)](formatValidationResult(_0x233a49,_0x590af0,_0x434827));}return _0x48934c[_0x23d6c7(0x13b)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x1b3dbf){const _0x5e8c3b=a152_0xd184d4,_0x30a692=new Set(),_0x1a7066=new Map(),_0x17af43=collectSegmentUsageCounts(_0x1b3dbf);if(_0x1b3dbf[_0x5e8c3b(0x17e)])for(const [_0x49585b,_0x2e9695]of Object[_0x5e8c3b(0x1f1)](_0x1b3dbf[_0x5e8c3b(0x17e)])){_0x30a692[_0x5e8c3b(0x1e4)](_0x49585b);if(_0x2e9695[_0x5e8c3b(0x202)]){const _0x57e1bd=yamlRuleToApi(_0x2e9695[_0x5e8c3b(0x202)]),_0x4b99f0=apiRuleToYaml(_0x57e1bd);_0x1a7066[_0x5e8c3b(0x1e9)](_0x49585b,_0x4b99f0);}}const _0x5565a4=new Map();let _0x2d35a3=0x0;for(const [_0x1a0f68,_0x5c28af]of _0x1a7066){const _0x343d94=serializeExpandedRule(_0x5c28af,_0x1a7066),_0x51b689=_0x5565a4['get'](_0x343d94)||[];_0x51b689[_0x5e8c3b(0x1f4)]({'name':_0x1a0f68,'index':_0x2d35a3}),_0x5565a4[_0x5e8c3b(0x1e9)](_0x343d94,_0x51b689),_0x2d35a3++;}const _0x8ac6a7=new Map();for(const [_0x4b1f4c,_0x13b46a]of _0x5565a4){const _0x1e7815=_0x13b46a[_0x5e8c3b(0x175)]()[_0x5e8c3b(0x18d)]((_0x4c9d93,_0x51506a)=>{const _0x2ae600=_0x5e8c3b,_0x590eef=_0x17af43[_0x2ae600(0x181)](_0x4c9d93['name'])||0x0,_0x450d92=_0x17af43[_0x2ae600(0x181)](_0x51506a[_0x2ae600(0x13a)])||0x0;if(_0x590eef!==_0x450d92)return _0x450d92-_0x590eef;return _0x4c9d93[_0x2ae600(0x136)]-_0x51506a['index'];})[_0x5e8c3b(0x1b6)](_0x2a35a0=>_0x2a35a0[_0x5e8c3b(0x13a)]),_0x25cdbb=[];for(const _0x47110e of _0x1e7815){const _0x4bae32=_0x17af43[_0x5e8c3b(0x181)](_0x47110e)||0x0,_0x15191f=Math[_0x5e8c3b(0x112)](_0x4bae32,0x1);for(let _0x1bd50c=0x0;_0x1bd50c<_0x15191f;_0x1bd50c++){_0x25cdbb[_0x5e8c3b(0x1f4)](_0x47110e);}}_0x8ac6a7[_0x5e8c3b(0x1e9)](_0x4b1f4c,_0x25cdbb);}return{'existingLocalSegmentNames':_0x30a692,'localSegmentRules':_0x1a7066,'localExpandedRuleToNames':_0x8ac6a7};}export function createSegmentIdResolver(_0x43fd79,_0x32ecc1){return async _0x38ec7e=>{const _0x141318=a152_0x2210,_0xd00424=_0x43fd79[_0x141318(0x181)](_0x38ec7e);if(!_0xd00424)throw new SDKError(ErrorCode[_0x141318(0x1d3)],_0x141318(0x1dc)+_0x38ec7e+_0x141318(0x17d)+_0x32ecc1+'\x27)');return _0xd00424;};}export function extractRootFolderId(_0x342fa8){const _0x3d7b42=a152_0xd184d4;return _0x342fa8[_0x3d7b42(0x1b1)]?.[_0x3d7b42(0x1f6)]?.['data']?.['id']||_0x342fa8[_0x3d7b42(0x1b1)]?.['parentFolder']?.[_0x3d7b42(0x114)]?.['id'];}export function buildConnectionMaps(_0x34bdd4){const _0x10177a=a152_0xd184d4,_0x25844d=new Map(),_0x1cd445=new Map(),_0x383c4a=new Map();for(const _0x38a222 of _0x34bdd4){_0x25844d[_0x10177a(0x1e9)](_0x38a222[_0x10177a(0x13a)],parseInt(_0x38a222['id'],0xa)),_0x1cd445['set'](_0x38a222['id'],_0x38a222[_0x10177a(0x13a)]),_0x383c4a[_0x10177a(0x1e9)](_0x38a222['name'],_0x38a222[_0x10177a(0x1e5)]);}return{'nameToId':_0x25844d,'idToName':_0x1cd445,'nameToType':_0x383c4a};}export function calculatePushStats(_0x5f543a,_0xcfc920,_0x3216c8,_0xcdeb9c,_0x9f9073,_0x4da4e1,_0x4e6a23){const _0x6509dd=a152_0xd184d4,_0x1aa578=_0x5f543a[_0x6509dd(0x206)](_0x266122=>_0x266122[_0x6509dd(0x1da)]),_0x459c75=_0x5f543a[_0x6509dd(0x206)](_0x3686e1=>!_0x3686e1[_0x6509dd(0x1da)]&&_0x3686e1['hasChanges']),_0x4de8d5=_0x5f543a['filter'](_0x5e1188=>!_0x5e1188[_0x6509dd(0x1da)]&&!_0x5e1188[_0x6509dd(0x1d2)]),_0x524608=_0x4da4e1?_0xcdeb9c:[],_0x2a294e=_0xcfc920['filter'](_0x3ec405=>_0x3ec405[_0x6509dd(0x1da)]),_0x404421=_0xcfc920['filter'](_0x4c8010=>!_0x4c8010[_0x6509dd(0x1da)]&&_0x4c8010['hasChanges']),_0x2141f0=_0xcfc920['filter'](_0x2e4745=>!_0x2e4745[_0x6509dd(0x1da)]&&!_0x2e4745['hasChanges']),_0x51cd99=_0x4da4e1?_0x9f9073:[],_0x52adec=_0x5f543a[_0x6509dd(0x1bd)](_0x63725d=>_0x63725d['activationActions']),_0x583cd5=_0x52adec[_0x6509dd(0x206)](_0x9ebfd6=>_0x9ebfd6[_0x6509dd(0x1e5)]===_0x6509dd(0x128)),_0x43488e=_0x52adec[_0x6509dd(0x206)](_0x113590=>_0x113590[_0x6509dd(0x1e5)]===_0x6509dd(0x159)),_0x185f1d=_0x52adec[_0x6509dd(0x206)](_0x1cf06b=>_0x1cf06b['type']===_0x6509dd(0x1b4)),_0x53720b=Array['from'](_0x3216c8)[_0x6509dd(0x18d)](),_0x2c7754=_0x4e6a23?![]:_0x1aa578[_0x6509dd(0x169)]>0x0||_0x459c75[_0x6509dd(0x169)]>0x0||_0x524608[_0x6509dd(0x169)]>0x0,_0x1f15cc=_0x2a294e[_0x6509dd(0x169)]>0x0||_0x404421['length']>0x0||_0x51cd99[_0x6509dd(0x169)]>0x0,_0x2cbe49=_0x4e6a23?![]:_0x52adec[_0x6509dd(0x169)]>0x0,_0x7cfc29=_0x53720b[_0x6509dd(0x169)]>0x0;return{'segments':{'new':_0x1aa578,'changed':_0x459c75,'unchanged':_0x4de8d5,'toDelete':_0x524608},'journeys':{'new':_0x2a294e,'changed':_0x404421,'unchanged':_0x2141f0,'toDelete':_0x51cd99},'activations':{'all':_0x52adec,'toCreate':_0x583cd5,'toUpdate':_0x43488e,'toDelete':_0x185f1d},'folders':{'toCreate':_0x53720b},'counts':{'segments':{'new':_0x1aa578[_0x6509dd(0x169)],'changed':_0x459c75[_0x6509dd(0x169)],'unchanged':_0x4de8d5[_0x6509dd(0x169)],'toDelete':_0x524608[_0x6509dd(0x169)]},'journeys':{'new':_0x2a294e[_0x6509dd(0x169)],'changed':_0x404421[_0x6509dd(0x169)],'unchanged':_0x2141f0['length'],'toDelete':_0x51cd99['length']},'activations':{'create':_0x583cd5[_0x6509dd(0x169)],'update':_0x43488e['length'],'delete':_0x185f1d[_0x6509dd(0x169)]},'folders':_0x53720b[_0x6509dd(0x169)]},'hasChanges':_0x2c7754||_0x1f15cc||_0x2cbe49||_0x7cfc29};}export async function buildPushExecutionContext(_0x4ad881,_0x176d94,_0x17afb4,_0x3507a1,_0x1be9d8,_0x54ccbb){const _0x1b50e5=a152_0xd184d4,_0xb4c5ad=extractRootFolderId(_0x17afb4),{pathToId:_0x3948a6,idToPath:_0x17c814}=buildFolderMaps(_0x1be9d8),_0x3a7bd6=buildSegmentNameToIdMap(_0x3507a1),_0x388cd3=new Map(),{batchAsync:_0x4af893}=await import(_0x1b50e5(0x132)),[_0x38611f,_0x5adac9]=await Promise[_0x1b50e5(0x121)]([_0x4ad881[_0x1b50e5(0x1e1)]['buildUserMaps'](),_0x4ad881[_0x1b50e5(0x11a)]['list'](),((async()=>{!_0x54ccbb&&_0x3507a1['length']>0x0&&await _0x4af893(_0x3507a1,async _0x183281=>{const _0x498447=a152_0x2210,_0x4d755a=await _0x4ad881[_0x498447(0x109)][_0x498447(0x133)](_0x176d94,_0x183281['id']);_0x388cd3[_0x498447(0x1e9)](_0x183281['id'],_0x4d755a);});})())]),{emailToId:_0x5b6597,idToEmail:_0x1ee214}=_0x38611f,_0x3e5173=buildConnectionMaps(_0x5adac9);return{'rootFolderId':_0xb4c5ad,'folderPathToId':_0x3948a6,'folderIdToPath':_0x17c814,'segmentNameToId':_0x3a7bd6,'activationsBySegmentId':_0x388cd3,'emailToIdMap':_0x5b6597,'idToEmailMap':_0x1ee214,'connectionNameToIdMap':_0x3e5173['nameToId'],'connectionIdToNameMap':_0x3e5173[_0x1b50e5(0x14b)],'connectionNameToTypeMap':_0x3e5173['nameToType']};}export function createPushYamlContextForBundle(_0x5786d4,_0x2711b3,_0x3c9882,_0x4a41b3,_0x8d7cba,_0x50d3bf,_0x1cf607,_0x4b4f94){const {existingLocalSegmentNames:_0x73d62,localExpandedRuleToNames:_0x5aeb09}=_0x4a41b3,_0xfba02c=new Set(),_0x1293fc=new Map(),_0x2f0cdb=new Map(),_0x5a4d5d=new Map(),_0x489fbe=createJumpTargetCache(),_0x253b06=new Map(),_0x5a01ee=new Map(),_0x34e240=new Set();let _0x2cbfb2;const _0x487340=_0x2930bf=>{const _0x1c09eb={'resolveSegment':async _0x154384=>{const _0x42859b=a152_0x2210,_0x4245cf=_0x5a4d5d['get'](_0x154384);if(_0x4245cf!==undefined)return{'name':_0x4245cf,'isJourneyLocal':!![]};try{const _0x31cd72=await fetchSegment(_0x5786d4,_0x2711b3,_0x154384,_0x3c9882);if(!_0x31cd72)throw new Error('Segment\x20not\x20found');const _0x47a692=generateJourneyLocalName(_0x31cd72[_0x42859b(0x13a)]),_0x32eab1=_0x31cd72[_0x42859b(0x1fd)]===SEGMENT_KIND_JOURNEY&&_0x47a692!==undefined;let _0x33602c=_0x31cd72[_0x42859b(0x13a)],_0x20361c;if(_0x32eab1&&_0x31cd72['rule']){const _0xef4098=apiRuleToYaml(_0x31cd72['rule']);_0x5a01ee[_0x42859b(0x1e9)](_0x154384,_0xef4098);const _0x52b916=async _0x526366=>{const _0x90f628=_0x42859b,_0x25030d=collectSegmentRefsFromRule(_0x526366);for(const _0x24a4dc of _0x25030d){if(!_0x5a01ee[_0x90f628(0x18e)](_0x24a4dc))try{const _0x6bcbc1=await fetchSegment(_0x5786d4,_0x2711b3,_0x24a4dc,_0x3c9882);if(_0x6bcbc1?.[_0x90f628(0x202)]){const _0x3d6bda=apiRuleToYaml(_0x6bcbc1['rule']);_0x5a01ee[_0x90f628(0x1e9)](_0x24a4dc,_0x3d6bda),await _0x52b916(_0x3d6bda);}}catch(_0x15ed97){logger[_0x90f628(0x17c)](_0x90f628(0x1b3)+_0x24a4dc+':\x20'+_0x15ed97);}}};await _0x52b916(_0xef4098);const _0x4e5f5e=serializeExpandedRule(_0xef4098,_0x5a01ee),_0x5c1e1c=_0x5aeb09[_0x42859b(0x181)](_0x4e5f5e);if(_0x5c1e1c&&_0x5c1e1c['length']>0x0){const _0x3c062a=_0x1293fc['get'](_0x4e5f5e)||0x0,_0x337434=_0x5c1e1c[_0x3c062a]||_0x5c1e1c[_0x5c1e1c[_0x42859b(0x169)]-0x1];_0x1293fc[_0x42859b(0x1e9)](_0x4e5f5e,_0x3c062a+0x1),_0x33602c=_0x337434,_0xfba02c['add'](_0x33602c),_0x5a4d5d[_0x42859b(0x1e9)](_0x154384,_0x33602c);const _0x5c6cd6=await resolveRuleSegmentRefs(_0xef4098,async _0x314ccf=>{const _0xd3b918=_0x42859b,_0x13e1d6=_0x5a4d5d[_0xd3b918(0x181)](_0x314ccf);if(_0x13e1d6)return _0x13e1d6;const _0x2b6518=await _0x2cbfb2[_0xd3b918(0x1c5)](_0x314ccf);return _0x2b6518['name'];});_0x20361c={'description':_0x31cd72[_0x42859b(0x168)],'rule':_0x5c6cd6};}else{const _0x81c580=_0x253b06[_0x42859b(0x181)](_0x4e5f5e);if(_0x81c580)_0x33602c=_0x81c580,_0x5a4d5d[_0x42859b(0x1e9)](_0x154384,_0x33602c);else{if(_0x47a692){let _0x1cfcbe=_0x47a692,_0xd128a7=0x2;while(_0xfba02c[_0x42859b(0x18e)](_0x1cfcbe)||_0x73d62[_0x42859b(0x18e)](_0x1cfcbe)){_0x1cfcbe=_0x47a692+'_'+_0xd128a7,_0xd128a7++;}_0xfba02c[_0x42859b(0x1e4)](_0x1cfcbe),_0x33602c=_0x1cfcbe;}_0x5a4d5d[_0x42859b(0x1e9)](_0x154384,_0x33602c),_0x253b06[_0x42859b(0x1e9)](_0x4e5f5e,_0x33602c);const _0x96e1e1=await resolveRuleSegmentRefs(_0xef4098,async _0x53e6a2=>{const _0x19723a=_0x42859b,_0x7f55aa=_0x5a4d5d[_0x19723a(0x181)](_0x53e6a2);if(_0x7f55aa)return _0x7f55aa;const _0x26d73c=await _0x2cbfb2[_0x19723a(0x1c5)](_0x53e6a2);return _0x26d73c[_0x19723a(0x13a)];});_0x20361c={'description':_0x31cd72[_0x42859b(0x168)],'rule':_0x96e1e1};}}}return{'name':_0x33602c,'isJourneyLocal':_0x32eab1,'definition':_0x20361c};}catch(_0x3757e8){return logger[_0x42859b(0x17c)](_0x42859b(0x180)+_0x154384+':\x20'+_0x3757e8),{'name':_0x154384,'isJourneyLocal':![]};}},'resolveActivation':async _0x1ecfe4=>{const _0xa454aa=a152_0x2210,_0x4abb3e=_0x2f0cdb[_0xa454aa(0x181)](_0x1ecfe4);if(_0x4abb3e!==undefined)return{'name':_0x4abb3e,'isJourneyLocal':!![]};try{let _0x5482f4=_0x1cf607?.['get'](_0x1ecfe4);!_0x5482f4&&(_0x5482f4=await _0x5786d4[_0xa454aa(0x1d4)][_0xa454aa(0x123)](_0x2930bf,_0x1ecfe4));const _0x2f0233=_0x5482f4[_0xa454aa(0x171)][_0xa454aa(0x19b)][_0xa454aa(0x13a)]||_0x1ecfe4,_0x50fe19=sanitizeYamlKey(_0x2f0233)||'activation_'+_0x1ecfe4,_0x9135b1=_0x50fe19;_0x2f0cdb[_0xa454aa(0x1e9)](_0x1ecfe4,_0x9135b1);const _0x53b0b3=journeyActivationStepToYaml(_0x5482f4,_0x8d7cba,_0x50d3bf);return{'name':_0x9135b1,'isJourneyLocal':!![],'definition':_0x53b0b3};}catch(_0x10809e){return logger[_0xa454aa(0x17c)]('Failed\x20to\x20resolve\x20activation\x20'+_0x1ecfe4+':\x20'+_0x10809e),{'name':_0x1ecfe4,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xb384f3,_0x1710fb)=>resolveJumpTarget(_0xb384f3,_0x1710fb,_0x489fbe,async _0x13b864=>{const _0x5d91cd=a152_0x2210,_0x2bb4e0=_0x4b4f94?.['get'](_0x13b864);if(_0x2bb4e0)return _0x2bb4e0;return _0x5786d4['journey'][_0x5d91cd(0x198)](_0x13b864);})};return _0x2cbfb2=_0x1c09eb,_0x1c09eb;},_0x489198=async _0x1c72e0=>{const _0x2f6453=a152_0x2210,{collectSegmentIdsFromJourneyApi:_0xabf63e}=await import(_0x2f6453(0x204)),{batchAsync:_0xde6569}=await import(_0x2f6453(0x132)),_0x7225a3=new Set();for(const _0x379ed4 of _0x1c72e0){let _0x41c17d=_0x4b4f94?.[_0x2f6453(0x181)](_0x379ed4);!_0x41c17d&&(_0x41c17d=await _0x5786d4['journey']['getJourney'](_0x379ed4));const _0x3df64c=_0xabf63e(_0x41c17d);for(const _0x5d4d3c of _0x3df64c){_0x7225a3[_0x2f6453(0x1e4)](_0x5d4d3c);}}let _0x369b20=Array[_0x2f6453(0x199)](_0x7225a3);while(_0x369b20[_0x2f6453(0x169)]>0x0){const _0x183341=_0x369b20[_0x2f6453(0x206)](_0x32ef4e=>!_0x34e240['has'](_0x32ef4e));if(_0x183341['length']===0x0)break;const _0x333489=await _0xde6569(_0x183341,async _0x457d0f=>{const _0x2f921f=_0x2f6453;_0x34e240[_0x2f921f(0x1e4)](_0x457d0f);const _0x50643e=await fetchSegment(_0x5786d4,_0x2711b3,_0x457d0f,_0x3c9882);if(!_0x50643e)return null;return{'segmentId':_0x457d0f,'segment':_0x50643e};},0xa),_0x24bacd=new Set();for(const _0xb140ba of _0x333489){if(!_0xb140ba?.[_0x2f6453(0x109)]?.[_0x2f6453(0x202)])continue;const _0x3c1908=apiRuleToYaml(_0xb140ba[_0x2f6453(0x109)][_0x2f6453(0x202)]);_0x5a01ee[_0x2f6453(0x1e9)](_0xb140ba[_0x2f6453(0x18c)],_0x3c1908);const _0x483fbf=collectSegmentRefsFromRule(_0x3c1908);for(const _0x2a89f0 of _0x483fbf){!_0x34e240[_0x2f6453(0x18e)](_0x2a89f0)&&_0x24bacd[_0x2f6453(0x1e4)](_0x2a89f0);}}_0x369b20=Array['from'](_0x24bacd);}};return{'createYamlContext':_0x487340,'prefetchJourneySegments':_0x489198};}export async function executePushSegments(_0x11e340,_0x2008cb,_0x114ace,_0x512e96,_0x105633){const _0x3a6a81=a152_0xd184d4,{segmentDefToCreateRequest:_0x567296,segmentDefToUpdateRequest:_0x258dff}=await import(_0x3a6a81(0x1cd)),_0x1db944=_0x114ace[_0x3a6a81(0x1c4)],_0x17a4f8=0x5,_0x38df6a=async _0x43bb9d=>{const _0x50d5ae=_0x3a6a81,_0x4d8d09=_0x43bb9d[_0x50d5ae(0x1cb)]?_0x1db944[_0x50d5ae(0x181)](_0x43bb9d['folderPath']):undefined;let _0x19e427;const _0x5e41a2={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x19ab7c=_0x43bb9d[_0x50d5ae(0x106)];if(_0x43bb9d[_0x50d5ae(0x106)]['rule']){const _0x5a55bd=createSegmentIdResolver(_0x114ace[_0x50d5ae(0x1b5)],_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]),_0xc16eb4=await resolveRuleSegmentIds(_0x43bb9d[_0x50d5ae(0x106)]['rule'],_0x5a55bd);_0x19ab7c={..._0x43bb9d[_0x50d5ae(0x106)],'rule':_0xc16eb4};}try{if(_0x43bb9d[_0x50d5ae(0x1da)]){_0x105633['onProgress']?.({'type':_0x50d5ae(0x1de),'name':_0x43bb9d['yamlConfig']['name']});const _0xf80e61=_0x567296(_0x19ab7c,_0x4d8d09),_0x438801=await _0x105633[_0x50d5ae(0x13e)]('Creating\x20segment\x20\x27'+_0x43bb9d[_0x50d5ae(0x106)]['name']+_0x50d5ae(0x13c),()=>_0x11e340['segment'][_0x50d5ae(0x19f)](_0x512e96['parentId'],_0xf80e61));_0x19e427=_0x438801['data']['id'],_0x114ace[_0x50d5ae(0x1b5)]['set'](_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)],_0x19e427),_0x5e41a2[_0x50d5ae(0x125)]={'name':_0x43bb9d[_0x50d5ae(0x106)]['name'],'id':_0x19e427},_0x105633['onProgress']?.({'type':_0x50d5ae(0x1a0),'name':_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)],'segmentId':_0x19e427}),_0x105633['logSuccess']?.(_0x50d5ae(0x19d)+_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]+'\x27'),_0x5e41a2[_0x50d5ae(0x1b2)]=0x1;}else{if(_0x43bb9d['hasChanges']){_0x105633[_0x50d5ae(0x167)]?.({'type':_0x50d5ae(0x108),'name':_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]});const _0x29a749=_0x258dff(_0x19ab7c);_0x4d8d09!==_0x43bb9d[_0x50d5ae(0x129)]?.['segmentFolderId']&&(_0x29a749['segmentFolderId']=_0x4d8d09?parseInt(_0x4d8d09,0xa):undefined),await _0x105633[_0x50d5ae(0x13e)](_0x50d5ae(0x201)+_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]+_0x50d5ae(0x13c),()=>_0x11e340[_0x50d5ae(0x109)][_0x50d5ae(0x124)](_0x512e96[_0x50d5ae(0x192)],_0x43bb9d['existingSegment']['id'],_0x29a749)),_0x19e427=_0x43bb9d[_0x50d5ae(0x129)]['id'],_0x105633[_0x50d5ae(0x167)]?.({'type':_0x50d5ae(0x116),'name':_0x43bb9d['yamlConfig'][_0x50d5ae(0x13a)]}),_0x105633[_0x50d5ae(0x1f3)]?.(_0x50d5ae(0x158)+_0x43bb9d['yamlConfig'][_0x50d5ae(0x13a)]+'\x27'),_0x5e41a2[_0x50d5ae(0x1a8)]=0x1;}else _0x19e427=_0x43bb9d[_0x50d5ae(0x129)]['id'];}}catch(_0x49e07e){const _0x2388c4=isHttp400Error(_0x49e07e),_0x5e295f=_0x2388c4?ErrorCode['SEGMENT_SYNTAX_ERROR']:ErrorCode['SEGMENT_UPDATE_ERROR'],_0x490df9=getErrorMessage(_0x49e07e);throw new SDKError(_0x5e295f,_0x50d5ae(0x1e8)+(_0x43bb9d[_0x50d5ae(0x1da)]?'create':_0x50d5ae(0x159))+_0x50d5ae(0x149)+_0x43bb9d[_0x50d5ae(0x10b)]+'\x0a\x20\x20'+_0x490df9,_0x49e07e);}try{const _0x7469f8=await syncActivationsForSegment(_0x11e340,_0x512e96['parentId'],_0x19e427,_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)],_0x43bb9d[_0x50d5ae(0x11c)],_0x105633,_0x43bb9d[_0x50d5ae(0x10b)]);_0x5e41a2[_0x50d5ae(0x1dd)]=_0x7469f8;}catch(_0x250d97){if(_0x250d97 instanceof SDKError)throw _0x250d97;throw new SDKError(ErrorCode[_0x50d5ae(0x1a6)],_0x50d5ae(0x144)+_0x43bb9d[_0x50d5ae(0x106)][_0x50d5ae(0x13a)]+_0x50d5ae(0x137)+_0x43bb9d[_0x50d5ae(0x10b)]+_0x50d5ae(0x107)+getErrorMessage(_0x250d97),_0x250d97);}return _0x5e41a2;},_0x4b0966=await batchAsync(_0x2008cb,_0x38df6a,_0x17a4f8),_0x1b6d57={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x595b7d of _0x4b0966){_0x1b6d57[_0x3a6a81(0x1b2)]+=_0x595b7d[_0x3a6a81(0x1b2)],_0x1b6d57[_0x3a6a81(0x1a8)]+=_0x595b7d[_0x3a6a81(0x1a8)],_0x595b7d[_0x3a6a81(0x125)]&&_0x1b6d57[_0x3a6a81(0x1a3)][_0x3a6a81(0x1e9)](_0x595b7d[_0x3a6a81(0x125)][_0x3a6a81(0x13a)],_0x595b7d[_0x3a6a81(0x125)]['id']),_0x1b6d57[_0x3a6a81(0x1dd)]['created']+=_0x595b7d[_0x3a6a81(0x1dd)][_0x3a6a81(0x1b2)],_0x1b6d57['activations'][_0x3a6a81(0x1a8)]+=_0x595b7d[_0x3a6a81(0x1dd)]['updated'],_0x1b6d57[_0x3a6a81(0x1dd)]['deleted']+=_0x595b7d[_0x3a6a81(0x1dd)][_0x3a6a81(0x16b)];}return _0x1b6d57;}async function syncActivationsForSegment(_0x390196,_0x547951,_0x9ebf62,_0x504165,_0x26e8ea,_0x19dfc9,_0x51a9f7){const _0x56f002=a152_0xd184d4,_0xb6414={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x249bc6 of _0x26e8ea){try{if(_0x249bc6[_0x56f002(0x1e5)]===_0x56f002(0x128)&&_0x249bc6[_0x56f002(0x1a9)])_0x19dfc9[_0x56f002(0x167)]?.({'type':_0x56f002(0x120),'segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),await _0x19dfc9[_0x56f002(0x13e)](_0x56f002(0x1ff)+_0x249bc6[_0x56f002(0x13a)]+_0x56f002(0x13c),()=>_0x390196[_0x56f002(0x109)]['createActivation'](_0x547951,_0x9ebf62,_0x249bc6[_0x56f002(0x1a9)])),_0x19dfc9[_0x56f002(0x167)]?.({'type':'activation_created','segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),_0x19dfc9[_0x56f002(0x1f3)]?.(_0x56f002(0x113)+_0x249bc6[_0x56f002(0x13a)]+'\x27'),_0xb6414[_0x56f002(0x1b2)]++;else{if(_0x249bc6['type']==='update'&&_0x249bc6[_0x56f002(0x1a9)]&&_0x249bc6[_0x56f002(0x152)])_0x19dfc9['onProgress']?.({'type':'activation_updating','segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),await _0x19dfc9['withProgress'](_0x56f002(0x1b8)+_0x249bc6['name']+_0x56f002(0x13c),()=>_0x390196[_0x56f002(0x109)][_0x56f002(0x1be)](_0x547951,_0x9ebf62,_0x249bc6['existingActivation']['id'],_0x249bc6[_0x56f002(0x1a9)])),_0x19dfc9[_0x56f002(0x167)]?.({'type':_0x56f002(0x15a),'segmentName':_0x504165,'activationName':_0x249bc6['name']}),_0x19dfc9['logSuccess']?.(_0x56f002(0x10a)+_0x249bc6['name']+'\x27'),_0xb6414[_0x56f002(0x1a8)]++;else _0x249bc6[_0x56f002(0x1e5)]==='delete'&&_0x249bc6['existingActivation']&&(_0x19dfc9[_0x56f002(0x167)]?.({'type':'activation_deleting','segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),await _0x19dfc9[_0x56f002(0x13e)](_0x56f002(0x1ad)+_0x249bc6[_0x56f002(0x13a)]+_0x56f002(0x13c),()=>_0x390196[_0x56f002(0x109)][_0x56f002(0x1c3)](_0x547951,_0x9ebf62,_0x249bc6[_0x56f002(0x152)]['id'])),_0x19dfc9[_0x56f002(0x167)]?.({'type':_0x56f002(0x16e),'segmentName':_0x504165,'activationName':_0x249bc6[_0x56f002(0x13a)]}),_0x19dfc9[_0x56f002(0x170)]?.('Deleted\x20activation\x20\x27'+_0x249bc6[_0x56f002(0x13a)]+'\x27'),_0xb6414[_0x56f002(0x16b)]++);}}catch(_0x4ff354){const _0x3ad8f1=isHttp400Error(_0x4ff354),_0x956302=_0x3ad8f1?ErrorCode[_0x56f002(0x156)]:ErrorCode[_0x56f002(0x1a6)],_0x2d805a=getErrorMessage(_0x4ff354);throw new SDKError(_0x956302,_0x56f002(0x1e8)+_0x249bc6[_0x56f002(0x1e5)]+_0x56f002(0x118)+_0x249bc6['name']+_0x56f002(0x137)+_0x51a9f7+_0x56f002(0x107)+_0x2d805a,_0x4ff354);}}return _0xb6414;}export async function executePushFolders(_0x1e6aca,_0x235dd1,_0x26115d,_0x5f4a02,_0x10bf3c){const _0x2850f7=a152_0xd184d4,_0x4d3c72=new Map(_0x26115d),_0xbf76dd=sortFoldersByDepth(_0x235dd1);for(const _0x5c4c4a of _0xbf76dd){const _0x31af12=_0x5c4c4a[_0x2850f7(0x1f7)]('/'),_0x384356=_0x31af12[_0x31af12[_0x2850f7(0x169)]-0x1],_0x312ba2=_0x31af12['slice'](0x0,-0x1)[_0x2850f7(0x13b)]('/'),_0x25cc02=_0x4d3c72[_0x2850f7(0x181)](_0x312ba2);_0x10bf3c['onProgress']?.({'type':_0x2850f7(0x174),'folder':_0x5c4c4a});const _0x1433b9={'name':_0x384356,'parentFolderId':_0x25cc02},_0x28c54c=await _0x10bf3c[_0x2850f7(0x13e)](_0x2850f7(0x141)+_0x5c4c4a+_0x2850f7(0x13c),()=>_0x1e6aca[_0x2850f7(0x109)]['createFolder'](_0x5f4a02['parentId'],_0x1433b9));_0x4d3c72[_0x2850f7(0x1e9)](_0x5c4c4a,_0x28c54c['data']['id']),_0x10bf3c[_0x2850f7(0x167)]?.({'type':'folder_created','folder':_0x5c4c4a,'folderId':_0x28c54c[_0x2850f7(0x114)]['id']}),_0x10bf3c[_0x2850f7(0x1f9)]?.(_0x2850f7(0x1cc)+_0x5c4c4a+'\x27');}return _0x4d3c72;}export async function executePushSegmentDeletions(_0x390f93,_0x5f027e,_0x672a6a){const _0x4dd317=a152_0xd184d4;if(_0x5f027e[_0x4dd317(0x169)]===0x0)return 0x0;const {batchAsync:_0xab4ecc}=await import(_0x4dd317(0x132)),_0x18ab31=0x5,_0x2cf664=await _0xab4ecc(_0x5f027e,async _0x4014e0=>{const _0x194f25=_0x4dd317;return _0x672a6a[_0x194f25(0x167)]?.({'type':_0x194f25(0x186),'name':_0x4014e0[_0x194f25(0x13a)]}),await _0x390f93['segment'][_0x194f25(0x147)](_0x4014e0['id']),_0x672a6a['onProgress']?.({'type':_0x194f25(0x1aa),'name':_0x4014e0['name']}),_0x672a6a[_0x194f25(0x170)]?.(_0x194f25(0x1bf)+_0x4014e0[_0x194f25(0x13a)]+'\x27'),0x1;},_0x18ab31);return _0x2cf664[_0x4dd317(0x145)]((_0x1615d3,_0x1d4cef)=>_0x1615d3+_0x1d4cef,0x0);}export async function executePushJourneys(_0x16a9ca,_0xb28120,_0x5694c6,_0x627012,_0x3573fb){const _0x3e2668=a152_0xd184d4,{journeyDefToRequest:_0x1fe269}=await import(_0x3e2668(0x204)),{activationDefToCreateRequest:_0x45368f,yamlRuleToApi:_0x20c9c4,validateSegmentRule:_0x1bf686}=await import(_0x3e2668(0x1cd)),_0x4ca4e7={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x196f38=new Map(_0x5694c6[_0x3e2668(0x1b5)]),_0x267981=0x5;for(let _0x17249a=0x0;_0x17249a<_0xb28120[_0x3e2668(0x169)];_0x17249a+=_0x267981){const _0x4a6991=_0xb28120[_0x3e2668(0x175)](_0x17249a,_0x17249a+_0x267981),_0x2a2932=await Promise['all'](_0x4a6991[_0x3e2668(0x1b6)](async _0x1a57c9=>{const _0x47c9ea=_0x3e2668;if(!_0x1a57c9[_0x47c9ea(0x1da)]&&!_0x1a57c9[_0x47c9ea(0x1d2)])return{'action':_0x47c9ea(0x103),'name':_0x1a57c9[_0x47c9ea(0x106)][_0x47c9ea(0x13a)],'journeyId':_0x1a57c9[_0x47c9ea(0x1e3)]?.['id']};const _0x5deeee=_0x1a57c9[_0x47c9ea(0x1cb)]?_0x5694c6[_0x47c9ea(0x1c4)][_0x47c9ea(0x181)](_0x1a57c9[_0x47c9ea(0x1cb)]):undefined;_0x3573fb[_0x47c9ea(0x167)]?.({'type':_0x1a57c9[_0x47c9ea(0x1da)]?_0x47c9ea(0x1ef):_0x47c9ea(0x17b),'name':_0x1a57c9['yamlConfig'][_0x47c9ea(0x13a)]});try{const _0x7260a=await executeSingleJourneyPush(_0x16a9ca,_0x1a57c9,{..._0x5694c6,'segmentNameToId':_0x196f38},{'parentId':_0x627012[_0x47c9ea(0x192)],'rootFolderId':_0x627012[_0x47c9ea(0x1e2)],'folderId':_0x5deeee,'verbose':_0x627012['verbose']},_0x3573fb,{'journeyDefToRequest':_0x1fe269,'activationDefToCreateRequest':_0x45368f,'yamlRuleToApi':_0x20c9c4,'validateSegmentRule':_0x1bf686});for(const [_0x581e80,_0x4e8717]of _0x7260a[_0x47c9ea(0x1c9)]){_0x196f38['set'](_0x581e80,_0x4e8717),_0x4ca4e7[_0x47c9ea(0x1c9)]['set'](_0x581e80,_0x4e8717);}if(_0x7260a['action']===_0x47c9ea(0x1b2))_0x3573fb[_0x47c9ea(0x167)]?.({'type':_0x47c9ea(0x143),'name':_0x1a57c9[_0x47c9ea(0x106)]['name'],'journeyId':_0x7260a[_0x47c9ea(0x1ee)]}),_0x3573fb[_0x47c9ea(0x1f3)]?.(_0x47c9ea(0x184)+_0x1a57c9[_0x47c9ea(0x106)][_0x47c9ea(0x13a)]+'\x27'),_0x4ca4e7['created']++;else _0x7260a['action']===_0x47c9ea(0x1a8)&&(_0x3573fb[_0x47c9ea(0x167)]?.({'type':_0x47c9ea(0x19e),'name':_0x1a57c9['yamlConfig'][_0x47c9ea(0x13a)]}),_0x3573fb[_0x47c9ea(0x1f3)]?.(_0x47c9ea(0x127)+_0x1a57c9['yamlConfig'][_0x47c9ea(0x13a)]+'\x27'),_0x4ca4e7[_0x47c9ea(0x1a8)]++);return{'action':_0x7260a[_0x47c9ea(0x18b)],'name':_0x1a57c9[_0x47c9ea(0x106)][_0x47c9ea(0x13a)],'journeyId':_0x7260a[_0x47c9ea(0x1ee)]};}catch(_0x29b1d8){const _0x1f2a53=isHttp400Error(_0x29b1d8),_0x2e2ab7=_0x1f2a53?ErrorCode[_0x47c9ea(0x173)]:ErrorCode[_0x47c9ea(0x197)],_0x39d632=getErrorMessage(_0x29b1d8);throw new SDKError(_0x2e2ab7,'Failed\x20to\x20'+(_0x1a57c9['isNew']?'create':_0x47c9ea(0x159))+'\x20journey\x20from\x20file:\x20'+_0x1a57c9[_0x47c9ea(0x10b)]+'\x0a\x20\x20'+_0x39d632,_0x29b1d8);}}));_0x4ca4e7[_0x3e2668(0x16a)][_0x3e2668(0x1f4)](..._0x2a2932);}return _0x4ca4e7;}async function matchExistingJourneySegments(_0x4cf040,_0x5d9d2d,_0x591d8d,_0x2aa1b2,_0x1cb24){const _0x54214f=a152_0xd184d4;if(!_0x5d9d2d[_0x54214f(0x1e3)]||!_0x5d9d2d[_0x54214f(0x106)][_0x54214f(0x17e)])return;const _0x5cb616=new Map(),_0x6eded0=new Set();for(const _0x539311 of Object[_0x54214f(0x1a2)](_0x5d9d2d[_0x54214f(0x106)][_0x54214f(0x17e)])){const _0x815db7=generateDeterministicJourneySegmentName(_0x5d9d2d[_0x54214f(0x106)]['name'],_0x539311);_0x5cb616[_0x54214f(0x1e9)](_0x815db7,_0x539311),_0x6eded0[_0x54214f(0x1e4)](_0x539311);}const _0x4893df=[],_0x1c0b7b=collectSegmentIdsFromJourneyApi(_0x5d9d2d[_0x54214f(0x1e3)]);for(const _0x1f710a of _0x1c0b7b){const _0x36a14f=await fetchSegment(_0x4cf040,_0x591d8d,_0x1f710a,_0x2aa1b2);if(!_0x36a14f?.[_0x54214f(0x13a)])continue;const _0x584e03=_0x5cb616['get'](_0x36a14f[_0x54214f(0x13a)]);_0x584e03?(_0x1cb24[_0x54214f(0x1e9)](_0x584e03,_0x1f710a),_0x6eded0['delete'](_0x584e03)):_0x4893df[_0x54214f(0x1f4)]({'id':_0x1f710a,'seg':_0x36a14f});}if(_0x6eded0[_0x54214f(0x1e7)]>0x0&&_0x4893df[_0x54214f(0x169)]>0x0){const {localExpandedRuleToNames:_0x395f11}=buildLocalExpandedRuleMappings(_0x5d9d2d[_0x54214f(0x106)]),_0x393735=new Map();for(const {id:_0xbeb679,seg:_0x52abe6}of _0x4893df){if(_0x52abe6['rule']){const _0x1485e3=apiRuleToYaml(_0x52abe6[_0x54214f(0x202)]);_0x393735['set'](_0xbeb679,_0x1485e3);}}for(const {id:_0x34e76a,seg:_0x5dbde1}of _0x4893df){if(!_0x5dbde1['rule'])continue;const _0x4e688d=_0x393735[_0x54214f(0x181)](_0x34e76a);if(!_0x4e688d)continue;const _0x1f06e7=serializeExpandedRule(_0x4e688d,_0x393735),_0x599262=_0x395f11['get'](_0x1f06e7);if(_0x599262){const _0x2c5fca=_0x599262[_0x54214f(0x179)](_0xdd4156=>_0x6eded0[_0x54214f(0x18e)](_0xdd4156));_0x2c5fca&&(_0x1cb24[_0x54214f(0x1e9)](_0x2c5fca,_0x34e76a),_0x6eded0[_0x54214f(0x1b4)](_0x2c5fca),logger[_0x54214f(0x17c)]('Matched\x20server\x20segment\x20\x27'+_0x5dbde1[_0x54214f(0x13a)]+'\x27\x20to\x20local\x20\x27'+_0x2c5fca+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x4a2454,_0x424962,_0x5db0d3,_0x483355,_0x5eb053,_0x43abda){const _0x31f72c=a152_0xd184d4,{journeyDefToRequest:_0x4f0860,activationDefToCreateRequest:_0x56e4f6,yamlRuleToApi:_0x52a130,validateSegmentRule:_0x230770}=_0x43abda,_0x1c7e1d=new Map(),_0x549b9f=new Map();recoverSegmentIdsFromPushRecovery(_0x424962,_0x1c7e1d,_0x5db0d3[_0x31f72c(0x1b5)]);const _0x4d249e=new Map(),_0x4b7eb0=new Map(),_0x50508f=new Map();let _0xb6ade0;const _0x4cf3e1=async()=>{const _0x313d94=_0x31f72c;if(_0xb6ade0)return;_0xb6ade0=new Map();if(!_0x424962['existingJourney'])return;const _0x4e32ac=await _0x4a2454[_0x313d94(0x1d4)][_0x313d94(0x133)](_0x424962[_0x313d94(0x1e3)]['id']);for(const _0x2d55de of _0x4e32ac){const _0x208c9c=journeyActivationStepToYaml(_0x2d55de,_0x5db0d3[_0x313d94(0x12c)],_0x5db0d3[_0x313d94(0x12e)]),_0x164fab=activationSignature(_0x208c9c);!_0xb6ade0['has'](_0x164fab)&&_0xb6ade0[_0x313d94(0x1e9)](_0x164fab,_0x2d55de['id']),_0x208c9c[_0x313d94(0x13a)]&&_0x549b9f[_0x313d94(0x1e9)](_0x208c9c[_0x313d94(0x13a)],_0x2d55de['id']);}};await matchExistingJourneySegments(_0x4a2454,_0x424962,_0x483355[_0x31f72c(0x192)],_0x5db0d3[_0x31f72c(0x140)],_0x5db0d3[_0x31f72c(0x1b5)]);const _0x5c068e={'resolveSegmentId':async _0x363e33=>{const _0x5ed6f4=_0x31f72c,_0x5647bd=_0x5db0d3[_0x5ed6f4(0x1b5)][_0x5ed6f4(0x181)](_0x363e33);if(!_0x5647bd)throw new SDKError(ErrorCode[_0x5ed6f4(0x1d3)],'Segment\x20not\x20found:\x20'+_0x363e33+_0x5ed6f4(0x190)+_0x424962[_0x5ed6f4(0x106)][_0x5ed6f4(0x13a)]+')');return _0x5647bd;},'resolveEmbeddedSegmentId':async(_0x55a64d,_0x1d525b)=>{const _0x431820=_0x31f72c,_0x515030=_0x5db0d3['segmentNameToId'][_0x431820(0x181)](_0x55a64d);if(_0x515030)return _0x515030;const _0x591cb9=_0x5db0d3['existingSegments']['find'](_0x2fae0d=>_0x2fae0d['name']===_0x55a64d);if(_0x591cb9)return _0x5db0d3[_0x431820(0x1b5)][_0x431820(0x1e9)](_0x55a64d,_0x591cb9['id']),_0x591cb9['id'];if(_0x424962[_0x431820(0x1da)]){const {stageName:_0x46b74a,criteriaName:_0x18e80c}=findSegmentCriteriaLocation(_0x424962[_0x431820(0x106)],_0x55a64d);return _0x230770(_0x55a64d,_0x1d525b[_0x431820(0x202)]),_0x4b7eb0['set'](_0x55a64d,{'definition':_0x1d525b,'stageName':_0x46b74a,'criteriaName':_0x18e80c}),createPendingSegmentId(_0x55a64d);}const _0x22b0e7=_0x424962[_0x431820(0x1e3)]?.['id'];if(!_0x22b0e7)throw new SDKError(ErrorCode[_0x431820(0x15d)],_0x431820(0x1d5));const _0xa09ef4=_0x4d249e['get'](_0x55a64d);if(_0xa09ef4)return _0xa09ef4;const _0x40c4ee=((async()=>{const _0x557ef5=_0x431820;_0x230770(_0x55a64d,_0x1d525b[_0x557ef5(0x202)]);const _0x15f74d=generateDeterministicJourneySegmentName(_0x424962[_0x557ef5(0x106)][_0x557ef5(0x13a)],_0x55a64d),_0x236c3c=_0x5db0d3[_0x557ef5(0x140)][_0x557ef5(0x179)](_0x352818=>_0x352818[_0x557ef5(0x13a)]===_0x15f74d),_0x39bec4=createSegmentIdResolver(_0x5db0d3['segmentNameToId'],_0x55a64d),_0x55cd4d=await resolveRuleSegmentIds(_0x1d525b[_0x557ef5(0x202)],_0x39bec4);let _0x327b97;return _0x236c3c?(await _0x4a2454[_0x557ef5(0x109)][_0x557ef5(0x124)](_0x483355['parentId'],_0x236c3c['id'],{'description':_0x1d525b[_0x557ef5(0x168)]||'Entry\x20criteria:\x20'+_0x55a64d,'rule':_0x52a130(_0x55cd4d),'countPopulation':!![]}),_0x327b97=_0x236c3c['id'],saveSegmentToPushRecovery(_0x424962[_0x557ef5(0x10b)],_0x424962['yamlConfig']['name'],_0x55a64d,{'segmentId':_0x327b97,'uniqueServerName':_0x15f74d,'createdAt':new Date()[_0x557ef5(0x15f)]()})):_0x327b97=await createOrRecoverEmbeddedSegment(_0x4a2454,_0x424962,{'localName':_0x55a64d,'uniqueSegmentName':_0x15f74d,'description':_0x1d525b[_0x557ef5(0x168)]||_0x557ef5(0x1a1)+_0x55a64d,'journeyId':_0x22b0e7,'resolvedRule':_0x55cd4d,'parentId':_0x483355[_0x557ef5(0x192)],'folderId':_0x483355['rootFolderId']||''},_0x52a130),_0x5db0d3[_0x557ef5(0x1b5)]['set'](_0x55a64d,_0x327b97),_0x1c7e1d[_0x557ef5(0x1e9)](_0x55a64d,_0x327b97),_0x327b97;})());_0x4d249e[_0x431820(0x1e9)](_0x55a64d,_0x40c4ee);try{return await _0x40c4ee;}finally{_0x4d249e['delete'](_0x55a64d);}},'resolveActivationId':async _0x2cd766=>{const _0x2c6c57=_0x31f72c,_0x22e73e=_0x549b9f[_0x2c6c57(0x181)](_0x2cd766);if(_0x22e73e)return _0x22e73e;if(_0x424962[_0x2c6c57(0x1e3)]){await _0x4cf3e1();const _0x1a9680=_0x549b9f[_0x2c6c57(0x181)](_0x2cd766);if(_0x1a9680)return _0x1a9680;}throw new SDKError(ErrorCode['NOT_FOUND'],_0x2c6c57(0x12b)+_0x2cd766+_0x2c6c57(0x190)+_0x424962[_0x2c6c57(0x106)]['name']+_0x2c6c57(0x1e0)+_0x2c6c57(0x1eb));},'resolveEmbeddedActivationId':async(_0x279269,_0x24ebba)=>{const _0x47f4c4=_0x31f72c,_0x3c6fe6=_0x549b9f[_0x47f4c4(0x181)](_0x279269);if(_0x3c6fe6)return _0x3c6fe6;if(_0x424962[_0x47f4c4(0x1da)])return _0x50508f[_0x47f4c4(0x1e9)](_0x279269,_0x24ebba),createPendingActivationId(_0x279269);if(_0x424962[_0x47f4c4(0x1e3)]){await _0x4cf3e1();const _0x2a0a73=_0x549b9f[_0x47f4c4(0x181)](_0x24ebba[_0x47f4c4(0x13a)]);if(_0x2a0a73)return _0x549b9f[_0x47f4c4(0x1e9)](_0x279269,_0x2a0a73),_0x2a0a73;const _0x1c5398=activationSignature(_0x24ebba),_0x5eb017=_0xb6ade0?.[_0x47f4c4(0x181)](_0x1c5398);if(_0x5eb017)return _0x549b9f['set'](_0x279269,_0x5eb017),_0x5eb017;const _0x3f66d8=await _0x56e4f6(_0x24ebba,_0x5db0d3[_0x47f4c4(0x1bc)]),_0x248f1b={..._0x3f66d8,..._0x24ebba[_0x47f4c4(0x153)]!==undefined&&{'runAfterJourneyRefresh':_0x24ebba['run_after_journey_refresh']}},_0x1827ca=await _0x4a2454[_0x47f4c4(0x1d4)][_0x47f4c4(0x209)](_0x424962[_0x47f4c4(0x1e3)]['id'],_0x248f1b);return _0x549b9f['set'](_0x279269,_0x1827ca['id']),_0x1827ca['id'];}throw new SDKError(ErrorCode[_0x47f4c4(0x15d)],_0x47f4c4(0x122));},'resolveJourneyId':async _0x3ae68f=>{const _0x570e6e=_0x31f72c;try{return await _0x4a2454[_0x570e6e(0x1d4)]['resolveJourneyId'](_0x483355[_0x570e6e(0x192)],_0x3ae68f);}catch(_0x28bb98){throw new SDKError(ErrorCode[_0x570e6e(0x1c0)],_0x570e6e(0x1c7)+_0x3ae68f+_0x570e6e(0x17f)+_0x424962[_0x570e6e(0x106)][_0x570e6e(0x13a)]+'\x27)',_0x28bb98);}},'resolveStageId':async(_0x359f90,_0x22f14e)=>{const _0xf4d9b6=_0x31f72c,_0x5e409f=await _0x4a2454[_0xf4d9b6(0x1d4)][_0xf4d9b6(0x198)](_0x359f90),_0x2555dd=_0x5e409f[_0xf4d9b6(0x171)][_0xf4d9b6(0x131)][_0xf4d9b6(0x179)](_0x5bc8d2=>_0x5bc8d2['name'][_0xf4d9b6(0x12f)]()===_0x22f14e[_0xf4d9b6(0x12f)]());if(!_0x2555dd?.['id'])throw new SDKError(ErrorCode[_0xf4d9b6(0x1c0)],_0xf4d9b6(0x130)+_0x22f14e+_0xf4d9b6(0x1fe)+(_0x5e409f[_0xf4d9b6(0x171)][_0xf4d9b6(0x1a4)]||_0x5e409f[_0xf4d9b6(0x171)]['name'])+'\x27');return _0x2555dd['id'];}},_0x366bd7=await _0x4f0860(_0x424962[_0x31f72c(0x106)],_0x483355[_0x31f72c(0x192)],_0x5c068e),_0x436501=_0x483355['folderId']||_0x483355[_0x31f72c(0x1e2)];_0x436501&&(_0x366bd7[_0x31f72c(0x1b1)]={'parentFolder':{'data':{'id':_0x436501,'type':_0x31f72c(0x1db)}}});if(_0x424962['isNew']){if(_0x4b7eb0['size']>0x0||_0x50508f['size']>0x0)return await executeThreeStepJourneyCreate(_0x4a2454,_0x424962,_0x366bd7,{'pendingEmbeddedSegments':_0x4b7eb0,'pendingEmbeddedActivations':_0x50508f,'embeddedSegmentNameToId':_0x1c7e1d,'journeyActivationNameToId':_0x549b9f},{..._0x483355,'effectiveFolderId':_0x436501},_0x5db0d3,_0x5eb053,_0x43abda);else{ensureJourneyDefaults(_0x366bd7[_0x31f72c(0x171)]);const _0x2d4cbc=await _0x4a2454[_0x31f72c(0x1d4)]['create'](_0x366bd7);return deletePushRecovery(_0x424962[_0x31f72c(0x10b)]),{'action':_0x31f72c(0x1b2),'journeyId':_0x2d4cbc['id'],'embeddedSegmentNameToId':_0x1c7e1d};}}else{if(_0x424962[_0x31f72c(0x1d2)]&&_0x424962['existingJourney']){_0x366bd7['id']=_0x424962[_0x31f72c(0x1e3)]['id'];const _0x5b35ff=_0x366bd7[_0x31f72c(0x171)];_0x424962['existingJourney']['attributes']?.[_0x31f72c(0x1a4)]&&(_0x5b35ff['journeyBundleName']=_0x424962[_0x31f72c(0x1e3)][_0x31f72c(0x171)][_0x31f72c(0x1a4)]);const _0x13b51a=_0x424962['existingJourney'][_0x31f72c(0x171)]?.[_0x31f72c(0x131)];return _0x13b51a&&_0x366bd7[_0x31f72c(0x171)]['journeyStages']&&injectExistingStageIds(_0x366bd7[_0x31f72c(0x171)]['journeyStages'],_0x13b51a),ensureJourneyDefaults(_0x5b35ff),await _0x4a2454[_0x31f72c(0x1d4)][_0x31f72c(0x159)](_0x424962[_0x31f72c(0x1e3)]['id'],_0x366bd7),deletePushRecovery(_0x424962['absolutePath']),{'action':_0x31f72c(0x1a8),'journeyId':_0x424962['existingJourney']['id'],'embeddedSegmentNameToId':_0x1c7e1d};}}return deletePushRecovery(_0x424962[_0x31f72c(0x10b)]),{'action':_0x31f72c(0x103),'journeyId':_0x424962[_0x31f72c(0x1e3)]?.['id'],'embeddedSegmentNameToId':_0x1c7e1d};}function findSegmentCriteriaLocation(_0x5ea51d,_0x1a7c46){const _0x1844b4=a152_0xd184d4,_0x462f3f=_0x5ea51d[_0x1844b4(0x110)]||_0x5ea51d[_0x1844b4(0x1a7)]?.[0x0]?.[_0x1844b4(0x110)]||[];let _0x17253f=_0x1844b4(0x12d),_0xc5ace=_0x1a7c46;const _0x65c30a=_0x5ea51d['goal']||_0x5ea51d[_0x1844b4(0x1a7)]?.[0x0]?.[_0x1844b4(0x1f0)];if(_0x65c30a?.['segment']===_0x1a7c46)return{'stageName':_0x1844b4(0x1f0),'criteriaName':_0x65c30a['name']||_0x1a7c46};_0x51b577:for(const _0x1c10f0 of _0x462f3f){if(_0x1c10f0[_0x1844b4(0x117)]?.[_0x1844b4(0x109)]===_0x1a7c46){_0x17253f=_0x1c10f0[_0x1844b4(0x13a)],_0xc5ace=_0x1c10f0[_0x1844b4(0x117)][_0x1844b4(0x13a)]||_0x1a7c46;break;}if(_0x1c10f0[_0x1844b4(0x14d)])for(const _0x2ae9a3 of _0x1c10f0[_0x1844b4(0x14d)]){if(_0x2ae9a3[_0x1844b4(0x1e5)]===_0x1844b4(0x14a)&&_0x2ae9a3[_0x1844b4(0x164)]?.[_0x1844b4(0x196)])for(const _0x36d023 of _0x2ae9a3[_0x1844b4(0x164)][_0x1844b4(0x196)]){if(_0x36d023['segment']===_0x1a7c46){_0x17253f=_0x1c10f0[_0x1844b4(0x13a)],_0xc5ace=_0x36d023[_0x1844b4(0x13a)]||_0x1a7c46;break _0x51b577;}}}}return{'stageName':_0x17253f,'criteriaName':_0xc5ace};}async function executeThreeStepJourneyCreate(_0x428729,_0x373b10,_0x5dcc0f,_0xdfaba,_0x5b8c01,_0x4a3416,_0x464907,_0x4792dc){const _0x4fe394=a152_0xd184d4,{activationDefToCreateRequest:_0x278e4a,yamlRuleToApi:_0x1c1c3c}=_0x4792dc,{pendingEmbeddedSegments:_0x385f20,pendingEmbeddedActivations:_0x591144,embeddedSegmentNameToId:_0xdb4e1d}=_0xdfaba,_0x5f2bd5=JSON[_0x4fe394(0x111)](JSON[_0x4fe394(0x142)](_0x5dcc0f));ensureJourneyDefaults(_0x5f2bd5[_0x4fe394(0x171)]),stripPendingIds(_0x5f2bd5);const _0x3f3df0=await _0x428729[_0x4fe394(0x1d4)][_0x4fe394(0x128)](_0x5f2bd5),_0x396783=_0x3f3df0['id'],_0x275c16=new Map();for(const _0xe2c5c6 of _0x3f3df0[_0x4fe394(0x171)][_0x4fe394(0x131)]){_0x275c16[_0x4fe394(0x1e9)](_0xe2c5c6[_0x4fe394(0x13a)][_0x4fe394(0x12f)](),_0xe2c5c6['id']);}recoverSegmentIdsFromPushRecovery(_0x373b10,_0xdb4e1d,_0x4a3416[_0x4fe394(0x1b5)]);for(const [_0x17bd56,{definition:_0xb127ae}]of _0x385f20){if(_0xdb4e1d[_0x4fe394(0x18e)](_0x17bd56)){_0x464907['onProgress']?.({'type':'embedded_segment_created','journeyName':_0x373b10['yamlConfig'][_0x4fe394(0x13a)],'segmentName':_0x17bd56});continue;}const _0x9b52de=generateDeterministicJourneySegmentName(_0x373b10['yamlConfig'][_0x4fe394(0x13a)],_0x17bd56);_0x464907[_0x4fe394(0x167)]?.({'type':_0x4fe394(0x16c),'journeyName':_0x373b10[_0x4fe394(0x106)]['name'],'segmentName':_0x17bd56});const _0x5c3398=createSegmentIdResolver(_0x4a3416[_0x4fe394(0x1b5)],_0x17bd56),_0x2118a5=await resolveRuleSegmentIds(_0xb127ae[_0x4fe394(0x202)],_0x5c3398),_0x151348=await createOrRecoverEmbeddedSegment(_0x428729,_0x373b10,{'localName':_0x17bd56,'uniqueSegmentName':_0x9b52de,'description':_0xb127ae['description']||_0x4fe394(0x1a1)+_0x17bd56,'journeyId':_0x396783,'resolvedRule':_0x2118a5,'parentId':_0x5b8c01[_0x4fe394(0x192)],'folderId':_0x5b8c01['effectiveFolderId']||''},_0x1c1c3c);_0xdb4e1d[_0x4fe394(0x1e9)](_0x17bd56,_0x151348),_0x4a3416[_0x4fe394(0x1b5)][_0x4fe394(0x1e9)](_0x17bd56,_0x151348),_0x464907[_0x4fe394(0x167)]?.({'type':_0x4fe394(0x15b),'journeyName':_0x373b10[_0x4fe394(0x106)][_0x4fe394(0x13a)],'segmentName':_0x17bd56});}const _0x77ba05=new Map();for(const [_0x4bde27,_0x12d130]of _0x591144){_0x464907['onProgress']?.({'type':'embedded_activation_creating','journeyName':_0x373b10[_0x4fe394(0x106)][_0x4fe394(0x13a)],'activationName':_0x4bde27});const _0x2eb684=await _0x278e4a(_0x12d130,_0x4a3416[_0x4fe394(0x1bc)]),_0x2d1a00={..._0x2eb684,..._0x12d130[_0x4fe394(0x153)]!==undefined&&{'runAfterJourneyRefresh':_0x12d130['run_after_journey_refresh']}},_0x30a56c=await _0x428729[_0x4fe394(0x1d4)][_0x4fe394(0x209)](_0x396783,_0x2d1a00);_0x77ba05[_0x4fe394(0x1e9)](_0x4bde27,_0x30a56c['id']),_0xdfaba[_0x4fe394(0x1b0)][_0x4fe394(0x1e9)](_0x4bde27,_0x30a56c['id']),_0x464907['onProgress']?.({'type':_0x4fe394(0x208),'journeyName':_0x373b10[_0x4fe394(0x106)][_0x4fe394(0x13a)],'activationName':_0x4bde27});}const _0x1503c2=JSON['parse'](JSON[_0x4fe394(0x142)](_0x5dcc0f));return _0x1503c2['id']=_0x396783,ensureJourneyDefaults(_0x1503c2[_0x4fe394(0x171)]),resolvePendingIdsInRequest(_0x1503c2,_0x5dcc0f,_0x275c16,_0xdb4e1d,_0x77ba05,_0x464907),await _0x428729[_0x4fe394(0x1d4)][_0x4fe394(0x159)](_0x396783,_0x1503c2),deletePushRecovery(_0x373b10[_0x4fe394(0x10b)]),{'action':_0x4fe394(0x1b2),'journeyId':_0x396783,'embeddedSegmentNameToId':_0xdb4e1d};}export function stripWaitStepPendingIds(_0xbc464a){const _0x420ff2=a152_0xd184d4,_0x37c292=_0xbc464a['conditionSegmentId']&&isPendingSegmentId(_0xbc464a[_0x420ff2(0x14f)]),_0x597144=_0xbc464a[_0x420ff2(0x138)]?.[_0x420ff2(0x166)](_0x54eade=>_0x54eade['segmentId']&&isPendingSegmentId(_0x54eade[_0x420ff2(0x18c)]));(_0x37c292||_0x597144)&&(_0xbc464a[_0x420ff2(0x1e6)]=_0x420ff2(0x176),_0xbc464a[_0x420ff2(0x119)]=0x1,_0xbc464a[_0x420ff2(0x191)]=_0x420ff2(0x1ec),delete _0xbc464a[_0x420ff2(0x14f)],delete _0xbc464a['conditionTimeoutDuration'],delete _0xbc464a[_0x420ff2(0x15e)],delete _0xbc464a[_0x420ff2(0x138)]);}function a152_0x3907(){const _0x14cbd3=['filter','Delete\x20the\x20push\x20recovery\x20file\x20(','embedded_activation_created','createActivation','includes','unchanged','124326SyiXYS','segmentByFolderAndName','yamlConfig','\x0a\x20\x20','segment_updating','segment','Updated\x20activation\x20\x27','absolutePath','draft','Activation','activationStepsById','journeyBundleId','stages','parse','max','Created\x20activation\x20\x27','data','stage\x20\x27','segment_updated','entry_criteria','\x20activation\x20\x27','waitStep','connection','1114320QhxsMn','activationActions','schedule','digest','265406YpAOJr','activation_creating','all','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','getActivation','updateSegmentById','createdSegmentId','__pending_','Updated\x20journey\x20\x27','create','existingSegment','startsWith','Activation\x20not\x20found:\x20','idToEmailMap','entry','connectionIdToNameMap','toLowerCase','Stage\x20\x27','journeyStages','../../utils/async.js','listActivations','conditionTimeoutDuration','sha1','index','\x27\x20from\x20file:\x20','conditions','state','name','join','\x27...','getSegment','withProgress','skipSegments','existingSegments','Creating\x20folder\x20\x27','stringify','journey_created','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','reduce','deps','deleteSegment','getLatestJourneyId','\x20segment\x20from\x20file:\x20','decision_point','idToName','activation_template_id','steps','all_columns','conditionSegmentId','30964RkHmDS','Name\x20has\x20already\x20been\x20taken','existingActivation','run_after_journey_refresh','trim','journeyBundlesByFolderAndName','ACTIVATION_SYNTAX_ERROR','milestone','Updated\x20segment\x20\x27','update','activation_updated','embedded_segment_created','item','INTERNAL','conditionTimeoutUnit','toISOString','segmentFolderId','SEGMENT_UPDATE_ERROR','entryCriteria','dirname','with','logWarning','some','onProgress','description','length','results','deleted','embedded_segment_creating','yamlActivation','activation_deleted','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','logDeleted','attributes','\x27\x20milestone','JOURNEY_SYNTAX_ERROR','folder_creating','slice','Duration','match','Condition','find','.$1.push-recovery.json','journey_updating','debug','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','segments','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','Failed\x20to\x20resolve\x20segment\x20','get','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','\x27\x20decision\x20point\x20branch\x20\x27','Created\x20journey\x20\x27','\x27\x20exit\x20criteria','segment_deleting','exitCriterias','getSegmentEntity','message','journeyActivationStepId','action','segmentId','sort','has','Embedded\x20segment\x20\x27','\x20(referenced\x20in\x20journey\x20','waitStepUnit','parentId','3774570YuBdnS','uniqueServerName','parseDocument','branches','JOURNEY_UPDATE_ERROR','getJourney','from','folderId','activationParams','diff','Created\x20segment\x20\x27','journey_updated','createSegment','segment_created','Entry\x20criteria:\x20','keys','createdSegmentIds','journeyBundleName','uniqueSegmentName','ACTIVATION_UPDATE_ERROR','journeys','updated','validatedRequest','segment_deleted','journeyName','\x27\x20entry\x20criteria','Deleting\x20activation\x20\x27','192QWjvoo','journeyById','journeyActivationNameToId','relationships','created','Failed\x20to\x20fetch\x20referenced\x20segment\x20','delete','segmentNameToId','map','14027562lpRiZl','Updating\x20activation\x20\x27','resolvedRule','null','isArray','activationContext','flatMap','updateActivation','Deleted\x20segment\x20\x27','NOT_FOUND','DecisionPoint','replace','deleteActivation','folderPathToId','resolveSegment','notification','Journey\x20\x27','versionNumber','embeddedSegmentNameToId','fetchJourney','folderPath','Created\x20folder\x20\x27','./child-segment-yaml.js','getSegmentEntity\x20also\x20failed\x20for\x20','):\x20','Fetching\x20','object','hasChanges','SEGMENT_NOT_FOUND','journey','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','351yHDKUZ','185619OcmzpY','\x27\x20for\x20','__pending_act_','isNew','folder','Segment\x20not\x20found:\x20','activations','segment_creating',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20',').\x20','user','rootFolderId','existingJourney','add','type','waitStepType','size','Failed\x20to\x20','set','utf-8','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','day','hex','journeyId','journey_creating','goal','entries','errors','logSuccess','push','toString','parentSegmentFolder','split','behavior','logInfo','valid','\x27\x20wait\x20condition','progress','kind','\x27\x20not\x20found\x20in\x20journey\x20\x27','Creating\x20activation\x20\x27','WaitStep','Updating\x20segment\x20\x27','rule','values','./journey-yaml.js','localName'];a152_0x3907=function(){return _0x14cbd3;};return a152_0x3907();}export function resolveWaitStepPendingIds(_0x488fa9,_0xd6aa1f,_0x1bac2a,_0x5b48e0){const _0x218645=a152_0xd184d4;if(_0xd6aa1f[_0x218645(0x14f)]&&isPendingSegmentId(_0xd6aa1f[_0x218645(0x14f)])){const _0x462e23=_0x1bac2a(_0xd6aa1f[_0x218645(0x14f)],_0x218645(0x115)+_0x5b48e0+'\x27\x20wait\x20condition');_0x462e23&&(_0x488fa9[_0x218645(0x1e6)]=_0x218645(0x178),_0x488fa9[_0x218645(0x14f)]=_0x462e23,delete _0x488fa9['waitStep'],delete _0x488fa9[_0x218645(0x191)],_0xd6aa1f[_0x218645(0x134)]!==undefined&&(_0x488fa9[_0x218645(0x134)]=_0xd6aa1f['conditionTimeoutDuration']),_0xd6aa1f[_0x218645(0x15e)]&&(_0x488fa9['conditionTimeoutUnit']=_0xd6aa1f[_0x218645(0x15e)]));}if(_0xd6aa1f['conditions']){const _0x48d44b=_0xd6aa1f[_0x218645(0x138)][_0x218645(0x166)](_0x5acb48=>_0x5acb48[_0x218645(0x18c)]&&isPendingSegmentId(_0x5acb48[_0x218645(0x18c)]));if(_0x48d44b){const _0x293400=_0xd6aa1f[_0x218645(0x138)][_0x218645(0x1b6)](_0x991454=>{const _0x866212=_0x218645;if(_0x991454[_0x866212(0x18c)]&&isPendingSegmentId(_0x991454[_0x866212(0x18c)])){const _0x4e72bd=_0x1bac2a(_0x991454[_0x866212(0x18c)],_0x866212(0x115)+_0x5b48e0+_0x866212(0x1fb));return{..._0x991454,'segmentId':_0x4e72bd||_0x991454[_0x866212(0x18c)]};}return{..._0x991454};});_0x488fa9[_0x218645(0x1e6)]='Condition',_0x488fa9['conditions']=_0x293400,delete _0x488fa9[_0x218645(0x119)],delete _0x488fa9[_0x218645(0x191)],delete _0x488fa9[_0x218645(0x14f)],delete _0x488fa9[_0x218645(0x134)],delete _0x488fa9[_0x218645(0x15e)];}}}function stripPendingIds(_0x91ef68){const _0xdda16f=a152_0xd184d4;_0x91ef68['attributes'][_0xdda16f(0x1f0)]?.['segmentId']&&isPendingSegmentId(_0x91ef68['attributes'][_0xdda16f(0x1f0)][_0xdda16f(0x18c)])&&delete _0x91ef68['attributes']['goal'];for(const _0x3bc338 of _0x91ef68[_0xdda16f(0x171)][_0xdda16f(0x131)]||[]){_0x3bc338[_0xdda16f(0x162)]?.[_0xdda16f(0x18c)]&&isPendingSegmentId(_0x3bc338[_0xdda16f(0x162)][_0xdda16f(0x18c)])&&delete _0x3bc338[_0xdda16f(0x162)];_0x3bc338[_0xdda16f(0x157)]?.[_0xdda16f(0x18c)]&&isPendingSegmentId(_0x3bc338['milestone'][_0xdda16f(0x18c)])&&delete _0x3bc338[_0xdda16f(0x157)];_0x3bc338[_0xdda16f(0x187)]&&(_0x3bc338[_0xdda16f(0x187)]=_0x3bc338[_0xdda16f(0x187)][_0xdda16f(0x206)](_0x456299=>!_0x456299[_0xdda16f(0x18c)]||!isPendingSegmentId(_0x456299[_0xdda16f(0x18c)])));if(_0x3bc338[_0xdda16f(0x14d)])for(const _0x369dd7 of Object['keys'](_0x3bc338[_0xdda16f(0x14d)])){const _0x4fdf89=_0x3bc338[_0xdda16f(0x14d)][_0x369dd7];_0x4fdf89[_0xdda16f(0x1e5)]===_0xdda16f(0x10d)&&_0x4fdf89[_0xdda16f(0x18a)]&&isPendingActivationId(_0x4fdf89['journeyActivationStepId'])&&(_0x4fdf89[_0xdda16f(0x18a)]='');if(_0x4fdf89[_0xdda16f(0x1e5)]===_0xdda16f(0x1c1)&&_0x4fdf89['branches'])for(const _0x1d5e11 of _0x4fdf89[_0xdda16f(0x196)]){_0x1d5e11[_0xdda16f(0x18c)]&&isPendingSegmentId(_0x1d5e11[_0xdda16f(0x18c)])&&(_0x1d5e11['segmentId']='');}_0x4fdf89['type']===_0xdda16f(0x200)&&stripWaitStepPendingIds(_0x4fdf89);}}}function resolvePendingIdsInRequest(_0x2a4a12,_0x1004c8,_0x190b14,_0x5f1601,_0x1a4e1a,_0x412015){const _0x4ddd0d=a152_0xd184d4,_0x1bbfc3=(_0x3ce23b,_0x22d76d)=>{const _0x3d45ac=a152_0x2210;if(!isPendingSegmentId(_0x3ce23b))return _0x3ce23b;const _0x545b18=extractPendingSegmentName(_0x3ce23b),_0x17e604=_0x5f1601[_0x3d45ac(0x181)](_0x545b18);return!_0x17e604&&_0x412015[_0x3d45ac(0x165)]?.(_0x3d45ac(0x16f)+_0x545b18+_0x3d45ac(0x1d8)+_0x22d76d),_0x17e604;};if(_0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x1f0)]?.[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x1f0)][_0x4ddd0d(0x18c)])){const _0x8b037c=_0x1bbfc3(_0x2a4a12['attributes']['goal'][_0x4ddd0d(0x18c)],'goal\x20criteria');_0x8b037c&&(_0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x1f0)][_0x4ddd0d(0x18c)]=_0x8b037c);}for(const _0x149ac2 of _0x2a4a12[_0x4ddd0d(0x171)][_0x4ddd0d(0x131)]||[]){const _0x20fa36=_0x190b14[_0x4ddd0d(0x181)](_0x149ac2[_0x4ddd0d(0x13a)][_0x4ddd0d(0x12f)]());_0x20fa36&&(_0x149ac2['id']=_0x20fa36);if(_0x149ac2['entryCriteria']?.[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0x149ac2['entryCriteria'][_0x4ddd0d(0x18c)])){const _0xb758e0=_0x1bbfc3(_0x149ac2['entryCriteria'][_0x4ddd0d(0x18c)],_0x4ddd0d(0x115)+_0x149ac2[_0x4ddd0d(0x13a)]+_0x4ddd0d(0x1ac));_0xb758e0&&(_0x149ac2[_0x4ddd0d(0x162)]['segmentId']=_0xb758e0);}if(_0x149ac2[_0x4ddd0d(0x187)])for(const _0xae8e79 of _0x149ac2[_0x4ddd0d(0x187)]){if(_0xae8e79[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0xae8e79[_0x4ddd0d(0x18c)])){const _0x3fdd42=_0x1bbfc3(_0xae8e79[_0x4ddd0d(0x18c)],_0x4ddd0d(0x115)+_0x149ac2['name']+_0x4ddd0d(0x185));_0x3fdd42&&(_0xae8e79['segmentId']=_0x3fdd42);}}if(_0x149ac2[_0x4ddd0d(0x157)]?.['segmentId']&&isPendingSegmentId(_0x149ac2['milestone']['segmentId'])){const _0x37c59f=_0x1bbfc3(_0x149ac2[_0x4ddd0d(0x157)]['segmentId'],_0x4ddd0d(0x115)+_0x149ac2[_0x4ddd0d(0x13a)]+_0x4ddd0d(0x172));_0x37c59f&&(_0x149ac2[_0x4ddd0d(0x157)][_0x4ddd0d(0x18c)]=_0x37c59f);}if(_0x149ac2[_0x4ddd0d(0x14d)]){const _0x588fc9=_0x200d1d=>_0x1004c8['attributes'][_0x4ddd0d(0x131)]?.[_0x4ddd0d(0x179)](_0x3d6b82=>_0x3d6b82[_0x4ddd0d(0x13a)][_0x4ddd0d(0x12f)]()===_0x149ac2[_0x4ddd0d(0x13a)][_0x4ddd0d(0x12f)]())?.[_0x4ddd0d(0x14d)]?.[_0x200d1d];for(const _0x5382ae of Object['keys'](_0x149ac2[_0x4ddd0d(0x14d)])){const _0x345939=_0x149ac2['steps'][_0x5382ae],_0x2f8eb3=_0x588fc9(_0x5382ae);if(_0x345939[_0x4ddd0d(0x1e5)]==='Activation'&&_0x345939[_0x4ddd0d(0x18a)]&&(isPendingActivationId(_0x345939[_0x4ddd0d(0x18a)])||_0x345939['journeyActivationStepId']==='')){if(_0x2f8eb3?.[_0x4ddd0d(0x18a)]&&isPendingActivationId(_0x2f8eb3[_0x4ddd0d(0x18a)])){const _0x2654d7=extractPendingActivationName(_0x2f8eb3['journeyActivationStepId']),_0x5d5040=_0x1a4e1a[_0x4ddd0d(0x181)](_0x2654d7);_0x5d5040&&(_0x345939[_0x4ddd0d(0x18a)]=_0x5d5040);}}if(_0x345939[_0x4ddd0d(0x1e5)]===_0x4ddd0d(0x1c1)&&_0x345939[_0x4ddd0d(0x196)]&&_0x2f8eb3?.[_0x4ddd0d(0x196)])for(let _0x4dd0d2=0x0;_0x4dd0d2<_0x345939[_0x4ddd0d(0x196)][_0x4ddd0d(0x169)];_0x4dd0d2++){const _0x39fc92=_0x345939['branches'][_0x4dd0d2],_0x286cd6=_0x2f8eb3[_0x4ddd0d(0x196)][_0x4dd0d2];if(_0x286cd6?.[_0x4ddd0d(0x18c)]&&isPendingSegmentId(_0x286cd6[_0x4ddd0d(0x18c)])){const _0x4008c5=_0x1bbfc3(_0x286cd6[_0x4ddd0d(0x18c)],_0x4ddd0d(0x115)+_0x149ac2[_0x4ddd0d(0x13a)]+_0x4ddd0d(0x183)+(_0x39fc92[_0x4ddd0d(0x13a)]||_0x4dd0d2)+'\x27');_0x4008c5&&(_0x39fc92[_0x4ddd0d(0x18c)]=_0x4008c5);}}_0x345939['type']===_0x4ddd0d(0x200)&&_0x2f8eb3?.[_0x4ddd0d(0x1e5)]==='WaitStep'&&resolveWaitStepPendingIds(_0x345939,_0x2f8eb3,_0x1bbfc3,_0x149ac2[_0x4ddd0d(0x13a)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7ed037,_0x2c406e){const _0x3f88c6=a153_0x24bd,_0x52d7f3=_0x7ed037();while(!![]){try{const _0x571113=parseInt(_0x3f88c6(0x15e))/0x1*(parseInt(_0x3f88c6(0x157))/0x2)+parseInt(_0x3f88c6(0x158))/0x3*(-parseInt(_0x3f88c6(0x151))/0x4)+-parseInt(_0x3f88c6(0x150))/0x5*(-parseInt(_0x3f88c6(0x153))/0x6)+parseInt(_0x3f88c6(0x15d))/0x7+-parseInt(_0x3f88c6(0x14e))/0x8+-parseInt(_0x3f88c6(0x154))/0x9*(-parseInt(_0x3f88c6(0x155))/0xa)+parseInt(_0x3f88c6(0x15f))/0xb*(-parseInt(_0x3f88c6(0x15c))/0xc);if(_0x571113===_0x2c406e)break;else _0x52d7f3['push'](_0x52d7f3['shift']());}catch(_0x2ce2bc){_0x52d7f3['push'](_0x52d7f3['shift']());}}}(a153_0x2945,0x986db));export function buildFolderIdToPathMap(_0x19ecfd){const _0x1cd139=a153_0x24bd,_0x2d8b=new Map(),_0x54a021=new Map();for(const _0x39fb48 of _0x19ecfd){_0x54a021[_0x1cd139(0x156)](_0x39fb48['id'],_0x39fb48);}const _0x418a0f=new Set();for(const _0x476ccc of _0x19ecfd){!_0x476ccc[_0x1cd139(0x159)]&&_0x418a0f['add'](_0x476ccc['id']);}function _0x14ca2a(_0x30da35){const _0x4aafb8=_0x1cd139;if(_0x2d8b[_0x4aafb8(0x15a)](_0x30da35['id']))return _0x2d8b[_0x4aafb8(0x14f)](_0x30da35['id']);if(_0x418a0f[_0x4aafb8(0x15a)](_0x30da35['id']))return _0x2d8b[_0x4aafb8(0x156)](_0x30da35['id'],''),'';if(_0x30da35[_0x4aafb8(0x159)]){const _0x233569=_0x54a021[_0x4aafb8(0x14f)](_0x30da35['parentFolderId']);if(_0x233569){const _0x1688d5=_0x14ca2a(_0x233569),_0x4d67a5=_0x1688d5?_0x1688d5+'/'+_0x30da35[_0x4aafb8(0x152)]:_0x30da35[_0x4aafb8(0x152)];return _0x2d8b[_0x4aafb8(0x156)](_0x30da35['id'],_0x4d67a5),_0x4d67a5;}}const _0x48ca97=_0x30da35[_0x4aafb8(0x152)];return _0x2d8b[_0x4aafb8(0x156)](_0x30da35['id'],_0x48ca97),_0x48ca97;}for(const _0x3eb2f4 of _0x19ecfd){_0x14ca2a(_0x3eb2f4);}return _0x2d8b;}export function buildFolderPathToIdMap(_0x5b45d7){const _0x478c1e=a153_0x24bd,_0x1d3926=new Map(),_0x4e5a61=new Map();for(const _0x35c1e3 of _0x5b45d7){_0x4e5a61[_0x478c1e(0x156)](_0x35c1e3['id'],_0x35c1e3);}const _0x53e850=new Set();for(const _0x421b8a of _0x5b45d7){!_0x421b8a[_0x478c1e(0x159)]&&_0x53e850[_0x478c1e(0x15b)](_0x421b8a['id']);}function _0x4037cb(_0x33b8f6){const _0x24d45f=_0x478c1e;if(_0x53e850[_0x24d45f(0x15a)](_0x33b8f6['id']))return'';if(_0x33b8f6[_0x24d45f(0x159)]){const _0x359960=_0x4e5a61[_0x24d45f(0x14f)](_0x33b8f6[_0x24d45f(0x159)]);if(_0x359960){const _0x5222b9=_0x4037cb(_0x359960);return _0x5222b9?_0x5222b9+'/'+_0x33b8f6[_0x24d45f(0x152)]:_0x33b8f6[_0x24d45f(0x152)];}}return _0x33b8f6['name'];}for(const _0xf24493 of _0x5b45d7){const _0x5e2a69=_0x4037cb(_0xf24493);_0x1d3926['set'](_0x5e2a69,_0xf24493['id']);}return _0x1d3926;}export function buildFolderMaps(_0x6081a8){const _0x375bc8=a153_0x24bd,_0x3f7227=buildFolderIdToPathMap(_0x6081a8),_0x2c1eca=new Map();for(const [_0x479655,_0x3d9003]of _0x3f7227){_0x2c1eca[_0x375bc8(0x156)](_0x3d9003,_0x479655);}return{'idToPath':_0x3f7227,'pathToId':_0x2c1eca};}export function getFolderPath(_0x395c59,_0x1f6322){const _0x151fbf=a153_0x24bd;if(!_0x395c59)return'';return _0x1f6322[_0x151fbf(0x14f)](_0x395c59)??'';}function a153_0x24bd(_0xa5315b,_0x4c150d){_0xa5315b=_0xa5315b-0x14e;const _0x29456d=a153_0x2945();let _0x24bdb1=_0x29456d[_0xa5315b];return _0x24bdb1;}function a153_0x2945(){const _0x172c2a=['set','2400418KaNQNL','415011huCFnZ','parentFolderId','has','add','4985184stzQAI','2851723UBsuoU','1evUpFe','22epXFdd','5523448eURtve','get','5HCwsgB','16ndzPwe','name','3641034iLhZMy','24363yaZvkt','1790XoBHBv'];a153_0x2945=function(){return _0x172c2a;};return a153_0x2945();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xe54e20,_0x16bb31){const _0x15f9d3=a154_0x5287,_0x214418=_0xe54e20();while(!![]){try{const _0x17c444=-parseInt(_0x15f9d3(0x12a))/0x1*(parseInt(_0x15f9d3(0x12b))/0x2)+parseInt(_0x15f9d3(0x107))/0x3*(-parseInt(_0x15f9d3(0x102))/0x4)+parseInt(_0x15f9d3(0x10b))/0x5*(-parseInt(_0x15f9d3(0x10e))/0x6)+-parseInt(_0x15f9d3(0x132))/0x7+parseInt(_0x15f9d3(0x125))/0x8+-parseInt(_0x15f9d3(0x128))/0x9*(parseInt(_0x15f9d3(0x105))/0xa)+parseInt(_0x15f9d3(0x121))/0xb;if(_0x17c444===_0x16bb31)break;else _0x214418['push'](_0x214418['shift']());}catch(_0x5d4413){_0x214418['push'](_0x214418['shift']());}}}(a154_0x1a7c,0x2e0e6));import a154_0x36b279 from'path';import{parse as a154_0x2d4d22}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x365814){const _0x588ac1=a154_0x5287;if(!_0x365814||_0x365814['trim']()==='')throw new Error(_0x588ac1(0x127));const _0x354565=_0x365814[_0x588ac1(0x124)]();if(_0x354565==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x365814};const _0x283495=_0x354565[_0x588ac1(0x134)]('/')?_0x354565['substring'](0x1):_0x354565,_0x5eafe8=_0x283495[_0x588ac1(0x11c)]('/')[_0x588ac1(0x113)](_0x2b6e82=>_0x2b6e82!=='');if(_0x5eafe8[_0x588ac1(0x126)]===0x0)throw new Error(_0x588ac1(0x103));const _0xedbc64=_0x354565[_0x588ac1(0x134)]('/')||!isRelativePathSegment(_0x5eafe8[0x0]);for(const _0x5311aa of _0x5eafe8){validatePathSegment(_0x5311aa);}return{'segments':_0x5eafe8,'isAbsolute':_0xedbc64,'raw':_0x365814};}function a154_0x1a7c(){const _0x11c81b=['Path\x20must\x20contain\x20at\x20least\x20one\x20segment','replace','20qjODwQ','slice','3FdNqob','type','readFile','Cannot\x20navigate\x20above\x20root','35470ZVbSpb','Cannot\x20split\x20empty\x20path','segments','258gVBTjf','File\x20not\x20found:\x20','journey','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','parse','filter','Path\x20attempts\x20to\x20navigate\x20above\x20root','join','name','.yml','root','dirname','endsWith','push','split','exists','Relative\x20path\x20cannot\x20be\x20empty','No\x20tdx.json\x20found\x20for\x20file:\x20','relative','15972132JmzMae','test','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','trim','47112jYkHsJ','length','Path\x20cannot\x20be\x20empty','1685790APNTRr','segment','29qAYUkF','2446XjpubF','raw','parent_segment','isAbsolute','tdx.json','Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','pop','1496236yRERsp','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','startsWith','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','1361512fXSGUS'];a154_0x1a7c=function(){return _0x11c81b;};return a154_0x1a7c();}function isRelativePathSegment(_0x439d86){return _0x439d86==='.'||_0x439d86==='..';}function validatePathSegment(_0x46a362){const _0x44ff00=a154_0x5287;if(_0x46a362==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x46a362==='.'||_0x46a362==='..')return;if(/[\x00-\x1F\x7F]/[_0x44ff00(0x122)](_0x46a362))throw new Error(_0x44ff00(0x111)+_0x46a362);if(_0x46a362!==_0x46a362[_0x44ff00(0x124)]()){}}function a154_0x5287(_0x5f5b0b,_0x596abd){_0x5f5b0b=_0x5f5b0b-0x102;const _0x1a7c23=a154_0x1a7c();let _0x5287c9=_0x1a7c23[_0x5f5b0b];return _0x5287c9;}export function validatePath(_0x47e22b){const _0x22d5a8=a154_0x5287;if(_0x47e22b[_0x22d5a8(0x10d)]['length']===0x0&&!_0x47e22b[_0x22d5a8(0x12e)])throw new Error(_0x22d5a8(0x11e));if(_0x47e22b[_0x22d5a8(0x12e)]){if(_0x47e22b[_0x22d5a8(0x10d)][0x0]==='..')throw new Error(_0x22d5a8(0x123));let _0x2ac50d=0x0;for(const _0x141b27 of _0x47e22b[_0x22d5a8(0x10d)]){if(_0x141b27==='..'){if(_0x2ac50d===0x0)throw new Error(_0x22d5a8(0x114));_0x2ac50d--;}else _0x141b27!=='.'&&_0x2ac50d++;}}}export function joinPaths(_0x16d380,_0x32e0ad){const _0xe6952a=a154_0x5287;if(!_0x16d380||_0x16d380==='/')return _0x32e0ad;if(!_0x32e0ad||_0x32e0ad==='.')return _0x16d380;if(_0x32e0ad[_0xe6952a(0x134)]('/'))return _0x32e0ad;const _0x3efe74=parsePath(_0x16d380),_0x1f2f49=parsePath(_0x32e0ad),_0x49fe1f=[..._0x3efe74['segments']];for(const _0x4e59c0 of _0x1f2f49[_0xe6952a(0x10d)]){if(_0x4e59c0==='.')continue;else{if(_0x4e59c0==='..'){if(_0x49fe1f[_0xe6952a(0x126)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x49fe1f[_0xe6952a(0x131)]();}else _0x49fe1f[_0xe6952a(0x11b)](_0x4e59c0);}}const _0x842273=_0x49fe1f['join']('/');return _0x3efe74[_0xe6952a(0x12c)][_0xe6952a(0x134)]('/')?'/'+_0x842273:_0x842273;}export function normalizePath(_0x47a556){const _0x1e13f9=a154_0x5287,_0x375576=parsePath(_0x47a556),_0x4e7227=[];for(const _0x4b7f50 of _0x375576['segments']){if(_0x4b7f50==='.')continue;else{if(_0x4b7f50==='..'){if(_0x4e7227[_0x1e13f9(0x126)]===0x0){if(_0x375576['isAbsolute'])throw new Error(_0x1e13f9(0x10a));_0x4e7227['push']('..');}else _0x4e7227[_0x4e7227[_0x1e13f9(0x126)]-0x1]==='..'?_0x4e7227[_0x1e13f9(0x11b)]('..'):_0x4e7227['pop']();}else _0x4e7227[_0x1e13f9(0x11b)](_0x4b7f50);}}if(_0x4e7227['length']===0x0)return _0x375576[_0x1e13f9(0x12e)]?'/':'.';const _0x23c701=_0x4e7227[_0x1e13f9(0x115)]('/');return _0x375576[_0x1e13f9(0x12c)]['startsWith']('/')?'/'+_0x23c701:_0x23c701;}export function getParentPath(_0x423896){const _0x53f0c6=a154_0x5287,_0xe7f926=parsePath(_0x423896);if(_0xe7f926['segments'][_0x53f0c6(0x126)]<=0x1)return'/';const _0x30d361=_0xe7f926['segments'][_0x53f0c6(0x106)](0x0,-0x1)[_0x53f0c6(0x115)]('/');return _0xe7f926[_0x53f0c6(0x12c)][_0x53f0c6(0x134)]('/')?'/'+_0x30d361:_0x30d361;}export function getBaseName(_0x1a62f3){const _0x58dcea=a154_0x5287,_0xd28d8a=parsePath(_0x1a62f3);return _0xd28d8a[_0x58dcea(0x10d)][_0xd28d8a[_0x58dcea(0x10d)][_0x58dcea(0x126)]-0x1]||'';}export function isChildPath(_0x3f3159,_0x89e8a2){const _0x15c935=a154_0x5287,_0x4aabd7=parsePath(_0x3f3159),_0x2fbfae=parsePath(_0x89e8a2);if(_0x4aabd7[_0x15c935(0x10d)]['length']<=_0x2fbfae[_0x15c935(0x10d)][_0x15c935(0x126)])return![];for(let _0xb18172=0x0;_0xb18172<_0x2fbfae[_0x15c935(0x10d)][_0x15c935(0x126)];_0xb18172++){if(_0x4aabd7[_0x15c935(0x10d)][_0xb18172]!==_0x2fbfae[_0x15c935(0x10d)][_0xb18172])return![];}return!![];}export function splitPath(_0xc77f4d){const _0x35eea3=a154_0x5287,_0x55e88b=parsePath(_0xc77f4d);if(_0x55e88b[_0x35eea3(0x10d)][_0x35eea3(0x126)]===0x0)throw new Error(_0x35eea3(0x10c));if(_0x55e88b[_0x35eea3(0x10d)][_0x35eea3(0x126)]===0x1)return{'parent':_0x55e88b[_0x35eea3(0x10d)][0x0]};return{'parent':_0x55e88b[_0x35eea3(0x10d)][0x0],'child':_0x55e88b[_0x35eea3(0x10d)][_0x35eea3(0x106)](0x1)[_0x35eea3(0x115)]('/')};}export function isYamlFilePath(_0x5c5647){const _0x29e524=a154_0x5287;return _0x5c5647[_0x29e524(0x11a)](_0x29e524(0x117))||_0x5c5647[_0x29e524(0x11a)]('.yaml');}export async function resolveYamlFilePath(_0x4ac1d4,_0x2a6054=nodeFileSystem){const _0x26a453=a154_0x5287,_0x96413c=a154_0x36b279['resolve'](_0x4ac1d4);if(!await _0x2a6054['exists'](_0x96413c))throw new Error(_0x26a453(0x10f)+_0x4ac1d4);let _0x11263a=a154_0x36b279[_0x26a453(0x119)](_0x96413c),_0x44b8fd=null,_0x1fc33f=null;const _0x114766=a154_0x36b279[_0x26a453(0x112)](_0x11263a)[_0x26a453(0x118)];while(_0x11263a!==_0x114766){const _0x3b88bd=a154_0x36b279[_0x26a453(0x115)](_0x11263a,_0x26a453(0x12f));if(await _0x2a6054[_0x26a453(0x11d)](_0x3b88bd)){_0x44b8fd=_0x3b88bd,_0x1fc33f=_0x11263a;break;}_0x11263a=a154_0x36b279['dirname'](_0x11263a);}if(!_0x44b8fd||!_0x1fc33f)throw new Error(_0x26a453(0x11f)+_0x4ac1d4+'\x0a'+_0x26a453(0x130));const _0x1cd2ff=await _0x2a6054[_0x26a453(0x109)](_0x44b8fd),_0x16f9df=JSON[_0x26a453(0x112)](_0x1cd2ff),_0x51044a=_0x16f9df[_0x26a453(0x12d)];if(!_0x51044a)throw new Error(_0x26a453(0x135));const _0x398127=await _0x2a6054[_0x26a453(0x109)](_0x96413c),_0x2425b5=a154_0x2d4d22(_0x398127),_0x519f6c=_0x2425b5[_0x26a453(0x116)];if(!_0x519f6c)throw new Error(_0x26a453(0x133)+_0x4ac1d4);const _0x1f667c=_0x2425b5[_0x26a453(0x108)]===_0x26a453(0x110)?'journey':_0x26a453(0x129),_0x10fdb4=a154_0x36b279[_0x26a453(0x120)](_0x1fc33f,_0x96413c),_0x2f167b=a154_0x36b279[_0x26a453(0x119)](_0x10fdb4),_0x23f777=_0x2f167b==='.'?'':_0x2f167b[_0x26a453(0x104)](/\\/g,'/'),_0x2bd160=_0x23f777?_0x51044a+'/'+_0x23f777+'/'+_0x519f6c:_0x51044a+'/'+_0x519f6c;return{'parentSegment':_0x51044a,'segmentName':_0x519f6c,'folderPath':_0x23f777,'fullPath':_0x2bd160,'resourceType':_0x1f667c,'content':_0x398127};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a155_0xa7b5(){const _0x35b221=['5HMkaQr','351348vmylEd','23702wWWxHa','.\x20Parent\x20name\x20cannot\x20be\x20empty','1728HemyEF','3451547CZLuMI','substring','1294536HkiVUO','749000VHvDaH','14lXlUDK','2850WGwJLI','5VaEhvU','indexOf','75342reuNPo','Invalid\x20segment\x20reference\x20format:\x20'];a155_0xa7b5=function(){return _0x35b221;};return a155_0xa7b5();}(function(_0x48627a,_0x403942){const _0x248f42=a155_0x5253,_0x4c8949=_0x48627a();while(!![]){try{const _0x153516=-parseInt(_0x248f42(0xf4))/0x1*(parseInt(_0x248f42(0xfa))/0x2)+parseInt(_0x248f42(0xf6))/0x3+parseInt(_0x248f42(0xf1))/0x4*(parseInt(_0x248f42(0xf8))/0x5)+parseInt(_0x248f42(0xf9))/0x6+parseInt(_0x248f42(0xf2))/0x7*(parseInt(_0x248f42(0xf0))/0x8)+-parseInt(_0x248f42(0xfc))/0x9*(parseInt(_0x248f42(0xf3))/0xa)+-parseInt(_0x248f42(0xee))/0xb;if(_0x153516===_0x403942)break;else _0x4c8949['push'](_0x4c8949['shift']());}catch(_0x278122){_0x4c8949['push'](_0x4c8949['shift']());}}}(a155_0xa7b5,0x28b94));function a155_0x5253(_0x1a9492,_0xb548b3){_0x1a9492=_0x1a9492-0xee;const _0xa7b53f=a155_0xa7b5();let _0x525350=_0xa7b53f[_0x1a9492];return _0x525350;}export function parseSegmentRef(_0x351df8){const _0x12a3b7=a155_0x5253,_0x186ab4=_0x351df8[_0x12a3b7(0xf5)]('/');if(_0x186ab4===-0x1)return{'parentId':_0x351df8};if(_0x186ab4===0x0)throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x351df8+_0x12a3b7(0xfb));const _0x3119d2=_0x351df8[_0x12a3b7(0xef)](0x0,_0x186ab4),_0xe85765=_0x351df8['substring'](_0x186ab4+0x1);if(_0xe85765==='')throw new Error(_0x12a3b7(0xf7)+_0x351df8+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x3119d2,'childId':_0xe85765};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fb622,_0x570b5b){const _0x13f9d8=a156_0xa04b,_0x3b2481=_0x2fb622();while(!![]){try{const _0x108237=-parseInt(_0x13f9d8(0xea))/0x1*(parseInt(_0x13f9d8(0x10b))/0x2)+-parseInt(_0x13f9d8(0x115))/0x3+parseInt(_0x13f9d8(0x120))/0x4*(-parseInt(_0x13f9d8(0x10c))/0x5)+parseInt(_0x13f9d8(0xf7))/0x6+-parseInt(_0x13f9d8(0xf3))/0x7*(-parseInt(_0x13f9d8(0x126))/0x8)+-parseInt(_0x13f9d8(0x10f))/0x9*(parseInt(_0x13f9d8(0x123))/0xa)+parseInt(_0x13f9d8(0xf9))/0xb*(parseInt(_0x13f9d8(0xff))/0xc);if(_0x108237===_0x570b5b)break;else _0x3b2481['push'](_0x3b2481['shift']());}catch(_0x3ef12b){_0x3b2481['push'](_0x3b2481['shift']());}}}(a156_0x4ac3,0x91a05));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x5e0444,_0xf6ac21={},_0x5c9437={}){const _0x5532e8=a156_0xa04b;if(_0x5c9437[_0x5532e8(0x121)])return runSemanticChecks(_0x5e0444,_0xf6ac21);const _0x30eb9e=SegmentDefSchema[_0x5532e8(0x122)](_0x5e0444);if(_0x30eb9e['success'])return runSemanticChecks(_0x30eb9e[_0x5532e8(0x113)],_0xf6ac21);return zodErrorsToValidationResult(_0x30eb9e[_0x5532e8(0x114)],_0xf6ac21);}export function validateRuleDef(_0x1000e3,_0x3eeb08,_0x414c30){const _0x4f1386=a156_0xa04b;if(!_0x1000e3)return[];const _0x3cd355=RuleDefSchema['safeParse'](_0x1000e3);if(_0x3cd355['success'])return checkRule(_0x3cd355[_0x4f1386(0x113)],_0x3eeb08,_0x414c30);const _0x1ea0fc=flattenZodIssues(_0x3cd355[_0x4f1386(0x114)][_0x4f1386(0xf5)]);return _0x1ea0fc['map'](_0x1430f9=>{const _0x3b316d=_0x4f1386,_0x49293a=formatZodPath(_0x1430f9[_0x3b316d(0x102)]),_0x161441=_0x49293a?_0x3eeb08+'.'+_0x49293a:_0x3eeb08,_0x525ad6=mapZodIssueToCode(_0x1430f9,_0x49293a),_0x1245a5=getLocationFromPath(_0x414c30[_0x3b316d(0x128)],_0x414c30[_0x3b316d(0xfd)],pathToArray(_0x161441));return{'level':'error','path':_0x161441,'code':_0x525ad6,'message':_0x1430f9[_0x3b316d(0xe9)],..._0x1245a5&&{'location':_0x1245a5}};});}function zodErrorsToValidationResult(_0x387b64,_0x3870b2){const _0xc094d5=a156_0xa04b,_0x1693d3=flattenZodIssues(_0x387b64[_0xc094d5(0xf5)]),_0xfa35c6=_0x1693d3['map'](_0x2d94ac=>{const _0x2236ea=_0xc094d5,_0x436f7f=formatZodPath(_0x2d94ac[_0x2236ea(0x102)]),_0x23c38f=mapZodIssueToCode(_0x2d94ac,_0x436f7f),_0x5c0488=getLocationFromPath(_0x3870b2[_0x2236ea(0x128)],_0x3870b2[_0x2236ea(0xfd)],_0x2d94ac['path'][_0x2236ea(0x10d)](_0x3a8af9=>typeof _0x3a8af9===_0x2236ea(0x11b)?String(_0x3a8af9):_0x3a8af9));return{'level':'error','path':_0x436f7f,'code':_0x23c38f,'message':_0x2d94ac['message'],..._0x5c0488&&{'location':_0x5c0488}};});return{'valid':![],'errors':_0xfa35c6,'warnings':[]};}function a156_0xa04b(_0x2d3833,_0x290876){_0x2d3833=_0x2d3833-0xe8;const _0x4ac3c8=a156_0x4ac3();let _0xa04b5f=_0x4ac3c8[_0x2d3833];return _0xa04b5f;}function a156_0x4ac3(){const _0xa8273f=['safeParse','4217570dBtfyW','warning','conditions','21680ceyfaO','custom','document','MISSING_CONDITIONS','rule.type','name','EMPTY_CONDITIONS','BEHAVIOR_SOURCE_MISSING_FILTER','message','3WKwXUT','.type','INVALID_RULE_TYPE','description','.attribute','.operator.type','NESTED_CONDITION_GROUP','INVALID_OPERATOR_TYPE','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','2387ZbrQVD','length','issues','type','5822700iIdxXK','SEGMENT_SCHEMA_ERROR','11MGvSZQ','push','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','source','.source','2803176QosBco','.conditions','code','path','rule','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','includes','aggregation','Attribute\x20name\x20cannot\x20be\x20empty','And','Behavior','471462dSzbGR','1290065ImUeSQ','map','MISSING_TIME_UNIT','9nYNhOp','arrayMatching','attribute','\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20','data','error','434130lanClg','params','\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','MISSING_BETWEEN_BOUNDS','validationCode','symbol','level','filter','endsWith','Attribute\x20\x27','4dMLQgJ','skipSchema'];a156_0x4ac3=function(){return _0xa8273f;};return a156_0x4ac3();}function mapZodIssueToCode(_0x513470,_0x2bc00c){const _0x5e7659=a156_0xa04b,_0x3be444=_0x513470[_0x5e7659(0x101)]===_0x5e7659(0x127)?_0x513470[_0x5e7659(0x116)]:undefined;if(_0x2bc00c===_0x5e7659(0x12b))return'MISSING_NAME';if(_0x2bc00c===_0x5e7659(0x12a)||_0x2bc00c[_0x5e7659(0x11e)](_0x5e7659(0xeb))){if(_0x513470['code']==='invalid_value'){if(_0x2bc00c===_0x5e7659(0x12a)||_0x2bc00c['match'](/\.conditions\[\d+\]\.type$/))return _0x5e7659(0xec);}}if(_0x2bc00c[_0x5e7659(0x11e)](_0x5e7659(0xef)))return _0x5e7659(0xf1);if(_0x2bc00c['endsWith']('.operator.value'))return'MISSING_OPERATOR_VALUE';if(_0x3be444?.[_0x5e7659(0x11a)]===_0x5e7659(0x119))return _0x5e7659(0x119);if(_0x3be444?.[_0x5e7659(0x11a)]===_0x5e7659(0x10e))return'MISSING_TIME_UNIT';if(_0x2bc00c[_0x5e7659(0x11e)](_0x5e7659(0x100))||_0x2bc00c===_0x5e7659(0x125))return _0x5e7659(0x129);if(_0x2bc00c[_0x5e7659(0x106)](_0x5e7659(0x110)))return'INVALID_ARRAY_MATCHING';if(_0x2bc00c['endsWith']('.segment'))return'MISSING_SEGMENT_REFERENCE';return _0x5e7659(0xf8);}function runSemanticChecks(_0x556f95,_0x3d0800){const _0xb15479=a156_0xa04b,_0x1d7fdc=[];_0x556f95[_0xb15479(0x103)]&&_0x1d7fdc[_0xb15479(0xfa)](...checkRule(_0x556f95[_0xb15479(0x103)],'rule',_0x3d0800));const _0x59d456=_0x1d7fdc[_0xb15479(0x11d)](_0x235d79=>_0x235d79[_0xb15479(0x11c)]===_0xb15479(0x114)),_0x1ae9d3=_0x1d7fdc[_0xb15479(0x11d)](_0x1d0d08=>_0x1d0d08[_0xb15479(0x11c)]===_0xb15479(0x124));return{'valid':_0x59d456[_0xb15479(0xf4)]===0x0,'errors':_0x59d456,'warnings':_0x1ae9d3};}function checkRule(_0x54e594,_0xd5f832,_0x23448e){const _0x2298b5=a156_0xa04b,_0xf2bae5=[];if(_0x54e594['conditions'][_0x2298b5(0xf4)]===0x0)return _0xf2bae5[_0x2298b5(0xfa)]({'level':_0x2298b5(0x114),'path':_0xd5f832+'.conditions','code':_0x2298b5(0x12c),'message':_0x2298b5(0x104),'location':getLocationFromPath(_0x23448e['document'],_0x23448e['source'],pathToArray(_0xd5f832+_0x2298b5(0x100)))}),_0xf2bae5;return _0xf2bae5[_0x2298b5(0xfa)](...checkConditions(_0x54e594[_0x2298b5(0x125)],_0xd5f832,_0x23448e)),_0xf2bae5;}function checkConditions(_0x360995,_0x42b486,_0x276f33){const _0x44a628=a156_0xa04b,_0x56d3ec=[];for(let _0x22faf6=0x0;_0x22faf6<_0x360995[_0x44a628(0xf4)];_0x22faf6++){const _0x13d95f=_0x360995[_0x22faf6],_0x1eaafd=_0x42b486+'.conditions['+_0x22faf6+']';_0x56d3ec['push'](...checkCondition(_0x13d95f,_0x1eaafd,_0x276f33));}return _0x56d3ec;}function checkCondition(_0x2fc1c3,_0xfe549c,_0x2d6515){const _0x3224b5=a156_0xa04b,_0x200e66=[];if(_0x2fc1c3[_0x3224b5(0xf6)]===_0x3224b5(0x109)||_0x2fc1c3[_0x3224b5(0xf6)]==='Or'){if(_0x2fc1c3['conditions'][_0x3224b5(0xf4)]===0x0)_0x200e66[_0x3224b5(0xfa)]({'level':'error','path':_0xfe549c+_0x3224b5(0x100),'code':'EMPTY_CONDITIONS','message':_0x2fc1c3[_0x3224b5(0xf6)]+'\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','location':getLocationFromPath(_0x2d6515[_0x3224b5(0x128)],_0x2d6515['source'],pathToArray(_0xfe549c+'.conditions'))});else{const _0x3fe1f6=_0x2fc1c3[_0x3224b5(0xed)]!==undefined;!_0x3fe1f6&&_0x200e66[_0x3224b5(0xfa)]({'level':'warning','path':_0xfe549c,'code':_0x3224b5(0xf0),'message':_0x2fc1c3[_0x3224b5(0xf6)]+_0x3224b5(0x117)+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+_0x3224b5(0xf2),'location':getLocationFromPath(_0x2d6515['document'],_0x2d6515[_0x3224b5(0xfd)],pathToArray(_0xfe549c))}),_0x200e66[_0x3224b5(0xfa)](...checkConditions(_0x2fc1c3[_0x3224b5(0x125)],_0xfe549c,_0x2d6515));}return _0x200e66;}if(_0x2fc1c3[_0x3224b5(0xf6)]==='Value'||_0x2fc1c3[_0x3224b5(0xf6)]===_0x3224b5(0x10a)){const _0x5ede5f=_0x2fc1c3,_0x464800=_0x5ede5f['source'],_0x5c745d=_0x5ede5f[_0x3224b5(0x107)],_0xe056e6=_0x464800||_0x5c745d;(!_0x5ede5f['attribute']||_0x5ede5f[_0x3224b5(0x111)]==='')&&(!_0xe056e6&&_0x200e66[_0x3224b5(0xfa)]({'level':_0x3224b5(0x114),'path':_0xfe549c+_0x3224b5(0xee),'code':'EMPTY_ATTRIBUTE','message':_0x3224b5(0x108),'location':getLocationFromPath(_0x2d6515['document'],_0x2d6515[_0x3224b5(0xfd)],pathToArray(_0xfe549c+_0x3224b5(0xee)))}));_0x5ede5f[_0x3224b5(0x11d)]&&_0x200e66[_0x3224b5(0xfa)](...checkRule(_0x5ede5f[_0x3224b5(0x11d)],_0xfe549c+'.filter',_0x2d6515));if(_0x5ede5f[_0x3224b5(0xfd)]){const _0x5aeef8=_0x5ede5f[_0x3224b5(0x111)]&&_0x5ede5f[_0x3224b5(0x111)]!=='';_0x5aeef8&&!_0x5ede5f[_0x3224b5(0x11d)]&&_0x200e66[_0x3224b5(0xfa)]({'level':_0x3224b5(0x114),'path':_0xfe549c+_0x3224b5(0xfe),'code':_0x3224b5(0xe8),'message':'Behavior\x20source\x20\x27'+_0x5ede5f[_0x3224b5(0xfd)]+'\x27\x20with\x20attribute\x20\x27'+_0x5ede5f[_0x3224b5(0x111)]+'\x27\x20'+_0x3224b5(0xfc)+_0x3224b5(0x105)+_0x3224b5(0x118),'location':getLocationFromPath(_0x2d6515[_0x3224b5(0x128)],_0x2d6515['source'],pathToArray(_0xfe549c+_0x3224b5(0xfe)))}),_0x5aeef8&&_0x5ede5f[_0x3224b5(0x11d)]&&_0x200e66[_0x3224b5(0xfa)]({'level':_0x3224b5(0x124),'path':_0xfe549c+_0x3224b5(0xee),'code':_0x3224b5(0xfb),'message':_0x3224b5(0x11f)+_0x5ede5f[_0x3224b5(0x111)]+_0x3224b5(0x112)+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x2d6515[_0x3224b5(0x128)],_0x2d6515[_0x3224b5(0xfd)],pathToArray(_0xfe549c+_0x3224b5(0xee)))});}}return _0x200e66;}
|