@treasuredata/tdx 2026.4.6 → 2026.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.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/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.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
|
-
(function(_0x5de13c,_0x24002){const _0x193d28=a146_0x6b41,_0x5c7ecf=_0x5de13c();while(!![]){try{const _0x50ff8d=-parseInt(_0x193d28(0x25a))/0x1+-parseInt(_0x193d28(0x247))/0x2+parseInt(_0x193d28(0x22b))/0x3+-parseInt(_0x193d28(0x24b))/0x4+-parseInt(_0x193d28(0x1ed))/0x5*(parseInt(_0x193d28(0x219))/0x6)+-parseInt(_0x193d28(0x1e7))/0x7+-parseInt(_0x193d28(0x218))/0x8*(-parseInt(_0x193d28(0x220))/0x9);if(_0x50ff8d===_0x24002)break;else _0x5c7ecf['push'](_0x5c7ecf['shift']());}catch(_0x4fdb1d){_0x5c7ecf['push'](_0x5c7ecf['shift']());}}}(a146_0x3f87,0xb7bb8));function a146_0x6b41(_0x45a2de,_0x547802){_0x45a2de=_0x45a2de-0x1d9;const _0x3f875e=a146_0x3f87();let _0x6b41=_0x3f875e[_0x45a2de];return _0x6b41;}import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x4ee100,_0xefba18,_0x73951f,_0x587dba,_0x4208c7,_0x203d4a){const _0x28c61d=a146_0x6b41;return{'level':_0x4ee100,'path':_0xefba18,'code':_0x73951f,'message':_0x587dba,'location':getLocationFromPath(_0x4208c7[_0x28c61d(0x245)],_0x4208c7[_0x28c61d(0x23a)],pathToArray(_0x203d4a??_0xefba18))};}function validateVersionStructure(_0xf6bcdb,_0x51ceee){const _0x472163=a146_0x6b41,_0x2e1b47=[];return _0xf6bcdb[_0x472163(0x1fc)]>MAX_STAGES&&_0x2e1b47[_0x472163(0x1e9)](createIssue('error',_0x472163(0x27a),_0x472163(0x200),'Journey\x20has\x20'+_0xf6bcdb[_0x472163(0x1fc)]+_0x472163(0x250)+MAX_STAGES,_0x51ceee)),_0x2e1b47;}function validateStageStructure(_0x1fbd77,_0x5be744,_0x7bc5df,_0x393098){const _0xea9667=a146_0x6b41,_0x56a8dd=[],_0x3ab4b0=_0xea9667(0x1ff)+_0x5be744+']';_0x5be744===0x0&&!_0x1fbd77[_0xea9667(0x21d)]&&_0x56a8dd[_0xea9667(0x1e9)](createIssue('error',_0x3ab4b0+_0xea9667(0x279),_0xea9667(0x1ec),_0xea9667(0x239)+_0x1fbd77[_0xea9667(0x21f)]+'\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)',_0x393098,_0x3ab4b0));const _0x3daf44=_0x5be744===_0x7bc5df-0x1;!_0x3daf44&&!_0x1fbd77[_0xea9667(0x1f5)]&&_0x56a8dd[_0xea9667(0x1e9)](createIssue('error',_0x3ab4b0+'.milestone','MISSING_MILESTONE','Stage\x20\x27'+_0x1fbd77['name']+_0xea9667(0x27f),_0x393098,_0x3ab4b0));(!_0x1fbd77[_0xea9667(0x1e2)]||_0x1fbd77[_0xea9667(0x1e2)]['length']===0x0)&&_0x56a8dd['push'](createIssue(_0xea9667(0x1f4),_0x3ab4b0+'.exit_criteria',_0xea9667(0x267),_0xea9667(0x239)+_0x1fbd77[_0xea9667(0x21f)]+_0xea9667(0x25f),_0x393098,_0x3ab4b0));const _0x9a546=_0x1fbd77['steps']?.['length']??0x0;if(_0x9a546===0x0)_0x56a8dd[_0xea9667(0x1e9)](createIssue(_0xea9667(0x225),_0x3ab4b0+_0xea9667(0x224),_0xea9667(0x280),'Stage\x20\x27'+_0x1fbd77[_0xea9667(0x21f)]+_0xea9667(0x288),_0x393098,_0x3ab4b0+_0xea9667(0x224)));else{if(_0x9a546===0x1)_0x56a8dd[_0xea9667(0x1e9)](createIssue(_0xea9667(0x1f4),_0x3ab4b0+'.steps',_0xea9667(0x280),_0xea9667(0x239)+_0x1fbd77[_0xea9667(0x21f)]+_0xea9667(0x275),_0x393098,_0x3ab4b0+_0xea9667(0x224)));else _0x9a546<=0x3&&_0x56a8dd['push'](createIssue('warning',_0x3ab4b0+'.steps','FEW_STEPS',_0xea9667(0x239)+_0x1fbd77[_0xea9667(0x21f)]+'\x27\x20has\x20only\x20'+_0x9a546+_0xea9667(0x231),_0x393098,_0x3ab4b0+_0xea9667(0x224)));}return _0x56a8dd;}function validateStep(_0x3a3d16,_0x50118f,_0x59ff80,_0x2f219b){const _0x580906=a146_0x6b41,_0x337cc4=[];if(_0x3a3d16['type']==='end')return _0x3a3d16[_0x580906(0x238)]&&_0x337cc4[_0x580906(0x1e9)](createIssue(_0x580906(0x225),_0x50118f+_0x580906(0x209),'END_STEP_HAS_NEXT_OR_WITH',_0x580906(0x1ef)+_0x3a3d16[_0x580906(0x21f)]+'\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field',_0x59ff80)),'with'in _0x3a3d16&&_0x3a3d16[_0x580906(0x1e1)]!==undefined&&_0x337cc4[_0x580906(0x1e9)](createIssue(_0x580906(0x225),_0x50118f+_0x580906(0x27c),_0x580906(0x269),_0x580906(0x1ef)+_0x3a3d16[_0x580906(0x21f)]+_0x580906(0x235),_0x59ff80)),_0x337cc4;_0x3a3d16[_0x580906(0x238)]&&(_0x59ff80[_0x580906(0x254)]&&!_0x59ff80[_0x580906(0x254)][_0x580906(0x204)](_0x3a3d16[_0x580906(0x238)])&&_0x337cc4[_0x580906(0x1e9)](createIssue('error',_0x50118f+_0x580906(0x209),'INVALID_NEXT_REFERENCE','Step\x20references\x20non-existent\x20step\x20\x27'+_0x3a3d16['next']+'\x27',_0x59ff80)));switch(_0x3a3d16[_0x580906(0x287)]){case _0x580906(0x27e):_0x337cc4[_0x580906(0x1e9)](...validateWaitStep(_0x3a3d16,_0x50118f,_0x59ff80,_0x2f219b));break;case'activation':_0x337cc4['push'](...validateActivationStep(_0x3a3d16,_0x50118f,_0x59ff80));break;case'decision_point':_0x337cc4[_0x580906(0x1e9)](...validateDecisionPointStep(_0x3a3d16,_0x50118f,_0x59ff80,_0x2f219b));break;case _0x580906(0x24a):_0x337cc4[_0x580906(0x1e9)](...validateAbTestStep(_0x3a3d16,_0x50118f,_0x59ff80,_0x2f219b));break;case'jump':_0x337cc4[_0x580906(0x1e9)](...validateJumpStep(_0x3a3d16,_0x50118f,_0x59ff80));break;}return _0x337cc4;}function validateWaitStep(_0x1d1968,_0x54d636,_0x84727e,_0x41c4ef){const _0x195429=a146_0x6b41,_0xdf66a8=[];if(!_0x1d1968[_0x195429(0x1e1)])return _0xdf66a8['push'](createIssue(_0x195429(0x225),_0x54d636+'.with','MISSING_WAIT_PARAMS','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field',_0x84727e,_0x54d636)),_0xdf66a8;if(_0x1d1968['with'][_0x195429(0x215)]){const _0x204c0a=_0x1d1968[_0x195429(0x1e1)][_0x195429(0x215)];if(_0x204c0a[_0x195429(0x258)]){_0x84727e[_0x195429(0x20a)]?.[_0x195429(0x27d)](_0x204c0a['segment']);!_0x204c0a[_0x195429(0x258)][_0x195429(0x1e6)](_0x195429(0x20c))&&(_0x84727e[_0x195429(0x263)]&&!_0x84727e[_0x195429(0x263)][_0x195429(0x204)](_0x204c0a[_0x195429(0x258)])&&_0xdf66a8[_0x195429(0x1e9)](createIssue(_0x195429(0x225),_0x54d636+_0x195429(0x266),_0x195429(0x232),_0x195429(0x21e)+_0x204c0a[_0x195429(0x258)]+_0x195429(0x1d9),_0x84727e)));_0x204c0a['next']&&_0x84727e[_0x195429(0x254)]&&!_0x84727e[_0x195429(0x254)][_0x195429(0x204)](_0x204c0a[_0x195429(0x238)])&&_0xdf66a8[_0x195429(0x1e9)](createIssue(_0x195429(0x225),_0x54d636+_0x195429(0x23f),_0x195429(0x240),_0x195429(0x210)+_0x204c0a[_0x195429(0x238)]+'\x27',_0x84727e));_0x204c0a[_0x195429(0x20f)]?.[_0x195429(0x238)]&&_0x84727e[_0x195429(0x254)]&&!_0x84727e[_0x195429(0x254)][_0x195429(0x204)](_0x204c0a[_0x195429(0x20f)][_0x195429(0x238)])&&_0xdf66a8[_0x195429(0x1e9)](createIssue(_0x195429(0x225),_0x54d636+'.with.condition.timeout.next','INVALID_NEXT_REFERENCE','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27'+_0x204c0a[_0x195429(0x20f)][_0x195429(0x238)]+'\x27',_0x84727e));const _0x4b8161=_0x204c0a[_0x195429(0x238)]||_0x1d1968['next'],_0x2b58d3=_0x204c0a[_0x195429(0x20f)]?.[_0x195429(0x238)]||_0x1d1968['next'];if(_0x4b8161){const _0xd8d75d=_0x41c4ef['get'](_0x4b8161);_0xd8d75d?.[_0x195429(0x287)]===_0x195429(0x277)&&_0xdf66a8[_0x195429(0x1e9)](createIssue('warning',_0x54d636+_0x195429(0x23f),'BRANCH_DIRECTLY_TO_MERGE',_0x195429(0x252)+_0x4b8161+_0x195429(0x237),_0x84727e,_0x54d636+_0x195429(0x230)));}if(_0x2b58d3){const _0x3e58d9=_0x41c4ef[_0x195429(0x241)](_0x2b58d3);_0x3e58d9?.[_0x195429(0x287)]===_0x195429(0x277)&&_0xdf66a8['push'](createIssue(_0x195429(0x1f4),_0x54d636+'.with.condition.timeout.next','BRANCH_DIRECTLY_TO_MERGE',_0x195429(0x23e)+_0x2b58d3+_0x195429(0x237),_0x84727e,_0x54d636+_0x195429(0x249)));}}}return _0xdf66a8;}function a146_0x3f87(){const _0x25e70a=['\x27\x20has\x20no\x20end\x20step','\x20(across\x20','152ZANUbb','8068938moNNKw','.with.branches[','variant\x20\x27','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','entry_criteria','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','name','2606913GBOhrx','.segment','BRANCH_DIRECTLY_TO_MERGE','size','.steps','error','match','segments','.rule','level','.steps[','3083325uumTdY','A/B\x20test\x20variant\x20\x27','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','.milestone','state','.with.condition','\x20steps\x20(may\x20be\x20too\x20simple)','MISSING_SEGMENT_REFERENCE','journey\x20entry','excluded','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','next','Stage\x20\x27','source','message','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','CONVERGENCE_WITHOUT_MERGE','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.with.condition.next','INVALID_NEXT_REFERENCE','get','percentage','MISSING_GOAL','segments.','document','Activation\x20step\x20requires\x20an\x20activation\x20reference','2985230FfFkro','join','.with.condition.timeout','ab_test','4385424GhEHYU','every','sort','Embedded\x20segment\x20\x27','keys','\x20stages\x20but\x20maximum\x20is\x20','steps','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Journey\x20name\x20is\x20required','stepNames','decision_point','MISSING_NAME','Criteria\x20references\x20undefined\x20segment\x20\x27','segment','includes','378410YkbpqL','DUPLICATE_LATEST','condition\x20of\x20\x27','branches','activationKeys','\x27\x20has\x20no\x20exit_criteria\x20defined','UNUSED_EMBEDDED_SEGMENT','\x27\x20(first\x20defined\x20at\x20steps[','.with.variants','embeddedSegments','goalIsInherited','symbol','.with.condition.segment','MISSING_EXIT_CRITERIA','Journey\x20can\x20have\x20at\x20most\x20one\x20','END_STEP_HAS_NEXT_OR_WITH','.type','\x27\x20with\x20no\x20action\x20in\x20between','launched','MISSING_CONDITIONS','version','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','skipSchema','some','set','\x27\x20(from:\x20','JOURNEY_SCHEMA_ERROR','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','.exit_criteria[','merge','Decision\x20branch\x20\x27','.entry_criteria','stages','reduce','.with','add','wait','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','INSUFFICIENT_STEPS','SINGLE_INPUT_MERGE','.with.branches','Merge\x20step\x20\x27','journeys','.with.target','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','type','\x27\x20has\x20no\x20steps','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','entries','issues','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','INVALID_AB_TEST_PERCENTAGES','replace','activation',').\x20Merge\x20is\x20unnecessary.','with','exit_criteria','activations','INVALID_JUMP_TARGET','step\x20\x27','startsWith','10265402tARNgp','target','push','Jump\x20step\x20requires\x20a\x20target','map','MISSING_ENTRY_CRITERIA','5BzASIP','.name','End\x20step\x20\x27','Journey\x20has\x20no\x20goal\x20defined','indices','values','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','warning','milestone','rule','MISSING_ACTIVATION_DEFINITION','versions','.with.activation','MERGE_TO_MERGE_CHAIN','journeys[','length','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','description','stages[','TOO_MANY_STAGES','branch\x20\x27','journey','variants','has','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','success','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','path','.next','referencedSegments','DUPLICATE_STEP_NAME','ref:','goal','trim','timeout','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','splice','abs','MISSING_STAGES','\x20versions)','condition'];a146_0x3f87=function(){return _0x25e70a;};return a146_0x3f87();}function validateActivationStep(_0x3878e4,_0x4c150d,_0x1c5bb9){const _0x435d52=a146_0x6b41,_0x48048f=[];if(!_0x3878e4[_0x435d52(0x1e1)]?.['activation'])return _0x48048f[_0x435d52(0x1e9)](createIssue('error',_0x4c150d+_0x435d52(0x1f9),'MISSING_ACTIVATION_REF',_0x435d52(0x246),_0x1c5bb9,_0x4c150d)),_0x48048f;const _0x2c91c3=_0x3878e4[_0x435d52(0x1e1)][_0x435d52(0x1df)];return _0x1c5bb9[_0x435d52(0x25e)]&&!_0x2c91c3[_0x435d52(0x1e6)](_0x435d52(0x20c))&&(!_0x1c5bb9[_0x435d52(0x25e)]['has'](_0x2c91c3)&&_0x48048f[_0x435d52(0x1e9)](createIssue(_0x435d52(0x225),_0x4c150d+_0x435d52(0x1f9),_0x435d52(0x1f7),_0x435d52(0x26f)+_0x2c91c3+_0x435d52(0x286),_0x1c5bb9))),_0x48048f;}function validateDecisionPointStep(_0xee63d8,_0x3ce6f3,_0x28afcf,_0x120ff6){const _0x3be37a=a146_0x6b41,_0x54a23c=[];if(!_0xee63d8[_0x3be37a(0x1e1)]?.[_0x3be37a(0x25d)]||_0xee63d8[_0x3be37a(0x1e1)][_0x3be37a(0x25d)][_0x3be37a(0x1fc)]===0x0)return _0x54a23c[_0x3be37a(0x1e9)](createIssue(_0x3be37a(0x225),_0x3ce6f3+_0x3be37a(0x282),'MISSING_CONDITIONS',_0x3be37a(0x1fd),_0x28afcf,_0x3ce6f3)),_0x54a23c;for(let _0x2c0820=0x0;_0x2c0820<_0xee63d8[_0x3be37a(0x1e1)][_0x3be37a(0x25d)][_0x3be37a(0x1fc)];_0x2c0820++){const _0x84da2c=_0xee63d8['with'][_0x3be37a(0x25d)][_0x2c0820],_0xbc4a8c=_0x3ce6f3+_0x3be37a(0x21a)+_0x2c0820+']';_0x84da2c['segment']&&!_0x84da2c[_0x3be37a(0x234)]&&(_0x28afcf[_0x3be37a(0x20a)]?.[_0x3be37a(0x27d)](_0x84da2c['segment']),!_0x84da2c['segment']['startsWith'](_0x3be37a(0x20c))&&(_0x28afcf[_0x3be37a(0x263)]&&!_0x28afcf['embeddedSegments']['has'](_0x84da2c[_0x3be37a(0x258)])&&_0x54a23c[_0x3be37a(0x1e9)](createIssue('error',_0xbc4a8c+_0x3be37a(0x221),_0x3be37a(0x232),_0x3be37a(0x236)+_0x84da2c[_0x3be37a(0x258)]+'\x27',_0x28afcf))));_0x84da2c[_0x3be37a(0x238)]&&_0x28afcf[_0x3be37a(0x254)]&&!_0x28afcf[_0x3be37a(0x254)]['has'](_0x84da2c[_0x3be37a(0x238)])&&_0x54a23c['push'](createIssue(_0x3be37a(0x225),_0xbc4a8c+_0x3be37a(0x209),'INVALID_NEXT_REFERENCE',_0x3be37a(0x22d)+_0x84da2c[_0x3be37a(0x238)]+'\x27',_0x28afcf));if(_0x84da2c[_0x3be37a(0x238)]){const _0x5beae2=_0x120ff6[_0x3be37a(0x241)](_0x84da2c['next']);_0x5beae2?.[_0x3be37a(0x287)]==='merge'&&_0x54a23c[_0x3be37a(0x1e9)](createIssue(_0x3be37a(0x1f4),_0xbc4a8c+_0x3be37a(0x209),'BRANCH_DIRECTLY_TO_MERGE',_0x3be37a(0x278)+_0x84da2c['name']+_0x3be37a(0x23c)+_0x84da2c[_0x3be37a(0x238)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x28afcf));}}return _0x54a23c;}function validateAbTestStep(_0x3c17f4,_0x11e188,_0x462e3e,_0x556ff3){const _0x14ce03=a146_0x6b41,_0x97cfda=[];if(!_0x3c17f4['with']?.[_0x14ce03(0x203)]||_0x3c17f4[_0x14ce03(0x1e1)]['variants']['length']===0x0)return _0x97cfda['push'](createIssue(_0x14ce03(0x225),_0x11e188+_0x14ce03(0x262),_0x14ce03(0x26d),_0x14ce03(0x207),_0x462e3e,_0x11e188)),_0x97cfda;const _0xf8b6c2=_0x3c17f4[_0x14ce03(0x1e1)]['variants'][_0x14ce03(0x27b)]((_0x4471d6,_0x5f12ac)=>_0x4471d6+(_0x5f12ac[_0x14ce03(0x242)]||0x0),0x0);Math[_0x14ce03(0x212)](_0xf8b6c2-0x64)>0.01&&_0x97cfda[_0x14ce03(0x1e9)](createIssue(_0x14ce03(0x225),_0x11e188+'.with.variants',_0x14ce03(0x1dd),'A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20'+_0xf8b6c2+'%)',_0x462e3e));for(let _0x37e57c=0x0;_0x37e57c<_0x3c17f4[_0x14ce03(0x1e1)][_0x14ce03(0x203)][_0x14ce03(0x1fc)];_0x37e57c++){const _0x46858d=_0x3c17f4[_0x14ce03(0x1e1)][_0x14ce03(0x203)][_0x37e57c],_0x29dd1d=_0x11e188+'.with.variants['+_0x37e57c+']';_0x46858d[_0x14ce03(0x238)]&&_0x462e3e[_0x14ce03(0x254)]&&!_0x462e3e[_0x14ce03(0x254)][_0x14ce03(0x204)](_0x46858d[_0x14ce03(0x238)])&&_0x97cfda[_0x14ce03(0x1e9)](createIssue(_0x14ce03(0x225),_0x29dd1d+_0x14ce03(0x209),_0x14ce03(0x240),'A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27'+_0x46858d[_0x14ce03(0x238)]+'\x27',_0x462e3e));if(_0x46858d[_0x14ce03(0x238)]){const _0x11bc6a=_0x556ff3[_0x14ce03(0x241)](_0x46858d[_0x14ce03(0x238)]);_0x11bc6a?.[_0x14ce03(0x287)]==='merge'&&_0x97cfda[_0x14ce03(0x1e9)](createIssue(_0x14ce03(0x1f4),_0x29dd1d+_0x14ce03(0x209),_0x14ce03(0x222),_0x14ce03(0x22c)+_0x46858d['name']+_0x14ce03(0x23c)+_0x46858d[_0x14ce03(0x238)]+_0x14ce03(0x26b),_0x462e3e));}}return _0x97cfda;}function validateJumpStep(_0x1ac3d4,_0x55a518,_0x2010ac){const _0x5bd453=a146_0x6b41,_0xb5b045=[];if(!_0x1ac3d4[_0x5bd453(0x1e1)]?.[_0x5bd453(0x1e8)])return _0xb5b045[_0x5bd453(0x1e9)](createIssue('error',_0x55a518+_0x5bd453(0x285),_0x5bd453(0x1e4),_0x5bd453(0x1ea),_0x2010ac,_0x55a518)),_0xb5b045;return(!_0x1ac3d4[_0x5bd453(0x1e1)][_0x5bd453(0x1e8)][_0x5bd453(0x202)]||!_0x1ac3d4[_0x5bd453(0x1e1)][_0x5bd453(0x1e8)]['stage'])&&_0xb5b045['push'](createIssue(_0x5bd453(0x225),_0x55a518+_0x5bd453(0x285),'INVALID_JUMP_TARGET','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names',_0x2010ac)),_0xb5b045;}function buildConvergenceMap(_0x53169e){const _0x3d573f=a146_0x6b41,_0x2be9c3=new Map();function _0x21c3c3(_0x116af4,_0x33f86f){const _0x38d3c6=a146_0x6b41,_0x3aad2f=_0x2be9c3['get'](_0x116af4)||[];_0x3aad2f[_0x38d3c6(0x1e9)](_0x33f86f),_0x2be9c3['set'](_0x116af4,_0x3aad2f);}for(const _0x3c024a of _0x53169e){_0x3c024a[_0x3d573f(0x238)]&&_0x21c3c3(_0x3c024a[_0x3d573f(0x238)],{'stepName':_0x3c024a['name'],'description':_0x3d573f(0x1e5)+_0x3c024a[_0x3d573f(0x21f)]+'\x27'});if(_0x3c024a[_0x3d573f(0x287)]===_0x3d573f(0x255)&&_0x3c024a[_0x3d573f(0x1e1)]?.[_0x3d573f(0x25d)])for(const _0x7767e9 of _0x3c024a[_0x3d573f(0x1e1)][_0x3d573f(0x25d)]){_0x7767e9[_0x3d573f(0x238)]&&_0x21c3c3(_0x7767e9[_0x3d573f(0x238)],{'stepName':_0x3c024a['name'],'description':_0x3d573f(0x201)+_0x7767e9[_0x3d573f(0x21f)]+'\x27\x20of\x20\x27'+_0x3c024a[_0x3d573f(0x21f)]+'\x27'});}if(_0x3c024a[_0x3d573f(0x287)]==='ab_test'&&_0x3c024a[_0x3d573f(0x1e1)]?.['variants'])for(const _0x2dd5bf of _0x3c024a[_0x3d573f(0x1e1)]['variants']){_0x2dd5bf[_0x3d573f(0x238)]&&_0x21c3c3(_0x2dd5bf[_0x3d573f(0x238)],{'stepName':_0x3c024a[_0x3d573f(0x21f)],'description':_0x3d573f(0x21b)+_0x2dd5bf['name']+'\x27\x20of\x20\x27'+_0x3c024a[_0x3d573f(0x21f)]+'\x27'});}_0x3c024a[_0x3d573f(0x287)]===_0x3d573f(0x27e)&&_0x3c024a['with']?.[_0x3d573f(0x215)]&&(_0x3c024a[_0x3d573f(0x1e1)]['condition'][_0x3d573f(0x238)]&&_0x21c3c3(_0x3c024a['with'][_0x3d573f(0x215)]['next'],{'stepName':_0x3c024a[_0x3d573f(0x21f)],'description':_0x3d573f(0x25c)+_0x3c024a[_0x3d573f(0x21f)]+'\x27'}),_0x3c024a[_0x3d573f(0x1e1)][_0x3d573f(0x215)][_0x3d573f(0x20f)]?.[_0x3d573f(0x238)]&&_0x21c3c3(_0x3c024a['with'][_0x3d573f(0x215)][_0x3d573f(0x20f)][_0x3d573f(0x238)],{'stepName':_0x3c024a[_0x3d573f(0x21f)],'description':'timeout\x20of\x20\x27'+_0x3c024a['name']+'\x27'}));}return _0x2be9c3;}function validateFlowControl(_0x425128,_0x5bcee2,_0x461857){const _0x3686c0=a146_0x6b41,_0x54d3c8=[],_0x43a6fd='stages['+_0x5bcee2+']',_0x18891c=_0x425128[_0x3686c0(0x251)]||[];if(_0x18891c['length']===0x0)return _0x54d3c8;const _0x3bcb0e=new Map();for(const _0x4d13e9 of _0x18891c){_0x4d13e9[_0x3686c0(0x21f)]&&_0x3bcb0e['set'](_0x4d13e9[_0x3686c0(0x21f)],_0x4d13e9);}const _0x4e683a=buildConvergenceMap(_0x18891c),_0x8d461f=_0x18891c[_0x3686c0(0x271)](_0x427adb=>_0x427adb[_0x3686c0(0x287)]==='end');!_0x8d461f&&_0x54d3c8[_0x3686c0(0x1e9)](createIssue(_0x3686c0(0x225),_0x43a6fd+_0x3686c0(0x224),'MISSING_END_STEP',_0x3686c0(0x239)+_0x425128['name']+_0x3686c0(0x216),_0x461857));for(const [_0x5e06ce,_0x1f022e]of _0x4e683a){const _0x3d6304=_0x3bcb0e[_0x3686c0(0x241)](_0x5e06ce);if(!_0x3d6304)continue;if(_0x1f022e['length']>0x1&&_0x3d6304[_0x3686c0(0x287)]!==_0x3686c0(0x277)){const _0x45846a=_0x1f022e['map'](_0x1b7761=>_0x1b7761[_0x3686c0(0x1fe)])[_0x3686c0(0x248)](',\x20');_0x54d3c8['push'](createIssue('error',_0x43a6fd+_0x3686c0(0x224),_0x3686c0(0x23d),_0x3686c0(0x1dc)+_0x5e06ce+_0x3686c0(0x273)+_0x45846a+').\x20Use\x20a\x20merge\x20step.',_0x461857));}_0x1f022e[_0x3686c0(0x1fc)]===0x1&&_0x3d6304[_0x3686c0(0x287)]===_0x3686c0(0x277)&&_0x54d3c8['push'](createIssue(_0x3686c0(0x1f4),_0x43a6fd+_0x3686c0(0x224),_0x3686c0(0x281),_0x3686c0(0x283)+_0x5e06ce+'\x27\x20has\x20only\x20one\x20input\x20(from:\x20'+_0x1f022e[0x0]['description']+_0x3686c0(0x1e0),_0x461857));}for(const _0x44bd50 of _0x18891c){if(_0x44bd50[_0x3686c0(0x287)]===_0x3686c0(0x277)&&_0x44bd50[_0x3686c0(0x238)]){const _0x2f269c=_0x3bcb0e['get'](_0x44bd50[_0x3686c0(0x238)]);_0x2f269c?.[_0x3686c0(0x287)]===_0x3686c0(0x277)&&_0x54d3c8[_0x3686c0(0x1e9)](createIssue(_0x3686c0(0x225),_0x43a6fd+_0x3686c0(0x224),_0x3686c0(0x1fa),'Merge\x20step\x20\x27'+_0x44bd50[_0x3686c0(0x21f)]+_0x3686c0(0x205)+_0x44bd50[_0x3686c0(0x238)]+'\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.',_0x461857));}}return _0x54d3c8;}function validateCriteria(_0x19200e,_0x40f18a,_0x45644f){const _0xd384e2=a146_0x6b41,_0x55ae6e=[];return _0x19200e[_0xd384e2(0x258)]&&(_0x45644f['referencedSegments']?.[_0xd384e2(0x27d)](_0x19200e[_0xd384e2(0x258)]),!_0x19200e[_0xd384e2(0x258)][_0xd384e2(0x1e6)](_0xd384e2(0x20c))&&(_0x45644f[_0xd384e2(0x263)]&&!_0x45644f['embeddedSegments'][_0xd384e2(0x204)](_0x19200e['segment'])&&_0x55ae6e[_0xd384e2(0x1e9)](createIssue(_0xd384e2(0x225),_0x40f18a+'.segment','MISSING_SEGMENT_REFERENCE',_0xd384e2(0x257)+_0x19200e[_0xd384e2(0x258)]+'\x27',_0x45644f)))),_0x55ae6e;}function validateEmbeddedSegment(_0x5d2491,_0x3f081a,_0x1f44b7){const _0x4ac396=a146_0x6b41,_0x3eb63d=[];return _0x5d2491[_0x4ac396(0x1f6)]&&_0x3eb63d[_0x4ac396(0x1e9)](...validateRuleDef(_0x5d2491[_0x4ac396(0x1f6)],_0x3f081a+_0x4ac396(0x228),_0x1f44b7)),_0x3eb63d;}function validateStage(_0x541fef,_0x454f54,_0x59e169,_0x1f577e){const _0x212b01=a146_0x6b41,_0x2c6a0a=[],_0x53445f=_0x212b01(0x1ff)+_0x454f54+']',_0x580657=new Map(),_0x4c6d7d=new Map();if(_0x541fef[_0x212b01(0x251)]){for(let _0x296f90=0x0;_0x296f90<_0x541fef[_0x212b01(0x251)]['length'];_0x296f90++){const _0x56bca7=_0x541fef[_0x212b01(0x251)][_0x296f90];_0x56bca7['name']&&_0x580657['set'](_0x56bca7[_0x212b01(0x21f)],_0x56bca7);}for(let _0x2cde56=0x0;_0x2cde56<_0x541fef[_0x212b01(0x251)][_0x212b01(0x1fc)];_0x2cde56++){const _0x26f184=_0x541fef[_0x212b01(0x251)][_0x2cde56],_0x3a727c=_0x53445f+_0x212b01(0x22a)+_0x2cde56+']';if(_0x26f184['name']){if(_0x4c6d7d[_0x212b01(0x204)](_0x26f184[_0x212b01(0x21f)])){const _0x2a1a8c=_0x4c6d7d[_0x212b01(0x241)](_0x26f184['name']);_0x2c6a0a[_0x212b01(0x1e9)](createIssue(_0x212b01(0x225),_0x3a727c+_0x212b01(0x1ee),_0x212b01(0x20b),'Duplicate\x20step\x20name\x20\x27'+_0x26f184['name']+_0x212b01(0x261)+_0x2a1a8c+'])',_0x1f577e));}else _0x4c6d7d[_0x212b01(0x272)](_0x26f184[_0x212b01(0x21f)],_0x2cde56);}_0x2c6a0a[_0x212b01(0x1e9)](...validateStep(_0x26f184,_0x3a727c,_0x1f577e,_0x580657));}}_0x541fef[_0x212b01(0x21d)]&&_0x2c6a0a[_0x212b01(0x1e9)](...validateCriteria(_0x541fef['entry_criteria'],_0x53445f+_0x212b01(0x279),_0x1f577e));if(_0x541fef[_0x212b01(0x1e2)])for(let _0x2846dd=0x0;_0x2846dd<_0x541fef[_0x212b01(0x1e2)][_0x212b01(0x1fc)];_0x2846dd++){_0x2c6a0a[_0x212b01(0x1e9)](...validateCriteria(_0x541fef[_0x212b01(0x1e2)][_0x2846dd],_0x53445f+_0x212b01(0x276)+_0x2846dd+']',_0x1f577e));}return _0x541fef[_0x212b01(0x1f5)]&&_0x2c6a0a[_0x212b01(0x1e9)](...validateCriteria(_0x541fef[_0x212b01(0x1f5)],_0x53445f+_0x212b01(0x22e),_0x1f577e)),_0x2c6a0a[_0x212b01(0x1e9)](...validateStageStructure(_0x541fef,_0x454f54,_0x59e169,_0x1f577e)),_0x2c6a0a['push'](...validateFlowControl(_0x541fef,_0x454f54,_0x1f577e)),_0x2c6a0a;}function validateStagesForVersion(_0xa172bb,_0x4d7673,_0x583d75,_0x132065,_0x37225b,_0x11c98e,_0x1fc6e7){const _0x4ac453=a146_0x6b41;if(_0xa172bb[_0x4ac453(0x1fc)]===0x0){_0x37225b[_0x4ac453(0x1e9)]({'level':_0x4ac453(0x225),'path':_0x132065+_0x4ac453(0x27a),'code':'MISSING_STAGES','message':_0x4ac453(0x21c),'location':getLocationFromPath(_0x583d75[_0x4ac453(0x245)],_0x583d75['source'],[_0x4ac453(0x27a)])});return;}const _0x5f08a6=new Set();for(const _0x40fa0d of _0xa172bb){if(_0x40fa0d[_0x4ac453(0x251)])for(const _0x4d321f of _0x40fa0d[_0x4ac453(0x251)]){_0x4d321f[_0x4ac453(0x21f)]&&_0x5f08a6[_0x4ac453(0x27d)](_0x4d321f[_0x4ac453(0x21f)]);}}const _0x380dc2={..._0x583d75,'stepNames':_0x5f08a6},_0x3a013a=validateVersionStructure(_0xa172bb,_0x380dc2);for(const _0x5b7725 of _0x3a013a){const _0x3d42e9=_0x132065?{..._0x5b7725,'path':''+_0x132065+_0x5b7725[_0x4ac453(0x208)]}:_0x5b7725;if(_0x3d42e9[_0x4ac453(0x229)]===_0x4ac453(0x225))_0x37225b[_0x4ac453(0x1e9)](_0x3d42e9);else _0x11c98e['push'](_0x3d42e9);}for(let _0xf85ab0=0x0;_0xf85ab0<_0xa172bb[_0x4ac453(0x1fc)];_0xf85ab0++){const _0xcb2764=validateStage(_0xa172bb[_0xf85ab0],_0xf85ab0,_0xa172bb[_0x4ac453(0x1fc)],_0x380dc2);for(const _0x4e5671 of _0xcb2764){const _0xfee5a3=_0x132065?{..._0x4e5671,'path':''+_0x132065+_0x4e5671[_0x4ac453(0x208)]}:_0x4e5671;if(_0xfee5a3[_0x4ac453(0x229)]===_0x4ac453(0x225))_0x37225b['push'](_0xfee5a3);else _0x11c98e[_0x4ac453(0x1e9)](_0xfee5a3);}}if(_0x4d7673['goal']){const _0x3e4abc=_0x1fc6e7?.[_0x4ac453(0x264)]?_0x4ac453(0x20d):_0x132065+_0x4ac453(0x20d),_0x13a1c1=validateCriteria(_0x4d7673[_0x4ac453(0x20d)],_0x3e4abc,_0x380dc2);for(const _0x4ec5a4 of _0x13a1c1){if(_0x4ec5a4['level']==='error')_0x37225b[_0x4ac453(0x1e9)](_0x4ec5a4);else _0x11c98e[_0x4ac453(0x1e9)](_0x4ec5a4);}}}function extractVersionIndex(_0x4f4baf){const _0x34d5a5=a146_0x6b41,_0x3efdfd=_0x4f4baf[_0x34d5a5(0x226)](/^journeys\[(\d+)\]\./);return _0x3efdfd?_0x3efdfd[0x1]:undefined;}function deduplicateAcrossVersions(_0x3e253a){const _0x4f77e5=a146_0x6b41,_0x55f462=new Map();for(let _0x55f11d=0x0;_0x55f11d<_0x3e253a[_0x4f77e5(0x1fc)];_0x55f11d++){const _0x3f6b15=_0x3e253a[_0x55f11d]['code']+':'+_0x3e253a[_0x55f11d]['message'],_0x51590d=extractVersionIndex(_0x3e253a[_0x55f11d][_0x4f77e5(0x208)]),_0x564fec=_0x55f462[_0x4f77e5(0x241)](_0x3f6b15);if(_0x564fec){_0x564fec[_0x4f77e5(0x1f1)][_0x4f77e5(0x1e9)](_0x55f11d);if(_0x51590d)_0x564fec[_0x4f77e5(0x1f8)][_0x4f77e5(0x27d)](_0x51590d);}else _0x55f462['set'](_0x3f6b15,{'indices':[_0x55f11d],'versions':new Set(_0x51590d?[_0x51590d]:[])});}const _0x2b0819=new Set();for(const {indices:_0x544e0d,versions:_0x110d75}of _0x55f462[_0x4f77e5(0x1f2)]()){if(_0x110d75[_0x4f77e5(0x223)]<=0x1)continue;const _0x1a1526=_0x3e253a[_0x544e0d[0x0]];_0x1a1526['path']=_0x1a1526['path'][_0x4f77e5(0x1de)](/^journeys\[\d+\]\./,''),_0x1a1526[_0x4f77e5(0x23b)]=_0x1a1526['message']+_0x4f77e5(0x217)+_0x110d75['size']+_0x4f77e5(0x214);for(let _0x14813b=0x1;_0x14813b<_0x544e0d[_0x4f77e5(0x1fc)];_0x14813b++){_0x2b0819[_0x4f77e5(0x27d)](_0x544e0d[_0x14813b]);}}const _0x1817e8=[..._0x2b0819][_0x4f77e5(0x24d)]((_0x37b622,_0x2b9e4a)=>_0x2b9e4a-_0x37b622);for(const _0x36cf52 of _0x1817e8){_0x3e253a[_0x4f77e5(0x211)](_0x36cf52,0x1);}}export function validateJourneyDef(_0x41843f,_0x92b988={},_0x57b6d3={}){const _0x4c3a12=a146_0x6b41;if(_0x57b6d3[_0x4c3a12(0x270)])return runJourneySemanticChecks(_0x41843f,_0x92b988);const _0x3dd487=JourneyDefSchema['safeParse'](_0x41843f);if(_0x3dd487[_0x4c3a12(0x206)])return runJourneySemanticChecks(_0x3dd487['data'],_0x92b988);return zodErrorsToJourneyValidationResult(_0x3dd487['error'],_0x92b988);}function zodErrorsToJourneyValidationResult(_0x48a421,_0x81f7ee){const _0xd43a05=a146_0x6b41,_0x290d36=flattenZodIssues(_0x48a421[_0xd43a05(0x1db)]),_0x3b602b=_0x290d36[_0xd43a05(0x1eb)](_0x45355b=>{const _0x95efd7=_0xd43a05,_0x222fd2=formatZodPath(_0x45355b[_0x95efd7(0x208)]),_0x1ec88e=mapJourneyZodIssueToCode(_0x45355b,_0x222fd2),_0x30f85e=getLocationFromPath(_0x81f7ee[_0x95efd7(0x245)],_0x81f7ee[_0x95efd7(0x23a)],_0x45355b[_0x95efd7(0x208)]['map'](_0x518962=>typeof _0x518962===_0x95efd7(0x265)?String(_0x518962):_0x518962));return{'level':'error','path':_0x222fd2,'code':_0x1ec88e,'message':_0x45355b[_0x95efd7(0x23b)],..._0x30f85e&&{'location':_0x30f85e}};});return{'valid':![],'errors':_0x3b602b,'warnings':[]};}function mapJourneyZodIssueToCode(_0xd60e60,_0x50598f){const _0x3fe330=a146_0x6b41;if(_0x50598f===_0x3fe330(0x21f))return _0x3fe330(0x256);if(_0x50598f['endsWith'](_0x3fe330(0x26a))&&_0x50598f['includes'](_0x3fe330(0x251)))return _0x3fe330(0x274);if(_0x50598f===_0x3fe330(0x27a)||_0x50598f['endsWith']('.stages'))return _0x3fe330(0x213);if(_0x50598f===''&&_0xd60e60[_0x3fe330(0x23b)][_0x3fe330(0x259)]('journeys,\x20stages,\x20or\x20versions'))return _0x3fe330(0x213);if(_0x50598f[_0x3fe330(0x259)](_0x3fe330(0x1df)))return'ACTIVATION_SCHEMA_ERROR';return _0x3fe330(0x274);}function runJourneySemanticChecks(_0x27f10c,_0x419ab8){const _0x16a650=a146_0x6b41,_0x269558=[],_0x431e70=[];(!_0x27f10c[_0x16a650(0x21f)]||_0x27f10c[_0x16a650(0x21f)][_0x16a650(0x20e)]()==='')&&_0x269558[_0x16a650(0x1e9)]({'level':'error','path':_0x16a650(0x21f),'code':'MISSING_NAME','message':_0x16a650(0x253),'location':getLocationFromPath(_0x419ab8['document'],_0x419ab8[_0x16a650(0x23a)],[_0x16a650(0x21f)])});const _0x5529c1=new Set();if(_0x27f10c[_0x16a650(0x227)])for(const _0x4cef03 of Object[_0x16a650(0x24f)](_0x27f10c['segments'])){_0x5529c1['add'](_0x4cef03);}const _0xa05eb9=new Set();if(_0x27f10c['activations'])for(const _0x1558e8 of Object[_0x16a650(0x24f)](_0x27f10c[_0x16a650(0x1e3)])){_0xa05eb9['add'](_0x1558e8);}const _0x1af38a=new Set(),_0x393a04={..._0x419ab8,'embeddedSegments':_0x5529c1,'referencedSegments':_0x1af38a,'activationKeys':_0xa05eb9[_0x16a650(0x223)]>0x0?_0xa05eb9:undefined};if(_0x27f10c[_0x16a650(0x227)])for(const [_0x2de646,_0x46ab1e]of Object[_0x16a650(0x1da)](_0x27f10c[_0x16a650(0x227)])){const _0xe31007=validateEmbeddedSegment(_0x46ab1e,_0x16a650(0x244)+_0x2de646,_0x393a04);for(const _0x5f3241 of _0xe31007){if(_0x5f3241[_0x16a650(0x229)]===_0x16a650(0x225))_0x269558['push'](_0x5f3241);else _0x431e70[_0x16a650(0x1e9)](_0x5f3241);}}const _0x58aa01=!!_0x27f10c[_0x16a650(0x20d)],_0xc34a2=_0x27f10c['journeys']?.[_0x16a650(0x24c)](_0x16ce02=>!!_0x16ce02[_0x16a650(0x20d)])??![];!_0x58aa01&&!_0xc34a2&&_0x431e70['push']({'level':_0x16a650(0x1f4),'path':'goal','code':_0x16a650(0x243),'message':_0x16a650(0x1f0),'location':getLocationFromPath(_0x419ab8[_0x16a650(0x245)],_0x419ab8[_0x16a650(0x23a)],['goal'])});const _0xc3b84d=_0x27f10c['journeys']??_0x27f10c[_0x16a650(0x1f8)];if(_0xc3b84d&&_0xc3b84d['filter'](_0x50ffcd=>_0x50ffcd['latest']===!![])[_0x16a650(0x1fc)]>0x1){const _0x571836=_0x27f10c['journeys']?_0x16a650(0x284):_0x16a650(0x1f8);_0x269558[_0x16a650(0x1e9)]({'level':_0x16a650(0x225),'path':_0x571836,'code':_0x16a650(0x25b),'message':_0x16a650(0x268)+(_0x571836===_0x16a650(0x284)?_0x16a650(0x233):_0x16a650(0x26e))+'\x20with\x20latest:\x20true','location':getLocationFromPath(_0x419ab8[_0x16a650(0x245)],_0x419ab8[_0x16a650(0x23a)],[_0x571836])});}if(_0x27f10c[_0x16a650(0x284)]&&_0x27f10c[_0x16a650(0x284)][_0x16a650(0x1fc)]>0x0)for(let _0x58f86e=0x0;_0x58f86e<_0x27f10c[_0x16a650(0x284)][_0x16a650(0x1fc)];_0x58f86e++){const _0x579c98=_0x27f10c[_0x16a650(0x284)][_0x58f86e];if(_0x27f10c[_0x16a650(0x284)]['length']>0x1&&_0x579c98[_0x16a650(0x22f)]===_0x16a650(0x26c))continue;const _0x4ae46f=_0x579c98[_0x16a650(0x27a)]||[],_0x1cd9cd=_0x16a650(0x1fb)+_0x58f86e+'].',_0x523f8d=!!_0x579c98[_0x16a650(0x20d)],_0x23b4e6=_0x523f8d?{..._0x27f10c,'goal':_0x579c98[_0x16a650(0x20d)]}:_0x27f10c;validateStagesForVersion(_0x4ae46f,_0x23b4e6,_0x393a04,_0x1cd9cd,_0x269558,_0x431e70,{'goalIsInherited':!_0x523f8d});}else{if(_0x27f10c[_0x16a650(0x1f8)]&&_0x27f10c[_0x16a650(0x1f8)]['length']>0x0)for(let _0x2dc555=0x0;_0x2dc555<_0x27f10c[_0x16a650(0x1f8)]['length'];_0x2dc555++){const _0x13e45d=_0x27f10c[_0x16a650(0x1f8)][_0x2dc555];if(_0x27f10c[_0x16a650(0x1f8)][_0x16a650(0x1fc)]>0x1&&_0x13e45d[_0x16a650(0x22f)]==='launched')continue;const _0x440958=_0x13e45d['stages']||[],_0x2d752a='versions['+_0x2dc555+'].';validateStagesForVersion(_0x440958,_0x27f10c,_0x393a04,_0x2d752a,_0x269558,_0x431e70);}else{const _0x3bc1b2=_0x27f10c[_0x16a650(0x27a)]||[];validateStagesForVersion(_0x3bc1b2,_0x27f10c,_0x393a04,'',_0x269558,_0x431e70);}}_0x27f10c[_0x16a650(0x284)]&&_0x27f10c[_0x16a650(0x284)][_0x16a650(0x1fc)]>0x1&&(deduplicateAcrossVersions(_0x269558),deduplicateAcrossVersions(_0x431e70));for(const _0x29a898 of _0x5529c1){!_0x1af38a[_0x16a650(0x204)](_0x29a898)&&!_0x29a898['startsWith']('excluded_')&&_0x431e70[_0x16a650(0x1e9)]({'level':_0x16a650(0x1f4),'path':'segments.'+_0x29a898,'code':_0x16a650(0x260),'message':_0x16a650(0x24e)+_0x29a898+_0x16a650(0x1f3),'location':getLocationFromPath(_0x419ab8[_0x16a650(0x245)],_0x419ab8[_0x16a650(0x23a)],[_0x16a650(0x227),_0x29a898])});}return{'valid':_0x269558['length']===0x0,'errors':_0x269558,'warnings':_0x431e70};}
|
|
1
|
+
(function(_0x2a3e4c,_0x2b83e2){const _0x358b3a=a146_0x39ea,_0x22fc50=_0x2a3e4c();while(!![]){try{const _0x37ce8e=parseInt(_0x358b3a(0xf8))/0x1+parseInt(_0x358b3a(0xaa))/0x2*(parseInt(_0x358b3a(0x10d))/0x3)+parseInt(_0x358b3a(0x142))/0x4+parseInt(_0x358b3a(0xb2))/0x5*(-parseInt(_0x358b3a(0xdc))/0x6)+-parseInt(_0x358b3a(0x15d))/0x7+parseInt(_0x358b3a(0x12a))/0x8*(parseInt(_0x358b3a(0xd5))/0x9)+-parseInt(_0x358b3a(0x151))/0xa;if(_0x37ce8e===_0x2b83e2)break;else _0x22fc50['push'](_0x22fc50['shift']());}catch(_0x3c6c43){_0x22fc50['push'](_0x22fc50['shift']());}}}(a146_0x58f2,0x77f6f));import{JourneyDefSchema}from'./types/journey-schema.js';function a146_0x39ea(_0xc7e80b,_0x5c48db){_0xc7e80b=_0xc7e80b-0xa8;const _0x58f2d1=a146_0x58f2();let _0x39ea8a=_0x58f2d1[_0xc7e80b];return _0x39ea8a;}import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x27539f,_0x44f32d,_0x10e3d0,_0xc21164,_0x213016,_0x2806db){const _0x50db8e=a146_0x39ea;return{'level':_0x27539f,'path':_0x44f32d,'code':_0x10e3d0,'message':_0xc21164,'location':getLocationFromPath(_0x213016[_0x50db8e(0xe1)],_0x213016['source'],pathToArray(_0x2806db??_0x44f32d))};}function validateVersionStructure(_0x122892,_0x475d9e){const _0x221301=a146_0x39ea,_0xe266e=[];return _0x122892[_0x221301(0x156)]>MAX_STAGES&&_0xe266e[_0x221301(0x13c)](createIssue(_0x221301(0xc7),_0x221301(0x120),_0x221301(0xb9),'Journey\x20has\x20'+_0x122892[_0x221301(0x156)]+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x475d9e)),_0xe266e;}function validateStageStructure(_0x2f98d1,_0x2188a1,_0x3be7be,_0x2a8290){const _0x1b6b1e=a146_0x39ea,_0x20b278=[],_0x35a808=_0x1b6b1e(0x15c)+_0x2188a1+']';_0x2188a1===0x0&&!_0x2f98d1[_0x1b6b1e(0x111)]&&_0x20b278[_0x1b6b1e(0x13c)](createIssue(_0x1b6b1e(0xc7),_0x35a808+_0x1b6b1e(0x11a),'MISSING_ENTRY_CRITERIA',_0x1b6b1e(0xcf)+_0x2f98d1[_0x1b6b1e(0xc9)]+_0x1b6b1e(0xe9),_0x2a8290,_0x35a808));const _0xd062ba=_0x2188a1===_0x3be7be-0x1;!_0xd062ba&&!_0x2f98d1['milestone']&&_0x20b278['push'](createIssue('error',_0x35a808+_0x1b6b1e(0xfd),'MISSING_MILESTONE','Stage\x20\x27'+_0x2f98d1[_0x1b6b1e(0xc9)]+'\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone',_0x2a8290,_0x35a808));(!_0x2f98d1[_0x1b6b1e(0xab)]||_0x2f98d1['exit_criteria']['length']===0x0)&&_0x20b278[_0x1b6b1e(0x13c)](createIssue('warning',_0x35a808+_0x1b6b1e(0x150),_0x1b6b1e(0xd8),_0x1b6b1e(0xcf)+_0x2f98d1['name']+_0x1b6b1e(0xda),_0x2a8290,_0x35a808));const _0x10457e=_0x2f98d1[_0x1b6b1e(0xd4)]?.['length']??0x0;if(_0x10457e===0x0)_0x20b278[_0x1b6b1e(0x13c)](createIssue('error',_0x35a808+_0x1b6b1e(0xd9),_0x1b6b1e(0x10c),'Stage\x20\x27'+_0x2f98d1['name']+_0x1b6b1e(0x144),_0x2a8290,_0x35a808+_0x1b6b1e(0xd9)));else{if(_0x10457e===0x1)_0x20b278['push'](createIssue('warning',_0x35a808+_0x1b6b1e(0xd9),_0x1b6b1e(0x10c),'Stage\x20\x27'+_0x2f98d1[_0x1b6b1e(0xc9)]+_0x1b6b1e(0xf9),_0x2a8290,_0x35a808+'.steps'));else _0x10457e<=0x3&&_0x20b278[_0x1b6b1e(0x13c)](createIssue(_0x1b6b1e(0xe3),_0x35a808+_0x1b6b1e(0xd9),_0x1b6b1e(0xe6),_0x1b6b1e(0xcf)+_0x2f98d1['name']+'\x27\x20has\x20only\x20'+_0x10457e+_0x1b6b1e(0xad),_0x2a8290,_0x35a808+'.steps'));}return _0x20b278;}function validateStep(_0x265748,_0x3f5e89,_0x5c10d2,_0x10ebe6){const _0x45a810=a146_0x39ea,_0x502a4b=[];if(_0x265748[_0x45a810(0xb7)]===_0x45a810(0x13a))return _0x265748['next']&&_0x502a4b[_0x45a810(0x13c)](createIssue('error',_0x3f5e89+_0x45a810(0x148),_0x45a810(0x12e),_0x45a810(0xce)+_0x265748[_0x45a810(0xc9)]+_0x45a810(0x14c),_0x5c10d2)),_0x45a810(0x102)in _0x265748&&_0x265748[_0x45a810(0x102)]!==undefined&&_0x502a4b[_0x45a810(0x13c)](createIssue('error',_0x3f5e89+'.with',_0x45a810(0x12e),_0x45a810(0xce)+_0x265748[_0x45a810(0xc9)]+_0x45a810(0xb1),_0x5c10d2)),_0x502a4b;_0x265748['next']&&(_0x5c10d2[_0x45a810(0xe8)]&&!_0x5c10d2['stepNames']['has'](_0x265748[_0x45a810(0xd0)])&&_0x502a4b[_0x45a810(0x13c)](createIssue('error',_0x3f5e89+'.next',_0x45a810(0x126),'Step\x20references\x20non-existent\x20step\x20\x27'+_0x265748[_0x45a810(0xd0)]+'\x27',_0x5c10d2)));switch(_0x265748[_0x45a810(0xb7)]){case _0x45a810(0x146):_0x502a4b[_0x45a810(0x13c)](...validateWaitStep(_0x265748,_0x3f5e89,_0x5c10d2,_0x10ebe6));break;case _0x45a810(0xc5):_0x502a4b[_0x45a810(0x13c)](...validateActivationStep(_0x265748,_0x3f5e89,_0x5c10d2));break;case'decision_point':_0x502a4b[_0x45a810(0x13c)](...validateDecisionPointStep(_0x265748,_0x3f5e89,_0x5c10d2,_0x10ebe6));break;case _0x45a810(0x10a):_0x502a4b[_0x45a810(0x13c)](...validateAbTestStep(_0x265748,_0x3f5e89,_0x5c10d2,_0x10ebe6));break;case'jump':_0x502a4b[_0x45a810(0x13c)](...validateJumpStep(_0x265748,_0x3f5e89,_0x5c10d2));break;}return _0x502a4b;}function validateWaitStep(_0x5cbceb,_0x353307,_0x2b1232,_0x4f537e){const _0x4593f8=a146_0x39ea,_0x494895=[];if(!_0x5cbceb['with'])return _0x494895[_0x4593f8(0x13c)](createIssue(_0x4593f8(0xc7),_0x353307+_0x4593f8(0xbd),_0x4593f8(0x159),'Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field',_0x2b1232,_0x353307)),_0x494895;if(_0x5cbceb[_0x4593f8(0x102)][_0x4593f8(0x13d)]){const _0x19b605=_0x5cbceb[_0x4593f8(0x102)][_0x4593f8(0x13d)];if(_0x19b605[_0x4593f8(0xac)]){_0x2b1232[_0x4593f8(0x116)]?.[_0x4593f8(0x122)](_0x19b605[_0x4593f8(0xac)]);!_0x19b605['segment'][_0x4593f8(0xba)](_0x4593f8(0xec))&&(_0x2b1232[_0x4593f8(0x136)]&&!_0x2b1232[_0x4593f8(0x136)][_0x4593f8(0xd6)](_0x19b605[_0x4593f8(0xac)])&&_0x494895['push'](createIssue('error',_0x353307+_0x4593f8(0x10e),'MISSING_SEGMENT_REFERENCE',_0x4593f8(0x12d)+_0x19b605[_0x4593f8(0xac)]+_0x4593f8(0x137),_0x2b1232)));_0x19b605[_0x4593f8(0xd0)]&&_0x2b1232[_0x4593f8(0xe8)]&&!_0x2b1232[_0x4593f8(0xe8)][_0x4593f8(0xd6)](_0x19b605[_0x4593f8(0xd0)])&&_0x494895[_0x4593f8(0x13c)](createIssue(_0x4593f8(0xc7),_0x353307+_0x4593f8(0xc6),_0x4593f8(0x126),'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x19b605[_0x4593f8(0xd0)]+'\x27',_0x2b1232));_0x19b605[_0x4593f8(0x130)]?.[_0x4593f8(0xd0)]&&_0x2b1232[_0x4593f8(0xe8)]&&!_0x2b1232[_0x4593f8(0xe8)][_0x4593f8(0xd6)](_0x19b605['timeout'][_0x4593f8(0xd0)])&&_0x494895[_0x4593f8(0x13c)](createIssue(_0x4593f8(0xc7),_0x353307+_0x4593f8(0xb5),_0x4593f8(0x126),_0x4593f8(0xc1)+_0x19b605[_0x4593f8(0x130)]['next']+'\x27',_0x2b1232));const _0x1b80d2=_0x19b605[_0x4593f8(0xd0)]||_0x5cbceb[_0x4593f8(0xd0)],_0x30060a=_0x19b605['timeout']?.[_0x4593f8(0xd0)]||_0x5cbceb[_0x4593f8(0xd0)];if(_0x1b80d2){const _0x460da0=_0x4f537e[_0x4593f8(0x105)](_0x1b80d2);_0x460da0?.[_0x4593f8(0xb7)]===_0x4593f8(0xd7)&&_0x494895[_0x4593f8(0x13c)](createIssue('warning',_0x353307+_0x4593f8(0xc6),_0x4593f8(0xcd),_0x4593f8(0xd1)+_0x1b80d2+_0x4593f8(0x12f),_0x2b1232,_0x353307+_0x4593f8(0xe4)));}if(_0x30060a){const _0x594f2f=_0x4f537e['get'](_0x30060a);_0x594f2f?.[_0x4593f8(0xb7)]===_0x4593f8(0xd7)&&_0x494895[_0x4593f8(0x13c)](createIssue(_0x4593f8(0xe3),_0x353307+'.with.condition.timeout.next',_0x4593f8(0xcd),_0x4593f8(0x141)+_0x30060a+_0x4593f8(0x12f),_0x2b1232,_0x353307+_0x4593f8(0xef)));}}}return _0x494895;}function validateActivationStep(_0x2c19b3,_0x2099cc,_0x10dae5){const _0x169081=a146_0x39ea,_0x270fd2=[];if(!_0x2c19b3[_0x169081(0x102)]?.['activation'])return _0x270fd2['push'](createIssue(_0x169081(0xc7),_0x2099cc+_0x169081(0x13b),_0x169081(0x104),_0x169081(0x106),_0x10dae5,_0x2099cc)),_0x270fd2;const _0x296b77=_0x2c19b3[_0x169081(0x102)]['activation'];return _0x10dae5[_0x169081(0x153)]&&!_0x296b77[_0x169081(0xba)](_0x169081(0xec))&&(!_0x10dae5[_0x169081(0x153)]['has'](_0x296b77)&&_0x270fd2[_0x169081(0x13c)](createIssue(_0x169081(0xc7),_0x2099cc+_0x169081(0x13b),_0x169081(0xc4),_0x169081(0x119)+_0x296b77+'\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.',_0x10dae5))),_0x270fd2;}function a146_0x58f2(){const _0x1b7e33=['.with.target','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','46190oNpeNj','.with.variants','join','.with.condition.timeout.next','endsWith','type','timeout\x20of\x20\x27','TOO_MANY_STAGES','startsWith','\x20with\x20latest:\x20true','issues','.with','DUPLICATE_LATEST','state','ACTIVATION_SCHEMA_ERROR','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','.stages','SINGLE_INPUT_MERGE','MISSING_ACTIVATION_DEFINITION','activation','.with.condition.next','error','Jump\x20step\x20requires\x20a\x20target','name','trim','skipSchema','stage','BRANCH_DIRECTLY_TO_MERGE','End\x20step\x20\x27','Stage\x20\x27','next','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','message','MERGE_TO_MERGE_CHAIN','steps','929187PaDByG','has','merge','MISSING_EXIT_CRITERIA','.steps','\x27\x20has\x20no\x20exit_criteria\x20defined','set','330cWaPxJ','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','match','.with.branches','replace','document','values','warning','.with.condition','journey\x20entry','FEW_STEPS','condition\x20of\x20\x27','stepNames','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','Decision\x20branch\x20\x27','journeys','ref:','Duplicate\x20step\x20name\x20\x27','version','.with.condition.timeout','activations','segments.','size','abs','\x27\x20of\x20\x27','journeys[','.with.branches[','target','913197KkBqTj','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','\x27\x20with\x20no\x20action\x20in\x20between','\x27\x20(from:\x20','.with.variants[','.milestone','.steps[','UNUSED_EMBEDDED_SEGMENT','safeParse','goalIsInherited','with','\x20(across\x20','MISSING_ACTIVATION_REF','get','Activation\x20step\x20requires\x20an\x20activation\x20reference','journey','launched','code','ab_test','.segment','INSUFFICIENT_STEPS','15gTuNYD','.with.condition.segment','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','step\x20\x27','entry_criteria','reduce','excluded','keys','goal','referencedSegments','branch\x20\x27','variants','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','.entry_criteria','branches','Embedded\x20segment\x20\x27','MISSING_CONDITIONS','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','decision_point','stages','latest','add','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','entries','level','INVALID_NEXT_REFERENCE','Merge\x20step\x20\x27','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','DUPLICATE_STEP_NAME','24sNAykM','\x27\x20has\x20no\x20end\x20step','map','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','END_STEP_HAS_NEXT_OR_WITH','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','timeout','splice','versions','source','milestone',').\x20Use\x20a\x20merge\x20step.','embeddedSegments','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','.name','INVALID_AB_TEST_PERCENTAGES','end','.with.activation','push','condition','MISSING_END_STEP','MISSING_STAGES','includes','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','2395904mOpXCX','segments','\x27\x20has\x20no\x20steps','.rule','wait','\x27\x20(first\x20defined\x20at\x20steps[','.next','MISSING_SEGMENT_REFERENCE','excluded_','percentage','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','filter','.exit_criteria','323520NMSota','path','activationKeys','A/B\x20test\x20variant\x20\x27','description','length','JOURNEY_SCHEMA_ERROR','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','MISSING_WAIT_PARAMS','rule','success','stages[','6113695WZWKcX','Criteria\x20references\x20undefined\x20segment\x20\x27','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.exit_criteria[','33320JHeTIQ','exit_criteria','segment','\x20steps\x20(may\x20be\x20too\x20simple)','some','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27'];a146_0x58f2=function(){return _0x1b7e33;};return a146_0x58f2();}function validateDecisionPointStep(_0x50e161,_0x2a85cd,_0x58c5a7,_0x5bb5aa){const _0x2cdc79=a146_0x39ea,_0x50a18f=[];if(!_0x50e161[_0x2cdc79(0x102)]?.[_0x2cdc79(0x11b)]||_0x50e161[_0x2cdc79(0x102)][_0x2cdc79(0x11b)][_0x2cdc79(0x156)]===0x0)return _0x50a18f['push'](createIssue(_0x2cdc79(0xc7),_0x2a85cd+_0x2cdc79(0xdf),'MISSING_CONDITIONS',_0x2cdc79(0x14e),_0x58c5a7,_0x2a85cd)),_0x50a18f;for(let _0x45479c=0x0;_0x45479c<_0x50e161[_0x2cdc79(0x102)][_0x2cdc79(0x11b)][_0x2cdc79(0x156)];_0x45479c++){const _0x5b46ce=_0x50e161[_0x2cdc79(0x102)]['branches'][_0x45479c],_0x4547ef=_0x2a85cd+_0x2cdc79(0xf6)+_0x45479c+']';_0x5b46ce[_0x2cdc79(0xac)]&&!_0x5b46ce[_0x2cdc79(0x113)]&&(_0x58c5a7[_0x2cdc79(0x116)]?.[_0x2cdc79(0x122)](_0x5b46ce[_0x2cdc79(0xac)]),!_0x5b46ce[_0x2cdc79(0xac)]['startsWith'](_0x2cdc79(0xec))&&(_0x58c5a7['embeddedSegments']&&!_0x58c5a7[_0x2cdc79(0x136)][_0x2cdc79(0xd6)](_0x5b46ce[_0x2cdc79(0xac)])&&_0x50a18f['push'](createIssue(_0x2cdc79(0xc7),_0x4547ef+'.segment',_0x2cdc79(0x149),_0x2cdc79(0x14d)+_0x5b46ce[_0x2cdc79(0xac)]+'\x27',_0x58c5a7))));_0x5b46ce[_0x2cdc79(0xd0)]&&_0x58c5a7[_0x2cdc79(0xe8)]&&!_0x58c5a7['stepNames']['has'](_0x5b46ce[_0x2cdc79(0xd0)])&&_0x50a18f[_0x2cdc79(0x13c)](createIssue(_0x2cdc79(0xc7),_0x4547ef+_0x2cdc79(0x148),'INVALID_NEXT_REFERENCE','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27'+_0x5b46ce[_0x2cdc79(0xd0)]+'\x27',_0x58c5a7));if(_0x5b46ce['next']){const _0x14f928=_0x5bb5aa[_0x2cdc79(0x105)](_0x5b46ce[_0x2cdc79(0xd0)]);_0x14f928?.['type']==='merge'&&_0x50a18f[_0x2cdc79(0x13c)](createIssue(_0x2cdc79(0xe3),_0x4547ef+'.next',_0x2cdc79(0xcd),_0x2cdc79(0xea)+_0x5b46ce[_0x2cdc79(0xc9)]+_0x2cdc79(0xa8)+_0x5b46ce[_0x2cdc79(0xd0)]+_0x2cdc79(0xfa),_0x58c5a7));}}return _0x50a18f;}function validateAbTestStep(_0x28c146,_0x12a20d,_0x20c213,_0x789e38){const _0xedad6f=a146_0x39ea,_0x11b5c0=[];if(!_0x28c146[_0xedad6f(0x102)]?.[_0xedad6f(0x118)]||_0x28c146[_0xedad6f(0x102)][_0xedad6f(0x118)][_0xedad6f(0x156)]===0x0)return _0x11b5c0[_0xedad6f(0x13c)](createIssue(_0xedad6f(0xc7),_0x12a20d+_0xedad6f(0xb3),_0xedad6f(0x11d),_0xedad6f(0x158),_0x20c213,_0x12a20d)),_0x11b5c0;const _0x249faa=_0x28c146[_0xedad6f(0x102)][_0xedad6f(0x118)][_0xedad6f(0x112)]((_0x17dc80,_0x2203f9)=>_0x17dc80+(_0x2203f9[_0xedad6f(0x14b)]||0x0),0x0);Math[_0xedad6f(0xf3)](_0x249faa-0x64)>0.01&&_0x11b5c0['push'](createIssue(_0xedad6f(0xc7),_0x12a20d+'.with.variants',_0xedad6f(0x139),_0xedad6f(0x128)+_0x249faa+'%)',_0x20c213));for(let _0x169190=0x0;_0x169190<_0x28c146[_0xedad6f(0x102)][_0xedad6f(0x118)][_0xedad6f(0x156)];_0x169190++){const _0x38f8df=_0x28c146[_0xedad6f(0x102)][_0xedad6f(0x118)][_0x169190],_0x2351d2=_0x12a20d+_0xedad6f(0xfc)+_0x169190+']';_0x38f8df['next']&&_0x20c213[_0xedad6f(0xe8)]&&!_0x20c213[_0xedad6f(0xe8)][_0xedad6f(0xd6)](_0x38f8df['next'])&&_0x11b5c0['push'](createIssue('error',_0x2351d2+_0xedad6f(0x148),_0xedad6f(0x126),_0xedad6f(0x11e)+_0x38f8df['next']+'\x27',_0x20c213));if(_0x38f8df[_0xedad6f(0xd0)]){const _0x10266d=_0x789e38[_0xedad6f(0x105)](_0x38f8df[_0xedad6f(0xd0)]);_0x10266d?.[_0xedad6f(0xb7)]===_0xedad6f(0xd7)&&_0x11b5c0[_0xedad6f(0x13c)](createIssue(_0xedad6f(0xe3),_0x2351d2+_0xedad6f(0x148),_0xedad6f(0xcd),_0xedad6f(0x154)+_0x38f8df[_0xedad6f(0xc9)]+_0xedad6f(0xa8)+_0x38f8df[_0xedad6f(0xd0)]+_0xedad6f(0xfa),_0x20c213));}}return _0x11b5c0;}function validateJumpStep(_0x3a5dab,_0xd3a623,_0x546fd7){const _0x5b3ab6=a146_0x39ea,_0xc83717=[];if(!_0x3a5dab[_0x5b3ab6(0x102)]?.[_0x5b3ab6(0xf7)])return _0xc83717['push'](createIssue('error',_0xd3a623+'.with.target','INVALID_JUMP_TARGET',_0x5b3ab6(0xc8),_0x546fd7,_0xd3a623)),_0xc83717;return(!_0x3a5dab[_0x5b3ab6(0x102)][_0x5b3ab6(0xf7)][_0x5b3ab6(0x107)]||!_0x3a5dab[_0x5b3ab6(0x102)][_0x5b3ab6(0xf7)][_0x5b3ab6(0xcc)])&&_0xc83717['push'](createIssue(_0x5b3ab6(0xc7),_0xd3a623+_0x5b3ab6(0xb0),'INVALID_JUMP_TARGET',_0x5b3ab6(0xdd),_0x546fd7)),_0xc83717;}function buildConvergenceMap(_0x27580f){const _0x297739=a146_0x39ea,_0x48fbce=new Map();function _0x3f4674(_0x294d15,_0x752c48){const _0x2649ba=a146_0x39ea,_0x2f267c=_0x48fbce[_0x2649ba(0x105)](_0x294d15)||[];_0x2f267c[_0x2649ba(0x13c)](_0x752c48),_0x48fbce[_0x2649ba(0xdb)](_0x294d15,_0x2f267c);}for(const _0x229cad of _0x27580f){_0x229cad['next']&&_0x3f4674(_0x229cad[_0x297739(0xd0)],{'stepName':_0x229cad[_0x297739(0xc9)],'description':_0x297739(0x110)+_0x229cad[_0x297739(0xc9)]+'\x27'});if(_0x229cad['type']===_0x297739(0x11f)&&_0x229cad[_0x297739(0x102)]?.['branches'])for(const _0x523107 of _0x229cad['with'][_0x297739(0x11b)]){_0x523107['next']&&_0x3f4674(_0x523107[_0x297739(0xd0)],{'stepName':_0x229cad['name'],'description':_0x297739(0x117)+_0x523107[_0x297739(0xc9)]+_0x297739(0xf4)+_0x229cad['name']+'\x27'});}if(_0x229cad['type']===_0x297739(0x10a)&&_0x229cad[_0x297739(0x102)]?.[_0x297739(0x118)])for(const _0x1f3778 of _0x229cad['with']['variants']){_0x1f3778[_0x297739(0xd0)]&&_0x3f4674(_0x1f3778['next'],{'stepName':_0x229cad[_0x297739(0xc9)],'description':'variant\x20\x27'+_0x1f3778[_0x297739(0xc9)]+_0x297739(0xf4)+_0x229cad['name']+'\x27'});}_0x229cad['type']===_0x297739(0x146)&&_0x229cad[_0x297739(0x102)]?.[_0x297739(0x13d)]&&(_0x229cad[_0x297739(0x102)]['condition'][_0x297739(0xd0)]&&_0x3f4674(_0x229cad[_0x297739(0x102)][_0x297739(0x13d)][_0x297739(0xd0)],{'stepName':_0x229cad[_0x297739(0xc9)],'description':_0x297739(0xe7)+_0x229cad[_0x297739(0xc9)]+'\x27'}),_0x229cad[_0x297739(0x102)][_0x297739(0x13d)][_0x297739(0x130)]?.['next']&&_0x3f4674(_0x229cad['with'][_0x297739(0x13d)][_0x297739(0x130)][_0x297739(0xd0)],{'stepName':_0x229cad['name'],'description':_0x297739(0xb8)+_0x229cad[_0x297739(0xc9)]+'\x27'}));}return _0x48fbce;}function validateFlowControl(_0x56ce30,_0x4ae9f1,_0x32e69b){const _0x1d6f76=a146_0x39ea,_0x207474=[],_0x2de717=_0x1d6f76(0x15c)+_0x4ae9f1+']',_0x48ed38=_0x56ce30[_0x1d6f76(0xd4)]||[];if(_0x48ed38['length']===0x0)return _0x207474;const _0x541deb=new Map();for(const _0x51f663 of _0x48ed38){_0x51f663['name']&&_0x541deb[_0x1d6f76(0xdb)](_0x51f663[_0x1d6f76(0xc9)],_0x51f663);}const _0x3283c9=buildConvergenceMap(_0x48ed38),_0x4388bf=_0x48ed38[_0x1d6f76(0xae)](_0x2a98b1=>_0x2a98b1[_0x1d6f76(0xb7)]===_0x1d6f76(0x13a));!_0x4388bf&&_0x207474[_0x1d6f76(0x13c)](createIssue('error',_0x2de717+_0x1d6f76(0xd9),_0x1d6f76(0x13e),'Stage\x20\x27'+_0x56ce30[_0x1d6f76(0xc9)]+_0x1d6f76(0x12b),_0x32e69b));for(const [_0x40b524,_0x42cf26]of _0x3283c9){const _0x5f2820=_0x541deb['get'](_0x40b524);if(!_0x5f2820)continue;if(_0x42cf26[_0x1d6f76(0x156)]>0x1&&_0x5f2820[_0x1d6f76(0xb7)]!==_0x1d6f76(0xd7)){const _0x80bdfe=_0x42cf26['map'](_0x8de523=>_0x8de523[_0x1d6f76(0x155)])[_0x1d6f76(0xb4)](',\x20');_0x207474['push'](createIssue('error',_0x2de717+_0x1d6f76(0xd9),'CONVERGENCE_WITHOUT_MERGE',_0x1d6f76(0xaf)+_0x40b524+_0x1d6f76(0xfb)+_0x80bdfe+_0x1d6f76(0x135),_0x32e69b));}_0x42cf26['length']===0x1&&_0x5f2820[_0x1d6f76(0xb7)]===_0x1d6f76(0xd7)&&_0x207474[_0x1d6f76(0x13c)](createIssue('warning',_0x2de717+_0x1d6f76(0xd9),_0x1d6f76(0xc3),_0x1d6f76(0x127)+_0x40b524+_0x1d6f76(0x123)+_0x42cf26[0x0]['description']+').\x20Merge\x20is\x20unnecessary.',_0x32e69b));}for(const _0x3c410a of _0x48ed38){if(_0x3c410a[_0x1d6f76(0xb7)]===_0x1d6f76(0xd7)&&_0x3c410a[_0x1d6f76(0xd0)]){const _0x4b20aa=_0x541deb[_0x1d6f76(0x105)](_0x3c410a['next']);_0x4b20aa?.[_0x1d6f76(0xb7)]===_0x1d6f76(0xd7)&&_0x207474[_0x1d6f76(0x13c)](createIssue(_0x1d6f76(0xc7),_0x2de717+_0x1d6f76(0xd9),_0x1d6f76(0xd3),_0x1d6f76(0x127)+_0x3c410a[_0x1d6f76(0xc9)]+'\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27'+_0x3c410a[_0x1d6f76(0xd0)]+'\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.',_0x32e69b));}}return _0x207474;}function validateCriteria(_0x50c383,_0x5f58cc,_0x25b280){const _0x2b1e89=a146_0x39ea,_0x46b6cb=[];return _0x50c383['segment']&&(_0x25b280[_0x2b1e89(0x116)]?.['add'](_0x50c383['segment']),!_0x50c383[_0x2b1e89(0xac)][_0x2b1e89(0xba)]('ref:')&&(_0x25b280[_0x2b1e89(0x136)]&&!_0x25b280[_0x2b1e89(0x136)][_0x2b1e89(0xd6)](_0x50c383[_0x2b1e89(0xac)])&&_0x46b6cb[_0x2b1e89(0x13c)](createIssue('error',_0x5f58cc+_0x2b1e89(0x10b),_0x2b1e89(0x149),_0x2b1e89(0x15e)+_0x50c383[_0x2b1e89(0xac)]+'\x27',_0x25b280)))),_0x46b6cb;}function validateEmbeddedSegment(_0x588282,_0x1b7f69,_0x23f13c){const _0x58e958=a146_0x39ea,_0x1a70e8=[];return _0x588282[_0x58e958(0x15a)]&&_0x1a70e8[_0x58e958(0x13c)](...validateRuleDef(_0x588282[_0x58e958(0x15a)],_0x1b7f69+_0x58e958(0x145),_0x23f13c)),_0x1a70e8;}function validateStage(_0x5a3cf2,_0x2803f7,_0x4ec7a3,_0x8c560c){const _0x5246bb=a146_0x39ea,_0x5dbe8f=[],_0x5544a0=_0x5246bb(0x15c)+_0x2803f7+']',_0x204cde=new Map(),_0x3de268=new Map();if(_0x5a3cf2[_0x5246bb(0xd4)]){for(let _0x43886b=0x0;_0x43886b<_0x5a3cf2['steps'][_0x5246bb(0x156)];_0x43886b++){const _0x2890bb=_0x5a3cf2['steps'][_0x43886b];_0x2890bb[_0x5246bb(0xc9)]&&_0x204cde[_0x5246bb(0xdb)](_0x2890bb[_0x5246bb(0xc9)],_0x2890bb);}for(let _0x4c2380=0x0;_0x4c2380<_0x5a3cf2[_0x5246bb(0xd4)][_0x5246bb(0x156)];_0x4c2380++){const _0x38534c=_0x5a3cf2[_0x5246bb(0xd4)][_0x4c2380],_0xe885aa=_0x5544a0+_0x5246bb(0xfe)+_0x4c2380+']';if(_0x38534c[_0x5246bb(0xc9)]){if(_0x3de268[_0x5246bb(0xd6)](_0x38534c['name'])){const _0x4872f2=_0x3de268[_0x5246bb(0x105)](_0x38534c['name']);_0x5dbe8f['push'](createIssue(_0x5246bb(0xc7),_0xe885aa+_0x5246bb(0x138),_0x5246bb(0x129),_0x5246bb(0xed)+_0x38534c[_0x5246bb(0xc9)]+_0x5246bb(0x147)+_0x4872f2+'])',_0x8c560c));}else _0x3de268[_0x5246bb(0xdb)](_0x38534c['name'],_0x4c2380);}_0x5dbe8f['push'](...validateStep(_0x38534c,_0xe885aa,_0x8c560c,_0x204cde));}}_0x5a3cf2[_0x5246bb(0x111)]&&_0x5dbe8f['push'](...validateCriteria(_0x5a3cf2[_0x5246bb(0x111)],_0x5544a0+_0x5246bb(0x11a),_0x8c560c));if(_0x5a3cf2['exit_criteria'])for(let _0x344e5a=0x0;_0x344e5a<_0x5a3cf2['exit_criteria'][_0x5246bb(0x156)];_0x344e5a++){_0x5dbe8f[_0x5246bb(0x13c)](...validateCriteria(_0x5a3cf2['exit_criteria'][_0x344e5a],_0x5544a0+_0x5246bb(0xa9)+_0x344e5a+']',_0x8c560c));}return _0x5a3cf2[_0x5246bb(0x134)]&&_0x5dbe8f[_0x5246bb(0x13c)](...validateCriteria(_0x5a3cf2[_0x5246bb(0x134)],_0x5544a0+'.milestone',_0x8c560c)),_0x5dbe8f[_0x5246bb(0x13c)](...validateStageStructure(_0x5a3cf2,_0x2803f7,_0x4ec7a3,_0x8c560c)),_0x5dbe8f[_0x5246bb(0x13c)](...validateFlowControl(_0x5a3cf2,_0x2803f7,_0x8c560c)),_0x5dbe8f;}function validateStagesForVersion(_0x113e5b,_0x55eed2,_0x1aedea,_0x3018e4,_0x2adf31,_0xe180a5,_0x12dd7e){const _0x37f978=a146_0x39ea;if(_0x113e5b['length']===0x0){_0x2adf31[_0x37f978(0x13c)]({'level':'error','path':_0x3018e4+'stages','code':_0x37f978(0x13f),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x1aedea['document'],_0x1aedea[_0x37f978(0x133)],[_0x37f978(0x120)])});return;}const _0x41cbd4=new Set();for(const _0x454abe of _0x113e5b){if(_0x454abe[_0x37f978(0xd4)])for(const _0x2213ec of _0x454abe[_0x37f978(0xd4)]){_0x2213ec[_0x37f978(0xc9)]&&_0x41cbd4[_0x37f978(0x122)](_0x2213ec[_0x37f978(0xc9)]);}}const _0x7db1b1={..._0x1aedea,'stepNames':_0x41cbd4},_0x1c17ef=validateVersionStructure(_0x113e5b,_0x7db1b1);for(const _0x2e5c42 of _0x1c17ef){const _0x5f54c0=_0x3018e4?{..._0x2e5c42,'path':''+_0x3018e4+_0x2e5c42[_0x37f978(0x152)]}:_0x2e5c42;if(_0x5f54c0[_0x37f978(0x125)]===_0x37f978(0xc7))_0x2adf31['push'](_0x5f54c0);else _0xe180a5[_0x37f978(0x13c)](_0x5f54c0);}for(let _0x240ea9=0x0;_0x240ea9<_0x113e5b[_0x37f978(0x156)];_0x240ea9++){const _0x140b33=validateStage(_0x113e5b[_0x240ea9],_0x240ea9,_0x113e5b[_0x37f978(0x156)],_0x7db1b1);for(const _0x26618f of _0x140b33){const _0x1f93fa=_0x3018e4?{..._0x26618f,'path':''+_0x3018e4+_0x26618f[_0x37f978(0x152)]}:_0x26618f;if(_0x1f93fa[_0x37f978(0x125)]==='error')_0x2adf31['push'](_0x1f93fa);else _0xe180a5['push'](_0x1f93fa);}}if(_0x55eed2[_0x37f978(0x115)]){const _0x507745=_0x12dd7e?.[_0x37f978(0x101)]?_0x37f978(0x115):_0x3018e4+_0x37f978(0x115),_0x53cbcc=validateCriteria(_0x55eed2[_0x37f978(0x115)],_0x507745,_0x7db1b1);for(const _0x54e333 of _0x53cbcc){if(_0x54e333[_0x37f978(0x125)]===_0x37f978(0xc7))_0x2adf31['push'](_0x54e333);else _0xe180a5['push'](_0x54e333);}}}function extractVersionIndex(_0x20bb62){const _0x4c74f7=a146_0x39ea,_0x471bbf=_0x20bb62[_0x4c74f7(0xde)](/^journeys\[(\d+)\]\./);return _0x471bbf?_0x471bbf[0x1]:undefined;}function deduplicateAcrossVersions(_0x3b2e5e){const _0x238e58=a146_0x39ea,_0x24b5ca=new Map();for(let _0x29fca6=0x0;_0x29fca6<_0x3b2e5e[_0x238e58(0x156)];_0x29fca6++){const _0x45d42b=_0x3b2e5e[_0x29fca6][_0x238e58(0x109)]+':'+_0x3b2e5e[_0x29fca6][_0x238e58(0xd2)],_0x5f4bbb=extractVersionIndex(_0x3b2e5e[_0x29fca6]['path']),_0x9a5be3=_0x24b5ca[_0x238e58(0x105)](_0x45d42b);if(_0x9a5be3){_0x9a5be3['indices'][_0x238e58(0x13c)](_0x29fca6);if(_0x5f4bbb)_0x9a5be3[_0x238e58(0x132)][_0x238e58(0x122)](_0x5f4bbb);}else _0x24b5ca['set'](_0x45d42b,{'indices':[_0x29fca6],'versions':new Set(_0x5f4bbb?[_0x5f4bbb]:[])});}const _0x2574a1=new Set();for(const {indices:_0x3db1cc,versions:_0xf9cccc}of _0x24b5ca[_0x238e58(0xe2)]()){if(_0xf9cccc[_0x238e58(0xf2)]<=0x1)continue;const _0x562545=_0x3b2e5e[_0x3db1cc[0x0]];_0x562545[_0x238e58(0x152)]=_0x562545[_0x238e58(0x152)][_0x238e58(0xe0)](/^journeys\[\d+\]\./,''),_0x562545[_0x238e58(0xd2)]=_0x562545[_0x238e58(0xd2)]+_0x238e58(0x103)+_0xf9cccc[_0x238e58(0xf2)]+'\x20versions)';for(let _0x55410e=0x1;_0x55410e<_0x3db1cc[_0x238e58(0x156)];_0x55410e++){_0x2574a1['add'](_0x3db1cc[_0x55410e]);}}const _0x4d917d=[..._0x2574a1]['sort']((_0x37446c,_0x21492a)=>_0x21492a-_0x37446c);for(const _0x438207 of _0x4d917d){_0x3b2e5e[_0x238e58(0x131)](_0x438207,0x1);}}export function validateJourneyDef(_0x4b6370,_0xb777c7={},_0x24f00d={}){const _0x2029d1=a146_0x39ea;if(_0x24f00d[_0x2029d1(0xcb)])return runJourneySemanticChecks(_0x4b6370,_0xb777c7);const _0x385f6b=JourneyDefSchema[_0x2029d1(0x100)](_0x4b6370);if(_0x385f6b[_0x2029d1(0x15b)])return runJourneySemanticChecks(_0x385f6b['data'],_0xb777c7);return zodErrorsToJourneyValidationResult(_0x385f6b[_0x2029d1(0xc7)],_0xb777c7);}function zodErrorsToJourneyValidationResult(_0x2fab97,_0x16b85d){const _0x2cc645=a146_0x39ea,_0x4c4865=flattenZodIssues(_0x2fab97[_0x2cc645(0xbc)]),_0x25ddb8=_0x4c4865[_0x2cc645(0x12c)](_0x141dcb=>{const _0x5ac4df=_0x2cc645,_0x398f24=formatZodPath(_0x141dcb['path']),_0x3b35f8=mapJourneyZodIssueToCode(_0x141dcb,_0x398f24),_0x1e8d20=getLocationFromPath(_0x16b85d[_0x5ac4df(0xe1)],_0x16b85d[_0x5ac4df(0x133)],_0x141dcb[_0x5ac4df(0x152)][_0x5ac4df(0x12c)](_0x2a741b=>typeof _0x2a741b==='symbol'?String(_0x2a741b):_0x2a741b));return{'level':_0x5ac4df(0xc7),'path':_0x398f24,'code':_0x3b35f8,'message':_0x141dcb[_0x5ac4df(0xd2)],..._0x1e8d20&&{'location':_0x1e8d20}};});return{'valid':![],'errors':_0x25ddb8,'warnings':[]};}function mapJourneyZodIssueToCode(_0x583fd7,_0x29781d){const _0x435233=a146_0x39ea;if(_0x29781d===_0x435233(0xc9))return'MISSING_NAME';if(_0x29781d[_0x435233(0xb6)]('.type')&&_0x29781d['includes'](_0x435233(0xd4)))return _0x435233(0x157);if(_0x29781d==='stages'||_0x29781d['endsWith'](_0x435233(0xc2)))return _0x435233(0x13f);if(_0x29781d===''&&_0x583fd7[_0x435233(0xd2)][_0x435233(0x140)]('journeys,\x20stages,\x20or\x20versions'))return'MISSING_STAGES';if(_0x29781d['includes'](_0x435233(0xc5)))return _0x435233(0xc0);return _0x435233(0x157);}function runJourneySemanticChecks(_0x2fafc7,_0x20d6b0){const _0x5edac8=a146_0x39ea,_0xf61971=[],_0x32f1db=[];(!_0x2fafc7[_0x5edac8(0xc9)]||_0x2fafc7['name'][_0x5edac8(0xca)]()==='')&&_0xf61971['push']({'level':_0x5edac8(0xc7),'path':_0x5edac8(0xc9),'code':'MISSING_NAME','message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x20d6b0[_0x5edac8(0xe1)],_0x20d6b0[_0x5edac8(0x133)],[_0x5edac8(0xc9)])});const _0x2c5e54=new Set();if(_0x2fafc7[_0x5edac8(0x143)])for(const _0xdf7d27 of Object['keys'](_0x2fafc7[_0x5edac8(0x143)])){_0x2c5e54[_0x5edac8(0x122)](_0xdf7d27);}const _0x345d06=new Set();if(_0x2fafc7[_0x5edac8(0xf0)])for(const _0x4bad61 of Object[_0x5edac8(0x114)](_0x2fafc7[_0x5edac8(0xf0)])){_0x345d06['add'](_0x4bad61);}const _0x44085b=new Set(),_0x543b79={..._0x20d6b0,'embeddedSegments':_0x2c5e54,'referencedSegments':_0x44085b,'activationKeys':_0x345d06['size']>0x0?_0x345d06:undefined};if(_0x2fafc7['segments'])for(const [_0x2d0b01,_0x2db14e]of Object[_0x5edac8(0x124)](_0x2fafc7['segments'])){const _0xdf303f=validateEmbeddedSegment(_0x2db14e,'segments.'+_0x2d0b01,_0x543b79);for(const _0x49020c of _0xdf303f){if(_0x49020c[_0x5edac8(0x125)]==='error')_0xf61971['push'](_0x49020c);else _0x32f1db[_0x5edac8(0x13c)](_0x49020c);}}const _0x277e5f=!!_0x2fafc7[_0x5edac8(0x115)],_0x4d6168=_0x2fafc7[_0x5edac8(0xeb)]?.['every'](_0x15b514=>!!_0x15b514[_0x5edac8(0x115)])??![];!_0x277e5f&&!_0x4d6168&&_0x32f1db[_0x5edac8(0x13c)]({'level':_0x5edac8(0xe3),'path':'goal','code':'MISSING_GOAL','message':'Journey\x20has\x20no\x20goal\x20defined','location':getLocationFromPath(_0x20d6b0['document'],_0x20d6b0[_0x5edac8(0x133)],['goal'])});const _0x5929a9=_0x2fafc7[_0x5edac8(0xeb)]??_0x2fafc7[_0x5edac8(0x132)];if(_0x5929a9&&_0x5929a9[_0x5edac8(0x14f)](_0x22a94d=>_0x22a94d[_0x5edac8(0x121)]===!![])[_0x5edac8(0x156)]>0x1){const _0x588ca8=_0x2fafc7['journeys']?_0x5edac8(0xeb):_0x5edac8(0x132);_0xf61971['push']({'level':_0x5edac8(0xc7),'path':_0x588ca8,'code':_0x5edac8(0xbe),'message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x588ca8===_0x5edac8(0xeb)?_0x5edac8(0xe5):_0x5edac8(0xee))+_0x5edac8(0xbb),'location':getLocationFromPath(_0x20d6b0['document'],_0x20d6b0[_0x5edac8(0x133)],[_0x588ca8])});}if(_0x2fafc7[_0x5edac8(0xeb)]&&_0x2fafc7[_0x5edac8(0xeb)]['length']>0x0)for(let _0x3e11b4=0x0;_0x3e11b4<_0x2fafc7[_0x5edac8(0xeb)][_0x5edac8(0x156)];_0x3e11b4++){const _0x1b0398=_0x2fafc7[_0x5edac8(0xeb)][_0x3e11b4];if(_0x2fafc7[_0x5edac8(0xeb)][_0x5edac8(0x156)]>0x1&&_0x1b0398[_0x5edac8(0xbf)]==='launched')continue;const _0x1e5ddb=_0x1b0398[_0x5edac8(0x120)]||[],_0x5058ba=_0x5edac8(0xf5)+_0x3e11b4+'].',_0x185f85=!!_0x1b0398[_0x5edac8(0x115)],_0x4d9691=_0x185f85?{..._0x2fafc7,'goal':_0x1b0398[_0x5edac8(0x115)]}:_0x2fafc7;validateStagesForVersion(_0x1e5ddb,_0x4d9691,_0x543b79,_0x5058ba,_0xf61971,_0x32f1db,{'goalIsInherited':!_0x185f85});}else{if(_0x2fafc7[_0x5edac8(0x132)]&&_0x2fafc7[_0x5edac8(0x132)]['length']>0x0)for(let _0x22beb8=0x0;_0x22beb8<_0x2fafc7[_0x5edac8(0x132)][_0x5edac8(0x156)];_0x22beb8++){const _0x1db044=_0x2fafc7['versions'][_0x22beb8];if(_0x2fafc7[_0x5edac8(0x132)][_0x5edac8(0x156)]>0x1&&_0x1db044['state']===_0x5edac8(0x108))continue;const _0x2cd1e4=_0x1db044[_0x5edac8(0x120)]||[],_0x10a2fb='versions['+_0x22beb8+'].';validateStagesForVersion(_0x2cd1e4,_0x2fafc7,_0x543b79,_0x10a2fb,_0xf61971,_0x32f1db);}else{const _0x13af41=_0x2fafc7[_0x5edac8(0x120)]||[];validateStagesForVersion(_0x13af41,_0x2fafc7,_0x543b79,'',_0xf61971,_0x32f1db);}}_0x2fafc7['journeys']&&_0x2fafc7[_0x5edac8(0xeb)][_0x5edac8(0x156)]>0x1&&(deduplicateAcrossVersions(_0xf61971),deduplicateAcrossVersions(_0x32f1db));for(const _0xcbe95d of _0x2c5e54){!_0x44085b[_0x5edac8(0xd6)](_0xcbe95d)&&!_0xcbe95d['startsWith'](_0x5edac8(0x14a))&&_0x32f1db[_0x5edac8(0x13c)]({'level':_0x5edac8(0xe3),'path':_0x5edac8(0xf1)+_0xcbe95d,'code':_0x5edac8(0xff),'message':_0x5edac8(0x11c)+_0xcbe95d+_0x5edac8(0x10f),'location':getLocationFromPath(_0x20d6b0[_0x5edac8(0xe1)],_0x20d6b0[_0x5edac8(0x133)],['segments',_0xcbe95d])});}return{'valid':_0xf61971[_0x5edac8(0x156)]===0x0,'errors':_0xf61971,'warnings':_0x32f1db};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x21e658,_0x1924c7){const _0x385b77=a147_0x4543,_0x3de1c5=_0x21e658();while(!![]){try{const _0x42c5f5=-parseInt(_0x385b77(0x12d))/0x1+-parseInt(_0x385b77(0x99))/0x2*(parseInt(_0x385b77(0x146))/0x3)+parseInt(_0x385b77(0x134))/0x4*(parseInt(_0x385b77(0x106))/0x5)+parseInt(_0x385b77(0xf4))/0x6+parseInt(_0x385b77(0xdc))/0x7+parseInt(_0x385b77(0xa5))/0x8*(-parseInt(_0x385b77(0xc3))/0x9)+-parseInt(_0x385b77(0x13d))/0xa*(-parseInt(_0x385b77(0x145))/0xb);if(_0x42c5f5===_0x1924c7)break;else _0x3de1c5['push'](_0x3de1c5['shift']());}catch(_0x2463af){_0x3de1c5['push'](_0x3de1c5['shift']());}}}(a147_0x2af7,0x82b14));import*as a147_0x3719d3 from'yaml';function a147_0x2af7(){const _0x863132=['6LlhMcx','goal:','activations:','activation_template_id','jump','get','merge','bundle_id','End','Jump','sort','name','Variant','versions','object','waitStepType','exitCriteria','reentryMode','624688ekDqab','find','timedOutPath','goal','*Max\x20wait\x20','DecisionPoint','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','isArray','resolveStageId','ref','description','segmentId','20624OpMOKC','exitCriterias','Journey\x20description','milestone','stringify','root_step','segment_id','stages:','Send\x20Notification','uniqueId','segments','Goal\x20Achieved','all_columns','end','unique_id','Merge','push','resolveSegmentName','day','filter','journeyStages','set','weeks','has','values','version','And','journey','size','resolveJourneyId','2214ZJXWmC','schedule','\x20\x20rule:\x0a','resolveEmbeddedActivationId','allowReentry','waitCondition','stage','days_of_week','(missing)','data','moveAfter','rootStep','resolveActivationName','wait','all','type','resolveJumpTarget','resolveSegmentId','entry_criteria','folder_id','timeout','Unknown\x20segment\x20\x22','from','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','customizedSplit','897722uATBuC','variants','startsWith','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','reentry:','relationships','activations','versions:','percentage','connector_config','with','journeyActivationStepId','wait_until','\x27.\x0a','state','steps','entryCriteria','keys','randomUUID','entries','ab_test','conditionTimeoutDuration','conditionTimeoutUnit','journeyBundleName','4885182EdUUmM','segment','version_number','slice','latest','waitStepUnit','Activation','no_reentry','waitStep','journeyId','stageName','includes','customized_split','journeyName','journeyStageId','Duration','resolveActivationId','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','6935csezbo','replace','columns','journeyBundleId','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','week','DaysOfTheWeek','draft','excluded','decision_point','waitUntilDate','versionNumber','\x20\x20\x20\x20conditions:\x0a','test','Condition','length','stageId','reentry_always','branches','condition','match','map','conditionSegmentId','resolveEmbeddedSegmentId','WaitStep','next','\x27:\x20','daysOfWeek','Wait\x201\x20Day','exit_criteria','journeys','activation','add','behavior','definition','reentry','toLowerCase','Expected\x20format:\x0a','stages','611571QKNXrR','unit','JOURNEY_SYNTAX_ERROR','days','duration','isJourneyLocal','embedded','1928dFzPIl','target','trim','attributes','resolveSegment','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','ABTest','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','uuid','20nSirrv','bundle_name','notification','conditions','parentFolder','rule','resolveActivation','Date','4371323iWgxDB'];a147_0x2af7=function(){return _0x863132;};return a147_0x2af7();}import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0x31f6db){const _0x4cc5bb=a147_0x4543,_0x42bab0=_0x31f6db['toLowerCase']();if(_0x42bab0===_0x4cc5bb(0x130)||_0x42bab0==='day')return'day';if(_0x42bab0===_0x4cc5bb(0xbb)||_0x42bab0===_0x4cc5bb(0x10b))return _0x4cc5bb(0x10b);return _0x31f6db;}export function journeyResponseToDefSync(_0x462161){const _0x4b8077=a147_0x4543,_0x1bae1c=_0x462161[_0x4b8077(0x137)],_0x4a1c7c=_0x1bae1c[_0x4b8077(0xf3)]||_0x1bae1c[_0x4b8077(0x92)],_0x47de29={'stages':_0x1bae1c['journeyStages'][_0x4b8077(0x11b)](convertApiStageToYaml),'id':_0x462161['id']};_0x1bae1c['goal']&&(_0x47de29[_0x4b8077(0x9c)]=convertApiCriteriaToYaml(_0x1bae1c[_0x4b8077(0x9c)]));_0x1bae1c['name']&&_0x1bae1c[_0x4b8077(0x92)]!==_0x4a1c7c&&(_0x47de29[_0x4b8077(0xbe)]=_0x1bae1c[_0x4b8077(0x92)]);_0x1bae1c[_0x4b8077(0x111)]!==undefined&&(_0x47de29[_0x4b8077(0xf6)]=_0x1bae1c[_0x4b8077(0x111)]);_0x1bae1c[_0x4b8077(0xea)]&&(_0x47de29[_0x4b8077(0xea)]=_0x1bae1c[_0x4b8077(0xea)]==='launched'?'launched':_0x4b8077(0x10d));const _0x195308={'type':_0x4b8077(0xc0),'name':_0x4a1c7c,'journeys':[_0x47de29]};_0x1bae1c[_0x4b8077(0xa3)]&&(_0x195308[_0x4b8077(0xa3)]=_0x1bae1c[_0x4b8077(0xa3)]);_0x1bae1c['goal']&&(_0x195308[_0x4b8077(0x9c)]=convertApiCriteriaToYaml(_0x1bae1c[_0x4b8077(0x9c)]));if(_0x1bae1c[_0x4b8077(0x98)])_0x195308[_0x4b8077(0x129)]=_0x1bae1c[_0x4b8077(0x98)];else _0x1bae1c[_0x4b8077(0xc7)]!==undefined&&(_0x195308[_0x4b8077(0x129)]=_0x1bae1c[_0x4b8077(0xc7)]?_0x4b8077(0x117):'no_reentry');return _0x1bae1c[_0x4b8077(0x109)]&&(_0x195308[_0x4b8077(0x8e)]=_0x1bae1c[_0x4b8077(0x109)]),_0x1bae1c['journeyBundleName']&&(_0x195308[_0x4b8077(0x13e)]=_0x1bae1c[_0x4b8077(0xf3)]),_0x462161[_0x4b8077(0xe1)]?.['parentFolder']?.[_0x4b8077(0xcc)]?.['id']&&(_0x195308[_0x4b8077(0xd6)]=_0x462161[_0x4b8077(0xe1)][_0x4b8077(0x141)]['data']['id']),_0x195308;}export async function journeyResponseToDef(_0x50916c,_0x20fead){const _0x325eda=a147_0x4543,_0x17de3d=journeyResponseToDefSync(_0x50916c);if(!_0x20fead)return _0x17de3d;const _0x3c00e6=new Set();collectSegmentIdsFromJourney(_0x17de3d,_0x3c00e6);const _0x5e01d6=new Set();collectActivationIdsFromJourney(_0x17de3d,_0x5e01d6);const _0x4b1c74={},_0x3eca66=new Map();for(const _0x420443 of Array[_0x325eda(0xd9)](_0x3c00e6)['sort']()){if(_0x20fead[_0x325eda(0x138)]){const _0x1f3dfd=await _0x20fead[_0x325eda(0x138)](_0x420443);if(_0x1f3dfd[_0x325eda(0x132)]){_0x3eca66[_0x325eda(0xba)](_0x420443,_0x1f3dfd['name']);if(_0x1f3dfd[_0x325eda(0x128)]){const _0x5e8804={..._0x1f3dfd['definition'],'rule':deepSortObject(_0x1f3dfd[_0x325eda(0x128)][_0x325eda(0x142)])};_0x4b1c74[_0x1f3dfd[_0x325eda(0x92)]]=_0x5e8804;}}else _0x3eca66[_0x325eda(0xba)](_0x420443,makeSegmentRef(_0x1f3dfd[_0x325eda(0x92)]));}else{if(_0x20fead[_0x325eda(0xb6)]){const _0x38ff75=await _0x20fead[_0x325eda(0xb6)](_0x420443);_0x3eca66[_0x325eda(0xba)](_0x420443,_0x38ff75);}}}const _0x293770={},_0x32c119=new Map();for(const _0x1b59f5 of Array[_0x325eda(0xd9)](_0x5e01d6)[_0x325eda(0x91)]()){if(_0x20fead[_0x325eda(0x143)]){const _0x4f4cb2=await _0x20fead[_0x325eda(0x143)](_0x1b59f5);_0x4f4cb2[_0x325eda(0x132)]?(_0x32c119[_0x325eda(0xba)](_0x1b59f5,_0x4f4cb2[_0x325eda(0x92)]),_0x4f4cb2['definition']&&(_0x293770[_0x4f4cb2['name']]=_0x4f4cb2[_0x325eda(0x128)])):_0x32c119[_0x325eda(0xba)](_0x1b59f5,makeSegmentRef(_0x4f4cb2['name']));}else{if(_0x20fead[_0x325eda(0xcf)]){const _0x58375c=await _0x20fead['resolveActivationName'](_0x1b59f5);_0x32c119[_0x325eda(0xba)](_0x1b59f5,_0x58375c);}}}_0x3eca66[_0x325eda(0xc1)]>0x0&&replaceSegmentIdsInJourney(_0x17de3d,_0x3eca66);_0x32c119['size']>0x0&&replaceActivationIdsInJourney(_0x17de3d,_0x32c119);if(_0x20fead[_0x325eda(0xd3)]){const _0x4b6dc0=[];collectJumpTargetsFromJourney(_0x17de3d,_0x4b6dc0);if(_0x4b6dc0[_0x325eda(0x115)]>0x0){const _0x42c2ad=new Map();for(const _0x1c6e8d of _0x4b6dc0){try{const _0x72ca87=await _0x20fead[_0x325eda(0xd3)](_0x1c6e8d[_0x325eda(0xfd)],_0x1c6e8d[_0x325eda(0x116)]);_0x42c2ad['set'](_0x1c6e8d[_0x325eda(0xfd)]+':'+_0x1c6e8d[_0x325eda(0x116)],_0x72ca87);}catch{}}_0x42c2ad[_0x325eda(0xc1)]>0x0&&replaceJumpTargetsInJourney(_0x17de3d,_0x42c2ad);}}return Object[_0x325eda(0xed)](_0x4b1c74)[_0x325eda(0x115)]>0x0&&(_0x17de3d['segments']=_0x4b1c74),Object['keys'](_0x293770)[_0x325eda(0x115)]>0x0&&(_0x17de3d[_0x325eda(0xe2)]=_0x293770),_0x17de3d;}function collectSegmentIdsFromJourney(_0xfcd47e,_0x3aa690){const _0x10340c=a147_0x4543;_0xfcd47e[_0x10340c(0x9c)]?.[_0x10340c(0xf5)]&&_0x3aa690[_0x10340c(0x126)](_0xfcd47e['goal'][_0x10340c(0xf5)]);const _0xe1fb64=_0x21bd41=>{const _0x430c56=_0x10340c;for(const _0x1c7c96 of _0x21bd41){_0x1c7c96[_0x430c56(0xd5)]?.['segment']&&_0x3aa690['add'](_0x1c7c96['entry_criteria'][_0x430c56(0xf5)]);if(_0x1c7c96[_0x430c56(0x123)])for(const _0x414313 of _0x1c7c96[_0x430c56(0x123)]){_0x414313[_0x430c56(0xf5)]&&_0x3aa690['add'](_0x414313[_0x430c56(0xf5)]);}_0x1c7c96[_0x430c56(0xa8)]?.[_0x430c56(0xf5)]&&_0x3aa690[_0x430c56(0x126)](_0x1c7c96[_0x430c56(0xa8)][_0x430c56(0xf5)]);if(_0x1c7c96[_0x430c56(0xeb)])for(const _0x38b972 of _0x1c7c96[_0x430c56(0xeb)]){if(_0x38b972[_0x430c56(0xd2)]===_0x430c56(0x10f)){const _0x2a84d0=_0x38b972;for(const _0x2e4be7 of _0x2a84d0[_0x430c56(0xe6)][_0x430c56(0x118)]){_0x2e4be7[_0x430c56(0xf5)]&&_0x3aa690[_0x430c56(0x126)](_0x2e4be7[_0x430c56(0xf5)]);}}else{if(_0x38b972[_0x430c56(0xd2)]===_0x430c56(0xd0)){const _0x2efa00=_0x38b972;_0x2efa00['with'][_0x430c56(0x119)]?.[_0x430c56(0xf5)]&&_0x3aa690['add'](_0x2efa00[_0x430c56(0xe6)][_0x430c56(0x119)][_0x430c56(0xf5)]);}}}}};if(_0xfcd47e['journeys'])for(const _0x427493 of _0xfcd47e[_0x10340c(0x124)]){_0x427493[_0x10340c(0x9c)]?.[_0x10340c(0xf5)]&&_0x3aa690[_0x10340c(0x126)](_0x427493[_0x10340c(0x9c)][_0x10340c(0xf5)]),_0xe1fb64(_0x427493[_0x10340c(0x12c)]);}_0xfcd47e[_0x10340c(0x12c)]&&_0xe1fb64(_0xfcd47e[_0x10340c(0x12c)]);if(_0xfcd47e[_0x10340c(0x94)])for(const _0x99ae2d of _0xfcd47e[_0x10340c(0x94)]){_0xe1fb64(_0x99ae2d['stages']);}}function replaceSegmentIdsInJourney(_0x47fc62,_0x271dd4){const _0x1548d4=a147_0x4543,_0x39518b=_0x10279d=>_0x271dd4[_0x1548d4(0x14b)](_0x10279d)||_0x10279d;_0x47fc62[_0x1548d4(0x9c)]?.['segment']&&(_0x47fc62['goal'][_0x1548d4(0xf5)]=_0x39518b(_0x47fc62['goal'][_0x1548d4(0xf5)]));const _0x51269b=_0x178c17=>{const _0x303e98=_0x1548d4;for(const _0x328a98 of _0x178c17){_0x328a98[_0x303e98(0xd5)]?.[_0x303e98(0xf5)]&&(_0x328a98[_0x303e98(0xd5)][_0x303e98(0xf5)]=_0x39518b(_0x328a98['entry_criteria'][_0x303e98(0xf5)]));if(_0x328a98[_0x303e98(0x123)])for(const _0x5af766 of _0x328a98[_0x303e98(0x123)]){_0x5af766['segment']&&(_0x5af766[_0x303e98(0xf5)]=_0x39518b(_0x5af766[_0x303e98(0xf5)]));}_0x328a98[_0x303e98(0xa8)]?.[_0x303e98(0xf5)]&&(_0x328a98[_0x303e98(0xa8)][_0x303e98(0xf5)]=_0x39518b(_0x328a98['milestone'][_0x303e98(0xf5)]));if(_0x328a98['steps'])for(const _0x57f3b of _0x328a98[_0x303e98(0xeb)]){if(_0x57f3b['type']===_0x303e98(0x10f)){const _0x47fdda=_0x57f3b;for(const _0xbee3a9 of _0x47fdda[_0x303e98(0xe6)][_0x303e98(0x118)]){_0xbee3a9[_0x303e98(0xf5)]&&(_0xbee3a9[_0x303e98(0xf5)]=_0x39518b(_0xbee3a9['segment']));}}else{if(_0x57f3b['type']===_0x303e98(0xd0)){const _0x1a7fda=_0x57f3b;_0x1a7fda['with']['condition']?.['segment']&&(_0x1a7fda[_0x303e98(0xe6)]['condition'][_0x303e98(0xf5)]=_0x39518b(_0x1a7fda[_0x303e98(0xe6)]['condition'][_0x303e98(0xf5)]));}}}}};if(_0x47fc62['journeys'])for(const _0x16d987 of _0x47fc62[_0x1548d4(0x124)]){_0x16d987['goal']?.[_0x1548d4(0xf5)]&&(_0x16d987[_0x1548d4(0x9c)][_0x1548d4(0xf5)]=_0x39518b(_0x16d987[_0x1548d4(0x9c)][_0x1548d4(0xf5)])),_0x51269b(_0x16d987['stages']);}_0x47fc62[_0x1548d4(0x12c)]&&_0x51269b(_0x47fc62['stages']);if(_0x47fc62['versions'])for(const _0x3df827 of _0x47fc62[_0x1548d4(0x94)]){_0x51269b(_0x3df827[_0x1548d4(0x12c)]);}}function collectActivationIdsFromJourney(_0x14f30f,_0x2a4620){const _0x215c1e=a147_0x4543,_0x875809=_0x2fd81a=>{const _0x335cdb=a147_0x4543;for(const _0x868b1c of _0x2fd81a){if(_0x868b1c[_0x335cdb(0xeb)])for(const _0x54a3bc of _0x868b1c[_0x335cdb(0xeb)]){if(_0x54a3bc[_0x335cdb(0xd2)]==='activation'){const _0x593d3a=_0x54a3bc;_0x593d3a[_0x335cdb(0xe6)][_0x335cdb(0x125)]&&/^\d+$/[_0x335cdb(0x113)](_0x593d3a[_0x335cdb(0xe6)]['activation'])&&_0x2a4620[_0x335cdb(0x126)](_0x593d3a[_0x335cdb(0xe6)][_0x335cdb(0x125)]);}}}};if(_0x14f30f['journeys'])for(const _0x33c1d8 of _0x14f30f['journeys']){_0x875809(_0x33c1d8['stages']);}_0x14f30f['stages']&&_0x875809(_0x14f30f[_0x215c1e(0x12c)]);if(_0x14f30f[_0x215c1e(0x94)])for(const _0x33df71 of _0x14f30f[_0x215c1e(0x94)]){_0x875809(_0x33df71[_0x215c1e(0x12c)]);}}function replaceActivationIdsInJourney(_0x20aa71,_0x1aab5e){const _0x46fbbb=a147_0x4543,_0x46c448=_0x52e12a=>_0x1aab5e[_0x46fbbb(0x14b)](_0x52e12a)||_0x52e12a,_0x218884=_0x3ace6a=>{const _0x509d92=_0x46fbbb;for(const _0x50adb1 of _0x3ace6a){if(_0x50adb1['steps'])for(const _0x3ac785 of _0x50adb1[_0x509d92(0xeb)]){if(_0x3ac785[_0x509d92(0xd2)]===_0x509d92(0x125)){const _0x232906=_0x3ac785;_0x232906[_0x509d92(0xe6)][_0x509d92(0x125)]&&(_0x232906[_0x509d92(0xe6)]['activation']=_0x46c448(_0x232906[_0x509d92(0xe6)]['activation']));}}}};if(_0x20aa71[_0x46fbbb(0x124)])for(const _0x159b49 of _0x20aa71[_0x46fbbb(0x124)]){_0x218884(_0x159b49[_0x46fbbb(0x12c)]);}_0x20aa71[_0x46fbbb(0x12c)]&&_0x218884(_0x20aa71['stages']);if(_0x20aa71[_0x46fbbb(0x94)])for(const _0x500264 of _0x20aa71[_0x46fbbb(0x94)]){_0x218884(_0x500264['stages']);}}function collectJumpTargetsFromJourney(_0x505a5d,_0x585408){const _0x2d4f60=a147_0x4543,_0x352327=new Set(),_0x2733b2=_0x37862c=>{const _0x33faef=a147_0x4543;for(const _0x4ca2a9 of _0x37862c){if(_0x4ca2a9['steps'])for(const _0x271bb8 of _0x4ca2a9['steps']){if(_0x271bb8[_0x33faef(0xd2)]===_0x33faef(0x14a)){const _0x1b7c61=_0x271bb8,_0x14e8cf=_0x1b7c61[_0x33faef(0xe6)]['target'];if(_0x14e8cf[_0x33faef(0xc0)]&&_0x14e8cf[_0x33faef(0xc9)]&&/^\d+$/[_0x33faef(0x113)](_0x14e8cf[_0x33faef(0xc0)])&&/^\d+$/['test'](_0x14e8cf['stage'])){const _0x398584=_0x14e8cf[_0x33faef(0xc0)]+':'+_0x14e8cf['stage'];!_0x352327[_0x33faef(0xbc)](_0x398584)&&(_0x352327[_0x33faef(0x126)](_0x398584),_0x585408[_0x33faef(0xb5)]({'journeyId':_0x14e8cf[_0x33faef(0xc0)],'stageId':_0x14e8cf[_0x33faef(0xc9)]}));}}}}};if(_0x505a5d[_0x2d4f60(0x124)])for(const _0x475f7c of _0x505a5d[_0x2d4f60(0x124)]){_0x2733b2(_0x475f7c['stages']);}_0x505a5d[_0x2d4f60(0x12c)]&&_0x2733b2(_0x505a5d[_0x2d4f60(0x12c)]);if(_0x505a5d[_0x2d4f60(0x94)])for(const _0x2498c9 of _0x505a5d[_0x2d4f60(0x94)]){_0x2733b2(_0x2498c9[_0x2d4f60(0x12c)]);}}function replaceJumpTargetsInJourney(_0x162c08,_0x2597d7){const _0x10575d=a147_0x4543,_0x59313d=_0x4de5b6=>{const _0x5c856d=a147_0x4543;for(const _0x2dfb57 of _0x4de5b6){if(_0x2dfb57[_0x5c856d(0xeb)])for(const _0x3bf7c9 of _0x2dfb57[_0x5c856d(0xeb)]){if(_0x3bf7c9[_0x5c856d(0xd2)]===_0x5c856d(0x14a)){const _0x5ce86a=_0x3bf7c9,_0x325ecc=_0x5ce86a[_0x5c856d(0xe6)][_0x5c856d(0x135)],_0x2694ad=_0x325ecc[_0x5c856d(0xc0)]+':'+_0x325ecc[_0x5c856d(0xc9)],_0x493ac3=_0x2597d7[_0x5c856d(0x14b)](_0x2694ad);_0x493ac3&&(_0x325ecc['journey']=_0x493ac3['journeyName'],_0x325ecc['stage']=_0x493ac3[_0x5c856d(0xfe)]);}}}};if(_0x162c08[_0x10575d(0x124)])for(const _0x22b69e of _0x162c08[_0x10575d(0x124)]){_0x59313d(_0x22b69e[_0x10575d(0x12c)]);}_0x162c08[_0x10575d(0x12c)]&&_0x59313d(_0x162c08[_0x10575d(0x12c)]);if(_0x162c08[_0x10575d(0x94)])for(const _0x2795b7 of _0x162c08[_0x10575d(0x94)]){_0x59313d(_0x2795b7[_0x10575d(0x12c)]);}}function generateReadableStepName(_0x5b8dd5,_0x13ff54){const _0x4bc0ec=a147_0x4543;if(_0x5b8dd5['name']&&_0x5b8dd5[_0x4bc0ec(0x92)]!==_0x5b8dd5[_0x4bc0ec(0xd2)]){const _0x48835d=_0x5b8dd5[_0x4bc0ec(0x92)][_0x4bc0ec(0x136)]();if(_0x48835d&&/[a-z0-9\p{L}]/iu[_0x4bc0ec(0x113)](_0x48835d))return _0x48835d;}const _0x371e9f=_0x5b8dd5[_0x4bc0ec(0xd2)][_0x4bc0ec(0x12a)]()[_0x4bc0ec(0x107)](/step$/i,'');return _0x371e9f+'_'+(_0x13ff54+0x1);}function getStepNextRefs(_0x3be957){const _0x2e1e8a=a147_0x4543,_0x573a46=[];if(_0x3be957['next'])_0x573a46[_0x2e1e8a(0xb5)](_0x3be957[_0x2e1e8a(0x11f)]);if(_0x3be957[_0x2e1e8a(0x118)])for(const _0x3b5469 of _0x3be957[_0x2e1e8a(0x118)]){if(_0x3b5469['next'])_0x573a46[_0x2e1e8a(0xb5)](_0x3b5469[_0x2e1e8a(0x11f)]);}if(_0x3be957[_0x2e1e8a(0xdd)])for(const _0x4c2e08 of _0x3be957[_0x2e1e8a(0xdd)]){if(_0x4c2e08[_0x2e1e8a(0x11f)])_0x573a46[_0x2e1e8a(0xb5)](_0x4c2e08['next']);}if(_0x3be957[_0x2e1e8a(0x140)])for(const _0xd5671f of _0x3be957[_0x2e1e8a(0x140)]){if(_0xd5671f[_0x2e1e8a(0x11f)])_0x573a46['push'](_0xd5671f[_0x2e1e8a(0x11f)]);}return _0x573a46;}function parseJumpTargetDisplayName(_0x398b8d){const _0x49e0fb=a147_0x4543,_0x389f22=_0x398b8d[_0x49e0fb(0x11a)](/^(.+?)\s*\(([^/)]+)/);if(!_0x389f22)return undefined;const _0x8c193d=_0x389f22[0x1][_0x49e0fb(0x136)](),_0x53db59=_0x389f22[0x2][_0x49e0fb(0x136)]();if(!_0x8c193d||!_0x53db59)return undefined;return{'stageName':_0x8c193d,'journeyName':_0x53db59};}function a147_0x4543(_0x6a088f,_0x3fe9da){_0x6a088f=_0x6a088f-0x8e;const _0x2af72a=a147_0x2af7();let _0x454304=_0x2af72a[_0x6a088f];return _0x454304;}function orderStepsFromRoot(_0x282d2a,_0x331d33){const _0x4485c4=a147_0x4543,_0x2bbc49=Object[_0x4485c4(0xef)](_0x282d2a);if(_0x2bbc49['length']===0x0)return[];const _0x2c8dfd=new Set(_0x2bbc49[_0x4485c4(0x11b)](([_0x2a538b])=>_0x2a538b)),_0x30710d=new Set();for(const [,_0x101300]of _0x2bbc49){for(const _0x1524ba of getStepNextRefs(_0x101300)){if(_0x2c8dfd['has'](_0x1524ba))_0x30710d[_0x4485c4(0x126)](_0x1524ba);}}let _0x157e95=_0x331d33&&_0x2c8dfd[_0x4485c4(0xbc)](_0x331d33)?_0x331d33:undefined;if(!_0x157e95){const _0x4c14d1=_0x2bbc49[_0x4485c4(0xb8)](([_0xaec43])=>!_0x30710d[_0x4485c4(0xbc)](_0xaec43));_0x4c14d1[_0x4485c4(0x115)]>0x0?_0x157e95=_0x4c14d1[0x0][0x0]:_0x157e95=_0x2bbc49[0x0][0x0];}const _0x2f5500=[],_0x507d08=new Set(),_0x643504=[_0x157e95];while(_0x643504['length']>0x0){const _0x21b826=_0x643504['shift']();if(_0x507d08[_0x4485c4(0xbc)](_0x21b826))continue;_0x507d08['add'](_0x21b826);const _0x89c0a7=_0x282d2a[_0x21b826];if(!_0x89c0a7)continue;_0x2f5500[_0x4485c4(0xb5)]({'uuid':_0x21b826,'step':_0x89c0a7});for(const _0x2e69f3 of getStepNextRefs(_0x89c0a7)){_0x2c8dfd[_0x4485c4(0xbc)](_0x2e69f3)&&!_0x507d08['has'](_0x2e69f3)&&_0x643504['push'](_0x2e69f3);}}for(const [_0x105333,_0x510e90]of _0x2bbc49){!_0x507d08[_0x4485c4(0xbc)](_0x105333)&&_0x2f5500[_0x4485c4(0xb5)]({'uuid':_0x105333,'step':_0x510e90});}return _0x2f5500;}function resolveStepReferences(_0xf78994,_0x9bff2c,_0x54d330,_0x5e2a02){const _0x2d6957=a147_0x4543;if(_0xf78994[_0x2d6957(0xd2)]!==_0x2d6957(0xb2)){_0xf78994['next']&&_0x5e2a02[_0x2d6957(0xbc)](_0xf78994[_0x2d6957(0x11f)])&&(_0xf78994[_0x2d6957(0x11f)]=_0x5e2a02['get'](_0xf78994['next']));const _0x515ceb=_0x9bff2c+0x1;if(_0x515ceb<_0x54d330[_0x2d6957(0x115)]){const _0x1aba79=_0x5e2a02[_0x2d6957(0x14b)](_0x54d330[_0x515ceb]['uuid']);_0xf78994[_0x2d6957(0x11f)]===_0x1aba79&&delete _0xf78994[_0x2d6957(0x11f)];}}if(_0xf78994[_0x2d6957(0xd2)]==='decision_point')for(const _0x4773e0 of _0xf78994[_0x2d6957(0xe6)][_0x2d6957(0x118)]){_0x4773e0['next']&&_0x5e2a02[_0x2d6957(0xbc)](_0x4773e0[_0x2d6957(0x11f)])&&(_0x4773e0[_0x2d6957(0x11f)]=_0x5e2a02[_0x2d6957(0x14b)](_0x4773e0[_0x2d6957(0x11f)]));}if(_0xf78994[_0x2d6957(0xd2)]===_0x2d6957(0xf0))for(const _0x3ea1d7 of _0xf78994[_0x2d6957(0xe6)]['variants']){_0x3ea1d7[_0x2d6957(0x11f)]&&_0x5e2a02[_0x2d6957(0xbc)](_0x3ea1d7[_0x2d6957(0x11f)])&&(_0x3ea1d7[_0x2d6957(0x11f)]=_0x5e2a02[_0x2d6957(0x14b)](_0x3ea1d7['next']));}if(_0xf78994[_0x2d6957(0xd2)]===_0x2d6957(0xd0)&&_0xf78994[_0x2d6957(0xe6)][_0x2d6957(0x119)]){const _0x1ea9bc=_0xf78994[_0x2d6957(0xe6)][_0x2d6957(0x119)];_0x1ea9bc['next']&&_0x5e2a02['has'](_0x1ea9bc[_0x2d6957(0x11f)])&&(_0x1ea9bc[_0x2d6957(0x11f)]=_0x5e2a02[_0x2d6957(0x14b)](_0x1ea9bc['next'])),_0x1ea9bc[_0x2d6957(0xd7)]?.[_0x2d6957(0x11f)]&&_0x5e2a02['has'](_0x1ea9bc['timeout']['next'])&&(_0x1ea9bc[_0x2d6957(0xd7)][_0x2d6957(0x11f)]=_0x5e2a02[_0x2d6957(0x14b)](_0x1ea9bc[_0x2d6957(0xd7)][_0x2d6957(0x11f)]));}}function convertApiStageToYaml(_0x315675){const _0xc5a10c=a147_0x4543,_0x6463e2={'name':_0x315675[_0xc5a10c(0x92)]};_0x315675['id']&&(_0x6463e2['id']=_0x315675['id']);_0x315675[_0xc5a10c(0xa3)]&&(_0x6463e2[_0xc5a10c(0xa3)]=_0x315675[_0xc5a10c(0xa3)]);_0x315675[_0xc5a10c(0xec)]&&(_0x6463e2['entry_criteria']=convertApiCriteriaToYaml(_0x315675[_0xc5a10c(0xec)]));_0x315675[_0xc5a10c(0xa6)]&&_0x315675[_0xc5a10c(0xa6)][_0xc5a10c(0x115)]>0x0&&(_0x6463e2[_0xc5a10c(0x123)]=_0x315675[_0xc5a10c(0xa6)][_0xc5a10c(0x11b)](convertApiCriteriaToYaml));_0x315675['milestone']&&(_0x6463e2[_0xc5a10c(0xa8)]=convertApiCriteriaToYaml(_0x315675['milestone']));if(_0x315675['steps']&&Object[_0xc5a10c(0xed)](_0x315675[_0xc5a10c(0xeb)])[_0xc5a10c(0x115)]>0x0){const _0x5f1c07=orderStepsFromRoot(_0x315675['steps'],_0x315675[_0xc5a10c(0xce)]),_0x51361a=new Map(),_0x54782a=new Set();for(let _0xffb6ae=0x0;_0xffb6ae<_0x5f1c07[_0xc5a10c(0x115)];_0xffb6ae++){const {uuid:_0x12c218,step:_0x1fcc1a}=_0x5f1c07[_0xffb6ae];let _0x53b814=generateReadableStepName(_0x1fcc1a,_0xffb6ae),_0x3c118b=_0x53b814,_0x1dfdb6=0x2;while(_0x54782a[_0xc5a10c(0xbc)](_0x3c118b)){_0x3c118b=_0x53b814+'_'+_0x1dfdb6,_0x1dfdb6++;}_0x54782a[_0xc5a10c(0x126)](_0x3c118b),_0x51361a[_0xc5a10c(0xba)](_0x12c218,_0x3c118b);}_0x6463e2[_0xc5a10c(0xeb)]=_0x5f1c07['map'](({uuid:_0x27d990,step:_0x302581},_0x4482ae)=>{const _0x7d1ab0=_0xc5a10c,_0x190dac=convertApiStepToYaml(_0x302581,_0x51361a[_0x7d1ab0(0x14b)](_0x27d990));return resolveStepReferences(_0x190dac,_0x4482ae,_0x5f1c07,_0x51361a),_0x190dac;});}return _0x6463e2;}function convertApiCriteriaToYaml(_0xf618f5){const _0x3213ed=a147_0x4543,_0x2f63ae={'name':_0xf618f5['name'],'segment':_0xf618f5[_0x3213ed(0xa4)]};_0xf618f5[_0x3213ed(0xa3)]&&(_0x2f63ae[_0x3213ed(0xa3)]=_0xf618f5[_0x3213ed(0xa3)]);if(_0xf618f5['target']){let _0x564a64=_0xf618f5[_0x3213ed(0x135)][_0x3213ed(0xfd)],_0xede443=_0xf618f5[_0x3213ed(0x135)][_0x3213ed(0x102)];if(_0xf618f5[_0x3213ed(0x135)][_0x3213ed(0x101)]){const _0x5c6a25=parseJumpTargetDisplayName(_0xf618f5['target'][_0x3213ed(0x101)]);_0x5c6a25&&(_0xede443=_0x5c6a25['stageName'],_0x564a64=_0x5c6a25[_0x3213ed(0x101)]);}_0x2f63ae[_0x3213ed(0x135)]={'journey':_0x564a64,'stage':_0xede443},_0xf618f5[_0x3213ed(0x135)]['journeyBundleId']&&(_0x2f63ae[_0x3213ed(0x135)][_0x3213ed(0x8e)]=_0xf618f5[_0x3213ed(0x135)][_0x3213ed(0x109)]);}return _0x2f63ae;}function convertApiStepToYaml(_0x3e36d0,_0x103d85){const _0x2ed851=a147_0x4543;switch(_0x3e36d0[_0x2ed851(0xd2)]){case _0x2ed851(0x11e):{const _0x18a52a={};if(_0x3e36d0[_0x2ed851(0x96)]===_0x2ed851(0x103)&&_0x3e36d0[_0x2ed851(0xfc)]!==undefined)_0x18a52a[_0x2ed851(0x131)]=_0x3e36d0[_0x2ed851(0xfc)],_0x18a52a[_0x2ed851(0x12e)]=_0x3e36d0['waitStepUnit'];else{if(_0x3e36d0[_0x2ed851(0x96)]===_0x2ed851(0x144)&&_0x3e36d0[_0x2ed851(0x110)])_0x18a52a['wait_until']=_0x3e36d0[_0x2ed851(0x110)];else{if(_0x3e36d0[_0x2ed851(0x96)]===_0x2ed851(0x10c)&&_0x3e36d0[_0x2ed851(0x121)])_0x18a52a['days_of_week']=_0x3e36d0[_0x2ed851(0x121)];else{if(_0x3e36d0[_0x2ed851(0x96)]===_0x2ed851(0x114)){if(_0x3e36d0[_0x2ed851(0x140)]&&_0x3e36d0[_0x2ed851(0x140)]['length']>0x0){const _0x5231d5=_0x3e36d0[_0x2ed851(0x140)][_0x2ed851(0x9a)](_0x365728=>!_0x365728[_0x2ed851(0x9b)]),_0x3b8cba=_0x3e36d0[_0x2ed851(0x140)][_0x2ed851(0x9a)](_0x57ebc1=>_0x57ebc1[_0x2ed851(0x9b)]);_0x5231d5?.[_0x2ed851(0xa4)]&&(_0x18a52a[_0x2ed851(0x119)]={'segment':_0x5231d5[_0x2ed851(0xa4)],..._0x5231d5['next']?{'next':_0x5231d5[_0x2ed851(0x11f)]}:{}},_0x3b8cba&&_0x3b8cba[_0x2ed851(0xcd)]!==undefined&&_0x3b8cba[_0x2ed851(0x12e)]&&(_0x18a52a[_0x2ed851(0x119)][_0x2ed851(0xd7)]={'duration':_0x3b8cba[_0x2ed851(0xcd)],'unit':_0x3b8cba[_0x2ed851(0x12e)],..._0x3b8cba[_0x2ed851(0x11f)]?{'next':_0x3b8cba[_0x2ed851(0x11f)]}:{}}));}else _0x3e36d0['conditionSegmentId']&&(_0x18a52a[_0x2ed851(0x119)]={'segment':_0x3e36d0[_0x2ed851(0x11c)]},_0x3e36d0[_0x2ed851(0xf1)]!==undefined&&_0x3e36d0[_0x2ed851(0xf2)]&&(_0x18a52a[_0x2ed851(0x119)][_0x2ed851(0xd7)]={'duration':_0x3e36d0[_0x2ed851(0xf1)],'unit':_0x3e36d0[_0x2ed851(0xf2)]}));}}}}const _0x2e0413={'type':_0x2ed851(0xd0),'name':_0x103d85,..._0x3e36d0[_0x2ed851(0x11f)]?{'next':_0x3e36d0[_0x2ed851(0x11f)]}:{},'with':_0x18a52a};return _0x2e0413;}case'Activation':{const _0x312286={'type':'activation','name':_0x103d85,..._0x3e36d0[_0x2ed851(0x11f)]?{'next':_0x3e36d0[_0x2ed851(0x11f)]}:{},'with':{'activation':_0x3e36d0[_0x2ed851(0xe7)]||''}};return _0x312286;}case _0x2ed851(0x9e):{const _0x55ebcc={'type':_0x2ed851(0x10f),'name':_0x103d85,..._0x3e36d0['next']?{'next':_0x3e36d0[_0x2ed851(0x11f)]}:{},'with':{'branches':(_0x3e36d0[_0x2ed851(0x118)]||[])[_0x2ed851(0x11b)](_0x516a88=>({'name':_0x516a88[_0x2ed851(0x92)],'segment':_0x516a88[_0x2ed851(0xa4)],'excluded':_0x516a88['excludedPath'],..._0x516a88[_0x2ed851(0x11f)]?{'next':_0x516a88['next']}:{}}))}};return _0x55ebcc;}case _0x2ed851(0x13a):case'AbTest':case _0x2ed851(0x93):{const _0x3f7974=_0x3e36d0[_0x2ed851(0xdd)]||(_0x3e36d0[_0x2ed851(0x118)]||[])[_0x2ed851(0x11b)](_0x2ad17d=>({'name':_0x2ad17d[_0x2ed851(0x92)],'percentage':0x0,'next':_0x2ad17d['next']})),_0x45adc6={'type':'ab_test','name':_0x103d85,..._0x3e36d0[_0x2ed851(0x11f)]?{'next':_0x3e36d0[_0x2ed851(0x11f)]}:{},'with':{'customized_split':_0x3e36d0[_0x2ed851(0xdb)],'unique_id':_0x3e36d0[_0x2ed851(0xae)],'variants':_0x3f7974['map'](_0x1115a2=>({'name':_0x1115a2[_0x2ed851(0x92)],'percentage':_0x1115a2[_0x2ed851(0xe4)],..._0x1115a2['next']?{'next':_0x1115a2[_0x2ed851(0x11f)]}:{}}))}};return _0x45adc6;}case'Merge':{const _0x2b829a={'type':'merge','name':_0x103d85,..._0x3e36d0[_0x2ed851(0x11f)]?{'next':_0x3e36d0[_0x2ed851(0x11f)]}:{}};return _0x2b829a;}case _0x2ed851(0x90):{let _0x4e0d03='',_0x4d35b8='',_0x59de2d;if(_0x3e36d0[_0x2ed851(0x135)]){_0x4e0d03=_0x3e36d0['target'][_0x2ed851(0xfd)],_0x4d35b8=_0x3e36d0[_0x2ed851(0x135)][_0x2ed851(0x102)],_0x59de2d=_0x3e36d0[_0x2ed851(0x135)][_0x2ed851(0x109)];if(_0x3e36d0[_0x2ed851(0x135)][_0x2ed851(0x101)]){const _0x57f42d=parseJumpTargetDisplayName(_0x3e36d0[_0x2ed851(0x135)][_0x2ed851(0x101)]);_0x57f42d&&(_0x4d35b8=_0x57f42d[_0x2ed851(0xfe)],_0x4e0d03=_0x57f42d[_0x2ed851(0x101)]);}}const _0x4b9953={'type':_0x2ed851(0x14a),'name':_0x103d85,..._0x3e36d0['next']?{'next':_0x3e36d0[_0x2ed851(0x11f)]}:{},'with':{'target':{'journey':_0x4e0d03,'stage':_0x4d35b8,..._0x59de2d?{'bundle_id':_0x59de2d}:{}}}};return _0x4b9953;}case _0x2ed851(0x8f):{const _0x1e57e7={'type':'end','name':_0x103d85};return _0x1e57e7;}default:{const _0x19accd={'type':'end','name':_0x103d85};return _0x19accd;}}}export async function journeyDefToRequest(_0x371330,_0x5b43b4,_0x1662e3){const _0x112883=a147_0x4543,_0x44ca82=_0x371330[_0x112883(0x12c)]||getActiveStages(_0x371330),_0x4ebbda=isJourneysArrayMode(_0x371330)||isMultiVersionMode(_0x371330)?getLatestJourneyEntry(_0x371330):undefined,_0x2be322=_0x4ebbda?.[_0x112883(0xbe)]??_0x371330['name'],_0x5cf9c4=_0x371330[_0x112883(0xaf)]||{},_0x41e5de=_0x371330['activations']||{},_0x32ba39={'type':_0x112883(0xc0),'attributes':{'name':_0x2be322,'audienceId':_0x5b43b4,'journeyStages':await Promise[_0x112883(0xd1)](_0x44ca82[_0x112883(0x11b)](_0x26ca30=>convertYamlStageToApi(_0x26ca30,_0x1662e3,_0x5cf9c4,_0x41e5de)))}},_0x5c207c=_0x4ebbda?.['id']??_0x371330['id'];_0x5c207c&&(_0x32ba39['id']=_0x5c207c);_0x371330[_0x112883(0xa3)]&&(_0x32ba39[_0x112883(0x137)][_0x112883(0xa3)]=_0x371330[_0x112883(0xa3)]);const _0x4de683=getEffectiveGoal(_0x371330);_0x4de683&&(_0x32ba39['attributes'][_0x112883(0x9c)]=await convertYamlCriteriaToApi(_0x4de683,_0x1662e3,_0x5cf9c4));const _0x421e3e=getEffectiveReentry(_0x371330);return _0x421e3e&&(_0x32ba39[_0x112883(0x137)][_0x112883(0x98)]=_0x421e3e,_0x32ba39[_0x112883(0x137)][_0x112883(0xc7)]=_0x421e3e!==_0x112883(0xfb)),_0x371330[_0x112883(0xd6)]&&(_0x32ba39[_0x112883(0xe1)]={'parentFolder':{'data':{'id':_0x371330[_0x112883(0xd6)],'type':'folder'}}}),_0x32ba39;}async function convertYamlStageToApi(_0x8b7974,_0x4135f5,_0x1e6474={},_0x4a5cd6={}){const _0x3b873e=a147_0x4543,_0x57ce37={'name':_0x8b7974[_0x3b873e(0x92)]};_0x8b7974['id']&&(_0x57ce37['id']=_0x8b7974['id']);_0x8b7974[_0x3b873e(0xa3)]&&(_0x57ce37[_0x3b873e(0xa3)]=_0x8b7974['description']);_0x8b7974[_0x3b873e(0xd5)]&&(_0x57ce37[_0x3b873e(0xec)]=await convertYamlCriteriaToApi(_0x8b7974[_0x3b873e(0xd5)],_0x4135f5,_0x1e6474));_0x8b7974[_0x3b873e(0x123)]&&_0x8b7974['exit_criteria'][_0x3b873e(0x115)]>0x0&&(_0x57ce37['exitCriterias']=await Promise[_0x3b873e(0xd1)](_0x8b7974[_0x3b873e(0x123)][_0x3b873e(0x11b)](_0x1efaaf=>convertYamlCriteriaToApi(_0x1efaaf,_0x4135f5,_0x1e6474))));_0x8b7974['milestone']&&(_0x57ce37[_0x3b873e(0xa8)]=await convertYamlCriteriaToApi(_0x8b7974[_0x3b873e(0xa8)],_0x4135f5,_0x1e6474));if(_0x8b7974[_0x3b873e(0xeb)]&&_0x8b7974['steps'][_0x3b873e(0x115)]>0x0){const _0x214def={},_0x29ab1f=_0x8b7974[_0x3b873e(0xeb)]['map']((_0x52c712,_0x31047e)=>{const _0x226893=_0x3b873e,_0x4b821e=_0x52c712[_0x226893(0x13c)]||generateUUID(),_0x3a9c1e=_0x52c712[_0x226893(0x92)]||_0x52c712[_0x226893(0xd2)]+'_'+_0x31047e;return _0x214def[_0x3a9c1e]=_0x4b821e,{..._0x52c712,'name':_0x3a9c1e};});_0x57ce37[_0x3b873e(0xce)]=_0x214def[_0x29ab1f[0x0]['name']],_0x57ce37[_0x3b873e(0xeb)]={};for(let _0xb64d3c=0x0;_0xb64d3c<_0x29ab1f[_0x3b873e(0x115)];_0xb64d3c++){const _0x18d0ee=_0x29ab1f[_0xb64d3c],_0x2bddcc=_0x214def[_0x18d0ee['name']],_0x3c7f3d=!_0x18d0ee['next']&&_0xb64d3c<_0x29ab1f[_0x3b873e(0x115)]-0x1&&_0x18d0ee['type']!==_0x3b873e(0xb2)?_0x29ab1f[_0xb64d3c+0x1][_0x3b873e(0x92)]:_0x18d0ee[_0x3b873e(0x11f)],_0xddb4aa=_0x3c7f3d!==_0x18d0ee[_0x3b873e(0x11f)]?{..._0x18d0ee,'next':_0x3c7f3d}:_0x18d0ee;_0x57ce37[_0x3b873e(0xeb)][_0x2bddcc]=await convertYamlStepToApi(_0xddb4aa,_0x4135f5,_0x1e6474,_0x214def,_0x4a5cd6);}}else _0x8b7974[_0x3b873e(0xaa)]&&(_0x57ce37[_0x3b873e(0xce)]=_0x8b7974[_0x3b873e(0xaa)]);return _0x57ce37;}async function convertYamlCriteriaToApi(_0x3d7866,_0x3cfce2,_0x5754ca={}){const _0x59d793=a147_0x4543;let _0x4d8317=_0x3d7866['segment'];if(_0x4d8317&&!/^\d+$/[_0x59d793(0x113)](_0x4d8317)){const _0x3d2efa=parseSegmentRef(_0x4d8317);if(_0x3d2efa[_0x59d793(0xd2)]==='ref')_0x3cfce2?.[_0x59d793(0xd4)]&&(_0x4d8317=await _0x3cfce2['resolveSegmentId'](_0x3d2efa[_0x59d793(0x92)]));else{if(_0x3d2efa[_0x59d793(0xd2)]===_0x59d793(0x133)&&_0x5754ca[_0x3d2efa[_0x59d793(0x92)]])_0x3cfce2?.[_0x59d793(0x11d)]&&(_0x4d8317=await _0x3cfce2['resolveEmbeddedSegmentId'](_0x3d2efa[_0x59d793(0x92)],_0x5754ca[_0x3d2efa[_0x59d793(0x92)]]));else _0x3cfce2?.[_0x59d793(0xd4)]&&(_0x4d8317=await _0x3cfce2[_0x59d793(0xd4)](_0x3d2efa[_0x59d793(0x92)]));}}const _0x1e07ed={'name':_0x3d7866['name'],'segmentId':_0x4d8317};_0x3d7866[_0x59d793(0xa3)]&&(_0x1e07ed[_0x59d793(0xa3)]=_0x3d7866['description']);if(_0x3d7866[_0x59d793(0x135)]){const _0x1b87a6=_0x3d7866['target']['journey'],_0x88de3e=_0x3d7866[_0x59d793(0x135)][_0x59d793(0xc9)];let _0x341e5c=_0x3d7866['target'][_0x59d793(0xc0)];_0x3cfce2?.[_0x59d793(0xc2)]&&!/^\d+$/[_0x59d793(0x113)](_0x341e5c)&&(_0x341e5c=await _0x3cfce2[_0x59d793(0xc2)](_0x341e5c));let _0x3573a0=_0x3d7866[_0x59d793(0x135)][_0x59d793(0xc9)];_0x3cfce2?.[_0x59d793(0xa1)]&&!/^\d+$/['test'](_0x3573a0)&&(_0x3573a0=await _0x3cfce2[_0x59d793(0xa1)](_0x341e5c,_0x3573a0));const _0x50cfba=!/^\d+$/[_0x59d793(0x113)](_0x1b87a6)&&!isLocalJourneyRef(_0x1b87a6)?formatApiJourneyName(_0x1b87a6,_0x88de3e):undefined;_0x1e07ed[_0x59d793(0x135)]={'journeyId':_0x341e5c,'journeyStageId':_0x3573a0,'journeyName':_0x50cfba,'confirmed':!![]},_0x3d7866['target'][_0x59d793(0x8e)]&&(_0x1e07ed[_0x59d793(0x135)]['journeyBundleId']=_0x3d7866[_0x59d793(0x135)][_0x59d793(0x8e)]);}return _0x1e07ed;}async function convertYamlStepToApi(_0x3ea9c3,_0x4e56f6,_0x5a4456={},_0xa2c04a={},_0x18684e={}){const _0x42dff8=a147_0x4543,_0x400dcf=async _0x366278=>{const _0x3e4b41=a147_0x4543;if(/^\d+$/[_0x3e4b41(0x113)](_0x366278))return _0x366278;const _0x1f0446=parseSegmentRef(_0x366278);if(_0x1f0446[_0x3e4b41(0xd2)]===_0x3e4b41(0xa2)){if(_0x4e56f6?.[_0x3e4b41(0xd4)])return await _0x4e56f6[_0x3e4b41(0xd4)](_0x1f0446['name']);}else{if(_0x1f0446[_0x3e4b41(0xd2)]==='embedded'&&_0x5a4456[_0x1f0446['name']]){if(_0x4e56f6?.[_0x3e4b41(0x11d)])return await _0x4e56f6[_0x3e4b41(0x11d)](_0x1f0446[_0x3e4b41(0x92)],_0x5a4456[_0x1f0446['name']]);}else{if(_0x4e56f6?.[_0x3e4b41(0xd4)])return await _0x4e56f6[_0x3e4b41(0xd4)](_0x1f0446['name']);}}return _0x366278;},_0x547ed0=async _0x576801=>{const _0x5e3973=a147_0x4543;if(/^\d+$/[_0x5e3973(0x113)](_0x576801))return _0x576801;const _0x39e3a2=parseSegmentRef(_0x576801);if(_0x39e3a2[_0x5e3973(0xd2)]==='ref'){if(_0x4e56f6?.[_0x5e3973(0x104)])return await _0x4e56f6[_0x5e3973(0x104)](_0x39e3a2[_0x5e3973(0x92)]);return _0x39e3a2[_0x5e3973(0x92)];}else{if(_0x39e3a2[_0x5e3973(0xd2)]===_0x5e3973(0x133)&&_0x18684e[_0x39e3a2[_0x5e3973(0x92)]]){if(_0x4e56f6?.[_0x5e3973(0xc6)])return await _0x4e56f6[_0x5e3973(0xc6)](_0x39e3a2[_0x5e3973(0x92)],_0x18684e[_0x39e3a2[_0x5e3973(0x92)]]);if(_0x4e56f6?.[_0x5e3973(0x104)])return await _0x4e56f6[_0x5e3973(0x104)](_0x39e3a2[_0x5e3973(0x92)]);}else{if(_0x4e56f6?.[_0x5e3973(0x104)])return await _0x4e56f6[_0x5e3973(0x104)](_0x39e3a2[_0x5e3973(0x92)]);}}return _0x576801;},_0x192231=_0x2fee81=>{if(!_0x2fee81)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i['test'](_0x2fee81))return _0x2fee81;return _0xa2c04a[_0x2fee81]||_0x2fee81;};switch(_0x3ea9c3[_0x42dff8(0xd2)]){case _0x42dff8(0xd0):{const _0x3a4715=_0x3ea9c3,_0x2d0506=_0x3a4715['with'],_0x280fd0={'type':_0x42dff8(0x11e),'name':_0x3a4715['name'],'next':_0x192231(_0x3a4715[_0x42dff8(0x11f)])};if(_0x2d0506[_0x42dff8(0x131)]!==undefined&&_0x2d0506[_0x42dff8(0x12e)])_0x280fd0[_0x42dff8(0x96)]='Duration',_0x280fd0[_0x42dff8(0xfc)]=_0x2d0506['duration'],_0x280fd0[_0x42dff8(0xf9)]=normalizeWaitUnit(_0x2d0506[_0x42dff8(0x12e)]);else{if(_0x2d0506[_0x42dff8(0xe8)])_0x280fd0['waitStepType']=_0x42dff8(0x144),_0x280fd0[_0x42dff8(0x110)]=_0x2d0506[_0x42dff8(0xe8)];else{if(_0x2d0506[_0x42dff8(0xca)])_0x280fd0[_0x42dff8(0x96)]=_0x42dff8(0x10c),_0x280fd0['daysOfWeek']=_0x2d0506[_0x42dff8(0xca)];else{if(_0x2d0506[_0x42dff8(0x119)]){_0x280fd0[_0x42dff8(0x96)]=_0x42dff8(0x114);const _0x58dd14=await _0x400dcf(_0x2d0506[_0x42dff8(0x119)][_0x42dff8(0xf5)]),_0xa7eb91=_0x2d0506['condition']['timeout']?.['next']!==undefined;if(_0xa7eb91){const _0x292f67=[];_0x292f67[_0x42dff8(0xb5)]({'id':generateUUID(),'segmentId':_0x58dd14,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x192231(_0x2d0506[_0x42dff8(0x119)][_0x42dff8(0x11f)]??_0x3a4715[_0x42dff8(0x11f)])});if(_0x2d0506['condition'][_0x42dff8(0xd7)]){const _0x5458ee=_0x2d0506[_0x42dff8(0x119)][_0x42dff8(0xd7)]['duration'],_0x91efc0=normalizeWaitUnit(_0x2d0506['condition'][_0x42dff8(0xd7)][_0x42dff8(0x12e)]);_0x292f67[_0x42dff8(0xb5)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x42dff8(0x9d)+_0x5458ee+'\x20'+_0x91efc0,'moveAfter':_0x5458ee,'unit':_0x91efc0,'next':_0x192231(_0x2d0506[_0x42dff8(0x119)][_0x42dff8(0xd7)][_0x42dff8(0x11f)])});}_0x280fd0[_0x42dff8(0x140)]=_0x292f67,delete _0x280fd0['next'];}else _0x280fd0[_0x42dff8(0x11c)]=_0x58dd14,_0x2d0506[_0x42dff8(0x119)][_0x42dff8(0xd7)]&&(_0x280fd0[_0x42dff8(0xf1)]=_0x2d0506[_0x42dff8(0x119)][_0x42dff8(0xd7)][_0x42dff8(0x131)],_0x2d0506[_0x42dff8(0x119)]['timeout']['unit']&&(_0x280fd0[_0x42dff8(0xf2)]=normalizeWaitUnit(_0x2d0506[_0x42dff8(0x119)]['timeout'][_0x42dff8(0x12e)])));}}}}return _0x280fd0;}case'activation':{const _0x1a9faa=_0x3ea9c3,_0x10bdcc=_0x1a9faa['with'][_0x42dff8(0x125)],_0xe958c6=await _0x547ed0(_0x10bdcc);return{'type':_0x42dff8(0xfa),'name':_0x1a9faa['name'],'journeyActivationStepId':_0xe958c6,'next':_0x192231(_0x1a9faa[_0x42dff8(0x11f)])};}case _0x42dff8(0x10f):{const _0x5db9ab=_0x3ea9c3,_0x20458e=_0x5db9ab[_0x42dff8(0xe6)][_0x42dff8(0x118)];return{'type':_0x42dff8(0x9e),'name':_0x5db9ab[_0x42dff8(0x92)],'branches':await Promise[_0x42dff8(0xd1)](_0x20458e[_0x42dff8(0x11b)](async _0x1c57ad=>{const _0x2ed29e=_0x42dff8;let _0x359f09='';if(!_0x1c57ad[_0x2ed29e(0x10e)]){const _0x379927=_0x1c57ad['segment']||_0x1c57ad[_0x2ed29e(0xab)]||'';_0x359f09=_0x379927?await _0x400dcf(_0x379927):'';}return{'id':crypto[_0x2ed29e(0xee)](),'name':_0x1c57ad[_0x2ed29e(0x92)],'description':null,'segmentId':_0x359f09,'excludedPath':_0x1c57ad[_0x2ed29e(0x10e)]??![],'next':_0x192231(_0x1c57ad[_0x2ed29e(0x11f)])};})),'next':_0x192231(_0x5db9ab[_0x42dff8(0x11f)])};}case'ab_test':{const _0x3ff647=_0x3ea9c3,_0x2d964d=_0x3ff647[_0x42dff8(0xe6)];return{'type':_0x42dff8(0x13a),'name':_0x3ff647[_0x42dff8(0x92)],'customizedSplit':_0x2d964d[_0x42dff8(0x100)],'uniqueId':_0x2d964d['unique_id'],'variants':_0x2d964d[_0x42dff8(0xdd)]['map'](_0x5af9fc=>({'id':_0x5af9fc['id']||generateUUID(),'name':_0x5af9fc[_0x42dff8(0x92)],'percentage':_0x5af9fc['percentage'],'next':_0x192231(_0x5af9fc[_0x42dff8(0x11f)])})),'next':_0x192231(_0x3ff647[_0x42dff8(0x11f)])};}case _0x42dff8(0x14c):return{'type':_0x42dff8(0xb4),'name':_0x3ea9c3[_0x42dff8(0x92)],'next':_0x192231(_0x3ea9c3['next'])};case _0x42dff8(0x14a):{const _0x1576b8=_0x3ea9c3,_0x5ad806=_0x1576b8[_0x42dff8(0xe6)]['target'],_0x1241f9=_0x5ad806[_0x42dff8(0xc0)],_0x55a0a3=_0x5ad806[_0x42dff8(0xc9)];let _0x49233f=_0x5ad806[_0x42dff8(0xc0)];_0x4e56f6?.[_0x42dff8(0xc2)]&&!/^\d+$/[_0x42dff8(0x113)](_0x49233f)&&(_0x49233f=await _0x4e56f6[_0x42dff8(0xc2)](_0x49233f));let _0x422c2d=_0x5ad806[_0x42dff8(0xc9)];_0x4e56f6?.[_0x42dff8(0xa1)]&&!/^\d+$/[_0x42dff8(0x113)](_0x422c2d)&&(_0x422c2d=await _0x4e56f6[_0x42dff8(0xa1)](_0x49233f,_0x422c2d));const _0x326f98=!/^\d+$/[_0x42dff8(0x113)](_0x1241f9)&&!isLocalJourneyRef(_0x1241f9)?formatApiJourneyName(_0x1241f9,_0x55a0a3):undefined;return{'type':_0x42dff8(0x90),'name':_0x1576b8['name'],'target':{'journeyId':_0x49233f,'journeyStageId':_0x422c2d,'journeyBundleId':_0x5ad806[_0x42dff8(0x8e)],'journeyName':_0x326f98,'confirmed':!![]},'next':_0x192231(_0x1576b8[_0x42dff8(0x11f)])};}case'end':return{'type':_0x42dff8(0x8f),'name':_0x3ea9c3[_0x42dff8(0x92)]};default:{const _0x44d835=_0x3ea9c3;return{'type':'End','name':_0x44d835[_0x42dff8(0x92)]};}}}export function toYamlString(_0x3ab4d1){const _0x9170c4=a147_0x4543,_0x18045c=stripInternalFields(_0x3ab4d1),_0x5b15e9=a147_0x3719d3[_0x9170c4(0xa9)](_0x18045c,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x3f90e8=['segments:',_0x9170c4(0x148),_0x9170c4(0x147),_0x9170c4(0xe0),'journeys:',_0x9170c4(0xac),_0x9170c4(0xe3)];let _0x2eea5e=_0x5b15e9;for(const _0x338255 of _0x3f90e8){_0x2eea5e=_0x2eea5e[_0x9170c4(0x107)](new RegExp('^('+_0x338255+')','m'),(_0xab3292,_0x3281af,_0x50eb4d)=>{if(_0x50eb4d===0x0||_0x2eea5e[_0x50eb4d-0x1]==='\x0a'&&_0x2eea5e[_0x50eb4d-0x2]==='\x0a')return _0x3281af;return'\x0a'+_0x3281af;});}return _0x2eea5e;}function stripInternalFields(_0x5f4957){const _0x41ac51=a147_0x4543,{id:_0x213a4e,folder_id:_0x49b693,bundle_id:_0x5bf6e7,bundle_name:_0x41e04e,version:_0x2648d0,allow_reentry:_0xc0e20b,..._0x39bd64}=_0x5f4957;return _0x39bd64[_0x41ac51(0x124)]&&(_0x39bd64['journeys']=_0x39bd64[_0x41ac51(0x124)][_0x41ac51(0x11b)](_0x4ea843=>{const _0xbd74c3=_0x41ac51,{id:_0x1f8fd1,..._0x3c58ec}=_0x4ea843;return{..._0x3c58ec,'stages':_0x3c58ec['stages'][_0xbd74c3(0x11b)](stripStageInternalFields),..._0x4ea843[_0xbd74c3(0xf8)]===!![]?{'latest':!![]}:{},..._0x39bd64['journeys'][_0xbd74c3(0x115)]===0x1&&_0x3c58ec[_0xbd74c3(0xbe)]==='v1'?{'version':undefined}:{}};})),_0x39bd64[_0x41ac51(0x12c)]&&(_0x39bd64[_0x41ac51(0x12c)]=_0x39bd64['stages'][_0x41ac51(0x11b)](stripStageInternalFields)),_0x39bd64[_0x41ac51(0x94)]&&(_0x39bd64[_0x41ac51(0x94)]=_0x39bd64[_0x41ac51(0x94)][_0x41ac51(0x11b)](_0x5f3eb0=>{const _0x30f11c=_0x41ac51,{id:_0x2f7053,..._0x5852be}=_0x5f3eb0;return{..._0x5852be,'stages':_0x5852be['stages'][_0x30f11c(0x11b)](stripStageInternalFields),..._0x5f3eb0[_0x30f11c(0xf8)]===!![]?{'latest':!![]}:{}};})),_0x39bd64;}function stripStageInternalFields(_0x170a1a){const {id:_0x271c56,..._0x5f0e14}=_0x170a1a;return _0x5f0e14;}export function parseYamlString(_0x55a555){return safeParseYaml(_0x55a555,JourneyDefSchema);}export function isJourneyDef(_0x4cdc79){const _0x355e02=a147_0x4543;return typeof _0x4cdc79===_0x355e02(0x95)&&_0x4cdc79!==null&&'type'in _0x4cdc79&&_0x4cdc79[_0x355e02(0xd2)]==='journey';}export function generateTemplate(_0xe9cae4,_0x4db760){const _0x30bbc6=a147_0x4543,_0x16ad52={'type':_0x30bbc6(0xc0),'name':_0xe9cae4,'description':_0x30bbc6(0xa7),'reentry':'no_reentry','goal':{'name':_0x30bbc6(0xb0),'segment':'goal-segment'},'stages':[{'name':'Stage\x201','description':'First\x20stage\x20of\x20the\x20journey','entry_criteria':{'name':'Entry\x20Criteria','segment':_0x4db760},'steps':[{'type':_0x30bbc6(0xd0),'name':_0x30bbc6(0x122),'with':{'duration':0x1,'unit':_0x30bbc6(0xb7)}},{'type':_0x30bbc6(0x125),'name':_0x30bbc6(0xad),'with':{'activation':'your-activation-name'}},{'type':_0x30bbc6(0xb2),'name':'Stage\x20Complete'}]}]};return toYamlString(_0x16ad52);}function generateUUID(){const _0x144025=a147_0x4543;return crypto[_0x144025(0xee)]();}export const SEGMENT_REF_PREFIX='ref:';export function parseSegmentRef(_0x495a90){const _0x1119d7=a147_0x4543;if(_0x495a90[_0x1119d7(0xde)](SEGMENT_REF_PREFIX))return{'type':_0x1119d7(0xa2),'name':_0x495a90[_0x1119d7(0xf7)](SEGMENT_REF_PREFIX[_0x1119d7(0x115)])};if(/^\d+$/[_0x1119d7(0x113)](_0x495a90))return{'type':'id','name':_0x495a90};return{'type':_0x1119d7(0x133),'name':_0x495a90};}export function makeSegmentRef(_0xd9e74c){return''+SEGMENT_REF_PREFIX+_0xd9e74c;}export function isExternalSegmentRef(_0x201b7e){return _0x201b7e['startsWith'](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x1c9b58){const _0x20876f=a147_0x4543;return!!(_0x1c9b58[_0x20876f(0x124)]&&_0x1c9b58['journeys'][_0x20876f(0x115)]>0x0);}export function isMultiVersionMode(_0x637986){const _0x3e4ffd=a147_0x4543;return!!(_0x637986['versions']&&_0x637986[_0x3e4ffd(0x94)][_0x3e4ffd(0x115)]>0x0);}export function isSingleVersionMode(_0x319bf1){const _0x27bb92=a147_0x4543;return!!(_0x319bf1[_0x27bb92(0x12c)]&&_0x319bf1['stages']['length']>0x0);}export function hasMultipleVersions(_0x46e919){const _0x5ef47f=a147_0x4543;if(isJourneysArrayMode(_0x46e919))return(_0x46e919[_0x5ef47f(0x124)]?.['length']||0x0)>0x1;if(isMultiVersionMode(_0x46e919))return(_0x46e919[_0x5ef47f(0x94)]?.[_0x5ef47f(0x115)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x1c8b22){const _0x204239=a147_0x4543;if(isJourneysArrayMode(_0x1c8b22))return _0x1c8b22;if(isSingleVersionMode(_0x1c8b22)){const {stages:_0x61c076,id:_0x3f0a68,version:_0x89b8cf,version_number:_0x52be6c,..._0x259ca2}=_0x1c8b22;return{..._0x259ca2,'journeys':[{'version':_0x89b8cf||'v1','stages':_0x61c076||[],'id':_0x3f0a68,'version_number':_0x52be6c}]};}if(isMultiVersionMode(_0x1c8b22)){const {versions:_0x4380d0,..._0x340521}=_0x1c8b22;return{..._0x340521,'journeys':(_0x4380d0||[])[_0x204239(0x11b)](_0x2a1ed6=>({'version':_0x2a1ed6['name'],'state':_0x2a1ed6[_0x204239(0xea)],'latest':_0x2a1ed6[_0x204239(0xf8)],'stages':_0x2a1ed6[_0x204239(0x12c)],'id':_0x2a1ed6['id'],'version_number':_0x2a1ed6[_0x204239(0xf6)]}))};}return _0x1c8b22;}export function normalizeJourneyDef(_0x7af486,_0x17a983){const _0x44d927=a147_0x4543,_0x42e385=normalizeToJourneysFormat(_0x7af486),_0x5d075e=_0x17a983?.['segments']?Object[_0x44d927(0xed)](_0x17a983[_0x44d927(0xaf)]):undefined,_0x2c8371=_0x17a983?.[_0x44d927(0xe2)]?Object['keys'](_0x17a983[_0x44d927(0xe2)]):undefined;return{'type':_0x44d927(0xc0),'name':_0x42e385[_0x44d927(0x92)],..._0x42e385[_0x44d927(0xa3)]!==undefined&&{'description':_0x42e385[_0x44d927(0xa3)]},..._0x42e385['goal']&&{'goal':normalizeJourneyCriteria(_0x42e385[_0x44d927(0x9c)])},..._0x42e385[_0x44d927(0x129)]!==undefined&&{'reentry':_0x42e385[_0x44d927(0x129)]},..._0x42e385[_0x44d927(0xaf)]&&{'segments':normalizeEmbeddedSegments(_0x42e385['segments'],_0x5d075e)},..._0x42e385['activations']&&{'activations':normalizeEmbeddedActivations(_0x42e385[_0x44d927(0xe2)],_0x2c8371)},..._0x42e385[_0x44d927(0x124)]&&{'journeys':_0x42e385['journeys'][_0x44d927(0x11b)](_0x873a62=>normalizeJourneyEntry(_0x873a62,_0x42e385['journeys'][_0x44d927(0x115)]===0x1))}};}function normalizeJourneyEntry(_0x422e35,_0x569582){const _0x18a02d=a147_0x4543;return{...!_0x569582&&_0x422e35[_0x18a02d(0xbe)]!==undefined&&{'version':_0x422e35[_0x18a02d(0xbe)]},..._0x422e35[_0x18a02d(0xea)]!==undefined&&{'state':_0x422e35[_0x18a02d(0xea)]},...!_0x569582&&_0x422e35[_0x18a02d(0xf8)]!==undefined&&{'latest':_0x422e35[_0x18a02d(0xf8)]},..._0x422e35['version_number']!==undefined&&{'version_number':_0x422e35[_0x18a02d(0xf6)]},..._0x422e35['goal']&&{'goal':normalizeJourneyCriteria(_0x422e35['goal'])},..._0x422e35[_0x18a02d(0x129)]!==undefined&&{'reentry':_0x422e35[_0x18a02d(0x129)]},'stages':_0x422e35[_0x18a02d(0x12c)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x188336){const _0x27d0fc=a147_0x4543;return{'name':_0x188336[_0x27d0fc(0x92)],..._0x188336[_0x27d0fc(0xa3)]!==undefined&&{'description':_0x188336[_0x27d0fc(0xa3)]},..._0x188336[_0x27d0fc(0xd5)]&&{'entry_criteria':normalizeJourneyCriteria(_0x188336[_0x27d0fc(0xd5)])},..._0x188336[_0x27d0fc(0x123)]&&{'exit_criteria':_0x188336[_0x27d0fc(0x123)]['map'](normalizeJourneyCriteria)},..._0x188336[_0x27d0fc(0xa8)]&&{'milestone':normalizeJourneyCriteria(_0x188336[_0x27d0fc(0xa8)])},..._0x188336[_0x27d0fc(0xeb)]&&{'steps':normalizeStepsWithImplicitNext(_0x188336[_0x27d0fc(0xeb)])}};}function normalizeStepsWithImplicitNext(_0x132ff1){const _0x20a422=a147_0x4543;return _0x132ff1[_0x20a422(0x11b)]((_0x4bab0e,_0x209dd6)=>{const _0x33eaf7=_0x20a422,_0x190621=_0x209dd6<_0x132ff1[_0x33eaf7(0x115)]-0x1?_0x132ff1[_0x209dd6+0x1][_0x33eaf7(0x92)]:undefined;return normalizeJourneyStep(_0x4bab0e,_0x190621);});}function normalizeJourneyCriteria(_0x50680f){const _0x2b931a=a147_0x4543;return{'name':_0x50680f[_0x2b931a(0x92)],..._0x50680f[_0x2b931a(0xa3)]!==undefined&&{'description':_0x50680f[_0x2b931a(0xa3)]},'segment':_0x50680f[_0x2b931a(0xf5)],..._0x50680f[_0x2b931a(0x135)]&&{'target':normalizeJumpTarget(_0x50680f[_0x2b931a(0x135)])}};}function normalizeJourneyStep(_0x5c49c5,_0x5813d6){const _0x64ffd9=a147_0x4543,_0x3a6316=_0x5c49c5[_0x64ffd9(0x11f)]!==undefined&&_0x5c49c5[_0x64ffd9(0x11f)]!==_0x5813d6,_0x572a43={'type':_0x5c49c5['type'],'name':_0x5c49c5[_0x64ffd9(0x92)],..._0x3a6316&&{'next':_0x5c49c5['next']}};if(_0x64ffd9(0xe6)in _0x5c49c5&&_0x5c49c5['with'])return{..._0x572a43,'with':normalizeStepParams(_0x5c49c5['type'],_0x5c49c5[_0x64ffd9(0xe6)])};return _0x572a43;}function normalizeStepParams(_0x587a16,_0xb4ecfd){const _0x5dd966=a147_0x4543;switch(_0x587a16){case _0x5dd966(0xd0):{const _0x260c37=_0xb4ecfd;let _0x44a6cb;return _0x260c37[_0x5dd966(0x119)]&&(_0x44a6cb={'segment':_0x260c37[_0x5dd966(0x119)][_0x5dd966(0xf5)],..._0x260c37[_0x5dd966(0x119)]['next']!==undefined&&{'next':_0x260c37[_0x5dd966(0x119)][_0x5dd966(0x11f)]},..._0x260c37[_0x5dd966(0x119)]['timeout']&&{'timeout':{'duration':_0x260c37[_0x5dd966(0x119)][_0x5dd966(0xd7)][_0x5dd966(0x131)],'unit':_0x260c37['condition'][_0x5dd966(0xd7)][_0x5dd966(0x12e)],..._0x260c37[_0x5dd966(0x119)]['timeout'][_0x5dd966(0x11f)]!==undefined&&{'next':_0x260c37[_0x5dd966(0x119)]['timeout']['next']}}}}),{..._0x260c37[_0x5dd966(0x131)]!==undefined&&{'duration':_0x260c37[_0x5dd966(0x131)]},..._0x260c37['unit']!==undefined&&{'unit':_0x260c37[_0x5dd966(0x12e)]},..._0x260c37['wait_until']!==undefined&&{'wait_until':_0x260c37[_0x5dd966(0xe8)]},..._0x260c37[_0x5dd966(0xca)]!==undefined&&{'days_of_week':_0x260c37[_0x5dd966(0xca)]},..._0x44a6cb&&{'condition':_0x44a6cb}};}case _0x5dd966(0x125):{const _0x114229=_0xb4ecfd;return{'activation':_0x114229['activation']};}case _0x5dd966(0x10f):{const _0x352d02=_0xb4ecfd;return{'branches':_0x352d02[_0x5dd966(0x118)][_0x5dd966(0x11b)](normalizeDecisionBranch)};}case _0x5dd966(0xf0):{const _0x407110=_0xb4ecfd;return{..._0x407110[_0x5dd966(0x100)]!==undefined&&{'customized_split':_0x407110[_0x5dd966(0x100)]},..._0x407110['unique_id']!==undefined&&{'unique_id':_0x407110[_0x5dd966(0xb3)]},'variants':_0x407110[_0x5dd966(0xdd)][_0x5dd966(0x11b)](normalizeAbTestVariant)};}case'jump':{const _0x1252ff=_0xb4ecfd;return{'target':normalizeJumpTarget(_0x1252ff[_0x5dd966(0x135)])};}default:return _0xb4ecfd;}}function normalizeDecisionBranch(_0x57c03f){const _0x5b2144=a147_0x4543;return{'name':_0x57c03f[_0x5b2144(0x92)],..._0x57c03f[_0x5b2144(0xf5)]!==undefined&&{'segment':_0x57c03f[_0x5b2144(0xf5)]},..._0x57c03f[_0x5b2144(0x10e)]!==undefined&&{'excluded':_0x57c03f[_0x5b2144(0x10e)]},..._0x57c03f['next']!==undefined&&{'next':_0x57c03f[_0x5b2144(0x11f)]}};}function normalizeAbTestVariant(_0x54f03e){const _0x2a7070=a147_0x4543;return{..._0x54f03e['id']!==undefined&&{'id':_0x54f03e['id']},'name':_0x54f03e[_0x2a7070(0x92)],'percentage':_0x54f03e[_0x2a7070(0xe4)],..._0x54f03e[_0x2a7070(0x11f)]!==undefined&&{'next':_0x54f03e[_0x2a7070(0x11f)]}};}function normalizeJumpTarget(_0x2b63a7){const _0x46a710=a147_0x4543;return{'journey':_0x2b63a7[_0x46a710(0xc0)],'stage':_0x2b63a7[_0x46a710(0xc9)],..._0x2b63a7['bundle_id']!==undefined&&{'bundle_id':_0x2b63a7[_0x46a710(0x8e)]}};}function normalizeEmbeddedSegments(_0x28bcdf,_0x2faf7d){const _0x1b8585=a147_0x4543,_0x3328f6={},_0x2a1950=Object[_0x1b8585(0xed)](_0x28bcdf),_0x1ca058=_0x2faf7d?[..._0x2faf7d[_0x1b8585(0xb8)](_0x5113c7=>_0x2a1950[_0x1b8585(0xff)](_0x5113c7)),..._0x2a1950[_0x1b8585(0xb8)](_0x3f8563=>!_0x2faf7d[_0x1b8585(0xff)](_0x3f8563))[_0x1b8585(0x91)]()]:_0x2a1950[_0x1b8585(0x91)]();for(const _0x401454 of _0x1ca058){const _0x144f71=_0x28bcdf[_0x401454];if(_0x144f71[_0x1b8585(0x142)]){const _0x103830=_0x144f71[_0x1b8585(0x142)];if(_0x103830[_0x1b8585(0xd2)]!==_0x1b8585(0xbf)&&_0x103830[_0x1b8585(0xd2)]!=='Or'){const _0x3d90b0=_0x103830[_0x1b8585(0xd2)]??_0x1b8585(0xcb);throw new SDKError(ErrorCode[_0x1b8585(0x12f)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x401454+_0x1b8585(0x120)+(_0x1b8585(0x10a)+_0x3d90b0+_0x1b8585(0xe9))+_0x1b8585(0x12b)+_0x1b8585(0xc5)+'\x20\x20\x20\x20type:\x20And\x0a'+_0x1b8585(0x112)+_0x1b8585(0xda)+_0x1b8585(0xdf)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x103830['conditions']||!Array['isArray'](_0x103830['conditions']))throw new SDKError(ErrorCode[_0x1b8585(0x12f)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x401454+'\x27:\x20'+_0x1b8585(0x13b)+'Expected\x20format:\x0a'+'\x20\x20rule:\x0a'+('\x20\x20\x20\x20type:\x20'+_0x103830[_0x1b8585(0xd2)]+'\x0a')+_0x1b8585(0x112)+_0x1b8585(0xda)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x1b8585(0x105));}_0x3328f6[_0x401454]={..._0x144f71[_0x1b8585(0xa3)]&&_0x144f71[_0x1b8585(0xa3)]['trim']()&&{'description':_0x144f71[_0x1b8585(0xa3)]},..._0x144f71[_0x1b8585(0x142)]&&{'rule':deepSortObject(_0x144f71[_0x1b8585(0x142)])}};}return _0x3328f6;}function normalizeEmbeddedActivations(_0x2c0559,_0x3026b8){const _0x969a47=a147_0x4543,_0x11a455={},_0x5011ce=Object[_0x969a47(0xed)](_0x2c0559),_0x428fc5=_0x3026b8?[..._0x3026b8[_0x969a47(0xb8)](_0xb7fbd5=>_0x5011ce['includes'](_0xb7fbd5)),..._0x5011ce[_0x969a47(0xb8)](_0x44ae00=>!_0x3026b8[_0x969a47(0xff)](_0x44ae00))[_0x969a47(0x91)]()]:_0x5011ce['sort']();for(const _0x4d03e8 of _0x428fc5){const _0x2dc06f=_0x2c0559[_0x4d03e8];_0x11a455[_0x4d03e8]={'name':_0x2dc06f[_0x969a47(0x92)],'connection':_0x2dc06f['connection'],..._0x2dc06f[_0x969a47(0xa3)]!==undefined&&{'description':_0x2dc06f[_0x969a47(0xa3)]},..._0x2dc06f[_0x969a47(0xb1)]!==undefined&&{'all_columns':_0x2dc06f[_0x969a47(0xb1)]},..._0x2dc06f[_0x969a47(0x108)]!==undefined&&{'columns':_0x2dc06f[_0x969a47(0x108)]},..._0x2dc06f[_0x969a47(0x127)]!==undefined&&{'behavior':_0x2dc06f[_0x969a47(0x127)]},..._0x2dc06f['schedule']!==undefined&&{'schedule':_0x2dc06f[_0x969a47(0xc4)]},..._0x2dc06f[_0x969a47(0x13f)]!==undefined&&{'notification':_0x2dc06f[_0x969a47(0x13f)]},..._0x2dc06f[_0x969a47(0xe5)]!==undefined&&{'connector_config':_0x2dc06f['connector_config']},..._0x2dc06f['activation_template_id']!==undefined&&{'activation_template_id':_0x2dc06f[_0x969a47(0x149)]}};}return _0x11a455;}export function getActiveStages(_0x3e6468){const _0x4d7ef5=a147_0x4543;if(isJourneysArrayMode(_0x3e6468)){const _0x455d2f=_0x3e6468[_0x4d7ef5(0x124)]||[],_0x15fcf1=_0x455d2f[_0x4d7ef5(0x9a)](_0x4e6551=>_0x4e6551[_0x4d7ef5(0xf8)]===!![])||_0x455d2f[0x0];return _0x15fcf1?.[_0x4d7ef5(0x12c)]||[];}if(isSingleVersionMode(_0x3e6468))return _0x3e6468['stages']||[];if(isMultiVersionMode(_0x3e6468)){const _0x1d84d9=_0x3e6468[_0x4d7ef5(0x94)]||[],_0x4fece2=_0x1d84d9[_0x4d7ef5(0x9a)](_0x5ec480=>_0x5ec480[_0x4d7ef5(0xf8)]===!![])||_0x1d84d9[0x0];return _0x4fece2?.[_0x4d7ef5(0x12c)]||[];}return[];}export function getLatestJourneyEntry(_0x37af2e){const _0x2df6b2=a147_0x4543;if(isJourneysArrayMode(_0x37af2e)){const _0x44c53b=_0x37af2e[_0x2df6b2(0x124)]||[];return _0x44c53b[_0x2df6b2(0x9a)](_0x1511c8=>_0x1511c8[_0x2df6b2(0xf8)]===!![])||_0x44c53b[0x0];}if(isMultiVersionMode(_0x37af2e)){const _0x485ba0=_0x37af2e[_0x2df6b2(0x94)]||[],_0x5a44c8=_0x485ba0['find'](_0x1ac793=>_0x1ac793[_0x2df6b2(0xf8)]===!![])||_0x485ba0[0x0];if(_0x5a44c8)return{'version':_0x5a44c8[_0x2df6b2(0x92)],'state':_0x5a44c8['state'],'latest':_0x5a44c8[_0x2df6b2(0xf8)],'stages':_0x5a44c8[_0x2df6b2(0x12c)],'id':_0x5a44c8['id'],'version_number':_0x5a44c8[_0x2df6b2(0xf6)]};}if(isSingleVersionMode(_0x37af2e))return{'version':_0x37af2e[_0x2df6b2(0xbe)]||'v1','state':_0x2df6b2(0x10d),'stages':_0x37af2e[_0x2df6b2(0x12c)]||[],'id':_0x37af2e['id'],'version_number':_0x37af2e[_0x2df6b2(0xf6)],'goal':_0x37af2e[_0x2df6b2(0x9c)],'reentry':_0x37af2e[_0x2df6b2(0x129)]};return undefined;}export function getLatestVersion(_0x4db926){const _0x4d3a3a=a147_0x4543;if(!isMultiVersionMode(_0x4db926))return undefined;const _0x4ebadc=_0x4db926['versions']||[];return _0x4ebadc['find'](_0x57783a=>_0x57783a[_0x4d3a3a(0xf8)]===!![])||_0x4ebadc[0x0];}export function getEffectiveGoal(_0x34fcee){const _0x582f55=getLatestJourneyEntry(_0x34fcee);return _0x582f55?.['goal']||_0x34fcee['goal'];}export function getEffectiveReentry(_0x3c964c){const _0xa3a397=a147_0x4543,_0x4c56a1=getLatestJourneyEntry(_0x3c964c);return _0x4c56a1?.[_0xa3a397(0x129)]||_0x3c964c[_0xa3a397(0x129)];}export function collectSegmentRefs(_0x5191d1){const _0x5a21c6=a147_0x4543,_0xce8dc1=new Set();_0x5191d1[_0x5a21c6(0x9c)]?.[_0x5a21c6(0xf5)]&&_0xce8dc1[_0x5a21c6(0x126)](_0x5191d1[_0x5a21c6(0x9c)][_0x5a21c6(0xf5)]);const _0x5d4a1c=_0x2bfd54=>{const _0x5b61be=_0x5a21c6;for(const _0x1d7a5b of _0x2bfd54){_0x1d7a5b[_0x5b61be(0xd5)]?.[_0x5b61be(0xf5)]&&_0xce8dc1[_0x5b61be(0x126)](_0x1d7a5b[_0x5b61be(0xd5)][_0x5b61be(0xf5)]);if(_0x1d7a5b[_0x5b61be(0x123)])for(const _0x2340e7 of _0x1d7a5b[_0x5b61be(0x123)]){_0x2340e7['segment']&&_0xce8dc1['add'](_0x2340e7[_0x5b61be(0xf5)]);}_0x1d7a5b[_0x5b61be(0xa8)]?.[_0x5b61be(0xf5)]&&_0xce8dc1['add'](_0x1d7a5b[_0x5b61be(0xa8)][_0x5b61be(0xf5)]);if(_0x1d7a5b['steps'])for(const _0x53ade4 of _0x1d7a5b[_0x5b61be(0xeb)]){if(_0x53ade4[_0x5b61be(0xd2)]===_0x5b61be(0x10f)){const _0x1860ef=_0x53ade4;for(const _0x35b8b4 of _0x1860ef['with'][_0x5b61be(0x118)]){_0x35b8b4[_0x5b61be(0xf5)]&&_0xce8dc1['add'](_0x35b8b4[_0x5b61be(0xf5)]);}}else{if(_0x53ade4[_0x5b61be(0xd2)]===_0x5b61be(0xd0)){const _0x440aaf=_0x53ade4;_0x440aaf[_0x5b61be(0xe6)][_0x5b61be(0x119)]?.[_0x5b61be(0xf5)]&&_0xce8dc1[_0x5b61be(0x126)](_0x440aaf[_0x5b61be(0xe6)][_0x5b61be(0x119)][_0x5b61be(0xf5)]);}}}}};_0x5191d1[_0x5a21c6(0x12c)]&&_0x5d4a1c(_0x5191d1[_0x5a21c6(0x12c)]);if(_0x5191d1['versions'])for(const _0x329675 of _0x5191d1[_0x5a21c6(0x94)]){_0x5d4a1c(_0x329675[_0x5a21c6(0x12c)]);}return _0xce8dc1;}export function validateSegmentRefs(_0x2b5088){const _0x343ebc=a147_0x4543,_0x292529=[],_0x1ee138=collectSegmentRefs(_0x2b5088),_0x5865c3=new Set(Object['keys'](_0x2b5088['segments']||{}));for(const _0x3baab1 of _0x1ee138){const _0x13a5b1=parseSegmentRef(_0x3baab1);_0x13a5b1[_0x343ebc(0xd2)]===_0x343ebc(0x133)&&!_0x5865c3[_0x343ebc(0xbc)](_0x13a5b1[_0x343ebc(0x92)])&&_0x292529[_0x343ebc(0xb5)](_0x343ebc(0xd8)+_0x13a5b1[_0x343ebc(0x92)]+_0x343ebc(0x139)+_0x13a5b1['name']+_0x343ebc(0x9f));}return _0x292529;}export function collectSegmentIdsFromJourneyApi(_0x3e207e){const _0x1baab8=a147_0x4543,_0x3e9e53=new Set();_0x3e207e[_0x1baab8(0x137)][_0x1baab8(0x9c)]?.['segmentId']&&_0x3e9e53[_0x1baab8(0x126)](_0x3e207e[_0x1baab8(0x137)][_0x1baab8(0x9c)]['segmentId']);const _0x52a244=_0x3e207e[_0x1baab8(0x137)][_0x1baab8(0xb9)];if(Array[_0x1baab8(0xa0)](_0x52a244))for(const _0x3820c4 of _0x52a244){_0x3820c4[_0x1baab8(0xec)]?.[_0x1baab8(0xa4)]&&_0x3e9e53[_0x1baab8(0x126)](_0x3820c4[_0x1baab8(0xec)]['segmentId']);const _0xce0530=_0x3820c4[_0x1baab8(0xa6)]??_0x3820c4[_0x1baab8(0x97)];if(Array['isArray'](_0xce0530))for(const _0x255c6a of _0xce0530){_0x255c6a[_0x1baab8(0xa4)]&&_0x3e9e53['add'](_0x255c6a[_0x1baab8(0xa4)]);}_0x3820c4[_0x1baab8(0xa8)]?.[_0x1baab8(0xa4)]&&_0x3e9e53[_0x1baab8(0x126)](_0x3820c4['milestone'][_0x1baab8(0xa4)]);if(_0x3820c4[_0x1baab8(0xeb)]&&typeof _0x3820c4[_0x1baab8(0xeb)]==='object'){const _0x97dbfa=Array[_0x1baab8(0xa0)](_0x3820c4['steps'])?_0x3820c4[_0x1baab8(0xeb)]:Object[_0x1baab8(0xbd)](_0x3820c4['steps']);for(const _0x1d8a86 of _0x97dbfa){_0x1d8a86[_0x1baab8(0xc8)]?.[_0x1baab8(0xa4)]&&_0x3e9e53[_0x1baab8(0x126)](_0x1d8a86['waitCondition']['segmentId']);const _0x3b915d=_0x1d8a86;_0x3b915d[_0x1baab8(0x11c)]&&_0x3e9e53[_0x1baab8(0x126)](_0x3b915d[_0x1baab8(0x11c)]);if(Array[_0x1baab8(0xa0)](_0x3b915d[_0x1baab8(0x140)]))for(const _0x19f2d2 of _0x3b915d[_0x1baab8(0x140)]){_0x19f2d2[_0x1baab8(0xa4)]&&_0x3e9e53['add'](_0x19f2d2[_0x1baab8(0xa4)]);}if(Array[_0x1baab8(0xa0)](_0x1d8a86['branches']))for(const _0x531f93 of _0x1d8a86[_0x1baab8(0x118)]){_0x531f93['segmentId']&&_0x3e9e53[_0x1baab8(0x126)](_0x531f93[_0x1baab8(0xa4)]);}}}}return _0x3e9e53;}
|
|
1
|
+
const a147_0x134c14=a147_0x5e51;(function(_0x1bb58c,_0x3101f4){const _0xb7764a=a147_0x5e51,_0x4c5682=_0x1bb58c();while(!![]){try{const _0xa59b7a=-parseInt(_0xb7764a(0xf4))/0x1+parseInt(_0xb7764a(0x12a))/0x2+parseInt(_0xb7764a(0xf6))/0x3*(parseInt(_0xb7764a(0xcc))/0x4)+-parseInt(_0xb7764a(0xb2))/0x5+parseInt(_0xb7764a(0x8d))/0x6*(-parseInt(_0xb7764a(0x6b))/0x7)+-parseInt(_0xb7764a(0x108))/0x8*(parseInt(_0xb7764a(0x11f))/0x9)+parseInt(_0xb7764a(0x94))/0xa*(parseInt(_0xb7764a(0xf7))/0xb);if(_0xa59b7a===_0x3101f4)break;else _0x4c5682['push'](_0x4c5682['shift']());}catch(_0x4e4f25){_0x4c5682['push'](_0x4c5682['shift']());}}}(a147_0x533c,0xb9e62));import*as a147_0x385692 from'yaml';function a147_0x5e51(_0x34574b,_0x54feab){_0x34574b=_0x34574b-0x6b;const _0x533c83=a147_0x533c();let _0x5e51cd=_0x533c83[_0x34574b];return _0x5e51cd;}import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0xdfa787){const _0x4d7f32=a147_0x5e51,_0x23ac38=_0xdfa787[_0x4d7f32(0x12f)]();if(_0x23ac38===_0x4d7f32(0xca)||_0x23ac38===_0x4d7f32(0x106))return _0x4d7f32(0x106);if(_0x23ac38===_0x4d7f32(0x8b)||_0x23ac38===_0x4d7f32(0xea))return'week';return _0xdfa787;}export function journeyResponseToDefSync(_0x3db3a0){const _0x54301b=a147_0x5e51,_0x1d813b=_0x3db3a0[_0x54301b(0x127)],_0x55d439=_0x1d813b[_0x54301b(0xad)]||_0x1d813b[_0x54301b(0xb3)],_0x225fa7={'stages':_0x1d813b[_0x54301b(0x6e)][_0x54301b(0x6d)](convertApiStageToYaml),'id':_0x3db3a0['id']};_0x1d813b['goal']&&(_0x225fa7['goal']=convertApiCriteriaToYaml(_0x1d813b[_0x54301b(0xa4)]));_0x1d813b['name']&&_0x1d813b['name']!==_0x55d439&&(_0x225fa7['version']=_0x1d813b[_0x54301b(0xb3)]);_0x1d813b['versionNumber']!==undefined&&(_0x225fa7[_0x54301b(0x75)]=_0x1d813b[_0x54301b(0x9f)]);_0x1d813b[_0x54301b(0xd0)]&&(_0x225fa7[_0x54301b(0xd0)]=_0x1d813b[_0x54301b(0xd0)]===_0x54301b(0x115)?_0x54301b(0x115):'draft');const _0x3d670d={'type':'journey','name':_0x55d439,'journeys':[_0x225fa7]};_0x1d813b[_0x54301b(0x88)]&&(_0x3d670d[_0x54301b(0x88)]=_0x1d813b[_0x54301b(0x88)]);_0x1d813b[_0x54301b(0xa4)]&&(_0x3d670d[_0x54301b(0xa4)]=convertApiCriteriaToYaml(_0x1d813b[_0x54301b(0xa4)]));if(_0x1d813b[_0x54301b(0xbd)])_0x3d670d['reentry']=_0x1d813b[_0x54301b(0xbd)];else _0x1d813b[_0x54301b(0xf3)]!==undefined&&(_0x3d670d[_0x54301b(0xe9)]=_0x1d813b[_0x54301b(0xf3)]?_0x54301b(0xf0):'no_reentry');return _0x1d813b[_0x54301b(0x123)]&&(_0x3d670d[_0x54301b(0x7a)]=_0x1d813b[_0x54301b(0x123)]),_0x1d813b[_0x54301b(0xad)]&&(_0x3d670d[_0x54301b(0xd3)]=_0x1d813b[_0x54301b(0xad)]),_0x3db3a0[_0x54301b(0xac)]?.[_0x54301b(0x73)]?.[_0x54301b(0x10b)]?.['id']&&(_0x3d670d[_0x54301b(0x101)]=_0x3db3a0[_0x54301b(0xac)]['parentFolder'][_0x54301b(0x10b)]['id']),_0x3d670d;}export async function journeyResponseToDef(_0x2384ee,_0x572ad6){const _0x31c1dd=a147_0x5e51,_0x30a474=journeyResponseToDefSync(_0x2384ee);if(!_0x572ad6)return _0x30a474;const _0x4a4947=new Set();collectSegmentIdsFromJourney(_0x30a474,_0x4a4947);const _0x2c9a76=new Set();collectActivationIdsFromJourney(_0x30a474,_0x2c9a76);const _0x377102={},_0x122c57=new Map();for(const _0xe870fe of Array[_0x31c1dd(0x8e)](_0x4a4947)[_0x31c1dd(0x110)]()){if(_0x572ad6[_0x31c1dd(0x95)]){const _0x53fedf=await _0x572ad6[_0x31c1dd(0x95)](_0xe870fe);if(_0x53fedf[_0x31c1dd(0x80)]){_0x122c57[_0x31c1dd(0x121)](_0xe870fe,_0x53fedf[_0x31c1dd(0xb3)]);if(_0x53fedf['definition']){const _0x52fc9e={..._0x53fedf[_0x31c1dd(0xb8)],'rule':deepSortObject(_0x53fedf[_0x31c1dd(0xb8)]['rule'])};_0x377102[_0x53fedf[_0x31c1dd(0xb3)]]=_0x52fc9e;}}else _0x122c57[_0x31c1dd(0x121)](_0xe870fe,makeSegmentRef(_0x53fedf[_0x31c1dd(0xb3)]));}else{if(_0x572ad6[_0x31c1dd(0x9e)]){const _0x951ee9=await _0x572ad6['resolveSegmentName'](_0xe870fe);_0x122c57[_0x31c1dd(0x121)](_0xe870fe,_0x951ee9);}}}const _0x50d4a6={},_0x1052df=new Map();for(const _0x17e0b6 of Array[_0x31c1dd(0x8e)](_0x2c9a76)[_0x31c1dd(0x110)]()){if(_0x572ad6[_0x31c1dd(0x129)]){const _0xf58188=await _0x572ad6[_0x31c1dd(0x129)](_0x17e0b6);_0xf58188['isJourneyLocal']?(_0x1052df[_0x31c1dd(0x121)](_0x17e0b6,_0xf58188['name']),_0xf58188[_0x31c1dd(0xb8)]&&(_0x50d4a6[_0xf58188[_0x31c1dd(0xb3)]]=_0xf58188[_0x31c1dd(0xb8)])):_0x1052df['set'](_0x17e0b6,makeSegmentRef(_0xf58188[_0x31c1dd(0xb3)]));}else{if(_0x572ad6[_0x31c1dd(0xb1)]){const _0x229f92=await _0x572ad6['resolveActivationName'](_0x17e0b6);_0x1052df[_0x31c1dd(0x121)](_0x17e0b6,_0x229f92);}}}_0x122c57[_0x31c1dd(0xe2)]>0x0&&replaceSegmentIdsInJourney(_0x30a474,_0x122c57);_0x1052df['size']>0x0&&replaceActivationIdsInJourney(_0x30a474,_0x1052df);if(_0x572ad6[_0x31c1dd(0xe0)]){const _0x463e28=[];collectJumpTargetsFromJourney(_0x30a474,_0x463e28);if(_0x463e28[_0x31c1dd(0x10d)]>0x0){const _0x25aae9=new Map();for(const _0x4c90ff of _0x463e28){try{const _0x5e48be=await _0x572ad6[_0x31c1dd(0xe0)](_0x4c90ff[_0x31c1dd(0xfa)],_0x4c90ff[_0x31c1dd(0x122)]);_0x25aae9[_0x31c1dd(0x121)](_0x4c90ff[_0x31c1dd(0xfa)]+':'+_0x4c90ff[_0x31c1dd(0x122)],_0x5e48be);}catch{}}_0x25aae9['size']>0x0&&replaceJumpTargetsInJourney(_0x30a474,_0x25aae9);}}return Object[_0x31c1dd(0xed)](_0x377102)[_0x31c1dd(0x10d)]>0x0&&(_0x30a474[_0x31c1dd(0xb6)]=_0x377102),Object['keys'](_0x50d4a6)['length']>0x0&&(_0x30a474['activations']=_0x50d4a6),_0x30a474;}function collectSegmentIdsFromJourney(_0x20ceb3,_0x1571b6){const _0x59d9f8=a147_0x5e51;_0x20ceb3['goal']?.['segment']&&_0x1571b6[_0x59d9f8(0xcb)](_0x20ceb3[_0x59d9f8(0xa4)][_0x59d9f8(0xda)]);const _0x44f564=_0x1a9f42=>{const _0x5be102=_0x59d9f8;for(const _0x1cb932 of _0x1a9f42){_0x1cb932[_0x5be102(0xba)]?.['segment']&&_0x1571b6[_0x5be102(0xcb)](_0x1cb932[_0x5be102(0xba)]['segment']);if(_0x1cb932[_0x5be102(0xd6)])for(const _0x5048bb of _0x1cb932['exit_criteria']){_0x5048bb[_0x5be102(0xda)]&&_0x1571b6[_0x5be102(0xcb)](_0x5048bb[_0x5be102(0xda)]);}_0x1cb932[_0x5be102(0xd5)]?.[_0x5be102(0xda)]&&_0x1571b6[_0x5be102(0xcb)](_0x1cb932['milestone']['segment']);if(_0x1cb932[_0x5be102(0x77)])for(const _0x2f184d of _0x1cb932[_0x5be102(0x77)]){if(_0x2f184d[_0x5be102(0x103)]===_0x5be102(0xec)){const _0x42ae35=_0x2f184d;for(const _0x10949f of _0x42ae35[_0x5be102(0xbb)]['branches']){_0x10949f[_0x5be102(0xda)]&&_0x1571b6['add'](_0x10949f['segment']);}}else{if(_0x2f184d['type']==='wait'){const _0x4c8831=_0x2f184d;_0x4c8831['with'][_0x5be102(0xfc)]?.[_0x5be102(0xda)]&&_0x1571b6[_0x5be102(0xcb)](_0x4c8831[_0x5be102(0xbb)][_0x5be102(0xfc)][_0x5be102(0xda)]);}}}}};if(_0x20ceb3[_0x59d9f8(0xcd)])for(const _0x2dd0e6 of _0x20ceb3[_0x59d9f8(0xcd)]){_0x2dd0e6['goal']?.[_0x59d9f8(0xda)]&&_0x1571b6[_0x59d9f8(0xcb)](_0x2dd0e6[_0x59d9f8(0xa4)][_0x59d9f8(0xda)]),_0x44f564(_0x2dd0e6[_0x59d9f8(0xdb)]);}_0x20ceb3[_0x59d9f8(0xdb)]&&_0x44f564(_0x20ceb3[_0x59d9f8(0xdb)]);if(_0x20ceb3[_0x59d9f8(0xf8)])for(const _0x4e39c4 of _0x20ceb3['versions']){_0x44f564(_0x4e39c4['stages']);}}function replaceSegmentIdsInJourney(_0x39fb92,_0x4d2b66){const _0x1c5e3d=a147_0x5e51,_0x9bc514=_0x3a6b8e=>_0x4d2b66[_0x1c5e3d(0xc0)](_0x3a6b8e)||_0x3a6b8e;_0x39fb92[_0x1c5e3d(0xa4)]?.[_0x1c5e3d(0xda)]&&(_0x39fb92[_0x1c5e3d(0xa4)][_0x1c5e3d(0xda)]=_0x9bc514(_0x39fb92[_0x1c5e3d(0xa4)][_0x1c5e3d(0xda)]));const _0x413598=_0x52ac54=>{const _0x2bfcbc=_0x1c5e3d;for(const _0x1e87b3 of _0x52ac54){_0x1e87b3[_0x2bfcbc(0xba)]?.[_0x2bfcbc(0xda)]&&(_0x1e87b3[_0x2bfcbc(0xba)][_0x2bfcbc(0xda)]=_0x9bc514(_0x1e87b3[_0x2bfcbc(0xba)]['segment']));if(_0x1e87b3[_0x2bfcbc(0xd6)])for(const _0x5412fa of _0x1e87b3[_0x2bfcbc(0xd6)]){_0x5412fa[_0x2bfcbc(0xda)]&&(_0x5412fa['segment']=_0x9bc514(_0x5412fa[_0x2bfcbc(0xda)]));}_0x1e87b3[_0x2bfcbc(0xd5)]?.[_0x2bfcbc(0xda)]&&(_0x1e87b3[_0x2bfcbc(0xd5)][_0x2bfcbc(0xda)]=_0x9bc514(_0x1e87b3[_0x2bfcbc(0xd5)][_0x2bfcbc(0xda)]));if(_0x1e87b3[_0x2bfcbc(0x77)])for(const _0x3eaf8e of _0x1e87b3[_0x2bfcbc(0x77)]){if(_0x3eaf8e['type']===_0x2bfcbc(0xec)){const _0x314067=_0x3eaf8e;for(const _0x26182a of _0x314067[_0x2bfcbc(0xbb)][_0x2bfcbc(0xd9)]){_0x26182a['segment']&&(_0x26182a['segment']=_0x9bc514(_0x26182a[_0x2bfcbc(0xda)]));}}else{if(_0x3eaf8e[_0x2bfcbc(0x103)]===_0x2bfcbc(0xc5)){const _0x58bad3=_0x3eaf8e;_0x58bad3[_0x2bfcbc(0xbb)][_0x2bfcbc(0xfc)]?.[_0x2bfcbc(0xda)]&&(_0x58bad3[_0x2bfcbc(0xbb)][_0x2bfcbc(0xfc)][_0x2bfcbc(0xda)]=_0x9bc514(_0x58bad3[_0x2bfcbc(0xbb)][_0x2bfcbc(0xfc)][_0x2bfcbc(0xda)]));}}}}};if(_0x39fb92['journeys'])for(const _0x4350c8 of _0x39fb92[_0x1c5e3d(0xcd)]){_0x4350c8[_0x1c5e3d(0xa4)]?.[_0x1c5e3d(0xda)]&&(_0x4350c8[_0x1c5e3d(0xa4)][_0x1c5e3d(0xda)]=_0x9bc514(_0x4350c8[_0x1c5e3d(0xa4)][_0x1c5e3d(0xda)])),_0x413598(_0x4350c8[_0x1c5e3d(0xdb)]);}_0x39fb92[_0x1c5e3d(0xdb)]&&_0x413598(_0x39fb92[_0x1c5e3d(0xdb)]);if(_0x39fb92[_0x1c5e3d(0xf8)])for(const _0x1d9244 of _0x39fb92['versions']){_0x413598(_0x1d9244[_0x1c5e3d(0xdb)]);}}function collectActivationIdsFromJourney(_0x2d709e,_0x1f1bec){const _0x5e5b45=a147_0x5e51,_0x490d72=_0x21a690=>{const _0xb2fe25=a147_0x5e51;for(const _0x3812b8 of _0x21a690){if(_0x3812b8[_0xb2fe25(0x77)])for(const _0x51b1a9 of _0x3812b8[_0xb2fe25(0x77)]){if(_0x51b1a9[_0xb2fe25(0x103)]==='activation'){const _0x52f46f=_0x51b1a9;_0x52f46f[_0xb2fe25(0xbb)]['activation']&&/^\d+$/[_0xb2fe25(0x10e)](_0x52f46f[_0xb2fe25(0xbb)][_0xb2fe25(0x11c)])&&_0x1f1bec['add'](_0x52f46f['with'][_0xb2fe25(0x11c)]);}}}};if(_0x2d709e[_0x5e5b45(0xcd)])for(const _0x31cd97 of _0x2d709e['journeys']){_0x490d72(_0x31cd97[_0x5e5b45(0xdb)]);}_0x2d709e[_0x5e5b45(0xdb)]&&_0x490d72(_0x2d709e[_0x5e5b45(0xdb)]);if(_0x2d709e['versions'])for(const _0x56800e of _0x2d709e[_0x5e5b45(0xf8)]){_0x490d72(_0x56800e[_0x5e5b45(0xdb)]);}}function replaceActivationIdsInJourney(_0x51c9b9,_0x30bd94){const _0x349eaa=a147_0x5e51,_0x3a68e8=_0x6e171b=>_0x30bd94[_0x349eaa(0xc0)](_0x6e171b)||_0x6e171b,_0x13a062=_0x599cef=>{const _0x217a69=_0x349eaa;for(const _0x32a5fb of _0x599cef){if(_0x32a5fb['steps'])for(const _0xc93ed9 of _0x32a5fb[_0x217a69(0x77)]){if(_0xc93ed9[_0x217a69(0x103)]===_0x217a69(0x11c)){const _0x37d064=_0xc93ed9;_0x37d064[_0x217a69(0xbb)]['activation']&&(_0x37d064['with'][_0x217a69(0x11c)]=_0x3a68e8(_0x37d064[_0x217a69(0xbb)][_0x217a69(0x11c)]));}}}};if(_0x51c9b9[_0x349eaa(0xcd)])for(const _0x51e378 of _0x51c9b9[_0x349eaa(0xcd)]){_0x13a062(_0x51e378[_0x349eaa(0xdb)]);}_0x51c9b9[_0x349eaa(0xdb)]&&_0x13a062(_0x51c9b9[_0x349eaa(0xdb)]);if(_0x51c9b9[_0x349eaa(0xf8)])for(const _0x3e9065 of _0x51c9b9['versions']){_0x13a062(_0x3e9065['stages']);}}function collectJumpTargetsFromJourney(_0x1c3219,_0x284eaf){const _0x3d2740=a147_0x5e51,_0x29f9b5=new Set(),_0xd3db8a=_0x348ad5=>{const _0x282dba=a147_0x5e51;for(const _0x52d5d5 of _0x348ad5){if(_0x52d5d5['steps'])for(const _0x540e0e of _0x52d5d5[_0x282dba(0x77)]){if(_0x540e0e[_0x282dba(0x103)]===_0x282dba(0xe6)){const _0x5b921a=_0x540e0e,_0x1210cc=_0x5b921a[_0x282dba(0xbb)]['target'];if(_0x1210cc[_0x282dba(0xc4)]&&_0x1210cc['stage']&&/^\d+$/[_0x282dba(0x10e)](_0x1210cc['journey'])&&/^\d+$/[_0x282dba(0x10e)](_0x1210cc['stage'])){const _0x2ce454=_0x1210cc[_0x282dba(0xc4)]+':'+_0x1210cc[_0x282dba(0x8f)];!_0x29f9b5['has'](_0x2ce454)&&(_0x29f9b5[_0x282dba(0xcb)](_0x2ce454),_0x284eaf[_0x282dba(0x9d)]({'journeyId':_0x1210cc[_0x282dba(0xc4)],'stageId':_0x1210cc[_0x282dba(0x8f)]}));}}}}};if(_0x1c3219[_0x3d2740(0xcd)])for(const _0x3c6a1d of _0x1c3219[_0x3d2740(0xcd)]){_0xd3db8a(_0x3c6a1d[_0x3d2740(0xdb)]);}_0x1c3219['stages']&&_0xd3db8a(_0x1c3219[_0x3d2740(0xdb)]);if(_0x1c3219[_0x3d2740(0xf8)])for(const _0xa50e20 of _0x1c3219['versions']){_0xd3db8a(_0xa50e20['stages']);}}function replaceJumpTargetsInJourney(_0x261814,_0x5bbaef){const _0x2437c2=a147_0x5e51,_0x45c374=_0x5d9c0b=>{const _0x1d325e=a147_0x5e51;for(const _0x3b01f2 of _0x5d9c0b){if(_0x3b01f2[_0x1d325e(0x77)])for(const _0x36ce45 of _0x3b01f2[_0x1d325e(0x77)]){if(_0x36ce45[_0x1d325e(0x103)]===_0x1d325e(0xe6)){const _0x4b4b24=_0x36ce45,_0x2def35=_0x4b4b24[_0x1d325e(0xbb)][_0x1d325e(0xdd)],_0x3b07c9=_0x2def35[_0x1d325e(0xc4)]+':'+_0x2def35[_0x1d325e(0x8f)],_0x4be997=_0x5bbaef['get'](_0x3b07c9);_0x4be997&&(_0x2def35[_0x1d325e(0xc4)]=_0x4be997[_0x1d325e(0xaa)],_0x2def35[_0x1d325e(0x8f)]=_0x4be997['stageName']);}}}};if(_0x261814['journeys'])for(const _0x992cd6 of _0x261814[_0x2437c2(0xcd)]){_0x45c374(_0x992cd6['stages']);}_0x261814['stages']&&_0x45c374(_0x261814[_0x2437c2(0xdb)]);if(_0x261814['versions'])for(const _0x171d99 of _0x261814['versions']){_0x45c374(_0x171d99[_0x2437c2(0xdb)]);}}function generateReadableStepName(_0x512512,_0xb936d2){const _0x5efc45=a147_0x5e51;if(_0x512512[_0x5efc45(0xb3)]&&_0x512512[_0x5efc45(0xb3)]!==_0x512512[_0x5efc45(0x103)]){const _0x3bc63d=_0x512512[_0x5efc45(0xb3)]['trim']();if(_0x3bc63d&&/[a-z0-9\p{L}]/iu['test'](_0x3bc63d))return _0x3bc63d;}const _0x2438c5=_0x512512[_0x5efc45(0x103)]['toLowerCase']()[_0x5efc45(0xc1)](/step$/i,'');return _0x2438c5+'_'+(_0xb936d2+0x1);}function getStepNextRefs(_0x39318c){const _0x165a5d=a147_0x5e51,_0x1c741b=[];if(_0x39318c[_0x165a5d(0xe3)])_0x1c741b['push'](_0x39318c[_0x165a5d(0xe3)]);if(_0x39318c[_0x165a5d(0xd9)])for(const _0x555043 of _0x39318c['branches']){if(_0x555043[_0x165a5d(0xe3)])_0x1c741b['push'](_0x555043['next']);}if(_0x39318c[_0x165a5d(0x134)])for(const _0x1d233b of _0x39318c[_0x165a5d(0x134)]){if(_0x1d233b['next'])_0x1c741b[_0x165a5d(0x9d)](_0x1d233b['next']);}if(_0x39318c[_0x165a5d(0xaf)])for(const _0x1f5730 of _0x39318c['conditions']){if(_0x1f5730['next'])_0x1c741b[_0x165a5d(0x9d)](_0x1f5730[_0x165a5d(0xe3)]);}return _0x1c741b;}function parseJumpTargetDisplayName(_0xda3f48){const _0x4e771b=a147_0x5e51,_0x176109=_0xda3f48[_0x4e771b(0xb0)](/^(.+?)\s*\(([^/)]+)/);if(!_0x176109)return undefined;const _0x2929bc=_0x176109[0x1][_0x4e771b(0x83)](),_0x52738e=_0x176109[0x2]['trim']();if(!_0x2929bc||!_0x52738e)return undefined;return{'stageName':_0x2929bc,'journeyName':_0x52738e};}function orderStepsFromRoot(_0x3baf6d,_0x37d8e1){const _0x42bc13=a147_0x5e51,_0x80d60c=Object[_0x42bc13(0xe8)](_0x3baf6d);if(_0x80d60c[_0x42bc13(0x10d)]===0x0)return[];const _0x546f27=new Set(_0x80d60c[_0x42bc13(0x6d)](([_0xe4efab])=>_0xe4efab)),_0x216e8d=new Set();for(const [,_0x2fe0f6]of _0x80d60c){for(const _0xbc6e80 of getStepNextRefs(_0x2fe0f6)){if(_0x546f27['has'](_0xbc6e80))_0x216e8d[_0x42bc13(0xcb)](_0xbc6e80);}}let _0x36d4ec=_0x37d8e1&&_0x546f27[_0x42bc13(0x86)](_0x37d8e1)?_0x37d8e1:undefined;if(!_0x36d4ec){const _0x3ff533=_0x80d60c[_0x42bc13(0xb7)](([_0x5714f8])=>!_0x216e8d[_0x42bc13(0x86)](_0x5714f8));_0x3ff533[_0x42bc13(0x10d)]>0x0?_0x36d4ec=_0x3ff533[0x0][0x0]:_0x36d4ec=_0x80d60c[0x0][0x0];}const _0x51c0a1=[],_0x1fc839=new Set(),_0x40df41=[_0x36d4ec];while(_0x40df41['length']>0x0){const _0x29faa4=_0x40df41[_0x42bc13(0x100)]();if(_0x1fc839[_0x42bc13(0x86)](_0x29faa4))continue;_0x1fc839[_0x42bc13(0xcb)](_0x29faa4);const _0x498749=_0x3baf6d[_0x29faa4];if(!_0x498749)continue;_0x51c0a1['push']({'uuid':_0x29faa4,'step':_0x498749});for(const _0x10e1a0 of getStepNextRefs(_0x498749)){_0x546f27['has'](_0x10e1a0)&&!_0x1fc839[_0x42bc13(0x86)](_0x10e1a0)&&_0x40df41[_0x42bc13(0x9d)](_0x10e1a0);}}for(const [_0x4d1074,_0x4c31f1]of _0x80d60c){!_0x1fc839[_0x42bc13(0x86)](_0x4d1074)&&_0x51c0a1[_0x42bc13(0x9d)]({'uuid':_0x4d1074,'step':_0x4c31f1});}return _0x51c0a1;}function resolveStepReferences(_0x3b109a,_0x260862,_0x1c6389,_0x1a87d3){const _0x403712=a147_0x5e51;if(_0x3b109a[_0x403712(0x103)]!=='end'){_0x3b109a['next']&&_0x1a87d3[_0x403712(0x86)](_0x3b109a[_0x403712(0xe3)])&&(_0x3b109a[_0x403712(0xe3)]=_0x1a87d3[_0x403712(0xc0)](_0x3b109a[_0x403712(0xe3)]));const _0x236a83=_0x260862+0x1;if(_0x236a83<_0x1c6389[_0x403712(0x10d)]){const _0x518b02=_0x1a87d3['get'](_0x1c6389[_0x236a83][_0x403712(0x9a)]);_0x3b109a[_0x403712(0xe3)]===_0x518b02&&delete _0x3b109a[_0x403712(0xe3)];}}if(_0x3b109a[_0x403712(0x103)]===_0x403712(0xec))for(const _0x3b0d10 of _0x3b109a['with'][_0x403712(0xd9)]){_0x3b0d10[_0x403712(0xe3)]&&_0x1a87d3[_0x403712(0x86)](_0x3b0d10[_0x403712(0xe3)])&&(_0x3b0d10['next']=_0x1a87d3[_0x403712(0xc0)](_0x3b0d10[_0x403712(0xe3)]));}if(_0x3b109a[_0x403712(0x103)]===_0x403712(0x133))for(const _0x47501a of _0x3b109a['with'][_0x403712(0x134)]){_0x47501a[_0x403712(0xe3)]&&_0x1a87d3[_0x403712(0x86)](_0x47501a[_0x403712(0xe3)])&&(_0x47501a[_0x403712(0xe3)]=_0x1a87d3[_0x403712(0xc0)](_0x47501a['next']));}if(_0x3b109a[_0x403712(0x103)]==='wait'&&_0x3b109a[_0x403712(0xbb)][_0x403712(0xfc)]){const _0x1f0970=_0x3b109a[_0x403712(0xbb)]['condition'];_0x1f0970[_0x403712(0xe3)]&&_0x1a87d3['has'](_0x1f0970[_0x403712(0xe3)])&&(_0x1f0970[_0x403712(0xe3)]=_0x1a87d3[_0x403712(0xc0)](_0x1f0970['next'])),_0x1f0970[_0x403712(0xae)]?.['next']&&_0x1a87d3['has'](_0x1f0970[_0x403712(0xae)][_0x403712(0xe3)])&&(_0x1f0970[_0x403712(0xae)][_0x403712(0xe3)]=_0x1a87d3[_0x403712(0xc0)](_0x1f0970['timeout'][_0x403712(0xe3)]));}}function convertApiStageToYaml(_0x300ed2){const _0x4d0629=a147_0x5e51,_0x37902c={'name':_0x300ed2[_0x4d0629(0xb3)]};_0x300ed2['id']&&(_0x37902c['id']=_0x300ed2['id']);_0x300ed2[_0x4d0629(0x88)]&&(_0x37902c['description']=_0x300ed2['description']);_0x300ed2[_0x4d0629(0xa9)]&&(_0x37902c[_0x4d0629(0xba)]=convertApiCriteriaToYaml(_0x300ed2['entryCriteria']));_0x300ed2['exitCriterias']&&_0x300ed2[_0x4d0629(0x12d)][_0x4d0629(0x10d)]>0x0&&(_0x37902c[_0x4d0629(0xd6)]=_0x300ed2[_0x4d0629(0x12d)]['map'](convertApiCriteriaToYaml));_0x300ed2['milestone']&&(_0x37902c[_0x4d0629(0xd5)]=convertApiCriteriaToYaml(_0x300ed2[_0x4d0629(0xd5)]));if(_0x300ed2[_0x4d0629(0x77)]&&Object[_0x4d0629(0xed)](_0x300ed2[_0x4d0629(0x77)])[_0x4d0629(0x10d)]>0x0){const _0x3106f2=orderStepsFromRoot(_0x300ed2[_0x4d0629(0x77)],_0x300ed2['rootStep']),_0x545281=new Map(),_0x19a80a=new Set();for(let _0x5ab370=0x0;_0x5ab370<_0x3106f2[_0x4d0629(0x10d)];_0x5ab370++){const {uuid:_0x283eee,step:_0x23063f}=_0x3106f2[_0x5ab370];let _0x811024=generateReadableStepName(_0x23063f,_0x5ab370),_0x2244f0=_0x811024,_0x3b96cc=0x2;while(_0x19a80a[_0x4d0629(0x86)](_0x2244f0)){_0x2244f0=_0x811024+'_'+_0x3b96cc,_0x3b96cc++;}_0x19a80a[_0x4d0629(0xcb)](_0x2244f0),_0x545281[_0x4d0629(0x121)](_0x283eee,_0x2244f0);}_0x37902c[_0x4d0629(0x77)]=_0x3106f2[_0x4d0629(0x6d)](({uuid:_0x2ae1de,step:_0x5e9f01},_0x7f7397)=>{const _0x18b767=_0x4d0629,_0x38414c=convertApiStepToYaml(_0x5e9f01,_0x545281[_0x18b767(0xc0)](_0x2ae1de));return resolveStepReferences(_0x38414c,_0x7f7397,_0x3106f2,_0x545281),_0x38414c;});}return _0x37902c;}function convertApiCriteriaToYaml(_0x1b5838){const _0x4365fb=a147_0x5e51,_0x295dc8={'name':_0x1b5838[_0x4365fb(0xb3)],'segment':_0x1b5838['segmentId']};_0x1b5838['description']&&(_0x295dc8[_0x4365fb(0x88)]=_0x1b5838['description']);if(_0x1b5838['target']){let _0x2d497b=_0x1b5838[_0x4365fb(0xdd)]['journeyId'],_0x433c82=_0x1b5838[_0x4365fb(0xdd)]['journeyStageId'];if(_0x1b5838[_0x4365fb(0xdd)][_0x4365fb(0xaa)]){const _0x398125=parseJumpTargetDisplayName(_0x1b5838[_0x4365fb(0xdd)][_0x4365fb(0xaa)]);_0x398125&&(_0x433c82=_0x398125['stageName'],_0x2d497b=_0x398125['journeyName']);}_0x295dc8[_0x4365fb(0xdd)]={'journey':_0x2d497b,'stage':_0x433c82},_0x1b5838['target'][_0x4365fb(0x123)]&&(_0x295dc8[_0x4365fb(0xdd)][_0x4365fb(0x7a)]=_0x1b5838[_0x4365fb(0xdd)][_0x4365fb(0x123)]);}return _0x295dc8;}function convertApiStepToYaml(_0x1ad97f,_0x4f71cd){const _0x42d96b=a147_0x5e51;switch(_0x1ad97f[_0x42d96b(0x103)]){case'WaitStep':{const _0x29320e={};if(_0x1ad97f[_0x42d96b(0xab)]==='Duration'&&_0x1ad97f['waitStep']!==undefined)_0x29320e[_0x42d96b(0x124)]=_0x1ad97f['waitStep'],_0x29320e[_0x42d96b(0xef)]=_0x1ad97f[_0x42d96b(0x105)];else{if(_0x1ad97f['waitStepType']==='Date'&&_0x1ad97f[_0x42d96b(0x79)])_0x29320e[_0x42d96b(0xbc)]=_0x1ad97f['waitUntilDate'];else{if(_0x1ad97f[_0x42d96b(0xab)]===_0x42d96b(0x116)&&_0x1ad97f[_0x42d96b(0x9b)])_0x29320e[_0x42d96b(0x12e)]=_0x1ad97f[_0x42d96b(0x9b)];else{if(_0x1ad97f[_0x42d96b(0xab)]===_0x42d96b(0x8a)){if(_0x1ad97f[_0x42d96b(0xaf)]&&_0x1ad97f[_0x42d96b(0xaf)][_0x42d96b(0x10d)]>0x0){const _0x440fa3=_0x1ad97f[_0x42d96b(0xaf)][_0x42d96b(0x7f)](_0x4934fb=>!_0x4934fb[_0x42d96b(0xf5)]),_0x231ee=_0x1ad97f[_0x42d96b(0xaf)][_0x42d96b(0x7f)](_0x22df90=>_0x22df90['timedOutPath']);_0x440fa3?.[_0x42d96b(0xe4)]&&(_0x29320e[_0x42d96b(0xfc)]={'segment':_0x440fa3[_0x42d96b(0xe4)],..._0x440fa3[_0x42d96b(0xe3)]?{'next':_0x440fa3[_0x42d96b(0xe3)]}:{}},_0x231ee&&_0x231ee[_0x42d96b(0xf1)]!==undefined&&_0x231ee[_0x42d96b(0xef)]&&(_0x29320e[_0x42d96b(0xfc)][_0x42d96b(0xae)]={'duration':_0x231ee['moveAfter'],'unit':_0x231ee['unit'],..._0x231ee['next']?{'next':_0x231ee[_0x42d96b(0xe3)]}:{}}));}else _0x1ad97f['conditionSegmentId']&&(_0x29320e['condition']={'segment':_0x1ad97f[_0x42d96b(0xfd)]},_0x1ad97f[_0x42d96b(0x113)]!==undefined&&_0x1ad97f['conditionTimeoutUnit']&&(_0x29320e[_0x42d96b(0xfc)][_0x42d96b(0xae)]={'duration':_0x1ad97f[_0x42d96b(0x113)],'unit':_0x1ad97f[_0x42d96b(0x114)]}));}}}}const _0x423407={'type':_0x42d96b(0xc5),'name':_0x4f71cd,..._0x1ad97f['next']?{'next':_0x1ad97f['next']}:{},'with':_0x29320e};return _0x423407;}case _0x42d96b(0x7e):{const _0x417ddf={'type':'activation','name':_0x4f71cd,..._0x1ad97f[_0x42d96b(0xe3)]?{'next':_0x1ad97f[_0x42d96b(0xe3)]}:{},'with':{'activation':_0x1ad97f[_0x42d96b(0x109)]||''}};return _0x417ddf;}case _0x42d96b(0x90):{const _0x2fc6fc={'type':_0x42d96b(0xec),'name':_0x4f71cd,..._0x1ad97f[_0x42d96b(0xe3)]?{'next':_0x1ad97f[_0x42d96b(0xe3)]}:{},'with':{'branches':(_0x1ad97f[_0x42d96b(0xd9)]||[])[_0x42d96b(0x6d)](_0x72ff76=>({'name':_0x72ff76[_0x42d96b(0xb3)],'segment':_0x72ff76[_0x42d96b(0xe4)],'excluded':_0x72ff76[_0x42d96b(0x12c)],..._0x72ff76[_0x42d96b(0xe3)]?{'next':_0x72ff76[_0x42d96b(0xe3)]}:{}}))}};return _0x2fc6fc;}case _0x42d96b(0x71):case'AbTest':case _0x42d96b(0xdc):{const _0x2616a6=_0x1ad97f['variants']||(_0x1ad97f['branches']||[])[_0x42d96b(0x6d)](_0x21fe0c=>({'name':_0x21fe0c[_0x42d96b(0xb3)],'percentage':0x0,'next':_0x21fe0c[_0x42d96b(0xe3)]})),_0x549cbe={'type':_0x42d96b(0x133),'name':_0x4f71cd,..._0x1ad97f['next']?{'next':_0x1ad97f[_0x42d96b(0xe3)]}:{},'with':{'customized_split':_0x1ad97f[_0x42d96b(0x131)],'unique_id':_0x1ad97f[_0x42d96b(0x130)],'variants':_0x2616a6[_0x42d96b(0x6d)](_0xbef680=>({'name':_0xbef680[_0x42d96b(0xb3)],'percentage':_0xbef680[_0x42d96b(0xd4)],..._0xbef680[_0x42d96b(0xe3)]?{'next':_0xbef680['next']}:{}}))}};return _0x549cbe;}case _0x42d96b(0xd7):{const _0x596e36={'type':_0x42d96b(0x91),'name':_0x4f71cd,..._0x1ad97f['next']?{'next':_0x1ad97f[_0x42d96b(0xe3)]}:{}};return _0x596e36;}case _0x42d96b(0xcf):{let _0x1eec41='',_0x3b09ec='',_0x37c20d;if(_0x1ad97f[_0x42d96b(0xdd)]){_0x1eec41=_0x1ad97f[_0x42d96b(0xdd)][_0x42d96b(0xfa)],_0x3b09ec=_0x1ad97f['target'][_0x42d96b(0x89)],_0x37c20d=_0x1ad97f[_0x42d96b(0xdd)][_0x42d96b(0x123)];if(_0x1ad97f[_0x42d96b(0xdd)][_0x42d96b(0xaa)]){const _0x577e8c=parseJumpTargetDisplayName(_0x1ad97f[_0x42d96b(0xdd)][_0x42d96b(0xaa)]);_0x577e8c&&(_0x3b09ec=_0x577e8c[_0x42d96b(0xde)],_0x1eec41=_0x577e8c[_0x42d96b(0xaa)]);}}const _0x1e2cfa={'type':_0x42d96b(0xe6),'name':_0x4f71cd,..._0x1ad97f[_0x42d96b(0xe3)]?{'next':_0x1ad97f[_0x42d96b(0xe3)]}:{},'with':{'target':{'journey':_0x1eec41,'stage':_0x3b09ec,..._0x37c20d?{'bundle_id':_0x37c20d}:{}}}};return _0x1e2cfa;}case _0x42d96b(0x119):{const _0xd57c18={'type':_0x42d96b(0x12b),'name':_0x4f71cd};return _0xd57c18;}default:{const _0x4fb72b={'type':_0x42d96b(0x12b),'name':_0x4f71cd};return _0x4fb72b;}}}export async function journeyDefToRequest(_0x7dd029,_0x47ce5f,_0x2dc63c){const _0x1502ed=a147_0x5e51,_0x480f65=_0x7dd029[_0x1502ed(0xdb)]||getActiveStages(_0x7dd029),_0x18f909=isJourneysArrayMode(_0x7dd029)||isMultiVersionMode(_0x7dd029)?getLatestJourneyEntry(_0x7dd029):undefined,_0x503fde=_0x18f909?.['version']??_0x7dd029[_0x1502ed(0xb3)],_0x258616=_0x7dd029['segments']||{},_0x187989=_0x7dd029[_0x1502ed(0x104)]||{},_0x3f182f={'type':_0x1502ed(0xc4),'attributes':{'name':_0x503fde,'audienceId':_0x47ce5f,'journeyStages':await Promise[_0x1502ed(0xfb)](_0x480f65[_0x1502ed(0x6d)](_0x1f0795=>convertYamlStageToApi(_0x1f0795,_0x2dc63c,_0x258616,_0x187989)))}},_0x49f149=_0x18f909?.['id']??_0x7dd029['id'];_0x49f149&&(_0x3f182f['id']=_0x49f149);_0x7dd029['description']&&(_0x3f182f['attributes']['description']=_0x7dd029[_0x1502ed(0x88)]);const _0xbcb3b5=getEffectiveGoal(_0x7dd029);_0xbcb3b5&&(_0x3f182f[_0x1502ed(0x127)][_0x1502ed(0xa4)]=await convertYamlCriteriaToApi(_0xbcb3b5,_0x2dc63c,_0x258616));const _0x262d83=getEffectiveReentry(_0x7dd029);return _0x262d83&&(_0x3f182f[_0x1502ed(0x127)][_0x1502ed(0xbd)]=_0x262d83,_0x3f182f[_0x1502ed(0x127)][_0x1502ed(0xf3)]=_0x262d83!==_0x1502ed(0xbe)),_0x7dd029[_0x1502ed(0x101)]&&(_0x3f182f['relationships']={'parentFolder':{'data':{'id':_0x7dd029[_0x1502ed(0x101)],'type':'folder'}}}),_0x3f182f;}async function convertYamlStageToApi(_0x1e6c7e,_0x3313d8,_0x289f16={},_0xce2087={}){const _0x45f821=a147_0x5e51,_0x52be0c={'name':_0x1e6c7e[_0x45f821(0xb3)]};_0x1e6c7e['id']&&(_0x52be0c['id']=_0x1e6c7e['id']);_0x1e6c7e[_0x45f821(0x88)]&&(_0x52be0c[_0x45f821(0x88)]=_0x1e6c7e[_0x45f821(0x88)]);_0x1e6c7e[_0x45f821(0xba)]&&(_0x52be0c[_0x45f821(0xa9)]=await convertYamlCriteriaToApi(_0x1e6c7e[_0x45f821(0xba)],_0x3313d8,_0x289f16));_0x1e6c7e['exit_criteria']&&_0x1e6c7e['exit_criteria'][_0x45f821(0x10d)]>0x0&&(_0x52be0c['exitCriterias']=await Promise['all'](_0x1e6c7e[_0x45f821(0xd6)][_0x45f821(0x6d)](_0x4cad0d=>convertYamlCriteriaToApi(_0x4cad0d,_0x3313d8,_0x289f16))));_0x1e6c7e[_0x45f821(0xd5)]&&(_0x52be0c[_0x45f821(0xd5)]=await convertYamlCriteriaToApi(_0x1e6c7e[_0x45f821(0xd5)],_0x3313d8,_0x289f16));if(_0x1e6c7e['steps']&&_0x1e6c7e[_0x45f821(0x77)]['length']>0x0){const _0x4a205e={},_0x21fe0b=_0x1e6c7e[_0x45f821(0x77)]['map']((_0x55c7f6,_0x3f3cd3)=>{const _0x2f3d5d=_0x45f821,_0x28ae0c=_0x55c7f6[_0x2f3d5d(0x9a)]||generateUUID(),_0x3b39ac=_0x55c7f6['name']||_0x55c7f6['type']+'_'+_0x3f3cd3;return _0x4a205e[_0x3b39ac]=_0x28ae0c,{..._0x55c7f6,'name':_0x3b39ac};});_0x52be0c['rootStep']=_0x4a205e[_0x21fe0b[0x0][_0x45f821(0xb3)]],_0x52be0c[_0x45f821(0x77)]={};for(let _0x4326ec=0x0;_0x4326ec<_0x21fe0b[_0x45f821(0x10d)];_0x4326ec++){const _0xd3c344=_0x21fe0b[_0x4326ec],_0x2e8c34=_0x4a205e[_0xd3c344[_0x45f821(0xb3)]],_0x5d5aa2=!_0xd3c344[_0x45f821(0xe3)]&&_0x4326ec<_0x21fe0b[_0x45f821(0x10d)]-0x1&&_0xd3c344[_0x45f821(0x103)]!==_0x45f821(0x12b)?_0x21fe0b[_0x4326ec+0x1][_0x45f821(0xb3)]:_0xd3c344[_0x45f821(0xe3)],_0x4751f4=_0x5d5aa2!==_0xd3c344['next']?{..._0xd3c344,'next':_0x5d5aa2}:_0xd3c344;_0x52be0c[_0x45f821(0x77)][_0x2e8c34]=await convertYamlStepToApi(_0x4751f4,_0x3313d8,_0x289f16,_0x4a205e,_0xce2087);}}else _0x1e6c7e[_0x45f821(0x85)]&&(_0x52be0c['rootStep']=_0x1e6c7e[_0x45f821(0x85)]);return _0x52be0c;}async function convertYamlCriteriaToApi(_0x21d3ca,_0x26bec7,_0x25266f={}){const _0x482ab9=a147_0x5e51;let _0x374bdf=_0x21d3ca['segment'];if(_0x374bdf&&!/^\d+$/[_0x482ab9(0x10e)](_0x374bdf)){const _0x215347=parseSegmentRef(_0x374bdf);if(_0x215347[_0x482ab9(0x103)]===_0x482ab9(0x126))_0x26bec7?.[_0x482ab9(0xa8)]&&(_0x374bdf=await _0x26bec7[_0x482ab9(0xa8)](_0x215347['name']));else{if(_0x215347[_0x482ab9(0x103)]===_0x482ab9(0x11a)&&_0x25266f[_0x215347[_0x482ab9(0xb3)]])_0x26bec7?.[_0x482ab9(0x93)]&&(_0x374bdf=await _0x26bec7['resolveEmbeddedSegmentId'](_0x215347[_0x482ab9(0xb3)],_0x25266f[_0x215347[_0x482ab9(0xb3)]]));else _0x26bec7?.['resolveSegmentId']&&(_0x374bdf=await _0x26bec7[_0x482ab9(0xa8)](_0x215347[_0x482ab9(0xb3)]));}}const _0x243c8c={'name':_0x21d3ca['name'],'segmentId':_0x374bdf};_0x21d3ca[_0x482ab9(0x88)]&&(_0x243c8c[_0x482ab9(0x88)]=_0x21d3ca[_0x482ab9(0x88)]);if(_0x21d3ca[_0x482ab9(0xdd)]){const _0xdbe2ce=_0x21d3ca[_0x482ab9(0xdd)]['journey'],_0x40560a=_0x21d3ca[_0x482ab9(0xdd)][_0x482ab9(0x8f)];let _0x169e5c=_0x21d3ca['target']['journey'];_0x26bec7?.[_0x482ab9(0xce)]&&!/^\d+$/[_0x482ab9(0x10e)](_0x169e5c)&&(_0x169e5c=await _0x26bec7['resolveJourneyId'](_0x169e5c));let _0x4df45c=_0x21d3ca[_0x482ab9(0xdd)][_0x482ab9(0x8f)];_0x26bec7?.[_0x482ab9(0xa7)]&&!/^\d+$/[_0x482ab9(0x10e)](_0x4df45c)&&(_0x4df45c=await _0x26bec7[_0x482ab9(0xa7)](_0x169e5c,_0x4df45c));const _0x1bc630=!/^\d+$/['test'](_0xdbe2ce)&&!isLocalJourneyRef(_0xdbe2ce)?formatApiJourneyName(_0xdbe2ce,_0x40560a):undefined;_0x243c8c['target']={'journeyId':_0x169e5c,'journeyStageId':_0x4df45c,'journeyName':_0x1bc630,'confirmed':!![]},_0x21d3ca[_0x482ab9(0xdd)][_0x482ab9(0x7a)]&&(_0x243c8c[_0x482ab9(0xdd)][_0x482ab9(0x123)]=_0x21d3ca['target']['bundle_id']);}return _0x243c8c;}async function convertYamlStepToApi(_0x469f5e,_0x5e1dfb,_0x4d6eea={},_0x23418a={},_0x4e81b0={}){const _0x538751=a147_0x5e51,_0x36b92a=async _0x4474d9=>{const _0x49441f=a147_0x5e51;if(/^\d+$/['test'](_0x4474d9))return _0x4474d9;const _0x4deaac=parseSegmentRef(_0x4474d9);if(_0x4deaac[_0x49441f(0x103)]===_0x49441f(0x126)){if(_0x5e1dfb?.['resolveSegmentId'])return await _0x5e1dfb[_0x49441f(0xa8)](_0x4deaac[_0x49441f(0xb3)]);}else{if(_0x4deaac[_0x49441f(0x103)]===_0x49441f(0x11a)&&_0x4d6eea[_0x4deaac[_0x49441f(0xb3)]]){if(_0x5e1dfb?.[_0x49441f(0x93)])return await _0x5e1dfb[_0x49441f(0x93)](_0x4deaac['name'],_0x4d6eea[_0x4deaac['name']]);}else{if(_0x5e1dfb?.['resolveSegmentId'])return await _0x5e1dfb[_0x49441f(0xa8)](_0x4deaac[_0x49441f(0xb3)]);}}return _0x4474d9;},_0xcd46a4=async _0x22f7ad=>{const _0x377e22=a147_0x5e51;if(/^\d+$/[_0x377e22(0x10e)](_0x22f7ad))return _0x22f7ad;const _0x3b3fbe=parseSegmentRef(_0x22f7ad);if(_0x3b3fbe[_0x377e22(0x103)]===_0x377e22(0x126)){if(_0x5e1dfb?.[_0x377e22(0x7b)])return await _0x5e1dfb[_0x377e22(0x7b)](_0x3b3fbe[_0x377e22(0xb3)]);return _0x3b3fbe[_0x377e22(0xb3)];}else{if(_0x3b3fbe[_0x377e22(0x103)]===_0x377e22(0x11a)&&_0x4e81b0[_0x3b3fbe[_0x377e22(0xb3)]]){if(_0x5e1dfb?.[_0x377e22(0xd2)])return await _0x5e1dfb['resolveEmbeddedActivationId'](_0x3b3fbe[_0x377e22(0xb3)],_0x4e81b0[_0x3b3fbe['name']]);if(_0x5e1dfb?.[_0x377e22(0x7b)])return await _0x5e1dfb[_0x377e22(0x7b)](_0x3b3fbe['name']);}else{if(_0x5e1dfb?.[_0x377e22(0x7b)])return await _0x5e1dfb[_0x377e22(0x7b)](_0x3b3fbe[_0x377e22(0xb3)]);}}return _0x22f7ad;},_0x38c689=_0x14b59b=>{const _0x525f8a=a147_0x5e51;if(!_0x14b59b)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x525f8a(0x10e)](_0x14b59b))return _0x14b59b;return _0x23418a[_0x14b59b]||_0x14b59b;};switch(_0x469f5e['type']){case _0x538751(0xc5):{const _0x471dae=_0x469f5e,_0x5c732f=_0x471dae[_0x538751(0xbb)],_0x2b3554={'type':_0x538751(0x112),'name':_0x471dae[_0x538751(0xb3)],'next':_0x38c689(_0x471dae[_0x538751(0xe3)])};if(_0x5c732f[_0x538751(0x124)]!==undefined&&_0x5c732f[_0x538751(0xef)])_0x2b3554[_0x538751(0xab)]=_0x538751(0x81),_0x2b3554[_0x538751(0xff)]=_0x5c732f[_0x538751(0x124)],_0x2b3554[_0x538751(0x105)]=normalizeWaitUnit(_0x5c732f[_0x538751(0xef)]);else{if(_0x5c732f[_0x538751(0xbc)])_0x2b3554['waitStepType']=_0x538751(0x98),_0x2b3554[_0x538751(0x79)]=_0x5c732f[_0x538751(0xbc)];else{if(_0x5c732f[_0x538751(0x12e)])_0x2b3554['waitStepType']=_0x538751(0x116),_0x2b3554[_0x538751(0x9b)]=_0x5c732f[_0x538751(0x12e)];else{if(_0x5c732f['condition']){_0x2b3554[_0x538751(0xab)]='Condition';const _0x484521=await _0x36b92a(_0x5c732f[_0x538751(0xfc)]['segment']),_0x26af8a=_0x5c732f[_0x538751(0xfc)][_0x538751(0xae)]?.[_0x538751(0xe3)]!==undefined;if(_0x26af8a){const _0x306da7=[];_0x306da7[_0x538751(0x9d)]({'id':generateUUID(),'segmentId':_0x484521,'timedOutPath':![],'name':_0x538751(0x107),'next':_0x38c689(_0x5c732f['condition']['next']??_0x471dae[_0x538751(0xe3)])});if(_0x5c732f[_0x538751(0xfc)][_0x538751(0xae)]){const _0x216044=_0x5c732f[_0x538751(0xfc)][_0x538751(0xae)]['duration'],_0x46ca65=normalizeWaitUnit(_0x5c732f[_0x538751(0xfc)][_0x538751(0xae)]['unit']);_0x306da7[_0x538751(0x9d)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x538751(0x82)+_0x216044+'\x20'+_0x46ca65,'moveAfter':_0x216044,'unit':_0x46ca65,'next':_0x38c689(_0x5c732f[_0x538751(0xfc)]['timeout'][_0x538751(0xe3)])});}_0x2b3554[_0x538751(0xaf)]=_0x306da7,delete _0x2b3554[_0x538751(0xe3)];}else _0x2b3554[_0x538751(0xfd)]=_0x484521,_0x5c732f[_0x538751(0xfc)]['timeout']&&(_0x2b3554[_0x538751(0x113)]=_0x5c732f[_0x538751(0xfc)][_0x538751(0xae)][_0x538751(0x124)],_0x5c732f[_0x538751(0xfc)]['timeout']['unit']&&(_0x2b3554[_0x538751(0x114)]=normalizeWaitUnit(_0x5c732f[_0x538751(0xfc)][_0x538751(0xae)][_0x538751(0xef)])));}}}}return _0x2b3554;}case'activation':{const _0x4dfa36=_0x469f5e,_0x327b53=_0x4dfa36[_0x538751(0xbb)]['activation'],_0xa1f5e5=await _0xcd46a4(_0x327b53);return{'type':'Activation','name':_0x4dfa36[_0x538751(0xb3)],'journeyActivationStepId':_0xa1f5e5,'next':_0x38c689(_0x4dfa36[_0x538751(0xe3)])};}case _0x538751(0xec):{const _0x372df3=_0x469f5e,_0x3c6f07=_0x372df3['with'][_0x538751(0xd9)];return{'type':'DecisionPoint','name':_0x372df3[_0x538751(0xb3)],'branches':await Promise[_0x538751(0xfb)](_0x3c6f07['map'](async _0x3985d8=>{const _0x4bc76e=_0x538751;let _0x41e145='';if(!_0x3985d8[_0x4bc76e(0xa5)]){const _0x5b2b77=_0x3985d8[_0x4bc76e(0xda)]||_0x3985d8[_0x4bc76e(0xeb)]||'';_0x41e145=_0x5b2b77?await _0x36b92a(_0x5b2b77):'';}return{'id':crypto['randomUUID'](),'name':_0x3985d8['name'],'description':null,'segmentId':_0x41e145,'excludedPath':_0x3985d8[_0x4bc76e(0xa5)]??![],'next':_0x38c689(_0x3985d8[_0x4bc76e(0xe3)])};})),'next':_0x38c689(_0x372df3[_0x538751(0xe3)])};}case _0x538751(0x133):{const _0x2d2a7a=_0x469f5e,_0x29c0f4=_0x2d2a7a[_0x538751(0xbb)];return{'type':_0x538751(0x71),'name':_0x2d2a7a['name'],'customizedSplit':_0x29c0f4['customized_split'],'uniqueId':_0x29c0f4['unique_id'],'variants':_0x29c0f4['variants']['map'](_0x158b77=>({'id':_0x158b77['id']||generateUUID(),'name':_0x158b77[_0x538751(0xb3)],'percentage':_0x158b77['percentage'],'next':_0x38c689(_0x158b77[_0x538751(0xe3)])})),'next':_0x38c689(_0x2d2a7a[_0x538751(0xe3)])};}case _0x538751(0x91):return{'type':'Merge','name':_0x469f5e[_0x538751(0xb3)],'next':_0x38c689(_0x469f5e[_0x538751(0xe3)])};case'jump':{const _0x57c7b4=_0x469f5e,_0x3c5ebf=_0x57c7b4['with'][_0x538751(0xdd)],_0x4c3c02=_0x3c5ebf[_0x538751(0xc4)],_0x2c26d1=_0x3c5ebf[_0x538751(0x8f)];let _0x57ee8a=_0x3c5ebf[_0x538751(0xc4)];_0x5e1dfb?.[_0x538751(0xce)]&&!/^\d+$/[_0x538751(0x10e)](_0x57ee8a)&&(_0x57ee8a=await _0x5e1dfb[_0x538751(0xce)](_0x57ee8a));let _0x57dded=_0x3c5ebf[_0x538751(0x8f)];_0x5e1dfb?.['resolveStageId']&&!/^\d+$/[_0x538751(0x10e)](_0x57dded)&&(_0x57dded=await _0x5e1dfb['resolveStageId'](_0x57ee8a,_0x57dded));const _0x26e750=!/^\d+$/[_0x538751(0x10e)](_0x4c3c02)&&!isLocalJourneyRef(_0x4c3c02)?formatApiJourneyName(_0x4c3c02,_0x2c26d1):undefined;return{'type':_0x538751(0xcf),'name':_0x57c7b4[_0x538751(0xb3)],'target':{'journeyId':_0x57ee8a,'journeyStageId':_0x57dded,'journeyBundleId':_0x3c5ebf['bundle_id'],'journeyName':_0x26e750,'confirmed':!![]},'next':_0x38c689(_0x57c7b4[_0x538751(0xe3)])};}case _0x538751(0x12b):return{'type':_0x538751(0x119),'name':_0x469f5e[_0x538751(0xb3)]};default:{const _0x324929=_0x469f5e;return{'type':'End','name':_0x324929['name']};}}}export function toYamlString(_0x35bc93){const _0x37235e=a147_0x5e51,_0x30bf4b=stripInternalFields(_0x35bc93),_0x281e89=a147_0x385692[_0x37235e(0xa0)](_0x30bf4b,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x37235e(0xb5)}),_0x5740ed=[_0x37235e(0x102),_0x37235e(0x11e),_0x37235e(0x11d),_0x37235e(0x11b),'journeys:',_0x37235e(0xf2),_0x37235e(0xc9)];let _0x4e4014=_0x281e89;for(const _0x53615d of _0x5740ed){_0x4e4014=_0x4e4014[_0x37235e(0xc1)](new RegExp('^('+_0x53615d+')','m'),(_0x4eb5bf,_0x30199,_0x2ee9a5)=>{if(_0x2ee9a5===0x0||_0x4e4014[_0x2ee9a5-0x1]==='\x0a'&&_0x4e4014[_0x2ee9a5-0x2]==='\x0a')return _0x30199;return'\x0a'+_0x30199;});}return _0x4e4014;}function stripInternalFields(_0x53a30d){const _0x4dc7c9=a147_0x5e51,{id:_0x48010c,folder_id:_0x4c88da,bundle_id:_0x189d18,bundle_name:_0x42bf14,version:_0x43a009,allow_reentry:_0x4eeac2,..._0x969945}=_0x53a30d;return _0x969945[_0x4dc7c9(0xcd)]&&(_0x969945[_0x4dc7c9(0xcd)]=_0x969945[_0x4dc7c9(0xcd)][_0x4dc7c9(0x6d)](_0x323e0a=>{const _0x26f272=_0x4dc7c9,{id:_0x35fb70,..._0x14d4a8}=_0x323e0a;return{..._0x14d4a8,'stages':_0x14d4a8['stages']['map'](stripStageInternalFields),..._0x323e0a['latest']===!![]?{'latest':!![]}:{},..._0x969945[_0x26f272(0xcd)][_0x26f272(0x10d)]===0x1&&_0x14d4a8[_0x26f272(0xa2)]==='v1'?{'version':undefined}:{}};})),_0x969945[_0x4dc7c9(0xdb)]&&(_0x969945['stages']=_0x969945['stages'][_0x4dc7c9(0x6d)](stripStageInternalFields)),_0x969945[_0x4dc7c9(0xf8)]&&(_0x969945[_0x4dc7c9(0xf8)]=_0x969945[_0x4dc7c9(0xf8)][_0x4dc7c9(0x6d)](_0x1f5cc6=>{const _0x5db5c9=_0x4dc7c9,{id:_0x2b08bf,..._0x2e839c}=_0x1f5cc6;return{..._0x2e839c,'stages':_0x2e839c[_0x5db5c9(0xdb)][_0x5db5c9(0x6d)](stripStageInternalFields),..._0x1f5cc6[_0x5db5c9(0xfe)]===!![]?{'latest':!![]}:{}};})),_0x969945;}function stripStageInternalFields(_0x2be6a4){const {id:_0x13eb5d,..._0xb38b6e}=_0x2be6a4;return _0xb38b6e;}export function parseYamlString(_0x487a87){return safeParseYaml(_0x487a87,JourneyDefSchema);}export function isJourneyDef(_0x4a44a2){const _0x499cbe=a147_0x5e51;return typeof _0x4a44a2===_0x499cbe(0xbf)&&_0x4a44a2!==null&&'type'in _0x4a44a2&&_0x4a44a2[_0x499cbe(0x103)]===_0x499cbe(0xc4);}function a147_0x533c(){const _0x47a891=['\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','Goal\x20Achieved','Date','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','uuid','daysOfWeek','connection','push','resolveSegmentName','versionNumber','stringify','notification','version','isArray','goal','excluded','Unknown\x20segment\x20\x22','resolveStageId','resolveSegmentId','entryCriteria','journeyName','waitStepType','relationships','journeyBundleName','timeout','conditions','match','resolveActivationName','599485KIuuyL','name','JOURNEY_SYNTAX_ERROR','null','segments','filter','definition','\x27:\x20','entry_criteria','with','wait_until','reentryMode','no_reentry','object','get','replace','schedule','Wait\x201\x20Day','journey','wait','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','columns','ref:','versions:','days','add','12ARVari','journeys','resolveJourneyId','Jump','state','exitCriteria','resolveEmbeddedActivationId','bundle_name','percentage','milestone','exit_criteria','Merge','Send\x20Notification','branches','segment','stages','Variant','target','stageName','unique_id','resolveJumpTarget','(missing)','size','next','segmentId','slice','jump','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','entries','reentry','week','segment_id','decision_point','keys','Entry\x20Criteria','unit','reentry_always','moveAfter','stages:','allowReentry','1241807mChZPW','timedOutPath','554118whfoNt','1588367lCRjoP','versions','\x20\x20rule:\x0a','journeyId','all','condition','conditionSegmentId','latest','waitStep','shift','folder_id','segments:','type','activations','waitStepUnit','day','Met\x20condition(s)','5896JMbCGg','journeyActivationStepId','goal-segment','data','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','length','test','\x27.\x0a','sort','Stage\x20Complete','WaitStep','conditionTimeoutDuration','conditionTimeoutUnit','launched','DaysOfTheWeek','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','behavior','End','embedded','reentry:','activation','goal:','activations:','8361ylHUtL','includes','set','stageId','journeyBundleId','duration','customized_split','ref','attributes','\x20\x20\x20\x20conditions:\x0a','resolveActivation','2264638WOtFYQ','end','excludedPath','exitCriterias','days_of_week','toLowerCase','uniqueId','customizedSplit','values','ab_test','variants','55405louRUD','rule','map','journeyStages','activation_template_id','draft','ABTest','And','parentFolder','\x20\x20\x20\x20type:\x20And\x0a','version_number','First\x20stage\x20of\x20the\x20journey','steps','waitCondition','waitUntilDate','bundle_id','resolveActivationId','connector_config','startsWith','Activation','find','isJourneyLocal','Duration','*Max\x20wait\x20','trim','Expected\x20format:\x0a','root_step','has','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','description','journeyStageId','Condition','weeks','\x20\x20\x20\x20type:\x20','354pvpwzM','from','stage','DecisionPoint','merge','all_columns','resolveEmbeddedSegmentId','110VauUDj','resolveSegment'];a147_0x533c=function(){return _0x47a891;};return a147_0x533c();}export function generateTemplate(_0x195705,_0x27718b){const _0x529ed3=a147_0x5e51,_0x51ecc0={'type':'journey','name':_0x195705,'description':'Journey\x20description','reentry':_0x529ed3(0xbe),'goal':{'name':_0x529ed3(0x97),'segment':_0x529ed3(0x10a)},'stages':[{'name':'Stage\x201','description':_0x529ed3(0x76),'entry_criteria':{'name':_0x529ed3(0xee),'segment':_0x27718b},'steps':[{'type':_0x529ed3(0xc5),'name':_0x529ed3(0xc3),'with':{'duration':0x1,'unit':_0x529ed3(0x106)}},{'type':_0x529ed3(0x11c),'name':_0x529ed3(0xd8),'with':{'activation':'your-activation-name'}},{'type':_0x529ed3(0x12b),'name':_0x529ed3(0x111)}]}]};return toYamlString(_0x51ecc0);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX=a147_0x134c14(0xc8);export function parseSegmentRef(_0x118b77){const _0x14f58d=a147_0x134c14;if(_0x118b77[_0x14f58d(0x7d)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x118b77[_0x14f58d(0xe5)](SEGMENT_REF_PREFIX[_0x14f58d(0x10d)])};if(/^\d+$/[_0x14f58d(0x10e)](_0x118b77))return{'type':'id','name':_0x118b77};return{'type':'embedded','name':_0x118b77};}export function makeSegmentRef(_0x299e90){return''+SEGMENT_REF_PREFIX+_0x299e90;}export function isExternalSegmentRef(_0x4396a8){const _0x1ae467=a147_0x134c14;return _0x4396a8[_0x1ae467(0x7d)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x172599){const _0x592d06=a147_0x134c14;return!!(_0x172599['journeys']&&_0x172599[_0x592d06(0xcd)][_0x592d06(0x10d)]>0x0);}export function isMultiVersionMode(_0xb27dfd){const _0xc444d=a147_0x134c14;return!!(_0xb27dfd[_0xc444d(0xf8)]&&_0xb27dfd[_0xc444d(0xf8)][_0xc444d(0x10d)]>0x0);}export function isSingleVersionMode(_0x5f43cc){const _0x187a1e=a147_0x134c14;return!!(_0x5f43cc['stages']&&_0x5f43cc[_0x187a1e(0xdb)][_0x187a1e(0x10d)]>0x0);}export function hasMultipleVersions(_0x16e2bb){const _0x14af6d=a147_0x134c14;if(isJourneysArrayMode(_0x16e2bb))return(_0x16e2bb[_0x14af6d(0xcd)]?.[_0x14af6d(0x10d)]||0x0)>0x1;if(isMultiVersionMode(_0x16e2bb))return(_0x16e2bb[_0x14af6d(0xf8)]?.[_0x14af6d(0x10d)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x53e9ba){const _0x2beccb=a147_0x134c14;if(isJourneysArrayMode(_0x53e9ba))return _0x53e9ba;if(isSingleVersionMode(_0x53e9ba)){const {stages:_0x4eabfc,id:_0x8a293d,version:_0x15d0f2,version_number:_0x5656fc,..._0x238047}=_0x53e9ba;return{..._0x238047,'journeys':[{'version':_0x15d0f2||'v1','stages':_0x4eabfc||[],'id':_0x8a293d,'version_number':_0x5656fc}]};}if(isMultiVersionMode(_0x53e9ba)){const {versions:_0x537587,..._0xd38da9}=_0x53e9ba;return{..._0xd38da9,'journeys':(_0x537587||[])[_0x2beccb(0x6d)](_0x4fff0b=>({'version':_0x4fff0b['name'],'state':_0x4fff0b[_0x2beccb(0xd0)],'latest':_0x4fff0b['latest'],'stages':_0x4fff0b[_0x2beccb(0xdb)],'id':_0x4fff0b['id'],'version_number':_0x4fff0b[_0x2beccb(0x75)]}))};}return _0x53e9ba;}export function normalizeJourneyDef(_0x1cc767,_0x44bcfd){const _0x32c126=a147_0x134c14,_0x2b215e=normalizeToJourneysFormat(_0x1cc767),_0x160d3c=_0x44bcfd?.[_0x32c126(0xb6)]?Object['keys'](_0x44bcfd[_0x32c126(0xb6)]):undefined,_0x4b3900=_0x44bcfd?.['activations']?Object[_0x32c126(0xed)](_0x44bcfd[_0x32c126(0x104)]):undefined;return{'type':'journey','name':_0x2b215e[_0x32c126(0xb3)],..._0x2b215e['description']!==undefined&&{'description':_0x2b215e[_0x32c126(0x88)]},..._0x2b215e['goal']&&{'goal':normalizeJourneyCriteria(_0x2b215e[_0x32c126(0xa4)])},..._0x2b215e[_0x32c126(0xe9)]!==undefined&&{'reentry':_0x2b215e[_0x32c126(0xe9)]},..._0x2b215e[_0x32c126(0xb6)]&&{'segments':normalizeEmbeddedSegments(_0x2b215e[_0x32c126(0xb6)],_0x160d3c)},..._0x2b215e[_0x32c126(0x104)]&&{'activations':normalizeEmbeddedActivations(_0x2b215e[_0x32c126(0x104)],_0x4b3900)},..._0x2b215e[_0x32c126(0xcd)]&&{'journeys':_0x2b215e[_0x32c126(0xcd)][_0x32c126(0x6d)](_0x277ec2=>normalizeJourneyEntry(_0x277ec2,_0x2b215e[_0x32c126(0xcd)][_0x32c126(0x10d)]===0x1))}};}function normalizeJourneyEntry(_0x54492e,_0x5f3c31){const _0x55f58a=a147_0x134c14;return{...!_0x5f3c31&&_0x54492e['version']!==undefined&&{'version':_0x54492e[_0x55f58a(0xa2)]},..._0x54492e[_0x55f58a(0xd0)]!==undefined&&{'state':_0x54492e[_0x55f58a(0xd0)]},...!_0x5f3c31&&_0x54492e[_0x55f58a(0xfe)]!==undefined&&{'latest':_0x54492e['latest']},..._0x54492e[_0x55f58a(0x75)]!==undefined&&{'version_number':_0x54492e[_0x55f58a(0x75)]},..._0x54492e[_0x55f58a(0xa4)]&&{'goal':normalizeJourneyCriteria(_0x54492e[_0x55f58a(0xa4)])},..._0x54492e['reentry']!==undefined&&{'reentry':_0x54492e[_0x55f58a(0xe9)]},'stages':_0x54492e[_0x55f58a(0xdb)][_0x55f58a(0x6d)](normalizeJourneyStage)};}function normalizeJourneyStage(_0x2fab06){const _0x13b7cf=a147_0x134c14;return{'name':_0x2fab06[_0x13b7cf(0xb3)],..._0x2fab06[_0x13b7cf(0x88)]!==undefined&&{'description':_0x2fab06[_0x13b7cf(0x88)]},..._0x2fab06[_0x13b7cf(0xba)]&&{'entry_criteria':normalizeJourneyCriteria(_0x2fab06[_0x13b7cf(0xba)])},..._0x2fab06[_0x13b7cf(0xd6)]&&{'exit_criteria':_0x2fab06[_0x13b7cf(0xd6)][_0x13b7cf(0x6d)](normalizeJourneyCriteria)},..._0x2fab06[_0x13b7cf(0xd5)]&&{'milestone':normalizeJourneyCriteria(_0x2fab06[_0x13b7cf(0xd5)])},..._0x2fab06['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x2fab06[_0x13b7cf(0x77)])}};}function normalizeStepsWithImplicitNext(_0x315162){const _0x3b4e7d=a147_0x134c14;return _0x315162[_0x3b4e7d(0x6d)]((_0x1f8bfe,_0x45f227)=>{const _0x57ef00=_0x3b4e7d,_0xf11a54=_0x45f227<_0x315162[_0x57ef00(0x10d)]-0x1?_0x315162[_0x45f227+0x1][_0x57ef00(0xb3)]:undefined;return normalizeJourneyStep(_0x1f8bfe,_0xf11a54);});}function normalizeJourneyCriteria(_0x449e15){const _0x492615=a147_0x134c14;return{'name':_0x449e15[_0x492615(0xb3)],..._0x449e15[_0x492615(0x88)]!==undefined&&{'description':_0x449e15[_0x492615(0x88)]},'segment':_0x449e15[_0x492615(0xda)],..._0x449e15[_0x492615(0xdd)]&&{'target':normalizeJumpTarget(_0x449e15[_0x492615(0xdd)])}};}function normalizeJourneyStep(_0x1fa3d0,_0x393e10){const _0x84b233=a147_0x134c14,_0x323b09=_0x1fa3d0['next']!==undefined&&_0x1fa3d0[_0x84b233(0xe3)]!==_0x393e10,_0xc0cb98={'type':_0x1fa3d0[_0x84b233(0x103)],'name':_0x1fa3d0[_0x84b233(0xb3)],..._0x323b09&&{'next':_0x1fa3d0[_0x84b233(0xe3)]}};if(_0x84b233(0xbb)in _0x1fa3d0&&_0x1fa3d0[_0x84b233(0xbb)])return{..._0xc0cb98,'with':normalizeStepParams(_0x1fa3d0[_0x84b233(0x103)],_0x1fa3d0[_0x84b233(0xbb)])};return _0xc0cb98;}function normalizeStepParams(_0x119c3d,_0x3a7244){const _0x39f371=a147_0x134c14;switch(_0x119c3d){case _0x39f371(0xc5):{const _0x146032=_0x3a7244;let _0x3fb7cb;return _0x146032[_0x39f371(0xfc)]&&(_0x3fb7cb={'segment':_0x146032[_0x39f371(0xfc)]['segment'],..._0x146032[_0x39f371(0xfc)][_0x39f371(0xe3)]!==undefined&&{'next':_0x146032[_0x39f371(0xfc)]['next']},..._0x146032['condition'][_0x39f371(0xae)]&&{'timeout':{'duration':_0x146032[_0x39f371(0xfc)][_0x39f371(0xae)][_0x39f371(0x124)],'unit':_0x146032['condition'][_0x39f371(0xae)][_0x39f371(0xef)],..._0x146032[_0x39f371(0xfc)][_0x39f371(0xae)][_0x39f371(0xe3)]!==undefined&&{'next':_0x146032[_0x39f371(0xfc)]['timeout'][_0x39f371(0xe3)]}}}}),{..._0x146032[_0x39f371(0x124)]!==undefined&&{'duration':_0x146032[_0x39f371(0x124)]},..._0x146032[_0x39f371(0xef)]!==undefined&&{'unit':_0x146032[_0x39f371(0xef)]},..._0x146032[_0x39f371(0xbc)]!==undefined&&{'wait_until':_0x146032[_0x39f371(0xbc)]},..._0x146032[_0x39f371(0x12e)]!==undefined&&{'days_of_week':_0x146032[_0x39f371(0x12e)]},..._0x3fb7cb&&{'condition':_0x3fb7cb}};}case _0x39f371(0x11c):{const _0x278328=_0x3a7244;return{'activation':_0x278328['activation']};}case _0x39f371(0xec):{const _0x18a567=_0x3a7244;return{'branches':_0x18a567[_0x39f371(0xd9)]['map'](normalizeDecisionBranch)};}case'ab_test':{const _0x1646ca=_0x3a7244;return{..._0x1646ca['customized_split']!==undefined&&{'customized_split':_0x1646ca[_0x39f371(0x125)]},..._0x1646ca[_0x39f371(0xdf)]!==undefined&&{'unique_id':_0x1646ca['unique_id']},'variants':_0x1646ca['variants']['map'](normalizeAbTestVariant)};}case _0x39f371(0xe6):{const _0x4b7753=_0x3a7244;return{'target':normalizeJumpTarget(_0x4b7753[_0x39f371(0xdd)])};}default:return _0x3a7244;}}function normalizeDecisionBranch(_0x15fae6){const _0xe70e98=a147_0x134c14;return{'name':_0x15fae6[_0xe70e98(0xb3)],..._0x15fae6['segment']!==undefined&&{'segment':_0x15fae6['segment']},..._0x15fae6[_0xe70e98(0xa5)]!==undefined&&{'excluded':_0x15fae6[_0xe70e98(0xa5)]},..._0x15fae6['next']!==undefined&&{'next':_0x15fae6[_0xe70e98(0xe3)]}};}function normalizeAbTestVariant(_0x4a8eb5){const _0xc137f0=a147_0x134c14;return{..._0x4a8eb5['id']!==undefined&&{'id':_0x4a8eb5['id']},'name':_0x4a8eb5['name'],'percentage':_0x4a8eb5['percentage'],..._0x4a8eb5['next']!==undefined&&{'next':_0x4a8eb5[_0xc137f0(0xe3)]}};}function normalizeJumpTarget(_0x245246){const _0x3787fe=a147_0x134c14;return{'journey':_0x245246[_0x3787fe(0xc4)],'stage':_0x245246[_0x3787fe(0x8f)],..._0x245246[_0x3787fe(0x7a)]!==undefined&&{'bundle_id':_0x245246['bundle_id']}};}function normalizeEmbeddedSegments(_0x333905,_0x503daf){const _0x1caba6=a147_0x134c14,_0x3e629f={},_0x27fe7f=Object[_0x1caba6(0xed)](_0x333905),_0x2ac842=_0x503daf?[..._0x503daf[_0x1caba6(0xb7)](_0x51cf2e=>_0x27fe7f['includes'](_0x51cf2e)),..._0x27fe7f[_0x1caba6(0xb7)](_0x3e8952=>!_0x503daf[_0x1caba6(0x120)](_0x3e8952))[_0x1caba6(0x110)]()]:_0x27fe7f[_0x1caba6(0x110)]();for(const _0x40edec of _0x2ac842){const _0x49fc44=_0x333905[_0x40edec];if(_0x49fc44[_0x1caba6(0x6c)]){const _0x5b78e0=_0x49fc44[_0x1caba6(0x6c)];if(_0x5b78e0[_0x1caba6(0x103)]!==_0x1caba6(0x72)&&_0x5b78e0[_0x1caba6(0x103)]!=='Or'){const _0x55b91e=_0x5b78e0[_0x1caba6(0x103)]??_0x1caba6(0xe1);throw new SDKError(ErrorCode[_0x1caba6(0xb4)],_0x1caba6(0x87)+_0x40edec+_0x1caba6(0xb9)+(_0x1caba6(0x99)+_0x55b91e+_0x1caba6(0x10f))+_0x1caba6(0x84)+_0x1caba6(0xf9)+_0x1caba6(0x74)+'\x20\x20\x20\x20conditions:\x0a'+_0x1caba6(0x96)+_0x1caba6(0x10c)+_0x1caba6(0x117));}if(!_0x5b78e0[_0x1caba6(0xaf)]||!Array['isArray'](_0x5b78e0[_0x1caba6(0xaf)]))throw new SDKError(ErrorCode[_0x1caba6(0xb4)],'Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27'+_0x40edec+_0x1caba6(0xb9)+_0x1caba6(0xc6)+'Expected\x20format:\x0a'+_0x1caba6(0xf9)+(_0x1caba6(0x8c)+_0x5b78e0[_0x1caba6(0x103)]+'\x0a')+_0x1caba6(0x128)+_0x1caba6(0x96)+_0x1caba6(0x10c)+_0x1caba6(0x117));}_0x3e629f[_0x40edec]={..._0x49fc44[_0x1caba6(0x88)]&&_0x49fc44[_0x1caba6(0x88)][_0x1caba6(0x83)]()&&{'description':_0x49fc44[_0x1caba6(0x88)]},..._0x49fc44[_0x1caba6(0x6c)]&&{'rule':deepSortObject(_0x49fc44[_0x1caba6(0x6c)])}};}return _0x3e629f;}function normalizeEmbeddedActivations(_0x666227,_0xdcfb91){const _0x532353=a147_0x134c14,_0x3b3841={},_0x119c9d=Object[_0x532353(0xed)](_0x666227),_0x34fed4=_0xdcfb91?[..._0xdcfb91[_0x532353(0xb7)](_0x5019b4=>_0x119c9d[_0x532353(0x120)](_0x5019b4)),..._0x119c9d[_0x532353(0xb7)](_0x1dfa58=>!_0xdcfb91[_0x532353(0x120)](_0x1dfa58))[_0x532353(0x110)]()]:_0x119c9d[_0x532353(0x110)]();for(const _0x11acea of _0x34fed4){const _0x131591=_0x666227[_0x11acea];_0x3b3841[_0x11acea]={'name':_0x131591[_0x532353(0xb3)],'connection':_0x131591[_0x532353(0x9c)],..._0x131591[_0x532353(0x88)]!==undefined&&{'description':_0x131591[_0x532353(0x88)]},..._0x131591[_0x532353(0x92)]!==undefined&&{'all_columns':_0x131591['all_columns']},..._0x131591[_0x532353(0xc7)]!==undefined&&{'columns':_0x131591['columns']},..._0x131591[_0x532353(0x118)]!==undefined&&{'behavior':_0x131591[_0x532353(0x118)]},..._0x131591[_0x532353(0xc2)]!==undefined&&{'schedule':_0x131591[_0x532353(0xc2)]},..._0x131591[_0x532353(0xa1)]!==undefined&&{'notification':_0x131591[_0x532353(0xa1)]},..._0x131591[_0x532353(0x7c)]!==undefined&&{'connector_config':_0x131591[_0x532353(0x7c)]},..._0x131591[_0x532353(0x6f)]!==undefined&&{'activation_template_id':_0x131591[_0x532353(0x6f)]}};}return _0x3b3841;}export function getActiveStages(_0x54b5e5){const _0x38bf55=a147_0x134c14;if(isJourneysArrayMode(_0x54b5e5)){const _0x574ac5=_0x54b5e5[_0x38bf55(0xcd)]||[],_0x889ad0=_0x574ac5[_0x38bf55(0x7f)](_0x586a8d=>_0x586a8d[_0x38bf55(0xfe)]===!![])||_0x574ac5[0x0];return _0x889ad0?.['stages']||[];}if(isSingleVersionMode(_0x54b5e5))return _0x54b5e5[_0x38bf55(0xdb)]||[];if(isMultiVersionMode(_0x54b5e5)){const _0x5b42a0=_0x54b5e5['versions']||[],_0x289cdc=_0x5b42a0[_0x38bf55(0x7f)](_0x5be139=>_0x5be139[_0x38bf55(0xfe)]===!![])||_0x5b42a0[0x0];return _0x289cdc?.[_0x38bf55(0xdb)]||[];}return[];}export function getLatestJourneyEntry(_0x4fc217){const _0x57ea9e=a147_0x134c14;if(isJourneysArrayMode(_0x4fc217)){const _0x4dd967=_0x4fc217['journeys']||[];return _0x4dd967[_0x57ea9e(0x7f)](_0xeacf39=>_0xeacf39[_0x57ea9e(0xfe)]===!![])||_0x4dd967[0x0];}if(isMultiVersionMode(_0x4fc217)){const _0x20d659=_0x4fc217[_0x57ea9e(0xf8)]||[],_0x339d5a=_0x20d659[_0x57ea9e(0x7f)](_0x9c2dd2=>_0x9c2dd2['latest']===!![])||_0x20d659[0x0];if(_0x339d5a)return{'version':_0x339d5a[_0x57ea9e(0xb3)],'state':_0x339d5a['state'],'latest':_0x339d5a[_0x57ea9e(0xfe)],'stages':_0x339d5a[_0x57ea9e(0xdb)],'id':_0x339d5a['id'],'version_number':_0x339d5a[_0x57ea9e(0x75)]};}if(isSingleVersionMode(_0x4fc217))return{'version':_0x4fc217['version']||'v1','state':_0x57ea9e(0x70),'stages':_0x4fc217[_0x57ea9e(0xdb)]||[],'id':_0x4fc217['id'],'version_number':_0x4fc217[_0x57ea9e(0x75)],'goal':_0x4fc217[_0x57ea9e(0xa4)],'reentry':_0x4fc217[_0x57ea9e(0xe9)]};return undefined;}export function getLatestVersion(_0x35e85f){const _0x5b6b48=a147_0x134c14;if(!isMultiVersionMode(_0x35e85f))return undefined;const _0xfa6d71=_0x35e85f[_0x5b6b48(0xf8)]||[];return _0xfa6d71[_0x5b6b48(0x7f)](_0x50cff9=>_0x50cff9['latest']===!![])||_0xfa6d71[0x0];}export function getEffectiveGoal(_0xdc207d){const _0x1ce0f4=a147_0x134c14,_0x30bbf3=getLatestJourneyEntry(_0xdc207d);return _0x30bbf3?.[_0x1ce0f4(0xa4)]||_0xdc207d['goal'];}export function getEffectiveReentry(_0x215149){const _0x789bde=a147_0x134c14,_0x15cc74=getLatestJourneyEntry(_0x215149);return _0x15cc74?.[_0x789bde(0xe9)]||_0x215149[_0x789bde(0xe9)];}export function collectSegmentRefs(_0x5eb161){const _0x44dae6=a147_0x134c14,_0x31d0c5=new Set();_0x5eb161[_0x44dae6(0xa4)]?.[_0x44dae6(0xda)]&&_0x31d0c5[_0x44dae6(0xcb)](_0x5eb161[_0x44dae6(0xa4)][_0x44dae6(0xda)]);const _0x1b3771=_0x3072e2=>{const _0x276252=_0x44dae6;for(const _0x1e7347 of _0x3072e2){_0x1e7347[_0x276252(0xba)]?.[_0x276252(0xda)]&&_0x31d0c5[_0x276252(0xcb)](_0x1e7347[_0x276252(0xba)][_0x276252(0xda)]);if(_0x1e7347[_0x276252(0xd6)])for(const _0x3ae92e of _0x1e7347[_0x276252(0xd6)]){_0x3ae92e[_0x276252(0xda)]&&_0x31d0c5[_0x276252(0xcb)](_0x3ae92e[_0x276252(0xda)]);}_0x1e7347[_0x276252(0xd5)]?.[_0x276252(0xda)]&&_0x31d0c5[_0x276252(0xcb)](_0x1e7347[_0x276252(0xd5)][_0x276252(0xda)]);if(_0x1e7347[_0x276252(0x77)])for(const _0x198467 of _0x1e7347[_0x276252(0x77)]){if(_0x198467[_0x276252(0x103)]===_0x276252(0xec)){const _0x46280b=_0x198467;for(const _0x2d1c65 of _0x46280b[_0x276252(0xbb)][_0x276252(0xd9)]){_0x2d1c65['segment']&&_0x31d0c5[_0x276252(0xcb)](_0x2d1c65[_0x276252(0xda)]);}}else{if(_0x198467[_0x276252(0x103)]===_0x276252(0xc5)){const _0x309a64=_0x198467;_0x309a64[_0x276252(0xbb)][_0x276252(0xfc)]?.['segment']&&_0x31d0c5[_0x276252(0xcb)](_0x309a64[_0x276252(0xbb)]['condition'][_0x276252(0xda)]);}}}}};_0x5eb161[_0x44dae6(0xdb)]&&_0x1b3771(_0x5eb161[_0x44dae6(0xdb)]);if(_0x5eb161[_0x44dae6(0xf8)])for(const _0x367a15 of _0x5eb161[_0x44dae6(0xf8)]){_0x1b3771(_0x367a15['stages']);}return _0x31d0c5;}export function validateSegmentRefs(_0x3e1337){const _0x3ada9e=a147_0x134c14,_0x2edc97=[],_0x2dc867=collectSegmentRefs(_0x3e1337),_0x339b80=new Set(Object[_0x3ada9e(0xed)](_0x3e1337[_0x3ada9e(0xb6)]||{}));for(const _0x37b790 of _0x2dc867){const _0x3e7e6a=parseSegmentRef(_0x37b790);_0x3e7e6a[_0x3ada9e(0x103)]===_0x3ada9e(0x11a)&&!_0x339b80['has'](_0x3e7e6a[_0x3ada9e(0xb3)])&&_0x2edc97[_0x3ada9e(0x9d)](_0x3ada9e(0xa6)+_0x3e7e6a[_0x3ada9e(0xb3)]+_0x3ada9e(0xe7)+_0x3e7e6a[_0x3ada9e(0xb3)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x2edc97;}export function collectSegmentIdsFromJourneyApi(_0x3fa3db){const _0xf72111=a147_0x134c14,_0x4e9033=new Set();_0x3fa3db[_0xf72111(0x127)][_0xf72111(0xa4)]?.['segmentId']&&_0x4e9033[_0xf72111(0xcb)](_0x3fa3db[_0xf72111(0x127)][_0xf72111(0xa4)][_0xf72111(0xe4)]);const _0x34bc89=_0x3fa3db[_0xf72111(0x127)][_0xf72111(0x6e)];if(Array[_0xf72111(0xa3)](_0x34bc89))for(const _0x29fb5d of _0x34bc89){_0x29fb5d[_0xf72111(0xa9)]?.[_0xf72111(0xe4)]&&_0x4e9033['add'](_0x29fb5d['entryCriteria'][_0xf72111(0xe4)]);const _0x34c66c=_0x29fb5d[_0xf72111(0x12d)]??_0x29fb5d[_0xf72111(0xd1)];if(Array[_0xf72111(0xa3)](_0x34c66c))for(const _0x13ef1f of _0x34c66c){_0x13ef1f[_0xf72111(0xe4)]&&_0x4e9033[_0xf72111(0xcb)](_0x13ef1f[_0xf72111(0xe4)]);}_0x29fb5d[_0xf72111(0xd5)]?.[_0xf72111(0xe4)]&&_0x4e9033[_0xf72111(0xcb)](_0x29fb5d[_0xf72111(0xd5)][_0xf72111(0xe4)]);if(_0x29fb5d[_0xf72111(0x77)]&&typeof _0x29fb5d[_0xf72111(0x77)]===_0xf72111(0xbf)){const _0x152fd3=Array[_0xf72111(0xa3)](_0x29fb5d['steps'])?_0x29fb5d[_0xf72111(0x77)]:Object[_0xf72111(0x132)](_0x29fb5d[_0xf72111(0x77)]);for(const _0x58942c of _0x152fd3){_0x58942c[_0xf72111(0x78)]?.[_0xf72111(0xe4)]&&_0x4e9033[_0xf72111(0xcb)](_0x58942c[_0xf72111(0x78)]['segmentId']);const _0x3a1241=_0x58942c;_0x3a1241[_0xf72111(0xfd)]&&_0x4e9033[_0xf72111(0xcb)](_0x3a1241[_0xf72111(0xfd)]);if(Array[_0xf72111(0xa3)](_0x3a1241[_0xf72111(0xaf)]))for(const _0x2cf559 of _0x3a1241[_0xf72111(0xaf)]){_0x2cf559['segmentId']&&_0x4e9033[_0xf72111(0xcb)](_0x2cf559[_0xf72111(0xe4)]);}if(Array[_0xf72111(0xa3)](_0x58942c['branches']))for(const _0x15e64f of _0x58942c['branches']){_0x15e64f[_0xf72111(0xe4)]&&_0x4e9033[_0xf72111(0xcb)](_0x15e64f[_0xf72111(0xe4)]);}}}}return _0x4e9033;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a148_0x6bbc42=a148_0x4137;function a148_0x5f56(){const _0x4683d8=['m.*','label','master','\x0aLIMIT\x200\x0a','length','327134cOQodV','push','-1d','toLowerCase','\x27)\x0a','\x27)\x0aLIMIT\x20','15588270icMfxe','map','\x20m\x0aJOIN\x20','columns','\x20LIMIT\x20','child_key','replace','\x20=\x20a.','SELECT\x20*\x20FROM\x20','LEFT\x20JOIN\x20','forEach','945234mDuwbB','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','database','\x20m\x0aLEFT\x20JOIN\x20','\x0aSELECT\x20m.','name','find','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','\x20b\x0a\x20\x20ON\x20m.','4193628VqCqFQ','b.*','\x20LIMIT\x200','all_columns','3CMmrpx','(all\x20columns)','\x0aWHERE\x20a.','SELECT\x20','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','5OPytGa','\x20a\x0a\x20\x20ON\x20m.','\x0aFROM\x20','\x0aSELECT\x20','source','test','\x20=\x20','\x0a\x20\x20ON\x20m.','table','\x0aLIMIT\x20','join','parent_key','\x20AS\x20','2052820QroCQm','2217448xtqgWV','attributes','1685688JmubuB','8lbWxbY','trim','column','\x20=\x20b.'];a148_0x5f56=function(){return _0x4683d8;};return a148_0x5f56();}(function(_0x125a8a,_0x4e79e2){const _0x367a23=a148_0x4137,_0x21454b=_0x125a8a();while(!![]){try{const _0x1770de=-parseInt(_0x367a23(0x1d4))/0x1+parseInt(_0x367a23(0x1ca))/0x2*(-parseInt(_0x367a23(0x1f2))/0x3)+-parseInt(_0x367a23(0x1c8))/0x4*(-parseInt(_0x367a23(0x1f8))/0x5)+-parseInt(_0x367a23(0x1ee))/0x6+parseInt(_0x367a23(0x1c7))/0x7+parseInt(_0x367a23(0x1cb))/0x8*(-parseInt(_0x367a23(0x1e5))/0x9)+parseInt(_0x367a23(0x1da))/0xa;if(_0x1770de===_0x4e79e2)break;else _0x21454b['push'](_0x21454b['shift']());}catch(_0x1d4fe7){_0x21454b['push'](_0x21454b['shift']());}}}(a148_0x5f56,0x6997b));export const DEFAULT_TIME_RANGE=a148_0x6bbc42(0x1d6);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x4be08d,_0x19829d,_0x1992f6){const _0x39d555=a148_0x6bbc42,_0x1ed6da=_0x1992f6&&_0x1992f6[_0x39d555(0x1d3)]>0x0?_0x1992f6['join'](',\x20'):'*';return _0x39d555(0x1f5)+_0x1ed6da+'\x20FROM\x20'+_0x4be08d+'.'+_0x19829d+_0x39d555(0x1f0);}export function generateMasterCountSQL(_0x8a9e62){const _0x30cc42=a148_0x6bbc42,{database:_0x48539a,table:_0x17e2cb}=_0x8a9e62['master'];return _0x30cc42(0x1ec)+_0x48539a+'.'+_0x17e2cb;}export function generateMasterSampleSQL(_0x2b8c5d,_0x771caf=0x5){const _0x25f540=a148_0x6bbc42,{database:_0x169f02,table:_0x441f60}=_0x2b8c5d[_0x25f540(0x1d1)];return _0x25f540(0x1e2)+_0x169f02+'.'+_0x441f60+_0x25f540(0x1de)+_0x771caf;}function a148_0x4137(_0x59e6ef,_0x438b81){_0x59e6ef=_0x59e6ef-0x1c4;const _0x5f5611=a148_0x5f56();let _0x413787=_0x5f5611[_0x59e6ef];return _0x413787;}export function generateAttributeCoverageSQL(_0x1051ed,_0x3aa0dc){const _0x1b23ad=a148_0x6bbc42,_0xc48c03=_0x1051ed[_0x1b23ad(0x1d1)];return(_0x1b23ad(0x1f6)+_0xc48c03[_0x1b23ad(0x1e7)]+'.'+_0xc48c03[_0x1b23ad(0x200)]+_0x1b23ad(0x1e8)+_0x3aa0dc[_0x1b23ad(0x1fc)][_0x1b23ad(0x1e7)]+'.'+_0x3aa0dc[_0x1b23ad(0x1fc)][_0x1b23ad(0x200)]+_0x1b23ad(0x1f9)+_0x3aa0dc['join'][_0x1b23ad(0x1c5)]+_0x1b23ad(0x1e1)+_0x3aa0dc['join'][_0x1b23ad(0x1df)]+_0x1b23ad(0x1f4)+_0x3aa0dc[_0x1b23ad(0x1c4)]['child_key']+'\x20IS\x20NOT\x20NULL\x0a')['trim']();}export function generateBehaviorStatsSQL(_0x5e6b6b,_0x133dae,_0x29e819=DEFAULT_TIME_RANGE){const _0x315b9e=a148_0x6bbc42,_0x51a7a3=_0x5e6b6b['master'];return(_0x315b9e(0x1e6)+_0x133dae[_0x315b9e(0x1c4)]['parent_key']+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x51a7a3[_0x315b9e(0x1e7)]+'.'+_0x51a7a3[_0x315b9e(0x200)]+_0x315b9e(0x1dc)+_0x133dae[_0x315b9e(0x1fc)]['database']+'.'+_0x133dae[_0x315b9e(0x1fc)][_0x315b9e(0x200)]+_0x315b9e(0x1ed)+_0x133dae[_0x315b9e(0x1c4)][_0x315b9e(0x1c5)]+_0x315b9e(0x1ce)+_0x133dae[_0x315b9e(0x1c4)][_0x315b9e(0x1df)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x29e819+_0x315b9e(0x1d8))[_0x315b9e(0x1cc)]();}export function generateAttributeSampleSQL(_0x5066cf,_0x4817df,_0x4ad5dd=0x5){const _0x2e2855=a148_0x6bbc42,_0x3f3416=_0x5066cf[_0x2e2855(0x1d1)],_0x932af4=_0x4817df[_0x2e2855(0x1c4)][_0x2e2855(0x1c5)],_0x480b08=_0x4817df[_0x2e2855(0x1dd)][_0x2e2855(0x1db)](_0x5e734c=>'a.'+_0x5e734c[_0x2e2855(0x1cd)])[_0x2e2855(0x1c4)](',\x20');return(_0x2e2855(0x1e9)+_0x932af4+',\x20'+_0x480b08+_0x2e2855(0x1fa)+_0x3f3416[_0x2e2855(0x1e7)]+'.'+_0x3f3416[_0x2e2855(0x200)]+'\x20m\x0aJOIN\x20'+_0x4817df[_0x2e2855(0x1fc)][_0x2e2855(0x1e7)]+'.'+_0x4817df[_0x2e2855(0x1fc)][_0x2e2855(0x200)]+_0x2e2855(0x1f9)+_0x4817df[_0x2e2855(0x1c4)][_0x2e2855(0x1c5)]+_0x2e2855(0x1e1)+_0x4817df[_0x2e2855(0x1c4)]['child_key']+'\x0aLIMIT\x20'+_0x4ad5dd+'\x0a')[_0x2e2855(0x1cc)]();}export function generateBehaviorSampleSQL(_0x547ce2,_0x514ba4,_0x5ecabe=0x5,_0x5824f7=DEFAULT_TIME_RANGE){const _0x584442=a148_0x6bbc42,_0x528eac=_0x547ce2['master'],_0x4fa430=_0x514ba4[_0x584442(0x1c4)][_0x584442(0x1c5)];let _0x2484d7;if(_0x514ba4[_0x584442(0x1f1)])_0x2484d7=_0x584442(0x1ef);else _0x514ba4['columns']&&_0x514ba4[_0x584442(0x1dd)][_0x584442(0x1d3)]>0x0?_0x2484d7=_0x514ba4[_0x584442(0x1dd)][_0x584442(0x1db)](_0x2f4a70=>'b.'+_0x2f4a70['column'])[_0x584442(0x1c4)](',\x20'):_0x2484d7=_0x584442(0x1ef);return(_0x584442(0x1e9)+_0x4fa430+',\x20'+_0x2484d7+_0x584442(0x1fa)+_0x528eac[_0x584442(0x1e7)]+'.'+_0x528eac[_0x584442(0x200)]+_0x584442(0x1dc)+_0x514ba4[_0x584442(0x1fc)][_0x584442(0x1e7)]+'.'+_0x514ba4['source'][_0x584442(0x200)]+_0x584442(0x1ed)+_0x514ba4[_0x584442(0x1c4)]['parent_key']+_0x584442(0x1ce)+_0x514ba4['join'][_0x584442(0x1df)]+_0x584442(0x1f7)+_0x5824f7+_0x584442(0x1d9)+_0x5ecabe+'\x0a')['trim']();}function quoteIdentifier(_0x3a4fb8){const _0x52ab18=a148_0x6bbc42;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x52ab18(0x1fd)](_0x3a4fb8))return'\x22'+_0x3a4fb8[_0x52ab18(0x1e0)](/"/g,'\x22\x22')+'\x22';return _0x3a4fb8;}export function generateEnrichedSQL(_0x52d5dc,_0x177430=0x5){const _0x3197de=a148_0x6bbc42,_0x30dee3=_0x52d5dc[_0x3197de(0x1d1)],_0x174eef=_0x52d5dc[_0x3197de(0x1c9)]||[];if(_0x174eef[_0x3197de(0x1d3)]===0x0)return _0x3197de(0x1e2)+_0x30dee3[_0x3197de(0x1e7)]+'.'+_0x30dee3[_0x3197de(0x200)]+_0x3197de(0x1de)+_0x177430;const _0x488d88=[_0x3197de(0x1cf)],_0x5df5fc=[];return _0x174eef[_0x3197de(0x1e4)]((_0x94c4a9,_0xb8f518)=>{const _0x30356b=_0x3197de,_0x5410a5='a'+_0xb8f518;_0x94c4a9[_0x30356b(0x1dd)]['forEach'](_0x38427a=>{const _0x2afed3=_0x30356b,_0x3510f7=quoteIdentifier(_0x38427a[_0x2afed3(0x1d0)]||_0x38427a[_0x2afed3(0x1cd)]);_0x488d88[_0x2afed3(0x1d5)](_0x5410a5+'.'+_0x38427a[_0x2afed3(0x1cd)]+_0x2afed3(0x1c6)+_0x3510f7);}),_0x5df5fc[_0x30356b(0x1d5)](_0x30356b(0x1e3)+_0x94c4a9[_0x30356b(0x1fc)][_0x30356b(0x1e7)]+'.'+_0x94c4a9[_0x30356b(0x1fc)][_0x30356b(0x200)]+'\x20'+_0x5410a5+_0x30356b(0x1ff)+_0x94c4a9['join'][_0x30356b(0x1c5)]+_0x30356b(0x1fe)+_0x5410a5+'.'+_0x94c4a9['join']['child_key']);}),(_0x3197de(0x1fb)+_0x488d88[_0x3197de(0x1c4)](',\x20')+_0x3197de(0x1fa)+_0x30dee3[_0x3197de(0x1e7)]+'.'+_0x30dee3['table']+'\x20m\x0a'+_0x5df5fc[_0x3197de(0x1c4)]('\x0a')+_0x3197de(0x201)+_0x177430+'\x0a')[_0x3197de(0x1cc)]();}export function generateAttributeSchemaSQL(_0x1bd8e5,_0x3647d0){const _0x14533b=a148_0x6bbc42,_0x295e74=_0x1bd8e5[_0x14533b(0x1d1)],_0x6eb6e6=_0x3647d0['join'][_0x14533b(0x1c5)],_0x407e37=_0x3647d0[_0x14533b(0x1dd)][_0x14533b(0x1db)](_0x1f3e26=>'a.'+_0x1f3e26[_0x14533b(0x1cd)])[_0x14533b(0x1c4)](',\x20');return('\x0aSELECT\x20m.'+_0x6eb6e6+',\x20'+_0x407e37+_0x14533b(0x1fa)+_0x295e74[_0x14533b(0x1e7)]+'.'+_0x295e74[_0x14533b(0x200)]+'\x20m\x0aJOIN\x20'+_0x3647d0[_0x14533b(0x1fc)][_0x14533b(0x1e7)]+'.'+_0x3647d0[_0x14533b(0x1fc)]['table']+_0x14533b(0x1f9)+_0x3647d0[_0x14533b(0x1c4)][_0x14533b(0x1c5)]+_0x14533b(0x1e1)+_0x3647d0['join'][_0x14533b(0x1df)]+_0x14533b(0x1d2))[_0x14533b(0x1cc)]();}export function generateBehaviorSchemaSQL(_0x400d4a,_0x40c900){const _0x27de67=a148_0x6bbc42,_0xc1abd4=_0x400d4a['master'],_0x253f56=_0x40c900[_0x27de67(0x1c4)][_0x27de67(0x1c5)];let _0x141791;if(_0x40c900[_0x27de67(0x1f1)])_0x141791='b.*';else _0x40c900[_0x27de67(0x1dd)]&&_0x40c900['columns']['length']>0x0?_0x141791=_0x40c900[_0x27de67(0x1dd)]['map'](_0x5589a6=>'b.'+_0x5589a6[_0x27de67(0x1cd)])['join'](',\x20'):_0x141791=_0x27de67(0x1ef);return('\x0aSELECT\x20m.'+_0x253f56+',\x20'+_0x141791+_0x27de67(0x1fa)+_0xc1abd4['database']+'.'+_0xc1abd4[_0x27de67(0x200)]+_0x27de67(0x1dc)+_0x40c900[_0x27de67(0x1fc)][_0x27de67(0x1e7)]+'.'+_0x40c900[_0x27de67(0x1fc)][_0x27de67(0x200)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x40c900[_0x27de67(0x1c4)][_0x27de67(0x1c5)]+'\x20=\x20b.'+_0x40c900['join']['child_key']+_0x27de67(0x1d2))['trim']();}export function getAttributeColumns(_0x443a89){const _0xd25d4e=a148_0x6bbc42;return _0x443a89[_0xd25d4e(0x1dd)][_0xd25d4e(0x1db)](_0x425618=>({'label':_0x425618['label']||_0x425618[_0xd25d4e(0x1cd)],'column':_0x425618['column']}));}export function getBehaviorColumns(_0x151a8c){const _0x5de7bd=a148_0x6bbc42;if(_0x151a8c[_0x5de7bd(0x1f1)])return[{'label':_0x5de7bd(0x1f3),'column':'*'}];if(_0x151a8c[_0x5de7bd(0x1dd)]&&_0x151a8c['columns']['length']>0x0)return _0x151a8c[_0x5de7bd(0x1dd)][_0x5de7bd(0x1db)](_0x476ad8=>({'label':_0x476ad8[_0x5de7bd(0x1d0)]||_0x476ad8['column'],'column':_0x476ad8[_0x5de7bd(0x1cd)]}));return[{'label':_0x5de7bd(0x1f3),'column':'*'}];}export function findAttributeByName(_0x4e2a5b,_0x37c8ae){const _0x23c6de=a148_0x6bbc42;return _0x4e2a5b[_0x23c6de(0x1c9)]?.[_0x23c6de(0x1eb)](_0x51ea1b=>_0x51ea1b[_0x23c6de(0x1ea)][_0x23c6de(0x1d7)]()===_0x37c8ae[_0x23c6de(0x1d7)]());}export function findBehaviorByName(_0x2809d8,_0x29904d){const _0x12cf28=a148_0x6bbc42;return _0x2809d8['behaviors']?.['find'](_0x23dba1=>_0x23dba1[_0x12cf28(0x1ea)][_0x12cf28(0x1d7)]()===_0x29904d[_0x12cf28(0x1d7)]());}
|