@treasuredata/tdx 2026.4.16 → 2026.4.17
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(_0x5baf8d,_0x4e7c86){const _0x2591f7=a146_0x4f36,_0xf70980=_0x5baf8d();while(!![]){try{const _0x439b8a=-parseInt(_0x2591f7(0x15f))/0x1*(parseInt(_0x2591f7(0x140))/0x2)+-parseInt(_0x2591f7(0x196))/0x3*(-parseInt(_0x2591f7(0x17d))/0x4)+parseInt(_0x2591f7(0x193))/0x5*(parseInt(_0x2591f7(0x127))/0x6)+parseInt(_0x2591f7(0x178))/0x7+parseInt(_0x2591f7(0x17a))/0x8*(parseInt(_0x2591f7(0x16c))/0x9)+parseInt(_0x2591f7(0x118))/0xa+parseInt(_0x2591f7(0x115))/0xb*(-parseInt(_0x2591f7(0x13d))/0xc);if(_0x439b8a===_0x4e7c86)break;else _0xf70980['push'](_0xf70980['shift']());}catch(_0x36ea2d){_0xf70980['push'](_0xf70980['shift']());}}}(a146_0x2362,0xad3ce));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x1d4774,_0x1038b6,_0x38fdb9,_0x49d77c,_0x6f8e4d,_0x386a04){const _0x1aa346=a146_0x4f36;return{'level':_0x1d4774,'path':_0x1038b6,'code':_0x38fdb9,'message':_0x49d77c,'location':getLocationFromPath(_0x6f8e4d['document'],_0x6f8e4d[_0x1aa346(0x17b)],pathToArray(_0x386a04??_0x1038b6))};}function validateVersionStructure(_0x435f0c,_0x5c790a){const _0x39ddaf=a146_0x4f36,_0x23f6e4=[];return _0x435f0c[_0x39ddaf(0x105)]>MAX_STAGES&&_0x23f6e4['push'](createIssue(_0x39ddaf(0x10d),_0x39ddaf(0x1b9),_0x39ddaf(0x134),_0x39ddaf(0x18f)+_0x435f0c['length']+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x5c790a)),_0x23f6e4;}function validateStageStructure(_0x247547,_0x135d8f,_0x48f0c5,_0xaad58e){const _0x22d84c=a146_0x4f36,_0x17c62f=[],_0x3c5f91=_0x22d84c(0x19b)+_0x135d8f+']';_0x135d8f===0x0&&!_0x247547[_0x22d84c(0x1a0)]&&_0x17c62f['push'](createIssue('error',_0x3c5f91+_0x22d84c(0x18c),_0x22d84c(0x14d),_0x22d84c(0x131)+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x174),_0xaad58e,_0x3c5f91));const _0x1de5f2=_0x135d8f===_0x48f0c5-0x1;!_0x1de5f2&&!_0x247547[_0x22d84c(0x1bd)]&&_0x17c62f[_0x22d84c(0x163)](createIssue('error',_0x3c5f91+_0x22d84c(0x1c0),_0x22d84c(0x117),'Stage\x20\x27'+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x1ab),_0xaad58e,_0x3c5f91));(!_0x247547[_0x22d84c(0x14c)]||_0x247547[_0x22d84c(0x14c)][_0x22d84c(0x105)]===0x0)&&_0x17c62f[_0x22d84c(0x163)](createIssue('warning',_0x3c5f91+'.exit_criteria',_0x22d84c(0x11e),_0x22d84c(0x131)+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x12d),_0xaad58e,_0x3c5f91));const _0x1be19b=_0x247547[_0x22d84c(0x156)]?.[_0x22d84c(0x105)]??0x0;if(_0x1be19b===0x0)_0x17c62f[_0x22d84c(0x163)](createIssue(_0x22d84c(0x10d),_0x3c5f91+_0x22d84c(0x197),'INSUFFICIENT_STEPS','Stage\x20\x27'+_0x247547['name']+_0x22d84c(0x152),_0xaad58e,_0x3c5f91+_0x22d84c(0x197)));else{if(_0x1be19b===0x1)_0x17c62f[_0x22d84c(0x163)](createIssue(_0x22d84c(0x199),_0x3c5f91+_0x22d84c(0x197),_0x22d84c(0x124),_0x22d84c(0x131)+_0x247547['name']+_0x22d84c(0x18a),_0xaad58e,_0x3c5f91+_0x22d84c(0x197)));else _0x1be19b<=0x3&&_0x17c62f[_0x22d84c(0x163)](createIssue(_0x22d84c(0x199),_0x3c5f91+_0x22d84c(0x197),'FEW_STEPS',_0x22d84c(0x131)+_0x247547[_0x22d84c(0x132)]+_0x22d84c(0x1a6)+_0x1be19b+_0x22d84c(0x147),_0xaad58e,_0x3c5f91+'.steps'));}return _0x17c62f;}function validateStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226){const _0xb64c3f=a146_0x4f36,_0x5a72b9=[];if(_0x356bb4[_0xb64c3f(0x142)]===_0xb64c3f(0x1b6))return _0x356bb4[_0xb64c3f(0x102)]&&_0x5a72b9['push'](createIssue('error',_0x49b54d+'.next','END_STEP_HAS_NEXT_OR_WITH',_0xb64c3f(0x10f)+_0x356bb4[_0xb64c3f(0x132)]+_0xb64c3f(0x15d),_0x1e7faa)),_0xb64c3f(0x122)in _0x356bb4&&_0x356bb4[_0xb64c3f(0x122)]!==undefined&&_0x5a72b9[_0xb64c3f(0x163)](createIssue(_0xb64c3f(0x10d),_0x49b54d+_0xb64c3f(0x185),_0xb64c3f(0x135),_0xb64c3f(0x10f)+_0x356bb4[_0xb64c3f(0x132)]+_0xb64c3f(0x138),_0x1e7faa)),_0x5a72b9;_0x356bb4[_0xb64c3f(0x102)]&&(_0x1e7faa[_0xb64c3f(0x175)]&&!_0x1e7faa[_0xb64c3f(0x175)][_0xb64c3f(0x16d)](_0x356bb4[_0xb64c3f(0x102)])&&_0x5a72b9[_0xb64c3f(0x163)](createIssue(_0xb64c3f(0x10d),_0x49b54d+_0xb64c3f(0x10e),_0xb64c3f(0x18e),_0xb64c3f(0x108)+_0x356bb4[_0xb64c3f(0x102)]+'\x27',_0x1e7faa)));switch(_0x356bb4[_0xb64c3f(0x142)]){case _0xb64c3f(0x182):_0x5a72b9['push'](...validateWaitStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226));break;case _0xb64c3f(0x137):_0x5a72b9[_0xb64c3f(0x163)](...validateActivationStep(_0x356bb4,_0x49b54d,_0x1e7faa));break;case _0xb64c3f(0x16a):_0x5a72b9['push'](...validateDecisionPointStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226));break;case _0xb64c3f(0x136):_0x5a72b9[_0xb64c3f(0x163)](...validateAbTestStep(_0x356bb4,_0x49b54d,_0x1e7faa,_0x322226));break;case'jump':_0x5a72b9['push'](...validateJumpStep(_0x356bb4,_0x49b54d,_0x1e7faa));break;}return _0x5a72b9;}function validateWaitStep(_0x220f7a,_0x2eb4b1,_0x117c41,_0x1b169f){const _0x555cab=a146_0x4f36,_0x502126=[];if(!_0x220f7a[_0x555cab(0x122)])return _0x502126[_0x555cab(0x163)](createIssue('error',_0x2eb4b1+'.with','MISSING_WAIT_PARAMS',_0x555cab(0x107),_0x117c41,_0x2eb4b1)),_0x502126;if(_0x220f7a[_0x555cab(0x122)][_0x555cab(0x11a)]){const _0x2c9a59=_0x220f7a[_0x555cab(0x122)][_0x555cab(0x11a)];if(_0x2c9a59[_0x555cab(0x166)]){_0x117c41['referencedSegments']?.['add'](_0x2c9a59[_0x555cab(0x166)]);!_0x2c9a59[_0x555cab(0x166)][_0x555cab(0x172)](_0x555cab(0x168))&&(_0x117c41[_0x555cab(0x177)]&&!_0x117c41[_0x555cab(0x177)][_0x555cab(0x16d)](_0x2c9a59['segment'])&&_0x502126[_0x555cab(0x163)](createIssue('error',_0x2eb4b1+_0x555cab(0x145),_0x555cab(0x125),_0x555cab(0x17c)+_0x2c9a59[_0x555cab(0x166)]+_0x555cab(0x1bf),_0x117c41)));_0x2c9a59[_0x555cab(0x102)]&&_0x117c41[_0x555cab(0x175)]&&!_0x117c41['stepNames'][_0x555cab(0x16d)](_0x2c9a59[_0x555cab(0x102)])&&_0x502126[_0x555cab(0x163)](createIssue(_0x555cab(0x10d),_0x2eb4b1+_0x555cab(0x114),_0x555cab(0x18e),_0x555cab(0x116)+_0x2c9a59[_0x555cab(0x102)]+'\x27',_0x117c41));_0x2c9a59['timeout']?.[_0x555cab(0x102)]&&_0x117c41[_0x555cab(0x175)]&&!_0x117c41[_0x555cab(0x175)][_0x555cab(0x16d)](_0x2c9a59[_0x555cab(0x160)][_0x555cab(0x102)])&&_0x502126['push'](createIssue('error',_0x2eb4b1+_0x555cab(0x10b),_0x555cab(0x18e),_0x555cab(0x198)+_0x2c9a59[_0x555cab(0x160)]['next']+'\x27',_0x117c41));const _0x28a901=_0x2c9a59['next']||_0x220f7a[_0x555cab(0x102)],_0x323907=_0x2c9a59[_0x555cab(0x160)]?.[_0x555cab(0x102)]||_0x220f7a[_0x555cab(0x102)];if(_0x28a901){const _0x448801=_0x1b169f[_0x555cab(0x151)](_0x28a901);_0x448801?.['type']===_0x555cab(0x155)&&_0x502126[_0x555cab(0x163)](createIssue(_0x555cab(0x199),_0x2eb4b1+_0x555cab(0x114),_0x555cab(0x1ad),_0x555cab(0x19d)+_0x28a901+_0x555cab(0x17e),_0x117c41,_0x2eb4b1+_0x555cab(0x171)));}if(_0x323907){const _0x146161=_0x1b169f['get'](_0x323907);_0x146161?.[_0x555cab(0x142)]===_0x555cab(0x155)&&_0x502126[_0x555cab(0x163)](createIssue('warning',_0x2eb4b1+'.with.condition.timeout.next','BRANCH_DIRECTLY_TO_MERGE',_0x555cab(0x133)+_0x323907+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x117c41,_0x2eb4b1+_0x555cab(0x164)));}}}return _0x502126;}function validateActivationStep(_0x4cd54d,_0x1a682f,_0x526f71){const _0x49b572=a146_0x4f36,_0x302aa8=[];if(!_0x4cd54d[_0x49b572(0x122)]?.['activation'])return _0x302aa8[_0x49b572(0x163)](createIssue('error',_0x1a682f+_0x49b572(0x15c),'MISSING_ACTIVATION_REF',_0x49b572(0x10c),_0x526f71,_0x1a682f)),_0x302aa8;const _0x46f30=_0x4cd54d[_0x49b572(0x122)][_0x49b572(0x137)];return _0x526f71['activationKeys']&&!_0x46f30[_0x49b572(0x172)]('ref:')&&(!_0x526f71[_0x49b572(0x192)][_0x49b572(0x16d)](_0x46f30)&&_0x302aa8['push'](createIssue(_0x49b572(0x10d),_0x1a682f+_0x49b572(0x15c),_0x49b572(0x191),'Activation\x20step\x20references\x20undefined\x20activation\x20\x27'+_0x46f30+_0x49b572(0x100),_0x526f71))),_0x302aa8;}function validateDecisionPointStep(_0x120462,_0x3e48b2,_0x35481d,_0x480f66){const _0x47e21a=a146_0x4f36,_0x4c39da=[];if(!_0x120462[_0x47e21a(0x122)]?.[_0x47e21a(0x11c)]||_0x120462['with'][_0x47e21a(0x11c)][_0x47e21a(0x105)]===0x0)return _0x4c39da[_0x47e21a(0x163)](createIssue(_0x47e21a(0x10d),_0x3e48b2+_0x47e21a(0x159),_0x47e21a(0x14f),_0x47e21a(0x180),_0x35481d,_0x3e48b2)),_0x4c39da;for(let _0x4aadc7=0x0;_0x4aadc7<_0x120462['with']['branches'][_0x47e21a(0x105)];_0x4aadc7++){const _0x10092a=_0x120462[_0x47e21a(0x122)][_0x47e21a(0x11c)][_0x4aadc7],_0x5a2788=_0x3e48b2+_0x47e21a(0x184)+_0x4aadc7+']';_0x10092a[_0x47e21a(0x166)]&&!_0x10092a[_0x47e21a(0x13a)]&&(_0x35481d[_0x47e21a(0x12e)]?.[_0x47e21a(0x189)](_0x10092a['segment']),!_0x10092a[_0x47e21a(0x166)]['startsWith'](_0x47e21a(0x168))&&(_0x35481d[_0x47e21a(0x177)]&&!_0x35481d[_0x47e21a(0x177)]['has'](_0x10092a[_0x47e21a(0x166)])&&_0x4c39da['push'](createIssue(_0x47e21a(0x10d),_0x5a2788+_0x47e21a(0x1b2),_0x47e21a(0x125),'Decision\x20branch\x20references\x20undefined\x20segment\x20\x27'+_0x10092a[_0x47e21a(0x166)]+'\x27',_0x35481d))));_0x10092a[_0x47e21a(0x102)]&&_0x35481d[_0x47e21a(0x175)]&&!_0x35481d[_0x47e21a(0x175)][_0x47e21a(0x16d)](_0x10092a['next'])&&_0x4c39da['push'](createIssue(_0x47e21a(0x10d),_0x5a2788+'.next','INVALID_NEXT_REFERENCE',_0x47e21a(0x18d)+_0x10092a[_0x47e21a(0x102)]+'\x27',_0x35481d));if(_0x10092a[_0x47e21a(0x102)]){const _0x64b4bd=_0x480f66['get'](_0x10092a[_0x47e21a(0x102)]);_0x64b4bd?.[_0x47e21a(0x142)]===_0x47e21a(0x155)&&_0x4c39da[_0x47e21a(0x163)](createIssue(_0x47e21a(0x199),_0x5a2788+'.next','BRANCH_DIRECTLY_TO_MERGE',_0x47e21a(0x1be)+_0x10092a[_0x47e21a(0x132)]+_0x47e21a(0x19c)+_0x10092a[_0x47e21a(0x102)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x35481d));}}return _0x4c39da;}function validateAbTestStep(_0x3fb938,_0x5c70de,_0x32a844,_0x2372c3){const _0x481c1a=a146_0x4f36,_0xf34ee7=[];if(!_0x3fb938[_0x481c1a(0x122)]?.[_0x481c1a(0x101)]||_0x3fb938['with'][_0x481c1a(0x101)][_0x481c1a(0x105)]===0x0)return _0xf34ee7[_0x481c1a(0x163)](createIssue(_0x481c1a(0x10d),_0x5c70de+_0x481c1a(0x1a7),_0x481c1a(0x14f),_0x481c1a(0x1b0),_0x32a844,_0x5c70de)),_0xf34ee7;const _0x3d8d00=_0x3fb938[_0x481c1a(0x122)]['variants'][_0x481c1a(0x19e)]((_0x2bec56,_0xd3beb0)=>_0x2bec56+(_0xd3beb0[_0x481c1a(0x141)]||0x0),0x0);Math[_0x481c1a(0x1b1)](_0x3d8d00-0x64)>0.01&&_0xf34ee7['push'](createIssue(_0x481c1a(0x10d),_0x5c70de+'.with.variants',_0x481c1a(0x157),_0x481c1a(0x1a9)+_0x3d8d00+'%)',_0x32a844));for(let _0x3d84b9=0x0;_0x3d84b9<_0x3fb938['with'][_0x481c1a(0x101)][_0x481c1a(0x105)];_0x3d84b9++){const _0x2d367f=_0x3fb938[_0x481c1a(0x122)][_0x481c1a(0x101)][_0x3d84b9],_0x46f282=_0x5c70de+_0x481c1a(0x173)+_0x3d84b9+']';_0x2d367f['next']&&_0x32a844['stepNames']&&!_0x32a844[_0x481c1a(0x175)]['has'](_0x2d367f['next'])&&_0xf34ee7[_0x481c1a(0x163)](createIssue(_0x481c1a(0x10d),_0x46f282+_0x481c1a(0x10e),_0x481c1a(0x18e),_0x481c1a(0x126)+_0x2d367f[_0x481c1a(0x102)]+'\x27',_0x32a844));if(_0x2d367f[_0x481c1a(0x102)]){const _0x5cec5c=_0x2372c3[_0x481c1a(0x151)](_0x2d367f['next']);_0x5cec5c?.[_0x481c1a(0x142)]===_0x481c1a(0x155)&&_0xf34ee7['push'](createIssue('warning',_0x46f282+_0x481c1a(0x10e),_0x481c1a(0x1ad),'A/B\x20test\x20variant\x20\x27'+_0x2d367f[_0x481c1a(0x132)]+_0x481c1a(0x19c)+_0x2d367f['next']+_0x481c1a(0x1ae),_0x32a844));}}return _0xf34ee7;}function validateJumpStep(_0xeee6f8,_0x5254bd,_0x9a3d0){const _0x54172d=a146_0x4f36,_0x7f6a13=[];if(!_0xeee6f8[_0x54172d(0x122)]?.['target'])return _0x7f6a13[_0x54172d(0x163)](createIssue(_0x54172d(0x10d),_0x5254bd+'.with.target',_0x54172d(0x158),_0x54172d(0x188),_0x9a3d0,_0x5254bd)),_0x7f6a13;return(!_0xeee6f8['with'][_0x54172d(0x183)][_0x54172d(0x18b)]||!_0xeee6f8[_0x54172d(0x122)][_0x54172d(0x183)][_0x54172d(0x162)])&&_0x7f6a13['push'](createIssue('error',_0x5254bd+_0x54172d(0x11f),_0x54172d(0x158),_0x54172d(0x128),_0x9a3d0)),_0x7f6a13;}function buildConvergenceMap(_0xe72302){const _0x2436f5=a146_0x4f36,_0x475352=new Map();function _0x5f562c(_0x1fcbcd,_0x238f1f){const _0x503ee9=a146_0x4f36,_0x5dd1d0=_0x475352['get'](_0x1fcbcd)||[];_0x5dd1d0[_0x503ee9(0x163)](_0x238f1f),_0x475352[_0x503ee9(0x150)](_0x1fcbcd,_0x5dd1d0);}for(const _0x4248f0 of _0xe72302){_0x4248f0[_0x2436f5(0x102)]&&_0x5f562c(_0x4248f0[_0x2436f5(0x102)],{'stepName':_0x4248f0[_0x2436f5(0x132)],'description':'step\x20\x27'+_0x4248f0['name']+'\x27'});if(_0x4248f0[_0x2436f5(0x142)]===_0x2436f5(0x16a)&&_0x4248f0[_0x2436f5(0x122)]?.[_0x2436f5(0x11c)])for(const _0x3af683 of _0x4248f0[_0x2436f5(0x122)]['branches']){_0x3af683[_0x2436f5(0x102)]&&_0x5f562c(_0x3af683[_0x2436f5(0x102)],{'stepName':_0x4248f0[_0x2436f5(0x132)],'description':_0x2436f5(0x12a)+_0x3af683[_0x2436f5(0x132)]+'\x27\x20of\x20\x27'+_0x4248f0[_0x2436f5(0x132)]+'\x27'});}if(_0x4248f0['type']===_0x2436f5(0x136)&&_0x4248f0[_0x2436f5(0x122)]?.[_0x2436f5(0x101)])for(const _0x5b72dd of _0x4248f0[_0x2436f5(0x122)]['variants']){_0x5b72dd[_0x2436f5(0x102)]&&_0x5f562c(_0x5b72dd[_0x2436f5(0x102)],{'stepName':_0x4248f0[_0x2436f5(0x132)],'description':'variant\x20\x27'+_0x5b72dd[_0x2436f5(0x132)]+_0x2436f5(0x13f)+_0x4248f0[_0x2436f5(0x132)]+'\x27'});}_0x4248f0['type']===_0x2436f5(0x182)&&_0x4248f0['with']?.[_0x2436f5(0x11a)]&&(_0x4248f0['with'][_0x2436f5(0x11a)]['next']&&_0x5f562c(_0x4248f0[_0x2436f5(0x122)][_0x2436f5(0x11a)][_0x2436f5(0x102)],{'stepName':_0x4248f0['name'],'description':_0x2436f5(0x165)+_0x4248f0[_0x2436f5(0x132)]+'\x27'}),_0x4248f0[_0x2436f5(0x122)][_0x2436f5(0x11a)]['timeout']?.[_0x2436f5(0x102)]&&_0x5f562c(_0x4248f0[_0x2436f5(0x122)][_0x2436f5(0x11a)][_0x2436f5(0x160)][_0x2436f5(0x102)],{'stepName':_0x4248f0['name'],'description':_0x2436f5(0x1b4)+_0x4248f0[_0x2436f5(0x132)]+'\x27'}));}return _0x475352;}function a146_0x2362(){const _0x1be466=['Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','Jump\x20step\x20requires\x20a\x20target','add','\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)','journey','.entry_criteria','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','INVALID_NEXT_REFERENCE','Journey\x20has\x20','.stages','MISSING_ACTIVATION_DEFINITION','activationKeys','1131265XjxfIz','MISSING_GOAL','journey\x20entry','6xsJAtq','.steps','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','warning','\x27\x20has\x20no\x20end\x20step','stages[','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','reduce','indices','entry_criteria','JOURNEY_SCHEMA_ERROR','journeys,\x20stages,\x20or\x20versions','rule','some','latest','\x27\x20has\x20only\x20','.with.variants','MERGE_TO_MERGE_CHAIN','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','versions','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','Journey\x20can\x20have\x20at\x20most\x20one\x20','BRANCH_DIRECTLY_TO_MERGE','\x27\x20with\x20no\x20action\x20in\x20between','filter','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','abs','.segment','level','timeout\x20of\x20\x27','map','end','every','ACTIVATION_SCHEMA_ERROR','stages','version','endsWith','replace','milestone','Decision\x20branch\x20\x27','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','.milestone','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','variants','next',').\x20Merge\x20is\x20unnecessary.','document','length','journeys[','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','Step\x20references\x20non-existent\x20step\x20\x27','segments','match','.with.condition.timeout.next','Activation\x20step\x20requires\x20an\x20activation\x20reference','error','.next','End\x20step\x20\x27','includes','DUPLICATE_LATEST','.steps[','journeys','.with.condition.next','40680618HjwxIp','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','MISSING_MILESTONE','10888040JmWITU','excluded_','condition','\x27\x20(from:\x20','branches','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','MISSING_EXIT_CRITERIA','.with.target',').\x20Use\x20a\x20merge\x20step.','issues','with','goal','INSUFFICIENT_STEPS','MISSING_SEGMENT_REFERENCE','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','12FUaSBm','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','branch\x20\x27','success','SINGLE_INPUT_MERGE','\x27\x20has\x20no\x20exit_criteria\x20defined','referencedSegments','safeParse','goalIsInherited','Stage\x20\x27','name','Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','TOO_MANY_STAGES','END_STEP_HAS_NEXT_OR_WITH','ab_test','activation','\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field','.rule','excluded','path','splice','12ucbXRl','activations','\x27\x20of\x20\x27','2pETLlf','percentage','type','message','join','.with.condition.segment','.name','\x20steps\x20(may\x20be\x20too\x20simple)','skipSchema','keys','UNUSED_EMBEDDED_SEGMENT','Merge\x20step\x20\x27','exit_criteria','MISSING_ENTRY_CRITERIA','Criteria\x20references\x20undefined\x20segment\x20\x27','MISSING_CONDITIONS','set','get','\x27\x20has\x20no\x20steps','versions[','entries','merge','steps','INVALID_AB_TEST_PERCENTAGES','INVALID_JUMP_TARGET','.with.branches','sort','Journey\x20has\x20no\x20goal\x20defined','.with.activation','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','.exit_criteria[','12959wHTiGg','timeout','size','stage','push','.with.condition.timeout','condition\x20of\x20\x27','segment','MISSING_END_STEP','ref:','MISSING_STAGES','decision_point','\x20with\x20latest:\x20true','4093308UzFSRO','has','data','MISSING_NAME','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','.with.condition','startsWith','.with.variants[','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','stepNames','\x20(across\x20','embeddedSegments','7521969hcDeBd','state','16FsuPqZ','source','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','1790556AggNEO','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','\x27\x20(first\x20defined\x20at\x20steps[','wait','target','.with.branches[','.with','DUPLICATE_STEP_NAME'];a146_0x2362=function(){return _0x1be466;};return a146_0x2362();}function validateFlowControl(_0x236f3e,_0x52e0ab,_0xec7d3c){const _0x55eb99=a146_0x4f36,_0x1d2550=[],_0x5358ce=_0x55eb99(0x19b)+_0x52e0ab+']',_0x30a7c2=_0x236f3e['steps']||[];if(_0x30a7c2[_0x55eb99(0x105)]===0x0)return _0x1d2550;const _0x204987=new Map();for(const _0x34c2d0 of _0x30a7c2){_0x34c2d0[_0x55eb99(0x132)]&&_0x204987[_0x55eb99(0x150)](_0x34c2d0[_0x55eb99(0x132)],_0x34c2d0);}const _0x526a8c=buildConvergenceMap(_0x30a7c2),_0x3efc58=_0x30a7c2[_0x55eb99(0x1a4)](_0x4c7617=>_0x4c7617[_0x55eb99(0x142)]==='end');!_0x3efc58&&_0x1d2550[_0x55eb99(0x163)](createIssue('error',_0x5358ce+_0x55eb99(0x197),_0x55eb99(0x167),_0x55eb99(0x131)+_0x236f3e[_0x55eb99(0x132)]+_0x55eb99(0x19a),_0xec7d3c));for(const [_0x4bf2f5,_0x3ecfd4]of _0x526a8c){const _0x5bf947=_0x204987[_0x55eb99(0x151)](_0x4bf2f5);if(!_0x5bf947)continue;if(_0x3ecfd4[_0x55eb99(0x105)]>0x1&&_0x5bf947[_0x55eb99(0x142)]!==_0x55eb99(0x155)){const _0x17afd0=_0x3ecfd4['map'](_0x5bff0c=>_0x5bff0c['description'])[_0x55eb99(0x144)](',\x20');_0x1d2550[_0x55eb99(0x163)](createIssue(_0x55eb99(0x10d),_0x5358ce+_0x55eb99(0x197),'CONVERGENCE_WITHOUT_MERGE',_0x55eb99(0x187)+_0x4bf2f5+_0x55eb99(0x11b)+_0x17afd0+_0x55eb99(0x120),_0xec7d3c));}_0x3ecfd4['length']===0x1&&_0x5bf947[_0x55eb99(0x142)]===_0x55eb99(0x155)&&_0x1d2550[_0x55eb99(0x163)](createIssue(_0x55eb99(0x199),_0x5358ce+_0x55eb99(0x197),_0x55eb99(0x12c),_0x55eb99(0x14b)+_0x4bf2f5+_0x55eb99(0x170)+_0x3ecfd4[0x0]['description']+_0x55eb99(0x103),_0xec7d3c));}for(const _0x3fff8c of _0x30a7c2){if(_0x3fff8c[_0x55eb99(0x142)]===_0x55eb99(0x155)&&_0x3fff8c[_0x55eb99(0x102)]){const _0x51327e=_0x204987['get'](_0x3fff8c[_0x55eb99(0x102)]);_0x51327e?.[_0x55eb99(0x142)]===_0x55eb99(0x155)&&_0x1d2550[_0x55eb99(0x163)](createIssue(_0x55eb99(0x10d),_0x5358ce+'.steps',_0x55eb99(0x1a8),_0x55eb99(0x14b)+_0x3fff8c[_0x55eb99(0x132)]+_0x55eb99(0x17f)+_0x3fff8c[_0x55eb99(0x102)]+_0x55eb99(0x11d),_0xec7d3c));}}return _0x1d2550;}function validateCriteria(_0x1960f7,_0x5a8334,_0x115d1a){const _0x1aaf1e=a146_0x4f36,_0x4ae3fd=[];return _0x1960f7[_0x1aaf1e(0x166)]&&(_0x115d1a['referencedSegments']?.[_0x1aaf1e(0x189)](_0x1960f7['segment']),!_0x1960f7[_0x1aaf1e(0x166)][_0x1aaf1e(0x172)]('ref:')&&(_0x115d1a['embeddedSegments']&&!_0x115d1a['embeddedSegments'][_0x1aaf1e(0x16d)](_0x1960f7['segment'])&&_0x4ae3fd[_0x1aaf1e(0x163)](createIssue(_0x1aaf1e(0x10d),_0x5a8334+_0x1aaf1e(0x1b2),_0x1aaf1e(0x125),_0x1aaf1e(0x14e)+_0x1960f7[_0x1aaf1e(0x166)]+'\x27',_0x115d1a)))),_0x4ae3fd;}function validateEmbeddedSegment(_0x591045,_0x263014,_0x4199c0){const _0x4424ea=a146_0x4f36,_0x35c212=[];return _0x591045['rule']&&_0x35c212['push'](...validateRuleDef(_0x591045[_0x4424ea(0x1a3)],_0x263014+_0x4424ea(0x139),_0x4199c0)),_0x35c212;}function validateStage(_0x52d2c6,_0x200851,_0x5b4f8f,_0x50be2a){const _0x4f1829=a146_0x4f36,_0xb80d34=[],_0x284bc9=_0x4f1829(0x19b)+_0x200851+']',_0x4688e7=new Map(),_0x1e7f9d=new Map();if(_0x52d2c6[_0x4f1829(0x156)]){for(let _0x5636b0=0x0;_0x5636b0<_0x52d2c6[_0x4f1829(0x156)][_0x4f1829(0x105)];_0x5636b0++){const _0x3d57f3=_0x52d2c6['steps'][_0x5636b0];_0x3d57f3['name']&&_0x4688e7[_0x4f1829(0x150)](_0x3d57f3['name'],_0x3d57f3);}for(let _0x52e20d=0x0;_0x52e20d<_0x52d2c6[_0x4f1829(0x156)][_0x4f1829(0x105)];_0x52e20d++){const _0x16e694=_0x52d2c6['steps'][_0x52e20d],_0x18be3c=_0x284bc9+_0x4f1829(0x112)+_0x52e20d+']';if(_0x16e694[_0x4f1829(0x132)]){if(_0x1e7f9d['has'](_0x16e694['name'])){const _0x133586=_0x1e7f9d['get'](_0x16e694[_0x4f1829(0x132)]);_0xb80d34[_0x4f1829(0x163)](createIssue('error',_0x18be3c+_0x4f1829(0x146),_0x4f1829(0x186),'Duplicate\x20step\x20name\x20\x27'+_0x16e694['name']+_0x4f1829(0x181)+_0x133586+'])',_0x50be2a));}else _0x1e7f9d[_0x4f1829(0x150)](_0x16e694['name'],_0x52e20d);}_0xb80d34['push'](...validateStep(_0x16e694,_0x18be3c,_0x50be2a,_0x4688e7));}}_0x52d2c6['entry_criteria']&&_0xb80d34['push'](...validateCriteria(_0x52d2c6[_0x4f1829(0x1a0)],_0x284bc9+_0x4f1829(0x18c),_0x50be2a));if(_0x52d2c6['exit_criteria'])for(let _0x14cbf8=0x0;_0x14cbf8<_0x52d2c6['exit_criteria'][_0x4f1829(0x105)];_0x14cbf8++){_0xb80d34['push'](...validateCriteria(_0x52d2c6[_0x4f1829(0x14c)][_0x14cbf8],_0x284bc9+_0x4f1829(0x15e)+_0x14cbf8+']',_0x50be2a));}return _0x52d2c6[_0x4f1829(0x1bd)]&&_0xb80d34['push'](...validateCriteria(_0x52d2c6['milestone'],_0x284bc9+_0x4f1829(0x1c0),_0x50be2a)),_0xb80d34['push'](...validateStageStructure(_0x52d2c6,_0x200851,_0x5b4f8f,_0x50be2a)),_0xb80d34[_0x4f1829(0x163)](...validateFlowControl(_0x52d2c6,_0x200851,_0x50be2a)),_0xb80d34;}function validateStagesForVersion(_0x13eedb,_0x4488c0,_0x54b4fe,_0x582df3,_0x85349e,_0x25dda9,_0x4c9759){const _0x319cf9=a146_0x4f36;if(_0x13eedb[_0x319cf9(0x105)]===0x0){_0x85349e[_0x319cf9(0x163)]({'level':_0x319cf9(0x10d),'path':_0x582df3+_0x319cf9(0x1b9),'code':_0x319cf9(0x169),'message':_0x319cf9(0x129),'location':getLocationFromPath(_0x54b4fe[_0x319cf9(0x104)],_0x54b4fe[_0x319cf9(0x17b)],[_0x319cf9(0x1b9)])});return;}const _0x2e0708=new Set();for(const _0x3f293f of _0x13eedb){if(_0x3f293f['steps'])for(const _0x186271 of _0x3f293f[_0x319cf9(0x156)]){_0x186271[_0x319cf9(0x132)]&&_0x2e0708[_0x319cf9(0x189)](_0x186271['name']);}}const _0x45c2c2={..._0x54b4fe,'stepNames':_0x2e0708},_0x184a7a=validateVersionStructure(_0x13eedb,_0x45c2c2);for(const _0x15be7b of _0x184a7a){const _0x2cce47=_0x582df3?{..._0x15be7b,'path':''+_0x582df3+_0x15be7b[_0x319cf9(0x13b)]}:_0x15be7b;if(_0x2cce47['level']===_0x319cf9(0x10d))_0x85349e[_0x319cf9(0x163)](_0x2cce47);else _0x25dda9['push'](_0x2cce47);}for(let _0x28c31a=0x0;_0x28c31a<_0x13eedb[_0x319cf9(0x105)];_0x28c31a++){const _0x351329=validateStage(_0x13eedb[_0x28c31a],_0x28c31a,_0x13eedb[_0x319cf9(0x105)],_0x45c2c2);for(const _0x525bd2 of _0x351329){const _0x1e867c=_0x582df3?{..._0x525bd2,'path':''+_0x582df3+_0x525bd2[_0x319cf9(0x13b)]}:_0x525bd2;if(_0x1e867c[_0x319cf9(0x1b3)]===_0x319cf9(0x10d))_0x85349e['push'](_0x1e867c);else _0x25dda9['push'](_0x1e867c);}}if(_0x4488c0['goal']){const _0x4cb534=_0x4c9759?.[_0x319cf9(0x130)]?'goal':_0x582df3+'goal',_0x1fa99b=validateCriteria(_0x4488c0[_0x319cf9(0x123)],_0x4cb534,_0x45c2c2);for(const _0x2f3ffa of _0x1fa99b){if(_0x2f3ffa[_0x319cf9(0x1b3)]===_0x319cf9(0x10d))_0x85349e['push'](_0x2f3ffa);else _0x25dda9[_0x319cf9(0x163)](_0x2f3ffa);}}}function extractVersionIndex(_0x41fbad){const _0x4d45e3=a146_0x4f36,_0x1e6cd3=_0x41fbad[_0x4d45e3(0x10a)](/^journeys\[(\d+)\]\./);return _0x1e6cd3?_0x1e6cd3[0x1]:undefined;}function deduplicateAcrossVersions(_0xc6fc67){const _0x5186b4=a146_0x4f36,_0x2ac1a7=new Map();for(let _0x27abfb=0x0;_0x27abfb<_0xc6fc67[_0x5186b4(0x105)];_0x27abfb++){const _0x2fa2cb=_0xc6fc67[_0x27abfb]['code']+':'+_0xc6fc67[_0x27abfb][_0x5186b4(0x143)],_0x8dd928=extractVersionIndex(_0xc6fc67[_0x27abfb][_0x5186b4(0x13b)]),_0x1faaa1=_0x2ac1a7[_0x5186b4(0x151)](_0x2fa2cb);if(_0x1faaa1){_0x1faaa1[_0x5186b4(0x19f)]['push'](_0x27abfb);if(_0x8dd928)_0x1faaa1[_0x5186b4(0x1aa)][_0x5186b4(0x189)](_0x8dd928);}else _0x2ac1a7[_0x5186b4(0x150)](_0x2fa2cb,{'indices':[_0x27abfb],'versions':new Set(_0x8dd928?[_0x8dd928]:[])});}const _0x645df5=new Set();for(const {indices:_0x455eb4,versions:_0x2b101e}of _0x2ac1a7['values']()){if(_0x2b101e[_0x5186b4(0x161)]<=0x1)continue;const _0x3102de=_0xc6fc67[_0x455eb4[0x0]];_0x3102de[_0x5186b4(0x13b)]=_0x3102de[_0x5186b4(0x13b)][_0x5186b4(0x1bc)](/^journeys\[\d+\]\./,''),_0x3102de[_0x5186b4(0x143)]=_0x3102de[_0x5186b4(0x143)]+_0x5186b4(0x176)+_0x2b101e[_0x5186b4(0x161)]+'\x20versions)';for(let _0x4b7329=0x1;_0x4b7329<_0x455eb4[_0x5186b4(0x105)];_0x4b7329++){_0x645df5['add'](_0x455eb4[_0x4b7329]);}}const _0x87e8fc=[..._0x645df5][_0x5186b4(0x15a)]((_0x22ce56,_0x392e59)=>_0x392e59-_0x22ce56);for(const _0x3cb2d5 of _0x87e8fc){_0xc6fc67[_0x5186b4(0x13c)](_0x3cb2d5,0x1);}}export function validateJourneyDef(_0x245ac7,_0xf34bb2={},_0x17e2a0={}){const _0x59e967=a146_0x4f36;if(_0x17e2a0[_0x59e967(0x148)])return runJourneySemanticChecks(_0x245ac7,_0xf34bb2);const _0x3220e8=JourneyDefSchema[_0x59e967(0x12f)](_0x245ac7);if(_0x3220e8[_0x59e967(0x12b)])return runJourneySemanticChecks(_0x3220e8[_0x59e967(0x16e)],_0xf34bb2);return zodErrorsToJourneyValidationResult(_0x3220e8[_0x59e967(0x10d)],_0xf34bb2);}function zodErrorsToJourneyValidationResult(_0x4cfbcd,_0x58981c){const _0x25d55f=a146_0x4f36,_0x3cbc7f=flattenZodIssues(_0x4cfbcd[_0x25d55f(0x121)]),_0x4d723d=_0x3cbc7f[_0x25d55f(0x1b5)](_0xb86f04=>{const _0x37c482=_0x25d55f,_0x106680=formatZodPath(_0xb86f04['path']),_0x4aca91=mapJourneyZodIssueToCode(_0xb86f04,_0x106680),_0x152153=getLocationFromPath(_0x58981c[_0x37c482(0x104)],_0x58981c[_0x37c482(0x17b)],_0xb86f04['path'][_0x37c482(0x1b5)](_0x41d75c=>typeof _0x41d75c==='symbol'?String(_0x41d75c):_0x41d75c));return{'level':_0x37c482(0x10d),'path':_0x106680,'code':_0x4aca91,'message':_0xb86f04[_0x37c482(0x143)],..._0x152153&&{'location':_0x152153}};});return{'valid':![],'errors':_0x4d723d,'warnings':[]};}function a146_0x4f36(_0x16d0a3,_0x4ff2ec){_0x16d0a3=_0x16d0a3-0x100;const _0x2362cd=a146_0x2362();let _0x4f362b=_0x2362cd[_0x16d0a3];return _0x4f362b;}function mapJourneyZodIssueToCode(_0xc53454,_0x20c8da){const _0x38ca20=a146_0x4f36;if(_0x20c8da===_0x38ca20(0x132))return'MISSING_NAME';if(_0x20c8da[_0x38ca20(0x1bb)]('.type')&&_0x20c8da[_0x38ca20(0x110)]('steps'))return _0x38ca20(0x1a1);if(_0x20c8da===_0x38ca20(0x1b9)||_0x20c8da[_0x38ca20(0x1bb)](_0x38ca20(0x190)))return _0x38ca20(0x169);if(_0x20c8da===''&&_0xc53454['message'][_0x38ca20(0x110)](_0x38ca20(0x1a2)))return _0x38ca20(0x169);if(_0x20c8da[_0x38ca20(0x110)](_0x38ca20(0x137)))return _0x38ca20(0x1b8);return _0x38ca20(0x1a1);}function runJourneySemanticChecks(_0x101508,_0x595d94){const _0x4ffd77=a146_0x4f36,_0x1927f1=[],_0x235801=[];(!_0x101508[_0x4ffd77(0x132)]||_0x101508[_0x4ffd77(0x132)]['trim']()==='')&&_0x1927f1[_0x4ffd77(0x163)]({'level':_0x4ffd77(0x10d),'path':_0x4ffd77(0x132),'code':_0x4ffd77(0x16f),'message':'Journey\x20name\x20is\x20required','location':getLocationFromPath(_0x595d94[_0x4ffd77(0x104)],_0x595d94[_0x4ffd77(0x17b)],[_0x4ffd77(0x132)])});const _0x2bf202=new Set();if(_0x101508[_0x4ffd77(0x109)])for(const _0x37fe14 of Object[_0x4ffd77(0x149)](_0x101508[_0x4ffd77(0x109)])){_0x2bf202[_0x4ffd77(0x189)](_0x37fe14);}const _0x43bd5e=new Set();if(_0x101508['activations'])for(const _0x5850ad of Object[_0x4ffd77(0x149)](_0x101508[_0x4ffd77(0x13e)])){_0x43bd5e[_0x4ffd77(0x189)](_0x5850ad);}const _0x32a3aa=new Set(),_0x5a3128={..._0x595d94,'embeddedSegments':_0x2bf202,'referencedSegments':_0x32a3aa,'activationKeys':_0x43bd5e[_0x4ffd77(0x161)]>0x0?_0x43bd5e:undefined};if(_0x101508[_0x4ffd77(0x109)])for(const [_0x268056,_0x5c5646]of Object[_0x4ffd77(0x154)](_0x101508[_0x4ffd77(0x109)])){const _0x3862b4=validateEmbeddedSegment(_0x5c5646,'segments.'+_0x268056,_0x5a3128);for(const _0x35b079 of _0x3862b4){if(_0x35b079[_0x4ffd77(0x1b3)]==='error')_0x1927f1[_0x4ffd77(0x163)](_0x35b079);else _0x235801[_0x4ffd77(0x163)](_0x35b079);}}const _0x51cc75=!!_0x101508['goal'],_0x1d5755=_0x101508['journeys']?.[_0x4ffd77(0x1b7)](_0xe7220e=>!!_0xe7220e['goal'])??![];!_0x51cc75&&!_0x1d5755&&_0x235801[_0x4ffd77(0x163)]({'level':'warning','path':_0x4ffd77(0x123),'code':_0x4ffd77(0x194),'message':_0x4ffd77(0x15b),'location':getLocationFromPath(_0x595d94['document'],_0x595d94[_0x4ffd77(0x17b)],[_0x4ffd77(0x123)])});const _0x5cd111=_0x101508['journeys']??_0x101508[_0x4ffd77(0x1aa)];if(_0x5cd111&&_0x5cd111[_0x4ffd77(0x1af)](_0x38ede6=>_0x38ede6[_0x4ffd77(0x1a5)]===!![])['length']>0x1){const _0x532a44=_0x101508[_0x4ffd77(0x113)]?_0x4ffd77(0x113):_0x4ffd77(0x1aa);_0x1927f1[_0x4ffd77(0x163)]({'level':_0x4ffd77(0x10d),'path':_0x532a44,'code':_0x4ffd77(0x111),'message':_0x4ffd77(0x1ac)+(_0x532a44==='journeys'?_0x4ffd77(0x195):_0x4ffd77(0x1ba))+_0x4ffd77(0x16b),'location':getLocationFromPath(_0x595d94[_0x4ffd77(0x104)],_0x595d94[_0x4ffd77(0x17b)],[_0x532a44])});}if(_0x101508[_0x4ffd77(0x113)]&&_0x101508[_0x4ffd77(0x113)]['length']>0x0)for(let _0x187b96=0x0;_0x187b96<_0x101508[_0x4ffd77(0x113)][_0x4ffd77(0x105)];_0x187b96++){const _0x5c9588=_0x101508[_0x4ffd77(0x113)][_0x187b96];if(_0x101508['journeys'][_0x4ffd77(0x105)]>0x1&&_0x5c9588[_0x4ffd77(0x179)]==='launched')continue;const _0xf19d47=_0x5c9588[_0x4ffd77(0x1b9)]||[],_0x1ecf88=_0x4ffd77(0x106)+_0x187b96+'].',_0x461140=!!_0x5c9588[_0x4ffd77(0x123)],_0x3cd140=_0x461140?{..._0x101508,'goal':_0x5c9588[_0x4ffd77(0x123)]}:_0x101508;validateStagesForVersion(_0xf19d47,_0x3cd140,_0x5a3128,_0x1ecf88,_0x1927f1,_0x235801,{'goalIsInherited':!_0x461140});}else{if(_0x101508[_0x4ffd77(0x1aa)]&&_0x101508['versions'][_0x4ffd77(0x105)]>0x0)for(let _0x58431b=0x0;_0x58431b<_0x101508[_0x4ffd77(0x1aa)]['length'];_0x58431b++){const _0x30764d=_0x101508['versions'][_0x58431b];if(_0x101508[_0x4ffd77(0x1aa)][_0x4ffd77(0x105)]>0x1&&_0x30764d['state']==='launched')continue;const _0x517717=_0x30764d[_0x4ffd77(0x1b9)]||[],_0x286588=_0x4ffd77(0x153)+_0x58431b+'].';validateStagesForVersion(_0x517717,_0x101508,_0x5a3128,_0x286588,_0x1927f1,_0x235801);}else{const _0x564912=_0x101508[_0x4ffd77(0x1b9)]||[];validateStagesForVersion(_0x564912,_0x101508,_0x5a3128,'',_0x1927f1,_0x235801);}}_0x101508[_0x4ffd77(0x113)]&&_0x101508[_0x4ffd77(0x113)][_0x4ffd77(0x105)]>0x1&&(deduplicateAcrossVersions(_0x1927f1),deduplicateAcrossVersions(_0x235801));for(const _0x3c05da of _0x2bf202){!_0x32a3aa[_0x4ffd77(0x16d)](_0x3c05da)&&!_0x3c05da[_0x4ffd77(0x172)](_0x4ffd77(0x119))&&_0x235801[_0x4ffd77(0x163)]({'level':'warning','path':'segments.'+_0x3c05da,'code':_0x4ffd77(0x14a),'message':'Embedded\x20segment\x20\x27'+_0x3c05da+'\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','location':getLocationFromPath(_0x595d94[_0x4ffd77(0x104)],_0x595d94['source'],[_0x4ffd77(0x109),_0x3c05da])});}return{'valid':_0x1927f1[_0x4ffd77(0x105)]===0x0,'errors':_0x1927f1,'warnings':_0x235801};}
|
|
1
|
+
(function(_0x2e8f72,_0x522ae2){const _0x20506b=a146_0x219d,_0x20cc60=_0x2e8f72();while(!![]){try{const _0x2eaf68=-parseInt(_0x20506b(0x166))/0x1*(parseInt(_0x20506b(0x17b))/0x2)+-parseInt(_0x20506b(0x153))/0x3*(-parseInt(_0x20506b(0x16c))/0x4)+parseInt(_0x20506b(0x126))/0x5+parseInt(_0x20506b(0xed))/0x6*(parseInt(_0x20506b(0xf0))/0x7)+-parseInt(_0x20506b(0x171))/0x8*(-parseInt(_0x20506b(0x161))/0x9)+parseInt(_0x20506b(0x16e))/0xa*(-parseInt(_0x20506b(0x165))/0xb)+parseInt(_0x20506b(0x170))/0xc*(-parseInt(_0x20506b(0x144))/0xd);if(_0x2eaf68===_0x522ae2)break;else _0x20cc60['push'](_0x20cc60['shift']());}catch(_0x44ec41){_0x20cc60['push'](_0x20cc60['shift']());}}}(a146_0x2681,0x62d2b));import{JourneyDefSchema}from'./types/journey-schema.js';import{formatZodPath,flattenZodIssues,getLocationFromPath,pathToArray,validateRuleDef}from'./yaml-validator.js';const MAX_STAGES=0x8;function createIssue(_0x92264b,_0x3fd3fb,_0x3ab424,_0x3728d5,_0x191f9c,_0x1fbca4){const _0x2cf347=a146_0x219d;return{'level':_0x92264b,'path':_0x3fd3fb,'code':_0x3ab424,'message':_0x3728d5,'location':getLocationFromPath(_0x191f9c[_0x2cf347(0x122)],_0x191f9c[_0x2cf347(0x129)],pathToArray(_0x1fbca4??_0x3fd3fb))};}function validateVersionStructure(_0x549b8b,_0x22003c){const _0x46e370=a146_0x219d,_0x56c71d=[];return _0x549b8b['length']>MAX_STAGES&&_0x56c71d['push'](createIssue(_0x46e370(0x18a),_0x46e370(0x13a),'TOO_MANY_STAGES',_0x46e370(0xe0)+_0x549b8b[_0x46e370(0x15c)]+'\x20stages\x20but\x20maximum\x20is\x20'+MAX_STAGES,_0x22003c)),_0x56c71d;}function validateStageStructure(_0x3dd136,_0x3acc67,_0x144c9d,_0x795f61){const _0x27ab2b=a146_0x219d,_0x2c2fb0=[],_0x2c87b3=_0x27ab2b(0x147)+_0x3acc67+']';_0x3acc67===0x0&&!_0x3dd136[_0x27ab2b(0xdb)]&&_0x2c2fb0[_0x27ab2b(0x149)](createIssue('error',_0x2c87b3+_0x27ab2b(0x183),_0x27ab2b(0x101),_0x27ab2b(0xf9)+_0x3dd136['name']+_0x27ab2b(0x109),_0x795f61,_0x2c87b3));const _0x4c47f2=_0x3acc67===_0x144c9d-0x1;!_0x4c47f2&&!_0x3dd136[_0x27ab2b(0x12f)]&&_0x2c2fb0[_0x27ab2b(0x149)](createIssue(_0x27ab2b(0x18a),_0x2c87b3+_0x27ab2b(0xec),_0x27ab2b(0x162),_0x27ab2b(0xf9)+_0x3dd136['name']+_0x27ab2b(0xef),_0x795f61,_0x2c87b3));(!_0x3dd136[_0x27ab2b(0xd4)]||_0x3dd136[_0x27ab2b(0xd4)][_0x27ab2b(0x15c)]===0x0)&&_0x2c2fb0[_0x27ab2b(0x149)](createIssue(_0x27ab2b(0x116),_0x2c87b3+'.exit_criteria',_0x27ab2b(0xf2),_0x27ab2b(0xf9)+_0x3dd136[_0x27ab2b(0x139)]+_0x27ab2b(0x11f),_0x795f61,_0x2c87b3));const _0x4683f2=_0x3dd136['steps']?.['length']??0x0;if(_0x4683f2===0x0)_0x2c2fb0[_0x27ab2b(0x149)](createIssue(_0x27ab2b(0x18a),_0x2c87b3+_0x27ab2b(0x11a),_0x27ab2b(0x146),_0x27ab2b(0xf9)+_0x3dd136[_0x27ab2b(0x139)]+_0x27ab2b(0x178),_0x795f61,_0x2c87b3+'.steps'));else{if(_0x4683f2===0x1)_0x2c2fb0[_0x27ab2b(0x149)](createIssue(_0x27ab2b(0x116),_0x2c87b3+'.steps',_0x27ab2b(0x146),_0x27ab2b(0xf9)+_0x3dd136['name']+'\x27\x20has\x20only\x201\x20step\x20(may\x20be\x20too\x20simple)',_0x795f61,_0x2c87b3+_0x27ab2b(0x11a)));else _0x4683f2<=0x3&&_0x2c2fb0[_0x27ab2b(0x149)](createIssue(_0x27ab2b(0x116),_0x2c87b3+_0x27ab2b(0x11a),_0x27ab2b(0x132),_0x27ab2b(0xf9)+_0x3dd136[_0x27ab2b(0x139)]+_0x27ab2b(0x179)+_0x4683f2+_0x27ab2b(0x16a),_0x795f61,_0x2c87b3+'.steps'));}return _0x2c2fb0;}function validateStep(_0x4c427c,_0x98bfd0,_0x442a11,_0x20cdbd){const _0x5cc01e=a146_0x219d,_0x52eb6d=[];if(_0x4c427c['type']===_0x5cc01e(0xfb))return _0x4c427c[_0x5cc01e(0xf1)]&&_0x52eb6d[_0x5cc01e(0x149)](createIssue(_0x5cc01e(0x18a),_0x98bfd0+_0x5cc01e(0x12a),_0x5cc01e(0x13b),_0x5cc01e(0x14f)+_0x4c427c[_0x5cc01e(0x139)]+_0x5cc01e(0x118),_0x442a11)),_0x5cc01e(0x106)in _0x4c427c&&_0x4c427c[_0x5cc01e(0x106)]!==undefined&&_0x52eb6d[_0x5cc01e(0x149)](createIssue(_0x5cc01e(0x18a),_0x98bfd0+_0x5cc01e(0x13f),_0x5cc01e(0x13b),_0x5cc01e(0x14f)+_0x4c427c['name']+'\x27\x20should\x20not\x20have\x20a\x20\x27with\x27\x20field',_0x442a11)),_0x52eb6d;_0x4c427c[_0x5cc01e(0xf1)]&&(_0x442a11['stepNames']&&!_0x442a11['stepNames'][_0x5cc01e(0x11d)](_0x4c427c[_0x5cc01e(0xf1)])&&_0x52eb6d['push'](createIssue(_0x5cc01e(0x18a),_0x98bfd0+_0x5cc01e(0x12a),_0x5cc01e(0xd5),'Step\x20references\x20non-existent\x20step\x20\x27'+_0x4c427c[_0x5cc01e(0xf1)]+'\x27',_0x442a11)));switch(_0x4c427c['type']){case _0x5cc01e(0x15d):_0x52eb6d[_0x5cc01e(0x149)](...validateWaitStep(_0x4c427c,_0x98bfd0,_0x442a11,_0x20cdbd));break;case'activation':_0x52eb6d[_0x5cc01e(0x149)](...validateActivationStep(_0x4c427c,_0x98bfd0,_0x442a11));break;case'decision_point':_0x52eb6d[_0x5cc01e(0x149)](...validateDecisionPointStep(_0x4c427c,_0x98bfd0,_0x442a11,_0x20cdbd));break;case _0x5cc01e(0x159):_0x52eb6d['push'](...validateAbTestStep(_0x4c427c,_0x98bfd0,_0x442a11,_0x20cdbd));break;case'jump':_0x52eb6d['push'](...validateJumpStep(_0x4c427c,_0x98bfd0,_0x442a11));break;}return _0x52eb6d;}function validateWaitStep(_0x3e8656,_0x3c168f,_0x448e73,_0x3707e0){const _0x3ddd4c=a146_0x219d,_0x5823de=[];if(!_0x3e8656['with'])return _0x5823de['push'](createIssue('error',_0x3c168f+_0x3ddd4c(0x13f),_0x3ddd4c(0x17f),_0x3ddd4c(0x138),_0x448e73,_0x3c168f)),_0x5823de;if(_0x3e8656[_0x3ddd4c(0x106)][_0x3ddd4c(0xd9)]){const _0x4ec8eb=_0x3e8656[_0x3ddd4c(0x106)][_0x3ddd4c(0xd9)];if(_0x4ec8eb[_0x3ddd4c(0xe3)]){_0x448e73['referencedSegments']?.[_0x3ddd4c(0x174)](_0x4ec8eb[_0x3ddd4c(0xe3)]);!_0x4ec8eb[_0x3ddd4c(0xe3)][_0x3ddd4c(0x13c)](_0x3ddd4c(0x128))&&(_0x448e73['embeddedSegments']&&!_0x448e73[_0x3ddd4c(0x119)][_0x3ddd4c(0x11d)](_0x4ec8eb[_0x3ddd4c(0xe3)])&&_0x5823de[_0x3ddd4c(0x149)](createIssue(_0x3ddd4c(0x18a),_0x3c168f+_0x3ddd4c(0x100),_0x3ddd4c(0xde),_0x3ddd4c(0xf6)+_0x4ec8eb[_0x3ddd4c(0xe3)]+_0x3ddd4c(0xd6),_0x448e73)));_0x4ec8eb[_0x3ddd4c(0xf1)]&&_0x448e73[_0x3ddd4c(0x14c)]&&!_0x448e73[_0x3ddd4c(0x14c)][_0x3ddd4c(0x11d)](_0x4ec8eb[_0x3ddd4c(0xf1)])&&_0x5823de[_0x3ddd4c(0x149)](createIssue(_0x3ddd4c(0x18a),_0x3c168f+_0x3ddd4c(0x15f),'INVALID_NEXT_REFERENCE',_0x3ddd4c(0x140)+_0x4ec8eb[_0x3ddd4c(0xf1)]+'\x27',_0x448e73));_0x4ec8eb[_0x3ddd4c(0x16b)]?.['next']&&_0x448e73[_0x3ddd4c(0x14c)]&&!_0x448e73[_0x3ddd4c(0x14c)]['has'](_0x4ec8eb['timeout'][_0x3ddd4c(0xf1)])&&_0x5823de[_0x3ddd4c(0x149)](createIssue(_0x3ddd4c(0x18a),_0x3c168f+'.with.condition.timeout.next',_0x3ddd4c(0xd5),_0x3ddd4c(0x102)+_0x4ec8eb['timeout'][_0x3ddd4c(0xf1)]+'\x27',_0x448e73));const _0x5e5d96=_0x4ec8eb['next']||_0x3e8656[_0x3ddd4c(0xf1)],_0x290141=_0x4ec8eb[_0x3ddd4c(0x16b)]?.[_0x3ddd4c(0xf1)]||_0x3e8656[_0x3ddd4c(0xf1)];if(_0x5e5d96){const _0x3dca13=_0x3707e0[_0x3ddd4c(0x14d)](_0x5e5d96);_0x3dca13?.[_0x3ddd4c(0x10c)]===_0x3ddd4c(0x151)&&_0x5823de[_0x3ddd4c(0x149)](createIssue(_0x3ddd4c(0x116),_0x3c168f+_0x3ddd4c(0x15f),'BRANCH_DIRECTLY_TO_MERGE',_0x3ddd4c(0x164)+_0x5e5d96+_0x3ddd4c(0x13d),_0x448e73,_0x3c168f+_0x3ddd4c(0x11c)));}if(_0x290141){const _0x3ab8d3=_0x3707e0[_0x3ddd4c(0x14d)](_0x290141);_0x3ab8d3?.['type']===_0x3ddd4c(0x151)&&_0x5823de['push'](createIssue('warning',_0x3c168f+_0x3ddd4c(0x131),_0x3ddd4c(0x107),'Wait\x20condition\x20timeout\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27'+_0x290141+'\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.',_0x448e73,_0x3c168f+_0x3ddd4c(0x180)));}}}return _0x5823de;}function validateActivationStep(_0x4d2b69,_0x4f1878,_0x31f6d5){const _0x362311=a146_0x219d,_0x56f762=[];if(!_0x4d2b69[_0x362311(0x106)]?.[_0x362311(0x143)])return _0x56f762[_0x362311(0x149)](createIssue(_0x362311(0x18a),_0x4f1878+_0x362311(0xdf),_0x362311(0x137),'Activation\x20step\x20requires\x20an\x20activation\x20reference',_0x31f6d5,_0x4f1878)),_0x56f762;const _0x2e277d=_0x4d2b69['with'][_0x362311(0x143)];return _0x31f6d5['activationKeys']&&!_0x2e277d[_0x362311(0x13c)](_0x362311(0x128))&&(!_0x31f6d5[_0x362311(0x18b)][_0x362311(0x11d)](_0x2e277d)&&_0x56f762[_0x362311(0x149)](createIssue(_0x362311(0x18a),_0x4f1878+'.with.activation','MISSING_ACTIVATION_DEFINITION',_0x362311(0x11e)+_0x2e277d+_0x362311(0x148),_0x31f6d5))),_0x56f762;}function validateDecisionPointStep(_0x6b924c,_0x4083a7,_0x5f64c9,_0x5806a1){const _0x3d22a2=a146_0x219d,_0x36b66a=[];if(!_0x6b924c['with']?.[_0x3d22a2(0x169)]||_0x6b924c[_0x3d22a2(0x106)]['branches'][_0x3d22a2(0x15c)]===0x0)return _0x36b66a[_0x3d22a2(0x149)](createIssue(_0x3d22a2(0x18a),_0x4083a7+_0x3d22a2(0x113),_0x3d22a2(0xfd),_0x3d22a2(0x172),_0x5f64c9,_0x4083a7)),_0x36b66a;for(let _0x303b5c=0x0;_0x303b5c<_0x6b924c['with'][_0x3d22a2(0x169)][_0x3d22a2(0x15c)];_0x303b5c++){const _0xb9066=_0x6b924c[_0x3d22a2(0x106)][_0x3d22a2(0x169)][_0x303b5c],_0x339fdb=_0x4083a7+_0x3d22a2(0x108)+_0x303b5c+']';_0xb9066[_0x3d22a2(0xe3)]&&!_0xb9066[_0x3d22a2(0x127)]&&(_0x5f64c9[_0x3d22a2(0x141)]?.[_0x3d22a2(0x174)](_0xb9066[_0x3d22a2(0xe3)]),!_0xb9066['segment'][_0x3d22a2(0x13c)](_0x3d22a2(0x128))&&(_0x5f64c9['embeddedSegments']&&!_0x5f64c9[_0x3d22a2(0x119)][_0x3d22a2(0x11d)](_0xb9066[_0x3d22a2(0xe3)])&&_0x36b66a[_0x3d22a2(0x149)](createIssue('error',_0x339fdb+'.segment',_0x3d22a2(0xde),_0x3d22a2(0x135)+_0xb9066[_0x3d22a2(0xe3)]+'\x27',_0x5f64c9))));_0xb9066[_0x3d22a2(0xf1)]&&_0x5f64c9[_0x3d22a2(0x14c)]&&!_0x5f64c9['stepNames'][_0x3d22a2(0x11d)](_0xb9066[_0x3d22a2(0xf1)])&&_0x36b66a['push'](createIssue(_0x3d22a2(0x18a),_0x339fdb+_0x3d22a2(0x12a),_0x3d22a2(0xd5),_0x3d22a2(0x142)+_0xb9066[_0x3d22a2(0xf1)]+'\x27',_0x5f64c9));if(_0xb9066[_0x3d22a2(0xf1)]){const _0x356fb6=_0x5806a1[_0x3d22a2(0x14d)](_0xb9066['next']);_0x356fb6?.[_0x3d22a2(0x10c)]===_0x3d22a2(0x151)&&_0x36b66a[_0x3d22a2(0x149)](createIssue(_0x3d22a2(0x116),_0x339fdb+_0x3d22a2(0x12a),_0x3d22a2(0x107),'Decision\x20branch\x20\x27'+_0xb9066[_0x3d22a2(0x139)]+_0x3d22a2(0x111)+_0xb9066[_0x3d22a2(0xf1)]+'\x27\x20with\x20no\x20action\x20in\x20between',_0x5f64c9));}}return _0x36b66a;}function validateAbTestStep(_0x4335ca,_0xf18b39,_0x291441,_0x129c70){const _0x3bc11f=a146_0x219d,_0x5c2e99=[];if(!_0x4335ca[_0x3bc11f(0x106)]?.[_0x3bc11f(0xd3)]||_0x4335ca[_0x3bc11f(0x106)][_0x3bc11f(0xd3)][_0x3bc11f(0x15c)]===0x0)return _0x5c2e99['push'](createIssue(_0x3bc11f(0x18a),_0xf18b39+_0x3bc11f(0x10e),_0x3bc11f(0xfd),_0x3bc11f(0x124),_0x291441,_0xf18b39)),_0x5c2e99;const _0x1bf650=_0x4335ca[_0x3bc11f(0x106)][_0x3bc11f(0xd3)]['reduce']((_0x34646b,_0x432b76)=>_0x34646b+(_0x432b76[_0x3bc11f(0xf8)]||0x0),0x0);Math[_0x3bc11f(0x145)](_0x1bf650-0x64)>0.01&&_0x5c2e99['push'](createIssue(_0x3bc11f(0x18a),_0xf18b39+_0x3bc11f(0x10e),_0x3bc11f(0xe8),'A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20'+_0x1bf650+'%)',_0x291441));for(let _0x2f007d=0x0;_0x2f007d<_0x4335ca[_0x3bc11f(0x106)][_0x3bc11f(0xd3)][_0x3bc11f(0x15c)];_0x2f007d++){const _0x5b7bff=_0x4335ca['with']['variants'][_0x2f007d],_0x58b766=_0xf18b39+_0x3bc11f(0x15a)+_0x2f007d+']';_0x5b7bff['next']&&_0x291441[_0x3bc11f(0x14c)]&&!_0x291441[_0x3bc11f(0x14c)][_0x3bc11f(0x11d)](_0x5b7bff['next'])&&_0x5c2e99[_0x3bc11f(0x149)](createIssue('error',_0x58b766+_0x3bc11f(0x12a),_0x3bc11f(0xd5),_0x3bc11f(0x114)+_0x5b7bff['next']+'\x27',_0x291441));if(_0x5b7bff['next']){const _0x42cadd=_0x129c70[_0x3bc11f(0x14d)](_0x5b7bff[_0x3bc11f(0xf1)]);_0x42cadd?.[_0x3bc11f(0x10c)]==='merge'&&_0x5c2e99[_0x3bc11f(0x149)](createIssue(_0x3bc11f(0x116),_0x58b766+_0x3bc11f(0x12a),_0x3bc11f(0x107),_0x3bc11f(0x12e)+_0x5b7bff['name']+_0x3bc11f(0x111)+_0x5b7bff[_0x3bc11f(0xf1)]+_0x3bc11f(0x110),_0x291441));}}return _0x5c2e99;}function validateJumpStep(_0x2539ed,_0x13a3a1,_0x9ca9ac){const _0x8d8658=a146_0x219d,_0x19b7d0=[];if(!_0x2539ed[_0x8d8658(0x106)]?.['target'])return _0x19b7d0[_0x8d8658(0x149)](createIssue(_0x8d8658(0x18a),_0x13a3a1+_0x8d8658(0xff),_0x8d8658(0x134),_0x8d8658(0x12c),_0x9ca9ac,_0x13a3a1)),_0x19b7d0;return(!_0x2539ed['with'][_0x8d8658(0x156)][_0x8d8658(0x154)]||!_0x2539ed[_0x8d8658(0x106)]['target']['stage'])&&_0x19b7d0[_0x8d8658(0x149)](createIssue(_0x8d8658(0x18a),_0x13a3a1+_0x8d8658(0xff),_0x8d8658(0x134),_0x8d8658(0xda),_0x9ca9ac)),_0x19b7d0;}function buildConvergenceMap(_0x331cd4){const _0x93ad3a=a146_0x219d,_0x49c4ac=new Map();function _0x59372e(_0x20dde5,_0x2942cf){const _0x3179e9=a146_0x219d,_0x21da73=_0x49c4ac[_0x3179e9(0x14d)](_0x20dde5)||[];_0x21da73[_0x3179e9(0x149)](_0x2942cf),_0x49c4ac['set'](_0x20dde5,_0x21da73);}for(const _0x224628 of _0x331cd4){_0x224628[_0x93ad3a(0xf1)]&&_0x59372e(_0x224628[_0x93ad3a(0xf1)],{'stepName':_0x224628['name'],'description':_0x93ad3a(0x117)+_0x224628[_0x93ad3a(0x139)]+'\x27'});if(_0x224628[_0x93ad3a(0x10c)]==='decision_point'&&_0x224628[_0x93ad3a(0x106)]?.[_0x93ad3a(0x169)])for(const _0x13b8ab of _0x224628['with'][_0x93ad3a(0x169)]){_0x13b8ab[_0x93ad3a(0xf1)]&&_0x59372e(_0x13b8ab['next'],{'stepName':_0x224628[_0x93ad3a(0x139)],'description':_0x93ad3a(0x189)+_0x13b8ab[_0x93ad3a(0x139)]+_0x93ad3a(0x185)+_0x224628[_0x93ad3a(0x139)]+'\x27'});}if(_0x224628[_0x93ad3a(0x10c)]===_0x93ad3a(0x159)&&_0x224628[_0x93ad3a(0x106)]?.[_0x93ad3a(0xd3)])for(const _0x2bc66e of _0x224628[_0x93ad3a(0x106)][_0x93ad3a(0xd3)]){_0x2bc66e[_0x93ad3a(0xf1)]&&_0x59372e(_0x2bc66e[_0x93ad3a(0xf1)],{'stepName':_0x224628['name'],'description':'variant\x20\x27'+_0x2bc66e[_0x93ad3a(0x139)]+_0x93ad3a(0x185)+_0x224628[_0x93ad3a(0x139)]+'\x27'});}_0x224628[_0x93ad3a(0x10c)]===_0x93ad3a(0x15d)&&_0x224628[_0x93ad3a(0x106)]?.[_0x93ad3a(0xd9)]&&(_0x224628[_0x93ad3a(0x106)][_0x93ad3a(0xd9)][_0x93ad3a(0xf1)]&&_0x59372e(_0x224628[_0x93ad3a(0x106)]['condition'][_0x93ad3a(0xf1)],{'stepName':_0x224628[_0x93ad3a(0x139)],'description':_0x93ad3a(0x158)+_0x224628['name']+'\x27'}),_0x224628[_0x93ad3a(0x106)][_0x93ad3a(0xd9)]['timeout']?.['next']&&_0x59372e(_0x224628[_0x93ad3a(0x106)][_0x93ad3a(0xd9)][_0x93ad3a(0x16b)][_0x93ad3a(0xf1)],{'stepName':_0x224628['name'],'description':'timeout\x20of\x20\x27'+_0x224628['name']+'\x27'}));}return _0x49c4ac;}function validateFlowControl(_0x1d6c84,_0x253d98,_0x77f1c0){const _0x16ce00=a146_0x219d,_0x52072b=[],_0x271912=_0x16ce00(0x147)+_0x253d98+']',_0x209652=_0x1d6c84[_0x16ce00(0x181)]||[];if(_0x209652['length']===0x0)return _0x52072b;const _0x98bc8f=new Map();for(const _0x1b3800 of _0x209652){_0x1b3800[_0x16ce00(0x139)]&&_0x98bc8f[_0x16ce00(0x163)](_0x1b3800[_0x16ce00(0x139)],_0x1b3800);}const _0x224b9f=buildConvergenceMap(_0x209652),_0x41795a=_0x209652[_0x16ce00(0x121)](_0x210d8b=>_0x210d8b['type']==='end');!_0x41795a&&_0x52072b[_0x16ce00(0x149)](createIssue(_0x16ce00(0x18a),_0x271912+_0x16ce00(0x11a),_0x16ce00(0x15e),'Stage\x20\x27'+_0x1d6c84[_0x16ce00(0x139)]+_0x16ce00(0xdd),_0x77f1c0));for(const [_0x5bb7b1,_0x2faf17]of _0x224b9f){const _0x2b5beb=_0x98bc8f['get'](_0x5bb7b1);if(!_0x2b5beb)continue;if(_0x2faf17[_0x16ce00(0x15c)]>0x1&&_0x2b5beb[_0x16ce00(0x10c)]!==_0x16ce00(0x151)){const _0x2ee9c2=_0x2faf17[_0x16ce00(0xe4)](_0x272832=>_0x272832[_0x16ce00(0x12d)])[_0x16ce00(0x120)](',\x20');_0x52072b[_0x16ce00(0x149)](createIssue(_0x16ce00(0x18a),_0x271912+_0x16ce00(0x11a),_0x16ce00(0x18d),_0x16ce00(0x14a)+_0x5bb7b1+_0x16ce00(0x173)+_0x2ee9c2+_0x16ce00(0xe6),_0x77f1c0));}_0x2faf17[_0x16ce00(0x15c)]===0x1&&_0x2b5beb[_0x16ce00(0x10c)]==='merge'&&_0x52072b[_0x16ce00(0x149)](createIssue(_0x16ce00(0x116),_0x271912+'.steps',_0x16ce00(0x15b),'Merge\x20step\x20\x27'+_0x5bb7b1+_0x16ce00(0x182)+_0x2faf17[0x0][_0x16ce00(0x12d)]+_0x16ce00(0x188),_0x77f1c0));}for(const _0x557421 of _0x209652){if(_0x557421[_0x16ce00(0x10c)]===_0x16ce00(0x151)&&_0x557421[_0x16ce00(0xf1)]){const _0x1b9a36=_0x98bc8f['get'](_0x557421['next']);_0x1b9a36?.['type']===_0x16ce00(0x151)&&_0x52072b[_0x16ce00(0x149)](createIssue(_0x16ce00(0x18a),_0x271912+_0x16ce00(0x11a),_0x16ce00(0xea),'Merge\x20step\x20\x27'+_0x557421[_0x16ce00(0x139)]+_0x16ce00(0x157)+_0x557421[_0x16ce00(0xf1)]+_0x16ce00(0x103),_0x77f1c0));}}return _0x52072b;}function a146_0x219d(_0x44d5b6,_0x2408dd){_0x44d5b6=_0x44d5b6-0xd3;const _0x2681ac=a146_0x2681();let _0x219d8f=_0x2681ac[_0x44d5b6];return _0x219d8f;}function validateCriteria(_0x5f0ff8,_0x373216,_0x4bfdc5){const _0x199ee6=a146_0x219d,_0x532471=[];return _0x5f0ff8[_0x199ee6(0xe3)]&&(_0x4bfdc5[_0x199ee6(0x141)]?.[_0x199ee6(0x174)](_0x5f0ff8[_0x199ee6(0xe3)]),!_0x5f0ff8[_0x199ee6(0xe3)][_0x199ee6(0x13c)](_0x199ee6(0x128))&&(_0x4bfdc5[_0x199ee6(0x119)]&&!_0x4bfdc5[_0x199ee6(0x119)][_0x199ee6(0x11d)](_0x5f0ff8[_0x199ee6(0xe3)])&&_0x532471[_0x199ee6(0x149)](createIssue(_0x199ee6(0x18a),_0x373216+_0x199ee6(0x17d),_0x199ee6(0xde),_0x199ee6(0xe2)+_0x5f0ff8[_0x199ee6(0xe3)]+'\x27',_0x4bfdc5)))),_0x532471;}function validateEmbeddedSegment(_0x1ac368,_0x1a46a1,_0x2703a1){const _0xb76726=a146_0x219d,_0x43bc24=[];return _0x1ac368[_0xb76726(0x136)]&&_0x43bc24[_0xb76726(0x149)](...validateRuleDef(_0x1ac368[_0xb76726(0x136)],_0x1a46a1+'.rule',_0x2703a1)),_0x43bc24;}function validateStage(_0x344d3b,_0x2fe603,_0x3c99cf,_0x19b92b){const _0x5af43c=a146_0x219d,_0x14446b=[],_0x4593d2=_0x5af43c(0x147)+_0x2fe603+']',_0x5a1551=new Map(),_0x3046f6=new Map();if(_0x344d3b[_0x5af43c(0x181)]){for(let _0x3b5930=0x0;_0x3b5930<_0x344d3b[_0x5af43c(0x181)][_0x5af43c(0x15c)];_0x3b5930++){const _0x3c9954=_0x344d3b[_0x5af43c(0x181)][_0x3b5930];_0x3c9954[_0x5af43c(0x139)]&&_0x5a1551[_0x5af43c(0x163)](_0x3c9954[_0x5af43c(0x139)],_0x3c9954);}for(let _0x234a4a=0x0;_0x234a4a<_0x344d3b[_0x5af43c(0x181)]['length'];_0x234a4a++){const _0x872d87=_0x344d3b['steps'][_0x234a4a],_0x1e518d=_0x4593d2+_0x5af43c(0x184)+_0x234a4a+']';if(_0x872d87['name']){if(_0x3046f6[_0x5af43c(0x11d)](_0x872d87[_0x5af43c(0x139)])){const _0x402959=_0x3046f6['get'](_0x872d87[_0x5af43c(0x139)]);_0x14446b[_0x5af43c(0x149)](createIssue(_0x5af43c(0x18a),_0x1e518d+_0x5af43c(0x125),_0x5af43c(0x177),_0x5af43c(0x10a)+_0x872d87[_0x5af43c(0x139)]+_0x5af43c(0x13e)+_0x402959+'])',_0x19b92b));}else _0x3046f6[_0x5af43c(0x163)](_0x872d87[_0x5af43c(0x139)],_0x234a4a);}_0x14446b[_0x5af43c(0x149)](...validateStep(_0x872d87,_0x1e518d,_0x19b92b,_0x5a1551));}}_0x344d3b['entry_criteria']&&_0x14446b[_0x5af43c(0x149)](...validateCriteria(_0x344d3b[_0x5af43c(0xdb)],_0x4593d2+_0x5af43c(0x183),_0x19b92b));if(_0x344d3b[_0x5af43c(0xd4)])for(let _0x2f42e1=0x0;_0x2f42e1<_0x344d3b[_0x5af43c(0xd4)][_0x5af43c(0x15c)];_0x2f42e1++){_0x14446b[_0x5af43c(0x149)](...validateCriteria(_0x344d3b['exit_criteria'][_0x2f42e1],_0x4593d2+_0x5af43c(0x112)+_0x2f42e1+']',_0x19b92b));}return _0x344d3b[_0x5af43c(0x12f)]&&_0x14446b[_0x5af43c(0x149)](...validateCriteria(_0x344d3b[_0x5af43c(0x12f)],_0x4593d2+'.milestone',_0x19b92b)),_0x14446b['push'](...validateStageStructure(_0x344d3b,_0x2fe603,_0x3c99cf,_0x19b92b)),_0x14446b[_0x5af43c(0x149)](...validateFlowControl(_0x344d3b,_0x2fe603,_0x19b92b)),_0x14446b;}function validateStagesForVersion(_0x85c7bd,_0x1c49a5,_0x4c34ba,_0x318709,_0x25caad,_0x348aa7,_0x1273ec){const _0x2cdb7b=a146_0x219d;if(_0x85c7bd[_0x2cdb7b(0x15c)]===0x0){_0x25caad[_0x2cdb7b(0x149)]({'level':_0x2cdb7b(0x18a),'path':_0x318709+'stages','code':_0x2cdb7b(0x150),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x4c34ba[_0x2cdb7b(0x122)],_0x4c34ba[_0x2cdb7b(0x129)],['stages'])});return;}const _0x59b651=new Set();for(const _0x5ce16a of _0x85c7bd){if(_0x5ce16a[_0x2cdb7b(0x181)])for(const _0x249564 of _0x5ce16a['steps']){_0x249564['name']&&_0x59b651['add'](_0x249564['name']);}}const _0x11f4f2={..._0x4c34ba,'stepNames':_0x59b651},_0xb9a9de=validateVersionStructure(_0x85c7bd,_0x11f4f2);for(const _0x3d1c42 of _0xb9a9de){const _0x38da1c=_0x318709?{..._0x3d1c42,'path':''+_0x318709+_0x3d1c42[_0x2cdb7b(0x12b)]}:_0x3d1c42;if(_0x38da1c[_0x2cdb7b(0x11b)]===_0x2cdb7b(0x18a))_0x25caad[_0x2cdb7b(0x149)](_0x38da1c);else _0x348aa7[_0x2cdb7b(0x149)](_0x38da1c);}for(let _0x5d2061=0x0;_0x5d2061<_0x85c7bd[_0x2cdb7b(0x15c)];_0x5d2061++){const _0x1985fa=validateStage(_0x85c7bd[_0x5d2061],_0x5d2061,_0x85c7bd[_0x2cdb7b(0x15c)],_0x11f4f2);for(const _0x479f11 of _0x1985fa){const _0x3fefc6=_0x318709?{..._0x479f11,'path':''+_0x318709+_0x479f11[_0x2cdb7b(0x12b)]}:_0x479f11;if(_0x3fefc6[_0x2cdb7b(0x11b)]===_0x2cdb7b(0x18a))_0x25caad[_0x2cdb7b(0x149)](_0x3fefc6);else _0x348aa7['push'](_0x3fefc6);}}if(_0x1c49a5['goal']){const _0x523243=_0x1273ec?.['goalIsInherited']?_0x2cdb7b(0x176):_0x318709+_0x2cdb7b(0x176),_0x3710d1=validateCriteria(_0x1c49a5[_0x2cdb7b(0x176)],_0x523243,_0x11f4f2);for(const _0x5d7f98 of _0x3710d1){if(_0x5d7f98[_0x2cdb7b(0x11b)]===_0x2cdb7b(0x18a))_0x25caad['push'](_0x5d7f98);else _0x348aa7['push'](_0x5d7f98);}}}function extractVersionIndex(_0x1a9d55){const _0x40c712=a146_0x219d,_0x43da5d=_0x1a9d55[_0x40c712(0xe5)](/^journeys\[(\d+)\]\./);return _0x43da5d?_0x43da5d[0x1]:undefined;}function deduplicateAcrossVersions(_0x502872){const _0x25a27d=a146_0x219d,_0x15519c=new Map();for(let _0x2fbd18=0x0;_0x2fbd18<_0x502872[_0x25a27d(0x15c)];_0x2fbd18++){const _0x3ee8dc=_0x502872[_0x2fbd18][_0x25a27d(0xe1)]+':'+_0x502872[_0x2fbd18]['message'],_0x483e4e=extractVersionIndex(_0x502872[_0x2fbd18][_0x25a27d(0x12b)]),_0x90f38e=_0x15519c['get'](_0x3ee8dc);if(_0x90f38e){_0x90f38e[_0x25a27d(0x18f)]['push'](_0x2fbd18);if(_0x483e4e)_0x90f38e[_0x25a27d(0x155)]['add'](_0x483e4e);}else _0x15519c[_0x25a27d(0x163)](_0x3ee8dc,{'indices':[_0x2fbd18],'versions':new Set(_0x483e4e?[_0x483e4e]:[])});}const _0x62c9a3=new Set();for(const {indices:_0x121b56,versions:_0x1f0388}of _0x15519c['values']()){if(_0x1f0388[_0x25a27d(0x10b)]<=0x1)continue;const _0x5e643f=_0x502872[_0x121b56[0x0]];_0x5e643f[_0x25a27d(0x12b)]=_0x5e643f['path'][_0x25a27d(0xd8)](/^journeys\[\d+\]\./,''),_0x5e643f[_0x25a27d(0xf4)]=_0x5e643f['message']+_0x25a27d(0x18c)+_0x1f0388[_0x25a27d(0x10b)]+_0x25a27d(0xe7);for(let _0x955d81=0x1;_0x955d81<_0x121b56['length'];_0x955d81++){_0x62c9a3[_0x25a27d(0x174)](_0x121b56[_0x955d81]);}}const _0x402830=[..._0x62c9a3][_0x25a27d(0x18e)]((_0x25fdb1,_0x3a4dd6)=>_0x3a4dd6-_0x25fdb1);for(const _0x32b64e of _0x402830){_0x502872['splice'](_0x32b64e,0x1);}}export function validateJourneyDef(_0x3e0d9f,_0xd47473={},_0x2ffeea={}){const _0xbf3a5c=a146_0x219d;if(_0x2ffeea[_0xbf3a5c(0x115)])return runJourneySemanticChecks(_0x3e0d9f,_0xd47473);const _0xca7daa=JourneyDefSchema['safeParse'](_0x3e0d9f);if(_0xca7daa[_0xbf3a5c(0x104)])return runJourneySemanticChecks(_0xca7daa[_0xbf3a5c(0xfa)],_0xd47473);return zodErrorsToJourneyValidationResult(_0xca7daa[_0xbf3a5c(0x18a)],_0xd47473);}function zodErrorsToJourneyValidationResult(_0x5adc1c,_0x21ff1d){const _0x375763=a146_0x219d,_0x10a2f1=flattenZodIssues(_0x5adc1c[_0x375763(0x10d)]),_0x34ad37=_0x10a2f1[_0x375763(0xe4)](_0x87999=>{const _0x535d40=_0x375763,_0x2693ac=formatZodPath(_0x87999[_0x535d40(0x12b)]),_0x40d389=mapJourneyZodIssueToCode(_0x87999,_0x2693ac),_0xe472d1=getLocationFromPath(_0x21ff1d[_0x535d40(0x122)],_0x21ff1d['source'],_0x87999['path'][_0x535d40(0xe4)](_0x26d8c9=>typeof _0x26d8c9===_0x535d40(0x168)?String(_0x26d8c9):_0x26d8c9));return{'level':_0x535d40(0x18a),'path':_0x2693ac,'code':_0x40d389,'message':_0x87999[_0x535d40(0xf4)],..._0xe472d1&&{'location':_0xe472d1}};});return{'valid':![],'errors':_0x34ad37,'warnings':[]};}function a146_0x2681(){const _0x291d79=['MISSING_ACTIVATION_REF','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','name','stages','END_STEP_HAS_NEXT_OR_WITH','startsWith','\x27\x20with\x20no\x20action.\x20Each\x20branch\x20of\x20a\x20condition\x20wait\x20must\x20perform\x20a\x20different\x20action.','\x27\x20(first\x20defined\x20at\x20steps[','.with','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','referencedSegments','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','activation','39wWMYAb','abs','INSUFFICIENT_STEPS','stages[','\x27.\x20Define\x20it\x20in\x20the\x20\x27activations\x27\x20section\x20or\x20use\x20\x27ref:Name\x27\x20for\x20external\x20activations.','push','Multiple\x20paths\x20converge\x20on\x20non-merge\x20step\x20\x27','.type','stepNames','get','journeys','End\x20step\x20\x27','MISSING_STAGES','merge','state','504oCtBXU','journey','versions','target','\x27\x20leads\x20to\x20another\x20merge\x20step\x20\x27','condition\x20of\x20\x27','ab_test','.with.variants[','SINGLE_INPUT_MERGE','length','wait','MISSING_END_STEP','.with.condition.next','activations','135ksdOMp','MISSING_MILESTONE','set','Wait\x20condition\x20matched\x20path\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','6664966uzkPkk','578169mdCnQk','versions[','symbol','branches','\x20steps\x20(may\x20be\x20too\x20simple)','timeout','16992ldasfz','keys','10ZJHGPG','endsWith','4040496PmrdLS','328776bkEtcH','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','\x27\x20(from:\x20','add','segments','goal','DUPLICATE_STEP_NAME','\x27\x20has\x20no\x20steps','\x27\x20has\x20only\x20','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','2waPPxL','MISSING_NAME','.segment','version','MISSING_WAIT_PARAMS','.with.condition.timeout','steps','\x27\x20has\x20only\x20one\x20input\x20(from:\x20','.entry_criteria','.steps[','\x27\x20of\x20\x27','entries','every',').\x20Merge\x20is\x20unnecessary.','branch\x20\x27','error','activationKeys','\x20(across\x20','CONVERGENCE_WITHOUT_MERGE','sort','indices','variants','exit_criteria','INVALID_NEXT_REFERENCE','\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','DUPLICATE_LATEST','replace','condition','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','entry_criteria','Journey\x20name\x20is\x20required','\x27\x20has\x20no\x20end\x20step','MISSING_SEGMENT_REFERENCE','.with.activation','Journey\x20has\x20','code','Criteria\x20references\x20undefined\x20segment\x20\x27','segment','map','match',').\x20Use\x20a\x20merge\x20step.','\x20versions)','INVALID_AB_TEST_PERCENTAGES','Journey\x20has\x20no\x20goal\x20defined','MERGE_TO_MERGE_CHAIN','Embedded\x20segment\x20\x27','.milestone','20106NTmpsM','filter','\x27\x20(non-last\x20stage)\x20is\x20missing\x20a\x20milestone','1169fVbSYT','next','MISSING_EXIT_CRITERIA','segments.','message','launched','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','JOURNEY_SCHEMA_ERROR','percentage','Stage\x20\x27','data','end','excluded_','MISSING_CONDITIONS','MISSING_GOAL','.with.target','.with.condition.segment','MISSING_ENTRY_CRITERIA','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','\x27.\x20Merge\x20chains\x20are\x20not\x20allowed.','success','trim','with','BRANCH_DIRECTLY_TO_MERGE','.with.branches[','\x27\x20is\x20missing\x20entry_criteria\x20(required\x20for\x20the\x20first\x20stage)','Duplicate\x20step\x20name\x20\x27','size','type','issues','.with.variants','journeys,\x20stages,\x20or\x20versions','\x27\x20with\x20no\x20action\x20in\x20between','\x27\x20goes\x20directly\x20to\x20merge\x20step\x20\x27','.exit_criteria[','.with.branches','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','skipSchema','warning','step\x20\x27','\x27\x20should\x20not\x20have\x20a\x20\x27next\x27\x20field','embeddedSegments','.steps','level','.with.condition','has','Activation\x20step\x20references\x20undefined\x20activation\x20\x27','\x27\x20has\x20no\x20exit_criteria\x20defined','join','some','document','latest','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','.name','3546210pZtgcy','excluded','ref:','source','.next','path','Jump\x20step\x20requires\x20a\x20target','description','A/B\x20test\x20variant\x20\x27','milestone','.stages','.with.condition.timeout.next','FEW_STEPS','includes','INVALID_JUMP_TARGET','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','rule'];a146_0x2681=function(){return _0x291d79;};return a146_0x2681();}function mapJourneyZodIssueToCode(_0x57add8,_0x5421e3){const _0x33cf6c=a146_0x219d;if(_0x5421e3===_0x33cf6c(0x139))return _0x33cf6c(0x17c);if(_0x5421e3[_0x33cf6c(0x16f)](_0x33cf6c(0x14b))&&_0x5421e3[_0x33cf6c(0x133)](_0x33cf6c(0x181)))return _0x33cf6c(0xf7);if(_0x5421e3===_0x33cf6c(0x13a)||_0x5421e3[_0x33cf6c(0x16f)](_0x33cf6c(0x130)))return _0x33cf6c(0x150);if(_0x5421e3===''&&_0x57add8[_0x33cf6c(0xf4)][_0x33cf6c(0x133)](_0x33cf6c(0x10f)))return'MISSING_STAGES';if(_0x5421e3[_0x33cf6c(0x133)]('activation'))return'ACTIVATION_SCHEMA_ERROR';return _0x33cf6c(0xf7);}function runJourneySemanticChecks(_0x4569b3,_0xb87d2){const _0x45e6bf=a146_0x219d,_0x551983=[],_0x23d47d=[];(!_0x4569b3[_0x45e6bf(0x139)]||_0x4569b3['name'][_0x45e6bf(0x105)]()==='')&&_0x551983[_0x45e6bf(0x149)]({'level':_0x45e6bf(0x18a),'path':_0x45e6bf(0x139),'code':_0x45e6bf(0x17c),'message':_0x45e6bf(0xdc),'location':getLocationFromPath(_0xb87d2[_0x45e6bf(0x122)],_0xb87d2[_0x45e6bf(0x129)],[_0x45e6bf(0x139)])});const _0x4dfbfd=new Set();if(_0x4569b3['segments'])for(const _0x5715cc of Object[_0x45e6bf(0x16d)](_0x4569b3['segments'])){_0x4dfbfd['add'](_0x5715cc);}const _0x132b02=new Set();if(_0x4569b3[_0x45e6bf(0x160)])for(const _0x435b59 of Object[_0x45e6bf(0x16d)](_0x4569b3[_0x45e6bf(0x160)])){_0x132b02[_0x45e6bf(0x174)](_0x435b59);}const _0x3d4f91=new Set(),_0x31a2a3={..._0xb87d2,'embeddedSegments':_0x4dfbfd,'referencedSegments':_0x3d4f91,'activationKeys':_0x132b02[_0x45e6bf(0x10b)]>0x0?_0x132b02:undefined};if(_0x4569b3['segments'])for(const [_0x3a0ce3,_0x22669e]of Object[_0x45e6bf(0x186)](_0x4569b3[_0x45e6bf(0x175)])){const _0x176928=validateEmbeddedSegment(_0x22669e,_0x45e6bf(0xf3)+_0x3a0ce3,_0x31a2a3);for(const _0x11aa16 of _0x176928){if(_0x11aa16[_0x45e6bf(0x11b)]===_0x45e6bf(0x18a))_0x551983[_0x45e6bf(0x149)](_0x11aa16);else _0x23d47d[_0x45e6bf(0x149)](_0x11aa16);}}const _0x128fde=!!_0x4569b3['goal'],_0x2fa83c=_0x4569b3[_0x45e6bf(0x14e)]?.[_0x45e6bf(0x187)](_0x253534=>!!_0x253534[_0x45e6bf(0x176)])??![];!_0x128fde&&!_0x2fa83c&&_0x23d47d['push']({'level':_0x45e6bf(0x116),'path':'goal','code':_0x45e6bf(0xfe),'message':_0x45e6bf(0xe9),'location':getLocationFromPath(_0xb87d2[_0x45e6bf(0x122)],_0xb87d2[_0x45e6bf(0x129)],['goal'])});const _0xa91f66=_0x4569b3['journeys']??_0x4569b3['versions'];if(_0xa91f66&&_0xa91f66[_0x45e6bf(0xee)](_0x223a88=>_0x223a88[_0x45e6bf(0x123)]===!![])[_0x45e6bf(0x15c)]>0x1){const _0x27b532=_0x4569b3[_0x45e6bf(0x14e)]?_0x45e6bf(0x14e):_0x45e6bf(0x155);_0x551983['push']({'level':'error','path':_0x27b532,'code':_0x45e6bf(0xd7),'message':'Journey\x20can\x20have\x20at\x20most\x20one\x20'+(_0x27b532===_0x45e6bf(0x14e)?'journey\x20entry':_0x45e6bf(0x17e))+'\x20with\x20latest:\x20true','location':getLocationFromPath(_0xb87d2['document'],_0xb87d2[_0x45e6bf(0x129)],[_0x27b532])});}if(_0x4569b3[_0x45e6bf(0x14e)]&&_0x4569b3[_0x45e6bf(0x14e)][_0x45e6bf(0x15c)]>0x0)for(let _0x3e8c5f=0x0;_0x3e8c5f<_0x4569b3[_0x45e6bf(0x14e)][_0x45e6bf(0x15c)];_0x3e8c5f++){const _0x489003=_0x4569b3[_0x45e6bf(0x14e)][_0x3e8c5f];if(_0x4569b3[_0x45e6bf(0x14e)][_0x45e6bf(0x15c)]>0x1&&_0x489003[_0x45e6bf(0x152)]==='launched')continue;const _0xb8336=_0x489003[_0x45e6bf(0x13a)]||[],_0x1835de='journeys['+_0x3e8c5f+'].',_0xe1000=!!_0x489003[_0x45e6bf(0x176)],_0x3f6bff=_0xe1000?{..._0x4569b3,'goal':_0x489003[_0x45e6bf(0x176)]}:_0x4569b3;validateStagesForVersion(_0xb8336,_0x3f6bff,_0x31a2a3,_0x1835de,_0x551983,_0x23d47d,{'goalIsInherited':!_0xe1000});}else{if(_0x4569b3[_0x45e6bf(0x155)]&&_0x4569b3[_0x45e6bf(0x155)][_0x45e6bf(0x15c)]>0x0)for(let _0x1f2269=0x0;_0x1f2269<_0x4569b3[_0x45e6bf(0x155)]['length'];_0x1f2269++){const _0x477e1d=_0x4569b3['versions'][_0x1f2269];if(_0x4569b3['versions'][_0x45e6bf(0x15c)]>0x1&&_0x477e1d[_0x45e6bf(0x152)]===_0x45e6bf(0xf5))continue;const _0x43f540=_0x477e1d[_0x45e6bf(0x13a)]||[],_0x3cfe42=_0x45e6bf(0x167)+_0x1f2269+'].';validateStagesForVersion(_0x43f540,_0x4569b3,_0x31a2a3,_0x3cfe42,_0x551983,_0x23d47d);}else{const _0x39a17d=_0x4569b3[_0x45e6bf(0x13a)]||[];validateStagesForVersion(_0x39a17d,_0x4569b3,_0x31a2a3,'',_0x551983,_0x23d47d);}}_0x4569b3[_0x45e6bf(0x14e)]&&_0x4569b3['journeys'][_0x45e6bf(0x15c)]>0x1&&(deduplicateAcrossVersions(_0x551983),deduplicateAcrossVersions(_0x23d47d));for(const _0x2ec03b of _0x4dfbfd){!_0x3d4f91[_0x45e6bf(0x11d)](_0x2ec03b)&&!_0x2ec03b[_0x45e6bf(0x13c)](_0x45e6bf(0xfc))&&_0x23d47d['push']({'level':_0x45e6bf(0x116),'path':'segments.'+_0x2ec03b,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0x45e6bf(0xeb)+_0x2ec03b+_0x45e6bf(0x17a),'location':getLocationFromPath(_0xb87d2[_0x45e6bf(0x122)],_0xb87d2[_0x45e6bf(0x129)],[_0x45e6bf(0x175),_0x2ec03b])});}return{'valid':_0x551983[_0x45e6bf(0x15c)]===0x0,'errors':_0x551983,'warnings':_0x23d47d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a147_0x21078b=a147_0x156b;(function(_0x165b9f,_0x3f2baa){const _0x1c9a05=a147_0x156b,_0x1f38cc=_0x165b9f();while(!![]){try{const _0x5eb60f=parseInt(_0x1c9a05(0x173))/0x1*(-parseInt(_0x1c9a05(0x1d4))/0x2)+-parseInt(_0x1c9a05(0x222))/0x3*(parseInt(_0x1c9a05(0x20b))/0x4)+-parseInt(_0x1c9a05(0x1ca))/0x5+-parseInt(_0x1c9a05(0x200))/0x6*(-parseInt(_0x1c9a05(0x1d0))/0x7)+-parseInt(_0x1c9a05(0x1fb))/0x8+parseInt(_0x1c9a05(0x1c0))/0x9*(-parseInt(_0x1c9a05(0x177))/0xa)+parseInt(_0x1c9a05(0x1fd))/0xb*(parseInt(_0x1c9a05(0x182))/0xc);if(_0x5eb60f===_0x3f2baa)break;else _0x1f38cc['push'](_0x1f38cc['shift']());}catch(_0x325d2f){_0x1f38cc['push'](_0x1f38cc['shift']());}}}(a147_0x1b2a,0xcda73));import*as a147_0x1e9c98 from'yaml';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(_0x2ce4c2){const _0x5da004=a147_0x156b,_0x7c2ecd=_0x2ce4c2[_0x5da004(0x1d6)]();if(_0x7c2ecd==='days'||_0x7c2ecd===_0x5da004(0x171))return'day';if(_0x7c2ecd===_0x5da004(0x1c6)||_0x7c2ecd===_0x5da004(0x183))return _0x5da004(0x183);return _0x2ce4c2;}export function journeyResponseToDefSync(_0x548ca0){const _0xc98bae=a147_0x156b,_0x2692f4=_0x548ca0[_0xc98bae(0x1b1)],_0x507959=_0x2692f4[_0xc98bae(0x1fc)]||_0x2692f4['name'],_0x180ab4={'stages':_0x2692f4[_0xc98bae(0x1fa)][_0xc98bae(0x217)](convertApiStageToYaml),'id':_0x548ca0['id']};_0x2692f4[_0xc98bae(0x21f)]&&(_0x180ab4[_0xc98bae(0x21f)]=convertApiCriteriaToYaml(_0x2692f4[_0xc98bae(0x21f)]));_0x2692f4['name']&&_0x2692f4['name']!==_0x507959&&(_0x180ab4[_0xc98bae(0x202)]=_0x2692f4[_0xc98bae(0x1de)]);_0x2692f4['versionNumber']!==undefined&&(_0x180ab4[_0xc98bae(0x1ec)]=_0x2692f4['versionNumber']);_0x2692f4[_0xc98bae(0x20f)]&&(_0x180ab4[_0xc98bae(0x20f)]=_0x2692f4[_0xc98bae(0x20f)]===_0xc98bae(0x176)?_0xc98bae(0x176):'draft');const _0x64e8cb={'type':_0xc98bae(0x19b),'name':_0x507959,'journeys':[_0x180ab4]};_0x2692f4[_0xc98bae(0x1b5)]&&(_0x64e8cb[_0xc98bae(0x1b5)]=_0x2692f4[_0xc98bae(0x1b5)]);_0x2692f4[_0xc98bae(0x21f)]&&(_0x64e8cb[_0xc98bae(0x21f)]=convertApiCriteriaToYaml(_0x2692f4[_0xc98bae(0x21f)]));if(_0x2692f4[_0xc98bae(0x1b6)])_0x64e8cb['reentry']=_0x2692f4[_0xc98bae(0x1b6)];else _0x2692f4[_0xc98bae(0x1a6)]!==undefined&&(_0x64e8cb['reentry']=_0x2692f4[_0xc98bae(0x1a6)]?_0xc98bae(0x1f6):_0xc98bae(0x1d8));return _0x2692f4['journeyBundleId']&&(_0x64e8cb[_0xc98bae(0x207)]=_0x2692f4[_0xc98bae(0x225)]),_0x2692f4[_0xc98bae(0x1fc)]&&(_0x64e8cb[_0xc98bae(0x209)]=_0x2692f4[_0xc98bae(0x1fc)]),_0x548ca0['relationships']?.['parentFolder']?.[_0xc98bae(0x181)]?.['id']&&(_0x64e8cb[_0xc98bae(0x17e)]=_0x548ca0[_0xc98bae(0x174)][_0xc98bae(0x19e)]['data']['id']),_0x64e8cb;}export async function journeyResponseToDef(_0x2acaab,_0x5387b7){const _0xff3e2d=a147_0x156b,_0x31eab8=journeyResponseToDefSync(_0x2acaab);if(!_0x5387b7)return _0x31eab8;const _0x534045=new Set();collectSegmentIdsFromJourney(_0x31eab8,_0x534045);const _0x2cb078=new Set();collectActivationIdsFromJourney(_0x31eab8,_0x2cb078);const _0x59908d={},_0x307ea7=new Map();for(const _0x116c78 of Array['from'](_0x534045)[_0xff3e2d(0x214)]()){if(_0x5387b7[_0xff3e2d(0x223)]){const _0x28650e=await _0x5387b7[_0xff3e2d(0x223)](_0x116c78);if(_0x28650e['isJourneyLocal']){_0x307ea7[_0xff3e2d(0x1d9)](_0x116c78,_0x28650e[_0xff3e2d(0x1de)]);if(_0x28650e['definition']){const _0x4f883f={..._0x28650e['definition'],'rule':deepSortObject(_0x28650e[_0xff3e2d(0x180)]['rule'])};_0x59908d[_0x28650e[_0xff3e2d(0x1de)]]=_0x4f883f;}}else _0x307ea7[_0xff3e2d(0x1d9)](_0x116c78,makeSegmentRef(_0x28650e['name']));}else{if(_0x5387b7[_0xff3e2d(0x1ea)]){const _0x5b78dd=await _0x5387b7[_0xff3e2d(0x1ea)](_0x116c78);_0x307ea7[_0xff3e2d(0x1d9)](_0x116c78,_0x5b78dd);}}}const _0x5de633={},_0x468f09=new Map();for(const _0x419c92 of Array['from'](_0x2cb078)[_0xff3e2d(0x214)]()){if(_0x5387b7[_0xff3e2d(0x1a5)]){const _0x1b9fb6=await _0x5387b7[_0xff3e2d(0x1a5)](_0x419c92);_0x1b9fb6['isJourneyLocal']?(_0x468f09[_0xff3e2d(0x1d9)](_0x419c92,_0x1b9fb6['name']),_0x1b9fb6['definition']&&(_0x5de633[_0x1b9fb6[_0xff3e2d(0x1de)]]=_0x1b9fb6[_0xff3e2d(0x180)])):_0x468f09[_0xff3e2d(0x1d9)](_0x419c92,makeSegmentRef(_0x1b9fb6[_0xff3e2d(0x1de)]));}else{if(_0x5387b7['resolveActivationName']){const _0x199706=await _0x5387b7[_0xff3e2d(0x210)](_0x419c92);_0x468f09[_0xff3e2d(0x1d9)](_0x419c92,_0x199706);}}}_0x307ea7[_0xff3e2d(0x17a)]>0x0&&replaceSegmentIdsInJourney(_0x31eab8,_0x307ea7);_0x468f09[_0xff3e2d(0x17a)]>0x0&&replaceActivationIdsInJourney(_0x31eab8,_0x468f09);if(_0x5387b7['resolveJumpTarget']){const _0x27a5eb=[];collectJumpTargetsFromJourney(_0x31eab8,_0x27a5eb);if(_0x27a5eb[_0xff3e2d(0x1ab)]>0x0){const _0x100686=new Map();for(const _0x565767 of _0x27a5eb){try{const _0x2360c9=await _0x5387b7[_0xff3e2d(0x226)](_0x565767[_0xff3e2d(0x21a)],_0x565767['stageId']);_0x100686['set'](_0x565767['journeyId']+':'+_0x565767[_0xff3e2d(0x216)],_0x2360c9);}catch{}}_0x100686['size']>0x0&&replaceJumpTargetsInJourney(_0x31eab8,_0x100686);}}return Object['keys'](_0x59908d)['length']>0x0&&(_0x31eab8['segments']=_0x59908d),Object['keys'](_0x5de633)[_0xff3e2d(0x1ab)]>0x0&&(_0x31eab8[_0xff3e2d(0x19f)]=_0x5de633),_0x31eab8;}function collectSegmentIdsFromJourney(_0x356a54,_0x3a98ea){const _0x4639e6=a147_0x156b;_0x356a54[_0x4639e6(0x21f)]?.[_0x4639e6(0x204)]&&_0x3a98ea[_0x4639e6(0x16d)](_0x356a54[_0x4639e6(0x21f)]['segment']);const _0x34e2ba=_0xbca5cf=>{const _0x28585c=_0x4639e6;for(const _0x529042 of _0xbca5cf){_0x529042['entry_criteria']?.['segment']&&_0x3a98ea['add'](_0x529042[_0x28585c(0x1d3)][_0x28585c(0x204)]);if(_0x529042[_0x28585c(0x18f)])for(const _0x2792a1 of _0x529042['exit_criteria']){_0x2792a1[_0x28585c(0x204)]&&_0x3a98ea[_0x28585c(0x16d)](_0x2792a1[_0x28585c(0x204)]);}_0x529042[_0x28585c(0x1e4)]?.['segment']&&_0x3a98ea[_0x28585c(0x16d)](_0x529042['milestone'][_0x28585c(0x204)]);if(_0x529042[_0x28585c(0x17f)])for(const _0x33cc5c of _0x529042[_0x28585c(0x17f)]){if(_0x33cc5c[_0x28585c(0x1dd)]===_0x28585c(0x1c3)){const _0x487a4c=_0x33cc5c;for(const _0xbfcd06 of _0x487a4c[_0x28585c(0x1b9)][_0x28585c(0x1ee)]){_0xbfcd06[_0x28585c(0x204)]&&_0x3a98ea[_0x28585c(0x16d)](_0xbfcd06[_0x28585c(0x204)]);}}else{if(_0x33cc5c[_0x28585c(0x1dd)]===_0x28585c(0x1e8)){const _0x938423=_0x33cc5c;_0x938423['with']['condition']?.['segment']&&_0x3a98ea[_0x28585c(0x16d)](_0x938423[_0x28585c(0x1b9)][_0x28585c(0x1b0)][_0x28585c(0x204)]);}}}}};if(_0x356a54[_0x4639e6(0x1e7)])for(const _0x499061 of _0x356a54[_0x4639e6(0x1e7)]){_0x499061['goal']?.[_0x4639e6(0x204)]&&_0x3a98ea[_0x4639e6(0x16d)](_0x499061[_0x4639e6(0x21f)][_0x4639e6(0x204)]),_0x34e2ba(_0x499061[_0x4639e6(0x1d7)]);}_0x356a54[_0x4639e6(0x1d7)]&&_0x34e2ba(_0x356a54['stages']);if(_0x356a54['versions'])for(const _0x8c8b5f of _0x356a54[_0x4639e6(0x21b)]){_0x34e2ba(_0x8c8b5f[_0x4639e6(0x1d7)]);}}function replaceSegmentIdsInJourney(_0x344b1b,_0x5dba22){const _0x38e5e5=a147_0x156b,_0x569568=_0x1af9b8=>_0x5dba22[_0x38e5e5(0x1a1)](_0x1af9b8)||_0x1af9b8;_0x344b1b['goal']?.[_0x38e5e5(0x204)]&&(_0x344b1b[_0x38e5e5(0x21f)][_0x38e5e5(0x204)]=_0x569568(_0x344b1b[_0x38e5e5(0x21f)]['segment']));const _0x50e3e7=_0x47457a=>{const _0x187582=_0x38e5e5;for(const _0x15fd5d of _0x47457a){_0x15fd5d[_0x187582(0x1d3)]?.['segment']&&(_0x15fd5d[_0x187582(0x1d3)][_0x187582(0x204)]=_0x569568(_0x15fd5d[_0x187582(0x1d3)][_0x187582(0x204)]));if(_0x15fd5d[_0x187582(0x18f)])for(const _0x4d8392 of _0x15fd5d[_0x187582(0x18f)]){_0x4d8392['segment']&&(_0x4d8392['segment']=_0x569568(_0x4d8392[_0x187582(0x204)]));}_0x15fd5d[_0x187582(0x1e4)]?.[_0x187582(0x204)]&&(_0x15fd5d[_0x187582(0x1e4)]['segment']=_0x569568(_0x15fd5d[_0x187582(0x1e4)]['segment']));if(_0x15fd5d[_0x187582(0x17f)])for(const _0x18dc84 of _0x15fd5d['steps']){if(_0x18dc84[_0x187582(0x1dd)]===_0x187582(0x1c3)){const _0xd9f5a0=_0x18dc84;for(const _0x242a1d of _0xd9f5a0[_0x187582(0x1b9)][_0x187582(0x1ee)]){_0x242a1d[_0x187582(0x204)]&&(_0x242a1d[_0x187582(0x204)]=_0x569568(_0x242a1d[_0x187582(0x204)]));}}else{if(_0x18dc84[_0x187582(0x1dd)]===_0x187582(0x1e8)){const _0x2eda9c=_0x18dc84;_0x2eda9c[_0x187582(0x1b9)][_0x187582(0x1b0)]?.[_0x187582(0x204)]&&(_0x2eda9c[_0x187582(0x1b9)][_0x187582(0x1b0)][_0x187582(0x204)]=_0x569568(_0x2eda9c[_0x187582(0x1b9)]['condition'][_0x187582(0x204)]));}}}}};if(_0x344b1b[_0x38e5e5(0x1e7)])for(const _0x165a7c of _0x344b1b['journeys']){_0x165a7c['goal']?.[_0x38e5e5(0x204)]&&(_0x165a7c['goal'][_0x38e5e5(0x204)]=_0x569568(_0x165a7c[_0x38e5e5(0x21f)][_0x38e5e5(0x204)])),_0x50e3e7(_0x165a7c['stages']);}_0x344b1b['stages']&&_0x50e3e7(_0x344b1b['stages']);if(_0x344b1b[_0x38e5e5(0x21b)])for(const _0xd39081 of _0x344b1b['versions']){_0x50e3e7(_0xd39081[_0x38e5e5(0x1d7)]);}}function collectActivationIdsFromJourney(_0x29abcc,_0x21b782){const _0x59591b=a147_0x156b,_0x21323f=_0x19dd4c=>{const _0x58e22c=a147_0x156b;for(const _0x44ede9 of _0x19dd4c){if(_0x44ede9[_0x58e22c(0x17f)])for(const _0x38000e of _0x44ede9[_0x58e22c(0x17f)]){if(_0x38000e['type']===_0x58e22c(0x1c5)){const _0xf5b9c4=_0x38000e;_0xf5b9c4[_0x58e22c(0x1b9)][_0x58e22c(0x1c5)]&&/^\d+$/[_0x58e22c(0x1df)](_0xf5b9c4['with'][_0x58e22c(0x1c5)])&&_0x21b782[_0x58e22c(0x16d)](_0xf5b9c4[_0x58e22c(0x1b9)][_0x58e22c(0x1c5)]);}}}};if(_0x29abcc['journeys'])for(const _0x4755a5 of _0x29abcc[_0x59591b(0x1e7)]){_0x21323f(_0x4755a5[_0x59591b(0x1d7)]);}_0x29abcc[_0x59591b(0x1d7)]&&_0x21323f(_0x29abcc[_0x59591b(0x1d7)]);if(_0x29abcc[_0x59591b(0x21b)])for(const _0x43ac81 of _0x29abcc[_0x59591b(0x21b)]){_0x21323f(_0x43ac81[_0x59591b(0x1d7)]);}}function replaceActivationIdsInJourney(_0x263c41,_0x59f0e6){const _0x350d80=a147_0x156b,_0x4ac9e0=_0x55a32b=>_0x59f0e6[_0x350d80(0x1a1)](_0x55a32b)||_0x55a32b,_0x215df3=_0x2c62a9=>{const _0x141728=_0x350d80;for(const _0x4121de of _0x2c62a9){if(_0x4121de['steps'])for(const _0x1e6e2c of _0x4121de[_0x141728(0x17f)]){if(_0x1e6e2c[_0x141728(0x1dd)]===_0x141728(0x1c5)){const _0x24e04d=_0x1e6e2c;_0x24e04d[_0x141728(0x1b9)][_0x141728(0x1c5)]&&(_0x24e04d[_0x141728(0x1b9)]['activation']=_0x4ac9e0(_0x24e04d[_0x141728(0x1b9)][_0x141728(0x1c5)]));}}}};if(_0x263c41[_0x350d80(0x1e7)])for(const _0x6c1d38 of _0x263c41['journeys']){_0x215df3(_0x6c1d38[_0x350d80(0x1d7)]);}_0x263c41['stages']&&_0x215df3(_0x263c41[_0x350d80(0x1d7)]);if(_0x263c41['versions'])for(const _0x2efaad of _0x263c41[_0x350d80(0x21b)]){_0x215df3(_0x2efaad[_0x350d80(0x1d7)]);}}function collectJumpTargetsFromJourney(_0xdf01d6,_0x595d44){const _0x177aaf=a147_0x156b,_0x1aeb19=new Set(),_0x440f89=_0x157b3f=>{const _0x3b8919=a147_0x156b;for(const _0x235611 of _0x157b3f){if(_0x235611[_0x3b8919(0x17f)])for(const _0x50f039 of _0x235611['steps']){if(_0x50f039['type']===_0x3b8919(0x192)){const _0x52ed6b=_0x50f039,_0x3e237c=_0x52ed6b[_0x3b8919(0x1b9)][_0x3b8919(0x18c)];if(_0x3e237c[_0x3b8919(0x19b)]&&_0x3e237c[_0x3b8919(0x188)]&&/^\d+$/[_0x3b8919(0x1df)](_0x3e237c[_0x3b8919(0x19b)])&&/^\d+$/[_0x3b8919(0x1df)](_0x3e237c[_0x3b8919(0x188)])){const _0x1634ec=_0x3e237c['journey']+':'+_0x3e237c[_0x3b8919(0x188)];!_0x1aeb19['has'](_0x1634ec)&&(_0x1aeb19[_0x3b8919(0x16d)](_0x1634ec),_0x595d44['push']({'journeyId':_0x3e237c[_0x3b8919(0x19b)],'stageId':_0x3e237c[_0x3b8919(0x188)]}));}}}}};if(_0xdf01d6[_0x177aaf(0x1e7)])for(const _0x51bed8 of _0xdf01d6[_0x177aaf(0x1e7)]){_0x440f89(_0x51bed8['stages']);}_0xdf01d6[_0x177aaf(0x1d7)]&&_0x440f89(_0xdf01d6[_0x177aaf(0x1d7)]);if(_0xdf01d6[_0x177aaf(0x21b)])for(const _0x45c670 of _0xdf01d6[_0x177aaf(0x21b)]){_0x440f89(_0x45c670[_0x177aaf(0x1d7)]);}}function replaceJumpTargetsInJourney(_0x7638fe,_0x3ff438){const _0x13f458=a147_0x156b,_0x5b95fd=_0x228727=>{const _0x3bb2d3=a147_0x156b;for(const _0x2a0d22 of _0x228727){if(_0x2a0d22['steps'])for(const _0x4715d0 of _0x2a0d22[_0x3bb2d3(0x17f)]){if(_0x4715d0[_0x3bb2d3(0x1dd)]===_0x3bb2d3(0x192)){const _0x99cfc5=_0x4715d0,_0x562fab=_0x99cfc5[_0x3bb2d3(0x1b9)][_0x3bb2d3(0x18c)],_0x1ccdeb=_0x562fab['journey']+':'+_0x562fab['stage'],_0xed68f7=_0x3ff438[_0x3bb2d3(0x1a1)](_0x1ccdeb);_0xed68f7&&(_0x562fab[_0x3bb2d3(0x19b)]=_0xed68f7[_0x3bb2d3(0x1e3)],_0x562fab['stage']=_0xed68f7[_0x3bb2d3(0x191)]);}}}};if(_0x7638fe[_0x13f458(0x1e7)])for(const _0x429122 of _0x7638fe[_0x13f458(0x1e7)]){_0x5b95fd(_0x429122[_0x13f458(0x1d7)]);}_0x7638fe[_0x13f458(0x1d7)]&&_0x5b95fd(_0x7638fe[_0x13f458(0x1d7)]);if(_0x7638fe[_0x13f458(0x21b)])for(const _0x26fe52 of _0x7638fe[_0x13f458(0x21b)]){_0x5b95fd(_0x26fe52[_0x13f458(0x1d7)]);}}function generateReadableStepName(_0x3ac71c,_0x34798c){const _0x4f39ab=a147_0x156b;if(_0x3ac71c[_0x4f39ab(0x1de)]&&_0x3ac71c[_0x4f39ab(0x1de)]!==_0x3ac71c['type']){const _0x1d6d57=_0x3ac71c[_0x4f39ab(0x1de)][_0x4f39ab(0x199)]();if(_0x1d6d57&&/[a-z0-9\p{L}]/iu[_0x4f39ab(0x1df)](_0x1d6d57))return _0x1d6d57;}const _0x12dc9b=_0x3ac71c['type'][_0x4f39ab(0x1d6)]()[_0x4f39ab(0x19c)](/step$/i,'');return _0x12dc9b+'_'+(_0x34798c+0x1);}function getStepNextRefs(_0x235a06){const _0x1b00b0=a147_0x156b,_0x221aa4=[];if(_0x235a06['next'])_0x221aa4[_0x1b00b0(0x1db)](_0x235a06[_0x1b00b0(0x1c8)]);if(_0x235a06[_0x1b00b0(0x1ee)])for(const _0xd70d86 of _0x235a06['branches']){if(_0xd70d86[_0x1b00b0(0x1c8)])_0x221aa4[_0x1b00b0(0x1db)](_0xd70d86['next']);}if(_0x235a06[_0x1b00b0(0x187)])for(const _0x17216a of _0x235a06[_0x1b00b0(0x187)]){if(_0x17216a[_0x1b00b0(0x1c8)])_0x221aa4[_0x1b00b0(0x1db)](_0x17216a[_0x1b00b0(0x1c8)]);}if(_0x235a06['conditions'])for(const _0x5df082 of _0x235a06[_0x1b00b0(0x1aa)]){if(_0x5df082[_0x1b00b0(0x1c8)])_0x221aa4[_0x1b00b0(0x1db)](_0x5df082[_0x1b00b0(0x1c8)]);}return _0x221aa4;}function parseJumpTargetDisplayName(_0x3918eb){const _0x33d185=a147_0x156b,_0x4528eb=_0x3918eb['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x4528eb)return undefined;const _0xb4b035=_0x4528eb[0x1][_0x33d185(0x199)](),_0xb174ea=_0x4528eb[0x2][_0x33d185(0x199)]();if(!_0xb4b035||!_0xb174ea)return undefined;return{'stageName':_0xb4b035,'journeyName':_0xb174ea};}function orderStepsFromRoot(_0x8303e4,_0x44a95d){const _0x2464c7=a147_0x156b,_0x15670d=Object[_0x2464c7(0x1dc)](_0x8303e4);if(_0x15670d[_0x2464c7(0x1ab)]===0x0)return[];const _0x428e3d=new Set(_0x15670d[_0x2464c7(0x217)](([_0x1aa4fd])=>_0x1aa4fd)),_0x3a5f7f=new Set();for(const [,_0x507a97]of _0x15670d){for(const _0x99708e of getStepNextRefs(_0x507a97)){if(_0x428e3d[_0x2464c7(0x1e5)](_0x99708e))_0x3a5f7f[_0x2464c7(0x16d)](_0x99708e);}}let _0x1cf8ab=_0x44a95d&&_0x428e3d[_0x2464c7(0x1e5)](_0x44a95d)?_0x44a95d:undefined;if(!_0x1cf8ab){const _0x3d86b0=_0x15670d[_0x2464c7(0x172)](([_0x389934])=>!_0x3a5f7f[_0x2464c7(0x1e5)](_0x389934));_0x3d86b0['length']>0x0?_0x1cf8ab=_0x3d86b0[0x0][0x0]:_0x1cf8ab=_0x15670d[0x0][0x0];}const _0x59e5e7=[],_0x3930d1=new Set(),_0x459546=[_0x1cf8ab];while(_0x459546[_0x2464c7(0x1ab)]>0x0){const _0x4f5c96=_0x459546[_0x2464c7(0x203)]();if(_0x3930d1['has'](_0x4f5c96))continue;_0x3930d1[_0x2464c7(0x16d)](_0x4f5c96);const _0x34047e=_0x8303e4[_0x4f5c96];if(!_0x34047e)continue;_0x59e5e7[_0x2464c7(0x1db)]({'uuid':_0x4f5c96,'step':_0x34047e});for(const _0xba2411 of getStepNextRefs(_0x34047e)){_0x428e3d[_0x2464c7(0x1e5)](_0xba2411)&&!_0x3930d1[_0x2464c7(0x1e5)](_0xba2411)&&_0x459546[_0x2464c7(0x1db)](_0xba2411);}}for(const [_0x13f79a,_0x44d88e]of _0x15670d){!_0x3930d1[_0x2464c7(0x1e5)](_0x13f79a)&&_0x59e5e7[_0x2464c7(0x1db)]({'uuid':_0x13f79a,'step':_0x44d88e});}return _0x59e5e7;}function resolveStepReferences(_0x3348dc,_0x5ed7a1,_0x4ff81e,_0x4b14d9){const _0x5cdf4c=a147_0x156b;if(_0x3348dc['type']!==_0x5cdf4c(0x1bd)){_0x3348dc['next']&&_0x4b14d9[_0x5cdf4c(0x1e5)](_0x3348dc['next'])&&(_0x3348dc['next']=_0x4b14d9[_0x5cdf4c(0x1a1)](_0x3348dc[_0x5cdf4c(0x1c8)]));const _0x5855ff=_0x5ed7a1+0x1;if(_0x5855ff<_0x4ff81e[_0x5cdf4c(0x1ab)]){const _0x2f9e93=_0x4b14d9[_0x5cdf4c(0x1a1)](_0x4ff81e[_0x5855ff][_0x5cdf4c(0x184)]);_0x3348dc['next']===_0x2f9e93&&delete _0x3348dc[_0x5cdf4c(0x1c8)];}}if(_0x3348dc[_0x5cdf4c(0x1dd)]===_0x5cdf4c(0x1c3))for(const _0x598945 of _0x3348dc[_0x5cdf4c(0x1b9)][_0x5cdf4c(0x1ee)]){_0x598945[_0x5cdf4c(0x1c8)]&&_0x4b14d9['has'](_0x598945[_0x5cdf4c(0x1c8)])&&(_0x598945['next']=_0x4b14d9['get'](_0x598945[_0x5cdf4c(0x1c8)]));}if(_0x3348dc[_0x5cdf4c(0x1dd)]===_0x5cdf4c(0x201))for(const _0x4ea46f of _0x3348dc['with']['variants']){_0x4ea46f[_0x5cdf4c(0x1c8)]&&_0x4b14d9[_0x5cdf4c(0x1e5)](_0x4ea46f['next'])&&(_0x4ea46f[_0x5cdf4c(0x1c8)]=_0x4b14d9['get'](_0x4ea46f['next']));}if(_0x3348dc[_0x5cdf4c(0x1dd)]===_0x5cdf4c(0x1e8)&&_0x3348dc[_0x5cdf4c(0x1b9)][_0x5cdf4c(0x1b0)]){const _0x155468=_0x3348dc['with'][_0x5cdf4c(0x1b0)];_0x155468[_0x5cdf4c(0x1c8)]&&_0x4b14d9[_0x5cdf4c(0x1e5)](_0x155468[_0x5cdf4c(0x1c8)])&&(_0x155468[_0x5cdf4c(0x1c8)]=_0x4b14d9['get'](_0x155468[_0x5cdf4c(0x1c8)])),_0x155468[_0x5cdf4c(0x1d2)]?.[_0x5cdf4c(0x1c8)]&&_0x4b14d9['has'](_0x155468['timeout'][_0x5cdf4c(0x1c8)])&&(_0x155468['timeout'][_0x5cdf4c(0x1c8)]=_0x4b14d9[_0x5cdf4c(0x1a1)](_0x155468['timeout'][_0x5cdf4c(0x1c8)]));}}function convertApiStageToYaml(_0x3c5299){const _0xcb535c=a147_0x156b,_0x2706a3={'name':_0x3c5299[_0xcb535c(0x1de)]};_0x3c5299['id']&&(_0x2706a3['id']=_0x3c5299['id']);_0x3c5299['description']&&(_0x2706a3['description']=_0x3c5299[_0xcb535c(0x1b5)]);_0x3c5299[_0xcb535c(0x20a)]&&(_0x2706a3[_0xcb535c(0x1d3)]=convertApiCriteriaToYaml(_0x3c5299[_0xcb535c(0x20a)]));_0x3c5299[_0xcb535c(0x1ba)]&&_0x3c5299['exitCriterias'][_0xcb535c(0x1ab)]>0x0&&(_0x2706a3[_0xcb535c(0x18f)]=_0x3c5299[_0xcb535c(0x1ba)][_0xcb535c(0x217)](convertApiCriteriaToYaml));_0x3c5299['milestone']&&(_0x2706a3[_0xcb535c(0x1e4)]=convertApiCriteriaToYaml(_0x3c5299[_0xcb535c(0x1e4)]));if(_0x3c5299['steps']&&Object[_0xcb535c(0x193)](_0x3c5299[_0xcb535c(0x17f)])[_0xcb535c(0x1ab)]>0x0){const _0x10795a=orderStepsFromRoot(_0x3c5299[_0xcb535c(0x17f)],_0x3c5299[_0xcb535c(0x1c9)]),_0x5d1ffc=new Map(),_0x33327b=new Set();for(let _0x45736d=0x0;_0x45736d<_0x10795a[_0xcb535c(0x1ab)];_0x45736d++){const {uuid:_0x1853ee,step:_0x593ea4}=_0x10795a[_0x45736d];let _0x1ad23a=generateReadableStepName(_0x593ea4,_0x45736d),_0xa91f12=_0x1ad23a,_0x26ed37=0x2;while(_0x33327b['has'](_0xa91f12)){_0xa91f12=_0x1ad23a+'_'+_0x26ed37,_0x26ed37++;}_0x33327b[_0xcb535c(0x16d)](_0xa91f12),_0x5d1ffc[_0xcb535c(0x1d9)](_0x1853ee,_0xa91f12);}_0x2706a3[_0xcb535c(0x17f)]=_0x10795a[_0xcb535c(0x217)](({uuid:_0x51e2ea,step:_0x35d8f5},_0x39f20a)=>{const _0xe8bfa4=_0xcb535c,_0x2867ec=convertApiStepToYaml(_0x35d8f5,_0x5d1ffc[_0xe8bfa4(0x1a1)](_0x51e2ea));return resolveStepReferences(_0x2867ec,_0x39f20a,_0x10795a,_0x5d1ffc),_0x2867ec;});}return _0x2706a3;}function convertApiCriteriaToYaml(_0x2792c3){const _0x1d9ca6=a147_0x156b,_0x122867={'name':_0x2792c3[_0x1d9ca6(0x1de)],'segment':_0x2792c3['segmentId']};_0x2792c3[_0x1d9ca6(0x1b5)]&&(_0x122867['description']=_0x2792c3[_0x1d9ca6(0x1b5)]);if(_0x2792c3[_0x1d9ca6(0x18c)]){let _0x1bbcf3=_0x2792c3[_0x1d9ca6(0x18c)][_0x1d9ca6(0x21a)],_0x515f96=_0x2792c3['target'][_0x1d9ca6(0x189)];if(_0x2792c3[_0x1d9ca6(0x18c)][_0x1d9ca6(0x1e3)]){const _0x3e0678=parseJumpTargetDisplayName(_0x2792c3[_0x1d9ca6(0x18c)]['journeyName']);_0x3e0678&&(_0x515f96=_0x3e0678[_0x1d9ca6(0x191)],_0x1bbcf3=_0x3e0678['journeyName']);}_0x122867['target']={'journey':_0x1bbcf3,'stage':_0x515f96},_0x2792c3['target']['journeyBundleId']&&(_0x122867[_0x1d9ca6(0x18c)]['bundle_id']=_0x2792c3[_0x1d9ca6(0x18c)][_0x1d9ca6(0x225)]);}return _0x122867;}function convertApiStepToYaml(_0x59afeb,_0x3944d3){const _0x405a8a=a147_0x156b;switch(_0x59afeb['type']){case _0x405a8a(0x215):{const _0x4f35fc={};if(_0x59afeb[_0x405a8a(0x17b)]===_0x405a8a(0x1c1)&&_0x59afeb['waitStep']!==undefined)_0x4f35fc['duration']=_0x59afeb['waitStep'],_0x4f35fc['unit']=_0x59afeb['waitStepUnit'];else{if(_0x59afeb['waitStepType']===_0x405a8a(0x205)&&_0x59afeb[_0x405a8a(0x1f0)])_0x4f35fc[_0x405a8a(0x21e)]=_0x59afeb[_0x405a8a(0x1f0)];else{if(_0x59afeb[_0x405a8a(0x17b)]===_0x405a8a(0x1be)&&_0x59afeb[_0x405a8a(0x224)])_0x4f35fc[_0x405a8a(0x213)]=_0x59afeb[_0x405a8a(0x224)];else{if(_0x59afeb[_0x405a8a(0x17b)]==='Condition'){if(_0x59afeb[_0x405a8a(0x1aa)]&&_0x59afeb[_0x405a8a(0x1aa)][_0x405a8a(0x1ab)]>0x0){const _0x9bf820=_0x59afeb[_0x405a8a(0x1aa)][_0x405a8a(0x197)](_0x21c10e=>!_0x21c10e[_0x405a8a(0x1a4)]),_0x45fd8e=_0x59afeb[_0x405a8a(0x1aa)][_0x405a8a(0x197)](_0x274306=>_0x274306['timedOutPath']);_0x9bf820?.[_0x405a8a(0x18a)]&&(_0x4f35fc[_0x405a8a(0x1b0)]={'segment':_0x9bf820[_0x405a8a(0x18a)],..._0x9bf820[_0x405a8a(0x1c8)]?{'next':_0x9bf820[_0x405a8a(0x1c8)]}:{}},_0x45fd8e&&_0x45fd8e[_0x405a8a(0x1cf)]!==undefined&&_0x45fd8e[_0x405a8a(0x1bc)]&&(_0x4f35fc['condition'][_0x405a8a(0x1d2)]={'duration':_0x45fd8e[_0x405a8a(0x1cf)],'unit':_0x45fd8e['unit'],..._0x45fd8e[_0x405a8a(0x1c8)]?{'next':_0x45fd8e[_0x405a8a(0x1c8)]}:{}}));}else _0x59afeb['conditionSegmentId']&&(_0x4f35fc[_0x405a8a(0x1b0)]={'segment':_0x59afeb[_0x405a8a(0x211)]},_0x59afeb['conditionTimeoutDuration']!==undefined&&_0x59afeb[_0x405a8a(0x1a9)]&&(_0x4f35fc[_0x405a8a(0x1b0)]['timeout']={'duration':_0x59afeb['conditionTimeoutDuration'],'unit':_0x59afeb[_0x405a8a(0x1a9)]}));}}}}const _0x20713a={'type':'wait','name':_0x3944d3,..._0x59afeb['next']?{'next':_0x59afeb['next']}:{},'with':_0x4f35fc};return _0x20713a;}case _0x405a8a(0x1a0):{const _0x5ec400={'type':_0x405a8a(0x1c5),'name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'activation':_0x59afeb[_0x405a8a(0x196)]||''}};return _0x5ec400;}case'DecisionPoint':{const _0x12a535={'type':_0x405a8a(0x1c3),'name':_0x3944d3,..._0x59afeb['next']?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'branches':(_0x59afeb[_0x405a8a(0x1ee)]||[])[_0x405a8a(0x217)](_0x2d16a9=>({'name':_0x2d16a9[_0x405a8a(0x1de)],'segment':_0x2d16a9[_0x405a8a(0x18a)],'excluded':_0x2d16a9['excludedPath'],..._0x2d16a9['next']?{'next':_0x2d16a9[_0x405a8a(0x1c8)]}:{}}))}};return _0x12a535;}case _0x405a8a(0x1c2):case _0x405a8a(0x1b2):case'Variant':{const _0x526753=_0x59afeb[_0x405a8a(0x187)]||(_0x59afeb[_0x405a8a(0x1ee)]||[])[_0x405a8a(0x217)](_0x4d4d2d=>({'name':_0x4d4d2d[_0x405a8a(0x1de)],'percentage':0x0,'next':_0x4d4d2d[_0x405a8a(0x1c8)]})),_0x3667b8={'type':'ab_test','name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'customized_split':_0x59afeb[_0x405a8a(0x1a7)],'unique_id':_0x59afeb[_0x405a8a(0x1cb)],'variants':_0x526753['map'](_0x385565=>({'name':_0x385565[_0x405a8a(0x1de)],'percentage':_0x385565['percentage'],..._0x385565[_0x405a8a(0x1c8)]?{'next':_0x385565[_0x405a8a(0x1c8)]}:{}}))}};return _0x3667b8;}case _0x405a8a(0x19d):{const _0x36cf34={'type':_0x405a8a(0x1c4),'name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{}};return _0x36cf34;}case'Jump':{let _0x4f4559='',_0x187240='',_0x38ec75;if(_0x59afeb[_0x405a8a(0x18c)]){_0x4f4559=_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x21a)],_0x187240=_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x189)],_0x38ec75=_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x225)];if(_0x59afeb[_0x405a8a(0x18c)][_0x405a8a(0x1e3)]){const _0x4e282a=parseJumpTargetDisplayName(_0x59afeb[_0x405a8a(0x18c)]['journeyName']);_0x4e282a&&(_0x187240=_0x4e282a[_0x405a8a(0x191)],_0x4f4559=_0x4e282a[_0x405a8a(0x1e3)]);}}const _0x49176e={'type':_0x405a8a(0x192),'name':_0x3944d3,..._0x59afeb[_0x405a8a(0x1c8)]?{'next':_0x59afeb[_0x405a8a(0x1c8)]}:{},'with':{'target':{'journey':_0x4f4559,'stage':_0x187240,..._0x38ec75?{'bundle_id':_0x38ec75}:{}}}};return _0x49176e;}case _0x405a8a(0x1cc):{const _0x156129={'type':_0x405a8a(0x1bd),'name':_0x3944d3};return _0x156129;}default:{const _0x1c5cbf={'type':_0x405a8a(0x1bd),'name':_0x3944d3};return _0x1c5cbf;}}}export async function journeyDefToRequest(_0x21b978,_0x2dd795,_0xf15d8){const _0x104dbf=a147_0x156b,_0x3763b6=_0x21b978['stages']||getActiveStages(_0x21b978),_0x58ba79=isJourneysArrayMode(_0x21b978)||isMultiVersionMode(_0x21b978)?getLatestJourneyEntry(_0x21b978):undefined,_0x2cf405=_0x58ba79?.[_0x104dbf(0x202)]??_0x21b978[_0x104dbf(0x1de)],_0x227827=_0x21b978[_0x104dbf(0x1e9)]||{},_0x5e6e28=_0x21b978[_0x104dbf(0x19f)]||{},_0x2ca28c={'type':_0x104dbf(0x19b),'attributes':{'name':_0x2cf405,'audienceId':_0x2dd795,'journeyStages':await Promise[_0x104dbf(0x1ac)](_0x3763b6[_0x104dbf(0x217)](_0x332f81=>convertYamlStageToApi(_0x332f81,_0xf15d8,_0x227827,_0x5e6e28)))}},_0x585685=_0x58ba79?.['id']??_0x21b978['id'];_0x585685&&(_0x2ca28c['id']=_0x585685);_0x21b978[_0x104dbf(0x1b5)]&&(_0x2ca28c['attributes'][_0x104dbf(0x1b5)]=_0x21b978['description']);const _0x51ce81=getEffectiveGoal(_0x21b978);_0x51ce81&&(_0x2ca28c[_0x104dbf(0x1b1)]['goal']=await convertYamlCriteriaToApi(_0x51ce81,_0xf15d8,_0x227827));const _0x2b8905=getEffectiveReentry(_0x21b978);return _0x2b8905&&(_0x2ca28c[_0x104dbf(0x1b1)][_0x104dbf(0x1b6)]=_0x2b8905,_0x2ca28c['attributes'][_0x104dbf(0x1a6)]=_0x2b8905!==_0x104dbf(0x1d8)),_0x21b978[_0x104dbf(0x17e)]&&(_0x2ca28c[_0x104dbf(0x174)]={'parentFolder':{'data':{'id':_0x21b978[_0x104dbf(0x17e)],'type':'folder'}}}),_0x2ca28c;}async function convertYamlStageToApi(_0x5e0013,_0x1b5c1e,_0x58851c={},_0x4b89fe={}){const _0x520e10=a147_0x156b,_0x32b09f={'name':_0x5e0013[_0x520e10(0x1de)]};_0x5e0013['id']&&(_0x32b09f['id']=_0x5e0013['id']);_0x5e0013[_0x520e10(0x1b5)]&&(_0x32b09f[_0x520e10(0x1b5)]=_0x5e0013[_0x520e10(0x1b5)]);_0x5e0013['entry_criteria']&&(_0x32b09f[_0x520e10(0x20a)]=await convertYamlCriteriaToApi(_0x5e0013[_0x520e10(0x1d3)],_0x1b5c1e,_0x58851c));_0x5e0013[_0x520e10(0x18f)]&&_0x5e0013[_0x520e10(0x18f)]['length']>0x0&&(_0x32b09f['exitCriterias']=await Promise[_0x520e10(0x1ac)](_0x5e0013[_0x520e10(0x18f)]['map'](_0x33e5e0=>convertYamlCriteriaToApi(_0x33e5e0,_0x1b5c1e,_0x58851c))));_0x5e0013[_0x520e10(0x1e4)]&&(_0x32b09f[_0x520e10(0x1e4)]=await convertYamlCriteriaToApi(_0x5e0013['milestone'],_0x1b5c1e,_0x58851c));if(_0x5e0013[_0x520e10(0x17f)]&&_0x5e0013[_0x520e10(0x17f)][_0x520e10(0x1ab)]>0x0){const _0x36ccdc={},_0x3f11db=_0x5e0013[_0x520e10(0x17f)][_0x520e10(0x217)]((_0x3add33,_0x3cfea2)=>{const _0x403e95=_0x520e10,_0x14b574=_0x3add33[_0x403e95(0x184)]||generateUUID(),_0x8081eb=_0x3add33[_0x403e95(0x1de)]||_0x3add33[_0x403e95(0x1dd)]+'_'+_0x3cfea2;return _0x36ccdc[_0x8081eb]=_0x14b574,{..._0x3add33,'name':_0x8081eb};});_0x32b09f[_0x520e10(0x1c9)]=_0x36ccdc[_0x3f11db[0x0][_0x520e10(0x1de)]],_0x32b09f['steps']={};for(let _0x308df7=0x0;_0x308df7<_0x3f11db[_0x520e10(0x1ab)];_0x308df7++){const _0x33b6d6=_0x3f11db[_0x308df7],_0x3d4397=_0x36ccdc[_0x33b6d6[_0x520e10(0x1de)]],_0x4ff592=!_0x33b6d6[_0x520e10(0x1c8)]&&_0x308df7<_0x3f11db['length']-0x1&&_0x33b6d6[_0x520e10(0x1dd)]!==_0x520e10(0x1bd)?_0x3f11db[_0x308df7+0x1]['name']:_0x33b6d6[_0x520e10(0x1c8)],_0x46087d=_0x4ff592!==_0x33b6d6['next']?{..._0x33b6d6,'next':_0x4ff592}:_0x33b6d6;_0x32b09f[_0x520e10(0x17f)][_0x3d4397]=await convertYamlStepToApi(_0x46087d,_0x1b5c1e,_0x58851c,_0x36ccdc,_0x4b89fe);}}else _0x5e0013[_0x520e10(0x198)]&&(_0x32b09f[_0x520e10(0x1c9)]=_0x5e0013['root_step']);return _0x32b09f;}async function convertYamlCriteriaToApi(_0x221f48,_0x191741,_0x4bbc6a={}){const _0x56f605=a147_0x156b;let _0x44161a=_0x221f48[_0x56f605(0x204)];if(_0x44161a&&!/^\d+$/[_0x56f605(0x1df)](_0x44161a)){const _0x5f1473=parseSegmentRef(_0x44161a);if(_0x5f1473[_0x56f605(0x1dd)]===_0x56f605(0x20c))_0x191741?.[_0x56f605(0x206)]&&(_0x44161a=await _0x191741[_0x56f605(0x206)](_0x5f1473[_0x56f605(0x1de)]));else{if(_0x5f1473[_0x56f605(0x1dd)]===_0x56f605(0x1f7)&&_0x4bbc6a[_0x5f1473[_0x56f605(0x1de)]])_0x191741?.[_0x56f605(0x19a)]&&(_0x44161a=await _0x191741[_0x56f605(0x19a)](_0x5f1473['name'],_0x4bbc6a[_0x5f1473[_0x56f605(0x1de)]]));else _0x191741?.[_0x56f605(0x206)]&&(_0x44161a=await _0x191741[_0x56f605(0x206)](_0x5f1473['name']));}}const _0x4d160f={'name':_0x221f48[_0x56f605(0x1de)],'segmentId':_0x44161a};_0x221f48[_0x56f605(0x1b5)]&&(_0x4d160f[_0x56f605(0x1b5)]=_0x221f48['description']);if(_0x221f48[_0x56f605(0x18c)]){const _0x2f6984=_0x221f48[_0x56f605(0x18c)][_0x56f605(0x19b)],_0x445ef4=_0x221f48['target'][_0x56f605(0x188)];let _0x12f527=_0x221f48['target'][_0x56f605(0x19b)];_0x191741?.[_0x56f605(0x1b8)]&&!/^\d+$/[_0x56f605(0x1df)](_0x12f527)&&(_0x12f527=await _0x191741['resolveJourneyId'](_0x12f527));let _0x691a4c=_0x221f48[_0x56f605(0x18c)][_0x56f605(0x188)];_0x191741?.['resolveStageId']&&!/^\d+$/['test'](_0x691a4c)&&(_0x691a4c=await _0x191741[_0x56f605(0x16c)](_0x12f527,_0x691a4c));const _0x3cf65a=!/^\d+$/['test'](_0x2f6984)&&!isLocalJourneyRef(_0x2f6984)?formatApiJourneyName(_0x2f6984,_0x445ef4):undefined;_0x4d160f[_0x56f605(0x18c)]={'journeyId':_0x12f527,'journeyStageId':_0x691a4c,'journeyName':_0x3cf65a,'confirmed':!![]},_0x221f48['target'][_0x56f605(0x207)]&&(_0x4d160f[_0x56f605(0x18c)][_0x56f605(0x225)]=_0x221f48[_0x56f605(0x18c)]['bundle_id']);}return _0x4d160f;}async function convertYamlStepToApi(_0x3b8c64,_0x43ef3f,_0x2cda7b={},_0x4a5494={},_0x1afc0a={}){const _0x3979a6=a147_0x156b,_0x5da310=async _0x20a5aa=>{const _0x560a56=a147_0x156b;if(/^\d+$/[_0x560a56(0x1df)](_0x20a5aa))return _0x20a5aa;const _0x482223=parseSegmentRef(_0x20a5aa);if(_0x482223[_0x560a56(0x1dd)]==='ref'){if(_0x43ef3f?.[_0x560a56(0x206)])return await _0x43ef3f[_0x560a56(0x206)](_0x482223[_0x560a56(0x1de)]);}else{if(_0x482223[_0x560a56(0x1dd)]===_0x560a56(0x1f7)&&_0x2cda7b[_0x482223[_0x560a56(0x1de)]]){if(_0x43ef3f?.[_0x560a56(0x19a)])return await _0x43ef3f[_0x560a56(0x19a)](_0x482223[_0x560a56(0x1de)],_0x2cda7b[_0x482223['name']]);}else{if(_0x43ef3f?.[_0x560a56(0x206)])return await _0x43ef3f[_0x560a56(0x206)](_0x482223['name']);}}return _0x20a5aa;},_0x2924a6=async _0x489077=>{const _0x403bbf=a147_0x156b;if(/^\d+$/[_0x403bbf(0x1df)](_0x489077))return _0x489077;const _0x32948e=parseSegmentRef(_0x489077);if(_0x32948e[_0x403bbf(0x1dd)]===_0x403bbf(0x20c)){if(_0x43ef3f?.[_0x403bbf(0x1cd)])return await _0x43ef3f[_0x403bbf(0x1cd)](_0x32948e['name']);return _0x32948e[_0x403bbf(0x1de)];}else{if(_0x32948e['type']===_0x403bbf(0x1f7)&&_0x1afc0a[_0x32948e[_0x403bbf(0x1de)]]){if(_0x43ef3f?.['resolveEmbeddedActivationId'])return await _0x43ef3f[_0x403bbf(0x1f8)](_0x32948e[_0x403bbf(0x1de)],_0x1afc0a[_0x32948e[_0x403bbf(0x1de)]]);if(_0x43ef3f?.[_0x403bbf(0x1cd)])return await _0x43ef3f[_0x403bbf(0x1cd)](_0x32948e[_0x403bbf(0x1de)]);}else{if(_0x43ef3f?.[_0x403bbf(0x1cd)])return await _0x43ef3f[_0x403bbf(0x1cd)](_0x32948e[_0x403bbf(0x1de)]);}}return _0x489077;},_0x520894=_0x454a84=>{const _0x3c9bef=a147_0x156b;if(!_0x454a84)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x3c9bef(0x1df)](_0x454a84))return _0x454a84;return _0x4a5494[_0x454a84]||_0x454a84;};switch(_0x3b8c64['type']){case _0x3979a6(0x1e8):{const _0x38c715=_0x3b8c64,_0x22d37e=_0x38c715[_0x3979a6(0x1b9)],_0x5c7e7b={'type':_0x3979a6(0x215),'name':_0x38c715[_0x3979a6(0x1de)],'next':_0x520894(_0x38c715[_0x3979a6(0x1c8)])};if(_0x22d37e[_0x3979a6(0x1ce)]!==undefined&&_0x22d37e[_0x3979a6(0x1bc)])_0x5c7e7b[_0x3979a6(0x17b)]=_0x3979a6(0x1c1),_0x5c7e7b[_0x3979a6(0x16f)]=_0x22d37e['duration'],_0x5c7e7b[_0x3979a6(0x1bb)]=normalizeWaitUnit(_0x22d37e[_0x3979a6(0x1bc)]);else{if(_0x22d37e[_0x3979a6(0x21e)])_0x5c7e7b[_0x3979a6(0x17b)]='Date',_0x5c7e7b['waitUntilDate']=_0x22d37e[_0x3979a6(0x21e)];else{if(_0x22d37e[_0x3979a6(0x213)])_0x5c7e7b[_0x3979a6(0x17b)]=_0x3979a6(0x1be),_0x5c7e7b[_0x3979a6(0x224)]=_0x22d37e['days_of_week'];else{if(_0x22d37e['condition']){_0x5c7e7b[_0x3979a6(0x17b)]=_0x3979a6(0x1eb);const _0x1df5c3=await _0x5da310(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x204)]),_0x4e3234=_0x22d37e['condition'][_0x3979a6(0x1d2)]?.[_0x3979a6(0x1c8)]!==undefined;if(_0x4e3234){const _0x3c1795=[];_0x3c1795[_0x3979a6(0x1db)]({'id':generateUUID(),'segmentId':_0x1df5c3,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x520894(_0x22d37e['condition'][_0x3979a6(0x1c8)]??_0x38c715[_0x3979a6(0x1c8)])});if(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)]){const _0x28d0cc=_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)][_0x3979a6(0x1ce)],_0x5e741a=normalizeWaitUnit(_0x22d37e[_0x3979a6(0x1b0)]['timeout'][_0x3979a6(0x1bc)]);_0x3c1795[_0x3979a6(0x1db)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x3979a6(0x20d)+_0x28d0cc+'\x20'+_0x5e741a,'moveAfter':_0x28d0cc,'unit':_0x5e741a,'next':_0x520894(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)]['next'])});}_0x5c7e7b['conditions']=_0x3c1795,delete _0x5c7e7b[_0x3979a6(0x1c8)];}else _0x5c7e7b[_0x3979a6(0x211)]=_0x1df5c3,_0x22d37e[_0x3979a6(0x1b0)]['timeout']&&(_0x5c7e7b['conditionTimeoutDuration']=_0x22d37e['condition'][_0x3979a6(0x1d2)][_0x3979a6(0x1ce)],_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)][_0x3979a6(0x1bc)]&&(_0x5c7e7b[_0x3979a6(0x1a9)]=normalizeWaitUnit(_0x22d37e[_0x3979a6(0x1b0)][_0x3979a6(0x1d2)]['unit'])));}}}}return _0x5c7e7b;}case _0x3979a6(0x1c5):{const _0x3da1bb=_0x3b8c64,_0x5e986e=_0x3da1bb['with'][_0x3979a6(0x1c5)],_0x21ee48=await _0x2924a6(_0x5e986e);return{'type':_0x3979a6(0x1a0),'name':_0x3da1bb[_0x3979a6(0x1de)],'journeyActivationStepId':_0x21ee48,'next':_0x520894(_0x3da1bb[_0x3979a6(0x1c8)])};}case _0x3979a6(0x1c3):{const _0x5f1a97=_0x3b8c64,_0x534328=_0x5f1a97[_0x3979a6(0x1b9)]['branches'];return{'type':_0x3979a6(0x1a2),'name':_0x5f1a97[_0x3979a6(0x1de)],'branches':await Promise[_0x3979a6(0x1ac)](_0x534328[_0x3979a6(0x217)](async _0x41029f=>{const _0x8a62fd=_0x3979a6;let _0x703ab6='';if(!_0x41029f[_0x8a62fd(0x185)]){const _0x5b00d6=_0x41029f['segment']||_0x41029f[_0x8a62fd(0x1e2)]||'';_0x703ab6=_0x5b00d6?await _0x5da310(_0x5b00d6):'';}return{'id':crypto[_0x8a62fd(0x208)](),'name':_0x41029f['name'],'description':null,'segmentId':_0x703ab6,'excludedPath':_0x41029f[_0x8a62fd(0x185)]??![],'next':_0x520894(_0x41029f[_0x8a62fd(0x1c8)])};})),'next':_0x520894(_0x5f1a97[_0x3979a6(0x1c8)])};}case _0x3979a6(0x201):{const _0x96ca0d=_0x3b8c64,_0x2f0d2f=_0x96ca0d[_0x3979a6(0x1b9)];return{'type':_0x3979a6(0x1c2),'name':_0x96ca0d[_0x3979a6(0x1de)],'customizedSplit':_0x2f0d2f[_0x3979a6(0x179)],'uniqueId':_0x2f0d2f[_0x3979a6(0x1f5)],'variants':_0x2f0d2f[_0x3979a6(0x187)][_0x3979a6(0x217)](_0x4ce791=>({'id':_0x4ce791['id']||generateUUID(),'name':_0x4ce791[_0x3979a6(0x1de)],'percentage':_0x4ce791['percentage'],'next':_0x520894(_0x4ce791['next'])})),'next':_0x520894(_0x96ca0d[_0x3979a6(0x1c8)])};}case _0x3979a6(0x1c4):return{'type':_0x3979a6(0x19d),'name':_0x3b8c64[_0x3979a6(0x1de)],'next':_0x520894(_0x3b8c64[_0x3979a6(0x1c8)])};case _0x3979a6(0x192):{const _0x311115=_0x3b8c64,_0x1c9cd5=_0x311115[_0x3979a6(0x1b9)][_0x3979a6(0x18c)],_0x7cf944=_0x1c9cd5[_0x3979a6(0x19b)],_0x5e00da=_0x1c9cd5['stage'];let _0x1fe23e=_0x1c9cd5[_0x3979a6(0x19b)];_0x43ef3f?.[_0x3979a6(0x1b8)]&&!/^\d+$/['test'](_0x1fe23e)&&(_0x1fe23e=await _0x43ef3f[_0x3979a6(0x1b8)](_0x1fe23e));let _0x2fbf79=_0x1c9cd5['stage'];_0x43ef3f?.[_0x3979a6(0x16c)]&&!/^\d+$/['test'](_0x2fbf79)&&(_0x2fbf79=await _0x43ef3f[_0x3979a6(0x16c)](_0x1fe23e,_0x2fbf79));const _0x5eb4b5=!/^\d+$/[_0x3979a6(0x1df)](_0x7cf944)&&!isLocalJourneyRef(_0x7cf944)?formatApiJourneyName(_0x7cf944,_0x5e00da):undefined;return{'type':'Jump','name':_0x311115[_0x3979a6(0x1de)],'target':{'journeyId':_0x1fe23e,'journeyStageId':_0x2fbf79,'journeyBundleId':_0x1c9cd5[_0x3979a6(0x207)],'journeyName':_0x5eb4b5,'confirmed':!![]},'next':_0x520894(_0x311115[_0x3979a6(0x1c8)])};}case _0x3979a6(0x1bd):return{'type':_0x3979a6(0x1cc),'name':_0x3b8c64[_0x3979a6(0x1de)]};default:{const _0x53a486=_0x3b8c64;return{'type':_0x3979a6(0x1cc),'name':_0x53a486[_0x3979a6(0x1de)]};}}}export function toYamlString(_0x5f4690){const _0x546131=a147_0x156b,_0xfa6f15=stripInternalFields(_0x5f4690),_0x35c2c3=a147_0x1e9c98[_0x546131(0x1a8)](_0xfa6f15,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x546131(0x1b4)}),_0x1524dc=[_0x546131(0x16e),_0x546131(0x1ed),_0x546131(0x1ef),'reentry:',_0x546131(0x194),'stages:',_0x546131(0x1d5)];let _0x4d1e42=_0x35c2c3;for(const _0x150806 of _0x1524dc){_0x4d1e42=_0x4d1e42['replace'](new RegExp('^('+_0x150806+')','m'),(_0x203bac,_0x5cec96,_0x4d74c1)=>{if(_0x4d74c1===0x0||_0x4d1e42[_0x4d74c1-0x1]==='\x0a'&&_0x4d1e42[_0x4d74c1-0x2]==='\x0a')return _0x5cec96;return'\x0a'+_0x5cec96;});}return _0x4d1e42;}function stripInternalFields(_0x3f9ed8){const _0x2e7104=a147_0x156b,{id:_0xf191d0,folder_id:_0x1fbfe6,bundle_id:_0x2fd4dd,bundle_name:_0x501acf,version:_0x7b1260,allow_reentry:_0x4ebb9f,..._0x300ada}=_0x3f9ed8;return _0x300ada[_0x2e7104(0x1e7)]&&(_0x300ada['journeys']=_0x300ada[_0x2e7104(0x1e7)][_0x2e7104(0x217)](_0x57ce3e=>{const _0x169966=_0x2e7104,{id:_0x13bf3f,..._0x5841d8}=_0x57ce3e;return{..._0x5841d8,'stages':_0x5841d8[_0x169966(0x1d7)][_0x169966(0x217)](stripStageInternalFields),..._0x57ce3e[_0x169966(0x1ad)]===!![]?{'latest':!![]}:{},..._0x300ada['journeys'][_0x169966(0x1ab)]===0x1&&_0x5841d8[_0x169966(0x202)]==='v1'?{'version':undefined}:{}};})),_0x300ada[_0x2e7104(0x1d7)]&&(_0x300ada[_0x2e7104(0x1d7)]=_0x300ada['stages']['map'](stripStageInternalFields)),_0x300ada[_0x2e7104(0x21b)]&&(_0x300ada[_0x2e7104(0x21b)]=_0x300ada[_0x2e7104(0x21b)][_0x2e7104(0x217)](_0x41bd8e=>{const _0x452f90=_0x2e7104,{id:_0x31f047,..._0x552358}=_0x41bd8e;return{..._0x552358,'stages':_0x552358['stages'][_0x452f90(0x217)](stripStageInternalFields),..._0x41bd8e[_0x452f90(0x1ad)]===!![]?{'latest':!![]}:{}};})),_0x300ada;}function stripStageInternalFields(_0x3af5c1){const {id:_0x2046a2,..._0x41ae36}=_0x3af5c1;return _0x41ae36;}export function parseYamlString(_0x2e8ccc){return safeParseYaml(_0x2e8ccc,JourneyDefSchema);}export function isJourneyDef(_0x159fcc){const _0x2e5c75=a147_0x156b;return typeof _0x159fcc===_0x2e5c75(0x18d)&&_0x159fcc!==null&&_0x2e5c75(0x1dd)in _0x159fcc&&_0x159fcc[_0x2e5c75(0x1dd)]===_0x2e5c75(0x19b);}export function generateTemplate(_0x38bc85,_0x20355){const _0x3f00b7=a147_0x156b,_0x569220={'type':_0x3f00b7(0x19b),'name':_0x38bc85,'description':_0x3f00b7(0x190),'reentry':_0x3f00b7(0x1d8),'goal':{'name':'Goal\x20Achieved','segment':_0x3f00b7(0x195)},'stages':[{'name':_0x3f00b7(0x1e0),'description':_0x3f00b7(0x186),'entry_criteria':{'name':'Entry\x20Criteria','segment':_0x20355},'steps':[{'type':_0x3f00b7(0x1e8),'name':_0x3f00b7(0x17c),'with':{'duration':0x1,'unit':_0x3f00b7(0x171)}},{'type':_0x3f00b7(0x1c5),'name':_0x3f00b7(0x1f2),'with':{'activation':_0x3f00b7(0x1ae)}},{'type':'end','name':_0x3f00b7(0x1bf)}]}]};return toYamlString(_0x569220);}function generateUUID(){const _0xe87b56=a147_0x156b;return crypto[_0xe87b56(0x208)]();}export const SEGMENT_REF_PREFIX=a147_0x21078b(0x218);export function parseSegmentRef(_0xaa0607){const _0x49e0aa=a147_0x21078b;if(_0xaa0607[_0x49e0aa(0x220)](SEGMENT_REF_PREFIX))return{'type':_0x49e0aa(0x20c),'name':_0xaa0607['slice'](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/['test'](_0xaa0607))return{'type':'id','name':_0xaa0607};return{'type':_0x49e0aa(0x1f7),'name':_0xaa0607};}export function makeSegmentRef(_0x503129){return''+SEGMENT_REF_PREFIX+_0x503129;}export function isExternalSegmentRef(_0x16964e){const _0x546225=a147_0x21078b;return _0x16964e[_0x546225(0x220)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0xc4679f){const _0xcbb1cf=a147_0x21078b;return!!(_0xc4679f['journeys']&&_0xc4679f['journeys'][_0xcbb1cf(0x1ab)]>0x0);}export function isMultiVersionMode(_0x475a1a){const _0x1f42f6=a147_0x21078b;return!!(_0x475a1a[_0x1f42f6(0x21b)]&&_0x475a1a['versions'][_0x1f42f6(0x1ab)]>0x0);}export function isSingleVersionMode(_0x5c864d){const _0x3f1aaf=a147_0x21078b;return!!(_0x5c864d[_0x3f1aaf(0x1d7)]&&_0x5c864d['stages'][_0x3f1aaf(0x1ab)]>0x0);}export function hasMultipleVersions(_0xb8227a){const _0x382bd3=a147_0x21078b;if(isJourneysArrayMode(_0xb8227a))return(_0xb8227a[_0x382bd3(0x1e7)]?.[_0x382bd3(0x1ab)]||0x0)>0x1;if(isMultiVersionMode(_0xb8227a))return(_0xb8227a[_0x382bd3(0x21b)]?.[_0x382bd3(0x1ab)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x3ed851){const _0x39a6a6=a147_0x21078b;if(isJourneysArrayMode(_0x3ed851))return _0x3ed851;if(isSingleVersionMode(_0x3ed851)){const {stages:_0x45b298,id:_0x325707,version:_0x33f739,version_number:_0x6c3831,..._0x351169}=_0x3ed851;return{..._0x351169,'journeys':[{'version':_0x33f739||'v1','stages':_0x45b298||[],'id':_0x325707,'version_number':_0x6c3831}]};}if(isMultiVersionMode(_0x3ed851)){const {versions:_0x29c09e,..._0x3abee6}=_0x3ed851;return{..._0x3abee6,'journeys':(_0x29c09e||[])[_0x39a6a6(0x217)](_0x2b062d=>({'version':_0x2b062d['name'],'state':_0x2b062d['state'],'latest':_0x2b062d[_0x39a6a6(0x1ad)],'stages':_0x2b062d[_0x39a6a6(0x1d7)],'id':_0x2b062d['id'],'version_number':_0x2b062d['version_number']}))};}return _0x3ed851;}export function normalizeJourneyDef(_0x5e1d83,_0xce0d5d){const _0x287eec=a147_0x21078b,_0xc1516e=normalizeToJourneysFormat(_0x5e1d83),_0x5b5d8e=_0xce0d5d?.['segments']?Object[_0x287eec(0x193)](_0xce0d5d[_0x287eec(0x1e9)]):undefined,_0x5868e6=_0xce0d5d?.[_0x287eec(0x19f)]?Object[_0x287eec(0x193)](_0xce0d5d['activations']):undefined;return{'type':'journey','name':_0xc1516e[_0x287eec(0x1de)],..._0xc1516e[_0x287eec(0x1b5)]!==undefined&&{'description':_0xc1516e[_0x287eec(0x1b5)]},..._0xc1516e[_0x287eec(0x21f)]&&{'goal':normalizeJourneyCriteria(_0xc1516e[_0x287eec(0x21f)])},..._0xc1516e[_0x287eec(0x21c)]!==undefined&&{'reentry':_0xc1516e[_0x287eec(0x21c)]},..._0xc1516e['segments']&&{'segments':normalizeEmbeddedSegments(_0xc1516e[_0x287eec(0x1e9)],_0x5b5d8e)},..._0xc1516e[_0x287eec(0x19f)]&&{'activations':normalizeEmbeddedActivations(_0xc1516e[_0x287eec(0x19f)],_0x5868e6)},..._0xc1516e[_0x287eec(0x1e7)]&&{'journeys':_0xc1516e[_0x287eec(0x1e7)][_0x287eec(0x217)](_0x3e95f3=>normalizeJourneyEntry(_0x3e95f3,_0xc1516e['journeys'][_0x287eec(0x1ab)]===0x1))}};}function a147_0x1b2a(){const _0x223860=['replace','Merge','parentFolder','activations','Activation','get','DecisionPoint','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','timedOutPath','resolveActivation','allowReentry','customizedSplit','stringify','conditionTimeoutUnit','conditions','length','all','latest','your-activation-name','notification','condition','attributes','AbTest','rule','null','description','reentryMode','all_columns','resolveJourneyId','with','exitCriterias','waitStepUnit','unit','end','DaysOfTheWeek','Stage\x20Complete','71541JvJRqj','Duration','ABTest','decision_point','merge','activation','weeks','schedule','next','rootStep','304025ekxDOo','uniqueId','End','resolveActivationId','duration','moveAfter','7qnRyWY','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','timeout','entry_criteria','2968SfUlWf','versions:','toLowerCase','stages','no_reentry','set','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','push','entries','type','name','test','Stage\x201','(missing)','segment_id','journeyName','milestone','has','Expected\x20format:\x0a','journeys','wait','segments','resolveSegmentName','Condition','version_number','activations:','branches','goal:','waitUntilDate','\x20\x20\x20\x20conditions:\x0a','Send\x20Notification','isArray','\x20\x20rule:\x0a','unique_id','reentry_always','embedded','resolveEmbeddedActivationId','\x27.\x0a','journeyStages','10805600jXBJls','journeyBundleName','540397nZmjSA','activation_template_id','\x20\x20\x20\x20type:\x20And\x0a','7238298ynxtRY','ab_test','version','shift','segment','Date','resolveSegmentId','bundle_id','randomUUID','bundle_name','entryCriteria','45032bQgHQI','ref','*Max\x20wait\x20','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','state','resolveActivationName','conditionSegmentId','includes','days_of_week','sort','WaitStep','stageId','map','ref:','\x27:\x20','journeyId','versions','reentry','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','wait_until','goal','startsWith','connector_config','447eJdfke','resolveSegment','daysOfWeek','journeyBundleId','resolveJumpTarget','resolveStageId','add','segments:','waitStep','\x20\x20\x20\x20type:\x20','day','filter','559IPSFOD','relationships','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','launched','40jcTcRm','columns','customized_split','size','waitStepType','Wait\x201\x20Day','behavior','folder_id','steps','definition','data','876oQzZrZ','week','uuid','excluded','First\x20stage\x20of\x20the\x20journey','variants','stage','journeyStageId','segmentId','waitCondition','target','object','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','exit_criteria','Journey\x20description','stageName','jump','keys','journeys:','goal-segment','journeyActivationStepId','find','root_step','trim','resolveEmbeddedSegmentId','journey'];a147_0x1b2a=function(){return _0x223860;};return a147_0x1b2a();}function normalizeJourneyEntry(_0x4d4529,_0x7313db){const _0x2bb6ef=a147_0x21078b;return{...!_0x7313db&&_0x4d4529[_0x2bb6ef(0x202)]!==undefined&&{'version':_0x4d4529[_0x2bb6ef(0x202)]},..._0x4d4529[_0x2bb6ef(0x20f)]!==undefined&&{'state':_0x4d4529[_0x2bb6ef(0x20f)]},...!_0x7313db&&_0x4d4529[_0x2bb6ef(0x1ad)]!==undefined&&{'latest':_0x4d4529['latest']},..._0x4d4529[_0x2bb6ef(0x1ec)]!==undefined&&{'version_number':_0x4d4529['version_number']},..._0x4d4529[_0x2bb6ef(0x21f)]&&{'goal':normalizeJourneyCriteria(_0x4d4529['goal'])},..._0x4d4529[_0x2bb6ef(0x21c)]!==undefined&&{'reentry':_0x4d4529[_0x2bb6ef(0x21c)]},'stages':_0x4d4529[_0x2bb6ef(0x1d7)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0xf0eff6){const _0xd26428=a147_0x21078b;return{'name':_0xf0eff6['name'],..._0xf0eff6[_0xd26428(0x1b5)]!==undefined&&{'description':_0xf0eff6[_0xd26428(0x1b5)]},..._0xf0eff6['entry_criteria']&&{'entry_criteria':normalizeJourneyCriteria(_0xf0eff6[_0xd26428(0x1d3)])},..._0xf0eff6[_0xd26428(0x18f)]&&{'exit_criteria':_0xf0eff6[_0xd26428(0x18f)][_0xd26428(0x217)](normalizeJourneyCriteria)},..._0xf0eff6[_0xd26428(0x1e4)]&&{'milestone':normalizeJourneyCriteria(_0xf0eff6[_0xd26428(0x1e4)])},..._0xf0eff6[_0xd26428(0x17f)]&&{'steps':normalizeStepsWithImplicitNext(_0xf0eff6[_0xd26428(0x17f)])}};}function normalizeStepsWithImplicitNext(_0x4fbd61){return _0x4fbd61['map']((_0x26cc87,_0x5acc04)=>{const _0x15622d=a147_0x156b,_0xb0700e=_0x5acc04<_0x4fbd61[_0x15622d(0x1ab)]-0x1?_0x4fbd61[_0x5acc04+0x1][_0x15622d(0x1de)]:undefined;return normalizeJourneyStep(_0x26cc87,_0xb0700e);});}function normalizeJourneyCriteria(_0x149b6b){const _0x5c7169=a147_0x21078b;return{'name':_0x149b6b[_0x5c7169(0x1de)],..._0x149b6b['description']!==undefined&&{'description':_0x149b6b['description']},'segment':_0x149b6b[_0x5c7169(0x204)],..._0x149b6b[_0x5c7169(0x18c)]&&{'target':normalizeJumpTarget(_0x149b6b[_0x5c7169(0x18c)])}};}function normalizeJourneyStep(_0x5e2aa7,_0x3a39dc){const _0x29eb74=a147_0x21078b,_0x294d9d=_0x5e2aa7[_0x29eb74(0x1c8)]!==undefined&&_0x5e2aa7[_0x29eb74(0x1c8)]!==_0x3a39dc,_0x22964e={'type':_0x5e2aa7['type'],'name':_0x5e2aa7[_0x29eb74(0x1de)],..._0x294d9d&&{'next':_0x5e2aa7[_0x29eb74(0x1c8)]}};if('with'in _0x5e2aa7&&_0x5e2aa7[_0x29eb74(0x1b9)])return{..._0x22964e,'with':normalizeStepParams(_0x5e2aa7[_0x29eb74(0x1dd)],_0x5e2aa7['with'])};return _0x22964e;}function normalizeStepParams(_0x318250,_0x5bb963){const _0x38883d=a147_0x21078b;switch(_0x318250){case _0x38883d(0x1e8):{const _0x4b6bf3=_0x5bb963;let _0x611df0;return _0x4b6bf3['condition']&&(_0x611df0={'segment':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x204)],..._0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1c8)]!==undefined&&{'next':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1c8)]},..._0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)]&&{'timeout':{'duration':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)][_0x38883d(0x1ce)],'unit':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)][_0x38883d(0x1bc)],..._0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)][_0x38883d(0x1c8)]!==undefined&&{'next':_0x4b6bf3[_0x38883d(0x1b0)][_0x38883d(0x1d2)]['next']}}}}),{..._0x4b6bf3[_0x38883d(0x1ce)]!==undefined&&{'duration':_0x4b6bf3[_0x38883d(0x1ce)]},..._0x4b6bf3['unit']!==undefined&&{'unit':_0x4b6bf3[_0x38883d(0x1bc)]},..._0x4b6bf3['wait_until']!==undefined&&{'wait_until':_0x4b6bf3[_0x38883d(0x21e)]},..._0x4b6bf3[_0x38883d(0x213)]!==undefined&&{'days_of_week':_0x4b6bf3[_0x38883d(0x213)]},..._0x611df0&&{'condition':_0x611df0}};}case _0x38883d(0x1c5):{const _0x254acd=_0x5bb963;return{'activation':_0x254acd[_0x38883d(0x1c5)]};}case _0x38883d(0x1c3):{const _0x3a5d5a=_0x5bb963;return{'branches':_0x3a5d5a[_0x38883d(0x1ee)][_0x38883d(0x217)](normalizeDecisionBranch)};}case'ab_test':{const _0x70cbc7=_0x5bb963;return{..._0x70cbc7['customized_split']!==undefined&&{'customized_split':_0x70cbc7[_0x38883d(0x179)]},..._0x70cbc7[_0x38883d(0x1f5)]!==undefined&&{'unique_id':_0x70cbc7[_0x38883d(0x1f5)]},'variants':_0x70cbc7[_0x38883d(0x187)][_0x38883d(0x217)](normalizeAbTestVariant)};}case'jump':{const _0x1f8b9a=_0x5bb963;return{'target':normalizeJumpTarget(_0x1f8b9a['target'])};}default:return _0x5bb963;}}function normalizeDecisionBranch(_0x57c917){const _0x128e3=a147_0x21078b;return{'name':_0x57c917['name'],..._0x57c917['segment']!==undefined&&{'segment':_0x57c917[_0x128e3(0x204)]},..._0x57c917['excluded']!==undefined&&{'excluded':_0x57c917[_0x128e3(0x185)]},..._0x57c917[_0x128e3(0x1c8)]!==undefined&&{'next':_0x57c917[_0x128e3(0x1c8)]}};}function normalizeAbTestVariant(_0x42c20b){const _0x3495e1=a147_0x21078b;return{..._0x42c20b['id']!==undefined&&{'id':_0x42c20b['id']},'name':_0x42c20b[_0x3495e1(0x1de)],'percentage':_0x42c20b['percentage'],..._0x42c20b[_0x3495e1(0x1c8)]!==undefined&&{'next':_0x42c20b[_0x3495e1(0x1c8)]}};}function normalizeJumpTarget(_0x464e4c){const _0x58c14c=a147_0x21078b;return{'journey':_0x464e4c[_0x58c14c(0x19b)],'stage':_0x464e4c['stage'],..._0x464e4c['bundle_id']!==undefined&&{'bundle_id':_0x464e4c[_0x58c14c(0x207)]}};}function normalizeEmbeddedSegments(_0x151609,_0x16abf2){const _0x53479b=a147_0x21078b,_0x2dc680={},_0x4acd93=Object[_0x53479b(0x193)](_0x151609),_0xef854=_0x16abf2?[..._0x16abf2[_0x53479b(0x172)](_0x34c9a9=>_0x4acd93[_0x53479b(0x212)](_0x34c9a9)),..._0x4acd93['filter'](_0x1e3ee8=>!_0x16abf2[_0x53479b(0x212)](_0x1e3ee8))['sort']()]:_0x4acd93['sort']();for(const _0x5284ad of _0xef854){const _0x41710d=_0x151609[_0x5284ad];if(_0x41710d['rule']){const _0x4b76cc=_0x41710d[_0x53479b(0x1b3)];if(_0x4b76cc[_0x53479b(0x1dd)]!=='And'&&_0x4b76cc['type']!=='Or'){const _0x587d93=_0x4b76cc['type']??_0x53479b(0x1e1);throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x53479b(0x1a3)+_0x5284ad+_0x53479b(0x219)+(_0x53479b(0x1da)+_0x587d93+_0x53479b(0x1f9))+_0x53479b(0x1e6)+_0x53479b(0x1f4)+_0x53479b(0x1ff)+_0x53479b(0x1f1)+_0x53479b(0x18e)+_0x53479b(0x21d)+_0x53479b(0x20e));}if(!_0x4b76cc[_0x53479b(0x1aa)]||!Array['isArray'](_0x4b76cc[_0x53479b(0x1aa)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x53479b(0x1a3)+_0x5284ad+_0x53479b(0x219)+_0x53479b(0x175)+_0x53479b(0x1e6)+_0x53479b(0x1f4)+(_0x53479b(0x170)+_0x4b76cc[_0x53479b(0x1dd)]+'\x0a')+'\x20\x20\x20\x20conditions:\x0a'+_0x53479b(0x18e)+'\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a'+_0x53479b(0x20e));}_0x2dc680[_0x5284ad]={..._0x41710d[_0x53479b(0x1b5)]&&_0x41710d['description'][_0x53479b(0x199)]()&&{'description':_0x41710d[_0x53479b(0x1b5)]},..._0x41710d[_0x53479b(0x1b3)]&&{'rule':deepSortObject(_0x41710d[_0x53479b(0x1b3)])}};}return _0x2dc680;}function normalizeEmbeddedActivations(_0x15a2d6,_0x2af66c){const _0x504529=a147_0x21078b,_0x50b692={},_0x18da7e=Object[_0x504529(0x193)](_0x15a2d6),_0x20b2d3=_0x2af66c?[..._0x2af66c[_0x504529(0x172)](_0x1108ac=>_0x18da7e[_0x504529(0x212)](_0x1108ac)),..._0x18da7e[_0x504529(0x172)](_0x39c6b7=>!_0x2af66c['includes'](_0x39c6b7))['sort']()]:_0x18da7e[_0x504529(0x214)]();for(const _0x5ab496 of _0x20b2d3){const _0x1af6f4=_0x15a2d6[_0x5ab496];_0x50b692[_0x5ab496]={'name':_0x1af6f4['name'],'connection':_0x1af6f4['connection'],..._0x1af6f4[_0x504529(0x1b5)]!==undefined&&{'description':_0x1af6f4[_0x504529(0x1b5)]},..._0x1af6f4[_0x504529(0x1b7)]!==undefined&&{'all_columns':_0x1af6f4[_0x504529(0x1b7)]},..._0x1af6f4[_0x504529(0x178)]!==undefined&&{'columns':_0x1af6f4[_0x504529(0x178)]},..._0x1af6f4[_0x504529(0x17d)]!==undefined&&{'behavior':_0x1af6f4[_0x504529(0x17d)]},..._0x1af6f4[_0x504529(0x1c7)]!==undefined&&{'schedule':_0x1af6f4[_0x504529(0x1c7)]},..._0x1af6f4[_0x504529(0x1af)]!==undefined&&{'notification':_0x1af6f4[_0x504529(0x1af)]},..._0x1af6f4[_0x504529(0x221)]!==undefined&&{'connector_config':_0x1af6f4[_0x504529(0x221)]},..._0x1af6f4[_0x504529(0x1fe)]!==undefined&&{'activation_template_id':_0x1af6f4[_0x504529(0x1fe)]}};}return _0x50b692;}export function getActiveStages(_0x32a7de){const _0x28cc41=a147_0x21078b;if(isJourneysArrayMode(_0x32a7de)){const _0x20b70b=_0x32a7de[_0x28cc41(0x1e7)]||[],_0x1868b6=_0x20b70b[_0x28cc41(0x197)](_0x43a216=>_0x43a216[_0x28cc41(0x1ad)]===!![])||_0x20b70b[0x0];return _0x1868b6?.[_0x28cc41(0x1d7)]||[];}if(isSingleVersionMode(_0x32a7de))return _0x32a7de['stages']||[];if(isMultiVersionMode(_0x32a7de)){const _0x397731=_0x32a7de[_0x28cc41(0x21b)]||[],_0x5d1b42=_0x397731[_0x28cc41(0x197)](_0x114e6e=>_0x114e6e[_0x28cc41(0x1ad)]===!![])||_0x397731[0x0];return _0x5d1b42?.[_0x28cc41(0x1d7)]||[];}return[];}export function getLatestJourneyEntry(_0x4f3fc3){const _0x3f7c1b=a147_0x21078b;if(isJourneysArrayMode(_0x4f3fc3)){const _0x1913b1=_0x4f3fc3[_0x3f7c1b(0x1e7)]||[];return _0x1913b1[_0x3f7c1b(0x197)](_0x93ff18=>_0x93ff18[_0x3f7c1b(0x1ad)]===!![])||_0x1913b1[0x0];}if(isMultiVersionMode(_0x4f3fc3)){const _0x1ad8e7=_0x4f3fc3[_0x3f7c1b(0x21b)]||[],_0x46fad9=_0x1ad8e7[_0x3f7c1b(0x197)](_0x19a47a=>_0x19a47a[_0x3f7c1b(0x1ad)]===!![])||_0x1ad8e7[0x0];if(_0x46fad9)return{'version':_0x46fad9['name'],'state':_0x46fad9[_0x3f7c1b(0x20f)],'latest':_0x46fad9['latest'],'stages':_0x46fad9[_0x3f7c1b(0x1d7)],'id':_0x46fad9['id'],'version_number':_0x46fad9[_0x3f7c1b(0x1ec)]};}if(isSingleVersionMode(_0x4f3fc3))return{'version':_0x4f3fc3[_0x3f7c1b(0x202)]||'v1','state':'draft','stages':_0x4f3fc3[_0x3f7c1b(0x1d7)]||[],'id':_0x4f3fc3['id'],'version_number':_0x4f3fc3[_0x3f7c1b(0x1ec)],'goal':_0x4f3fc3[_0x3f7c1b(0x21f)],'reentry':_0x4f3fc3[_0x3f7c1b(0x21c)]};return undefined;}export function getLatestVersion(_0x4d0489){const _0x7d3829=a147_0x21078b;if(!isMultiVersionMode(_0x4d0489))return undefined;const _0x3db89f=_0x4d0489[_0x7d3829(0x21b)]||[];return _0x3db89f[_0x7d3829(0x197)](_0x1c4845=>_0x1c4845[_0x7d3829(0x1ad)]===!![])||_0x3db89f[0x0];}function a147_0x156b(_0x87e820,_0x5bac62){_0x87e820=_0x87e820-0x16c;const _0x1b2ac5=a147_0x1b2a();let _0x156b1c=_0x1b2ac5[_0x87e820];return _0x156b1c;}export function getEffectiveGoal(_0x1e6619){const _0x4d1380=a147_0x21078b,_0xf5231b=getLatestJourneyEntry(_0x1e6619);return _0xf5231b?.[_0x4d1380(0x21f)]||_0x1e6619[_0x4d1380(0x21f)];}export function getEffectiveReentry(_0x55fdc7){const _0x3e043a=a147_0x21078b,_0x26d5fd=getLatestJourneyEntry(_0x55fdc7);return _0x26d5fd?.[_0x3e043a(0x21c)]||_0x55fdc7[_0x3e043a(0x21c)];}export function collectSegmentRefs(_0x18237d){const _0x5c4bfc=a147_0x21078b,_0x2d065a=new Set();_0x18237d['goal']?.[_0x5c4bfc(0x204)]&&_0x2d065a[_0x5c4bfc(0x16d)](_0x18237d[_0x5c4bfc(0x21f)][_0x5c4bfc(0x204)]);const _0x579255=_0x56eed0=>{const _0x4c46a0=_0x5c4bfc;for(const _0x30940a of _0x56eed0){_0x30940a[_0x4c46a0(0x1d3)]?.['segment']&&_0x2d065a[_0x4c46a0(0x16d)](_0x30940a[_0x4c46a0(0x1d3)]['segment']);if(_0x30940a['exit_criteria'])for(const _0x21f28e of _0x30940a[_0x4c46a0(0x18f)]){_0x21f28e[_0x4c46a0(0x204)]&&_0x2d065a[_0x4c46a0(0x16d)](_0x21f28e[_0x4c46a0(0x204)]);}_0x30940a[_0x4c46a0(0x1e4)]?.[_0x4c46a0(0x204)]&&_0x2d065a['add'](_0x30940a[_0x4c46a0(0x1e4)][_0x4c46a0(0x204)]);if(_0x30940a[_0x4c46a0(0x17f)])for(const _0x318839 of _0x30940a[_0x4c46a0(0x17f)]){if(_0x318839[_0x4c46a0(0x1dd)]===_0x4c46a0(0x1c3)){const _0x3ab993=_0x318839;for(const _0x4a338c of _0x3ab993[_0x4c46a0(0x1b9)]['branches']){_0x4a338c[_0x4c46a0(0x204)]&&_0x2d065a[_0x4c46a0(0x16d)](_0x4a338c['segment']);}}else{if(_0x318839[_0x4c46a0(0x1dd)]===_0x4c46a0(0x1e8)){const _0x1d00dd=_0x318839;_0x1d00dd[_0x4c46a0(0x1b9)][_0x4c46a0(0x1b0)]?.[_0x4c46a0(0x204)]&&_0x2d065a[_0x4c46a0(0x16d)](_0x1d00dd[_0x4c46a0(0x1b9)][_0x4c46a0(0x1b0)]['segment']);}}}}};_0x18237d[_0x5c4bfc(0x1d7)]&&_0x579255(_0x18237d['stages']);if(_0x18237d[_0x5c4bfc(0x21b)])for(const _0xb84901 of _0x18237d[_0x5c4bfc(0x21b)]){_0x579255(_0xb84901['stages']);}return _0x2d065a;}export function validateSegmentRefs(_0x334bfd){const _0x24a19b=a147_0x21078b,_0x551617=[],_0x13eed4=collectSegmentRefs(_0x334bfd),_0x5db76f=new Set(Object[_0x24a19b(0x193)](_0x334bfd[_0x24a19b(0x1e9)]||{}));for(const _0xf54074 of _0x13eed4){const _0x303faa=parseSegmentRef(_0xf54074);_0x303faa[_0x24a19b(0x1dd)]==='embedded'&&!_0x5db76f[_0x24a19b(0x1e5)](_0x303faa[_0x24a19b(0x1de)])&&_0x551617[_0x24a19b(0x1db)]('Unknown\x20segment\x20\x22'+_0x303faa['name']+_0x24a19b(0x1d1)+_0x303faa[_0x24a19b(0x1de)]+'\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.');}return _0x551617;}export function collectSegmentIdsFromJourneyApi(_0x4534f8){const _0x4c4992=a147_0x21078b,_0x5a8a4d=new Set();_0x4534f8[_0x4c4992(0x1b1)][_0x4c4992(0x21f)]?.[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x4534f8[_0x4c4992(0x1b1)]['goal'][_0x4c4992(0x18a)]);const _0x27cd38=_0x4534f8[_0x4c4992(0x1b1)][_0x4c4992(0x1fa)];if(Array[_0x4c4992(0x1f3)](_0x27cd38))for(const _0x4b28a5 of _0x27cd38){_0x4b28a5[_0x4c4992(0x20a)]?.[_0x4c4992(0x18a)]&&_0x5a8a4d['add'](_0x4b28a5[_0x4c4992(0x20a)][_0x4c4992(0x18a)]);const _0x363f73=_0x4b28a5['exitCriterias']??_0x4b28a5['exitCriteria'];if(Array[_0x4c4992(0x1f3)](_0x363f73))for(const _0x464860 of _0x363f73){_0x464860[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x464860[_0x4c4992(0x18a)]);}_0x4b28a5['milestone']?.[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x4b28a5['milestone'][_0x4c4992(0x18a)]);if(_0x4b28a5[_0x4c4992(0x17f)]&&typeof _0x4b28a5[_0x4c4992(0x17f)]===_0x4c4992(0x18d)){const _0x3096f4=Array[_0x4c4992(0x1f3)](_0x4b28a5[_0x4c4992(0x17f)])?_0x4b28a5['steps']:Object['values'](_0x4b28a5[_0x4c4992(0x17f)]);for(const _0x3aaa7e of _0x3096f4){_0x3aaa7e['waitCondition']?.[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x3aaa7e[_0x4c4992(0x18b)]['segmentId']);const _0x16ee0b=_0x3aaa7e;_0x16ee0b[_0x4c4992(0x211)]&&_0x5a8a4d['add'](_0x16ee0b[_0x4c4992(0x211)]);if(Array[_0x4c4992(0x1f3)](_0x16ee0b['conditions']))for(const _0x12aa6b of _0x16ee0b[_0x4c4992(0x1aa)]){_0x12aa6b[_0x4c4992(0x18a)]&&_0x5a8a4d[_0x4c4992(0x16d)](_0x12aa6b['segmentId']);}if(Array['isArray'](_0x3aaa7e['branches']))for(const _0x5c07c4 of _0x3aaa7e[_0x4c4992(0x1ee)]){_0x5c07c4['segmentId']&&_0x5a8a4d['add'](_0x5c07c4[_0x4c4992(0x18a)]);}}}}return _0x5a8a4d;}
|
|
1
|
+
const a147_0xbe4df2=a147_0x5d42;(function(_0x59638f,_0x38d903){const _0x1cd79a=a147_0x5d42,_0x37b606=_0x59638f();while(!![]){try{const _0x4218bf=parseInt(_0x1cd79a(0xc3))/0x1*(parseInt(_0x1cd79a(0xd9))/0x2)+parseInt(_0x1cd79a(0x6f))/0x3*(-parseInt(_0x1cd79a(0x87))/0x4)+parseInt(_0x1cd79a(0xd8))/0x5*(-parseInt(_0x1cd79a(0x72))/0x6)+-parseInt(_0x1cd79a(0x6a))/0x7+-parseInt(_0x1cd79a(0x92))/0x8+-parseInt(_0x1cd79a(0x10e))/0x9*(-parseInt(_0x1cd79a(0xc9))/0xa)+parseInt(_0x1cd79a(0x109))/0xb;if(_0x4218bf===_0x38d903)break;else _0x37b606['push'](_0x37b606['shift']());}catch(_0x274099){_0x37b606['push'](_0x37b606['shift']());}}}(a147_0x13c5,0x2e514));import*as a147_0x47bc69 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{deepSortObject}from'./child-segment-yaml.js';import{safeParseYaml}from'./yaml-validator.js';function a147_0x5d42(_0x163240,_0x427a97){_0x163240=_0x163240-0x6a;const _0x13c5ee=a147_0x13c5();let _0x5d42f9=_0x13c5ee[_0x163240];return _0x5d42f9;}import{JourneyDefSchema}from'./types/journey-schema.js';import{formatApiJourneyName,isLocalJourneyRef}from'./journey-utils.js';export function normalizeWaitUnit(_0xba6baf){const _0x42f77f=a147_0x5d42,_0x740a80=_0xba6baf['toLowerCase']();if(_0x740a80===_0x42f77f(0x11f)||_0x740a80==='day')return _0x42f77f(0x91);if(_0x740a80===_0x42f77f(0x110)||_0x740a80===_0x42f77f(0x120))return'week';return _0xba6baf;}export function journeyResponseToDefSync(_0x1a2c2b){const _0x558f0c=a147_0x5d42,_0x2a49f8=_0x1a2c2b[_0x558f0c(0xab)],_0xd2fc2c=_0x2a49f8[_0x558f0c(0xff)]||_0x2a49f8[_0x558f0c(0x128)],_0x38fb6a={'stages':_0x2a49f8['journeyStages'][_0x558f0c(0xac)](convertApiStageToYaml),'id':_0x1a2c2b['id']};_0x2a49f8[_0x558f0c(0xb8)]&&(_0x38fb6a[_0x558f0c(0xb8)]=convertApiCriteriaToYaml(_0x2a49f8[_0x558f0c(0xb8)]));_0x2a49f8[_0x558f0c(0x128)]&&_0x2a49f8['name']!==_0xd2fc2c&&(_0x38fb6a['version']=_0x2a49f8[_0x558f0c(0x128)]);_0x2a49f8['versionNumber']!==undefined&&(_0x38fb6a[_0x558f0c(0x7b)]=_0x2a49f8[_0x558f0c(0x10c)]);_0x2a49f8['state']&&(_0x38fb6a[_0x558f0c(0xf5)]=_0x2a49f8['state']===_0x558f0c(0xec)?_0x558f0c(0xec):_0x558f0c(0xdf));const _0x2e0503={'type':_0x558f0c(0xf7),'name':_0xd2fc2c,'journeys':[_0x38fb6a]};_0x2a49f8[_0x558f0c(0xa9)]&&(_0x2e0503[_0x558f0c(0xa9)]=_0x2a49f8[_0x558f0c(0xa9)]);_0x2a49f8[_0x558f0c(0xb8)]&&(_0x2e0503['goal']=convertApiCriteriaToYaml(_0x2a49f8[_0x558f0c(0xb8)]));if(_0x2a49f8[_0x558f0c(0x11e)])_0x2e0503['reentry']=_0x2a49f8[_0x558f0c(0x11e)];else _0x2a49f8[_0x558f0c(0xbb)]!==undefined&&(_0x2e0503[_0x558f0c(0xd5)]=_0x2a49f8[_0x558f0c(0xbb)]?_0x558f0c(0x119):_0x558f0c(0x8a));return _0x2a49f8[_0x558f0c(0xae)]&&(_0x2e0503[_0x558f0c(0x107)]=_0x2a49f8['journeyBundleId']),_0x2a49f8[_0x558f0c(0xff)]&&(_0x2e0503[_0x558f0c(0xf0)]=_0x2a49f8[_0x558f0c(0xff)]),_0x1a2c2b['relationships']?.[_0x558f0c(0x71)]?.[_0x558f0c(0xd6)]?.['id']&&(_0x2e0503['folder_id']=_0x1a2c2b['relationships']['parentFolder'][_0x558f0c(0xd6)]['id']),_0x2e0503;}export async function journeyResponseToDef(_0x20470d,_0x3d60a1){const _0xf64a6=a147_0x5d42,_0x20bfb7=journeyResponseToDefSync(_0x20470d);if(!_0x3d60a1)return _0x20bfb7;const _0x110948=new Set();collectSegmentIdsFromJourney(_0x20bfb7,_0x110948);const _0x1a7d7e=new Set();collectActivationIdsFromJourney(_0x20bfb7,_0x1a7d7e);const _0x3c0706={},_0x114ef8=new Map();for(const _0x41273c of Array[_0xf64a6(0xc1)](_0x110948)[_0xf64a6(0x116)]()){if(_0x3d60a1[_0xf64a6(0x84)]){const _0x2b63a1=await _0x3d60a1[_0xf64a6(0x84)](_0x41273c);if(_0x2b63a1[_0xf64a6(0xca)]){_0x114ef8[_0xf64a6(0x9d)](_0x41273c,_0x2b63a1[_0xf64a6(0x128)]);if(_0x2b63a1[_0xf64a6(0xfd)]){const _0x307afd={..._0x2b63a1[_0xf64a6(0xfd)],'rule':deepSortObject(_0x2b63a1['definition'][_0xf64a6(0xd3)])};_0x3c0706[_0x2b63a1[_0xf64a6(0x128)]]=_0x307afd;}}else _0x114ef8['set'](_0x41273c,makeSegmentRef(_0x2b63a1[_0xf64a6(0x128)]));}else{if(_0x3d60a1[_0xf64a6(0xa7)]){const _0x14a0e9=await _0x3d60a1[_0xf64a6(0xa7)](_0x41273c);_0x114ef8[_0xf64a6(0x9d)](_0x41273c,_0x14a0e9);}}}const _0x57f232={},_0x46f03b=new Map();for(const _0x279370 of Array[_0xf64a6(0xc1)](_0x1a7d7e)[_0xf64a6(0x116)]()){if(_0x3d60a1[_0xf64a6(0x98)]){const _0x5da94d=await _0x3d60a1[_0xf64a6(0x98)](_0x279370);_0x5da94d['isJourneyLocal']?(_0x46f03b[_0xf64a6(0x9d)](_0x279370,_0x5da94d[_0xf64a6(0x128)]),_0x5da94d[_0xf64a6(0xfd)]&&(_0x57f232[_0x5da94d['name']]=_0x5da94d[_0xf64a6(0xfd)])):_0x46f03b['set'](_0x279370,makeSegmentRef(_0x5da94d[_0xf64a6(0x128)]));}else{if(_0x3d60a1[_0xf64a6(0xbd)]){const _0x52a07a=await _0x3d60a1['resolveActivationName'](_0x279370);_0x46f03b[_0xf64a6(0x9d)](_0x279370,_0x52a07a);}}}_0x114ef8[_0xf64a6(0x111)]>0x0&&replaceSegmentIdsInJourney(_0x20bfb7,_0x114ef8);_0x46f03b[_0xf64a6(0x111)]>0x0&&replaceActivationIdsInJourney(_0x20bfb7,_0x46f03b);if(_0x3d60a1['resolveJumpTarget']){const _0x326af2=[];collectJumpTargetsFromJourney(_0x20bfb7,_0x326af2);if(_0x326af2[_0xf64a6(0xf1)]>0x0){const _0x16c636=new Map();for(const _0x2a5ea5 of _0x326af2){try{const _0x456535=await _0x3d60a1[_0xf64a6(0xa3)](_0x2a5ea5[_0xf64a6(0x90)],_0x2a5ea5[_0xf64a6(0xce)]);_0x16c636[_0xf64a6(0x9d)](_0x2a5ea5['journeyId']+':'+_0x2a5ea5[_0xf64a6(0xce)],_0x456535);}catch{}}_0x16c636[_0xf64a6(0x111)]>0x0&&replaceJumpTargetsInJourney(_0x20bfb7,_0x16c636);}}return Object[_0xf64a6(0xd1)](_0x3c0706)['length']>0x0&&(_0x20bfb7['segments']=_0x3c0706),Object[_0xf64a6(0xd1)](_0x57f232)[_0xf64a6(0xf1)]>0x0&&(_0x20bfb7[_0xf64a6(0x76)]=_0x57f232),_0x20bfb7;}function collectSegmentIdsFromJourney(_0x10d12b,_0x334c2a){const _0x5b9809=a147_0x5d42;_0x10d12b[_0x5b9809(0xb8)]?.['segment']&&_0x334c2a[_0x5b9809(0xaf)](_0x10d12b[_0x5b9809(0xb8)][_0x5b9809(0x81)]);const _0x346ff8=_0x4e492f=>{const _0xa1303=_0x5b9809;for(const _0x255b99 of _0x4e492f){_0x255b99[_0xa1303(0x88)]?.['segment']&&_0x334c2a[_0xa1303(0xaf)](_0x255b99['entry_criteria'][_0xa1303(0x81)]);if(_0x255b99[_0xa1303(0xe7)])for(const _0x599f14 of _0x255b99['exit_criteria']){_0x599f14[_0xa1303(0x81)]&&_0x334c2a[_0xa1303(0xaf)](_0x599f14[_0xa1303(0x81)]);}_0x255b99[_0xa1303(0xa6)]?.[_0xa1303(0x81)]&&_0x334c2a[_0xa1303(0xaf)](_0x255b99[_0xa1303(0xa6)]['segment']);if(_0x255b99[_0xa1303(0xb6)])for(const _0x4e3751 of _0x255b99['steps']){if(_0x4e3751[_0xa1303(0xa8)]===_0xa1303(0xe4)){const _0x44b5b7=_0x4e3751;for(const _0x17f198 of _0x44b5b7[_0xa1303(0xb3)][_0xa1303(0x10d)]){_0x17f198[_0xa1303(0x81)]&&_0x334c2a['add'](_0x17f198['segment']);}}else{if(_0x4e3751[_0xa1303(0xa8)]===_0xa1303(0x115)){const _0x1b9229=_0x4e3751;_0x1b9229[_0xa1303(0xb3)][_0xa1303(0x6d)]?.['segment']&&_0x334c2a[_0xa1303(0xaf)](_0x1b9229[_0xa1303(0xb3)][_0xa1303(0x6d)]['segment']);}}}}};if(_0x10d12b[_0x5b9809(0x7e)])for(const _0x271b59 of _0x10d12b['journeys']){_0x271b59['goal']?.[_0x5b9809(0x81)]&&_0x334c2a[_0x5b9809(0xaf)](_0x271b59[_0x5b9809(0xb8)][_0x5b9809(0x81)]),_0x346ff8(_0x271b59['stages']);}_0x10d12b[_0x5b9809(0xfe)]&&_0x346ff8(_0x10d12b[_0x5b9809(0xfe)]);if(_0x10d12b[_0x5b9809(0xdb)])for(const _0xfe74a2 of _0x10d12b[_0x5b9809(0xdb)]){_0x346ff8(_0xfe74a2[_0x5b9809(0xfe)]);}}function replaceSegmentIdsInJourney(_0x33771e,_0x564004){const _0x186647=a147_0x5d42,_0x4bbd05=_0x292e37=>_0x564004[_0x186647(0x105)](_0x292e37)||_0x292e37;_0x33771e[_0x186647(0xb8)]?.[_0x186647(0x81)]&&(_0x33771e[_0x186647(0xb8)][_0x186647(0x81)]=_0x4bbd05(_0x33771e[_0x186647(0xb8)]['segment']));const _0x45e060=_0x482a4b=>{const _0x191c4a=_0x186647;for(const _0x4cdffc of _0x482a4b){_0x4cdffc[_0x191c4a(0x88)]?.[_0x191c4a(0x81)]&&(_0x4cdffc[_0x191c4a(0x88)]['segment']=_0x4bbd05(_0x4cdffc[_0x191c4a(0x88)][_0x191c4a(0x81)]));if(_0x4cdffc[_0x191c4a(0xe7)])for(const _0x4ed8b4 of _0x4cdffc[_0x191c4a(0xe7)]){_0x4ed8b4[_0x191c4a(0x81)]&&(_0x4ed8b4[_0x191c4a(0x81)]=_0x4bbd05(_0x4ed8b4['segment']));}_0x4cdffc[_0x191c4a(0xa6)]?.[_0x191c4a(0x81)]&&(_0x4cdffc[_0x191c4a(0xa6)][_0x191c4a(0x81)]=_0x4bbd05(_0x4cdffc['milestone'][_0x191c4a(0x81)]));if(_0x4cdffc['steps'])for(const _0x1a4e53 of _0x4cdffc[_0x191c4a(0xb6)]){if(_0x1a4e53['type']===_0x191c4a(0xe4)){const _0x220f45=_0x1a4e53;for(const _0x523a36 of _0x220f45[_0x191c4a(0xb3)][_0x191c4a(0x10d)]){_0x523a36['segment']&&(_0x523a36[_0x191c4a(0x81)]=_0x4bbd05(_0x523a36[_0x191c4a(0x81)]));}}else{if(_0x1a4e53[_0x191c4a(0xa8)]===_0x191c4a(0x115)){const _0x5ada24=_0x1a4e53;_0x5ada24['with']['condition']?.['segment']&&(_0x5ada24[_0x191c4a(0xb3)][_0x191c4a(0x6d)]['segment']=_0x4bbd05(_0x5ada24[_0x191c4a(0xb3)]['condition'][_0x191c4a(0x81)]));}}}}};if(_0x33771e[_0x186647(0x7e)])for(const _0x48e06d of _0x33771e[_0x186647(0x7e)]){_0x48e06d[_0x186647(0xb8)]?.[_0x186647(0x81)]&&(_0x48e06d['goal'][_0x186647(0x81)]=_0x4bbd05(_0x48e06d[_0x186647(0xb8)][_0x186647(0x81)])),_0x45e060(_0x48e06d[_0x186647(0xfe)]);}_0x33771e['stages']&&_0x45e060(_0x33771e[_0x186647(0xfe)]);if(_0x33771e[_0x186647(0xdb)])for(const _0x3c7f78 of _0x33771e[_0x186647(0xdb)]){_0x45e060(_0x3c7f78['stages']);}}function collectActivationIdsFromJourney(_0xc49d69,_0x2ea3a6){const _0xfa9fa2=a147_0x5d42,_0x51e190=_0x5f9ec9=>{const _0x9d15fa=a147_0x5d42;for(const _0x22f8cc of _0x5f9ec9){if(_0x22f8cc[_0x9d15fa(0xb6)])for(const _0x245499 of _0x22f8cc[_0x9d15fa(0xb6)]){if(_0x245499[_0x9d15fa(0xa8)]===_0x9d15fa(0xed)){const _0x29db68=_0x245499;_0x29db68[_0x9d15fa(0xb3)][_0x9d15fa(0xed)]&&/^\d+$/[_0x9d15fa(0x75)](_0x29db68[_0x9d15fa(0xb3)][_0x9d15fa(0xed)])&&_0x2ea3a6[_0x9d15fa(0xaf)](_0x29db68[_0x9d15fa(0xb3)][_0x9d15fa(0xed)]);}}}};if(_0xc49d69[_0xfa9fa2(0x7e)])for(const _0x1a0ffc of _0xc49d69[_0xfa9fa2(0x7e)]){_0x51e190(_0x1a0ffc[_0xfa9fa2(0xfe)]);}_0xc49d69[_0xfa9fa2(0xfe)]&&_0x51e190(_0xc49d69['stages']);if(_0xc49d69[_0xfa9fa2(0xdb)])for(const _0x214a8e of _0xc49d69[_0xfa9fa2(0xdb)]){_0x51e190(_0x214a8e[_0xfa9fa2(0xfe)]);}}function replaceActivationIdsInJourney(_0x373c86,_0x366b7a){const _0x38d6d5=a147_0x5d42,_0x4541ab=_0x311cf3=>_0x366b7a['get'](_0x311cf3)||_0x311cf3,_0x5f4d4b=_0x165e50=>{const _0x25898f=a147_0x5d42;for(const _0x38f6ea of _0x165e50){if(_0x38f6ea[_0x25898f(0xb6)])for(const _0x29b177 of _0x38f6ea[_0x25898f(0xb6)]){if(_0x29b177[_0x25898f(0xa8)]===_0x25898f(0xed)){const _0x55651f=_0x29b177;_0x55651f[_0x25898f(0xb3)][_0x25898f(0xed)]&&(_0x55651f[_0x25898f(0xb3)][_0x25898f(0xed)]=_0x4541ab(_0x55651f['with'][_0x25898f(0xed)]));}}}};if(_0x373c86[_0x38d6d5(0x7e)])for(const _0x94d2ef of _0x373c86[_0x38d6d5(0x7e)]){_0x5f4d4b(_0x94d2ef[_0x38d6d5(0xfe)]);}_0x373c86[_0x38d6d5(0xfe)]&&_0x5f4d4b(_0x373c86['stages']);if(_0x373c86[_0x38d6d5(0xdb)])for(const _0x1f5eb5 of _0x373c86[_0x38d6d5(0xdb)]){_0x5f4d4b(_0x1f5eb5['stages']);}}function collectJumpTargetsFromJourney(_0x207c71,_0x366565){const _0x566dc2=a147_0x5d42,_0x143579=new Set(),_0x53c667=_0x423ce7=>{const _0xc851be=a147_0x5d42;for(const _0x502cde of _0x423ce7){if(_0x502cde[_0xc851be(0xb6)])for(const _0x1813c4 of _0x502cde['steps']){if(_0x1813c4[_0xc851be(0xa8)]==='jump'){const _0x441e22=_0x1813c4,_0x4d39b9=_0x441e22['with'][_0xc851be(0xd4)];if(_0x4d39b9['journey']&&_0x4d39b9[_0xc851be(0x127)]&&/^\d+$/['test'](_0x4d39b9[_0xc851be(0xf7)])&&/^\d+$/[_0xc851be(0x75)](_0x4d39b9[_0xc851be(0x127)])){const _0x4af532=_0x4d39b9[_0xc851be(0xf7)]+':'+_0x4d39b9[_0xc851be(0x127)];!_0x143579[_0xc851be(0x79)](_0x4af532)&&(_0x143579['add'](_0x4af532),_0x366565[_0xc851be(0x10a)]({'journeyId':_0x4d39b9[_0xc851be(0xf7)],'stageId':_0x4d39b9['stage']}));}}}}};if(_0x207c71[_0x566dc2(0x7e)])for(const _0x1eae71 of _0x207c71[_0x566dc2(0x7e)]){_0x53c667(_0x1eae71['stages']);}_0x207c71[_0x566dc2(0xfe)]&&_0x53c667(_0x207c71[_0x566dc2(0xfe)]);if(_0x207c71[_0x566dc2(0xdb)])for(const _0x3e9e1e of _0x207c71[_0x566dc2(0xdb)]){_0x53c667(_0x3e9e1e['stages']);}}function replaceJumpTargetsInJourney(_0x365260,_0xd6e800){const _0x42d058=a147_0x5d42,_0x4414c1=_0x3eccc6=>{const _0x2d7d47=a147_0x5d42;for(const _0x135164 of _0x3eccc6){if(_0x135164[_0x2d7d47(0xb6)])for(const _0x81eec4 of _0x135164[_0x2d7d47(0xb6)]){if(_0x81eec4['type']===_0x2d7d47(0xeb)){const _0x478437=_0x81eec4,_0x168e82=_0x478437[_0x2d7d47(0xb3)]['target'],_0x41b57b=_0x168e82['journey']+':'+_0x168e82[_0x2d7d47(0x127)],_0x137e21=_0xd6e800[_0x2d7d47(0x105)](_0x41b57b);_0x137e21&&(_0x168e82[_0x2d7d47(0xf7)]=_0x137e21[_0x2d7d47(0x106)],_0x168e82[_0x2d7d47(0x127)]=_0x137e21[_0x2d7d47(0xc7)]);}}}};if(_0x365260[_0x42d058(0x7e)])for(const _0x4500c3 of _0x365260['journeys']){_0x4414c1(_0x4500c3[_0x42d058(0xfe)]);}_0x365260[_0x42d058(0xfe)]&&_0x4414c1(_0x365260[_0x42d058(0xfe)]);if(_0x365260[_0x42d058(0xdb)])for(const _0x57c2e3 of _0x365260[_0x42d058(0xdb)]){_0x4414c1(_0x57c2e3[_0x42d058(0xfe)]);}}function generateReadableStepName(_0x4d3721,_0x4fc4d8){const _0x222061=a147_0x5d42;if(_0x4d3721[_0x222061(0x128)]&&_0x4d3721['name']!==_0x4d3721[_0x222061(0xa8)]){const _0x239789=_0x4d3721[_0x222061(0x128)]['trim']();if(_0x239789&&/[a-z0-9\p{L}]/iu[_0x222061(0x75)](_0x239789))return _0x239789;}const _0x494914=_0x4d3721['type'][_0x222061(0x11a)]()['replace'](/step$/i,'');return _0x494914+'_'+(_0x4fc4d8+0x1);}function getStepNextRefs(_0x21341d){const _0x4c8d04=a147_0x5d42,_0x5d2d56=[];if(_0x21341d[_0x4c8d04(0x78)])_0x5d2d56['push'](_0x21341d[_0x4c8d04(0x78)]);if(_0x21341d['branches'])for(const _0x374c01 of _0x21341d['branches']){if(_0x374c01[_0x4c8d04(0x78)])_0x5d2d56[_0x4c8d04(0x10a)](_0x374c01[_0x4c8d04(0x78)]);}if(_0x21341d[_0x4c8d04(0xe5)])for(const _0x5eb0ac of _0x21341d[_0x4c8d04(0xe5)]){if(_0x5eb0ac[_0x4c8d04(0x78)])_0x5d2d56['push'](_0x5eb0ac['next']);}if(_0x21341d[_0x4c8d04(0x6c)])for(const _0x3f71ce of _0x21341d['conditions']){if(_0x3f71ce[_0x4c8d04(0x78)])_0x5d2d56[_0x4c8d04(0x10a)](_0x3f71ce[_0x4c8d04(0x78)]);}return _0x5d2d56;}function parseJumpTargetDisplayName(_0x40dd16){const _0xb4bfbf=a147_0x5d42,_0x718312=_0x40dd16['match'](/^(.+?)\s*\(([^/)]+)/);if(!_0x718312)return undefined;const _0x5e7ca1=_0x718312[0x1][_0xb4bfbf(0x80)](),_0x1909b5=_0x718312[0x2][_0xb4bfbf(0x80)]();if(!_0x5e7ca1||!_0x1909b5)return undefined;return{'stageName':_0x5e7ca1,'journeyName':_0x1909b5};}function orderStepsFromRoot(_0x1163af,_0x43319a){const _0x1bc7c=a147_0x5d42,_0x56801a=Object[_0x1bc7c(0x73)](_0x1163af);if(_0x56801a[_0x1bc7c(0xf1)]===0x0)return[];const _0x1205ce=new Set(_0x56801a[_0x1bc7c(0xac)](([_0x277c37])=>_0x277c37)),_0x5ef3ff=new Set();for(const [,_0x7afcc1]of _0x56801a){for(const _0x19d77e of getStepNextRefs(_0x7afcc1)){if(_0x1205ce[_0x1bc7c(0x79)](_0x19d77e))_0x5ef3ff[_0x1bc7c(0xaf)](_0x19d77e);}}let _0x2b48fa=_0x43319a&&_0x1205ce[_0x1bc7c(0x79)](_0x43319a)?_0x43319a:undefined;if(!_0x2b48fa){const _0x1d3958=_0x56801a[_0x1bc7c(0x10f)](([_0x304db9])=>!_0x5ef3ff['has'](_0x304db9));_0x1d3958[_0x1bc7c(0xf1)]>0x0?_0x2b48fa=_0x1d3958[0x0][0x0]:_0x2b48fa=_0x56801a[0x0][0x0];}const _0x8c696e=[],_0x55d0e9=new Set(),_0x3340e0=[_0x2b48fa];while(_0x3340e0['length']>0x0){const _0x3a7c97=_0x3340e0[_0x1bc7c(0xef)]();if(_0x55d0e9[_0x1bc7c(0x79)](_0x3a7c97))continue;_0x55d0e9[_0x1bc7c(0xaf)](_0x3a7c97);const _0xdbafab=_0x1163af[_0x3a7c97];if(!_0xdbafab)continue;_0x8c696e[_0x1bc7c(0x10a)]({'uuid':_0x3a7c97,'step':_0xdbafab});for(const _0x520e9e of getStepNextRefs(_0xdbafab)){_0x1205ce['has'](_0x520e9e)&&!_0x55d0e9[_0x1bc7c(0x79)](_0x520e9e)&&_0x3340e0[_0x1bc7c(0x10a)](_0x520e9e);}}for(const [_0x40d63b,_0x6873d1]of _0x56801a){!_0x55d0e9[_0x1bc7c(0x79)](_0x40d63b)&&_0x8c696e[_0x1bc7c(0x10a)]({'uuid':_0x40d63b,'step':_0x6873d1});}return _0x8c696e;}function resolveStepReferences(_0x38d3dc,_0x52ed8e,_0x2dc25c,_0x57a70a){const _0x3daef9=a147_0x5d42;if(_0x38d3dc[_0x3daef9(0xa8)]!=='end'){_0x38d3dc[_0x3daef9(0x78)]&&_0x57a70a['has'](_0x38d3dc[_0x3daef9(0x78)])&&(_0x38d3dc[_0x3daef9(0x78)]=_0x57a70a['get'](_0x38d3dc[_0x3daef9(0x78)]));const _0x212439=_0x52ed8e+0x1;if(_0x212439<_0x2dc25c[_0x3daef9(0xf1)]){const _0x5f18d0=_0x57a70a[_0x3daef9(0x105)](_0x2dc25c[_0x212439][_0x3daef9(0x7d)]);_0x38d3dc[_0x3daef9(0x78)]===_0x5f18d0&&delete _0x38d3dc['next'];}}if(_0x38d3dc[_0x3daef9(0xa8)]===_0x3daef9(0xe4))for(const _0xf7ddfb of _0x38d3dc[_0x3daef9(0xb3)][_0x3daef9(0x10d)]){_0xf7ddfb[_0x3daef9(0x78)]&&_0x57a70a['has'](_0xf7ddfb[_0x3daef9(0x78)])&&(_0xf7ddfb[_0x3daef9(0x78)]=_0x57a70a[_0x3daef9(0x105)](_0xf7ddfb[_0x3daef9(0x78)]));}if(_0x38d3dc[_0x3daef9(0xa8)]===_0x3daef9(0xcb))for(const _0x4d24d6 of _0x38d3dc['with']['variants']){_0x4d24d6[_0x3daef9(0x78)]&&_0x57a70a[_0x3daef9(0x79)](_0x4d24d6[_0x3daef9(0x78)])&&(_0x4d24d6[_0x3daef9(0x78)]=_0x57a70a['get'](_0x4d24d6[_0x3daef9(0x78)]));}if(_0x38d3dc[_0x3daef9(0xa8)]===_0x3daef9(0x115)&&_0x38d3dc['with']['condition']){const _0x4e7d5d=_0x38d3dc['with'][_0x3daef9(0x6d)];_0x4e7d5d[_0x3daef9(0x78)]&&_0x57a70a[_0x3daef9(0x79)](_0x4e7d5d[_0x3daef9(0x78)])&&(_0x4e7d5d[_0x3daef9(0x78)]=_0x57a70a[_0x3daef9(0x105)](_0x4e7d5d[_0x3daef9(0x78)])),_0x4e7d5d[_0x3daef9(0xd0)]?.[_0x3daef9(0x78)]&&_0x57a70a[_0x3daef9(0x79)](_0x4e7d5d['timeout']['next'])&&(_0x4e7d5d[_0x3daef9(0xd0)][_0x3daef9(0x78)]=_0x57a70a[_0x3daef9(0x105)](_0x4e7d5d[_0x3daef9(0xd0)][_0x3daef9(0x78)]));}}function convertApiStageToYaml(_0x3cc7b9){const _0x1b3636=a147_0x5d42,_0x538ae2={'name':_0x3cc7b9[_0x1b3636(0x128)]};_0x3cc7b9['id']&&(_0x538ae2['id']=_0x3cc7b9['id']);_0x3cc7b9[_0x1b3636(0xa9)]&&(_0x538ae2['description']=_0x3cc7b9[_0x1b3636(0xa9)]);_0x3cc7b9[_0x1b3636(0x77)]&&(_0x538ae2[_0x1b3636(0x88)]=convertApiCriteriaToYaml(_0x3cc7b9[_0x1b3636(0x77)]));_0x3cc7b9['exitCriterias']&&_0x3cc7b9['exitCriterias'][_0x1b3636(0xf1)]>0x0&&(_0x538ae2['exit_criteria']=_0x3cc7b9[_0x1b3636(0xbf)]['map'](convertApiCriteriaToYaml));_0x3cc7b9[_0x1b3636(0xa6)]&&(_0x538ae2['milestone']=convertApiCriteriaToYaml(_0x3cc7b9[_0x1b3636(0xa6)]));if(_0x3cc7b9[_0x1b3636(0xb6)]&&Object[_0x1b3636(0xd1)](_0x3cc7b9[_0x1b3636(0xb6)])[_0x1b3636(0xf1)]>0x0){const _0x59bfb2=orderStepsFromRoot(_0x3cc7b9['steps'],_0x3cc7b9['rootStep']),_0x489211=new Map(),_0xaa4572=new Set();for(let _0x36549f=0x0;_0x36549f<_0x59bfb2[_0x1b3636(0xf1)];_0x36549f++){const {uuid:_0xac954d,step:_0x2bb7d1}=_0x59bfb2[_0x36549f];let _0x2ab78b=generateReadableStepName(_0x2bb7d1,_0x36549f),_0x539339=_0x2ab78b,_0x44e234=0x2;while(_0xaa4572[_0x1b3636(0x79)](_0x539339)){_0x539339=_0x2ab78b+'_'+_0x44e234,_0x44e234++;}_0xaa4572[_0x1b3636(0xaf)](_0x539339),_0x489211[_0x1b3636(0x9d)](_0xac954d,_0x539339);}_0x538ae2[_0x1b3636(0xb6)]=_0x59bfb2['map'](({uuid:_0x573474,step:_0x36e551},_0x46b3a0)=>{const _0xcb3d51=_0x1b3636,_0x200fbb=convertApiStepToYaml(_0x36e551,_0x489211[_0xcb3d51(0x105)](_0x573474));return resolveStepReferences(_0x200fbb,_0x46b3a0,_0x59bfb2,_0x489211),_0x200fbb;});}return _0x538ae2;}function a147_0x13c5(){const _0x16ffcd=['get','journeyName','bundle_id','merge','6855156zQFKlR','push','\x22.\x20Define\x20it\x20in\x20the\x20segments\x20section\x20or\x20use\x20\x22ref:','versionNumber','branches','83745UwWbHh','filter','weeks','size','end','connector_config','behavior','wait','sort','Journey\x20description','AbTest','reentry_always','toLowerCase','schedule','resolveSegmentId','includes','reentryMode','days','week','latest','moveAfter','Stage\x20Complete','waitStepType','waitUntilDate','folder_id','stage','name','Date','Goal\x20Achieved','Condition','resolveStageId','1883826kzXCMb','Variant','conditions','condition','percentage','3ktcbeU','\x20\x20\x20\x20type:\x20','parentFolder','350976rssbPb','entries','conditionSegmentId','test','activations','entryCriteria','next','has','rule.conditions\x20must\x20be\x20an\x20array\x20of\x20conditions.\x0a','version_number','ABTest','uuid','journeys','segmentId','trim','segment','timedOutPath','Entry\x20Criteria','resolveSegment','excluded','segment_id','1084676gPOpLs','entry_criteria','\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...','no_reentry','First\x20stage\x20of\x20the\x20journey','\x27.\x0a','Stage\x201','\x20\x20\x20\x20\x20\x20\x20\x20attribute:\x20...\x0a','resolveJourneyId','journeyId','day','2350392pShVvl','stages:','all','segments:','\x20\x20\x20\x20type:\x20And\x0a','root_step','resolveActivation','customized_split','resolveEmbeddedActivationId','waitStep','journeyStageId','set','object','Expected\x20format:\x0a','\x27:\x20','\x20\x20rule:\x0a','randomUUID','resolveJumpTarget','Invalid\x20rule\x20in\x20embedded\x20segment\x20\x27','version','milestone','resolveSegmentName','type','description','versions:','attributes','map','find','journeyBundleId','add','wait_until','waitCondition','*Max\x20wait\x20','with','your-activation-name','End','steps','WaitStep','goal','\x20\x20\x20\x20conditions:\x0a','daysOfWeek','allowReentry','resolveActivationId','resolveActivationName','all_columns','exitCriterias','null','from','reentry:','300917XXBMNV','ref:','duration','connection','stageName','embedded','170pYcdJS','isJourneyLocal','ab_test','JOURNEY_SYNTAX_ERROR','waitStepUnit','stageId','Jump','timeout','keys','conditionTimeoutDuration','rule','target','reentry','data','Duration','5ZtpEgc','2FrvCxl','startsWith','versions','goal-segment','Send\x20Notification','resolveEmbeddedSegmentId','draft','notification','DecisionPoint','rootStep','segments','decision_point','variants','values','exit_criteria','unique_id','folder','ref','jump','launched','activation','DaysOfTheWeek','shift','bundle_name','length','rule.type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','Activation','isArray','state','activation_template_id','journey','columns','Wait\x201\x20Day','conditionTimeoutUnit','(missing)','unit','definition','stages','journeyBundleName','\x22\x20to\x20reference\x20an\x20existing\x20child\x20segment.','\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a','days_of_week','journeys:','Merge'];a147_0x13c5=function(){return _0x16ffcd;};return a147_0x13c5();}function convertApiCriteriaToYaml(_0x3c700b){const _0x29312=a147_0x5d42,_0x50e0e9={'name':_0x3c700b['name'],'segment':_0x3c700b[_0x29312(0x7f)]};_0x3c700b[_0x29312(0xa9)]&&(_0x50e0e9[_0x29312(0xa9)]=_0x3c700b[_0x29312(0xa9)]);if(_0x3c700b[_0x29312(0xd4)]){let _0x33bff9=_0x3c700b['target']['journeyId'],_0x3873a7=_0x3c700b[_0x29312(0xd4)][_0x29312(0x9c)];if(_0x3c700b[_0x29312(0xd4)]['journeyName']){const _0x1cd510=parseJumpTargetDisplayName(_0x3c700b[_0x29312(0xd4)][_0x29312(0x106)]);_0x1cd510&&(_0x3873a7=_0x1cd510['stageName'],_0x33bff9=_0x1cd510[_0x29312(0x106)]);}_0x50e0e9[_0x29312(0xd4)]={'journey':_0x33bff9,'stage':_0x3873a7},_0x3c700b[_0x29312(0xd4)][_0x29312(0xae)]&&(_0x50e0e9['target'][_0x29312(0x107)]=_0x3c700b[_0x29312(0xd4)][_0x29312(0xae)]);}return _0x50e0e9;}function convertApiStepToYaml(_0x2120ec,_0x12e661){const _0x31ca86=a147_0x5d42;switch(_0x2120ec[_0x31ca86(0xa8)]){case _0x31ca86(0xb7):{const _0x318c1c={};if(_0x2120ec['waitStepType']==='Duration'&&_0x2120ec[_0x31ca86(0x9b)]!==undefined)_0x318c1c[_0x31ca86(0xc5)]=_0x2120ec[_0x31ca86(0x9b)],_0x318c1c[_0x31ca86(0xfc)]=_0x2120ec[_0x31ca86(0xcd)];else{if(_0x2120ec['waitStepType']===_0x31ca86(0x129)&&_0x2120ec[_0x31ca86(0x125)])_0x318c1c['wait_until']=_0x2120ec[_0x31ca86(0x125)];else{if(_0x2120ec[_0x31ca86(0x124)]===_0x31ca86(0xee)&&_0x2120ec[_0x31ca86(0xba)])_0x318c1c[_0x31ca86(0x102)]=_0x2120ec[_0x31ca86(0xba)];else{if(_0x2120ec[_0x31ca86(0x124)]===_0x31ca86(0x12b)){if(_0x2120ec[_0x31ca86(0x6c)]&&_0x2120ec[_0x31ca86(0x6c)][_0x31ca86(0xf1)]>0x0){const _0x4ee353=_0x2120ec[_0x31ca86(0x6c)][_0x31ca86(0xad)](_0x368a2e=>!_0x368a2e['timedOutPath']),_0xabfdce=_0x2120ec[_0x31ca86(0x6c)]['find'](_0x3903da=>_0x3903da[_0x31ca86(0x82)]);_0x4ee353?.[_0x31ca86(0x7f)]&&(_0x318c1c['condition']={'segment':_0x4ee353['segmentId'],..._0x4ee353[_0x31ca86(0x78)]?{'next':_0x4ee353[_0x31ca86(0x78)]}:{}},_0xabfdce&&_0xabfdce[_0x31ca86(0x122)]!==undefined&&_0xabfdce[_0x31ca86(0xfc)]&&(_0x318c1c[_0x31ca86(0x6d)]['timeout']={'duration':_0xabfdce[_0x31ca86(0x122)],'unit':_0xabfdce[_0x31ca86(0xfc)],..._0xabfdce['next']?{'next':_0xabfdce['next']}:{}}));}else _0x2120ec['conditionSegmentId']&&(_0x318c1c['condition']={'segment':_0x2120ec[_0x31ca86(0x74)]},_0x2120ec[_0x31ca86(0xd2)]!==undefined&&_0x2120ec[_0x31ca86(0xfa)]&&(_0x318c1c['condition'][_0x31ca86(0xd0)]={'duration':_0x2120ec[_0x31ca86(0xd2)],'unit':_0x2120ec[_0x31ca86(0xfa)]}));}}}}const _0x20e03f={'type':_0x31ca86(0x115),'name':_0x12e661,..._0x2120ec['next']?{'next':_0x2120ec[_0x31ca86(0x78)]}:{},'with':_0x318c1c};return _0x20e03f;}case _0x31ca86(0xf3):{const _0x16d63f={'type':_0x31ca86(0xed),'name':_0x12e661,..._0x2120ec[_0x31ca86(0x78)]?{'next':_0x2120ec['next']}:{},'with':{'activation':_0x2120ec['journeyActivationStepId']||''}};return _0x16d63f;}case'DecisionPoint':{const _0xf3f223={'type':_0x31ca86(0xe4),'name':_0x12e661,..._0x2120ec[_0x31ca86(0x78)]?{'next':_0x2120ec[_0x31ca86(0x78)]}:{},'with':{'branches':(_0x2120ec[_0x31ca86(0x10d)]||[])['map'](_0x4256e6=>({'name':_0x4256e6[_0x31ca86(0x128)],'segment':_0x4256e6[_0x31ca86(0x7f)],'excluded':_0x4256e6['excludedPath'],..._0x4256e6['next']?{'next':_0x4256e6['next']}:{}}))}};return _0xf3f223;}case _0x31ca86(0x7c):case _0x31ca86(0x118):case _0x31ca86(0x6b):{const _0x4d5d52=_0x2120ec['variants']||(_0x2120ec[_0x31ca86(0x10d)]||[])[_0x31ca86(0xac)](_0x59f397=>({'name':_0x59f397[_0x31ca86(0x128)],'percentage':0x0,'next':_0x59f397[_0x31ca86(0x78)]})),_0x4beace={'type':_0x31ca86(0xcb),'name':_0x12e661,..._0x2120ec[_0x31ca86(0x78)]?{'next':_0x2120ec['next']}:{},'with':{'customized_split':_0x2120ec['customizedSplit'],'unique_id':_0x2120ec['uniqueId'],'variants':_0x4d5d52[_0x31ca86(0xac)](_0x3a71b6=>({'name':_0x3a71b6[_0x31ca86(0x128)],'percentage':_0x3a71b6[_0x31ca86(0x6e)],..._0x3a71b6[_0x31ca86(0x78)]?{'next':_0x3a71b6['next']}:{}}))}};return _0x4beace;}case _0x31ca86(0x104):{const _0x250683={'type':_0x31ca86(0x108),'name':_0x12e661,..._0x2120ec[_0x31ca86(0x78)]?{'next':_0x2120ec[_0x31ca86(0x78)]}:{}};return _0x250683;}case _0x31ca86(0xcf):{let _0x457d76='',_0x2c0565='',_0x52ed30;if(_0x2120ec[_0x31ca86(0xd4)]){_0x457d76=_0x2120ec[_0x31ca86(0xd4)][_0x31ca86(0x90)],_0x2c0565=_0x2120ec[_0x31ca86(0xd4)][_0x31ca86(0x9c)],_0x52ed30=_0x2120ec[_0x31ca86(0xd4)][_0x31ca86(0xae)];if(_0x2120ec[_0x31ca86(0xd4)][_0x31ca86(0x106)]){const _0x481ece=parseJumpTargetDisplayName(_0x2120ec[_0x31ca86(0xd4)][_0x31ca86(0x106)]);_0x481ece&&(_0x2c0565=_0x481ece['stageName'],_0x457d76=_0x481ece['journeyName']);}}const _0x5b1f35={'type':'jump','name':_0x12e661,..._0x2120ec[_0x31ca86(0x78)]?{'next':_0x2120ec['next']}:{},'with':{'target':{'journey':_0x457d76,'stage':_0x2c0565,..._0x52ed30?{'bundle_id':_0x52ed30}:{}}}};return _0x5b1f35;}case _0x31ca86(0xb5):{const _0x24e072={'type':_0x31ca86(0x112),'name':_0x12e661};return _0x24e072;}default:{const _0x471367={'type':'end','name':_0x12e661};return _0x471367;}}}export async function journeyDefToRequest(_0x5092dc,_0x155279,_0x40fafe){const _0x4cf895=a147_0x5d42,_0x194b9d=_0x5092dc[_0x4cf895(0xfe)]||getActiveStages(_0x5092dc),_0x503fed=isJourneysArrayMode(_0x5092dc)||isMultiVersionMode(_0x5092dc)?getLatestJourneyEntry(_0x5092dc):undefined,_0x4d4d20=_0x503fed?.[_0x4cf895(0xa5)]??_0x5092dc[_0x4cf895(0x128)],_0x35368e=_0x5092dc['segments']||{},_0x48636c=_0x5092dc[_0x4cf895(0x76)]||{},_0x5f0528={'type':'journey','attributes':{'name':_0x4d4d20,'audienceId':_0x155279,'journeyStages':await Promise['all'](_0x194b9d[_0x4cf895(0xac)](_0x529df2=>convertYamlStageToApi(_0x529df2,_0x40fafe,_0x35368e,_0x48636c)))}},_0x5a3115=_0x503fed?.['id']??_0x5092dc['id'];_0x5a3115&&(_0x5f0528['id']=_0x5a3115);_0x5092dc['description']&&(_0x5f0528[_0x4cf895(0xab)][_0x4cf895(0xa9)]=_0x5092dc[_0x4cf895(0xa9)]);const _0x29262a=getEffectiveGoal(_0x5092dc);_0x29262a&&(_0x5f0528['attributes']['goal']=await convertYamlCriteriaToApi(_0x29262a,_0x40fafe,_0x35368e));const _0x5a39ac=getEffectiveReentry(_0x5092dc);return _0x5a39ac&&(_0x5f0528['attributes']['reentryMode']=_0x5a39ac,_0x5f0528[_0x4cf895(0xab)][_0x4cf895(0xbb)]=_0x5a39ac!==_0x4cf895(0x8a)),_0x5092dc[_0x4cf895(0x126)]&&(_0x5f0528['relationships']={'parentFolder':{'data':{'id':_0x5092dc[_0x4cf895(0x126)],'type':_0x4cf895(0xe9)}}}),_0x5f0528;}async function convertYamlStageToApi(_0x328450,_0x4798ce,_0x47f315={},_0x194d78={}){const _0x97dd97=a147_0x5d42,_0xca46ae={'name':_0x328450[_0x97dd97(0x128)]};_0x328450['id']&&(_0xca46ae['id']=_0x328450['id']);_0x328450[_0x97dd97(0xa9)]&&(_0xca46ae[_0x97dd97(0xa9)]=_0x328450[_0x97dd97(0xa9)]);_0x328450['entry_criteria']&&(_0xca46ae[_0x97dd97(0x77)]=await convertYamlCriteriaToApi(_0x328450[_0x97dd97(0x88)],_0x4798ce,_0x47f315));_0x328450[_0x97dd97(0xe7)]&&_0x328450[_0x97dd97(0xe7)][_0x97dd97(0xf1)]>0x0&&(_0xca46ae[_0x97dd97(0xbf)]=await Promise[_0x97dd97(0x94)](_0x328450[_0x97dd97(0xe7)][_0x97dd97(0xac)](_0x181a51=>convertYamlCriteriaToApi(_0x181a51,_0x4798ce,_0x47f315))));_0x328450[_0x97dd97(0xa6)]&&(_0xca46ae[_0x97dd97(0xa6)]=await convertYamlCriteriaToApi(_0x328450[_0x97dd97(0xa6)],_0x4798ce,_0x47f315));if(_0x328450['steps']&&_0x328450[_0x97dd97(0xb6)][_0x97dd97(0xf1)]>0x0){const _0x16683b={},_0x5498e5=_0x328450[_0x97dd97(0xb6)]['map']((_0x54a0cb,_0x11af31)=>{const _0x4e4b61=_0x97dd97,_0x3b273e=_0x54a0cb[_0x4e4b61(0x7d)]||generateUUID(),_0x202d71=_0x54a0cb[_0x4e4b61(0x128)]||_0x54a0cb[_0x4e4b61(0xa8)]+'_'+_0x11af31;return _0x16683b[_0x202d71]=_0x3b273e,{..._0x54a0cb,'name':_0x202d71};});_0xca46ae[_0x97dd97(0xe2)]=_0x16683b[_0x5498e5[0x0][_0x97dd97(0x128)]],_0xca46ae[_0x97dd97(0xb6)]={};for(let _0x1fbfd6=0x0;_0x1fbfd6<_0x5498e5[_0x97dd97(0xf1)];_0x1fbfd6++){const _0x545ea3=_0x5498e5[_0x1fbfd6],_0x2b74c6=_0x16683b[_0x545ea3[_0x97dd97(0x128)]],_0xe3ad05=!_0x545ea3[_0x97dd97(0x78)]&&_0x1fbfd6<_0x5498e5[_0x97dd97(0xf1)]-0x1&&_0x545ea3[_0x97dd97(0xa8)]!==_0x97dd97(0x112)?_0x5498e5[_0x1fbfd6+0x1][_0x97dd97(0x128)]:_0x545ea3[_0x97dd97(0x78)],_0x5d0a53=_0xe3ad05!==_0x545ea3[_0x97dd97(0x78)]?{..._0x545ea3,'next':_0xe3ad05}:_0x545ea3;_0xca46ae['steps'][_0x2b74c6]=await convertYamlStepToApi(_0x5d0a53,_0x4798ce,_0x47f315,_0x16683b,_0x194d78);}}else _0x328450['root_step']&&(_0xca46ae[_0x97dd97(0xe2)]=_0x328450[_0x97dd97(0x97)]);return _0xca46ae;}async function convertYamlCriteriaToApi(_0x47ec3c,_0x136565,_0x518c7f={}){const _0x4890bf=a147_0x5d42;let _0xaa47d0=_0x47ec3c['segment'];if(_0xaa47d0&&!/^\d+$/[_0x4890bf(0x75)](_0xaa47d0)){const _0x58d738=parseSegmentRef(_0xaa47d0);if(_0x58d738['type']===_0x4890bf(0xea))_0x136565?.['resolveSegmentId']&&(_0xaa47d0=await _0x136565[_0x4890bf(0x11c)](_0x58d738[_0x4890bf(0x128)]));else{if(_0x58d738[_0x4890bf(0xa8)]===_0x4890bf(0xc8)&&_0x518c7f[_0x58d738['name']])_0x136565?.[_0x4890bf(0xde)]&&(_0xaa47d0=await _0x136565[_0x4890bf(0xde)](_0x58d738[_0x4890bf(0x128)],_0x518c7f[_0x58d738[_0x4890bf(0x128)]]));else _0x136565?.[_0x4890bf(0x11c)]&&(_0xaa47d0=await _0x136565[_0x4890bf(0x11c)](_0x58d738[_0x4890bf(0x128)]));}}const _0x29b128={'name':_0x47ec3c['name'],'segmentId':_0xaa47d0};_0x47ec3c[_0x4890bf(0xa9)]&&(_0x29b128[_0x4890bf(0xa9)]=_0x47ec3c[_0x4890bf(0xa9)]);if(_0x47ec3c[_0x4890bf(0xd4)]){const _0x58d4b7=_0x47ec3c[_0x4890bf(0xd4)]['journey'],_0x72c55c=_0x47ec3c[_0x4890bf(0xd4)]['stage'];let _0x1510e2=_0x47ec3c[_0x4890bf(0xd4)][_0x4890bf(0xf7)];_0x136565?.['resolveJourneyId']&&!/^\d+$/['test'](_0x1510e2)&&(_0x1510e2=await _0x136565['resolveJourneyId'](_0x1510e2));let _0x57968b=_0x47ec3c[_0x4890bf(0xd4)][_0x4890bf(0x127)];_0x136565?.['resolveStageId']&&!/^\d+$/['test'](_0x57968b)&&(_0x57968b=await _0x136565[_0x4890bf(0x12c)](_0x1510e2,_0x57968b));const _0x15f88b=!/^\d+$/[_0x4890bf(0x75)](_0x58d4b7)&&!isLocalJourneyRef(_0x58d4b7)?formatApiJourneyName(_0x58d4b7,_0x72c55c):undefined;_0x29b128[_0x4890bf(0xd4)]={'journeyId':_0x1510e2,'journeyStageId':_0x57968b,'journeyName':_0x15f88b,'confirmed':!![]},_0x47ec3c[_0x4890bf(0xd4)][_0x4890bf(0x107)]&&(_0x29b128[_0x4890bf(0xd4)][_0x4890bf(0xae)]=_0x47ec3c[_0x4890bf(0xd4)][_0x4890bf(0x107)]);}return _0x29b128;}async function convertYamlStepToApi(_0x3b8475,_0x24c138,_0x491a8b={},_0x582a6d={},_0x37b209={}){const _0x50dcba=a147_0x5d42,_0x54e2da=async _0x5dd55c=>{const _0x9aa32=a147_0x5d42;if(/^\d+$/[_0x9aa32(0x75)](_0x5dd55c))return _0x5dd55c;const _0x2de618=parseSegmentRef(_0x5dd55c);if(_0x2de618['type']==='ref'){if(_0x24c138?.[_0x9aa32(0x11c)])return await _0x24c138[_0x9aa32(0x11c)](_0x2de618['name']);}else{if(_0x2de618['type']==='embedded'&&_0x491a8b[_0x2de618[_0x9aa32(0x128)]]){if(_0x24c138?.[_0x9aa32(0xde)])return await _0x24c138[_0x9aa32(0xde)](_0x2de618[_0x9aa32(0x128)],_0x491a8b[_0x2de618['name']]);}else{if(_0x24c138?.['resolveSegmentId'])return await _0x24c138[_0x9aa32(0x11c)](_0x2de618[_0x9aa32(0x128)]);}}return _0x5dd55c;},_0x3371d3=async _0x54e0b4=>{const _0x5705c9=a147_0x5d42;if(/^\d+$/[_0x5705c9(0x75)](_0x54e0b4))return _0x54e0b4;const _0x4bb009=parseSegmentRef(_0x54e0b4);if(_0x4bb009[_0x5705c9(0xa8)]===_0x5705c9(0xea)){if(_0x24c138?.[_0x5705c9(0xbc)])return await _0x24c138[_0x5705c9(0xbc)](_0x4bb009['name']);return _0x4bb009[_0x5705c9(0x128)];}else{if(_0x4bb009[_0x5705c9(0xa8)]===_0x5705c9(0xc8)&&_0x37b209[_0x4bb009['name']]){if(_0x24c138?.['resolveEmbeddedActivationId'])return await _0x24c138[_0x5705c9(0x9a)](_0x4bb009['name'],_0x37b209[_0x4bb009[_0x5705c9(0x128)]]);if(_0x24c138?.[_0x5705c9(0xbc)])return await _0x24c138[_0x5705c9(0xbc)](_0x4bb009[_0x5705c9(0x128)]);}else{if(_0x24c138?.[_0x5705c9(0xbc)])return await _0x24c138[_0x5705c9(0xbc)](_0x4bb009[_0x5705c9(0x128)]);}}return _0x54e0b4;},_0x5310f3=_0xe96782=>{const _0x2a1a4c=a147_0x5d42;if(!_0xe96782)return undefined;if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i[_0x2a1a4c(0x75)](_0xe96782))return _0xe96782;return _0x582a6d[_0xe96782]||_0xe96782;};switch(_0x3b8475[_0x50dcba(0xa8)]){case _0x50dcba(0x115):{const _0x59f234=_0x3b8475,_0x135270=_0x59f234['with'],_0x59f10c={'type':_0x50dcba(0xb7),'name':_0x59f234[_0x50dcba(0x128)],'next':_0x5310f3(_0x59f234[_0x50dcba(0x78)])};if(_0x135270[_0x50dcba(0xc5)]!==undefined&&_0x135270['unit'])_0x59f10c['waitStepType']=_0x50dcba(0xd7),_0x59f10c[_0x50dcba(0x9b)]=_0x135270['duration'],_0x59f10c[_0x50dcba(0xcd)]=normalizeWaitUnit(_0x135270[_0x50dcba(0xfc)]);else{if(_0x135270[_0x50dcba(0xb0)])_0x59f10c[_0x50dcba(0x124)]='Date',_0x59f10c['waitUntilDate']=_0x135270[_0x50dcba(0xb0)];else{if(_0x135270[_0x50dcba(0x102)])_0x59f10c[_0x50dcba(0x124)]=_0x50dcba(0xee),_0x59f10c[_0x50dcba(0xba)]=_0x135270[_0x50dcba(0x102)];else{if(_0x135270[_0x50dcba(0x6d)]){_0x59f10c[_0x50dcba(0x124)]=_0x50dcba(0x12b);const _0x5ef4d6=await _0x54e2da(_0x135270[_0x50dcba(0x6d)][_0x50dcba(0x81)]),_0x3273e0=_0x135270[_0x50dcba(0x6d)]['timeout']?.['next']!==undefined;if(_0x3273e0){const _0x5e607e=[];_0x5e607e['push']({'id':generateUUID(),'segmentId':_0x5ef4d6,'timedOutPath':![],'name':'Met\x20condition(s)','next':_0x5310f3(_0x135270[_0x50dcba(0x6d)][_0x50dcba(0x78)]??_0x59f234[_0x50dcba(0x78)])});if(_0x135270[_0x50dcba(0x6d)]['timeout']){const _0x3d883b=_0x135270[_0x50dcba(0x6d)][_0x50dcba(0xd0)]['duration'],_0x1cdd32=normalizeWaitUnit(_0x135270[_0x50dcba(0x6d)][_0x50dcba(0xd0)]['unit']);_0x5e607e[_0x50dcba(0x10a)]({'id':generateUUID(),'timedOutPath':!![],'name':_0x50dcba(0xb2)+_0x3d883b+'\x20'+_0x1cdd32,'moveAfter':_0x3d883b,'unit':_0x1cdd32,'next':_0x5310f3(_0x135270[_0x50dcba(0x6d)][_0x50dcba(0xd0)]['next'])});}_0x59f10c['conditions']=_0x5e607e,delete _0x59f10c[_0x50dcba(0x78)];}else _0x59f10c[_0x50dcba(0x74)]=_0x5ef4d6,_0x135270[_0x50dcba(0x6d)]['timeout']&&(_0x59f10c[_0x50dcba(0xd2)]=_0x135270[_0x50dcba(0x6d)][_0x50dcba(0xd0)][_0x50dcba(0xc5)],_0x135270[_0x50dcba(0x6d)]['timeout'][_0x50dcba(0xfc)]&&(_0x59f10c[_0x50dcba(0xfa)]=normalizeWaitUnit(_0x135270['condition'][_0x50dcba(0xd0)][_0x50dcba(0xfc)])));}}}}return _0x59f10c;}case _0x50dcba(0xed):{const _0x5dff89=_0x3b8475,_0x591cab=_0x5dff89[_0x50dcba(0xb3)][_0x50dcba(0xed)],_0x57a182=await _0x3371d3(_0x591cab);return{'type':_0x50dcba(0xf3),'name':_0x5dff89['name'],'journeyActivationStepId':_0x57a182,'next':_0x5310f3(_0x5dff89[_0x50dcba(0x78)])};}case _0x50dcba(0xe4):{const _0x58d327=_0x3b8475,_0x539add=_0x58d327[_0x50dcba(0xb3)][_0x50dcba(0x10d)];return{'type':_0x50dcba(0xe1),'name':_0x58d327[_0x50dcba(0x128)],'branches':await Promise['all'](_0x539add[_0x50dcba(0xac)](async _0x15123f=>{const _0x49f125=_0x50dcba;let _0x2db275='';if(!_0x15123f[_0x49f125(0x85)]){const _0x1f8d06=_0x15123f[_0x49f125(0x81)]||_0x15123f[_0x49f125(0x86)]||'';_0x2db275=_0x1f8d06?await _0x54e2da(_0x1f8d06):'';}return{'id':crypto[_0x49f125(0xa2)](),'name':_0x15123f[_0x49f125(0x128)],'description':null,'segmentId':_0x2db275,'excludedPath':_0x15123f['excluded']??![],'next':_0x5310f3(_0x15123f[_0x49f125(0x78)])};})),'next':_0x5310f3(_0x58d327[_0x50dcba(0x78)])};}case'ab_test':{const _0x31f228=_0x3b8475,_0x44575e=_0x31f228[_0x50dcba(0xb3)];return{'type':_0x50dcba(0x7c),'name':_0x31f228['name'],'customizedSplit':_0x44575e[_0x50dcba(0x99)],'uniqueId':_0x44575e[_0x50dcba(0xe8)],'variants':_0x44575e['variants']['map'](_0x341d10=>({'id':_0x341d10['id']||generateUUID(),'name':_0x341d10[_0x50dcba(0x128)],'percentage':_0x341d10['percentage'],'next':_0x5310f3(_0x341d10[_0x50dcba(0x78)])})),'next':_0x5310f3(_0x31f228[_0x50dcba(0x78)])};}case _0x50dcba(0x108):return{'type':_0x50dcba(0x104),'name':_0x3b8475[_0x50dcba(0x128)],'next':_0x5310f3(_0x3b8475[_0x50dcba(0x78)])};case _0x50dcba(0xeb):{const _0xba56c=_0x3b8475,_0x175c8f=_0xba56c[_0x50dcba(0xb3)][_0x50dcba(0xd4)],_0x5902b2=_0x175c8f[_0x50dcba(0xf7)],_0x3c7896=_0x175c8f[_0x50dcba(0x127)];let _0x224f03=_0x175c8f[_0x50dcba(0xf7)];_0x24c138?.[_0x50dcba(0x8f)]&&!/^\d+$/[_0x50dcba(0x75)](_0x224f03)&&(_0x224f03=await _0x24c138[_0x50dcba(0x8f)](_0x224f03));let _0x112a6d=_0x175c8f[_0x50dcba(0x127)];_0x24c138?.[_0x50dcba(0x12c)]&&!/^\d+$/[_0x50dcba(0x75)](_0x112a6d)&&(_0x112a6d=await _0x24c138[_0x50dcba(0x12c)](_0x224f03,_0x112a6d));const _0x1d6d54=!/^\d+$/['test'](_0x5902b2)&&!isLocalJourneyRef(_0x5902b2)?formatApiJourneyName(_0x5902b2,_0x3c7896):undefined;return{'type':_0x50dcba(0xcf),'name':_0xba56c[_0x50dcba(0x128)],'target':{'journeyId':_0x224f03,'journeyStageId':_0x112a6d,'journeyBundleId':_0x175c8f[_0x50dcba(0x107)],'journeyName':_0x1d6d54,'confirmed':!![]},'next':_0x5310f3(_0xba56c[_0x50dcba(0x78)])};}case _0x50dcba(0x112):return{'type':'End','name':_0x3b8475[_0x50dcba(0x128)]};default:{const _0x543e18=_0x3b8475;return{'type':_0x50dcba(0xb5),'name':_0x543e18[_0x50dcba(0x128)]};}}}export function toYamlString(_0x5e6ba8){const _0x3c8b42=a147_0x5d42,_0x46c999=stripInternalFields(_0x5e6ba8),_0x316c63=a147_0x47bc69['stringify'](_0x46c999,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3c8b42(0xc0)}),_0x4d5c00=[_0x3c8b42(0x95),'activations:','goal:',_0x3c8b42(0xc2),_0x3c8b42(0x103),_0x3c8b42(0x93),_0x3c8b42(0xaa)];let _0x3cf466=_0x316c63;for(const _0x4cd8a6 of _0x4d5c00){_0x3cf466=_0x3cf466['replace'](new RegExp('^('+_0x4cd8a6+')','m'),(_0x34da5c,_0x5b2f19,_0x1354b0)=>{if(_0x1354b0===0x0||_0x3cf466[_0x1354b0-0x1]==='\x0a'&&_0x3cf466[_0x1354b0-0x2]==='\x0a')return _0x5b2f19;return'\x0a'+_0x5b2f19;});}return _0x3cf466;}function stripInternalFields(_0x13b082){const _0x2941a9=a147_0x5d42,{id:_0x15f80f,folder_id:_0x295729,bundle_id:_0x2df912,bundle_name:_0x79706,version:_0x3ac878,allow_reentry:_0x4cf799,..._0x5b4300}=_0x13b082;return _0x5b4300['journeys']&&(_0x5b4300[_0x2941a9(0x7e)]=_0x5b4300[_0x2941a9(0x7e)]['map'](_0x36db8e=>{const _0x1fdcb7=_0x2941a9,{id:_0x1e7864,..._0x9c675a}=_0x36db8e;return{..._0x9c675a,'stages':_0x9c675a['stages']['map'](stripStageInternalFields),..._0x36db8e[_0x1fdcb7(0x121)]===!![]?{'latest':!![]}:{},..._0x5b4300[_0x1fdcb7(0x7e)][_0x1fdcb7(0xf1)]===0x1&&_0x9c675a[_0x1fdcb7(0xa5)]==='v1'?{'version':undefined}:{}};})),_0x5b4300[_0x2941a9(0xfe)]&&(_0x5b4300['stages']=_0x5b4300['stages'][_0x2941a9(0xac)](stripStageInternalFields)),_0x5b4300[_0x2941a9(0xdb)]&&(_0x5b4300[_0x2941a9(0xdb)]=_0x5b4300[_0x2941a9(0xdb)]['map'](_0x59166a=>{const _0x2400e3=_0x2941a9,{id:_0x2c7134,..._0x5709ba}=_0x59166a;return{..._0x5709ba,'stages':_0x5709ba[_0x2400e3(0xfe)][_0x2400e3(0xac)](stripStageInternalFields),..._0x59166a[_0x2400e3(0x121)]===!![]?{'latest':!![]}:{}};})),_0x5b4300;}function stripStageInternalFields(_0x1a675d){const {id:_0x5f3508,..._0x1299d0}=_0x1a675d;return _0x1299d0;}export function parseYamlString(_0x1e6396){return safeParseYaml(_0x1e6396,JourneyDefSchema);}export function isJourneyDef(_0x1a61be){const _0x322420=a147_0x5d42;return typeof _0x1a61be===_0x322420(0x9e)&&_0x1a61be!==null&&_0x322420(0xa8)in _0x1a61be&&_0x1a61be[_0x322420(0xa8)]===_0x322420(0xf7);}export function generateTemplate(_0x190420,_0x23fb15){const _0xf4dd8f=a147_0x5d42,_0x4cb72c={'type':'journey','name':_0x190420,'description':_0xf4dd8f(0x117),'reentry':'no_reentry','goal':{'name':_0xf4dd8f(0x12a),'segment':_0xf4dd8f(0xdc)},'stages':[{'name':_0xf4dd8f(0x8d),'description':_0xf4dd8f(0x8b),'entry_criteria':{'name':_0xf4dd8f(0x83),'segment':_0x23fb15},'steps':[{'type':'wait','name':_0xf4dd8f(0xf9),'with':{'duration':0x1,'unit':_0xf4dd8f(0x91)}},{'type':_0xf4dd8f(0xed),'name':_0xf4dd8f(0xdd),'with':{'activation':_0xf4dd8f(0xb4)}},{'type':_0xf4dd8f(0x112),'name':_0xf4dd8f(0x123)}]}]};return toYamlString(_0x4cb72c);}function generateUUID(){return crypto['randomUUID']();}export const SEGMENT_REF_PREFIX=a147_0xbe4df2(0xc4);export function parseSegmentRef(_0x1c3c69){const _0x3ed7ac=a147_0xbe4df2;if(_0x1c3c69[_0x3ed7ac(0xda)](SEGMENT_REF_PREFIX))return{'type':'ref','name':_0x1c3c69['slice'](SEGMENT_REF_PREFIX['length'])};if(/^\d+$/['test'](_0x1c3c69))return{'type':'id','name':_0x1c3c69};return{'type':_0x3ed7ac(0xc8),'name':_0x1c3c69};}export function makeSegmentRef(_0x4953ed){return''+SEGMENT_REF_PREFIX+_0x4953ed;}export function isExternalSegmentRef(_0x4c927e){const _0x4958ae=a147_0xbe4df2;return _0x4c927e[_0x4958ae(0xda)](SEGMENT_REF_PREFIX);}export function isJourneysArrayMode(_0x5c3ba6){const _0x3ee700=a147_0xbe4df2;return!!(_0x5c3ba6[_0x3ee700(0x7e)]&&_0x5c3ba6['journeys'][_0x3ee700(0xf1)]>0x0);}export function isMultiVersionMode(_0x5245a8){const _0x17377f=a147_0xbe4df2;return!!(_0x5245a8[_0x17377f(0xdb)]&&_0x5245a8[_0x17377f(0xdb)]['length']>0x0);}export function isSingleVersionMode(_0xb4245b){const _0x16269f=a147_0xbe4df2;return!!(_0xb4245b[_0x16269f(0xfe)]&&_0xb4245b['stages']['length']>0x0);}export function hasMultipleVersions(_0x5b8a37){const _0x345aa0=a147_0xbe4df2;if(isJourneysArrayMode(_0x5b8a37))return(_0x5b8a37[_0x345aa0(0x7e)]?.[_0x345aa0(0xf1)]||0x0)>0x1;if(isMultiVersionMode(_0x5b8a37))return(_0x5b8a37[_0x345aa0(0xdb)]?.[_0x345aa0(0xf1)]||0x0)>0x1;return![];}export function normalizeToJourneysFormat(_0x4b6ca2){const _0x36813d=a147_0xbe4df2;if(isJourneysArrayMode(_0x4b6ca2))return _0x4b6ca2;if(isSingleVersionMode(_0x4b6ca2)){const {stages:_0x1ffdfd,id:_0x404e6d,version:_0x48f95d,version_number:_0x88b57b,..._0x43b280}=_0x4b6ca2;return{..._0x43b280,'journeys':[{'version':_0x48f95d||'v1','stages':_0x1ffdfd||[],'id':_0x404e6d,'version_number':_0x88b57b}]};}if(isMultiVersionMode(_0x4b6ca2)){const {versions:_0x4735f7,..._0x115d82}=_0x4b6ca2;return{..._0x115d82,'journeys':(_0x4735f7||[])[_0x36813d(0xac)](_0x388109=>({'version':_0x388109[_0x36813d(0x128)],'state':_0x388109[_0x36813d(0xf5)],'latest':_0x388109[_0x36813d(0x121)],'stages':_0x388109[_0x36813d(0xfe)],'id':_0x388109['id'],'version_number':_0x388109[_0x36813d(0x7b)]}))};}return _0x4b6ca2;}export function normalizeJourneyDef(_0x227c75,_0x3ba58b){const _0x3248fd=a147_0xbe4df2,_0xe1c673=normalizeToJourneysFormat(_0x227c75),_0x12a419=_0x3ba58b?.[_0x3248fd(0xe3)]?Object['keys'](_0x3ba58b['segments']):undefined,_0x13c979=_0x3ba58b?.[_0x3248fd(0x76)]?Object['keys'](_0x3ba58b[_0x3248fd(0x76)]):undefined;return{'type':'journey','name':_0xe1c673[_0x3248fd(0x128)],..._0xe1c673[_0x3248fd(0xa9)]!==undefined&&{'description':_0xe1c673[_0x3248fd(0xa9)]},..._0xe1c673[_0x3248fd(0xb8)]&&{'goal':normalizeJourneyCriteria(_0xe1c673[_0x3248fd(0xb8)])},..._0xe1c673['reentry']!==undefined&&{'reentry':_0xe1c673[_0x3248fd(0xd5)]},..._0xe1c673[_0x3248fd(0xe3)]&&{'segments':normalizeEmbeddedSegments(_0xe1c673[_0x3248fd(0xe3)],_0x12a419)},..._0xe1c673[_0x3248fd(0x76)]&&{'activations':normalizeEmbeddedActivations(_0xe1c673[_0x3248fd(0x76)],_0x13c979)},..._0xe1c673['journeys']&&{'journeys':_0xe1c673[_0x3248fd(0x7e)][_0x3248fd(0xac)](_0x51a4ed=>normalizeJourneyEntry(_0x51a4ed,_0xe1c673[_0x3248fd(0x7e)][_0x3248fd(0xf1)]===0x1))}};}function normalizeJourneyEntry(_0x3c9606,_0x13be1e){const _0x1dcab6=a147_0xbe4df2;return{...!_0x13be1e&&_0x3c9606[_0x1dcab6(0xa5)]!==undefined&&{'version':_0x3c9606['version']},..._0x3c9606['state']!==undefined&&{'state':_0x3c9606[_0x1dcab6(0xf5)]},...!_0x13be1e&&_0x3c9606[_0x1dcab6(0x121)]!==undefined&&{'latest':_0x3c9606['latest']},..._0x3c9606[_0x1dcab6(0x7b)]!==undefined&&{'version_number':_0x3c9606[_0x1dcab6(0x7b)]},..._0x3c9606[_0x1dcab6(0xb8)]&&{'goal':normalizeJourneyCriteria(_0x3c9606[_0x1dcab6(0xb8)])},..._0x3c9606[_0x1dcab6(0xd5)]!==undefined&&{'reentry':_0x3c9606[_0x1dcab6(0xd5)]},'stages':_0x3c9606[_0x1dcab6(0xfe)]['map'](normalizeJourneyStage)};}function normalizeJourneyStage(_0x353366){const _0x3cf22d=a147_0xbe4df2;return{'name':_0x353366[_0x3cf22d(0x128)],..._0x353366[_0x3cf22d(0xa9)]!==undefined&&{'description':_0x353366[_0x3cf22d(0xa9)]},..._0x353366[_0x3cf22d(0x88)]&&{'entry_criteria':normalizeJourneyCriteria(_0x353366[_0x3cf22d(0x88)])},..._0x353366[_0x3cf22d(0xe7)]&&{'exit_criteria':_0x353366['exit_criteria'][_0x3cf22d(0xac)](normalizeJourneyCriteria)},..._0x353366['milestone']&&{'milestone':normalizeJourneyCriteria(_0x353366[_0x3cf22d(0xa6)])},..._0x353366['steps']&&{'steps':normalizeStepsWithImplicitNext(_0x353366[_0x3cf22d(0xb6)])}};}function normalizeStepsWithImplicitNext(_0x44c809){const _0x362a67=a147_0xbe4df2;return _0x44c809[_0x362a67(0xac)]((_0x3e87b5,_0x389f45)=>{const _0x5514cd=_0x362a67,_0x6c5c21=_0x389f45<_0x44c809[_0x5514cd(0xf1)]-0x1?_0x44c809[_0x389f45+0x1]['name']:undefined;return normalizeJourneyStep(_0x3e87b5,_0x6c5c21);});}function normalizeJourneyCriteria(_0x3d9123){const _0x354bea=a147_0xbe4df2;return{'name':_0x3d9123[_0x354bea(0x128)],..._0x3d9123['description']!==undefined&&{'description':_0x3d9123['description']},'segment':_0x3d9123[_0x354bea(0x81)],..._0x3d9123[_0x354bea(0xd4)]&&{'target':normalizeJumpTarget(_0x3d9123['target'])}};}function normalizeJourneyStep(_0x206e87,_0x23eb31){const _0x178e7a=a147_0xbe4df2,_0x56bda9=_0x206e87[_0x178e7a(0x78)]!==undefined&&_0x206e87['next']!==_0x23eb31,_0x510b4f={'type':_0x206e87[_0x178e7a(0xa8)],'name':_0x206e87[_0x178e7a(0x128)],..._0x56bda9&&{'next':_0x206e87[_0x178e7a(0x78)]}};if(_0x178e7a(0xb3)in _0x206e87&&_0x206e87[_0x178e7a(0xb3)])return{..._0x510b4f,'with':normalizeStepParams(_0x206e87['type'],_0x206e87[_0x178e7a(0xb3)])};return _0x510b4f;}function normalizeStepParams(_0x4cddb0,_0x2e98c4){const _0x36635e=a147_0xbe4df2;switch(_0x4cddb0){case'wait':{const _0xb5651b=_0x2e98c4;let _0x3b8749;return _0xb5651b[_0x36635e(0x6d)]&&(_0x3b8749={'segment':_0xb5651b[_0x36635e(0x6d)][_0x36635e(0x81)],..._0xb5651b[_0x36635e(0x6d)]['next']!==undefined&&{'next':_0xb5651b[_0x36635e(0x6d)][_0x36635e(0x78)]},..._0xb5651b['condition']['timeout']&&{'timeout':{'duration':_0xb5651b[_0x36635e(0x6d)]['timeout'][_0x36635e(0xc5)],'unit':_0xb5651b[_0x36635e(0x6d)][_0x36635e(0xd0)]['unit'],..._0xb5651b[_0x36635e(0x6d)][_0x36635e(0xd0)][_0x36635e(0x78)]!==undefined&&{'next':_0xb5651b[_0x36635e(0x6d)][_0x36635e(0xd0)][_0x36635e(0x78)]}}}}),{..._0xb5651b[_0x36635e(0xc5)]!==undefined&&{'duration':_0xb5651b[_0x36635e(0xc5)]},..._0xb5651b[_0x36635e(0xfc)]!==undefined&&{'unit':_0xb5651b[_0x36635e(0xfc)]},..._0xb5651b[_0x36635e(0xb0)]!==undefined&&{'wait_until':_0xb5651b[_0x36635e(0xb0)]},..._0xb5651b[_0x36635e(0x102)]!==undefined&&{'days_of_week':_0xb5651b['days_of_week']},..._0x3b8749&&{'condition':_0x3b8749}};}case _0x36635e(0xed):{const _0x28a228=_0x2e98c4;return{'activation':_0x28a228[_0x36635e(0xed)]};}case _0x36635e(0xe4):{const _0x213244=_0x2e98c4;return{'branches':_0x213244[_0x36635e(0x10d)][_0x36635e(0xac)](normalizeDecisionBranch)};}case _0x36635e(0xcb):{const _0x174aff=_0x2e98c4;return{..._0x174aff[_0x36635e(0x99)]!==undefined&&{'customized_split':_0x174aff[_0x36635e(0x99)]},..._0x174aff[_0x36635e(0xe8)]!==undefined&&{'unique_id':_0x174aff[_0x36635e(0xe8)]},'variants':_0x174aff['variants'][_0x36635e(0xac)](normalizeAbTestVariant)};}case _0x36635e(0xeb):{const _0x596eff=_0x2e98c4;return{'target':normalizeJumpTarget(_0x596eff[_0x36635e(0xd4)])};}default:return _0x2e98c4;}}function normalizeDecisionBranch(_0x39d0a0){const _0x50ae89=a147_0xbe4df2;return{'name':_0x39d0a0['name'],..._0x39d0a0[_0x50ae89(0x81)]!==undefined&&{'segment':_0x39d0a0[_0x50ae89(0x81)]},..._0x39d0a0[_0x50ae89(0x85)]!==undefined&&{'excluded':_0x39d0a0[_0x50ae89(0x85)]},..._0x39d0a0[_0x50ae89(0x78)]!==undefined&&{'next':_0x39d0a0[_0x50ae89(0x78)]}};}function normalizeAbTestVariant(_0xad0867){const _0x3230dd=a147_0xbe4df2;return{..._0xad0867['id']!==undefined&&{'id':_0xad0867['id']},'name':_0xad0867['name'],'percentage':_0xad0867[_0x3230dd(0x6e)],..._0xad0867[_0x3230dd(0x78)]!==undefined&&{'next':_0xad0867[_0x3230dd(0x78)]}};}function normalizeJumpTarget(_0x31d0b7){const _0xdfc69a=a147_0xbe4df2;return{'journey':_0x31d0b7[_0xdfc69a(0xf7)],'stage':_0x31d0b7[_0xdfc69a(0x127)],..._0x31d0b7[_0xdfc69a(0x107)]!==undefined&&{'bundle_id':_0x31d0b7['bundle_id']}};}function normalizeEmbeddedSegments(_0x1fd718,_0x5e1c75){const _0x2d95b9=a147_0xbe4df2,_0x3c7a8d={},_0x1856bd=Object['keys'](_0x1fd718),_0x371c04=_0x5e1c75?[..._0x5e1c75['filter'](_0x101837=>_0x1856bd[_0x2d95b9(0x11d)](_0x101837)),..._0x1856bd['filter'](_0x2babd9=>!_0x5e1c75[_0x2d95b9(0x11d)](_0x2babd9))[_0x2d95b9(0x116)]()]:_0x1856bd[_0x2d95b9(0x116)]();for(const _0x4f2f29 of _0x371c04){const _0x27655f=_0x1fd718[_0x4f2f29];if(_0x27655f['rule']){const _0x4f1836=_0x27655f[_0x2d95b9(0xd3)];if(_0x4f1836[_0x2d95b9(0xa8)]!=='And'&&_0x4f1836[_0x2d95b9(0xa8)]!=='Or'){const _0x17f62a=_0x4f1836[_0x2d95b9(0xa8)]??_0x2d95b9(0xfb);throw new SDKError(ErrorCode[_0x2d95b9(0xcc)],_0x2d95b9(0xa4)+_0x4f2f29+_0x2d95b9(0xa0)+(_0x2d95b9(0xf2)+_0x17f62a+_0x2d95b9(0x8c))+'Expected\x20format:\x0a'+_0x2d95b9(0xa1)+_0x2d95b9(0x96)+_0x2d95b9(0xb9)+_0x2d95b9(0x101)+_0x2d95b9(0x8e)+'\x20\x20\x20\x20\x20\x20\x20\x20operator:\x20...');}if(!_0x4f1836[_0x2d95b9(0x6c)]||!Array['isArray'](_0x4f1836[_0x2d95b9(0x6c)]))throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x2d95b9(0xa4)+_0x4f2f29+'\x27:\x20'+_0x2d95b9(0x7a)+_0x2d95b9(0x9f)+_0x2d95b9(0xa1)+(_0x2d95b9(0x70)+_0x4f1836['type']+'\x0a')+_0x2d95b9(0xb9)+'\x20\x20\x20\x20\x20\x20-\x20type:\x20Value\x0a'+_0x2d95b9(0x8e)+_0x2d95b9(0x89));}_0x3c7a8d[_0x4f2f29]={..._0x27655f[_0x2d95b9(0xa9)]&&_0x27655f[_0x2d95b9(0xa9)]['trim']()&&{'description':_0x27655f[_0x2d95b9(0xa9)]},..._0x27655f[_0x2d95b9(0xd3)]&&{'rule':deepSortObject(_0x27655f[_0x2d95b9(0xd3)])}};}return _0x3c7a8d;}function normalizeEmbeddedActivations(_0x55c9f9,_0x59a6f5){const _0x4bcb4c=a147_0xbe4df2,_0x231015={},_0x582a03=Object['keys'](_0x55c9f9),_0xf1210e=_0x59a6f5?[..._0x59a6f5[_0x4bcb4c(0x10f)](_0x32e1c9=>_0x582a03[_0x4bcb4c(0x11d)](_0x32e1c9)),..._0x582a03[_0x4bcb4c(0x10f)](_0x57893a=>!_0x59a6f5[_0x4bcb4c(0x11d)](_0x57893a))[_0x4bcb4c(0x116)]()]:_0x582a03[_0x4bcb4c(0x116)]();for(const _0x26cedd of _0xf1210e){const _0x550045=_0x55c9f9[_0x26cedd];_0x231015[_0x26cedd]={'name':_0x550045[_0x4bcb4c(0x128)],'connection':_0x550045[_0x4bcb4c(0xc6)],..._0x550045[_0x4bcb4c(0xa9)]!==undefined&&{'description':_0x550045[_0x4bcb4c(0xa9)]},..._0x550045['all_columns']!==undefined&&{'all_columns':_0x550045[_0x4bcb4c(0xbe)]},..._0x550045[_0x4bcb4c(0xf8)]!==undefined&&{'columns':_0x550045[_0x4bcb4c(0xf8)]},..._0x550045['behavior']!==undefined&&{'behavior':_0x550045[_0x4bcb4c(0x114)]},..._0x550045['schedule']!==undefined&&{'schedule':_0x550045[_0x4bcb4c(0x11b)]},..._0x550045[_0x4bcb4c(0xe0)]!==undefined&&{'notification':_0x550045[_0x4bcb4c(0xe0)]},..._0x550045[_0x4bcb4c(0x113)]!==undefined&&{'connector_config':_0x550045[_0x4bcb4c(0x113)]},..._0x550045[_0x4bcb4c(0xf6)]!==undefined&&{'activation_template_id':_0x550045['activation_template_id']}};}return _0x231015;}export function getActiveStages(_0x2cc9a5){const _0x2641e3=a147_0xbe4df2;if(isJourneysArrayMode(_0x2cc9a5)){const _0x4e8cbe=_0x2cc9a5[_0x2641e3(0x7e)]||[],_0xb7d298=_0x4e8cbe[_0x2641e3(0xad)](_0x13aa73=>_0x13aa73[_0x2641e3(0x121)]===!![])||_0x4e8cbe[0x0];return _0xb7d298?.['stages']||[];}if(isSingleVersionMode(_0x2cc9a5))return _0x2cc9a5['stages']||[];if(isMultiVersionMode(_0x2cc9a5)){const _0x465925=_0x2cc9a5[_0x2641e3(0xdb)]||[],_0x59a194=_0x465925[_0x2641e3(0xad)](_0x128b37=>_0x128b37['latest']===!![])||_0x465925[0x0];return _0x59a194?.[_0x2641e3(0xfe)]||[];}return[];}export function getLatestJourneyEntry(_0xef9549){const _0x118735=a147_0xbe4df2;if(isJourneysArrayMode(_0xef9549)){const _0x3bd57b=_0xef9549[_0x118735(0x7e)]||[];return _0x3bd57b[_0x118735(0xad)](_0x136d09=>_0x136d09[_0x118735(0x121)]===!![])||_0x3bd57b[0x0];}if(isMultiVersionMode(_0xef9549)){const _0x3ee387=_0xef9549[_0x118735(0xdb)]||[],_0x3063e2=_0x3ee387[_0x118735(0xad)](_0x18fb45=>_0x18fb45[_0x118735(0x121)]===!![])||_0x3ee387[0x0];if(_0x3063e2)return{'version':_0x3063e2[_0x118735(0x128)],'state':_0x3063e2[_0x118735(0xf5)],'latest':_0x3063e2[_0x118735(0x121)],'stages':_0x3063e2[_0x118735(0xfe)],'id':_0x3063e2['id'],'version_number':_0x3063e2[_0x118735(0x7b)]};}if(isSingleVersionMode(_0xef9549))return{'version':_0xef9549['version']||'v1','state':_0x118735(0xdf),'stages':_0xef9549[_0x118735(0xfe)]||[],'id':_0xef9549['id'],'version_number':_0xef9549[_0x118735(0x7b)],'goal':_0xef9549[_0x118735(0xb8)],'reentry':_0xef9549[_0x118735(0xd5)]};return undefined;}export function getLatestVersion(_0x37adf6){const _0x124935=a147_0xbe4df2;if(!isMultiVersionMode(_0x37adf6))return undefined;const _0x33a249=_0x37adf6[_0x124935(0xdb)]||[];return _0x33a249[_0x124935(0xad)](_0x2c6144=>_0x2c6144[_0x124935(0x121)]===!![])||_0x33a249[0x0];}export function getEffectiveGoal(_0x373cab){const _0x120c56=a147_0xbe4df2,_0x5afeed=getLatestJourneyEntry(_0x373cab);return _0x5afeed?.[_0x120c56(0xb8)]||_0x373cab['goal'];}export function getEffectiveReentry(_0x2ad0cf){const _0x1b4c68=a147_0xbe4df2,_0x5ea8a4=getLatestJourneyEntry(_0x2ad0cf);return _0x5ea8a4?.[_0x1b4c68(0xd5)]||_0x2ad0cf['reentry'];}export function collectSegmentRefs(_0xa99e8e){const _0x24a589=a147_0xbe4df2,_0x26069b=new Set();_0xa99e8e[_0x24a589(0xb8)]?.['segment']&&_0x26069b[_0x24a589(0xaf)](_0xa99e8e['goal']['segment']);const _0x267ff2=_0x1eb2e3=>{const _0x3fcf0d=_0x24a589;for(const _0x31d0e0 of _0x1eb2e3){_0x31d0e0[_0x3fcf0d(0x88)]?.['segment']&&_0x26069b['add'](_0x31d0e0['entry_criteria'][_0x3fcf0d(0x81)]);if(_0x31d0e0['exit_criteria'])for(const _0x4ec87a of _0x31d0e0['exit_criteria']){_0x4ec87a[_0x3fcf0d(0x81)]&&_0x26069b[_0x3fcf0d(0xaf)](_0x4ec87a[_0x3fcf0d(0x81)]);}_0x31d0e0['milestone']?.[_0x3fcf0d(0x81)]&&_0x26069b[_0x3fcf0d(0xaf)](_0x31d0e0[_0x3fcf0d(0xa6)][_0x3fcf0d(0x81)]);if(_0x31d0e0[_0x3fcf0d(0xb6)])for(const _0xc448c8 of _0x31d0e0[_0x3fcf0d(0xb6)]){if(_0xc448c8[_0x3fcf0d(0xa8)]===_0x3fcf0d(0xe4)){const _0x238ed8=_0xc448c8;for(const _0x1069bf of _0x238ed8[_0x3fcf0d(0xb3)][_0x3fcf0d(0x10d)]){_0x1069bf[_0x3fcf0d(0x81)]&&_0x26069b[_0x3fcf0d(0xaf)](_0x1069bf[_0x3fcf0d(0x81)]);}}else{if(_0xc448c8['type']===_0x3fcf0d(0x115)){const _0x347fed=_0xc448c8;_0x347fed[_0x3fcf0d(0xb3)]['condition']?.[_0x3fcf0d(0x81)]&&_0x26069b[_0x3fcf0d(0xaf)](_0x347fed[_0x3fcf0d(0xb3)][_0x3fcf0d(0x6d)][_0x3fcf0d(0x81)]);}}}}};_0xa99e8e[_0x24a589(0xfe)]&&_0x267ff2(_0xa99e8e[_0x24a589(0xfe)]);if(_0xa99e8e[_0x24a589(0xdb)])for(const _0x5c59de of _0xa99e8e[_0x24a589(0xdb)]){_0x267ff2(_0x5c59de[_0x24a589(0xfe)]);}return _0x26069b;}export function validateSegmentRefs(_0xc54067){const _0x449ade=a147_0xbe4df2,_0x58f926=[],_0x5e345c=collectSegmentRefs(_0xc54067),_0x1137da=new Set(Object['keys'](_0xc54067['segments']||{}));for(const _0x218fe8 of _0x5e345c){const _0x17e7f5=parseSegmentRef(_0x218fe8);_0x17e7f5[_0x449ade(0xa8)]===_0x449ade(0xc8)&&!_0x1137da['has'](_0x17e7f5[_0x449ade(0x128)])&&_0x58f926[_0x449ade(0x10a)]('Unknown\x20segment\x20\x22'+_0x17e7f5[_0x449ade(0x128)]+_0x449ade(0x10b)+_0x17e7f5[_0x449ade(0x128)]+_0x449ade(0x100));}return _0x58f926;}export function collectSegmentIdsFromJourneyApi(_0x8f8706){const _0xa71753=a147_0xbe4df2,_0x1039d2=new Set();_0x8f8706['attributes'][_0xa71753(0xb8)]?.[_0xa71753(0x7f)]&&_0x1039d2[_0xa71753(0xaf)](_0x8f8706[_0xa71753(0xab)][_0xa71753(0xb8)][_0xa71753(0x7f)]);const _0x906e03=_0x8f8706[_0xa71753(0xab)]['journeyStages'];if(Array['isArray'](_0x906e03))for(const _0x1543e5 of _0x906e03){_0x1543e5[_0xa71753(0x77)]?.[_0xa71753(0x7f)]&&_0x1039d2[_0xa71753(0xaf)](_0x1543e5[_0xa71753(0x77)][_0xa71753(0x7f)]);const _0x172bb8=_0x1543e5[_0xa71753(0xbf)]??_0x1543e5['exitCriteria'];if(Array[_0xa71753(0xf4)](_0x172bb8))for(const _0x67721d of _0x172bb8){_0x67721d[_0xa71753(0x7f)]&&_0x1039d2['add'](_0x67721d['segmentId']);}_0x1543e5[_0xa71753(0xa6)]?.[_0xa71753(0x7f)]&&_0x1039d2['add'](_0x1543e5['milestone'][_0xa71753(0x7f)]);if(_0x1543e5[_0xa71753(0xb6)]&&typeof _0x1543e5[_0xa71753(0xb6)]===_0xa71753(0x9e)){const _0x1c5ceb=Array[_0xa71753(0xf4)](_0x1543e5[_0xa71753(0xb6)])?_0x1543e5['steps']:Object[_0xa71753(0xe6)](_0x1543e5[_0xa71753(0xb6)]);for(const _0x4ef8e1 of _0x1c5ceb){_0x4ef8e1['waitCondition']?.[_0xa71753(0x7f)]&&_0x1039d2['add'](_0x4ef8e1[_0xa71753(0xb1)][_0xa71753(0x7f)]);const _0x4042ac=_0x4ef8e1;_0x4042ac['conditionSegmentId']&&_0x1039d2['add'](_0x4042ac[_0xa71753(0x74)]);if(Array[_0xa71753(0xf4)](_0x4042ac[_0xa71753(0x6c)]))for(const _0x15bfd9 of _0x4042ac[_0xa71753(0x6c)]){_0x15bfd9['segmentId']&&_0x1039d2[_0xa71753(0xaf)](_0x15bfd9[_0xa71753(0x7f)]);}if(Array['isArray'](_0x4ef8e1[_0xa71753(0x10d)]))for(const _0x89fc59 of _0x4ef8e1[_0xa71753(0x10d)]){_0x89fc59[_0xa71753(0x7f)]&&_0x1039d2[_0xa71753(0xaf)](_0x89fc59[_0xa71753(0x7f)]);}}}}return _0x1039d2;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a148_0x34a3a7=a148_0x143c;function a148_0x143c(_0x22e317,_0x500484){_0x22e317=_0x22e317-0x1e9;const _0x2b4320=a148_0x2b43();let _0x143c9b=_0x2b4320[_0x22e317];return _0x143c9b;}(function(_0x5e9101,_0x4f91b5){const _0x3ac44c=a148_0x143c,_0x5c1eb6=_0x5e9101();while(!![]){try{const _0x3f3a53=parseInt(_0x3ac44c(0x200))/0x1*(-parseInt(_0x3ac44c(0x221))/0x2)+parseInt(_0x3ac44c(0x1f1))/0x3*(-parseInt(_0x3ac44c(0x1e9))/0x4)+-parseInt(_0x3ac44c(0x20c))/0x5+parseInt(_0x3ac44c(0x215))/0x6*(parseInt(_0x3ac44c(0x20b))/0x7)+-parseInt(_0x3ac44c(0x1f6))/0x8+parseInt(_0x3ac44c(0x1f3))/0x9*(parseInt(_0x3ac44c(0x220))/0xa)+parseInt(_0x3ac44c(0x222))/0xb;if(_0x3f3a53===_0x4f91b5)break;else _0x5c1eb6['push'](_0x5c1eb6['shift']());}catch(_0x47216f){_0x5c1eb6['push'](_0x5c1eb6['shift']());}}}(a148_0x2b43,0xb35d1));export const DEFAULT_TIME_RANGE=a148_0x34a3a7(0x208);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x3c124c,_0x27e21b,_0x5d4f59){const _0x59bc3e=a148_0x34a3a7,_0x36875e=_0x5d4f59&&_0x5d4f59[_0x59bc3e(0x204)]>0x0?_0x5d4f59[_0x59bc3e(0x226)](',\x20'):'*';return _0x59bc3e(0x207)+_0x36875e+_0x59bc3e(0x225)+_0x3c124c+'.'+_0x27e21b+_0x59bc3e(0x21a);}function a148_0x2b43(){const _0x58c059=['\x20=\x20a.','10Mnxkhu','558MvuTfW','9479800uBPjnX','\x20m\x0aLEFT\x20JOIN\x20','map','\x20FROM\x20','join','\x0aLIMIT\x20','behaviors','2776924VDPQwP','\x20=\x20','\x20m\x0aJOIN\x20','master','\x20IS\x20NOT\x20NULL\x0a','\x27)\x0a','push','all_columns','3NnkkqQ','\x20=\x20b.','12195261wWutkn','columns','column','1887856gKuZIw','forEach','table','b.*','SELECT\x20*\x20FROM\x20','\x0aSELECT\x20','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','trim','database',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','1783sRsaUW','label','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x20b\x0a\x20\x20ON\x20m.','length','\x0aWHERE\x20a.','toLowerCase','SELECT\x20','-1d','replace','\x20a\x0a\x20\x20ON\x20m.','14RHeNVN','2825020wNRdpB','\x0aSELECT\x20m.','test','\x0aLIMIT\x200\x0a','parent_key','find','\x27)\x0aLIMIT\x20','LEFT\x20JOIN\x20','child_key','1531554jIZrAj','\x0a\x20\x20ON\x20m.','(all\x20columns)','source','\x20m\x0a','\x20LIMIT\x200','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','\x0aFROM\x20','name','attributes'];a148_0x2b43=function(){return _0x58c059;};return a148_0x2b43();}export function generateMasterCountSQL(_0x36b157){const _0xbf09da=a148_0x34a3a7,{database:_0x5e5933,table:_0x65927a}=_0x36b157[_0xbf09da(0x1ec)];return _0xbf09da(0x1fc)+_0x5e5933+'.'+_0x65927a;}export function generateMasterSampleSQL(_0x48f98f,_0x116afa=0x5){const _0x17a1e8=a148_0x34a3a7,{database:_0x3f1cfe,table:_0x3552f0}=_0x48f98f[_0x17a1e8(0x1ec)];return'SELECT\x20*\x20FROM\x20'+_0x3f1cfe+'.'+_0x3552f0+'\x20LIMIT\x20'+_0x116afa;}export function generateAttributeCoverageSQL(_0x1e42b3,_0xe07910){const _0x225447=a148_0x34a3a7,_0x57cde1=_0x1e42b3[_0x225447(0x1ec)];return(_0x225447(0x202)+_0x57cde1[_0x225447(0x1fe)]+'.'+_0x57cde1[_0x225447(0x1f8)]+_0x225447(0x223)+_0xe07910[_0x225447(0x218)][_0x225447(0x1fe)]+'.'+_0xe07910[_0x225447(0x218)][_0x225447(0x1f8)]+_0x225447(0x20a)+_0xe07910[_0x225447(0x226)][_0x225447(0x210)]+_0x225447(0x21f)+_0xe07910[_0x225447(0x226)][_0x225447(0x214)]+_0x225447(0x205)+_0xe07910[_0x225447(0x226)][_0x225447(0x214)]+_0x225447(0x1ed))['trim']();}export function generateBehaviorStatsSQL(_0x5e1fe0,_0x441b27,_0xa41375=DEFAULT_TIME_RANGE){const _0x57acdc=a148_0x34a3a7,_0x1d2bdb=_0x5e1fe0['master'];return('\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.'+_0x441b27[_0x57acdc(0x226)][_0x57acdc(0x210)]+_0x57acdc(0x1ff)+_0x1d2bdb['database']+'.'+_0x1d2bdb[_0x57acdc(0x1f8)]+_0x57acdc(0x1eb)+_0x441b27[_0x57acdc(0x218)][_0x57acdc(0x1fe)]+'.'+_0x441b27[_0x57acdc(0x218)][_0x57acdc(0x1f8)]+_0x57acdc(0x203)+_0x441b27[_0x57acdc(0x226)][_0x57acdc(0x210)]+_0x57acdc(0x1f2)+_0x441b27[_0x57acdc(0x226)][_0x57acdc(0x214)]+_0x57acdc(0x21b)+_0xa41375+_0x57acdc(0x1ee))['trim']();}export function generateAttributeSampleSQL(_0x3b7d3a,_0x1c199b,_0x26c3a2=0x5){const _0x5cd91a=a148_0x34a3a7,_0x171e0b=_0x3b7d3a[_0x5cd91a(0x1ec)],_0x488be6=_0x1c199b[_0x5cd91a(0x226)]['parent_key'],_0x4cfece=_0x1c199b[_0x5cd91a(0x1f4)][_0x5cd91a(0x224)](_0x33c6b3=>'a.'+_0x33c6b3[_0x5cd91a(0x1f5)])[_0x5cd91a(0x226)](',\x20');return(_0x5cd91a(0x20d)+_0x488be6+',\x20'+_0x4cfece+_0x5cd91a(0x21c)+_0x171e0b[_0x5cd91a(0x1fe)]+'.'+_0x171e0b[_0x5cd91a(0x1f8)]+_0x5cd91a(0x1eb)+_0x1c199b[_0x5cd91a(0x218)][_0x5cd91a(0x1fe)]+'.'+_0x1c199b[_0x5cd91a(0x218)]['table']+_0x5cd91a(0x20a)+_0x1c199b[_0x5cd91a(0x226)][_0x5cd91a(0x210)]+'\x20=\x20a.'+_0x1c199b['join'][_0x5cd91a(0x214)]+_0x5cd91a(0x227)+_0x26c3a2+'\x0a')['trim']();}export function generateBehaviorSampleSQL(_0x4cc263,_0x50ef5a,_0x5ab43b=0x5,_0x1ef355=DEFAULT_TIME_RANGE){const _0x116e58=a148_0x34a3a7,_0x3f926d=_0x4cc263[_0x116e58(0x1ec)],_0x40a3b9=_0x50ef5a[_0x116e58(0x226)][_0x116e58(0x210)];let _0x737b3;if(_0x50ef5a[_0x116e58(0x1f0)])_0x737b3=_0x116e58(0x1f9);else _0x50ef5a[_0x116e58(0x1f4)]&&_0x50ef5a[_0x116e58(0x1f4)][_0x116e58(0x204)]>0x0?_0x737b3=_0x50ef5a['columns'][_0x116e58(0x224)](_0x4a4d4d=>'b.'+_0x4a4d4d['column'])[_0x116e58(0x226)](',\x20'):_0x737b3=_0x116e58(0x1f9);return(_0x116e58(0x20d)+_0x40a3b9+',\x20'+_0x737b3+'\x0aFROM\x20'+_0x3f926d[_0x116e58(0x1fe)]+'.'+_0x3f926d[_0x116e58(0x1f8)]+'\x20m\x0aJOIN\x20'+_0x50ef5a[_0x116e58(0x218)][_0x116e58(0x1fe)]+'.'+_0x50ef5a['source'][_0x116e58(0x1f8)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x50ef5a[_0x116e58(0x226)][_0x116e58(0x210)]+_0x116e58(0x1f2)+_0x50ef5a[_0x116e58(0x226)][_0x116e58(0x214)]+'\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27'+_0x1ef355+_0x116e58(0x212)+_0x5ab43b+'\x0a')[_0x116e58(0x1fd)]();}function quoteIdentifier(_0x4d2ecf){const _0x131516=a148_0x34a3a7;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x131516(0x20e)](_0x4d2ecf))return'\x22'+_0x4d2ecf[_0x131516(0x209)](/"/g,'\x22\x22')+'\x22';return _0x4d2ecf;}export function generateEnrichedSQL(_0x3660a3,_0x5aa808=0x5){const _0x16ba0d=a148_0x34a3a7,_0x3ca548=_0x3660a3['master'],_0x3532fc=_0x3660a3[_0x16ba0d(0x21e)]||[];if(_0x3532fc[_0x16ba0d(0x204)]===0x0)return _0x16ba0d(0x1fa)+_0x3ca548[_0x16ba0d(0x1fe)]+'.'+_0x3ca548[_0x16ba0d(0x1f8)]+'\x20LIMIT\x20'+_0x5aa808;const _0x718864=['m.*'],_0x2b7de6=[];return _0x3532fc[_0x16ba0d(0x1f7)]((_0x5d1fc8,_0x39aab2)=>{const _0xad261f=_0x16ba0d,_0x46c354='a'+_0x39aab2;_0x5d1fc8['columns'][_0xad261f(0x1f7)](_0x109879=>{const _0x507ded=_0xad261f,_0x340130=quoteIdentifier(_0x109879[_0x507ded(0x201)]||_0x109879[_0x507ded(0x1f5)]);_0x718864['push'](_0x46c354+'.'+_0x109879[_0x507ded(0x1f5)]+'\x20AS\x20'+_0x340130);}),_0x2b7de6[_0xad261f(0x1ef)](_0xad261f(0x213)+_0x5d1fc8['source'][_0xad261f(0x1fe)]+'.'+_0x5d1fc8[_0xad261f(0x218)][_0xad261f(0x1f8)]+'\x20'+_0x46c354+_0xad261f(0x216)+_0x5d1fc8[_0xad261f(0x226)][_0xad261f(0x210)]+_0xad261f(0x1ea)+_0x46c354+'.'+_0x5d1fc8['join'][_0xad261f(0x214)]);}),(_0x16ba0d(0x1fb)+_0x718864['join'](',\x20')+_0x16ba0d(0x21c)+_0x3ca548[_0x16ba0d(0x1fe)]+'.'+_0x3ca548[_0x16ba0d(0x1f8)]+_0x16ba0d(0x219)+_0x2b7de6[_0x16ba0d(0x226)]('\x0a')+_0x16ba0d(0x227)+_0x5aa808+'\x0a')['trim']();}export function generateAttributeSchemaSQL(_0x4086c4,_0x2b494c){const _0x36af58=a148_0x34a3a7,_0x180e88=_0x4086c4[_0x36af58(0x1ec)],_0x22a0e9=_0x2b494c[_0x36af58(0x226)][_0x36af58(0x210)],_0x5a9491=_0x2b494c[_0x36af58(0x1f4)]['map'](_0x5ea43f=>'a.'+_0x5ea43f[_0x36af58(0x1f5)])[_0x36af58(0x226)](',\x20');return(_0x36af58(0x20d)+_0x22a0e9+',\x20'+_0x5a9491+'\x0aFROM\x20'+_0x180e88[_0x36af58(0x1fe)]+'.'+_0x180e88[_0x36af58(0x1f8)]+_0x36af58(0x1eb)+_0x2b494c[_0x36af58(0x218)][_0x36af58(0x1fe)]+'.'+_0x2b494c[_0x36af58(0x218)]['table']+_0x36af58(0x20a)+_0x2b494c['join'][_0x36af58(0x210)]+_0x36af58(0x21f)+_0x2b494c[_0x36af58(0x226)]['child_key']+_0x36af58(0x20f))[_0x36af58(0x1fd)]();}export function generateBehaviorSchemaSQL(_0x101fb0,_0x29aa94){const _0x9470c6=a148_0x34a3a7,_0x297631=_0x101fb0[_0x9470c6(0x1ec)],_0x16fe48=_0x29aa94[_0x9470c6(0x226)][_0x9470c6(0x210)];let _0x41ef76;if(_0x29aa94['all_columns'])_0x41ef76=_0x9470c6(0x1f9);else _0x29aa94[_0x9470c6(0x1f4)]&&_0x29aa94[_0x9470c6(0x1f4)][_0x9470c6(0x204)]>0x0?_0x41ef76=_0x29aa94[_0x9470c6(0x1f4)]['map'](_0x1e89ce=>'b.'+_0x1e89ce['column'])['join'](',\x20'):_0x41ef76=_0x9470c6(0x1f9);return(_0x9470c6(0x20d)+_0x16fe48+',\x20'+_0x41ef76+_0x9470c6(0x21c)+_0x297631[_0x9470c6(0x1fe)]+'.'+_0x297631['table']+'\x20m\x0aJOIN\x20'+_0x29aa94[_0x9470c6(0x218)][_0x9470c6(0x1fe)]+'.'+_0x29aa94[_0x9470c6(0x218)][_0x9470c6(0x1f8)]+_0x9470c6(0x203)+_0x29aa94[_0x9470c6(0x226)]['parent_key']+_0x9470c6(0x1f2)+_0x29aa94['join']['child_key']+_0x9470c6(0x20f))[_0x9470c6(0x1fd)]();}export function getAttributeColumns(_0x547075){const _0x1af993=a148_0x34a3a7;return _0x547075[_0x1af993(0x1f4)][_0x1af993(0x224)](_0x563bb5=>({'label':_0x563bb5[_0x1af993(0x201)]||_0x563bb5[_0x1af993(0x1f5)],'column':_0x563bb5[_0x1af993(0x1f5)]}));}export function getBehaviorColumns(_0x3162d9){const _0x343756=a148_0x34a3a7;if(_0x3162d9[_0x343756(0x1f0)])return[{'label':_0x343756(0x217),'column':'*'}];if(_0x3162d9[_0x343756(0x1f4)]&&_0x3162d9['columns']['length']>0x0)return _0x3162d9[_0x343756(0x1f4)][_0x343756(0x224)](_0x1e0cc2=>({'label':_0x1e0cc2[_0x343756(0x201)]||_0x1e0cc2[_0x343756(0x1f5)],'column':_0x1e0cc2[_0x343756(0x1f5)]}));return[{'label':'(all\x20columns)','column':'*'}];}export function findAttributeByName(_0x47288e,_0x1d80fe){const _0x232730=a148_0x34a3a7;return _0x47288e[_0x232730(0x21e)]?.[_0x232730(0x211)](_0x178bb5=>_0x178bb5[_0x232730(0x21d)][_0x232730(0x206)]()===_0x1d80fe[_0x232730(0x206)]());}export function findBehaviorByName(_0x7dda58,_0x4d0dce){const _0x46b7a4=a148_0x34a3a7;return _0x7dda58[_0x46b7a4(0x228)]?.[_0x46b7a4(0x211)](_0x327d02=>_0x327d02[_0x46b7a4(0x21d)][_0x46b7a4(0x206)]()===_0x4d0dce[_0x46b7a4(0x206)]());}
|