@treasuredata/tdx 0.16.13 → 0.16.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-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/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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/utils.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/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/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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/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/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/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/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x22364c,_0xe4d868){const _0xb19314=a106_0x1ca7,_0x29ce4e=_0x22364c();while(!![]){try{const _0x3d5a2d=parseInt(_0xb19314(0xb5))/0x1*(-parseInt(_0xb19314(0xd1))/0x2)+-parseInt(_0xb19314(0xbe))/0x3+parseInt(_0xb19314(0xcb))/0x4+parseInt(_0xb19314(0xd3))/0x5+-parseInt(_0xb19314(0xc8))/0x6*(-parseInt(_0xb19314(0xcc))/0x7)+-parseInt(_0xb19314(0xd0))/0x8+-parseInt(_0xb19314(0xb8))/0x9*(-parseInt(_0xb19314(0xc9))/0xa);if(_0x3d5a2d===_0xe4d868)break;else _0x29ce4e['push'](_0x29ce4e['shift']());}catch(_0x2cb18a){_0x29ce4e['push'](_0x29ce4e['shift']());}}}(a106_0x29af,0xbba05));import{readFileSync}from'fs';import{createInterface}from'readline';export function stripSqlComments(_0x45952b){const _0x1f64a0=a106_0x1ca7;let _0x96f391=_0x45952b['replace'](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x96f391=_0x96f391[_0x1f64a0(0xc0)](/--.*$/gm,''),_0x96f391[_0x1f64a0(0xbc)]();}function isEscaped(_0xf4c887,_0x40e7d5){let _0x9862a6=0x0;for(let _0x5e783b=_0x40e7d5-0x1;_0x5e783b>=0x0&&_0xf4c887[_0x5e783b]==='\x5c';_0x5e783b--){_0x9862a6++;}return _0x9862a6%0x2===0x1;}export function splitSqlStatements(_0x55caf3){const _0x5e83a0=a106_0x1ca7,_0xb3a055=stripSqlComments(_0x55caf3);if(!_0xb3a055)throw new Error(_0x5e83a0(0xce));const _0x3cd61a=[];let _0x561d99='',_0x1c0148=![],_0x185cee=![],_0x4c871f=![];for(let _0x2347c0=0x0;_0x2347c0<_0x55caf3[_0x5e83a0(0xba)];_0x2347c0++){const _0x2e2772=_0x55caf3[_0x2347c0];if(_0x2e2772==='\x27'&&!isEscaped(_0x55caf3,_0x2347c0)&&!_0x185cee&&!_0x4c871f)_0x1c0148=!_0x1c0148;else{if(_0x2e2772==='\x22'&&!isEscaped(_0x55caf3,_0x2347c0)&&!_0x1c0148&&!_0x4c871f)_0x185cee=!_0x185cee;else _0x2e2772==='`'&&!isEscaped(_0x55caf3,_0x2347c0)&&!_0x1c0148&&!_0x185cee&&(_0x4c871f=!_0x4c871f);}if(_0x2e2772===';'&&!_0x1c0148&&!_0x185cee&&!_0x4c871f){const _0x6fa00=_0x561d99[_0x5e83a0(0xbc)]();_0x6fa00&&_0x3cd61a[_0x5e83a0(0xca)](_0x6fa00),_0x561d99='';}else _0x561d99+=_0x2e2772;}const _0x25405e=_0x561d99[_0x5e83a0(0xbc)]();_0x25405e&&_0x3cd61a[_0x5e83a0(0xca)](_0x25405e);const _0x1434ee=_0x3cd61a[_0x5e83a0(0xb6)](_0x31a3bb=>_0x31a3bb[_0x5e83a0(0xbc)]())['filter'](_0x30b7fe=>{const _0x3e6194=_0x5e83a0,_0x2596ae=stripSqlComments(_0x30b7fe);return _0x2596ae[_0x3e6194(0xba)]>0x0;});if(_0x1434ee[_0x5e83a0(0xba)]===0x0)throw new Error(_0x5e83a0(0xce));return _0x1434ee;}export function readFileContent(_0x31df82){const _0x5819e9=a106_0x1ca7;try{return readFileSync(_0x31df82,'utf-8');}catch(_0x4c0394){const _0x3e555d=_0x4c0394[_0x5819e9(0xb4)];if(_0x3e555d===_0x5819e9(0xb7))throw new Error('File\x20\x27'+_0x31df82+'\x27\x20not\x20found');else{if(_0x3e555d==='EACCES')throw new Error(_0x5819e9(0xb9)+_0x31df82+'\x27');else throw new Error(_0x5819e9(0xbb)+_0x31df82+'\x27:\x20'+_0x4c0394[_0x5819e9(0xcd)]);}}}export function readSqlStatementsFromFile(_0xeb5e46){const _0x2ff748=a106_0x1ca7,_0x34814e=readFileContent(_0xeb5e46);try{return splitSqlStatements(_0x34814e);}catch(_0x2ab2a2){throw new Error(_0x2ff748(0xbf)+_0xeb5e46+'\x27\x20'+_0x2ab2a2[_0x2ff748(0xcd)][_0x2ff748(0xd2)]());}}export async function readStdinContent(){const _0x405c1a=a106_0x1ca7;if(process[_0x405c1a(0xbd)][_0x405c1a(0xc5)])throw new Error(_0x405c1a(0xc6));return new Promise((_0x3c2a62,_0x4f9788)=>{const _0x2129f2=_0x405c1a,_0x4ef17a=[],_0x21936b=createInterface({'input':process['stdin'],'terminal':![]});_0x21936b['on'](_0x2129f2(0xc7),_0x4f852a=>{const _0x29ba5b=_0x2129f2;_0x4ef17a[_0x29ba5b(0xca)](_0x4f852a);}),_0x21936b['on'](_0x2129f2(0xc1),()=>{const _0x3a4bbb=_0x2129f2;_0x3c2a62(_0x4ef17a[_0x3a4bbb(0xcf)]('\x0a'));}),_0x21936b['on'](_0x2129f2(0xc4),_0x45a437=>{const _0x51b3d7=_0x2129f2;_0x21936b['close'](),_0x4f9788(new Error(_0x51b3d7(0xc2)+_0x45a437[_0x51b3d7(0xcd)]));});});}function a106_0x1ca7(_0x1e13a3,_0x5ef9bc){_0x1e13a3=_0x1e13a3-0xb4;const _0x29af2d=a106_0x29af();let _0x1ca77f=_0x29af2d[_0x1e13a3];return _0x1ca77f;}export async function readSqlStatementsFromStdin(){const _0x4475b5=a106_0x1ca7,_0x14bad2=await readStdinContent();try{return splitSqlStatements(_0x14bad2);}catch(_0x3cc21e){throw new Error(_0x4475b5(0xc3)+_0x3cc21e[_0x4475b5(0xcd)]['toLowerCase']());}}export function isSqlFilePath(_0x19d1e5){return/\w\.sql$/['test'](_0x19d1e5);}function a106_0x29af(){const _0x5a2e37=['549AyOGpP','Permission\x20denied\x20reading\x20file\x20\x27','length','Error\x20reading\x20file\x20\x27','trim','stdin','3225306Foveps','File\x20\x27','replace','close','Error\x20reading\x20from\x20stdin:\x20','stdin\x20','error','isTTY','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','line','2130ZVClzU','271260CxQEJL','push','5941696HjdKoO','5677wVYoUh','message','Content\x20contains\x20no\x20SQL\x20statements','join','8922816NsHylF','1565010EXfeWC','toLowerCase','1567305cOkjlV','code','1QNQwtk','map','ENOENT'];a106_0x29af=function(){return _0x5a2e37;};return a106_0x29af();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a107_0x13863d=a107_0x3b2d;(function(_0x34a26c,_0x195903){const _0x27012f=a107_0x3b2d,_0x551621=_0x34a26c();while(!![]){try{const _0x1de359=-parseInt(_0x27012f(0x123))/0x1*(parseInt(_0x27012f(0x113))/0x2)+-parseInt(_0x27012f(0x12c))/0x3+-parseInt(_0x27012f(0xef))/0x4*(parseInt(_0x27012f(0xe2))/0x5)+parseInt(_0x27012f(0xda))/0x6+-parseInt(_0x27012f(0x121))/0x7+parseInt(_0x27012f(0xec))/0x8+parseInt(_0x27012f(0xf3))/0x9;if(_0x1de359===_0x195903)break;else _0x551621['push'](_0x551621['shift']());}catch(_0x27cd23){_0x551621['push'](_0x551621['shift']());}}}(a107_0x25ae,0x26468));import*as a107_0x3dd409 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x1cc176,_0x295715){const _0x1f0f62=a107_0x3b2d,_0x32623d=_0x1cc176[_0x1f0f62(0x12d)]&&_0x1f0f62(0x14f)in _0x1cc176[_0x1f0f62(0x12d)]&&_0x1cc176['rule'][_0x1f0f62(0x14f)];return{'type':'segment','name':_0x1cc176[_0x1f0f62(0xc3)],..._0x1cc176[_0x1f0f62(0xc1)]&&{'description':_0x1cc176['description']},..._0x295715&&{'folder':_0x295715},..._0x32623d&&{'rule':apiRuleToYaml(_0x1cc176[_0x1f0f62(0x12d)])},..._0x1cc176[_0x1f0f62(0xea)]!==undefined&&{'kind':_0x1cc176[_0x1f0f62(0xea)]===0x0?_0x1f0f62(0x147):_0x1cc176['kind']===0x1?_0x1f0f62(0xcc):_0x1f0f62(0x11f)},..._0x1cc176[_0x1f0f62(0x119)]!==undefined&&{'visible':_0x1cc176[_0x1f0f62(0x119)]}};}export async function segmentResponseToDef(_0x341f94,_0x4cfc98,_0x1ab184){const _0x2db72a=a107_0x3b2d,_0x25221e=segmentResponseToDefSync(_0x341f94,_0x1ab184);if(!_0x4cfc98||!_0x4cfc98[_0x2db72a(0x11e)])return _0x25221e;return _0x25221e[_0x2db72a(0x12d)]&&(_0x25221e[_0x2db72a(0x12d)]=await resolveRuleSegmentRefs(_0x25221e[_0x2db72a(0x12d)],_0x4cfc98['resolveSegmentName'])),_0x25221e;}export function apiRuleToYaml(_0x447251){const _0x448739=a107_0x3b2d,_0x494c7a=(_0x447251[_0x448739(0xe9)]||[])[_0x448739(0x13c)](apiConditionToYaml);if(_0x494c7a['length']===0x1&&!_0x447251[_0x448739(0xc1)]&&_0x448739(0x14f)in _0x494c7a[0x0]&&(_0x494c7a[0x0][_0x448739(0x14f)]==='And'||_0x494c7a[0x0]['type']==='Or')){const _0x1edb87=_0x494c7a[0x0];if(_0x1edb87[_0x448739(0x14f)]===_0x447251[_0x448739(0x14f)]&&_0x1edb87[_0x448739(0xe9)])return{'type':_0x447251['type'],'conditions':_0x1edb87[_0x448739(0xe9)],..._0x1edb87[_0x448739(0xc1)]&&{'description':_0x1edb87[_0x448739(0xc1)]}};}return{'type':_0x447251[_0x448739(0x14f)],'conditions':_0x494c7a,..._0x447251[_0x448739(0xc1)]&&{'description':_0x447251[_0x448739(0xc1)]}};}export async function resolveRuleSegmentRefs(_0x39c7de,_0x2b978b){const _0x1c429b=a107_0x3b2d,_0xc037ce=await Promise[_0x1c429b(0x135)](_0x39c7de['conditions'][_0x1c429b(0x13c)](_0x213414=>resolveConditionSegmentRefs(_0x213414,_0x2b978b)));return{..._0x39c7de,'conditions':_0xc037ce};}async function resolveConditionSegmentRefs(_0x23c757,_0x1d08bc){const _0x454241=a107_0x3b2d;if('segment'in _0x23c757&&(_0x23c757[_0x454241(0x14f)]===_0x454241(0x10a)||_0x23c757['type']===_0x454241(0x14c))){const _0x22c0fd=_0x23c757;if(/^\d+$/[_0x454241(0x10e)](_0x22c0fd[_0x454241(0xc6)])){const _0x22e7a9=await _0x1d08bc(_0x22c0fd[_0x454241(0xc6)]);return{..._0x22c0fd,'segment':_0x22e7a9};}return _0x23c757;}if('conditions'in _0x23c757&&_0x23c757['conditions']){const _0x4a77ff=_0x23c757,_0x564849=await Promise['all'](_0x4a77ff['conditions'][_0x454241(0x13c)](_0x2a996b=>resolveConditionSegmentRefs(_0x2a996b,_0x1d08bc)));return{..._0x4a77ff,'conditions':_0x564849};}if(_0x454241(0x143)in _0x23c757&&_0x23c757[_0x454241(0x143)]){const _0x188c63=_0x23c757,_0x11934a=await resolveRuleSegmentRefs(_0x188c63[_0x454241(0x143)],_0x1d08bc);return{..._0x188c63,'filter':_0x11934a};}return _0x23c757;}export async function resolveRuleSegmentIds(_0x2ec064,_0x4e0293){const _0x2507e9=a107_0x3b2d,_0x26e927=await Promise[_0x2507e9(0x135)](_0x2ec064[_0x2507e9(0xe9)][_0x2507e9(0x13c)](_0x6f570c=>resolveConditionSegmentIds(_0x6f570c,_0x4e0293)));return{..._0x2ec064,'conditions':_0x26e927};}async function resolveConditionSegmentIds(_0x5ecd8c,_0xa4ec49){const _0xdd876c=a107_0x3b2d;if(_0xdd876c(0xc6)in _0x5ecd8c&&(_0x5ecd8c[_0xdd876c(0x14f)]===_0xdd876c(0x10a)||_0x5ecd8c['type']===_0xdd876c(0x14c))){const _0x1326c7=_0x5ecd8c;if(!/^\d+$/[_0xdd876c(0x10e)](_0x1326c7[_0xdd876c(0xc6)])){const _0x2f7837=await _0xa4ec49(_0x1326c7[_0xdd876c(0xc6)]);return{..._0x1326c7,'segment':_0x2f7837};}return _0x5ecd8c;}if(_0xdd876c(0xe9)in _0x5ecd8c&&_0x5ecd8c[_0xdd876c(0xe9)]){const _0x2b5031=_0x5ecd8c,_0x4432d8=await Promise[_0xdd876c(0x135)](_0x2b5031['conditions'][_0xdd876c(0x13c)](_0x5d6b7a=>resolveConditionSegmentIds(_0x5d6b7a,_0xa4ec49)));return{..._0x2b5031,'conditions':_0x4432d8};}if(_0xdd876c(0x143)in _0x5ecd8c&&_0x5ecd8c[_0xdd876c(0x143)]){const _0x1c9f08=_0x5ecd8c,_0x3c0842=await resolveRuleSegmentIds(_0x1c9f08[_0xdd876c(0x143)],_0xa4ec49);return{..._0x1c9f08,'filter':_0x3c0842};}return _0x5ecd8c;}function apiConditionToYaml(_0x191d41){const _0x32c716=a107_0x3b2d;if(_0x191d41['type']===_0x32c716(0xd1)||_0x191d41[_0x32c716(0x14f)]==='Or'){if(_0x191d41[_0x32c716(0xe9)]){const _0x475169=_0x191d41[_0x32c716(0xe9)]['map'](apiConditionToYaml);if(_0x475169['length']===0x1&&!_0x191d41['description'])return _0x475169[0x0];return{'type':_0x191d41['type'],'conditions':_0x475169,..._0x191d41['description']&&{'description':_0x191d41[_0x32c716(0xc1)]}};}}if(_0x191d41[_0x32c716(0x14f)]===_0x32c716(0xfd)&&_0x191d41[_0x32c716(0xee)]&&_0x191d41[_0x32c716(0xdd)]){const _0x58939e=_0x191d41[_0x32c716(0xee)][_0x32c716(0x146)]?{'type':_0x191d41[_0x32c716(0xee)][_0x32c716(0x146)][_0x32c716(0x14f)],..._0x191d41['leftValue'][_0x32c716(0x146)][_0x32c716(0x13f)]&&{'groupingColumns':_0x191d41['leftValue'][_0x32c716(0x146)]['groupingColumns']}}:undefined;return{'type':'Value','attribute':_0x191d41[_0x32c716(0xee)][_0x32c716(0xc3)]||'','operator':apiOperatorToYaml(_0x191d41[_0x32c716(0xdd)]),..._0x191d41[_0x32c716(0x14b)]&&_0x191d41['arrayMatching']!==_0x32c716(0x11a)?{'arrayMatching':_0x191d41[_0x32c716(0x14b)]}:{},..._0x191d41[_0x32c716(0x14c)]?{'exclude':_0x191d41[_0x32c716(0x14c)]}:{},..._0x58939e?{'aggregation':_0x58939e}:{},..._0x191d41[_0x32c716(0xee)][_0x32c716(0x10d)]?{'source':_0x191d41['leftValue'][_0x32c716(0x10d)][_0x32c716(0xc3)]}:{},..._0x191d41['leftValue'][_0x32c716(0x143)]?{'filter':apiRuleToYaml(_0x191d41[_0x32c716(0xee)][_0x32c716(0x143)])}:{},..._0x191d41[_0x32c716(0xe8)]!==undefined&&_0x191d41[_0x32c716(0xe8)]!==null?{'limit':_0x191d41[_0x32c716(0xe8)]}:{}};}if(_0x191d41[_0x32c716(0x14f)]===_0x32c716(0x126)&&_0x191d41['id'])return{'type':_0x191d41[_0x32c716(0x14c)]?_0x32c716(0x14c):_0x32c716(0x10a),'segment':_0x191d41['id']};return{'type':'And','conditions':[]};}function isTemporalOperator(_0x973ba1){return _0x973ba1==='TimeWithinPast'||_0x973ba1==='TimeWithinNext';}function getEffectiveValue(_0xe73e1c){const _0xc82f6d=a107_0x3b2d,_0x5e47f1=_0xe73e1c[_0xc82f6d(0x12b)];return _0xe73e1c['value']??_0x5e47f1;}function apiOperatorToYaml(_0x319876){const _0x17d4ef=a107_0x3b2d;let _0x427c93;if(_0x319876[_0x17d4ef(0xbf)]&&_0x319876[_0x17d4ef(0xbf)]['length']>0x0)_0x427c93=_0x319876[_0x17d4ef(0xbf)];else{if(_0x319876[_0x17d4ef(0xf1)]!==undefined)_0x427c93=_0x319876[_0x17d4ef(0xf1)];else isTemporalOperator(_0x319876[_0x17d4ef(0x14f)])&&_0x319876[_0x17d4ef(0xd4)]!==undefined&&(_0x427c93=_0x319876[_0x17d4ef(0xd4)]);}return{'type':mapApiOperatorType(_0x319876[_0x17d4ef(0x14f)]),..._0x319876[_0x17d4ef(0x11d)]&&{'not':_0x319876[_0x17d4ef(0x11d)]},..._0x427c93!==undefined&&{'value':_0x427c93},..._0x319876[_0x17d4ef(0x13b)]&&{'unit':_0x319876[_0x17d4ef(0x13b)]}};}function mapApiOperatorType(_0x3e8229){return _0x3e8229;}export function segmentDefToCreateRequest(_0x466072,_0x130bc2){const _0x22bf54=a107_0x3b2d,_0x218943={'name':_0x466072['name']};return _0x466072[_0x22bf54(0xc1)]&&(_0x218943['description']=_0x466072[_0x22bf54(0xc1)]),_0x466072[_0x22bf54(0x12d)]&&(_0x218943[_0x22bf54(0x12d)]=yamlRuleToApi(_0x466072[_0x22bf54(0x12d)])),_0x466072[_0x22bf54(0xea)]&&(_0x218943[_0x22bf54(0xea)]=_0x466072[_0x22bf54(0xea)]===_0x22bf54(0x147)?0x0:_0x466072['kind']==='realtime'?0x1:0x2),_0x466072[_0x22bf54(0x128)]!==undefined&&(_0x218943[_0x22bf54(0x119)]=_0x466072[_0x22bf54(0x128)]),_0x130bc2&&(_0x218943[_0x22bf54(0x108)]=_0x130bc2),_0x218943;}export function segmentDefToUpdateRequest(_0x93c431){const _0x41b3c0=a107_0x3b2d,_0x4b57e4={'name':_0x93c431[_0x41b3c0(0xc3)]};return _0x93c431['description']!==undefined&&(_0x4b57e4['description']=_0x93c431[_0x41b3c0(0xc1)]),_0x93c431[_0x41b3c0(0x12d)]&&(_0x4b57e4[_0x41b3c0(0x12d)]=yamlRuleToApi(_0x93c431[_0x41b3c0(0x12d)])),_0x93c431[_0x41b3c0(0xea)]&&(_0x4b57e4[_0x41b3c0(0xea)]=_0x93c431[_0x41b3c0(0xea)]===_0x41b3c0(0x147)?0x0:_0x93c431[_0x41b3c0(0xea)]===_0x41b3c0(0xcc)?0x1:0x2),_0x4b57e4;}export function yamlRuleToApi(_0x5d54f1,_0x18a7dc=![]){const _0x4edee3=a107_0x3b2d,_0x11bb24=_0x5d54f1['conditions']['map'](yamlConditionToApi);if(_0x18a7dc){const _0x136440=_0x11bb24[_0x4edee3(0xd6)](_0x1a0cab=>_0x1a0cab[_0x4edee3(0x14f)]===_0x4edee3(0xd1)||_0x1a0cab[_0x4edee3(0x14f)]==='Or');if(!_0x136440&&_0x11bb24[_0x4edee3(0xc7)]>0x0)return{'type':_0x5d54f1[_0x4edee3(0x14f)],'conditions':[{'type':_0x4edee3(0xd1),'description':_0x5d54f1['description']||'','conditions':_0x11bb24}]};}return{'type':_0x5d54f1['type'],'conditions':_0x11bb24,..._0x5d54f1['description']&&{'description':_0x5d54f1[_0x4edee3(0xc1)]}};}function yamlConditionToApi(_0x418a02){const _0x380c93=a107_0x3b2d;if(_0x380c93(0xc6)in _0x418a02&&(_0x418a02[_0x380c93(0x14f)]===_0x380c93(0x10a)||_0x418a02['type']===_0x380c93(0x14c))){const _0x419bf1=_0x418a02;return{'type':_0x380c93(0x126),'id':_0x419bf1[_0x380c93(0xc6)],'exclude':_0x419bf1[_0x380c93(0x14f)]==='exclude'};}if(_0x380c93(0x14f)in _0x418a02&&(_0x418a02[_0x380c93(0x14f)]===_0x380c93(0xd1)||_0x418a02['type']==='Or')){const _0x5a3ea7=_0x418a02;return{'type':_0x5a3ea7['type'],'conditions':_0x5a3ea7[_0x380c93(0xe9)][_0x380c93(0x13c)](yamlConditionToApi),..._0x5a3ea7[_0x380c93(0xc1)]&&{'description':_0x5a3ea7[_0x380c93(0xc1)]}};}const _0x546a87=_0x418a02,_0x98e6aa={'type':_0x380c93(0xfd),'leftValue':buildLeftValue(_0x546a87),'operator':yamlOperatorToApi(_0x546a87[_0x380c93(0xdd)]),'exclude':_0x546a87['exclude']??![],'arrayMatching':_0x546a87['arrayMatching']??'any'};return _0x546a87[_0x380c93(0xe8)]!==undefined&&(_0x98e6aa[_0x380c93(0xe8)]=_0x546a87[_0x380c93(0xe8)]),_0x98e6aa;}function buildLeftValue(_0x48f84a){const _0x37fa32=a107_0x3b2d,_0x20dc20={'name':_0x48f84a[_0x37fa32(0x129)]};return _0x48f84a[_0x37fa32(0x146)]&&(_0x20dc20[_0x37fa32(0x146)]={'type':_0x48f84a['aggregation'][_0x37fa32(0x14f)],..._0x48f84a[_0x37fa32(0x146)][_0x37fa32(0x13f)]&&{'groupingColumns':_0x48f84a[_0x37fa32(0x146)]['groupingColumns']}}),_0x48f84a[_0x37fa32(0x10d)]&&(_0x20dc20[_0x37fa32(0x10d)]={'name':_0x48f84a[_0x37fa32(0x10d)]}),_0x48f84a['filter']&&(_0x20dc20['filter']=yamlRuleToApi(_0x48f84a[_0x37fa32(0x143)])),_0x20dc20;}function yamlOperatorToApi(_0x5a024a){const _0x28d5a2=a107_0x3b2d,_0x295c36={'type':mapYamlOperatorType(_0x5a024a['type']),'not':_0x5a024a[_0x28d5a2(0x11d)]??![]},_0x355ec6=getEffectiveValue(_0x5a024a);if(_0x355ec6!==undefined){if(Array['isArray'](_0x355ec6))_0x295c36['rightValues']=_0x355ec6;else isTemporalOperator(_0x5a024a['type'])?_0x295c36['value']=_0x355ec6:_0x295c36[_0x28d5a2(0xf1)]=_0x355ec6;}return _0x5a024a['unit']&&(_0x295c36[_0x28d5a2(0x13b)]=_0x5a024a[_0x28d5a2(0x13b)]),_0x295c36;}function mapYamlOperatorType(_0x2f0522){return _0x2f0522;}export function toYamlString(_0x4ac629){const _0x478f57=a107_0x3b2d,_0x5c9426=JSON[_0x478f57(0xf4)](JSON[_0x478f57(0x105)](_0x4ac629)),_0x1b9e69=a107_0x3dd409[_0x478f57(0x105)](_0x5c9426,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x478f57(0xe7)}),_0x2177f6=[_0x478f57(0xf6)];let _0x29426b=_0x1b9e69;for(const _0xd3b63f of _0x2177f6){_0x29426b=_0x29426b['replace'](new RegExp('^('+_0xd3b63f+')','m'),(_0x253de4,_0x64be3a,_0x1a4e4f)=>{if(_0x1a4e4f===0x0||_0x29426b[_0x1a4e4f-0x1]==='\x0a'&&_0x29426b[_0x1a4e4f-0x2]==='\x0a')return _0x64be3a;return'\x0a'+_0x64be3a;});}return _0x29426b;}export function parseYamlString(_0x4cbc4a){const _0x2f18c5=a107_0x3b2d,_0x1161ce=a107_0x3dd409[_0x2f18c5(0xf4)](_0x4cbc4a);if(!_0x1161ce['name'])throw new Error(_0x2f18c5(0xf2));if(_0x1161ce[_0x2f18c5(0x14f)]&&_0x1161ce[_0x2f18c5(0x14f)]!==_0x2f18c5(0xc6))throw new Error(_0x2f18c5(0xd3)+_0x1161ce[_0x2f18c5(0x14f)]);return _0x1161ce;}export function isSegmentYaml(_0x4eb867){const _0x4285cf=a107_0x3b2d;if(typeof _0x4eb867!==_0x4285cf(0xd5)||_0x4eb867===null)return![];const _0x2a80ae=_0x4eb867;return _0x2a80ae[_0x4285cf(0x14f)]===_0x4285cf(0xc6)||_0x2a80ae[_0x4285cf(0x14f)]===undefined;}export function generateTemplate(_0x5a6dd1=a107_0x13863d(0x130)){const _0x472cc8=a107_0x13863d,_0x4c19fa={'type':_0x472cc8(0xc6),'name':_0x5a6dd1,'description':_0x472cc8(0xd7),'rule':{'type':'And','conditions':[{'type':_0x472cc8(0xfd),'attribute':_0x472cc8(0x10f),'operator':{'type':_0x472cc8(0x11c),'value':_0x472cc8(0xd4)}}]}};return toYamlString(_0x4c19fa);}function a107_0x3b2d(_0x20da88,_0x59ce57){_0x20da88=_0x20da88-0xbf;const _0x25aefe=a107_0x25ae();let _0x3b2da1=_0x25aefe[_0x20da88];return _0x3b2da1;}export function segmentToYamlString(_0x2bf33e){const _0x42dfa9=a107_0x13863d,_0x2166b1=JSON[_0x42dfa9(0xf4)](JSON[_0x42dfa9(0x105)](_0x2bf33e)),_0x1fc285=a107_0x3dd409['stringify'](_0x2166b1,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x598890=['rule:',_0x42dfa9(0xf7)];let _0x284a96=_0x1fc285;for(const _0x426091 of _0x598890){_0x284a96=_0x284a96[_0x42dfa9(0xc2)](new RegExp('^('+_0x426091+')','m'),(_0x27cdfc,_0x2b5fa8,_0x5a66d3)=>{if(_0x5a66d3===0x0||_0x284a96[_0x5a66d3-0x1]==='\x0a'&&_0x284a96[_0x5a66d3-0x2]==='\x0a')return _0x2b5fa8;return'\x0a'+_0x2b5fa8;});}return _0x284a96;}export function parseSegmentYamlFile(_0x2c3f02){const _0x119989=a107_0x13863d,_0xd79c8e=a107_0x3dd409[_0x119989(0xf4)](_0x2c3f02);if(!_0xd79c8e[_0x119989(0xc3)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0xd79c8e;}export function normalizeChildSegmentYaml(_0xd7dec7){const _0x56d4fa=a107_0x13863d;return{'type':_0x56d4fa(0xc6),'name':_0xd7dec7['name'],..._0xd7dec7[_0x56d4fa(0xc1)]!==undefined&&{'description':_0xd7dec7[_0x56d4fa(0xc1)]},..._0xd7dec7[_0x56d4fa(0x150)]!==undefined&&{'folder':_0xd7dec7['folder']},..._0xd7dec7[_0x56d4fa(0x12d)]&&{'rule':normalizeRule(_0xd7dec7[_0x56d4fa(0x12d)])},..._0xd7dec7[_0x56d4fa(0xea)]!==undefined&&{'kind':_0xd7dec7[_0x56d4fa(0xea)]},..._0xd7dec7[_0x56d4fa(0x128)]!==undefined&&{'visible':_0xd7dec7[_0x56d4fa(0x128)]},..._0xd7dec7[_0x56d4fa(0xc5)]&&{'activations':_0xd7dec7[_0x56d4fa(0xc5)][_0x56d4fa(0x13c)](normalizeActivation)}};}export function normalizeRule(_0x2097dc){const _0x26d062=a107_0x13863d;return{'type':_0x2097dc[_0x26d062(0x14f)],'conditions':_0x2097dc['conditions'][_0x26d062(0x13c)](normalizeCondition),..._0x2097dc['description']!==undefined&&{'description':_0x2097dc[_0x26d062(0xc1)]}};}function a107_0x25ae(){const _0x33ac5e=['YAML\x20config\x20missing\x20required\x20field:\x20name','4566744qBDNrM','parse','scheduleType','rule:','activations:','duration','repeatUnit','set','sort','formatting','Value','localRuleToName','emailRecipients','behaviorTableName','repeatSubFrequency','activation_template_id','errors','orderBy','stringify','].attribute\x20cannot\x20be\x20empty.\x0a','startAt','segmentFolderId','behavior','include','Connector:\x20','end_on','source','test','attribute_name','ruleHashToName','join_row','attributes','942zZNnjz','columns','warnings','repeat_unit','__UNRESOLVED__','\x27:\x20','isVisible','any','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','Equal','not','resolveSegmentName','funnel_stage','join_strategy','1558732AdHzgb','start_at','293tqfXWz','joinRow','activationTemplateId','Reference','notify_on','visible','attribute','notification','values','59265SNXlci','rule','has','from','New\x20Segment','Unknown\x20connection:\x20','connector_config\x20for\x20activation\x20\x22','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','localeCompare','all','connectionNameToIdMap','allColumns','connectorConfig','string','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','unit','map','add','isArray','groupingColumns','\x0a\x0aAvailable\x20fields:\x0a','getSchema','repeatFrequency','filter','code','timezone','aggregation','batch','max','\x22:\x0a','usedNames','arrayMatching','exclude','repeat_sub_frequency','endOn','type','folder','rightValues','repeat_frequency','description','replace','name','activationParams','activations','segment','length','CONNECTION_NOT_FOUND','connector_config','syndicationBehavior','JOURNEY_SYNTAX_ERROR','realtime','entries','behavior_table','connection','notifyOn','And','keys','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','value','object','every','Segment\x20description','connectionNameToTypeMap','schedule','531480bqYTBM','order_by','min','operator','toLowerCase','CONNECTOR_INVALID_CONFIG','visibility','get','1377895QTqqlm','all_columns','email_recipients','connectionId','Unknown\x20email\x20recipient:\x20','null','limit','conditions','kind','CONNECTOR_SCHEMA_NOT_FOUND','1734344IpaTMS','joinStrategy','leftValue','4LDHRZw','valid','rightValue'];a107_0x25ae=function(){return _0x33ac5e;};return a107_0x25ae();}function normalizeCondition(_0x12b32e){const _0x53fe43=a107_0x13863d;if(_0x53fe43(0xc6)in _0x12b32e&&(_0x12b32e[_0x53fe43(0x14f)]===_0x53fe43(0x10a)||_0x12b32e[_0x53fe43(0x14f)]===_0x53fe43(0x14c))){const _0x3907bc=_0x12b32e;return{'type':_0x3907bc[_0x53fe43(0x14f)],'segment':_0x3907bc['segment']};}if(_0x53fe43(0x14f)in _0x12b32e&&(_0x12b32e['type']===_0x53fe43(0xd1)||_0x12b32e[_0x53fe43(0x14f)]==='Or')){const _0x1f89fb=_0x12b32e;return{'type':_0x1f89fb[_0x53fe43(0x14f)],'conditions':_0x1f89fb['conditions'][_0x53fe43(0x13c)](normalizeCondition),..._0x1f89fb[_0x53fe43(0xc1)]!==undefined&&{'description':_0x1f89fb['description']}};}const _0x4949be=_0x12b32e;return{'type':'Value','attribute':_0x4949be['attribute'],'operator':normalizeOperator(_0x4949be[_0x53fe43(0xdd)]),..._0x4949be[_0x53fe43(0x14b)]!==undefined&&{'arrayMatching':_0x4949be['arrayMatching']},..._0x4949be[_0x53fe43(0x14c)]!==undefined&&{'exclude':_0x4949be[_0x53fe43(0x14c)]},..._0x4949be[_0x53fe43(0x146)]!==undefined&&{'aggregation':_0x4949be[_0x53fe43(0x146)]},..._0x4949be[_0x53fe43(0x10d)]!==undefined&&{'source':_0x4949be[_0x53fe43(0x10d)]},..._0x4949be[_0x53fe43(0x143)]!==undefined&&{'filter':normalizeRule(_0x4949be[_0x53fe43(0x143)])},..._0x4949be['limit']!==undefined&&{'limit':_0x4949be['limit']}};}function normalizeOperator(_0x1b08b9){const _0x3a3b0c=a107_0x13863d,_0x36daf2=getEffectiveValue(_0x1b08b9);return{'type':_0x1b08b9['type'],..._0x1b08b9[_0x3a3b0c(0x11d)]!==undefined&&{'not':_0x1b08b9[_0x3a3b0c(0x11d)]},..._0x36daf2!==undefined&&{'value':_0x36daf2},..._0x1b08b9[_0x3a3b0c(0xdc)]!==undefined&&{'min':_0x1b08b9[_0x3a3b0c(0xdc)]},..._0x1b08b9[_0x3a3b0c(0x148)]!==undefined&&{'max':_0x1b08b9['max']},..._0x1b08b9[_0x3a3b0c(0x13b)]!==undefined&&{'unit':_0x1b08b9[_0x3a3b0c(0x13b)]},..._0x1b08b9[_0x3a3b0c(0xf8)]!==undefined&&{'duration':_0x1b08b9[_0x3a3b0c(0xf8)]},..._0x1b08b9[_0x3a3b0c(0x12f)]!==undefined&&{'from':_0x1b08b9[_0x3a3b0c(0x12f)]}};}function normalizeActivation(_0x4aff20){const _0x2447b7=a107_0x13863d;return{'name':_0x4aff20[_0x2447b7(0xc3)],'connection':_0x4aff20[_0x2447b7(0xcf)],..._0x4aff20[_0x2447b7(0xc1)]!==undefined&&{'description':_0x4aff20[_0x2447b7(0xc1)]},..._0x4aff20[_0x2447b7(0xe3)]!==undefined&&{'all_columns':_0x4aff20[_0x2447b7(0xe3)]},..._0x4aff20[_0x2447b7(0x114)]!==undefined&&{'columns':_0x4aff20['columns']},..._0x4aff20[_0x2447b7(0x109)]!==undefined&&{'behavior':_0x4aff20[_0x2447b7(0x109)]},..._0x4aff20[_0x2447b7(0xd9)]!==undefined&&{'schedule':_0x4aff20[_0x2447b7(0xd9)]},..._0x4aff20[_0x2447b7(0x12a)]!==undefined&&{'notification':_0x4aff20[_0x2447b7(0x12a)]},..._0x4aff20[_0x2447b7(0xc9)]!==undefined&&{'connector_config':_0x4aff20[_0x2447b7(0xc9)]},..._0x4aff20[_0x2447b7(0x102)]!==undefined&&{'activation_template_id':_0x4aff20['activation_template_id']}};}export function activationResponseToDef(_0x58f19a,_0x327921,_0x3ac5f0){const _0xd8451a=a107_0x13863d,_0x5531ea=_0x58f19a[_0xd8451a(0xe5)]||'',_0x3a10c7=_0x3ac5f0?.[_0xd8451a(0xe1)](_0x5531ea)??_0x5531ea,_0x5e8435={'name':_0x58f19a['name'],'connection':_0x3a10c7};_0x58f19a[_0xd8451a(0xc1)]&&(_0x5e8435[_0xd8451a(0xc1)]=_0x58f19a[_0xd8451a(0xc1)]);let _0x470656=[];_0x58f19a[_0xd8451a(0x114)]&&_0x58f19a[_0xd8451a(0x114)][_0xd8451a(0xc7)]>0x0&&(_0x470656=_0x58f19a[_0xd8451a(0x114)][_0xd8451a(0x143)](_0x1c3809=>_0x1c3809&&_0x1c3809['name'])['map'](_0x34282d=>{const _0x190a4f=_0xd8451a;if(_0x34282d[_0x190a4f(0x14f)]||_0x34282d['visibility'])return{'name':_0x34282d[_0x190a4f(0xc3)],..._0x34282d['type']&&{'type':_0x34282d[_0x190a4f(0x14f)]},..._0x34282d[_0x190a4f(0xe0)]&&{'visibility':_0x34282d[_0x190a4f(0xe0)]}};return _0x34282d[_0x190a4f(0xc3)];}));_0x470656[_0xd8451a(0xc7)]>0x0&&(_0x5e8435['columns']=_0x470656);_0x58f19a[_0xd8451a(0x137)]!==undefined&&(_0x58f19a[_0xd8451a(0x137)]===![]&&_0x470656[_0xd8451a(0xc7)]===0x0?_0x5e8435['all_columns']=!![]:_0x5e8435[_0xd8451a(0xe3)]=_0x58f19a[_0xd8451a(0x137)]);const _0x16c0a8={};let _0x2bb9a7=![];_0x58f19a[_0xd8451a(0xf5)]&&(_0x16c0a8['type']=_0x58f19a['scheduleType'],_0x2bb9a7=!![]);_0x58f19a[_0xd8451a(0xf9)]&&(_0x16c0a8[_0xd8451a(0x116)]=_0x58f19a['repeatUnit'],_0x2bb9a7=!![]);_0x58f19a['repeatFrequency']!==undefined&&_0x58f19a[_0xd8451a(0x142)]!==null&&(_0x16c0a8[_0xd8451a(0xc0)]=_0x58f19a['repeatFrequency'],_0x2bb9a7=!![]);_0x58f19a[_0xd8451a(0x101)]&&_0x58f19a['repeatSubFrequency'][_0xd8451a(0xc7)]>0x0&&(_0x16c0a8[_0xd8451a(0x14d)]=_0x58f19a[_0xd8451a(0x101)],_0x2bb9a7=!![]);_0x58f19a[_0xd8451a(0x107)]!==undefined&&(_0x16c0a8[_0xd8451a(0x122)]=_0x58f19a['startAt'],_0x2bb9a7=!![]);_0x58f19a[_0xd8451a(0x14e)]!==undefined&&(_0x16c0a8['end_on']=_0x58f19a[_0xd8451a(0x14e)],_0x2bb9a7=!![]);_0x58f19a[_0xd8451a(0x145)]&&(_0x16c0a8[_0xd8451a(0x145)]=_0x58f19a[_0xd8451a(0x145)],_0x2bb9a7=!![]);_0x2bb9a7&&(_0x5e8435['schedule']=_0x16c0a8);(_0x58f19a['notifyOn']&&_0x58f19a[_0xd8451a(0xd0)][_0xd8451a(0xc7)]>0x0||_0x58f19a[_0xd8451a(0xff)]&&_0x58f19a[_0xd8451a(0xff)][_0xd8451a(0xc7)]>0x0)&&(_0x5e8435[_0xd8451a(0x12a)]={},_0x58f19a['notifyOn']&&_0x58f19a[_0xd8451a(0xd0)]['length']>0x0&&(_0x5e8435[_0xd8451a(0x12a)][_0xd8451a(0x127)]=_0x58f19a[_0xd8451a(0xd0)]),_0x58f19a['emailRecipients']&&_0x58f19a[_0xd8451a(0xff)]['length']>0x0&&(_0x5e8435[_0xd8451a(0x12a)][_0xd8451a(0xe4)]=_0x58f19a[_0xd8451a(0xff)]['map'](_0xd8723c=>{const _0x2dbf9c=_0x327921?.['get'](_0xd8723c);return _0x2dbf9c??String(_0xd8723c);})));_0x58f19a[_0xd8451a(0x138)]&&Object[_0xd8451a(0xd2)](_0x58f19a[_0xd8451a(0x138)])[_0xd8451a(0xc7)]>0x0&&(_0x5e8435[_0xd8451a(0xc9)]=normalizeConnectorConfigForYaml(_0x58f19a[_0xd8451a(0x138)]));_0x58f19a[_0xd8451a(0x125)]&&(_0x5e8435[_0xd8451a(0x102)]=_0x58f19a[_0xd8451a(0x125)]);if(_0x58f19a[_0xd8451a(0xca)]){const _0x2e8f27={},_0x18e405=_0x58f19a[_0xd8451a(0xca)];_0x18e405['columns']&&_0x18e405[_0xd8451a(0x114)]['length']>0x0&&(_0x2e8f27[_0xd8451a(0x114)]=_0x18e405[_0xd8451a(0x114)]['filter'](_0x2a5275=>_0x2a5275&&_0x2a5275[_0xd8451a(0xc3)])[_0xd8451a(0x13c)](_0x29409c=>({'name':_0x29409c[_0xd8451a(0xc3)],..._0x29409c['type']&&{'type':_0x29409c[_0xd8451a(0x14f)]},..._0x29409c[_0xd8451a(0xe0)]&&{'visibility':_0x29409c['visibility']}}))),_0x18e405[_0xd8451a(0x100)]&&(_0x2e8f27[_0xd8451a(0xce)]=_0x18e405[_0xd8451a(0x100)]),_0x18e405[_0xd8451a(0x124)]!==undefined&&(_0x2e8f27['join_row']=_0x18e405[_0xd8451a(0x124)]),_0x18e405[_0xd8451a(0xed)]&&(_0x2e8f27[_0xd8451a(0x120)]=_0x18e405[_0xd8451a(0xed)]),_0x18e405['formatting']&&(_0x2e8f27[_0xd8451a(0xfc)]=_0x18e405[_0xd8451a(0xfc)]),_0x18e405[_0xd8451a(0x104)]&&_0x18e405[_0xd8451a(0x104)][_0xd8451a(0xc7)]>0x0&&(_0x2e8f27[_0xd8451a(0xdb)]=_0x18e405[_0xd8451a(0x104)]),Object[_0xd8451a(0xd2)](_0x2e8f27)['length']>0x0&&(_0x5e8435[_0xd8451a(0x109)]=_0x2e8f27);}return _0x5e8435;}export function journeyActivationStepToYaml(_0x4a504b,_0x4d3ad8,_0x5f33c2){const _0x2105fd=a107_0x13863d,_0x3a7bb8=_0x4a504b[_0x2105fd(0x112)][_0x2105fd(0xc4)],_0x28ae5a=_0x3a7bb8[_0x2105fd(0xe5)]||'',_0x445256=_0x5f33c2?.[_0x2105fd(0xe1)](_0x28ae5a)??_0x28ae5a,_0xc7c0e9={'name':_0x3a7bb8['name']||'','connection':_0x445256};_0x3a7bb8[_0x2105fd(0xc1)]&&(_0xc7c0e9[_0x2105fd(0xc1)]=_0x3a7bb8[_0x2105fd(0xc1)]);let _0xcd866e=[];_0x3a7bb8[_0x2105fd(0x114)]&&_0x3a7bb8[_0x2105fd(0x114)]['length']>0x0&&(_0xcd866e=_0x3a7bb8['columns'][_0x2105fd(0x143)](_0x25598d=>_0x25598d&&_0x25598d['name'])['map'](_0x42a0b5=>{const _0x109e06=_0x2105fd;if(_0x42a0b5[_0x109e06(0x14f)]||_0x42a0b5[_0x109e06(0xe0)])return{'name':_0x42a0b5[_0x109e06(0xc3)],..._0x42a0b5[_0x109e06(0x14f)]&&{'type':_0x42a0b5['type']},..._0x42a0b5[_0x109e06(0xe0)]&&{'visibility':_0x42a0b5[_0x109e06(0xe0)]}};return _0x42a0b5[_0x109e06(0xc3)];}));_0xcd866e['length']>0x0&&(_0xc7c0e9[_0x2105fd(0x114)]=_0xcd866e);_0x3a7bb8[_0x2105fd(0x137)]!==undefined&&(_0x3a7bb8[_0x2105fd(0x137)]===![]&&_0xcd866e[_0x2105fd(0xc7)]===0x0?_0xc7c0e9[_0x2105fd(0xe3)]=!![]:_0xc7c0e9[_0x2105fd(0xe3)]=_0x3a7bb8['allColumns']);const _0x4f9959={};let _0x41f333=![];_0x3a7bb8[_0x2105fd(0xf5)]&&(_0x4f9959[_0x2105fd(0x14f)]=_0x3a7bb8['scheduleType'],_0x41f333=!![]);_0x3a7bb8[_0x2105fd(0xf9)]&&(_0x4f9959[_0x2105fd(0x116)]=_0x3a7bb8[_0x2105fd(0xf9)],_0x41f333=!![]);_0x3a7bb8['repeatFrequency']!==undefined&&_0x3a7bb8[_0x2105fd(0x142)]!==null&&(_0x4f9959[_0x2105fd(0xc0)]=_0x3a7bb8[_0x2105fd(0x142)],_0x41f333=!![]);_0x3a7bb8[_0x2105fd(0x107)]!==undefined&&(_0x4f9959[_0x2105fd(0x122)]=_0x3a7bb8[_0x2105fd(0x107)],_0x41f333=!![]);_0x3a7bb8['endOn']!==undefined&&(_0x4f9959[_0x2105fd(0x10c)]=_0x3a7bb8[_0x2105fd(0x14e)],_0x41f333=!![]);_0x3a7bb8['timezone']&&(_0x4f9959[_0x2105fd(0x145)]=_0x3a7bb8[_0x2105fd(0x145)],_0x41f333=!![]);_0x41f333&&(_0xc7c0e9['schedule']=_0x4f9959);(_0x3a7bb8[_0x2105fd(0xd0)]&&_0x3a7bb8[_0x2105fd(0xd0)][_0x2105fd(0xc7)]>0x0||_0x3a7bb8[_0x2105fd(0xff)]&&_0x3a7bb8[_0x2105fd(0xff)][_0x2105fd(0xc7)]>0x0)&&(_0xc7c0e9[_0x2105fd(0x12a)]={},_0x3a7bb8[_0x2105fd(0xd0)]&&_0x3a7bb8[_0x2105fd(0xd0)][_0x2105fd(0xc7)]>0x0&&(_0xc7c0e9['notification'][_0x2105fd(0x127)]=_0x3a7bb8[_0x2105fd(0xd0)]),_0x3a7bb8['emailRecipients']&&_0x3a7bb8[_0x2105fd(0xff)][_0x2105fd(0xc7)]>0x0&&(_0xc7c0e9['notification'][_0x2105fd(0xe4)]=_0x3a7bb8[_0x2105fd(0xff)]['map'](_0x492d6b=>{const _0x3c9b10=_0x4d3ad8?.['get'](_0x492d6b);return _0x3c9b10??String(_0x492d6b);})));_0x3a7bb8[_0x2105fd(0x138)]&&Object['keys'](_0x3a7bb8[_0x2105fd(0x138)])[_0x2105fd(0xc7)]>0x0&&(_0xc7c0e9[_0x2105fd(0xc9)]=normalizeConnectorConfigForYaml(_0x3a7bb8[_0x2105fd(0x138)]));_0x3a7bb8[_0x2105fd(0x125)]&&(_0xc7c0e9['activation_template_id']=_0x3a7bb8[_0x2105fd(0x125)]);if(_0x3a7bb8[_0x2105fd(0xca)]){const _0x32a8ed={},_0x36cfdc=_0x3a7bb8['syndicationBehavior'];_0x36cfdc[_0x2105fd(0x114)]&&_0x36cfdc[_0x2105fd(0x114)][_0x2105fd(0xc7)]>0x0&&(_0x32a8ed[_0x2105fd(0x114)]=_0x36cfdc['columns'][_0x2105fd(0x143)](_0x135e4e=>_0x135e4e&&_0x135e4e[_0x2105fd(0xc3)])[_0x2105fd(0x13c)](_0x15996f=>({'name':_0x15996f[_0x2105fd(0xc3)],..._0x15996f[_0x2105fd(0x14f)]&&{'type':_0x15996f[_0x2105fd(0x14f)]},..._0x15996f[_0x2105fd(0xe0)]&&{'visibility':_0x15996f['visibility']}}))),_0x36cfdc[_0x2105fd(0x100)]&&(_0x32a8ed[_0x2105fd(0xce)]=_0x36cfdc[_0x2105fd(0x100)]),_0x36cfdc[_0x2105fd(0x124)]!==undefined&&(_0x32a8ed[_0x2105fd(0x111)]=_0x36cfdc[_0x2105fd(0x124)]),_0x36cfdc[_0x2105fd(0xed)]&&(_0x32a8ed[_0x2105fd(0x120)]=_0x36cfdc[_0x2105fd(0xed)]),_0x36cfdc['formatting']&&(_0x32a8ed['formatting']=_0x36cfdc['formatting']),_0x36cfdc[_0x2105fd(0x104)]&&_0x36cfdc[_0x2105fd(0x104)][_0x2105fd(0xc7)]>0x0&&(_0x32a8ed[_0x2105fd(0xdb)]=_0x36cfdc[_0x2105fd(0x104)]),Object[_0x2105fd(0xd2)](_0x32a8ed)[_0x2105fd(0xc7)]>0x0&&(_0xc7c0e9[_0x2105fd(0x109)]=_0x32a8ed);}return _0xc7c0e9;}export function segmentWithActivationsToYaml(_0x5dba64,_0x1490c9,_0x4280fa,_0x51dfb7,_0x5e85e8){const _0x497035=a107_0x13863d,_0x36943f=segmentResponseToDefSync(_0x5dba64,_0x4280fa);return _0x1490c9[_0x497035(0xc7)]>0x0&&(_0x36943f[_0x497035(0xc5)]=_0x1490c9[_0x497035(0x13c)](_0x10a302=>activationResponseToDef(_0x10a302,_0x51dfb7,_0x5e85e8))),_0x36943f;}function normalizeColumn(_0x1d8640){const _0x3f6dba=a107_0x13863d;if(typeof _0x1d8640==='string')return{'name':_0x1d8640};return{'name':_0x1d8640[_0x3f6dba(0xc3)],..._0x1d8640[_0x3f6dba(0x14f)]&&{'type':_0x1d8640[_0x3f6dba(0x14f)]},..._0x1d8640['visibility']&&{'visibility':_0x1d8640[_0x3f6dba(0xe0)]}};}export async function activationDefToCreateRequest(_0x627bf6,_0x94cd7f){const _0x56c596=a107_0x13863d,_0x24712c=_0x94cd7f?.['emailToIdMap'],_0x1eb371=_0x94cd7f?.[_0x56c596(0x136)],_0xe0f5bf=_0x627bf6[_0x56c596(0xcf)];let _0x6ab3f1;const _0x2041a9=parseInt(_0xe0f5bf,0xa);if(!isNaN(_0x2041a9)&&String(_0x2041a9)===_0xe0f5bf)_0x6ab3f1=_0x2041a9;else{const _0x108e0f=_0x1eb371?.['get'](_0xe0f5bf);if(_0x108e0f===undefined)throw new SDKError(ErrorCode[_0x56c596(0xc8)],_0x56c596(0x131)+_0xe0f5bf,undefined,{'helpText':_0x56c596(0x13a)});_0x6ab3f1=_0x108e0f;}const _0x79a0c5={'name':_0x627bf6[_0x56c596(0xc3)],'connectionId':_0x6ab3f1};_0x627bf6[_0x56c596(0xc1)]&&(_0x79a0c5[_0x56c596(0xc1)]=_0x627bf6[_0x56c596(0xc1)]);let _0x5e8a25=[];_0x627bf6[_0x56c596(0x114)]&&_0x627bf6[_0x56c596(0x114)][_0x56c596(0xc7)]>0x0&&(_0x5e8a25=_0x627bf6[_0x56c596(0x114)][_0x56c596(0x143)](_0x21d3a3=>_0x21d3a3!=null)['map'](normalizeColumn));_0x5e8a25[_0x56c596(0xc7)]>0x0&&(_0x79a0c5[_0x56c596(0x114)]=_0x5e8a25);_0x627bf6['all_columns']!==undefined&&(_0x627bf6[_0x56c596(0xe3)]===![]&&_0x5e8a25[_0x56c596(0xc7)]===0x0?_0x79a0c5['allColumns']=!![]:_0x79a0c5[_0x56c596(0x137)]=_0x627bf6[_0x56c596(0xe3)]);if(_0x627bf6[_0x56c596(0xd9)]){const _0x18e23e=_0x627bf6[_0x56c596(0xd9)];_0x18e23e[_0x56c596(0x14f)]&&(_0x79a0c5[_0x56c596(0xf5)]=_0x18e23e[_0x56c596(0x14f)]),_0x18e23e[_0x56c596(0x116)]&&(_0x79a0c5[_0x56c596(0xf9)]=_0x18e23e['repeat_unit']),_0x18e23e[_0x56c596(0xc0)]!==undefined&&(_0x79a0c5[_0x56c596(0x142)]=_0x18e23e[_0x56c596(0xc0)]),_0x18e23e[_0x56c596(0x14d)]&&(_0x79a0c5[_0x56c596(0x101)]=_0x18e23e[_0x56c596(0x14d)]),_0x18e23e[_0x56c596(0x122)]!==undefined&&(_0x79a0c5[_0x56c596(0x107)]=_0x18e23e[_0x56c596(0x122)]),_0x18e23e[_0x56c596(0x10c)]!==undefined&&(_0x79a0c5[_0x56c596(0x14e)]=_0x18e23e['end_on']),_0x18e23e['timezone']&&(_0x79a0c5[_0x56c596(0x145)]=_0x18e23e['timezone']);}_0x627bf6[_0x56c596(0x12a)]&&(_0x627bf6[_0x56c596(0x12a)][_0x56c596(0x127)]&&(_0x79a0c5['notifyOn']=_0x627bf6['notification'][_0x56c596(0x127)]),_0x627bf6['notification']['email_recipients']&&(_0x79a0c5['emailRecipients']=_0x627bf6['notification'][_0x56c596(0xe4)][_0x56c596(0x13c)](_0x585b39=>{const _0x56e3c3=_0x56c596,_0x1bea33=Number(_0x585b39);if(!isNaN(_0x1bea33)&&String(_0x1bea33)===_0x585b39)return _0x1bea33;const _0x40d36=_0x24712c?.['get'](_0x585b39[_0x56e3c3(0xde)]());if(_0x40d36===undefined)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x56e3c3(0xe6)+_0x585b39+_0x56e3c3(0x133));return _0x40d36;})));if(_0x627bf6['connector_config']){const _0x9fb956=_0x94cd7f?.[_0x56c596(0xd8)]?.['get'](_0xe0f5bf);if(_0x9fb956&&_0x94cd7f?.[_0x56c596(0x141)])try{const _0x289ae5=await _0x94cd7f[_0x56c596(0x141)](_0x9fb956),_0x1a4197=validateConnectorConfig(_0x627bf6['connector_config'],_0x289ae5);if(!_0x1a4197[_0x56c596(0xf0)])throw new SDKError(ErrorCode[_0x56c596(0xdf)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x627bf6[_0x56c596(0xc3)]+'\x22:\x0a'+formatValidationErrors(_0x1a4197[_0x56c596(0x103)]),undefined,{'helpText':_0x56c596(0x10b)+_0x9fb956+_0x56c596(0x140)+formatSchemaAsHelp(_0x289ae5)});if(_0x1a4197[_0x56c596(0x115)][_0x56c596(0xc7)]>0x0){const _0xd7aced=formatValidationWarnings(_0x1a4197[_0x56c596(0x115)]);console['warn'](_0x56c596(0x132)+_0x627bf6['name']+_0x56c596(0x149)+_0xd7aced);}_0x79a0c5['connectorConfig']=transformConfigToLegacy(_0x627bf6[_0x56c596(0xc9)],_0x289ae5);}catch(_0x31bdcc){if(_0x31bdcc instanceof SDKError&&_0x31bdcc[_0x56c596(0x144)]===ErrorCode[_0x56c596(0xeb)])_0x79a0c5[_0x56c596(0x138)]=_0x627bf6[_0x56c596(0xc9)];else throw _0x31bdcc;}else _0x79a0c5[_0x56c596(0x138)]=_0x627bf6[_0x56c596(0xc9)];}_0x627bf6['activation_template_id']!==undefined&&(_0x79a0c5['activationTemplateId']=_0x627bf6[_0x56c596(0x102)]);if(_0x627bf6[_0x56c596(0x109)]){const _0x6ed379=_0x627bf6[_0x56c596(0x109)],_0x4e8f2a={};if(_0x6ed379['columns']&&_0x6ed379[_0x56c596(0x114)][_0x56c596(0xc7)]>0x0){const _0x33ea96=_0x6ed379['columns'][_0x56c596(0x143)](_0x64a0b4=>_0x64a0b4&&_0x64a0b4[_0x56c596(0xc3)]);_0x33ea96['length']>0x0&&(_0x4e8f2a[_0x56c596(0x114)]=_0x33ea96);}_0x6ed379['behavior_table']&&(_0x4e8f2a[_0x56c596(0x100)]=_0x6ed379[_0x56c596(0xce)]),_0x6ed379[_0x56c596(0x111)]!==undefined&&(_0x4e8f2a[_0x56c596(0x124)]=_0x6ed379['join_row']),_0x6ed379[_0x56c596(0x120)]&&(_0x4e8f2a['joinStrategy']=_0x6ed379['join_strategy']),_0x6ed379[_0x56c596(0xfc)]&&(_0x4e8f2a[_0x56c596(0xfc)]=_0x6ed379['formatting']),_0x6ed379['order_by']&&(_0x4e8f2a['orderBy']=_0x6ed379[_0x56c596(0xdb)]),_0x79a0c5['syndicationBehavior']=_0x4e8f2a;}return _0x79a0c5;}export async function activationDefToUpdateRequest(_0x3f09cf,_0x2600e1){return activationDefToCreateRequest(_0x3f09cf,_0x2600e1);}export function deepSortObject(_0x147af9){const _0x31ef1a=a107_0x13863d;if(_0x147af9===null||typeof _0x147af9!==_0x31ef1a(0xd5))return _0x147af9;if(Array[_0x31ef1a(0x13e)](_0x147af9))return _0x147af9[_0x31ef1a(0x13c)](deepSortObject)[_0x31ef1a(0xfb)]((_0x1d6ccc,_0x336960)=>JSON[_0x31ef1a(0x105)](_0x1d6ccc)[_0x31ef1a(0x134)](JSON['stringify'](_0x336960)));const _0x49f669={};for(const _0x2f0860 of Object[_0x31ef1a(0xd2)](_0x147af9)[_0x31ef1a(0xfb)]()){_0x49f669[_0x2f0860]=deepSortObject(_0x147af9[_0x2f0860]);}return _0x49f669;}export function serializeRule(_0x50620c){const _0x453b62=a107_0x13863d;return JSON[_0x453b62(0x105)](deepSortObject(_0x50620c));}export function normalizeRuleForMatching(_0x113dd5){return normalizeConditionsForMatching(_0x113dd5);}function normalizeConditionsForMatching(_0x40c854){const _0x3e21fc=a107_0x13863d;if(_0x40c854===null||typeof _0x40c854!=='object')return _0x40c854;if(Array['isArray'](_0x40c854))return _0x40c854[_0x3e21fc(0x13c)](normalizeConditionsForMatching);const _0x4b1654=_0x40c854;if((_0x4b1654[_0x3e21fc(0x14f)]==='include'||_0x4b1654['type']==='exclude')&&typeof _0x4b1654[_0x3e21fc(0xc6)]===_0x3e21fc(0x139))return{..._0x4b1654,'segment':'__SEGMENT_REF__'};const _0xcbeba4={};for(const _0x27a018 of Object[_0x3e21fc(0xd2)](_0x4b1654)){_0xcbeba4[_0x27a018]=normalizeConditionsForMatching(_0x4b1654[_0x27a018]);}return _0xcbeba4;}export function serializeRuleForMatching(_0x2a7699){const _0x219bd5=a107_0x13863d;return JSON[_0x219bd5(0x105)](deepSortObject(normalizeRuleForMatching(_0x2a7699)));}export function expandSegmentReferences(_0x344e92,_0x2929c4,_0x711bca=new Set()){return expandConditions(_0x344e92,_0x2929c4,_0x711bca);}function expandConditions(_0x4dd40a,_0x515f8c,_0x3d4567){const _0x25c54c=a107_0x13863d;if(_0x4dd40a===null||typeof _0x4dd40a!==_0x25c54c(0xd5))return _0x4dd40a;if(Array['isArray'](_0x4dd40a))return _0x4dd40a['map'](_0x4738e0=>expandConditions(_0x4738e0,_0x515f8c,_0x3d4567));const _0x1a9290=_0x4dd40a;if((_0x1a9290[_0x25c54c(0x14f)]==='include'||_0x1a9290[_0x25c54c(0x14f)]===_0x25c54c(0x14c))&&typeof _0x1a9290[_0x25c54c(0xc6)]===_0x25c54c(0x139)){const _0x1fb1c0=_0x1a9290[_0x25c54c(0xc6)],_0x5a97e5=_0x515f8c['get'](_0x1fb1c0);if(_0x5a97e5&&!_0x3d4567[_0x25c54c(0x12e)](_0x1fb1c0)){const _0x24c205=new Set(_0x3d4567);_0x24c205[_0x25c54c(0x13d)](_0x1fb1c0);const _0xefb1ce=expandConditions(_0x5a97e5,_0x515f8c,_0x24c205);return{'type':_0x1a9290['type'],'expanded_rule':_0xefb1ce};}return{'type':_0x1a9290['type'],'expanded_rule':_0x25c54c(0x117)};}const _0x5456eb={};for(const _0x1d55ae of Object[_0x25c54c(0xd2)](_0x1a9290)){_0x5456eb[_0x1d55ae]=expandConditions(_0x1a9290[_0x1d55ae],_0x515f8c,_0x3d4567);}return _0x5456eb;}export function serializeExpandedRule(_0x4a1370,_0x550dad){const _0x15c5fe=expandSegmentReferences(_0x4a1370,_0x550dad);return JSON['stringify'](deepSortObject(_0x15c5fe));}export function createSegmentNameContext(_0x7e31bf){const _0x52c20c=a107_0x13863d,_0x2aede6=new Set(),_0x52f0ab=new Map(),_0x31e344=new Map();if(_0x7e31bf)for(const [_0xe5f2c3,_0x2ff899]of Object[_0x52c20c(0xcd)](_0x7e31bf)){if(_0x2ff899[_0x52c20c(0x12d)]){const _0x3dff8b=serializeRule(_0x2ff899[_0x52c20c(0x12d)]);_0x31e344[_0x52c20c(0xfa)](_0x3dff8b,_0xe5f2c3),_0x2aede6['add'](_0xe5f2c3);}}return{'usedNames':_0x2aede6,'ruleHashToName':_0x52f0ab,'localRuleToName':_0x7e31bf?_0x31e344:undefined};}export function resolveSegmentName(_0x481d85,_0x1fdb2a,_0x2225bf,_0x18efe4){const _0x44746c=a107_0x13863d,_0x4de194=serializeRule(_0x1fdb2a);if(_0x2225bf[_0x44746c(0xfe)]){const _0x538151=_0x2225bf[_0x44746c(0xfe)][_0x44746c(0xe1)](_0x4de194);if(_0x538151)return{'name':_0x538151,'isDuplicate':![],'isLocalMatch':!![]};}const _0x934bde=_0x2225bf['ruleHashToName'][_0x44746c(0xe1)](_0x4de194);if(_0x934bde)return{'name':_0x934bde,'isDuplicate':!![],'isLocalMatch':![]};const _0x57d139=_0x18efe4(_0x481d85);let _0x3a8901=_0x57d139||_0x481d85,_0x3f39fe=_0x3a8901,_0x195482=0x2;while(_0x2225bf[_0x44746c(0x14a)][_0x44746c(0x12e)](_0x3f39fe)){_0x3f39fe=_0x3a8901+'_'+_0x195482,_0x195482++;}return _0x2225bf[_0x44746c(0x14a)][_0x44746c(0x13d)](_0x3f39fe),_0x2225bf[_0x44746c(0x110)]['set'](_0x4de194,_0x3f39fe),{'name':_0x3f39fe,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x444c64){const _0x47b71e=[],_0x5cff3c=_0xed5920=>{const _0x47528b=a107_0x3b2d;if(!_0xed5920||typeof _0xed5920!=='object')return;if(Array[_0x47528b(0x13e)](_0xed5920)){_0xed5920['forEach'](_0x5cff3c);return;}const _0x59689b=_0xed5920;(_0x59689b[_0x47528b(0x14f)]===_0x47528b(0x10a)||_0x59689b[_0x47528b(0x14f)]===_0x47528b(0x14c))&&typeof _0x59689b['segment']==='string'&&_0x47b71e['push'](_0x59689b[_0x47528b(0xc6)]);for(const _0x2efaed of Object[_0x47528b(0x12b)](_0x59689b)){_0x5cff3c(_0x2efaed);}};return _0x5cff3c(_0x444c64),_0x47b71e;}export function validateSegmentRule(_0x42336d,_0x31cdc3){const _0x1c668d=a107_0x13863d;if(!_0x31cdc3||!_0x31cdc3['conditions'])return;for(let _0x3653dd=0x0;_0x3653dd<_0x31cdc3[_0x1c668d(0xe9)][_0x1c668d(0xc7)];_0x3653dd++){const _0x4f5a1b=_0x31cdc3[_0x1c668d(0xe9)][_0x3653dd];if('type'in _0x4f5a1b&&_0x4f5a1b[_0x1c668d(0x14f)]==='Value'){const _0x56271=_0x4f5a1b;if(!_0x56271[_0x1c668d(0x129)]||_0x56271[_0x1c668d(0x129)]==='')throw new SDKError(ErrorCode[_0x1c668d(0xcb)],_0x1c668d(0x11b)+_0x42336d+_0x1c668d(0x118)+('conditions['+_0x3653dd+_0x1c668d(0x106))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|
|
1
|
+
const a107_0x21f8ff=a107_0x1e6e;(function(_0xa8e31b,_0x5735a0){const _0x5a8be3=a107_0x1e6e,_0x6da419=_0xa8e31b();while(!![]){try{const _0x339b52=-parseInt(_0x5a8be3(0x17d))/0x1*(-parseInt(_0x5a8be3(0x181))/0x2)+parseInt(_0x5a8be3(0x128))/0x3*(parseInt(_0x5a8be3(0xfe))/0x4)+-parseInt(_0x5a8be3(0x10d))/0x5*(parseInt(_0x5a8be3(0x113))/0x6)+-parseInt(_0x5a8be3(0x161))/0x7+parseInt(_0x5a8be3(0x18b))/0x8*(parseInt(_0x5a8be3(0x13a))/0x9)+parseInt(_0x5a8be3(0x17e))/0xa*(-parseInt(_0x5a8be3(0x16a))/0xb)+parseInt(_0x5a8be3(0x17f))/0xc*(parseInt(_0x5a8be3(0x182))/0xd);if(_0x339b52===_0x5735a0)break;else _0x6da419['push'](_0x6da419['shift']());}catch(_0x524e7c){_0x6da419['push'](_0x6da419['shift']());}}}(a107_0x23ea,0x566c0));import*as a107_0x521346 from'yaml';function a107_0x1e6e(_0xeb7692,_0x39379e){_0xeb7692=_0xeb7692-0xfc;const _0x23eaf8=a107_0x23ea();let _0x1e6ede=_0x23eaf8[_0xeb7692];return _0x1e6ede;}import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x335f0c,_0x421919){const _0x344761=a107_0x1e6e,_0x467592=_0x335f0c[_0x344761(0x110)]&&_0x344761(0x15c)in _0x335f0c[_0x344761(0x110)]&&_0x335f0c[_0x344761(0x110)][_0x344761(0x15c)];return{'type':_0x344761(0x126),'name':_0x335f0c[_0x344761(0x16c)],..._0x335f0c['description']&&{'description':_0x335f0c[_0x344761(0x163)]},..._0x421919&&{'folder':_0x421919},..._0x467592&&{'rule':apiRuleToYaml(_0x335f0c['rule'])},..._0x335f0c[_0x344761(0x13d)]!==undefined&&{'kind':_0x335f0c[_0x344761(0x13d)]===0x0?_0x344761(0x127):_0x335f0c[_0x344761(0x13d)]===0x1?_0x344761(0x146):_0x344761(0x133)},..._0x335f0c[_0x344761(0x14f)]!==undefined&&{'visible':_0x335f0c['isVisible']}};}export async function segmentResponseToDef(_0x271880,_0x2907cc,_0x4c563d){const _0x317f0a=a107_0x1e6e,_0x3a57de=segmentResponseToDefSync(_0x271880,_0x4c563d);if(!_0x2907cc||!_0x2907cc[_0x317f0a(0xfd)])return _0x3a57de;return _0x3a57de[_0x317f0a(0x110)]&&(_0x3a57de[_0x317f0a(0x110)]=await resolveRuleSegmentRefs(_0x3a57de[_0x317f0a(0x110)],_0x2907cc[_0x317f0a(0xfd)])),_0x3a57de;}export function apiRuleToYaml(_0x2c47ca){const _0x2b344=a107_0x1e6e,_0x342f1f=(_0x2c47ca['conditions']||[])[_0x2b344(0x121)](apiConditionToYaml);if(_0x342f1f['length']===0x1&&!_0x2c47ca[_0x2b344(0x163)]&&_0x2b344(0x15c)in _0x342f1f[0x0]&&(_0x342f1f[0x0][_0x2b344(0x15c)]===_0x2b344(0x170)||_0x342f1f[0x0][_0x2b344(0x15c)]==='Or')){const _0x448d40=_0x342f1f[0x0];if(_0x448d40['type']===_0x2c47ca[_0x2b344(0x15c)]&&_0x448d40[_0x2b344(0x12c)])return{'type':_0x2c47ca[_0x2b344(0x15c)],'conditions':_0x448d40['conditions'],..._0x448d40['description']&&{'description':_0x448d40['description']}};}return{'type':_0x2c47ca[_0x2b344(0x15c)],'conditions':_0x342f1f,..._0x2c47ca[_0x2b344(0x163)]&&{'description':_0x2c47ca['description']}};}export async function resolveRuleSegmentRefs(_0x34fcc0,_0x1c162a){const _0x3eae3d=a107_0x1e6e,_0x91181a=await Promise['all'](_0x34fcc0[_0x3eae3d(0x12c)]['map'](_0x88ae3a=>resolveConditionSegmentRefs(_0x88ae3a,_0x1c162a)));return{..._0x34fcc0,'conditions':_0x91181a};}async function resolveConditionSegmentRefs(_0x379fa5,_0x1e83d1){const _0x420c66=a107_0x1e6e;if(_0x420c66(0x126)in _0x379fa5&&(_0x379fa5[_0x420c66(0x15c)]===_0x420c66(0x187)||_0x379fa5['type']===_0x420c66(0x139))){const _0x1b9d45=_0x379fa5;if(/^\d+$/[_0x420c66(0x111)](_0x1b9d45['segment'])){const _0x1acb58=await _0x1e83d1(_0x1b9d45[_0x420c66(0x126)]);return{..._0x1b9d45,'segment':_0x1acb58};}return _0x379fa5;}if(_0x420c66(0x12c)in _0x379fa5&&_0x379fa5[_0x420c66(0x12c)]){const _0xab1173=_0x379fa5,_0x3ade53=await Promise[_0x420c66(0x178)](_0xab1173['conditions'][_0x420c66(0x121)](_0x1ab240=>resolveConditionSegmentRefs(_0x1ab240,_0x1e83d1)));return{..._0xab1173,'conditions':_0x3ade53};}if(_0x420c66(0x114)in _0x379fa5&&_0x379fa5[_0x420c66(0x114)]){const _0x2c040e=_0x379fa5,_0x4fed9b=await resolveRuleSegmentRefs(_0x2c040e[_0x420c66(0x114)],_0x1e83d1);return{..._0x2c040e,'filter':_0x4fed9b};}return _0x379fa5;}export async function resolveRuleSegmentIds(_0x457388,_0x2244c5){const _0x35e763=a107_0x1e6e,_0x530f1a=await Promise[_0x35e763(0x178)](_0x457388[_0x35e763(0x12c)][_0x35e763(0x121)](_0x2ee62f=>resolveConditionSegmentIds(_0x2ee62f,_0x2244c5)));return{..._0x457388,'conditions':_0x530f1a};}async function resolveConditionSegmentIds(_0x5dd53e,_0x49d2b3){const _0x15f89b=a107_0x1e6e;if(_0x15f89b(0x126)in _0x5dd53e&&(_0x5dd53e[_0x15f89b(0x15c)]===_0x15f89b(0x187)||_0x5dd53e['type']===_0x15f89b(0x139))){const _0x32a252=_0x5dd53e;if(!/^\d+$/[_0x15f89b(0x111)](_0x32a252[_0x15f89b(0x126)])){const _0x1d5e9e=await _0x49d2b3(_0x32a252['segment']);return{..._0x32a252,'segment':_0x1d5e9e};}return _0x5dd53e;}if(_0x15f89b(0x12c)in _0x5dd53e&&_0x5dd53e[_0x15f89b(0x12c)]){const _0x25806c=_0x5dd53e,_0x18fd81=await Promise[_0x15f89b(0x178)](_0x25806c[_0x15f89b(0x12c)][_0x15f89b(0x121)](_0x10a63d=>resolveConditionSegmentIds(_0x10a63d,_0x49d2b3)));return{..._0x25806c,'conditions':_0x18fd81};}if(_0x15f89b(0x114)in _0x5dd53e&&_0x5dd53e[_0x15f89b(0x114)]){const _0x2ab2c4=_0x5dd53e,_0x9a5fac=await resolveRuleSegmentIds(_0x2ab2c4['filter'],_0x49d2b3);return{..._0x2ab2c4,'filter':_0x9a5fac};}return _0x5dd53e;}function apiConditionToYaml(_0x41043f){const _0x42f243=a107_0x1e6e;if(_0x41043f[_0x42f243(0x15c)]===_0x42f243(0x170)||_0x41043f[_0x42f243(0x15c)]==='Or'){if(_0x41043f[_0x42f243(0x12c)]){const _0x3f1af3=_0x41043f['conditions'][_0x42f243(0x121)](apiConditionToYaml);if(_0x3f1af3['length']===0x1&&!_0x41043f[_0x42f243(0x163)])return _0x3f1af3[0x0];return{'type':_0x41043f[_0x42f243(0x15c)],'conditions':_0x3f1af3,..._0x41043f[_0x42f243(0x163)]&&{'description':_0x41043f[_0x42f243(0x163)]}};}}if(_0x41043f[_0x42f243(0x15c)]===_0x42f243(0x132)&&_0x41043f[_0x42f243(0x124)]&&_0x41043f['operator']){const _0x58c883=_0x41043f[_0x42f243(0x124)][_0x42f243(0x106)]?{'type':_0x41043f[_0x42f243(0x124)][_0x42f243(0x106)]['type'],..._0x41043f['leftValue'][_0x42f243(0x106)][_0x42f243(0x140)]&&{'groupingColumns':_0x41043f[_0x42f243(0x124)][_0x42f243(0x106)]['groupingColumns']}}:undefined;return{'type':'Value','attribute':_0x41043f[_0x42f243(0x124)]['name']||'','operator':apiOperatorToYaml(_0x41043f[_0x42f243(0x173)]),..._0x41043f['arrayMatching']&&_0x41043f[_0x42f243(0x171)]!==_0x42f243(0x16e)?{'arrayMatching':_0x41043f[_0x42f243(0x171)]}:{},..._0x41043f[_0x42f243(0x139)]?{'exclude':_0x41043f[_0x42f243(0x139)]}:{},..._0x58c883?{'aggregation':_0x58c883}:{},..._0x41043f[_0x42f243(0x124)][_0x42f243(0x180)]?{'source':_0x41043f[_0x42f243(0x124)][_0x42f243(0x180)][_0x42f243(0x16c)]}:{},..._0x41043f[_0x42f243(0x124)]['filter']?{'filter':apiRuleToYaml(_0x41043f[_0x42f243(0x124)][_0x42f243(0x114)])}:{},..._0x41043f['limit']!==undefined&&_0x41043f[_0x42f243(0x167)]!==null?{'limit':_0x41043f[_0x42f243(0x167)]}:{}};}if(_0x41043f[_0x42f243(0x15c)]===_0x42f243(0x172)&&_0x41043f['id'])return{'type':_0x41043f[_0x42f243(0x139)]?_0x42f243(0x139):_0x42f243(0x187),'segment':_0x41043f['id']};return{'type':'And','conditions':[]};}function isTemporalOperator(_0x441e2b){const _0x3e5432=a107_0x1e6e;return _0x441e2b===_0x3e5432(0x17a)||_0x441e2b===_0x3e5432(0x14b);}function getEffectiveValue(_0x48bd2a){const _0x242c91=a107_0x1e6e,_0x17bca1=_0x48bd2a[_0x242c91(0x177)];return _0x48bd2a[_0x242c91(0x123)]??_0x17bca1;}function apiOperatorToYaml(_0x440e6d){const _0x241fbc=a107_0x1e6e;let _0x2ab57f;if(_0x440e6d[_0x241fbc(0x15d)]&&_0x440e6d[_0x241fbc(0x15d)][_0x241fbc(0x15e)]>0x0)_0x2ab57f=_0x440e6d[_0x241fbc(0x15d)];else{if(_0x440e6d[_0x241fbc(0x10c)]!==undefined)_0x2ab57f=_0x440e6d[_0x241fbc(0x10c)];else isTemporalOperator(_0x440e6d[_0x241fbc(0x15c)])&&_0x440e6d[_0x241fbc(0x123)]!==undefined&&(_0x2ab57f=_0x440e6d['value']);}return{'type':mapApiOperatorType(_0x440e6d[_0x241fbc(0x15c)]),..._0x440e6d['not']&&{'not':_0x440e6d[_0x241fbc(0x12d)]},..._0x2ab57f!==undefined&&{'value':_0x2ab57f},..._0x440e6d['unit']&&{'unit':_0x440e6d[_0x241fbc(0x12f)]}};}function mapApiOperatorType(_0x10cfba){return _0x10cfba;}export function segmentDefToCreateRequest(_0x518a80,_0x4c15eb){const _0x131502=a107_0x1e6e,_0x4cead8={'name':_0x518a80[_0x131502(0x16c)]};return _0x518a80['description']&&(_0x4cead8[_0x131502(0x163)]=_0x518a80['description']),_0x518a80[_0x131502(0x110)]&&(_0x4cead8[_0x131502(0x110)]=yamlRuleToApi(_0x518a80['rule'])),_0x518a80[_0x131502(0x13d)]&&(_0x4cead8[_0x131502(0x13d)]=_0x518a80[_0x131502(0x13d)]==='batch'?0x0:_0x518a80['kind']===_0x131502(0x146)?0x1:0x2),_0x518a80[_0x131502(0x105)]!==undefined&&(_0x4cead8[_0x131502(0x14f)]=_0x518a80[_0x131502(0x105)]),_0x4c15eb&&(_0x4cead8['segmentFolderId']=_0x4c15eb),_0x4cead8;}export function segmentDefToUpdateRequest(_0x3f1516){const _0x204d52=a107_0x1e6e,_0x5df6fc={'name':_0x3f1516[_0x204d52(0x16c)]};return _0x3f1516[_0x204d52(0x163)]!==undefined&&(_0x5df6fc['description']=_0x3f1516[_0x204d52(0x163)]),_0x3f1516[_0x204d52(0x110)]&&(_0x5df6fc[_0x204d52(0x110)]=yamlRuleToApi(_0x3f1516['rule'])),_0x3f1516[_0x204d52(0x13d)]&&(_0x5df6fc[_0x204d52(0x13d)]=_0x3f1516[_0x204d52(0x13d)]===_0x204d52(0x127)?0x0:_0x3f1516[_0x204d52(0x13d)]===_0x204d52(0x146)?0x1:0x2),_0x5df6fc;}export function yamlRuleToApi(_0x4268a2,_0x968eb5=![]){const _0x1b4b3d=a107_0x1e6e,_0xe13503=_0x4268a2['conditions']['map'](yamlConditionToApi);if(_0x968eb5){const _0x16813e=_0xe13503[_0x1b4b3d(0x138)](_0xccfd38=>_0xccfd38[_0x1b4b3d(0x15c)]===_0x1b4b3d(0x170)||_0xccfd38[_0x1b4b3d(0x15c)]==='Or');if(!_0x16813e&&_0xe13503[_0x1b4b3d(0x15e)]>0x0)return{'type':_0x4268a2[_0x1b4b3d(0x15c)],'conditions':[{'type':'And','description':_0x4268a2[_0x1b4b3d(0x163)]||'','conditions':_0xe13503}]};}return{'type':_0x4268a2[_0x1b4b3d(0x15c)],'conditions':_0xe13503,..._0x4268a2[_0x1b4b3d(0x163)]&&{'description':_0x4268a2['description']}};}function yamlConditionToApi(_0x48227a){const _0x3aa883=a107_0x1e6e;if('segment'in _0x48227a&&(_0x48227a[_0x3aa883(0x15c)]==='include'||_0x48227a[_0x3aa883(0x15c)]==='exclude')){const _0x16ab75=_0x48227a;return{'type':_0x3aa883(0x172),'id':_0x16ab75[_0x3aa883(0x126)],'exclude':_0x16ab75[_0x3aa883(0x15c)]==='exclude'};}if('type'in _0x48227a&&(_0x48227a[_0x3aa883(0x15c)]===_0x3aa883(0x170)||_0x48227a[_0x3aa883(0x15c)]==='Or')){const _0x2fdee5=_0x48227a;return{'type':_0x2fdee5['type'],'conditions':_0x2fdee5[_0x3aa883(0x12c)][_0x3aa883(0x121)](yamlConditionToApi),..._0x2fdee5['description']&&{'description':_0x2fdee5[_0x3aa883(0x163)]}};}const _0x5acd93=_0x48227a,_0xc5aa03={'type':'Value','leftValue':buildLeftValue(_0x5acd93),'operator':yamlOperatorToApi(_0x5acd93[_0x3aa883(0x173)]),'exclude':_0x5acd93[_0x3aa883(0x139)]??![],'arrayMatching':_0x5acd93[_0x3aa883(0x171)]??'any'};return _0x5acd93['limit']!==undefined&&(_0xc5aa03[_0x3aa883(0x167)]=_0x5acd93[_0x3aa883(0x167)]),_0xc5aa03;}function buildLeftValue(_0xce1f9e){const _0x3d8aeb=a107_0x1e6e,_0x1453af={'name':_0xce1f9e['attribute']};return _0xce1f9e['aggregation']&&(_0x1453af['aggregation']={'type':_0xce1f9e[_0x3d8aeb(0x106)][_0x3d8aeb(0x15c)],..._0xce1f9e[_0x3d8aeb(0x106)]['groupingColumns']&&{'groupingColumns':_0xce1f9e[_0x3d8aeb(0x106)]['groupingColumns']}}),_0xce1f9e[_0x3d8aeb(0x180)]&&(_0x1453af['source']={'name':_0xce1f9e[_0x3d8aeb(0x180)]}),_0xce1f9e[_0x3d8aeb(0x114)]&&(_0x1453af[_0x3d8aeb(0x114)]=yamlRuleToApi(_0xce1f9e[_0x3d8aeb(0x114)])),_0x1453af;}function yamlOperatorToApi(_0x33f395){const _0xf8a56a=a107_0x1e6e,_0x396963={'type':mapYamlOperatorType(_0x33f395[_0xf8a56a(0x15c)]),'not':_0x33f395[_0xf8a56a(0x12d)]??![]},_0x5b32e7=getEffectiveValue(_0x33f395);if(_0x5b32e7!==undefined){if(Array[_0xf8a56a(0x10a)](_0x5b32e7))_0x396963[_0xf8a56a(0x15d)]=_0x5b32e7;else isTemporalOperator(_0x33f395['type'])?_0x396963[_0xf8a56a(0x123)]=_0x5b32e7:_0x396963['rightValue']=_0x5b32e7;}return _0x33f395[_0xf8a56a(0x12f)]&&(_0x396963[_0xf8a56a(0x12f)]=_0x33f395['unit']),_0x396963;}function mapYamlOperatorType(_0x3593bc){return _0x3593bc;}export function toYamlString(_0x2154e3){const _0x496e3d=a107_0x1e6e,_0x244be5=JSON[_0x496e3d(0x18f)](JSON[_0x496e3d(0x112)](_0x2154e3)),_0x2aee7c=a107_0x521346[_0x496e3d(0x112)](_0x244be5,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x56c0c1=[_0x496e3d(0x189)];let _0x579c15=_0x2aee7c;for(const _0x5341e5 of _0x56c0c1){_0x579c15=_0x579c15[_0x496e3d(0x185)](new RegExp('^('+_0x5341e5+')','m'),(_0x5a5ba4,_0x12693f,_0x110b1b)=>{if(_0x110b1b===0x0||_0x579c15[_0x110b1b-0x1]==='\x0a'&&_0x579c15[_0x110b1b-0x2]==='\x0a')return _0x12693f;return'\x0a'+_0x12693f;});}return _0x579c15;}export function parseYamlString(_0x40f406){const _0x37cf86=a107_0x1e6e,_0x78abef=a107_0x521346[_0x37cf86(0x18f)](_0x40f406);if(!_0x78abef[_0x37cf86(0x16c)])throw new Error(_0x37cf86(0x143));if(_0x78abef[_0x37cf86(0x15c)]&&_0x78abef[_0x37cf86(0x15c)]!==_0x37cf86(0x126))throw new Error('YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20'+_0x78abef[_0x37cf86(0x15c)]);return _0x78abef;}export function isSegmentYaml(_0x1e98ca){const _0x4eccf4=a107_0x1e6e;if(typeof _0x1e98ca!==_0x4eccf4(0x190)||_0x1e98ca===null)return![];const _0x3ca1c1=_0x1e98ca;return _0x3ca1c1[_0x4eccf4(0x15c)]===_0x4eccf4(0x126)||_0x3ca1c1['type']===undefined;}export function generateTemplate(_0x283ac2=a107_0x21f8ff(0x115)){const _0x420847=a107_0x21f8ff,_0x20e179={'type':'segment','name':_0x283ac2,'description':'Segment\x20description','rule':{'type':_0x420847(0x170),'conditions':[{'type':_0x420847(0x132),'attribute':'attribute_name','operator':{'type':_0x420847(0x184),'value':_0x420847(0x123)}}]}};return toYamlString(_0x20e179);}export function segmentToYamlString(_0x263387){const _0x3181fd=a107_0x21f8ff,_0xa99eb7=JSON['parse'](JSON[_0x3181fd(0x112)](_0x263387)),_0x19efad=a107_0x521346['stringify'](_0xa99eb7,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3181fd(0x11d)}),_0x4d3434=['rule:','activations:'];let _0x28b86b=_0x19efad;for(const _0x2f4570 of _0x4d3434){_0x28b86b=_0x28b86b['replace'](new RegExp('^('+_0x2f4570+')','m'),(_0x1131f6,_0x2e33ae,_0x1ccd9b)=>{if(_0x1ccd9b===0x0||_0x28b86b[_0x1ccd9b-0x1]==='\x0a'&&_0x28b86b[_0x1ccd9b-0x2]==='\x0a')return _0x2e33ae;return'\x0a'+_0x2e33ae;});}return _0x28b86b;}export function parseSegmentYamlFile(_0x3a8a10){const _0x241b47=a107_0x521346['parse'](_0x3a8a10);if(!_0x241b47['name'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');return _0x241b47;}export function normalizeChildSegmentYaml(_0x24465c){const _0xf52173=a107_0x21f8ff;return{'type':_0xf52173(0x126),'name':_0x24465c[_0xf52173(0x16c)],..._0x24465c[_0xf52173(0x163)]!==undefined&&{'description':_0x24465c[_0xf52173(0x163)]},..._0x24465c[_0xf52173(0x11b)]!==undefined&&{'folder':_0x24465c[_0xf52173(0x11b)]},..._0x24465c['rule']&&{'rule':normalizeRule(_0x24465c[_0xf52173(0x110)])},..._0x24465c[_0xf52173(0x13d)]!==undefined&&{'kind':_0x24465c[_0xf52173(0x13d)]},..._0x24465c[_0xf52173(0x105)]!==undefined&&{'visible':_0x24465c[_0xf52173(0x105)]},..._0x24465c[_0xf52173(0x18c)]&&{'activations':_0x24465c['activations'][_0xf52173(0x121)](normalizeActivation)}};}export function normalizeRule(_0x45081e){const _0x137354=a107_0x21f8ff;return{'type':_0x45081e[_0x137354(0x15c)],'conditions':_0x45081e[_0x137354(0x12c)][_0x137354(0x121)](normalizeCondition),..._0x45081e[_0x137354(0x163)]!==undefined&&{'description':_0x45081e[_0x137354(0x163)]}};}function normalizeCondition(_0x233a7c){const _0x3f7530=a107_0x21f8ff;if(_0x3f7530(0x126)in _0x233a7c&&(_0x233a7c[_0x3f7530(0x15c)]===_0x3f7530(0x187)||_0x233a7c[_0x3f7530(0x15c)]===_0x3f7530(0x139))){const _0x5dfec9=_0x233a7c;return{'type':_0x5dfec9[_0x3f7530(0x15c)],'segment':_0x5dfec9[_0x3f7530(0x126)]};}if(_0x3f7530(0x15c)in _0x233a7c&&(_0x233a7c[_0x3f7530(0x15c)]==='And'||_0x233a7c[_0x3f7530(0x15c)]==='Or')){const _0x245b46=_0x233a7c;return{'type':_0x245b46[_0x3f7530(0x15c)],'conditions':_0x245b46[_0x3f7530(0x12c)]['map'](normalizeCondition),..._0x245b46[_0x3f7530(0x163)]!==undefined&&{'description':_0x245b46[_0x3f7530(0x163)]}};}const _0x1078f1=_0x233a7c;return{'type':_0x3f7530(0x132),'attribute':_0x1078f1[_0x3f7530(0x137)],'operator':normalizeOperator(_0x1078f1[_0x3f7530(0x173)]),..._0x1078f1[_0x3f7530(0x171)]!==undefined&&{'arrayMatching':_0x1078f1['arrayMatching']},..._0x1078f1['exclude']!==undefined&&{'exclude':_0x1078f1[_0x3f7530(0x139)]},..._0x1078f1[_0x3f7530(0x106)]!==undefined&&{'aggregation':_0x1078f1[_0x3f7530(0x106)]},..._0x1078f1[_0x3f7530(0x180)]!==undefined&&{'source':_0x1078f1[_0x3f7530(0x180)]},..._0x1078f1['filter']!==undefined&&{'filter':normalizeRule(_0x1078f1[_0x3f7530(0x114)])},..._0x1078f1['limit']!==undefined&&{'limit':_0x1078f1[_0x3f7530(0x167)]}};}function normalizeOperator(_0x53a372){const _0x3442d7=a107_0x21f8ff,_0xace543=getEffectiveValue(_0x53a372);return{'type':_0x53a372[_0x3442d7(0x15c)],..._0x53a372[_0x3442d7(0x12d)]!==undefined&&{'not':_0x53a372[_0x3442d7(0x12d)]},..._0xace543!==undefined&&{'value':_0xace543},..._0x53a372[_0x3442d7(0x153)]!==undefined&&{'min':_0x53a372[_0x3442d7(0x153)]},..._0x53a372[_0x3442d7(0x160)]!==undefined&&{'max':_0x53a372['max']},..._0x53a372['unit']!==undefined&&{'unit':_0x53a372['unit']},..._0x53a372[_0x3442d7(0x12e)]!==undefined&&{'duration':_0x53a372[_0x3442d7(0x12e)]},..._0x53a372[_0x3442d7(0x122)]!==undefined&&{'from':_0x53a372[_0x3442d7(0x122)]}};}function normalizeActivation(_0xe4a661){const _0x4b2c6f=a107_0x21f8ff;return{'name':_0xe4a661[_0x4b2c6f(0x16c)],'connection':_0xe4a661['connection'],..._0xe4a661[_0x4b2c6f(0x163)]!==undefined&&{'description':_0xe4a661[_0x4b2c6f(0x163)]},..._0xe4a661[_0x4b2c6f(0x108)]!==undefined&&{'all_columns':_0xe4a661[_0x4b2c6f(0x108)]},..._0xe4a661[_0x4b2c6f(0x145)]!==undefined&&{'columns':_0xe4a661['columns']},..._0xe4a661[_0x4b2c6f(0x103)]!==undefined&&{'behavior':_0xe4a661[_0x4b2c6f(0x103)]},..._0xe4a661['schedule']!==undefined&&{'schedule':_0xe4a661[_0x4b2c6f(0x100)]},..._0xe4a661[_0x4b2c6f(0x10e)]!==undefined&&{'notification':_0xe4a661[_0x4b2c6f(0x10e)]},..._0xe4a661[_0x4b2c6f(0x14a)]!==undefined&&{'connector_config':_0xe4a661[_0x4b2c6f(0x14a)]},..._0xe4a661[_0x4b2c6f(0x186)]!==undefined&&{'activation_template_id':_0xe4a661['activation_template_id']}};}export function activationResponseToDef(_0x47a183,_0x43b0db,_0x207f47){const _0x264689=a107_0x21f8ff,_0x192888=_0x47a183[_0x264689(0x149)]||'',_0x31ac24=_0x207f47?.[_0x264689(0x150)](_0x192888)??_0x192888,_0x279fcb={'name':_0x47a183['name'],'connection':_0x31ac24};_0x47a183[_0x264689(0x163)]&&(_0x279fcb[_0x264689(0x163)]=_0x47a183[_0x264689(0x163)]);let _0x2074ed=[];_0x47a183['columns']&&_0x47a183[_0x264689(0x145)]['length']>0x0&&(_0x2074ed=_0x47a183[_0x264689(0x145)][_0x264689(0x114)](_0x72b0ae=>_0x72b0ae&&_0x72b0ae[_0x264689(0x16c)])[_0x264689(0x121)](_0x1d6519=>{const _0x5a624f=_0x264689;if(_0x1d6519['type']||_0x1d6519[_0x5a624f(0x157)])return{'name':_0x1d6519['name'],..._0x1d6519[_0x5a624f(0x15c)]&&{'type':_0x1d6519['type']},..._0x1d6519['visibility']&&{'visibility':_0x1d6519[_0x5a624f(0x157)]}};return _0x1d6519[_0x5a624f(0x16c)];}));_0x2074ed['length']>0x0&&(_0x279fcb[_0x264689(0x145)]=_0x2074ed);_0x47a183[_0x264689(0xfc)]!==undefined&&(_0x47a183[_0x264689(0xfc)]===![]&&_0x2074ed[_0x264689(0x15e)]===0x0?_0x279fcb[_0x264689(0x108)]=!![]:_0x279fcb[_0x264689(0x108)]=_0x47a183[_0x264689(0xfc)]);const _0x160d8e={};let _0x130d07=![];_0x47a183[_0x264689(0x175)]&&(_0x160d8e[_0x264689(0x15c)]=_0x47a183[_0x264689(0x175)],_0x130d07=!![]);_0x47a183[_0x264689(0x16d)]&&(_0x160d8e[_0x264689(0x166)]=_0x47a183[_0x264689(0x16d)],_0x130d07=!![]);_0x47a183[_0x264689(0x154)]!==undefined&&_0x47a183[_0x264689(0x154)]!==null&&(_0x160d8e[_0x264689(0x164)]=_0x47a183[_0x264689(0x154)],_0x130d07=!![]);_0x47a183[_0x264689(0x12b)]&&_0x47a183['repeatSubFrequency'][_0x264689(0x15e)]>0x0&&(_0x160d8e['repeat_sub_frequency']=_0x47a183[_0x264689(0x12b)],_0x130d07=!![]);_0x47a183[_0x264689(0x17c)]!==undefined&&(_0x160d8e['start_at']=_0x47a183['startAt'],_0x130d07=!![]);_0x47a183[_0x264689(0x125)]!==undefined&&(_0x160d8e[_0x264689(0x16f)]=_0x47a183[_0x264689(0x125)],_0x130d07=!![]);_0x47a183[_0x264689(0x11a)]&&(_0x160d8e[_0x264689(0x11a)]=_0x47a183[_0x264689(0x11a)],_0x130d07=!![]);_0x130d07&&(_0x279fcb[_0x264689(0x100)]=_0x160d8e);(_0x47a183[_0x264689(0x15a)]&&_0x47a183[_0x264689(0x15a)][_0x264689(0x15e)]>0x0||_0x47a183[_0x264689(0x129)]&&_0x47a183['emailRecipients'][_0x264689(0x15e)]>0x0)&&(_0x279fcb[_0x264689(0x10e)]={},_0x47a183[_0x264689(0x15a)]&&_0x47a183[_0x264689(0x15a)][_0x264689(0x15e)]>0x0&&(_0x279fcb[_0x264689(0x10e)]['notify_on']=_0x47a183[_0x264689(0x15a)]),_0x47a183[_0x264689(0x129)]&&_0x47a183['emailRecipients']['length']>0x0&&(_0x279fcb[_0x264689(0x10e)][_0x264689(0x14e)]=_0x47a183[_0x264689(0x129)][_0x264689(0x121)](_0x4a2321=>{const _0x5ef1ba=_0x264689,_0x29c305=_0x43b0db?.[_0x5ef1ba(0x150)](_0x4a2321);return _0x29c305??String(_0x4a2321);})));_0x47a183[_0x264689(0xff)]&&Object[_0x264689(0x109)](_0x47a183['connectorConfig'])[_0x264689(0x15e)]>0x0&&(_0x279fcb['connector_config']=normalizeConnectorConfigForYaml(_0x47a183['connectorConfig']));_0x47a183[_0x264689(0x10b)]&&(_0x279fcb[_0x264689(0x186)]=_0x47a183['activationTemplateId']);if(_0x47a183[_0x264689(0x13b)]){const _0xb384c2={},_0x330ef1=_0x47a183[_0x264689(0x13b)];_0x330ef1[_0x264689(0x145)]&&_0x330ef1[_0x264689(0x145)][_0x264689(0x15e)]>0x0&&(_0xb384c2[_0x264689(0x145)]=_0x330ef1[_0x264689(0x145)][_0x264689(0x114)](_0x3945c0=>_0x3945c0&&_0x3945c0['name'])[_0x264689(0x121)](_0x23bcbc=>({'name':_0x23bcbc[_0x264689(0x16c)],..._0x23bcbc[_0x264689(0x15c)]&&{'type':_0x23bcbc[_0x264689(0x15c)]},..._0x23bcbc[_0x264689(0x157)]&&{'visibility':_0x23bcbc[_0x264689(0x157)]}}))),_0x330ef1[_0x264689(0x179)]&&(_0xb384c2[_0x264689(0x18a)]=_0x330ef1['behaviorTableName']),_0x330ef1[_0x264689(0x134)]!==undefined&&(_0xb384c2[_0x264689(0x162)]=_0x330ef1['joinRow']),_0x330ef1[_0x264689(0x183)]&&(_0xb384c2[_0x264689(0x156)]=_0x330ef1[_0x264689(0x183)]),_0x330ef1[_0x264689(0x14d)]&&(_0xb384c2['formatting']=_0x330ef1[_0x264689(0x14d)]),_0x330ef1[_0x264689(0x119)]&&_0x330ef1[_0x264689(0x119)]['length']>0x0&&(_0xb384c2[_0x264689(0x159)]=_0x330ef1['orderBy']),Object[_0x264689(0x109)](_0xb384c2)['length']>0x0&&(_0x279fcb[_0x264689(0x103)]=_0xb384c2);}return _0x279fcb;}export function journeyActivationStepToYaml(_0x61497a,_0x3752ec,_0x21d3d9){const _0x2b0f26=a107_0x21f8ff,_0x7191d9=_0x61497a[_0x2b0f26(0x188)][_0x2b0f26(0x104)],_0x593274=_0x7191d9[_0x2b0f26(0x149)]||'',_0x2229ea=_0x21d3d9?.[_0x2b0f26(0x150)](_0x593274)??_0x593274,_0x251c61={'name':_0x7191d9[_0x2b0f26(0x16c)]||'','connection':_0x2229ea};_0x7191d9['description']&&(_0x251c61[_0x2b0f26(0x163)]=_0x7191d9[_0x2b0f26(0x163)]);let _0xc1a73d=[];_0x7191d9[_0x2b0f26(0x145)]&&_0x7191d9[_0x2b0f26(0x145)][_0x2b0f26(0x15e)]>0x0&&(_0xc1a73d=_0x7191d9[_0x2b0f26(0x145)][_0x2b0f26(0x114)](_0x5a38f2=>_0x5a38f2&&_0x5a38f2[_0x2b0f26(0x16c)])[_0x2b0f26(0x121)](_0xcfc7d0=>{const _0x555c62=_0x2b0f26;if(_0xcfc7d0[_0x555c62(0x15c)]||_0xcfc7d0[_0x555c62(0x157)])return{'name':_0xcfc7d0['name'],..._0xcfc7d0[_0x555c62(0x15c)]&&{'type':_0xcfc7d0[_0x555c62(0x15c)]},..._0xcfc7d0['visibility']&&{'visibility':_0xcfc7d0[_0x555c62(0x157)]}};return _0xcfc7d0[_0x555c62(0x16c)];}));_0xc1a73d[_0x2b0f26(0x15e)]>0x0&&(_0x251c61[_0x2b0f26(0x145)]=_0xc1a73d);_0x7191d9[_0x2b0f26(0xfc)]!==undefined&&(_0x7191d9[_0x2b0f26(0xfc)]===![]&&_0xc1a73d[_0x2b0f26(0x15e)]===0x0?_0x251c61[_0x2b0f26(0x108)]=!![]:_0x251c61[_0x2b0f26(0x108)]=_0x7191d9[_0x2b0f26(0xfc)]);const _0xa92124={};let _0x24611a=![];_0x7191d9[_0x2b0f26(0x175)]&&(_0xa92124[_0x2b0f26(0x15c)]=_0x7191d9['scheduleType'],_0x24611a=!![]);_0x7191d9[_0x2b0f26(0x16d)]&&(_0xa92124[_0x2b0f26(0x166)]=_0x7191d9[_0x2b0f26(0x16d)],_0x24611a=!![]);_0x7191d9[_0x2b0f26(0x154)]!==undefined&&_0x7191d9[_0x2b0f26(0x154)]!==null&&(_0xa92124['repeat_frequency']=_0x7191d9[_0x2b0f26(0x154)],_0x24611a=!![]);_0x7191d9['startAt']!==undefined&&(_0xa92124[_0x2b0f26(0x135)]=_0x7191d9[_0x2b0f26(0x17c)],_0x24611a=!![]);_0x7191d9[_0x2b0f26(0x125)]!==undefined&&(_0xa92124[_0x2b0f26(0x16f)]=_0x7191d9['endOn'],_0x24611a=!![]);_0x7191d9['timezone']&&(_0xa92124[_0x2b0f26(0x11a)]=_0x7191d9['timezone'],_0x24611a=!![]);_0x24611a&&(_0x251c61[_0x2b0f26(0x100)]=_0xa92124);(_0x7191d9[_0x2b0f26(0x15a)]&&_0x7191d9[_0x2b0f26(0x15a)][_0x2b0f26(0x15e)]>0x0||_0x7191d9[_0x2b0f26(0x129)]&&_0x7191d9[_0x2b0f26(0x129)][_0x2b0f26(0x15e)]>0x0)&&(_0x251c61[_0x2b0f26(0x10e)]={},_0x7191d9[_0x2b0f26(0x15a)]&&_0x7191d9[_0x2b0f26(0x15a)]['length']>0x0&&(_0x251c61[_0x2b0f26(0x10e)][_0x2b0f26(0x147)]=_0x7191d9[_0x2b0f26(0x15a)]),_0x7191d9['emailRecipients']&&_0x7191d9[_0x2b0f26(0x129)][_0x2b0f26(0x15e)]>0x0&&(_0x251c61[_0x2b0f26(0x10e)][_0x2b0f26(0x14e)]=_0x7191d9[_0x2b0f26(0x129)]['map'](_0x5dadb7=>{const _0x1069b2=_0x2b0f26,_0x2e2c18=_0x3752ec?.[_0x1069b2(0x150)](_0x5dadb7);return _0x2e2c18??String(_0x5dadb7);})));_0x7191d9[_0x2b0f26(0xff)]&&Object[_0x2b0f26(0x109)](_0x7191d9[_0x2b0f26(0xff)])['length']>0x0&&(_0x251c61[_0x2b0f26(0x14a)]=normalizeConnectorConfigForYaml(_0x7191d9[_0x2b0f26(0xff)]));_0x7191d9['activationTemplateId']&&(_0x251c61['activation_template_id']=_0x7191d9['activationTemplateId']);if(_0x7191d9['syndicationBehavior']){const _0x317e92={},_0x25a763=_0x7191d9[_0x2b0f26(0x13b)];_0x25a763[_0x2b0f26(0x145)]&&_0x25a763[_0x2b0f26(0x145)]['length']>0x0&&(_0x317e92[_0x2b0f26(0x145)]=_0x25a763['columns'][_0x2b0f26(0x114)](_0x109604=>_0x109604&&_0x109604[_0x2b0f26(0x16c)])[_0x2b0f26(0x121)](_0x3e842e=>({'name':_0x3e842e['name'],..._0x3e842e[_0x2b0f26(0x15c)]&&{'type':_0x3e842e[_0x2b0f26(0x15c)]},..._0x3e842e[_0x2b0f26(0x157)]&&{'visibility':_0x3e842e[_0x2b0f26(0x157)]}}))),_0x25a763[_0x2b0f26(0x179)]&&(_0x317e92[_0x2b0f26(0x18a)]=_0x25a763[_0x2b0f26(0x179)]),_0x25a763[_0x2b0f26(0x134)]!==undefined&&(_0x317e92[_0x2b0f26(0x162)]=_0x25a763[_0x2b0f26(0x134)]),_0x25a763[_0x2b0f26(0x183)]&&(_0x317e92['join_strategy']=_0x25a763[_0x2b0f26(0x183)]),_0x25a763['formatting']&&(_0x317e92['formatting']=_0x25a763[_0x2b0f26(0x14d)]),_0x25a763[_0x2b0f26(0x119)]&&_0x25a763[_0x2b0f26(0x119)]['length']>0x0&&(_0x317e92[_0x2b0f26(0x159)]=_0x25a763[_0x2b0f26(0x119)]),Object[_0x2b0f26(0x109)](_0x317e92)['length']>0x0&&(_0x251c61['behavior']=_0x317e92);}return _0x251c61;}export function segmentWithActivationsToYaml(_0x3a287a,_0x146ac4,_0x594716,_0x1e3492,_0x216ce1){const _0x205fd2=a107_0x21f8ff,_0xc40454=segmentResponseToDefSync(_0x3a287a,_0x594716);return _0x146ac4['length']>0x0&&(_0xc40454[_0x205fd2(0x18c)]=_0x146ac4['map'](_0x30e20d=>activationResponseToDef(_0x30e20d,_0x1e3492,_0x216ce1))),_0xc40454;}function normalizeColumn(_0x533870){const _0x1f0c82=a107_0x21f8ff;if(typeof _0x533870===_0x1f0c82(0x15b))return{'name':_0x533870};return{'name':_0x533870[_0x1f0c82(0x16c)],..._0x533870[_0x1f0c82(0x15c)]&&{'type':_0x533870['type']},..._0x533870[_0x1f0c82(0x157)]&&{'visibility':_0x533870[_0x1f0c82(0x157)]}};}export async function activationDefToCreateRequest(_0x5f12a6,_0x2088c3){const _0x58bda2=a107_0x21f8ff,_0x248ed8=_0x2088c3?.[_0x58bda2(0x102)],_0x1b99b=_0x2088c3?.[_0x58bda2(0x101)],_0x90b215=_0x5f12a6[_0x58bda2(0x15f)];let _0x57fd79;const _0xed6d56=parseInt(_0x90b215,0xa);if(!isNaN(_0xed6d56)&&String(_0xed6d56)===_0x90b215)_0x57fd79=_0xed6d56;else{const _0x4abc19=_0x1b99b?.[_0x58bda2(0x150)](_0x90b215);if(_0x4abc19===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x58bda2(0x152)+_0x90b215,undefined,{'helpText':_0x58bda2(0x11c)});_0x57fd79=_0x4abc19;}const _0x409727={'name':_0x5f12a6[_0x58bda2(0x16c)],'connectionId':_0x57fd79};_0x5f12a6[_0x58bda2(0x163)]&&(_0x409727[_0x58bda2(0x163)]=_0x5f12a6[_0x58bda2(0x163)]);let _0x39e7ee=[];_0x5f12a6[_0x58bda2(0x145)]&&_0x5f12a6['columns']['length']>0x0&&(_0x39e7ee=_0x5f12a6['columns'][_0x58bda2(0x114)](_0x171b97=>_0x171b97!=null)[_0x58bda2(0x121)](normalizeColumn));_0x39e7ee[_0x58bda2(0x15e)]>0x0&&(_0x409727[_0x58bda2(0x145)]=_0x39e7ee);_0x5f12a6['all_columns']!==undefined&&(_0x5f12a6[_0x58bda2(0x108)]===![]&&_0x39e7ee[_0x58bda2(0x15e)]===0x0?_0x409727[_0x58bda2(0xfc)]=!![]:_0x409727[_0x58bda2(0xfc)]=_0x5f12a6['all_columns']);if(_0x5f12a6['schedule']){const _0x32f6d7=_0x5f12a6[_0x58bda2(0x100)];_0x32f6d7[_0x58bda2(0x15c)]&&(_0x409727[_0x58bda2(0x175)]=_0x32f6d7['type']),_0x32f6d7[_0x58bda2(0x166)]&&(_0x409727['repeatUnit']=_0x32f6d7[_0x58bda2(0x166)]),_0x32f6d7['repeat_frequency']!==undefined&&(_0x409727[_0x58bda2(0x154)]=_0x32f6d7[_0x58bda2(0x164)]),_0x32f6d7[_0x58bda2(0x107)]&&(_0x409727['repeatSubFrequency']=_0x32f6d7[_0x58bda2(0x107)]),_0x32f6d7[_0x58bda2(0x135)]!==undefined&&(_0x409727[_0x58bda2(0x17c)]=_0x32f6d7[_0x58bda2(0x135)]),_0x32f6d7['end_on']!==undefined&&(_0x409727[_0x58bda2(0x125)]=_0x32f6d7[_0x58bda2(0x16f)]),_0x32f6d7[_0x58bda2(0x11a)]&&(_0x409727[_0x58bda2(0x11a)]=_0x32f6d7['timezone']);}_0x5f12a6['notification']&&(_0x5f12a6[_0x58bda2(0x10e)][_0x58bda2(0x147)]&&(_0x409727[_0x58bda2(0x15a)]=_0x5f12a6[_0x58bda2(0x10e)]['notify_on']),_0x5f12a6[_0x58bda2(0x10e)][_0x58bda2(0x14e)]&&(_0x409727['emailRecipients']=_0x5f12a6[_0x58bda2(0x10e)][_0x58bda2(0x14e)][_0x58bda2(0x121)](_0x16961c=>{const _0x2d3c6e=_0x58bda2,_0x3fe199=Number(_0x16961c);if(!isNaN(_0x3fe199)&&String(_0x3fe199)===_0x16961c)return _0x3fe199;const _0x4b2463=_0x248ed8?.['get'](_0x16961c[_0x2d3c6e(0x13c)]());if(_0x4b2463===undefined)throw new SDKError(ErrorCode[_0x2d3c6e(0x136)],_0x2d3c6e(0x11f)+_0x16961c+_0x2d3c6e(0x131));return _0x4b2463;})));if(_0x5f12a6[_0x58bda2(0x14a)]){const _0x7dd2c=_0x2088c3?.[_0x58bda2(0x16b)]?.[_0x58bda2(0x150)](_0x90b215);if(_0x7dd2c&&_0x2088c3?.['getSchema'])try{const _0x418fd9=await _0x2088c3[_0x58bda2(0x18d)](_0x7dd2c),_0x530f23=validateConnectorConfig(_0x5f12a6['connector_config'],_0x418fd9);if(!_0x530f23[_0x58bda2(0x141)])throw new SDKError(ErrorCode[_0x58bda2(0x14c)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x5f12a6[_0x58bda2(0x16c)]+_0x58bda2(0x176)+formatValidationErrors(_0x530f23[_0x58bda2(0x13f)]),undefined,{'helpText':_0x58bda2(0x12a)+_0x7dd2c+_0x58bda2(0x168)+formatSchemaAsHelp(_0x418fd9)});if(_0x530f23['warnings']['length']>0x0){const _0x2bf5f8=formatValidationWarnings(_0x530f23['warnings']);console['warn'](_0x58bda2(0x130)+_0x5f12a6[_0x58bda2(0x16c)]+'\x22:\x0a'+_0x2bf5f8);}_0x409727[_0x58bda2(0xff)]=transformConfigToLegacy(_0x5f12a6[_0x58bda2(0x14a)],_0x418fd9);}catch(_0x1906bd){if(_0x1906bd instanceof SDKError&&_0x1906bd[_0x58bda2(0x120)]===ErrorCode[_0x58bda2(0x148)])_0x409727['connectorConfig']=_0x5f12a6[_0x58bda2(0x14a)];else throw _0x1906bd;}else _0x409727[_0x58bda2(0xff)]=_0x5f12a6[_0x58bda2(0x14a)];}_0x5f12a6['activation_template_id']!==undefined&&(_0x409727[_0x58bda2(0x10b)]=_0x5f12a6[_0x58bda2(0x186)]);if(_0x5f12a6[_0x58bda2(0x103)]){const _0x454cee=_0x5f12a6[_0x58bda2(0x103)],_0x3b5089={};if(_0x454cee[_0x58bda2(0x145)]&&_0x454cee[_0x58bda2(0x145)][_0x58bda2(0x15e)]>0x0){const _0x8b194c=_0x454cee['columns'][_0x58bda2(0x114)](_0xff0aee=>_0xff0aee&&_0xff0aee[_0x58bda2(0x16c)]);_0x8b194c['length']>0x0&&(_0x3b5089[_0x58bda2(0x145)]=_0x8b194c);}_0x454cee[_0x58bda2(0x18a)]&&(_0x3b5089[_0x58bda2(0x179)]=_0x454cee[_0x58bda2(0x18a)]),_0x454cee[_0x58bda2(0x162)]!==undefined&&(_0x3b5089[_0x58bda2(0x134)]=_0x454cee[_0x58bda2(0x162)]),_0x454cee['join_strategy']&&(_0x3b5089[_0x58bda2(0x183)]=_0x454cee[_0x58bda2(0x156)]),_0x454cee[_0x58bda2(0x14d)]&&(_0x3b5089[_0x58bda2(0x14d)]=_0x454cee['formatting']),_0x454cee['order_by']&&(_0x3b5089[_0x58bda2(0x119)]=_0x454cee['order_by']),_0x409727[_0x58bda2(0x13b)]=_0x3b5089;}return _0x409727;}export async function activationDefToUpdateRequest(_0x1b8971,_0x5113ba){return activationDefToCreateRequest(_0x1b8971,_0x5113ba);}export function deepSortObject(_0x533190){const _0x172848=a107_0x21f8ff;if(_0x533190===null||typeof _0x533190!=='object')return _0x533190;if(Array['isArray'](_0x533190))return _0x533190[_0x172848(0x121)](deepSortObject)[_0x172848(0x17b)]((_0x4148a3,_0x56b320)=>JSON[_0x172848(0x112)](_0x4148a3)[_0x172848(0x116)](JSON[_0x172848(0x112)](_0x56b320)));const _0x57664e={};for(const _0x457fe7 of Object[_0x172848(0x109)](_0x533190)[_0x172848(0x17b)]()){_0x57664e[_0x457fe7]=deepSortObject(_0x533190[_0x457fe7]);}return _0x57664e;}export function serializeRule(_0x1628ba){const _0x183bb5=a107_0x21f8ff;return JSON[_0x183bb5(0x112)](deepSortObject(_0x1628ba));}export function normalizeRuleForMatching(_0x10b335){return normalizeConditionsForMatching(_0x10b335);}function normalizeConditionsForMatching(_0x14acf5){const _0x5b7569=a107_0x21f8ff;if(_0x14acf5===null||typeof _0x14acf5!==_0x5b7569(0x190))return _0x14acf5;if(Array[_0x5b7569(0x10a)](_0x14acf5))return _0x14acf5[_0x5b7569(0x121)](normalizeConditionsForMatching);const _0x3fa307=_0x14acf5;if((_0x3fa307[_0x5b7569(0x15c)]===_0x5b7569(0x187)||_0x3fa307[_0x5b7569(0x15c)]==='exclude')&&typeof _0x3fa307['segment']===_0x5b7569(0x15b))return{..._0x3fa307,'segment':'__SEGMENT_REF__'};const _0x14a8be={};for(const _0x6e619f of Object['keys'](_0x3fa307)){_0x14a8be[_0x6e619f]=normalizeConditionsForMatching(_0x3fa307[_0x6e619f]);}return _0x14a8be;}export function serializeRuleForMatching(_0x5434e0){const _0xee4971=a107_0x21f8ff;return JSON[_0xee4971(0x112)](deepSortObject(normalizeRuleForMatching(_0x5434e0)));}export function expandSegmentReferences(_0x148a7b,_0x6a641a,_0x1edb05=new Set()){return expandConditions(_0x148a7b,_0x6a641a,_0x1edb05);}function expandConditions(_0x5b4898,_0x279d67,_0xaf3b8f){const _0x92ec1e=a107_0x21f8ff;if(_0x5b4898===null||typeof _0x5b4898!==_0x92ec1e(0x190))return _0x5b4898;if(Array[_0x92ec1e(0x10a)](_0x5b4898))return _0x5b4898[_0x92ec1e(0x121)](_0x5f18cd=>expandConditions(_0x5f18cd,_0x279d67,_0xaf3b8f));const _0x41304e=_0x5b4898;if((_0x41304e[_0x92ec1e(0x15c)]===_0x92ec1e(0x187)||_0x41304e[_0x92ec1e(0x15c)]===_0x92ec1e(0x139))&&typeof _0x41304e[_0x92ec1e(0x126)]===_0x92ec1e(0x15b)){const _0x28b6ca=_0x41304e['segment'],_0x10184a=_0x279d67[_0x92ec1e(0x150)](_0x28b6ca);if(_0x10184a&&!_0xaf3b8f[_0x92ec1e(0x142)](_0x28b6ca)){const _0x22c7aa=new Set(_0xaf3b8f);_0x22c7aa[_0x92ec1e(0x144)](_0x28b6ca);const _0x10a2fc=expandConditions(_0x10184a,_0x279d67,_0x22c7aa);return{'type':_0x41304e[_0x92ec1e(0x15c)],'expanded_rule':_0x10a2fc};}return{'type':_0x41304e['type'],'expanded_rule':_0x92ec1e(0x18e)};}const _0x2c0ae9={};for(const _0x40e377 of Object[_0x92ec1e(0x109)](_0x41304e)){_0x2c0ae9[_0x40e377]=expandConditions(_0x41304e[_0x40e377],_0x279d67,_0xaf3b8f);}return _0x2c0ae9;}export function serializeExpandedRule(_0x54239f,_0x2818ea){const _0x150dc5=a107_0x21f8ff,_0x3e936a=expandSegmentReferences(_0x54239f,_0x2818ea);return JSON[_0x150dc5(0x112)](deepSortObject(_0x3e936a));}export function createSegmentNameContext(_0x3877a8){const _0xe7a617=a107_0x21f8ff,_0x1aa9ef=new Set(),_0x5a4fd9=new Map(),_0x52d78a=new Map();if(_0x3877a8)for(const [_0x1b4a93,_0x2466aa]of Object[_0xe7a617(0x165)](_0x3877a8)){if(_0x2466aa[_0xe7a617(0x110)]){const _0xc76aa2=serializeRule(_0x2466aa['rule']);_0x52d78a[_0xe7a617(0x174)](_0xc76aa2,_0x1b4a93),_0x1aa9ef[_0xe7a617(0x144)](_0x1b4a93);}}return{'usedNames':_0x1aa9ef,'ruleHashToName':_0x5a4fd9,'localRuleToName':_0x3877a8?_0x52d78a:undefined};}export function resolveSegmentName(_0x20c177,_0x5e478d,_0x26607d,_0x11862f){const _0x3ba0fa=a107_0x21f8ff,_0x114709=serializeRule(_0x5e478d);if(_0x26607d[_0x3ba0fa(0x118)]){const _0x5ee510=_0x26607d[_0x3ba0fa(0x118)][_0x3ba0fa(0x150)](_0x114709);if(_0x5ee510)return{'name':_0x5ee510,'isDuplicate':![],'isLocalMatch':!![]};}const _0x1d88ed=_0x26607d[_0x3ba0fa(0x10f)]['get'](_0x114709);if(_0x1d88ed)return{'name':_0x1d88ed,'isDuplicate':!![],'isLocalMatch':![]};const _0x2043a4=_0x11862f(_0x20c177);let _0x351080=_0x2043a4||_0x20c177,_0x3e753c=_0x351080,_0x529f9b=0x2;while(_0x26607d['usedNames']['has'](_0x3e753c)){_0x3e753c=_0x351080+'_'+_0x529f9b,_0x529f9b++;}return _0x26607d['usedNames']['add'](_0x3e753c),_0x26607d[_0x3ba0fa(0x10f)][_0x3ba0fa(0x174)](_0x114709,_0x3e753c),{'name':_0x3e753c,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x54e2cf){const _0x287d18=[],_0x524d02=_0x2ccef7=>{const _0x4b6ab7=a107_0x1e6e;if(!_0x2ccef7||typeof _0x2ccef7!==_0x4b6ab7(0x190))return;if(Array[_0x4b6ab7(0x10a)](_0x2ccef7)){_0x2ccef7[_0x4b6ab7(0x117)](_0x524d02);return;}const _0x250165=_0x2ccef7;(_0x250165[_0x4b6ab7(0x15c)]==='include'||_0x250165[_0x4b6ab7(0x15c)]===_0x4b6ab7(0x139))&&typeof _0x250165['segment']===_0x4b6ab7(0x15b)&&_0x287d18[_0x4b6ab7(0x158)](_0x250165[_0x4b6ab7(0x126)]);for(const _0x67b05f of Object['values'](_0x250165)){_0x524d02(_0x67b05f);}};return _0x524d02(_0x54e2cf),_0x287d18;}function a107_0x23ea(){const _0x16365e=['Unknown\x20email\x20recipient:\x20','code','map','from','value','leftValue','endOn','segment','batch','363lIihSM','emailRecipients','Connector:\x20','repeatSubFrequency','conditions','not','duration','unit','connector_config\x20for\x20activation\x20\x22','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','Value','funnel_stage','joinRow','start_at','INVALID_ARGUMENT','attribute','every','exclude','9rVtLWq','syndicationBehavior','toLowerCase','kind','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','errors','groupingColumns','valid','has','YAML\x20config\x20missing\x20required\x20field:\x20name','add','columns','realtime','notify_on','CONNECTOR_SCHEMA_NOT_FOUND','connectionId','connector_config','TimeWithinNext','CONNECTOR_INVALID_CONFIG','formatting','email_recipients','isVisible','get','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Unknown\x20connection:\x20','min','repeatFrequency','\x27:\x20','join_strategy','visibility','push','order_by','notifyOn','string','type','rightValues','length','connection','max','4721066UAZKce','join_row','description','repeat_frequency','entries','repeat_unit','limit','\x0a\x0aAvailable\x20fields:\x0a','].attribute\x20cannot\x20be\x20empty.\x0a','5720539LnLvkO','connectionNameToTypeMap','name','repeatUnit','any','end_on','And','arrayMatching','Reference','operator','set','scheduleType','\x22:\x0a','values','all','behaviorTableName','TimeWithinPast','sort','startAt','1WbXBLk','10lUIVWE','12UFzrOk','source','31162kDnNUD','21440757mGwngU','joinStrategy','Equal','replace','activation_template_id','include','attributes','rule:','behavior_table','3306696DYOHDj','activations','getSchema','__UNRESOLVED__','parse','object','allColumns','resolveSegmentName','600nMDZIZ','connectorConfig','schedule','connectionNameToIdMap','emailToIdMap','behavior','activationParams','visible','aggregation','repeat_sub_frequency','all_columns','keys','isArray','activationTemplateId','rightValue','10lvDGpF','notification','ruleHashToName','rule','test','stringify','1643658xcxmSc','filter','New\x20Segment','localeCompare','forEach','localRuleToName','orderBy','timezone','folder','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','null','JOURNEY_SYNTAX_ERROR'];a107_0x23ea=function(){return _0x16365e;};return a107_0x23ea();}export function validateSegmentRule(_0xb19b32,_0x1b3cb7){const _0x440eeb=a107_0x21f8ff;if(!_0x1b3cb7||!_0x1b3cb7[_0x440eeb(0x12c)])return;for(let _0x32de03=0x0;_0x32de03<_0x1b3cb7[_0x440eeb(0x12c)][_0x440eeb(0x15e)];_0x32de03++){const _0x44ccaa=_0x1b3cb7['conditions'][_0x32de03];if(_0x440eeb(0x15c)in _0x44ccaa&&_0x44ccaa[_0x440eeb(0x15c)]===_0x440eeb(0x132)){const _0x383bbe=_0x44ccaa;if(!_0x383bbe['attribute']||_0x383bbe['attribute']==='')throw new SDKError(ErrorCode[_0x440eeb(0x11e)],_0x440eeb(0x13e)+_0xb19b32+_0x440eeb(0x155)+('conditions['+_0x32de03+_0x440eeb(0x169))+_0x440eeb(0x151));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a108_0x1995(){const _0x2439d7=['push','size','column_name','name','YES','4804EEWTnN','columns','fields','sort','parentColumn','SELECT\x20*\x20FROM\x20(\x0a','tableName','parentTableName','type','data','source','displayName','set','bold','294qbicmS','query','behaviorName','information_schema','column_type','trim','key','5815928gsmCDD','9542160FSfMIh','cyan','replace','verbose','Unknown','error','Fetching\x20schema...','null','\x20\x20\x20\x20','map','behavior','215775dNNOes','Behaviors','dim','varchar','localeCompare','2716716BCZtBj','1695GTjCRO','entries','execute','slice','1541rscpsj','default','4357065SLWTtr','attribute'];a108_0x1995=function(){return _0x2439d7;};return a108_0x1995();}(function(_0x3b396d,_0x22f79b){const _0x3b2aba=a108_0x43bd,_0x5542bf=_0x3b396d();while(!![]){try{const _0x1e1390=parseInt(_0x3b2aba(0x197))/0x1+-parseInt(_0x3b2aba(0x192))/0x2+-parseInt(_0x3b2aba(0x199))/0x3+-parseInt(_0x3b2aba(0x1a0))/0x4*(-parseInt(_0x3b2aba(0x193))/0x5)+-parseInt(_0x3b2aba(0x17a))/0x6*(-parseInt(_0x3b2aba(0x18d))/0x7)+parseInt(_0x3b2aba(0x181))/0x8+parseInt(_0x3b2aba(0x182))/0x9;if(_0x1e1390===_0x22f79b)break;else _0x5542bf['push'](_0x5542bf['shift']());}catch(_0x1bfed3){_0x5542bf['push'](_0x5542bf['shift']());}}}(a108_0x1995,0xdaa87));import a108_0x1baaa3 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a108_0x43bd(_0x37cf90,_0x3d35fb){_0x37cf90=_0x37cf90-0x172;const _0x1995a3=a108_0x1995();let _0x43bdf1=_0x1995a3[_0x37cf90];return _0x43bdf1;}export function buildSchemaResult(_0xd7f78e){const _0x375335=a108_0x43bd,_0x57930f=_0xd7f78e[_0x375335(0x1a1)][_0x375335(0x18b)](_0x179339=>({'column_name':_0x179339['name'],'column_type':_0x179339[_0x375335(0x174)],'null':_0x375335(0x19f),'key':null,'default':null,'extra':null}));return{..._0xd7f78e,'columns':[{'name':_0x375335(0x19d),'type':'varchar'},{'name':_0x375335(0x17e),'type':_0x375335(0x190)},{'name':_0x375335(0x189),'type':_0x375335(0x190)},{'name':_0x375335(0x180),'type':_0x375335(0x190)},{'name':_0x375335(0x198),'type':_0x375335(0x190)},{'name':'extra','type':'varchar'}],'data':_0x57930f};}export async function executeSchemaQuery(_0xcdd592,_0x4052d5,_0x5d91e0){const _0x4bfc2b=a108_0x43bd,_0x5a35e0=_0xcdd592[_0x4bfc2b(0x17f)]()[_0x4bfc2b(0x184)](/;+$/,''),_0x352413=_0x4bfc2b(0x1a5)+_0x5a35e0+'\x0a)\x20AS\x20segment_query\x20LIMIT\x200';_0x5d91e0[_0x4bfc2b(0x185)]&&console[_0x4bfc2b(0x187)]('Schema\x20query:\x0a'+_0x352413);const _0x4b6913=await withProgressSpinner(_0x4bfc2b(0x188),async _0x421152=>{const _0x1c69fd=_0x4bfc2b,_0x4bb77c=await _0x4052d5[_0x1c69fd(0x17b)][_0x1c69fd(0x195)](_0x352413,{'catalog':'td','schema':_0x1c69fd(0x17d),'onJobId':_0x56428a=>{_0x421152['setJobId'](_0x56428a);}});return _0x4bb77c;},{'verbose':_0x5d91e0[_0x4bfc2b(0x185)]});return buildSchemaResult(_0x4b6913[_0x4bfc2b(0x175)]);}export function displayFieldsHumanReadable(_0x25bb43,_0x477954){const _0x3f33a3=a108_0x43bd,_0x3e10eb=_0x25bb43['filter'](_0x20b6c0=>_0x20b6c0['source']===_0x3f33a3(0x19a)),_0x210d90=_0x25bb43['filter'](_0x3676c3=>_0x3676c3[_0x3f33a3(0x176)]===_0x3f33a3(0x18c)),_0x4d3e1a=new Map();for(const _0x2433ac of _0x3e10eb){const _0x29461c=_0x2433ac['groupingName']||_0x2433ac['parentTableName']||'Unknown',_0x6db078=_0x4d3e1a['get'](_0x29461c);_0x6db078?_0x6db078['fields'][_0x3f33a3(0x19b)](_0x2433ac):_0x4d3e1a['set'](_0x29461c,{'displayName':_0x29461c,'tableName':_0x2433ac[_0x3f33a3(0x173)],'fields':[_0x2433ac]});}const _0x5c86ea=new Map();for(const _0x54beea of _0x210d90){const _0x4153cd=_0x54beea[_0x3f33a3(0x17c)]||_0x3f33a3(0x186),_0xf3bba7=_0x5c86ea['get'](_0x4153cd)||[];_0xf3bba7[_0x3f33a3(0x19b)](_0x54beea),_0x5c86ea[_0x3f33a3(0x178)](_0x4153cd,_0xf3bba7);}console[_0x3f33a3(0x187)]('\x0a'+a108_0x1baaa3[_0x3f33a3(0x179)](_0x477954));if(_0x4d3e1a[_0x3f33a3(0x19c)]>0x0){console[_0x3f33a3(0x187)]('\x0a'+a108_0x1baaa3[_0x3f33a3(0x18f)]('Attributes'));const _0x5c9ea8=[..._0x4d3e1a[_0x3f33a3(0x194)]()][_0x3f33a3(0x1a3)]((_0x476e12,_0x3121fc)=>_0x476e12[0x0][_0x3f33a3(0x191)](_0x3121fc[0x0]));for(const [,_0x430b95]of _0x5c9ea8){const _0x2e6766=_0x430b95[_0x3f33a3(0x172)]&&_0x430b95[_0x3f33a3(0x172)]!==_0x430b95['displayName']?'\x20'+a108_0x1baaa3[_0x3f33a3(0x18f)]('('+_0x430b95[_0x3f33a3(0x172)]+')'):'';console['error']('\x20\x20'+a108_0x1baaa3[_0x3f33a3(0x179)](_0x430b95[_0x3f33a3(0x177)])+_0x2e6766);const _0x1724b4=[..._0x430b95[_0x3f33a3(0x1a2)]][_0x3f33a3(0x1a3)]((_0x42231e,_0x1a35d3)=>_0x42231e['name'][_0x3f33a3(0x191)](_0x1a35d3[_0x3f33a3(0x19e)]));for(const _0x32e496 of _0x1724b4){const _0x1ba519=_0x32e496[_0x3f33a3(0x1a4)]&&_0x32e496['parentColumn']!==_0x32e496[_0x3f33a3(0x19e)]?'\x20'+a108_0x1baaa3[_0x3f33a3(0x18f)]('('+_0x32e496[_0x3f33a3(0x1a4)]+')'):'';console[_0x3f33a3(0x187)]('\x20\x20\x20\x20'+_0x32e496[_0x3f33a3(0x19e)]+_0x1ba519+':\x20'+a108_0x1baaa3[_0x3f33a3(0x183)](_0x32e496[_0x3f33a3(0x174)]));}}}if(_0x5c86ea[_0x3f33a3(0x19c)]>0x0){console['error']('\x0a'+a108_0x1baaa3[_0x3f33a3(0x18f)](_0x3f33a3(0x18e)));const _0x1bff8c=[..._0x5c86ea[_0x3f33a3(0x194)]()][_0x3f33a3(0x1a3)]((_0x3e6efe,_0x331c3f)=>_0x3e6efe[0x0][_0x3f33a3(0x191)](_0x331c3f[0x0]));for(const [_0xc26889,_0x40f354]of _0x1bff8c){const _0x505d9e=_0x40f354[0x0],_0xba2a4b=_0x505d9e?.['parentTableName']||'';console['error']('\x20\x20'+a108_0x1baaa3[_0x3f33a3(0x179)](_0xc26889)+(_0xba2a4b?'\x20'+a108_0x1baaa3[_0x3f33a3(0x18f)]('('+_0xba2a4b+')'):''));const _0x41e3f4=[..._0x40f354][_0x3f33a3(0x1a3)]((_0x41783d,_0x3869af)=>_0x41783d['name']['localeCompare'](_0x3869af['name']));for(const _0x2a5611 of _0x41e3f4){const _0x505181=_0x2a5611[_0x3f33a3(0x19e)]['startsWith'](_0xc26889+'.')?_0x2a5611[_0x3f33a3(0x19e)][_0x3f33a3(0x196)](_0xc26889['length']+0x1):_0x2a5611['name'],_0x2a6c4f=_0x2a5611['parentColumn']&&_0x2a5611[_0x3f33a3(0x1a4)]!==_0x505181?'\x20'+a108_0x1baaa3[_0x3f33a3(0x18f)]('('+_0x2a5611[_0x3f33a3(0x1a4)]+')'):'';console[_0x3f33a3(0x187)](_0x3f33a3(0x18a)+_0x505181+_0x2a6c4f+':\x20'+a108_0x1baaa3['cyan'](_0x2a5611[_0x3f33a3(0x174)]));}}}console[_0x3f33a3(0x187)]('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x492cfa,_0x4a9ed0){const _0x4ccf34=a109_0x47dd,_0x47c909=_0x492cfa();while(!![]){try{const _0x2c22c2=-parseInt(_0x4ccf34(0x197))/0x1*(-parseInt(_0x4ccf34(0x19d))/0x2)+-parseInt(_0x4ccf34(0x191))/0x3+parseInt(_0x4ccf34(0x199))/0x4+-parseInt(_0x4ccf34(0x19e))/0x5+parseInt(_0x4ccf34(0x190))/0x6+parseInt(_0x4ccf34(0x193))/0x7+-parseInt(_0x4ccf34(0x192))/0x8;if(_0x2c22c2===_0x4a9ed0)break;else _0x47c909['push'](_0x47c909['shift']());}catch(_0x5344dd){_0x47c909['push'](_0x47c909['shift']());}}}(a109_0x50a7,0xcbc65));import{readdirSync,statSync}from'fs';import a109_0x229d39 from'path';function a109_0x47dd(_0x5b1bd5,_0x21c518){_0x5b1bd5=_0x5b1bd5-0x18c;const _0x50a749=a109_0x50a7();let _0x47dd2c=_0x50a749[_0x5b1bd5];return _0x47dd2c;}export function findYamlFiles(_0x5312d9){const _0x1d12d0=[];function _0x6c5b02(_0x144825){const _0x302f22=a109_0x47dd,_0x1e6a08=readdirSync(_0x144825,{'withFileTypes':!![]});for(const _0x39fcc4 of _0x1e6a08){const _0x352350=a109_0x229d39[_0x302f22(0x198)](_0x144825,_0x39fcc4[_0x302f22(0x196)]);if(_0x39fcc4[_0x302f22(0x18e)]())_0x6c5b02(_0x352350);else(_0x39fcc4[_0x302f22(0x196)][_0x302f22(0x18c)](_0x302f22(0x194))||_0x39fcc4[_0x302f22(0x196)][_0x302f22(0x18c)](_0x302f22(0x18d)))&&_0x1d12d0[_0x302f22(0x18f)](_0x352350);}}return _0x6c5b02(_0x5312d9),_0x1d12d0;}function a109_0x50a7(){const _0x27880b=['.yml','relative','name','3AVVRer','join','2456324RXtZWW','dirname','extname','map','61610dFvJfe','2908685EqJhKp','endsWith','.yaml','isDirectory','push','9458604NMyKPI','3872250wmmlie','9070656FvnRvk','10906350zkUJZd'];a109_0x50a7=function(){return _0x27880b;};return a109_0x50a7();}export function discoverYamlFiles(_0x3d401b){const _0xda0d1=a109_0x47dd,_0x4b9cb5=findYamlFiles(_0x3d401b);return _0x4b9cb5[_0xda0d1(0x19c)](_0x1d60f2=>{const _0x35d697=_0xda0d1,_0x5aab1c=a109_0x229d39[_0x35d697(0x195)](_0x3d401b,_0x1d60f2),_0xa9d4e0=a109_0x229d39[_0x35d697(0x19a)](_0x5aab1c);return{'absolutePath':_0x1d60f2,'relativePath':_0x5aab1c,'folderPath':_0xa9d4e0==='.'?'':_0xa9d4e0};});}export function isYamlFile(_0x341ddc){const _0x24b83e=a109_0x47dd;try{const _0x4d4671=statSync(_0x341ddc);if(!_0x4d4671['isFile']())return![];const _0x7ca256=a109_0x229d39[_0x24b83e(0x19b)](_0x341ddc)['toLowerCase']();return _0x7ca256===_0x24b83e(0x194)||_0x7ca256===_0x24b83e(0x18d);}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a110_0x3eb9(){const _0x155570=['values','merged','length','.yml','description','version_number','11700896RwxFHA','join','string','journeyBundleName','all_columns','557uFtHxX','from','entry_criteria','push','columns','stringify','version','has','decision_point','activation_template_id','milestone','140xoJQCF','yaml','replace','map','steps','notification','conditions','journeyStages','name','schedule','index','some','include','trim','stages','get','type','activation','segment','5581030MHiygd','branches','launched','3384444niNwLM','item','max','activations','slice','bundle_id','behavior','keys','endsWith','versions','20170ryJfkn','sort','match','find','set','goal','startsWith','exclude','segments','toLowerCase','exit_criteria','isArray','with','3404gZZqpg','rule','86406ESZcpe','6368274xhFgZQ','connector_config','latest','attributes','journeys','condition','journey','bundle_name','entries','versionNumber','7092ggeFRy'];a110_0x3eb9=function(){return _0x155570;};return a110_0x3eb9();}(function(_0x229352,_0x4dfe69){const _0x1cc17a=a110_0x5c83,_0x3059aa=_0x229352();while(!![]){try{const _0x50edaf=parseInt(_0x1cc17a(0xfc))/0x1*(-parseInt(_0x1cc17a(0xe3))/0x2)+-parseInt(_0x1cc17a(0xe5))/0x3*(parseInt(_0x1cc17a(0x107))/0x4)+parseInt(_0x1cc17a(0xc9))/0x5+parseInt(_0x1cc17a(0xe6))/0x6+parseInt(_0x1cc17a(0xcc))/0x7+-parseInt(_0x1cc17a(0xf7))/0x8+-parseInt(_0x1cc17a(0xf0))/0x9*(-parseInt(_0x1cc17a(0xd6))/0xa);if(_0x50edaf===_0x4dfe69)break;else _0x3059aa['push'](_0x3059aa['shift']());}catch(_0x520798){_0x3059aa['push'](_0x3059aa['shift']());}}}(a110_0x3eb9,0xcb121));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x4f6860){const _0x241313=a110_0x5c83;return _0x4f6860[_0x241313(0xdf)]()[_0x241313(0x109)](/\s+/g,'_')['replace'](/[^a-z0-9_]/g,'')[_0x241313(0x109)](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x13571c){const _0x459a93=a110_0x5c83,_0x2c113b=_0x13571c[_0x459a93(0xd8)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x2c113b){const _0x32c628=_0x2c113b[0x1][_0x459a93(0xdf)](),_0x13f62c=_0x2c113b[0x2],_0x40be66=_0x13f62c[_0x459a93(0x109)](/-/g,'')[_0x459a93(0xd0)](0x0,0x4)[_0x459a93(0xdf)]();return _0x32c628+'_'+_0x40be66;}const _0x292fd2=_0x13571c[_0x459a93(0xd8)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x292fd2){const _0x59295c=_0x292fd2[0x1],_0x423fc3=_0x292fd2[0x2][_0x459a93(0xdf)](),_0x33cf08=_0x59295c[_0x459a93(0x109)](/-/g,'')[_0x459a93(0xd0)](0x0,0x4)[_0x459a93(0xdf)]();return _0x423fc3+'_'+_0x33cf08;}return undefined;}function stableStringify(_0x50a595){const _0x41421a=a110_0x5c83;if(Array[_0x41421a(0xe1)](_0x50a595))return'['+_0x50a595['map'](_0x1f6103=>stableStringify(_0x1f6103))[_0x41421a(0xf8)](',')+']';if(_0x50a595&&typeof _0x50a595==='object'){const _0x24702f=_0x50a595,_0x530c80=Object[_0x41421a(0xd3)](_0x24702f)[_0x41421a(0xd7)](),_0x8e3258=_0x530c80[_0x41421a(0x10a)](_0x2313c4=>'\x22'+_0x2313c4+'\x22:'+stableStringify(_0x24702f[_0x2313c4]));return'{'+_0x8e3258[_0x41421a(0xf8)](',')+'}';}const _0xb34c9e=JSON[_0x41421a(0x101)](_0x50a595);return _0xb34c9e===undefined?'null':_0xb34c9e;}export function consolidateActivationsByContent(_0x384afe){const _0x2c86ba=a110_0x5c83,_0x5a919c={},_0x10b8d3=new Map(),_0x5bfba0=new Map();for(const _0x53637e of _0x384afe){if(!_0x53637e)continue;for(const [_0x1df5b1,_0x47cdf9]of Object[_0x2c86ba(0xee)](_0x53637e)){const _0x25c817={'connection':_0x47cdf9['connection'],..._0x47cdf9[_0x2c86ba(0xfb)]!==undefined&&{'all_columns':_0x47cdf9[_0x2c86ba(0xfb)]},..._0x47cdf9['columns']!==undefined&&{'columns':_0x47cdf9[_0x2c86ba(0x100)]},..._0x47cdf9[_0x2c86ba(0xd2)]!==undefined&&{'behavior':_0x47cdf9[_0x2c86ba(0xd2)]},..._0x47cdf9['schedule']!==undefined&&{'schedule':_0x47cdf9[_0x2c86ba(0x110)]},..._0x47cdf9['notification']!==undefined&&{'notification':_0x47cdf9[_0x2c86ba(0x10c)]},..._0x47cdf9[_0x2c86ba(0xe7)]!==undefined&&{'connector_config':_0x47cdf9[_0x2c86ba(0xe7)]},..._0x47cdf9[_0x2c86ba(0x105)]!==undefined&&{'activation_template_id':_0x47cdf9[_0x2c86ba(0x105)]}},_0x562797=stableStringify(_0x25c817),_0x3c7da3=_0x5bfba0['get'](_0x562797);_0x3c7da3?_0x10b8d3[_0x2c86ba(0xda)](_0x1df5b1,_0x3c7da3):(_0x5a919c[_0x1df5b1]=_0x47cdf9,_0x10b8d3[_0x2c86ba(0xda)](_0x1df5b1,_0x1df5b1),_0x5bfba0['set'](_0x562797,_0x1df5b1));}}return{'merged':_0x5a919c,'nameMapping':_0x10b8d3};}export function updateActivationReferences(_0x4975e0,_0x2acf83){const _0x16e331=a110_0x5c83;if(!_0x4975e0)return;for(const _0x357868 of _0x4975e0){if(!_0x357868['steps'])continue;for(const _0x28ccda of _0x357868[_0x16e331(0x10b)]){if(_0x28ccda[_0x16e331(0xc6)]===_0x16e331(0xc7)&&_0x28ccda['with']?.[_0x16e331(0xc7)]){const _0x1da8aa=_0x2acf83[_0x16e331(0xc5)](_0x28ccda[_0x16e331(0xe2)][_0x16e331(0xc7)]);_0x1da8aa&&_0x1da8aa!==_0x28ccda['with']['activation']&&(_0x28ccda[_0x16e331(0xe2)][_0x16e331(0xc7)]=_0x1da8aa);}}}}export function consolidateSegmentsByContent(_0x3ba229,_0x424ec6){const _0x183994=a110_0x5c83,_0x434182={},_0x2b21da=new Map(),_0x36c716=new Map();for(const _0x1fe6c1 of _0x3ba229){if(!_0x1fe6c1)continue;for(const [_0x232f67,_0x2403ff]of Object['entries'](_0x1fe6c1)){if(!_0x2403ff[_0x183994(0xe4)]){_0x434182[_0x232f67]=_0x2403ff,_0x2b21da[_0x183994(0xda)](_0x232f67,_0x232f67);continue;}const _0x3a0e9d=_0x2403ff[_0x183994(0xf5)]&&_0x2403ff['description'][_0x183994(0xc3)]()?_0x2403ff['description']:undefined,_0x5c8b53=JSON[_0x183994(0x101)]({'description':_0x3a0e9d,'rule':deepSortObject(_0x2403ff[_0x183994(0xe4)])}),_0xddd464=_0x36c716[_0x183994(0xc5)](_0x5c8b53);if(_0xddd464){const _0xac278={..._0x2403ff[_0x183994(0xf5)]!==undefined&&{'description':_0x2403ff[_0x183994(0xf5)]},'rule':_0x2403ff[_0x183994(0xe4)]?deepSortObject(_0x2403ff['rule']):_0x2403ff[_0x183994(0xe4)]};if(_0x232f67<_0xddd464){_0x434182[_0x232f67]=_0xac278,delete _0x434182[_0xddd464];for(const [_0x5c65e4,_0x3a7e8c]of _0x2b21da[_0x183994(0xee)]()){_0x3a7e8c===_0xddd464&&_0x2b21da[_0x183994(0xda)](_0x5c65e4,_0x232f67);}_0x2b21da[_0x183994(0xda)](_0x232f67,_0x232f67),_0x36c716[_0x183994(0xda)](_0x5c8b53,_0x232f67);}else _0x434182[_0xddd464]=_0xac278,_0x2b21da[_0x183994(0xda)](_0x232f67,_0xddd464);}else{let _0x4e24f6=_0x232f67;if(_0x424ec6){const _0xc6d1fe=_0x424ec6['get'](_0x5c8b53);_0xc6d1fe&&_0xc6d1fe[_0x183994(0xf3)]>0x0&&(_0x4e24f6=_0xc6d1fe[_0x183994(0xd0)]()[_0x183994(0xd7)]()[0x0]);}const _0xc44b7f={..._0x2403ff[_0x183994(0xf5)]!==undefined&&{'description':_0x2403ff[_0x183994(0xf5)]},'rule':_0x2403ff[_0x183994(0xe4)]?deepSortObject(_0x2403ff[_0x183994(0xe4)]):_0x2403ff[_0x183994(0xe4)]};_0x434182[_0x4e24f6]=_0xc44b7f,_0x2b21da['set'](_0x232f67,_0x4e24f6),_0x36c716[_0x183994(0xda)](_0x5c8b53,_0x4e24f6);}}}return{'merged':_0x434182,'nameMapping':_0x2b21da};}export function updateSegmentReferences(_0x416340,_0x41ad64){const _0x3dcecb=a110_0x5c83;if(!_0x416340)return;for(const _0x76d10 of _0x416340){if(_0x76d10[_0x3dcecb(0xfe)]?.[_0x3dcecb(0xc8)]){const _0x31baab=_0x41ad64[_0x3dcecb(0xc5)](_0x76d10[_0x3dcecb(0xfe)][_0x3dcecb(0xc8)]);_0x31baab&&(_0x76d10[_0x3dcecb(0xfe)][_0x3dcecb(0xc8)]=_0x31baab);}if(_0x76d10[_0x3dcecb(0x10b)])for(const _0xddfb72 of _0x76d10['steps']){if(_0xddfb72[_0x3dcecb(0xc6)]===_0x3dcecb(0x104)&&_0xddfb72[_0x3dcecb(0xe2)]?.[_0x3dcecb(0xca)])for(const _0x275126 of _0xddfb72[_0x3dcecb(0xe2)]['branches']){if(_0x275126['segment']){const _0x59997d=_0x41ad64['get'](_0x275126[_0x3dcecb(0xc8)]);_0x59997d&&(_0x275126[_0x3dcecb(0xc8)]=_0x59997d);}}}}}export function updateSegmentRefsInSegments(_0xadf026,_0x28e21f){const _0x1a92a5=a110_0x5c83;for(const _0x5b9aac of Object[_0x1a92a5(0xf1)](_0xadf026)){_0x5b9aac[_0x1a92a5(0xe4)]&&updateSegmentRefsInRule(_0x5b9aac[_0x1a92a5(0xe4)],_0x28e21f);}}function updateSegmentRefsInRule(_0x39db53,_0x17b8a0){const _0x2a552f=a110_0x5c83;if(_0x39db53===null||typeof _0x39db53!=='object')return;if(Array[_0x2a552f(0xe1)](_0x39db53)){for(const _0x18a430 of _0x39db53){updateSegmentRefsInRule(_0x18a430,_0x17b8a0);}return;}const _0x2cb3f1=_0x39db53;if((_0x2cb3f1[_0x2a552f(0xc6)]===_0x2a552f(0xc2)||_0x2cb3f1['type']===_0x2a552f(0xdd))&&typeof _0x2cb3f1[_0x2a552f(0xc8)]===_0x2a552f(0xf9)){const _0x4c05ab=_0x17b8a0[_0x2a552f(0xc5)](_0x2cb3f1[_0x2a552f(0xc8)]);_0x4c05ab&&(_0x2cb3f1[_0x2a552f(0xc8)]=_0x4c05ab);}if(_0x2cb3f1[_0x2a552f(0x10d)]&&Array[_0x2a552f(0xe1)](_0x2cb3f1[_0x2a552f(0x10d)]))for(const _0x57c29c of _0x2cb3f1['conditions']){updateSegmentRefsInRule(_0x57c29c,_0x17b8a0);}}export function buildJourneysArray(_0x36bd60){const _0x138781=a110_0x5c83,_0xf2be8f=Math[_0x138781(0xce)](..._0x36bd60[_0x138781(0x10a)](_0x41b415=>_0x41b415[_0x138781(0xcd)][_0x138781(0xef)]||0x0));return _0x36bd60['map'](_0x5a5f93=>{const _0x19eb98=_0x138781,_0x57cc3f=(_0x5a5f93[_0x19eb98(0xcd)][_0x19eb98(0xef)]||0x0)===_0xf2be8f,_0x34586b=_0x5a5f93[_0x19eb98(0x108)]['journeys']?.[0x0],_0x43be4d={'version':_0x34586b?.[_0x19eb98(0x102)]||_0x5a5f93[_0x19eb98(0x108)][_0x19eb98(0x102)]||_0x5a5f93[_0x19eb98(0xcd)][_0x19eb98(0x10f)],'state':_0x5a5f93[_0x19eb98(0xcd)]['state']===_0x19eb98(0xcb)?_0x19eb98(0xcb):'draft','stages':_0x34586b?.[_0x19eb98(0xc4)]||_0x5a5f93['yaml'][_0x19eb98(0xc4)]||[],'id':_0x34586b?.['id']||_0x5a5f93[_0x19eb98(0x108)]['id'],'version_number':_0x34586b?.[_0x19eb98(0xf6)]||_0x5a5f93['yaml'][_0x19eb98(0xf6)]};return _0x57cc3f&&(_0x43be4d[_0x19eb98(0xe8)]=!![]),_0x43be4d;});}export function buildMergedJourneyDef(_0x4a8f2a,_0x17b906){const _0x465567=a110_0x5c83,_0x5ed0e0=_0x4a8f2a[0x0][_0x465567(0x108)],_0x25fdcc=buildJourneysArray(_0x4a8f2a),{merged:_0xbb1c82,nameMapping:_0x36696c}=consolidateSegmentsByContent(_0x4a8f2a[_0x465567(0x10a)](_0x3a9bab=>_0x3a9bab[_0x465567(0x108)]['segments']),_0x17b906);updateSegmentRefsInSegments(_0xbb1c82,_0x36696c);const _0x2a240c=Array[_0x465567(0xfd)](_0x36696c[_0x465567(0xee)]())[_0x465567(0xc1)](([_0x3028bb,_0x1d3f1d])=>_0x3028bb!==_0x1d3f1d&&_0x3028bb[_0x465567(0xdc)]('entry_criteria'));let _0x27a812=_0xbb1c82,_0x45c741=new Map();if(_0x2a240c){const _0x63f13f=consolidateSegmentsByContent([_0xbb1c82],_0x17b906);_0x27a812=_0x63f13f[_0x465567(0xf2)],_0x45c741=_0x63f13f['nameMapping'];}const _0x4b832b=new Map(_0x36696c);for(const [_0x23e7c8,_0xfee026]of _0x45c741[_0x465567(0xee)]()){_0x4b832b[_0x465567(0xda)](_0x23e7c8,_0xfee026);}for(const [_0x1acbc0,_0x32f4de]of _0x4b832b[_0x465567(0xee)]()){let _0x953776=_0x32f4de,_0x47e3b3=0x0;while(_0x4b832b[_0x465567(0x103)](_0x953776)&&_0x4b832b[_0x465567(0xc5)](_0x953776)!==_0x953776&&_0x47e3b3<MAX_MAPPING_CHAIN_DEPTH){_0x953776=_0x4b832b[_0x465567(0xc5)](_0x953776),_0x47e3b3++;}_0x953776!==_0x32f4de&&_0x4b832b['set'](_0x1acbc0,_0x953776);}for(const _0x1e2122 of _0x25fdcc){updateSegmentReferences(_0x1e2122[_0x465567(0xc4)],_0x4b832b);}const {merged:_0x108b27,nameMapping:_0x25c7d8}=consolidateActivationsByContent(_0x4a8f2a['map'](_0x452d12=>_0x452d12[_0x465567(0x108)][_0x465567(0xcf)]));for(const _0x5c89a8 of _0x25fdcc){updateActivationReferences(_0x5c89a8[_0x465567(0xc4)],_0x25c7d8);}let _0x1a6924=_0x5ed0e0[_0x465567(0xdb)];if(_0x1a6924?.[_0x465567(0xc8)]){const _0x1996e2=_0x4b832b[_0x465567(0xc5)](_0x1a6924[_0x465567(0xc8)]);_0x1996e2&&(_0x1a6924={..._0x1a6924,'segment':_0x1996e2});}for(const _0x35b98e of _0x25fdcc){if(_0x35b98e['goal']?.['segment']){const _0x48c1cd=_0x4b832b[_0x465567(0xc5)](_0x35b98e[_0x465567(0xdb)][_0x465567(0xc8)]);_0x48c1cd&&(_0x35b98e['goal']={..._0x35b98e[_0x465567(0xdb)],'segment':_0x48c1cd});}}return{'type':_0x465567(0xec),'name':_0x5ed0e0['name'],'description':_0x5ed0e0[_0x465567(0xf5)],'goal':_0x1a6924,'reentry':_0x5ed0e0['reentry'],'segments':Object['keys'](_0x27a812)[_0x465567(0xf3)]>0x0?_0x27a812:undefined,'activations':Object[_0x465567(0xd3)](_0x108b27)[_0x465567(0xf3)]>0x0?_0x108b27:undefined,'journeys':_0x25fdcc,'bundle_id':_0x5ed0e0[_0x465567(0xd1)],'bundle_name':_0x5ed0e0[_0x465567(0xed)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x5afde9,_0x2cf9c,_0x1d9e2f,_0x4bc027){const _0x4535f2=a110_0x5c83,_0x285efa=_0x5afde9+':'+_0x2cf9c,_0x56c048=_0x1d9e2f[_0x4535f2(0xc5)](_0x285efa);if(_0x56c048)return _0x56c048;const _0x21ce54=await _0x4bc027(_0x5afde9),_0x2ebad7=_0x21ce54['attributes'][_0x4535f2(0xfa)]||_0x21ce54['attributes'][_0x4535f2(0x10f)],_0x26fb01=_0x21ce54[_0x4535f2(0xe9)][_0x4535f2(0x10e)][_0x4535f2(0xd9)](_0x4f62ae=>String(_0x4f62ae['id'])===String(_0x2cf9c)),_0xeab101=_0x26fb01?.[_0x4535f2(0x10f)]||_0x2cf9c,_0x1e1976={'journeyName':_0x2ebad7,'stageName':_0xeab101};return _0x1d9e2f[_0x4535f2(0xda)](_0x285efa,_0x1e1976),_0x1e1976;}function a110_0x5c83(_0x128396,_0x3ed794){_0x128396=_0x128396-0xc0;const _0x3eb92b=a110_0x3eb9();let _0x5c83db=_0x3eb92b[_0x128396];return _0x5c83db;}export function formatApiJourneyName(_0xc31213,_0x991f88){return _0x991f88+'\x20('+_0xc31213+')';}export function isLocalJourneyRef(_0x363b35){const _0x4efb3b=a110_0x5c83;return _0x363b35[_0x4efb3b(0xd4)](_0x4efb3b(0xf4))||_0x363b35[_0x4efb3b(0xd4)]('.yaml');}export function buildLocalRuleToNameMapping(_0xac36e1){const _0x454857=a110_0x5c83,_0x4e660a=new Map();if(!_0xac36e1)return _0x4e660a;for(const [_0x3e8048,_0x4b84ee]of Object[_0x454857(0xee)](_0xac36e1)){if(_0x4b84ee[_0x454857(0xe4)]){const _0x27f640=serializeRule(_0x4b84ee[_0x454857(0xe4)]),_0x47cd60=_0x4e660a[_0x454857(0xc5)](_0x27f640)||[];_0x47cd60[_0x454857(0xff)](_0x3e8048),_0x4e660a['set'](_0x27f640,_0x47cd60);}}return _0x4e660a;}export function buildLocalRuleToNameMappingFromJourney(_0xf8f929){const _0x35a3c9=a110_0x5c83,_0x2c0634=_0xf8f929[_0x35a3c9(0xde)];if(!_0x2c0634)return new Map();const _0x2b9053=collectSegmentUsageCounts(_0xf8f929),_0x4c0ed0=new Map();let _0x3d6908=0x0;for(const [_0x305f08,_0x59396d]of Object['entries'](_0x2c0634)){if(!_0x59396d[_0x35a3c9(0xe4)]){_0x3d6908++;continue;}const _0x1083b7=serializeRule(_0x59396d['rule']),_0x463d57=_0x4c0ed0['get'](_0x1083b7)||[];_0x463d57[_0x35a3c9(0xff)]({'name':_0x305f08,'index':_0x3d6908}),_0x4c0ed0[_0x35a3c9(0xda)](_0x1083b7,_0x463d57),_0x3d6908++;}const _0x396dde=new Map();for(const [_0x5251c3,_0x3faa6c]of _0x4c0ed0){const _0x4b95cc=_0x3faa6c['slice']()[_0x35a3c9(0xd7)]((_0x1cc2f1,_0x1c7c1c)=>{const _0x586f8b=_0x35a3c9,_0x4fe364=_0x2b9053[_0x586f8b(0xc5)](_0x1cc2f1['name'])||0x0,_0xf2e3f1=_0x2b9053[_0x586f8b(0xc5)](_0x1c7c1c[_0x586f8b(0x10f)])||0x0;if(_0x4fe364!==_0xf2e3f1)return _0xf2e3f1-_0x4fe364;return _0x1cc2f1[_0x586f8b(0xc0)]-_0x1c7c1c[_0x586f8b(0xc0)];})[_0x35a3c9(0x10a)](_0x7c7da6=>_0x7c7da6['name']);_0x396dde[_0x35a3c9(0xda)](_0x5251c3,_0x4b95cc);}return _0x396dde;}export function collectSegmentUsageCounts(_0x104593){const _0x50e083=a110_0x5c83,_0x42ec0d=new Map(),_0x1604f8=_0x5a6981=>{const _0x151b4f=a110_0x5c83;if(!_0x5a6981)return;_0x42ec0d[_0x151b4f(0xda)](_0x5a6981,(_0x42ec0d['get'](_0x5a6981)||0x0)+0x1);},_0x585a2e=_0x1d274d=>{const _0x24578a=a110_0x5c83;for(const _0x3b980d of _0x1d274d){_0x1604f8(_0x3b980d['entry_criteria']?.[_0x24578a(0xc8)]);if(_0x3b980d['exit_criteria'])for(const _0x323e10 of _0x3b980d[_0x24578a(0xe0)]){_0x1604f8(_0x323e10[_0x24578a(0xc8)]);}_0x1604f8(_0x3b980d[_0x24578a(0x106)]?.[_0x24578a(0xc8)]);if(_0x3b980d[_0x24578a(0x10b)])for(const _0x259e51 of _0x3b980d['steps']){if(_0x259e51[_0x24578a(0xc6)]===_0x24578a(0x104))for(const _0x3c79b8 of _0x259e51['with'][_0x24578a(0xca)]){_0x1604f8(_0x3c79b8['segment']);}else _0x259e51['type']==='wait'&&_0x1604f8(_0x259e51[_0x24578a(0xe2)][_0x24578a(0xeb)]?.[_0x24578a(0xc8)]);}}};_0x1604f8(_0x104593['goal']?.[_0x50e083(0xc8)]);if(_0x104593[_0x50e083(0xea)])for(const _0x865d0e of _0x104593[_0x50e083(0xea)]){_0x1604f8(_0x865d0e['goal']?.[_0x50e083(0xc8)]),_0x585a2e(_0x865d0e[_0x50e083(0xc4)]);}_0x104593[_0x50e083(0xc4)]&&_0x585a2e(_0x104593['stages']);if(_0x104593[_0x50e083(0xd5)])for(const _0x1c5e7c of _0x104593[_0x50e083(0xd5)]){_0x585a2e(_0x1c5e7c[_0x50e083(0xc4)]);}return _0x42ec0d;}
|
|
1
|
+
(function(_0xd36b42,_0x1daca4){const _0x1d33ce=a110_0x3579,_0x280eb8=_0xd36b42();while(!![]){try{const _0x57e8f3=parseInt(_0x1d33ce(0x171))/0x1+-parseInt(_0x1d33ce(0x187))/0x2*(-parseInt(_0x1d33ce(0x182))/0x3)+-parseInt(_0x1d33ce(0x16c))/0x4*(parseInt(_0x1d33ce(0x19a))/0x5)+-parseInt(_0x1d33ce(0x197))/0x6*(parseInt(_0x1d33ce(0x16b))/0x7)+parseInt(_0x1d33ce(0x177))/0x8*(-parseInt(_0x1d33ce(0x174))/0x9)+-parseInt(_0x1d33ce(0x18e))/0xa+-parseInt(_0x1d33ce(0x18f))/0xb*(-parseInt(_0x1d33ce(0x17d))/0xc);if(_0x57e8f3===_0x1daca4)break;else _0x280eb8['push'](_0x280eb8['shift']());}catch(_0x47fe1f){_0x280eb8['push'](_0x280eb8['shift']());}}}(a110_0x3f8c,0x9355f));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';function a110_0x3579(_0x3a8d33,_0x38af58){_0x3a8d33=_0x3a8d33-0x164;const _0x3f8cb6=a110_0x3f8c();let _0x3579a6=_0x3f8cb6[_0x3a8d33];return _0x3579a6;}export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x59d1ea){const _0x5b7ba5=a110_0x3579;return _0x59d1ea['toLowerCase']()[_0x5b7ba5(0x1aa)](/\s+/g,'_')[_0x5b7ba5(0x1aa)](/[^a-z0-9_]/g,'')['replace'](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x5d87fd){const _0x52a0fd=a110_0x3579,_0x52b055=_0x5d87fd['match'](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x52b055){const _0x4dd7eb=_0x52b055[0x1][_0x52a0fd(0x190)](),_0x29e526=_0x52b055[0x2],_0x294a38=_0x29e526[_0x52a0fd(0x1aa)](/-/g,'')['slice'](0x0,0x4)[_0x52a0fd(0x190)]();return _0x4dd7eb+'_'+_0x294a38;}const _0x55a8e1=_0x5d87fd[_0x52a0fd(0x18b)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x55a8e1){const _0x12ad40=_0x55a8e1[0x1],_0x56e55e=_0x55a8e1[0x2][_0x52a0fd(0x190)](),_0x17a12d=_0x12ad40['replace'](/-/g,'')[_0x52a0fd(0x198)](0x0,0x4)[_0x52a0fd(0x190)]();return _0x56e55e+'_'+_0x17a12d;}return undefined;}function stableStringify(_0x8690ce){const _0x57b5e8=a110_0x3579;if(Array['isArray'](_0x8690ce))return'['+_0x8690ce['map'](_0x46a7c=>stableStringify(_0x46a7c))[_0x57b5e8(0x1b1)](',')+']';if(_0x8690ce&&typeof _0x8690ce===_0x57b5e8(0x18d)){const _0x3d14e3=_0x8690ce,_0x2d146c=Object[_0x57b5e8(0x1a2)](_0x3d14e3)[_0x57b5e8(0x195)](),_0x2d250d=_0x2d146c[_0x57b5e8(0x1a6)](_0x1778d9=>'\x22'+_0x1778d9+'\x22:'+stableStringify(_0x3d14e3[_0x1778d9]));return'{'+_0x2d250d[_0x57b5e8(0x1b1)](',')+'}';}const _0x249c8e=JSON[_0x57b5e8(0x192)](_0x8690ce);return _0x249c8e===undefined?_0x57b5e8(0x17b):_0x249c8e;}export function consolidateActivationsByContent(_0x99ae31){const _0x9b5b6e=a110_0x3579,_0x4e721a={},_0x4c10cc=new Map(),_0x578ce5=new Map();for(const _0x333cb6 of _0x99ae31){if(!_0x333cb6)continue;for(const [_0x120281,_0x39dddd]of Object['entries'](_0x333cb6)){const _0x124517={'connection':_0x39dddd['connection'],..._0x39dddd[_0x9b5b6e(0x1a1)]!==undefined&&{'all_columns':_0x39dddd['all_columns']},..._0x39dddd[_0x9b5b6e(0x16a)]!==undefined&&{'columns':_0x39dddd[_0x9b5b6e(0x16a)]},..._0x39dddd[_0x9b5b6e(0x183)]!==undefined&&{'behavior':_0x39dddd[_0x9b5b6e(0x183)]},..._0x39dddd[_0x9b5b6e(0x1b3)]!==undefined&&{'schedule':_0x39dddd[_0x9b5b6e(0x1b3)]},..._0x39dddd['notification']!==undefined&&{'notification':_0x39dddd[_0x9b5b6e(0x19e)]},..._0x39dddd[_0x9b5b6e(0x18a)]!==undefined&&{'connector_config':_0x39dddd[_0x9b5b6e(0x18a)]},..._0x39dddd[_0x9b5b6e(0x184)]!==undefined&&{'activation_template_id':_0x39dddd[_0x9b5b6e(0x184)]}},_0x2fb2ea=stableStringify(_0x124517),_0x1bfc86=_0x578ce5[_0x9b5b6e(0x1a7)](_0x2fb2ea);_0x1bfc86?_0x4c10cc['set'](_0x120281,_0x1bfc86):(_0x4e721a[_0x120281]=_0x39dddd,_0x4c10cc[_0x9b5b6e(0x1ae)](_0x120281,_0x120281),_0x578ce5[_0x9b5b6e(0x1ae)](_0x2fb2ea,_0x120281));}}return{'merged':_0x4e721a,'nameMapping':_0x4c10cc};}export function updateActivationReferences(_0x4c588d,_0x37f9f1){const _0x1c2729=a110_0x3579;if(!_0x4c588d)return;for(const _0x312655 of _0x4c588d){if(!_0x312655[_0x1c2729(0x1b0)])continue;for(const _0x19a3e4 of _0x312655[_0x1c2729(0x1b0)]){if(_0x19a3e4[_0x1c2729(0x166)]===_0x1c2729(0x16e)&&_0x19a3e4[_0x1c2729(0x167)]?.['activation']){const _0x4fb97d=_0x37f9f1['get'](_0x19a3e4[_0x1c2729(0x167)][_0x1c2729(0x16e)]);_0x4fb97d&&_0x4fb97d!==_0x19a3e4[_0x1c2729(0x167)]['activation']&&(_0x19a3e4['with']['activation']=_0x4fb97d);}}}}function a110_0x3f8c(){const _0x2d32bc=['16xkHJke','rule','activation','entry_criteria','launched','948969bgQoVt','milestone','item','9kokgge','activations','index','946240eRZhzV','segments','string','bundle_name','null','reentry','272844JdkJyL','latest','stages','goal','length','1111947DogjHF','behavior','activation_template_id','journeyStages','wait','4KGdbOM','find','description','connector_config','match','draft','object','7257150cXvVrP','649maVvlD','toLowerCase','exit_criteria','stringify','branches','endsWith','sort','journey','19272wplBlM','slice','name','703565qlBBRk','yaml','startsWith','.yml','notification','versionNumber','segment','all_columns','keys','some','push','trim','map','get','attributes','isArray','replace','version','journeyBundleName','from','set','decision_point','steps','join','exclude','schedule','version_number','versions','journeys','.yaml','include','has','conditions','type','with','nameMapping','entries','columns','2226tVVHPj'];a110_0x3f8c=function(){return _0x2d32bc;};return a110_0x3f8c();}export function consolidateSegmentsByContent(_0x157c3b,_0x4d54cc){const _0x1329be=a110_0x3579,_0x4ebdb5={},_0xdb1609=new Map(),_0x43c923=new Map();for(const _0x25939b of _0x157c3b){if(!_0x25939b)continue;for(const [_0x2ed690,_0x2416ab]of Object[_0x1329be(0x169)](_0x25939b)){if(!_0x2416ab[_0x1329be(0x16d)]){_0x4ebdb5[_0x2ed690]=_0x2416ab,_0xdb1609['set'](_0x2ed690,_0x2ed690);continue;}const _0x311978=_0x2416ab[_0x1329be(0x189)]&&_0x2416ab['description'][_0x1329be(0x1a5)]()?_0x2416ab[_0x1329be(0x189)]:undefined,_0xa709ed=JSON[_0x1329be(0x192)]({'description':_0x311978,'rule':deepSortObject(_0x2416ab[_0x1329be(0x16d)])}),_0x209178=_0x43c923[_0x1329be(0x1a7)](_0xa709ed);if(_0x209178){const _0x5c8a51={..._0x2416ab[_0x1329be(0x189)]!==undefined&&{'description':_0x2416ab[_0x1329be(0x189)]},'rule':_0x2416ab[_0x1329be(0x16d)]?deepSortObject(_0x2416ab[_0x1329be(0x16d)]):_0x2416ab[_0x1329be(0x16d)]};if(_0x2ed690<_0x209178){_0x4ebdb5[_0x2ed690]=_0x5c8a51,delete _0x4ebdb5[_0x209178];for(const [_0x1afa26,_0x467b2c]of _0xdb1609[_0x1329be(0x169)]()){_0x467b2c===_0x209178&&_0xdb1609['set'](_0x1afa26,_0x2ed690);}_0xdb1609[_0x1329be(0x1ae)](_0x2ed690,_0x2ed690),_0x43c923[_0x1329be(0x1ae)](_0xa709ed,_0x2ed690);}else _0x4ebdb5[_0x209178]=_0x5c8a51,_0xdb1609[_0x1329be(0x1ae)](_0x2ed690,_0x209178);}else{let _0x26b56f=_0x2ed690;if(_0x4d54cc){const _0x1d00ea=_0x4d54cc[_0x1329be(0x1a7)](_0xa709ed);_0x1d00ea&&_0x1d00ea[_0x1329be(0x181)]>0x0&&(_0x26b56f=_0x1d00ea[_0x1329be(0x198)]()[_0x1329be(0x195)]()[0x0]);}const _0x1203b3={..._0x2416ab[_0x1329be(0x189)]!==undefined&&{'description':_0x2416ab[_0x1329be(0x189)]},'rule':_0x2416ab[_0x1329be(0x16d)]?deepSortObject(_0x2416ab[_0x1329be(0x16d)]):_0x2416ab[_0x1329be(0x16d)]};_0x4ebdb5[_0x26b56f]=_0x1203b3,_0xdb1609['set'](_0x2ed690,_0x26b56f),_0x43c923[_0x1329be(0x1ae)](_0xa709ed,_0x26b56f);}}}return{'merged':_0x4ebdb5,'nameMapping':_0xdb1609};}export function updateSegmentReferences(_0x585dd7,_0x43f20c){const _0x482bed=a110_0x3579;if(!_0x585dd7)return;for(const _0x18c504 of _0x585dd7){if(_0x18c504[_0x482bed(0x16f)]?.[_0x482bed(0x1a0)]){const _0x15d19e=_0x43f20c[_0x482bed(0x1a7)](_0x18c504['entry_criteria'][_0x482bed(0x1a0)]);_0x15d19e&&(_0x18c504[_0x482bed(0x16f)][_0x482bed(0x1a0)]=_0x15d19e);}if(_0x18c504[_0x482bed(0x1b0)])for(const _0x23b960 of _0x18c504[_0x482bed(0x1b0)]){if(_0x23b960[_0x482bed(0x166)]===_0x482bed(0x1af)&&_0x23b960[_0x482bed(0x167)]?.[_0x482bed(0x193)])for(const _0x332ede of _0x23b960[_0x482bed(0x167)][_0x482bed(0x193)]){if(_0x332ede[_0x482bed(0x1a0)]){const _0x5ce1c4=_0x43f20c[_0x482bed(0x1a7)](_0x332ede[_0x482bed(0x1a0)]);_0x5ce1c4&&(_0x332ede[_0x482bed(0x1a0)]=_0x5ce1c4);}}}}}export function updateSegmentRefsInSegments(_0x1a51be,_0x58f366){const _0x2c93a2=a110_0x3579;for(const _0x516f92 of Object['values'](_0x1a51be)){_0x516f92[_0x2c93a2(0x16d)]&&updateSegmentRefsInRule(_0x516f92['rule'],_0x58f366);}}function updateSegmentRefsInRule(_0x1b2cc1,_0x141216){const _0x950d53=a110_0x3579;if(_0x1b2cc1===null||typeof _0x1b2cc1!=='object')return;if(Array[_0x950d53(0x1a9)](_0x1b2cc1)){for(const _0x1e1667 of _0x1b2cc1){updateSegmentRefsInRule(_0x1e1667,_0x141216);}return;}const _0x15c16d=_0x1b2cc1;if((_0x15c16d[_0x950d53(0x166)]===_0x950d53(0x1b8)||_0x15c16d['type']===_0x950d53(0x1b2))&&typeof _0x15c16d[_0x950d53(0x1a0)]===_0x950d53(0x179)){const _0x196556=_0x141216[_0x950d53(0x1a7)](_0x15c16d[_0x950d53(0x1a0)]);_0x196556&&(_0x15c16d[_0x950d53(0x1a0)]=_0x196556);}if(_0x15c16d[_0x950d53(0x165)]&&Array[_0x950d53(0x1a9)](_0x15c16d[_0x950d53(0x165)]))for(const _0x529426 of _0x15c16d[_0x950d53(0x165)]){updateSegmentRefsInRule(_0x529426,_0x141216);}}export function buildJourneysArray(_0x1d16e1){const _0x234aed=a110_0x3579,_0x1eb5a5=Math['max'](..._0x1d16e1[_0x234aed(0x1a6)](_0xcb5bfa=>_0xcb5bfa[_0x234aed(0x173)][_0x234aed(0x19f)]||0x0));return _0x1d16e1[_0x234aed(0x1a6)](_0x43c75e=>{const _0x432a04=_0x234aed,_0x5398e7=(_0x43c75e['item'][_0x432a04(0x19f)]||0x0)===_0x1eb5a5,_0x54b8eb=_0x43c75e[_0x432a04(0x19b)]['journeys']?.[0x0],_0x1b0095={'version':_0x54b8eb?.[_0x432a04(0x1ab)]||_0x43c75e[_0x432a04(0x19b)]['version']||_0x43c75e[_0x432a04(0x173)][_0x432a04(0x199)],'state':_0x43c75e[_0x432a04(0x173)]['state']==='launched'?_0x432a04(0x170):_0x432a04(0x18c),'stages':_0x54b8eb?.[_0x432a04(0x17f)]||_0x43c75e['yaml'][_0x432a04(0x17f)]||[],'id':_0x54b8eb?.['id']||_0x43c75e[_0x432a04(0x19b)]['id'],'version_number':_0x54b8eb?.[_0x432a04(0x1b4)]||_0x43c75e['yaml'][_0x432a04(0x1b4)]};return _0x5398e7&&(_0x1b0095[_0x432a04(0x17e)]=!![]),_0x1b0095;});}export function buildMergedJourneyDef(_0x406b34,_0x4f23ea){const _0x312fd1=a110_0x3579,_0x1374f8=_0x406b34[0x0]['yaml'],_0x50e064=buildJourneysArray(_0x406b34),{merged:_0x25f150,nameMapping:_0x450b4e}=consolidateSegmentsByContent(_0x406b34['map'](_0x59bd24=>_0x59bd24['yaml'][_0x312fd1(0x178)]),_0x4f23ea);updateSegmentRefsInSegments(_0x25f150,_0x450b4e);const _0x14da2a=Array[_0x312fd1(0x1ad)](_0x450b4e['entries']())[_0x312fd1(0x1a3)](([_0x261c8b,_0x5a26e1])=>_0x261c8b!==_0x5a26e1&&_0x261c8b[_0x312fd1(0x19c)](_0x312fd1(0x16f)));let _0x5ab163=_0x25f150,_0x12fda5=new Map();if(_0x14da2a){const _0x12c5aa=consolidateSegmentsByContent([_0x25f150],_0x4f23ea);_0x5ab163=_0x12c5aa['merged'],_0x12fda5=_0x12c5aa[_0x312fd1(0x168)];}const _0x4081a1=new Map(_0x450b4e);for(const [_0x164fc3,_0x275835]of _0x12fda5['entries']()){_0x4081a1['set'](_0x164fc3,_0x275835);}for(const [_0x358acf,_0x3cf0c4]of _0x4081a1['entries']()){let _0x463a9a=_0x3cf0c4,_0x83c63b=0x0;while(_0x4081a1[_0x312fd1(0x164)](_0x463a9a)&&_0x4081a1['get'](_0x463a9a)!==_0x463a9a&&_0x83c63b<MAX_MAPPING_CHAIN_DEPTH){_0x463a9a=_0x4081a1[_0x312fd1(0x1a7)](_0x463a9a),_0x83c63b++;}_0x463a9a!==_0x3cf0c4&&_0x4081a1[_0x312fd1(0x1ae)](_0x358acf,_0x463a9a);}for(const _0x2c276f of _0x50e064){updateSegmentReferences(_0x2c276f['stages'],_0x4081a1);}const {merged:_0x37c5bd,nameMapping:_0x12197b}=consolidateActivationsByContent(_0x406b34[_0x312fd1(0x1a6)](_0x5e9117=>_0x5e9117['yaml'][_0x312fd1(0x175)]));for(const _0x5a1c60 of _0x50e064){updateActivationReferences(_0x5a1c60[_0x312fd1(0x17f)],_0x12197b);}let _0x3ca100=_0x1374f8[_0x312fd1(0x180)];if(_0x3ca100?.[_0x312fd1(0x1a0)]){const _0x2b8aee=_0x4081a1['get'](_0x3ca100[_0x312fd1(0x1a0)]);_0x2b8aee&&(_0x3ca100={..._0x3ca100,'segment':_0x2b8aee});}for(const _0x47227c of _0x50e064){if(_0x47227c['goal']?.[_0x312fd1(0x1a0)]){const _0x5adbc4=_0x4081a1['get'](_0x47227c[_0x312fd1(0x180)][_0x312fd1(0x1a0)]);_0x5adbc4&&(_0x47227c[_0x312fd1(0x180)]={..._0x47227c['goal'],'segment':_0x5adbc4});}}return{'type':_0x312fd1(0x196),'name':_0x1374f8[_0x312fd1(0x199)],'description':_0x1374f8[_0x312fd1(0x189)],'goal':_0x3ca100,'reentry':_0x1374f8[_0x312fd1(0x17c)],'segments':Object['keys'](_0x5ab163)[_0x312fd1(0x181)]>0x0?_0x5ab163:undefined,'activations':Object[_0x312fd1(0x1a2)](_0x37c5bd)[_0x312fd1(0x181)]>0x0?_0x37c5bd:undefined,'journeys':_0x50e064,'bundle_id':_0x1374f8['bundle_id'],'bundle_name':_0x1374f8[_0x312fd1(0x17a)]};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x44b545,_0x43edf5,_0x32888d,_0x3d30f2){const _0x401785=a110_0x3579,_0xb0fedd=_0x44b545+':'+_0x43edf5,_0x35bb87=_0x32888d['get'](_0xb0fedd);if(_0x35bb87)return _0x35bb87;const _0x42e5d0=await _0x3d30f2(_0x44b545),_0x53283d=_0x42e5d0['attributes'][_0x401785(0x1ac)]||_0x42e5d0[_0x401785(0x1a8)]['name'],_0x175418=_0x42e5d0[_0x401785(0x1a8)][_0x401785(0x185)][_0x401785(0x188)](_0x9715d7=>String(_0x9715d7['id'])===String(_0x43edf5)),_0x3d0c30=_0x175418?.[_0x401785(0x199)]||_0x43edf5,_0x3f2913={'journeyName':_0x53283d,'stageName':_0x3d0c30};return _0x32888d[_0x401785(0x1ae)](_0xb0fedd,_0x3f2913),_0x3f2913;}export function formatApiJourneyName(_0x296da9,_0x4ff0de){return _0x4ff0de+'\x20('+_0x296da9+')';}export function isLocalJourneyRef(_0x3e3803){const _0x17a9e1=a110_0x3579;return _0x3e3803['endsWith'](_0x17a9e1(0x19d))||_0x3e3803[_0x17a9e1(0x194)](_0x17a9e1(0x1b7));}export function buildLocalRuleToNameMapping(_0x9e2767){const _0x767d9c=a110_0x3579,_0x4734e7=new Map();if(!_0x9e2767)return _0x4734e7;for(const [_0x1f4c90,_0x21e582]of Object[_0x767d9c(0x169)](_0x9e2767)){if(_0x21e582[_0x767d9c(0x16d)]){const _0xc498f9=serializeRule(_0x21e582[_0x767d9c(0x16d)]),_0x17adb6=_0x4734e7[_0x767d9c(0x1a7)](_0xc498f9)||[];_0x17adb6['push'](_0x1f4c90),_0x4734e7[_0x767d9c(0x1ae)](_0xc498f9,_0x17adb6);}}return _0x4734e7;}export function buildLocalRuleToNameMappingFromJourney(_0xa02708){const _0x535830=a110_0x3579,_0xa61e15=_0xa02708[_0x535830(0x178)];if(!_0xa61e15)return new Map();const _0xf214cc=collectSegmentUsageCounts(_0xa02708),_0x29c95f=new Map();let _0x2c2f7f=0x0;for(const [_0x19e4d8,_0x3ec0bf]of Object[_0x535830(0x169)](_0xa61e15)){if(!_0x3ec0bf[_0x535830(0x16d)]){_0x2c2f7f++;continue;}const _0x1801a8=serializeRule(_0x3ec0bf['rule']),_0x45fbc3=_0x29c95f[_0x535830(0x1a7)](_0x1801a8)||[];_0x45fbc3[_0x535830(0x1a4)]({'name':_0x19e4d8,'index':_0x2c2f7f}),_0x29c95f['set'](_0x1801a8,_0x45fbc3),_0x2c2f7f++;}const _0x1f72d8=new Map();for(const [_0xf0fdc8,_0x4c22a8]of _0x29c95f){const _0x4b06c0=_0x4c22a8['slice']()['sort']((_0x216d96,_0x576034)=>{const _0x36a2ff=_0x535830,_0x23458b=_0xf214cc[_0x36a2ff(0x1a7)](_0x216d96['name'])||0x0,_0x3aa207=_0xf214cc[_0x36a2ff(0x1a7)](_0x576034['name'])||0x0;if(_0x23458b!==_0x3aa207)return _0x3aa207-_0x23458b;return _0x216d96[_0x36a2ff(0x176)]-_0x576034[_0x36a2ff(0x176)];})['map'](_0x448efa=>_0x448efa[_0x535830(0x199)]);_0x1f72d8[_0x535830(0x1ae)](_0xf0fdc8,_0x4b06c0);}return _0x1f72d8;}export function collectSegmentUsageCounts(_0x9f64a6){const _0x84d0af=a110_0x3579,_0x41374f=new Map(),_0x560f1f=_0x363e72=>{const _0x28d2d7=a110_0x3579;if(!_0x363e72)return;_0x41374f['set'](_0x363e72,(_0x41374f[_0x28d2d7(0x1a7)](_0x363e72)||0x0)+0x1);},_0x446bb4=_0x40a5e6=>{const _0x1c9276=a110_0x3579;for(const _0x1fdcb4 of _0x40a5e6){_0x560f1f(_0x1fdcb4[_0x1c9276(0x16f)]?.['segment']);if(_0x1fdcb4['exit_criteria'])for(const _0x35f443 of _0x1fdcb4[_0x1c9276(0x191)]){_0x560f1f(_0x35f443['segment']);}_0x560f1f(_0x1fdcb4[_0x1c9276(0x172)]?.[_0x1c9276(0x1a0)]);if(_0x1fdcb4[_0x1c9276(0x1b0)])for(const _0x258c50 of _0x1fdcb4[_0x1c9276(0x1b0)]){if(_0x258c50[_0x1c9276(0x166)]===_0x1c9276(0x1af))for(const _0x545e01 of _0x258c50[_0x1c9276(0x167)][_0x1c9276(0x193)]){_0x560f1f(_0x545e01[_0x1c9276(0x1a0)]);}else _0x258c50[_0x1c9276(0x166)]===_0x1c9276(0x186)&&_0x560f1f(_0x258c50[_0x1c9276(0x167)]['condition']?.[_0x1c9276(0x1a0)]);}}};_0x560f1f(_0x9f64a6[_0x84d0af(0x180)]?.['segment']);if(_0x9f64a6[_0x84d0af(0x1b6)])for(const _0x57d521 of _0x9f64a6[_0x84d0af(0x1b6)]){_0x560f1f(_0x57d521['goal']?.[_0x84d0af(0x1a0)]),_0x446bb4(_0x57d521[_0x84d0af(0x17f)]);}_0x9f64a6['stages']&&_0x446bb4(_0x9f64a6['stages']);if(_0x9f64a6[_0x84d0af(0x1b5)])for(const _0x5060d4 of _0x9f64a6[_0x84d0af(0x1b5)]){_0x446bb4(_0x5060d4[_0x84d0af(0x17f)]);}return _0x41374f;}
|