@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
|
-
const a142_0x24cc65=a142_0x2990;(function(_0x3fbc0d,_0x36fbbd){const _0x1c4c9f=a142_0x2990,_0x14c9b1=_0x3fbc0d();while(!![]){try{const _0x21252d=parseInt(_0x1c4c9f(0x104))/0x1*(-parseInt(_0x1c4c9f(0xec))/0x2)+parseInt(_0x1c4c9f(0x11d))/0x3*(-parseInt(_0x1c4c9f(0xd5))/0x4)+parseInt(_0x1c4c9f(0x183))/0x5*(-parseInt(_0x1c4c9f(0x16f))/0x6)+-parseInt(_0x1c4c9f(0x15e))/0x7*(-parseInt(_0x1c4c9f(0xcf))/0x8)+-parseInt(_0x1c4c9f(0xd1))/0x9*(parseInt(_0x1c4c9f(0xe2))/0xa)+parseInt(_0x1c4c9f(0x11e))/0xb+parseInt(_0x1c4c9f(0x11f))/0xc;if(_0x21252d===_0x36fbbd)break;else _0x14c9b1['push'](_0x14c9b1['shift']());}catch(_0x2f1922){_0x14c9b1['push'](_0x14c9b1['shift']());}}}(a142_0x36ba,0x85c8c));import*as a142_0x53a596 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a142_0x24cc65(0xd2),'hourly':a142_0x24cc65(0xf9),'weekly':a142_0x24cc65(0x178),'monthly':a142_0x24cc65(0xdd),'minutes_interval':a142_0x24cc65(0xff)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x24cc65(0x131),'hour':a142_0x24cc65(0x173),'week':a142_0x24cc65(0x156),'month':'monthly','minute':a142_0x24cc65(0x174)};function filterRuleAsRuleDef(_0x141394){return _0x141394;}function ruleDefAsFilterRule(_0x309d51){return _0x309d51;}export function segmentResponseToDefSync(_0x1097bb,_0x32d850){const _0x24980b=a142_0x24cc65,_0x107d29=_0x1097bb[_0x24980b(0xe9)]&&_0x24980b(0xd9)in _0x1097bb[_0x24980b(0xe9)]&&_0x1097bb['rule'][_0x24980b(0xd9)];return{'type':'segment','name':_0x1097bb[_0x24980b(0x179)],..._0x1097bb[_0x24980b(0x175)]&&{'description':_0x1097bb[_0x24980b(0x175)]},..._0x32d850&&{'folder':_0x32d850},..._0x107d29&&{'rule':apiRuleToYaml(_0x1097bb[_0x24980b(0xe9)])},..._0x1097bb[_0x24980b(0xd4)]!==undefined&&{'kind':_0x1097bb[_0x24980b(0xd4)]===0x0?_0x24980b(0x166):_0x1097bb[_0x24980b(0xd4)]===0x1?_0x24980b(0x17a):_0x24980b(0x112)},..._0x1097bb['isVisible']!==undefined&&{'visible':_0x1097bb['isVisible']}};}export async function segmentResponseToDef(_0x21266f,_0x27398b,_0x4f00d3){const _0x5d1808=a142_0x24cc65,_0x10e12b=segmentResponseToDefSync(_0x21266f,_0x4f00d3);if(!_0x27398b||!_0x27398b[_0x5d1808(0x115)])return _0x10e12b;return _0x10e12b[_0x5d1808(0xe9)]&&(_0x10e12b[_0x5d1808(0xe9)]=await resolveRuleSegmentRefs(_0x10e12b['rule'],_0x27398b[_0x5d1808(0x115)])),_0x10e12b;}export function apiRuleToYaml(_0x4ed7bc){const _0xad1376=a142_0x24cc65,_0x27921e=(_0x4ed7bc[_0xad1376(0x154)]||[])[_0xad1376(0xdb)](_0x10429b=>{const _0x5d71dd=_0xad1376,_0x80f0a3=apiConditionToYaml(_0x10429b);if(isCompositeType(_0x80f0a3)&&_0x80f0a3[_0x5d71dd(0x175)]!==undefined){const _0x1bc836=_0x80f0a3;if(_0x1bc836[_0x5d71dd(0x154)][_0x5d71dd(0x138)]===0x1)return _0x1bc836[_0x5d71dd(0x154)];return[{'type':_0x1bc836[_0x5d71dd(0xd9)],'conditions':_0x1bc836[_0x5d71dd(0x154)]}];}return[_0x80f0a3];});if(_0x27921e['length']===0x1&&!_0x4ed7bc[_0xad1376(0x175)]&&isCompositeType(_0x27921e[0x0])){const _0x184ddb=_0x27921e[0x0];if(_0x184ddb[_0xad1376(0xd9)]===_0x4ed7bc[_0xad1376(0xd9)]&&_0x184ddb[_0xad1376(0x154)]&&_0x184ddb[_0xad1376(0x175)]===undefined)return{'type':_0x4ed7bc[_0xad1376(0xd9)],'conditions':_0x184ddb['conditions']};}return{'type':_0x4ed7bc[_0xad1376(0xd9)],'conditions':_0x27921e};}export async function resolveRuleSegmentRefs(_0x407e8a,_0x4485b0){const _0x3fc871=a142_0x24cc65;return transformRuleSegmentRefs(_0x407e8a,_0x4485b0,_0x241b18=>/^\d+$/[_0x3fc871(0x101)](_0x241b18));}async function transformConditionSegmentRefs(_0x3950d1,_0x98d687,_0x26952f,_0x36e7bc){const _0x42a4fd=a142_0x24cc65;if('segment'in _0x3950d1&&(_0x3950d1['type']===_0x42a4fd(0x159)||_0x3950d1['type']===_0x42a4fd(0x12e))){const _0x3c1d2a=_0x3950d1;if(_0x26952f(_0x3c1d2a[_0x42a4fd(0x130)]))return{..._0x3c1d2a,'segment':await _0x98d687(_0x3c1d2a[_0x42a4fd(0x130)])};return _0x3950d1;}if('conditions'in _0x3950d1&&_0x3950d1[_0x42a4fd(0x154)]){const _0x1086ac=_0x3950d1,_0x52687b=await Promise[_0x42a4fd(0x118)](_0x1086ac['conditions'][_0x42a4fd(0x152)](_0x8f78d4=>transformConditionSegmentRefs(_0x8f78d4,_0x98d687,_0x26952f,_0x36e7bc)));return{..._0x1086ac,'conditions':_0x52687b};}if('filter'in _0x3950d1&&_0x3950d1['filter']){const _0x2d6649=_0x3950d1,_0xbdd447=await _0x36e7bc(filterRuleAsRuleDef(_0x2d6649[_0x42a4fd(0x111)]),_0x98d687);return{..._0x2d6649,'filter':ruleDefAsFilterRule(_0xbdd447)};}return _0x3950d1;}async function transformRuleSegmentRefs(_0x148b95,_0x263f48,_0x1d7024){const _0x55936a=a142_0x24cc65,_0x33d883=(_0x531929,_0x35a5fe)=>transformRuleSegmentRefs(_0x531929,_0x35a5fe,_0x1d7024),_0x560b60=await Promise['all'](_0x148b95[_0x55936a(0x154)][_0x55936a(0x152)](_0x4b9624=>transformConditionSegmentRefs(_0x4b9624,_0x263f48,_0x1d7024,_0x33d883)));return{..._0x148b95,'conditions':_0x560b60};}function a142_0x2990(_0x51b6cd,_0x332d30){_0x51b6cd=_0x51b6cd-0xcc;const _0x36bafe=a142_0x36ba();let _0x299077=_0x36bafe[_0x51b6cd];return _0x299077;}export async function resolveRuleSegmentIds(_0x3fe1a1,_0x3a5c34){const _0xbd8ef1=a142_0x24cc65;return transformRuleSegmentRefs(_0x3fe1a1,_0x3a5c34,_0xe03ec3=>!/^\d+$/[_0xbd8ef1(0x101)](_0xe03ec3));}function isCompositeType(_0x3873f9){const _0x3e2980=a142_0x24cc65;return _0x3873f9[_0x3e2980(0xd9)]==='And'||_0x3873f9[_0x3e2980(0xd9)]==='Or';}function isBehaviorApiCondition(_0xde5932){const _0x16faff=a142_0x24cc65;if(!_0xde5932[_0x16faff(0xe8)]?.[_0x16faff(0xe5)]?.[_0x16faff(0x179)])return![];return!![];}function apiConditionToYaml(_0x365b7f){const _0x2af777=a142_0x24cc65;if(_0x365b7f[_0x2af777(0xd9)]===_0x2af777(0x11c)||_0x365b7f[_0x2af777(0xd9)]==='Or'){if(_0x365b7f[_0x2af777(0x154)]){const _0x323d00=_0x365b7f[_0x2af777(0x154)]['map'](apiConditionToYaml),_0x2c52b9=_0x365b7f[_0x2af777(0x175)]!==undefined;if(_0x323d00[_0x2af777(0x138)]===0x1&&!_0x2c52b9)return _0x323d00[0x0];return{'type':_0x365b7f['type'],'conditions':_0x323d00,..._0x365b7f['description']!==undefined&&{'description':_0x365b7f[_0x2af777(0x175)]}};}}if(_0x365b7f[_0x2af777(0xd9)]===_0x2af777(0x109)&&_0x365b7f['leftValue']&&_0x365b7f[_0x2af777(0x10e)]){const _0x212def=_0x365b7f[_0x2af777(0xe8)][_0x2af777(0x158)]?buildAggregationDefFromApi(_0x365b7f[_0x2af777(0xe8)][_0x2af777(0x158)]):undefined;if(isBehaviorApiCondition(_0x365b7f)){const _0xf92816=_0x365b7f['leftValue'][_0x2af777(0xe5)][_0x2af777(0x179)];return{'type':_0x2af777(0x107),'attribute':'','operator':apiOperatorToYaml(_0x365b7f[_0x2af777(0x10e)]),..._0x365b7f[_0x2af777(0x11a)]&&_0x365b7f[_0x2af777(0x11a)]!==_0x2af777(0xee)?{'arrayMatching':_0x365b7f[_0x2af777(0x11a)]}:{},..._0x365b7f[_0x2af777(0x12e)]?{'exclude':_0x365b7f[_0x2af777(0x12e)]}:{},..._0x212def?{'aggregation':_0x212def}:{},'source':_0xf92816,..._0x365b7f['leftValue'][_0x2af777(0x111)]?{'filter':apiRuleToYaml(_0x365b7f[_0x2af777(0xe8)]['filter'])}:{},..._0x365b7f[_0x2af777(0x128)]!==undefined&&_0x365b7f[_0x2af777(0x128)]!==null?{'limit':_0x365b7f[_0x2af777(0x128)]}:{}};}return{'type':'Value','attribute':_0x365b7f['leftValue'][_0x2af777(0x179)]||'','operator':apiOperatorToYaml(_0x365b7f[_0x2af777(0x10e)]),..._0x365b7f[_0x2af777(0x11a)]&&_0x365b7f[_0x2af777(0x11a)]!==_0x2af777(0xee)?{'arrayMatching':_0x365b7f[_0x2af777(0x11a)]}:{},..._0x365b7f['exclude']?{'exclude':_0x365b7f[_0x2af777(0x12e)]}:{},..._0x212def?{'aggregation':_0x212def}:{},..._0x365b7f[_0x2af777(0xe8)][_0x2af777(0x111)]?{'filter':apiRuleToYaml(_0x365b7f['leftValue'][_0x2af777(0x111)])}:{},..._0x365b7f[_0x2af777(0x128)]!==undefined&&_0x365b7f[_0x2af777(0x128)]!==null?{'limit':_0x365b7f['limit']}:{}};}if(_0x365b7f[_0x2af777(0xd9)]===_0x2af777(0xd0)&&_0x365b7f[_0x2af777(0x103)]&&_0x365b7f['operator'])return{'type':_0x2af777(0xd0),'column':_0x365b7f[_0x2af777(0x103)],'operator':apiOperatorToYaml(_0x365b7f['operator'])};if(_0x365b7f['type']===_0x2af777(0x100)&&_0x365b7f['id'])return{'type':_0x365b7f[_0x2af777(0x12e)]?_0x2af777(0x12e):_0x2af777(0x159),'segment':_0x365b7f['id']};return{'type':_0x2af777(0x11c),'conditions':[]};}function isTemporalOperator(_0x1bf9cc){return _0x1bf9cc==='TimeWithinPast'||_0x1bf9cc==='TimeWithinNext';}function isBetweenOperator(_0x43e918){return _0x43e918==='Between';}function getEffectiveValue(_0x1c5aa3){const _0x544b1a=a142_0x24cc65,_0x430995=_0x1c5aa3[_0x544b1a(0x163)];return _0x1c5aa3[_0x544b1a(0x122)]??_0x430995;}function parseNumericValue(_0x2d05f8){const _0x5428fa=a142_0x24cc65;if(typeof _0x2d05f8===_0x5428fa(0x10d)&&_0x2d05f8!==null)return _0x2d05f8;if(_0x2d05f8==='')return _0x2d05f8;const _0x4f209f=Number(_0x2d05f8);return Number[_0x5428fa(0x143)](_0x4f209f)?_0x4f209f:_0x2d05f8;}function apiOperatorToYaml(_0x3e4b29){const _0x33c09c=a142_0x24cc65;if(isBetweenOperator(_0x3e4b29['type']))return{'type':mapApiOperatorType(_0x3e4b29[_0x33c09c(0xd9)]),..._0x3e4b29['not']!==undefined&&{'not':_0x3e4b29[_0x33c09c(0x125)]},..._0x3e4b29[_0x33c09c(0xed)]!==undefined&&{'min':parseNumericValue(_0x3e4b29['minValue'])},..._0x3e4b29[_0x33c09c(0x15c)]!==undefined&&{'max':parseNumericValue(_0x3e4b29[_0x33c09c(0x15c)])}};if(_0x3e4b29[_0x33c09c(0xd9)]===_0x33c09c(0x119))return{'type':_0x33c09c(0x119),..._0x3e4b29[_0x33c09c(0x125)]!==undefined&&{'not':_0x3e4b29[_0x33c09c(0x125)]},..._0x3e4b29['duration']!==undefined&&{'duration':_0x3e4b29[_0x33c09c(0x14b)]},..._0x3e4b29[_0x33c09c(0x136)]!==undefined&&{'from':_0x3e4b29[_0x33c09c(0x136)]},..._0x3e4b29['reverse']!==undefined&&{'reverse':_0x3e4b29[_0x33c09c(0x14a)]}};let _0x154800;if(_0x3e4b29[_0x33c09c(0x12a)]&&_0x3e4b29[_0x33c09c(0x12a)][_0x33c09c(0x138)]>0x0)_0x154800=_0x3e4b29[_0x33c09c(0x12a)];else{if(_0x3e4b29[_0x33c09c(0x155)]!==undefined)_0x154800=_0x3e4b29[_0x33c09c(0x155)];else isTemporalOperator(_0x3e4b29['type'])&&_0x3e4b29[_0x33c09c(0x122)]!==undefined&&(_0x154800=_0x3e4b29[_0x33c09c(0x122)]);}return{'type':mapApiOperatorType(_0x3e4b29[_0x33c09c(0xd9)]),..._0x3e4b29[_0x33c09c(0x125)]!==undefined&&{'not':_0x3e4b29[_0x33c09c(0x125)]},..._0x154800!==undefined&&{'value':_0x154800},..._0x3e4b29['unit']!==undefined&&{'unit':_0x3e4b29['unit']}};}function mapApiOperatorType(_0x484cc6){return _0x484cc6;}export function segmentDefToCreateRequest(_0x5f4cb8,_0x5c3995){const _0x1953eb=a142_0x24cc65,_0xba00fc={'name':_0x5f4cb8[_0x1953eb(0x179)]};return _0x5f4cb8[_0x1953eb(0x175)]&&(_0xba00fc['description']=_0x5f4cb8[_0x1953eb(0x175)]),_0x5f4cb8['rule']&&(_0xba00fc[_0x1953eb(0xe9)]=yamlRuleToApi(_0x5f4cb8['rule'])),_0x5f4cb8[_0x1953eb(0xd4)]&&(_0xba00fc[_0x1953eb(0xd4)]=_0x5f4cb8[_0x1953eb(0xd4)]===_0x1953eb(0x166)?0x0:_0x5f4cb8[_0x1953eb(0xd4)]===_0x1953eb(0x17a)?0x1:0x2),_0x5f4cb8[_0x1953eb(0xf6)]!==undefined&&(_0xba00fc[_0x1953eb(0x127)]=_0x5f4cb8[_0x1953eb(0xf6)]),_0x5c3995&&(_0xba00fc[_0x1953eb(0xf3)]=_0x5c3995),_0xba00fc;}export function segmentDefToUpdateRequest(_0x1df61b){const _0x5b17e5=a142_0x24cc65,_0x390e0c={'name':_0x1df61b['name']};return _0x1df61b[_0x5b17e5(0x175)]!==undefined&&(_0x390e0c[_0x5b17e5(0x175)]=_0x1df61b['description']),_0x1df61b[_0x5b17e5(0xe9)]&&(_0x390e0c['rule']=yamlRuleToApi(_0x1df61b[_0x5b17e5(0xe9)])),_0x1df61b[_0x5b17e5(0xd4)]&&(_0x390e0c[_0x5b17e5(0xd4)]=_0x1df61b[_0x5b17e5(0xd4)]===_0x5b17e5(0x166)?0x0:_0x1df61b[_0x5b17e5(0xd4)]==='realtime'?0x1:0x2),_0x390e0c;}export function yamlRuleToApi(_0x164ca0){const _0x1aebb1=a142_0x24cc65,_0x39076a=_0x164ca0[_0x1aebb1(0x154)][_0x1aebb1(0x152)](yamlConditionToApi),_0x5b5e94=_0x39076a[_0x1aebb1(0x14e)](_0x15bf05=>isCompositeType(_0x15bf05)&&_0x15bf05[_0x1aebb1(0x175)]!==undefined);if(!_0x5b5e94&&_0x39076a[_0x1aebb1(0x138)]>0x0){const _0x93f45a=[];for(const _0x72ba96 of _0x39076a){isCompositeType(_0x72ba96)&&_0x72ba96[_0x1aebb1(0x175)]===undefined&&_0x72ba96[_0x1aebb1(0x154)]&&_0x72ba96[_0x1aebb1(0x154)][_0x1aebb1(0x14e)](_0x3e2d1b=>!isCompositeType(_0x3e2d1b))?_0x93f45a[_0x1aebb1(0x157)]({'type':_0x72ba96[_0x1aebb1(0xd9)],'description':'','conditions':_0x72ba96[_0x1aebb1(0x154)]}):_0x93f45a[_0x1aebb1(0x157)]({'type':'And','description':_0x164ca0[_0x1aebb1(0x175)]||'','conditions':[_0x72ba96]});}return{'type':_0x164ca0[_0x1aebb1(0xd9)],'conditions':_0x93f45a};}return{'type':_0x164ca0[_0x1aebb1(0xd9)],'conditions':_0x39076a,..._0x164ca0[_0x1aebb1(0x175)]&&{'description':_0x164ca0[_0x1aebb1(0x175)]}};}function yamlFilterRuleToApi(_0x269183){const _0x464405=a142_0x24cc65,_0x43c3a7=_0x269183[_0x464405(0x154)]['map'](yamlConditionToApi);return{'type':_0x269183[_0x464405(0xd9)],'conditions':_0x43c3a7};}function yamlConditionToApi(_0x3def3f){const _0x3f7772=a142_0x24cc65;if(_0x3f7772(0x130)in _0x3def3f&&(_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0x159)||_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0x12e))){const _0x39db1a=_0x3def3f;return{'type':_0x3f7772(0x100),'id':_0x39db1a[_0x3f7772(0x130)],'exclude':_0x39db1a[_0x3f7772(0xd9)]===_0x3f7772(0x12e)};}if(_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0x11c)||_0x3def3f['type']==='Or'){const _0x2aa1b5=_0x3def3f;return{'type':_0x2aa1b5[_0x3f7772(0xd9)],'conditions':_0x2aa1b5[_0x3f7772(0x154)][_0x3f7772(0x152)](yamlConditionToApi),..._0x2aa1b5[_0x3f7772(0x175)]&&{'description':_0x2aa1b5['description']}};}if(_0x3f7772(0x103)in _0x3def3f&&_0x3def3f[_0x3f7772(0xd9)]===_0x3f7772(0xd0)){const _0x2c5b89=_0x3def3f;return{'type':_0x3f7772(0xd0),'column':_0x2c5b89[_0x3f7772(0x103)],'operator':yamlOperatorToApi(_0x2c5b89[_0x3f7772(0x10e)])};}const _0x665c90=_0x3def3f,_0x192ab1={'type':_0x3f7772(0x109),'leftValue':buildLeftValue(_0x665c90),'operator':yamlOperatorToApi(_0x665c90['operator']),'exclude':_0x665c90['exclude']??![],'arrayMatching':_0x665c90[_0x3f7772(0x11a)]??_0x3f7772(0xee)};return _0x665c90[_0x3f7772(0x128)]!==undefined&&(_0x192ab1[_0x3f7772(0x128)]=_0x665c90[_0x3f7772(0x128)]),_0x192ab1;}function buildAggregationDefFromApi(_0x19fa79){const _0x5b16e9=a142_0x24cc65,_0x4d2f90=_0x19fa79[_0x5b16e9(0xd9)];if(_0x4d2f90==='CountDistinct')return{'type':_0x4d2f90,'columns':_0x19fa79[_0x5b16e9(0xe1)]??[]};if(_0x4d2f90===_0x5b16e9(0xfb)||_0x4d2f90===_0x5b16e9(0xfd))return{'type':_0x4d2f90,'column':_0x19fa79[_0x5b16e9(0x103)]??'','orderColumn':_0x19fa79[_0x5b16e9(0x150)]??'',..._0x19fa79[_0x5b16e9(0x12f)]&&{'groupingColumns':_0x19fa79[_0x5b16e9(0x12f)]}};if(_0x4d2f90==='Count')return{'type':_0x4d2f90,..._0x19fa79[_0x5b16e9(0x12f)]&&{'groupingColumns':_0x19fa79[_0x5b16e9(0x12f)]}};return{'type':_0x4d2f90,'column':_0x19fa79['column']??'',..._0x19fa79[_0x5b16e9(0x12f)]&&{'groupingColumns':_0x19fa79['groupingColumns']}};}function buildLeftValue(_0x1412e2){const _0x423bc7=a142_0x24cc65,_0x390cf6={};_0x1412e2[_0x423bc7(0x114)]&&_0x1412e2[_0x423bc7(0xd9)]!==_0x423bc7(0x107)&&(_0x390cf6['name']=_0x1412e2[_0x423bc7(0x114)]);if(_0x1412e2['aggregation']){const _0x45a462=_0x1412e2['aggregation'];if(_0x45a462[_0x423bc7(0xd9)]==='CountDistinct')_0x390cf6[_0x423bc7(0x158)]={'type':'CountDistinct','columns':_0x45a462[_0x423bc7(0xe1)]};else{if(_0x45a462['type']===_0x423bc7(0xfb)||_0x45a462[_0x423bc7(0xd9)]===_0x423bc7(0xfd))_0x390cf6[_0x423bc7(0x158)]={'type':_0x45a462['type'],'column':_0x45a462[_0x423bc7(0x103)],'orderColumn':_0x45a462[_0x423bc7(0x150)],..._0x45a462[_0x423bc7(0x12f)]&&{'groupingColumns':_0x45a462[_0x423bc7(0x12f)]}};else _0x45a462[_0x423bc7(0xd9)]===_0x423bc7(0x13d)?_0x390cf6['aggregation']={'type':_0x423bc7(0x13d),..._0x45a462['groupingColumns']&&{'groupingColumns':_0x45a462[_0x423bc7(0x12f)]}}:_0x390cf6[_0x423bc7(0x158)]={'type':_0x45a462[_0x423bc7(0xd9)],'column':_0x45a462['column'],..._0x45a462['groupingColumns']&&{'groupingColumns':_0x45a462[_0x423bc7(0x12f)]}};}}return _0x1412e2['source']&&(_0x390cf6[_0x423bc7(0xe5)]={'name':_0x1412e2['source']}),_0x1412e2['filter']&&(_0x390cf6[_0x423bc7(0x111)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x1412e2['filter']))),_0x390cf6;}function yamlOperatorToApi(_0x1ddb6c){const _0x56be35=a142_0x24cc65,_0x993153={'type':mapYamlOperatorType(_0x1ddb6c[_0x56be35(0xd9)]),'not':_0x1ddb6c[_0x56be35(0x125)]??![]};if(isBetweenOperator(_0x1ddb6c['type']))return _0x1ddb6c[_0x56be35(0x161)]!==undefined&&(_0x993153[_0x56be35(0xed)]=typeof _0x1ddb6c[_0x56be35(0x161)]==='object'?_0x1ddb6c[_0x56be35(0x161)]:String(_0x1ddb6c[_0x56be35(0x161)])),_0x1ddb6c['max']!==undefined&&(_0x993153[_0x56be35(0x15c)]=typeof _0x1ddb6c[_0x56be35(0xeb)]===_0x56be35(0x10d)?_0x1ddb6c[_0x56be35(0xeb)]:String(_0x1ddb6c[_0x56be35(0xeb)])),_0x993153;if(_0x1ddb6c[_0x56be35(0xd9)]===_0x56be35(0x119))return _0x1ddb6c[_0x56be35(0x14b)]&&(_0x993153[_0x56be35(0x14b)]=_0x1ddb6c[_0x56be35(0x14b)]),_0x1ddb6c[_0x56be35(0x136)]&&(_0x993153[_0x56be35(0x136)]=_0x1ddb6c[_0x56be35(0x136)]),_0x1ddb6c[_0x56be35(0x14a)]!==undefined&&(_0x993153[_0x56be35(0x14a)]=_0x1ddb6c['reverse']),_0x993153;const _0x2ebebc=getEffectiveValue(_0x1ddb6c);if(_0x2ebebc!==undefined){if(Array[_0x56be35(0x168)](_0x2ebebc))_0x993153[_0x56be35(0x12a)]=_0x2ebebc;else isTemporalOperator(_0x1ddb6c[_0x56be35(0xd9)])?_0x993153[_0x56be35(0x122)]=_0x2ebebc:_0x993153[_0x56be35(0x155)]=_0x2ebebc;}return _0x1ddb6c[_0x56be35(0x121)]&&(_0x993153[_0x56be35(0x121)]=_0x1ddb6c['unit']),_0x993153;}function mapYamlOperatorType(_0x4f0c83){return _0x4f0c83;}export function toYamlString(_0x4c4c1b){const _0x512e57=a142_0x24cc65,_0x47b372=JSON[_0x512e57(0xf7)](JSON['stringify'](_0x4c4c1b)),_0x7686a4=a142_0x53a596['stringify'](_0x47b372,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x512e57(0x129)}),_0x3453c1=['rule:'];let _0x34d113=_0x7686a4;for(const _0x4242db of _0x3453c1){_0x34d113=_0x34d113['replace'](new RegExp('^('+_0x4242db+')','m'),(_0x3a7a10,_0x5465e7,_0x512e32)=>{if(_0x512e32===0x0||_0x34d113[_0x512e32-0x1]==='\x0a'&&_0x34d113[_0x512e32-0x2]==='\x0a')return _0x5465e7;return'\x0a'+_0x5465e7;});}return _0x34d113;}export function parseYamlString(_0x40690e){return parseSegmentYamlFile(_0x40690e);}export function isSegmentYaml(_0x562236){const _0x3472fb=a142_0x24cc65;if(typeof _0x562236!==_0x3472fb(0x10d)||_0x562236===null)return![];const _0x12b9c0=_0x562236;return _0x12b9c0['type']===_0x3472fb(0x130)||_0x12b9c0[_0x3472fb(0xd9)]===undefined;}function a142_0x36ba(){const _0x31a3a9=['aggregation','include','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','].attribute\x20cannot\x20be\x20empty.\x0a','maxValue','email_recipients','96838OHTLEQ','emailRecipients','valid','min','timezone','values','Warning:\x20activation\x20\x22','connector_config\x20for\x20activation\x20\x22','batch','Please\x20specify\x20a\x20valid\x20attribute\x20name.','isArray','connectionNameToTypeMap','formatting','activation_template_id','run_after_journey_refresh','behavior','attributes','6OgCdzz','join_row','warn','start_at','hourly','minutes_interval','description','Invalid\x20connector_config\x20for\x20activation\x20\x22','join_strategy','week','name','realtime','\x22:\x0a','allColumns','INVALID_ARGUMENT','cron','orderBy','order_by','schedule','entries','5379995kVxojc','add','folder','CONNECTOR_INVALID_CONFIG','456rcWxQI','Column','801xZtJVy','day','connection','kind','7692zqEIyq','emailToIdMap','match','activationParams','type','behavior_table','flatMap','warnings','month','code','notifyOn','sort','columns','92760hlguOs','ruleHashToName','repeat_unit','source','Unknown\x20connection:\x20','repeat_sub_frequency','leftValue','rule','joinRow','max','481766jOAZxQ','minValue','any','scheduleType','notification','connectorConfig','string','segmentFolderId','all_columns','stringify','visible','parse','All','hour','shape','First','runAfterJourneyRefresh','Last','\x20\x20-\x20\x22','minute','Reference','test','joinStrategy','column','3lpkNjp','visibility','\x27:\x20','Behavior','syndicationBehavior','Value','localRuleToName','has','repeatFrequency','object','operator','end_on','behaviorTableName','filter','funnel_stage','get','attribute','resolveSegmentName','startAt','nested_workflow_name','all','TimeRange','arrayMatching','attribute_name','And','513oKVzQM','1080640hcibup','31370964RoSLXe','nested_workflow_project_name','unit','value','endOn','repeatSubFrequency','not','activationTemplateId','isVisible','limit','null','rightValues','set','CONNECTOR_SCHEMA_NOT_FOUND','connectionId','exclude','groupingColumns','segment','daily','conditions[','lockEnabled','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a','Equal','from','nestedWorkflowName','length','__SEGMENT_REF__','join','connector_config','activations','Count','getSchema','JOURNEY_SYNTAX_ERROR','repeatUnit','New\x20Segment','usedNames','isFinite','connectionNameToIdMap','activations:','none','Connector:\x20','repeat_frequency','lock_enabled','reverse','duration','keys','toLowerCase','every','nestedWorkflowProjectName','orderColumn','replace','map','timeWindow','conditions','rightValue','weekly','push'];a142_0x36ba=function(){return _0x31a3a9;};return a142_0x36ba();}export function generateTemplate(_0x1c6a43=a142_0x24cc65(0x141)){const _0x1bf8f9=a142_0x24cc65,_0x837c1c={'type':_0x1bf8f9(0x130),'name':_0x1c6a43,'description':'Segment\x20description','rule':{'type':_0x1bf8f9(0x11c),'conditions':[{'type':_0x1bf8f9(0x109),'attribute':_0x1bf8f9(0x11b),'operator':{'type':_0x1bf8f9(0x135),'value':'value'}}]}};return toYamlString(_0x837c1c);}export function segmentToYamlString(_0xe9f119){const _0x7fea18=a142_0x24cc65,_0xabaeab=JSON[_0x7fea18(0xf7)](JSON['stringify'](_0xe9f119)),_0x1af7cd=a142_0x53a596[_0x7fea18(0xf5)](_0xabaeab,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x7fea18(0x129)}),_0x41e7c6=['rule:',_0x7fea18(0x145)];let _0x225daa=_0x1af7cd;for(const _0x54f726 of _0x41e7c6){_0x225daa=_0x225daa[_0x7fea18(0x151)](new RegExp('^('+_0x54f726+')','m'),(_0x1c6ca5,_0x759d60,_0x20b00e)=>{if(_0x20b00e===0x0||_0x225daa[_0x20b00e-0x1]==='\x0a'&&_0x225daa[_0x20b00e-0x2]==='\x0a')return _0x759d60;return'\x0a'+_0x759d60;});}return _0x225daa;}export function parseSegmentYamlFile(_0x9221d7){return safeParseYaml(_0x9221d7,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x2ca7f5){const _0x4cde11=a142_0x24cc65;return{'type':_0x4cde11(0x130),'name':_0x2ca7f5[_0x4cde11(0x179)],..._0x2ca7f5['description']!==undefined&&{'description':_0x2ca7f5[_0x4cde11(0x175)]},..._0x2ca7f5[_0x4cde11(0xcd)]!==undefined&&{'folder':_0x2ca7f5[_0x4cde11(0xcd)]},..._0x2ca7f5[_0x4cde11(0xe9)]&&{'rule':normalizeRule(_0x2ca7f5[_0x4cde11(0xe9)])},..._0x2ca7f5[_0x4cde11(0xd4)]!==undefined&&{'kind':_0x2ca7f5[_0x4cde11(0xd4)]},..._0x2ca7f5['visible']!==undefined&&{'visible':_0x2ca7f5[_0x4cde11(0xf6)]},..._0x2ca7f5[_0x4cde11(0x13c)]&&{'activations':_0x2ca7f5[_0x4cde11(0x13c)][_0x4cde11(0x152)](normalizeActivation)}};}export function normalizeRule(_0x39a711){const _0x3e7418=a142_0x24cc65;return{'type':_0x39a711[_0x3e7418(0xd9)],'conditions':_0x39a711[_0x3e7418(0x154)][_0x3e7418(0x152)](normalizeCondition),..._0x39a711[_0x3e7418(0x175)]!==undefined&&{'description':_0x39a711[_0x3e7418(0x175)]}};}function normalizeCondition(_0x3c369d){const _0x34d963=a142_0x24cc65;if('segment'in _0x3c369d&&(_0x3c369d['type']===_0x34d963(0x159)||_0x3c369d[_0x34d963(0xd9)]===_0x34d963(0x12e))){const _0x1a1364=_0x3c369d;return{'type':_0x1a1364[_0x34d963(0xd9)],'segment':_0x1a1364[_0x34d963(0x130)]};}if(_0x3c369d[_0x34d963(0xd9)]===_0x34d963(0x11c)||_0x3c369d[_0x34d963(0xd9)]==='Or'){const _0x55f2c1=_0x3c369d;return{'type':_0x55f2c1[_0x34d963(0xd9)],'conditions':_0x55f2c1[_0x34d963(0x154)][_0x34d963(0x152)](normalizeCondition),..._0x55f2c1['description']!==undefined&&{'description':_0x55f2c1[_0x34d963(0x175)]}};}if(_0x34d963(0x103)in _0x3c369d&&_0x3c369d['type']===_0x34d963(0xd0)){const _0x15a8b1=_0x3c369d;return{'type':'Column','column':_0x15a8b1[_0x34d963(0x103)],'operator':normalizeOperator(_0x15a8b1['operator'])};}if(_0x3c369d[_0x34d963(0xd9)]==='Behavior'){const _0xae1e63=_0x3c369d;return{'type':'Behavior','attribute':_0xae1e63[_0x34d963(0x114)],'operator':normalizeOperator(_0xae1e63['operator']),..._0xae1e63[_0x34d963(0x11a)]!==undefined&&{'arrayMatching':_0xae1e63[_0x34d963(0x11a)]},..._0xae1e63[_0x34d963(0x12e)]!==undefined&&{'exclude':_0xae1e63[_0x34d963(0x12e)]},..._0xae1e63[_0x34d963(0x158)]!==undefined&&{'aggregation':_0xae1e63['aggregation']},..._0xae1e63[_0x34d963(0xe5)]!==undefined&&{'source':_0xae1e63[_0x34d963(0xe5)]},..._0xae1e63[_0x34d963(0x111)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0xae1e63[_0x34d963(0x111)])))},..._0xae1e63['timeWindow']!==undefined&&{'timeWindow':_0xae1e63[_0x34d963(0x153)]},..._0xae1e63['limit']!==undefined&&{'limit':_0xae1e63[_0x34d963(0x128)]}};}const _0x4b9095=_0x3c369d;return{'type':'Value','attribute':_0x4b9095[_0x34d963(0x114)],'operator':normalizeOperator(_0x4b9095[_0x34d963(0x10e)]),..._0x4b9095[_0x34d963(0x11a)]!==undefined&&{'arrayMatching':_0x4b9095[_0x34d963(0x11a)]},..._0x4b9095[_0x34d963(0x12e)]!==undefined&&{'exclude':_0x4b9095[_0x34d963(0x12e)]},..._0x4b9095[_0x34d963(0x158)]!==undefined&&{'aggregation':_0x4b9095[_0x34d963(0x158)]},..._0x4b9095[_0x34d963(0xe5)]!==undefined&&{'source':_0x4b9095[_0x34d963(0xe5)]},..._0x4b9095[_0x34d963(0x111)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x4b9095[_0x34d963(0x111)])))},..._0x4b9095['limit']!==undefined&&{'limit':_0x4b9095[_0x34d963(0x128)]}};}function normalizeOperator(_0x56dc2e){const _0x58fa8a=a142_0x24cc65;if(isBetweenOperator(_0x56dc2e['type']))return{'type':_0x56dc2e[_0x58fa8a(0xd9)],..._0x56dc2e['not']!==undefined&&{'not':_0x56dc2e[_0x58fa8a(0x125)]},..._0x56dc2e[_0x58fa8a(0x161)]!==undefined&&{'min':_0x56dc2e[_0x58fa8a(0x161)]},..._0x56dc2e[_0x58fa8a(0xeb)]!==undefined&&{'max':_0x56dc2e['max']}};const _0x124ae1=getEffectiveValue(_0x56dc2e);return{'type':_0x56dc2e[_0x58fa8a(0xd9)],..._0x56dc2e['not']!==undefined&&{'not':_0x56dc2e[_0x58fa8a(0x125)]},..._0x124ae1!==undefined&&{'value':_0x124ae1},..._0x56dc2e[_0x58fa8a(0x121)]!==undefined&&{'unit':_0x56dc2e[_0x58fa8a(0x121)]},..._0x56dc2e[_0x58fa8a(0x14b)]!==undefined&&{'duration':_0x56dc2e[_0x58fa8a(0x14b)]},..._0x56dc2e[_0x58fa8a(0x136)]!==undefined&&{'from':_0x56dc2e[_0x58fa8a(0x136)]},..._0x56dc2e[_0x58fa8a(0x14a)]!==undefined&&{'reverse':_0x56dc2e[_0x58fa8a(0x14a)]}};}function normalizeActivation(_0x1c94c0){const _0x36f9c3=a142_0x24cc65;return{'name':_0x1c94c0[_0x36f9c3(0x179)],'connection':_0x1c94c0['connection'],..._0x1c94c0[_0x36f9c3(0x175)]!==undefined&&{'description':_0x1c94c0['description']},..._0x1c94c0[_0x36f9c3(0xf4)]!==undefined&&{'all_columns':_0x1c94c0['all_columns']},..._0x1c94c0[_0x36f9c3(0xe1)]!==undefined&&{'columns':_0x1c94c0[_0x36f9c3(0xe1)]},..._0x1c94c0[_0x36f9c3(0x16d)]!==undefined&&{'behavior':_0x1c94c0[_0x36f9c3(0x16d)]},..._0x1c94c0['schedule']!==undefined&&{'schedule':_0x1c94c0[_0x36f9c3(0x181)]},..._0x1c94c0[_0x36f9c3(0xf0)]!==undefined&&{'notification':_0x1c94c0[_0x36f9c3(0xf0)]},..._0x1c94c0[_0x36f9c3(0x13b)]!==undefined&&{'connector_config':_0x1c94c0[_0x36f9c3(0x13b)]},..._0x1c94c0[_0x36f9c3(0x16b)]!==undefined&&{'activation_template_id':_0x1c94c0[_0x36f9c3(0x16b)]},..._0x1c94c0[_0x36f9c3(0x120)]!==undefined&&{'nested_workflow_project_name':_0x1c94c0[_0x36f9c3(0x120)]},..._0x1c94c0['nested_workflow_name']!==undefined&&{'nested_workflow_name':_0x1c94c0[_0x36f9c3(0x117)]},..._0x1c94c0[_0x36f9c3(0x149)]!==undefined&&{'lock_enabled':_0x1c94c0[_0x36f9c3(0x149)]}};}function getColumnName(_0x86f8c1){const _0x1eadc7=a142_0x24cc65;return _0x86f8c1[_0x1eadc7(0x103)]||_0x86f8c1['name'];}export function activationResponseToDef(_0x5d3f25,_0x1bfddf,_0x2d087d){const _0x3360e6=a142_0x24cc65,_0x26e56b=_0x5d3f25[_0x3360e6(0x12d)]||'',_0x267107=_0x2d087d?.[_0x3360e6(0x113)](_0x26e56b)??_0x26e56b,_0x15dfb4={'name':_0x5d3f25[_0x3360e6(0x179)],'connection':_0x267107};_0x5d3f25['description']&&(_0x15dfb4[_0x3360e6(0x175)]=_0x5d3f25[_0x3360e6(0x175)]);let _0x2d2c89=[];_0x5d3f25[_0x3360e6(0xe1)]&&_0x5d3f25['columns'][_0x3360e6(0x138)]>0x0&&(_0x2d2c89=_0x5d3f25[_0x3360e6(0xe1)]['filter'](_0x58d88e=>_0x58d88e&&getColumnName(_0x58d88e))[_0x3360e6(0x152)](_0x137ba0=>{const _0x1522ed=_0x3360e6,_0x3b35d5=getColumnName(_0x137ba0);if(_0x137ba0['type']||_0x137ba0['visibility'])return{'name':_0x3b35d5,..._0x137ba0[_0x1522ed(0xd9)]&&{'type':_0x137ba0[_0x1522ed(0xd9)]},..._0x137ba0['visibility']&&{'visibility':_0x137ba0['visibility']}};return _0x3b35d5;}));_0x2d2c89['length']>0x0&&(_0x15dfb4[_0x3360e6(0xe1)]=_0x2d2c89);_0x5d3f25['allColumns']!==undefined&&(_0x5d3f25[_0x3360e6(0x17c)]===![]&&_0x2d2c89[_0x3360e6(0x138)]===0x0?_0x15dfb4[_0x3360e6(0xf4)]=!![]:_0x15dfb4[_0x3360e6(0xf4)]=_0x5d3f25[_0x3360e6(0x17c)]);const _0x293527={};let _0x2cd548=![];_0x5d3f25['scheduleType']&&(_0x293527['type']=_0x5d3f25[_0x3360e6(0xef)],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x140)]&&(_0x293527['repeat_unit']=_0x5d3f25[_0x3360e6(0x140)],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x10c)]!==undefined&&_0x5d3f25[_0x3360e6(0x10c)]!==null&&(_0x293527['repeat_frequency']=_0x5d3f25['repeatFrequency'],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x124)]&&_0x5d3f25[_0x3360e6(0x124)][_0x3360e6(0x138)]>0x0&&(_0x293527['repeat_sub_frequency']=_0x5d3f25['repeatSubFrequency'],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x116)]!==undefined&&(_0x293527[_0x3360e6(0x172)]=_0x5d3f25[_0x3360e6(0x116)],_0x2cd548=!![]);_0x5d3f25[_0x3360e6(0x123)]!==undefined&&(_0x293527[_0x3360e6(0x10f)]=_0x5d3f25['endOn'],_0x2cd548=!![]);_0x5d3f25['timezone']&&(_0x293527[_0x3360e6(0x162)]=_0x5d3f25[_0x3360e6(0x162)],_0x2cd548=!![]);_0x2cd548&&(_0x15dfb4[_0x3360e6(0x181)]=_0x293527);(_0x5d3f25[_0x3360e6(0xdf)]&&_0x5d3f25['notifyOn'][_0x3360e6(0x138)]>0x0||_0x5d3f25[_0x3360e6(0x15f)]&&_0x5d3f25[_0x3360e6(0x15f)][_0x3360e6(0x138)]>0x0)&&(_0x15dfb4['notification']={},_0x5d3f25[_0x3360e6(0xdf)]&&_0x5d3f25['notifyOn'][_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0xf0)]['notify_on']=_0x5d3f25[_0x3360e6(0xdf)]),_0x5d3f25[_0x3360e6(0x15f)]&&_0x5d3f25[_0x3360e6(0x15f)][_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0xf0)][_0x3360e6(0x15d)]=_0x5d3f25['emailRecipients'][_0x3360e6(0x152)](_0xaa39d5=>{const _0x26b1ad=_0x3360e6,_0x113400=_0x1bfddf?.[_0x26b1ad(0x113)](_0xaa39d5);return _0x113400??String(_0xaa39d5);})));_0x5d3f25['connectorConfig']&&Object[_0x3360e6(0x14c)](_0x5d3f25['connectorConfig'])[_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0x13b)]=normalizeConnectorConfigForYaml(_0x5d3f25['connectorConfig']));_0x5d3f25[_0x3360e6(0x126)]&&(_0x15dfb4['activation_template_id']=_0x5d3f25[_0x3360e6(0x126)]);if(_0x5d3f25[_0x3360e6(0x108)]){const _0x4e63b5={},_0x522644=_0x5d3f25['syndicationBehavior'];_0x522644[_0x3360e6(0xe1)]&&_0x522644[_0x3360e6(0xe1)][_0x3360e6(0x138)]>0x0&&(_0x4e63b5[_0x3360e6(0xe1)]=_0x522644[_0x3360e6(0xe1)]['filter'](_0x130acb=>_0x130acb&&getColumnName(_0x130acb))[_0x3360e6(0x152)](_0xf3fde3=>({'name':getColumnName(_0xf3fde3),..._0xf3fde3['type']&&{'type':_0xf3fde3[_0x3360e6(0xd9)]},..._0xf3fde3[_0x3360e6(0x105)]&&{'visibility':_0xf3fde3['visibility']}}))),_0x522644[_0x3360e6(0x110)]&&(_0x4e63b5[_0x3360e6(0xda)]=_0x522644[_0x3360e6(0x110)]),_0x522644[_0x3360e6(0xea)]!==undefined&&(_0x4e63b5[_0x3360e6(0x170)]=_0x522644[_0x3360e6(0xea)]),_0x522644[_0x3360e6(0x102)]&&(_0x4e63b5[_0x3360e6(0x177)]=_0x522644[_0x3360e6(0x102)]),_0x522644[_0x3360e6(0x16a)]&&(_0x4e63b5[_0x3360e6(0x16a)]=_0x522644['formatting']),_0x522644[_0x3360e6(0x17f)]&&_0x522644[_0x3360e6(0x17f)][_0x3360e6(0x138)]>0x0&&(_0x4e63b5[_0x3360e6(0x180)]=_0x522644[_0x3360e6(0x17f)]),Object[_0x3360e6(0x14c)](_0x4e63b5)[_0x3360e6(0x138)]>0x0&&(_0x15dfb4[_0x3360e6(0x16d)]=_0x4e63b5);}return _0x5d3f25['nestedWorkflowProjectName']&&(_0x15dfb4[_0x3360e6(0x120)]=_0x5d3f25[_0x3360e6(0x14f)]),_0x5d3f25[_0x3360e6(0x137)]&&(_0x15dfb4[_0x3360e6(0x117)]=_0x5d3f25[_0x3360e6(0x137)]),_0x5d3f25[_0x3360e6(0x133)]!==undefined&&(_0x15dfb4[_0x3360e6(0x149)]=_0x5d3f25['lockEnabled']),_0x15dfb4;}export function journeyActivationStepToYaml(_0x4a126b,_0x96c2d8,_0x55311d){const _0x1ab91d=a142_0x24cc65,_0x487b07=_0x4a126b[_0x1ab91d(0x16e)][_0x1ab91d(0xd8)],_0x5b53cb=_0x487b07[_0x1ab91d(0x12d)]||'',_0x159d71=_0x55311d?.[_0x1ab91d(0x113)](_0x5b53cb)??_0x5b53cb,_0x1af0b0={'name':_0x487b07['name']||'','connection':_0x159d71};_0x4a126b[_0x1ab91d(0x16e)][_0x1ab91d(0xfc)]&&(_0x1af0b0[_0x1ab91d(0x16c)]=!![]);_0x487b07[_0x1ab91d(0x175)]&&(_0x1af0b0['description']=_0x487b07[_0x1ab91d(0x175)]);let _0x185483=[];_0x487b07[_0x1ab91d(0xe1)]&&_0x487b07[_0x1ab91d(0xe1)][_0x1ab91d(0x138)]>0x0&&(_0x185483=_0x487b07[_0x1ab91d(0xe1)]['filter'](_0x62e7c1=>_0x62e7c1&&getColumnName(_0x62e7c1))[_0x1ab91d(0x152)](_0x1a4843=>{const _0x10f3cf=_0x1ab91d,_0x49d35f=getColumnName(_0x1a4843);if(_0x1a4843[_0x10f3cf(0xd9)]||_0x1a4843[_0x10f3cf(0x105)])return{'name':_0x49d35f,..._0x1a4843[_0x10f3cf(0xd9)]&&{'type':_0x1a4843[_0x10f3cf(0xd9)]},..._0x1a4843['visibility']&&{'visibility':_0x1a4843[_0x10f3cf(0x105)]}};return _0x49d35f;}));_0x185483[_0x1ab91d(0x138)]>0x0&&(_0x1af0b0[_0x1ab91d(0xe1)]=_0x185483);_0x487b07[_0x1ab91d(0x17c)]!==undefined&&(_0x487b07[_0x1ab91d(0x17c)]===![]&&_0x185483[_0x1ab91d(0x138)]===0x0?_0x1af0b0[_0x1ab91d(0xf4)]=!![]:_0x1af0b0[_0x1ab91d(0xf4)]=_0x487b07[_0x1ab91d(0x17c)]);const _0x44c05b={};let _0x3d9d6b=![];_0x487b07['scheduleType']&&(_0x44c05b['type']=_0x487b07[_0x1ab91d(0xef)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x140)]&&(_0x44c05b['repeat_unit']=_0x487b07[_0x1ab91d(0x140)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x10c)]!==undefined&&_0x487b07[_0x1ab91d(0x10c)]!==null&&(_0x44c05b['repeat_frequency']=_0x487b07['repeatFrequency'],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x116)]!==undefined&&(_0x44c05b[_0x1ab91d(0x172)]=_0x487b07[_0x1ab91d(0x116)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x123)]!==undefined&&(_0x44c05b['end_on']=_0x487b07[_0x1ab91d(0x123)],_0x3d9d6b=!![]);_0x487b07[_0x1ab91d(0x162)]&&(_0x44c05b[_0x1ab91d(0x162)]=_0x487b07[_0x1ab91d(0x162)],_0x3d9d6b=!![]);_0x3d9d6b&&(_0x1af0b0[_0x1ab91d(0x181)]=_0x44c05b);(_0x487b07[_0x1ab91d(0xdf)]&&_0x487b07['notifyOn'][_0x1ab91d(0x138)]>0x0||_0x487b07[_0x1ab91d(0x15f)]&&_0x487b07[_0x1ab91d(0x15f)][_0x1ab91d(0x138)]>0x0)&&(_0x1af0b0[_0x1ab91d(0xf0)]={},_0x487b07[_0x1ab91d(0xdf)]&&_0x487b07['notifyOn']['length']>0x0&&(_0x1af0b0['notification']['notify_on']=_0x487b07[_0x1ab91d(0xdf)]),_0x487b07[_0x1ab91d(0x15f)]&&_0x487b07[_0x1ab91d(0x15f)][_0x1ab91d(0x138)]>0x0&&(_0x1af0b0[_0x1ab91d(0xf0)][_0x1ab91d(0x15d)]=_0x487b07[_0x1ab91d(0x15f)][_0x1ab91d(0x152)](_0x52778a=>{const _0x185ba3=_0x1ab91d,_0x11d77a=_0x96c2d8?.[_0x185ba3(0x113)](_0x52778a);return _0x11d77a??String(_0x52778a);})));_0x487b07[_0x1ab91d(0xf1)]&&Object[_0x1ab91d(0x14c)](_0x487b07[_0x1ab91d(0xf1)])[_0x1ab91d(0x138)]>0x0&&(_0x1af0b0['connector_config']=normalizeConnectorConfigForYaml(_0x487b07['connectorConfig']));_0x487b07[_0x1ab91d(0x126)]&&(_0x1af0b0[_0x1ab91d(0x16b)]=_0x487b07['activationTemplateId']);if(_0x487b07['syndicationBehavior']){const _0xa5de99={},_0x649678=_0x487b07['syndicationBehavior'];_0x649678[_0x1ab91d(0xe1)]&&_0x649678[_0x1ab91d(0xe1)]['length']>0x0&&(_0xa5de99[_0x1ab91d(0xe1)]=_0x649678['columns'][_0x1ab91d(0x111)](_0x33a88d=>_0x33a88d&&getColumnName(_0x33a88d))[_0x1ab91d(0x152)](_0x2ad63c=>({'name':getColumnName(_0x2ad63c),..._0x2ad63c[_0x1ab91d(0xd9)]&&{'type':_0x2ad63c[_0x1ab91d(0xd9)]},..._0x2ad63c[_0x1ab91d(0x105)]&&{'visibility':_0x2ad63c[_0x1ab91d(0x105)]}}))),_0x649678['behaviorTableName']&&(_0xa5de99[_0x1ab91d(0xda)]=_0x649678['behaviorTableName']),_0x649678['joinRow']!==undefined&&(_0xa5de99[_0x1ab91d(0x170)]=_0x649678[_0x1ab91d(0xea)]),_0x649678[_0x1ab91d(0x102)]&&(_0xa5de99[_0x1ab91d(0x177)]=_0x649678[_0x1ab91d(0x102)]),_0x649678['formatting']&&(_0xa5de99[_0x1ab91d(0x16a)]=_0x649678[_0x1ab91d(0x16a)]),_0x649678[_0x1ab91d(0x17f)]&&_0x649678[_0x1ab91d(0x17f)]['length']>0x0&&(_0xa5de99[_0x1ab91d(0x180)]=_0x649678[_0x1ab91d(0x17f)]),Object[_0x1ab91d(0x14c)](_0xa5de99)[_0x1ab91d(0x138)]>0x0&&(_0x1af0b0['behavior']=_0xa5de99);}return _0x1af0b0;}export function segmentWithActivationsToYaml(_0x2976a4,_0x20559a,_0xc03e83,_0x36ced7,_0x1aa8c4){const _0x2284d7=a142_0x24cc65,_0x1f3f10=segmentResponseToDefSync(_0x2976a4,_0xc03e83);return _0x20559a['length']>0x0&&(_0x1f3f10[_0x2284d7(0x13c)]=_0x20559a[_0x2284d7(0x152)](_0x4cccb8=>activationResponseToDef(_0x4cccb8,_0x36ced7,_0x1aa8c4))),_0x1f3f10;}function normalizeColumn(_0xce03ce){const _0x4f0d41=a142_0x24cc65;if(typeof _0xce03ce===_0x4f0d41(0xf2))return{'column':_0xce03ce,'source':{'column':_0xce03ce}};return{'column':_0xce03ce[_0x4f0d41(0x179)],'source':{'column':_0xce03ce[_0x4f0d41(0x179)]},..._0xce03ce[_0x4f0d41(0xd9)]&&{'type':_0xce03ce[_0x4f0d41(0xd9)]},..._0xce03ce[_0x4f0d41(0x105)]&&{'visibility':_0xce03ce[_0x4f0d41(0x105)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a142_0x24cc65(0x14c)](ActivationDefSchema[a142_0x24cc65(0xfa)]));export function warnUnrecognizedActivationFields(_0x47f266,_0x11c23c){const _0x84dd22=a142_0x24cc65,_0x3180ac=Object['keys'](_0x47f266)[_0x84dd22(0x111)](_0x14d13d=>!KNOWN_ACTIVATION_FIELDS[_0x84dd22(0x10b)](_0x14d13d));if(_0x3180ac[_0x84dd22(0x138)]>0x0){const _0x56d11a=_0x3180ac[_0x84dd22(0x152)](_0x5c440a=>_0x84dd22(0xfe)+_0x5c440a+'\x22')[_0x84dd22(0x13a)]('\x0a');console[_0x84dd22(0x171)](_0x84dd22(0x164)+_0x11c23c+_0x84dd22(0x134)+_0x56d11a);}}export async function activationDefToCreateRequest(_0x41d76d,_0x4ce43d){const _0x496fbe=a142_0x24cc65;warnUnrecognizedActivationFields(_0x41d76d,_0x41d76d['name']);const _0x117572=_0x4ce43d?.[_0x496fbe(0xd6)],_0x319a16=_0x4ce43d?.[_0x496fbe(0x144)],_0x27fccc=_0x41d76d[_0x496fbe(0xd3)];let _0x59f57c;const _0x1c9e18=parseInt(_0x27fccc,0xa);if(!isNaN(_0x1c9e18)&&String(_0x1c9e18)===_0x27fccc)_0x59f57c=_0x1c9e18;else{const _0x156759=_0x319a16?.[_0x496fbe(0x113)](_0x27fccc);if(_0x156759===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x496fbe(0xe6)+_0x27fccc,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x59f57c=_0x156759;}const _0x10300b={'name':_0x41d76d[_0x496fbe(0x179)],'connectionId':_0x59f57c};_0x41d76d[_0x496fbe(0x175)]&&(_0x10300b[_0x496fbe(0x175)]=_0x41d76d[_0x496fbe(0x175)]);let _0x5a006d=[];_0x41d76d[_0x496fbe(0xe1)]&&_0x41d76d[_0x496fbe(0xe1)][_0x496fbe(0x138)]>0x0&&(_0x5a006d=_0x41d76d[_0x496fbe(0xe1)][_0x496fbe(0x111)](_0x2f42f7=>_0x2f42f7!=null)['map'](normalizeColumn));_0x5a006d['length']>0x0&&(_0x10300b[_0x496fbe(0xe1)]=_0x5a006d);_0x41d76d[_0x496fbe(0xf4)]!==undefined&&(_0x41d76d[_0x496fbe(0xf4)]===![]&&_0x5a006d[_0x496fbe(0x138)]===0x0?_0x10300b[_0x496fbe(0x17c)]=!![]:_0x10300b[_0x496fbe(0x17c)]=_0x41d76d[_0x496fbe(0xf4)]);if(_0x41d76d['schedule']){const _0x3bfb4a=_0x41d76d[_0x496fbe(0x181)],_0x4e4516=_0x3bfb4a[_0x496fbe(0xd9)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x3bfb4a[_0x496fbe(0xe4)]];_0x4e4516&&(_0x10300b[_0x496fbe(0xef)]=_0x4e4516);const _0x176c2f=_0x3bfb4a['repeat_unit']??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x3bfb4a[_0x496fbe(0xd9)]];_0x176c2f&&(_0x10300b[_0x496fbe(0x140)]=_0x176c2f);_0x3bfb4a[_0x496fbe(0x148)]!==undefined&&(_0x10300b['repeatFrequency']=_0x3bfb4a['repeat_frequency']);_0x3bfb4a[_0x496fbe(0xe7)]&&(_0x10300b[_0x496fbe(0x124)]=_0x3bfb4a[_0x496fbe(0xe7)]);_0x3bfb4a['start_at']!==undefined&&(_0x10300b[_0x496fbe(0x116)]=_0x3bfb4a[_0x496fbe(0x172)]);_0x3bfb4a[_0x496fbe(0x10f)]!==undefined&&(_0x10300b[_0x496fbe(0x123)]=_0x3bfb4a[_0x496fbe(0x10f)]);_0x3bfb4a['timezone']&&(_0x10300b[_0x496fbe(0x162)]=_0x3bfb4a[_0x496fbe(0x162)]);if(_0x4e4516&&_0x4e4516!==_0x496fbe(0x146)&&_0x4e4516!==_0x496fbe(0x17e)&&_0x3bfb4a['start_at']){const _0x3be5db=_0x3bfb4a['start_at'][_0x496fbe(0xd7)](/T(\d{2}:\d{2})/);_0x3be5db&&(_0x10300b['scheduleOption']=_0x3be5db[0x1]);}}_0x41d76d[_0x496fbe(0xf0)]&&(_0x41d76d[_0x496fbe(0xf0)]['notify_on']&&(_0x10300b['notifyOn']=_0x41d76d[_0x496fbe(0xf0)]['notify_on']),_0x41d76d[_0x496fbe(0xf0)]['email_recipients']&&(_0x10300b[_0x496fbe(0x15f)]=_0x41d76d[_0x496fbe(0xf0)][_0x496fbe(0x15d)][_0x496fbe(0x152)](_0x47d7b1=>{const _0x14aa58=_0x496fbe,_0x1bfa6a=Number(_0x47d7b1);if(!isNaN(_0x1bfa6a)&&String(_0x1bfa6a)===_0x47d7b1)return _0x1bfa6a;const _0x52f787=_0x117572?.['get'](_0x47d7b1[_0x14aa58(0x14d)]());if(_0x52f787===undefined)throw new SDKError(ErrorCode[_0x14aa58(0x17d)],'Unknown\x20email\x20recipient:\x20'+_0x47d7b1+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x52f787;})));if(_0x41d76d[_0x496fbe(0x13b)]){const _0x2aed2f=_0x4ce43d?.[_0x496fbe(0x169)]?.[_0x496fbe(0x113)](_0x27fccc);if(_0x2aed2f&&_0x4ce43d?.[_0x496fbe(0x13e)])try{const _0x313b74=await _0x4ce43d[_0x496fbe(0x13e)](_0x2aed2f),_0x61a3fb=validateConnectorConfig(_0x41d76d[_0x496fbe(0x13b)],_0x313b74);if(!_0x61a3fb[_0x496fbe(0x160)])throw new SDKError(ErrorCode[_0x496fbe(0xce)],_0x496fbe(0x176)+_0x41d76d[_0x496fbe(0x179)]+'\x22:\x0a'+formatValidationErrors(_0x61a3fb['errors']),undefined,{'helpText':_0x496fbe(0x147)+_0x2aed2f+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x313b74)});if(_0x61a3fb['warnings'][_0x496fbe(0x138)]>0x0){const _0x55ae1=formatValidationWarnings(_0x61a3fb[_0x496fbe(0xdc)]);console[_0x496fbe(0x171)](_0x496fbe(0x165)+_0x41d76d[_0x496fbe(0x179)]+_0x496fbe(0x17b)+_0x55ae1);}_0x10300b[_0x496fbe(0xf1)]=transformConfigToLegacy(_0x41d76d['connector_config'],_0x313b74);}catch(_0x537983){if(_0x537983 instanceof SDKError&&_0x537983[_0x496fbe(0xde)]===ErrorCode[_0x496fbe(0x12c)])_0x10300b[_0x496fbe(0xf1)]=_0x41d76d[_0x496fbe(0x13b)];else throw _0x537983;}else _0x10300b[_0x496fbe(0xf1)]=_0x41d76d[_0x496fbe(0x13b)];}_0x41d76d[_0x496fbe(0x16b)]!==undefined&&(_0x10300b[_0x496fbe(0x126)]=_0x41d76d['activation_template_id']);if(_0x41d76d[_0x496fbe(0x16d)]){const _0xdfca75=_0x41d76d[_0x496fbe(0x16d)],_0x13bf28={};if(_0xdfca75[_0x496fbe(0xe1)]&&_0xdfca75[_0x496fbe(0xe1)]['length']>0x0){const _0x213ee3=_0xdfca75[_0x496fbe(0xe1)][_0x496fbe(0x111)](_0x3849fc=>_0x3849fc&&_0x3849fc[_0x496fbe(0x179)])['map'](normalizeColumn);_0x213ee3[_0x496fbe(0x138)]>0x0&&(_0x13bf28['columns']=_0x213ee3);}_0xdfca75[_0x496fbe(0xda)]&&(_0x13bf28[_0x496fbe(0x110)]=_0xdfca75[_0x496fbe(0xda)]);_0xdfca75[_0x496fbe(0x177)]&&(_0x13bf28[_0x496fbe(0x102)]=_0xdfca75[_0x496fbe(0x177)]);if(_0xdfca75[_0x496fbe(0x170)]!==undefined)_0x13bf28['joinRow']=_0xdfca75['join_row'];else{if(_0xdfca75[_0x496fbe(0x177)]===_0x496fbe(0xfd)||_0xdfca75['join_strategy']===_0x496fbe(0xfb))_0x13bf28[_0x496fbe(0xea)]=0x1;else _0xdfca75['join_strategy']===_0x496fbe(0xf8)&&(_0x13bf28[_0x496fbe(0xea)]=null);}_0xdfca75[_0x496fbe(0x16a)]&&(_0x13bf28[_0x496fbe(0x16a)]=_0xdfca75[_0x496fbe(0x16a)]),_0xdfca75[_0x496fbe(0x180)]&&(_0x13bf28['orderBy']=_0xdfca75[_0x496fbe(0x180)]),_0x10300b[_0x496fbe(0x108)]=_0x13bf28;}return _0x41d76d[_0x496fbe(0x120)]&&(_0x10300b['nestedWorkflowProjectName']=_0x41d76d[_0x496fbe(0x120)]),_0x41d76d[_0x496fbe(0x117)]&&(_0x10300b['nestedWorkflowName']=_0x41d76d[_0x496fbe(0x117)]),_0x41d76d[_0x496fbe(0x149)]!==undefined&&(_0x10300b[_0x496fbe(0x133)]=_0x41d76d[_0x496fbe(0x149)]),_0x10300b;}export async function activationDefToUpdateRequest(_0x4c9887,_0xb41354){return activationDefToCreateRequest(_0x4c9887,_0xb41354);}export function deepSortObject(_0x3cb4bc){const _0x514df8=a142_0x24cc65;if(_0x3cb4bc===null||typeof _0x3cb4bc!=='object')return _0x3cb4bc;if(Array[_0x514df8(0x168)](_0x3cb4bc))return _0x3cb4bc[_0x514df8(0x152)](deepSortObject)[_0x514df8(0xe0)]((_0x3771bc,_0x565610)=>JSON['stringify'](_0x3771bc)['localeCompare'](JSON['stringify'](_0x565610)));const _0x5c1126={};for(const _0x58f61f of Object[_0x514df8(0x14c)](_0x3cb4bc)[_0x514df8(0xe0)]()){_0x5c1126[_0x58f61f]=deepSortObject(_0x3cb4bc[_0x58f61f]);}return _0x5c1126;}export function serializeRule(_0x4234a1){const _0x4af443=a142_0x24cc65;return JSON[_0x4af443(0xf5)](deepSortObject(_0x4234a1));}export function normalizeRuleForMatching(_0x424d7a){return normalizeConditionsForMatching(_0x424d7a);}function normalizeConditionsForMatching(_0xab0a68){const _0x3d159c=a142_0x24cc65;if(_0xab0a68===null||typeof _0xab0a68!==_0x3d159c(0x10d))return _0xab0a68;if(Array['isArray'](_0xab0a68))return _0xab0a68[_0x3d159c(0x152)](normalizeConditionsForMatching);const _0x36a158=_0xab0a68;if((_0x36a158[_0x3d159c(0xd9)]===_0x3d159c(0x159)||_0x36a158[_0x3d159c(0xd9)]==='exclude')&&typeof _0x36a158['segment']==='string')return{..._0x36a158,'segment':_0x3d159c(0x139)};const _0x1df16b={};for(const _0x47cdab of Object[_0x3d159c(0x14c)](_0x36a158)){_0x1df16b[_0x47cdab]=normalizeConditionsForMatching(_0x36a158[_0x47cdab]);}return _0x1df16b;}export function serializeRuleForMatching(_0x4a283f){const _0x494d06=a142_0x24cc65;return JSON[_0x494d06(0xf5)](deepSortObject(normalizeRuleForMatching(_0x4a283f)));}export function expandSegmentReferences(_0x2ebd2e,_0x46a4f4,_0xb8b80a=new Set()){return expandConditions(_0x2ebd2e,_0x46a4f4,_0xb8b80a);}function expandConditions(_0x2c9a57,_0x5c3bc3,_0x4558f2){const _0x314ff9=a142_0x24cc65;if(_0x2c9a57===null||typeof _0x2c9a57!=='object')return _0x2c9a57;if(Array[_0x314ff9(0x168)](_0x2c9a57))return _0x2c9a57[_0x314ff9(0x152)](_0x5c7253=>expandConditions(_0x5c7253,_0x5c3bc3,_0x4558f2));const _0x4f626f=_0x2c9a57;if((_0x4f626f[_0x314ff9(0xd9)]===_0x314ff9(0x159)||_0x4f626f['type']==='exclude')&&typeof _0x4f626f[_0x314ff9(0x130)]===_0x314ff9(0xf2)){const _0x431a75=_0x4f626f[_0x314ff9(0x130)],_0x5e18d8=_0x5c3bc3[_0x314ff9(0x113)](_0x431a75);if(_0x5e18d8&&!_0x4558f2[_0x314ff9(0x10b)](_0x431a75)){const _0x72b40b=new Set(_0x4558f2);_0x72b40b[_0x314ff9(0xcc)](_0x431a75);const _0x434358=expandConditions(_0x5e18d8,_0x5c3bc3,_0x72b40b);return{'type':_0x4f626f[_0x314ff9(0xd9)],'expanded_rule':_0x434358};}return{'type':_0x4f626f['type'],'expanded_rule':'__UNRESOLVED__'};}const _0x57d462={};for(const _0x1b6c53 of Object[_0x314ff9(0x14c)](_0x4f626f)){_0x57d462[_0x1b6c53]=expandConditions(_0x4f626f[_0x1b6c53],_0x5c3bc3,_0x4558f2);}return _0x57d462;}export function serializeExpandedRule(_0x300cee,_0x2beee7){const _0xf92201=a142_0x24cc65,_0x50eb70=expandSegmentReferences(_0x300cee,_0x2beee7);return JSON[_0xf92201(0xf5)](deepSortObject(_0x50eb70));}export function createSegmentNameContext(_0x33353f){const _0x5ba8c9=a142_0x24cc65,_0x12172b=new Set(),_0x2bb15c=new Map(),_0x99abfb=new Map();if(_0x33353f)for(const [_0x5f0960,_0x466a73]of Object[_0x5ba8c9(0x182)](_0x33353f)){if(_0x466a73[_0x5ba8c9(0xe9)]){const _0x3156ed=serializeRule(_0x466a73['rule']);_0x99abfb[_0x5ba8c9(0x12b)](_0x3156ed,_0x5f0960),_0x12172b[_0x5ba8c9(0xcc)](_0x5f0960);}}return{'usedNames':_0x12172b,'ruleHashToName':_0x2bb15c,'localRuleToName':_0x33353f?_0x99abfb:undefined};}export function resolveSegmentName(_0x276f82,_0x2f0911,_0x340552,_0x13470c){const _0xd6cf4a=a142_0x24cc65,_0x5bb532=serializeRule(_0x2f0911);if(_0x340552[_0xd6cf4a(0x10a)]){const _0x1b18ec=_0x340552[_0xd6cf4a(0x10a)]['get'](_0x5bb532);if(_0x1b18ec)return{'name':_0x1b18ec,'isDuplicate':![],'isLocalMatch':!![]};}const _0x18f23b=_0x340552[_0xd6cf4a(0xe3)]['get'](_0x5bb532);if(_0x18f23b)return{'name':_0x18f23b,'isDuplicate':!![],'isLocalMatch':![]};const _0x1e9520=_0x13470c(_0x276f82);let _0x5d948c=_0x1e9520||_0x276f82,_0x2ce86a=_0x5d948c,_0x207916=0x2;while(_0x340552[_0xd6cf4a(0x142)]['has'](_0x2ce86a)){_0x2ce86a=_0x5d948c+'_'+_0x207916,_0x207916++;}return _0x340552['usedNames']['add'](_0x2ce86a),_0x340552[_0xd6cf4a(0xe3)][_0xd6cf4a(0x12b)](_0x5bb532,_0x2ce86a),{'name':_0x2ce86a,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x1716a4){const _0x25a789=[],_0x332a41=_0x6d566e=>{const _0x324508=a142_0x2990;if(!_0x6d566e||typeof _0x6d566e!==_0x324508(0x10d))return;if(Array[_0x324508(0x168)](_0x6d566e)){_0x6d566e['forEach'](_0x332a41);return;}const _0x39fecf=_0x6d566e;(_0x39fecf[_0x324508(0xd9)]===_0x324508(0x159)||_0x39fecf[_0x324508(0xd9)]===_0x324508(0x12e))&&typeof _0x39fecf[_0x324508(0x130)]==='string'&&_0x25a789['push'](_0x39fecf['segment']);for(const _0x4bcde3 of Object[_0x324508(0x163)](_0x39fecf)){_0x332a41(_0x4bcde3);}};return _0x332a41(_0x1716a4),_0x25a789;}export function validateSegmentRule(_0x861275,_0x20abda){const _0x395408=a142_0x24cc65;if(!_0x20abda||!_0x20abda[_0x395408(0x154)])return;for(let _0x3c4853=0x0;_0x3c4853<_0x20abda['conditions']['length'];_0x3c4853++){const _0xdf6b99=_0x20abda[_0x395408(0x154)][_0x3c4853];if(_0x395408(0xd9)in _0xdf6b99&&_0xdf6b99['type']===_0x395408(0x109)){const _0x37b187=_0xdf6b99,_0x2bce3e=_0x37b187[_0x395408(0xe5)]||_0x37b187[_0x395408(0x158)];if((!_0x37b187[_0x395408(0x114)]||_0x37b187[_0x395408(0x114)]==='')&&!_0x2bce3e)throw new SDKError(ErrorCode[_0x395408(0x13f)],_0x395408(0x15a)+_0x861275+_0x395408(0x106)+(_0x395408(0x132)+_0x3c4853+_0x395408(0x15b))+_0x395408(0x167));}}}
|
|
1
|
+
const a142_0x48c789=a142_0x1ba4;(function(_0x373798,_0x2723d5){const _0x1699b6=a142_0x1ba4,_0x3ccd1c=_0x373798();while(!![]){try{const _0x224b95=parseInt(_0x1699b6(0x12a))/0x1+parseInt(_0x1699b6(0x19a))/0x2+parseInt(_0x1699b6(0x166))/0x3*(parseInt(_0x1699b6(0x195))/0x4)+-parseInt(_0x1699b6(0x17a))/0x5+-parseInt(_0x1699b6(0x186))/0x6*(parseInt(_0x1699b6(0x198))/0x7)+parseInt(_0x1699b6(0x130))/0x8+-parseInt(_0x1699b6(0x177))/0x9*(parseInt(_0x1699b6(0x12e))/0xa);if(_0x224b95===_0x2723d5)break;else _0x3ccd1c['push'](_0x3ccd1c['shift']());}catch(_0x55562f){_0x3ccd1c['push'](_0x3ccd1c['shift']());}}}(a142_0x1291,0x1a528));import*as a142_0x361253 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a142_0x48c789(0x14d),'hourly':a142_0x48c789(0x165),'weekly':a142_0x48c789(0x175),'monthly':a142_0x48c789(0x1bb),'minutes_interval':a142_0x48c789(0x17e)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a142_0x48c789(0x148),'hour':a142_0x48c789(0x157),'week':a142_0x48c789(0x1b1),'month':'monthly','minute':a142_0x48c789(0x121)};function filterRuleAsRuleDef(_0x4eb666){return _0x4eb666;}function ruleDefAsFilterRule(_0x25bd33){return _0x25bd33;}export function segmentResponseToDefSync(_0x48226e,_0x3c8bb6){const _0x4592ca=a142_0x48c789,_0x1510b6=_0x48226e[_0x4592ca(0x1b5)]&&_0x4592ca(0x145)in _0x48226e[_0x4592ca(0x1b5)]&&_0x48226e[_0x4592ca(0x1b5)]['type'];return{'type':_0x4592ca(0x13a),'name':_0x48226e['name'],..._0x48226e[_0x4592ca(0x1ab)]&&{'description':_0x48226e[_0x4592ca(0x1ab)]},..._0x3c8bb6&&{'folder':_0x3c8bb6},..._0x1510b6&&{'rule':apiRuleToYaml(_0x48226e[_0x4592ca(0x1b5)])},..._0x48226e['kind']!==undefined&&{'kind':_0x48226e['kind']===0x0?_0x4592ca(0x187):_0x48226e[_0x4592ca(0x1c7)]===0x1?'realtime':_0x4592ca(0x1c0)},..._0x48226e[_0x4592ca(0x1a4)]!==undefined&&{'visible':_0x48226e[_0x4592ca(0x1a4)]}};}export async function segmentResponseToDef(_0x8bd6a,_0x293ca2,_0x4cf419){const _0x1a8989=a142_0x48c789,_0x20d2dd=segmentResponseToDefSync(_0x8bd6a,_0x4cf419);if(!_0x293ca2||!_0x293ca2[_0x1a8989(0x1c3)])return _0x20d2dd;return _0x20d2dd['rule']&&(_0x20d2dd[_0x1a8989(0x1b5)]=await resolveRuleSegmentRefs(_0x20d2dd[_0x1a8989(0x1b5)],_0x293ca2[_0x1a8989(0x1c3)])),_0x20d2dd;}export function apiRuleToYaml(_0x517903){const _0x470ec5=a142_0x48c789,_0x28e590=(_0x517903['conditions']||[])[_0x470ec5(0x19c)](_0x5dcf20=>{const _0x5ba5d3=_0x470ec5,_0x166450=apiConditionToYaml(_0x5dcf20);if(isCompositeType(_0x166450)&&_0x166450['description']!==undefined){const _0x394811=_0x166450;if(_0x394811[_0x5ba5d3(0x1b8)][_0x5ba5d3(0x1b4)]===0x1)return _0x394811['conditions'];return[{'type':_0x394811[_0x5ba5d3(0x145)],'conditions':_0x394811[_0x5ba5d3(0x1b8)]}];}return[_0x166450];});if(_0x28e590['length']===0x1&&!_0x517903[_0x470ec5(0x1ab)]&&isCompositeType(_0x28e590[0x0])){const _0x474703=_0x28e590[0x0];if(_0x474703[_0x470ec5(0x145)]===_0x517903[_0x470ec5(0x145)]&&_0x474703[_0x470ec5(0x1b8)]&&_0x474703[_0x470ec5(0x1ab)]===undefined)return{'type':_0x517903[_0x470ec5(0x145)],'conditions':_0x474703[_0x470ec5(0x1b8)]};}return{'type':_0x517903[_0x470ec5(0x145)],'conditions':_0x28e590};}export async function resolveRuleSegmentRefs(_0x13b505,_0x7bc320){const _0x226e80=a142_0x48c789;return transformRuleSegmentRefs(_0x13b505,_0x7bc320,_0x2bc54f=>/^\d+$/[_0x226e80(0x120)](_0x2bc54f));}async function transformConditionSegmentRefs(_0x53bd7d,_0x531ac9,_0x1128e8,_0x5e594f){const _0xbf1ee0=a142_0x48c789;if('segment'in _0x53bd7d&&(_0x53bd7d['type']===_0xbf1ee0(0x181)||_0x53bd7d['type']===_0xbf1ee0(0x194))){const _0x544e9d=_0x53bd7d;if(_0x1128e8(_0x544e9d[_0xbf1ee0(0x13a)]))return{..._0x544e9d,'segment':await _0x531ac9(_0x544e9d[_0xbf1ee0(0x13a)])};return _0x53bd7d;}if(_0xbf1ee0(0x1b8)in _0x53bd7d&&_0x53bd7d[_0xbf1ee0(0x1b8)]){const _0x223a19=_0x53bd7d,_0xc8ba43=await Promise[_0xbf1ee0(0x1c2)](_0x223a19[_0xbf1ee0(0x1b8)][_0xbf1ee0(0x14f)](_0x1cc40d=>transformConditionSegmentRefs(_0x1cc40d,_0x531ac9,_0x1128e8,_0x5e594f)));return{..._0x223a19,'conditions':_0xc8ba43};}if(_0xbf1ee0(0x164)in _0x53bd7d&&_0x53bd7d[_0xbf1ee0(0x164)]){const _0x3bcd84=_0x53bd7d,_0xa69f9=await _0x5e594f(filterRuleAsRuleDef(_0x3bcd84[_0xbf1ee0(0x164)]),_0x531ac9);return{..._0x3bcd84,'filter':ruleDefAsFilterRule(_0xa69f9)};}return _0x53bd7d;}async function transformRuleSegmentRefs(_0x3ebda2,_0xb95466,_0x5dfd27){const _0x47bafa=a142_0x48c789,_0x30076a=(_0x181b41,_0x4f3579)=>transformRuleSegmentRefs(_0x181b41,_0x4f3579,_0x5dfd27),_0x4d0551=await Promise[_0x47bafa(0x1c2)](_0x3ebda2[_0x47bafa(0x1b8)][_0x47bafa(0x14f)](_0x3f437b=>transformConditionSegmentRefs(_0x3f437b,_0xb95466,_0x5dfd27,_0x30076a)));return{..._0x3ebda2,'conditions':_0x4d0551};}export async function resolveRuleSegmentIds(_0x3e9be5,_0x1e1ab9){const _0x4b398e=a142_0x48c789;return transformRuleSegmentRefs(_0x3e9be5,_0x1e1ab9,_0x5a6d55=>!/^\d+$/[_0x4b398e(0x120)](_0x5a6d55));}function isCompositeType(_0x3fc77a){const _0x4324a3=a142_0x48c789;return _0x3fc77a[_0x4324a3(0x145)]===_0x4324a3(0x135)||_0x3fc77a[_0x4324a3(0x145)]==='Or';}function isBehaviorApiCondition(_0x311a80){const _0xae6b41=a142_0x48c789;if(!_0x311a80[_0xae6b41(0x15a)]?.[_0xae6b41(0x131)]?.[_0xae6b41(0x173)])return![];return!![];}function apiConditionToYaml(_0x58de15){const _0x4caace=a142_0x48c789;if(_0x58de15[_0x4caace(0x145)]==='And'||_0x58de15[_0x4caace(0x145)]==='Or'){if(_0x58de15[_0x4caace(0x1b8)]){const _0x204c24=_0x58de15[_0x4caace(0x1b8)][_0x4caace(0x14f)](apiConditionToYaml),_0x3951c5=_0x58de15[_0x4caace(0x1ab)]!==undefined;if(_0x204c24['length']===0x1&&!_0x3951c5)return _0x204c24[0x0];return{'type':_0x58de15[_0x4caace(0x145)],'conditions':_0x204c24,..._0x58de15[_0x4caace(0x1ab)]!==undefined&&{'description':_0x58de15[_0x4caace(0x1ab)]}};}}if(_0x58de15[_0x4caace(0x145)]==='Value'&&_0x58de15['leftValue']&&_0x58de15[_0x4caace(0x1af)]){const _0x356f9a=_0x58de15[_0x4caace(0x15a)][_0x4caace(0x1be)]?buildAggregationDefFromApi(_0x58de15[_0x4caace(0x15a)]['aggregation']):undefined;if(isBehaviorApiCondition(_0x58de15)){const _0x5837dd=_0x58de15['leftValue']['source']['name'];return{'type':_0x4caace(0x132),'attribute':'','operator':apiOperatorToYaml(_0x58de15[_0x4caace(0x1af)]),..._0x58de15['arrayMatching']&&_0x58de15['arrayMatching']!=='any'?{'arrayMatching':_0x58de15[_0x4caace(0x1c4)]}:{},..._0x58de15[_0x4caace(0x194)]?{'exclude':_0x58de15[_0x4caace(0x194)]}:{},..._0x356f9a?{'aggregation':_0x356f9a}:{},'source':_0x5837dd,..._0x58de15[_0x4caace(0x15a)]['filter']?{'filter':apiRuleToYaml(_0x58de15[_0x4caace(0x15a)][_0x4caace(0x164)])}:{},..._0x58de15[_0x4caace(0x11b)]!==undefined&&_0x58de15[_0x4caace(0x11b)]!==null?{'limit':_0x58de15[_0x4caace(0x11b)]}:{}};}return{'type':'Value','attribute':_0x58de15['leftValue'][_0x4caace(0x173)]||'','operator':apiOperatorToYaml(_0x58de15[_0x4caace(0x1af)]),..._0x58de15[_0x4caace(0x1c4)]&&_0x58de15['arrayMatching']!==_0x4caace(0x147)?{'arrayMatching':_0x58de15[_0x4caace(0x1c4)]}:{},..._0x58de15[_0x4caace(0x194)]?{'exclude':_0x58de15[_0x4caace(0x194)]}:{},..._0x356f9a?{'aggregation':_0x356f9a}:{},..._0x58de15['leftValue'][_0x4caace(0x164)]?{'filter':apiRuleToYaml(_0x58de15[_0x4caace(0x15a)][_0x4caace(0x164)])}:{},..._0x58de15[_0x4caace(0x11b)]!==undefined&&_0x58de15[_0x4caace(0x11b)]!==null?{'limit':_0x58de15['limit']}:{}};}if(_0x58de15[_0x4caace(0x145)]===_0x4caace(0x156)&&_0x58de15[_0x4caace(0x1c5)]&&_0x58de15['operator'])return{'type':_0x4caace(0x156),'column':_0x58de15[_0x4caace(0x1c5)],'operator':apiOperatorToYaml(_0x58de15['operator'])};if(_0x58de15[_0x4caace(0x145)]==='Reference'&&_0x58de15['id'])return{'type':_0x58de15[_0x4caace(0x194)]?_0x4caace(0x194):_0x4caace(0x181),'segment':_0x58de15['id']};return{'type':_0x4caace(0x135),'conditions':[]};}function isTemporalOperator(_0x512ab8){const _0x4acd6b=a142_0x48c789;return _0x512ab8===_0x4acd6b(0x190)||_0x512ab8===_0x4acd6b(0x117);}function isBetweenOperator(_0x166ea6){return _0x166ea6==='Between';}function getEffectiveValue(_0x37edfc){const _0x2c4ed0=a142_0x48c789,_0x19a73e=_0x37edfc['values'];return _0x37edfc[_0x2c4ed0(0x19f)]??_0x19a73e;}function parseNumericValue(_0x4ec461){if(typeof _0x4ec461==='object'&&_0x4ec461!==null)return _0x4ec461;if(_0x4ec461==='')return _0x4ec461;const _0x1935b9=Number(_0x4ec461);return Number['isFinite'](_0x1935b9)?_0x1935b9:_0x4ec461;}function apiOperatorToYaml(_0x3ce6d5){const _0x23dd6f=a142_0x48c789;if(isBetweenOperator(_0x3ce6d5[_0x23dd6f(0x145)]))return{'type':mapApiOperatorType(_0x3ce6d5[_0x23dd6f(0x145)]),..._0x3ce6d5['not']!==undefined&&{'not':_0x3ce6d5[_0x23dd6f(0x19e)]},..._0x3ce6d5['minValue']!==undefined&&{'min':parseNumericValue(_0x3ce6d5[_0x23dd6f(0x176)])},..._0x3ce6d5[_0x23dd6f(0x159)]!==undefined&&{'max':parseNumericValue(_0x3ce6d5[_0x23dd6f(0x159)])}};if(_0x3ce6d5[_0x23dd6f(0x145)]==='TimeRange')return{'type':'TimeRange',..._0x3ce6d5['not']!==undefined&&{'not':_0x3ce6d5[_0x23dd6f(0x19e)]},..._0x3ce6d5['duration']!==undefined&&{'duration':_0x3ce6d5[_0x23dd6f(0x1ca)]},..._0x3ce6d5['from']!==undefined&&{'from':_0x3ce6d5['from']},..._0x3ce6d5[_0x23dd6f(0x11e)]!==undefined&&{'reverse':_0x3ce6d5['reverse']}};let _0x5bb6e7;if(_0x3ce6d5[_0x23dd6f(0x1b0)]&&_0x3ce6d5[_0x23dd6f(0x1b0)][_0x23dd6f(0x1b4)]>0x0)_0x5bb6e7=_0x3ce6d5[_0x23dd6f(0x1b0)];else{if(_0x3ce6d5['rightValue']!==undefined)_0x5bb6e7=_0x3ce6d5[_0x23dd6f(0x153)];else isTemporalOperator(_0x3ce6d5['type'])&&_0x3ce6d5[_0x23dd6f(0x19f)]!==undefined&&(_0x5bb6e7=_0x3ce6d5[_0x23dd6f(0x19f)]);}return{'type':mapApiOperatorType(_0x3ce6d5[_0x23dd6f(0x145)]),..._0x3ce6d5[_0x23dd6f(0x19e)]!==undefined&&{'not':_0x3ce6d5[_0x23dd6f(0x19e)]},..._0x5bb6e7!==undefined&&{'value':_0x5bb6e7},..._0x3ce6d5[_0x23dd6f(0x1b9)]!==undefined&&{'unit':_0x3ce6d5['unit']}};}function mapApiOperatorType(_0x442d0c){return _0x442d0c;}export function segmentDefToCreateRequest(_0x5462de,_0x121fcf){const _0x216a14=a142_0x48c789,_0x5d1119={'name':_0x5462de[_0x216a14(0x173)]};return _0x5462de[_0x216a14(0x1ab)]&&(_0x5d1119[_0x216a14(0x1ab)]=_0x5462de[_0x216a14(0x1ab)]),_0x5462de[_0x216a14(0x1b5)]&&(_0x5d1119[_0x216a14(0x1b5)]=yamlRuleToApi(_0x5462de[_0x216a14(0x1b5)])),_0x5462de['kind']&&(_0x5d1119[_0x216a14(0x1c7)]=_0x5462de[_0x216a14(0x1c7)]===_0x216a14(0x187)?0x0:_0x5462de['kind']===_0x216a14(0x182)?0x1:0x2),_0x5462de['visible']!==undefined&&(_0x5d1119[_0x216a14(0x1a4)]=_0x5462de[_0x216a14(0x16d)]),_0x121fcf&&(_0x5d1119[_0x216a14(0x14b)]=_0x121fcf),_0x5d1119;}export function segmentDefToUpdateRequest(_0x311fcc){const _0x2085a3=a142_0x48c789,_0x4ba76e={'name':_0x311fcc[_0x2085a3(0x173)]};return _0x311fcc['description']!==undefined&&(_0x4ba76e[_0x2085a3(0x1ab)]=_0x311fcc[_0x2085a3(0x1ab)]),_0x311fcc[_0x2085a3(0x1b5)]&&(_0x4ba76e[_0x2085a3(0x1b5)]=yamlRuleToApi(_0x311fcc[_0x2085a3(0x1b5)])),_0x311fcc[_0x2085a3(0x1c7)]&&(_0x4ba76e['kind']=_0x311fcc[_0x2085a3(0x1c7)]===_0x2085a3(0x187)?0x0:_0x311fcc['kind']===_0x2085a3(0x182)?0x1:0x2),_0x4ba76e;}export function yamlRuleToApi(_0x26d773){const _0x3031ab=a142_0x48c789,_0x24dd8e=_0x26d773[_0x3031ab(0x1b8)][_0x3031ab(0x14f)](yamlConditionToApi),_0x159bb3=_0x24dd8e['every'](_0x23575d=>isCompositeType(_0x23575d)&&_0x23575d['description']!==undefined);if(!_0x159bb3&&_0x24dd8e[_0x3031ab(0x1b4)]>0x0){const _0x2e0185=[];for(const _0x465e60 of _0x24dd8e){isCompositeType(_0x465e60)&&_0x465e60[_0x3031ab(0x1ab)]===undefined&&_0x465e60['conditions']&&_0x465e60['conditions'][_0x3031ab(0x18f)](_0x2d2850=>!isCompositeType(_0x2d2850))?_0x2e0185['push']({'type':_0x465e60[_0x3031ab(0x145)],'description':'','conditions':_0x465e60[_0x3031ab(0x1b8)]}):_0x2e0185['push']({'type':'And','description':_0x26d773[_0x3031ab(0x1ab)]||'','conditions':[_0x465e60]});}return{'type':_0x26d773[_0x3031ab(0x145)],'conditions':_0x2e0185};}return{'type':_0x26d773[_0x3031ab(0x145)],'conditions':_0x24dd8e,..._0x26d773['description']&&{'description':_0x26d773['description']}};}function yamlFilterRuleToApi(_0x526cf7){const _0x7548e9=a142_0x48c789,_0x159bea=_0x526cf7[_0x7548e9(0x1b8)][_0x7548e9(0x14f)](yamlConditionToApi);return{'type':_0x526cf7[_0x7548e9(0x145)],'conditions':_0x159bea};}function yamlConditionToApi(_0x563fcf){const _0x3ededc=a142_0x48c789;if(_0x3ededc(0x13a)in _0x563fcf&&(_0x563fcf['type']===_0x3ededc(0x181)||_0x563fcf[_0x3ededc(0x145)]===_0x3ededc(0x194))){const _0x2226b8=_0x563fcf;return{'type':_0x3ededc(0x19d),'id':_0x2226b8[_0x3ededc(0x13a)],'exclude':_0x2226b8[_0x3ededc(0x145)]===_0x3ededc(0x194)};}if(_0x563fcf[_0x3ededc(0x145)]===_0x3ededc(0x135)||_0x563fcf[_0x3ededc(0x145)]==='Or'){const _0x303374=_0x563fcf;return{'type':_0x303374[_0x3ededc(0x145)],'conditions':_0x303374[_0x3ededc(0x1b8)]['map'](yamlConditionToApi),..._0x303374[_0x3ededc(0x1ab)]&&{'description':_0x303374[_0x3ededc(0x1ab)]}};}if('column'in _0x563fcf&&_0x563fcf['type']==='Column'){const _0x3554f4=_0x563fcf;return{'type':_0x3ededc(0x156),'column':_0x3554f4[_0x3ededc(0x1c5)],'operator':yamlOperatorToApi(_0x3554f4[_0x3ededc(0x1af)])};}const _0x59f2a6=_0x563fcf,_0x5e0a2c={'type':_0x3ededc(0x1b2),'leftValue':buildLeftValue(_0x59f2a6),'operator':yamlOperatorToApi(_0x59f2a6['operator']),'exclude':_0x59f2a6[_0x3ededc(0x194)]??![],'arrayMatching':_0x59f2a6[_0x3ededc(0x1c4)]??_0x3ededc(0x147)};return _0x59f2a6['limit']!==undefined&&(_0x5e0a2c[_0x3ededc(0x11b)]=_0x59f2a6[_0x3ededc(0x11b)]),_0x5e0a2c;}function a142_0x1ba4(_0x192f2a,_0x856e7d){_0x192f2a=_0x192f2a-0x116;const _0x1291e9=a142_0x1291();let _0x1ba40d=_0x1291e9[_0x192f2a];return _0x1ba40d;}function buildAggregationDefFromApi(_0x4430d0){const _0x57c4e5=a142_0x48c789,_0x51b376=_0x4430d0[_0x57c4e5(0x145)];if(_0x51b376===_0x57c4e5(0x125))return{'type':_0x51b376,'columns':_0x4430d0[_0x57c4e5(0x178)]??[]};if(_0x51b376===_0x57c4e5(0x13d)||_0x51b376===_0x57c4e5(0x19b))return{'type':_0x51b376,'column':_0x4430d0[_0x57c4e5(0x1c5)]??'','orderColumn':_0x4430d0['orderColumn']??'',..._0x4430d0['groupingColumns']&&{'groupingColumns':_0x4430d0[_0x57c4e5(0x1cc)]}};if(_0x51b376==='Count')return{'type':_0x51b376,..._0x4430d0['groupingColumns']&&{'groupingColumns':_0x4430d0[_0x57c4e5(0x1cc)]}};return{'type':_0x51b376,'column':_0x4430d0[_0x57c4e5(0x1c5)]??'',..._0x4430d0[_0x57c4e5(0x1cc)]&&{'groupingColumns':_0x4430d0[_0x57c4e5(0x1cc)]}};}function buildLeftValue(_0x5707fe){const _0x387497=a142_0x48c789,_0x1b84e0={};_0x5707fe[_0x387497(0x1c1)]&&_0x5707fe[_0x387497(0x145)]!==_0x387497(0x132)&&(_0x1b84e0[_0x387497(0x173)]=_0x5707fe[_0x387497(0x1c1)]);if(_0x5707fe[_0x387497(0x1be)]){const _0x4efe7c=_0x5707fe[_0x387497(0x1be)];if(_0x4efe7c['type']===_0x387497(0x125))_0x1b84e0[_0x387497(0x1be)]={'type':_0x387497(0x125),'columns':_0x4efe7c['columns']};else{if(_0x4efe7c[_0x387497(0x145)]==='First'||_0x4efe7c[_0x387497(0x145)]===_0x387497(0x19b))_0x1b84e0[_0x387497(0x1be)]={'type':_0x4efe7c[_0x387497(0x145)],'column':_0x4efe7c[_0x387497(0x1c5)],'orderColumn':_0x4efe7c[_0x387497(0x1c9)],..._0x4efe7c[_0x387497(0x1cc)]&&{'groupingColumns':_0x4efe7c[_0x387497(0x1cc)]}};else _0x4efe7c[_0x387497(0x145)]===_0x387497(0x1b7)?_0x1b84e0[_0x387497(0x1be)]={'type':'Count',..._0x4efe7c[_0x387497(0x1cc)]&&{'groupingColumns':_0x4efe7c[_0x387497(0x1cc)]}}:_0x1b84e0[_0x387497(0x1be)]={'type':_0x4efe7c[_0x387497(0x145)],'column':_0x4efe7c[_0x387497(0x1c5)],..._0x4efe7c[_0x387497(0x1cc)]&&{'groupingColumns':_0x4efe7c[_0x387497(0x1cc)]}};}}return _0x5707fe['source']&&(_0x1b84e0[_0x387497(0x131)]={'name':_0x5707fe[_0x387497(0x131)]}),_0x5707fe['filter']&&(_0x1b84e0[_0x387497(0x164)]=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x5707fe[_0x387497(0x164)]))),_0x1b84e0;}function yamlOperatorToApi(_0x53715d){const _0xeea833=a142_0x48c789,_0x3c7471={'type':mapYamlOperatorType(_0x53715d[_0xeea833(0x145)]),'not':_0x53715d[_0xeea833(0x19e)]??![]};if(isBetweenOperator(_0x53715d['type']))return _0x53715d[_0xeea833(0x174)]!==undefined&&(_0x3c7471[_0xeea833(0x176)]=typeof _0x53715d['min']==='object'?_0x53715d[_0xeea833(0x174)]:String(_0x53715d[_0xeea833(0x174)])),_0x53715d[_0xeea833(0x1ba)]!==undefined&&(_0x3c7471[_0xeea833(0x159)]=typeof _0x53715d[_0xeea833(0x1ba)]===_0xeea833(0x1ac)?_0x53715d['max']:String(_0x53715d[_0xeea833(0x1ba)])),_0x3c7471;if(_0x53715d[_0xeea833(0x145)]==='TimeRange')return _0x53715d['duration']&&(_0x3c7471[_0xeea833(0x1ca)]=_0x53715d[_0xeea833(0x1ca)]),_0x53715d[_0xeea833(0x119)]&&(_0x3c7471[_0xeea833(0x119)]=_0x53715d['from']),_0x53715d[_0xeea833(0x11e)]!==undefined&&(_0x3c7471['reverse']=_0x53715d[_0xeea833(0x11e)]),_0x3c7471;const _0x48a2a4=getEffectiveValue(_0x53715d);if(_0x48a2a4!==undefined){if(Array[_0xeea833(0x13b)](_0x48a2a4))_0x3c7471['rightValues']=_0x48a2a4;else isTemporalOperator(_0x53715d[_0xeea833(0x145)])?_0x3c7471[_0xeea833(0x19f)]=_0x48a2a4:_0x3c7471[_0xeea833(0x153)]=_0x48a2a4;}return _0x53715d[_0xeea833(0x1b9)]&&(_0x3c7471[_0xeea833(0x1b9)]=_0x53715d['unit']),_0x3c7471;}function mapYamlOperatorType(_0x4030e5){return _0x4030e5;}export function toYamlString(_0x3aa797){const _0x586ca8=a142_0x48c789,_0x24e393=JSON[_0x586ca8(0x154)](JSON[_0x586ca8(0x17b)](_0x3aa797)),_0xa430ef=a142_0x361253['stringify'](_0x24e393,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x586ca8(0x15e)}),_0xf2e307=['rule:'];let _0x1804ca=_0xa430ef;for(const _0x14f376 of _0xf2e307){_0x1804ca=_0x1804ca['replace'](new RegExp('^('+_0x14f376+')','m'),(_0xcfb7a1,_0x422bd0,_0x47fe67)=>{if(_0x47fe67===0x0||_0x1804ca[_0x47fe67-0x1]==='\x0a'&&_0x1804ca[_0x47fe67-0x2]==='\x0a')return _0x422bd0;return'\x0a'+_0x422bd0;});}return _0x1804ca;}export function parseYamlString(_0x114f24){return parseSegmentYamlFile(_0x114f24);}export function isSegmentYaml(_0x2e878a){const _0x5c41ac=a142_0x48c789;if(typeof _0x2e878a!==_0x5c41ac(0x1ac)||_0x2e878a===null)return![];const _0x3fafb1=_0x2e878a;return _0x3fafb1[_0x5c41ac(0x145)]===_0x5c41ac(0x13a)||_0x3fafb1['type']===undefined;}export function generateTemplate(_0x1cbf70=a142_0x48c789(0x179)){const _0x1d7805=a142_0x48c789,_0x96dafc={'type':'segment','name':_0x1cbf70,'description':_0x1d7805(0x143),'rule':{'type':'And','conditions':[{'type':_0x1d7805(0x1b2),'attribute':_0x1d7805(0x1c6),'operator':{'type':_0x1d7805(0x191),'value':'value'}}]}};return toYamlString(_0x96dafc);}export function segmentToYamlString(_0x3e7a8f){const _0x1872a3=a142_0x48c789,_0x80f725=JSON[_0x1872a3(0x154)](JSON[_0x1872a3(0x17b)](_0x3e7a8f)),_0x588df8=a142_0x361253['stringify'](_0x80f725,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x1872a3(0x15e)}),_0x42b779=[_0x1872a3(0x1a5),_0x1872a3(0x151)];let _0x463c51=_0x588df8;for(const _0xce57c7 of _0x42b779){_0x463c51=_0x463c51[_0x1872a3(0x11a)](new RegExp('^('+_0xce57c7+')','m'),(_0x502555,_0x27aae2,_0x5872de)=>{if(_0x5872de===0x0||_0x463c51[_0x5872de-0x1]==='\x0a'&&_0x463c51[_0x5872de-0x2]==='\x0a')return _0x27aae2;return'\x0a'+_0x27aae2;});}return _0x463c51;}function a142_0x1291(){const _0x8436b=['folder','get','11230YupLlT','activation_template_id','695728SbcbAA','source','Behavior','keys','timezone','And','connectionId','usedNames','forEach','attributes','segment','isArray','code','First','match','All','syndicationBehavior','activations','errors','Segment\x20description','timeWindow','type','activationParams','any','daily','Unknown\x20connection:\x20','has','segmentFolderId','warn','day','add','map','joinStrategy','activations:','behavior','rightValue','parse','visibility','Column','hourly','order_by','maxValue','leftValue','entries','allColumns','join_row','null','Connector:\x20','getSchema','run_after_journey_refresh','notification','nestedWorkflowName','filter','hour','3XTOejD','repeatFrequency','set','start_at','__UNRESOLVED__','CONNECTOR_SCHEMA_NOT_FOUND','repeatUnit','visible','orderBy','\x22:\x0a','ruleHashToName','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','__SEGMENT_REF__','name','min','week','minValue','1548NaRZRo','columns','New\x20Segment','28165zCmlQC','stringify','Please\x20specify\x20a\x20valid\x20attribute\x20name.','connectorConfig','minute','connector_config\x20for\x20activation\x20\x22','warnings','include','realtime','shape','lock_enabled','INVALID_ARGUMENT','6ZsQcJc','batch','joinRow','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','email_recipients','connector_config','conditions[','emailToIdMap','nested_workflow_name','every','TimeWithinPast','Equal','connection','string','exclude','248212IqmrTR','repeat_unit','all_columns','968723oocHQG','repeatSubFrequency','366968KiwnNT','Last','flatMap','Reference','not','value','nestedWorkflowProjectName','Invalid\x20connector_config\x20for\x20activation\x20\x22','repeat_sub_frequency','localeCompare','isVisible','rule:','nested_workflow_project_name','lockEnabled','CONNECTOR_INVALID_CONFIG','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a','notify_on','description','object','schedule','join_strategy','operator','rightValues','weekly','Value','behaviorTableName','length','rule','localRuleToName','Count','conditions','unit','max','month','activationTemplateId','behavior_table','aggregation','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','funnel_stage','attribute','all','resolveSegmentName','arrayMatching','column','attribute_name','kind','repeat_frequency','orderColumn','duration','scheduleType','groupingColumns','\x20\x20-\x20\x22','formatting','endOn','toLowerCase','connectionNameToIdMap','TimeWithinNext','valid','from','replace','limit','end_on','\x27:\x20','reverse','emailRecipients','test','minutes_interval','JOURNEY_SYNTAX_ERROR','push','startAt','CountDistinct','CONNECTION_NOT_FOUND','notifyOn','Unknown\x20email\x20recipient:\x20','Warning:\x20activation\x20\x22','112491EWDFrt','sort'];a142_0x1291=function(){return _0x8436b;};return a142_0x1291();}export function parseSegmentYamlFile(_0x3cf42f){return safeParseYaml(_0x3cf42f,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x458708){const _0x5180ef=a142_0x48c789;return{'type':_0x5180ef(0x13a),'name':_0x458708[_0x5180ef(0x173)],..._0x458708[_0x5180ef(0x1ab)]!==undefined&&{'description':_0x458708[_0x5180ef(0x1ab)]},..._0x458708['folder']!==undefined&&{'folder':_0x458708[_0x5180ef(0x12c)]},..._0x458708['rule']&&{'rule':normalizeRule(_0x458708[_0x5180ef(0x1b5)])},..._0x458708[_0x5180ef(0x1c7)]!==undefined&&{'kind':_0x458708['kind']},..._0x458708[_0x5180ef(0x16d)]!==undefined&&{'visible':_0x458708[_0x5180ef(0x16d)]},..._0x458708[_0x5180ef(0x141)]&&{'activations':_0x458708[_0x5180ef(0x141)][_0x5180ef(0x14f)](normalizeActivation)}};}export function normalizeRule(_0x530654){const _0x43f490=a142_0x48c789;return{'type':_0x530654[_0x43f490(0x145)],'conditions':_0x530654[_0x43f490(0x1b8)][_0x43f490(0x14f)](normalizeCondition),..._0x530654[_0x43f490(0x1ab)]!==undefined&&{'description':_0x530654['description']}};}function normalizeCondition(_0x4c28a0){const _0x48ddcf=a142_0x48c789;if(_0x48ddcf(0x13a)in _0x4c28a0&&(_0x4c28a0[_0x48ddcf(0x145)]===_0x48ddcf(0x181)||_0x4c28a0[_0x48ddcf(0x145)]==='exclude')){const _0x4b1bbe=_0x4c28a0;return{'type':_0x4b1bbe[_0x48ddcf(0x145)],'segment':_0x4b1bbe['segment']};}if(_0x4c28a0['type']==='And'||_0x4c28a0[_0x48ddcf(0x145)]==='Or'){const _0x5a5fba=_0x4c28a0;return{'type':_0x5a5fba[_0x48ddcf(0x145)],'conditions':_0x5a5fba[_0x48ddcf(0x1b8)]['map'](normalizeCondition),..._0x5a5fba[_0x48ddcf(0x1ab)]!==undefined&&{'description':_0x5a5fba[_0x48ddcf(0x1ab)]}};}if(_0x48ddcf(0x1c5)in _0x4c28a0&&_0x4c28a0[_0x48ddcf(0x145)]==='Column'){const _0x469b97=_0x4c28a0;return{'type':'Column','column':_0x469b97[_0x48ddcf(0x1c5)],'operator':normalizeOperator(_0x469b97[_0x48ddcf(0x1af)])};}if(_0x4c28a0[_0x48ddcf(0x145)]==='Behavior'){const _0x3d584f=_0x4c28a0;return{'type':'Behavior','attribute':_0x3d584f[_0x48ddcf(0x1c1)],'operator':normalizeOperator(_0x3d584f[_0x48ddcf(0x1af)]),..._0x3d584f[_0x48ddcf(0x1c4)]!==undefined&&{'arrayMatching':_0x3d584f[_0x48ddcf(0x1c4)]},..._0x3d584f[_0x48ddcf(0x194)]!==undefined&&{'exclude':_0x3d584f['exclude']},..._0x3d584f[_0x48ddcf(0x1be)]!==undefined&&{'aggregation':_0x3d584f[_0x48ddcf(0x1be)]},..._0x3d584f['source']!==undefined&&{'source':_0x3d584f[_0x48ddcf(0x131)]},..._0x3d584f[_0x48ddcf(0x164)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x3d584f[_0x48ddcf(0x164)])))},..._0x3d584f[_0x48ddcf(0x144)]!==undefined&&{'timeWindow':_0x3d584f['timeWindow']},..._0x3d584f[_0x48ddcf(0x11b)]!==undefined&&{'limit':_0x3d584f['limit']}};}const _0x5e150d=_0x4c28a0;return{'type':_0x48ddcf(0x1b2),'attribute':_0x5e150d[_0x48ddcf(0x1c1)],'operator':normalizeOperator(_0x5e150d[_0x48ddcf(0x1af)]),..._0x5e150d['arrayMatching']!==undefined&&{'arrayMatching':_0x5e150d['arrayMatching']},..._0x5e150d['exclude']!==undefined&&{'exclude':_0x5e150d['exclude']},..._0x5e150d['aggregation']!==undefined&&{'aggregation':_0x5e150d[_0x48ddcf(0x1be)]},..._0x5e150d[_0x48ddcf(0x131)]!==undefined&&{'source':_0x5e150d[_0x48ddcf(0x131)]},..._0x5e150d[_0x48ddcf(0x164)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x5e150d[_0x48ddcf(0x164)])))},..._0x5e150d[_0x48ddcf(0x11b)]!==undefined&&{'limit':_0x5e150d['limit']}};}function normalizeOperator(_0x1c28c8){const _0x29e7d0=a142_0x48c789;if(isBetweenOperator(_0x1c28c8[_0x29e7d0(0x145)]))return{'type':_0x1c28c8[_0x29e7d0(0x145)],..._0x1c28c8[_0x29e7d0(0x19e)]!==undefined&&{'not':_0x1c28c8[_0x29e7d0(0x19e)]},..._0x1c28c8[_0x29e7d0(0x174)]!==undefined&&{'min':_0x1c28c8['min']},..._0x1c28c8[_0x29e7d0(0x1ba)]!==undefined&&{'max':_0x1c28c8['max']}};const _0x544641=getEffectiveValue(_0x1c28c8);return{'type':_0x1c28c8['type'],..._0x1c28c8[_0x29e7d0(0x19e)]!==undefined&&{'not':_0x1c28c8[_0x29e7d0(0x19e)]},..._0x544641!==undefined&&{'value':_0x544641},..._0x1c28c8[_0x29e7d0(0x1b9)]!==undefined&&{'unit':_0x1c28c8['unit']},..._0x1c28c8[_0x29e7d0(0x1ca)]!==undefined&&{'duration':_0x1c28c8['duration']},..._0x1c28c8[_0x29e7d0(0x119)]!==undefined&&{'from':_0x1c28c8[_0x29e7d0(0x119)]},..._0x1c28c8[_0x29e7d0(0x11e)]!==undefined&&{'reverse':_0x1c28c8[_0x29e7d0(0x11e)]}};}function normalizeActivation(_0x2ba685){const _0x439ace=a142_0x48c789;return{'name':_0x2ba685[_0x439ace(0x173)],'connection':_0x2ba685[_0x439ace(0x192)],..._0x2ba685[_0x439ace(0x1ab)]!==undefined&&{'description':_0x2ba685['description']},..._0x2ba685[_0x439ace(0x197)]!==undefined&&{'all_columns':_0x2ba685[_0x439ace(0x197)]},..._0x2ba685['columns']!==undefined&&{'columns':_0x2ba685['columns']},..._0x2ba685[_0x439ace(0x152)]!==undefined&&{'behavior':_0x2ba685[_0x439ace(0x152)]},..._0x2ba685[_0x439ace(0x1ad)]!==undefined&&{'schedule':_0x2ba685['schedule']},..._0x2ba685[_0x439ace(0x162)]!==undefined&&{'notification':_0x2ba685[_0x439ace(0x162)]},..._0x2ba685[_0x439ace(0x18b)]!==undefined&&{'connector_config':_0x2ba685[_0x439ace(0x18b)]},..._0x2ba685['activation_template_id']!==undefined&&{'activation_template_id':_0x2ba685[_0x439ace(0x12f)]},..._0x2ba685[_0x439ace(0x1a6)]!==undefined&&{'nested_workflow_project_name':_0x2ba685[_0x439ace(0x1a6)]},..._0x2ba685[_0x439ace(0x18e)]!==undefined&&{'nested_workflow_name':_0x2ba685['nested_workflow_name']},..._0x2ba685['lock_enabled']!==undefined&&{'lock_enabled':_0x2ba685[_0x439ace(0x184)]}};}function getColumnName(_0x257e0e){const _0x4694c8=a142_0x48c789;return _0x257e0e[_0x4694c8(0x1c5)]||_0x257e0e[_0x4694c8(0x173)];}export function activationResponseToDef(_0x4d44ae,_0x1a6c48,_0x14b182){const _0x13462b=a142_0x48c789,_0x38b87d=_0x4d44ae['connectionId']||'',_0x1522dd=_0x14b182?.[_0x13462b(0x12d)](_0x38b87d)??_0x38b87d,_0x5ebf76={'name':_0x4d44ae[_0x13462b(0x173)],'connection':_0x1522dd};_0x4d44ae[_0x13462b(0x1ab)]&&(_0x5ebf76[_0x13462b(0x1ab)]=_0x4d44ae[_0x13462b(0x1ab)]);let _0x1729ff=[];_0x4d44ae[_0x13462b(0x178)]&&_0x4d44ae[_0x13462b(0x178)][_0x13462b(0x1b4)]>0x0&&(_0x1729ff=_0x4d44ae['columns'][_0x13462b(0x164)](_0x34e680=>_0x34e680&&getColumnName(_0x34e680))[_0x13462b(0x14f)](_0x45071f=>{const _0x173be5=_0x13462b,_0x3ca2f7=getColumnName(_0x45071f);if(_0x45071f[_0x173be5(0x145)]||_0x45071f['visibility'])return{'name':_0x3ca2f7,..._0x45071f[_0x173be5(0x145)]&&{'type':_0x45071f['type']},..._0x45071f[_0x173be5(0x155)]&&{'visibility':_0x45071f['visibility']}};return _0x3ca2f7;}));_0x1729ff[_0x13462b(0x1b4)]>0x0&&(_0x5ebf76[_0x13462b(0x178)]=_0x1729ff);_0x4d44ae[_0x13462b(0x15c)]!==undefined&&(_0x4d44ae[_0x13462b(0x15c)]===![]&&_0x1729ff[_0x13462b(0x1b4)]===0x0?_0x5ebf76[_0x13462b(0x197)]=!![]:_0x5ebf76[_0x13462b(0x197)]=_0x4d44ae['allColumns']);const _0x2bb317={};let _0x5dc9a5=![];_0x4d44ae[_0x13462b(0x1cb)]&&(_0x2bb317[_0x13462b(0x145)]=_0x4d44ae[_0x13462b(0x1cb)],_0x5dc9a5=!![]);_0x4d44ae[_0x13462b(0x16c)]&&(_0x2bb317[_0x13462b(0x196)]=_0x4d44ae[_0x13462b(0x16c)],_0x5dc9a5=!![]);_0x4d44ae[_0x13462b(0x167)]!==undefined&&_0x4d44ae['repeatFrequency']!==null&&(_0x2bb317[_0x13462b(0x1c8)]=_0x4d44ae['repeatFrequency'],_0x5dc9a5=!![]);_0x4d44ae[_0x13462b(0x199)]&&_0x4d44ae[_0x13462b(0x199)]['length']>0x0&&(_0x2bb317[_0x13462b(0x1a2)]=_0x4d44ae['repeatSubFrequency'],_0x5dc9a5=!![]);_0x4d44ae[_0x13462b(0x124)]!==undefined&&(_0x2bb317['start_at']=_0x4d44ae['startAt'],_0x5dc9a5=!![]);_0x4d44ae[_0x13462b(0x1cf)]!==undefined&&(_0x2bb317[_0x13462b(0x11c)]=_0x4d44ae[_0x13462b(0x1cf)],_0x5dc9a5=!![]);_0x4d44ae[_0x13462b(0x134)]&&(_0x2bb317['timezone']=_0x4d44ae[_0x13462b(0x134)],_0x5dc9a5=!![]);_0x5dc9a5&&(_0x5ebf76[_0x13462b(0x1ad)]=_0x2bb317);(_0x4d44ae[_0x13462b(0x127)]&&_0x4d44ae[_0x13462b(0x127)][_0x13462b(0x1b4)]>0x0||_0x4d44ae[_0x13462b(0x11f)]&&_0x4d44ae['emailRecipients'][_0x13462b(0x1b4)]>0x0)&&(_0x5ebf76[_0x13462b(0x162)]={},_0x4d44ae[_0x13462b(0x127)]&&_0x4d44ae[_0x13462b(0x127)][_0x13462b(0x1b4)]>0x0&&(_0x5ebf76['notification'][_0x13462b(0x1aa)]=_0x4d44ae[_0x13462b(0x127)]),_0x4d44ae[_0x13462b(0x11f)]&&_0x4d44ae[_0x13462b(0x11f)][_0x13462b(0x1b4)]>0x0&&(_0x5ebf76[_0x13462b(0x162)][_0x13462b(0x18a)]=_0x4d44ae['emailRecipients'][_0x13462b(0x14f)](_0x2a2e70=>{const _0x2dd8f7=_0x13462b,_0x1dcd08=_0x1a6c48?.[_0x2dd8f7(0x12d)](_0x2a2e70);return _0x1dcd08??String(_0x2a2e70);})));_0x4d44ae[_0x13462b(0x17d)]&&Object[_0x13462b(0x133)](_0x4d44ae['connectorConfig'])[_0x13462b(0x1b4)]>0x0&&(_0x5ebf76[_0x13462b(0x18b)]=normalizeConnectorConfigForYaml(_0x4d44ae['connectorConfig']));_0x4d44ae[_0x13462b(0x1bc)]&&(_0x5ebf76['activation_template_id']=_0x4d44ae[_0x13462b(0x1bc)]);if(_0x4d44ae[_0x13462b(0x140)]){const _0x9969cf={},_0xd39a71=_0x4d44ae[_0x13462b(0x140)];_0xd39a71[_0x13462b(0x178)]&&_0xd39a71['columns']['length']>0x0&&(_0x9969cf[_0x13462b(0x178)]=_0xd39a71[_0x13462b(0x178)][_0x13462b(0x164)](_0x22ac9d=>_0x22ac9d&&getColumnName(_0x22ac9d))[_0x13462b(0x14f)](_0x5f35da=>({'name':getColumnName(_0x5f35da),..._0x5f35da['type']&&{'type':_0x5f35da['type']},..._0x5f35da[_0x13462b(0x155)]&&{'visibility':_0x5f35da[_0x13462b(0x155)]}}))),_0xd39a71[_0x13462b(0x1b3)]&&(_0x9969cf[_0x13462b(0x1bd)]=_0xd39a71[_0x13462b(0x1b3)]),_0xd39a71[_0x13462b(0x188)]!==undefined&&(_0x9969cf[_0x13462b(0x15d)]=_0xd39a71[_0x13462b(0x188)]),_0xd39a71[_0x13462b(0x150)]&&(_0x9969cf[_0x13462b(0x1ae)]=_0xd39a71[_0x13462b(0x150)]),_0xd39a71[_0x13462b(0x1ce)]&&(_0x9969cf['formatting']=_0xd39a71[_0x13462b(0x1ce)]),_0xd39a71[_0x13462b(0x16e)]&&_0xd39a71[_0x13462b(0x16e)][_0x13462b(0x1b4)]>0x0&&(_0x9969cf[_0x13462b(0x158)]=_0xd39a71[_0x13462b(0x16e)]),Object['keys'](_0x9969cf)['length']>0x0&&(_0x5ebf76[_0x13462b(0x152)]=_0x9969cf);}return _0x4d44ae[_0x13462b(0x1a0)]&&(_0x5ebf76[_0x13462b(0x1a6)]=_0x4d44ae['nestedWorkflowProjectName']),_0x4d44ae[_0x13462b(0x163)]&&(_0x5ebf76['nested_workflow_name']=_0x4d44ae[_0x13462b(0x163)]),_0x4d44ae['lockEnabled']!==undefined&&(_0x5ebf76['lock_enabled']=_0x4d44ae[_0x13462b(0x1a7)]),_0x5ebf76;}export function journeyActivationStepToYaml(_0xee4026,_0x42521d,_0x5819d0){const _0x2b8d50=a142_0x48c789,_0x5fa73f=_0xee4026[_0x2b8d50(0x139)][_0x2b8d50(0x146)],_0x999467=_0x5fa73f[_0x2b8d50(0x136)]||'',_0x132e0b=_0x5819d0?.[_0x2b8d50(0x12d)](_0x999467)??_0x999467,_0xea7866={'name':_0x5fa73f[_0x2b8d50(0x173)]||'','connection':_0x132e0b};_0xee4026[_0x2b8d50(0x139)]['runAfterJourneyRefresh']&&(_0xea7866[_0x2b8d50(0x161)]=!![]);_0x5fa73f[_0x2b8d50(0x1ab)]&&(_0xea7866['description']=_0x5fa73f[_0x2b8d50(0x1ab)]);let _0x1976b9=[];_0x5fa73f['columns']&&_0x5fa73f[_0x2b8d50(0x178)]['length']>0x0&&(_0x1976b9=_0x5fa73f[_0x2b8d50(0x178)][_0x2b8d50(0x164)](_0x129118=>_0x129118&&getColumnName(_0x129118))['map'](_0x45ff32=>{const _0x129033=_0x2b8d50,_0x28383f=getColumnName(_0x45ff32);if(_0x45ff32['type']||_0x45ff32[_0x129033(0x155)])return{'name':_0x28383f,..._0x45ff32['type']&&{'type':_0x45ff32[_0x129033(0x145)]},..._0x45ff32['visibility']&&{'visibility':_0x45ff32[_0x129033(0x155)]}};return _0x28383f;}));_0x1976b9['length']>0x0&&(_0xea7866[_0x2b8d50(0x178)]=_0x1976b9);_0x5fa73f[_0x2b8d50(0x15c)]!==undefined&&(_0x5fa73f[_0x2b8d50(0x15c)]===![]&&_0x1976b9['length']===0x0?_0xea7866[_0x2b8d50(0x197)]=!![]:_0xea7866[_0x2b8d50(0x197)]=_0x5fa73f[_0x2b8d50(0x15c)]);const _0xf98310={};let _0x3be1b2=![];_0x5fa73f['scheduleType']&&(_0xf98310[_0x2b8d50(0x145)]=_0x5fa73f[_0x2b8d50(0x1cb)],_0x3be1b2=!![]);_0x5fa73f[_0x2b8d50(0x16c)]&&(_0xf98310[_0x2b8d50(0x196)]=_0x5fa73f[_0x2b8d50(0x16c)],_0x3be1b2=!![]);_0x5fa73f['repeatFrequency']!==undefined&&_0x5fa73f[_0x2b8d50(0x167)]!==null&&(_0xf98310[_0x2b8d50(0x1c8)]=_0x5fa73f[_0x2b8d50(0x167)],_0x3be1b2=!![]);_0x5fa73f[_0x2b8d50(0x124)]!==undefined&&(_0xf98310['start_at']=_0x5fa73f[_0x2b8d50(0x124)],_0x3be1b2=!![]);_0x5fa73f[_0x2b8d50(0x1cf)]!==undefined&&(_0xf98310[_0x2b8d50(0x11c)]=_0x5fa73f['endOn'],_0x3be1b2=!![]);_0x5fa73f[_0x2b8d50(0x134)]&&(_0xf98310[_0x2b8d50(0x134)]=_0x5fa73f[_0x2b8d50(0x134)],_0x3be1b2=!![]);_0x3be1b2&&(_0xea7866['schedule']=_0xf98310);(_0x5fa73f[_0x2b8d50(0x127)]&&_0x5fa73f[_0x2b8d50(0x127)][_0x2b8d50(0x1b4)]>0x0||_0x5fa73f['emailRecipients']&&_0x5fa73f[_0x2b8d50(0x11f)][_0x2b8d50(0x1b4)]>0x0)&&(_0xea7866[_0x2b8d50(0x162)]={},_0x5fa73f[_0x2b8d50(0x127)]&&_0x5fa73f['notifyOn']['length']>0x0&&(_0xea7866[_0x2b8d50(0x162)][_0x2b8d50(0x1aa)]=_0x5fa73f[_0x2b8d50(0x127)]),_0x5fa73f[_0x2b8d50(0x11f)]&&_0x5fa73f[_0x2b8d50(0x11f)][_0x2b8d50(0x1b4)]>0x0&&(_0xea7866[_0x2b8d50(0x162)][_0x2b8d50(0x18a)]=_0x5fa73f[_0x2b8d50(0x11f)][_0x2b8d50(0x14f)](_0x20426e=>{const _0x3f7cef=_0x2b8d50,_0x2ed21d=_0x42521d?.[_0x3f7cef(0x12d)](_0x20426e);return _0x2ed21d??String(_0x20426e);})));_0x5fa73f[_0x2b8d50(0x17d)]&&Object['keys'](_0x5fa73f[_0x2b8d50(0x17d)])[_0x2b8d50(0x1b4)]>0x0&&(_0xea7866[_0x2b8d50(0x18b)]=normalizeConnectorConfigForYaml(_0x5fa73f[_0x2b8d50(0x17d)]));_0x5fa73f[_0x2b8d50(0x1bc)]&&(_0xea7866[_0x2b8d50(0x12f)]=_0x5fa73f[_0x2b8d50(0x1bc)]);if(_0x5fa73f[_0x2b8d50(0x140)]){const _0x40688e={},_0x45f6b1=_0x5fa73f[_0x2b8d50(0x140)];_0x45f6b1[_0x2b8d50(0x178)]&&_0x45f6b1[_0x2b8d50(0x178)][_0x2b8d50(0x1b4)]>0x0&&(_0x40688e['columns']=_0x45f6b1['columns'][_0x2b8d50(0x164)](_0x546714=>_0x546714&&getColumnName(_0x546714))[_0x2b8d50(0x14f)](_0x3b2157=>({'name':getColumnName(_0x3b2157),..._0x3b2157[_0x2b8d50(0x145)]&&{'type':_0x3b2157[_0x2b8d50(0x145)]},..._0x3b2157[_0x2b8d50(0x155)]&&{'visibility':_0x3b2157['visibility']}}))),_0x45f6b1[_0x2b8d50(0x1b3)]&&(_0x40688e[_0x2b8d50(0x1bd)]=_0x45f6b1[_0x2b8d50(0x1b3)]),_0x45f6b1[_0x2b8d50(0x188)]!==undefined&&(_0x40688e['join_row']=_0x45f6b1[_0x2b8d50(0x188)]),_0x45f6b1['joinStrategy']&&(_0x40688e[_0x2b8d50(0x1ae)]=_0x45f6b1[_0x2b8d50(0x150)]),_0x45f6b1['formatting']&&(_0x40688e[_0x2b8d50(0x1ce)]=_0x45f6b1[_0x2b8d50(0x1ce)]),_0x45f6b1['orderBy']&&_0x45f6b1[_0x2b8d50(0x16e)]['length']>0x0&&(_0x40688e['order_by']=_0x45f6b1[_0x2b8d50(0x16e)]),Object['keys'](_0x40688e)[_0x2b8d50(0x1b4)]>0x0&&(_0xea7866[_0x2b8d50(0x152)]=_0x40688e);}return _0xea7866;}export function segmentWithActivationsToYaml(_0x48976b,_0x22fd32,_0x3bce28,_0x19fbf3,_0x4a0482){const _0x506384=a142_0x48c789,_0x50eafc=segmentResponseToDefSync(_0x48976b,_0x3bce28);return _0x22fd32[_0x506384(0x1b4)]>0x0&&(_0x50eafc['activations']=_0x22fd32['map'](_0x1bc3ea=>activationResponseToDef(_0x1bc3ea,_0x19fbf3,_0x4a0482))),_0x50eafc;}function normalizeColumn(_0x4eef1f){const _0x5644a3=a142_0x48c789;if(typeof _0x4eef1f===_0x5644a3(0x193))return{'column':_0x4eef1f,'source':{'column':_0x4eef1f}};return{'column':_0x4eef1f[_0x5644a3(0x173)],'source':{'column':_0x4eef1f['name']},..._0x4eef1f[_0x5644a3(0x145)]&&{'type':_0x4eef1f['type']},..._0x4eef1f['visibility']&&{'visibility':_0x4eef1f[_0x5644a3(0x155)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a142_0x48c789(0x133)](ActivationDefSchema[a142_0x48c789(0x183)]));export function warnUnrecognizedActivationFields(_0x355bff,_0x3d5537){const _0x5dd295=a142_0x48c789,_0xce72b7=Object[_0x5dd295(0x133)](_0x355bff)[_0x5dd295(0x164)](_0x38a0ab=>!KNOWN_ACTIVATION_FIELDS['has'](_0x38a0ab));if(_0xce72b7[_0x5dd295(0x1b4)]>0x0){const _0x47132f=_0xce72b7[_0x5dd295(0x14f)](_0x171b8e=>_0x5dd295(0x1cd)+_0x171b8e+'\x22')['join']('\x0a');console[_0x5dd295(0x14c)](_0x5dd295(0x129)+_0x3d5537+_0x5dd295(0x1a9)+_0x47132f);}}export async function activationDefToCreateRequest(_0x25fe9d,_0x1459ba){const _0x32ba63=a142_0x48c789;warnUnrecognizedActivationFields(_0x25fe9d,_0x25fe9d[_0x32ba63(0x173)]);const _0xc12693=_0x1459ba?.[_0x32ba63(0x18d)],_0x5c299a=_0x1459ba?.[_0x32ba63(0x116)],_0x441949=_0x25fe9d[_0x32ba63(0x192)];let _0xa07b0c;const _0x13d8af=parseInt(_0x441949,0xa);if(!isNaN(_0x13d8af)&&String(_0x13d8af)===_0x441949)_0xa07b0c=_0x13d8af;else{const _0x169017=_0x5c299a?.[_0x32ba63(0x12d)](_0x441949);if(_0x169017===undefined)throw new SDKError(ErrorCode[_0x32ba63(0x126)],_0x32ba63(0x149)+_0x441949,undefined,{'helpText':_0x32ba63(0x171)});_0xa07b0c=_0x169017;}const _0x126de2={'name':_0x25fe9d[_0x32ba63(0x173)],'connectionId':_0xa07b0c};_0x25fe9d[_0x32ba63(0x1ab)]&&(_0x126de2[_0x32ba63(0x1ab)]=_0x25fe9d[_0x32ba63(0x1ab)]);let _0x1a6b38=[];_0x25fe9d[_0x32ba63(0x178)]&&_0x25fe9d[_0x32ba63(0x178)][_0x32ba63(0x1b4)]>0x0&&(_0x1a6b38=_0x25fe9d[_0x32ba63(0x178)][_0x32ba63(0x164)](_0x14eb04=>_0x14eb04!=null)[_0x32ba63(0x14f)](normalizeColumn));_0x1a6b38[_0x32ba63(0x1b4)]>0x0&&(_0x126de2['columns']=_0x1a6b38);_0x25fe9d[_0x32ba63(0x197)]!==undefined&&(_0x25fe9d[_0x32ba63(0x197)]===![]&&_0x1a6b38[_0x32ba63(0x1b4)]===0x0?_0x126de2[_0x32ba63(0x15c)]=!![]:_0x126de2[_0x32ba63(0x15c)]=_0x25fe9d[_0x32ba63(0x197)]);if(_0x25fe9d[_0x32ba63(0x1ad)]){const _0x5d8c54=_0x25fe9d[_0x32ba63(0x1ad)],_0x45395f=_0x5d8c54[_0x32ba63(0x145)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x5d8c54[_0x32ba63(0x196)]];_0x45395f&&(_0x126de2[_0x32ba63(0x1cb)]=_0x45395f);const _0x1632e2=_0x5d8c54['repeat_unit']??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x5d8c54[_0x32ba63(0x145)]];_0x1632e2&&(_0x126de2[_0x32ba63(0x16c)]=_0x1632e2);_0x5d8c54['repeat_frequency']!==undefined&&(_0x126de2['repeatFrequency']=_0x5d8c54[_0x32ba63(0x1c8)]);_0x5d8c54['repeat_sub_frequency']&&(_0x126de2[_0x32ba63(0x199)]=_0x5d8c54['repeat_sub_frequency']);_0x5d8c54['start_at']!==undefined&&(_0x126de2['startAt']=_0x5d8c54['start_at']);_0x5d8c54['end_on']!==undefined&&(_0x126de2[_0x32ba63(0x1cf)]=_0x5d8c54[_0x32ba63(0x11c)]);_0x5d8c54[_0x32ba63(0x134)]&&(_0x126de2['timezone']=_0x5d8c54[_0x32ba63(0x134)]);if(_0x45395f&&_0x45395f!=='none'&&_0x45395f!=='cron'&&_0x5d8c54[_0x32ba63(0x169)]){const _0x7ae7d0=_0x5d8c54[_0x32ba63(0x169)][_0x32ba63(0x13e)](/T(\d{2}:\d{2})/);_0x7ae7d0&&(_0x126de2['scheduleOption']=_0x7ae7d0[0x1]);}}_0x25fe9d[_0x32ba63(0x162)]&&(_0x25fe9d['notification']['notify_on']&&(_0x126de2[_0x32ba63(0x127)]=_0x25fe9d[_0x32ba63(0x162)][_0x32ba63(0x1aa)]),_0x25fe9d[_0x32ba63(0x162)][_0x32ba63(0x18a)]&&(_0x126de2[_0x32ba63(0x11f)]=_0x25fe9d[_0x32ba63(0x162)][_0x32ba63(0x18a)]['map'](_0x5ef503=>{const _0x5d5dc7=_0x32ba63,_0x3ce728=Number(_0x5ef503);if(!isNaN(_0x3ce728)&&String(_0x3ce728)===_0x5ef503)return _0x3ce728;const _0x37a4ae=_0xc12693?.['get'](_0x5ef503[_0x5d5dc7(0x1d0)]());if(_0x37a4ae===undefined)throw new SDKError(ErrorCode[_0x5d5dc7(0x185)],_0x5d5dc7(0x128)+_0x5ef503+_0x5d5dc7(0x1bf));return _0x37a4ae;})));if(_0x25fe9d['connector_config']){const _0x20f364=_0x1459ba?.['connectionNameToTypeMap']?.[_0x32ba63(0x12d)](_0x441949);if(_0x20f364&&_0x1459ba?.[_0x32ba63(0x160)])try{const _0x22b0c2=await _0x1459ba['getSchema'](_0x20f364),_0x35ab0e=validateConnectorConfig(_0x25fe9d[_0x32ba63(0x18b)],_0x22b0c2);if(!_0x35ab0e[_0x32ba63(0x118)])throw new SDKError(ErrorCode[_0x32ba63(0x1a8)],_0x32ba63(0x1a1)+_0x25fe9d[_0x32ba63(0x173)]+_0x32ba63(0x16f)+formatValidationErrors(_0x35ab0e[_0x32ba63(0x142)]),undefined,{'helpText':_0x32ba63(0x15f)+_0x20f364+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x22b0c2)});if(_0x35ab0e['warnings'][_0x32ba63(0x1b4)]>0x0){const _0x4d6f66=formatValidationWarnings(_0x35ab0e[_0x32ba63(0x180)]);console[_0x32ba63(0x14c)](_0x32ba63(0x17f)+_0x25fe9d[_0x32ba63(0x173)]+'\x22:\x0a'+_0x4d6f66);}_0x126de2[_0x32ba63(0x17d)]=transformConfigToLegacy(_0x25fe9d[_0x32ba63(0x18b)],_0x22b0c2);}catch(_0x1c6ab0){if(_0x1c6ab0 instanceof SDKError&&_0x1c6ab0[_0x32ba63(0x13c)]===ErrorCode[_0x32ba63(0x16b)])_0x126de2['connectorConfig']=_0x25fe9d[_0x32ba63(0x18b)];else throw _0x1c6ab0;}else _0x126de2[_0x32ba63(0x17d)]=_0x25fe9d[_0x32ba63(0x18b)];}_0x25fe9d[_0x32ba63(0x12f)]!==undefined&&(_0x126de2[_0x32ba63(0x1bc)]=_0x25fe9d[_0x32ba63(0x12f)]);if(_0x25fe9d['behavior']){const _0x4896da=_0x25fe9d[_0x32ba63(0x152)],_0x36ce8e={};if(_0x4896da['columns']&&_0x4896da[_0x32ba63(0x178)]['length']>0x0){const _0x923331=_0x4896da[_0x32ba63(0x178)][_0x32ba63(0x164)](_0x2ef7b1=>_0x2ef7b1&&_0x2ef7b1[_0x32ba63(0x173)])['map'](normalizeColumn);_0x923331[_0x32ba63(0x1b4)]>0x0&&(_0x36ce8e[_0x32ba63(0x178)]=_0x923331);}_0x4896da[_0x32ba63(0x1bd)]&&(_0x36ce8e[_0x32ba63(0x1b3)]=_0x4896da[_0x32ba63(0x1bd)]);_0x4896da[_0x32ba63(0x1ae)]&&(_0x36ce8e[_0x32ba63(0x150)]=_0x4896da[_0x32ba63(0x1ae)]);if(_0x4896da[_0x32ba63(0x15d)]!==undefined)_0x36ce8e['joinRow']=_0x4896da[_0x32ba63(0x15d)];else{if(_0x4896da['join_strategy']===_0x32ba63(0x19b)||_0x4896da[_0x32ba63(0x1ae)]===_0x32ba63(0x13d))_0x36ce8e['joinRow']=0x1;else _0x4896da['join_strategy']===_0x32ba63(0x13f)&&(_0x36ce8e[_0x32ba63(0x188)]=null);}_0x4896da[_0x32ba63(0x1ce)]&&(_0x36ce8e['formatting']=_0x4896da[_0x32ba63(0x1ce)]),_0x4896da[_0x32ba63(0x158)]&&(_0x36ce8e['orderBy']=_0x4896da[_0x32ba63(0x158)]),_0x126de2['syndicationBehavior']=_0x36ce8e;}return _0x25fe9d['nested_workflow_project_name']&&(_0x126de2[_0x32ba63(0x1a0)]=_0x25fe9d[_0x32ba63(0x1a6)]),_0x25fe9d[_0x32ba63(0x18e)]&&(_0x126de2['nestedWorkflowName']=_0x25fe9d[_0x32ba63(0x18e)]),_0x25fe9d[_0x32ba63(0x184)]!==undefined&&(_0x126de2['lockEnabled']=_0x25fe9d['lock_enabled']),_0x126de2;}export async function activationDefToUpdateRequest(_0x76887a,_0xdd3985){return activationDefToCreateRequest(_0x76887a,_0xdd3985);}export function deepSortObject(_0xdf19ab){const _0x9c06c8=a142_0x48c789;if(_0xdf19ab===null||typeof _0xdf19ab!=='object')return _0xdf19ab;if(Array[_0x9c06c8(0x13b)](_0xdf19ab))return _0xdf19ab[_0x9c06c8(0x14f)](deepSortObject)[_0x9c06c8(0x12b)]((_0x2e8c14,_0x30f336)=>JSON[_0x9c06c8(0x17b)](_0x2e8c14)[_0x9c06c8(0x1a3)](JSON[_0x9c06c8(0x17b)](_0x30f336)));const _0x473886={};for(const _0x1ceae1 of Object['keys'](_0xdf19ab)[_0x9c06c8(0x12b)]()){_0x473886[_0x1ceae1]=deepSortObject(_0xdf19ab[_0x1ceae1]);}return _0x473886;}export function serializeRule(_0x320f33){const _0x4f30ca=a142_0x48c789;return JSON[_0x4f30ca(0x17b)](deepSortObject(_0x320f33));}export function normalizeRuleForMatching(_0x10a304){return normalizeConditionsForMatching(_0x10a304);}function normalizeConditionsForMatching(_0x50b3cb){const _0x262c17=a142_0x48c789;if(_0x50b3cb===null||typeof _0x50b3cb!==_0x262c17(0x1ac))return _0x50b3cb;if(Array['isArray'](_0x50b3cb))return _0x50b3cb['map'](normalizeConditionsForMatching);const _0x5e13c5=_0x50b3cb;if((_0x5e13c5[_0x262c17(0x145)]==='include'||_0x5e13c5['type']===_0x262c17(0x194))&&typeof _0x5e13c5[_0x262c17(0x13a)]===_0x262c17(0x193))return{..._0x5e13c5,'segment':_0x262c17(0x172)};const _0x5dc276={};for(const _0x232c53 of Object['keys'](_0x5e13c5)){_0x5dc276[_0x232c53]=normalizeConditionsForMatching(_0x5e13c5[_0x232c53]);}return _0x5dc276;}export function serializeRuleForMatching(_0x4e7285){const _0x4d94e1=a142_0x48c789;return JSON[_0x4d94e1(0x17b)](deepSortObject(normalizeRuleForMatching(_0x4e7285)));}export function expandSegmentReferences(_0x8f8bcc,_0x27997f,_0xd284ba=new Set()){return expandConditions(_0x8f8bcc,_0x27997f,_0xd284ba);}function expandConditions(_0x5432e5,_0x235ad5,_0x5f433f){const _0x1cfb54=a142_0x48c789;if(_0x5432e5===null||typeof _0x5432e5!==_0x1cfb54(0x1ac))return _0x5432e5;if(Array[_0x1cfb54(0x13b)](_0x5432e5))return _0x5432e5[_0x1cfb54(0x14f)](_0x425ac5=>expandConditions(_0x425ac5,_0x235ad5,_0x5f433f));const _0x1a76cc=_0x5432e5;if((_0x1a76cc[_0x1cfb54(0x145)]==='include'||_0x1a76cc[_0x1cfb54(0x145)]===_0x1cfb54(0x194))&&typeof _0x1a76cc[_0x1cfb54(0x13a)]===_0x1cfb54(0x193)){const _0x3f0669=_0x1a76cc[_0x1cfb54(0x13a)],_0x1e0af8=_0x235ad5[_0x1cfb54(0x12d)](_0x3f0669);if(_0x1e0af8&&!_0x5f433f[_0x1cfb54(0x14a)](_0x3f0669)){const _0x423895=new Set(_0x5f433f);_0x423895[_0x1cfb54(0x14e)](_0x3f0669);const _0x3654ed=expandConditions(_0x1e0af8,_0x235ad5,_0x423895);return{'type':_0x1a76cc[_0x1cfb54(0x145)],'expanded_rule':_0x3654ed};}return{'type':_0x1a76cc[_0x1cfb54(0x145)],'expanded_rule':_0x1cfb54(0x16a)};}const _0x388bc1={};for(const _0xe649ea of Object[_0x1cfb54(0x133)](_0x1a76cc)){_0x388bc1[_0xe649ea]=expandConditions(_0x1a76cc[_0xe649ea],_0x235ad5,_0x5f433f);}return _0x388bc1;}export function serializeExpandedRule(_0x3b85b7,_0x50796a){const _0x35a33c=expandSegmentReferences(_0x3b85b7,_0x50796a);return JSON['stringify'](deepSortObject(_0x35a33c));}export function createSegmentNameContext(_0x27f617){const _0x2d4fe4=a142_0x48c789,_0x54eebe=new Set(),_0x175e11=new Map(),_0x5dd5fd=new Map();if(_0x27f617)for(const [_0x5538b1,_0x412d82]of Object[_0x2d4fe4(0x15b)](_0x27f617)){if(_0x412d82[_0x2d4fe4(0x1b5)]){const _0x166855=serializeRule(_0x412d82['rule']);_0x5dd5fd[_0x2d4fe4(0x168)](_0x166855,_0x5538b1),_0x54eebe['add'](_0x5538b1);}}return{'usedNames':_0x54eebe,'ruleHashToName':_0x175e11,'localRuleToName':_0x27f617?_0x5dd5fd:undefined};}export function resolveSegmentName(_0x5eaefa,_0x53a926,_0x2c910b,_0x45520a){const _0x3a1488=a142_0x48c789,_0x38d8a0=serializeRule(_0x53a926);if(_0x2c910b[_0x3a1488(0x1b6)]){const _0x2fe34d=_0x2c910b[_0x3a1488(0x1b6)][_0x3a1488(0x12d)](_0x38d8a0);if(_0x2fe34d)return{'name':_0x2fe34d,'isDuplicate':![],'isLocalMatch':!![]};}const _0x3c4577=_0x2c910b[_0x3a1488(0x170)]['get'](_0x38d8a0);if(_0x3c4577)return{'name':_0x3c4577,'isDuplicate':!![],'isLocalMatch':![]};const _0x1354f0=_0x45520a(_0x5eaefa);let _0x3fcb70=_0x1354f0||_0x5eaefa,_0x5390fa=_0x3fcb70,_0x30c0a9=0x2;while(_0x2c910b[_0x3a1488(0x137)]['has'](_0x5390fa)){_0x5390fa=_0x3fcb70+'_'+_0x30c0a9,_0x30c0a9++;}return _0x2c910b['usedNames'][_0x3a1488(0x14e)](_0x5390fa),_0x2c910b[_0x3a1488(0x170)][_0x3a1488(0x168)](_0x38d8a0,_0x5390fa),{'name':_0x5390fa,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x17578a){const _0x13b4c3=[],_0x5cd683=_0x5be8f2=>{const _0x4b7c72=a142_0x1ba4;if(!_0x5be8f2||typeof _0x5be8f2!=='object')return;if(Array[_0x4b7c72(0x13b)](_0x5be8f2)){_0x5be8f2[_0x4b7c72(0x138)](_0x5cd683);return;}const _0x7d7a11=_0x5be8f2;(_0x7d7a11['type']===_0x4b7c72(0x181)||_0x7d7a11[_0x4b7c72(0x145)]===_0x4b7c72(0x194))&&typeof _0x7d7a11[_0x4b7c72(0x13a)]==='string'&&_0x13b4c3[_0x4b7c72(0x123)](_0x7d7a11['segment']);for(const _0x1acc4c of Object['values'](_0x7d7a11)){_0x5cd683(_0x1acc4c);}};return _0x5cd683(_0x17578a),_0x13b4c3;}export function validateSegmentRule(_0x20085e,_0x1844d5){const _0x4cf789=a142_0x48c789;if(!_0x1844d5||!_0x1844d5[_0x4cf789(0x1b8)])return;for(let _0x14eb96=0x0;_0x14eb96<_0x1844d5['conditions'][_0x4cf789(0x1b4)];_0x14eb96++){const _0x8e7840=_0x1844d5['conditions'][_0x14eb96];if(_0x4cf789(0x145)in _0x8e7840&&_0x8e7840[_0x4cf789(0x145)]==='Value'){const _0x511ab2=_0x8e7840,_0x472445=_0x511ab2[_0x4cf789(0x131)]||_0x511ab2[_0x4cf789(0x1be)];if((!_0x511ab2[_0x4cf789(0x1c1)]||_0x511ab2[_0x4cf789(0x1c1)]==='')&&!_0x472445)throw new SDKError(ErrorCode[_0x4cf789(0x122)],_0x4cf789(0x189)+_0x20085e+_0x4cf789(0x11d)+(_0x4cf789(0x18c)+_0x14eb96+'].attribute\x20cannot\x20be\x20empty.\x0a')+_0x4cf789(0x17c));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x176982,_0x9f4aa2){const _0xebcb7d=a143_0x4dfe,_0x1ee76a=_0x176982();while(!![]){try{const _0x477f8a=-parseInt(_0xebcb7d(0x190))/0x1+parseInt(_0xebcb7d(0x178))/0x2+parseInt(_0xebcb7d(0x16c))/0x3*(-parseInt(_0xebcb7d(0x16d))/0x4)+-parseInt(_0xebcb7d(0x1a5))/0x5*(-parseInt(_0xebcb7d(0x170))/0x6)+-parseInt(_0xebcb7d(0x18e))/0x7*(-parseInt(_0xebcb7d(0x1aa))/0x8)+parseInt(_0xebcb7d(0x1a9))/0x9*(parseInt(_0xebcb7d(0x18a))/0xa)+-parseInt(_0xebcb7d(0x176))/0xb*(parseInt(_0xebcb7d(0x199))/0xc);if(_0x477f8a===_0x9f4aa2)break;else _0x1ee76a['push'](_0x1ee76a['shift']());}catch(_0x20d5c5){_0x1ee76a['push'](_0x1ee76a['shift']());}}}(a143_0x14e2,0x7c5de));import a143_0x5defe3 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a143_0x4dfe(_0xf1529b,_0x42141b){_0xf1529b=_0xf1529b-0x16a;const _0x14e22e=a143_0x14e2();let _0x4dfe86=_0x14e22e[_0xf1529b];return _0x4dfe86;}export function buildSchemaResult(_0x4d6990){const _0x26afa0=a143_0x4dfe,_0x378ff3=_0x4d6990[_0x26afa0(0x17b)][_0x26afa0(0x192)](_0xe12011=>({'column_name':_0xe12011[_0x26afa0(0x19c)],'column_type':_0xe12011[_0x26afa0(0x1ab)],'null':'YES','key':null,'default':null,'extra':null}));return{..._0x4d6990,'columns':[{'name':_0x26afa0(0x186),'type':_0x26afa0(0x173)},{'name':'column_type','type':'varchar'},{'name':_0x26afa0(0x180),'type':_0x26afa0(0x173)},{'name':_0x26afa0(0x172),'type':_0x26afa0(0x173)},{'name':_0x26afa0(0x16b),'type':_0x26afa0(0x173)},{'name':_0x26afa0(0x195),'type':'varchar'}],'data':_0x378ff3};}function a143_0x14e2(){const _0x94b80=['trim','18205AwMwPf','source','groupingName','push','2214ShZbjL','2304dGTyZQ','type','parentTableName','default','462QSxrmF','9396giXRFb','Fetching\x20schema...','localeCompare','1374BfzkDW','startsWith','key','varchar','parentColumn','data','38159lCfjsw','set','604254QcbAZF','some','filter','columns','length','Unknown','cyan','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','null','matrixColumnName','sort','bold','behavior','slice','column_name','matrixTableName','information_schema','SELECT\x20*\x20FROM\x20(\x0a','40010FyvJoK','setJobId','query','size','12558oPzyuM','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','447462lRuMyz','Behaviors','map','execute','displayName','extra','fields','Schema\x20query:\x0a','dim','4560mWqFRD','entries','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','name','error','Attributes','verbose','tableName','\x20\x20\x20\x20','get','replace'];a143_0x14e2=function(){return _0x94b80;};return a143_0x14e2();}export async function executeSchemaQuery(_0x56f375,_0x24642c,_0xebfdf9){const _0x34720e=a143_0x4dfe,_0x48555b=_0x56f375[_0x34720e(0x1a4)]()[_0x34720e(0x1a3)](/;+$/,''),_0x1a1cd7=_0x34720e(0x189)+_0x48555b+_0x34720e(0x18f);_0xebfdf9[_0x34720e(0x19f)]&&console[_0x34720e(0x19d)](_0x34720e(0x197)+_0x1a1cd7);const _0x11f8d5=await withProgressSpinner(_0x34720e(0x16e),async _0x591d22=>{const _0xf167d8=_0x34720e,_0x5b003d=await _0x24642c[_0xf167d8(0x18c)][_0xf167d8(0x193)](_0x1a1cd7,{'catalog':'td','schema':_0xf167d8(0x188),'onJobId':_0x2a7554=>{const _0x240785=_0xf167d8;_0x591d22[_0x240785(0x18b)](_0x2a7554);}});return _0x5b003d;},{'verbose':_0xebfdf9[_0x34720e(0x19f)]});return buildSchemaResult(_0x11f8d5[_0x34720e(0x175)]);}function columnName(_0x5058c8){const _0xedcde3=a143_0x4dfe;return _0x5058c8[_0xedcde3(0x181)]||_0x5058c8[_0xedcde3(0x174)]||_0x5058c8[_0xedcde3(0x19c)];}function formatFieldLine(_0x377116,_0x423cec,_0x5242f4){const _0x54a89a=a143_0x4dfe,_0x2996c1=_0x377116!==_0x423cec?'\x20'+a143_0x5defe3[_0x54a89a(0x198)]('('+_0x423cec+')'):'';return _0x54a89a(0x1a1)+_0x377116+_0x2996c1+':\x20'+a143_0x5defe3[_0x54a89a(0x17e)](_0x5242f4);}function sortByColumnName(_0x5097b5){const _0x57d0db=a143_0x4dfe;return[..._0x5097b5][_0x57d0db(0x182)]((_0x4acc97,_0x4efaf2)=>columnName(_0x4acc97)[_0x57d0db(0x16f)](columnName(_0x4efaf2)));}export function displayFieldsHumanReadable(_0x4a8fbc,_0x363bc4){const _0x3eff1b=a143_0x4dfe,_0x33d417=_0x4a8fbc[_0x3eff1b(0x17a)](_0x28f008=>_0x28f008[_0x3eff1b(0x1a6)]==='attribute'),_0x4a335b=_0x4a8fbc['filter'](_0x5965d3=>_0x5965d3[_0x3eff1b(0x1a6)]===_0x3eff1b(0x184)),_0x4ac9c9=new Map();for(const _0x2ab54b of _0x33d417){const _0x495f70=_0x2ab54b[_0x3eff1b(0x1a7)]||_0x2ab54b[_0x3eff1b(0x16a)]||'Unknown',_0x5ca58e=_0x4ac9c9[_0x3eff1b(0x1a2)](_0x495f70);_0x5ca58e?_0x5ca58e['fields'][_0x3eff1b(0x1a8)](_0x2ab54b):_0x4ac9c9[_0x3eff1b(0x177)](_0x495f70,{'displayName':_0x495f70,'tableName':_0x2ab54b['parentTableName'],'fields':[_0x2ab54b]});}const _0xfbaa2f=new Map();for(const _0x171950 of _0x4a335b){const _0x350225=_0x171950['behaviorName']||_0x3eff1b(0x17d),_0x30bfa2=_0xfbaa2f[_0x3eff1b(0x1a2)](_0x350225)||[];_0x30bfa2[_0x3eff1b(0x1a8)](_0x171950),_0xfbaa2f['set'](_0x350225,_0x30bfa2);}console[_0x3eff1b(0x19d)]('\x0a'+a143_0x5defe3[_0x3eff1b(0x183)](_0x363bc4));if(_0x4ac9c9[_0x3eff1b(0x18d)]>0x0){console[_0x3eff1b(0x19d)]('\x0a'+a143_0x5defe3[_0x3eff1b(0x198)](_0x3eff1b(0x19e)));const _0x526c57=[..._0x4ac9c9['entries']()]['sort']((_0x1bc768,_0x141ed0)=>_0x1bc768[0x0]['localeCompare'](_0x141ed0[0x0]));for(const [,_0x509648]of _0x526c57){const _0x57f135=_0x509648[_0x3eff1b(0x1a0)]&&_0x509648[_0x3eff1b(0x1a0)]!==_0x509648[_0x3eff1b(0x194)]?'\x20'+a143_0x5defe3[_0x3eff1b(0x198)]('('+_0x509648[_0x3eff1b(0x1a0)]+')'):'';console[_0x3eff1b(0x19d)]('\x20\x20'+a143_0x5defe3[_0x3eff1b(0x183)](_0x509648[_0x3eff1b(0x194)])+_0x57f135);for(const _0x2f8716 of sortByColumnName(_0x509648[_0x3eff1b(0x196)])){console['error'](formatFieldLine(columnName(_0x2f8716),_0x2f8716[_0x3eff1b(0x19c)],_0x2f8716[_0x3eff1b(0x1ab)]));}}}if(_0xfbaa2f['size']>0x0){console[_0x3eff1b(0x19d)]('\x0a'+a143_0x5defe3['dim'](_0x3eff1b(0x191)));const _0x5dd7be=[..._0xfbaa2f[_0x3eff1b(0x19a)]()][_0x3eff1b(0x182)]((_0x3b268f,_0xaceff)=>_0x3b268f[0x0]['localeCompare'](_0xaceff[0x0]));for(const [_0x2fc45c,_0x3e76ab]of _0x5dd7be){const _0x3f1ccd=_0x3e76ab[0x0],_0x476f16=_0x3f1ccd?.[_0x3eff1b(0x187)];if(_0x476f16){const _0x346ba2=_0x476f16!==_0x2fc45c?'\x20'+a143_0x5defe3[_0x3eff1b(0x198)]('('+_0x2fc45c+')'):'';console[_0x3eff1b(0x19d)]('\x20\x20'+a143_0x5defe3[_0x3eff1b(0x183)](_0x476f16)+_0x346ba2);}else{const _0x2ec64e=_0x3f1ccd?.['parentTableName']||'';console[_0x3eff1b(0x19d)]('\x20\x20'+a143_0x5defe3[_0x3eff1b(0x183)](_0x2fc45c)+(_0x2ec64e?'\x20'+a143_0x5defe3['dim']('('+_0x2ec64e+')'):''));}for(const _0x26104c of sortByColumnName(_0x3e76ab)){const _0x322642=_0x26104c[_0x3eff1b(0x19c)][_0x3eff1b(0x171)](_0x2fc45c+'.')?_0x26104c[_0x3eff1b(0x19c)][_0x3eff1b(0x185)](_0x2fc45c[_0x3eff1b(0x17c)]+0x1):_0x26104c[_0x3eff1b(0x19c)];console[_0x3eff1b(0x19d)](formatFieldLine(columnName(_0x26104c),_0x322642,_0x26104c['type']));}}}const _0x1b6940=_0x4a8fbc[_0x3eff1b(0x179)](_0x253fc1=>_0x253fc1[_0x3eff1b(0x181)]||_0x253fc1[_0x3eff1b(0x187)]);_0x1b6940&&(console['error']('\x0a'+a143_0x5defe3[_0x3eff1b(0x198)](_0x3eff1b(0x19b))),console[_0x3eff1b(0x19d)](a143_0x5defe3['dim'](_0x3eff1b(0x17f)))),console[_0x3eff1b(0x19d)]('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2cbd9e,_0x3abc83){const _0x102556=a144_0x4529,_0x340579=_0x2cbd9e();while(!![]){try{const _0xf87ae0=parseInt(_0x102556(0x189))/0x1*(parseInt(_0x102556(0x17f))/0x2)+-parseInt(_0x102556(0x181))/0x3*(-parseInt(_0x102556(0x187))/0x4)+-parseInt(_0x102556(0x192))/0x5+parseInt(_0x102556(0x18d))/0x6+parseInt(_0x102556(0x182))/0x7+-parseInt(_0x102556(0x17e))/0x8*(parseInt(_0x102556(0x185))/0x9)+-parseInt(_0x102556(0x18b))/0xa*(parseInt(_0x102556(0x184))/0xb);if(_0xf87ae0===_0x3abc83)break;else _0x340579['push'](_0x340579['shift']());}catch(_0x134110){_0x340579['push'](_0x340579['shift']());}}}(a144_0x1344,0x35973));function a144_0x4529(_0x58c012,_0x385a51){_0x58c012=_0x58c012-0x17e;const _0x1344b6=a144_0x1344();let _0x45294a=_0x1344b6[_0x58c012];return _0x45294a;}import{readdirSync,statSync}from'fs';import a144_0x5b0079 from'path';export function findYamlFiles(_0x2a5920){const _0x3b87e4=[];function _0x513751(_0x2c9509){const _0x45f498=a144_0x4529,_0x4c084a=readdirSync(_0x2c9509,{'withFileTypes':!![]});for(const _0x3ccab4 of _0x4c084a){const _0x3a948f=a144_0x5b0079['join'](_0x2c9509,_0x3ccab4['name']);if(_0x3ccab4['isDirectory']())_0x513751(_0x3a948f);else(_0x3ccab4[_0x45f498(0x18a)][_0x45f498(0x183)](_0x45f498(0x191))||_0x3ccab4[_0x45f498(0x18a)][_0x45f498(0x183)]('.yaml'))&&_0x3b87e4[_0x45f498(0x18c)](_0x3a948f);}}return _0x513751(_0x2a5920),_0x3b87e4;}export function discoverYamlFiles(_0x1ab179){const _0x26f1b6=a144_0x4529,_0x3a3299=findYamlFiles(_0x1ab179);return _0x3a3299[_0x26f1b6(0x193)](_0x2edf64=>{const _0x32ad56=_0x26f1b6,_0x4871f1=a144_0x5b0079[_0x32ad56(0x186)](_0x1ab179,_0x2edf64),_0x32401e=a144_0x5b0079[_0x32ad56(0x188)](_0x4871f1);return{'absolutePath':_0x2edf64,'relativePath':_0x4871f1,'folderPath':_0x32401e==='.'?'':_0x32401e[_0x32ad56(0x18e)](/\\/g,'/')};});}function a144_0x1344(){const _0x26b56b=['995250oQuyds','map','424NQcqum','5886OssWFJ','.yaml','1503PGOvQr','1323126hfTXQO','endsWith','30151FGHnsi','60318ZvnMSe','relative','2272Ccmufj','dirname','130lIoqdo','name','1840HSLWAy','push','2531586ubMMji','replace','isFile','extname','.yml'];a144_0x1344=function(){return _0x26b56b;};return a144_0x1344();}export function isYamlFile(_0x434db8){const _0x2acdd1=a144_0x4529;try{const _0x4a1cad=statSync(_0x434db8);if(!_0x4a1cad[_0x2acdd1(0x18f)]())return![];const _0x495144=a144_0x5b0079[_0x2acdd1(0x190)](_0x434db8)['toLowerCase']();return _0x495144===_0x2acdd1(0x191)||_0x495144===_0x2acdd1(0x180);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x579c33,_0x5b5428){const _0x4860d0=a145_0x4b53,_0xe1d0a5=_0x579c33();while(!![]){try{const _0x5bbeec=-parseInt(_0x4860d0(0x15d))/0x1+-parseInt(_0x4860d0(0x18b))/0x2+parseInt(_0x4860d0(0x159))/0x3*(parseInt(_0x4860d0(0x153))/0x4)+parseInt(_0x4860d0(0x17d))/0x5*(parseInt(_0x4860d0(0x179))/0x6)+parseInt(_0x4860d0(0x154))/0x7*(parseInt(_0x4860d0(0x196))/0x8)+-parseInt(_0x4860d0(0x176))/0x9*(parseInt(_0x4860d0(0x14a))/0xa)+parseInt(_0x4860d0(0x178))/0xb*(parseInt(_0x4860d0(0x193))/0xc);if(_0x5bbeec===_0x5b5428)break;else _0xe1d0a5['push'](_0xe1d0a5['shift']());}catch(_0x5c237e){_0xe1d0a5['push'](_0xe1d0a5['shift']());}}}(a145_0x8cca,0x3b0be));function a145_0x4b53(_0x3a7ef7,_0x4d386d){_0x3a7ef7=_0x3a7ef7-0x143;const _0x8cca4c=a145_0x8cca();let _0x4b538d=_0x8cca4c[_0x3a7ef7];return _0x4b538d;}import{serializeRule,deepSortObject}from'./child-segment-yaml.js';function a145_0x8cca(){const _0x422140=['wait','segments','merged','stages','description','version_number','schedule','map','has','.yaml','some','join','push','exclude','milestone','draft','match','activations','length','1797732VzlXWp','name','224653IhmVRe','6cOJaBB','launched','steps','behavior','1177555UBIKce','values','include','version','yaml','string','rule','branches','nameMapping','goal','replace','type','bundle_id','find','837752bxautq','.yml','latest','all_columns','versions','null','startsWith','slice','276bOQnkw','toLowerCase','conditions','8ZvtfQS','journeys','connector_config','index','decision_point','journey','get','set','entries','exit_criteria','20hCqyym','condition','trim','columns','sort','activation','from','object','entry_criteria','4ITKkiD','1021461zmOdnz','state','attributes','segment','activation_template_id','1114977TpLRIr','notification','isArray','keys','162596vccKTI','bundle_name','reentry','item','endsWith','with'];a145_0x8cca=function(){return _0x422140;};return a145_0x8cca();}export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0xfc6339){const _0x1c54c1=a145_0x4b53;return _0xfc6339[_0x1c54c1(0x194)]()[_0x1c54c1(0x187)](/\s+/g,'_')[_0x1c54c1(0x187)](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x1c54c1(0x187)](/_+/g,'_')[_0x1c54c1(0x187)](/^_|_$/g,'');}export function generateJourneyLocalName(_0xdc2b84){const _0x4bedb6=a145_0x4b53,_0x4266a1=_0xdc2b84[_0x4bedb6(0x173)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x4266a1){const _0x29cd30=_0x4266a1[0x1][_0x4bedb6(0x194)](),_0x4f1eb6=_0x4266a1[0x2],_0x549810=_0x4f1eb6[_0x4bedb6(0x187)](/-/g,'')['slice'](0x0,0x4)[_0x4bedb6(0x194)]();return _0x29cd30+'_'+_0x549810;}const _0x46ae2b=_0xdc2b84[_0x4bedb6(0x173)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x46ae2b){const _0x5cc5d4=_0x46ae2b[0x1],_0x16bb3e=_0x46ae2b[0x2][_0x4bedb6(0x194)](),_0x54d000=_0x5cc5d4[_0x4bedb6(0x187)](/-/g,'')[_0x4bedb6(0x192)](0x0,0x4)[_0x4bedb6(0x194)]();return _0x16bb3e+'_'+_0x54d000;}return undefined;}function stableStringify(_0x3b0571){const _0x1a6dd3=a145_0x4b53;if(Array[_0x1a6dd3(0x15b)](_0x3b0571))return'['+_0x3b0571['map'](_0x272fe1=>stableStringify(_0x272fe1))[_0x1a6dd3(0x16e)](',')+']';if(_0x3b0571&&typeof _0x3b0571===_0x1a6dd3(0x151)){const _0x820a2d=_0x3b0571,_0x14d46f=Object[_0x1a6dd3(0x15c)](_0x820a2d)['sort'](),_0x434e41=_0x14d46f[_0x1a6dd3(0x16a)](_0x1c4b18=>'\x22'+_0x1c4b18+'\x22:'+stableStringify(_0x820a2d[_0x1c4b18]));return'{'+_0x434e41['join'](',')+'}';}const _0x45385d=JSON['stringify'](_0x3b0571);return _0x45385d===undefined?_0x1a6dd3(0x190):_0x45385d;}export function consolidateActivationsByContent(_0x26bcf5){const _0x5d4df7=a145_0x4b53,_0x5427b2={},_0x32d9eb=new Map(),_0x50693f=new Map();for(const _0x338964 of _0x26bcf5){if(!_0x338964)continue;for(const [_0x4aa811,_0x59570d]of Object[_0x5d4df7(0x148)](_0x338964)){const _0x124298={'name':_0x59570d['name'],'connection':_0x59570d['connection'],..._0x59570d[_0x5d4df7(0x18e)]!==undefined&&{'all_columns':_0x59570d['all_columns']},..._0x59570d[_0x5d4df7(0x14d)]!==undefined&&{'columns':_0x59570d[_0x5d4df7(0x14d)]},..._0x59570d[_0x5d4df7(0x17c)]!==undefined&&{'behavior':_0x59570d[_0x5d4df7(0x17c)]},..._0x59570d['schedule']!==undefined&&{'schedule':_0x59570d[_0x5d4df7(0x169)]},..._0x59570d[_0x5d4df7(0x15a)]!==undefined&&{'notification':_0x59570d[_0x5d4df7(0x15a)]},..._0x59570d['connector_config']!==undefined&&{'connector_config':_0x59570d[_0x5d4df7(0x198)]},..._0x59570d['activation_template_id']!==undefined&&{'activation_template_id':_0x59570d[_0x5d4df7(0x158)]}},_0x176631=stableStringify(_0x124298),_0x1caee7=_0x50693f[_0x5d4df7(0x146)](_0x176631);_0x1caee7?_0x32d9eb['set'](_0x4aa811,_0x1caee7):(_0x5427b2[_0x4aa811]=_0x59570d,_0x32d9eb[_0x5d4df7(0x147)](_0x4aa811,_0x4aa811),_0x50693f[_0x5d4df7(0x147)](_0x176631,_0x4aa811));}}return{'merged':_0x5427b2,'nameMapping':_0x32d9eb};}export function updateActivationReferences(_0x18e957,_0x4fc144){const _0x24ca50=a145_0x4b53;if(!_0x18e957)return;for(const _0x573160 of _0x18e957){if(!_0x573160[_0x24ca50(0x17b)])continue;for(const _0x36489d of _0x573160[_0x24ca50(0x17b)]){if(_0x36489d[_0x24ca50(0x188)]===_0x24ca50(0x14f)&&_0x36489d['with']?.['activation']){const _0x267965=_0x4fc144['get'](_0x36489d[_0x24ca50(0x162)]['activation']);_0x267965&&_0x267965!==_0x36489d[_0x24ca50(0x162)][_0x24ca50(0x14f)]&&(_0x36489d[_0x24ca50(0x162)]['activation']=_0x267965);}}}}export function consolidateSegmentsByContent(_0x543d1b,_0x543d95){const _0x560069=a145_0x4b53,_0x75e80f={},_0x4de82f=new Map(),_0x552f45=new Map();for(const _0x5e13d3 of _0x543d1b){if(!_0x5e13d3)continue;for(const [_0x32a596,_0xfdf93]of Object[_0x560069(0x148)](_0x5e13d3)){if(!_0xfdf93[_0x560069(0x183)]){_0x75e80f[_0x32a596]=_0xfdf93,_0x4de82f[_0x560069(0x147)](_0x32a596,_0x32a596);continue;}const _0x1d7b52=_0xfdf93[_0x560069(0x167)]&&_0xfdf93[_0x560069(0x167)][_0x560069(0x14c)]()?_0xfdf93[_0x560069(0x167)]:undefined,_0x5efdc6=JSON['stringify']({'description':_0x1d7b52,'rule':deepSortObject(_0xfdf93[_0x560069(0x183)])}),_0x4c8781=_0x552f45['get'](_0x5efdc6);if(_0x4c8781){const _0x50132c={..._0xfdf93[_0x560069(0x167)]!==undefined&&{'description':_0xfdf93['description']},'rule':_0xfdf93['rule']?deepSortObject(_0xfdf93[_0x560069(0x183)]):_0xfdf93[_0x560069(0x183)]};if(_0x32a596<_0x4c8781){_0x75e80f[_0x32a596]=_0x50132c,delete _0x75e80f[_0x4c8781];for(const [_0x264b30,_0x4b968c]of _0x4de82f['entries']()){_0x4b968c===_0x4c8781&&_0x4de82f['set'](_0x264b30,_0x32a596);}_0x4de82f['set'](_0x32a596,_0x32a596),_0x552f45[_0x560069(0x147)](_0x5efdc6,_0x32a596);}else _0x75e80f[_0x4c8781]=_0x50132c,_0x4de82f['set'](_0x32a596,_0x4c8781);}else{let _0x2e3bf9=_0x32a596;if(_0x543d95){const _0x36ce52=_0x543d95[_0x560069(0x146)](_0x5efdc6);_0x36ce52&&_0x36ce52[_0x560069(0x175)]>0x0&&(_0x2e3bf9=_0x36ce52[_0x560069(0x192)]()[_0x560069(0x14e)]()[0x0]);}const _0x33d1ef={..._0xfdf93[_0x560069(0x167)]!==undefined&&{'description':_0xfdf93[_0x560069(0x167)]},'rule':_0xfdf93['rule']?deepSortObject(_0xfdf93[_0x560069(0x183)]):_0xfdf93[_0x560069(0x183)]};_0x75e80f[_0x2e3bf9]=_0x33d1ef,_0x4de82f[_0x560069(0x147)](_0x32a596,_0x2e3bf9),_0x552f45[_0x560069(0x147)](_0x5efdc6,_0x2e3bf9);}}}return{'merged':_0x75e80f,'nameMapping':_0x4de82f};}export function updateSegmentReferences(_0x26e452,_0x2fbc73){const _0x134187=a145_0x4b53;if(!_0x26e452)return;for(const _0x9486f5 of _0x26e452){if(_0x9486f5['entry_criteria']?.[_0x134187(0x157)]){const _0x5ca1c7=_0x2fbc73[_0x134187(0x146)](_0x9486f5[_0x134187(0x152)]['segment']);_0x5ca1c7&&(_0x9486f5[_0x134187(0x152)][_0x134187(0x157)]=_0x5ca1c7);}if(_0x9486f5[_0x134187(0x149)])for(const _0x3584ed of _0x9486f5[_0x134187(0x149)]){if(_0x3584ed[_0x134187(0x157)]){const _0x3b0dc8=_0x2fbc73[_0x134187(0x146)](_0x3584ed[_0x134187(0x157)]);_0x3b0dc8&&(_0x3584ed[_0x134187(0x157)]=_0x3b0dc8);}}if(_0x9486f5[_0x134187(0x171)]?.[_0x134187(0x157)]){const _0x121f3b=_0x2fbc73[_0x134187(0x146)](_0x9486f5[_0x134187(0x171)][_0x134187(0x157)]);_0x121f3b&&(_0x9486f5[_0x134187(0x171)]['segment']=_0x121f3b);}if(_0x9486f5[_0x134187(0x17b)])for(const _0x25a0a0 of _0x9486f5[_0x134187(0x17b)]){if(_0x25a0a0[_0x134187(0x188)]===_0x134187(0x144)&&_0x25a0a0['with']?.[_0x134187(0x184)])for(const _0x10735c of _0x25a0a0[_0x134187(0x162)][_0x134187(0x184)]){if(_0x10735c['segment']){const _0x58bd9f=_0x2fbc73[_0x134187(0x146)](_0x10735c[_0x134187(0x157)]);_0x58bd9f&&(_0x10735c['segment']=_0x58bd9f);}}if(_0x25a0a0['type']===_0x134187(0x163)&&_0x25a0a0['with']?.[_0x134187(0x14b)]?.[_0x134187(0x157)]){const _0x123e65=_0x2fbc73['get'](_0x25a0a0[_0x134187(0x162)][_0x134187(0x14b)][_0x134187(0x157)]);_0x123e65&&(_0x25a0a0['with'][_0x134187(0x14b)][_0x134187(0x157)]=_0x123e65);}}}}export function updateSegmentRefsInSegments(_0x248d43,_0x1e243b){const _0x54274b=a145_0x4b53;for(const _0xa6abd0 of Object[_0x54274b(0x17e)](_0x248d43)){_0xa6abd0[_0x54274b(0x183)]&&updateSegmentRefsInRule(_0xa6abd0['rule'],_0x1e243b);}}function updateSegmentRefsInRule(_0x51ed7a,_0x1ff24e){const _0x59e602=a145_0x4b53;if(_0x51ed7a===null||typeof _0x51ed7a!==_0x59e602(0x151))return;if(Array[_0x59e602(0x15b)](_0x51ed7a)){for(const _0x1dd304 of _0x51ed7a){updateSegmentRefsInRule(_0x1dd304,_0x1ff24e);}return;}const _0x5c0022=_0x51ed7a;if((_0x5c0022[_0x59e602(0x188)]===_0x59e602(0x17f)||_0x5c0022['type']===_0x59e602(0x170))&&typeof _0x5c0022['segment']===_0x59e602(0x182)){const _0x132a00=_0x1ff24e[_0x59e602(0x146)](_0x5c0022['segment']);_0x132a00&&(_0x5c0022[_0x59e602(0x157)]=_0x132a00);}if(_0x5c0022[_0x59e602(0x195)]&&Array['isArray'](_0x5c0022[_0x59e602(0x195)]))for(const _0xc32175 of _0x5c0022[_0x59e602(0x195)]){updateSegmentRefsInRule(_0xc32175,_0x1ff24e);}}export function buildJourneysArray(_0x48fe2a,_0x4c4f4c){const _0x534bc3=a145_0x4b53;return _0x48fe2a[_0x534bc3(0x16a)](_0xf65fc6=>{const _0x328069=_0x534bc3,_0x4d86d1=_0x4c4f4c?_0xf65fc6[_0x328069(0x160)]['id']===_0x4c4f4c:_0x48fe2a['length']===0x1,_0x157591=_0xf65fc6[_0x328069(0x181)][_0x328069(0x197)]?.[0x0],_0x52d7db=_0x157591?.[_0x328069(0x186)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x186)],_0x1f1fe2={'version':_0x157591?.[_0x328069(0x180)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x180)]||_0xf65fc6[_0x328069(0x160)]['name'],'state':_0xf65fc6['item'][_0x328069(0x155)]===_0x328069(0x17a)?_0x328069(0x17a):_0x328069(0x172),'stages':_0x157591?.[_0x328069(0x166)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x166)]||[],'id':_0x157591?.['id']||_0xf65fc6[_0x328069(0x181)]['id'],'version_number':_0x157591?.[_0x328069(0x168)]||_0xf65fc6[_0x328069(0x181)][_0x328069(0x168)]};return _0x52d7db&&(_0x1f1fe2[_0x328069(0x186)]=_0x52d7db),_0x4d86d1&&(_0x1f1fe2[_0x328069(0x18d)]=!![]),_0x1f1fe2;});}export function buildMergedJourneyDef(_0xdb52d2,_0xb02824,_0x49ea6d){const _0x19de85=a145_0x4b53,_0x4a3402=_0xdb52d2[0x0]['yaml'],_0x50dc9f=buildJourneysArray(_0xdb52d2,_0x49ea6d),{merged:_0x21c56a,nameMapping:_0x234531}=consolidateSegmentsByContent(_0xdb52d2[_0x19de85(0x16a)](_0x348533=>_0x348533[_0x19de85(0x181)]['segments']),_0xb02824);updateSegmentRefsInSegments(_0x21c56a,_0x234531);const _0x5d4cf7=Array[_0x19de85(0x150)](_0x234531[_0x19de85(0x148)]())[_0x19de85(0x16d)](([_0x3899e3,_0x54df7c])=>_0x3899e3!==_0x54df7c&&_0x3899e3[_0x19de85(0x191)](_0x19de85(0x152)));let _0x66acd9=_0x21c56a,_0x484b1e=new Map();if(_0x5d4cf7){const _0x2ec269=consolidateSegmentsByContent([_0x21c56a],_0xb02824);_0x66acd9=_0x2ec269[_0x19de85(0x165)],_0x484b1e=_0x2ec269[_0x19de85(0x185)];}const _0xc40306=new Map(_0x234531);for(const [_0x11727f,_0x2e92f9]of _0x484b1e[_0x19de85(0x148)]()){_0xc40306[_0x19de85(0x147)](_0x11727f,_0x2e92f9);}for(const [_0x5432b2,_0x11d981]of _0xc40306[_0x19de85(0x148)]()){let _0x12e5e7=_0x11d981,_0x4f3fd1=0x0;while(_0xc40306[_0x19de85(0x16b)](_0x12e5e7)&&_0xc40306[_0x19de85(0x146)](_0x12e5e7)!==_0x12e5e7&&_0x4f3fd1<MAX_MAPPING_CHAIN_DEPTH){_0x12e5e7=_0xc40306[_0x19de85(0x146)](_0x12e5e7),_0x4f3fd1++;}_0x12e5e7!==_0x11d981&&_0xc40306[_0x19de85(0x147)](_0x5432b2,_0x12e5e7);}for(const _0x5127bb of _0x50dc9f){updateSegmentReferences(_0x5127bb[_0x19de85(0x166)],_0xc40306);}const {merged:_0x1234fb,nameMapping:_0x21de16}=consolidateActivationsByContent(_0xdb52d2['map'](_0x591e6c=>_0x591e6c[_0x19de85(0x181)][_0x19de85(0x174)]));for(const _0x49788d of _0x50dc9f){updateActivationReferences(_0x49788d[_0x19de85(0x166)],_0x21de16);}let _0x5e5628=_0x4a3402[_0x19de85(0x186)];if(_0x5e5628?.[_0x19de85(0x157)]){const _0x21aabf=_0xc40306['get'](_0x5e5628[_0x19de85(0x157)]);_0x21aabf&&(_0x5e5628={..._0x5e5628,'segment':_0x21aabf});}for(const _0x40820a of _0x50dc9f){if(_0x40820a['goal']?.['segment']){const _0x432707=_0xc40306[_0x19de85(0x146)](_0x40820a[_0x19de85(0x186)][_0x19de85(0x157)]);_0x432707&&(_0x40820a[_0x19de85(0x186)]={..._0x40820a[_0x19de85(0x186)],'segment':_0x432707});}}return _0x50dc9f['some'](_0x1055e2=>_0x1055e2['goal'])&&(_0x5e5628=undefined),{'type':_0x19de85(0x145),'name':_0x4a3402[_0x19de85(0x177)],'description':_0x4a3402[_0x19de85(0x167)],'goal':_0x5e5628,'reentry':_0x4a3402[_0x19de85(0x15f)],'segments':Object[_0x19de85(0x15c)](_0x66acd9)[_0x19de85(0x175)]>0x0?_0x66acd9:undefined,'activations':Object[_0x19de85(0x15c)](_0x1234fb)[_0x19de85(0x175)]>0x0?_0x1234fb:undefined,'journeys':_0x50dc9f,'bundle_id':_0x4a3402[_0x19de85(0x189)],'bundle_name':_0x4a3402[_0x19de85(0x15e)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x38c47a,_0xde26ce,_0x34d395,_0x54ba17){const _0x533b36=a145_0x4b53,_0x59500b=_0x38c47a+':'+_0xde26ce,_0xc8e139=_0x34d395['get'](_0x59500b);if(_0xc8e139)return _0xc8e139;const _0x34ab57=await _0x54ba17(_0x38c47a),_0x580eb5=_0x34ab57['attributes']['journeyBundleName']||_0x34ab57[_0x533b36(0x156)][_0x533b36(0x177)],_0x1bbe45=_0x34ab57[_0x533b36(0x156)]['journeyStages'][_0x533b36(0x18a)](_0x7daa6a=>String(_0x7daa6a['id'])===String(_0xde26ce)),_0x2eda6d=_0x1bbe45?.[_0x533b36(0x177)]||_0xde26ce,_0x3ed097={'journeyName':_0x580eb5,'stageName':_0x2eda6d};return _0x34d395[_0x533b36(0x147)](_0x59500b,_0x3ed097),_0x3ed097;}export function formatApiJourneyName(_0x4c08bd,_0x334894){return _0x334894+'\x20('+_0x4c08bd+')';}export function isLocalJourneyRef(_0x26cbac){const _0x3355d7=a145_0x4b53;return _0x26cbac[_0x3355d7(0x161)](_0x3355d7(0x18c))||_0x26cbac['endsWith'](_0x3355d7(0x16c));}export function buildLocalRuleToNameMapping(_0x4570b4){const _0x2b1bc9=a145_0x4b53,_0xd035b9=new Map();if(!_0x4570b4)return _0xd035b9;for(const [_0x1051ee,_0x22dda4]of Object['entries'](_0x4570b4)){if(_0x22dda4[_0x2b1bc9(0x183)]){const _0x220473=serializeRule(_0x22dda4[_0x2b1bc9(0x183)]),_0x1a4205=_0xd035b9[_0x2b1bc9(0x146)](_0x220473)||[];_0x1a4205[_0x2b1bc9(0x16f)](_0x1051ee),_0xd035b9[_0x2b1bc9(0x147)](_0x220473,_0x1a4205);}}return _0xd035b9;}export function buildLocalRuleToNameMappingFromJourney(_0x376a76){const _0x549e30=a145_0x4b53,_0x4fdac9=_0x376a76[_0x549e30(0x164)];if(!_0x4fdac9)return new Map();const _0x1aa5e3=collectSegmentUsageCounts(_0x376a76),_0x5c0c81=new Map();let _0x81e173=0x0;for(const [_0xfc438c,_0x54e1d5]of Object['entries'](_0x4fdac9)){if(!_0x54e1d5[_0x549e30(0x183)]){_0x81e173++;continue;}const _0xef0c3f=serializeRule(_0x54e1d5[_0x549e30(0x183)]),_0x36e0af=_0x5c0c81[_0x549e30(0x146)](_0xef0c3f)||[];_0x36e0af[_0x549e30(0x16f)]({'name':_0xfc438c,'index':_0x81e173}),_0x5c0c81[_0x549e30(0x147)](_0xef0c3f,_0x36e0af),_0x81e173++;}const _0x561e36=new Map();for(const [_0x410fbf,_0x19dc34]of _0x5c0c81){const _0x53574b=_0x19dc34[_0x549e30(0x192)]()[_0x549e30(0x14e)]((_0x115e6b,_0x411f15)=>{const _0x587e1d=_0x549e30,_0x3b3122=_0x1aa5e3[_0x587e1d(0x146)](_0x115e6b[_0x587e1d(0x177)])||0x0,_0x8b573=_0x1aa5e3[_0x587e1d(0x146)](_0x411f15[_0x587e1d(0x177)])||0x0;if(_0x3b3122!==_0x8b573)return _0x8b573-_0x3b3122;return _0x115e6b['index']-_0x411f15[_0x587e1d(0x143)];})[_0x549e30(0x16a)](_0x1c1e4d=>_0x1c1e4d[_0x549e30(0x177)]);_0x561e36['set'](_0x410fbf,_0x53574b);}return _0x561e36;}export function collectSegmentUsageCounts(_0x2f9803){const _0x1c4649=a145_0x4b53,_0x4fd647=new Map(),_0x21993d=_0x34d8f9=>{const _0x218ebe=a145_0x4b53;if(!_0x34d8f9)return;_0x4fd647[_0x218ebe(0x147)](_0x34d8f9,(_0x4fd647['get'](_0x34d8f9)||0x0)+0x1);},_0x20a685=_0x379300=>{const _0x5a75af=a145_0x4b53;for(const _0x47326f of _0x379300){_0x21993d(_0x47326f[_0x5a75af(0x152)]?.[_0x5a75af(0x157)]);if(_0x47326f[_0x5a75af(0x149)])for(const _0x32eee6 of _0x47326f[_0x5a75af(0x149)]){_0x21993d(_0x32eee6['segment']);}_0x21993d(_0x47326f['milestone']?.[_0x5a75af(0x157)]);if(_0x47326f[_0x5a75af(0x17b)])for(const _0x428961 of _0x47326f[_0x5a75af(0x17b)]){if(_0x428961['type']===_0x5a75af(0x144))for(const _0x510de2 of _0x428961[_0x5a75af(0x162)][_0x5a75af(0x184)]){_0x21993d(_0x510de2[_0x5a75af(0x157)]);}else _0x428961[_0x5a75af(0x188)]===_0x5a75af(0x163)&&_0x21993d(_0x428961[_0x5a75af(0x162)]['condition']?.[_0x5a75af(0x157)]);}}};_0x21993d(_0x2f9803[_0x1c4649(0x186)]?.['segment']);if(_0x2f9803[_0x1c4649(0x197)])for(const _0x855f8d of _0x2f9803['journeys']){_0x21993d(_0x855f8d[_0x1c4649(0x186)]?.[_0x1c4649(0x157)]),_0x20a685(_0x855f8d['stages']);}_0x2f9803[_0x1c4649(0x166)]&&_0x20a685(_0x2f9803[_0x1c4649(0x166)]);if(_0x2f9803[_0x1c4649(0x18f)])for(const _0x385aee of _0x2f9803[_0x1c4649(0x18f)]){_0x20a685(_0x385aee[_0x1c4649(0x166)]);}return _0x4fd647;}
|
|
1
|
+
(function(_0x12500c,_0x4492db){const _0x566fdf=a145_0xf760,_0x31acaf=_0x12500c();while(!![]){try{const _0x42acae=-parseInt(_0x566fdf(0x180))/0x1*(parseInt(_0x566fdf(0x18f))/0x2)+-parseInt(_0x566fdf(0x179))/0x3+parseInt(_0x566fdf(0x15e))/0x4*(-parseInt(_0x566fdf(0x190))/0x5)+parseInt(_0x566fdf(0x160))/0x6+-parseInt(_0x566fdf(0x148))/0x7+parseInt(_0x566fdf(0x14e))/0x8+parseInt(_0x566fdf(0x17d))/0x9*(parseInt(_0x566fdf(0x163))/0xa);if(_0x42acae===_0x4492db)break;else _0x31acaf['push'](_0x31acaf['shift']());}catch(_0x5ba018){_0x31acaf['push'](_0x31acaf['shift']());}}}(a145_0x1cb0,0xd1702));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x1f3761){const _0x5d2943=a145_0xf760;return _0x1f3761[_0x5d2943(0x14f)]()['replace'](/\s+/g,'_')[_0x5d2943(0x164)](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')[_0x5d2943(0x164)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x5e6ff1){const _0x20267f=a145_0xf760,_0x13c49e=_0x5e6ff1[_0x20267f(0x157)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x13c49e){const _0x40935a=_0x13c49e[0x1][_0x20267f(0x14f)](),_0x15ce8f=_0x13c49e[0x2],_0x378563=_0x15ce8f[_0x20267f(0x164)](/-/g,'')[_0x20267f(0x16c)](0x0,0x4)['toLowerCase']();return _0x40935a+'_'+_0x378563;}const _0x2f15b4=_0x5e6ff1[_0x20267f(0x157)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x2f15b4){const _0x13b756=_0x2f15b4[0x1],_0x2729c0=_0x2f15b4[0x2][_0x20267f(0x14f)](),_0x1e392d=_0x13b756[_0x20267f(0x164)](/-/g,'')[_0x20267f(0x16c)](0x0,0x4)[_0x20267f(0x14f)]();return _0x2729c0+'_'+_0x1e392d;}return undefined;}function stableStringify(_0x2caf0d){const _0x213fcc=a145_0xf760;if(Array[_0x213fcc(0x144)](_0x2caf0d))return'['+_0x2caf0d['map'](_0x8bf876=>stableStringify(_0x8bf876))[_0x213fcc(0x14d)](',')+']';if(_0x2caf0d&&typeof _0x2caf0d==='object'){const _0x420d0b=_0x2caf0d,_0x4d80bd=Object[_0x213fcc(0x184)](_0x420d0b)[_0x213fcc(0x14c)](),_0x5da0b9=_0x4d80bd[_0x213fcc(0x17e)](_0xf637c2=>'\x22'+_0xf637c2+'\x22:'+stableStringify(_0x420d0b[_0xf637c2]));return'{'+_0x5da0b9[_0x213fcc(0x14d)](',')+'}';}const _0x3e40b9=JSON['stringify'](_0x2caf0d);return _0x3e40b9===undefined?_0x213fcc(0x156):_0x3e40b9;}export function consolidateActivationsByContent(_0xc644ed){const _0x289dbf=a145_0xf760,_0x367724={},_0xe88997=new Map(),_0x5ad5d5=new Map();for(const _0x11d3f8 of _0xc644ed){if(!_0x11d3f8)continue;for(const [_0x2ce46c,_0x5c903b]of Object[_0x289dbf(0x174)](_0x11d3f8)){const _0x395432={'name':_0x5c903b[_0x289dbf(0x168)],'connection':_0x5c903b[_0x289dbf(0x153)],..._0x5c903b['all_columns']!==undefined&&{'all_columns':_0x5c903b[_0x289dbf(0x152)]},..._0x5c903b[_0x289dbf(0x159)]!==undefined&&{'columns':_0x5c903b[_0x289dbf(0x159)]},..._0x5c903b[_0x289dbf(0x145)]!==undefined&&{'behavior':_0x5c903b[_0x289dbf(0x145)]},..._0x5c903b[_0x289dbf(0x176)]!==undefined&&{'schedule':_0x5c903b[_0x289dbf(0x176)]},..._0x5c903b['notification']!==undefined&&{'notification':_0x5c903b['notification']},..._0x5c903b[_0x289dbf(0x17b)]!==undefined&&{'connector_config':_0x5c903b[_0x289dbf(0x17b)]},..._0x5c903b[_0x289dbf(0x15d)]!==undefined&&{'activation_template_id':_0x5c903b['activation_template_id']}},_0x2eb8d6=stableStringify(_0x395432),_0x46c0a0=_0x5ad5d5[_0x289dbf(0x192)](_0x2eb8d6);_0x46c0a0?_0xe88997[_0x289dbf(0x191)](_0x2ce46c,_0x46c0a0):(_0x367724[_0x2ce46c]=_0x5c903b,_0xe88997[_0x289dbf(0x191)](_0x2ce46c,_0x2ce46c),_0x5ad5d5[_0x289dbf(0x191)](_0x2eb8d6,_0x2ce46c));}}return{'merged':_0x367724,'nameMapping':_0xe88997};}function a145_0x1cb0(){const _0x4ff2a0=['columns','attributes','reentry','journeys','activation_template_id','1580ywSBzK','version','686856FUArsT','length','versions','40EniJIy','replace','stages','some','milestone','name','index','entry_criteria','wait','slice','find','version_number','goal','.yaml','rule','from','string','entries','draft','schedule','with','journeyStages','5101674qXzRSI','condition','connector_config','type','5097159eTFlgF','map','journey','143016zgeozb','launched','bundle_id','stringify','keys','decision_point','bundle_name','segment','endsWith','item','push','yaml','steps','state','startsWith','2dTryZC','1890CqXxlg','set','get','isArray','behavior','branches','trim','5483436soReAb','description','object','exit_criteria','sort','join','10033680xvCsiS','toLowerCase','activation','exclude','all_columns','connection','journeyBundleName','has','null','match','conditions'];a145_0x1cb0=function(){return _0x4ff2a0;};return a145_0x1cb0();}export function updateActivationReferences(_0x46d487,_0x513d1c){const _0x2e519a=a145_0xf760;if(!_0x46d487)return;for(const _0x1aff72 of _0x46d487){if(!_0x1aff72['steps'])continue;for(const _0x1242ca of _0x1aff72[_0x2e519a(0x18c)]){if(_0x1242ca[_0x2e519a(0x17c)]==='activation'&&_0x1242ca[_0x2e519a(0x177)]?.['activation']){const _0x21315c=_0x513d1c[_0x2e519a(0x192)](_0x1242ca[_0x2e519a(0x177)][_0x2e519a(0x150)]);_0x21315c&&_0x21315c!==_0x1242ca[_0x2e519a(0x177)][_0x2e519a(0x150)]&&(_0x1242ca[_0x2e519a(0x177)][_0x2e519a(0x150)]=_0x21315c);}}}}export function consolidateSegmentsByContent(_0x3b2825,_0x5b8ca7){const _0xef0378=a145_0xf760,_0x1b5dc7={},_0x18a27e=new Map(),_0x2bb710=new Map();for(const _0x3584fe of _0x3b2825){if(!_0x3584fe)continue;for(const [_0x43464f,_0xed2a24]of Object['entries'](_0x3584fe)){if(!_0xed2a24['rule']){_0x1b5dc7[_0x43464f]=_0xed2a24,_0x18a27e[_0xef0378(0x191)](_0x43464f,_0x43464f);continue;}const _0x2f161f=_0xed2a24[_0xef0378(0x149)]&&_0xed2a24[_0xef0378(0x149)][_0xef0378(0x147)]()?_0xed2a24[_0xef0378(0x149)]:undefined,_0x2f9913=JSON[_0xef0378(0x183)]({'description':_0x2f161f,'rule':deepSortObject(_0xed2a24[_0xef0378(0x171)])}),_0x499e61=_0x2bb710[_0xef0378(0x192)](_0x2f9913);if(_0x499e61){const _0x36c215={..._0xed2a24[_0xef0378(0x149)]!==undefined&&{'description':_0xed2a24[_0xef0378(0x149)]},'rule':_0xed2a24[_0xef0378(0x171)]?deepSortObject(_0xed2a24[_0xef0378(0x171)]):_0xed2a24[_0xef0378(0x171)]};if(_0x43464f<_0x499e61){_0x1b5dc7[_0x43464f]=_0x36c215,delete _0x1b5dc7[_0x499e61];for(const [_0xa5c3e1,_0x42c8b4]of _0x18a27e[_0xef0378(0x174)]()){_0x42c8b4===_0x499e61&&_0x18a27e[_0xef0378(0x191)](_0xa5c3e1,_0x43464f);}_0x18a27e[_0xef0378(0x191)](_0x43464f,_0x43464f),_0x2bb710[_0xef0378(0x191)](_0x2f9913,_0x43464f);}else _0x1b5dc7[_0x499e61]=_0x36c215,_0x18a27e[_0xef0378(0x191)](_0x43464f,_0x499e61);}else{let _0x39490a=_0x43464f;if(_0x5b8ca7){const _0x188521=_0x5b8ca7[_0xef0378(0x192)](_0x2f9913);_0x188521&&_0x188521[_0xef0378(0x161)]>0x0&&(_0x39490a=_0x188521[_0xef0378(0x16c)]()['sort']()[0x0]);}const _0x35b07c={..._0xed2a24[_0xef0378(0x149)]!==undefined&&{'description':_0xed2a24['description']},'rule':_0xed2a24['rule']?deepSortObject(_0xed2a24['rule']):_0xed2a24['rule']};_0x1b5dc7[_0x39490a]=_0x35b07c,_0x18a27e[_0xef0378(0x191)](_0x43464f,_0x39490a),_0x2bb710[_0xef0378(0x191)](_0x2f9913,_0x39490a);}}}return{'merged':_0x1b5dc7,'nameMapping':_0x18a27e};}export function updateSegmentReferences(_0x502f56,_0x3b9fa7){const _0x5d0e3e=a145_0xf760;if(!_0x502f56)return;for(const _0x485dae of _0x502f56){if(_0x485dae['entry_criteria']?.['segment']){const _0x34875f=_0x3b9fa7['get'](_0x485dae[_0x5d0e3e(0x16a)][_0x5d0e3e(0x187)]);_0x34875f&&(_0x485dae[_0x5d0e3e(0x16a)][_0x5d0e3e(0x187)]=_0x34875f);}if(_0x485dae[_0x5d0e3e(0x14b)])for(const _0x1e383e of _0x485dae[_0x5d0e3e(0x14b)]){if(_0x1e383e['segment']){const _0x516556=_0x3b9fa7[_0x5d0e3e(0x192)](_0x1e383e['segment']);_0x516556&&(_0x1e383e['segment']=_0x516556);}}if(_0x485dae['milestone']?.[_0x5d0e3e(0x187)]){const _0x1f5be9=_0x3b9fa7[_0x5d0e3e(0x192)](_0x485dae[_0x5d0e3e(0x167)][_0x5d0e3e(0x187)]);_0x1f5be9&&(_0x485dae['milestone'][_0x5d0e3e(0x187)]=_0x1f5be9);}if(_0x485dae[_0x5d0e3e(0x18c)])for(const _0x2c7d23 of _0x485dae[_0x5d0e3e(0x18c)]){if(_0x2c7d23[_0x5d0e3e(0x17c)]===_0x5d0e3e(0x185)&&_0x2c7d23['with']?.[_0x5d0e3e(0x146)])for(const _0x3c031e of _0x2c7d23[_0x5d0e3e(0x177)][_0x5d0e3e(0x146)]){if(_0x3c031e[_0x5d0e3e(0x187)]){const _0x33f1c5=_0x3b9fa7[_0x5d0e3e(0x192)](_0x3c031e[_0x5d0e3e(0x187)]);_0x33f1c5&&(_0x3c031e[_0x5d0e3e(0x187)]=_0x33f1c5);}}if(_0x2c7d23[_0x5d0e3e(0x17c)]===_0x5d0e3e(0x16b)&&_0x2c7d23[_0x5d0e3e(0x177)]?.[_0x5d0e3e(0x17a)]?.[_0x5d0e3e(0x187)]){const _0x35fec7=_0x3b9fa7[_0x5d0e3e(0x192)](_0x2c7d23[_0x5d0e3e(0x177)][_0x5d0e3e(0x17a)][_0x5d0e3e(0x187)]);_0x35fec7&&(_0x2c7d23[_0x5d0e3e(0x177)][_0x5d0e3e(0x17a)]['segment']=_0x35fec7);}}}}export function updateSegmentRefsInSegments(_0x5909df,_0x225c47){const _0x4ef93f=a145_0xf760;for(const _0x1a44d4 of Object['values'](_0x5909df)){_0x1a44d4[_0x4ef93f(0x171)]&&updateSegmentRefsInRule(_0x1a44d4[_0x4ef93f(0x171)],_0x225c47);}}function updateSegmentRefsInRule(_0x1533cb,_0x2c0b4c){const _0x3e4c67=a145_0xf760;if(_0x1533cb===null||typeof _0x1533cb!==_0x3e4c67(0x14a))return;if(Array[_0x3e4c67(0x144)](_0x1533cb)){for(const _0x41408f of _0x1533cb){updateSegmentRefsInRule(_0x41408f,_0x2c0b4c);}return;}const _0x3e12d8=_0x1533cb;if((_0x3e12d8[_0x3e4c67(0x17c)]==='include'||_0x3e12d8[_0x3e4c67(0x17c)]===_0x3e4c67(0x151))&&typeof _0x3e12d8[_0x3e4c67(0x187)]===_0x3e4c67(0x173)){const _0x256135=_0x2c0b4c[_0x3e4c67(0x192)](_0x3e12d8[_0x3e4c67(0x187)]);_0x256135&&(_0x3e12d8[_0x3e4c67(0x187)]=_0x256135);}if(_0x3e12d8['conditions']&&Array[_0x3e4c67(0x144)](_0x3e12d8['conditions']))for(const _0x19af66 of _0x3e12d8[_0x3e4c67(0x158)]){updateSegmentRefsInRule(_0x19af66,_0x2c0b4c);}}export function buildJourneysArray(_0x5d0afc,_0x5408ae){const _0x49d9c2=a145_0xf760;return _0x5d0afc[_0x49d9c2(0x17e)](_0x10c442=>{const _0x217074=_0x49d9c2,_0x48196e=_0x5408ae?_0x10c442[_0x217074(0x189)]['id']===_0x5408ae:_0x5d0afc[_0x217074(0x161)]===0x1,_0x4b7ff4=_0x10c442[_0x217074(0x18b)]['journeys']?.[0x0],_0x27e025=_0x4b7ff4?.['goal']||_0x10c442['yaml'][_0x217074(0x16f)],_0x5afcd7={'version':_0x4b7ff4?.[_0x217074(0x15f)]||_0x10c442[_0x217074(0x18b)][_0x217074(0x15f)]||_0x10c442[_0x217074(0x189)][_0x217074(0x168)],'state':_0x10c442[_0x217074(0x189)][_0x217074(0x18d)]==='launched'?_0x217074(0x181):_0x217074(0x175),'stages':_0x4b7ff4?.['stages']||_0x10c442[_0x217074(0x18b)][_0x217074(0x165)]||[],'id':_0x4b7ff4?.['id']||_0x10c442['yaml']['id'],'version_number':_0x4b7ff4?.[_0x217074(0x16e)]||_0x10c442[_0x217074(0x18b)]['version_number']};return _0x27e025&&(_0x5afcd7['goal']=_0x27e025),_0x48196e&&(_0x5afcd7['latest']=!![]),_0x5afcd7;});}export function buildMergedJourneyDef(_0x2427ea,_0x24e880,_0x2138cd){const _0x162326=a145_0xf760,_0xbc81f=_0x2427ea[0x0][_0x162326(0x18b)],_0x174d5a=buildJourneysArray(_0x2427ea,_0x2138cd),{merged:_0x380dba,nameMapping:_0x761b1c}=consolidateSegmentsByContent(_0x2427ea['map'](_0x24caac=>_0x24caac[_0x162326(0x18b)]['segments']),_0x24e880);updateSegmentRefsInSegments(_0x380dba,_0x761b1c);const _0x1fd2c2=Array[_0x162326(0x172)](_0x761b1c[_0x162326(0x174)]())[_0x162326(0x166)](([_0x3d83b5,_0x141099])=>_0x3d83b5!==_0x141099&&_0x3d83b5[_0x162326(0x18e)](_0x162326(0x16a)));let _0xedc843=_0x380dba,_0x1ec679=new Map();if(_0x1fd2c2){const _0x3dbd32=consolidateSegmentsByContent([_0x380dba],_0x24e880);_0xedc843=_0x3dbd32['merged'],_0x1ec679=_0x3dbd32['nameMapping'];}const _0x7b8a97=new Map(_0x761b1c);for(const [_0x2ca45f,_0x74e329]of _0x1ec679['entries']()){_0x7b8a97[_0x162326(0x191)](_0x2ca45f,_0x74e329);}for(const [_0x43b8a1,_0x12d879]of _0x7b8a97[_0x162326(0x174)]()){let _0xdb4807=_0x12d879,_0x4e3f25=0x0;while(_0x7b8a97[_0x162326(0x155)](_0xdb4807)&&_0x7b8a97[_0x162326(0x192)](_0xdb4807)!==_0xdb4807&&_0x4e3f25<MAX_MAPPING_CHAIN_DEPTH){_0xdb4807=_0x7b8a97[_0x162326(0x192)](_0xdb4807),_0x4e3f25++;}_0xdb4807!==_0x12d879&&_0x7b8a97[_0x162326(0x191)](_0x43b8a1,_0xdb4807);}for(const _0x4028a8 of _0x174d5a){updateSegmentReferences(_0x4028a8[_0x162326(0x165)],_0x7b8a97);}const {merged:_0x2eefaf,nameMapping:_0x3b9735}=consolidateActivationsByContent(_0x2427ea['map'](_0x50d5fd=>_0x50d5fd['yaml']['activations']));for(const _0x1cce63 of _0x174d5a){updateActivationReferences(_0x1cce63[_0x162326(0x165)],_0x3b9735);}let _0x3d6cac=_0xbc81f[_0x162326(0x16f)];if(_0x3d6cac?.[_0x162326(0x187)]){const _0x4e7395=_0x7b8a97[_0x162326(0x192)](_0x3d6cac['segment']);_0x4e7395&&(_0x3d6cac={..._0x3d6cac,'segment':_0x4e7395});}for(const _0x359cff of _0x174d5a){if(_0x359cff['goal']?.[_0x162326(0x187)]){const _0x429e2d=_0x7b8a97[_0x162326(0x192)](_0x359cff['goal']['segment']);_0x429e2d&&(_0x359cff[_0x162326(0x16f)]={..._0x359cff['goal'],'segment':_0x429e2d});}}return _0x174d5a['some'](_0x5ad296=>_0x5ad296[_0x162326(0x16f)])&&(_0x3d6cac=undefined),{'type':_0x162326(0x17f),'name':_0xbc81f[_0x162326(0x168)],'description':_0xbc81f['description'],'goal':_0x3d6cac,'reentry':_0xbc81f[_0x162326(0x15b)],'segments':Object[_0x162326(0x184)](_0xedc843)[_0x162326(0x161)]>0x0?_0xedc843:undefined,'activations':Object[_0x162326(0x184)](_0x2eefaf)['length']>0x0?_0x2eefaf:undefined,'journeys':_0x174d5a,'bundle_id':_0xbc81f[_0x162326(0x182)],'bundle_name':_0xbc81f[_0x162326(0x186)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x6bd1f,_0x5e4a65,_0x2d997a,_0x24f236){const _0x347500=a145_0xf760,_0x2be2b4=_0x6bd1f+':'+_0x5e4a65,_0x139868=_0x2d997a['get'](_0x2be2b4);if(_0x139868)return _0x139868;const _0x3d1d40=await _0x24f236(_0x6bd1f),_0x40d10c=_0x3d1d40['attributes'][_0x347500(0x154)]||_0x3d1d40['attributes']['name'],_0x522a3e=_0x3d1d40[_0x347500(0x15a)][_0x347500(0x178)][_0x347500(0x16d)](_0x57d08c=>String(_0x57d08c['id'])===String(_0x5e4a65)),_0x36c5f1=_0x522a3e?.['name']||_0x5e4a65,_0x4a246c={'journeyName':_0x40d10c,'stageName':_0x36c5f1};return _0x2d997a[_0x347500(0x191)](_0x2be2b4,_0x4a246c),_0x4a246c;}export function formatApiJourneyName(_0xdfa0c1,_0x14e1e2){return _0x14e1e2+'\x20('+_0xdfa0c1+')';}export function isLocalJourneyRef(_0x4b062e){const _0x3afa84=a145_0xf760;return _0x4b062e[_0x3afa84(0x188)]('.yml')||_0x4b062e[_0x3afa84(0x188)](_0x3afa84(0x170));}export function buildLocalRuleToNameMapping(_0x16e9b6){const _0x2dc1c1=a145_0xf760,_0x228acb=new Map();if(!_0x16e9b6)return _0x228acb;for(const [_0x2ec92d,_0x1cd2b2]of Object['entries'](_0x16e9b6)){if(_0x1cd2b2[_0x2dc1c1(0x171)]){const _0x2ae81b=serializeRule(_0x1cd2b2[_0x2dc1c1(0x171)]),_0x1dc1d2=_0x228acb[_0x2dc1c1(0x192)](_0x2ae81b)||[];_0x1dc1d2[_0x2dc1c1(0x18a)](_0x2ec92d),_0x228acb[_0x2dc1c1(0x191)](_0x2ae81b,_0x1dc1d2);}}return _0x228acb;}export function buildLocalRuleToNameMappingFromJourney(_0x20e6ba){const _0x210f87=a145_0xf760,_0x203883=_0x20e6ba['segments'];if(!_0x203883)return new Map();const _0x5f4a08=collectSegmentUsageCounts(_0x20e6ba),_0x536c3c=new Map();let _0x10aad8=0x0;for(const [_0x498736,_0x4d6f24]of Object[_0x210f87(0x174)](_0x203883)){if(!_0x4d6f24[_0x210f87(0x171)]){_0x10aad8++;continue;}const _0x349672=serializeRule(_0x4d6f24[_0x210f87(0x171)]),_0x5d0d6c=_0x536c3c[_0x210f87(0x192)](_0x349672)||[];_0x5d0d6c['push']({'name':_0x498736,'index':_0x10aad8}),_0x536c3c[_0x210f87(0x191)](_0x349672,_0x5d0d6c),_0x10aad8++;}const _0xea3625=new Map();for(const [_0x4c1afc,_0x45d407]of _0x536c3c){const _0x1c4176=_0x45d407[_0x210f87(0x16c)]()[_0x210f87(0x14c)]((_0x443a04,_0x4b0a54)=>{const _0x177cbc=_0x210f87,_0x1e0391=_0x5f4a08[_0x177cbc(0x192)](_0x443a04[_0x177cbc(0x168)])||0x0,_0x186232=_0x5f4a08['get'](_0x4b0a54['name'])||0x0;if(_0x1e0391!==_0x186232)return _0x186232-_0x1e0391;return _0x443a04[_0x177cbc(0x169)]-_0x4b0a54['index'];})['map'](_0x282ef9=>_0x282ef9[_0x210f87(0x168)]);_0xea3625[_0x210f87(0x191)](_0x4c1afc,_0x1c4176);}return _0xea3625;}function a145_0xf760(_0x13520b,_0x357ce5){_0x13520b=_0x13520b-0x144;const _0x1cb0d0=a145_0x1cb0();let _0xf76048=_0x1cb0d0[_0x13520b];return _0xf76048;}export function collectSegmentUsageCounts(_0x489154){const _0x2530ed=a145_0xf760,_0x118771=new Map(),_0x7886bc=_0x3f3a33=>{const _0x257ee6=a145_0xf760;if(!_0x3f3a33)return;_0x118771[_0x257ee6(0x191)](_0x3f3a33,(_0x118771[_0x257ee6(0x192)](_0x3f3a33)||0x0)+0x1);},_0x368833=_0x5b32df=>{const _0x5525ce=a145_0xf760;for(const _0x4164f1 of _0x5b32df){_0x7886bc(_0x4164f1['entry_criteria']?.[_0x5525ce(0x187)]);if(_0x4164f1['exit_criteria'])for(const _0x236b7c of _0x4164f1[_0x5525ce(0x14b)]){_0x7886bc(_0x236b7c[_0x5525ce(0x187)]);}_0x7886bc(_0x4164f1[_0x5525ce(0x167)]?.[_0x5525ce(0x187)]);if(_0x4164f1[_0x5525ce(0x18c)])for(const _0x4ce0b1 of _0x4164f1[_0x5525ce(0x18c)]){if(_0x4ce0b1['type']===_0x5525ce(0x185))for(const _0x564f98 of _0x4ce0b1['with'][_0x5525ce(0x146)]){_0x7886bc(_0x564f98[_0x5525ce(0x187)]);}else _0x4ce0b1['type']===_0x5525ce(0x16b)&&_0x7886bc(_0x4ce0b1['with'][_0x5525ce(0x17a)]?.[_0x5525ce(0x187)]);}}};_0x7886bc(_0x489154[_0x2530ed(0x16f)]?.[_0x2530ed(0x187)]);if(_0x489154[_0x2530ed(0x15c)])for(const _0x30e0cf of _0x489154[_0x2530ed(0x15c)]){_0x7886bc(_0x30e0cf[_0x2530ed(0x16f)]?.[_0x2530ed(0x187)]),_0x368833(_0x30e0cf[_0x2530ed(0x165)]);}_0x489154[_0x2530ed(0x165)]&&_0x368833(_0x489154[_0x2530ed(0x165)]);if(_0x489154[_0x2530ed(0x162)])for(const _0x317ea1 of _0x489154[_0x2530ed(0x162)]){_0x368833(_0x317ea1[_0x2530ed(0x165)]);}return _0x118771;}
|