@treasuredata/tdx 2026.7.3 → 2026.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.d.ts.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-command.js.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +67 -0
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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.d.ts +11 -0
- package/dist/commands/describe.d.ts.map +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/describe.js.map +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.d.ts.map +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/job-command.js.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.d.ts.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-command.js.map +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-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-api-client.js.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +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.d.ts +47 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +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.d.ts +6 -6
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +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.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.d.ts +9 -1
- package/dist/sdk/query/index.d.ts.map +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/index.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js.map +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.d.ts.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/target-resolution.js.map +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.d.ts.map +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/parent-segment-def.d.ts.map +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/cas.d.ts +5 -0
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +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/util/tree-search.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/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.d.ts +33 -0
- package/dist/utils/claude-code-state.d.ts.map +1 -0
- package/dist/utils/claude-code-state.js +1 -0
- package/dist/utils/claude-code-state.js.map +1 -0
- 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/proxy-fetch.js +1 -1
- package/dist/utils/proxy-fetch.js.map +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 +18 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
const a149_0x2d6e43=a149_0x1ffa;(function(_0x216771,_0x741f75){const _0x175a2a=a149_0x1ffa,_0x508048=_0x216771();while(!![]){try{const _0x5131bb=-parseInt(_0x175a2a(0x1fd))/0x1+-parseInt(_0x175a2a(0x216))/0x2+parseInt(_0x175a2a(0x255))/0x3+parseInt(_0x175a2a(0x1d1))/0x4*(-parseInt(_0x175a2a(0x1e4))/0x5)+parseInt(_0x175a2a(0x1d4))/0x6*(-parseInt(_0x175a2a(0x269))/0x7)+parseInt(_0x175a2a(0x221))/0x8*(parseInt(_0x175a2a(0x1d5))/0x9)+parseInt(_0x175a2a(0x26a))/0xa*(parseInt(_0x175a2a(0x1ef))/0xb);if(_0x5131bb===_0x741f75)break;else _0x508048['push'](_0x508048['shift']());}catch(_0x5760b0){_0x508048['push'](_0x508048['shift']());}}}(a149_0xcfbc,0x85517));import*as a149_0x4b8a7a 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';function a149_0x1ffa(_0x52b9f8,_0x460cf4){_0x52b9f8=_0x52b9f8-0x1b2;const _0xcfbcf=a149_0xcfbc();let _0x1ffa0d=_0xcfbcf[_0x52b9f8];return _0x1ffa0d;}import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a149_0x2d6e43(0x26d),'hourly':a149_0x2d6e43(0x239),'weekly':a149_0x2d6e43(0x20d),'monthly':a149_0x2d6e43(0x220),'minutes_interval':a149_0x2d6e43(0x1cc)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a149_0x2d6e43(0x25d),'hour':a149_0x2d6e43(0x265),'week':a149_0x2d6e43(0x24f),'month':'monthly','minute':'minutes_interval'};function filterRuleAsRuleDef(_0x20687a){return _0x20687a;}function ruleDefAsFilterRule(_0x4037be){return _0x4037be;}export function segmentResponseToDefSync(_0x59dabc,_0xfb97f8){const _0x1af7da=a149_0x2d6e43,_0x194cac=_0x59dabc[_0x1af7da(0x22d)]&&'type'in _0x59dabc[_0x1af7da(0x22d)]&&_0x59dabc['rule'][_0x1af7da(0x23c)];return{'type':_0x1af7da(0x23b),'name':_0x59dabc['name'],..._0x59dabc[_0x1af7da(0x1b9)]&&{'description':_0x59dabc[_0x1af7da(0x1b9)]},..._0xfb97f8&&{'folder':_0xfb97f8},..._0x194cac&&{'rule':apiRuleToYaml(_0x59dabc[_0x1af7da(0x22d)])},..._0x59dabc[_0x1af7da(0x25f)]!==undefined&&{'kind':_0x59dabc[_0x1af7da(0x25f)]===0x0?_0x1af7da(0x211):_0x59dabc[_0x1af7da(0x25f)]===0x1?_0x1af7da(0x24a):_0x1af7da(0x207)},..._0x59dabc[_0x1af7da(0x205)]!==undefined&&{'visible':_0x59dabc[_0x1af7da(0x205)]}};}export async function segmentResponseToDef(_0x3e3956,_0x1264d0,_0x374bc4){const _0x5860d6=a149_0x2d6e43,_0x1582a9=segmentResponseToDefSync(_0x3e3956,_0x374bc4);if(!_0x1264d0||!_0x1264d0[_0x5860d6(0x238)])return _0x1582a9;return _0x1582a9[_0x5860d6(0x22d)]&&(_0x1582a9[_0x5860d6(0x22d)]=await resolveRuleSegmentRefs(_0x1582a9[_0x5860d6(0x22d)],_0x1264d0[_0x5860d6(0x238)])),_0x1582a9;}export function apiRuleToYaml(_0x49a43a){const _0x5206fa=a149_0x2d6e43;if(_0x49a43a[_0x5206fa(0x23c)]==='Composite')return{'type':_0x5206fa(0x20b),'conditions':(_0x49a43a[_0x5206fa(0x212)]||[])['map'](apiConditionToYaml),..._0x49a43a['description']!==undefined&&{'description':_0x49a43a['description']},..._0x49a43a[_0x5206fa(0x209)]!==undefined&&{'expr':_0x49a43a[_0x5206fa(0x209)]}};const _0x48f021=(_0x49a43a[_0x5206fa(0x212)]||[])[_0x5206fa(0x1da)](_0x2daa75=>{const _0x35cde1=_0x5206fa,_0x39592e=apiConditionToYaml(_0x2daa75);if(isCompositeType(_0x39592e)&&_0x39592e[_0x35cde1(0x1b9)]!==undefined){const _0x2c5eec=_0x39592e;if(_0x2c5eec[_0x35cde1(0x212)][_0x35cde1(0x1f4)]===0x1)return _0x2c5eec[_0x35cde1(0x212)];return[{'type':_0x2c5eec[_0x35cde1(0x23c)],'conditions':_0x2c5eec['conditions']}];}return[_0x39592e];});if(_0x48f021[_0x5206fa(0x1f4)]===0x1&&!_0x49a43a[_0x5206fa(0x1b9)]&&isCompositeType(_0x48f021[0x0])){const _0x9f2e94=_0x48f021[0x0];if(_0x9f2e94[_0x5206fa(0x23c)]===_0x49a43a[_0x5206fa(0x23c)]&&_0x9f2e94['conditions']&&_0x9f2e94['description']===undefined)return{'type':_0x49a43a[_0x5206fa(0x23c)],'conditions':_0x9f2e94[_0x5206fa(0x212)]};}return{'type':_0x49a43a[_0x5206fa(0x23c)],'conditions':_0x48f021};}export async function resolveRuleSegmentRefs(_0x34259c,_0x12d897){const _0x321bf6=a149_0x2d6e43;return transformRuleSegmentRefs(_0x34259c,_0x12d897,_0x2b44ee=>/^\d+$/[_0x321bf6(0x203)](_0x2b44ee));}async function transformConditionSegmentRefs(_0xc3351d,_0x1f0003,_0x5308b9,_0x3ef63f){const _0x487734=a149_0x2d6e43;if(_0x487734(0x23b)in _0xc3351d&&(_0xc3351d[_0x487734(0x23c)]===_0x487734(0x1e8)||_0xc3351d[_0x487734(0x23c)]==='exclude')){const _0x499c9a=_0xc3351d;if(_0x5308b9(_0x499c9a[_0x487734(0x23b)]))return{..._0x499c9a,'segment':await _0x1f0003(_0x499c9a[_0x487734(0x23b)])};return _0xc3351d;}if(_0x487734(0x212)in _0xc3351d&&_0xc3351d[_0x487734(0x212)]){const _0x3cad92=_0xc3351d,_0x1abb43=await Promise['all'](_0x3cad92['conditions'][_0x487734(0x219)](_0x3f64ae=>transformConditionSegmentRefs(_0x3f64ae,_0x1f0003,_0x5308b9,_0x3ef63f)));return{..._0x3cad92,'conditions':_0x1abb43};}if(_0x487734(0x228)in _0xc3351d&&_0xc3351d['filter']){const _0x34f135=_0xc3351d,_0x40215c=await _0x3ef63f(filterRuleAsRuleDef(_0x34f135['filter']),_0x1f0003);return{..._0x34f135,'filter':ruleDefAsFilterRule(_0x40215c)};}return _0xc3351d;}async function transformRuleSegmentRefs(_0x2f63e4,_0xf63d99,_0x692fa6){const _0x483006=a149_0x2d6e43,_0x3d4f88=(_0x3cab51,_0x4b0993)=>transformRuleSegmentRefs(_0x3cab51,_0x4b0993,_0x692fa6),_0x1a80e6=await Promise[_0x483006(0x24e)](_0x2f63e4['conditions']['map'](_0x19ad3a=>transformConditionSegmentRefs(_0x19ad3a,_0xf63d99,_0x692fa6,_0x3d4f88)));return{..._0x2f63e4,'conditions':_0x1a80e6};}export async function resolveRuleSegmentIds(_0xf55275,_0x257a27){const _0x512fb6=a149_0x2d6e43;return transformRuleSegmentRefs(_0xf55275,_0x257a27,_0x2439a5=>!/^\d+$/[_0x512fb6(0x203)](_0x2439a5));}function isCompositeType(_0x2fe893){const _0x2cf2ea=a149_0x2d6e43;return _0x2fe893[_0x2cf2ea(0x23c)]===_0x2cf2ea(0x225)||_0x2fe893['type']==='Or'||_0x2fe893['type']==='Composite';}function isBehaviorApiCondition(_0x350612){const _0x385ab8=a149_0x2d6e43;if(!_0x350612[_0x385ab8(0x1e9)]?.[_0x385ab8(0x24d)]?.['name'])return![];return!![];}function apiConditionToYaml(_0x290726){const _0x29754e=a149_0x2d6e43;if(_0x290726[_0x29754e(0x23c)]===_0x29754e(0x225)||_0x290726['type']==='Or'){if(_0x290726[_0x29754e(0x212)]){const _0x30f131=_0x290726[_0x29754e(0x212)][_0x29754e(0x219)](apiConditionToYaml),_0x144e29=_0x290726['description']!==undefined;if(_0x30f131[_0x29754e(0x1f4)]===0x1&&!_0x144e29)return _0x30f131[0x0];return{'type':_0x290726[_0x29754e(0x23c)],'conditions':_0x30f131,..._0x290726[_0x29754e(0x1b9)]!==undefined&&{'description':_0x290726[_0x29754e(0x1b9)]}};}}if(_0x290726[_0x29754e(0x23c)]==='Composite'&&_0x290726[_0x29754e(0x212)])return{'type':_0x29754e(0x20b),'conditions':_0x290726[_0x29754e(0x212)]['map'](apiConditionToYaml),..._0x290726[_0x29754e(0x1b9)]!==undefined&&{'description':_0x290726[_0x29754e(0x1b9)]},..._0x290726[_0x29754e(0x209)]!==undefined&&{'expr':_0x290726[_0x29754e(0x209)]}};if(_0x290726[_0x29754e(0x23c)]===_0x29754e(0x1d2)&&_0x290726[_0x29754e(0x1e9)]&&_0x290726['operator']){const _0x19a479=_0x290726[_0x29754e(0x1e9)][_0x29754e(0x210)]?buildAggregationDefFromApi(_0x290726[_0x29754e(0x1e9)][_0x29754e(0x210)]):undefined;if(isBehaviorApiCondition(_0x290726)){const _0x28c279=_0x290726[_0x29754e(0x1e9)]['source'][_0x29754e(0x1f6)];return{'type':_0x29754e(0x234),'attribute':'','operator':apiOperatorToYaml(_0x290726[_0x29754e(0x1c2)]),..._0x290726['arrayMatching']&&_0x290726[_0x29754e(0x1b4)]!==_0x29754e(0x229)?{'arrayMatching':_0x290726[_0x29754e(0x1b4)]}:{},..._0x290726[_0x29754e(0x243)]?{'exclude':_0x290726[_0x29754e(0x243)]}:{},..._0x19a479?{'aggregation':_0x19a479}:{},'source':_0x28c279,..._0x290726[_0x29754e(0x1e9)][_0x29754e(0x228)]?{'filter':apiRuleToYaml(_0x290726[_0x29754e(0x1e9)][_0x29754e(0x228)])}:{},..._0x290726[_0x29754e(0x204)]!==undefined&&_0x290726[_0x29754e(0x204)]!==null?{'limit':_0x290726[_0x29754e(0x204)]}:{}};}return{'type':_0x29754e(0x1d2),'attribute':_0x290726[_0x29754e(0x1e9)][_0x29754e(0x1f6)]||'','operator':apiOperatorToYaml(_0x290726[_0x29754e(0x1c2)]),..._0x290726[_0x29754e(0x1b4)]&&_0x290726[_0x29754e(0x1b4)]!==_0x29754e(0x229)?{'arrayMatching':_0x290726[_0x29754e(0x1b4)]}:{},..._0x290726[_0x29754e(0x243)]?{'exclude':_0x290726[_0x29754e(0x243)]}:{},..._0x19a479?{'aggregation':_0x19a479}:{},..._0x290726[_0x29754e(0x1e9)][_0x29754e(0x228)]?{'filter':apiRuleToYaml(_0x290726[_0x29754e(0x1e9)]['filter'])}:{},..._0x290726[_0x29754e(0x204)]!==undefined&&_0x290726['limit']!==null?{'limit':_0x290726[_0x29754e(0x204)]}:{}};}if(_0x290726[_0x29754e(0x23c)]==='Column'&&_0x290726[_0x29754e(0x24b)]&&_0x290726['operator'])return{'type':_0x29754e(0x1fa),'column':_0x290726[_0x29754e(0x24b)],'operator':apiOperatorToYaml(_0x290726[_0x29754e(0x1c2)])};if(_0x290726[_0x29754e(0x23c)]===_0x29754e(0x206)&&_0x290726['id'])return{'type':_0x290726[_0x29754e(0x243)]?_0x29754e(0x243):'include','segment':_0x290726['id']};return{'type':_0x29754e(0x225),'conditions':[]};}function isTemporalOperator(_0x307df0){const _0x169928=a149_0x2d6e43;return _0x307df0===_0x169928(0x233)||_0x307df0===_0x169928(0x1ea);}function isBetweenOperator(_0x2db7a3){const _0x524313=a149_0x2d6e43;return _0x2db7a3===_0x524313(0x1c7);}function getEffectiveValue(_0x504e56){const _0xb7e5c1=a149_0x2d6e43,_0x44e081=_0x504e56['values'];return _0x504e56[_0xb7e5c1(0x222)]??_0x44e081;}function parseNumericValue(_0x5f18a1){const _0x1c32af=a149_0x2d6e43;if(typeof _0x5f18a1==='object'&&_0x5f18a1!==null)return _0x5f18a1;if(_0x5f18a1==='')return _0x5f18a1;const _0x2a2689=Number(_0x5f18a1);return Number[_0x1c32af(0x231)](_0x2a2689)?_0x2a2689:_0x5f18a1;}function apiOperatorToYaml(_0x4491cd){const _0x4cfd51=a149_0x2d6e43;if(isBetweenOperator(_0x4491cd[_0x4cfd51(0x23c)]))return{'type':mapApiOperatorType(_0x4491cd[_0x4cfd51(0x23c)]),..._0x4491cd['not']!==undefined&&{'not':_0x4491cd[_0x4cfd51(0x22e)]},..._0x4491cd[_0x4cfd51(0x252)]!==undefined&&{'min':parseNumericValue(_0x4491cd[_0x4cfd51(0x252)])},..._0x4491cd['maxValue']!==undefined&&{'max':parseNumericValue(_0x4491cd[_0x4cfd51(0x1e7)])}};if(_0x4491cd['type']===_0x4cfd51(0x1bd))return{'type':_0x4cfd51(0x1bd),..._0x4491cd[_0x4cfd51(0x22e)]!==undefined&&{'not':_0x4491cd[_0x4cfd51(0x22e)]},..._0x4491cd['duration']!==undefined&&{'duration':_0x4491cd[_0x4cfd51(0x249)]},..._0x4491cd[_0x4cfd51(0x1de)]!==undefined&&{'from':_0x4491cd[_0x4cfd51(0x1de)]},..._0x4491cd['reverse']!==undefined&&{'reverse':_0x4491cd[_0x4cfd51(0x26b)]}};let _0x5c5d22;if(_0x4491cd['rightValues']&&_0x4491cd[_0x4cfd51(0x1d6)][_0x4cfd51(0x1f4)]>0x0)_0x5c5d22=_0x4491cd[_0x4cfd51(0x1d6)];else{if(_0x4491cd['rightValue']!==undefined)_0x5c5d22=_0x4491cd[_0x4cfd51(0x26c)];else isTemporalOperator(_0x4491cd[_0x4cfd51(0x23c)])&&_0x4491cd[_0x4cfd51(0x222)]!==undefined&&(_0x5c5d22=_0x4491cd[_0x4cfd51(0x222)]);}return{'type':mapApiOperatorType(_0x4491cd[_0x4cfd51(0x23c)]),..._0x4491cd[_0x4cfd51(0x22e)]!==undefined&&{'not':_0x4491cd[_0x4cfd51(0x22e)]},..._0x5c5d22!==undefined&&{'value':_0x5c5d22},..._0x4491cd[_0x4cfd51(0x21a)]!==undefined&&{'unit':_0x4491cd[_0x4cfd51(0x21a)]}};}function mapApiOperatorType(_0x258f3a){return _0x258f3a;}export function segmentDefToCreateRequest(_0x5bf361,_0x561807){const _0x326e54=a149_0x2d6e43,_0x1ab583={'name':_0x5bf361[_0x326e54(0x1f6)]};return _0x5bf361[_0x326e54(0x1b9)]&&(_0x1ab583['description']=_0x5bf361[_0x326e54(0x1b9)]),_0x5bf361[_0x326e54(0x22d)]&&(_0x1ab583[_0x326e54(0x22d)]=yamlRuleToApi(_0x5bf361[_0x326e54(0x22d)])),_0x5bf361[_0x326e54(0x25f)]&&(_0x1ab583['kind']=_0x5bf361[_0x326e54(0x25f)]===_0x326e54(0x211)?0x0:_0x5bf361['kind']===_0x326e54(0x24a)?0x1:0x2),_0x5bf361[_0x326e54(0x1c5)]!==undefined&&(_0x1ab583[_0x326e54(0x205)]=_0x5bf361['visible']),_0x561807&&(_0x1ab583[_0x326e54(0x1e6)]=_0x561807),_0x1ab583;}export function segmentDefToUpdateRequest(_0x4b89b9){const _0x32bd36=a149_0x2d6e43,_0x211aa7={'name':_0x4b89b9[_0x32bd36(0x1f6)]};return _0x4b89b9[_0x32bd36(0x1b9)]!==undefined&&(_0x211aa7[_0x32bd36(0x1b9)]=_0x4b89b9[_0x32bd36(0x1b9)]),_0x4b89b9[_0x32bd36(0x22d)]&&(_0x211aa7[_0x32bd36(0x22d)]=yamlRuleToApi(_0x4b89b9[_0x32bd36(0x22d)])),_0x4b89b9['kind']&&(_0x211aa7[_0x32bd36(0x25f)]=_0x4b89b9[_0x32bd36(0x25f)]===_0x32bd36(0x211)?0x0:_0x4b89b9[_0x32bd36(0x25f)]===_0x32bd36(0x24a)?0x1:0x2),_0x211aa7;}export function yamlRuleToApi(_0x338a5e){const _0x400c8e=a149_0x2d6e43;if(_0x338a5e[_0x400c8e(0x23c)]==='Composite')return{'type':'Composite','conditions':_0x338a5e['conditions'][_0x400c8e(0x219)](yamlConditionToApi),..._0x338a5e[_0x400c8e(0x1b9)]!==undefined&&{'description':_0x338a5e[_0x400c8e(0x1b9)]},..._0x338a5e[_0x400c8e(0x209)]!==undefined&&{'expr':_0x338a5e['expr']}};const _0x4bc9d8=_0x338a5e['conditions'][_0x400c8e(0x219)](yamlConditionToApi),_0x1dc71d=_0x4bc9d8[_0x400c8e(0x1b6)](_0x5649fc=>isCompositeType(_0x5649fc)&&_0x5649fc[_0x400c8e(0x1b9)]!==undefined);if(!_0x1dc71d&&_0x4bc9d8[_0x400c8e(0x1f4)]>0x0){const _0xc7baa5=[];for(const _0x1af502 of _0x4bc9d8){isCompositeType(_0x1af502)&&_0x1af502['description']===undefined&&_0x1af502[_0x400c8e(0x212)]&&_0x1af502[_0x400c8e(0x212)][_0x400c8e(0x1b6)](_0x120330=>!isCompositeType(_0x120330))?_0xc7baa5['push']({'type':_0x1af502[_0x400c8e(0x23c)],'description':'','conditions':_0x1af502[_0x400c8e(0x212)]}):_0xc7baa5[_0x400c8e(0x202)]({'type':_0x400c8e(0x225),'description':_0x338a5e['description']||'','conditions':[_0x1af502]});}return{'type':_0x338a5e[_0x400c8e(0x23c)],'conditions':_0xc7baa5};}return{'type':_0x338a5e[_0x400c8e(0x23c)],'conditions':_0x4bc9d8,..._0x338a5e[_0x400c8e(0x1b9)]&&{'description':_0x338a5e[_0x400c8e(0x1b9)]}};}function a149_0xcfbc(){const _0x24ff16=['activations:','code','notifyOn','Unknown\x20connection:\x20','runAfterJourneyRefresh','set','daily','localRuleToName','kind','activation_template_id','repeatFrequency','parse','nested_workflow_project_name','lock_enabled','hourly','allColumns','syndicationBehavior','join','30443cTTTxG','30YYvKGK','reverse','rightValue','day','Segment\x20description','connector_config\x20for\x20activation\x20\x22','rule:','emailRecipients','arrayMatching','repeatSubFrequency','every','CONNECTION_NOT_FOUND','groupingColumns','description','errors','keys','join_strategy','TimeRange','join_row','Last','ruleHashToName','nested_workflow_name','operator','getSchema','columns','visible','order_by','Between','Equal','First','entries','repeat_unit','minute','schedule','repeatUnit','activationTemplateId','\x20\x20-\x20\x22','336XaQVLu','Value','notification','558GoSYmg','9GhqCHM','rightValues','emailToIdMap','run_after_journey_refresh','].attribute\x20cannot\x20be\x20empty.\x0a','flatMap','Warning:\x20activation\x20\x22','warnings','CountDistinct','from','timeWindow','JOURNEY_SYNTAX_ERROR','orderColumn','visibility','start_at','235fgEjRF','values','segmentFolderId','maxValue','include','leftValue','TimeWithinNext','sort','add','All','endOn','3902954PLevEF','\x22:\x0a','Count','isArray','min','length','max','name','object','__SEGMENT_REF__','replace','Column','timezone','localeCompare','1035290RSbLbS','Unknown\x20email\x20recipient:\x20','end_on','attributes','behavior_table','push','test','limit','isVisible','Reference','funnel_stage','attribute','expr','orderBy','Composite','activations','week','stringify','email_recipients','aggregation','batch','conditions','joinStrategy','null','cron','219894TlpMoW','Invalid\x20connector_config\x20for\x20activation\x20\x22','connectorConfig','map','unit','notify_on','lockEnabled','repeat_frequency','warn','CONNECTOR_SCHEMA_NOT_FOUND','month','4010144OvMepn','value','activationParams','connection','And','usedNames','string','filter','any','has','startAt','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','rule','not','repeat_sub_frequency','connectionNameToIdMap','isFinite','connectionNameToTypeMap','TimeWithinPast','Behavior','get','Connector:\x20','\x27:\x20','resolveSegmentName','hour','none','segment','type','Please\x20specify\x20a\x20valid\x20attribute\x20name.','joinRow','valid','nestedWorkflowName','formatting','forEach','exclude','folder','behavior','connector_config','scheduleType','connectionId','duration','realtime','column','scheduleOption','source','all','weekly','behaviorTableName','nestedWorkflowProjectName','minValue','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','all_columns','1602009TFGday','\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a'];a149_0xcfbc=function(){return _0x24ff16;};return a149_0xcfbc();}function yamlFilterRuleToApi(_0x235662){const _0x5469f6=a149_0x2d6e43,_0x26c7a6=_0x235662[_0x5469f6(0x212)]['map'](yamlConditionToApi);return{'type':_0x235662[_0x5469f6(0x23c)],'conditions':_0x26c7a6};}function yamlConditionToApi(_0x5abc49){const _0x4e3b96=a149_0x2d6e43;if('segment'in _0x5abc49&&(_0x5abc49[_0x4e3b96(0x23c)]===_0x4e3b96(0x1e8)||_0x5abc49['type']===_0x4e3b96(0x243))){const _0x1fbea5=_0x5abc49;return{'type':_0x4e3b96(0x206),'id':_0x1fbea5[_0x4e3b96(0x23b)],'exclude':_0x1fbea5[_0x4e3b96(0x23c)]==='exclude'};}if(_0x5abc49[_0x4e3b96(0x23c)]===_0x4e3b96(0x225)||_0x5abc49[_0x4e3b96(0x23c)]==='Or'||_0x5abc49[_0x4e3b96(0x23c)]==='Composite'){const _0x57e55d=_0x5abc49;return{'type':_0x57e55d['type'],'conditions':_0x57e55d[_0x4e3b96(0x212)]['map'](yamlConditionToApi),..._0x57e55d[_0x4e3b96(0x1b9)]&&{'description':_0x57e55d[_0x4e3b96(0x1b9)]},..._0x57e55d['expr']!==undefined&&{'expr':_0x57e55d[_0x4e3b96(0x209)]}};}if('column'in _0x5abc49&&_0x5abc49['type']===_0x4e3b96(0x1fa)){const _0xe7ed42=_0x5abc49;return{'type':_0x4e3b96(0x1fa),'column':_0xe7ed42[_0x4e3b96(0x24b)],'operator':yamlOperatorToApi(_0xe7ed42[_0x4e3b96(0x1c2)])};}const _0x438cf6=_0x5abc49,_0x53067b={'type':_0x4e3b96(0x1d2),'leftValue':buildLeftValue(_0x438cf6),'operator':yamlOperatorToApi(_0x438cf6[_0x4e3b96(0x1c2)]),'exclude':_0x438cf6[_0x4e3b96(0x243)]??![],'arrayMatching':_0x438cf6['arrayMatching']??'any'};return _0x438cf6[_0x4e3b96(0x204)]!==undefined&&(_0x53067b['limit']=_0x438cf6[_0x4e3b96(0x204)]),_0x53067b;}function buildAggregationDefFromApi(_0x101ad7){const _0x308baf=a149_0x2d6e43,_0x2ee080=_0x101ad7[_0x308baf(0x23c)];if(_0x2ee080===_0x308baf(0x1dd))return{'type':_0x2ee080,'columns':_0x101ad7[_0x308baf(0x1c4)]??[]};if(_0x2ee080===_0x308baf(0x1c9)||_0x2ee080==='Last')return{'type':_0x2ee080,'column':_0x101ad7[_0x308baf(0x24b)]??'','orderColumn':_0x101ad7['orderColumn']??'',..._0x101ad7[_0x308baf(0x1b8)]&&{'groupingColumns':_0x101ad7['groupingColumns']}};if(_0x2ee080===_0x308baf(0x1f1))return{'type':_0x2ee080,..._0x101ad7['groupingColumns']&&{'groupingColumns':_0x101ad7[_0x308baf(0x1b8)]}};return{'type':_0x2ee080,'column':_0x101ad7[_0x308baf(0x24b)]??'',..._0x101ad7[_0x308baf(0x1b8)]&&{'groupingColumns':_0x101ad7[_0x308baf(0x1b8)]}};}function buildLeftValue(_0xe5ff8e){const _0x43352f=a149_0x2d6e43,_0x31034a={};_0xe5ff8e[_0x43352f(0x208)]&&_0xe5ff8e[_0x43352f(0x23c)]!==_0x43352f(0x234)&&(_0x31034a[_0x43352f(0x1f6)]=_0xe5ff8e[_0x43352f(0x208)]);if(_0xe5ff8e[_0x43352f(0x210)]){const _0x2dae09=_0xe5ff8e[_0x43352f(0x210)];if(_0x2dae09[_0x43352f(0x23c)]===_0x43352f(0x1dd))_0x31034a[_0x43352f(0x210)]={'type':_0x43352f(0x1dd),'columns':_0x2dae09[_0x43352f(0x1c4)]};else{if(_0x2dae09[_0x43352f(0x23c)]===_0x43352f(0x1c9)||_0x2dae09['type']===_0x43352f(0x1bf))_0x31034a[_0x43352f(0x210)]={'type':_0x2dae09[_0x43352f(0x23c)],'column':_0x2dae09['column'],'orderColumn':_0x2dae09[_0x43352f(0x1e1)],..._0x2dae09[_0x43352f(0x1b8)]&&{'groupingColumns':_0x2dae09['groupingColumns']}};else _0x2dae09[_0x43352f(0x23c)]===_0x43352f(0x1f1)?_0x31034a[_0x43352f(0x210)]={'type':'Count',..._0x2dae09['groupingColumns']&&{'groupingColumns':_0x2dae09[_0x43352f(0x1b8)]}}:_0x31034a[_0x43352f(0x210)]={'type':_0x2dae09['type'],'column':_0x2dae09[_0x43352f(0x24b)],..._0x2dae09[_0x43352f(0x1b8)]&&{'groupingColumns':_0x2dae09['groupingColumns']}};}}return _0xe5ff8e[_0x43352f(0x24d)]&&(_0x31034a[_0x43352f(0x24d)]={'name':_0xe5ff8e[_0x43352f(0x24d)]}),_0xe5ff8e[_0x43352f(0x228)]&&(_0x31034a['filter']=yamlFilterRuleToApi(filterRuleAsRuleDef(_0xe5ff8e[_0x43352f(0x228)]))),_0x31034a;}function yamlOperatorToApi(_0x39ec24){const _0x215d11=a149_0x2d6e43,_0x388e2b={'type':mapYamlOperatorType(_0x39ec24[_0x215d11(0x23c)]),'not':_0x39ec24[_0x215d11(0x22e)]??![]};if(isBetweenOperator(_0x39ec24[_0x215d11(0x23c)]))return _0x39ec24[_0x215d11(0x1f3)]!==undefined&&(_0x388e2b[_0x215d11(0x252)]=typeof _0x39ec24['min']===_0x215d11(0x1f7)?_0x39ec24['min']:String(_0x39ec24[_0x215d11(0x1f3)])),_0x39ec24[_0x215d11(0x1f5)]!==undefined&&(_0x388e2b[_0x215d11(0x1e7)]=typeof _0x39ec24[_0x215d11(0x1f5)]==='object'?_0x39ec24[_0x215d11(0x1f5)]:String(_0x39ec24[_0x215d11(0x1f5)])),_0x388e2b;if(_0x39ec24[_0x215d11(0x23c)]==='TimeRange')return _0x39ec24[_0x215d11(0x249)]&&(_0x388e2b[_0x215d11(0x249)]=_0x39ec24[_0x215d11(0x249)]),_0x39ec24[_0x215d11(0x1de)]&&(_0x388e2b[_0x215d11(0x1de)]=_0x39ec24[_0x215d11(0x1de)]),_0x39ec24[_0x215d11(0x26b)]!==undefined&&(_0x388e2b['reverse']=_0x39ec24[_0x215d11(0x26b)]),_0x388e2b;const _0x3fb6a1=getEffectiveValue(_0x39ec24);if(_0x3fb6a1!==undefined){if(Array[_0x215d11(0x1f2)](_0x3fb6a1))_0x388e2b[_0x215d11(0x1d6)]=_0x3fb6a1;else isTemporalOperator(_0x39ec24[_0x215d11(0x23c)])?_0x388e2b[_0x215d11(0x222)]=_0x3fb6a1:_0x388e2b[_0x215d11(0x26c)]=_0x3fb6a1;}return _0x39ec24['unit']&&(_0x388e2b[_0x215d11(0x21a)]=_0x39ec24[_0x215d11(0x21a)]),_0x388e2b;}function mapYamlOperatorType(_0x40ad0f){return _0x40ad0f;}export function toYamlString(_0x818087){const _0x2c7f75=a149_0x2d6e43,_0x1375a4=JSON[_0x2c7f75(0x262)](JSON[_0x2c7f75(0x20e)](_0x818087)),_0x4783d0=a149_0x4b8a7a[_0x2c7f75(0x20e)](_0x1375a4,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x18d95b=[_0x2c7f75(0x1b2)];let _0x57a0f6=_0x4783d0;for(const _0x3c68e3 of _0x18d95b){_0x57a0f6=_0x57a0f6[_0x2c7f75(0x1f9)](new RegExp('^('+_0x3c68e3+')','m'),(_0x31a1e3,_0x2f7db6,_0x5f3b35)=>{if(_0x5f3b35===0x0||_0x57a0f6[_0x5f3b35-0x1]==='\x0a'&&_0x57a0f6[_0x5f3b35-0x2]==='\x0a')return _0x2f7db6;return'\x0a'+_0x2f7db6;});}return _0x57a0f6;}export function parseYamlString(_0x459ca3){return parseSegmentYamlFile(_0x459ca3);}export function isSegmentYaml(_0x3a8760){const _0x2040b8=a149_0x2d6e43;if(typeof _0x3a8760!=='object'||_0x3a8760===null)return![];const _0x17b303=_0x3a8760;return _0x17b303[_0x2040b8(0x23c)]===_0x2040b8(0x23b)||_0x17b303[_0x2040b8(0x23c)]===undefined;}export function generateTemplate(_0x290e08='New\x20Segment'){const _0x25827f=a149_0x2d6e43,_0x593e57={'type':'segment','name':_0x290e08,'description':_0x25827f(0x26e),'rule':{'type':'And','conditions':[{'type':_0x25827f(0x1d2),'attribute':'attribute_name','operator':{'type':_0x25827f(0x1c8),'value':_0x25827f(0x222)}}]}};return toYamlString(_0x593e57);}export function segmentToYamlString(_0x13fd27){const _0x360356=a149_0x2d6e43,_0x491ab6=JSON[_0x360356(0x262)](JSON[_0x360356(0x20e)](_0x13fd27)),_0x158efd=a149_0x4b8a7a[_0x360356(0x20e)](_0x491ab6,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x360356(0x214)}),_0x755b5f=[_0x360356(0x1b2),_0x360356(0x257)];let _0x2032be=_0x158efd;for(const _0x5b074d of _0x755b5f){_0x2032be=_0x2032be[_0x360356(0x1f9)](new RegExp('^('+_0x5b074d+')','m'),(_0x2cb0b8,_0x5c944c,_0x57d62b)=>{if(_0x57d62b===0x0||_0x2032be[_0x57d62b-0x1]==='\x0a'&&_0x2032be[_0x57d62b-0x2]==='\x0a')return _0x5c944c;return'\x0a'+_0x5c944c;});}return _0x2032be;}export function parseSegmentYamlFile(_0x20781b){return safeParseYaml(_0x20781b,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x45b9bf){const _0x325449=a149_0x2d6e43;return{'type':_0x325449(0x23b),'name':_0x45b9bf[_0x325449(0x1f6)],..._0x45b9bf[_0x325449(0x1b9)]!==undefined&&{'description':_0x45b9bf[_0x325449(0x1b9)]},..._0x45b9bf[_0x325449(0x244)]!==undefined&&{'folder':_0x45b9bf['folder']},..._0x45b9bf[_0x325449(0x22d)]&&{'rule':normalizeRule(_0x45b9bf[_0x325449(0x22d)])},..._0x45b9bf[_0x325449(0x25f)]!==undefined&&{'kind':_0x45b9bf['kind']},..._0x45b9bf[_0x325449(0x1c5)]!==undefined&&{'visible':_0x45b9bf['visible']},..._0x45b9bf[_0x325449(0x20c)]&&{'activations':_0x45b9bf[_0x325449(0x20c)][_0x325449(0x219)](normalizeActivation)}};}export function normalizeRule(_0x52f5b8){const _0x13608f=a149_0x2d6e43;return{'type':_0x52f5b8['type'],'conditions':_0x52f5b8[_0x13608f(0x212)][_0x13608f(0x219)](normalizeCondition),..._0x52f5b8[_0x13608f(0x1b9)]!==undefined&&{'description':_0x52f5b8[_0x13608f(0x1b9)]},..._0x52f5b8[_0x13608f(0x209)]!==undefined&&{'expr':_0x52f5b8[_0x13608f(0x209)]}};}function normalizeCondition(_0x4f5c82){const _0x2762d3=a149_0x2d6e43;if(_0x2762d3(0x23b)in _0x4f5c82&&(_0x4f5c82[_0x2762d3(0x23c)]===_0x2762d3(0x1e8)||_0x4f5c82[_0x2762d3(0x23c)]===_0x2762d3(0x243))){const _0x1aec60=_0x4f5c82;return{'type':_0x1aec60['type'],'segment':_0x1aec60['segment']};}if(_0x4f5c82[_0x2762d3(0x23c)]===_0x2762d3(0x225)||_0x4f5c82[_0x2762d3(0x23c)]==='Or'||_0x4f5c82[_0x2762d3(0x23c)]===_0x2762d3(0x20b)){const _0x459fa5=_0x4f5c82;return{'type':_0x459fa5[_0x2762d3(0x23c)],'conditions':_0x459fa5[_0x2762d3(0x212)][_0x2762d3(0x219)](normalizeCondition),..._0x459fa5['description']!==undefined&&{'description':_0x459fa5[_0x2762d3(0x1b9)]},..._0x459fa5[_0x2762d3(0x209)]!==undefined&&{'expr':_0x459fa5[_0x2762d3(0x209)]}};}if('column'in _0x4f5c82&&_0x4f5c82[_0x2762d3(0x23c)]===_0x2762d3(0x1fa)){const _0x4664cc=_0x4f5c82;return{'type':_0x2762d3(0x1fa),'column':_0x4664cc[_0x2762d3(0x24b)],'operator':normalizeOperator(_0x4664cc['operator'])};}if(_0x4f5c82[_0x2762d3(0x23c)]==='Behavior'){const _0x41fa36=_0x4f5c82;return{'type':_0x2762d3(0x234),'attribute':_0x41fa36['attribute'],'operator':normalizeOperator(_0x41fa36[_0x2762d3(0x1c2)]),..._0x41fa36[_0x2762d3(0x1b4)]!==undefined&&{'arrayMatching':_0x41fa36['arrayMatching']},..._0x41fa36[_0x2762d3(0x243)]!==undefined&&{'exclude':_0x41fa36[_0x2762d3(0x243)]},..._0x41fa36['aggregation']!==undefined&&{'aggregation':_0x41fa36[_0x2762d3(0x210)]},..._0x41fa36[_0x2762d3(0x24d)]!==undefined&&{'source':_0x41fa36[_0x2762d3(0x24d)]},..._0x41fa36[_0x2762d3(0x228)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x41fa36['filter'])))},..._0x41fa36[_0x2762d3(0x1df)]!==undefined&&{'timeWindow':_0x41fa36[_0x2762d3(0x1df)]},..._0x41fa36[_0x2762d3(0x204)]!==undefined&&{'limit':_0x41fa36[_0x2762d3(0x204)]}};}const _0x2c6932=_0x4f5c82;return{'type':'Value','attribute':_0x2c6932[_0x2762d3(0x208)],'operator':normalizeOperator(_0x2c6932[_0x2762d3(0x1c2)]),..._0x2c6932[_0x2762d3(0x1b4)]!==undefined&&{'arrayMatching':_0x2c6932[_0x2762d3(0x1b4)]},..._0x2c6932[_0x2762d3(0x243)]!==undefined&&{'exclude':_0x2c6932['exclude']},..._0x2c6932[_0x2762d3(0x210)]!==undefined&&{'aggregation':_0x2c6932[_0x2762d3(0x210)]},..._0x2c6932[_0x2762d3(0x24d)]!==undefined&&{'source':_0x2c6932[_0x2762d3(0x24d)]},..._0x2c6932[_0x2762d3(0x228)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x2c6932['filter'])))},..._0x2c6932[_0x2762d3(0x204)]!==undefined&&{'limit':_0x2c6932[_0x2762d3(0x204)]}};}function normalizeOperator(_0x56c1b5){const _0x3ba9d0=a149_0x2d6e43;if(isBetweenOperator(_0x56c1b5[_0x3ba9d0(0x23c)]))return{'type':_0x56c1b5[_0x3ba9d0(0x23c)],..._0x56c1b5[_0x3ba9d0(0x22e)]!==undefined&&{'not':_0x56c1b5[_0x3ba9d0(0x22e)]},..._0x56c1b5['min']!==undefined&&{'min':_0x56c1b5['min']},..._0x56c1b5[_0x3ba9d0(0x1f5)]!==undefined&&{'max':_0x56c1b5[_0x3ba9d0(0x1f5)]}};const _0x2e07d9=getEffectiveValue(_0x56c1b5);return{'type':_0x56c1b5[_0x3ba9d0(0x23c)],..._0x56c1b5[_0x3ba9d0(0x22e)]!==undefined&&{'not':_0x56c1b5['not']},..._0x2e07d9!==undefined&&{'value':_0x2e07d9},..._0x56c1b5[_0x3ba9d0(0x21a)]!==undefined&&{'unit':_0x56c1b5[_0x3ba9d0(0x21a)]},..._0x56c1b5['duration']!==undefined&&{'duration':_0x56c1b5[_0x3ba9d0(0x249)]},..._0x56c1b5[_0x3ba9d0(0x1de)]!==undefined&&{'from':_0x56c1b5[_0x3ba9d0(0x1de)]},..._0x56c1b5[_0x3ba9d0(0x26b)]!==undefined&&{'reverse':_0x56c1b5[_0x3ba9d0(0x26b)]}};}function normalizeActivation(_0x11d939){const _0x1649b9=a149_0x2d6e43;return{'name':_0x11d939[_0x1649b9(0x1f6)],'connection':_0x11d939[_0x1649b9(0x224)],..._0x11d939[_0x1649b9(0x1b9)]!==undefined&&{'description':_0x11d939[_0x1649b9(0x1b9)]},..._0x11d939['all_columns']!==undefined&&{'all_columns':_0x11d939[_0x1649b9(0x254)]},..._0x11d939[_0x1649b9(0x1c4)]!==undefined&&{'columns':_0x11d939[_0x1649b9(0x1c4)]},..._0x11d939['behavior']!==undefined&&{'behavior':_0x11d939[_0x1649b9(0x245)]},..._0x11d939[_0x1649b9(0x1cd)]!==undefined&&{'schedule':_0x11d939[_0x1649b9(0x1cd)]},..._0x11d939['notification']!==undefined&&{'notification':_0x11d939[_0x1649b9(0x1d3)]},..._0x11d939['connector_config']!==undefined&&{'connector_config':_0x11d939[_0x1649b9(0x246)]},..._0x11d939[_0x1649b9(0x260)]!==undefined&&{'activation_template_id':_0x11d939[_0x1649b9(0x260)]},..._0x11d939[_0x1649b9(0x263)]!==undefined&&{'nested_workflow_project_name':_0x11d939[_0x1649b9(0x263)]},..._0x11d939[_0x1649b9(0x1c1)]!==undefined&&{'nested_workflow_name':_0x11d939['nested_workflow_name']},..._0x11d939[_0x1649b9(0x264)]!==undefined&&{'lock_enabled':_0x11d939[_0x1649b9(0x264)]}};}function getColumnName(_0xf0b75){const _0x2f7c76=a149_0x2d6e43;return _0xf0b75[_0x2f7c76(0x24b)]||_0xf0b75['name'];}export function activationResponseToDef(_0x4059ed,_0x7af6cc,_0xb34d6f){const _0x8d710b=a149_0x2d6e43,_0x4c2114=_0x4059ed[_0x8d710b(0x248)]||'',_0x32706a=_0xb34d6f?.['get'](_0x4c2114)??_0x4c2114,_0x6b5ce4={'name':_0x4059ed[_0x8d710b(0x1f6)],'connection':_0x32706a};_0x4059ed['description']&&(_0x6b5ce4['description']=_0x4059ed[_0x8d710b(0x1b9)]);let _0x530830=[];_0x4059ed[_0x8d710b(0x1c4)]&&_0x4059ed['columns'][_0x8d710b(0x1f4)]>0x0&&(_0x530830=_0x4059ed[_0x8d710b(0x1c4)][_0x8d710b(0x228)](_0x215e94=>_0x215e94&&getColumnName(_0x215e94))[_0x8d710b(0x219)](_0x245b20=>{const _0xf63da9=_0x8d710b,_0x447fb5=getColumnName(_0x245b20);if(_0x245b20[_0xf63da9(0x23c)]||_0x245b20[_0xf63da9(0x1e2)])return{'name':_0x447fb5,..._0x245b20[_0xf63da9(0x23c)]&&{'type':_0x245b20[_0xf63da9(0x23c)]},..._0x245b20[_0xf63da9(0x1e2)]&&{'visibility':_0x245b20['visibility']}};return _0x447fb5;}));_0x530830[_0x8d710b(0x1f4)]>0x0&&(_0x6b5ce4[_0x8d710b(0x1c4)]=_0x530830);_0x4059ed[_0x8d710b(0x266)]!==undefined&&(_0x4059ed['allColumns']===![]&&_0x530830['length']===0x0?_0x6b5ce4[_0x8d710b(0x254)]=!![]:_0x6b5ce4[_0x8d710b(0x254)]=_0x4059ed['allColumns']);const _0x1b96a5={};let _0x510f1d=![];_0x4059ed[_0x8d710b(0x247)]&&(_0x1b96a5['type']=_0x4059ed[_0x8d710b(0x247)],_0x510f1d=!![]);_0x4059ed[_0x8d710b(0x1ce)]&&(_0x1b96a5[_0x8d710b(0x1cb)]=_0x4059ed[_0x8d710b(0x1ce)],_0x510f1d=!![]);_0x4059ed[_0x8d710b(0x261)]!==undefined&&_0x4059ed[_0x8d710b(0x261)]!==null&&(_0x1b96a5['repeat_frequency']=_0x4059ed[_0x8d710b(0x261)],_0x510f1d=!![]);_0x4059ed['repeatSubFrequency']&&_0x4059ed[_0x8d710b(0x1b5)][_0x8d710b(0x1f4)]>0x0&&(_0x1b96a5['repeat_sub_frequency']=_0x4059ed[_0x8d710b(0x1b5)],_0x510f1d=!![]);_0x4059ed[_0x8d710b(0x22b)]!==undefined&&(_0x1b96a5[_0x8d710b(0x1e3)]=_0x4059ed[_0x8d710b(0x22b)],_0x510f1d=!![]);_0x4059ed[_0x8d710b(0x1ee)]!==undefined&&(_0x1b96a5[_0x8d710b(0x1ff)]=_0x4059ed['endOn'],_0x510f1d=!![]);_0x4059ed[_0x8d710b(0x1fb)]&&(_0x1b96a5[_0x8d710b(0x1fb)]=_0x4059ed[_0x8d710b(0x1fb)],_0x510f1d=!![]);_0x510f1d&&(_0x6b5ce4[_0x8d710b(0x1cd)]=_0x1b96a5);(_0x4059ed[_0x8d710b(0x259)]&&_0x4059ed[_0x8d710b(0x259)]['length']>0x0||_0x4059ed[_0x8d710b(0x1b3)]&&_0x4059ed['emailRecipients'][_0x8d710b(0x1f4)]>0x0)&&(_0x6b5ce4[_0x8d710b(0x1d3)]={},_0x4059ed[_0x8d710b(0x259)]&&_0x4059ed[_0x8d710b(0x259)]['length']>0x0&&(_0x6b5ce4[_0x8d710b(0x1d3)][_0x8d710b(0x21b)]=_0x4059ed[_0x8d710b(0x259)]),_0x4059ed['emailRecipients']&&_0x4059ed[_0x8d710b(0x1b3)][_0x8d710b(0x1f4)]>0x0&&(_0x6b5ce4['notification'][_0x8d710b(0x20f)]=_0x4059ed['emailRecipients'][_0x8d710b(0x219)](_0x5caf8f=>{const _0x5f1292=_0x8d710b,_0xb00171=_0x7af6cc?.[_0x5f1292(0x235)](_0x5caf8f);return _0xb00171??String(_0x5caf8f);})));_0x4059ed[_0x8d710b(0x218)]&&Object[_0x8d710b(0x1bb)](_0x4059ed[_0x8d710b(0x218)])[_0x8d710b(0x1f4)]>0x0&&(_0x6b5ce4[_0x8d710b(0x246)]=normalizeConnectorConfigForYaml(_0x4059ed[_0x8d710b(0x218)]));_0x4059ed['activationTemplateId']&&(_0x6b5ce4['activation_template_id']=_0x4059ed[_0x8d710b(0x1cf)]);if(_0x4059ed[_0x8d710b(0x267)]){const _0x235f49={},_0x5ba344=_0x4059ed[_0x8d710b(0x267)];_0x5ba344[_0x8d710b(0x1c4)]&&_0x5ba344['columns'][_0x8d710b(0x1f4)]>0x0&&(_0x235f49[_0x8d710b(0x1c4)]=_0x5ba344[_0x8d710b(0x1c4)][_0x8d710b(0x228)](_0x3ae7ed=>_0x3ae7ed&&getColumnName(_0x3ae7ed))[_0x8d710b(0x219)](_0x2acb9b=>({'name':getColumnName(_0x2acb9b),..._0x2acb9b[_0x8d710b(0x23c)]&&{'type':_0x2acb9b['type']},..._0x2acb9b[_0x8d710b(0x1e2)]&&{'visibility':_0x2acb9b['visibility']}}))),_0x5ba344['behaviorTableName']&&(_0x235f49[_0x8d710b(0x201)]=_0x5ba344[_0x8d710b(0x250)]),_0x5ba344[_0x8d710b(0x23e)]!==undefined&&(_0x235f49[_0x8d710b(0x1be)]=_0x5ba344[_0x8d710b(0x23e)]),_0x5ba344['joinStrategy']&&(_0x235f49[_0x8d710b(0x1bc)]=_0x5ba344[_0x8d710b(0x213)]),_0x5ba344[_0x8d710b(0x241)]&&(_0x235f49['formatting']=_0x5ba344[_0x8d710b(0x241)]),_0x5ba344['orderBy']&&_0x5ba344[_0x8d710b(0x20a)][_0x8d710b(0x1f4)]>0x0&&(_0x235f49[_0x8d710b(0x1c6)]=_0x5ba344[_0x8d710b(0x20a)]),Object[_0x8d710b(0x1bb)](_0x235f49)[_0x8d710b(0x1f4)]>0x0&&(_0x6b5ce4[_0x8d710b(0x245)]=_0x235f49);}return _0x4059ed[_0x8d710b(0x251)]&&(_0x6b5ce4['nested_workflow_project_name']=_0x4059ed[_0x8d710b(0x251)]),_0x4059ed[_0x8d710b(0x240)]&&(_0x6b5ce4['nested_workflow_name']=_0x4059ed[_0x8d710b(0x240)]),_0x4059ed['lockEnabled']!==undefined&&(_0x6b5ce4[_0x8d710b(0x264)]=_0x4059ed[_0x8d710b(0x21c)]),_0x6b5ce4;}export function journeyActivationStepToYaml(_0x211a3f,_0x5f0193,_0x49717f){const _0x42f17d=a149_0x2d6e43,_0x6b68bc=_0x211a3f[_0x42f17d(0x200)][_0x42f17d(0x223)],_0x469b57=_0x6b68bc[_0x42f17d(0x248)]||'',_0x545182=_0x49717f?.[_0x42f17d(0x235)](_0x469b57)??_0x469b57,_0x4a0e75={'name':_0x6b68bc[_0x42f17d(0x1f6)]||'','connection':_0x545182};_0x211a3f[_0x42f17d(0x200)][_0x42f17d(0x25b)]&&(_0x4a0e75[_0x42f17d(0x1d8)]=!![]);_0x6b68bc['description']&&(_0x4a0e75[_0x42f17d(0x1b9)]=_0x6b68bc[_0x42f17d(0x1b9)]);let _0x4a077b=[];_0x6b68bc['columns']&&_0x6b68bc['columns'][_0x42f17d(0x1f4)]>0x0&&(_0x4a077b=_0x6b68bc[_0x42f17d(0x1c4)][_0x42f17d(0x228)](_0x482a27=>_0x482a27&&getColumnName(_0x482a27))[_0x42f17d(0x219)](_0x1cf301=>{const _0x283327=_0x42f17d,_0x1cda2b=getColumnName(_0x1cf301);if(_0x1cf301[_0x283327(0x23c)]||_0x1cf301[_0x283327(0x1e2)])return{'name':_0x1cda2b,..._0x1cf301[_0x283327(0x23c)]&&{'type':_0x1cf301[_0x283327(0x23c)]},..._0x1cf301['visibility']&&{'visibility':_0x1cf301[_0x283327(0x1e2)]}};return _0x1cda2b;}));_0x4a077b[_0x42f17d(0x1f4)]>0x0&&(_0x4a0e75[_0x42f17d(0x1c4)]=_0x4a077b);_0x6b68bc[_0x42f17d(0x266)]!==undefined&&(_0x6b68bc[_0x42f17d(0x266)]===![]&&_0x4a077b[_0x42f17d(0x1f4)]===0x0?_0x4a0e75[_0x42f17d(0x254)]=!![]:_0x4a0e75[_0x42f17d(0x254)]=_0x6b68bc[_0x42f17d(0x266)]);const _0x2eb27a={};let _0x577d1c=![];_0x6b68bc['scheduleType']&&(_0x2eb27a[_0x42f17d(0x23c)]=_0x6b68bc[_0x42f17d(0x247)],_0x577d1c=!![]);_0x6b68bc[_0x42f17d(0x1ce)]&&(_0x2eb27a[_0x42f17d(0x1cb)]=_0x6b68bc[_0x42f17d(0x1ce)],_0x577d1c=!![]);_0x6b68bc[_0x42f17d(0x261)]!==undefined&&_0x6b68bc[_0x42f17d(0x261)]!==null&&(_0x2eb27a[_0x42f17d(0x21d)]=_0x6b68bc[_0x42f17d(0x261)],_0x577d1c=!![]);_0x6b68bc['startAt']!==undefined&&(_0x2eb27a[_0x42f17d(0x1e3)]=_0x6b68bc[_0x42f17d(0x22b)],_0x577d1c=!![]);_0x6b68bc['endOn']!==undefined&&(_0x2eb27a[_0x42f17d(0x1ff)]=_0x6b68bc[_0x42f17d(0x1ee)],_0x577d1c=!![]);_0x6b68bc['timezone']&&(_0x2eb27a['timezone']=_0x6b68bc['timezone'],_0x577d1c=!![]);_0x577d1c&&(_0x4a0e75['schedule']=_0x2eb27a);(_0x6b68bc['notifyOn']&&_0x6b68bc[_0x42f17d(0x259)]['length']>0x0||_0x6b68bc['emailRecipients']&&_0x6b68bc['emailRecipients'][_0x42f17d(0x1f4)]>0x0)&&(_0x4a0e75[_0x42f17d(0x1d3)]={},_0x6b68bc['notifyOn']&&_0x6b68bc['notifyOn']['length']>0x0&&(_0x4a0e75[_0x42f17d(0x1d3)]['notify_on']=_0x6b68bc[_0x42f17d(0x259)]),_0x6b68bc['emailRecipients']&&_0x6b68bc['emailRecipients'][_0x42f17d(0x1f4)]>0x0&&(_0x4a0e75[_0x42f17d(0x1d3)][_0x42f17d(0x20f)]=_0x6b68bc['emailRecipients']['map'](_0x1c1dc9=>{const _0x28a316=_0x42f17d,_0x39d7c2=_0x5f0193?.[_0x28a316(0x235)](_0x1c1dc9);return _0x39d7c2??String(_0x1c1dc9);})));_0x6b68bc[_0x42f17d(0x218)]&&Object['keys'](_0x6b68bc[_0x42f17d(0x218)])[_0x42f17d(0x1f4)]>0x0&&(_0x4a0e75['connector_config']=normalizeConnectorConfigForYaml(_0x6b68bc[_0x42f17d(0x218)]));_0x6b68bc[_0x42f17d(0x1cf)]&&(_0x4a0e75[_0x42f17d(0x260)]=_0x6b68bc[_0x42f17d(0x1cf)]);if(_0x6b68bc[_0x42f17d(0x267)]){const _0x1b9187={},_0x54d302=_0x6b68bc[_0x42f17d(0x267)];_0x54d302[_0x42f17d(0x1c4)]&&_0x54d302[_0x42f17d(0x1c4)][_0x42f17d(0x1f4)]>0x0&&(_0x1b9187['columns']=_0x54d302[_0x42f17d(0x1c4)]['filter'](_0x334af1=>_0x334af1&&getColumnName(_0x334af1))[_0x42f17d(0x219)](_0x3140d2=>({'name':getColumnName(_0x3140d2),..._0x3140d2['type']&&{'type':_0x3140d2[_0x42f17d(0x23c)]},..._0x3140d2['visibility']&&{'visibility':_0x3140d2[_0x42f17d(0x1e2)]}}))),_0x54d302[_0x42f17d(0x250)]&&(_0x1b9187[_0x42f17d(0x201)]=_0x54d302[_0x42f17d(0x250)]),_0x54d302['joinRow']!==undefined&&(_0x1b9187[_0x42f17d(0x1be)]=_0x54d302[_0x42f17d(0x23e)]),_0x54d302[_0x42f17d(0x213)]&&(_0x1b9187[_0x42f17d(0x1bc)]=_0x54d302['joinStrategy']),_0x54d302[_0x42f17d(0x241)]&&(_0x1b9187['formatting']=_0x54d302[_0x42f17d(0x241)]),_0x54d302[_0x42f17d(0x20a)]&&_0x54d302[_0x42f17d(0x20a)]['length']>0x0&&(_0x1b9187[_0x42f17d(0x1c6)]=_0x54d302[_0x42f17d(0x20a)]),Object[_0x42f17d(0x1bb)](_0x1b9187)['length']>0x0&&(_0x4a0e75[_0x42f17d(0x245)]=_0x1b9187);}return _0x4a0e75;}export function segmentWithActivationsToYaml(_0x54e6b4,_0x5cb45e,_0xa6fa3a,_0x458e4d,_0x4ebd39){const _0x498a59=a149_0x2d6e43,_0x11f6c5=segmentResponseToDefSync(_0x54e6b4,_0xa6fa3a);return _0x5cb45e['length']>0x0&&(_0x11f6c5[_0x498a59(0x20c)]=_0x5cb45e[_0x498a59(0x219)](_0x416519=>activationResponseToDef(_0x416519,_0x458e4d,_0x4ebd39))),_0x11f6c5;}function normalizeColumn(_0x54fc35){const _0x30f9c1=a149_0x2d6e43;if(typeof _0x54fc35===_0x30f9c1(0x227))return{'column':_0x54fc35,'source':{'column':_0x54fc35}};return{'column':_0x54fc35['name'],'source':{'column':_0x54fc35[_0x30f9c1(0x1f6)]},..._0x54fc35[_0x30f9c1(0x23c)]&&{'type':_0x54fc35['type']},..._0x54fc35[_0x30f9c1(0x1e2)]&&{'visibility':_0x54fc35[_0x30f9c1(0x1e2)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object['keys'](ActivationDefSchema['shape']));export function warnUnrecognizedActivationFields(_0x163597,_0x8e7582){const _0x3d5c43=a149_0x2d6e43,_0x428ed2=Object['keys'](_0x163597)['filter'](_0x2e7aaa=>!KNOWN_ACTIVATION_FIELDS[_0x3d5c43(0x22a)](_0x2e7aaa));if(_0x428ed2[_0x3d5c43(0x1f4)]>0x0){const _0x10aedb=_0x428ed2['map'](_0x2a88ce=>_0x3d5c43(0x1d0)+_0x2a88ce+'\x22')[_0x3d5c43(0x268)]('\x0a');console[_0x3d5c43(0x21e)](_0x3d5c43(0x1db)+_0x8e7582+_0x3d5c43(0x256)+_0x10aedb);}}export async function activationDefToCreateRequest(_0x255706,_0x11c25d){const _0x565b33=a149_0x2d6e43;warnUnrecognizedActivationFields(_0x255706,_0x255706[_0x565b33(0x1f6)]);const _0x362676=_0x11c25d?.[_0x565b33(0x1d7)],_0x5a900a=_0x11c25d?.[_0x565b33(0x230)],_0x238cb7=_0x255706[_0x565b33(0x224)];let _0x938fbb;const _0x5646fa=parseInt(_0x238cb7,0xa);if(!isNaN(_0x5646fa)&&String(_0x5646fa)===_0x238cb7)_0x938fbb=_0x5646fa;else{const _0x3e2af0=_0x5a900a?.[_0x565b33(0x235)](_0x238cb7);if(_0x3e2af0===undefined)throw new SDKError(ErrorCode[_0x565b33(0x1b7)],_0x565b33(0x25a)+_0x238cb7,undefined,{'helpText':_0x565b33(0x253)});_0x938fbb=_0x3e2af0;}const _0x48a532={'name':_0x255706[_0x565b33(0x1f6)],'connectionId':_0x938fbb};_0x255706['description']&&(_0x48a532['description']=_0x255706[_0x565b33(0x1b9)]);let _0x3c3881=[];_0x255706[_0x565b33(0x1c4)]&&_0x255706[_0x565b33(0x1c4)][_0x565b33(0x1f4)]>0x0&&(_0x3c3881=_0x255706[_0x565b33(0x1c4)][_0x565b33(0x228)](_0x26b4f2=>_0x26b4f2!=null)[_0x565b33(0x219)](normalizeColumn));_0x3c3881[_0x565b33(0x1f4)]>0x0&&(_0x48a532['columns']=_0x3c3881);_0x255706[_0x565b33(0x254)]!==undefined&&(_0x255706['all_columns']===![]&&_0x3c3881[_0x565b33(0x1f4)]===0x0?_0x48a532[_0x565b33(0x266)]=!![]:_0x48a532['allColumns']=_0x255706[_0x565b33(0x254)]);if(_0x255706['schedule']){const _0x4b0940=_0x255706['schedule'],_0x201c55=_0x4b0940[_0x565b33(0x23c)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x4b0940[_0x565b33(0x1cb)]];_0x201c55&&(_0x48a532[_0x565b33(0x247)]=_0x201c55);const _0x107c8c=_0x4b0940[_0x565b33(0x1cb)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x4b0940[_0x565b33(0x23c)]];_0x107c8c&&(_0x48a532['repeatUnit']=_0x107c8c);_0x4b0940[_0x565b33(0x21d)]!==undefined&&(_0x48a532[_0x565b33(0x261)]=_0x4b0940['repeat_frequency']);_0x4b0940['repeat_sub_frequency']&&(_0x48a532[_0x565b33(0x1b5)]=_0x4b0940[_0x565b33(0x22f)]);_0x4b0940['start_at']!==undefined&&(_0x48a532['startAt']=_0x4b0940[_0x565b33(0x1e3)]);_0x4b0940[_0x565b33(0x1ff)]!==undefined&&(_0x48a532[_0x565b33(0x1ee)]=_0x4b0940[_0x565b33(0x1ff)]);_0x4b0940[_0x565b33(0x1fb)]&&(_0x48a532[_0x565b33(0x1fb)]=_0x4b0940[_0x565b33(0x1fb)]);if(_0x201c55&&_0x201c55!==_0x565b33(0x23a)&&_0x201c55!==_0x565b33(0x215)&&_0x4b0940['start_at']){const _0x2192a1=_0x4b0940[_0x565b33(0x1e3)]['match'](/T(\d{2}:\d{2})/);_0x2192a1&&(_0x48a532[_0x565b33(0x24c)]=_0x2192a1[0x1]);}}_0x255706['notification']&&(_0x255706[_0x565b33(0x1d3)][_0x565b33(0x21b)]&&(_0x48a532['notifyOn']=_0x255706[_0x565b33(0x1d3)][_0x565b33(0x21b)]),_0x255706[_0x565b33(0x1d3)][_0x565b33(0x20f)]&&(_0x48a532[_0x565b33(0x1b3)]=_0x255706['notification'][_0x565b33(0x20f)][_0x565b33(0x219)](_0x3c214f=>{const _0x54ea4d=_0x565b33,_0x1fce29=Number(_0x3c214f);if(!isNaN(_0x1fce29)&&String(_0x1fce29)===_0x3c214f)return _0x1fce29;const _0x15d712=_0x362676?.[_0x54ea4d(0x235)](_0x3c214f['toLowerCase']());if(_0x15d712===undefined)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x54ea4d(0x1fe)+_0x3c214f+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x15d712;})));if(_0x255706['connector_config']){const _0x2ca2d2=_0x11c25d?.[_0x565b33(0x232)]?.[_0x565b33(0x235)](_0x238cb7);if(_0x2ca2d2&&_0x11c25d?.[_0x565b33(0x1c3)])try{const _0x309f16=await _0x11c25d[_0x565b33(0x1c3)](_0x2ca2d2),_0x23fad1=validateConnectorConfig(_0x255706[_0x565b33(0x246)],_0x309f16);if(!_0x23fad1[_0x565b33(0x23f)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],_0x565b33(0x217)+_0x255706[_0x565b33(0x1f6)]+_0x565b33(0x1f0)+formatValidationErrors(_0x23fad1[_0x565b33(0x1ba)]),undefined,{'helpText':_0x565b33(0x236)+_0x2ca2d2+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x309f16)});if(_0x23fad1[_0x565b33(0x1dc)][_0x565b33(0x1f4)]>0x0){const _0x130e87=formatValidationWarnings(_0x23fad1[_0x565b33(0x1dc)]);console[_0x565b33(0x21e)](_0x565b33(0x26f)+_0x255706[_0x565b33(0x1f6)]+_0x565b33(0x1f0)+_0x130e87);}_0x48a532[_0x565b33(0x218)]=transformConfigToLegacy(_0x255706[_0x565b33(0x246)],_0x309f16);}catch(_0x81dcf1){if(_0x81dcf1 instanceof SDKError&&_0x81dcf1[_0x565b33(0x258)]===ErrorCode[_0x565b33(0x21f)])_0x48a532[_0x565b33(0x218)]=_0x255706[_0x565b33(0x246)];else throw _0x81dcf1;}else _0x48a532['connectorConfig']=_0x255706[_0x565b33(0x246)];}else _0x48a532['connectorConfig']={};_0x255706[_0x565b33(0x260)]!==undefined&&(_0x48a532[_0x565b33(0x1cf)]=_0x255706['activation_template_id']);if(_0x255706[_0x565b33(0x245)]){const _0x115201=_0x255706[_0x565b33(0x245)],_0x335f73={};if(_0x115201[_0x565b33(0x1c4)]&&_0x115201['columns'][_0x565b33(0x1f4)]>0x0){const _0x3c19d6=_0x115201['columns'][_0x565b33(0x228)](_0x28db57=>_0x28db57&&_0x28db57[_0x565b33(0x1f6)])['map'](normalizeColumn);_0x3c19d6[_0x565b33(0x1f4)]>0x0&&(_0x335f73[_0x565b33(0x1c4)]=_0x3c19d6);}_0x115201[_0x565b33(0x201)]&&(_0x335f73[_0x565b33(0x250)]=_0x115201[_0x565b33(0x201)]);_0x115201[_0x565b33(0x1bc)]&&(_0x335f73['joinStrategy']=_0x115201[_0x565b33(0x1bc)]);if(_0x115201[_0x565b33(0x1be)]!==undefined)_0x335f73[_0x565b33(0x23e)]=_0x115201['join_row'];else{if(_0x115201[_0x565b33(0x1bc)]===_0x565b33(0x1bf)||_0x115201[_0x565b33(0x1bc)]===_0x565b33(0x1c9))_0x335f73[_0x565b33(0x23e)]=0x1;else _0x115201[_0x565b33(0x1bc)]===_0x565b33(0x1ed)&&(_0x335f73['joinRow']=null);}_0x115201[_0x565b33(0x241)]&&(_0x335f73[_0x565b33(0x241)]=_0x115201[_0x565b33(0x241)]),_0x115201[_0x565b33(0x1c6)]&&(_0x335f73[_0x565b33(0x20a)]=_0x115201[_0x565b33(0x1c6)]),_0x48a532[_0x565b33(0x267)]=_0x335f73;}return _0x255706['nested_workflow_project_name']&&(_0x48a532[_0x565b33(0x251)]=_0x255706[_0x565b33(0x263)]),_0x255706[_0x565b33(0x1c1)]&&(_0x48a532[_0x565b33(0x240)]=_0x255706['nested_workflow_name']),_0x255706[_0x565b33(0x264)]!==undefined&&(_0x48a532[_0x565b33(0x21c)]=_0x255706[_0x565b33(0x264)]),_0x48a532;}export async function activationDefToUpdateRequest(_0x23d431,_0x24c2c0){return activationDefToCreateRequest(_0x23d431,_0x24c2c0);}export function deepSortObject(_0x3291d3){const _0x459d68=a149_0x2d6e43;if(_0x3291d3===null||typeof _0x3291d3!==_0x459d68(0x1f7))return _0x3291d3;if(Array[_0x459d68(0x1f2)](_0x3291d3))return _0x3291d3[_0x459d68(0x219)](deepSortObject)[_0x459d68(0x1eb)]((_0xb011a,_0x5ad9a3)=>JSON[_0x459d68(0x20e)](_0xb011a)[_0x459d68(0x1fc)](JSON[_0x459d68(0x20e)](_0x5ad9a3)));const _0x46bd6d=_0x3291d3;if(_0x46bd6d[_0x459d68(0x23c)]===_0x459d68(0x20b)&&Array[_0x459d68(0x1f2)](_0x46bd6d[_0x459d68(0x212)])){const _0x4c77fb={};for(const _0x280a4f of Object['keys'](_0x46bd6d)[_0x459d68(0x1eb)]()){_0x4c77fb[_0x280a4f]=_0x280a4f===_0x459d68(0x212)?_0x46bd6d[_0x459d68(0x212)]['map'](deepSortObject):deepSortObject(_0x46bd6d[_0x280a4f]);}return _0x4c77fb;}const _0x39a328={};for(const _0x404726 of Object[_0x459d68(0x1bb)](_0x3291d3)['sort']()){_0x39a328[_0x404726]=deepSortObject(_0x3291d3[_0x404726]);}return _0x39a328;}export function serializeRule(_0xfbde7b){const _0x356970=a149_0x2d6e43;return JSON[_0x356970(0x20e)](deepSortObject(_0xfbde7b));}export function normalizeRuleForMatching(_0x30a0cd){return normalizeConditionsForMatching(_0x30a0cd);}function normalizeConditionsForMatching(_0x96cc29){const _0x57a94c=a149_0x2d6e43;if(_0x96cc29===null||typeof _0x96cc29!==_0x57a94c(0x1f7))return _0x96cc29;if(Array['isArray'](_0x96cc29))return _0x96cc29['map'](normalizeConditionsForMatching);const _0x38c122=_0x96cc29;if((_0x38c122['type']==='include'||_0x38c122[_0x57a94c(0x23c)]===_0x57a94c(0x243))&&typeof _0x38c122['segment']===_0x57a94c(0x227))return{..._0x38c122,'segment':_0x57a94c(0x1f8)};const _0x53d2c9={};for(const _0x86f80e of Object[_0x57a94c(0x1bb)](_0x38c122)){_0x53d2c9[_0x86f80e]=normalizeConditionsForMatching(_0x38c122[_0x86f80e]);}return _0x53d2c9;}export function serializeRuleForMatching(_0x399901){const _0x2b2d6d=a149_0x2d6e43;return JSON[_0x2b2d6d(0x20e)](deepSortObject(normalizeRuleForMatching(_0x399901)));}export function expandSegmentReferences(_0x109c95,_0x31d7ce,_0x33281d=new Set()){return expandConditions(_0x109c95,_0x31d7ce,_0x33281d);}function expandConditions(_0x3d7051,_0xea5456,_0x2a3945){const _0x13d455=a149_0x2d6e43;if(_0x3d7051===null||typeof _0x3d7051!==_0x13d455(0x1f7))return _0x3d7051;if(Array[_0x13d455(0x1f2)](_0x3d7051))return _0x3d7051[_0x13d455(0x219)](_0x23248e=>expandConditions(_0x23248e,_0xea5456,_0x2a3945));const _0x2d34c2=_0x3d7051;if((_0x2d34c2[_0x13d455(0x23c)]==='include'||_0x2d34c2[_0x13d455(0x23c)]===_0x13d455(0x243))&&typeof _0x2d34c2[_0x13d455(0x23b)]===_0x13d455(0x227)){const _0x13506a=_0x2d34c2['segment'],_0x58d55b=_0xea5456[_0x13d455(0x235)](_0x13506a);if(_0x58d55b&&!_0x2a3945[_0x13d455(0x22a)](_0x13506a)){const _0x212dcd=new Set(_0x2a3945);_0x212dcd[_0x13d455(0x1ec)](_0x13506a);const _0x45d63c=expandConditions(_0x58d55b,_0xea5456,_0x212dcd);return{'type':_0x2d34c2['type'],'expanded_rule':_0x45d63c};}return{'type':_0x2d34c2[_0x13d455(0x23c)],'expanded_rule':'__UNRESOLVED__'};}const _0x1f1b33={};for(const _0x3d1096 of Object[_0x13d455(0x1bb)](_0x2d34c2)){_0x1f1b33[_0x3d1096]=expandConditions(_0x2d34c2[_0x3d1096],_0xea5456,_0x2a3945);}return _0x1f1b33;}export function serializeExpandedRule(_0x4ac6ff,_0x1f50a4){const _0x444231=a149_0x2d6e43,_0x33c81e=expandSegmentReferences(_0x4ac6ff,_0x1f50a4);return JSON[_0x444231(0x20e)](deepSortObject(_0x33c81e));}export function createSegmentNameContext(_0x5c0e93){const _0x198cf4=a149_0x2d6e43,_0x5dac58=new Set(),_0x2cf1dd=new Map(),_0x268de9=new Map();if(_0x5c0e93)for(const [_0x589662,_0xf698a2]of Object[_0x198cf4(0x1ca)](_0x5c0e93)){if(_0xf698a2['rule']){const _0x8ff585=serializeRule(_0xf698a2['rule']);_0x268de9[_0x198cf4(0x25c)](_0x8ff585,_0x589662),_0x5dac58[_0x198cf4(0x1ec)](_0x589662);}}return{'usedNames':_0x5dac58,'ruleHashToName':_0x2cf1dd,'localRuleToName':_0x5c0e93?_0x268de9:undefined};}export function resolveSegmentName(_0x2c6e24,_0x53a0b8,_0x866586,_0x516fff){const _0x14d721=a149_0x2d6e43,_0x2b8f2d=serializeRule(_0x53a0b8);if(_0x866586[_0x14d721(0x25e)]){const _0x19fcf3=_0x866586[_0x14d721(0x25e)][_0x14d721(0x235)](_0x2b8f2d);if(_0x19fcf3)return{'name':_0x19fcf3,'isDuplicate':![],'isLocalMatch':!![]};}const _0x5ae48f=_0x866586['ruleHashToName'][_0x14d721(0x235)](_0x2b8f2d);if(_0x5ae48f)return{'name':_0x5ae48f,'isDuplicate':!![],'isLocalMatch':![]};const _0x2c9654=_0x516fff(_0x2c6e24);let _0x43778f=_0x2c9654||_0x2c6e24,_0x413aa4=_0x43778f,_0x3106a8=0x2;while(_0x866586[_0x14d721(0x226)][_0x14d721(0x22a)](_0x413aa4)){_0x413aa4=_0x43778f+'_'+_0x3106a8,_0x3106a8++;}return _0x866586[_0x14d721(0x226)][_0x14d721(0x1ec)](_0x413aa4),_0x866586[_0x14d721(0x1c0)][_0x14d721(0x25c)](_0x2b8f2d,_0x413aa4),{'name':_0x413aa4,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x15d974){const _0x20ca69=[],_0x49cda6=_0x46ab49=>{const _0x10286f=a149_0x1ffa;if(!_0x46ab49||typeof _0x46ab49!=='object')return;if(Array[_0x10286f(0x1f2)](_0x46ab49)){_0x46ab49[_0x10286f(0x242)](_0x49cda6);return;}const _0x2ead21=_0x46ab49;(_0x2ead21[_0x10286f(0x23c)]===_0x10286f(0x1e8)||_0x2ead21[_0x10286f(0x23c)]===_0x10286f(0x243))&&typeof _0x2ead21[_0x10286f(0x23b)]===_0x10286f(0x227)&&_0x20ca69[_0x10286f(0x202)](_0x2ead21[_0x10286f(0x23b)]);for(const _0x280065 of Object[_0x10286f(0x1e5)](_0x2ead21)){_0x49cda6(_0x280065);}};return _0x49cda6(_0x15d974),_0x20ca69;}export function validateSegmentRule(_0x57bf2d,_0x3ea533){const _0x47f48f=a149_0x2d6e43;if(!_0x3ea533||!_0x3ea533[_0x47f48f(0x212)])return;for(let _0xa1c527=0x0;_0xa1c527<_0x3ea533['conditions'][_0x47f48f(0x1f4)];_0xa1c527++){const _0x587186=_0x3ea533[_0x47f48f(0x212)][_0xa1c527];if(_0x47f48f(0x23c)in _0x587186&&_0x587186[_0x47f48f(0x23c)]==='Value'){const _0x29b1c3=_0x587186,_0x59071b=_0x29b1c3[_0x47f48f(0x24d)]||_0x29b1c3[_0x47f48f(0x210)];if((!_0x29b1c3[_0x47f48f(0x208)]||_0x29b1c3['attribute']==='')&&!_0x59071b)throw new SDKError(ErrorCode[_0x47f48f(0x1e0)],_0x47f48f(0x22c)+_0x57bf2d+_0x47f48f(0x237)+('conditions['+_0xa1c527+_0x47f48f(0x1d9))+_0x47f48f(0x23d));}}}
|
|
1
|
+
const a149_0x16ee03=a149_0x4f28;(function(_0x402e89,_0x4c12e7){const _0x358b85=a149_0x4f28,_0x2810fd=_0x402e89();while(!![]){try{const _0x5ad695=parseInt(_0x358b85(0x117))/0x1*(-parseInt(_0x358b85(0x125))/0x2)+-parseInt(_0x358b85(0xf8))/0x3+-parseInt(_0x358b85(0x15b))/0x4*(parseInt(_0x358b85(0x153))/0x5)+parseInt(_0x358b85(0x13d))/0x6+parseInt(_0x358b85(0xd2))/0x7*(parseInt(_0x358b85(0x13e))/0x8)+parseInt(_0x358b85(0xaf))/0x9*(parseInt(_0x358b85(0x102))/0xa)+-parseInt(_0x358b85(0xd8))/0xb*(-parseInt(_0x358b85(0xff))/0xc);if(_0x5ad695===_0x4c12e7)break;else _0x2810fd['push'](_0x2810fd['shift']());}catch(_0xaa04d3){_0x2810fd['push'](_0x2810fd['shift']());}}}(a149_0x5a26,0xc4bad));import*as a149_0x16d5e3 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';function a149_0x5a26(){const _0x231388=['order_by','null','CONNECTOR_SCHEMA_NOT_FOUND','stringify','max','get','Equal','minValue','timeWindow','localeCompare','leftValue','CONNECTION_NOT_FOUND','rightValue','connector_config\x20for\x20activation\x20\x22','min','segment','syndicationBehavior','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','repeat_sub_frequency','values','32410DyUFnp','orderColumn','warn','start_at','kind','unit','not','getSchema','672SpwWVA','nestedWorkflowProjectName','\x22:\x0a','nested_workflow_name','activations:','hourly','attribute_name','startAt','18TjbGmb','type','connector_config','aggregation','connectionNameToTypeMap','Unknown\x20email\x20recipient:\x20','usedNames','emailRecipients','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','email_recipients','source','every','CountDistinct','keys','notification','has','__SEGMENT_REF__','repeat_frequency','any','schedule','activationTemplateId','isArray','formatting','maxValue','column','join_strategy','Segment\x20description','attributes','minute','map','folder','join','all_columns','TimeWithinPast','CONNECTOR_INVALID_CONFIG','6650609SuqrJM','conditions','repeat_unit','minutes_interval','value','notify_on','11pzytfq','].attribute\x20cannot\x20be\x20empty.\x0a','\x27:\x20','Column','TimeRange','valid','__UNRESOLVED__','description','activations','timezone','endOn','name','First','warnings','resolveSegmentName','length','connectionId','funnel_stage','orderBy','realtime','activationParams','columns','INVALID_ARGUMENT','Reference','none','behaviorTableName','rule:','replace','behavior_table','repeatSubFrequency','Unknown\x20connection:\x20','batch','4727433BwFXoq','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','rightValues','repeatUnit','filter','exclude','string','23644428StvxMn','errors','daily','1022690xKvRKR','attribute','joinStrategy','joinRow','groupingColumns','behavior','Between','Value','join_row','Last','visibility','Behavior','activation_template_id','object','lock_enabled','reverse','lockEnabled','isVisible','scheduleOption','weekly','sort','377829xUHOOl','segmentFolderId','expr','shape','code','end_on','Connector:\x20','push','include','connection','emailToIdMap','limit','TimeWithinNext','add','6ojCmkV','arrayMatching','visible','And','Composite','connectorConfig','nested_workflow_project_name','scheduleType','duration','set','nestedWorkflowName','ruleHashToName','notifyOn','Count','hour','from','rule','all','Please\x20specify\x20a\x20valid\x20attribute\x20name.','repeatFrequency','parse','All','operator','allColumns','8874510RAxxsq','8SdesOv'];a149_0x5a26=function(){return _0x231388;};return a149_0x5a26();}import{ActivationDefSchema}from'./types/activation-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':'day','hourly':a149_0x16ee03(0x133),'weekly':'week','monthly':'month','minutes_interval':a149_0x16ee03(0xcb)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a149_0x16ee03(0x101),'hour':a149_0x16ee03(0x160),'week':a149_0x16ee03(0x115),'month':'monthly','minute':a149_0x16ee03(0xd5)};function filterRuleAsRuleDef(_0x4f5d21){return _0x4f5d21;}function ruleDefAsFilterRule(_0x9d8262){return _0x9d8262;}export function segmentResponseToDefSync(_0x1a39bc,_0x1cc3b0){const _0x581195=a149_0x16ee03,_0x38abce=_0x1a39bc['rule']&&_0x581195(0xb0)in _0x1a39bc['rule']&&_0x1a39bc[_0x581195(0x135)][_0x581195(0xb0)];return{'type':_0x581195(0x14e),'name':_0x1a39bc['name'],..._0x1a39bc[_0x581195(0xdf)]&&{'description':_0x1a39bc['description']},..._0x1cc3b0&&{'folder':_0x1cc3b0},..._0x38abce&&{'rule':apiRuleToYaml(_0x1a39bc['rule'])},..._0x1a39bc['kind']!==undefined&&{'kind':_0x1a39bc[_0x581195(0x157)]===0x0?_0x581195(0xf7):_0x1a39bc[_0x581195(0x157)]===0x1?_0x581195(0xeb):_0x581195(0xe9)},..._0x1a39bc[_0x581195(0x113)]!==undefined&&{'visible':_0x1a39bc[_0x581195(0x113)]}};}export async function segmentResponseToDef(_0x35e35f,_0x1c2d7e,_0x5f1516){const _0x4e5e1f=a149_0x16ee03,_0x268230=segmentResponseToDefSync(_0x35e35f,_0x5f1516);if(!_0x1c2d7e||!_0x1c2d7e[_0x4e5e1f(0xe6)])return _0x268230;return _0x268230['rule']&&(_0x268230[_0x4e5e1f(0x135)]=await resolveRuleSegmentRefs(_0x268230[_0x4e5e1f(0x135)],_0x1c2d7e[_0x4e5e1f(0xe6)])),_0x268230;}export function apiRuleToYaml(_0x40e63c){const _0x1fc5d3=a149_0x16ee03;if(_0x40e63c[_0x1fc5d3(0xb0)]==='Composite')return{'type':_0x1fc5d3(0x129),'conditions':(_0x40e63c[_0x1fc5d3(0xd3)]||[])[_0x1fc5d3(0xcc)](apiConditionToYaml),..._0x40e63c['description']!==undefined&&{'description':_0x40e63c[_0x1fc5d3(0xdf)]},..._0x40e63c[_0x1fc5d3(0x119)]!==undefined&&{'expr':_0x40e63c['expr']}};const _0x27ae6f=(_0x40e63c[_0x1fc5d3(0xd3)]||[])['flatMap'](_0x563dfb=>{const _0x52f52d=apiConditionToYaml(_0x563dfb);if(isCompositeType(_0x52f52d)&&_0x52f52d['description']!==undefined){const _0x5a22e0=_0x52f52d;if(_0x5a22e0['conditions']['length']===0x1)return _0x5a22e0['conditions'];return[{'type':_0x5a22e0['type'],'conditions':_0x5a22e0['conditions']}];}return[_0x52f52d];});if(_0x27ae6f[_0x1fc5d3(0xe7)]===0x1&&!_0x40e63c['description']&&isCompositeType(_0x27ae6f[0x0])){const _0x3d9ce0=_0x27ae6f[0x0];if(_0x3d9ce0[_0x1fc5d3(0xb0)]===_0x40e63c['type']&&_0x3d9ce0[_0x1fc5d3(0xd3)]&&_0x3d9ce0[_0x1fc5d3(0xdf)]===undefined)return{'type':_0x40e63c['type'],'conditions':_0x3d9ce0[_0x1fc5d3(0xd3)]};}return{'type':_0x40e63c['type'],'conditions':_0x27ae6f};}export async function resolveRuleSegmentRefs(_0x11b0aa,_0x4e6013){return transformRuleSegmentRefs(_0x11b0aa,_0x4e6013,_0xc837e9=>/^\d+$/['test'](_0xc837e9));}async function transformConditionSegmentRefs(_0x57e43e,_0x3efaac,_0x33a7e0,_0x4d6085){const _0x3de982=a149_0x16ee03;if(_0x3de982(0x14e)in _0x57e43e&&(_0x57e43e[_0x3de982(0xb0)]===_0x3de982(0x11f)||_0x57e43e['type']===_0x3de982(0xfd))){const _0x1a9eda=_0x57e43e;if(_0x33a7e0(_0x1a9eda[_0x3de982(0x14e)]))return{..._0x1a9eda,'segment':await _0x3efaac(_0x1a9eda['segment'])};return _0x57e43e;}if(_0x3de982(0xd3)in _0x57e43e&&_0x57e43e['conditions']){const _0x37ebcb=_0x57e43e,_0x265637=await Promise[_0x3de982(0x136)](_0x37ebcb[_0x3de982(0xd3)][_0x3de982(0xcc)](_0x2a2508=>transformConditionSegmentRefs(_0x2a2508,_0x3efaac,_0x33a7e0,_0x4d6085)));return{..._0x37ebcb,'conditions':_0x265637};}if(_0x3de982(0xfc)in _0x57e43e&&_0x57e43e[_0x3de982(0xfc)]){const _0x1197af=_0x57e43e,_0x30e7ee=await _0x4d6085(filterRuleAsRuleDef(_0x1197af[_0x3de982(0xfc)]),_0x3efaac);return{..._0x1197af,'filter':ruleDefAsFilterRule(_0x30e7ee)};}return _0x57e43e;}async function transformRuleSegmentRefs(_0x224959,_0x237fe5,_0x15e8ad){const _0x131837=a149_0x16ee03,_0x491d19=(_0x4766ac,_0x1b6494)=>transformRuleSegmentRefs(_0x4766ac,_0x1b6494,_0x15e8ad),_0x3e7c59=await Promise[_0x131837(0x136)](_0x224959[_0x131837(0xd3)][_0x131837(0xcc)](_0x330cfd=>transformConditionSegmentRefs(_0x330cfd,_0x237fe5,_0x15e8ad,_0x491d19)));return{..._0x224959,'conditions':_0x3e7c59};}export async function resolveRuleSegmentIds(_0x5c85bd,_0x32c5e3){return transformRuleSegmentRefs(_0x5c85bd,_0x32c5e3,_0x173614=>!/^\d+$/['test'](_0x173614));}function isCompositeType(_0x28540a){const _0x40536e=a149_0x16ee03;return _0x28540a[_0x40536e(0xb0)]===_0x40536e(0x128)||_0x28540a['type']==='Or'||_0x28540a[_0x40536e(0xb0)]===_0x40536e(0x129);}function isBehaviorApiCondition(_0x2ef48c){const _0xe5a5b6=a149_0x16ee03;if(!_0x2ef48c[_0xe5a5b6(0x149)]?.[_0xe5a5b6(0xb9)]?.['name'])return![];return!![];}function apiConditionToYaml(_0x5c35cb){const _0x27d4ce=a149_0x16ee03;if(_0x5c35cb[_0x27d4ce(0xb0)]===_0x27d4ce(0x128)||_0x5c35cb[_0x27d4ce(0xb0)]==='Or'){if(_0x5c35cb[_0x27d4ce(0xd3)]){const _0x43758d=_0x5c35cb[_0x27d4ce(0xd3)][_0x27d4ce(0xcc)](apiConditionToYaml),_0x112315=_0x5c35cb[_0x27d4ce(0xdf)]!==undefined;if(_0x43758d['length']===0x1&&!_0x112315)return _0x43758d[0x0];return{'type':_0x5c35cb[_0x27d4ce(0xb0)],'conditions':_0x43758d,..._0x5c35cb['description']!==undefined&&{'description':_0x5c35cb['description']}};}}if(_0x5c35cb[_0x27d4ce(0xb0)]===_0x27d4ce(0x129)&&_0x5c35cb[_0x27d4ce(0xd3)])return{'type':_0x27d4ce(0x129),'conditions':_0x5c35cb[_0x27d4ce(0xd3)][_0x27d4ce(0xcc)](apiConditionToYaml),..._0x5c35cb['description']!==undefined&&{'description':_0x5c35cb['description']},..._0x5c35cb[_0x27d4ce(0x119)]!==undefined&&{'expr':_0x5c35cb[_0x27d4ce(0x119)]}};if(_0x5c35cb[_0x27d4ce(0xb0)]===_0x27d4ce(0x109)&&_0x5c35cb[_0x27d4ce(0x149)]&&_0x5c35cb[_0x27d4ce(0x13b)]){const _0x5b7abd=_0x5c35cb[_0x27d4ce(0x149)]['aggregation']?buildAggregationDefFromApi(_0x5c35cb[_0x27d4ce(0x149)][_0x27d4ce(0xb2)]):undefined;if(isBehaviorApiCondition(_0x5c35cb)){const _0x296240=_0x5c35cb['leftValue'][_0x27d4ce(0xb9)][_0x27d4ce(0xe3)];return{'type':'Behavior','attribute':'','operator':apiOperatorToYaml(_0x5c35cb[_0x27d4ce(0x13b)]),..._0x5c35cb[_0x27d4ce(0x126)]&&_0x5c35cb[_0x27d4ce(0x126)]!==_0x27d4ce(0xc1)?{'arrayMatching':_0x5c35cb[_0x27d4ce(0x126)]}:{},..._0x5c35cb[_0x27d4ce(0xfd)]?{'exclude':_0x5c35cb[_0x27d4ce(0xfd)]}:{},..._0x5b7abd?{'aggregation':_0x5b7abd}:{},'source':_0x296240,..._0x5c35cb['leftValue'][_0x27d4ce(0xfc)]?{'filter':apiRuleToYaml(_0x5c35cb[_0x27d4ce(0x149)][_0x27d4ce(0xfc)])}:{},..._0x5c35cb[_0x27d4ce(0x122)]!==undefined&&_0x5c35cb[_0x27d4ce(0x122)]!==null?{'limit':_0x5c35cb[_0x27d4ce(0x122)]}:{}};}return{'type':'Value','attribute':_0x5c35cb['leftValue'][_0x27d4ce(0xe3)]||'','operator':apiOperatorToYaml(_0x5c35cb['operator']),..._0x5c35cb[_0x27d4ce(0x126)]&&_0x5c35cb['arrayMatching']!=='any'?{'arrayMatching':_0x5c35cb['arrayMatching']}:{},..._0x5c35cb[_0x27d4ce(0xfd)]?{'exclude':_0x5c35cb['exclude']}:{},..._0x5b7abd?{'aggregation':_0x5b7abd}:{},..._0x5c35cb[_0x27d4ce(0x149)]['filter']?{'filter':apiRuleToYaml(_0x5c35cb[_0x27d4ce(0x149)][_0x27d4ce(0xfc)])}:{},..._0x5c35cb[_0x27d4ce(0x122)]!==undefined&&_0x5c35cb[_0x27d4ce(0x122)]!==null?{'limit':_0x5c35cb[_0x27d4ce(0x122)]}:{}};}if(_0x5c35cb['type']===_0x27d4ce(0xdb)&&_0x5c35cb[_0x27d4ce(0xc7)]&&_0x5c35cb[_0x27d4ce(0x13b)])return{'type':'Column','column':_0x5c35cb['column'],'operator':apiOperatorToYaml(_0x5c35cb[_0x27d4ce(0x13b)])};if(_0x5c35cb[_0x27d4ce(0xb0)]==='Reference'&&_0x5c35cb['id'])return{'type':_0x5c35cb['exclude']?'exclude':_0x27d4ce(0x11f),'segment':_0x5c35cb['id']};return{'type':'And','conditions':[]};}function isTemporalOperator(_0x4964a3){const _0x5f0a79=a149_0x16ee03;return _0x4964a3===_0x5f0a79(0xd0)||_0x4964a3===_0x5f0a79(0x123);}function isBetweenOperator(_0x176cf5){const _0x3dcd03=a149_0x16ee03;return _0x176cf5===_0x3dcd03(0x108);}function getEffectiveValue(_0x2de2d5){const _0x5dd0af=a149_0x16ee03,_0x104d7a=_0x2de2d5[_0x5dd0af(0x152)];return _0x2de2d5['value']??_0x104d7a;}function parseNumericValue(_0x43086b){const _0x317f44=a149_0x16ee03;if(typeof _0x43086b===_0x317f44(0x10f)&&_0x43086b!==null)return _0x43086b;if(_0x43086b==='')return _0x43086b;const _0x38d1a3=Number(_0x43086b);return Number['isFinite'](_0x38d1a3)?_0x38d1a3:_0x43086b;}function apiOperatorToYaml(_0x22b6d7){const _0x3e803e=a149_0x16ee03;if(isBetweenOperator(_0x22b6d7[_0x3e803e(0xb0)]))return{'type':mapApiOperatorType(_0x22b6d7[_0x3e803e(0xb0)]),..._0x22b6d7[_0x3e803e(0x159)]!==undefined&&{'not':_0x22b6d7[_0x3e803e(0x159)]},..._0x22b6d7['minValue']!==undefined&&{'min':parseNumericValue(_0x22b6d7[_0x3e803e(0x146)])},..._0x22b6d7[_0x3e803e(0xc6)]!==undefined&&{'max':parseNumericValue(_0x22b6d7[_0x3e803e(0xc6)])}};if(_0x22b6d7[_0x3e803e(0xb0)]===_0x3e803e(0xdc))return{'type':_0x3e803e(0xdc),..._0x22b6d7['not']!==undefined&&{'not':_0x22b6d7[_0x3e803e(0x159)]},..._0x22b6d7['duration']!==undefined&&{'duration':_0x22b6d7[_0x3e803e(0x12d)]},..._0x22b6d7[_0x3e803e(0x134)]!==undefined&&{'from':_0x22b6d7[_0x3e803e(0x134)]},..._0x22b6d7[_0x3e803e(0x111)]!==undefined&&{'reverse':_0x22b6d7[_0x3e803e(0x111)]}};let _0x370717;if(_0x22b6d7[_0x3e803e(0xfa)]&&_0x22b6d7['rightValues'][_0x3e803e(0xe7)]>0x0)_0x370717=_0x22b6d7[_0x3e803e(0xfa)];else{if(_0x22b6d7[_0x3e803e(0x14b)]!==undefined)_0x370717=_0x22b6d7[_0x3e803e(0x14b)];else isTemporalOperator(_0x22b6d7[_0x3e803e(0xb0)])&&_0x22b6d7[_0x3e803e(0xd6)]!==undefined&&(_0x370717=_0x22b6d7['value']);}return{'type':mapApiOperatorType(_0x22b6d7[_0x3e803e(0xb0)]),..._0x22b6d7[_0x3e803e(0x159)]!==undefined&&{'not':_0x22b6d7[_0x3e803e(0x159)]},..._0x370717!==undefined&&{'value':_0x370717},..._0x22b6d7[_0x3e803e(0x158)]!==undefined&&{'unit':_0x22b6d7[_0x3e803e(0x158)]}};}function mapApiOperatorType(_0x3d3ef7){return _0x3d3ef7;}export function segmentDefToCreateRequest(_0x3f92c4,_0x4b2b8a){const _0x2c4216=a149_0x16ee03,_0x555c83={'name':_0x3f92c4[_0x2c4216(0xe3)]};return _0x3f92c4['description']&&(_0x555c83[_0x2c4216(0xdf)]=_0x3f92c4[_0x2c4216(0xdf)]),_0x3f92c4[_0x2c4216(0x135)]&&(_0x555c83[_0x2c4216(0x135)]=yamlRuleToApi(_0x3f92c4[_0x2c4216(0x135)])),_0x3f92c4['kind']&&(_0x555c83[_0x2c4216(0x157)]=_0x3f92c4[_0x2c4216(0x157)]===_0x2c4216(0xf7)?0x0:_0x3f92c4['kind']===_0x2c4216(0xeb)?0x1:0x2),_0x3f92c4[_0x2c4216(0x127)]!==undefined&&(_0x555c83[_0x2c4216(0x113)]=_0x3f92c4[_0x2c4216(0x127)]),_0x4b2b8a&&(_0x555c83[_0x2c4216(0x118)]=_0x4b2b8a),_0x555c83;}export function segmentDefToUpdateRequest(_0x572205){const _0x17cd13=a149_0x16ee03,_0x42d730={'name':_0x572205[_0x17cd13(0xe3)]};return _0x572205[_0x17cd13(0xdf)]!==undefined&&(_0x42d730[_0x17cd13(0xdf)]=_0x572205['description']),_0x572205[_0x17cd13(0x135)]&&(_0x42d730[_0x17cd13(0x135)]=yamlRuleToApi(_0x572205[_0x17cd13(0x135)])),_0x572205[_0x17cd13(0x157)]&&(_0x42d730[_0x17cd13(0x157)]=_0x572205[_0x17cd13(0x157)]===_0x17cd13(0xf7)?0x0:_0x572205['kind']==='realtime'?0x1:0x2),_0x42d730;}export function yamlRuleToApi(_0x16f34d){const _0x19c9ac=a149_0x16ee03;if(_0x16f34d[_0x19c9ac(0xb0)]===_0x19c9ac(0x129))return{'type':'Composite','conditions':_0x16f34d[_0x19c9ac(0xd3)][_0x19c9ac(0xcc)](yamlConditionToApi),..._0x16f34d[_0x19c9ac(0xdf)]!==undefined&&{'description':_0x16f34d[_0x19c9ac(0xdf)]},..._0x16f34d[_0x19c9ac(0x119)]!==undefined&&{'expr':_0x16f34d[_0x19c9ac(0x119)]}};const _0x581d25=_0x16f34d['conditions'][_0x19c9ac(0xcc)](yamlConditionToApi),_0x18ab30=_0x581d25[_0x19c9ac(0xba)](_0x301df2=>isCompositeType(_0x301df2)&&_0x301df2['description']!==undefined);if(!_0x18ab30&&_0x581d25[_0x19c9ac(0xe7)]>0x0){const _0x239f0e=[];for(const _0x2ba282 of _0x581d25){isCompositeType(_0x2ba282)&&_0x2ba282[_0x19c9ac(0xdf)]===undefined&&_0x2ba282[_0x19c9ac(0xd3)]&&_0x2ba282[_0x19c9ac(0xd3)][_0x19c9ac(0xba)](_0x4f6d46=>!isCompositeType(_0x4f6d46))?_0x239f0e[_0x19c9ac(0x11e)]({'type':_0x2ba282['type'],'description':'','conditions':_0x2ba282[_0x19c9ac(0xd3)]}):_0x239f0e[_0x19c9ac(0x11e)]({'type':'And','description':_0x16f34d[_0x19c9ac(0xdf)]||'','conditions':[_0x2ba282]});}return{'type':_0x16f34d[_0x19c9ac(0xb0)],'conditions':_0x239f0e};}return{'type':_0x16f34d[_0x19c9ac(0xb0)],'conditions':_0x581d25,..._0x16f34d['description']&&{'description':_0x16f34d[_0x19c9ac(0xdf)]}};}function yamlFilterRuleToApi(_0x3de916){const _0x546163=a149_0x16ee03,_0x21df91=_0x3de916[_0x546163(0xd3)][_0x546163(0xcc)](yamlConditionToApi);return{'type':_0x3de916[_0x546163(0xb0)],'conditions':_0x21df91};}function yamlConditionToApi(_0xef2469){const _0x314930=a149_0x16ee03;if(_0x314930(0x14e)in _0xef2469&&(_0xef2469[_0x314930(0xb0)]===_0x314930(0x11f)||_0xef2469[_0x314930(0xb0)]===_0x314930(0xfd))){const _0x1550e6=_0xef2469;return{'type':_0x314930(0xef),'id':_0x1550e6['segment'],'exclude':_0x1550e6[_0x314930(0xb0)]===_0x314930(0xfd)};}if(_0xef2469[_0x314930(0xb0)]==='And'||_0xef2469[_0x314930(0xb0)]==='Or'||_0xef2469['type']===_0x314930(0x129)){const _0x5b84d2=_0xef2469;return{'type':_0x5b84d2[_0x314930(0xb0)],'conditions':_0x5b84d2[_0x314930(0xd3)][_0x314930(0xcc)](yamlConditionToApi),..._0x5b84d2['description']&&{'description':_0x5b84d2[_0x314930(0xdf)]},..._0x5b84d2[_0x314930(0x119)]!==undefined&&{'expr':_0x5b84d2[_0x314930(0x119)]}};}if('column'in _0xef2469&&_0xef2469['type']===_0x314930(0xdb)){const _0x1581ec=_0xef2469;return{'type':_0x314930(0xdb),'column':_0x1581ec[_0x314930(0xc7)],'operator':yamlOperatorToApi(_0x1581ec[_0x314930(0x13b)])};}const _0x5dfff8=_0xef2469,_0x274899={'type':_0x314930(0x109),'leftValue':buildLeftValue(_0x5dfff8),'operator':yamlOperatorToApi(_0x5dfff8[_0x314930(0x13b)]),'exclude':_0x5dfff8['exclude']??![],'arrayMatching':_0x5dfff8[_0x314930(0x126)]??_0x314930(0xc1)};return _0x5dfff8['limit']!==undefined&&(_0x274899[_0x314930(0x122)]=_0x5dfff8['limit']),_0x274899;}function buildAggregationDefFromApi(_0x412df7){const _0x53a7fa=a149_0x16ee03,_0x4ac915=_0x412df7[_0x53a7fa(0xb0)];if(_0x4ac915===_0x53a7fa(0xbb))return{'type':_0x4ac915,'columns':_0x412df7['columns']??[]};if(_0x4ac915==='First'||_0x4ac915===_0x53a7fa(0x10b))return{'type':_0x4ac915,'column':_0x412df7[_0x53a7fa(0xc7)]??'','orderColumn':_0x412df7[_0x53a7fa(0x154)]??'',..._0x412df7[_0x53a7fa(0x106)]&&{'groupingColumns':_0x412df7['groupingColumns']}};if(_0x4ac915===_0x53a7fa(0x132))return{'type':_0x4ac915,..._0x412df7[_0x53a7fa(0x106)]&&{'groupingColumns':_0x412df7['groupingColumns']}};return{'type':_0x4ac915,'column':_0x412df7['column']??'',..._0x412df7[_0x53a7fa(0x106)]&&{'groupingColumns':_0x412df7[_0x53a7fa(0x106)]}};}function buildLeftValue(_0x4faed1){const _0x5d7df2=a149_0x16ee03,_0xd06070={};_0x4faed1[_0x5d7df2(0x103)]&&_0x4faed1[_0x5d7df2(0xb0)]!==_0x5d7df2(0x10d)&&(_0xd06070[_0x5d7df2(0xe3)]=_0x4faed1['attribute']);if(_0x4faed1['aggregation']){const _0x337276=_0x4faed1[_0x5d7df2(0xb2)];if(_0x337276[_0x5d7df2(0xb0)]===_0x5d7df2(0xbb))_0xd06070[_0x5d7df2(0xb2)]={'type':'CountDistinct','columns':_0x337276[_0x5d7df2(0xed)]};else{if(_0x337276[_0x5d7df2(0xb0)]===_0x5d7df2(0xe4)||_0x337276[_0x5d7df2(0xb0)]===_0x5d7df2(0x10b))_0xd06070[_0x5d7df2(0xb2)]={'type':_0x337276[_0x5d7df2(0xb0)],'column':_0x337276[_0x5d7df2(0xc7)],'orderColumn':_0x337276[_0x5d7df2(0x154)],..._0x337276[_0x5d7df2(0x106)]&&{'groupingColumns':_0x337276['groupingColumns']}};else _0x337276[_0x5d7df2(0xb0)]==='Count'?_0xd06070[_0x5d7df2(0xb2)]={'type':_0x5d7df2(0x132),..._0x337276['groupingColumns']&&{'groupingColumns':_0x337276[_0x5d7df2(0x106)]}}:_0xd06070['aggregation']={'type':_0x337276[_0x5d7df2(0xb0)],'column':_0x337276['column'],..._0x337276['groupingColumns']&&{'groupingColumns':_0x337276[_0x5d7df2(0x106)]}};}}return _0x4faed1[_0x5d7df2(0xb9)]&&(_0xd06070['source']={'name':_0x4faed1['source']}),_0x4faed1[_0x5d7df2(0xfc)]&&(_0xd06070['filter']=yamlFilterRuleToApi(filterRuleAsRuleDef(_0x4faed1[_0x5d7df2(0xfc)]))),_0xd06070;}function yamlOperatorToApi(_0xca8959){const _0x4a7f38=a149_0x16ee03,_0x3dfe48={'type':mapYamlOperatorType(_0xca8959['type']),'not':_0xca8959[_0x4a7f38(0x159)]??![]};if(isBetweenOperator(_0xca8959[_0x4a7f38(0xb0)]))return _0xca8959[_0x4a7f38(0x14d)]!==undefined&&(_0x3dfe48[_0x4a7f38(0x146)]=typeof _0xca8959[_0x4a7f38(0x14d)]===_0x4a7f38(0x10f)?_0xca8959[_0x4a7f38(0x14d)]:String(_0xca8959[_0x4a7f38(0x14d)])),_0xca8959[_0x4a7f38(0x143)]!==undefined&&(_0x3dfe48['maxValue']=typeof _0xca8959[_0x4a7f38(0x143)]==='object'?_0xca8959['max']:String(_0xca8959['max'])),_0x3dfe48;if(_0xca8959[_0x4a7f38(0xb0)]===_0x4a7f38(0xdc))return _0xca8959[_0x4a7f38(0x12d)]&&(_0x3dfe48['duration']=_0xca8959[_0x4a7f38(0x12d)]),_0xca8959[_0x4a7f38(0x134)]&&(_0x3dfe48[_0x4a7f38(0x134)]=_0xca8959[_0x4a7f38(0x134)]),_0xca8959[_0x4a7f38(0x111)]!==undefined&&(_0x3dfe48[_0x4a7f38(0x111)]=_0xca8959['reverse']),_0x3dfe48;const _0x111224=getEffectiveValue(_0xca8959);if(_0x111224!==undefined){if(Array[_0x4a7f38(0xc4)](_0x111224))_0x3dfe48[_0x4a7f38(0xfa)]=_0x111224;else isTemporalOperator(_0xca8959[_0x4a7f38(0xb0)])?_0x3dfe48[_0x4a7f38(0xd6)]=_0x111224:_0x3dfe48[_0x4a7f38(0x14b)]=_0x111224;}return _0xca8959['unit']&&(_0x3dfe48[_0x4a7f38(0x158)]=_0xca8959[_0x4a7f38(0x158)]),_0x3dfe48;}function mapYamlOperatorType(_0x3ff889){return _0x3ff889;}export function toYamlString(_0x4bf1aa){const _0x4dc4c6=a149_0x16ee03,_0xbd2a94=JSON[_0x4dc4c6(0x139)](JSON[_0x4dc4c6(0x142)](_0x4bf1aa)),_0x1eced9=a149_0x16d5e3['stringify'](_0xbd2a94,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4dc4c6(0x140)}),_0x42eede=[_0x4dc4c6(0xf2)];let _0x1fa0ea=_0x1eced9;for(const _0x381e96 of _0x42eede){_0x1fa0ea=_0x1fa0ea[_0x4dc4c6(0xf3)](new RegExp('^('+_0x381e96+')','m'),(_0x5da0ec,_0xa9e813,_0xb67884)=>{if(_0xb67884===0x0||_0x1fa0ea[_0xb67884-0x1]==='\x0a'&&_0x1fa0ea[_0xb67884-0x2]==='\x0a')return _0xa9e813;return'\x0a'+_0xa9e813;});}return _0x1fa0ea;}export function parseYamlString(_0x1346d6){return parseSegmentYamlFile(_0x1346d6);}export function isSegmentYaml(_0x54a2d5){const _0x24a831=a149_0x16ee03;if(typeof _0x54a2d5!==_0x24a831(0x10f)||_0x54a2d5===null)return![];const _0x8272f5=_0x54a2d5;return _0x8272f5['type']===_0x24a831(0x14e)||_0x8272f5[_0x24a831(0xb0)]===undefined;}export function generateTemplate(_0xc96e23='New\x20Segment'){const _0x464edb=a149_0x16ee03,_0x2f9695={'type':'segment','name':_0xc96e23,'description':_0x464edb(0xc9),'rule':{'type':_0x464edb(0x128),'conditions':[{'type':_0x464edb(0x109),'attribute':_0x464edb(0x161),'operator':{'type':_0x464edb(0x145),'value':_0x464edb(0xd6)}}]}};return toYamlString(_0x2f9695);}export function segmentToYamlString(_0x3f43d1){const _0x445c9d=a149_0x16ee03,_0x4cc48f=JSON[_0x445c9d(0x139)](JSON[_0x445c9d(0x142)](_0x3f43d1)),_0x2d49a2=a149_0x16d5e3[_0x445c9d(0x142)](_0x4cc48f,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x445c9d(0x140)}),_0xe65203=[_0x445c9d(0xf2),_0x445c9d(0x15f)];let _0x5e6fd8=_0x2d49a2;for(const _0xc59a64 of _0xe65203){_0x5e6fd8=_0x5e6fd8['replace'](new RegExp('^('+_0xc59a64+')','m'),(_0x106913,_0x6b8d01,_0x5ead90)=>{if(_0x5ead90===0x0||_0x5e6fd8[_0x5ead90-0x1]==='\x0a'&&_0x5e6fd8[_0x5ead90-0x2]==='\x0a')return _0x6b8d01;return'\x0a'+_0x6b8d01;});}return _0x5e6fd8;}export function parseSegmentYamlFile(_0x22458d){return safeParseYaml(_0x22458d,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x1259f7){const _0xb71105=a149_0x16ee03;return{'type':_0xb71105(0x14e),'name':_0x1259f7[_0xb71105(0xe3)],..._0x1259f7[_0xb71105(0xdf)]!==undefined&&{'description':_0x1259f7[_0xb71105(0xdf)]},..._0x1259f7[_0xb71105(0xcd)]!==undefined&&{'folder':_0x1259f7[_0xb71105(0xcd)]},..._0x1259f7['rule']&&{'rule':normalizeRule(_0x1259f7[_0xb71105(0x135)])},..._0x1259f7[_0xb71105(0x157)]!==undefined&&{'kind':_0x1259f7[_0xb71105(0x157)]},..._0x1259f7[_0xb71105(0x127)]!==undefined&&{'visible':_0x1259f7['visible']},..._0x1259f7[_0xb71105(0xe0)]&&{'activations':_0x1259f7[_0xb71105(0xe0)]['map'](normalizeActivation)}};}function a149_0x4f28(_0x4a9f92,_0x3340b4){_0x4a9f92=_0x4a9f92-0xaf;const _0x5a2665=a149_0x5a26();let _0x4f28f6=_0x5a2665[_0x4a9f92];return _0x4f28f6;}export function normalizeRule(_0x259404){const _0x33e73e=a149_0x16ee03;return{'type':_0x259404[_0x33e73e(0xb0)],'conditions':_0x259404[_0x33e73e(0xd3)][_0x33e73e(0xcc)](normalizeCondition),..._0x259404[_0x33e73e(0xdf)]!==undefined&&{'description':_0x259404[_0x33e73e(0xdf)]},..._0x259404[_0x33e73e(0x119)]!==undefined&&{'expr':_0x259404[_0x33e73e(0x119)]}};}function normalizeCondition(_0x29daad){const _0x557d41=a149_0x16ee03;if('segment'in _0x29daad&&(_0x29daad[_0x557d41(0xb0)]===_0x557d41(0x11f)||_0x29daad[_0x557d41(0xb0)]===_0x557d41(0xfd))){const _0x59aed9=_0x29daad;return{'type':_0x59aed9[_0x557d41(0xb0)],'segment':_0x59aed9[_0x557d41(0x14e)]};}if(_0x29daad[_0x557d41(0xb0)]===_0x557d41(0x128)||_0x29daad[_0x557d41(0xb0)]==='Or'||_0x29daad[_0x557d41(0xb0)]==='Composite'){const _0xa2ee6e=_0x29daad;return{'type':_0xa2ee6e[_0x557d41(0xb0)],'conditions':_0xa2ee6e['conditions'][_0x557d41(0xcc)](normalizeCondition),..._0xa2ee6e[_0x557d41(0xdf)]!==undefined&&{'description':_0xa2ee6e[_0x557d41(0xdf)]},..._0xa2ee6e[_0x557d41(0x119)]!==undefined&&{'expr':_0xa2ee6e[_0x557d41(0x119)]}};}if('column'in _0x29daad&&_0x29daad[_0x557d41(0xb0)]===_0x557d41(0xdb)){const _0x35037b=_0x29daad;return{'type':_0x557d41(0xdb),'column':_0x35037b[_0x557d41(0xc7)],'operator':normalizeOperator(_0x35037b[_0x557d41(0x13b)])};}if(_0x29daad[_0x557d41(0xb0)]===_0x557d41(0x10d)){const _0x413672=_0x29daad;return{'type':_0x557d41(0x10d),'attribute':_0x413672[_0x557d41(0x103)],'operator':normalizeOperator(_0x413672[_0x557d41(0x13b)]),..._0x413672[_0x557d41(0x126)]!==undefined&&{'arrayMatching':_0x413672[_0x557d41(0x126)]},..._0x413672['exclude']!==undefined&&{'exclude':_0x413672['exclude']},..._0x413672[_0x557d41(0xb2)]!==undefined&&{'aggregation':_0x413672[_0x557d41(0xb2)]},..._0x413672[_0x557d41(0xb9)]!==undefined&&{'source':_0x413672['source']},..._0x413672['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x413672[_0x557d41(0xfc)])))},..._0x413672[_0x557d41(0x147)]!==undefined&&{'timeWindow':_0x413672['timeWindow']},..._0x413672[_0x557d41(0x122)]!==undefined&&{'limit':_0x413672[_0x557d41(0x122)]}};}const _0x5b6706=_0x29daad;return{'type':_0x557d41(0x109),'attribute':_0x5b6706[_0x557d41(0x103)],'operator':normalizeOperator(_0x5b6706[_0x557d41(0x13b)]),..._0x5b6706[_0x557d41(0x126)]!==undefined&&{'arrayMatching':_0x5b6706[_0x557d41(0x126)]},..._0x5b6706['exclude']!==undefined&&{'exclude':_0x5b6706[_0x557d41(0xfd)]},..._0x5b6706[_0x557d41(0xb2)]!==undefined&&{'aggregation':_0x5b6706[_0x557d41(0xb2)]},..._0x5b6706[_0x557d41(0xb9)]!==undefined&&{'source':_0x5b6706['source']},..._0x5b6706[_0x557d41(0xfc)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x5b6706['filter'])))},..._0x5b6706[_0x557d41(0x122)]!==undefined&&{'limit':_0x5b6706[_0x557d41(0x122)]}};}function normalizeOperator(_0x4ad5cc){const _0x37f2ab=a149_0x16ee03;if(isBetweenOperator(_0x4ad5cc['type']))return{'type':_0x4ad5cc['type'],..._0x4ad5cc[_0x37f2ab(0x159)]!==undefined&&{'not':_0x4ad5cc[_0x37f2ab(0x159)]},..._0x4ad5cc[_0x37f2ab(0x14d)]!==undefined&&{'min':_0x4ad5cc['min']},..._0x4ad5cc[_0x37f2ab(0x143)]!==undefined&&{'max':_0x4ad5cc[_0x37f2ab(0x143)]}};const _0x54c898=getEffectiveValue(_0x4ad5cc);return{'type':_0x4ad5cc[_0x37f2ab(0xb0)],..._0x4ad5cc[_0x37f2ab(0x159)]!==undefined&&{'not':_0x4ad5cc[_0x37f2ab(0x159)]},..._0x54c898!==undefined&&{'value':_0x54c898},..._0x4ad5cc[_0x37f2ab(0x158)]!==undefined&&{'unit':_0x4ad5cc['unit']},..._0x4ad5cc[_0x37f2ab(0x12d)]!==undefined&&{'duration':_0x4ad5cc[_0x37f2ab(0x12d)]},..._0x4ad5cc['from']!==undefined&&{'from':_0x4ad5cc[_0x37f2ab(0x134)]},..._0x4ad5cc[_0x37f2ab(0x111)]!==undefined&&{'reverse':_0x4ad5cc[_0x37f2ab(0x111)]}};}function normalizeActivation(_0x4d9ff0){const _0xb44102=a149_0x16ee03;return{'name':_0x4d9ff0[_0xb44102(0xe3)],'connection':_0x4d9ff0[_0xb44102(0x120)],..._0x4d9ff0['description']!==undefined&&{'description':_0x4d9ff0[_0xb44102(0xdf)]},..._0x4d9ff0[_0xb44102(0xcf)]!==undefined&&{'all_columns':_0x4d9ff0[_0xb44102(0xcf)]},..._0x4d9ff0[_0xb44102(0xed)]!==undefined&&{'columns':_0x4d9ff0[_0xb44102(0xed)]},..._0x4d9ff0[_0xb44102(0x107)]!==undefined&&{'behavior':_0x4d9ff0['behavior']},..._0x4d9ff0[_0xb44102(0xc2)]!==undefined&&{'schedule':_0x4d9ff0[_0xb44102(0xc2)]},..._0x4d9ff0[_0xb44102(0xbd)]!==undefined&&{'notification':_0x4d9ff0[_0xb44102(0xbd)]},..._0x4d9ff0[_0xb44102(0xb1)]!==undefined&&{'connector_config':_0x4d9ff0[_0xb44102(0xb1)]},..._0x4d9ff0['activation_template_id']!==undefined&&{'activation_template_id':_0x4d9ff0[_0xb44102(0x10e)]},..._0x4d9ff0['nested_workflow_project_name']!==undefined&&{'nested_workflow_project_name':_0x4d9ff0[_0xb44102(0x12b)]},..._0x4d9ff0[_0xb44102(0x15e)]!==undefined&&{'nested_workflow_name':_0x4d9ff0[_0xb44102(0x15e)]},..._0x4d9ff0[_0xb44102(0x110)]!==undefined&&{'lock_enabled':_0x4d9ff0[_0xb44102(0x110)]}};}function getColumnName(_0x4a25e4){const _0x3f6e56=a149_0x16ee03;return _0x4a25e4[_0x3f6e56(0xc7)]||_0x4a25e4[_0x3f6e56(0xe3)];}export function activationResponseToDef(_0x54d721,_0x41137c,_0x55aaee){const _0x71ef9a=a149_0x16ee03,_0x49d0f4=_0x54d721['connectionId']||'',_0x545de6=_0x55aaee?.[_0x71ef9a(0x144)](_0x49d0f4)??_0x49d0f4,_0x317436={'name':_0x54d721['name'],'connection':_0x545de6};_0x54d721['description']&&(_0x317436[_0x71ef9a(0xdf)]=_0x54d721['description']);let _0x48df0b=[];_0x54d721[_0x71ef9a(0xed)]&&_0x54d721[_0x71ef9a(0xed)]['length']>0x0&&(_0x48df0b=_0x54d721[_0x71ef9a(0xed)]['filter'](_0x51f7e1=>_0x51f7e1&&getColumnName(_0x51f7e1))[_0x71ef9a(0xcc)](_0x29f948=>{const _0xa952fe=_0x71ef9a,_0x3f6171=getColumnName(_0x29f948);if(_0x29f948[_0xa952fe(0xb0)]||_0x29f948[_0xa952fe(0x10c)])return{'name':_0x3f6171,..._0x29f948[_0xa952fe(0xb0)]&&{'type':_0x29f948['type']},..._0x29f948['visibility']&&{'visibility':_0x29f948[_0xa952fe(0x10c)]}};return _0x3f6171;}));_0x48df0b[_0x71ef9a(0xe7)]>0x0&&(_0x317436[_0x71ef9a(0xed)]=_0x48df0b);_0x54d721[_0x71ef9a(0x13c)]!==undefined&&(_0x54d721['allColumns']===![]&&_0x48df0b[_0x71ef9a(0xe7)]===0x0?_0x317436['all_columns']=!![]:_0x317436['all_columns']=_0x54d721[_0x71ef9a(0x13c)]);const _0x50318d={};let _0x19c478=![];_0x54d721[_0x71ef9a(0x12c)]&&(_0x50318d[_0x71ef9a(0xb0)]=_0x54d721['scheduleType'],_0x19c478=!![]);_0x54d721['repeatUnit']&&(_0x50318d['repeat_unit']=_0x54d721[_0x71ef9a(0xfb)],_0x19c478=!![]);_0x54d721['repeatFrequency']!==undefined&&_0x54d721[_0x71ef9a(0x138)]!==null&&(_0x50318d[_0x71ef9a(0xc0)]=_0x54d721['repeatFrequency'],_0x19c478=!![]);_0x54d721['repeatSubFrequency']&&_0x54d721[_0x71ef9a(0xf5)][_0x71ef9a(0xe7)]>0x0&&(_0x50318d[_0x71ef9a(0x151)]=_0x54d721[_0x71ef9a(0xf5)],_0x19c478=!![]);_0x54d721['startAt']!==undefined&&(_0x50318d[_0x71ef9a(0x156)]=_0x54d721[_0x71ef9a(0x162)],_0x19c478=!![]);_0x54d721[_0x71ef9a(0xe2)]!==undefined&&(_0x50318d[_0x71ef9a(0x11c)]=_0x54d721[_0x71ef9a(0xe2)],_0x19c478=!![]);_0x54d721[_0x71ef9a(0xe1)]&&(_0x50318d[_0x71ef9a(0xe1)]=_0x54d721[_0x71ef9a(0xe1)],_0x19c478=!![]);_0x19c478&&(_0x317436[_0x71ef9a(0xc2)]=_0x50318d);(_0x54d721[_0x71ef9a(0x131)]&&_0x54d721[_0x71ef9a(0x131)][_0x71ef9a(0xe7)]>0x0||_0x54d721['emailRecipients']&&_0x54d721['emailRecipients']['length']>0x0)&&(_0x317436['notification']={},_0x54d721[_0x71ef9a(0x131)]&&_0x54d721[_0x71ef9a(0x131)]['length']>0x0&&(_0x317436[_0x71ef9a(0xbd)]['notify_on']=_0x54d721[_0x71ef9a(0x131)]),_0x54d721[_0x71ef9a(0xb6)]&&_0x54d721[_0x71ef9a(0xb6)]['length']>0x0&&(_0x317436[_0x71ef9a(0xbd)]['email_recipients']=_0x54d721[_0x71ef9a(0xb6)][_0x71ef9a(0xcc)](_0x906617=>{const _0x16c3e9=_0x71ef9a,_0x593838=_0x41137c?.[_0x16c3e9(0x144)](_0x906617);return _0x593838??String(_0x906617);})));_0x54d721[_0x71ef9a(0x12a)]&&Object[_0x71ef9a(0xbc)](_0x54d721['connectorConfig'])[_0x71ef9a(0xe7)]>0x0&&(_0x317436[_0x71ef9a(0xb1)]=normalizeConnectorConfigForYaml(_0x54d721[_0x71ef9a(0x12a)]));_0x54d721[_0x71ef9a(0xc3)]&&(_0x317436[_0x71ef9a(0x10e)]=_0x54d721[_0x71ef9a(0xc3)]);if(_0x54d721[_0x71ef9a(0x14f)]){const _0x2de72d={},_0x57f9a4=_0x54d721[_0x71ef9a(0x14f)];_0x57f9a4[_0x71ef9a(0xed)]&&_0x57f9a4[_0x71ef9a(0xed)]['length']>0x0&&(_0x2de72d[_0x71ef9a(0xed)]=_0x57f9a4[_0x71ef9a(0xed)][_0x71ef9a(0xfc)](_0x25d272=>_0x25d272&&getColumnName(_0x25d272))[_0x71ef9a(0xcc)](_0xd4f68d=>({'name':getColumnName(_0xd4f68d),..._0xd4f68d['type']&&{'type':_0xd4f68d[_0x71ef9a(0xb0)]},..._0xd4f68d[_0x71ef9a(0x10c)]&&{'visibility':_0xd4f68d[_0x71ef9a(0x10c)]}}))),_0x57f9a4[_0x71ef9a(0xf1)]&&(_0x2de72d['behavior_table']=_0x57f9a4[_0x71ef9a(0xf1)]),_0x57f9a4[_0x71ef9a(0x105)]!==undefined&&(_0x2de72d['join_row']=_0x57f9a4[_0x71ef9a(0x105)]),_0x57f9a4[_0x71ef9a(0x104)]&&(_0x2de72d['join_strategy']=_0x57f9a4[_0x71ef9a(0x104)]),_0x57f9a4[_0x71ef9a(0xc5)]&&(_0x2de72d['formatting']=_0x57f9a4['formatting']),_0x57f9a4[_0x71ef9a(0xea)]&&_0x57f9a4[_0x71ef9a(0xea)][_0x71ef9a(0xe7)]>0x0&&(_0x2de72d[_0x71ef9a(0x13f)]=_0x57f9a4[_0x71ef9a(0xea)]),Object[_0x71ef9a(0xbc)](_0x2de72d)[_0x71ef9a(0xe7)]>0x0&&(_0x317436[_0x71ef9a(0x107)]=_0x2de72d);}return _0x54d721[_0x71ef9a(0x15c)]&&(_0x317436['nested_workflow_project_name']=_0x54d721[_0x71ef9a(0x15c)]),_0x54d721[_0x71ef9a(0x12f)]&&(_0x317436[_0x71ef9a(0x15e)]=_0x54d721[_0x71ef9a(0x12f)]),_0x54d721['lockEnabled']!==undefined&&(_0x317436['lock_enabled']=_0x54d721[_0x71ef9a(0x112)]),_0x317436;}export function journeyActivationStepToYaml(_0x202163,_0x2c148c,_0x554cfe){const _0x13ae13=a149_0x16ee03,_0x18149b=_0x202163[_0x13ae13(0xca)][_0x13ae13(0xec)],_0x59f610=_0x18149b[_0x13ae13(0xe8)]||'',_0x13d6ca=_0x554cfe?.[_0x13ae13(0x144)](_0x59f610)??_0x59f610,_0x12687d={'name':_0x18149b[_0x13ae13(0xe3)]||'','connection':_0x13d6ca};_0x202163[_0x13ae13(0xca)]['runAfterJourneyRefresh']&&(_0x12687d['run_after_journey_refresh']=!![]);_0x18149b[_0x13ae13(0xdf)]&&(_0x12687d['description']=_0x18149b[_0x13ae13(0xdf)]);let _0x3c4921=[];_0x18149b[_0x13ae13(0xed)]&&_0x18149b['columns'][_0x13ae13(0xe7)]>0x0&&(_0x3c4921=_0x18149b[_0x13ae13(0xed)]['filter'](_0x42548c=>_0x42548c&&getColumnName(_0x42548c))[_0x13ae13(0xcc)](_0x1f6ed3=>{const _0x322140=_0x13ae13,_0x163773=getColumnName(_0x1f6ed3);if(_0x1f6ed3[_0x322140(0xb0)]||_0x1f6ed3[_0x322140(0x10c)])return{'name':_0x163773,..._0x1f6ed3[_0x322140(0xb0)]&&{'type':_0x1f6ed3[_0x322140(0xb0)]},..._0x1f6ed3['visibility']&&{'visibility':_0x1f6ed3[_0x322140(0x10c)]}};return _0x163773;}));_0x3c4921[_0x13ae13(0xe7)]>0x0&&(_0x12687d[_0x13ae13(0xed)]=_0x3c4921);_0x18149b[_0x13ae13(0x13c)]!==undefined&&(_0x18149b[_0x13ae13(0x13c)]===![]&&_0x3c4921['length']===0x0?_0x12687d[_0x13ae13(0xcf)]=!![]:_0x12687d[_0x13ae13(0xcf)]=_0x18149b[_0x13ae13(0x13c)]);const _0xa0554d={};let _0xbbd2d8=![];_0x18149b[_0x13ae13(0x12c)]&&(_0xa0554d['type']=_0x18149b['scheduleType'],_0xbbd2d8=!![]);_0x18149b[_0x13ae13(0xfb)]&&(_0xa0554d[_0x13ae13(0xd4)]=_0x18149b[_0x13ae13(0xfb)],_0xbbd2d8=!![]);_0x18149b[_0x13ae13(0x138)]!==undefined&&_0x18149b[_0x13ae13(0x138)]!==null&&(_0xa0554d[_0x13ae13(0xc0)]=_0x18149b['repeatFrequency'],_0xbbd2d8=!![]);_0x18149b[_0x13ae13(0x162)]!==undefined&&(_0xa0554d[_0x13ae13(0x156)]=_0x18149b[_0x13ae13(0x162)],_0xbbd2d8=!![]);_0x18149b[_0x13ae13(0xe2)]!==undefined&&(_0xa0554d['end_on']=_0x18149b[_0x13ae13(0xe2)],_0xbbd2d8=!![]);_0x18149b['timezone']&&(_0xa0554d[_0x13ae13(0xe1)]=_0x18149b['timezone'],_0xbbd2d8=!![]);_0xbbd2d8&&(_0x12687d['schedule']=_0xa0554d);(_0x18149b[_0x13ae13(0x131)]&&_0x18149b[_0x13ae13(0x131)][_0x13ae13(0xe7)]>0x0||_0x18149b[_0x13ae13(0xb6)]&&_0x18149b[_0x13ae13(0xb6)][_0x13ae13(0xe7)]>0x0)&&(_0x12687d[_0x13ae13(0xbd)]={},_0x18149b[_0x13ae13(0x131)]&&_0x18149b[_0x13ae13(0x131)][_0x13ae13(0xe7)]>0x0&&(_0x12687d[_0x13ae13(0xbd)][_0x13ae13(0xd7)]=_0x18149b[_0x13ae13(0x131)]),_0x18149b['emailRecipients']&&_0x18149b[_0x13ae13(0xb6)][_0x13ae13(0xe7)]>0x0&&(_0x12687d['notification'][_0x13ae13(0xb8)]=_0x18149b[_0x13ae13(0xb6)][_0x13ae13(0xcc)](_0x335c69=>{const _0x583839=_0x13ae13,_0x1c8b1=_0x2c148c?.[_0x583839(0x144)](_0x335c69);return _0x1c8b1??String(_0x335c69);})));_0x18149b['connectorConfig']&&Object[_0x13ae13(0xbc)](_0x18149b[_0x13ae13(0x12a)])[_0x13ae13(0xe7)]>0x0&&(_0x12687d[_0x13ae13(0xb1)]=normalizeConnectorConfigForYaml(_0x18149b[_0x13ae13(0x12a)]));_0x18149b[_0x13ae13(0xc3)]&&(_0x12687d['activation_template_id']=_0x18149b[_0x13ae13(0xc3)]);if(_0x18149b['syndicationBehavior']){const _0x1d6110={},_0x43cc83=_0x18149b[_0x13ae13(0x14f)];_0x43cc83[_0x13ae13(0xed)]&&_0x43cc83[_0x13ae13(0xed)]['length']>0x0&&(_0x1d6110[_0x13ae13(0xed)]=_0x43cc83[_0x13ae13(0xed)][_0x13ae13(0xfc)](_0x107b6a=>_0x107b6a&&getColumnName(_0x107b6a))[_0x13ae13(0xcc)](_0x319b83=>({'name':getColumnName(_0x319b83),..._0x319b83['type']&&{'type':_0x319b83['type']},..._0x319b83[_0x13ae13(0x10c)]&&{'visibility':_0x319b83[_0x13ae13(0x10c)]}}))),_0x43cc83['behaviorTableName']&&(_0x1d6110[_0x13ae13(0xf4)]=_0x43cc83[_0x13ae13(0xf1)]),_0x43cc83[_0x13ae13(0x105)]!==undefined&&(_0x1d6110[_0x13ae13(0x10a)]=_0x43cc83[_0x13ae13(0x105)]),_0x43cc83[_0x13ae13(0x104)]&&(_0x1d6110[_0x13ae13(0xc8)]=_0x43cc83[_0x13ae13(0x104)]),_0x43cc83['formatting']&&(_0x1d6110[_0x13ae13(0xc5)]=_0x43cc83[_0x13ae13(0xc5)]),_0x43cc83[_0x13ae13(0xea)]&&_0x43cc83['orderBy'][_0x13ae13(0xe7)]>0x0&&(_0x1d6110['order_by']=_0x43cc83['orderBy']),Object[_0x13ae13(0xbc)](_0x1d6110)['length']>0x0&&(_0x12687d[_0x13ae13(0x107)]=_0x1d6110);}return _0x12687d;}export function segmentWithActivationsToYaml(_0x1c700d,_0x1ce4c7,_0x518cf7,_0x50745a,_0x402b1b){const _0x3bb440=a149_0x16ee03,_0xf7c608=segmentResponseToDefSync(_0x1c700d,_0x518cf7);return _0x1ce4c7[_0x3bb440(0xe7)]>0x0&&(_0xf7c608[_0x3bb440(0xe0)]=_0x1ce4c7[_0x3bb440(0xcc)](_0x25aa48=>activationResponseToDef(_0x25aa48,_0x50745a,_0x402b1b))),_0xf7c608;}function normalizeColumn(_0x85e7c){const _0x47cb08=a149_0x16ee03;if(typeof _0x85e7c===_0x47cb08(0xfe))return{'column':_0x85e7c,'source':{'column':_0x85e7c}};return{'column':_0x85e7c[_0x47cb08(0xe3)],'source':{'column':_0x85e7c[_0x47cb08(0xe3)]},..._0x85e7c['type']&&{'type':_0x85e7c[_0x47cb08(0xb0)]},..._0x85e7c['visibility']&&{'visibility':_0x85e7c[_0x47cb08(0x10c)]}};}const KNOWN_ACTIVATION_FIELDS=new Set(Object[a149_0x16ee03(0xbc)](ActivationDefSchema[a149_0x16ee03(0x11a)]));export function warnUnrecognizedActivationFields(_0x2aa6cc,_0x80d2ec){const _0x3ce4a3=a149_0x16ee03,_0x4bf8f5=Object[_0x3ce4a3(0xbc)](_0x2aa6cc)[_0x3ce4a3(0xfc)](_0x22ee41=>!KNOWN_ACTIVATION_FIELDS[_0x3ce4a3(0xbe)](_0x22ee41));if(_0x4bf8f5[_0x3ce4a3(0xe7)]>0x0){const _0x40de1b=_0x4bf8f5[_0x3ce4a3(0xcc)](_0x193cf1=>'\x20\x20-\x20\x22'+_0x193cf1+'\x22')[_0x3ce4a3(0xce)]('\x0a');console['warn']('Warning:\x20activation\x20\x22'+_0x80d2ec+'\x22\x20has\x20unrecognized\x20fields\x20(will\x20be\x20ignored):\x0a'+_0x40de1b);}}export async function activationDefToCreateRequest(_0xa9d658,_0x267539){const _0x10672f=a149_0x16ee03;warnUnrecognizedActivationFields(_0xa9d658,_0xa9d658[_0x10672f(0xe3)]);const _0x4a8be3=_0x267539?.[_0x10672f(0x121)],_0x5758c7=_0x267539?.['connectionNameToIdMap'],_0x38671a=_0xa9d658['connection'];let _0x2e593d;const _0x3b839d=parseInt(_0x38671a,0xa);if(!isNaN(_0x3b839d)&&String(_0x3b839d)===_0x38671a)_0x2e593d=_0x3b839d;else{const _0x27ebe0=_0x5758c7?.[_0x10672f(0x144)](_0x38671a);if(_0x27ebe0===undefined)throw new SDKError(ErrorCode[_0x10672f(0x14a)],_0x10672f(0xf6)+_0x38671a,undefined,{'helpText':_0x10672f(0x150)});_0x2e593d=_0x27ebe0;}const _0x33f3dd={'name':_0xa9d658[_0x10672f(0xe3)],'connectionId':_0x2e593d};_0xa9d658[_0x10672f(0xdf)]&&(_0x33f3dd[_0x10672f(0xdf)]=_0xa9d658[_0x10672f(0xdf)]);let _0x31478d=[];_0xa9d658[_0x10672f(0xed)]&&_0xa9d658[_0x10672f(0xed)][_0x10672f(0xe7)]>0x0&&(_0x31478d=_0xa9d658[_0x10672f(0xed)][_0x10672f(0xfc)](_0x22f312=>_0x22f312!=null)[_0x10672f(0xcc)](normalizeColumn));_0x31478d['length']>0x0&&(_0x33f3dd['columns']=_0x31478d);_0xa9d658[_0x10672f(0xcf)]!==undefined&&(_0xa9d658[_0x10672f(0xcf)]===![]&&_0x31478d[_0x10672f(0xe7)]===0x0?_0x33f3dd['allColumns']=!![]:_0x33f3dd[_0x10672f(0x13c)]=_0xa9d658['all_columns']);if(_0xa9d658[_0x10672f(0xc2)]){const _0x516a3f=_0xa9d658[_0x10672f(0xc2)],_0x57c8e7=_0x516a3f[_0x10672f(0xb0)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x516a3f[_0x10672f(0xd4)]];_0x57c8e7&&(_0x33f3dd[_0x10672f(0x12c)]=_0x57c8e7);const _0x23e3dc=_0x516a3f['repeat_unit']??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x516a3f[_0x10672f(0xb0)]];_0x23e3dc&&(_0x33f3dd[_0x10672f(0xfb)]=_0x23e3dc);_0x516a3f['repeat_frequency']!==undefined&&(_0x33f3dd['repeatFrequency']=_0x516a3f[_0x10672f(0xc0)]);_0x516a3f[_0x10672f(0x151)]&&(_0x33f3dd[_0x10672f(0xf5)]=_0x516a3f['repeat_sub_frequency']);_0x516a3f['start_at']!==undefined&&(_0x33f3dd[_0x10672f(0x162)]=_0x516a3f[_0x10672f(0x156)]);_0x516a3f[_0x10672f(0x11c)]!==undefined&&(_0x33f3dd[_0x10672f(0xe2)]=_0x516a3f[_0x10672f(0x11c)]);_0x516a3f[_0x10672f(0xe1)]&&(_0x33f3dd[_0x10672f(0xe1)]=_0x516a3f[_0x10672f(0xe1)]);if(_0x57c8e7&&_0x57c8e7!==_0x10672f(0xf0)&&_0x57c8e7!=='cron'&&_0x516a3f['start_at']){const _0x21198d=_0x516a3f[_0x10672f(0x156)]['match'](/T(\d{2}:\d{2})/);_0x21198d&&(_0x33f3dd[_0x10672f(0x114)]=_0x21198d[0x1]);}}_0xa9d658[_0x10672f(0xbd)]&&(_0xa9d658['notification']['notify_on']&&(_0x33f3dd[_0x10672f(0x131)]=_0xa9d658[_0x10672f(0xbd)]['notify_on']),_0xa9d658[_0x10672f(0xbd)]['email_recipients']&&(_0x33f3dd[_0x10672f(0xb6)]=_0xa9d658[_0x10672f(0xbd)][_0x10672f(0xb8)][_0x10672f(0xcc)](_0x2d8764=>{const _0x2bc23f=_0x10672f,_0x223fd8=Number(_0x2d8764);if(!isNaN(_0x223fd8)&&String(_0x223fd8)===_0x2d8764)return _0x223fd8;const _0x49539d=_0x4a8be3?.[_0x2bc23f(0x144)](_0x2d8764['toLowerCase']());if(_0x49539d===undefined)throw new SDKError(ErrorCode[_0x2bc23f(0xee)],_0x2bc23f(0xb4)+_0x2d8764+_0x2bc23f(0xb7));return _0x49539d;})));if(_0xa9d658[_0x10672f(0xb1)]){const _0x2b2e66=_0x267539?.[_0x10672f(0xb3)]?.[_0x10672f(0x144)](_0x38671a);if(_0x2b2e66&&_0x267539?.[_0x10672f(0x15a)])try{const _0x37d207=await _0x267539['getSchema'](_0x2b2e66),_0x454945=validateConnectorConfig(_0xa9d658[_0x10672f(0xb1)],_0x37d207);if(!_0x454945[_0x10672f(0xdd)])throw new SDKError(ErrorCode[_0x10672f(0xd1)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0xa9d658[_0x10672f(0xe3)]+_0x10672f(0x15d)+formatValidationErrors(_0x454945[_0x10672f(0x100)]),undefined,{'helpText':_0x10672f(0x11d)+_0x2b2e66+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x37d207)});if(_0x454945[_0x10672f(0xe5)]['length']>0x0){const _0x465bcc=formatValidationWarnings(_0x454945[_0x10672f(0xe5)]);console[_0x10672f(0x155)](_0x10672f(0x14c)+_0xa9d658[_0x10672f(0xe3)]+_0x10672f(0x15d)+_0x465bcc);}_0x33f3dd[_0x10672f(0x12a)]=transformConfigToLegacy(_0xa9d658['connector_config'],_0x37d207);}catch(_0x134edd){if(_0x134edd instanceof SDKError&&_0x134edd[_0x10672f(0x11b)]===ErrorCode[_0x10672f(0x141)])_0x33f3dd['connectorConfig']=_0xa9d658[_0x10672f(0xb1)];else throw _0x134edd;}else _0x33f3dd['connectorConfig']=_0xa9d658['connector_config'];}else _0x33f3dd[_0x10672f(0x12a)]={};_0xa9d658[_0x10672f(0x10e)]!==undefined&&(_0x33f3dd[_0x10672f(0xc3)]=_0xa9d658[_0x10672f(0x10e)]);if(_0xa9d658[_0x10672f(0x107)]){const _0x60eb51=_0xa9d658[_0x10672f(0x107)],_0x1a60d7={};if(_0x60eb51[_0x10672f(0xed)]&&_0x60eb51[_0x10672f(0xed)]['length']>0x0){const _0x7fedfe=_0x60eb51['columns'][_0x10672f(0xfc)](_0x3bd22a=>_0x3bd22a&&_0x3bd22a[_0x10672f(0xe3)])[_0x10672f(0xcc)](normalizeColumn);_0x7fedfe[_0x10672f(0xe7)]>0x0&&(_0x1a60d7[_0x10672f(0xed)]=_0x7fedfe);}_0x60eb51[_0x10672f(0xf4)]&&(_0x1a60d7[_0x10672f(0xf1)]=_0x60eb51[_0x10672f(0xf4)]);_0x60eb51[_0x10672f(0xc8)]&&(_0x1a60d7[_0x10672f(0x104)]=_0x60eb51[_0x10672f(0xc8)]);if(_0x60eb51[_0x10672f(0x10a)]!==undefined)_0x1a60d7['joinRow']=_0x60eb51[_0x10672f(0x10a)];else{if(_0x60eb51[_0x10672f(0xc8)]===_0x10672f(0x10b)||_0x60eb51['join_strategy']===_0x10672f(0xe4))_0x1a60d7[_0x10672f(0x105)]=0x1;else _0x60eb51[_0x10672f(0xc8)]===_0x10672f(0x13a)&&(_0x1a60d7['joinRow']=null);}_0x60eb51['formatting']&&(_0x1a60d7[_0x10672f(0xc5)]=_0x60eb51[_0x10672f(0xc5)]),_0x60eb51[_0x10672f(0x13f)]&&(_0x1a60d7['orderBy']=_0x60eb51[_0x10672f(0x13f)]),_0x33f3dd['syndicationBehavior']=_0x1a60d7;}return _0xa9d658[_0x10672f(0x12b)]&&(_0x33f3dd[_0x10672f(0x15c)]=_0xa9d658[_0x10672f(0x12b)]),_0xa9d658[_0x10672f(0x15e)]&&(_0x33f3dd[_0x10672f(0x12f)]=_0xa9d658[_0x10672f(0x15e)]),_0xa9d658[_0x10672f(0x110)]!==undefined&&(_0x33f3dd[_0x10672f(0x112)]=_0xa9d658[_0x10672f(0x110)]),_0x33f3dd;}export async function activationDefToUpdateRequest(_0x113878,_0x1f8684){return activationDefToCreateRequest(_0x113878,_0x1f8684);}export function deepSortObject(_0x491445){const _0x26d871=a149_0x16ee03;if(_0x491445===null||typeof _0x491445!==_0x26d871(0x10f))return _0x491445;if(Array[_0x26d871(0xc4)](_0x491445))return _0x491445['map'](deepSortObject)[_0x26d871(0x116)]((_0x1c49ac,_0x18d0d3)=>JSON[_0x26d871(0x142)](_0x1c49ac)[_0x26d871(0x148)](JSON[_0x26d871(0x142)](_0x18d0d3)));const _0x786be3=_0x491445;if(_0x786be3['type']===_0x26d871(0x129)&&Array[_0x26d871(0xc4)](_0x786be3[_0x26d871(0xd3)])){const _0x4a658e={};for(const _0x1418e9 of Object[_0x26d871(0xbc)](_0x786be3)[_0x26d871(0x116)]()){_0x4a658e[_0x1418e9]=_0x1418e9===_0x26d871(0xd3)?_0x786be3[_0x26d871(0xd3)][_0x26d871(0xcc)](deepSortObject):deepSortObject(_0x786be3[_0x1418e9]);}return _0x4a658e;}const _0x287af5={};for(const _0x37aa73 of Object['keys'](_0x491445)['sort']()){_0x287af5[_0x37aa73]=deepSortObject(_0x491445[_0x37aa73]);}return _0x287af5;}export function serializeRule(_0x380262){return JSON['stringify'](deepSortObject(_0x380262));}export function normalizeRuleForMatching(_0x110377){return normalizeConditionsForMatching(_0x110377);}function normalizeConditionsForMatching(_0x54d910){const _0xa682f8=a149_0x16ee03;if(_0x54d910===null||typeof _0x54d910!==_0xa682f8(0x10f))return _0x54d910;if(Array[_0xa682f8(0xc4)](_0x54d910))return _0x54d910[_0xa682f8(0xcc)](normalizeConditionsForMatching);const _0x3764ff=_0x54d910;if((_0x3764ff[_0xa682f8(0xb0)]==='include'||_0x3764ff[_0xa682f8(0xb0)]===_0xa682f8(0xfd))&&typeof _0x3764ff[_0xa682f8(0x14e)]===_0xa682f8(0xfe))return{..._0x3764ff,'segment':_0xa682f8(0xbf)};const _0x587813={};for(const _0x71f00b of Object[_0xa682f8(0xbc)](_0x3764ff)){_0x587813[_0x71f00b]=normalizeConditionsForMatching(_0x3764ff[_0x71f00b]);}return _0x587813;}export function serializeRuleForMatching(_0x83b2f3){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0x83b2f3)));}export function expandSegmentReferences(_0x17ba72,_0x362d9c,_0x3588c0=new Set()){return expandConditions(_0x17ba72,_0x362d9c,_0x3588c0);}function expandConditions(_0x487151,_0x4ba1aa,_0x2bace4){const _0x2a00ff=a149_0x16ee03;if(_0x487151===null||typeof _0x487151!=='object')return _0x487151;if(Array['isArray'](_0x487151))return _0x487151[_0x2a00ff(0xcc)](_0x51d9f8=>expandConditions(_0x51d9f8,_0x4ba1aa,_0x2bace4));const _0x444914=_0x487151;if((_0x444914[_0x2a00ff(0xb0)]===_0x2a00ff(0x11f)||_0x444914[_0x2a00ff(0xb0)]===_0x2a00ff(0xfd))&&typeof _0x444914['segment']===_0x2a00ff(0xfe)){const _0x6784f6=_0x444914[_0x2a00ff(0x14e)],_0x5e123d=_0x4ba1aa['get'](_0x6784f6);if(_0x5e123d&&!_0x2bace4[_0x2a00ff(0xbe)](_0x6784f6)){const _0x1e515e=new Set(_0x2bace4);_0x1e515e[_0x2a00ff(0x124)](_0x6784f6);const _0x390dd5=expandConditions(_0x5e123d,_0x4ba1aa,_0x1e515e);return{'type':_0x444914[_0x2a00ff(0xb0)],'expanded_rule':_0x390dd5};}return{'type':_0x444914[_0x2a00ff(0xb0)],'expanded_rule':_0x2a00ff(0xde)};}const _0x167e29={};for(const _0x346f01 of Object['keys'](_0x444914)){_0x167e29[_0x346f01]=expandConditions(_0x444914[_0x346f01],_0x4ba1aa,_0x2bace4);}return _0x167e29;}export function serializeExpandedRule(_0x11ecb6,_0x26625f){const _0x5739ee=a149_0x16ee03,_0x3f9d8b=expandSegmentReferences(_0x11ecb6,_0x26625f);return JSON[_0x5739ee(0x142)](deepSortObject(_0x3f9d8b));}export function createSegmentNameContext(_0x32f71b){const _0x4e39c4=a149_0x16ee03,_0xd6f365=new Set(),_0x3856ac=new Map(),_0xb797b1=new Map();if(_0x32f71b)for(const [_0x33b28b,_0x12feef]of Object['entries'](_0x32f71b)){if(_0x12feef[_0x4e39c4(0x135)]){const _0x49bcb9=serializeRule(_0x12feef['rule']);_0xb797b1[_0x4e39c4(0x12e)](_0x49bcb9,_0x33b28b),_0xd6f365['add'](_0x33b28b);}}return{'usedNames':_0xd6f365,'ruleHashToName':_0x3856ac,'localRuleToName':_0x32f71b?_0xb797b1:undefined};}export function resolveSegmentName(_0x55b920,_0x2b9cdf,_0x554e46,_0x31a8c8){const _0x4518ea=a149_0x16ee03,_0x58f01b=serializeRule(_0x2b9cdf);if(_0x554e46['localRuleToName']){const _0x2fb5c8=_0x554e46['localRuleToName'][_0x4518ea(0x144)](_0x58f01b);if(_0x2fb5c8)return{'name':_0x2fb5c8,'isDuplicate':![],'isLocalMatch':!![]};}const _0x455902=_0x554e46[_0x4518ea(0x130)]['get'](_0x58f01b);if(_0x455902)return{'name':_0x455902,'isDuplicate':!![],'isLocalMatch':![]};const _0x2b78ff=_0x31a8c8(_0x55b920);let _0x1d3ad2=_0x2b78ff||_0x55b920,_0x5ca8ad=_0x1d3ad2,_0x430c8e=0x2;while(_0x554e46[_0x4518ea(0xb5)]['has'](_0x5ca8ad)){_0x5ca8ad=_0x1d3ad2+'_'+_0x430c8e,_0x430c8e++;}return _0x554e46['usedNames'][_0x4518ea(0x124)](_0x5ca8ad),_0x554e46[_0x4518ea(0x130)][_0x4518ea(0x12e)](_0x58f01b,_0x5ca8ad),{'name':_0x5ca8ad,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x6ad763){const _0x24d5b7=[],_0x4b2a5f=_0x5025b5=>{const _0x36ab41=a149_0x4f28;if(!_0x5025b5||typeof _0x5025b5!==_0x36ab41(0x10f))return;if(Array[_0x36ab41(0xc4)](_0x5025b5)){_0x5025b5['forEach'](_0x4b2a5f);return;}const _0x21c814=_0x5025b5;(_0x21c814[_0x36ab41(0xb0)]===_0x36ab41(0x11f)||_0x21c814['type']===_0x36ab41(0xfd))&&typeof _0x21c814[_0x36ab41(0x14e)]===_0x36ab41(0xfe)&&_0x24d5b7[_0x36ab41(0x11e)](_0x21c814['segment']);for(const _0x54aa6d of Object[_0x36ab41(0x152)](_0x21c814)){_0x4b2a5f(_0x54aa6d);}};return _0x4b2a5f(_0x6ad763),_0x24d5b7;}export function validateSegmentRule(_0x3bfeba,_0x4630d0){const _0x1c8d01=a149_0x16ee03;if(!_0x4630d0||!_0x4630d0[_0x1c8d01(0xd3)])return;for(let _0x405d65=0x0;_0x405d65<_0x4630d0[_0x1c8d01(0xd3)]['length'];_0x405d65++){const _0x10a6b6=_0x4630d0[_0x1c8d01(0xd3)][_0x405d65];if('type'in _0x10a6b6&&_0x10a6b6[_0x1c8d01(0xb0)]===_0x1c8d01(0x109)){const _0x3018b2=_0x10a6b6,_0x3b1455=_0x3018b2[_0x1c8d01(0xb9)]||_0x3018b2['aggregation'];if((!_0x3018b2[_0x1c8d01(0x103)]||_0x3018b2[_0x1c8d01(0x103)]==='')&&!_0x3b1455)throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x1c8d01(0xf9)+_0x3bfeba+_0x1c8d01(0xda)+('conditions['+_0x405d65+_0x1c8d01(0xd9))+_0x1c8d01(0x137));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36a193,_0x5df150){const _0x58fc74=a150_0x31a6,_0x9cebe1=_0x36a193();while(!![]){try{const _0xb90720=-parseInt(_0x58fc74(0x1ee))/0x1*(parseInt(_0x58fc74(0x1e3))/0x2)+-parseInt(_0x58fc74(0x219))/0x3*(-parseInt(_0x58fc74(0x20b))/0x4)+parseInt(_0x58fc74(0x202))/0x5*(parseInt(_0x58fc74(0x1f4))/0x6)+parseInt(_0x58fc74(0x204))/0x7+parseInt(_0x58fc74(0x1f9))/0x8*(parseInt(_0x58fc74(0x1e7))/0x9)+-parseInt(_0x58fc74(0x20a))/0xa*(parseInt(_0x58fc74(0x208))/0xb)+-parseInt(_0x58fc74(0x20f))/0xc;if(_0xb90720===_0x5df150)break;else _0x9cebe1['push'](_0x9cebe1['shift']());}catch(_0x2b945f){_0x9cebe1['push'](_0x9cebe1['shift']());}}}(a150_0x38e9,0x9d44d));import a150_0x4b1a0d from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x51b02c){const _0x477642=a150_0x31a6,_0x2d6cee=_0x51b02c[_0x477642(0x1e8)]['map'](_0x2822c6=>({'column_name':_0x2822c6[_0x477642(0x1e9)],'column_type':_0x2822c6[_0x477642(0x209)],'null':_0x477642(0x206),'key':null,'default':null,'extra':null}));return{..._0x51b02c,'columns':[{'name':_0x477642(0x1e6),'type':_0x477642(0x1e5)},{'name':_0x477642(0x1ec),'type':_0x477642(0x1e5)},{'name':_0x477642(0x21b),'type':_0x477642(0x1e5)},{'name':_0x477642(0x211),'type':'varchar'},{'name':_0x477642(0x1f2),'type':_0x477642(0x1e5)},{'name':_0x477642(0x1ea),'type':_0x477642(0x1e5)}],'data':_0x2d6cee};}export async function executeSchemaQuery(_0x13f7ab,_0x427d05,_0x5d4c69){const _0x428381=a150_0x31a6,_0x139b80=_0x13f7ab[_0x428381(0x1ff)]()[_0x428381(0x1fc)](/;+$/,''),_0x42745a=_0x428381(0x21c)+_0x139b80+_0x428381(0x216);_0x5d4c69[_0x428381(0x20c)]&&console[_0x428381(0x1fe)]('Schema\x20query:\x0a'+_0x42745a);const _0x160467=await withProgressSpinner(_0x428381(0x217),async _0x2f02cb=>{const _0x32e2fd=_0x428381,_0x4674d5=await _0x427d05[_0x32e2fd(0x214)]['execute'](_0x42745a,{'catalog':'td','schema':'information_schema','onJobId':_0x9eac5b=>{const _0x28c828=_0x32e2fd;_0x2f02cb[_0x28c828(0x20d)](_0x9eac5b);}});return _0x4674d5;},{'verbose':_0x5d4c69[_0x428381(0x20c)]});return buildSchemaResult(_0x160467[_0x428381(0x1fb)]);}function columnName(_0x4454e8){const _0x1321e0=a150_0x31a6;return _0x4454e8['matrixColumnName']||_0x4454e8[_0x1321e0(0x1e4)]||_0x4454e8[_0x1321e0(0x1e9)];}function formatFieldLine(_0x3e137f,_0x30208b,_0xf8f543){const _0x4d6bbd=a150_0x31a6,_0x283a17=_0x3e137f!==_0x30208b?'\x20'+a150_0x4b1a0d['dim']('('+_0x30208b+')'):'';return'\x20\x20\x20\x20'+_0x3e137f+_0x283a17+':\x20'+a150_0x4b1a0d[_0x4d6bbd(0x1f6)](_0xf8f543);}function a150_0x31a6(_0x47e217,_0x1e3726){_0x47e217=_0x47e217-0x1e3;const _0x38e95a=a150_0x38e9();let _0x31a637=_0x38e95a[_0x47e217];return _0x31a637;}function sortByColumnName(_0x4b3e76){const _0x3b4385=a150_0x31a6;return[..._0x4b3e76][_0x3b4385(0x200)]((_0x2a30d3,_0x1a8d62)=>columnName(_0x2a30d3)[_0x3b4385(0x201)](columnName(_0x1a8d62)));}export function displayFieldsHumanReadable(_0x476555,_0x50ea5e){const _0x1412e7=a150_0x31a6,_0x57d3ce=_0x476555[_0x1412e7(0x1ef)](_0xfd3657=>_0xfd3657[_0x1412e7(0x1fa)]===_0x1412e7(0x1f5)),_0x283121=_0x476555['filter'](_0x2ef4b3=>_0x2ef4b3[_0x1412e7(0x1fa)]==='behavior'),_0x58973c=new Map();for(const _0x58df7c of _0x57d3ce){const _0x5386f6=_0x58df7c[_0x1412e7(0x213)]||_0x58df7c['parentTableName']||_0x1412e7(0x205),_0x294394=_0x58973c['get'](_0x5386f6);_0x294394?_0x294394['fields'][_0x1412e7(0x203)](_0x58df7c):_0x58973c[_0x1412e7(0x1f8)](_0x5386f6,{'displayName':_0x5386f6,'tableName':_0x58df7c[_0x1412e7(0x1ed)],'fields':[_0x58df7c]});}const _0x2348ef=new Map();for(const _0x358474 of _0x283121){const _0x3c9a7a=_0x358474[_0x1412e7(0x215)]||'Unknown',_0x45f47c=_0x2348ef['get'](_0x3c9a7a)||[];_0x45f47c[_0x1412e7(0x203)](_0x358474),_0x2348ef[_0x1412e7(0x1f8)](_0x3c9a7a,_0x45f47c);}console[_0x1412e7(0x1fe)]('\x0a'+a150_0x4b1a0d[_0x1412e7(0x1f7)](_0x50ea5e));if(_0x58973c[_0x1412e7(0x1f1)]>0x0){console[_0x1412e7(0x1fe)]('\x0a'+a150_0x4b1a0d[_0x1412e7(0x1f3)]('Attributes'));const _0x2b856a=[..._0x58973c[_0x1412e7(0x1f0)]()][_0x1412e7(0x200)]((_0x5c71b2,_0x2ae92d)=>_0x5c71b2[0x0]['localeCompare'](_0x2ae92d[0x0]));for(const [,_0x3664ae]of _0x2b856a){const _0x4b441c=_0x3664ae[_0x1412e7(0x210)]&&_0x3664ae[_0x1412e7(0x210)]!==_0x3664ae[_0x1412e7(0x1eb)]?'\x20'+a150_0x4b1a0d[_0x1412e7(0x1f3)]('('+_0x3664ae['tableName']+')'):'';console[_0x1412e7(0x1fe)]('\x20\x20'+a150_0x4b1a0d[_0x1412e7(0x1f7)](_0x3664ae['displayName'])+_0x4b441c);for(const _0x2e0071 of sortByColumnName(_0x3664ae[_0x1412e7(0x21a)])){console[_0x1412e7(0x1fe)](formatFieldLine(columnName(_0x2e0071),_0x2e0071[_0x1412e7(0x1e9)],_0x2e0071[_0x1412e7(0x209)]));}}}if(_0x2348ef[_0x1412e7(0x1f1)]>0x0){console[_0x1412e7(0x1fe)]('\x0a'+a150_0x4b1a0d[_0x1412e7(0x1f3)](_0x1412e7(0x1fd)));const _0x11e4d9=[..._0x2348ef[_0x1412e7(0x1f0)]()][_0x1412e7(0x200)]((_0x36c0be,_0x2cf13e)=>_0x36c0be[0x0][_0x1412e7(0x201)](_0x2cf13e[0x0]));for(const [_0x30d501,_0x6d74]of _0x11e4d9){const _0x17d4b3=_0x6d74[0x0],_0x5a9ab4=_0x17d4b3?.[_0x1412e7(0x207)];if(_0x5a9ab4){const _0x20487b=_0x5a9ab4!==_0x30d501?'\x20'+a150_0x4b1a0d[_0x1412e7(0x1f3)]('('+_0x30d501+')'):'';console[_0x1412e7(0x1fe)]('\x20\x20'+a150_0x4b1a0d[_0x1412e7(0x1f7)](_0x5a9ab4)+_0x20487b);}else{const _0x16682d=_0x17d4b3?.['parentTableName']||'';console[_0x1412e7(0x1fe)]('\x20\x20'+a150_0x4b1a0d[_0x1412e7(0x1f7)](_0x30d501)+(_0x16682d?'\x20'+a150_0x4b1a0d['dim']('('+_0x16682d+')'):''));}for(const _0x1ab842 of sortByColumnName(_0x6d74)){const _0x19d966=_0x1ab842[_0x1412e7(0x1e9)]['startsWith'](_0x30d501+'.')?_0x1ab842[_0x1412e7(0x1e9)][_0x1412e7(0x218)](_0x30d501[_0x1412e7(0x20e)]+0x1):_0x1ab842['name'];console[_0x1412e7(0x1fe)](formatFieldLine(columnName(_0x1ab842),_0x19d966,_0x1ab842[_0x1412e7(0x209)]));}}}const _0x4d2e46=_0x476555[_0x1412e7(0x212)](_0xb907cb=>_0xb907cb['matrixColumnName']||_0xb907cb[_0x1412e7(0x207)]);_0x4d2e46&&(console['error']('\x0a'+a150_0x4b1a0d[_0x1412e7(0x1f3)]('Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).')),console[_0x1412e7(0x1fe)](a150_0x4b1a0d[_0x1412e7(0x1f3)](_0x1412e7(0x21d)))),console['error']('');}function a150_0x38e9(){const _0x15195c=['push','2002567IcnSpq','Unknown','YES','matrixTableName','3019093gHHJqI','type','30PxYuzq','4HPvtIg','verbose','setJobId','length','3722532FYlDXh','tableName','key','some','groupingName','query','behaviorName','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','Fetching\x20schema...','slice','3090759IqQKXw','fields','null','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','422nhwwin','parentColumn','varchar','column_name','147411xCNNOB','columns','name','extra','displayName','column_type','parentTableName','4871jwOUtz','filter','entries','size','default','dim','831522SMSlcN','attribute','cyan','bold','set','592uxuHgl','source','data','replace','Behaviors','error','trim','sort','localeCompare','10NRLoJs'];a150_0x38e9=function(){return _0x15195c;};return a150_0x38e9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d0262,_0x4c9bd5){const _0x587776=a151_0x417a,_0x10fef2=_0x2d0262();while(!![]){try{const _0x234da0=-parseInt(_0x587776(0x1c6))/0x1+parseInt(_0x587776(0x1c5))/0x2*(-parseInt(_0x587776(0x1c1))/0x3)+-parseInt(_0x587776(0x1c0))/0x4+parseInt(_0x587776(0x1b6))/0x5+-parseInt(_0x587776(0x1bb))/0x6*(-parseInt(_0x587776(0x1c4))/0x7)+parseInt(_0x587776(0x1c8))/0x8+-parseInt(_0x587776(0x1b8))/0x9;if(_0x234da0===_0x4c9bd5)break;else _0x10fef2['push'](_0x10fef2['shift']());}catch(_0x3639d2){_0x10fef2['push'](_0x10fef2['shift']());}}}(a151_0xdb75,0xb4bb4));import{readdirSync,statSync}from'fs';function a151_0x417a(_0x5abfca,_0x1f40b8){_0x5abfca=_0x5abfca-0x1b6;const _0xdb7524=a151_0xdb75();let _0x417aec=_0xdb7524[_0x5abfca];return _0x417aec;}import a151_0x173282 from'path';function a151_0xdb75(){const _0x1002a8=['10mSzvje','479074FDKIkB','dirname','9244480JQIdfU','3955560TiqMJp','.yml','2319030ZxWQtC','join','.yaml','618wTsgHV','name','relative','replace','endsWith','3383340WAVrlU','617613hsJoWp','push','isDirectory','95522NgbCeE'];a151_0xdb75=function(){return _0x1002a8;};return a151_0xdb75();}export function findYamlFiles(_0x2c127a){const _0x2bd831=[];function _0xcc033(_0x190049){const _0x496fce=a151_0x417a,_0x1d0e8c=readdirSync(_0x190049,{'withFileTypes':!![]});for(const _0x292116 of _0x1d0e8c){const _0x3230f1=a151_0x173282[_0x496fce(0x1b9)](_0x190049,_0x292116['name']);if(_0x292116[_0x496fce(0x1c3)]())_0xcc033(_0x3230f1);else(_0x292116[_0x496fce(0x1bc)][_0x496fce(0x1bf)](_0x496fce(0x1b7))||_0x292116[_0x496fce(0x1bc)][_0x496fce(0x1bf)](_0x496fce(0x1ba)))&&_0x2bd831[_0x496fce(0x1c2)](_0x3230f1);}}return _0xcc033(_0x2c127a),_0x2bd831;}export function discoverYamlFiles(_0x562c09){const _0x425a62=findYamlFiles(_0x562c09);return _0x425a62['map'](_0x483c78=>{const _0x147fa0=a151_0x417a,_0x3cd83d=a151_0x173282[_0x147fa0(0x1bd)](_0x562c09,_0x483c78),_0x34379b=a151_0x173282[_0x147fa0(0x1c7)](_0x3cd83d);return{'absolutePath':_0x483c78,'relativePath':_0x3cd83d,'folderPath':_0x34379b==='.'?'':_0x34379b[_0x147fa0(0x1be)](/\\/g,'/')};});}export function isYamlFile(_0x5325fd){const _0x2ec90d=a151_0x417a;try{const _0x41b4c2=statSync(_0x5325fd);if(!_0x41b4c2['isFile']())return![];const _0xac9aa2=a151_0x173282['extname'](_0x5325fd)['toLowerCase']();return _0xac9aa2===_0x2ec90d(0x1b7)||_0xac9aa2===_0x2ec90d(0x1ba);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1f33da,_0x4f4211){const _0x2e52a1=a152_0x39dd,_0x3d4d44=_0x1f33da();while(!![]){try{const _0x160d55=parseInt(_0x2e52a1(0x12d))/0x1+parseInt(_0x2e52a1(0x116))/0x2*(-parseInt(_0x2e52a1(0x114))/0x3)+-parseInt(_0x2e52a1(0x10f))/0x4+parseInt(_0x2e52a1(0x124))/0x5*(parseInt(_0x2e52a1(0x12e))/0x6)+-parseInt(_0x2e52a1(0x129))/0x7+parseInt(_0x2e52a1(0x138))/0x8+parseInt(_0x2e52a1(0x122))/0x9*(parseInt(_0x2e52a1(0x11f))/0xa);if(_0x160d55===_0x4f4211)break;else _0x3d4d44['push'](_0x3d4d44['shift']());}catch(_0x313ffb){_0x3d4d44['push'](_0x3d4d44['shift']());}}}(a152_0x2312,0x53699));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x4f739c){const _0x4476a6=a152_0x39dd;return _0x4f739c['toLowerCase']()['replace'](/\s+/g,'_')[_0x4476a6(0x106)](/[^a-z0-9_\p{L}\p{N}]/gu,'')['replace'](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0xa04fee){const _0x35c57f=a152_0x39dd,_0x8ddba0=_0xa04fee[_0x35c57f(0x134)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x8ddba0){const _0x48f49e=_0x8ddba0[0x1]['toLowerCase'](),_0x8b3e2d=_0x8ddba0[0x2],_0x2f166a=_0x8b3e2d[_0x35c57f(0x106)](/-/g,'')[_0x35c57f(0x132)](0x0,0x4)[_0x35c57f(0xf2)]();return _0x48f49e+'_'+_0x2f166a;}const _0x4388c1=_0xa04fee[_0x35c57f(0x134)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x4388c1){const _0x181a89=_0x4388c1[0x1],_0x553ff2=_0x4388c1[0x2][_0x35c57f(0xf2)](),_0x2c7685=_0x181a89[_0x35c57f(0x106)](/-/g,'')[_0x35c57f(0x132)](0x0,0x4)['toLowerCase']();return _0x553ff2+'_'+_0x2c7685;}return undefined;}function stableStringify(_0x41d4b0){const _0x4812c8=a152_0x39dd;if(Array[_0x4812c8(0xf1)](_0x41d4b0))return'['+_0x41d4b0[_0x4812c8(0x127)](_0x597ddb=>stableStringify(_0x597ddb))[_0x4812c8(0x131)](',')+']';if(_0x41d4b0&&typeof _0x41d4b0===_0x4812c8(0x13b)){const _0xd1aa04=_0x41d4b0,_0x26f3ad=Object[_0x4812c8(0x110)](_0xd1aa04)[_0x4812c8(0x118)](),_0x2d327f=_0x26f3ad[_0x4812c8(0x127)](_0x3baa58=>'\x22'+_0x3baa58+'\x22:'+stableStringify(_0xd1aa04[_0x3baa58]));return'{'+_0x2d327f[_0x4812c8(0x131)](',')+'}';}const _0x214f16=JSON[_0x4812c8(0xf0)](_0x41d4b0);return _0x214f16===undefined?_0x4812c8(0x10b):_0x214f16;}export function consolidateActivationsByContent(_0x5713ce){const _0xe97545=a152_0x39dd,_0x42ef0e={},_0x2c4c2e=new Map(),_0x2feb89=new Map();for(const _0xa0a3e7 of _0x5713ce){if(!_0xa0a3e7)continue;for(const [_0x4663f3,_0x282897]of Object['entries'](_0xa0a3e7)){const _0x488409={'name':_0x282897[_0xe97545(0x11b)],'connection':_0x282897[_0xe97545(0x12a)],..._0x282897['all_columns']!==undefined&&{'all_columns':_0x282897['all_columns']},..._0x282897['columns']!==undefined&&{'columns':_0x282897[_0xe97545(0xf9)]},..._0x282897[_0xe97545(0xee)]!==undefined&&{'behavior':_0x282897[_0xe97545(0xee)]},..._0x282897[_0xe97545(0x101)]!==undefined&&{'schedule':_0x282897[_0xe97545(0x101)]},..._0x282897[_0xe97545(0x11a)]!==undefined&&{'notification':_0x282897[_0xe97545(0x11a)]},..._0x282897['connector_config']!==undefined&&{'connector_config':_0x282897[_0xe97545(0x102)]},..._0x282897[_0xe97545(0x11c)]!==undefined&&{'activation_template_id':_0x282897['activation_template_id']}},_0x505b6b=stableStringify(_0x488409),_0x154513=_0x2feb89['get'](_0x505b6b);_0x154513?_0x2c4c2e['set'](_0x4663f3,_0x154513):(_0x42ef0e[_0x4663f3]=_0x282897,_0x2c4c2e['set'](_0x4663f3,_0x4663f3),_0x2feb89[_0xe97545(0x121)](_0x505b6b,_0x4663f3));}}return{'merged':_0x42ef0e,'nameMapping':_0x2c4c2e};}export function updateActivationReferences(_0x2c9bf9,_0x4df2af){const _0x220178=a152_0x39dd;if(!_0x2c9bf9)return;for(const _0x12b64e of _0x2c9bf9){if(!_0x12b64e[_0x220178(0xf4)])continue;for(const _0x49d551 of _0x12b64e[_0x220178(0xf4)]){if(_0x49d551[_0x220178(0x111)]===_0x220178(0x123)&&_0x49d551[_0x220178(0xfd)]?.['activation']){const _0x24a355=_0x4df2af[_0x220178(0xf3)](_0x49d551[_0x220178(0xfd)][_0x220178(0x123)]);_0x24a355&&_0x24a355!==_0x49d551['with'][_0x220178(0x123)]&&(_0x49d551[_0x220178(0xfd)][_0x220178(0x123)]=_0x24a355);}}}}export function consolidateSegmentsByContent(_0x26dd96,_0x15e659){const _0x455bad=a152_0x39dd,_0xe812c7={},_0x2216ae=new Map(),_0x35a7bd=new Map();for(const _0x4b703b of _0x26dd96){if(!_0x4b703b)continue;for(const [_0x5d7508,_0x3ae201]of Object[_0x455bad(0x117)](_0x4b703b)){if(!_0x3ae201[_0x455bad(0x113)]){_0xe812c7[_0x5d7508]=_0x3ae201,_0x2216ae[_0x455bad(0x121)](_0x5d7508,_0x5d7508);continue;}const _0x44477c=_0x3ae201[_0x455bad(0x119)]&&_0x3ae201['description'][_0x455bad(0xfa)]()?_0x3ae201[_0x455bad(0x119)]:undefined,_0x15342f=JSON[_0x455bad(0xf0)]({'description':_0x44477c,'rule':deepSortObject(_0x3ae201[_0x455bad(0x113)])}),_0x3fe1ee=_0x35a7bd[_0x455bad(0xf3)](_0x15342f);if(_0x3fe1ee){const _0x44120a={..._0x3ae201[_0x455bad(0x119)]!==undefined&&{'description':_0x3ae201['description']},'rule':_0x3ae201[_0x455bad(0x113)]?deepSortObject(_0x3ae201[_0x455bad(0x113)]):_0x3ae201['rule']};if(_0x5d7508<_0x3fe1ee){_0xe812c7[_0x5d7508]=_0x44120a,delete _0xe812c7[_0x3fe1ee];for(const [_0xce1966,_0x53f011]of _0x2216ae[_0x455bad(0x117)]()){_0x53f011===_0x3fe1ee&&_0x2216ae[_0x455bad(0x121)](_0xce1966,_0x5d7508);}_0x2216ae[_0x455bad(0x121)](_0x5d7508,_0x5d7508),_0x35a7bd[_0x455bad(0x121)](_0x15342f,_0x5d7508);}else _0xe812c7[_0x3fe1ee]=_0x44120a,_0x2216ae[_0x455bad(0x121)](_0x5d7508,_0x3fe1ee);}else{let _0x4750f3=_0x5d7508;if(_0x15e659){const _0x74466c=_0x15e659[_0x455bad(0xf3)](_0x15342f);_0x74466c&&_0x74466c[_0x455bad(0xed)]>0x0&&(_0x4750f3=_0x74466c[_0x455bad(0x132)]()[_0x455bad(0x118)]()[0x0]);}const _0x125048={..._0x3ae201['description']!==undefined&&{'description':_0x3ae201[_0x455bad(0x119)]},'rule':_0x3ae201[_0x455bad(0x113)]?deepSortObject(_0x3ae201['rule']):_0x3ae201[_0x455bad(0x113)]};_0xe812c7[_0x4750f3]=_0x125048,_0x2216ae[_0x455bad(0x121)](_0x5d7508,_0x4750f3),_0x35a7bd['set'](_0x15342f,_0x4750f3);}}}return{'merged':_0xe812c7,'nameMapping':_0x2216ae};}export function updateSegmentReferences(_0x51c9a2,_0x2c593a){const _0x573bfa=a152_0x39dd;if(!_0x51c9a2)return;for(const _0x52bfa0 of _0x51c9a2){if(_0x52bfa0['entry_criteria']?.[_0x573bfa(0x109)]){const _0x4e675d=_0x2c593a[_0x573bfa(0xf3)](_0x52bfa0[_0x573bfa(0xf8)][_0x573bfa(0x109)]);_0x4e675d&&(_0x52bfa0['entry_criteria'][_0x573bfa(0x109)]=_0x4e675d);}if(_0x52bfa0[_0x573bfa(0x100)])for(const _0x2c98de of _0x52bfa0[_0x573bfa(0x100)]){if(_0x2c98de[_0x573bfa(0x109)]){const _0x4845a4=_0x2c593a[_0x573bfa(0xf3)](_0x2c98de[_0x573bfa(0x109)]);_0x4845a4&&(_0x2c98de[_0x573bfa(0x109)]=_0x4845a4);}}if(_0x52bfa0[_0x573bfa(0xfb)]?.[_0x573bfa(0x109)]){const _0x14970a=_0x2c593a[_0x573bfa(0xf3)](_0x52bfa0[_0x573bfa(0xfb)]['segment']);_0x14970a&&(_0x52bfa0[_0x573bfa(0xfb)][_0x573bfa(0x109)]=_0x14970a);}if(_0x52bfa0['steps'])for(const _0x562283 of _0x52bfa0[_0x573bfa(0xf4)]){if(_0x562283[_0x573bfa(0x111)]===_0x573bfa(0x120)&&_0x562283[_0x573bfa(0xfd)]?.[_0x573bfa(0xf5)])for(const _0x230b7f of _0x562283['with'][_0x573bfa(0xf5)]){if(_0x230b7f[_0x573bfa(0x109)]){const _0x1aea33=_0x2c593a[_0x573bfa(0xf3)](_0x230b7f['segment']);_0x1aea33&&(_0x230b7f[_0x573bfa(0x109)]=_0x1aea33);}}if(_0x562283[_0x573bfa(0x111)]===_0x573bfa(0xfc)&&_0x562283[_0x573bfa(0xfd)]?.[_0x573bfa(0x12c)]?.[_0x573bfa(0x109)]){const _0x112724=_0x2c593a[_0x573bfa(0xf3)](_0x562283[_0x573bfa(0xfd)]['condition']['segment']);_0x112724&&(_0x562283['with'][_0x573bfa(0x12c)]['segment']=_0x112724);}}}}function a152_0x39dd(_0x49e0a7,_0x166556){_0x49e0a7=_0x49e0a7-0xed;const _0x231262=a152_0x2312();let _0x39dd3e=_0x231262[_0x49e0a7];return _0x39dd3e;}export function updateSegmentRefsInSegments(_0x18ff54,_0x393008){const _0x503338=a152_0x39dd;for(const _0x54a8d8 of Object[_0x503338(0x12f)](_0x18ff54)){_0x54a8d8[_0x503338(0x113)]&&updateSegmentRefsInRule(_0x54a8d8[_0x503338(0x113)],_0x393008);}}function updateSegmentRefsInRule(_0x3971f7,_0x2fe3bd){const _0xc4a97e=a152_0x39dd;if(_0x3971f7===null||typeof _0x3971f7!==_0xc4a97e(0x13b))return;if(Array[_0xc4a97e(0xf1)](_0x3971f7)){for(const _0x5bc43c of _0x3971f7){updateSegmentRefsInRule(_0x5bc43c,_0x2fe3bd);}return;}const _0x4dede9=_0x3971f7;if((_0x4dede9['type']===_0xc4a97e(0xfe)||_0x4dede9[_0xc4a97e(0x111)]===_0xc4a97e(0x13c))&&typeof _0x4dede9['segment']==='string'){const _0x5c5ca7=_0x2fe3bd[_0xc4a97e(0xf3)](_0x4dede9[_0xc4a97e(0x109)]);_0x5c5ca7&&(_0x4dede9[_0xc4a97e(0x109)]=_0x5c5ca7);}if(_0x4dede9['conditions']&&Array[_0xc4a97e(0xf1)](_0x4dede9['conditions']))for(const _0x578a6d of _0x4dede9[_0xc4a97e(0x103)]){updateSegmentRefsInRule(_0x578a6d,_0x2fe3bd);}}export function buildJourneysArray(_0x59b433,_0x104e5f){const _0x2fef1b=a152_0x39dd;return _0x59b433[_0x2fef1b(0x127)](_0x435f90=>{const _0x1781d1=_0x2fef1b,_0x637518=_0x104e5f?_0x435f90['item']['id']===_0x104e5f:_0x59b433[_0x1781d1(0xed)]===0x1,_0x1dab39=_0x435f90['yaml']['journeys']?.[0x0],_0x40c978=_0x1dab39?.[_0x1781d1(0x133)]||_0x435f90[_0x1781d1(0xff)][_0x1781d1(0x133)],_0x568757={'version':_0x1dab39?.[_0x1781d1(0xef)]||_0x435f90[_0x1781d1(0xff)][_0x1781d1(0xef)]||_0x435f90['item'][_0x1781d1(0x11b)],'state':_0x435f90[_0x1781d1(0x11d)]['state']===_0x1781d1(0x105)?_0x1781d1(0x105):_0x1781d1(0x108),'stages':_0x1dab39?.['stages']||_0x435f90[_0x1781d1(0xff)][_0x1781d1(0x10c)]||[],'id':_0x1dab39?.['id']||_0x435f90[_0x1781d1(0xff)]['id'],'version_number':_0x1dab39?.['version_number']||_0x435f90[_0x1781d1(0xff)]['version_number']};return _0x40c978&&(_0x568757[_0x1781d1(0x133)]=_0x40c978),_0x637518&&(_0x568757[_0x1781d1(0x10a)]=!![]),_0x568757;});}export function buildMergedJourneyDef(_0xbeb151,_0x4aedfa,_0x16be62){const _0x367114=a152_0x39dd,_0x1365f6=_0xbeb151[0x0][_0x367114(0xff)],_0x34d7c5=buildJourneysArray(_0xbeb151,_0x16be62),{merged:_0x5d365c,nameMapping:_0x94fcaf}=consolidateSegmentsByContent(_0xbeb151[_0x367114(0x127)](_0x18281b=>_0x18281b[_0x367114(0xff)][_0x367114(0x128)]),_0x4aedfa);updateSegmentRefsInSegments(_0x5d365c,_0x94fcaf);const _0x39e42e=Array[_0x367114(0x139)](_0x94fcaf[_0x367114(0x117)]())[_0x367114(0x130)](([_0x3a320b,_0x59c3c6])=>_0x3a320b!==_0x59c3c6&&_0x3a320b[_0x367114(0x10d)]('entry_criteria'));let _0x101b01=_0x5d365c,_0x11b6e0=new Map();if(_0x39e42e){const _0x26ce70=consolidateSegmentsByContent([_0x5d365c],_0x4aedfa);_0x101b01=_0x26ce70[_0x367114(0x12b)],_0x11b6e0=_0x26ce70[_0x367114(0x104)];}const _0x5be1f5=new Map(_0x94fcaf);for(const [_0x52a9c0,_0x49c769]of _0x11b6e0[_0x367114(0x117)]()){_0x5be1f5['set'](_0x52a9c0,_0x49c769);}for(const [_0x829472,_0x54f02d]of _0x5be1f5[_0x367114(0x117)]()){let _0x1f644f=_0x54f02d,_0x252967=0x0;while(_0x5be1f5[_0x367114(0x13a)](_0x1f644f)&&_0x5be1f5[_0x367114(0xf3)](_0x1f644f)!==_0x1f644f&&_0x252967<MAX_MAPPING_CHAIN_DEPTH){_0x1f644f=_0x5be1f5[_0x367114(0xf3)](_0x1f644f),_0x252967++;}_0x1f644f!==_0x54f02d&&_0x5be1f5[_0x367114(0x121)](_0x829472,_0x1f644f);}for(const _0x248c9f of _0x34d7c5){updateSegmentReferences(_0x248c9f['stages'],_0x5be1f5);}const {merged:_0x221b58,nameMapping:_0x4d1b52}=consolidateActivationsByContent(_0xbeb151['map'](_0x4cd56c=>_0x4cd56c[_0x367114(0xff)]['activations']));for(const _0x246178 of _0x34d7c5){updateActivationReferences(_0x246178[_0x367114(0x10c)],_0x4d1b52);}let _0x296f89=_0x1365f6[_0x367114(0x133)];if(_0x296f89?.[_0x367114(0x109)]){const _0x3ff079=_0x5be1f5[_0x367114(0xf3)](_0x296f89[_0x367114(0x109)]);_0x3ff079&&(_0x296f89={..._0x296f89,'segment':_0x3ff079});}for(const _0x3b8d65 of _0x34d7c5){if(_0x3b8d65['goal']?.[_0x367114(0x109)]){const _0x4368ba=_0x5be1f5['get'](_0x3b8d65[_0x367114(0x133)]['segment']);_0x4368ba&&(_0x3b8d65[_0x367114(0x133)]={..._0x3b8d65['goal'],'segment':_0x4368ba});}}return _0x34d7c5[_0x367114(0x130)](_0x3b71b2=>_0x3b71b2[_0x367114(0x133)])&&(_0x296f89=undefined),{'type':_0x367114(0x10e),'name':_0x1365f6[_0x367114(0x11b)],'description':_0x1365f6[_0x367114(0x119)],'goal':_0x296f89,'reentry':_0x1365f6[_0x367114(0x125)],'segments':Object[_0x367114(0x110)](_0x101b01)[_0x367114(0xed)]>0x0?_0x101b01:undefined,'activations':Object[_0x367114(0x110)](_0x221b58)[_0x367114(0xed)]>0x0?_0x221b58:undefined,'journeys':_0x34d7c5,'bundle_id':_0x1365f6['bundle_id'],'bundle_name':_0x1365f6['bundle_name']};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x26beef,_0x1c7549,_0x437030,_0x2fa62e){const _0x22baaa=a152_0x39dd,_0x5502af=_0x26beef+':'+_0x1c7549,_0x4de668=_0x437030['get'](_0x5502af);if(_0x4de668)return _0x4de668;const _0x576118=await _0x2fa62e(_0x26beef),_0x47ef7d=_0x576118[_0x22baaa(0x112)][_0x22baaa(0xf6)]||_0x576118[_0x22baaa(0x112)][_0x22baaa(0x11b)],_0x4f191a=_0x576118[_0x22baaa(0x112)][_0x22baaa(0x137)][_0x22baaa(0x126)](_0x305746=>String(_0x305746['id'])===String(_0x1c7549)),_0x143811=_0x4f191a?.[_0x22baaa(0x11b)]||_0x1c7549,_0x1b9c5d={'journeyName':_0x47ef7d,'stageName':_0x143811};return _0x437030[_0x22baaa(0x121)](_0x5502af,_0x1b9c5d),_0x1b9c5d;}export function formatApiJourneyName(_0xf12ea5,_0x54462b){return _0x54462b+'\x20('+_0xf12ea5+')';}export function isLocalJourneyRef(_0x188644){const _0x15d025=a152_0x39dd;return _0x188644[_0x15d025(0x135)](_0x15d025(0xf7))||_0x188644['endsWith'](_0x15d025(0x11e));}export function buildLocalRuleToNameMapping(_0x45ee48){const _0x49fad3=a152_0x39dd,_0x320421=new Map();if(!_0x45ee48)return _0x320421;for(const [_0x537a0d,_0x2c7502]of Object['entries'](_0x45ee48)){if(_0x2c7502[_0x49fad3(0x113)]){const _0x4257c9=serializeRule(_0x2c7502['rule']),_0xe7a46=_0x320421[_0x49fad3(0xf3)](_0x4257c9)||[];_0xe7a46['push'](_0x537a0d),_0x320421[_0x49fad3(0x121)](_0x4257c9,_0xe7a46);}}return _0x320421;}export function buildLocalRuleToNameMappingFromJourney(_0x445b59){const _0x3b9143=a152_0x39dd,_0x4c454c=_0x445b59['segments'];if(!_0x4c454c)return new Map();const _0x138043=collectSegmentUsageCounts(_0x445b59),_0x4d7321=new Map();let _0x5e1aa4=0x0;for(const [_0x5f28ef,_0x4d37aa]of Object[_0x3b9143(0x117)](_0x4c454c)){if(!_0x4d37aa[_0x3b9143(0x113)]){_0x5e1aa4++;continue;}const _0x4ea93e=serializeRule(_0x4d37aa['rule']),_0x5cf433=_0x4d7321[_0x3b9143(0xf3)](_0x4ea93e)||[];_0x5cf433['push']({'name':_0x5f28ef,'index':_0x5e1aa4}),_0x4d7321['set'](_0x4ea93e,_0x5cf433),_0x5e1aa4++;}const _0x333feb=new Map();for(const [_0x47e95e,_0x493654]of _0x4d7321){const _0x51ebcb=_0x493654['slice']()[_0x3b9143(0x118)]((_0x1d1fac,_0x414917)=>{const _0x3f4355=_0x3b9143,_0x2b7fab=_0x138043[_0x3f4355(0xf3)](_0x1d1fac[_0x3f4355(0x11b)])||0x0,_0xc27e7e=_0x138043[_0x3f4355(0xf3)](_0x414917[_0x3f4355(0x11b)])||0x0;if(_0x2b7fab!==_0xc27e7e)return _0xc27e7e-_0x2b7fab;return _0x1d1fac[_0x3f4355(0x107)]-_0x414917[_0x3f4355(0x107)];})['map'](_0x3e32a5=>_0x3e32a5['name']);_0x333feb[_0x3b9143(0x121)](_0x47e95e,_0x51ebcb);}return _0x333feb;}export function collectSegmentUsageCounts(_0x470e2e){const _0x52c45a=a152_0x39dd,_0x2044f6=new Map(),_0x140f85=_0x20f6d5=>{const _0x105e89=a152_0x39dd;if(!_0x20f6d5)return;_0x2044f6[_0x105e89(0x121)](_0x20f6d5,(_0x2044f6['get'](_0x20f6d5)||0x0)+0x1);},_0x37a266=_0x1815ca=>{const _0x149c48=a152_0x39dd;for(const _0x5a3d2f of _0x1815ca){_0x140f85(_0x5a3d2f['entry_criteria']?.[_0x149c48(0x109)]);if(_0x5a3d2f[_0x149c48(0x100)])for(const _0x9dc63 of _0x5a3d2f[_0x149c48(0x100)]){_0x140f85(_0x9dc63[_0x149c48(0x109)]);}_0x140f85(_0x5a3d2f['milestone']?.[_0x149c48(0x109)]);if(_0x5a3d2f[_0x149c48(0xf4)])for(const _0x2bed3d of _0x5a3d2f[_0x149c48(0xf4)]){if(_0x2bed3d[_0x149c48(0x111)]===_0x149c48(0x120))for(const _0x175bda of _0x2bed3d[_0x149c48(0xfd)]['branches']){_0x140f85(_0x175bda[_0x149c48(0x109)]);}else _0x2bed3d[_0x149c48(0x111)]==='wait'&&_0x140f85(_0x2bed3d[_0x149c48(0xfd)][_0x149c48(0x12c)]?.[_0x149c48(0x109)]);}}};_0x140f85(_0x470e2e[_0x52c45a(0x133)]?.[_0x52c45a(0x109)]);if(_0x470e2e[_0x52c45a(0x136)])for(const _0x43d8b0 of _0x470e2e['journeys']){_0x140f85(_0x43d8b0['goal']?.[_0x52c45a(0x109)]),_0x37a266(_0x43d8b0[_0x52c45a(0x10c)]);}_0x470e2e[_0x52c45a(0x10c)]&&_0x37a266(_0x470e2e[_0x52c45a(0x10c)]);if(_0x470e2e[_0x52c45a(0x115)])for(const _0x18e175 of _0x470e2e[_0x52c45a(0x115)]){_0x37a266(_0x18e175['stages']);}return _0x2044f6;}function a152_0x2312(){const _0x14fb10=['condition','472482oiydXE','6QhCcUK','values','some','join','slice','goal','match','endsWith','journeys','journeyStages','1288056CwNQCK','from','has','object','exclude','length','behavior','version','stringify','isArray','toLowerCase','get','steps','branches','journeyBundleName','.yml','entry_criteria','columns','trim','milestone','wait','with','include','yaml','exit_criteria','schedule','connector_config','conditions','nameMapping','launched','replace','index','draft','segment','latest','null','stages','startsWith','journey','1635604LoDucu','keys','type','attributes','rule','1111197uNejpL','versions','2EfrgaH','entries','sort','description','notification','name','activation_template_id','item','.yaml','7046920zvRuVv','decision_point','set','9KgITRp','activation','903145HUMTQP','reentry','find','map','segments','2784971lKLYsF','connection','merged'];a152_0x2312=function(){return _0x14fb10;};return a152_0x2312();}
|
|
1
|
+
(function(_0x10228c,_0x10118d){const _0x2dae32=a152_0x43c8,_0x1cc7d3=_0x10228c();while(!![]){try{const _0x22f55c=parseInt(_0x2dae32(0xc4))/0x1+-parseInt(_0x2dae32(0xac))/0x2*(-parseInt(_0x2dae32(0xca))/0x3)+-parseInt(_0x2dae32(0xcc))/0x4+-parseInt(_0x2dae32(0xd5))/0x5+-parseInt(_0x2dae32(0xf4))/0x6+-parseInt(_0x2dae32(0xb8))/0x7*(parseInt(_0x2dae32(0xe4))/0x8)+parseInt(_0x2dae32(0xc0))/0x9;if(_0x22f55c===_0x10118d)break;else _0x1cc7d3['push'](_0x1cc7d3['shift']());}catch(_0x34f06d){_0x1cc7d3['push'](_0x1cc7d3['shift']());}}}(a152_0x4995,0x53b02));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x44ad6b){const _0x5accff=a152_0x43c8;return _0x44ad6b[_0x5accff(0xda)]()['replace'](/\s+/g,'_')['replace'](/[^a-z0-9_\p{L}\p{N}]/gu,'')[_0x5accff(0xba)](/_+/g,'_')[_0x5accff(0xba)](/^_|_$/g,'');}function a152_0x43c8(_0x27e9a2,_0x535af7){_0x27e9a2=_0x27e9a2-0xab;const _0x4995b1=a152_0x4995();let _0x43c8e0=_0x4995b1[_0x27e9a2];return _0x43c8e0;}export function generateJourneyLocalName(_0x56778b){const _0x20ebac=a152_0x43c8,_0x6498d0=_0x56778b[_0x20ebac(0xd0)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x6498d0){const _0x39c3ab=_0x6498d0[0x1][_0x20ebac(0xda)](),_0x52ba2e=_0x6498d0[0x2],_0x2a1194=_0x52ba2e[_0x20ebac(0xba)](/-/g,'')['slice'](0x0,0x4)['toLowerCase']();return _0x39c3ab+'_'+_0x2a1194;}const _0xd1da92=_0x56778b['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0xd1da92){const _0xf812f3=_0xd1da92[0x1],_0x112a38=_0xd1da92[0x2][_0x20ebac(0xda)](),_0x5369c7=_0xf812f3[_0x20ebac(0xba)](/-/g,'')[_0x20ebac(0xe9)](0x0,0x4)[_0x20ebac(0xda)]();return _0x112a38+'_'+_0x5369c7;}return undefined;}function stableStringify(_0x2c581e){const _0x447983=a152_0x43c8;if(Array[_0x447983(0xf5)](_0x2c581e))return'['+_0x2c581e[_0x447983(0xdb)](_0x474255=>stableStringify(_0x474255))[_0x447983(0xee)](',')+']';if(_0x2c581e&&typeof _0x2c581e===_0x447983(0xad)){const _0x287f07=_0x2c581e,_0xd06d97=Object[_0x447983(0xf2)](_0x287f07)[_0x447983(0xae)](),_0xe23201=_0xd06d97[_0x447983(0xdb)](_0x1489e6=>'\x22'+_0x1489e6+'\x22:'+stableStringify(_0x287f07[_0x1489e6]));return'{'+_0xe23201[_0x447983(0xee)](',')+'}';}const _0x30b60b=JSON['stringify'](_0x2c581e);return _0x30b60b===undefined?'null':_0x30b60b;}export function consolidateActivationsByContent(_0x57f19d){const _0x1cd2d3=a152_0x43c8,_0x5b79ae={},_0x1ac5ce=new Map(),_0x57b204=new Map();for(const _0xb93e50 of _0x57f19d){if(!_0xb93e50)continue;for(const [_0x3b60bc,_0x3bc083]of Object['entries'](_0xb93e50)){const _0x58ab4a={'name':_0x3bc083[_0x1cd2d3(0xe1)],'connection':_0x3bc083[_0x1cd2d3(0xcd)],..._0x3bc083[_0x1cd2d3(0xce)]!==undefined&&{'all_columns':_0x3bc083[_0x1cd2d3(0xce)]},..._0x3bc083[_0x1cd2d3(0xb6)]!==undefined&&{'columns':_0x3bc083[_0x1cd2d3(0xb6)]},..._0x3bc083[_0x1cd2d3(0xf6)]!==undefined&&{'behavior':_0x3bc083['behavior']},..._0x3bc083[_0x1cd2d3(0xbf)]!==undefined&&{'schedule':_0x3bc083[_0x1cd2d3(0xbf)]},..._0x3bc083[_0x1cd2d3(0xdc)]!==undefined&&{'notification':_0x3bc083[_0x1cd2d3(0xdc)]},..._0x3bc083[_0x1cd2d3(0xd4)]!==undefined&&{'connector_config':_0x3bc083[_0x1cd2d3(0xd4)]},..._0x3bc083[_0x1cd2d3(0xec)]!==undefined&&{'activation_template_id':_0x3bc083['activation_template_id']}},_0x1e4432=stableStringify(_0x58ab4a),_0x2602b5=_0x57b204['get'](_0x1e4432);_0x2602b5?_0x1ac5ce[_0x1cd2d3(0xc3)](_0x3b60bc,_0x2602b5):(_0x5b79ae[_0x3b60bc]=_0x3bc083,_0x1ac5ce[_0x1cd2d3(0xc3)](_0x3b60bc,_0x3b60bc),_0x57b204[_0x1cd2d3(0xc3)](_0x1e4432,_0x3b60bc));}}return{'merged':_0x5b79ae,'nameMapping':_0x1ac5ce};}export function updateActivationReferences(_0x462ef8,_0x5e5b58){const _0x57015b=a152_0x43c8;if(!_0x462ef8)return;for(const _0x1ef0d5 of _0x462ef8){if(!_0x1ef0d5['steps'])continue;for(const _0x3d7f12 of _0x1ef0d5[_0x57015b(0xd8)]){if(_0x3d7f12[_0x57015b(0xf8)]==='activation'&&_0x3d7f12[_0x57015b(0xb4)]?.[_0x57015b(0xf7)]){const _0xc10724=_0x5e5b58['get'](_0x3d7f12[_0x57015b(0xb4)][_0x57015b(0xf7)]);_0xc10724&&_0xc10724!==_0x3d7f12['with'][_0x57015b(0xf7)]&&(_0x3d7f12[_0x57015b(0xb4)][_0x57015b(0xf7)]=_0xc10724);}}}}export function consolidateSegmentsByContent(_0x3367ae,_0xec1a83){const _0xe96ff3=a152_0x43c8,_0x5a51bb={},_0x549b34=new Map(),_0x24f7cf=new Map();for(const _0x3027d2 of _0x3367ae){if(!_0x3027d2)continue;for(const [_0x3b8b6e,_0x4952c2]of Object[_0xe96ff3(0xd7)](_0x3027d2)){if(!_0x4952c2[_0xe96ff3(0xe6)]){_0x5a51bb[_0x3b8b6e]=_0x4952c2,_0x549b34[_0xe96ff3(0xc3)](_0x3b8b6e,_0x3b8b6e);continue;}const _0x421738=_0x4952c2[_0xe96ff3(0xe8)]&&_0x4952c2['description'][_0xe96ff3(0xdd)]()?_0x4952c2['description']:undefined,_0x5ba3b1=JSON[_0xe96ff3(0xb1)]({'description':_0x421738,'rule':deepSortObject(_0x4952c2[_0xe96ff3(0xe6)])}),_0x3ae031=_0x24f7cf['get'](_0x5ba3b1);if(_0x3ae031){const _0x1a162a={..._0x4952c2[_0xe96ff3(0xe8)]!==undefined&&{'description':_0x4952c2[_0xe96ff3(0xe8)]},'rule':_0x4952c2[_0xe96ff3(0xe6)]?deepSortObject(_0x4952c2['rule']):_0x4952c2['rule']};if(_0x3b8b6e<_0x3ae031){_0x5a51bb[_0x3b8b6e]=_0x1a162a,delete _0x5a51bb[_0x3ae031];for(const [_0x250c45,_0x2907ec]of _0x549b34[_0xe96ff3(0xd7)]()){_0x2907ec===_0x3ae031&&_0x549b34[_0xe96ff3(0xc3)](_0x250c45,_0x3b8b6e);}_0x549b34['set'](_0x3b8b6e,_0x3b8b6e),_0x24f7cf[_0xe96ff3(0xc3)](_0x5ba3b1,_0x3b8b6e);}else _0x5a51bb[_0x3ae031]=_0x1a162a,_0x549b34[_0xe96ff3(0xc3)](_0x3b8b6e,_0x3ae031);}else{let _0xe9f80b=_0x3b8b6e;if(_0xec1a83){const _0x2a247e=_0xec1a83['get'](_0x5ba3b1);_0x2a247e&&_0x2a247e[_0xe96ff3(0xbb)]>0x0&&(_0xe9f80b=_0x2a247e[_0xe96ff3(0xe9)]()[_0xe96ff3(0xae)]()[0x0]);}const _0x2c1f63={..._0x4952c2['description']!==undefined&&{'description':_0x4952c2[_0xe96ff3(0xe8)]},'rule':_0x4952c2[_0xe96ff3(0xe6)]?deepSortObject(_0x4952c2[_0xe96ff3(0xe6)]):_0x4952c2[_0xe96ff3(0xe6)]};_0x5a51bb[_0xe9f80b]=_0x2c1f63,_0x549b34['set'](_0x3b8b6e,_0xe9f80b),_0x24f7cf[_0xe96ff3(0xc3)](_0x5ba3b1,_0xe9f80b);}}}return{'merged':_0x5a51bb,'nameMapping':_0x549b34};}export function updateSegmentReferences(_0x3ea962,_0x281800){const _0x340c32=a152_0x43c8;if(!_0x3ea962)return;for(const _0x116aad of _0x3ea962){if(_0x116aad[_0x340c32(0xc5)]?.[_0x340c32(0xdf)]){const _0x5599e6=_0x281800['get'](_0x116aad['entry_criteria'][_0x340c32(0xdf)]);_0x5599e6&&(_0x116aad[_0x340c32(0xc5)][_0x340c32(0xdf)]=_0x5599e6);}if(_0x116aad[_0x340c32(0xef)])for(const _0x2e900d of _0x116aad[_0x340c32(0xef)]){if(_0x2e900d[_0x340c32(0xdf)]){const _0xa667d=_0x281800[_0x340c32(0xe5)](_0x2e900d[_0x340c32(0xdf)]);_0xa667d&&(_0x2e900d[_0x340c32(0xdf)]=_0xa667d);}}if(_0x116aad[_0x340c32(0xd6)]?.['segment']){const _0x783dcc=_0x281800[_0x340c32(0xe5)](_0x116aad['milestone'][_0x340c32(0xdf)]);_0x783dcc&&(_0x116aad[_0x340c32(0xd6)][_0x340c32(0xdf)]=_0x783dcc);}if(_0x116aad[_0x340c32(0xd8)])for(const _0x20dfa3 of _0x116aad[_0x340c32(0xd8)]){if(_0x20dfa3[_0x340c32(0xf8)]==='decision_point'&&_0x20dfa3[_0x340c32(0xb4)]?.['branches'])for(const _0x3f950d of _0x20dfa3[_0x340c32(0xb4)][_0x340c32(0xd9)]){if(_0x3f950d[_0x340c32(0xdf)]){const _0x3d8914=_0x281800[_0x340c32(0xe5)](_0x3f950d[_0x340c32(0xdf)]);_0x3d8914&&(_0x3f950d['segment']=_0x3d8914);}}if(_0x20dfa3[_0x340c32(0xf8)]===_0x340c32(0xf3)&&_0x20dfa3['with']?.[_0x340c32(0xbe)]?.[_0x340c32(0xdf)]){const _0x20f293=_0x281800[_0x340c32(0xe5)](_0x20dfa3['with'][_0x340c32(0xbe)]['segment']);_0x20f293&&(_0x20dfa3['with'][_0x340c32(0xbe)][_0x340c32(0xdf)]=_0x20f293);}}}}export function updateSegmentRefsInSegments(_0x339bee,_0x1c2a9f){const _0x3681f8=a152_0x43c8;for(const _0xdd2c46 of Object['values'](_0x339bee)){_0xdd2c46[_0x3681f8(0xe6)]&&updateSegmentRefsInRule(_0xdd2c46['rule'],_0x1c2a9f);}}function updateSegmentRefsInRule(_0x13d1bc,_0x1d88e5){const _0xaf3b90=a152_0x43c8;if(_0x13d1bc===null||typeof _0x13d1bc!=='object')return;if(Array[_0xaf3b90(0xf5)](_0x13d1bc)){for(const _0x243cb3 of _0x13d1bc){updateSegmentRefsInRule(_0x243cb3,_0x1d88e5);}return;}const _0x4aa50b=_0x13d1bc;if((_0x4aa50b[_0xaf3b90(0xf8)]===_0xaf3b90(0xbd)||_0x4aa50b[_0xaf3b90(0xf8)]==='exclude')&&typeof _0x4aa50b['segment']===_0xaf3b90(0xe3)){const _0x1abf2f=_0x1d88e5[_0xaf3b90(0xe5)](_0x4aa50b[_0xaf3b90(0xdf)]);_0x1abf2f&&(_0x4aa50b[_0xaf3b90(0xdf)]=_0x1abf2f);}if(_0x4aa50b['conditions']&&Array[_0xaf3b90(0xf5)](_0x4aa50b[_0xaf3b90(0xc9)]))for(const _0x5ba46e of _0x4aa50b['conditions']){updateSegmentRefsInRule(_0x5ba46e,_0x1d88e5);}}export function buildJourneysArray(_0x5ae0ea,_0x28285d){const _0x58471f=a152_0x43c8;return _0x5ae0ea[_0x58471f(0xdb)](_0x205199=>{const _0x477e46=_0x58471f,_0x319c59=_0x28285d?_0x205199['item']['id']===_0x28285d:_0x5ae0ea[_0x477e46(0xbb)]===0x1,_0x307231=_0x205199[_0x477e46(0xb3)]['journeys']?.[0x0],_0x20fc93=_0x307231?.[_0x477e46(0xd3)]||_0x205199['yaml'][_0x477e46(0xd3)],_0x52af03={'version':_0x307231?.[_0x477e46(0xc2)]||_0x205199[_0x477e46(0xb3)][_0x477e46(0xc2)]||_0x205199[_0x477e46(0xb7)]['name'],'state':_0x205199[_0x477e46(0xb7)][_0x477e46(0xab)]===_0x477e46(0xf1)?_0x477e46(0xf1):_0x477e46(0xed),'stages':_0x307231?.[_0x477e46(0xd1)]||_0x205199['yaml'][_0x477e46(0xd1)]||[],'id':_0x307231?.['id']||_0x205199[_0x477e46(0xb3)]['id'],'version_number':_0x307231?.['version_number']||_0x205199[_0x477e46(0xb3)][_0x477e46(0xf0)]};return _0x20fc93&&(_0x52af03[_0x477e46(0xd3)]=_0x20fc93),_0x319c59&&(_0x52af03[_0x477e46(0xcb)]=!![]),_0x52af03;});}export function buildMergedJourneyDef(_0x528d29,_0x5d7785,_0x41ee0a){const _0x4bbdaa=a152_0x43c8,_0x4cdace=_0x528d29[0x0][_0x4bbdaa(0xb3)],_0x3a0067=buildJourneysArray(_0x528d29,_0x41ee0a),{merged:_0x5c02ec,nameMapping:_0x433eec}=consolidateSegmentsByContent(_0x528d29[_0x4bbdaa(0xdb)](_0x349bcb=>_0x349bcb[_0x4bbdaa(0xb3)]['segments']),_0x5d7785);updateSegmentRefsInSegments(_0x5c02ec,_0x433eec);const _0x14a66b=Array['from'](_0x433eec[_0x4bbdaa(0xd7)]())[_0x4bbdaa(0xaf)](([_0x32c2d4,_0x598fe6])=>_0x32c2d4!==_0x598fe6&&_0x32c2d4[_0x4bbdaa(0xd2)]('entry_criteria'));let _0x3e5915=_0x5c02ec,_0x123a5f=new Map();if(_0x14a66b){const _0x502d0c=consolidateSegmentsByContent([_0x5c02ec],_0x5d7785);_0x3e5915=_0x502d0c[_0x4bbdaa(0xde)],_0x123a5f=_0x502d0c[_0x4bbdaa(0xe0)];}const _0x1022db=new Map(_0x433eec);for(const [_0x47bca5,_0xb0111b]of _0x123a5f[_0x4bbdaa(0xd7)]()){_0x1022db[_0x4bbdaa(0xc3)](_0x47bca5,_0xb0111b);}for(const [_0x13e180,_0x599172]of _0x1022db[_0x4bbdaa(0xd7)]()){let _0x39df61=_0x599172,_0x308198=0x0;while(_0x1022db[_0x4bbdaa(0xb9)](_0x39df61)&&_0x1022db['get'](_0x39df61)!==_0x39df61&&_0x308198<MAX_MAPPING_CHAIN_DEPTH){_0x39df61=_0x1022db[_0x4bbdaa(0xe5)](_0x39df61),_0x308198++;}_0x39df61!==_0x599172&&_0x1022db[_0x4bbdaa(0xc3)](_0x13e180,_0x39df61);}for(const _0x505a61 of _0x3a0067){updateSegmentReferences(_0x505a61[_0x4bbdaa(0xd1)],_0x1022db);}const {merged:_0x498e85,nameMapping:_0x3aee5f}=consolidateActivationsByContent(_0x528d29['map'](_0x48b008=>_0x48b008[_0x4bbdaa(0xb3)][_0x4bbdaa(0xc6)]));for(const _0x17a933 of _0x3a0067){updateActivationReferences(_0x17a933[_0x4bbdaa(0xd1)],_0x3aee5f);}let _0x34c9e2=_0x4cdace['goal'];if(_0x34c9e2?.[_0x4bbdaa(0xdf)]){const _0x5ad1a0=_0x1022db[_0x4bbdaa(0xe5)](_0x34c9e2[_0x4bbdaa(0xdf)]);_0x5ad1a0&&(_0x34c9e2={..._0x34c9e2,'segment':_0x5ad1a0});}for(const _0x1f7348 of _0x3a0067){if(_0x1f7348[_0x4bbdaa(0xd3)]?.['segment']){const _0x38fef6=_0x1022db[_0x4bbdaa(0xe5)](_0x1f7348[_0x4bbdaa(0xd3)][_0x4bbdaa(0xdf)]);_0x38fef6&&(_0x1f7348[_0x4bbdaa(0xd3)]={..._0x1f7348['goal'],'segment':_0x38fef6});}}return _0x3a0067['some'](_0x3ca48b=>_0x3ca48b[_0x4bbdaa(0xd3)])&&(_0x34c9e2=undefined),{'type':'journey','name':_0x4cdace[_0x4bbdaa(0xe1)],'description':_0x4cdace[_0x4bbdaa(0xe8)],'goal':_0x34c9e2,'reentry':_0x4cdace[_0x4bbdaa(0xc8)],'segments':Object[_0x4bbdaa(0xf2)](_0x3e5915)['length']>0x0?_0x3e5915:undefined,'activations':Object[_0x4bbdaa(0xf2)](_0x498e85)[_0x4bbdaa(0xbb)]>0x0?_0x498e85:undefined,'journeys':_0x3a0067,'bundle_id':_0x4cdace[_0x4bbdaa(0xb2)],'bundle_name':_0x4cdace[_0x4bbdaa(0xe2)]};}function a152_0x4995(){const _0x4caf39=['nameMapping','name','bundle_name','string','61144xGgXNG','get','rule','segments','description','slice','journeyStages','journeys','activation_template_id','draft','join','exit_criteria','version_number','launched','keys','wait','1801596cCdZDf','isArray','behavior','activation','type','state','25258fifTpA','object','sort','some','endsWith','stringify','bundle_id','yaml','with','versions','columns','item','581abYkpR','has','replace','length','decision_point','include','condition','schedule','6545223yodNmt','attributes','version','set','322301eAgBjn','entry_criteria','activations','journeyBundleName','reentry','conditions','132huVFkn','latest','210436CeqhEo','connection','all_columns','index','match','stages','startsWith','goal','connector_config','1375970wJbynI','milestone','entries','steps','branches','toLowerCase','map','notification','trim','merged','segment'];a152_0x4995=function(){return _0x4caf39;};return a152_0x4995();}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x225d02,_0x56b28a,_0x545500,_0x1d9adc){const _0x32aa11=a152_0x43c8,_0x46fb2e=_0x225d02+':'+_0x56b28a,_0x43e05f=_0x545500[_0x32aa11(0xe5)](_0x46fb2e);if(_0x43e05f)return _0x43e05f;const _0x266c0f=await _0x1d9adc(_0x225d02),_0x5e47d2=_0x266c0f[_0x32aa11(0xc1)][_0x32aa11(0xc7)]||_0x266c0f[_0x32aa11(0xc1)][_0x32aa11(0xe1)],_0x1c47b4=_0x266c0f[_0x32aa11(0xc1)][_0x32aa11(0xea)]['find'](_0x22aeca=>String(_0x22aeca['id'])===String(_0x56b28a)),_0x4db278=_0x1c47b4?.[_0x32aa11(0xe1)]||_0x56b28a,_0x158289={'journeyName':_0x5e47d2,'stageName':_0x4db278};return _0x545500['set'](_0x46fb2e,_0x158289),_0x158289;}export function formatApiJourneyName(_0x17f524,_0x391c01){return _0x391c01+'\x20('+_0x17f524+')';}export function isLocalJourneyRef(_0x28937a){const _0x39633a=a152_0x43c8;return _0x28937a[_0x39633a(0xb0)]('.yml')||_0x28937a[_0x39633a(0xb0)]('.yaml');}export function buildLocalRuleToNameMapping(_0x2d5a8f){const _0x5a9fc3=a152_0x43c8,_0x57a2b9=new Map();if(!_0x2d5a8f)return _0x57a2b9;for(const [_0x1cafb1,_0x59a327]of Object[_0x5a9fc3(0xd7)](_0x2d5a8f)){if(_0x59a327[_0x5a9fc3(0xe6)]){const _0x305b21=serializeRule(_0x59a327[_0x5a9fc3(0xe6)]),_0x13becc=_0x57a2b9['get'](_0x305b21)||[];_0x13becc['push'](_0x1cafb1),_0x57a2b9['set'](_0x305b21,_0x13becc);}}return _0x57a2b9;}export function buildLocalRuleToNameMappingFromJourney(_0x283ae1){const _0x3d7284=a152_0x43c8,_0x1b8f09=_0x283ae1[_0x3d7284(0xe7)];if(!_0x1b8f09)return new Map();const _0x35036d=collectSegmentUsageCounts(_0x283ae1),_0x2fdd34=new Map();let _0x2e21a4=0x0;for(const [_0x230dff,_0xff1789]of Object[_0x3d7284(0xd7)](_0x1b8f09)){if(!_0xff1789[_0x3d7284(0xe6)]){_0x2e21a4++;continue;}const _0x4bcc37=serializeRule(_0xff1789[_0x3d7284(0xe6)]),_0x4b3227=_0x2fdd34['get'](_0x4bcc37)||[];_0x4b3227['push']({'name':_0x230dff,'index':_0x2e21a4}),_0x2fdd34[_0x3d7284(0xc3)](_0x4bcc37,_0x4b3227),_0x2e21a4++;}const _0x5f4a05=new Map();for(const [_0x2ab4c8,_0xf93bc7]of _0x2fdd34){const _0x395d9b=_0xf93bc7[_0x3d7284(0xe9)]()[_0x3d7284(0xae)]((_0x11c0ca,_0x27a40e)=>{const _0x49f1dd=_0x3d7284,_0x24e09a=_0x35036d[_0x49f1dd(0xe5)](_0x11c0ca[_0x49f1dd(0xe1)])||0x0,_0x5552a9=_0x35036d[_0x49f1dd(0xe5)](_0x27a40e[_0x49f1dd(0xe1)])||0x0;if(_0x24e09a!==_0x5552a9)return _0x5552a9-_0x24e09a;return _0x11c0ca['index']-_0x27a40e[_0x49f1dd(0xcf)];})[_0x3d7284(0xdb)](_0x3de3cb=>_0x3de3cb[_0x3d7284(0xe1)]);_0x5f4a05['set'](_0x2ab4c8,_0x395d9b);}return _0x5f4a05;}export function collectSegmentUsageCounts(_0x196097){const _0xeefc64=a152_0x43c8,_0x545656=new Map(),_0x188557=_0x1436d5=>{const _0x64ccec=a152_0x43c8;if(!_0x1436d5)return;_0x545656['set'](_0x1436d5,(_0x545656[_0x64ccec(0xe5)](_0x1436d5)||0x0)+0x1);},_0x29d09b=_0x11953e=>{const _0x26b761=a152_0x43c8;for(const _0xed6aae of _0x11953e){_0x188557(_0xed6aae[_0x26b761(0xc5)]?.[_0x26b761(0xdf)]);if(_0xed6aae['exit_criteria'])for(const _0x1f4e47 of _0xed6aae[_0x26b761(0xef)]){_0x188557(_0x1f4e47[_0x26b761(0xdf)]);}_0x188557(_0xed6aae[_0x26b761(0xd6)]?.['segment']);if(_0xed6aae[_0x26b761(0xd8)])for(const _0x3addd5 of _0xed6aae[_0x26b761(0xd8)]){if(_0x3addd5[_0x26b761(0xf8)]===_0x26b761(0xbc))for(const _0x1b8088 of _0x3addd5[_0x26b761(0xb4)][_0x26b761(0xd9)]){_0x188557(_0x1b8088[_0x26b761(0xdf)]);}else _0x3addd5['type']===_0x26b761(0xf3)&&_0x188557(_0x3addd5[_0x26b761(0xb4)][_0x26b761(0xbe)]?.[_0x26b761(0xdf)]);}}};_0x188557(_0x196097[_0xeefc64(0xd3)]?.[_0xeefc64(0xdf)]);if(_0x196097[_0xeefc64(0xeb)])for(const _0x15d722 of _0x196097[_0xeefc64(0xeb)]){_0x188557(_0x15d722[_0xeefc64(0xd3)]?.['segment']),_0x29d09b(_0x15d722[_0xeefc64(0xd1)]);}_0x196097['stages']&&_0x29d09b(_0x196097['stages']);if(_0x196097[_0xeefc64(0xb5)])for(const _0x1f0859 of _0x196097['versions']){_0x29d09b(_0x1f0859[_0xeefc64(0xd1)]);}return _0x545656;}
|