@treasuredata/tdx 2026.6.1 → 2026.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +2 -2
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +23 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workflow.d.ts +1 -1
- package/dist/sdk/types/workflow.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +23 -2
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.d.ts +4 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js.map +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a155_0x3e8afc=a155_0x4ade;(function(_0x45304d,_0x1874d4){const _0x3b7323=a155_0x4ade,_0x58f268=_0x45304d();while(!![]){try{const _0x4438e6=parseInt(_0x3b7323(0x158))/0x1*(parseInt(_0x3b7323(0x143))/0x2)+-parseInt(_0x3b7323(0x18d))/0x3+parseInt(_0x3b7323(0x197))/0x4*(-parseInt(_0x3b7323(0x1e5))/0x5)+parseInt(_0x3b7323(0x149))/0x6*(parseInt(_0x3b7323(0x14f))/0x7)+parseInt(_0x3b7323(0x1cb))/0x8*(-parseInt(_0x3b7323(0x1a3))/0x9)+-parseInt(_0x3b7323(0x228))/0xa*(-parseInt(_0x3b7323(0x161))/0xb)+parseInt(_0x3b7323(0x1c3))/0xc*(-parseInt(_0x3b7323(0x178))/0xd);if(_0x4438e6===_0x1874d4)break;else _0x58f268['push'](_0x58f268['shift']());}catch(_0x4680a8){_0x58f268['push'](_0x58f268['shift']());}}}(a155_0x3ac6,0x3a503));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x3e8afc(0x211));export const PENDING_SEGMENT_PREFIX='__pending_';export const PENDING_ACTIVATION_PREFIX=a155_0x3e8afc(0x1ad);export function createPendingSegmentId(_0x5d9d86){return''+PENDING_SEGMENT_PREFIX+_0x5d9d86+'__';}export function isPendingSegmentId(_0x379c86){const _0x1c598a=a155_0x3e8afc;return _0x379c86['startsWith'](PENDING_SEGMENT_PREFIX)&&!_0x379c86[_0x1c598a(0x238)](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x114a00){const _0x493668=a155_0x3e8afc;return _0x114a00[_0x493668(0x199)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x57709f){return''+PENDING_ACTIVATION_PREFIX+_0x57709f+'__';}export function isPendingActivationId(_0x37e375){return _0x37e375['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0x111bfb){return _0x111bfb['replace'](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x575a81,_0x1e8c63){const _0x323385=a155_0x3e8afc,_0x2b45a2=_0x575a81+'::'+(_0x1e8c63[_0x323385(0x23d)]()||_0x323385(0x1cf)),_0x708fde=createHash(_0x323385(0x200))[_0x323385(0x206)](_0x2b45a2)['digest'](_0x323385(0x1a1))[_0x323385(0x195)](0x0,0xc);return _0x323385(0x14d)+_0x708fde;}export function ensureJourneyDefaults(_0x316b01){const _0x1764bd=a155_0x3e8afc;!_0x316b01[_0x1764bd(0x214)]&&(_0x316b01['description']=''),!_0x316b01['state']&&(_0x316b01['state']=_0x1764bd(0x18b));}export function injectExistingStageIds(_0x19ae9e,_0x51cdf6){const _0x28e2b1=a155_0x3e8afc,_0x81d7c7=new Map(_0x51cdf6[_0x28e2b1(0x1ef)](_0x50458f=>[_0x50458f[_0x28e2b1(0x1ea)],_0x50458f['id']]));for(const _0x45a01c of _0x19ae9e){if(!_0x45a01c['id']){const _0x3af461=_0x81d7c7[_0x28e2b1(0x1bd)](_0x45a01c[_0x28e2b1(0x1ea)]);_0x3af461&&(_0x45a01c['id']=_0x3af461);}}}export function resolveTDFolderPath(_0x5d861c,_0x148959,_0x45b650){const _0xa8e920=a155_0x3e8afc;if(!_0x148959)return _0x5d861c;if(_0x5d861c===_0x45b650||_0x5d861c[_0xa8e920(0x238)](_0x45b650+'/'))return _0x5d861c;return _0x5d861c?_0x45b650+'/'+_0x5d861c:_0x45b650;}export function addFoldersToCreate(_0x3f6ef8,_0x4ec148,_0x3e95e2){const _0x4fa041=a155_0x3e8afc;if(!_0x3f6ef8)return;if(_0x4ec148[_0x4fa041(0x1c9)](_0x3f6ef8))return;const _0x26d32e=_0x3f6ef8['split']('/');let _0x2fe9a2='';for(const _0x45dff4 of _0x26d32e){_0x2fe9a2=_0x2fe9a2?_0x2fe9a2+'/'+_0x45dff4:_0x45dff4,!_0x4ec148['has'](_0x2fe9a2)&&_0x3e95e2['add'](_0x2fe9a2);}}export function sortFoldersByDepth(_0xf8e381){return[..._0xf8e381]['sort']((_0x3a6657,_0x568c9e)=>{const _0x2778f9=a155_0x4ade,_0x5867fd=(_0x3a6657[_0x2778f9(0x236)](/\//g)||[])['length'],_0x37ec8e=(_0x568c9e['match'](/\//g)||[])[_0x2778f9(0x140)];return _0x5867fd-_0x37ec8e;});}import*as a155_0x3e9382 from'yaml';import{readFileSync}from'fs';import a155_0x405b9f from'path';import{isJourneyDef,parseYamlString as a155_0x273a5a,toYamlString as a155_0xf7453a,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';function a155_0x4ade(_0x389954,_0x476ccf){_0x389954=_0x389954-0x13d;const _0x3ac689=a155_0x3ac6();let _0x4ade46=_0x3ac689[_0x389954];return _0x4ade46;}import{readPushRecovery,saveSegmentToPushRecovery,deletePushRecovery}from'./push-recovery.js';import{validateSegmentDef,formatValidationResult}from'./yaml-validator.js';import{validateJourneyDef}from'./journey-validator.js';function stableStringify(_0x398e05){const _0x53a42b=a155_0x3e8afc;if(Array[_0x53a42b(0x21e)](_0x398e05))return'['+_0x398e05[_0x53a42b(0x1ef)](_0x4f5a26=>stableStringify(_0x4f5a26))[_0x53a42b(0x23a)](',')+']';if(_0x398e05&&typeof _0x398e05===_0x53a42b(0x1e0)){const _0x89d658=_0x398e05,_0x225469=Object[_0x53a42b(0x1f0)](_0x89d658)[_0x53a42b(0x180)](),_0x62cbed=_0x225469[_0x53a42b(0x1ef)](_0x555616=>'\x22'+_0x555616+'\x22:'+stableStringify(_0x89d658[_0x555616]));return'{'+_0x62cbed[_0x53a42b(0x23a)](',')+'}';}const _0x5719c8=JSON[_0x53a42b(0x22e)](_0x398e05);return _0x5719c8===undefined?_0x53a42b(0x153):_0x5719c8;}function activationSignature(_0x2a2c9f){const _0x262714=a155_0x3e8afc,_0x577d11={'connection':_0x2a2c9f[_0x262714(0x1d1)],..._0x2a2c9f[_0x262714(0x1b9)]!==undefined&&{'all_columns':_0x2a2c9f[_0x262714(0x1b9)]},..._0x2a2c9f[_0x262714(0x203)]!==undefined&&{'columns':_0x2a2c9f[_0x262714(0x203)]},..._0x2a2c9f[_0x262714(0x1da)]!==undefined&&{'behavior':_0x2a2c9f[_0x262714(0x1da)]},..._0x2a2c9f[_0x262714(0x1e6)]!==undefined&&{'schedule':_0x2a2c9f[_0x262714(0x1e6)]},..._0x2a2c9f['notification']!==undefined&&{'notification':_0x2a2c9f[_0x262714(0x1bc)]},..._0x2a2c9f[_0x262714(0x1f6)]!==undefined&&{'connector_config':_0x2a2c9f[_0x262714(0x1f6)]},..._0x2a2c9f['activation_template_id']!==undefined&&{'activation_template_id':_0x2a2c9f[_0x262714(0x172)]}};return stableStringify(_0x577d11);}async function fetchSegment(_0x20c2fa,_0x8fcdb4,_0x3aeebd,_0x17f31d){const _0x4f5ec1=a155_0x3e8afc,_0x4f0520=_0x17f31d?.[_0x4f5ec1(0x1d4)](_0x2483c6=>_0x2483c6['id']===_0x3aeebd);if(_0x4f0520)return _0x4f0520;try{return await _0x20c2fa[_0x4f5ec1(0x1cf)][_0x4f5ec1(0x188)](_0x8fcdb4,_0x3aeebd);}catch(_0x5d6f00){logger[_0x4f5ec1(0x22b)](_0x4f5ec1(0x1a7)+_0x3aeebd+_0x4f5ec1(0x1f2)+_0x5d6f00);try{return await _0x20c2fa[_0x4f5ec1(0x1cf)][_0x4f5ec1(0x18a)](_0x3aeebd);}catch(_0x4bad8e){return logger[_0x4f5ec1(0x22b)](_0x4f5ec1(0x1b0)+_0x3aeebd+':\x20'+_0x4bad8e),null;}}}function recoverSegmentIdsFromPushRecovery(_0x5cbf6d,_0x59c17a,_0x983c03){const _0x5c6cca=a155_0x3e8afc,_0x3237d0=readPushRecovery(_0x5cbf6d[_0x5c6cca(0x1fd)]);if(_0x3237d0?.[_0x5c6cca(0x16b)]===_0x5cbf6d[_0x5c6cca(0x1d8)][_0x5c6cca(0x1ea)])for(const [_0xf6979b,_0xf19dea]of Object[_0x5c6cca(0x1a6)](_0x3237d0[_0x5c6cca(0x156)])){const _0x4573d0=generateDeterministicJourneySegmentName(_0x5cbf6d[_0x5c6cca(0x1d8)][_0x5c6cca(0x1ea)],_0xf6979b);_0xf19dea['uniqueServerName']===_0x4573d0&&(_0x59c17a[_0x5c6cca(0x226)](_0xf6979b,_0xf19dea[_0x5c6cca(0x1a0)]),_0x983c03[_0x5c6cca(0x226)](_0xf6979b,_0xf19dea[_0x5c6cca(0x1a0)]));}}async function createOrRecoverEmbeddedSegment(_0x58ebed,_0x50e9c4,_0x62049b,_0x9d9cd7){const _0x109522=a155_0x3e8afc;let _0x53bee8;try{_0x53bee8=await _0x58ebed[_0x109522(0x1cf)][_0x109522(0x230)]({'name':_0x62049b['uniqueSegmentName'],'description':_0x62049b['description'],'journeyId':_0x62049b[_0x109522(0x181)],'rule':_0x9d9cd7(_0x62049b[_0x109522(0x224)],!![]),'countPopulation':!![],'parentFolderId':_0x62049b[_0x109522(0x1cd)],'audienceId':_0x62049b[_0x109522(0x212)]});}catch(_0x1d4c93){const _0xd01470=_0x1d4c93 instanceof Error&&_0x1d4c93['message'][_0x109522(0x15a)](_0x109522(0x233));if(_0xd01470){const _0x700b03=readPushRecovery(_0x50e9c4[_0x109522(0x1fd)]),_0x4f1939=_0x700b03?.[_0x109522(0x16b)]===_0x50e9c4[_0x109522(0x1d8)][_0x109522(0x1ea)]?_0x700b03[_0x109522(0x156)][_0x62049b[_0x109522(0x1f8)]]:undefined;if(_0x4f1939?.[_0x109522(0x194)]===_0x62049b[_0x109522(0x240)])await _0x58ebed[_0x109522(0x1cf)]['updateSegmentById'](_0x62049b[_0x109522(0x212)],_0x4f1939['segmentId'],{'description':_0x62049b[_0x109522(0x214)],'rule':_0x9d9cd7(_0x62049b[_0x109522(0x224)],!![]),'countPopulation':!![]}),_0x53bee8=_0x4f1939[_0x109522(0x1a0)];else throw new SDKError(ErrorCode[_0x109522(0x14b)],'Embedded\x20segment\x20\x27'+_0x62049b[_0x109522(0x1f8)]+_0x109522(0x1fe)+(_0x109522(0x229)+_0x50e9c4[_0x109522(0x1fd)][_0x109522(0x199)](/([^/]+)$/,_0x109522(0x227))+')\x20')+'and\x20the\x20server\x20segment,\x20then\x20retry.',_0x1d4c93);}else throw _0x1d4c93;}return saveSegmentToPushRecovery(_0x50e9c4[_0x109522(0x1fd)],_0x50e9c4[_0x109522(0x1d8)][_0x109522(0x1ea)],_0x62049b[_0x109522(0x1f8)],{'segmentId':_0x53bee8,'uniqueServerName':_0x62049b[_0x109522(0x240)],'createdAt':new Date()['toISOString']()}),_0x53bee8;}export async function prepareSegmentFiles(_0x4f3a9e,_0x122d40,_0x2b9b6d,_0xc1fea,_0x472c8e){const _0x58afb9=a155_0x3e8afc,{activationDefToCreateRequest:_0x52deba}=await import('./child-segment-yaml.js'),_0x3b9b62=[],_0x21b15e=new Set();for(const {yamlConfig:_0x4a8c4c,folderPath:_0xe939c4,sourcePath:_0x2436d9}of _0x4f3a9e){const _0x51cf27=resolveTDFolderPath(_0xe939c4,_0xc1fea,_0x472c8e),_0x5ac887=_0x51cf27+':'+_0x4a8c4c[_0x58afb9(0x1ea)],_0x38fd67=_0x122d40[_0x58afb9(0x14c)]['get'](_0x5ac887),_0x353236=_0x38fd67?_0x122d40['activationsBySegmentId'][_0x58afb9(0x1bd)](_0x38fd67['id'])||[]:[];addFoldersToCreate(_0x51cf27,_0x122d40['folderPathToId'],_0x21b15e);const _0x16a588=calculateActivationActions(_0x4a8c4c['activations']||[],_0x353236,_0x122d40[_0x58afb9(0x1f7)],_0x122d40['connectionIdToNameMap']);for(const _0x33dcfc of _0x16a588){(_0x33dcfc[_0x58afb9(0x20c)]===_0x58afb9(0x148)||_0x33dcfc['type']===_0x58afb9(0x206))&&_0x33dcfc['yamlActivation']&&(_0x33dcfc[_0x58afb9(0x1b5)]=await _0x52deba(_0x33dcfc[_0x58afb9(0x213)],_0x2b9b6d));}const _0x2b61f8=calculateSegmentDiff(_0x4a8c4c,_0x38fd67,_0x353236,_0x122d40[_0x58afb9(0x1f7)],_0x122d40['connectionIdToNameMap']);_0x3b9b62[_0x58afb9(0x209)]({'relativePath':_0x4a8c4c[_0x58afb9(0x1ea)],'absolutePath':_0x2436d9,'yamlConfig':_0x4a8c4c,'folderPath':_0x51cf27,'existingSegment':_0x38fd67,'existingActivations':_0x353236,'isNew':_0x2b61f8['isNew'],'hasChanges':_0x2b61f8[_0x58afb9(0x21c)],'diff':_0x2b61f8[_0x58afb9(0x231)],'activationActions':_0x16a588});}return{'segmentFiles':_0x3b9b62,'foldersToCreate':_0x21b15e};}export async function prepareJourneyFiles(_0x434e48,_0x247edf,_0x38c17a,_0x6d233c){const _0x6be047=a155_0x3e8afc,_0x1d9d23=[],_0x31c1d1=new Set();for(const {yamlConfig:_0x5045d7,folderPath:_0x46d3be,sourcePath:_0x1dc750}of _0x434e48){const _0x2191fa=resolveTDFolderPath(_0x46d3be,_0x38c17a,_0x6d233c),_0x1fb0f1=_0x2191fa+':'+_0x5045d7[_0x6be047(0x1ea)],_0x35efeb=_0x247edf[_0x6be047(0x147)][_0x6be047(0x1bd)](_0x1fb0f1);let _0x5d8863,_0x4f2311;if(_0x35efeb&&_0x35efeb[_0x6be047(0x140)]>0x0){const _0x17954e=buildLocalExpandedRuleMappings(_0x5045d7),{createYamlContext:_0x566564,prefetchJourneySegments:_0x5607c8}=createPushYamlContextForBundle(_0x247edf['deps'],_0x247edf[_0x6be047(0x212)],_0x247edf[_0x6be047(0x15b)],_0x17954e,_0x247edf[_0x6be047(0x1f7)],_0x247edf[_0x6be047(0x19d)],_0x247edf[_0x6be047(0x157)],_0x247edf[_0x6be047(0x1aa)]);await _0x5607c8(_0x35efeb[_0x6be047(0x1ef)](_0x1c962e=>_0x1c962e['id']));const _0x4bbb02=await _0x247edf[_0x6be047(0x1a2)][_0x6be047(0x1e4)][_0x6be047(0x239)](_0x35efeb[0x0][_0x6be047(0x22c)]),_0x5a5642=hasMultipleVersions(_0x5045d7),_0x49745d=async _0x2c3846=>{const _0x119b9f=_0x6be047,_0x8ba404=_0x247edf[_0x119b9f(0x1aa)]?.[_0x119b9f(0x1bd)](_0x2c3846);if(_0x8ba404)return _0x8ba404;return _0x247edf['fetchJourney']({'journeyId':_0x2c3846,'journeyName':_0x5045d7['name'],'isMultiVersion':_0x35efeb[_0x119b9f(0x140)]>0x1});};if(_0x5a5642&&_0x35efeb[_0x6be047(0x140)]>0x1){const _0x3a65e5=[];for(const _0xa1bcb4 of _0x35efeb){const _0x14f2a5=_0xa1bcb4[_0x6be047(0x1d0)]||0x1;_0x247edf['progress']?.[_0x6be047(0x206)](_0x6be047(0x1ba)+_0x5045d7[_0x6be047(0x1ea)]+'\x20v'+_0x14f2a5);const _0x9ef8ec=await _0x49745d(_0xa1bcb4['id']),_0x58931b=_0x566564(_0xa1bcb4['id']),_0x33921a=await journeyResponseToDef(_0x9ef8ec,_0x58931b);_0x3a65e5[_0x6be047(0x209)]({'item':_0xa1bcb4,'yaml':_0x33921a});}const _0x95c0a0=buildLocalRuleToNameMappingFromJourney(_0x5045d7);_0x4f2311=buildMergedJourneyDef(_0x3a65e5,_0x95c0a0,_0x4bbb02);const _0x2f1c3b=Math[_0x6be047(0x198)](..._0x3a65e5[_0x6be047(0x1ef)](_0x5b3c8b=>_0x5b3c8b[_0x6be047(0x23f)]['versionNumber']||0x0)),_0x50b8e6=_0x35efeb[_0x6be047(0x1d4)](_0x1ad251=>(_0x1ad251[_0x6be047(0x1d0)]||0x0)===_0x2f1c3b);_0x50b8e6&&(_0x247edf[_0x6be047(0x187)]?.[_0x6be047(0x206)]('Fetching\x20'+_0x5045d7[_0x6be047(0x1ea)]+'\x20v'+_0x2f1c3b),_0x5d8863=await _0x49745d(_0x50b8e6['id']));}else{const _0x38825f=_0x35efeb[_0x35efeb['length']-0x1];_0x247edf[_0x6be047(0x187)]?.[_0x6be047(0x206)](_0x6be047(0x1ba)+_0x5045d7[_0x6be047(0x1ea)]),_0x5d8863=await _0x49745d(_0x38825f['id']);const _0xd916da=_0x566564(_0x38825f['id']),_0x50e5ab=await journeyResponseToDef(_0x5d8863,_0xd916da),_0x1b44ad=buildLocalRuleToNameMappingFromJourney(_0x5045d7);_0x4f2311=buildMergedJourneyDef([{'item':_0x38825f,'yaml':_0x50e5ab}],_0x1b44ad,_0x4bbb02);}}addFoldersToCreate(_0x2191fa,_0x247edf['folderPathToId'],_0x31c1d1);const _0x50786a=calculateJourneyDiff(_0x5045d7,_0x4f2311);_0x1d9d23[_0x6be047(0x209)]({'relativePath':_0x5045d7[_0x6be047(0x1ea)],'absolutePath':_0x1dc750,'yamlConfig':_0x5045d7,'folderPath':_0x2191fa,'existingJourney':_0x5d8863,'isNew':_0x50786a[_0x6be047(0x1f1)],'hasChanges':_0x50786a[_0x6be047(0x21c)],'diff':_0x50786a[_0x6be047(0x231)]});}return{'journeyFiles':_0x1d9d23,'foldersToCreate':_0x31c1d1};}export function calculateActivationActions(_0x50a2a1,_0x355166,_0x1a99fc,_0x2c8a33){const _0x3297a7=a155_0x3e8afc,_0x5a9355=[],_0x229522=new Map();for(const _0x1e46df of _0x355166){_0x229522[_0x3297a7(0x226)](_0x1e46df[_0x3297a7(0x1ea)],_0x1e46df);}const _0x14a142=new Map();for(const _0x5e23c3 of _0x50a2a1){_0x14a142['set'](_0x5e23c3[_0x3297a7(0x1ea)],_0x5e23c3);}for(const _0x21eb14 of _0x50a2a1){const _0x3d0f88=_0x229522[_0x3297a7(0x1bd)](_0x21eb14[_0x3297a7(0x1ea)]);if(!_0x3d0f88)_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x148),'name':_0x21eb14[_0x3297a7(0x1ea)],'yamlActivation':_0x21eb14});else{const _0x3add0b=activationResponseToDef(_0x3d0f88,_0x1a99fc,_0x2c8a33),_0x3b3404=a155_0x3e9382[_0x3297a7(0x22e)](_0x3add0b),_0x4bb94d=a155_0x3e9382[_0x3297a7(0x22e)](_0x21eb14);_0x3b3404!==_0x4bb94d&&_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x206),'name':_0x21eb14[_0x3297a7(0x1ea)],'yamlActivation':_0x21eb14,'existingActivation':_0x3d0f88});}}for(const _0x270c20 of _0x355166){!_0x14a142[_0x3297a7(0x1c9)](_0x270c20[_0x3297a7(0x1ea)])&&_0x5a9355[_0x3297a7(0x209)]({'type':_0x3297a7(0x235),'name':_0x270c20[_0x3297a7(0x1ea)],'existingActivation':_0x270c20});}return _0x5a9355;}function calculateYamlDiff(_0xcc43af,_0x462d6b){if(_0x462d6b){const _0x161878=generateDiff(_0x462d6b,_0xcc43af),_0x50d4d5=hasChanges(_0x161878);return{'isNew':![],'hasChanges':_0x50d4d5,'diff':_0x50d4d5?formatDiffWithColors(_0x161878):undefined};}const _0x4dfb80=generateDiff('',_0xcc43af);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x4dfb80)};}function a155_0x3ac6(){const _0x57a3f2=['\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27','\x27\x20to\x20local\x20\x27','resolveSegment','Updating\x20activation\x20\x27','utf-8','object','embedded_segment_created','activations','\x20activation\x20\x27','journey','25pkSZzP','schedule','user','segmentFolderId','segmentNameToId','name','journeyActivationStepId','Created\x20journey\x20\x27','getActivation','WaitStep','map','keys','isNew',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','segment_created','deleteSegment','steps','connector_config','idToEmailMap','localName','activation_deleted','reduce','\x27...','SEGMENT_SYNTAX_ERROR','absolutePath','\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20','created','sha1','add','Creating\x20segment\x20\x27','columns','ACTIVATION_SYNTAX_ERROR','deleted','update','createdSegmentIds','toString','push','JOURNEY_SYNTAX_ERROR','Failed\x20to\x20resolve\x20activation\x20','type',').\x20','some','waitStep','Segment\x20not\x20found','tdx.sdk.push-workflow','parentId','yamlActivation','description','ACTIVATION_UPDATE_ERROR','list','size','entry_criteria','folderPath','waitStepUnit','segment_deleting','hasChanges','unchanged','isArray','conditions','filter','goal','resolveJourneyId','Activation','resolvedRule','action','set','.$1.push-recovery.json','4320950inhJNH','Delete\x20the\x20push\x20recovery\x20file\x20(','journeyActivationNameToId','debug','journeyBundleId','\x27\x20not\x20found\x20in\x20journey\x20\x27','stringify','relationships','createJourneySegment','diff','valid','Name\x20has\x20already\x20been\x20taken','Deleting\x20activation\x20\x27','delete','match','rule','startsWith','getLatestJourneyId','join','segment_updating','updated','trim','Condition','item','uniqueSegmentName','goal\x20criteria','onProgress','Activation\x20not\x20found:\x20','\x27\x20from\x20file:\x20','data','length','\x27\x20exit\x20criteria','flatMap','218MGgmIj','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','Failed\x20to\x20','buildUserMaps','journeyBundlesByFolderAndName','create','128094YVcFBs','embedded_activation_created','SEGMENT_UPDATE_ERROR','segmentByFolderAndName','journey_entry_criteria_','activation_deleting','154ulRevl','existingSegment','createActivation','nameToId','null','\x27\x20by\x20rule\x20content','rootFolderId','segments','activationStepsById','1912JRDgFv','\x27\x20entry\x20criteria','includes','existingSegments','Journey\x20\x27','run_after_journey_refresh','kind','parse','relative','11dLWVxB','index','activation_','parentFolder','embeddedSegmentNameToId','activation_creating','activationActions','conditionTimeoutUnit','attributes','journeyStages','journeyName','with','createSegment','branches','conditionTimeoutDuration','segment_deleted','./child-segment-yaml.js','activation_template_id','Created\x20activation\x20\x27','journeyBundleName','logDeleted','from','\x27\x20wait\x20condition','169GdjHpP','):\x20','parseDocument','exitCriterias','embedded_activation_creating','Segment\x20not\x20found:\x20','parentSegmentFolder','listActivations','sort','journeyId','conditionSegmentId','journey_updating','Failed\x20to\x20resolve\x20segment\x20','segment_creating','Stage\x20\x27','progress','getSegment','waitStepType','getSegmentEntity','draft','dirname','560424JTbCiZ','segment_updated','nameToType','DecisionPoint','split','existingActivation','folderPathToId','uniqueServerName','slice','entryCriteria','172992LJldAS','max','replace','journey_creating','\x20segment\x20from\x20file:\x20','\x20journey\x20from\x20file:\x20','connectionIdToNameMap','activationContext','createdSegmentId','segmentId','hex','deps','176859mNYRZY','Updated\x20activation\x20\x27','SEGMENT_NOT_FOUND','entries','getSegment\x20failed\x20for\x20','../../utils/async.js','Deleted\x20segment\x20\x27','journeyById','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','\x20(referenced\x20in\x20journey\x20','__pending_act_','day','milestone','getSegmentEntity\x20also\x20failed\x20for\x20','stage\x20\x27','logInfo','\x27\x20milestone','activation_updated','validatedRequest','journeys','NOT_FOUND','Entry\x20criteria:\x20','all_columns','Fetching\x20','existingJourney','notification','get','logSuccess','toLowerCase','updateSegmentById','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','skipSegments','87612RDreFH','withProgress','Duration','journey_created','./journey-yaml.js','values','has','\x0a\x20\x20','152uRhLOt','results','folderId','JOURNEY_UPDATE_ERROR','segment','versionNumber','connection','folder_creating','Updated\x20journey\x20\x27','find','updateActivation','Updated\x20segment\x20\x27','getJourney','yamlConfig','INTERNAL','behavior'];a155_0x3ac6=function(){return _0x57a3f2;};return a155_0x3ac6();}export function calculateSegmentDiff(_0x46a00e,_0x3a5a95,_0x2eb6a1,_0x3f1211,_0x29d5d7){const _0xf0d31e=segmentToYamlString(_0x46a00e),_0x2d9a85=_0x3a5a95?segmentToYamlString(segmentWithActivationsToYaml(_0x3a5a95,_0x2eb6a1,undefined,_0x3f1211,_0x29d5d7)):undefined;return calculateYamlDiff(_0xf0d31e,_0x2d9a85);}export function calculateJourneyDiff(_0x44b661,_0x472fc2){const _0x5af34b=normalizeJourneyDef(_0x44b661,_0x44b661),_0x34a97b=a155_0xf7453a(_0x5af34b),_0x335882=_0x472fc2?a155_0xf7453a(normalizeJourneyDef(_0x472fc2,_0x44b661)):undefined;return calculateYamlDiff(_0x34a97b,_0x335882);}export function findSegmentsToDelete(_0x5bdb26,_0x399bd9,_0xa43a3,_0x18b27e,_0x2b1646){const _0x20b798=a155_0x3e8afc,_0x35be86=new Set();for(const {yamlConfig:_0x5ad60c,folderPath:_0xaf0c9d}of _0x399bd9){_0x35be86['add'](_0xaf0c9d+':'+_0x5ad60c[_0x20b798(0x1ea)]);}return _0x5bdb26[_0x20b798(0x220)](_0xbf7a1=>{const _0x25b5b4=_0x20b798,_0x5ca8c2=_0xbf7a1[_0x25b5b4(0x1e8)]?_0xa43a3[_0x25b5b4(0x1bd)](_0xbf7a1[_0x25b5b4(0x1e8)][_0x25b5b4(0x208)]())||'':'',_0x11a761=_0x5ca8c2+':'+_0xbf7a1[_0x25b5b4(0x1ea)];if(_0x35be86[_0x25b5b4(0x1c9)](_0x11a761))return![];if(_0x2b1646)return _0x5ca8c2===_0x18b27e||_0x5ca8c2[_0x25b5b4(0x238)](_0x18b27e+'/');return!![];});}export function findJourneysToDelete(_0x2c854e,_0xe00316,_0x49085f,_0x42d506,_0x1c6f81){const _0x4d0221=a155_0x3e8afc,_0x59ece5=new Set();for(const {yamlConfig:_0x1eb8e8,folderPath:_0x1ad7e0}of _0xe00316){_0x59ece5[_0x4d0221(0x201)](_0x1ad7e0+':'+_0x1eb8e8['name']);}return _0x2c854e[_0x4d0221(0x220)](_0x967121=>{const _0x28ebb3=_0x4d0221,_0x10fa67=_0x967121['folderId']?_0x49085f[_0x28ebb3(0x1bd)](_0x967121['folderId'])||'':'',_0x26ecc7=_0x10fa67+':'+_0x967121[_0x28ebb3(0x174)];if(_0x59ece5[_0x28ebb3(0x1c9)](_0x26ecc7))return![];if(_0x1c6f81)return _0x10fa67===_0x42d506||_0x10fa67['startsWith'](_0x42d506+'/');return!![];});}export function buildSegmentLookupMap(_0x2bba65,_0x304f2a){const _0x334399=a155_0x3e8afc,_0x46a236=new Map();for(const _0x25af9e of _0x2bba65){const _0x41f9d8=_0x25af9e[_0x334399(0x1e8)]?_0x304f2a[_0x334399(0x1bd)](_0x25af9e[_0x334399(0x1e8)][_0x334399(0x208)]())||'':'',_0xc38b4b=_0x41f9d8+':'+_0x25af9e[_0x334399(0x1ea)];_0x46a236[_0x334399(0x226)](_0xc38b4b,_0x25af9e);}return _0x46a236;}export function buildSegmentNameToIdMap(_0x1c2b79){const _0x57cf6d=a155_0x3e8afc,_0x5a88e0=new Map();for(const _0x2b8710 of _0x1c2b79){_0x5a88e0[_0x57cf6d(0x226)](_0x2b8710[_0x57cf6d(0x1ea)],_0x2b8710['id']);}return _0x5a88e0;}export function buildJourneyBundleLookupMap(_0x15c5ef,_0x54265d){const _0x5625c0=a155_0x3e8afc,_0x28bfc8=new Map();for(const _0x37afad of _0x15c5ef){const _0x1232f8=_0x37afad['folderId']?_0x54265d[_0x5625c0(0x1bd)](_0x37afad[_0x5625c0(0x1cd)])||'':'',_0x175aeb=_0x1232f8+':'+_0x37afad['journeyBundleName'];!_0x28bfc8['has'](_0x175aeb)&&_0x28bfc8[_0x5625c0(0x226)](_0x175aeb,[]),_0x28bfc8[_0x5625c0(0x1bd)](_0x175aeb)[_0x5625c0(0x209)](_0x37afad);}for(const _0x2aebf9 of _0x28bfc8[_0x5625c0(0x1c8)]()){_0x2aebf9[_0x5625c0(0x180)]((_0x4d8534,_0x3281b2)=>(_0x4d8534[_0x5625c0(0x1d0)]||0x0)-(_0x3281b2[_0x5625c0(0x1d0)]||0x0));}return _0x28bfc8;}export function collectFoldersToCreate(_0x1dbdb5,_0x1e2ad7){const _0x448312=a155_0x3e8afc,_0x1451c8=new Set();for(const _0x4ec888 of _0x1dbdb5){if(!_0x4ec888)continue;if(_0x1e2ad7[_0x448312(0x1c9)](_0x4ec888))continue;const _0x3b801e=_0x4ec888[_0x448312(0x191)]('/');let _0x702f7e='';for(const _0x2edbd1 of _0x3b801e){_0x702f7e=_0x702f7e?_0x702f7e+'/'+_0x2edbd1:_0x2edbd1,!_0x1e2ad7[_0x448312(0x1c9)](_0x702f7e)&&_0x1451c8['add'](_0x702f7e);}}return _0x1451c8;}export function parseAndClassifyYamlFiles(_0x4c2f70,_0x27ca64,_0x410b1c){const _0x2b9305=a155_0x3e8afc,_0x13f962=[],_0x4f215c=[];for(const _0x1d6f66 of _0x4c2f70){const _0x16e2b3=a155_0x405b9f['relative'](_0x27ca64,a155_0x405b9f[_0x2b9305(0x18c)](_0x1d6f66)),_0x4c7cf1=_0x16e2b3==='.'?'':_0x16e2b3[_0x2b9305(0x199)](/\\/g,'/'),_0xd1aecc=readFileSync(_0x1d6f66,'utf-8'),_0x28743d=a155_0x3e9382[_0x2b9305(0x15f)](_0xd1aecc);if(isJourneyDef(_0x28743d)){const _0x735f9=a155_0x273a5a(_0xd1aecc);_0x4f215c[_0x2b9305(0x209)]({'yamlConfig':_0x735f9,'folderPath':_0x4c7cf1,'sourcePath':_0x1d6f66});}else{if(!_0x410b1c?.[_0x2b9305(0x1c2)]){const _0x382929=parseSegmentYamlFile(_0xd1aecc),_0x212975=normalizeChildSegmentYaml(_0x382929);_0x13f962[_0x2b9305(0x209)]({'yamlConfig':_0x212975,'folderPath':_0x4c7cf1,'sourcePath':_0x1d6f66});}}}return{'segments':_0x13f962,'journeys':_0x4f215c};}export function validateParsedFiles(_0x24dd3e,_0x4b1366){const _0x530acd=a155_0x3e8afc,_0x5b3d22=[];for(const {yamlConfig:_0x291212,sourcePath:_0x1270cf}of _0x24dd3e[_0x530acd(0x156)]){const _0x173579=readFileSync(_0x1270cf,_0x530acd(0x1df)),_0x97b394=a155_0x3e9382['parseDocument'](_0x173579),_0x67347=validateSegmentDef(_0x291212,{'source':_0x173579,'document':_0x97b394},{'skipSchema':!![]});if(!_0x67347[_0x530acd(0x232)]){const _0x3379f9=a155_0x405b9f['relative'](_0x4b1366,_0x1270cf);_0x5b3d22[_0x530acd(0x209)]({'filePath':_0x3379f9,'source':_0x173579,'result':_0x67347,'isJourney':![]});}}for(const {yamlConfig:_0x36490c,sourcePath:_0x123b8e}of _0x24dd3e[_0x530acd(0x1b6)]){const _0x21b193=readFileSync(_0x123b8e,_0x530acd(0x1df)),_0x13fe88=a155_0x3e9382[_0x530acd(0x17a)](_0x21b193),_0x4d4678=validateJourneyDef(_0x36490c,{'source':_0x21b193,'document':_0x13fe88},{'skipSchema':!![]});if(!_0x4d4678[_0x530acd(0x232)]){const _0x2406af=a155_0x405b9f[_0x530acd(0x160)](_0x4b1366,_0x123b8e);_0x5b3d22[_0x530acd(0x209)]({'filePath':_0x2406af,'source':_0x21b193,'result':_0x4d4678,'isJourney':!![]});}}return _0x5b3d22;}export function formatValidationErrors(_0x2338f7){const _0xf2dcb8=a155_0x3e8afc,_0x3f2670=[];for(const {filePath:_0x4b5ab0,source:_0x69feb4,result:_0x1b207e,isJourney:_0x20858a}of _0x2338f7){const _0x25c71c=_0x20858a?'journey':_0xf2dcb8(0x1cf);_0x3f2670['push']('\x0a'+_0x4b5ab0+'\x20('+_0x25c71c+_0xf2dcb8(0x179)+_0x1b207e['errors'][_0xf2dcb8(0x140)]+'\x20error(s)'),_0x3f2670[_0xf2dcb8(0x209)](formatValidationResult(_0x1b207e,_0x69feb4,_0x4b5ab0));}return _0x3f2670[_0xf2dcb8(0x23a)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x1368ac){const _0x113d63=a155_0x3e8afc,_0x19dff9=new Set(),_0x46ed8c=new Map(),_0x407891=collectSegmentUsageCounts(_0x1368ac);if(_0x1368ac[_0x113d63(0x156)])for(const [_0x1ebf0f,_0x3272f6]of Object['entries'](_0x1368ac[_0x113d63(0x156)])){_0x19dff9['add'](_0x1ebf0f);if(_0x3272f6['rule']){const _0x371d1b=yamlRuleToApi(_0x3272f6[_0x113d63(0x237)]),_0x1a1cc9=apiRuleToYaml(_0x371d1b);_0x46ed8c[_0x113d63(0x226)](_0x1ebf0f,_0x1a1cc9);}}const _0x44ba13=new Map();let _0x4706e3=0x0;for(const [_0x413c86,_0xd924bd]of _0x46ed8c){const _0x3ee884=serializeExpandedRule(_0xd924bd,_0x46ed8c),_0x507fc4=_0x44ba13['get'](_0x3ee884)||[];_0x507fc4['push']({'name':_0x413c86,'index':_0x4706e3}),_0x44ba13[_0x113d63(0x226)](_0x3ee884,_0x507fc4),_0x4706e3++;}const _0x3dabaa=new Map();for(const [_0x322049,_0x835e20]of _0x44ba13){const _0x348084=_0x835e20[_0x113d63(0x195)]()[_0x113d63(0x180)]((_0x123f15,_0x49929b)=>{const _0x2511bc=_0x113d63,_0x3f0e56=_0x407891['get'](_0x123f15[_0x2511bc(0x1ea)])||0x0,_0x4c257a=_0x407891[_0x2511bc(0x1bd)](_0x49929b[_0x2511bc(0x1ea)])||0x0;if(_0x3f0e56!==_0x4c257a)return _0x4c257a-_0x3f0e56;return _0x123f15[_0x2511bc(0x162)]-_0x49929b['index'];})[_0x113d63(0x1ef)](_0x82f2b=>_0x82f2b[_0x113d63(0x1ea)]),_0x2abf29=[];for(const _0x5bf556 of _0x348084){const _0x3281c2=_0x407891['get'](_0x5bf556)||0x0,_0x14b95e=Math[_0x113d63(0x198)](_0x3281c2,0x1);for(let _0x78a62b=0x0;_0x78a62b<_0x14b95e;_0x78a62b++){_0x2abf29[_0x113d63(0x209)](_0x5bf556);}}_0x3dabaa[_0x113d63(0x226)](_0x322049,_0x2abf29);}return{'existingLocalSegmentNames':_0x19dff9,'localSegmentRules':_0x46ed8c,'localExpandedRuleToNames':_0x3dabaa};}export function createSegmentIdResolver(_0x2bf81c,_0x3c55d6){return async _0x11f007=>{const _0x4cccac=a155_0x4ade,_0x50471b=_0x2bf81c['get'](_0x11f007);if(!_0x50471b)throw new SDKError(ErrorCode[_0x4cccac(0x1a5)],_0x4cccac(0x17d)+_0x11f007+_0x4cccac(0x144)+_0x3c55d6+'\x27)');return _0x50471b;};}export function extractRootFolderId(_0xcd9459){const _0x180dc5=a155_0x3e8afc;return _0xcd9459[_0x180dc5(0x22f)]?.[_0x180dc5(0x17e)]?.[_0x180dc5(0x13f)]?.['id']||_0xcd9459[_0x180dc5(0x22f)]?.[_0x180dc5(0x164)]?.[_0x180dc5(0x13f)]?.['id'];}export function buildConnectionMaps(_0x447c5b){const _0x4199e2=a155_0x3e8afc,_0x17a2e0=new Map(),_0x486814=new Map(),_0x33d386=new Map();for(const _0x26b8bc of _0x447c5b){_0x17a2e0[_0x4199e2(0x226)](_0x26b8bc[_0x4199e2(0x1ea)],parseInt(_0x26b8bc['id'],0xa)),_0x486814[_0x4199e2(0x226)](_0x26b8bc['id'],_0x26b8bc['name']),_0x33d386[_0x4199e2(0x226)](_0x26b8bc[_0x4199e2(0x1ea)],_0x26b8bc[_0x4199e2(0x20c)]);}return{'nameToId':_0x17a2e0,'idToName':_0x486814,'nameToType':_0x33d386};}export function calculatePushStats(_0x575502,_0xf32ab7,_0x2e2778,_0x50f577,_0x4119dd,_0x909440,_0x449f42){const _0x1cec2d=a155_0x3e8afc,_0x2a3aa1=_0x575502[_0x1cec2d(0x220)](_0x550c26=>_0x550c26['isNew']),_0x4f58c7=_0x575502[_0x1cec2d(0x220)](_0x5e4c36=>!_0x5e4c36[_0x1cec2d(0x1f1)]&&_0x5e4c36[_0x1cec2d(0x21c)]),_0x406e74=_0x575502[_0x1cec2d(0x220)](_0x17f899=>!_0x17f899[_0x1cec2d(0x1f1)]&&!_0x17f899[_0x1cec2d(0x21c)]),_0x211bc1=_0x909440?_0x50f577:[],_0x663c9=_0xf32ab7[_0x1cec2d(0x220)](_0x65f974=>_0x65f974[_0x1cec2d(0x1f1)]),_0x595c49=_0xf32ab7[_0x1cec2d(0x220)](_0x427662=>!_0x427662['isNew']&&_0x427662[_0x1cec2d(0x21c)]),_0x13f75a=_0xf32ab7[_0x1cec2d(0x220)](_0xc6651f=>!_0xc6651f[_0x1cec2d(0x1f1)]&&!_0xc6651f[_0x1cec2d(0x21c)]),_0x12a91f=_0x909440?_0x4119dd:[],_0x4ce7a9=_0x575502[_0x1cec2d(0x142)](_0x2aba01=>_0x2aba01[_0x1cec2d(0x167)]),_0x52256c=_0x4ce7a9[_0x1cec2d(0x220)](_0x488807=>_0x488807[_0x1cec2d(0x20c)]===_0x1cec2d(0x148)),_0x58dd51=_0x4ce7a9['filter'](_0xa376ed=>_0xa376ed[_0x1cec2d(0x20c)]===_0x1cec2d(0x206)),_0x491ec0=_0x4ce7a9[_0x1cec2d(0x220)](_0x2d7d9c=>_0x2d7d9c[_0x1cec2d(0x20c)]===_0x1cec2d(0x235)),_0x5ac204=Array[_0x1cec2d(0x176)](_0x2e2778)[_0x1cec2d(0x180)](),_0x120dba=_0x449f42?![]:_0x2a3aa1['length']>0x0||_0x4f58c7[_0x1cec2d(0x140)]>0x0||_0x211bc1[_0x1cec2d(0x140)]>0x0,_0x4ba015=_0x663c9[_0x1cec2d(0x140)]>0x0||_0x595c49[_0x1cec2d(0x140)]>0x0||_0x12a91f[_0x1cec2d(0x140)]>0x0,_0x12d8b5=_0x449f42?![]:_0x4ce7a9[_0x1cec2d(0x140)]>0x0,_0x1634fb=_0x5ac204['length']>0x0;return{'segments':{'new':_0x2a3aa1,'changed':_0x4f58c7,'unchanged':_0x406e74,'toDelete':_0x211bc1},'journeys':{'new':_0x663c9,'changed':_0x595c49,'unchanged':_0x13f75a,'toDelete':_0x12a91f},'activations':{'all':_0x4ce7a9,'toCreate':_0x52256c,'toUpdate':_0x58dd51,'toDelete':_0x491ec0},'folders':{'toCreate':_0x5ac204},'counts':{'segments':{'new':_0x2a3aa1[_0x1cec2d(0x140)],'changed':_0x4f58c7[_0x1cec2d(0x140)],'unchanged':_0x406e74['length'],'toDelete':_0x211bc1[_0x1cec2d(0x140)]},'journeys':{'new':_0x663c9[_0x1cec2d(0x140)],'changed':_0x595c49['length'],'unchanged':_0x13f75a['length'],'toDelete':_0x12a91f['length']},'activations':{'create':_0x52256c[_0x1cec2d(0x140)],'update':_0x58dd51[_0x1cec2d(0x140)],'delete':_0x491ec0[_0x1cec2d(0x140)]},'folders':_0x5ac204[_0x1cec2d(0x140)]},'hasChanges':_0x120dba||_0x4ba015||_0x12d8b5||_0x1634fb};}export async function buildPushExecutionContext(_0x293d93,_0x386119,_0x9b087f,_0x37b283,_0x5774a5,_0x58337c){const _0x393242=a155_0x3e8afc,_0x3002e9=extractRootFolderId(_0x9b087f),{pathToId:_0x307bd9,idToPath:_0x1eee56}=buildFolderMaps(_0x5774a5),_0x57b79f=buildSegmentNameToIdMap(_0x37b283),_0x5ce808=new Map(),{batchAsync:_0x31f6cf}=await import(_0x393242(0x1a8)),[_0x2560fd,_0x27432f]=await Promise['all']([_0x293d93[_0x393242(0x1e7)][_0x393242(0x146)](),_0x293d93[_0x393242(0x1d1)][_0x393242(0x216)](),((async()=>{const _0x3108e9=_0x393242;!_0x58337c&&_0x37b283[_0x3108e9(0x140)]>0x0&&await _0x31f6cf(_0x37b283,async _0x307f3e=>{const _0x262530=_0x3108e9,_0x53c655=await _0x293d93[_0x262530(0x1cf)][_0x262530(0x17f)](_0x386119,_0x307f3e['id']);_0x5ce808[_0x262530(0x226)](_0x307f3e['id'],_0x53c655);});})())]),{emailToId:_0x5e92e3,idToEmail:_0x4a6208}=_0x2560fd,_0x3b6ab0=buildConnectionMaps(_0x27432f);return{'rootFolderId':_0x3002e9,'folderPathToId':_0x307bd9,'folderIdToPath':_0x1eee56,'segmentNameToId':_0x57b79f,'activationsBySegmentId':_0x5ce808,'emailToIdMap':_0x5e92e3,'idToEmailMap':_0x4a6208,'connectionNameToIdMap':_0x3b6ab0[_0x393242(0x152)],'connectionIdToNameMap':_0x3b6ab0['idToName'],'connectionNameToTypeMap':_0x3b6ab0[_0x393242(0x18f)]};}export function createPushYamlContextForBundle(_0x2801f5,_0x174031,_0x1adb85,_0x593d12,_0x1d8202,_0x4930fa,_0x29b469,_0x403b28){const {existingLocalSegmentNames:_0x21c146,localExpandedRuleToNames:_0x109722}=_0x593d12,_0x5ca435=new Set(),_0x44cbd=new Map(),_0x31b0a9=new Map(),_0x50b31a=new Map(),_0x18ec09=createJumpTargetCache(),_0x3aeabb=new Map(),_0x19e7a2=new Map(),_0x4db2b4=new Set();let _0x5c19ea;const _0x26acd7=_0x3c3151=>{const _0x20f263={'resolveSegment':async _0x360071=>{const _0x5d9fb2=a155_0x4ade,_0x5e9e60=_0x50b31a[_0x5d9fb2(0x1bd)](_0x360071);if(_0x5e9e60!==undefined)return{'name':_0x5e9e60,'isJourneyLocal':!![]};try{const _0x2965eb=await fetchSegment(_0x2801f5,_0x174031,_0x360071,_0x1adb85);if(!_0x2965eb)throw new Error(_0x5d9fb2(0x210));const _0x39904b=generateJourneyLocalName(_0x2965eb[_0x5d9fb2(0x1ea)]),_0x5857e9=_0x2965eb[_0x5d9fb2(0x15e)]===SEGMENT_KIND_JOURNEY&&_0x39904b!==undefined;let _0x57c5b0=_0x2965eb[_0x5d9fb2(0x1ea)],_0x12255f;if(_0x5857e9&&_0x2965eb[_0x5d9fb2(0x237)]){const _0x5cf297=apiRuleToYaml(_0x2965eb[_0x5d9fb2(0x237)]);_0x19e7a2[_0x5d9fb2(0x226)](_0x360071,_0x5cf297);const _0x163521=async _0x5a265e=>{const _0x9b0f40=_0x5d9fb2,_0x1e3378=collectSegmentRefsFromRule(_0x5a265e);for(const _0x349704 of _0x1e3378){if(!_0x19e7a2[_0x9b0f40(0x1c9)](_0x349704))try{const _0x46ea62=await fetchSegment(_0x2801f5,_0x174031,_0x349704,_0x1adb85);if(_0x46ea62?.[_0x9b0f40(0x237)]){const _0x3007cb=apiRuleToYaml(_0x46ea62[_0x9b0f40(0x237)]);_0x19e7a2[_0x9b0f40(0x226)](_0x349704,_0x3007cb),await _0x163521(_0x3007cb);}}catch(_0x5eda44){logger['debug']('Failed\x20to\x20fetch\x20referenced\x20segment\x20'+_0x349704+':\x20'+_0x5eda44);}}};await _0x163521(_0x5cf297);const _0x2b2bf2=serializeExpandedRule(_0x5cf297,_0x19e7a2),_0x31f0d4=_0x109722[_0x5d9fb2(0x1bd)](_0x2b2bf2);if(_0x31f0d4&&_0x31f0d4[_0x5d9fb2(0x140)]>0x0){const _0x3d3661=_0x44cbd[_0x5d9fb2(0x1bd)](_0x2b2bf2)||0x0,_0x2f1adb=_0x31f0d4[_0x3d3661]||_0x31f0d4[_0x31f0d4[_0x5d9fb2(0x140)]-0x1];_0x44cbd['set'](_0x2b2bf2,_0x3d3661+0x1),_0x57c5b0=_0x2f1adb,_0x5ca435[_0x5d9fb2(0x201)](_0x57c5b0),_0x50b31a[_0x5d9fb2(0x226)](_0x360071,_0x57c5b0);const _0x13f7e5=await resolveRuleSegmentRefs(_0x5cf297,async _0x2c40b7=>{const _0x218d0b=_0x5d9fb2,_0x2b87eb=_0x50b31a[_0x218d0b(0x1bd)](_0x2c40b7);if(_0x2b87eb)return _0x2b87eb;const _0x322c53=await _0x5c19ea[_0x218d0b(0x1dd)](_0x2c40b7);return _0x322c53[_0x218d0b(0x1ea)];});_0x12255f={'description':_0x2965eb[_0x5d9fb2(0x214)],'rule':_0x13f7e5};}else{const _0x4ea653=_0x3aeabb[_0x5d9fb2(0x1bd)](_0x2b2bf2);if(_0x4ea653)_0x57c5b0=_0x4ea653,_0x50b31a['set'](_0x360071,_0x57c5b0);else{if(_0x39904b){let _0x2109d5=_0x39904b,_0x3545a6=0x2;while(_0x5ca435[_0x5d9fb2(0x1c9)](_0x2109d5)||_0x21c146[_0x5d9fb2(0x1c9)](_0x2109d5)){_0x2109d5=_0x39904b+'_'+_0x3545a6,_0x3545a6++;}_0x5ca435[_0x5d9fb2(0x201)](_0x2109d5),_0x57c5b0=_0x2109d5;}_0x50b31a['set'](_0x360071,_0x57c5b0),_0x3aeabb['set'](_0x2b2bf2,_0x57c5b0);const _0x39a1bf=await resolveRuleSegmentRefs(_0x5cf297,async _0x19b470=>{const _0x1a822d=_0x5d9fb2,_0x163b33=_0x50b31a[_0x1a822d(0x1bd)](_0x19b470);if(_0x163b33)return _0x163b33;const _0x1230b2=await _0x5c19ea[_0x1a822d(0x1dd)](_0x19b470);return _0x1230b2[_0x1a822d(0x1ea)];});_0x12255f={'description':_0x2965eb[_0x5d9fb2(0x214)],'rule':_0x39a1bf};}}}return{'name':_0x57c5b0,'isJourneyLocal':_0x5857e9,'definition':_0x12255f};}catch(_0x1d7c42){return logger[_0x5d9fb2(0x22b)](_0x5d9fb2(0x184)+_0x360071+':\x20'+_0x1d7c42),{'name':_0x360071,'isJourneyLocal':![]};}},'resolveActivation':async _0x227aec=>{const _0x134cff=a155_0x4ade,_0x36a2b6=_0x31b0a9['get'](_0x227aec);if(_0x36a2b6!==undefined)return{'name':_0x36a2b6,'isJourneyLocal':!![]};try{let _0x32b6d2=_0x29b469?.[_0x134cff(0x1bd)](_0x227aec);!_0x32b6d2&&(_0x32b6d2=await _0x2801f5[_0x134cff(0x1e4)][_0x134cff(0x1ed)](_0x3c3151,_0x227aec));const _0x4366e4=_0x32b6d2[_0x134cff(0x169)]['activationParams'][_0x134cff(0x1ea)]||_0x227aec,_0x49c328=sanitizeYamlKey(_0x4366e4)||_0x134cff(0x163)+_0x227aec,_0x4f610c=_0x49c328;_0x31b0a9[_0x134cff(0x226)](_0x227aec,_0x4f610c);const _0x4e9642=journeyActivationStepToYaml(_0x32b6d2,_0x1d8202,_0x4930fa);return{'name':_0x4f610c,'isJourneyLocal':!![],'definition':_0x4e9642};}catch(_0x575540){return logger['debug'](_0x134cff(0x20b)+_0x227aec+':\x20'+_0x575540),{'name':_0x227aec,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x50e640,_0x24fd28)=>resolveJumpTarget(_0x50e640,_0x24fd28,_0x18ec09,async _0x46074c=>{const _0x2321cf=a155_0x4ade,_0xb86ba6=_0x403b28?.[_0x2321cf(0x1bd)](_0x46074c);if(_0xb86ba6)return _0xb86ba6;return _0x2801f5[_0x2321cf(0x1e4)][_0x2321cf(0x1d7)](_0x46074c);})};return _0x5c19ea=_0x20f263,_0x20f263;},_0x2749ba=async _0x189d50=>{const _0x2d4777=a155_0x4ade,{collectSegmentIdsFromJourneyApi:_0x153122}=await import(_0x2d4777(0x1c7)),{batchAsync:_0x2fd0d3}=await import('../../utils/async.js'),_0x48f8f7=new Set();for(const _0x1e6991 of _0x189d50){let _0xd116b0=_0x403b28?.[_0x2d4777(0x1bd)](_0x1e6991);!_0xd116b0&&(_0xd116b0=await _0x2801f5[_0x2d4777(0x1e4)][_0x2d4777(0x1d7)](_0x1e6991));const _0x2da71b=_0x153122(_0xd116b0);for(const _0x14feff of _0x2da71b){_0x48f8f7['add'](_0x14feff);}}let _0x3d53da=Array[_0x2d4777(0x176)](_0x48f8f7);while(_0x3d53da[_0x2d4777(0x140)]>0x0){const _0x4dccd6=_0x3d53da['filter'](_0x4805ed=>!_0x4db2b4['has'](_0x4805ed));if(_0x4dccd6[_0x2d4777(0x140)]===0x0)break;const _0x390df5=await _0x2fd0d3(_0x4dccd6,async _0x2b26d2=>{_0x4db2b4['add'](_0x2b26d2);const _0x274da6=await fetchSegment(_0x2801f5,_0x174031,_0x2b26d2,_0x1adb85);if(!_0x274da6)return null;return{'segmentId':_0x2b26d2,'segment':_0x274da6};},0xa),_0x5f2e50=new Set();for(const _0xd1858e of _0x390df5){if(!_0xd1858e?.[_0x2d4777(0x1cf)]?.[_0x2d4777(0x237)])continue;const _0x393e47=apiRuleToYaml(_0xd1858e['segment'][_0x2d4777(0x237)]);_0x19e7a2['set'](_0xd1858e['segmentId'],_0x393e47);const _0x964bd6=collectSegmentRefsFromRule(_0x393e47);for(const _0x16c502 of _0x964bd6){!_0x4db2b4[_0x2d4777(0x1c9)](_0x16c502)&&_0x5f2e50[_0x2d4777(0x201)](_0x16c502);}}_0x3d53da=Array['from'](_0x5f2e50);}};return{'createYamlContext':_0x26acd7,'prefetchJourneySegments':_0x2749ba};}export async function executePushSegments(_0xe51685,_0x1f3583,_0x549dfe,_0x15daf3,_0x1cee54){const _0x4d2367=a155_0x3e8afc,{segmentDefToCreateRequest:_0x4bb4c4,segmentDefToUpdateRequest:_0x1d7c0b}=await import(_0x4d2367(0x171)),_0x23f801=_0x549dfe[_0x4d2367(0x193)],_0x2112a6=0x5,_0x5ae251=async _0x3fb02a=>{const _0x307264=_0x4d2367,_0x43de5f=_0x3fb02a['folderPath']?_0x23f801[_0x307264(0x1bd)](_0x3fb02a[_0x307264(0x219)]):undefined;let _0x137b4b;const _0x255bc1={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x4ecdeb=_0x3fb02a[_0x307264(0x1d8)];if(_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x237)]){const _0x4b55ee=createSegmentIdResolver(_0x549dfe['segmentNameToId'],_0x3fb02a['yamlConfig'][_0x307264(0x1ea)]),_0x31b538=await resolveRuleSegmentIds(_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x237)],_0x4b55ee);_0x4ecdeb={..._0x3fb02a[_0x307264(0x1d8)],'rule':_0x31b538};}try{if(_0x3fb02a[_0x307264(0x1f1)]){_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x185),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]});const _0x41be83=_0x4bb4c4(_0x4ecdeb,_0x43de5f),_0x29e23c=await _0x1cee54[_0x307264(0x1c4)](_0x307264(0x202)+_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]+_0x307264(0x1fb),()=>_0xe51685[_0x307264(0x1cf)][_0x307264(0x16d)](_0x15daf3['parentId'],_0x41be83));_0x137b4b=_0x29e23c['data']['id'],_0x549dfe[_0x307264(0x1e9)][_0x307264(0x226)](_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)],_0x137b4b),_0x255bc1[_0x307264(0x19f)]={'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)],'id':_0x137b4b},_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x1f3),'name':_0x3fb02a['yamlConfig'][_0x307264(0x1ea)],'segmentId':_0x137b4b}),_0x1cee54[_0x307264(0x1be)]?.('Created\x20segment\x20\x27'+_0x3fb02a[_0x307264(0x1d8)]['name']+'\x27'),_0x255bc1[_0x307264(0x1ff)]=0x1;}else{if(_0x3fb02a[_0x307264(0x21c)]){_0x1cee54['onProgress']?.({'type':_0x307264(0x23b),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]});const _0x349308=_0x1d7c0b(_0x4ecdeb);_0x43de5f!==_0x3fb02a[_0x307264(0x150)]?.[_0x307264(0x1e8)]&&(_0x349308[_0x307264(0x1e8)]=_0x43de5f?parseInt(_0x43de5f,0xa):undefined),await _0x1cee54[_0x307264(0x1c4)]('Updating\x20segment\x20\x27'+_0x3fb02a['yamlConfig'][_0x307264(0x1ea)]+_0x307264(0x1fb),()=>_0xe51685[_0x307264(0x1cf)][_0x307264(0x1c0)](_0x15daf3[_0x307264(0x212)],_0x3fb02a['existingSegment']['id'],_0x349308)),_0x137b4b=_0x3fb02a[_0x307264(0x150)]['id'],_0x1cee54[_0x307264(0x242)]?.({'type':_0x307264(0x18e),'name':_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]}),_0x1cee54[_0x307264(0x1be)]?.(_0x307264(0x1d6)+_0x3fb02a[_0x307264(0x1d8)]['name']+'\x27'),_0x255bc1[_0x307264(0x23c)]=0x1;}else _0x137b4b=_0x3fb02a[_0x307264(0x150)]['id'];}}catch(_0x249aed){const _0x5aed34=isHttp400Error(_0x249aed),_0x59e4cd=_0x5aed34?ErrorCode[_0x307264(0x1fc)]:ErrorCode[_0x307264(0x14b)],_0x3ad62a=getErrorMessage(_0x249aed);throw new SDKError(_0x59e4cd,_0x307264(0x145)+(_0x3fb02a[_0x307264(0x1f1)]?_0x307264(0x148):'update')+_0x307264(0x19b)+_0x3fb02a[_0x307264(0x1fd)]+_0x307264(0x1ca)+_0x3ad62a,_0x249aed);}try{const _0x2ccb13=await syncActivationsForSegment(_0xe51685,_0x15daf3['parentId'],_0x137b4b,_0x3fb02a['yamlConfig'][_0x307264(0x1ea)],_0x3fb02a['activationActions'],_0x1cee54,_0x3fb02a[_0x307264(0x1fd)]);_0x255bc1[_0x307264(0x1e2)]=_0x2ccb13;}catch(_0x19fbfd){if(_0x19fbfd instanceof SDKError)throw _0x19fbfd;throw new SDKError(ErrorCode['ACTIVATION_UPDATE_ERROR'],'Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27'+_0x3fb02a[_0x307264(0x1d8)][_0x307264(0x1ea)]+'\x27\x20from\x20file:\x20'+_0x3fb02a[_0x307264(0x1fd)]+_0x307264(0x1ca)+getErrorMessage(_0x19fbfd),_0x19fbfd);}return _0x255bc1;},_0x241bdb=await batchAsync(_0x1f3583,_0x5ae251,_0x2112a6),_0xaa31e9={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x3c94c0 of _0x241bdb){_0xaa31e9[_0x4d2367(0x1ff)]+=_0x3c94c0['created'],_0xaa31e9[_0x4d2367(0x23c)]+=_0x3c94c0[_0x4d2367(0x23c)],_0x3c94c0[_0x4d2367(0x19f)]&&_0xaa31e9[_0x4d2367(0x207)]['set'](_0x3c94c0[_0x4d2367(0x19f)][_0x4d2367(0x1ea)],_0x3c94c0['createdSegmentId']['id']),_0xaa31e9['activations'][_0x4d2367(0x1ff)]+=_0x3c94c0[_0x4d2367(0x1e2)][_0x4d2367(0x1ff)],_0xaa31e9[_0x4d2367(0x1e2)][_0x4d2367(0x23c)]+=_0x3c94c0[_0x4d2367(0x1e2)][_0x4d2367(0x23c)],_0xaa31e9[_0x4d2367(0x1e2)][_0x4d2367(0x205)]+=_0x3c94c0[_0x4d2367(0x1e2)]['deleted'];}return _0xaa31e9;}async function syncActivationsForSegment(_0x46297,_0x14fcf0,_0x1e9d6c,_0x1e116d,_0x4399f6,_0x4a3b02,_0x1b7d28){const _0x1e343a=a155_0x3e8afc,_0x15ade6={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x5406bf of _0x4399f6){try{if(_0x5406bf[_0x1e343a(0x20c)]===_0x1e343a(0x148)&&_0x5406bf[_0x1e343a(0x1b5)])_0x4a3b02['onProgress']?.({'type':_0x1e343a(0x166),'segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),await _0x4a3b02[_0x1e343a(0x1c4)]('Creating\x20activation\x20\x27'+_0x5406bf['name']+_0x1e343a(0x1fb),()=>_0x46297[_0x1e343a(0x1cf)][_0x1e343a(0x151)](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x1b5)])),_0x4a3b02['onProgress']?.({'type':'activation_created','segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),_0x4a3b02[_0x1e343a(0x1be)]?.(_0x1e343a(0x173)+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x1ff)]++;else{if(_0x5406bf['type']==='update'&&_0x5406bf[_0x1e343a(0x1b5)]&&_0x5406bf[_0x1e343a(0x192)])_0x4a3b02[_0x1e343a(0x242)]?.({'type':'activation_updating','segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),await _0x4a3b02[_0x1e343a(0x1c4)](_0x1e343a(0x1de)+_0x5406bf[_0x1e343a(0x1ea)]+_0x1e343a(0x1fb),()=>_0x46297['segment'][_0x1e343a(0x1d5)](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x192)]['id'],_0x5406bf[_0x1e343a(0x1b5)])),_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x1b4),'segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),_0x4a3b02['logSuccess']?.(_0x1e343a(0x1a4)+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x23c)]++;else _0x5406bf[_0x1e343a(0x20c)]==='delete'&&_0x5406bf[_0x1e343a(0x192)]&&(_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x14e),'segmentName':_0x1e116d,'activationName':_0x5406bf[_0x1e343a(0x1ea)]}),await _0x4a3b02[_0x1e343a(0x1c4)](_0x1e343a(0x234)+_0x5406bf['name']+_0x1e343a(0x1fb),()=>_0x46297[_0x1e343a(0x1cf)]['deleteActivation'](_0x14fcf0,_0x1e9d6c,_0x5406bf[_0x1e343a(0x192)]['id'])),_0x4a3b02[_0x1e343a(0x242)]?.({'type':_0x1e343a(0x1f9),'segmentName':_0x1e116d,'activationName':_0x5406bf['name']}),_0x4a3b02[_0x1e343a(0x175)]?.('Deleted\x20activation\x20\x27'+_0x5406bf[_0x1e343a(0x1ea)]+'\x27'),_0x15ade6[_0x1e343a(0x205)]++);}}catch(_0x4acdc9){const _0x3eb22c=isHttp400Error(_0x4acdc9),_0x2bd182=_0x3eb22c?ErrorCode[_0x1e343a(0x204)]:ErrorCode[_0x1e343a(0x215)],_0x54cf7d=getErrorMessage(_0x4acdc9);throw new SDKError(_0x2bd182,_0x1e343a(0x145)+_0x5406bf[_0x1e343a(0x20c)]+_0x1e343a(0x1e3)+_0x5406bf[_0x1e343a(0x1ea)]+_0x1e343a(0x13e)+_0x1b7d28+_0x1e343a(0x1ca)+_0x54cf7d,_0x4acdc9);}}return _0x15ade6;}export async function executePushFolders(_0x1c37ee,_0x33f160,_0x1b5a5d,_0x5446c8,_0xec07b3){const _0x1f70b7=a155_0x3e8afc,_0x577718=new Map(_0x1b5a5d),_0x4c3b14=sortFoldersByDepth(_0x33f160);for(const _0x1f582d of _0x4c3b14){const _0x184390=_0x1f582d[_0x1f70b7(0x191)]('/'),_0xa1bd14=_0x184390[_0x184390['length']-0x1],_0x2a7e4a=_0x184390[_0x1f70b7(0x195)](0x0,-0x1)[_0x1f70b7(0x23a)]('/'),_0x20dd15=_0x577718[_0x1f70b7(0x1bd)](_0x2a7e4a);_0xec07b3['onProgress']?.({'type':_0x1f70b7(0x1d2),'folder':_0x1f582d});const _0x183128={'name':_0xa1bd14,'parentFolderId':_0x20dd15},_0x780d1=await _0xec07b3[_0x1f70b7(0x1c4)]('Creating\x20folder\x20\x27'+_0x1f582d+_0x1f70b7(0x1fb),()=>_0x1c37ee[_0x1f70b7(0x1cf)]['createFolder'](_0x5446c8[_0x1f70b7(0x212)],_0x183128));_0x577718[_0x1f70b7(0x226)](_0x1f582d,_0x780d1[_0x1f70b7(0x13f)]['id']),_0xec07b3[_0x1f70b7(0x242)]?.({'type':'folder_created','folder':_0x1f582d,'folderId':_0x780d1[_0x1f70b7(0x13f)]['id']}),_0xec07b3[_0x1f70b7(0x1b2)]?.('Created\x20folder\x20\x27'+_0x1f582d+'\x27');}return _0x577718;}export async function executePushSegmentDeletions(_0x4155e6,_0x110263,_0x37e2cd){const _0x4f6e5e=a155_0x3e8afc;if(_0x110263[_0x4f6e5e(0x140)]===0x0)return 0x0;const {batchAsync:_0x1c7001}=await import(_0x4f6e5e(0x1a8)),_0x1dbc81=0x5,_0x100638=await _0x1c7001(_0x110263,async _0x1a45d4=>{const _0x131bd4=_0x4f6e5e;return _0x37e2cd[_0x131bd4(0x242)]?.({'type':_0x131bd4(0x21b),'name':_0x1a45d4[_0x131bd4(0x1ea)]}),await _0x4155e6['segment'][_0x131bd4(0x1f4)](_0x1a45d4['id']),_0x37e2cd[_0x131bd4(0x242)]?.({'type':_0x131bd4(0x170),'name':_0x1a45d4[_0x131bd4(0x1ea)]}),_0x37e2cd[_0x131bd4(0x175)]?.(_0x131bd4(0x1a9)+_0x1a45d4[_0x131bd4(0x1ea)]+'\x27'),0x1;},_0x1dbc81);return _0x100638[_0x4f6e5e(0x1fa)]((_0x5bbc05,_0x1d4751)=>_0x5bbc05+_0x1d4751,0x0);}export async function executePushJourneys(_0x237080,_0x516ebd,_0x1ca9ea,_0x5077f0,_0x389c64){const _0x2fe200=a155_0x3e8afc,{journeyDefToRequest:_0x55df89}=await import('./journey-yaml.js'),{activationDefToCreateRequest:_0x336048,yamlRuleToApi:_0x498f8e,validateSegmentRule:_0x4d139f}=await import(_0x2fe200(0x171)),_0x2f49e0={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x29e6b9=new Map(_0x1ca9ea['segmentNameToId']),_0x5b2b17=0x5;for(let _0x38b414=0x0;_0x38b414<_0x516ebd[_0x2fe200(0x140)];_0x38b414+=_0x5b2b17){const _0x4dbaba=_0x516ebd[_0x2fe200(0x195)](_0x38b414,_0x38b414+_0x5b2b17),_0x5449e8=await Promise['all'](_0x4dbaba[_0x2fe200(0x1ef)](async _0x70f1e2=>{const _0x36b2a7=_0x2fe200;if(!_0x70f1e2[_0x36b2a7(0x1f1)]&&!_0x70f1e2[_0x36b2a7(0x21c)])return{'action':'unchanged','name':_0x70f1e2['yamlConfig'][_0x36b2a7(0x1ea)],'journeyId':_0x70f1e2[_0x36b2a7(0x1bb)]?.['id']};const _0x500fc7=_0x70f1e2[_0x36b2a7(0x219)]?_0x1ca9ea['folderPathToId']['get'](_0x70f1e2['folderPath']):undefined;_0x389c64[_0x36b2a7(0x242)]?.({'type':_0x70f1e2['isNew']?_0x36b2a7(0x19a):_0x36b2a7(0x183),'name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)]});try{const _0x2aab2f=await executeSingleJourneyPush(_0x237080,_0x70f1e2,{..._0x1ca9ea,'segmentNameToId':_0x29e6b9},{'parentId':_0x5077f0[_0x36b2a7(0x212)],'rootFolderId':_0x5077f0['rootFolderId'],'folderId':_0x500fc7,'verbose':_0x5077f0['verbose']},_0x389c64,{'journeyDefToRequest':_0x55df89,'activationDefToCreateRequest':_0x336048,'yamlRuleToApi':_0x498f8e,'validateSegmentRule':_0x4d139f});for(const [_0x3138fc,_0x215ccb]of _0x2aab2f[_0x36b2a7(0x165)]){_0x29e6b9[_0x36b2a7(0x226)](_0x3138fc,_0x215ccb),_0x2f49e0['embeddedSegmentNameToId']['set'](_0x3138fc,_0x215ccb);}if(_0x2aab2f['action']===_0x36b2a7(0x1ff))_0x389c64['onProgress']?.({'type':_0x36b2a7(0x1c6),'name':_0x70f1e2[_0x36b2a7(0x1d8)]['name'],'journeyId':_0x2aab2f['journeyId']}),_0x389c64['logSuccess']?.(_0x36b2a7(0x1ec)+_0x70f1e2[_0x36b2a7(0x1d8)]['name']+'\x27'),_0x2f49e0['created']++;else _0x2aab2f[_0x36b2a7(0x225)]===_0x36b2a7(0x23c)&&(_0x389c64[_0x36b2a7(0x242)]?.({'type':'journey_updated','name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)]}),_0x389c64[_0x36b2a7(0x1be)]?.(_0x36b2a7(0x1d3)+_0x70f1e2[_0x36b2a7(0x1d8)]['name']+'\x27'),_0x2f49e0[_0x36b2a7(0x23c)]++);return{'action':_0x2aab2f[_0x36b2a7(0x225)],'name':_0x70f1e2[_0x36b2a7(0x1d8)][_0x36b2a7(0x1ea)],'journeyId':_0x2aab2f[_0x36b2a7(0x181)]};}catch(_0x5dec90){const _0x280bc2=isHttp400Error(_0x5dec90),_0x1eb85e=_0x280bc2?ErrorCode[_0x36b2a7(0x20a)]:ErrorCode[_0x36b2a7(0x1ce)],_0x43a851=getErrorMessage(_0x5dec90);throw new SDKError(_0x1eb85e,_0x36b2a7(0x145)+(_0x70f1e2[_0x36b2a7(0x1f1)]?_0x36b2a7(0x148):_0x36b2a7(0x206))+_0x36b2a7(0x19c)+_0x70f1e2['absolutePath']+_0x36b2a7(0x1ca)+_0x43a851,_0x5dec90);}}));_0x2f49e0[_0x2fe200(0x1cc)][_0x2fe200(0x209)](..._0x5449e8);}return _0x2f49e0;}async function matchExistingJourneySegments(_0x2c016e,_0x2a2d33,_0x8add1a,_0x3ddd9d,_0xc424ee){const _0x28e1cd=a155_0x3e8afc;if(!_0x2a2d33[_0x28e1cd(0x1bb)]||!_0x2a2d33['yamlConfig'][_0x28e1cd(0x156)])return;const _0x213096=new Map(),_0x181add=new Set();for(const _0x474dce of Object[_0x28e1cd(0x1f0)](_0x2a2d33[_0x28e1cd(0x1d8)][_0x28e1cd(0x156)])){const _0x3ede26=generateDeterministicJourneySegmentName(_0x2a2d33[_0x28e1cd(0x1d8)][_0x28e1cd(0x1ea)],_0x474dce);_0x213096[_0x28e1cd(0x226)](_0x3ede26,_0x474dce),_0x181add[_0x28e1cd(0x201)](_0x474dce);}const _0x3dce37=[],_0x897542=collectSegmentIdsFromJourneyApi(_0x2a2d33[_0x28e1cd(0x1bb)]);for(const _0x435b09 of _0x897542){const _0x3c5094=await fetchSegment(_0x2c016e,_0x8add1a,_0x435b09,_0x3ddd9d);if(!_0x3c5094?.[_0x28e1cd(0x1ea)])continue;const _0x4850a5=_0x213096[_0x28e1cd(0x1bd)](_0x3c5094[_0x28e1cd(0x1ea)]);_0x4850a5?(_0xc424ee[_0x28e1cd(0x226)](_0x4850a5,_0x435b09),_0x181add[_0x28e1cd(0x235)](_0x4850a5)):_0x3dce37[_0x28e1cd(0x209)]({'id':_0x435b09,'seg':_0x3c5094});}if(_0x181add[_0x28e1cd(0x217)]>0x0&&_0x3dce37['length']>0x0){const {localExpandedRuleToNames:_0x4d63c3}=buildLocalExpandedRuleMappings(_0x2a2d33['yamlConfig']),_0xd9cc21=new Map();for(const {id:_0x2e6e61,seg:_0x2230d3}of _0x3dce37){if(_0x2230d3[_0x28e1cd(0x237)]){const _0x100f05=apiRuleToYaml(_0x2230d3[_0x28e1cd(0x237)]);_0xd9cc21[_0x28e1cd(0x226)](_0x2e6e61,_0x100f05);}}for(const {id:_0x2cfc76,seg:_0x44b1e5}of _0x3dce37){if(!_0x44b1e5[_0x28e1cd(0x237)])continue;const _0x725b95=_0xd9cc21[_0x28e1cd(0x1bd)](_0x2cfc76);if(!_0x725b95)continue;const _0x2b930a=serializeExpandedRule(_0x725b95,_0xd9cc21),_0xcce6e=_0x4d63c3[_0x28e1cd(0x1bd)](_0x2b930a);if(_0xcce6e){const _0x560e56=_0xcce6e[_0x28e1cd(0x1d4)](_0x2a158a=>_0x181add[_0x28e1cd(0x1c9)](_0x2a158a));_0x560e56&&(_0xc424ee[_0x28e1cd(0x226)](_0x560e56,_0x2cfc76),_0x181add[_0x28e1cd(0x235)](_0x560e56),logger[_0x28e1cd(0x22b)]('Matched\x20server\x20segment\x20\x27'+_0x44b1e5['name']+_0x28e1cd(0x1dc)+_0x560e56+_0x28e1cd(0x154)));}}}}async function executeSingleJourneyPush(_0x203680,_0x5086c1,_0x2e1f5a,_0x175d9c,_0x32c89d,_0x3dcbcb){const _0x109663=a155_0x3e8afc,{journeyDefToRequest:_0x592f0e,activationDefToCreateRequest:_0x1ec983,yamlRuleToApi:_0x230876,validateSegmentRule:_0x385163}=_0x3dcbcb,_0x42d3b2=new Map(),_0x5ae881=new Map();recoverSegmentIdsFromPushRecovery(_0x5086c1,_0x42d3b2,_0x2e1f5a[_0x109663(0x1e9)]);const _0x25ac48=new Map(),_0x29e407=new Map(),_0x45ecdf=new Map();let _0x535d3c;const _0x481186=async()=>{const _0x29a872=_0x109663;if(_0x535d3c)return;_0x535d3c=new Map();if(!_0x5086c1[_0x29a872(0x1bb)])return;const _0x176a33=await _0x203680[_0x29a872(0x1e4)][_0x29a872(0x17f)](_0x5086c1[_0x29a872(0x1bb)]['id']);for(const _0x116b5e of _0x176a33){const _0x551aa6=journeyActivationStepToYaml(_0x116b5e,_0x2e1f5a[_0x29a872(0x1f7)],_0x2e1f5a[_0x29a872(0x19d)]),_0x58a2bf=activationSignature(_0x551aa6);!_0x535d3c[_0x29a872(0x1c9)](_0x58a2bf)&&_0x535d3c[_0x29a872(0x226)](_0x58a2bf,_0x116b5e['id']),_0x551aa6[_0x29a872(0x1ea)]&&_0x5ae881['set'](_0x551aa6[_0x29a872(0x1ea)],_0x116b5e['id']);}};await matchExistingJourneySegments(_0x203680,_0x5086c1,_0x175d9c['parentId'],_0x2e1f5a[_0x109663(0x15b)],_0x2e1f5a[_0x109663(0x1e9)]);const _0x1bb984={'resolveSegmentId':async _0x502558=>{const _0x3bd9af=_0x109663,_0x3c31e4=_0x2e1f5a[_0x3bd9af(0x1e9)][_0x3bd9af(0x1bd)](_0x502558);if(!_0x3c31e4)throw new SDKError(ErrorCode[_0x3bd9af(0x1a5)],_0x3bd9af(0x17d)+_0x502558+_0x3bd9af(0x1ac)+_0x5086c1['yamlConfig']['name']+')');return _0x3c31e4;},'resolveEmbeddedSegmentId':async(_0x3f756f,_0x286df1)=>{const _0x3d779c=_0x109663,_0x1bbb56=_0x2e1f5a[_0x3d779c(0x1e9)][_0x3d779c(0x1bd)](_0x3f756f);if(_0x1bbb56)return _0x1bbb56;const _0x8ddc50=_0x2e1f5a['existingSegments']['find'](_0x509c32=>_0x509c32['name']===_0x3f756f);if(_0x8ddc50)return _0x2e1f5a[_0x3d779c(0x1e9)][_0x3d779c(0x226)](_0x3f756f,_0x8ddc50['id']),_0x8ddc50['id'];if(_0x5086c1['isNew']){const {stageName:_0x56416b,criteriaName:_0x180ffa}=findSegmentCriteriaLocation(_0x5086c1['yamlConfig'],_0x3f756f);return _0x385163(_0x3f756f,_0x286df1[_0x3d779c(0x237)]),_0x29e407[_0x3d779c(0x226)](_0x3f756f,{'definition':_0x286df1,'stageName':_0x56416b,'criteriaName':_0x180ffa}),createPendingSegmentId(_0x3f756f);}const _0x5a590d=_0x5086c1[_0x3d779c(0x1bb)]?.['id'];if(!_0x5a590d)throw new SDKError(ErrorCode[_0x3d779c(0x1d9)],_0x3d779c(0x1ab));const _0x4bd12a=_0x25ac48[_0x3d779c(0x1bd)](_0x3f756f);if(_0x4bd12a)return _0x4bd12a;const _0x14c88f=((async()=>{const _0x1e3160=_0x3d779c;_0x385163(_0x3f756f,_0x286df1[_0x1e3160(0x237)]);const _0x11231e=generateDeterministicJourneySegmentName(_0x5086c1[_0x1e3160(0x1d8)][_0x1e3160(0x1ea)],_0x3f756f),_0x2c4c1c=_0x2e1f5a[_0x1e3160(0x15b)]['find'](_0x2e3e57=>_0x2e3e57[_0x1e3160(0x1ea)]===_0x11231e),_0x596f70=createSegmentIdResolver(_0x2e1f5a[_0x1e3160(0x1e9)],_0x3f756f),_0x297dda=await resolveRuleSegmentIds(_0x286df1['rule'],_0x596f70);let _0x34c28a;return _0x2c4c1c?(await _0x203680['segment'][_0x1e3160(0x1c0)](_0x175d9c[_0x1e3160(0x212)],_0x2c4c1c['id'],{'description':_0x286df1['description']||_0x1e3160(0x1b8)+_0x3f756f,'rule':_0x230876(_0x297dda),'countPopulation':!![]}),_0x34c28a=_0x2c4c1c['id'],saveSegmentToPushRecovery(_0x5086c1[_0x1e3160(0x1fd)],_0x5086c1['yamlConfig'][_0x1e3160(0x1ea)],_0x3f756f,{'segmentId':_0x34c28a,'uniqueServerName':_0x11231e,'createdAt':new Date()['toISOString']()})):_0x34c28a=await createOrRecoverEmbeddedSegment(_0x203680,_0x5086c1,{'localName':_0x3f756f,'uniqueSegmentName':_0x11231e,'description':_0x286df1['description']||'Entry\x20criteria:\x20'+_0x3f756f,'journeyId':_0x5a590d,'resolvedRule':_0x297dda,'parentId':_0x175d9c['parentId'],'folderId':_0x175d9c[_0x1e3160(0x155)]||''},_0x230876),_0x2e1f5a[_0x1e3160(0x1e9)][_0x1e3160(0x226)](_0x3f756f,_0x34c28a),_0x42d3b2[_0x1e3160(0x226)](_0x3f756f,_0x34c28a),_0x34c28a;})());_0x25ac48[_0x3d779c(0x226)](_0x3f756f,_0x14c88f);try{return await _0x14c88f;}finally{_0x25ac48[_0x3d779c(0x235)](_0x3f756f);}},'resolveActivationId':async _0x4c7102=>{const _0x56647c=_0x109663,_0x46bd0d=_0x5ae881[_0x56647c(0x1bd)](_0x4c7102);if(_0x46bd0d)return _0x46bd0d;if(_0x5086c1['existingJourney']){await _0x481186();const _0x107331=_0x5ae881[_0x56647c(0x1bd)](_0x4c7102);if(_0x107331)return _0x107331;}throw new SDKError(ErrorCode[_0x56647c(0x1b7)],_0x56647c(0x13d)+_0x4c7102+_0x56647c(0x1ac)+_0x5086c1[_0x56647c(0x1d8)][_0x56647c(0x1ea)]+_0x56647c(0x20d)+_0x56647c(0x1c1));},'resolveEmbeddedActivationId':async(_0x1fb9a0,_0x34645a)=>{const _0xa09e3e=_0x109663,_0x34ae1e=_0x5ae881['get'](_0x1fb9a0);if(_0x34ae1e)return _0x34ae1e;if(_0x5086c1['isNew'])return _0x45ecdf[_0xa09e3e(0x226)](_0x1fb9a0,_0x34645a),createPendingActivationId(_0x1fb9a0);if(_0x5086c1[_0xa09e3e(0x1bb)]){await _0x481186();const _0x588748=_0x5ae881[_0xa09e3e(0x1bd)](_0x34645a[_0xa09e3e(0x1ea)]);if(_0x588748)return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x588748),_0x588748;const _0x571241=activationSignature(_0x34645a),_0x459181=_0x535d3c?.[_0xa09e3e(0x1bd)](_0x571241);if(_0x459181)return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x459181),_0x459181;const _0x1352bc=await _0x1ec983(_0x34645a,_0x2e1f5a[_0xa09e3e(0x19e)]),_0x2af3c4={..._0x1352bc,..._0x34645a[_0xa09e3e(0x15d)]!==undefined&&{'runAfterJourneyRefresh':_0x34645a['run_after_journey_refresh']}},_0x446aeb=await _0x203680[_0xa09e3e(0x1e4)][_0xa09e3e(0x151)](_0x5086c1['existingJourney']['id'],_0x2af3c4);return _0x5ae881[_0xa09e3e(0x226)](_0x1fb9a0,_0x446aeb['id']),_0x446aeb['id'];}throw new SDKError(ErrorCode[_0xa09e3e(0x1d9)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0x3877fb=>{const _0x201a13=_0x109663;try{return await _0x203680[_0x201a13(0x1e4)][_0x201a13(0x222)](_0x175d9c[_0x201a13(0x212)],_0x3877fb);}catch(_0x4315df){throw new SDKError(ErrorCode[_0x201a13(0x1b7)],_0x201a13(0x15c)+_0x3877fb+_0x201a13(0x1db)+_0x5086c1[_0x201a13(0x1d8)]['name']+'\x27)',_0x4315df);}},'resolveStageId':async(_0x4eb4cd,_0x20b60c)=>{const _0xb13f05=_0x109663,_0x2c83a9=await _0x203680[_0xb13f05(0x1e4)][_0xb13f05(0x1d7)](_0x4eb4cd),_0x291466=_0x2c83a9['attributes'][_0xb13f05(0x16a)]['find'](_0x15daf8=>_0x15daf8[_0xb13f05(0x1ea)][_0xb13f05(0x1bf)]()===_0x20b60c[_0xb13f05(0x1bf)]());if(!_0x291466?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],_0xb13f05(0x186)+_0x20b60c+_0xb13f05(0x22d)+(_0x2c83a9[_0xb13f05(0x169)][_0xb13f05(0x174)]||_0x2c83a9[_0xb13f05(0x169)][_0xb13f05(0x1ea)])+'\x27');return _0x291466['id'];}},_0xe77327=await _0x592f0e(_0x5086c1['yamlConfig'],_0x175d9c['parentId'],_0x1bb984),_0x3bc7d1=_0x175d9c[_0x109663(0x1cd)]||_0x175d9c[_0x109663(0x155)];_0x3bc7d1&&(_0xe77327[_0x109663(0x22f)]={'parentFolder':{'data':{'id':_0x3bc7d1,'type':'folder'}}});if(_0x5086c1[_0x109663(0x1f1)]){if(_0x29e407['size']>0x0||_0x45ecdf[_0x109663(0x217)]>0x0)return await executeThreeStepJourneyCreate(_0x203680,_0x5086c1,_0xe77327,{'pendingEmbeddedSegments':_0x29e407,'pendingEmbeddedActivations':_0x45ecdf,'embeddedSegmentNameToId':_0x42d3b2,'journeyActivationNameToId':_0x5ae881},{..._0x175d9c,'effectiveFolderId':_0x3bc7d1},_0x2e1f5a,_0x32c89d,_0x3dcbcb);else{ensureJourneyDefaults(_0xe77327['attributes']);const _0x20e9ae=await _0x203680['journey'][_0x109663(0x148)](_0xe77327);return deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':'created','journeyId':_0x20e9ae['id'],'embeddedSegmentNameToId':_0x42d3b2};}}else{if(_0x5086c1[_0x109663(0x21c)]&&_0x5086c1['existingJourney']){_0xe77327['id']=_0x5086c1['existingJourney']['id'];const _0x12f904=_0xe77327['attributes'];_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]?.['journeyBundleName']&&(_0x12f904['journeyBundleName']=_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]['journeyBundleName']);const _0x133c50=_0x5086c1[_0x109663(0x1bb)][_0x109663(0x169)]?.[_0x109663(0x16a)];return _0x133c50&&_0xe77327[_0x109663(0x169)][_0x109663(0x16a)]&&injectExistingStageIds(_0xe77327[_0x109663(0x169)]['journeyStages'],_0x133c50),ensureJourneyDefaults(_0x12f904),await _0x203680[_0x109663(0x1e4)]['update'](_0x5086c1[_0x109663(0x1bb)]['id'],_0xe77327),deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':'updated','journeyId':_0x5086c1[_0x109663(0x1bb)]['id'],'embeddedSegmentNameToId':_0x42d3b2};}}return deletePushRecovery(_0x5086c1[_0x109663(0x1fd)]),{'action':_0x109663(0x21d),'journeyId':_0x5086c1['existingJourney']?.['id'],'embeddedSegmentNameToId':_0x42d3b2};}function findSegmentCriteriaLocation(_0x11e085,_0x2f7a3e){const _0x14b7fa=a155_0x3e8afc,_0x170b22=_0x11e085['stages']||_0x11e085[_0x14b7fa(0x1b6)]?.[0x0]?.['stages']||[];let _0x33c795='entry',_0x4a8abe=_0x2f7a3e;const _0x39fe5e=_0x11e085[_0x14b7fa(0x221)]||_0x11e085['journeys']?.[0x0]?.['goal'];if(_0x39fe5e?.[_0x14b7fa(0x1cf)]===_0x2f7a3e)return{'stageName':'goal','criteriaName':_0x39fe5e['name']||_0x2f7a3e};_0x19f7f5:for(const _0x154352 of _0x170b22){if(_0x154352[_0x14b7fa(0x218)]?.[_0x14b7fa(0x1cf)]===_0x2f7a3e){_0x33c795=_0x154352[_0x14b7fa(0x1ea)],_0x4a8abe=_0x154352['entry_criteria'][_0x14b7fa(0x1ea)]||_0x2f7a3e;break;}if(_0x154352[_0x14b7fa(0x1f5)])for(const _0x3ebf84 of _0x154352[_0x14b7fa(0x1f5)]){if(_0x3ebf84['type']==='decision_point'&&_0x3ebf84['with']?.[_0x14b7fa(0x16e)])for(const _0x21ae37 of _0x3ebf84[_0x14b7fa(0x16c)][_0x14b7fa(0x16e)]){if(_0x21ae37[_0x14b7fa(0x1cf)]===_0x2f7a3e){_0x33c795=_0x154352[_0x14b7fa(0x1ea)],_0x4a8abe=_0x21ae37['name']||_0x2f7a3e;break _0x19f7f5;}}}}return{'stageName':_0x33c795,'criteriaName':_0x4a8abe};}async function executeThreeStepJourneyCreate(_0x3f04b7,_0x5ce3a0,_0xcc729f,_0xcb8a56,_0x3287d4,_0x4e0937,_0x4fd9b4,_0x5c3076){const _0x8f6373=a155_0x3e8afc,{activationDefToCreateRequest:_0x14b87f,yamlRuleToApi:_0x19739e}=_0x5c3076,{pendingEmbeddedSegments:_0x445344,pendingEmbeddedActivations:_0x3f78fa,embeddedSegmentNameToId:_0x101e07}=_0xcb8a56,_0x1319c1=JSON[_0x8f6373(0x15f)](JSON[_0x8f6373(0x22e)](_0xcc729f));ensureJourneyDefaults(_0x1319c1[_0x8f6373(0x169)]),stripPendingIds(_0x1319c1);const _0x1f8f95=await _0x3f04b7[_0x8f6373(0x1e4)]['create'](_0x1319c1),_0x5bef8c=_0x1f8f95['id'],_0x470bde=new Map();for(const _0x55e199 of _0x1f8f95['attributes'][_0x8f6373(0x16a)]){_0x470bde[_0x8f6373(0x226)](_0x55e199[_0x8f6373(0x1ea)][_0x8f6373(0x1bf)](),_0x55e199['id']);}recoverSegmentIdsFromPushRecovery(_0x5ce3a0,_0x101e07,_0x4e0937[_0x8f6373(0x1e9)]);for(const [_0x3886df,{definition:_0x247b9c}]of _0x445344){if(_0x101e07[_0x8f6373(0x1c9)](_0x3886df)){_0x4fd9b4[_0x8f6373(0x242)]?.({'type':_0x8f6373(0x1e1),'journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'segmentName':_0x3886df});continue;}const _0x39c492=generateDeterministicJourneySegmentName(_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],_0x3886df);_0x4fd9b4[_0x8f6373(0x242)]?.({'type':'embedded_segment_creating','journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'segmentName':_0x3886df});const _0x254174=createSegmentIdResolver(_0x4e0937[_0x8f6373(0x1e9)],_0x3886df),_0x8e2c1f=await resolveRuleSegmentIds(_0x247b9c[_0x8f6373(0x237)],_0x254174),_0x40bf3d=await createOrRecoverEmbeddedSegment(_0x3f04b7,_0x5ce3a0,{'localName':_0x3886df,'uniqueSegmentName':_0x39c492,'description':_0x247b9c[_0x8f6373(0x214)]||'Entry\x20criteria:\x20'+_0x3886df,'journeyId':_0x5bef8c,'resolvedRule':_0x8e2c1f,'parentId':_0x3287d4['parentId'],'folderId':_0x3287d4['effectiveFolderId']||''},_0x19739e);_0x101e07[_0x8f6373(0x226)](_0x3886df,_0x40bf3d),_0x4e0937['segmentNameToId'][_0x8f6373(0x226)](_0x3886df,_0x40bf3d),_0x4fd9b4['onProgress']?.({'type':_0x8f6373(0x1e1),'journeyName':_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],'segmentName':_0x3886df});}const _0x2f42ea=new Map();for(const [_0x4a38e9,_0x5cc95c]of _0x3f78fa){_0x4fd9b4[_0x8f6373(0x242)]?.({'type':_0x8f6373(0x17c),'journeyName':_0x5ce3a0[_0x8f6373(0x1d8)][_0x8f6373(0x1ea)],'activationName':_0x4a38e9});const _0x202b0b=await _0x14b87f(_0x5cc95c,_0x4e0937[_0x8f6373(0x19e)]),_0x412c41={..._0x202b0b,..._0x5cc95c[_0x8f6373(0x15d)]!==undefined&&{'runAfterJourneyRefresh':_0x5cc95c[_0x8f6373(0x15d)]}},_0x828842=await _0x3f04b7[_0x8f6373(0x1e4)]['createActivation'](_0x5bef8c,_0x412c41);_0x2f42ea['set'](_0x4a38e9,_0x828842['id']),_0xcb8a56[_0x8f6373(0x22a)]['set'](_0x4a38e9,_0x828842['id']),_0x4fd9b4['onProgress']?.({'type':_0x8f6373(0x14a),'journeyName':_0x5ce3a0['yamlConfig'][_0x8f6373(0x1ea)],'activationName':_0x4a38e9});}const _0x488fec=JSON[_0x8f6373(0x15f)](JSON[_0x8f6373(0x22e)](_0xcc729f));return _0x488fec['id']=_0x5bef8c,ensureJourneyDefaults(_0x488fec[_0x8f6373(0x169)]),resolvePendingIdsInRequest(_0x488fec,_0xcc729f,_0x470bde,_0x101e07,_0x2f42ea,_0x4fd9b4),await _0x3f04b7['journey'][_0x8f6373(0x206)](_0x5bef8c,_0x488fec),deletePushRecovery(_0x5ce3a0[_0x8f6373(0x1fd)]),{'action':_0x8f6373(0x1ff),'journeyId':_0x5bef8c,'embeddedSegmentNameToId':_0x101e07};}export function stripWaitStepPendingIds(_0x40bf2f){const _0x4e9a1b=a155_0x3e8afc,_0x4459b4=_0x40bf2f[_0x4e9a1b(0x182)]&&isPendingSegmentId(_0x40bf2f[_0x4e9a1b(0x182)]),_0x3d616b=_0x40bf2f['conditions']?.[_0x4e9a1b(0x20e)](_0x2aab19=>_0x2aab19[_0x4e9a1b(0x1a0)]&&isPendingSegmentId(_0x2aab19[_0x4e9a1b(0x1a0)]));(_0x4459b4||_0x3d616b)&&(_0x40bf2f[_0x4e9a1b(0x189)]=_0x4e9a1b(0x1c5),_0x40bf2f[_0x4e9a1b(0x20f)]=0x1,_0x40bf2f[_0x4e9a1b(0x21a)]=_0x4e9a1b(0x1ae),delete _0x40bf2f['conditionSegmentId'],delete _0x40bf2f[_0x4e9a1b(0x16f)],delete _0x40bf2f['conditionTimeoutUnit'],delete _0x40bf2f[_0x4e9a1b(0x21f)]);}export function resolveWaitStepPendingIds(_0x78d326,_0x1999b7,_0xef8343,_0x5aef09){const _0x21b826=a155_0x3e8afc;if(_0x1999b7[_0x21b826(0x182)]&&isPendingSegmentId(_0x1999b7[_0x21b826(0x182)])){const _0xeb05d3=_0xef8343(_0x1999b7['conditionSegmentId'],_0x21b826(0x1b1)+_0x5aef09+_0x21b826(0x177));_0xeb05d3&&(_0x78d326['waitStepType']=_0x21b826(0x23e),_0x78d326['conditionSegmentId']=_0xeb05d3,delete _0x78d326['waitStep'],delete _0x78d326[_0x21b826(0x21a)],_0x1999b7[_0x21b826(0x16f)]!==undefined&&(_0x78d326[_0x21b826(0x16f)]=_0x1999b7['conditionTimeoutDuration']),_0x1999b7[_0x21b826(0x168)]&&(_0x78d326[_0x21b826(0x168)]=_0x1999b7[_0x21b826(0x168)]));}if(_0x1999b7[_0x21b826(0x21f)]){const _0x15f8d2=_0x1999b7[_0x21b826(0x21f)][_0x21b826(0x20e)](_0x3bb161=>_0x3bb161[_0x21b826(0x1a0)]&&isPendingSegmentId(_0x3bb161[_0x21b826(0x1a0)]));if(_0x15f8d2){const _0x31c080=_0x1999b7[_0x21b826(0x21f)][_0x21b826(0x1ef)](_0x986975=>{const _0x3c53d7=_0x21b826;if(_0x986975[_0x3c53d7(0x1a0)]&&isPendingSegmentId(_0x986975[_0x3c53d7(0x1a0)])){const _0x447654=_0xef8343(_0x986975[_0x3c53d7(0x1a0)],_0x3c53d7(0x1b1)+_0x5aef09+'\x27\x20wait\x20condition');return{..._0x986975,'segmentId':_0x447654||_0x986975[_0x3c53d7(0x1a0)]};}return{..._0x986975};});_0x78d326[_0x21b826(0x189)]=_0x21b826(0x23e),_0x78d326[_0x21b826(0x21f)]=_0x31c080,delete _0x78d326[_0x21b826(0x20f)],delete _0x78d326[_0x21b826(0x21a)],delete _0x78d326[_0x21b826(0x182)],delete _0x78d326[_0x21b826(0x16f)],delete _0x78d326['conditionTimeoutUnit'];}}}function stripPendingIds(_0x557a6a){const _0x1562d3=a155_0x3e8afc;_0x557a6a['attributes'][_0x1562d3(0x221)]?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x557a6a['attributes'][_0x1562d3(0x221)][_0x1562d3(0x1a0)])&&delete _0x557a6a[_0x1562d3(0x169)][_0x1562d3(0x221)];for(const _0x1f3574 of _0x557a6a[_0x1562d3(0x169)][_0x1562d3(0x16a)]||[]){_0x1f3574[_0x1562d3(0x196)]?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1f3574['entryCriteria'][_0x1562d3(0x1a0)])&&delete _0x1f3574[_0x1562d3(0x196)];_0x1f3574['milestone']?.[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1f3574[_0x1562d3(0x1af)][_0x1562d3(0x1a0)])&&delete _0x1f3574[_0x1562d3(0x1af)];_0x1f3574['exitCriterias']&&(_0x1f3574['exitCriterias']=_0x1f3574[_0x1562d3(0x17b)][_0x1562d3(0x220)](_0x204638=>!_0x204638[_0x1562d3(0x1a0)]||!isPendingSegmentId(_0x204638[_0x1562d3(0x1a0)])));if(_0x1f3574[_0x1562d3(0x1f5)])for(const _0x126b73 of Object[_0x1562d3(0x1f0)](_0x1f3574[_0x1562d3(0x1f5)])){const _0x5e0396=_0x1f3574[_0x1562d3(0x1f5)][_0x126b73];_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x223)&&_0x5e0396[_0x1562d3(0x1eb)]&&isPendingActivationId(_0x5e0396[_0x1562d3(0x1eb)])&&(_0x5e0396[_0x1562d3(0x1eb)]='');if(_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x190)&&_0x5e0396[_0x1562d3(0x16e)])for(const _0x1d8898 of _0x5e0396[_0x1562d3(0x16e)]){_0x1d8898[_0x1562d3(0x1a0)]&&isPendingSegmentId(_0x1d8898[_0x1562d3(0x1a0)])&&(_0x1d8898[_0x1562d3(0x1a0)]='');}_0x5e0396[_0x1562d3(0x20c)]===_0x1562d3(0x1ee)&&stripWaitStepPendingIds(_0x5e0396);}}}function resolvePendingIdsInRequest(_0x4852c8,_0x456269,_0x548a1e,_0x8443d6,_0x37a340,_0x147cf3){const _0x2e45a1=a155_0x3e8afc,_0x5f1d28=(_0x418794,_0x4d464a)=>{const _0x31154d=a155_0x4ade;if(!isPendingSegmentId(_0x418794))return _0x418794;const _0x4e6807=extractPendingSegmentName(_0x418794),_0x11745e=_0x8443d6[_0x31154d(0x1bd)](_0x4e6807);return!_0x11745e&&_0x147cf3['logWarning']?.('Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27'+_0x4e6807+'\x27\x20for\x20'+_0x4d464a),_0x11745e;};if(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)])){const _0x10574d=_0x5f1d28(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)],_0x2e45a1(0x241));_0x10574d&&(_0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x221)][_0x2e45a1(0x1a0)]=_0x10574d);}for(const _0x48fcc9 of _0x4852c8[_0x2e45a1(0x169)][_0x2e45a1(0x16a)]||[]){const _0x1be0ba=_0x548a1e[_0x2e45a1(0x1bd)](_0x48fcc9[_0x2e45a1(0x1ea)][_0x2e45a1(0x1bf)]());_0x1be0ba&&(_0x48fcc9['id']=_0x1be0ba);if(_0x48fcc9[_0x2e45a1(0x196)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x48fcc9['entryCriteria']['segmentId'])){const _0x33259d=_0x5f1d28(_0x48fcc9['entryCriteria'][_0x2e45a1(0x1a0)],'stage\x20\x27'+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x159));_0x33259d&&(_0x48fcc9[_0x2e45a1(0x196)][_0x2e45a1(0x1a0)]=_0x33259d);}if(_0x48fcc9['exitCriterias'])for(const _0x150968 of _0x48fcc9[_0x2e45a1(0x17b)]){if(_0x150968[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x150968[_0x2e45a1(0x1a0)])){const _0x9f7d30=_0x5f1d28(_0x150968[_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x141));_0x9f7d30&&(_0x150968[_0x2e45a1(0x1a0)]=_0x9f7d30);}}if(_0x48fcc9[_0x2e45a1(0x1af)]?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x48fcc9[_0x2e45a1(0x1af)]['segmentId'])){const _0x5cfc16=_0x5f1d28(_0x48fcc9[_0x2e45a1(0x1af)][_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+_0x2e45a1(0x1b3));_0x5cfc16&&(_0x48fcc9[_0x2e45a1(0x1af)][_0x2e45a1(0x1a0)]=_0x5cfc16);}if(_0x48fcc9[_0x2e45a1(0x1f5)]){const _0x58deca=_0x407b8d=>_0x456269[_0x2e45a1(0x169)][_0x2e45a1(0x16a)]?.['find'](_0x31f15c=>_0x31f15c['name']['toLowerCase']()===_0x48fcc9['name']['toLowerCase']())?.['steps']?.[_0x407b8d];for(const _0x57da17 of Object[_0x2e45a1(0x1f0)](_0x48fcc9[_0x2e45a1(0x1f5)])){const _0x5576ff=_0x48fcc9[_0x2e45a1(0x1f5)][_0x57da17],_0x1e90b8=_0x58deca(_0x57da17);if(_0x5576ff['type']===_0x2e45a1(0x223)&&_0x5576ff[_0x2e45a1(0x1eb)]&&(isPendingActivationId(_0x5576ff['journeyActivationStepId'])||_0x5576ff['journeyActivationStepId']==='')){if(_0x1e90b8?.[_0x2e45a1(0x1eb)]&&isPendingActivationId(_0x1e90b8[_0x2e45a1(0x1eb)])){const _0x3874c5=extractPendingActivationName(_0x1e90b8['journeyActivationStepId']),_0x5cfac3=_0x37a340[_0x2e45a1(0x1bd)](_0x3874c5);_0x5cfac3&&(_0x5576ff['journeyActivationStepId']=_0x5cfac3);}}if(_0x5576ff['type']===_0x2e45a1(0x190)&&_0x5576ff[_0x2e45a1(0x16e)]&&_0x1e90b8?.[_0x2e45a1(0x16e)])for(let _0x1ed25d=0x0;_0x1ed25d<_0x5576ff['branches'][_0x2e45a1(0x140)];_0x1ed25d++){const _0x2a2974=_0x5576ff[_0x2e45a1(0x16e)][_0x1ed25d],_0x8c2fb4=_0x1e90b8[_0x2e45a1(0x16e)][_0x1ed25d];if(_0x8c2fb4?.[_0x2e45a1(0x1a0)]&&isPendingSegmentId(_0x8c2fb4['segmentId'])){const _0x4712e4=_0x5f1d28(_0x8c2fb4[_0x2e45a1(0x1a0)],_0x2e45a1(0x1b1)+_0x48fcc9[_0x2e45a1(0x1ea)]+'\x27\x20decision\x20point\x20branch\x20\x27'+(_0x2a2974[_0x2e45a1(0x1ea)]||_0x1ed25d)+'\x27');_0x4712e4&&(_0x2a2974[_0x2e45a1(0x1a0)]=_0x4712e4);}}_0x5576ff[_0x2e45a1(0x20c)]===_0x2e45a1(0x1ee)&&_0x1e90b8?.[_0x2e45a1(0x20c)]===_0x2e45a1(0x1ee)&&resolveWaitStepPendingIds(_0x5576ff,_0x1e90b8,_0x5f1d28,_0x48fcc9[_0x2e45a1(0x1ea)]);}}}}
|
|
1
|
+
const a155_0x50aee1=a155_0x1494;(function(_0x1196e1,_0x38270e){const _0x115241=a155_0x1494,_0x5dcd61=_0x1196e1();while(!![]){try{const _0x44274f=-parseInt(_0x115241(0x12d))/0x1*(-parseInt(_0x115241(0x135))/0x2)+parseInt(_0x115241(0x95))/0x3+parseInt(_0x115241(0x7b))/0x4+parseInt(_0x115241(0x7e))/0x5*(parseInt(_0x115241(0x16f))/0x6)+parseInt(_0x115241(0xfc))/0x7*(-parseInt(_0x115241(0x83))/0x8)+-parseInt(_0x115241(0x162))/0x9*(-parseInt(_0x115241(0x11b))/0xa)+-parseInt(_0x115241(0x81))/0xb;if(_0x44274f===_0x38270e)break;else _0x5dcd61['push'](_0x5dcd61['shift']());}catch(_0x3b75ce){_0x5dcd61['push'](_0x5dcd61['shift']());}}}(a155_0x383d,0x8b3e6));import{createHash}from'crypto';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x50aee1(0x163));export const PENDING_SEGMENT_PREFIX=a155_0x50aee1(0x118);export const PENDING_ACTIVATION_PREFIX=a155_0x50aee1(0x175);export function createPendingSegmentId(_0x1da63a){return''+PENDING_SEGMENT_PREFIX+_0x1da63a+'__';}export function isPendingSegmentId(_0x3878af){const _0x4107f2=a155_0x50aee1;return _0x3878af[_0x4107f2(0x146)](PENDING_SEGMENT_PREFIX)&&!_0x3878af['startsWith'](PENDING_ACTIVATION_PREFIX);}export function extractPendingSegmentName(_0x46cfdd){const _0x1a825f=a155_0x50aee1;return _0x46cfdd[_0x1a825f(0x131)](/^__pending_(.+)__$/,'$1');}export function createPendingActivationId(_0x4112d9){return''+PENDING_ACTIVATION_PREFIX+_0x4112d9+'__';}export function isPendingActivationId(_0x307d70){const _0xa0edee=a155_0x50aee1;return _0x307d70[_0xa0edee(0x146)](PENDING_ACTIVATION_PREFIX);}export function extractPendingActivationName(_0xeaba7b){const _0x249164=a155_0x50aee1;return _0xeaba7b[_0x249164(0x131)](/^__pending_act_(.+)__$/,'$1');}export function generateDeterministicJourneySegmentName(_0x174cbc,_0x290f51){const _0x532c49=a155_0x50aee1,_0x27eee0=_0x174cbc+'::'+(_0x290f51['trim']()||_0x532c49(0xa7)),_0x41ab3c=createHash(_0x532c49(0x158))[_0x532c49(0xd7)](_0x27eee0)['digest'](_0x532c49(0x8d))[_0x532c49(0x8b)](0x0,0xc);return'journey_entry_criteria_'+_0x41ab3c;}export function ensureJourneyDefaults(_0x468d1a){const _0x14c537=a155_0x50aee1;!_0x468d1a['description']&&(_0x468d1a[_0x14c537(0x174)]=''),!_0x468d1a['state']&&(_0x468d1a[_0x14c537(0x17a)]=_0x14c537(0xb5));}export function injectExistingStageIds(_0x5c68ad,_0x4598dd){const _0x47ccd6=a155_0x50aee1,_0x2349a6=new Map(_0x4598dd['map'](_0x5b1d72=>[_0x5b1d72[_0x47ccd6(0xa3)],_0x5b1d72['id']]));for(const _0x4050cd of _0x5c68ad){if(!_0x4050cd['id']){const _0x1a171b=_0x2349a6[_0x47ccd6(0x100)](_0x4050cd[_0x47ccd6(0xa3)]);_0x1a171b&&(_0x4050cd['id']=_0x1a171b);}}}export function resolveTDFolderPath(_0x26c0fe,_0x6739ff,_0x2f3469){const _0x4b578b=a155_0x50aee1;if(!_0x6739ff)return _0x26c0fe;if(_0x26c0fe===_0x2f3469||_0x26c0fe[_0x4b578b(0x146)](_0x2f3469+'/'))return _0x26c0fe;return _0x26c0fe?_0x2f3469+'/'+_0x26c0fe:_0x2f3469;}export function addFoldersToCreate(_0x140aeb,_0x539a1f,_0x30b0a8){const _0x330b04=a155_0x50aee1;if(!_0x140aeb)return;if(_0x539a1f[_0x330b04(0x125)](_0x140aeb))return;const _0x4d6965=_0x140aeb['split']('/');let _0x4ef3bc='';for(const _0x6aa9 of _0x4d6965){_0x4ef3bc=_0x4ef3bc?_0x4ef3bc+'/'+_0x6aa9:_0x6aa9,!_0x539a1f[_0x330b04(0x125)](_0x4ef3bc)&&_0x30b0a8[_0x330b04(0x167)](_0x4ef3bc);}}export function sortFoldersByDepth(_0x1a7af0){const _0x2d0503=a155_0x50aee1;return[..._0x1a7af0][_0x2d0503(0xc4)]((_0x97beda,_0x5925b1)=>{const _0x288d54=_0x2d0503,_0x5966a6=(_0x97beda['match'](/\//g)||[])[_0x288d54(0xd1)],_0x2d446e=(_0x5925b1[_0x288d54(0x11e)](/\//g)||[])[_0x288d54(0xd1)];return _0x5966a6-_0x2d446e;});}import*as a155_0x2b1cb1 from'yaml';import{readFileSync}from'fs';import a155_0x156b1f from'path';import{isJourneyDef,parseYamlString as a155_0x41b119,toYamlString as a155_0x359912,normalizeJourneyDef,hasMultipleVersions,journeyResponseToDef,collectSegmentIdsFromJourneyApi}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,createJumpTargetCache,resolveJumpTarget,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,collectSegmentUsageCounts}from'./journey-utils.js';import{activationResponseToDef,segmentToYamlString,segmentWithActivationsToYaml,parseSegmentYamlFile,normalizeChildSegmentYaml,apiRuleToYaml,yamlRuleToApi,serializeExpandedRule,collectSegmentRefsFromRule,resolveRuleSegmentRefs,resolveRuleSegmentIds,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{batchAsync}from'../../utils/async.js';function a155_0x383d(){const _0x20e812=['Condition','action','errors','yamlActivation','draft','join','data','logSuccess','includes','parse','createdSegmentIds','waitStepUnit','\x27\x20entry\x20criteria','embedded_activation_created','getSegment\x20failed\x20for\x20','keys','diff','yamlConfig','segment_updated','sort','some','folderPath','relationships','Updating\x20segment\x20\x27','toString','SEGMENT_NOT_FOUND','find','JOURNEY_UPDATE_ERROR','../../utils/async.js','message','debug','Duration','length','behavior','Warning:\x20Could\x20not\x20resolve\x20embedded\x20segment\x20\x27','nameToType','deleteSegment','validatedRequest','update','getJourney','existingSegments','isNew','absolutePath','journeyActivationStepId','getLatestJourneyId','uniqueServerName','exitCriterias','existingJourney','all','Deleting\x20activation\x20\x27','\x27\x20wait\x20condition','Journey\x20\x27','object','columns','activations','./child-segment-yaml.js','activationStepsById','\x27\x20exit\x20criteria','decision_point','Failed\x20to\x20resolve\x20segment\x20','toISOString','effectiveFolderId','INTERNAL','DecisionPoint','conditionTimeoutUnit','toLowerCase','journeyStages','branches','ACTIVATION_UPDATE_ERROR','steps','uniqueSegmentName','Creating\x20folder\x20\x27','Cannot\x20create\x20embedded\x20segment\x20for\x20existing\x20journey\x20without\x20journey\x20ID','Matched\x20server\x20segment\x20\x27','rootFolderId','6219178NUiAOi','Failed\x20to\x20sync\x20activations\x20for\x20segment\x20\x27','rule','Segment\x20not\x20found:\x20','get','notification','type','folder_created','journey_creating','segment_creating','idToEmailMap','journeyActivationNameToId','attributes','item','\x27\x20from\x20file:\x20','and\x20the\x20server\x20segment,\x20then\x20retry.','embedded_segment_created','push','Updated\x20segment\x20\x27','createdSegmentId','Delete\x20the\x20push\x20recovery\x20file\x20(',').\x20','activation_template_id','goal','Failed\x20to\x20','Entry\x20criteria:\x20','\x27\x20for\x20','journeyId','__pending_','list','segmentId','470WSpCcc','waitStep','max','match','split','.$1.push-recovery.json','schedule','parseDocument','resolvedRule','index','has','getSegmentEntity\x20also\x20failed\x20for\x20','\x27\x20not\x20found\x20in\x20journey\x20\x27','\x27\x20to\x20local\x20\x27','deleted','progress','listActivations','connection','274121bkhpFY','connector_config','logInfo','stringify','replace','journeyBundleId','entries','JOURNEY_SYNTAX_ERROR','2hAslfg','map','journeyBundleName','conditions','updated','SEGMENT_UPDATE_ERROR','\x0a\x20\x20','connectionIdToNameMap','Segment\x20not\x20found','versionNumber','Failed\x20to\x20resolve\x20activation\x20','Created\x20segment\x20\x27','segment_deleted','parentId','activationsBySegmentId','embeddedSegmentNameToId','segmentNameToId','startsWith','NOT_FOUND','folderId','relative','waitStepType','with','\x27\x20decision\x20point\x20branch\x20\x27','size','all_columns','entry_criteria','folderPathToId','embedded_activation_creating','activation_deleting','idToName','localName','SEGMENT_SYNTAX_ERROR','segments','createFolder','sha1','createJourneySegment','Name\x20has\x20already\x20been\x20taken','milestone','nameToId','Activation\x20not\x20found:\x20','filter','journeyName','delete','utf-8','198972DnrKIU','tdx.sdk.push-workflow','from','Fetching\x20','hasChanges','add','journeyBundlesByFolderAndName','dirname','fetchJourney','Creating\x20activation\x20\x27','\x20(referenced\x20in\x20journey\x20','WaitStep','created','176532PkfFva','logWarning','getSegmentEntity','journey_updating','\x20journey\x20from\x20file:\x20','description','__pending_act_','activation_created','entryCriteria','embedded_segment_creating','stages','state','segment_updating','activationParams','getActivation','resolveSegment','journey_created','values','segmentByFolderAndName','activation_deleted','flatMap','ACTIVATION_SYNTAX_ERROR','3399028BGiaVk','\x27...','set','5ZhdtBz','Created\x20activation\x20\x27','\x20(referenced\x20in\x20embedded\x20segment\x20\x27','11852170gvueRA','segment_created','8ixlWEC','journey','Created\x20folder\x20\x27','Activation','create','existingActivation','parentFolder','Deleted\x20activation\x20\x27','slice','conditionTimeoutDuration','hex','segmentFolderId','createActivation','activationActions','Updated\x20journey\x20\x27','journeys','resolveJourneyId','logDeleted','1031670SssANQ','Embedded\x20segment\x20\x27','valid','journey_updated',',\x20falling\x20back\x20to\x20getSegmentEntity:\x20','folder_creating','goal\x20criteria','onProgress','Failed\x20to\x20fetch\x20referenced\x20segment\x20','\x27\x20milestone','conditionSegmentId','activation_','updateSegmentById','run_after_journey_refresh','name','Define\x20it\x20in\x20the\x20journey\x27s\x20\x27activations\x27\x20section\x20or\x20use\x20an\x20existing\x20activation\x20ID.','./journey-yaml.js','reduce','segment','withProgress','isArray','existingSegment','journeyById','unchanged','stage\x20\x27','activationContext','deps','verbose'];a155_0x383d=function(){return _0x20e812;};return a155_0x383d();}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(_0x4e5f7c){const _0x547cfd=a155_0x50aee1;if(Array[_0x547cfd(0xa9)](_0x4e5f7c))return'['+_0x4e5f7c['map'](_0x4f6370=>stableStringify(_0x4f6370))['join'](',')+']';if(_0x4e5f7c&&typeof _0x4e5f7c===_0x547cfd(0xe5)){const _0x18a566=_0x4e5f7c,_0x4873db=Object[_0x547cfd(0xc0)](_0x18a566)[_0x547cfd(0xc4)](),_0x1a92ff=_0x4873db[_0x547cfd(0x136)](_0x56006a=>'\x22'+_0x56006a+'\x22:'+stableStringify(_0x18a566[_0x56006a]));return'{'+_0x1a92ff[_0x547cfd(0xb6)](',')+'}';}const _0x2b7f56=JSON[_0x547cfd(0x130)](_0x4e5f7c);return _0x2b7f56===undefined?'null':_0x2b7f56;}function activationSignature(_0xfa716b){const _0x135b72=a155_0x50aee1,_0x4c7c26={'connection':_0xfa716b['connection'],..._0xfa716b[_0x135b72(0x14e)]!==undefined&&{'all_columns':_0xfa716b[_0x135b72(0x14e)]},..._0xfa716b[_0x135b72(0xe6)]!==undefined&&{'columns':_0xfa716b[_0x135b72(0xe6)]},..._0xfa716b[_0x135b72(0xd2)]!==undefined&&{'behavior':_0xfa716b[_0x135b72(0xd2)]},..._0xfa716b[_0x135b72(0x121)]!==undefined&&{'schedule':_0xfa716b[_0x135b72(0x121)]},..._0xfa716b[_0x135b72(0x101)]!==undefined&&{'notification':_0xfa716b[_0x135b72(0x101)]},..._0xfa716b['connector_config']!==undefined&&{'connector_config':_0xfa716b[_0x135b72(0x12e)]},..._0xfa716b[_0x135b72(0x112)]!==undefined&&{'activation_template_id':_0xfa716b[_0x135b72(0x112)]}};return stableStringify(_0x4c7c26);}function a155_0x1494(_0x3bca8c,_0x248c4b){_0x3bca8c=_0x3bca8c-0x77;const _0x383d3a=a155_0x383d();let _0x14942b=_0x383d3a[_0x3bca8c];return _0x14942b;}async function fetchSegment(_0x4f3275,_0x5b148f,_0x541f29,_0x14e6af){const _0x47daf2=a155_0x50aee1,_0xb639e0=_0x14e6af?.[_0x47daf2(0xcb)](_0x2caa68=>_0x2caa68['id']===_0x541f29);if(_0xb639e0)return _0xb639e0;try{return await _0x4f3275[_0x47daf2(0xa7)]['getSegment'](_0x5b148f,_0x541f29);}catch(_0xdd6cfc){logger[_0x47daf2(0xcf)](_0x47daf2(0xbf)+_0x541f29+_0x47daf2(0x99)+_0xdd6cfc);try{return await _0x4f3275[_0x47daf2(0xa7)][_0x47daf2(0x171)](_0x541f29);}catch(_0x2f4273){return logger[_0x47daf2(0xcf)](_0x47daf2(0x126)+_0x541f29+':\x20'+_0x2f4273),null;}}}function recoverSegmentIdsFromPushRecovery(_0x485885,_0x543577,_0x4a6109){const _0x5cc31f=a155_0x50aee1,_0x3a5618=readPushRecovery(_0x485885[_0x5cc31f(0xdb)]);if(_0x3a5618?.[_0x5cc31f(0x15f)]===_0x485885[_0x5cc31f(0xc2)][_0x5cc31f(0xa3)])for(const [_0x1494ff,_0x882791]of Object[_0x5cc31f(0x133)](_0x3a5618['segments'])){const _0x2fe42f=generateDeterministicJourneySegmentName(_0x485885[_0x5cc31f(0xc2)][_0x5cc31f(0xa3)],_0x1494ff);_0x882791['uniqueServerName']===_0x2fe42f&&(_0x543577[_0x5cc31f(0x7d)](_0x1494ff,_0x882791[_0x5cc31f(0x11a)]),_0x4a6109[_0x5cc31f(0x7d)](_0x1494ff,_0x882791['segmentId']));}}async function createOrRecoverEmbeddedSegment(_0x210ebe,_0xfcf7ba,_0x1349f8,_0x1eb141){const _0x248385=a155_0x50aee1;let _0x228aaa;try{_0x228aaa=await _0x210ebe[_0x248385(0xa7)][_0x248385(0x159)]({'name':_0x1349f8[_0x248385(0xf7)],'description':_0x1349f8[_0x248385(0x174)],'journeyId':_0x1349f8['journeyId'],'rule':_0x1eb141(_0x1349f8[_0x248385(0x123)],!![]),'countPopulation':!![],'parentFolderId':_0x1349f8['folderId'],'audienceId':_0x1349f8[_0x248385(0x142)]});}catch(_0xdd8561){const _0x276634=_0xdd8561 instanceof Error&&_0xdd8561[_0x248385(0xce)][_0x248385(0xb9)](_0x248385(0x15a));if(_0x276634){const _0x52a676=readPushRecovery(_0xfcf7ba[_0x248385(0xdb)]),_0x765795=_0x52a676?.[_0x248385(0x15f)]===_0xfcf7ba[_0x248385(0xc2)][_0x248385(0xa3)]?_0x52a676[_0x248385(0x156)][_0x1349f8[_0x248385(0x154)]]:undefined;if(_0x765795?.[_0x248385(0xde)]===_0x1349f8['uniqueSegmentName'])await _0x210ebe[_0x248385(0xa7)][_0x248385(0xa1)](_0x1349f8[_0x248385(0x142)],_0x765795['segmentId'],{'description':_0x1349f8[_0x248385(0x174)],'rule':_0x1eb141(_0x1349f8[_0x248385(0x123)],!![]),'countPopulation':!![]}),_0x228aaa=_0x765795['segmentId'];else throw new SDKError(ErrorCode[_0x248385(0x13a)],_0x248385(0x96)+_0x1349f8[_0x248385(0x154)]+'\x27\x20already\x20exists\x20on\x20server\x20but\x20cannot\x20be\x20found.\x20'+(_0x248385(0x110)+_0xfcf7ba[_0x248385(0xdb)][_0x248385(0x131)](/([^/]+)$/,_0x248385(0x120))+')\x20')+_0x248385(0x10b),_0xdd8561);}else throw _0xdd8561;}return saveSegmentToPushRecovery(_0xfcf7ba[_0x248385(0xdb)],_0xfcf7ba[_0x248385(0xc2)][_0x248385(0xa3)],_0x1349f8['localName'],{'segmentId':_0x228aaa,'uniqueServerName':_0x1349f8[_0x248385(0xf7)],'createdAt':new Date()['toISOString']()}),_0x228aaa;}export async function prepareSegmentFiles(_0x20dcc5,_0x21c2a4,_0x3030bd,_0x16d711,_0x281b7c){const _0x1f1c85=a155_0x50aee1,{activationDefToCreateRequest:_0x49fd86}=await import('./child-segment-yaml.js'),_0x25dd25=[],_0x17191a=new Set();for(const {yamlConfig:_0x4743ee,folderPath:_0x5591ab,sourcePath:_0x13a424}of _0x20dcc5){const _0xb557fe=resolveTDFolderPath(_0x5591ab,_0x16d711,_0x281b7c),_0x7ec1eb=_0xb557fe+':'+_0x4743ee['name'],_0x1c3e9d=_0x21c2a4[_0x1f1c85(0x77)][_0x1f1c85(0x100)](_0x7ec1eb),_0x3928e0=_0x1c3e9d?_0x21c2a4[_0x1f1c85(0x143)][_0x1f1c85(0x100)](_0x1c3e9d['id'])||[]:[];addFoldersToCreate(_0xb557fe,_0x21c2a4[_0x1f1c85(0x150)],_0x17191a);const _0x465243=calculateActivationActions(_0x4743ee[_0x1f1c85(0xe7)]||[],_0x3928e0,_0x21c2a4['idToEmailMap'],_0x21c2a4['connectionIdToNameMap']);for(const _0x193d16 of _0x465243){(_0x193d16[_0x1f1c85(0x102)]===_0x1f1c85(0x87)||_0x193d16[_0x1f1c85(0x102)]===_0x1f1c85(0xd7))&&_0x193d16[_0x1f1c85(0xb4)]&&(_0x193d16['validatedRequest']=await _0x49fd86(_0x193d16[_0x1f1c85(0xb4)],_0x3030bd));}const _0x13e7b5=calculateSegmentDiff(_0x4743ee,_0x1c3e9d,_0x3928e0,_0x21c2a4[_0x1f1c85(0x106)],_0x21c2a4[_0x1f1c85(0x13c)]);_0x25dd25[_0x1f1c85(0x10d)]({'relativePath':_0x4743ee[_0x1f1c85(0xa3)],'absolutePath':_0x13a424,'yamlConfig':_0x4743ee,'folderPath':_0xb557fe,'existingSegment':_0x1c3e9d,'existingActivations':_0x3928e0,'isNew':_0x13e7b5['isNew'],'hasChanges':_0x13e7b5['hasChanges'],'diff':_0x13e7b5[_0x1f1c85(0xc1)],'activationActions':_0x465243});}return{'segmentFiles':_0x25dd25,'foldersToCreate':_0x17191a};}export async function prepareJourneyFiles(_0x5bf83c,_0xdbc9f9,_0x3421af,_0x44a1af){const _0x213e0a=a155_0x50aee1,_0x437500=[],_0x231426=new Set();for(const {yamlConfig:_0x3cbb4f,folderPath:_0x3e8a16,sourcePath:_0x5130fe}of _0x5bf83c){const _0x11ea56=resolveTDFolderPath(_0x3e8a16,_0x3421af,_0x44a1af),_0x398c8e=_0x11ea56+':'+_0x3cbb4f[_0x213e0a(0xa3)],_0x1c3e38=_0xdbc9f9[_0x213e0a(0x168)][_0x213e0a(0x100)](_0x398c8e);let _0x58ab3c,_0x25fd28;if(_0x1c3e38&&_0x1c3e38[_0x213e0a(0xd1)]>0x0){const _0x51bb65=buildLocalExpandedRuleMappings(_0x3cbb4f),{createYamlContext:_0x2af5c3,prefetchJourneySegments:_0x36a382}=createPushYamlContextForBundle(_0xdbc9f9['deps'],_0xdbc9f9['parentId'],_0xdbc9f9[_0x213e0a(0xd9)],_0x51bb65,_0xdbc9f9[_0x213e0a(0x106)],_0xdbc9f9['connectionIdToNameMap'],_0xdbc9f9[_0x213e0a(0xe9)],_0xdbc9f9['journeyById']);await _0x36a382(_0x1c3e38[_0x213e0a(0x136)](_0x24ff93=>_0x24ff93['id']));const _0x4ee2ce=await _0xdbc9f9[_0x213e0a(0xaf)]['journey'][_0x213e0a(0xdd)](_0x1c3e38[0x0][_0x213e0a(0x132)]),_0x45ddca=hasMultipleVersions(_0x3cbb4f),_0x52172f=async _0xd18e22=>{const _0x394b88=_0x213e0a,_0x59af78=_0xdbc9f9[_0x394b88(0xab)]?.[_0x394b88(0x100)](_0xd18e22);if(_0x59af78)return _0x59af78;return _0xdbc9f9[_0x394b88(0x16a)]({'journeyId':_0xd18e22,'journeyName':_0x3cbb4f['name'],'isMultiVersion':_0x1c3e38[_0x394b88(0xd1)]>0x1});};if(_0x45ddca&&_0x1c3e38['length']>0x1){const _0x58ae41=[];for(const _0x322e9f of _0x1c3e38){const _0x5f6e54=_0x322e9f['versionNumber']||0x1;_0xdbc9f9['progress']?.['update'](_0x213e0a(0x165)+_0x3cbb4f[_0x213e0a(0xa3)]+'\x20v'+_0x5f6e54);const _0x149c8f=await _0x52172f(_0x322e9f['id']),_0x36be9a=_0x2af5c3(_0x322e9f['id']),_0x5568dc=await journeyResponseToDef(_0x149c8f,_0x36be9a);_0x58ae41[_0x213e0a(0x10d)]({'item':_0x322e9f,'yaml':_0x5568dc});}const _0x473e98=buildLocalRuleToNameMappingFromJourney(_0x3cbb4f);_0x25fd28=buildMergedJourneyDef(_0x58ae41,_0x473e98,_0x4ee2ce);const _0x63e2b3=Math[_0x213e0a(0x11d)](..._0x58ae41['map'](_0x308d0b=>_0x308d0b[_0x213e0a(0x109)]['versionNumber']||0x0)),_0x3aea8c=_0x1c3e38[_0x213e0a(0xcb)](_0x4f8b92=>(_0x4f8b92['versionNumber']||0x0)===_0x63e2b3);_0x3aea8c&&(_0xdbc9f9[_0x213e0a(0x12a)]?.[_0x213e0a(0xd7)]('Fetching\x20'+_0x3cbb4f[_0x213e0a(0xa3)]+'\x20v'+_0x63e2b3),_0x58ab3c=await _0x52172f(_0x3aea8c['id']));}else{const _0x407e32=_0x1c3e38[_0x1c3e38[_0x213e0a(0xd1)]-0x1];_0xdbc9f9[_0x213e0a(0x12a)]?.[_0x213e0a(0xd7)](_0x213e0a(0x165)+_0x3cbb4f[_0x213e0a(0xa3)]),_0x58ab3c=await _0x52172f(_0x407e32['id']);const _0x505d9d=_0x2af5c3(_0x407e32['id']),_0x4eab5a=await journeyResponseToDef(_0x58ab3c,_0x505d9d),_0xd0c230=buildLocalRuleToNameMappingFromJourney(_0x3cbb4f);_0x25fd28=buildMergedJourneyDef([{'item':_0x407e32,'yaml':_0x4eab5a}],_0xd0c230,_0x4ee2ce);}}addFoldersToCreate(_0x11ea56,_0xdbc9f9[_0x213e0a(0x150)],_0x231426);const _0x496f08=calculateJourneyDiff(_0x3cbb4f,_0x25fd28);_0x437500['push']({'relativePath':_0x3cbb4f[_0x213e0a(0xa3)],'absolutePath':_0x5130fe,'yamlConfig':_0x3cbb4f,'folderPath':_0x11ea56,'existingJourney':_0x58ab3c,'isNew':_0x496f08[_0x213e0a(0xda)],'hasChanges':_0x496f08[_0x213e0a(0x166)],'diff':_0x496f08[_0x213e0a(0xc1)]});}return{'journeyFiles':_0x437500,'foldersToCreate':_0x231426};}export function calculateActivationActions(_0x380762,_0x42d2a9,_0x252b60,_0x43626e){const _0x58c760=a155_0x50aee1,_0x5a7f1f=[],_0x2f62e6=new Map();for(const _0x5d2bf6 of _0x42d2a9){_0x2f62e6[_0x58c760(0x7d)](_0x5d2bf6['name'],_0x5d2bf6);}const _0x3c5455=new Map();for(const _0x3558b2 of _0x380762){_0x3c5455[_0x58c760(0x7d)](_0x3558b2[_0x58c760(0xa3)],_0x3558b2);}for(const _0x5051e1 of _0x380762){const _0x1e1fb5=_0x2f62e6[_0x58c760(0x100)](_0x5051e1[_0x58c760(0xa3)]);if(!_0x1e1fb5)_0x5a7f1f[_0x58c760(0x10d)]({'type':_0x58c760(0x87),'name':_0x5051e1[_0x58c760(0xa3)],'yamlActivation':_0x5051e1});else{const _0x20b055=activationResponseToDef(_0x1e1fb5,_0x252b60,_0x43626e),_0x3e8ae5=a155_0x2b1cb1[_0x58c760(0x130)](_0x20b055),_0x4965eb=a155_0x2b1cb1[_0x58c760(0x130)](_0x5051e1);_0x3e8ae5!==_0x4965eb&&_0x5a7f1f['push']({'type':_0x58c760(0xd7),'name':_0x5051e1[_0x58c760(0xa3)],'yamlActivation':_0x5051e1,'existingActivation':_0x1e1fb5});}}for(const _0x2b2d8c of _0x42d2a9){!_0x3c5455[_0x58c760(0x125)](_0x2b2d8c[_0x58c760(0xa3)])&&_0x5a7f1f['push']({'type':_0x58c760(0x160),'name':_0x2b2d8c[_0x58c760(0xa3)],'existingActivation':_0x2b2d8c});}return _0x5a7f1f;}function calculateYamlDiff(_0x44b5db,_0x5970a2){if(_0x5970a2){const _0x44d127=generateDiff(_0x5970a2,_0x44b5db),_0x231f8b=hasChanges(_0x44d127);return{'isNew':![],'hasChanges':_0x231f8b,'diff':_0x231f8b?formatDiffWithColors(_0x44d127):undefined};}const _0x5e30d6=generateDiff('',_0x44b5db);return{'isNew':!![],'hasChanges':![],'diff':formatDiffWithColors(_0x5e30d6)};}export function calculateSegmentDiff(_0x4937bf,_0x2c72fe,_0x10a89c,_0x44afc0,_0x34853d){const _0x4051a6=segmentToYamlString(_0x4937bf),_0x269e46=_0x2c72fe?segmentToYamlString(segmentWithActivationsToYaml(_0x2c72fe,_0x10a89c,undefined,_0x44afc0,_0x34853d)):undefined;return calculateYamlDiff(_0x4051a6,_0x269e46);}export function calculateJourneyDiff(_0x1ee8e6,_0x3797eb){const _0x655024=normalizeJourneyDef(_0x1ee8e6,_0x1ee8e6),_0x522a7a=a155_0x359912(_0x655024),_0x3373c9=_0x3797eb?a155_0x359912(normalizeJourneyDef(_0x3797eb,_0x1ee8e6)):undefined;return calculateYamlDiff(_0x522a7a,_0x3373c9);}export function findSegmentsToDelete(_0xbaca7d,_0x24a21b,_0x46bb9a,_0x178e75,_0x4fcbd6){const _0x373e17=a155_0x50aee1,_0x4850f8=new Set();for(const {yamlConfig:_0x273e03,folderPath:_0x533db7}of _0x24a21b){_0x4850f8[_0x373e17(0x167)](_0x533db7+':'+_0x273e03[_0x373e17(0xa3)]);}return _0xbaca7d[_0x373e17(0x15e)](_0x516c30=>{const _0x259dd3=_0x373e17,_0x3dcf55=_0x516c30[_0x259dd3(0x8e)]?_0x46bb9a[_0x259dd3(0x100)](_0x516c30[_0x259dd3(0x8e)][_0x259dd3(0xc9)]())||'':'',_0x4cbbf8=_0x3dcf55+':'+_0x516c30[_0x259dd3(0xa3)];if(_0x4850f8['has'](_0x4cbbf8))return![];if(_0x4fcbd6)return _0x3dcf55===_0x178e75||_0x3dcf55[_0x259dd3(0x146)](_0x178e75+'/');return!![];});}export function findJourneysToDelete(_0xeb6a0e,_0x1db81d,_0x3e4412,_0x593255,_0x909eb9){const _0x4cb2b8=a155_0x50aee1,_0x2ffcbb=new Set();for(const {yamlConfig:_0x88cefe,folderPath:_0x4319a1}of _0x1db81d){_0x2ffcbb[_0x4cb2b8(0x167)](_0x4319a1+':'+_0x88cefe[_0x4cb2b8(0xa3)]);}return _0xeb6a0e[_0x4cb2b8(0x15e)](_0x20ab50=>{const _0x446c5d=_0x4cb2b8,_0x11786c=_0x20ab50[_0x446c5d(0x148)]?_0x3e4412[_0x446c5d(0x100)](_0x20ab50[_0x446c5d(0x148)])||'':'',_0x3ad103=_0x11786c+':'+_0x20ab50['journeyBundleName'];if(_0x2ffcbb['has'](_0x3ad103))return![];if(_0x909eb9)return _0x11786c===_0x593255||_0x11786c[_0x446c5d(0x146)](_0x593255+'/');return!![];});}export function buildSegmentLookupMap(_0x5ae78a,_0x417084){const _0x255537=a155_0x50aee1,_0x1e2b37=new Map();for(const _0x515a9 of _0x5ae78a){const _0x128914=_0x515a9[_0x255537(0x8e)]?_0x417084['get'](_0x515a9[_0x255537(0x8e)][_0x255537(0xc9)]())||'':'',_0x482a0e=_0x128914+':'+_0x515a9[_0x255537(0xa3)];_0x1e2b37['set'](_0x482a0e,_0x515a9);}return _0x1e2b37;}export function buildSegmentNameToIdMap(_0x1314ac){const _0x2e5c04=a155_0x50aee1,_0x370602=new Map();for(const _0x129f1b of _0x1314ac){_0x370602[_0x2e5c04(0x7d)](_0x129f1b[_0x2e5c04(0xa3)],_0x129f1b['id']);}return _0x370602;}export function buildJourneyBundleLookupMap(_0x4f1d15,_0x35656d){const _0x5183e4=a155_0x50aee1,_0x172424=new Map();for(const _0x7a877a of _0x4f1d15){const _0x2eec36=_0x7a877a[_0x5183e4(0x148)]?_0x35656d[_0x5183e4(0x100)](_0x7a877a[_0x5183e4(0x148)])||'':'',_0x5d2f5b=_0x2eec36+':'+_0x7a877a['journeyBundleName'];!_0x172424[_0x5183e4(0x125)](_0x5d2f5b)&&_0x172424[_0x5183e4(0x7d)](_0x5d2f5b,[]),_0x172424[_0x5183e4(0x100)](_0x5d2f5b)[_0x5183e4(0x10d)](_0x7a877a);}for(const _0x3e80a5 of _0x172424[_0x5183e4(0x180)]()){_0x3e80a5[_0x5183e4(0xc4)]((_0x5571b6,_0x4c4b9d)=>(_0x5571b6[_0x5183e4(0x13e)]||0x0)-(_0x4c4b9d['versionNumber']||0x0));}return _0x172424;}export function collectFoldersToCreate(_0x4bc4fe,_0x4c2330){const _0x35555b=a155_0x50aee1,_0x18bed1=new Set();for(const _0xf2933b of _0x4bc4fe){if(!_0xf2933b)continue;if(_0x4c2330['has'](_0xf2933b))continue;const _0xf2237e=_0xf2933b[_0x35555b(0x11f)]('/');let _0x51ea3d='';for(const _0x16a032 of _0xf2237e){_0x51ea3d=_0x51ea3d?_0x51ea3d+'/'+_0x16a032:_0x16a032,!_0x4c2330[_0x35555b(0x125)](_0x51ea3d)&&_0x18bed1[_0x35555b(0x167)](_0x51ea3d);}}return _0x18bed1;}export function parseAndClassifyYamlFiles(_0x3c502c,_0x4ebac6,_0x29e1fa){const _0x5ed937=a155_0x50aee1,_0x18532d=[],_0x37ef07=[];for(const _0x46a073 of _0x3c502c){const _0x13f20b=a155_0x156b1f[_0x5ed937(0x149)](_0x4ebac6,a155_0x156b1f[_0x5ed937(0x169)](_0x46a073)),_0x27ca91=_0x13f20b==='.'?'':_0x13f20b['replace'](/\\/g,'/'),_0x187e93=readFileSync(_0x46a073,_0x5ed937(0x161)),_0x40291e=a155_0x2b1cb1[_0x5ed937(0xba)](_0x187e93);if(isJourneyDef(_0x40291e)){const _0x44425a=a155_0x41b119(_0x187e93);_0x37ef07[_0x5ed937(0x10d)]({'yamlConfig':_0x44425a,'folderPath':_0x27ca91,'sourcePath':_0x46a073});}else{if(!_0x29e1fa?.['skipSegments']){const _0x114d5c=parseSegmentYamlFile(_0x187e93),_0x1c0532=normalizeChildSegmentYaml(_0x114d5c);_0x18532d[_0x5ed937(0x10d)]({'yamlConfig':_0x1c0532,'folderPath':_0x27ca91,'sourcePath':_0x46a073});}}}return{'segments':_0x18532d,'journeys':_0x37ef07};}export function validateParsedFiles(_0x4dc75c,_0x1bf8b6){const _0x43003c=a155_0x50aee1,_0x511215=[];for(const {yamlConfig:_0x5686c0,sourcePath:_0x3d81b3}of _0x4dc75c[_0x43003c(0x156)]){const _0x47f214=readFileSync(_0x3d81b3,_0x43003c(0x161)),_0x27c33f=a155_0x2b1cb1[_0x43003c(0x122)](_0x47f214),_0x1c8278=validateSegmentDef(_0x5686c0,{'source':_0x47f214,'document':_0x27c33f},{'skipSchema':!![]});if(!_0x1c8278[_0x43003c(0x97)]){const _0x2bad7e=a155_0x156b1f[_0x43003c(0x149)](_0x1bf8b6,_0x3d81b3);_0x511215[_0x43003c(0x10d)]({'filePath':_0x2bad7e,'source':_0x47f214,'result':_0x1c8278,'isJourney':![]});}}for(const {yamlConfig:_0x2eb122,sourcePath:_0x1d0a66}of _0x4dc75c['journeys']){const _0x1bb9db=readFileSync(_0x1d0a66,_0x43003c(0x161)),_0xcfd8b4=a155_0x2b1cb1[_0x43003c(0x122)](_0x1bb9db),_0x34aabd=validateJourneyDef(_0x2eb122,{'source':_0x1bb9db,'document':_0xcfd8b4},{'skipSchema':!![]});if(!_0x34aabd[_0x43003c(0x97)]){const _0x25aac4=a155_0x156b1f['relative'](_0x1bf8b6,_0x1d0a66);_0x511215[_0x43003c(0x10d)]({'filePath':_0x25aac4,'source':_0x1bb9db,'result':_0x34aabd,'isJourney':!![]});}}return _0x511215;}export function formatValidationErrors(_0x1262b8){const _0x3f2c1f=a155_0x50aee1,_0x147970=[];for(const {filePath:_0x5d3241,source:_0x249772,result:_0x858520,isJourney:_0xc2cd4f}of _0x1262b8){const _0x31177c=_0xc2cd4f?_0x3f2c1f(0x84):'segment';_0x147970[_0x3f2c1f(0x10d)]('\x0a'+_0x5d3241+'\x20('+_0x31177c+'):\x20'+_0x858520[_0x3f2c1f(0xb3)][_0x3f2c1f(0xd1)]+'\x20error(s)'),_0x147970[_0x3f2c1f(0x10d)](formatValidationResult(_0x858520,_0x249772,_0x5d3241));}return _0x147970[_0x3f2c1f(0xb6)]('\x0a');}export function buildLocalExpandedRuleMappings(_0x43027f){const _0x248d97=a155_0x50aee1,_0xfb019c=new Set(),_0x3ae564=new Map(),_0x511f0b=collectSegmentUsageCounts(_0x43027f);if(_0x43027f[_0x248d97(0x156)])for(const [_0x55e8a7,_0x54194c]of Object[_0x248d97(0x133)](_0x43027f[_0x248d97(0x156)])){_0xfb019c[_0x248d97(0x167)](_0x55e8a7);if(_0x54194c[_0x248d97(0xfe)]){const _0xb3ccf7=yamlRuleToApi(_0x54194c[_0x248d97(0xfe)]),_0x4477a4=apiRuleToYaml(_0xb3ccf7);_0x3ae564[_0x248d97(0x7d)](_0x55e8a7,_0x4477a4);}}const _0x22ca13=new Map();let _0x2b0048=0x0;for(const [_0x54ba10,_0x2d691a]of _0x3ae564){const _0x317ee0=serializeExpandedRule(_0x2d691a,_0x3ae564),_0x34c350=_0x22ca13[_0x248d97(0x100)](_0x317ee0)||[];_0x34c350[_0x248d97(0x10d)]({'name':_0x54ba10,'index':_0x2b0048}),_0x22ca13[_0x248d97(0x7d)](_0x317ee0,_0x34c350),_0x2b0048++;}const _0x3f302d=new Map();for(const [_0x468d1c,_0x405352]of _0x22ca13){const _0x7ddafb=_0x405352['slice']()[_0x248d97(0xc4)]((_0x59aee5,_0x159b26)=>{const _0x34c6b7=_0x248d97,_0xc11e7a=_0x511f0b[_0x34c6b7(0x100)](_0x59aee5['name'])||0x0,_0x18e616=_0x511f0b[_0x34c6b7(0x100)](_0x159b26['name'])||0x0;if(_0xc11e7a!==_0x18e616)return _0x18e616-_0xc11e7a;return _0x59aee5[_0x34c6b7(0x124)]-_0x159b26[_0x34c6b7(0x124)];})[_0x248d97(0x136)](_0x3fc4f4=>_0x3fc4f4[_0x248d97(0xa3)]),_0x186f38=[];for(const _0x5550fb of _0x7ddafb){const _0x48c578=_0x511f0b[_0x248d97(0x100)](_0x5550fb)||0x0,_0x250f2e=Math['max'](_0x48c578,0x1);for(let _0x449294=0x0;_0x449294<_0x250f2e;_0x449294++){_0x186f38['push'](_0x5550fb);}}_0x3f302d[_0x248d97(0x7d)](_0x468d1c,_0x186f38);}return{'existingLocalSegmentNames':_0xfb019c,'localSegmentRules':_0x3ae564,'localExpandedRuleToNames':_0x3f302d};}export function createSegmentIdResolver(_0x59b06a,_0x3aee7b){return async _0x532100=>{const _0x52e4e2=a155_0x1494,_0x3bbbc8=_0x59b06a[_0x52e4e2(0x100)](_0x532100);if(!_0x3bbbc8)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x52e4e2(0xff)+_0x532100+_0x52e4e2(0x80)+_0x3aee7b+'\x27)');return _0x3bbbc8;};}export function extractRootFolderId(_0x35dee5){const _0x10797c=a155_0x50aee1;return _0x35dee5[_0x10797c(0xc7)]?.['parentSegmentFolder']?.[_0x10797c(0xb7)]?.['id']||_0x35dee5[_0x10797c(0xc7)]?.[_0x10797c(0x89)]?.[_0x10797c(0xb7)]?.['id'];}export function buildConnectionMaps(_0x4f38bf){const _0x55bcd3=a155_0x50aee1,_0x120911=new Map(),_0x18b56d=new Map(),_0x105561=new Map();for(const _0x1bbb89 of _0x4f38bf){_0x120911[_0x55bcd3(0x7d)](_0x1bbb89['name'],parseInt(_0x1bbb89['id'],0xa)),_0x18b56d[_0x55bcd3(0x7d)](_0x1bbb89['id'],_0x1bbb89[_0x55bcd3(0xa3)]),_0x105561[_0x55bcd3(0x7d)](_0x1bbb89[_0x55bcd3(0xa3)],_0x1bbb89[_0x55bcd3(0x102)]);}return{'nameToId':_0x120911,'idToName':_0x18b56d,'nameToType':_0x105561};}export function calculatePushStats(_0x1710b8,_0x58a952,_0x3644ad,_0x124830,_0x597ad4,_0xa0d640,_0x1e947e){const _0x37c555=a155_0x50aee1,_0x11ee02=_0x1710b8[_0x37c555(0x15e)](_0x22d112=>_0x22d112['isNew']),_0x226177=_0x1710b8[_0x37c555(0x15e)](_0x34d17a=>!_0x34d17a[_0x37c555(0xda)]&&_0x34d17a[_0x37c555(0x166)]),_0x153752=_0x1710b8[_0x37c555(0x15e)](_0x51e60b=>!_0x51e60b['isNew']&&!_0x51e60b[_0x37c555(0x166)]),_0x19a49e=_0xa0d640?_0x124830:[],_0x538cae=_0x58a952[_0x37c555(0x15e)](_0x14c5e6=>_0x14c5e6[_0x37c555(0xda)]),_0x487ad3=_0x58a952[_0x37c555(0x15e)](_0x50b4a3=>!_0x50b4a3[_0x37c555(0xda)]&&_0x50b4a3[_0x37c555(0x166)]),_0x3428bf=_0x58a952[_0x37c555(0x15e)](_0x49dbb7=>!_0x49dbb7[_0x37c555(0xda)]&&!_0x49dbb7[_0x37c555(0x166)]),_0x3354ee=_0xa0d640?_0x597ad4:[],_0x5e9e5e=_0x1710b8[_0x37c555(0x79)](_0x26a59a=>_0x26a59a[_0x37c555(0x90)]),_0x2623c1=_0x5e9e5e['filter'](_0x21c6f2=>_0x21c6f2[_0x37c555(0x102)]===_0x37c555(0x87)),_0x1dbb05=_0x5e9e5e['filter'](_0x176c15=>_0x176c15[_0x37c555(0x102)]===_0x37c555(0xd7)),_0x37aa1a=_0x5e9e5e[_0x37c555(0x15e)](_0x515c25=>_0x515c25[_0x37c555(0x102)]==='delete'),_0x22873d=Array[_0x37c555(0x164)](_0x3644ad)[_0x37c555(0xc4)](),_0x4213d3=_0x1e947e?![]:_0x11ee02[_0x37c555(0xd1)]>0x0||_0x226177[_0x37c555(0xd1)]>0x0||_0x19a49e[_0x37c555(0xd1)]>0x0,_0x496e85=_0x538cae[_0x37c555(0xd1)]>0x0||_0x487ad3[_0x37c555(0xd1)]>0x0||_0x3354ee['length']>0x0,_0x72d108=_0x1e947e?![]:_0x5e9e5e[_0x37c555(0xd1)]>0x0,_0x2d0d57=_0x22873d['length']>0x0;return{'segments':{'new':_0x11ee02,'changed':_0x226177,'unchanged':_0x153752,'toDelete':_0x19a49e},'journeys':{'new':_0x538cae,'changed':_0x487ad3,'unchanged':_0x3428bf,'toDelete':_0x3354ee},'activations':{'all':_0x5e9e5e,'toCreate':_0x2623c1,'toUpdate':_0x1dbb05,'toDelete':_0x37aa1a},'folders':{'toCreate':_0x22873d},'counts':{'segments':{'new':_0x11ee02[_0x37c555(0xd1)],'changed':_0x226177['length'],'unchanged':_0x153752['length'],'toDelete':_0x19a49e['length']},'journeys':{'new':_0x538cae['length'],'changed':_0x487ad3[_0x37c555(0xd1)],'unchanged':_0x3428bf[_0x37c555(0xd1)],'toDelete':_0x3354ee[_0x37c555(0xd1)]},'activations':{'create':_0x2623c1[_0x37c555(0xd1)],'update':_0x1dbb05[_0x37c555(0xd1)],'delete':_0x37aa1a[_0x37c555(0xd1)]},'folders':_0x22873d['length']},'hasChanges':_0x4213d3||_0x496e85||_0x72d108||_0x2d0d57};}export async function buildPushExecutionContext(_0x6987cf,_0x327217,_0x3bada9,_0x5c8051,_0x2392d8,_0x31c7f5){const _0x153646=a155_0x50aee1,_0x1ec90e=extractRootFolderId(_0x3bada9),{pathToId:_0x3e8722,idToPath:_0x51f191}=buildFolderMaps(_0x2392d8),_0x48976a=buildSegmentNameToIdMap(_0x5c8051),_0x15048d=new Map(),{batchAsync:_0x642942}=await import(_0x153646(0xcd)),[_0x5c2123,_0x443e44]=await Promise[_0x153646(0xe1)]([_0x6987cf['user']['buildUserMaps'](),_0x6987cf[_0x153646(0x12c)][_0x153646(0x119)](),((async()=>{!_0x31c7f5&&_0x5c8051['length']>0x0&&await _0x642942(_0x5c8051,async _0x57a782=>{const _0x149c5=a155_0x1494,_0x4aacd2=await _0x6987cf[_0x149c5(0xa7)][_0x149c5(0x12b)](_0x327217,_0x57a782['id']);_0x15048d[_0x149c5(0x7d)](_0x57a782['id'],_0x4aacd2);});})())]),{emailToId:_0x16d2b9,idToEmail:_0x1fa136}=_0x5c2123,_0x265d3d=buildConnectionMaps(_0x443e44);return{'rootFolderId':_0x1ec90e,'folderPathToId':_0x3e8722,'folderIdToPath':_0x51f191,'segmentNameToId':_0x48976a,'activationsBySegmentId':_0x15048d,'emailToIdMap':_0x16d2b9,'idToEmailMap':_0x1fa136,'connectionNameToIdMap':_0x265d3d[_0x153646(0x15c)],'connectionIdToNameMap':_0x265d3d[_0x153646(0x153)],'connectionNameToTypeMap':_0x265d3d[_0x153646(0xd4)]};}export function createPushYamlContextForBundle(_0x39bcd1,_0xc13b73,_0x388341,_0x5db2e0,_0x4e6380,_0x4a09b1,_0x2a4a27,_0x279939){const {existingLocalSegmentNames:_0x45af1b,localExpandedRuleToNames:_0x17fe00}=_0x5db2e0,_0x351acc=new Set(),_0xc25a17=new Map(),_0x4f4a12=new Map(),_0x50d26e=new Map(),_0x56ae6e=createJumpTargetCache(),_0x1f5097=new Map(),_0x33c6be=new Map(),_0x61640d=new Set();let _0x32b8db;const _0x56963f=_0x81ec25=>{const _0x25b67d={'resolveSegment':async _0x38f794=>{const _0x5a292b=a155_0x1494,_0x335032=_0x50d26e[_0x5a292b(0x100)](_0x38f794);if(_0x335032!==undefined)return{'name':_0x335032,'isJourneyLocal':!![]};try{const _0x84163e=await fetchSegment(_0x39bcd1,_0xc13b73,_0x38f794,_0x388341);if(!_0x84163e)throw new Error(_0x5a292b(0x13d));const _0x4c521f=generateJourneyLocalName(_0x84163e[_0x5a292b(0xa3)]),_0x4a0a4a=_0x84163e['kind']===SEGMENT_KIND_JOURNEY&&_0x4c521f!==undefined;let _0x23e37c=_0x84163e[_0x5a292b(0xa3)],_0x30c55c;if(_0x4a0a4a&&_0x84163e[_0x5a292b(0xfe)]){const _0x36e33c=apiRuleToYaml(_0x84163e[_0x5a292b(0xfe)]);_0x33c6be[_0x5a292b(0x7d)](_0x38f794,_0x36e33c);const _0x570adb=async _0x3caea3=>{const _0x50a85a=_0x5a292b,_0x1dac4c=collectSegmentRefsFromRule(_0x3caea3);for(const _0xf7c6e6 of _0x1dac4c){if(!_0x33c6be[_0x50a85a(0x125)](_0xf7c6e6))try{const _0x5b2e5f=await fetchSegment(_0x39bcd1,_0xc13b73,_0xf7c6e6,_0x388341);if(_0x5b2e5f?.['rule']){const _0x4adcc1=apiRuleToYaml(_0x5b2e5f[_0x50a85a(0xfe)]);_0x33c6be[_0x50a85a(0x7d)](_0xf7c6e6,_0x4adcc1),await _0x570adb(_0x4adcc1);}}catch(_0x5b09a6){logger[_0x50a85a(0xcf)](_0x50a85a(0x9d)+_0xf7c6e6+':\x20'+_0x5b09a6);}}};await _0x570adb(_0x36e33c);const _0x5eb151=serializeExpandedRule(_0x36e33c,_0x33c6be),_0x2ca7e4=_0x17fe00[_0x5a292b(0x100)](_0x5eb151);if(_0x2ca7e4&&_0x2ca7e4[_0x5a292b(0xd1)]>0x0){const _0x1ccb5c=_0xc25a17['get'](_0x5eb151)||0x0,_0xca6fec=_0x2ca7e4[_0x1ccb5c]||_0x2ca7e4[_0x2ca7e4[_0x5a292b(0xd1)]-0x1];_0xc25a17[_0x5a292b(0x7d)](_0x5eb151,_0x1ccb5c+0x1),_0x23e37c=_0xca6fec,_0x351acc[_0x5a292b(0x167)](_0x23e37c),_0x50d26e[_0x5a292b(0x7d)](_0x38f794,_0x23e37c);const _0x125dd3=await resolveRuleSegmentRefs(_0x36e33c,async _0x5b5c2c=>{const _0x5d3531=_0x5a292b,_0x5175dc=_0x50d26e[_0x5d3531(0x100)](_0x5b5c2c);if(_0x5175dc)return _0x5175dc;const _0x8b80d0=await _0x32b8db[_0x5d3531(0x17e)](_0x5b5c2c);return _0x8b80d0[_0x5d3531(0xa3)];});_0x30c55c={'description':_0x84163e[_0x5a292b(0x174)],'rule':_0x125dd3};}else{const _0x57e02e=_0x1f5097['get'](_0x5eb151);if(_0x57e02e)_0x23e37c=_0x57e02e,_0x50d26e[_0x5a292b(0x7d)](_0x38f794,_0x23e37c);else{if(_0x4c521f){let _0x3bc99b=_0x4c521f,_0x36ec99=0x2;while(_0x351acc['has'](_0x3bc99b)||_0x45af1b['has'](_0x3bc99b)){_0x3bc99b=_0x4c521f+'_'+_0x36ec99,_0x36ec99++;}_0x351acc[_0x5a292b(0x167)](_0x3bc99b),_0x23e37c=_0x3bc99b;}_0x50d26e[_0x5a292b(0x7d)](_0x38f794,_0x23e37c),_0x1f5097[_0x5a292b(0x7d)](_0x5eb151,_0x23e37c);const _0x2771fe=await resolveRuleSegmentRefs(_0x36e33c,async _0xfe1871=>{const _0x35cebb=_0x5a292b,_0x11cafb=_0x50d26e[_0x35cebb(0x100)](_0xfe1871);if(_0x11cafb)return _0x11cafb;const _0x4c572b=await _0x32b8db[_0x35cebb(0x17e)](_0xfe1871);return _0x4c572b[_0x35cebb(0xa3)];});_0x30c55c={'description':_0x84163e[_0x5a292b(0x174)],'rule':_0x2771fe};}}}return{'name':_0x23e37c,'isJourneyLocal':_0x4a0a4a,'definition':_0x30c55c};}catch(_0x34389d){return logger[_0x5a292b(0xcf)](_0x5a292b(0xec)+_0x38f794+':\x20'+_0x34389d),{'name':_0x38f794,'isJourneyLocal':![]};}},'resolveActivation':async _0x588962=>{const _0x46ab04=a155_0x1494,_0x3e4282=_0x4f4a12[_0x46ab04(0x100)](_0x588962);if(_0x3e4282!==undefined)return{'name':_0x3e4282,'isJourneyLocal':!![]};try{let _0x167dd8=_0x2a4a27?.[_0x46ab04(0x100)](_0x588962);!_0x167dd8&&(_0x167dd8=await _0x39bcd1['journey'][_0x46ab04(0x17d)](_0x81ec25,_0x588962));const _0x6b0cd=_0x167dd8[_0x46ab04(0x108)][_0x46ab04(0x17c)]['name']||_0x588962,_0x32266d=sanitizeYamlKey(_0x6b0cd)||_0x46ab04(0xa0)+_0x588962,_0x1e119f=_0x32266d;_0x4f4a12[_0x46ab04(0x7d)](_0x588962,_0x1e119f);const _0x41f506=journeyActivationStepToYaml(_0x167dd8,_0x4e6380,_0x4a09b1);return{'name':_0x1e119f,'isJourneyLocal':!![],'definition':_0x41f506};}catch(_0x57e7d2){return logger[_0x46ab04(0xcf)](_0x46ab04(0x13f)+_0x588962+':\x20'+_0x57e7d2),{'name':_0x588962,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x54a17d,_0x1f6b7d)=>resolveJumpTarget(_0x54a17d,_0x1f6b7d,_0x56ae6e,async _0x47f1bc=>{const _0x3c03c0=a155_0x1494,_0x30be09=_0x279939?.[_0x3c03c0(0x100)](_0x47f1bc);if(_0x30be09)return _0x30be09;return _0x39bcd1['journey'][_0x3c03c0(0xd8)](_0x47f1bc);})};return _0x32b8db=_0x25b67d,_0x25b67d;},_0x3f4ea1=async _0xee3b88=>{const _0x5916d4=a155_0x1494,{collectSegmentIdsFromJourneyApi:_0x30867a}=await import(_0x5916d4(0xa5)),{batchAsync:_0x2071b5}=await import('../../utils/async.js'),_0x5ea57b=new Set();for(const _0x27e892 of _0xee3b88){let _0x562fe6=_0x279939?.[_0x5916d4(0x100)](_0x27e892);!_0x562fe6&&(_0x562fe6=await _0x39bcd1[_0x5916d4(0x84)][_0x5916d4(0xd8)](_0x27e892));const _0x47e9b7=_0x30867a(_0x562fe6);for(const _0x54953b of _0x47e9b7){_0x5ea57b[_0x5916d4(0x167)](_0x54953b);}}let _0x1c1722=Array[_0x5916d4(0x164)](_0x5ea57b);while(_0x1c1722['length']>0x0){const _0x401b3a=_0x1c1722[_0x5916d4(0x15e)](_0x4bb9fa=>!_0x61640d[_0x5916d4(0x125)](_0x4bb9fa));if(_0x401b3a['length']===0x0)break;const _0x2151bd=await _0x2071b5(_0x401b3a,async _0x3ecba9=>{const _0x2e8bc2=_0x5916d4;_0x61640d[_0x2e8bc2(0x167)](_0x3ecba9);const _0x5ea434=await fetchSegment(_0x39bcd1,_0xc13b73,_0x3ecba9,_0x388341);if(!_0x5ea434)return null;return{'segmentId':_0x3ecba9,'segment':_0x5ea434};},0xa),_0x564370=new Set();for(const _0x15efe7 of _0x2151bd){if(!_0x15efe7?.[_0x5916d4(0xa7)]?.[_0x5916d4(0xfe)])continue;const _0x11e207=apiRuleToYaml(_0x15efe7[_0x5916d4(0xa7)][_0x5916d4(0xfe)]);_0x33c6be[_0x5916d4(0x7d)](_0x15efe7[_0x5916d4(0x11a)],_0x11e207);const _0x2ff607=collectSegmentRefsFromRule(_0x11e207);for(const _0x2162ed of _0x2ff607){!_0x61640d['has'](_0x2162ed)&&_0x564370[_0x5916d4(0x167)](_0x2162ed);}}_0x1c1722=Array[_0x5916d4(0x164)](_0x564370);}};return{'createYamlContext':_0x56963f,'prefetchJourneySegments':_0x3f4ea1};}export async function executePushSegments(_0x49bb7d,_0x1237ef,_0x210b07,_0x44b4b2,_0x5cb7ed){const _0x2d9f96=a155_0x50aee1,{segmentDefToCreateRequest:_0x47365e,segmentDefToUpdateRequest:_0x519f9d}=await import(_0x2d9f96(0xe8)),_0x33daa2=_0x210b07[_0x2d9f96(0x150)],_0x57696e=0x5,_0x2f9b5b=async _0x572e3e=>{const _0x2d8c35=_0x2d9f96,_0x3b61fd=_0x572e3e[_0x2d8c35(0xc6)]?_0x33daa2[_0x2d8c35(0x100)](_0x572e3e['folderPath']):undefined;let _0x5c83e4;const _0x55728d={'created':0x0,'updated':0x0,'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};let _0x2c268e=_0x572e3e[_0x2d8c35(0xc2)];if(_0x572e3e[_0x2d8c35(0xc2)]['rule']){const _0x4903bb=createSegmentIdResolver(_0x210b07['segmentNameToId'],_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]),_0x4ea86c=await resolveRuleSegmentIds(_0x572e3e[_0x2d8c35(0xc2)]['rule'],_0x4903bb);_0x2c268e={..._0x572e3e['yamlConfig'],'rule':_0x4ea86c};}try{if(_0x572e3e[_0x2d8c35(0xda)]){_0x5cb7ed['onProgress']?.({'type':_0x2d8c35(0x105),'name':_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]});const _0x1b07a4=_0x47365e(_0x2c268e,_0x3b61fd),_0xdfc9e9=await _0x5cb7ed['withProgress']('Creating\x20segment\x20\x27'+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+_0x2d8c35(0x7c),()=>_0x49bb7d[_0x2d8c35(0xa7)]['createSegment'](_0x44b4b2[_0x2d8c35(0x142)],_0x1b07a4));_0x5c83e4=_0xdfc9e9[_0x2d8c35(0xb7)]['id'],_0x210b07['segmentNameToId'][_0x2d8c35(0x7d)](_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)],_0x5c83e4),_0x55728d[_0x2d8c35(0x10f)]={'name':_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)],'id':_0x5c83e4},_0x5cb7ed['onProgress']?.({'type':_0x2d8c35(0x82),'name':_0x572e3e['yamlConfig']['name'],'segmentId':_0x5c83e4}),_0x5cb7ed[_0x2d8c35(0xb8)]?.(_0x2d8c35(0x140)+_0x572e3e[_0x2d8c35(0xc2)]['name']+'\x27'),_0x55728d[_0x2d8c35(0x16e)]=0x1;}else{if(_0x572e3e['hasChanges']){_0x5cb7ed[_0x2d8c35(0x9c)]?.({'type':_0x2d8c35(0x17b),'name':_0x572e3e[_0x2d8c35(0xc2)]['name']});const _0x4e8b26=_0x519f9d(_0x2c268e);_0x3b61fd!==_0x572e3e[_0x2d8c35(0xaa)]?.[_0x2d8c35(0x8e)]&&(_0x4e8b26[_0x2d8c35(0x8e)]=_0x3b61fd?parseInt(_0x3b61fd,0xa):undefined),await _0x5cb7ed['withProgress'](_0x2d8c35(0xc8)+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+_0x2d8c35(0x7c),()=>_0x49bb7d[_0x2d8c35(0xa7)][_0x2d8c35(0xa1)](_0x44b4b2[_0x2d8c35(0x142)],_0x572e3e[_0x2d8c35(0xaa)]['id'],_0x4e8b26)),_0x5c83e4=_0x572e3e[_0x2d8c35(0xaa)]['id'],_0x5cb7ed[_0x2d8c35(0x9c)]?.({'type':_0x2d8c35(0xc3),'name':_0x572e3e['yamlConfig']['name']}),_0x5cb7ed[_0x2d8c35(0xb8)]?.(_0x2d8c35(0x10e)+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+'\x27'),_0x55728d[_0x2d8c35(0x139)]=0x1;}else _0x5c83e4=_0x572e3e[_0x2d8c35(0xaa)]['id'];}}catch(_0x18f10b){const _0x3c10bd=isHttp400Error(_0x18f10b),_0x2eed67=_0x3c10bd?ErrorCode[_0x2d8c35(0x155)]:ErrorCode[_0x2d8c35(0x13a)],_0x1eaa9a=getErrorMessage(_0x18f10b);throw new SDKError(_0x2eed67,_0x2d8c35(0x114)+(_0x572e3e[_0x2d8c35(0xda)]?_0x2d8c35(0x87):_0x2d8c35(0xd7))+'\x20segment\x20from\x20file:\x20'+_0x572e3e[_0x2d8c35(0xdb)]+'\x0a\x20\x20'+_0x1eaa9a,_0x18f10b);}try{const _0x3beeac=await syncActivationsForSegment(_0x49bb7d,_0x44b4b2['parentId'],_0x5c83e4,_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)],_0x572e3e[_0x2d8c35(0x90)],_0x5cb7ed,_0x572e3e[_0x2d8c35(0xdb)]);_0x55728d[_0x2d8c35(0xe7)]=_0x3beeac;}catch(_0x115a89){if(_0x115a89 instanceof SDKError)throw _0x115a89;throw new SDKError(ErrorCode[_0x2d8c35(0xf5)],_0x2d8c35(0xfd)+_0x572e3e[_0x2d8c35(0xc2)][_0x2d8c35(0xa3)]+_0x2d8c35(0x10a)+_0x572e3e[_0x2d8c35(0xdb)]+_0x2d8c35(0x13b)+getErrorMessage(_0x115a89),_0x115a89);}return _0x55728d;},_0x5c8126=await batchAsync(_0x1237ef,_0x2f9b5b,_0x57696e),_0x48d36c={'created':0x0,'updated':0x0,'deleted':0x0,'createdSegmentIds':new Map(),'activations':{'created':0x0,'updated':0x0,'deleted':0x0}};for(const _0x2ee420 of _0x5c8126){_0x48d36c['created']+=_0x2ee420[_0x2d9f96(0x16e)],_0x48d36c['updated']+=_0x2ee420['updated'],_0x2ee420[_0x2d9f96(0x10f)]&&_0x48d36c[_0x2d9f96(0xbb)][_0x2d9f96(0x7d)](_0x2ee420[_0x2d9f96(0x10f)][_0x2d9f96(0xa3)],_0x2ee420[_0x2d9f96(0x10f)]['id']),_0x48d36c[_0x2d9f96(0xe7)][_0x2d9f96(0x16e)]+=_0x2ee420[_0x2d9f96(0xe7)][_0x2d9f96(0x16e)],_0x48d36c[_0x2d9f96(0xe7)][_0x2d9f96(0x139)]+=_0x2ee420['activations'][_0x2d9f96(0x139)],_0x48d36c['activations'][_0x2d9f96(0x129)]+=_0x2ee420['activations']['deleted'];}return _0x48d36c;}async function syncActivationsForSegment(_0x2e83eb,_0x3ddcd9,_0x34c118,_0x25ebb5,_0x258d00,_0x30ea52,_0x5296f4){const _0x3d11a9=a155_0x50aee1,_0x53ca63={'created':0x0,'updated':0x0,'deleted':0x0};for(const _0x38e192 of _0x258d00){try{if(_0x38e192['type']===_0x3d11a9(0x87)&&_0x38e192[_0x3d11a9(0xd6)])_0x30ea52[_0x3d11a9(0x9c)]?.({'type':'activation_creating','segmentName':_0x25ebb5,'activationName':_0x38e192['name']}),await _0x30ea52['withProgress'](_0x3d11a9(0x16b)+_0x38e192[_0x3d11a9(0xa3)]+_0x3d11a9(0x7c),()=>_0x2e83eb['segment'][_0x3d11a9(0x8f)](_0x3ddcd9,_0x34c118,_0x38e192[_0x3d11a9(0xd6)])),_0x30ea52['onProgress']?.({'type':_0x3d11a9(0x176),'segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),_0x30ea52[_0x3d11a9(0xb8)]?.(_0x3d11a9(0x7f)+_0x38e192[_0x3d11a9(0xa3)]+'\x27'),_0x53ca63[_0x3d11a9(0x16e)]++;else{if(_0x38e192[_0x3d11a9(0x102)]===_0x3d11a9(0xd7)&&_0x38e192['validatedRequest']&&_0x38e192[_0x3d11a9(0x88)])_0x30ea52[_0x3d11a9(0x9c)]?.({'type':'activation_updating','segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),await _0x30ea52['withProgress']('Updating\x20activation\x20\x27'+_0x38e192[_0x3d11a9(0xa3)]+_0x3d11a9(0x7c),()=>_0x2e83eb[_0x3d11a9(0xa7)]['updateActivation'](_0x3ddcd9,_0x34c118,_0x38e192[_0x3d11a9(0x88)]['id'],_0x38e192['validatedRequest'])),_0x30ea52[_0x3d11a9(0x9c)]?.({'type':'activation_updated','segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),_0x30ea52[_0x3d11a9(0xb8)]?.('Updated\x20activation\x20\x27'+_0x38e192[_0x3d11a9(0xa3)]+'\x27'),_0x53ca63[_0x3d11a9(0x139)]++;else _0x38e192[_0x3d11a9(0x102)]===_0x3d11a9(0x160)&&_0x38e192[_0x3d11a9(0x88)]&&(_0x30ea52[_0x3d11a9(0x9c)]?.({'type':_0x3d11a9(0x152),'segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),await _0x30ea52['withProgress'](_0x3d11a9(0xe2)+_0x38e192['name']+_0x3d11a9(0x7c),()=>_0x2e83eb[_0x3d11a9(0xa7)]['deleteActivation'](_0x3ddcd9,_0x34c118,_0x38e192[_0x3d11a9(0x88)]['id'])),_0x30ea52[_0x3d11a9(0x9c)]?.({'type':_0x3d11a9(0x78),'segmentName':_0x25ebb5,'activationName':_0x38e192[_0x3d11a9(0xa3)]}),_0x30ea52[_0x3d11a9(0x94)]?.(_0x3d11a9(0x8a)+_0x38e192[_0x3d11a9(0xa3)]+'\x27'),_0x53ca63[_0x3d11a9(0x129)]++);}}catch(_0x3d998c){const _0x24ea4a=isHttp400Error(_0x3d998c),_0x61b44a=_0x24ea4a?ErrorCode[_0x3d11a9(0x7a)]:ErrorCode[_0x3d11a9(0xf5)],_0x434f8b=getErrorMessage(_0x3d998c);throw new SDKError(_0x61b44a,_0x3d11a9(0x114)+_0x38e192[_0x3d11a9(0x102)]+'\x20activation\x20\x27'+_0x38e192[_0x3d11a9(0xa3)]+_0x3d11a9(0x10a)+_0x5296f4+'\x0a\x20\x20'+_0x434f8b,_0x3d998c);}}return _0x53ca63;}export async function executePushFolders(_0x4e39a5,_0x4f8f7d,_0x3ee285,_0x2a4610,_0x5666fb){const _0x533b0d=a155_0x50aee1,_0x1f51c=new Map(_0x3ee285),_0x50812f=sortFoldersByDepth(_0x4f8f7d);for(const _0x5568bc of _0x50812f){const _0x176268=_0x5568bc[_0x533b0d(0x11f)]('/'),_0x3043ac=_0x176268[_0x176268['length']-0x1],_0x57e863=_0x176268[_0x533b0d(0x8b)](0x0,-0x1)['join']('/'),_0x53b1e7=_0x1f51c[_0x533b0d(0x100)](_0x57e863);_0x5666fb['onProgress']?.({'type':_0x533b0d(0x9a),'folder':_0x5568bc});const _0x3945d9={'name':_0x3043ac,'parentFolderId':_0x53b1e7},_0x406a95=await _0x5666fb[_0x533b0d(0xa8)](_0x533b0d(0xf8)+_0x5568bc+'\x27...',()=>_0x4e39a5[_0x533b0d(0xa7)][_0x533b0d(0x157)](_0x2a4610[_0x533b0d(0x142)],_0x3945d9));_0x1f51c[_0x533b0d(0x7d)](_0x5568bc,_0x406a95[_0x533b0d(0xb7)]['id']),_0x5666fb[_0x533b0d(0x9c)]?.({'type':_0x533b0d(0x103),'folder':_0x5568bc,'folderId':_0x406a95[_0x533b0d(0xb7)]['id']}),_0x5666fb[_0x533b0d(0x12f)]?.(_0x533b0d(0x85)+_0x5568bc+'\x27');}return _0x1f51c;}export async function executePushSegmentDeletions(_0x397910,_0x10ad72,_0x4de12b){const _0x4f5e81=a155_0x50aee1;if(_0x10ad72[_0x4f5e81(0xd1)]===0x0)return 0x0;const {batchAsync:_0x186238}=await import(_0x4f5e81(0xcd)),_0x514161=0x5,_0x4d4c64=await _0x186238(_0x10ad72,async _0x20ea8d=>{const _0x352288=_0x4f5e81;return _0x4de12b[_0x352288(0x9c)]?.({'type':'segment_deleting','name':_0x20ea8d[_0x352288(0xa3)]}),await _0x397910[_0x352288(0xa7)][_0x352288(0xd5)](_0x20ea8d['id']),_0x4de12b[_0x352288(0x9c)]?.({'type':_0x352288(0x141),'name':_0x20ea8d[_0x352288(0xa3)]}),_0x4de12b[_0x352288(0x94)]?.('Deleted\x20segment\x20\x27'+_0x20ea8d[_0x352288(0xa3)]+'\x27'),0x1;},_0x514161);return _0x4d4c64[_0x4f5e81(0xa6)]((_0x3c5574,_0x74bdb3)=>_0x3c5574+_0x74bdb3,0x0);}export async function executePushJourneys(_0xcfee1,_0x5c7743,_0x5a1064,_0x20ad1a,_0x1344af){const _0x2a30c8=a155_0x50aee1,{journeyDefToRequest:_0x51a5c4}=await import(_0x2a30c8(0xa5)),{activationDefToCreateRequest:_0x3ec110,yamlRuleToApi:_0x34c287,validateSegmentRule:_0x35d3a6}=await import(_0x2a30c8(0xe8)),_0x5479d7={'results':[],'created':0x0,'updated':0x0,'embeddedSegmentNameToId':new Map()},_0x103bef=new Map(_0x5a1064['segmentNameToId']),_0x15bf0b=0x5;for(let _0x3cecff=0x0;_0x3cecff<_0x5c7743[_0x2a30c8(0xd1)];_0x3cecff+=_0x15bf0b){const _0x229539=_0x5c7743['slice'](_0x3cecff,_0x3cecff+_0x15bf0b),_0x957928=await Promise[_0x2a30c8(0xe1)](_0x229539['map'](async _0x8e200d=>{const _0x2fe9d4=_0x2a30c8;if(!_0x8e200d[_0x2fe9d4(0xda)]&&!_0x8e200d[_0x2fe9d4(0x166)])return{'action':_0x2fe9d4(0xac),'name':_0x8e200d[_0x2fe9d4(0xc2)]['name'],'journeyId':_0x8e200d[_0x2fe9d4(0xe0)]?.['id']};const _0x133e33=_0x8e200d[_0x2fe9d4(0xc6)]?_0x5a1064[_0x2fe9d4(0x150)][_0x2fe9d4(0x100)](_0x8e200d[_0x2fe9d4(0xc6)]):undefined;_0x1344af[_0x2fe9d4(0x9c)]?.({'type':_0x8e200d['isNew']?_0x2fe9d4(0x104):_0x2fe9d4(0x172),'name':_0x8e200d['yamlConfig']['name']});try{const _0x447b2b=await executeSingleJourneyPush(_0xcfee1,_0x8e200d,{..._0x5a1064,'segmentNameToId':_0x103bef},{'parentId':_0x20ad1a[_0x2fe9d4(0x142)],'rootFolderId':_0x20ad1a[_0x2fe9d4(0xfb)],'folderId':_0x133e33,'verbose':_0x20ad1a[_0x2fe9d4(0xb0)]},_0x1344af,{'journeyDefToRequest':_0x51a5c4,'activationDefToCreateRequest':_0x3ec110,'yamlRuleToApi':_0x34c287,'validateSegmentRule':_0x35d3a6});for(const [_0x151924,_0x40ac7a]of _0x447b2b[_0x2fe9d4(0x144)]){_0x103bef[_0x2fe9d4(0x7d)](_0x151924,_0x40ac7a),_0x5479d7['embeddedSegmentNameToId'][_0x2fe9d4(0x7d)](_0x151924,_0x40ac7a);}if(_0x447b2b[_0x2fe9d4(0xb2)]==='created')_0x1344af['onProgress']?.({'type':_0x2fe9d4(0x17f),'name':_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)],'journeyId':_0x447b2b['journeyId']}),_0x1344af[_0x2fe9d4(0xb8)]?.('Created\x20journey\x20\x27'+_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)]+'\x27'),_0x5479d7[_0x2fe9d4(0x16e)]++;else _0x447b2b[_0x2fe9d4(0xb2)]==='updated'&&(_0x1344af['onProgress']?.({'type':_0x2fe9d4(0x98),'name':_0x8e200d['yamlConfig'][_0x2fe9d4(0xa3)]}),_0x1344af[_0x2fe9d4(0xb8)]?.(_0x2fe9d4(0x91)+_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)]+'\x27'),_0x5479d7[_0x2fe9d4(0x139)]++);return{'action':_0x447b2b[_0x2fe9d4(0xb2)],'name':_0x8e200d[_0x2fe9d4(0xc2)][_0x2fe9d4(0xa3)],'journeyId':_0x447b2b[_0x2fe9d4(0x117)]};}catch(_0x5a291a){const _0x312fc6=isHttp400Error(_0x5a291a),_0xaad62c=_0x312fc6?ErrorCode[_0x2fe9d4(0x134)]:ErrorCode[_0x2fe9d4(0xcc)],_0x4bb872=getErrorMessage(_0x5a291a);throw new SDKError(_0xaad62c,_0x2fe9d4(0x114)+(_0x8e200d['isNew']?_0x2fe9d4(0x87):_0x2fe9d4(0xd7))+_0x2fe9d4(0x173)+_0x8e200d['absolutePath']+_0x2fe9d4(0x13b)+_0x4bb872,_0x5a291a);}}));_0x5479d7['results'][_0x2a30c8(0x10d)](..._0x957928);}return _0x5479d7;}async function matchExistingJourneySegments(_0x2fcfdd,_0xbd1845,_0x54461f,_0x24fd55,_0x285b72){const _0x6e452a=a155_0x50aee1;if(!_0xbd1845[_0x6e452a(0xe0)]||!_0xbd1845[_0x6e452a(0xc2)][_0x6e452a(0x156)])return;const _0x562d1a=new Map(),_0x34c46c=new Set();for(const _0x4d5289 of Object[_0x6e452a(0xc0)](_0xbd1845[_0x6e452a(0xc2)][_0x6e452a(0x156)])){const _0x1561b3=generateDeterministicJourneySegmentName(_0xbd1845[_0x6e452a(0xc2)][_0x6e452a(0xa3)],_0x4d5289);_0x562d1a['set'](_0x1561b3,_0x4d5289),_0x34c46c[_0x6e452a(0x167)](_0x4d5289);}const _0x3f6aac=[],_0x2f705f=collectSegmentIdsFromJourneyApi(_0xbd1845['existingJourney']);for(const _0x5ef7a5 of _0x2f705f){const _0xa0b0d1=await fetchSegment(_0x2fcfdd,_0x54461f,_0x5ef7a5,_0x24fd55);if(!_0xa0b0d1?.[_0x6e452a(0xa3)])continue;const _0x5f5054=_0x562d1a[_0x6e452a(0x100)](_0xa0b0d1[_0x6e452a(0xa3)]);_0x5f5054?(_0x285b72['set'](_0x5f5054,_0x5ef7a5),_0x34c46c[_0x6e452a(0x160)](_0x5f5054)):_0x3f6aac[_0x6e452a(0x10d)]({'id':_0x5ef7a5,'seg':_0xa0b0d1});}if(_0x34c46c[_0x6e452a(0x14d)]>0x0&&_0x3f6aac[_0x6e452a(0xd1)]>0x0){const {localExpandedRuleToNames:_0x24543a}=buildLocalExpandedRuleMappings(_0xbd1845['yamlConfig']),_0x5bda60=new Map();for(const {id:_0xe8a8c7,seg:_0x485919}of _0x3f6aac){if(_0x485919['rule']){const _0x4354db=apiRuleToYaml(_0x485919[_0x6e452a(0xfe)]);_0x5bda60[_0x6e452a(0x7d)](_0xe8a8c7,_0x4354db);}}for(const {id:_0xb680c4,seg:_0x129284}of _0x3f6aac){if(!_0x129284[_0x6e452a(0xfe)])continue;const _0x42690a=_0x5bda60[_0x6e452a(0x100)](_0xb680c4);if(!_0x42690a)continue;const _0x2de0aa=serializeExpandedRule(_0x42690a,_0x5bda60),_0x2d1d3b=_0x24543a[_0x6e452a(0x100)](_0x2de0aa);if(_0x2d1d3b){const _0xfa9c89=_0x2d1d3b['find'](_0x51051d=>_0x34c46c['has'](_0x51051d));_0xfa9c89&&(_0x285b72[_0x6e452a(0x7d)](_0xfa9c89,_0xb680c4),_0x34c46c[_0x6e452a(0x160)](_0xfa9c89),logger[_0x6e452a(0xcf)](_0x6e452a(0xfa)+_0x129284[_0x6e452a(0xa3)]+_0x6e452a(0x128)+_0xfa9c89+'\x27\x20by\x20rule\x20content'));}}}}async function executeSingleJourneyPush(_0x25e109,_0x14c1cc,_0x3bdd23,_0x163caa,_0x32db20,_0x4553b3){const _0xec0b3a=a155_0x50aee1,{journeyDefToRequest:_0x5003da,activationDefToCreateRequest:_0x3686ae,yamlRuleToApi:_0x4bd32a,validateSegmentRule:_0x1ac64f}=_0x4553b3,_0x1c6c72=new Map(),_0x4e417a=new Map();recoverSegmentIdsFromPushRecovery(_0x14c1cc,_0x1c6c72,_0x3bdd23['segmentNameToId']);const _0x5b9bb4=new Map(),_0x337d2d=new Map(),_0x2c0769=new Map();let _0x27491d;const _0x547577=async()=>{const _0x2a0f7d=a155_0x1494;if(_0x27491d)return;_0x27491d=new Map();if(!_0x14c1cc[_0x2a0f7d(0xe0)])return;const _0x29394d=await _0x25e109['journey'][_0x2a0f7d(0x12b)](_0x14c1cc[_0x2a0f7d(0xe0)]['id']);for(const _0x2be7c2 of _0x29394d){const _0x5d1aeb=journeyActivationStepToYaml(_0x2be7c2,_0x3bdd23['idToEmailMap'],_0x3bdd23[_0x2a0f7d(0x13c)]),_0x576594=activationSignature(_0x5d1aeb);!_0x27491d[_0x2a0f7d(0x125)](_0x576594)&&_0x27491d[_0x2a0f7d(0x7d)](_0x576594,_0x2be7c2['id']),_0x5d1aeb['name']&&_0x4e417a['set'](_0x5d1aeb[_0x2a0f7d(0xa3)],_0x2be7c2['id']);}};await matchExistingJourneySegments(_0x25e109,_0x14c1cc,_0x163caa[_0xec0b3a(0x142)],_0x3bdd23['existingSegments'],_0x3bdd23[_0xec0b3a(0x145)]);const _0x305024={'resolveSegmentId':async _0x6a10a7=>{const _0xe017b6=_0xec0b3a,_0x308d97=_0x3bdd23['segmentNameToId'][_0xe017b6(0x100)](_0x6a10a7);if(!_0x308d97)throw new SDKError(ErrorCode[_0xe017b6(0xca)],_0xe017b6(0xff)+_0x6a10a7+_0xe017b6(0x16c)+_0x14c1cc['yamlConfig']['name']+')');return _0x308d97;},'resolveEmbeddedSegmentId':async(_0x496a9b,_0x4416d4)=>{const _0x57042b=_0xec0b3a,_0x2b0420=_0x3bdd23[_0x57042b(0x145)][_0x57042b(0x100)](_0x496a9b);if(_0x2b0420)return _0x2b0420;const _0x50ecef=_0x3bdd23[_0x57042b(0xd9)][_0x57042b(0xcb)](_0x22c06b=>_0x22c06b[_0x57042b(0xa3)]===_0x496a9b);if(_0x50ecef)return _0x3bdd23[_0x57042b(0x145)][_0x57042b(0x7d)](_0x496a9b,_0x50ecef['id']),_0x50ecef['id'];if(_0x14c1cc[_0x57042b(0xda)]){const {stageName:_0x418ecf,criteriaName:_0x7b874b}=findSegmentCriteriaLocation(_0x14c1cc[_0x57042b(0xc2)],_0x496a9b);return _0x1ac64f(_0x496a9b,_0x4416d4[_0x57042b(0xfe)]),_0x337d2d[_0x57042b(0x7d)](_0x496a9b,{'definition':_0x4416d4,'stageName':_0x418ecf,'criteriaName':_0x7b874b}),createPendingSegmentId(_0x496a9b);}const _0x3b4bfa=_0x14c1cc[_0x57042b(0xe0)]?.['id'];if(!_0x3b4bfa)throw new SDKError(ErrorCode[_0x57042b(0xef)],_0x57042b(0xf9));const _0x5007a8=_0x5b9bb4[_0x57042b(0x100)](_0x496a9b);if(_0x5007a8)return _0x5007a8;const _0x275411=((async()=>{const _0x31d853=_0x57042b;_0x1ac64f(_0x496a9b,_0x4416d4[_0x31d853(0xfe)]);const _0x4451c3=generateDeterministicJourneySegmentName(_0x14c1cc[_0x31d853(0xc2)]['name'],_0x496a9b),_0x25b35c=_0x3bdd23['existingSegments'][_0x31d853(0xcb)](_0x4d07d7=>_0x4d07d7[_0x31d853(0xa3)]===_0x4451c3),_0x2708f9=createSegmentIdResolver(_0x3bdd23[_0x31d853(0x145)],_0x496a9b),_0x536e39=await resolveRuleSegmentIds(_0x4416d4['rule'],_0x2708f9);let _0x289320;return _0x25b35c?(await _0x25e109['segment'][_0x31d853(0xa1)](_0x163caa[_0x31d853(0x142)],_0x25b35c['id'],{'description':_0x4416d4[_0x31d853(0x174)]||_0x31d853(0x115)+_0x496a9b,'rule':_0x4bd32a(_0x536e39),'countPopulation':!![]}),_0x289320=_0x25b35c['id'],saveSegmentToPushRecovery(_0x14c1cc['absolutePath'],_0x14c1cc[_0x31d853(0xc2)][_0x31d853(0xa3)],_0x496a9b,{'segmentId':_0x289320,'uniqueServerName':_0x4451c3,'createdAt':new Date()[_0x31d853(0xed)]()})):_0x289320=await createOrRecoverEmbeddedSegment(_0x25e109,_0x14c1cc,{'localName':_0x496a9b,'uniqueSegmentName':_0x4451c3,'description':_0x4416d4[_0x31d853(0x174)]||_0x31d853(0x115)+_0x496a9b,'journeyId':_0x3b4bfa,'resolvedRule':_0x536e39,'parentId':_0x163caa[_0x31d853(0x142)],'folderId':_0x163caa[_0x31d853(0xfb)]||''},_0x4bd32a),_0x3bdd23[_0x31d853(0x145)][_0x31d853(0x7d)](_0x496a9b,_0x289320),_0x1c6c72[_0x31d853(0x7d)](_0x496a9b,_0x289320),_0x289320;})());_0x5b9bb4[_0x57042b(0x7d)](_0x496a9b,_0x275411);try{return await _0x275411;}finally{_0x5b9bb4[_0x57042b(0x160)](_0x496a9b);}},'resolveActivationId':async _0x216be9=>{const _0x5270b9=_0xec0b3a,_0x4969ab=_0x4e417a[_0x5270b9(0x100)](_0x216be9);if(_0x4969ab)return _0x4969ab;if(_0x14c1cc[_0x5270b9(0xe0)]){await _0x547577();const _0x2986c3=_0x4e417a['get'](_0x216be9);if(_0x2986c3)return _0x2986c3;}throw new SDKError(ErrorCode[_0x5270b9(0x147)],_0x5270b9(0x15d)+_0x216be9+_0x5270b9(0x16c)+_0x14c1cc['yamlConfig'][_0x5270b9(0xa3)]+_0x5270b9(0x111)+_0x5270b9(0xa4));},'resolveEmbeddedActivationId':async(_0x484a51,_0x2cefde)=>{const _0x172ed7=_0xec0b3a,_0x5da23c=_0x4e417a[_0x172ed7(0x100)](_0x484a51);if(_0x5da23c)return _0x5da23c;if(_0x14c1cc[_0x172ed7(0xda)])return _0x2c0769[_0x172ed7(0x7d)](_0x484a51,_0x2cefde),createPendingActivationId(_0x484a51);if(_0x14c1cc[_0x172ed7(0xe0)]){await _0x547577();const _0x127347=_0x4e417a[_0x172ed7(0x100)](_0x2cefde['name']);if(_0x127347)return _0x4e417a[_0x172ed7(0x7d)](_0x484a51,_0x127347),_0x127347;const _0x4f2b96=activationSignature(_0x2cefde),_0x2a2bca=_0x27491d?.['get'](_0x4f2b96);if(_0x2a2bca)return _0x4e417a['set'](_0x484a51,_0x2a2bca),_0x2a2bca;const _0x221c7d=await _0x3686ae(_0x2cefde,_0x3bdd23[_0x172ed7(0xae)]),_0x224e65={..._0x221c7d,..._0x2cefde[_0x172ed7(0xa2)]!==undefined&&{'runAfterJourneyRefresh':_0x2cefde[_0x172ed7(0xa2)]}},_0x7fd1eb=await _0x25e109[_0x172ed7(0x84)][_0x172ed7(0x8f)](_0x14c1cc[_0x172ed7(0xe0)]['id'],_0x224e65);return _0x4e417a['set'](_0x484a51,_0x7fd1eb['id']),_0x7fd1eb['id'];}throw new SDKError(ErrorCode[_0x172ed7(0xef)],'Cannot\x20create\x20embedded\x20activation\x20without\x20journey\x20context');},'resolveJourneyId':async _0xe004b8=>{const _0x1d9a00=_0xec0b3a;try{return await _0x25e109[_0x1d9a00(0x84)][_0x1d9a00(0x93)](_0x163caa[_0x1d9a00(0x142)],_0xe004b8);}catch(_0x45c30a){throw new SDKError(ErrorCode[_0x1d9a00(0x147)],_0x1d9a00(0xe4)+_0xe004b8+'\x27\x20not\x20found\x20in\x20parent\x20segment\x20(referenced\x20in\x20jump\x20step\x20of\x20\x27'+_0x14c1cc[_0x1d9a00(0xc2)][_0x1d9a00(0xa3)]+'\x27)',_0x45c30a);}},'resolveStageId':async(_0x1c2418,_0x8d3f28)=>{const _0x4b6314=_0xec0b3a,_0x5259aa=await _0x25e109[_0x4b6314(0x84)][_0x4b6314(0xd8)](_0x1c2418),_0x51a5e0=_0x5259aa[_0x4b6314(0x108)]['journeyStages'][_0x4b6314(0xcb)](_0x1c322c=>_0x1c322c[_0x4b6314(0xa3)][_0x4b6314(0xf2)]()===_0x8d3f28[_0x4b6314(0xf2)]());if(!_0x51a5e0?.['id'])throw new SDKError(ErrorCode['NOT_FOUND'],'Stage\x20\x27'+_0x8d3f28+_0x4b6314(0x127)+(_0x5259aa['attributes'][_0x4b6314(0x137)]||_0x5259aa[_0x4b6314(0x108)]['name'])+'\x27');return _0x51a5e0['id'];}},_0x1e82f9=await _0x5003da(_0x14c1cc[_0xec0b3a(0xc2)],_0x163caa[_0xec0b3a(0x142)],_0x305024),_0x3e4db8=_0x163caa[_0xec0b3a(0x148)]||_0x163caa[_0xec0b3a(0xfb)];_0x3e4db8&&(_0x1e82f9[_0xec0b3a(0xc7)]={'parentFolder':{'data':{'id':_0x3e4db8,'type':'folder'}}});if(_0x14c1cc[_0xec0b3a(0xda)]){if(_0x337d2d[_0xec0b3a(0x14d)]>0x0||_0x2c0769[_0xec0b3a(0x14d)]>0x0)return await executeThreeStepJourneyCreate(_0x25e109,_0x14c1cc,_0x1e82f9,{'pendingEmbeddedSegments':_0x337d2d,'pendingEmbeddedActivations':_0x2c0769,'embeddedSegmentNameToId':_0x1c6c72,'journeyActivationNameToId':_0x4e417a},{..._0x163caa,'effectiveFolderId':_0x3e4db8},_0x3bdd23,_0x32db20,_0x4553b3);else{ensureJourneyDefaults(_0x1e82f9[_0xec0b3a(0x108)]);const _0x49d82c=await _0x25e109[_0xec0b3a(0x84)][_0xec0b3a(0x87)](_0x1e82f9);return deletePushRecovery(_0x14c1cc[_0xec0b3a(0xdb)]),{'action':_0xec0b3a(0x16e),'journeyId':_0x49d82c['id'],'embeddedSegmentNameToId':_0x1c6c72};}}else{if(_0x14c1cc[_0xec0b3a(0x166)]&&_0x14c1cc[_0xec0b3a(0xe0)]){_0x1e82f9['id']=_0x14c1cc['existingJourney']['id'];const _0xb68fd9=_0x1e82f9[_0xec0b3a(0x108)];_0x14c1cc[_0xec0b3a(0xe0)][_0xec0b3a(0x108)]?.[_0xec0b3a(0x137)]&&(_0xb68fd9[_0xec0b3a(0x137)]=_0x14c1cc['existingJourney'][_0xec0b3a(0x108)][_0xec0b3a(0x137)]);const _0x476afb=_0x14c1cc[_0xec0b3a(0xe0)][_0xec0b3a(0x108)]?.['journeyStages'];return _0x476afb&&_0x1e82f9[_0xec0b3a(0x108)][_0xec0b3a(0xf3)]&&injectExistingStageIds(_0x1e82f9[_0xec0b3a(0x108)][_0xec0b3a(0xf3)],_0x476afb),ensureJourneyDefaults(_0xb68fd9),await _0x25e109['journey'][_0xec0b3a(0xd7)](_0x14c1cc[_0xec0b3a(0xe0)]['id'],_0x1e82f9),deletePushRecovery(_0x14c1cc['absolutePath']),{'action':_0xec0b3a(0x139),'journeyId':_0x14c1cc[_0xec0b3a(0xe0)]['id'],'embeddedSegmentNameToId':_0x1c6c72};}}return deletePushRecovery(_0x14c1cc['absolutePath']),{'action':_0xec0b3a(0xac),'journeyId':_0x14c1cc[_0xec0b3a(0xe0)]?.['id'],'embeddedSegmentNameToId':_0x1c6c72};}function findSegmentCriteriaLocation(_0x5ec0b3,_0x39317e){const _0x4b781e=a155_0x50aee1,_0x542d06=_0x5ec0b3[_0x4b781e(0x179)]||_0x5ec0b3[_0x4b781e(0x92)]?.[0x0]?.[_0x4b781e(0x179)]||[];let _0xb018a5='entry',_0xcc9d63=_0x39317e;const _0xb62fdb=_0x5ec0b3[_0x4b781e(0x113)]||_0x5ec0b3[_0x4b781e(0x92)]?.[0x0]?.[_0x4b781e(0x113)];if(_0xb62fdb?.[_0x4b781e(0xa7)]===_0x39317e)return{'stageName':_0x4b781e(0x113),'criteriaName':_0xb62fdb[_0x4b781e(0xa3)]||_0x39317e};_0x3ff5ba:for(const _0x1d5aa8 of _0x542d06){if(_0x1d5aa8[_0x4b781e(0x14f)]?.['segment']===_0x39317e){_0xb018a5=_0x1d5aa8['name'],_0xcc9d63=_0x1d5aa8['entry_criteria']['name']||_0x39317e;break;}if(_0x1d5aa8[_0x4b781e(0xf6)])for(const _0x50e0c6 of _0x1d5aa8[_0x4b781e(0xf6)]){if(_0x50e0c6['type']===_0x4b781e(0xeb)&&_0x50e0c6['with']?.[_0x4b781e(0xf4)])for(const _0x35a855 of _0x50e0c6[_0x4b781e(0x14b)]['branches']){if(_0x35a855[_0x4b781e(0xa7)]===_0x39317e){_0xb018a5=_0x1d5aa8[_0x4b781e(0xa3)],_0xcc9d63=_0x35a855['name']||_0x39317e;break _0x3ff5ba;}}}}return{'stageName':_0xb018a5,'criteriaName':_0xcc9d63};}async function executeThreeStepJourneyCreate(_0x230d58,_0x2c5e38,_0xab1331,_0x57d765,_0x5d570e,_0x164675,_0x4fbc5f,_0x593ee0){const _0x3cdcbb=a155_0x50aee1,{activationDefToCreateRequest:_0x254e9b,yamlRuleToApi:_0x595b07}=_0x593ee0,{pendingEmbeddedSegments:_0x38e4c1,pendingEmbeddedActivations:_0xb3211e,embeddedSegmentNameToId:_0x5ced84}=_0x57d765,_0x5c3b19=JSON[_0x3cdcbb(0xba)](JSON[_0x3cdcbb(0x130)](_0xab1331));ensureJourneyDefaults(_0x5c3b19[_0x3cdcbb(0x108)]),stripPendingIds(_0x5c3b19);const _0x155547=await _0x230d58[_0x3cdcbb(0x84)][_0x3cdcbb(0x87)](_0x5c3b19),_0x3c46bf=_0x155547['id'],_0x1349cc=new Map();for(const _0x512ea2 of _0x155547[_0x3cdcbb(0x108)][_0x3cdcbb(0xf3)]){_0x1349cc['set'](_0x512ea2[_0x3cdcbb(0xa3)]['toLowerCase'](),_0x512ea2['id']);}recoverSegmentIdsFromPushRecovery(_0x2c5e38,_0x5ced84,_0x164675[_0x3cdcbb(0x145)]);for(const [_0x3ee8b2,{definition:_0x34eb27}]of _0x38e4c1){if(_0x5ced84[_0x3cdcbb(0x125)](_0x3ee8b2)){_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x10c),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)]['name'],'segmentName':_0x3ee8b2});continue;}const _0xeccecd=generateDeterministicJourneySegmentName(_0x2c5e38['yamlConfig']['name'],_0x3ee8b2);_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x178),'journeyName':_0x2c5e38['yamlConfig'][_0x3cdcbb(0xa3)],'segmentName':_0x3ee8b2});const _0x2884fb=createSegmentIdResolver(_0x164675[_0x3cdcbb(0x145)],_0x3ee8b2),_0x1f7d57=await resolveRuleSegmentIds(_0x34eb27[_0x3cdcbb(0xfe)],_0x2884fb),_0x44f4d2=await createOrRecoverEmbeddedSegment(_0x230d58,_0x2c5e38,{'localName':_0x3ee8b2,'uniqueSegmentName':_0xeccecd,'description':_0x34eb27[_0x3cdcbb(0x174)]||'Entry\x20criteria:\x20'+_0x3ee8b2,'journeyId':_0x3c46bf,'resolvedRule':_0x1f7d57,'parentId':_0x5d570e[_0x3cdcbb(0x142)],'folderId':_0x5d570e[_0x3cdcbb(0xee)]||''},_0x595b07);_0x5ced84[_0x3cdcbb(0x7d)](_0x3ee8b2,_0x44f4d2),_0x164675[_0x3cdcbb(0x145)][_0x3cdcbb(0x7d)](_0x3ee8b2,_0x44f4d2),_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x10c),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)][_0x3cdcbb(0xa3)],'segmentName':_0x3ee8b2});}const _0x18e9be=new Map();for(const [_0x2c3f18,_0x4a5cd8]of _0xb3211e){_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0x151),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)]['name'],'activationName':_0x2c3f18});const _0x509b54=await _0x254e9b(_0x4a5cd8,_0x164675[_0x3cdcbb(0xae)]),_0x212b26={..._0x509b54,..._0x4a5cd8['run_after_journey_refresh']!==undefined&&{'runAfterJourneyRefresh':_0x4a5cd8[_0x3cdcbb(0xa2)]}},_0x2db942=await _0x230d58['journey']['createActivation'](_0x3c46bf,_0x212b26);_0x18e9be[_0x3cdcbb(0x7d)](_0x2c3f18,_0x2db942['id']),_0x57d765[_0x3cdcbb(0x107)][_0x3cdcbb(0x7d)](_0x2c3f18,_0x2db942['id']),_0x4fbc5f[_0x3cdcbb(0x9c)]?.({'type':_0x3cdcbb(0xbe),'journeyName':_0x2c5e38[_0x3cdcbb(0xc2)][_0x3cdcbb(0xa3)],'activationName':_0x2c3f18});}const _0x554343=JSON[_0x3cdcbb(0xba)](JSON['stringify'](_0xab1331));return _0x554343['id']=_0x3c46bf,ensureJourneyDefaults(_0x554343[_0x3cdcbb(0x108)]),resolvePendingIdsInRequest(_0x554343,_0xab1331,_0x1349cc,_0x5ced84,_0x18e9be,_0x4fbc5f),await _0x230d58['journey'][_0x3cdcbb(0xd7)](_0x3c46bf,_0x554343),deletePushRecovery(_0x2c5e38[_0x3cdcbb(0xdb)]),{'action':_0x3cdcbb(0x16e),'journeyId':_0x3c46bf,'embeddedSegmentNameToId':_0x5ced84};}export function stripWaitStepPendingIds(_0x349828){const _0x33f457=a155_0x50aee1,_0x1ececc=_0x349828[_0x33f457(0x9f)]&&isPendingSegmentId(_0x349828['conditionSegmentId']),_0x2d70c4=_0x349828['conditions']?.[_0x33f457(0xc5)](_0x536361=>_0x536361[_0x33f457(0x11a)]&&isPendingSegmentId(_0x536361['segmentId']));(_0x1ececc||_0x2d70c4)&&(_0x349828[_0x33f457(0x14a)]=_0x33f457(0xd0),_0x349828[_0x33f457(0x11c)]=0x1,_0x349828[_0x33f457(0xbc)]='day',delete _0x349828[_0x33f457(0x9f)],delete _0x349828[_0x33f457(0x8c)],delete _0x349828[_0x33f457(0xf1)],delete _0x349828[_0x33f457(0x138)]);}export function resolveWaitStepPendingIds(_0x4bb036,_0x13a48f,_0x499b55,_0xb3c94e){const _0x5cc635=a155_0x50aee1;if(_0x13a48f['conditionSegmentId']&&isPendingSegmentId(_0x13a48f[_0x5cc635(0x9f)])){const _0x40d041=_0x499b55(_0x13a48f[_0x5cc635(0x9f)],'stage\x20\x27'+_0xb3c94e+_0x5cc635(0xe3));_0x40d041&&(_0x4bb036[_0x5cc635(0x14a)]='Condition',_0x4bb036[_0x5cc635(0x9f)]=_0x40d041,delete _0x4bb036['waitStep'],delete _0x4bb036[_0x5cc635(0xbc)],_0x13a48f[_0x5cc635(0x8c)]!==undefined&&(_0x4bb036[_0x5cc635(0x8c)]=_0x13a48f[_0x5cc635(0x8c)]),_0x13a48f[_0x5cc635(0xf1)]&&(_0x4bb036[_0x5cc635(0xf1)]=_0x13a48f[_0x5cc635(0xf1)]));}if(_0x13a48f[_0x5cc635(0x138)]){const _0x1955d1=_0x13a48f[_0x5cc635(0x138)][_0x5cc635(0xc5)](_0x211ce6=>_0x211ce6[_0x5cc635(0x11a)]&&isPendingSegmentId(_0x211ce6[_0x5cc635(0x11a)]));if(_0x1955d1){const _0x4933b8=_0x13a48f[_0x5cc635(0x138)][_0x5cc635(0x136)](_0x3c033e=>{const _0x1c2764=_0x5cc635;if(_0x3c033e[_0x1c2764(0x11a)]&&isPendingSegmentId(_0x3c033e[_0x1c2764(0x11a)])){const _0x3d6d26=_0x499b55(_0x3c033e[_0x1c2764(0x11a)],_0x1c2764(0xad)+_0xb3c94e+_0x1c2764(0xe3));return{..._0x3c033e,'segmentId':_0x3d6d26||_0x3c033e[_0x1c2764(0x11a)]};}return{..._0x3c033e};});_0x4bb036[_0x5cc635(0x14a)]=_0x5cc635(0xb1),_0x4bb036['conditions']=_0x4933b8,delete _0x4bb036['waitStep'],delete _0x4bb036[_0x5cc635(0xbc)],delete _0x4bb036[_0x5cc635(0x9f)],delete _0x4bb036['conditionTimeoutDuration'],delete _0x4bb036[_0x5cc635(0xf1)];}}}function stripPendingIds(_0x96b8f3){const _0x165a60=a155_0x50aee1;_0x96b8f3['attributes'][_0x165a60(0x113)]?.[_0x165a60(0x11a)]&&isPendingSegmentId(_0x96b8f3[_0x165a60(0x108)][_0x165a60(0x113)][_0x165a60(0x11a)])&&delete _0x96b8f3[_0x165a60(0x108)][_0x165a60(0x113)];for(const _0x3eb4f8 of _0x96b8f3[_0x165a60(0x108)][_0x165a60(0xf3)]||[]){_0x3eb4f8[_0x165a60(0x177)]?.[_0x165a60(0x11a)]&&isPendingSegmentId(_0x3eb4f8[_0x165a60(0x177)][_0x165a60(0x11a)])&&delete _0x3eb4f8[_0x165a60(0x177)];_0x3eb4f8[_0x165a60(0x15b)]?.['segmentId']&&isPendingSegmentId(_0x3eb4f8['milestone']['segmentId'])&&delete _0x3eb4f8[_0x165a60(0x15b)];_0x3eb4f8[_0x165a60(0xdf)]&&(_0x3eb4f8[_0x165a60(0xdf)]=_0x3eb4f8[_0x165a60(0xdf)][_0x165a60(0x15e)](_0x4818b0=>!_0x4818b0['segmentId']||!isPendingSegmentId(_0x4818b0[_0x165a60(0x11a)])));if(_0x3eb4f8[_0x165a60(0xf6)])for(const _0x30db2d of Object[_0x165a60(0xc0)](_0x3eb4f8[_0x165a60(0xf6)])){const _0x3b7b87=_0x3eb4f8[_0x165a60(0xf6)][_0x30db2d];_0x3b7b87[_0x165a60(0x102)]===_0x165a60(0x86)&&_0x3b7b87['journeyActivationStepId']&&isPendingActivationId(_0x3b7b87['journeyActivationStepId'])&&(_0x3b7b87[_0x165a60(0xdc)]='');if(_0x3b7b87[_0x165a60(0x102)]===_0x165a60(0xf0)&&_0x3b7b87['branches'])for(const _0x505e68 of _0x3b7b87[_0x165a60(0xf4)]){_0x505e68[_0x165a60(0x11a)]&&isPendingSegmentId(_0x505e68[_0x165a60(0x11a)])&&(_0x505e68[_0x165a60(0x11a)]='');}_0x3b7b87[_0x165a60(0x102)]===_0x165a60(0x16d)&&stripWaitStepPendingIds(_0x3b7b87);}}}function resolvePendingIdsInRequest(_0x272eca,_0x34eb85,_0x675199,_0x2cfe71,_0xebd268,_0x5cca25){const _0x400bfa=a155_0x50aee1,_0x156134=(_0xe4ca0e,_0x384004)=>{const _0x47c078=a155_0x1494;if(!isPendingSegmentId(_0xe4ca0e))return _0xe4ca0e;const _0x5bc245=extractPendingSegmentName(_0xe4ca0e),_0x41903a=_0x2cfe71['get'](_0x5bc245);return!_0x41903a&&_0x5cca25[_0x47c078(0x170)]?.(_0x47c078(0xd3)+_0x5bc245+_0x47c078(0x116)+_0x384004),_0x41903a;};if(_0x272eca[_0x400bfa(0x108)]['goal']?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x272eca[_0x400bfa(0x108)][_0x400bfa(0x113)][_0x400bfa(0x11a)])){const _0x2ab228=_0x156134(_0x272eca[_0x400bfa(0x108)][_0x400bfa(0x113)][_0x400bfa(0x11a)],_0x400bfa(0x9b));_0x2ab228&&(_0x272eca[_0x400bfa(0x108)]['goal'][_0x400bfa(0x11a)]=_0x2ab228);}for(const _0x408a3e of _0x272eca[_0x400bfa(0x108)][_0x400bfa(0xf3)]||[]){const _0x228d94=_0x675199[_0x400bfa(0x100)](_0x408a3e[_0x400bfa(0xa3)][_0x400bfa(0xf2)]());_0x228d94&&(_0x408a3e['id']=_0x228d94);if(_0x408a3e[_0x400bfa(0x177)]?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x408a3e[_0x400bfa(0x177)][_0x400bfa(0x11a)])){const _0x4df93d=_0x156134(_0x408a3e['entryCriteria'][_0x400bfa(0x11a)],_0x400bfa(0xad)+_0x408a3e['name']+_0x400bfa(0xbd));_0x4df93d&&(_0x408a3e[_0x400bfa(0x177)][_0x400bfa(0x11a)]=_0x4df93d);}if(_0x408a3e['exitCriterias'])for(const _0x5b1cfa of _0x408a3e['exitCriterias']){if(_0x5b1cfa[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x5b1cfa[_0x400bfa(0x11a)])){const _0x27bdeb=_0x156134(_0x5b1cfa['segmentId'],_0x400bfa(0xad)+_0x408a3e[_0x400bfa(0xa3)]+_0x400bfa(0xea));_0x27bdeb&&(_0x5b1cfa[_0x400bfa(0x11a)]=_0x27bdeb);}}if(_0x408a3e['milestone']?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x408a3e[_0x400bfa(0x15b)][_0x400bfa(0x11a)])){const _0x2f223e=_0x156134(_0x408a3e['milestone'][_0x400bfa(0x11a)],'stage\x20\x27'+_0x408a3e[_0x400bfa(0xa3)]+_0x400bfa(0x9e));_0x2f223e&&(_0x408a3e[_0x400bfa(0x15b)]['segmentId']=_0x2f223e);}if(_0x408a3e[_0x400bfa(0xf6)]){const _0x1fc1dc=_0x3eeacf=>_0x34eb85[_0x400bfa(0x108)]['journeyStages']?.['find'](_0x2aef32=>_0x2aef32[_0x400bfa(0xa3)][_0x400bfa(0xf2)]()===_0x408a3e['name']['toLowerCase']())?.[_0x400bfa(0xf6)]?.[_0x3eeacf];for(const _0x125593 of Object['keys'](_0x408a3e[_0x400bfa(0xf6)])){const _0x107f96=_0x408a3e[_0x400bfa(0xf6)][_0x125593],_0x1278ea=_0x1fc1dc(_0x125593);if(_0x107f96[_0x400bfa(0x102)]===_0x400bfa(0x86)&&_0x107f96[_0x400bfa(0xdc)]&&(isPendingActivationId(_0x107f96['journeyActivationStepId'])||_0x107f96[_0x400bfa(0xdc)]==='')){if(_0x1278ea?.[_0x400bfa(0xdc)]&&isPendingActivationId(_0x1278ea['journeyActivationStepId'])){const _0x15fd83=extractPendingActivationName(_0x1278ea[_0x400bfa(0xdc)]),_0x772dfa=_0xebd268[_0x400bfa(0x100)](_0x15fd83);_0x772dfa&&(_0x107f96[_0x400bfa(0xdc)]=_0x772dfa);}}if(_0x107f96[_0x400bfa(0x102)]===_0x400bfa(0xf0)&&_0x107f96['branches']&&_0x1278ea?.['branches'])for(let _0x5d934d=0x0;_0x5d934d<_0x107f96[_0x400bfa(0xf4)][_0x400bfa(0xd1)];_0x5d934d++){const _0x1de1e8=_0x107f96['branches'][_0x5d934d],_0x4b3bb6=_0x1278ea['branches'][_0x5d934d];if(_0x4b3bb6?.[_0x400bfa(0x11a)]&&isPendingSegmentId(_0x4b3bb6['segmentId'])){const _0x32b2c0=_0x156134(_0x4b3bb6[_0x400bfa(0x11a)],_0x400bfa(0xad)+_0x408a3e[_0x400bfa(0xa3)]+_0x400bfa(0x14c)+(_0x1de1e8[_0x400bfa(0xa3)]||_0x5d934d)+'\x27');_0x32b2c0&&(_0x1de1e8[_0x400bfa(0x11a)]=_0x32b2c0);}}_0x107f96[_0x400bfa(0x102)]===_0x400bfa(0x16d)&&_0x1278ea?.[_0x400bfa(0x102)]===_0x400bfa(0x16d)&&resolveWaitStepPendingIds(_0x107f96,_0x1278ea,_0x156134,_0x408a3e[_0x400bfa(0xa3)]);}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xabb88a,_0x5cc42c){const _0x2cfe9c=a156_0x414d,_0x3ebad6=_0xabb88a();while(!![]){try{const _0x5a52da=-parseInt(_0x2cfe9c(0x193))/0x1*(-parseInt(_0x2cfe9c(0x194))/0x2)+-parseInt(_0x2cfe9c(0x19c))/0x3+parseInt(_0x2cfe9c(0x19e))/0x4+-parseInt(_0x2cfe9c(0x192))/0x5+parseInt(_0x2cfe9c(0x195))/0x6*(-parseInt(_0x2cfe9c(0x19a))/0x7)+-parseInt(_0x2cfe9c(0x19b))/0x8+parseInt(_0x2cfe9c(0x19d))/0x9*(parseInt(_0x2cfe9c(0x198))/0xa);if(_0x5a52da===_0x5cc42c)break;else _0x3ebad6['push'](_0x3ebad6['shift']());}catch(_0x139afd){_0x3ebad6['push'](_0x3ebad6['shift']());}}}(a156_0x29c9,0xe05be));export function buildFolderIdToPathMap(_0x21f93e){const _0x45df86=a156_0x414d,_0x1710f6=new Map(),_0x461594=new Map();for(const _0x30d7bc of _0x21f93e){_0x461594[_0x45df86(0x197)](_0x30d7bc['id'],_0x30d7bc);}const _0x2ca36c=new Set();for(const _0x2fde9f of _0x21f93e){!_0x2fde9f[_0x45df86(0x19f)]&&_0x2ca36c['add'](_0x2fde9f['id']);}function _0x413e55(_0x1b9783){const _0x5addf1=_0x45df86;if(_0x1710f6[_0x5addf1(0x1a0)](_0x1b9783['id']))return _0x1710f6[_0x5addf1(0x1a1)](_0x1b9783['id']);if(_0x2ca36c['has'](_0x1b9783['id']))return _0x1710f6[_0x5addf1(0x197)](_0x1b9783['id'],''),'';if(_0x1b9783['parentFolderId']){const _0x6d6191=_0x461594['get'](_0x1b9783[_0x5addf1(0x19f)]);if(_0x6d6191){const _0x592f9d=_0x413e55(_0x6d6191),_0x49c94d=_0x592f9d?_0x592f9d+'/'+_0x1b9783[_0x5addf1(0x199)]:_0x1b9783[_0x5addf1(0x199)];return _0x1710f6['set'](_0x1b9783['id'],_0x49c94d),_0x49c94d;}}const _0x2d23d4=_0x1b9783[_0x5addf1(0x199)];return _0x1710f6[_0x5addf1(0x197)](_0x1b9783['id'],_0x2d23d4),_0x2d23d4;}for(const _0x4bfd1d of _0x21f93e){_0x413e55(_0x4bfd1d);}return _0x1710f6;}export function buildFolderPathToIdMap(_0x4bee1){const _0x3c3242=a156_0x414d,_0x17f2fb=new Map(),_0x4bcf86=new Map();for(const _0x2e0ddc of _0x4bee1){_0x4bcf86[_0x3c3242(0x197)](_0x2e0ddc['id'],_0x2e0ddc);}const _0x180fd0=new Set();for(const _0x4318a9 of _0x4bee1){!_0x4318a9[_0x3c3242(0x19f)]&&_0x180fd0[_0x3c3242(0x196)](_0x4318a9['id']);}function _0x5cfa4e(_0x45f75f){const _0x5bca55=_0x3c3242;if(_0x180fd0[_0x5bca55(0x1a0)](_0x45f75f['id']))return'';if(_0x45f75f[_0x5bca55(0x19f)]){const _0xad2ce8=_0x4bcf86[_0x5bca55(0x1a1)](_0x45f75f['parentFolderId']);if(_0xad2ce8){const _0x19af43=_0x5cfa4e(_0xad2ce8);return _0x19af43?_0x19af43+'/'+_0x45f75f[_0x5bca55(0x199)]:_0x45f75f[_0x5bca55(0x199)];}}return _0x45f75f[_0x5bca55(0x199)];}for(const _0x201fc1 of _0x4bee1){const _0x2940c0=_0x5cfa4e(_0x201fc1);_0x17f2fb[_0x3c3242(0x197)](_0x2940c0,_0x201fc1['id']);}return _0x17f2fb;}function a156_0x414d(_0xa9cbb0,_0x8eaae){_0xa9cbb0=_0xa9cbb0-0x192;const _0x29c936=a156_0x29c9();let _0x414deb=_0x29c936[_0xa9cbb0];return _0x414deb;}export function buildFolderMaps(_0x2d64e9){const _0xc455c=a156_0x414d,_0x468d3c=buildFolderIdToPathMap(_0x2d64e9),_0xc95bda=new Map();for(const [_0x208261,_0x3d9dea]of _0x468d3c){_0xc95bda[_0xc455c(0x197)](_0x3d9dea,_0x208261);}return{'idToPath':_0x468d3c,'pathToId':_0xc95bda};}export function getFolderPath(_0x24b0e6,_0x454a7d){const _0x4a4317=a156_0x414d;if(!_0x24b0e6)return'';return _0x454a7d[_0x4a4317(0x1a1)](_0x24b0e6)??'';}function a156_0x29c9(){const _0x37d0ca=['1030722cwJEhl','9SNACsj','6811604zrrmqM','parentFolderId','has','get','356690zVWchl','1oSnJBc','850856EZwgPs','12vItrtk','add','set','3413380LpkJGY','name','879116sRcsth','7076840YyQIbP'];a156_0x29c9=function(){return _0x37d0ca;};return a156_0x29c9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xcb3d19,_0x38e246){const _0x38dda5=a157_0x57cc,_0x28101a=_0xcb3d19();while(!![]){try{const _0x40e6b4=-parseInt(_0x38dda5(0x83))/0x1*(-parseInt(_0x38dda5(0x96))/0x2)+parseInt(_0x38dda5(0x7f))/0x3*(parseInt(_0x38dda5(0xa0))/0x4)+parseInt(_0x38dda5(0xb2))/0x5+parseInt(_0x38dda5(0x99))/0x6*(-parseInt(_0x38dda5(0x92))/0x7)+parseInt(_0x38dda5(0x84))/0x8+-parseInt(_0x38dda5(0xa6))/0x9+parseInt(_0x38dda5(0xa4))/0xa*(-parseInt(_0x38dda5(0x9a))/0xb);if(_0x40e6b4===_0x38e246)break;else _0x28101a['push'](_0x28101a['shift']());}catch(_0x293060){_0x28101a['push'](_0x28101a['shift']());}}}(a157_0x4b29,0xe2d40));import a157_0x112c91 from'path';import{parse as a157_0x539c96}from'yaml';import{nodeFileSystem}from'../io/node-filesystem.js';export function parsePath(_0x166886){const _0x23e7ca=a157_0x57cc;if(!_0x166886||_0x166886[_0x23e7ca(0xad)]()==='')throw new Error(_0x23e7ca(0x9c));const _0x25610e=_0x166886['trim']();if(_0x25610e==='/')return{'segments':[],'isAbsolute':!![],'raw':_0x166886};const _0x2d1970=_0x25610e[_0x23e7ca(0xab)]('/')?_0x25610e[_0x23e7ca(0xa1)](0x1):_0x25610e,_0x49cfbb=_0x2d1970['split']('/')[_0x23e7ca(0x8c)](_0x48c149=>_0x48c149!=='');if(_0x49cfbb['length']===0x0)throw new Error(_0x23e7ca(0xae));const _0x4bdf04=_0x25610e['startsWith']('/')||!isRelativePathSegment(_0x49cfbb[0x0]);for(const _0x1a8312 of _0x49cfbb){validatePathSegment(_0x1a8312);}return{'segments':_0x49cfbb,'isAbsolute':_0x4bdf04,'raw':_0x166886};}function isRelativePathSegment(_0x4625b5){return _0x4625b5==='.'||_0x4625b5==='..';}function validatePathSegment(_0x4d6f57){const _0x3fa96f=a157_0x57cc;if(_0x4d6f57==='')throw new Error(_0x3fa96f(0xa5));if(_0x4d6f57==='.'||_0x4d6f57==='..')return;if(/[\x00-\x1F\x7F]/[_0x3fa96f(0x81)](_0x4d6f57))throw new Error(_0x3fa96f(0x82)+_0x4d6f57);if(_0x4d6f57!==_0x4d6f57[_0x3fa96f(0xad)]()){}}export function validatePath(_0x1baf56){const _0x552419=a157_0x57cc;if(_0x1baf56[_0x552419(0xb0)]['length']===0x0&&!_0x1baf56[_0x552419(0xb1)])throw new Error(_0x552419(0x90));if(_0x1baf56[_0x552419(0xb1)]){if(_0x1baf56['segments'][0x0]==='..')throw new Error(_0x552419(0xa2));let _0xb85714=0x0;for(const _0x57f0f8 of _0x1baf56[_0x552419(0xb0)]){if(_0x57f0f8==='..'){if(_0xb85714===0x0)throw new Error(_0x552419(0xa7));_0xb85714--;}else _0x57f0f8!=='.'&&_0xb85714++;}}}export function joinPaths(_0x569ab2,_0x172f25){const _0x1de9e4=a157_0x57cc;if(!_0x569ab2||_0x569ab2==='/')return _0x172f25;if(!_0x172f25||_0x172f25==='.')return _0x569ab2;if(_0x172f25[_0x1de9e4(0xab)]('/'))return _0x172f25;const _0x446190=parsePath(_0x569ab2),_0x4f8841=parsePath(_0x172f25),_0x2504d6=[..._0x446190[_0x1de9e4(0xb0)]];for(const _0x59674f of _0x4f8841[_0x1de9e4(0xb0)]){if(_0x59674f==='.')continue;else{if(_0x59674f==='..'){if(_0x2504d6[_0x1de9e4(0x9d)]===0x0)throw new Error('Cannot\x20navigate\x20above\x20root');_0x2504d6['pop']();}else _0x2504d6[_0x1de9e4(0x8b)](_0x59674f);}}const _0x4aad16=_0x2504d6[_0x1de9e4(0x95)]('/');return _0x446190[_0x1de9e4(0x8a)][_0x1de9e4(0xab)]('/')?'/'+_0x4aad16:_0x4aad16;}function a157_0x4b29(){const _0x41b351=['Hint:\x20Run\x20`tdx\x20sg\x20pull\x20\x22Parent\x20Segment\x20Name\x22`\x20first\x20to\x20create\x20a\x20project\x20directory,\x20then\x20work\x20within\x20that\x20directory.','Path\x20cannot\x20be\x20empty','length','parent_segment','tdx.json','19704BXkClq','substring','Absolute\x20path\x20cannot\x20start\x20with\x20\x22..\x22','resolve','610vJbeVm','Path\x20segment\x20cannot\x20be\x20empty','2953809DtvnVi','Path\x20attempts\x20to\x20navigate\x20above\x20root','slice','exists','readFile','startsWith','dirname','trim','Path\x20must\x20contain\x20at\x20least\x20one\x20segment','type','segments','isAbsolute','8594065pQshFY','897wZTMtH','parse','test','Path\x20segment\x20contains\x20invalid\x20control\x20characters:\x20','4niWmBX','5649032FeJSDP','root','journey','endsWith','Invalid\x20YAML:\x20missing\x20name\x20field\x20in\x20','File\x20not\x20found:\x20','raw','push','filter','No\x20tdx.json\x20found\x20for\x20file:\x20','name','Invalid\x20tdx.json:\x20missing\x20parent_segment\x20field','Relative\x20path\x20cannot\x20be\x20empty','Cannot\x20navigate\x20above\x20root','161ttcmJG','.yml','replace','join','53854dtEhVA','Cannot\x20split\x20empty\x20path','pop','441492ujQOoe','190399GDiRCj'];a157_0x4b29=function(){return _0x41b351;};return a157_0x4b29();}function a157_0x57cc(_0x1c83e9,_0x4dcb03){_0x1c83e9=_0x1c83e9-0x7f;const _0x4b295c=a157_0x4b29();let _0x57cce6=_0x4b295c[_0x1c83e9];return _0x57cce6;}export function normalizePath(_0x811509){const _0x4764f7=a157_0x57cc,_0x1a1990=parsePath(_0x811509),_0x1bc216=[];for(const _0x27b4ce of _0x1a1990[_0x4764f7(0xb0)]){if(_0x27b4ce==='.')continue;else{if(_0x27b4ce==='..'){if(_0x1bc216['length']===0x0){if(_0x1a1990[_0x4764f7(0xb1)])throw new Error(_0x4764f7(0x91));_0x1bc216[_0x4764f7(0x8b)]('..');}else _0x1bc216[_0x1bc216['length']-0x1]==='..'?_0x1bc216[_0x4764f7(0x8b)]('..'):_0x1bc216[_0x4764f7(0x98)]();}else _0x1bc216['push'](_0x27b4ce);}}if(_0x1bc216[_0x4764f7(0x9d)]===0x0)return _0x1a1990[_0x4764f7(0xb1)]?'/':'.';const _0x118784=_0x1bc216[_0x4764f7(0x95)]('/');return _0x1a1990[_0x4764f7(0x8a)][_0x4764f7(0xab)]('/')?'/'+_0x118784:_0x118784;}export function getParentPath(_0x541c3f){const _0x1a8a33=a157_0x57cc,_0x4154c5=parsePath(_0x541c3f);if(_0x4154c5[_0x1a8a33(0xb0)][_0x1a8a33(0x9d)]<=0x1)return'/';const _0x29a85f=_0x4154c5[_0x1a8a33(0xb0)][_0x1a8a33(0xa8)](0x0,-0x1)['join']('/');return _0x4154c5['raw'][_0x1a8a33(0xab)]('/')?'/'+_0x29a85f:_0x29a85f;}export function getBaseName(_0x1e1ceb){const _0x16f6a9=a157_0x57cc,_0x55b4d=parsePath(_0x1e1ceb);return _0x55b4d[_0x16f6a9(0xb0)][_0x55b4d[_0x16f6a9(0xb0)][_0x16f6a9(0x9d)]-0x1]||'';}export function isChildPath(_0xee3dc5,_0x479188){const _0x2a13ad=a157_0x57cc,_0x71835e=parsePath(_0xee3dc5),_0x32febc=parsePath(_0x479188);if(_0x71835e[_0x2a13ad(0xb0)][_0x2a13ad(0x9d)]<=_0x32febc[_0x2a13ad(0xb0)][_0x2a13ad(0x9d)])return![];for(let _0x4e9232=0x0;_0x4e9232<_0x32febc[_0x2a13ad(0xb0)][_0x2a13ad(0x9d)];_0x4e9232++){if(_0x71835e[_0x2a13ad(0xb0)][_0x4e9232]!==_0x32febc[_0x2a13ad(0xb0)][_0x4e9232])return![];}return!![];}export function splitPath(_0x5b0d50){const _0x2a03f1=a157_0x57cc,_0x239311=parsePath(_0x5b0d50);if(_0x239311[_0x2a03f1(0xb0)][_0x2a03f1(0x9d)]===0x0)throw new Error(_0x2a03f1(0x97));if(_0x239311[_0x2a03f1(0xb0)][_0x2a03f1(0x9d)]===0x1)return{'parent':_0x239311[_0x2a03f1(0xb0)][0x0]};return{'parent':_0x239311[_0x2a03f1(0xb0)][0x0],'child':_0x239311[_0x2a03f1(0xb0)][_0x2a03f1(0xa8)](0x1)[_0x2a03f1(0x95)]('/')};}export function isYamlFilePath(_0x88ab0d){const _0x32364f=a157_0x57cc;return _0x88ab0d['endsWith'](_0x32364f(0x93))||_0x88ab0d[_0x32364f(0x87)]('.yaml');}export async function resolveYamlFilePath(_0xa9cfa3,_0xf925db=nodeFileSystem){const _0x26ed08=a157_0x57cc,_0x5e934e=a157_0x112c91[_0x26ed08(0xa3)](_0xa9cfa3);if(!await _0xf925db[_0x26ed08(0xa9)](_0x5e934e))throw new Error(_0x26ed08(0x89)+_0xa9cfa3);let _0x1105f5=a157_0x112c91['dirname'](_0x5e934e),_0x5d1d4a=null,_0x3acd29=null;const _0x1aff38=a157_0x112c91[_0x26ed08(0x80)](_0x1105f5)[_0x26ed08(0x85)];while(_0x1105f5!==_0x1aff38){const _0x2b49c7=a157_0x112c91[_0x26ed08(0x95)](_0x1105f5,_0x26ed08(0x9f));if(await _0xf925db[_0x26ed08(0xa9)](_0x2b49c7)){_0x5d1d4a=_0x2b49c7,_0x3acd29=_0x1105f5;break;}_0x1105f5=a157_0x112c91[_0x26ed08(0xac)](_0x1105f5);}if(!_0x5d1d4a||!_0x3acd29)throw new Error(_0x26ed08(0x8d)+_0xa9cfa3+'\x0a'+_0x26ed08(0x9b));const _0x53135f=await _0xf925db[_0x26ed08(0xaa)](_0x5d1d4a),_0x2eae5b=JSON[_0x26ed08(0x80)](_0x53135f),_0x1fe413=_0x2eae5b[_0x26ed08(0x9e)];if(!_0x1fe413)throw new Error(_0x26ed08(0x8f));const _0x5c8a28=await _0xf925db[_0x26ed08(0xaa)](_0x5e934e),_0x55461c=a157_0x539c96(_0x5c8a28),_0x2fa232=_0x55461c[_0x26ed08(0x8e)];if(!_0x2fa232)throw new Error(_0x26ed08(0x88)+_0xa9cfa3);const _0x1dff07=_0x55461c[_0x26ed08(0xaf)]===_0x26ed08(0x86)?_0x26ed08(0x86):'segment',_0xfeb68f=a157_0x112c91['relative'](_0x3acd29,_0x5e934e),_0x2e7ad4=a157_0x112c91[_0x26ed08(0xac)](_0xfeb68f),_0x1db879=_0x2e7ad4==='.'?'':_0x2e7ad4[_0x26ed08(0x94)](/\\/g,'/'),_0xdc667b=_0x1db879?_0x1fe413+'/'+_0x1db879+'/'+_0x2fa232:_0x1fe413+'/'+_0x2fa232;return{'parentSegment':_0x1fe413,'segmentName':_0x2fa232,'folderPath':_0x1db879,'fullPath':_0xdc667b,'resourceType':_0x1dff07,'content':_0x5c8a28};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a158_0x2a64(){const _0xf17d46=['570699IfogkR','Invalid\x20segment\x20reference\x20format:\x20','6362163mIaLtu','.\x20Child\x20name\x20cannot\x20be\x20empty','substring','135yQNGnu','.\x20Parent\x20name\x20cannot\x20be\x20empty','7GvYclQ','2664192OmYWvs','68394BrRKUd','2842552PPwlEM','6lezrxo','3942323nzWXMv','indexOf','10aoeMiW','455205HhAkmh'];a158_0x2a64=function(){return _0xf17d46;};return a158_0x2a64();}(function(_0x20d7b1,_0x26383e){const _0x5694ab=a158_0x42e7,_0x36856d=_0x20d7b1();while(!![]){try{const _0x5e3622=-parseInt(_0x5694ab(0x178))/0x1+parseInt(_0x5694ab(0x174))/0x2*(parseInt(_0x5694ab(0x169))/0x3)+parseInt(_0x5694ab(0x171))/0x4+parseInt(_0x5694ab(0x16e))/0x5*(parseInt(_0x5694ab(0x172))/0x6)+parseInt(_0x5694ab(0x170))/0x7*(-parseInt(_0x5694ab(0x173))/0x8)+parseInt(_0x5694ab(0x16b))/0x9*(-parseInt(_0x5694ab(0x177))/0xa)+parseInt(_0x5694ab(0x175))/0xb;if(_0x5e3622===_0x26383e)break;else _0x36856d['push'](_0x36856d['shift']());}catch(_0x48e718){_0x36856d['push'](_0x36856d['shift']());}}}(a158_0x2a64,0x5e1ca));function a158_0x42e7(_0x37ae2d,_0x4af14e){_0x37ae2d=_0x37ae2d-0x169;const _0x2a647a=a158_0x2a64();let _0x42e75a=_0x2a647a[_0x37ae2d];return _0x42e75a;}export function parseSegmentRef(_0x2e79bb){const _0x1a4e1c=a158_0x42e7,_0x630e77=_0x2e79bb[_0x1a4e1c(0x176)]('/');if(_0x630e77===-0x1)return{'parentId':_0x2e79bb};if(_0x630e77===0x0)throw new Error(_0x1a4e1c(0x16a)+_0x2e79bb+_0x1a4e1c(0x16f));const _0x5a7eb6=_0x2e79bb['substring'](0x0,_0x630e77),_0x40a2a7=_0x2e79bb[_0x1a4e1c(0x16d)](_0x630e77+0x1);if(_0x40a2a7==='')throw new Error(_0x1a4e1c(0x16a)+_0x2e79bb+_0x1a4e1c(0x16c));return{'parentId':_0x5a7eb6,'childId':_0x40a2a7};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a159_0x5939(){const _0x21588e=['.operator.not','MISSING_OPERATOR_VALUE','conditions','.operator.type','type','source','For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','352398cBoIbP','And','custom','path','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','MISSING_BETWEEN_BOUNDS','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','4rOXdwg','length','5471710YONwgL','error','aggregation','endsWith','80250QEZnzp','38856gpQGOD','filter','Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','2096728sKOnyx','\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20','.attribute','.segment','push','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','warning','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','operator','1481540ZdzLin','message','symbol','.type','BEHAVIOR_SOURCE_MISSING_FILTER','448GQyCmr','attribute','3949qGKkpm','MISSING_TIME_UNIT','MISSING_NAME','.conditions','12nVxpxu','INVALID_ARRAY_MATCHING','TimeWithinNext','rule','rule.type','match','validationCode','NESTED_CONDITION_GROUP','description','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20','\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','Behavior\x20source\x20\x27','success','EMPTY_CONDITIONS','45MEfkDz','invalid_value','\x27\x20with\x20attribute\x20\x27','EMPTY_ATTRIBUTE','params','issues','969819LmantX','TimeWithinPast','level','TEMPORAL_NEGATION_UNSUPPORTED','data','INVALID_RULE_TYPE','.source','document','Attribute\x20name\x20cannot\x20be\x20empty','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','Operator\x20\x27','map'];a159_0x5939=function(){return _0x21588e;};return a159_0x5939();}(function(_0x326a9c,_0x4f2b26){const _0x1b1c1d=a159_0xc0db,_0x4812c6=_0x326a9c();while(!![]){try{const _0x1e86b6=parseInt(_0x1b1c1d(0x152))/0x1*(-parseInt(_0x1b1c1d(0x14b))/0x2)+parseInt(_0x1b1c1d(0x138))/0x3*(-parseInt(_0x1b1c1d(0x170))/0x4)+parseInt(_0x1b1c1d(0x154))/0x5+-parseInt(_0x1b1c1d(0x158))/0x6*(-parseInt(_0x1b1c1d(0x16a))/0x7)+parseInt(_0x1b1c1d(0x15c))/0x8+-parseInt(_0x1b1c1d(0x132))/0x9*(parseInt(_0x1b1c1d(0x165))/0xa)+parseInt(_0x1b1c1d(0x16c))/0xb*(parseInt(_0x1b1c1d(0x159))/0xc);if(_0x1e86b6===_0x4f2b26)break;else _0x4812c6['push'](_0x4812c6['shift']());}catch(_0x7bea77){_0x4812c6['push'](_0x4812c6['shift']());}}}(a159_0x5939,0xea402));function a159_0xc0db(_0x4a8a31,_0x2ca8f1){_0x4a8a31=_0x4a8a31-0x12c;const _0x59397f=a159_0x5939();let _0xc0dbef=_0x59397f[_0x4a8a31];return _0xc0dbef;}import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';export function validateSegmentDef(_0x3f3b74,_0x748d3d={},_0x3dec2={}){const _0x49a8a2=a159_0xc0db;if(_0x3dec2['skipSchema'])return runSemanticChecks(_0x3f3b74,_0x748d3d);const _0x24cf87=SegmentDefSchema['safeParse'](_0x3f3b74);if(_0x24cf87[_0x49a8a2(0x130)])return runSemanticChecks(_0x24cf87[_0x49a8a2(0x13c)],_0x748d3d);return zodErrorsToValidationResult(_0x24cf87[_0x49a8a2(0x155)],_0x748d3d);}export function validateRuleDef(_0x2aef27,_0x178fd5,_0x51cf75){const _0x5543fa=a159_0xc0db;if(!_0x2aef27)return[];const _0x4b6414=RuleDefSchema['safeParse'](_0x2aef27);if(_0x4b6414[_0x5543fa(0x130)])return checkRule(_0x4b6414[_0x5543fa(0x13c)],_0x178fd5,_0x51cf75);const _0x2a5a34=flattenZodIssues(_0x4b6414['error'][_0x5543fa(0x137)]);return _0x2a5a34['map'](_0x444c3f=>{const _0x187cf9=_0x5543fa,_0x38130a=formatZodPath(_0x444c3f[_0x187cf9(0x14e)]),_0x5b6a3d=_0x38130a?_0x178fd5+'.'+_0x38130a:_0x178fd5,_0x415d41=mapZodIssueToCode(_0x444c3f,_0x38130a),_0x5a7fce=getLocationFromPath(_0x51cf75[_0x187cf9(0x13f)],_0x51cf75[_0x187cf9(0x149)],pathToArray(_0x5b6a3d));return{'level':_0x187cf9(0x155),'path':_0x5b6a3d,'code':_0x415d41,'message':_0x444c3f[_0x187cf9(0x166)],..._0x5a7fce&&{'location':_0x5a7fce}};});}function zodErrorsToValidationResult(_0x2c84f8,_0x5730ad){const _0x5e151b=a159_0xc0db,_0x26e87c=flattenZodIssues(_0x2c84f8[_0x5e151b(0x137)]),_0x3d450d=_0x26e87c[_0x5e151b(0x143)](_0x314dd7=>{const _0x46eeb3=_0x5e151b,_0x30de88=formatZodPath(_0x314dd7[_0x46eeb3(0x14e)]),_0xddb44b=mapZodIssueToCode(_0x314dd7,_0x30de88),_0x48c4e5=getLocationFromPath(_0x5730ad[_0x46eeb3(0x13f)],_0x5730ad['source'],_0x314dd7['path'][_0x46eeb3(0x143)](_0x36b547=>typeof _0x36b547===_0x46eeb3(0x167)?String(_0x36b547):_0x36b547));return{'level':_0x46eeb3(0x155),'path':_0x30de88,'code':_0xddb44b,'message':_0x314dd7[_0x46eeb3(0x166)],..._0x48c4e5&&{'location':_0x48c4e5}};});return{'valid':![],'errors':_0x3d450d,'warnings':[]};}function mapZodIssueToCode(_0x379942,_0x57b9d4){const _0x3bc54c=a159_0xc0db,_0x296059=_0x379942['code']===_0x3bc54c(0x14d)?_0x379942[_0x3bc54c(0x136)]:undefined;if(_0x57b9d4==='name')return _0x3bc54c(0x16e);if(_0x57b9d4===_0x3bc54c(0x174)||_0x57b9d4[_0x3bc54c(0x157)](_0x3bc54c(0x168))){if(_0x379942['code']===_0x3bc54c(0x133)){if(_0x57b9d4===_0x3bc54c(0x174)||_0x57b9d4[_0x3bc54c(0x175)](/\.conditions\[\d+\]\.type$/))return _0x3bc54c(0x13d);}}if(_0x57b9d4[_0x3bc54c(0x157)](_0x3bc54c(0x147)))return'INVALID_OPERATOR_TYPE';if(_0x57b9d4[_0x3bc54c(0x157)]('.operator.value'))return _0x3bc54c(0x145);if(_0x296059?.[_0x3bc54c(0x176)]===_0x3bc54c(0x150))return _0x3bc54c(0x150);if(_0x296059?.[_0x3bc54c(0x176)]===_0x3bc54c(0x16d))return _0x3bc54c(0x16d);if(_0x57b9d4[_0x3bc54c(0x157)](_0x3bc54c(0x16f))||_0x57b9d4===_0x3bc54c(0x146))return'MISSING_CONDITIONS';if(_0x57b9d4['includes']('arrayMatching'))return _0x3bc54c(0x171);if(_0x57b9d4['endsWith'](_0x3bc54c(0x15f)))return'MISSING_SEGMENT_REFERENCE';return'SEGMENT_SCHEMA_ERROR';}function runSemanticChecks(_0x2b24c4,_0x5d74fc){const _0x458449=a159_0xc0db,_0x55368c=[];_0x2b24c4[_0x458449(0x173)]&&_0x55368c[_0x458449(0x160)](...checkRule(_0x2b24c4[_0x458449(0x173)],_0x458449(0x173),_0x5d74fc));const _0x2e400f=_0x55368c[_0x458449(0x15a)](_0x16a515=>_0x16a515[_0x458449(0x13a)]==='error'),_0x8e921b=_0x55368c['filter'](_0x23301a=>_0x23301a[_0x458449(0x13a)]===_0x458449(0x162));return{'valid':_0x2e400f['length']===0x0,'errors':_0x2e400f,'warnings':_0x8e921b};}function checkRule(_0x5545ed,_0x425eed,_0x3951c6){const _0x4964f2=a159_0xc0db,_0x4919d8=[];if(_0x5545ed[_0x4964f2(0x146)][_0x4964f2(0x153)]===0x0)return _0x4919d8[_0x4964f2(0x160)]({'level':_0x4964f2(0x155),'path':_0x425eed+_0x4964f2(0x16f),'code':_0x4964f2(0x131),'message':_0x4964f2(0x161),'location':getLocationFromPath(_0x3951c6[_0x4964f2(0x13f)],_0x3951c6['source'],pathToArray(_0x425eed+'.conditions'))}),_0x4919d8;return _0x4919d8[_0x4964f2(0x160)](...checkConditions(_0x5545ed['conditions'],_0x425eed,_0x3951c6)),_0x4919d8;}function checkConditions(_0x1712d9,_0x500277,_0x43aebe){const _0x8cf1b7=a159_0xc0db,_0x531d79=[];for(let _0x2e3a8d=0x0;_0x2e3a8d<_0x1712d9[_0x8cf1b7(0x153)];_0x2e3a8d++){const _0x16e601=_0x1712d9[_0x2e3a8d],_0x3fc79e=_0x500277+'.conditions['+_0x2e3a8d+']';_0x531d79['push'](...checkCondition(_0x16e601,_0x3fc79e,_0x43aebe));}return _0x531d79;}function checkCondition(_0x386590,_0x4a3e62,_0x5d59b7){const _0x3abcf2=a159_0xc0db,_0x1118fd=[];if(_0x386590['type']===_0x3abcf2(0x14c)||_0x386590[_0x3abcf2(0x148)]==='Or'||_0x386590[_0x3abcf2(0x148)]==='Composite'){if(_0x386590[_0x3abcf2(0x146)]['length']===0x0)_0x1118fd[_0x3abcf2(0x160)]({'level':'error','path':_0x4a3e62+_0x3abcf2(0x16f),'code':_0x3abcf2(0x131),'message':_0x386590['type']+_0x3abcf2(0x151),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62+_0x3abcf2(0x16f)))});else{const _0x289966=_0x386590[_0x3abcf2(0x178)]!==undefined,_0x462a52=_0x386590[_0x3abcf2(0x148)]==='Composite';!_0x289966&&!_0x462a52&&_0x1118fd['push']({'level':_0x3abcf2(0x162),'path':_0x4a3e62,'code':_0x3abcf2(0x177),'message':_0x386590[_0x3abcf2(0x148)]+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+'condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20'+_0x3abcf2(0x179),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62))}),_0x1118fd['push'](...checkConditions(_0x386590[_0x3abcf2(0x146)],_0x4a3e62,_0x5d59b7));}return _0x1118fd;}if(_0x386590[_0x3abcf2(0x148)]==='Value'||_0x386590[_0x3abcf2(0x148)]==='Behavior'){const _0x21902e=_0x386590,_0xf1696a=_0x21902e[_0x3abcf2(0x149)],_0x40e044=_0x21902e[_0x3abcf2(0x156)],_0xb7fe89=_0xf1696a||_0x40e044,_0x2cdd8d=_0x21902e[_0x3abcf2(0x164)]?.[_0x3abcf2(0x148)];if((_0x2cdd8d===_0x3abcf2(0x139)||_0x2cdd8d===_0x3abcf2(0x172))&&_0x21902e[_0x3abcf2(0x164)]?.['not']!==undefined){const _0x25740a=_0x21902e[_0x3abcf2(0x164)]['not']===!![];_0x1118fd[_0x3abcf2(0x160)]({'level':_0x25740a?'error':'warning','path':_0x4a3e62+_0x3abcf2(0x144),'code':_0x3abcf2(0x13b),'message':_0x25740a?_0x3abcf2(0x142)+_0x2cdd8d+_0x3abcf2(0x15d)+_0x3abcf2(0x12c)+_0x3abcf2(0x163):_0x3abcf2(0x142)+_0x2cdd8d+_0x3abcf2(0x12d)+_0x3abcf2(0x141),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7['source'],pathToArray(_0x4a3e62+'.operator.not'))});}(!_0x21902e[_0x3abcf2(0x16b)]||_0x21902e[_0x3abcf2(0x16b)]==='')&&(!_0xb7fe89&&_0x1118fd['push']({'level':_0x3abcf2(0x155),'path':_0x4a3e62+_0x3abcf2(0x15e),'code':_0x3abcf2(0x135),'message':_0x3abcf2(0x140),'location':getLocationFromPath(_0x5d59b7['document'],_0x5d59b7['source'],pathToArray(_0x4a3e62+_0x3abcf2(0x15e)))}));_0x21902e[_0x3abcf2(0x15a)]&&_0x1118fd['push'](...checkRule(_0x21902e[_0x3abcf2(0x15a)],_0x4a3e62+'.filter',_0x5d59b7));if(_0x21902e['source']){const _0x39fdd7=_0x21902e[_0x3abcf2(0x16b)]&&_0x21902e['attribute']!=='';_0x39fdd7&&!_0x21902e[_0x3abcf2(0x15a)]&&_0x1118fd[_0x3abcf2(0x160)]({'level':_0x3abcf2(0x155),'path':_0x4a3e62+_0x3abcf2(0x13e),'code':_0x3abcf2(0x169),'message':_0x3abcf2(0x12f)+_0x21902e[_0x3abcf2(0x149)]+_0x3abcf2(0x134)+_0x21902e['attribute']+'\x27\x20'+'requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20'+_0x3abcf2(0x12e)+_0x3abcf2(0x15b),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62+'.source'))}),_0x39fdd7&&_0x21902e[_0x3abcf2(0x15a)]&&_0x1118fd['push']({'level':_0x3abcf2(0x162),'path':_0x4a3e62+_0x3abcf2(0x15e),'code':_0x3abcf2(0x14f),'message':'Attribute\x20\x27'+_0x21902e[_0x3abcf2(0x16b)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+_0x3abcf2(0x14a),'location':getLocationFromPath(_0x5d59b7[_0x3abcf2(0x13f)],_0x5d59b7[_0x3abcf2(0x149)],pathToArray(_0x4a3e62+_0x3abcf2(0x15e)))});}}return _0x1118fd;}
|
|
1
|
+
(function(_0x122c6c,_0x1633f1){const _0x1f1610=a159_0x1511,_0x246b62=_0x122c6c();while(!![]){try{const _0x1a4738=parseInt(_0x1f1610(0x230))/0x1*(parseInt(_0x1f1610(0x233))/0x2)+parseInt(_0x1f1610(0x22b))/0x3*(-parseInt(_0x1f1610(0x1e9))/0x4)+parseInt(_0x1f1610(0x21f))/0x5+-parseInt(_0x1f1610(0x1fe))/0x6*(parseInt(_0x1f1610(0x1ee))/0x7)+-parseInt(_0x1f1610(0x1ef))/0x8*(parseInt(_0x1f1610(0x222))/0x9)+-parseInt(_0x1f1610(0x1eb))/0xa+-parseInt(_0x1f1610(0x20f))/0xb*(-parseInt(_0x1f1610(0x217))/0xc);if(_0x1a4738===_0x1633f1)break;else _0x246b62['push'](_0x246b62['shift']());}catch(_0x199cca){_0x246b62['push'](_0x246b62['shift']());}}}(a159_0x20b4,0xdf444));import{SegmentDefSchema,RuleDefSchema}from'./types/segment-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray}from'./yaml-validator.js';function a159_0x20b4(){const _0x3aa687=['.operator.value','2524790BHaURn','Behavior','attribute','686623zKFCyD','3220432oISHne','condition\x20groups\x20correctly.\x20Segment\x20execution\x20is\x20unaffected.\x20For\x20same-attribute\x20Or\x20','TimeWithinNext','Attribute\x20name\x20cannot\x20be\x20empty','requires\x20a\x20nested\x20\x27filter\x27.\x20Without\x20filter,\x20the\x20source\x20is\x20silently\x20ignored\x20and\x20','MISSING_NAME','type','path','description','endsWith','name','custom','match','map','issues','6YhxJao','level','params','Attribute\x20\x27','Behavior\x20source\x20\x27','rule.type','.operator.type','Value','MISSING_TIME_UNIT','Rule\x20conditions\x20array\x20cannot\x20be\x20empty.\x20Add\x20at\x20least\x20one\x20condition.','.filter','aggregation','MISSING_OPERATOR_VALUE','source','includes','push','Remove\x20\x27not:\x20false\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','2268101pdlzqC','success','conditions','.attribute','filter','\x27\x20with\x20attribute\x20\x27','\x20condition\x20cannot\x20have\x20an\x20empty\x20conditions\x20array','Remove\x20\x27not\x27\x20—\x20temporal\x20operators\x20do\x20not\x20support\x20negation.','36pOSlAT','INVALID_OPERATOR_TYPE','operator','.operator.not','EMPTY_CONDITIONS','skipSchema','BEHAVIOR_SOURCE_MISSING_FILTER','code','5205555hAPXgZ','error','MISSING_BETWEEN_BOUNDS','9FRRgTi','INVALID_ARRAY_MATCHING','TEMPORAL_NEGATION_UNSUPPORTED','NESTED_CONDITION_GROUP','data','validationCode','Operator\x20\x27','.conditions[','MISSING_CONDITIONS','1344711xqYinV','BEHAVIOR_SOURCE_WITH_ATTRIBUTE','TimeWithinPast','warning','MISSING_SEGMENT_REFERENCE','91235XWjYUk','rule','document','10LUUwHs','message','invalid_value','length','the\x20condition\x20queries\x20the\x20master\x20table\x20instead.\x20','safeParse','.conditions','symbol','not','conditions,\x20consider\x20using\x20\x27In\x27\x20operator:\x20operator:\x20{\x20type:\x20In,\x20value:\x20[\x22val1\x22,\x20\x22val2\x22]\x20}','Composite','4fnLFWw'];a159_0x20b4=function(){return _0x3aa687;};return a159_0x20b4();}export function validateSegmentDef(_0x4a616d,_0x8f3d21={},_0x20ecf4={}){const _0x3d52ba=a159_0x1511;if(_0x20ecf4[_0x3d52ba(0x21c)])return runSemanticChecks(_0x4a616d,_0x8f3d21);const _0x2e3bac=SegmentDefSchema[_0x3d52ba(0x1e3)](_0x4a616d);if(_0x2e3bac[_0x3d52ba(0x210)])return runSemanticChecks(_0x2e3bac[_0x3d52ba(0x226)],_0x8f3d21);return zodErrorsToValidationResult(_0x2e3bac[_0x3d52ba(0x220)],_0x8f3d21);}export function validateRuleDef(_0x4431c9,_0x8e5dbc,_0xf5c73a){const _0x953589=a159_0x1511;if(!_0x4431c9)return[];const _0x38f9ee=RuleDefSchema['safeParse'](_0x4431c9);if(_0x38f9ee['success'])return checkRule(_0x38f9ee[_0x953589(0x226)],_0x8e5dbc,_0xf5c73a);const _0x115126=flattenZodIssues(_0x38f9ee[_0x953589(0x220)][_0x953589(0x1fd)]);return _0x115126[_0x953589(0x1fc)](_0x39c0f6=>{const _0x3cd0b5=_0x953589,_0x30a5d0=formatZodPath(_0x39c0f6[_0x3cd0b5(0x1f6)]),_0x88770e=_0x30a5d0?_0x8e5dbc+'.'+_0x30a5d0:_0x8e5dbc,_0x32d33e=mapZodIssueToCode(_0x39c0f6,_0x30a5d0),_0x5f516c=getLocationFromPath(_0xf5c73a[_0x3cd0b5(0x232)],_0xf5c73a[_0x3cd0b5(0x20b)],pathToArray(_0x88770e));return{'level':'error','path':_0x88770e,'code':_0x32d33e,'message':_0x39c0f6[_0x3cd0b5(0x234)],..._0x5f516c&&{'location':_0x5f516c}};});}function zodErrorsToValidationResult(_0x310b73,_0x4de2c3){const _0xc17b76=a159_0x1511,_0x538456=flattenZodIssues(_0x310b73[_0xc17b76(0x1fd)]),_0xf73e7c=_0x538456[_0xc17b76(0x1fc)](_0x5f2f51=>{const _0x28706c=_0xc17b76,_0x1e3a82=formatZodPath(_0x5f2f51['path']),_0x2b5266=mapZodIssueToCode(_0x5f2f51,_0x1e3a82),_0x25bcaa=getLocationFromPath(_0x4de2c3[_0x28706c(0x232)],_0x4de2c3[_0x28706c(0x20b)],_0x5f2f51[_0x28706c(0x1f6)][_0x28706c(0x1fc)](_0x2f47dc=>typeof _0x2f47dc===_0x28706c(0x1e5)?String(_0x2f47dc):_0x2f47dc));return{'level':_0x28706c(0x220),'path':_0x1e3a82,'code':_0x2b5266,'message':_0x5f2f51['message'],..._0x25bcaa&&{'location':_0x25bcaa}};});return{'valid':![],'errors':_0xf73e7c,'warnings':[]};}function mapZodIssueToCode(_0x4492cb,_0xd0b6a){const _0x2b669e=a159_0x1511,_0x2397ce=_0x4492cb[_0x2b669e(0x21e)]===_0x2b669e(0x1fa)?_0x4492cb[_0x2b669e(0x200)]:undefined;if(_0xd0b6a===_0x2b669e(0x1f9))return _0x2b669e(0x1f4);if(_0xd0b6a===_0x2b669e(0x203)||_0xd0b6a['endsWith']('.type')){if(_0x4492cb[_0x2b669e(0x21e)]===_0x2b669e(0x235)){if(_0xd0b6a==='rule.type'||_0xd0b6a[_0x2b669e(0x1fb)](/\.conditions\[\d+\]\.type$/))return'INVALID_RULE_TYPE';}}if(_0xd0b6a[_0x2b669e(0x1f8)](_0x2b669e(0x204)))return _0x2b669e(0x218);if(_0xd0b6a[_0x2b669e(0x1f8)](_0x2b669e(0x1ea)))return _0x2b669e(0x20a);if(_0x2397ce?.[_0x2b669e(0x227)]===_0x2b669e(0x221))return _0x2b669e(0x221);if(_0x2397ce?.[_0x2b669e(0x227)]==='MISSING_TIME_UNIT')return _0x2b669e(0x206);if(_0xd0b6a[_0x2b669e(0x1f8)](_0x2b669e(0x1e4))||_0xd0b6a===_0x2b669e(0x211))return _0x2b669e(0x22a);if(_0xd0b6a[_0x2b669e(0x20c)]('arrayMatching'))return _0x2b669e(0x223);if(_0xd0b6a[_0x2b669e(0x1f8)]('.segment'))return _0x2b669e(0x22f);return'SEGMENT_SCHEMA_ERROR';}function runSemanticChecks(_0x373bb0,_0x4b426e){const _0x398717=a159_0x1511,_0x1ea58d=[];_0x373bb0[_0x398717(0x231)]&&_0x1ea58d[_0x398717(0x20d)](...checkRule(_0x373bb0[_0x398717(0x231)],_0x398717(0x231),_0x4b426e));const _0x383357=_0x1ea58d['filter'](_0x27c2ef=>_0x27c2ef[_0x398717(0x1ff)]==='error'),_0x173261=_0x1ea58d[_0x398717(0x213)](_0x57e6de=>_0x57e6de[_0x398717(0x1ff)]===_0x398717(0x22e));return{'valid':_0x383357['length']===0x0,'errors':_0x383357,'warnings':_0x173261};}function a159_0x1511(_0x3e25d0,_0x1d51ab){_0x3e25d0=_0x3e25d0-0x1e2;const _0x20b44c=a159_0x20b4();let _0x1511c8=_0x20b44c[_0x3e25d0];return _0x1511c8;}function checkRule(_0x49d888,_0x54a124,_0x1865cd){const _0x1762bf=a159_0x1511,_0x3f5c1b=[];if(_0x49d888['conditions']['length']===0x0)return _0x3f5c1b['push']({'level':_0x1762bf(0x220),'path':_0x54a124+_0x1762bf(0x1e4),'code':_0x1762bf(0x21b),'message':_0x1762bf(0x207),'location':getLocationFromPath(_0x1865cd[_0x1762bf(0x232)],_0x1865cd['source'],pathToArray(_0x54a124+_0x1762bf(0x1e4)))}),_0x3f5c1b;return _0x3f5c1b[_0x1762bf(0x20d)](...checkConditions(_0x49d888[_0x1762bf(0x211)],_0x54a124,_0x1865cd)),_0x3f5c1b;}function checkConditions(_0x60743d,_0x599675,_0x5c69f2){const _0x1fe69=a159_0x1511,_0x1d434=[];for(let _0x21d322=0x0;_0x21d322<_0x60743d[_0x1fe69(0x236)];_0x21d322++){const _0x2b8b05=_0x60743d[_0x21d322],_0x42f5f7=_0x599675+_0x1fe69(0x229)+_0x21d322+']';_0x1d434[_0x1fe69(0x20d)](...checkCondition(_0x2b8b05,_0x42f5f7,_0x5c69f2));}return _0x1d434;}function checkCondition(_0x2b24a6,_0x56aeff,_0x30b243){const _0xfbc84=a159_0x1511,_0x4b3080=[];if(_0x2b24a6['type']==='And'||_0x2b24a6[_0xfbc84(0x1f5)]==='Or'||_0x2b24a6[_0xfbc84(0x1f5)]===_0xfbc84(0x1e8)){if(_0x2b24a6[_0xfbc84(0x211)][_0xfbc84(0x236)]===0x0)_0x4b3080[_0xfbc84(0x20d)]({'level':'error','path':_0x56aeff+_0xfbc84(0x1e4),'code':_0xfbc84(0x21b),'message':_0x2b24a6['type']+_0xfbc84(0x215),'location':getLocationFromPath(_0x30b243[_0xfbc84(0x232)],_0x30b243['source'],pathToArray(_0x56aeff+_0xfbc84(0x1e4)))});else{const _0x370b46=_0x2b24a6[_0xfbc84(0x1f7)]!==undefined,_0x6bc3b0=_0x2b24a6[_0xfbc84(0x1f5)]===_0xfbc84(0x1e8);!_0x370b46&&!_0x6bc3b0&&_0x4b3080['push']({'level':_0xfbc84(0x22e),'path':_0x56aeff,'code':_0xfbc84(0x225),'message':_0x2b24a6[_0xfbc84(0x1f5)]+'\x20condition\x20group:\x20Console\x20UI\x20SQL\x20preview\x20does\x20not\x20display\x20nested\x20'+_0xfbc84(0x1f0)+_0xfbc84(0x1e7),'location':getLocationFromPath(_0x30b243[_0xfbc84(0x232)],_0x30b243[_0xfbc84(0x20b)],pathToArray(_0x56aeff))}),_0x4b3080['push'](...checkConditions(_0x2b24a6[_0xfbc84(0x211)],_0x56aeff,_0x30b243));}return _0x4b3080;}if(_0x2b24a6[_0xfbc84(0x1f5)]===_0xfbc84(0x205)||_0x2b24a6[_0xfbc84(0x1f5)]===_0xfbc84(0x1ec)){const _0x5221a5=_0x2b24a6,_0x247ac1=_0x5221a5['source'],_0x2a3d06=_0x5221a5[_0xfbc84(0x209)],_0x1057a4=_0x247ac1||_0x2a3d06,_0x5a7ef3=_0x5221a5[_0xfbc84(0x219)]?.[_0xfbc84(0x1f5)];if((_0x5a7ef3===_0xfbc84(0x22d)||_0x5a7ef3===_0xfbc84(0x1f1))&&_0x5221a5[_0xfbc84(0x219)]?.[_0xfbc84(0x1e6)]!==undefined){const _0x4f643a=_0x5221a5['operator'][_0xfbc84(0x1e6)]===!![];_0x4b3080[_0xfbc84(0x20d)]({'level':_0x4f643a?'error':_0xfbc84(0x22e),'path':_0x56aeff+_0xfbc84(0x21a),'code':_0xfbc84(0x224),'message':_0x4f643a?_0xfbc84(0x228)+_0x5a7ef3+'\x27\x20with\x20\x27not:\x20true\x27\x20is\x20not\x20supported\x20by\x20the\x20Console\x20segment\x20editor.\x20'+'The\x20editor\x20will\x20silently\x20drop\x20the\x20negation\x20and\x20corrupt\x20the\x20segment\x20on\x20re-save.\x20'+_0xfbc84(0x216):_0xfbc84(0x228)+_0x5a7ef3+'\x27\x20does\x20not\x20support\x20the\x20\x27not\x27\x20field.\x20'+_0xfbc84(0x20e),'location':getLocationFromPath(_0x30b243['document'],_0x30b243[_0xfbc84(0x20b)],pathToArray(_0x56aeff+_0xfbc84(0x21a)))});}(!_0x5221a5[_0xfbc84(0x1ed)]||_0x5221a5[_0xfbc84(0x1ed)]==='')&&(!_0x1057a4&&_0x4b3080[_0xfbc84(0x20d)]({'level':_0xfbc84(0x220),'path':_0x56aeff+_0xfbc84(0x212),'code':'EMPTY_ATTRIBUTE','message':_0xfbc84(0x1f2),'location':getLocationFromPath(_0x30b243['document'],_0x30b243['source'],pathToArray(_0x56aeff+_0xfbc84(0x212)))}));_0x5221a5['filter']&&_0x4b3080['push'](...checkRule(_0x5221a5[_0xfbc84(0x213)],_0x56aeff+_0xfbc84(0x208),_0x30b243));if(_0x5221a5[_0xfbc84(0x20b)]){const _0x27dc33=_0x5221a5[_0xfbc84(0x1ed)]&&_0x5221a5['attribute']!=='';_0x27dc33&&!_0x5221a5[_0xfbc84(0x213)]&&_0x4b3080[_0xfbc84(0x20d)]({'level':_0xfbc84(0x220),'path':_0x56aeff+'.source','code':_0xfbc84(0x21d),'message':_0xfbc84(0x202)+_0x5221a5[_0xfbc84(0x20b)]+_0xfbc84(0x214)+_0x5221a5[_0xfbc84(0x1ed)]+'\x27\x20'+_0xfbc84(0x1f3)+_0xfbc84(0x1e2)+'Use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20\x27filter.type:\x20And\x27\x20containing\x20\x27type:\x20Column\x27\x20conditions.','location':getLocationFromPath(_0x30b243['document'],_0x30b243[_0xfbc84(0x20b)],pathToArray(_0x56aeff+'.source'))}),_0x27dc33&&_0x5221a5['filter']&&_0x4b3080['push']({'level':_0xfbc84(0x22e),'path':_0x56aeff+_0xfbc84(0x212),'code':_0xfbc84(0x22c),'message':_0xfbc84(0x201)+_0x5221a5[_0xfbc84(0x1ed)]+'\x27\x20with\x20behavior\x20source\x20may\x20cause\x20unexpected\x20behavior.\x20'+'For\x20behavior\x20aggregations,\x20use\x20\x27attribute:\x20\x22\x22\x27\x20with\x20Column\x20conditions\x20in\x20filter.','location':getLocationFromPath(_0x30b243['document'],_0x30b243[_0xfbc84(0x20b)],pathToArray(_0x56aeff+'.attribute'))});}}return _0x4b3080;}
|