@treasuredata/tdx 2026.9.3 → 2026.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/ai-usage-command-base.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-journey-command.d.ts +34 -0
- package/dist/commands/cas-journey-command.d.ts.map +1 -0
- package/dist/commands/cas-journey-command.js +1 -0
- package/dist/commands/cas-journey-command.js.map +1 -0
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/codex-command.d.ts.map +1 -1
- package/dist/commands/codex-command.js +1 -1
- package/dist/commands/codex-command.js.map +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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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-readiness-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-in-browser-message-command.js +1 -1
- package/dist/commands/engage-landing-page-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/engage-workspace-assignment-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts +46 -0
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +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/opencode-command.d.ts +25 -0
- package/dist/commands/opencode-command.d.ts.map +1 -1
- package/dist/commands/opencode-command.js +1 -1
- package/dist/commands/opencode-command.js.map +1 -1
- package/dist/commands/opencode-usage-command.js +1 -1
- package/dist/commands/p13n-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +10 -1
- package/dist/core/auth.d.ts.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/auth.js.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.d.ts +2 -0
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +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/auth-token.js +1 -1
- package/dist/sdk/cas/audience-context.d.ts +33 -0
- package/dist/sdk/cas/audience-context.d.ts.map +1 -0
- package/dist/sdk/cas/audience-context.js +1 -0
- package/dist/sdk/cas/audience-context.js.map +1 -0
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.d.ts +8 -0
- package/dist/sdk/cas/index.d.ts.map +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/index.js.map +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/p13n-studio-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/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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-readiness-workflow.js +1 -1
- package/dist/sdk/engage/campaign-readiness.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/in-browser-message-pull.js +1 -1
- package/dist/sdk/engage/in-browser-message-push.js +1 -1
- package/dist/sdk/engage/in-browser-message-validator.js +1 -1
- package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
- package/dist/sdk/engage/landing-page-init.js +1 -1
- package/dist/sdk/engage/landing-page-public-asset.js +1 -1
- package/dist/sdk/engage/landing-page-pull.js +1 -1
- package/dist/sdk/engage/landing-page-push.js +1 -1
- package/dist/sdk/engage/landing-page-static-site.js +1 -1
- package/dist/sdk/engage/landing-page-validator.js +1 -1
- package/dist/sdk/engage/landing-page-workspace.js +1 -1
- package/dist/sdk/engage/landing-page-yaml.js +1 -1
- package/dist/sdk/engage/list-campaign-schema.js +1 -1
- package/dist/sdk/engage/list-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/always-on-campaign-schema.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/in-browser-message-schema.js +1 -1
- package/dist/sdk/engage/types/landing-page-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/workspace-assignments.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.d.ts +4 -1
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- package/dist/sdk/p13n-studio-errors.js +1 -1
- package/dist/sdk/p13n-studio.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.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/audience-context.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.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/proxy-fetch.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 +2 -1
package/dist/sdk/realtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a192_0x93f0b9=a192_0x2d0d;(function(_0x2fd347,_0x450ced){const _0x29b49e=a192_0x2d0d,_0x245923=_0x2fd347();while(!![]){try{const _0x1e6076=-parseInt(_0x29b49e(0x124))/0x1+-parseInt(_0x29b49e(0x102))/0x2*(-parseInt(_0x29b49e(0x11d))/0x3)+-parseInt(_0x29b49e(0x107))/0x4*(parseInt(_0x29b49e(0x119))/0x5)+parseInt(_0x29b49e(0x114))/0x6+parseInt(_0x29b49e(0x10a))/0x7*(-parseInt(_0x29b49e(0x10e))/0x8)+parseInt(_0x29b49e(0x106))/0x9*(-parseInt(_0x29b49e(0x115))/0xa)+-parseInt(_0x29b49e(0x10c))/0xb*(-parseInt(_0x29b49e(0x121))/0xc);if(_0x1e6076===_0x450ced)break;else _0x245923['push'](_0x245923['shift']());}catch(_0x56a3af){_0x245923['push'](_0x245923['shift']());}}}(a192_0x541e,0x53a5c));import{HTTPClient}from'./client/http-client.js';function a192_0x2d0d(_0x2c86bd,_0x42a0e3){_0x2c86bd=_0x2c86bd-0x100;const _0x541eab=a192_0x541e();let _0x2d0de8=_0x541eab[_0x2c86bd];return _0x2d0de8;}import{CDPApiClient}from'./client/cdp-api-client.js';import{getEndpoint}from'./client/endpoints.js';import{getAuthHeaders,toHeaderRecord}from'../core/auth.js';function a192_0x541e(){const _0x418616=['attributes','2172rIOqpB','request','getCurrentRealtimeConfigVersion','507592OSKAcX','map','getParentSegment','disabled','listJourneys','cdpClient','scheduleType','enabled','apiKey','name','339632CVwOdF','pauseRealtimeJourney','population','keys','9tAKEjI','8Zenotj','/realtime_setting','listParentSegments','3796842ofhoCy','proxy','67353ZUrqDc','application/vnd.treasuredata.v1+json','8cUCqvX','updateConfig','object','site','httpClient','application/json','2004792MOSWQm','5536870xCYWld','/audiences/','getCurrentConfigVersion','timeout','13845hhzPrI','GET','list','PUT','9SwkiTI','cdp','getConfig'];a192_0x541e=function(){return _0x418616;};return a192_0x541e();}export class RealtimeSDK{[a192_0x93f0b9(0x112)];['cdpClient'];constructor(_0x30f8c4){const _0x3adcde=a192_0x93f0b9,_0x16793a=getEndpoint(_0x30f8c4['site'],_0x3adcde(0x11e)),_0x1352ff=toHeaderRecord(getAuthHeaders(_0x30f8c4[_0x3adcde(0x111)],_0x30f8c4[_0x3adcde(0x100)],_0x30f8c4['accessToken']));this[_0x3adcde(0x112)]=new HTTPClient(_0x16793a,{..._0x1352ff,'Accept':_0x3adcde(0x10d),'Content-Type':_0x3adcde(0x113)},{'proxy':_0x30f8c4[_0x3adcde(0x10b)],'defaultTimeout':_0x30f8c4[_0x3adcde(0x118)]}),this['cdpClient']=new CDPApiClient(_0x30f8c4);}async['isEnabled'](_0x5d4b1f){const _0x52e209=a192_0x93f0b9;try{const _0x1990c3=await this[_0x52e209(0x112)][_0x52e209(0x122)](_0x52e209(0x11a),'/audiences/'+_0x5d4b1f+'/realtime_setting');return _0x1990c3!==null;}catch{return![];}}async['getStatus'](_0x18057f){const _0x46361a=a192_0x93f0b9,_0x4676da=await this[_0x46361a(0x129)][_0x46361a(0x126)](_0x18057f);let _0x22de60=![],_0xe2c102=![];try{const _0x3deff9=await this['httpClient']['request'](_0x46361a(0x11a),_0x46361a(0x116)+_0x18057f+_0x46361a(0x108));_0x22de60=!![],_0xe2c102=!!(_0x3deff9&&typeof _0x3deff9===_0x46361a(0x110)&&Object[_0x46361a(0x105)](_0x3deff9)['length']>0x0);}catch{_0x22de60=![],_0xe2c102=![];}return{'parent_segment_id':_0x18057f,'parent_segment_name':_0x4676da[_0x46361a(0x120)][_0x46361a(0x101)],'realtime_enabled':_0x22de60,'realtime_config_exists':_0xe2c102,'status':_0x22de60?_0x46361a(0x12b):_0x46361a(0x127)};}async[a192_0x93f0b9(0x11f)](_0x20feb2){const _0x29f346=a192_0x93f0b9,_0x2dec72=await this[_0x29f346(0x112)][_0x29f346(0x122)](_0x29f346(0x11a),_0x29f346(0x116)+_0x20feb2+_0x29f346(0x108));return _0x2dec72||{};}async[a192_0x93f0b9(0x10f)](_0x207c4e,_0x3d5322){const _0x42b4ba=a192_0x93f0b9,_0x21a765=await this['httpClient']['request'](_0x42b4ba(0x11c),_0x42b4ba(0x116)+_0x207c4e+_0x42b4ba(0x108),{'body':_0x3d5322});return _0x21a765||{};}async[a192_0x93f0b9(0x11b)](){const _0x14b079=a192_0x93f0b9,_0x3b4323=await this['cdpClient'][_0x14b079(0x109)](),_0x1c50e7=await Promise['all'](_0x3b4323[_0x14b079(0x125)](async _0x1963df=>{const _0x3cbf5b=_0x14b079,_0x29be68=await this['isEnabled'](_0x1963df['id']);return{'id':_0x1963df['id'],'name':_0x1963df[_0x3cbf5b(0x120)]['name'],'population':_0x1963df['attributes'][_0x3cbf5b(0x104)],'realtime_enabled':_0x29be68,'schedule_type':_0x1963df[_0x3cbf5b(0x120)][_0x3cbf5b(0x12a)],'updated_at':_0x1963df[_0x3cbf5b(0x120)]['updatedAt']};}));return _0x1c50e7;}async[a192_0x93f0b9(0x128)](_0x4eceeb){const _0x5ea447=a192_0x93f0b9;return await this[_0x5ea447(0x129)]['listRealtimeJourneys'](_0x4eceeb);}async['pauseJourney'](_0x168fee){const _0x5e7703=a192_0x93f0b9;return await this[_0x5e7703(0x129)][_0x5e7703(0x103)](_0x168fee);}async['resumeJourney'](_0x488924){const _0x19f2eb=a192_0x93f0b9;return await this[_0x19f2eb(0x129)]['resumeRealtimeJourney'](_0x488924);}async[a192_0x93f0b9(0x117)](_0x2da594){const _0x1de83e=a192_0x93f0b9;return await this[_0x1de83e(0x129)][_0x1de83e(0x123)](_0x2da594);}}
|
package/dist/sdk/schedule.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a193_0x505e(_0x1e47d8,_0x4ee1c4){_0x1e47d8=_0x1e47d8-0x190;const _0x9affeb=a193_0x9aff();let _0x505eb5=_0x9affeb[_0x1e47d8];return _0x505eb5;}const a193_0x4e978b=a193_0x505e;(function(_0x470728,_0x3625ba){const _0x3b55c3=a193_0x505e,_0x19b98e=_0x470728();while(!![]){try{const _0x30affc=-parseInt(_0x3b55c3(0x1a7))/0x1*(-parseInt(_0x3b55c3(0x1b6))/0x2)+-parseInt(_0x3b55c3(0x1c1))/0x3*(parseInt(_0x3b55c3(0x1bc))/0x4)+parseInt(_0x3b55c3(0x1c0))/0x5+-parseInt(_0x3b55c3(0x193))/0x6+-parseInt(_0x3b55c3(0x1bd))/0x7+-parseInt(_0x3b55c3(0x194))/0x8+-parseInt(_0x3b55c3(0x190))/0x9*(-parseInt(_0x3b55c3(0x1c9))/0xa);if(_0x30affc===_0x3625ba)break;else _0x19b98e['push'](_0x19b98e['shift']());}catch(_0x4db6f2){_0x19b98e['push'](_0x19b98e['shift']());}}}(a193_0x9aff,0x1e02a));import{TDApiClient}from'./client/td-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function normalizeTimestamp(_0x3fcd26){const _0x2c056b=a193_0x505e;if(!_0x3fcd26)return undefined;if(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/[_0x2c056b(0x192)](_0x3fcd26))return _0x3fcd26;return _0x3fcd26['replace'](_0x2c056b(0x1bb),'Z')[_0x2c056b(0x1c7)]('\x20','T');}function a193_0x9aff(){const _0x2618e7=['\x5c$&','num','getTime','filter','update','Schedule\x20name\x20is\x20required','queries','slice','scheduled','4090IuOgNd','floor','history','now','pattern','\x20UTC','8MjlpiQ','277004sPcYkR','map','created_at','890205TTGvga','146856FONvEq','cron','delete','updated_at','INVALID_ARGUMENT','query','replace','type','269530lrrBQn','push','9vhyear','Type\x20is\x20required','test','645456RwUUdw','463040afxUIR','runSchedule','find','getScheduleHistory','client','updateSchedule','Invalid\x20time\x20format:\x20','limit','pagination','desc','listSchedules','start_at','Query\x20is\x20required','NOT_FOUND','has_next_page','num\x20must\x20be\x20between\x201\x20and\x2010','name','deleteSchedule','length','108SQIhyH','show','database','listQueries','list','time'];a193_0x9aff=function(){return _0x2618e7;};return a193_0x9aff();}export class ScheduleSDK{[a193_0x4e978b(0x198)];constructor(_0x5b152e){this['client']=new TDApiClient(_0x5b152e);}async[a193_0x4e978b(0x1ab)](_0x166898){const _0x3fa7f3=a193_0x4e978b,_0x37bf26=await this[_0x3fa7f3(0x198)][_0x3fa7f3(0x19e)](),_0x2cb6e2=_0x37bf26[_0x3fa7f3(0x1be)](_0x22afd6=>({..._0x22afd6,'created_at':normalizeTimestamp(_0x22afd6[_0x3fa7f3(0x1bf)])??_0x22afd6[_0x3fa7f3(0x1bf)]}));if(_0x166898?.[_0x3fa7f3(0x19b)]&&_0x166898[_0x3fa7f3(0x19b)]>0x0)return _0x2cb6e2['slice'](0x0,_0x166898[_0x3fa7f3(0x19b)]);return _0x2cb6e2;}async['listQueries'](_0x41476d){const _0x117ff0=a193_0x4e978b,_0x364fea=0x64,_0x4e3909=_0x41476d?.[_0x117ff0(0x19b)],_0x8ddded=[];let _0x2268a0=!![],_0x5cfcda,_0x3c8186,_0x208fd0;if(_0x41476d?.[_0x117ff0(0x1ba)]){const _0x42f044=_0x41476d[_0x117ff0(0x1ba)]['replace'](/[.+^${}()|[\]\\]/g,_0x117ff0(0x1ad)),_0x442e2c=_0x42f044['replace'](/\*/g,'.*')[_0x117ff0(0x1c7)](/\?/g,'.');_0x208fd0=new RegExp('^'+_0x442e2c+'$','i');}while(_0x2268a0&&(!_0x4e3909||_0x8ddded[_0x117ff0(0x1a6)]<_0x4e3909)){const _0x44eefd=await this[_0x117ff0(0x198)][_0x117ff0(0x1aa)]({'anchor_column':'updated_at','sort_direction':_0x117ff0(0x19d),'page_size':_0x364fea,'anchor_id':_0x5cfcda,'anchor_value':_0x3c8186});let _0xdbb469=_0x44eefd['queries'];_0x41476d?.[_0x117ff0(0x1b5)]&&(_0xdbb469=_0xdbb469[_0x117ff0(0x1b0)](_0x1ec656=>_0x1ec656[_0x117ff0(0x1c2)]!==null));_0x208fd0&&(_0xdbb469=_0xdbb469[_0x117ff0(0x1b0)](_0x59495d=>_0x59495d[_0x117ff0(0x1a4)]&&_0x208fd0[_0x117ff0(0x192)](_0x59495d['name'])));_0x8ddded[_0x117ff0(0x1ca)](..._0xdbb469),_0x2268a0=_0x44eefd[_0x117ff0(0x19c)][_0x117ff0(0x1a2)];if(_0x2268a0&&_0x44eefd[_0x117ff0(0x1b3)][_0x117ff0(0x1a6)]>0x0){const _0x180bc3=_0x44eefd['queries'][_0x44eefd[_0x117ff0(0x1b3)][_0x117ff0(0x1a6)]-0x1];_0x5cfcda=_0x180bc3['id'],_0x3c8186=_0x180bc3[_0x117ff0(0x1c4)];}}const _0x2c98ff=_0x4e3909?_0x8ddded[_0x117ff0(0x1b4)](0x0,_0x4e3909):_0x8ddded;return{'queries':_0x2c98ff,'pagination':{'has_next_page':_0x2268a0||(_0x4e3909?_0x8ddded['length']>_0x4e3909:![])}};}async[a193_0x4e978b(0x1a8)](_0x42db0e){const _0x2911cb=a193_0x4e978b,_0x549292=await this['client'][_0x2911cb(0x19e)](),_0x157564=_0x549292[_0x2911cb(0x196)](_0x3ac438=>_0x3ac438['name']===_0x42db0e);if(!_0x157564)throw new SDKError(ErrorCode[_0x2911cb(0x1a1)],'Schedule\x20not\x20found:\x20'+_0x42db0e);return{..._0x157564,'created_at':normalizeTimestamp(_0x157564[_0x2911cb(0x1bf)])??_0x157564[_0x2911cb(0x1bf)]};}async['create'](_0x9d31d4,_0x4c2bd4){const _0x1a02c6=a193_0x4e978b;if(!_0x9d31d4)throw new SDKError(ErrorCode[_0x1a02c6(0x1c5)],_0x1a02c6(0x1b2));if(!_0x4c2bd4[_0x1a02c6(0x1a9)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Database\x20is\x20required');if(!_0x4c2bd4[_0x1a02c6(0x1c6)])throw new SDKError(ErrorCode[_0x1a02c6(0x1c5)],_0x1a02c6(0x1a0));if(!_0x4c2bd4[_0x1a02c6(0x1c8)])throw new SDKError(ErrorCode[_0x1a02c6(0x1c5)],_0x1a02c6(0x191));return await this[_0x1a02c6(0x198)]['createSchedule'](_0x9d31d4,_0x4c2bd4);}async[a193_0x4e978b(0x1b1)](_0x575174,_0x4d9d0e){const _0x2a14a5=a193_0x4e978b;if(!_0x575174)throw new SDKError(ErrorCode[_0x2a14a5(0x1c5)],_0x2a14a5(0x1b2));return await this[_0x2a14a5(0x198)][_0x2a14a5(0x199)](_0x575174,_0x4d9d0e);}async[a193_0x4e978b(0x1c3)](_0x3a7d55){const _0x1a97b9=a193_0x4e978b;if(!_0x3a7d55)throw new SDKError(ErrorCode[_0x1a97b9(0x1c5)],_0x1a97b9(0x1b2));return await this[_0x1a97b9(0x198)][_0x1a97b9(0x1a5)](_0x3a7d55);}async['run'](_0x57bd32,_0x16a01d){const _0x13747c=a193_0x4e978b;if(!_0x57bd32)throw new SDKError(ErrorCode[_0x13747c(0x1c5)],'Schedule\x20name\x20is\x20required');let _0x2d94f7;if(_0x16a01d?.[_0x13747c(0x1ac)]){const _0xeab974=typeof _0x16a01d['time']==='string'?new Date(_0x16a01d[_0x13747c(0x1ac)]):_0x16a01d[_0x13747c(0x1ac)];if(isNaN(_0xeab974[_0x13747c(0x1af)]()))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x13747c(0x19a)+_0x16a01d[_0x13747c(0x1ac)]);_0x2d94f7=Math['floor'](_0xeab974[_0x13747c(0x1af)]()/0x3e8);}else _0x2d94f7=Math[_0x13747c(0x1b7)](Date[_0x13747c(0x1b9)]()/0x3e8);if(_0x16a01d?.['num']!==undefined){if(_0x16a01d['num']<0x1||_0x16a01d[_0x13747c(0x1ae)]>0xa)throw new SDKError(ErrorCode[_0x13747c(0x1c5)],_0x13747c(0x1a3));}return await this[_0x13747c(0x198)][_0x13747c(0x195)](_0x57bd32,_0x2d94f7,_0x16a01d?.[_0x13747c(0x1ae)]);}async[a193_0x4e978b(0x1b8)](_0x3995f2,_0x5e5d55){const _0x5cc7b9=a193_0x4e978b;if(!_0x3995f2)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5cc7b9(0x1b2));const _0x23548d=await this[_0x5cc7b9(0x198)][_0x5cc7b9(0x197)](_0x3995f2,_0x5e5d55);return{..._0x23548d,'history':_0x23548d[_0x5cc7b9(0x1b8)][_0x5cc7b9(0x1be)](_0x107d99=>({..._0x107d99,'created_at':normalizeTimestamp(_0x107d99['created_at']),'start_at':normalizeTimestamp(_0x107d99[_0x5cc7b9(0x19f)]),'end_at':normalizeTimestamp(_0x107d99['end_at'])}))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5acc64,_0xa4e971){const _0x396229=a194_0x6d4b,_0x4f23a7=_0x5acc64();while(!![]){try{const _0x51054f=parseInt(_0x396229(0x124))/0x1+-parseInt(_0x396229(0x122))/0x2*(-parseInt(_0x396229(0x121))/0x3)+-parseInt(_0x396229(0x130))/0x4*(parseInt(_0x396229(0x12d))/0x5)+parseInt(_0x396229(0x137))/0x6*(parseInt(_0x396229(0x125))/0x7)+parseInt(_0x396229(0x132))/0x8*(-parseInt(_0x396229(0x11f))/0x9)+parseInt(_0x396229(0x135))/0xa*(-parseInt(_0x396229(0x11e))/0xb)+parseInt(_0x396229(0x129))/0xc*(parseInt(_0x396229(0x12e))/0xd);if(_0x51054f===_0xa4e971)break;else _0x4f23a7['push'](_0x4f23a7['shift']());}catch(_0x411c37){_0x4f23a7['push'](_0x4f23a7['shift']());}}}(a194_0x4a12,0x19674));import{SDKError,ErrorCode}from'../errors.js';import{extractRootFolderId}from'./push-workflow.js';function a194_0x4a12(){const _0x1ce9e2=['segment','132781dshvsQ','702PAJNYf','\x27\x20(id\x20','3NVploU','149392jzhwwe','kind','185713fzLzjq','102963tntyHZ','rootFolderId','name','test','6144Jwdweb','Pass\x20the\x20numeric\x20id\x20instead.','SEGMENT_NOT_FOUND','Parent\x20segment\x20not\x20found:\x20','6965glLXBF','4940XoFQfC','composable','456qfGKZy','join','3880IBCZWb','map','listParents','140tpnacY','filter','6ALFWJm','getParentSegmentEntity','cas','length','INVALID_ARGUMENT','Audience\x20name\x20or\x20id\x20is\x20required','\x20audience\x20\x27'];a194_0x4a12=function(){return _0x1ce9e2;};return a194_0x4a12();}function toResolved({entity:_0x15cc7f,kind:_0x24b365}){const _0x1a45fe=a194_0x6d4b;return{'id':_0x15cc7f['id'],'name':_0x15cc7f['attributes'][_0x1a45fe(0x127)],'kind':_0x24b365,'rootFolderId':extractRootFolderId(_0x15cc7f)};}function a194_0x6d4b(_0x759abb,_0x44dc3a){_0x759abb=_0x759abb-0x118;const _0x4a1255=a194_0x4a12();let _0x6d4b12=_0x4a1255[_0x759abb];return _0x6d4b12;}async function loadEntities(_0x22a0a5){const _0x36bc55=a194_0x6d4b,_0x1180f7=await _0x22a0a5[_0x36bc55(0x11d)][_0x36bc55(0x134)]();return{'entities':_0x1180f7[_0x36bc55(0x133)](_0x22b151=>({'entity':_0x22b151,'kind':'complete'}))};}export async function listAllAudienceEntities(_0x1b7e09){return await loadEntities(_0x1b7e09);}export async function resolveAudienceRootFolderId(_0x438fcf,_0xf49555){const _0x2d9944=a194_0x6d4b;if(_0x438fcf['rootFolderId'])return _0x438fcf[_0x2d9944(0x126)];const _0x5cdf5c=_0x438fcf[_0x2d9944(0x123)]===_0x2d9944(0x12f)?await _0xf49555[_0x2d9944(0x118)][_0x2d9944(0x138)](_0x438fcf['id']):await _0xf49555[_0x2d9944(0x11d)]['getParent'](_0x438fcf['id']);return extractRootFolderId(_0x5cdf5c);}function describeCandidates(_0x4c885b){const _0x2e7918=a194_0x6d4b;return _0x4c885b['map'](_0x4401e2=>_0x4401e2[_0x2e7918(0x123)]+_0x2e7918(0x11c)+_0x4401e2['name']+_0x2e7918(0x120)+_0x4401e2['id']+')')[_0x2e7918(0x131)](',\x20');}export async function resolveAudienceContext(_0x172678,_0x4fa638){const _0x548465=a194_0x6d4b;if(!_0x172678)throw new SDKError(ErrorCode[_0x548465(0x11a)],_0x548465(0x11b));const {entities:_0x3b7e0a}=await loadEntities(_0x4fa638),_0x31f57b=_0x3b7e0a[_0x548465(0x133)](toResolved);let _0x17de64=[];/^\d+$/[_0x548465(0x128)](_0x172678)&&(_0x17de64=_0x31f57b['filter'](_0x30cc25=>_0x30cc25['id']===_0x172678));_0x17de64['length']===0x0&&(_0x17de64=_0x31f57b[_0x548465(0x136)](_0x1c3667=>_0x1c3667[_0x548465(0x127)]===_0x172678));if(_0x17de64[_0x548465(0x119)]===0x0)throw new SDKError(ErrorCode[_0x548465(0x12b)],_0x548465(0x12c)+_0x172678);if(_0x17de64['length']>0x1)throw new SDKError(ErrorCode[_0x548465(0x11a)],'\x27'+_0x172678+'\x27\x20is\x20ambiguous\x20—\x20it\x20matches:\x20'+describeCandidates(_0x17de64)+'.\x20'+_0x548465(0x12a));const _0xd4fa5d=_0x17de64[0x0];return{..._0xd4fa5d,'rootFolderId':await resolveAudienceRootFolderId(_0xd4fa5d,_0x4fa638)};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a193_0x389ba7=a193_0xb32c;(function(_0x536f8f,_0x39a1de){const _0x59928f=a193_0xb32c,_0x43d733=_0x536f8f();while(!![]){try{const _0x3b9b50=parseInt(_0x59928f(0x256))/0x1*(-parseInt(_0x59928f(0x245))/0x2)+-parseInt(_0x59928f(0x279))/0x3*(-parseInt(_0x59928f(0x238))/0x4)+-parseInt(_0x59928f(0x22d))/0x5*(parseInt(_0x59928f(0x213))/0x6)+parseInt(_0x59928f(0x255))/0x7*(-parseInt(_0x59928f(0x254))/0x8)+parseInt(_0x59928f(0x210))/0x9+-parseInt(_0x59928f(0x1ff))/0xa*(parseInt(_0x59928f(0x204))/0xb)+parseInt(_0x59928f(0x261))/0xc;if(_0x3b9b50===_0x39a1de)break;else _0x43d733['push'](_0x43d733['shift']());}catch(_0x586387){_0x43d733['push'](_0x43d733['shift']());}}}(a193_0x30f8,0x4eaec));import*as a193_0x4e4a39 from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp,getLegacySettingsField}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':'day','hourly':a193_0x389ba7(0x22e),'weekly':a193_0x389ba7(0x1e4),'monthly':a193_0x389ba7(0x277),'minutes_interval':a193_0x389ba7(0x1f6)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':a193_0x389ba7(0x1f3),'hour':a193_0x389ba7(0x1e9),'week':a193_0x389ba7(0x225),'month':a193_0x389ba7(0x272),'minute':a193_0x389ba7(0x1c6)};function filterRuleAsRuleDef(_0x3d8271){return _0x3d8271;}function ruleDefAsFilterRule(_0x323b72){return _0x323b72;}export function segmentResponseToDefSync(_0x3dbad7,_0x1ace55){const _0x521714=a193_0x389ba7,_0x5526fd=_0x3dbad7[_0x521714(0x226)]&&_0x521714(0x26e)in _0x3dbad7['rule']&&_0x3dbad7[_0x521714(0x226)][_0x521714(0x26e)];return{'type':_0x521714(0x269),'name':_0x3dbad7[_0x521714(0x1bb)],..._0x3dbad7[_0x521714(0x278)]&&{'description':_0x3dbad7[_0x521714(0x278)]},..._0x1ace55&&{'folder':_0x1ace55},..._0x5526fd&&{'rule':apiRuleToYaml(_0x3dbad7[_0x521714(0x226)])},..._0x3dbad7[_0x521714(0x1ed)]!==undefined&&{'kind':_0x3dbad7[_0x521714(0x1ed)]===0x0?_0x521714(0x275):_0x3dbad7[_0x521714(0x1ed)]===0x1?_0x521714(0x1c3):_0x521714(0x24e)},..._0x3dbad7[_0x521714(0x1c2)]!==undefined&&{'visible':_0x3dbad7[_0x521714(0x1c2)]}};}export async function segmentResponseToDef(_0x4a90d5,_0x150d9b,_0x72a28){const _0x2bb972=a193_0x389ba7,_0x42fec2=segmentResponseToDefSync(_0x4a90d5,_0x72a28);if(!_0x150d9b||!_0x150d9b['resolveSegmentName'])return _0x42fec2;return _0x42fec2[_0x2bb972(0x226)]&&(_0x42fec2['rule']=await resolveRuleSegmentRefs(_0x42fec2[_0x2bb972(0x226)],_0x150d9b['resolveSegmentName'])),_0x42fec2;}export function apiRuleToYaml(_0x23351c){const _0x300f15=a193_0x389ba7;if(_0x23351c[_0x300f15(0x26e)]===_0x300f15(0x1ca))return{'type':_0x300f15(0x1ca),'conditions':(_0x23351c[_0x300f15(0x1be)]||[])[_0x300f15(0x23d)](apiConditionToYaml),..._0x23351c[_0x300f15(0x278)]!==undefined&&{'description':_0x23351c['description']},..._0x23351c[_0x300f15(0x20d)]!==undefined&&{'expr':_0x23351c[_0x300f15(0x20d)]}};const _0x3a0714=(_0x23351c['conditions']||[])[_0x300f15(0x1cc)](_0x26907e=>{const _0x42095e=_0x300f15,_0x35c686=apiConditionToYaml(_0x26907e);if(isCompositeType(_0x35c686)&&_0x35c686[_0x42095e(0x278)]!==undefined){const _0x48fc94=_0x35c686;if(_0x48fc94['conditions'][_0x42095e(0x24c)]===0x1)return _0x48fc94[_0x42095e(0x1be)];return[{'type':_0x48fc94[_0x42095e(0x26e)],'conditions':_0x48fc94[_0x42095e(0x1be)]}];}return[_0x35c686];});if(_0x3a0714[_0x300f15(0x24c)]===0x1&&!_0x23351c[_0x300f15(0x278)]&&isCompositeType(_0x3a0714[0x0])){const _0x248e62=_0x3a0714[0x0];if(_0x248e62[_0x300f15(0x26e)]===_0x23351c[_0x300f15(0x26e)]&&_0x248e62[_0x300f15(0x1be)]&&_0x248e62['description']===undefined)return{'type':_0x23351c['type'],'conditions':_0x248e62['conditions']};}return{'type':_0x23351c[_0x300f15(0x26e)],'conditions':_0x3a0714};}function a193_0xb32c(_0x5cb6a1,_0x3d9e1f){_0x5cb6a1=_0x5cb6a1-0x1b9;const _0x30f807=a193_0x30f8();let _0xb32c5a=_0x30f807[_0x5cb6a1];return _0xb32c5a;}export async function resolveRuleSegmentRefs(_0x25eebc,_0x4ae6f3){const _0x100e41=a193_0x389ba7;return transformRuleSegmentRefs(_0x25eebc,_0x4ae6f3,_0x49bf11=>/^\d+$/[_0x100e41(0x262)](_0x49bf11));}async function transformConditionSegmentRefs(_0x19afb0,_0x3eb67e,_0x19291c,_0x382cf9){const _0xc905c7=a193_0x389ba7;if('segment'in _0x19afb0&&(_0x19afb0[_0xc905c7(0x26e)]===_0xc905c7(0x21d)||_0x19afb0[_0xc905c7(0x26e)]===_0xc905c7(0x221))){const _0x239fc3=_0x19afb0;if(_0x19291c(_0x239fc3['segment']))return{..._0x239fc3,'segment':await _0x3eb67e(_0x239fc3['segment'])};return _0x19afb0;}if(_0xc905c7(0x1be)in _0x19afb0&&_0x19afb0[_0xc905c7(0x1be)]){const _0x2bb362=_0x19afb0,_0x198824=await Promise[_0xc905c7(0x217)](_0x2bb362[_0xc905c7(0x1be)][_0xc905c7(0x23d)](_0x55da8d=>transformConditionSegmentRefs(_0x55da8d,_0x3eb67e,_0x19291c,_0x382cf9)));return{..._0x2bb362,'conditions':_0x198824};}if(_0xc905c7(0x1c8)in _0x19afb0&&_0x19afb0[_0xc905c7(0x1c8)]){const _0x39d750=_0x19afb0,_0x4dfb23=await _0x382cf9(filterRuleAsRuleDef(_0x39d750[_0xc905c7(0x1c8)]),_0x3eb67e);return{..._0x39d750,'filter':ruleDefAsFilterRule(_0x4dfb23)};}return _0x19afb0;}async function transformRuleSegmentRefs(_0x1bde8a,_0x1a7445,_0xc26817){const _0x10fe3c=a193_0x389ba7,_0xdce370=(_0x4fe5b3,_0x50fad1)=>transformRuleSegmentRefs(_0x4fe5b3,_0x50fad1,_0xc26817),_0x947f1e=await Promise[_0x10fe3c(0x217)](_0x1bde8a[_0x10fe3c(0x1be)][_0x10fe3c(0x23d)](_0x2a22aa=>transformConditionSegmentRefs(_0x2a22aa,_0x1a7445,_0xc26817,_0xdce370)));return{..._0x1bde8a,'conditions':_0x947f1e};}export async function resolveRuleSegmentIds(_0x2ccd75,_0x4bb154){const _0x570180=a193_0x389ba7;return transformRuleSegmentRefs(_0x2ccd75,_0x4bb154,_0x524cba=>!/^\d+$/[_0x570180(0x262)](_0x524cba));}function isCompositeType(_0x71491d){const _0x59976c=a193_0x389ba7;return _0x71491d[_0x59976c(0x26e)]===_0x59976c(0x1c9)||_0x71491d[_0x59976c(0x26e)]==='Or'||_0x71491d['type']===_0x59976c(0x1ca);}function isBehaviorApiCondition(_0x18627e){const _0x7d585b=a193_0x389ba7;if(!_0x18627e[_0x7d585b(0x1e0)]?.[_0x7d585b(0x1fb)]?.[_0x7d585b(0x1bb)])return![];return!![];}function apiConditionToYaml(_0x564b58){const _0x895f93=a193_0x389ba7;if(_0x564b58['type']===_0x895f93(0x1c9)||_0x564b58['type']==='Or'){if(_0x564b58['conditions']){const _0xc8ecca=_0x564b58[_0x895f93(0x1be)]['map'](apiConditionToYaml),_0x548c27=_0x564b58[_0x895f93(0x278)]!==undefined;if(_0xc8ecca[_0x895f93(0x24c)]===0x1&&!_0x548c27)return _0xc8ecca[0x0];return{'type':_0x564b58[_0x895f93(0x26e)],'conditions':_0xc8ecca,..._0x564b58[_0x895f93(0x278)]!==undefined&&{'description':_0x564b58[_0x895f93(0x278)]}};}}if(_0x564b58['type']===_0x895f93(0x1ca)&&_0x564b58[_0x895f93(0x1be)])return{'type':_0x895f93(0x1ca),'conditions':_0x564b58['conditions'][_0x895f93(0x23d)](apiConditionToYaml),..._0x564b58[_0x895f93(0x278)]!==undefined&&{'description':_0x564b58[_0x895f93(0x278)]},..._0x564b58[_0x895f93(0x20d)]!==undefined&&{'expr':_0x564b58[_0x895f93(0x20d)]}};if(_0x564b58[_0x895f93(0x26e)]===_0x895f93(0x208)&&_0x564b58['leftValue']&&_0x564b58['operator']){const _0x39e5a2=_0x564b58[_0x895f93(0x1e0)][_0x895f93(0x1fa)]?buildAggregationDefFromApi(_0x564b58[_0x895f93(0x1e0)][_0x895f93(0x1fa)]):undefined;if(isBehaviorApiCondition(_0x564b58)){const _0xb1bf30=_0x564b58[_0x895f93(0x1e0)][_0x895f93(0x1fb)][_0x895f93(0x1bb)],{timeWindow:_0x1f6961,remainingFilter:_0x33dfd6}=extractTimeWindow(_0x564b58['leftValue'][_0x895f93(0x1c8)]);return{'type':_0x895f93(0x274),'attribute':'','operator':apiOperatorToYaml(_0x564b58[_0x895f93(0x250)]),..._0x564b58[_0x895f93(0x276)]&&_0x564b58[_0x895f93(0x276)]!==_0x895f93(0x1de)?{'arrayMatching':_0x564b58[_0x895f93(0x276)]}:{},..._0x564b58[_0x895f93(0x221)]?{'exclude':_0x564b58[_0x895f93(0x221)]}:{},..._0x39e5a2?{'aggregation':_0x39e5a2}:{},'source':_0xb1bf30,..._0x1f6961?{'timeWindow':_0x1f6961}:{},..._0x33dfd6?{'filter':apiRuleToYaml(_0x33dfd6)}:{},..._0x564b58[_0x895f93(0x27a)]!==undefined&&_0x564b58[_0x895f93(0x27a)]!==null?{'limit':_0x564b58[_0x895f93(0x27a)]}:{}};}return{'type':_0x895f93(0x208),'attribute':_0x564b58[_0x895f93(0x1e0)]['name']||'','operator':apiOperatorToYaml(_0x564b58['operator']),..._0x564b58[_0x895f93(0x276)]&&_0x564b58['arrayMatching']!=='any'?{'arrayMatching':_0x564b58[_0x895f93(0x276)]}:{},..._0x564b58[_0x895f93(0x221)]?{'exclude':_0x564b58['exclude']}:{},..._0x39e5a2?{'aggregation':_0x39e5a2}:{},..._0x564b58[_0x895f93(0x1e0)]['filter']?{'filter':apiRuleToYaml(_0x564b58['leftValue']['filter'])}:{},..._0x564b58['limit']!==undefined&&_0x564b58[_0x895f93(0x27a)]!==null?{'limit':_0x564b58[_0x895f93(0x27a)]}:{}};}if(_0x564b58[_0x895f93(0x26e)]===_0x895f93(0x224)&&_0x564b58[_0x895f93(0x21c)]&&_0x564b58[_0x895f93(0x250)])return{'type':_0x895f93(0x224),'column':_0x564b58[_0x895f93(0x21c)],'operator':apiOperatorToYaml(_0x564b58['operator'])};if(_0x564b58[_0x895f93(0x26e)]===_0x895f93(0x1db)&&_0x564b58['id'])return{'type':_0x564b58['exclude']?_0x895f93(0x221):_0x895f93(0x21d),'segment':_0x564b58['id']};return{'type':_0x895f93(0x1c9),'conditions':[]};}function a193_0x30f8(){const _0xee2d4f=['nested_workflow_project_name','replace','get','minValue','132099CPeyCO','CountDistinct','Invalid\x20connector_config\x20for\x20activation\x20\x22','getSchema','Value','All','emailRecipients','match','reverse','expr','repeatUnit','toLowerCase','3860046bxzKhd','stringify','email_recipients','738312NdLtGE','findIndex','values','repeat_frequency','all','getMetadata','Cannot\x20build\x20connector_config\x20for\x20activation\x20\x22','end_on','syndicationBehavior','column','include','value','rule:','behaviors','exclude','scheduleOption','scheduleType','Column','weekly','rule','lock_enabled','connectionId','set','visibility','localeCompare','duration','25cAiQiO','hour','repeatFrequency','has','parse','attributes','activations:','forEach','lockEnabled','notify_on','unit','4oVsOUF','repeat_sub_frequency','nested_workflow_name','\x22:\x20','all_columns','map','push','min','Count','timeWindow','Equal','segmentFolderId','not','28390RpnVZv','order_by','join_row','activationTemplateId','columns','runAfterJourneyRefresh','__UNRESOLVED__','length','connectorConfig','funnel_stage','attribute','operator','First','Last','CONNECTOR_INVALID_CONFIG','3384tHKbgx','8421baLpfg','3OJjPZC','schedule','Unknown\x20connection:\x20','attribute_name','connector_config','\x27:\x20','conditions[','rightValues','connection','Between','object','13610472PZWeCV','test','TimeWithinPast','INVALID_ARGUMENT','\x22:\x0a','.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.','nestedWorkflowName','behaviorTableName','segment','orderBy','behavior','ruleHashToName','every','type','repeatSubFrequency','isFinite','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','monthly','activation_template_id','Behavior','batch','arrayMatching','month','description','678369oFGwWV','limit','provides\x20no\x20getMetadata.\x20This\x20is\x20a\x20wiring\x20bug\x20in\x20tdx,\x20not\x20a\x20problem\x20with\x20your\x20YAML.','timezone','name','start_at','Unknown\x20email\x20recipient:\x20','conditions','max','joinRow','endOn','isVisible','realtime','isArray','Connector:\x20','minutes_interval','warn','filter','And','Composite','run_after_journey_refresh','flatMap','visible','INTERNAL','TimeRange','timestamp','cron','from','joinStrategy','keys','groupingColumns','Segment\x20description','nestedWorkflowProjectName','notification','rightValue','connectionNameToIdMap','Reference','add','JOURNEY_SYNTAX_ERROR','any','string','leftValue','null','startAt','maxValue','week','allColumns','syndicationBehaviors','behavior_table','usedNames','hourly','join_strategy','none','entries','kind','valid','CONNECTION_NOT_FOUND','__SEGMENT_REF__','New\x20Segment','warnings','daily','formatting','notifyOn','minute','orderColumn','connectionNameToTypeMap','sort','aggregation','source','repeat_unit','activations','localRuleToName','250lXqstW'];a193_0x30f8=function(){return _0xee2d4f;};return a193_0x30f8();}function isTemporalOperator(_0xe7d6c8){const _0x1ac5a9=a193_0x389ba7;return _0xe7d6c8===_0x1ac5a9(0x263)||_0xe7d6c8==='TimeWithinNext';}function isBetweenOperator(_0x5a4bef){const _0x36d76b=a193_0x389ba7;return _0x5a4bef===_0x36d76b(0x25f);}function getEffectiveValue(_0x22282a){const _0x8a3c9b=a193_0x389ba7,_0x136179=_0x22282a[_0x8a3c9b(0x215)];return _0x22282a[_0x8a3c9b(0x21e)]??_0x136179;}function parseNumericValue(_0x33364a){const _0x3a6075=a193_0x389ba7;if(typeof _0x33364a===_0x3a6075(0x260)&&_0x33364a!==null)return _0x33364a;if(_0x33364a==='')return _0x33364a;const _0x442791=Number(_0x33364a);return Number[_0x3a6075(0x270)](_0x442791)?_0x442791:_0x33364a;}function apiOperatorToYaml(_0x30a0ee){const _0x9ffc06=a193_0x389ba7;if(isBetweenOperator(_0x30a0ee[_0x9ffc06(0x26e)]))return{'type':mapApiOperatorType(_0x30a0ee[_0x9ffc06(0x26e)]),..._0x30a0ee[_0x9ffc06(0x244)]!==undefined&&{'not':_0x30a0ee[_0x9ffc06(0x244)]},..._0x30a0ee[_0x9ffc06(0x203)]!==undefined&&{'min':parseNumericValue(_0x30a0ee[_0x9ffc06(0x203)])},..._0x30a0ee[_0x9ffc06(0x1e3)]!==undefined&&{'max':parseNumericValue(_0x30a0ee[_0x9ffc06(0x1e3)])}};if(_0x30a0ee['type']==='TimeRange')return{'type':_0x9ffc06(0x1cf),..._0x30a0ee[_0x9ffc06(0x244)]!==undefined&&{'not':_0x30a0ee['not']},..._0x30a0ee['duration']!==undefined&&{'duration':_0x30a0ee[_0x9ffc06(0x22c)]},..._0x30a0ee[_0x9ffc06(0x1d2)]!==undefined&&{'from':_0x30a0ee[_0x9ffc06(0x1d2)]},..._0x30a0ee['reverse']!==undefined&&{'reverse':_0x30a0ee[_0x9ffc06(0x20c)]}};let _0x44349b;if(_0x30a0ee[_0x9ffc06(0x25d)]&&_0x30a0ee['rightValues'][_0x9ffc06(0x24c)]>0x0)_0x44349b=_0x30a0ee[_0x9ffc06(0x25d)];else{if(_0x30a0ee[_0x9ffc06(0x1d9)]!==undefined)_0x44349b=_0x30a0ee[_0x9ffc06(0x1d9)];else isTemporalOperator(_0x30a0ee['type'])&&_0x30a0ee[_0x9ffc06(0x21e)]!==undefined&&(_0x44349b=_0x30a0ee[_0x9ffc06(0x21e)]);}return{'type':mapApiOperatorType(_0x30a0ee['type']),..._0x30a0ee['not']!==undefined&&{'not':_0x30a0ee[_0x9ffc06(0x244)]},..._0x44349b!==undefined&&{'value':_0x44349b},..._0x30a0ee[_0x9ffc06(0x237)]!==undefined&&{'unit':_0x30a0ee['unit']}};}function mapApiOperatorType(_0xaaeb12){return _0xaaeb12;}export function segmentDefToCreateRequest(_0x27d83b,_0x56ea65){const _0x5d5164=a193_0x389ba7,_0xbf644f={'name':_0x27d83b[_0x5d5164(0x1bb)]};return _0x27d83b[_0x5d5164(0x278)]&&(_0xbf644f[_0x5d5164(0x278)]=_0x27d83b[_0x5d5164(0x278)]),_0x27d83b[_0x5d5164(0x226)]&&(_0xbf644f[_0x5d5164(0x226)]=yamlRuleToApi(_0x27d83b['rule'])),_0x27d83b['kind']&&(_0xbf644f[_0x5d5164(0x1ed)]=_0x27d83b[_0x5d5164(0x1ed)]===_0x5d5164(0x275)?0x0:_0x27d83b[_0x5d5164(0x1ed)]===_0x5d5164(0x1c3)?0x1:0x2),_0x27d83b[_0x5d5164(0x1cd)]!==undefined&&(_0xbf644f[_0x5d5164(0x1c2)]=_0x27d83b[_0x5d5164(0x1cd)]),_0x56ea65&&(_0xbf644f[_0x5d5164(0x243)]=_0x56ea65),_0xbf644f;}export function segmentDefToUpdateRequest(_0x3ba9f9){const _0x2b05e9=a193_0x389ba7,_0x555fb6={'name':_0x3ba9f9[_0x2b05e9(0x1bb)]};return _0x3ba9f9[_0x2b05e9(0x278)]!==undefined&&(_0x555fb6['description']=_0x3ba9f9[_0x2b05e9(0x278)]),_0x3ba9f9['rule']&&(_0x555fb6[_0x2b05e9(0x226)]=yamlRuleToApi(_0x3ba9f9[_0x2b05e9(0x226)])),_0x3ba9f9[_0x2b05e9(0x1ed)]&&(_0x555fb6[_0x2b05e9(0x1ed)]=_0x3ba9f9[_0x2b05e9(0x1ed)]===_0x2b05e9(0x275)?0x0:_0x3ba9f9['kind']===_0x2b05e9(0x1c3)?0x1:0x2),_0x555fb6;}export function yamlRuleToApi(_0x42e853){const _0x8c7b3c=a193_0x389ba7;if(_0x42e853['type']===_0x8c7b3c(0x1ca))return{'type':_0x8c7b3c(0x1ca),'conditions':_0x42e853['conditions'][_0x8c7b3c(0x23d)](yamlConditionToApi),..._0x42e853[_0x8c7b3c(0x278)]!==undefined&&{'description':_0x42e853[_0x8c7b3c(0x278)]},..._0x42e853[_0x8c7b3c(0x20d)]!==undefined&&{'expr':_0x42e853[_0x8c7b3c(0x20d)]}};const _0xde9e91=_0x42e853[_0x8c7b3c(0x1be)][_0x8c7b3c(0x23d)](yamlConditionToApi),_0x472d9d=_0xde9e91[_0x8c7b3c(0x26d)](_0x112f50=>isCompositeType(_0x112f50)&&_0x112f50['description']!==undefined);if(!_0x472d9d&&_0xde9e91[_0x8c7b3c(0x24c)]>0x0){const _0x44bf14=[];for(const _0x381142 of _0xde9e91){isCompositeType(_0x381142)&&_0x381142[_0x8c7b3c(0x278)]===undefined&&_0x381142[_0x8c7b3c(0x1be)]&&_0x381142[_0x8c7b3c(0x1be)]['every'](_0x5107f3=>!isCompositeType(_0x5107f3))?_0x44bf14[_0x8c7b3c(0x23e)]({'type':_0x381142[_0x8c7b3c(0x26e)],'description':'','conditions':_0x381142[_0x8c7b3c(0x1be)]}):_0x44bf14['push']({'type':'And','description':_0x42e853[_0x8c7b3c(0x278)]||'','conditions':[_0x381142]});}return{'type':_0x42e853['type'],'conditions':_0x44bf14};}return{'type':_0x42e853[_0x8c7b3c(0x26e)],'conditions':_0xde9e91,..._0x42e853['description']&&{'description':_0x42e853[_0x8c7b3c(0x278)]}};}function yamlFilterRuleToApi(_0x59c111){const _0x38271f=a193_0x389ba7,_0x4e2771=_0x59c111['conditions']['map'](yamlConditionToApi);return{'type':_0x59c111[_0x38271f(0x26e)],'conditions':_0x4e2771};}function yamlConditionToApi(_0x8c1df9){const _0x3cddf4=a193_0x389ba7;if(_0x3cddf4(0x269)in _0x8c1df9&&(_0x8c1df9[_0x3cddf4(0x26e)]===_0x3cddf4(0x21d)||_0x8c1df9[_0x3cddf4(0x26e)]===_0x3cddf4(0x221))){const _0xef7073=_0x8c1df9;return{'type':_0x3cddf4(0x1db),'id':_0xef7073[_0x3cddf4(0x269)],'exclude':_0xef7073[_0x3cddf4(0x26e)]===_0x3cddf4(0x221)};}if(_0x8c1df9[_0x3cddf4(0x26e)]==='And'||_0x8c1df9[_0x3cddf4(0x26e)]==='Or'||_0x8c1df9[_0x3cddf4(0x26e)]===_0x3cddf4(0x1ca)){const _0x333f7f=_0x8c1df9;return{'type':_0x333f7f[_0x3cddf4(0x26e)],'conditions':_0x333f7f[_0x3cddf4(0x1be)][_0x3cddf4(0x23d)](yamlConditionToApi),..._0x333f7f[_0x3cddf4(0x278)]&&{'description':_0x333f7f[_0x3cddf4(0x278)]},..._0x333f7f['expr']!==undefined&&{'expr':_0x333f7f[_0x3cddf4(0x20d)]}};}if(_0x3cddf4(0x21c)in _0x8c1df9&&_0x8c1df9[_0x3cddf4(0x26e)]===_0x3cddf4(0x224)){const _0x24a4ad=_0x8c1df9;return{'type':_0x3cddf4(0x224),'column':_0x24a4ad[_0x3cddf4(0x21c)],'operator':yamlOperatorToApi(_0x24a4ad[_0x3cddf4(0x250)])};}const _0x4e82f9=_0x8c1df9,_0x41d63a={'type':_0x3cddf4(0x208),'leftValue':buildLeftValue(_0x4e82f9),'operator':yamlOperatorToApi(_0x4e82f9[_0x3cddf4(0x250)]),'exclude':_0x4e82f9['exclude']??![],'arrayMatching':_0x4e82f9['arrayMatching']??'any'};return _0x4e82f9[_0x3cddf4(0x27a)]!==undefined&&(_0x41d63a[_0x3cddf4(0x27a)]=_0x4e82f9[_0x3cddf4(0x27a)]),_0x41d63a;}function buildAggregationDefFromApi(_0x27beb5){const _0x286039=a193_0x389ba7,_0x334420=_0x27beb5[_0x286039(0x26e)];if(_0x334420===_0x286039(0x205))return{'type':_0x334420,'columns':_0x27beb5['columns']??[]};if(_0x334420==='First'||_0x334420==='Last')return{'type':_0x334420,'column':_0x27beb5[_0x286039(0x21c)]??'','orderColumn':_0x27beb5[_0x286039(0x1f7)]??'',..._0x27beb5[_0x286039(0x1d5)]&&{'groupingColumns':_0x27beb5['groupingColumns']}};if(_0x334420==='Count')return{'type':_0x334420,..._0x27beb5['groupingColumns']&&{'groupingColumns':_0x27beb5['groupingColumns']}};return{'type':_0x334420,'column':_0x27beb5[_0x286039(0x21c)]??'',..._0x27beb5['groupingColumns']&&{'groupingColumns':_0x27beb5[_0x286039(0x1d5)]}};}function buildLeftValue(_0xc97d9){const _0x1153e3=a193_0x389ba7,_0x2fc184={};_0xc97d9['attribute']&&_0xc97d9[_0x1153e3(0x26e)]!=='Behavior'&&(_0x2fc184[_0x1153e3(0x1bb)]=_0xc97d9[_0x1153e3(0x24f)]);if(_0xc97d9[_0x1153e3(0x1fa)]){const _0x46c8e6=_0xc97d9['aggregation'];if(_0x46c8e6[_0x1153e3(0x26e)]===_0x1153e3(0x205))_0x2fc184['aggregation']={'type':'CountDistinct','columns':_0x46c8e6[_0x1153e3(0x249)]};else{if(_0x46c8e6[_0x1153e3(0x26e)]===_0x1153e3(0x251)||_0x46c8e6['type']===_0x1153e3(0x252))_0x2fc184['aggregation']={'type':_0x46c8e6[_0x1153e3(0x26e)],'column':_0x46c8e6[_0x1153e3(0x21c)],'orderColumn':_0x46c8e6['orderColumn'],..._0x46c8e6[_0x1153e3(0x1d5)]&&{'groupingColumns':_0x46c8e6[_0x1153e3(0x1d5)]}};else _0x46c8e6['type']===_0x1153e3(0x240)?_0x2fc184[_0x1153e3(0x1fa)]={'type':_0x1153e3(0x240),..._0x46c8e6['groupingColumns']&&{'groupingColumns':_0x46c8e6[_0x1153e3(0x1d5)]}}:_0x2fc184[_0x1153e3(0x1fa)]={'type':_0x46c8e6[_0x1153e3(0x26e)],'column':_0x46c8e6[_0x1153e3(0x21c)],..._0x46c8e6['groupingColumns']&&{'groupingColumns':_0x46c8e6[_0x1153e3(0x1d5)]}};}}_0xc97d9[_0x1153e3(0x1fb)]&&(_0x2fc184[_0x1153e3(0x1fb)]={'name':_0xc97d9[_0x1153e3(0x1fb)]});const _0x5bdcd0=_0xc97d9[_0x1153e3(0x26e)]==='Behavior'?_0xc97d9[_0x1153e3(0x241)]:undefined,_0x25a111=_0x5bdcd0?[buildTimeWindowCondition(_0x5bdcd0)]:[],_0x503232=[..._0xc97d9[_0x1153e3(0x1c8)]?.[_0x1153e3(0x1be)]??[],..._0x25a111];return _0x503232[_0x1153e3(0x24c)]>0x0&&(_0x2fc184['filter']=yamlFilterRuleToApi(filterRuleAsRuleDef({'type':'And','conditions':_0x503232}))),_0x2fc184;}function buildTimeWindowCondition(_0x24f2d2){const _0xfc1f3e=a193_0x389ba7;return{'type':_0xfc1f3e(0x224),'column':_0xfc1f3e(0x1d0),'operator':{'type':_0xfc1f3e(0x263),'value':_0x24f2d2['duration'],'unit':_0x24f2d2['unit']}};}function extractTimeWindow(_0xa2cf03){const _0x37e08b=a193_0x389ba7;if(!_0xa2cf03?.[_0x37e08b(0x1be)]?.[_0x37e08b(0x24c)])return{'remainingFilter':_0xa2cf03};const _0x5bf851=_0xa2cf03[_0x37e08b(0x1be)][_0x37e08b(0x214)](_0x290768=>_0x290768[_0x37e08b(0x26e)]===_0x37e08b(0x224)&&_0x290768['column']==='timestamp'&&_0x290768[_0x37e08b(0x250)]?.['type']===_0x37e08b(0x263)&&!_0x290768[_0x37e08b(0x250)][_0x37e08b(0x244)]&&typeof _0x290768[_0x37e08b(0x250)][_0x37e08b(0x21e)]==='number'&&typeof _0x290768[_0x37e08b(0x250)][_0x37e08b(0x237)]==='string');if(_0x5bf851===-0x1)return{'remainingFilter':_0xa2cf03};const _0x134ecc=_0xa2cf03[_0x37e08b(0x1be)][_0x5bf851],_0x30428b=_0xa2cf03[_0x37e08b(0x1be)][_0x37e08b(0x1c8)]((_0xfb38ef,_0x5401e7)=>_0x5401e7!==_0x5bf851);return{'timeWindow':{'duration':_0x134ecc[_0x37e08b(0x250)][_0x37e08b(0x21e)],'unit':_0x134ecc[_0x37e08b(0x250)][_0x37e08b(0x237)]},'remainingFilter':_0x30428b[_0x37e08b(0x24c)]>0x0?{..._0xa2cf03,'conditions':_0x30428b}:undefined};}function yamlOperatorToApi(_0x321e47){const _0x1738f0=a193_0x389ba7,_0x3d6337={'type':mapYamlOperatorType(_0x321e47[_0x1738f0(0x26e)]),'not':_0x321e47[_0x1738f0(0x244)]??![]};if(isBetweenOperator(_0x321e47[_0x1738f0(0x26e)]))return _0x321e47['min']!==undefined&&(_0x3d6337[_0x1738f0(0x203)]=typeof _0x321e47[_0x1738f0(0x23f)]===_0x1738f0(0x260)?_0x321e47['min']:String(_0x321e47[_0x1738f0(0x23f)])),_0x321e47['max']!==undefined&&(_0x3d6337['maxValue']=typeof _0x321e47[_0x1738f0(0x1bf)]==='object'?_0x321e47[_0x1738f0(0x1bf)]:String(_0x321e47[_0x1738f0(0x1bf)])),_0x3d6337;if(_0x321e47['type']===_0x1738f0(0x1cf))return _0x321e47[_0x1738f0(0x22c)]&&(_0x3d6337[_0x1738f0(0x22c)]=_0x321e47['duration']),_0x321e47['from']&&(_0x3d6337[_0x1738f0(0x1d2)]=_0x321e47[_0x1738f0(0x1d2)]),_0x321e47[_0x1738f0(0x20c)]!==undefined&&(_0x3d6337['reverse']=_0x321e47['reverse']),_0x3d6337;const _0x48d19e=getEffectiveValue(_0x321e47);if(_0x48d19e!==undefined){if(Array[_0x1738f0(0x1c4)](_0x48d19e))_0x3d6337[_0x1738f0(0x25d)]=_0x48d19e;else isTemporalOperator(_0x321e47[_0x1738f0(0x26e)])?_0x3d6337[_0x1738f0(0x21e)]=_0x48d19e:_0x3d6337['rightValue']=_0x48d19e;}return _0x321e47[_0x1738f0(0x237)]&&(_0x3d6337['unit']=_0x321e47['unit']),_0x3d6337;}function mapYamlOperatorType(_0x85d292){return _0x85d292;}export function toYamlString(_0x435842){const _0x41c416=a193_0x389ba7,_0x1fc9d8=JSON[_0x41c416(0x231)](JSON[_0x41c416(0x211)](_0x435842)),_0x485292=a193_0x4e4a39['stringify'](_0x1fc9d8,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x41c416(0x1e1)}),_0x236910=['rule:'];let _0x1dd1d9=_0x485292;for(const _0x3cfb2c of _0x236910){_0x1dd1d9=_0x1dd1d9[_0x41c416(0x201)](new RegExp('^('+_0x3cfb2c+')','m'),(_0x4c4741,_0x28492e,_0x7a5f7d)=>{if(_0x7a5f7d===0x0||_0x1dd1d9[_0x7a5f7d-0x1]==='\x0a'&&_0x1dd1d9[_0x7a5f7d-0x2]==='\x0a')return _0x28492e;return'\x0a'+_0x28492e;});}return _0x1dd1d9;}export function parseYamlString(_0x4bfe23){return parseSegmentYamlFile(_0x4bfe23);}export function isSegmentYaml(_0x185c7b){const _0x31fba9=a193_0x389ba7;if(typeof _0x185c7b!==_0x31fba9(0x260)||_0x185c7b===null)return![];const _0x44789d=_0x185c7b;return _0x44789d[_0x31fba9(0x26e)]===_0x31fba9(0x269)||_0x44789d[_0x31fba9(0x26e)]===undefined;}export function generateTemplate(_0x318c13=a193_0x389ba7(0x1f1)){const _0x4cb6e3=a193_0x389ba7,_0x3876bb={'type':'segment','name':_0x318c13,'description':_0x4cb6e3(0x1d6),'rule':{'type':_0x4cb6e3(0x1c9),'conditions':[{'type':_0x4cb6e3(0x208),'attribute':_0x4cb6e3(0x259),'operator':{'type':_0x4cb6e3(0x242),'value':'value'}}]}};return toYamlString(_0x3876bb);}export function segmentToYamlString(_0xe3c177){const _0xcd75ac=a193_0x389ba7,_0x2eac45=JSON[_0xcd75ac(0x231)](JSON[_0xcd75ac(0x211)](_0xe3c177)),_0x3851a2=a193_0x4e4a39[_0xcd75ac(0x211)](_0x2eac45,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xcd75ac(0x1e1)}),_0x3a60d3=[_0xcd75ac(0x21f),_0xcd75ac(0x233)];let _0x212c71=_0x3851a2;for(const _0x20091a of _0x3a60d3){_0x212c71=_0x212c71[_0xcd75ac(0x201)](new RegExp('^('+_0x20091a+')','m'),(_0x201844,_0x15c0de,_0x1ce613)=>{if(_0x1ce613===0x0||_0x212c71[_0x1ce613-0x1]==='\x0a'&&_0x212c71[_0x1ce613-0x2]==='\x0a')return _0x15c0de;return'\x0a'+_0x15c0de;});}return _0x212c71;}export function parseSegmentYamlFile(_0x41079f){return safeParseYaml(_0x41079f,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x4991e4){const _0x285021=a193_0x389ba7;return{'type':_0x285021(0x269),'name':_0x4991e4[_0x285021(0x1bb)],..._0x4991e4[_0x285021(0x278)]!==undefined&&{'description':_0x4991e4[_0x285021(0x278)]},..._0x4991e4['folder']!==undefined&&{'folder':_0x4991e4['folder']},..._0x4991e4[_0x285021(0x226)]&&{'rule':normalizeRule(_0x4991e4[_0x285021(0x226)])},..._0x4991e4['kind']!==undefined&&{'kind':_0x4991e4[_0x285021(0x1ed)]},..._0x4991e4[_0x285021(0x1cd)]!==undefined&&{'visible':_0x4991e4['visible']},..._0x4991e4[_0x285021(0x1fd)]&&{'activations':_0x4991e4[_0x285021(0x1fd)][_0x285021(0x23d)](normalizeActivation)}};}export function normalizeRule(_0x44d9e3){const _0x1b99d9=a193_0x389ba7;return{'type':_0x44d9e3['type'],'conditions':_0x44d9e3[_0x1b99d9(0x1be)][_0x1b99d9(0x23d)](normalizeCondition),..._0x44d9e3[_0x1b99d9(0x278)]!==undefined&&{'description':_0x44d9e3[_0x1b99d9(0x278)]},..._0x44d9e3['expr']!==undefined&&{'expr':_0x44d9e3['expr']}};}function normalizeCondition(_0x1f19d4){const _0x205d2f=a193_0x389ba7;if('segment'in _0x1f19d4&&(_0x1f19d4[_0x205d2f(0x26e)]===_0x205d2f(0x21d)||_0x1f19d4[_0x205d2f(0x26e)]==='exclude')){const _0x4db9e7=_0x1f19d4;return{'type':_0x4db9e7[_0x205d2f(0x26e)],'segment':_0x4db9e7[_0x205d2f(0x269)]};}if(_0x1f19d4[_0x205d2f(0x26e)]===_0x205d2f(0x1c9)||_0x1f19d4[_0x205d2f(0x26e)]==='Or'||_0x1f19d4[_0x205d2f(0x26e)]===_0x205d2f(0x1ca)){const _0x3e67b7=_0x1f19d4;return{'type':_0x3e67b7[_0x205d2f(0x26e)],'conditions':_0x3e67b7[_0x205d2f(0x1be)]['map'](normalizeCondition),..._0x3e67b7[_0x205d2f(0x278)]!==undefined&&{'description':_0x3e67b7[_0x205d2f(0x278)]},..._0x3e67b7['expr']!==undefined&&{'expr':_0x3e67b7[_0x205d2f(0x20d)]}};}if(_0x205d2f(0x21c)in _0x1f19d4&&_0x1f19d4[_0x205d2f(0x26e)]===_0x205d2f(0x224)){const _0x37cbc8=_0x1f19d4;return{'type':_0x205d2f(0x224),'column':_0x37cbc8[_0x205d2f(0x21c)],'operator':normalizeOperator(_0x37cbc8[_0x205d2f(0x250)])};}if(_0x1f19d4[_0x205d2f(0x26e)]==='Behavior'){const _0x5b7ae5=_0x1f19d4;return{'type':'Behavior','attribute':_0x5b7ae5['attribute'],'operator':normalizeOperator(_0x5b7ae5[_0x205d2f(0x250)]),..._0x5b7ae5[_0x205d2f(0x276)]!==undefined&&{'arrayMatching':_0x5b7ae5['arrayMatching']},..._0x5b7ae5[_0x205d2f(0x221)]!==undefined&&{'exclude':_0x5b7ae5['exclude']},..._0x5b7ae5[_0x205d2f(0x1fa)]!==undefined&&{'aggregation':_0x5b7ae5[_0x205d2f(0x1fa)]},..._0x5b7ae5['source']!==undefined&&{'source':_0x5b7ae5[_0x205d2f(0x1fb)]},..._0x5b7ae5[_0x205d2f(0x1c8)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x5b7ae5[_0x205d2f(0x1c8)])))},..._0x5b7ae5['timeWindow']!==undefined&&{'timeWindow':_0x5b7ae5[_0x205d2f(0x241)]},..._0x5b7ae5['limit']!==undefined&&{'limit':_0x5b7ae5['limit']}};}const _0x4ad11f=_0x1f19d4;return{'type':_0x205d2f(0x208),'attribute':_0x4ad11f[_0x205d2f(0x24f)],'operator':normalizeOperator(_0x4ad11f['operator']),..._0x4ad11f[_0x205d2f(0x276)]!==undefined&&{'arrayMatching':_0x4ad11f[_0x205d2f(0x276)]},..._0x4ad11f[_0x205d2f(0x221)]!==undefined&&{'exclude':_0x4ad11f[_0x205d2f(0x221)]},..._0x4ad11f[_0x205d2f(0x1fa)]!==undefined&&{'aggregation':_0x4ad11f[_0x205d2f(0x1fa)]},..._0x4ad11f[_0x205d2f(0x1fb)]!==undefined&&{'source':_0x4ad11f[_0x205d2f(0x1fb)]},..._0x4ad11f[_0x205d2f(0x1c8)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x4ad11f[_0x205d2f(0x1c8)])))},..._0x4ad11f[_0x205d2f(0x27a)]!==undefined&&{'limit':_0x4ad11f[_0x205d2f(0x27a)]}};}function normalizeOperator(_0xb754ef){const _0x2efd7e=a193_0x389ba7;if(isBetweenOperator(_0xb754ef[_0x2efd7e(0x26e)]))return{'type':_0xb754ef[_0x2efd7e(0x26e)],..._0xb754ef[_0x2efd7e(0x244)]!==undefined&&{'not':_0xb754ef[_0x2efd7e(0x244)]},..._0xb754ef[_0x2efd7e(0x23f)]!==undefined&&{'min':_0xb754ef[_0x2efd7e(0x23f)]},..._0xb754ef[_0x2efd7e(0x1bf)]!==undefined&&{'max':_0xb754ef[_0x2efd7e(0x1bf)]}};const _0x5d9473=getEffectiveValue(_0xb754ef);return{'type':_0xb754ef[_0x2efd7e(0x26e)],..._0xb754ef[_0x2efd7e(0x244)]!==undefined&&{'not':_0xb754ef[_0x2efd7e(0x244)]},..._0x5d9473!==undefined&&{'value':_0x5d9473},..._0xb754ef[_0x2efd7e(0x237)]!==undefined&&{'unit':_0xb754ef[_0x2efd7e(0x237)]},..._0xb754ef['duration']!==undefined&&{'duration':_0xb754ef[_0x2efd7e(0x22c)]},..._0xb754ef[_0x2efd7e(0x1d2)]!==undefined&&{'from':_0xb754ef[_0x2efd7e(0x1d2)]},..._0xb754ef['reverse']!==undefined&&{'reverse':_0xb754ef[_0x2efd7e(0x20c)]}};}function normalizeActivation(_0x10fd90){const _0x166808=a193_0x389ba7;return{'name':_0x10fd90['name'],'connection':_0x10fd90['connection'],..._0x10fd90[_0x166808(0x278)]!==undefined&&{'description':_0x10fd90[_0x166808(0x278)]},..._0x10fd90[_0x166808(0x23c)]!==undefined&&{'all_columns':_0x10fd90[_0x166808(0x23c)]},..._0x10fd90[_0x166808(0x249)]!==undefined&&{'columns':_0x10fd90[_0x166808(0x249)]},..._0x10fd90[_0x166808(0x26b)]!==undefined&&{'behavior':_0x10fd90['behavior']},..._0x10fd90[_0x166808(0x220)]!==undefined&&{'behaviors':_0x10fd90[_0x166808(0x220)]},..._0x10fd90[_0x166808(0x257)]!==undefined&&{'schedule':_0x10fd90[_0x166808(0x257)]},..._0x10fd90[_0x166808(0x1d8)]!==undefined&&{'notification':_0x10fd90[_0x166808(0x1d8)]},..._0x10fd90[_0x166808(0x25a)]!==undefined&&{'connector_config':_0x10fd90[_0x166808(0x25a)]},..._0x10fd90[_0x166808(0x273)]!==undefined&&{'activation_template_id':_0x10fd90['activation_template_id']},..._0x10fd90[_0x166808(0x200)]!==undefined&&{'nested_workflow_project_name':_0x10fd90[_0x166808(0x200)]},..._0x10fd90[_0x166808(0x23a)]!==undefined&&{'nested_workflow_name':_0x10fd90['nested_workflow_name']},..._0x10fd90[_0x166808(0x227)]!==undefined&&{'lock_enabled':_0x10fd90['lock_enabled']}};}function getColumnName(_0x170518){const _0x36d21f=a193_0x389ba7;return _0x170518[_0x36d21f(0x21c)]||_0x170518[_0x36d21f(0x1bb)];}function behaviorApiToDef(_0x5e5b79){const _0x2ec669=a193_0x389ba7,_0x170ac5={};return _0x5e5b79[_0x2ec669(0x249)]&&_0x5e5b79[_0x2ec669(0x249)][_0x2ec669(0x24c)]>0x0&&(_0x170ac5[_0x2ec669(0x249)]=_0x5e5b79[_0x2ec669(0x249)][_0x2ec669(0x1c8)](_0x3b6c8b=>_0x3b6c8b&&getColumnName(_0x3b6c8b))[_0x2ec669(0x23d)](_0x3a42e1=>({'name':getColumnName(_0x3a42e1),..._0x3a42e1[_0x2ec669(0x26e)]&&{'type':_0x3a42e1[_0x2ec669(0x26e)]},..._0x3a42e1[_0x2ec669(0x22a)]&&{'visibility':_0x3a42e1[_0x2ec669(0x22a)]}}))),_0x5e5b79[_0x2ec669(0x268)]&&(_0x170ac5[_0x2ec669(0x1e7)]=_0x5e5b79[_0x2ec669(0x268)]),_0x5e5b79[_0x2ec669(0x1c0)]!==undefined&&(_0x170ac5['join_row']=_0x5e5b79[_0x2ec669(0x1c0)]),_0x5e5b79[_0x2ec669(0x1d3)]&&(_0x170ac5[_0x2ec669(0x1ea)]=_0x5e5b79[_0x2ec669(0x1d3)]),_0x5e5b79[_0x2ec669(0x1f4)]&&(_0x170ac5[_0x2ec669(0x1f4)]=_0x5e5b79['formatting']),_0x5e5b79['orderBy']&&_0x5e5b79[_0x2ec669(0x26a)][_0x2ec669(0x24c)]>0x0&&(_0x170ac5[_0x2ec669(0x246)]=_0x5e5b79[_0x2ec669(0x26a)]),_0x170ac5;}function behaviorsApiToDef(_0x57f89e){const _0x1ff329=a193_0x389ba7;return _0x57f89e[_0x1ff329(0x23d)](behaviorApiToDef)[_0x1ff329(0x1c8)](_0x20fb1c=>Object[_0x1ff329(0x1d4)](_0x20fb1c)['length']>0x0);}export function activationResponseToDef(_0x57bf39,_0x472558,_0x9c1078){const _0x37bde6=a193_0x389ba7,_0x1febce=_0x57bf39[_0x37bde6(0x228)]||'',_0x29c467=_0x9c1078?.[_0x37bde6(0x202)](_0x1febce)??_0x1febce,_0x457d69={'name':_0x57bf39[_0x37bde6(0x1bb)],'connection':_0x29c467};_0x57bf39['description']&&(_0x457d69[_0x37bde6(0x278)]=_0x57bf39[_0x37bde6(0x278)]);let _0x185ebf=[];_0x57bf39[_0x37bde6(0x249)]&&_0x57bf39['columns'][_0x37bde6(0x24c)]>0x0&&(_0x185ebf=_0x57bf39['columns'][_0x37bde6(0x1c8)](_0xd1e496=>_0xd1e496&&getColumnName(_0xd1e496))['map'](_0x38349e=>{const _0x16a09f=_0x37bde6,_0x552759=getColumnName(_0x38349e);if(_0x38349e[_0x16a09f(0x26e)]||_0x38349e[_0x16a09f(0x22a)])return{'name':_0x552759,..._0x38349e[_0x16a09f(0x26e)]&&{'type':_0x38349e['type']},..._0x38349e[_0x16a09f(0x22a)]&&{'visibility':_0x38349e['visibility']}};return _0x552759;}));_0x185ebf[_0x37bde6(0x24c)]>0x0&&(_0x457d69[_0x37bde6(0x249)]=_0x185ebf);_0x57bf39[_0x37bde6(0x1e5)]!==undefined&&(_0x57bf39[_0x37bde6(0x1e5)]===![]&&_0x185ebf[_0x37bde6(0x24c)]===0x0?_0x457d69['all_columns']=!![]:_0x457d69[_0x37bde6(0x23c)]=_0x57bf39[_0x37bde6(0x1e5)]);const _0x1faf24={};let _0x44a2b0=![];_0x57bf39[_0x37bde6(0x223)]&&(_0x1faf24['type']=_0x57bf39[_0x37bde6(0x223)],_0x44a2b0=!![]);_0x57bf39[_0x37bde6(0x20e)]&&(_0x1faf24[_0x37bde6(0x1fc)]=_0x57bf39[_0x37bde6(0x20e)],_0x44a2b0=!![]);_0x57bf39[_0x37bde6(0x22f)]!==undefined&&_0x57bf39[_0x37bde6(0x22f)]!==null&&(_0x1faf24['repeat_frequency']=_0x57bf39['repeatFrequency'],_0x44a2b0=!![]);_0x57bf39['repeatSubFrequency']&&_0x57bf39[_0x37bde6(0x26f)]['length']>0x0&&(_0x1faf24['repeat_sub_frequency']=_0x57bf39[_0x37bde6(0x26f)],_0x44a2b0=!![]);_0x57bf39[_0x37bde6(0x1e2)]!==undefined&&(_0x1faf24[_0x37bde6(0x1bc)]=_0x57bf39[_0x37bde6(0x1e2)],_0x44a2b0=!![]);_0x57bf39['endOn']!==undefined&&(_0x1faf24[_0x37bde6(0x21a)]=_0x57bf39[_0x37bde6(0x1c1)],_0x44a2b0=!![]);_0x57bf39['timezone']&&(_0x1faf24[_0x37bde6(0x1ba)]=_0x57bf39['timezone'],_0x44a2b0=!![]);_0x44a2b0&&(_0x457d69['schedule']=_0x1faf24);(_0x57bf39[_0x37bde6(0x1f5)]&&_0x57bf39[_0x37bde6(0x1f5)][_0x37bde6(0x24c)]>0x0||_0x57bf39[_0x37bde6(0x20a)]&&_0x57bf39[_0x37bde6(0x20a)]['length']>0x0)&&(_0x457d69[_0x37bde6(0x1d8)]={},_0x57bf39['notifyOn']&&_0x57bf39['notifyOn'][_0x37bde6(0x24c)]>0x0&&(_0x457d69[_0x37bde6(0x1d8)][_0x37bde6(0x236)]=_0x57bf39[_0x37bde6(0x1f5)]),_0x57bf39['emailRecipients']&&_0x57bf39[_0x37bde6(0x20a)][_0x37bde6(0x24c)]>0x0&&(_0x457d69[_0x37bde6(0x1d8)][_0x37bde6(0x212)]=_0x57bf39[_0x37bde6(0x20a)][_0x37bde6(0x23d)](_0x461788=>{const _0xaf9172=_0x37bde6,_0x1f9006=_0x472558?.[_0xaf9172(0x202)](_0x461788);return _0x1f9006??String(_0x461788);})));_0x57bf39[_0x37bde6(0x24d)]&&Object[_0x37bde6(0x1d4)](_0x57bf39['connectorConfig'])[_0x37bde6(0x24c)]>0x0&&(_0x457d69[_0x37bde6(0x25a)]=normalizeConnectorConfigForYaml(_0x57bf39[_0x37bde6(0x24d)]));_0x57bf39['activationTemplateId']&&(_0x457d69[_0x37bde6(0x273)]=_0x57bf39[_0x37bde6(0x248)]);if(_0x57bf39[_0x37bde6(0x1e6)]&&_0x57bf39['syndicationBehaviors'][_0x37bde6(0x24c)]>0x0){const _0x46bda2=behaviorsApiToDef(_0x57bf39[_0x37bde6(0x1e6)]);_0x46bda2[_0x37bde6(0x24c)]>0x0&&(_0x457d69[_0x37bde6(0x220)]=_0x46bda2);}return _0x57bf39[_0x37bde6(0x1d7)]&&(_0x457d69[_0x37bde6(0x200)]=_0x57bf39['nestedWorkflowProjectName']),_0x57bf39[_0x37bde6(0x267)]&&(_0x457d69['nested_workflow_name']=_0x57bf39[_0x37bde6(0x267)]),_0x57bf39[_0x37bde6(0x235)]!==undefined&&(_0x457d69['lock_enabled']=_0x57bf39[_0x37bde6(0x235)]),_0x457d69;}export function journeyActivationStepToYaml(_0x176c0e,_0x332ea5,_0x29d471){const _0xa6540=a193_0x389ba7,_0xef41d2=_0x176c0e[_0xa6540(0x232)]['activationParams'],_0x5d16e9=_0xef41d2[_0xa6540(0x228)]||'',_0x30f353=_0x29d471?.[_0xa6540(0x202)](_0x5d16e9)??_0x5d16e9,_0x59c231={'name':_0xef41d2[_0xa6540(0x1bb)]||'','connection':_0x30f353};_0x176c0e[_0xa6540(0x232)][_0xa6540(0x24a)]&&(_0x59c231[_0xa6540(0x1cb)]=!![]);_0xef41d2['description']&&(_0x59c231[_0xa6540(0x278)]=_0xef41d2[_0xa6540(0x278)]);let _0x4433bf=[];_0xef41d2[_0xa6540(0x249)]&&_0xef41d2['columns']['length']>0x0&&(_0x4433bf=_0xef41d2['columns'][_0xa6540(0x1c8)](_0x1e4b21=>_0x1e4b21&&getColumnName(_0x1e4b21))['map'](_0x24ea06=>{const _0x1afd8e=_0xa6540,_0x54d031=getColumnName(_0x24ea06);if(_0x24ea06['type']||_0x24ea06['visibility'])return{'name':_0x54d031,..._0x24ea06['type']&&{'type':_0x24ea06['type']},..._0x24ea06[_0x1afd8e(0x22a)]&&{'visibility':_0x24ea06[_0x1afd8e(0x22a)]}};return _0x54d031;}));_0x4433bf[_0xa6540(0x24c)]>0x0&&(_0x59c231[_0xa6540(0x249)]=_0x4433bf);_0xef41d2[_0xa6540(0x1e5)]!==undefined&&(_0xef41d2['allColumns']===![]&&_0x4433bf[_0xa6540(0x24c)]===0x0?_0x59c231[_0xa6540(0x23c)]=!![]:_0x59c231[_0xa6540(0x23c)]=_0xef41d2[_0xa6540(0x1e5)]);const _0x30c137={};let _0x49ef0f=![];_0xef41d2[_0xa6540(0x223)]&&(_0x30c137[_0xa6540(0x26e)]=_0xef41d2['scheduleType'],_0x49ef0f=!![]);_0xef41d2[_0xa6540(0x20e)]&&(_0x30c137[_0xa6540(0x1fc)]=_0xef41d2[_0xa6540(0x20e)],_0x49ef0f=!![]);_0xef41d2['repeatFrequency']!==undefined&&_0xef41d2[_0xa6540(0x22f)]!==null&&(_0x30c137[_0xa6540(0x216)]=_0xef41d2[_0xa6540(0x22f)],_0x49ef0f=!![]);_0xef41d2['startAt']!==undefined&&(_0x30c137[_0xa6540(0x1bc)]=_0xef41d2['startAt'],_0x49ef0f=!![]);_0xef41d2[_0xa6540(0x1c1)]!==undefined&&(_0x30c137['end_on']=_0xef41d2[_0xa6540(0x1c1)],_0x49ef0f=!![]);_0xef41d2[_0xa6540(0x1ba)]&&(_0x30c137['timezone']=_0xef41d2[_0xa6540(0x1ba)],_0x49ef0f=!![]);_0x49ef0f&&(_0x59c231[_0xa6540(0x257)]=_0x30c137);(_0xef41d2[_0xa6540(0x1f5)]&&_0xef41d2[_0xa6540(0x1f5)]['length']>0x0||_0xef41d2[_0xa6540(0x20a)]&&_0xef41d2[_0xa6540(0x20a)]['length']>0x0)&&(_0x59c231[_0xa6540(0x1d8)]={},_0xef41d2[_0xa6540(0x1f5)]&&_0xef41d2['notifyOn'][_0xa6540(0x24c)]>0x0&&(_0x59c231[_0xa6540(0x1d8)][_0xa6540(0x236)]=_0xef41d2[_0xa6540(0x1f5)]),_0xef41d2[_0xa6540(0x20a)]&&_0xef41d2['emailRecipients'][_0xa6540(0x24c)]>0x0&&(_0x59c231[_0xa6540(0x1d8)][_0xa6540(0x212)]=_0xef41d2[_0xa6540(0x20a)][_0xa6540(0x23d)](_0x2777a1=>{const _0x353b2e=_0xa6540,_0x4d8861=_0x332ea5?.[_0x353b2e(0x202)](_0x2777a1);return _0x4d8861??String(_0x2777a1);})));_0xef41d2[_0xa6540(0x24d)]&&Object[_0xa6540(0x1d4)](_0xef41d2['connectorConfig'])[_0xa6540(0x24c)]>0x0&&(_0x59c231[_0xa6540(0x25a)]=normalizeConnectorConfigForYaml(_0xef41d2[_0xa6540(0x24d)]));_0xef41d2[_0xa6540(0x248)]&&(_0x59c231[_0xa6540(0x273)]=_0xef41d2[_0xa6540(0x248)]);if(_0xef41d2[_0xa6540(0x1e6)]&&_0xef41d2[_0xa6540(0x1e6)][_0xa6540(0x24c)]>0x0){const _0x5c8095=behaviorsApiToDef(_0xef41d2[_0xa6540(0x1e6)]);_0x5c8095['length']>0x0&&(_0x59c231[_0xa6540(0x220)]=_0x5c8095);}return _0x59c231;}export function segmentWithActivationsToYaml(_0x9cc006,_0x5caf32,_0x50f6b9,_0x22c2d4,_0x4fcad6){const _0x4b2a93=a193_0x389ba7,_0x1539c0=segmentResponseToDefSync(_0x9cc006,_0x50f6b9);return _0x5caf32[_0x4b2a93(0x24c)]>0x0&&(_0x1539c0[_0x4b2a93(0x1fd)]=_0x5caf32['map'](_0x184ffd=>activationResponseToDef(_0x184ffd,_0x22c2d4,_0x4fcad6))),_0x1539c0;}function normalizeColumn(_0x12fef1){const _0x2229e2=a193_0x389ba7;if(typeof _0x12fef1===_0x2229e2(0x1df))return{'column':_0x12fef1,'source':{'column':_0x12fef1}};return{'column':_0x12fef1['name'],'source':{'column':_0x12fef1[_0x2229e2(0x1bb)]},..._0x12fef1[_0x2229e2(0x26e)]&&{'type':_0x12fef1[_0x2229e2(0x26e)]},..._0x12fef1[_0x2229e2(0x22a)]&&{'visibility':_0x12fef1[_0x2229e2(0x22a)]}};}function behaviorDefToApi(_0x4d39d2){const _0x578434=a193_0x389ba7,_0x250c57={};if(_0x4d39d2[_0x578434(0x249)]&&_0x4d39d2[_0x578434(0x249)][_0x578434(0x24c)]>0x0){const _0x46d13d=_0x4d39d2[_0x578434(0x249)]['filter'](_0x4833d6=>typeof _0x4833d6===_0x578434(0x1df)?_0x4833d6:_0x4833d6[_0x578434(0x1bb)])[_0x578434(0x23d)](normalizeColumn);_0x46d13d[_0x578434(0x24c)]>0x0&&(_0x250c57[_0x578434(0x249)]=_0x46d13d);}_0x4d39d2[_0x578434(0x1e7)]&&(_0x250c57[_0x578434(0x268)]=_0x4d39d2['behavior_table']);_0x4d39d2[_0x578434(0x1ea)]&&(_0x250c57['joinStrategy']=_0x4d39d2[_0x578434(0x1ea)]);if(_0x4d39d2[_0x578434(0x247)]!==undefined)_0x250c57['joinRow']=_0x4d39d2[_0x578434(0x247)];else{if(_0x4d39d2[_0x578434(0x1ea)]===_0x578434(0x252)||_0x4d39d2[_0x578434(0x1ea)]===_0x578434(0x251))_0x250c57[_0x578434(0x1c0)]=0x1;else _0x4d39d2[_0x578434(0x1ea)]===_0x578434(0x209)&&(_0x250c57[_0x578434(0x1c0)]=null);}return _0x4d39d2['formatting']&&(_0x250c57[_0x578434(0x1f4)]=_0x4d39d2[_0x578434(0x1f4)]),_0x4d39d2[_0x578434(0x246)]&&(_0x250c57[_0x578434(0x26a)]=_0x4d39d2['order_by']),_0x250c57;}export async function activationDefToCreateRequest(_0x5ba9d6,_0x36f06f){const _0x353f80=a193_0x389ba7,_0x232c91=_0x36f06f?.['emailToIdMap'],_0x1f3dec=_0x36f06f?.[_0x353f80(0x1da)],_0x3a9650=_0x5ba9d6[_0x353f80(0x25e)];let _0x50e7f5;const _0x261cba=parseInt(_0x3a9650,0xa);if(!isNaN(_0x261cba)&&String(_0x261cba)===_0x3a9650)_0x50e7f5=_0x261cba;else{const _0x200784=_0x1f3dec?.[_0x353f80(0x202)](_0x3a9650);if(_0x200784===undefined)throw new SDKError(ErrorCode[_0x353f80(0x1ef)],_0x353f80(0x258)+_0x3a9650,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x50e7f5=_0x200784;}const _0x15866b={'name':_0x5ba9d6[_0x353f80(0x1bb)],'connectionId':_0x50e7f5};_0x5ba9d6[_0x353f80(0x278)]&&(_0x15866b['description']=_0x5ba9d6[_0x353f80(0x278)]);let _0x87b400=[];_0x5ba9d6[_0x353f80(0x249)]&&_0x5ba9d6['columns']['length']>0x0&&(_0x87b400=_0x5ba9d6[_0x353f80(0x249)][_0x353f80(0x1c8)](_0x581ef8=>_0x581ef8!=null)[_0x353f80(0x23d)](normalizeColumn));_0x87b400[_0x353f80(0x24c)]>0x0&&(_0x15866b['columns']=_0x87b400);_0x5ba9d6[_0x353f80(0x23c)]!==undefined&&(_0x5ba9d6[_0x353f80(0x23c)]===![]&&_0x87b400[_0x353f80(0x24c)]===0x0?_0x15866b[_0x353f80(0x1e5)]=!![]:_0x15866b[_0x353f80(0x1e5)]=_0x5ba9d6[_0x353f80(0x23c)]);if(_0x5ba9d6['schedule']){const _0x43c335=_0x5ba9d6[_0x353f80(0x257)],_0x50ee8c=_0x43c335[_0x353f80(0x26e)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x43c335[_0x353f80(0x1fc)]];_0x50ee8c&&(_0x15866b[_0x353f80(0x223)]=_0x50ee8c);const _0x5d72f6=_0x43c335[_0x353f80(0x1fc)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x43c335[_0x353f80(0x26e)]];_0x5d72f6&&(_0x15866b[_0x353f80(0x20e)]=_0x5d72f6);_0x43c335[_0x353f80(0x216)]!==undefined&&(_0x15866b[_0x353f80(0x22f)]=_0x43c335['repeat_frequency']);_0x43c335[_0x353f80(0x239)]&&(_0x15866b[_0x353f80(0x26f)]=_0x43c335['repeat_sub_frequency']);_0x43c335[_0x353f80(0x1bc)]!==undefined&&(_0x15866b['startAt']=_0x43c335[_0x353f80(0x1bc)]);_0x43c335[_0x353f80(0x21a)]!==undefined&&(_0x15866b[_0x353f80(0x1c1)]=_0x43c335['end_on']);_0x43c335[_0x353f80(0x1ba)]&&(_0x15866b[_0x353f80(0x1ba)]=_0x43c335[_0x353f80(0x1ba)]);if(_0x50ee8c&&_0x50ee8c!==_0x353f80(0x1eb)&&_0x50ee8c!==_0x353f80(0x1d1)&&_0x43c335[_0x353f80(0x1bc)]){const _0x41f8c9=_0x43c335[_0x353f80(0x1bc)][_0x353f80(0x20b)](/T(\d{2}:\d{2})/);_0x41f8c9&&(_0x15866b[_0x353f80(0x222)]=_0x41f8c9[0x1]);}}_0x5ba9d6['notification']&&(_0x5ba9d6[_0x353f80(0x1d8)]['notify_on']&&(_0x15866b[_0x353f80(0x1f5)]=_0x5ba9d6[_0x353f80(0x1d8)][_0x353f80(0x236)]),_0x5ba9d6[_0x353f80(0x1d8)][_0x353f80(0x212)]&&(_0x15866b[_0x353f80(0x20a)]=_0x5ba9d6[_0x353f80(0x1d8)][_0x353f80(0x212)][_0x353f80(0x23d)](_0x784dd2=>{const _0x2fa1c5=_0x353f80,_0x4236b9=Number(_0x784dd2);if(!isNaN(_0x4236b9)&&String(_0x4236b9)===_0x784dd2)return _0x4236b9;const _0x3b6404=_0x232c91?.[_0x2fa1c5(0x202)](_0x784dd2[_0x2fa1c5(0x20f)]());if(_0x3b6404===undefined)throw new SDKError(ErrorCode[_0x2fa1c5(0x264)],_0x2fa1c5(0x1bd)+_0x784dd2+_0x2fa1c5(0x266));return _0x3b6404;})));if(_0x5ba9d6[_0x353f80(0x25a)]){const _0x21c31c=_0x36f06f?.[_0x353f80(0x1f8)]?.['get'](_0x3a9650);_0x15866b[_0x353f80(0x24d)]=_0x5ba9d6[_0x353f80(0x25a)];if(_0x21c31c&&_0x36f06f?.[_0x353f80(0x207)]){let _0x43835d;try{_0x43835d=await _0x36f06f['getSchema'](_0x21c31c);const _0xa82101=validateConnectorConfig(_0x5ba9d6[_0x353f80(0x25a)],_0x43835d);if(!_0xa82101[_0x353f80(0x1ee)])throw new SDKError(ErrorCode[_0x353f80(0x253)],_0x353f80(0x206)+_0x5ba9d6['name']+'\x22:\x0a'+formatValidationErrors(_0xa82101['errors']),undefined,{'helpText':_0x353f80(0x1c5)+_0x21c31c+'\x0a\x0aAvailable\x20fields:\x0a'+formatSchemaAsHelp(_0x43835d)});if(_0xa82101[_0x353f80(0x1f2)]['length']>0x0){const _0x499532=formatValidationWarnings(_0xa82101[_0x353f80(0x1f2)]);console[_0x353f80(0x1c7)]('connector_config\x20for\x20activation\x20\x22'+_0x5ba9d6[_0x353f80(0x1bb)]+_0x353f80(0x265)+_0x499532);}}catch(_0x40461f){if(!(_0x40461f instanceof SDKError)||_0x40461f['code']!==ErrorCode['CONNECTOR_SCHEMA_NOT_FOUND'])throw _0x40461f;}if(_0x43835d&&getLegacySettingsField(_0x43835d)){if(!_0x36f06f?.[_0x353f80(0x218)])throw new SDKError(ErrorCode[_0x353f80(0x1ce)],_0x353f80(0x219)+_0x5ba9d6[_0x353f80(0x1bb)]+_0x353f80(0x23b)+('\x22'+_0x21c31c+'\x22\x20is\x20a\x20legacy-style\x20connector,\x20but\x20the\x20activation\x20context\x20')+_0x353f80(0x1b9));const _0x4dbd9a=await _0x36f06f[_0x353f80(0x218)](_0x21c31c);_0x15866b['connectorConfig']=transformConfigToLegacy(_0x5ba9d6[_0x353f80(0x25a)],_0x4dbd9a);}}}else _0x15866b['connectorConfig']={};_0x5ba9d6[_0x353f80(0x273)]!==undefined&&(_0x15866b['activationTemplateId']=_0x5ba9d6[_0x353f80(0x273)]);if(_0x5ba9d6['behaviors'])_0x15866b[_0x353f80(0x1e6)]=_0x5ba9d6[_0x353f80(0x220)][_0x353f80(0x23d)](behaviorDefToApi);else _0x5ba9d6[_0x353f80(0x26b)]&&(_0x15866b[_0x353f80(0x21b)]=behaviorDefToApi(_0x5ba9d6[_0x353f80(0x26b)]));return _0x5ba9d6[_0x353f80(0x200)]&&(_0x15866b[_0x353f80(0x1d7)]=_0x5ba9d6[_0x353f80(0x200)]),_0x5ba9d6[_0x353f80(0x23a)]&&(_0x15866b[_0x353f80(0x267)]=_0x5ba9d6[_0x353f80(0x23a)]),_0x5ba9d6[_0x353f80(0x227)]!==undefined&&(_0x15866b[_0x353f80(0x235)]=_0x5ba9d6[_0x353f80(0x227)]),_0x15866b;}export async function activationDefToUpdateRequest(_0x33ab2b,_0x374db3){return activationDefToCreateRequest(_0x33ab2b,_0x374db3);}export function deepSortObject(_0xff322f){const _0x368b13=a193_0x389ba7;if(_0xff322f===null||typeof _0xff322f!==_0x368b13(0x260))return _0xff322f;if(Array[_0x368b13(0x1c4)](_0xff322f))return _0xff322f[_0x368b13(0x23d)](deepSortObject)['sort']((_0x11e749,_0x3b332f)=>JSON[_0x368b13(0x211)](_0x11e749)[_0x368b13(0x22b)](JSON[_0x368b13(0x211)](_0x3b332f)));const _0x5c7633=_0xff322f;if(_0x5c7633[_0x368b13(0x26e)]===_0x368b13(0x1ca)&&Array[_0x368b13(0x1c4)](_0x5c7633[_0x368b13(0x1be)])){const _0x5e8a44={};for(const _0x405c1b of Object[_0x368b13(0x1d4)](_0x5c7633)[_0x368b13(0x1f9)]()){_0x5e8a44[_0x405c1b]=_0x405c1b===_0x368b13(0x1be)?_0x5c7633['conditions'][_0x368b13(0x23d)](deepSortObject):deepSortObject(_0x5c7633[_0x405c1b]);}return _0x5e8a44;}const _0x2f1c7a={};for(const _0xeda6c7 of Object[_0x368b13(0x1d4)](_0xff322f)[_0x368b13(0x1f9)]()){_0x2f1c7a[_0xeda6c7]=deepSortObject(_0xff322f[_0xeda6c7]);}return _0x2f1c7a;}export function serializeRule(_0x3ddeea){return JSON['stringify'](deepSortObject(_0x3ddeea));}export function normalizeRuleForMatching(_0x401d77){return normalizeConditionsForMatching(_0x401d77);}function normalizeConditionsForMatching(_0x3b67a6){const _0x434762=a193_0x389ba7;if(_0x3b67a6===null||typeof _0x3b67a6!=='object')return _0x3b67a6;if(Array[_0x434762(0x1c4)](_0x3b67a6))return _0x3b67a6['map'](normalizeConditionsForMatching);const _0x106356=_0x3b67a6;if((_0x106356[_0x434762(0x26e)]===_0x434762(0x21d)||_0x106356[_0x434762(0x26e)]==='exclude')&&typeof _0x106356['segment']===_0x434762(0x1df))return{..._0x106356,'segment':_0x434762(0x1f0)};const _0x2d80e0={};for(const _0x126117 of Object[_0x434762(0x1d4)](_0x106356)){_0x2d80e0[_0x126117]=normalizeConditionsForMatching(_0x106356[_0x126117]);}return _0x2d80e0;}export function serializeRuleForMatching(_0x240f25){const _0x155822=a193_0x389ba7;return JSON[_0x155822(0x211)](deepSortObject(normalizeRuleForMatching(_0x240f25)));}export function expandSegmentReferences(_0x407879,_0x3dcae3,_0x48d59b=new Set()){return expandConditions(_0x407879,_0x3dcae3,_0x48d59b);}function expandConditions(_0x2e713f,_0x7e2653,_0x37e36c){const _0x1f2884=a193_0x389ba7;if(_0x2e713f===null||typeof _0x2e713f!==_0x1f2884(0x260))return _0x2e713f;if(Array[_0x1f2884(0x1c4)](_0x2e713f))return _0x2e713f[_0x1f2884(0x23d)](_0x375401=>expandConditions(_0x375401,_0x7e2653,_0x37e36c));const _0x27c173=_0x2e713f;if((_0x27c173['type']==='include'||_0x27c173['type']===_0x1f2884(0x221))&&typeof _0x27c173['segment']==='string'){const _0x52d63d=_0x27c173[_0x1f2884(0x269)],_0x5063ad=_0x7e2653[_0x1f2884(0x202)](_0x52d63d);if(_0x5063ad&&!_0x37e36c[_0x1f2884(0x230)](_0x52d63d)){const _0x5693fa=new Set(_0x37e36c);_0x5693fa['add'](_0x52d63d);const _0x2ba712=expandConditions(_0x5063ad,_0x7e2653,_0x5693fa);return{'type':_0x27c173['type'],'expanded_rule':_0x2ba712};}return{'type':_0x27c173[_0x1f2884(0x26e)],'expanded_rule':_0x1f2884(0x24b)};}const _0x50e65e={};for(const _0x3a8246 of Object[_0x1f2884(0x1d4)](_0x27c173)){_0x50e65e[_0x3a8246]=expandConditions(_0x27c173[_0x3a8246],_0x7e2653,_0x37e36c);}return _0x50e65e;}export function serializeExpandedRule(_0x10aaac,_0x2ccfb7){const _0x51b5be=a193_0x389ba7,_0x998ef1=expandSegmentReferences(_0x10aaac,_0x2ccfb7);return JSON[_0x51b5be(0x211)](deepSortObject(_0x998ef1));}export function createSegmentNameContext(_0x3a69fb){const _0x5cb9f9=a193_0x389ba7,_0x49bdff=new Set(),_0x339efc=new Map(),_0x4670b1=new Map();if(_0x3a69fb)for(const [_0x1f325e,_0x30c81f]of Object[_0x5cb9f9(0x1ec)](_0x3a69fb)){if(_0x30c81f[_0x5cb9f9(0x226)]){const _0xd55e1=serializeRule(_0x30c81f[_0x5cb9f9(0x226)]);_0x4670b1['set'](_0xd55e1,_0x1f325e),_0x49bdff[_0x5cb9f9(0x1dc)](_0x1f325e);}}return{'usedNames':_0x49bdff,'ruleHashToName':_0x339efc,'localRuleToName':_0x3a69fb?_0x4670b1:undefined};}export function resolveSegmentName(_0x5ca453,_0x557051,_0x58d185,_0x104c04){const _0x245bce=a193_0x389ba7,_0x372d1b=serializeRule(_0x557051);if(_0x58d185[_0x245bce(0x1fe)]){const _0x37c9eb=_0x58d185[_0x245bce(0x1fe)][_0x245bce(0x202)](_0x372d1b);if(_0x37c9eb)return{'name':_0x37c9eb,'isDuplicate':![],'isLocalMatch':!![]};}const _0x28325b=_0x58d185[_0x245bce(0x26c)][_0x245bce(0x202)](_0x372d1b);if(_0x28325b)return{'name':_0x28325b,'isDuplicate':!![],'isLocalMatch':![]};const _0x11bb31=_0x104c04(_0x5ca453);let _0x54b94f=_0x11bb31||_0x5ca453,_0x1fb424=_0x54b94f,_0x4c0331=0x2;while(_0x58d185[_0x245bce(0x1e8)][_0x245bce(0x230)](_0x1fb424)){_0x1fb424=_0x54b94f+'_'+_0x4c0331,_0x4c0331++;}return _0x58d185['usedNames'][_0x245bce(0x1dc)](_0x1fb424),_0x58d185['ruleHashToName'][_0x245bce(0x229)](_0x372d1b,_0x1fb424),{'name':_0x1fb424,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x557368){const _0x45bd43=[],_0x51431a=_0x2ffeb6=>{const _0x2ac6d3=a193_0xb32c;if(!_0x2ffeb6||typeof _0x2ffeb6!=='object')return;if(Array[_0x2ac6d3(0x1c4)](_0x2ffeb6)){_0x2ffeb6[_0x2ac6d3(0x234)](_0x51431a);return;}const _0x2a7bb7=_0x2ffeb6;(_0x2a7bb7['type']===_0x2ac6d3(0x21d)||_0x2a7bb7[_0x2ac6d3(0x26e)]===_0x2ac6d3(0x221))&&typeof _0x2a7bb7[_0x2ac6d3(0x269)]===_0x2ac6d3(0x1df)&&_0x45bd43[_0x2ac6d3(0x23e)](_0x2a7bb7[_0x2ac6d3(0x269)]);for(const _0xfde5a4 of Object[_0x2ac6d3(0x215)](_0x2a7bb7)){_0x51431a(_0xfde5a4);}};return _0x51431a(_0x557368),_0x45bd43;}export function validateSegmentRule(_0x11da09,_0x279ce7){const _0x2e3277=a193_0x389ba7;if(!_0x279ce7||!_0x279ce7[_0x2e3277(0x1be)])return;for(let _0x4d84b5=0x0;_0x4d84b5<_0x279ce7[_0x2e3277(0x1be)][_0x2e3277(0x24c)];_0x4d84b5++){const _0x2f2e38=_0x279ce7[_0x2e3277(0x1be)][_0x4d84b5];if('type'in _0x2f2e38&&_0x2f2e38['type']===_0x2e3277(0x208)){const _0x1da3d3=_0x2f2e38,_0x30b82b=_0x1da3d3[_0x2e3277(0x1fb)]||_0x1da3d3['aggregation'];if((!_0x1da3d3[_0x2e3277(0x24f)]||_0x1da3d3[_0x2e3277(0x24f)]==='')&&!_0x30b82b)throw new SDKError(ErrorCode[_0x2e3277(0x1dd)],_0x2e3277(0x271)+_0x11da09+_0x2e3277(0x25b)+(_0x2e3277(0x25c)+_0x4d84b5+'].attribute\x20cannot\x20be\x20empty.\x0a')+'Please\x20specify\x20a\x20valid\x20attribute\x20name.');}}}
|
|
1
|
+
const a195_0x2a38e8=a195_0x4935;(function(_0x500f41,_0x21a0a3){const _0x225e14=a195_0x4935,_0x387dab=_0x500f41();while(!![]){try{const _0x52ca85=parseInt(_0x225e14(0xec))/0x1*(-parseInt(_0x225e14(0x13e))/0x2)+-parseInt(_0x225e14(0xd9))/0x3+-parseInt(_0x225e14(0x145))/0x4*(parseInt(_0x225e14(0x114))/0x5)+parseInt(_0x225e14(0x130))/0x6+-parseInt(_0x225e14(0x10c))/0x7+-parseInt(_0x225e14(0xfb))/0x8+parseInt(_0x225e14(0xc3))/0x9*(parseInt(_0x225e14(0xc2))/0xa);if(_0x52ca85===_0x21a0a3)break;else _0x387dab['push'](_0x387dab['shift']());}catch(_0x2c998f){_0x387dab['push'](_0x387dab['shift']());}}}(a195_0x1a1e,0x654c4));import*as a195_0x2658ce from'yaml';import{safeParseYaml}from'./yaml-validator.js';import{SDKError,ErrorCode}from'../errors.js';import{validateConnectorConfig,transformConfigToLegacy,normalizeConnectorConfigForYaml,formatValidationErrors,formatValidationWarnings,formatSchemaAsHelp,getLegacySettingsField}from'../connection-validator.js';import{SegmentDefSchema}from'./types/segment-schema.js';const SCHEDULE_TYPE_TO_REPEAT_UNIT={'daily':a195_0x2a38e8(0x100),'hourly':'hour','weekly':a195_0x2a38e8(0x157),'monthly':a195_0x2a38e8(0x113),'minutes_interval':a195_0x2a38e8(0x129)},REPEAT_UNIT_TO_SCHEDULE_TYPE={'day':'daily','hour':a195_0x2a38e8(0x16b),'week':a195_0x2a38e8(0x135),'month':a195_0x2a38e8(0x174),'minute':a195_0x2a38e8(0x173)};function filterRuleAsRuleDef(_0x32096e){return _0x32096e;}function ruleDefAsFilterRule(_0x49b85e){return _0x49b85e;}export function segmentResponseToDefSync(_0x4cc2c0,_0x42bb17){const _0x5e0020=a195_0x2a38e8,_0x434c8f=_0x4cc2c0[_0x5e0020(0x101)]&&_0x5e0020(0x170)in _0x4cc2c0[_0x5e0020(0x101)]&&_0x4cc2c0[_0x5e0020(0x101)]['type'];return{'type':_0x5e0020(0x144),'name':_0x4cc2c0['name'],..._0x4cc2c0['description']&&{'description':_0x4cc2c0[_0x5e0020(0x140)]},..._0x42bb17&&{'folder':_0x42bb17},..._0x434c8f&&{'rule':apiRuleToYaml(_0x4cc2c0[_0x5e0020(0x101)])},..._0x4cc2c0['kind']!==undefined&&{'kind':_0x4cc2c0['kind']===0x0?_0x5e0020(0x10b):_0x4cc2c0[_0x5e0020(0xdf)]===0x1?_0x5e0020(0x133):_0x5e0020(0x10d)},..._0x4cc2c0[_0x5e0020(0x179)]!==undefined&&{'visible':_0x4cc2c0[_0x5e0020(0x179)]}};}export async function segmentResponseToDef(_0x4a278f,_0x2e848b,_0x1a2f39){const _0x257301=a195_0x2a38e8,_0x1a78f8=segmentResponseToDefSync(_0x4a278f,_0x1a2f39);if(!_0x2e848b||!_0x2e848b[_0x257301(0xbc)])return _0x1a78f8;return _0x1a78f8['rule']&&(_0x1a78f8[_0x257301(0x101)]=await resolveRuleSegmentRefs(_0x1a78f8[_0x257301(0x101)],_0x2e848b[_0x257301(0xbc)])),_0x1a78f8;}function a195_0x1a1e(){const _0x587a5e=['replace','allColumns','connection','attributes','Please\x20specify\x20a\x20valid\x20attribute\x20name.','month','35IxjDVl','getSchema','TimeWithinPast','filter','\x0a\x0aAvailable\x20fields:\x0a','TimeRange','And','columns','].attribute\x20cannot\x20be\x20empty.\x0a','CONNECTION_NOT_FOUND','lock_enabled','syndicationBehaviors','repeat_unit','behaviors','notify_on','run_after_journey_refresh','TimeWithinNext','join_strategy','repeatFrequency','Invalid\x20condition\x20in\x20embedded\x20segment\x20\x27','attribute_name','minute','scheduleType','scheduleOption','attribute','reverse','repeatUnit','usedNames','101520HbGtjq','has','notifyOn','realtime','Unknown\x20connection:\x20','weekly','activation_template_id','leftValue','unit','Invalid\x20connector_config\x20for\x20activation\x20\x22','Between','nested_workflow_name','groupingColumns','orderBy','13204zTFktD','Segment\x20description','description','orderColumn','every','aggregation','segment','15408HxQNbl','maxValue','conditions','connector_config\x20for\x20activation\x20\x22','New\x20Segment','findIndex','behaviorTableName','source','all_columns','email_recipients','connectorConfig','length','name','activationTemplateId','activations','localRuleToName','flatMap','runAfterJourneyRefresh','week','JOURNEY_SYNTAX_ERROR','behavior_table','connector_config','column','isFinite','join_row','rule:','INVALID_ARGUMENT','schedule','isArray','limit','connectionId','endOn','sort','rightValue','warnings','visibility','timeWindow','repeat_frequency','hourly','visible','Reference','\x22:\x20','\x27:\x20','type','duration','joinRow','minutes_interval','monthly','Composite','CONNECTOR_INVALID_CONFIG','syndicationBehavior','ruleHashToName','isVisible','nestedWorkflowName','segmentFolderId','resolveSegmentName','start_at','cron','minValue','all','Count','4890rRMHLN','41085xZxgHS','First','arrayMatching','toLowerCase','errors','activationParams','add','null','values','emailRecipients','lockEnabled','string','Behavior','operator','object','Equal','include','repeatSubFrequency','stringify','startAt','max','CountDistinct','1374720syCpwY','number','behavior','repeat_sub_frequency','expr','valid','kind','\x22:\x0a','get','Column','nestedWorkflowProjectName','CONNECTOR_SCHEMA_NOT_FOUND','map','forEach','from','folder','any','timezone','not','2nziNJZ','All','end_on','notification','getMetadata','Unknown\x20email\x20recipient:\x20','Value','connectionNameToTypeMap','push','Last','warn','test','set','entries','exclude','5024328pciCqz','none','code','INTERNAL','keys','day','rule','value','formatting','timestamp','joinStrategy','min','parse','rightValues','order_by','\x22\x20is\x20a\x20legacy-style\x20connector,\x20but\x20the\x20activation\x20context\x20','batch','4954880dlcVVd','funnel_stage'];a195_0x1a1e=function(){return _0x587a5e;};return a195_0x1a1e();}export function apiRuleToYaml(_0x41f825){const _0x56e2dc=a195_0x2a38e8;if(_0x41f825[_0x56e2dc(0x170)]===_0x56e2dc(0x175))return{'type':_0x56e2dc(0x175),'conditions':(_0x41f825[_0x56e2dc(0x147)]||[])[_0x56e2dc(0xe5)](apiConditionToYaml),..._0x41f825[_0x56e2dc(0x140)]!==undefined&&{'description':_0x41f825[_0x56e2dc(0x140)]},..._0x41f825['expr']!==undefined&&{'expr':_0x41f825['expr']}};const _0x4cedfd=(_0x41f825[_0x56e2dc(0x147)]||[])[_0x56e2dc(0x155)](_0x321525=>{const _0x6483f1=_0x56e2dc,_0x408a6a=apiConditionToYaml(_0x321525);if(isCompositeType(_0x408a6a)&&_0x408a6a[_0x6483f1(0x140)]!==undefined){const _0x48a0ca=_0x408a6a;if(_0x48a0ca[_0x6483f1(0x147)]['length']===0x1)return _0x48a0ca['conditions'];return[{'type':_0x48a0ca['type'],'conditions':_0x48a0ca[_0x6483f1(0x147)]}];}return[_0x408a6a];});if(_0x4cedfd[_0x56e2dc(0x150)]===0x1&&!_0x41f825[_0x56e2dc(0x140)]&&isCompositeType(_0x4cedfd[0x0])){const _0x2cd525=_0x4cedfd[0x0];if(_0x2cd525[_0x56e2dc(0x170)]===_0x41f825[_0x56e2dc(0x170)]&&_0x2cd525[_0x56e2dc(0x147)]&&_0x2cd525[_0x56e2dc(0x140)]===undefined)return{'type':_0x41f825['type'],'conditions':_0x2cd525['conditions']};}return{'type':_0x41f825['type'],'conditions':_0x4cedfd};}export async function resolveRuleSegmentRefs(_0x1cef9f,_0x561ea6){const _0x31d7bd=a195_0x2a38e8;return transformRuleSegmentRefs(_0x1cef9f,_0x561ea6,_0x5053da=>/^\d+$/[_0x31d7bd(0xf7)](_0x5053da));}async function transformConditionSegmentRefs(_0x11333b,_0x1d845a,_0x5cfdea,_0x393d9f){const _0x3d5545=a195_0x2a38e8;if(_0x3d5545(0x144)in _0x11333b&&(_0x11333b[_0x3d5545(0x170)]===_0x3d5545(0xd3)||_0x11333b['type']===_0x3d5545(0xfa))){const _0x394fa7=_0x11333b;if(_0x5cfdea(_0x394fa7['segment']))return{..._0x394fa7,'segment':await _0x1d845a(_0x394fa7[_0x3d5545(0x144)])};return _0x11333b;}if(_0x3d5545(0x147)in _0x11333b&&_0x11333b[_0x3d5545(0x147)]){const _0x7dcfb0=_0x11333b,_0x52bb11=await Promise[_0x3d5545(0xc0)](_0x7dcfb0['conditions'][_0x3d5545(0xe5)](_0x5c948a=>transformConditionSegmentRefs(_0x5c948a,_0x1d845a,_0x5cfdea,_0x393d9f)));return{..._0x7dcfb0,'conditions':_0x52bb11};}if('filter'in _0x11333b&&_0x11333b['filter']){const _0x48c8ba=_0x11333b,_0x5bfecf=await _0x393d9f(filterRuleAsRuleDef(_0x48c8ba['filter']),_0x1d845a);return{..._0x48c8ba,'filter':ruleDefAsFilterRule(_0x5bfecf)};}return _0x11333b;}async function transformRuleSegmentRefs(_0x46abe9,_0x16ea13,_0x431375){const _0x202855=a195_0x2a38e8,_0x4ee74f=(_0x4a7d2c,_0x33567f)=>transformRuleSegmentRefs(_0x4a7d2c,_0x33567f,_0x431375),_0x67e1de=await Promise[_0x202855(0xc0)](_0x46abe9[_0x202855(0x147)][_0x202855(0xe5)](_0x1731dd=>transformConditionSegmentRefs(_0x1731dd,_0x16ea13,_0x431375,_0x4ee74f)));return{..._0x46abe9,'conditions':_0x67e1de};}export async function resolveRuleSegmentIds(_0x5f4f0e,_0x49e4ae){const _0x4067c7=a195_0x2a38e8;return transformRuleSegmentRefs(_0x5f4f0e,_0x49e4ae,_0xb69060=>!/^\d+$/[_0x4067c7(0xf7)](_0xb69060));}function isCompositeType(_0x4aa0bb){const _0x1ce230=a195_0x2a38e8;return _0x4aa0bb[_0x1ce230(0x170)]==='And'||_0x4aa0bb[_0x1ce230(0x170)]==='Or'||_0x4aa0bb[_0x1ce230(0x170)]===_0x1ce230(0x175);}function isBehaviorApiCondition(_0x35e3ba){const _0x4cd43e=a195_0x2a38e8;if(!_0x35e3ba['leftValue']?.[_0x4cd43e(0x14c)]?.[_0x4cd43e(0x151)])return![];return!![];}function apiConditionToYaml(_0x3e54f9){const _0x3baebf=a195_0x2a38e8;if(_0x3e54f9[_0x3baebf(0x170)]===_0x3baebf(0x11a)||_0x3e54f9[_0x3baebf(0x170)]==='Or'){if(_0x3e54f9[_0x3baebf(0x147)]){const _0x18acdd=_0x3e54f9[_0x3baebf(0x147)][_0x3baebf(0xe5)](apiConditionToYaml),_0x172dba=_0x3e54f9[_0x3baebf(0x140)]!==undefined;if(_0x18acdd[_0x3baebf(0x150)]===0x1&&!_0x172dba)return _0x18acdd[0x0];return{'type':_0x3e54f9['type'],'conditions':_0x18acdd,..._0x3e54f9[_0x3baebf(0x140)]!==undefined&&{'description':_0x3e54f9['description']}};}}if(_0x3e54f9[_0x3baebf(0x170)]===_0x3baebf(0x175)&&_0x3e54f9[_0x3baebf(0x147)])return{'type':'Composite','conditions':_0x3e54f9[_0x3baebf(0x147)][_0x3baebf(0xe5)](apiConditionToYaml),..._0x3e54f9[_0x3baebf(0x140)]!==undefined&&{'description':_0x3e54f9[_0x3baebf(0x140)]},..._0x3e54f9[_0x3baebf(0xdd)]!==undefined&&{'expr':_0x3e54f9[_0x3baebf(0xdd)]}};if(_0x3e54f9[_0x3baebf(0x170)]===_0x3baebf(0xf2)&&_0x3e54f9[_0x3baebf(0x137)]&&_0x3e54f9[_0x3baebf(0xd0)]){const _0x1bf41f=_0x3e54f9['leftValue'][_0x3baebf(0x143)]?buildAggregationDefFromApi(_0x3e54f9[_0x3baebf(0x137)]['aggregation']):undefined;if(isBehaviorApiCondition(_0x3e54f9)){const _0x48141a=_0x3e54f9['leftValue'][_0x3baebf(0x14c)][_0x3baebf(0x151)],{timeWindow:_0x321baf,remainingFilter:_0x346c68}=extractTimeWindow(_0x3e54f9[_0x3baebf(0x137)]['filter']);return{'type':'Behavior','attribute':'','operator':apiOperatorToYaml(_0x3e54f9['operator']),..._0x3e54f9['arrayMatching']&&_0x3e54f9[_0x3baebf(0xc5)]!==_0x3baebf(0xe9)?{'arrayMatching':_0x3e54f9[_0x3baebf(0xc5)]}:{},..._0x3e54f9[_0x3baebf(0xfa)]?{'exclude':_0x3e54f9[_0x3baebf(0xfa)]}:{},..._0x1bf41f?{'aggregation':_0x1bf41f}:{},'source':_0x48141a,..._0x321baf?{'timeWindow':_0x321baf}:{},..._0x346c68?{'filter':apiRuleToYaml(_0x346c68)}:{},..._0x3e54f9['limit']!==undefined&&_0x3e54f9[_0x3baebf(0x162)]!==null?{'limit':_0x3e54f9['limit']}:{}};}return{'type':_0x3baebf(0xf2),'attribute':_0x3e54f9['leftValue'][_0x3baebf(0x151)]||'','operator':apiOperatorToYaml(_0x3e54f9[_0x3baebf(0xd0)]),..._0x3e54f9[_0x3baebf(0xc5)]&&_0x3e54f9['arrayMatching']!==_0x3baebf(0xe9)?{'arrayMatching':_0x3e54f9[_0x3baebf(0xc5)]}:{},..._0x3e54f9[_0x3baebf(0xfa)]?{'exclude':_0x3e54f9['exclude']}:{},..._0x1bf41f?{'aggregation':_0x1bf41f}:{},..._0x3e54f9['leftValue']['filter']?{'filter':apiRuleToYaml(_0x3e54f9[_0x3baebf(0x137)][_0x3baebf(0x117)])}:{},..._0x3e54f9[_0x3baebf(0x162)]!==undefined&&_0x3e54f9['limit']!==null?{'limit':_0x3e54f9[_0x3baebf(0x162)]}:{}};}if(_0x3e54f9['type']===_0x3baebf(0xe2)&&_0x3e54f9[_0x3baebf(0x15b)]&&_0x3e54f9[_0x3baebf(0xd0)])return{'type':'Column','column':_0x3e54f9[_0x3baebf(0x15b)],'operator':apiOperatorToYaml(_0x3e54f9[_0x3baebf(0xd0)])};if(_0x3e54f9[_0x3baebf(0x170)]===_0x3baebf(0x16d)&&_0x3e54f9['id'])return{'type':_0x3e54f9[_0x3baebf(0xfa)]?'exclude':_0x3baebf(0xd3),'segment':_0x3e54f9['id']};return{'type':'And','conditions':[]};}function isTemporalOperator(_0x246a48){const _0xc1cf51=a195_0x2a38e8;return _0x246a48===_0xc1cf51(0x116)||_0x246a48===_0xc1cf51(0x124);}function isBetweenOperator(_0x3e448d){const _0x5de581=a195_0x2a38e8;return _0x3e448d===_0x5de581(0x13a);}function getEffectiveValue(_0x541656){const _0x37b319=a195_0x2a38e8,_0x312367=_0x541656[_0x37b319(0xcb)];return _0x541656[_0x37b319(0x102)]??_0x312367;}function parseNumericValue(_0x4099b2){const _0x2c1dcf=a195_0x2a38e8;if(typeof _0x4099b2===_0x2c1dcf(0xd1)&&_0x4099b2!==null)return _0x4099b2;if(_0x4099b2==='')return _0x4099b2;const _0xccb820=Number(_0x4099b2);return Number[_0x2c1dcf(0x15c)](_0xccb820)?_0xccb820:_0x4099b2;}function apiOperatorToYaml(_0x1be2e5){const _0x159f58=a195_0x2a38e8;if(isBetweenOperator(_0x1be2e5[_0x159f58(0x170)]))return{'type':mapApiOperatorType(_0x1be2e5[_0x159f58(0x170)]),..._0x1be2e5[_0x159f58(0xeb)]!==undefined&&{'not':_0x1be2e5[_0x159f58(0xeb)]},..._0x1be2e5[_0x159f58(0xbf)]!==undefined&&{'min':parseNumericValue(_0x1be2e5[_0x159f58(0xbf)])},..._0x1be2e5[_0x159f58(0x146)]!==undefined&&{'max':parseNumericValue(_0x1be2e5[_0x159f58(0x146)])}};if(_0x1be2e5['type']==='TimeRange')return{'type':_0x159f58(0x119),..._0x1be2e5[_0x159f58(0xeb)]!==undefined&&{'not':_0x1be2e5['not']},..._0x1be2e5['duration']!==undefined&&{'duration':_0x1be2e5[_0x159f58(0x171)]},..._0x1be2e5[_0x159f58(0xe7)]!==undefined&&{'from':_0x1be2e5[_0x159f58(0xe7)]},..._0x1be2e5[_0x159f58(0x12d)]!==undefined&&{'reverse':_0x1be2e5['reverse']}};let _0x34bf6b;if(_0x1be2e5[_0x159f58(0x108)]&&_0x1be2e5[_0x159f58(0x108)][_0x159f58(0x150)]>0x0)_0x34bf6b=_0x1be2e5[_0x159f58(0x108)];else{if(_0x1be2e5[_0x159f58(0x166)]!==undefined)_0x34bf6b=_0x1be2e5[_0x159f58(0x166)];else isTemporalOperator(_0x1be2e5['type'])&&_0x1be2e5[_0x159f58(0x102)]!==undefined&&(_0x34bf6b=_0x1be2e5[_0x159f58(0x102)]);}return{'type':mapApiOperatorType(_0x1be2e5[_0x159f58(0x170)]),..._0x1be2e5[_0x159f58(0xeb)]!==undefined&&{'not':_0x1be2e5[_0x159f58(0xeb)]},..._0x34bf6b!==undefined&&{'value':_0x34bf6b},..._0x1be2e5[_0x159f58(0x138)]!==undefined&&{'unit':_0x1be2e5[_0x159f58(0x138)]}};}function mapApiOperatorType(_0x4ff468){return _0x4ff468;}export function segmentDefToCreateRequest(_0x27aa95,_0x318950){const _0x35701e=a195_0x2a38e8,_0x452b2a={'name':_0x27aa95['name']};return _0x27aa95['description']&&(_0x452b2a[_0x35701e(0x140)]=_0x27aa95[_0x35701e(0x140)]),_0x27aa95[_0x35701e(0x101)]&&(_0x452b2a[_0x35701e(0x101)]=yamlRuleToApi(_0x27aa95['rule'])),_0x27aa95[_0x35701e(0xdf)]&&(_0x452b2a['kind']=_0x27aa95[_0x35701e(0xdf)]===_0x35701e(0x10b)?0x0:_0x27aa95['kind']===_0x35701e(0x133)?0x1:0x2),_0x27aa95[_0x35701e(0x16c)]!==undefined&&(_0x452b2a['isVisible']=_0x27aa95[_0x35701e(0x16c)]),_0x318950&&(_0x452b2a[_0x35701e(0xbb)]=_0x318950),_0x452b2a;}export function segmentDefToUpdateRequest(_0x174812){const _0xad0870=a195_0x2a38e8,_0x5ab2a7={'name':_0x174812[_0xad0870(0x151)]};return _0x174812[_0xad0870(0x140)]!==undefined&&(_0x5ab2a7[_0xad0870(0x140)]=_0x174812[_0xad0870(0x140)]),_0x174812['rule']&&(_0x5ab2a7['rule']=yamlRuleToApi(_0x174812[_0xad0870(0x101)])),_0x174812[_0xad0870(0xdf)]&&(_0x5ab2a7['kind']=_0x174812[_0xad0870(0xdf)]===_0xad0870(0x10b)?0x0:_0x174812[_0xad0870(0xdf)]===_0xad0870(0x133)?0x1:0x2),_0x5ab2a7;}export function yamlRuleToApi(_0x372185){const _0x3f2801=a195_0x2a38e8;if(_0x372185[_0x3f2801(0x170)]===_0x3f2801(0x175))return{'type':_0x3f2801(0x175),'conditions':_0x372185[_0x3f2801(0x147)][_0x3f2801(0xe5)](yamlConditionToApi),..._0x372185[_0x3f2801(0x140)]!==undefined&&{'description':_0x372185[_0x3f2801(0x140)]},..._0x372185[_0x3f2801(0xdd)]!==undefined&&{'expr':_0x372185[_0x3f2801(0xdd)]}};const _0x245dce=_0x372185[_0x3f2801(0x147)][_0x3f2801(0xe5)](yamlConditionToApi),_0x286f5e=_0x245dce[_0x3f2801(0x142)](_0x177d3b=>isCompositeType(_0x177d3b)&&_0x177d3b[_0x3f2801(0x140)]!==undefined);if(!_0x286f5e&&_0x245dce['length']>0x0){const _0x34d2ce=[];for(const _0x2ba93a of _0x245dce){isCompositeType(_0x2ba93a)&&_0x2ba93a[_0x3f2801(0x140)]===undefined&&_0x2ba93a[_0x3f2801(0x147)]&&_0x2ba93a[_0x3f2801(0x147)][_0x3f2801(0x142)](_0x8999de=>!isCompositeType(_0x8999de))?_0x34d2ce[_0x3f2801(0xf4)]({'type':_0x2ba93a[_0x3f2801(0x170)],'description':'','conditions':_0x2ba93a[_0x3f2801(0x147)]}):_0x34d2ce[_0x3f2801(0xf4)]({'type':_0x3f2801(0x11a),'description':_0x372185[_0x3f2801(0x140)]||'','conditions':[_0x2ba93a]});}return{'type':_0x372185['type'],'conditions':_0x34d2ce};}return{'type':_0x372185[_0x3f2801(0x170)],'conditions':_0x245dce,..._0x372185[_0x3f2801(0x140)]&&{'description':_0x372185[_0x3f2801(0x140)]}};}function yamlFilterRuleToApi(_0x43cf45){const _0x21619f=a195_0x2a38e8,_0x2211cf=_0x43cf45[_0x21619f(0x147)]['map'](yamlConditionToApi);return{'type':_0x43cf45[_0x21619f(0x170)],'conditions':_0x2211cf};}function yamlConditionToApi(_0x14a7ea){const _0x885b8f=a195_0x2a38e8;if(_0x885b8f(0x144)in _0x14a7ea&&(_0x14a7ea[_0x885b8f(0x170)]===_0x885b8f(0xd3)||_0x14a7ea[_0x885b8f(0x170)]===_0x885b8f(0xfa))){const _0x220cc5=_0x14a7ea;return{'type':_0x885b8f(0x16d),'id':_0x220cc5[_0x885b8f(0x144)],'exclude':_0x220cc5['type']===_0x885b8f(0xfa)};}if(_0x14a7ea[_0x885b8f(0x170)]===_0x885b8f(0x11a)||_0x14a7ea[_0x885b8f(0x170)]==='Or'||_0x14a7ea[_0x885b8f(0x170)]===_0x885b8f(0x175)){const _0x39b77a=_0x14a7ea;return{'type':_0x39b77a[_0x885b8f(0x170)],'conditions':_0x39b77a[_0x885b8f(0x147)][_0x885b8f(0xe5)](yamlConditionToApi),..._0x39b77a[_0x885b8f(0x140)]&&{'description':_0x39b77a[_0x885b8f(0x140)]},..._0x39b77a[_0x885b8f(0xdd)]!==undefined&&{'expr':_0x39b77a[_0x885b8f(0xdd)]}};}if(_0x885b8f(0x15b)in _0x14a7ea&&_0x14a7ea['type']===_0x885b8f(0xe2)){const _0x352fe=_0x14a7ea;return{'type':'Column','column':_0x352fe[_0x885b8f(0x15b)],'operator':yamlOperatorToApi(_0x352fe[_0x885b8f(0xd0)])};}const _0x141c86=_0x14a7ea,_0x47a5ee={'type':_0x885b8f(0xf2),'leftValue':buildLeftValue(_0x141c86),'operator':yamlOperatorToApi(_0x141c86[_0x885b8f(0xd0)]),'exclude':_0x141c86[_0x885b8f(0xfa)]??![],'arrayMatching':_0x141c86['arrayMatching']??_0x885b8f(0xe9)};return _0x141c86[_0x885b8f(0x162)]!==undefined&&(_0x47a5ee[_0x885b8f(0x162)]=_0x141c86[_0x885b8f(0x162)]),_0x47a5ee;}function buildAggregationDefFromApi(_0x3ed8ff){const _0x3263cd=a195_0x2a38e8,_0x3a73c2=_0x3ed8ff[_0x3263cd(0x170)];if(_0x3a73c2==='CountDistinct')return{'type':_0x3a73c2,'columns':_0x3ed8ff[_0x3263cd(0x11b)]??[]};if(_0x3a73c2===_0x3263cd(0xc4)||_0x3a73c2==='Last')return{'type':_0x3a73c2,'column':_0x3ed8ff[_0x3263cd(0x15b)]??'','orderColumn':_0x3ed8ff[_0x3263cd(0x141)]??'',..._0x3ed8ff['groupingColumns']&&{'groupingColumns':_0x3ed8ff[_0x3263cd(0x13c)]}};if(_0x3a73c2===_0x3263cd(0xc1))return{'type':_0x3a73c2,..._0x3ed8ff[_0x3263cd(0x13c)]&&{'groupingColumns':_0x3ed8ff[_0x3263cd(0x13c)]}};return{'type':_0x3a73c2,'column':_0x3ed8ff[_0x3263cd(0x15b)]??'',..._0x3ed8ff['groupingColumns']&&{'groupingColumns':_0x3ed8ff['groupingColumns']}};}function buildLeftValue(_0x32e369){const _0x31f55f=a195_0x2a38e8,_0x4eeba3={};_0x32e369[_0x31f55f(0x12c)]&&_0x32e369['type']!==_0x31f55f(0xcf)&&(_0x4eeba3[_0x31f55f(0x151)]=_0x32e369[_0x31f55f(0x12c)]);if(_0x32e369['aggregation']){const _0x4de92e=_0x32e369[_0x31f55f(0x143)];if(_0x4de92e['type']===_0x31f55f(0xd8))_0x4eeba3[_0x31f55f(0x143)]={'type':_0x31f55f(0xd8),'columns':_0x4de92e[_0x31f55f(0x11b)]};else{if(_0x4de92e[_0x31f55f(0x170)]===_0x31f55f(0xc4)||_0x4de92e[_0x31f55f(0x170)]===_0x31f55f(0xf5))_0x4eeba3[_0x31f55f(0x143)]={'type':_0x4de92e[_0x31f55f(0x170)],'column':_0x4de92e[_0x31f55f(0x15b)],'orderColumn':_0x4de92e['orderColumn'],..._0x4de92e['groupingColumns']&&{'groupingColumns':_0x4de92e[_0x31f55f(0x13c)]}};else _0x4de92e[_0x31f55f(0x170)]===_0x31f55f(0xc1)?_0x4eeba3[_0x31f55f(0x143)]={'type':_0x31f55f(0xc1),..._0x4de92e[_0x31f55f(0x13c)]&&{'groupingColumns':_0x4de92e[_0x31f55f(0x13c)]}}:_0x4eeba3[_0x31f55f(0x143)]={'type':_0x4de92e['type'],'column':_0x4de92e[_0x31f55f(0x15b)],..._0x4de92e[_0x31f55f(0x13c)]&&{'groupingColumns':_0x4de92e['groupingColumns']}};}}_0x32e369['source']&&(_0x4eeba3[_0x31f55f(0x14c)]={'name':_0x32e369['source']});const _0x33dfaa=_0x32e369[_0x31f55f(0x170)]==='Behavior'?_0x32e369['timeWindow']:undefined,_0x52d431=_0x33dfaa?[buildTimeWindowCondition(_0x33dfaa)]:[],_0x59d099=[..._0x32e369[_0x31f55f(0x117)]?.[_0x31f55f(0x147)]??[],..._0x52d431];return _0x59d099[_0x31f55f(0x150)]>0x0&&(_0x4eeba3[_0x31f55f(0x117)]=yamlFilterRuleToApi(filterRuleAsRuleDef({'type':'And','conditions':_0x59d099}))),_0x4eeba3;}function buildTimeWindowCondition(_0x5e879e){const _0x126b6c=a195_0x2a38e8;return{'type':'Column','column':_0x126b6c(0x104),'operator':{'type':_0x126b6c(0x116),'value':_0x5e879e[_0x126b6c(0x171)],'unit':_0x5e879e[_0x126b6c(0x138)]}};}function extractTimeWindow(_0x2326da){const _0xc09b3d=a195_0x2a38e8;if(!_0x2326da?.[_0xc09b3d(0x147)]?.[_0xc09b3d(0x150)])return{'remainingFilter':_0x2326da};const _0x200f70=_0x2326da[_0xc09b3d(0x147)][_0xc09b3d(0x14a)](_0x1ace3e=>_0x1ace3e['type']===_0xc09b3d(0xe2)&&_0x1ace3e[_0xc09b3d(0x15b)]===_0xc09b3d(0x104)&&_0x1ace3e[_0xc09b3d(0xd0)]?.[_0xc09b3d(0x170)]==='TimeWithinPast'&&!_0x1ace3e['operator'][_0xc09b3d(0xeb)]&&typeof _0x1ace3e['operator'][_0xc09b3d(0x102)]===_0xc09b3d(0xda)&&typeof _0x1ace3e[_0xc09b3d(0xd0)][_0xc09b3d(0x138)]===_0xc09b3d(0xce));if(_0x200f70===-0x1)return{'remainingFilter':_0x2326da};const _0x569a4f=_0x2326da[_0xc09b3d(0x147)][_0x200f70],_0x3e73e1=_0x2326da['conditions'][_0xc09b3d(0x117)]((_0xdd4532,_0x43508b)=>_0x43508b!==_0x200f70);return{'timeWindow':{'duration':_0x569a4f['operator'][_0xc09b3d(0x102)],'unit':_0x569a4f['operator'][_0xc09b3d(0x138)]},'remainingFilter':_0x3e73e1['length']>0x0?{..._0x2326da,'conditions':_0x3e73e1}:undefined};}function yamlOperatorToApi(_0x169b18){const _0x107ff7=a195_0x2a38e8,_0x12fc8a={'type':mapYamlOperatorType(_0x169b18[_0x107ff7(0x170)]),'not':_0x169b18['not']??![]};if(isBetweenOperator(_0x169b18[_0x107ff7(0x170)]))return _0x169b18[_0x107ff7(0x106)]!==undefined&&(_0x12fc8a[_0x107ff7(0xbf)]=typeof _0x169b18[_0x107ff7(0x106)]===_0x107ff7(0xd1)?_0x169b18[_0x107ff7(0x106)]:String(_0x169b18[_0x107ff7(0x106)])),_0x169b18[_0x107ff7(0xd7)]!==undefined&&(_0x12fc8a[_0x107ff7(0x146)]=typeof _0x169b18[_0x107ff7(0xd7)]===_0x107ff7(0xd1)?_0x169b18[_0x107ff7(0xd7)]:String(_0x169b18[_0x107ff7(0xd7)])),_0x12fc8a;if(_0x169b18[_0x107ff7(0x170)]===_0x107ff7(0x119))return _0x169b18[_0x107ff7(0x171)]&&(_0x12fc8a[_0x107ff7(0x171)]=_0x169b18[_0x107ff7(0x171)]),_0x169b18['from']&&(_0x12fc8a[_0x107ff7(0xe7)]=_0x169b18[_0x107ff7(0xe7)]),_0x169b18['reverse']!==undefined&&(_0x12fc8a[_0x107ff7(0x12d)]=_0x169b18[_0x107ff7(0x12d)]),_0x12fc8a;const _0x574537=getEffectiveValue(_0x169b18);if(_0x574537!==undefined){if(Array[_0x107ff7(0x161)](_0x574537))_0x12fc8a['rightValues']=_0x574537;else isTemporalOperator(_0x169b18['type'])?_0x12fc8a[_0x107ff7(0x102)]=_0x574537:_0x12fc8a[_0x107ff7(0x166)]=_0x574537;}return _0x169b18[_0x107ff7(0x138)]&&(_0x12fc8a[_0x107ff7(0x138)]=_0x169b18[_0x107ff7(0x138)]),_0x12fc8a;}function mapYamlOperatorType(_0x252c40){return _0x252c40;}export function toYamlString(_0x37d739){const _0x4b9fb5=a195_0x2a38e8,_0x25f620=JSON[_0x4b9fb5(0x107)](JSON[_0x4b9fb5(0xd5)](_0x37d739)),_0x4a1c88=a195_0x2658ce['stringify'](_0x25f620,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4b9fb5(0xca)}),_0x1ad51c=['rule:'];let _0x24ad4e=_0x4a1c88;for(const _0x242f81 of _0x1ad51c){_0x24ad4e=_0x24ad4e['replace'](new RegExp('^('+_0x242f81+')','m'),(_0x1b9ae9,_0x1f466f,_0xb4a784)=>{if(_0xb4a784===0x0||_0x24ad4e[_0xb4a784-0x1]==='\x0a'&&_0x24ad4e[_0xb4a784-0x2]==='\x0a')return _0x1f466f;return'\x0a'+_0x1f466f;});}return _0x24ad4e;}export function parseYamlString(_0x12a4af){return parseSegmentYamlFile(_0x12a4af);}export function isSegmentYaml(_0x368b0e){const _0x3d6ba6=a195_0x2a38e8;if(typeof _0x368b0e!==_0x3d6ba6(0xd1)||_0x368b0e===null)return![];const _0x3e39b6=_0x368b0e;return _0x3e39b6[_0x3d6ba6(0x170)]===_0x3d6ba6(0x144)||_0x3e39b6[_0x3d6ba6(0x170)]===undefined;}function a195_0x4935(_0x563f22,_0x57e12e){_0x563f22=_0x563f22-0xbb;const _0x1a1eb3=a195_0x1a1e();let _0x49351c=_0x1a1eb3[_0x563f22];return _0x49351c;}export function generateTemplate(_0x187c2f=a195_0x2a38e8(0x149)){const _0x276e5e=a195_0x2a38e8,_0x406bb2={'type':_0x276e5e(0x144),'name':_0x187c2f,'description':_0x276e5e(0x13f),'rule':{'type':'And','conditions':[{'type':_0x276e5e(0xf2),'attribute':_0x276e5e(0x128),'operator':{'type':_0x276e5e(0xd2),'value':_0x276e5e(0x102)}}]}};return toYamlString(_0x406bb2);}export function segmentToYamlString(_0x29f727){const _0x4508d8=a195_0x2a38e8,_0x3b9af2=JSON[_0x4508d8(0x107)](JSON[_0x4508d8(0xd5)](_0x29f727)),_0x5a2f27=a195_0x2658ce[_0x4508d8(0xd5)](_0x3b9af2,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x4508d8(0xca)}),_0xad6d4d=[_0x4508d8(0x15e),'activations:'];let _0x22e705=_0x5a2f27;for(const _0x3e794c of _0xad6d4d){_0x22e705=_0x22e705[_0x4508d8(0x10e)](new RegExp('^('+_0x3e794c+')','m'),(_0x25b877,_0x42d28f,_0x13b49e)=>{if(_0x13b49e===0x0||_0x22e705[_0x13b49e-0x1]==='\x0a'&&_0x22e705[_0x13b49e-0x2]==='\x0a')return _0x42d28f;return'\x0a'+_0x42d28f;});}return _0x22e705;}export function parseSegmentYamlFile(_0x59721d){return safeParseYaml(_0x59721d,SegmentDefSchema);}export function normalizeChildSegmentYaml(_0x4692cd){const _0x3a427d=a195_0x2a38e8;return{'type':_0x3a427d(0x144),'name':_0x4692cd['name'],..._0x4692cd[_0x3a427d(0x140)]!==undefined&&{'description':_0x4692cd['description']},..._0x4692cd[_0x3a427d(0xe8)]!==undefined&&{'folder':_0x4692cd[_0x3a427d(0xe8)]},..._0x4692cd['rule']&&{'rule':normalizeRule(_0x4692cd['rule'])},..._0x4692cd['kind']!==undefined&&{'kind':_0x4692cd[_0x3a427d(0xdf)]},..._0x4692cd['visible']!==undefined&&{'visible':_0x4692cd['visible']},..._0x4692cd[_0x3a427d(0x153)]&&{'activations':_0x4692cd['activations'][_0x3a427d(0xe5)](normalizeActivation)}};}export function normalizeRule(_0x9a339b){const _0x2076c1=a195_0x2a38e8;return{'type':_0x9a339b[_0x2076c1(0x170)],'conditions':_0x9a339b['conditions'][_0x2076c1(0xe5)](normalizeCondition),..._0x9a339b['description']!==undefined&&{'description':_0x9a339b[_0x2076c1(0x140)]},..._0x9a339b[_0x2076c1(0xdd)]!==undefined&&{'expr':_0x9a339b[_0x2076c1(0xdd)]}};}function normalizeCondition(_0x3dfacb){const _0xa0f0ab=a195_0x2a38e8;if(_0xa0f0ab(0x144)in _0x3dfacb&&(_0x3dfacb[_0xa0f0ab(0x170)]===_0xa0f0ab(0xd3)||_0x3dfacb['type']===_0xa0f0ab(0xfa))){const _0x17652e=_0x3dfacb;return{'type':_0x17652e[_0xa0f0ab(0x170)],'segment':_0x17652e[_0xa0f0ab(0x144)]};}if(_0x3dfacb[_0xa0f0ab(0x170)]===_0xa0f0ab(0x11a)||_0x3dfacb[_0xa0f0ab(0x170)]==='Or'||_0x3dfacb[_0xa0f0ab(0x170)]===_0xa0f0ab(0x175)){const _0x2472b2=_0x3dfacb;return{'type':_0x2472b2['type'],'conditions':_0x2472b2[_0xa0f0ab(0x147)][_0xa0f0ab(0xe5)](normalizeCondition),..._0x2472b2[_0xa0f0ab(0x140)]!==undefined&&{'description':_0x2472b2[_0xa0f0ab(0x140)]},..._0x2472b2['expr']!==undefined&&{'expr':_0x2472b2[_0xa0f0ab(0xdd)]}};}if(_0xa0f0ab(0x15b)in _0x3dfacb&&_0x3dfacb['type']===_0xa0f0ab(0xe2)){const _0x431901=_0x3dfacb;return{'type':_0xa0f0ab(0xe2),'column':_0x431901[_0xa0f0ab(0x15b)],'operator':normalizeOperator(_0x431901[_0xa0f0ab(0xd0)])};}if(_0x3dfacb[_0xa0f0ab(0x170)]===_0xa0f0ab(0xcf)){const _0x2670c=_0x3dfacb;return{'type':'Behavior','attribute':_0x2670c[_0xa0f0ab(0x12c)],'operator':normalizeOperator(_0x2670c[_0xa0f0ab(0xd0)]),..._0x2670c[_0xa0f0ab(0xc5)]!==undefined&&{'arrayMatching':_0x2670c['arrayMatching']},..._0x2670c[_0xa0f0ab(0xfa)]!==undefined&&{'exclude':_0x2670c[_0xa0f0ab(0xfa)]},..._0x2670c['aggregation']!==undefined&&{'aggregation':_0x2670c[_0xa0f0ab(0x143)]},..._0x2670c[_0xa0f0ab(0x14c)]!==undefined&&{'source':_0x2670c[_0xa0f0ab(0x14c)]},..._0x2670c[_0xa0f0ab(0x117)]!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x2670c[_0xa0f0ab(0x117)])))},..._0x2670c[_0xa0f0ab(0x169)]!==undefined&&{'timeWindow':_0x2670c[_0xa0f0ab(0x169)]},..._0x2670c['limit']!==undefined&&{'limit':_0x2670c[_0xa0f0ab(0x162)]}};}const _0x48df2e=_0x3dfacb;return{'type':'Value','attribute':_0x48df2e[_0xa0f0ab(0x12c)],'operator':normalizeOperator(_0x48df2e['operator']),..._0x48df2e[_0xa0f0ab(0xc5)]!==undefined&&{'arrayMatching':_0x48df2e[_0xa0f0ab(0xc5)]},..._0x48df2e[_0xa0f0ab(0xfa)]!==undefined&&{'exclude':_0x48df2e[_0xa0f0ab(0xfa)]},..._0x48df2e[_0xa0f0ab(0x143)]!==undefined&&{'aggregation':_0x48df2e['aggregation']},..._0x48df2e[_0xa0f0ab(0x14c)]!==undefined&&{'source':_0x48df2e['source']},..._0x48df2e['filter']!==undefined&&{'filter':ruleDefAsFilterRule(normalizeRule(filterRuleAsRuleDef(_0x48df2e[_0xa0f0ab(0x117)])))},..._0x48df2e['limit']!==undefined&&{'limit':_0x48df2e['limit']}};}function normalizeOperator(_0x2a2630){const _0xcbd4bd=a195_0x2a38e8;if(isBetweenOperator(_0x2a2630['type']))return{'type':_0x2a2630[_0xcbd4bd(0x170)],..._0x2a2630[_0xcbd4bd(0xeb)]!==undefined&&{'not':_0x2a2630[_0xcbd4bd(0xeb)]},..._0x2a2630[_0xcbd4bd(0x106)]!==undefined&&{'min':_0x2a2630['min']},..._0x2a2630[_0xcbd4bd(0xd7)]!==undefined&&{'max':_0x2a2630[_0xcbd4bd(0xd7)]}};const _0x46271f=getEffectiveValue(_0x2a2630);return{'type':_0x2a2630['type'],..._0x2a2630[_0xcbd4bd(0xeb)]!==undefined&&{'not':_0x2a2630[_0xcbd4bd(0xeb)]},..._0x46271f!==undefined&&{'value':_0x46271f},..._0x2a2630[_0xcbd4bd(0x138)]!==undefined&&{'unit':_0x2a2630[_0xcbd4bd(0x138)]},..._0x2a2630[_0xcbd4bd(0x171)]!==undefined&&{'duration':_0x2a2630[_0xcbd4bd(0x171)]},..._0x2a2630[_0xcbd4bd(0xe7)]!==undefined&&{'from':_0x2a2630[_0xcbd4bd(0xe7)]},..._0x2a2630['reverse']!==undefined&&{'reverse':_0x2a2630[_0xcbd4bd(0x12d)]}};}function normalizeActivation(_0x2c46c5){const _0x356ebe=a195_0x2a38e8;return{'name':_0x2c46c5[_0x356ebe(0x151)],'connection':_0x2c46c5[_0x356ebe(0x110)],..._0x2c46c5[_0x356ebe(0x140)]!==undefined&&{'description':_0x2c46c5[_0x356ebe(0x140)]},..._0x2c46c5[_0x356ebe(0x14d)]!==undefined&&{'all_columns':_0x2c46c5[_0x356ebe(0x14d)]},..._0x2c46c5['columns']!==undefined&&{'columns':_0x2c46c5['columns']},..._0x2c46c5[_0x356ebe(0xdb)]!==undefined&&{'behavior':_0x2c46c5['behavior']},..._0x2c46c5['behaviors']!==undefined&&{'behaviors':_0x2c46c5[_0x356ebe(0x121)]},..._0x2c46c5[_0x356ebe(0x160)]!==undefined&&{'schedule':_0x2c46c5[_0x356ebe(0x160)]},..._0x2c46c5[_0x356ebe(0xef)]!==undefined&&{'notification':_0x2c46c5[_0x356ebe(0xef)]},..._0x2c46c5[_0x356ebe(0x15a)]!==undefined&&{'connector_config':_0x2c46c5[_0x356ebe(0x15a)]},..._0x2c46c5[_0x356ebe(0x136)]!==undefined&&{'activation_template_id':_0x2c46c5[_0x356ebe(0x136)]},..._0x2c46c5['nested_workflow_project_name']!==undefined&&{'nested_workflow_project_name':_0x2c46c5['nested_workflow_project_name']},..._0x2c46c5['nested_workflow_name']!==undefined&&{'nested_workflow_name':_0x2c46c5['nested_workflow_name']},..._0x2c46c5['lock_enabled']!==undefined&&{'lock_enabled':_0x2c46c5[_0x356ebe(0x11e)]}};}function getColumnName(_0x390019){const _0xc9d5a2=a195_0x2a38e8;return _0x390019[_0xc9d5a2(0x15b)]||_0x390019[_0xc9d5a2(0x151)];}function behaviorApiToDef(_0x3876c6){const _0x164a19=a195_0x2a38e8,_0x135350={};return _0x3876c6[_0x164a19(0x11b)]&&_0x3876c6[_0x164a19(0x11b)][_0x164a19(0x150)]>0x0&&(_0x135350['columns']=_0x3876c6[_0x164a19(0x11b)][_0x164a19(0x117)](_0x2ac417=>_0x2ac417&&getColumnName(_0x2ac417))['map'](_0x396979=>({'name':getColumnName(_0x396979),..._0x396979['type']&&{'type':_0x396979[_0x164a19(0x170)]},..._0x396979[_0x164a19(0x168)]&&{'visibility':_0x396979[_0x164a19(0x168)]}}))),_0x3876c6['behaviorTableName']&&(_0x135350[_0x164a19(0x159)]=_0x3876c6[_0x164a19(0x14b)]),_0x3876c6[_0x164a19(0x172)]!==undefined&&(_0x135350[_0x164a19(0x15d)]=_0x3876c6[_0x164a19(0x172)]),_0x3876c6['joinStrategy']&&(_0x135350['join_strategy']=_0x3876c6[_0x164a19(0x105)]),_0x3876c6[_0x164a19(0x103)]&&(_0x135350[_0x164a19(0x103)]=_0x3876c6[_0x164a19(0x103)]),_0x3876c6[_0x164a19(0x13d)]&&_0x3876c6[_0x164a19(0x13d)][_0x164a19(0x150)]>0x0&&(_0x135350[_0x164a19(0x109)]=_0x3876c6['orderBy']),_0x135350;}function behaviorsApiToDef(_0x21cf7b){const _0x1cf81c=a195_0x2a38e8;return _0x21cf7b['map'](behaviorApiToDef)['filter'](_0x2e501a=>Object[_0x1cf81c(0xff)](_0x2e501a)[_0x1cf81c(0x150)]>0x0);}export function activationResponseToDef(_0x449d94,_0xe358ca,_0x31924f){const _0xe2ce50=a195_0x2a38e8,_0x4039b1=_0x449d94['connectionId']||'',_0x538e69=_0x31924f?.['get'](_0x4039b1)??_0x4039b1,_0x17ce6e={'name':_0x449d94[_0xe2ce50(0x151)],'connection':_0x538e69};_0x449d94['description']&&(_0x17ce6e[_0xe2ce50(0x140)]=_0x449d94['description']);let _0x4e569d=[];_0x449d94[_0xe2ce50(0x11b)]&&_0x449d94['columns']['length']>0x0&&(_0x4e569d=_0x449d94[_0xe2ce50(0x11b)][_0xe2ce50(0x117)](_0x2183d0=>_0x2183d0&&getColumnName(_0x2183d0))[_0xe2ce50(0xe5)](_0x59f0ff=>{const _0xee4769=_0xe2ce50,_0x60fb53=getColumnName(_0x59f0ff);if(_0x59f0ff[_0xee4769(0x170)]||_0x59f0ff[_0xee4769(0x168)])return{'name':_0x60fb53,..._0x59f0ff[_0xee4769(0x170)]&&{'type':_0x59f0ff[_0xee4769(0x170)]},..._0x59f0ff[_0xee4769(0x168)]&&{'visibility':_0x59f0ff[_0xee4769(0x168)]}};return _0x60fb53;}));_0x4e569d[_0xe2ce50(0x150)]>0x0&&(_0x17ce6e[_0xe2ce50(0x11b)]=_0x4e569d);_0x449d94[_0xe2ce50(0x10f)]!==undefined&&(_0x449d94['allColumns']===![]&&_0x4e569d[_0xe2ce50(0x150)]===0x0?_0x17ce6e[_0xe2ce50(0x14d)]=!![]:_0x17ce6e[_0xe2ce50(0x14d)]=_0x449d94['allColumns']);const _0x5abd10={};let _0x5f4588=![];_0x449d94[_0xe2ce50(0x12a)]&&(_0x5abd10[_0xe2ce50(0x170)]=_0x449d94[_0xe2ce50(0x12a)],_0x5f4588=!![]);_0x449d94[_0xe2ce50(0x12e)]&&(_0x5abd10[_0xe2ce50(0x120)]=_0x449d94[_0xe2ce50(0x12e)],_0x5f4588=!![]);_0x449d94[_0xe2ce50(0x126)]!==undefined&&_0x449d94[_0xe2ce50(0x126)]!==null&&(_0x5abd10[_0xe2ce50(0x16a)]=_0x449d94[_0xe2ce50(0x126)],_0x5f4588=!![]);_0x449d94[_0xe2ce50(0xd4)]&&_0x449d94[_0xe2ce50(0xd4)][_0xe2ce50(0x150)]>0x0&&(_0x5abd10[_0xe2ce50(0xdc)]=_0x449d94[_0xe2ce50(0xd4)],_0x5f4588=!![]);_0x449d94['startAt']!==undefined&&(_0x5abd10[_0xe2ce50(0xbd)]=_0x449d94[_0xe2ce50(0xd6)],_0x5f4588=!![]);_0x449d94[_0xe2ce50(0x164)]!==undefined&&(_0x5abd10[_0xe2ce50(0xee)]=_0x449d94['endOn'],_0x5f4588=!![]);_0x449d94[_0xe2ce50(0xea)]&&(_0x5abd10[_0xe2ce50(0xea)]=_0x449d94['timezone'],_0x5f4588=!![]);_0x5f4588&&(_0x17ce6e[_0xe2ce50(0x160)]=_0x5abd10);(_0x449d94['notifyOn']&&_0x449d94[_0xe2ce50(0x132)][_0xe2ce50(0x150)]>0x0||_0x449d94[_0xe2ce50(0xcc)]&&_0x449d94[_0xe2ce50(0xcc)][_0xe2ce50(0x150)]>0x0)&&(_0x17ce6e[_0xe2ce50(0xef)]={},_0x449d94[_0xe2ce50(0x132)]&&_0x449d94['notifyOn'][_0xe2ce50(0x150)]>0x0&&(_0x17ce6e[_0xe2ce50(0xef)][_0xe2ce50(0x122)]=_0x449d94[_0xe2ce50(0x132)]),_0x449d94[_0xe2ce50(0xcc)]&&_0x449d94['emailRecipients'][_0xe2ce50(0x150)]>0x0&&(_0x17ce6e[_0xe2ce50(0xef)]['email_recipients']=_0x449d94[_0xe2ce50(0xcc)]['map'](_0x20809c=>{const _0x536e66=_0xe2ce50,_0x2e5792=_0xe358ca?.[_0x536e66(0xe1)](_0x20809c);return _0x2e5792??String(_0x20809c);})));_0x449d94[_0xe2ce50(0x14f)]&&Object[_0xe2ce50(0xff)](_0x449d94[_0xe2ce50(0x14f)])[_0xe2ce50(0x150)]>0x0&&(_0x17ce6e[_0xe2ce50(0x15a)]=normalizeConnectorConfigForYaml(_0x449d94['connectorConfig']));_0x449d94[_0xe2ce50(0x152)]&&(_0x17ce6e[_0xe2ce50(0x136)]=_0x449d94['activationTemplateId']);if(_0x449d94[_0xe2ce50(0x11f)]&&_0x449d94[_0xe2ce50(0x11f)][_0xe2ce50(0x150)]>0x0){const _0x4eaac0=behaviorsApiToDef(_0x449d94[_0xe2ce50(0x11f)]);_0x4eaac0[_0xe2ce50(0x150)]>0x0&&(_0x17ce6e[_0xe2ce50(0x121)]=_0x4eaac0);}return _0x449d94[_0xe2ce50(0xe3)]&&(_0x17ce6e['nested_workflow_project_name']=_0x449d94[_0xe2ce50(0xe3)]),_0x449d94[_0xe2ce50(0x17a)]&&(_0x17ce6e[_0xe2ce50(0x13b)]=_0x449d94[_0xe2ce50(0x17a)]),_0x449d94['lockEnabled']!==undefined&&(_0x17ce6e[_0xe2ce50(0x11e)]=_0x449d94[_0xe2ce50(0xcd)]),_0x17ce6e;}export function journeyActivationStepToYaml(_0x103d5d,_0x1f7bd2,_0x1c268a){const _0x143bf6=a195_0x2a38e8,_0x1abcdf=_0x103d5d[_0x143bf6(0x111)][_0x143bf6(0xc8)],_0x7704e3=_0x1abcdf[_0x143bf6(0x163)]||'',_0x527558=_0x1c268a?.[_0x143bf6(0xe1)](_0x7704e3)??_0x7704e3,_0x40f48c={'name':_0x1abcdf[_0x143bf6(0x151)]||'','connection':_0x527558};_0x103d5d['attributes'][_0x143bf6(0x156)]&&(_0x40f48c[_0x143bf6(0x123)]=!![]);_0x1abcdf[_0x143bf6(0x140)]&&(_0x40f48c[_0x143bf6(0x140)]=_0x1abcdf[_0x143bf6(0x140)]);let _0x1d7fc7=[];_0x1abcdf['columns']&&_0x1abcdf[_0x143bf6(0x11b)][_0x143bf6(0x150)]>0x0&&(_0x1d7fc7=_0x1abcdf[_0x143bf6(0x11b)][_0x143bf6(0x117)](_0x506a5d=>_0x506a5d&&getColumnName(_0x506a5d))[_0x143bf6(0xe5)](_0x4ac89a=>{const _0x1360f7=_0x143bf6,_0xc4d8f8=getColumnName(_0x4ac89a);if(_0x4ac89a['type']||_0x4ac89a[_0x1360f7(0x168)])return{'name':_0xc4d8f8,..._0x4ac89a[_0x1360f7(0x170)]&&{'type':_0x4ac89a['type']},..._0x4ac89a['visibility']&&{'visibility':_0x4ac89a[_0x1360f7(0x168)]}};return _0xc4d8f8;}));_0x1d7fc7[_0x143bf6(0x150)]>0x0&&(_0x40f48c[_0x143bf6(0x11b)]=_0x1d7fc7);_0x1abcdf['allColumns']!==undefined&&(_0x1abcdf[_0x143bf6(0x10f)]===![]&&_0x1d7fc7[_0x143bf6(0x150)]===0x0?_0x40f48c[_0x143bf6(0x14d)]=!![]:_0x40f48c[_0x143bf6(0x14d)]=_0x1abcdf[_0x143bf6(0x10f)]);const _0x141338={};let _0x192f87=![];_0x1abcdf[_0x143bf6(0x12a)]&&(_0x141338[_0x143bf6(0x170)]=_0x1abcdf[_0x143bf6(0x12a)],_0x192f87=!![]);_0x1abcdf[_0x143bf6(0x12e)]&&(_0x141338['repeat_unit']=_0x1abcdf['repeatUnit'],_0x192f87=!![]);_0x1abcdf[_0x143bf6(0x126)]!==undefined&&_0x1abcdf[_0x143bf6(0x126)]!==null&&(_0x141338[_0x143bf6(0x16a)]=_0x1abcdf['repeatFrequency'],_0x192f87=!![]);_0x1abcdf[_0x143bf6(0xd6)]!==undefined&&(_0x141338[_0x143bf6(0xbd)]=_0x1abcdf[_0x143bf6(0xd6)],_0x192f87=!![]);_0x1abcdf[_0x143bf6(0x164)]!==undefined&&(_0x141338['end_on']=_0x1abcdf[_0x143bf6(0x164)],_0x192f87=!![]);_0x1abcdf[_0x143bf6(0xea)]&&(_0x141338['timezone']=_0x1abcdf['timezone'],_0x192f87=!![]);_0x192f87&&(_0x40f48c[_0x143bf6(0x160)]=_0x141338);(_0x1abcdf[_0x143bf6(0x132)]&&_0x1abcdf[_0x143bf6(0x132)][_0x143bf6(0x150)]>0x0||_0x1abcdf[_0x143bf6(0xcc)]&&_0x1abcdf['emailRecipients']['length']>0x0)&&(_0x40f48c[_0x143bf6(0xef)]={},_0x1abcdf[_0x143bf6(0x132)]&&_0x1abcdf['notifyOn'][_0x143bf6(0x150)]>0x0&&(_0x40f48c['notification'][_0x143bf6(0x122)]=_0x1abcdf[_0x143bf6(0x132)]),_0x1abcdf[_0x143bf6(0xcc)]&&_0x1abcdf['emailRecipients'][_0x143bf6(0x150)]>0x0&&(_0x40f48c['notification']['email_recipients']=_0x1abcdf[_0x143bf6(0xcc)][_0x143bf6(0xe5)](_0x50c31c=>{const _0x27b1e8=_0x143bf6,_0x4e45b0=_0x1f7bd2?.[_0x27b1e8(0xe1)](_0x50c31c);return _0x4e45b0??String(_0x50c31c);})));_0x1abcdf[_0x143bf6(0x14f)]&&Object['keys'](_0x1abcdf['connectorConfig'])[_0x143bf6(0x150)]>0x0&&(_0x40f48c[_0x143bf6(0x15a)]=normalizeConnectorConfigForYaml(_0x1abcdf[_0x143bf6(0x14f)]));_0x1abcdf[_0x143bf6(0x152)]&&(_0x40f48c[_0x143bf6(0x136)]=_0x1abcdf[_0x143bf6(0x152)]);if(_0x1abcdf['syndicationBehaviors']&&_0x1abcdf[_0x143bf6(0x11f)][_0x143bf6(0x150)]>0x0){const _0x2f197c=behaviorsApiToDef(_0x1abcdf['syndicationBehaviors']);_0x2f197c['length']>0x0&&(_0x40f48c[_0x143bf6(0x121)]=_0x2f197c);}return _0x40f48c;}export function segmentWithActivationsToYaml(_0x153efd,_0x51776d,_0x4f7206,_0x457b75,_0x5aca0e){const _0x5901d7=a195_0x2a38e8,_0x548532=segmentResponseToDefSync(_0x153efd,_0x4f7206);return _0x51776d[_0x5901d7(0x150)]>0x0&&(_0x548532[_0x5901d7(0x153)]=_0x51776d['map'](_0x18f22d=>activationResponseToDef(_0x18f22d,_0x457b75,_0x5aca0e))),_0x548532;}function normalizeColumn(_0x2df28a){const _0x23a4c6=a195_0x2a38e8;if(typeof _0x2df28a==='string')return{'column':_0x2df28a,'source':{'column':_0x2df28a}};return{'column':_0x2df28a[_0x23a4c6(0x151)],'source':{'column':_0x2df28a['name']},..._0x2df28a[_0x23a4c6(0x170)]&&{'type':_0x2df28a[_0x23a4c6(0x170)]},..._0x2df28a[_0x23a4c6(0x168)]&&{'visibility':_0x2df28a[_0x23a4c6(0x168)]}};}function behaviorDefToApi(_0x748559){const _0x14ba9a=a195_0x2a38e8,_0x524850={};if(_0x748559['columns']&&_0x748559[_0x14ba9a(0x11b)][_0x14ba9a(0x150)]>0x0){const _0x2e4e99=_0x748559['columns']['filter'](_0x1c396b=>typeof _0x1c396b===_0x14ba9a(0xce)?_0x1c396b:_0x1c396b['name'])['map'](normalizeColumn);_0x2e4e99['length']>0x0&&(_0x524850[_0x14ba9a(0x11b)]=_0x2e4e99);}_0x748559[_0x14ba9a(0x159)]&&(_0x524850['behaviorTableName']=_0x748559[_0x14ba9a(0x159)]);_0x748559[_0x14ba9a(0x125)]&&(_0x524850['joinStrategy']=_0x748559['join_strategy']);if(_0x748559[_0x14ba9a(0x15d)]!==undefined)_0x524850['joinRow']=_0x748559[_0x14ba9a(0x15d)];else{if(_0x748559[_0x14ba9a(0x125)]===_0x14ba9a(0xf5)||_0x748559['join_strategy']===_0x14ba9a(0xc4))_0x524850[_0x14ba9a(0x172)]=0x1;else _0x748559['join_strategy']===_0x14ba9a(0xed)&&(_0x524850['joinRow']=null);}return _0x748559['formatting']&&(_0x524850[_0x14ba9a(0x103)]=_0x748559[_0x14ba9a(0x103)]),_0x748559[_0x14ba9a(0x109)]&&(_0x524850[_0x14ba9a(0x13d)]=_0x748559[_0x14ba9a(0x109)]),_0x524850;}export async function activationDefToCreateRequest(_0x238944,_0x7dd1ff){const _0x203df4=a195_0x2a38e8,_0x5429a1=_0x7dd1ff?.['emailToIdMap'],_0x49088c=_0x7dd1ff?.['connectionNameToIdMap'],_0x13789e=_0x238944['connection'];let _0x11a1ee;const _0x554092=parseInt(_0x13789e,0xa);if(!isNaN(_0x554092)&&String(_0x554092)===_0x13789e)_0x11a1ee=_0x554092;else{const _0x1c9139=_0x49088c?.[_0x203df4(0xe1)](_0x13789e);if(_0x1c9139===undefined)throw new SDKError(ErrorCode[_0x203df4(0x11d)],_0x203df4(0x134)+_0x13789e,undefined,{'helpText':'Use\x20\x27tdx\x20connections\x27\x20to\x20list\x20available\x20connections'});_0x11a1ee=_0x1c9139;}const _0xfe1535={'name':_0x238944['name'],'connectionId':_0x11a1ee};_0x238944['description']&&(_0xfe1535['description']=_0x238944['description']);let _0x74813b=[];_0x238944[_0x203df4(0x11b)]&&_0x238944[_0x203df4(0x11b)]['length']>0x0&&(_0x74813b=_0x238944[_0x203df4(0x11b)][_0x203df4(0x117)](_0x2cadf6=>_0x2cadf6!=null)['map'](normalizeColumn));_0x74813b[_0x203df4(0x150)]>0x0&&(_0xfe1535[_0x203df4(0x11b)]=_0x74813b);_0x238944[_0x203df4(0x14d)]!==undefined&&(_0x238944[_0x203df4(0x14d)]===![]&&_0x74813b['length']===0x0?_0xfe1535[_0x203df4(0x10f)]=!![]:_0xfe1535[_0x203df4(0x10f)]=_0x238944[_0x203df4(0x14d)]);if(_0x238944[_0x203df4(0x160)]){const _0x4ef377=_0x238944[_0x203df4(0x160)],_0x2c71aa=_0x4ef377[_0x203df4(0x170)]??REPEAT_UNIT_TO_SCHEDULE_TYPE[_0x4ef377[_0x203df4(0x120)]];_0x2c71aa&&(_0xfe1535['scheduleType']=_0x2c71aa);const _0x54b3f7=_0x4ef377[_0x203df4(0x120)]??SCHEDULE_TYPE_TO_REPEAT_UNIT[_0x4ef377[_0x203df4(0x170)]];_0x54b3f7&&(_0xfe1535[_0x203df4(0x12e)]=_0x54b3f7);_0x4ef377['repeat_frequency']!==undefined&&(_0xfe1535['repeatFrequency']=_0x4ef377[_0x203df4(0x16a)]);_0x4ef377[_0x203df4(0xdc)]&&(_0xfe1535[_0x203df4(0xd4)]=_0x4ef377[_0x203df4(0xdc)]);_0x4ef377[_0x203df4(0xbd)]!==undefined&&(_0xfe1535[_0x203df4(0xd6)]=_0x4ef377[_0x203df4(0xbd)]);_0x4ef377[_0x203df4(0xee)]!==undefined&&(_0xfe1535[_0x203df4(0x164)]=_0x4ef377[_0x203df4(0xee)]);_0x4ef377['timezone']&&(_0xfe1535[_0x203df4(0xea)]=_0x4ef377['timezone']);if(_0x2c71aa&&_0x2c71aa!==_0x203df4(0xfc)&&_0x2c71aa!==_0x203df4(0xbe)&&_0x4ef377[_0x203df4(0xbd)]){const _0x44bc84=_0x4ef377[_0x203df4(0xbd)]['match'](/T(\d{2}:\d{2})/);_0x44bc84&&(_0xfe1535[_0x203df4(0x12b)]=_0x44bc84[0x1]);}}_0x238944['notification']&&(_0x238944['notification'][_0x203df4(0x122)]&&(_0xfe1535[_0x203df4(0x132)]=_0x238944['notification'][_0x203df4(0x122)]),_0x238944[_0x203df4(0xef)][_0x203df4(0x14e)]&&(_0xfe1535[_0x203df4(0xcc)]=_0x238944['notification']['email_recipients'][_0x203df4(0xe5)](_0x225a5b=>{const _0x122c9d=_0x203df4,_0x596406=Number(_0x225a5b);if(!isNaN(_0x596406)&&String(_0x596406)===_0x225a5b)return _0x596406;const _0x341b00=_0x5429a1?.[_0x122c9d(0xe1)](_0x225a5b[_0x122c9d(0xc6)]());if(_0x341b00===undefined)throw new SDKError(ErrorCode[_0x122c9d(0x15f)],_0x122c9d(0xf1)+_0x225a5b+'.\x20Use\x20\x27tdx\x20user\x20list\x27\x20to\x20see\x20valid\x20emails.');return _0x341b00;})));if(_0x238944[_0x203df4(0x15a)]){const _0x53b8b9=_0x7dd1ff?.[_0x203df4(0xf3)]?.[_0x203df4(0xe1)](_0x13789e);_0xfe1535[_0x203df4(0x14f)]=_0x238944[_0x203df4(0x15a)];if(_0x53b8b9&&_0x7dd1ff?.[_0x203df4(0x115)]){let _0x467e8a;try{_0x467e8a=await _0x7dd1ff['getSchema'](_0x53b8b9);const _0x50f1a9=validateConnectorConfig(_0x238944[_0x203df4(0x15a)],_0x467e8a);if(!_0x50f1a9[_0x203df4(0xde)])throw new SDKError(ErrorCode[_0x203df4(0x176)],_0x203df4(0x139)+_0x238944['name']+_0x203df4(0xe0)+formatValidationErrors(_0x50f1a9[_0x203df4(0xc7)]),undefined,{'helpText':'Connector:\x20'+_0x53b8b9+_0x203df4(0x118)+formatSchemaAsHelp(_0x467e8a)});if(_0x50f1a9[_0x203df4(0x167)][_0x203df4(0x150)]>0x0){const _0x5a3dce=formatValidationWarnings(_0x50f1a9[_0x203df4(0x167)]);console[_0x203df4(0xf6)](_0x203df4(0x148)+_0x238944['name']+_0x203df4(0xe0)+_0x5a3dce);}}catch(_0xe897b1){if(!(_0xe897b1 instanceof SDKError)||_0xe897b1[_0x203df4(0xfd)]!==ErrorCode[_0x203df4(0xe4)])throw _0xe897b1;}if(_0x467e8a&&getLegacySettingsField(_0x467e8a)){if(!_0x7dd1ff?.[_0x203df4(0xf0)])throw new SDKError(ErrorCode[_0x203df4(0xfe)],'Cannot\x20build\x20connector_config\x20for\x20activation\x20\x22'+_0x238944[_0x203df4(0x151)]+_0x203df4(0x16e)+('\x22'+_0x53b8b9+_0x203df4(0x10a))+'provides\x20no\x20getMetadata.\x20This\x20is\x20a\x20wiring\x20bug\x20in\x20tdx,\x20not\x20a\x20problem\x20with\x20your\x20YAML.');const _0x264056=await _0x7dd1ff[_0x203df4(0xf0)](_0x53b8b9);_0xfe1535[_0x203df4(0x14f)]=transformConfigToLegacy(_0x238944['connector_config'],_0x264056);}}}else _0xfe1535[_0x203df4(0x14f)]={};_0x238944[_0x203df4(0x136)]!==undefined&&(_0xfe1535[_0x203df4(0x152)]=_0x238944[_0x203df4(0x136)]);if(_0x238944[_0x203df4(0x121)])_0xfe1535[_0x203df4(0x11f)]=_0x238944[_0x203df4(0x121)][_0x203df4(0xe5)](behaviorDefToApi);else _0x238944['behavior']&&(_0xfe1535[_0x203df4(0x177)]=behaviorDefToApi(_0x238944[_0x203df4(0xdb)]));return _0x238944['nested_workflow_project_name']&&(_0xfe1535[_0x203df4(0xe3)]=_0x238944['nested_workflow_project_name']),_0x238944[_0x203df4(0x13b)]&&(_0xfe1535[_0x203df4(0x17a)]=_0x238944[_0x203df4(0x13b)]),_0x238944[_0x203df4(0x11e)]!==undefined&&(_0xfe1535[_0x203df4(0xcd)]=_0x238944[_0x203df4(0x11e)]),_0xfe1535;}export async function activationDefToUpdateRequest(_0x12a755,_0x53d3ab){return activationDefToCreateRequest(_0x12a755,_0x53d3ab);}export function deepSortObject(_0x2c148b){const _0x298abb=a195_0x2a38e8;if(_0x2c148b===null||typeof _0x2c148b!==_0x298abb(0xd1))return _0x2c148b;if(Array['isArray'](_0x2c148b))return _0x2c148b[_0x298abb(0xe5)](deepSortObject)[_0x298abb(0x165)]((_0x1579ae,_0x4810d1)=>JSON[_0x298abb(0xd5)](_0x1579ae)['localeCompare'](JSON[_0x298abb(0xd5)](_0x4810d1)));const _0x222c33=_0x2c148b;if(_0x222c33['type']===_0x298abb(0x175)&&Array['isArray'](_0x222c33[_0x298abb(0x147)])){const _0xd8207a={};for(const _0x2a3455 of Object[_0x298abb(0xff)](_0x222c33)['sort']()){_0xd8207a[_0x2a3455]=_0x2a3455===_0x298abb(0x147)?_0x222c33[_0x298abb(0x147)]['map'](deepSortObject):deepSortObject(_0x222c33[_0x2a3455]);}return _0xd8207a;}const _0x23d73d={};for(const _0x49c3ec of Object[_0x298abb(0xff)](_0x2c148b)['sort']()){_0x23d73d[_0x49c3ec]=deepSortObject(_0x2c148b[_0x49c3ec]);}return _0x23d73d;}export function serializeRule(_0x11ce51){const _0xb39048=a195_0x2a38e8;return JSON[_0xb39048(0xd5)](deepSortObject(_0x11ce51));}export function normalizeRuleForMatching(_0x2c3d82){return normalizeConditionsForMatching(_0x2c3d82);}function normalizeConditionsForMatching(_0xe7d10a){const _0xedf4d5=a195_0x2a38e8;if(_0xe7d10a===null||typeof _0xe7d10a!=='object')return _0xe7d10a;if(Array['isArray'](_0xe7d10a))return _0xe7d10a[_0xedf4d5(0xe5)](normalizeConditionsForMatching);const _0x4708b1=_0xe7d10a;if((_0x4708b1[_0xedf4d5(0x170)]===_0xedf4d5(0xd3)||_0x4708b1[_0xedf4d5(0x170)]===_0xedf4d5(0xfa))&&typeof _0x4708b1[_0xedf4d5(0x144)]===_0xedf4d5(0xce))return{..._0x4708b1,'segment':'__SEGMENT_REF__'};const _0x573f56={};for(const _0x5603cd of Object['keys'](_0x4708b1)){_0x573f56[_0x5603cd]=normalizeConditionsForMatching(_0x4708b1[_0x5603cd]);}return _0x573f56;}export function serializeRuleForMatching(_0xa0125e){const _0x40605d=a195_0x2a38e8;return JSON[_0x40605d(0xd5)](deepSortObject(normalizeRuleForMatching(_0xa0125e)));}export function expandSegmentReferences(_0x2ec128,_0x3bd021,_0x2940ba=new Set()){return expandConditions(_0x2ec128,_0x3bd021,_0x2940ba);}function expandConditions(_0xbc554a,_0x3b61af,_0x3a20bc){const _0x22f0dc=a195_0x2a38e8;if(_0xbc554a===null||typeof _0xbc554a!==_0x22f0dc(0xd1))return _0xbc554a;if(Array[_0x22f0dc(0x161)](_0xbc554a))return _0xbc554a[_0x22f0dc(0xe5)](_0x3d8699=>expandConditions(_0x3d8699,_0x3b61af,_0x3a20bc));const _0x1dae8e=_0xbc554a;if((_0x1dae8e[_0x22f0dc(0x170)]===_0x22f0dc(0xd3)||_0x1dae8e[_0x22f0dc(0x170)]===_0x22f0dc(0xfa))&&typeof _0x1dae8e[_0x22f0dc(0x144)]===_0x22f0dc(0xce)){const _0x6f810a=_0x1dae8e[_0x22f0dc(0x144)],_0x48f315=_0x3b61af['get'](_0x6f810a);if(_0x48f315&&!_0x3a20bc['has'](_0x6f810a)){const _0x434ae0=new Set(_0x3a20bc);_0x434ae0[_0x22f0dc(0xc9)](_0x6f810a);const _0x562042=expandConditions(_0x48f315,_0x3b61af,_0x434ae0);return{'type':_0x1dae8e[_0x22f0dc(0x170)],'expanded_rule':_0x562042};}return{'type':_0x1dae8e[_0x22f0dc(0x170)],'expanded_rule':'__UNRESOLVED__'};}const _0x367d7f={};for(const _0x2a1f8b of Object[_0x22f0dc(0xff)](_0x1dae8e)){_0x367d7f[_0x2a1f8b]=expandConditions(_0x1dae8e[_0x2a1f8b],_0x3b61af,_0x3a20bc);}return _0x367d7f;}export function serializeExpandedRule(_0x3ca7d4,_0x122673){const _0x393f6d=a195_0x2a38e8,_0xd7bed=expandSegmentReferences(_0x3ca7d4,_0x122673);return JSON[_0x393f6d(0xd5)](deepSortObject(_0xd7bed));}export function createSegmentNameContext(_0x3932ee){const _0x3d3ab0=a195_0x2a38e8,_0x10ad26=new Set(),_0xe6ba12=new Map(),_0x5bf9ea=new Map();if(_0x3932ee)for(const [_0x488838,_0x1e1a02]of Object[_0x3d3ab0(0xf9)](_0x3932ee)){if(_0x1e1a02['rule']){const _0x2faa9a=serializeRule(_0x1e1a02[_0x3d3ab0(0x101)]);_0x5bf9ea[_0x3d3ab0(0xf8)](_0x2faa9a,_0x488838),_0x10ad26['add'](_0x488838);}}return{'usedNames':_0x10ad26,'ruleHashToName':_0xe6ba12,'localRuleToName':_0x3932ee?_0x5bf9ea:undefined};}export function resolveSegmentName(_0x5583de,_0x3fe00e,_0x34e314,_0x559040){const _0x18a95e=a195_0x2a38e8,_0x413e8a=serializeRule(_0x3fe00e);if(_0x34e314[_0x18a95e(0x154)]){const _0x4b637c=_0x34e314[_0x18a95e(0x154)][_0x18a95e(0xe1)](_0x413e8a);if(_0x4b637c)return{'name':_0x4b637c,'isDuplicate':![],'isLocalMatch':!![]};}const _0x28da42=_0x34e314[_0x18a95e(0x178)]['get'](_0x413e8a);if(_0x28da42)return{'name':_0x28da42,'isDuplicate':!![],'isLocalMatch':![]};const _0x1e985d=_0x559040(_0x5583de);let _0xdde17e=_0x1e985d||_0x5583de,_0x54fe0d=_0xdde17e,_0x53009b=0x2;while(_0x34e314[_0x18a95e(0x12f)][_0x18a95e(0x131)](_0x54fe0d)){_0x54fe0d=_0xdde17e+'_'+_0x53009b,_0x53009b++;}return _0x34e314[_0x18a95e(0x12f)][_0x18a95e(0xc9)](_0x54fe0d),_0x34e314[_0x18a95e(0x178)][_0x18a95e(0xf8)](_0x413e8a,_0x54fe0d),{'name':_0x54fe0d,'isDuplicate':![],'isLocalMatch':![]};}export function collectSegmentRefsFromRule(_0x1dfaf8){const _0x4b47a3=[],_0xaba975=_0x1bdaa5=>{const _0x48636a=a195_0x4935;if(!_0x1bdaa5||typeof _0x1bdaa5!==_0x48636a(0xd1))return;if(Array[_0x48636a(0x161)](_0x1bdaa5)){_0x1bdaa5[_0x48636a(0xe6)](_0xaba975);return;}const _0x358d31=_0x1bdaa5;(_0x358d31['type']===_0x48636a(0xd3)||_0x358d31[_0x48636a(0x170)]===_0x48636a(0xfa))&&typeof _0x358d31['segment']===_0x48636a(0xce)&&_0x4b47a3[_0x48636a(0xf4)](_0x358d31[_0x48636a(0x144)]);for(const _0x5153c1 of Object['values'](_0x358d31)){_0xaba975(_0x5153c1);}};return _0xaba975(_0x1dfaf8),_0x4b47a3;}export function validateSegmentRule(_0x15a539,_0x471323){const _0x49d55c=a195_0x2a38e8;if(!_0x471323||!_0x471323[_0x49d55c(0x147)])return;for(let _0x2ed408=0x0;_0x2ed408<_0x471323[_0x49d55c(0x147)][_0x49d55c(0x150)];_0x2ed408++){const _0x39ae04=_0x471323['conditions'][_0x2ed408];if(_0x49d55c(0x170)in _0x39ae04&&_0x39ae04[_0x49d55c(0x170)]===_0x49d55c(0xf2)){const _0x2b3a02=_0x39ae04,_0x4ecf9b=_0x2b3a02[_0x49d55c(0x14c)]||_0x2b3a02['aggregation'];if((!_0x2b3a02['attribute']||_0x2b3a02[_0x49d55c(0x12c)]==='')&&!_0x4ecf9b)throw new SDKError(ErrorCode[_0x49d55c(0x158)],_0x49d55c(0x127)+_0x15a539+_0x49d55c(0x16f)+('conditions['+_0x2ed408+_0x49d55c(0x11c))+_0x49d55c(0x112));}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1def0a,_0x2c1749){const _0x524f20=a196_0x3f98,_0x56593b=_0x1def0a();while(!![]){try{const _0x3027a1=parseInt(_0x524f20(0x1a0))/0x1*(-parseInt(_0x524f20(0x19c))/0x2)+parseInt(_0x524f20(0x196))/0x3+-parseInt(_0x524f20(0x193))/0x4*(-parseInt(_0x524f20(0x19b))/0x5)+parseInt(_0x524f20(0x19f))/0x6+-parseInt(_0x524f20(0x195))/0x7+parseInt(_0x524f20(0x194))/0x8+-parseInt(_0x524f20(0x1b5))/0x9;if(_0x3027a1===_0x2c1749)break;else _0x56593b['push'](_0x56593b['shift']());}catch(_0x1130f2){_0x56593b['push'](_0x56593b['shift']());}}}(a196_0x2923,0x388d2));import a196_0x28a6de from'chalk';import{withProgressSpinner}from'../../utils/spinner.js';function a196_0x3f98(_0x3cff1a,_0x181087){_0x3cff1a=_0x3cff1a-0x191;const _0x292323=a196_0x2923();let _0x3f98dc=_0x292323[_0x3cff1a];return _0x3f98dc;}export function buildSchemaResult(_0x1f1ab9){const _0x4a254f=a196_0x3f98,_0x225f60=_0x1f1ab9['columns'][_0x4a254f(0x1b2)](_0x530711=>({'column_name':_0x530711[_0x4a254f(0x191)],'column_type':_0x530711['type'],'null':_0x4a254f(0x1c1),'key':null,'default':null,'extra':null}));return{..._0x1f1ab9,'columns':[{'name':'column_name','type':_0x4a254f(0x1ac)},{'name':'column_type','type':'varchar'},{'name':_0x4a254f(0x1ae),'type':_0x4a254f(0x1ac)},{'name':_0x4a254f(0x19a),'type':_0x4a254f(0x1ac)},{'name':'default','type':_0x4a254f(0x1ac)},{'name':_0x4a254f(0x1a1),'type':_0x4a254f(0x1ac)}],'data':_0x225f60};}export async function executeSchemaQuery(_0x234fad,_0xed26d0,_0x39ed16){const _0x4c3528=a196_0x3f98,_0x459199=_0x234fad[_0x4c3528(0x1bb)]()[_0x4c3528(0x1a3)](/;+$/,''),_0x2f098c='SELECT\x20*\x20FROM\x20(\x0a'+_0x459199+'\x0a)\x20AS\x20segment_query\x20LIMIT\x200';_0x39ed16[_0x4c3528(0x1be)]&&console[_0x4c3528(0x1ab)]('Schema\x20query:\x0a'+_0x2f098c);const _0x398063=await withProgressSpinner(_0x4c3528(0x19d),async _0x88a29a=>{const _0x5c6a15=_0x4c3528,_0x5b7042=await _0xed26d0['query'][_0x5c6a15(0x19e)](_0x2f098c,{'catalog':'td','schema':'information_schema','onJobId':_0x4d2641=>{const _0xec15c=_0x5c6a15;_0x88a29a[_0xec15c(0x1ad)](_0x4d2641);}});return _0x5b7042;},{'verbose':_0x39ed16[_0x4c3528(0x1be)]});return buildSchemaResult(_0x398063[_0x4c3528(0x1b4)]);}function columnName(_0x590c34){const _0x3d3440=a196_0x3f98;return _0x590c34['matrixColumnName']||_0x590c34[_0x3d3440(0x1af)]||_0x590c34[_0x3d3440(0x191)];}function formatFieldLine(_0x3ee688,_0x326fe7,_0x3aa421){const _0x362765=a196_0x3f98,_0x111dbe=_0x3ee688!==_0x326fe7?'\x20'+a196_0x28a6de[_0x362765(0x1bd)]('('+_0x326fe7+')'):'';return _0x362765(0x1a4)+_0x3ee688+_0x111dbe+':\x20'+a196_0x28a6de[_0x362765(0x1b0)](_0x3aa421);}function sortByColumnName(_0x8d258){const _0x9611bc=a196_0x3f98;return[..._0x8d258][_0x9611bc(0x198)]((_0x4fc395,_0x14b129)=>columnName(_0x4fc395)[_0x9611bc(0x1a5)](columnName(_0x14b129)));}function a196_0x2923(){const _0x218845=['bold','matrixTableName','Attributes','filter','trim','attribute','dim','verbose','tableName','behaviorName','YES','startsWith','name','groupingName','824768zysrAQ','2336504tTNXnl','1311247WjHPwZ','98634OyVEuz','some','sort','Unknown','key','5xlNhZV','78014WVnoQq','Fetching\x20schema...','execute','2776644uPHBRx','1BEoAFf','extra','source','replace','\x20\x20\x20\x20','localeCompare','fields','parentTableName','Behaviors','matrixColumnName','length','error','varchar','setJobId','null','parentColumn','cyan','displayName','map','push','data','4823505lDXEau','type'];a196_0x2923=function(){return _0x218845;};return a196_0x2923();}export function displayFieldsHumanReadable(_0x20a273,_0x1d427d){const _0x54eecf=a196_0x3f98,_0x169b4c=_0x20a273[_0x54eecf(0x1ba)](_0x1dbbc4=>_0x1dbbc4[_0x54eecf(0x1a2)]===_0x54eecf(0x1bc)),_0x46acc6=_0x20a273[_0x54eecf(0x1ba)](_0x203e84=>_0x203e84[_0x54eecf(0x1a2)]==='behavior'),_0x4333ea=new Map();for(const _0x4b5afd of _0x169b4c){const _0x212fd1=_0x4b5afd[_0x54eecf(0x192)]||_0x4b5afd[_0x54eecf(0x1a7)]||_0x54eecf(0x199),_0x57386c=_0x4333ea['get'](_0x212fd1);_0x57386c?_0x57386c[_0x54eecf(0x1a6)]['push'](_0x4b5afd):_0x4333ea['set'](_0x212fd1,{'displayName':_0x212fd1,'tableName':_0x4b5afd[_0x54eecf(0x1a7)],'fields':[_0x4b5afd]});}const _0x50dbd1=new Map();for(const _0x24c682 of _0x46acc6){const _0x39a5e7=_0x24c682[_0x54eecf(0x1c0)]||_0x54eecf(0x199),_0x581576=_0x50dbd1['get'](_0x39a5e7)||[];_0x581576[_0x54eecf(0x1b3)](_0x24c682),_0x50dbd1['set'](_0x39a5e7,_0x581576);}console[_0x54eecf(0x1ab)]('\x0a'+a196_0x28a6de[_0x54eecf(0x1b7)](_0x1d427d));if(_0x4333ea['size']>0x0){console[_0x54eecf(0x1ab)]('\x0a'+a196_0x28a6de[_0x54eecf(0x1bd)](_0x54eecf(0x1b9)));const _0x3ac28d=[..._0x4333ea['entries']()][_0x54eecf(0x198)]((_0x301a26,_0x418e42)=>_0x301a26[0x0][_0x54eecf(0x1a5)](_0x418e42[0x0]));for(const [,_0x2e4b51]of _0x3ac28d){const _0x17a974=_0x2e4b51[_0x54eecf(0x1bf)]&&_0x2e4b51[_0x54eecf(0x1bf)]!==_0x2e4b51[_0x54eecf(0x1b1)]?'\x20'+a196_0x28a6de[_0x54eecf(0x1bd)]('('+_0x2e4b51[_0x54eecf(0x1bf)]+')'):'';console[_0x54eecf(0x1ab)]('\x20\x20'+a196_0x28a6de[_0x54eecf(0x1b7)](_0x2e4b51[_0x54eecf(0x1b1)])+_0x17a974);for(const _0x11b7c8 of sortByColumnName(_0x2e4b51[_0x54eecf(0x1a6)])){console[_0x54eecf(0x1ab)](formatFieldLine(columnName(_0x11b7c8),_0x11b7c8[_0x54eecf(0x191)],_0x11b7c8[_0x54eecf(0x1b6)]));}}}if(_0x50dbd1['size']>0x0){console[_0x54eecf(0x1ab)]('\x0a'+a196_0x28a6de[_0x54eecf(0x1bd)](_0x54eecf(0x1a8)));const _0x206d92=[..._0x50dbd1['entries']()]['sort']((_0x2ec63d,_0x431490)=>_0x2ec63d[0x0][_0x54eecf(0x1a5)](_0x431490[0x0]));for(const [_0x54517d,_0x3fd029]of _0x206d92){const _0x31c61a=_0x3fd029[0x0],_0x4eae95=_0x31c61a?.[_0x54eecf(0x1b8)];if(_0x4eae95){const _0x3b3257=_0x4eae95!==_0x54517d?'\x20'+a196_0x28a6de['dim']('('+_0x54517d+')'):'';console[_0x54eecf(0x1ab)]('\x20\x20'+a196_0x28a6de[_0x54eecf(0x1b7)](_0x4eae95)+_0x3b3257);}else{const _0x5f85d7=_0x31c61a?.[_0x54eecf(0x1a7)]||'';console[_0x54eecf(0x1ab)]('\x20\x20'+a196_0x28a6de['bold'](_0x54517d)+(_0x5f85d7?'\x20'+a196_0x28a6de[_0x54eecf(0x1bd)]('('+_0x5f85d7+')'):''));}for(const _0x31de00 of sortByColumnName(_0x3fd029)){const _0x174ee9=_0x31de00[_0x54eecf(0x191)][_0x54eecf(0x1c2)](_0x54517d+'.')?_0x31de00[_0x54eecf(0x191)]['slice'](_0x54517d[_0x54eecf(0x1aa)]+0x1):_0x31de00[_0x54eecf(0x191)];console['error'](formatFieldLine(columnName(_0x31de00),_0x174ee9,_0x31de00['type']));}}}const _0x35eeb4=_0x20a273[_0x54eecf(0x197)](_0x3af282=>_0x3af282[_0x54eecf(0x1a9)]||_0x3af282['matrixTableName']);_0x35eeb4&&(console[_0x54eecf(0x1ab)]('\x0a'+a196_0x28a6de[_0x54eecf(0x1bd)]('Tip:\x20Names\x20shown\x20are\x20column\x20names\x20for\x20segment\x20YAML\x20(attribute/source).')),console[_0x54eecf(0x1ab)](a196_0x28a6de[_0x54eecf(0x1bd)]('\x20\x20\x20\x20\x20Display\x20names\x20in\x20()\x20are\x20for\x20console\x20reference\x20only.'))),console['error']('');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f9436,_0x44ba8d){const _0x43ae55=a197_0x4964,_0x393975=_0x1f9436();while(!![]){try{const _0x402427=-parseInt(_0x43ae55(0x1c5))/0x1*(parseInt(_0x43ae55(0x1c1))/0x2)+parseInt(_0x43ae55(0x1c3))/0x3*(-parseInt(_0x43ae55(0x1be))/0x4)+parseInt(_0x43ae55(0x1b7))/0x5+-parseInt(_0x43ae55(0x1bc))/0x6*(parseInt(_0x43ae55(0x1b9))/0x7)+-parseInt(_0x43ae55(0x1c0))/0x8+-parseInt(_0x43ae55(0x1bd))/0x9*(parseInt(_0x43ae55(0x1b8))/0xa)+parseInt(_0x43ae55(0x1bb))/0xb;if(_0x402427===_0x44ba8d)break;else _0x393975['push'](_0x393975['shift']());}catch(_0xacc211){_0x393975['push'](_0x393975['shift']());}}}(a197_0x2960,0x82318));function a197_0x2960(){const _0x99d02=['19295408bTjkiZ','227298HUkNtu','44721qnpWyg','17184YzZhoo','isDirectory','2172720DwRsvl','4WuPVBA','name','93iVGlvP','relative','230102YWBwqk','.yaml','extname','map','replace','endsWith','toLowerCase','.yml','3614900AyxtOJ','1790mTghMc','35uGgNin','join'];a197_0x2960=function(){return _0x99d02;};return a197_0x2960();}import{readdirSync,statSync}from'fs';function a197_0x4964(_0x58dae4,_0x238f99){_0x58dae4=_0x58dae4-0x1b2;const _0x2960fa=a197_0x2960();let _0x49646d=_0x2960fa[_0x58dae4];return _0x49646d;}import a197_0x24134e from'path';export function findYamlFiles(_0x38093a){const _0xfd6a5a=[];function _0x2314f0(_0x41f69d){const _0x3ef351=a197_0x4964,_0x3d4718=readdirSync(_0x41f69d,{'withFileTypes':!![]});for(const _0x2b1e27 of _0x3d4718){const _0x8bd3b5=a197_0x24134e[_0x3ef351(0x1ba)](_0x41f69d,_0x2b1e27['name']);if(_0x2b1e27[_0x3ef351(0x1bf)]())_0x2314f0(_0x8bd3b5);else(_0x2b1e27[_0x3ef351(0x1c2)][_0x3ef351(0x1b4)](_0x3ef351(0x1b6))||_0x2b1e27[_0x3ef351(0x1c2)][_0x3ef351(0x1b4)]('.yaml'))&&_0xfd6a5a['push'](_0x8bd3b5);}}return _0x2314f0(_0x38093a),_0xfd6a5a;}export function discoverYamlFiles(_0x2b73af){const _0x4c1c32=a197_0x4964,_0x30a3d6=findYamlFiles(_0x2b73af);return _0x30a3d6[_0x4c1c32(0x1b2)](_0x22169c=>{const _0x313b58=_0x4c1c32,_0x5921c4=a197_0x24134e[_0x313b58(0x1c4)](_0x2b73af,_0x22169c),_0xcb73c5=a197_0x24134e['dirname'](_0x5921c4);return{'absolutePath':_0x22169c,'relativePath':_0x5921c4,'folderPath':_0xcb73c5==='.'?'':_0xcb73c5[_0x313b58(0x1b3)](/\\/g,'/')};});}export function isYamlFile(_0x8de12d){const _0x5ec2b0=a197_0x4964;try{const _0x12a4a8=statSync(_0x8de12d);if(!_0x12a4a8['isFile']())return![];const _0x4b035b=a197_0x24134e[_0x5ec2b0(0x1c7)](_0x8de12d)[_0x5ec2b0(0x1b5)]();return _0x4b035b===_0x5ec2b0(0x1b6)||_0x4b035b===_0x5ec2b0(0x1c6);}catch{return![];}}
|