@treasuredata/tdx 0.23.1 → 0.24.0
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/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/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/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/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/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-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-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/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/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/process.js.map +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(_0x36595f,_0x13a9bb){const _0x878200=a100_0x443c,_0x17905f=_0x36595f();while(!![]){try{const _0x57e968=-parseInt(_0x878200(0xee))/0x1*(parseInt(_0x878200(0xe1))/0x2)+-parseInt(_0x878200(0xed))/0x3+parseInt(_0x878200(0xeb))/0x4*(-parseInt(_0x878200(0xf1))/0x5)+parseInt(_0x878200(0xf0))/0x6*(-parseInt(_0x878200(0xfe))/0x7)+-parseInt(_0x878200(0xfd))/0x8*(-parseInt(_0x878200(0xe3))/0x9)+parseInt(_0x878200(0xe2))/0xa+parseInt(_0x878200(0xe4))/0xb;if(_0x57e968===_0x13a9bb)break;else _0x17905f['push'](_0x17905f['shift']());}catch(_0xf662ab){_0x17905f['push'](_0x17905f['shift']());}}}(a100_0x33a5,0x1b99c));import{readFileSync}from'fs';function a100_0x33a5(){const _0x5d6b86=['trim','isTTY','error','Content\x20contains\x20no\x20SQL\x20statements','676888nVapVi','14tfOlwy','message','142rvIUrg','367190SDxrao','9czqzWg','4489309gqUDAd','test','push','replace','close','\x27:\x20','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','80FuSkku','ENOENT','412188XHoNOY','1361CicOai','\x27\x20not\x20found','324330NBDeuk','18565fiKPsc','join','File\x20\x27','line','stdin\x20','length','Error\x20reading\x20file\x20\x27','toLowerCase'];a100_0x33a5=function(){return _0x5d6b86;};return a100_0x33a5();}import{createInterface}from'readline';export function stripSqlComments(_0x8642aa){const _0x227b16=a100_0x443c;let _0xdf4417=_0x8642aa[_0x227b16(0xe7)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0xdf4417=_0xdf4417['replace'](/--.*$/gm,''),_0xdf4417[_0x227b16(0xf9)]();}function isEscaped(_0x46eabf,_0x317727){let _0x58d8f3=0x0;for(let _0x5b3388=_0x317727-0x1;_0x5b3388>=0x0&&_0x46eabf[_0x5b3388]==='\x5c';_0x5b3388--){_0x58d8f3++;}return _0x58d8f3%0x2===0x1;}export function splitSqlStatements(_0x595b86){const _0x456f6d=a100_0x443c,_0x33c723=stripSqlComments(_0x595b86);if(!_0x33c723)throw new Error(_0x456f6d(0xfc));const _0x368c28=[];let _0x4427ab='',_0x29a477=![],_0x2a737d=![],_0x151f83=![];for(let _0x19215e=0x0;_0x19215e<_0x595b86['length'];_0x19215e++){const _0x107638=_0x595b86[_0x19215e];if(_0x107638==='\x27'&&!isEscaped(_0x595b86,_0x19215e)&&!_0x2a737d&&!_0x151f83)_0x29a477=!_0x29a477;else{if(_0x107638==='\x22'&&!isEscaped(_0x595b86,_0x19215e)&&!_0x29a477&&!_0x151f83)_0x2a737d=!_0x2a737d;else _0x107638==='`'&&!isEscaped(_0x595b86,_0x19215e)&&!_0x29a477&&!_0x2a737d&&(_0x151f83=!_0x151f83);}if(_0x107638===';'&&!_0x29a477&&!_0x2a737d&&!_0x151f83){const _0x397fe2=_0x4427ab[_0x456f6d(0xf9)]();_0x397fe2&&_0x368c28['push'](_0x397fe2),_0x4427ab='';}else _0x4427ab+=_0x107638;}const _0x26c2d0=_0x4427ab[_0x456f6d(0xf9)]();_0x26c2d0&&_0x368c28['push'](_0x26c2d0);const _0x3c2e42=_0x368c28['map'](_0x564587=>_0x564587[_0x456f6d(0xf9)]())['filter'](_0x4cc348=>{const _0x4b55cf=_0x456f6d,_0x35dbcb=stripSqlComments(_0x4cc348);return _0x35dbcb[_0x4b55cf(0xf6)]>0x0;});if(_0x3c2e42[_0x456f6d(0xf6)]===0x0)throw new Error(_0x456f6d(0xfc));return _0x3c2e42;}export function readFileContent(_0x1a9c5e){const _0x4497de=a100_0x443c;try{return readFileSync(_0x1a9c5e,'utf-8');}catch(_0x210d04){const _0x50fe10=_0x210d04['code'];if(_0x50fe10===_0x4497de(0xec))throw new Error(_0x4497de(0xf3)+_0x1a9c5e+_0x4497de(0xef));else{if(_0x50fe10==='EACCES')throw new Error('Permission\x20denied\x20reading\x20file\x20\x27'+_0x1a9c5e+'\x27');else throw new Error(_0x4497de(0xf7)+_0x1a9c5e+_0x4497de(0xe9)+_0x210d04['message']);}}}export function readSqlStatementsFromFile(_0x4c81cb){const _0xc75e9c=a100_0x443c,_0x1f541c=readFileContent(_0x4c81cb);try{return splitSqlStatements(_0x1f541c);}catch(_0x551540){throw new Error(_0xc75e9c(0xf3)+_0x4c81cb+'\x27\x20'+_0x551540[_0xc75e9c(0xe0)][_0xc75e9c(0xf8)]());}}export async function readStdinContent(){const _0x3108db=a100_0x443c;if(process['stdin'][_0x3108db(0xfa)])throw new Error(_0x3108db(0xea));return new Promise((_0x1a61e6,_0x1265b8)=>{const _0x117099=_0x3108db,_0x31fde0=[],_0x174db0=createInterface({'input':process['stdin'],'terminal':![]});_0x174db0['on'](_0x117099(0xf4),_0xe2aa60=>{const _0x292c93=_0x117099;_0x31fde0[_0x292c93(0xe6)](_0xe2aa60);}),_0x174db0['on'](_0x117099(0xe8),()=>{const _0x359e54=_0x117099;_0x1a61e6(_0x31fde0[_0x359e54(0xf2)]('\x0a'));}),_0x174db0['on'](_0x117099(0xfb),_0x5aea9e=>{const _0x5ca171=_0x117099;_0x174db0['close'](),_0x1265b8(new Error('Error\x20reading\x20from\x20stdin:\x20'+_0x5aea9e[_0x5ca171(0xe0)]));});});}export async function readSqlStatementsFromStdin(){const _0x2d6ffe=a100_0x443c,_0x3ec67a=await readStdinContent();try{return splitSqlStatements(_0x3ec67a);}catch(_0x59bdf0){throw new Error(_0x2d6ffe(0xf5)+_0x59bdf0['message'][_0x2d6ffe(0xf8)]());}}function a100_0x443c(_0x436397,_0x3de088){_0x436397=_0x436397-0xe0;const _0x33a51b=a100_0x33a5();let _0x443ceb=_0x33a51b[_0x436397];return _0x443ceb;}export function isSqlFilePath(_0x365350){const _0xda6a23=a100_0x443c;return/\w\.sql$/[_0xda6a23(0xe5)](_0x365350);}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a101_0x4d964a=a101_0x363c;(function(_0x2dcf15,_0x9f4d0d){const _0x52c15a=a101_0x363c,_0x553a47=_0x2dcf15();while(!![]){try{const _0x5c6392=-parseInt(_0x52c15a(0xdf))/0x1+-parseInt(_0x52c15a(0xd2))/0x2*(parseInt(_0x52c15a(0xd1))/0x3)+parseInt(_0x52c15a(0xcb))/0x4+-parseInt(_0x52c15a(0xb9))/0x5+parseInt(_0x52c15a(0xe1))/0x6+parseInt(_0x52c15a(0xe9))/0x7*(parseInt(_0x52c15a(0xbc))/0x8)+parseInt(_0x52c15a(0xd5))/0x9*(parseInt(_0x52c15a(0xdd))/0xa);if(_0x5c6392===_0x9f4d0d)break;else _0x553a47['push'](_0x553a47['shift']());}catch(_0x5648b7){_0x553a47['push'](_0x553a47['shift']());}}}(a101_0x9838,0x82748));function a101_0x363c(_0x1ca538,_0x5b4bfd){_0x1ca538=_0x1ca538-0xb4;const _0x9838cd=a101_0x9838();let _0x363cd1=_0x9838cd[_0x1ca538];return _0x363cd1;}import{TDApiClient}from'./client/td-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function normalizeTimestamp(_0x18f89a){const _0x3dbcaf=a101_0x363c;if(!_0x18f89a)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x3dbcaf(0xb6)](_0x18f89a))return _0x18f89a;return _0x18f89a[_0x3dbcaf(0xca)](_0x3dbcaf(0xde),'Z')[_0x3dbcaf(0xca)]('\x20','T');}export class ScheduleSDK{[a101_0x4d964a(0xc5)];constructor(_0x391718){const _0x54d77b=a101_0x4d964a;this[_0x54d77b(0xc5)]=new TDApiClient(_0x391718);}async['list'](_0x49137a){const _0x264722=a101_0x4d964a,_0x2af3bf=await this['client'][_0x264722(0xb5)](),_0x3b4217=_0x2af3bf['map'](_0x407293=>({..._0x407293,'created_at':normalizeTimestamp(_0x407293['created_at'])??_0x407293[_0x264722(0xe4)]}));if(_0x49137a?.[_0x264722(0xec)]&&_0x49137a[_0x264722(0xec)]>0x0)return _0x3b4217[_0x264722(0xdb)](0x0,_0x49137a['limit']);return _0x3b4217;}async[a101_0x4d964a(0xd3)](_0x2e06d7){const _0x48be25=a101_0x4d964a,_0x5e985a=0x64,_0x32654c=_0x2e06d7?.['limit'],_0x18b0df=[];let _0xead7f8=!![],_0x271e5c,_0xbda615,_0x29e332;if(_0x2e06d7?.[_0x48be25(0xe7)]){const _0xd37760=_0x2e06d7['pattern'][_0x48be25(0xca)](/[.+^${}()|[\]\\]/g,_0x48be25(0xda)),_0x2f4745=_0xd37760[_0x48be25(0xca)](/\*/g,'.*')[_0x48be25(0xca)](/\?/g,'.');_0x29e332=new RegExp('^'+_0x2f4745+'$','i');}while(_0xead7f8&&(!_0x32654c||_0x18b0df[_0x48be25(0xd4)]<_0x32654c)){const _0x83bd5a=await this[_0x48be25(0xc5)]['listQueries']({'anchor_column':'updated_at','sort_direction':_0x48be25(0xcd),'page_size':_0x5e985a,'anchor_id':_0x271e5c,'anchor_value':_0xbda615});let _0x3c3e3c=_0x83bd5a[_0x48be25(0xd8)];_0x2e06d7?.[_0x48be25(0xd9)]&&(_0x3c3e3c=_0x3c3e3c['filter'](_0x1a6ee1=>_0x1a6ee1[_0x48be25(0xe3)]!==null));_0x29e332&&(_0x3c3e3c=_0x3c3e3c[_0x48be25(0xc7)](_0x119d0e=>_0x119d0e[_0x48be25(0xd6)]&&_0x29e332[_0x48be25(0xb6)](_0x119d0e['name'])));_0x18b0df[_0x48be25(0xeb)](..._0x3c3e3c),_0xead7f8=_0x83bd5a[_0x48be25(0xea)]['has_next_page'];if(_0xead7f8&&_0x83bd5a['queries'][_0x48be25(0xd4)]>0x0){const _0x5b1e9c=_0x83bd5a[_0x48be25(0xd8)][_0x83bd5a[_0x48be25(0xd8)][_0x48be25(0xd4)]-0x1];_0x271e5c=_0x5b1e9c['id'],_0xbda615=_0x5b1e9c[_0x48be25(0xc2)];}}const _0x53f073=_0x32654c?_0x18b0df[_0x48be25(0xdb)](0x0,_0x32654c):_0x18b0df;return{'queries':_0x53f073,'pagination':{'has_next_page':_0xead7f8||(_0x32654c?_0x18b0df[_0x48be25(0xd4)]>_0x32654c:![])}};}async['show'](_0xfc9430){const _0x456a30=a101_0x4d964a,_0x2aa8f7=await this[_0x456a30(0xc5)][_0x456a30(0xb5)](),_0x385c7b=_0x2aa8f7[_0x456a30(0xc9)](_0x541a8d=>_0x541a8d[_0x456a30(0xd6)]===_0xfc9430);if(!_0x385c7b)throw new SDKError(ErrorCode[_0x456a30(0xbd)],'Schedule\x20not\x20found:\x20'+_0xfc9430);return{..._0x385c7b,'created_at':normalizeTimestamp(_0x385c7b[_0x456a30(0xe4)])??_0x385c7b['created_at']};}async[a101_0x4d964a(0xdc)](_0x160d39,_0x10dc2e){const _0x1a7a6b=a101_0x4d964a;if(!_0x160d39)throw new SDKError(ErrorCode[_0x1a7a6b(0xcf)],'Schedule\x20name\x20is\x20required');if(!_0x10dc2e[_0x1a7a6b(0xe6)])throw new SDKError(ErrorCode[_0x1a7a6b(0xcf)],'Database\x20is\x20required');if(!_0x10dc2e[_0x1a7a6b(0xb8)])throw new SDKError(ErrorCode[_0x1a7a6b(0xcf)],_0x1a7a6b(0xe8));if(!_0x10dc2e['type'])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1a7a6b(0xed));return await this[_0x1a7a6b(0xc5)][_0x1a7a6b(0xbf)](_0x160d39,_0x10dc2e);}async['update'](_0x460076,_0x383466){const _0x45266a=a101_0x4d964a;if(!_0x460076)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x45266a(0xe5));return await this[_0x45266a(0xc5)][_0x45266a(0xd7)](_0x460076,_0x383466);}async[a101_0x4d964a(0xb4)](_0x43853f){const _0x44496e=a101_0x4d964a;if(!_0x43853f)throw new SDKError(ErrorCode[_0x44496e(0xcf)],'Schedule\x20name\x20is\x20required');return await this[_0x44496e(0xc5)][_0x44496e(0xcc)](_0x43853f);}async[a101_0x4d964a(0xc0)](_0x5c6e4d,_0x4b6f17){const _0x375317=a101_0x4d964a;if(!_0x5c6e4d)throw new SDKError(ErrorCode[_0x375317(0xcf)],_0x375317(0xe5));let _0x231bec;if(_0x4b6f17?.[_0x375317(0xc8)]){const _0x681ee5=typeof _0x4b6f17[_0x375317(0xc8)]===_0x375317(0xba)?new Date(_0x4b6f17[_0x375317(0xc8)]):_0x4b6f17[_0x375317(0xc8)];if(isNaN(_0x681ee5[_0x375317(0xc6)]()))throw new SDKError(ErrorCode[_0x375317(0xcf)],'Invalid\x20time\x20format:\x20'+_0x4b6f17[_0x375317(0xc8)]);_0x231bec=Math[_0x375317(0xbe)](_0x681ee5[_0x375317(0xc6)]()/0x3e8);}else _0x231bec=Math[_0x375317(0xbe)](Date[_0x375317(0xe2)]()/0x3e8);if(_0x4b6f17?.[_0x375317(0xc1)]!==undefined){if(_0x4b6f17[_0x375317(0xc1)]<0x1||_0x4b6f17['num']>0xa)throw new SDKError(ErrorCode[_0x375317(0xcf)],_0x375317(0xc3));}return await this[_0x375317(0xc5)][_0x375317(0xe0)](_0x5c6e4d,_0x231bec,_0x4b6f17?.[_0x375317(0xc1)]);}async['history'](_0x36c772,_0x112941){const _0x203dbc=a101_0x4d964a;if(!_0x36c772)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x203dbc(0xe5));const _0x4dacac=await this[_0x203dbc(0xc5)][_0x203dbc(0xce)](_0x36c772,_0x112941);return{..._0x4dacac,'history':_0x4dacac[_0x203dbc(0xd0)][_0x203dbc(0xc4)](_0x217c59=>({..._0x217c59,'created_at':normalizeTimestamp(_0x217c59[_0x203dbc(0xe4)]),'start_at':normalizeTimestamp(_0x217c59[_0x203dbc(0xbb)]),'end_at':normalizeTimestamp(_0x217c59[_0x203dbc(0xb7)])}))};}}function a101_0x9838(){const _0x52707e=['replace','492736lrVWYK','deleteSchedule','desc','getScheduleHistory','INVALID_ARGUMENT','history','1979709vUuRbO','2geGtHQ','listQueries','length','657KfaNrb','name','updateSchedule','queries','scheduled','\x5c$&','slice','create','120340PTufZs','\x20UTC','412780TVpKnp','runSchedule','1228434FAMiQa','now','cron','created_at','Schedule\x20name\x20is\x20required','database','pattern','Query\x20is\x20required','306698ZVnRJO','pagination','push','limit','Type\x20is\x20required','delete','listSchedules','test','end_at','query','844800orBFYx','string','start_at','104HpBAuN','NOT_FOUND','floor','createSchedule','run','num','updated_at','num\x20must\x20be\x20between\x201\x20and\x2010','map','client','getTime','filter','time','find'];a101_0x9838=function(){return _0x52707e;};return a101_0x9838();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x35331b,_0x41faa2){const _0x348ff1=a102_0x417c,_0x1a51af=_0x35331b();while(!![]){try{const _0x1f6fe2=parseInt(_0x348ff1(0x1b8))/0x1*(parseInt(_0x348ff1(0x1db))/0x2)+-parseInt(_0x348ff1(0x170))/0x3*(parseInt(_0x348ff1(0x1c8))/0x4)+parseInt(_0x348ff1(0x184))/0x5+parseInt(_0x348ff1(0x188))/0x6+parseInt(_0x348ff1(0x16e))/0x7+parseInt(_0x348ff1(0x1cc))/0x8+-parseInt(_0x348ff1(0x185))/0x9*(parseInt(_0x348ff1(0x175))/0xa);if(_0x1f6fe2===_0x41faa2)break;else _0x1a51af['push'](_0x1a51af['shift']());}catch(_0x47a9d4){_0x1a51af['push'](_0x1a51af['shift']());}}}(a102_0x5466,0xb1fc9));import*as a102_0xf1f92b from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x8137a5,_0x3501aa){const _0x48102b=a102_0x417c,_0x3d4958=_0x8137a5['rule']&&'type'in _0x8137a5[_0x48102b(0x19e)]&&_0x8137a5[_0x48102b(0x19e)][_0x48102b(0x1d2)];return{'type':_0x48102b(0x1d5),'name':_0x8137a5[_0x48102b(0x1eb)],..._0x8137a5[_0x48102b(0x1f1)]&&{'description':_0x8137a5[_0x48102b(0x1f1)]},..._0x3501aa&&{'folder':_0x3501aa},..._0x3d4958&&{'rule':apiRuleToYaml(_0x8137a5['rule'])},..._0x8137a5[_0x48102b(0x16a)]!==undefined&&{'kind':_0x8137a5[_0x48102b(0x16a)]===0x0?_0x48102b(0x187):_0x8137a5[_0x48102b(0x16a)]===0x1?_0x48102b(0x1f6):_0x48102b(0x1c2)},..._0x8137a5[_0x48102b(0x1e2)]!==undefined&&{'visible':_0x8137a5[_0x48102b(0x1e2)]}};}export async function segmentResponseToDef(_0x23a1e3,_0x2547ea,_0x35d14f){const _0x2fc62d=a102_0x417c,_0x48b824=segmentResponseToDefSync(_0x23a1e3,_0x35d14f);if(!_0x2547ea||!_0x2547ea[_0x2fc62d(0x1ed)])return _0x48b824;return _0x48b824[_0x2fc62d(0x19e)]&&(_0x48b824[_0x2fc62d(0x19e)]=await resolveRuleSegmentRefs(_0x48b824[_0x2fc62d(0x19e)],_0x2547ea['resolveSegmentName'])),_0x48b824;}export function apiRuleToYaml(_0x181b4a){const _0x1d0eae=a102_0x417c,_0x45bff3=(_0x181b4a['conditions']||[])[_0x1d0eae(0x16b)](apiConditionToYaml);if(_0x45bff3[_0x1d0eae(0x172)]===0x1&&!_0x181b4a['description']&&_0x1d0eae(0x1d2)in _0x45bff3[0x0]&&(_0x45bff3[0x0][_0x1d0eae(0x1d2)]===_0x1d0eae(0x1a6)||_0x45bff3[0x0]['type']==='Or')){const _0x3038fa=_0x45bff3[0x0];if(_0x3038fa['type']===_0x181b4a['type']&&_0x3038fa['conditions'])return{'type':_0x181b4a[_0x1d0eae(0x1d2)],'conditions':_0x3038fa[_0x1d0eae(0x1a0)],..._0x3038fa['description']&&{'description':_0x3038fa[_0x1d0eae(0x1f1)]}};}return{'type':_0x181b4a['type'],'conditions':_0x45bff3,..._0x181b4a[_0x1d0eae(0x1f1)]&&{'description':_0x181b4a[_0x1d0eae(0x1f1)]}};}export async function resolveRuleSegmentRefs(_0x2ffb10,_0x2fa4d0){const _0x113bec=a102_0x417c,_0x12b73a=await Promise[_0x113bec(0x17d)](_0x2ffb10[_0x113bec(0x1a0)][_0x113bec(0x16b)](_0x23ed68=>resolveConditionSegmentRefs(_0x23ed68,_0x2fa4d0)));return{..._0x2ffb10,'conditions':_0x12b73a};}async function resolveConditionSegmentRefs(_0x310c46,_0x447402){const _0x10cf03=a102_0x417c;if(_0x10cf03(0x1d5)in _0x310c46&&(_0x310c46[_0x10cf03(0x1d2)]===_0x10cf03(0x199)||_0x310c46['type']===_0x10cf03(0x19c))){const _0x269416=_0x310c46;if(/^\d+$/[_0x10cf03(0x1ef)](_0x269416[_0x10cf03(0x1d5)])){const _0x4d0c83=await _0x447402(_0x269416['segment']);return{..._0x269416,'segment':_0x4d0c83};}return _0x310c46;}if(_0x10cf03(0x1a0)in _0x310c46&&_0x310c46[_0x10cf03(0x1a0)]){const _0x277d9f=_0x310c46,_0x2f8e42=await Promise['all'](_0x277d9f['conditions'][_0x10cf03(0x16b)](_0xd208ac=>resolveConditionSegmentRefs(_0xd208ac,_0x447402)));return{..._0x277d9f,'conditions':_0x2f8e42};}if(_0x10cf03(0x1b7)in _0x310c46&&_0x310c46[_0x10cf03(0x1b7)]){const _0x3ebf1b=_0x310c46,_0x32d9a3=await resolveRuleSegmentRefs(_0x3ebf1b['filter'],_0x447402);return{..._0x3ebf1b,'filter':_0x32d9a3};}return _0x310c46;}export async function resolveRuleSegmentIds(_0x18fc54,_0x344ff6){const _0x160a28=a102_0x417c,_0x207740=await Promise[_0x160a28(0x17d)](_0x18fc54[_0x160a28(0x1a0)][_0x160a28(0x16b)](_0x83ccc9=>resolveConditionSegmentIds(_0x83ccc9,_0x344ff6)));return{..._0x18fc54,'conditions':_0x207740};}async function resolveConditionSegmentIds(_0x4315da,_0x3928c4){const _0x2636f7=a102_0x417c;if('segment'in _0x4315da&&(_0x4315da[_0x2636f7(0x1d2)]===_0x2636f7(0x199)||_0x4315da[_0x2636f7(0x1d2)]===_0x2636f7(0x19c))){const _0x3157e5=_0x4315da;if(!/^\d+$/[_0x2636f7(0x1ef)](_0x3157e5[_0x2636f7(0x1d5)])){const _0x4a5843=await _0x3928c4(_0x3157e5[_0x2636f7(0x1d5)]);return{..._0x3157e5,'segment':_0x4a5843};}return _0x4315da;}if(_0x2636f7(0x1a0)in _0x4315da&&_0x4315da[_0x2636f7(0x1a0)]){const _0xf976e9=_0x4315da,_0x23b5bd=await Promise[_0x2636f7(0x17d)](_0xf976e9[_0x2636f7(0x1a0)][_0x2636f7(0x16b)](_0x4da9f5=>resolveConditionSegmentIds(_0x4da9f5,_0x3928c4)));return{..._0xf976e9,'conditions':_0x23b5bd};}if(_0x2636f7(0x1b7)in _0x4315da&&_0x4315da[_0x2636f7(0x1b7)]){const _0x5a6491=_0x4315da,_0x5570ab=await resolveRuleSegmentIds(_0x5a6491['filter'],_0x3928c4);return{..._0x5a6491,'filter':_0x5570ab};}return _0x4315da;}function apiConditionToYaml(_0x1e220b){const _0x3be572=a102_0x417c;if(_0x1e220b[_0x3be572(0x1d2)]===_0x3be572(0x1a6)||_0x1e220b[_0x3be572(0x1d2)]==='Or'){if(_0x1e220b[_0x3be572(0x1a0)]){const _0x347769=_0x1e220b[_0x3be572(0x1a0)][_0x3be572(0x16b)](apiConditionToYaml);if(_0x347769['length']===0x1&&!_0x1e220b[_0x3be572(0x1f1)])return _0x347769[0x0];return{'type':_0x1e220b[_0x3be572(0x1d2)],'conditions':_0x347769,..._0x1e220b[_0x3be572(0x1f1)]&&{'description':_0x1e220b[_0x3be572(0x1f1)]}};}}if(_0x1e220b['type']===_0x3be572(0x17a)&&_0x1e220b[_0x3be572(0x1d4)]&&_0x1e220b[_0x3be572(0x16c)]){const _0x5b2def=_0x1e220b[_0x3be572(0x1d4)]['aggregation']?{'type':_0x1e220b[_0x3be572(0x1d4)]['aggregation'][_0x3be572(0x1d2)],..._0x1e220b['leftValue'][_0x3be572(0x18d)][_0x3be572(0x1f0)]&&{'groupingColumns':_0x1e220b[_0x3be572(0x1d4)][_0x3be572(0x18d)][_0x3be572(0x1f0)]}}:undefined;return{'type':_0x3be572(0x17a),'attribute':_0x1e220b[_0x3be572(0x1d4)][_0x3be572(0x1eb)]||'','operator':apiOperatorToYaml(_0x1e220b[_0x3be572(0x16c)]),..._0x1e220b['arrayMatching']&&_0x1e220b['arrayMatching']!==_0x3be572(0x1d0)?{'arrayMatching':_0x1e220b['arrayMatching']}:{},..._0x1e220b[_0x3be572(0x19c)]?{'exclude':_0x1e220b['exclude']}:{},..._0x5b2def?{'aggregation':_0x5b2def}:{},..._0x1e220b['leftValue'][_0x3be572(0x1ec)]?{'source':_0x1e220b[_0x3be572(0x1d4)][_0x3be572(0x1ec)][_0x3be572(0x1eb)]}:{},..._0x1e220b[_0x3be572(0x1d4)][_0x3be572(0x1b7)]?{'filter':apiRuleToYaml(_0x1e220b[_0x3be572(0x1d4)][_0x3be572(0x1b7)])}:{},..._0x1e220b[_0x3be572(0x177)]!==undefined&&_0x1e220b[_0x3be572(0x177)]!==null?{'limit':_0x1e220b[_0x3be572(0x177)]}:{}};}if(_0x1e220b[_0x3be572(0x1d2)]==='Reference'&&_0x1e220b['id'])return{'type':_0x1e220b[_0x3be572(0x19c)]?_0x3be572(0x19c):'include','segment':_0x1e220b['id']};return{'type':_0x3be572(0x1a6),'conditions':[]};}function isTemporalOperator(_0x1576bc){const _0x5b949d=a102_0x417c;return _0x1576bc===_0x5b949d(0x18b)||_0x1576bc===_0x5b949d(0x1f2);}function getEffectiveValue(_0x3e9f19){const _0x369ed4=a102_0x417c,_0x3929c9=_0x3e9f19['values'];return _0x3e9f19[_0x369ed4(0x1a8)]??_0x3929c9;}function apiOperatorToYaml(_0x2be414){const _0x509e9d=a102_0x417c;let _0x4c9233;if(_0x2be414[_0x509e9d(0x19b)]&&_0x2be414[_0x509e9d(0x19b)][_0x509e9d(0x172)]>0x0)_0x4c9233=_0x2be414[_0x509e9d(0x19b)];else{if(_0x2be414[_0x509e9d(0x1aa)]!==undefined)_0x4c9233=_0x2be414[_0x509e9d(0x1aa)];else isTemporalOperator(_0x2be414[_0x509e9d(0x1d2)])&&_0x2be414[_0x509e9d(0x1a8)]!==undefined&&(_0x4c9233=_0x2be414[_0x509e9d(0x1a8)]);}return{'type':mapApiOperatorType(_0x2be414[_0x509e9d(0x1d2)]),..._0x2be414[_0x509e9d(0x1c7)]&&{'not':_0x2be414[_0x509e9d(0x1c7)]},..._0x4c9233!==undefined&&{'value':_0x4c9233},..._0x2be414[_0x509e9d(0x18e)]&&{'unit':_0x2be414[_0x509e9d(0x18e)]}};}function mapApiOperatorType(_0x17b3f5){return _0x17b3f5;}export function segmentDefToCreateRequest(_0x3636ff,_0x51d41e){const _0x597f79=a102_0x417c,_0x17017d={'name':_0x3636ff[_0x597f79(0x1eb)]};return _0x3636ff[_0x597f79(0x1f1)]&&(_0x17017d[_0x597f79(0x1f1)]=_0x3636ff['description']),_0x3636ff[_0x597f79(0x19e)]&&(_0x17017d[_0x597f79(0x19e)]=yamlRuleToApi(_0x3636ff[_0x597f79(0x19e)])),_0x3636ff[_0x597f79(0x16a)]&&(_0x17017d['kind']=_0x3636ff[_0x597f79(0x16a)]==='batch'?0x0:_0x3636ff[_0x597f79(0x16a)]===_0x597f79(0x1f6)?0x1:0x2),_0x3636ff[_0x597f79(0x193)]!==undefined&&(_0x17017d[_0x597f79(0x1e2)]=_0x3636ff[_0x597f79(0x193)]),_0x51d41e&&(_0x17017d['segmentFolderId']=_0x51d41e),_0x17017d;}export function segmentDefToUpdateRequest(_0x58bf4c){const _0x26e65a=a102_0x417c,_0x2ed1ba={'name':_0x58bf4c[_0x26e65a(0x1eb)]};return _0x58bf4c[_0x26e65a(0x1f1)]!==undefined&&(_0x2ed1ba[_0x26e65a(0x1f1)]=_0x58bf4c[_0x26e65a(0x1f1)]),_0x58bf4c[_0x26e65a(0x19e)]&&(_0x2ed1ba[_0x26e65a(0x19e)]=yamlRuleToApi(_0x58bf4c['rule'])),_0x58bf4c[_0x26e65a(0x16a)]&&(_0x2ed1ba[_0x26e65a(0x16a)]=_0x58bf4c[_0x26e65a(0x16a)]===_0x26e65a(0x187)?0x0:_0x58bf4c[_0x26e65a(0x16a)]==='realtime'?0x1:0x2),_0x2ed1ba;}export function yamlRuleToApi(_0x4c5892,_0x4a6e67=![]){const _0x4a8984=a102_0x417c,_0x351d58=_0x4c5892[_0x4a8984(0x1a0)]['map'](yamlConditionToApi);if(_0x4a6e67){const _0x31ac52=_0x351d58[_0x4a8984(0x1e0)](_0x145626=>_0x145626[_0x4a8984(0x1d2)]==='And'||_0x145626['type']==='Or');if(!_0x31ac52&&_0x351d58[_0x4a8984(0x172)]>0x0)return{'type':_0x4c5892[_0x4a8984(0x1d2)],'conditions':[{'type':_0x4a8984(0x1a6),'description':_0x4c5892['description']||'','conditions':_0x351d58}]};}return{'type':_0x4c5892[_0x4a8984(0x1d2)],'conditions':_0x351d58,..._0x4c5892['description']&&{'description':_0x4c5892[_0x4a8984(0x1f1)]}};}function yamlConditionToApi(_0x77452d){const _0x1c891c=a102_0x417c;if(_0x1c891c(0x1d5)in _0x77452d&&(_0x77452d['type']==='include'||_0x77452d['type']==='exclude')){const _0x4cda7b=_0x77452d;return{'type':'Reference','id':_0x4cda7b[_0x1c891c(0x1d5)],'exclude':_0x4cda7b[_0x1c891c(0x1d2)]===_0x1c891c(0x19c)};}if(_0x1c891c(0x1d2)in _0x77452d&&(_0x77452d['type']===_0x1c891c(0x1a6)||_0x77452d['type']==='Or')){const _0x2973e6=_0x77452d;return{'type':_0x2973e6['type'],'conditions':_0x2973e6['conditions'][_0x1c891c(0x16b)](yamlConditionToApi),..._0x2973e6['description']&&{'description':_0x2973e6[_0x1c891c(0x1f1)]}};}const _0x40df7d=_0x77452d,_0x149584={'type':'Value','leftValue':buildLeftValue(_0x40df7d),'operator':yamlOperatorToApi(_0x40df7d[_0x1c891c(0x16c)]),'exclude':_0x40df7d['exclude']??![],'arrayMatching':_0x40df7d[_0x1c891c(0x1af)]??'any'};return _0x40df7d['limit']!==undefined&&(_0x149584['limit']=_0x40df7d['limit']),_0x149584;}function buildLeftValue(_0xc45ee7){const _0x2f8e5b=a102_0x417c,_0x450edf={'name':_0xc45ee7['attribute']};return _0xc45ee7['aggregation']&&(_0x450edf[_0x2f8e5b(0x18d)]={'type':_0xc45ee7['aggregation'][_0x2f8e5b(0x1d2)],..._0xc45ee7[_0x2f8e5b(0x18d)][_0x2f8e5b(0x1f0)]&&{'groupingColumns':_0xc45ee7[_0x2f8e5b(0x18d)][_0x2f8e5b(0x1f0)]}}),_0xc45ee7[_0x2f8e5b(0x1ec)]&&(_0x450edf[_0x2f8e5b(0x1ec)]={'name':_0xc45ee7['source']}),_0xc45ee7['filter']&&(_0x450edf[_0x2f8e5b(0x1b7)]=yamlRuleToApi(_0xc45ee7[_0x2f8e5b(0x1b7)])),_0x450edf;}function yamlOperatorToApi(_0x5efa1f){const _0x41e9c0=a102_0x417c,_0x7d79c1={'type':mapYamlOperatorType(_0x5efa1f['type']),'not':_0x5efa1f[_0x41e9c0(0x1c7)]??![]},_0x21f083=getEffectiveValue(_0x5efa1f);if(_0x21f083!==undefined){if(Array[_0x41e9c0(0x17b)](_0x21f083))_0x7d79c1[_0x41e9c0(0x19b)]=_0x21f083;else isTemporalOperator(_0x5efa1f[_0x41e9c0(0x1d2)])?_0x7d79c1[_0x41e9c0(0x1a8)]=_0x21f083:_0x7d79c1['rightValue']=_0x21f083;}return _0x5efa1f[_0x41e9c0(0x18e)]&&(_0x7d79c1[_0x41e9c0(0x18e)]=_0x5efa1f[_0x41e9c0(0x18e)]),_0x7d79c1;}function mapYamlOperatorType(_0x8c4072){return _0x8c4072;}export function toYamlString(_0x960130){const _0x4a70de=a102_0x417c,_0x189245=JSON[_0x4a70de(0x1cf)](JSON[_0x4a70de(0x173)](_0x960130)),_0x32dd2a=a102_0xf1f92b['stringify'](_0x189245,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4a70de(0x16f)}),_0x4da8d5=[_0x4a70de(0x196)];let _0x43eba9=_0x32dd2a;for(const _0x5a0000 of _0x4da8d5){_0x43eba9=_0x43eba9[_0x4a70de(0x1d7)](new RegExp('^('+_0x5a0000+')','m'),(_0x14f1dd,_0x1f70ad,_0x1940fe)=>{if(_0x1940fe===0x0||_0x43eba9[_0x1940fe-0x1]==='\x0a'&&_0x43eba9[_0x1940fe-0x2]==='\x0a')return _0x1f70ad;return'\x0a'+_0x1f70ad;});}return _0x43eba9;}export function parseYamlString(_0x22fd5a){const _0x44022a=a102_0x417c,_0x851894=a102_0xf1f92b[_0x44022a(0x1cf)](_0x22fd5a);if(!_0x851894[_0x44022a(0x1eb)])throw new Error(_0x44022a(0x1b2));if(_0x851894[_0x44022a(0x1d2)]&&_0x851894[_0x44022a(0x1d2)]!==_0x44022a(0x1d5))throw new Error('YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20'+_0x851894['type']);return _0x851894;}export function isSegmentYaml(_0x445a45){const _0x1670d2=a102_0x417c;if(typeof _0x445a45!==_0x1670d2(0x1dc)||_0x445a45===null)return![];const _0x476b72=_0x445a45;return _0x476b72[_0x1670d2(0x1d2)]===_0x1670d2(0x1d5)||_0x476b72[_0x1670d2(0x1d2)]===undefined;}export function generateTemplate(_0xd713ca='New\x20Segment'){const _0x452e1e=a102_0x417c,_0x4595ff={'type':'segment','name':_0xd713ca,'description':_0x452e1e(0x1e7),'rule':{'type':_0x452e1e(0x1a6),'conditions':[{'type':'Value','attribute':_0x452e1e(0x167),'operator':{'type':'Equal','value':'value'}}]}};return toYamlString(_0x4595ff);}export function segmentToYamlString(_0x3e6755){const _0x33d167=a102_0x417c,_0x586965=JSON[_0x33d167(0x1cf)](JSON['stringify'](_0x3e6755)),_0x7535bd=a102_0xf1f92b['stringify'](_0x586965,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x33d167(0x16f)}),_0x5b0eda=['rule:',_0x33d167(0x1bd)];let _0x1bdcb1=_0x7535bd;for(const _0x20e14d of _0x5b0eda){_0x1bdcb1=_0x1bdcb1[_0x33d167(0x1d7)](new RegExp('^('+_0x20e14d+')','m'),(_0x4eab91,_0x387778,_0xcd3e92)=>{if(_0xcd3e92===0x0||_0x1bdcb1[_0xcd3e92-0x1]==='\x0a'&&_0x1bdcb1[_0xcd3e92-0x2]==='\x0a')return _0x387778;return'\x0a'+_0x387778;});}return _0x1bdcb1;}export function parseSegmentYamlFile(_0x100b09){const _0x160642=a102_0x417c,_0x5088e9=a102_0xf1f92b[_0x160642(0x1cf)](_0x100b09);if(!_0x5088e9['name'])throw new Error(_0x160642(0x1b2));return _0x5088e9;}export function normalizeChildSegmentYaml(_0x5683dc){const _0xc9a2a2=a102_0x417c;return{'type':_0xc9a2a2(0x1d5),'name':_0x5683dc[_0xc9a2a2(0x1eb)],..._0x5683dc['description']!==undefined&&{'description':_0x5683dc['description']},..._0x5683dc[_0xc9a2a2(0x1c0)]!==undefined&&{'folder':_0x5683dc[_0xc9a2a2(0x1c0)]},..._0x5683dc[_0xc9a2a2(0x19e)]&&{'rule':normalizeRule(_0x5683dc[_0xc9a2a2(0x19e)])},..._0x5683dc[_0xc9a2a2(0x16a)]!==undefined&&{'kind':_0x5683dc[_0xc9a2a2(0x16a)]},..._0x5683dc[_0xc9a2a2(0x193)]!==undefined&&{'visible':_0x5683dc['visible']},..._0x5683dc[_0xc9a2a2(0x174)]&&{'activations':_0x5683dc[_0xc9a2a2(0x174)][_0xc9a2a2(0x16b)](normalizeActivation)}};}export function normalizeRule(_0x5a3db9){const _0x21a667=a102_0x417c;return{'type':_0x5a3db9['type'],'conditions':_0x5a3db9['conditions'][_0x21a667(0x16b)](normalizeCondition),..._0x5a3db9[_0x21a667(0x1f1)]!==undefined&&{'description':_0x5a3db9[_0x21a667(0x1f1)]}};}function normalizeCondition(_0x177ac3){const _0x42077e=a102_0x417c;if(_0x42077e(0x1d5)in _0x177ac3&&(_0x177ac3['type']==='include'||_0x177ac3['type']===_0x42077e(0x19c))){const _0x3ecebc=_0x177ac3;return{'type':_0x3ecebc[_0x42077e(0x1d2)],'segment':_0x3ecebc[_0x42077e(0x1d5)]};}if(_0x42077e(0x1d2)in _0x177ac3&&(_0x177ac3[_0x42077e(0x1d2)]===_0x42077e(0x1a6)||_0x177ac3[_0x42077e(0x1d2)]==='Or')){const _0x224f14=_0x177ac3;return{'type':_0x224f14['type'],'conditions':_0x224f14['conditions']['map'](normalizeCondition),..._0x224f14[_0x42077e(0x1f1)]!==undefined&&{'description':_0x224f14[_0x42077e(0x1f1)]}};}const _0x44a70f=_0x177ac3;return{'type':_0x42077e(0x17a),'attribute':_0x44a70f[_0x42077e(0x1bc)],'operator':normalizeOperator(_0x44a70f['operator']),..._0x44a70f[_0x42077e(0x1af)]!==undefined&&{'arrayMatching':_0x44a70f[_0x42077e(0x1af)]},..._0x44a70f[_0x42077e(0x19c)]!==undefined&&{'exclude':_0x44a70f[_0x42077e(0x19c)]},..._0x44a70f['aggregation']!==undefined&&{'aggregation':_0x44a70f['aggregation']},..._0x44a70f[_0x42077e(0x1ec)]!==undefined&&{'source':_0x44a70f['source']},..._0x44a70f[_0x42077e(0x1b7)]!==undefined&&{'filter':normalizeRule(_0x44a70f[_0x42077e(0x1b7)])},..._0x44a70f['limit']!==undefined&&{'limit':_0x44a70f[_0x42077e(0x177)]}};}function normalizeOperator(_0x4b0039){const _0x397463=a102_0x417c,_0x34c328=getEffectiveValue(_0x4b0039);return{'type':_0x4b0039[_0x397463(0x1d2)],..._0x4b0039['not']!==undefined&&{'not':_0x4b0039[_0x397463(0x1c7)]},..._0x34c328!==undefined&&{'value':_0x34c328},..._0x4b0039[_0x397463(0x1c5)]!==undefined&&{'min':_0x4b0039[_0x397463(0x1c5)]},..._0x4b0039[_0x397463(0x1a3)]!==undefined&&{'max':_0x4b0039[_0x397463(0x1a3)]},..._0x4b0039['unit']!==undefined&&{'unit':_0x4b0039['unit']},..._0x4b0039[_0x397463(0x194)]!==undefined&&{'duration':_0x4b0039[_0x397463(0x194)]},..._0x4b0039[_0x397463(0x171)]!==undefined&&{'from':_0x4b0039[_0x397463(0x171)]}};}function a102_0x417c(_0x4c2cab,_0x3223a3){_0x4c2cab=_0x4c2cab-0x167;const _0x5466e1=a102_0x5466();let _0x417c64=_0x5466e1[_0x4c2cab];return _0x417c64;}function normalizeActivation(_0x125e29){const _0x4ac049=a102_0x417c;return{'name':_0x125e29[_0x4ac049(0x1eb)],'connection':_0x125e29[_0x4ac049(0x1ee)],..._0x125e29['description']!==undefined&&{'description':_0x125e29[_0x4ac049(0x1f1)]},..._0x125e29[_0x4ac049(0x1a2)]!==undefined&&{'all_columns':_0x125e29[_0x4ac049(0x1a2)]},..._0x125e29[_0x4ac049(0x1a7)]!==undefined&&{'columns':_0x125e29[_0x4ac049(0x1a7)]},..._0x125e29['behavior']!==undefined&&{'behavior':_0x125e29['behavior']},..._0x125e29[_0x4ac049(0x176)]!==undefined&&{'schedule':_0x125e29[_0x4ac049(0x176)]},..._0x125e29['notification']!==undefined&&{'notification':_0x125e29['notification']},..._0x125e29[_0x4ac049(0x168)]!==undefined&&{'connector_config':_0x125e29[_0x4ac049(0x168)]},..._0x125e29[_0x4ac049(0x1b9)]!==undefined&&{'activation_template_id':_0x125e29['activation_template_id']}};}export function activationResponseToDef(_0x470d06,_0x525f2a,_0x15b2a8){const _0x57b325=a102_0x417c,_0x25d316=_0x470d06['connectionId']||'',_0x36958a=_0x15b2a8?.['get'](_0x25d316)??_0x25d316,_0x502f74={'name':_0x470d06[_0x57b325(0x1eb)],'connection':_0x36958a};_0x470d06[_0x57b325(0x1f1)]&&(_0x502f74['description']=_0x470d06[_0x57b325(0x1f1)]);let _0x38873a=[];_0x470d06[_0x57b325(0x1a7)]&&_0x470d06[_0x57b325(0x1a7)]['length']>0x0&&(_0x38873a=_0x470d06[_0x57b325(0x1a7)]['filter'](_0xd9c73=>_0xd9c73&&_0xd9c73[_0x57b325(0x1eb)])['map'](_0x44b1f6=>{const _0xbc946a=_0x57b325;if(_0x44b1f6[_0xbc946a(0x1d2)]||_0x44b1f6[_0xbc946a(0x19a)])return{'name':_0x44b1f6[_0xbc946a(0x1eb)],..._0x44b1f6[_0xbc946a(0x1d2)]&&{'type':_0x44b1f6[_0xbc946a(0x1d2)]},..._0x44b1f6[_0xbc946a(0x19a)]&&{'visibility':_0x44b1f6[_0xbc946a(0x19a)]}};return _0x44b1f6[_0xbc946a(0x1eb)];}));_0x38873a['length']>0x0&&(_0x502f74[_0x57b325(0x1a7)]=_0x38873a);_0x470d06[_0x57b325(0x1ab)]!==undefined&&(_0x470d06[_0x57b325(0x1ab)]===![]&&_0x38873a['length']===0x0?_0x502f74[_0x57b325(0x1a2)]=!![]:_0x502f74[_0x57b325(0x1a2)]=_0x470d06['allColumns']);const _0x342728={};let _0x4e4940=![];_0x470d06[_0x57b325(0x1cb)]&&(_0x342728[_0x57b325(0x1d2)]=_0x470d06['scheduleType'],_0x4e4940=!![]);_0x470d06['repeatUnit']&&(_0x342728[_0x57b325(0x191)]=_0x470d06[_0x57b325(0x1bf)],_0x4e4940=!![]);_0x470d06[_0x57b325(0x17f)]!==undefined&&_0x470d06[_0x57b325(0x17f)]!==null&&(_0x342728[_0x57b325(0x179)]=_0x470d06[_0x57b325(0x17f)],_0x4e4940=!![]);_0x470d06['repeatSubFrequency']&&_0x470d06[_0x57b325(0x1a9)][_0x57b325(0x172)]>0x0&&(_0x342728[_0x57b325(0x1e1)]=_0x470d06[_0x57b325(0x1a9)],_0x4e4940=!![]);_0x470d06[_0x57b325(0x18f)]!==undefined&&(_0x342728['start_at']=_0x470d06['startAt'],_0x4e4940=!![]);_0x470d06['endOn']!==undefined&&(_0x342728['end_on']=_0x470d06[_0x57b325(0x1ce)],_0x4e4940=!![]);_0x470d06['timezone']&&(_0x342728[_0x57b325(0x1ae)]=_0x470d06['timezone'],_0x4e4940=!![]);_0x4e4940&&(_0x502f74[_0x57b325(0x176)]=_0x342728);(_0x470d06['notifyOn']&&_0x470d06['notifyOn'][_0x57b325(0x172)]>0x0||_0x470d06[_0x57b325(0x182)]&&_0x470d06[_0x57b325(0x182)][_0x57b325(0x172)]>0x0)&&(_0x502f74[_0x57b325(0x1a1)]={},_0x470d06[_0x57b325(0x1da)]&&_0x470d06['notifyOn'][_0x57b325(0x172)]>0x0&&(_0x502f74[_0x57b325(0x1a1)][_0x57b325(0x17c)]=_0x470d06['notifyOn']),_0x470d06[_0x57b325(0x182)]&&_0x470d06[_0x57b325(0x182)][_0x57b325(0x172)]>0x0&&(_0x502f74[_0x57b325(0x1a1)][_0x57b325(0x1c3)]=_0x470d06[_0x57b325(0x182)][_0x57b325(0x16b)](_0x1ce247=>{const _0x377445=_0x57b325,_0x5b4b73=_0x525f2a?.[_0x377445(0x192)](_0x1ce247);return _0x5b4b73??String(_0x1ce247);})));_0x470d06[_0x57b325(0x178)]&&Object[_0x57b325(0x1d6)](_0x470d06[_0x57b325(0x178)])[_0x57b325(0x172)]>0x0&&(_0x502f74[_0x57b325(0x168)]=normalizeConnectorConfigForYaml(_0x470d06[_0x57b325(0x178)]));_0x470d06['activationTemplateId']&&(_0x502f74[_0x57b325(0x1b9)]=_0x470d06['activationTemplateId']);if(_0x470d06['syndicationBehavior']){const _0xee3b69={},_0x3f8f35=_0x470d06[_0x57b325(0x1d3)];_0x3f8f35[_0x57b325(0x1a7)]&&_0x3f8f35['columns'][_0x57b325(0x172)]>0x0&&(_0xee3b69[_0x57b325(0x1a7)]=_0x3f8f35[_0x57b325(0x1a7)][_0x57b325(0x1b7)](_0x1c9583=>_0x1c9583&&_0x1c9583[_0x57b325(0x1eb)])[_0x57b325(0x16b)](_0x45fd22=>({'name':_0x45fd22[_0x57b325(0x1eb)],..._0x45fd22[_0x57b325(0x1d2)]&&{'type':_0x45fd22[_0x57b325(0x1d2)]},..._0x45fd22[_0x57b325(0x19a)]&&{'visibility':_0x45fd22['visibility']}}))),_0x3f8f35[_0x57b325(0x1b3)]&&(_0xee3b69['behavior_table']=_0x3f8f35[_0x57b325(0x1b3)]),_0x3f8f35[_0x57b325(0x1e6)]!==undefined&&(_0xee3b69[_0x57b325(0x1b6)]=_0x3f8f35[_0x57b325(0x1e6)]),_0x3f8f35[_0x57b325(0x189)]&&(_0xee3b69[_0x57b325(0x1d1)]=_0x3f8f35[_0x57b325(0x189)]),_0x3f8f35[_0x57b325(0x198)]&&(_0xee3b69[_0x57b325(0x198)]=_0x3f8f35['formatting']),_0x3f8f35[_0x57b325(0x1e8)]&&_0x3f8f35[_0x57b325(0x1e8)][_0x57b325(0x172)]>0x0&&(_0xee3b69[_0x57b325(0x1ad)]=_0x3f8f35[_0x57b325(0x1e8)]),Object[_0x57b325(0x1d6)](_0xee3b69)[_0x57b325(0x172)]>0x0&&(_0x502f74['behavior']=_0xee3b69);}return _0x502f74;}export function journeyActivationStepToYaml(_0x19373d,_0x184651,_0x2d2014){const _0x52c370=a102_0x417c,_0x21397c=_0x19373d['attributes'][_0x52c370(0x186)],_0x26370e=_0x21397c['connectionId']||'',_0x107384=_0x2d2014?.[_0x52c370(0x192)](_0x26370e)??_0x26370e,_0x171653={'name':_0x21397c[_0x52c370(0x1eb)]||'','connection':_0x107384};_0x21397c['description']&&(_0x171653['description']=_0x21397c[_0x52c370(0x1f1)]);let _0x1d8fbb=[];_0x21397c['columns']&&_0x21397c[_0x52c370(0x1a7)][_0x52c370(0x172)]>0x0&&(_0x1d8fbb=_0x21397c['columns']['filter'](_0xe4ce29=>_0xe4ce29&&_0xe4ce29[_0x52c370(0x1eb)])[_0x52c370(0x16b)](_0x2bd1bd=>{const _0x364838=_0x52c370;if(_0x2bd1bd[_0x364838(0x1d2)]||_0x2bd1bd[_0x364838(0x19a)])return{'name':_0x2bd1bd[_0x364838(0x1eb)],..._0x2bd1bd[_0x364838(0x1d2)]&&{'type':_0x2bd1bd[_0x364838(0x1d2)]},..._0x2bd1bd[_0x364838(0x19a)]&&{'visibility':_0x2bd1bd[_0x364838(0x19a)]}};return _0x2bd1bd['name'];}));_0x1d8fbb[_0x52c370(0x172)]>0x0&&(_0x171653[_0x52c370(0x1a7)]=_0x1d8fbb);_0x21397c[_0x52c370(0x1ab)]!==undefined&&(_0x21397c[_0x52c370(0x1ab)]===![]&&_0x1d8fbb[_0x52c370(0x172)]===0x0?_0x171653['all_columns']=!![]:_0x171653[_0x52c370(0x1a2)]=_0x21397c[_0x52c370(0x1ab)]);const _0x1144d1={};let _0x150066=![];_0x21397c[_0x52c370(0x1cb)]&&(_0x1144d1['type']=_0x21397c[_0x52c370(0x1cb)],_0x150066=!![]);_0x21397c['repeatUnit']&&(_0x1144d1[_0x52c370(0x191)]=_0x21397c['repeatUnit'],_0x150066=!![]);_0x21397c[_0x52c370(0x17f)]!==undefined&&_0x21397c[_0x52c370(0x17f)]!==null&&(_0x1144d1[_0x52c370(0x179)]=_0x21397c['repeatFrequency'],_0x150066=!![]);_0x21397c[_0x52c370(0x18f)]!==undefined&&(_0x1144d1[_0x52c370(0x1dd)]=_0x21397c[_0x52c370(0x18f)],_0x150066=!![]);_0x21397c[_0x52c370(0x1ce)]!==undefined&&(_0x1144d1[_0x52c370(0x1c6)]=_0x21397c[_0x52c370(0x1ce)],_0x150066=!![]);_0x21397c[_0x52c370(0x1ae)]&&(_0x1144d1[_0x52c370(0x1ae)]=_0x21397c[_0x52c370(0x1ae)],_0x150066=!![]);_0x150066&&(_0x171653[_0x52c370(0x176)]=_0x1144d1);(_0x21397c[_0x52c370(0x1da)]&&_0x21397c[_0x52c370(0x1da)][_0x52c370(0x172)]>0x0||_0x21397c['emailRecipients']&&_0x21397c[_0x52c370(0x182)][_0x52c370(0x172)]>0x0)&&(_0x171653[_0x52c370(0x1a1)]={},_0x21397c['notifyOn']&&_0x21397c[_0x52c370(0x1da)][_0x52c370(0x172)]>0x0&&(_0x171653[_0x52c370(0x1a1)][_0x52c370(0x17c)]=_0x21397c[_0x52c370(0x1da)]),_0x21397c[_0x52c370(0x182)]&&_0x21397c[_0x52c370(0x182)][_0x52c370(0x172)]>0x0&&(_0x171653[_0x52c370(0x1a1)][_0x52c370(0x1c3)]=_0x21397c[_0x52c370(0x182)][_0x52c370(0x16b)](_0x3f96e3=>{const _0x307fdd=_0x52c370,_0x44db45=_0x184651?.[_0x307fdd(0x192)](_0x3f96e3);return _0x44db45??String(_0x3f96e3);})));_0x21397c['connectorConfig']&&Object[_0x52c370(0x1d6)](_0x21397c[_0x52c370(0x178)])[_0x52c370(0x172)]>0x0&&(_0x171653[_0x52c370(0x168)]=normalizeConnectorConfigForYaml(_0x21397c[_0x52c370(0x178)]));_0x21397c[_0x52c370(0x1b0)]&&(_0x171653['activation_template_id']=_0x21397c[_0x52c370(0x1b0)]);if(_0x21397c[_0x52c370(0x1d3)]){const _0x37a614={},_0x158db7=_0x21397c[_0x52c370(0x1d3)];_0x158db7[_0x52c370(0x1a7)]&&_0x158db7['columns'][_0x52c370(0x172)]>0x0&&(_0x37a614['columns']=_0x158db7[_0x52c370(0x1a7)][_0x52c370(0x1b7)](_0x24fab0=>_0x24fab0&&_0x24fab0[_0x52c370(0x1eb)])[_0x52c370(0x16b)](_0x2e007f=>({'name':_0x2e007f[_0x52c370(0x1eb)],..._0x2e007f[_0x52c370(0x1d2)]&&{'type':_0x2e007f[_0x52c370(0x1d2)]},..._0x2e007f[_0x52c370(0x19a)]&&{'visibility':_0x2e007f['visibility']}}))),_0x158db7[_0x52c370(0x1b3)]&&(_0x37a614['behavior_table']=_0x158db7['behaviorTableName']),_0x158db7[_0x52c370(0x1e6)]!==undefined&&(_0x37a614[_0x52c370(0x1b6)]=_0x158db7[_0x52c370(0x1e6)]),_0x158db7['joinStrategy']&&(_0x37a614[_0x52c370(0x1d1)]=_0x158db7[_0x52c370(0x189)]),_0x158db7[_0x52c370(0x198)]&&(_0x37a614[_0x52c370(0x198)]=_0x158db7[_0x52c370(0x198)]),_0x158db7[_0x52c370(0x1e8)]&&_0x158db7['orderBy'][_0x52c370(0x172)]>0x0&&(_0x37a614[_0x52c370(0x1ad)]=_0x158db7[_0x52c370(0x1e8)]),Object[_0x52c370(0x1d6)](_0x37a614)['length']>0x0&&(_0x171653[_0x52c370(0x19d)]=_0x37a614);}return _0x171653;}export function segmentWithActivationsToYaml(_0x2e1555,_0x4a1097,_0x5114b7,_0xcba943,_0x4ce73b){const _0x5b3330=a102_0x417c,_0x695806=segmentResponseToDefSync(_0x2e1555,_0x5114b7);return _0x4a1097[_0x5b3330(0x172)]>0x0&&(_0x695806[_0x5b3330(0x174)]=_0x4a1097[_0x5b3330(0x16b)](_0x8da1b1=>activationResponseToDef(_0x8da1b1,_0xcba943,_0x4ce73b))),_0x695806;}function normalizeColumn(_0x4cbcc2){const _0x409eb3=a102_0x417c;if(typeof _0x4cbcc2===_0x409eb3(0x197))return{'name':_0x4cbcc2};return{'name':_0x4cbcc2['name'],..._0x4cbcc2['type']&&{'type':_0x4cbcc2[_0x409eb3(0x1d2)]},..._0x4cbcc2['visibility']&&{'visibility':_0x4cbcc2[_0x409eb3(0x19a)]}};}export async function activationDefToCreateRequest(_0x5a1ca8,_0x28d891){const _0xcb8e65=a102_0x417c,_0x4d7188=_0x28d891?.[_0xcb8e65(0x1b5)],_0x2d56a6=_0x28d891?.[_0xcb8e65(0x1df)],_0x3f43b3=_0x5a1ca8[_0xcb8e65(0x1ee)];let _0x38efc0;const _0x477439=parseInt(_0x3f43b3,0xa);if(!isNaN(_0x477439)&&String(_0x477439)===_0x3f43b3)_0x38efc0=_0x477439;else{const _0x3ada7c=_0x2d56a6?.[_0xcb8e65(0x192)](_0x3f43b3);if(_0x3ada7c===undefined)throw new SDKError(ErrorCode[_0xcb8e65(0x169)],_0xcb8e65(0x1b1)+_0x3f43b3,undefined,{'helpText':_0xcb8e65(0x1f3)});_0x38efc0=_0x3ada7c;}const _0x68847e={'name':_0x5a1ca8[_0xcb8e65(0x1eb)],'connectionId':_0x38efc0};_0x5a1ca8[_0xcb8e65(0x1f1)]&&(_0x68847e['description']=_0x5a1ca8[_0xcb8e65(0x1f1)]);let _0x359150=[];_0x5a1ca8['columns']&&_0x5a1ca8['columns']['length']>0x0&&(_0x359150=_0x5a1ca8[_0xcb8e65(0x1a7)]['filter'](_0x2e0cfe=>_0x2e0cfe!=null)['map'](normalizeColumn));_0x359150[_0xcb8e65(0x172)]>0x0&&(_0x68847e[_0xcb8e65(0x1a7)]=_0x359150);_0x5a1ca8['all_columns']!==undefined&&(_0x5a1ca8[_0xcb8e65(0x1a2)]===![]&&_0x359150[_0xcb8e65(0x172)]===0x0?_0x68847e['allColumns']=!![]:_0x68847e[_0xcb8e65(0x1ab)]=_0x5a1ca8[_0xcb8e65(0x1a2)]);if(_0x5a1ca8[_0xcb8e65(0x176)]){const _0x3b247c=_0x5a1ca8[_0xcb8e65(0x176)];_0x3b247c[_0xcb8e65(0x1d2)]&&(_0x68847e[_0xcb8e65(0x1cb)]=_0x3b247c[_0xcb8e65(0x1d2)]),_0x3b247c[_0xcb8e65(0x191)]&&(_0x68847e['repeatUnit']=_0x3b247c['repeat_unit']),_0x3b247c[_0xcb8e65(0x179)]!==undefined&&(_0x68847e[_0xcb8e65(0x17f)]=_0x3b247c[_0xcb8e65(0x179)]),_0x3b247c['repeat_sub_frequency']&&(_0x68847e[_0xcb8e65(0x1a9)]=_0x3b247c[_0xcb8e65(0x1e1)]),_0x3b247c[_0xcb8e65(0x1dd)]!==undefined&&(_0x68847e[_0xcb8e65(0x18f)]=_0x3b247c[_0xcb8e65(0x1dd)]),_0x3b247c[_0xcb8e65(0x1c6)]!==undefined&&(_0x68847e[_0xcb8e65(0x1ce)]=_0x3b247c[_0xcb8e65(0x1c6)]),_0x3b247c[_0xcb8e65(0x1ae)]&&(_0x68847e['timezone']=_0x3b247c[_0xcb8e65(0x1ae)]);}_0x5a1ca8[_0xcb8e65(0x1a1)]&&(_0x5a1ca8['notification']['notify_on']&&(_0x68847e[_0xcb8e65(0x1da)]=_0x5a1ca8['notification']['notify_on']),_0x5a1ca8['notification'][_0xcb8e65(0x1c3)]&&(_0x68847e[_0xcb8e65(0x182)]=_0x5a1ca8[_0xcb8e65(0x1a1)][_0xcb8e65(0x1c3)][_0xcb8e65(0x16b)](_0x473f06=>{const _0x33de96=_0xcb8e65,_0x4cfac=Number(_0x473f06);if(!isNaN(_0x4cfac)&&String(_0x4cfac)===_0x473f06)return _0x4cfac;const _0x50c1a6=_0x4d7188?.[_0x33de96(0x192)](_0x473f06[_0x33de96(0x1cd)]());if(_0x50c1a6===undefined)throw new SDKError(ErrorCode[_0x33de96(0x1c4)],_0x33de96(0x16d)+_0x473f06+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x50c1a6;})));if(_0x5a1ca8[_0xcb8e65(0x168)]){const _0x5002d2=_0x28d891?.[_0xcb8e65(0x1bb)]?.['get'](_0x3f43b3);if(_0x5002d2&&_0x28d891?.[_0xcb8e65(0x1ea)])try{const _0xa5caa5=await _0x28d891[_0xcb8e65(0x1ea)](_0x5002d2),_0xb7aa59=validateConnectorConfig(_0x5a1ca8['connector_config'],_0xa5caa5);if(!_0xb7aa59[_0xcb8e65(0x18a)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],_0xcb8e65(0x1c1)+_0x5a1ca8[_0xcb8e65(0x1eb)]+_0xcb8e65(0x183)+formatValidationErrors(_0xb7aa59[_0xcb8e65(0x1be)]),undefined,{'helpText':_0xcb8e65(0x190)+_0x5002d2+_0xcb8e65(0x180)+formatSchemaAsHelp(_0xa5caa5)});if(_0xb7aa59[_0xcb8e65(0x1f4)]['length']>0x0){const _0x391723=formatValidationWarnings(_0xb7aa59['warnings']);console[_0xcb8e65(0x1b4)](_0xcb8e65(0x1e5)+_0x5a1ca8[_0xcb8e65(0x1eb)]+_0xcb8e65(0x183)+_0x391723);}_0x68847e['connectorConfig']=transformConfigToLegacy(_0x5a1ca8['connector_config'],_0xa5caa5);}catch(_0x366165){if(_0x366165 instanceof SDKError&&_0x366165[_0xcb8e65(0x1a5)]===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x68847e['connectorConfig']=_0x5a1ca8[_0xcb8e65(0x168)];else throw _0x366165;}else _0x68847e[_0xcb8e65(0x178)]=_0x5a1ca8[_0xcb8e65(0x168)];}_0x5a1ca8[_0xcb8e65(0x1b9)]!==undefined&&(_0x68847e[_0xcb8e65(0x1b0)]=_0x5a1ca8[_0xcb8e65(0x1b9)]);if(_0x5a1ca8[_0xcb8e65(0x19d)]){const _0x1a1964=_0x5a1ca8[_0xcb8e65(0x19d)],_0x24d495={};if(_0x1a1964[_0xcb8e65(0x1a7)]&&_0x1a1964[_0xcb8e65(0x1a7)][_0xcb8e65(0x172)]>0x0){const _0x479a6f=_0x1a1964['columns'][_0xcb8e65(0x1b7)](_0x2ea298=>_0x2ea298&&_0x2ea298[_0xcb8e65(0x1eb)]);_0x479a6f['length']>0x0&&(_0x24d495[_0xcb8e65(0x1a7)]=_0x479a6f);}_0x1a1964[_0xcb8e65(0x1a4)]&&(_0x24d495[_0xcb8e65(0x1b3)]=_0x1a1964[_0xcb8e65(0x1a4)]),_0x1a1964[_0xcb8e65(0x1b6)]!==undefined&&(_0x24d495[_0xcb8e65(0x1e6)]=_0x1a1964['join_row']),_0x1a1964[_0xcb8e65(0x1d1)]&&(_0x24d495[_0xcb8e65(0x189)]=_0x1a1964[_0xcb8e65(0x1d1)]),_0x1a1964[_0xcb8e65(0x198)]&&(_0x24d495[_0xcb8e65(0x198)]=_0x1a1964[_0xcb8e65(0x198)]),_0x1a1964[_0xcb8e65(0x1ad)]&&(_0x24d495[_0xcb8e65(0x1e8)]=_0x1a1964[_0xcb8e65(0x1ad)]),_0x68847e['syndicationBehavior']=_0x24d495;}return _0x68847e;}export async function activationDefToUpdateRequest(_0x57b68e,_0x4e3a97){return activationDefToCreateRequest(_0x57b68e,_0x4e3a97);}function a102_0x5466(){const _0x6b6bb0=['joinRow','Segment\x20description','orderBy','usedNames','getSchema','name','source','resolveSegmentName','connection','test','groupingColumns','description','TimeWithinNext','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','warnings','].attribute\x20cannot\x20be\x20empty.\x0a','realtime','attribute_name','connector_config','CONNECTION_NOT_FOUND','kind','map','operator','Unknown\x20email\x20recipient:\x20','8786330RMLZBh','null','3KAlrGF','from','length','stringify','activations','5476820qecIBg','schedule','limit','connectorConfig','repeat_frequency','Value','isArray','notify_on','all','values','repeatFrequency','\x0a\x0aAvailable\x20fields:\x0a','set','emailRecipients','\x22:\x0a','670700buABUW','27YJkPnQ','activationParams','batch','2506482dYeIHr','joinStrategy','valid','TimeWithinPast','conditions[','aggregation','unit','startAt','Connector:\x20','repeat_unit','get','visible','duration','entries','rule:','string','formatting','include','visibility','rightValues','exclude','behavior','rule','__SEGMENT_REF__','conditions','notification','all_columns','max','behavior_table','code','And','columns','value','repeatSubFrequency','rightValue','allColumns','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','order_by','timezone','arrayMatching','activationTemplateId','Unknown\x20connection:\x20','YAML\x20config\x20missing\x20required\x20field:\x20name','behaviorTableName','warn','emailToIdMap','join_row','filter','644135etCawz','activation_template_id','has','connectionNameToTypeMap','attribute','activations:','errors','repeatUnit','folder','Invalid\x20connector_config\x20for\x20activation\x20\x22','funnel_stage','email_recipients','INVALID_ARGUMENT','min','end_on','not','4638860SCOWrN','\x27:\x20','add','scheduleType','8644656wxLlGX','toLowerCase','endOn','parse','any','join_strategy','type','syndicationBehavior','leftValue','segment','keys','replace','__UNRESOLVED__','ruleHashToName','notifyOn','2CMtbWq','object','start_at','sort','connectionNameToIdMap','every','repeat_sub_frequency','isVisible','localRuleToName','forEach','connector_config\x20for\x20activation\x20\x22'];a102_0x5466=function(){return _0x6b6bb0;};return a102_0x5466();}export function deepSortObject(_0x315e8f){const _0x70387f=a102_0x417c;if(_0x315e8f===null||typeof _0x315e8f!=='object')return _0x315e8f;if(Array[_0x70387f(0x17b)](_0x315e8f))return _0x315e8f[_0x70387f(0x16b)](deepSortObject)[_0x70387f(0x1de)]((_0x47e77d,_0x438601)=>JSON['stringify'](_0x47e77d)['localeCompare'](JSON[_0x70387f(0x173)](_0x438601)));const _0x242fac={};for(const _0x3867b5 of Object[_0x70387f(0x1d6)](_0x315e8f)[_0x70387f(0x1de)]()){_0x242fac[_0x3867b5]=deepSortObject(_0x315e8f[_0x3867b5]);}return _0x242fac;}export function serializeRule(_0x5610c7){const _0x32ecdb=a102_0x417c;return JSON[_0x32ecdb(0x173)](deepSortObject(_0x5610c7));}export function normalizeRuleForMatching(_0x3019b1){return normalizeConditionsForMatching(_0x3019b1);}function normalizeConditionsForMatching(_0x4a025f){const _0x8ccf58=a102_0x417c;if(_0x4a025f===null||typeof _0x4a025f!==_0x8ccf58(0x1dc))return _0x4a025f;if(Array[_0x8ccf58(0x17b)](_0x4a025f))return _0x4a025f[_0x8ccf58(0x16b)](normalizeConditionsForMatching);const _0x305825=_0x4a025f;if((_0x305825['type']===_0x8ccf58(0x199)||_0x305825[_0x8ccf58(0x1d2)]==='exclude')&&typeof _0x305825[_0x8ccf58(0x1d5)]===_0x8ccf58(0x197))return{..._0x305825,'segment':_0x8ccf58(0x19f)};const _0x96d4e0={};for(const _0x10dfab of Object[_0x8ccf58(0x1d6)](_0x305825)){_0x96d4e0[_0x10dfab]=normalizeConditionsForMatching(_0x305825[_0x10dfab]);}return _0x96d4e0;}export function serializeRuleForMatching(_0x14ab6c){const _0x41622b=a102_0x417c;return JSON[_0x41622b(0x173)](deepSortObject(normalizeRuleForMatching(_0x14ab6c)));}export function expandSegmentReferences(_0x177220,_0x248f2a,_0x21dabf=new Set()){return expandConditions(_0x177220,_0x248f2a,_0x21dabf);}function expandConditions(_0x1578b6,_0x230089,_0x47512c){const _0x347112=a102_0x417c;if(_0x1578b6===null||typeof _0x1578b6!==_0x347112(0x1dc))return _0x1578b6;if(Array[_0x347112(0x17b)](_0x1578b6))return _0x1578b6[_0x347112(0x16b)](_0x17cf94=>expandConditions(_0x17cf94,_0x230089,_0x47512c));const _0x11be2a=_0x1578b6;if((_0x11be2a['type']==='include'||_0x11be2a[_0x347112(0x1d2)]===_0x347112(0x19c))&&typeof _0x11be2a[_0x347112(0x1d5)]===_0x347112(0x197)){const _0x235b6c=_0x11be2a[_0x347112(0x1d5)],_0x4321f4=_0x230089['get'](_0x235b6c);if(_0x4321f4&&!_0x47512c[_0x347112(0x1ba)](_0x235b6c)){const _0x4ba8f2=new Set(_0x47512c);_0x4ba8f2[_0x347112(0x1ca)](_0x235b6c);const _0xe479df=expandConditions(_0x4321f4,_0x230089,_0x4ba8f2);return{'type':_0x11be2a['type'],'expanded_rule':_0xe479df};}return{'type':_0x11be2a['type'],'expanded_rule':_0x347112(0x1d8)};}const _0x54ab28={};for(const _0x26111f of Object[_0x347112(0x1d6)](_0x11be2a)){_0x54ab28[_0x26111f]=expandConditions(_0x11be2a[_0x26111f],_0x230089,_0x47512c);}return _0x54ab28;}export function serializeExpandedRule(_0x4f4527,_0x2cbbeb){const _0x5e2449=a102_0x417c,_0x514d03=expandSegmentReferences(_0x4f4527,_0x2cbbeb);return JSON[_0x5e2449(0x173)](deepSortObject(_0x514d03));}export function createSegmentNameContext(_0x2f4a80){const _0x1994d0=a102_0x417c,_0x2f453b=new Set(),_0x3c4e70=new Map(),_0x33ea31=new Map();if(_0x2f4a80)for(const [_0xc095f5,_0x4b8f60]of Object[_0x1994d0(0x195)](_0x2f4a80)){if(_0x4b8f60[_0x1994d0(0x19e)]){const _0x9eb340=serializeRule(_0x4b8f60[_0x1994d0(0x19e)]);_0x33ea31[_0x1994d0(0x181)](_0x9eb340,_0xc095f5),_0x2f453b[_0x1994d0(0x1ca)](_0xc095f5);}}return{'usedNames':_0x2f453b,'ruleHashToName':_0x3c4e70,'localRuleToName':_0x2f4a80?_0x33ea31:undefined};}export function resolveSegmentName(_0x36bd21,_0x1ceca2,_0x295af7,_0xda6bca){const _0x5ed8d7=a102_0x417c,_0x2bc50f=serializeRule(_0x1ceca2);if(_0x295af7[_0x5ed8d7(0x1e3)]){const _0x138078=_0x295af7['localRuleToName'][_0x5ed8d7(0x192)](_0x2bc50f);if(_0x138078)return{'name':_0x138078,'isDuplicate':![],'isLocalMatch':!![]};}const _0x2333d3=_0x295af7[_0x5ed8d7(0x1d9)][_0x5ed8d7(0x192)](_0x2bc50f);if(_0x2333d3)return{'name':_0x2333d3,'isDuplicate':!![],'isLocalMatch':![]};const _0x461513=_0xda6bca(_0x36bd21);let _0x4785b3=_0x461513||_0x36bd21,_0x517a79=_0x4785b3,_0x429220=0x2;while(_0x295af7['usedNames']['has'](_0x517a79)){_0x517a79=_0x4785b3+'_'+_0x429220,_0x429220++;}return _0x295af7[_0x5ed8d7(0x1e9)][_0x5ed8d7(0x1ca)](_0x517a79),_0x295af7[_0x5ed8d7(0x1d9)][_0x5ed8d7(0x181)](_0x2bc50f,_0x517a79),{'name':_0x517a79,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x88a15d){const _0x4a3076=[],_0x277b6b=_0x1ccf48=>{const _0x311723=a102_0x417c;if(!_0x1ccf48||typeof _0x1ccf48!==_0x311723(0x1dc))return;if(Array['isArray'](_0x1ccf48)){_0x1ccf48[_0x311723(0x1e4)](_0x277b6b);return;}const _0x329e06=_0x1ccf48;(_0x329e06[_0x311723(0x1d2)]===_0x311723(0x199)||_0x329e06['type']===_0x311723(0x19c))&&typeof _0x329e06['segment']===_0x311723(0x197)&&_0x4a3076['push'](_0x329e06[_0x311723(0x1d5)]);for(const _0x14c95b of Object[_0x311723(0x17e)](_0x329e06)){_0x277b6b(_0x14c95b);}};return _0x277b6b(_0x88a15d),_0x4a3076;}export function validateSegmentRule(_0xfad4a2,_0x57c87e){const _0x6edfbd=a102_0x417c;if(!_0x57c87e||!_0x57c87e[_0x6edfbd(0x1a0)])return;for(let _0x18509a=0x0;_0x18509a<_0x57c87e[_0x6edfbd(0x1a0)][_0x6edfbd(0x172)];_0x18509a++){const _0xa6857a=_0x57c87e['conditions'][_0x18509a];if('type'in _0xa6857a&&_0xa6857a[_0x6edfbd(0x1d2)]===_0x6edfbd(0x17a)){const _0x191a83=_0xa6857a;if(!_0x191a83[_0x6edfbd(0x1bc)]||_0x191a83[_0x6edfbd(0x1bc)]==='')throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x6edfbd(0x1ac)+_0xfad4a2+_0x6edfbd(0x1c9)+(_0x6edfbd(0x18c)+_0x18509a+_0x6edfbd(0x1f5))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|
|
1
|
+
const a102_0x4d77d2=a102_0x3d58;(function(_0x32c083,_0x4a0609){const _0x5b3f88=a102_0x3d58,_0x3c1041=_0x32c083();while(!![]){try{const _0x142df8=-parseInt(_0x5b3f88(0x101))/0x1+parseInt(_0x5b3f88(0xbd))/0x2+parseInt(_0x5b3f88(0x7e))/0x3+parseInt(_0x5b3f88(0x90))/0x4*(parseInt(_0x5b3f88(0x8a))/0x5)+parseInt(_0x5b3f88(0xaa))/0x6+parseInt(_0x5b3f88(0xf0))/0x7+-parseInt(_0x5b3f88(0xe5))/0x8*(parseInt(_0x5b3f88(0xbf))/0x9);if(_0x142df8===_0x4a0609)break;else _0x3c1041['push'](_0x3c1041['shift']());}catch(_0x44578c){_0x3c1041['push'](_0x3c1041['shift']());}}}(a102_0x1109,0x73d2d));import*as a102_0xc5c917 from'yaml';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';export function segmentResponseToDefSync(_0x197701,_0x330862){const _0x3266c3=a102_0x3d58,_0x3307d3=_0x197701[_0x3266c3(0xbc)]&&'type'in _0x197701[_0x3266c3(0xbc)]&&_0x197701[_0x3266c3(0xbc)]['type'];return{'type':_0x3266c3(0xfe),'name':_0x197701[_0x3266c3(0xcb)],..._0x197701['description']&&{'description':_0x197701[_0x3266c3(0xcd)]},..._0x330862&&{'folder':_0x330862},..._0x3307d3&&{'rule':apiRuleToYaml(_0x197701[_0x3266c3(0xbc)])},..._0x197701[_0x3266c3(0x93)]!==undefined&&{'kind':_0x197701[_0x3266c3(0x93)]===0x0?_0x3266c3(0x7f):_0x197701[_0x3266c3(0x93)]===0x1?_0x3266c3(0xb4):'funnel_stage'},..._0x197701[_0x3266c3(0xc3)]!==undefined&&{'visible':_0x197701[_0x3266c3(0xc3)]}};}export async function segmentResponseToDef(_0x3f315a,_0x588301,_0x38c8fd){const _0x339776=a102_0x3d58,_0x520d49=segmentResponseToDefSync(_0x3f315a,_0x38c8fd);if(!_0x588301||!_0x588301['resolveSegmentName'])return _0x520d49;return _0x520d49[_0x339776(0xbc)]&&(_0x520d49[_0x339776(0xbc)]=await resolveRuleSegmentRefs(_0x520d49['rule'],_0x588301['resolveSegmentName'])),_0x520d49;}export function apiRuleToYaml(_0x4211ce){const _0x2c77eb=a102_0x3d58,_0xc0472e=(_0x4211ce[_0x2c77eb(0xab)]||[])[_0x2c77eb(0x102)](apiConditionToYaml);if(_0xc0472e['length']===0x1&&!_0x4211ce[_0x2c77eb(0xcd)]&&_0x2c77eb(0xb7)in _0xc0472e[0x0]&&(_0xc0472e[0x0]['type']===_0x2c77eb(0x94)||_0xc0472e[0x0][_0x2c77eb(0xb7)]==='Or')){const _0x53357b=_0xc0472e[0x0];if(_0x53357b[_0x2c77eb(0xb7)]===_0x4211ce[_0x2c77eb(0xb7)]&&_0x53357b['conditions'])return{'type':_0x4211ce[_0x2c77eb(0xb7)],'conditions':_0x53357b[_0x2c77eb(0xab)],..._0x53357b[_0x2c77eb(0xcd)]&&{'description':_0x53357b[_0x2c77eb(0xcd)]}};}return{'type':_0x4211ce[_0x2c77eb(0xb7)],'conditions':_0xc0472e,..._0x4211ce[_0x2c77eb(0xcd)]&&{'description':_0x4211ce[_0x2c77eb(0xcd)]}};}export async function resolveRuleSegmentRefs(_0x59ee5e,_0x220622){const _0x3b867a=a102_0x3d58,_0x547a25=await Promise[_0x3b867a(0x8f)](_0x59ee5e[_0x3b867a(0xab)][_0x3b867a(0x102)](_0x3dccef=>resolveConditionSegmentRefs(_0x3dccef,_0x220622)));return{..._0x59ee5e,'conditions':_0x547a25};}async function resolveConditionSegmentRefs(_0x50d921,_0x216a30){const _0x5759c1=a102_0x3d58;if(_0x5759c1(0xfe)in _0x50d921&&(_0x50d921[_0x5759c1(0xb7)]===_0x5759c1(0xa8)||_0x50d921[_0x5759c1(0xb7)]===_0x5759c1(0x79))){const _0x49d080=_0x50d921;if(/^\d+$/[_0x5759c1(0xde)](_0x49d080['segment'])){const _0x55f6a4=await _0x216a30(_0x49d080[_0x5759c1(0xfe)]);return{..._0x49d080,'segment':_0x55f6a4};}return _0x50d921;}if('conditions'in _0x50d921&&_0x50d921[_0x5759c1(0xab)]){const _0x4cc9d4=_0x50d921,_0x2cf176=await Promise['all'](_0x4cc9d4['conditions'][_0x5759c1(0x102)](_0x8d1d27=>resolveConditionSegmentRefs(_0x8d1d27,_0x216a30)));return{..._0x4cc9d4,'conditions':_0x2cf176};}if('filter'in _0x50d921&&_0x50d921[_0x5759c1(0x104)]){const _0x55aab7=_0x50d921,_0x4888a6=await resolveRuleSegmentRefs(_0x55aab7[_0x5759c1(0x104)],_0x216a30);return{..._0x55aab7,'filter':_0x4888a6};}return _0x50d921;}export async function resolveRuleSegmentIds(_0xe1b6bd,_0x423cdf){const _0x2c4691=a102_0x3d58,_0x56971d=await Promise['all'](_0xe1b6bd['conditions'][_0x2c4691(0x102)](_0x36a587=>resolveConditionSegmentIds(_0x36a587,_0x423cdf)));return{..._0xe1b6bd,'conditions':_0x56971d};}async function resolveConditionSegmentIds(_0x13d853,_0x13e9c1){const _0xd39f8d=a102_0x3d58;if('segment'in _0x13d853&&(_0x13d853[_0xd39f8d(0xb7)]===_0xd39f8d(0xa8)||_0x13d853['type']==='exclude')){const _0x22a8ab=_0x13d853;if(!/^\d+$/[_0xd39f8d(0xde)](_0x22a8ab[_0xd39f8d(0xfe)])){const _0x3d73c5=await _0x13e9c1(_0x22a8ab[_0xd39f8d(0xfe)]);return{..._0x22a8ab,'segment':_0x3d73c5};}return _0x13d853;}if(_0xd39f8d(0xab)in _0x13d853&&_0x13d853[_0xd39f8d(0xab)]){const _0x311948=_0x13d853,_0x2bda1a=await Promise[_0xd39f8d(0x8f)](_0x311948['conditions'][_0xd39f8d(0x102)](_0x366671=>resolveConditionSegmentIds(_0x366671,_0x13e9c1)));return{..._0x311948,'conditions':_0x2bda1a};}if(_0xd39f8d(0x104)in _0x13d853&&_0x13d853[_0xd39f8d(0x104)]){const _0xe059b4=_0x13d853,_0x201ba9=await resolveRuleSegmentIds(_0xe059b4[_0xd39f8d(0x104)],_0x13e9c1);return{..._0xe059b4,'filter':_0x201ba9};}return _0x13d853;}function apiConditionToYaml(_0x479705){const _0x5e3626=a102_0x3d58;if(_0x479705['type']===_0x5e3626(0x94)||_0x479705[_0x5e3626(0xb7)]==='Or'){if(_0x479705[_0x5e3626(0xab)]){const _0x5c2055=_0x479705[_0x5e3626(0xab)]['map'](apiConditionToYaml);if(_0x5c2055[_0x5e3626(0xbb)]===0x1&&!_0x479705[_0x5e3626(0xcd)])return _0x5c2055[0x0];return{'type':_0x479705['type'],'conditions':_0x5c2055,..._0x479705[_0x5e3626(0xcd)]&&{'description':_0x479705[_0x5e3626(0xcd)]}};}}if(_0x479705[_0x5e3626(0xb7)]===_0x5e3626(0x100)&&_0x479705[_0x5e3626(0x76)]&&_0x479705[_0x5e3626(0x99)]){const _0x2fc4f8=_0x479705[_0x5e3626(0x76)]['aggregation']?{'type':_0x479705['leftValue']['aggregation'][_0x5e3626(0xb7)],..._0x479705[_0x5e3626(0x76)][_0x5e3626(0xf2)][_0x5e3626(0x108)]&&{'groupingColumns':_0x479705[_0x5e3626(0x76)]['aggregation'][_0x5e3626(0x108)]}}:undefined;return{'type':_0x5e3626(0x100),'attribute':_0x479705[_0x5e3626(0x76)][_0x5e3626(0xcb)]||'','operator':apiOperatorToYaml(_0x479705['operator']),..._0x479705[_0x5e3626(0xe8)]&&_0x479705['arrayMatching']!==_0x5e3626(0xf6)?{'arrayMatching':_0x479705[_0x5e3626(0xe8)]}:{},..._0x479705[_0x5e3626(0x79)]?{'exclude':_0x479705[_0x5e3626(0x79)]}:{},..._0x2fc4f8?{'aggregation':_0x2fc4f8}:{},..._0x479705[_0x5e3626(0x76)][_0x5e3626(0xbe)]?{'source':_0x479705[_0x5e3626(0x76)][_0x5e3626(0xbe)][_0x5e3626(0xcb)]}:{},..._0x479705[_0x5e3626(0x76)]['filter']?{'filter':apiRuleToYaml(_0x479705[_0x5e3626(0x76)][_0x5e3626(0x104)])}:{},..._0x479705['limit']!==undefined&&_0x479705[_0x5e3626(0x9d)]!==null?{'limit':_0x479705['limit']}:{}};}if(_0x479705['type']===_0x5e3626(0xae)&&_0x479705['id'])return{'type':_0x479705[_0x5e3626(0x79)]?_0x5e3626(0x79):_0x5e3626(0xa8),'segment':_0x479705['id']};return{'type':_0x5e3626(0x94),'conditions':[]};}function isTemporalOperator(_0x4ba5e1){const _0x6d0034=a102_0x3d58;return _0x4ba5e1===_0x6d0034(0xa9)||_0x4ba5e1===_0x6d0034(0xdd);}function getEffectiveValue(_0x1b1139){const _0x152dc3=a102_0x3d58,_0x56f73f=_0x1b1139[_0x152dc3(0xb5)];return _0x1b1139[_0x152dc3(0xcc)]??_0x56f73f;}function apiOperatorToYaml(_0x5e1336){const _0x3624f3=a102_0x3d58;let _0x4265df;if(_0x5e1336[_0x3624f3(0xa2)]&&_0x5e1336[_0x3624f3(0xa2)][_0x3624f3(0xbb)]>0x0)_0x4265df=_0x5e1336['rightValues'];else{if(_0x5e1336['rightValue']!==undefined)_0x4265df=_0x5e1336[_0x3624f3(0x87)];else isTemporalOperator(_0x5e1336[_0x3624f3(0xb7)])&&_0x5e1336['value']!==undefined&&(_0x4265df=_0x5e1336[_0x3624f3(0xcc)]);}return{'type':mapApiOperatorType(_0x5e1336[_0x3624f3(0xb7)]),..._0x5e1336[_0x3624f3(0x78)]&&{'not':_0x5e1336[_0x3624f3(0x78)]},..._0x4265df!==undefined&&{'value':_0x4265df},..._0x5e1336['unit']&&{'unit':_0x5e1336[_0x3624f3(0x82)]}};}function mapApiOperatorType(_0x1a75c8){return _0x1a75c8;}export function segmentDefToCreateRequest(_0x5cb5ab,_0x3913df){const _0x4fbee2=a102_0x3d58,_0x5ba523={'name':_0x5cb5ab[_0x4fbee2(0xcb)]};return _0x5cb5ab[_0x4fbee2(0xcd)]&&(_0x5ba523[_0x4fbee2(0xcd)]=_0x5cb5ab[_0x4fbee2(0xcd)]),_0x5cb5ab[_0x4fbee2(0xbc)]&&(_0x5ba523[_0x4fbee2(0xbc)]=yamlRuleToApi(_0x5cb5ab[_0x4fbee2(0xbc)])),_0x5cb5ab[_0x4fbee2(0x93)]&&(_0x5ba523[_0x4fbee2(0x93)]=_0x5cb5ab[_0x4fbee2(0x93)]===_0x4fbee2(0x7f)?0x0:_0x5cb5ab[_0x4fbee2(0x93)]==='realtime'?0x1:0x2),_0x5cb5ab[_0x4fbee2(0x107)]!==undefined&&(_0x5ba523[_0x4fbee2(0xc3)]=_0x5cb5ab[_0x4fbee2(0x107)]),_0x3913df&&(_0x5ba523[_0x4fbee2(0x9b)]=_0x3913df),_0x5ba523;}export function segmentDefToUpdateRequest(_0x12f931){const _0x203665=a102_0x3d58,_0x16294e={'name':_0x12f931[_0x203665(0xcb)]};return _0x12f931[_0x203665(0xcd)]!==undefined&&(_0x16294e[_0x203665(0xcd)]=_0x12f931[_0x203665(0xcd)]),_0x12f931[_0x203665(0xbc)]&&(_0x16294e[_0x203665(0xbc)]=yamlRuleToApi(_0x12f931['rule'])),_0x12f931[_0x203665(0x93)]&&(_0x16294e[_0x203665(0x93)]=_0x12f931[_0x203665(0x93)]===_0x203665(0x7f)?0x0:_0x12f931['kind']===_0x203665(0xb4)?0x1:0x2),_0x16294e;}export function yamlRuleToApi(_0x183bd8,_0x34e4f7=![]){const _0x1cc95b=a102_0x3d58,_0x42c286=_0x183bd8[_0x1cc95b(0xab)][_0x1cc95b(0x102)](yamlConditionToApi);if(_0x34e4f7){const _0x4168d2=_0x42c286[_0x1cc95b(0xc6)](_0x29a9e1=>_0x29a9e1[_0x1cc95b(0xb7)]===_0x1cc95b(0x94)||_0x29a9e1['type']==='Or');if(!_0x4168d2&&_0x42c286['length']>0x0)return{'type':_0x183bd8[_0x1cc95b(0xb7)],'conditions':[{'type':_0x1cc95b(0x94),'description':_0x183bd8['description']||'','conditions':_0x42c286}]};}return{'type':_0x183bd8[_0x1cc95b(0xb7)],'conditions':_0x42c286,..._0x183bd8['description']&&{'description':_0x183bd8[_0x1cc95b(0xcd)]}};}function yamlConditionToApi(_0x4b6a5f){const _0x115215=a102_0x3d58;if(_0x115215(0xfe)in _0x4b6a5f&&(_0x4b6a5f[_0x115215(0xb7)]===_0x115215(0xa8)||_0x4b6a5f[_0x115215(0xb7)]===_0x115215(0x79))){const _0x5287fb=_0x4b6a5f;return{'type':_0x115215(0xae),'id':_0x5287fb[_0x115215(0xfe)],'exclude':_0x5287fb[_0x115215(0xb7)]===_0x115215(0x79)};}if(_0x115215(0xb7)in _0x4b6a5f&&(_0x4b6a5f['type']===_0x115215(0x94)||_0x4b6a5f[_0x115215(0xb7)]==='Or')){const _0x380f25=_0x4b6a5f;return{'type':_0x380f25[_0x115215(0xb7)],'conditions':_0x380f25[_0x115215(0xab)][_0x115215(0x102)](yamlConditionToApi),..._0x380f25[_0x115215(0xcd)]&&{'description':_0x380f25[_0x115215(0xcd)]}};}const _0x3c7cb5=_0x4b6a5f,_0x3be188={'type':'Value','leftValue':buildLeftValue(_0x3c7cb5),'operator':yamlOperatorToApi(_0x3c7cb5[_0x115215(0x99)]),'exclude':_0x3c7cb5[_0x115215(0x79)]??![],'arrayMatching':_0x3c7cb5[_0x115215(0xe8)]??'any'};return _0x3c7cb5[_0x115215(0x9d)]!==undefined&&(_0x3be188[_0x115215(0x9d)]=_0x3c7cb5[_0x115215(0x9d)]),_0x3be188;}function buildLeftValue(_0x4176f1){const _0x469a46=a102_0x3d58,_0x2939b7={'name':_0x4176f1['attribute']};return _0x4176f1[_0x469a46(0xf2)]&&(_0x2939b7[_0x469a46(0xf2)]={'type':_0x4176f1[_0x469a46(0xf2)][_0x469a46(0xb7)],..._0x4176f1[_0x469a46(0xf2)][_0x469a46(0x108)]&&{'groupingColumns':_0x4176f1[_0x469a46(0xf2)][_0x469a46(0x108)]}}),_0x4176f1[_0x469a46(0xbe)]&&(_0x2939b7['source']={'name':_0x4176f1['source']}),_0x4176f1[_0x469a46(0x104)]&&(_0x2939b7['filter']=yamlRuleToApi(_0x4176f1['filter'])),_0x2939b7;}function yamlOperatorToApi(_0x10a23c){const _0x3ec5aa=a102_0x3d58,_0x59f70b={'type':mapYamlOperatorType(_0x10a23c[_0x3ec5aa(0xb7)]),'not':_0x10a23c[_0x3ec5aa(0x78)]??![]},_0x35ab7c=getEffectiveValue(_0x10a23c);if(_0x35ab7c!==undefined){if(Array['isArray'](_0x35ab7c))_0x59f70b['rightValues']=_0x35ab7c;else isTemporalOperator(_0x10a23c[_0x3ec5aa(0xb7)])?_0x59f70b[_0x3ec5aa(0xcc)]=_0x35ab7c:_0x59f70b[_0x3ec5aa(0x87)]=_0x35ab7c;}return _0x10a23c['unit']&&(_0x59f70b['unit']=_0x10a23c[_0x3ec5aa(0x82)]),_0x59f70b;}function mapYamlOperatorType(_0x3f5931){return _0x3f5931;}export function toYamlString(_0x309472){const _0x1a912e=a102_0x3d58,_0x23c376=JSON[_0x1a912e(0xe3)](JSON[_0x1a912e(0xc0)](_0x309472)),_0x2f29b7=a102_0xc5c917[_0x1a912e(0xc0)](_0x23c376,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x4b8366=[_0x1a912e(0x92)];let _0xd98479=_0x2f29b7;for(const _0x1ea69b of _0x4b8366){_0xd98479=_0xd98479['replace'](new RegExp('^('+_0x1ea69b+')','m'),(_0xd27ff,_0x4650a1,_0x52af20)=>{if(_0x52af20===0x0||_0xd98479[_0x52af20-0x1]==='\x0a'&&_0xd98479[_0x52af20-0x2]==='\x0a')return _0x4650a1;return'\x0a'+_0x4650a1;});}return _0xd98479;}function a102_0x3d58(_0x462dad,_0x7f0ac5){_0x462dad=_0x462dad-0x75;const _0x110976=a102_0x1109();let _0x3d584d=_0x110976[_0x462dad];return _0x3d584d;}export function parseYamlString(_0x2bfb09){const _0x598163=a102_0x3d58,_0x4bec3d=a102_0xc5c917[_0x598163(0xe3)](_0x2bfb09);if(!_0x4bec3d['name'])throw new Error(_0x598163(0xd8));if(_0x4bec3d[_0x598163(0xb7)]&&_0x4bec3d['type']!==_0x598163(0xfe))throw new Error(_0x598163(0x89)+_0x4bec3d[_0x598163(0xb7)]);return _0x4bec3d;}export function isSegmentYaml(_0x8566c6){const _0x3e649d=a102_0x3d58;if(typeof _0x8566c6!=='object'||_0x8566c6===null)return![];const _0x1814e4=_0x8566c6;return _0x1814e4[_0x3e649d(0xb7)]===_0x3e649d(0xfe)||_0x1814e4['type']===undefined;}export function generateTemplate(_0x51aaa3=a102_0x4d77d2(0xb6)){const _0x138990=a102_0x4d77d2,_0x341995={'type':_0x138990(0xfe),'name':_0x51aaa3,'description':_0x138990(0xb1),'rule':{'type':_0x138990(0x94),'conditions':[{'type':_0x138990(0x100),'attribute':_0x138990(0xeb),'operator':{'type':_0x138990(0xb2),'value':_0x138990(0xcc)}}]}};return toYamlString(_0x341995);}export function segmentToYamlString(_0x1b0fb9){const _0x3bd6ca=a102_0x4d77d2,_0x4f338a=JSON['parse'](JSON[_0x3bd6ca(0xc0)](_0x1b0fb9)),_0x5f4698=a102_0xc5c917[_0x3bd6ca(0xc0)](_0x4f338a,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x3bd6ca(0xda)}),_0x2fd506=[_0x3bd6ca(0x92),_0x3bd6ca(0x75)];let _0x12ab45=_0x5f4698;for(const _0x24c0ad of _0x2fd506){_0x12ab45=_0x12ab45['replace'](new RegExp('^('+_0x24c0ad+')','m'),(_0x178e9a,_0x3ae201,_0x27d942)=>{if(_0x27d942===0x0||_0x12ab45[_0x27d942-0x1]==='\x0a'&&_0x12ab45[_0x27d942-0x2]==='\x0a')return _0x3ae201;return'\x0a'+_0x3ae201;});}return _0x12ab45;}export function parseSegmentYamlFile(_0x30e6f7){const _0x541e3b=a102_0x4d77d2,_0x2a9d44=a102_0xc5c917[_0x541e3b(0xe3)](_0x30e6f7);if(!_0x2a9d44['name'])throw new Error(_0x541e3b(0xd8));return _0x2a9d44;}export function normalizeChildSegmentYaml(_0x1dc8fc){const _0x4f2461=a102_0x4d77d2;return{'type':'segment','name':_0x1dc8fc['name'],..._0x1dc8fc[_0x4f2461(0xcd)]!==undefined&&{'description':_0x1dc8fc['description']},..._0x1dc8fc[_0x4f2461(0xef)]!==undefined&&{'folder':_0x1dc8fc['folder']},..._0x1dc8fc[_0x4f2461(0xbc)]&&{'rule':normalizeRule(_0x1dc8fc[_0x4f2461(0xbc)])},..._0x1dc8fc[_0x4f2461(0x93)]!==undefined&&{'kind':_0x1dc8fc[_0x4f2461(0x93)]},..._0x1dc8fc[_0x4f2461(0x107)]!==undefined&&{'visible':_0x1dc8fc[_0x4f2461(0x107)]},..._0x1dc8fc[_0x4f2461(0xdf)]&&{'activations':_0x1dc8fc[_0x4f2461(0xdf)]['map'](normalizeActivation)}};}export function normalizeRule(_0x20e130){const _0x307444=a102_0x4d77d2;return{'type':_0x20e130[_0x307444(0xb7)],'conditions':_0x20e130[_0x307444(0xab)][_0x307444(0x102)](normalizeCondition),..._0x20e130[_0x307444(0xcd)]!==undefined&&{'description':_0x20e130[_0x307444(0xcd)]}};}function normalizeCondition(_0x4cbb89){const _0x346851=a102_0x4d77d2;if('segment'in _0x4cbb89&&(_0x4cbb89['type']===_0x346851(0xa8)||_0x4cbb89[_0x346851(0xb7)]===_0x346851(0x79))){const _0xe59b83=_0x4cbb89;return{'type':_0xe59b83[_0x346851(0xb7)],'segment':_0xe59b83[_0x346851(0xfe)]};}if(_0x346851(0xb7)in _0x4cbb89&&(_0x4cbb89[_0x346851(0xb7)]==='And'||_0x4cbb89['type']==='Or')){const _0x3780c5=_0x4cbb89;return{'type':_0x3780c5[_0x346851(0xb7)],'conditions':_0x3780c5[_0x346851(0xab)]['map'](normalizeCondition),..._0x3780c5[_0x346851(0xcd)]!==undefined&&{'description':_0x3780c5[_0x346851(0xcd)]}};}const _0x40f464=_0x4cbb89;return{'type':'Value','attribute':_0x40f464[_0x346851(0xb0)],'operator':normalizeOperator(_0x40f464['operator']),..._0x40f464['arrayMatching']!==undefined&&{'arrayMatching':_0x40f464['arrayMatching']},..._0x40f464[_0x346851(0x79)]!==undefined&&{'exclude':_0x40f464[_0x346851(0x79)]},..._0x40f464[_0x346851(0xf2)]!==undefined&&{'aggregation':_0x40f464['aggregation']},..._0x40f464[_0x346851(0xbe)]!==undefined&&{'source':_0x40f464[_0x346851(0xbe)]},..._0x40f464['filter']!==undefined&&{'filter':normalizeRule(_0x40f464[_0x346851(0x104)])},..._0x40f464[_0x346851(0x9d)]!==undefined&&{'limit':_0x40f464[_0x346851(0x9d)]}};}function normalizeOperator(_0x3d7164){const _0x2c288c=a102_0x4d77d2,_0x3f914=getEffectiveValue(_0x3d7164);return{'type':_0x3d7164[_0x2c288c(0xb7)],..._0x3d7164[_0x2c288c(0x78)]!==undefined&&{'not':_0x3d7164[_0x2c288c(0x78)]},..._0x3f914!==undefined&&{'value':_0x3f914},..._0x3d7164['min']!==undefined&&{'min':_0x3d7164[_0x2c288c(0x96)]},..._0x3d7164[_0x2c288c(0xe2)]!==undefined&&{'max':_0x3d7164[_0x2c288c(0xe2)]},..._0x3d7164[_0x2c288c(0x82)]!==undefined&&{'unit':_0x3d7164[_0x2c288c(0x82)]},..._0x3d7164[_0x2c288c(0xed)]!==undefined&&{'duration':_0x3d7164[_0x2c288c(0xed)]},..._0x3d7164['from']!==undefined&&{'from':_0x3d7164['from']}};}function normalizeActivation(_0x379d47){const _0x8cb86a=a102_0x4d77d2;return{'name':_0x379d47[_0x8cb86a(0xcb)],'connection':_0x379d47[_0x8cb86a(0xf5)],..._0x379d47['description']!==undefined&&{'description':_0x379d47[_0x8cb86a(0xcd)]},..._0x379d47[_0x8cb86a(0xfc)]!==undefined&&{'all_columns':_0x379d47['all_columns']},..._0x379d47[_0x8cb86a(0xd2)]!==undefined&&{'columns':_0x379d47['columns']},..._0x379d47['behavior']!==undefined&&{'behavior':_0x379d47[_0x8cb86a(0x9f)]},..._0x379d47[_0x8cb86a(0xf9)]!==undefined&&{'schedule':_0x379d47[_0x8cb86a(0xf9)]},..._0x379d47['notification']!==undefined&&{'notification':_0x379d47['notification']},..._0x379d47[_0x8cb86a(0xd7)]!==undefined&&{'connector_config':_0x379d47['connector_config']},..._0x379d47['activation_template_id']!==undefined&&{'activation_template_id':_0x379d47['activation_template_id']}};}export function activationResponseToDef(_0x1a2ae1,_0x1bf273,_0x348242){const _0x20e0e6=a102_0x4d77d2,_0x428954=_0x1a2ae1[_0x20e0e6(0xb8)]||'',_0x536f39=_0x348242?.[_0x20e0e6(0xf7)](_0x428954)??_0x428954,_0x23d131={'name':_0x1a2ae1['name'],'connection':_0x536f39};_0x1a2ae1[_0x20e0e6(0xcd)]&&(_0x23d131[_0x20e0e6(0xcd)]=_0x1a2ae1[_0x20e0e6(0xcd)]);let _0x4d3e12=[];_0x1a2ae1[_0x20e0e6(0xd2)]&&_0x1a2ae1[_0x20e0e6(0xd2)][_0x20e0e6(0xbb)]>0x0&&(_0x4d3e12=_0x1a2ae1[_0x20e0e6(0xd2)][_0x20e0e6(0x104)](_0x325dc6=>_0x325dc6&&_0x325dc6[_0x20e0e6(0xcb)])[_0x20e0e6(0x102)](_0x3ad1d3=>{const _0x2e3dfc=_0x20e0e6;if(_0x3ad1d3[_0x2e3dfc(0xb7)]||_0x3ad1d3['visibility'])return{'name':_0x3ad1d3[_0x2e3dfc(0xcb)],..._0x3ad1d3['type']&&{'type':_0x3ad1d3[_0x2e3dfc(0xb7)]},..._0x3ad1d3[_0x2e3dfc(0xea)]&&{'visibility':_0x3ad1d3[_0x2e3dfc(0xea)]}};return _0x3ad1d3[_0x2e3dfc(0xcb)];}));_0x4d3e12['length']>0x0&&(_0x23d131[_0x20e0e6(0xd2)]=_0x4d3e12);_0x1a2ae1['allColumns']!==undefined&&(_0x1a2ae1[_0x20e0e6(0xe4)]===![]&&_0x4d3e12[_0x20e0e6(0xbb)]===0x0?_0x23d131[_0x20e0e6(0xfc)]=!![]:_0x23d131[_0x20e0e6(0xfc)]=_0x1a2ae1[_0x20e0e6(0xe4)]);const _0x5ebff7={};let _0x159414=![];_0x1a2ae1['scheduleType']&&(_0x5ebff7[_0x20e0e6(0xb7)]=_0x1a2ae1[_0x20e0e6(0x7a)],_0x159414=!![]);_0x1a2ae1['repeatUnit']&&(_0x5ebff7[_0x20e0e6(0xc4)]=_0x1a2ae1[_0x20e0e6(0xf1)],_0x159414=!![]);_0x1a2ae1['repeatFrequency']!==undefined&&_0x1a2ae1[_0x20e0e6(0xee)]!==null&&(_0x5ebff7[_0x20e0e6(0xd1)]=_0x1a2ae1[_0x20e0e6(0xee)],_0x159414=!![]);_0x1a2ae1[_0x20e0e6(0xb3)]&&_0x1a2ae1[_0x20e0e6(0xb3)][_0x20e0e6(0xbb)]>0x0&&(_0x5ebff7['repeat_sub_frequency']=_0x1a2ae1[_0x20e0e6(0xb3)],_0x159414=!![]);_0x1a2ae1[_0x20e0e6(0xc8)]!==undefined&&(_0x5ebff7[_0x20e0e6(0xc5)]=_0x1a2ae1[_0x20e0e6(0xc8)],_0x159414=!![]);_0x1a2ae1['endOn']!==undefined&&(_0x5ebff7[_0x20e0e6(0xcf)]=_0x1a2ae1['endOn'],_0x159414=!![]);_0x1a2ae1[_0x20e0e6(0x77)]&&(_0x5ebff7[_0x20e0e6(0x77)]=_0x1a2ae1[_0x20e0e6(0x77)],_0x159414=!![]);_0x159414&&(_0x23d131[_0x20e0e6(0xf9)]=_0x5ebff7);(_0x1a2ae1[_0x20e0e6(0xc1)]&&_0x1a2ae1['notifyOn'][_0x20e0e6(0xbb)]>0x0||_0x1a2ae1['emailRecipients']&&_0x1a2ae1[_0x20e0e6(0xd9)][_0x20e0e6(0xbb)]>0x0)&&(_0x23d131[_0x20e0e6(0x106)]={},_0x1a2ae1['notifyOn']&&_0x1a2ae1[_0x20e0e6(0xc1)][_0x20e0e6(0xbb)]>0x0&&(_0x23d131[_0x20e0e6(0x106)][_0x20e0e6(0x7c)]=_0x1a2ae1['notifyOn']),_0x1a2ae1[_0x20e0e6(0xd9)]&&_0x1a2ae1[_0x20e0e6(0xd9)][_0x20e0e6(0xbb)]>0x0&&(_0x23d131['notification'][_0x20e0e6(0x9e)]=_0x1a2ae1[_0x20e0e6(0xd9)][_0x20e0e6(0x102)](_0x3e0458=>{const _0x12e707=_0x1bf273?.['get'](_0x3e0458);return _0x12e707??String(_0x3e0458);})));_0x1a2ae1['connectorConfig']&&Object[_0x20e0e6(0xa0)](_0x1a2ae1[_0x20e0e6(0xe6)])['length']>0x0&&(_0x23d131[_0x20e0e6(0xd7)]=normalizeConnectorConfigForYaml(_0x1a2ae1[_0x20e0e6(0xe6)]));_0x1a2ae1[_0x20e0e6(0xc7)]&&(_0x23d131[_0x20e0e6(0x105)]=_0x1a2ae1[_0x20e0e6(0xc7)]);if(_0x1a2ae1[_0x20e0e6(0xfd)]){const _0x1d6885={},_0x46d271=_0x1a2ae1[_0x20e0e6(0xfd)];_0x46d271['columns']&&_0x46d271['columns'][_0x20e0e6(0xbb)]>0x0&&(_0x1d6885[_0x20e0e6(0xd2)]=_0x46d271['columns'][_0x20e0e6(0x104)](_0x101f26=>_0x101f26&&_0x101f26[_0x20e0e6(0xcb)])[_0x20e0e6(0x102)](_0x236922=>({'name':_0x236922[_0x20e0e6(0xcb)],..._0x236922['type']&&{'type':_0x236922[_0x20e0e6(0xb7)]},..._0x236922[_0x20e0e6(0xea)]&&{'visibility':_0x236922[_0x20e0e6(0xea)]}}))),_0x46d271[_0x20e0e6(0xc9)]&&(_0x1d6885[_0x20e0e6(0x85)]=_0x46d271['behaviorTableName']),_0x46d271[_0x20e0e6(0xdc)]!==undefined&&(_0x1d6885[_0x20e0e6(0x97)]=_0x46d271[_0x20e0e6(0xdc)]),_0x46d271[_0x20e0e6(0xfb)]&&(_0x1d6885[_0x20e0e6(0x88)]=_0x46d271[_0x20e0e6(0xfb)]),_0x46d271[_0x20e0e6(0xf4)]&&(_0x1d6885[_0x20e0e6(0xf4)]=_0x46d271['formatting']),_0x46d271[_0x20e0e6(0x84)]&&_0x46d271[_0x20e0e6(0x84)][_0x20e0e6(0xbb)]>0x0&&(_0x1d6885[_0x20e0e6(0x95)]=_0x46d271[_0x20e0e6(0x84)]),Object[_0x20e0e6(0xa0)](_0x1d6885)[_0x20e0e6(0xbb)]>0x0&&(_0x23d131[_0x20e0e6(0x9f)]=_0x1d6885);}return _0x23d131;}export function journeyActivationStepToYaml(_0x1f0acf,_0x2420b9,_0x120c16){const _0x52d7a7=a102_0x4d77d2,_0x238c56=_0x1f0acf[_0x52d7a7(0xf8)][_0x52d7a7(0xff)],_0x22cd9a=_0x238c56[_0x52d7a7(0xb8)]||'',_0x15e1e8=_0x120c16?.['get'](_0x22cd9a)??_0x22cd9a,_0x17525c={'name':_0x238c56[_0x52d7a7(0xcb)]||'','connection':_0x15e1e8};_0x238c56['description']&&(_0x17525c[_0x52d7a7(0xcd)]=_0x238c56['description']);let _0x55aa27=[];_0x238c56[_0x52d7a7(0xd2)]&&_0x238c56[_0x52d7a7(0xd2)][_0x52d7a7(0xbb)]>0x0&&(_0x55aa27=_0x238c56['columns'][_0x52d7a7(0x104)](_0x1d9d0d=>_0x1d9d0d&&_0x1d9d0d[_0x52d7a7(0xcb)])[_0x52d7a7(0x102)](_0x44ecf9=>{const _0x5c5b74=_0x52d7a7;if(_0x44ecf9[_0x5c5b74(0xb7)]||_0x44ecf9[_0x5c5b74(0xea)])return{'name':_0x44ecf9[_0x5c5b74(0xcb)],..._0x44ecf9[_0x5c5b74(0xb7)]&&{'type':_0x44ecf9['type']},..._0x44ecf9['visibility']&&{'visibility':_0x44ecf9[_0x5c5b74(0xea)]}};return _0x44ecf9[_0x5c5b74(0xcb)];}));_0x55aa27[_0x52d7a7(0xbb)]>0x0&&(_0x17525c[_0x52d7a7(0xd2)]=_0x55aa27);_0x238c56[_0x52d7a7(0xe4)]!==undefined&&(_0x238c56['allColumns']===![]&&_0x55aa27['length']===0x0?_0x17525c[_0x52d7a7(0xfc)]=!![]:_0x17525c[_0x52d7a7(0xfc)]=_0x238c56['allColumns']);const _0x35c788={};let _0x464dc4=![];_0x238c56[_0x52d7a7(0x7a)]&&(_0x35c788[_0x52d7a7(0xb7)]=_0x238c56[_0x52d7a7(0x7a)],_0x464dc4=!![]);_0x238c56[_0x52d7a7(0xf1)]&&(_0x35c788[_0x52d7a7(0xc4)]=_0x238c56[_0x52d7a7(0xf1)],_0x464dc4=!![]);_0x238c56['repeatFrequency']!==undefined&&_0x238c56[_0x52d7a7(0xee)]!==null&&(_0x35c788['repeat_frequency']=_0x238c56['repeatFrequency'],_0x464dc4=!![]);_0x238c56[_0x52d7a7(0xc8)]!==undefined&&(_0x35c788['start_at']=_0x238c56[_0x52d7a7(0xc8)],_0x464dc4=!![]);_0x238c56[_0x52d7a7(0xb9)]!==undefined&&(_0x35c788['end_on']=_0x238c56[_0x52d7a7(0xb9)],_0x464dc4=!![]);_0x238c56[_0x52d7a7(0x77)]&&(_0x35c788[_0x52d7a7(0x77)]=_0x238c56[_0x52d7a7(0x77)],_0x464dc4=!![]);_0x464dc4&&(_0x17525c['schedule']=_0x35c788);(_0x238c56[_0x52d7a7(0xc1)]&&_0x238c56[_0x52d7a7(0xc1)]['length']>0x0||_0x238c56[_0x52d7a7(0xd9)]&&_0x238c56[_0x52d7a7(0xd9)][_0x52d7a7(0xbb)]>0x0)&&(_0x17525c[_0x52d7a7(0x106)]={},_0x238c56[_0x52d7a7(0xc1)]&&_0x238c56['notifyOn'][_0x52d7a7(0xbb)]>0x0&&(_0x17525c[_0x52d7a7(0x106)][_0x52d7a7(0x7c)]=_0x238c56[_0x52d7a7(0xc1)]),_0x238c56[_0x52d7a7(0xd9)]&&_0x238c56[_0x52d7a7(0xd9)][_0x52d7a7(0xbb)]>0x0&&(_0x17525c[_0x52d7a7(0x106)][_0x52d7a7(0x9e)]=_0x238c56[_0x52d7a7(0xd9)][_0x52d7a7(0x102)](_0x19f2ee=>{const _0x39823a=_0x2420b9?.['get'](_0x19f2ee);return _0x39823a??String(_0x19f2ee);})));_0x238c56[_0x52d7a7(0xe6)]&&Object[_0x52d7a7(0xa0)](_0x238c56[_0x52d7a7(0xe6)])[_0x52d7a7(0xbb)]>0x0&&(_0x17525c[_0x52d7a7(0xd7)]=normalizeConnectorConfigForYaml(_0x238c56[_0x52d7a7(0xe6)]));_0x238c56[_0x52d7a7(0xc7)]&&(_0x17525c[_0x52d7a7(0x105)]=_0x238c56['activationTemplateId']);if(_0x238c56['syndicationBehavior']){const _0x3d7a75={},_0x19112e=_0x238c56['syndicationBehavior'];_0x19112e[_0x52d7a7(0xd2)]&&_0x19112e[_0x52d7a7(0xd2)][_0x52d7a7(0xbb)]>0x0&&(_0x3d7a75['columns']=_0x19112e[_0x52d7a7(0xd2)][_0x52d7a7(0x104)](_0x282314=>_0x282314&&_0x282314[_0x52d7a7(0xcb)])[_0x52d7a7(0x102)](_0x43f251=>({'name':_0x43f251[_0x52d7a7(0xcb)],..._0x43f251[_0x52d7a7(0xb7)]&&{'type':_0x43f251[_0x52d7a7(0xb7)]},..._0x43f251[_0x52d7a7(0xea)]&&{'visibility':_0x43f251[_0x52d7a7(0xea)]}}))),_0x19112e[_0x52d7a7(0xc9)]&&(_0x3d7a75['behavior_table']=_0x19112e[_0x52d7a7(0xc9)]),_0x19112e[_0x52d7a7(0xdc)]!==undefined&&(_0x3d7a75[_0x52d7a7(0x97)]=_0x19112e['joinRow']),_0x19112e[_0x52d7a7(0xfb)]&&(_0x3d7a75[_0x52d7a7(0x88)]=_0x19112e[_0x52d7a7(0xfb)]),_0x19112e[_0x52d7a7(0xf4)]&&(_0x3d7a75[_0x52d7a7(0xf4)]=_0x19112e[_0x52d7a7(0xf4)]),_0x19112e['orderBy']&&_0x19112e[_0x52d7a7(0x84)]['length']>0x0&&(_0x3d7a75[_0x52d7a7(0x95)]=_0x19112e[_0x52d7a7(0x84)]),Object[_0x52d7a7(0xa0)](_0x3d7a75)[_0x52d7a7(0xbb)]>0x0&&(_0x17525c[_0x52d7a7(0x9f)]=_0x3d7a75);}return _0x17525c;}export function segmentWithActivationsToYaml(_0x3536b7,_0x546bbf,_0x40d871,_0x5c0767,_0x90c89c){const _0x6a01f0=a102_0x4d77d2,_0x5f26a4=segmentResponseToDefSync(_0x3536b7,_0x40d871);return _0x546bbf[_0x6a01f0(0xbb)]>0x0&&(_0x5f26a4[_0x6a01f0(0xdf)]=_0x546bbf[_0x6a01f0(0x102)](_0xe5c842=>activationResponseToDef(_0xe5c842,_0x5c0767,_0x90c89c))),_0x5f26a4;}function normalizeColumn(_0xc72d4f){const _0x56045f=a102_0x4d77d2;if(typeof _0xc72d4f===_0x56045f(0xf3))return{'name':_0xc72d4f};return{'name':_0xc72d4f[_0x56045f(0xcb)],..._0xc72d4f['type']&&{'type':_0xc72d4f[_0x56045f(0xb7)]},..._0xc72d4f[_0x56045f(0xea)]&&{'visibility':_0xc72d4f[_0x56045f(0xea)]}};}function a102_0x1109(){const _0x476200=['And','order_by','min','join_row','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','operator','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','segmentFolderId','Please\x20specify\x20a\x20valid\x20attribute\x20name.','limit','email_recipients','behavior','keys','emailToIdMap','rightValues','set','].attribute\x20cannot\x20be\x20empty.\x0a','\x0a\x0aAvailable\x20fields:\x0a','code','CONNECTOR_SCHEMA_NOT_FOUND','include','TimeWithinPast','5302908vzJqNO','conditions','connectionNameToIdMap','warnings','Reference','conditions[','attribute','Segment\x20description','Equal','repeatSubFrequency','realtime','values','New\x20Segment','type','connectionId','endOn','Invalid\x20connector_config\x20for\x20activation\x20\x22','length','rule','1836766dHiTPn','source','91917fameHW','stringify','notifyOn','CONNECTOR_INVALID_CONFIG','isVisible','repeat_unit','start_at','every','activationTemplateId','startAt','behaviorTableName','errors','name','value','description','entries','end_on','has','repeat_frequency','columns','warn','\x22:\x0a','valid','localRuleToName','connector_config','YAML\x20config\x20missing\x20required\x20field:\x20name','emailRecipients','null','add','joinRow','TimeWithinNext','test','activations','connector_config\x20for\x20activation\x20\x22','object','max','parse','allColumns','2296norYug','connectorConfig','\x27:\x20','arrayMatching','usedNames','visibility','attribute_name','Unknown\x20connection:\x20','duration','repeatFrequency','folder','3691786EOPNns','repeatUnit','aggregation','string','formatting','connection','any','get','attributes','schedule','CONNECTION_NOT_FOUND','joinStrategy','all_columns','syndicationBehavior','segment','activationParams','Value','287403YTpEyt','map','toLowerCase','filter','activation_template_id','notification','visible','groupingColumns','INVALID_ARGUMENT','activations:','leftValue','timezone','not','exclude','scheduleType','localeCompare','notify_on','isArray','2044767MveFXl','batch','getSchema','ruleHashToName','unit','__SEGMENT_REF__','orderBy','behavior_table','Unknown\x20email\x20recipient:\x20','rightValue','join_strategy','YAML\x20type\x20must\x20be\x20\x27segment\x27\x20or\x20omitted,\x20got:\x20','45jJIPlY','sort','__UNRESOLVED__','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','forEach','all','303004ntluhP','repeat_sub_frequency','rule:','kind'];a102_0x1109=function(){return _0x476200;};return a102_0x1109();}export async function activationDefToCreateRequest(_0x3b452d,_0x871b14){const _0x4859b5=a102_0x4d77d2,_0x9da781=_0x871b14?.[_0x4859b5(0xa1)],_0x36aa97=_0x871b14?.[_0x4859b5(0xac)],_0x50093b=_0x3b452d['connection'];let _0x534a6b;const _0x3f9ee3=parseInt(_0x50093b,0xa);if(!isNaN(_0x3f9ee3)&&String(_0x3f9ee3)===_0x50093b)_0x534a6b=_0x3f9ee3;else{const _0x583820=_0x36aa97?.[_0x4859b5(0xf7)](_0x50093b);if(_0x583820===undefined)throw new SDKError(ErrorCode[_0x4859b5(0xfa)],_0x4859b5(0xec)+_0x50093b,undefined,{'helpText':_0x4859b5(0x98)});_0x534a6b=_0x583820;}const _0x37b1b4={'name':_0x3b452d[_0x4859b5(0xcb)],'connectionId':_0x534a6b};_0x3b452d['description']&&(_0x37b1b4['description']=_0x3b452d[_0x4859b5(0xcd)]);let _0xb24652=[];_0x3b452d[_0x4859b5(0xd2)]&&_0x3b452d[_0x4859b5(0xd2)]['length']>0x0&&(_0xb24652=_0x3b452d[_0x4859b5(0xd2)][_0x4859b5(0x104)](_0x225a04=>_0x225a04!=null)[_0x4859b5(0x102)](normalizeColumn));_0xb24652[_0x4859b5(0xbb)]>0x0&&(_0x37b1b4['columns']=_0xb24652);_0x3b452d[_0x4859b5(0xfc)]!==undefined&&(_0x3b452d['all_columns']===![]&&_0xb24652[_0x4859b5(0xbb)]===0x0?_0x37b1b4['allColumns']=!![]:_0x37b1b4['allColumns']=_0x3b452d[_0x4859b5(0xfc)]);if(_0x3b452d[_0x4859b5(0xf9)]){const _0x238585=_0x3b452d['schedule'];_0x238585[_0x4859b5(0xb7)]&&(_0x37b1b4[_0x4859b5(0x7a)]=_0x238585['type']),_0x238585[_0x4859b5(0xc4)]&&(_0x37b1b4[_0x4859b5(0xf1)]=_0x238585['repeat_unit']),_0x238585['repeat_frequency']!==undefined&&(_0x37b1b4[_0x4859b5(0xee)]=_0x238585[_0x4859b5(0xd1)]),_0x238585[_0x4859b5(0x91)]&&(_0x37b1b4['repeatSubFrequency']=_0x238585[_0x4859b5(0x91)]),_0x238585['start_at']!==undefined&&(_0x37b1b4['startAt']=_0x238585[_0x4859b5(0xc5)]),_0x238585[_0x4859b5(0xcf)]!==undefined&&(_0x37b1b4[_0x4859b5(0xb9)]=_0x238585['end_on']),_0x238585[_0x4859b5(0x77)]&&(_0x37b1b4['timezone']=_0x238585[_0x4859b5(0x77)]);}_0x3b452d['notification']&&(_0x3b452d['notification']['notify_on']&&(_0x37b1b4[_0x4859b5(0xc1)]=_0x3b452d[_0x4859b5(0x106)][_0x4859b5(0x7c)]),_0x3b452d['notification']['email_recipients']&&(_0x37b1b4[_0x4859b5(0xd9)]=_0x3b452d[_0x4859b5(0x106)][_0x4859b5(0x9e)][_0x4859b5(0x102)](_0x5bb285=>{const _0x272bbc=_0x4859b5,_0x3c7c63=Number(_0x5bb285);if(!isNaN(_0x3c7c63)&&String(_0x3c7c63)===_0x5bb285)return _0x3c7c63;const _0x3dd126=_0x9da781?.[_0x272bbc(0xf7)](_0x5bb285[_0x272bbc(0x103)]());if(_0x3dd126===undefined)throw new SDKError(ErrorCode[_0x272bbc(0x109)],_0x272bbc(0x86)+_0x5bb285+_0x272bbc(0x9a));return _0x3dd126;})));if(_0x3b452d[_0x4859b5(0xd7)]){const _0x412511=_0x871b14?.['connectionNameToTypeMap']?.[_0x4859b5(0xf7)](_0x50093b);if(_0x412511&&_0x871b14?.[_0x4859b5(0x80)])try{const _0x3dab5d=await _0x871b14[_0x4859b5(0x80)](_0x412511),_0x156c4d=validateConnectorConfig(_0x3b452d[_0x4859b5(0xd7)],_0x3dab5d);if(!_0x156c4d[_0x4859b5(0xd5)])throw new SDKError(ErrorCode[_0x4859b5(0xc2)],_0x4859b5(0xba)+_0x3b452d[_0x4859b5(0xcb)]+_0x4859b5(0xd4)+formatValidationErrors(_0x156c4d[_0x4859b5(0xca)]),undefined,{'helpText':'Connector:\x20'+_0x412511+_0x4859b5(0xa5)+formatSchemaAsHelp(_0x3dab5d)});if(_0x156c4d[_0x4859b5(0xad)]['length']>0x0){const _0x45487b=formatValidationWarnings(_0x156c4d[_0x4859b5(0xad)]);console[_0x4859b5(0xd3)](_0x4859b5(0xe0)+_0x3b452d[_0x4859b5(0xcb)]+'\x22:\x0a'+_0x45487b);}_0x37b1b4[_0x4859b5(0xe6)]=transformConfigToLegacy(_0x3b452d[_0x4859b5(0xd7)],_0x3dab5d);}catch(_0x56fbdb){if(_0x56fbdb instanceof SDKError&&_0x56fbdb[_0x4859b5(0xa6)]===ErrorCode[_0x4859b5(0xa7)])_0x37b1b4[_0x4859b5(0xe6)]=_0x3b452d[_0x4859b5(0xd7)];else throw _0x56fbdb;}else _0x37b1b4[_0x4859b5(0xe6)]=_0x3b452d['connector_config'];}_0x3b452d[_0x4859b5(0x105)]!==undefined&&(_0x37b1b4[_0x4859b5(0xc7)]=_0x3b452d[_0x4859b5(0x105)]);if(_0x3b452d[_0x4859b5(0x9f)]){const _0x150499=_0x3b452d[_0x4859b5(0x9f)],_0x53c9fe={};if(_0x150499[_0x4859b5(0xd2)]&&_0x150499[_0x4859b5(0xd2)][_0x4859b5(0xbb)]>0x0){const _0x49d50d=_0x150499[_0x4859b5(0xd2)]['filter'](_0x31e707=>_0x31e707&&_0x31e707[_0x4859b5(0xcb)]);_0x49d50d['length']>0x0&&(_0x53c9fe[_0x4859b5(0xd2)]=_0x49d50d);}_0x150499[_0x4859b5(0x85)]&&(_0x53c9fe['behaviorTableName']=_0x150499['behavior_table']),_0x150499[_0x4859b5(0x97)]!==undefined&&(_0x53c9fe[_0x4859b5(0xdc)]=_0x150499[_0x4859b5(0x97)]),_0x150499[_0x4859b5(0x88)]&&(_0x53c9fe['joinStrategy']=_0x150499[_0x4859b5(0x88)]),_0x150499[_0x4859b5(0xf4)]&&(_0x53c9fe[_0x4859b5(0xf4)]=_0x150499[_0x4859b5(0xf4)]),_0x150499['order_by']&&(_0x53c9fe['orderBy']=_0x150499['order_by']),_0x37b1b4[_0x4859b5(0xfd)]=_0x53c9fe;}return _0x37b1b4;}export async function activationDefToUpdateRequest(_0x3a72ec,_0x420db7){return activationDefToCreateRequest(_0x3a72ec,_0x420db7);}export function deepSortObject(_0x51f8cb){const _0x3d1681=a102_0x4d77d2;if(_0x51f8cb===null||typeof _0x51f8cb!==_0x3d1681(0xe1))return _0x51f8cb;if(Array['isArray'](_0x51f8cb))return _0x51f8cb[_0x3d1681(0x102)](deepSortObject)['sort']((_0x2e2ba3,_0x2788f5)=>JSON['stringify'](_0x2e2ba3)[_0x3d1681(0x7b)](JSON['stringify'](_0x2788f5)));const _0x392186={};for(const _0x361eae of Object['keys'](_0x51f8cb)[_0x3d1681(0x8b)]()){_0x392186[_0x361eae]=deepSortObject(_0x51f8cb[_0x361eae]);}return _0x392186;}export function serializeRule(_0x490ba2){const _0x5c946b=a102_0x4d77d2;return JSON[_0x5c946b(0xc0)](deepSortObject(_0x490ba2));}export function normalizeRuleForMatching(_0x4f6207){return normalizeConditionsForMatching(_0x4f6207);}function normalizeConditionsForMatching(_0x10e535){const _0x2c292b=a102_0x4d77d2;if(_0x10e535===null||typeof _0x10e535!=='object')return _0x10e535;if(Array['isArray'](_0x10e535))return _0x10e535[_0x2c292b(0x102)](normalizeConditionsForMatching);const _0x3acd82=_0x10e535;if((_0x3acd82[_0x2c292b(0xb7)]===_0x2c292b(0xa8)||_0x3acd82[_0x2c292b(0xb7)]===_0x2c292b(0x79))&&typeof _0x3acd82[_0x2c292b(0xfe)]===_0x2c292b(0xf3))return{..._0x3acd82,'segment':_0x2c292b(0x83)};const _0x388698={};for(const _0x515800 of Object[_0x2c292b(0xa0)](_0x3acd82)){_0x388698[_0x515800]=normalizeConditionsForMatching(_0x3acd82[_0x515800]);}return _0x388698;}export function serializeRuleForMatching(_0xd4845d){return JSON['stringify'](deepSortObject(normalizeRuleForMatching(_0xd4845d)));}export function expandSegmentReferences(_0x2311aa,_0x484c23,_0x161612=new Set()){return expandConditions(_0x2311aa,_0x484c23,_0x161612);}function expandConditions(_0xb2ab9f,_0x116e0d,_0x2401c8){const _0x2bd4ee=a102_0x4d77d2;if(_0xb2ab9f===null||typeof _0xb2ab9f!==_0x2bd4ee(0xe1))return _0xb2ab9f;if(Array[_0x2bd4ee(0x7d)](_0xb2ab9f))return _0xb2ab9f[_0x2bd4ee(0x102)](_0x3cce07=>expandConditions(_0x3cce07,_0x116e0d,_0x2401c8));const _0x18ecc6=_0xb2ab9f;if((_0x18ecc6['type']===_0x2bd4ee(0xa8)||_0x18ecc6[_0x2bd4ee(0xb7)]===_0x2bd4ee(0x79))&&typeof _0x18ecc6['segment']===_0x2bd4ee(0xf3)){const _0x43b0c1=_0x18ecc6[_0x2bd4ee(0xfe)],_0x296a8f=_0x116e0d['get'](_0x43b0c1);if(_0x296a8f&&!_0x2401c8['has'](_0x43b0c1)){const _0x55e10a=new Set(_0x2401c8);_0x55e10a[_0x2bd4ee(0xdb)](_0x43b0c1);const _0x3f4b3f=expandConditions(_0x296a8f,_0x116e0d,_0x55e10a);return{'type':_0x18ecc6[_0x2bd4ee(0xb7)],'expanded_rule':_0x3f4b3f};}return{'type':_0x18ecc6[_0x2bd4ee(0xb7)],'expanded_rule':_0x2bd4ee(0x8c)};}const _0x11e952={};for(const _0x204b2d of Object['keys'](_0x18ecc6)){_0x11e952[_0x204b2d]=expandConditions(_0x18ecc6[_0x204b2d],_0x116e0d,_0x2401c8);}return _0x11e952;}export function serializeExpandedRule(_0x24892d,_0x312c76){const _0x364b74=a102_0x4d77d2,_0x12c7fa=expandSegmentReferences(_0x24892d,_0x312c76);return JSON[_0x364b74(0xc0)](deepSortObject(_0x12c7fa));}export function createSegmentNameContext(_0x651721){const _0xc3cf31=a102_0x4d77d2,_0x4337a7=new Set(),_0x43223f=new Map(),_0x4498f4=new Map();if(_0x651721)for(const [_0x398db2,_0x4226e4]of Object[_0xc3cf31(0xce)](_0x651721)){if(_0x4226e4[_0xc3cf31(0xbc)]){const _0x11af32=serializeRule(_0x4226e4[_0xc3cf31(0xbc)]);_0x4498f4[_0xc3cf31(0xa3)](_0x11af32,_0x398db2),_0x4337a7[_0xc3cf31(0xdb)](_0x398db2);}}return{'usedNames':_0x4337a7,'ruleHashToName':_0x43223f,'localRuleToName':_0x651721?_0x4498f4:undefined};}export function resolveSegmentName(_0x46361f,_0x45dff0,_0x10b111,_0x341fe0){const _0x4a2e13=a102_0x4d77d2,_0x349f27=serializeRule(_0x45dff0);if(_0x10b111['localRuleToName']){const _0x37a4f1=_0x10b111[_0x4a2e13(0xd6)][_0x4a2e13(0xf7)](_0x349f27);if(_0x37a4f1)return{'name':_0x37a4f1,'isDuplicate':![],'isLocalMatch':!![]};}const _0x180f2d=_0x10b111[_0x4a2e13(0x81)]['get'](_0x349f27);if(_0x180f2d)return{'name':_0x180f2d,'isDuplicate':!![],'isLocalMatch':![]};const _0x58bb76=_0x341fe0(_0x46361f);let _0xa771e8=_0x58bb76||_0x46361f,_0x5b4f7c=_0xa771e8,_0x57f7dc=0x2;while(_0x10b111[_0x4a2e13(0xe9)][_0x4a2e13(0xd0)](_0x5b4f7c)){_0x5b4f7c=_0xa771e8+'_'+_0x57f7dc,_0x57f7dc++;}return _0x10b111[_0x4a2e13(0xe9)][_0x4a2e13(0xdb)](_0x5b4f7c),_0x10b111[_0x4a2e13(0x81)][_0x4a2e13(0xa3)](_0x349f27,_0x5b4f7c),{'name':_0x5b4f7c,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0xb3059f){const _0x53fbf0=[],_0x538298=_0x4bb405=>{const _0x4f53be=a102_0x3d58;if(!_0x4bb405||typeof _0x4bb405!=='object')return;if(Array[_0x4f53be(0x7d)](_0x4bb405)){_0x4bb405[_0x4f53be(0x8e)](_0x538298);return;}const _0x51ac53=_0x4bb405;(_0x51ac53['type']===_0x4f53be(0xa8)||_0x51ac53[_0x4f53be(0xb7)]===_0x4f53be(0x79))&&typeof _0x51ac53[_0x4f53be(0xfe)]===_0x4f53be(0xf3)&&_0x53fbf0['push'](_0x51ac53[_0x4f53be(0xfe)]);for(const _0x280465 of Object[_0x4f53be(0xb5)](_0x51ac53)){_0x538298(_0x280465);}};return _0x538298(_0xb3059f),_0x53fbf0;}export function validateSegmentRule(_0xd82f8c,_0x33bcf7){const _0x202810=a102_0x4d77d2;if(!_0x33bcf7||!_0x33bcf7['conditions'])return;for(let _0x3494e7=0x0;_0x3494e7<_0x33bcf7['conditions'][_0x202810(0xbb)];_0x3494e7++){const _0x3e96e4=_0x33bcf7[_0x202810(0xab)][_0x3494e7];if('type'in _0x3e96e4&&_0x3e96e4[_0x202810(0xb7)]===_0x202810(0x100)){const _0x19555a=_0x3e96e4;if(!_0x19555a[_0x202810(0xb0)]||_0x19555a[_0x202810(0xb0)]==='')throw new SDKError(ErrorCode['JOURNEY_SYNTAX_ERROR'],_0x202810(0x8d)+_0xd82f8c+_0x202810(0xe7)+(_0x202810(0xaf)+_0x3494e7+_0x202810(0xa4))+_0x202810(0x9c));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a103_0x2fa1(_0x3d5146,_0x5c1f70){_0x3d5146=_0x3d5146-0xaa;const _0x128930=a103_0x1289();let _0x2fa1a1=_0x128930[_0x3d5146];return _0x2fa1a1;}(function(_0x2384e1,_0x26765b){const _0x3a18a7=a103_0x2fa1,_0x52938a=_0x2384e1();while(!![]){try{const _0x3795a4=parseInt(_0x3a18a7(0xd6))/0x1*(parseInt(_0x3a18a7(0xbc))/0x2)+parseInt(_0x3a18a7(0xdc))/0x3*(-parseInt(_0x3a18a7(0xc6))/0x4)+parseInt(_0x3a18a7(0xc2))/0x5*(-parseInt(_0x3a18a7(0xda))/0x6)+parseInt(_0x3a18a7(0xdb))/0x7*(parseInt(_0x3a18a7(0xcb))/0x8)+-parseInt(_0x3a18a7(0xd1))/0x9*(-parseInt(_0x3a18a7(0xd3))/0xa)+-parseInt(_0x3a18a7(0xc3))/0xb*(parseInt(_0x3a18a7(0xbd))/0xc)+parseInt(_0x3a18a7(0xb6))/0xd*(parseInt(_0x3a18a7(0xd4))/0xe);if(_0x3795a4===_0x26765b)break;else _0x52938a['push'](_0x52938a['shift']());}catch(_0x584560){_0x52938a['push'](_0x52938a['shift']());}}}(a103_0x1289,0x1dda7));import a103_0xcf6cc1 from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x2c7a0a){const _0x37d593=a103_0x2fa1,_0xb4220d=_0x2c7a0a[_0x37d593(0xb2)][_0x37d593(0xba)](_0x2719d4=>({'column_name':_0x2719d4[_0x37d593(0xca)],'column_type':_0x2719d4[_0x37d593(0xbb)],'null':_0x37d593(0xd0),'key':null,'default':null,'extra':null}));return{..._0x2c7a0a,'columns':[{'name':_0x37d593(0xae),'type':_0x37d593(0xcd)},{'name':_0x37d593(0xce),'type':'varchar'},{'name':_0x37d593(0xaa),'type':_0x37d593(0xcd)},{'name':'key','type':_0x37d593(0xcd)},{'name':_0x37d593(0xb1),'type':_0x37d593(0xcd)},{'name':_0x37d593(0xb7),'type':_0x37d593(0xcd)}],'data':_0xb4220d};}export async function executeSchemaQuery(_0x53de54,_0x56d9d9,_0x491e15){const _0x84a356=a103_0x2fa1,_0x38fb5c=_0x53de54[_0x84a356(0xb3)]()['replace'](/;+$/,''),_0x37e226='SELECT\x20*\x20FROM\x20(\x0a'+_0x38fb5c+_0x84a356(0xc1);_0x491e15[_0x84a356(0xcf)]&&console['error'](_0x84a356(0xc9)+_0x37e226);const _0x3553e9=await withProgressSpinner('Fetching\x20schema...',async _0x39d5f6=>{const _0x42d2a9=_0x84a356,_0x3d0d97=await _0x56d9d9[_0x42d2a9(0xbe)][_0x42d2a9(0xc8)](_0x37e226,{'catalog':'td','schema':'information_schema','onJobId':_0x1136d0=>{const _0x4105ae=_0x42d2a9;_0x39d5f6[_0x4105ae(0xaf)](_0x1136d0);}});return _0x3d0d97;},{'verbose':_0x491e15[_0x84a356(0xcf)]});return buildSchemaResult(_0x3553e9[_0x84a356(0xe0)]);}function a103_0x1289(){const _0x339eb2=['startsWith','attribute','Behaviors','null','fields','slice','get','column_name','setJobId','parentTableName','default','columns','trim','parentColumn','set','1624727HFgFQx','extra','entries','filter','map','type','2WQJpYe','660tNNQQB','query','bold','tableName','\x0a)\x20AS\x20segment_query\x20LIMIT\x200','245255tJMcjZ','44561UiAedf','error','behavior','38748uAMECF','localeCompare','execute','Schema\x20query:\x0a','name','3384zTbQsK','Unknown','varchar','column_type','verbose','YES','9JolGXy','dim','436670HxqFLt','14LzyLhF','displayName','43557PtxOAI','size','groupingName','\x20\x20\x20\x20','6FjtBMk','3171fOLMuS','3gtYEjN','behaviorName','push','sort','data','length','source'];a103_0x1289=function(){return _0x339eb2;};return a103_0x1289();}export function displayFieldsHumanReadable(_0x1db25b,_0xed0708){const _0x13af4e=a103_0x2fa1,_0x2dd87e=_0x1db25b[_0x13af4e(0xb9)](_0x131f60=>_0x131f60[_0x13af4e(0xe2)]===_0x13af4e(0xe4)),_0x3d8936=_0x1db25b['filter'](_0x39ac66=>_0x39ac66['source']===_0x13af4e(0xc5)),_0x318e5c=new Map();for(const _0x4c0cde of _0x2dd87e){const _0xf5f412=_0x4c0cde[_0x13af4e(0xd8)]||_0x4c0cde[_0x13af4e(0xb0)]||_0x13af4e(0xcc),_0x1bd91e=_0x318e5c[_0x13af4e(0xad)](_0xf5f412);_0x1bd91e?_0x1bd91e[_0x13af4e(0xab)][_0x13af4e(0xde)](_0x4c0cde):_0x318e5c[_0x13af4e(0xb5)](_0xf5f412,{'displayName':_0xf5f412,'tableName':_0x4c0cde['parentTableName'],'fields':[_0x4c0cde]});}const _0x3a8711=new Map();for(const _0x531087 of _0x3d8936){const _0x472b4a=_0x531087[_0x13af4e(0xdd)]||_0x13af4e(0xcc),_0x5bb3e4=_0x3a8711[_0x13af4e(0xad)](_0x472b4a)||[];_0x5bb3e4[_0x13af4e(0xde)](_0x531087),_0x3a8711[_0x13af4e(0xb5)](_0x472b4a,_0x5bb3e4);}console[_0x13af4e(0xc4)]('\x0a'+a103_0xcf6cc1[_0x13af4e(0xbf)](_0xed0708));if(_0x318e5c[_0x13af4e(0xd7)]>0x0){console[_0x13af4e(0xc4)]('\x0a'+a103_0xcf6cc1['dim']('Attributes'));const _0x4b6f79=[..._0x318e5c[_0x13af4e(0xb8)]()][_0x13af4e(0xdf)]((_0x1220a6,_0x20a32e)=>_0x1220a6[0x0][_0x13af4e(0xc7)](_0x20a32e[0x0]));for(const [,_0x4fd4a2]of _0x4b6f79){const _0x9ceb09=_0x4fd4a2[_0x13af4e(0xc0)]&&_0x4fd4a2['tableName']!==_0x4fd4a2[_0x13af4e(0xd5)]?'\x20'+a103_0xcf6cc1[_0x13af4e(0xd2)]('('+_0x4fd4a2['tableName']+')'):'';console[_0x13af4e(0xc4)]('\x20\x20'+a103_0xcf6cc1[_0x13af4e(0xbf)](_0x4fd4a2[_0x13af4e(0xd5)])+_0x9ceb09);const _0x30c97e=[..._0x4fd4a2[_0x13af4e(0xab)]][_0x13af4e(0xdf)]((_0x42dd05,_0x1a737b)=>_0x42dd05[_0x13af4e(0xca)][_0x13af4e(0xc7)](_0x1a737b[_0x13af4e(0xca)]));for(const _0x2a1fd3 of _0x30c97e){const _0x24f8fc=_0x2a1fd3[_0x13af4e(0xb4)]&&_0x2a1fd3[_0x13af4e(0xb4)]!==_0x2a1fd3[_0x13af4e(0xca)]?'\x20'+a103_0xcf6cc1[_0x13af4e(0xd2)]('('+_0x2a1fd3[_0x13af4e(0xb4)]+')'):'';console[_0x13af4e(0xc4)](_0x13af4e(0xd9)+_0x2a1fd3[_0x13af4e(0xca)]+_0x24f8fc+':\x20'+a103_0xcf6cc1['cyan'](_0x2a1fd3[_0x13af4e(0xbb)]));}}}if(_0x3a8711[_0x13af4e(0xd7)]>0x0){console[_0x13af4e(0xc4)]('\x0a'+a103_0xcf6cc1[_0x13af4e(0xd2)](_0x13af4e(0xe5)));const _0x5997c9=[..._0x3a8711[_0x13af4e(0xb8)]()][_0x13af4e(0xdf)]((_0x54a1b8,_0x42484e)=>_0x54a1b8[0x0][_0x13af4e(0xc7)](_0x42484e[0x0]));for(const [_0x205b0e,_0x4f0b4a]of _0x5997c9){const _0x201ed5=_0x4f0b4a[0x0],_0x2c3ced=_0x201ed5?.[_0x13af4e(0xb0)]||'';console[_0x13af4e(0xc4)]('\x20\x20'+a103_0xcf6cc1['bold'](_0x205b0e)+(_0x2c3ced?'\x20'+a103_0xcf6cc1['dim']('('+_0x2c3ced+')'):''));const _0xc76751=[..._0x4f0b4a]['sort']((_0x436ea1,_0x89c3f2)=>_0x436ea1['name']['localeCompare'](_0x89c3f2[_0x13af4e(0xca)]));for(const _0x57ad85 of _0xc76751){const _0x27ce5c=_0x57ad85[_0x13af4e(0xca)][_0x13af4e(0xe3)](_0x205b0e+'.')?_0x57ad85['name'][_0x13af4e(0xac)](_0x205b0e[_0x13af4e(0xe1)]+0x1):_0x57ad85['name'],_0x1f10c5=_0x57ad85[_0x13af4e(0xb4)]&&_0x57ad85['parentColumn']!==_0x27ce5c?'\x20'+a103_0xcf6cc1['dim']('('+_0x57ad85[_0x13af4e(0xb4)]+')'):'';console[_0x13af4e(0xc4)](_0x13af4e(0xd9)+_0x27ce5c+_0x1f10c5+':\x20'+a103_0xcf6cc1['cyan'](_0x57ad85[_0x13af4e(0xbb)]));}}}console['error']('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x305d30,_0x525172){const _0x52afe1=a104_0x5f0e,_0x13cfb4=_0x305d30();while(!![]){try{const _0x242aac=parseInt(_0x52afe1(0x77))/0x1+parseInt(_0x52afe1(0x82))/0x2*(-parseInt(_0x52afe1(0x80))/0x3)+-parseInt(_0x52afe1(0x8b))/0x4*(-parseInt(_0x52afe1(0x7f))/0x5)+-parseInt(_0x52afe1(0x7e))/0x6*(-parseInt(_0x52afe1(0x7a))/0x7)+-parseInt(_0x52afe1(0x7c))/0x8*(-parseInt(_0x52afe1(0x79))/0x9)+-parseInt(_0x52afe1(0x81))/0xa+-parseInt(_0x52afe1(0x86))/0xb*(parseInt(_0x52afe1(0x85))/0xc);if(_0x242aac===_0x525172)break;else _0x13cfb4['push'](_0x13cfb4['shift']());}catch(_0x2d8554){_0x13cfb4['push'](_0x13cfb4['shift']());}}}(a104_0x56b5,0xe6f02));import{readdirSync,statSync}from'fs';import a104_0x407f78 from'path';export function findYamlFiles(_0x46d33d){const _0x573295=[];function _0x34956d(_0x5f02e1){const _0x361bdf=a104_0x5f0e,_0x3488ad=readdirSync(_0x5f02e1,{'withFileTypes':!![]});for(const _0x11b74b of _0x3488ad){const _0x4abb9a=a104_0x407f78[_0x361bdf(0x83)](_0x5f02e1,_0x11b74b['name']);if(_0x11b74b[_0x361bdf(0x7b)]())_0x34956d(_0x4abb9a);else(_0x11b74b['name']['endsWith'](_0x361bdf(0x87))||_0x11b74b['name'][_0x361bdf(0x89)](_0x361bdf(0x7d)))&&_0x573295[_0x361bdf(0x8a)](_0x4abb9a);}}return _0x34956d(_0x46d33d),_0x573295;}function a104_0x5f0e(_0x206390,_0x4db467){_0x206390=_0x206390-0x76;const _0x56b571=a104_0x56b5();let _0x5f0ed8=_0x56b571[_0x206390];return _0x5f0ed8;}export function discoverYamlFiles(_0x5599e8){const _0x23c91e=findYamlFiles(_0x5599e8);return _0x23c91e['map'](_0x328b18=>{const _0xea7dab=a104_0x5f0e,_0x30a2ed=a104_0x407f78[_0xea7dab(0x88)](_0x5599e8,_0x328b18),_0x7b1c1e=a104_0x407f78['dirname'](_0x30a2ed);return{'absolutePath':_0x328b18,'relativePath':_0x30a2ed,'folderPath':_0x7b1c1e==='.'?'':_0x7b1c1e};});}export function isYamlFile(_0x30928f){const _0x520f21=a104_0x5f0e;try{const _0x35b960=statSync(_0x30928f);if(!_0x35b960[_0x520f21(0x78)]())return![];const _0x212255=a104_0x407f78[_0x520f21(0x76)](_0x30928f)[_0x520f21(0x84)]();return _0x212255===_0x520f21(0x87)||_0x212255===_0x520f21(0x7d);}catch{return![];}}function a104_0x56b5(){const _0x7573a4=['24RqhPZI','17437904uTZIth','.yml','relative','endsWith','push','3704YoCELc','extname','1139661olIhiq','isFile','63zzFphs','10171518RPisft','isDirectory','2072904bJuFVf','.yaml','6KBbsQy','7330dAhGXX','15BZMrDT','12438020NPALlh','161516opQKAY','join','toLowerCase'];a104_0x56b5=function(){return _0x7573a4;};return a104_0x56b5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2b9d3d,_0x173478){const _0x4184c5=a105_0x4b7a,_0x1c6103=_0x2b9d3d();while(!![]){try{const _0x533b29=parseInt(_0x4184c5(0x142))/0x1*(-parseInt(_0x4184c5(0x151))/0x2)+-parseInt(_0x4184c5(0x144))/0x3+-parseInt(_0x4184c5(0x12f))/0x4+-parseInt(_0x4184c5(0x133))/0x5*(parseInt(_0x4184c5(0x137))/0x6)+-parseInt(_0x4184c5(0x140))/0x7+-parseInt(_0x4184c5(0x13e))/0x8+parseInt(_0x4184c5(0x119))/0x9;if(_0x533b29===_0x173478)break;else _0x1c6103['push'](_0x1c6103['shift']());}catch(_0x2cf635){_0x1c6103['push'](_0x1c6103['shift']());}}}(a105_0x26b6,0xca904));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x237893){const _0x5e783c=a105_0x4b7a;return _0x237893[_0x5e783c(0x13f)]()[_0x5e783c(0x138)](/\s+/g,'_')[_0x5e783c(0x138)](/[^a-z0-9_]/g,'')[_0x5e783c(0x138)](/_+/g,'_')['replace'](/^_|_$/g,'');}export function generateJourneyLocalName(_0x147ba4){const _0x1c54ae=a105_0x4b7a,_0xb6d222=_0x147ba4[_0x1c54ae(0x13a)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0xb6d222){const _0x3c8438=_0xb6d222[0x1][_0x1c54ae(0x13f)](),_0x45d546=_0xb6d222[0x2],_0x56d372=_0x45d546[_0x1c54ae(0x138)](/-/g,'')[_0x1c54ae(0x158)](0x0,0x4)[_0x1c54ae(0x13f)]();return _0x3c8438+'_'+_0x56d372;}const _0x2e894c=_0x147ba4['match'](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x2e894c){const _0xbd80e4=_0x2e894c[0x1],_0x479253=_0x2e894c[0x2][_0x1c54ae(0x13f)](),_0xcc894b=_0xbd80e4[_0x1c54ae(0x138)](/-/g,'')['slice'](0x0,0x4)[_0x1c54ae(0x13f)]();return _0x479253+'_'+_0xcc894b;}return undefined;}function stableStringify(_0x41bfa2){const _0x273d72=a105_0x4b7a;if(Array[_0x273d72(0x15a)](_0x41bfa2))return'['+_0x41bfa2[_0x273d72(0x129)](_0x19f509=>stableStringify(_0x19f509))[_0x273d72(0x121)](',')+']';if(_0x41bfa2&&typeof _0x41bfa2==='object'){const _0x4d2766=_0x41bfa2,_0x396f54=Object[_0x273d72(0x131)](_0x4d2766)['sort'](),_0x4d3305=_0x396f54[_0x273d72(0x129)](_0x4498ed=>'\x22'+_0x4498ed+'\x22:'+stableStringify(_0x4d2766[_0x4498ed]));return'{'+_0x4d3305[_0x273d72(0x121)](',')+'}';}const _0x53cd55=JSON[_0x273d72(0x113)](_0x41bfa2);return _0x53cd55===undefined?_0x273d72(0x112):_0x53cd55;}export function consolidateActivationsByContent(_0x4f1852){const _0x28c355=a105_0x4b7a,_0x58ef7a={},_0x420e89=new Map(),_0x13d362=new Map();for(const _0x570db8 of _0x4f1852){if(!_0x570db8)continue;for(const [_0x26caed,_0x5201c0]of Object[_0x28c355(0x114)](_0x570db8)){const _0x192442={'connection':_0x5201c0[_0x28c355(0x147)],..._0x5201c0['all_columns']!==undefined&&{'all_columns':_0x5201c0[_0x28c355(0x11d)]},..._0x5201c0[_0x28c355(0x141)]!==undefined&&{'columns':_0x5201c0[_0x28c355(0x141)]},..._0x5201c0[_0x28c355(0x120)]!==undefined&&{'behavior':_0x5201c0['behavior']},..._0x5201c0[_0x28c355(0x157)]!==undefined&&{'schedule':_0x5201c0[_0x28c355(0x157)]},..._0x5201c0['notification']!==undefined&&{'notification':_0x5201c0[_0x28c355(0x135)]},..._0x5201c0[_0x28c355(0x117)]!==undefined&&{'connector_config':_0x5201c0[_0x28c355(0x117)]},..._0x5201c0[_0x28c355(0x13c)]!==undefined&&{'activation_template_id':_0x5201c0[_0x28c355(0x13c)]}},_0x4030bb=stableStringify(_0x192442),_0x5af682=_0x13d362[_0x28c355(0x14a)](_0x4030bb);_0x5af682?_0x420e89[_0x28c355(0x139)](_0x26caed,_0x5af682):(_0x58ef7a[_0x26caed]=_0x5201c0,_0x420e89[_0x28c355(0x139)](_0x26caed,_0x26caed),_0x13d362[_0x28c355(0x139)](_0x4030bb,_0x26caed));}}return{'merged':_0x58ef7a,'nameMapping':_0x420e89};}export function updateActivationReferences(_0xbebc87,_0x421581){const _0x24f390=a105_0x4b7a;if(!_0xbebc87)return;for(const _0x3d6589 of _0xbebc87){if(!_0x3d6589[_0x24f390(0x11b)])continue;for(const _0x46de0b of _0x3d6589['steps']){if(_0x46de0b[_0x24f390(0x11c)]===_0x24f390(0x134)&&_0x46de0b[_0x24f390(0x152)]?.[_0x24f390(0x134)]){const _0x267cae=_0x421581[_0x24f390(0x14a)](_0x46de0b[_0x24f390(0x152)][_0x24f390(0x134)]);_0x267cae&&_0x267cae!==_0x46de0b['with'][_0x24f390(0x134)]&&(_0x46de0b[_0x24f390(0x152)][_0x24f390(0x134)]=_0x267cae);}}}}export function consolidateSegmentsByContent(_0x285294,_0x5dc09e){const _0x57e4f1=a105_0x4b7a,_0x201978={},_0x4ccef4=new Map(),_0x160f15=new Map();for(const _0x24997a of _0x285294){if(!_0x24997a)continue;for(const [_0x455b9c,_0x2ad607]of Object[_0x57e4f1(0x114)](_0x24997a)){if(!_0x2ad607[_0x57e4f1(0x132)]){_0x201978[_0x455b9c]=_0x2ad607,_0x4ccef4['set'](_0x455b9c,_0x455b9c);continue;}const _0x907d3b=_0x2ad607[_0x57e4f1(0x124)]&&_0x2ad607[_0x57e4f1(0x124)][_0x57e4f1(0x12a)]()?_0x2ad607[_0x57e4f1(0x124)]:undefined,_0x5646a5=JSON[_0x57e4f1(0x113)]({'description':_0x907d3b,'rule':deepSortObject(_0x2ad607[_0x57e4f1(0x132)])}),_0x461e97=_0x160f15[_0x57e4f1(0x14a)](_0x5646a5);if(_0x461e97){const _0x52ae74={..._0x2ad607[_0x57e4f1(0x124)]!==undefined&&{'description':_0x2ad607[_0x57e4f1(0x124)]},'rule':_0x2ad607['rule']?deepSortObject(_0x2ad607[_0x57e4f1(0x132)]):_0x2ad607[_0x57e4f1(0x132)]};if(_0x455b9c<_0x461e97){_0x201978[_0x455b9c]=_0x52ae74,delete _0x201978[_0x461e97];for(const [_0x3935e5,_0x2c42c8]of _0x4ccef4[_0x57e4f1(0x114)]()){_0x2c42c8===_0x461e97&&_0x4ccef4[_0x57e4f1(0x139)](_0x3935e5,_0x455b9c);}_0x4ccef4[_0x57e4f1(0x139)](_0x455b9c,_0x455b9c),_0x160f15['set'](_0x5646a5,_0x455b9c);}else _0x201978[_0x461e97]=_0x52ae74,_0x4ccef4[_0x57e4f1(0x139)](_0x455b9c,_0x461e97);}else{let _0x36784e=_0x455b9c;if(_0x5dc09e){const _0x32a1bf=_0x5dc09e[_0x57e4f1(0x14a)](_0x5646a5);_0x32a1bf&&_0x32a1bf[_0x57e4f1(0x143)]>0x0&&(_0x36784e=_0x32a1bf[_0x57e4f1(0x158)]()['sort']()[0x0]);}const _0x5c99da={..._0x2ad607[_0x57e4f1(0x124)]!==undefined&&{'description':_0x2ad607['description']},'rule':_0x2ad607[_0x57e4f1(0x132)]?deepSortObject(_0x2ad607[_0x57e4f1(0x132)]):_0x2ad607[_0x57e4f1(0x132)]};_0x201978[_0x36784e]=_0x5c99da,_0x4ccef4[_0x57e4f1(0x139)](_0x455b9c,_0x36784e),_0x160f15[_0x57e4f1(0x139)](_0x5646a5,_0x36784e);}}}return{'merged':_0x201978,'nameMapping':_0x4ccef4};}export function updateSegmentReferences(_0x4e148f,_0x25db53){const _0x35446c=a105_0x4b7a;if(!_0x4e148f)return;for(const _0xeeb7cd of _0x4e148f){if(_0xeeb7cd[_0x35446c(0x116)]?.[_0x35446c(0x128)]){const _0x4a5f34=_0x25db53['get'](_0xeeb7cd['entry_criteria']['segment']);_0x4a5f34&&(_0xeeb7cd[_0x35446c(0x116)][_0x35446c(0x128)]=_0x4a5f34);}if(_0xeeb7cd[_0x35446c(0x11b)])for(const _0x517d53 of _0xeeb7cd[_0x35446c(0x11b)]){if(_0x517d53['type']===_0x35446c(0x13b)&&_0x517d53[_0x35446c(0x152)]?.[_0x35446c(0x12c)])for(const _0x1586da of _0x517d53['with'][_0x35446c(0x12c)]){if(_0x1586da[_0x35446c(0x128)]){const _0x46083e=_0x25db53['get'](_0x1586da[_0x35446c(0x128)]);_0x46083e&&(_0x1586da[_0x35446c(0x128)]=_0x46083e);}}}}}export function updateSegmentRefsInSegments(_0x379cef,_0x5ab37e){const _0x45bb06=a105_0x4b7a;for(const _0x6e567d of Object['values'](_0x379cef)){_0x6e567d[_0x45bb06(0x132)]&&updateSegmentRefsInRule(_0x6e567d[_0x45bb06(0x132)],_0x5ab37e);}}function updateSegmentRefsInRule(_0x95989,_0x17331a){const _0x319b24=a105_0x4b7a;if(_0x95989===null||typeof _0x95989!==_0x319b24(0x146))return;if(Array[_0x319b24(0x15a)](_0x95989)){for(const _0x47daa1 of _0x95989){updateSegmentRefsInRule(_0x47daa1,_0x17331a);}return;}const _0x50b286=_0x95989;if((_0x50b286[_0x319b24(0x11c)]===_0x319b24(0x12d)||_0x50b286[_0x319b24(0x11c)]===_0x319b24(0x11a))&&typeof _0x50b286[_0x319b24(0x128)]===_0x319b24(0x153)){const _0x3eeb3a=_0x17331a['get'](_0x50b286[_0x319b24(0x128)]);_0x3eeb3a&&(_0x50b286[_0x319b24(0x128)]=_0x3eeb3a);}if(_0x50b286[_0x319b24(0x15c)]&&Array[_0x319b24(0x15a)](_0x50b286[_0x319b24(0x15c)]))for(const _0x27048d of _0x50b286[_0x319b24(0x15c)]){updateSegmentRefsInRule(_0x27048d,_0x17331a);}}function a105_0x4b7a(_0x4c01e5,_0x4cadd6){_0x4c01e5=_0x4c01e5-0x10f;const _0x26b6e8=a105_0x26b6();let _0x4b7a41=_0x26b6e8[_0x4c01e5];return _0x4b7a41;}export function buildJourneysArray(_0x319767){const _0x4718f2=a105_0x4b7a,_0x2e060f=Math[_0x4718f2(0x130)](..._0x319767[_0x4718f2(0x129)](_0x3697c3=>_0x3697c3[_0x4718f2(0x12e)][_0x4718f2(0x125)]||0x0));return _0x319767[_0x4718f2(0x129)](_0x3998f3=>{const _0x4a1dc7=_0x4718f2,_0x58ca8f=(_0x3998f3[_0x4a1dc7(0x12e)][_0x4a1dc7(0x125)]||0x0)===_0x2e060f,_0x205083=_0x3998f3[_0x4a1dc7(0x15e)][_0x4a1dc7(0x154)]?.[0x0],_0x486930={'version':_0x205083?.[_0x4a1dc7(0x115)]||_0x3998f3[_0x4a1dc7(0x15e)][_0x4a1dc7(0x115)]||_0x3998f3[_0x4a1dc7(0x12e)][_0x4a1dc7(0x126)],'state':_0x3998f3[_0x4a1dc7(0x12e)][_0x4a1dc7(0x14e)]==='launched'?_0x4a1dc7(0x13d):_0x4a1dc7(0x123),'stages':_0x205083?.[_0x4a1dc7(0x15b)]||_0x3998f3[_0x4a1dc7(0x15e)][_0x4a1dc7(0x15b)]||[],'id':_0x205083?.['id']||_0x3998f3[_0x4a1dc7(0x15e)]['id'],'version_number':_0x205083?.[_0x4a1dc7(0x14f)]||_0x3998f3[_0x4a1dc7(0x15e)][_0x4a1dc7(0x14f)]};return _0x58ca8f&&(_0x486930[_0x4a1dc7(0x118)]=!![]),_0x486930;});}export function buildMergedJourneyDef(_0x2e1d28,_0x571f40){const _0x3ded7e=a105_0x4b7a,_0x10edc9=_0x2e1d28[0x0][_0x3ded7e(0x15e)],_0x1b993b=buildJourneysArray(_0x2e1d28),{merged:_0x5bf539,nameMapping:_0x1428f6}=consolidateSegmentsByContent(_0x2e1d28[_0x3ded7e(0x129)](_0x418030=>_0x418030[_0x3ded7e(0x15e)][_0x3ded7e(0x10f)]),_0x571f40);updateSegmentRefsInSegments(_0x5bf539,_0x1428f6);const _0x16c37e=Array[_0x3ded7e(0x15d)](_0x1428f6['entries']())[_0x3ded7e(0x127)](([_0x27ff06,_0x13eb7d])=>_0x27ff06!==_0x13eb7d&&_0x27ff06['startsWith'](_0x3ded7e(0x116)));let _0xcdd1e6=_0x5bf539,_0x3aad21=new Map();if(_0x16c37e){const _0x8c1201=consolidateSegmentsByContent([_0x5bf539],_0x571f40);_0xcdd1e6=_0x8c1201['merged'],_0x3aad21=_0x8c1201['nameMapping'];}const _0x13b1be=new Map(_0x1428f6);for(const [_0x465d69,_0x162e30]of _0x3aad21['entries']()){_0x13b1be['set'](_0x465d69,_0x162e30);}for(const [_0x4b5a55,_0x2388f5]of _0x13b1be[_0x3ded7e(0x114)]()){let _0x5bb5c2=_0x2388f5,_0x3da217=0x0;while(_0x13b1be[_0x3ded7e(0x11f)](_0x5bb5c2)&&_0x13b1be['get'](_0x5bb5c2)!==_0x5bb5c2&&_0x3da217<MAX_MAPPING_CHAIN_DEPTH){_0x5bb5c2=_0x13b1be[_0x3ded7e(0x14a)](_0x5bb5c2),_0x3da217++;}_0x5bb5c2!==_0x2388f5&&_0x13b1be[_0x3ded7e(0x139)](_0x4b5a55,_0x5bb5c2);}for(const _0x53d7f8 of _0x1b993b){updateSegmentReferences(_0x53d7f8[_0x3ded7e(0x15b)],_0x13b1be);}const {merged:_0x31452f,nameMapping:_0x398af1}=consolidateActivationsByContent(_0x2e1d28[_0x3ded7e(0x129)](_0x38ed51=>_0x38ed51[_0x3ded7e(0x15e)]['activations']));for(const _0x528d77 of _0x1b993b){updateActivationReferences(_0x528d77[_0x3ded7e(0x15b)],_0x398af1);}let _0x4e90d8=_0x10edc9[_0x3ded7e(0x11e)];if(_0x4e90d8?.[_0x3ded7e(0x128)]){const _0xa26e2e=_0x13b1be[_0x3ded7e(0x14a)](_0x4e90d8[_0x3ded7e(0x128)]);_0xa26e2e&&(_0x4e90d8={..._0x4e90d8,'segment':_0xa26e2e});}for(const _0x1e562a of _0x1b993b){if(_0x1e562a[_0x3ded7e(0x11e)]?.[_0x3ded7e(0x128)]){const _0x1d6129=_0x13b1be['get'](_0x1e562a[_0x3ded7e(0x11e)][_0x3ded7e(0x128)]);_0x1d6129&&(_0x1e562a['goal']={..._0x1e562a['goal'],'segment':_0x1d6129});}}return{'type':_0x3ded7e(0x14d),'name':_0x10edc9[_0x3ded7e(0x126)],'description':_0x10edc9[_0x3ded7e(0x124)],'goal':_0x4e90d8,'reentry':_0x10edc9['reentry'],'segments':Object[_0x3ded7e(0x131)](_0xcdd1e6)[_0x3ded7e(0x143)]>0x0?_0xcdd1e6:undefined,'activations':Object[_0x3ded7e(0x131)](_0x31452f)['length']>0x0?_0x31452f:undefined,'journeys':_0x1b993b,'bundle_id':_0x10edc9[_0x3ded7e(0x136)],'bundle_name':_0x10edc9['bundle_name']};}function a105_0x26b6(){const _0x46f395=['from','yaml','segments','index','.yaml','null','stringify','entries','version','entry_criteria','connector_config','latest','53505468KpAogW','exclude','steps','type','all_columns','goal','has','behavior','join','condition','draft','description','versionNumber','name','some','segment','map','trim','attributes','branches','include','item','1512476iZEOJJ','max','keys','rule','58875kxPsNu','activation','notification','bundle_id','504jCvIEx','replace','set','match','decision_point','activation_template_id','launched','4023712jiKaQT','toLowerCase','10453422CcgVHP','columns','1367NpobKw','length','2245335wCEhTL','endsWith','object','connection','journeyBundleName','exit_criteria','get','sort','.yml','journey','state','version_number','push','1468whmJEb','with','string','journeys','wait','milestone','schedule','slice','versions','isArray','stages','conditions'];a105_0x26b6=function(){return _0x46f395;};return a105_0x26b6();}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x374b96,_0x2da5a0,_0xed698f,_0x48cf95){const _0x2f920a=a105_0x4b7a,_0x5a1a65=_0x374b96+':'+_0x2da5a0,_0x4ffe95=_0xed698f[_0x2f920a(0x14a)](_0x5a1a65);if(_0x4ffe95)return _0x4ffe95;const _0xd7c737=await _0x48cf95(_0x374b96),_0x49715e=_0xd7c737[_0x2f920a(0x12b)][_0x2f920a(0x148)]||_0xd7c737['attributes'][_0x2f920a(0x126)],_0x48a4e0=_0xd7c737['attributes']['journeyStages']['find'](_0x480e4a=>String(_0x480e4a['id'])===String(_0x2da5a0)),_0x5b65b1=_0x48a4e0?.[_0x2f920a(0x126)]||_0x2da5a0,_0x26654a={'journeyName':_0x49715e,'stageName':_0x5b65b1};return _0xed698f[_0x2f920a(0x139)](_0x5a1a65,_0x26654a),_0x26654a;}export function formatApiJourneyName(_0x202e52,_0x3cbc29){return _0x3cbc29+'\x20('+_0x202e52+')';}export function isLocalJourneyRef(_0x1b910c){const _0x171b52=a105_0x4b7a;return _0x1b910c[_0x171b52(0x145)](_0x171b52(0x14c))||_0x1b910c[_0x171b52(0x145)](_0x171b52(0x111));}export function buildLocalRuleToNameMapping(_0x57072d){const _0x5b4212=a105_0x4b7a,_0x586e07=new Map();if(!_0x57072d)return _0x586e07;for(const [_0x28c655,_0x3ae5b9]of Object[_0x5b4212(0x114)](_0x57072d)){if(_0x3ae5b9[_0x5b4212(0x132)]){const _0x5cce36=serializeRule(_0x3ae5b9[_0x5b4212(0x132)]),_0x2c7dfb=_0x586e07[_0x5b4212(0x14a)](_0x5cce36)||[];_0x2c7dfb[_0x5b4212(0x150)](_0x28c655),_0x586e07[_0x5b4212(0x139)](_0x5cce36,_0x2c7dfb);}}return _0x586e07;}export function buildLocalRuleToNameMappingFromJourney(_0x3bbb36){const _0x46c369=a105_0x4b7a,_0x371f6f=_0x3bbb36[_0x46c369(0x10f)];if(!_0x371f6f)return new Map();const _0x2f300e=collectSegmentUsageCounts(_0x3bbb36),_0x449393=new Map();let _0x1b256a=0x0;for(const [_0x68bf17,_0x314d9c]of Object['entries'](_0x371f6f)){if(!_0x314d9c[_0x46c369(0x132)]){_0x1b256a++;continue;}const _0x27b874=serializeRule(_0x314d9c[_0x46c369(0x132)]),_0xb5eef2=_0x449393[_0x46c369(0x14a)](_0x27b874)||[];_0xb5eef2['push']({'name':_0x68bf17,'index':_0x1b256a}),_0x449393[_0x46c369(0x139)](_0x27b874,_0xb5eef2),_0x1b256a++;}const _0x5a64e2=new Map();for(const [_0x1106ab,_0x467ccb]of _0x449393){const _0x33b011=_0x467ccb[_0x46c369(0x158)]()[_0x46c369(0x14b)]((_0x230e5c,_0x4244ec)=>{const _0x7f4dd7=_0x46c369,_0x4e347=_0x2f300e[_0x7f4dd7(0x14a)](_0x230e5c[_0x7f4dd7(0x126)])||0x0,_0xa4c89a=_0x2f300e[_0x7f4dd7(0x14a)](_0x4244ec[_0x7f4dd7(0x126)])||0x0;if(_0x4e347!==_0xa4c89a)return _0xa4c89a-_0x4e347;return _0x230e5c[_0x7f4dd7(0x110)]-_0x4244ec['index'];})[_0x46c369(0x129)](_0x1a2007=>_0x1a2007[_0x46c369(0x126)]);_0x5a64e2[_0x46c369(0x139)](_0x1106ab,_0x33b011);}return _0x5a64e2;}export function collectSegmentUsageCounts(_0x2d9e52){const _0x3ac344=a105_0x4b7a,_0x74a4c6=new Map(),_0x4f80d6=_0x27356c=>{const _0x168f95=a105_0x4b7a;if(!_0x27356c)return;_0x74a4c6[_0x168f95(0x139)](_0x27356c,(_0x74a4c6[_0x168f95(0x14a)](_0x27356c)||0x0)+0x1);},_0x211ee6=_0x1d1764=>{const _0x366bdd=a105_0x4b7a;for(const _0x457147 of _0x1d1764){_0x4f80d6(_0x457147[_0x366bdd(0x116)]?.[_0x366bdd(0x128)]);if(_0x457147[_0x366bdd(0x149)])for(const _0x1471e9 of _0x457147[_0x366bdd(0x149)]){_0x4f80d6(_0x1471e9[_0x366bdd(0x128)]);}_0x4f80d6(_0x457147[_0x366bdd(0x156)]?.[_0x366bdd(0x128)]);if(_0x457147['steps'])for(const _0xeb54a1 of _0x457147[_0x366bdd(0x11b)]){if(_0xeb54a1[_0x366bdd(0x11c)]===_0x366bdd(0x13b))for(const _0x1d6e97 of _0xeb54a1[_0x366bdd(0x152)][_0x366bdd(0x12c)]){_0x4f80d6(_0x1d6e97['segment']);}else _0xeb54a1[_0x366bdd(0x11c)]===_0x366bdd(0x155)&&_0x4f80d6(_0xeb54a1['with'][_0x366bdd(0x122)]?.[_0x366bdd(0x128)]);}}};_0x4f80d6(_0x2d9e52[_0x3ac344(0x11e)]?.[_0x3ac344(0x128)]);if(_0x2d9e52[_0x3ac344(0x154)])for(const _0x53b609 of _0x2d9e52[_0x3ac344(0x154)]){_0x4f80d6(_0x53b609[_0x3ac344(0x11e)]?.[_0x3ac344(0x128)]),_0x211ee6(_0x53b609['stages']);}_0x2d9e52['stages']&&_0x211ee6(_0x2d9e52[_0x3ac344(0x15b)]);if(_0x2d9e52[_0x3ac344(0x159)])for(const _0x25a2e9 of _0x2d9e52[_0x3ac344(0x159)]){_0x211ee6(_0x25a2e9[_0x3ac344(0x15b)]);}return _0x74a4c6;}
|
|
1
|
+
(function(_0x52bb72,_0x129f76){const _0x5994ab=a105_0x4581,_0x2ca704=_0x52bb72();while(!![]){try{const _0x5e26ae=-parseInt(_0x5994ab(0x148))/0x1*(parseInt(_0x5994ab(0x152))/0x2)+-parseInt(_0x5994ab(0x13f))/0x3+parseInt(_0x5994ab(0x169))/0x4*(-parseInt(_0x5994ab(0x167))/0x5)+-parseInt(_0x5994ab(0x151))/0x6+-parseInt(_0x5994ab(0x14f))/0x7+parseInt(_0x5994ab(0x153))/0x8+parseInt(_0x5994ab(0x15d))/0x9;if(_0x5e26ae===_0x129f76)break;else _0x2ca704['push'](_0x2ca704['shift']());}catch(_0x419094){_0x2ca704['push'](_0x2ca704['shift']());}}}(a105_0x4e48,0x6d12d));import{serializeRule,deepSortObject}from'./child-segment-yaml.js';export const SEGMENT_KIND_JOURNEY=0x3;const MAX_MAPPING_CHAIN_DEPTH=0xa;export function sanitizeYamlKey(_0x2304bd){const _0xe6911c=a105_0x4581;return _0x2304bd[_0xe6911c(0x144)]()[_0xe6911c(0x14d)](/\s+/g,'_')[_0xe6911c(0x14d)](/[^a-z0-9_]/g,'')[_0xe6911c(0x14d)](/_+/g,'_')[_0xe6911c(0x14d)](/^_|_$/g,'');}export function generateJourneyLocalName(_0x5d2eba){const _0x4db53e=a105_0x4581,_0x50fc91=_0x5d2eba[_0x4db53e(0x12f)](/^journey_([a-z_]+)_([0-9a-f-]+)$/i);if(_0x50fc91){const _0x36b42e=_0x50fc91[0x1][_0x4db53e(0x144)](),_0x4c7836=_0x50fc91[0x2],_0x5aefdf=_0x4c7836['replace'](/-/g,'')['slice'](0x0,0x4)[_0x4db53e(0x144)]();return _0x36b42e+'_'+_0x5aefdf;}const _0x1bea7e=_0x5d2eba[_0x4db53e(0x12f)](/^journey_\d+_stage_\d+_step_([0-9a-f-]+)_([a-z_]+)$/i);if(_0x1bea7e){const _0x9b8219=_0x1bea7e[0x1],_0x5bde01=_0x1bea7e[0x2][_0x4db53e(0x144)](),_0x3fe8c3=_0x9b8219[_0x4db53e(0x14d)](/-/g,'')[_0x4db53e(0x160)](0x0,0x4)[_0x4db53e(0x144)]();return _0x5bde01+'_'+_0x3fe8c3;}return undefined;}function a105_0x4581(_0x256650,_0x27157b){_0x256650=_0x256650-0x11c;const _0x4e48e0=a105_0x4e48();let _0x45814f=_0x4e48e0[_0x256650];return _0x45814f;}function stableStringify(_0x300469){const _0x42b3c8=a105_0x4581;if(Array['isArray'](_0x300469))return'['+_0x300469[_0x42b3c8(0x126)](_0x58fe3d=>stableStringify(_0x58fe3d))[_0x42b3c8(0x123)](',')+']';if(_0x300469&&typeof _0x300469===_0x42b3c8(0x11c)){const _0x91c1eb=_0x300469,_0x36bc4d=Object[_0x42b3c8(0x16a)](_0x91c1eb)[_0x42b3c8(0x159)](),_0x144600=_0x36bc4d[_0x42b3c8(0x126)](_0x279b47=>'\x22'+_0x279b47+'\x22:'+stableStringify(_0x91c1eb[_0x279b47]));return'{'+_0x144600[_0x42b3c8(0x123)](',')+'}';}const _0x532f67=JSON[_0x42b3c8(0x13a)](_0x300469);return _0x532f67===undefined?_0x42b3c8(0x149):_0x532f67;}function a105_0x4e48(){const _0x410c60=['exclude','segment','versions','sort','columns','values','wait','19548558zonFpL','journeyStages','reentry','slice','condition','string','draft','launched','with','.yml','1331765ViqWcR','attributes','4hboAeA','keys','object','behavior','entries','conditions','bundle_id','journeys','find','join','trim','yaml','map','journey','get','index','decision_point','item','description','latest','push','match','schedule','include','length','steps','activation','branches','startsWith','activation_template_id','has','rule','stringify','exit_criteria','goal','connector_config','notification','1907556cyVeDL','.yaml','entry_criteria','activations','segments','toLowerCase','milestone','connection','set','105dCYZAl','null','all_columns','version_number','type','replace','endsWith','1055166vYiwwc','version','4832388UIDtwQ','10566NvBAXP','5502072VDjqgP','name','stages'];a105_0x4e48=function(){return _0x410c60;};return a105_0x4e48();}export function consolidateActivationsByContent(_0x4c9892){const _0x12a3b1=a105_0x4581,_0x35557e={},_0x1c9e21=new Map(),_0x3f6c8b=new Map();for(const _0x4b2169 of _0x4c9892){if(!_0x4b2169)continue;for(const [_0x34e304,_0x523d12]of Object['entries'](_0x4b2169)){const _0x4e87f4={'connection':_0x523d12[_0x12a3b1(0x146)],..._0x523d12['all_columns']!==undefined&&{'all_columns':_0x523d12[_0x12a3b1(0x14a)]},..._0x523d12[_0x12a3b1(0x15a)]!==undefined&&{'columns':_0x523d12[_0x12a3b1(0x15a)]},..._0x523d12[_0x12a3b1(0x11d)]!==undefined&&{'behavior':_0x523d12[_0x12a3b1(0x11d)]},..._0x523d12[_0x12a3b1(0x130)]!==undefined&&{'schedule':_0x523d12[_0x12a3b1(0x130)]},..._0x523d12[_0x12a3b1(0x13e)]!==undefined&&{'notification':_0x523d12[_0x12a3b1(0x13e)]},..._0x523d12[_0x12a3b1(0x13d)]!==undefined&&{'connector_config':_0x523d12[_0x12a3b1(0x13d)]},..._0x523d12[_0x12a3b1(0x137)]!==undefined&&{'activation_template_id':_0x523d12[_0x12a3b1(0x137)]}},_0x18084e=stableStringify(_0x4e87f4),_0x362c31=_0x3f6c8b['get'](_0x18084e);_0x362c31?_0x1c9e21[_0x12a3b1(0x147)](_0x34e304,_0x362c31):(_0x35557e[_0x34e304]=_0x523d12,_0x1c9e21[_0x12a3b1(0x147)](_0x34e304,_0x34e304),_0x3f6c8b[_0x12a3b1(0x147)](_0x18084e,_0x34e304));}}return{'merged':_0x35557e,'nameMapping':_0x1c9e21};}export function updateActivationReferences(_0x388766,_0x46c67d){const _0x185af0=a105_0x4581;if(!_0x388766)return;for(const _0x36c070 of _0x388766){if(!_0x36c070[_0x185af0(0x133)])continue;for(const _0x5f4a53 of _0x36c070[_0x185af0(0x133)]){if(_0x5f4a53[_0x185af0(0x14c)]==='activation'&&_0x5f4a53[_0x185af0(0x165)]?.[_0x185af0(0x134)]){const _0x5081fb=_0x46c67d[_0x185af0(0x128)](_0x5f4a53['with'][_0x185af0(0x134)]);_0x5081fb&&_0x5081fb!==_0x5f4a53['with']['activation']&&(_0x5f4a53[_0x185af0(0x165)][_0x185af0(0x134)]=_0x5081fb);}}}}export function consolidateSegmentsByContent(_0x3b3d63,_0x219dd8){const _0x1869de=a105_0x4581,_0x3dac2c={},_0x344de5=new Map(),_0x4adb29=new Map();for(const _0x35364d of _0x3b3d63){if(!_0x35364d)continue;for(const [_0x48bb7a,_0xc384ca]of Object[_0x1869de(0x11e)](_0x35364d)){if(!_0xc384ca['rule']){_0x3dac2c[_0x48bb7a]=_0xc384ca,_0x344de5[_0x1869de(0x147)](_0x48bb7a,_0x48bb7a);continue;}const _0x5f464f=_0xc384ca[_0x1869de(0x12c)]&&_0xc384ca[_0x1869de(0x12c)][_0x1869de(0x124)]()?_0xc384ca[_0x1869de(0x12c)]:undefined,_0x2956ab=JSON['stringify']({'description':_0x5f464f,'rule':deepSortObject(_0xc384ca[_0x1869de(0x139)])}),_0x48abfd=_0x4adb29[_0x1869de(0x128)](_0x2956ab);if(_0x48abfd){const _0x532df1={..._0xc384ca[_0x1869de(0x12c)]!==undefined&&{'description':_0xc384ca['description']},'rule':_0xc384ca[_0x1869de(0x139)]?deepSortObject(_0xc384ca[_0x1869de(0x139)]):_0xc384ca[_0x1869de(0x139)]};if(_0x48bb7a<_0x48abfd){_0x3dac2c[_0x48bb7a]=_0x532df1,delete _0x3dac2c[_0x48abfd];for(const [_0x4be807,_0x284b94]of _0x344de5[_0x1869de(0x11e)]()){_0x284b94===_0x48abfd&&_0x344de5[_0x1869de(0x147)](_0x4be807,_0x48bb7a);}_0x344de5[_0x1869de(0x147)](_0x48bb7a,_0x48bb7a),_0x4adb29[_0x1869de(0x147)](_0x2956ab,_0x48bb7a);}else _0x3dac2c[_0x48abfd]=_0x532df1,_0x344de5[_0x1869de(0x147)](_0x48bb7a,_0x48abfd);}else{let _0x2e6ccd=_0x48bb7a;if(_0x219dd8){const _0x20c81e=_0x219dd8[_0x1869de(0x128)](_0x2956ab);_0x20c81e&&_0x20c81e[_0x1869de(0x132)]>0x0&&(_0x2e6ccd=_0x20c81e['slice']()[_0x1869de(0x159)]()[0x0]);}const _0x3e1346={..._0xc384ca[_0x1869de(0x12c)]!==undefined&&{'description':_0xc384ca[_0x1869de(0x12c)]},'rule':_0xc384ca[_0x1869de(0x139)]?deepSortObject(_0xc384ca['rule']):_0xc384ca[_0x1869de(0x139)]};_0x3dac2c[_0x2e6ccd]=_0x3e1346,_0x344de5[_0x1869de(0x147)](_0x48bb7a,_0x2e6ccd),_0x4adb29[_0x1869de(0x147)](_0x2956ab,_0x2e6ccd);}}}return{'merged':_0x3dac2c,'nameMapping':_0x344de5};}export function updateSegmentReferences(_0x145ce8,_0x129f17){const _0x1a8cdd=a105_0x4581;if(!_0x145ce8)return;for(const _0x433911 of _0x145ce8){if(_0x433911[_0x1a8cdd(0x141)]?.[_0x1a8cdd(0x157)]){const _0x3c8176=_0x129f17[_0x1a8cdd(0x128)](_0x433911[_0x1a8cdd(0x141)]['segment']);_0x3c8176&&(_0x433911[_0x1a8cdd(0x141)][_0x1a8cdd(0x157)]=_0x3c8176);}if(_0x433911[_0x1a8cdd(0x133)])for(const _0x39e990 of _0x433911[_0x1a8cdd(0x133)]){if(_0x39e990['type']===_0x1a8cdd(0x12a)&&_0x39e990[_0x1a8cdd(0x165)]?.[_0x1a8cdd(0x135)])for(const _0x12c340 of _0x39e990['with'][_0x1a8cdd(0x135)]){if(_0x12c340[_0x1a8cdd(0x157)]){const _0x2c06f1=_0x129f17[_0x1a8cdd(0x128)](_0x12c340['segment']);_0x2c06f1&&(_0x12c340[_0x1a8cdd(0x157)]=_0x2c06f1);}}}}}export function updateSegmentRefsInSegments(_0x12182a,_0x4155eb){const _0x1a11a5=a105_0x4581;for(const _0x2939ea of Object[_0x1a11a5(0x15b)](_0x12182a)){_0x2939ea[_0x1a11a5(0x139)]&&updateSegmentRefsInRule(_0x2939ea[_0x1a11a5(0x139)],_0x4155eb);}}function updateSegmentRefsInRule(_0x1caab7,_0x50c1ed){const _0x1692d2=a105_0x4581;if(_0x1caab7===null||typeof _0x1caab7!=='object')return;if(Array['isArray'](_0x1caab7)){for(const _0xb90152 of _0x1caab7){updateSegmentRefsInRule(_0xb90152,_0x50c1ed);}return;}const _0x1f63b1=_0x1caab7;if((_0x1f63b1['type']===_0x1692d2(0x131)||_0x1f63b1[_0x1692d2(0x14c)]===_0x1692d2(0x156))&&typeof _0x1f63b1[_0x1692d2(0x157)]===_0x1692d2(0x162)){const _0x5a1d33=_0x50c1ed[_0x1692d2(0x128)](_0x1f63b1[_0x1692d2(0x157)]);_0x5a1d33&&(_0x1f63b1[_0x1692d2(0x157)]=_0x5a1d33);}if(_0x1f63b1[_0x1692d2(0x11f)]&&Array['isArray'](_0x1f63b1[_0x1692d2(0x11f)]))for(const _0xfd580d of _0x1f63b1['conditions']){updateSegmentRefsInRule(_0xfd580d,_0x50c1ed);}}export function buildJourneysArray(_0x4be14c){const _0x1d67bd=a105_0x4581,_0x1e84a6=Math['max'](..._0x4be14c[_0x1d67bd(0x126)](_0x46134e=>_0x46134e[_0x1d67bd(0x12b)]['versionNumber']||0x0));return _0x4be14c['map'](_0x1469bb=>{const _0x2b507c=_0x1d67bd,_0x419a6f=(_0x1469bb['item']['versionNumber']||0x0)===_0x1e84a6,_0xad5e11=_0x1469bb[_0x2b507c(0x125)]['journeys']?.[0x0],_0x4e5302={'version':_0xad5e11?.['version']||_0x1469bb[_0x2b507c(0x125)][_0x2b507c(0x150)]||_0x1469bb[_0x2b507c(0x12b)][_0x2b507c(0x154)],'state':_0x1469bb[_0x2b507c(0x12b)]['state']===_0x2b507c(0x164)?_0x2b507c(0x164):_0x2b507c(0x163),'stages':_0xad5e11?.[_0x2b507c(0x155)]||_0x1469bb['yaml'][_0x2b507c(0x155)]||[],'id':_0xad5e11?.['id']||_0x1469bb[_0x2b507c(0x125)]['id'],'version_number':_0xad5e11?.[_0x2b507c(0x14b)]||_0x1469bb[_0x2b507c(0x125)]['version_number']};return _0x419a6f&&(_0x4e5302[_0x2b507c(0x12d)]=!![]),_0x4e5302;});}export function buildMergedJourneyDef(_0x446a3a,_0x48e699){const _0x411b21=a105_0x4581,_0x5493d9=_0x446a3a[0x0]['yaml'],_0x53dac3=buildJourneysArray(_0x446a3a),{merged:_0x1d8213,nameMapping:_0xd94b96}=consolidateSegmentsByContent(_0x446a3a[_0x411b21(0x126)](_0x41bc1f=>_0x41bc1f[_0x411b21(0x125)]['segments']),_0x48e699);updateSegmentRefsInSegments(_0x1d8213,_0xd94b96);const _0xfc2e25=Array['from'](_0xd94b96[_0x411b21(0x11e)]())['some'](([_0x42cabe,_0x1eff6c])=>_0x42cabe!==_0x1eff6c&&_0x42cabe[_0x411b21(0x136)](_0x411b21(0x141)));let _0x56c1c8=_0x1d8213,_0x1d9432=new Map();if(_0xfc2e25){const _0x32023d=consolidateSegmentsByContent([_0x1d8213],_0x48e699);_0x56c1c8=_0x32023d['merged'],_0x1d9432=_0x32023d['nameMapping'];}const _0x44f168=new Map(_0xd94b96);for(const [_0x4401d7,_0x32bbbe]of _0x1d9432['entries']()){_0x44f168['set'](_0x4401d7,_0x32bbbe);}for(const [_0x5a78ec,_0x872899]of _0x44f168[_0x411b21(0x11e)]()){let _0x82837b=_0x872899,_0x3ebd27=0x0;while(_0x44f168[_0x411b21(0x138)](_0x82837b)&&_0x44f168[_0x411b21(0x128)](_0x82837b)!==_0x82837b&&_0x3ebd27<MAX_MAPPING_CHAIN_DEPTH){_0x82837b=_0x44f168[_0x411b21(0x128)](_0x82837b),_0x3ebd27++;}_0x82837b!==_0x872899&&_0x44f168['set'](_0x5a78ec,_0x82837b);}for(const _0x34b9d3 of _0x53dac3){updateSegmentReferences(_0x34b9d3[_0x411b21(0x155)],_0x44f168);}const {merged:_0x36e660,nameMapping:_0x520d6d}=consolidateActivationsByContent(_0x446a3a[_0x411b21(0x126)](_0x2880f3=>_0x2880f3[_0x411b21(0x125)][_0x411b21(0x142)]));for(const _0x2a530a of _0x53dac3){updateActivationReferences(_0x2a530a[_0x411b21(0x155)],_0x520d6d);}let _0x58f126=_0x5493d9[_0x411b21(0x13c)];if(_0x58f126?.[_0x411b21(0x157)]){const _0x215897=_0x44f168[_0x411b21(0x128)](_0x58f126[_0x411b21(0x157)]);_0x215897&&(_0x58f126={..._0x58f126,'segment':_0x215897});}for(const _0x312076 of _0x53dac3){if(_0x312076[_0x411b21(0x13c)]?.[_0x411b21(0x157)]){const _0x487b11=_0x44f168[_0x411b21(0x128)](_0x312076[_0x411b21(0x13c)][_0x411b21(0x157)]);_0x487b11&&(_0x312076[_0x411b21(0x13c)]={..._0x312076[_0x411b21(0x13c)],'segment':_0x487b11});}}return{'type':_0x411b21(0x127),'name':_0x5493d9['name'],'description':_0x5493d9[_0x411b21(0x12c)],'goal':_0x58f126,'reentry':_0x5493d9[_0x411b21(0x15f)],'segments':Object['keys'](_0x56c1c8)['length']>0x0?_0x56c1c8:undefined,'activations':Object[_0x411b21(0x16a)](_0x36e660)[_0x411b21(0x132)]>0x0?_0x36e660:undefined,'journeys':_0x53dac3,'bundle_id':_0x5493d9[_0x411b21(0x120)],'bundle_name':_0x5493d9['bundle_name']};}export function createJumpTargetCache(){return new Map();}export async function resolveJumpTarget(_0x53d8c8,_0x1ac7fb,_0x4fefe6,_0x2f6c90){const _0xe54678=a105_0x4581,_0x1d6dc1=_0x53d8c8+':'+_0x1ac7fb,_0x2fdbce=_0x4fefe6[_0xe54678(0x128)](_0x1d6dc1);if(_0x2fdbce)return _0x2fdbce;const _0x12bbe7=await _0x2f6c90(_0x53d8c8),_0x1ff1bc=_0x12bbe7[_0xe54678(0x168)]['journeyBundleName']||_0x12bbe7[_0xe54678(0x168)][_0xe54678(0x154)],_0x480308=_0x12bbe7[_0xe54678(0x168)][_0xe54678(0x15e)][_0xe54678(0x122)](_0x121d36=>String(_0x121d36['id'])===String(_0x1ac7fb)),_0x2be96e=_0x480308?.[_0xe54678(0x154)]||_0x1ac7fb,_0xaec9c={'journeyName':_0x1ff1bc,'stageName':_0x2be96e};return _0x4fefe6[_0xe54678(0x147)](_0x1d6dc1,_0xaec9c),_0xaec9c;}export function formatApiJourneyName(_0x4060c1,_0xd10909){return _0xd10909+'\x20('+_0x4060c1+')';}export function isLocalJourneyRef(_0x495a60){const _0xadad3=a105_0x4581;return _0x495a60[_0xadad3(0x14e)](_0xadad3(0x166))||_0x495a60[_0xadad3(0x14e)](_0xadad3(0x140));}export function buildLocalRuleToNameMapping(_0x24d468){const _0x591032=a105_0x4581,_0x3f328b=new Map();if(!_0x24d468)return _0x3f328b;for(const [_0x38ca98,_0x15f931]of Object[_0x591032(0x11e)](_0x24d468)){if(_0x15f931[_0x591032(0x139)]){const _0x5a39e2=serializeRule(_0x15f931['rule']),_0x34eb99=_0x3f328b[_0x591032(0x128)](_0x5a39e2)||[];_0x34eb99['push'](_0x38ca98),_0x3f328b[_0x591032(0x147)](_0x5a39e2,_0x34eb99);}}return _0x3f328b;}export function buildLocalRuleToNameMappingFromJourney(_0x5227e8){const _0x50c5ec=a105_0x4581,_0x1a550a=_0x5227e8[_0x50c5ec(0x143)];if(!_0x1a550a)return new Map();const _0x214874=collectSegmentUsageCounts(_0x5227e8),_0x2fe15c=new Map();let _0x286968=0x0;for(const [_0x20cd2c,_0x39e371]of Object[_0x50c5ec(0x11e)](_0x1a550a)){if(!_0x39e371[_0x50c5ec(0x139)]){_0x286968++;continue;}const _0x39a124=serializeRule(_0x39e371['rule']),_0x55707e=_0x2fe15c['get'](_0x39a124)||[];_0x55707e[_0x50c5ec(0x12e)]({'name':_0x20cd2c,'index':_0x286968}),_0x2fe15c[_0x50c5ec(0x147)](_0x39a124,_0x55707e),_0x286968++;}const _0x316a71=new Map();for(const [_0x5eaa4b,_0x2d0f49]of _0x2fe15c){const _0x4915af=_0x2d0f49[_0x50c5ec(0x160)]()[_0x50c5ec(0x159)]((_0x1be057,_0x437731)=>{const _0x1d5fa8=_0x50c5ec,_0x4216bb=_0x214874[_0x1d5fa8(0x128)](_0x1be057[_0x1d5fa8(0x154)])||0x0,_0x4ec844=_0x214874[_0x1d5fa8(0x128)](_0x437731[_0x1d5fa8(0x154)])||0x0;if(_0x4216bb!==_0x4ec844)return _0x4ec844-_0x4216bb;return _0x1be057[_0x1d5fa8(0x129)]-_0x437731[_0x1d5fa8(0x129)];})[_0x50c5ec(0x126)](_0x58adb3=>_0x58adb3[_0x50c5ec(0x154)]);_0x316a71[_0x50c5ec(0x147)](_0x5eaa4b,_0x4915af);}return _0x316a71;}export function collectSegmentUsageCounts(_0x37baa3){const _0x20f477=a105_0x4581,_0x4126e8=new Map(),_0x23ba5c=_0x5b97a1=>{const _0x115bc5=a105_0x4581;if(!_0x5b97a1)return;_0x4126e8[_0x115bc5(0x147)](_0x5b97a1,(_0x4126e8[_0x115bc5(0x128)](_0x5b97a1)||0x0)+0x1);},_0x3aee35=_0x109ce8=>{const _0x5a3760=a105_0x4581;for(const _0x458b0e of _0x109ce8){_0x23ba5c(_0x458b0e[_0x5a3760(0x141)]?.[_0x5a3760(0x157)]);if(_0x458b0e[_0x5a3760(0x13b)])for(const _0x4e9a30 of _0x458b0e[_0x5a3760(0x13b)]){_0x23ba5c(_0x4e9a30[_0x5a3760(0x157)]);}_0x23ba5c(_0x458b0e[_0x5a3760(0x145)]?.[_0x5a3760(0x157)]);if(_0x458b0e['steps'])for(const _0x23d4a8 of _0x458b0e[_0x5a3760(0x133)]){if(_0x23d4a8[_0x5a3760(0x14c)]===_0x5a3760(0x12a))for(const _0x16ac09 of _0x23d4a8[_0x5a3760(0x165)][_0x5a3760(0x135)]){_0x23ba5c(_0x16ac09[_0x5a3760(0x157)]);}else _0x23d4a8['type']===_0x5a3760(0x15c)&&_0x23ba5c(_0x23d4a8['with'][_0x5a3760(0x161)]?.[_0x5a3760(0x157)]);}}};_0x23ba5c(_0x37baa3[_0x20f477(0x13c)]?.['segment']);if(_0x37baa3[_0x20f477(0x121)])for(const _0x57674f of _0x37baa3[_0x20f477(0x121)]){_0x23ba5c(_0x57674f[_0x20f477(0x13c)]?.[_0x20f477(0x157)]),_0x3aee35(_0x57674f[_0x20f477(0x155)]);}_0x37baa3[_0x20f477(0x155)]&&_0x3aee35(_0x37baa3[_0x20f477(0x155)]);if(_0x37baa3[_0x20f477(0x158)])for(const _0x28df80 of _0x37baa3['versions']){_0x3aee35(_0x28df80[_0x20f477(0x155)]);}return _0x4126e8;}
|