@treasuredata/tdx 2026.3.4 → 2026.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a135_0x3c0fc2=a135_0x3303;function a135_0x3303(_0x252988,_0x367751){_0x252988=_0x252988-0xf8;const _0x2daea9=a135_0x2dae();let _0x3303a4=_0x2daea9[_0x252988];return _0x3303a4;}(function(_0x55287c,_0x449644){const _0x4fbdb7=a135_0x3303,_0x2840e6=_0x55287c();while(!![]){try{const _0x3205f1=-parseInt(_0x4fbdb7(0x101))/0x1*(-parseInt(_0x4fbdb7(0x110))/0x2)+-parseInt(_0x4fbdb7(0x10f))/0x3+parseInt(_0x4fbdb7(0x100))/0x4+parseInt(_0x4fbdb7(0xff))/0x5*(-parseInt(_0x4fbdb7(0xfe))/0x6)+-parseInt(_0x4fbdb7(0x105))/0x7*(parseInt(_0x4fbdb7(0xf8))/0x8)+-parseInt(_0x4fbdb7(0xfc))/0x9*(-parseInt(_0x4fbdb7(0x108))/0xa)+parseInt(_0x4fbdb7(0x10a))/0xb;if(_0x3205f1===_0x449644)break;else _0x2840e6['push'](_0x2840e6['shift']());}catch(_0x2ce17e){_0x2840e6['push'](_0x2840e6['shift']());}}}(a135_0x2dae,0xd0d2e));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a135_0x5236ab from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a135_0x3c0fc2(0x102));export function getPushRecoveryPath(_0x3b9f1c){const _0x28ae98=a135_0x3c0fc2,_0x3202f2=a135_0x5236ab[_0x28ae98(0x109)](_0x3b9f1c),_0x118c64=a135_0x5236ab['basename'](_0x3b9f1c);return a135_0x5236ab['join'](_0x3202f2,'.'+_0x118c64+_0x28ae98(0x10e));}export function readPushRecovery(_0x56f451){const _0x31b9fc=a135_0x3c0fc2,_0x43dbe3=getPushRecoveryPath(_0x56f451);if(!existsSync(_0x43dbe3))return undefined;try{const _0x3fb3b7=readFileSync(_0x43dbe3,_0x31b9fc(0x103)),_0x53a01c=JSON[_0x31b9fc(0x10c)](_0x3fb3b7);if(_0x53a01c?.[_0x31b9fc(0x10d)]!==0x1||typeof _0x53a01c[_0x31b9fc(0xf9)]!==_0x31b9fc(0xfa))return undefined;return _0x53a01c;}catch(_0x3e5a96){return _0x3e5a96 instanceof SyntaxError?logger['debug'](_0x31b9fc(0x104)+_0x3e5a96):logger['warn'](_0x31b9fc(0xfb)+_0x3e5a96),undefined;}}export function writePushRecovery(_0x5109b1,_0x54a79d){const _0x1e5486=a135_0x3c0fc2,_0x567869=getPushRecoveryPath(_0x5109b1),_0x58c2d7=_0x567869+'.tmp';writeFileSync(_0x58c2d7,JSON[_0x1e5486(0x10b)](_0x54a79d,null,0x2)+'\x0a','utf-8'),renameSync(_0x58c2d7,_0x567869);}function a135_0x2dae(){const _0x3bdc18=['Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','558FAZknc','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','1122nVzdhX','23205LItVyH','3342000lvSwUW','268VaqASw','tdx.sdk.push-recovery','utf-8','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','112teqnpa','ENOENT','toISOString','4990UTNWae','dirname','10699788XqFfIu','stringify','parse','version','.push-recovery.json','555867EWvwEp','1884awVwEw','91552vMdLDC','journeyName','string'];a135_0x2dae=function(){return _0x3bdc18;};return a135_0x2dae();}export function deletePushRecovery(_0x1b0a34){const _0x391881=a135_0x3c0fc2,_0x1cf894=getPushRecoveryPath(_0x1b0a34);try{unlinkSync(_0x1cf894);}catch(_0x2c85bb){_0x2c85bb['code']!==_0x391881(0x106)&&logger['debug'](_0x391881(0xfd)+_0x2c85bb);}}export function saveSegmentToPushRecovery(_0x2913da,_0x420957,_0x251e63,_0x39a591){const _0x5dfe46=a135_0x3c0fc2,_0x257aa7=readPushRecovery(_0x2913da),_0x19bf11=_0x257aa7?.[_0x5dfe46(0xf9)]===_0x420957?{..._0x257aa7,'updatedAt':new Date()[_0x5dfe46(0x107)]()}:{'version':0x1,'journeyName':_0x420957,'updatedAt':new Date()[_0x5dfe46(0x107)](),'segments':{}};_0x19bf11['segments'][_0x251e63]=_0x39a591,writePushRecovery(_0x2913da,_0x19bf11);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a136_0x357cba=a136_0x1e1e;(function(_0x2139af,_0xbca997){const _0x4538ff=a136_0x1e1e,_0x25c650=_0x2139af();while(!![]){try{const _0x29997a=-parseInt(_0x4538ff(0x1f8))/0x1*(parseInt(_0x4538ff(0x2cf))/0x2)+parseInt(_0x4538ff(0x2f1))/0x3+parseInt(_0x4538ff(0x21f))/0x4+parseInt(_0x4538ff(0x1fb))/0x5+-parseInt(_0x4538ff(0x26c))/0x6+parseInt(_0x4538ff(0x2bd))/0x7*(parseInt(_0x4538ff(0x2ef))/0x8)+parseInt(_0x4538ff(0x254))/0x9*(-parseInt(_0x4538ff(0x293))/0xa);if(_0x29997a===_0xbca997)break;else _0x25c650['push'](_0x25c650['shift']());}catch(_0xdbe66c){_0x25c650['push'](_0x25c650['shift']());}}}(a136_0x3ed0,0x5b60e));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a136_0x357cba(0x29a));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a136_0x357cba(0x272);export function createPendingSegmentId(_0x4a307e){return''+PENDING_SEGMENT_PREFIX+_0x4a307e+'__';}export function isPendingSegmentId(_0x45f7ec){return _0x45f7ec['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x45f7ec['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x37b228){const _0x13180d=a136_0x357cba;return _0x37b228[_0x13180d(0x210)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x23a617){return''+PENDING_ACTIVATION_PREFIX+_0x23a617+'__';}export function isPendingActivationId(_0x1b99a9){const _0x4ef38f=a136_0x357cba;return _0x1b99a9[_0x4ef38f(0x204)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x241860){const _0x5050e2=a136_0x357cba;return _0x241860[_0x5050e2(0x210)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x42a0e3,_0x38ee68){const _0x5f0edf=a136_0x357cba,_0x3d0cf9=_0x42a0e3+'::'+(_0x38ee68[_0x5f0edf(0x223)]()||_0x5f0edf(0x27c)),_0x5d505a=createHash(_0x5f0edf(0x29c))['update'](_0x3d0cf9)['digest']('hex')[_0x5f0edf(0x29b)](0x0,0xc);return _0x5f0edf(0x222)+_0x5d505a;}export function ensureJourneyDefaults(_0x4524df){const _0x41d26c=a136_0x357cba;!_0x4524df[_0x41d26c(0x2a7)]&&(_0x4524df['description']=''),!_0x4524df[_0x41d26c(0x27e)]&&(_0x4524df['state']=_0x41d26c(0x28f));}export function injectExistingStageIds(_0x49130e,_0x1bed38){const _0x5c69c4=a136_0x357cba,_0x18a934=new Map(_0x1bed38[_0x5c69c4(0x2d4)](_0x322caa=>[_0x322caa[_0x5c69c4(0x2e8)],_0x322caa['id']]));for(const _0x5a066c of _0x49130e){if(!_0x5a066c['id']){const _0x117833=_0x18a934[_0x5c69c4(0x20a)](_0x5a066c[_0x5c69c4(0x2e8)]);_0x117833&&(_0x5a066c['id']=_0x117833);}}}export function resolveTDFolderPath(_0x542fe7,_0x1f2287,_0x3d4b1d){if(!_0x1f2287)return _0x542fe7;if(_0x542fe7===_0x3d4b1d||_0x542fe7['startsWith'](_0x3d4b1d+'/'))return _0x542fe7;return _0x542fe7?_0x3d4b1d+'/'+_0x542fe7:_0x3d4b1d;}export function addFoldersToCreate(_0x271e11,_0x167973,_0x333ec8){const _0x1c5c0d=a136_0x357cba;if(!_0x271e11)return;if(_0x167973['has'](_0x271e11))return;const _0x2554e7=_0x271e11[_0x1c5c0d(0x206)]('/');let _0x132d56='';for(const _0x2d0a91 of _0x2554e7){_0x132d56=_0x132d56?_0x132d56+'/'+_0x2d0a91:_0x2d0a91,!_0x167973[_0x1c5c0d(0x1f4)](_0x132d56)&&_0x333ec8['add'](_0x132d56);}}export function sortFoldersByDepth(_0x92e148){return[..._0x92e148]['sort']((_0x268490,_0x354809)=>{const _0x313826=a136_0x1e1e,_0x3c9869=(_0x268490[_0x313826(0x2ea)](/\//g)||[])[_0x313826(0x2b3)],_0xf3c4fe=(_0x354809[_0x313826(0x2ea)](/\//g)||[])['length'];return _0x3c9869-_0xf3c4fe;});}import*as a136_0xa17e00 from'yaml';import{readFileSync}from'fs';import a136_0x8d255f from'path';import{isJourneyDef,parseYamlString as a136_0x35b9fb,toYamlString as a136_0x4d3ac1,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';function a136_0x1e1e(_0x56647a,_0x5db192){_0x56647a=_0x56647a-0x1f4;const _0x3ed0f8=a136_0x3ed0();let _0x1e1ef7=_0x3ed0f8[_0x56647a];return _0x1e1ef7;}import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x6c5f29){const _0x412cec=a136_0x357cba;if(Array['isArray'](_0x6c5f29))return'['+_0x6c5f29[_0x412cec(0x2d4)](_0x5cbfde=>stableStringify(_0x5cbfde))[_0x412cec(0x290)](',')+']';if(_0x6c5f29&&typeof _0x6c5f29===_0x412cec(0x217)){const _0x59d405=_0x6c5f29,_0xda26aa=Object[_0x412cec(0x212)](_0x59d405)[_0x412cec(0x2dc)](),_0x3c7fe4=_0xda26aa[_0x412cec(0x2d4)](_0x5229a3=>'\x22'+_0x5229a3+'\x22:'+stableStringify(_0x59d405[_0x5229a3]));return'{'+_0x3c7fe4['join'](',')+'}';}const _0x352659=JSON['stringify'](_0x6c5f29);return _0x352659===undefined?'null':_0x352659;}function activationSignature(_0x227c69){const _0x226ade=a136_0x357cba,_0x3a423f={'connection':_0x227c69['connection'],..._0x227c69[_0x226ade(0x20e)]!==undefined&&{'all_columns':_0x227c69[_0x226ade(0x20e)]},..._0x227c69[_0x226ade(0x26a)]!==undefined&&{'columns':_0x227c69[_0x226ade(0x26a)]},..._0x227c69['behavior']!==undefined&&{'behavior':_0x227c69[_0x226ade(0x2ee)]},..._0x227c69[_0x226ade(0x29e)]!==undefined&&{'schedule':_0x227c69[_0x226ade(0x29e)]},..._0x227c69[_0x226ade(0x238)]!==undefined&&{'notification':_0x227c69['notification']},..._0x227c69[_0x226ade(0x202)]!==undefined&&{'connector_config':_0x227c69[_0x226ade(0x202)]},..._0x227c69[_0x226ade(0x22a)]!==undefined&&{'activation_template_id':_0x227c69[_0x226ade(0x22a)]}};return stableStringify(_0x3a423f);}async function fetchSegment(_0x4df899,_0x2a8e1b,_0x4bb5d1,_0x9b58cc){const _0x9b2042=a136_0x357cba,_0x2e0b5e=_0x9b58cc?.[_0x9b2042(0x280)](_0x1346cd=>_0x1346cd['id']===_0x4bb5d1);if(_0x2e0b5e)return _0x2e0b5e;try{return await _0x4df899[_0x9b2042(0x27c)]['getSegment'](_0x2a8e1b,_0x4bb5d1);}catch(_0x2daeeb){logger[_0x9b2042(0x2d3)](_0x9b2042(0x2d7)+_0x4bb5d1+_0x9b2042(0x1f6)+_0x2daeeb);try{return await _0x4df899[_0x9b2042(0x27c)][_0x9b2042(0x215)](_0x4bb5d1);}catch(_0x4a5094){return logger['debug'](_0x9b2042(0x268)+_0x4bb5d1+':\x20'+_0x4a5094),null;}}}function recoverSegmentIdsFromPushRecovery(_0x2ca3fe,_0x2dafc1,_0x13904f){const _0x26ad07=a136_0x357cba,_0x117ba4=readPushRecovery(_0x2ca3fe[_0x26ad07(0x2b5)]);if(_0x117ba4?.[_0x26ad07(0x2ba)]===_0x2ca3fe[_0x26ad07(0x276)][_0x26ad07(0x2e8)])for(const [_0xc46d99,_0x32b77f]of Object[_0x26ad07(0x255)](_0x117ba4[_0x26ad07(0x284)])){const _0x46dd8d=generateDeterministicJourneySegmentName(_0x2ca3fe[_0x26ad07(0x276)][_0x26ad07(0x2e8)],_0xc46d99);_0x32b77f['uniqueServerName']===_0x46dd8d&&(_0x2dafc1[_0x26ad07(0x278)](_0xc46d99,_0x32b77f['segmentId']),_0x13904f[_0x26ad07(0x278)](_0xc46d99,_0x32b77f[_0x26ad07(0x235)]));}}async function createOrRecoverEmbeddedSegment(_0x528464,_0xeae038,_0x51c8be,_0x49ac3a){const _0x4ee978=a136_0x357cba;let _0x4f2f8e;try{_0x4f2f8e=await _0x528464[_0x4ee978(0x27c)][_0x4ee978(0x2ca)]({'name':_0x51c8be[_0x4ee978(0x295)],'description':_0x51c8be['description'],'journeyId':_0x51c8be['journeyId'],'rule':_0x49ac3a(_0x51c8be[_0x4ee978(0x25d)],!![]),'countPopulation':!![],'parentFolderId':_0x51c8be[_0x4ee978(0x279)],'audienceId':_0x51c8be[_0x4ee978(0x25f)]});}catch(_0x5d3d60){const _0x1620d5=_0x5d3d60 instanceof Error&&_0x5d3d60['message']['includes']('Name\x20has\x20already\x20been\x20taken');if(_0x1620d5){const _0x3cb2f7=readPushRecovery(_0xeae038['absolutePath']),_0x1d505b=_0x3cb2f7?.[_0x4ee978(0x2ba)]===_0xeae038['yamlConfig'][_0x4ee978(0x2e8)]?_0x3cb2f7[_0x4ee978(0x284)][_0x51c8be['localName']]:undefined;if(_0x1d505b?.[_0x4ee978(0x299)]===_0x51c8be[_0x4ee978(0x295)])await _0x528464['segment']['updateSegmentById'](_0x51c8be[_0x4ee978(0x25f)],_0x1d505b[_0x4ee978(0x235)],{'description':_0x51c8be[_0x4ee978(0x2a7)],'rule':_0x49ac3a(_0x51c8be[_0x4ee978(0x25d)],!![]),'countPopulation':!![]}),_0x4f2f8e=_0x1d505b['segmentId'];else throw new SDKError(ErrorCode[_0x4ee978(0x1f7)],'Embedded\x20segment\x20\x27'+_0x51c8be['localName']+_0x4ee978(0x21d)+(_0x4ee978(0x24b)+_0xeae038['absolutePath'][_0x4ee978(0x210)](/([^/]+)$/,_0x4ee978(0x240))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x5d3d60);}else throw _0x5d3d60;}return saveSegmentToPushRecovery(_0xeae038['absolutePath'],_0xeae038['yamlConfig'][_0x4ee978(0x2e8)],_0x51c8be['localName'],{'segmentId':_0x4f2f8e,'uniqueServerName':_0x51c8be['uniqueSegmentName'],'createdAt':new Date()['toISOString']()}),_0x4f2f8e;}export async function prepareSegmentFiles(_0x45567d,_0x2fd2fa,_0x113dae,_0x499e2a,_0xac32e2){const _0x19be47=a136_0x357cba,{activationDefToCreateRequest:_0x1e03bd}=await import(_0x19be47(0x227)),_0x52af62=[],_0x545330=new Set();for(const {yamlConfig:_0x31c0a9,folderPath:_0x1d4ffe,sourcePath:_0x9bd085}of _0x45567d){const _0x9fd523=resolveTDFolderPath(_0x1d4ffe,_0x499e2a,_0xac32e2),_0x19996a=_0x9fd523+':'+_0x31c0a9['name'],_0x112bca=_0x2fd2fa[_0x19be47(0x270)]['get'](_0x19996a),_0x11dcde=_0x112bca?_0x2fd2fa[_0x19be47(0x2dd)][_0x19be47(0x20a)](_0x112bca['id'])||[]:[];addFoldersToCreate(_0x9fd523,_0x2fd2fa[_0x19be47(0x25c)],_0x545330);const _0x4db40c=calculateActivationActions(_0x31c0a9[_0x19be47(0x1f5)]||[],_0x11dcde,_0x2fd2fa[_0x19be47(0x1fe)],_0x2fd2fa[_0x19be47(0x241)]);for(const _0xdd6d53 of _0x4db40c){(_0xdd6d53[_0x19be47(0x22e)]===_0x19be47(0x277)||_0xdd6d53[_0x19be47(0x22e)]==='update')&&_0xdd6d53[_0x19be47(0x213)]&&(_0xdd6d53['validatedRequest']=await _0x1e03bd(_0xdd6d53[_0x19be47(0x213)],_0x113dae));}const _0x58ddef=calculateSegmentDiff(_0x31c0a9,_0x112bca,_0x11dcde,_0x2fd2fa[_0x19be47(0x1fe)],_0x2fd2fa[_0x19be47(0x241)]);_0x52af62[_0x19be47(0x2b9)]({'relativePath':_0x31c0a9[_0x19be47(0x2e8)],'absolutePath':_0x9bd085,'yamlConfig':_0x31c0a9,'folderPath':_0x9fd523,'existingSegment':_0x112bca,'existingActivations':_0x11dcde,'isNew':_0x58ddef[_0x19be47(0x232)],'hasChanges':_0x58ddef[_0x19be47(0x2ab)],'diff':_0x58ddef[_0x19be47(0x2da)],'activationActions':_0x4db40c});}return{'segmentFiles':_0x52af62,'foldersToCreate':_0x545330};}export async function prepareJourneyFiles(_0x5def8f,_0x539ec4,_0x2c395f,_0x446700){const _0x1cd45f=a136_0x357cba,_0x3d70f3=[],_0x443e22=new Set();for(const {yamlConfig:_0x200d5d,folderPath:_0x274d73,sourcePath:_0x192b7c}of _0x5def8f){const _0x1a17ba=resolveTDFolderPath(_0x274d73,_0x2c395f,_0x446700),_0x5f1a8c=_0x1a17ba+':'+_0x200d5d[_0x1cd45f(0x2e8)],_0x48473=_0x539ec4['journeyBundlesByFolderAndName']['get'](_0x5f1a8c);let _0x51119c,_0x12cbd4;if(_0x48473&&_0x48473[_0x1cd45f(0x2b3)]>0x0){const _0x282000=buildLocalExpandedRuleMappings(_0x200d5d),{createYamlContext:_0x8c8bf,prefetchJourneySegments:_0x15f2d1}=createPushYamlContextForBundle(_0x539ec4[_0x1cd45f(0x2f3)],_0x539ec4['parentId'],_0x539ec4[_0x1cd45f(0x2d8)],_0x282000,_0x539ec4['idToEmailMap'],_0x539ec4[_0x1cd45f(0x241)],_0x539ec4[_0x1cd45f(0x23e)],_0x539ec4[_0x1cd45f(0x2ce)]);await _0x15f2d1(_0x48473[_0x1cd45f(0x2d4)](_0x4bce97=>_0x4bce97['id']));const _0x43ee03=await _0x539ec4[_0x1cd45f(0x2f3)][_0x1cd45f(0x22d)][_0x1cd45f(0x2ec)](_0x48473[0x0][_0x1cd45f(0x205)]),_0x46ac00=hasMultipleVersions(_0x200d5d),_0x398bac=async _0x5e33ad=>{const _0x472c7a=_0x1cd45f,_0x12fa7d=_0x539ec4[_0x472c7a(0x2ce)]?.[_0x472c7a(0x20a)](_0x5e33ad);if(_0x12fa7d)return _0x12fa7d;return _0x539ec4[_0x472c7a(0x24c)]({'journeyId':_0x5e33ad,'journeyName':_0x200d5d[_0x472c7a(0x2e8)],'isMultiVersion':_0x48473[_0x472c7a(0x2b3)]>0x1});};if(_0x46ac00&&_0x48473['length']>0x1){const _0x36a04b=[];for(const _0x3f9b08 of _0x48473){const _0x26e21d=_0x3f9b08[_0x1cd45f(0x2ac)]||0x1;_0x539ec4[_0x1cd45f(0x2a6)]?.[_0x1cd45f(0x23d)](_0x1cd45f(0x2c2)+_0x200d5d[_0x1cd45f(0x2e8)]+'\x20v'+_0x26e21d);const _0x4808a5=await _0x398bac(_0x3f9b08['id']),_0x99964a=_0x8c8bf(_0x3f9b08['id']),_0x17eae0=await journeyResponseToDef(_0x4808a5,_0x99964a);_0x36a04b[_0x1cd45f(0x2b9)]({'item':_0x3f9b08,'yaml':_0x17eae0});}const _0x5b1eaa=buildLocalRuleToNameMappingFromJourney(_0x200d5d);_0x12cbd4=buildMergedJourneyDef(_0x36a04b,_0x5b1eaa,_0x43ee03);const _0x3f9d7e=Math[_0x1cd45f(0x1ff)](..._0x36a04b[_0x1cd45f(0x2d4)](_0x44eb10=>_0x44eb10[_0x1cd45f(0x2f4)]['versionNumber']||0x0)),_0x47925d=_0x48473['find'](_0x3e4c83=>(_0x3e4c83[_0x1cd45f(0x2ac)]||0x0)===_0x3f9d7e);_0x47925d&&(_0x539ec4[_0x1cd45f(0x2a6)]?.[_0x1cd45f(0x23d)]('Fetching\x20'+_0x200d5d[_0x1cd45f(0x2e8)]+'\x20v'+_0x3f9d7e),_0x51119c=await _0x398bac(_0x47925d['id']));}else{const _0x37b454=_0x48473[_0x48473[_0x1cd45f(0x2b3)]-0x1];_0x539ec4[_0x1cd45f(0x2a6)]?.[_0x1cd45f(0x23d)](_0x1cd45f(0x2c2)+_0x200d5d[_0x1cd45f(0x2e8)]),_0x51119c=await _0x398bac(_0x37b454['id']);const _0x219dcb=_0x8c8bf(_0x37b454['id']),_0x3435c5=await journeyResponseToDef(_0x51119c,_0x219dcb),_0xa55eda=buildLocalRuleToNameMappingFromJourney(_0x200d5d);_0x12cbd4=buildMergedJourneyDef([{'item':_0x37b454,'yaml':_0x3435c5}],_0xa55eda,_0x43ee03);}}addFoldersToCreate(_0x1a17ba,_0x539ec4[_0x1cd45f(0x25c)],_0x443e22);const _0x59a34c=calculateJourneyDiff(_0x200d5d,_0x12cbd4);_0x3d70f3[_0x1cd45f(0x2b9)]({'relativePath':_0x200d5d[_0x1cd45f(0x2e8)],'absolutePath':_0x192b7c,'yamlConfig':_0x200d5d,'folderPath':_0x1a17ba,'existingJourney':_0x51119c,'isNew':_0x59a34c[_0x1cd45f(0x232)],'hasChanges':_0x59a34c[_0x1cd45f(0x2ab)],'diff':_0x59a34c[_0x1cd45f(0x2da)]});}return{'journeyFiles':_0x3d70f3,'foldersToCreate':_0x443e22};}export function calculateActivationActions(_0x1b9881,_0x25c8f8,_0x1a3b78,_0x146012){const _0x4a1262=a136_0x357cba,_0x4fc51f=[],_0x5cc1ee=new Map();for(const _0x335c9b of _0x25c8f8){_0x5cc1ee[_0x4a1262(0x278)](_0x335c9b[_0x4a1262(0x2e8)],_0x335c9b);}const _0xf1bbf0=new Map();for(const _0x4d1184 of _0x1b9881){_0xf1bbf0['set'](_0x4d1184[_0x4a1262(0x2e8)],_0x4d1184);}for(const _0x33638b of _0x1b9881){const _0x36a21b=_0x5cc1ee[_0x4a1262(0x20a)](_0x33638b[_0x4a1262(0x2e8)]);if(!_0x36a21b)_0x4fc51f[_0x4a1262(0x2b9)]({'type':_0x4a1262(0x277),'name':_0x33638b[_0x4a1262(0x2e8)],'yamlActivation':_0x33638b});else{const _0x22903e=activationResponseToDef(_0x36a21b,_0x1a3b78,_0x146012),_0x57e41f=a136_0xa17e00['stringify'](_0x22903e),_0x40c6bf=a136_0xa17e00[_0x4a1262(0x287)](_0x33638b);_0x57e41f!==_0x40c6bf&&_0x4fc51f['push']({'type':_0x4a1262(0x23d),'name':_0x33638b[_0x4a1262(0x2e8)],'yamlActivation':_0x33638b,'existingActivation':_0x36a21b});}}for(const _0x3cd5b9 of _0x25c8f8){!_0xf1bbf0['has'](_0x3cd5b9[_0x4a1262(0x2e8)])&&_0x4fc51f[_0x4a1262(0x2b9)]({'type':_0x4a1262(0x291),'name':_0x3cd5b9['name'],'existingActivation':_0x3cd5b9});}return _0x4fc51f;}function calculateYamlDiff(_0x411f3b,_0x3b44a0){if(_0x3b44a0){const _0xbf0683=generateDiff(_0x3b44a0,_0x411f3b),_0x4a2eca=hasChanges(_0xbf0683);return{'isNew':![],'hasChanges':_0x4a2eca,'diff':_0x4a2eca?formatDiffWithColors(_0xbf0683):undefined};}const _0x44ce14=generateDiff('',_0x411f3b);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x44ce14)};}export function calculateSegmentDiff(_0x52aefc,_0x5a9a45,_0x5d89ab,_0x2ce223,_0x37b255){const _0x1ff7e0=segmentToYamlString(_0x52aefc),_0x416b0d=_0x5a9a45?segmentToYamlString(segmentWithActivationsToYaml(_0x5a9a45,_0x5d89ab,undefined,_0x2ce223,_0x37b255)):undefined;return calculateYamlDiff(_0x1ff7e0,_0x416b0d);}export function calculateJourneyDiff(_0x21d527,_0x7844e2){const _0x4ebc2f=normalizeJourneyDef(_0x21d527,_0x21d527),_0x5ed54b=a136_0x4d3ac1(_0x4ebc2f),_0x21dc95=_0x7844e2?a136_0x4d3ac1(normalizeJourneyDef(_0x7844e2,_0x21d527)):undefined;return calculateYamlDiff(_0x5ed54b,_0x21dc95);}export function findSegmentsToDelete(_0xfb1c91,_0x553836,_0x9f0ab6,_0x43fd74,_0x3b24f8){const _0x1abcc0=a136_0x357cba,_0x425b7e=new Set();for(const {yamlConfig:_0x102e64,folderPath:_0x51cec7}of _0x553836){_0x425b7e[_0x1abcc0(0x256)](_0x51cec7+':'+_0x102e64[_0x1abcc0(0x2e8)]);}return _0xfb1c91['filter'](_0x4fb12f=>{const _0x17e0ca=_0x1abcc0,_0x431a7e=_0x4fb12f[_0x17e0ca(0x2e5)]?_0x9f0ab6[_0x17e0ca(0x20a)](_0x4fb12f[_0x17e0ca(0x2e5)]['toString']())||'':'',_0x2636f1=_0x431a7e+':'+_0x4fb12f[_0x17e0ca(0x2e8)];if(_0x425b7e[_0x17e0ca(0x1f4)](_0x2636f1))return![];if(_0x3b24f8)return _0x431a7e===_0x43fd74||_0x431a7e[_0x17e0ca(0x204)](_0x43fd74+'/');return!![];});}export function findJourneysToDelete(_0x58ad2d,_0x188556,_0x4a2a47,_0x35e832,_0x45e0f1){const _0x50557f=a136_0x357cba,_0x1e21f7=new Set();for(const {yamlConfig:_0x5658f4,folderPath:_0x3effa8}of _0x188556){_0x1e21f7[_0x50557f(0x256)](_0x3effa8+':'+_0x5658f4[_0x50557f(0x2e8)]);}return _0x58ad2d[_0x50557f(0x257)](_0x1c6711=>{const _0x285b7c=_0x50557f,_0x10d4f8=_0x1c6711[_0x285b7c(0x279)]?_0x4a2a47[_0x285b7c(0x20a)](_0x1c6711[_0x285b7c(0x279)])||'':'',_0x4b971c=_0x10d4f8+':'+_0x1c6711['journeyBundleName'];if(_0x1e21f7[_0x285b7c(0x1f4)](_0x4b971c))return![];if(_0x45e0f1)return _0x10d4f8===_0x35e832||_0x10d4f8[_0x285b7c(0x204)](_0x35e832+'/');return!![];});}export function buildSegmentLookupMap(_0x26373d,_0x575c09){const _0x51976d=a136_0x357cba,_0x4f737f=new Map();for(const _0xc4542e of _0x26373d){const _0x120a99=_0xc4542e[_0x51976d(0x2e5)]?_0x575c09[_0x51976d(0x20a)](_0xc4542e[_0x51976d(0x2e5)][_0x51976d(0x273)]())||'':'',_0x425bed=_0x120a99+':'+_0xc4542e[_0x51976d(0x2e8)];_0x4f737f['set'](_0x425bed,_0xc4542e);}return _0x4f737f;}export function buildSegmentNameToIdMap(_0x2678e7){const _0xb14f76=a136_0x357cba,_0x41da08=new Map();for(const _0x28ad71 of _0x2678e7){_0x41da08[_0xb14f76(0x278)](_0x28ad71[_0xb14f76(0x2e8)],_0x28ad71['id']);}return _0x41da08;}export function buildJourneyBundleLookupMap(_0x50ac67,_0x259fa0){const _0x32efc4=a136_0x357cba,_0x43ccd2=new Map();for(const _0x396304 of _0x50ac67){const _0x4a3fd0=_0x396304[_0x32efc4(0x279)]?_0x259fa0[_0x32efc4(0x20a)](_0x396304[_0x32efc4(0x279)])||'':'',_0x457823=_0x4a3fd0+':'+_0x396304[_0x32efc4(0x237)];!_0x43ccd2[_0x32efc4(0x1f4)](_0x457823)&&_0x43ccd2[_0x32efc4(0x278)](_0x457823,[]),_0x43ccd2[_0x32efc4(0x20a)](_0x457823)['push'](_0x396304);}for(const _0x1c915a of _0x43ccd2[_0x32efc4(0x2e6)]()){_0x1c915a[_0x32efc4(0x2dc)]((_0x20d960,_0x38e3d6)=>(_0x20d960['versionNumber']||0x0)-(_0x38e3d6[_0x32efc4(0x2ac)]||0x0));}return _0x43ccd2;}export function collectFoldersToCreate(_0x46ee4e,_0x2fe63e){const _0x51907a=a136_0x357cba,_0x5661c7=new Set();for(const _0x51e777 of _0x46ee4e){if(!_0x51e777)continue;if(_0x2fe63e['has'](_0x51e777))continue;const _0x3f4fba=_0x51e777[_0x51907a(0x206)]('/');let _0x3f890d='';for(const _0x200d4d of _0x3f4fba){_0x3f890d=_0x3f890d?_0x3f890d+'/'+_0x200d4d:_0x200d4d,!_0x2fe63e['has'](_0x3f890d)&&_0x5661c7[_0x51907a(0x256)](_0x3f890d);}}return _0x5661c7;}export function parseAndClassifyYamlFiles(_0x29ba9a,_0x4dd884,_0x46d6da){const _0x488b48=a136_0x357cba,_0x5793e4=[],_0x483d22=[];for(const _0x12a994 of _0x29ba9a){const _0x2ad500=a136_0x8d255f[_0x488b48(0x242)](_0x4dd884,a136_0x8d255f['dirname'](_0x12a994)),_0x4d6f27=_0x2ad500==='.'?'':_0x2ad500,_0x193257=readFileSync(_0x12a994,'utf-8'),_0x162828=a136_0xa17e00[_0x488b48(0x201)](_0x193257);if(isJourneyDef(_0x162828)){const _0x1ba771=a136_0x35b9fb(_0x193257);_0x483d22[_0x488b48(0x2b9)]({'yamlConfig':_0x1ba771,'folderPath':_0x4d6f27,'sourcePath':_0x12a994});}else{if(!_0x46d6da?.[_0x488b48(0x2df)]){const _0x1491e8=parseSegmentYamlFile(_0x193257),_0xc6a45f=normalizeChildSegmentYaml(_0x1491e8);_0x5793e4[_0x488b48(0x2b9)]({'yamlConfig':_0xc6a45f,'folderPath':_0x4d6f27,'sourcePath':_0x12a994});}}}return{'segments':_0x5793e4,'journeys':_0x483d22};}export function validateParsedFiles(_0x28292d,_0x2bd1d1){const _0x3f1897=a136_0x357cba,_0xab5727=[];for(const {yamlConfig:_0x1067b3,sourcePath:_0x149e2e}of _0x28292d['segments']){const _0x1e9751=readFileSync(_0x149e2e,'utf-8'),_0x58d4bb=a136_0xa17e00[_0x3f1897(0x245)](_0x1e9751),_0x142379=validateSegmentDef(_0x1067b3,{'source':_0x1e9751,'document':_0x58d4bb},{'skipSchema':!![]});if(!_0x142379[_0x3f1897(0x26e)]){const _0x4c1934=a136_0x8d255f['relative'](_0x2bd1d1,_0x149e2e);_0xab5727['push']({'filePath':_0x4c1934,'source':_0x1e9751,'result':_0x142379,'isJourney':![]});}}for(const {yamlConfig:_0x54dbc5,sourcePath:_0x358df7}of _0x28292d[_0x3f1897(0x27f)]){const _0x426d47=readFileSync(_0x358df7,_0x3f1897(0x2ae)),_0x885da4=a136_0xa17e00[_0x3f1897(0x245)](_0x426d47),_0x317228=validateJourneyDef(_0x54dbc5,{'source':_0x426d47,'document':_0x885da4},{'skipSchema':!![]});if(!_0x317228['valid']){const _0x21e540=a136_0x8d255f[_0x3f1897(0x242)](_0x2bd1d1,_0x358df7);_0xab5727[_0x3f1897(0x2b9)]({'filePath':_0x21e540,'source':_0x426d47,'result':_0x317228,'isJourney':!![]});}}return _0xab5727;}export function formatValidationErrors(_0x2de739){const _0x16d9ef=a136_0x357cba,_0x45666d=[];for(const {filePath:_0x550708,source:_0x12c4b9,result:_0x10edd1,isJourney:_0x27b30c}of _0x2de739){const _0x12fd69=_0x27b30c?_0x16d9ef(0x22d):_0x16d9ef(0x27c);_0x45666d[_0x16d9ef(0x2b9)]('\x0a'+_0x550708+'\x20('+_0x12fd69+_0x16d9ef(0x2b0)+_0x10edd1[_0x16d9ef(0x228)][_0x16d9ef(0x2b3)]+_0x16d9ef(0x1f9)),_0x45666d[_0x16d9ef(0x2b9)](formatValidationResult(_0x10edd1,_0x12c4b9,_0x550708));}return _0x45666d['join']('\x0a');}export function buildLocalExpandedRuleMappings(_0x30d749){const _0x4de235=a136_0x357cba,_0x237c8d=new Set(),_0x4d95b1=new Map(),_0x321651=collectSegmentUsageCounts(_0x30d749);if(_0x30d749['segments'])for(const [_0x4d3c4f,_0x3566eb]of Object['entries'](_0x30d749[_0x4de235(0x284)])){_0x237c8d['add'](_0x4d3c4f);if(_0x3566eb[_0x4de235(0x25e)]){const _0x454b72=yamlRuleToApi(_0x3566eb[_0x4de235(0x25e)]),_0x1771c1=apiRuleToYaml(_0x454b72);_0x4d95b1[_0x4de235(0x278)](_0x4d3c4f,_0x1771c1);}}const _0x1e5973=new Map();let _0x515fc0=0x0;for(const [_0x18fed0,_0x32faa2]of _0x4d95b1){const _0x15d8a1=serializeExpandedRule(_0x32faa2,_0x4d95b1),_0x477366=_0x1e5973['get'](_0x15d8a1)||[];_0x477366[_0x4de235(0x2b9)]({'name':_0x18fed0,'index':_0x515fc0}),_0x1e5973['set'](_0x15d8a1,_0x477366),_0x515fc0++;}const _0x5b1f05=new Map();for(const [_0x380af7,_0x27c358]of _0x1e5973){const _0x2823df=_0x27c358[_0x4de235(0x29b)]()['sort']((_0x232cc1,_0x4b16f2)=>{const _0x953a3b=_0x4de235,_0x455aad=_0x321651[_0x953a3b(0x20a)](_0x232cc1['name'])||0x0,_0x516449=_0x321651[_0x953a3b(0x20a)](_0x4b16f2['name'])||0x0;if(_0x455aad!==_0x516449)return _0x516449-_0x455aad;return _0x232cc1[_0x953a3b(0x2e1)]-_0x4b16f2['index'];})['map'](_0x1f9b49=>_0x1f9b49[_0x4de235(0x2e8)]),_0x1caa71=[];for(const _0x5857ef of _0x2823df){const _0x58286f=_0x321651[_0x4de235(0x20a)](_0x5857ef)||0x0,_0x1b91b7=Math[_0x4de235(0x1ff)](_0x58286f,0x1);for(let _0x39d82f=0x0;_0x39d82f<_0x1b91b7;_0x39d82f++){_0x1caa71[_0x4de235(0x2b9)](_0x5857ef);}}_0x5b1f05[_0x4de235(0x278)](_0x380af7,_0x1caa71);}return{'existingLocalSegmentNames':_0x237c8d,'localSegmentRules':_0x4d95b1,'localExpandedRuleToNames':_0x5b1f05};}export function createSegmentIdResolver(_0x506388,_0x46dda0){return async _0x2a2728=>{const _0x84269=a136_0x1e1e,_0x558d54=_0x506388[_0x84269(0x20a)](_0x2a2728);if(!_0x558d54)throw new SDKError(ErrorCode[_0x84269(0x2a1)],_0x84269(0x24e)+_0x2a2728+'\x20(referenced\x20in\x20embedded\x20segment\x20\x27'+_0x46dda0+'\x27)');return _0x558d54;};}export function extractRootFolderId(_0x445c29){const _0x4e8635=a136_0x357cba;return _0x445c29['relationships']?.[_0x4e8635(0x25b)]?.['data']?.['id']||_0x445c29['relationships']?.['parentFolder']?.[_0x4e8635(0x2cb)]?.['id'];}export function buildConnectionMaps(_0x3c2e5d){const _0x3cd20a=a136_0x357cba,_0x4e3bcd=new Map(),_0x3ce502=new Map(),_0x3f7995=new Map();for(const _0x177e45 of _0x3c2e5d){_0x4e3bcd[_0x3cd20a(0x278)](_0x177e45[_0x3cd20a(0x2e8)],parseInt(_0x177e45['id'],0xa)),_0x3ce502[_0x3cd20a(0x278)](_0x177e45['id'],_0x177e45[_0x3cd20a(0x2e8)]),_0x3f7995[_0x3cd20a(0x278)](_0x177e45[_0x3cd20a(0x2e8)],_0x177e45[_0x3cd20a(0x22e)]);}return{'nameToId':_0x4e3bcd,'idToName':_0x3ce502,'nameToType':_0x3f7995};}export function calculatePushStats(_0x4f517d,_0x2bff1f,_0x19905c,_0x4c4fd6,_0x3016a4,_0x44d7f8,_0x5559ca){const _0x33ca2f=a136_0x357cba,_0x3693c0=_0x4f517d[_0x33ca2f(0x257)](_0x2c97dd=>_0x2c97dd[_0x33ca2f(0x232)]),_0x2bb7e2=_0x4f517d[_0x33ca2f(0x257)](_0x1bf4b6=>!_0x1bf4b6[_0x33ca2f(0x232)]&&_0x1bf4b6['hasChanges']),_0x3edde9=_0x4f517d[_0x33ca2f(0x257)](_0x281f29=>!_0x281f29['isNew']&&!_0x281f29[_0x33ca2f(0x2ab)]),_0x1b92f6=_0x44d7f8?_0x4c4fd6:[],_0x3bc40d=_0x2bff1f[_0x33ca2f(0x257)](_0x12ff0f=>_0x12ff0f[_0x33ca2f(0x232)]),_0x424830=_0x2bff1f[_0x33ca2f(0x257)](_0x3ee8c0=>!_0x3ee8c0[_0x33ca2f(0x232)]&&_0x3ee8c0[_0x33ca2f(0x2ab)]),_0x32dbc8=_0x2bff1f['filter'](_0x29b99c=>!_0x29b99c[_0x33ca2f(0x232)]&&!_0x29b99c[_0x33ca2f(0x2ab)]),_0x4a728b=_0x44d7f8?_0x3016a4:[],_0x26f0a8=_0x4f517d[_0x33ca2f(0x2a2)](_0x2bf3f8=>_0x2bf3f8[_0x33ca2f(0x21b)]),_0x12fed1=_0x26f0a8[_0x33ca2f(0x257)](_0x2d2c91=>_0x2d2c91[_0x33ca2f(0x22e)]===_0x33ca2f(0x277)),_0x287fbd=_0x26f0a8[_0x33ca2f(0x257)](_0x3743b5=>_0x3743b5[_0x33ca2f(0x22e)]==='update'),_0x4674b8=_0x26f0a8[_0x33ca2f(0x257)](_0x27ac75=>_0x27ac75[_0x33ca2f(0x22e)]===_0x33ca2f(0x291)),_0x177fee=Array[_0x33ca2f(0x2de)](_0x19905c)[_0x33ca2f(0x2dc)](),_0x1ed898=_0x5559ca?![]:_0x3693c0['length']>0x0||_0x2bb7e2[_0x33ca2f(0x2b3)]>0x0||_0x1b92f6[_0x33ca2f(0x2b3)]>0x0,_0x2d664d=_0x3bc40d[_0x33ca2f(0x2b3)]>0x0||_0x424830[_0x33ca2f(0x2b3)]>0x0||_0x4a728b[_0x33ca2f(0x2b3)]>0x0,_0x1954de=_0x5559ca?![]:_0x26f0a8[_0x33ca2f(0x2b3)]>0x0,_0x24203c=_0x177fee[_0x33ca2f(0x2b3)]>0x0;return{'segments':{'new':_0x3693c0,'changed':_0x2bb7e2,'unchanged':_0x3edde9,'toDelete':_0x1b92f6},'journeys':{'new':_0x3bc40d,'changed':_0x424830,'unchanged':_0x32dbc8,'toDelete':_0x4a728b},'activations':{'all':_0x26f0a8,'toCreate':_0x12fed1,'toUpdate':_0x287fbd,'toDelete':_0x4674b8},'folders':{'toCreate':_0x177fee},'counts':{'segments':{'new':_0x3693c0[_0x33ca2f(0x2b3)],'changed':_0x2bb7e2[_0x33ca2f(0x2b3)],'unchanged':_0x3edde9[_0x33ca2f(0x2b3)],'toDelete':_0x1b92f6['length']},'journeys':{'new':_0x3bc40d['length'],'changed':_0x424830['length'],'unchanged':_0x32dbc8[_0x33ca2f(0x2b3)],'toDelete':_0x4a728b[_0x33ca2f(0x2b3)]},'activations':{'create':_0x12fed1[_0x33ca2f(0x2b3)],'update':_0x287fbd[_0x33ca2f(0x2b3)],'delete':_0x4674b8[_0x33ca2f(0x2b3)]},'folders':_0x177fee['length']},'hasChanges':_0x1ed898||_0x2d664d||_0x1954de||_0x24203c};}export async function buildPushExecutionContext(_0x3a1673,_0xc3bc86,_0x472dc6,_0x1eeafa,_0x292fae,_0xa061e0){const _0x2461a1=a136_0x357cba,_0xf7e2f7=extractRootFolderId(_0x472dc6),{pathToId:_0x396dfe,idToPath:_0x508a9b}=buildFolderMaps(_0x292fae),_0x40bfe8=buildSegmentNameToIdMap(_0x1eeafa),_0x4f7eda=new Map(),{batchAsync:_0x4c8dfd}=await import(_0x2461a1(0x22c)),[_0x2e5d34,_0xa307ff]=await Promise[_0x2461a1(0x2e2)]([_0x3a1673['user'][_0x2461a1(0x24f)](),_0x3a1673[_0x2461a1(0x2cc)][_0x2461a1(0x21e)](),((async()=>{!_0xa061e0&&_0x1eeafa['length']>0x0&&await _0x4c8dfd(_0x1eeafa,async _0x12d634=>{const _0xedcec4=a136_0x1e1e,_0x31bf9c=await _0x3a1673[_0xedcec4(0x27c)]['listActivations'](_0xc3bc86,_0x12d634['id']);_0x4f7eda['set'](_0x12d634['id'],_0x31bf9c);});})())]),{emailToId:_0x451389,idToEmail:_0x4a9fae}=_0x2e5d34,_0x462fc2=buildConnectionMaps(_0xa307ff);return{'rootFolderId':_0xf7e2f7,'folderPathToId':_0x396dfe,'folderIdToPath':_0x508a9b,'segmentNameToId':_0x40bfe8,'activationsBySegmentId':_0x4f7eda,'emailToIdMap':_0x451389,'idToEmailMap':_0x4a9fae,'connectionNameToIdMap':_0x462fc2['nameToId'],'connectionIdToNameMap':_0x462fc2[_0x2461a1(0x260)],'connectionNameToTypeMap':_0x462fc2[_0x2461a1(0x23b)]};}export function createPushYamlContextForBundle(_0x2f1bb6,_0x22c3de,_0x43d31d,_0x3e943b,_0x2d46d2,_0x42a516,_0x9998ab,_0x3c3a0f){const {existingLocalSegmentNames:_0x31c2e9,localExpandedRuleToNames:_0x1897ed}=_0x3e943b,_0x145a3c=new Set(),_0x56516e=new Map(),_0x2fefda=new Map(),_0x374d0f=new Map(),_0x530029=createJumpTargetCache(),_0x11999c=new Map(),_0x4d43a3=new Map(),_0x1ae375=new Set();let _0xc7398c;const _0x50cca7=_0x40fbfb=>{const _0x51c67d={'resolveSegment':async _0x1dd49c=>{const _0x4b3814=a136_0x1e1e,_0xd2ec19=_0x374d0f[_0x4b3814(0x20a)](_0x1dd49c);if(_0xd2ec19!==undefined)return{'name':_0xd2ec19,'isJourneyLocal':!![]};try{const _0x162e3c=await fetchSegment(_0x2f1bb6,_0x22c3de,_0x1dd49c,_0x43d31d);if(!_0x162e3c)throw new Error(_0x4b3814(0x2f0));const _0xcb443=generateJourneyLocalName(_0x162e3c[_0x4b3814(0x2e8)]),_0x168c20=_0x162e3c[_0x4b3814(0x2d0)]===SEGMENT_KIND_JOURNEY&&_0xcb443!==undefined;let _0x16852e=_0x162e3c[_0x4b3814(0x2e8)],_0x1a2aac;if(_0x168c20&&_0x162e3c[_0x4b3814(0x25e)]){const _0x1e4628=apiRuleToYaml(_0x162e3c[_0x4b3814(0x25e)]);_0x4d43a3[_0x4b3814(0x278)](_0x1dd49c,_0x1e4628);const _0x4f5b0b=async _0x1bbc9e=>{const _0x52dbe1=_0x4b3814,_0x1893fe=collectSegmentRefsFromRule(_0x1bbc9e);for(const _0x4193a5 of _0x1893fe){if(!_0x4d43a3[_0x52dbe1(0x1f4)](_0x4193a5))try{const _0x546903=await fetchSegment(_0x2f1bb6,_0x22c3de,_0x4193a5,_0x43d31d);if(_0x546903?.[_0x52dbe1(0x25e)]){const _0x4a2938=apiRuleToYaml(_0x546903[_0x52dbe1(0x25e)]);_0x4d43a3[_0x52dbe1(0x278)](_0x4193a5,_0x4a2938),await _0x4f5b0b(_0x4a2938);}}catch(_0x189212){logger[_0x52dbe1(0x2d3)](_0x52dbe1(0x220)+_0x4193a5+':\x20'+_0x189212);}}};await _0x4f5b0b(_0x1e4628);const _0x281ce8=serializeExpandedRule(_0x1e4628,_0x4d43a3),_0x37f874=_0x1897ed[_0x4b3814(0x20a)](_0x281ce8);if(_0x37f874&&_0x37f874[_0x4b3814(0x2b3)]>0x0){const _0x478a6f=_0x56516e[_0x4b3814(0x20a)](_0x281ce8)||0x0,_0x40a817=_0x37f874[_0x478a6f]||_0x37f874[_0x37f874['length']-0x1];_0x56516e[_0x4b3814(0x278)](_0x281ce8,_0x478a6f+0x1),_0x16852e=_0x40a817,_0x145a3c[_0x4b3814(0x256)](_0x16852e),_0x374d0f[_0x4b3814(0x278)](_0x1dd49c,_0x16852e);const _0x1d9834=await resolveRuleSegmentRefs(_0x1e4628,async _0x18a746=>{const _0x28b5b2=_0x4b3814,_0x39a4ad=_0x374d0f['get'](_0x18a746);if(_0x39a4ad)return _0x39a4ad;const _0x811f85=await _0xc7398c[_0x28b5b2(0x21a)](_0x18a746);return _0x811f85[_0x28b5b2(0x2e8)];});_0x1a2aac={'description':_0x162e3c[_0x4b3814(0x2a7)],'rule':_0x1d9834};}else{const _0x5b26fe=_0x11999c['get'](_0x281ce8);if(_0x5b26fe)_0x16852e=_0x5b26fe,_0x374d0f[_0x4b3814(0x278)](_0x1dd49c,_0x16852e);else{if(_0xcb443){let _0x5cd35a=_0xcb443,_0x56b69e=0x2;while(_0x145a3c[_0x4b3814(0x1f4)](_0x5cd35a)||_0x31c2e9[_0x4b3814(0x1f4)](_0x5cd35a)){_0x5cd35a=_0xcb443+'_'+_0x56b69e,_0x56b69e++;}_0x145a3c[_0x4b3814(0x256)](_0x5cd35a),_0x16852e=_0x5cd35a;}_0x374d0f[_0x4b3814(0x278)](_0x1dd49c,_0x16852e),_0x11999c[_0x4b3814(0x278)](_0x281ce8,_0x16852e);const _0x2bdc86=await resolveRuleSegmentRefs(_0x1e4628,async _0x2345f7=>{const _0x4b12db=_0x374d0f['get'](_0x2345f7);if(_0x4b12db)return _0x4b12db;const _0x5ba4e7=await _0xc7398c['resolveSegment'](_0x2345f7);return _0x5ba4e7['name'];});_0x1a2aac={'description':_0x162e3c[_0x4b3814(0x2a7)],'rule':_0x2bdc86};}}}return{'name':_0x16852e,'isJourneyLocal':_0x168c20,'definition':_0x1a2aac};}catch(_0x281904){return logger[_0x4b3814(0x2d3)](_0x4b3814(0x251)+_0x1dd49c+':\x20'+_0x281904),{'name':_0x1dd49c,'isJourneyLocal':![]};}},'resolveActivation':async _0x1bcc61=>{const _0x4ea7bf=a136_0x1e1e,_0x1972c1=_0x2fefda[_0x4ea7bf(0x20a)](_0x1bcc61);if(_0x1972c1!==undefined)return{'name':_0x1972c1,'isJourneyLocal':!![]};try{let _0xe3a7c1=_0x9998ab?.[_0x4ea7bf(0x20a)](_0x1bcc61);!_0xe3a7c1&&(_0xe3a7c1=await _0x2f1bb6[_0x4ea7bf(0x22d)][_0x4ea7bf(0x2a9)](_0x40fbfb,_0x1bcc61));const _0x1c5a67=_0xe3a7c1[_0x4ea7bf(0x2c8)][_0x4ea7bf(0x24a)][_0x4ea7bf(0x2e8)]||_0x1bcc61,_0x52f8be=sanitizeYamlKey(_0x1c5a67)||_0x4ea7bf(0x26f)+_0x1bcc61,_0x4f72e7=_0x52f8be;_0x2fefda[_0x4ea7bf(0x278)](_0x1bcc61,_0x4f72e7);const _0x39dc17=journeyActivationStepToYaml(_0xe3a7c1,_0x2d46d2,_0x42a516);return{'name':_0x4f72e7,'isJourneyLocal':!![],'definition':_0x39dc17};}catch(_0x7be0f0){return logger[_0x4ea7bf(0x2d3)](_0x4ea7bf(0x259)+_0x1bcc61+':\x20'+_0x7be0f0),{'name':_0x1bcc61,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2c4b5b,_0x3eee0f)=>resolveJumpTarget(_0x2c4b5b,_0x3eee0f,_0x530029,async _0x50cf08=>{const _0x14b5d=a136_0x1e1e,_0x1f3ab0=_0x3c3a0f?.['get'](_0x50cf08);if(_0x1f3ab0)return _0x1f3ab0;return _0x2f1bb6[_0x14b5d(0x22d)][_0x14b5d(0x2b2)](_0x50cf08);})};return _0xc7398c=_0x51c67d,_0x51c67d;},_0x104c72=async _0x5df58c=>{const _0x12b3d7=a136_0x1e1e,{collectSegmentIdsFromJourneyApi:_0x3c324d}=await import(_0x12b3d7(0x200)),{batchAsync:_0x130bd1}=await import(_0x12b3d7(0x22c)),_0x5a5c34=new Set();for(const _0x31180c of _0x5df58c){let _0x1f9f58=_0x3c3a0f?.[_0x12b3d7(0x20a)](_0x31180c);!_0x1f9f58&&(_0x1f9f58=await _0x2f1bb6[_0x12b3d7(0x22d)][_0x12b3d7(0x2b2)](_0x31180c));const _0xf84256=_0x3c324d(_0x1f9f58);for(const _0x219c4e of _0xf84256){_0x5a5c34[_0x12b3d7(0x256)](_0x219c4e);}}let _0x39ed93=Array['from'](_0x5a5c34);while(_0x39ed93[_0x12b3d7(0x2b3)]>0x0){const _0x435c35=_0x39ed93[_0x12b3d7(0x257)](_0x410f2d=>!_0x1ae375[_0x12b3d7(0x1f4)](_0x410f2d));if(_0x435c35[_0x12b3d7(0x2b3)]===0x0)break;const _0x201761=await _0x130bd1(_0x435c35,async _0x5c3dc9=>{_0x1ae375['add'](_0x5c3dc9);const _0x2a87a5=await fetchSegment(_0x2f1bb6,_0x22c3de,_0x5c3dc9,_0x43d31d);if(!_0x2a87a5)return null;return{'segmentId':_0x5c3dc9,'segment':_0x2a87a5};},0xa),_0x1ee317=new Set();for(const _0x421e45 of _0x201761){if(!_0x421e45?.[_0x12b3d7(0x27c)]?.[_0x12b3d7(0x25e)])continue;const _0x49dbcc=apiRuleToYaml(_0x421e45[_0x12b3d7(0x27c)][_0x12b3d7(0x25e)]);_0x4d43a3[_0x12b3d7(0x278)](_0x421e45[_0x12b3d7(0x235)],_0x49dbcc);const _0x1f6798=collectSegmentRefsFromRule(_0x49dbcc);for(const _0x227fa2 of _0x1f6798){!_0x1ae375[_0x12b3d7(0x1f4)](_0x227fa2)&&_0x1ee317['add'](_0x227fa2);}}_0x39ed93=Array[_0x12b3d7(0x2de)](_0x1ee317);}};return{'createYamlContext':_0x50cca7,'prefetchJourneySegments':_0x104c72};}export async function executePushSegments(_0x50f05a,_0x189d11,_0x26a95a,_0x243de9,_0x4f89a1){const _0x563034=a136_0x357cba,{segmentDefToCreateRequest:_0x1fadae,segmentDefToUpdateRequest:_0x2b1863}=await import(_0x563034(0x227)),_0x10f424=_0x26a95a[_0x563034(0x25c)],_0x1cb70b=0x5,_0x2a9e03=async _0x5b16aa=>{const _0x2ac060=_0x563034,_0xb55e94=_0x5b16aa['folderPath']?_0x10f424[_0x2ac060(0x20a)](_0x5b16aa[_0x2ac060(0x29d)]):undefined;let _0x338ea1;const _0x2ab97c={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x381d41=_0x5b16aa['yamlConfig'];if(_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x25e)]){const _0x5f0c71=createSegmentIdResolver(_0x26a95a['segmentNameToId'],_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]),_0xd62583=await resolveRuleSegmentIds(_0x5b16aa[_0x2ac060(0x276)]['rule'],_0x5f0c71);_0x381d41={..._0x5b16aa['yamlConfig'],'rule':_0xd62583};}try{if(_0x5b16aa['isNew']){_0x4f89a1['onProgress']?.({'type':_0x2ac060(0x296),'name':_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]});const _0x866aa7=_0x1fadae(_0x381d41,_0xb55e94),_0x4f875d=await _0x4f89a1[_0x2ac060(0x2e7)](_0x2ac060(0x288)+_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)]+_0x2ac060(0x292),()=>_0x50f05a[_0x2ac060(0x27c)][_0x2ac060(0x27d)](_0x243de9[_0x2ac060(0x25f)],_0x866aa7));_0x338ea1=_0x4f875d[_0x2ac060(0x2cb)]['id'],_0x26a95a[_0x2ac060(0x20f)][_0x2ac060(0x278)](_0x5b16aa['yamlConfig']['name'],_0x338ea1),_0x2ab97c[_0x2ac060(0x1fa)]={'name':_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)],'id':_0x338ea1},_0x4f89a1[_0x2ac060(0x275)]?.({'type':_0x2ac060(0x285),'name':_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)],'segmentId':_0x338ea1}),_0x4f89a1[_0x2ac060(0x289)]?.('Created\x20segment\x20\x27'+_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]+'\x27'),_0x2ab97c[_0x2ac060(0x28c)]=0x1;}else{if(_0x5b16aa[_0x2ac060(0x2ab)]){_0x4f89a1[_0x2ac060(0x275)]?.({'type':_0x2ac060(0x23f),'name':_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)]});const _0x5f3b3f=_0x2b1863(_0x381d41);_0xb55e94!==_0x5b16aa[_0x2ac060(0x271)]?.[_0x2ac060(0x2e5)]&&(_0x5f3b3f['segmentFolderId']=_0xb55e94?parseInt(_0xb55e94,0xa):undefined),await _0x4f89a1[_0x2ac060(0x2e7)](_0x2ac060(0x224)+_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]+_0x2ac060(0x292),()=>_0x50f05a[_0x2ac060(0x27c)]['updateSegmentById'](_0x243de9[_0x2ac060(0x25f)],_0x5b16aa[_0x2ac060(0x271)]['id'],_0x5f3b3f)),_0x338ea1=_0x5b16aa['existingSegment']['id'],_0x4f89a1[_0x2ac060(0x275)]?.({'type':_0x2ac060(0x2c6),'name':_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]}),_0x4f89a1['logSuccess']?.(_0x2ac060(0x2a8)+_0x5b16aa[_0x2ac060(0x276)][_0x2ac060(0x2e8)]+'\x27'),_0x2ab97c[_0x2ac060(0x22b)]=0x1;}else _0x338ea1=_0x5b16aa[_0x2ac060(0x271)]['id'];}}catch(_0x565252){const _0x6d5d2b=isHttp400Error(_0x565252),_0x302d35=_0x6d5d2b?ErrorCode[_0x2ac060(0x234)]:ErrorCode[_0x2ac060(0x1f7)],_0x5e5928=getErrorMessage(_0x565252);throw new SDKError(_0x302d35,_0x2ac060(0x2af)+(_0x5b16aa[_0x2ac060(0x232)]?_0x2ac060(0x277):_0x2ac060(0x23d))+_0x2ac060(0x261)+_0x5b16aa[_0x2ac060(0x2b5)]+'\x0a\x20\x20'+_0x5e5928,_0x565252);}try{const _0x59280c=await syncActivationsForSegment(_0x50f05a,_0x243de9[_0x2ac060(0x25f)],_0x338ea1,_0x5b16aa['yamlConfig'][_0x2ac060(0x2e8)],_0x5b16aa['activationActions'],_0x4f89a1,_0x5b16aa[_0x2ac060(0x2b5)]);_0x2ab97c['activations']=_0x59280c;}catch(_0x130fda){if(_0x130fda instanceof SDKError)throw _0x130fda;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2ac060(0x248)+_0x5b16aa[_0x2ac060(0x276)]['name']+_0x2ac060(0x229)+_0x5b16aa[_0x2ac060(0x2b5)]+_0x2ac060(0x21c)+getErrorMessage(_0x130fda),_0x130fda);}return _0x2ab97c;},_0x25cde6=await batchAsync(_0x189d11,_0x2a9e03,_0x1cb70b),_0x4f00ad={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x1e8a07 of _0x25cde6){_0x4f00ad['created']+=_0x1e8a07[_0x563034(0x28c)],_0x4f00ad[_0x563034(0x22b)]+=_0x1e8a07['updated'],_0x1e8a07['createdSegmentId']&&_0x4f00ad['createdSegmentIds'][_0x563034(0x278)](_0x1e8a07['createdSegmentId'][_0x563034(0x2e8)],_0x1e8a07[_0x563034(0x1fa)]['id']),_0x4f00ad[_0x563034(0x1f5)]['created']+=_0x1e8a07[_0x563034(0x1f5)][_0x563034(0x28c)],_0x4f00ad['activations'][_0x563034(0x22b)]+=_0x1e8a07[_0x563034(0x1f5)][_0x563034(0x22b)],_0x4f00ad[_0x563034(0x1f5)][_0x563034(0x2d6)]+=_0x1e8a07['activations'][_0x563034(0x2d6)];}return _0x4f00ad;}async function syncActivationsForSegment(_0x45e2e8,_0x1ec732,_0x426de3,_0xb3080f,_0x44ee6c,_0x4a65a3,_0x2226c8){const _0x3e2b6d=a136_0x357cba,_0x2da6b7={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x4532a0 of _0x44ee6c){try{if(_0x4532a0[_0x3e2b6d(0x22e)]===_0x3e2b6d(0x277)&&_0x4532a0[_0x3e2b6d(0x2b1)])_0x4a65a3['onProgress']?.({'type':_0x3e2b6d(0x2c9),'segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),await _0x4a65a3[_0x3e2b6d(0x2e7)](_0x3e2b6d(0x2a3)+_0x4532a0[_0x3e2b6d(0x2e8)]+_0x3e2b6d(0x292),()=>_0x45e2e8['segment'][_0x3e2b6d(0x216)](_0x1ec732,_0x426de3,_0x4532a0[_0x3e2b6d(0x2b1)])),_0x4a65a3[_0x3e2b6d(0x275)]?.({'type':_0x3e2b6d(0x239),'segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),_0x4a65a3[_0x3e2b6d(0x289)]?.(_0x3e2b6d(0x2bb)+_0x4532a0[_0x3e2b6d(0x2e8)]+'\x27'),_0x2da6b7[_0x3e2b6d(0x28c)]++;else{if(_0x4532a0[_0x3e2b6d(0x22e)]==='update'&&_0x4532a0[_0x3e2b6d(0x2b1)]&&_0x4532a0[_0x3e2b6d(0x27b)])_0x4a65a3[_0x3e2b6d(0x275)]?.({'type':_0x3e2b6d(0x2f2),'segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),await _0x4a65a3[_0x3e2b6d(0x2e7)](_0x3e2b6d(0x264)+_0x4532a0['name']+'\x27...',()=>_0x45e2e8['segment'][_0x3e2b6d(0x28d)](_0x1ec732,_0x426de3,_0x4532a0['existingActivation']['id'],_0x4532a0['validatedRequest'])),_0x4a65a3['onProgress']?.({'type':_0x3e2b6d(0x23c),'segmentName':_0xb3080f,'activationName':_0x4532a0['name']}),_0x4a65a3[_0x3e2b6d(0x289)]?.(_0x3e2b6d(0x203)+_0x4532a0[_0x3e2b6d(0x2e8)]+'\x27'),_0x2da6b7[_0x3e2b6d(0x22b)]++;else _0x4532a0[_0x3e2b6d(0x22e)]===_0x3e2b6d(0x291)&&_0x4532a0[_0x3e2b6d(0x27b)]&&(_0x4a65a3[_0x3e2b6d(0x275)]?.({'type':'activation_deleting','segmentName':_0xb3080f,'activationName':_0x4532a0[_0x3e2b6d(0x2e8)]}),await _0x4a65a3['withProgress'](_0x3e2b6d(0x2aa)+_0x4532a0[_0x3e2b6d(0x2e8)]+_0x3e2b6d(0x292),()=>_0x45e2e8[_0x3e2b6d(0x27c)][_0x3e2b6d(0x2e3)](_0x1ec732,_0x426de3,_0x4532a0[_0x3e2b6d(0x27b)]['id'])),_0x4a65a3['onProgress']?.({'type':_0x3e2b6d(0x2c0),'segmentName':_0xb3080f,'activationName':_0x4532a0['name']}),_0x4a65a3[_0x3e2b6d(0x2ed)]?.(_0x3e2b6d(0x246)+_0x4532a0['name']+'\x27'),_0x2da6b7['deleted']++);}}catch(_0x13bb19){const _0x1fd21c=isHttp400Error(_0x13bb19),_0x3bf603=_0x1fd21c?ErrorCode[_0x3e2b6d(0x207)]:ErrorCode[_0x3e2b6d(0x263)],_0x56cad2=getErrorMessage(_0x13bb19);throw new SDKError(_0x3bf603,'Failed\x20to\x20'+_0x4532a0[_0x3e2b6d(0x22e)]+_0x3e2b6d(0x28e)+_0x4532a0[_0x3e2b6d(0x2e8)]+_0x3e2b6d(0x229)+_0x2226c8+_0x3e2b6d(0x21c)+_0x56cad2,_0x13bb19);}}return _0x2da6b7;}export async function executePushFolders(_0x533952,_0x5ababa,_0x79c06b,_0x33be98,_0x1621a2){const _0x5b38b8=a136_0x357cba,_0x45e02a=new Map(_0x79c06b),_0x591fb5=sortFoldersByDepth(_0x5ababa);for(const _0x142bb0 of _0x591fb5){const _0x2c972c=_0x142bb0[_0x5b38b8(0x206)]('/'),_0x76860d=_0x2c972c[_0x2c972c[_0x5b38b8(0x2b3)]-0x1],_0x20262e=_0x2c972c[_0x5b38b8(0x29b)](0x0,-0x1)[_0x5b38b8(0x290)]('/'),_0xeef736=_0x45e02a[_0x5b38b8(0x20a)](_0x20262e);_0x1621a2[_0x5b38b8(0x275)]?.({'type':'folder_creating','folder':_0x142bb0});const _0x58a486={'name':_0x76860d,'parentFolderId':_0xeef736},_0x543041=await _0x1621a2[_0x5b38b8(0x2e7)](_0x5b38b8(0x27a)+_0x142bb0+_0x5b38b8(0x292),()=>_0x533952[_0x5b38b8(0x27c)][_0x5b38b8(0x20c)](_0x33be98[_0x5b38b8(0x25f)],_0x58a486));_0x45e02a['set'](_0x142bb0,_0x543041[_0x5b38b8(0x2cb)]['id']),_0x1621a2[_0x5b38b8(0x275)]?.({'type':_0x5b38b8(0x236),'folder':_0x142bb0,'folderId':_0x543041[_0x5b38b8(0x2cb)]['id']}),_0x1621a2[_0x5b38b8(0x26b)]?.(_0x5b38b8(0x2f6)+_0x142bb0+'\x27');}return _0x45e02a;}function a136_0x3ed0(){const _0x4d9629=['created','updateActivation','\x20activation\x20\x27','draft','join','delete','\x27...','188570twaieq','journeyActivationNameToId','uniqueSegmentName','segment_creating','with','journey_updating','uniqueServerName','tdx.sdk.push-workflow','slice','sha1','folderPath','schedule','journeyId','embeddedSegmentNameToId','SEGMENT_NOT_FOUND','flatMap','Creating\x20activation\x20\x27','conditions','updateSegmentById','progress','description','Updated\x20segment\x20\x27','getActivation','Deleting\x20activation\x20\x27','hasChanges','versionNumber','\x27\x20for\x20','utf-8','Failed\x20to\x20','):\x20','validatedRequest','getJourney','length','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','absolutePath','\x27\x20milestone','journeyStages','\x27\x20wait\x20condition','push','journeyName','Created\x20activation\x20\x27','\x27\x20entry\x20criteria','77QifsxD','decision_point','stage\x20\x27','activation_deleted','branches','Fetching\x20','embedded_activation_creating','Entry\x20criteria:\x20','Stage\x20\x27','segment_updated','waitStep','attributes','activation_creating','createJourneySegment','data','connection','effectiveFolderId','journeyById','812002JFxABx','kind','journey_creating','action','debug','map','folder','deleted','getSegment\x20failed\x20for\x20','existingSegments','existingJourney','diff','conditionTimeoutUnit','sort','activationsBySegmentId','from','skipSegments','size','index','all','deleteActivation','entry_criteria','segmentFolderId','values','withProgress','name','stages','match','run_after_journey_refresh','getLatestJourneyId','logDeleted','behavior','271368VxuBqP','Segment\x20not\x20found','1707990MIHGsL','activation_updating','deps','item','exitCriterias','Created\x20folder\x20\x27','has','activations',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','SEGMENT_UPDATE_ERROR','1lUKufs','\x20error(s)','createdSegmentId','3503065XZInUd','journey_created','toLowerCase','idToEmailMap','max','./journey-yaml.js','parse','connector_config','Updated\x20activation\x20\x27','startsWith','journeyBundleId','split','ACTIVATION_SYNTAX_ERROR','activationContext','\x27\x20decision\x20point\x20branch\x20\x27','get','Deleted\x20segment\x20\x27','createFolder','rootFolderId','all_columns','segmentNameToId','replace','Matched\x20server\x20segment\x20\x27','keys','yamlActivation','entryCriteria','getSegmentEntity','createActivation','object','Activation','Created\x20journey\x20\x27','resolveSegment','activationActions','\x0a\x20\x20','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','list','355280AfTxFi','Failed\x20to\x20fetch\x20referenced\x20segment\x20','NOT_FOUND','journey_entry_criteria_','trim','Updating\x20segment\x20\x27','\x20journey\x20from\x20file:\x20','Journey\x20\x27','./child-segment-yaml.js','errors','\x27\x20from\x20file:\x20','activation_template_id','updated','../../utils/async.js','journey','type','goal\x20criteria','reduce','Activation\x20not\x20found:\x20','isNew','segment_deleted','SEGMENT_SYNTAX_ERROR','segmentId','folder_created','journeyBundleName','notification','activation_created','steps','nameToType','activation_updated','update','activationStepsById','segment_updating','.$1.push-recovery.json','connectionIdToNameMap','relative','goal','toISOString','parseDocument','Deleted\x20activation\x20\x27','milestone','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','JOURNEY_UPDATE_ERROR','activationParams','Delete\x20the\x20push\x20recovery\x20file\x20(','fetchJourney','Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context','Segment\x20not\x20found:\x20','buildUserMaps','some','Failed\x20to\x20resolve\x20segment\x20','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','embedded_segment_created','333JXnkem','entries','add','filter','day','Failed\x20to\x20resolve\x20activation\x20','embedded_activation_created','parentSegmentFolder','folderPathToId','resolvedRule','rule','parentId','idToName','\x20segment\x20from\x20file:\x20','conditionTimeoutDuration','ACTIVATION_UPDATE_ERROR','Updating\x20activation\x20\x27','WaitStep','logWarning','waitStepUnit','getSegmentEntity\x20also\x20failed\x20for\x20','conditionSegmentId','columns','logInfo','1523388WadKEB','journeyActivationStepId','valid','activation_','segmentByFolderAndName','existingSegment','__pending_act_','toString','journey_updated','onProgress','yamlConfig','create','set','folderId','Creating\x20folder\x20\x27','existingActivation','segment','createSegment','state','journeys','find','INTERNAL','listActivations','DecisionPoint','segments','segment_created','\x20(referenced\x20in\x20journey\x20','stringify','Creating\x20segment\x20\x27','logSuccess','\x27\x20exit\x20criteria','waitStepType'];a136_0x3ed0=function(){return _0x4d9629;};return a136_0x3ed0();}export async function executePushSegmentDeletions(_0x23d8c6,_0x181b2d,_0x174392){const _0x3f63fa=a136_0x357cba;if(_0x181b2d[_0x3f63fa(0x2b3)]===0x0)return 0x0;const {batchAsync:_0x8f167b}=await import(_0x3f63fa(0x22c)),_0x5219bd=0x5,_0x1fbe59=await _0x8f167b(_0x181b2d,async _0x246094=>{const _0x22cfc6=_0x3f63fa;return _0x174392[_0x22cfc6(0x275)]?.({'type':'segment_deleting','name':_0x246094[_0x22cfc6(0x2e8)]}),await _0x23d8c6[_0x22cfc6(0x27c)]['deleteSegment'](_0x246094['id']),_0x174392[_0x22cfc6(0x275)]?.({'type':_0x22cfc6(0x233),'name':_0x246094['name']}),_0x174392[_0x22cfc6(0x2ed)]?.(_0x22cfc6(0x20b)+_0x246094[_0x22cfc6(0x2e8)]+'\x27'),0x1;},_0x5219bd);return _0x1fbe59[_0x3f63fa(0x230)]((_0x189325,_0x40523e)=>_0x189325+_0x40523e,0x0);}export async function executePushJourneys(_0x571193,_0xfd2ca9,_0x1a237b,_0x6d0a12,_0x55a10c){const _0x5b74d3=a136_0x357cba,{journeyDefToRequest:_0x1c2578}=await import(_0x5b74d3(0x200)),{activationDefToCreateRequest:_0x208b6b,yamlRuleToApi:_0x319d18,validateSegmentRule:_0x342be}=await import(_0x5b74d3(0x227)),_0x4151a5={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x49798e=new Map(_0x1a237b[_0x5b74d3(0x20f)]),_0x38f6c8=0x5;for(let _0x2f73b2=0x0;_0x2f73b2<_0xfd2ca9[_0x5b74d3(0x2b3)];_0x2f73b2+=_0x38f6c8){const _0x102e12=_0xfd2ca9[_0x5b74d3(0x29b)](_0x2f73b2,_0x2f73b2+_0x38f6c8),_0x25f1a9=await Promise['all'](_0x102e12['map'](async _0x4e6227=>{const _0x29bd6b=_0x5b74d3;if(!_0x4e6227[_0x29bd6b(0x232)]&&!_0x4e6227[_0x29bd6b(0x2ab)])return{'action':'unchanged','name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)],'journeyId':_0x4e6227[_0x29bd6b(0x2d9)]?.['id']};const _0x2b119f=_0x4e6227[_0x29bd6b(0x29d)]?_0x1a237b[_0x29bd6b(0x25c)][_0x29bd6b(0x20a)](_0x4e6227[_0x29bd6b(0x29d)]):undefined;_0x55a10c[_0x29bd6b(0x275)]?.({'type':_0x4e6227[_0x29bd6b(0x232)]?_0x29bd6b(0x2d1):_0x29bd6b(0x298),'name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)]});try{const _0x257fd8=await executeSingleJourneyPush(_0x571193,_0x4e6227,{..._0x1a237b,'segmentNameToId':_0x49798e},{'parentId':_0x6d0a12[_0x29bd6b(0x25f)],'rootFolderId':_0x6d0a12[_0x29bd6b(0x20d)],'folderId':_0x2b119f,'verbose':_0x6d0a12['verbose']},_0x55a10c,{'journeyDefToRequest':_0x1c2578,'activationDefToCreateRequest':_0x208b6b,'yamlRuleToApi':_0x319d18,'validateSegmentRule':_0x342be});for(const [_0x3442d6,_0x31e941]of _0x257fd8[_0x29bd6b(0x2a0)]){_0x49798e[_0x29bd6b(0x278)](_0x3442d6,_0x31e941),_0x4151a5[_0x29bd6b(0x2a0)][_0x29bd6b(0x278)](_0x3442d6,_0x31e941);}if(_0x257fd8['action']===_0x29bd6b(0x28c))_0x55a10c['onProgress']?.({'type':_0x29bd6b(0x1fc),'name':_0x4e6227['yamlConfig'][_0x29bd6b(0x2e8)],'journeyId':_0x257fd8[_0x29bd6b(0x29f)]}),_0x55a10c[_0x29bd6b(0x289)]?.(_0x29bd6b(0x219)+_0x4e6227['yamlConfig'][_0x29bd6b(0x2e8)]+'\x27'),_0x4151a5['created']++;else _0x257fd8[_0x29bd6b(0x2d2)]===_0x29bd6b(0x22b)&&(_0x55a10c[_0x29bd6b(0x275)]?.({'type':_0x29bd6b(0x274),'name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)]}),_0x55a10c[_0x29bd6b(0x289)]?.('Updated\x20journey\x20\x27'+_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)]+'\x27'),_0x4151a5[_0x29bd6b(0x22b)]++);return{'action':_0x257fd8[_0x29bd6b(0x2d2)],'name':_0x4e6227[_0x29bd6b(0x276)][_0x29bd6b(0x2e8)],'journeyId':_0x257fd8[_0x29bd6b(0x29f)]};}catch(_0x20755b){const _0x54437b=isHttp400Error(_0x20755b),_0x34ffad=_0x54437b?ErrorCode['JOURNEY_SYNTAX_ERROR']:ErrorCode[_0x29bd6b(0x249)],_0x1d2723=getErrorMessage(_0x20755b);throw new SDKError(_0x34ffad,_0x29bd6b(0x2af)+(_0x4e6227[_0x29bd6b(0x232)]?_0x29bd6b(0x277):'update')+_0x29bd6b(0x225)+_0x4e6227[_0x29bd6b(0x2b5)]+_0x29bd6b(0x21c)+_0x1d2723,_0x20755b);}}));_0x4151a5['results'][_0x5b74d3(0x2b9)](..._0x25f1a9);}return _0x4151a5;}async function matchExistingJourneySegments(_0x1769cf,_0x2ddc94,_0x240ae3,_0x2cd3b1,_0xa964ed){const _0x1b9541=a136_0x357cba;if(!_0x2ddc94[_0x1b9541(0x2d9)]||!_0x2ddc94[_0x1b9541(0x276)]['segments'])return;const _0x44de4d=new Map(),_0x5f0bde=new Set();for(const _0x2a2c15 of Object[_0x1b9541(0x212)](_0x2ddc94['yamlConfig'][_0x1b9541(0x284)])){const _0x70f3a5=generateDeterministicJourneySegmentName(_0x2ddc94[_0x1b9541(0x276)][_0x1b9541(0x2e8)],_0x2a2c15);_0x44de4d[_0x1b9541(0x278)](_0x70f3a5,_0x2a2c15),_0x5f0bde[_0x1b9541(0x256)](_0x2a2c15);}const _0x1fbe3d=[],_0x7b8520=collectSegmentIdsFromJourneyApi(_0x2ddc94[_0x1b9541(0x2d9)]);for(const _0x3b4e7a of _0x7b8520){const _0x447bbf=await fetchSegment(_0x1769cf,_0x240ae3,_0x3b4e7a,_0x2cd3b1);if(!_0x447bbf?.['name'])continue;const _0x4f8734=_0x44de4d[_0x1b9541(0x20a)](_0x447bbf[_0x1b9541(0x2e8)]);_0x4f8734?(_0xa964ed[_0x1b9541(0x278)](_0x4f8734,_0x3b4e7a),_0x5f0bde[_0x1b9541(0x291)](_0x4f8734)):_0x1fbe3d['push']({'id':_0x3b4e7a,'seg':_0x447bbf});}if(_0x5f0bde[_0x1b9541(0x2e0)]>0x0&&_0x1fbe3d[_0x1b9541(0x2b3)]>0x0){const {localExpandedRuleToNames:_0x2ca58c}=buildLocalExpandedRuleMappings(_0x2ddc94[_0x1b9541(0x276)]),_0x7149ee=new Map();for(const {id:_0x2e3930,seg:_0x22e719}of _0x1fbe3d){if(_0x22e719[_0x1b9541(0x25e)]){const _0x2b17bb=apiRuleToYaml(_0x22e719[_0x1b9541(0x25e)]);_0x7149ee[_0x1b9541(0x278)](_0x2e3930,_0x2b17bb);}}for(const {id:_0x491491,seg:_0x3fcedf}of _0x1fbe3d){if(!_0x3fcedf['rule'])continue;const _0x457d9f=_0x7149ee[_0x1b9541(0x20a)](_0x491491);if(!_0x457d9f)continue;const _0x5a2cd0=serializeExpandedRule(_0x457d9f,_0x7149ee),_0x141f1=_0x2ca58c[_0x1b9541(0x20a)](_0x5a2cd0);if(_0x141f1){const _0x4fff46=_0x141f1[_0x1b9541(0x280)](_0x1d27ed=>_0x5f0bde[_0x1b9541(0x1f4)](_0x1d27ed));_0x4fff46&&(_0xa964ed[_0x1b9541(0x278)](_0x4fff46,_0x491491),_0x5f0bde[_0x1b9541(0x291)](_0x4fff46),logger['debug'](_0x1b9541(0x211)+_0x3fcedf[_0x1b9541(0x2e8)]+'\x27\x20to\x20local\x20\x27'+_0x4fff46+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x5659e7,_0x51c86b,_0x400b80,_0xf469b7,_0x2d9e67,_0x96003){const _0x11d149=a136_0x357cba,{journeyDefToRequest:_0x420c1f,activationDefToCreateRequest:_0x3d8bb6,yamlRuleToApi:_0x138e65,validateSegmentRule:_0x3ca05b}=_0x96003,_0x5b4c84=new Map(),_0x10473b=new Map();recoverSegmentIdsFromPushRecovery(_0x51c86b,_0x5b4c84,_0x400b80[_0x11d149(0x20f)]);const _0x694cd2=new Map(),_0x448c64=new Map(),_0x133f4d=new Map();let _0x10777f;const _0x2f8981=async()=>{const _0x4a00f8=_0x11d149;if(_0x10777f)return;_0x10777f=new Map();if(!_0x51c86b[_0x4a00f8(0x2d9)])return;const _0x3d3bd9=await _0x5659e7['journey'][_0x4a00f8(0x282)](_0x51c86b[_0x4a00f8(0x2d9)]['id']);for(const _0x12f520 of _0x3d3bd9){const _0x3b377c=journeyActivationStepToYaml(_0x12f520,_0x400b80[_0x4a00f8(0x1fe)],_0x400b80[_0x4a00f8(0x241)]),_0x38a43c=activationSignature(_0x3b377c);!_0x10777f['has'](_0x38a43c)&&_0x10777f[_0x4a00f8(0x278)](_0x38a43c,_0x12f520['id']),_0x3b377c[_0x4a00f8(0x2e8)]&&_0x10473b[_0x4a00f8(0x278)](_0x3b377c[_0x4a00f8(0x2e8)],_0x12f520['id']);}};await matchExistingJourneySegments(_0x5659e7,_0x51c86b,_0xf469b7[_0x11d149(0x25f)],_0x400b80[_0x11d149(0x2d8)],_0x400b80['segmentNameToId']);const _0x323372={'resolveSegmentId':async _0x2d908a=>{const _0x493ea3=_0x11d149,_0xd90142=_0x400b80['segmentNameToId'][_0x493ea3(0x20a)](_0x2d908a);if(!_0xd90142)throw new SDKError(ErrorCode[_0x493ea3(0x2a1)],_0x493ea3(0x24e)+_0x2d908a+_0x493ea3(0x286)+_0x51c86b['yamlConfig'][_0x493ea3(0x2e8)]+')');return _0xd90142;},'resolveEmbeddedSegmentId':async(_0x1a8b4c,_0x1b015d)=>{const _0x3ab9e6=_0x11d149,_0x1a52c4=_0x400b80[_0x3ab9e6(0x20f)][_0x3ab9e6(0x20a)](_0x1a8b4c);if(_0x1a52c4)return _0x1a52c4;const _0x747c90=_0x400b80[_0x3ab9e6(0x2d8)][_0x3ab9e6(0x280)](_0x32df10=>_0x32df10[_0x3ab9e6(0x2e8)]===_0x1a8b4c);if(_0x747c90)return _0x400b80[_0x3ab9e6(0x20f)][_0x3ab9e6(0x278)](_0x1a8b4c,_0x747c90['id']),_0x747c90['id'];if(_0x51c86b[_0x3ab9e6(0x232)]){const {stageName:_0x4b5103,criteriaName:_0x2f1c31}=findSegmentCriteriaLocation(_0x51c86b[_0x3ab9e6(0x276)],_0x1a8b4c);return _0x3ca05b(_0x1a8b4c,_0x1b015d[_0x3ab9e6(0x25e)]),_0x448c64[_0x3ab9e6(0x278)](_0x1a8b4c,{'definition':_0x1b015d,'stageName':_0x4b5103,'criteriaName':_0x2f1c31}),createPendingSegmentId(_0x1a8b4c);}const _0xb4dece=_0x51c86b[_0x3ab9e6(0x2d9)]?.['id'];if(!_0xb4dece)throw new SDKError(ErrorCode[_0x3ab9e6(0x281)],_0x3ab9e6(0x2b4));const _0x56af47=_0x694cd2[_0x3ab9e6(0x20a)](_0x1a8b4c);if(_0x56af47)return _0x56af47;const _0x2c0dfb=((async()=>{const _0x1aa12c=_0x3ab9e6;_0x3ca05b(_0x1a8b4c,_0x1b015d[_0x1aa12c(0x25e)]);const _0x13d424=generateDeterministicJourneySegmentName(_0x51c86b['yamlConfig'][_0x1aa12c(0x2e8)],_0x1a8b4c),_0x1d5322=_0x400b80['existingSegments'][_0x1aa12c(0x280)](_0x57802e=>_0x57802e['name']===_0x13d424),_0x16169c=createSegmentIdResolver(_0x400b80[_0x1aa12c(0x20f)],_0x1a8b4c),_0x1f6c3a=await resolveRuleSegmentIds(_0x1b015d['rule'],_0x16169c);let _0x39e9ff;return _0x1d5322?(await _0x5659e7[_0x1aa12c(0x27c)][_0x1aa12c(0x2a5)](_0xf469b7[_0x1aa12c(0x25f)],_0x1d5322['id'],{'description':_0x1b015d[_0x1aa12c(0x2a7)]||'Entry\x20criteria:\x20'+_0x1a8b4c,'rule':_0x138e65(_0x1f6c3a,!![]),'countPopulation':!![]}),_0x39e9ff=_0x1d5322['id'],saveSegmentToPushRecovery(_0x51c86b[_0x1aa12c(0x2b5)],_0x51c86b[_0x1aa12c(0x276)][_0x1aa12c(0x2e8)],_0x1a8b4c,{'segmentId':_0x39e9ff,'uniqueServerName':_0x13d424,'createdAt':new Date()[_0x1aa12c(0x244)]()})):_0x39e9ff=await createOrRecoverEmbeddedSegment(_0x5659e7,_0x51c86b,{'localName':_0x1a8b4c,'uniqueSegmentName':_0x13d424,'description':_0x1b015d['description']||_0x1aa12c(0x2c4)+_0x1a8b4c,'journeyId':_0xb4dece,'resolvedRule':_0x1f6c3a,'parentId':_0xf469b7[_0x1aa12c(0x25f)],'folderId':_0xf469b7[_0x1aa12c(0x20d)]||''},_0x138e65),_0x400b80[_0x1aa12c(0x20f)]['set'](_0x1a8b4c,_0x39e9ff),_0x5b4c84[_0x1aa12c(0x278)](_0x1a8b4c,_0x39e9ff),_0x39e9ff;})());_0x694cd2[_0x3ab9e6(0x278)](_0x1a8b4c,_0x2c0dfb);try{return await _0x2c0dfb;}finally{_0x694cd2[_0x3ab9e6(0x291)](_0x1a8b4c);}},'resolveActivationId':async _0x486cdc=>{const _0x3efab9=_0x11d149,_0x1fb970=_0x10473b[_0x3efab9(0x20a)](_0x486cdc);if(_0x1fb970)return _0x1fb970;if(_0x51c86b[_0x3efab9(0x2d9)]){await _0x2f8981();const _0x6cc5ba=_0x10473b[_0x3efab9(0x20a)](_0x486cdc);if(_0x6cc5ba)return _0x6cc5ba;}throw new SDKError(ErrorCode[_0x3efab9(0x221)],_0x3efab9(0x231)+_0x486cdc+'\x20(referenced\x20in\x20journey\x20'+_0x51c86b[_0x3efab9(0x276)][_0x3efab9(0x2e8)]+').\x20'+_0x3efab9(0x252));},'resolveEmbeddedActivationId':async(_0x130cb9,_0x4129b4)=>{const _0x115490=_0x11d149,_0x1fca22=_0x10473b[_0x115490(0x20a)](_0x130cb9);if(_0x1fca22)return _0x1fca22;if(_0x51c86b[_0x115490(0x232)])return _0x133f4d[_0x115490(0x278)](_0x130cb9,_0x4129b4),createPendingActivationId(_0x130cb9);if(_0x51c86b[_0x115490(0x2d9)]){await _0x2f8981();const _0x57f50a=_0x10473b[_0x115490(0x20a)](_0x4129b4[_0x115490(0x2e8)]);if(_0x57f50a)return _0x10473b['set'](_0x130cb9,_0x57f50a),_0x57f50a;const _0x1539f2=activationSignature(_0x4129b4),_0x2218e7=_0x10777f?.[_0x115490(0x20a)](_0x1539f2);if(_0x2218e7)return _0x10473b[_0x115490(0x278)](_0x130cb9,_0x2218e7),_0x2218e7;const _0x3d73f5=await _0x3d8bb6(_0x4129b4,_0x400b80[_0x115490(0x208)]),_0x114762={..._0x3d73f5,..._0x4129b4[_0x115490(0x2eb)]!==undefined&&{'runAfterJourneyRefresh':_0x4129b4[_0x115490(0x2eb)]}},_0x5b5847=await _0x5659e7[_0x115490(0x22d)][_0x115490(0x216)](_0x51c86b[_0x115490(0x2d9)]['id'],_0x114762);return _0x10473b['set'](_0x130cb9,_0x5b5847['id']),_0x5b5847['id'];}throw new SDKError(ErrorCode[_0x115490(0x281)],_0x115490(0x24d));},'resolveJourneyId':async _0x4031fd=>{const _0x48854a=_0x11d149;try{return await _0x5659e7[_0x48854a(0x22d)]['resolveJourneyId'](_0xf469b7[_0x48854a(0x25f)],_0x4031fd);}catch(_0x537abc){throw new SDKError(ErrorCode['NOT_FOUND'],_0x48854a(0x226)+_0x4031fd+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x51c86b[_0x48854a(0x276)]['name']+'\x27)',_0x537abc);}},'resolveStageId':async(_0x3f6a64,_0x28ab39)=>{const _0x243ead=_0x11d149,_0x4a914e=await _0x5659e7[_0x243ead(0x22d)]['getJourney'](_0x3f6a64),_0xe2929c=_0x4a914e[_0x243ead(0x2c8)][_0x243ead(0x2b7)]['find'](_0x1d43ef=>_0x1d43ef[_0x243ead(0x2e8)][_0x243ead(0x1fd)]()===_0x28ab39[_0x243ead(0x1fd)]());if(!_0xe2929c?.['id'])throw new SDKError(ErrorCode[_0x243ead(0x221)],_0x243ead(0x2c5)+_0x28ab39+'\x27\x20not\x20found\x20in\x20journey\x20\x27'+(_0x4a914e['attributes'][_0x243ead(0x237)]||_0x4a914e[_0x243ead(0x2c8)]['name'])+'\x27');return _0xe2929c['id'];}},_0xf3c417=await _0x420c1f(_0x51c86b[_0x11d149(0x276)],_0xf469b7[_0x11d149(0x25f)],_0x323372),_0xab7f9a=_0xf469b7['folderId']||_0xf469b7['rootFolderId'];_0xab7f9a&&(_0xf3c417['relationships']={'parentFolder':{'data':{'id':_0xab7f9a,'type':_0x11d149(0x2d5)}}});if(_0x51c86b[_0x11d149(0x232)]){if(_0x448c64[_0x11d149(0x2e0)]>0x0||_0x133f4d[_0x11d149(0x2e0)]>0x0)return await executeThreeStepJourneyCreate(_0x5659e7,_0x51c86b,_0xf3c417,{'pendingEmbeddedSegments':_0x448c64,'pendingEmbeddedActivations':_0x133f4d,'embeddedSegmentNameToId':_0x5b4c84,'journeyActivationNameToId':_0x10473b},{..._0xf469b7,'effectiveFolderId':_0xab7f9a},_0x400b80,_0x2d9e67,_0x96003);else{ensureJourneyDefaults(_0xf3c417[_0x11d149(0x2c8)]);const _0x4afd8f=await _0x5659e7[_0x11d149(0x22d)][_0x11d149(0x277)](_0xf3c417);return deletePushRecovery(_0x51c86b[_0x11d149(0x2b5)]),{'action':_0x11d149(0x28c),'journeyId':_0x4afd8f['id'],'embeddedSegmentNameToId':_0x5b4c84};}}else{if(_0x51c86b[_0x11d149(0x2ab)]&&_0x51c86b[_0x11d149(0x2d9)]){_0xf3c417['id']=_0x51c86b[_0x11d149(0x2d9)]['id'];const _0x28b475=_0xf3c417[_0x11d149(0x2c8)];_0x51c86b[_0x11d149(0x2d9)][_0x11d149(0x2c8)]?.[_0x11d149(0x237)]&&(_0x28b475['journeyBundleName']=_0x51c86b['existingJourney'][_0x11d149(0x2c8)][_0x11d149(0x237)]);const _0x49feaf=_0x51c86b[_0x11d149(0x2d9)]['attributes']?.['journeyStages'];return _0x49feaf&&_0xf3c417[_0x11d149(0x2c8)][_0x11d149(0x2b7)]&&injectExistingStageIds(_0xf3c417[_0x11d149(0x2c8)][_0x11d149(0x2b7)],_0x49feaf),ensureJourneyDefaults(_0x28b475),await _0x5659e7[_0x11d149(0x22d)][_0x11d149(0x23d)](_0x51c86b[_0x11d149(0x2d9)]['id'],_0xf3c417),deletePushRecovery(_0x51c86b[_0x11d149(0x2b5)]),{'action':_0x11d149(0x22b),'journeyId':_0x51c86b[_0x11d149(0x2d9)]['id'],'embeddedSegmentNameToId':_0x5b4c84};}}return deletePushRecovery(_0x51c86b['absolutePath']),{'action':'unchanged','journeyId':_0x51c86b[_0x11d149(0x2d9)]?.['id'],'embeddedSegmentNameToId':_0x5b4c84};}function findSegmentCriteriaLocation(_0x12b31c,_0x554d05){const _0x4fd2f4=a136_0x357cba,_0x548391=_0x12b31c[_0x4fd2f4(0x2e9)]||_0x12b31c[_0x4fd2f4(0x27f)]?.[0x0]?.[_0x4fd2f4(0x2e9)]||[];let _0x58f209='entry',_0x2d5aa6=_0x554d05;const _0x4f9618=_0x12b31c[_0x4fd2f4(0x243)]||_0x12b31c[_0x4fd2f4(0x27f)]?.[0x0]?.[_0x4fd2f4(0x243)];if(_0x4f9618?.[_0x4fd2f4(0x27c)]===_0x554d05)return{'stageName':'goal','criteriaName':_0x4f9618[_0x4fd2f4(0x2e8)]||_0x554d05};_0x411b94:for(const _0x458c32 of _0x548391){if(_0x458c32[_0x4fd2f4(0x2e4)]?.['segment']===_0x554d05){_0x58f209=_0x458c32['name'],_0x2d5aa6=_0x458c32[_0x4fd2f4(0x2e4)]['name']||_0x554d05;break;}if(_0x458c32[_0x4fd2f4(0x23a)])for(const _0x16978b of _0x458c32[_0x4fd2f4(0x23a)]){if(_0x16978b[_0x4fd2f4(0x22e)]===_0x4fd2f4(0x2be)&&_0x16978b[_0x4fd2f4(0x297)]?.[_0x4fd2f4(0x2c1)])for(const _0xbf468d of _0x16978b[_0x4fd2f4(0x297)][_0x4fd2f4(0x2c1)]){if(_0xbf468d['segment']===_0x554d05){_0x58f209=_0x458c32['name'],_0x2d5aa6=_0xbf468d['name']||_0x554d05;break _0x411b94;}}}}return{'stageName':_0x58f209,'criteriaName':_0x2d5aa6};}async function executeThreeStepJourneyCreate(_0x2cdf02,_0x2e5055,_0x520e13,_0x2d9f97,_0x454dab,_0xa55d22,_0x509397,_0x2deb42){const _0x215707=a136_0x357cba,{activationDefToCreateRequest:_0x2ef6ea,yamlRuleToApi:_0x58da24}=_0x2deb42,{pendingEmbeddedSegments:_0x41e1f4,pendingEmbeddedActivations:_0xde01de,embeddedSegmentNameToId:_0x1c4a09}=_0x2d9f97,_0x3cf802=JSON[_0x215707(0x201)](JSON['stringify'](_0x520e13));ensureJourneyDefaults(_0x3cf802[_0x215707(0x2c8)]),stripPendingIds(_0x3cf802);const _0x56e07c=await _0x2cdf02[_0x215707(0x22d)][_0x215707(0x277)](_0x3cf802),_0x28f3c2=_0x56e07c['id'],_0x1ba680=new Map();for(const _0x4a118b of _0x56e07c[_0x215707(0x2c8)]['journeyStages']){_0x1ba680[_0x215707(0x278)](_0x4a118b[_0x215707(0x2e8)][_0x215707(0x1fd)](),_0x4a118b['id']);}recoverSegmentIdsFromPushRecovery(_0x2e5055,_0x1c4a09,_0xa55d22[_0x215707(0x20f)]);for(const [_0x2b831b,{definition:_0xd2dfc6}]of _0x41e1f4){if(_0x1c4a09[_0x215707(0x1f4)](_0x2b831b)){_0x509397[_0x215707(0x275)]?.({'type':_0x215707(0x253),'journeyName':_0x2e5055[_0x215707(0x276)][_0x215707(0x2e8)],'segmentName':_0x2b831b});continue;}const _0x1c117a=generateDeterministicJourneySegmentName(_0x2e5055['yamlConfig'][_0x215707(0x2e8)],_0x2b831b);_0x509397[_0x215707(0x275)]?.({'type':'embedded_segment_creating','journeyName':_0x2e5055[_0x215707(0x276)][_0x215707(0x2e8)],'segmentName':_0x2b831b});const _0x230c10=createSegmentIdResolver(_0xa55d22[_0x215707(0x20f)],_0x2b831b),_0x31b25d=await resolveRuleSegmentIds(_0xd2dfc6[_0x215707(0x25e)],_0x230c10),_0x48ce8b=await createOrRecoverEmbeddedSegment(_0x2cdf02,_0x2e5055,{'localName':_0x2b831b,'uniqueSegmentName':_0x1c117a,'description':_0xd2dfc6['description']||'Entry\x20criteria:\x20'+_0x2b831b,'journeyId':_0x28f3c2,'resolvedRule':_0x31b25d,'parentId':_0x454dab['parentId'],'folderId':_0x454dab[_0x215707(0x2cd)]||''},_0x58da24);_0x1c4a09[_0x215707(0x278)](_0x2b831b,_0x48ce8b),_0xa55d22[_0x215707(0x20f)][_0x215707(0x278)](_0x2b831b,_0x48ce8b),_0x509397[_0x215707(0x275)]?.({'type':'embedded_segment_created','journeyName':_0x2e5055['yamlConfig']['name'],'segmentName':_0x2b831b});}const _0x35523b=new Map();for(const [_0xa815be,_0x3a110c]of _0xde01de){_0x509397[_0x215707(0x275)]?.({'type':_0x215707(0x2c3),'journeyName':_0x2e5055[_0x215707(0x276)][_0x215707(0x2e8)],'activationName':_0xa815be});const _0x1172b1=await _0x2ef6ea(_0x3a110c,_0xa55d22[_0x215707(0x208)]),_0x3d7814={..._0x1172b1,..._0x3a110c[_0x215707(0x2eb)]!==undefined&&{'runAfterJourneyRefresh':_0x3a110c['run_after_journey_refresh']}},_0x24afb0=await _0x2cdf02[_0x215707(0x22d)][_0x215707(0x216)](_0x28f3c2,_0x3d7814);_0x35523b['set'](_0xa815be,_0x24afb0['id']),_0x2d9f97[_0x215707(0x294)][_0x215707(0x278)](_0xa815be,_0x24afb0['id']),_0x509397['onProgress']?.({'type':_0x215707(0x25a),'journeyName':_0x2e5055[_0x215707(0x276)]['name'],'activationName':_0xa815be});}const _0x532aac=JSON['parse'](JSON['stringify'](_0x520e13));return _0x532aac['id']=_0x28f3c2,ensureJourneyDefaults(_0x532aac[_0x215707(0x2c8)]),resolvePendingIdsInRequest(_0x532aac,_0x520e13,_0x1ba680,_0x1c4a09,_0x35523b,_0x509397),await _0x2cdf02['journey'][_0x215707(0x23d)](_0x28f3c2,_0x532aac),deletePushRecovery(_0x2e5055['absolutePath']),{'action':'created','journeyId':_0x28f3c2,'embeddedSegmentNameToId':_0x1c4a09};}export function stripWaitStepPendingIds(_0xef56bc){const _0x17e040=a136_0x357cba,_0x5d8ff5=_0xef56bc[_0x17e040(0x269)]&&isPendingSegmentId(_0xef56bc[_0x17e040(0x269)]),_0x412cc3=_0xef56bc['conditions']?.['some'](_0x5edc28=>_0x5edc28['segmentId']&&isPendingSegmentId(_0x5edc28[_0x17e040(0x235)]));(_0x5d8ff5||_0x412cc3)&&(_0xef56bc[_0x17e040(0x28b)]='Duration',_0xef56bc[_0x17e040(0x2c7)]=0x1,_0xef56bc[_0x17e040(0x267)]=_0x17e040(0x258),delete _0xef56bc[_0x17e040(0x269)],delete _0xef56bc[_0x17e040(0x262)],delete _0xef56bc[_0x17e040(0x2db)],delete _0xef56bc[_0x17e040(0x2a4)]);}export function resolveWaitStepPendingIds(_0x130a28,_0x5c55c7,_0x580aa2,_0x42d91b){const _0x454bfc=a136_0x357cba;if(_0x5c55c7[_0x454bfc(0x269)]&&isPendingSegmentId(_0x5c55c7[_0x454bfc(0x269)])){const _0x50eea5=_0x580aa2(_0x5c55c7[_0x454bfc(0x269)],_0x454bfc(0x2bf)+_0x42d91b+'\x27\x20wait\x20condition');_0x50eea5&&(_0x130a28[_0x454bfc(0x28b)]='Condition',_0x130a28[_0x454bfc(0x269)]=_0x50eea5,delete _0x130a28['waitStep'],delete _0x130a28[_0x454bfc(0x267)],_0x5c55c7[_0x454bfc(0x262)]!==undefined&&(_0x130a28[_0x454bfc(0x262)]=_0x5c55c7['conditionTimeoutDuration']),_0x5c55c7[_0x454bfc(0x2db)]&&(_0x130a28[_0x454bfc(0x2db)]=_0x5c55c7[_0x454bfc(0x2db)]));}if(_0x5c55c7[_0x454bfc(0x2a4)]){const _0x5aebe8=_0x5c55c7[_0x454bfc(0x2a4)][_0x454bfc(0x250)](_0xba90f4=>_0xba90f4[_0x454bfc(0x235)]&&isPendingSegmentId(_0xba90f4[_0x454bfc(0x235)]));if(_0x5aebe8){const _0x409ac9=_0x5c55c7[_0x454bfc(0x2a4)]['map'](_0x783f3d=>{const _0x425acd=_0x454bfc;if(_0x783f3d[_0x425acd(0x235)]&&isPendingSegmentId(_0x783f3d[_0x425acd(0x235)])){const _0x2860f8=_0x580aa2(_0x783f3d[_0x425acd(0x235)],'stage\x20\x27'+_0x42d91b+_0x425acd(0x2b8));return{..._0x783f3d,'segmentId':_0x2860f8||_0x783f3d['segmentId']};}return{..._0x783f3d};});_0x130a28[_0x454bfc(0x28b)]='Condition',_0x130a28['conditions']=_0x409ac9,delete _0x130a28[_0x454bfc(0x2c7)],delete _0x130a28[_0x454bfc(0x267)],delete _0x130a28[_0x454bfc(0x269)],delete _0x130a28[_0x454bfc(0x262)],delete _0x130a28['conditionTimeoutUnit'];}}}function stripPendingIds(_0x4f21b4){const _0x12efc5=a136_0x357cba;_0x4f21b4[_0x12efc5(0x2c8)]['goal']?.[_0x12efc5(0x235)]&&isPendingSegmentId(_0x4f21b4['attributes'][_0x12efc5(0x243)][_0x12efc5(0x235)])&&delete _0x4f21b4[_0x12efc5(0x2c8)][_0x12efc5(0x243)];for(const _0x38ab35 of _0x4f21b4['attributes']['journeyStages']||[]){_0x38ab35['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0x38ab35[_0x12efc5(0x214)][_0x12efc5(0x235)])&&delete _0x38ab35[_0x12efc5(0x214)];_0x38ab35[_0x12efc5(0x247)]?.[_0x12efc5(0x235)]&&isPendingSegmentId(_0x38ab35['milestone'][_0x12efc5(0x235)])&&delete _0x38ab35[_0x12efc5(0x247)];_0x38ab35[_0x12efc5(0x2f5)]&&(_0x38ab35[_0x12efc5(0x2f5)]=_0x38ab35[_0x12efc5(0x2f5)][_0x12efc5(0x257)](_0x22ba77=>!_0x22ba77[_0x12efc5(0x235)]||!isPendingSegmentId(_0x22ba77[_0x12efc5(0x235)])));if(_0x38ab35['steps'])for(const _0x1131d6 of Object[_0x12efc5(0x212)](_0x38ab35[_0x12efc5(0x23a)])){const _0x589bf8=_0x38ab35[_0x12efc5(0x23a)][_0x1131d6];_0x589bf8[_0x12efc5(0x22e)]===_0x12efc5(0x218)&&_0x589bf8[_0x12efc5(0x26d)]&&isPendingActivationId(_0x589bf8['journeyActivationStepId'])&&(_0x589bf8[_0x12efc5(0x26d)]='');if(_0x589bf8[_0x12efc5(0x22e)]===_0x12efc5(0x283)&&_0x589bf8['branches'])for(const _0x2791f9 of _0x589bf8[_0x12efc5(0x2c1)]){_0x2791f9[_0x12efc5(0x235)]&&isPendingSegmentId(_0x2791f9['segmentId'])&&(_0x2791f9[_0x12efc5(0x235)]='');}_0x589bf8[_0x12efc5(0x22e)]==='WaitStep'&&stripWaitStepPendingIds(_0x589bf8);}}}function resolvePendingIdsInRequest(_0x56b79f,_0x590914,_0x4c3b66,_0x3c2d7d,_0x35b2ee,_0x440f6c){const _0x78b3d5=a136_0x357cba,_0x5801cf=(_0x222240,_0x189e83)=>{const _0x210dae=a136_0x1e1e;if(!isPendingSegmentId(_0x222240))return _0x222240;const _0x30a0c1=extractPendingSegmentName(_0x222240),_0xf4c150=_0x3c2d7d[_0x210dae(0x20a)](_0x30a0c1);return!_0xf4c150&&_0x440f6c[_0x210dae(0x266)]?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x30a0c1+_0x210dae(0x2ad)+_0x189e83),_0xf4c150;};if(_0x56b79f[_0x78b3d5(0x2c8)]['goal']?.[_0x78b3d5(0x235)]&&isPendingSegmentId(_0x56b79f['attributes'][_0x78b3d5(0x243)]['segmentId'])){const _0x2a37eb=_0x5801cf(_0x56b79f[_0x78b3d5(0x2c8)]['goal'][_0x78b3d5(0x235)],_0x78b3d5(0x22f));_0x2a37eb&&(_0x56b79f[_0x78b3d5(0x2c8)][_0x78b3d5(0x243)][_0x78b3d5(0x235)]=_0x2a37eb);}for(const _0xce16de of _0x56b79f['attributes'][_0x78b3d5(0x2b7)]||[]){const _0x202ac2=_0x4c3b66['get'](_0xce16de['name']['toLowerCase']());_0x202ac2&&(_0xce16de['id']=_0x202ac2);if(_0xce16de['entryCriteria']?.['segmentId']&&isPendingSegmentId(_0xce16de['entryCriteria'][_0x78b3d5(0x235)])){const _0x57c233=_0x5801cf(_0xce16de[_0x78b3d5(0x214)][_0x78b3d5(0x235)],_0x78b3d5(0x2bf)+_0xce16de['name']+_0x78b3d5(0x2bc));_0x57c233&&(_0xce16de[_0x78b3d5(0x214)][_0x78b3d5(0x235)]=_0x57c233);}if(_0xce16de['exitCriterias'])for(const _0x57be8c of _0xce16de[_0x78b3d5(0x2f5)]){if(_0x57be8c['segmentId']&&isPendingSegmentId(_0x57be8c[_0x78b3d5(0x235)])){const _0x469661=_0x5801cf(_0x57be8c[_0x78b3d5(0x235)],'stage\x20\x27'+_0xce16de['name']+_0x78b3d5(0x28a));_0x469661&&(_0x57be8c[_0x78b3d5(0x235)]=_0x469661);}}if(_0xce16de[_0x78b3d5(0x247)]?.['segmentId']&&isPendingSegmentId(_0xce16de[_0x78b3d5(0x247)][_0x78b3d5(0x235)])){const _0x397bfd=_0x5801cf(_0xce16de[_0x78b3d5(0x247)][_0x78b3d5(0x235)],_0x78b3d5(0x2bf)+_0xce16de[_0x78b3d5(0x2e8)]+_0x78b3d5(0x2b6));_0x397bfd&&(_0xce16de[_0x78b3d5(0x247)]['segmentId']=_0x397bfd);}if(_0xce16de['steps']){const _0x55da2c=_0x4f2f80=>_0x590914[_0x78b3d5(0x2c8)]['journeyStages']?.[_0x78b3d5(0x280)](_0x184459=>_0x184459[_0x78b3d5(0x2e8)][_0x78b3d5(0x1fd)]()===_0xce16de['name'][_0x78b3d5(0x1fd)]())?.[_0x78b3d5(0x23a)]?.[_0x4f2f80];for(const _0x17dcde of Object['keys'](_0xce16de[_0x78b3d5(0x23a)])){const _0xc3f047=_0xce16de[_0x78b3d5(0x23a)][_0x17dcde],_0x59c21f=_0x55da2c(_0x17dcde);if(_0xc3f047['type']===_0x78b3d5(0x218)&&_0xc3f047[_0x78b3d5(0x26d)]&&(isPendingActivationId(_0xc3f047[_0x78b3d5(0x26d)])||_0xc3f047[_0x78b3d5(0x26d)]==='')){if(_0x59c21f?.['journeyActivationStepId']&&isPendingActivationId(_0x59c21f[_0x78b3d5(0x26d)])){const _0x4c72b4=extractPendingActivationName(_0x59c21f['journeyActivationStepId']),_0x57fde2=_0x35b2ee['get'](_0x4c72b4);_0x57fde2&&(_0xc3f047[_0x78b3d5(0x26d)]=_0x57fde2);}}if(_0xc3f047[_0x78b3d5(0x22e)]===_0x78b3d5(0x283)&&_0xc3f047[_0x78b3d5(0x2c1)]&&_0x59c21f?.[_0x78b3d5(0x2c1)])for(let _0x16c2f7=0x0;_0x16c2f7<_0xc3f047[_0x78b3d5(0x2c1)][_0x78b3d5(0x2b3)];_0x16c2f7++){const _0x825e74=_0xc3f047[_0x78b3d5(0x2c1)][_0x16c2f7],_0x1c5139=_0x59c21f[_0x78b3d5(0x2c1)][_0x16c2f7];if(_0x1c5139?.['segmentId']&&isPendingSegmentId(_0x1c5139[_0x78b3d5(0x235)])){const _0x457efe=_0x5801cf(_0x1c5139[_0x78b3d5(0x235)],_0x78b3d5(0x2bf)+_0xce16de[_0x78b3d5(0x2e8)]+_0x78b3d5(0x209)+(_0x825e74[_0x78b3d5(0x2e8)]||_0x16c2f7)+'\x27');_0x457efe&&(_0x825e74[_0x78b3d5(0x235)]=_0x457efe);}}_0xc3f047['type']==='WaitStep'&&_0x59c21f?.[_0x78b3d5(0x22e)]===_0x78b3d5(0x265)&&resolveWaitStepPendingIds(_0xc3f047,_0x59c21f,_0x5801cf,_0xce16de[_0x78b3d5(0x2e8)]);}}}}
|
|
1
|
+
const a136_0x3aef17=a136_0x39b7;(function(_0x18f438,_0x58e13d){const _0x2542e9=a136_0x39b7,_0x5317a6=_0x18f438();while(!![]){try{const _0x1c1cbe=parseInt(_0x2542e9(0x14b))/0x1+parseInt(_0x2542e9(0xee))/0x2*(parseInt(_0x2542e9(0x139))/0x3)+-parseInt(_0x2542e9(0xc4))/0x4+parseInt(_0x2542e9(0x16c))/0x5*(parseInt(_0x2542e9(0x162))/0x6)+parseInt(_0x2542e9(0xc8))/0x7*(-parseInt(_0x2542e9(0xfa))/0x8)+-parseInt(_0x2542e9(0x11e))/0x9*(-parseInt(_0x2542e9(0x10a))/0xa)+parseInt(_0x2542e9(0x131))/0xb*(parseInt(_0x2542e9(0x12e))/0xc);if(_0x1c1cbe===_0x58e13d)break;else _0x5317a6['push'](_0x5317a6['shift']());}catch(_0x2e6440){_0x5317a6['push'](_0x5317a6['shift']());}}}(a136_0x111c,0x69e05));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a136_0x3aef17(0x16d));export const PENDING_SEGMENT_PREFIX=a136_0x3aef17(0x11a);export const PENDING_ACTIVATION_PREFIX='__pending_act_';export function createPendingSegmentId(_0x47c0ef){return''+PENDING_SEGMENT_PREFIX+_0x47c0ef+'__';}export function isPendingSegmentId(_0x2c04db){const _0xfe9b24=a136_0x3aef17;return _0x2c04db['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x2c04db[_0xfe9b24(0x140)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x174439){const _0x29c890=a136_0x3aef17;return _0x174439[_0x29c890(0xe0)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x3c18c0){return''+PENDING_ACTIVATION_PREFIX+_0x3c18c0+'__';}export function isPendingActivationId(_0x1e11a7){const _0x538bbb=a136_0x3aef17;return _0x1e11a7[_0x538bbb(0x140)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x3e5c48){const _0x3ddcec=a136_0x3aef17;return _0x3e5c48[_0x3ddcec(0xe0)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x1eb2c2,_0x233790){const _0x26866e=a136_0x3aef17,_0x484105=_0x1eb2c2+'::'+(_0x233790[_0x26866e(0x181)]()||_0x26866e(0xa3)),_0x4d7946=createHash('sha1')[_0x26866e(0x137)](_0x484105)['digest'](_0x26866e(0x118))['slice'](0x0,0xc);return _0x26866e(0x174)+_0x4d7946;}export function ensureJourneyDefaults(_0x35af9b){const _0x50c4e5=a136_0x3aef17;!_0x35af9b[_0x50c4e5(0x16b)]&&(_0x35af9b[_0x50c4e5(0x16b)]=''),!_0x35af9b['state']&&(_0x35af9b[_0x50c4e5(0x142)]=_0x50c4e5(0x105));}export function injectExistingStageIds(_0x2fa5f1,_0x530438){const _0x2bc768=a136_0x3aef17,_0x6feabb=new Map(_0x530438['map'](_0x4429db=>[_0x4429db['name'],_0x4429db['id']]));for(const _0x3667e2 of _0x2fa5f1){if(!_0x3667e2['id']){const _0x2e68b2=_0x6feabb[_0x2bc768(0xe9)](_0x3667e2[_0x2bc768(0xfc)]);_0x2e68b2&&(_0x3667e2['id']=_0x2e68b2);}}}export function resolveTDFolderPath(_0x4885d1,_0x1b9e8d,_0x579f99){const _0x589412=a136_0x3aef17;if(!_0x1b9e8d)return _0x4885d1;if(_0x4885d1===_0x579f99||_0x4885d1[_0x589412(0x140)](_0x579f99+'/'))return _0x4885d1;return _0x4885d1?_0x579f99+'/'+_0x4885d1:_0x579f99;}export function addFoldersToCreate(_0x2629ad,_0x4b5f84,_0x3c948a){const _0x240d59=a136_0x3aef17;if(!_0x2629ad)return;if(_0x4b5f84[_0x240d59(0x132)](_0x2629ad))return;const _0x532453=_0x2629ad[_0x240d59(0xec)]('/');let _0x2e7972='';for(const _0x3c427c of _0x532453){_0x2e7972=_0x2e7972?_0x2e7972+'/'+_0x3c427c:_0x3c427c,!_0x4b5f84[_0x240d59(0x132)](_0x2e7972)&&_0x3c948a[_0x240d59(0x99)](_0x2e7972);}}export function sortFoldersByDepth(_0x4f8d50){const _0x1f69b2=a136_0x3aef17;return[..._0x4f8d50][_0x1f69b2(0x157)]((_0x90ab5,_0x3758f3)=>{const _0x13e5eb=_0x1f69b2,_0x325433=(_0x90ab5[_0x13e5eb(0x148)](/\//g)||[])['length'],_0x2b4858=(_0x3758f3['match'](/\//g)||[])[_0x13e5eb(0x93)];return _0x325433-_0x2b4858;});}import*as a136_0x42129b from'yaml';import{readFileSync}from'fs';import a136_0x2cf61d from'path';import{isJourneyDef,parseYamlString as a136_0x52b19f,toYamlString as a136_0x3b10e7,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';function a136_0x39b7(_0x16f507,_0x5a0a80){_0x16f507=_0x16f507-0x90;const _0x111cd0=a136_0x111c();let _0x39b734=_0x111cd0[_0x16f507];return _0x39b734;}import{batchAsync}from'../../utils/async.js';function a136_0x111c(){const _0x389c9c=['journeyActivationStepId','getSegment','goal','\x20journey\x20from\x20file:\x20','hex','\x20error(s)','__pending_','reduce','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','):\x20','108ytZHuZ','relationships','max','run_after_journey_refresh','folderPath','waitStepType','listActivations','activation_updated','parentId','\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','branches','activationActions','toLowerCase','existingSegments','segmentId','logSuccess','4406808giedol','entryCriteria','size','22HDevgT','has','created','decision_point','find','notification','update','entries','1317arMcqb','embedded_segment_created','JOURNEY_SYNTAX_ERROR','fetchJourney','\x27\x20exit\x20criteria','conditionTimeoutDuration','getJourney','startsWith','diff','state','activationStepsById','map','./child-segment-yaml.js','isNew','Deleted\x20segment\x20\x27','match','segmentFolderId','withProgress','738763WCXJhe','\x27\x20milestone','existingJourney','segment_deleted','verbose','values','data','getSegmentEntity','WaitStep','Embedded\x20segment\x20\x27','segmentNameToId','SEGMENT_NOT_FOUND','sort','\x20activation\x20\x27','createJourneySegment','embedded_activation_creating','\x27\x20from\x20file:\x20','Matched\x20server\x20segment\x20\x27','createFolder','journeyBundleName','deleted','parseDocument','Creating\x20folder\x20\x27','593874BloQTc','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','existingActivation','action','delete','keys','conditionSegmentId','attributes',').\x20','description','5RHMccA','tdx.sdk.push-workflow','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','with','user','valid','day','Creating\x20segment\x20\x27','journey_entry_criteria_','Condition','isArray','connection','logDeleted','journey_updated','journeys','Delete\x20the\x20push\x20recovery\x20file\x20(','embedded_segment_creating','Updating\x20activation\x20\x27','ACTIVATION_UPDATE_ERROR','list','\x20(referenced\x20in\x20journey\x20','trim','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','existingSegment','activation_deleting','stringify','goal\x20criteria','createdSegmentId','effectiveFolderId','deps','index','activationParams','exitCriterias','idToName','push','onProgress','resolvedRule','deleteSegment','nameToId','segments','Updating\x20segment\x20\x27','\x27...','\x27\x20decision\x20point\x20branch\x20\x27','rootFolderId','folder','errors','\x27\x20entry\x20criteria','activationsBySegmentId','uniqueServerName','Failed\x20to\x20fetch\x20referenced\x20segment\x20','getSegmentEntity\x20also\x20failed\x20for\x20','length','versionNumber','entry_criteria','connector_config','stages','all','add','object','\x0a\x20\x20','getSegment\x20failed\x20for\x20','results','Segment\x20not\x20found','Duration','Entry\x20criteria:\x20','activations','\x27\x20wait\x20condition','segment','steps','activationContext','createdSegmentIds','Journey\x20\x27','Created\x20activation\x20\x27','conditionTimeoutUnit','stage\x20\x27','journeyStages','parentSegmentFolder','journeyById','activation_template_id','segment_created','journey_created','journeyBundlesByFolderAndName','idToEmailMap','and\x20the\x20server\x20segment,\x20then\x20retry.','Deleted\x20activation\x20\x27','Stage\x20\x27','Name\x20has\x20already\x20been\x20taken','yamlConfig','milestone','Failed\x20to\x20','Segment\x20not\x20found:\x20','dirname','waitStep','Updated\x20journey\x20\x27','type','createActivation','\x27\x20not\x20found\x20in\x20journey\x20\x27','set','create','toISOString','3266152JxwssK','updateSegmentById','journey_creating','segment_deleting','1631RYqyGq','DecisionPoint','updated','toString','schedule','nameToType','Failed\x20to\x20resolve\x20segment\x20','.$1.push-recovery.json','slice','journey','Activation\x20not\x20found:\x20','segment_creating','connectionIdToNameMap','embeddedSegmentNameToId','journeyId','folderPathToId','NOT_FOUND','SEGMENT_SYNTAX_ERROR','hasChanges','INTERNAL',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','resolveJourneyId','\x20segment\x20from\x20file:\x20','localName','replace','unchanged','folder_creating','behavior','columns','journeyName','uniqueSegmentName','Creating\x20activation\x20\x27','message','get','yamlActivation','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','split','from','1068alqfMd','conditions','rule','../../utils/async.js','some','parse','absolutePath','SEGMENT_UPDATE_ERROR','relative','journey_updating','\x27\x20to\x20local\x20\x27','skipSegments','19144NsOHWv','all_columns','name','\x27\x20for\x20','item','Deleting\x20activation\x20\x27','getActivation','debug','Created\x20journey\x20\x27','entry','./journey-yaml.js','draft','includes','progress','segmentByFolderAndName','waitStepUnit','950KVldoB','folderId','activation_deleted','join','filter','validatedRequest','activation_creating','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Fetching\x20','utf-8'];a136_0x111c=function(){return _0x389c9c;};return a136_0x111c();}import{buildFolderMaps}from'./resolution-context.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage}from'../errors.js';import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0xe81b00){const _0x54fb53=a136_0x3aef17;if(Array[_0x54fb53(0x176)](_0xe81b00))return'['+_0xe81b00[_0x54fb53(0x144)](_0x3ee7e7=>stableStringify(_0x3ee7e7))[_0x54fb53(0x10d)](',')+']';if(_0xe81b00&&typeof _0xe81b00===_0x54fb53(0x9a)){const _0x3cb061=_0xe81b00,_0x5b56ca=Object['keys'](_0x3cb061)[_0x54fb53(0x157)](),_0x7a6a34=_0x5b56ca[_0x54fb53(0x144)](_0x13016f=>'\x22'+_0x13016f+'\x22:'+stableStringify(_0x3cb061[_0x13016f]));return'{'+_0x7a6a34['join'](',')+'}';}const _0x12c603=JSON[_0x54fb53(0x185)](_0xe81b00);return _0x12c603===undefined?'null':_0x12c603;}function activationSignature(_0x46ef42){const _0x6ecb1e=a136_0x3aef17,_0x55f4f5={'connection':_0x46ef42[_0x6ecb1e(0x177)],..._0x46ef42[_0x6ecb1e(0xfb)]!==undefined&&{'all_columns':_0x46ef42[_0x6ecb1e(0xfb)]},..._0x46ef42[_0x6ecb1e(0xe4)]!==undefined&&{'columns':_0x46ef42['columns']},..._0x46ef42[_0x6ecb1e(0xe3)]!==undefined&&{'behavior':_0x46ef42[_0x6ecb1e(0xe3)]},..._0x46ef42['schedule']!==undefined&&{'schedule':_0x46ef42[_0x6ecb1e(0xcc)]},..._0x46ef42[_0x6ecb1e(0x136)]!==undefined&&{'notification':_0x46ef42['notification']},..._0x46ef42[_0x6ecb1e(0x96)]!==undefined&&{'connector_config':_0x46ef42['connector_config']},..._0x46ef42[_0x6ecb1e(0xae)]!==undefined&&{'activation_template_id':_0x46ef42[_0x6ecb1e(0xae)]}};return stableStringify(_0x55f4f5);}async function fetchSegment(_0x1aaabc,_0x38e1b7,_0x5583cc,_0x23b6de){const _0x194c56=a136_0x3aef17,_0x47fed7=_0x23b6de?.[_0x194c56(0x135)](_0x4fe3a0=>_0x4fe3a0['id']===_0x5583cc);if(_0x47fed7)return _0x47fed7;try{return await _0x1aaabc['segment'][_0x194c56(0x115)](_0x38e1b7,_0x5583cc);}catch(_0x220b51){logger[_0x194c56(0x101)](_0x194c56(0x9c)+_0x5583cc+_0x194c56(0xdc)+_0x220b51);try{return await _0x1aaabc[_0x194c56(0xa3)][_0x194c56(0x152)](_0x5583cc);}catch(_0x341e2f){return logger[_0x194c56(0x101)](_0x194c56(0x92)+_0x5583cc+':\x20'+_0x341e2f),null;}}}function recoverSegmentIdsFromPushRecovery(_0x44ea52,_0x36fa9d,_0x4b2154){const _0x4a746b=a136_0x3aef17,_0x44af6d=readPushRecovery(_0x44ea52[_0x4a746b(0xf4)]);if(_0x44af6d?.[_0x4a746b(0xe5)]===_0x44ea52[_0x4a746b(0xb7)]['name'])for(const [_0x360246,_0x59bffd]of Object[_0x4a746b(0x138)](_0x44af6d[_0x4a746b(0x193)])){const _0x1d57df=generateDeterministicJourneySegmentName(_0x44ea52[_0x4a746b(0xb7)][_0x4a746b(0xfc)],_0x360246);_0x59bffd[_0x4a746b(0x90)]===_0x1d57df&&(_0x36fa9d[_0x4a746b(0xc1)](_0x360246,_0x59bffd['segmentId']),_0x4b2154[_0x4a746b(0xc1)](_0x360246,_0x59bffd[_0x4a746b(0x12c)]));}}async function createOrRecoverEmbeddedSegment(_0x45acd0,_0x28066b,_0xde8a32,_0x50221d){const _0xa9d105=a136_0x3aef17;let _0x4f7a41;try{_0x4f7a41=await _0x45acd0[_0xa9d105(0xa3)][_0xa9d105(0x159)]({'name':_0xde8a32[_0xa9d105(0xe6)],'description':_0xde8a32[_0xa9d105(0x16b)],'journeyId':_0xde8a32[_0xa9d105(0xd6)],'rule':_0x50221d(_0xde8a32['resolvedRule'],!![]),'countPopulation':!![],'parentFolderId':_0xde8a32[_0xa9d105(0x10b)],'audienceId':_0xde8a32[_0xa9d105(0x126)]});}catch(_0x340fe6){const _0x566578=_0x340fe6 instanceof Error&&_0x340fe6[_0xa9d105(0xe8)][_0xa9d105(0x106)](_0xa9d105(0xb6));if(_0x566578){const _0x39d4d5=readPushRecovery(_0x28066b['absolutePath']),_0x3b8db1=_0x39d4d5?.[_0xa9d105(0xe5)]===_0x28066b['yamlConfig'][_0xa9d105(0xfc)]?_0x39d4d5[_0xa9d105(0x193)][_0xde8a32[_0xa9d105(0xdf)]]:undefined;if(_0x3b8db1?.[_0xa9d105(0x90)]===_0xde8a32[_0xa9d105(0xe6)])await _0x45acd0[_0xa9d105(0xa3)][_0xa9d105(0xc5)](_0xde8a32[_0xa9d105(0x126)],_0x3b8db1[_0xa9d105(0x12c)],{'description':_0xde8a32[_0xa9d105(0x16b)],'rule':_0x50221d(_0xde8a32[_0xa9d105(0x190)],!![]),'countPopulation':!![]}),_0x4f7a41=_0x3b8db1[_0xa9d105(0x12c)];else throw new SDKError(ErrorCode[_0xa9d105(0xf5)],_0xa9d105(0x154)+_0xde8a32[_0xa9d105(0xdf)]+_0xa9d105(0x11c)+(_0xa9d105(0x17b)+_0x28066b[_0xa9d105(0xf4)]['replace'](/([^/]+)$/,_0xa9d105(0xcf))+')\x20')+_0xa9d105(0xb3),_0x340fe6);}else throw _0x340fe6;}return saveSegmentToPushRecovery(_0x28066b[_0xa9d105(0xf4)],_0x28066b['yamlConfig'][_0xa9d105(0xfc)],_0xde8a32['localName'],{'segmentId':_0x4f7a41,'uniqueServerName':_0xde8a32[_0xa9d105(0xe6)],'createdAt':new Date()[_0xa9d105(0xc3)]()}),_0x4f7a41;}export async function prepareSegmentFiles(_0x209ad3,_0x30ca51,_0x1b993b,_0x27ec8a,_0x59b679){const _0xb20738=a136_0x3aef17,{activationDefToCreateRequest:_0x488d1f}=await import(_0xb20738(0x145)),_0x18a1f5=[],_0x2f809a=new Set();for(const {yamlConfig:_0x3122fa,folderPath:_0x20558f,sourcePath:_0x43f49e}of _0x209ad3){const _0x4da65e=resolveTDFolderPath(_0x20558f,_0x27ec8a,_0x59b679),_0x47b8c4=_0x4da65e+':'+_0x3122fa[_0xb20738(0xfc)],_0x53807e=_0x30ca51[_0xb20738(0x108)][_0xb20738(0xe9)](_0x47b8c4),_0x36f8be=_0x53807e?_0x30ca51[_0xb20738(0x19b)][_0xb20738(0xe9)](_0x53807e['id'])||[]:[];addFoldersToCreate(_0x4da65e,_0x30ca51['folderPathToId'],_0x2f809a);const _0x2e931d=calculateActivationActions(_0x3122fa[_0xb20738(0xa1)]||[],_0x36f8be,_0x30ca51[_0xb20738(0xb2)],_0x30ca51['connectionIdToNameMap']);for(const _0x588d83 of _0x2e931d){(_0x588d83['type']==='create'||_0x588d83['type']===_0xb20738(0x137))&&_0x588d83['yamlActivation']&&(_0x588d83[_0xb20738(0x10f)]=await _0x488d1f(_0x588d83[_0xb20738(0xea)],_0x1b993b));}const _0x5db702=calculateSegmentDiff(_0x3122fa,_0x53807e,_0x36f8be,_0x30ca51[_0xb20738(0xb2)],_0x30ca51[_0xb20738(0xd4)]);_0x18a1f5[_0xb20738(0x18e)]({'relativePath':_0x3122fa[_0xb20738(0xfc)],'absolutePath':_0x43f49e,'yamlConfig':_0x3122fa,'folderPath':_0x4da65e,'existingSegment':_0x53807e,'existingActivations':_0x36f8be,'isNew':_0x5db702[_0xb20738(0x146)],'hasChanges':_0x5db702[_0xb20738(0xda)],'diff':_0x5db702[_0xb20738(0x141)],'activationActions':_0x2e931d});}return{'segmentFiles':_0x18a1f5,'foldersToCreate':_0x2f809a};}export async function prepareJourneyFiles(_0x450a5c,_0xbf8388,_0x52bfb7,_0x31cef4){const _0x208f1a=a136_0x3aef17,_0x4c6891=[],_0x13e226=new Set();for(const {yamlConfig:_0x161e69,folderPath:_0x4cf788,sourcePath:_0x243ede}of _0x450a5c){const _0x5efb4b=resolveTDFolderPath(_0x4cf788,_0x52bfb7,_0x31cef4),_0x23cd8b=_0x5efb4b+':'+_0x161e69[_0x208f1a(0xfc)],_0x4e08ea=_0xbf8388[_0x208f1a(0xb1)][_0x208f1a(0xe9)](_0x23cd8b);let _0x5a75fe,_0x16c653;if(_0x4e08ea&&_0x4e08ea['length']>0x0){const _0x1228be=buildLocalExpandedRuleMappings(_0x161e69),{createYamlContext:_0x3a705d,prefetchJourneySegments:_0x11191d}=createPushYamlContextForBundle(_0xbf8388[_0x208f1a(0x189)],_0xbf8388[_0x208f1a(0x126)],_0xbf8388[_0x208f1a(0x12b)],_0x1228be,_0xbf8388[_0x208f1a(0xb2)],_0xbf8388[_0x208f1a(0xd4)],_0xbf8388[_0x208f1a(0x143)],_0xbf8388[_0x208f1a(0xad)]);await _0x11191d(_0x4e08ea['map'](_0x4e4897=>_0x4e4897['id']));const _0x5e4961=await _0xbf8388[_0x208f1a(0x189)][_0x208f1a(0xd1)]['getLatestJourneyId'](_0x4e08ea[0x0]['journeyBundleId']),_0x4f579c=hasMultipleVersions(_0x161e69),_0x23b7c6=async _0x110d8c=>{const _0x12a1cd=_0x208f1a,_0x3a1e30=_0xbf8388[_0x12a1cd(0xad)]?.[_0x12a1cd(0xe9)](_0x110d8c);if(_0x3a1e30)return _0x3a1e30;return _0xbf8388[_0x12a1cd(0x13c)]({'journeyId':_0x110d8c,'journeyName':_0x161e69['name'],'isMultiVersion':_0x4e08ea[_0x12a1cd(0x93)]>0x1});};if(_0x4f579c&&_0x4e08ea[_0x208f1a(0x93)]>0x1){const _0x52c97c=[];for(const _0x499401 of _0x4e08ea){const _0x238edc=_0x499401[_0x208f1a(0x94)]||0x1;_0xbf8388[_0x208f1a(0x107)]?.[_0x208f1a(0x137)]('Fetching\x20'+_0x161e69[_0x208f1a(0xfc)]+'\x20v'+_0x238edc);const _0x309160=await _0x23b7c6(_0x499401['id']),_0x58eb75=_0x3a705d(_0x499401['id']),_0x4e6629=await journeyResponseToDef(_0x309160,_0x58eb75);_0x52c97c[_0x208f1a(0x18e)]({'item':_0x499401,'yaml':_0x4e6629});}const _0x552c6d=buildLocalRuleToNameMappingFromJourney(_0x161e69);_0x16c653=buildMergedJourneyDef(_0x52c97c,_0x552c6d,_0x5e4961);const _0x58b4db=Math[_0x208f1a(0x120)](..._0x52c97c[_0x208f1a(0x144)](_0x47bc0c=>_0x47bc0c[_0x208f1a(0xfe)][_0x208f1a(0x94)]||0x0)),_0xb51c54=_0x4e08ea[_0x208f1a(0x135)](_0x1260a7=>(_0x1260a7[_0x208f1a(0x94)]||0x0)===_0x58b4db);_0xb51c54&&(_0xbf8388['progress']?.[_0x208f1a(0x137)](_0x208f1a(0x112)+_0x161e69[_0x208f1a(0xfc)]+'\x20v'+_0x58b4db),_0x5a75fe=await _0x23b7c6(_0xb51c54['id']));}else{const _0x15218c=_0x4e08ea[_0x4e08ea[_0x208f1a(0x93)]-0x1];_0xbf8388['progress']?.[_0x208f1a(0x137)](_0x208f1a(0x112)+_0x161e69['name']),_0x5a75fe=await _0x23b7c6(_0x15218c['id']);const _0x1a7271=_0x3a705d(_0x15218c['id']),_0x5d8b73=await journeyResponseToDef(_0x5a75fe,_0x1a7271),_0x3454ac=buildLocalRuleToNameMappingFromJourney(_0x161e69);_0x16c653=buildMergedJourneyDef([{'item':_0x15218c,'yaml':_0x5d8b73}],_0x3454ac,_0x5e4961);}}addFoldersToCreate(_0x5efb4b,_0xbf8388[_0x208f1a(0xd7)],_0x13e226);const _0x31e85f=calculateJourneyDiff(_0x161e69,_0x16c653);_0x4c6891[_0x208f1a(0x18e)]({'relativePath':_0x161e69[_0x208f1a(0xfc)],'absolutePath':_0x243ede,'yamlConfig':_0x161e69,'folderPath':_0x5efb4b,'existingJourney':_0x5a75fe,'isNew':_0x31e85f[_0x208f1a(0x146)],'hasChanges':_0x31e85f[_0x208f1a(0xda)],'diff':_0x31e85f[_0x208f1a(0x141)]});}return{'journeyFiles':_0x4c6891,'foldersToCreate':_0x13e226};}export function calculateActivationActions(_0xe72ddf,_0x11585c,_0x2a0533,_0x34a585){const _0x47c10f=a136_0x3aef17,_0x48e79a=[],_0x38733c=new Map();for(const _0x24d2b0 of _0x11585c){_0x38733c[_0x47c10f(0xc1)](_0x24d2b0['name'],_0x24d2b0);}const _0x4fbe86=new Map();for(const _0x7f4b23 of _0xe72ddf){_0x4fbe86['set'](_0x7f4b23[_0x47c10f(0xfc)],_0x7f4b23);}for(const _0x392dbe of _0xe72ddf){const _0x30ed21=_0x38733c[_0x47c10f(0xe9)](_0x392dbe[_0x47c10f(0xfc)]);if(!_0x30ed21)_0x48e79a[_0x47c10f(0x18e)]({'type':_0x47c10f(0xc2),'name':_0x392dbe[_0x47c10f(0xfc)],'yamlActivation':_0x392dbe});else{const _0x30a281=activationResponseToDef(_0x30ed21,_0x2a0533,_0x34a585),_0x373c5a=a136_0x42129b[_0x47c10f(0x185)](_0x30a281),_0x5d214c=a136_0x42129b[_0x47c10f(0x185)](_0x392dbe);_0x373c5a!==_0x5d214c&&_0x48e79a['push']({'type':_0x47c10f(0x137),'name':_0x392dbe['name'],'yamlActivation':_0x392dbe,'existingActivation':_0x30ed21});}}for(const _0x33cad9 of _0x11585c){!_0x4fbe86['has'](_0x33cad9[_0x47c10f(0xfc)])&&_0x48e79a[_0x47c10f(0x18e)]({'type':_0x47c10f(0x166),'name':_0x33cad9[_0x47c10f(0xfc)],'existingActivation':_0x33cad9});}return _0x48e79a;}function calculateYamlDiff(_0x1ca7cb,_0x292d72){if(_0x292d72){const _0x2fd871=generateDiff(_0x292d72,_0x1ca7cb),_0x5f2620=hasChanges(_0x2fd871);return{'isNew':![],'hasChanges':_0x5f2620,'diff':_0x5f2620?formatDiffWithColors(_0x2fd871):undefined};}const _0x3b75e3=generateDiff('',_0x1ca7cb);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x3b75e3)};}export function calculateSegmentDiff(_0x5a8851,_0x21a1d8,_0x3858fd,_0xa121,_0x2dd560){const _0xcc8dc3=segmentToYamlString(_0x5a8851),_0x58af2c=_0x21a1d8?segmentToYamlString(segmentWithActivationsToYaml(_0x21a1d8,_0x3858fd,undefined,_0xa121,_0x2dd560)):undefined;return calculateYamlDiff(_0xcc8dc3,_0x58af2c);}export function calculateJourneyDiff(_0x16cde6,_0xdf8ad2){const _0xa71038=normalizeJourneyDef(_0x16cde6,_0x16cde6),_0x53db2b=a136_0x3b10e7(_0xa71038),_0x188d82=_0xdf8ad2?a136_0x3b10e7(normalizeJourneyDef(_0xdf8ad2,_0x16cde6)):undefined;return calculateYamlDiff(_0x53db2b,_0x188d82);}export function findSegmentsToDelete(_0x4b9c50,_0x2b9794,_0x13b0d4,_0x3dcbed,_0x38f1a0){const _0x1b9d1d=a136_0x3aef17,_0x41c794=new Set();for(const {yamlConfig:_0x56e456,folderPath:_0xd64a88}of _0x2b9794){_0x41c794[_0x1b9d1d(0x99)](_0xd64a88+':'+_0x56e456[_0x1b9d1d(0xfc)]);}return _0x4b9c50['filter'](_0x1bec88=>{const _0x6fd184=_0x1b9d1d,_0x512324=_0x1bec88['segmentFolderId']?_0x13b0d4['get'](_0x1bec88[_0x6fd184(0x149)][_0x6fd184(0xcb)]())||'':'',_0x1fbdb7=_0x512324+':'+_0x1bec88[_0x6fd184(0xfc)];if(_0x41c794['has'](_0x1fbdb7))return![];if(_0x38f1a0)return _0x512324===_0x3dcbed||_0x512324[_0x6fd184(0x140)](_0x3dcbed+'/');return!![];});}export function findJourneysToDelete(_0x1a8572,_0x16cc7e,_0xed97b5,_0x42100c,_0x51153f){const _0x4af5fe=a136_0x3aef17,_0x226e89=new Set();for(const {yamlConfig:_0x422771,folderPath:_0x3734f9}of _0x16cc7e){_0x226e89[_0x4af5fe(0x99)](_0x3734f9+':'+_0x422771['name']);}return _0x1a8572['filter'](_0x33d0e2=>{const _0x3637f7=_0x4af5fe,_0x3526af=_0x33d0e2[_0x3637f7(0x10b)]?_0xed97b5[_0x3637f7(0xe9)](_0x33d0e2[_0x3637f7(0x10b)])||'':'',_0xd8a93b=_0x3526af+':'+_0x33d0e2[_0x3637f7(0x15e)];if(_0x226e89[_0x3637f7(0x132)](_0xd8a93b))return![];if(_0x51153f)return _0x3526af===_0x42100c||_0x3526af[_0x3637f7(0x140)](_0x42100c+'/');return!![];});}export function buildSegmentLookupMap(_0xfdba68,_0x519546){const _0x69760=a136_0x3aef17,_0x4827e0=new Map();for(const _0x543367 of _0xfdba68){const _0x4557b7=_0x543367[_0x69760(0x149)]?_0x519546[_0x69760(0xe9)](_0x543367['segmentFolderId'][_0x69760(0xcb)]())||'':'',_0x50598e=_0x4557b7+':'+_0x543367[_0x69760(0xfc)];_0x4827e0[_0x69760(0xc1)](_0x50598e,_0x543367);}return _0x4827e0;}export function buildSegmentNameToIdMap(_0x44b73f){const _0x224149=new Map();for(const _0x439c28 of _0x44b73f){_0x224149['set'](_0x439c28['name'],_0x439c28['id']);}return _0x224149;}export function buildJourneyBundleLookupMap(_0x1a1de9,_0x496dd8){const _0x3d8fd8=a136_0x3aef17,_0x3c00aa=new Map();for(const _0x22bf2c of _0x1a1de9){const _0x27a956=_0x22bf2c[_0x3d8fd8(0x10b)]?_0x496dd8[_0x3d8fd8(0xe9)](_0x22bf2c[_0x3d8fd8(0x10b)])||'':'',_0xf92a5d=_0x27a956+':'+_0x22bf2c[_0x3d8fd8(0x15e)];!_0x3c00aa[_0x3d8fd8(0x132)](_0xf92a5d)&&_0x3c00aa[_0x3d8fd8(0xc1)](_0xf92a5d,[]),_0x3c00aa[_0x3d8fd8(0xe9)](_0xf92a5d)['push'](_0x22bf2c);}for(const _0x274610 of _0x3c00aa[_0x3d8fd8(0x150)]()){_0x274610[_0x3d8fd8(0x157)]((_0x5739fe,_0x14853f)=>(_0x5739fe['versionNumber']||0x0)-(_0x14853f[_0x3d8fd8(0x94)]||0x0));}return _0x3c00aa;}export function collectFoldersToCreate(_0xe35593,_0x1726e9){const _0x96a53b=a136_0x3aef17,_0x2366c2=new Set();for(const _0x10ebd6 of _0xe35593){if(!_0x10ebd6)continue;if(_0x1726e9['has'](_0x10ebd6))continue;const _0x4e6308=_0x10ebd6[_0x96a53b(0xec)]('/');let _0xab51e6='';for(const _0x5e4b30 of _0x4e6308){_0xab51e6=_0xab51e6?_0xab51e6+'/'+_0x5e4b30:_0x5e4b30,!_0x1726e9[_0x96a53b(0x132)](_0xab51e6)&&_0x2366c2[_0x96a53b(0x99)](_0xab51e6);}}return _0x2366c2;}export function parseAndClassifyYamlFiles(_0x425130,_0x2e23b3,_0x2cf8c2){const _0x3f6edf=a136_0x3aef17,_0x4dff42=[],_0x5798c9=[];for(const _0x1131af of _0x425130){const _0x3c6fc4=a136_0x2cf61d[_0x3f6edf(0xf6)](_0x2e23b3,a136_0x2cf61d[_0x3f6edf(0xbb)](_0x1131af)),_0x444dea=_0x3c6fc4==='.'?'':_0x3c6fc4,_0x5ddf1f=readFileSync(_0x1131af,_0x3f6edf(0x113)),_0x12f185=a136_0x42129b[_0x3f6edf(0xf3)](_0x5ddf1f);if(isJourneyDef(_0x12f185)){const _0x1fdbf8=a136_0x52b19f(_0x5ddf1f);_0x5798c9[_0x3f6edf(0x18e)]({'yamlConfig':_0x1fdbf8,'folderPath':_0x444dea,'sourcePath':_0x1131af});}else{if(!_0x2cf8c2?.[_0x3f6edf(0xf9)]){const _0x148d64=parseSegmentYamlFile(_0x5ddf1f),_0x13bf62=normalizeChildSegmentYaml(_0x148d64);_0x4dff42['push']({'yamlConfig':_0x13bf62,'folderPath':_0x444dea,'sourcePath':_0x1131af});}}}return{'segments':_0x4dff42,'journeys':_0x5798c9};}export function validateParsedFiles(_0x4e7d62,_0x25101b){const _0x8aa6ac=a136_0x3aef17,_0x3b900e=[];for(const {yamlConfig:_0x210722,sourcePath:_0x19810a}of _0x4e7d62[_0x8aa6ac(0x193)]){const _0x585c7a=readFileSync(_0x19810a,_0x8aa6ac(0x113)),_0x531c19=a136_0x42129b[_0x8aa6ac(0x160)](_0x585c7a),_0x16b479=validateSegmentDef(_0x210722,{'source':_0x585c7a,'document':_0x531c19},{'skipSchema':!![]});if(!_0x16b479[_0x8aa6ac(0x171)]){const _0x45eaf6=a136_0x2cf61d[_0x8aa6ac(0xf6)](_0x25101b,_0x19810a);_0x3b900e[_0x8aa6ac(0x18e)]({'filePath':_0x45eaf6,'source':_0x585c7a,'result':_0x16b479,'isJourney':![]});}}for(const {yamlConfig:_0x54339d,sourcePath:_0x2590d3}of _0x4e7d62[_0x8aa6ac(0x17a)]){const _0x2ab71b=readFileSync(_0x2590d3,'utf-8'),_0x1b7960=a136_0x42129b[_0x8aa6ac(0x160)](_0x2ab71b),_0x1fc705=validateJourneyDef(_0x54339d,{'source':_0x2ab71b,'document':_0x1b7960},{'skipSchema':!![]});if(!_0x1fc705[_0x8aa6ac(0x171)]){const _0x1fb4da=a136_0x2cf61d[_0x8aa6ac(0xf6)](_0x25101b,_0x2590d3);_0x3b900e[_0x8aa6ac(0x18e)]({'filePath':_0x1fb4da,'source':_0x2ab71b,'result':_0x1fc705,'isJourney':!![]});}}return _0x3b900e;}export function formatValidationErrors(_0x1cfb71){const _0x33d4c0=a136_0x3aef17,_0x5a9f20=[];for(const {filePath:_0x158262,source:_0x42829b,result:_0x49f0aa,isJourney:_0x25671e}of _0x1cfb71){const _0x1df9d7=_0x25671e?_0x33d4c0(0xd1):_0x33d4c0(0xa3);_0x5a9f20[_0x33d4c0(0x18e)]('\x0a'+_0x158262+'\x20('+_0x1df9d7+_0x33d4c0(0x11d)+_0x49f0aa[_0x33d4c0(0x199)]['length']+_0x33d4c0(0x119)),_0x5a9f20['push'](formatValidationResult(_0x49f0aa,_0x42829b,_0x158262));}return _0x5a9f20[_0x33d4c0(0x10d)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x201706){const _0x5e2a36=a136_0x3aef17,_0x5651e3=new Set(),_0x5648c8=new Map(),_0x20a0c1=collectSegmentUsageCounts(_0x201706);if(_0x201706[_0x5e2a36(0x193)])for(const [_0x333c82,_0x5c5a42]of Object[_0x5e2a36(0x138)](_0x201706[_0x5e2a36(0x193)])){_0x5651e3[_0x5e2a36(0x99)](_0x333c82);if(_0x5c5a42[_0x5e2a36(0xf0)]){const _0x5fdcd1=yamlRuleToApi(_0x5c5a42[_0x5e2a36(0xf0)]),_0x3b8ec3=apiRuleToYaml(_0x5fdcd1);_0x5648c8[_0x5e2a36(0xc1)](_0x333c82,_0x3b8ec3);}}const _0x1e56ec=new Map();let _0x4479e7=0x0;for(const [_0x1381b1,_0x44b669]of _0x5648c8){const _0x54e5e9=serializeExpandedRule(_0x44b669,_0x5648c8),_0x3f9a0d=_0x1e56ec['get'](_0x54e5e9)||[];_0x3f9a0d[_0x5e2a36(0x18e)]({'name':_0x1381b1,'index':_0x4479e7}),_0x1e56ec[_0x5e2a36(0xc1)](_0x54e5e9,_0x3f9a0d),_0x4479e7++;}const _0x23031a=new Map();for(const [_0x20ef60,_0x5c8018]of _0x1e56ec){const _0x3b5d9c=_0x5c8018[_0x5e2a36(0xd0)]()[_0x5e2a36(0x157)]((_0x2e5b48,_0x49a43c)=>{const _0x27f5f1=_0x5e2a36,_0x42a9b2=_0x20a0c1[_0x27f5f1(0xe9)](_0x2e5b48[_0x27f5f1(0xfc)])||0x0,_0x273912=_0x20a0c1['get'](_0x49a43c[_0x27f5f1(0xfc)])||0x0;if(_0x42a9b2!==_0x273912)return _0x273912-_0x42a9b2;return _0x2e5b48[_0x27f5f1(0x18a)]-_0x49a43c[_0x27f5f1(0x18a)];})[_0x5e2a36(0x144)](_0x44066a=>_0x44066a[_0x5e2a36(0xfc)]),_0xf6834f=[];for(const _0x351061 of _0x3b5d9c){const _0x53bcbe=_0x20a0c1[_0x5e2a36(0xe9)](_0x351061)||0x0,_0x10e392=Math[_0x5e2a36(0x120)](_0x53bcbe,0x1);for(let _0x439882=0x0;_0x439882<_0x10e392;_0x439882++){_0xf6834f[_0x5e2a36(0x18e)](_0x351061);}}_0x23031a[_0x5e2a36(0xc1)](_0x20ef60,_0xf6834f);}return{'existingLocalSegmentNames':_0x5651e3,'localSegmentRules':_0x5648c8,'localExpandedRuleToNames':_0x23031a};}export function createSegmentIdResolver(_0x5aaa6d,_0xff64a9){return async _0x447dfd=>{const _0x36e1aa=a136_0x39b7,_0x108230=_0x5aaa6d[_0x36e1aa(0xe9)](_0x447dfd);if(!_0x108230)throw new SDKError(ErrorCode[_0x36e1aa(0x156)],'Segment\x20not\x20found:\x20'+_0x447dfd+_0x36e1aa(0x111)+_0xff64a9+'\x27)');return _0x108230;};}export function extractRootFolderId(_0x313a96){const _0x391292=a136_0x3aef17;return _0x313a96['relationships']?.[_0x391292(0xac)]?.[_0x391292(0x151)]?.['id']||_0x313a96['relationships']?.['parentFolder']?.[_0x391292(0x151)]?.['id'];}export function buildConnectionMaps(_0x836b62){const _0x2bfa00=a136_0x3aef17,_0x2e4ce8=new Map(),_0x97b11e=new Map(),_0x821cd4=new Map();for(const _0x19c461 of _0x836b62){_0x2e4ce8[_0x2bfa00(0xc1)](_0x19c461['name'],parseInt(_0x19c461['id'],0xa)),_0x97b11e['set'](_0x19c461['id'],_0x19c461[_0x2bfa00(0xfc)]),_0x821cd4[_0x2bfa00(0xc1)](_0x19c461[_0x2bfa00(0xfc)],_0x19c461[_0x2bfa00(0xbe)]);}return{'nameToId':_0x2e4ce8,'idToName':_0x97b11e,'nameToType':_0x821cd4};}export function calculatePushStats(_0x2031f3,_0x415eac,_0x3fe616,_0x280244,_0x1dd6dc,_0x5bcca7,_0x596da0){const _0x474823=a136_0x3aef17,_0x182960=_0x2031f3[_0x474823(0x10e)](_0x340b59=>_0x340b59[_0x474823(0x146)]),_0x5c86d3=_0x2031f3['filter'](_0x133e17=>!_0x133e17['isNew']&&_0x133e17['hasChanges']),_0x3b8069=_0x2031f3[_0x474823(0x10e)](_0x34ed9e=>!_0x34ed9e['isNew']&&!_0x34ed9e['hasChanges']),_0x19bd33=_0x5bcca7?_0x280244:[],_0x620c57=_0x415eac[_0x474823(0x10e)](_0x3a4c61=>_0x3a4c61[_0x474823(0x146)]),_0x3de342=_0x415eac[_0x474823(0x10e)](_0x27be0d=>!_0x27be0d[_0x474823(0x146)]&&_0x27be0d[_0x474823(0xda)]),_0x3db485=_0x415eac[_0x474823(0x10e)](_0x2f5feb=>!_0x2f5feb[_0x474823(0x146)]&&!_0x2f5feb[_0x474823(0xda)]),_0x73f72=_0x5bcca7?_0x1dd6dc:[],_0x1726c3=_0x2031f3['flatMap'](_0x541fb7=>_0x541fb7[_0x474823(0x129)]),_0x3e6bfa=_0x1726c3[_0x474823(0x10e)](_0xb20a14=>_0xb20a14[_0x474823(0xbe)]===_0x474823(0xc2)),_0x102e95=_0x1726c3[_0x474823(0x10e)](_0xd229a5=>_0xd229a5[_0x474823(0xbe)]===_0x474823(0x137)),_0xb86735=_0x1726c3['filter'](_0x13de6a=>_0x13de6a[_0x474823(0xbe)]===_0x474823(0x166)),_0x570aed=Array['from'](_0x3fe616)['sort'](),_0x2f127f=_0x596da0?![]:_0x182960[_0x474823(0x93)]>0x0||_0x5c86d3[_0x474823(0x93)]>0x0||_0x19bd33[_0x474823(0x93)]>0x0,_0x4bbcb6=_0x620c57[_0x474823(0x93)]>0x0||_0x3de342[_0x474823(0x93)]>0x0||_0x73f72[_0x474823(0x93)]>0x0,_0x4a8bd6=_0x596da0?![]:_0x1726c3[_0x474823(0x93)]>0x0,_0x29360b=_0x570aed['length']>0x0;return{'segments':{'new':_0x182960,'changed':_0x5c86d3,'unchanged':_0x3b8069,'toDelete':_0x19bd33},'journeys':{'new':_0x620c57,'changed':_0x3de342,'unchanged':_0x3db485,'toDelete':_0x73f72},'activations':{'all':_0x1726c3,'toCreate':_0x3e6bfa,'toUpdate':_0x102e95,'toDelete':_0xb86735},'folders':{'toCreate':_0x570aed},'counts':{'segments':{'new':_0x182960[_0x474823(0x93)],'changed':_0x5c86d3[_0x474823(0x93)],'unchanged':_0x3b8069[_0x474823(0x93)],'toDelete':_0x19bd33[_0x474823(0x93)]},'journeys':{'new':_0x620c57[_0x474823(0x93)],'changed':_0x3de342[_0x474823(0x93)],'unchanged':_0x3db485[_0x474823(0x93)],'toDelete':_0x73f72['length']},'activations':{'create':_0x3e6bfa[_0x474823(0x93)],'update':_0x102e95[_0x474823(0x93)],'delete':_0xb86735[_0x474823(0x93)]},'folders':_0x570aed[_0x474823(0x93)]},'hasChanges':_0x2f127f||_0x4bbcb6||_0x4a8bd6||_0x29360b};}export async function buildPushExecutionContext(_0x1d5138,_0x3bf6af,_0x1ab10a,_0x43af1d,_0x40ab54,_0x4c1079){const _0x17a9c9=a136_0x3aef17,_0x5c0fd6=extractRootFolderId(_0x1ab10a),{pathToId:_0x207c42,idToPath:_0x3b823d}=buildFolderMaps(_0x40ab54),_0x2674a7=buildSegmentNameToIdMap(_0x43af1d),_0x1ac936=new Map(),{batchAsync:_0x539291}=await import(_0x17a9c9(0xf1)),[_0x3fecb7,_0x1a09ad]=await Promise[_0x17a9c9(0x98)]([_0x1d5138[_0x17a9c9(0x170)]['buildUserMaps'](),_0x1d5138['connection'][_0x17a9c9(0x17f)](),((async()=>{const _0x55afdf=_0x17a9c9;!_0x4c1079&&_0x43af1d[_0x55afdf(0x93)]>0x0&&await _0x539291(_0x43af1d,async _0x312cfc=>{const _0x1ff942=_0x55afdf,_0xc8e223=await _0x1d5138['segment'][_0x1ff942(0x124)](_0x3bf6af,_0x312cfc['id']);_0x1ac936['set'](_0x312cfc['id'],_0xc8e223);});})())]),{emailToId:_0x4bc963,idToEmail:_0x4916f6}=_0x3fecb7,_0xe12ba9=buildConnectionMaps(_0x1a09ad);return{'rootFolderId':_0x5c0fd6,'folderPathToId':_0x207c42,'folderIdToPath':_0x3b823d,'segmentNameToId':_0x2674a7,'activationsBySegmentId':_0x1ac936,'emailToIdMap':_0x4bc963,'idToEmailMap':_0x4916f6,'connectionNameToIdMap':_0xe12ba9[_0x17a9c9(0x192)],'connectionIdToNameMap':_0xe12ba9[_0x17a9c9(0x18d)],'connectionNameToTypeMap':_0xe12ba9[_0x17a9c9(0xcd)]};}export function createPushYamlContextForBundle(_0x26a3e7,_0x733b5d,_0x240240,_0x27bb0f,_0x281d2b,_0x104c0d,_0x421a18,_0x5a795d){const {existingLocalSegmentNames:_0x9857c2,localExpandedRuleToNames:_0x20a1a3}=_0x27bb0f,_0x511da4=new Set(),_0x3e8b03=new Map(),_0x161ded=new Map(),_0x83c44a=new Map(),_0x2b93d8=createJumpTargetCache(),_0x14aba5=new Map(),_0x6a3172=new Map(),_0x29f194=new Set();let _0x1d1da1;const _0x3e84d2=_0x2ce74b=>{const _0x217d86={'resolveSegment':async _0x41e041=>{const _0x4c85e4=a136_0x39b7,_0x114671=_0x83c44a['get'](_0x41e041);if(_0x114671!==undefined)return{'name':_0x114671,'isJourneyLocal':!![]};try{const _0x1ea903=await fetchSegment(_0x26a3e7,_0x733b5d,_0x41e041,_0x240240);if(!_0x1ea903)throw new Error(_0x4c85e4(0x9e));const _0x354e60=generateJourneyLocalName(_0x1ea903[_0x4c85e4(0xfc)]),_0x4a0f98=_0x1ea903['kind']===SEGMENT_KIND_JOURNEY&&_0x354e60!==undefined;let _0x1a6242=_0x1ea903[_0x4c85e4(0xfc)],_0x407e65;if(_0x4a0f98&&_0x1ea903[_0x4c85e4(0xf0)]){const _0x109431=apiRuleToYaml(_0x1ea903[_0x4c85e4(0xf0)]);_0x6a3172['set'](_0x41e041,_0x109431);const _0x2e5a04=async _0x3c7d31=>{const _0x29f189=_0x4c85e4,_0x2ec105=collectSegmentRefsFromRule(_0x3c7d31);for(const _0x3c3493 of _0x2ec105){if(!_0x6a3172[_0x29f189(0x132)](_0x3c3493))try{const _0x285880=await fetchSegment(_0x26a3e7,_0x733b5d,_0x3c3493,_0x240240);if(_0x285880?.[_0x29f189(0xf0)]){const _0x5171fb=apiRuleToYaml(_0x285880['rule']);_0x6a3172[_0x29f189(0xc1)](_0x3c3493,_0x5171fb),await _0x2e5a04(_0x5171fb);}}catch(_0x41294f){logger[_0x29f189(0x101)](_0x29f189(0x91)+_0x3c3493+':\x20'+_0x41294f);}}};await _0x2e5a04(_0x109431);const _0x5a87fd=serializeExpandedRule(_0x109431,_0x6a3172),_0x13cec6=_0x20a1a3[_0x4c85e4(0xe9)](_0x5a87fd);if(_0x13cec6&&_0x13cec6[_0x4c85e4(0x93)]>0x0){const _0x2185b2=_0x3e8b03['get'](_0x5a87fd)||0x0,_0x5dc677=_0x13cec6[_0x2185b2]||_0x13cec6[_0x13cec6[_0x4c85e4(0x93)]-0x1];_0x3e8b03[_0x4c85e4(0xc1)](_0x5a87fd,_0x2185b2+0x1),_0x1a6242=_0x5dc677,_0x511da4[_0x4c85e4(0x99)](_0x1a6242),_0x83c44a['set'](_0x41e041,_0x1a6242);const _0x2421cb=await resolveRuleSegmentRefs(_0x109431,async _0x415507=>{const _0x5ced94=_0x4c85e4,_0x4e7ce2=_0x83c44a[_0x5ced94(0xe9)](_0x415507);if(_0x4e7ce2)return _0x4e7ce2;const _0x49ed1e=await _0x1d1da1['resolveSegment'](_0x415507);return _0x49ed1e[_0x5ced94(0xfc)];});_0x407e65={'description':_0x1ea903[_0x4c85e4(0x16b)],'rule':_0x2421cb};}else{const _0x508cc0=_0x14aba5[_0x4c85e4(0xe9)](_0x5a87fd);if(_0x508cc0)_0x1a6242=_0x508cc0,_0x83c44a[_0x4c85e4(0xc1)](_0x41e041,_0x1a6242);else{if(_0x354e60){let _0x569572=_0x354e60,_0x14b4d4=0x2;while(_0x511da4[_0x4c85e4(0x132)](_0x569572)||_0x9857c2[_0x4c85e4(0x132)](_0x569572)){_0x569572=_0x354e60+'_'+_0x14b4d4,_0x14b4d4++;}_0x511da4['add'](_0x569572),_0x1a6242=_0x569572;}_0x83c44a[_0x4c85e4(0xc1)](_0x41e041,_0x1a6242),_0x14aba5[_0x4c85e4(0xc1)](_0x5a87fd,_0x1a6242);const _0x408772=await resolveRuleSegmentRefs(_0x109431,async _0x508c09=>{const _0x5c2d82=_0x4c85e4,_0x4d6b6e=_0x83c44a[_0x5c2d82(0xe9)](_0x508c09);if(_0x4d6b6e)return _0x4d6b6e;const _0x3d7144=await _0x1d1da1['resolveSegment'](_0x508c09);return _0x3d7144[_0x5c2d82(0xfc)];});_0x407e65={'description':_0x1ea903[_0x4c85e4(0x16b)],'rule':_0x408772};}}}return{'name':_0x1a6242,'isJourneyLocal':_0x4a0f98,'definition':_0x407e65};}catch(_0x137a26){return logger[_0x4c85e4(0x101)](_0x4c85e4(0xce)+_0x41e041+':\x20'+_0x137a26),{'name':_0x41e041,'isJourneyLocal':![]};}},'resolveActivation':async _0x41622a=>{const _0x250713=a136_0x39b7,_0x165d05=_0x161ded[_0x250713(0xe9)](_0x41622a);if(_0x165d05!==undefined)return{'name':_0x165d05,'isJourneyLocal':!![]};try{let _0x2298e7=_0x421a18?.[_0x250713(0xe9)](_0x41622a);!_0x2298e7&&(_0x2298e7=await _0x26a3e7[_0x250713(0xd1)][_0x250713(0x100)](_0x2ce74b,_0x41622a));const _0x29a358=_0x2298e7[_0x250713(0x169)][_0x250713(0x18b)][_0x250713(0xfc)]||_0x41622a,_0x568d8b=sanitizeYamlKey(_0x29a358)||'activation_'+_0x41622a,_0x191938=_0x568d8b;_0x161ded['set'](_0x41622a,_0x191938);const _0x1b32c6=journeyActivationStepToYaml(_0x2298e7,_0x281d2b,_0x104c0d);return{'name':_0x191938,'isJourneyLocal':!![],'definition':_0x1b32c6};}catch(_0x2baa2b){return logger[_0x250713(0x101)]('Failed\x20to\x20resolve\x20activation\x20'+_0x41622a+':\x20'+_0x2baa2b),{'name':_0x41622a,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x476b7a,_0x54e8ad)=>resolveJumpTarget(_0x476b7a,_0x54e8ad,_0x2b93d8,async _0x5e75af=>{const _0x52adbe=a136_0x39b7,_0x1d4102=_0x5a795d?.['get'](_0x5e75af);if(_0x1d4102)return _0x1d4102;return _0x26a3e7[_0x52adbe(0xd1)]['getJourney'](_0x5e75af);})};return _0x1d1da1=_0x217d86,_0x217d86;},_0x20891b=async _0x53b4ef=>{const _0x2a23f8=a136_0x39b7,{collectSegmentIdsFromJourneyApi:_0x3e9b0f}=await import(_0x2a23f8(0x104)),{batchAsync:_0x413113}=await import('../../utils/async.js'),_0x39c801=new Set();for(const _0x3a831e of _0x53b4ef){let _0x29a586=_0x5a795d?.[_0x2a23f8(0xe9)](_0x3a831e);!_0x29a586&&(_0x29a586=await _0x26a3e7['journey'][_0x2a23f8(0x13f)](_0x3a831e));const _0x86bbb1=_0x3e9b0f(_0x29a586);for(const _0x20e7ef of _0x86bbb1){_0x39c801[_0x2a23f8(0x99)](_0x20e7ef);}}let _0x26dac4=Array[_0x2a23f8(0xed)](_0x39c801);while(_0x26dac4[_0x2a23f8(0x93)]>0x0){const _0x730cbf=_0x26dac4[_0x2a23f8(0x10e)](_0x5548ba=>!_0x29f194[_0x2a23f8(0x132)](_0x5548ba));if(_0x730cbf[_0x2a23f8(0x93)]===0x0)break;const _0x15e1ae=await _0x413113(_0x730cbf,async _0x2eb899=>{const _0x29b85f=_0x2a23f8;_0x29f194[_0x29b85f(0x99)](_0x2eb899);const _0x1e424e=await fetchSegment(_0x26a3e7,_0x733b5d,_0x2eb899,_0x240240);if(!_0x1e424e)return null;return{'segmentId':_0x2eb899,'segment':_0x1e424e};},0xa),_0x161ac3=new Set();for(const _0x166bfe of _0x15e1ae){if(!_0x166bfe?.[_0x2a23f8(0xa3)]?.[_0x2a23f8(0xf0)])continue;const _0x422c0c=apiRuleToYaml(_0x166bfe[_0x2a23f8(0xa3)][_0x2a23f8(0xf0)]);_0x6a3172[_0x2a23f8(0xc1)](_0x166bfe[_0x2a23f8(0x12c)],_0x422c0c);const _0x366493=collectSegmentRefsFromRule(_0x422c0c);for(const _0x1345ef of _0x366493){!_0x29f194[_0x2a23f8(0x132)](_0x1345ef)&&_0x161ac3[_0x2a23f8(0x99)](_0x1345ef);}}_0x26dac4=Array[_0x2a23f8(0xed)](_0x161ac3);}};return{'createYamlContext':_0x3e84d2,'prefetchJourneySegments':_0x20891b};}export async function executePushSegments(_0x56b03b,_0x43ad8c,_0x430813,_0x12b931,_0xae6e51){const _0x2b433a=a136_0x3aef17,{segmentDefToCreateRequest:_0xeac0a3,segmentDefToUpdateRequest:_0x3b2c34}=await import(_0x2b433a(0x145)),_0x10b75d=_0x430813[_0x2b433a(0xd7)],_0x1a0dd1=0x5,_0x394fa3=async _0x2141e9=>{const _0x2f6b08=_0x2b433a,_0x36179d=_0x2141e9['folderPath']?_0x10b75d[_0x2f6b08(0xe9)](_0x2141e9[_0x2f6b08(0x122)]):undefined;let _0x6ef5c1;const _0x309f5e={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x4ccad5=_0x2141e9[_0x2f6b08(0xb7)];if(_0x2141e9[_0x2f6b08(0xb7)]['rule']){const _0x310104=createSegmentIdResolver(_0x430813[_0x2f6b08(0x155)],_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xfc)]),_0x45e8a4=await resolveRuleSegmentIds(_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xf0)],_0x310104);_0x4ccad5={..._0x2141e9[_0x2f6b08(0xb7)],'rule':_0x45e8a4};}try{if(_0x2141e9[_0x2f6b08(0x146)]){_0xae6e51[_0x2f6b08(0x18f)]?.({'type':_0x2f6b08(0xd3),'name':_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xfc)]});const _0xeace0a=_0xeac0a3(_0x4ccad5,_0x36179d),_0x2a572c=await _0xae6e51[_0x2f6b08(0x14a)](_0x2f6b08(0x173)+_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xfc)]+_0x2f6b08(0x195),()=>_0x56b03b['segment']['createSegment'](_0x12b931[_0x2f6b08(0x126)],_0xeace0a));_0x6ef5c1=_0x2a572c['data']['id'],_0x430813[_0x2f6b08(0x155)][_0x2f6b08(0xc1)](_0x2141e9['yamlConfig'][_0x2f6b08(0xfc)],_0x6ef5c1),_0x309f5e[_0x2f6b08(0x187)]={'name':_0x2141e9['yamlConfig'][_0x2f6b08(0xfc)],'id':_0x6ef5c1},_0xae6e51[_0x2f6b08(0x18f)]?.({'type':_0x2f6b08(0xaf),'name':_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xfc)],'segmentId':_0x6ef5c1}),_0xae6e51[_0x2f6b08(0x12d)]?.('Created\x20segment\x20\x27'+_0x2141e9['yamlConfig'][_0x2f6b08(0xfc)]+'\x27'),_0x309f5e[_0x2f6b08(0x133)]=0x1;}else{if(_0x2141e9[_0x2f6b08(0xda)]){_0xae6e51[_0x2f6b08(0x18f)]?.({'type':'segment_updating','name':_0x2141e9[_0x2f6b08(0xb7)]['name']});const _0x9a8803=_0x3b2c34(_0x4ccad5);_0x36179d!==_0x2141e9[_0x2f6b08(0x183)]?.[_0x2f6b08(0x149)]&&(_0x9a8803[_0x2f6b08(0x149)]=_0x36179d?parseInt(_0x36179d,0xa):undefined),await _0xae6e51[_0x2f6b08(0x14a)](_0x2f6b08(0x194)+_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xfc)]+'\x27...',()=>_0x56b03b[_0x2f6b08(0xa3)][_0x2f6b08(0xc5)](_0x12b931['parentId'],_0x2141e9[_0x2f6b08(0x183)]['id'],_0x9a8803)),_0x6ef5c1=_0x2141e9[_0x2f6b08(0x183)]['id'],_0xae6e51[_0x2f6b08(0x18f)]?.({'type':'segment_updated','name':_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xfc)]}),_0xae6e51['logSuccess']?.('Updated\x20segment\x20\x27'+_0x2141e9['yamlConfig'][_0x2f6b08(0xfc)]+'\x27'),_0x309f5e['updated']=0x1;}else _0x6ef5c1=_0x2141e9[_0x2f6b08(0x183)]['id'];}}catch(_0x4f4321){const _0x3ee230=isHttp400Error(_0x4f4321),_0x2800ee=_0x3ee230?ErrorCode[_0x2f6b08(0xd9)]:ErrorCode[_0x2f6b08(0xf5)],_0x3141f8=getErrorMessage(_0x4f4321);throw new SDKError(_0x2800ee,_0x2f6b08(0xb9)+(_0x2141e9['isNew']?_0x2f6b08(0xc2):_0x2f6b08(0x137))+_0x2f6b08(0xde)+_0x2141e9[_0x2f6b08(0xf4)]+'\x0a\x20\x20'+_0x3141f8,_0x4f4321);}try{const _0x1e729d=await syncActivationsForSegment(_0x56b03b,_0x12b931['parentId'],_0x6ef5c1,_0x2141e9[_0x2f6b08(0xb7)][_0x2f6b08(0xfc)],_0x2141e9[_0x2f6b08(0x129)],_0xae6e51,_0x2141e9['absolutePath']);_0x309f5e[_0x2f6b08(0xa1)]=_0x1e729d;}catch(_0x252161){if(_0x252161 instanceof SDKError)throw _0x252161;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],_0x2f6b08(0xeb)+_0x2141e9[_0x2f6b08(0xb7)]['name']+_0x2f6b08(0x15b)+_0x2141e9['absolutePath']+_0x2f6b08(0x9b)+getErrorMessage(_0x252161),_0x252161);}return _0x309f5e;},_0x5500b9=await batchAsync(_0x43ad8c,_0x394fa3,_0x1a0dd1),_0x551f4a={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x5aed5d of _0x5500b9){_0x551f4a[_0x2b433a(0x133)]+=_0x5aed5d['created'],_0x551f4a['updated']+=_0x5aed5d['updated'],_0x5aed5d[_0x2b433a(0x187)]&&_0x551f4a[_0x2b433a(0xa6)]['set'](_0x5aed5d[_0x2b433a(0x187)][_0x2b433a(0xfc)],_0x5aed5d[_0x2b433a(0x187)]['id']),_0x551f4a[_0x2b433a(0xa1)][_0x2b433a(0x133)]+=_0x5aed5d[_0x2b433a(0xa1)][_0x2b433a(0x133)],_0x551f4a[_0x2b433a(0xa1)][_0x2b433a(0xca)]+=_0x5aed5d[_0x2b433a(0xa1)]['updated'],_0x551f4a[_0x2b433a(0xa1)][_0x2b433a(0x15f)]+=_0x5aed5d[_0x2b433a(0xa1)][_0x2b433a(0x15f)];}return _0x551f4a;}async function syncActivationsForSegment(_0xe64274,_0x33e7fb,_0x548dba,_0x47cd7e,_0x235ea2,_0x5ae290,_0x196785){const _0xf7547=a136_0x3aef17,_0x4c96f={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x3d56a6 of _0x235ea2){try{if(_0x3d56a6['type']===_0xf7547(0xc2)&&_0x3d56a6[_0xf7547(0x10f)])_0x5ae290[_0xf7547(0x18f)]?.({'type':_0xf7547(0x110),'segmentName':_0x47cd7e,'activationName':_0x3d56a6[_0xf7547(0xfc)]}),await _0x5ae290[_0xf7547(0x14a)](_0xf7547(0xe7)+_0x3d56a6[_0xf7547(0xfc)]+'\x27...',()=>_0xe64274['segment'][_0xf7547(0xbf)](_0x33e7fb,_0x548dba,_0x3d56a6['validatedRequest'])),_0x5ae290[_0xf7547(0x18f)]?.({'type':'activation_created','segmentName':_0x47cd7e,'activationName':_0x3d56a6[_0xf7547(0xfc)]}),_0x5ae290[_0xf7547(0x12d)]?.(_0xf7547(0xa8)+_0x3d56a6['name']+'\x27'),_0x4c96f['created']++;else{if(_0x3d56a6[_0xf7547(0xbe)]===_0xf7547(0x137)&&_0x3d56a6[_0xf7547(0x10f)]&&_0x3d56a6[_0xf7547(0x164)])_0x5ae290[_0xf7547(0x18f)]?.({'type':'activation_updating','segmentName':_0x47cd7e,'activationName':_0x3d56a6[_0xf7547(0xfc)]}),await _0x5ae290[_0xf7547(0x14a)](_0xf7547(0x17d)+_0x3d56a6['name']+_0xf7547(0x195),()=>_0xe64274[_0xf7547(0xa3)]['updateActivation'](_0x33e7fb,_0x548dba,_0x3d56a6[_0xf7547(0x164)]['id'],_0x3d56a6[_0xf7547(0x10f)])),_0x5ae290[_0xf7547(0x18f)]?.({'type':_0xf7547(0x125),'segmentName':_0x47cd7e,'activationName':_0x3d56a6[_0xf7547(0xfc)]}),_0x5ae290[_0xf7547(0x12d)]?.('Updated\x20activation\x20\x27'+_0x3d56a6['name']+'\x27'),_0x4c96f[_0xf7547(0xca)]++;else _0x3d56a6['type']===_0xf7547(0x166)&&_0x3d56a6[_0xf7547(0x164)]&&(_0x5ae290[_0xf7547(0x18f)]?.({'type':_0xf7547(0x184),'segmentName':_0x47cd7e,'activationName':_0x3d56a6['name']}),await _0x5ae290[_0xf7547(0x14a)](_0xf7547(0xff)+_0x3d56a6[_0xf7547(0xfc)]+'\x27...',()=>_0xe64274[_0xf7547(0xa3)]['deleteActivation'](_0x33e7fb,_0x548dba,_0x3d56a6[_0xf7547(0x164)]['id'])),_0x5ae290['onProgress']?.({'type':_0xf7547(0x10c),'segmentName':_0x47cd7e,'activationName':_0x3d56a6[_0xf7547(0xfc)]}),_0x5ae290[_0xf7547(0x178)]?.(_0xf7547(0xb4)+_0x3d56a6['name']+'\x27'),_0x4c96f[_0xf7547(0x15f)]++);}}catch(_0x3d0f3a){const _0x4e1c59=isHttp400Error(_0x3d0f3a),_0x2605f7=_0x4e1c59?ErrorCode['ACTIVATION_SYNTAX_ERROR']:ErrorCode[_0xf7547(0x17e)],_0x3bc20c=getErrorMessage(_0x3d0f3a);throw new SDKError(_0x2605f7,_0xf7547(0xb9)+_0x3d56a6[_0xf7547(0xbe)]+_0xf7547(0x158)+_0x3d56a6[_0xf7547(0xfc)]+'\x27\x20from\x20file:\x20'+_0x196785+'\x0a\x20\x20'+_0x3bc20c,_0x3d0f3a);}}return _0x4c96f;}export async function executePushFolders(_0x37a9ef,_0x41804c,_0x3f20f6,_0x5ed847,_0x2b9bd4){const _0x5187b1=a136_0x3aef17,_0x26ccac=new Map(_0x3f20f6),_0x5ae514=sortFoldersByDepth(_0x41804c);for(const _0xc22000 of _0x5ae514){const _0x53beea=_0xc22000['split']('/'),_0x2e7ad0=_0x53beea[_0x53beea[_0x5187b1(0x93)]-0x1],_0x2d07a7=_0x53beea['slice'](0x0,-0x1)[_0x5187b1(0x10d)]('/'),_0x398b26=_0x26ccac[_0x5187b1(0xe9)](_0x2d07a7);_0x2b9bd4['onProgress']?.({'type':_0x5187b1(0xe2),'folder':_0xc22000});const _0x1f1375={'name':_0x2e7ad0,'parentFolderId':_0x398b26},_0x1ee934=await _0x2b9bd4[_0x5187b1(0x14a)](_0x5187b1(0x161)+_0xc22000+_0x5187b1(0x195),()=>_0x37a9ef['segment'][_0x5187b1(0x15d)](_0x5ed847[_0x5187b1(0x126)],_0x1f1375));_0x26ccac['set'](_0xc22000,_0x1ee934[_0x5187b1(0x151)]['id']),_0x2b9bd4[_0x5187b1(0x18f)]?.({'type':'folder_created','folder':_0xc22000,'folderId':_0x1ee934[_0x5187b1(0x151)]['id']}),_0x2b9bd4['logInfo']?.('Created\x20folder\x20\x27'+_0xc22000+'\x27');}return _0x26ccac;}export async function executePushSegmentDeletions(_0x21f847,_0x3e04fa,_0x382ec4){const _0x490b6c=a136_0x3aef17;if(_0x3e04fa[_0x490b6c(0x93)]===0x0)return 0x0;const {batchAsync:_0x48aac2}=await import(_0x490b6c(0xf1)),_0x7625a4=0x5,_0x297cdb=await _0x48aac2(_0x3e04fa,async _0x3bd0d2=>{const _0x48f733=_0x490b6c;return _0x382ec4[_0x48f733(0x18f)]?.({'type':_0x48f733(0xc7),'name':_0x3bd0d2[_0x48f733(0xfc)]}),await _0x21f847['segment'][_0x48f733(0x191)](_0x3bd0d2['id']),_0x382ec4[_0x48f733(0x18f)]?.({'type':_0x48f733(0x14e),'name':_0x3bd0d2[_0x48f733(0xfc)]}),_0x382ec4['logDeleted']?.(_0x48f733(0x147)+_0x3bd0d2[_0x48f733(0xfc)]+'\x27'),0x1;},_0x7625a4);return _0x297cdb[_0x490b6c(0x11b)]((_0x4d5bb8,_0x4ca3f8)=>_0x4d5bb8+_0x4ca3f8,0x0);}export async function executePushJourneys(_0x581a02,_0x495535,_0x407c5f,_0x16f38b,_0x207705){const _0x33b8d0=a136_0x3aef17,{journeyDefToRequest:_0x1cb273}=await import(_0x33b8d0(0x104)),{activationDefToCreateRequest:_0x54668e,yamlRuleToApi:_0x2e68df,validateSegmentRule:_0x2e9c0a}=await import(_0x33b8d0(0x145)),_0x186083={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x383aae=new Map(_0x407c5f['segmentNameToId']),_0x429a0e=0x5;for(let _0x438a5f=0x0;_0x438a5f<_0x495535[_0x33b8d0(0x93)];_0x438a5f+=_0x429a0e){const _0x34488c=_0x495535[_0x33b8d0(0xd0)](_0x438a5f,_0x438a5f+_0x429a0e),_0x57611c=await Promise[_0x33b8d0(0x98)](_0x34488c[_0x33b8d0(0x144)](async _0x167b47=>{const _0x274e0b=_0x33b8d0;if(!_0x167b47[_0x274e0b(0x146)]&&!_0x167b47['hasChanges'])return{'action':_0x274e0b(0xe1),'name':_0x167b47[_0x274e0b(0xb7)][_0x274e0b(0xfc)],'journeyId':_0x167b47[_0x274e0b(0x14d)]?.['id']};const _0x33d8cb=_0x167b47[_0x274e0b(0x122)]?_0x407c5f[_0x274e0b(0xd7)]['get'](_0x167b47[_0x274e0b(0x122)]):undefined;_0x207705['onProgress']?.({'type':_0x167b47[_0x274e0b(0x146)]?_0x274e0b(0xc6):_0x274e0b(0xf7),'name':_0x167b47[_0x274e0b(0xb7)][_0x274e0b(0xfc)]});try{const _0x52f1ff=await executeSingleJourneyPush(_0x581a02,_0x167b47,{..._0x407c5f,'segmentNameToId':_0x383aae},{'parentId':_0x16f38b[_0x274e0b(0x126)],'rootFolderId':_0x16f38b[_0x274e0b(0x197)],'folderId':_0x33d8cb,'verbose':_0x16f38b[_0x274e0b(0x14f)]},_0x207705,{'journeyDefToRequest':_0x1cb273,'activationDefToCreateRequest':_0x54668e,'yamlRuleToApi':_0x2e68df,'validateSegmentRule':_0x2e9c0a});for(const [_0x57a1aa,_0x5b97b1]of _0x52f1ff[_0x274e0b(0xd5)]){_0x383aae['set'](_0x57a1aa,_0x5b97b1),_0x186083[_0x274e0b(0xd5)][_0x274e0b(0xc1)](_0x57a1aa,_0x5b97b1);}if(_0x52f1ff[_0x274e0b(0x165)]===_0x274e0b(0x133))_0x207705[_0x274e0b(0x18f)]?.({'type':_0x274e0b(0xb0),'name':_0x167b47['yamlConfig']['name'],'journeyId':_0x52f1ff[_0x274e0b(0xd6)]}),_0x207705[_0x274e0b(0x12d)]?.(_0x274e0b(0x102)+_0x167b47[_0x274e0b(0xb7)]['name']+'\x27'),_0x186083[_0x274e0b(0x133)]++;else _0x52f1ff['action']===_0x274e0b(0xca)&&(_0x207705[_0x274e0b(0x18f)]?.({'type':_0x274e0b(0x179),'name':_0x167b47[_0x274e0b(0xb7)][_0x274e0b(0xfc)]}),_0x207705[_0x274e0b(0x12d)]?.(_0x274e0b(0xbd)+_0x167b47[_0x274e0b(0xb7)][_0x274e0b(0xfc)]+'\x27'),_0x186083[_0x274e0b(0xca)]++);return{'action':_0x52f1ff[_0x274e0b(0x165)],'name':_0x167b47[_0x274e0b(0xb7)]['name'],'journeyId':_0x52f1ff['journeyId']};}catch(_0x2e7051){const _0xe5e043=isHttp400Error(_0x2e7051),_0x4ec547=_0xe5e043?ErrorCode[_0x274e0b(0x13b)]:ErrorCode['JOURNEY_UPDATE_ERROR'],_0x23af95=getErrorMessage(_0x2e7051);throw new SDKError(_0x4ec547,_0x274e0b(0xb9)+(_0x167b47[_0x274e0b(0x146)]?_0x274e0b(0xc2):_0x274e0b(0x137))+_0x274e0b(0x117)+_0x167b47[_0x274e0b(0xf4)]+'\x0a\x20\x20'+_0x23af95,_0x2e7051);}}));_0x186083[_0x33b8d0(0x9d)][_0x33b8d0(0x18e)](..._0x57611c);}return _0x186083;}async function matchExistingJourneySegments(_0x500d69,_0x3a23e3,_0x478fee,_0x44ab42,_0x1f6159){const _0x2674d8=a136_0x3aef17;if(!_0x3a23e3[_0x2674d8(0x14d)]||!_0x3a23e3[_0x2674d8(0xb7)]['segments'])return;const _0x484502=new Map(),_0x204ac9=new Set();for(const _0x4126c8 of Object[_0x2674d8(0x167)](_0x3a23e3[_0x2674d8(0xb7)][_0x2674d8(0x193)])){const _0x34f9e1=generateDeterministicJourneySegmentName(_0x3a23e3[_0x2674d8(0xb7)]['name'],_0x4126c8);_0x484502[_0x2674d8(0xc1)](_0x34f9e1,_0x4126c8),_0x204ac9['add'](_0x4126c8);}const _0x16b81d=[],_0x3bfff8=collectSegmentIdsFromJourneyApi(_0x3a23e3['existingJourney']);for(const _0x443fbd of _0x3bfff8){const _0x1118c4=await fetchSegment(_0x500d69,_0x478fee,_0x443fbd,_0x44ab42);if(!_0x1118c4?.[_0x2674d8(0xfc)])continue;const _0x4a33de=_0x484502['get'](_0x1118c4['name']);_0x4a33de?(_0x1f6159[_0x2674d8(0xc1)](_0x4a33de,_0x443fbd),_0x204ac9[_0x2674d8(0x166)](_0x4a33de)):_0x16b81d[_0x2674d8(0x18e)]({'id':_0x443fbd,'seg':_0x1118c4});}if(_0x204ac9[_0x2674d8(0x130)]>0x0&&_0x16b81d['length']>0x0){const {localExpandedRuleToNames:_0x136076}=buildLocalExpandedRuleMappings(_0x3a23e3[_0x2674d8(0xb7)]),_0x3d982a=new Map();for(const {id:_0x46528c,seg:_0x2cb712}of _0x16b81d){if(_0x2cb712[_0x2674d8(0xf0)]){const _0x218298=apiRuleToYaml(_0x2cb712['rule']);_0x3d982a[_0x2674d8(0xc1)](_0x46528c,_0x218298);}}for(const {id:_0x2816a3,seg:_0x49374e}of _0x16b81d){if(!_0x49374e['rule'])continue;const _0x20ac6c=_0x3d982a[_0x2674d8(0xe9)](_0x2816a3);if(!_0x20ac6c)continue;const _0x17323f=serializeExpandedRule(_0x20ac6c,_0x3d982a),_0x17499e=_0x136076[_0x2674d8(0xe9)](_0x17323f);if(_0x17499e){const _0x2e2d33=_0x17499e['find'](_0x4870b3=>_0x204ac9[_0x2674d8(0x132)](_0x4870b3));_0x2e2d33&&(_0x1f6159[_0x2674d8(0xc1)](_0x2e2d33,_0x2816a3),_0x204ac9[_0x2674d8(0x166)](_0x2e2d33),logger[_0x2674d8(0x101)](_0x2674d8(0x15c)+_0x49374e[_0x2674d8(0xfc)]+_0x2674d8(0xf8)+_0x2e2d33+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x37cc08,_0x1f191e,_0x324b05,_0x29f4c3,_0x3e4b26,_0x3e050f){const _0x4bccec=a136_0x3aef17,{journeyDefToRequest:_0x56d866,activationDefToCreateRequest:_0x442255,yamlRuleToApi:_0x30da48,validateSegmentRule:_0x4e16b3}=_0x3e050f,_0x37eb69=new Map(),_0x18f31d=new Map();recoverSegmentIdsFromPushRecovery(_0x1f191e,_0x37eb69,_0x324b05['segmentNameToId']);const _0x5ce731=new Map(),_0x6d7011=new Map(),_0x20dbab=new Map();let _0x2b1730;const _0x4967ea=async()=>{const _0xf0ab15=a136_0x39b7;if(_0x2b1730)return;_0x2b1730=new Map();if(!_0x1f191e[_0xf0ab15(0x14d)])return;const _0x451a02=await _0x37cc08[_0xf0ab15(0xd1)]['listActivations'](_0x1f191e['existingJourney']['id']);for(const _0x3f2c7d of _0x451a02){const _0x5201f7=journeyActivationStepToYaml(_0x3f2c7d,_0x324b05[_0xf0ab15(0xb2)],_0x324b05['connectionIdToNameMap']),_0x497e52=activationSignature(_0x5201f7);!_0x2b1730['has'](_0x497e52)&&_0x2b1730['set'](_0x497e52,_0x3f2c7d['id']),_0x5201f7[_0xf0ab15(0xfc)]&&_0x18f31d['set'](_0x5201f7[_0xf0ab15(0xfc)],_0x3f2c7d['id']);}};await matchExistingJourneySegments(_0x37cc08,_0x1f191e,_0x29f4c3[_0x4bccec(0x126)],_0x324b05[_0x4bccec(0x12b)],_0x324b05[_0x4bccec(0x155)]);const _0x5c588b={'resolveSegmentId':async _0x1eeec4=>{const _0x440c6a=_0x4bccec,_0x54c7ef=_0x324b05[_0x440c6a(0x155)][_0x440c6a(0xe9)](_0x1eeec4);if(!_0x54c7ef)throw new SDKError(ErrorCode[_0x440c6a(0x156)],_0x440c6a(0xba)+_0x1eeec4+_0x440c6a(0x180)+_0x1f191e[_0x440c6a(0xb7)]['name']+')');return _0x54c7ef;},'resolveEmbeddedSegmentId':async(_0x4c683a,_0x220b45)=>{const _0x2331f7=_0x4bccec,_0x5af733=_0x324b05[_0x2331f7(0x155)]['get'](_0x4c683a);if(_0x5af733)return _0x5af733;const _0x54f891=_0x324b05[_0x2331f7(0x12b)][_0x2331f7(0x135)](_0x3ae1e2=>_0x3ae1e2[_0x2331f7(0xfc)]===_0x4c683a);if(_0x54f891)return _0x324b05[_0x2331f7(0x155)]['set'](_0x4c683a,_0x54f891['id']),_0x54f891['id'];if(_0x1f191e[_0x2331f7(0x146)]){const {stageName:_0x4a048e,criteriaName:_0x2540b}=findSegmentCriteriaLocation(_0x1f191e[_0x2331f7(0xb7)],_0x4c683a);return _0x4e16b3(_0x4c683a,_0x220b45[_0x2331f7(0xf0)]),_0x6d7011['set'](_0x4c683a,{'definition':_0x220b45,'stageName':_0x4a048e,'criteriaName':_0x2540b}),createPendingSegmentId(_0x4c683a);}const _0x3b737a=_0x1f191e['existingJourney']?.['id'];if(!_0x3b737a)throw new SDKError(ErrorCode['INTERNAL'],_0x2331f7(0x16e));const _0x545431=_0x5ce731[_0x2331f7(0xe9)](_0x4c683a);if(_0x545431)return _0x545431;const _0x56e113=((async()=>{const _0x253958=_0x2331f7;_0x4e16b3(_0x4c683a,_0x220b45['rule']);const _0x24c0bf=generateDeterministicJourneySegmentName(_0x1f191e[_0x253958(0xb7)][_0x253958(0xfc)],_0x4c683a),_0x2ad4b0=_0x324b05['existingSegments']['find'](_0x36118b=>_0x36118b[_0x253958(0xfc)]===_0x24c0bf),_0x2da448=createSegmentIdResolver(_0x324b05['segmentNameToId'],_0x4c683a),_0x2bc6e7=await resolveRuleSegmentIds(_0x220b45[_0x253958(0xf0)],_0x2da448);let _0x3aad13;return _0x2ad4b0?(await _0x37cc08[_0x253958(0xa3)][_0x253958(0xc5)](_0x29f4c3[_0x253958(0x126)],_0x2ad4b0['id'],{'description':_0x220b45[_0x253958(0x16b)]||_0x253958(0xa0)+_0x4c683a,'rule':_0x30da48(_0x2bc6e7,!![]),'countPopulation':!![]}),_0x3aad13=_0x2ad4b0['id'],saveSegmentToPushRecovery(_0x1f191e[_0x253958(0xf4)],_0x1f191e['yamlConfig'][_0x253958(0xfc)],_0x4c683a,{'segmentId':_0x3aad13,'uniqueServerName':_0x24c0bf,'createdAt':new Date()['toISOString']()})):_0x3aad13=await createOrRecoverEmbeddedSegment(_0x37cc08,_0x1f191e,{'localName':_0x4c683a,'uniqueSegmentName':_0x24c0bf,'description':_0x220b45[_0x253958(0x16b)]||'Entry\x20criteria:\x20'+_0x4c683a,'journeyId':_0x3b737a,'resolvedRule':_0x2bc6e7,'parentId':_0x29f4c3[_0x253958(0x126)],'folderId':_0x29f4c3['rootFolderId']||''},_0x30da48),_0x324b05[_0x253958(0x155)][_0x253958(0xc1)](_0x4c683a,_0x3aad13),_0x37eb69['set'](_0x4c683a,_0x3aad13),_0x3aad13;})());_0x5ce731[_0x2331f7(0xc1)](_0x4c683a,_0x56e113);try{return await _0x56e113;}finally{_0x5ce731[_0x2331f7(0x166)](_0x4c683a);}},'resolveActivationId':async _0x5c04a2=>{const _0x5973dc=_0x4bccec,_0x71942b=_0x18f31d['get'](_0x5c04a2);if(_0x71942b)return _0x71942b;if(_0x1f191e[_0x5973dc(0x14d)]){await _0x4967ea();const _0x560747=_0x18f31d[_0x5973dc(0xe9)](_0x5c04a2);if(_0x560747)return _0x560747;}throw new SDKError(ErrorCode[_0x5973dc(0xd8)],_0x5973dc(0xd2)+_0x5c04a2+_0x5973dc(0x180)+_0x1f191e[_0x5973dc(0xb7)][_0x5973dc(0xfc)]+_0x5973dc(0x16a)+_0x5973dc(0x182));},'resolveEmbeddedActivationId':async(_0x5c2663,_0x33af14)=>{const _0x314b88=_0x4bccec,_0x50b792=_0x18f31d[_0x314b88(0xe9)](_0x5c2663);if(_0x50b792)return _0x50b792;if(_0x1f191e[_0x314b88(0x146)])return _0x20dbab['set'](_0x5c2663,_0x33af14),createPendingActivationId(_0x5c2663);if(_0x1f191e[_0x314b88(0x14d)]){await _0x4967ea();const _0xcf727a=_0x18f31d['get'](_0x33af14['name']);if(_0xcf727a)return _0x18f31d[_0x314b88(0xc1)](_0x5c2663,_0xcf727a),_0xcf727a;const _0x5ac48f=activationSignature(_0x33af14),_0x425294=_0x2b1730?.[_0x314b88(0xe9)](_0x5ac48f);if(_0x425294)return _0x18f31d[_0x314b88(0xc1)](_0x5c2663,_0x425294),_0x425294;const _0x40c106=await _0x442255(_0x33af14,_0x324b05[_0x314b88(0xa5)]),_0x2d17ae={..._0x40c106,..._0x33af14[_0x314b88(0x121)]!==undefined&&{'runAfterJourneyRefresh':_0x33af14[_0x314b88(0x121)]}},_0x40bd14=await _0x37cc08[_0x314b88(0xd1)][_0x314b88(0xbf)](_0x1f191e[_0x314b88(0x14d)]['id'],_0x2d17ae);return _0x18f31d['set'](_0x5c2663,_0x40bd14['id']),_0x40bd14['id'];}throw new SDKError(ErrorCode[_0x314b88(0xdb)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x4d9a2d=>{const _0x20eb03=_0x4bccec;try{return await _0x37cc08['journey'][_0x20eb03(0xdd)](_0x29f4c3[_0x20eb03(0x126)],_0x4d9a2d);}catch(_0xa4ff84){throw new SDKError(ErrorCode[_0x20eb03(0xd8)],_0x20eb03(0xa7)+_0x4d9a2d+_0x20eb03(0x127)+_0x1f191e[_0x20eb03(0xb7)][_0x20eb03(0xfc)]+'\x27)',_0xa4ff84);}},'resolveStageId':async(_0x5934fe,_0x7b04f9)=>{const _0x192496=_0x4bccec,_0xbc6bda=await _0x37cc08[_0x192496(0xd1)][_0x192496(0x13f)](_0x5934fe),_0x49ba9a=_0xbc6bda['attributes']['journeyStages'][_0x192496(0x135)](_0x5b2ae5=>_0x5b2ae5[_0x192496(0xfc)][_0x192496(0x12a)]()===_0x7b04f9[_0x192496(0x12a)]());if(!_0x49ba9a?.['id'])throw new SDKError(ErrorCode[_0x192496(0xd8)],_0x192496(0xb5)+_0x7b04f9+_0x192496(0xc0)+(_0xbc6bda[_0x192496(0x169)][_0x192496(0x15e)]||_0xbc6bda['attributes'][_0x192496(0xfc)])+'\x27');return _0x49ba9a['id'];}},_0x1f6b6a=await _0x56d866(_0x1f191e[_0x4bccec(0xb7)],_0x29f4c3[_0x4bccec(0x126)],_0x5c588b),_0x28a153=_0x29f4c3[_0x4bccec(0x10b)]||_0x29f4c3[_0x4bccec(0x197)];_0x28a153&&(_0x1f6b6a[_0x4bccec(0x11f)]={'parentFolder':{'data':{'id':_0x28a153,'type':_0x4bccec(0x198)}}});if(_0x1f191e[_0x4bccec(0x146)]){if(_0x6d7011[_0x4bccec(0x130)]>0x0||_0x20dbab[_0x4bccec(0x130)]>0x0)return await executeThreeStepJourneyCreate(_0x37cc08,_0x1f191e,_0x1f6b6a,{'pendingEmbeddedSegments':_0x6d7011,'pendingEmbeddedActivations':_0x20dbab,'embeddedSegmentNameToId':_0x37eb69,'journeyActivationNameToId':_0x18f31d},{..._0x29f4c3,'effectiveFolderId':_0x28a153},_0x324b05,_0x3e4b26,_0x3e050f);else{ensureJourneyDefaults(_0x1f6b6a[_0x4bccec(0x169)]);const _0x348165=await _0x37cc08[_0x4bccec(0xd1)]['create'](_0x1f6b6a);return deletePushRecovery(_0x1f191e[_0x4bccec(0xf4)]),{'action':_0x4bccec(0x133),'journeyId':_0x348165['id'],'embeddedSegmentNameToId':_0x37eb69};}}else{if(_0x1f191e[_0x4bccec(0xda)]&&_0x1f191e[_0x4bccec(0x14d)]){_0x1f6b6a['id']=_0x1f191e['existingJourney']['id'];const _0x2ff8c6=_0x1f6b6a[_0x4bccec(0x169)];_0x1f191e['existingJourney'][_0x4bccec(0x169)]?.[_0x4bccec(0x15e)]&&(_0x2ff8c6[_0x4bccec(0x15e)]=_0x1f191e[_0x4bccec(0x14d)][_0x4bccec(0x169)]['journeyBundleName']);const _0x46604b=_0x1f191e[_0x4bccec(0x14d)]['attributes']?.[_0x4bccec(0xab)];return _0x46604b&&_0x1f6b6a[_0x4bccec(0x169)][_0x4bccec(0xab)]&&injectExistingStageIds(_0x1f6b6a['attributes']['journeyStages'],_0x46604b),ensureJourneyDefaults(_0x2ff8c6),await _0x37cc08['journey']['update'](_0x1f191e[_0x4bccec(0x14d)]['id'],_0x1f6b6a),deletePushRecovery(_0x1f191e[_0x4bccec(0xf4)]),{'action':'updated','journeyId':_0x1f191e[_0x4bccec(0x14d)]['id'],'embeddedSegmentNameToId':_0x37eb69};}}return deletePushRecovery(_0x1f191e[_0x4bccec(0xf4)]),{'action':_0x4bccec(0xe1),'journeyId':_0x1f191e['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x37eb69};}function findSegmentCriteriaLocation(_0x443701,_0x307101){const _0x511ef4=a136_0x3aef17,_0x539799=_0x443701['stages']||_0x443701[_0x511ef4(0x17a)]?.[0x0]?.[_0x511ef4(0x97)]||[];let _0x4ade6b=_0x511ef4(0x103),_0x332062=_0x307101;const _0x56f544=_0x443701[_0x511ef4(0x116)]||_0x443701[_0x511ef4(0x17a)]?.[0x0]?.[_0x511ef4(0x116)];if(_0x56f544?.[_0x511ef4(0xa3)]===_0x307101)return{'stageName':_0x511ef4(0x116),'criteriaName':_0x56f544['name']||_0x307101};_0xdfa760:for(const _0x42a937 of _0x539799){if(_0x42a937[_0x511ef4(0x95)]?.[_0x511ef4(0xa3)]===_0x307101){_0x4ade6b=_0x42a937['name'],_0x332062=_0x42a937[_0x511ef4(0x95)][_0x511ef4(0xfc)]||_0x307101;break;}if(_0x42a937[_0x511ef4(0xa4)])for(const _0x3b0089 of _0x42a937['steps']){if(_0x3b0089[_0x511ef4(0xbe)]===_0x511ef4(0x134)&&_0x3b0089[_0x511ef4(0x16f)]?.[_0x511ef4(0x128)])for(const _0x1480cc of _0x3b0089['with']['branches']){if(_0x1480cc['segment']===_0x307101){_0x4ade6b=_0x42a937[_0x511ef4(0xfc)],_0x332062=_0x1480cc[_0x511ef4(0xfc)]||_0x307101;break _0xdfa760;}}}}return{'stageName':_0x4ade6b,'criteriaName':_0x332062};}async function executeThreeStepJourneyCreate(_0x52a2dd,_0x23444d,_0x1ed42c,_0x27afe8,_0x14ba59,_0x263708,_0x150a51,_0x4183c9){const _0x2ba583=a136_0x3aef17,{activationDefToCreateRequest:_0x5bddc8,yamlRuleToApi:_0x2334e6}=_0x4183c9,{pendingEmbeddedSegments:_0x54c776,pendingEmbeddedActivations:_0x337baa,embeddedSegmentNameToId:_0x882e6d}=_0x27afe8,_0x526760=JSON[_0x2ba583(0xf3)](JSON[_0x2ba583(0x185)](_0x1ed42c));ensureJourneyDefaults(_0x526760[_0x2ba583(0x169)]),stripPendingIds(_0x526760);const _0x2d3508=await _0x52a2dd[_0x2ba583(0xd1)][_0x2ba583(0xc2)](_0x526760),_0x5bd3ec=_0x2d3508['id'],_0x3fab16=new Map();for(const _0x58b89d of _0x2d3508['attributes'][_0x2ba583(0xab)]){_0x3fab16[_0x2ba583(0xc1)](_0x58b89d[_0x2ba583(0xfc)]['toLowerCase'](),_0x58b89d['id']);}recoverSegmentIdsFromPushRecovery(_0x23444d,_0x882e6d,_0x263708[_0x2ba583(0x155)]);for(const [_0x59ab25,{definition:_0x35377d}]of _0x54c776){if(_0x882e6d['has'](_0x59ab25)){_0x150a51['onProgress']?.({'type':_0x2ba583(0x13a),'journeyName':_0x23444d['yamlConfig'][_0x2ba583(0xfc)],'segmentName':_0x59ab25});continue;}const _0x39227d=generateDeterministicJourneySegmentName(_0x23444d[_0x2ba583(0xb7)][_0x2ba583(0xfc)],_0x59ab25);_0x150a51[_0x2ba583(0x18f)]?.({'type':_0x2ba583(0x17c),'journeyName':_0x23444d[_0x2ba583(0xb7)][_0x2ba583(0xfc)],'segmentName':_0x59ab25});const _0x65a3f9=createSegmentIdResolver(_0x263708[_0x2ba583(0x155)],_0x59ab25),_0x314341=await resolveRuleSegmentIds(_0x35377d[_0x2ba583(0xf0)],_0x65a3f9),_0xc14a93=await createOrRecoverEmbeddedSegment(_0x52a2dd,_0x23444d,{'localName':_0x59ab25,'uniqueSegmentName':_0x39227d,'description':_0x35377d[_0x2ba583(0x16b)]||_0x2ba583(0xa0)+_0x59ab25,'journeyId':_0x5bd3ec,'resolvedRule':_0x314341,'parentId':_0x14ba59[_0x2ba583(0x126)],'folderId':_0x14ba59[_0x2ba583(0x188)]||''},_0x2334e6);_0x882e6d[_0x2ba583(0xc1)](_0x59ab25,_0xc14a93),_0x263708['segmentNameToId']['set'](_0x59ab25,_0xc14a93),_0x150a51['onProgress']?.({'type':_0x2ba583(0x13a),'journeyName':_0x23444d[_0x2ba583(0xb7)][_0x2ba583(0xfc)],'segmentName':_0x59ab25});}const _0x26dc9b=new Map();for(const [_0x2d3905,_0x112f51]of _0x337baa){_0x150a51['onProgress']?.({'type':_0x2ba583(0x15a),'journeyName':_0x23444d[_0x2ba583(0xb7)][_0x2ba583(0xfc)],'activationName':_0x2d3905});const _0x21931d=await _0x5bddc8(_0x112f51,_0x263708[_0x2ba583(0xa5)]),_0x3e8707={..._0x21931d,..._0x112f51[_0x2ba583(0x121)]!==undefined&&{'runAfterJourneyRefresh':_0x112f51['run_after_journey_refresh']}},_0x4e11ce=await _0x52a2dd[_0x2ba583(0xd1)][_0x2ba583(0xbf)](_0x5bd3ec,_0x3e8707);_0x26dc9b['set'](_0x2d3905,_0x4e11ce['id']),_0x27afe8['journeyActivationNameToId'][_0x2ba583(0xc1)](_0x2d3905,_0x4e11ce['id']),_0x150a51['onProgress']?.({'type':'embedded_activation_created','journeyName':_0x23444d[_0x2ba583(0xb7)][_0x2ba583(0xfc)],'activationName':_0x2d3905});}const _0x522e36=JSON[_0x2ba583(0xf3)](JSON[_0x2ba583(0x185)](_0x1ed42c));return _0x522e36['id']=_0x5bd3ec,ensureJourneyDefaults(_0x522e36[_0x2ba583(0x169)]),resolvePendingIdsInRequest(_0x522e36,_0x1ed42c,_0x3fab16,_0x882e6d,_0x26dc9b,_0x150a51),await _0x52a2dd[_0x2ba583(0xd1)]['update'](_0x5bd3ec,_0x522e36),deletePushRecovery(_0x23444d[_0x2ba583(0xf4)]),{'action':_0x2ba583(0x133),'journeyId':_0x5bd3ec,'embeddedSegmentNameToId':_0x882e6d};}export function stripWaitStepPendingIds(_0x1e30ce){const _0x27dc66=a136_0x3aef17,_0x295f81=_0x1e30ce['conditionSegmentId']&&isPendingSegmentId(_0x1e30ce[_0x27dc66(0x168)]),_0x531708=_0x1e30ce[_0x27dc66(0xef)]?.[_0x27dc66(0xf2)](_0x4cc585=>_0x4cc585[_0x27dc66(0x12c)]&&isPendingSegmentId(_0x4cc585[_0x27dc66(0x12c)]));(_0x295f81||_0x531708)&&(_0x1e30ce['waitStepType']=_0x27dc66(0x9f),_0x1e30ce[_0x27dc66(0xbc)]=0x1,_0x1e30ce[_0x27dc66(0x109)]=_0x27dc66(0x172),delete _0x1e30ce[_0x27dc66(0x168)],delete _0x1e30ce[_0x27dc66(0x13e)],delete _0x1e30ce[_0x27dc66(0xa9)],delete _0x1e30ce[_0x27dc66(0xef)]);}export function resolveWaitStepPendingIds(_0x2bd6c3,_0x217391,_0x14aca5,_0x35f493){const _0x5bf910=a136_0x3aef17;if(_0x217391[_0x5bf910(0x168)]&&isPendingSegmentId(_0x217391[_0x5bf910(0x168)])){const _0x184dd3=_0x14aca5(_0x217391['conditionSegmentId'],_0x5bf910(0xaa)+_0x35f493+_0x5bf910(0xa2));_0x184dd3&&(_0x2bd6c3[_0x5bf910(0x123)]='Condition',_0x2bd6c3[_0x5bf910(0x168)]=_0x184dd3,delete _0x2bd6c3[_0x5bf910(0xbc)],delete _0x2bd6c3[_0x5bf910(0x109)],_0x217391['conditionTimeoutDuration']!==undefined&&(_0x2bd6c3[_0x5bf910(0x13e)]=_0x217391[_0x5bf910(0x13e)]),_0x217391[_0x5bf910(0xa9)]&&(_0x2bd6c3['conditionTimeoutUnit']=_0x217391[_0x5bf910(0xa9)]));}if(_0x217391['conditions']){const _0xf774af=_0x217391[_0x5bf910(0xef)]['some'](_0x466b7f=>_0x466b7f[_0x5bf910(0x12c)]&&isPendingSegmentId(_0x466b7f[_0x5bf910(0x12c)]));if(_0xf774af){const _0x1f1a71=_0x217391['conditions'][_0x5bf910(0x144)](_0x152672=>{const _0x586847=_0x5bf910;if(_0x152672['segmentId']&&isPendingSegmentId(_0x152672['segmentId'])){const _0x28a21f=_0x14aca5(_0x152672[_0x586847(0x12c)],'stage\x20\x27'+_0x35f493+'\x27\x20wait\x20condition');return{..._0x152672,'segmentId':_0x28a21f||_0x152672['segmentId']};}return{..._0x152672};});_0x2bd6c3['waitStepType']=_0x5bf910(0x175),_0x2bd6c3['conditions']=_0x1f1a71,delete _0x2bd6c3[_0x5bf910(0xbc)],delete _0x2bd6c3[_0x5bf910(0x109)],delete _0x2bd6c3[_0x5bf910(0x168)],delete _0x2bd6c3[_0x5bf910(0x13e)],delete _0x2bd6c3[_0x5bf910(0xa9)];}}}function stripPendingIds(_0x4219b4){const _0x3b33c3=a136_0x3aef17;_0x4219b4[_0x3b33c3(0x169)][_0x3b33c3(0x116)]?.[_0x3b33c3(0x12c)]&&isPendingSegmentId(_0x4219b4[_0x3b33c3(0x169)][_0x3b33c3(0x116)][_0x3b33c3(0x12c)])&&delete _0x4219b4['attributes'][_0x3b33c3(0x116)];for(const _0x5f0e78 of _0x4219b4['attributes'][_0x3b33c3(0xab)]||[]){_0x5f0e78[_0x3b33c3(0x12f)]?.[_0x3b33c3(0x12c)]&&isPendingSegmentId(_0x5f0e78[_0x3b33c3(0x12f)][_0x3b33c3(0x12c)])&&delete _0x5f0e78[_0x3b33c3(0x12f)];_0x5f0e78['milestone']?.[_0x3b33c3(0x12c)]&&isPendingSegmentId(_0x5f0e78[_0x3b33c3(0xb8)][_0x3b33c3(0x12c)])&&delete _0x5f0e78[_0x3b33c3(0xb8)];_0x5f0e78['exitCriterias']&&(_0x5f0e78[_0x3b33c3(0x18c)]=_0x5f0e78[_0x3b33c3(0x18c)][_0x3b33c3(0x10e)](_0x1914a2=>!_0x1914a2[_0x3b33c3(0x12c)]||!isPendingSegmentId(_0x1914a2[_0x3b33c3(0x12c)])));if(_0x5f0e78[_0x3b33c3(0xa4)])for(const _0xfab7ac of Object[_0x3b33c3(0x167)](_0x5f0e78['steps'])){const _0x3c93ae=_0x5f0e78[_0x3b33c3(0xa4)][_0xfab7ac];_0x3c93ae[_0x3b33c3(0xbe)]==='Activation'&&_0x3c93ae[_0x3b33c3(0x114)]&&isPendingActivationId(_0x3c93ae[_0x3b33c3(0x114)])&&(_0x3c93ae[_0x3b33c3(0x114)]='');if(_0x3c93ae[_0x3b33c3(0xbe)]===_0x3b33c3(0xc9)&&_0x3c93ae[_0x3b33c3(0x128)])for(const _0x375aff of _0x3c93ae['branches']){_0x375aff[_0x3b33c3(0x12c)]&&isPendingSegmentId(_0x375aff[_0x3b33c3(0x12c)])&&(_0x375aff[_0x3b33c3(0x12c)]='');}_0x3c93ae[_0x3b33c3(0xbe)]===_0x3b33c3(0x153)&&stripWaitStepPendingIds(_0x3c93ae);}}}function resolvePendingIdsInRequest(_0xfc6742,_0x67dab5,_0x31bfa7,_0x43e74e,_0x36ae09,_0x3fdf02){const _0x5bf514=a136_0x3aef17,_0x924e91=(_0x1629f5,_0x1b5785)=>{const _0x2d336d=a136_0x39b7;if(!isPendingSegmentId(_0x1629f5))return _0x1629f5;const _0x5b5dec=extractPendingSegmentName(_0x1629f5),_0x1cc50c=_0x43e74e[_0x2d336d(0xe9)](_0x5b5dec);return!_0x1cc50c&&_0x3fdf02['logWarning']?.(_0x2d336d(0x163)+_0x5b5dec+_0x2d336d(0xfd)+_0x1b5785),_0x1cc50c;};if(_0xfc6742['attributes'][_0x5bf514(0x116)]?.[_0x5bf514(0x12c)]&&isPendingSegmentId(_0xfc6742[_0x5bf514(0x169)][_0x5bf514(0x116)]['segmentId'])){const _0x237bb6=_0x924e91(_0xfc6742['attributes'][_0x5bf514(0x116)][_0x5bf514(0x12c)],_0x5bf514(0x186));_0x237bb6&&(_0xfc6742['attributes'][_0x5bf514(0x116)][_0x5bf514(0x12c)]=_0x237bb6);}for(const _0x393097 of _0xfc6742[_0x5bf514(0x169)]['journeyStages']||[]){const _0x5cdec4=_0x31bfa7[_0x5bf514(0xe9)](_0x393097[_0x5bf514(0xfc)][_0x5bf514(0x12a)]());_0x5cdec4&&(_0x393097['id']=_0x5cdec4);if(_0x393097['entryCriteria']?.[_0x5bf514(0x12c)]&&isPendingSegmentId(_0x393097[_0x5bf514(0x12f)][_0x5bf514(0x12c)])){const _0x2e8097=_0x924e91(_0x393097['entryCriteria'][_0x5bf514(0x12c)],_0x5bf514(0xaa)+_0x393097['name']+_0x5bf514(0x19a));_0x2e8097&&(_0x393097[_0x5bf514(0x12f)]['segmentId']=_0x2e8097);}if(_0x393097[_0x5bf514(0x18c)])for(const _0x4bd0ec of _0x393097['exitCriterias']){if(_0x4bd0ec[_0x5bf514(0x12c)]&&isPendingSegmentId(_0x4bd0ec[_0x5bf514(0x12c)])){const _0x11f839=_0x924e91(_0x4bd0ec[_0x5bf514(0x12c)],_0x5bf514(0xaa)+_0x393097[_0x5bf514(0xfc)]+_0x5bf514(0x13d));_0x11f839&&(_0x4bd0ec[_0x5bf514(0x12c)]=_0x11f839);}}if(_0x393097[_0x5bf514(0xb8)]?.[_0x5bf514(0x12c)]&&isPendingSegmentId(_0x393097['milestone']['segmentId'])){const _0x3d4d71=_0x924e91(_0x393097['milestone']['segmentId'],'stage\x20\x27'+_0x393097[_0x5bf514(0xfc)]+_0x5bf514(0x14c));_0x3d4d71&&(_0x393097[_0x5bf514(0xb8)][_0x5bf514(0x12c)]=_0x3d4d71);}if(_0x393097[_0x5bf514(0xa4)]){const _0x9dcb3a=_0x544d14=>_0x67dab5[_0x5bf514(0x169)][_0x5bf514(0xab)]?.[_0x5bf514(0x135)](_0x26e589=>_0x26e589[_0x5bf514(0xfc)]['toLowerCase']()===_0x393097['name'][_0x5bf514(0x12a)]())?.[_0x5bf514(0xa4)]?.[_0x544d14];for(const _0x4bb680 of Object[_0x5bf514(0x167)](_0x393097['steps'])){const _0xef151a=_0x393097['steps'][_0x4bb680],_0x3d0ee4=_0x9dcb3a(_0x4bb680);if(_0xef151a[_0x5bf514(0xbe)]==='Activation'&&_0xef151a['journeyActivationStepId']&&(isPendingActivationId(_0xef151a['journeyActivationStepId'])||_0xef151a[_0x5bf514(0x114)]==='')){if(_0x3d0ee4?.['journeyActivationStepId']&&isPendingActivationId(_0x3d0ee4[_0x5bf514(0x114)])){const _0x332c5f=extractPendingActivationName(_0x3d0ee4[_0x5bf514(0x114)]),_0x5c0155=_0x36ae09[_0x5bf514(0xe9)](_0x332c5f);_0x5c0155&&(_0xef151a[_0x5bf514(0x114)]=_0x5c0155);}}if(_0xef151a['type']===_0x5bf514(0xc9)&&_0xef151a['branches']&&_0x3d0ee4?.[_0x5bf514(0x128)])for(let _0x28698a=0x0;_0x28698a<_0xef151a['branches'][_0x5bf514(0x93)];_0x28698a++){const _0x3110ad=_0xef151a[_0x5bf514(0x128)][_0x28698a],_0x223c40=_0x3d0ee4[_0x5bf514(0x128)][_0x28698a];if(_0x223c40?.['segmentId']&&isPendingSegmentId(_0x223c40[_0x5bf514(0x12c)])){const _0x547db7=_0x924e91(_0x223c40[_0x5bf514(0x12c)],_0x5bf514(0xaa)+_0x393097[_0x5bf514(0xfc)]+_0x5bf514(0x196)+(_0x3110ad[_0x5bf514(0xfc)]||_0x28698a)+'\x27');_0x547db7&&(_0x3110ad[_0x5bf514(0x12c)]=_0x547db7);}}_0xef151a['type']===_0x5bf514(0x153)&&_0x3d0ee4?.[_0x5bf514(0xbe)]===_0x5bf514(0x153)&&resolveWaitStepPendingIds(_0xef151a,_0x3d0ee4,_0x924e91,_0x393097[_0x5bf514(0xfc)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a137_0x235f(_0xd2bdb6,_0x162aaf){_0xd2bdb6=_0xd2bdb6-0xd7;const _0x425dbb=a137_0x425d();let _0x235f04=_0x425dbb[_0xd2bdb6];return _0x235f04;}function a137_0x425d(){const _0x55f7d7=['180312nbmYPV','12Nncmxc','282255nLXxVn','set','331109wmuXRK','2191662JDNmVO','name','add','get','has','522991vsyBfu','1207220KNxWjZ','32xsmYNi','parentFolderId','944316OuullX'];a137_0x425d=function(){return _0x55f7d7;};return a137_0x425d();}(function(_0x34169c,_0x594f72){const _0x58d92f=a137_0x235f,_0x32ce70=_0x34169c();while(!![]){try{const _0x3f9b77=parseInt(_0x58d92f(0xe3))/0x1+parseInt(_0x58d92f(0xdf))/0x2+parseInt(_0x58d92f(0xe1))/0x3+parseInt(_0x58d92f(0xde))/0x4+parseInt(_0x58d92f(0xdb))/0x5+-parseInt(_0x58d92f(0xe0))/0x6*(-parseInt(_0x58d92f(0xda))/0x7)+parseInt(_0x58d92f(0xdc))/0x8*(-parseInt(_0x58d92f(0xe4))/0x9);if(_0x3f9b77===_0x594f72)break;else _0x32ce70['push'](_0x32ce70['shift']());}catch(_0x26d0d4){_0x32ce70['push'](_0x32ce70['shift']());}}}(a137_0x425d,0x29123));export function buildFolderIdToPathMap(_0x37c8de){const _0xd41608=a137_0x235f,_0x740157=new Map(),_0x54e6cc=new Map();for(const _0x4e12b3 of _0x37c8de){_0x54e6cc['set'](_0x4e12b3['id'],_0x4e12b3);}const _0x5e1fae=new Set();for(const _0x4bfc21 of _0x37c8de){!_0x4bfc21[_0xd41608(0xdd)]&&_0x5e1fae['add'](_0x4bfc21['id']);}function _0x58175c(_0x50fcc9){const _0xa50f76=_0xd41608;if(_0x740157[_0xa50f76(0xd9)](_0x50fcc9['id']))return _0x740157[_0xa50f76(0xd8)](_0x50fcc9['id']);if(_0x5e1fae[_0xa50f76(0xd9)](_0x50fcc9['id']))return _0x740157['set'](_0x50fcc9['id'],''),'';if(_0x50fcc9[_0xa50f76(0xdd)]){const _0x52fe19=_0x54e6cc[_0xa50f76(0xd8)](_0x50fcc9[_0xa50f76(0xdd)]);if(_0x52fe19){const _0x13653d=_0x58175c(_0x52fe19),_0x1855ca=_0x13653d?_0x13653d+'/'+_0x50fcc9['name']:_0x50fcc9[_0xa50f76(0xe5)];return _0x740157[_0xa50f76(0xe2)](_0x50fcc9['id'],_0x1855ca),_0x1855ca;}}const _0x4a8bfd=_0x50fcc9[_0xa50f76(0xe5)];return _0x740157[_0xa50f76(0xe2)](_0x50fcc9['id'],_0x4a8bfd),_0x4a8bfd;}for(const _0x263e83 of _0x37c8de){_0x58175c(_0x263e83);}return _0x740157;}export function buildFolderPathToIdMap(_0x24a2d0){const _0x35d697=a137_0x235f,_0x5e88cb=new Map(),_0x46635e=new Map();for(const _0x52331b of _0x24a2d0){_0x46635e[_0x35d697(0xe2)](_0x52331b['id'],_0x52331b);}const _0x107c16=new Set();for(const _0xca067b of _0x24a2d0){!_0xca067b['parentFolderId']&&_0x107c16[_0x35d697(0xd7)](_0xca067b['id']);}function _0x1a1917(_0xd440e1){const _0x33642f=_0x35d697;if(_0x107c16[_0x33642f(0xd9)](_0xd440e1['id']))return'';if(_0xd440e1[_0x33642f(0xdd)]){const _0x15873d=_0x46635e['get'](_0xd440e1['parentFolderId']);if(_0x15873d){const _0x3d8bcd=_0x1a1917(_0x15873d);return _0x3d8bcd?_0x3d8bcd+'/'+_0xd440e1[_0x33642f(0xe5)]:_0xd440e1['name'];}}return _0xd440e1[_0x33642f(0xe5)];}for(const _0x48b4ba of _0x24a2d0){const _0x58ffa5=_0x1a1917(_0x48b4ba);_0x5e88cb[_0x35d697(0xe2)](_0x58ffa5,_0x48b4ba['id']);}return _0x5e88cb;}export function buildFolderMaps(_0xed5013){const _0x55b809=a137_0x235f,_0x3ceb94=buildFolderIdToPathMap(_0xed5013),_0x150be6=new Map();for(const [_0x546b70,_0x2e2cd6]of _0x3ceb94){_0x150be6[_0x55b809(0xe2)](_0x2e2cd6,_0x546b70);}return{'idToPath':_0x3ceb94,'pathToId':_0x150be6};}export function getFolderPath(_0x3bbd04,_0x36e11a){const _0x3d0e13=a137_0x235f;if(!_0x3bbd04)return'';return _0x36e11a[_0x3d0e13(0xd8)](_0x3bbd04)??'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x216153,_0x3ac2a0){const _0x25e573=a138_0x5c38,_0x3ea021=_0x216153();while(!![]){try{const _0x256c51=-parseInt(_0x25e573(0xa7))/0x1+parseInt(_0x25e573(0xa9))/0x2*(parseInt(_0x25e573(0x9f))/0x3)+parseInt(_0x25e573(0x87))/0x4*(parseInt(_0x25e573(0x88))/0x5)+parseInt(_0x25e573(0x8e))/0x6*(-parseInt(_0x25e573(0xa4))/0x7)+parseInt(_0x25e573(0xad))/0x8+-parseInt(_0x25e573(0x7e))/0x9*(parseInt(_0x25e573(0xa6))/0xa)+parseInt(_0x25e573(0x85))/0xb*(-parseInt(_0x25e573(0x9d))/0xc);if(_0x256c51===_0x3ac2a0)break;else _0x3ea021['push'](_0x3ea021['shift']());}catch(_0x2cd5a7){_0x3ea021['push'](_0x3ea021['shift']());}}}(a138_0x15ce,0x536da));import a138_0x43ca0a from'path';import{parse as a138_0x324d2d}from'yaml';function a138_0x5c38(_0x1338df,_0x2f5015){_0x1338df=_0x1338df-0x7e;const _0x15cec8=a138_0x15ce();let _0x5c38e4=_0x15cec8[_0x1338df];return _0x5c38e4;}import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x5b8f77){const _0x1bfe4a=a138_0x5c38;if(!_0x5b8f77||_0x5b8f77[_0x1bfe4a(0x8d)]()==='')throw new Error('Path\x20cannot\x20be\x20empty');const _0x33ddac=_0x5b8f77[_0x1bfe4a(0x8d)]();if(_0x33ddac==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x5b8f77};const _0x4352de=_0x33ddac[_0x1bfe4a(0xa2)]('/')?_0x33ddac[_0x1bfe4a(0xa3)](0x1):_0x33ddac,_0x206b89=_0x4352de[_0x1bfe4a(0x92)]('/')['filter'](_0x107fab=>_0x107fab!=='');if(_0x206b89['length']===0x0)throw new Error(_0x1bfe4a(0x89));const _0x4525a7=_0x33ddac[_0x1bfe4a(0xa2)]('/')||!isRelativePathSegment(_0x206b89[0x0]);for(const _0x413c8b of _0x206b89){validatePathSegment(_0x413c8b);}return{'segments':_0x206b89,'isAbsolute':_0x4525a7,'raw':_0x5b8f77};}function isRelativePathSegment(_0x5aaabf){return _0x5aaabf==='.'||_0x5aaabf==='..';}function validatePathSegment(_0x51751d){const _0x35627c=a138_0x5c38;if(_0x51751d==='')throw new Error('Path\x20segment\x20cannot\x20be\x20empty');if(_0x51751d==='.'||_0x51751d==='..')return;if(/[\x00-\x1F\x7F]/[_0x35627c(0x96)](_0x51751d))throw new Error(_0x35627c(0x83)+_0x51751d);if(_0x51751d!==_0x51751d[_0x35627c(0x8d)]()){}}function a138_0x15ce(){const _0x126304=['isAbsolute','469048FuFvyJ','journey','join','type','5223784kqaAcC','185616CjtMGN','tdx.json','.yaml','root','No\x20tdx.json\x20found\x20for\x20file:\x20','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','Cannot\x20split\x20empty\x20path','764786vSYOmP','Path\x20attempts\x20to\x20navigate\x20above\x20root','4meCpIX','2953350OGXkkn','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','parent_segment','dirname','parse','trim','641790ySLJrQ','push','segment','length','split','relative','readFile','Relative\x20path\x20cannot\x20be\x20empty','test','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','endsWith','File\x20not\x20found:\x20','name','Cannot\x20navigate\x20above\x20root','replace','36szvQts','segments','3WUHGUJ','exists','slice','startsWith','substring','21FWLCtq','raw','160AvYuLd','276988HxIIKS'];a138_0x15ce=function(){return _0x126304;};return a138_0x15ce();}export function validatePath(_0x500579){const _0x1b6793=a138_0x5c38;if(_0x500579[_0x1b6793(0x9e)]['length']===0x0&&!_0x500579[_0x1b6793(0xa8)])throw new Error(_0x1b6793(0x95));if(_0x500579[_0x1b6793(0xa8)]){if(_0x500579[_0x1b6793(0x9e)][0x0]==='..')throw new Error('Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22');let _0x1003c5=0x0;for(const _0x1cd151 of _0x500579[_0x1b6793(0x9e)]){if(_0x1cd151==='..'){if(_0x1003c5===0x0)throw new Error(_0x1b6793(0x86));_0x1003c5--;}else _0x1cd151!=='.'&&_0x1003c5++;}}}export function joinPaths(_0x1015ea,_0x134ea0){const _0x17b3a1=a138_0x5c38;if(!_0x1015ea||_0x1015ea==='/')return _0x134ea0;if(!_0x134ea0||_0x134ea0==='.')return _0x1015ea;if(_0x134ea0['startsWith']('/'))return _0x134ea0;const _0x488585=parsePath(_0x1015ea),_0x336107=parsePath(_0x134ea0),_0x334ed9=[..._0x488585['segments']];for(const _0x36675b of _0x336107[_0x17b3a1(0x9e)]){if(_0x36675b==='.')continue;else{if(_0x36675b==='..'){if(_0x334ed9['length']===0x0)throw new Error(_0x17b3a1(0x9b));_0x334ed9['pop']();}else _0x334ed9[_0x17b3a1(0x8f)](_0x36675b);}}const _0x5ba196=_0x334ed9[_0x17b3a1(0xab)]('/');return _0x488585[_0x17b3a1(0xa5)]['startsWith']('/')?'/'+_0x5ba196:_0x5ba196;}export function normalizePath(_0x596899){const _0xd42d44=a138_0x5c38,_0x2af4ef=parsePath(_0x596899),_0xe5dc39=[];for(const _0xfcd9e2 of _0x2af4ef[_0xd42d44(0x9e)]){if(_0xfcd9e2==='.')continue;else{if(_0xfcd9e2==='..'){if(_0xe5dc39['length']===0x0){if(_0x2af4ef[_0xd42d44(0xa8)])throw new Error(_0xd42d44(0x9b));_0xe5dc39[_0xd42d44(0x8f)]('..');}else _0xe5dc39[_0xe5dc39['length']-0x1]==='..'?_0xe5dc39[_0xd42d44(0x8f)]('..'):_0xe5dc39['pop']();}else _0xe5dc39[_0xd42d44(0x8f)](_0xfcd9e2);}}if(_0xe5dc39[_0xd42d44(0x91)]===0x0)return _0x2af4ef[_0xd42d44(0xa8)]?'/':'.';const _0x537f8d=_0xe5dc39[_0xd42d44(0xab)]('/');return _0x2af4ef[_0xd42d44(0xa5)]['startsWith']('/')?'/'+_0x537f8d:_0x537f8d;}export function getParentPath(_0x5f193d){const _0x570c93=a138_0x5c38,_0x31fde7=parsePath(_0x5f193d);if(_0x31fde7['segments'][_0x570c93(0x91)]<=0x1)return'/';const _0x2486f8=_0x31fde7['segments'][_0x570c93(0xa1)](0x0,-0x1)['join']('/');return _0x31fde7[_0x570c93(0xa5)]['startsWith']('/')?'/'+_0x2486f8:_0x2486f8;}export function getBaseName(_0x1b0a05){const _0x13b728=a138_0x5c38,_0x117f15=parsePath(_0x1b0a05);return _0x117f15['segments'][_0x117f15[_0x13b728(0x9e)][_0x13b728(0x91)]-0x1]||'';}export function isChildPath(_0x1754b4,_0x124fb6){const _0x231aaa=a138_0x5c38,_0x44d61d=parsePath(_0x1754b4),_0x183490=parsePath(_0x124fb6);if(_0x44d61d[_0x231aaa(0x9e)]['length']<=_0x183490[_0x231aaa(0x9e)][_0x231aaa(0x91)])return![];for(let _0x20c569=0x0;_0x20c569<_0x183490['segments'][_0x231aaa(0x91)];_0x20c569++){if(_0x44d61d[_0x231aaa(0x9e)][_0x20c569]!==_0x183490['segments'][_0x20c569])return![];}return!![];}export function splitPath(_0x58f2e8){const _0x31b67a=a138_0x5c38,_0x2ed653=parsePath(_0x58f2e8);if(_0x2ed653[_0x31b67a(0x9e)][_0x31b67a(0x91)]===0x0)throw new Error(_0x31b67a(0x84));if(_0x2ed653[_0x31b67a(0x9e)][_0x31b67a(0x91)]===0x1)return{'parent':_0x2ed653[_0x31b67a(0x9e)][0x0]};return{'parent':_0x2ed653[_0x31b67a(0x9e)][0x0],'child':_0x2ed653['segments']['slice'](0x1)[_0x31b67a(0xab)]('/')};}export function isYamlFilePath(_0x4197c3){const _0x396eb1=a138_0x5c38;return _0x4197c3[_0x396eb1(0x98)]('.yml')||_0x4197c3[_0x396eb1(0x98)](_0x396eb1(0x80));}export async function resolveYamlFilePath(_0x1b80eb,_0x4d5fa5=nodeFileSystem){const _0x42bcc6=a138_0x5c38,_0x341a3e=a138_0x43ca0a['resolve'](_0x1b80eb);if(!await _0x4d5fa5[_0x42bcc6(0xa0)](_0x341a3e))throw new Error(_0x42bcc6(0x99)+_0x1b80eb);let _0x284a17=a138_0x43ca0a[_0x42bcc6(0x8b)](_0x341a3e),_0x44498b=null,_0x3bb483=null;const _0x31527a=a138_0x43ca0a['parse'](_0x284a17)[_0x42bcc6(0x81)];while(_0x284a17!==_0x31527a){const _0xccd242=a138_0x43ca0a[_0x42bcc6(0xab)](_0x284a17,_0x42bcc6(0x7f));if(await _0x4d5fa5[_0x42bcc6(0xa0)](_0xccd242)){_0x44498b=_0xccd242,_0x3bb483=_0x284a17;break;}_0x284a17=a138_0x43ca0a['dirname'](_0x284a17);}if(!_0x44498b||!_0x3bb483)throw new Error(_0x42bcc6(0x82)+_0x1b80eb+'\x0a'+'Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.');const _0x4fcb1f=await _0x4d5fa5['readFile'](_0x44498b),_0x266cf2=JSON[_0x42bcc6(0x8c)](_0x4fcb1f),_0x195ec1=_0x266cf2[_0x42bcc6(0x8a)];if(!_0x195ec1)throw new Error(_0x42bcc6(0x97));const _0x51edce=await _0x4d5fa5[_0x42bcc6(0x94)](_0x341a3e),_0x1b618a=a138_0x324d2d(_0x51edce),_0x2a8285=_0x1b618a[_0x42bcc6(0x9a)];if(!_0x2a8285)throw new Error('Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20'+_0x1b80eb);const _0xef1b69=_0x1b618a[_0x42bcc6(0xac)]==='journey'?_0x42bcc6(0xaa):_0x42bcc6(0x90),_0x4197ad=a138_0x43ca0a[_0x42bcc6(0x93)](_0x3bb483,_0x341a3e),_0x48bdf0=a138_0x43ca0a['dirname'](_0x4197ad),_0x2a76fb=_0x48bdf0==='.'?'':_0x48bdf0[_0x42bcc6(0x9c)](/\\/g,'/'),_0x1e63f5=_0x2a76fb?_0x195ec1+'/'+_0x2a76fb+'/'+_0x2a8285:_0x195ec1+'/'+_0x2a8285;return{'parentSegment':_0x195ec1,'segmentName':_0x2a8285,'folderPath':_0x2a76fb,'fullPath':_0x1e63f5,'resourceType':_0xef1b69,'content':_0x51edce};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a139_0x54ad(){const _0x4f32e6=['indexOf','769836SmlroS','176sdxnPv','261OeHApW','Invalid\x20segment\x20reference\x20format:\x20','.\x20Child\x20name\x20cannot\x20be\x20empty','588bimNds','37928vtFMgk','2292978vPURRK','519002lTVpdN','8DehKmL','substring','4810Rjtrig','573986EnmtZX','734979lZXiqe','5NtMeuQ'];a139_0x54ad=function(){return _0x4f32e6;};return a139_0x54ad();}(function(_0x522686,_0x1d44ef){const _0x4d8bd3=a139_0x219b,_0xdf793b=_0x522686();while(!![]){try{const _0x365c77=parseInt(_0x4d8bd3(0xf0))/0x1+parseInt(_0x4d8bd3(0xec))/0x2+-parseInt(_0x4d8bd3(0xe1))/0x3*(-parseInt(_0x4d8bd3(0xed))/0x4)+parseInt(_0x4d8bd3(0xe2))/0x5*(-parseInt(_0x4d8bd3(0xeb))/0x6)+parseInt(_0x4d8bd3(0xe9))/0x7*(parseInt(_0x4d8bd3(0xea))/0x8)+-parseInt(_0x4d8bd3(0xe6))/0x9*(-parseInt(_0x4d8bd3(0xef))/0xa)+parseInt(_0x4d8bd3(0xe5))/0xb*(-parseInt(_0x4d8bd3(0xe4))/0xc);if(_0x365c77===_0x1d44ef)break;else _0xdf793b['push'](_0xdf793b['shift']());}catch(_0x3d9962){_0xdf793b['push'](_0xdf793b['shift']());}}}(a139_0x54ad,0x4fd8f));function a139_0x219b(_0x2c8540,_0x162889){_0x2c8540=_0x2c8540-0xe1;const _0x54ad4c=a139_0x54ad();let _0x219bef=_0x54ad4c[_0x2c8540];return _0x219bef;}export function parseSegmentRef(_0x1e0e6f){const _0x33970e=a139_0x219b,_0x3a33c6=_0x1e0e6f[_0x33970e(0xe3)]('/');if(_0x3a33c6===-0x1)return{'parentId':_0x1e0e6f};if(_0x3a33c6===0x0)throw new Error(_0x33970e(0xe7)+_0x1e0e6f+'.\x20Parent\x20name\x20cannot\x20be\x20empty');const _0x45809f=_0x1e0e6f[_0x33970e(0xee)](0x0,_0x3a33c6),_0x78efd0=_0x1e0e6f[_0x33970e(0xee)](_0x3a33c6+0x1);if(_0x78efd0==='')throw new Error('Invalid\x20segment\x20reference\x20format:\x20'+_0x1e0e6f+_0x33970e(0xe8));return{'parentId':_0x45809f,'childId':_0x78efd0};}
|