@treasuredata/tdx 2026.3.4 → 2026.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.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/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/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/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43b241,_0x1f68ff){const _0x207d38=a120_0x41bf,_0x2646a8=_0x43b241();while(!![]){try{const _0x499d5c=-parseInt(_0x207d38(0x1b9))/0x1+parseInt(_0x207d38(0x1b8))/0x2+-parseInt(_0x207d38(0x1c2))/0x3+-parseInt(_0x207d38(0x1cb))/0x4*(parseInt(_0x207d38(0x1c4))/0x5)+-parseInt(_0x207d38(0x1d0))/0x6*(-parseInt(_0x207d38(0x1b6))/0x7)+parseInt(_0x207d38(0x1c1))/0x8*(parseInt(_0x207d38(0x1ce))/0x9)+parseInt(_0x207d38(0x1bd))/0xa;if(_0x499d5c===_0x1f68ff)break;else _0x2646a8['push'](_0x2646a8['shift']());}catch(_0x128327){_0x2646a8['push'](_0x2646a8['shift']());}}}(a120_0x5a72,0x9b9df));export const MODEL_PRICING={'claude-opus-4-6':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'claude-opus-4-5-20251101':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'opus':{'inputPricePerMTok':0x5,'outputPricePerMTok':0x19,'cacheWritePricePerMTok':6.25,'cacheReadPricePerMTok':0.5},'claude-sonnet-4-5-20250929':{'inputPricePerMTok':0x3,'outputPricePerMTok':0xf,'cacheWritePricePerMTok':3.75,'cacheReadPricePerMTok':0.3},'sonnet':{'inputPricePerMTok':0x3,'outputPricePerMTok':0xf,'cacheWritePricePerMTok':3.75,'cacheReadPricePerMTok':0.3},'claude-haiku-4-5-20251001':{'inputPricePerMTok':0x1,'outputPricePerMTok':0x5,'cacheWritePricePerMTok':1.25,'cacheReadPricePerMTok':0.1},'haiku':{'inputPricePerMTok':0x1,'outputPricePerMTok':0x5,'cacheWritePricePerMTok':1.25,'cacheReadPricePerMTok':0.1}};export const EXTENDED_CONTEXT_PRICING={'inputPricePerMTok':0x6,'outputPricePerMTok':22.5,'cacheWritePricePerMTok':7.5,'cacheReadPricePerMTok':0.6};function a120_0x41bf(_0x46a8df,_0x4ab2a8){_0x46a8df=_0x46a8df-0x1b4;const _0x5a7295=a120_0x5a72();let _0x41bf7d=_0x5a7295[_0x46a8df];return _0x41bf7d;}function a120_0x5a72(){const _0x56aaf7=['Opus\x204.5','2231770mSOqgE','4-5','Sonnet\x204','cacheReadPricePerMTok','215672zDpiPZ','608766KCngWq','cacheWritePricePerMTok','5NzAZvs','inputPricePerMTok','haiku','Sonnet\x204.5','Claude','Haiku\x204.5','opus','4218932VwKMKJ','includes','toLowerCase','45zLktoD','sonnet','650490qbenym','Haiku\x204','4.5','77XGAsNh','en-US','1579798rNVYOs','445374SanyPD','4.6','4-6'];a120_0x5a72=function(){return _0x56aaf7;};return a120_0x5a72();}export const USD_PER_AI_CREDIT=54.24;export const CONTEXT_LIMITS={'sonnet':0x30d40,'haiku':0x30d40,'opus':0x30d40,'default':0x30d40};export function getModelPricing(_0x1ffff6){const _0x5aa2e7=a120_0x41bf;if(MODEL_PRICING[_0x1ffff6])return MODEL_PRICING[_0x1ffff6];const _0x20bbcd=_0x1ffff6['toLowerCase']();if(_0x20bbcd[_0x5aa2e7(0x1cc)](_0x5aa2e7(0x1ca)))return MODEL_PRICING[_0x5aa2e7(0x1ca)];if(_0x20bbcd[_0x5aa2e7(0x1cc)](_0x5aa2e7(0x1cf)))return MODEL_PRICING['sonnet'];if(_0x20bbcd['includes'](_0x5aa2e7(0x1c6)))return MODEL_PRICING[_0x5aa2e7(0x1c6)];return MODEL_PRICING[_0x5aa2e7(0x1cf)];}export function calculateTokenCost(_0x1503f4,_0x56bf4a,_0xf86646,_0x3f2272,_0x37a50d){const _0x562a7b=a120_0x41bf,_0x3bbfed=0xf4240;return _0x1503f4*_0x37a50d[_0x562a7b(0x1c5)]/_0x3bbfed+_0x56bf4a*_0x37a50d['outputPricePerMTok']/_0x3bbfed+_0xf86646*_0x37a50d[_0x562a7b(0x1c3)]/_0x3bbfed+_0x3f2272*_0x37a50d[_0x562a7b(0x1c0)]/_0x3bbfed;}export function usdToAiCredits(_0x2b611d){return _0x2b611d/USD_PER_AI_CREDIT;}export function calculateCreditsFromTokens(_0x11c1f8,_0x4cb026,_0x4778c5,_0x1744bc,_0xa8810d){const _0x542c7e=getModelPricing(_0xa8810d),_0x498c48=calculateTokenCost(_0x11c1f8,_0x4cb026,_0x4778c5,_0x1744bc,_0x542c7e);return usdToAiCredits(_0x498c48);}export function getContextLimit(_0x26b3d3){const _0x53f106=a120_0x41bf,_0x13711f=_0x26b3d3['toLowerCase']();if(_0x13711f[_0x53f106(0x1cc)](_0x53f106(0x1cf)))return CONTEXT_LIMITS[_0x53f106(0x1cf)];if(_0x13711f[_0x53f106(0x1cc)](_0x53f106(0x1c6)))return CONTEXT_LIMITS[_0x53f106(0x1c6)];if(_0x13711f[_0x53f106(0x1cc)](_0x53f106(0x1ca)))return CONTEXT_LIMITS['opus'];return CONTEXT_LIMITS['default'];}export function getModelDisplayName(_0x51fa32){const _0x1fad72=a120_0x41bf,_0x3d5d81=_0x51fa32[_0x1fad72(0x1cd)]();if(_0x3d5d81[_0x1fad72(0x1cc)]('sonnet')){if(_0x3d5d81[_0x1fad72(0x1cc)]('4-5')||_0x3d5d81['includes'](_0x1fad72(0x1b5)))return _0x1fad72(0x1c7);return _0x1fad72(0x1bf);}if(_0x3d5d81[_0x1fad72(0x1cc)]('haiku')){if(_0x3d5d81[_0x1fad72(0x1cc)](_0x1fad72(0x1be))||_0x3d5d81['includes'](_0x1fad72(0x1b5)))return _0x1fad72(0x1c9);return _0x1fad72(0x1b4);}if(_0x3d5d81[_0x1fad72(0x1cc)]('opus')){if(_0x3d5d81[_0x1fad72(0x1cc)](_0x1fad72(0x1bb))||_0x3d5d81[_0x1fad72(0x1cc)](_0x1fad72(0x1ba)))return'Opus\x204.6';if(_0x3d5d81[_0x1fad72(0x1cc)](_0x1fad72(0x1be))||_0x3d5d81[_0x1fad72(0x1cc)](_0x1fad72(0x1b5)))return _0x1fad72(0x1bc);return'Opus\x204';}return _0x1fad72(0x1c8);}export function formatTokenCount(_0x22245d){const _0x13e081=a120_0x41bf;return _0x22245d['toLocaleString'](_0x13e081(0x1b7));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a121_0x5b2533=a121_0x4587;(function(_0x413047,_0x1da06e){const _0x30f43a=a121_0x4587,_0x43ed37=_0x413047();while(!![]){try{const _0x42983d=-parseInt(_0x30f43a(0xb5))/0x1+-parseInt(_0x30f43a(0xa0))/0x2*(parseInt(_0x30f43a(0xa1))/0x3)+-parseInt(_0x30f43a(0xa4))/0x4*(parseInt(_0x30f43a(0xb4))/0x5)+-parseInt(_0x30f43a(0x9e))/0x6+parseInt(_0x30f43a(0xb7))/0x7+-parseInt(_0x30f43a(0xb6))/0x8*(parseInt(_0x30f43a(0xa6))/0x9)+-parseInt(_0x30f43a(0x9d))/0xa*(-parseInt(_0x30f43a(0xba))/0xb);if(_0x42983d===_0x1da06e)break;else _0x43ed37['push'](_0x43ed37['shift']());}catch(_0x24650a){_0x43ed37['push'](_0x43ed37['shift']());}}}(a121_0x1dc9,0xeb355));function a121_0x4587(_0x2b9d5f,_0x4e23f7){_0x2b9d5f=_0x2b9d5f-0x9d;const _0x1dc987=a121_0x1dc9();let _0x45875b=_0x1dc987[_0x2b9d5f];return _0x45875b;}import{HTTPClient}from'./client/http-client.js';import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';function a121_0x1dc9(){const _0x3a1038=['PUT','DELETE','/realtime_personalization_services/','5XimIMm','910567LSJwKO','2936280iaXVjh','484491vflTyC','application/json','accessToken','54848981IkpdgU','get','10gZjIkT','7829844qdLjER','delete','2pBONgF','1723026Aqihtq','create','site','3740612pjxKcI','httpClient','9zqPtbU','isArray','GET','/realtime_personalization_services','/audiences/','POST','application/vnd.treasuredata.v1+json','update','request','proxy','apiKey'];a121_0x1dc9=function(){return _0x3a1038;};return a121_0x1dc9();}export class PersonalizationSDK{[a121_0x5b2533(0xa5)];constructor(_0x2621c0){const _0x1b0d0b=a121_0x5b2533,_0x2fffa0=getEndpoint(_0x2621c0['site'],'cdp'),_0x4830e3=toHeaderRecord(getAuthHeaders(_0x2621c0[_0x1b0d0b(0xa3)],_0x2621c0[_0x1b0d0b(0xb0)],_0x2621c0[_0x1b0d0b(0xb9)]));this['httpClient']=new HTTPClient(_0x2fffa0,{..._0x4830e3,'Accept':_0x1b0d0b(0xac),'Content-Type':_0x1b0d0b(0xb8)},{'proxy':_0x2621c0[_0x1b0d0b(0xaf)]});}async['list'](_0x2f4d18){const _0x46da4f=a121_0x5b2533,_0x509c3d=await this[_0x46da4f(0xa5)][_0x46da4f(0xae)]('GET',_0x46da4f(0xaa)+_0x2f4d18+'/realtime_personalization_services?page[size]=100');return Array[_0x46da4f(0xa7)](_0x509c3d)?_0x509c3d:_0x509c3d['data']||[];}async[a121_0x5b2533(0xbb)](_0x41e500,_0x34f8ac){const _0x1e9737=a121_0x5b2533,_0xe1734f=await this[_0x1e9737(0xa5)][_0x1e9737(0xae)](_0x1e9737(0xa8),_0x1e9737(0xaa)+_0x41e500+_0x1e9737(0xb3)+_0x34f8ac);return _0xe1734f||{};}async[a121_0x5b2533(0xa2)](_0x1eb4d1,_0x38a552){const _0x41b7ac=a121_0x5b2533,_0x2a8dad=await this[_0x41b7ac(0xa5)]['request'](_0x41b7ac(0xab),_0x41b7ac(0xaa)+_0x1eb4d1+_0x41b7ac(0xa9),{'body':_0x38a552});return _0x2a8dad||{};}async[a121_0x5b2533(0xad)](_0x9c92e8,_0xc72143,_0x1ad042){const _0x53d2ed=a121_0x5b2533,_0x4f8ed4=await this[_0x53d2ed(0xa5)][_0x53d2ed(0xae)](_0x53d2ed(0xb1),_0x53d2ed(0xaa)+_0x9c92e8+'/realtime_personalization_services/'+_0xc72143,{'body':_0x1ad042});return _0x4f8ed4||{};}async[a121_0x5b2533(0x9f)](_0x4cc9ea,_0x1df2b0){const _0x2ec28b=a121_0x5b2533;await this[_0x2ec28b(0xa5)][_0x2ec28b(0xae)](_0x2ec28b(0xb2),'/audiences/'+_0x4cc9ea+_0x2ec28b(0xb3)+_0x1df2b0);}}
|
package/dist/sdk/query/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a122_0x44e30e=a122_0x4b65;(function(_0x377876,_0x3e6e23){const _0x3e1ab4=a122_0x4b65,_0x3bf7a5=_0x377876();while(!![]){try{const _0x5493c8=parseInt(_0x3e1ab4(0x149))/0x1*(parseInt(_0x3e1ab4(0x15d))/0x2)+parseInt(_0x3e1ab4(0x14f))/0x3*(-parseInt(_0x3e1ab4(0x14d))/0x4)+parseInt(_0x3e1ab4(0x163))/0x5*(-parseInt(_0x3e1ab4(0x168))/0x6)+parseInt(_0x3e1ab4(0x166))/0x7*(-parseInt(_0x3e1ab4(0x13e))/0x8)+-parseInt(_0x3e1ab4(0x15e))/0x9+-parseInt(_0x3e1ab4(0x159))/0xa*(-parseInt(_0x3e1ab4(0x161))/0xb)+-parseInt(_0x3e1ab4(0x144))/0xc*(-parseInt(_0x3e1ab4(0x13f))/0xd);if(_0x5493c8===_0x3e6e23)break;else _0x3bf7a5['push'](_0x3bf7a5['shift']());}catch(_0x52ac8c){_0x3bf7a5['push'](_0x3bf7a5['shift']());}}}(a122_0x8539,0x8a035));import{TrinoApiClient}from'../client/trino-api-client.js';import{escapeStringLiteral,buildLikePattern}from'../../utils/string-utils.js';import{SDKError,ErrorCode}from'../errors.js';import{DEFAULT_LISTING_LIMIT}from'../../core/constants.js';function a122_0x4b65(_0x29b2cc,_0x4177b9){_0x29b2cc=_0x29b2cc-0x12d;const _0x853911=a122_0x8539();let _0x4b6554=_0x853911[_0x29b2cc];return _0x4b6554;}export class QuerySDK{[a122_0x44e30e(0x12f)];constructor(_0x53be0f){const _0x3ff3c5=a122_0x44e30e;this[_0x3ff3c5(0x12f)]=new TrinoApiClient(_0x53be0f);}async[a122_0x44e30e(0x157)](_0x15da9c,_0x43c83c){const _0x5ffd9d=a122_0x44e30e;if(!_0x15da9c||_0x15da9c[_0x5ffd9d(0x146)]()['length']===0x0)throw new SDKError(ErrorCode[_0x5ffd9d(0x15a)],_0x5ffd9d(0x145),undefined,{'helpText':_0x5ffd9d(0x139)});return await this[_0x5ffd9d(0x12f)][_0x5ffd9d(0x138)](_0x15da9c,_0x43c83c);}async[a122_0x44e30e(0x162)](_0x15166d,_0x3f297b=DEFAULT_LISTING_LIMIT){const _0x530722=a122_0x44e30e;if(_0x15166d!==undefined&&_0x15166d[_0x530722(0x146)]()[_0x530722(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x530722(0x155)],_0x530722(0x15f),undefined,{'helpText':_0x530722(0x132)});if(_0x3f297b<=0x0)throw new SDKError(ErrorCode[_0x530722(0x155)],'Limit\x20must\x20be\x20a\x20positive\x20number',undefined,{'helpText':_0x530722(0x13a)});let _0x16a6a0=_0x530722(0x12e);_0x15166d&&(_0x16a6a0+='\x0a\x20\x20AND\x20schema_name\x20LIKE\x20'+buildLikePattern(_0x15166d)+_0x530722(0x134));_0x16a6a0+=_0x530722(0x133)+_0x3f297b;const _0x119a59=await this[_0x530722(0x12f)]['executeQuery'](_0x16a6a0['trim']());return _0x119a59[_0x530722(0x147)];}async[a122_0x44e30e(0x140)](_0x2a9676,_0x3750e8,_0x138799,_0x5269e4=DEFAULT_LISTING_LIMIT){const _0x4162fb=a122_0x44e30e;if(_0x2a9676!==undefined&&_0x2a9676[_0x4162fb(0x146)]()['length']===0x0)throw new SDKError(ErrorCode[_0x4162fb(0x155)],_0x4162fb(0x14c),undefined,{'helpText':_0x4162fb(0x165)});if(_0x3750e8!==undefined&&_0x3750e8['trim']()[_0x4162fb(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x4162fb(0x155)],_0x4162fb(0x15f),undefined,{'helpText':_0x4162fb(0x160)});if(_0x138799!==undefined&&_0x138799[_0x4162fb(0x146)]()[_0x4162fb(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x4162fb(0x155)],_0x4162fb(0x141),undefined,{'helpText':_0x4162fb(0x148)});if(_0x5269e4<=0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4162fb(0x14b),undefined,{'helpText':_0x4162fb(0x13a)});let _0xf06740;_0x2a9676?(_0xf06740=_0x4162fb(0x152)+escapeStringLiteral(_0x2a9676)+_0x4162fb(0x142),_0x3750e8&&(_0xf06740+='\x0a\x20\x20AND\x20table_name\x20LIKE\x20'+buildLikePattern(_0x3750e8)+_0x4162fb(0x134)),_0xf06740+=_0x4162fb(0x130)+_0x5269e4):(_0xf06740=_0x4162fb(0x15b),_0x138799&&(_0xf06740+=_0x4162fb(0x12d)+buildLikePattern(_0x138799)+_0x4162fb(0x134)),_0x3750e8&&(_0xf06740+='\x0a\x20\x20AND\x20table_name\x20LIKE\x20'+buildLikePattern(_0x3750e8)+_0x4162fb(0x134)),_0xf06740+=_0x4162fb(0x135)+_0x5269e4);const _0x535cc6=await this[_0x4162fb(0x12f)]['executeQuery'](_0xf06740[_0x4162fb(0x146)]());return _0x535cc6[_0x4162fb(0x147)];}async[a122_0x44e30e(0x14e)](_0x477f4f){const _0x202b72=a122_0x44e30e,_0x5a6662=(_0x202b72(0x13d)+escapeStringLiteral(_0x477f4f)+'\x0a\x20\x20\x20\x20')[_0x202b72(0x146)](),_0x337670=await this[_0x202b72(0x12f)][_0x202b72(0x138)](_0x5a6662);return _0x337670[_0x202b72(0x147)][_0x202b72(0x15c)]>0x0;}async['validateTable'](_0x3ac0a8,_0x1793f8){const _0x63d190=a122_0x44e30e,_0x1b5cd4=(_0x63d190(0x131)+escapeStringLiteral(_0x3ac0a8)+_0x63d190(0x153)+escapeStringLiteral(_0x1793f8)+'\x0a\x20\x20\x20\x20')[_0x63d190(0x146)](),_0x3a892c=await this[_0x63d190(0x12f)][_0x63d190(0x138)](_0x1b5cd4);return _0x3a892c[_0x63d190(0x147)]['length']>0x0;}async[a122_0x44e30e(0x137)](_0x1682a3,_0x4ae7f8){const _0x204938=a122_0x44e30e;if(!_0x1682a3||_0x1682a3['trim']()[_0x204938(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x204938(0x15a)],_0x204938(0x14a),undefined,{'helpText':'Usage:\x20tdx\x20describe\x20<database.table>'});if(!_0x4ae7f8||_0x4ae7f8[_0x204938(0x146)]()[_0x204938(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x204938(0x15a)],_0x204938(0x13b),undefined,{'helpText':_0x204938(0x151)});const _0x1ddbd2=('\x0a\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20column_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20data_type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20is_nullable\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.columns\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20'+escapeStringLiteral(_0x1682a3)+_0x204938(0x153)+escapeStringLiteral(_0x4ae7f8)+_0x204938(0x154))[_0x204938(0x146)](),_0x5425e9=await this[_0x204938(0x12f)][_0x204938(0x138)](_0x1ddbd2);return _0x5425e9[_0x204938(0x147)];}async[a122_0x44e30e(0x156)](_0x205956,_0x566e1b,_0x3c4b07=0x28,_0x4e8209){const _0x38f9f6=a122_0x44e30e;if(!_0x205956||_0x205956[_0x38f9f6(0x146)]()['length']===0x0)throw new SDKError(ErrorCode[_0x38f9f6(0x15a)],_0x38f9f6(0x14a),undefined,{'helpText':_0x38f9f6(0x143)});if(!_0x566e1b||_0x566e1b['trim']()[_0x38f9f6(0x15c)]===0x0)throw new SDKError(ErrorCode[_0x38f9f6(0x15a)],_0x38f9f6(0x13b),undefined,{'helpText':_0x38f9f6(0x143)});if(!Number[_0x38f9f6(0x158)](_0x3c4b07)||_0x3c4b07<=0x0)throw new SDKError(ErrorCode[_0x38f9f6(0x155)],_0x38f9f6(0x150),undefined,{'helpText':_0x38f9f6(0x13c)});const _0x15575a=escapeStringLiteral(_0x205956)['slice'](0x1,-0x1)+'.'+escapeStringLiteral(_0x566e1b)[_0x38f9f6(0x136)](0x1,-0x1),_0x3acf14=_0x38f9f6(0x167)+_0x15575a+_0x38f9f6(0x164)+_0x3c4b07,_0x5e74da=await this['trinoApiClient'][_0x38f9f6(0x138)](_0x3acf14,{'catalog':_0x4e8209,'schema':_0x205956});return _0x5e74da;}}function a122_0x8539(){const _0x4289b6=['executeQuery','Provide\x20SQL\x20via\x20argument\x20or\x20use\x20--file\x20option.','Provide\x20a\x20positive\x20number\x20for\x20limit\x20(e.g.,\x20100).','Table\x20name\x20is\x20required','Use\x20--limit\x20<number>\x20to\x20specify\x20row\x20limit\x20(must\x20be\x20positive).','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20schema_name\x20=\x20','5823280BJNpHd','538681dOFrvq','listTables','Database\x20pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','\x0a\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20show\x20<database.table>','552AvYRfM','SQL\x20query\x20is\x20required','trim','data','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20to\x20search\x20all\x20databases.','272186ivmntu','Database\x20name\x20is\x20required','Limit\x20must\x20be\x20a\x20positive\x20number','Database\x20name\x20cannot\x20be\x20empty\x20or\x20whitespace-only','2470948JdVeKY','validateDatabase','3WUWIjH','Limit\x20must\x20be\x20a\x20positive\x20integer','Usage:\x20tdx\x20describe\x20<database.table>','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_name\x20=\x20','\x0a\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20ordinal_position\x0a\x20\x20\x20\x20','INVALID_ARGUMENT','showTable','execute','isInteger','144140FKekCm','MISSING_ARGUMENT','\x0a\x20\x20\x20\x20\x20\x20\x20\x20SELECT\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_schema\x20AS\x20database_name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20table_name\x0a\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20','length','8WvwMLj','6927039ZmrNEi','Pattern\x20cannot\x20be\x20empty\x20or\x20whitespace-only','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22user_*\x22)\x20or\x20omit\x20to\x20list\x20all\x20tables.','451mxzbrI','listDatabases','5fhpdPV','\x20LIMIT\x20','Provide\x20a\x20valid\x20database\x20name\x20or\x20omit\x20to\x20list\x20tables\x20from\x20all\x20databases.','7eRWPLC','SELECT\x20*\x20FROM\x20','5431206wVIeDT','\x0a\x20\x20AND\x20table_schema\x20LIKE\x20','\x0a\x20\x20\x20\x20\x20\x20SELECT\x20schema_name\x20AS\x20database_name\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.schemata\x0a\x20\x20\x20\x20\x20\x20WHERE\x20catalog_name\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20','trinoApiClient','\x0aORDER\x20BY\x20table_name\x0aLIMIT\x20','\x0a\x20\x20\x20\x20\x20\x20SELECT\x201\x0a\x20\x20\x20\x20\x20\x20FROM\x20td.information_schema.tables\x0a\x20\x20\x20\x20\x20\x20WHERE\x20table_catalog\x20=\x20\x27td\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20AND\x20table_schema\x20=\x20','Provide\x20a\x20valid\x20glob\x20pattern\x20(e.g.,\x20\x22prod_*\x22)\x20or\x20omit\x20the\x20pattern\x20to\x20list\x20all\x20databases.','\x0aORDER\x20BY\x20database_name\x0aLIMIT\x20','\x20ESCAPE\x20\x27\x5c\x27','\x0aORDER\x20BY\x20database_name,\x20table_name\x0aLIMIT\x20','slice','describeTable'];a122_0x8539=function(){return _0x4289b6;};return a122_0x8539();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x39b7a2,_0x2a6a70){const _0x251004=a123_0x198a,_0x5cdebf=_0x39b7a2();while(!![]){try{const _0x5d39e0=-parseInt(_0x251004(0x88))/0x1+-parseInt(_0x251004(0x94))/0x2*(parseInt(_0x251004(0x93))/0x3)+-parseInt(_0x251004(0x92))/0x4*(parseInt(_0x251004(0x7c))/0x5)+parseInt(_0x251004(0x97))/0x6*(parseInt(_0x251004(0x7d))/0x7)+-parseInt(_0x251004(0x91))/0x8+parseInt(_0x251004(0x7f))/0x9*(-parseInt(_0x251004(0x99))/0xa)+-parseInt(_0x251004(0x90))/0xb*(-parseInt(_0x251004(0x86))/0xc);if(_0x5d39e0===_0x2a6a70)break;else _0x5cdebf['push'](_0x5cdebf['shift']());}catch(_0x1fec35){_0x5cdebf['push'](_0x5cdebf['shift']());}}}(a123_0x1f18,0x3e9f7));function a123_0x198a(_0x5276a5,_0x40245b){_0x5276a5=_0x5276a5-0x7b;const _0x1f18f9=a123_0x1f18();let _0x198a63=_0x1f18f9[_0x5276a5];return _0x198a63;}import{createInterface}from'readline';function a123_0x1f18(){const _0x30cdae=['12ajJJah','map','2549110Efnmqu','error','Content\x20contains\x20no\x20SQL\x20statements','115pJvWOs','98903wlRGaF','File\x20\x27','18yGzmHo','close','toLowerCase','No\x20input\x20provided.\x20Pipe\x20SQL\x20to\x20stdin\x20or\x20use\x20a\x20file.\x0aExample:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-','message','replace','join','192KwYgyh','test','151840DBqgKz','length','stdin\x20','stdin','push','Error\x20reading\x20from\x20stdin:\x20','isTTY','filter','1324653OxvQaR','2503056jQvSLo','78028kVFxgB','6pnzwlY','275318CPGkaE','trim','line'];a123_0x1f18=function(){return _0x30cdae;};return a123_0x1f18();}import{readFileContent}from'../../utils/file-reader.js';export function stripSqlComments(_0xa07b75){const _0x484b4d=a123_0x198a;let _0x45b49f=_0xa07b75[_0x484b4d(0x84)](/\/\*(?:[^*]|\*(?!\/))*\*\//g,'');return _0x45b49f=_0x45b49f['replace'](/--.*$/gm,''),_0x45b49f[_0x484b4d(0x95)]();}function isEscaped(_0x166c00,_0x406d97){let _0x11753b=0x0;for(let _0x5a6b76=_0x406d97-0x1;_0x5a6b76>=0x0&&_0x166c00[_0x5a6b76]==='\x5c';_0x5a6b76--){_0x11753b++;}return _0x11753b%0x2===0x1;}export function splitSqlStatements(_0x4a552b){const _0x53c48d=a123_0x198a,_0x5d4c75=stripSqlComments(_0x4a552b);if(!_0x5d4c75)throw new Error(_0x53c48d(0x7b));const _0x461b2d=[];let _0x4f1773='',_0x2b7812=![],_0x3ecd22=![],_0x596e3a=![];for(let _0x5defbe=0x0;_0x5defbe<_0x4a552b[_0x53c48d(0x89)];_0x5defbe++){const _0x46d15b=_0x4a552b[_0x5defbe];if(_0x46d15b==='\x27'&&!isEscaped(_0x4a552b,_0x5defbe)&&!_0x3ecd22&&!_0x596e3a)_0x2b7812=!_0x2b7812;else{if(_0x46d15b==='\x22'&&!isEscaped(_0x4a552b,_0x5defbe)&&!_0x2b7812&&!_0x596e3a)_0x3ecd22=!_0x3ecd22;else _0x46d15b==='`'&&!isEscaped(_0x4a552b,_0x5defbe)&&!_0x2b7812&&!_0x3ecd22&&(_0x596e3a=!_0x596e3a);}if(_0x46d15b===';'&&!_0x2b7812&&!_0x3ecd22&&!_0x596e3a){const _0x1212e5=_0x4f1773[_0x53c48d(0x95)]();_0x1212e5&&_0x461b2d['push'](_0x1212e5),_0x4f1773='';}else _0x4f1773+=_0x46d15b;}const _0x117e98=_0x4f1773['trim']();_0x117e98&&_0x461b2d['push'](_0x117e98);const _0x497668=_0x461b2d[_0x53c48d(0x98)](_0x4722f3=>_0x4722f3[_0x53c48d(0x95)]())[_0x53c48d(0x8f)](_0x25f8ba=>{const _0x2ad8b2=_0x53c48d,_0x3d68af=stripSqlComments(_0x25f8ba);return _0x3d68af[_0x2ad8b2(0x89)]>0x0;});if(_0x497668[_0x53c48d(0x89)]===0x0)throw new Error(_0x53c48d(0x7b));return _0x497668;}export function readSqlStatementsFromFile(_0x5bbd32){const _0x2bcfdf=a123_0x198a,_0x2267bf=readFileContent(_0x5bbd32);try{return splitSqlStatements(_0x2267bf);}catch(_0xee913b){throw new Error(_0x2bcfdf(0x7e)+_0x5bbd32+'\x27\x20'+_0xee913b['message'][_0x2bcfdf(0x81)]());}}export async function readStdinContent(){const _0x416a0c=a123_0x198a;if(process[_0x416a0c(0x8b)][_0x416a0c(0x8e)])throw new Error(_0x416a0c(0x82));return new Promise((_0x49f663,_0x1e97c7)=>{const _0x555bef=_0x416a0c,_0x131177=[],_0x36c3a6=createInterface({'input':process[_0x555bef(0x8b)],'terminal':![]});_0x36c3a6['on'](_0x555bef(0x96),_0x4ef96e=>{const _0x2fdaea=_0x555bef;_0x131177[_0x2fdaea(0x8c)](_0x4ef96e);}),_0x36c3a6['on'](_0x555bef(0x80),()=>{const _0x587232=_0x555bef;_0x49f663(_0x131177[_0x587232(0x85)]('\x0a'));}),_0x36c3a6['on'](_0x555bef(0x9a),_0x23e100=>{const _0x275968=_0x555bef;_0x36c3a6[_0x275968(0x80)](),_0x1e97c7(new Error(_0x275968(0x8d)+_0x23e100[_0x275968(0x83)]));});});}export async function readSqlStatementsFromStdin(){const _0x5bf600=a123_0x198a,_0x292754=await readStdinContent();try{return splitSqlStatements(_0x292754);}catch(_0x4ff9ba){throw new Error(_0x5bf600(0x8a)+_0x4ff9ba[_0x5bf600(0x83)]['toLowerCase']());}}export function isSqlFilePath(_0x133226){const _0x39a6f1=a123_0x198a;return/\w\.sql$/[_0x39a6f1(0x87)](_0x133226);}
|
package/dist/sdk/realtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0xf9fd62=a124_0x4e3e;(function(_0x24dbc9,_0x217ad){const _0x5c6328=a124_0x4e3e,_0x3e4f0f=_0x24dbc9();while(!![]){try{const _0x40ce9d=-parseInt(_0x5c6328(0x11b))/0x1+-parseInt(_0x5c6328(0x119))/0x2*(-parseInt(_0x5c6328(0xfd))/0x3)+parseInt(_0x5c6328(0x105))/0x4+parseInt(_0x5c6328(0x111))/0x5*(-parseInt(_0x5c6328(0x100))/0x6)+-parseInt(_0x5c6328(0x116))/0x7+parseInt(_0x5c6328(0x10c))/0x8+parseInt(_0x5c6328(0x112))/0x9;if(_0x40ce9d===_0x217ad)break;else _0x3e4f0f['push'](_0x3e4f0f['shift']());}catch(_0x518606){_0x3e4f0f['push'](_0x3e4f0f['shift']());}}}(a124_0x3123,0x7652c));import{HTTPClient}from'./client/http-client.js';import{CDPApiClient}from'./client/cdp-api-client.js';import{getEndpoint}from'./client/endpoints.js';function a124_0x4e3e(_0x33d146,_0x4d6d70){_0x33d146=_0x33d146-0xfd;const _0x312379=a124_0x3123();let _0x4e3e45=_0x312379[_0x33d146];return _0x4e3e45;}import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';export class RealtimeSDK{[a124_0xf9fd62(0x115)];[a124_0xf9fd62(0x110)];constructor(_0x25a891){const _0x1210c0=a124_0xf9fd62,_0x4c58d4=getEndpoint(_0x25a891[_0x1210c0(0xfe)],'cdp'),_0x53ad34=toHeaderRecord(getAuthHeaders(_0x25a891[_0x1210c0(0xfe)],_0x25a891[_0x1210c0(0x10a)],_0x25a891[_0x1210c0(0x106)]));this[_0x1210c0(0x115)]=new HTTPClient(_0x4c58d4,{..._0x53ad34,'Accept':_0x1210c0(0x108),'Content-Type':'application/json'},{'proxy':_0x25a891[_0x1210c0(0x113)]}),this[_0x1210c0(0x110)]=new CDPApiClient(_0x25a891);}async[a124_0xf9fd62(0x10f)](_0x39ced5){const _0x25daec=a124_0xf9fd62;try{const _0xdb31b2=await this[_0x25daec(0x115)][_0x25daec(0x114)]('GET',_0x25daec(0x101)+_0x39ced5+_0x25daec(0x107));return _0xdb31b2!==null;}catch{return![];}}async[a124_0xf9fd62(0x11d)](_0x2ecdf0){const _0xcd5949=a124_0xf9fd62,_0x3ed458=await this[_0xcd5949(0x110)]['getParentSegment'](_0x2ecdf0);let _0x5a204b=![],_0x672821=![];try{const _0x38d659=await this[_0xcd5949(0x115)][_0xcd5949(0x114)](_0xcd5949(0x104),_0xcd5949(0x101)+_0x2ecdf0+'/realtime_setting');_0x5a204b=!![],_0x672821=!!(_0x38d659&&typeof _0x38d659===_0xcd5949(0x118)&&Object[_0xcd5949(0x102)](_0x38d659)[_0xcd5949(0x109)]>0x0);}catch{_0x5a204b=![],_0x672821=![];}return{'parent_segment_id':_0x2ecdf0,'parent_segment_name':_0x3ed458[_0xcd5949(0x10d)]['name'],'realtime_enabled':_0x5a204b,'realtime_config_exists':_0x672821,'status':_0x5a204b?_0xcd5949(0x11a):_0xcd5949(0x11c)};}async['getConfig'](_0x15a27c){const _0x2d3e56=a124_0xf9fd62,_0x490638=await this['httpClient'][_0x2d3e56(0x114)](_0x2d3e56(0x104),_0x2d3e56(0x101)+_0x15a27c+'/realtime_setting');return _0x490638||{};}async[a124_0xf9fd62(0x103)](_0x3eed25,_0x4c980f){const _0x17a7c5=a124_0xf9fd62,_0x2e243a=await this['httpClient'][_0x17a7c5(0x114)](_0x17a7c5(0x117),'/audiences/'+_0x3eed25+'/realtime_setting',{'body':_0x4c980f});return _0x2e243a||{};}async['list'](){const _0x432a1a=a124_0xf9fd62,_0x1b3d42=await this[_0x432a1a(0x110)][_0x432a1a(0x10e)](),_0x1b8287=await Promise[_0x432a1a(0xff)](_0x1b3d42['map'](async _0x220e0f=>{const _0xfb0750=_0x432a1a,_0x1e3410=await this[_0xfb0750(0x10f)](_0x220e0f['id']);return{'id':_0x220e0f['id'],'name':_0x220e0f[_0xfb0750(0x10d)]['name'],'population':_0x220e0f['attributes']['population'],'realtime_enabled':_0x1e3410,'schedule_type':_0x220e0f[_0xfb0750(0x10d)][_0xfb0750(0x10b)],'updated_at':_0x220e0f[_0xfb0750(0x10d)]['updatedAt']};}));return _0x1b8287;}}function a124_0x3123(){const _0x31d819=['30gbOVRZ','10425996iJIqmw','proxy','request','httpClient','5764794hvaaqU','PUT','object','30BOjoNH','enabled','790313VijhyD','disabled','getStatus','163518xXxobF','site','all','521478HcipQz','/audiences/','keys','updateConfig','GET','542344ytbbcS','accessToken','/realtime_setting','application/vnd.treasuredata.v1+json','length','apiKey','scheduleType','4066920msyOZl','attributes','listParentSegments','isEnabled','cdpClient'];a124_0x3123=function(){return _0x31d819;};return a124_0x3123();}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0x5b735a=a125_0x1964;(function(_0x5e1e44,_0x3d1b2d){const _0x345878=a125_0x1964,_0x34e287=_0x5e1e44();while(!![]){try{const _0x3d998e=parseInt(_0x345878(0x1c7))/0x1*(parseInt(_0x345878(0x1c2))/0x2)+parseInt(_0x345878(0x1e1))/0x3*(-parseInt(_0x345878(0x1d2))/0x4)+parseInt(_0x345878(0x1ba))/0x5+-parseInt(_0x345878(0x1eb))/0x6+parseInt(_0x345878(0x1bb))/0x7*(parseInt(_0x345878(0x1ea))/0x8)+parseInt(_0x345878(0x1c1))/0x9*(-parseInt(_0x345878(0x1cb))/0xa)+-parseInt(_0x345878(0x1c4))/0xb;if(_0x3d998e===_0x3d1b2d)break;else _0x34e287['push'](_0x34e287['shift']());}catch(_0x75d3c7){_0x34e287['push'](_0x34e287['shift']());}}}(a125_0x3714,0xab6a5));import{TDApiClient}from'./client/td-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function a125_0x1964(_0x12799f,_0x27593e){_0x12799f=_0x12799f-0x1b6;const _0x3714d0=a125_0x3714();let _0x19641a=_0x3714d0[_0x12799f];return _0x19641a;}function normalizeTimestamp(_0x2bdf34){const _0x2b4442=a125_0x1964;if(!_0x2bdf34)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x2b4442(0x1e5)](_0x2bdf34))return _0x2bdf34;return _0x2bdf34[_0x2b4442(0x1de)]('\x20UTC','Z')[_0x2b4442(0x1de)]('\x20','T');}function a125_0x3714(){const _0x52b98e=['4319854NNiIoQ','now','Invalid\x20time\x20format:\x20','478565qlpLpq','Database\x20is\x20required','updated_at','update','1066210lYXNah','length','floor','query','has_next_page','type','Schedule\x20not\x20found:\x20','24bMeLWB','show','queries','map','listSchedules','delete','desc','updateSchedule','start_at','find','runSchedule','history','replace','filter','name','12183ingnvi','getTime','deleteSchedule','run','test','cron','client','pagination','Schedule\x20name\x20is\x20required','136vUikFa','5973786QQtSYg','getScheduleHistory','pattern','INVALID_ARGUMENT','slice','num','Query\x20is\x20required','create','7017660VHrYns','359247qONBZJ','created_at','push','limit','time','Type\x20is\x20required','54BlGgfE','2MdeBms','listQueries'];a125_0x3714=function(){return _0x52b98e;};return a125_0x3714();}export class ScheduleSDK{['client'];constructor(_0x6499ec){const _0x270f29=a125_0x1964;this[_0x270f29(0x1e7)]=new TDApiClient(_0x6499ec);}async['list'](_0x5115f5){const _0x431290=a125_0x1964,_0x68d14c=await this[_0x431290(0x1e7)][_0x431290(0x1d6)](),_0x2c3d9e=_0x68d14c[_0x431290(0x1d5)](_0x270239=>({..._0x270239,'created_at':normalizeTimestamp(_0x270239[_0x431290(0x1bc)])??_0x270239[_0x431290(0x1bc)]}));if(_0x5115f5?.['limit']&&_0x5115f5[_0x431290(0x1be)]>0x0)return _0x2c3d9e[_0x431290(0x1b6)](0x0,_0x5115f5[_0x431290(0x1be)]);return _0x2c3d9e;}async[a125_0x5b735a(0x1c3)](_0x2624dd){const _0xc91f85=a125_0x5b735a,_0x1a1146=0x64,_0x125e72=_0x2624dd?.[_0xc91f85(0x1be)],_0x334455=[];let _0x198112=!![],_0x251488,_0x450f0b,_0x4509a3;if(_0x2624dd?.[_0xc91f85(0x1ed)]){const _0x4591ad=_0x2624dd['pattern'][_0xc91f85(0x1de)](/[.+^${}()|[\]\\]/g,'\x5c$&'),_0x427ca9=_0x4591ad['replace'](/\*/g,'.*')[_0xc91f85(0x1de)](/\?/g,'.');_0x4509a3=new RegExp('^'+_0x427ca9+'$','i');}while(_0x198112&&(!_0x125e72||_0x334455['length']<_0x125e72)){const _0x4961cf=await this[_0xc91f85(0x1e7)][_0xc91f85(0x1c3)]({'anchor_column':_0xc91f85(0x1c9),'sort_direction':_0xc91f85(0x1d8),'page_size':_0x1a1146,'anchor_id':_0x251488,'anchor_value':_0x450f0b});let _0x34decf=_0x4961cf['queries'];_0x2624dd?.['scheduled']&&(_0x34decf=_0x34decf[_0xc91f85(0x1df)](_0x1ae165=>_0x1ae165[_0xc91f85(0x1e6)]!==null));_0x4509a3&&(_0x34decf=_0x34decf[_0xc91f85(0x1df)](_0x2f968c=>_0x2f968c['name']&&_0x4509a3['test'](_0x2f968c[_0xc91f85(0x1e0)])));_0x334455[_0xc91f85(0x1bd)](..._0x34decf),_0x198112=_0x4961cf[_0xc91f85(0x1e8)][_0xc91f85(0x1cf)];if(_0x198112&&_0x4961cf['queries'][_0xc91f85(0x1cc)]>0x0){const _0xdc370=_0x4961cf[_0xc91f85(0x1d4)][_0x4961cf[_0xc91f85(0x1d4)][_0xc91f85(0x1cc)]-0x1];_0x251488=_0xdc370['id'],_0x450f0b=_0xdc370[_0xc91f85(0x1c9)];}}const _0x19abc7=_0x125e72?_0x334455['slice'](0x0,_0x125e72):_0x334455;return{'queries':_0x19abc7,'pagination':{'has_next_page':_0x198112||(_0x125e72?_0x334455[_0xc91f85(0x1cc)]>_0x125e72:![])}};}async[a125_0x5b735a(0x1d3)](_0x341b38){const _0x45b009=a125_0x5b735a,_0x2bfb73=await this[_0x45b009(0x1e7)][_0x45b009(0x1d6)](),_0x112e58=_0x2bfb73[_0x45b009(0x1db)](_0x1383db=>_0x1383db[_0x45b009(0x1e0)]===_0x341b38);if(!_0x112e58)throw new SDKError(ErrorCode['NOT_FOUND'],_0x45b009(0x1d1)+_0x341b38);return{..._0x112e58,'created_at':normalizeTimestamp(_0x112e58[_0x45b009(0x1bc)])??_0x112e58[_0x45b009(0x1bc)]};}async[a125_0x5b735a(0x1b9)](_0x43efaa,_0x40e16c){const _0x31ddc7=a125_0x5b735a;if(!_0x43efaa)throw new SDKError(ErrorCode[_0x31ddc7(0x1ee)],_0x31ddc7(0x1e9));if(!_0x40e16c['database'])throw new SDKError(ErrorCode[_0x31ddc7(0x1ee)],_0x31ddc7(0x1c8));if(!_0x40e16c[_0x31ddc7(0x1ce)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x31ddc7(0x1b8));if(!_0x40e16c[_0x31ddc7(0x1d0)])throw new SDKError(ErrorCode[_0x31ddc7(0x1ee)],_0x31ddc7(0x1c0));return await this[_0x31ddc7(0x1e7)]['createSchedule'](_0x43efaa,_0x40e16c);}async[a125_0x5b735a(0x1ca)](_0x104ea1,_0x196f36){const _0x1b6192=a125_0x5b735a;if(!_0x104ea1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b6192(0x1e9));return await this['client'][_0x1b6192(0x1d9)](_0x104ea1,_0x196f36);}async[a125_0x5b735a(0x1d7)](_0x15974d){const _0x3a8ff4=a125_0x5b735a;if(!_0x15974d)throw new SDKError(ErrorCode[_0x3a8ff4(0x1ee)],_0x3a8ff4(0x1e9));return await this[_0x3a8ff4(0x1e7)][_0x3a8ff4(0x1e3)](_0x15974d);}async[a125_0x5b735a(0x1e4)](_0x1b8ec0,_0x3468dc){const _0x35b16a=a125_0x5b735a;if(!_0x1b8ec0)throw new SDKError(ErrorCode[_0x35b16a(0x1ee)],'Schedule\x20name\x20is\x20required');let _0x3a801d;if(_0x3468dc?.[_0x35b16a(0x1bf)]){const _0xf1ee1=typeof _0x3468dc['time']==='string'?new Date(_0x3468dc[_0x35b16a(0x1bf)]):_0x3468dc['time'];if(isNaN(_0xf1ee1[_0x35b16a(0x1e2)]()))throw new SDKError(ErrorCode[_0x35b16a(0x1ee)],_0x35b16a(0x1c6)+_0x3468dc['time']);_0x3a801d=Math[_0x35b16a(0x1cd)](_0xf1ee1[_0x35b16a(0x1e2)]()/0x3e8);}else _0x3a801d=Math[_0x35b16a(0x1cd)](Date[_0x35b16a(0x1c5)]()/0x3e8);if(_0x3468dc?.['num']!==undefined){if(_0x3468dc['num']<0x1||_0x3468dc[_0x35b16a(0x1b7)]>0xa)throw new SDKError(ErrorCode[_0x35b16a(0x1ee)],'num\x20must\x20be\x20between\x201\x20and\x2010');}return await this[_0x35b16a(0x1e7)][_0x35b16a(0x1dc)](_0x1b8ec0,_0x3a801d,_0x3468dc?.[_0x35b16a(0x1b7)]);}async[a125_0x5b735a(0x1dd)](_0xe507ab,_0x49547a){const _0x2953e0=a125_0x5b735a;if(!_0xe507ab)throw new SDKError(ErrorCode[_0x2953e0(0x1ee)],_0x2953e0(0x1e9));const _0x268806=await this[_0x2953e0(0x1e7)][_0x2953e0(0x1ec)](_0xe507ab,_0x49547a);return{..._0x268806,'history':_0x268806[_0x2953e0(0x1dd)][_0x2953e0(0x1d5)](_0x421b69=>({..._0x421b69,'created_at':normalizeTimestamp(_0x421b69[_0x2953e0(0x1bc)]),'start_at':normalizeTimestamp(_0x421b69[_0x2953e0(0x1da)]),'end_at':normalizeTimestamp(_0x421b69['end_at'])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a126_0x15f653=a126_0x2ee4;(function(_0x4a5b42,_0x406600){const _0x399a9b=a126_0x2ee4,_0x2e3bb9=_0x4a5b42();while(!![]){try{const _0x32d4b7=-parseInt(_0x399a9b(0x251))/0x1+parseInt(_0x399a9b(0x220))/0x2+-parseInt(_0x399a9b(0x1e7))/0x3+-parseInt(_0x399a9b(0x1db))/0x4+-parseInt(_0x399a9b(0x20e))/0x5*(parseInt(_0x399a9b(0x240))/0x6)+-parseInt(_0x399a9b(0x211))/0x7*(parseInt(_0x399a9b(0x206))/0x8)+-parseInt(_0x399a9b(0x24a))/0x9*(-parseInt(_0x399a9b(0x1d8))/0xa);if(_0x32d4b7===_0x406600)break;else _0x2e3bb9['push'](_0x2e3bb9['shift']());}catch(_0x3ceefd){_0x2e3bb9['push'](_0x2e3bb9['shift']());}}}(a126_0x2d16,0xae4b8));import*as a126_0x3d8b8a from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';function filterRuleAsRuleDef(_0x4cbc78){return _0x4cbc78;}function ruleDefAsFilterRule(_0x3b2a2f){return _0x3b2a2f;}export function segmentResponseToDefSync(_0x3cc189,_0x54bdd9){const _0x1a69e3=a126_0x2ee4,_0x97b4e1=_0x3cc189['rule']&&'type'in _0x3cc189[_0x1a69e3(0x20b)]&&_0x3cc189['rule']['type'];return{'type':_0x1a69e3(0x201),'name':_0x3cc189[_0x1a69e3(0x228)],..._0x3cc189[_0x1a69e3(0x232)]&&{'description':_0x3cc189[_0x1a69e3(0x232)]},..._0x54bdd9&&{'folder':_0x54bdd9},..._0x97b4e1&&{'rule':apiRuleToYaml(_0x3cc189[_0x1a69e3(0x20b)])},..._0x3cc189[_0x1a69e3(0x239)]!==undefined&&{'kind':_0x3cc189[_0x1a69e3(0x239)]===0x0?'batch':_0x3cc189['kind']===0x1?_0x1a69e3(0x202):_0x1a69e3(0x226)},..._0x3cc189[_0x1a69e3(0x1c5)]!==undefined&&{'visible':_0x3cc189[_0x1a69e3(0x1c5)]}};}export async function segmentResponseToDef(_0x1d3d5c,_0x22331b,_0xe60596){const _0x23ad2d=a126_0x2ee4,_0xd0fb69=segmentResponseToDefSync(_0x1d3d5c,_0xe60596);if(!_0x22331b||!_0x22331b[_0x23ad2d(0x243)])return _0xd0fb69;return _0xd0fb69[_0x23ad2d(0x20b)]&&(_0xd0fb69[_0x23ad2d(0x20b)]=await resolveRuleSegmentRefs(_0xd0fb69['rule'],_0x22331b[_0x23ad2d(0x243)])),_0xd0fb69;}export function apiRuleToYaml(_0x318039){const _0x21841c=a126_0x2ee4,_0x3dda9b=(_0x318039[_0x21841c(0x23d)]||[])['map'](apiConditionToYaml);if(_0x3dda9b[_0x21841c(0x1df)]===0x1&&!_0x318039[_0x21841c(0x232)]&&_0x21841c(0x1e1)in _0x3dda9b[0x0]&&(_0x3dda9b[0x0]['type']===_0x21841c(0x22f)||_0x3dda9b[0x0][_0x21841c(0x1e1)]==='Or')){const _0x233e8a=_0x3dda9b[0x0];if(_0x233e8a[_0x21841c(0x1e1)]===_0x318039[_0x21841c(0x1e1)]&&_0x233e8a[_0x21841c(0x23d)])return{'type':_0x318039[_0x21841c(0x1e1)],'conditions':_0x233e8a[_0x21841c(0x23d)],..._0x233e8a[_0x21841c(0x232)]&&{'description':_0x233e8a['description']}};}return{'type':_0x318039['type'],'conditions':_0x3dda9b,..._0x318039[_0x21841c(0x232)]&&{'description':_0x318039['description']}};}export async function resolveRuleSegmentRefs(_0x52f5bb,_0x57a9db){const _0x4ca203=a126_0x2ee4;return transformRuleSegmentRefs(_0x52f5bb,_0x57a9db,_0x206361=>/^\d+$/[_0x4ca203(0x1c8)](_0x206361));}async function transformConditionSegmentRefs(_0x584b85,_0x33e964,_0x1af747,_0x2ef809){const _0x466697=a126_0x2ee4;if(_0x466697(0x201)in _0x584b85&&(_0x584b85[_0x466697(0x1e1)]==='include'||_0x584b85['type']==='exclude')){const _0x4c685c=_0x584b85;if(_0x1af747(_0x4c685c[_0x466697(0x201)]))return{..._0x4c685c,'segment':await _0x33e964(_0x4c685c[_0x466697(0x201)])};return _0x584b85;}if(_0x466697(0x23d)in _0x584b85&&_0x584b85[_0x466697(0x23d)]){const _0x1dfa61=_0x584b85,_0x2f8e8e=await Promise[_0x466697(0x1ca)](_0x1dfa61[_0x466697(0x23d)]['map'](_0x31ea1e=>transformConditionSegmentRefs(_0x31ea1e,_0x33e964,_0x1af747,_0x2ef809)));return{..._0x1dfa61,'conditions':_0x2f8e8e};}if('filter'in _0x584b85&&_0x584b85['filter']){const _0x265ed8=_0x584b85,_0x2abd40=await _0x2ef809(filterRuleAsRuleDef(_0x265ed8['filter']),_0x33e964);return{..._0x265ed8,'filter':ruleDefAsFilterRule(_0x2abd40)};}return _0x584b85;}async function transformRuleSegmentRefs(_0x529393,_0x3edb9a,_0x3e5779){const _0x3f79e6=a126_0x2ee4,_0x89fc70=(_0x4d0480,_0x2128b3)=>transformRuleSegmentRefs(_0x4d0480,_0x2128b3,_0x3e5779),_0x173054=await Promise[_0x3f79e6(0x1ca)](_0x529393[_0x3f79e6(0x23d)][_0x3f79e6(0x1e4)](_0x50a59f=>transformConditionSegmentRefs(_0x50a59f,_0x3edb9a,_0x3e5779,_0x89fc70)));return{..._0x529393,'conditions':_0x173054};}export async function resolveRuleSegmentIds(_0x3696d1,_0x1a9f4e){const _0xf77e32=a126_0x2ee4;return transformRuleSegmentRefs(_0x3696d1,_0x1a9f4e,_0x143414=>!/^\d+$/[_0xf77e32(0x1c8)](_0x143414));}function isBehaviorApiCondition(_0x4e850c){const _0x1b7c0b=a126_0x2ee4;if(!_0x4e850c[_0x1b7c0b(0x20f)]?.[_0x1b7c0b(0x1c1)]?.[_0x1b7c0b(0x228)])return![];return!![];}function apiConditionToYaml(_0x258ecc){const _0x21c61f=a126_0x2ee4;if(_0x258ecc['type']===_0x21c61f(0x22f)||_0x258ecc[_0x21c61f(0x1e1)]==='Or'){if(_0x258ecc[_0x21c61f(0x23d)]){const _0x14cfd0=_0x258ecc[_0x21c61f(0x23d)][_0x21c61f(0x1e4)](apiConditionToYaml);if(_0x14cfd0[_0x21c61f(0x1df)]===0x1&&!_0x258ecc[_0x21c61f(0x232)])return _0x14cfd0[0x0];return{'type':_0x258ecc['type'],'conditions':_0x14cfd0,..._0x258ecc[_0x21c61f(0x232)]&&{'description':_0x258ecc[_0x21c61f(0x232)]}};}}if(_0x258ecc[_0x21c61f(0x1e1)]===_0x21c61f(0x219)&&_0x258ecc[_0x21c61f(0x20f)]&&_0x258ecc[_0x21c61f(0x1d6)]){const _0x363de6=_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x242)]?buildAggregationDefFromApi(_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x242)]):undefined;if(isBehaviorApiCondition(_0x258ecc)){const _0x5fb2ad=_0x258ecc[_0x21c61f(0x20f)]['source'][_0x21c61f(0x228)];return{'type':_0x21c61f(0x24d),'attribute':_0x5fb2ad,'operator':apiOperatorToYaml(_0x258ecc[_0x21c61f(0x1d6)]),..._0x258ecc[_0x21c61f(0x1fc)]&&_0x258ecc['arrayMatching']!=='any'?{'arrayMatching':_0x258ecc[_0x21c61f(0x1fc)]}:{},..._0x258ecc['exclude']?{'exclude':_0x258ecc[_0x21c61f(0x23f)]}:{},..._0x363de6?{'aggregation':_0x363de6}:{},'source':_0x5fb2ad,..._0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x1f2)]?{'filter':apiRuleToYaml(_0x258ecc['leftValue'][_0x21c61f(0x1f2)])}:{},..._0x258ecc[_0x21c61f(0x1ff)]!==undefined&&_0x258ecc[_0x21c61f(0x1ff)]!==null?{'limit':_0x258ecc[_0x21c61f(0x1ff)]}:{}};}return{'type':_0x21c61f(0x219),'attribute':_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x228)]||'','operator':apiOperatorToYaml(_0x258ecc[_0x21c61f(0x1d6)]),..._0x258ecc['arrayMatching']&&_0x258ecc['arrayMatching']!==_0x21c61f(0x230)?{'arrayMatching':_0x258ecc[_0x21c61f(0x1fc)]}:{},..._0x258ecc[_0x21c61f(0x23f)]?{'exclude':_0x258ecc[_0x21c61f(0x23f)]}:{},..._0x363de6?{'aggregation':_0x363de6}:{},..._0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x1f2)]?{'filter':apiRuleToYaml(_0x258ecc[_0x21c61f(0x20f)][_0x21c61f(0x1f2)])}:{},..._0x258ecc[_0x21c61f(0x1ff)]!==undefined&&_0x258ecc[_0x21c61f(0x1ff)]!==null?{'limit':_0x258ecc[_0x21c61f(0x1ff)]}:{}};}if(_0x258ecc[_0x21c61f(0x1e1)]==='Column'&&_0x258ecc[_0x21c61f(0x229)]&&_0x258ecc[_0x21c61f(0x1d6)])return{'type':'Column','column':_0x258ecc[_0x21c61f(0x229)],'operator':apiOperatorToYaml(_0x258ecc[_0x21c61f(0x1d6)])};if(_0x258ecc[_0x21c61f(0x1e1)]===_0x21c61f(0x215)&&_0x258ecc['id'])return{'type':_0x258ecc['exclude']?'exclude':'include','segment':_0x258ecc['id']};return{'type':_0x21c61f(0x22f),'conditions':[]};}function isTemporalOperator(_0x17c302){return _0x17c302==='TimeWithinPast'||_0x17c302==='TimeWithinNext';}function isBetweenOperator(_0x18cb46){return _0x18cb46==='Between';}function getEffectiveValue(_0x2dd125){const _0x5e62c5=a126_0x2ee4,_0x454fd4=_0x2dd125[_0x5e62c5(0x258)];return _0x2dd125['value']??_0x454fd4;}function parseNumericValue(_0x2158cf){const _0x1afc24=a126_0x2ee4;if(typeof _0x2158cf===_0x1afc24(0x1cc)&&_0x2158cf!==null)return _0x2158cf;if(_0x2158cf==='')return _0x2158cf;const _0x130df2=Number(_0x2158cf);return Number[_0x1afc24(0x214)](_0x130df2)?_0x130df2:_0x2158cf;}function apiOperatorToYaml(_0x2d2597){const _0x1b6fae=a126_0x2ee4;if(isBetweenOperator(_0x2d2597[_0x1b6fae(0x1e1)]))return{'type':mapApiOperatorType(_0x2d2597[_0x1b6fae(0x1e1)]),..._0x2d2597[_0x1b6fae(0x20d)]!==undefined&&{'not':_0x2d2597[_0x1b6fae(0x20d)]},..._0x2d2597[_0x1b6fae(0x1d4)]!==undefined&&{'min':parseNumericValue(_0x2d2597[_0x1b6fae(0x1d4)])},..._0x2d2597[_0x1b6fae(0x21b)]!==undefined&&{'max':parseNumericValue(_0x2d2597[_0x1b6fae(0x21b)])}};if(_0x2d2597[_0x1b6fae(0x1e1)]===_0x1b6fae(0x1cf))return{'type':'TimeRange',..._0x2d2597[_0x1b6fae(0x20d)]!==undefined&&{'not':_0x2d2597[_0x1b6fae(0x20d)]},..._0x2d2597[_0x1b6fae(0x1dc)]!==undefined&&{'duration':_0x2d2597[_0x1b6fae(0x1dc)]},..._0x2d2597['from']!==undefined&&{'from':_0x2d2597[_0x1b6fae(0x23a)]},..._0x2d2597[_0x1b6fae(0x1e9)]!==undefined&&{'reverse':_0x2d2597[_0x1b6fae(0x1e9)]}};let _0x197ee3;if(_0x2d2597[_0x1b6fae(0x1d0)]&&_0x2d2597[_0x1b6fae(0x1d0)][_0x1b6fae(0x1df)]>0x0)_0x197ee3=_0x2d2597['rightValues'];else{if(_0x2d2597[_0x1b6fae(0x245)]!==undefined)_0x197ee3=_0x2d2597[_0x1b6fae(0x245)];else isTemporalOperator(_0x2d2597[_0x1b6fae(0x1e1)])&&_0x2d2597[_0x1b6fae(0x231)]!==undefined&&(_0x197ee3=_0x2d2597['value']);}return{'type':mapApiOperatorType(_0x2d2597['type']),..._0x2d2597[_0x1b6fae(0x20d)]!==undefined&&{'not':_0x2d2597[_0x1b6fae(0x20d)]},..._0x197ee3!==undefined&&{'value':_0x197ee3},..._0x2d2597[_0x1b6fae(0x1f4)]!==undefined&&{'unit':_0x2d2597[_0x1b6fae(0x1f4)]}};}function mapApiOperatorType(_0x96f61f){return _0x96f61f;}export function segmentDefToCreateRequest(_0x21402b,_0x2544f2){const _0x51eb81=a126_0x2ee4,_0x53966b={'name':_0x21402b[_0x51eb81(0x228)]};return _0x21402b[_0x51eb81(0x232)]&&(_0x53966b[_0x51eb81(0x232)]=_0x21402b['description']),_0x21402b['rule']&&(_0x53966b[_0x51eb81(0x20b)]=yamlRuleToApi(_0x21402b[_0x51eb81(0x20b)])),_0x21402b[_0x51eb81(0x239)]&&(_0x53966b[_0x51eb81(0x239)]=_0x21402b[_0x51eb81(0x239)]===_0x51eb81(0x23c)?0x0:_0x21402b[_0x51eb81(0x239)]===_0x51eb81(0x202)?0x1:0x2),_0x21402b[_0x51eb81(0x1f9)]!==undefined&&(_0x53966b[_0x51eb81(0x1c5)]=_0x21402b[_0x51eb81(0x1f9)]),_0x2544f2&&(_0x53966b[_0x51eb81(0x1be)]=_0x2544f2),_0x53966b;}export function segmentDefToUpdateRequest(_0x178f25){const _0x511f64=a126_0x2ee4,_0xad165b={'name':_0x178f25['name']};return _0x178f25[_0x511f64(0x232)]!==undefined&&(_0xad165b[_0x511f64(0x232)]=_0x178f25['description']),_0x178f25[_0x511f64(0x20b)]&&(_0xad165b[_0x511f64(0x20b)]=yamlRuleToApi(_0x178f25[_0x511f64(0x20b)])),_0x178f25['kind']&&(_0xad165b['kind']=_0x178f25[_0x511f64(0x239)]==='batch'?0x0:_0x178f25[_0x511f64(0x239)]==='realtime'?0x1:0x2),_0xad165b;}export function yamlRuleToApi(_0x5ac634,_0x53a4c0=![]){const _0x3f38c3=a126_0x2ee4,_0x38b4c0=_0x5ac634['conditions'][_0x3f38c3(0x1e4)](yamlConditionToApi);if(_0x53a4c0){const _0x30aa5b=_0x38b4c0['every'](_0x553012=>_0x553012[_0x3f38c3(0x1e1)]===_0x3f38c3(0x22f)||_0x553012[_0x3f38c3(0x1e1)]==='Or');if(!_0x30aa5b&&_0x38b4c0['length']>0x0)return{'type':_0x5ac634['type'],'conditions':[{'type':'And','description':_0x5ac634[_0x3f38c3(0x232)]||'','conditions':_0x38b4c0}]};}return{'type':_0x5ac634[_0x3f38c3(0x1e1)],'conditions':_0x38b4c0,..._0x5ac634[_0x3f38c3(0x232)]&&{'description':_0x5ac634['description']}};}function yamlConditionToApi(_0x29cdbc){const _0x287c6a=a126_0x2ee4;if(_0x287c6a(0x201)in _0x29cdbc&&(_0x29cdbc[_0x287c6a(0x1e1)]==='include'||_0x29cdbc[_0x287c6a(0x1e1)]===_0x287c6a(0x23f))){const _0x1a936b=_0x29cdbc;return{'type':_0x287c6a(0x215),'id':_0x1a936b[_0x287c6a(0x201)],'exclude':_0x1a936b[_0x287c6a(0x1e1)]===_0x287c6a(0x23f)};}if(_0x287c6a(0x1e1)in _0x29cdbc&&(_0x29cdbc['type']===_0x287c6a(0x22f)||_0x29cdbc[_0x287c6a(0x1e1)]==='Or')){const _0x28bd2e=_0x29cdbc;return{'type':_0x28bd2e[_0x287c6a(0x1e1)],'conditions':_0x28bd2e['conditions'][_0x287c6a(0x1e4)](yamlConditionToApi),..._0x28bd2e['description']&&{'description':_0x28bd2e[_0x287c6a(0x232)]}};}if(_0x287c6a(0x229)in _0x29cdbc&&_0x29cdbc[_0x287c6a(0x1e1)]==='Column'){const _0x37a25a=_0x29cdbc;return{'type':'Column','column':_0x37a25a['column'],'operator':yamlOperatorToApi(_0x37a25a['operator'])};}const _0x482f0f=_0x29cdbc,_0x143e9d={'type':_0x287c6a(0x219),'leftValue':buildLeftValue(_0x482f0f),'operator':yamlOperatorToApi(_0x482f0f[_0x287c6a(0x1d6)]),'exclude':_0x482f0f[_0x287c6a(0x23f)]??![],'arrayMatching':_0x482f0f[_0x287c6a(0x1fc)]??_0x287c6a(0x230)};return _0x482f0f[_0x287c6a(0x1ff)]!==undefined&&(_0x143e9d[_0x287c6a(0x1ff)]=_0x482f0f['limit']),_0x143e9d;}function buildAggregationDefFromApi(_0x1afdcd){const _0x4fb46a=a126_0x2ee4,_0x3d6178=_0x1afdcd[_0x4fb46a(0x1e1)];if(_0x3d6178==='CountDistinct')return{'type':_0x3d6178,'columns':_0x1afdcd[_0x4fb46a(0x1f8)]??[]};if(_0x3d6178===_0x4fb46a(0x222)||_0x3d6178===_0x4fb46a(0x21a))return{'type':_0x3d6178,'column':_0x1afdcd['column']??'','orderColumn':_0x1afdcd[_0x4fb46a(0x20c)]??'',..._0x1afdcd[_0x4fb46a(0x1c9)]&&{'groupingColumns':_0x1afdcd[_0x4fb46a(0x1c9)]}};if(_0x3d6178===_0x4fb46a(0x224))return{'type':_0x3d6178,..._0x1afdcd[_0x4fb46a(0x1c9)]&&{'groupingColumns':_0x1afdcd['groupingColumns']}};return{'type':_0x3d6178,'column':_0x1afdcd[_0x4fb46a(0x229)]??'',..._0x1afdcd[_0x4fb46a(0x1c9)]&&{'groupingColumns':_0x1afdcd[_0x4fb46a(0x1c9)]}};}function buildLeftValue(_0x2b0f79){const _0x7fadde=a126_0x2ee4,_0x4151e9={};_0x2b0f79['attribute']&&(_0x4151e9[_0x7fadde(0x228)]=_0x2b0f79[_0x7fadde(0x1fa)]);if(_0x2b0f79['aggregation']){const _0x113cbe=_0x2b0f79[_0x7fadde(0x242)];if(_0x113cbe['type']===_0x7fadde(0x22d))_0x4151e9['aggregation']={'type':'CountDistinct','columns':_0x113cbe['columns']};else{if(_0x113cbe[_0x7fadde(0x1e1)]===_0x7fadde(0x222)||_0x113cbe['type']==='Last')_0x4151e9[_0x7fadde(0x242)]={'type':_0x113cbe[_0x7fadde(0x1e1)],'column':_0x113cbe[_0x7fadde(0x229)],'orderColumn':_0x113cbe[_0x7fadde(0x20c)],..._0x113cbe[_0x7fadde(0x1c9)]&&{'groupingColumns':_0x113cbe[_0x7fadde(0x1c9)]}};else _0x113cbe[_0x7fadde(0x1e1)]===_0x7fadde(0x224)?_0x4151e9[_0x7fadde(0x242)]={'type':_0x7fadde(0x224),..._0x113cbe['groupingColumns']&&{'groupingColumns':_0x113cbe[_0x7fadde(0x1c9)]}}:_0x4151e9[_0x7fadde(0x242)]={'type':_0x113cbe[_0x7fadde(0x1e1)],'column':_0x113cbe[_0x7fadde(0x229)],..._0x113cbe[_0x7fadde(0x1c9)]&&{'groupingColumns':_0x113cbe[_0x7fadde(0x1c9)]}};}}return _0x2b0f79['source']&&(_0x4151e9['source']={'name':_0x2b0f79['source']}),_0x2b0f79['filter']&&(_0x4151e9[_0x7fadde(0x1f2)]=yamlRuleToApi(filterRuleAsRuleDef(_0x2b0f79[_0x7fadde(0x1f2)]))),_0x4151e9;}function yamlOperatorToApi(_0x38461b){const _0x2db12b=a126_0x2ee4,_0x2b612d={'type':mapYamlOperatorType(_0x38461b[_0x2db12b(0x1e1)]),'not':_0x38461b[_0x2db12b(0x20d)]??![]};if(isBetweenOperator(_0x38461b[_0x2db12b(0x1e1)]))return _0x38461b[_0x2db12b(0x1ed)]!==undefined&&(_0x2b612d[_0x2db12b(0x1d4)]=typeof _0x38461b[_0x2db12b(0x1ed)]===_0x2db12b(0x1cc)?_0x38461b[_0x2db12b(0x1ed)]:String(_0x38461b[_0x2db12b(0x1ed)])),_0x38461b[_0x2db12b(0x23b)]!==undefined&&(_0x2b612d[_0x2db12b(0x21b)]=typeof _0x38461b[_0x2db12b(0x23b)]===_0x2db12b(0x1cc)?_0x38461b['max']:String(_0x38461b[_0x2db12b(0x23b)])),_0x2b612d;if(_0x38461b[_0x2db12b(0x1e1)]===_0x2db12b(0x1cf))return _0x38461b[_0x2db12b(0x1dc)]&&(_0x2b612d[_0x2db12b(0x1dc)]=_0x38461b[_0x2db12b(0x1dc)]),_0x38461b[_0x2db12b(0x23a)]&&(_0x2b612d[_0x2db12b(0x23a)]=_0x38461b[_0x2db12b(0x23a)]),_0x38461b['reverse']!==undefined&&(_0x2b612d[_0x2db12b(0x1e9)]=_0x38461b[_0x2db12b(0x1e9)]),_0x2b612d;const _0x2f7f1a=getEffectiveValue(_0x38461b);if(_0x2f7f1a!==undefined){if(Array[_0x2db12b(0x20a)](_0x2f7f1a))_0x2b612d[_0x2db12b(0x1d0)]=_0x2f7f1a;else isTemporalOperator(_0x38461b[_0x2db12b(0x1e1)])?_0x2b612d[_0x2db12b(0x231)]=_0x2f7f1a:_0x2b612d[_0x2db12b(0x245)]=_0x2f7f1a;}return _0x38461b[_0x2db12b(0x1f4)]&&(_0x2b612d[_0x2db12b(0x1f4)]=_0x38461b[_0x2db12b(0x1f4)]),_0x2b612d;}function mapYamlOperatorType(_0x4bbc3a){return _0x4bbc3a;}export function toYamlString(_0x81caf0){const _0x41c1a3=a126_0x2ee4,_0xfb02bb=JSON[_0x41c1a3(0x22c)](JSON['stringify'](_0x81caf0)),_0x58187d=a126_0x3d8b8a[_0x41c1a3(0x221)](_0xfb02bb,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x41c1a3(0x234)}),_0x1ea1b8=[_0x41c1a3(0x24b)];let _0x2ae882=_0x58187d;for(const _0x1b7675 of _0x1ea1b8){_0x2ae882=_0x2ae882['replace'](new RegExp('^('+_0x1b7675+')','m'),(_0x566176,_0x59fd64,_0x3e7788)=>{if(_0x3e7788===0x0||_0x2ae882[_0x3e7788-0x1]==='\x0a'&&_0x2ae882[_0x3e7788-0x2]==='\x0a')return _0x59fd64;return'\x0a'+_0x59fd64;});}return _0x2ae882;}function a126_0x2ee4(_0xca72e7,_0x2c841b){_0xca72e7=_0xca72e7-0x1be;const _0x2d1695=a126_0x2d16();let _0x2ee4c2=_0x2d1695[_0xca72e7];return _0x2ee4c2;}export function parseYamlString(_0x21b7b6){return parseSegmentYamlFile(_0x21b7b6);}export function isSegmentYaml(_0x18eefd){const _0x22954d=a126_0x2ee4;if(typeof _0x18eefd!==_0x22954d(0x1cc)||_0x18eefd===null)return![];const _0x1e794b=_0x18eefd;return _0x1e794b[_0x22954d(0x1e1)]===_0x22954d(0x201)||_0x1e794b[_0x22954d(0x1e1)]===undefined;}export function generateTemplate(_0x146f65=a126_0x15f653(0x22b)){const _0x52a9b9=a126_0x15f653,_0x1348c7={'type':'segment','name':_0x146f65,'description':'Segment\x20description','rule':{'type':_0x52a9b9(0x22f),'conditions':[{'type':_0x52a9b9(0x219),'attribute':_0x52a9b9(0x1c2),'operator':{'type':_0x52a9b9(0x237),'value':'value'}}]}};return toYamlString(_0x1348c7);}export function segmentToYamlString(_0x2fad6b){const _0x12ee02=a126_0x15f653,_0x448f57=JSON[_0x12ee02(0x22c)](JSON['stringify'](_0x2fad6b)),_0x409e73=a126_0x3d8b8a[_0x12ee02(0x221)](_0x448f57,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x12ee02(0x234)}),_0x23203e=[_0x12ee02(0x24b),_0x12ee02(0x227)];let _0x34df96=_0x409e73;for(const _0x1cc0bb of _0x23203e){_0x34df96=_0x34df96['replace'](new RegExp('^('+_0x1cc0bb+')','m'),(_0x4d84ac,_0x700801,_0x9fc301)=>{if(_0x9fc301===0x0||_0x34df96[_0x9fc301-0x1]==='\x0a'&&_0x34df96[_0x9fc301-0x2]==='\x0a')return _0x700801;return'\x0a'+_0x700801;});}return _0x34df96;}export function parseSegmentYamlFile(_0x40101b){return safeParseYaml(_0x40101b,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x3c501e){const _0x330608=a126_0x15f653;return{'type':_0x330608(0x201),'name':_0x3c501e[_0x330608(0x228)],..._0x3c501e[_0x330608(0x232)]!==undefined&&{'description':_0x3c501e[_0x330608(0x232)]},..._0x3c501e['folder']!==undefined&&{'folder':_0x3c501e[_0x330608(0x1fe)]},..._0x3c501e[_0x330608(0x20b)]&&{'rule':normalizeRule(_0x3c501e[_0x330608(0x20b)])},..._0x3c501e[_0x330608(0x239)]!==undefined&&{'kind':_0x3c501e[_0x330608(0x239)]},..._0x3c501e[_0x330608(0x1f9)]!==undefined&&{'visible':_0x3c501e[_0x330608(0x1f9)]},..._0x3c501e[_0x330608(0x257)]&&{'activations':_0x3c501e[_0x330608(0x257)][_0x330608(0x1e4)](normalizeActivation)}};}function a126_0x2d16(){const _0x1c0911=['schedule','warnings','segmentFolderId','keys','connectionId','source','attribute_name','notify_on','visibility','isVisible','end_on','run_after_journey_refresh','test','groupingColumns','all','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','object','connector_config\x20for\x20activation\x20\x22','repeatFrequency','TimeRange','rightValues','conditions[','orderBy','connectionNameToIdMap','minValue','repeat_sub_frequency','operator','push','12308900TClZAy','joinStrategy','all_columns','5566504oxYrfc','duration','code','repeatUnit','length','getSchema','type','\x0a\x0aAvailable\x20fields:\x0a','behavior','map','Please\x20specify\x20a\x20valid\x20attribute\x20name.','Connector:\x20','1602012viGCVZ','emailToIdMap','reverse','joinRow','string','JOURNEY_SYNTAX_ERROR','min','notification','syndicationBehavior','startAt','timezone','filter','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','unit','order_by','sort','join_strategy','columns','visible','attribute','valid','arrayMatching','formatting','folder','limit','join_row','segment','realtime','connector_config','repeatSubFrequency','ruleHashToName','8ZeKNRj','localRuleToName','\x27:\x20','CONNECTOR_SCHEMA_NOT_FOUND','isArray','rule','orderColumn','not','1423805IkeWeI','leftValue','errors','7882301PKuOyj','include','runAfterJourneyRefresh','isFinite','Reference','usedNames','Unknown\x20email\x20recipient:\x20','\x22:\x0a','Value','Last','maxValue','email_recipients','set','behavior_table','Column','852252pozljH','stringify','First','scheduleType','Count','warn','funnel_stage','activations:','name','column','add','New\x20Segment','parse','CountDistinct','forEach','And','any','value','description','emailRecipients','null','activation_template_id','connection','Equal','start_at','kind','from','max','batch','conditions','connectorConfig','exclude','30Fxwmst','repeat_frequency','aggregation','resolveSegmentName','has','rightValue','endOn','entries','Unknown\x20connection:\x20','allColumns','45lCnbGz','rule:','repeat_unit','Behavior','].attribute\x20cannot\x20be\x20empty.\x0a','activationTemplateId','get','1391186dKHBtw','activationParams','INVALID_ARGUMENT','behaviorTableName','notifyOn','__UNRESOLVED__','activations','values'];a126_0x2d16=function(){return _0x1c0911;};return a126_0x2d16();}export function normalizeRule(_0x2243ae){const _0x5afd3e=a126_0x15f653;return{'type':_0x2243ae['type'],'conditions':_0x2243ae[_0x5afd3e(0x23d)][_0x5afd3e(0x1e4)](normalizeCondition),..._0x2243ae[_0x5afd3e(0x232)]!==undefined&&{'description':_0x2243ae[_0x5afd3e(0x232)]}};}function normalizeCondition(_0x55f08f){const _0x1257b8=a126_0x15f653;if(_0x1257b8(0x201)in _0x55f08f&&(_0x55f08f[_0x1257b8(0x1e1)]===_0x1257b8(0x212)||_0x55f08f['type']===_0x1257b8(0x23f))){const _0x33997a=_0x55f08f;return{'type':_0x33997a['type'],'segment':_0x33997a[_0x1257b8(0x201)]};}if(_0x1257b8(0x1e1)in _0x55f08f&&(_0x55f08f[_0x1257b8(0x1e1)]===_0x1257b8(0x22f)||_0x55f08f[_0x1257b8(0x1e1)]==='Or')){const _0x4e0a0e=_0x55f08f;return{'type':_0x4e0a0e[_0x1257b8(0x1e1)],'conditions':_0x4e0a0e[_0x1257b8(0x23d)][_0x1257b8(0x1e4)](normalizeCondition),..._0x4e0a0e['description']!==undefined&&{'description':_0x4e0a0e[_0x1257b8(0x232)]}};}if(_0x1257b8(0x229)in _0x55f08f&&_0x55f08f[_0x1257b8(0x1e1)]===_0x1257b8(0x21f)){const _0x53d5ad=_0x55f08f;return{'type':_0x1257b8(0x21f),'column':_0x53d5ad[_0x1257b8(0x229)],'operator':normalizeOperator(_0x53d5ad[_0x1257b8(0x1d6)])};}const _0x458b96=_0x55f08f;return{'type':_0x1257b8(0x219),'attribute':_0x458b96[_0x1257b8(0x1fa)],'operator':normalizeOperator(_0x458b96[_0x1257b8(0x1d6)]),..._0x458b96[_0x1257b8(0x1fc)]!==undefined&&{'arrayMatching':_0x458b96[_0x1257b8(0x1fc)]},..._0x458b96[_0x1257b8(0x23f)]!==undefined&&{'exclude':_0x458b96[_0x1257b8(0x23f)]},..._0x458b96[_0x1257b8(0x242)]!==undefined&&{'aggregation':_0x458b96[_0x1257b8(0x242)]},..._0x458b96[_0x1257b8(0x1c1)]!==undefined&&{'source':_0x458b96['source']},..._0x458b96[_0x1257b8(0x1f2)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x458b96[_0x1257b8(0x1f2)])))},..._0x458b96[_0x1257b8(0x1ff)]!==undefined&&{'limit':_0x458b96[_0x1257b8(0x1ff)]}};}function normalizeOperator(_0x4a64e5){const _0x229cc1=a126_0x15f653;if(isBetweenOperator(_0x4a64e5[_0x229cc1(0x1e1)]))return{'type':_0x4a64e5[_0x229cc1(0x1e1)],..._0x4a64e5['not']!==undefined&&{'not':_0x4a64e5['not']},..._0x4a64e5['min']!==undefined&&{'min':_0x4a64e5[_0x229cc1(0x1ed)]},..._0x4a64e5['max']!==undefined&&{'max':_0x4a64e5[_0x229cc1(0x23b)]}};const _0x637817=getEffectiveValue(_0x4a64e5);return{'type':_0x4a64e5['type'],..._0x4a64e5[_0x229cc1(0x20d)]!==undefined&&{'not':_0x4a64e5['not']},..._0x637817!==undefined&&{'value':_0x637817},..._0x4a64e5[_0x229cc1(0x1f4)]!==undefined&&{'unit':_0x4a64e5[_0x229cc1(0x1f4)]},..._0x4a64e5['duration']!==undefined&&{'duration':_0x4a64e5[_0x229cc1(0x1dc)]},..._0x4a64e5[_0x229cc1(0x23a)]!==undefined&&{'from':_0x4a64e5['from']},..._0x4a64e5[_0x229cc1(0x1e9)]!==undefined&&{'reverse':_0x4a64e5[_0x229cc1(0x1e9)]}};}function normalizeActivation(_0x31c205){const _0x2844b0=a126_0x15f653;return{'name':_0x31c205[_0x2844b0(0x228)],'connection':_0x31c205[_0x2844b0(0x236)],..._0x31c205[_0x2844b0(0x232)]!==undefined&&{'description':_0x31c205[_0x2844b0(0x232)]},..._0x31c205[_0x2844b0(0x1da)]!==undefined&&{'all_columns':_0x31c205[_0x2844b0(0x1da)]},..._0x31c205[_0x2844b0(0x1f8)]!==undefined&&{'columns':_0x31c205[_0x2844b0(0x1f8)]},..._0x31c205[_0x2844b0(0x1e3)]!==undefined&&{'behavior':_0x31c205[_0x2844b0(0x1e3)]},..._0x31c205['schedule']!==undefined&&{'schedule':_0x31c205[_0x2844b0(0x259)]},..._0x31c205[_0x2844b0(0x1ee)]!==undefined&&{'notification':_0x31c205['notification']},..._0x31c205['connector_config']!==undefined&&{'connector_config':_0x31c205[_0x2844b0(0x203)]},..._0x31c205['activation_template_id']!==undefined&&{'activation_template_id':_0x31c205[_0x2844b0(0x235)]}};}export function activationResponseToDef(_0x528168,_0x1b0d96,_0x42334b){const _0x4ba7c5=a126_0x15f653,_0x595ead=_0x528168[_0x4ba7c5(0x1c0)]||'',_0x4bed7e=_0x42334b?.['get'](_0x595ead)??_0x595ead,_0x3897e3={'name':_0x528168[_0x4ba7c5(0x228)],'connection':_0x4bed7e};_0x528168['description']&&(_0x3897e3['description']=_0x528168[_0x4ba7c5(0x232)]);let _0x3a3761=[];_0x528168[_0x4ba7c5(0x1f8)]&&_0x528168[_0x4ba7c5(0x1f8)]['length']>0x0&&(_0x3a3761=_0x528168['columns'][_0x4ba7c5(0x1f2)](_0x5b85ac=>_0x5b85ac&&_0x5b85ac[_0x4ba7c5(0x228)])[_0x4ba7c5(0x1e4)](_0xb75f26=>{const _0x153998=_0x4ba7c5;if(_0xb75f26[_0x153998(0x1e1)]||_0xb75f26[_0x153998(0x1c4)])return{'name':_0xb75f26[_0x153998(0x228)],..._0xb75f26[_0x153998(0x1e1)]&&{'type':_0xb75f26['type']},..._0xb75f26[_0x153998(0x1c4)]&&{'visibility':_0xb75f26[_0x153998(0x1c4)]}};return _0xb75f26['name'];}));_0x3a3761[_0x4ba7c5(0x1df)]>0x0&&(_0x3897e3[_0x4ba7c5(0x1f8)]=_0x3a3761);_0x528168[_0x4ba7c5(0x249)]!==undefined&&(_0x528168[_0x4ba7c5(0x249)]===![]&&_0x3a3761[_0x4ba7c5(0x1df)]===0x0?_0x3897e3[_0x4ba7c5(0x1da)]=!![]:_0x3897e3['all_columns']=_0x528168[_0x4ba7c5(0x249)]);const _0x4168ba={};let _0x83b09d=![];_0x528168[_0x4ba7c5(0x223)]&&(_0x4168ba[_0x4ba7c5(0x1e1)]=_0x528168[_0x4ba7c5(0x223)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1de)]&&(_0x4168ba['repeat_unit']=_0x528168['repeatUnit'],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1ce)]!==undefined&&_0x528168['repeatFrequency']!==null&&(_0x4168ba[_0x4ba7c5(0x241)]=_0x528168[_0x4ba7c5(0x1ce)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x204)]&&_0x528168[_0x4ba7c5(0x204)][_0x4ba7c5(0x1df)]>0x0&&(_0x4168ba[_0x4ba7c5(0x1d5)]=_0x528168['repeatSubFrequency'],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1f0)]!==undefined&&(_0x4168ba[_0x4ba7c5(0x238)]=_0x528168[_0x4ba7c5(0x1f0)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x246)]!==undefined&&(_0x4168ba['end_on']=_0x528168[_0x4ba7c5(0x246)],_0x83b09d=!![]);_0x528168[_0x4ba7c5(0x1f1)]&&(_0x4168ba[_0x4ba7c5(0x1f1)]=_0x528168['timezone'],_0x83b09d=!![]);_0x83b09d&&(_0x3897e3[_0x4ba7c5(0x259)]=_0x4168ba);(_0x528168[_0x4ba7c5(0x255)]&&_0x528168['notifyOn'][_0x4ba7c5(0x1df)]>0x0||_0x528168['emailRecipients']&&_0x528168[_0x4ba7c5(0x233)][_0x4ba7c5(0x1df)]>0x0)&&(_0x3897e3[_0x4ba7c5(0x1ee)]={},_0x528168[_0x4ba7c5(0x255)]&&_0x528168[_0x4ba7c5(0x255)]['length']>0x0&&(_0x3897e3[_0x4ba7c5(0x1ee)][_0x4ba7c5(0x1c3)]=_0x528168['notifyOn']),_0x528168[_0x4ba7c5(0x233)]&&_0x528168['emailRecipients']['length']>0x0&&(_0x3897e3[_0x4ba7c5(0x1ee)][_0x4ba7c5(0x21c)]=_0x528168[_0x4ba7c5(0x233)][_0x4ba7c5(0x1e4)](_0x612b2a=>{const _0x5a3123=_0x4ba7c5,_0x27511c=_0x1b0d96?.[_0x5a3123(0x250)](_0x612b2a);return _0x27511c??String(_0x612b2a);})));_0x528168[_0x4ba7c5(0x23e)]&&Object[_0x4ba7c5(0x1bf)](_0x528168[_0x4ba7c5(0x23e)])[_0x4ba7c5(0x1df)]>0x0&&(_0x3897e3[_0x4ba7c5(0x203)]=normalizeConnectorConfigForYaml(_0x528168[_0x4ba7c5(0x23e)]));_0x528168[_0x4ba7c5(0x24f)]&&(_0x3897e3['activation_template_id']=_0x528168[_0x4ba7c5(0x24f)]);if(_0x528168[_0x4ba7c5(0x1ef)]){const _0x2340a4={},_0x379244=_0x528168[_0x4ba7c5(0x1ef)];_0x379244['columns']&&_0x379244[_0x4ba7c5(0x1f8)]['length']>0x0&&(_0x2340a4['columns']=_0x379244['columns'][_0x4ba7c5(0x1f2)](_0xb5a498=>_0xb5a498&&_0xb5a498[_0x4ba7c5(0x228)])['map'](_0x1f1a3a=>({'name':_0x1f1a3a[_0x4ba7c5(0x228)],..._0x1f1a3a[_0x4ba7c5(0x1e1)]&&{'type':_0x1f1a3a[_0x4ba7c5(0x1e1)]},..._0x1f1a3a[_0x4ba7c5(0x1c4)]&&{'visibility':_0x1f1a3a[_0x4ba7c5(0x1c4)]}}))),_0x379244['behaviorTableName']&&(_0x2340a4[_0x4ba7c5(0x21e)]=_0x379244[_0x4ba7c5(0x254)]),_0x379244[_0x4ba7c5(0x1ea)]!==undefined&&(_0x2340a4['join_row']=_0x379244['joinRow']),_0x379244['joinStrategy']&&(_0x2340a4['join_strategy']=_0x379244[_0x4ba7c5(0x1d9)]),_0x379244['formatting']&&(_0x2340a4[_0x4ba7c5(0x1fd)]=_0x379244[_0x4ba7c5(0x1fd)]),_0x379244['orderBy']&&_0x379244[_0x4ba7c5(0x1d2)][_0x4ba7c5(0x1df)]>0x0&&(_0x2340a4['order_by']=_0x379244[_0x4ba7c5(0x1d2)]),Object['keys'](_0x2340a4)[_0x4ba7c5(0x1df)]>0x0&&(_0x3897e3[_0x4ba7c5(0x1e3)]=_0x2340a4);}return _0x3897e3;}export function journeyActivationStepToYaml(_0x578d67,_0x165096,_0x322e6c){const _0x42170e=a126_0x15f653,_0x47d0b1=_0x578d67['attributes'][_0x42170e(0x252)],_0x5e2271=_0x47d0b1['connectionId']||'',_0x2e585e=_0x322e6c?.[_0x42170e(0x250)](_0x5e2271)??_0x5e2271,_0xa620b3={'name':_0x47d0b1[_0x42170e(0x228)]||'','connection':_0x2e585e};_0x578d67['attributes'][_0x42170e(0x213)]&&(_0xa620b3[_0x42170e(0x1c7)]=!![]);_0x47d0b1['description']&&(_0xa620b3[_0x42170e(0x232)]=_0x47d0b1['description']);let _0x356ec7=[];_0x47d0b1[_0x42170e(0x1f8)]&&_0x47d0b1[_0x42170e(0x1f8)][_0x42170e(0x1df)]>0x0&&(_0x356ec7=_0x47d0b1['columns'][_0x42170e(0x1f2)](_0x255bc5=>_0x255bc5&&_0x255bc5[_0x42170e(0x228)])[_0x42170e(0x1e4)](_0x348b65=>{const _0x33bc23=_0x42170e;if(_0x348b65['type']||_0x348b65['visibility'])return{'name':_0x348b65[_0x33bc23(0x228)],..._0x348b65[_0x33bc23(0x1e1)]&&{'type':_0x348b65[_0x33bc23(0x1e1)]},..._0x348b65[_0x33bc23(0x1c4)]&&{'visibility':_0x348b65[_0x33bc23(0x1c4)]}};return _0x348b65['name'];}));_0x356ec7[_0x42170e(0x1df)]>0x0&&(_0xa620b3['columns']=_0x356ec7);_0x47d0b1['allColumns']!==undefined&&(_0x47d0b1[_0x42170e(0x249)]===![]&&_0x356ec7['length']===0x0?_0xa620b3[_0x42170e(0x1da)]=!![]:_0xa620b3[_0x42170e(0x1da)]=_0x47d0b1[_0x42170e(0x249)]);const _0x82f2d1={};let _0x1757f7=![];_0x47d0b1['scheduleType']&&(_0x82f2d1[_0x42170e(0x1e1)]=_0x47d0b1[_0x42170e(0x223)],_0x1757f7=!![]);_0x47d0b1[_0x42170e(0x1de)]&&(_0x82f2d1[_0x42170e(0x24c)]=_0x47d0b1[_0x42170e(0x1de)],_0x1757f7=!![]);_0x47d0b1['repeatFrequency']!==undefined&&_0x47d0b1[_0x42170e(0x1ce)]!==null&&(_0x82f2d1[_0x42170e(0x241)]=_0x47d0b1[_0x42170e(0x1ce)],_0x1757f7=!![]);_0x47d0b1[_0x42170e(0x1f0)]!==undefined&&(_0x82f2d1[_0x42170e(0x238)]=_0x47d0b1['startAt'],_0x1757f7=!![]);_0x47d0b1[_0x42170e(0x246)]!==undefined&&(_0x82f2d1[_0x42170e(0x1c6)]=_0x47d0b1[_0x42170e(0x246)],_0x1757f7=!![]);_0x47d0b1['timezone']&&(_0x82f2d1[_0x42170e(0x1f1)]=_0x47d0b1[_0x42170e(0x1f1)],_0x1757f7=!![]);_0x1757f7&&(_0xa620b3[_0x42170e(0x259)]=_0x82f2d1);(_0x47d0b1[_0x42170e(0x255)]&&_0x47d0b1['notifyOn']['length']>0x0||_0x47d0b1['emailRecipients']&&_0x47d0b1[_0x42170e(0x233)][_0x42170e(0x1df)]>0x0)&&(_0xa620b3[_0x42170e(0x1ee)]={},_0x47d0b1[_0x42170e(0x255)]&&_0x47d0b1[_0x42170e(0x255)]['length']>0x0&&(_0xa620b3[_0x42170e(0x1ee)][_0x42170e(0x1c3)]=_0x47d0b1[_0x42170e(0x255)]),_0x47d0b1[_0x42170e(0x233)]&&_0x47d0b1[_0x42170e(0x233)][_0x42170e(0x1df)]>0x0&&(_0xa620b3[_0x42170e(0x1ee)][_0x42170e(0x21c)]=_0x47d0b1[_0x42170e(0x233)][_0x42170e(0x1e4)](_0x22e588=>{const _0xd213eb=_0x42170e,_0x24cfad=_0x165096?.[_0xd213eb(0x250)](_0x22e588);return _0x24cfad??String(_0x22e588);})));_0x47d0b1[_0x42170e(0x23e)]&&Object[_0x42170e(0x1bf)](_0x47d0b1[_0x42170e(0x23e)])[_0x42170e(0x1df)]>0x0&&(_0xa620b3['connector_config']=normalizeConnectorConfigForYaml(_0x47d0b1[_0x42170e(0x23e)]));_0x47d0b1['activationTemplateId']&&(_0xa620b3[_0x42170e(0x235)]=_0x47d0b1['activationTemplateId']);if(_0x47d0b1[_0x42170e(0x1ef)]){const _0x263c53={},_0x13d179=_0x47d0b1[_0x42170e(0x1ef)];_0x13d179['columns']&&_0x13d179[_0x42170e(0x1f8)][_0x42170e(0x1df)]>0x0&&(_0x263c53[_0x42170e(0x1f8)]=_0x13d179[_0x42170e(0x1f8)][_0x42170e(0x1f2)](_0x463451=>_0x463451&&_0x463451['name'])[_0x42170e(0x1e4)](_0x35c4fc=>({'name':_0x35c4fc[_0x42170e(0x228)],..._0x35c4fc[_0x42170e(0x1e1)]&&{'type':_0x35c4fc[_0x42170e(0x1e1)]},..._0x35c4fc[_0x42170e(0x1c4)]&&{'visibility':_0x35c4fc[_0x42170e(0x1c4)]}}))),_0x13d179['behaviorTableName']&&(_0x263c53[_0x42170e(0x21e)]=_0x13d179[_0x42170e(0x254)]),_0x13d179['joinRow']!==undefined&&(_0x263c53[_0x42170e(0x200)]=_0x13d179[_0x42170e(0x1ea)]),_0x13d179[_0x42170e(0x1d9)]&&(_0x263c53[_0x42170e(0x1f7)]=_0x13d179[_0x42170e(0x1d9)]),_0x13d179[_0x42170e(0x1fd)]&&(_0x263c53[_0x42170e(0x1fd)]=_0x13d179[_0x42170e(0x1fd)]),_0x13d179['orderBy']&&_0x13d179[_0x42170e(0x1d2)][_0x42170e(0x1df)]>0x0&&(_0x263c53[_0x42170e(0x1f5)]=_0x13d179[_0x42170e(0x1d2)]),Object[_0x42170e(0x1bf)](_0x263c53)[_0x42170e(0x1df)]>0x0&&(_0xa620b3[_0x42170e(0x1e3)]=_0x263c53);}return _0xa620b3;}export function segmentWithActivationsToYaml(_0x4dd195,_0x41b30c,_0x19300a,_0x25b871,_0x590dcc){const _0xb00978=a126_0x15f653,_0x9415bf=segmentResponseToDefSync(_0x4dd195,_0x19300a);return _0x41b30c[_0xb00978(0x1df)]>0x0&&(_0x9415bf['activations']=_0x41b30c[_0xb00978(0x1e4)](_0x37f10a=>activationResponseToDef(_0x37f10a,_0x25b871,_0x590dcc))),_0x9415bf;}function normalizeColumn(_0x4f8038){const _0x334f14=a126_0x15f653;if(typeof _0x4f8038===_0x334f14(0x1eb))return{'name':_0x4f8038};return{'name':_0x4f8038[_0x334f14(0x228)],..._0x4f8038['type']&&{'type':_0x4f8038[_0x334f14(0x1e1)]},..._0x4f8038[_0x334f14(0x1c4)]&&{'visibility':_0x4f8038['visibility']}};}export async function activationDefToCreateRequest(_0x241a32,_0x509206){const _0x21349a=a126_0x15f653,_0x552a15=_0x509206?.[_0x21349a(0x1e8)],_0x5a9549=_0x509206?.[_0x21349a(0x1d3)],_0x7eba38=_0x241a32[_0x21349a(0x236)];let _0x5f3493;const _0x3568d2=parseInt(_0x7eba38,0xa);if(!isNaN(_0x3568d2)&&String(_0x3568d2)===_0x7eba38)_0x5f3493=_0x3568d2;else{const _0x468fb1=_0x5a9549?.[_0x21349a(0x250)](_0x7eba38);if(_0x468fb1===undefined)throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x21349a(0x248)+_0x7eba38,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x5f3493=_0x468fb1;}const _0x2b0c16={'name':_0x241a32['name'],'connectionId':_0x5f3493};_0x241a32[_0x21349a(0x232)]&&(_0x2b0c16[_0x21349a(0x232)]=_0x241a32['description']);let _0x3a9382=[];_0x241a32[_0x21349a(0x1f8)]&&_0x241a32[_0x21349a(0x1f8)][_0x21349a(0x1df)]>0x0&&(_0x3a9382=_0x241a32[_0x21349a(0x1f8)][_0x21349a(0x1f2)](_0xbfbed=>_0xbfbed!=null)[_0x21349a(0x1e4)](normalizeColumn));_0x3a9382['length']>0x0&&(_0x2b0c16[_0x21349a(0x1f8)]=_0x3a9382);_0x241a32[_0x21349a(0x1da)]!==undefined&&(_0x241a32[_0x21349a(0x1da)]===![]&&_0x3a9382[_0x21349a(0x1df)]===0x0?_0x2b0c16[_0x21349a(0x249)]=!![]:_0x2b0c16[_0x21349a(0x249)]=_0x241a32[_0x21349a(0x1da)]);if(_0x241a32[_0x21349a(0x259)]){const _0x111af2=_0x241a32['schedule'];_0x111af2[_0x21349a(0x1e1)]&&(_0x2b0c16[_0x21349a(0x223)]=_0x111af2[_0x21349a(0x1e1)]),_0x111af2[_0x21349a(0x24c)]&&(_0x2b0c16['repeatUnit']=_0x111af2['repeat_unit']),_0x111af2['repeat_frequency']!==undefined&&(_0x2b0c16[_0x21349a(0x1ce)]=_0x111af2[_0x21349a(0x241)]),_0x111af2[_0x21349a(0x1d5)]&&(_0x2b0c16[_0x21349a(0x204)]=_0x111af2[_0x21349a(0x1d5)]),_0x111af2['start_at']!==undefined&&(_0x2b0c16[_0x21349a(0x1f0)]=_0x111af2[_0x21349a(0x238)]),_0x111af2['end_on']!==undefined&&(_0x2b0c16[_0x21349a(0x246)]=_0x111af2['end_on']),_0x111af2[_0x21349a(0x1f1)]&&(_0x2b0c16[_0x21349a(0x1f1)]=_0x111af2[_0x21349a(0x1f1)]);}_0x241a32[_0x21349a(0x1ee)]&&(_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x1c3)]&&(_0x2b0c16['notifyOn']=_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x1c3)]),_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x21c)]&&(_0x2b0c16['emailRecipients']=_0x241a32[_0x21349a(0x1ee)][_0x21349a(0x21c)]['map'](_0x1683e0=>{const _0x257d84=_0x21349a,_0x23e6f7=Number(_0x1683e0);if(!isNaN(_0x23e6f7)&&String(_0x23e6f7)===_0x1683e0)return _0x23e6f7;const _0x3514bd=_0x552a15?.['get'](_0x1683e0['toLowerCase']());if(_0x3514bd===undefined)throw new SDKError(ErrorCode[_0x257d84(0x253)],_0x257d84(0x217)+_0x1683e0+_0x257d84(0x1cb));return _0x3514bd;})));if(_0x241a32[_0x21349a(0x203)]){const _0x2a940d=_0x509206?.['connectionNameToTypeMap']?.['get'](_0x7eba38);if(_0x2a940d&&_0x509206?.['getSchema'])try{const _0x5a9499=await _0x509206[_0x21349a(0x1e0)](_0x2a940d),_0x148bd5=validateConnectorConfig(_0x241a32[_0x21349a(0x203)],_0x5a9499);if(!_0x148bd5[_0x21349a(0x1fb)])throw new SDKError(ErrorCode['CONNECTOR_INVALID_CONFIG'],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x241a32[_0x21349a(0x228)]+_0x21349a(0x218)+formatValidationErrors(_0x148bd5[_0x21349a(0x210)]),undefined,{'helpText':_0x21349a(0x1e6)+_0x2a940d+_0x21349a(0x1e2)+formatSchemaAsHelp(_0x5a9499)});if(_0x148bd5['warnings'][_0x21349a(0x1df)]>0x0){const _0x53185a=formatValidationWarnings(_0x148bd5[_0x21349a(0x25a)]);console[_0x21349a(0x225)](_0x21349a(0x1cd)+_0x241a32[_0x21349a(0x228)]+'\x22:\x0a'+_0x53185a);}_0x2b0c16['connectorConfig']=transformConfigToLegacy(_0x241a32[_0x21349a(0x203)],_0x5a9499);}catch(_0x53904a){if(_0x53904a instanceof SDKError&&_0x53904a[_0x21349a(0x1dd)]===ErrorCode[_0x21349a(0x209)])_0x2b0c16[_0x21349a(0x23e)]=_0x241a32[_0x21349a(0x203)];else throw _0x53904a;}else _0x2b0c16[_0x21349a(0x23e)]=_0x241a32[_0x21349a(0x203)];}_0x241a32[_0x21349a(0x235)]!==undefined&&(_0x2b0c16['activationTemplateId']=_0x241a32[_0x21349a(0x235)]);if(_0x241a32[_0x21349a(0x1e3)]){const _0xbed615=_0x241a32[_0x21349a(0x1e3)],_0x3956ce={};if(_0xbed615[_0x21349a(0x1f8)]&&_0xbed615[_0x21349a(0x1f8)][_0x21349a(0x1df)]>0x0){const _0x1c8a94=_0xbed615['columns'][_0x21349a(0x1f2)](_0xe4d74d=>_0xe4d74d&&_0xe4d74d[_0x21349a(0x228)]);_0x1c8a94[_0x21349a(0x1df)]>0x0&&(_0x3956ce[_0x21349a(0x1f8)]=_0x1c8a94);}_0xbed615[_0x21349a(0x21e)]&&(_0x3956ce['behaviorTableName']=_0xbed615[_0x21349a(0x21e)]),_0xbed615[_0x21349a(0x200)]!==undefined&&(_0x3956ce[_0x21349a(0x1ea)]=_0xbed615['join_row']),_0xbed615['join_strategy']&&(_0x3956ce[_0x21349a(0x1d9)]=_0xbed615[_0x21349a(0x1f7)]),_0xbed615[_0x21349a(0x1fd)]&&(_0x3956ce[_0x21349a(0x1fd)]=_0xbed615[_0x21349a(0x1fd)]),_0xbed615[_0x21349a(0x1f5)]&&(_0x3956ce[_0x21349a(0x1d2)]=_0xbed615[_0x21349a(0x1f5)]),_0x2b0c16['syndicationBehavior']=_0x3956ce;}return _0x2b0c16;}export async function activationDefToUpdateRequest(_0x25f592,_0xf0f30c){return activationDefToCreateRequest(_0x25f592,_0xf0f30c);}export function deepSortObject(_0x5bdf83){const _0x4f558b=a126_0x15f653;if(_0x5bdf83===null||typeof _0x5bdf83!==_0x4f558b(0x1cc))return _0x5bdf83;if(Array['isArray'](_0x5bdf83))return _0x5bdf83[_0x4f558b(0x1e4)](deepSortObject)[_0x4f558b(0x1f6)]((_0x2e022f,_0x4337ff)=>JSON['stringify'](_0x2e022f)['localeCompare'](JSON[_0x4f558b(0x221)](_0x4337ff)));const _0x17f1a4={};for(const _0x2d9517 of Object['keys'](_0x5bdf83)[_0x4f558b(0x1f6)]()){_0x17f1a4[_0x2d9517]=deepSortObject(_0x5bdf83[_0x2d9517]);}return _0x17f1a4;}export function serializeRule(_0x4c5744){const _0x33a3c8=a126_0x15f653;return JSON[_0x33a3c8(0x221)](deepSortObject(_0x4c5744));}export function normalizeRuleForMatching(_0x299d67){return normalizeConditionsForMatching(_0x299d67);}function normalizeConditionsForMatching(_0x2d0887){const _0x2d5b0=a126_0x15f653;if(_0x2d0887===null||typeof _0x2d0887!==_0x2d5b0(0x1cc))return _0x2d0887;if(Array[_0x2d5b0(0x20a)](_0x2d0887))return _0x2d0887['map'](normalizeConditionsForMatching);const _0x491db3=_0x2d0887;if((_0x491db3[_0x2d5b0(0x1e1)]==='include'||_0x491db3['type']===_0x2d5b0(0x23f))&&typeof _0x491db3[_0x2d5b0(0x201)]==='string')return{..._0x491db3,'segment':'__SEGMENT_REF__'};const _0x5a72bd={};for(const _0x1ce280 of Object[_0x2d5b0(0x1bf)](_0x491db3)){_0x5a72bd[_0x1ce280]=normalizeConditionsForMatching(_0x491db3[_0x1ce280]);}return _0x5a72bd;}export function serializeRuleForMatching(_0x58bcac){const _0x1a92ff=a126_0x15f653;return JSON[_0x1a92ff(0x221)](deepSortObject(normalizeRuleForMatching(_0x58bcac)));}export function expandSegmentReferences(_0x220e04,_0x31dba2,_0x3c229d=new Set()){return expandConditions(_0x220e04,_0x31dba2,_0x3c229d);}function expandConditions(_0x5d91cc,_0x1b61cb,_0x262c41){const _0x13dd9a=a126_0x15f653;if(_0x5d91cc===null||typeof _0x5d91cc!=='object')return _0x5d91cc;if(Array[_0x13dd9a(0x20a)](_0x5d91cc))return _0x5d91cc['map'](_0x4616c7=>expandConditions(_0x4616c7,_0x1b61cb,_0x262c41));const _0xa968f5=_0x5d91cc;if((_0xa968f5[_0x13dd9a(0x1e1)]===_0x13dd9a(0x212)||_0xa968f5[_0x13dd9a(0x1e1)]===_0x13dd9a(0x23f))&&typeof _0xa968f5[_0x13dd9a(0x201)]===_0x13dd9a(0x1eb)){const _0x397477=_0xa968f5[_0x13dd9a(0x201)],_0x37b367=_0x1b61cb[_0x13dd9a(0x250)](_0x397477);if(_0x37b367&&!_0x262c41[_0x13dd9a(0x244)](_0x397477)){const _0x144bb8=new Set(_0x262c41);_0x144bb8[_0x13dd9a(0x22a)](_0x397477);const _0x58f626=expandConditions(_0x37b367,_0x1b61cb,_0x144bb8);return{'type':_0xa968f5[_0x13dd9a(0x1e1)],'expanded_rule':_0x58f626};}return{'type':_0xa968f5[_0x13dd9a(0x1e1)],'expanded_rule':_0x13dd9a(0x256)};}const _0x97f906={};for(const _0x2bb84d of Object[_0x13dd9a(0x1bf)](_0xa968f5)){_0x97f906[_0x2bb84d]=expandConditions(_0xa968f5[_0x2bb84d],_0x1b61cb,_0x262c41);}return _0x97f906;}export function serializeExpandedRule(_0x38cade,_0x232e06){const _0x5f3f93=expandSegmentReferences(_0x38cade,_0x232e06);return JSON['stringify'](deepSortObject(_0x5f3f93));}export function createSegmentNameContext(_0x33613e){const _0x13e2e7=a126_0x15f653,_0x5b34df=new Set(),_0x85b47d=new Map(),_0x2d935f=new Map();if(_0x33613e)for(const [_0x5e3d13,_0x33f439]of Object[_0x13e2e7(0x247)](_0x33613e)){if(_0x33f439[_0x13e2e7(0x20b)]){const _0x466151=serializeRule(_0x33f439[_0x13e2e7(0x20b)]);_0x2d935f[_0x13e2e7(0x21d)](_0x466151,_0x5e3d13),_0x5b34df[_0x13e2e7(0x22a)](_0x5e3d13);}}return{'usedNames':_0x5b34df,'ruleHashToName':_0x85b47d,'localRuleToName':_0x33613e?_0x2d935f:undefined};}export function resolveSegmentName(_0x1c65a8,_0x772e2b,_0x70b530,_0xe272de){const _0x25ebc5=a126_0x15f653,_0x512fef=serializeRule(_0x772e2b);if(_0x70b530[_0x25ebc5(0x207)]){const _0x16223c=_0x70b530['localRuleToName'][_0x25ebc5(0x250)](_0x512fef);if(_0x16223c)return{'name':_0x16223c,'isDuplicate':![],'isLocalMatch':!![]};}const _0x144bae=_0x70b530[_0x25ebc5(0x205)][_0x25ebc5(0x250)](_0x512fef);if(_0x144bae)return{'name':_0x144bae,'isDuplicate':!![],'isLocalMatch':![]};const _0x3b2508=_0xe272de(_0x1c65a8);let _0x5ae351=_0x3b2508||_0x1c65a8,_0x53e35a=_0x5ae351,_0x42b581=0x2;while(_0x70b530[_0x25ebc5(0x216)][_0x25ebc5(0x244)](_0x53e35a)){_0x53e35a=_0x5ae351+'_'+_0x42b581,_0x42b581++;}return _0x70b530[_0x25ebc5(0x216)][_0x25ebc5(0x22a)](_0x53e35a),_0x70b530['ruleHashToName'][_0x25ebc5(0x21d)](_0x512fef,_0x53e35a),{'name':_0x53e35a,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x22482a){const _0x363552=[],_0x4f144a=_0x5bcfdc=>{const _0x460b73=a126_0x2ee4;if(!_0x5bcfdc||typeof _0x5bcfdc!==_0x460b73(0x1cc))return;if(Array['isArray'](_0x5bcfdc)){_0x5bcfdc[_0x460b73(0x22e)](_0x4f144a);return;}const _0x23d060=_0x5bcfdc;(_0x23d060['type']==='include'||_0x23d060[_0x460b73(0x1e1)]===_0x460b73(0x23f))&&typeof _0x23d060[_0x460b73(0x201)]===_0x460b73(0x1eb)&&_0x363552[_0x460b73(0x1d7)](_0x23d060[_0x460b73(0x201)]);for(const _0x27489e of Object['values'](_0x23d060)){_0x4f144a(_0x27489e);}};return _0x4f144a(_0x22482a),_0x363552;}export function validateSegmentRule(_0x2d9e2a,_0x58c881){const _0x1f0237=a126_0x15f653;if(!_0x58c881||!_0x58c881[_0x1f0237(0x23d)])return;for(let _0x1cf689=0x0;_0x1cf689<_0x58c881['conditions']['length'];_0x1cf689++){const _0x3ab0fe=_0x58c881[_0x1f0237(0x23d)][_0x1cf689];if('type'in _0x3ab0fe&&_0x3ab0fe[_0x1f0237(0x1e1)]===_0x1f0237(0x219)){const _0x434a40=_0x3ab0fe,_0x1dd03b=_0x434a40[_0x1f0237(0x1c1)]||_0x434a40[_0x1f0237(0x242)];if((!_0x434a40[_0x1f0237(0x1fa)]||_0x434a40[_0x1f0237(0x1fa)]==='')&&!_0x1dd03b)throw new SDKError(ErrorCode[_0x1f0237(0x1ec)],_0x1f0237(0x1f3)+_0x2d9e2a+_0x1f0237(0x208)+(_0x1f0237(0x1d1)+_0x1cf689+_0x1f0237(0x24e))+_0x1f0237(0x1e5));}}}
|
|
1
|
+
const a126_0x13492b=a126_0x2525;(function(_0x5b836f,_0x21cf64){const _0x4cddc2=a126_0x2525,_0x3c5e7a=_0x5b836f();while(!![]){try{const _0x136caa=parseInt(_0x4cddc2(0x224))/0x1*(-parseInt(_0x4cddc2(0x1e3))/0x2)+-parseInt(_0x4cddc2(0x1d5))/0x3*(-parseInt(_0x4cddc2(0x1bd))/0x4)+-parseInt(_0x4cddc2(0x209))/0x5*(-parseInt(_0x4cddc2(0x1e1))/0x6)+-parseInt(_0x4cddc2(0x1b8))/0x7+-parseInt(_0x4cddc2(0x1b5))/0x8+parseInt(_0x4cddc2(0x1fe))/0x9+-parseInt(_0x4cddc2(0x1c4))/0xa*(-parseInt(_0x4cddc2(0x198))/0xb);if(_0x136caa===_0x21cf64)break;else _0x3c5e7a['push'](_0x3c5e7a['shift']());}catch(_0x3dfdfa){_0x3c5e7a['push'](_0x3c5e7a['shift']());}}}(a126_0x2306,0x9c490));import*as a126_0x53c10e from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';function filterRuleAsRuleDef(_0x39d92b){return _0x39d92b;}function ruleDefAsFilterRule(_0x20aeb8){return _0x20aeb8;}export function segmentResponseToDefSync(_0x441f33,_0x3f4113){const _0x3fd2e0=a126_0x2525,_0x1b86d3=_0x441f33[_0x3fd2e0(0x219)]&&'type'in _0x441f33[_0x3fd2e0(0x219)]&&_0x441f33[_0x3fd2e0(0x219)][_0x3fd2e0(0x19e)];return{'type':_0x3fd2e0(0x1ed),'name':_0x441f33[_0x3fd2e0(0x217)],..._0x441f33[_0x3fd2e0(0x1f2)]&&{'description':_0x441f33[_0x3fd2e0(0x1f2)]},..._0x3f4113&&{'folder':_0x3f4113},..._0x1b86d3&&{'rule':apiRuleToYaml(_0x441f33[_0x3fd2e0(0x219)])},..._0x441f33[_0x3fd2e0(0x1b7)]!==undefined&&{'kind':_0x441f33[_0x3fd2e0(0x1b7)]===0x0?_0x3fd2e0(0x197):_0x441f33[_0x3fd2e0(0x1b7)]===0x1?_0x3fd2e0(0x1d2):_0x3fd2e0(0x1e0)},..._0x441f33[_0x3fd2e0(0x20f)]!==undefined&&{'visible':_0x441f33[_0x3fd2e0(0x20f)]}};}export async function segmentResponseToDef(_0x45ae9c,_0x203796,_0x4536f9){const _0x212c31=a126_0x2525,_0x449980=segmentResponseToDefSync(_0x45ae9c,_0x4536f9);if(!_0x203796||!_0x203796['resolveSegmentName'])return _0x449980;return _0x449980[_0x212c31(0x219)]&&(_0x449980['rule']=await resolveRuleSegmentRefs(_0x449980[_0x212c31(0x219)],_0x203796[_0x212c31(0x1b3)])),_0x449980;}export function apiRuleToYaml(_0x4675ed){const _0x2f538b=a126_0x2525,_0x402c53=(_0x4675ed[_0x2f538b(0x1cf)]||[])['map'](apiConditionToYaml);if(_0x402c53[_0x2f538b(0x1f6)]===0x1&&!_0x4675ed['description']&&_0x2f538b(0x19e)in _0x402c53[0x0]&&(_0x402c53[0x0][_0x2f538b(0x19e)]===_0x2f538b(0x21c)||_0x402c53[0x0][_0x2f538b(0x19e)]==='Or')){const _0xc5a4fc=_0x402c53[0x0];if(_0xc5a4fc['type']===_0x4675ed[_0x2f538b(0x19e)]&&_0xc5a4fc[_0x2f538b(0x1cf)])return{'type':_0x4675ed[_0x2f538b(0x19e)],'conditions':_0xc5a4fc[_0x2f538b(0x1cf)],..._0xc5a4fc['description']&&{'description':_0xc5a4fc[_0x2f538b(0x1f2)]}};}return{'type':_0x4675ed[_0x2f538b(0x19e)],'conditions':_0x402c53,..._0x4675ed[_0x2f538b(0x1f2)]&&{'description':_0x4675ed['description']}};}export async function resolveRuleSegmentRefs(_0x1c2cc9,_0x1904ea){const _0x24efd3=a126_0x2525;return transformRuleSegmentRefs(_0x1c2cc9,_0x1904ea,_0x5e35f0=>/^\d+$/[_0x24efd3(0x19c)](_0x5e35f0));}async function transformConditionSegmentRefs(_0x220d1e,_0x4f2b1e,_0x3f9df6,_0x185696){const _0x352d8a=a126_0x2525;if(_0x352d8a(0x1ed)in _0x220d1e&&(_0x220d1e[_0x352d8a(0x19e)]==='include'||_0x220d1e[_0x352d8a(0x19e)]===_0x352d8a(0x1ce))){const _0x3d7ee7=_0x220d1e;if(_0x3f9df6(_0x3d7ee7[_0x352d8a(0x1ed)]))return{..._0x3d7ee7,'segment':await _0x4f2b1e(_0x3d7ee7[_0x352d8a(0x1ed)])};return _0x220d1e;}if(_0x352d8a(0x1cf)in _0x220d1e&&_0x220d1e['conditions']){const _0x21f399=_0x220d1e,_0x3bd72b=await Promise[_0x352d8a(0x1ab)](_0x21f399['conditions'][_0x352d8a(0x21b)](_0x199238=>transformConditionSegmentRefs(_0x199238,_0x4f2b1e,_0x3f9df6,_0x185696)));return{..._0x21f399,'conditions':_0x3bd72b};}if(_0x352d8a(0x1d6)in _0x220d1e&&_0x220d1e[_0x352d8a(0x1d6)]){const _0x2de27b=_0x220d1e,_0x1cbe69=await _0x185696(filterRuleAsRuleDef(_0x2de27b['filter']),_0x4f2b1e);return{..._0x2de27b,'filter':ruleDefAsFilterRule(_0x1cbe69)};}return _0x220d1e;}async function transformRuleSegmentRefs(_0x444934,_0xb833a5,_0x3f1ba3){const _0x41c0f6=a126_0x2525,_0x2e4152=(_0x165145,_0x3bbc68)=>transformRuleSegmentRefs(_0x165145,_0x3bbc68,_0x3f1ba3),_0x58118e=await Promise['all'](_0x444934['conditions'][_0x41c0f6(0x21b)](_0x2dedce=>transformConditionSegmentRefs(_0x2dedce,_0xb833a5,_0x3f1ba3,_0x2e4152)));return{..._0x444934,'conditions':_0x58118e};}export async function resolveRuleSegmentIds(_0x28bb79,_0x1bb542){const _0x8fee21=a126_0x2525;return transformRuleSegmentRefs(_0x28bb79,_0x1bb542,_0x23cef8=>!/^\d+$/[_0x8fee21(0x19c)](_0x23cef8));}function isBehaviorApiCondition(_0x286443){const _0x55f48b=a126_0x2525;if(!_0x286443[_0x55f48b(0x1f9)]?.[_0x55f48b(0x1fc)]?.[_0x55f48b(0x217)])return![];return!![];}function apiConditionToYaml(_0x287f74){const _0x37ae9b=a126_0x2525;if(_0x287f74[_0x37ae9b(0x19e)]==='And'||_0x287f74[_0x37ae9b(0x19e)]==='Or'){if(_0x287f74['conditions']){const _0x2e17fa=_0x287f74['conditions'][_0x37ae9b(0x21b)](apiConditionToYaml);if(_0x2e17fa[_0x37ae9b(0x1f6)]===0x1&&!_0x287f74[_0x37ae9b(0x1f2)])return _0x2e17fa[0x0];return{'type':_0x287f74['type'],'conditions':_0x2e17fa,..._0x287f74[_0x37ae9b(0x1f2)]&&{'description':_0x287f74[_0x37ae9b(0x1f2)]}};}}if(_0x287f74[_0x37ae9b(0x19e)]===_0x37ae9b(0x196)&&_0x287f74[_0x37ae9b(0x1f9)]&&_0x287f74['operator']){const _0x4fa5fa=_0x287f74['leftValue']['aggregation']?buildAggregationDefFromApi(_0x287f74[_0x37ae9b(0x1f9)][_0x37ae9b(0x200)]):undefined;if(isBehaviorApiCondition(_0x287f74)){const _0x45d9e7=_0x287f74['leftValue']['source'][_0x37ae9b(0x217)];return{'type':_0x37ae9b(0x220),'attribute':_0x45d9e7,'operator':apiOperatorToYaml(_0x287f74[_0x37ae9b(0x1cd)]),..._0x287f74[_0x37ae9b(0x199)]&&_0x287f74['arrayMatching']!==_0x37ae9b(0x1f5)?{'arrayMatching':_0x287f74[_0x37ae9b(0x199)]}:{},..._0x287f74[_0x37ae9b(0x1ce)]?{'exclude':_0x287f74['exclude']}:{},..._0x4fa5fa?{'aggregation':_0x4fa5fa}:{},'source':_0x45d9e7,..._0x287f74[_0x37ae9b(0x1f9)][_0x37ae9b(0x1d6)]?{'filter':apiRuleToYaml(_0x287f74[_0x37ae9b(0x1f9)][_0x37ae9b(0x1d6)])}:{},..._0x287f74[_0x37ae9b(0x1c3)]!==undefined&&_0x287f74[_0x37ae9b(0x1c3)]!==null?{'limit':_0x287f74['limit']}:{}};}return{'type':_0x37ae9b(0x196),'attribute':_0x287f74['leftValue'][_0x37ae9b(0x217)]||'','operator':apiOperatorToYaml(_0x287f74['operator']),..._0x287f74['arrayMatching']&&_0x287f74[_0x37ae9b(0x199)]!=='any'?{'arrayMatching':_0x287f74['arrayMatching']}:{},..._0x287f74['exclude']?{'exclude':_0x287f74[_0x37ae9b(0x1ce)]}:{},..._0x4fa5fa?{'aggregation':_0x4fa5fa}:{},..._0x287f74[_0x37ae9b(0x1f9)][_0x37ae9b(0x1d6)]?{'filter':apiRuleToYaml(_0x287f74[_0x37ae9b(0x1f9)]['filter'])}:{},..._0x287f74[_0x37ae9b(0x1c3)]!==undefined&&_0x287f74['limit']!==null?{'limit':_0x287f74['limit']}:{}};}if(_0x287f74[_0x37ae9b(0x19e)]===_0x37ae9b(0x1c8)&&_0x287f74[_0x37ae9b(0x228)]&&_0x287f74[_0x37ae9b(0x1cd)])return{'type':'Column','column':_0x287f74[_0x37ae9b(0x228)],'operator':apiOperatorToYaml(_0x287f74[_0x37ae9b(0x1cd)])};if(_0x287f74[_0x37ae9b(0x19e)]===_0x37ae9b(0x1ae)&&_0x287f74['id'])return{'type':_0x287f74['exclude']?_0x37ae9b(0x1ce):_0x37ae9b(0x1a9),'segment':_0x287f74['id']};return{'type':_0x37ae9b(0x21c),'conditions':[]};}function isTemporalOperator(_0x30788a){const _0x5d4f38=a126_0x2525;return _0x30788a==='TimeWithinPast'||_0x30788a===_0x5d4f38(0x1dc);}function isBetweenOperator(_0x3c220f){const _0x5267be=a126_0x2525;return _0x3c220f===_0x5267be(0x1c1);}function getEffectiveValue(_0x138649){const _0x48b007=a126_0x2525,_0x465aec=_0x138649[_0x48b007(0x214)];return _0x138649[_0x48b007(0x1c0)]??_0x465aec;}function parseNumericValue(_0xf38506){const _0x2eca54=a126_0x2525;if(typeof _0xf38506===_0x2eca54(0x1e9)&&_0xf38506!==null)return _0xf38506;if(_0xf38506==='')return _0xf38506;const _0x2b825a=Number(_0xf38506);return Number[_0x2eca54(0x191)](_0x2b825a)?_0x2b825a:_0xf38506;}function apiOperatorToYaml(_0x214a52){const _0x3f4b8f=a126_0x2525;if(isBetweenOperator(_0x214a52[_0x3f4b8f(0x19e)]))return{'type':mapApiOperatorType(_0x214a52[_0x3f4b8f(0x19e)]),..._0x214a52[_0x3f4b8f(0x1ba)]!==undefined&&{'not':_0x214a52[_0x3f4b8f(0x1ba)]},..._0x214a52['minValue']!==undefined&&{'min':parseNumericValue(_0x214a52[_0x3f4b8f(0x1cc)])},..._0x214a52[_0x3f4b8f(0x21f)]!==undefined&&{'max':parseNumericValue(_0x214a52['maxValue'])}};if(_0x214a52[_0x3f4b8f(0x19e)]==='TimeRange')return{'type':'TimeRange',..._0x214a52[_0x3f4b8f(0x1ba)]!==undefined&&{'not':_0x214a52[_0x3f4b8f(0x1ba)]},..._0x214a52[_0x3f4b8f(0x1f8)]!==undefined&&{'duration':_0x214a52['duration']},..._0x214a52[_0x3f4b8f(0x1a7)]!==undefined&&{'from':_0x214a52[_0x3f4b8f(0x1a7)]},..._0x214a52['reverse']!==undefined&&{'reverse':_0x214a52[_0x3f4b8f(0x1ff)]}};let _0x119eaf;if(_0x214a52[_0x3f4b8f(0x190)]&&_0x214a52[_0x3f4b8f(0x190)][_0x3f4b8f(0x1f6)]>0x0)_0x119eaf=_0x214a52[_0x3f4b8f(0x190)];else{if(_0x214a52[_0x3f4b8f(0x1da)]!==undefined)_0x119eaf=_0x214a52[_0x3f4b8f(0x1da)];else isTemporalOperator(_0x214a52[_0x3f4b8f(0x19e)])&&_0x214a52[_0x3f4b8f(0x1c0)]!==undefined&&(_0x119eaf=_0x214a52['value']);}return{'type':mapApiOperatorType(_0x214a52[_0x3f4b8f(0x19e)]),..._0x214a52['not']!==undefined&&{'not':_0x214a52[_0x3f4b8f(0x1ba)]},..._0x119eaf!==undefined&&{'value':_0x119eaf},..._0x214a52[_0x3f4b8f(0x1a1)]!==undefined&&{'unit':_0x214a52[_0x3f4b8f(0x1a1)]}};}function mapApiOperatorType(_0xcad38d){return _0xcad38d;}export function segmentDefToCreateRequest(_0x3d124d,_0x335ffb){const _0x5a4a1e=a126_0x2525,_0x51ddc8={'name':_0x3d124d[_0x5a4a1e(0x217)]};return _0x3d124d['description']&&(_0x51ddc8[_0x5a4a1e(0x1f2)]=_0x3d124d['description']),_0x3d124d['rule']&&(_0x51ddc8[_0x5a4a1e(0x219)]=yamlRuleToApi(_0x3d124d[_0x5a4a1e(0x219)])),_0x3d124d['kind']&&(_0x51ddc8[_0x5a4a1e(0x1b7)]=_0x3d124d['kind']===_0x5a4a1e(0x197)?0x0:_0x3d124d['kind']===_0x5a4a1e(0x1d2)?0x1:0x2),_0x3d124d[_0x5a4a1e(0x1aa)]!==undefined&&(_0x51ddc8[_0x5a4a1e(0x20f)]=_0x3d124d[_0x5a4a1e(0x1aa)]),_0x335ffb&&(_0x51ddc8[_0x5a4a1e(0x1b9)]=_0x335ffb),_0x51ddc8;}export function segmentDefToUpdateRequest(_0x1e778c){const _0x349358=a126_0x2525,_0x1876e0={'name':_0x1e778c[_0x349358(0x217)]};return _0x1e778c['description']!==undefined&&(_0x1876e0[_0x349358(0x1f2)]=_0x1e778c['description']),_0x1e778c['rule']&&(_0x1876e0[_0x349358(0x219)]=yamlRuleToApi(_0x1e778c[_0x349358(0x219)])),_0x1e778c['kind']&&(_0x1876e0[_0x349358(0x1b7)]=_0x1e778c[_0x349358(0x1b7)]===_0x349358(0x197)?0x0:_0x1e778c[_0x349358(0x1b7)]==='realtime'?0x1:0x2),_0x1876e0;}export function yamlRuleToApi(_0x4f6ff9,_0x4153f6=![]){const _0x33175c=a126_0x2525,_0x5b3513=_0x4f6ff9[_0x33175c(0x1cf)]['map'](yamlConditionToApi);if(_0x4153f6){const _0x1df4ad=_0x5b3513[_0x33175c(0x1f3)](_0x5c25ac=>_0x5c25ac[_0x33175c(0x19e)]===_0x33175c(0x21c)||_0x5c25ac['type']==='Or');if(!_0x1df4ad&&_0x5b3513[_0x33175c(0x1f6)]>0x0)return{'type':_0x4f6ff9['type'],'conditions':[{'type':_0x33175c(0x21c),'description':_0x4f6ff9['description']||'','conditions':_0x5b3513}]};}return{'type':_0x4f6ff9['type'],'conditions':_0x5b3513,..._0x4f6ff9[_0x33175c(0x1f2)]&&{'description':_0x4f6ff9[_0x33175c(0x1f2)]}};}function yamlConditionToApi(_0x1d9840){const _0x2d2652=a126_0x2525;if(_0x2d2652(0x1ed)in _0x1d9840&&(_0x1d9840[_0x2d2652(0x19e)]==='include'||_0x1d9840['type']===_0x2d2652(0x1ce))){const _0x550c91=_0x1d9840;return{'type':_0x2d2652(0x1ae),'id':_0x550c91[_0x2d2652(0x1ed)],'exclude':_0x550c91['type']===_0x2d2652(0x1ce)};}if(_0x2d2652(0x19e)in _0x1d9840&&(_0x1d9840[_0x2d2652(0x19e)]===_0x2d2652(0x21c)||_0x1d9840[_0x2d2652(0x19e)]==='Or')){const _0x2a786c=_0x1d9840;return{'type':_0x2a786c[_0x2d2652(0x19e)],'conditions':_0x2a786c[_0x2d2652(0x1cf)][_0x2d2652(0x21b)](yamlConditionToApi),..._0x2a786c[_0x2d2652(0x1f2)]&&{'description':_0x2a786c[_0x2d2652(0x1f2)]}};}if(_0x2d2652(0x228)in _0x1d9840&&_0x1d9840[_0x2d2652(0x19e)]===_0x2d2652(0x1c8)){const _0x1d5e04=_0x1d9840;return{'type':_0x2d2652(0x1c8),'column':_0x1d5e04[_0x2d2652(0x228)],'operator':yamlOperatorToApi(_0x1d5e04[_0x2d2652(0x1cd)])};}const _0x4b8538=_0x1d9840,_0x3c3b93={'type':_0x2d2652(0x196),'leftValue':buildLeftValue(_0x4b8538),'operator':yamlOperatorToApi(_0x4b8538['operator']),'exclude':_0x4b8538['exclude']??![],'arrayMatching':_0x4b8538[_0x2d2652(0x199)]??'any'};return _0x4b8538[_0x2d2652(0x1c3)]!==undefined&&(_0x3c3b93[_0x2d2652(0x1c3)]=_0x4b8538[_0x2d2652(0x1c3)]),_0x3c3b93;}function buildAggregationDefFromApi(_0x50bec7){const _0xe0f598=a126_0x2525,_0x594fe9=_0x50bec7[_0xe0f598(0x19e)];if(_0x594fe9===_0xe0f598(0x1ef))return{'type':_0x594fe9,'columns':_0x50bec7['columns']??[]};if(_0x594fe9===_0xe0f598(0x1a8)||_0x594fe9===_0xe0f598(0x206))return{'type':_0x594fe9,'column':_0x50bec7[_0xe0f598(0x228)]??'','orderColumn':_0x50bec7[_0xe0f598(0x1ea)]??'',..._0x50bec7[_0xe0f598(0x213)]&&{'groupingColumns':_0x50bec7[_0xe0f598(0x213)]}};if(_0x594fe9==='Count')return{'type':_0x594fe9,..._0x50bec7[_0xe0f598(0x213)]&&{'groupingColumns':_0x50bec7[_0xe0f598(0x213)]}};return{'type':_0x594fe9,'column':_0x50bec7[_0xe0f598(0x228)]??'',..._0x50bec7[_0xe0f598(0x213)]&&{'groupingColumns':_0x50bec7[_0xe0f598(0x213)]}};}function buildLeftValue(_0x276149){const _0x591831=a126_0x2525,_0x1b9625={};_0x276149['attribute']&&(_0x1b9625[_0x591831(0x217)]=_0x276149[_0x591831(0x1d3)]);if(_0x276149[_0x591831(0x200)]){const _0x33c6cf=_0x276149[_0x591831(0x200)];if(_0x33c6cf[_0x591831(0x19e)]==='CountDistinct')_0x1b9625[_0x591831(0x200)]={'type':_0x591831(0x1ef),'columns':_0x33c6cf[_0x591831(0x1db)]};else{if(_0x33c6cf[_0x591831(0x19e)]==='First'||_0x33c6cf['type']===_0x591831(0x206))_0x1b9625[_0x591831(0x200)]={'type':_0x33c6cf[_0x591831(0x19e)],'column':_0x33c6cf['column'],'orderColumn':_0x33c6cf[_0x591831(0x1ea)],..._0x33c6cf[_0x591831(0x213)]&&{'groupingColumns':_0x33c6cf[_0x591831(0x213)]}};else _0x33c6cf['type']==='Count'?_0x1b9625[_0x591831(0x200)]={'type':'Count',..._0x33c6cf['groupingColumns']&&{'groupingColumns':_0x33c6cf['groupingColumns']}}:_0x1b9625[_0x591831(0x200)]={'type':_0x33c6cf[_0x591831(0x19e)],'column':_0x33c6cf[_0x591831(0x228)],..._0x33c6cf[_0x591831(0x213)]&&{'groupingColumns':_0x33c6cf[_0x591831(0x213)]}};}}return _0x276149[_0x591831(0x1fc)]&&(_0x1b9625[_0x591831(0x1fc)]={'name':_0x276149[_0x591831(0x1fc)]}),_0x276149[_0x591831(0x1d6)]&&(_0x1b9625[_0x591831(0x1d6)]=yamlRuleToApi(filterRuleAsRuleDef(_0x276149[_0x591831(0x1d6)]))),_0x1b9625;}function yamlOperatorToApi(_0x4d5b9e){const _0x26564c=a126_0x2525,_0x521b59={'type':mapYamlOperatorType(_0x4d5b9e[_0x26564c(0x19e)]),'not':_0x4d5b9e[_0x26564c(0x1ba)]??![]};if(isBetweenOperator(_0x4d5b9e[_0x26564c(0x19e)]))return _0x4d5b9e[_0x26564c(0x203)]!==undefined&&(_0x521b59['minValue']=typeof _0x4d5b9e[_0x26564c(0x203)]===_0x26564c(0x1e9)?_0x4d5b9e[_0x26564c(0x203)]:String(_0x4d5b9e[_0x26564c(0x203)])),_0x4d5b9e[_0x26564c(0x1d4)]!==undefined&&(_0x521b59[_0x26564c(0x21f)]=typeof _0x4d5b9e[_0x26564c(0x1d4)]===_0x26564c(0x1e9)?_0x4d5b9e['max']:String(_0x4d5b9e[_0x26564c(0x1d4)])),_0x521b59;if(_0x4d5b9e['type']===_0x26564c(0x19a))return _0x4d5b9e[_0x26564c(0x1f8)]&&(_0x521b59[_0x26564c(0x1f8)]=_0x4d5b9e['duration']),_0x4d5b9e[_0x26564c(0x1a7)]&&(_0x521b59['from']=_0x4d5b9e[_0x26564c(0x1a7)]),_0x4d5b9e[_0x26564c(0x1ff)]!==undefined&&(_0x521b59[_0x26564c(0x1ff)]=_0x4d5b9e['reverse']),_0x521b59;const _0x2077e5=getEffectiveValue(_0x4d5b9e);if(_0x2077e5!==undefined){if(Array[_0x26564c(0x1d8)](_0x2077e5))_0x521b59[_0x26564c(0x190)]=_0x2077e5;else isTemporalOperator(_0x4d5b9e['type'])?_0x521b59[_0x26564c(0x1c0)]=_0x2077e5:_0x521b59[_0x26564c(0x1da)]=_0x2077e5;}return _0x4d5b9e[_0x26564c(0x1a1)]&&(_0x521b59[_0x26564c(0x1a1)]=_0x4d5b9e[_0x26564c(0x1a1)]),_0x521b59;}function mapYamlOperatorType(_0x2eff04){return _0x2eff04;}export function toYamlString(_0x37dfa6){const _0x46cbce=a126_0x2525,_0x961054=JSON[_0x46cbce(0x1a6)](JSON[_0x46cbce(0x20b)](_0x37dfa6)),_0xe5165b=a126_0x53c10e[_0x46cbce(0x20b)](_0x961054,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x46cbce(0x1fa)}),_0x4654ff=[_0x46cbce(0x1f1)];let _0x37db3b=_0xe5165b;for(const _0x242098 of _0x4654ff){_0x37db3b=_0x37db3b['replace'](new RegExp('^('+_0x242098+')','m'),(_0x59c2dd,_0x41f005,_0x1f86ee)=>{if(_0x1f86ee===0x0||_0x37db3b[_0x1f86ee-0x1]==='\x0a'&&_0x37db3b[_0x1f86ee-0x2]==='\x0a')return _0x41f005;return'\x0a'+_0x41f005;});}return _0x37db3b;}function a126_0x2306(){const _0x1b3ea8=['activationTemplateId','behaviorTableName','warnings','parse','from','First','include','visible','all','connector_config\x20for\x20activation\x20\x22','connectionId','Reference','\x27:\x20','join_row','formatting','notification','resolveSegmentName','New\x20Segment','9132600VqLCUU','folder','kind','5454393rdyNVK','segmentFolderId','not','repeatSubFrequency','Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections','1128nPGXOn','getSchema','replace','value','Between','join_strategy','limit','10xKEvMR','start_at','get','CONNECTION_NOT_FOUND','Column','repeatUnit','notifyOn','activationParams','minValue','operator','exclude','conditions','set','activation_template_id','realtime','attribute','max','1290iEdqzl','filter','CONNECTOR_INVALID_CONFIG','isArray','email_recipients','rightValue','columns','TimeWithinNext','JOURNEY_SYNTAX_ERROR','entries','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','funnel_stage','1086TnHiif','attributes','36410UKvrex','orderBy','INVALID_ARGUMENT','order_by','run_after_journey_refresh','runAfterJourneyRefresh','object','orderColumn','startAt','keys','segment','timezone','CountDistinct','behavior','rule:','description','every','push','any','length','sort','duration','leftValue','null','syndicationBehavior','source','localRuleToName','6620445EXYLEX','reverse','aggregation','usedNames','conditions[','min','has','emailRecipients','Last','end_on','connectionNameToTypeMap','24820NtbcQW','connector_config','stringify','endOn','Segment\x20description','localeCompare','isVisible','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','joinRow','toLowerCase','groupingColumns','values','repeat_unit','warn','name','connectionNameToIdMap','rule','all_columns','map','And','connection','add','maxValue','Behavior','allColumns','repeat_frequency','notify_on','28aaZywL','ruleHashToName','errors','__UNRESOLVED__','column','activations','repeat_sub_frequency','behavior_table','joinStrategy','repeatFrequency','connectorConfig','].attribute\x20cannot\x20be\x20empty.\x0a','rightValues','isFinite','__SEGMENT_REF__','scheduleType','visibility','schedule','Value','batch','14468399YkyWfE','arrayMatching','TimeRange','emailToIdMap','test','forEach','type','string','\x22:\x0a','unit','valid'];a126_0x2306=function(){return _0x1b3ea8;};return a126_0x2306();}export function parseYamlString(_0x5ea585){return parseSegmentYamlFile(_0x5ea585);}export function isSegmentYaml(_0x5317ed){const _0x4d6256=a126_0x2525;if(typeof _0x5317ed!==_0x4d6256(0x1e9)||_0x5317ed===null)return![];const _0x5695c6=_0x5317ed;return _0x5695c6[_0x4d6256(0x19e)]==='segment'||_0x5695c6[_0x4d6256(0x19e)]===undefined;}export function generateTemplate(_0x17576d=a126_0x13492b(0x1b4)){const _0x3c5ded=a126_0x13492b,_0x517dd0={'type':_0x3c5ded(0x1ed),'name':_0x17576d,'description':_0x3c5ded(0x20d),'rule':{'type':_0x3c5ded(0x21c),'conditions':[{'type':_0x3c5ded(0x196),'attribute':'attribute_name','operator':{'type':'Equal','value':_0x3c5ded(0x1c0)}}]}};return toYamlString(_0x517dd0);}export function segmentToYamlString(_0x59fc3e){const _0x3a2d1b=a126_0x13492b,_0x83324a=JSON[_0x3a2d1b(0x1a6)](JSON[_0x3a2d1b(0x20b)](_0x59fc3e)),_0x206e24=a126_0x53c10e['stringify'](_0x83324a,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x4e7d5e=[_0x3a2d1b(0x1f1),'activations:'];let _0x19774a=_0x206e24;for(const _0x3c5b97 of _0x4e7d5e){_0x19774a=_0x19774a[_0x3a2d1b(0x1bf)](new RegExp('^('+_0x3c5b97+')','m'),(_0x3b3868,_0x186c17,_0x4cf22c)=>{if(_0x4cf22c===0x0||_0x19774a[_0x4cf22c-0x1]==='\x0a'&&_0x19774a[_0x4cf22c-0x2]==='\x0a')return _0x186c17;return'\x0a'+_0x186c17;});}return _0x19774a;}export function parseSegmentYamlFile(_0x55938e){return safeParseYaml(_0x55938e,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x25f8dd){const _0x2a2390=a126_0x13492b;return{'type':_0x2a2390(0x1ed),'name':_0x25f8dd[_0x2a2390(0x217)],..._0x25f8dd[_0x2a2390(0x1f2)]!==undefined&&{'description':_0x25f8dd['description']},..._0x25f8dd[_0x2a2390(0x1b6)]!==undefined&&{'folder':_0x25f8dd[_0x2a2390(0x1b6)]},..._0x25f8dd['rule']&&{'rule':normalizeRule(_0x25f8dd[_0x2a2390(0x219)])},..._0x25f8dd['kind']!==undefined&&{'kind':_0x25f8dd[_0x2a2390(0x1b7)]},..._0x25f8dd['visible']!==undefined&&{'visible':_0x25f8dd[_0x2a2390(0x1aa)]},..._0x25f8dd[_0x2a2390(0x229)]&&{'activations':_0x25f8dd[_0x2a2390(0x229)][_0x2a2390(0x21b)](normalizeActivation)}};}export function normalizeRule(_0x1c27ec){const _0x4714d5=a126_0x13492b;return{'type':_0x1c27ec['type'],'conditions':_0x1c27ec['conditions']['map'](normalizeCondition),..._0x1c27ec['description']!==undefined&&{'description':_0x1c27ec[_0x4714d5(0x1f2)]}};}function normalizeCondition(_0x48471b){const _0x278924=a126_0x13492b;if('segment'in _0x48471b&&(_0x48471b[_0x278924(0x19e)]===_0x278924(0x1a9)||_0x48471b['type']===_0x278924(0x1ce))){const _0x49647e=_0x48471b;return{'type':_0x49647e[_0x278924(0x19e)],'segment':_0x49647e[_0x278924(0x1ed)]};}if(_0x278924(0x19e)in _0x48471b&&(_0x48471b[_0x278924(0x19e)]===_0x278924(0x21c)||_0x48471b[_0x278924(0x19e)]==='Or')){const _0x450d69=_0x48471b;return{'type':_0x450d69[_0x278924(0x19e)],'conditions':_0x450d69[_0x278924(0x1cf)][_0x278924(0x21b)](normalizeCondition),..._0x450d69[_0x278924(0x1f2)]!==undefined&&{'description':_0x450d69[_0x278924(0x1f2)]}};}if(_0x278924(0x228)in _0x48471b&&_0x48471b[_0x278924(0x19e)]===_0x278924(0x1c8)){const _0x1c7dbf=_0x48471b;return{'type':_0x278924(0x1c8),'column':_0x1c7dbf['column'],'operator':normalizeOperator(_0x1c7dbf[_0x278924(0x1cd)])};}const _0x3584fb=_0x48471b;return{'type':'Value','attribute':_0x3584fb['attribute'],'operator':normalizeOperator(_0x3584fb[_0x278924(0x1cd)]),..._0x3584fb['arrayMatching']!==undefined&&{'arrayMatching':_0x3584fb[_0x278924(0x199)]},..._0x3584fb[_0x278924(0x1ce)]!==undefined&&{'exclude':_0x3584fb[_0x278924(0x1ce)]},..._0x3584fb[_0x278924(0x200)]!==undefined&&{'aggregation':_0x3584fb[_0x278924(0x200)]},..._0x3584fb[_0x278924(0x1fc)]!==undefined&&{'source':_0x3584fb['source']},..._0x3584fb[_0x278924(0x1d6)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x3584fb[_0x278924(0x1d6)])))},..._0x3584fb[_0x278924(0x1c3)]!==undefined&&{'limit':_0x3584fb[_0x278924(0x1c3)]}};}function normalizeOperator(_0x4556e3){const _0x2b90db=a126_0x13492b;if(isBetweenOperator(_0x4556e3['type']))return{'type':_0x4556e3[_0x2b90db(0x19e)],..._0x4556e3[_0x2b90db(0x1ba)]!==undefined&&{'not':_0x4556e3[_0x2b90db(0x1ba)]},..._0x4556e3[_0x2b90db(0x203)]!==undefined&&{'min':_0x4556e3[_0x2b90db(0x203)]},..._0x4556e3['max']!==undefined&&{'max':_0x4556e3[_0x2b90db(0x1d4)]}};const _0x16f5c0=getEffectiveValue(_0x4556e3);return{'type':_0x4556e3['type'],..._0x4556e3[_0x2b90db(0x1ba)]!==undefined&&{'not':_0x4556e3[_0x2b90db(0x1ba)]},..._0x16f5c0!==undefined&&{'value':_0x16f5c0},..._0x4556e3[_0x2b90db(0x1a1)]!==undefined&&{'unit':_0x4556e3[_0x2b90db(0x1a1)]},..._0x4556e3[_0x2b90db(0x1f8)]!==undefined&&{'duration':_0x4556e3['duration']},..._0x4556e3[_0x2b90db(0x1a7)]!==undefined&&{'from':_0x4556e3['from']},..._0x4556e3[_0x2b90db(0x1ff)]!==undefined&&{'reverse':_0x4556e3[_0x2b90db(0x1ff)]}};}function normalizeActivation(_0x179268){const _0x10724f=a126_0x13492b;return{'name':_0x179268[_0x10724f(0x217)],'connection':_0x179268['connection'],..._0x179268[_0x10724f(0x1f2)]!==undefined&&{'description':_0x179268['description']},..._0x179268[_0x10724f(0x21a)]!==undefined&&{'all_columns':_0x179268['all_columns']},..._0x179268[_0x10724f(0x1db)]!==undefined&&{'columns':_0x179268[_0x10724f(0x1db)]},..._0x179268[_0x10724f(0x1f0)]!==undefined&&{'behavior':_0x179268[_0x10724f(0x1f0)]},..._0x179268[_0x10724f(0x195)]!==undefined&&{'schedule':_0x179268[_0x10724f(0x195)]},..._0x179268[_0x10724f(0x1b2)]!==undefined&&{'notification':_0x179268[_0x10724f(0x1b2)]},..._0x179268[_0x10724f(0x20a)]!==undefined&&{'connector_config':_0x179268[_0x10724f(0x20a)]},..._0x179268[_0x10724f(0x1d1)]!==undefined&&{'activation_template_id':_0x179268[_0x10724f(0x1d1)]}};}export function activationResponseToDef(_0x1ae2cd,_0x175fdc,_0xe94835){const _0x3dc06f=a126_0x13492b,_0x17d76a=_0x1ae2cd[_0x3dc06f(0x1ad)]||'',_0x310867=_0xe94835?.[_0x3dc06f(0x1c6)](_0x17d76a)??_0x17d76a,_0x1c1117={'name':_0x1ae2cd['name'],'connection':_0x310867};_0x1ae2cd['description']&&(_0x1c1117[_0x3dc06f(0x1f2)]=_0x1ae2cd['description']);let _0x49b841=[];_0x1ae2cd['columns']&&_0x1ae2cd[_0x3dc06f(0x1db)][_0x3dc06f(0x1f6)]>0x0&&(_0x49b841=_0x1ae2cd[_0x3dc06f(0x1db)][_0x3dc06f(0x1d6)](_0x1974e4=>_0x1974e4&&_0x1974e4[_0x3dc06f(0x217)])['map'](_0xf6381c=>{const _0x198eee=_0x3dc06f;if(_0xf6381c[_0x198eee(0x19e)]||_0xf6381c[_0x198eee(0x194)])return{'name':_0xf6381c[_0x198eee(0x217)],..._0xf6381c[_0x198eee(0x19e)]&&{'type':_0xf6381c[_0x198eee(0x19e)]},..._0xf6381c[_0x198eee(0x194)]&&{'visibility':_0xf6381c[_0x198eee(0x194)]}};return _0xf6381c[_0x198eee(0x217)];}));_0x49b841[_0x3dc06f(0x1f6)]>0x0&&(_0x1c1117[_0x3dc06f(0x1db)]=_0x49b841);_0x1ae2cd[_0x3dc06f(0x221)]!==undefined&&(_0x1ae2cd[_0x3dc06f(0x221)]===![]&&_0x49b841[_0x3dc06f(0x1f6)]===0x0?_0x1c1117[_0x3dc06f(0x21a)]=!![]:_0x1c1117['all_columns']=_0x1ae2cd['allColumns']);const _0x31b3b2={};let _0x5999e6=![];_0x1ae2cd[_0x3dc06f(0x193)]&&(_0x31b3b2[_0x3dc06f(0x19e)]=_0x1ae2cd[_0x3dc06f(0x193)],_0x5999e6=!![]);_0x1ae2cd[_0x3dc06f(0x1c9)]&&(_0x31b3b2[_0x3dc06f(0x215)]=_0x1ae2cd['repeatUnit'],_0x5999e6=!![]);_0x1ae2cd[_0x3dc06f(0x22d)]!==undefined&&_0x1ae2cd[_0x3dc06f(0x22d)]!==null&&(_0x31b3b2[_0x3dc06f(0x222)]=_0x1ae2cd[_0x3dc06f(0x22d)],_0x5999e6=!![]);_0x1ae2cd[_0x3dc06f(0x1bb)]&&_0x1ae2cd['repeatSubFrequency']['length']>0x0&&(_0x31b3b2[_0x3dc06f(0x22a)]=_0x1ae2cd[_0x3dc06f(0x1bb)],_0x5999e6=!![]);_0x1ae2cd[_0x3dc06f(0x1eb)]!==undefined&&(_0x31b3b2[_0x3dc06f(0x1c5)]=_0x1ae2cd[_0x3dc06f(0x1eb)],_0x5999e6=!![]);_0x1ae2cd['endOn']!==undefined&&(_0x31b3b2[_0x3dc06f(0x207)]=_0x1ae2cd[_0x3dc06f(0x20c)],_0x5999e6=!![]);_0x1ae2cd['timezone']&&(_0x31b3b2[_0x3dc06f(0x1ee)]=_0x1ae2cd[_0x3dc06f(0x1ee)],_0x5999e6=!![]);_0x5999e6&&(_0x1c1117[_0x3dc06f(0x195)]=_0x31b3b2);(_0x1ae2cd[_0x3dc06f(0x1ca)]&&_0x1ae2cd[_0x3dc06f(0x1ca)][_0x3dc06f(0x1f6)]>0x0||_0x1ae2cd[_0x3dc06f(0x205)]&&_0x1ae2cd[_0x3dc06f(0x205)][_0x3dc06f(0x1f6)]>0x0)&&(_0x1c1117[_0x3dc06f(0x1b2)]={},_0x1ae2cd[_0x3dc06f(0x1ca)]&&_0x1ae2cd['notifyOn'][_0x3dc06f(0x1f6)]>0x0&&(_0x1c1117['notification'][_0x3dc06f(0x223)]=_0x1ae2cd[_0x3dc06f(0x1ca)]),_0x1ae2cd[_0x3dc06f(0x205)]&&_0x1ae2cd[_0x3dc06f(0x205)]['length']>0x0&&(_0x1c1117[_0x3dc06f(0x1b2)][_0x3dc06f(0x1d9)]=_0x1ae2cd['emailRecipients'][_0x3dc06f(0x21b)](_0xabf61e=>{const _0x4bc684=_0x175fdc?.['get'](_0xabf61e);return _0x4bc684??String(_0xabf61e);})));_0x1ae2cd[_0x3dc06f(0x18e)]&&Object[_0x3dc06f(0x1ec)](_0x1ae2cd[_0x3dc06f(0x18e)])[_0x3dc06f(0x1f6)]>0x0&&(_0x1c1117[_0x3dc06f(0x20a)]=normalizeConnectorConfigForYaml(_0x1ae2cd['connectorConfig']));_0x1ae2cd[_0x3dc06f(0x1a3)]&&(_0x1c1117['activation_template_id']=_0x1ae2cd[_0x3dc06f(0x1a3)]);if(_0x1ae2cd[_0x3dc06f(0x1fb)]){const _0x15d3d3={},_0x539a9e=_0x1ae2cd[_0x3dc06f(0x1fb)];_0x539a9e[_0x3dc06f(0x1db)]&&_0x539a9e[_0x3dc06f(0x1db)][_0x3dc06f(0x1f6)]>0x0&&(_0x15d3d3['columns']=_0x539a9e[_0x3dc06f(0x1db)]['filter'](_0x5d1629=>_0x5d1629&&_0x5d1629[_0x3dc06f(0x217)])[_0x3dc06f(0x21b)](_0xe07df5=>({'name':_0xe07df5[_0x3dc06f(0x217)],..._0xe07df5[_0x3dc06f(0x19e)]&&{'type':_0xe07df5[_0x3dc06f(0x19e)]},..._0xe07df5[_0x3dc06f(0x194)]&&{'visibility':_0xe07df5['visibility']}}))),_0x539a9e[_0x3dc06f(0x1a4)]&&(_0x15d3d3[_0x3dc06f(0x22b)]=_0x539a9e['behaviorTableName']),_0x539a9e[_0x3dc06f(0x211)]!==undefined&&(_0x15d3d3['join_row']=_0x539a9e[_0x3dc06f(0x211)]),_0x539a9e[_0x3dc06f(0x22c)]&&(_0x15d3d3['join_strategy']=_0x539a9e[_0x3dc06f(0x22c)]),_0x539a9e[_0x3dc06f(0x1b1)]&&(_0x15d3d3[_0x3dc06f(0x1b1)]=_0x539a9e[_0x3dc06f(0x1b1)]),_0x539a9e[_0x3dc06f(0x1e4)]&&_0x539a9e[_0x3dc06f(0x1e4)]['length']>0x0&&(_0x15d3d3[_0x3dc06f(0x1e6)]=_0x539a9e['orderBy']),Object[_0x3dc06f(0x1ec)](_0x15d3d3)[_0x3dc06f(0x1f6)]>0x0&&(_0x1c1117['behavior']=_0x15d3d3);}return _0x1c1117;}export function journeyActivationStepToYaml(_0x1d290e,_0x19a7ca,_0x12e1d2){const _0x46d7bf=a126_0x13492b,_0x3d8e27=_0x1d290e[_0x46d7bf(0x1e2)][_0x46d7bf(0x1cb)],_0x520ccf=_0x3d8e27[_0x46d7bf(0x1ad)]||'',_0x46ef9d=_0x12e1d2?.[_0x46d7bf(0x1c6)](_0x520ccf)??_0x520ccf,_0x3ba416={'name':_0x3d8e27[_0x46d7bf(0x217)]||'','connection':_0x46ef9d};_0x1d290e[_0x46d7bf(0x1e2)][_0x46d7bf(0x1e8)]&&(_0x3ba416[_0x46d7bf(0x1e7)]=!![]);_0x3d8e27['description']&&(_0x3ba416[_0x46d7bf(0x1f2)]=_0x3d8e27[_0x46d7bf(0x1f2)]);let _0x31c555=[];_0x3d8e27[_0x46d7bf(0x1db)]&&_0x3d8e27[_0x46d7bf(0x1db)]['length']>0x0&&(_0x31c555=_0x3d8e27[_0x46d7bf(0x1db)][_0x46d7bf(0x1d6)](_0x3d5878=>_0x3d5878&&_0x3d5878['name'])[_0x46d7bf(0x21b)](_0x42a2bd=>{const _0x3bf3ba=_0x46d7bf;if(_0x42a2bd[_0x3bf3ba(0x19e)]||_0x42a2bd[_0x3bf3ba(0x194)])return{'name':_0x42a2bd[_0x3bf3ba(0x217)],..._0x42a2bd[_0x3bf3ba(0x19e)]&&{'type':_0x42a2bd[_0x3bf3ba(0x19e)]},..._0x42a2bd['visibility']&&{'visibility':_0x42a2bd[_0x3bf3ba(0x194)]}};return _0x42a2bd['name'];}));_0x31c555[_0x46d7bf(0x1f6)]>0x0&&(_0x3ba416[_0x46d7bf(0x1db)]=_0x31c555);_0x3d8e27['allColumns']!==undefined&&(_0x3d8e27['allColumns']===![]&&_0x31c555[_0x46d7bf(0x1f6)]===0x0?_0x3ba416[_0x46d7bf(0x21a)]=!![]:_0x3ba416[_0x46d7bf(0x21a)]=_0x3d8e27['allColumns']);const _0x5db8ac={};let _0x57989b=![];_0x3d8e27[_0x46d7bf(0x193)]&&(_0x5db8ac[_0x46d7bf(0x19e)]=_0x3d8e27[_0x46d7bf(0x193)],_0x57989b=!![]);_0x3d8e27[_0x46d7bf(0x1c9)]&&(_0x5db8ac[_0x46d7bf(0x215)]=_0x3d8e27['repeatUnit'],_0x57989b=!![]);_0x3d8e27[_0x46d7bf(0x22d)]!==undefined&&_0x3d8e27[_0x46d7bf(0x22d)]!==null&&(_0x5db8ac['repeat_frequency']=_0x3d8e27[_0x46d7bf(0x22d)],_0x57989b=!![]);_0x3d8e27[_0x46d7bf(0x1eb)]!==undefined&&(_0x5db8ac[_0x46d7bf(0x1c5)]=_0x3d8e27[_0x46d7bf(0x1eb)],_0x57989b=!![]);_0x3d8e27[_0x46d7bf(0x20c)]!==undefined&&(_0x5db8ac[_0x46d7bf(0x207)]=_0x3d8e27[_0x46d7bf(0x20c)],_0x57989b=!![]);_0x3d8e27[_0x46d7bf(0x1ee)]&&(_0x5db8ac[_0x46d7bf(0x1ee)]=_0x3d8e27[_0x46d7bf(0x1ee)],_0x57989b=!![]);_0x57989b&&(_0x3ba416[_0x46d7bf(0x195)]=_0x5db8ac);(_0x3d8e27[_0x46d7bf(0x1ca)]&&_0x3d8e27[_0x46d7bf(0x1ca)]['length']>0x0||_0x3d8e27[_0x46d7bf(0x205)]&&_0x3d8e27[_0x46d7bf(0x205)]['length']>0x0)&&(_0x3ba416[_0x46d7bf(0x1b2)]={},_0x3d8e27[_0x46d7bf(0x1ca)]&&_0x3d8e27['notifyOn'][_0x46d7bf(0x1f6)]>0x0&&(_0x3ba416[_0x46d7bf(0x1b2)][_0x46d7bf(0x223)]=_0x3d8e27['notifyOn']),_0x3d8e27['emailRecipients']&&_0x3d8e27[_0x46d7bf(0x205)][_0x46d7bf(0x1f6)]>0x0&&(_0x3ba416[_0x46d7bf(0x1b2)][_0x46d7bf(0x1d9)]=_0x3d8e27[_0x46d7bf(0x205)][_0x46d7bf(0x21b)](_0x397380=>{const _0x429b03=_0x19a7ca?.['get'](_0x397380);return _0x429b03??String(_0x397380);})));_0x3d8e27[_0x46d7bf(0x18e)]&&Object['keys'](_0x3d8e27[_0x46d7bf(0x18e)])[_0x46d7bf(0x1f6)]>0x0&&(_0x3ba416['connector_config']=normalizeConnectorConfigForYaml(_0x3d8e27[_0x46d7bf(0x18e)]));_0x3d8e27[_0x46d7bf(0x1a3)]&&(_0x3ba416[_0x46d7bf(0x1d1)]=_0x3d8e27[_0x46d7bf(0x1a3)]);if(_0x3d8e27[_0x46d7bf(0x1fb)]){const _0x1f0f97={},_0x4c25ca=_0x3d8e27[_0x46d7bf(0x1fb)];_0x4c25ca['columns']&&_0x4c25ca[_0x46d7bf(0x1db)][_0x46d7bf(0x1f6)]>0x0&&(_0x1f0f97[_0x46d7bf(0x1db)]=_0x4c25ca[_0x46d7bf(0x1db)][_0x46d7bf(0x1d6)](_0x1e8f78=>_0x1e8f78&&_0x1e8f78['name'])[_0x46d7bf(0x21b)](_0x410f20=>({'name':_0x410f20[_0x46d7bf(0x217)],..._0x410f20[_0x46d7bf(0x19e)]&&{'type':_0x410f20['type']},..._0x410f20['visibility']&&{'visibility':_0x410f20[_0x46d7bf(0x194)]}}))),_0x4c25ca['behaviorTableName']&&(_0x1f0f97[_0x46d7bf(0x22b)]=_0x4c25ca[_0x46d7bf(0x1a4)]),_0x4c25ca['joinRow']!==undefined&&(_0x1f0f97[_0x46d7bf(0x1b0)]=_0x4c25ca['joinRow']),_0x4c25ca[_0x46d7bf(0x22c)]&&(_0x1f0f97[_0x46d7bf(0x1c2)]=_0x4c25ca['joinStrategy']),_0x4c25ca[_0x46d7bf(0x1b1)]&&(_0x1f0f97['formatting']=_0x4c25ca[_0x46d7bf(0x1b1)]),_0x4c25ca['orderBy']&&_0x4c25ca[_0x46d7bf(0x1e4)][_0x46d7bf(0x1f6)]>0x0&&(_0x1f0f97['order_by']=_0x4c25ca[_0x46d7bf(0x1e4)]),Object['keys'](_0x1f0f97)['length']>0x0&&(_0x3ba416[_0x46d7bf(0x1f0)]=_0x1f0f97);}return _0x3ba416;}export function segmentWithActivationsToYaml(_0xfdeb26,_0x22d4fd,_0x47bc22,_0x3531ef,_0xe37fb7){const _0xedfef6=a126_0x13492b,_0x302b92=segmentResponseToDefSync(_0xfdeb26,_0x47bc22);return _0x22d4fd[_0xedfef6(0x1f6)]>0x0&&(_0x302b92['activations']=_0x22d4fd[_0xedfef6(0x21b)](_0x26ef46=>activationResponseToDef(_0x26ef46,_0x3531ef,_0xe37fb7))),_0x302b92;}function normalizeColumn(_0x23d342){const _0x24dc4a=a126_0x13492b;if(typeof _0x23d342===_0x24dc4a(0x19f))return{'name':_0x23d342};return{'name':_0x23d342[_0x24dc4a(0x217)],..._0x23d342[_0x24dc4a(0x19e)]&&{'type':_0x23d342['type']},..._0x23d342[_0x24dc4a(0x194)]&&{'visibility':_0x23d342[_0x24dc4a(0x194)]}};}export async function activationDefToCreateRequest(_0x30d72a,_0x49c2de){const _0x4789e3=a126_0x13492b,_0x2b6bf2=_0x49c2de?.[_0x4789e3(0x19b)],_0x4dc832=_0x49c2de?.[_0x4789e3(0x218)],_0x1bd20b=_0x30d72a[_0x4789e3(0x21d)];let _0xc0bd07;const _0x50b594=parseInt(_0x1bd20b,0xa);if(!isNaN(_0x50b594)&&String(_0x50b594)===_0x1bd20b)_0xc0bd07=_0x50b594;else{const _0x383986=_0x4dc832?.[_0x4789e3(0x1c6)](_0x1bd20b);if(_0x383986===undefined)throw new SDKError(ErrorCode[_0x4789e3(0x1c7)],'Unknown\x20connection:\x20'+_0x1bd20b,undefined,{'helpText':_0x4789e3(0x1bc)});_0xc0bd07=_0x383986;}const _0x2bf624={'name':_0x30d72a[_0x4789e3(0x217)],'connectionId':_0xc0bd07};_0x30d72a[_0x4789e3(0x1f2)]&&(_0x2bf624['description']=_0x30d72a[_0x4789e3(0x1f2)]);let _0x127367=[];_0x30d72a[_0x4789e3(0x1db)]&&_0x30d72a['columns'][_0x4789e3(0x1f6)]>0x0&&(_0x127367=_0x30d72a[_0x4789e3(0x1db)]['filter'](_0x5ee954=>_0x5ee954!=null)[_0x4789e3(0x21b)](normalizeColumn));_0x127367[_0x4789e3(0x1f6)]>0x0&&(_0x2bf624[_0x4789e3(0x1db)]=_0x127367);_0x30d72a[_0x4789e3(0x21a)]!==undefined&&(_0x30d72a[_0x4789e3(0x21a)]===![]&&_0x127367[_0x4789e3(0x1f6)]===0x0?_0x2bf624['allColumns']=!![]:_0x2bf624[_0x4789e3(0x221)]=_0x30d72a[_0x4789e3(0x21a)]);if(_0x30d72a[_0x4789e3(0x195)]){const _0x19f610=_0x30d72a[_0x4789e3(0x195)];_0x19f610[_0x4789e3(0x19e)]&&(_0x2bf624[_0x4789e3(0x193)]=_0x19f610[_0x4789e3(0x19e)]),_0x19f610['repeat_unit']&&(_0x2bf624[_0x4789e3(0x1c9)]=_0x19f610[_0x4789e3(0x215)]),_0x19f610[_0x4789e3(0x222)]!==undefined&&(_0x2bf624[_0x4789e3(0x22d)]=_0x19f610[_0x4789e3(0x222)]),_0x19f610[_0x4789e3(0x22a)]&&(_0x2bf624[_0x4789e3(0x1bb)]=_0x19f610['repeat_sub_frequency']),_0x19f610[_0x4789e3(0x1c5)]!==undefined&&(_0x2bf624['startAt']=_0x19f610[_0x4789e3(0x1c5)]),_0x19f610[_0x4789e3(0x207)]!==undefined&&(_0x2bf624[_0x4789e3(0x20c)]=_0x19f610[_0x4789e3(0x207)]),_0x19f610[_0x4789e3(0x1ee)]&&(_0x2bf624[_0x4789e3(0x1ee)]=_0x19f610[_0x4789e3(0x1ee)]);}_0x30d72a[_0x4789e3(0x1b2)]&&(_0x30d72a[_0x4789e3(0x1b2)][_0x4789e3(0x223)]&&(_0x2bf624[_0x4789e3(0x1ca)]=_0x30d72a['notification'][_0x4789e3(0x223)]),_0x30d72a[_0x4789e3(0x1b2)]['email_recipients']&&(_0x2bf624['emailRecipients']=_0x30d72a[_0x4789e3(0x1b2)]['email_recipients'][_0x4789e3(0x21b)](_0x1846fd=>{const _0x5378ef=_0x4789e3,_0x436574=Number(_0x1846fd);if(!isNaN(_0x436574)&&String(_0x436574)===_0x1846fd)return _0x436574;const _0x40a81c=_0x2b6bf2?.[_0x5378ef(0x1c6)](_0x1846fd[_0x5378ef(0x212)]());if(_0x40a81c===undefined)throw new SDKError(ErrorCode[_0x5378ef(0x1e5)],'Unknown\x20email\x20recipient:\x20'+_0x1846fd+_0x5378ef(0x210));return _0x40a81c;})));if(_0x30d72a[_0x4789e3(0x20a)]){const _0x147dc2=_0x49c2de?.[_0x4789e3(0x208)]?.[_0x4789e3(0x1c6)](_0x1bd20b);if(_0x147dc2&&_0x49c2de?.[_0x4789e3(0x1be)])try{const _0x4e379d=await _0x49c2de[_0x4789e3(0x1be)](_0x147dc2),_0x589a78=validateConnectorConfig(_0x30d72a[_0x4789e3(0x20a)],_0x4e379d);if(!_0x589a78[_0x4789e3(0x1a2)])throw new SDKError(ErrorCode[_0x4789e3(0x1d7)],'Invalid\x20connector_config\x20for\x20activation\x20\x22'+_0x30d72a[_0x4789e3(0x217)]+_0x4789e3(0x1a0)+formatValidationErrors(_0x589a78[_0x4789e3(0x226)]),undefined,{'helpText':'Connector:\x20'+_0x147dc2+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x4e379d)});if(_0x589a78['warnings'][_0x4789e3(0x1f6)]>0x0){const _0x3f0a40=formatValidationWarnings(_0x589a78[_0x4789e3(0x1a5)]);console[_0x4789e3(0x216)](_0x4789e3(0x1ac)+_0x30d72a[_0x4789e3(0x217)]+_0x4789e3(0x1a0)+_0x3f0a40);}_0x2bf624['connectorConfig']=transformConfigToLegacy(_0x30d72a[_0x4789e3(0x20a)],_0x4e379d);}catch(_0x27a9a7){if(_0x27a9a7 instanceof SDKError&&_0x27a9a7['code']===ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])_0x2bf624[_0x4789e3(0x18e)]=_0x30d72a[_0x4789e3(0x20a)];else throw _0x27a9a7;}else _0x2bf624[_0x4789e3(0x18e)]=_0x30d72a[_0x4789e3(0x20a)];}_0x30d72a[_0x4789e3(0x1d1)]!==undefined&&(_0x2bf624[_0x4789e3(0x1a3)]=_0x30d72a['activation_template_id']);if(_0x30d72a[_0x4789e3(0x1f0)]){const _0x510643=_0x30d72a['behavior'],_0x2bf3c8={};if(_0x510643['columns']&&_0x510643[_0x4789e3(0x1db)][_0x4789e3(0x1f6)]>0x0){const _0x4d0472=_0x510643[_0x4789e3(0x1db)][_0x4789e3(0x1d6)](_0x258847=>_0x258847&&_0x258847[_0x4789e3(0x217)]);_0x4d0472[_0x4789e3(0x1f6)]>0x0&&(_0x2bf3c8[_0x4789e3(0x1db)]=_0x4d0472);}_0x510643[_0x4789e3(0x22b)]&&(_0x2bf3c8[_0x4789e3(0x1a4)]=_0x510643[_0x4789e3(0x22b)]),_0x510643[_0x4789e3(0x1b0)]!==undefined&&(_0x2bf3c8[_0x4789e3(0x211)]=_0x510643[_0x4789e3(0x1b0)]),_0x510643[_0x4789e3(0x1c2)]&&(_0x2bf3c8['joinStrategy']=_0x510643[_0x4789e3(0x1c2)]),_0x510643[_0x4789e3(0x1b1)]&&(_0x2bf3c8[_0x4789e3(0x1b1)]=_0x510643[_0x4789e3(0x1b1)]),_0x510643[_0x4789e3(0x1e6)]&&(_0x2bf3c8[_0x4789e3(0x1e4)]=_0x510643[_0x4789e3(0x1e6)]),_0x2bf624[_0x4789e3(0x1fb)]=_0x2bf3c8;}return _0x2bf624;}export async function activationDefToUpdateRequest(_0x40d466,_0x255638){return activationDefToCreateRequest(_0x40d466,_0x255638);}export function deepSortObject(_0x5ed0a4){const _0x792d47=a126_0x13492b;if(_0x5ed0a4===null||typeof _0x5ed0a4!==_0x792d47(0x1e9))return _0x5ed0a4;if(Array[_0x792d47(0x1d8)](_0x5ed0a4))return _0x5ed0a4[_0x792d47(0x21b)](deepSortObject)[_0x792d47(0x1f7)]((_0x2e655f,_0x335ef1)=>JSON[_0x792d47(0x20b)](_0x2e655f)[_0x792d47(0x20e)](JSON[_0x792d47(0x20b)](_0x335ef1)));const _0x51a9b7={};for(const _0x1ca4c1 of Object['keys'](_0x5ed0a4)[_0x792d47(0x1f7)]()){_0x51a9b7[_0x1ca4c1]=deepSortObject(_0x5ed0a4[_0x1ca4c1]);}return _0x51a9b7;}export function serializeRule(_0x37bcdb){return JSON['stringify'](deepSortObject(_0x37bcdb));}export function normalizeRuleForMatching(_0x3958d6){return normalizeConditionsForMatching(_0x3958d6);}function normalizeConditionsForMatching(_0x2f9e95){const _0x3fac01=a126_0x13492b;if(_0x2f9e95===null||typeof _0x2f9e95!==_0x3fac01(0x1e9))return _0x2f9e95;if(Array[_0x3fac01(0x1d8)](_0x2f9e95))return _0x2f9e95[_0x3fac01(0x21b)](normalizeConditionsForMatching);const _0x2ec093=_0x2f9e95;if((_0x2ec093[_0x3fac01(0x19e)]===_0x3fac01(0x1a9)||_0x2ec093[_0x3fac01(0x19e)]==='exclude')&&typeof _0x2ec093[_0x3fac01(0x1ed)]===_0x3fac01(0x19f))return{..._0x2ec093,'segment':_0x3fac01(0x192)};const _0x571335={};for(const _0x39a9e5 of Object[_0x3fac01(0x1ec)](_0x2ec093)){_0x571335[_0x39a9e5]=normalizeConditionsForMatching(_0x2ec093[_0x39a9e5]);}return _0x571335;}export function serializeRuleForMatching(_0x129b96){const _0x20bf95=a126_0x13492b;return JSON[_0x20bf95(0x20b)](deepSortObject(normalizeRuleForMatching(_0x129b96)));}export function expandSegmentReferences(_0x1f4fe2,_0x2f086b,_0x4c1dc=new Set()){return expandConditions(_0x1f4fe2,_0x2f086b,_0x4c1dc);}function a126_0x2525(_0x2cd5f5,_0x5aa1d4){_0x2cd5f5=_0x2cd5f5-0x18e;const _0x23061b=a126_0x2306();let _0x25251f=_0x23061b[_0x2cd5f5];return _0x25251f;}function expandConditions(_0x135ff7,_0x49a8e8,_0x8a88a6){const _0x12160c=a126_0x13492b;if(_0x135ff7===null||typeof _0x135ff7!==_0x12160c(0x1e9))return _0x135ff7;if(Array[_0x12160c(0x1d8)](_0x135ff7))return _0x135ff7[_0x12160c(0x21b)](_0x51869f=>expandConditions(_0x51869f,_0x49a8e8,_0x8a88a6));const _0x18fa56=_0x135ff7;if((_0x18fa56[_0x12160c(0x19e)]===_0x12160c(0x1a9)||_0x18fa56[_0x12160c(0x19e)]===_0x12160c(0x1ce))&&typeof _0x18fa56[_0x12160c(0x1ed)]===_0x12160c(0x19f)){const _0x1d6e9d=_0x18fa56[_0x12160c(0x1ed)],_0x100fe1=_0x49a8e8[_0x12160c(0x1c6)](_0x1d6e9d);if(_0x100fe1&&!_0x8a88a6[_0x12160c(0x204)](_0x1d6e9d)){const _0x2353f8=new Set(_0x8a88a6);_0x2353f8[_0x12160c(0x21e)](_0x1d6e9d);const _0x40cc06=expandConditions(_0x100fe1,_0x49a8e8,_0x2353f8);return{'type':_0x18fa56[_0x12160c(0x19e)],'expanded_rule':_0x40cc06};}return{'type':_0x18fa56['type'],'expanded_rule':_0x12160c(0x227)};}const _0xcfee46={};for(const _0x2c786f of Object[_0x12160c(0x1ec)](_0x18fa56)){_0xcfee46[_0x2c786f]=expandConditions(_0x18fa56[_0x2c786f],_0x49a8e8,_0x8a88a6);}return _0xcfee46;}export function serializeExpandedRule(_0x370600,_0x197763){const _0x484a44=a126_0x13492b,_0xe4e6b6=expandSegmentReferences(_0x370600,_0x197763);return JSON[_0x484a44(0x20b)](deepSortObject(_0xe4e6b6));}export function createSegmentNameContext(_0x2866dc){const _0xbab585=a126_0x13492b,_0x22701e=new Set(),_0x511284=new Map(),_0x21fc59=new Map();if(_0x2866dc)for(const [_0x2eeb3a,_0x157956]of Object[_0xbab585(0x1de)](_0x2866dc)){if(_0x157956[_0xbab585(0x219)]){const _0x4ffe7b=serializeRule(_0x157956[_0xbab585(0x219)]);_0x21fc59[_0xbab585(0x1d0)](_0x4ffe7b,_0x2eeb3a),_0x22701e[_0xbab585(0x21e)](_0x2eeb3a);}}return{'usedNames':_0x22701e,'ruleHashToName':_0x511284,'localRuleToName':_0x2866dc?_0x21fc59:undefined};}export function resolveSegmentName(_0x15fc28,_0x147dfc,_0x28b019,_0x5ddb05){const _0x80344=a126_0x13492b,_0x5e96ce=serializeRule(_0x147dfc);if(_0x28b019[_0x80344(0x1fd)]){const _0x4b13cb=_0x28b019[_0x80344(0x1fd)][_0x80344(0x1c6)](_0x5e96ce);if(_0x4b13cb)return{'name':_0x4b13cb,'isDuplicate':![],'isLocalMatch':!![]};}const _0x120fd2=_0x28b019['ruleHashToName'][_0x80344(0x1c6)](_0x5e96ce);if(_0x120fd2)return{'name':_0x120fd2,'isDuplicate':!![],'isLocalMatch':![]};const _0x4a5e8f=_0x5ddb05(_0x15fc28);let _0x29a302=_0x4a5e8f||_0x15fc28,_0x4a81e0=_0x29a302,_0x325dbb=0x2;while(_0x28b019[_0x80344(0x201)][_0x80344(0x204)](_0x4a81e0)){_0x4a81e0=_0x29a302+'_'+_0x325dbb,_0x325dbb++;}return _0x28b019[_0x80344(0x201)]['add'](_0x4a81e0),_0x28b019[_0x80344(0x225)][_0x80344(0x1d0)](_0x5e96ce,_0x4a81e0),{'name':_0x4a81e0,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x159987){const _0x25d08c=[],_0x147b12=_0x51544f=>{const _0x2c6365=a126_0x2525;if(!_0x51544f||typeof _0x51544f!==_0x2c6365(0x1e9))return;if(Array[_0x2c6365(0x1d8)](_0x51544f)){_0x51544f[_0x2c6365(0x19d)](_0x147b12);return;}const _0x3ced52=_0x51544f;(_0x3ced52[_0x2c6365(0x19e)]===_0x2c6365(0x1a9)||_0x3ced52[_0x2c6365(0x19e)]==='exclude')&&typeof _0x3ced52[_0x2c6365(0x1ed)]===_0x2c6365(0x19f)&&_0x25d08c[_0x2c6365(0x1f4)](_0x3ced52[_0x2c6365(0x1ed)]);for(const _0x338cf0 of Object[_0x2c6365(0x214)](_0x3ced52)){_0x147b12(_0x338cf0);}};return _0x147b12(_0x159987),_0x25d08c;}export function validateSegmentRule(_0x56899e,_0x3d521f){const _0x4f582b=a126_0x13492b;if(!_0x3d521f||!_0x3d521f[_0x4f582b(0x1cf)])return;for(let _0x3248f7=0x0;_0x3248f7<_0x3d521f['conditions'][_0x4f582b(0x1f6)];_0x3248f7++){const _0x165735=_0x3d521f['conditions'][_0x3248f7];if('type'in _0x165735&&_0x165735[_0x4f582b(0x19e)]===_0x4f582b(0x196)){const _0x193f79=_0x165735,_0x27fc87=_0x193f79[_0x4f582b(0x1fc)]||_0x193f79[_0x4f582b(0x200)];if((!_0x193f79[_0x4f582b(0x1d3)]||_0x193f79['attribute']==='')&&!_0x27fc87)throw new SDKError(ErrorCode[_0x4f582b(0x1dd)],_0x4f582b(0x1df)+_0x56899e+_0x4f582b(0x1af)+(_0x4f582b(0x202)+_0x3248f7+_0x4f582b(0x18f))+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x292b30,_0x2dc154){const _0x37ea78=a127_0x2ef7,_0x1fb9a3=_0x292b30();while(!![]){try{const _0x2b566e=parseInt(_0x37ea78(0x1e9))/0x1*(-parseInt(_0x37ea78(0x208))/0x2)+-parseInt(_0x37ea78(0x1d3))/0x3*(parseInt(_0x37ea78(0x1fa))/0x4)+-parseInt(_0x37ea78(0x1f3))/0x5*(-parseInt(_0x37ea78(0x1ec))/0x6)+parseInt(_0x37ea78(0x1df))/0x7*(-parseInt(_0x37ea78(0x1d4))/0x8)+parseInt(_0x37ea78(0x1d7))/0x9+parseInt(_0x37ea78(0x1d2))/0xa*(parseInt(_0x37ea78(0x1db))/0xb)+parseInt(_0x37ea78(0x20a))/0xc;if(_0x2b566e===_0x2dc154)break;else _0x1fb9a3['push'](_0x1fb9a3['shift']());}catch(_0x4c40e9){_0x1fb9a3['push'](_0x1fb9a3['shift']());}}}(a127_0x3db3,0x68fb0));import a127_0x457008 from'chalk';function a127_0x2ef7(_0x35583a,_0x15dccf){_0x35583a=_0x35583a-0x1d2;const _0x3db335=a127_0x3db3();let _0x2ef730=_0x3db335[_0x35583a];return _0x2ef730;}import{withProgressSpinner}from'../../utils/spinner.js';export function buildSchemaResult(_0x3c9648){const _0x421df4=a127_0x2ef7,_0x24c73a=_0x3c9648[_0x421df4(0x1fc)][_0x421df4(0x204)](_0x526328=>({'column_name':_0x526328[_0x421df4(0x20b)],'column_type':_0x526328['type'],'null':_0x421df4(0x1f4),'key':null,'default':null,'extra':null}));return{..._0x3c9648,'columns':[{'name':_0x421df4(0x1ee),'type':_0x421df4(0x1e8)},{'name':_0x421df4(0x210),'type':'varchar'},{'name':'null','type':_0x421df4(0x1e8)},{'name':_0x421df4(0x1dc),'type':'varchar'},{'name':'default','type':_0x421df4(0x1e8)},{'name':_0x421df4(0x1fe),'type':'varchar'}],'data':_0x24c73a};}export async function executeSchemaQuery(_0x2dd6c6,_0x43afc0,_0x5251e3){const _0x694ee9=a127_0x2ef7,_0x1a0239=_0x2dd6c6[_0x694ee9(0x1e4)]()['replace'](/;+$/,''),_0x78d577=_0x694ee9(0x1e6)+_0x1a0239+'\x0a)\x20AS\x20segment_query\x20LIMIT\x200';_0x5251e3[_0x694ee9(0x209)]&&console['error']('Schema\x20query:\x0a'+_0x78d577);const _0x5c1b00=await withProgressSpinner(_0x694ee9(0x1f8),async _0x2d9cbc=>{const _0x5113c9=_0x694ee9,_0x531b91=await _0x43afc0['query'][_0x5113c9(0x1f9)](_0x78d577,{'catalog':'td','schema':_0x5113c9(0x1e5),'onJobId':_0x36a06b=>{const _0x72dbd8=_0x5113c9;_0x2d9cbc[_0x72dbd8(0x20d)](_0x36a06b);}});return _0x531b91;},{'verbose':_0x5251e3[_0x694ee9(0x209)]});return buildSchemaResult(_0x5c1b00[_0x694ee9(0x203)]);}function columnName(_0x47060e){const _0x1b8de8=a127_0x2ef7;return _0x47060e[_0x1b8de8(0x1eb)]||_0x47060e[_0x1b8de8(0x1e2)]||_0x47060e[_0x1b8de8(0x20b)];}function a127_0x3db3(){const _0x48c144=['column_type','2230uYgNcZ','6dFzwBu','28104lRkRBj','cyan','dim','1143702uXReqP','displayName','localeCompare','some','21725yxPalU','key','Unknown','behavior','1141TijQak','get','entries','parentColumn','error','trim','information_schema','SELECT\x20*\x20FROM\x20(\x0a','source','varchar','2825ibvpgL','size','matrixColumnName','94338VajZxm','set','column_name','bold','attribute','Behaviors','sort','5ZuFISP','YES','Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).','push','\x20\x20\x20\x20','Fetching\x20schema...','execute','99340EsthJu','fields','columns','Attributes','extra','slice','filter','\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.','matrixTableName','data','map','length','parentTableName','startsWith','528GCdHIH','verbose','14578356AJTZPP','name','type','setJobId','groupingName','tableName'];a127_0x3db3=function(){return _0x48c144;};return a127_0x3db3();}function formatFieldLine(_0x17e7dc,_0x3adceb,_0x3c3a3e){const _0x2356df=a127_0x2ef7,_0x245546=_0x17e7dc!==_0x3adceb?'\x20'+a127_0x457008[_0x2356df(0x1d6)]('('+_0x3adceb+')'):'';return _0x2356df(0x1f7)+_0x17e7dc+_0x245546+':\x20'+a127_0x457008[_0x2356df(0x1d5)](_0x3c3a3e);}function sortByColumnName(_0x3c29ae){const _0x13b672=a127_0x2ef7;return[..._0x3c29ae][_0x13b672(0x1f2)]((_0x8a4052,_0x5ca8fa)=>columnName(_0x8a4052)[_0x13b672(0x1d9)](columnName(_0x5ca8fa)));}export function displayFieldsHumanReadable(_0x406fe6,_0x5d7b34){const _0x5376b2=a127_0x2ef7,_0x4537cd=_0x406fe6[_0x5376b2(0x200)](_0x3b5245=>_0x3b5245['source']===_0x5376b2(0x1f0)),_0x4546f4=_0x406fe6[_0x5376b2(0x200)](_0x3a37fb=>_0x3a37fb[_0x5376b2(0x1e7)]===_0x5376b2(0x1de)),_0x29600a=new Map();for(const _0x15428d of _0x4537cd){const _0x304ddf=_0x15428d[_0x5376b2(0x20e)]||_0x15428d[_0x5376b2(0x206)]||_0x5376b2(0x1dd),_0x4c6f29=_0x29600a[_0x5376b2(0x1e0)](_0x304ddf);_0x4c6f29?_0x4c6f29['fields'][_0x5376b2(0x1f6)](_0x15428d):_0x29600a[_0x5376b2(0x1ed)](_0x304ddf,{'displayName':_0x304ddf,'tableName':_0x15428d[_0x5376b2(0x206)],'fields':[_0x15428d]});}const _0x1a5456=new Map();for(const _0x49d199 of _0x4546f4){const _0x2f8ebc=_0x49d199['behaviorName']||_0x5376b2(0x1dd),_0x2f1d6c=_0x1a5456[_0x5376b2(0x1e0)](_0x2f8ebc)||[];_0x2f1d6c[_0x5376b2(0x1f6)](_0x49d199),_0x1a5456[_0x5376b2(0x1ed)](_0x2f8ebc,_0x2f1d6c);}console[_0x5376b2(0x1e3)]('\x0a'+a127_0x457008[_0x5376b2(0x1ef)](_0x5d7b34));if(_0x29600a[_0x5376b2(0x1ea)]>0x0){console[_0x5376b2(0x1e3)]('\x0a'+a127_0x457008[_0x5376b2(0x1d6)](_0x5376b2(0x1fd)));const _0x48e70a=[..._0x29600a[_0x5376b2(0x1e1)]()][_0x5376b2(0x1f2)]((_0x3dbb80,_0x563fc7)=>_0x3dbb80[0x0][_0x5376b2(0x1d9)](_0x563fc7[0x0]));for(const [,_0x1e825f]of _0x48e70a){const _0x34d8e5=_0x1e825f[_0x5376b2(0x20f)]&&_0x1e825f['tableName']!==_0x1e825f[_0x5376b2(0x1d8)]?'\x20'+a127_0x457008[_0x5376b2(0x1d6)]('('+_0x1e825f[_0x5376b2(0x20f)]+')'):'';console['error']('\x20\x20'+a127_0x457008[_0x5376b2(0x1ef)](_0x1e825f[_0x5376b2(0x1d8)])+_0x34d8e5);for(const _0x3973ec of sortByColumnName(_0x1e825f[_0x5376b2(0x1fb)])){console[_0x5376b2(0x1e3)](formatFieldLine(columnName(_0x3973ec),_0x3973ec['name'],_0x3973ec[_0x5376b2(0x20c)]));}}}if(_0x1a5456[_0x5376b2(0x1ea)]>0x0){console['error']('\x0a'+a127_0x457008[_0x5376b2(0x1d6)](_0x5376b2(0x1f1)));const _0x507851=[..._0x1a5456[_0x5376b2(0x1e1)]()][_0x5376b2(0x1f2)]((_0x134d83,_0x28a558)=>_0x134d83[0x0][_0x5376b2(0x1d9)](_0x28a558[0x0]));for(const [_0x38c448,_0x8b0ae0]of _0x507851){const _0x51f946=_0x8b0ae0[0x0],_0x5abb74=_0x51f946?.[_0x5376b2(0x202)];if(_0x5abb74){const _0x49c6f6=_0x5abb74!==_0x38c448?'\x20'+a127_0x457008[_0x5376b2(0x1d6)]('('+_0x38c448+')'):'';console[_0x5376b2(0x1e3)]('\x20\x20'+a127_0x457008[_0x5376b2(0x1ef)](_0x5abb74)+_0x49c6f6);}else{const _0x1d1079=_0x51f946?.[_0x5376b2(0x206)]||'';console[_0x5376b2(0x1e3)]('\x20\x20'+a127_0x457008[_0x5376b2(0x1ef)](_0x38c448)+(_0x1d1079?'\x20'+a127_0x457008[_0x5376b2(0x1d6)]('('+_0x1d1079+')'):''));}for(const _0x135e7a of sortByColumnName(_0x8b0ae0)){const _0x2c2e79=_0x135e7a[_0x5376b2(0x20b)][_0x5376b2(0x207)](_0x38c448+'.')?_0x135e7a[_0x5376b2(0x20b)][_0x5376b2(0x1ff)](_0x38c448[_0x5376b2(0x205)]+0x1):_0x135e7a['name'];console['error'](formatFieldLine(columnName(_0x135e7a),_0x2c2e79,_0x135e7a['type']));}}}const _0x97f4b3=_0x406fe6[_0x5376b2(0x1da)](_0x177401=>_0x177401[_0x5376b2(0x1eb)]||_0x177401[_0x5376b2(0x202)]);_0x97f4b3&&(console[_0x5376b2(0x1e3)]('\x0a'+a127_0x457008['dim'](_0x5376b2(0x1f5))),console[_0x5376b2(0x1e3)](a127_0x457008['dim'](_0x5376b2(0x201)))),console[_0x5376b2(0x1e3)]('');}
|