@treasuredata/tdx 0.13.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.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/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/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/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +37 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.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/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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +1 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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/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/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a98_0x546590=a98_0xd296;(function(_0x2441b4,_0x43e714){const _0x2152bd=a98_0xd296,_0x2c5e05=_0x2441b4();while(!![]){try{const _0x4adaef=-parseInt(_0x2152bd(0xc7))/0x1*(parseInt(_0x2152bd(0x160))/0x2)+parseInt(_0x2152bd(0xf4))/0x3+parseInt(_0x2152bd(0x173))/0x4*(parseInt(_0x2152bd(0x12b))/0x5)+parseInt(_0x2152bd(0x181))/0x6+parseInt(_0x2152bd(0x152))/0x7+parseInt(_0x2152bd(0xd2))/0x8+-parseInt(_0x2152bd(0x170))/0x9*(parseInt(_0x2152bd(0xad))/0xa);if(_0x4adaef===_0x43e714)break;else _0x2c5e05['push'](_0x2c5e05['shift']());}catch(_0x59804b){_0x2c5e05['push'](_0x2c5e05['shift']());}}}(a98_0x2237,0xead1b));import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a98_0x546590(0x18c);export const PENDING_ACTIVATION_PREFIX=a98_0x546590(0xab);function a98_0xd296(_0x18db13,_0xd35a32){_0x18db13=_0x18db13-0xa8;const _0x2237ea=a98_0x2237();let _0xd296a7=_0x2237ea[_0x18db13];return _0xd296a7;}export function createPendingSegmentId(_0x4acb34){return''+PENDING_SEGMENT_PREFIX+_0x4acb34+'__';}export function isPendingSegmentId(_0x4c6ba3){return _0x4c6ba3['startsWith'](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x3ca966){const _0x5e4e95=a98_0x546590;return _0x3ca966[_0x5e4e95(0xf6)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4a87e6){return''+PENDING_ACTIVATION_PREFIX+_0x4a87e6+'__';}export function isPendingActivationId(_0x5f172d){const _0x5983b9=a98_0x546590;return _0x5f172d[_0x5983b9(0x18e)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x1c17a1){const _0x57ab94=a98_0x546590;return _0x1c17a1[_0x57ab94(0xf6)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x20a23d,_0x5bbf93){const _0x4c6ab5=a98_0x546590,_0x5435f1=_0x20a23d+'::'+(_0x5bbf93[_0x4c6ab5(0x150)]()||_0x4c6ab5(0x147)),_0x315d8f=createHash('sha1')[_0x4c6ab5(0xac)](_0x5435f1)['digest'](_0x4c6ab5(0xb2))[_0x4c6ab5(0x138)](0x0,0xc);return _0x4c6ab5(0xf8)+_0x315d8f;}export function ensureJourneyDefaults(_0x3d59bc){const _0x46c261=a98_0x546590;!_0x3d59bc[_0x46c261(0x15c)]&&(_0x3d59bc[_0x46c261(0x15c)]=''),!_0x3d59bc[_0x46c261(0x13d)]&&(_0x3d59bc[_0x46c261(0x13d)]=_0x46c261(0x130));}export function resolveTDFolderPath(_0x2aad59,_0x678b3b,_0x2c40cc){const _0x25bacd=a98_0x546590;if(!_0x678b3b)return _0x2aad59;if(_0x2aad59===_0x2c40cc||_0x2aad59[_0x25bacd(0x18e)](_0x2c40cc+'/'))return _0x2aad59;return _0x2aad59?_0x2c40cc+'/'+_0x2aad59:_0x2c40cc;}export function addFoldersToCreate(_0x40d632,_0x24deb0,_0x2e0af4){const _0x1ec03b=a98_0x546590;if(!_0x40d632)return;if(_0x24deb0[_0x1ec03b(0x148)](_0x40d632))return;const _0x13ce8f=_0x40d632[_0x1ec03b(0x10f)]('/');let _0x1e632b='';for(const _0x1869b5 of _0x13ce8f){_0x1e632b=_0x1e632b?_0x1e632b+'/'+_0x1869b5:_0x1869b5,!_0x24deb0[_0x1ec03b(0x148)](_0x1e632b)&&_0x2e0af4[_0x1ec03b(0xde)](_0x1e632b);}}import*as a98_0x86e150 from'yaml';import{readFileSync}from'fs';import a98_0x310c11 from'path';import{isJourneyDef,parseYamlString as a98_0x11249f,toYamlString as a98_0x5c395a,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x2c300a){const _0x2ea1ea=a98_0x546590;if(Array[_0x2ea1ea(0x17a)](_0x2c300a))return'['+_0x2c300a['map'](_0x381c58=>stableStringify(_0x381c58))[_0x2ea1ea(0xdd)](',')+']';if(_0x2c300a&&typeof _0x2c300a==='object'){const _0x3907fe=_0x2c300a,_0xcca712=Object['keys'](_0x3907fe)[_0x2ea1ea(0x156)](),_0x453bd5=_0xcca712[_0x2ea1ea(0xe9)](_0x191502=>'\x22'+_0x191502+'\x22:'+stableStringify(_0x3907fe[_0x191502]));return'{'+_0x453bd5[_0x2ea1ea(0xdd)](',')+'}';}const _0x2b02b5=JSON[_0x2ea1ea(0xc1)](_0x2c300a);return _0x2b02b5===undefined?_0x2ea1ea(0xf1):_0x2b02b5;}function activationSignature(_0x7105a3){const _0x454a16=a98_0x546590,_0x3e7a66={'connection':_0x7105a3[_0x454a16(0x139)],..._0x7105a3['all_columns']!==undefined&&{'all_columns':_0x7105a3[_0x454a16(0xb0)]},..._0x7105a3[_0x454a16(0x15e)]!==undefined&&{'columns':_0x7105a3[_0x454a16(0x15e)]},..._0x7105a3[_0x454a16(0x161)]!==undefined&&{'behavior':_0x7105a3[_0x454a16(0x161)]},..._0x7105a3[_0x454a16(0xdb)]!==undefined&&{'schedule':_0x7105a3[_0x454a16(0xdb)]},..._0x7105a3[_0x454a16(0x14a)]!==undefined&&{'notification':_0x7105a3['notification']},..._0x7105a3['connector_config']!==undefined&&{'connector_config':_0x7105a3[_0x454a16(0x105)]},..._0x7105a3['activation_template_id']!==undefined&&{'activation_template_id':_0x7105a3['activation_template_id']}};return stableStringify(_0x3e7a66);}export async function prepareSegmentFiles(_0x6f0e69,_0x1b7e04,_0x26a9c1,_0x347ccd,_0x196cb6){const _0x4605b4=a98_0x546590,{activationDefToCreateRequest:_0x185042}=await import(_0x4605b4(0x12f)),_0x139b6c=[],_0x5d11e0=new Set();for(const {yamlConfig:_0x104f27,folderPath:_0x2d8f46,sourcePath:_0x39ecde}of _0x6f0e69){const _0x5815b9=resolveTDFolderPath(_0x2d8f46,_0x347ccd,_0x196cb6),_0x36a0f9=_0x5815b9+':'+_0x104f27['name'],_0x5e2a8b=_0x1b7e04['segmentByFolderAndName'][_0x4605b4(0xcc)](_0x36a0f9),_0x25d817=_0x5e2a8b?_0x1b7e04[_0x4605b4(0x18d)]['get'](_0x5e2a8b['id'])||[]:[];addFoldersToCreate(_0x5815b9,_0x1b7e04['folderPathToId'],_0x5d11e0);const _0xa25c80=calculateActivationActions(_0x104f27[_0x4605b4(0x154)]||[],_0x25d817,_0x1b7e04[_0x4605b4(0x159)],_0x1b7e04[_0x4605b4(0x195)]);for(const _0x315478 of _0xa25c80){(_0x315478[_0x4605b4(0x104)]===_0x4605b4(0x168)||_0x315478[_0x4605b4(0x104)]===_0x4605b4(0xac))&&_0x315478[_0x4605b4(0x188)]&&(_0x315478['validatedRequest']=await _0x185042(_0x315478['yamlActivation'],_0x26a9c1));}const _0x4bbfaf=calculateSegmentDiff(_0x104f27,_0x5e2a8b,_0x25d817,_0x1b7e04['idToEmailMap'],_0x1b7e04[_0x4605b4(0x195)]);_0x139b6c['push']({'relativePath':_0x104f27[_0x4605b4(0x196)],'absolutePath':_0x39ecde,'yamlConfig':_0x104f27,'folderPath':_0x5815b9,'existingSegment':_0x5e2a8b,'existingActivations':_0x25d817,'isNew':_0x4bbfaf[_0x4605b4(0xd3)],'hasChanges':_0x4bbfaf['hasChanges'],'diff':_0x4bbfaf[_0x4605b4(0xbd)],'activationActions':_0xa25c80});}return{'segmentFiles':_0x139b6c,'foldersToCreate':_0x5d11e0};}export async function prepareJourneyFiles(_0x58a813,_0x349277,_0x59825d,_0x38f891){const _0x433497=a98_0x546590,_0xa3aa31=[],_0x1cef8f=new Set();for(const {yamlConfig:_0x837987,folderPath:_0x23e24f,sourcePath:_0x576bcc}of _0x58a813){const _0x130fe4=resolveTDFolderPath(_0x23e24f,_0x59825d,_0x38f891),_0x281c41=_0x130fe4+':'+_0x837987[_0x433497(0x196)],_0x9f2a20=_0x349277[_0x433497(0x108)][_0x433497(0xcc)](_0x281c41);let _0x435889,_0x538f1f;if(_0x9f2a20&&_0x9f2a20[_0x433497(0x16f)]>0x0){const _0x2d5442=buildLocalExpandedRuleMappings(_0x837987),{createYamlContext:_0x182e8e,prefetchJourneySegments:_0x323e5f}=createPushYamlContextForBundle(_0x349277[_0x433497(0x15f)],_0x349277['parentId'],_0x349277['existingSegments'],_0x2d5442,_0x349277[_0x433497(0x159)],_0x349277[_0x433497(0x195)],_0x349277['activationStepsById'],_0x349277['journeyById']);await _0x323e5f(_0x9f2a20['map'](_0xa3d490=>_0xa3d490['id']));const _0x26c8dd=hasMultipleVersions(_0x837987),_0x205208=async _0x3d8196=>{const _0x220c0b=_0x433497,_0x9a108c=_0x349277[_0x220c0b(0x120)]?.[_0x220c0b(0xcc)](_0x3d8196);if(_0x9a108c)return _0x9a108c;return _0x349277[_0x220c0b(0xd7)]({'journeyId':_0x3d8196,'journeyName':_0x837987['name'],'isMultiVersion':_0x9f2a20[_0x220c0b(0x16f)]>0x1});};if(_0x26c8dd&&_0x9f2a20[_0x433497(0x16f)]>0x1){const _0x260dc0=[];for(const _0x3be977 of _0x9f2a20){const _0x555b84=_0x3be977[_0x433497(0xef)]||0x1;_0x349277[_0x433497(0x182)]?.[_0x433497(0xac)](_0x433497(0x13c)+_0x837987[_0x433497(0x196)]+'\x20v'+_0x555b84);const _0xee7e4c=await _0x205208(_0x3be977['id']),_0x3d9635=_0x182e8e(_0x3be977['id']),_0x450a12=await journeyResponseToDef(_0xee7e4c,_0x3d9635);_0x260dc0[_0x433497(0xe3)]({'item':_0x3be977,'yaml':_0x450a12});}const _0x32ffe2=buildLocalRuleToNameMappingFromJourney(_0x837987);_0x538f1f=buildMergedJourneyDef(_0x260dc0,_0x32ffe2);const _0x293103=Math[_0x433497(0xf3)](..._0x260dc0[_0x433497(0xe9)](_0x412caa=>_0x412caa[_0x433497(0x135)]['versionNumber']||0x0)),_0x2c1f8f=_0x9f2a20[_0x433497(0xb7)](_0x38869f=>(_0x38869f[_0x433497(0xef)]||0x0)===_0x293103);_0x2c1f8f&&(_0x349277['progress']?.['update'](_0x433497(0x13c)+_0x837987[_0x433497(0x196)]+'\x20v'+_0x293103),_0x435889=await _0x205208(_0x2c1f8f['id']));}else{const _0xbdf34f=_0x9f2a20[_0x9f2a20[_0x433497(0x16f)]-0x1];_0x349277['progress']?.['update'](_0x433497(0x13c)+_0x837987[_0x433497(0x196)]),_0x435889=await _0x205208(_0xbdf34f['id']);const _0x14d563=_0x182e8e(_0xbdf34f['id']),_0x124c56=await journeyResponseToDef(_0x435889,_0x14d563),_0x19c7ab=buildLocalRuleToNameMappingFromJourney(_0x837987);_0x538f1f=buildMergedJourneyDef([{'item':_0xbdf34f,'yaml':_0x124c56}],_0x19c7ab);}}addFoldersToCreate(_0x130fe4,_0x349277[_0x433497(0xc3)],_0x1cef8f);const _0x193af4=calculateJourneyDiff(_0x837987,_0x538f1f);_0xa3aa31[_0x433497(0xe3)]({'relativePath':_0x837987['name'],'absolutePath':_0x576bcc,'yamlConfig':_0x837987,'folderPath':_0x130fe4,'existingJourney':_0x435889,'isNew':_0x193af4[_0x433497(0xd3)],'hasChanges':_0x193af4[_0x433497(0x164)],'diff':_0x193af4['diff']});}return{'journeyFiles':_0xa3aa31,'foldersToCreate':_0x1cef8f};}export function calculateActivationActions(_0x372e61,_0x20ab21,_0x4671bf,_0x44dc0e){const _0x453840=a98_0x546590,_0x1d1883=[],_0x5a9cea=new Map();for(const _0x214d58 of _0x20ab21){_0x5a9cea['set'](_0x214d58[_0x453840(0x196)],_0x214d58);}const _0x30c0c9=new Map();for(const _0x31249f of _0x372e61){_0x30c0c9[_0x453840(0xcf)](_0x31249f['name'],_0x31249f);}for(const _0xf6f439 of _0x372e61){const _0x277c6b=_0x5a9cea[_0x453840(0xcc)](_0xf6f439[_0x453840(0x196)]);if(!_0x277c6b)_0x1d1883[_0x453840(0xe3)]({'type':_0x453840(0x168),'name':_0xf6f439[_0x453840(0x196)],'yamlActivation':_0xf6f439});else{const _0x3ab8b3=activationResponseToDef(_0x277c6b,_0x4671bf,_0x44dc0e),_0x2a956a=a98_0x86e150[_0x453840(0xc1)](_0x3ab8b3),_0x2d6dda=a98_0x86e150[_0x453840(0xc1)](_0xf6f439);_0x2a956a!==_0x2d6dda&&_0x1d1883[_0x453840(0xe3)]({'type':_0x453840(0xac),'name':_0xf6f439['name'],'yamlActivation':_0xf6f439,'existingActivation':_0x277c6b});}}for(const _0x391237 of _0x20ab21){!_0x30c0c9['has'](_0x391237[_0x453840(0x196)])&&_0x1d1883[_0x453840(0xe3)]({'type':'delete','name':_0x391237[_0x453840(0x196)],'existingActivation':_0x391237});}return _0x1d1883;}function a98_0x2237(){const _0x2063a3=['journeyBundleName','Activation','\x20(referenced\x20in\x20journey\x20','resolveSegment','\x27\x20for\x20','from','Entry\x20criteria:\x20','deleted','unchanged','Updated\x20journey\x20\x27','journey_updating','results','journeyById','Created\x20activation\x20\x27','updateActivation','idToName','./journey-yaml.js','ACTIVATION_UPDATE_ERROR','onProgress','ACTIVATION_SYNTAX_ERROR','verbose','segment_deleted','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','10YkBarr','NOT_FOUND','index','exitCriterias','./child-segment-yaml.js','draft','Deleting\x20activation\x20\x27','folder','rootFolderId','activation_created','item','deleteSegment','all','slice','connection','logDeleted','rule','Fetching\x20','state','journey_created','getJourney','JOURNEY_UPDATE_ERROR','\x27...','folderPath','Created\x20journey\x20\x27','Creating\x20activation\x20\x27','JOURNEY_SYNTAX_ERROR','Updated\x20segment\x20\x27','segment','has','journey_creating','notification','journey','reduce','size','action','Segment\x20not\x20found:\x20','trim','yamlConfig','12103952djBqrb','embedded_activation_created','activations','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','sort','activation_updated','SEGMENT_NOT_FOUND','idToEmailMap',').\x20','steps','description','folder_creating','columns','deps','34IWUodI','behavior','\x20segment\x20from\x20file:\x20','updated','hasChanges','SEGMENT_UPDATE_ERROR','existingActivation','\x20journey\x20from\x20file:\x20','create','parentFolder','Deleted\x20activation\x20\x27','getActivation','parseDocument','effectiveFolderId','existingSegments','length','2061rAMwig','logWarning','Created\x20folder\x20\x27','3707756AUQHbS','data','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','parse','waitCondition','activation_deleting','goal','isArray','nameToType','skipSegments','listActivations','\x27\x20entry\x20criteria','absolutePath','parentId','9255078iJZGjI','progress','Created\x20segment\x20\x27','validatedRequest','entry_criteria','createActivation','utf-8','yamlActivation','SEGMENT_SYNTAX_ERROR','listSegments','deleteActivation','__pending_','activationsBySegmentId','startsWith','createJourneySegment','journeyActivationStepId','relative','journey_updated','valid','journeyStages','connectionIdToNameMap','name','toLowerCase','with','filter','__pending_act_','update','252610hreYQP','journeyId','toString','all_columns','Stage\x20\x27','hex','\x0a\x20\x20','goal\x20criteria','decision_point','embedded_segment_creating','find','Updating\x20activation\x20\x27','activation_','relationships','segmentId','kind','diff','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','includes','stages','stringify','\x27\x20from\x20file:\x20','folderPathToId','buildUserMaps','embedded_segment_created','\x27\x20milestone','82102cMOhzu','logSuccess','folderId','dirname','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','get','existingSegment','flatMap','set','segment_deleting','embedded_activation_creating','15032528SzVJCE','isNew','segmentNameToId','stage\x20\x27','withProgress','fetchJourney','getSegment','Updating\x20segment\x20\x27','createdSegmentId','schedule','updateSegmentById','join','add','\x27\x20wait\x20condition','Updated\x20activation\x20\x27','message','segmentFolderId','push','branches','entryCriteria','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','\x27\x20decision\x20point\x20branch\x20\x27','Creating\x20folder\x20\x27','map','createFolder','segments','milestone','existingJourney','delete','versionNumber','activation_updating','null','activationActions','max','3413187KAyIlj','parentSegmentFolder','replace','createSegment','journey_entry_criteria_','activationParams','Failed\x20to\x20','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','activationContext','DecisionPoint','WaitStep','embeddedSegmentNameToId','keys','activation_deleted','journeys','Deleted\x20segment\x20\x27','type','connector_config','logInfo','resolveJourneyId','journeyBundlesByFolderAndName','created','../../utils/async.js','segment_updated','createdSegmentIds','Name\x20has\x20already\x20been\x20taken','segment_creating','split','attributes','entries','activation_creating','\x20error(s)'];a98_0x2237=function(){return _0x2063a3;};return a98_0x2237();}export function calculateSegmentDiff(_0x46caca,_0x548d68,_0xd6c05f,_0x264fb4,_0x9310ef){const _0x5cf6dc=segmentToYamlString(_0x46caca);if(_0x548d68){const _0x3a1ce3=segmentWithActivationsToYaml(_0x548d68,_0xd6c05f,undefined,_0x264fb4,_0x9310ef),_0x5c61bc=segmentToYamlString(_0x3a1ce3),_0xde9dba=generateDiff(_0x5c61bc,_0x5cf6dc),_0x938edc=hasChanges(_0xde9dba);return{'isNew':![],'hasChanges':_0x938edc,'diff':_0x938edc?formatDiffWithColors(_0xde9dba):undefined};}const _0xb6ad38=generateDiff('',_0x5cf6dc);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0xb6ad38)};}export function calculateJourneyDiff(_0x1a9890,_0x19b00b){const _0x193abb=normalizeJourneyDef(_0x1a9890,_0x1a9890),_0x23747d=a98_0x5c395a(_0x193abb);if(_0x19b00b){const _0xe30b2e=normalizeJourneyDef(_0x19b00b,_0x1a9890),_0x5b7a12=a98_0x5c395a(_0xe30b2e),_0x276263=generateDiff(_0x5b7a12,_0x23747d),_0xe9435b=hasChanges(_0x276263);return{'isNew':![],'hasChanges':_0xe9435b,'diff':_0xe9435b?formatDiffWithColors(_0x276263):undefined};}const _0x23f2fd=generateDiff('',_0x23747d);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x23f2fd)};}export function findSegmentsToDelete(_0xd8e94e,_0x4f985c,_0x574733,_0x20c0f3,_0x3d264f){const _0x4388c6=a98_0x546590,_0x4e1b89=new Set();for(const {yamlConfig:_0x5c137a,folderPath:_0x4d0176}of _0x4f985c){_0x4e1b89[_0x4388c6(0xde)](_0x4d0176+':'+_0x5c137a['name']);}return _0xd8e94e[_0x4388c6(0xaa)](_0x5bb4e6=>{const _0x47b73f=_0x4388c6,_0xf1fcf9=_0x5bb4e6[_0x47b73f(0xe2)]?_0x574733[_0x47b73f(0xcc)](_0x5bb4e6['segmentFolderId']['toString']())||'':'',_0x500990=_0xf1fcf9+':'+_0x5bb4e6['name'];if(_0x4e1b89[_0x47b73f(0x148)](_0x500990))return![];if(_0x3d264f)return _0xf1fcf9===_0x20c0f3||_0xf1fcf9['startsWith'](_0x20c0f3+'/');return!![];});}export function findJourneysToDelete(_0x1125f4,_0xac066e,_0x3f5774,_0x4f76a9,_0x5e0ae2){const _0x3535fa=a98_0x546590,_0x3d2c78=new Set();for(const {yamlConfig:_0x319495,folderPath:_0x120655}of _0xac066e){_0x3d2c78['add'](_0x120655+':'+_0x319495[_0x3535fa(0x196)]);}return _0x1125f4[_0x3535fa(0xaa)](_0x37c0d1=>{const _0x3e48c8=_0x3535fa,_0x3c7a54=_0x37c0d1[_0x3e48c8(0xc9)]?_0x3f5774[_0x3e48c8(0xcc)](_0x37c0d1[_0x3e48c8(0xc9)])||'':'',_0x51f542=_0x3c7a54+':'+_0x37c0d1[_0x3e48c8(0x114)];if(_0x3d2c78[_0x3e48c8(0x148)](_0x51f542))return![];if(_0x5e0ae2)return _0x3c7a54===_0x4f76a9||_0x3c7a54[_0x3e48c8(0x18e)](_0x4f76a9+'/');return!![];});}export function buildSegmentLookupMap(_0x5654b4,_0x5b18cb){const _0x2d8099=a98_0x546590,_0x1118d6=new Map();for(const _0x3230fd of _0x5654b4){const _0x25556c=_0x3230fd[_0x2d8099(0xe2)]?_0x5b18cb['get'](_0x3230fd[_0x2d8099(0xe2)][_0x2d8099(0xaf)]())||'':'',_0x194ae3=_0x25556c+':'+_0x3230fd[_0x2d8099(0x196)];_0x1118d6[_0x2d8099(0xcf)](_0x194ae3,_0x3230fd);}return _0x1118d6;}export function buildSegmentNameToIdMap(_0x58340b){const _0x5c6465=a98_0x546590,_0x342309=new Map();for(const _0x51ac03 of _0x58340b){_0x342309['set'](_0x51ac03[_0x5c6465(0x196)],_0x51ac03['id']);}return _0x342309;}export function buildJourneyBundleLookupMap(_0x466dab,_0x534085){const _0xc44c76=a98_0x546590,_0x4ae871=new Map();for(const _0x14f694 of _0x466dab){const _0x159ec0=_0x14f694[_0xc44c76(0xc9)]?_0x534085[_0xc44c76(0xcc)](_0x14f694[_0xc44c76(0xc9)])||'':'',_0x30883f=_0x159ec0+':'+_0x14f694[_0xc44c76(0x114)];!_0x4ae871[_0xc44c76(0x148)](_0x30883f)&&_0x4ae871[_0xc44c76(0xcf)](_0x30883f,[]),_0x4ae871[_0xc44c76(0xcc)](_0x30883f)[_0xc44c76(0xe3)](_0x14f694);}for(const _0x112193 of _0x4ae871['values']()){_0x112193[_0xc44c76(0x156)]((_0x2039e6,_0x42993d)=>(_0x2039e6[_0xc44c76(0xef)]||0x0)-(_0x42993d['versionNumber']||0x0));}return _0x4ae871;}export function collectFoldersToCreate(_0x84feee,_0x392a96){const _0x36462c=a98_0x546590,_0x587146=new Set();for(const _0x31e784 of _0x84feee){if(!_0x31e784)continue;if(_0x392a96[_0x36462c(0x148)](_0x31e784))continue;const _0x48d544=_0x31e784[_0x36462c(0x10f)]('/');let _0x1dffcf='';for(const _0x402116 of _0x48d544){_0x1dffcf=_0x1dffcf?_0x1dffcf+'/'+_0x402116:_0x402116,!_0x392a96[_0x36462c(0x148)](_0x1dffcf)&&_0x587146[_0x36462c(0xde)](_0x1dffcf);}}return _0x587146;}export function parseAndClassifyYamlFiles(_0x1fb348,_0x4674f0,_0x54cf9e){const _0x4d4cc1=a98_0x546590,_0x29b97b=[],_0x512e78=[];for(const _0x2a5995 of _0x1fb348){const _0x5cd1e4=a98_0x310c11[_0x4d4cc1(0x191)](_0x4674f0,a98_0x310c11[_0x4d4cc1(0xca)](_0x2a5995)),_0x4110b8=_0x5cd1e4==='.'?'':_0x5cd1e4,_0x17a1ea=readFileSync(_0x2a5995,_0x4d4cc1(0x187)),_0x35ea1a=a98_0x86e150[_0x4d4cc1(0x176)](_0x17a1ea);if(isJourneyDef(_0x35ea1a)){const _0xaaf436=a98_0x11249f(_0x17a1ea);_0x512e78[_0x4d4cc1(0xe3)]({'yamlConfig':_0xaaf436,'folderPath':_0x4110b8,'sourcePath':_0x2a5995});}else{if(!_0x54cf9e?.[_0x4d4cc1(0x17c)]){const _0x3a4d48=parseSegmentYamlFile(_0x17a1ea),_0x1b0381=normalizeChildSegmentYaml(_0x3a4d48);_0x29b97b[_0x4d4cc1(0xe3)]({'yamlConfig':_0x1b0381,'folderPath':_0x4110b8,'sourcePath':_0x2a5995});}}}return{'segments':_0x29b97b,'journeys':_0x512e78};}export function validateParsedFiles(_0x2141f1,_0x16e8e8){const _0x2145a1=a98_0x546590,_0xbdb406=[];for(const {yamlConfig:_0x482549,sourcePath:_0x13fd5f}of _0x2141f1[_0x2145a1(0xeb)]){const _0x2db136=readFileSync(_0x13fd5f,_0x2145a1(0x187)),_0xcefcae=a98_0x86e150[_0x2145a1(0x16c)](_0x2db136),_0x2702cc=validateSegmentDef(_0x482549,{'source':_0x2db136,'document':_0xcefcae});if(!_0x2702cc['valid']){const _0x31debe=a98_0x310c11[_0x2145a1(0x191)](_0x16e8e8,_0x13fd5f);_0xbdb406['push']({'filePath':_0x31debe,'source':_0x2db136,'result':_0x2702cc,'isJourney':![]});}}for(const {yamlConfig:_0x58960e,sourcePath:_0x446f2f}of _0x2141f1[_0x2145a1(0x102)]){const _0x3d2558=readFileSync(_0x446f2f,'utf-8'),_0x2cec84=a98_0x86e150[_0x2145a1(0x16c)](_0x3d2558),_0x127a10=validateJourneyDef(_0x58960e,{'source':_0x3d2558,'document':_0x2cec84});if(!_0x127a10[_0x2145a1(0x193)]){const _0xfe36c8=a98_0x310c11[_0x2145a1(0x191)](_0x16e8e8,_0x446f2f);_0xbdb406[_0x2145a1(0xe3)]({'filePath':_0xfe36c8,'source':_0x3d2558,'result':_0x127a10,'isJourney':!![]});}}return _0xbdb406;}export function formatValidationErrors(_0x1c2cc2){const _0x416aa7=a98_0x546590,_0x4ce90c=[];for(const {filePath:_0x4e22e6,source:_0x1b23ad,result:_0x3fa428,isJourney:_0x3072be}of _0x1c2cc2){const _0x409aab=_0x3072be?'journey':_0x416aa7(0x147);_0x4ce90c['push']('\x0a'+_0x4e22e6+'\x20('+_0x409aab+'):\x20'+_0x3fa428['errors'][_0x416aa7(0x16f)]+_0x416aa7(0x113)),_0x4ce90c[_0x416aa7(0xe3)](formatValidationResult(_0x3fa428,_0x1b23ad,_0x4e22e6));}return _0x4ce90c[_0x416aa7(0xdd)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x4ca2a5){const _0xb48791=a98_0x546590,_0x582e3d=new Set(),_0x3ff9e8=new Map(),_0x46f580=collectSegmentUsageCounts(_0x4ca2a5);if(_0x4ca2a5[_0xb48791(0xeb)])for(const [_0x5e20a2,_0x5dce6c]of Object[_0xb48791(0x111)](_0x4ca2a5[_0xb48791(0xeb)])){_0x582e3d[_0xb48791(0xde)](_0x5e20a2);if(_0x5dce6c[_0xb48791(0x13b)]){const _0x443573=yamlRuleToApi(_0x5dce6c['rule']),_0x55c06d=apiRuleToYaml(_0x443573);_0x3ff9e8[_0xb48791(0xcf)](_0x5e20a2,_0x55c06d);}}const _0x26046b=new Map();let _0x1a0766=0x0;for(const [_0x1815b2,_0x2003a8]of _0x3ff9e8){const _0x20ae6a=serializeExpandedRule(_0x2003a8,_0x3ff9e8),_0x502295=_0x26046b[_0xb48791(0xcc)](_0x20ae6a)||[];_0x502295[_0xb48791(0xe3)]({'name':_0x1815b2,'index':_0x1a0766}),_0x26046b[_0xb48791(0xcf)](_0x20ae6a,_0x502295),_0x1a0766++;}const _0x51dd64=new Map();for(const [_0x59c5ab,_0x2503ce]of _0x26046b){const _0x4eb8cc=_0x2503ce[_0xb48791(0x138)]()[_0xb48791(0x156)]((_0x582a60,_0x268811)=>{const _0x4ae317=_0xb48791,_0x1900da=_0x46f580[_0x4ae317(0xcc)](_0x582a60['name'])||0x0,_0x26f47f=_0x46f580[_0x4ae317(0xcc)](_0x268811['name'])||0x0;if(_0x1900da!==_0x26f47f)return _0x26f47f-_0x1900da;return _0x582a60[_0x4ae317(0x12d)]-_0x268811['index'];})['map'](_0x4d9158=>_0x4d9158[_0xb48791(0x196)]),_0x18796e=[];for(const _0x199002 of _0x4eb8cc){const _0x4e6657=_0x46f580['get'](_0x199002)||0x0,_0x335095=Math[_0xb48791(0xf3)](_0x4e6657,0x1);for(let _0x506fee=0x0;_0x506fee<_0x335095;_0x506fee++){_0x18796e[_0xb48791(0xe3)](_0x199002);}}_0x51dd64[_0xb48791(0xcf)](_0x59c5ab,_0x18796e);}return{'existingLocalSegmentNames':_0x582e3d,'localSegmentRules':_0x3ff9e8,'localExpandedRuleToNames':_0x51dd64};}async function buildServerSegmentRuleMap(_0x4e1115,_0x14851f,_0x55e2a1,_0x3fb735){const _0x595cdf=new Map(),_0x2cdbba=new Set(),_0x241066=async _0x5345f4=>{const _0x60c926=a98_0xd296;if(_0x2cdbba[_0x60c926(0x148)](_0x5345f4))return;_0x2cdbba[_0x60c926(0xde)](_0x5345f4);let _0xf13c16=_0x55e2a1['find'](_0x3fe27b=>_0x3fe27b['id']===_0x5345f4);if(!_0xf13c16)try{_0xf13c16=await _0x4e1115[_0x60c926(0x147)][_0x60c926(0xd8)](_0x14851f,_0x5345f4);}catch{return;}if(!_0xf13c16?.[_0x60c926(0x13b)])return;const _0x481856=apiRuleToYaml(_0xf13c16[_0x60c926(0x13b)]);_0x595cdf[_0x60c926(0xcf)](_0x5345f4,_0x481856);const _0x1d6601=collectSegmentRefsFromRule(_0x481856);for(const _0x1d227a of _0x1d6601){await _0x241066(_0x1d227a);}};for(const _0x204f9c of _0x3fb735){await _0x241066(_0x204f9c);}return _0x595cdf;}export function createSegmentIdResolver(_0x5add50,_0x582334){return async _0x1b9958=>{const _0x4dfb2e=a98_0xd296,_0x1caf80=_0x5add50['get'](_0x1b9958);if(!_0x1caf80)throw new SDKError(ErrorCode[_0x4dfb2e(0x158)],_0x4dfb2e(0x14f)+_0x1b9958+_0x4dfb2e(0xcb)+_0x582334+'\x27)');return _0x1caf80;};}export function extractRootFolderId(_0xa8549c){const _0x1de18c=a98_0x546590;return _0xa8549c['relationships']?.[_0x1de18c(0xf5)]?.[_0x1de18c(0x174)]?.['id']||_0xa8549c['relationships']?.[_0x1de18c(0x169)]?.['data']?.['id'];}export function buildConnectionMaps(_0x1b1788){const _0x2c0c33=a98_0x546590,_0x2b4ea0=new Map(),_0x2fee18=new Map(),_0x12b334=new Map();for(const _0x29b643 of _0x1b1788){_0x2b4ea0[_0x2c0c33(0xcf)](_0x29b643[_0x2c0c33(0x196)],parseInt(_0x29b643['id'],0xa)),_0x2fee18[_0x2c0c33(0xcf)](_0x29b643['id'],_0x29b643[_0x2c0c33(0x196)]),_0x12b334[_0x2c0c33(0xcf)](_0x29b643[_0x2c0c33(0x196)],_0x29b643[_0x2c0c33(0x104)]);}return{'nameToId':_0x2b4ea0,'idToName':_0x2fee18,'nameToType':_0x12b334};}export function calculatePushStats(_0x3fb367,_0x3bde59,_0x1dfc58,_0x11919f,_0x595ef2,_0x2f36b9,_0x19153b){const _0x254df8=a98_0x546590,_0x2dc648=_0x3fb367['filter'](_0x21e224=>_0x21e224[_0x254df8(0xd3)]),_0x2627dc=_0x3fb367[_0x254df8(0xaa)](_0xc79fb5=>!_0xc79fb5['isNew']&&_0xc79fb5[_0x254df8(0x164)]),_0x13594c=_0x3fb367[_0x254df8(0xaa)](_0x9b40f1=>!_0x9b40f1['isNew']&&!_0x9b40f1[_0x254df8(0x164)]),_0x40722d=_0x2f36b9?_0x11919f:[],_0x579ad9=_0x3bde59[_0x254df8(0xaa)](_0x12a5e8=>_0x12a5e8[_0x254df8(0xd3)]),_0x1d9e1b=_0x3bde59[_0x254df8(0xaa)](_0x20e124=>!_0x20e124[_0x254df8(0xd3)]&&_0x20e124['hasChanges']),_0x13dbd0=_0x3bde59[_0x254df8(0xaa)](_0x391fac=>!_0x391fac[_0x254df8(0xd3)]&&!_0x391fac['hasChanges']),_0x56876d=_0x2f36b9?_0x595ef2:[],_0x1220e9=_0x3fb367[_0x254df8(0xce)](_0x6a29e4=>_0x6a29e4[_0x254df8(0xf2)]),_0x52078d=_0x1220e9[_0x254df8(0xaa)](_0x406525=>_0x406525[_0x254df8(0x104)]===_0x254df8(0x168)),_0xb4ed50=_0x1220e9['filter'](_0x6bce5e=>_0x6bce5e[_0x254df8(0x104)]===_0x254df8(0xac)),_0x43cacc=_0x1220e9[_0x254df8(0xaa)](_0x5e4baa=>_0x5e4baa[_0x254df8(0x104)]===_0x254df8(0xee)),_0x5e98c1=Array[_0x254df8(0x119)](_0x1dfc58)[_0x254df8(0x156)](),_0x1cd3df=_0x19153b?![]:_0x2dc648[_0x254df8(0x16f)]>0x0||_0x2627dc['length']>0x0||_0x40722d[_0x254df8(0x16f)]>0x0,_0x3f1a48=_0x579ad9[_0x254df8(0x16f)]>0x0||_0x1d9e1b[_0x254df8(0x16f)]>0x0||_0x56876d[_0x254df8(0x16f)]>0x0,_0x46fbe0=_0x19153b?![]:_0x1220e9['length']>0x0,_0x30f437=_0x5e98c1[_0x254df8(0x16f)]>0x0;return{'segments':{'new':_0x2dc648,'changed':_0x2627dc,'unchanged':_0x13594c,'toDelete':_0x40722d},'journeys':{'new':_0x579ad9,'changed':_0x1d9e1b,'unchanged':_0x13dbd0,'toDelete':_0x56876d},'activations':{'all':_0x1220e9,'toCreate':_0x52078d,'toUpdate':_0xb4ed50,'toDelete':_0x43cacc},'folders':{'toCreate':_0x5e98c1},'counts':{'segments':{'new':_0x2dc648[_0x254df8(0x16f)],'changed':_0x2627dc['length'],'unchanged':_0x13594c[_0x254df8(0x16f)],'toDelete':_0x40722d[_0x254df8(0x16f)]},'journeys':{'new':_0x579ad9[_0x254df8(0x16f)],'changed':_0x1d9e1b['length'],'unchanged':_0x13dbd0['length'],'toDelete':_0x56876d['length']},'activations':{'create':_0x52078d[_0x254df8(0x16f)],'update':_0xb4ed50[_0x254df8(0x16f)],'delete':_0x43cacc[_0x254df8(0x16f)]},'folders':_0x5e98c1['length']},'hasChanges':_0x1cd3df||_0x3f1a48||_0x46fbe0||_0x30f437};}export async function buildPushExecutionContext(_0x44a662,_0x13c17b,_0x5390e6,_0x939d8c,_0x2a4604,_0x1149a8){const _0x248859=a98_0x546590,_0x42a59e=extractRootFolderId(_0x5390e6),{pathToId:_0x4e9620,idToPath:_0x337463}=buildFolderMaps(_0x2a4604),_0x1406d5=buildSegmentNameToIdMap(_0x939d8c),_0x1bab96=new Map(),{batchAsync:_0x4ffa15}=await import(_0x248859(0x10a)),[_0x40c58a,_0x47b058]=await Promise[_0x248859(0x137)]([_0x44a662['user'][_0x248859(0xc4)](),_0x44a662[_0x248859(0x139)]['list'](),((async()=>{const _0x5eb3ff=_0x248859;!_0x1149a8&&_0x939d8c[_0x5eb3ff(0x16f)]>0x0&&await _0x4ffa15(_0x939d8c,async _0x1d5697=>{const _0x549c6d=_0x5eb3ff,_0x913891=await _0x44a662['segment'][_0x549c6d(0x17d)](_0x13c17b,_0x1d5697['id']);_0x1bab96[_0x549c6d(0xcf)](_0x1d5697['id'],_0x913891);});})())]),{emailToId:_0x126e1f,idToEmail:_0x5d239e}=_0x40c58a,_0x7ba783=buildConnectionMaps(_0x47b058);return{'rootFolderId':_0x42a59e,'folderPathToId':_0x4e9620,'folderIdToPath':_0x337463,'segmentNameToId':_0x1406d5,'activationsBySegmentId':_0x1bab96,'emailToIdMap':_0x126e1f,'idToEmailMap':_0x5d239e,'connectionNameToIdMap':_0x7ba783['nameToId'],'connectionIdToNameMap':_0x7ba783[_0x248859(0x123)],'connectionNameToTypeMap':_0x7ba783[_0x248859(0x17b)]};}export function createPushYamlContextForBundle(_0x28dbbc,_0x5d95a0,_0x4e02f8,_0x5023c4,_0x10cd91,_0x16d0d6,_0x522fb4,_0x5844ba){const {existingLocalSegmentNames:_0xe747c5,localExpandedRuleToNames:_0xec30d7}=_0x5023c4,_0x2f4a01=new Set(),_0x550d26=new Map(),_0x51afe1=new Map(),_0x1c405e=new Map(),_0x3a8443=createJumpTargetCache(),_0x59acbb=new Map(),_0x4a4336=new Map(),_0x4dba09=new Set();let _0x187a94;const _0x3f35d=_0x4922ad=>{const _0xaf1bb7={'resolveSegment':async _0x143f39=>{const _0x3ca987=a98_0xd296,_0x554498=_0x1c405e[_0x3ca987(0xcc)](_0x143f39);if(_0x554498!==undefined)return{'name':_0x554498,'isJourneyLocal':!![]};try{let _0x1ac50c=_0x4e02f8[_0x3ca987(0xb7)](_0x693654=>_0x693654['id']===_0x143f39);!_0x1ac50c&&(_0x1ac50c=await _0x28dbbc[_0x3ca987(0x147)][_0x3ca987(0xd8)](_0x5d95a0,_0x143f39));const _0x110486=generateJourneyLocalName(_0x1ac50c[_0x3ca987(0x196)]),_0x179685=_0x1ac50c[_0x3ca987(0xbc)]===SEGMENT_KIND_JOURNEY&&_0x110486!==undefined;let _0x3353be=_0x1ac50c[_0x3ca987(0x196)],_0x4456d7;if(_0x179685&&_0x1ac50c[_0x3ca987(0x13b)]){const _0x482a52=apiRuleToYaml(_0x1ac50c[_0x3ca987(0x13b)]);_0x4a4336[_0x3ca987(0xcf)](_0x143f39,_0x482a52);const _0x5261b9=async _0x4d3269=>{const _0x58bd6=_0x3ca987,_0x99e4c2=collectSegmentRefsFromRule(_0x4d3269);for(const _0x19952d of _0x99e4c2){if(!_0x4a4336[_0x58bd6(0x148)](_0x19952d))try{const _0x6f1a69=await _0x28dbbc[_0x58bd6(0x147)][_0x58bd6(0xd8)](_0x5d95a0,_0x19952d);if(_0x6f1a69?.[_0x58bd6(0x13b)]){const _0x5f0746=apiRuleToYaml(_0x6f1a69[_0x58bd6(0x13b)]);_0x4a4336[_0x58bd6(0xcf)](_0x19952d,_0x5f0746),await _0x5261b9(_0x5f0746);}}catch{}}};await _0x5261b9(_0x482a52);const _0x1714ba=serializeExpandedRule(_0x482a52,_0x4a4336),_0x186cdd=_0xec30d7[_0x3ca987(0xcc)](_0x1714ba);if(_0x186cdd&&_0x186cdd[_0x3ca987(0x16f)]>0x0){const _0x5b1828=_0x550d26['get'](_0x1714ba)||0x0,_0x3a526e=_0x186cdd[_0x5b1828]||_0x186cdd[_0x186cdd[_0x3ca987(0x16f)]-0x1];_0x550d26['set'](_0x1714ba,_0x5b1828+0x1),_0x3353be=_0x3a526e,_0x2f4a01[_0x3ca987(0xde)](_0x3353be),_0x1c405e[_0x3ca987(0xcf)](_0x143f39,_0x3353be);const _0x381104=await resolveRuleSegmentRefs(_0x482a52,async _0x397b3c=>{const _0x537dd1=_0x3ca987,_0x5ba8c5=_0x1c405e['get'](_0x397b3c);if(_0x5ba8c5)return _0x5ba8c5;const _0x279b91=await _0x187a94[_0x537dd1(0x117)](_0x397b3c);return _0x279b91['name'];});_0x4456d7={'description':_0x1ac50c['description'],'rule':_0x381104};}else{const _0x5bc351=_0x59acbb[_0x3ca987(0xcc)](_0x1714ba);if(_0x5bc351)_0x3353be=_0x5bc351,_0x1c405e[_0x3ca987(0xcf)](_0x143f39,_0x3353be);else{if(_0x110486){let _0x5945aa=_0x110486,_0x4ae8d4=0x2;while(_0x2f4a01[_0x3ca987(0x148)](_0x5945aa)||_0xe747c5['has'](_0x5945aa)){_0x5945aa=_0x110486+'_'+_0x4ae8d4,_0x4ae8d4++;}_0x2f4a01[_0x3ca987(0xde)](_0x5945aa),_0x3353be=_0x5945aa;}_0x1c405e[_0x3ca987(0xcf)](_0x143f39,_0x3353be),_0x59acbb[_0x3ca987(0xcf)](_0x1714ba,_0x3353be);const _0x47e387=await resolveRuleSegmentRefs(_0x482a52,async _0xc9bf2=>{const _0x42c691=_0x3ca987,_0x4073ef=_0x1c405e['get'](_0xc9bf2);if(_0x4073ef)return _0x4073ef;const _0x1fa6f9=await _0x187a94[_0x42c691(0x117)](_0xc9bf2);return _0x1fa6f9[_0x42c691(0x196)];});_0x4456d7={'description':_0x1ac50c['description'],'rule':_0x47e387};}}}return{'name':_0x3353be,'isJourneyLocal':_0x179685,'definition':_0x4456d7};}catch{return{'name':_0x143f39,'isJourneyLocal':![]};}},'resolveActivation':async _0x22f177=>{const _0x666eef=a98_0xd296,_0xa82292=_0x51afe1[_0x666eef(0xcc)](_0x22f177);if(_0xa82292!==undefined)return{'name':_0xa82292,'isJourneyLocal':!![]};try{let _0x1efb5d=_0x522fb4?.[_0x666eef(0xcc)](_0x22f177);!_0x1efb5d&&(_0x1efb5d=await _0x28dbbc[_0x666eef(0x14b)][_0x666eef(0x16b)](_0x4922ad,_0x22f177));const _0xc3dae6=_0x1efb5d[_0x666eef(0x110)][_0x666eef(0xf9)]['name']||_0x22f177,_0x8d75b0=sanitizeYamlKey(_0xc3dae6)||_0x666eef(0xb9)+_0x22f177,_0x3acba0=_0x8d75b0;_0x51afe1[_0x666eef(0xcf)](_0x22f177,_0x3acba0);const _0x4c18a0=journeyActivationStepToYaml(_0x1efb5d,_0x10cd91,_0x16d0d6);return{'name':_0x3acba0,'isJourneyLocal':!![],'definition':_0x4c18a0};}catch{return{'name':_0x22f177,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x579685,_0x2f9a1c)=>resolveJumpTarget(_0x579685,_0x2f9a1c,_0x3a8443,async _0x150f78=>{const _0x246f70=a98_0xd296,_0x385829=_0x5844ba?.[_0x246f70(0xcc)](_0x150f78);if(_0x385829)return _0x385829;return _0x28dbbc[_0x246f70(0x14b)][_0x246f70(0x13f)](_0x150f78);})};return _0x187a94=_0xaf1bb7,_0xaf1bb7;},_0x38077c=async _0x189c63=>{const _0x358bc3=a98_0xd296,{collectSegmentIdsFromJourneyApi:_0x5d9469}=await import(_0x358bc3(0x124)),{batchAsync:_0x19d101}=await import(_0x358bc3(0x10a)),_0x5c1890=new Set();for(const _0x2cac23 of _0x189c63){let _0x1ca78b=_0x5844ba?.['get'](_0x2cac23);!_0x1ca78b&&(_0x1ca78b=await _0x28dbbc[_0x358bc3(0x14b)][_0x358bc3(0x13f)](_0x2cac23));const _0x1aa722=_0x5d9469(_0x1ca78b);for(const _0x1fefd8 of _0x1aa722){_0x5c1890[_0x358bc3(0xde)](_0x1fefd8);}}let _0x4b717d=Array[_0x358bc3(0x119)](_0x5c1890);while(_0x4b717d[_0x358bc3(0x16f)]>0x0){const _0x74c37=_0x4b717d[_0x358bc3(0xaa)](_0x3ebfa4=>!_0x4dba09[_0x358bc3(0x148)](_0x3ebfa4));if(_0x74c37['length']===0x0)break;const _0x4dccc8=await _0x19d101(_0x74c37,async _0x14fd29=>{const _0x3bba5f=_0x358bc3;_0x4dba09[_0x3bba5f(0xde)](_0x14fd29);let _0x307900=_0x4e02f8[_0x3bba5f(0xb7)](_0x38fec0=>_0x38fec0['id']===_0x14fd29);if(!_0x307900)try{_0x307900=await _0x28dbbc[_0x3bba5f(0x147)][_0x3bba5f(0xd8)](_0x5d95a0,_0x14fd29);}catch{return null;}return{'segmentId':_0x14fd29,'segment':_0x307900};},0xa),_0x179fe5=new Set();for(const _0x5dcdad of _0x4dccc8){if(!_0x5dcdad?.[_0x358bc3(0x147)]?.[_0x358bc3(0x13b)])continue;const _0x3f80b8=apiRuleToYaml(_0x5dcdad['segment']['rule']);_0x4a4336[_0x358bc3(0xcf)](_0x5dcdad[_0x358bc3(0xbb)],_0x3f80b8);const _0x432a3d=collectSegmentRefsFromRule(_0x3f80b8);for(const _0x2d10f6 of _0x432a3d){!_0x4dba09['has'](_0x2d10f6)&&_0x179fe5[_0x358bc3(0xde)](_0x2d10f6);}}_0x4b717d=Array[_0x358bc3(0x119)](_0x179fe5);}};return{'createYamlContext':_0x3f35d,'prefetchJourneySegments':_0x38077c};}export async function executePushSegments(_0xde0d9d,_0x2bfa01,_0x3820b3,_0x4f0246,_0x1b748b){const _0x5e48a8=a98_0x546590,{segmentDefToCreateRequest:_0x492409,segmentDefToUpdateRequest:_0x2d3973}=await import(_0x5e48a8(0x12f)),_0x26f039=_0x3820b3[_0x5e48a8(0xc3)],_0x169a72=0x5,_0x24ea0a=async _0x4e6d17=>{const _0x390780=_0x5e48a8,_0x49143d=_0x4e6d17['folderPath']?_0x26f039['get'](_0x4e6d17[_0x390780(0x142)]):undefined;let _0x4d494e;const _0x2f2f2e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x4e6d17['isNew']){_0x1b748b[_0x390780(0x126)]?.({'type':_0x390780(0x10e),'name':_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]});const _0x26cb62=_0x492409(_0x4e6d17['yamlConfig'],_0x49143d),_0x34a48b=await _0x1b748b[_0x390780(0xd6)]('Creating\x20segment\x20\x27'+_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]+_0x390780(0x141),()=>_0xde0d9d[_0x390780(0x147)][_0x390780(0xf7)](_0x4f0246['parentId'],_0x26cb62));_0x4d494e=_0x34a48b[_0x390780(0x174)]['id'],_0x2f2f2e[_0x390780(0xda)]={'name':_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)],'id':_0x4d494e},_0x1b748b[_0x390780(0x126)]?.({'type':'segment_created','name':_0x4e6d17['yamlConfig'][_0x390780(0x196)],'segmentId':_0x4d494e}),_0x1b748b[_0x390780(0xc8)]?.(_0x390780(0x183)+_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]+'\x27'),_0x2f2f2e[_0x390780(0x109)]=0x1;}else{if(_0x4e6d17[_0x390780(0x164)]){_0x1b748b[_0x390780(0x126)]?.({'type':'segment_updating','name':_0x4e6d17['yamlConfig'][_0x390780(0x196)]});const _0x1eb3af=_0x2d3973(_0x4e6d17['yamlConfig']);_0x49143d!==_0x4e6d17[_0x390780(0xcd)]?.[_0x390780(0xe2)]&&(_0x1eb3af[_0x390780(0xe2)]=_0x49143d?parseInt(_0x49143d,0xa):undefined),await _0x1b748b[_0x390780(0xd6)](_0x390780(0xd9)+_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)]+_0x390780(0x141),()=>_0xde0d9d['segment'][_0x390780(0xdc)](_0x4f0246['parentId'],_0x4e6d17[_0x390780(0xcd)]['id'],_0x1eb3af)),_0x4d494e=_0x4e6d17[_0x390780(0xcd)]['id'],_0x1b748b['onProgress']?.({'type':_0x390780(0x10b),'name':_0x4e6d17[_0x390780(0x151)]['name']}),_0x1b748b[_0x390780(0xc8)]?.(_0x390780(0x146)+_0x4e6d17['yamlConfig'][_0x390780(0x196)]+'\x27'),_0x2f2f2e[_0x390780(0x163)]=0x1;}else _0x4d494e=_0x4e6d17[_0x390780(0xcd)]['id'];}}catch(_0x51b948){const _0xd80965=isHttp400Error(_0x51b948),_0x9141c6=_0xd80965?ErrorCode[_0x390780(0x189)]:ErrorCode[_0x390780(0x165)],_0x23c98f=getErrorMessage(_0x51b948);throw new SDKError(_0x9141c6,'Failed\x20to\x20'+(_0x4e6d17['isNew']?_0x390780(0x168):_0x390780(0xac))+_0x390780(0x162)+_0x4e6d17[_0x390780(0x17f)]+_0x390780(0xb3)+_0x23c98f,_0x51b948);}try{const _0x4cff78=await syncActivationsForSegment(_0xde0d9d,_0x4f0246[_0x390780(0x180)],_0x4d494e,_0x4e6d17[_0x390780(0x151)][_0x390780(0x196)],_0x4e6d17['activationActions'],_0x1b748b,_0x4e6d17[_0x390780(0x17f)]);_0x2f2f2e[_0x390780(0x154)]=_0x4cff78;}catch(_0x46ee42){if(_0x46ee42 instanceof SDKError)throw _0x46ee42;throw new SDKError(ErrorCode[_0x390780(0x125)],_0x390780(0x175)+_0x4e6d17['yamlConfig'][_0x390780(0x196)]+_0x390780(0xc2)+_0x4e6d17[_0x390780(0x17f)]+_0x390780(0xb3)+getErrorMessage(_0x46ee42),_0x46ee42);}return _0x2f2f2e;},_0x6ff7f9=await batchAsync(_0x2bfa01,_0x24ea0a,_0x169a72),_0x3de68a={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x542f78 of _0x6ff7f9){_0x3de68a[_0x5e48a8(0x109)]+=_0x542f78[_0x5e48a8(0x109)],_0x3de68a[_0x5e48a8(0x163)]+=_0x542f78[_0x5e48a8(0x163)],_0x542f78[_0x5e48a8(0xda)]&&_0x3de68a[_0x5e48a8(0x10c)][_0x5e48a8(0xcf)](_0x542f78['createdSegmentId'][_0x5e48a8(0x196)],_0x542f78[_0x5e48a8(0xda)]['id']),_0x3de68a['activations'][_0x5e48a8(0x109)]+=_0x542f78['activations'][_0x5e48a8(0x109)],_0x3de68a['activations'][_0x5e48a8(0x163)]+=_0x542f78[_0x5e48a8(0x154)][_0x5e48a8(0x163)],_0x3de68a[_0x5e48a8(0x154)]['deleted']+=_0x542f78[_0x5e48a8(0x154)][_0x5e48a8(0x11b)];}return _0x3de68a;}async function syncActivationsForSegment(_0x53f520,_0x2ab962,_0x51fd55,_0x2029c5,_0x30fd42,_0x710a4f,_0x8d6f33){const _0xc46cf6=a98_0x546590,_0x4882c0={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3498b3 of _0x30fd42){try{if(_0x3498b3[_0xc46cf6(0x104)]===_0xc46cf6(0x168)&&_0x3498b3[_0xc46cf6(0x184)])_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x112),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),await _0x710a4f['withProgress'](_0xc46cf6(0x144)+_0x3498b3[_0xc46cf6(0x196)]+_0xc46cf6(0x141),()=>_0x53f520[_0xc46cf6(0x147)][_0xc46cf6(0x186)](_0x2ab962,_0x51fd55,_0x3498b3[_0xc46cf6(0x184)])),_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x134),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),_0x710a4f[_0xc46cf6(0xc8)]?.(_0xc46cf6(0x121)+_0x3498b3[_0xc46cf6(0x196)]+'\x27'),_0x4882c0[_0xc46cf6(0x109)]++;else{if(_0x3498b3[_0xc46cf6(0x104)]===_0xc46cf6(0xac)&&_0x3498b3[_0xc46cf6(0x184)]&&_0x3498b3[_0xc46cf6(0x166)])_0x710a4f['onProgress']?.({'type':_0xc46cf6(0xf0),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),await _0x710a4f['withProgress'](_0xc46cf6(0xb8)+_0x3498b3[_0xc46cf6(0x196)]+_0xc46cf6(0x141),()=>_0x53f520['segment'][_0xc46cf6(0x122)](_0x2ab962,_0x51fd55,_0x3498b3[_0xc46cf6(0x166)]['id'],_0x3498b3[_0xc46cf6(0x184)])),_0x710a4f['onProgress']?.({'type':_0xc46cf6(0x157),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),_0x710a4f[_0xc46cf6(0xc8)]?.(_0xc46cf6(0xe0)+_0x3498b3[_0xc46cf6(0x196)]+'\x27'),_0x4882c0[_0xc46cf6(0x163)]++;else _0x3498b3[_0xc46cf6(0x104)]===_0xc46cf6(0xee)&&_0x3498b3[_0xc46cf6(0x166)]&&(_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x178),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),await _0x710a4f['withProgress'](_0xc46cf6(0x131)+_0x3498b3[_0xc46cf6(0x196)]+_0xc46cf6(0x141),()=>_0x53f520[_0xc46cf6(0x147)][_0xc46cf6(0x18b)](_0x2ab962,_0x51fd55,_0x3498b3[_0xc46cf6(0x166)]['id'])),_0x710a4f[_0xc46cf6(0x126)]?.({'type':_0xc46cf6(0x101),'segmentName':_0x2029c5,'activationName':_0x3498b3[_0xc46cf6(0x196)]}),_0x710a4f[_0xc46cf6(0x13a)]?.(_0xc46cf6(0x16a)+_0x3498b3['name']+'\x27'),_0x4882c0[_0xc46cf6(0x11b)]++);}}catch(_0x44bfcf){const _0x22cef6=isHttp400Error(_0x44bfcf),_0x58f3ba=_0x22cef6?ErrorCode[_0xc46cf6(0x127)]:ErrorCode[_0xc46cf6(0x125)],_0x446a3f=getErrorMessage(_0x44bfcf);throw new SDKError(_0x58f3ba,_0xc46cf6(0xfa)+_0x3498b3[_0xc46cf6(0x104)]+'\x20activation\x20\x27'+_0x3498b3[_0xc46cf6(0x196)]+'\x27\x20from\x20file:\x20'+_0x8d6f33+_0xc46cf6(0xb3)+_0x446a3f,_0x44bfcf);}}return _0x4882c0;}export async function executePushFolders(_0x426f3f,_0x587a11,_0x49d620,_0x393746,_0x141cc1){const _0x69c48=a98_0x546590,_0x3c2c21=new Map(_0x49d620);for(const _0x26b795 of _0x587a11){const _0x1f09d3=_0x26b795[_0x69c48(0x10f)]('/'),_0x355c3c=_0x1f09d3[_0x1f09d3['length']-0x1],_0x2b759a=_0x1f09d3[_0x69c48(0x138)](0x0,-0x1)[_0x69c48(0xdd)]('/'),_0xd46295=_0x3c2c21[_0x69c48(0xcc)](_0x2b759a);_0x141cc1[_0x69c48(0x126)]?.({'type':_0x69c48(0x15d),'folder':_0x26b795});const _0x3eedd1={'name':_0x355c3c,'parentFolderId':_0xd46295},_0x47594b=await _0x141cc1['withProgress'](_0x69c48(0xe8)+_0x26b795+_0x69c48(0x141),()=>_0x426f3f[_0x69c48(0x147)][_0x69c48(0xea)](_0x393746[_0x69c48(0x180)],_0x3eedd1));_0x3c2c21['set'](_0x26b795,_0x47594b[_0x69c48(0x174)]['id']),_0x141cc1[_0x69c48(0x126)]?.({'type':'folder_created','folder':_0x26b795,'folderId':_0x47594b[_0x69c48(0x174)]['id']}),_0x141cc1[_0x69c48(0x106)]?.(_0x69c48(0x172)+_0x26b795+'\x27');}return _0x3c2c21;}export async function executePushSegmentDeletions(_0x20fefb,_0x1c5e73,_0x4e66d0){const _0x24aa7b=a98_0x546590;if(_0x1c5e73[_0x24aa7b(0x16f)]===0x0)return 0x0;const {batchAsync:_0x30d404}=await import(_0x24aa7b(0x10a)),_0x400474=0x5,_0x47044b=await _0x30d404(_0x1c5e73,async _0x488798=>{const _0x2b67ef=_0x24aa7b;return _0x4e66d0[_0x2b67ef(0x126)]?.({'type':_0x2b67ef(0xd0),'name':_0x488798[_0x2b67ef(0x196)]}),await _0x20fefb[_0x2b67ef(0x147)][_0x2b67ef(0x136)](_0x488798['id']),_0x4e66d0[_0x2b67ef(0x126)]?.({'type':_0x2b67ef(0x129),'name':_0x488798['name']}),_0x4e66d0[_0x2b67ef(0x13a)]?.(_0x2b67ef(0x103)+_0x488798[_0x2b67ef(0x196)]+'\x27'),0x1;},_0x400474);return _0x47044b[_0x24aa7b(0x14c)]((_0x27e417,_0x55b509)=>_0x27e417+_0x55b509,0x0);}export async function executePushJourneys(_0x1b0c8f,_0x314c55,_0x1fbfbd,_0x2a4069,_0x3f2878){const _0x913fbd=a98_0x546590,{journeyDefToRequest:_0x523195}=await import(_0x913fbd(0x124)),{activationDefToCreateRequest:_0x43f7e0,yamlRuleToApi:_0x52e75e,validateSegmentRule:_0x25c0bb}=await import('./child-segment-yaml.js'),_0x12bb1f={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x5d162d=new Map(_0x1fbfbd[_0x913fbd(0xd4)]),_0x4c3ad4=0x5;for(let _0x43e0ee=0x0;_0x43e0ee<_0x314c55[_0x913fbd(0x16f)];_0x43e0ee+=_0x4c3ad4){const _0x9779ec=_0x314c55[_0x913fbd(0x138)](_0x43e0ee,_0x43e0ee+_0x4c3ad4),_0x3ead63=await Promise['all'](_0x9779ec[_0x913fbd(0xe9)](async _0x4751f7=>{const _0xface2=_0x913fbd;if(!_0x4751f7[_0xface2(0xd3)]&&!_0x4751f7[_0xface2(0x164)])return{'action':_0xface2(0x11c),'name':_0x4751f7[_0xface2(0x151)][_0xface2(0x196)],'journeyId':_0x4751f7[_0xface2(0xed)]?.['id']};const _0x1d788f=_0x4751f7[_0xface2(0x142)]?_0x1fbfbd[_0xface2(0xc3)][_0xface2(0xcc)](_0x4751f7['folderPath']):undefined;_0x3f2878[_0xface2(0x126)]?.({'type':_0x4751f7[_0xface2(0xd3)]?_0xface2(0x149):_0xface2(0x11e),'name':_0x4751f7[_0xface2(0x151)][_0xface2(0x196)]});try{const _0x3fa76a=await executeSingleJourneyPush(_0x1b0c8f,_0x4751f7,{..._0x1fbfbd,'segmentNameToId':_0x5d162d},{'parentId':_0x2a4069[_0xface2(0x180)],'rootFolderId':_0x2a4069[_0xface2(0x133)],'folderId':_0x1d788f,'verbose':_0x2a4069[_0xface2(0x128)]},_0x3f2878,{'journeyDefToRequest':_0x523195,'activationDefToCreateRequest':_0x43f7e0,'yamlRuleToApi':_0x52e75e,'validateSegmentRule':_0x25c0bb});for(const [_0x421650,_0x534bb2]of _0x3fa76a['embeddedSegmentNameToId']){_0x5d162d['set'](_0x421650,_0x534bb2),_0x12bb1f[_0xface2(0xff)][_0xface2(0xcf)](_0x421650,_0x534bb2);}if(_0x3fa76a[_0xface2(0x14e)]===_0xface2(0x109))_0x3f2878[_0xface2(0x126)]?.({'type':_0xface2(0x13e),'name':_0x4751f7[_0xface2(0x151)][_0xface2(0x196)],'journeyId':_0x3fa76a[_0xface2(0xae)]}),_0x3f2878[_0xface2(0xc8)]?.(_0xface2(0x143)+_0x4751f7[_0xface2(0x151)][_0xface2(0x196)]+'\x27'),_0x12bb1f[_0xface2(0x109)]++;else _0x3fa76a[_0xface2(0x14e)]==='updated'&&(_0x3f2878[_0xface2(0x126)]?.({'type':_0xface2(0x192),'name':_0x4751f7[_0xface2(0x151)]['name']}),_0x3f2878[_0xface2(0xc8)]?.(_0xface2(0x11d)+_0x4751f7[_0xface2(0x151)][_0xface2(0x196)]+'\x27'),_0x12bb1f[_0xface2(0x163)]++);return{'action':_0x3fa76a[_0xface2(0x14e)],'name':_0x4751f7[_0xface2(0x151)]['name'],'journeyId':_0x3fa76a[_0xface2(0xae)]};}catch(_0xb29729){const _0x2951e2=isHttp400Error(_0xb29729),_0x47471a=_0x2951e2?ErrorCode[_0xface2(0x145)]:ErrorCode[_0xface2(0x140)],_0x2c42d1=getErrorMessage(_0xb29729);throw new SDKError(_0x47471a,_0xface2(0xfa)+(_0x4751f7[_0xface2(0xd3)]?'create':_0xface2(0xac))+_0xface2(0x167)+_0x4751f7[_0xface2(0x17f)]+_0xface2(0xb3)+_0x2c42d1,_0xb29729);}}));_0x12bb1f[_0x913fbd(0x11f)][_0x913fbd(0xe3)](..._0x3ead63);}return _0x12bb1f;}async function executeSingleJourneyPush(_0x54537b,_0x5c27b6,_0x5e96f2,_0x12953b,_0x3c8862,_0x2d7f66){const _0x417ec2=a98_0x546590,{journeyDefToRequest:_0x29e93e,activationDefToCreateRequest:_0x135786,yamlRuleToApi:_0x1c27fe,validateSegmentRule:_0x156d6e}=_0x2d7f66,_0x2ebaad=new Map(),_0x5f1a84=new Map(),_0x22d887=new Map(),_0x3d92f9=new Map(),_0x8208a1=new Map();let _0x59d352;const _0x49e31e=async()=>{const _0x3ac681=a98_0xd296;if(_0x59d352)return;_0x59d352=new Map();if(!_0x5c27b6[_0x3ac681(0xed)])return;const _0x2e7121=await _0x54537b['journey'][_0x3ac681(0x17d)](_0x5c27b6[_0x3ac681(0xed)]['id']);for(const _0xaf873 of _0x2e7121){const _0x33a2ff=journeyActivationStepToYaml(_0xaf873,_0x5e96f2[_0x3ac681(0x159)],_0x5e96f2[_0x3ac681(0x195)]),_0x3861a4=activationSignature(_0x33a2ff);!_0x59d352[_0x3ac681(0x148)](_0x3861a4)&&_0x59d352[_0x3ac681(0xcf)](_0x3861a4,_0xaf873['id']),_0x33a2ff[_0x3ac681(0x196)]&&_0x5f1a84['set'](_0x33a2ff[_0x3ac681(0x196)],_0xaf873['id']);}};if(_0x5c27b6[_0x417ec2(0xed)]&&_0x5c27b6['yamlConfig'][_0x417ec2(0xeb)]){const _0x3785f9=buildLocalExpandedRuleMappings(_0x5c27b6[_0x417ec2(0x151)]),_0x54ca70=_0x3785f9['localSegmentRules'];if(_0x54ca70['size']>0x0){const _0xf6461e=new Map();for(const [_0x2af2df,_0x14290f]of _0x54ca70){const _0x23c8e5=serializeExpandedRule(_0x14290f,_0x54ca70);_0xf6461e[_0x417ec2(0xcf)](_0x2af2df,_0x23c8e5);}const _0x5594ec=collectSegmentIdsFromJourneyApi(_0x5c27b6[_0x417ec2(0xed)]);if(_0x5594ec['size']>0x0){const _0x499578=await buildServerSegmentRuleMap(_0x54537b,_0x12953b[_0x417ec2(0x180)],_0x5e96f2[_0x417ec2(0x16e)],_0x5594ec);if(_0x499578[_0x417ec2(0x14d)]>0x0){const _0x1365b4=new Map();for(const [_0x530c85,_0x581acc]of _0x499578){const _0x5354d9=serializeExpandedRule(_0x581acc,_0x499578);!_0x1365b4[_0x417ec2(0x148)](_0x5354d9)&&_0x1365b4[_0x417ec2(0xcf)](_0x5354d9,_0x530c85);}for(const [_0xb64e64,_0x69b9f2]of _0xf6461e){const _0x44a46b=_0x1365b4[_0x417ec2(0xcc)](_0x69b9f2);_0x44a46b&&(_0x8208a1[_0x417ec2(0xcf)](_0xb64e64,_0x44a46b),_0x5e96f2['segmentNameToId'][_0x417ec2(0xcf)](_0xb64e64,_0x44a46b));}}}}}const _0x210ab5={'resolveSegmentId':async _0x2f738a=>{const _0xafef6f=_0x417ec2,_0x52e6ab=_0x5e96f2['segmentNameToId'][_0xafef6f(0xcc)](_0x2f738a);if(!_0x52e6ab)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20not\x20found:\x20'+_0x2f738a+'\x20(referenced\x20in\x20journey\x20'+_0x5c27b6[_0xafef6f(0x151)][_0xafef6f(0x196)]+')');return _0x52e6ab;},'resolveEmbeddedSegmentId':async(_0x442064,_0x241429)=>{const _0x1d7312=_0x417ec2,_0x427199=_0x5e96f2[_0x1d7312(0xd4)]['get'](_0x442064);if(_0x427199)return _0x427199;const _0x34a2af=_0x8208a1[_0x1d7312(0xcc)](_0x442064);if(_0x34a2af)return _0x5e96f2[_0x1d7312(0xd4)][_0x1d7312(0xcf)](_0x442064,_0x34a2af),_0x34a2af;const _0x7d25dc=_0x5e96f2[_0x1d7312(0x16e)]['find'](_0x2c5a31=>_0x2c5a31[_0x1d7312(0x196)]===_0x442064);if(_0x7d25dc)return _0x5e96f2[_0x1d7312(0xd4)]['set'](_0x442064,_0x7d25dc['id']),_0x7d25dc['id'];if(_0x5c27b6[_0x1d7312(0xd3)]){const {stageName:_0x1d0628,criteriaName:_0x46d5a4}=findSegmentCriteriaLocation(_0x5c27b6['yamlConfig'],_0x442064);return _0x156d6e(_0x442064,_0x241429[_0x1d7312(0x13b)]),_0x22d887[_0x1d7312(0xcf)](_0x442064,{'definition':_0x241429,'stageName':_0x1d0628,'criteriaName':_0x46d5a4}),createPendingSegmentId(_0x442064);}const _0x2b3cf1=_0x5c27b6[_0x1d7312(0xed)]?.['id'];if(!_0x2b3cf1)throw new SDKError(ErrorCode['INTERNAL'],_0x1d7312(0x12a));_0x156d6e(_0x442064,_0x241429[_0x1d7312(0x13b)]);const _0x27d176=generateDeterministicJourneySegmentName(_0x5c27b6[_0x1d7312(0x151)][_0x1d7312(0x196)],_0x442064),_0x3535b7=_0x5e96f2[_0x1d7312(0x16e)][_0x1d7312(0xb7)](_0x57ad87=>_0x57ad87[_0x1d7312(0x196)]===_0x27d176),_0x304ca4=createSegmentIdResolver(_0x5e96f2[_0x1d7312(0xd4)],_0x442064),_0x454fc5=await resolveRuleSegmentIds(_0x241429['rule'],_0x304ca4);let _0x674048;if(_0x3535b7)await _0x54537b[_0x1d7312(0x147)][_0x1d7312(0xdc)](_0x12953b[_0x1d7312(0x180)],_0x3535b7['id'],{'description':_0x241429[_0x1d7312(0x15c)]||_0x1d7312(0x11a)+_0x442064,'rule':_0x1c27fe(_0x454fc5,!![]),'countPopulation':!![]}),_0x674048=_0x3535b7['id'];else try{_0x674048=await _0x54537b['segment']['createJourneySegment']({'name':_0x27d176,'description':_0x241429[_0x1d7312(0x15c)]||_0x1d7312(0x11a)+_0x442064,'journeyId':_0x2b3cf1,'rule':_0x1c27fe(_0x454fc5,!![]),'countPopulation':!![],'parentFolderId':_0x12953b['rootFolderId']||'','audienceId':_0x12953b[_0x1d7312(0x180)]});}catch(_0x836d43){const _0x4af9ee=_0x836d43 instanceof Error&&_0x836d43[_0x1d7312(0xe1)][_0x1d7312(0xbf)](_0x1d7312(0x10d));if(_0x4af9ee){const _0x596fd6=await _0x54537b[_0x1d7312(0x147)][_0x1d7312(0x18a)](_0x12953b[_0x1d7312(0x180)]),_0x2f2624=_0x596fd6[_0x1d7312(0xb7)](_0x1b4dc5=>_0x1b4dc5[_0x1d7312(0x196)]===_0x27d176);if(_0x2f2624)await _0x54537b['segment'][_0x1d7312(0xdc)](_0x12953b['parentId'],_0x2f2624['id'],{'description':_0x241429['description']||_0x1d7312(0x11a)+_0x442064,'rule':_0x1c27fe(_0x454fc5,!![]),'countPopulation':!![]}),_0x674048=_0x2f2624['id'];else throw _0x836d43;}else throw _0x836d43;}return _0x5e96f2[_0x1d7312(0xd4)][_0x1d7312(0xcf)](_0x442064,_0x674048),_0x2ebaad['set'](_0x442064,_0x674048),_0x674048;},'resolveActivationId':async _0x3be93b=>{const _0x129aef=_0x417ec2,_0x2f46bb=_0x5f1a84[_0x129aef(0xcc)](_0x3be93b);if(_0x2f46bb)return _0x2f46bb;if(_0x5c27b6[_0x129aef(0xed)]){await _0x49e31e();const _0x48c1d8=_0x5f1a84[_0x129aef(0xcc)](_0x3be93b);if(_0x48c1d8)return _0x48c1d8;}throw new SDKError(ErrorCode['NOT_FOUND'],'Activation\x20not\x20found:\x20'+_0x3be93b+_0x129aef(0x116)+_0x5c27b6['yamlConfig'][_0x129aef(0x196)]+_0x129aef(0x15a)+_0x129aef(0xe6));},'resolveEmbeddedActivationId':async(_0x12296d,_0x4dd2c1)=>{const _0x2268e1=_0x417ec2,_0x410307=_0x5f1a84['get'](_0x12296d);if(_0x410307)return _0x410307;if(_0x5c27b6['isNew'])return _0x3d92f9[_0x2268e1(0xcf)](_0x12296d,_0x4dd2c1),createPendingActivationId(_0x12296d);if(_0x5c27b6[_0x2268e1(0xed)]){await _0x49e31e();const _0x1f493=_0x5f1a84[_0x2268e1(0xcc)](_0x4dd2c1['name']);if(_0x1f493)return _0x5f1a84[_0x2268e1(0xcf)](_0x12296d,_0x1f493),_0x1f493;const _0x200f66=activationSignature(_0x4dd2c1),_0x15622b=_0x59d352?.['get'](_0x200f66);if(_0x15622b)return _0x5f1a84[_0x2268e1(0xcf)](_0x12296d,_0x15622b),_0x15622b;const _0x22dd95=await _0x135786(_0x4dd2c1,_0x5e96f2[_0x2268e1(0xfc)]),_0x5781a8=await _0x54537b[_0x2268e1(0x14b)][_0x2268e1(0x186)](_0x5c27b6['existingJourney']['id'],_0x22dd95);return _0x5f1a84['set'](_0x12296d,_0x5781a8['id']),_0x5781a8['id'];}throw new SDKError(ErrorCode['INTERNAL'],_0x2268e1(0x155));},'resolveJourneyId':async _0x192137=>{const _0x329db6=_0x417ec2;try{return await _0x54537b[_0x329db6(0x14b)][_0x329db6(0x107)](_0x12953b[_0x329db6(0x180)],_0x192137);}catch(_0x2c5799){throw new SDKError(ErrorCode['NOT_FOUND'],'Journey\x20\x27'+_0x192137+_0x329db6(0xfb)+_0x5c27b6[_0x329db6(0x151)][_0x329db6(0x196)]+'\x27)',_0x2c5799);}},'resolveStageId':async(_0x1e2f56,_0x4c54f7)=>{const _0xfc55c3=_0x417ec2,_0x1be8e=await _0x54537b[_0xfc55c3(0x14b)][_0xfc55c3(0x13f)](_0x1e2f56),_0x59b39a=_0x1be8e[_0xfc55c3(0x110)][_0xfc55c3(0x194)][_0xfc55c3(0xb7)](_0x28ed1b=>_0x28ed1b[_0xfc55c3(0x196)]['toLowerCase']()===_0x4c54f7['toLowerCase']());if(!_0x59b39a?.['id'])throw new SDKError(ErrorCode[_0xfc55c3(0x12c)],_0xfc55c3(0xb1)+_0x4c54f7+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x1be8e['attributes'][_0xfc55c3(0x114)]||_0x1be8e[_0xfc55c3(0x110)]['name'])+'\x27');return _0x59b39a['id'];}},_0x89d491=await _0x29e93e(_0x5c27b6[_0x417ec2(0x151)],_0x12953b[_0x417ec2(0x180)],_0x210ab5),_0x3d3b9f=_0x12953b['folderId']||_0x12953b['rootFolderId'];_0x3d3b9f&&(_0x89d491[_0x417ec2(0xba)]={'parentFolder':{'data':{'id':_0x3d3b9f,'type':_0x417ec2(0x132)}}});if(_0x5c27b6['isNew']){if(_0x22d887[_0x417ec2(0x14d)]>0x0||_0x3d92f9[_0x417ec2(0x14d)]>0x0)return await executeThreeStepJourneyCreate(_0x54537b,_0x5c27b6,_0x89d491,{'pendingEmbeddedSegments':_0x22d887,'pendingEmbeddedActivations':_0x3d92f9,'embeddedSegmentNameToId':_0x2ebaad,'journeyActivationNameToId':_0x5f1a84},{..._0x12953b,'effectiveFolderId':_0x3d3b9f},_0x5e96f2,_0x3c8862,_0x2d7f66);else{ensureJourneyDefaults(_0x89d491[_0x417ec2(0x110)]);const _0x167e67=await _0x54537b[_0x417ec2(0x14b)][_0x417ec2(0x168)](_0x89d491);return{'action':_0x417ec2(0x109),'journeyId':_0x167e67['id'],'embeddedSegmentNameToId':_0x2ebaad};}}else{if(_0x5c27b6[_0x417ec2(0x164)]&&_0x5c27b6[_0x417ec2(0xed)])return ensureJourneyDefaults(_0x89d491[_0x417ec2(0x110)]),await _0x54537b[_0x417ec2(0x14b)][_0x417ec2(0xac)](_0x5c27b6['existingJourney']['id'],_0x89d491),{'action':'updated','journeyId':_0x5c27b6['existingJourney']['id'],'embeddedSegmentNameToId':_0x2ebaad};}return{'action':_0x417ec2(0x11c),'journeyId':_0x5c27b6['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x2ebaad};}function findSegmentCriteriaLocation(_0x5c2fe8,_0x17f5c9){const _0x448d27=a98_0x546590,_0x5a1ba9=_0x5c2fe8[_0x448d27(0xc0)]||_0x5c2fe8['journeys']?.[0x0]?.[_0x448d27(0xc0)]||[];let _0xf11fba='entry',_0x1b8734=_0x17f5c9;const _0x373aea=_0x5c2fe8['goal']||_0x5c2fe8['journeys']?.[0x0]?.[_0x448d27(0x179)];if(_0x373aea?.[_0x448d27(0x147)]===_0x17f5c9)return{'stageName':_0x448d27(0x179),'criteriaName':_0x373aea[_0x448d27(0x196)]||_0x17f5c9};_0x53670f:for(const _0x2df1a5 of _0x5a1ba9){if(_0x2df1a5[_0x448d27(0x185)]?.[_0x448d27(0x147)]===_0x17f5c9){_0xf11fba=_0x2df1a5[_0x448d27(0x196)],_0x1b8734=_0x2df1a5[_0x448d27(0x185)][_0x448d27(0x196)]||_0x17f5c9;break;}if(_0x2df1a5[_0x448d27(0x15b)])for(const _0x349ec5 of _0x2df1a5[_0x448d27(0x15b)]){if(_0x349ec5[_0x448d27(0x104)]===_0x448d27(0xb5)&&_0x349ec5['with']?.[_0x448d27(0xe4)])for(const _0x3be348 of _0x349ec5[_0x448d27(0xa9)][_0x448d27(0xe4)]){if(_0x3be348['segment']===_0x17f5c9){_0xf11fba=_0x2df1a5['name'],_0x1b8734=_0x3be348['name']||_0x17f5c9;break _0x53670f;}}}}return{'stageName':_0xf11fba,'criteriaName':_0x1b8734};}async function executeThreeStepJourneyCreate(_0x1d60a9,_0xc601b2,_0x3069fb,_0x3dd6e8,_0x532cef,_0x4edd22,_0x56b4f8,_0x4cdacf){const _0x3ed775=a98_0x546590,{activationDefToCreateRequest:_0x2aa74e,yamlRuleToApi:_0x197fa7}=_0x4cdacf,{pendingEmbeddedSegments:_0x1af192,pendingEmbeddedActivations:_0x473531,embeddedSegmentNameToId:_0x10f7fd}=_0x3dd6e8,_0x4fd9e7=JSON[_0x3ed775(0x176)](JSON['stringify'](_0x3069fb));ensureJourneyDefaults(_0x4fd9e7['attributes']),stripPendingIds(_0x4fd9e7);const _0x39148c=await _0x1d60a9[_0x3ed775(0x14b)][_0x3ed775(0x168)](_0x4fd9e7),_0x48a56f=_0x39148c['id'],_0x47815c=new Map();for(const _0x5196b9 of _0x39148c['attributes']['journeyStages']){_0x47815c[_0x3ed775(0xcf)](_0x5196b9[_0x3ed775(0x196)]['toLowerCase'](),_0x5196b9['id']);}for(const [_0x22a7a7,{definition:_0x520b57}]of _0x1af192){const _0x10dba9=generateDeterministicJourneySegmentName(_0xc601b2['yamlConfig'][_0x3ed775(0x196)],_0x22a7a7);_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0xb6),'journeyName':_0xc601b2['yamlConfig'][_0x3ed775(0x196)],'segmentName':_0x22a7a7});const _0x4e9d1c=createSegmentIdResolver(_0x4edd22[_0x3ed775(0xd4)],_0x22a7a7),_0x283079=await resolveRuleSegmentIds(_0x520b57[_0x3ed775(0x13b)],_0x4e9d1c),_0x4e9dba=await _0x1d60a9[_0x3ed775(0x147)][_0x3ed775(0x18f)]({'name':_0x10dba9,'description':_0x520b57[_0x3ed775(0x15c)]||'Entry\x20criteria:\x20'+_0x22a7a7,'journeyId':_0x48a56f,'rule':_0x197fa7(_0x283079,!![]),'countPopulation':!![],'parentFolderId':_0x532cef[_0x3ed775(0x16d)]||'','audienceId':_0x532cef[_0x3ed775(0x180)]});_0x10f7fd[_0x3ed775(0xcf)](_0x22a7a7,_0x4e9dba),_0x4edd22[_0x3ed775(0xd4)]['set'](_0x22a7a7,_0x4e9dba),_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0xc5),'journeyName':_0xc601b2[_0x3ed775(0x151)][_0x3ed775(0x196)],'segmentName':_0x22a7a7});}const _0x4fe1f4=new Map();for(const [_0x44694c,_0x1e30cd]of _0x473531){_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0xd1),'journeyName':_0xc601b2[_0x3ed775(0x151)][_0x3ed775(0x196)],'activationName':_0x44694c});const _0x334216=await _0x2aa74e(_0x1e30cd,_0x4edd22['activationContext']),_0x294490=await _0x1d60a9['journey']['createActivation'](_0x48a56f,_0x334216);_0x4fe1f4[_0x3ed775(0xcf)](_0x44694c,_0x294490['id']),_0x3dd6e8['journeyActivationNameToId'][_0x3ed775(0xcf)](_0x44694c,_0x294490['id']),_0x56b4f8[_0x3ed775(0x126)]?.({'type':_0x3ed775(0x153),'journeyName':_0xc601b2[_0x3ed775(0x151)]['name'],'activationName':_0x44694c});}const _0x30af86=JSON[_0x3ed775(0x176)](JSON[_0x3ed775(0xc1)](_0x3069fb));return _0x30af86['id']=_0x48a56f,ensureJourneyDefaults(_0x30af86[_0x3ed775(0x110)]),resolvePendingIdsInRequest(_0x30af86,_0x3069fb,_0x47815c,_0x10f7fd,_0x4fe1f4,_0x56b4f8),await _0x1d60a9[_0x3ed775(0x14b)][_0x3ed775(0xac)](_0x48a56f,_0x30af86),{'action':_0x3ed775(0x109),'journeyId':_0x48a56f,'embeddedSegmentNameToId':_0x10f7fd};}function stripPendingIds(_0x1a81e3){const _0x502357=a98_0x546590;for(const _0xed62e1 of _0x1a81e3[_0x502357(0x110)][_0x502357(0x194)]||[]){_0xed62e1['entryCriteria']?.[_0x502357(0xbb)]&&isPendingSegmentId(_0xed62e1['entryCriteria'][_0x502357(0xbb)])&&delete _0xed62e1['entryCriteria'];if(_0xed62e1[_0x502357(0x15b)])for(const _0x5e0abb of Object['keys'](_0xed62e1[_0x502357(0x15b)])){const _0x30ba1e=_0xed62e1[_0x502357(0x15b)][_0x5e0abb];_0x30ba1e[_0x502357(0x104)]===_0x502357(0x115)&&_0x30ba1e[_0x502357(0x190)]&&isPendingActivationId(_0x30ba1e[_0x502357(0x190)])&&(_0x30ba1e['journeyActivationStepId']='');if(_0x30ba1e[_0x502357(0x104)]==='DecisionPoint'&&_0x30ba1e[_0x502357(0xe4)])for(const _0x120840 of _0x30ba1e[_0x502357(0xe4)]){_0x120840[_0x502357(0xbb)]&&isPendingSegmentId(_0x120840['segmentId'])&&(_0x120840['segmentId']='');}_0x30ba1e['type']===_0x502357(0xfe)&&_0x30ba1e[_0x502357(0x177)]?.[_0x502357(0xbb)]&&isPendingSegmentId(_0x30ba1e[_0x502357(0x177)]['segmentId'])&&(_0x30ba1e['waitCondition'][_0x502357(0xbb)]='');}}}function resolvePendingIdsInRequest(_0x5c2843,_0x30f2fc,_0x41780e,_0x450ed1,_0x2596f7,_0xed2c59){const _0x1d270e=a98_0x546590,_0x183b87=(_0x5d9167,_0x5e96d0)=>{const _0x4f892b=a98_0xd296;if(!isPendingSegmentId(_0x5d9167))return _0x5d9167;const _0x55666c=extractPendingSegmentName(_0x5d9167),_0x3b7759=_0x450ed1[_0x4f892b(0xcc)](_0x55666c);return!_0x3b7759&&_0xed2c59[_0x4f892b(0x171)]?.(_0x4f892b(0xbe)+_0x55666c+_0x4f892b(0x118)+_0x5e96d0),_0x3b7759;};if(_0x5c2843[_0x1d270e(0x110)][_0x1d270e(0x179)]?.[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x5c2843[_0x1d270e(0x110)][_0x1d270e(0x179)][_0x1d270e(0xbb)])){const _0x240646=_0x183b87(_0x5c2843[_0x1d270e(0x110)]['goal'][_0x1d270e(0xbb)],_0x1d270e(0xb4));_0x240646&&(_0x5c2843['attributes'][_0x1d270e(0x179)][_0x1d270e(0xbb)]=_0x240646);}for(const _0x139df9 of _0x5c2843[_0x1d270e(0x110)][_0x1d270e(0x194)]||[]){const _0x5a7c24=_0x41780e[_0x1d270e(0xcc)](_0x139df9[_0x1d270e(0x196)][_0x1d270e(0xa8)]());_0x5a7c24&&(_0x139df9['id']=_0x5a7c24);if(_0x139df9[_0x1d270e(0xe5)]?.[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x139df9[_0x1d270e(0xe5)][_0x1d270e(0xbb)])){const _0x2cd4fc=_0x183b87(_0x139df9[_0x1d270e(0xe5)]['segmentId'],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0x17e));_0x2cd4fc&&(_0x139df9[_0x1d270e(0xe5)][_0x1d270e(0xbb)]=_0x2cd4fc);}if(_0x139df9[_0x1d270e(0x12e)])for(const _0x3b6988 of _0x139df9['exitCriterias']){if(_0x3b6988[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x3b6988[_0x1d270e(0xbb)])){const _0x5963bc=_0x183b87(_0x3b6988[_0x1d270e(0xbb)],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+'\x27\x20exit\x20criteria');_0x5963bc&&(_0x3b6988['segmentId']=_0x5963bc);}}if(_0x139df9[_0x1d270e(0xec)]?.['segmentId']&&isPendingSegmentId(_0x139df9[_0x1d270e(0xec)][_0x1d270e(0xbb)])){const _0x4b9cd3=_0x183b87(_0x139df9[_0x1d270e(0xec)]['segmentId'],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0xc6));_0x4b9cd3&&(_0x139df9[_0x1d270e(0xec)][_0x1d270e(0xbb)]=_0x4b9cd3);}if(_0x139df9[_0x1d270e(0x15b)]){const _0x1ec80d=_0x3e8f3e=>_0x30f2fc[_0x1d270e(0x110)]['journeyStages'][_0x1d270e(0xb7)](_0x199a67=>_0x199a67[_0x1d270e(0x196)][_0x1d270e(0xa8)]()===_0x139df9[_0x1d270e(0x196)][_0x1d270e(0xa8)]())?.['steps']?.[_0x3e8f3e];for(const _0x1e218e of Object[_0x1d270e(0x100)](_0x139df9[_0x1d270e(0x15b)])){const _0x22f18f=_0x139df9['steps'][_0x1e218e],_0x22e6a2=_0x1ec80d(_0x1e218e);if(_0x22f18f[_0x1d270e(0x104)]===_0x1d270e(0x115)&&_0x22f18f[_0x1d270e(0x190)]&&(isPendingActivationId(_0x22f18f[_0x1d270e(0x190)])||_0x22f18f['journeyActivationStepId']==='')){if(_0x22e6a2?.[_0x1d270e(0x190)]&&isPendingActivationId(_0x22e6a2['journeyActivationStepId'])){const _0x34e34c=extractPendingActivationName(_0x22e6a2[_0x1d270e(0x190)]),_0x4216b7=_0x2596f7[_0x1d270e(0xcc)](_0x34e34c);_0x4216b7&&(_0x22f18f[_0x1d270e(0x190)]=_0x4216b7);}}if(_0x22f18f[_0x1d270e(0x104)]===_0x1d270e(0xfd)&&_0x22f18f[_0x1d270e(0xe4)]&&_0x22e6a2?.[_0x1d270e(0xe4)])for(let _0x3c4ec9=0x0;_0x3c4ec9<_0x22f18f[_0x1d270e(0xe4)][_0x1d270e(0x16f)];_0x3c4ec9++){const _0x3afc10=_0x22f18f[_0x1d270e(0xe4)][_0x3c4ec9],_0x29922e=_0x22e6a2[_0x1d270e(0xe4)][_0x3c4ec9];if(_0x29922e?.['segmentId']&&isPendingSegmentId(_0x29922e[_0x1d270e(0xbb)])){const _0x1ef0a4=_0x183b87(_0x29922e[_0x1d270e(0xbb)],_0x1d270e(0xd5)+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0xe7)+(_0x3afc10[_0x1d270e(0x196)]||_0x3c4ec9)+'\x27');_0x1ef0a4&&(_0x3afc10[_0x1d270e(0xbb)]=_0x1ef0a4);}}if(_0x22f18f['type']===_0x1d270e(0xfe)&&_0x22f18f['waitCondition']?.[_0x1d270e(0xbb)]&&_0x22e6a2?.[_0x1d270e(0x177)]?.[_0x1d270e(0xbb)]&&isPendingSegmentId(_0x22e6a2[_0x1d270e(0x177)][_0x1d270e(0xbb)])){const _0x2c8f37=_0x183b87(_0x22e6a2[_0x1d270e(0x177)]['segmentId'],'stage\x20\x27'+_0x139df9[_0x1d270e(0x196)]+_0x1d270e(0xdf));_0x2c8f37&&(_0x22f18f[_0x1d270e(0x177)][_0x1d270e(0xbb)]=_0x2c8f37);}}}}}
|
|
1
|
+
const a98_0x545ff9=a98_0x1668;(function(_0x5cbce2,_0x3695ce){const _0x368ae2=a98_0x1668,_0x461531=_0x5cbce2();while(!![]){try{const _0x555eab=parseInt(_0x368ae2(0x201))/0x1*(parseInt(_0x368ae2(0x27c))/0x2)+parseInt(_0x368ae2(0x215))/0x3*(parseInt(_0x368ae2(0x1c0))/0x4)+parseInt(_0x368ae2(0x25d))/0x5+-parseInt(_0x368ae2(0x23c))/0x6+-parseInt(_0x368ae2(0x25f))/0x7+-parseInt(_0x368ae2(0x1e8))/0x8*(parseInt(_0x368ae2(0x220))/0x9)+-parseInt(_0x368ae2(0x1df))/0xa;if(_0x555eab===_0x3695ce)break;else _0x461531['push'](_0x461531['shift']());}catch(_0x4b5bc6){_0x461531['push'](_0x461531['shift']());}}}(a98_0x3634,0xe48a2));function a98_0x1668(_0x21142c,_0x279883){_0x21142c=_0x21142c-0x1ab;const _0x3634b6=a98_0x3634();let _0x16680b=_0x3634b6[_0x21142c];return _0x16680b;}import{createHash}from'crypto';export const PENDING_SEGMENT_PREFIX=a98_0x545ff9(0x225);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x4a3209){return''+PENDING_SEGMENT_PREFIX+_0x4a3209+'__';}export function isPendingSegmentId(_0x5f2603){const _0x1a98d1=a98_0x545ff9;return _0x5f2603[_0x1a98d1(0x1cc)](PENDING_SEGMENT_PREFIX);}export function extractPendingSegmentName(_0x1618d6){const _0x344d8c=a98_0x545ff9;return _0x1618d6[_0x344d8c(0x237)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x5876dc){return''+PENDING_ACTIVATION_PREFIX+_0x5876dc+'__';}export function isPendingActivationId(_0x53a585){const _0x3cb3f1=a98_0x545ff9;return _0x53a585[_0x3cb3f1(0x1cc)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x19fea5){const _0xd635d6=a98_0x545ff9;return _0x19fea5[_0xd635d6(0x237)](/^__pending_act_(.+)__$/,'$1');}function generateDeterministicJourneySegmentName(_0x45e7ca,_0x5b3d6e){const _0x3a9698=a98_0x545ff9,_0x3793ae=_0x45e7ca+'::'+(_0x5b3d6e['trim']()||'segment'),_0x3eb22b=createHash(_0x3a9698(0x260))[_0x3a9698(0x203)](_0x3793ae)[_0x3a9698(0x261)]('hex')[_0x3a9698(0x26d)](0x0,0xc);return _0x3a9698(0x27a)+_0x3eb22b;}export function ensureJourneyDefaults(_0x24dcf5){const _0x3a694d=a98_0x545ff9;!_0x24dcf5[_0x3a694d(0x247)]&&(_0x24dcf5[_0x3a694d(0x247)]=''),!_0x24dcf5['state']&&(_0x24dcf5['state']='draft');}export function resolveTDFolderPath(_0x4b0350,_0x4380f6,_0x1a3324){if(!_0x4380f6)return _0x4b0350;if(_0x4b0350===_0x1a3324||_0x4b0350['startsWith'](_0x1a3324+'/'))return _0x4b0350;return _0x4b0350?_0x1a3324+'/'+_0x4b0350:_0x1a3324;}export function addFoldersToCreate(_0x456867,_0x5a3012,_0x3e2f5a){const _0x5559e6=a98_0x545ff9;if(!_0x456867)return;if(_0x5a3012[_0x5559e6(0x1f0)](_0x456867))return;const _0x54e9ba=_0x456867[_0x5559e6(0x1ce)]('/');let _0x478fae='';for(const _0x255ee3 of _0x54e9ba){_0x478fae=_0x478fae?_0x478fae+'/'+_0x255ee3:_0x255ee3,!_0x5a3012[_0x5559e6(0x1f0)](_0x478fae)&&_0x3e2f5a[_0x5559e6(0x23e)](_0x478fae);}}import*as a98_0x1fee7e from'yaml';import{readFileSync}from'fs';import a98_0x4a9171 from'path';import{isJourneyDef,parseYamlString as a98_0x13dd3b,toYamlString as a98_0x4774d0,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{validateSegmentDef,validateJourneyDef,formatValidationResult}from'./yaml-validator.js';function stableStringify(_0x49b1db){const _0xd8a1b=a98_0x545ff9;if(Array[_0xd8a1b(0x20c)](_0x49b1db))return'['+_0x49b1db[_0xd8a1b(0x1bf)](_0x2f718d=>stableStringify(_0x2f718d))[_0xd8a1b(0x254)](',')+']';if(_0x49b1db&&typeof _0x49b1db==='object'){const _0x4165b1=_0x49b1db,_0x1425ff=Object[_0xd8a1b(0x228)](_0x4165b1)['sort'](),_0x4df573=_0x1425ff[_0xd8a1b(0x1bf)](_0x58e50a=>'\x22'+_0x58e50a+'\x22:'+stableStringify(_0x4165b1[_0x58e50a]));return'{'+_0x4df573[_0xd8a1b(0x254)](',')+'}';}const _0xb0ec35=JSON[_0xd8a1b(0x1b9)](_0x49b1db);return _0xb0ec35===undefined?'null':_0xb0ec35;}function activationSignature(_0x20783d){const _0x408bc7=a98_0x545ff9,_0x58fb3c={'connection':_0x20783d[_0x408bc7(0x213)],..._0x20783d['all_columns']!==undefined&&{'all_columns':_0x20783d[_0x408bc7(0x21f)]},..._0x20783d[_0x408bc7(0x21b)]!==undefined&&{'columns':_0x20783d['columns']},..._0x20783d['behavior']!==undefined&&{'behavior':_0x20783d['behavior']},..._0x20783d[_0x408bc7(0x1e6)]!==undefined&&{'schedule':_0x20783d[_0x408bc7(0x1e6)]},..._0x20783d[_0x408bc7(0x1d0)]!==undefined&&{'notification':_0x20783d[_0x408bc7(0x1d0)]},..._0x20783d[_0x408bc7(0x1b1)]!==undefined&&{'connector_config':_0x20783d['connector_config']},..._0x20783d['activation_template_id']!==undefined&&{'activation_template_id':_0x20783d[_0x408bc7(0x23d)]}};return stableStringify(_0x58fb3c);}export async function prepareSegmentFiles(_0x380f12,_0xf2dd12,_0x2d3c1c,_0x1e3a3e,_0x36873a){const _0x50988e=a98_0x545ff9,{activationDefToCreateRequest:_0x260dfd}=await import(_0x50988e(0x22f)),_0xfefd4a=[],_0x18c5cd=new Set();for(const {yamlConfig:_0x625ca7,folderPath:_0x25f21f,sourcePath:_0x278c5d}of _0x380f12){const _0x2174bc=resolveTDFolderPath(_0x25f21f,_0x1e3a3e,_0x36873a),_0x18736e=_0x2174bc+':'+_0x625ca7[_0x50988e(0x1e7)],_0x359101=_0xf2dd12['segmentByFolderAndName'][_0x50988e(0x1ad)](_0x18736e),_0x1927b1=_0x359101?_0xf2dd12[_0x50988e(0x1f6)]['get'](_0x359101['id'])||[]:[];addFoldersToCreate(_0x2174bc,_0xf2dd12[_0x50988e(0x1c7)],_0x18c5cd);const _0x25bf1b=calculateActivationActions(_0x625ca7[_0x50988e(0x245)]||[],_0x1927b1,_0xf2dd12[_0x50988e(0x1e5)],_0xf2dd12[_0x50988e(0x253)]);for(const _0x558756 of _0x25bf1b){(_0x558756[_0x50988e(0x1ef)]==='create'||_0x558756[_0x50988e(0x1ef)]===_0x50988e(0x203))&&_0x558756[_0x50988e(0x238)]&&(_0x558756[_0x50988e(0x281)]=await _0x260dfd(_0x558756[_0x50988e(0x238)],_0x2d3c1c));}const _0x322f3e=calculateSegmentDiff(_0x625ca7,_0x359101,_0x1927b1,_0xf2dd12[_0x50988e(0x1e5)],_0xf2dd12['connectionIdToNameMap']);_0xfefd4a[_0x50988e(0x277)]({'relativePath':_0x625ca7[_0x50988e(0x1e7)],'absolutePath':_0x278c5d,'yamlConfig':_0x625ca7,'folderPath':_0x2174bc,'existingSegment':_0x359101,'existingActivations':_0x1927b1,'isNew':_0x322f3e[_0x50988e(0x1e0)],'hasChanges':_0x322f3e['hasChanges'],'diff':_0x322f3e['diff'],'activationActions':_0x25bf1b});}return{'segmentFiles':_0xfefd4a,'foldersToCreate':_0x18c5cd};}export async function prepareJourneyFiles(_0x206c76,_0x4566b2,_0x4ceb89,_0x521ba1){const _0x2cb74e=a98_0x545ff9,_0x78b25b=[],_0x2933c6=new Set();for(const {yamlConfig:_0x3a5e3c,folderPath:_0x145240,sourcePath:_0x483d9b}of _0x206c76){const _0x5bd4c8=resolveTDFolderPath(_0x145240,_0x4ceb89,_0x521ba1),_0x26094c=_0x5bd4c8+':'+_0x3a5e3c[_0x2cb74e(0x1e7)],_0x5c3f84=_0x4566b2['journeyBundlesByFolderAndName'][_0x2cb74e(0x1ad)](_0x26094c);let _0x250b21,_0x466e28;if(_0x5c3f84&&_0x5c3f84[_0x2cb74e(0x226)]>0x0){const _0x518a1c=buildLocalExpandedRuleMappings(_0x3a5e3c),{createYamlContext:_0x35a34a,prefetchJourneySegments:_0xf9eaab}=createPushYamlContextForBundle(_0x4566b2[_0x2cb74e(0x1d8)],_0x4566b2[_0x2cb74e(0x231)],_0x4566b2[_0x2cb74e(0x24f)],_0x518a1c,_0x4566b2[_0x2cb74e(0x1e5)],_0x4566b2['connectionIdToNameMap'],_0x4566b2[_0x2cb74e(0x289)],_0x4566b2['journeyById']);await _0xf9eaab(_0x5c3f84[_0x2cb74e(0x1bf)](_0xee6b69=>_0xee6b69['id']));const _0x582cc0=hasMultipleVersions(_0x3a5e3c),_0x5d5f93=async _0x252c25=>{const _0x366c91=_0x2cb74e,_0xace943=_0x4566b2[_0x366c91(0x1c2)]?.['get'](_0x252c25);if(_0xace943)return _0xace943;return _0x4566b2[_0x366c91(0x1ba)]({'journeyId':_0x252c25,'journeyName':_0x3a5e3c[_0x366c91(0x1e7)],'isMultiVersion':_0x5c3f84[_0x366c91(0x226)]>0x1});};if(_0x582cc0&&_0x5c3f84[_0x2cb74e(0x226)]>0x1){const _0x25a2ea=[];for(const _0xc8832 of _0x5c3f84){const _0x4dc2b4=_0xc8832['versionNumber']||0x1;_0x4566b2[_0x2cb74e(0x246)]?.[_0x2cb74e(0x203)](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]+'\x20v'+_0x4dc2b4);const _0x10c506=await _0x5d5f93(_0xc8832['id']),_0x271050=_0x35a34a(_0xc8832['id']),_0x35637c=await journeyResponseToDef(_0x10c506,_0x271050);_0x25a2ea[_0x2cb74e(0x277)]({'item':_0xc8832,'yaml':_0x35637c});}const _0xe01b6a=buildLocalRuleToNameMappingFromJourney(_0x3a5e3c);_0x466e28=buildMergedJourneyDef(_0x25a2ea,_0xe01b6a);const _0x5861c1=Math[_0x2cb74e(0x234)](..._0x25a2ea[_0x2cb74e(0x1bf)](_0x4e167b=>_0x4e167b[_0x2cb74e(0x285)][_0x2cb74e(0x233)]||0x0)),_0x97753d=_0x5c3f84[_0x2cb74e(0x284)](_0x1b4f76=>(_0x1b4f76[_0x2cb74e(0x233)]||0x0)===_0x5861c1);_0x97753d&&(_0x4566b2[_0x2cb74e(0x246)]?.['update'](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]+'\x20v'+_0x5861c1),_0x250b21=await _0x5d5f93(_0x97753d['id']));}else{const _0x5d6569=_0x5c3f84[_0x5c3f84[_0x2cb74e(0x226)]-0x1];_0x4566b2[_0x2cb74e(0x246)]?.[_0x2cb74e(0x203)](_0x2cb74e(0x219)+_0x3a5e3c[_0x2cb74e(0x1e7)]),_0x250b21=await _0x5d5f93(_0x5d6569['id']);const _0x44f48b=_0x35a34a(_0x5d6569['id']),_0x258f80=await journeyResponseToDef(_0x250b21,_0x44f48b),_0x2bf4d1=buildLocalRuleToNameMappingFromJourney(_0x3a5e3c);_0x466e28=buildMergedJourneyDef([{'item':_0x5d6569,'yaml':_0x258f80}],_0x2bf4d1);}}addFoldersToCreate(_0x5bd4c8,_0x4566b2[_0x2cb74e(0x1c7)],_0x2933c6);const _0x2e456c=calculateJourneyDiff(_0x3a5e3c,_0x466e28);_0x78b25b[_0x2cb74e(0x277)]({'relativePath':_0x3a5e3c['name'],'absolutePath':_0x483d9b,'yamlConfig':_0x3a5e3c,'folderPath':_0x5bd4c8,'existingJourney':_0x250b21,'isNew':_0x2e456c['isNew'],'hasChanges':_0x2e456c[_0x2cb74e(0x1d4)],'diff':_0x2e456c[_0x2cb74e(0x24a)]});}return{'journeyFiles':_0x78b25b,'foldersToCreate':_0x2933c6};}export function calculateActivationActions(_0x3ccd10,_0x415286,_0x31a9c8,_0x48e22f){const _0x4fd9a5=a98_0x545ff9,_0x555781=[],_0x4e3ff7=new Map();for(const _0x9504ee of _0x415286){_0x4e3ff7[_0x4fd9a5(0x22b)](_0x9504ee[_0x4fd9a5(0x1e7)],_0x9504ee);}const _0x8d481f=new Map();for(const _0x30444a of _0x3ccd10){_0x8d481f[_0x4fd9a5(0x22b)](_0x30444a[_0x4fd9a5(0x1e7)],_0x30444a);}for(const _0x13fa34 of _0x3ccd10){const _0x4e3025=_0x4e3ff7[_0x4fd9a5(0x1ad)](_0x13fa34[_0x4fd9a5(0x1e7)]);if(!_0x4e3025)_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x270),'name':_0x13fa34[_0x4fd9a5(0x1e7)],'yamlActivation':_0x13fa34});else{const _0x41744c=activationResponseToDef(_0x4e3025,_0x31a9c8,_0x48e22f),_0x281436=a98_0x1fee7e[_0x4fd9a5(0x1b9)](_0x41744c),_0xf6962d=a98_0x1fee7e[_0x4fd9a5(0x1b9)](_0x13fa34);_0x281436!==_0xf6962d&&_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x203),'name':_0x13fa34[_0x4fd9a5(0x1e7)],'yamlActivation':_0x13fa34,'existingActivation':_0x4e3025});}}for(const _0x2aef59 of _0x415286){!_0x8d481f['has'](_0x2aef59['name'])&&_0x555781[_0x4fd9a5(0x277)]({'type':_0x4fd9a5(0x1c4),'name':_0x2aef59['name'],'existingActivation':_0x2aef59});}return _0x555781;}export function calculateSegmentDiff(_0x4668b4,_0x45e8e4,_0x4f502c,_0x96fca7,_0x4b6191){const _0x46c81f=segmentToYamlString(_0x4668b4);if(_0x45e8e4){const _0x596197=segmentWithActivationsToYaml(_0x45e8e4,_0x4f502c,undefined,_0x96fca7,_0x4b6191),_0x51004b=segmentToYamlString(_0x596197),_0x3384bd=generateDiff(_0x51004b,_0x46c81f),_0x45c540=hasChanges(_0x3384bd);return{'isNew':![],'hasChanges':_0x45c540,'diff':_0x45c540?formatDiffWithColors(_0x3384bd):undefined};}const _0x3292a1=generateDiff('',_0x46c81f);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3292a1)};}export function calculateJourneyDiff(_0x26c8bd,_0x339806){const _0x310348=normalizeJourneyDef(_0x26c8bd,_0x26c8bd),_0x565cec=a98_0x4774d0(_0x310348);if(_0x339806){const _0x21a38e=normalizeJourneyDef(_0x339806,_0x26c8bd),_0x40de8b=a98_0x4774d0(_0x21a38e),_0x47d85c=generateDiff(_0x40de8b,_0x565cec),_0x254db3=hasChanges(_0x47d85c);return{'isNew':![],'hasChanges':_0x254db3,'diff':_0x254db3?formatDiffWithColors(_0x47d85c):undefined};}const _0x12eccb=generateDiff('',_0x565cec);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x12eccb)};}export function findSegmentsToDelete(_0x24f3aa,_0x5106b8,_0x47ca97,_0x154c59,_0x263b0d){const _0xd1f56=a98_0x545ff9,_0x5f164b=new Set();for(const {yamlConfig:_0x42cd13,folderPath:_0x4c489d}of _0x5106b8){_0x5f164b[_0xd1f56(0x23e)](_0x4c489d+':'+_0x42cd13['name']);}return _0x24f3aa['filter'](_0x481b80=>{const _0x40da34=_0xd1f56,_0x5c3148=_0x481b80[_0x40da34(0x22e)]?_0x47ca97[_0x40da34(0x1ad)](_0x481b80[_0x40da34(0x22e)][_0x40da34(0x1f2)]())||'':'',_0x4b7ae3=_0x5c3148+':'+_0x481b80[_0x40da34(0x1e7)];if(_0x5f164b[_0x40da34(0x1f0)](_0x4b7ae3))return![];if(_0x263b0d)return _0x5c3148===_0x154c59||_0x5c3148['startsWith'](_0x154c59+'/');return!![];});}export function findJourneysToDelete(_0xef9ae1,_0x391d7b,_0x19dc2a,_0x561d3d,_0x45d3e4){const _0xa1e6a7=a98_0x545ff9,_0x5acbac=new Set();for(const {yamlConfig:_0x31de67,folderPath:_0x43569b}of _0x391d7b){_0x5acbac[_0xa1e6a7(0x23e)](_0x43569b+':'+_0x31de67['name']);}return _0xef9ae1[_0xa1e6a7(0x20e)](_0x5ebdf1=>{const _0x374b62=_0xa1e6a7,_0x80abc6=_0x5ebdf1[_0x374b62(0x257)]?_0x19dc2a[_0x374b62(0x1ad)](_0x5ebdf1[_0x374b62(0x257)])||'':'',_0x9b2aec=_0x80abc6+':'+_0x5ebdf1['journeyBundleName'];if(_0x5acbac['has'](_0x9b2aec))return![];if(_0x45d3e4)return _0x80abc6===_0x561d3d||_0x80abc6[_0x374b62(0x1cc)](_0x561d3d+'/');return!![];});}export function buildSegmentLookupMap(_0x26bbc7,_0x65e4a){const _0x1d87c4=a98_0x545ff9,_0x53ba6a=new Map();for(const _0x20be35 of _0x26bbc7){const _0x32388b=_0x20be35['segmentFolderId']?_0x65e4a['get'](_0x20be35['segmentFolderId']['toString']())||'':'',_0x145c8e=_0x32388b+':'+_0x20be35[_0x1d87c4(0x1e7)];_0x53ba6a['set'](_0x145c8e,_0x20be35);}return _0x53ba6a;}export function buildSegmentNameToIdMap(_0x1d1b18){const _0x214b89=a98_0x545ff9,_0xc9246=new Map();for(const _0x1ea982 of _0x1d1b18){_0xc9246[_0x214b89(0x22b)](_0x1ea982[_0x214b89(0x1e7)],_0x1ea982['id']);}return _0xc9246;}export function buildJourneyBundleLookupMap(_0x7280aa,_0x50a519){const _0x43da6d=a98_0x545ff9,_0x2844fd=new Map();for(const _0x25a428 of _0x7280aa){const _0x2ed6d5=_0x25a428[_0x43da6d(0x257)]?_0x50a519['get'](_0x25a428[_0x43da6d(0x257)])||'':'',_0x10cd5f=_0x2ed6d5+':'+_0x25a428[_0x43da6d(0x274)];!_0x2844fd[_0x43da6d(0x1f0)](_0x10cd5f)&&_0x2844fd[_0x43da6d(0x22b)](_0x10cd5f,[]),_0x2844fd[_0x43da6d(0x1ad)](_0x10cd5f)['push'](_0x25a428);}for(const _0x30b540 of _0x2844fd[_0x43da6d(0x1d1)]()){_0x30b540[_0x43da6d(0x26e)]((_0x1bb756,_0x1065f)=>(_0x1bb756[_0x43da6d(0x233)]||0x0)-(_0x1065f[_0x43da6d(0x233)]||0x0));}return _0x2844fd;}export function collectFoldersToCreate(_0x5a3812,_0x5b3f95){const _0xf17fb0=a98_0x545ff9,_0x476971=new Set();for(const _0x594c00 of _0x5a3812){if(!_0x594c00)continue;if(_0x5b3f95[_0xf17fb0(0x1f0)](_0x594c00))continue;const _0x2ff654=_0x594c00[_0xf17fb0(0x1ce)]('/');let _0x2ab68d='';for(const _0x31a1d7 of _0x2ff654){_0x2ab68d=_0x2ab68d?_0x2ab68d+'/'+_0x31a1d7:_0x31a1d7,!_0x5b3f95['has'](_0x2ab68d)&&_0x476971[_0xf17fb0(0x23e)](_0x2ab68d);}}return _0x476971;}export function parseAndClassifyYamlFiles(_0xa5741,_0x43f4ad,_0xbd5073){const _0x1aec9b=a98_0x545ff9,_0x1b5269=[],_0x33e675=[];for(const _0x3de1fd of _0xa5741){const _0x214b5c=a98_0x4a9171[_0x1aec9b(0x1ea)](_0x43f4ad,a98_0x4a9171[_0x1aec9b(0x1d5)](_0x3de1fd)),_0xefd256=_0x214b5c==='.'?'':_0x214b5c,_0x24f98a=readFileSync(_0x3de1fd,'utf-8'),_0x5306e9=a98_0x1fee7e[_0x1aec9b(0x255)](_0x24f98a);if(isJourneyDef(_0x5306e9)){const _0x40e151=a98_0x13dd3b(_0x24f98a);_0x33e675[_0x1aec9b(0x277)]({'yamlConfig':_0x40e151,'folderPath':_0xefd256,'sourcePath':_0x3de1fd});}else{if(!_0xbd5073?.[_0x1aec9b(0x200)]){const _0x31ac2c=parseSegmentYamlFile(_0x24f98a),_0x439ba1=normalizeChildSegmentYaml(_0x31ac2c);_0x1b5269[_0x1aec9b(0x277)]({'yamlConfig':_0x439ba1,'folderPath':_0xefd256,'sourcePath':_0x3de1fd});}}}return{'segments':_0x1b5269,'journeys':_0x33e675};}function a98_0x3634(){const _0x62ff44=['find','item','\x27\x20from\x20file:\x20','getJourney','with','activationStepsById','parseDocument','WaitStep','\x27\x20milestone','size','get','onProgress','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','all','connector_config','getSegment','user','attributes','INTERNAL','\x27...','message','activation_updating','stringify','fetchJourney','withProgress','Segment\x20not\x20found:\x20','resolveJourneyId','ACTIVATION_UPDATE_ERROR','map','105724famhpc','activationContext','journeyById','\x20(referenced\x20in\x20journey\x20','delete','kind','Created\x20journey\x20\x27','folderPathToId','activation_created','parentFolder','segmentNameToId','journey_created','startsWith','embedded_activation_created','split','flatMap','notification','values','listSegments','decision_point','hasChanges','dirname','journeyStages','stage\x20\x27','deps','createdSegmentId','nameToId','embeddedSegmentNameToId','segmentId','logSuccess','DecisionPoint','4930700LcQCdk','isNew','reduce','utf-8','createdSegmentIds','goal','idToEmailMap','schedule','name','10358312PHBUEz','createJourneySegment','relative','Created\x20activation\x20\x27','segment_deleted','absolutePath','action','type','has','entryCriteria','toString','results','stages','idToName','activationsBySegmentId','created','activation_deleted','segment_deleting','verbose','segment','Activation','toLowerCase','embedded_activation_creating','existingJourney','skipSegments','26kCGxUi','activationActions','update','embedded_segment_creating','activation_creating','journeyActivationNameToId','journeys','journeyId','Deleted\x20segment\x20\x27','deleted','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','isArray','valid','filter','\x27\x20entry\x20criteria','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','entry_criteria','journey','connection','existingActivation','6BkGhjb','createFolder','index','JOURNEY_SYNTAX_ERROR','Fetching\x20','\x20error(s)','columns','Updating\x20activation\x20\x27','Creating\x20activation\x20\x27','exitCriterias','all_columns','9crOnWT','segment_updated','journeyActivationStepId','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','deleteActivation','__pending_','length','logDeleted','keys','segment_updating','includes','set','./journey-yaml.js','Created\x20segment\x20\x27','segmentFolderId','./child-segment-yaml.js','entries','parentId','Updated\x20journey\x20\x27','versionNumber','max','resolveSegment','data','replace','yamlActivation','localSegmentRules','\x27\x20wait\x20condition',').\x20','1322166BBaoEl','activation_template_id','add','milestone','Stage\x20\x27','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','createSegment','waitCondition','SEGMENT_SYNTAX_ERROR','activations','progress','description','folderPath','from','diff','createActivation','NOT_FOUND','segment_created','existingSegment','existingSegments','listActivations','Deleted\x20activation\x20\x27','updated','connectionIdToNameMap','join','parse','rootFolderId','folderId','steps','\x27\x20exit\x20criteria','SEGMENT_NOT_FOUND','\x0a\x20\x20','list','6626680DoLygD','\x20activation\x20\x27','367752tckRvG','sha1','digest','\x20journey\x20from\x20file:\x20','folder','updateActivation','yamlConfig','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','segments','Creating\x20segment\x20\x27','activation_','unchanged','Updated\x20segment\x20\x27','\x27\x20decision\x20point\x20branch\x20\x27','slice','sort','../../utils/async.js','create','errors','Entry\x20criteria:\x20','Failed\x20to\x20','journeyBundleName','\x27\x20for\x20','buildUserMaps','push','SEGMENT_UPDATE_ERROR','Activation\x20not\x20found:\x20','journey_entry_criteria_','activation_deleting','124512oHsDPI','journey_updating','\x20segment\x20from\x20file:\x20','rule','relationships','validatedRequest','getActivation','branches'];a98_0x3634=function(){return _0x62ff44;};return a98_0x3634();}export function validateParsedFiles(_0x49c9bc,_0x52a4cb){const _0x227e38=a98_0x545ff9,_0x535ffc=[];for(const {yamlConfig:_0x2b323b,sourcePath:_0x1535ba}of _0x49c9bc[_0x227e38(0x267)]){const _0x2af58c=readFileSync(_0x1535ba,_0x227e38(0x1e2)),_0x1f39ec=a98_0x1fee7e[_0x227e38(0x28a)](_0x2af58c),_0x2f9eb5=validateSegmentDef(_0x2b323b,{'source':_0x2af58c,'document':_0x1f39ec});if(!_0x2f9eb5[_0x227e38(0x20d)]){const _0x5a9b3c=a98_0x4a9171[_0x227e38(0x1ea)](_0x52a4cb,_0x1535ba);_0x535ffc[_0x227e38(0x277)]({'filePath':_0x5a9b3c,'source':_0x2af58c,'result':_0x2f9eb5,'isJourney':![]});}}for(const {yamlConfig:_0x4e70fd,sourcePath:_0x4f1bc4}of _0x49c9bc['journeys']){const _0x532ecc=readFileSync(_0x4f1bc4,_0x227e38(0x1e2)),_0x2546df=a98_0x1fee7e[_0x227e38(0x28a)](_0x532ecc),_0x2e857c=validateJourneyDef(_0x4e70fd,{'source':_0x532ecc,'document':_0x2546df});if(!_0x2e857c[_0x227e38(0x20d)]){const _0x5b1fa4=a98_0x4a9171[_0x227e38(0x1ea)](_0x52a4cb,_0x4f1bc4);_0x535ffc[_0x227e38(0x277)]({'filePath':_0x5b1fa4,'source':_0x532ecc,'result':_0x2e857c,'isJourney':!![]});}}return _0x535ffc;}export function formatValidationErrors(_0x3ff87d){const _0x5cf9d0=a98_0x545ff9,_0x5af0ec=[];for(const {filePath:_0x31272a,source:_0x215ab2,result:_0x3ae9dc,isJourney:_0x386cad}of _0x3ff87d){const _0x38ad3c=_0x386cad?_0x5cf9d0(0x212):_0x5cf9d0(0x1fb);_0x5af0ec[_0x5cf9d0(0x277)]('\x0a'+_0x31272a+'\x20('+_0x38ad3c+'):\x20'+_0x3ae9dc[_0x5cf9d0(0x271)][_0x5cf9d0(0x226)]+_0x5cf9d0(0x21a)),_0x5af0ec[_0x5cf9d0(0x277)](formatValidationResult(_0x3ae9dc,_0x215ab2,_0x31272a));}return _0x5af0ec[_0x5cf9d0(0x254)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x3fdec0){const _0x20459b=a98_0x545ff9,_0x267993=new Set(),_0x58ea11=new Map(),_0x2434b7=collectSegmentUsageCounts(_0x3fdec0);if(_0x3fdec0[_0x20459b(0x267)])for(const [_0x3fb1b7,_0x2cf66c]of Object[_0x20459b(0x230)](_0x3fdec0[_0x20459b(0x267)])){_0x267993['add'](_0x3fb1b7);if(_0x2cf66c[_0x20459b(0x27f)]){const _0x4f6ab5=yamlRuleToApi(_0x2cf66c[_0x20459b(0x27f)]),_0x15a6d4=apiRuleToYaml(_0x4f6ab5);_0x58ea11[_0x20459b(0x22b)](_0x3fb1b7,_0x15a6d4);}}const _0x4057c4=new Map();let _0x472a08=0x0;for(const [_0x5a9bc6,_0x2091ca]of _0x58ea11){const _0x2b6f66=serializeExpandedRule(_0x2091ca,_0x58ea11),_0x4b212e=_0x4057c4[_0x20459b(0x1ad)](_0x2b6f66)||[];_0x4b212e[_0x20459b(0x277)]({'name':_0x5a9bc6,'index':_0x472a08}),_0x4057c4[_0x20459b(0x22b)](_0x2b6f66,_0x4b212e),_0x472a08++;}const _0x40a066=new Map();for(const [_0xa9dfef,_0x8e4507]of _0x4057c4){const _0x1dca06=_0x8e4507['slice']()[_0x20459b(0x26e)]((_0x11b04c,_0x2063b4)=>{const _0x2687a7=_0x20459b,_0x1f4a3f=_0x2434b7[_0x2687a7(0x1ad)](_0x11b04c[_0x2687a7(0x1e7)])||0x0,_0x801395=_0x2434b7[_0x2687a7(0x1ad)](_0x2063b4[_0x2687a7(0x1e7)])||0x0;if(_0x1f4a3f!==_0x801395)return _0x801395-_0x1f4a3f;return _0x11b04c[_0x2687a7(0x217)]-_0x2063b4[_0x2687a7(0x217)];})[_0x20459b(0x1bf)](_0x3a0d93=>_0x3a0d93[_0x20459b(0x1e7)]),_0x5e1c23=[];for(const _0x4fde36 of _0x1dca06){const _0x4dedbc=_0x2434b7[_0x20459b(0x1ad)](_0x4fde36)||0x0,_0x7e7e3f=Math[_0x20459b(0x234)](_0x4dedbc,0x1);for(let _0x3bbfd5=0x0;_0x3bbfd5<_0x7e7e3f;_0x3bbfd5++){_0x5e1c23[_0x20459b(0x277)](_0x4fde36);}}_0x40a066[_0x20459b(0x22b)](_0xa9dfef,_0x5e1c23);}return{'existingLocalSegmentNames':_0x267993,'localSegmentRules':_0x58ea11,'localExpandedRuleToNames':_0x40a066};}async function buildServerSegmentRuleMap(_0x2a9ccf,_0x1bc91b,_0xafc8b6,_0x4be332){const _0x122085=new Map(),_0x40bc1b=new Set(),_0x25b757=async _0x2481b9=>{const _0x1f0e8d=a98_0x1668;if(_0x40bc1b['has'](_0x2481b9))return;_0x40bc1b[_0x1f0e8d(0x23e)](_0x2481b9);let _0x3e186a=_0xafc8b6[_0x1f0e8d(0x284)](_0x17d374=>_0x17d374['id']===_0x2481b9);if(!_0x3e186a)try{_0x3e186a=await _0x2a9ccf[_0x1f0e8d(0x1fb)][_0x1f0e8d(0x1b2)](_0x1bc91b,_0x2481b9);}catch{return;}if(!_0x3e186a?.['rule'])return;const _0x191991=apiRuleToYaml(_0x3e186a[_0x1f0e8d(0x27f)]);_0x122085[_0x1f0e8d(0x22b)](_0x2481b9,_0x191991);const _0x3e582f=collectSegmentRefsFromRule(_0x191991);for(const _0x44d007 of _0x3e582f){await _0x25b757(_0x44d007);}};for(const _0x41b856 of _0x4be332){await _0x25b757(_0x41b856);}return _0x122085;}export function createSegmentIdResolver(_0x2fd889,_0x34824f){return async _0x977483=>{const _0x371d8b=a98_0x1668,_0x2b00f9=_0x2fd889[_0x371d8b(0x1ad)](_0x977483);if(!_0x2b00f9)throw new SDKError(ErrorCode[_0x371d8b(0x25a)],_0x371d8b(0x1bc)+_0x977483+_0x371d8b(0x223)+_0x34824f+'\x27)');return _0x2b00f9;};}export function extractRootFolderId(_0x1611a9){const _0x55f7b9=a98_0x545ff9;return _0x1611a9[_0x55f7b9(0x280)]?.['parentSegmentFolder']?.[_0x55f7b9(0x236)]?.['id']||_0x1611a9[_0x55f7b9(0x280)]?.[_0x55f7b9(0x1c9)]?.[_0x55f7b9(0x236)]?.['id'];}export function buildConnectionMaps(_0x1b2118){const _0x27ac87=a98_0x545ff9,_0x148946=new Map(),_0x4ca259=new Map(),_0x23b7e9=new Map();for(const _0x3cde4e of _0x1b2118){_0x148946[_0x27ac87(0x22b)](_0x3cde4e['name'],parseInt(_0x3cde4e['id'],0xa)),_0x4ca259[_0x27ac87(0x22b)](_0x3cde4e['id'],_0x3cde4e['name']),_0x23b7e9[_0x27ac87(0x22b)](_0x3cde4e['name'],_0x3cde4e['type']);}return{'nameToId':_0x148946,'idToName':_0x4ca259,'nameToType':_0x23b7e9};}export function calculatePushStats(_0x4e3a51,_0x51c8b6,_0x4f2a28,_0x4d2304,_0x570445,_0x23dd10,_0x10140b){const _0x361deb=a98_0x545ff9,_0x499926=_0x4e3a51[_0x361deb(0x20e)](_0x589817=>_0x589817[_0x361deb(0x1e0)]),_0x30660b=_0x4e3a51['filter'](_0x54bbd3=>!_0x54bbd3['isNew']&&_0x54bbd3[_0x361deb(0x1d4)]),_0x158eed=_0x4e3a51['filter'](_0x46d1e0=>!_0x46d1e0[_0x361deb(0x1e0)]&&!_0x46d1e0[_0x361deb(0x1d4)]),_0x2621ce=_0x23dd10?_0x4d2304:[],_0x1d2557=_0x51c8b6[_0x361deb(0x20e)](_0x353544=>_0x353544[_0x361deb(0x1e0)]),_0x525a36=_0x51c8b6[_0x361deb(0x20e)](_0x39e23b=>!_0x39e23b[_0x361deb(0x1e0)]&&_0x39e23b['hasChanges']),_0x83b237=_0x51c8b6[_0x361deb(0x20e)](_0x65adf6=>!_0x65adf6[_0x361deb(0x1e0)]&&!_0x65adf6[_0x361deb(0x1d4)]),_0x490e8d=_0x23dd10?_0x570445:[],_0x23bff4=_0x4e3a51[_0x361deb(0x1cf)](_0x27584f=>_0x27584f[_0x361deb(0x202)]),_0x2c032b=_0x23bff4[_0x361deb(0x20e)](_0x28be89=>_0x28be89['type']===_0x361deb(0x270)),_0x4a0d0c=_0x23bff4[_0x361deb(0x20e)](_0x4bbd42=>_0x4bbd42['type']===_0x361deb(0x203)),_0x288e17=_0x23bff4[_0x361deb(0x20e)](_0x147226=>_0x147226[_0x361deb(0x1ef)]==='delete'),_0x30382d=Array[_0x361deb(0x249)](_0x4f2a28)[_0x361deb(0x26e)](),_0x127173=_0x10140b?![]:_0x499926[_0x361deb(0x226)]>0x0||_0x30660b[_0x361deb(0x226)]>0x0||_0x2621ce[_0x361deb(0x226)]>0x0,_0x365b6f=_0x1d2557[_0x361deb(0x226)]>0x0||_0x525a36[_0x361deb(0x226)]>0x0||_0x490e8d[_0x361deb(0x226)]>0x0,_0x13f146=_0x10140b?![]:_0x23bff4[_0x361deb(0x226)]>0x0,_0x36cfbf=_0x30382d[_0x361deb(0x226)]>0x0;return{'segments':{'new':_0x499926,'changed':_0x30660b,'unchanged':_0x158eed,'toDelete':_0x2621ce},'journeys':{'new':_0x1d2557,'changed':_0x525a36,'unchanged':_0x83b237,'toDelete':_0x490e8d},'activations':{'all':_0x23bff4,'toCreate':_0x2c032b,'toUpdate':_0x4a0d0c,'toDelete':_0x288e17},'folders':{'toCreate':_0x30382d},'counts':{'segments':{'new':_0x499926[_0x361deb(0x226)],'changed':_0x30660b['length'],'unchanged':_0x158eed[_0x361deb(0x226)],'toDelete':_0x2621ce[_0x361deb(0x226)]},'journeys':{'new':_0x1d2557[_0x361deb(0x226)],'changed':_0x525a36['length'],'unchanged':_0x83b237[_0x361deb(0x226)],'toDelete':_0x490e8d[_0x361deb(0x226)]},'activations':{'create':_0x2c032b[_0x361deb(0x226)],'update':_0x4a0d0c[_0x361deb(0x226)],'delete':_0x288e17['length']},'folders':_0x30382d[_0x361deb(0x226)]},'hasChanges':_0x127173||_0x365b6f||_0x13f146||_0x36cfbf};}export async function buildPushExecutionContext(_0x44379d,_0x5d77fa,_0xb12d65,_0xe614,_0x2dab5a,_0x3e7e4e){const _0x1c91bb=a98_0x545ff9,_0x1e349a=extractRootFolderId(_0xb12d65),{pathToId:_0x5e822a,idToPath:_0xbbbde9}=buildFolderMaps(_0x2dab5a),_0x43aa75=buildSegmentNameToIdMap(_0xe614),_0x500fbe=new Map(),{batchAsync:_0x2e9eed}=await import(_0x1c91bb(0x26f)),[_0x3f6361,_0x414754]=await Promise[_0x1c91bb(0x1b0)]([_0x44379d[_0x1c91bb(0x1b3)][_0x1c91bb(0x276)](),_0x44379d[_0x1c91bb(0x213)][_0x1c91bb(0x25c)](),((async()=>{const _0x37141c=_0x1c91bb;!_0x3e7e4e&&_0xe614[_0x37141c(0x226)]>0x0&&await _0x2e9eed(_0xe614,async _0x456ae4=>{const _0x5a95ff=_0x37141c,_0x36c486=await _0x44379d['segment'][_0x5a95ff(0x250)](_0x5d77fa,_0x456ae4['id']);_0x500fbe[_0x5a95ff(0x22b)](_0x456ae4['id'],_0x36c486);});})())]),{emailToId:_0xb7e373,idToEmail:_0x100513}=_0x3f6361,_0x10e053=buildConnectionMaps(_0x414754);return{'rootFolderId':_0x1e349a,'folderPathToId':_0x5e822a,'folderIdToPath':_0xbbbde9,'segmentNameToId':_0x43aa75,'activationsBySegmentId':_0x500fbe,'emailToIdMap':_0xb7e373,'idToEmailMap':_0x100513,'connectionNameToIdMap':_0x10e053[_0x1c91bb(0x1da)],'connectionIdToNameMap':_0x10e053[_0x1c91bb(0x1f5)],'connectionNameToTypeMap':_0x10e053['nameToType']};}export function createPushYamlContextForBundle(_0x3d98d8,_0x4c53d8,_0x1ec99,_0x57ca5e,_0x33ac29,_0x593ff9,_0x5b8800,_0x52f52d){const {existingLocalSegmentNames:_0x449527,localExpandedRuleToNames:_0x343bcd}=_0x57ca5e,_0x105d27=new Set(),_0x388c28=new Map(),_0x3494e6=new Map(),_0x3fb7bd=new Map(),_0x5c716c=createJumpTargetCache(),_0x388c10=new Map(),_0xf5c451=new Map(),_0x3388db=new Set();let _0x20d9f1;const _0x50cfb9=_0x51f9eb=>{const _0x409040={'resolveSegment':async _0x5f34f6=>{const _0x254813=a98_0x1668,_0xc5e67d=_0x3fb7bd[_0x254813(0x1ad)](_0x5f34f6);if(_0xc5e67d!==undefined)return{'name':_0xc5e67d,'isJourneyLocal':!![]};try{let _0x3e44fe=_0x1ec99[_0x254813(0x284)](_0x42a2a8=>_0x42a2a8['id']===_0x5f34f6);!_0x3e44fe&&(_0x3e44fe=await _0x3d98d8['segment'][_0x254813(0x1b2)](_0x4c53d8,_0x5f34f6));const _0x32719e=generateJourneyLocalName(_0x3e44fe[_0x254813(0x1e7)]),_0x3f18c0=_0x3e44fe[_0x254813(0x1c5)]===SEGMENT_KIND_JOURNEY&&_0x32719e!==undefined;let _0x5deb07=_0x3e44fe['name'],_0x5a3393;if(_0x3f18c0&&_0x3e44fe[_0x254813(0x27f)]){const _0x569773=apiRuleToYaml(_0x3e44fe[_0x254813(0x27f)]);_0xf5c451[_0x254813(0x22b)](_0x5f34f6,_0x569773);const _0x228e8a=async _0x3ce2ae=>{const _0x1e5604=_0x254813,_0x243de5=collectSegmentRefsFromRule(_0x3ce2ae);for(const _0xc981f1 of _0x243de5){if(!_0xf5c451[_0x1e5604(0x1f0)](_0xc981f1))try{const _0x3b00e4=await _0x3d98d8[_0x1e5604(0x1fb)][_0x1e5604(0x1b2)](_0x4c53d8,_0xc981f1);if(_0x3b00e4?.['rule']){const _0x368117=apiRuleToYaml(_0x3b00e4[_0x1e5604(0x27f)]);_0xf5c451[_0x1e5604(0x22b)](_0xc981f1,_0x368117),await _0x228e8a(_0x368117);}}catch{}}};await _0x228e8a(_0x569773);const _0x2ac18=serializeExpandedRule(_0x569773,_0xf5c451),_0x1cab83=_0x343bcd['get'](_0x2ac18);if(_0x1cab83&&_0x1cab83['length']>0x0){const _0x17cfdb=_0x388c28[_0x254813(0x1ad)](_0x2ac18)||0x0,_0x5bccbc=_0x1cab83[_0x17cfdb]||_0x1cab83[_0x1cab83['length']-0x1];_0x388c28[_0x254813(0x22b)](_0x2ac18,_0x17cfdb+0x1),_0x5deb07=_0x5bccbc,_0x105d27['add'](_0x5deb07),_0x3fb7bd[_0x254813(0x22b)](_0x5f34f6,_0x5deb07);const _0x1f5955=await resolveRuleSegmentRefs(_0x569773,async _0x44669a=>{const _0x53b99e=_0x254813,_0x4b0146=_0x3fb7bd[_0x53b99e(0x1ad)](_0x44669a);if(_0x4b0146)return _0x4b0146;const _0x435760=await _0x20d9f1[_0x53b99e(0x235)](_0x44669a);return _0x435760['name'];});_0x5a3393={'description':_0x3e44fe['description'],'rule':_0x1f5955};}else{const _0x154851=_0x388c10[_0x254813(0x1ad)](_0x2ac18);if(_0x154851)_0x5deb07=_0x154851,_0x3fb7bd[_0x254813(0x22b)](_0x5f34f6,_0x5deb07);else{if(_0x32719e){let _0x2784ce=_0x32719e,_0x4d0483=0x2;while(_0x105d27[_0x254813(0x1f0)](_0x2784ce)||_0x449527[_0x254813(0x1f0)](_0x2784ce)){_0x2784ce=_0x32719e+'_'+_0x4d0483,_0x4d0483++;}_0x105d27['add'](_0x2784ce),_0x5deb07=_0x2784ce;}_0x3fb7bd['set'](_0x5f34f6,_0x5deb07),_0x388c10[_0x254813(0x22b)](_0x2ac18,_0x5deb07);const _0x4fe7c7=await resolveRuleSegmentRefs(_0x569773,async _0x2ff80f=>{const _0x48db2f=_0x254813,_0xd6488f=_0x3fb7bd['get'](_0x2ff80f);if(_0xd6488f)return _0xd6488f;const _0x3b8198=await _0x20d9f1[_0x48db2f(0x235)](_0x2ff80f);return _0x3b8198['name'];});_0x5a3393={'description':_0x3e44fe[_0x254813(0x247)],'rule':_0x4fe7c7};}}}return{'name':_0x5deb07,'isJourneyLocal':_0x3f18c0,'definition':_0x5a3393};}catch{return{'name':_0x5f34f6,'isJourneyLocal':![]};}},'resolveActivation':async _0x1450e5=>{const _0x45a83a=a98_0x1668,_0x4850a6=_0x3494e6[_0x45a83a(0x1ad)](_0x1450e5);if(_0x4850a6!==undefined)return{'name':_0x4850a6,'isJourneyLocal':!![]};try{let _0x17ed4a=_0x5b8800?.[_0x45a83a(0x1ad)](_0x1450e5);!_0x17ed4a&&(_0x17ed4a=await _0x3d98d8[_0x45a83a(0x212)][_0x45a83a(0x282)](_0x51f9eb,_0x1450e5));const _0x2abfae=_0x17ed4a[_0x45a83a(0x1b4)]['activationParams'][_0x45a83a(0x1e7)]||_0x1450e5,_0x3d2bc5=sanitizeYamlKey(_0x2abfae)||_0x45a83a(0x269)+_0x1450e5,_0x4e6028=_0x3d2bc5;_0x3494e6[_0x45a83a(0x22b)](_0x1450e5,_0x4e6028);const _0x5c19ac=journeyActivationStepToYaml(_0x17ed4a,_0x33ac29,_0x593ff9);return{'name':_0x4e6028,'isJourneyLocal':!![],'definition':_0x5c19ac};}catch{return{'name':_0x1450e5,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5a1efc,_0x2add03)=>resolveJumpTarget(_0x5a1efc,_0x2add03,_0x5c716c,async _0xd6e0c9=>{const _0x331f58=a98_0x1668,_0x5ce015=_0x52f52d?.[_0x331f58(0x1ad)](_0xd6e0c9);if(_0x5ce015)return _0x5ce015;return _0x3d98d8[_0x331f58(0x212)]['getJourney'](_0xd6e0c9);})};return _0x20d9f1=_0x409040,_0x409040;},_0x5b3d6d=async _0x87a9b4=>{const _0x2d3af7=a98_0x1668,{collectSegmentIdsFromJourneyApi:_0x4fb92d}=await import(_0x2d3af7(0x22c)),{batchAsync:_0xd6b6c2}=await import('../../utils/async.js'),_0x34cc6f=new Set();for(const _0x2c033d of _0x87a9b4){let _0x1b3c7d=_0x52f52d?.[_0x2d3af7(0x1ad)](_0x2c033d);!_0x1b3c7d&&(_0x1b3c7d=await _0x3d98d8['journey'][_0x2d3af7(0x287)](_0x2c033d));const _0x1a5c81=_0x4fb92d(_0x1b3c7d);for(const _0x5d0e07 of _0x1a5c81){_0x34cc6f[_0x2d3af7(0x23e)](_0x5d0e07);}}let _0x37230e=Array['from'](_0x34cc6f);while(_0x37230e[_0x2d3af7(0x226)]>0x0){const _0x427c2f=_0x37230e[_0x2d3af7(0x20e)](_0x55f80e=>!_0x3388db[_0x2d3af7(0x1f0)](_0x55f80e));if(_0x427c2f[_0x2d3af7(0x226)]===0x0)break;const _0x3b558a=await _0xd6b6c2(_0x427c2f,async _0x494387=>{const _0x5c74d2=_0x2d3af7;_0x3388db['add'](_0x494387);let _0x15c931=_0x1ec99[_0x5c74d2(0x284)](_0x2f4f2c=>_0x2f4f2c['id']===_0x494387);if(!_0x15c931)try{_0x15c931=await _0x3d98d8['segment'][_0x5c74d2(0x1b2)](_0x4c53d8,_0x494387);}catch{return null;}return{'segmentId':_0x494387,'segment':_0x15c931};},0xa),_0x118ca9=new Set();for(const _0x25b324 of _0x3b558a){if(!_0x25b324?.['segment']?.[_0x2d3af7(0x27f)])continue;const _0x788389=apiRuleToYaml(_0x25b324[_0x2d3af7(0x1fb)]['rule']);_0xf5c451[_0x2d3af7(0x22b)](_0x25b324[_0x2d3af7(0x1dc)],_0x788389);const _0x2be5fa=collectSegmentRefsFromRule(_0x788389);for(const _0x448911 of _0x2be5fa){!_0x3388db[_0x2d3af7(0x1f0)](_0x448911)&&_0x118ca9[_0x2d3af7(0x23e)](_0x448911);}}_0x37230e=Array[_0x2d3af7(0x249)](_0x118ca9);}};return{'createYamlContext':_0x50cfb9,'prefetchJourneySegments':_0x5b3d6d};}export async function executePushSegments(_0x5cb398,_0x2e5ba1,_0x141042,_0x15258b,_0x592bee){const _0x38421b=a98_0x545ff9,{segmentDefToCreateRequest:_0x1a6cae,segmentDefToUpdateRequest:_0x5e9545}=await import(_0x38421b(0x22f)),_0x378f77=_0x141042['folderPathToId'],_0x318d85=0x5,_0x2eae01=async _0x47d65d=>{const _0x4b55b3=_0x38421b,_0x50352e=_0x47d65d[_0x4b55b3(0x248)]?_0x378f77[_0x4b55b3(0x1ad)](_0x47d65d[_0x4b55b3(0x248)]):undefined;let _0x45ae72;const _0x5de558={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};try{if(_0x47d65d['isNew']){_0x592bee[_0x4b55b3(0x1ae)]?.({'type':'segment_creating','name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]});const _0x39c9d0=_0x1a6cae(_0x47d65d['yamlConfig'],_0x50352e),_0x6c44b9=await _0x592bee['withProgress'](_0x4b55b3(0x268)+_0x47d65d[_0x4b55b3(0x265)]['name']+_0x4b55b3(0x1b6),()=>_0x5cb398['segment'][_0x4b55b3(0x242)](_0x15258b['parentId'],_0x39c9d0));_0x45ae72=_0x6c44b9['data']['id'],_0x5de558[_0x4b55b3(0x1d9)]={'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],'id':_0x45ae72},_0x592bee['onProgress']?.({'type':_0x4b55b3(0x24d),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],'segmentId':_0x45ae72}),_0x592bee['logSuccess']?.(_0x4b55b3(0x22d)+_0x47d65d[_0x4b55b3(0x265)]['name']+'\x27'),_0x5de558[_0x4b55b3(0x1f7)]=0x1;}else{if(_0x47d65d[_0x4b55b3(0x1d4)]){_0x592bee[_0x4b55b3(0x1ae)]?.({'type':_0x4b55b3(0x229),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]});const _0x1facf4=_0x5e9545(_0x47d65d[_0x4b55b3(0x265)]);_0x50352e!==_0x47d65d[_0x4b55b3(0x24e)]?.[_0x4b55b3(0x22e)]&&(_0x1facf4[_0x4b55b3(0x22e)]=_0x50352e?parseInt(_0x50352e,0xa):undefined),await _0x592bee[_0x4b55b3(0x1bb)]('Updating\x20segment\x20\x27'+_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]+_0x4b55b3(0x1b6),()=>_0x5cb398['segment']['updateSegmentById'](_0x15258b[_0x4b55b3(0x231)],_0x47d65d['existingSegment']['id'],_0x1facf4)),_0x45ae72=_0x47d65d['existingSegment']['id'],_0x592bee[_0x4b55b3(0x1ae)]?.({'type':_0x4b55b3(0x221),'name':_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)]}),_0x592bee[_0x4b55b3(0x1dd)]?.(_0x4b55b3(0x26b)+_0x47d65d[_0x4b55b3(0x265)]['name']+'\x27'),_0x5de558[_0x4b55b3(0x252)]=0x1;}else _0x45ae72=_0x47d65d[_0x4b55b3(0x24e)]['id'];}}catch(_0xbb29d1){const _0xb0546e=isHttp400Error(_0xbb29d1),_0x2b390d=_0xb0546e?ErrorCode[_0x4b55b3(0x244)]:ErrorCode[_0x4b55b3(0x278)],_0x4446ab=getErrorMessage(_0xbb29d1);throw new SDKError(_0x2b390d,_0x4b55b3(0x273)+(_0x47d65d[_0x4b55b3(0x1e0)]?_0x4b55b3(0x270):_0x4b55b3(0x203))+_0x4b55b3(0x27e)+_0x47d65d[_0x4b55b3(0x1ed)]+_0x4b55b3(0x25b)+_0x4446ab,_0xbb29d1);}try{const _0x4a7589=await syncActivationsForSegment(_0x5cb398,_0x15258b[_0x4b55b3(0x231)],_0x45ae72,_0x47d65d[_0x4b55b3(0x265)][_0x4b55b3(0x1e7)],_0x47d65d[_0x4b55b3(0x202)],_0x592bee,_0x47d65d[_0x4b55b3(0x1ed)]);_0x5de558[_0x4b55b3(0x245)]=_0x4a7589;}catch(_0x2c3488){if(_0x2c3488 instanceof SDKError)throw _0x2c3488;throw new SDKError(ErrorCode[_0x4b55b3(0x1be)],_0x4b55b3(0x241)+_0x47d65d['yamlConfig'][_0x4b55b3(0x1e7)]+'\x27\x20from\x20file:\x20'+_0x47d65d['absolutePath']+'\x0a\x20\x20'+getErrorMessage(_0x2c3488),_0x2c3488);}return _0x5de558;},_0x3f8163=await batchAsync(_0x2e5ba1,_0x2eae01,_0x318d85),_0x2250f7={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5e9c33 of _0x3f8163){_0x2250f7['created']+=_0x5e9c33['created'],_0x2250f7[_0x38421b(0x252)]+=_0x5e9c33[_0x38421b(0x252)],_0x5e9c33[_0x38421b(0x1d9)]&&_0x2250f7[_0x38421b(0x1e3)]['set'](_0x5e9c33['createdSegmentId'][_0x38421b(0x1e7)],_0x5e9c33[_0x38421b(0x1d9)]['id']),_0x2250f7[_0x38421b(0x245)][_0x38421b(0x1f7)]+=_0x5e9c33[_0x38421b(0x245)]['created'],_0x2250f7[_0x38421b(0x245)][_0x38421b(0x252)]+=_0x5e9c33['activations'][_0x38421b(0x252)],_0x2250f7[_0x38421b(0x245)][_0x38421b(0x20a)]+=_0x5e9c33['activations'][_0x38421b(0x20a)];}return _0x2250f7;}async function syncActivationsForSegment(_0x459475,_0x199cd0,_0x1379d3,_0x401402,_0x19f926,_0x5c2438,_0x26e7ac){const _0x7e8658=a98_0x545ff9,_0x399e8f={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4d5c80 of _0x19f926){try{if(_0x4d5c80['type']===_0x7e8658(0x270)&&_0x4d5c80['validatedRequest'])_0x5c2438['onProgress']?.({'type':_0x7e8658(0x205),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)](_0x7e8658(0x21d)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x24b)](_0x199cd0,_0x1379d3,_0x4d5c80['validatedRequest'])),_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1c8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438[_0x7e8658(0x1dd)]?.(_0x7e8658(0x1eb)+_0x4d5c80[_0x7e8658(0x1e7)]+'\x27'),_0x399e8f[_0x7e8658(0x1f7)]++;else{if(_0x4d5c80[_0x7e8658(0x1ef)]==='update'&&_0x4d5c80[_0x7e8658(0x281)]&&_0x4d5c80[_0x7e8658(0x214)])_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1b8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)](_0x7e8658(0x21c)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x264)](_0x199cd0,_0x1379d3,_0x4d5c80[_0x7e8658(0x214)]['id'],_0x4d5c80[_0x7e8658(0x281)])),_0x5c2438['onProgress']?.({'type':'activation_updated','segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438[_0x7e8658(0x1dd)]?.('Updated\x20activation\x20\x27'+_0x4d5c80['name']+'\x27'),_0x399e8f[_0x7e8658(0x252)]++;else _0x4d5c80['type']===_0x7e8658(0x1c4)&&_0x4d5c80['existingActivation']&&(_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x27b),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),await _0x5c2438[_0x7e8658(0x1bb)]('Deleting\x20activation\x20\x27'+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x1b6),()=>_0x459475[_0x7e8658(0x1fb)][_0x7e8658(0x224)](_0x199cd0,_0x1379d3,_0x4d5c80[_0x7e8658(0x214)]['id'])),_0x5c2438[_0x7e8658(0x1ae)]?.({'type':_0x7e8658(0x1f8),'segmentName':_0x401402,'activationName':_0x4d5c80[_0x7e8658(0x1e7)]}),_0x5c2438['logDeleted']?.(_0x7e8658(0x251)+_0x4d5c80[_0x7e8658(0x1e7)]+'\x27'),_0x399e8f[_0x7e8658(0x20a)]++);}}catch(_0xa1cc86){const _0x1fc165=isHttp400Error(_0xa1cc86),_0x126880=_0x1fc165?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x3df723=getErrorMessage(_0xa1cc86);throw new SDKError(_0x126880,_0x7e8658(0x273)+_0x4d5c80['type']+_0x7e8658(0x25e)+_0x4d5c80[_0x7e8658(0x1e7)]+_0x7e8658(0x286)+_0x26e7ac+_0x7e8658(0x25b)+_0x3df723,_0xa1cc86);}}return _0x399e8f;}export async function executePushFolders(_0x2a6bd7,_0x1f6d8d,_0x5663df,_0x1d1992,_0x5cce4f){const _0xb295d8=a98_0x545ff9,_0x41dc18=new Map(_0x5663df);for(const _0x3195d0 of _0x1f6d8d){const _0x369543=_0x3195d0[_0xb295d8(0x1ce)]('/'),_0x2528cd=_0x369543[_0x369543['length']-0x1],_0x5dd12f=_0x369543[_0xb295d8(0x26d)](0x0,-0x1)[_0xb295d8(0x254)]('/'),_0x30db51=_0x41dc18[_0xb295d8(0x1ad)](_0x5dd12f);_0x5cce4f['onProgress']?.({'type':'folder_creating','folder':_0x3195d0});const _0x48a8fd={'name':_0x2528cd,'parentFolderId':_0x30db51},_0x4e832b=await _0x5cce4f[_0xb295d8(0x1bb)]('Creating\x20folder\x20\x27'+_0x3195d0+_0xb295d8(0x1b6),()=>_0x2a6bd7[_0xb295d8(0x1fb)][_0xb295d8(0x216)](_0x1d1992[_0xb295d8(0x231)],_0x48a8fd));_0x41dc18['set'](_0x3195d0,_0x4e832b[_0xb295d8(0x236)]['id']),_0x5cce4f[_0xb295d8(0x1ae)]?.({'type':'folder_created','folder':_0x3195d0,'folderId':_0x4e832b[_0xb295d8(0x236)]['id']}),_0x5cce4f['logInfo']?.('Created\x20folder\x20\x27'+_0x3195d0+'\x27');}return _0x41dc18;}export async function executePushSegmentDeletions(_0x9cbdb0,_0x58f029,_0x4e08a8){const _0x4b0bc4=a98_0x545ff9;if(_0x58f029['length']===0x0)return 0x0;const {batchAsync:_0x157747}=await import(_0x4b0bc4(0x26f)),_0x1f4530=0x5,_0x17721d=await _0x157747(_0x58f029,async _0x188b01=>{const _0x2479dd=_0x4b0bc4;return _0x4e08a8['onProgress']?.({'type':_0x2479dd(0x1f9),'name':_0x188b01[_0x2479dd(0x1e7)]}),await _0x9cbdb0[_0x2479dd(0x1fb)]['deleteSegment'](_0x188b01['id']),_0x4e08a8[_0x2479dd(0x1ae)]?.({'type':_0x2479dd(0x1ec),'name':_0x188b01['name']}),_0x4e08a8[_0x2479dd(0x227)]?.(_0x2479dd(0x209)+_0x188b01[_0x2479dd(0x1e7)]+'\x27'),0x1;},_0x1f4530);return _0x17721d[_0x4b0bc4(0x1e1)]((_0x518562,_0x38df0a)=>_0x518562+_0x38df0a,0x0);}export async function executePushJourneys(_0x2e5819,_0x18c266,_0x2ca293,_0x4a700c,_0x44dd8f){const _0x362eca=a98_0x545ff9,{journeyDefToRequest:_0x1ed69b}=await import(_0x362eca(0x22c)),{activationDefToCreateRequest:_0x4e4f1f,yamlRuleToApi:_0x575318,validateSegmentRule:_0x665502}=await import(_0x362eca(0x22f)),_0x450256={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x249fb3=new Map(_0x2ca293[_0x362eca(0x1ca)]),_0x5da4e4=0x5;for(let _0x40b369=0x0;_0x40b369<_0x18c266['length'];_0x40b369+=_0x5da4e4){const _0x5aa9b6=_0x18c266[_0x362eca(0x26d)](_0x40b369,_0x40b369+_0x5da4e4),_0xfa43f3=await Promise[_0x362eca(0x1b0)](_0x5aa9b6[_0x362eca(0x1bf)](async _0x37643d=>{const _0x4c3b1f=_0x362eca;if(!_0x37643d[_0x4c3b1f(0x1e0)]&&!_0x37643d[_0x4c3b1f(0x1d4)])return{'action':'unchanged','name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)],'journeyId':_0x37643d[_0x4c3b1f(0x1ff)]?.['id']};const _0x18d52d=_0x37643d[_0x4c3b1f(0x248)]?_0x2ca293[_0x4c3b1f(0x1c7)]['get'](_0x37643d[_0x4c3b1f(0x248)]):undefined;_0x44dd8f['onProgress']?.({'type':_0x37643d[_0x4c3b1f(0x1e0)]?'journey_creating':_0x4c3b1f(0x27d),'name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]});try{const _0x4cb435=await executeSingleJourneyPush(_0x2e5819,_0x37643d,{..._0x2ca293,'segmentNameToId':_0x249fb3},{'parentId':_0x4a700c['parentId'],'rootFolderId':_0x4a700c[_0x4c3b1f(0x256)],'folderId':_0x18d52d,'verbose':_0x4a700c[_0x4c3b1f(0x1fa)]},_0x44dd8f,{'journeyDefToRequest':_0x1ed69b,'activationDefToCreateRequest':_0x4e4f1f,'yamlRuleToApi':_0x575318,'validateSegmentRule':_0x665502});for(const [_0x32225c,_0x2ddb1f]of _0x4cb435['embeddedSegmentNameToId']){_0x249fb3[_0x4c3b1f(0x22b)](_0x32225c,_0x2ddb1f),_0x450256[_0x4c3b1f(0x1db)][_0x4c3b1f(0x22b)](_0x32225c,_0x2ddb1f);}if(_0x4cb435[_0x4c3b1f(0x1ee)]===_0x4c3b1f(0x1f7))_0x44dd8f[_0x4c3b1f(0x1ae)]?.({'type':_0x4c3b1f(0x1cb),'name':_0x37643d['yamlConfig'][_0x4c3b1f(0x1e7)],'journeyId':_0x4cb435[_0x4c3b1f(0x208)]}),_0x44dd8f[_0x4c3b1f(0x1dd)]?.(_0x4c3b1f(0x1c6)+_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]+'\x27'),_0x450256[_0x4c3b1f(0x1f7)]++;else _0x4cb435[_0x4c3b1f(0x1ee)]===_0x4c3b1f(0x252)&&(_0x44dd8f[_0x4c3b1f(0x1ae)]?.({'type':'journey_updated','name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]}),_0x44dd8f[_0x4c3b1f(0x1dd)]?.(_0x4c3b1f(0x232)+_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)]+'\x27'),_0x450256['updated']++);return{'action':_0x4cb435[_0x4c3b1f(0x1ee)],'name':_0x37643d[_0x4c3b1f(0x265)][_0x4c3b1f(0x1e7)],'journeyId':_0x4cb435[_0x4c3b1f(0x208)]};}catch(_0x5f05f7){const _0x46bee0=isHttp400Error(_0x5f05f7),_0x5476fa=_0x46bee0?ErrorCode[_0x4c3b1f(0x218)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x2ab0c8=getErrorMessage(_0x5f05f7);throw new SDKError(_0x5476fa,_0x4c3b1f(0x273)+(_0x37643d[_0x4c3b1f(0x1e0)]?_0x4c3b1f(0x270):_0x4c3b1f(0x203))+_0x4c3b1f(0x262)+_0x37643d[_0x4c3b1f(0x1ed)]+_0x4c3b1f(0x25b)+_0x2ab0c8,_0x5f05f7);}}));_0x450256[_0x362eca(0x1f3)][_0x362eca(0x277)](..._0xfa43f3);}return _0x450256;}async function executeSingleJourneyPush(_0x4dc700,_0x4d803e,_0x4154f8,_0xf7b9ef,_0x12c454,_0x5d4516){const _0x50cc66=a98_0x545ff9,{journeyDefToRequest:_0x4555ff,activationDefToCreateRequest:_0x189100,yamlRuleToApi:_0xec6ccc,validateSegmentRule:_0x152641}=_0x5d4516,_0x16366c=new Map(),_0x325639=new Map(),_0x482da5=new Map(),_0x2b1d33=new Map(),_0x355ca3=new Map();let _0x1a5a97;const _0x2f5440=async()=>{const _0x3a3728=a98_0x1668;if(_0x1a5a97)return;_0x1a5a97=new Map();if(!_0x4d803e[_0x3a3728(0x1ff)])return;const _0x33c222=await _0x4dc700['journey'][_0x3a3728(0x250)](_0x4d803e[_0x3a3728(0x1ff)]['id']);for(const _0x4835a8 of _0x33c222){const _0x39d16d=journeyActivationStepToYaml(_0x4835a8,_0x4154f8[_0x3a3728(0x1e5)],_0x4154f8[_0x3a3728(0x253)]),_0x4b7936=activationSignature(_0x39d16d);!_0x1a5a97[_0x3a3728(0x1f0)](_0x4b7936)&&_0x1a5a97[_0x3a3728(0x22b)](_0x4b7936,_0x4835a8['id']),_0x39d16d[_0x3a3728(0x1e7)]&&_0x325639['set'](_0x39d16d[_0x3a3728(0x1e7)],_0x4835a8['id']);}};if(_0x4d803e[_0x50cc66(0x1ff)]&&_0x4d803e[_0x50cc66(0x265)][_0x50cc66(0x267)]){const _0x8b42f9=buildLocalExpandedRuleMappings(_0x4d803e['yamlConfig']),_0x41512b=_0x8b42f9[_0x50cc66(0x239)];if(_0x41512b['size']>0x0){const _0x5c3f52=new Map();for(const [_0x4fc331,_0x14f965]of _0x41512b){const _0x6ff573=serializeExpandedRule(_0x14f965,_0x41512b);_0x5c3f52[_0x50cc66(0x22b)](_0x4fc331,_0x6ff573);}const _0x20f501=collectSegmentIdsFromJourneyApi(_0x4d803e[_0x50cc66(0x1ff)]);if(_0x20f501['size']>0x0){const _0x393ccc=await buildServerSegmentRuleMap(_0x4dc700,_0xf7b9ef[_0x50cc66(0x231)],_0x4154f8[_0x50cc66(0x24f)],_0x20f501);if(_0x393ccc[_0x50cc66(0x1ac)]>0x0){const _0x1b68f5=new Map();for(const [_0x1bccd7,_0x460993]of _0x393ccc){const _0x1341e0=serializeExpandedRule(_0x460993,_0x393ccc);!_0x1b68f5[_0x50cc66(0x1f0)](_0x1341e0)&&_0x1b68f5[_0x50cc66(0x22b)](_0x1341e0,_0x1bccd7);}for(const [_0x4d4cef,_0x5237f8]of _0x5c3f52){const _0x1ed86a=_0x1b68f5[_0x50cc66(0x1ad)](_0x5237f8);_0x1ed86a&&(_0x355ca3[_0x50cc66(0x22b)](_0x4d4cef,_0x1ed86a),_0x4154f8['segmentNameToId'][_0x50cc66(0x22b)](_0x4d4cef,_0x1ed86a));}}}}}const _0x18743d={'resolveSegmentId':async _0x456f50=>{const _0x1a6018=_0x50cc66,_0x38635d=_0x4154f8[_0x1a6018(0x1ca)][_0x1a6018(0x1ad)](_0x456f50);if(!_0x38635d)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1a6018(0x1bc)+_0x456f50+_0x1a6018(0x1c3)+_0x4d803e[_0x1a6018(0x265)][_0x1a6018(0x1e7)]+')');return _0x38635d;},'resolveEmbeddedSegmentId':async(_0x26f94b,_0x3371a3)=>{const _0x3e641b=_0x50cc66,_0x2757f9=_0x4154f8['segmentNameToId'][_0x3e641b(0x1ad)](_0x26f94b);if(_0x2757f9)return _0x2757f9;const _0x41e09e=_0x355ca3['get'](_0x26f94b);if(_0x41e09e)return _0x4154f8[_0x3e641b(0x1ca)]['set'](_0x26f94b,_0x41e09e),_0x41e09e;const _0x13a71b=_0x4154f8[_0x3e641b(0x24f)][_0x3e641b(0x284)](_0x2c77fb=>_0x2c77fb[_0x3e641b(0x1e7)]===_0x26f94b);if(_0x13a71b)return _0x4154f8['segmentNameToId'][_0x3e641b(0x22b)](_0x26f94b,_0x13a71b['id']),_0x13a71b['id'];if(_0x4d803e[_0x3e641b(0x1e0)]){const {stageName:_0x2df014,criteriaName:_0x235e1c}=findSegmentCriteriaLocation(_0x4d803e[_0x3e641b(0x265)],_0x26f94b);return _0x152641(_0x26f94b,_0x3371a3[_0x3e641b(0x27f)]),_0x482da5[_0x3e641b(0x22b)](_0x26f94b,{'definition':_0x3371a3,'stageName':_0x2df014,'criteriaName':_0x235e1c}),createPendingSegmentId(_0x26f94b);}const _0x2af282=_0x4d803e[_0x3e641b(0x1ff)]?.['id'];if(!_0x2af282)throw new SDKError(ErrorCode[_0x3e641b(0x1b5)],_0x3e641b(0x266));_0x152641(_0x26f94b,_0x3371a3['rule']);const _0x47c6ac=generateDeterministicJourneySegmentName(_0x4d803e[_0x3e641b(0x265)][_0x3e641b(0x1e7)],_0x26f94b),_0x2cf793=_0x4154f8[_0x3e641b(0x24f)][_0x3e641b(0x284)](_0x312e9a=>_0x312e9a[_0x3e641b(0x1e7)]===_0x47c6ac),_0x110baa=createSegmentIdResolver(_0x4154f8['segmentNameToId'],_0x26f94b),_0x30e5d5=await resolveRuleSegmentIds(_0x3371a3[_0x3e641b(0x27f)],_0x110baa);let _0x1021e5;if(_0x2cf793)await _0x4dc700[_0x3e641b(0x1fb)]['updateSegmentById'](_0xf7b9ef[_0x3e641b(0x231)],_0x2cf793['id'],{'description':_0x3371a3[_0x3e641b(0x247)]||_0x3e641b(0x272)+_0x26f94b,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![]}),_0x1021e5=_0x2cf793['id'];else try{_0x1021e5=await _0x4dc700[_0x3e641b(0x1fb)][_0x3e641b(0x1e9)]({'name':_0x47c6ac,'description':_0x3371a3[_0x3e641b(0x247)]||'Entry\x20criteria:\x20'+_0x26f94b,'journeyId':_0x2af282,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![],'parentFolderId':_0xf7b9ef['rootFolderId']||'','audienceId':_0xf7b9ef[_0x3e641b(0x231)]});}catch(_0x8e882b){const _0x4f179c=_0x8e882b instanceof Error&&_0x8e882b[_0x3e641b(0x1b7)][_0x3e641b(0x22a)]('Name\x20has\x20already\x20been\x20taken');if(_0x4f179c){const _0xfd3b68=await _0x4dc700[_0x3e641b(0x1fb)][_0x3e641b(0x1d2)](_0xf7b9ef['parentId']),_0x35051c=_0xfd3b68[_0x3e641b(0x284)](_0x5be499=>_0x5be499[_0x3e641b(0x1e7)]===_0x47c6ac);if(_0x35051c)await _0x4dc700[_0x3e641b(0x1fb)]['updateSegmentById'](_0xf7b9ef[_0x3e641b(0x231)],_0x35051c['id'],{'description':_0x3371a3[_0x3e641b(0x247)]||'Entry\x20criteria:\x20'+_0x26f94b,'rule':_0xec6ccc(_0x30e5d5,!![]),'countPopulation':!![]}),_0x1021e5=_0x35051c['id'];else throw _0x8e882b;}else throw _0x8e882b;}return _0x4154f8['segmentNameToId'][_0x3e641b(0x22b)](_0x26f94b,_0x1021e5),_0x16366c['set'](_0x26f94b,_0x1021e5),_0x1021e5;},'resolveActivationId':async _0x53fe85=>{const _0x3602f4=_0x50cc66,_0x380daa=_0x325639['get'](_0x53fe85);if(_0x380daa)return _0x380daa;if(_0x4d803e[_0x3602f4(0x1ff)]){await _0x2f5440();const _0x21a89e=_0x325639[_0x3602f4(0x1ad)](_0x53fe85);if(_0x21a89e)return _0x21a89e;}throw new SDKError(ErrorCode[_0x3602f4(0x24c)],_0x3602f4(0x279)+_0x53fe85+_0x3602f4(0x1c3)+_0x4d803e[_0x3602f4(0x265)]['name']+_0x3602f4(0x23b)+_0x3602f4(0x1af));},'resolveEmbeddedActivationId':async(_0x334b10,_0x433060)=>{const _0x26040d=_0x50cc66,_0x4c5358=_0x325639[_0x26040d(0x1ad)](_0x334b10);if(_0x4c5358)return _0x4c5358;if(_0x4d803e[_0x26040d(0x1e0)])return _0x2b1d33[_0x26040d(0x22b)](_0x334b10,_0x433060),createPendingActivationId(_0x334b10);if(_0x4d803e['existingJourney']){await _0x2f5440();const _0x529ee7=_0x325639['get'](_0x433060[_0x26040d(0x1e7)]);if(_0x529ee7)return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x529ee7),_0x529ee7;const _0xbd0871=activationSignature(_0x433060),_0x22b745=_0x1a5a97?.['get'](_0xbd0871);if(_0x22b745)return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x22b745),_0x22b745;const _0x37a5c9=await _0x189100(_0x433060,_0x4154f8[_0x26040d(0x1c1)]),_0x4dd77f=await _0x4dc700[_0x26040d(0x212)]['createActivation'](_0x4d803e[_0x26040d(0x1ff)]['id'],_0x37a5c9);return _0x325639[_0x26040d(0x22b)](_0x334b10,_0x4dd77f['id']),_0x4dd77f['id'];}throw new SDKError(ErrorCode[_0x26040d(0x1b5)],_0x26040d(0x20b));},'resolveJourneyId':async _0x9b8e07=>{const _0x51c2c1=_0x50cc66;try{return await _0x4dc700[_0x51c2c1(0x212)][_0x51c2c1(0x1bd)](_0xf7b9ef[_0x51c2c1(0x231)],_0x9b8e07);}catch(_0x4651b9){throw new SDKError(ErrorCode[_0x51c2c1(0x24c)],'Journey\x20\x27'+_0x9b8e07+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x4d803e[_0x51c2c1(0x265)][_0x51c2c1(0x1e7)]+'\x27)',_0x4651b9);}},'resolveStageId':async(_0x8937dc,_0x18261f)=>{const _0x291b34=_0x50cc66,_0x3bcdf3=await _0x4dc700[_0x291b34(0x212)]['getJourney'](_0x8937dc),_0x184b9b=_0x3bcdf3[_0x291b34(0x1b4)][_0x291b34(0x1d6)]['find'](_0xee530c=>_0xee530c[_0x291b34(0x1e7)][_0x291b34(0x1fd)]()===_0x18261f['toLowerCase']());if(!_0x184b9b?.['id'])throw new SDKError(ErrorCode[_0x291b34(0x24c)],_0x291b34(0x240)+_0x18261f+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x3bcdf3['attributes'][_0x291b34(0x274)]||_0x3bcdf3['attributes']['name'])+'\x27');return _0x184b9b['id'];}},_0x19fcb9=await _0x4555ff(_0x4d803e['yamlConfig'],_0xf7b9ef[_0x50cc66(0x231)],_0x18743d),_0x485973=_0xf7b9ef[_0x50cc66(0x257)]||_0xf7b9ef[_0x50cc66(0x256)];_0x485973&&(_0x19fcb9[_0x50cc66(0x280)]={'parentFolder':{'data':{'id':_0x485973,'type':_0x50cc66(0x263)}}});if(_0x4d803e['isNew']){if(_0x482da5[_0x50cc66(0x1ac)]>0x0||_0x2b1d33['size']>0x0)return await executeThreeStepJourneyCreate(_0x4dc700,_0x4d803e,_0x19fcb9,{'pendingEmbeddedSegments':_0x482da5,'pendingEmbeddedActivations':_0x2b1d33,'embeddedSegmentNameToId':_0x16366c,'journeyActivationNameToId':_0x325639},{..._0xf7b9ef,'effectiveFolderId':_0x485973},_0x4154f8,_0x12c454,_0x5d4516);else{ensureJourneyDefaults(_0x19fcb9[_0x50cc66(0x1b4)]);const _0x28b970=await _0x4dc700[_0x50cc66(0x212)]['create'](_0x19fcb9);return{'action':_0x50cc66(0x1f7),'journeyId':_0x28b970['id'],'embeddedSegmentNameToId':_0x16366c};}}else{if(_0x4d803e[_0x50cc66(0x1d4)]&&_0x4d803e['existingJourney'])return ensureJourneyDefaults(_0x19fcb9[_0x50cc66(0x1b4)]),await _0x4dc700[_0x50cc66(0x212)][_0x50cc66(0x203)](_0x4d803e['existingJourney']['id'],_0x19fcb9),{'action':_0x50cc66(0x252),'journeyId':_0x4d803e['existingJourney']['id'],'embeddedSegmentNameToId':_0x16366c};}return{'action':_0x50cc66(0x26a),'journeyId':_0x4d803e['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x16366c};}function findSegmentCriteriaLocation(_0x3b89d9,_0x640b6c){const _0x5b8dbe=a98_0x545ff9,_0x5d0840=_0x3b89d9[_0x5b8dbe(0x1f4)]||_0x3b89d9[_0x5b8dbe(0x207)]?.[0x0]?.['stages']||[];let _0x258e77='entry',_0x4ff962=_0x640b6c;const _0x41bba4=_0x3b89d9['goal']||_0x3b89d9[_0x5b8dbe(0x207)]?.[0x0]?.[_0x5b8dbe(0x1e4)];if(_0x41bba4?.['segment']===_0x640b6c)return{'stageName':_0x5b8dbe(0x1e4),'criteriaName':_0x41bba4[_0x5b8dbe(0x1e7)]||_0x640b6c};_0x485a27:for(const _0x289101 of _0x5d0840){if(_0x289101[_0x5b8dbe(0x211)]?.[_0x5b8dbe(0x1fb)]===_0x640b6c){_0x258e77=_0x289101['name'],_0x4ff962=_0x289101['entry_criteria'][_0x5b8dbe(0x1e7)]||_0x640b6c;break;}if(_0x289101[_0x5b8dbe(0x258)])for(const _0x5dc7b0 of _0x289101[_0x5b8dbe(0x258)]){if(_0x5dc7b0['type']===_0x5b8dbe(0x1d3)&&_0x5dc7b0[_0x5b8dbe(0x288)]?.['branches'])for(const _0x1c2e25 of _0x5dc7b0['with']['branches']){if(_0x1c2e25[_0x5b8dbe(0x1fb)]===_0x640b6c){_0x258e77=_0x289101[_0x5b8dbe(0x1e7)],_0x4ff962=_0x1c2e25[_0x5b8dbe(0x1e7)]||_0x640b6c;break _0x485a27;}}}}return{'stageName':_0x258e77,'criteriaName':_0x4ff962};}async function executeThreeStepJourneyCreate(_0x2a6d9e,_0xf9109,_0x53458f,_0x2b815c,_0x494dd4,_0x853d14,_0x55c907,_0x37e882){const _0x579343=a98_0x545ff9,{activationDefToCreateRequest:_0x2c33f2,yamlRuleToApi:_0x83b3be}=_0x37e882,{pendingEmbeddedSegments:_0x4519e2,pendingEmbeddedActivations:_0x5e3711,embeddedSegmentNameToId:_0x2cacca}=_0x2b815c,_0x254034=JSON['parse'](JSON['stringify'](_0x53458f));ensureJourneyDefaults(_0x254034['attributes']),stripPendingIds(_0x254034);const _0x14e589=await _0x2a6d9e['journey']['create'](_0x254034),_0x1a484e=_0x14e589['id'],_0x5119ba=new Map();for(const _0x58bfe8 of _0x14e589[_0x579343(0x1b4)]['journeyStages']){_0x5119ba[_0x579343(0x22b)](_0x58bfe8[_0x579343(0x1e7)][_0x579343(0x1fd)](),_0x58bfe8['id']);}for(const [_0x20cc5d,{definition:_0x10ad78}]of _0x4519e2){const _0x33935b=generateDeterministicJourneySegmentName(_0xf9109[_0x579343(0x265)]['name'],_0x20cc5d);_0x55c907[_0x579343(0x1ae)]?.({'type':_0x579343(0x204),'journeyName':_0xf9109[_0x579343(0x265)]['name'],'segmentName':_0x20cc5d});const _0x532ec0=createSegmentIdResolver(_0x853d14[_0x579343(0x1ca)],_0x20cc5d),_0x349ca1=await resolveRuleSegmentIds(_0x10ad78[_0x579343(0x27f)],_0x532ec0),_0x5d2cbf=await _0x2a6d9e['segment'][_0x579343(0x1e9)]({'name':_0x33935b,'description':_0x10ad78[_0x579343(0x247)]||_0x579343(0x272)+_0x20cc5d,'journeyId':_0x1a484e,'rule':_0x83b3be(_0x349ca1,!![]),'countPopulation':!![],'parentFolderId':_0x494dd4['effectiveFolderId']||'','audienceId':_0x494dd4['parentId']});_0x2cacca[_0x579343(0x22b)](_0x20cc5d,_0x5d2cbf),_0x853d14[_0x579343(0x1ca)][_0x579343(0x22b)](_0x20cc5d,_0x5d2cbf),_0x55c907[_0x579343(0x1ae)]?.({'type':'embedded_segment_created','journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'segmentName':_0x20cc5d});}const _0x58e004=new Map();for(const [_0x4d8100,_0x243562]of _0x5e3711){_0x55c907['onProgress']?.({'type':_0x579343(0x1fe),'journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'activationName':_0x4d8100});const _0x4fe0e1=await _0x2c33f2(_0x243562,_0x853d14[_0x579343(0x1c1)]),_0x5be152=await _0x2a6d9e['journey'][_0x579343(0x24b)](_0x1a484e,_0x4fe0e1);_0x58e004[_0x579343(0x22b)](_0x4d8100,_0x5be152['id']),_0x2b815c[_0x579343(0x206)][_0x579343(0x22b)](_0x4d8100,_0x5be152['id']),_0x55c907[_0x579343(0x1ae)]?.({'type':_0x579343(0x1cd),'journeyName':_0xf9109[_0x579343(0x265)][_0x579343(0x1e7)],'activationName':_0x4d8100});}const _0x599f96=JSON[_0x579343(0x255)](JSON[_0x579343(0x1b9)](_0x53458f));return _0x599f96['id']=_0x1a484e,ensureJourneyDefaults(_0x599f96[_0x579343(0x1b4)]),resolvePendingIdsInRequest(_0x599f96,_0x53458f,_0x5119ba,_0x2cacca,_0x58e004,_0x55c907),await _0x2a6d9e['journey'][_0x579343(0x203)](_0x1a484e,_0x599f96),{'action':_0x579343(0x1f7),'journeyId':_0x1a484e,'embeddedSegmentNameToId':_0x2cacca};}function stripPendingIds(_0x43e81b){const _0x21e4b7=a98_0x545ff9;for(const _0x4a499f of _0x43e81b[_0x21e4b7(0x1b4)][_0x21e4b7(0x1d6)]||[]){_0x4a499f['entryCriteria']?.[_0x21e4b7(0x1dc)]&&isPendingSegmentId(_0x4a499f[_0x21e4b7(0x1f1)]['segmentId'])&&delete _0x4a499f[_0x21e4b7(0x1f1)];if(_0x4a499f['steps'])for(const _0x4102dd of Object[_0x21e4b7(0x228)](_0x4a499f['steps'])){const _0x2f8f9f=_0x4a499f[_0x21e4b7(0x258)][_0x4102dd];_0x2f8f9f[_0x21e4b7(0x1ef)]==='Activation'&&_0x2f8f9f[_0x21e4b7(0x222)]&&isPendingActivationId(_0x2f8f9f['journeyActivationStepId'])&&(_0x2f8f9f[_0x21e4b7(0x222)]='');if(_0x2f8f9f[_0x21e4b7(0x1ef)]===_0x21e4b7(0x1de)&&_0x2f8f9f['branches'])for(const _0x4dfce0 of _0x2f8f9f['branches']){_0x4dfce0['segmentId']&&isPendingSegmentId(_0x4dfce0[_0x21e4b7(0x1dc)])&&(_0x4dfce0[_0x21e4b7(0x1dc)]='');}_0x2f8f9f[_0x21e4b7(0x1ef)]===_0x21e4b7(0x28b)&&_0x2f8f9f['waitCondition']?.[_0x21e4b7(0x1dc)]&&isPendingSegmentId(_0x2f8f9f['waitCondition'][_0x21e4b7(0x1dc)])&&(_0x2f8f9f[_0x21e4b7(0x243)][_0x21e4b7(0x1dc)]='');}}}function resolvePendingIdsInRequest(_0x144dc5,_0xcfc61,_0x101fa9,_0x3cce76,_0x18938d,_0x40764e){const _0x314451=a98_0x545ff9,_0x437160=(_0x51dc05,_0x939822)=>{const _0x4f121a=a98_0x1668;if(!isPendingSegmentId(_0x51dc05))return _0x51dc05;const _0x2d38cc=extractPendingSegmentName(_0x51dc05),_0x17218a=_0x3cce76['get'](_0x2d38cc);return!_0x17218a&&_0x40764e['logWarning']?.(_0x4f121a(0x210)+_0x2d38cc+_0x4f121a(0x275)+_0x939822),_0x17218a;};if(_0x144dc5[_0x314451(0x1b4)]['goal']?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x144dc5[_0x314451(0x1b4)][_0x314451(0x1e4)]['segmentId'])){const _0x3e922c=_0x437160(_0x144dc5[_0x314451(0x1b4)][_0x314451(0x1e4)][_0x314451(0x1dc)],'goal\x20criteria');_0x3e922c&&(_0x144dc5[_0x314451(0x1b4)]['goal'][_0x314451(0x1dc)]=_0x3e922c);}for(const _0x570f7d of _0x144dc5[_0x314451(0x1b4)]['journeyStages']||[]){const _0x13325c=_0x101fa9[_0x314451(0x1ad)](_0x570f7d[_0x314451(0x1e7)][_0x314451(0x1fd)]());_0x13325c&&(_0x570f7d['id']=_0x13325c);if(_0x570f7d[_0x314451(0x1f1)]?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x570f7d['entryCriteria'][_0x314451(0x1dc)])){const _0x9940d7=_0x437160(_0x570f7d['entryCriteria']['segmentId'],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x20f));_0x9940d7&&(_0x570f7d[_0x314451(0x1f1)][_0x314451(0x1dc)]=_0x9940d7);}if(_0x570f7d[_0x314451(0x21e)])for(const _0x32d488 of _0x570f7d[_0x314451(0x21e)]){if(_0x32d488[_0x314451(0x1dc)]&&isPendingSegmentId(_0x32d488[_0x314451(0x1dc)])){const _0xa29267=_0x437160(_0x32d488[_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d['name']+_0x314451(0x259));_0xa29267&&(_0x32d488['segmentId']=_0xa29267);}}if(_0x570f7d['milestone']?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x570f7d[_0x314451(0x23f)]['segmentId'])){const _0x4fa705=_0x437160(_0x570f7d['milestone'][_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x1ab));_0x4fa705&&(_0x570f7d[_0x314451(0x23f)][_0x314451(0x1dc)]=_0x4fa705);}if(_0x570f7d[_0x314451(0x258)]){const _0x2e82b6=_0x304c7f=>_0xcfc61[_0x314451(0x1b4)][_0x314451(0x1d6)][_0x314451(0x284)](_0x464ada=>_0x464ada[_0x314451(0x1e7)][_0x314451(0x1fd)]()===_0x570f7d[_0x314451(0x1e7)]['toLowerCase']())?.[_0x314451(0x258)]?.[_0x304c7f];for(const _0x4b273b of Object[_0x314451(0x228)](_0x570f7d['steps'])){const _0x3f79ac=_0x570f7d['steps'][_0x4b273b],_0x5494ff=_0x2e82b6(_0x4b273b);if(_0x3f79ac['type']===_0x314451(0x1fc)&&_0x3f79ac[_0x314451(0x222)]&&(isPendingActivationId(_0x3f79ac[_0x314451(0x222)])||_0x3f79ac[_0x314451(0x222)]==='')){if(_0x5494ff?.['journeyActivationStepId']&&isPendingActivationId(_0x5494ff['journeyActivationStepId'])){const _0x5e16ec=extractPendingActivationName(_0x5494ff[_0x314451(0x222)]),_0xb33432=_0x18938d[_0x314451(0x1ad)](_0x5e16ec);_0xb33432&&(_0x3f79ac[_0x314451(0x222)]=_0xb33432);}}if(_0x3f79ac[_0x314451(0x1ef)]===_0x314451(0x1de)&&_0x3f79ac[_0x314451(0x283)]&&_0x5494ff?.[_0x314451(0x283)])for(let _0x95f5d5=0x0;_0x95f5d5<_0x3f79ac[_0x314451(0x283)][_0x314451(0x226)];_0x95f5d5++){const _0x230a89=_0x3f79ac[_0x314451(0x283)][_0x95f5d5],_0x3c6506=_0x5494ff[_0x314451(0x283)][_0x95f5d5];if(_0x3c6506?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x3c6506[_0x314451(0x1dc)])){const _0x2524b2=_0x437160(_0x3c6506[_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x26c)+(_0x230a89['name']||_0x95f5d5)+'\x27');_0x2524b2&&(_0x230a89[_0x314451(0x1dc)]=_0x2524b2);}}if(_0x3f79ac[_0x314451(0x1ef)]===_0x314451(0x28b)&&_0x3f79ac[_0x314451(0x243)]?.[_0x314451(0x1dc)]&&_0x5494ff?.[_0x314451(0x243)]?.[_0x314451(0x1dc)]&&isPendingSegmentId(_0x5494ff[_0x314451(0x243)][_0x314451(0x1dc)])){const _0x189833=_0x437160(_0x5494ff[_0x314451(0x243)][_0x314451(0x1dc)],_0x314451(0x1d7)+_0x570f7d[_0x314451(0x1e7)]+_0x314451(0x23a));_0x189833&&(_0x3f79ac[_0x314451(0x243)]['segmentId']=_0x189833);}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a99_0x28fb(){const _0x2d2ca5=['has','5146839HaNcdJ','2729065LgkQAQ','set','parentFolderId','get','1300520QQICym','8996160EfFkyz','756ETTtQD','name','10199wTxNGc','2658759jxvANV','30oVkzjc','6eLTFeE','87719mnCkwt','add'];a99_0x28fb=function(){return _0x2d2ca5;};return a99_0x28fb();}(function(_0x188d0a,_0x34f667){const _0x265349=a99_0x2533,_0x26d911=_0x188d0a();while(!![]){try{const _0x4d6bb1=parseInt(_0x265349(0x98))/0x1*(parseInt(_0x265349(0x97))/0x2)+parseInt(_0x265349(0x95))/0x3+-parseInt(_0x265349(0xa0))/0x4+parseInt(_0x265349(0x9c))/0x5+parseInt(_0x265349(0x92))/0x6*(-parseInt(_0x265349(0x94))/0x7)+parseInt(_0x265349(0xa1))/0x8+-parseInt(_0x265349(0x9b))/0x9*(parseInt(_0x265349(0x96))/0xa);if(_0x4d6bb1===_0x34f667)break;else _0x26d911['push'](_0x26d911['shift']());}catch(_0x4ff742){_0x26d911['push'](_0x26d911['shift']());}}}(a99_0x28fb,0x915da));function a99_0x2533(_0x452039,_0x4a6c5b){_0x452039=_0x452039-0x92;const _0x28fbc7=a99_0x28fb();let _0x2533ca=_0x28fbc7[_0x452039];return _0x2533ca;}export function buildFolderIdToPathMap(_0x2a4564){const _0x371847=a99_0x2533,_0x312c85=new Map(),_0x4ebbca=new Map();for(const _0x420501 of _0x2a4564){_0x4ebbca[_0x371847(0x9d)](_0x420501['id'],_0x420501);}const _0x5b9dbc=new Set();for(const _0x59f0ac of _0x2a4564){!_0x59f0ac['parentFolderId']&&_0x5b9dbc['add'](_0x59f0ac['id']);}function _0x4f5721(_0x2a15a3){const _0x134f99=_0x371847;if(_0x312c85[_0x134f99(0x9a)](_0x2a15a3['id']))return _0x312c85[_0x134f99(0x9f)](_0x2a15a3['id']);if(_0x5b9dbc[_0x134f99(0x9a)](_0x2a15a3['id']))return _0x312c85[_0x134f99(0x9d)](_0x2a15a3['id'],''),'';if(_0x2a15a3['parentFolderId']){const _0x1f1461=_0x4ebbca[_0x134f99(0x9f)](_0x2a15a3[_0x134f99(0x9e)]);if(_0x1f1461){const _0x476fce=_0x4f5721(_0x1f1461),_0x15fbf6=_0x476fce?_0x476fce+'/'+_0x2a15a3['name']:_0x2a15a3[_0x134f99(0x93)];return _0x312c85[_0x134f99(0x9d)](_0x2a15a3['id'],_0x15fbf6),_0x15fbf6;}}const _0x38f9a6=_0x2a15a3[_0x134f99(0x93)];return _0x312c85[_0x134f99(0x9d)](_0x2a15a3['id'],_0x38f9a6),_0x38f9a6;}for(const _0x5ace50 of _0x2a4564){_0x4f5721(_0x5ace50);}return _0x312c85;}export function buildFolderPathToIdMap(_0x1768aa){const _0x4d7664=a99_0x2533,_0x9a24b0=new Map(),_0x13c647=new Map();for(const _0x7ea310 of _0x1768aa){_0x13c647[_0x4d7664(0x9d)](_0x7ea310['id'],_0x7ea310);}const _0x1061ea=new Set();for(const _0x3fc49b of _0x1768aa){!_0x3fc49b['parentFolderId']&&_0x1061ea[_0x4d7664(0x99)](_0x3fc49b['id']);}function _0x42e876(_0x447af5){const _0x4d0055=_0x4d7664;if(_0x1061ea[_0x4d0055(0x9a)](_0x447af5['id']))return'';if(_0x447af5[_0x4d0055(0x9e)]){const _0x49ef85=_0x13c647['get'](_0x447af5[_0x4d0055(0x9e)]);if(_0x49ef85){const _0x3eb2f7=_0x42e876(_0x49ef85);return _0x3eb2f7?_0x3eb2f7+'/'+_0x447af5[_0x4d0055(0x93)]:_0x447af5[_0x4d0055(0x93)];}}return _0x447af5[_0x4d0055(0x93)];}for(const _0x2f59ad of _0x1768aa){const _0x469763=_0x42e876(_0x2f59ad);_0x9a24b0[_0x4d7664(0x9d)](_0x469763,_0x2f59ad['id']);}return _0x9a24b0;}export function buildFolderMaps(_0x2a7699){const _0x1c8791=a99_0x2533,_0x4cac96=buildFolderIdToPathMap(_0x2a7699),_0x299d26=new Map();for(const [_0x3b1e66,_0x1d218b]of _0x4cac96){_0x299d26[_0x1c8791(0x9d)](_0x1d218b,_0x3b1e66);}return{'idToPath':_0x4cac96,'pathToId':_0x299d26};}export function getFolderPath(_0x107378,_0x16c1bb){const _0x4465eb=a99_0x2533;if(!_0x107378)return'';return _0x16c1bb[_0x4465eb(0x9f)](_0x107378)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xebc0ea,_0x2069c2){const _0x1a41c8=a100_0x3484,_0x17defd=_0xebc0ea();while(!![]){try{const _0x277e4a=parseInt(_0x1a41c8(0x16c))/0x1*(parseInt(_0x1a41c8(0x156))/0x2)+parseInt(_0x1a41c8(0x16e))/0x3+-parseInt(_0x1a41c8(0x15f))/0x4+parseInt(_0x1a41c8(0x150))/0x5*(parseInt(_0x1a41c8(0x15a))/0x6)+parseInt(_0x1a41c8(0x175))/0x7+parseInt(_0x1a41c8(0x154))/0x8*(parseInt(_0x1a41c8(0x15b))/0x9)+-parseInt(_0x1a41c8(0x153))/0xa;if(_0x277e4a===_0x2069c2)break;else _0x17defd['push'](_0x17defd['shift']());}catch(_0x1b90d8){_0x17defd['push'](_0x17defd['shift']());}}}(a100_0x234e,0x996f5));import a100_0x243d01 from'path';import{parse as a100_0x2a554a}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x55b482){const _0x473cd8=a100_0x3484;if(!_0x55b482||_0x55b482[_0x473cd8(0x165)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x2d4905=_0x55b482[_0x473cd8(0x165)]();if(_0x2d4905==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x55b482};const _0x4c6ca0=_0x2d4905['startsWith']('/')?_0x2d4905['substring'](0x1):_0x2d4905,_0x35793a=_0x4c6ca0[_0x473cd8(0x151)]('/')[_0x473cd8(0x171)](_0x3068e5=>_0x3068e5!=='');if(_0x35793a[_0x473cd8(0x164)]===0x0)throw new Error(_0x473cd8(0x167));const _0x3929e8=_0x2d4905[_0x473cd8(0x157)]('/')||!isRelativePathSegment(_0x35793a[0x0]);for(const _0xc0157c of _0x35793a){validatePathSegment(_0xc0157c);}return{'segments':_0x35793a,'isAbsolute':_0x3929e8,'raw':_0x55b482};}function isRelativePathSegment(_0x36782){return _0x36782==='.'||_0x36782==='..';}function validatePathSegment(_0x451d91){const _0x1f21f8=a100_0x3484;if(_0x451d91==='')throw new Error(_0x1f21f8(0x174));if(_0x451d91==='.'||_0x451d91==='..')return;if(/[\x00-\x1F\x7F]/[_0x1f21f8(0x166)](_0x451d91))throw new Error(_0x1f21f8(0x162)+_0x451d91);if(_0x451d91!==_0x451d91[_0x1f21f8(0x165)]()){}}export function validatePath(_0x151f4f){const _0x479124=a100_0x3484;if(_0x151f4f[_0x479124(0x163)][_0x479124(0x164)]===0x0&&!_0x151f4f['isAbsolute'])throw new Error(_0x479124(0x15d));if(_0x151f4f['isAbsolute']){if(_0x151f4f['segments'][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x50e7d6=0x0;for(const _0x14a0db of _0x151f4f[_0x479124(0x163)]){if(_0x14a0db==='..'){if(_0x50e7d6===0x0)throw new Error('Path\x20attempts\x20to\x20navigate\x20above\x20root');_0x50e7d6--;}else _0x14a0db!=='.'&&_0x50e7d6++;}}}export function joinPaths(_0x3a7176,_0x4a965b){const _0x536bb9=a100_0x3484;if(!_0x3a7176||_0x3a7176==='/')return _0x4a965b;if(!_0x4a965b||_0x4a965b==='.')return _0x3a7176;if(_0x4a965b[_0x536bb9(0x157)]('/'))return _0x4a965b;const _0x2cdf6f=parsePath(_0x3a7176),_0x458475=parsePath(_0x4a965b),_0x5b659f=[..._0x2cdf6f[_0x536bb9(0x163)]];for(const _0x102d1b of _0x458475[_0x536bb9(0x163)]){if(_0x102d1b==='.')continue;else{if(_0x102d1b==='..'){if(_0x5b659f[_0x536bb9(0x164)]===0x0)throw new Error(_0x536bb9(0x15c));_0x5b659f['pop']();}else _0x5b659f[_0x536bb9(0x16b)](_0x102d1b);}}const _0x1c9191=_0x5b659f[_0x536bb9(0x179)]('/');return _0x2cdf6f[_0x536bb9(0x176)][_0x536bb9(0x157)]('/')?'/'+_0x1c9191:_0x1c9191;}export function normalizePath(_0x4d7a8a){const _0x3c2b8d=a100_0x3484,_0x34c7b9=parsePath(_0x4d7a8a),_0x423787=[];for(const _0x3dd2ac of _0x34c7b9[_0x3c2b8d(0x163)]){if(_0x3dd2ac==='.')continue;else{if(_0x3dd2ac==='..'){if(_0x423787[_0x3c2b8d(0x164)]===0x0){if(_0x34c7b9[_0x3c2b8d(0x161)])throw new Error(_0x3c2b8d(0x15c));_0x423787[_0x3c2b8d(0x16b)]('..');}else _0x423787[_0x423787[_0x3c2b8d(0x164)]-0x1]==='..'?_0x423787[_0x3c2b8d(0x16b)]('..'):_0x423787['pop']();}else _0x423787[_0x3c2b8d(0x16b)](_0x3dd2ac);}}if(_0x423787['length']===0x0)return _0x34c7b9[_0x3c2b8d(0x161)]?'/':'.';const _0x284dc3=_0x423787[_0x3c2b8d(0x179)]('/');return _0x34c7b9['raw'][_0x3c2b8d(0x157)]('/')?'/'+_0x284dc3:_0x284dc3;}export function getParentPath(_0x9e8715){const _0x5e5242=a100_0x3484,_0xb3a3c=parsePath(_0x9e8715);if(_0xb3a3c[_0x5e5242(0x163)]['length']<=0x1)return'/';const _0x5c7d6f=_0xb3a3c['segments']['slice'](0x0,-0x1)[_0x5e5242(0x179)]('/');return _0xb3a3c[_0x5e5242(0x176)]['startsWith']('/')?'/'+_0x5c7d6f:_0x5c7d6f;}export function getBaseName(_0x1e00d9){const _0x877bc0=a100_0x3484,_0x4be63d=parsePath(_0x1e00d9);return _0x4be63d[_0x877bc0(0x163)][_0x4be63d[_0x877bc0(0x163)][_0x877bc0(0x164)]-0x1]||'';}export function isChildPath(_0x1ee773,_0x2196ca){const _0x294e5a=a100_0x3484,_0x2809e5=parsePath(_0x1ee773),_0x5d9b8e=parsePath(_0x2196ca);if(_0x2809e5[_0x294e5a(0x163)]['length']<=_0x5d9b8e['segments'][_0x294e5a(0x164)])return![];for(let _0x3d728b=0x0;_0x3d728b<_0x5d9b8e[_0x294e5a(0x163)][_0x294e5a(0x164)];_0x3d728b++){if(_0x2809e5[_0x294e5a(0x163)][_0x3d728b]!==_0x5d9b8e[_0x294e5a(0x163)][_0x3d728b])return![];}return!![];}export function splitPath(_0x129890){const _0x4430a3=a100_0x3484,_0x5664e4=parsePath(_0x129890);if(_0x5664e4['segments'][_0x4430a3(0x164)]===0x0)throw new Error(_0x4430a3(0x16d));if(_0x5664e4[_0x4430a3(0x163)][_0x4430a3(0x164)]===0x1)return{'parent':_0x5664e4[_0x4430a3(0x163)][0x0]};return{'parent':_0x5664e4['segments'][0x0],'child':_0x5664e4[_0x4430a3(0x163)][_0x4430a3(0x160)](0x1)['join']('/')};}export function isYamlFilePath(_0x54e5dc){const _0x145bc0=a100_0x3484;return _0x54e5dc[_0x145bc0(0x177)](_0x145bc0(0x168))||_0x54e5dc[_0x145bc0(0x177)](_0x145bc0(0x14e));}function a100_0x3484(_0x57a03c,_0x15b505){_0x57a03c=_0x57a03c-0x14e;const _0x234e1d=a100_0x234e();let _0x348404=_0x234e1d[_0x57a03c];return _0x348404;}export async function resolveYamlFilePath(_0x17a05a,_0x4ad1a3=nodeFileSystem){const _0x50b455=a100_0x3484,_0x570863=a100_0x243d01[_0x50b455(0x172)](_0x17a05a);if(!await _0x4ad1a3[_0x50b455(0x169)](_0x570863))throw new Error(_0x50b455(0x17a)+_0x17a05a);let _0x23c962=a100_0x243d01['dirname'](_0x570863),_0x354da7=null,_0x58d914=null;const _0x2bd5f7=a100_0x243d01[_0x50b455(0x16f)](_0x23c962)['root'];while(_0x23c962!==_0x2bd5f7){const _0x4cae2f=a100_0x243d01[_0x50b455(0x179)](_0x23c962,_0x50b455(0x16a));if(await _0x4ad1a3[_0x50b455(0x169)](_0x4cae2f)){_0x354da7=_0x4cae2f,_0x58d914=_0x23c962;break;}_0x23c962=a100_0x243d01['dirname'](_0x23c962);}if(!_0x354da7||!_0x58d914)throw new Error(_0x50b455(0x155)+_0x17a05a);const _0x2b6eff=await _0x4ad1a3[_0x50b455(0x159)](_0x354da7),_0x1ba647=JSON[_0x50b455(0x16f)](_0x2b6eff),_0x68a374=_0x1ba647[_0x50b455(0x17d)];if(!_0x68a374)throw new Error(_0x50b455(0x170));const _0x576086=await _0x4ad1a3[_0x50b455(0x159)](_0x570863),_0x11a92c=a100_0x2a554a(_0x576086),_0x95e1f5=_0x11a92c[_0x50b455(0x17b)];if(!_0x95e1f5)throw new Error(_0x50b455(0x158)+_0x17a05a);const _0x490e15=_0x11a92c[_0x50b455(0x15e)]===_0x50b455(0x152)?_0x50b455(0x152):_0x50b455(0x14f),_0x587da6=a100_0x243d01[_0x50b455(0x17c)](_0x58d914,_0x570863),_0x39ca8f=a100_0x243d01[_0x50b455(0x173)](_0x587da6),_0x342851=_0x39ca8f==='.'?'':_0x39ca8f[_0x50b455(0x178)](/\\/g,'/'),_0x13772e=_0x342851?_0x68a374+'/'+_0x342851+'/'+_0x95e1f5:_0x68a374+'/'+_0x95e1f5;return{'parentSegment':_0x68a374,'segmentName':_0x95e1f5,'folderPath':_0x342851,'fullPath':_0x13772e,'resourceType':_0x490e15};}function a100_0x234e(){const _0x32c2c4=['parse','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','filter','resolve','dirname','Path\x20segment\x20cannot\x20be\x20empty','8183021JDPPhL','raw','endsWith','replace','join','File\x20not\x20found:\x20','name','relative','parent_segment','.yaml','segment','25CVPMWV','split','journey','24497920wldPQI','8OOPymR','No\x20tdx.json\x20found\x20for\x20file:\x20','1385558fRWlwl','startsWith','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','readFile','261930IwdxAJ','1766511xfGjNB','Cannot\x20navigate\x20above\x20root','Relative\x20path\x20cannot\x20be\x20empty','type','790772HWfPuA','slice','isAbsolute','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','segments','length','trim','test','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','.yml','exists','tdx.json','push','1YxsgEA','Cannot\x20split\x20empty\x20path','2998854mKmMDf'];a100_0x234e=function(){return _0x32c2c4;};return a100_0x234e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x19666c,_0x3947ac){const _0x105b2a=a101_0x3989,_0x518892=_0x19666c();while(!![]){try{const _0x31d7a4=parseInt(_0x105b2a(0xb2))/0x1+parseInt(_0x105b2a(0xb4))/0x2*(-parseInt(_0x105b2a(0xa9))/0x3)+-parseInt(_0x105b2a(0xab))/0x4*(parseInt(_0x105b2a(0xb3))/0x5)+parseInt(_0x105b2a(0xb0))/0x6+parseInt(_0x105b2a(0xae))/0x7*(-parseInt(_0x105b2a(0xad))/0x8)+parseInt(_0x105b2a(0xa8))/0x9+parseInt(_0x105b2a(0xb1))/0xa;if(_0x31d7a4===_0x3947ac)break;else _0x518892['push'](_0x518892['shift']());}catch(_0x43cfa6){_0x518892['push'](_0x518892['shift']());}}}(a101_0x487f,0x53256));function a101_0x3989(_0x211d63,_0x39e1a0){_0x211d63=_0x211d63-0xa8;const _0x487f79=a101_0x487f();let _0x39896d=_0x487f79[_0x211d63];return _0x39896d;}function a101_0x487f(){const _0x2cdd23=['substring','3257718WvFpye','3780790TOEXZX','213409mCrVau','5eObLaU','14216EZuPmN','472464ZYAhvO','192bLnpJj','Invalid\x20segment\x20reference\x20format:\x20','724252KWhkTv','.\x20Parent\x20name\x20cannot\x20be\x20empty','3152xCUPyA','3738XacFUI'];a101_0x487f=function(){return _0x2cdd23;};return a101_0x487f();}export function parseSegmentRef(_0x1d8d0a){const _0x5139e2=a101_0x3989,_0x2b1cae=_0x1d8d0a['indexOf']('/');if(_0x2b1cae===-0x1)return{'parentId':_0x1d8d0a};if(_0x2b1cae===0x0)throw new Error(_0x5139e2(0xaa)+_0x1d8d0a+_0x5139e2(0xac));const _0x3d7614=_0x1d8d0a['substring'](0x0,_0x2b1cae),_0x11f6f1=_0x1d8d0a[_0x5139e2(0xaf)](_0x2b1cae+0x1);if(_0x11f6f1==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1d8d0a+'.\x20Child\x20name\x20cannot\x20be\x20empty');return{'parentId':_0x3d7614,'childId':_0x11f6f1};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b41ee,_0x421134){const _0x187e21=a102_0x39d4,_0x33db0e=_0x4b41ee();while(!![]){try{const _0x171a3f=parseInt(_0x187e21(0x12c))/0x1+-parseInt(_0x187e21(0x108))/0x2+parseInt(_0x187e21(0xfc))/0x3+parseInt(_0x187e21(0x11a))/0x4+-parseInt(_0x187e21(0x10a))/0x5*(-parseInt(_0x187e21(0x124))/0x6)+parseInt(_0x187e21(0x109))/0x7*(parseInt(_0x187e21(0x11e))/0x8)+parseInt(_0x187e21(0x10e))/0x9*(-parseInt(_0x187e21(0x129))/0xa);if(_0x171a3f===_0x421134)break;else _0x33db0e['push'](_0x33db0e['shift']());}catch(_0x3188ad){_0x33db0e['push'](_0x33db0e['shift']());}}}(a102_0x3d92,0x5ac54));function a102_0x3d92(){const _0x471a05=['no_parent','546968scufDL','isDirectory','type','segmentName','match','Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27','183102zooMqH','resolve','scopedFolderPath','tdx.json','parse','2920OguFVp','root','exists','463521awxTkf','startsWith','readFile','File\x20not\x20found:\x20','parent_name','basename','1915341wJQiIJ','stat','No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','resourceType','file','dirname','no_config','includes','isScoped','error','trim','invalid_yaml','345858VEEuyG','14vFkjgs','120MfAbEN','parentSegment','configDir','extname','62649UeYAAx','relative','file_not_found','join','journey','message','context','Not\x20a\x20YAML\x20file:\x20','parent_segment','cwd','replace','isFile','2424876IKQQEl','No\x20tdx.json\x20found','folderPath'];a102_0x3d92=function(){return _0x471a05;};return a102_0x3d92();}import a102_0x2befb8 from'path';function a102_0x39d4(_0x352205,_0x1b7d02){_0x352205=_0x352205-0xfb;const _0x3d9214=a102_0x3d92();let _0x39d49a=_0x3d9214[_0x352205];return _0x39d49a;}import{sanitizeFileName}from'../../utils/string-utils.js';import{nodeFileSystem}from'../io/node-filesystem.js';import{isYamlFilePath,resolveYamlFilePath}from'./segment-path-parser.js';import{getSegmentRootDir}from'./tdx-config.js';export function isSuccessfulResolution(_0x188db8){const _0x3580f4=a102_0x39d4;return _0x188db8[_0x3580f4(0x120)]!=='error';}export function isScopedResolution(_0x14ccb5){const _0x5665c1=a102_0x39d4;return _0x14ccb5[_0x5665c1(0x120)]==='directory'||_0x14ccb5['type']===_0x5665c1(0x100)||_0x14ccb5[_0x5665c1(0x120)]===_0x5665c1(0x114);}export function getScopedDetails(_0x483bb4){const _0x36639f=a102_0x39d4;if(isScopedResolution(_0x483bb4))return{'isScoped':_0x483bb4['isScoped'],'scopedFolderPath':_0x483bb4[_0x36639f(0x126)]};return undefined;}async function findTdxConfigAsync(_0x29660c,_0x484b76){const _0x164806=a102_0x39d4;let _0x4331c4=a102_0x2befb8[_0x164806(0x125)](_0x29660c);const _0x664bc9=a102_0x2befb8['parse'](_0x4331c4)[_0x164806(0x12a)];while(_0x4331c4!==_0x664bc9){const _0x5bfad5=a102_0x2befb8[_0x164806(0x111)](_0x4331c4,_0x164806(0x127));if(await _0x484b76[_0x164806(0x12b)](_0x5bfad5))try{const _0x5563a2=await _0x484b76[_0x164806(0x12e)](_0x5bfad5),_0x39d1c1=JSON[_0x164806(0x128)](_0x5563a2);if(_0x39d1c1[_0x164806(0x116)]&&typeof _0x39d1c1['parent_segment']==='string')return{'configPath':_0x5bfad5,'configDir':_0x4331c4,'parentSegment':_0x39d1c1['parent_segment']};}catch{}_0x4331c4=a102_0x2befb8[_0x164806(0x101)](_0x4331c4);}return null;}function calculateScopedPath(_0x46f726,_0x4ecee0){const _0x212571=a102_0x39d4,_0x57b654=a102_0x2befb8[_0x212571(0x10f)](_0x4ecee0,_0x46f726),_0x4029a2=_0x57b654!==''&&_0x57b654!=='.'&&!_0x57b654[_0x212571(0x12d)]('..');return{'isScoped':_0x4029a2,'scopedFolderPath':_0x4029a2?_0x57b654[_0x212571(0x118)](/\\/g,'/'):''};}export async function resolveTarget(_0x4ecce1){const _0x24bb6b=a102_0x39d4,{arg:_0x215fd8,contextParent:_0x4ffb65,cwd:cwd=process[_0x24bb6b(0x117)](),fs:fs=nodeFileSystem}=_0x4ecce1;if(_0x215fd8&&isYamlFilePath(_0x215fd8))try{const _0x199255=await resolveYamlFilePath(_0x215fd8,fs),_0x5d7d05=a102_0x2befb8[_0x24bb6b(0x125)](_0x215fd8),_0x598f80=a102_0x2befb8[_0x24bb6b(0x101)](_0x5d7d05),_0x540d9b=await findTdxConfigAsync(_0x598f80,fs);if(!_0x540d9b){if(_0x4ffb65){const _0x44c9bb=a102_0x2befb8[_0x24bb6b(0x101)](_0x5d7d05);return{'type':_0x24bb6b(0x100),'parentName':_0x4ffb65,'targetDir':_0x44c9bb,'configRoot':_0x44c9bb,'filePath':_0x5d7d05,'resourceName':_0x199255[_0x24bb6b(0x121)],'folderPath':_0x199255[_0x24bb6b(0x11c)],'resourceType':_0x199255[_0x24bb6b(0xff)],'isScoped':![],'scopedFolderPath':''};}return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x102),'message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x215fd8,'arg':_0x215fd8,'helpText':_0x24bb6b(0x123)};}const _0x35f42f=calculateScopedPath(_0x598f80,_0x540d9b[_0x24bb6b(0x10c)]);return{'type':_0x24bb6b(0x100),'parentName':_0x540d9b[_0x24bb6b(0x10b)],'targetDir':_0x540d9b[_0x24bb6b(0x10c)],'configRoot':_0x540d9b[_0x24bb6b(0x10c)],'filePath':_0x5d7d05,'resourceName':_0x199255['segmentName'],'folderPath':_0x199255[_0x24bb6b(0x11c)],'resourceType':_0x199255[_0x24bb6b(0xff)],'isScoped':_0x35f42f[_0x24bb6b(0x104)],'scopedFolderPath':_0x35f42f[_0x24bb6b(0x126)]};}catch(_0x144b24){const _0x1c3486=_0x144b24 instanceof Error?_0x144b24[_0x24bb6b(0x113)]:String(_0x144b24);if(_0x1c3486[_0x24bb6b(0x103)]('File\x20not\x20found'))return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x110),'message':_0x24bb6b(0x12f)+_0x215fd8,'arg':_0x215fd8};if(_0x1c3486[_0x24bb6b(0x103)](_0x24bb6b(0x11b))){if(_0x4ffb65){const _0x211b34=a102_0x2befb8['resolve'](_0x215fd8);if(await fs[_0x24bb6b(0x12b)](_0x211b34)){const _0x3ea49c=a102_0x2befb8['dirname'](_0x211b34),_0x5190b4=await fs[_0x24bb6b(0x12e)](_0x211b34),_0x22251d=_0x5190b4['match'](/^name:\s*["']?([^"'\n]+)["']?/m),_0x1d6355=_0x5190b4[_0x24bb6b(0x122)](/^type:\s*["']?([^"'\n]+)["']?/m),_0x36d83d=_0x22251d?_0x22251d[0x1][_0x24bb6b(0x106)]():a102_0x2befb8[_0x24bb6b(0xfb)](_0x215fd8,a102_0x2befb8[_0x24bb6b(0x10d)](_0x215fd8)),_0x20cf7a=_0x1d6355&&_0x1d6355[0x1][_0x24bb6b(0x106)]()===_0x24bb6b(0x112)?'journey':'segment';return{'type':'file','parentName':_0x4ffb65,'targetDir':_0x3ea49c,'configRoot':_0x3ea49c,'filePath':_0x211b34,'resourceName':_0x36d83d,'folderPath':'','resourceType':_0x20cf7a,'isScoped':![],'scopedFolderPath':''};}}return{'type':_0x24bb6b(0x105),'errorCode':'no_config','message':'No\x20tdx.json\x20found\x20for\x20file:\x20'+_0x215fd8,'arg':_0x215fd8,'helpText':_0x24bb6b(0x123)};}return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x107),'message':_0x1c3486,'arg':_0x215fd8};}if(_0x215fd8){const _0x10e210=a102_0x2befb8[_0x24bb6b(0x125)](cwd,_0x215fd8);let _0x639f22=null;try{_0x639f22=await fs[_0x24bb6b(0xfd)](_0x10e210);}catch{}if(_0x639f22?.[_0x24bb6b(0x11f)]()){const _0x3d8ab6=await findTdxConfigAsync(_0x10e210,fs);if(_0x3d8ab6){const _0x3385fc=calculateScopedPath(_0x10e210,_0x3d8ab6[_0x24bb6b(0x10c)]);return{'type':'directory','parentName':_0x3d8ab6['parentSegment'],'targetDir':_0x10e210,'configRoot':_0x3d8ab6['configDir'],'isScoped':_0x3385fc[_0x24bb6b(0x104)],'scopedFolderPath':_0x3385fc['scopedFolderPath']};}if(_0x4ffb65)return{'type':'directory','parentName':_0x4ffb65,'targetDir':_0x10e210,'configRoot':_0x10e210,'isScoped':![],'scopedFolderPath':''};return{'type':'error','errorCode':_0x24bb6b(0x102),'message':_0x24bb6b(0xfe)+_0x215fd8,'arg':_0x215fd8,'helpText':'Tip:\x20Run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure\x0a\x20\x20Or\x20set\x20context:\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27'};}if(_0x639f22?.[_0x24bb6b(0x119)]())return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x107),'message':_0x24bb6b(0x115)+_0x215fd8,'arg':_0x215fd8,'helpText':'Segment\x20and\x20journey\x20files\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension'};const _0x5b5a18=sanitizeFileName(_0x215fd8),_0x1cb2fa=getSegmentRootDir(_0x5b5a18,cwd);return{'type':_0x24bb6b(0x130),'parentName':_0x215fd8,'targetDir':_0x1cb2fa,'configRoot':_0x1cb2fa};}const _0x5cce53=await findTdxConfigAsync(cwd,fs);if(_0x5cce53){const _0x5a039b=calculateScopedPath(cwd,_0x5cce53[_0x24bb6b(0x10c)]);return{'type':'context','parentName':_0x5cce53[_0x24bb6b(0x10b)],'targetDir':cwd,'configRoot':_0x5cce53[_0x24bb6b(0x10c)],'isScoped':_0x5a039b[_0x24bb6b(0x104)],'scopedFolderPath':_0x5a039b[_0x24bb6b(0x126)]};}if(_0x4ffb65){const _0x1c44ea=sanitizeFileName(_0x4ffb65),_0x23b2cd=getSegmentRootDir(_0x1c44ea,cwd);return{'type':_0x24bb6b(0x114),'parentName':_0x4ffb65,'targetDir':_0x23b2cd,'configRoot':_0x23b2cd,'isScoped':![],'scopedFolderPath':''};}return{'type':_0x24bb6b(0x105),'errorCode':_0x24bb6b(0x11d),'message':'Parent\x20segment\x20not\x20specified','helpText':'Use\x20\x27tdx\x20sg\x20use\x20<parent_name>\x27\x20to\x20set\x20context\x0aOr\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_name>\x27\x20to\x20create\x20the\x20folder\x20structure'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a103_0x3ca6f5=a103_0x20b1;(function(_0x35ffaf,_0x1ea934){const _0x3ead4e=a103_0x20b1,_0x4b7572=_0x35ffaf();while(!![]){try{const _0x4ccb37=-parseInt(_0x3ead4e(0xee))/0x1+parseInt(_0x3ead4e(0xef))/0x2+parseInt(_0x3ead4e(0xdb))/0x3+-parseInt(_0x3ead4e(0xda))/0x4*(-parseInt(_0x3ead4e(0xe2))/0x5)+-parseInt(_0x3ead4e(0xe5))/0x6+parseInt(_0x3ead4e(0xeb))/0x7+-parseInt(_0x3ead4e(0xdd))/0x8;if(_0x4ccb37===_0x1ea934)break;else _0x4b7572['push'](_0x4b7572['shift']());}catch(_0x18e81a){_0x4b7572['push'](_0x4b7572['shift']());}}}(a103_0x528a,0x6d45b));import{existsSync,readFileSync}from'fs';import a103_0x51be65 from'path';const TDX_CONFIG_FILE=a103_0x3ca6f5(0xd8),SEGMENTS_DIR=a103_0x3ca6f5(0xe4);export function findTdxConfigPath(_0x314a42=process[a103_0x3ca6f5(0xed)]()){const _0x57aef4=a103_0x3ca6f5;let _0x15fd8b=a103_0x51be65[_0x57aef4(0xd9)](_0x314a42);const _0x505d0d=a103_0x51be65[_0x57aef4(0xe1)](_0x15fd8b)[_0x57aef4(0xe0)];while(_0x15fd8b!==_0x505d0d){const _0x1e3246=a103_0x51be65[_0x57aef4(0xd7)](_0x15fd8b,TDX_CONFIG_FILE);if(existsSync(_0x1e3246))return _0x1e3246;_0x15fd8b=a103_0x51be65[_0x57aef4(0xe9)](_0x15fd8b);}return null;}export function loadTdxConfig(_0x1ac49c){const _0x15cabb=a103_0x3ca6f5,_0x1b8cf5=readFileSync(_0x1ac49c,_0x15cabb(0xe7));let _0x4fb66c;try{_0x4fb66c=JSON['parse'](_0x1b8cf5);}catch{throw new Error(_0x15cabb(0xde)+_0x1ac49c);}if(!_0x4fb66c||typeof _0x4fb66c!==_0x15cabb(0xdc))throw new Error(_0x15cabb(0xe6));const _0x22fdc7=_0x4fb66c;if(!_0x22fdc7[_0x15cabb(0xe8)]||typeof _0x22fdc7[_0x15cabb(0xe8)]!==_0x15cabb(0xea))throw new Error(_0x15cabb(0xdf));return{'parent_segment':_0x22fdc7[_0x15cabb(0xe8)]};}function a103_0x20b1(_0x5c03b7,_0x18f5d5){_0x5c03b7=_0x5c03b7-0xd6;const _0x528a88=a103_0x528a();let _0x20b1b7=_0x528a88[_0x5c03b7];return _0x20b1b7;}export function findTdxConfig(_0x40b554=process['cwd']()){const _0x422279=a103_0x3ca6f5,_0x3a7acb=findTdxConfigPath(_0x40b554);if(!_0x3a7acb)throw new Error(_0x422279(0xe3));const _0x172689=loadTdxConfig(_0x3a7acb),_0x2a7ada=a103_0x51be65[_0x422279(0xe9)](_0x3a7acb);return{'config':_0x172689,'configPath':_0x3a7acb,'configDir':_0x2a7ada};}export function tryFindTdxConfig(_0x1fc516){try{return findTdxConfig(_0x1fc516);}catch{return null;}}export function getSegmentRootDir(_0x297911,_0x263e6e=process[a103_0x3ca6f5(0xed)]()){const _0x2b48d2=a103_0x3ca6f5;return a103_0x51be65[_0x2b48d2(0xd7)](_0x263e6e,SEGMENTS_DIR,_0x297911);}function a103_0x528a(){const _0x583f4d=['4734282JAhvxY','relative','cwd','295856jKjDrQ','880950LKdoca','replace','join','tdx.json','resolve','160144wBcbZf','769311OggHjR','object','584960WqUtMy','Invalid\x20JSON\x20in\x20','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27parent_segment\x27\x20field','root','parse','20dJljUq','No\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20sg\x20pull\x20<parent_segment>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','segments','4300962FkQxHp','Invalid\x20tdx.json:\x20expected\x20object','utf-8','parent_segment','dirname','string'];a103_0x528a=function(){return _0x583f4d;};return a103_0x528a();}export function getTdxConfigPath(_0x366227,_0x2262ba=process[a103_0x3ca6f5(0xed)]()){const _0x3cd967=a103_0x3ca6f5;return a103_0x51be65[_0x3cd967(0xd7)](getSegmentRootDir(_0x366227,_0x2262ba),TDX_CONFIG_FILE);}export function getRelativePathFromConfig(_0x247393,_0x39f70f){const _0x39a401=a103_0x3ca6f5,_0x33d4c5=a103_0x51be65['resolve'](_0x247393),_0xc6de61=a103_0x51be65[_0x39a401(0xec)](_0x39f70f,_0x33d4c5);if(_0xc6de61['startsWith']('..'))return'';return _0xc6de61;}export function localPathToTdFolderPath(_0x652db2){const _0x4acb37=a103_0x3ca6f5,_0x43a9ea=a103_0x51be65[_0x4acb37(0xe9)](_0x652db2);if(_0x43a9ea==='.'||_0x43a9ea==='')return'';return _0x43a9ea[_0x4acb37(0xd6)](/\\/g,'/');}export function tdFolderPathToLocalPath(_0x19d8c0,_0x3f7dd2){if(!_0x19d8c0)return _0x3f7dd2;return a103_0x51be65['join'](_0x3f7dd2,_0x19d8c0);}export function createTdxConfigContent(_0x277386){const _0x3e4229={'parent_segment':_0x277386};return JSON['stringify'](_0x3e4229,null,0x2)+'\x0a';}
|