@treasuredata/tdx 2026.4.18 → 2026.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts +38 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts +1 -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/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-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +1 -0
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.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.d.ts +26 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.d.ts +1 -1
- package/dist/sdk/client/http-client.d.ts.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/http-client.js.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +7 -0
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.d.ts +2 -2
- package/dist/sdk/engage/types/campaign-def.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +256 -8
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +28 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +125 -1
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +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/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +14 -1
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +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.d.ts +65 -0
- package/dist/sdk/workflow/task-graph.d.ts.map +1 -0
- package/dist/sdk/workflow/task-graph.js +1 -0
- package/dist/sdk/workflow/task-graph.js.map +1 -0
- 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/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x10c381=a31_0xc607;(function(_0x1fd1d9,_0x1ffd67){const _0x51c9ee=a31_0xc607,_0xdcfa11=_0x1fd1d9();while(!![]){try{const _0x20b4d0=parseInt(_0x51c9ee(0x120))/0x1*(-parseInt(_0x51c9ee(0x110))/0x2)+-parseInt(_0x51c9ee(0x26e))/0x3*(-parseInt(_0x51c9ee(0x8e))/0x4)+-parseInt(_0x51c9ee(0x7d))/0x5*(parseInt(_0x51c9ee(0x207))/0x6)+parseInt(_0x51c9ee(0x12d))/0x7*(-parseInt(_0x51c9ee(0x1c9))/0x8)+-parseInt(_0x51c9ee(0x25a))/0x9*(parseInt(_0x51c9ee(0x1b1))/0xa)+-parseInt(_0x51c9ee(0x1ea))/0xb+parseInt(_0x51c9ee(0x25f))/0xc;if(_0x20b4d0===_0x1ffd67)break;else _0xdcfa11['push'](_0xdcfa11['shift']());}catch(_0x115682){_0xdcfa11['push'](_0xdcfa11['shift']());}}}(a31_0x1457,0x52aaf));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x1ac1cb from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x343d08 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x10c381(0x17c),LEGACY_PARENT_SEGMENT_DIR=a31_0x10c381(0x27d);function openBrowser(_0x89c7b0){const _0x5a5e7b=a31_0x10c381,_0x59e79b=process[_0x5a5e7b(0xd8)],_0x5e9bb3=_0x59e79b===_0x5a5e7b(0x18c)?'open':_0x59e79b===_0x5a5e7b(0x249)?'start':_0x5a5e7b(0xb4);spawn(_0x5e9bb3,[_0x89c7b0],{'detached':!![],'stdio':'ignore'})[_0x5a5e7b(0x256)]();}function migrateLegacyDirectory(){const _0xcaade6=a31_0x10c381;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3c2c03=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3c2c03[_0xcaade6(0x132)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x185)](_0xcaade6(0x142)+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x1a5)+PARENT_SEGMENT_DIR+_0xcaade6(0x222))),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x1a7)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0xbf))),![];console['error'](a31_0x343d08[_0xcaade6(0x185)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xcaade6(0x19f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xcaade6(0xdd)](a31_0x343d08[_0xcaade6(0x97)]('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x421e28){const _0x59c778=_0x421e28 instanceof Error?_0x421e28[_0xcaade6(0x14e)]:String(_0x421e28);return console['error'](a31_0x343d08['red'](_0xcaade6(0x23e)+_0x59c778+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x10c381(0xb3)](_0x31a99c){const _0x187c15=a31_0x10c381;return migrateLegacyDirectory(),super[_0x187c15(0xb3)](_0x31a99c);}}function resolveYamlFile(_0x474569){const _0x53ef7e=a31_0x10c381;if(_0x474569[_0x53ef7e(0x1fa)](_0x53ef7e(0x1d1))||_0x474569['endsWith']('.yaml'))return _0x474569;return a31_0x1ac1cb[_0x53ef7e(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x474569)+_0x53ef7e(0x1d1));}function formatProgressMessage(_0x3fb98b){const _0x50c57b=a31_0x10c381,_0x2c5e7b=_0x3fb98b[_0x50c57b(0x21d)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2c5e7b){const [,_0x3ee29e,_0x2818e2,_0x3ad993='']=_0x2c5e7b;return a31_0x343d08[_0x50c57b(0x1a7)](_0x3ee29e+':')+'\x20'+_0x2818e2+a31_0x343d08[_0x50c57b(0x1a7)](_0x3ad993);}return a31_0x343d08['dim'](_0x3fb98b);}function showFileNotFoundError(_0x3c8c5a,_0x1023bb){const _0xb4bb17=a31_0x10c381;console['error'](a31_0x343d08[_0xb4bb17(0x11b)]('Error:\x20File\x20not\x20found:\x20'+_0x3c8c5a+'\x0a')),console[_0xb4bb17(0xdd)](a31_0x343d08[_0xb4bb17(0x12a)](_0xb4bb17(0x96)+_0x1023bb+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x54e068){const _0x36fd51=a31_0x10c381;if(!_0x54e068[_0x36fd51(0x193)])return;const _0x2b2d53=_0x54e068[_0x36fd51(0x193)],_0x19acbe=_0x2b2d53[_0x36fd51(0x191)]?a31_0x343d08[_0x36fd51(0x97)]('⚡\x20Enabled'):a31_0x343d08[_0x36fd51(0x185)](_0x36fd51(0xbc));console['error']('\x0a'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x261))+'\x20'+_0x19acbe);if(_0x2b2d53[_0x36fd51(0xdc)]&&_0x2b2d53[_0x36fd51(0xdc)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)]('Events:')+'\x20'+_0x2b2d53[_0x36fd51(0xdc)]['length']+_0x36fd51(0x135));for(const _0x85cacc of _0x2b2d53['events']){const _0x51a017=_0x85cacc[_0x36fd51(0x1f1)]===![]?a31_0x343d08[_0x36fd51(0x11b)]('✘'):a31_0x343d08[_0x36fd51(0x97)]('✔');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x51a017+'\x20'+_0x85cacc[_0x36fd51(0x23b)]),_0x85cacc[_0x36fd51(0x1dd)]&&console['error'](_0x36fd51(0x235)+a31_0x343d08[_0x36fd51(0x11b)](_0x85cacc['sourceTableError']));}}if(_0x2b2d53[_0x36fd51(0x166)]&&_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x170))+'\x20'+_0x2b2d53[_0x36fd51(0x166)][_0x36fd51(0x190)]+_0x36fd51(0x135));for(const _0x2108bb of _0x2b2d53[_0x36fd51(0x166)]){const _0x3c90cd=_0x2108bb['valid']?a31_0x343d08[_0x36fd51(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x36fd51(0xdd)](_0x36fd51(0x263)+_0x3c90cd+'\x20'+_0x2108bb[_0x36fd51(0x23b)]+'\x20'+a31_0x343d08['dim']('('+_0x2108bb[_0x36fd51(0x83)]+')'));}}if(_0x2b2d53['idStitching']){const _0x380698=_0x2b2d53[_0x36fd51(0x155)][_0x36fd51(0xb5)]?.[_0x36fd51(0x190)]?'\x20+\x20['+_0x2b2d53['idStitching'][_0x36fd51(0xb5)][_0x36fd51(0xa1)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0x23a))+'\x20'+_0x2b2d53[_0x36fd51(0x155)]['primaryKey']+_0x380698);}if(_0x2b2d53[_0x36fd51(0x101)]&&_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]>0x0){console[_0x36fd51(0xdd)]('\x20\x20'+a31_0x343d08[_0x36fd51(0x1a7)](_0x36fd51(0xac))+'\x20'+_0x2b2d53['personalizationServices']['length']+_0x36fd51(0x18a)+(_0x2b2d53['personalizationServices'][_0x36fd51(0x190)]!==0x1?'s':''));for(const _0x462e28 of _0x2b2d53[_0x36fd51(0x101)]){console[_0x36fd51(0xdd)](_0x36fd51(0x1ab)+_0x462e28[_0x36fd51(0x23b)]);}}}function showParentSegmentNotSetError(_0x471b57){const _0x3a53c0=a31_0x10c381;console[_0x3a53c0(0xdd)](a31_0x343d08[_0x3a53c0(0x185)](_0x3a53c0(0x241))),console[_0x3a53c0(0xdd)](_0x471b57);}export class ParentSegmentListCommand extends BaseCommand{['name']='segment:parent:list';['description']='List\x20parent\x20segments';async[a31_0x10c381(0xa0)](_0x3098bc){const _0x4fee57=a31_0x10c381,{options:_0x298992,args:_0x19eaf8,tdx:_0x3066c2}=_0x3098bc,_0x1e51b2=_0x19eaf8[0x0];_0x298992[_0x4fee57(0x20b)]&&(console[_0x4fee57(0xdd)](_0x4fee57(0x25d)+_0x298992[_0x4fee57(0x201)]),_0x1e51b2&&console[_0x4fee57(0xdd)](_0x4fee57(0x220)+_0x1e51b2));const _0x60d6da=await withSpinner(_0x1e51b2?_0x4fee57(0x13c)+_0x1e51b2+_0x4fee57(0x169):_0x4fee57(0x250),()=>_0x3066c2['segment'][_0x4fee57(0x1c7)](),{'verbose':_0x298992[_0x4fee57(0x20b)]});let _0x42c91a=_0x60d6da[_0x4fee57(0x8b)];if(_0x1e51b2){const _0x21f67c=_0x1e51b2[_0x4fee57(0x15f)](/[.+^${}()|[\]\\]/g,_0x4fee57(0x1f3))['replace'](/\*/g,'.*')[_0x4fee57(0x15f)](/\?/g,'.'),_0xcb71d9=new RegExp('^'+_0x21f67c+'$','i');_0x42c91a=_0x42c91a[_0x4fee57(0xe0)](_0xc7704d=>_0xcb71d9['test'](_0xc7704d[_0x4fee57(0x166)]['name']));}_0x42c91a['sort']((_0x3f5cc9,_0x2c6157)=>_0x3f5cc9['attributes'][_0x4fee57(0x23b)][_0x4fee57(0x19e)](_0x2c6157[_0x4fee57(0x166)][_0x4fee57(0x23b)])),console[_0x4fee57(0xdd)](_0x4fee57(0x227)+_0x42c91a[_0x4fee57(0x190)]+_0x4fee57(0xca)+(_0x42c91a[_0x4fee57(0x190)]!==0x1?'s':''));const _0xabf71b=_0x3831f5=>{const _0x4f3d85=_0x4fee57;return getConsoleNextUrl(_0x298992[_0x4f3d85(0x201)],'/app/dw/parentSegments/'+_0x3831f5);};if(_0x298992['format']===_0x4fee57(0x22f)||_0x298992[_0x4fee57(0x6f)]===_0x4fee57(0xd1)){const _0x42622d=_0x42c91a[_0x4fee57(0xe9)](_0x54430f=>({..._0x54430f,'url':_0xabf71b(_0x54430f['id'])}));await handleSDKOutput(_0x42622d,_0x298992);}else{if(_0x42c91a[_0x4fee57(0x190)]===0x0)_0x1e51b2?console[_0x4fee57(0x1db)](_0x4fee57(0x17a)+_0x1e51b2):console[_0x4fee57(0x1db)](_0x4fee57(0x1d5));else for(const _0x128efa of _0x42c91a){const _0x45ac87=_0x128efa['attributes'][_0x4fee57(0x19b)]?a31_0x343d08[_0x4fee57(0x1a7)]('\x20('+formatRows(_0x128efa['attributes'][_0x4fee57(0x19b)])+')'):'',_0x31536e=hyperlink(_0x128efa[_0x4fee57(0x166)]['name'],_0xabf71b(_0x128efa['id']));console['log'](_0x4fee57(0xea)+_0x31536e+_0x45ac87);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x72);[a31_0x10c381(0x184)]=a31_0x10c381(0x15c);async[a31_0x10c381(0xa0)](_0x30d66b){const _0x45ef3d=a31_0x10c381,{options:_0x47dcb2,args:_0x53ffcd,tdx:_0x5d241e}=_0x30d66b;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x45ef3d(0x22d)+_0x45ef3d(0x211));const _0x56a0f8=_0x47dcb2;if(_0x53ffcd[_0x45ef3d(0x190)]===0x0)return console[_0x45ef3d(0xdd)](a31_0x343d08[_0x45ef3d(0x11b)](_0x45ef3d(0x99))),console['error']('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x2a94b3=_0x53ffcd[0x0];if(!_0x56a0f8[_0x45ef3d(0x127)]||!_0x56a0f8['table'])return console[_0x45ef3d(0xdd)](_0x45ef3d(0xfb)),console[_0x45ef3d(0xdd)](_0x45ef3d(0xf4)),0x1;_0x56a0f8[_0x45ef3d(0x20b)]&&(console['error'](_0x45ef3d(0x25d)+_0x56a0f8[_0x45ef3d(0x201)]),console['error']('Name:\x20'+_0x2a94b3),console[_0x45ef3d(0xdd)](_0x45ef3d(0x9b)+_0x56a0f8[_0x45ef3d(0x127)]),console[_0x45ef3d(0xdd)](_0x45ef3d(0x11d)+_0x56a0f8[_0x45ef3d(0x27e)]));const _0x39917c=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x166)],_0x56a0f8[_0x45ef3d(0x71)]),_0x581764=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x70)],_0x56a0f8['behaviorsFile']),_0x53e0ca=await loadJSONFromOptions(_0x56a0f8[_0x45ef3d(0x102)],_0x56a0f8['customerGroupFile']),_0x21125d={'name':_0x2a94b3,'description':_0x56a0f8['description'],'scheduleType':_0x56a0f8[_0x45ef3d(0x177)],'scheduleOption':_0x56a0f8[_0x45ef3d(0x27b)],'timezone':_0x56a0f8[_0x45ef3d(0x214)],'master':{'parentDatabaseName':_0x56a0f8['database'],'parentTableName':_0x56a0f8[_0x45ef3d(0x27e)]},'attributes':_0x39917c,'behaviors':_0x581764,'customerGroup':_0x53e0ca},_0x125ae7=await withSpinner(_0x45ef3d(0x86)+_0x2a94b3+_0x45ef3d(0x169),()=>_0x5d241e[_0x45ef3d(0x209)][_0x45ef3d(0x73)](_0x21125d),{'verbose':_0x47dcb2[_0x45ef3d(0x20b)]}),_0x36ee59=_0x125ae7[_0x45ef3d(0x8b)];return console[_0x45ef3d(0xdd)](_0x45ef3d(0x194)+_0x36ee59['name']+_0x45ef3d(0x274)+_0x36ee59['id']),await handleSDKOutput([_0x36ee59],_0x47dcb2),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x218);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x43aaf4){const _0x6bf07=a31_0x10c381,{options:_0x22ddfb,args:_0x46f3f3,tdx:_0x815c9}=_0x43aaf4;console[_0x6bf07(0xdd)](_0x6bf07(0x7f)+_0x6bf07(0x22d)+_0x6bf07(0x211));const _0x5cd3e5=_0x22ddfb;if(_0x46f3f3[_0x6bf07(0x190)]===0x0)return console['error'](a31_0x343d08[_0x6bf07(0x11b)](_0x6bf07(0x99))),console['error'](_0x6bf07(0x225)),0x1;const _0x314baf=_0x46f3f3[0x0];_0x5cd3e5[_0x6bf07(0x20b)]&&(console['error']('Site:\x20'+_0x5cd3e5['site']),console[_0x6bf07(0xdd)](_0x6bf07(0x224)+_0x314baf));const _0x5c1d31=await withSpinner(_0x6bf07(0x240)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['getParentFull'](_0x314baf),{'verbose':_0x5cd3e5['verbose']}),_0x2dba1f=_0x5c1d31['data'],_0x93ebbb=await loadJSONFromOptions(_0x5cd3e5['addAttributes'],_0x5cd3e5[_0x6bf07(0x180)]),_0x3b0f25=await loadJSONFromOptions(_0x5cd3e5['addBehaviors'],_0x5cd3e5[_0x6bf07(0x131)]),_0x590d80={'name':_0x2dba1f[_0x6bf07(0x23b)],'description':_0x5cd3e5[_0x6bf07(0x184)]!==undefined?_0x5cd3e5[_0x6bf07(0x184)]:_0x2dba1f[_0x6bf07(0x184)],'scheduleType':_0x5cd3e5[_0x6bf07(0x177)]!==undefined?_0x5cd3e5[_0x6bf07(0x177)]:_0x2dba1f[_0x6bf07(0x177)],'scheduleOption':_0x5cd3e5[_0x6bf07(0x27b)]!==undefined?_0x5cd3e5['scheduleOption']:_0x2dba1f[_0x6bf07(0x27b)],'timezone':_0x5cd3e5[_0x6bf07(0x214)]!==undefined?_0x5cd3e5[_0x6bf07(0x214)]:_0x2dba1f['timezone'],'master':_0x2dba1f['master'],'attributes':_0x93ebbb?[..._0x2dba1f['attributes']||[],..._0x93ebbb]:_0x2dba1f[_0x6bf07(0x166)],'behaviors':_0x3b0f25?[..._0x2dba1f[_0x6bf07(0x70)]||[],..._0x3b0f25]:_0x2dba1f[_0x6bf07(0x70)],'customerGroup':_0x2dba1f[_0x6bf07(0x102)]},_0x1458b6=await withSpinner(_0x6bf07(0x1ec)+_0x314baf+_0x6bf07(0x169),()=>_0x815c9[_0x6bf07(0x209)]['updateParent'](_0x314baf,_0x590d80),{'verbose':_0x5cd3e5[_0x6bf07(0x20b)]}),_0x3d14f5=_0x1458b6['data'];return console[_0x6bf07(0xdd)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x3d14f5[_0x6bf07(0x23b)]+'\x27'),await handleSDKOutput([_0x3d14f5],_0x5cd3e5),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';[a31_0x10c381(0x184)]=a31_0x10c381(0x178);async[a31_0x10c381(0xa0)](_0x5914c6){const _0x5e1418=a31_0x10c381,{options:_0x2a7f89,args:_0x16d040,tdx:_0x3e98ed}=_0x5914c6,_0x3841aa=_0x2a7f89,_0xd3e6f0=_0x16d040[0x0]||_0x2a7f89[_0x5e1418(0x113)];if(!_0xd3e6f0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a'+_0x5e1418(0x104)),0x1;if(_0x3841aa['use']&&_0x3841aa[_0x5e1418(0x1f5)])return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0x24d))),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x95)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x5e1418(0xdd)](a31_0x343d08['cyan'](_0x5e1418(0x277))),0x1;const _0x2168c=_0x3841aa[_0x5e1418(0x1f5)]||a31_0x1ac1cb[_0x5e1418(0xa1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0xd3e6f0)+'.yml');_0x3841aa[_0x5e1418(0x20b)]&&(console[_0x5e1418(0xdd)](_0x5e1418(0x25d)+_0x3841aa[_0x5e1418(0x201)]),console[_0x5e1418(0xdd)](_0x5e1418(0x224)+_0xd3e6f0),console[_0x5e1418(0xdd)](_0x5e1418(0x1bc)+_0x2168c));const _0x501d2c=await withSpinner(_0x5e1418(0xa9)+_0xd3e6f0+_0x5e1418(0x169),()=>_0x3e98ed[_0x5e1418(0x209)][_0x5e1418(0x159)](_0xd3e6f0),{'verbose':_0x3841aa[_0x5e1418(0x20b)]}),_0x316e1d=_0x501d2c[_0x5e1418(0x8b)];if(existsSync(_0x2168c)){const _0x53711b=readFileSync(_0x2168c,_0x5e1418(0x20f)),_0x1787d5=generateDiff(_0x53711b,_0x316e1d);if(!hasChanges(_0x1787d5))console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x90)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x5e1418(0x1b2)+_0x2168c+'\x27:'),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c)),console[_0x5e1418(0xdd)](formatDiffWithColors(_0x1787d5)),console[_0x5e1418(0xdd)]('─'[_0x5e1418(0x1c1)](0x3c));if(!_0x3841aa[_0x5e1418(0x130)]){if(!isInteractive())return console['error'](a31_0x343d08[_0x5e1418(0x11b)](_0x5e1418(0xfd)),_0x5e1418(0x1b0)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x1a7)](_0x5e1418(0x182))),0x1;const _0x110ecf=await confirmKey('Overwrite\x20\x27'+_0x2168c+'\x27?');if(!_0x110ecf)return console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x185)](_0x5e1418(0x1ae))),0x1;}writeFileSync(_0x2168c,_0x316e1d,'utf-8'),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0x14c)+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}}else{const _0x5b8b1e=a31_0x1ac1cb['dirname'](_0x2168c);!existsSync(_0x5b8b1e)&&mkdirSync(_0x5b8b1e,{'recursive':!![]}),writeFileSync(_0x2168c,_0x316e1d,_0x5e1418(0x20f)),console[_0x5e1418(0xdd)](a31_0x343d08[_0x5e1418(0x97)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0x2168c));}return saveSessionContext({'parent_segment':_0xd3e6f0},_0x3841aa['session']),console['error'](a31_0x343d08[_0x5e1418(0x97)]('✔')+_0x5e1418(0xed)+a31_0x343d08['dim'](_0x5e1418(0x27d))+'\x20=\x20'+a31_0x343d08[_0x5e1418(0x12a)](_0xd3e6f0)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='segment:parent:push';[a31_0x10c381(0x184)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x171a9d){const _0x43569e=a31_0x10c381,{options:_0x282466,args:_0x1d0c17,tdx:_0x2da1ce}=_0x171a9d,_0x54c023=_0x282466,_0xf3e4b8=_0x1d0c17[0x0]||_0x282466[_0x43569e(0x113)];if(!_0xf3e4b8)return showParentSegmentNotSetError(_0x43569e(0x6c)+_0x43569e(0x245)),0x1;const _0x94f6bc=resolveYamlFile(_0xf3e4b8);if(!existsSync(_0x94f6bc))return showFileNotFoundError(_0x94f6bc,_0xf3e4b8),0x1;_0x54c023[_0x43569e(0x20b)]&&(console['error'](_0x43569e(0x25d)+_0x54c023[_0x43569e(0x201)]),console['error']('YAML\x20file:\x20'+_0x94f6bc));let _0x4fb0c1;try{_0x4fb0c1=readFileSync(_0x94f6bc,_0x43569e(0x20f));}catch(_0x46032b){const _0x5deaca=_0x46032b instanceof Error?_0x46032b['message']:String(_0x46032b);return console[_0x43569e(0xdd)](_0x43569e(0x1cf)+_0x5deaca),0x1;}const _0x4ec2f8=await withSpinner(_0x43569e(0x1ff),()=>_0x2da1ce[_0x43569e(0x209)][_0x43569e(0xce)](_0x4fb0c1),{'verbose':_0x54c023['verbose']}),_0x4dd4ba=_0x4ec2f8['data'],{isNew:_0x4fa72,name:_0x3532f8,hasChanges:_0x5c524f,diffFormatted:_0x118c43}=_0x4dd4ba;if(!_0x5c524f)return console['error'](_0x43569e(0x1e6)+_0x3532f8+_0x43569e(0x1ce)),0x0;_0x4fa72?console[_0x43569e(0xdd)](_0x43569e(0xcb)+_0x3532f8+'\x27:'):console['error'](_0x43569e(0xfa)+_0x3532f8+'\x27:');console[_0x43569e(0xdd)]('─'[_0x43569e(0x1c1)](0x3c)),console[_0x43569e(0xdd)](_0x118c43),console['error']('─'['repeat'](0x3c));const _0x3ed510=_0x4fa72?_0x43569e(0x136)+_0x3532f8+'\x27?':_0x43569e(0xb7)+_0x3532f8+'\x27?';if(!_0x54c023['yes']){if(!isInteractive())return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x11b)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x43569e(0xdd)](a31_0x343d08['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4c3828=await confirmKey(_0x3ed510);if(!_0x4c3828)return console[_0x43569e(0xdd)](a31_0x343d08[_0x43569e(0x185)](_0x43569e(0x1ae))),0x1;}const _0x28d0c0=_0x4fa72?_0x43569e(0x147):_0x43569e(0x1a4),_0x52241c=await withSpinner(_0x28d0c0+_0x43569e(0x199)+_0x3532f8+'\x27...',()=>_0x4dd4ba[_0x43569e(0x9a)](),{'verbose':_0x54c023[_0x43569e(0x20b)]}),_0x552605=_0x52241c['data'],_0x1e14b9=getConsoleNextUrl(_0x54c023[_0x43569e(0x201)],_0x43569e(0x13d)+_0x552605['id']),_0x34ebeb=_0x4fa72?_0x43569e(0x21e):_0x43569e(0xcd);return console[_0x43569e(0xdd)]('✔\x20'+_0x34ebeb+_0x43569e(0x199)+_0x552605[_0x43569e(0x23b)]+'\x27'),console['error']('\x20\x20'+_0x1e14b9),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xd4);[a31_0x10c381(0x184)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a31_0x10c381(0xa0)](_0x135961){const _0xd78c2f=a31_0x10c381,{options:_0x38c0e8,args:_0x3c66fa,tdx:_0x1df442}=_0x135961,_0x53086f=_0x38c0e8,_0x237b8c=_0x3c66fa[0x0]||_0x38c0e8[_0xd78c2f(0x113)];if(!_0x237b8c)return showParentSegmentNotSetError(_0xd78c2f(0xef)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0xd78c2f(0x1a2)+_0xd78c2f(0x1b6)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0xd78c2f(0xd9)),0x1;const _0x1ce1d9=resolveYamlFile(_0x237b8c);if(!existsSync(_0x1ce1d9))return showFileNotFoundError(_0x1ce1d9,_0x237b8c),0x1;_0x53086f[_0xd78c2f(0x20b)]&&(console[_0xd78c2f(0xdd)](_0xd78c2f(0x25d)+_0x53086f[_0xd78c2f(0x201)]),console[_0xd78c2f(0xdd)]('YAML\x20file:\x20'+_0x1ce1d9));let _0x258ce7;try{_0x258ce7=readFileSync(_0x1ce1d9,_0xd78c2f(0x20f));}catch(_0x304227){const _0x173b17=_0x304227 instanceof Error?_0x304227[_0xd78c2f(0x14e)]:String(_0x304227);return console[_0xd78c2f(0xdd)](_0xd78c2f(0x1cf)+_0x173b17),0x1;}const _0x573b64=createCommandSpinner(a31_0x343d08[_0xd78c2f(0x1a7)](_0xd78c2f(0x216)),{'verbose':_0x53086f[_0xd78c2f(0x20b)]});_0x573b64[_0xd78c2f(0x134)]();const _0x32e9e3={'onProgress':_0x61ba4f=>{_0x573b64['text']=formatProgressMessage(_0x61ba4f);}};if(_0x53086f[_0xd78c2f(0x77)])_0x32e9e3[_0xd78c2f(0x77)]=!![];if(_0x53086f[_0xd78c2f(0x27f)])_0x32e9e3[_0xd78c2f(0x27f)]=!![];_0x53086f[_0xd78c2f(0xf8)]&&(_0x32e9e3[_0xd78c2f(0xf8)]=_0x53086f[_0xd78c2f(0xf8)]);_0x53086f['behavior']&&(_0x32e9e3[_0xd78c2f(0x239)]=_0x53086f[_0xd78c2f(0x239)]);if(_0x53086f['interval'])_0x32e9e3['interval']=_0x53086f[_0xd78c2f(0x1f4)];let _0x2cb6e8;try{_0x2cb6e8=await _0x1df442[_0xd78c2f(0x209)][_0xd78c2f(0x13e)](_0x258ce7,_0x32e9e3),_0x573b64[_0xd78c2f(0xf6)]();}catch(_0x47ae22){_0x573b64['stop']();throw _0x47ae22;}const _0x3907d4=_0x53086f[_0xd78c2f(0x1f4)]||_0xd78c2f(0x206);return this[_0xd78c2f(0xf5)](_0x2cb6e8,_0x32e9e3,_0x1ce1d9,_0x3907d4),_0x2cb6e8[_0xd78c2f(0x202)]?0x0:0x1;}[a31_0x10c381(0xf5)](_0x57cabf,_0xa75c38,_0x15cac8,_0x12fd59){const _0x2ee003=a31_0x10c381;console['error']('\x0a'+a31_0x343d08['bold'](_0x2ee003(0x115))+'\x20'+_0x57cabf[_0x2ee003(0x23b)]),console[_0x2ee003(0xdd)]('═'[_0x2ee003(0x1c1)](0x3c)),this[_0x2ee003(0x1c5)](_0x57cabf);if(typeof _0xa75c38[_0x2ee003(0xf8)]===_0x2ee003(0x6d)){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,_0x2ee003(0xf8),_0xa75c38[_0x2ee003(0xf8)]);return;}if(_0xa75c38[_0x2ee003(0xf8)]===!![]){this[_0x2ee003(0x213)](_0x57cabf),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'attributes');return;}if(typeof _0xa75c38[_0x2ee003(0x239)]===_0x2ee003(0x6d)){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this['displayPreviewHints'](_0x15cac8,_0x12fd59,'behavior',_0xa75c38[_0x2ee003(0x239)]);return;}if(_0xa75c38[_0x2ee003(0x239)]===!![]){this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this['displaySummary'](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,'behaviors');return;}this[_0x2ee003(0x213)](_0x57cabf),this[_0x2ee003(0x1eb)](_0x57cabf,_0x12fd59),this[_0x2ee003(0x187)](_0x57cabf),this[_0x2ee003(0xc8)](_0x57cabf),this[_0x2ee003(0x16c)](_0x15cac8,_0x12fd59,_0x2ee003(0x1e8));}[a31_0x10c381(0x187)](_0xef9990){displayRealtimeValidation(_0xef9990);}[a31_0x10c381(0x16c)](_0xc115bf,_0x4ccd89,_0x255708,_0x3b533d){const _0x270f54=a31_0x10c381;console[_0x270f54(0xdd)]('\x0a'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x1f6)));const _0x3f5906=_0x4ccd89!==_0x270f54(0x206)?_0x270f54(0x8c)+_0x4ccd89:'';if(_0x255708==='attribute'&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x26b)+_0x3b533d+'\x22'+_0x3f5906));else{if(_0x255708===_0x270f54(0x239)&&_0x3b533d)console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x13b)+_0x3b533d+'\x22'+_0x3f5906));else(_0x255708==='attributes'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--attribute\x20\x22<name>\x22'+_0x3f5906));}(_0x255708==='behaviors'||_0x255708===_0x270f54(0x1e8))&&console[_0x270f54(0xdd)]('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)](_0x270f54(0x279)+_0xc115bf+_0x270f54(0x22e)+_0x3f5906)),_0x255708===_0x270f54(0x1e8)&&console['error']('\x20\x20'+a31_0x343d08[_0x270f54(0x1a7)]('tdx\x20ps\x20preview\x20'+_0xc115bf+'\x20--enriched'+_0x3f5906));}[a31_0x10c381(0x1c5)](_0x19c790){const _0x256ce5=a31_0x10c381,{master:_0x44faa4}=_0x19c790,_0x28de44=_0x44faa4[_0x256ce5(0x121)]?a31_0x343d08[_0x256ce5(0x97)]('✔'):a31_0x343d08['red']('✘');console[_0x256ce5(0xdd)]('\x0a'+a31_0x343d08['dim'](_0x256ce5(0x108))),console[_0x256ce5(0xdd)](_0x28de44+'\x20'+a31_0x343d08[_0x256ce5(0x10a)](_0x44faa4[_0x256ce5(0x127)]+'.'+_0x44faa4[_0x256ce5(0x27e)])),_0x44faa4[_0x256ce5(0x121)]?_0x44faa4[_0x256ce5(0x139)]!==undefined&&console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x1a7)](_0x256ce5(0x16f))+'\x20'+a31_0x343d08[_0x256ce5(0x12a)](formatRows(_0x44faa4[_0x256ce5(0x139)]))):console[_0x256ce5(0xdd)]('\x20\x20'+a31_0x343d08[_0x256ce5(0x11b)](_0x256ce5(0xaa))+'\x20'+_0x44faa4[_0x256ce5(0x80)]);}['displayAttributesStats'](_0x31044a){const _0x5337eb=a31_0x10c381;if(_0x31044a[_0x5337eb(0x166)]['length']===0x0)return;console[_0x5337eb(0xdd)]('\x0a'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x12b)));for(const _0x3fb821 of _0x31044a[_0x5337eb(0x166)]){const _0x37062b=_0x3fb821[_0x5337eb(0x121)]?a31_0x343d08[_0x5337eb(0x97)]('✔'):a31_0x343d08[_0x5337eb(0x11b)]('✘');let _0x1986a2='';if(_0x3fb821['schemaValid']&&_0x3fb821[_0x5337eb(0x111)]!==undefined&&_0x3fb821[_0x5337eb(0x14f)]!==undefined){const _0x42ba99=_0x3fb821[_0x5337eb(0x14f)][_0x5337eb(0x1de)](0x1),_0x591dbd=_0x3fb821[_0x5337eb(0x14f)]>=0x50?a31_0x343d08[_0x5337eb(0x97)]:_0x3fb821['coveragePercent']>=0x32?a31_0x343d08[_0x5337eb(0x185)]:a31_0x343d08[_0x5337eb(0x11b)];_0x1986a2='\x20'+a31_0x343d08[_0x5337eb(0x1a7)]('Coverage:')+'\x20'+_0x591dbd(_0x42ba99+'%')+'\x20('+formatRows(_0x3fb821['matchedCount'])+_0x5337eb(0x78);}console[_0x5337eb(0xdd)](_0x37062b+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x23b)])+_0x1986a2),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xa3))+'\x20'+a31_0x343d08[_0x5337eb(0x10a)](_0x3fb821[_0x5337eb(0x127)]+'.'+_0x3fb821[_0x5337eb(0x27e)]));const _0x3cdd2f=_0x3fb821[_0x5337eb(0x14d)]===_0x3fb821[_0x5337eb(0x20a)]?a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0x22c))+'\x20'+_0x3fb821[_0x5337eb(0x14d)]:a31_0x343d08[_0x5337eb(0x1a7)]('Join:')+'\x20'+_0x3fb821[_0x5337eb(0x14d)]+_0x5337eb(0x212)+_0x3fb821[_0x5337eb(0x20a)];console['error']('\x20\x20'+_0x3cdd2f),console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08[_0x5337eb(0x1a7)](_0x5337eb(0xd5))),this[_0x5337eb(0x114)](_0x3fb821[_0x5337eb(0x1e1)]),!_0x3fb821[_0x5337eb(0x121)]&&console[_0x5337eb(0xdd)]('\x20\x20'+a31_0x343d08['red']('Error:')+'\x20'+_0x3fb821[_0x5337eb(0x80)]);}}[a31_0x10c381(0x1eb)](_0x41b017,_0x39bfd0){const _0x7fa835=a31_0x10c381;if(_0x41b017[_0x7fa835(0x70)][_0x7fa835(0x190)]===0x0)return;console['error']('\x0a'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xa5))+'\x20'+a31_0x343d08['dim']('('+_0x39bfd0+')'));for(const _0x16facd of _0x41b017[_0x7fa835(0x70)]){const _0x1038b1=_0x16facd[_0x7fa835(0x121)]?a31_0x343d08['green']('✔'):a31_0x343d08['red']('✘');let _0x6af501='';if(_0x16facd[_0x7fa835(0x121)]&&_0x16facd['customersWithEvents']!==undefined&&_0x16facd[_0x7fa835(0x6a)]!==undefined){const _0x1b6bc7=_0x16facd['customerPercent']?.[_0x7fa835(0x1de)](0x1)||'?',_0x273fe0=(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x32?a31_0x343d08['green']:(_0x16facd[_0x7fa835(0x174)]??0x0)>=0x14?a31_0x343d08['yellow']:a31_0x343d08[_0x7fa835(0x11b)];_0x6af501='\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xe3))+'\x20'+_0x273fe0(formatRows(_0x16facd[_0x7fa835(0x266)]))+'\x20('+_0x1b6bc7+'%)\x20'+a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x160))+'\x20'+a31_0x343d08['cyan'](formatRows(_0x16facd['totalEvents']));}console[_0x7fa835(0xdd)](_0x1038b1+'\x20'+a31_0x343d08['bold'](_0x16facd['name'])+_0x6af501),console[_0x7fa835(0xdd)]('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Source:')+'\x20'+a31_0x343d08[_0x7fa835(0x10a)](_0x16facd[_0x7fa835(0x127)]+'.'+_0x16facd[_0x7fa835(0x27e)]));const _0x13f23a=_0x16facd[_0x7fa835(0x14d)]===_0x16facd['foreignKey']?a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0x22c))+'\x20'+_0x16facd[_0x7fa835(0x14d)]:a31_0x343d08[_0x7fa835(0x1a7)](_0x7fa835(0xf9))+'\x20'+_0x16facd[_0x7fa835(0x14d)]+_0x7fa835(0x212)+_0x16facd[_0x7fa835(0x20a)];console['error']('\x20\x20'+_0x13f23a),console['error']('\x20\x20'+a31_0x343d08[_0x7fa835(0x1a7)]('Columns:')),this[_0x7fa835(0x114)](_0x16facd[_0x7fa835(0x1e1)]),!_0x16facd['schemaValid']&&console['error']('\x20\x20'+a31_0x343d08['red'](_0x7fa835(0xaa))+'\x20'+_0x16facd['schemaError']);}}[a31_0x10c381(0x114)](_0x56c907){const _0x43e2f9=a31_0x10c381;for(const _0x471d2d of _0x56c907){_0x471d2d[_0x43e2f9(0x23d)]===_0x471d2d[_0x43e2f9(0xbd)]||_0x471d2d[_0x43e2f9(0xbd)]==='*'?console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d['label']):console[_0x43e2f9(0xdd)](_0x43e2f9(0x1ab)+_0x471d2d[_0x43e2f9(0x23d)]+'\x20'+a31_0x343d08[_0x43e2f9(0x1a7)]('('+_0x471d2d['column']+')'));}}[a31_0x10c381(0xc8)](_0x3a0d04){const _0x4767ea=a31_0x10c381;console[_0x4767ea(0xdd)]('─'[_0x4767ea(0x1c1)](0x3c));if(_0x3a0d04[_0x4767ea(0xc0)]['length']>0x0){console[_0x4767ea(0xdd)]('\x0a'+a31_0x343d08[_0x4767ea(0x11b)]('Errors:'));for(const _0x5a1673 of _0x3a0d04[_0x4767ea(0xc0)]){console[_0x4767ea(0xdd)]('\x20\x20'+a31_0x343d08[_0x4767ea(0x11b)]('•')+'\x20'+_0x5a1673);}}_0x3a0d04[_0x4767ea(0x202)]&&console['error']('\x0a'+a31_0x343d08[_0x4767ea(0x97)]('✔')+_0x4767ea(0x234));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xdf);[a31_0x10c381(0x184)]=a31_0x10c381(0x1fd);async[a31_0x10c381(0xa0)](_0x44efa8){const _0x1458f9=a31_0x10c381,{options:_0x12c47a,args:_0x19112d,tdx:_0x1cc753}=_0x44efa8,_0x32ee13=_0x12c47a,_0x42b1c6=_0x19112d[0x0]||_0x12c47a[_0x1458f9(0x113)];if(!_0x42b1c6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x1458f9(0x124)+'Options\x20(one\x20required):\x0a'+_0x1458f9(0x144)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x1458f9(0x269)+_0x1458f9(0xd9)),0x1;if(!_0x32ee13['master']&&!_0x32ee13[_0x1458f9(0xf8)]&&!_0x32ee13['behavior']&&!_0x32ee13[_0x1458f9(0x27f)])return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xde))),console[_0x1458f9(0xdd)](_0x1458f9(0x237)),console[_0x1458f9(0xdd)](_0x1458f9(0x19a)),console[_0x1458f9(0xdd)](_0x1458f9(0x109)),console[_0x1458f9(0xdd)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x1458f9(0xdd)](_0x1458f9(0x173)),console[_0x1458f9(0xdd)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x2488fe=resolveYamlFile(_0x42b1c6);if(!existsSync(_0x2488fe))return showFileNotFoundError(_0x2488fe,_0x42b1c6),0x1;_0x32ee13[_0x1458f9(0x20b)]&&(console['error'](_0x1458f9(0x25d)+_0x32ee13[_0x1458f9(0x201)]),console[_0x1458f9(0xdd)](_0x1458f9(0x12e)+_0x2488fe));let _0x32ed80;try{_0x32ed80=readFileSync(_0x2488fe,_0x1458f9(0x20f));}catch(_0x132a19){const _0x4503d0=_0x132a19 instanceof Error?_0x132a19[_0x1458f9(0x14e)]:String(_0x132a19);return console['error'](_0x1458f9(0x1cf)+_0x4503d0),0x1;}let _0x34607a;try{_0x34607a=parseDef(_0x32ed80);}catch(_0x247ff8){const _0x5447e3=_0x247ff8 instanceof Error?_0x247ff8[_0x1458f9(0x14e)]:String(_0x247ff8);return console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0xb0)+_0x5447e3)),0x1;}if(_0x32ee13[_0x1458f9(0xf8)]===!![]||_0x32ee13[_0x1458f9(0xf8)]===''){const _0x2d2c17=_0x34607a['attributes']?.['map'](_0x5501f6=>_0x5501f6['name'])||[];if(_0x2d2c17[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08['red']('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x183))),console[_0x1458f9(0xdd)](_0x1458f9(0x217));for(const _0x4d315a of _0x2d2c17){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08['cyan'](_0x4d315a));}console[_0x1458f9(0xdd)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x42b1c6+'\x20--attribute\x20\x22'+_0x2d2c17[0x0]+'\x22');}return 0x1;}if(_0x32ee13[_0x1458f9(0x239)]===!![]||_0x32ee13[_0x1458f9(0x239)]===''){const _0x3f2e3a=_0x34607a['behaviors']?.['map'](_0x6f6ba7=>_0x6f6ba7[_0x1458f9(0x23b)])||[];if(_0x3f2e3a[_0x1458f9(0x190)]===0x0)console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)](_0x1458f9(0x21a)));else{console[_0x1458f9(0xdd)](a31_0x343d08[_0x1458f9(0x11b)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x1458f9(0xdd)]('Available\x20behaviors:');for(const _0x5b9b0c of _0x3f2e3a){console[_0x1458f9(0xdd)]('\x20\x20'+a31_0x343d08[_0x1458f9(0x12a)](_0x5b9b0c));}console[_0x1458f9(0xdd)](_0x1458f9(0x12f)+_0x42b1c6+_0x1458f9(0x13b)+_0x3f2e3a[0x0]+'\x22');}return 0x1;}const _0x32468c=createCommandSpinner(a31_0x343d08[_0x1458f9(0x1a7)](_0x1458f9(0x1b8)),{'verbose':_0x32ee13[_0x1458f9(0x20b)]});_0x32468c[_0x1458f9(0x134)]();const _0x32d7c5={'onProgress':_0xd559ca=>{const _0xbb0b11=_0x1458f9;_0x32468c[_0xbb0b11(0xf0)]=formatProgressMessage(_0xd559ca);}};if(_0x32ee13[_0x1458f9(0x77)])_0x32d7c5['master']=!![];if(_0x32ee13['attribute']&&typeof _0x32ee13['attribute']===_0x1458f9(0x6d))_0x32d7c5['attribute']=_0x32ee13[_0x1458f9(0xf8)];if(_0x32ee13[_0x1458f9(0x239)]&&typeof _0x32ee13[_0x1458f9(0x239)]==='string')_0x32d7c5[_0x1458f9(0x239)]=_0x32ee13[_0x1458f9(0x239)];if(_0x32ee13[_0x1458f9(0x27f)])_0x32d7c5[_0x1458f9(0x27f)]=!![];if(_0x32ee13[_0x1458f9(0x1f4)])_0x32d7c5[_0x1458f9(0x1f4)]=_0x32ee13['interval'];let _0x2d3e8c;try{_0x2d3e8c=await _0x1cc753[_0x1458f9(0x209)][_0x1458f9(0x1c2)](_0x32ed80,_0x32d7c5),_0x32468c[_0x1458f9(0xf6)]();}catch(_0x587d24){_0x32468c[_0x1458f9(0xf6)]();throw _0x587d24;}return await this[_0x1458f9(0x7e)](_0x2d3e8c,{'master':_0x32ee13[_0x1458f9(0x77)],'attribute':typeof _0x32ee13[_0x1458f9(0xf8)]==='string'?_0x32ee13['attribute']:undefined,'behavior':typeof _0x32ee13['behavior']==='string'?_0x32ee13[_0x1458f9(0x239)]:undefined,'enriched':_0x32ee13[_0x1458f9(0x27f)]}),_0x2d3e8c[_0x1458f9(0x202)]?0x0:0x1;}async[a31_0x10c381(0x7e)](_0x77abfe,_0x1d111d){const _0x5429ac=a31_0x10c381;console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x10a)](_0x5429ac(0x1c6))+'\x20'+_0x77abfe['name']),console[_0x5429ac(0xdd)]('═'[_0x5429ac(0x1c1)](0x3c));if(_0x1d111d[_0x5429ac(0x77)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x4ce067=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x242))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x77abfe['master'][_0x5429ac(0x127)]+'.'+_0x77abfe[_0x5429ac(0x77)][_0x5429ac(0x27e)]);await this[_0x5429ac(0x125)](_0x4ce067,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0xf8)]&&_0x77abfe['sampleData']){const _0x3417c8=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x10c))+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0xf8)]);await this[_0x5429ac(0x125)](_0x3417c8,_0x77abfe['sampleData']);}else{if(_0x1d111d[_0x5429ac(0x239)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x2f318d=a31_0x343d08[_0x5429ac(0x1a7)]('Behavior:')+'\x20'+a31_0x343d08[_0x5429ac(0x10a)](_0x1d111d[_0x5429ac(0x239)]);await this['displaySampleData'](_0x2f318d,_0x77abfe[_0x5429ac(0x226)]);}else{if(_0x1d111d[_0x5429ac(0x27f)]&&_0x77abfe[_0x5429ac(0x226)]){const _0x59d38e=a31_0x343d08[_0x5429ac(0x1a7)](_0x5429ac(0x85))+'\x20'+a31_0x343d08['bold']('Master\x20+\x20Attributes');await this[_0x5429ac(0x125)](_0x59d38e,_0x77abfe['sampleData']);}else!_0x77abfe[_0x5429ac(0x226)]&&console[_0x5429ac(0xdd)](_0x5429ac(0x151));}}}if(_0x77abfe[_0x5429ac(0xc0)][_0x5429ac(0x190)]>0x0){console[_0x5429ac(0xdd)]('─'[_0x5429ac(0x1c1)](0x3c)),console['error']('\x0a'+a31_0x343d08[_0x5429ac(0x11b)](_0x5429ac(0x163)));for(const _0x1d1a69 of _0x77abfe['errors']){console['error']('\x20\x20'+a31_0x343d08[_0x5429ac(0x11b)]('•')+'\x20'+_0x1d1a69);}}}async['displaySampleData'](_0x1899ea,_0x3c7bc6){const _0x3f44e2=a31_0x10c381;if(_0x3c7bc6[_0x3f44e2(0x190)]===0x0){console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea),console[_0x3f44e2(0xdd)](_0x3f44e2(0x17d));return;}console[_0x3f44e2(0xdd)]('\x0a'+_0x1899ea);const _0x1437b6=Object[_0x3f44e2(0x93)](_0x3c7bc6[0x0])['map'](_0x930ba4=>({'name':_0x930ba4,'type':typeof _0x3c7bc6[0x0][_0x930ba4]===_0x3f44e2(0x1e5)?_0x3f44e2(0x1a6):_0x3f44e2(0x9d)})),_0x835ce4={'queryId':'preview','columns':_0x1437b6,'data':_0x3c7bc6,'stats':{'state':_0x3f44e2(0x1b7),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3c7bc6[_0x3f44e2(0x190)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5add35=formatAsTable(_0x835ce4,_0x3c7bc6[_0x3f44e2(0x190)],!![]);await writeOutput(_0x5add35,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x8a);[a31_0x10c381(0x184)]=a31_0x10c381(0x6b);async[a31_0x10c381(0xa0)](_0x335d89){const _0x4c169f=a31_0x10c381,{options:_0x6e259d,args:_0x51b9b7,tdx:_0x26eff8}=_0x335d89,_0x2447f8=_0x6e259d,_0xe5ca08=_0x51b9b7[0x0]||_0x6e259d[_0x4c169f(0x113)];if(!_0xe5ca08)return showParentSegmentNotSetError(_0x4c169f(0x18e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x2def5b=resolveYamlFile(_0xe5ca08);if(existsSync(_0x2def5b)){_0x2447f8['verbose']&&console[_0x4c169f(0xdd)](_0x4c169f(0xd0)+_0x2def5b);let _0x18ea26;try{_0x18ea26=readFileSync(_0x2def5b,_0x4c169f(0x20f));}catch(_0x270f74){const _0x1e6b59=_0x270f74 instanceof Error?_0x270f74[_0x4c169f(0x14e)]:String(_0x270f74);return console[_0x4c169f(0xdd)]('Error\x20reading\x20file:\x20'+_0x1e6b59),0x1;}const _0x215205=await withSpinner('Analyzing\x20changes...',()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0xce)](_0x18ea26),{'verbose':_0x2447f8['verbose']}),_0x212929=_0x215205[_0x4c169f(0x8b)],{isNew:_0x49c254,name:_0x4c71a4,hasChanges:_0xa209f2,diffFormatted:_0x466939}=_0x212929;if(_0xa209f2){_0x49c254?console[_0x4c169f(0xdd)](_0x4c169f(0xcb)+_0x4c71a4+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x4c71a4+'\x27:');console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c)),console[_0x4c169f(0xdd)](_0x466939),console[_0x4c169f(0xdd)]('─'[_0x4c169f(0x1c1)](0x3c));const _0x1d108e=_0x49c254?'Create\x20parent\x20segment\x20\x27'+_0x4c71a4+'\x27\x20and\x20run\x20workflow?':_0x4c169f(0xb7)+_0x4c71a4+_0x4c169f(0xee);if(!_0x2447f8['yes']){if(!isInteractive())return console['error'](a31_0x343d08[_0x4c169f(0x11b)]('\x0aError:'),_0x4c169f(0x1b0)),console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x182))),0x1;const _0x36c1b4=await confirmKey(_0x1d108e);if(!_0x36c1b4)return console[_0x4c169f(0xdd)](a31_0x343d08[_0x4c169f(0x185)](_0x4c169f(0x1ae))),0x1;}const _0x1de1c5=_0x49c254?_0x4c169f(0x147):_0x4c169f(0x1a4);await withSpinner(_0x1de1c5+_0x4c169f(0x199)+_0x4c71a4+_0x4c169f(0x169),()=>_0x212929['apply'](),{'verbose':_0x2447f8[_0x4c169f(0x20b)]});const _0x270001=_0x49c254?_0x4c169f(0x21e):'Updated';console[_0x4c169f(0xdd)]('✔\x20'+_0x270001+_0x4c169f(0x199)+_0x4c71a4+'\x27');}else console[_0x4c169f(0xdd)](_0x4c169f(0x1e6)+_0x4c71a4+_0x4c169f(0xb8));}const _0xdfb9d0=await withSpinner(_0x4c169f(0x257)+_0xe5ca08+_0x4c169f(0x169),()=>_0x26eff8[_0x4c169f(0x209)][_0x4c169f(0x1d4)](_0xe5ca08),{'verbose':_0x2447f8[_0x4c169f(0x20b)]}),_0x199606=_0xdfb9d0['data'],_0x341710=getConsoleUrl(_0x2447f8['site'],_0x4c169f(0x179)+_0x199606[_0x4c169f(0xf2)]+_0x4c169f(0x10f)+_0x199606[_0x4c169f(0x172)]+_0x4c169f(0x22a)+_0x199606[_0x4c169f(0x271)]);return console[_0x4c169f(0xdd)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xec))+'\x20'+_0x199606[_0x4c169f(0x75)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0x171))+'\x20'+_0x199606[_0x4c169f(0xab)]),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08['dim'](_0x4c169f(0xd2))+'\x20'+_0x199606['workflowSessionId']),console[_0x4c169f(0xdd)]('\x20\x20'+a31_0x343d08[_0x4c169f(0x1a7)](_0x4c169f(0xa8))+'\x20'+_0x199606[_0x4c169f(0x271)]),console[_0x4c169f(0xdd)]('\x20\x20'+_0x341710),console[_0x4c169f(0xdd)]('\x0a'+a31_0x343d08['dim']('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x199606[_0x4c169f(0x271)]+_0x4c169f(0xcc)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ba);[a31_0x10c381(0x184)]=a31_0x10c381(0x105);async[a31_0x10c381(0xa0)](_0x52e1ff){const _0x2a8514=a31_0x10c381,{options:_0x30f9e3,args:_0x5e3599,tdx:_0x52078f}=_0x52e1ff,_0x221fe7=_0x5e3599[0x0]||_0x30f9e3['parentSegment'];if(!_0x221fe7)return showParentSegmentNotSetError(_0x2a8514(0x200)+_0x2a8514(0xbb)),0x1;_0x30f9e3[_0x2a8514(0x20b)]&&(console[_0x2a8514(0xdd)](_0x2a8514(0x25d)+_0x30f9e3[_0x2a8514(0x201)]),console[_0x2a8514(0xdd)](_0x2a8514(0x224)+_0x221fe7));const _0x2429e0=await withSpinner(_0x2a8514(0xa6)+_0x221fe7+_0x2a8514(0x169),()=>_0x52078f[_0x2a8514(0x209)][_0x2a8514(0x9e)](_0x221fe7),{'verbose':_0x30f9e3[_0x2a8514(0x20b)]}),_0x596ded=_0x2429e0[_0x2a8514(0x8b)];console['error'](_0x2a8514(0x227)+_0x596ded[_0x2a8514(0x190)]+_0x2a8514(0x264)+(_0x596ded[_0x2a8514(0x190)]!==0x1?'s':''));if(_0x30f9e3[_0x2a8514(0x22f)]||_0x30f9e3[_0x2a8514(0xd1)])return await handleSDKOutput(_0x596ded,_0x30f9e3),0x0;return displayFieldsHumanReadable(_0x596ded,_0x221fe7),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a31_0x10c381(0x1d7);[a31_0x10c381(0x184)]=a31_0x10c381(0x270);async['execute'](_0x353f90){const _0x318124=a31_0x10c381,{options:_0x2bc0b0,args:_0x4aeacb,tdx:_0x480c32}=_0x353f90,_0x37defb=_0x2bc0b0,_0x8fea50=_0x4aeacb[0x0]||_0x2bc0b0[_0x318124(0x113)];if(!_0x8fea50)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x318124(0x278)+'Options:\x0a'+_0x318124(0x20c)),0x1;_0x2bc0b0['verbose']&&(console['error'](_0x318124(0x25d)+_0x2bc0b0[_0x318124(0x201)]),console[_0x318124(0xdd)](_0x318124(0x224)+_0x8fea50));const _0x4aed97=await withSpinner(_0x318124(0xa9)+_0x8fea50+'\x27...',()=>_0x480c32[_0x318124(0x209)]['getParentFull'](_0x8fea50),{'verbose':_0x2bc0b0['verbose']}),_0x2ef3b9=_0x4aed97[_0x318124(0x8b)];if(_0x37defb[_0x318124(0xa4)]){const _0x2f2274=getConsoleNextUrl(_0x37defb[_0x318124(0x201)],_0x318124(0x13d)+_0x2ef3b9['id']);return console['error'](a31_0x343d08[_0x318124(0x97)]('✔')+_0x318124(0x1fb)+a31_0x343d08[_0x318124(0x12a)](_0x2f2274)),openBrowser(_0x2f2274),0x0;}return await handleSingleObjectOutput(_0x2ef3b9,_0x2bc0b0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a31_0x10c381(0x184)]=a31_0x10c381(0x26c);async[a31_0x10c381(0xa0)](_0x4c4d50){const _0x23b122=a31_0x10c381,{options:_0x93b121,args:_0x4098ea,tdx:_0x1ecf2e}=_0x4c4d50,_0x428f7d=_0x93b121,_0x428147=_0x4098ea[0x0]||_0x93b121[_0x23b122(0x113)];if(!_0x428147)return showParentSegmentNotSetError(_0x23b122(0xd6)+_0x23b122(0x238)+'Options:\x0a'+_0x23b122(0x247)),0x1;_0x93b121[_0x23b122(0x20b)]&&(console[_0x23b122(0xdd)](_0x23b122(0x25d)+_0x93b121[_0x23b122(0x201)]),console[_0x23b122(0xdd)](_0x23b122(0x224)+_0x428147));const _0x591c0a=await withSpinner(_0x23b122(0x252)+_0x428147+_0x23b122(0x169),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x13a)](_0x428147),{'verbose':_0x93b121[_0x23b122(0x20b)]}),_0x3620f3=_0x591c0a[_0x23b122(0x8b)],_0x1e3b9c=_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x268)](_0x3620f3);if(_0x428f7d[_0x23b122(0x1f5)]){const _0x1b65b0=await this[_0x23b122(0x157)](_0x4c4d50,_0x428147,_0x3620f3,_0x1e3b9c),_0x529d39=this[_0x23b122(0x8f)](_0x1b65b0);writeFileSync(_0x428f7d[_0x23b122(0x1f5)],_0x529d39);const _0x13fdec=_0x1b65b0[_0x23b122(0x141)]['columns']['length']+_0x1b65b0[_0x23b122(0x70)]['reduce']((_0x43a1f6,_0x4fd031)=>_0x43a1f6+_0x4fd031[_0x23b122(0x1e1)][_0x23b122(0x190)],0x0),_0x362f41=_0x1b65b0[_0x23b122(0x70)][_0x23b122(0xe0)](_0x26c352=>_0x26c352[_0x23b122(0x1e1)][_0x23b122(0x190)]===0x0)['length'];return console[_0x23b122(0x1db)](_0x23b122(0xf7)+_0x428f7d[_0x23b122(0x1f5)]),console[_0x23b122(0x1db)](_0x23b122(0x10b)+_0x1e3b9c),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1b65b0[_0x23b122(0x70)][_0x23b122(0x190)]+_0x23b122(0x21f)),console[_0x23b122(0x1db)](_0x23b122(0xc6)+_0x13fdec+'\x20total'),_0x362f41>0x0&&console[_0x23b122(0x1db)](_0x23b122(0x14b)+_0x362f41+_0x23b122(0x228)),0x0;}console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('Output\x20Database:')+'\x20'+a31_0x343d08[_0x23b122(0x12a)](_0x1e3b9c));const _0x32b90c=await withSpinner(_0x23b122(0x23c),()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x1c4)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)]('customers')+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+_0x23b122(0x87)));const _0x4ebcb7=await executeSchemaQuery(_0x32b90c[_0x23b122(0x8b)],_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x4ebcb7,_0x93b121);const _0x303d29=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x1ecf2e[_0x23b122(0x209)][_0x23b122(0x24e)](_0x3620f3),{'verbose':_0x93b121[_0x23b122(0x20b)]});for(const _0x3e9c41 of _0x303d29[_0x23b122(0x8b)]){const _0x425d64='behavior_'+_0x3e9c41[_0x23b122(0x198)]()['replace'](/\s+/g,'_'),_0x27e650=_0x23b122(0x272)+_0x1e3b9c+'.'+_0x425d64;console[_0x23b122(0xdd)]('\x0a'+a31_0x343d08[_0x23b122(0x10a)](_0x3e9c41)+'\x20'+a31_0x343d08[_0x23b122(0x1a7)]('('+_0x1e3b9c+'.'+_0x425d64+')'));try{const _0x5f2453=await executeSchemaQuery(_0x27e650,_0x1ecf2e,_0x93b121);await handleQueryOutput(_0x5f2453,_0x93b121);}catch{console['error'](a31_0x343d08['yellow'](_0x23b122(0x19d)));}}return 0x0;}async[a31_0x10c381(0x157)](_0x4a80ab,_0xec355c,_0x402939,_0x50efad){const _0x222dc3=a31_0x10c381,{options:_0x35209c,tdx:_0x4add41}=_0x4a80ab,_0x499e5d=await withSpinner(_0x222dc3(0x23c),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x1c4)](_0x402939),{'verbose':_0x35209c[_0x222dc3(0x20b)]}),_0xc67c56=await executeSchemaQuery(_0x499e5d[_0x222dc3(0x8b)],_0x4add41,_0x35209c),_0x28c57d=_0xc67c56[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x295c8f=>({'name':_0x295c8f['column_name'],'type':_0x295c8f['column_type']})),_0x2b1700=await withSpinner(_0x222dc3(0x129),()=>_0x4add41[_0x222dc3(0x209)][_0x222dc3(0x24e)](_0x402939),{'verbose':_0x35209c['verbose']}),_0x2ee692=[];for(const _0x4d0b95 of _0x2b1700[_0x222dc3(0x8b)]){const _0x328d2f=_0x222dc3(0x1d2)+_0x4d0b95[_0x222dc3(0x198)]()[_0x222dc3(0x15f)](/\s+/g,'_'),_0x3714e9='SELECT\x20*\x20FROM\x20'+_0x50efad+'.'+_0x328d2f;let _0x1d4dc6=[];try{const _0x3f2955=await executeSchemaQuery(_0x3714e9,_0x4add41,_0x35209c);_0x1d4dc6=_0x3f2955[_0x222dc3(0x8b)][_0x222dc3(0xe9)](_0x231c0a=>({'name':_0x231c0a[_0x222dc3(0x20e)],'type':_0x231c0a[_0x222dc3(0x1f2)]}));}catch{}_0x2ee692[_0x222dc3(0x188)]({'table':_0x328d2f,'columns':_0x1d4dc6});}return{'database':_0x50efad,'parent_segment':_0xec355c,'parent_id':_0x402939,'customers':{'table':_0x222dc3(0x141),'columns':_0x28c57d},'behaviors':_0x2ee692};}['formatSchemaJson'](_0x4f71b3){const _0x557e6a=a31_0x10c381,_0x2e920e=_0x53a27c=>{const _0x3b63db=a31_0xc607;if(_0x53a27c[_0x3b63db(0x190)]===0x0)return'[]';const _0x5c9f07=_0x53a27c[_0x3b63db(0xe9)](_0x3529e0=>_0x3b63db(0x143)+_0x3529e0[_0x3b63db(0x23b)]+_0x3b63db(0x13f)+_0x3529e0['type']+_0x3b63db(0x1be));return'[\x0a'+_0x5c9f07['join'](',\x0a')+_0x3b63db(0x221);},_0x52d359=_0x4f71b3[_0x557e6a(0x70)][_0x557e6a(0xe9)](_0x20e1b3=>{const _0x402508=_0x557e6a;return _0x402508(0x1bb)+_0x20e1b3[_0x402508(0x27e)]+_0x402508(0x165)+_0x2e920e(_0x20e1b3['columns'])['replace'](/^/gm,'\x20\x20')[_0x402508(0x107)]()+'\x0a\x20\x20\x20\x20}';})[_0x557e6a(0xa1)](',\x0a');return _0x557e6a(0x259)+_0x4f71b3[_0x557e6a(0x127)]+_0x557e6a(0x24f)+_0x4f71b3[_0x557e6a(0x27d)]+_0x557e6a(0x232)+_0x4f71b3[_0x557e6a(0x84)]+_0x557e6a(0x26d)+_0x4f71b3[_0x557e6a(0x141)][_0x557e6a(0x27e)]+_0x557e6a(0xd3)+_0x2e920e(_0x4f71b3[_0x557e6a(0x141)]['columns'])[_0x557e6a(0x15f)](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x52d359+_0x557e6a(0x17e);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x10e);[a31_0x10c381(0x184)]=a31_0x10c381(0x25b);async['execute'](_0x3118b8){const _0xc511a5=a31_0x10c381,{options:_0xbd78e8,args:_0x358d30,tdx:_0x104cfe}=_0x3118b8,_0x53a9de=_0x358d30[0x0]||_0xbd78e8[_0xc511a5(0x113)];if(!_0x53a9de)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0xc511a5(0x21b)),0x1;_0xbd78e8[_0xc511a5(0x20b)]&&(console[_0xc511a5(0xdd)](_0xc511a5(0x25d)+_0xbd78e8[_0xc511a5(0x201)]),console['error'](_0xc511a5(0x224)+_0x53a9de));const _0x35c3c7=await withSpinner(_0xc511a5(0x252)+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)]['resolveParentId'](_0x53a9de),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x3d1be8=_0x35c3c7[_0xc511a5(0x8b)],_0x52306f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x53a9de+_0xc511a5(0x169),()=>_0x104cfe[_0xc511a5(0x209)][_0xc511a5(0x1c4)](_0x3d1be8),{'verbose':_0xbd78e8[_0xc511a5(0x20b)]}),_0x1d4e19=_0x52306f[_0xc511a5(0x8b)];return _0xbd78e8['format']===_0xc511a5(0x22f)||_0xbd78e8[_0xc511a5(0x6f)]===_0xc511a5(0xd1)?await handleSDKOutput([{'sql':_0x1d4e19}],_0xbd78e8):console[_0xc511a5(0x1db)](_0x1d4e19),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0x10c381(0x1ed);[a31_0x10c381(0x184)]='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x10c381(0xa0)](_0x44cbb5){const _0x4d97b6=a31_0x10c381,{options:_0x536f51,args:_0x56e795,tdx:_0x41d497}=_0x44cbb5,_0x42bda3=_0x56e795[0x0]||_0x536f51[_0x4d97b6(0x113)];if(!_0x42bda3)return showParentSegmentNotSetError(_0x4d97b6(0x1ad)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x536f51[_0x4d97b6(0x20b)]&&(console[_0x4d97b6(0xdd)](_0x4d97b6(0x25d)+_0x536f51[_0x4d97b6(0x201)]),console[_0x4d97b6(0xdd)]('Parent\x20segment:\x20'+_0x42bda3));const _0x124ce2=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x13a)](_0x42bda3),{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0x48ca78=_0x124ce2[_0x4d97b6(0x8b)],_0x5b15a1=await withSpinner(_0x4d97b6(0x116)+_0x42bda3+_0x4d97b6(0x169),()=>_0x41d497[_0x4d97b6(0x209)][_0x4d97b6(0x1c4)](_0x48ca78),{'verbose':_0x536f51[_0x4d97b6(0x20b)]});let _0x406b20=_0x5b15a1[_0x4d97b6(0x8b)];const _0x1828e7=resolveLimit(_0x536f51[_0x4d97b6(0x244)],DEFAULT_DISPLAY_LIMIT),_0x35390c=/\bLIMIT\s+\d+/i[_0x4d97b6(0x1f7)](_0x406b20);!_0x35390c&&(_0x406b20=_0x406b20[_0x4d97b6(0x107)]()[_0x4d97b6(0x15f)](/;+$/,''),_0x406b20=_0x4d97b6(0xd7)+_0x406b20+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x1828e7);_0x536f51[_0x4d97b6(0x20b)]&&console[_0x4d97b6(0xdd)](_0x4d97b6(0x230)+_0x406b20);const _0x236f44=await withProgressSpinner(_0x4d97b6(0x106),async _0x311afb=>{const _0x5e00a6=_0x4d97b6,_0x3d2a8a=await _0x41d497[_0x5e00a6(0x27c)][_0x5e00a6(0xa0)](_0x406b20,{'catalog':'td','schema':'information_schema','onJobId':_0x513ec8=>{const _0x250ed1=_0x5e00a6;_0x311afb[_0x250ed1(0x6e)](_0x513ec8);}});return _0x3d2a8a;},{'verbose':_0x536f51[_0x4d97b6(0x20b)]}),_0xaf7573=_0x236f44[_0x4d97b6(0x8b)],_0x5cbb8e=_0xaf7573[_0x4d97b6(0x197)]?_0x4d97b6(0x1a9)+_0xaf7573['jobId']+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0xaf7573[_0x4d97b6(0x22b)][_0x4d97b6(0xe2)][_0x4d97b6(0x18f)]()+_0x4d97b6(0xa2)+(_0x4d97b6(0xb9)+formatElapsed(_0xaf7573[_0x4d97b6(0x22b)]['elapsedTimeMillis'])+_0x5cbb8e)),await handleQueryOutput(_0xaf7573,_0x536f51),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x243);async['execute'](_0x33ffef){const _0x158950=a31_0x10c381,{options:_0x5b8526,args:_0x581243,tdx:_0x4dabc1}=_0x33ffef,_0x443136=_0x581243[0x0],_0x1e0121=await withSpinner(_0x443136?_0x158950(0x223)+_0x443136+'\x27...':_0x158950(0xc1),()=>_0x4dabc1[_0x158950(0x193)][_0x158950(0xb1)](),{'verbose':_0x5b8526[_0x158950(0x20b)]});let _0x364e25=_0x1e0121[_0x158950(0x8b)][_0x158950(0xe0)](_0xb93c79=>_0xb93c79['realtime_enabled']);if(_0x443136){const _0x2a8322=_0x443136[_0x158950(0x15f)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3633a0=new RegExp('^'+_0x2a8322+'$','i');_0x364e25=_0x364e25['filter'](_0x2da970=>_0x3633a0['test'](_0x2da970[_0x158950(0x23b)]));}_0x364e25[_0x158950(0x1c3)]((_0x4c7553,_0x1d2d7c)=>_0x4c7553[_0x158950(0x23b)][_0x158950(0x19e)](_0x1d2d7c['name'])),console['error'](_0x158950(0x227)+_0x364e25[_0x158950(0x190)]+_0x158950(0x258)+(_0x364e25['length']!==0x1?'s':''));const _0x2d10b6=_0x56441b=>{const _0x297ebd=_0x158950;return getConsoleNextUrl(_0x5b8526[_0x297ebd(0x201)],_0x297ebd(0x13d)+_0x56441b);};if(_0x5b8526['format']===_0x158950(0x22f)||_0x5b8526[_0x158950(0x6f)]===_0x158950(0xd1)){const _0x5e6cac=_0x364e25[_0x158950(0xe9)](_0x50d8d7=>({..._0x50d8d7,'url':_0x2d10b6(_0x50d8d7['id'])}));await handleSDKOutput(_0x5e6cac,_0x5b8526);}else{if(_0x364e25[_0x158950(0x190)]===0x0)console[_0x158950(0x1db)](_0x158950(0x1f9));else for(const _0x595944 of _0x364e25){const _0x40ad02=_0x595944[_0x158950(0x19b)]?a31_0x343d08[_0x158950(0x1a7)]('\x20('+formatRows(_0x595944['population'])+')'):'',_0x38dc73=hyperlink(_0x595944[_0x158950(0x23b)],_0x2d10b6(_0x595944['id']));console[_0x158950(0x1db)]('⚡\x20'+_0x38dc73+_0x40ad02);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x10c381(0x76);[a31_0x10c381(0x184)]=a31_0x10c381(0x1cb);async[a31_0x10c381(0xa0)](_0x5565bf){const _0xc48a0a=a31_0x10c381,{options:_0x2181ec,args:_0x21f5c9,tdx:_0x4b618e}=_0x5565bf,_0x3e0c25=_0x21f5c9[0x0]||_0x2181ec[_0xc48a0a(0x113)];if(!_0x3e0c25)return showParentSegmentNotSetError(_0xc48a0a(0x24c)+_0xc48a0a(0x27a)),0x1;const _0x353b51=resolveYamlFile(_0x3e0c25);if(!existsSync(_0x353b51))return showFileNotFoundError(_0x353b51,_0x3e0c25),0x1;let _0x21c479;try{_0x21c479=readFileSync(_0x353b51,_0xc48a0a(0x20f));}catch(_0x1a9d2c){const _0x364746=_0x1a9d2c instanceof Error?_0x1a9d2c['message']:String(_0x1a9d2c);return console[_0xc48a0a(0xdd)](_0xc48a0a(0x1cf)+_0x364746),0x1;}const _0x1740c4=createCommandSpinner(a31_0x343d08[_0xc48a0a(0x1a7)](_0xc48a0a(0x1bf)),{'verbose':_0x2181ec[_0xc48a0a(0x20b)]});_0x1740c4[_0xc48a0a(0x134)]();const _0x4f729a={'realtime':!![],'onProgress':_0xd5f8f8=>{_0x1740c4['text']=formatProgressMessage(_0xd5f8f8);}};let _0x3ee981;try{_0x3ee981=await _0x4b618e['segment'][_0xc48a0a(0x13e)](_0x21c479,_0x4f729a),_0x1740c4['stop']();}catch(_0x4df603){_0x1740c4[_0xc48a0a(0xf6)]();throw _0x4df603;}console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x10a)](_0xc48a0a(0x26a))+'\x20'+_0x3ee981[_0xc48a0a(0x23b)]),console[_0xc48a0a(0xdd)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x3ee981),console[_0xc48a0a(0xdd)]('─'[_0xc48a0a(0x1c1)](0x3c));if(_0x3ee981['errors']['length']>0x0){console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x11b)](_0xc48a0a(0x163)));for(const _0x1f8311 of _0x3ee981[_0xc48a0a(0xc0)]){console['error']('\x20\x20'+a31_0x343d08['red']('•')+'\x20'+_0x1f8311);}}return _0x3ee981['allValid']&&console[_0xc48a0a(0xdd)]('\x0a'+a31_0x343d08[_0xc48a0a(0x97)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x3ee981[_0xc48a0a(0x202)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x7c);[a31_0x10c381(0x184)]=a31_0x10c381(0xda);async[a31_0x10c381(0xa0)](_0x432e06){const _0x58c637=a31_0x10c381,{options:_0x33bd60,args:_0x572f0d,tdx:_0x2a358b}=_0x432e06,_0x445b63=_0x572f0d[0x0]||_0x33bd60['parentSegment'];if(!_0x445b63)return showParentSegmentNotSetError(_0x58c637(0x89)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment'),0x1;_0x33bd60[_0x58c637(0x20b)]&&(console[_0x58c637(0xdd)](_0x58c637(0x25d)+_0x33bd60[_0x58c637(0x201)]),console[_0x58c637(0xdd)](_0x58c637(0x224)+_0x445b63));const _0x4f6b67=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x445b63+'\x27...',()=>_0x2a358b[_0x58c637(0x209)][_0x58c637(0x13a)](_0x445b63),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x24d465=_0x4f6b67[_0x58c637(0x8b)],_0x83cb45=await withSpinner(_0x58c637(0xc4)+_0x445b63+_0x58c637(0x169),()=>_0x2a358b[_0x58c637(0x193)][_0x58c637(0x162)](_0x24d465),{'verbose':_0x33bd60[_0x58c637(0x20b)]}),_0x51da20=_0x83cb45[_0x58c637(0x8b)];console[_0x58c637(0xdd)](_0x58c637(0x227)+_0x51da20[_0x58c637(0x190)]+_0x58c637(0x1f8)+(_0x51da20[_0x58c637(0x190)]!==0x1?'s':''));if(_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0x22f)||_0x33bd60[_0x58c637(0x6f)]===_0x58c637(0xd1))await handleSDKOutput(_0x51da20,_0x33bd60);else{if(_0x51da20['length']===0x0)console['log'](_0x58c637(0xfe));else for(const _0x41470b of _0x51da20){const _0x1ecc40=_0x41470b[_0x58c637(0xe8)]===_0x58c637(0x1b3)?'🚀':'📝',_0x280854=_0x41470b[_0x58c637(0xae)]?a31_0x343d08[_0x58c637(0x185)]('\x20(paused)'):'',_0xd10e03=a31_0x343d08[_0x58c637(0x1a7)]('\x20('+_0x41470b[_0x58c637(0xb6)]+_0x58c637(0x246)+(_0x41470b[_0x58c637(0xb6)]!==0x1?'s':'')+')');console[_0x58c637(0x1db)](_0x1ecc40+'\x20'+_0x41470b['name']+_0x280854+_0xd10e03);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:rt:jn:pause';[a31_0x10c381(0x184)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x10c381(0xa0)](_0x3ab82c){const _0x362d14=a31_0x10c381,{options:_0x473d74,args:_0x335bee,tdx:_0x76df46}=_0x3ab82c,_0x49487c=_0x335bee[0x0];if(!_0x49487c)return console['error'](a31_0x343d08[_0x362d14(0x11b)](_0x362d14(0x1a3))),console[_0x362d14(0xdd)](_0x362d14(0x260)),console[_0x362d14(0xdd)](a31_0x343d08['dim'](_0x362d14(0x79))),0x1;_0x473d74[_0x362d14(0x20b)]&&(console[_0x362d14(0xdd)]('Site:\x20'+_0x473d74['site']),console[_0x362d14(0xdd)]('RT\x20Journey\x20ID:\x20'+_0x49487c));const _0x11c724=await withSpinner(_0x362d14(0xe7)+_0x49487c+_0x362d14(0x169),()=>_0x76df46[_0x362d14(0x193)][_0x362d14(0xe1)](_0x49487c),{'verbose':_0x473d74[_0x362d14(0x20b)]}),_0x52cf94=_0x11c724['data'];console[_0x362d14(0xdd)](_0x362d14(0x16a)+_0x52cf94[_0x362d14(0x23b)]+'\x27');if(_0x473d74[_0x362d14(0x6f)]===_0x362d14(0x22f)||_0x473d74[_0x362d14(0x6f)]==='jsonl')await handleSDKOutput([_0x52cf94],_0x473d74);else{const _0x165614=_0x52cf94['state']===_0x362d14(0x1b3)?'🚀':'📝',_0x3a885e=_0x52cf94[_0x362d14(0xae)]?a31_0x343d08[_0x362d14(0x185)](_0x362d14(0xe6)):'';console['log'](_0x165614+'\x20'+_0x52cf94['name']+_0x3a885e);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a31_0x10c381(0xeb);[a31_0x10c381(0x184)]=a31_0x10c381(0xf1);async['execute'](_0x5ced64){const _0x27b149=a31_0x10c381,{options:_0x41695e,args:_0x3a85b9,tdx:_0x3043b9}=_0x5ced64,_0x19b4b8=_0x3a85b9[0x0];if(!_0x19b4b8)return console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x11b)](_0x27b149(0x1a3))),console[_0x27b149(0xdd)](_0x27b149(0x149)),console[_0x27b149(0xdd)](a31_0x343d08[_0x27b149(0x1a7)](_0x27b149(0x79))),0x1;_0x41695e[_0x27b149(0x20b)]&&(console[_0x27b149(0xdd)](_0x27b149(0x25d)+_0x41695e[_0x27b149(0x201)]),console['error'](_0x27b149(0x11e)+_0x19b4b8));const _0x2252f7=await withSpinner(_0x27b149(0x203)+_0x19b4b8+_0x27b149(0x169),()=>_0x3043b9[_0x27b149(0x193)][_0x27b149(0x117)](_0x19b4b8),{'verbose':_0x41695e[_0x27b149(0x20b)]}),_0x358c47=_0x2252f7[_0x27b149(0x8b)];console['error'](_0x27b149(0x175)+_0x358c47[_0x27b149(0x23b)]+'\x27');if(_0x41695e[_0x27b149(0x6f)]===_0x27b149(0x22f)||_0x41695e[_0x27b149(0x6f)]===_0x27b149(0xd1))await handleSDKOutput([_0x358c47],_0x41695e);else{const _0x6d485b=_0x358c47[_0x27b149(0xe8)]===_0x27b149(0x1b3)?'🚀':'📝',_0x3cd1fc=_0x358c47[_0x27b149(0xae)]?a31_0x343d08[_0x27b149(0x185)](_0x27b149(0xe6)):'';console[_0x27b149(0x1db)](_0x6d485b+'\x20'+_0x358c47['name']+_0x3cd1fc);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x205);[a31_0x10c381(0x184)]=a31_0x10c381(0xcf);async['execute'](_0xb83c57){const _0x4a7668=a31_0x10c381,{options:_0x44fc36,args:_0x25c781,tdx:_0x1276af}=_0xb83c57,_0x5b83d6=_0x25c781[0x0]||_0x44fc36[_0x4a7668(0x113)];if(!_0x5b83d6)return showParentSegmentNotSetError(_0x4a7668(0x12c)+_0x4a7668(0x7a)),0x1;_0x44fc36['verbose']&&(console[_0x4a7668(0xdd)](_0x4a7668(0x25d)+_0x44fc36[_0x4a7668(0x201)]),console[_0x4a7668(0xdd)](_0x4a7668(0x224)+_0x5b83d6));const _0x18efef=await withSpinner(_0x4a7668(0x252)+_0x5b83d6+'\x27...',()=>_0x1276af['segment'][_0x4a7668(0x13a)](_0x5b83d6),{'verbose':_0x44fc36[_0x4a7668(0x20b)]}),_0x2b464c=_0x18efef[_0x4a7668(0x8b)],_0x3f0844=await withSpinner(_0x4a7668(0x26f)+_0x5b83d6+_0x4a7668(0x169),()=>_0x1276af[_0x4a7668(0x193)][_0x4a7668(0x1da)](_0x2b464c),{'verbose':_0x44fc36['verbose']}),_0x26dbc3=_0x3f0844['data'];return console[_0x4a7668(0xdd)](_0x4a7668(0x1fe)),_0x44fc36['format']===_0x4a7668(0x22f)||_0x44fc36[_0x4a7668(0x6f)]===_0x4a7668(0xd1)?await handleSDKOutput([_0x26dbc3],_0x44fc36):(console[_0x4a7668(0x1db)](_0x4a7668(0x1cd)+_0x26dbc3['id']),console['log'](_0x4a7668(0xb2)+_0x26dbc3[_0x4a7668(0x75)]),console[_0x4a7668(0x1db)](_0x4a7668(0x1f0)+_0x26dbc3['identifier']),console[_0x4a7668(0x1db)]('eventKind:\x20'+_0x26dbc3['eventKind']),console[_0x4a7668(0x1db)](_0x4a7668(0x1ef)+_0x26dbc3['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:list';[a31_0x10c381(0x184)]=a31_0x10c381(0x1e0);async[a31_0x10c381(0xa0)](_0x25e872){const _0x374070=a31_0x10c381,{options:_0x35257d,args:_0x14afc8,tdx:_0x1156da}=_0x25e872,_0x1acec3=_0x14afc8[0x0]||_0x35257d[_0x374070(0x113)];if(!_0x1acec3)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x374070(0xc5)),0x1;const _0x4c9903=await withSpinner(_0x374070(0x252)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x209)]['resolveParentId'](_0x1acec3),{'verbose':_0x35257d[_0x374070(0x20b)]}),_0x5dea0f=_0x4c9903['data'],_0x32442c=await withSpinner(_0x374070(0x196)+_0x1acec3+_0x374070(0x169),()=>_0x1156da[_0x374070(0x18b)][_0x374070(0xb1)](_0x5dea0f),{'verbose':_0x35257d['verbose']}),_0x1b38ce=_0x32442c[_0x374070(0x8b)];console['error'](_0x374070(0x227)+_0x1b38ce[_0x374070(0x190)]+_0x374070(0x25c)+(_0x1b38ce['length']!==0x1?'s':''));if(_0x35257d[_0x374070(0x6f)]===_0x374070(0x22f)||_0x35257d[_0x374070(0x6f)]===_0x374070(0xd1))await handleSDKOutput(_0x1b38ce,_0x35257d);else{if(_0x1b38ce[_0x374070(0x190)]===0x0)console[_0x374070(0x1db)](_0x374070(0x1d6)),console[_0x374070(0xdd)](a31_0x343d08[_0x374070(0x12a)](_0x374070(0x16b)));else for(const _0x120aaa of _0x1b38ce){console[_0x374070(0x1db)](a31_0x343d08[_0x374070(0x10a)](_0x120aaa['name'])+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x120aaa['id']+')'));_0x120aaa['description']&&console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x120aaa[_0x374070(0x184)]));if(_0x120aaa[_0x374070(0x1d3)]&&_0x120aaa[_0x374070(0x1d3)]['length']>0x0)for(const _0x55b96d of _0x120aaa['tokens']){const _0x23f8f2=_0x55b96d['allowedIps']?.[_0x374070(0x190)]?_0x55b96d[_0x374070(0x81)][_0x374070(0xa1)](',\x20'):'any';console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x374070(0x152))+'\x20'+_0x55b96d[_0x374070(0x23b)]+'\x20'+a31_0x343d08[_0x374070(0x1a7)]('(id:\x20'+_0x55b96d['id']+')')),console[_0x374070(0x1db)](_0x374070(0x263)+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x24a))+'\x20'+_0x23f8f2);}else console[_0x374070(0x1db)]('\x20\x20'+a31_0x343d08[_0x374070(0x1a7)](_0x374070(0x119)));}}return 0x0;}}function a31_0x1457(){const _0x3dd339=['updatedAt','Error\x20parsing\x20YAML:\x20','list','audienceId:\x20','run','xdg-open','stitchingKeys','stageCount','Apply\x20changes\x20to\x20\x27','\x27\x20is\x20up\x20to\x20date','in\x20','Error:\x20Token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','⚡\x20Not\x20enabled','column','ps:pz:create','/\x20directory.\x0a','errors','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','✔\x20Deleted\x20token\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20\x20Columns:\x20','ps:pz:delete','displaySummary','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x20parent\x20segment','\x0aNew\x20parent\x20segment\x20\x27','\x20kill','Updated','pushParentYaml','Get\x20current\x20RT\x20configuration\x20version\x20status','Found\x20YAML\x20file:\x20','jsonl','Session:','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:validate','Columns:','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','SELECT\x20*\x20FROM\x20(\x0a','platform','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','List\x20RT\x20journeys','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','events','error','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','segment:parent:preview','filter','pauseJourney','processedRows','Customers:','delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20(paused)','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','state','map','👥\x20','ps:rt:jn:resume','Audience\x20ID:','\x20Context\x20set:\x20','\x27\x20and\x20run\x20workflow?','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','text','Resume\x20activations\x20in\x20an\x20RT\x20journey','workflowId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','displayValidateResults','stop','Schema\x20saved\x20to\x20','attribute','Join:','\x0aChanges\x20to\x20apply\x20to\x20\x27','Error:\x20--database\x20and\x20--table\x20are\x20required','Show\x20personalization\x20service\x20details','\x0aError:','No\x20RT\x20journeys\x20found','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','personalizationServices','customerGroup','public:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','List\x20available\x20fields\x20for\x20segmentation','Executing\x20parent\x20segment\x20query...','trim','Master\x20Table','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','bold','\x20\x20Database:\x20','Attribute:','user_id','segment:parent:sql','/sessions/','6442mWSPbu','matchedCount','ps:pz:service:token:create','parentSegment','displayColumns','Validate:','Fetching\x20SQL\x20for\x20\x27','resumeJourney','createPersonalization','no\x20tokens\x20configured','Delete\x20a\x20realtime\x20personalization','red','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Table:\x20','RT\x20Journey\x20ID:\x20','true','107zAegoZ','schemaValid','Update\x20a\x20realtime\x20personalization\x20entity','Deleting\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displaySampleData','createToken','database','keyEventCriteria','Fetching\x20behavior\x20list...','cyan','Attributes','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','4529959uBijYq','YAML\x20file:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','yes','addBehaviorsFile','isDirectory','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','start','\x20configured','Create\x20parent\x20segment\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','rowCount','resolveParentId','\x20--behavior\x20\x22','Listing\x20parent\x20segments\x20matching\x20\x27','/app/dw/parentSegments/','validateParentYaml','\x22,\x20\x22type\x22:\x20\x22','create','customers','\x0a⚠️\x20\x20Both\x20','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Error:\x20Service\x20name\x20is\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Creating','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','entryCriteria:','\x20\x20Note:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','joinKey','message','coveragePercent','Personalization\x20service\x20description','\x0aNo\x20sample\x20data\x20available','token:','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','relationships','idStitching','folder-segment','collectSchema','audienceId:','pullParentYaml','tdx\x20ps\x20push\x20','createdAt','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','personalization_services','Deleting\x20personalization\x20service\x20\x27','replace','Events:','✔\x20Updated\x20personalization\x20service\x20\x27','listJourneys','Errors:','deletePersonalization','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','deleteToken','\x27...','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','displayPreviewHints','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x27\x20for\x20service\x20\x27','Rows:','Attributes:','Status:','workflowSessionId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerPercent','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','keyEventId','scheduleType','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','/app/workflows/','No\x20parent\x20segments\x20match\x20pattern:\x20','patch','parent_segments','\x20\x20No\x20sample\x20data\x20available','\x0a\x20\x20]\x0a}\x0a','✔\x20Deleted\x20personalization\x20service\x20\x27','addAttributesFile','Listing\x20personalizations\x20for\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20--attribute\x20requires\x20a\x20name\x0a','description','yellow','Finding\x20service\x20for\x20token...','displayRealtimeInfo','push','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20service','personalization','darwin','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','toLocaleString','length','enabled','payload','realtime','✔\x20Created\x20parent\x20segment\x20\x27','null','Listing\x20personalization\x20services\x20for\x20\x27','jobId','toLowerCase','\x20parent\x20segment\x20\x27','Options:','population','Error:\x20Service\x20ID\x20is\x20required','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','localeCompare','/\x20→\x20','\x20\x201.\x20Edit\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Options:\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Updating','/\x20and\x20','double','dim','(id:\x20','\x20[Job\x20ID:\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20\x20\x20-\x20','ps:pz:list','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Aborted.','keyEventId:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','10VjCAer','\x0aChanges\x20to\x20\x27','launched','Creating\x20personalization\x20\x27','Error:\x20Token\x20name\x20is\x20required','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','FINISHED','Fetching\x20sample\x20data...','My\x20Service','segment:parent:fields','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Output\x20file:\x20','\x20to\x20push\x20the\x20configuration','\x22\x20}','Validating\x20RT\x20configuration...','✔\x20Created\x20personalization\x20\x27','repeat','previewParentYaml','sort','getParentSQL','displayMasterInfo','Preview:','listParents','Error:\x20Personalization\x20ID\x20is\x20required','8UHBXwg','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','✔\x20Found\x20personalization\x20\x27','id:\x20','\x27\x20is\x20already\x20up\x20to\x20date','Error\x20reading\x20file:\x20','\x20Added\x20RT\x202.0\x20template\x20section','.yml','behavior_','tokens','runParent','No\x20parent\x20segments\x20found','No\x20personalization\x20services\x20configured','segment:parent:view','parentFolder','sections','getCurrentConfigVersion','log','✔\x20Created\x20personalization\x20service\x20\x27','sourceTableError','toFixed','page_view','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','columns','value','payload:','last_page_viewed','number','✔\x20No\x20changes\x20-\x20\x27','Delete\x20a\x20personalization\x20service','all','listPersonalizations','1343111BulZIi','displayBehaviorsStats','Updating\x20parent\x20segment\x20\x27','segment:parent:show','Creating\x20token\x20\x27','status:\x20','identifier:\x20','sourceTableValid','column_type','\x5c$&','interval','output','To\x20view\x20sample\x20data:','test','\x20RT\x20journey','No\x20RT-enabled\x20parent\x20segments\x20found','endsWith','\x20Opening\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','✔\x20Retrieved\x20RT\x20configuration\x20version','Analyzing\x20changes...','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','site','allValid','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','indexOf','ps:rt:configuration_versions','-1d','78gjeVpX','\x20\x20\x20\x20\x20\x20\x20\x20','segment','foreignKey','verbose','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','updated:','column_name','utf-8','ps:pz:service:create','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20=\x20','displayAttributesStats','timezone','ps:pz:service:update','Validating\x20configuration...','Available\x20attributes:','segment:parent:update','patchPersonalization','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','get','match','Created','\x20behaviors','Pattern:\x20','\x0a\x20\x20\x20\x20]','/\x20directories\x20exist.','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Parent\x20segment:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','sampleData','✔\x20Found\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','includeSensitive:','/attempt/','stats','Join\x20on:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20--behavior\x20\x22<name>\x22','json','SQL\x20query:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x20true','\x20Configuration\x20is\x20valid','\x20\x20\x20\x20\x20\x20','\x20to\x20configure\x20your\x20personalization\x20service','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','behavior','ID\x20Stitching:','name','Fetching\x20customers\x20schema...','label','✘\x20Failed\x20to\x20rename\x20directory:\x20','single','Fetching\x20current\x20configuration\x20for\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Master:','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','limit','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20stage','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','win32','allowed\x20IPs:','Next\x20steps:','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','getBehaviorNames','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Listing\x20parent\x20segments...','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Resolving\x20parent\x20segment\x20\x27','Create\x20a\x20realtime\x20personalization\x20entity','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','created:','unref','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x20RT-enabled\x20parent\x20segment','{\x0a\x20\x20\x22database\x22:\x20\x22','3451383ewOKpk','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20personalization\x20service','Site:\x20','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','22481508EuAjvb','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','RT\x202.0:','<database>.<table>','\x20\x20\x20\x20','\x20field','\x20\x202.\x20Run\x20','customersWithEvents','Creating\x20personalization\x20service\x20\x27','getOutputDatabaseName','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','RT\x202.0\x20Validate:','\x20--attribute\x20\x22','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','3iiHuSw','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Show\x20parent\x20segment\x20details','workflowAttemptId','SELECT\x20*\x20FROM\x20','td_client_id','\x27\x20with\x20ID:\x20','ps:pz:service:delete','ps:pz:patch','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','tdx\x20ps\x20preview\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','scheduleOption','query','parent_segment','table','enriched','totalEvents','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','string','setJobId','format','behaviors','attributesFile','segment:parent:create','createParent','Show\x20a\x20specific\x20realtime\x20personalization','audienceId','ps:rt:validate','master','\x20rows)','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','public','ps:rt:jn:list','165265McJbhv','displayPreviewResults','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','schemaError','allowedIps','entryCriteria','type','parent_id','Enriched:','Creating\x20parent\x20segment\x20\x27','.customers)','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','segment:parent:run','data','\x20--interval\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','1568836Cajerd','formatSchemaJson','\x20No\x20changes\x20-\x20','No\x20personalizations\x20configured','folderId','keys','✔\x20Deleted\x20personalization\x20\x27','using\x20the\x20default\x20path:\x20','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','green','file','Error:\x20Parent\x20segment\x20name\x20is\x20required','apply','Database:\x20','\x20service(s)\x20configured','varchar','listFields','includeSensitive','execute','join','\x20rows\x20','Source:','web','Behaviors','Listing\x20fields\x20for\x20\x27','\x27\x20(id:\x20','Attempt:','Fetching\x20parent\x20segment\x20\x27','Error:','status','Personalization:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','paused'];a31_0x1457=function(){return _0x3dd339;};return a31_0x1457();}export class PSPzServiceCreateCommand extends BaseCommand{['name']=a31_0x10c381(0x210);['description']='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async['execute'](_0x14c081){const _0x50740a=a31_0x10c381,{options:_0x25b9a2,args:_0x2b8d4c,tdx:_0x248438}=_0x14c081,_0x2e0016=_0x25b9a2,_0x4f04ca=_0x2b8d4c[0x0],_0x1c0273=_0x2b8d4c[0x1]||_0x25b9a2[_0x50740a(0x113)];if(!_0x4f04ca)return console[_0x50740a(0xdd)](_0x50740a(0x145)),console[_0x50740a(0xdd)](_0x50740a(0x153)),console[_0x50740a(0xdd)](_0x50740a(0x1a1)),0x1;if(!_0x1c0273)return showParentSegmentNotSetError(_0x50740a(0x8d)+_0x50740a(0x1a1)),0x1;const _0x834737=await withSpinner(_0x50740a(0x252)+_0x1c0273+_0x50740a(0x169),()=>_0x248438['segment'][_0x50740a(0x13a)](_0x1c0273),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x2528e1=_0x834737['data'],_0xbd2b17={'name':_0x4f04ca,'description':_0x2e0016[_0x50740a(0x184)],'public':_0x2e0016[_0x50740a(0x7b)]},_0x3ede30=await withSpinner(_0x50740a(0x267)+_0x4f04ca+'\x27...',()=>_0x248438[_0x50740a(0x18b)][_0x50740a(0x140)](_0x2528e1,_0xbd2b17),{'verbose':_0x25b9a2[_0x50740a(0x20b)]}),_0x183b9=_0x3ede30['data'];return console[_0x50740a(0xdd)](_0x50740a(0x1dc)+_0x183b9[_0x50740a(0x23b)]+_0x50740a(0x274)+_0x183b9['id']),await handleSDKOutput([_0x183b9],_0x25b9a2),0x0;}}function a31_0xc607(_0x154e97,_0x58a7cd){_0x154e97=_0x154e97-0x6a;const _0x1457f4=a31_0x1457();let _0xc60793=_0x1457f4[_0x154e97];return _0xc60793;}export class PSPzServiceShowCommand extends BaseCommand{['name']='ps:pz:service:show';[a31_0x10c381(0x184)]=a31_0x10c381(0xfc);async[a31_0x10c381(0xa0)](_0x21841b){const _0x396ddf=a31_0x10c381,{options:_0x4c5839,args:_0x4e73e0,tdx:_0x461618}=_0x21841b,_0x10fc73=_0x4e73e0[0x0],_0x526076=_0x4e73e0[0x1]||_0x4c5839[_0x396ddf(0x113)];if(!_0x10fc73)return console['error'](_0x396ddf(0x19c)),console[_0x396ddf(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x396ddf(0xdd)](_0x396ddf(0x16d)),0x1;if(!_0x526076)return showParentSegmentNotSetError(_0x396ddf(0x148)+_0x396ddf(0x16d)),0x1;const _0x2c6342=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x526076+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x209)]['resolveParentId'](_0x526076),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0x5c0d24=_0x2c6342[_0x396ddf(0x8b)],_0x38f889=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x10fc73+_0x396ddf(0x169),()=>_0x461618[_0x396ddf(0x18b)][_0x396ddf(0x21c)](_0x5c0d24,_0x10fc73),{'verbose':_0x4c5839[_0x396ddf(0x20b)]}),_0xbc807f=_0x38f889[_0x396ddf(0x8b)];if(_0x4c5839['json']||_0x4c5839[_0x396ddf(0xd1)])await handleSDKOutput([_0xbc807f],_0x4c5839);else{console['log'](a31_0x343d08[_0x396ddf(0x10a)](_0xbc807f['name'])+'\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('(id:\x20'+_0xbc807f['id']+')'));_0xbc807f[_0x396ddf(0x184)]&&console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['dim'](_0xbc807f[_0x396ddf(0x184)]));console['log']('\x20\x20'+a31_0x343d08[_0x396ddf(0x12a)](_0x396ddf(0x103))+'\x20'+(_0xbc807f[_0x396ddf(0x7b)]?'yes':'no'));if(_0xbc807f[_0x396ddf(0x1d3)]&&_0xbc807f[_0x396ddf(0x1d3)][_0x396ddf(0x190)]>0x0)for(const _0x16a9de of _0xbc807f[_0x396ddf(0x1d3)]){const _0x85249=_0x16a9de[_0x396ddf(0x81)]?.[_0x396ddf(0x190)]?_0x16a9de['allowedIps'][_0x396ddf(0xa1)](',\x20'):'any';console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x396ddf(0x152))+'\x20'+_0x16a9de[_0x396ddf(0x23b)]+'\x20'+a31_0x343d08['dim'](_0x396ddf(0x1a8)+_0x16a9de['id']+')')),console[_0x396ddf(0x1db)]('\x20\x20\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)](_0x396ddf(0x24a))+'\x20'+_0x85249);}else console[_0x396ddf(0x1db)]('\x20\x20'+a31_0x343d08[_0x396ddf(0x1a7)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x275);['description']=a31_0x10c381(0x1e7);async[a31_0x10c381(0xa0)](_0x354435){const _0x440070=a31_0x10c381,{options:_0x5b74cc,args:_0x13f7c4,tdx:_0x1076b2}=_0x354435,_0x1f074f=_0x13f7c4[0x0],_0x20388d=_0x13f7c4[0x1]||_0x5b74cc[_0x440070(0x113)];if(!_0x1f074f)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x440070(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]'),console[_0x440070(0xdd)](_0x440070(0xc2)),0x1;if(!_0x20388d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x440070(0xc2)),0x1;const _0x5bbd9c=await withSpinner(_0x440070(0x252)+_0x20388d+_0x440070(0x169),()=>_0x1076b2[_0x440070(0x209)][_0x440070(0x13a)](_0x20388d),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),_0x2fd140=_0x5bbd9c[_0x440070(0x8b)];return await withSpinner(_0x440070(0x15e)+_0x1f074f+_0x440070(0x169),()=>_0x1076b2['personalization'][_0x440070(0xe4)](_0x2fd140,_0x1f074f),{'verbose':_0x5b74cc[_0x440070(0x20b)]}),console['error'](_0x440070(0x17f)+_0x1f074f+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x215);[a31_0x10c381(0x184)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x10c381(0xa0)](_0xf6cb19){const _0x5c2229=a31_0x10c381,{options:_0x48c980,args:_0x15a269,tdx:_0x17eb26}=_0xf6cb19,_0x30e9b7=_0x48c980,_0x235fbd=_0x15a269[0x0],_0x2076fb=_0x15a269[0x1]||_0x48c980[_0x5c2229(0x113)];if(!_0x235fbd)return console['error'](_0x5c2229(0x19c)),console[_0x5c2229(0xdd)](_0x5c2229(0xff)),console[_0x5c2229(0xdd)](_0x5c2229(0xf3)),0x1;if(!_0x30e9b7[_0x5c2229(0x23b)])return console[_0x5c2229(0xdd)]('Error:\x20--name\x20is\x20required'),console[_0x5c2229(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x2076fb)return showParentSegmentNotSetError(_0x5c2229(0x248)+_0x5c2229(0xf3)),0x1;const _0x67486=await withSpinner(_0x5c2229(0x252)+_0x2076fb+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x209)][_0x5c2229(0x13a)](_0x2076fb),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2e7e0b=_0x67486[_0x5c2229(0x8b)],_0x4cb217={'name':_0x30e9b7[_0x5c2229(0x23b)]};_0x30e9b7[_0x5c2229(0x184)]!==undefined&&(_0x4cb217[_0x5c2229(0x184)]=_0x30e9b7[_0x5c2229(0x184)]);const _0x50f6ce=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x235fbd+_0x5c2229(0x169),()=>_0x17eb26[_0x5c2229(0x18b)][_0x5c2229(0x17b)](_0x2e7e0b,_0x235fbd,_0x4cb217),{'verbose':_0x48c980[_0x5c2229(0x20b)]}),_0x2b41f3=_0x50f6ce[_0x5c2229(0x8b)];return console['error'](_0x5c2229(0x161)+_0x2b41f3[_0x5c2229(0x23b)]+'\x27'),await handleSDKOutput([_0x2b41f3],_0x48c980),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x112);[a31_0x10c381(0x184)]=a31_0x10c381(0x88);async[a31_0x10c381(0xa0)](_0x3fa6a9){const _0x5c52a6=a31_0x10c381,{options:_0x458d91,args:_0x2559af,tdx:_0x2a3b3d}=_0x3fa6a9,_0x3a2569=_0x458d91,_0x39b27f=_0x2559af[0x0],_0x421fa4=_0x2559af[0x1],_0xf77ff6=_0x2559af[0x2]||_0x458d91[_0x5c52a6(0x113)];if(!_0x39b27f)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x1b5)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x11c)),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0x421fa4)return console[_0x5c52a6(0xdd)](_0x5c52a6(0x19c)),console[_0x5c52a6(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x5c52a6(0xdd)](_0x5c52a6(0x138)),0x1;if(!_0xf77ff6)return showParentSegmentNotSetError(_0x5c52a6(0xad)+_0x5c52a6(0x138)),0x1;const _0x5dc7e0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xf77ff6+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x209)][_0x5c52a6(0x13a)](_0xf77ff6),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x483253=_0x5dc7e0[_0x5c52a6(0x8b)],_0x52c4d8={'name':_0x39b27f};_0x3a2569[_0x5c52a6(0x81)]&&(_0x52c4d8['allowedIps']=_0x3a2569[_0x5c52a6(0x81)]['split'](',')['map'](_0xcded64=>_0xcded64['trim']()));_0x3a2569[_0x5c52a6(0x184)]&&(_0x52c4d8[_0x5c52a6(0x184)]=_0x3a2569['description']);const _0x1e2753=await withSpinner(_0x5c52a6(0x1ee)+_0x39b27f+_0x5c52a6(0x16e)+_0x421fa4+_0x5c52a6(0x169),()=>_0x2a3b3d[_0x5c52a6(0x18b)][_0x5c52a6(0x126)](_0x483253,_0x421fa4,_0x52c4d8),{'verbose':_0x458d91[_0x5c52a6(0x20b)]}),_0x255302=_0x1e2753['data'];return console[_0x5c52a6(0xdd)]('✔\x20Created\x20token\x20\x27'+_0x255302['name']+_0x5c52a6(0x274)+_0x255302['id']),_0x255302[_0x5c52a6(0x1e2)]&&(console[_0x5c52a6(0xdd)](a31_0x343d08[_0x5c52a6(0x185)](_0x5c52a6(0x25e))),console['error'](a31_0x343d08['cyan'](_0x255302[_0x5c52a6(0x1e2)])),console[_0x5c52a6(0xdd)]('')),await handleSDKOutput([_0x255302],_0x458d91),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:service:token:delete';[a31_0x10c381(0x184)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x4a4c2f){const _0x23c5a3=a31_0x10c381,{options:_0x12981c,args:_0x176bbb,tdx:_0x45abcd}=_0x4a4c2f,_0x3a97d6=_0x176bbb[0x0],_0x513424=_0x176bbb[0x1]||_0x12981c['parentSegment'];if(!_0x3a97d6)return console['error']('Error:\x20Token\x20ID\x20is\x20required'),console[_0x23c5a3(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console['error'](_0x23c5a3(0xc9)),0x1;if(!_0x513424)return showParentSegmentNotSetError(_0x23c5a3(0x146)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x500b6a=await withSpinner(_0x23c5a3(0x252)+_0x513424+'\x27...',()=>_0x45abcd[_0x23c5a3(0x209)][_0x23c5a3(0x13a)](_0x513424),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x15c95e=_0x500b6a[_0x23c5a3(0x8b)],_0x40b617=await withSpinner(_0x23c5a3(0x186),()=>_0x45abcd[_0x23c5a3(0x18b)]['list'](_0x15c95e),{'verbose':_0x12981c['verbose']}),_0x5df558=_0x40b617['data'];let _0x335be0;for(const _0x2df0ca of _0x5df558){if(_0x2df0ca[_0x23c5a3(0x1d3)]?.['some'](_0x5e9f0a=>_0x5e9f0a['id']===_0x3a97d6)){_0x335be0=_0x2df0ca['id'];break;}}if(!_0x335be0)return console[_0x23c5a3(0xdd)](_0x23c5a3(0xba)+_0x3a97d6+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x243520=await withSpinner('Deleting\x20token\x20\x27'+_0x3a97d6+'\x27...',()=>_0x45abcd[_0x23c5a3(0x18b)][_0x23c5a3(0x168)](_0x15c95e,_0x335be0,_0x3a97d6),{'verbose':_0x12981c[_0x23c5a3(0x20b)]}),_0x4d351d=_0x243520[_0x23c5a3(0x8b)];return console[_0x23c5a3(0xdd)](_0x23c5a3(0xc3)+(_0x4d351d['name']||_0x3a97d6)+'\x27'),await handleSDKOutput([_0x4d351d],_0x12981c),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x1ac);[a31_0x10c381(0x184)]=a31_0x10c381(0x189);async[a31_0x10c381(0xa0)](_0x509e7f){const _0x376243=a31_0x10c381,{options:_0x41704e,args:_0x5006d4,tdx:_0x3f7360}=_0x509e7f,_0x2075d6=_0x5006d4[0x0]||_0x41704e[_0x376243(0x113)];if(!_0x2075d6)return showParentSegmentNotSetError(_0x376243(0x1fc)+_0x376243(0x231)),0x1;const _0x54b4a9=await withSpinner(_0x376243(0x252)+_0x2075d6+'\x27...',()=>_0x3f7360[_0x376243(0x209)][_0x376243(0x13a)](_0x2075d6),{'verbose':_0x41704e[_0x376243(0x20b)]}),_0x3a75bc=_0x54b4a9[_0x376243(0x8b)],_0x2a638d=await withSpinner(_0x376243(0x181)+_0x2075d6+_0x376243(0x169),()=>_0x3f7360[_0x376243(0x18b)][_0x376243(0x1e9)](_0x3a75bc),{'verbose':_0x41704e['verbose']}),_0x3a49ea=_0x2a638d['data'];console[_0x376243(0xdd)](_0x376243(0x227)+_0x3a49ea[_0x376243(0x190)]+'\x20personalization'+(_0x3a49ea['length']!==0x1?'s':''));if(_0x41704e[_0x376243(0x6f)]===_0x376243(0x22f)||_0x41704e['format']===_0x376243(0xd1))await handleSDKOutput(_0x3a49ea,_0x41704e);else{if(_0x3a49ea[_0x376243(0x190)]===0x0)console[_0x376243(0x1db)](_0x376243(0x91));else for(const _0x2236db of _0x3a49ea){console[_0x376243(0x1db)](a31_0x343d08[_0x376243(0x10a)](_0x2236db['name'])+'\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x376243(0x1a8)+_0x2236db['id']+')'));_0x2236db[_0x376243(0x184)]&&console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x1a7)](_0x2236db[_0x376243(0x184)]));const _0x3a817b=_0x2236db[_0x376243(0x1d9)]?.[_0x376243(0x190)]||0x0;console[_0x376243(0x1db)]('\x20\x20'+a31_0x343d08[_0x376243(0x12a)]('sections:')+'\x20'+_0x3a817b);if(_0x2236db[_0x376243(0x1d9)]&&_0x2236db[_0x376243(0x1d9)][_0x376243(0x190)]>0x0)for(const _0x1f738b of _0x2236db['sections']){console['log'](_0x376243(0x1ab)+_0x1f738b[_0x376243(0x23b)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x10c381(0x23b)]='ps:pz:show';[a31_0x10c381(0x184)]=a31_0x10c381(0x74);async['execute'](_0x27b26e){const _0x39e30a=a31_0x10c381,{options:_0x93446a,args:_0x12a437,tdx:_0x446d51}=_0x27b26e,_0x1f2d63=_0x12a437[0x0];if(!_0x1f2d63)return console[_0x39e30a(0xdd)](_0x39e30a(0x1c8)),console[_0x39e30a(0xdd)](_0x39e30a(0x1ca)),0x1;const _0x18e182=await withSpinner('Getting\x20personalization\x20\x27'+_0x1f2d63+'\x27...',()=>_0x446d51[_0x39e30a(0x18b)]['getPersonalization'](_0x1f2d63),{'verbose':_0x93446a['verbose']}),_0x244a90=_0x18e182[_0x39e30a(0x8b)];console['error'](_0x39e30a(0x1cc)+_0x244a90['name']+'\x27');if(_0x93446a[_0x39e30a(0x6f)]==='json'||_0x93446a[_0x39e30a(0x6f)]===_0x39e30a(0xd1))await handleSDKOutput([_0x244a90],_0x93446a);else{console['log'](a31_0x343d08[_0x39e30a(0x10a)](_0x244a90['name'])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x244a90['id']+')'));_0x244a90[_0x39e30a(0x184)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x244a90[_0x39e30a(0x184)]));_0x244a90[_0x39e30a(0x75)]&&console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x158))+'\x20'+_0x244a90[_0x39e30a(0x75)]);console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x255))+'\x20'+_0x244a90[_0x39e30a(0x15b)]),console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08['cyan'](_0x39e30a(0x20d))+'\x20'+_0x244a90[_0x39e30a(0xaf)]);const _0x1ce276=_0x244a90['sections']?.[_0x39e30a(0x190)]||0x0;console[_0x39e30a(0x1db)]('\x20\x20'+a31_0x343d08[_0x39e30a(0x12a)]('sections:')+'\x20'+_0x1ce276);if(_0x244a90[_0x39e30a(0x1d9)]&&_0x244a90[_0x39e30a(0x1d9)][_0x39e30a(0x190)]>0x0)for(const _0x4160a5 of _0x244a90[_0x39e30a(0x1d9)]){console['log'](_0x39e30a(0x263)+a31_0x343d08[_0x39e30a(0x10a)](_0x4160a5[_0x39e30a(0x23b)])+'\x20'+a31_0x343d08[_0x39e30a(0x1a7)](_0x39e30a(0x1a8)+_0x4160a5['id']+')')),_0x4160a5[_0x39e30a(0x82)]&&(console[_0x39e30a(0x1db)](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x14a))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['name']),_0x4160a5[_0x39e30a(0x82)][_0x39e30a(0x128)]?.['keyEventId']&&console[_0x39e30a(0x1db)](_0x39e30a(0x208)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1af))+'\x20'+_0x4160a5[_0x39e30a(0x82)]['keyEventCriteria'][_0x39e30a(0x176)])),_0x4160a5[_0x39e30a(0x192)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x1e3))+'\x20'+JSON['stringify'](_0x4160a5['payload'])),_0x4160a5[_0x39e30a(0x9f)]&&console['log'](_0x39e30a(0x235)+a31_0x343d08[_0x39e30a(0x12a)](_0x39e30a(0x229))+_0x39e30a(0x233));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xc7);[a31_0x10c381(0x184)]=a31_0x10c381(0x11a);async[a31_0x10c381(0xa0)](_0x9c7cff){const _0x34b730=a31_0x10c381,{options:_0x506448,args:_0x2db245,tdx:_0x483722}=_0x9c7cff,_0x26a8ba=_0x2db245[0x0];if(!_0x26a8ba)return console['error'](_0x34b730(0x1c8)),console[_0x34b730(0xdd)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x34b730(0x123)+_0x26a8ba+_0x34b730(0x169),()=>_0x483722['personalization'][_0x34b730(0x164)](_0x26a8ba),{'verbose':_0x506448[_0x34b730(0x20b)]}),console['error'](_0x34b730(0x94)+_0x26a8ba+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0xbe);[a31_0x10c381(0x184)]=a31_0x10c381(0x253);async['execute'](_0x17caa2){const _0x5436e4=a31_0x10c381,{options:_0x5361e6,tdx:_0x2dae15}=_0x17caa2,_0x120035=_0x5361e6;let _0x397555;if(_0x120035[_0x5436e4(0x98)]){_0x397555=await loadJSON(_0x120035[_0x5436e4(0x98)],!![]);if(!_0x397555[_0x5436e4(0x154)]?.[_0x5436e4(0x1d8)])return console[_0x5436e4(0xdd)](_0x5436e4(0x100)),console[_0x5436e4(0xdd)](_0x5436e4(0x133)),console['error']('\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'),0x1;}else{if(!_0x120035[_0x5436e4(0x23b)])return console[_0x5436e4(0xdd)](_0x5436e4(0x18d)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)](_0x5436e4(0xe5)),0x1;if(_0x120035[_0x5436e4(0x184)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x251)),console[_0x5436e4(0xdd)](_0x5436e4(0xdb)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x120035[_0x5436e4(0x92)]===undefined)return console[_0x5436e4(0xdd)](_0x5436e4(0x1aa)),console[_0x5436e4(0xdd)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x40c6cc=_0x120035['audienceId'];if(!_0x40c6cc&&_0x5361e6[_0x5436e4(0x113)]){const _0x58e517=await withSpinner(_0x5436e4(0x252)+_0x5361e6['parentSegment']+'\x27...',()=>_0x2dae15[_0x5436e4(0x209)][_0x5436e4(0x13a)](_0x5361e6[_0x5436e4(0x113)]),{'verbose':_0x5361e6[_0x5436e4(0x20b)]});_0x40c6cc=_0x58e517[_0x5436e4(0x8b)];}let _0x5f424c;_0x120035[_0x5436e4(0x1d9)]&&(_0x5f424c=await loadJSON(_0x120035[_0x5436e4(0x1d9)],![]));const _0x5b88ca=_0x120035[_0x5436e4(0x92)]===_0x5436e4(0x195)?null:{'id':_0x120035[_0x5436e4(0x92)],'type':_0x5436e4(0x156)};_0x397555={'attributes':{'name':_0x120035['name'],'description':_0x120035[_0x5436e4(0x184)]||null,..._0x40c6cc!==undefined&&{'audienceId':_0x40c6cc},..._0x5f424c!==undefined&&{'sections':_0x5f424c}},'relationships':{'parentFolder':{'data':_0x5b88ca}}};}const _0x35f924=await withSpinner(_0x5436e4(0x1b4)+(_0x397555[_0x5436e4(0x166)]?.[_0x5436e4(0x23b)]??'')+'\x27...',()=>_0x2dae15[_0x5436e4(0x18b)][_0x5436e4(0x118)](_0x397555),{'verbose':_0x5361e6['verbose']}),_0x446d43=_0x35f924[_0x5436e4(0x8b)];return console['error'](_0x5436e4(0x1c0)+_0x446d43[_0x5436e4(0x23b)]+'\x27\x20with\x20ID:\x20'+_0x446d43['id']),await handleSDKOutput([_0x446d43],_0x5361e6),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x10c381(0x23b)]=a31_0x10c381(0x276);[a31_0x10c381(0x184)]=a31_0x10c381(0x122);async[a31_0x10c381(0xa0)](_0xa946ba){const _0x2be4e3=a31_0x10c381,{options:_0x6054af,args:_0x75a133}=_0xa946ba,_0x5c6f16=_0x6054af,_0x276e92=_0x75a133[0x0];if(!_0x276e92)return console[_0x2be4e3(0xdd)](_0x2be4e3(0x1c8)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),console[_0x2be4e3(0xdd)](_0x2be4e3(0x167)),0x1;let _0x37d924;if(_0x5c6f16[_0x2be4e3(0x98)])_0x37d924=await loadJSON(_0x5c6f16['file'],!![]);else{if(!_0x5c6f16[_0x2be4e3(0x23b)])return console[_0x2be4e3(0xdd)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x2be4e3(0xdd)](_0x2be4e3(0x254)),0x1;if(_0x5c6f16['description']===undefined)return console[_0x2be4e3(0xdd)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x2be4e3(0x254)),0x1;let _0x3b3da0;_0x5c6f16[_0x2be4e3(0x1d9)]&&(_0x3b3da0=await loadJSON(_0x5c6f16[_0x2be4e3(0x1d9)],![])),_0x37d924={'attributes':{'name':_0x5c6f16[_0x2be4e3(0x23b)],'description':_0x5c6f16[_0x2be4e3(0x184)]||null,..._0x3b3da0!==undefined&&{'sections':_0x3b3da0}}};}const {tdx:_0x222022}=_0xa946ba,_0x5b9e2e=await withSpinner('Patching\x20personalization\x20\x27'+_0x276e92+'\x27...',()=>_0x222022[_0x2be4e3(0x18b)][_0x2be4e3(0x219)](_0x276e92,_0x37d924),{'verbose':_0x6054af[_0x2be4e3(0x20b)]}),_0x16bf5a=_0x5b9e2e[_0x2be4e3(0x8b)];return console[_0x2be4e3(0xdd)]('✔\x20Updated\x20personalization\x20\x27'+_0x16bf5a[_0x2be4e3(0x23b)]+_0x2be4e3(0xa7)+_0x16bf5a['id']+')'),await handleSDKOutput([_0x16bf5a],_0x6054af),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x10c381(0x23b)]='ps:pz:init';[a31_0x10c381(0x184)]=a31_0x10c381(0x137);async[a31_0x10c381(0xa0)](_0x564bc0){const _0x570bde=a31_0x10c381,{options:_0x58e73d,args:_0x161f60}=_0x564bc0,_0x164dcf=_0x161f60[0x0]||_0x58e73d[_0x570bde(0x113)];if(!_0x164dcf)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x3a8697=resolveYamlFile(_0x164dcf);if(!existsSync(_0x3a8697))return showFileNotFoundError(_0x3a8697,_0x164dcf),0x1;let _0x4f14f2;try{_0x4f14f2=readFileSync(_0x3a8697,_0x570bde(0x20f));}catch(_0x216638){const _0x4134a5=_0x216638 instanceof Error?_0x216638[_0x570bde(0x14e)]:String(_0x216638);return console[_0x570bde(0xdd)](_0x570bde(0x1cf)+_0x4134a5),0x1;}let _0x935bc7;try{_0x935bc7=parseDef(_0x4f14f2);}catch(_0x503531){const _0x18545c=_0x503531 instanceof Error?_0x503531[_0x570bde(0x14e)]:String(_0x503531);return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x11b)](_0x570bde(0xb0)+_0x18545c)),0x1;}if(_0x935bc7[_0x570bde(0x15d)]&&_0x935bc7[_0x570bde(0x15d)]['length']>0x0)return console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x185)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0x3a8697)),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x1a7)]('\x20\x20\x20'+_0x935bc7[_0x570bde(0x15d)][_0x570bde(0x190)]+_0x570bde(0x9c))),0x1;!_0x935bc7[_0x570bde(0x193)]&&(_0x935bc7[_0x570bde(0x193)]={'events':[{'name':_0x570bde(0x1df),'source_table':_0x570bde(0x262)}],'attributes':[{'name':'last_page_viewed','type':_0x570bde(0x23f)}],'id_stitching':{'primary_key':_0x935bc7[_0x570bde(0x77)][_0x570bde(0x27e)]==='customers'?_0x570bde(0x273):_0x570bde(0x10d)}});_0x935bc7[_0x570bde(0x15d)]=[{'name':_0x570bde(0x1b9),'description':_0x570bde(0x150),'trigger_event':_0x570bde(0x1df),'sections':[{'name':'Default','criteria':_0x570bde(0x11f),'attributes':[_0x570bde(0x1e4)]}]}];const _0x38615=serializeDef(_0x935bc7);return writeFileSync(_0x3a8697,_0x38615,'utf-8'),console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x343d08[_0x570bde(0x12a)](_0x3a8697)),(!_0x935bc7['realtime']||_0x4f14f2[_0x570bde(0x204)]('realtime:')===-0x1)&&console[_0x570bde(0xdd)](a31_0x343d08[_0x570bde(0x97)]('✔')+_0x570bde(0x1d0)),console[_0x570bde(0xdd)]('\x0a'+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x24b))),console[_0x570bde(0xdd)](_0x570bde(0x1a0)+_0x3a8697+_0x570bde(0x236)),console[_0x570bde(0xdd)](_0x570bde(0x265)+a31_0x343d08[_0x570bde(0x1a7)](_0x570bde(0x15a)+_0x164dcf)+_0x570bde(0x1bd)),0x0;}}
|
|
1
|
+
const a31_0x42adf9=a31_0x4265;(function(_0x50565b,_0x550f00){const _0x5cc460=a31_0x4265,_0xbcea42=_0x50565b();while(!![]){try{const _0x5609f2=-parseInt(_0x5cc460(0x360))/0x1+parseInt(_0x5cc460(0x362))/0x2*(-parseInt(_0x5cc460(0x20f))/0x3)+parseInt(_0x5cc460(0x239))/0x4*(-parseInt(_0x5cc460(0x161))/0x5)+parseInt(_0x5cc460(0x276))/0x6+-parseInt(_0x5cc460(0x2a8))/0x7*(-parseInt(_0x5cc460(0x19f))/0x8)+parseInt(_0x5cc460(0x36f))/0x9*(-parseInt(_0x5cc460(0x30a))/0xa)+parseInt(_0x5cc460(0x1d7))/0xb;if(_0x5609f2===_0x550f00)break;else _0xbcea42['push'](_0xbcea42['shift']());}catch(_0xf958ad){_0xbcea42['push'](_0xbcea42['shift']());}}}(a31_0x3517,0x24b44));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0xd7a2f9 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x185d3c from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';function a31_0x4265(_0xd7b060,_0x49aa62){_0xd7b060=_0xd7b060-0x155;const _0x351702=a31_0x3517();let _0x426537=_0x351702[_0xd7b060];return _0x426537;}import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x42adf9(0x316),LEGACY_PARENT_SEGMENT_DIR=a31_0x42adf9(0x248);function openBrowser(_0x7b4418){const _0x1cc1dc=a31_0x42adf9,_0x3450a9=process[_0x1cc1dc(0x261)],_0x2ba458=_0x3450a9===_0x1cc1dc(0x339)?_0x1cc1dc(0x1ad):_0x3450a9===_0x1cc1dc(0x2bf)?'start':_0x1cc1dc(0x370);spawn(_0x2ba458,[_0x7b4418],{'detached':!![],'stdio':_0x1cc1dc(0x18b)})['unref']();}function migrateLegacyDirectory(){const _0xad3140=a31_0x42adf9;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x49f920=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x49f920[_0xad3140(0x27e)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xad3140(0x361)](a31_0x185d3c[_0xad3140(0x328)](_0xad3140(0x205)+LEGACY_PARENT_SEGMENT_DIR+_0xad3140(0x22c)+PARENT_SEGMENT_DIR+_0xad3140(0x2c5))),console[_0xad3140(0x361)](a31_0x185d3c[_0xad3140(0x1f2)](_0xad3140(0x1d9)+LEGACY_PARENT_SEGMENT_DIR+_0xad3140(0x329))),![];console['error'](a31_0x185d3c[_0xad3140(0x328)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xad3140(0x361)](a31_0x185d3c['green'](_0xad3140(0x2c6)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4ee0f5){const _0x163fba=_0x4ee0f5 instanceof Error?_0x4ee0f5[_0xad3140(0x1f5)]:String(_0x4ee0f5);return console[_0xad3140(0x361)](a31_0x185d3c['red'](_0xad3140(0x254)+_0x163fba+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x31f0ce){const _0x29e96f=a31_0x42adf9;return migrateLegacyDirectory(),super[_0x29e96f(0x230)](_0x31f0ce);}}function resolveYamlFile(_0x4b7b76){const _0x5154e5=a31_0x42adf9;if(_0x4b7b76[_0x5154e5(0x2a2)](_0x5154e5(0x17a))||_0x4b7b76[_0x5154e5(0x2a2)](_0x5154e5(0x35c)))return _0x4b7b76;return a31_0xd7a2f9[_0x5154e5(0x208)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4b7b76)+_0x5154e5(0x17a));}function a31_0x3517(){const _0x2ad4d2=['jsonl','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','payload:','Aborted.','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','launched','Join:','Audience\x20ID:','behavior_','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','columns','\x20\x20Tables:\x201\x20customers\x20+\x20','segment:parent:sql','Error\x20parsing\x20YAML:\x20','\x20rows)','\x20\x20\x20','Created','23656GmPAbK','\x20\x20\x20\x20-\x20','population','\x0aNew\x20parent\x20segment\x20\x27','✔\x20Deleted\x20personalization\x20service\x20\x27','events','realtime_enabled','Options:','preview','List\x20RT\x20journeys','customerPercent','Table:\x20','apply','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','open','Pause\x20activations\x20in\x20an\x20RT\x20journey','listPersonalizations','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','state','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','sourceTableError','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','Resume\x20activations\x20in\x20an\x20RT\x20journey','in\x20','\x20to\x20configure\x20your\x20personalization\x20service','eventKind:\x20','createParent','\x0aChanges\x20to\x20apply\x20to\x20\x27','ps:rt:jn:resume','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','(id:\x20','stringify','timezone','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','format','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','no\x20tokens\x20configured','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','matchedCount','\x0aError:','sort','replace','Get\x20SQL\x20query\x20for\x20parent\x20segment','✔\x20Deleted\x20token\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Creating\x20token\x20\x27','elapsedTimeMillis','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','✔\x20Updated\x20parent\x20segment\x20\x27','type','\x20service(s)\x20configured','5537466RYZddj','column','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','updateParent','segment:parent:view','segment:parent:run','ps:rt:configuration_versions','\x0a✔\x20Workflow\x20started','Database:\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20\x20','\x27...','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Resolving\x20parent\x20segment\x20\x27','personalization_services','formatSchemaJson','displayPreviewResults','some','customerGroupFile','createToken','addBehaviorsFile','filter','Creating','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','using\x20the\x20default\x20path:\x20','length','dim','toFixed','Fetching\x20current\x20configuration\x20for\x20\x27','message','ps:pz:service:create','\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}','\x20No\x20changes\x20-\x20','Show\x20a\x20specific\x20realtime\x20personalization','Listing\x20RT-enabled\x20parent\x20segments...','repeat','displayColumns','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','schemaError','Available\x20attributes:','execute','Master\x20+\x20Attributes','string','stitchingKeys','\x0a⚠️\x20\x20Both\x20','log','Error:\x20--database\x20and\x20--table\x20are\x20required','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','indexOf','Listing\x20parent\x20segments\x20matching\x20\x27','Fetching\x20behavior\x20list...','tokens','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','3ZMOohX','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','Error:\x20--name\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','identifier','List\x20parent\x20segments','\x20--behavior\x20\x22<name>\x22','getOutputDatabaseName','output','\x20field','allowed\x20IPs:','toLocaleString','No\x20personalization\x20services\x20configured','allowedIps','number','utf-8','addAttributesFile','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','start','parent_id','Validating\x20RT\x20configuration...','web','Error:','\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20jn\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20for\x20specific\x20parent\x20segment','json','/sessions/','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','/\x20and\x20','sections','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','run','double','✔\x20Updated\x20personalization\x20\x27','Attribute:','stats','/attempt/','file','Show\x20personalization\x20service\x20details','updated:','4548PybCcn','displaySummary','Rows:','ps:pz:service:show','Parent\x20segment:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Session:','\x5c$&','Creating\x20personalization\x20\x27','null','displayAttributesStats','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','/app/dw/parentSegments/','workflowSessionId','parent_segment','Create\x20parent\x20segment\x20\x27','any','verbose','ps:pz:patch','Creating\x20parent\x20segment\x20\x27','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','\x20\x20\x20\x20\x20\x20','SELECT\x20*\x20FROM\x20(\x0a','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','✔\x20Created\x20token\x20\x27','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x27\x20is\x20already\x20up\x20to\x20date','✔\x20Retrieved\x20RT\x20configuration\x20version','Attempt:','Updating','data','displayMasterInfo','errors','rowCount','sections:','valid','\x20--attribute\x20\x22','platform','segment:parent:desc','workflowAttemptId','behavior','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','SELECT\x20*\x20FROM\x20','audienceId:','ID\x20Stitching:','Fetching\x20sample\x20data...','Enriched:','deleteToken','foreignKey','ps:pz:service:token:create','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Updated','text','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x20RT\x20configuration\x20is\x20valid','joinKey','815292KpFlLs','parentFolder','public','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20configuration_versions\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20for\x20specific\x20parent\x20segment','single','attributes','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Error:\x20Service\x20name\x20is\x20required','isDirectory','Getting\x20personalization\x20\x27','\x20total','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Apply\x20changes\x20to\x20\x27','segment:parent:fields','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','segment:parent:pull','column_name','eventKind','segment:parent:update','displaySampleData','\x20is\x20already\x20up\x20to\x20date','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','status','green','Usage:\x20tdx\x20ps\x20rt\x20jn\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20RT\x20journeys\x20(requires\x20context)\x0a','Output\x20file:\x20','master','deletePersonalization','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','ps:rt:jn:list','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','ps:pz:service:list','\x27\x20is\x20up\x20to\x20date','segment:parent:validate','Overwrite\x20\x27','Site:\x20','\x20--behavior\x20\x22','user_id','\x20to\x20push\x20the\x20configuration','Executing\x20parent\x20segment\x20query...','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','✔\x20Deleted\x20personalization\x20\x27','endsWith','enriched','Fetching\x20parent\x20segment\x20\x27','test','segment:parent:push','\x20tdx\x20wf\x20attempt\x20','49MFQYgF','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Available\x20behaviors:','\x20behaviors','column_type','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','RT\x202.0:','\x20\x20Columns:\x20','\x20Added\x20RT\x202.0\x20template\x20section','Next\x20steps:','No\x20RT-enabled\x20parent\x20segments\x20found','YAML\x20file:\x20','\x0a\x20\x20]\x0a}\x0a','audienceId','Default','Error:\x20Service\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','Pattern:\x20','attributesFile','ps:rt:list','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Error\x20reading\x20file:\x20','win32','Schema\x20saved\x20to\x20','\x20Configuration\x20is\x20valid','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','coveragePercent','RT\x202.0\x20Validate:','/\x20directories\x20exist.','✔\x20Renamed\x20directory\x20to\x20','Deleting\x20personalization\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','description','keyEventId','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','list','Usage:\x20tdx\x20ps\x20pz\x20service\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','\x20parent\x20segment','session','✔\x20Found\x20','\x20Opening\x20','get','reduce','getBehaviorNames','ps:rt:jn:pause','Errors:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','behaviors','create','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','No\x20parent\x20segments\x20found','Events:','relationships','ps:pz:create','Status:','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','segment:parent:create','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','✔\x20No\x20changes\x20-\x20\x27','td_client_id','stageCount','listFields','behaviorsFile','Creating\x20personalization\x20service\x20\x27','audienceId:\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','👥\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','segment:parent:show','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','push','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x22\x20}','dirname','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','.customers)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','map','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x27\x20and\x20run\x20workflow?','Options\x20(one\x20required):\x0a','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','totalEvents','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','customers','public:','listParents','match','getParentSQL','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','✔\x20Created\x20personalization\x20service\x20\x27','cyan','\x20(paused)','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','10LdqTGb','displayRealtimeInfo','Show\x20parent\x20segment\x20schema\x20(column\x20types)','displayPreviewHints','allValid','segment:parent:preview','Join\x20on:','tdx\x20ps\x20push\x20','varchar','Master:','⚡\x20Not\x20enabled','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','parent_segments','Finding\x20service\x20for\x20token...','customersWithEvents','stop','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','information_schema','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','createdAt','\x20\x20Note:\x20','database','name','\x20--attribute\x20\x22<name>\x22','\x0aNo\x20sample\x20data\x20available','sampleData','use','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20true','yellow','/\x20directory.\x0a','entryCriteria','true','collectSchema','keyEventCriteria','Behavior:','\x20\x20\x20\x20','attribute','\x20rows\x20','Source:','limit','resumeJourney','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','customerGroup','createPersonalization','Show\x20parent\x20segment\x20details','darwin','all','Usage:\x20tdx\x20ps\x20rt\x20configuration_versions\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Get\x20RT\x20config\x20version\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','Options:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','label','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20parent\x20segment\x20\x27','value','Create\x20a\x20realtime\x20personalization\x20entity','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','FINISHED','List\x20available\x20fields\x20for\x20segmentation','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','ps:pz:init','ps:pz:list','previewParentYaml','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','status:\x20','created:','scheduleOption','keyEventId:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','personalizationServices','displayValidateResults','\x27\x20with\x20ID:\x20','To\x20cancel:','schemaValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','bold','.yaml','\x20+\x20[','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','query','282819lKojao','error','213538kvnkiE','primaryKey','last_page_viewed','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x20\x202.\x20Run\x20','realtime','\x20configured','site','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','id:\x20','table','red','855405dWKqGY','xdg-open','folderId','Update\x20a\x20realtime\x20personalization\x20entity','Delete\x20a\x20personalization\x20service','\x20--enriched','toLowerCase','\x20personalization','validateParentYaml','Validate:','tdx\x20ps\x20preview\x20','Name:\x20','Columns:','yes','parentSegment','\x20=\x20','<database>.<table>','110kyiwMp','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','pullParentYaml','trim','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','getPersonalization','idStitching','getParentFull','Personalization:','No\x20parent\x20segments\x20match\x20pattern:\x20','Analyzing\x20changes...','Fetching\x20customers\x20schema...','split','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','displayBehaviorsStats','interval','ps:pz:service:token:delete','payload','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Behaviors','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','RT\x20Journey\x20ID:\x20','realtime:','page_view','.yml','personalization','Error:\x20Personalization\x20ID\x20is\x20required','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','jobId','To\x20view\x20sample\x20data:','paused','includeSensitive','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','resolveParentId','Listing\x20RT\x20journeys\x20for\x20\x27','delete','/app/workflows/','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','pushParentYaml','scheduleType','ignore','\x22,\x20\x22type\x22:\x20\x22'];a31_0x3517=function(){return _0x2ad4d2;};return a31_0x3517();}function formatProgressMessage(_0x42d176){const _0x517013=a31_0x42adf9,_0x1af8b6=_0x42d176[_0x517013(0x303)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1af8b6){const [,_0x23bd06,_0x4be5f8,_0x4115b2='']=_0x1af8b6;return a31_0x185d3c['dim'](_0x23bd06+':')+'\x20'+_0x4be5f8+a31_0x185d3c[_0x517013(0x1f2)](_0x4115b2);}return a31_0x185d3c[_0x517013(0x1f2)](_0x42d176);}function showFileNotFoundError(_0x295aa2,_0x4263bd){const _0x45e6e1=a31_0x42adf9;console[_0x45e6e1(0x361)](a31_0x185d3c['red']('Error:\x20File\x20not\x20found:\x20'+_0x295aa2+'\x0a')),console['error'](a31_0x185d3c['cyan'](_0x45e6e1(0x309)+_0x4263bd+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x3cec95){const _0x210201=a31_0x42adf9;if(!_0x3cec95[_0x210201(0x368)])return;const _0x16efd9=_0x3cec95[_0x210201(0x368)],_0x5dbbd5=_0x16efd9['enabled']?a31_0x185d3c[_0x210201(0x28f)]('⚡\x20Enabled'):a31_0x185d3c[_0x210201(0x328)](_0x210201(0x314));console[_0x210201(0x361)]('\x0a'+a31_0x185d3c[_0x210201(0x1f2)](_0x210201(0x2af))+'\x20'+_0x5dbbd5);if(_0x16efd9[_0x210201(0x1a4)]&&_0x16efd9[_0x210201(0x1a4)][_0x210201(0x1f1)]>0x0){console['error']('\x20\x20'+a31_0x185d3c['dim'](_0x210201(0x2dd))+'\x20'+_0x16efd9['events'][_0x210201(0x1f1)]+'\x20configured');for(const _0x5ce8c4 of _0x16efd9[_0x210201(0x1a4)]){const _0x2ea24c=_0x5ce8c4['sourceTableValid']===![]?a31_0x185d3c[_0x210201(0x36e)]('✘'):a31_0x185d3c[_0x210201(0x28f)]('✔');console['error'](_0x210201(0x32f)+_0x2ea24c+'\x20'+_0x5ce8c4['name']),_0x5ce8c4[_0x210201(0x1b3)]&&console['error']('\x20\x20\x20\x20\x20\x20'+a31_0x185d3c['red'](_0x5ce8c4['sourceTableError']));}}if(_0x16efd9[_0x210201(0x27b)]&&_0x16efd9['attributes'][_0x210201(0x1f1)]>0x0){console[_0x210201(0x361)]('\x20\x20'+a31_0x185d3c[_0x210201(0x1f2)]('Attributes:')+'\x20'+_0x16efd9[_0x210201(0x27b)]['length']+_0x210201(0x369));for(const _0x37510f of _0x16efd9[_0x210201(0x27b)]){const _0x3859fa=_0x37510f[_0x210201(0x25f)]?a31_0x185d3c[_0x210201(0x28f)]('✔'):a31_0x185d3c[_0x210201(0x36e)]('✘');console[_0x210201(0x361)](_0x210201(0x32f)+_0x3859fa+'\x20'+_0x37510f[_0x210201(0x321)]+'\x20'+a31_0x185d3c[_0x210201(0x1f2)]('('+_0x37510f[_0x210201(0x1d5)]+')'));}}if(_0x16efd9['idStitching']){const _0x397c69=_0x16efd9[_0x210201(0x168)][_0x210201(0x204)]?.[_0x210201(0x1f1)]?_0x210201(0x35d)+_0x16efd9['idStitching'][_0x210201(0x204)][_0x210201(0x208)](',\x20')+']':'';console[_0x210201(0x361)]('\x20\x20'+a31_0x185d3c[_0x210201(0x1f2)](_0x210201(0x268))+'\x20'+_0x16efd9[_0x210201(0x168)][_0x210201(0x363)]+_0x397c69);}if(_0x16efd9[_0x210201(0x354)]&&_0x16efd9['personalizationServices'][_0x210201(0x1f1)]>0x0){console[_0x210201(0x361)]('\x20\x20'+a31_0x185d3c['dim'](_0x210201(0x16a))+'\x20'+_0x16efd9[_0x210201(0x354)][_0x210201(0x1f1)]+_0x210201(0x227)+(_0x16efd9[_0x210201(0x354)]['length']!==0x1?'s':''));for(const _0x32011f of _0x16efd9[_0x210201(0x354)]){console['error']('\x20\x20\x20\x20-\x20'+_0x32011f[_0x210201(0x321)]);}}}function showParentSegmentNotSetError(_0x583131){const _0x257104=a31_0x42adf9;console['error'](a31_0x185d3c[_0x257104(0x328)](_0x257104(0x221))),console[_0x257104(0x361)](_0x583131);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x42adf9(0x321)]='segment:parent:list';['description']=a31_0x42adf9(0x215);async[a31_0x42adf9(0x201)](_0x333f6d){const _0x2c56b7=a31_0x42adf9,{options:_0x51682c,args:_0x487b20,tdx:_0x23a630}=_0x333f6d,_0x262f98=_0x487b20[0x0];_0x51682c['verbose']&&(console[_0x2c56b7(0x361)]('Site:\x20'+_0x51682c[_0x2c56b7(0x36a)]),_0x262f98&&console[_0x2c56b7(0x361)](_0x2c56b7(0x2ba)+_0x262f98));const _0x5bc19f=await withSpinner(_0x262f98?_0x2c56b7(0x20b)+_0x262f98+_0x2c56b7(0x1e2):'Listing\x20parent\x20segments...',()=>_0x23a630[_0x2c56b7(0x271)][_0x2c56b7(0x302)](),{'verbose':_0x51682c['verbose']});let _0x3cdae9=_0x5bc19f[_0x2c56b7(0x25a)];if(_0x262f98){const _0x3cc56f=_0x262f98[_0x2c56b7(0x1cd)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x2c56b7(0x1cd)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x2319f2=new RegExp('^'+_0x3cc56f+'$','i');_0x3cdae9=_0x3cdae9['filter'](_0x25fade=>_0x2319f2['test'](_0x25fade[_0x2c56b7(0x27b)][_0x2c56b7(0x321)]));}_0x3cdae9[_0x2c56b7(0x1cc)]((_0x324e90,_0x40651a)=>_0x324e90['attributes'][_0x2c56b7(0x321)]['localeCompare'](_0x40651a[_0x2c56b7(0x27b)]['name'])),console[_0x2c56b7(0x361)](_0x2c56b7(0x2d0)+_0x3cdae9['length']+_0x2c56b7(0x2ce)+(_0x3cdae9[_0x2c56b7(0x1f1)]!==0x1?'s':''));const _0x2597ee=_0x58c268=>{const _0x272aa0=_0x2c56b7;return getConsoleNextUrl(_0x51682c['site'],_0x272aa0(0x246)+_0x58c268);};if(_0x51682c['format']===_0x2c56b7(0x229)||_0x51682c[_0x2c56b7(0x1c2)]===_0x2c56b7(0x18d)){const _0x426ce7=_0x3cdae9['map'](_0x47f557=>({..._0x47f557,'url':_0x2597ee(_0x47f557['id'])}));await handleSDKOutput(_0x426ce7,_0x51682c);}else{if(_0x3cdae9[_0x2c56b7(0x1f1)]===0x0)_0x262f98?console['log'](_0x2c56b7(0x16b)+_0x262f98):console[_0x2c56b7(0x206)](_0x2c56b7(0x2dc));else for(const _0x470aa5 of _0x3cdae9){const _0x2e8357=_0x470aa5['attributes'][_0x2c56b7(0x1a1)]?a31_0x185d3c[_0x2c56b7(0x1f2)]('\x20('+formatRows(_0x470aa5[_0x2c56b7(0x27b)][_0x2c56b7(0x1a1)])+')'):'',_0x5e892a=hyperlink(_0x470aa5[_0x2c56b7(0x27b)][_0x2c56b7(0x321)],_0x2597ee(_0x470aa5['id']));console['log'](_0x2c56b7(0x2ec)+_0x5e892a+_0x2e8357);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x2e2);[a31_0x42adf9(0x2c9)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x29161a){const _0x46816f=a31_0x42adf9,{options:_0x5b054c,args:_0x1dd4cf,tdx:_0x3885af}=_0x29161a;console['error'](_0x46816f(0x1c3)+_0x46816f(0x345)+_0x46816f(0x315));const _0x2d0593=_0x5b054c;if(_0x1dd4cf[_0x46816f(0x1f1)]===0x0)return console['error'](a31_0x185d3c[_0x46816f(0x36e)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x46816f(0x361)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x393ceb=_0x1dd4cf[0x0];if(!_0x2d0593['database']||!_0x2d0593[_0x46816f(0x36d)])return console['error'](_0x46816f(0x207)),console[_0x46816f(0x361)](_0x46816f(0x210)),0x1;_0x2d0593[_0x46816f(0x24b)]&&(console[_0x46816f(0x361)](_0x46816f(0x29b)+_0x2d0593['site']),console['error'](_0x46816f(0x15b)+_0x393ceb),console['error'](_0x46816f(0x1df)+_0x2d0593[_0x46816f(0x320)]),console[_0x46816f(0x361)](_0x46816f(0x1aa)+_0x2d0593[_0x46816f(0x36d)]));const _0xbf253a=await loadJSONFromOptions(_0x2d0593['attributes'],_0x2d0593[_0x46816f(0x2bb)]),_0x476006=await loadJSONFromOptions(_0x2d0593[_0x46816f(0x2d8)],_0x2d0593[_0x46816f(0x2e8)]),_0x2a10f8=await loadJSONFromOptions(_0x2d0593[_0x46816f(0x336)],_0x2d0593[_0x46816f(0x1ea)]),_0x2c2e9f={'name':_0x393ceb,'description':_0x2d0593[_0x46816f(0x2c9)],'scheduleType':_0x2d0593[_0x46816f(0x18a)],'scheduleOption':_0x2d0593[_0x46816f(0x351)],'timezone':_0x2d0593[_0x46816f(0x1c0)],'master':{'parentDatabaseName':_0x2d0593['database'],'parentTableName':_0x2d0593['table']},'attributes':_0xbf253a,'behaviors':_0x476006,'customerGroup':_0x2a10f8},_0x16a663=await withSpinner(_0x46816f(0x24d)+_0x393ceb+_0x46816f(0x1e2),()=>_0x3885af[_0x46816f(0x271)][_0x46816f(0x1b9)](_0x2c2e9f),{'verbose':_0x5b054c[_0x46816f(0x24b)]}),_0x3883d3=_0x16a663[_0x46816f(0x25a)];return console[_0x46816f(0x361)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x3883d3[_0x46816f(0x321)]+_0x46816f(0x356)+_0x3883d3['id']),await handleSDKOutput([_0x3883d3],_0x5b054c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x28a);[a31_0x42adf9(0x2c9)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a31_0x42adf9(0x201)](_0x4f171b){const _0x425217=a31_0x42adf9,{options:_0x3620cb,args:_0x2077c3,tdx:_0x5b2b1b}=_0x4f171b;console[_0x425217(0x361)](_0x425217(0x1b0)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x425217(0x315));const _0x42f990=_0x3620cb;if(_0x2077c3[_0x425217(0x1f1)]===0x0)return console[_0x425217(0x361)](a31_0x185d3c[_0x425217(0x36e)](_0x425217(0x2c8))),console[_0x425217(0x361)](_0x425217(0x252)),0x1;const _0x2a0dd8=_0x2077c3[0x0];_0x42f990[_0x425217(0x24b)]&&(console[_0x425217(0x361)](_0x425217(0x29b)+_0x42f990[_0x425217(0x36a)]),console[_0x425217(0x361)](_0x425217(0x23d)+_0x2a0dd8));const _0xfb311b=await withSpinner(_0x425217(0x1f4)+_0x2a0dd8+_0x425217(0x1e2),()=>_0x5b2b1b['segment'][_0x425217(0x169)](_0x2a0dd8),{'verbose':_0x42f990[_0x425217(0x24b)]}),_0x205e99=_0xfb311b[_0x425217(0x25a)],_0x266a4e=await loadJSONFromOptions(_0x42f990['addAttributes'],_0x42f990[_0x425217(0x220)]),_0xad1525=await loadJSONFromOptions(_0x42f990['addBehaviors'],_0x42f990[_0x425217(0x1ec)]),_0x535a2d={'name':_0x205e99[_0x425217(0x321)],'description':_0x42f990[_0x425217(0x2c9)]!==undefined?_0x42f990[_0x425217(0x2c9)]:_0x205e99[_0x425217(0x2c9)],'scheduleType':_0x42f990['scheduleType']!==undefined?_0x42f990[_0x425217(0x18a)]:_0x205e99[_0x425217(0x18a)],'scheduleOption':_0x42f990[_0x425217(0x351)]!==undefined?_0x42f990['scheduleOption']:_0x205e99[_0x425217(0x351)],'timezone':_0x42f990[_0x425217(0x1c0)]!==undefined?_0x42f990['timezone']:_0x205e99[_0x425217(0x1c0)],'master':_0x205e99[_0x425217(0x292)],'attributes':_0x266a4e?[..._0x205e99[_0x425217(0x27b)]||[],..._0x266a4e]:_0x205e99[_0x425217(0x27b)],'behaviors':_0xad1525?[..._0x205e99[_0x425217(0x2d8)]||[],..._0xad1525]:_0x205e99[_0x425217(0x2d8)],'customerGroup':_0x205e99['customerGroup']},_0x339e8c=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x2a0dd8+_0x425217(0x1e2),()=>_0x5b2b1b['segment'][_0x425217(0x1da)](_0x2a0dd8,_0x535a2d),{'verbose':_0x42f990[_0x425217(0x24b)]}),_0x885d55=_0x339e8c[_0x425217(0x25a)];return console[_0x425217(0x361)](_0x425217(0x1d4)+_0x885d55['name']+'\x27'),await handleSDKOutput([_0x885d55],_0x42f990),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a31_0x42adf9(0x287);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x2ed);async[a31_0x42adf9(0x201)](_0x429127){const _0x565f07=a31_0x42adf9,{options:_0x269096,args:_0x947c2a,tdx:_0x1d31f5}=_0x429127,_0x2ba760=_0x269096,_0x25cff2=_0x947c2a[0x0]||_0x269096[_0x565f07(0x15e)];if(!_0x25cff2)return showParentSegmentNotSetError(_0x565f07(0x1e0)+_0x565f07(0x353)),0x1;if(_0x2ba760[_0x565f07(0x325)]&&_0x2ba760[_0x565f07(0x218)])return console[_0x565f07(0x361)](a31_0x185d3c['red'](_0x565f07(0x18f))),console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x1f2)](_0x565f07(0x2c2))),console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x1f2)](_0x565f07(0x1f0)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x565f07(0x361)](a31_0x185d3c['cyan'](_0x565f07(0x2cb))),0x1;const _0x5015f3=_0x2ba760[_0x565f07(0x218)]||a31_0xd7a2f9['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x25cff2)+'.yml');_0x2ba760[_0x565f07(0x24b)]&&(console[_0x565f07(0x361)]('Site:\x20'+_0x2ba760['site']),console[_0x565f07(0x361)](_0x565f07(0x23d)+_0x25cff2),console[_0x565f07(0x361)](_0x565f07(0x291)+_0x5015f3));const _0x51b6f3=await withSpinner(_0x565f07(0x2a4)+_0x25cff2+_0x565f07(0x1e2),()=>_0x1d31f5['segment'][_0x565f07(0x164)](_0x25cff2),{'verbose':_0x2ba760['verbose']}),_0x364744=_0x51b6f3[_0x565f07(0x25a)];if(existsSync(_0x5015f3)){const _0x3ce17b=readFileSync(_0x5015f3,_0x565f07(0x21f)),_0x2875b7=generateDiff(_0x3ce17b,_0x364744);if(!hasChanges(_0x2875b7))console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x28f)]('✔')+_0x565f07(0x1f8)+a31_0x185d3c[_0x565f07(0x307)](_0x5015f3)+_0x565f07(0x28c));else{console[_0x565f07(0x361)]('\x0aChanges\x20to\x20\x27'+_0x5015f3+'\x27:'),console[_0x565f07(0x361)]('─'[_0x565f07(0x1fb)](0x3c)),console[_0x565f07(0x361)](formatDiffWithColors(_0x2875b7)),console[_0x565f07(0x361)]('─'[_0x565f07(0x1fb)](0x3c));if(!_0x2ba760['yes']){if(!isInteractive())return console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x36e)]('\x0aError:'),_0x565f07(0x163)),console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x1f2)](_0x565f07(0x294))),0x1;const _0x174139=await confirmKey(_0x565f07(0x29a)+_0x5015f3+'\x27?');if(!_0x174139)return console[_0x565f07(0x361)](a31_0x185d3c['yellow'](_0x565f07(0x191))),0x1;}writeFileSync(_0x5015f3,_0x364744,_0x565f07(0x21f)),console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x28f)]('✔')+_0x565f07(0x2a9)+a31_0x185d3c[_0x565f07(0x307)](_0x5015f3));}}else{const _0x48af92=a31_0xd7a2f9[_0x565f07(0x2f4)](_0x5015f3);!existsSync(_0x48af92)&&mkdirSync(_0x48af92,{'recursive':!![]}),writeFileSync(_0x5015f3,_0x364744,'utf-8'),console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x28f)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x185d3c[_0x565f07(0x307)](_0x5015f3));}return saveSessionContext({'parent_segment':_0x25cff2},_0x2ba760[_0x565f07(0x2cf)]),console[_0x565f07(0x361)](a31_0x185d3c[_0x565f07(0x28f)]('✔')+'\x20Context\x20set:\x20'+a31_0x185d3c[_0x565f07(0x1f2)]('parent_segment')+_0x565f07(0x15f)+a31_0x185d3c['cyan'](_0x25cff2)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x2a6);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x2f9);async[a31_0x42adf9(0x201)](_0x3ac8ad){const _0x4f2e0f=a31_0x42adf9,{options:_0xf4f192,args:_0x4badfb,tdx:_0x2d60b5}=_0x3ac8ad,_0x1118da=_0xf4f192,_0x2586af=_0x4badfb[0x0]||_0xf4f192['parentSegment'];if(!_0x2586af)return showParentSegmentNotSetError(_0x4f2e0f(0x1fd)+_0x4f2e0f(0x255)),0x1;const _0x4a0eaa=resolveYamlFile(_0x2586af);if(!existsSync(_0x4a0eaa))return showFileNotFoundError(_0x4a0eaa,_0x2586af),0x1;_0x1118da[_0x4f2e0f(0x24b)]&&(console['error']('Site:\x20'+_0x1118da[_0x4f2e0f(0x36a)]),console[_0x4f2e0f(0x361)](_0x4f2e0f(0x2b4)+_0x4a0eaa));let _0x52204c;try{_0x52204c=readFileSync(_0x4a0eaa,'utf-8');}catch(_0x57197b){const _0x2ac0b2=_0x57197b instanceof Error?_0x57197b['message']:String(_0x57197b);return console[_0x4f2e0f(0x361)](_0x4f2e0f(0x2be)+_0x2ac0b2),0x1;}const _0x2c49f3=await withSpinner(_0x4f2e0f(0x16c),()=>_0x2d60b5['segment'][_0x4f2e0f(0x189)](_0x52204c),{'verbose':_0x1118da['verbose']}),_0x1cd9f4=_0x2c49f3[_0x4f2e0f(0x25a)],{isNew:_0x58817b,name:_0x2c88d5,hasChanges:_0x52f2d4,diffFormatted:_0xaeb256}=_0x1cd9f4;if(!_0x52f2d4)return console[_0x4f2e0f(0x361)]('✔\x20No\x20changes\x20-\x20\x27'+_0x2c88d5+_0x4f2e0f(0x256)),0x0;_0x58817b?console['error'](_0x4f2e0f(0x1a2)+_0x2c88d5+'\x27:'):console['error']('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x2c88d5+'\x27:');console[_0x4f2e0f(0x361)]('─'[_0x4f2e0f(0x1fb)](0x3c)),console[_0x4f2e0f(0x361)](_0xaeb256),console[_0x4f2e0f(0x361)]('─'[_0x4f2e0f(0x1fb)](0x3c));const _0x42e02e=_0x58817b?_0x4f2e0f(0x249)+_0x2c88d5+'\x27?':_0x4f2e0f(0x284)+_0x2c88d5+'\x27?';if(!_0x1118da[_0x4f2e0f(0x15d)]){if(!isInteractive())return console[_0x4f2e0f(0x361)](a31_0x185d3c[_0x4f2e0f(0x36e)](_0x4f2e0f(0x1cb)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a31_0x185d3c[_0x4f2e0f(0x1f2)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x28a961=await confirmKey(_0x42e02e);if(!_0x28a961)return console[_0x4f2e0f(0x361)](a31_0x185d3c[_0x4f2e0f(0x328)]('Aborted.')),0x1;}const _0x2807b6=_0x58817b?_0x4f2e0f(0x1ee):_0x4f2e0f(0x259),_0x495f31=await withSpinner(_0x2807b6+_0x4f2e0f(0x342)+_0x2c88d5+_0x4f2e0f(0x1e2),()=>_0x1cd9f4[_0x4f2e0f(0x1ab)](),{'verbose':_0x1118da['verbose']}),_0x521eef=_0x495f31[_0x4f2e0f(0x25a)],_0x48814f=getConsoleNextUrl(_0x1118da[_0x4f2e0f(0x36a)],'/app/dw/parentSegments/'+_0x521eef['id']),_0x484f76=_0x58817b?_0x4f2e0f(0x19e):_0x4f2e0f(0x26f);return console[_0x4f2e0f(0x361)]('✔\x20'+_0x484f76+'\x20parent\x20segment\x20\x27'+_0x521eef[_0x4f2e0f(0x321)]+'\x27'),console['error']('\x20\x20'+_0x48814f),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x299);[a31_0x42adf9(0x2c9)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a31_0x42adf9(0x201)](_0x5cd86f){const _0x5ad538=a31_0x42adf9,{options:_0x406b6c,args:_0x47a047,tdx:_0x3ddfd7}=_0x5cd86f,_0x2254bb=_0x406b6c,_0x4de0a9=_0x47a047[0x0]||_0x406b6c[_0x5ad538(0x15e)];if(!_0x4de0a9)return showParentSegmentNotSetError(_0x5ad538(0x176)+_0x5ad538(0x1e4)+_0x5ad538(0x33d)+_0x5ad538(0x162)+_0x5ad538(0x1c5)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x1acfe8=resolveYamlFile(_0x4de0a9);if(!existsSync(_0x1acfe8))return showFileNotFoundError(_0x1acfe8,_0x4de0a9),0x1;_0x2254bb[_0x5ad538(0x24b)]&&(console['error'](_0x5ad538(0x29b)+_0x2254bb[_0x5ad538(0x36a)]),console[_0x5ad538(0x361)]('YAML\x20file:\x20'+_0x1acfe8));let _0x1f02a8;try{_0x1f02a8=readFileSync(_0x1acfe8,'utf-8');}catch(_0x1bf04b){const _0xdb323a=_0x1bf04b instanceof Error?_0x1bf04b[_0x5ad538(0x1f5)]:String(_0x1bf04b);return console['error'](_0x5ad538(0x2be)+_0xdb323a),0x1;}const _0x26e8cf=createCommandSpinner(a31_0x185d3c['dim']('Validating\x20configuration...'),{'verbose':_0x2254bb['verbose']});_0x26e8cf[_0x5ad538(0x222)]();const _0x3e4d3e={'onProgress':_0x61beac=>{const _0x519af3=_0x5ad538;_0x26e8cf[_0x519af3(0x270)]=formatProgressMessage(_0x61beac);}};if(_0x2254bb['master'])_0x3e4d3e[_0x5ad538(0x292)]=!![];if(_0x2254bb[_0x5ad538(0x2a3)])_0x3e4d3e[_0x5ad538(0x2a3)]=!![];_0x2254bb['attribute']&&(_0x3e4d3e[_0x5ad538(0x330)]=_0x2254bb[_0x5ad538(0x330)]);_0x2254bb[_0x5ad538(0x264)]&&(_0x3e4d3e[_0x5ad538(0x264)]=_0x2254bb['behavior']);if(_0x2254bb['interval'])_0x3e4d3e['interval']=_0x2254bb[_0x5ad538(0x171)];let _0x22e6eb;try{_0x22e6eb=await _0x3ddfd7[_0x5ad538(0x271)][_0x5ad538(0x158)](_0x1f02a8,_0x3e4d3e),_0x26e8cf[_0x5ad538(0x319)]();}catch(_0x49fe18){_0x26e8cf[_0x5ad538(0x319)]();throw _0x49fe18;}const _0x62f941=_0x2254bb['interval']||'-1d';return this[_0x5ad538(0x355)](_0x22e6eb,_0x3e4d3e,_0x1acfe8,_0x62f941),_0x22e6eb['allValid']?0x0:0x1;}[a31_0x42adf9(0x355)](_0x38fdb3,_0x13715c,_0x475b89,_0x4c2f7a){const _0x14471e=a31_0x42adf9;console[_0x14471e(0x361)]('\x0a'+a31_0x185d3c['bold'](_0x14471e(0x159))+'\x20'+_0x38fdb3[_0x14471e(0x321)]),console[_0x14471e(0x361)]('═'['repeat'](0x3c)),this[_0x14471e(0x25b)](_0x38fdb3);if(typeof _0x13715c['attribute']===_0x14471e(0x203)){this['displayAttributesStats'](_0x38fdb3),this['displaySummary'](_0x38fdb3),this[_0x14471e(0x30d)](_0x475b89,_0x4c2f7a,'attribute',_0x13715c['attribute']);return;}if(_0x13715c[_0x14471e(0x330)]===!![]){this[_0x14471e(0x244)](_0x38fdb3),this[_0x14471e(0x23a)](_0x38fdb3),this[_0x14471e(0x30d)](_0x475b89,_0x4c2f7a,'attributes');return;}if(typeof _0x13715c[_0x14471e(0x264)]===_0x14471e(0x203)){this[_0x14471e(0x170)](_0x38fdb3,_0x4c2f7a),this[_0x14471e(0x23a)](_0x38fdb3),this[_0x14471e(0x30d)](_0x475b89,_0x4c2f7a,'behavior',_0x13715c['behavior']);return;}if(_0x13715c[_0x14471e(0x264)]===!![]){this[_0x14471e(0x170)](_0x38fdb3,_0x4c2f7a),this[_0x14471e(0x23a)](_0x38fdb3),this['displayPreviewHints'](_0x475b89,_0x4c2f7a,_0x14471e(0x2d8));return;}this['displayAttributesStats'](_0x38fdb3),this[_0x14471e(0x170)](_0x38fdb3,_0x4c2f7a),this[_0x14471e(0x30b)](_0x38fdb3),this[_0x14471e(0x23a)](_0x38fdb3),this[_0x14471e(0x30d)](_0x475b89,_0x4c2f7a,_0x14471e(0x33a));}['displayRealtimeInfo'](_0x556b00){displayRealtimeValidation(_0x556b00);}['displayPreviewHints'](_0x529014,_0x2ee4e8,_0x182431,_0x5dc756){const _0x537be1=a31_0x42adf9;console[_0x537be1(0x361)]('\x0a'+a31_0x185d3c[_0x537be1(0x1f2)](_0x537be1(0x17f)));const _0xe10052=_0x2ee4e8!=='-1d'?'\x20--interval\x20'+_0x2ee4e8:'';if(_0x182431==='attribute'&&_0x5dc756)console[_0x537be1(0x361)]('\x20\x20'+a31_0x185d3c[_0x537be1(0x1f2)]('tdx\x20ps\x20preview\x20'+_0x529014+_0x537be1(0x260)+_0x5dc756+'\x22'+_0xe10052));else{if(_0x182431===_0x537be1(0x264)&&_0x5dc756)console[_0x537be1(0x361)]('\x20\x20'+a31_0x185d3c['dim'](_0x537be1(0x15a)+_0x529014+_0x537be1(0x29c)+_0x5dc756+'\x22'+_0xe10052));else(_0x182431===_0x537be1(0x27b)||_0x182431===_0x537be1(0x33a))&&console['error']('\x20\x20'+a31_0x185d3c[_0x537be1(0x1f2)]('tdx\x20ps\x20preview\x20'+_0x529014+_0x537be1(0x322)+_0xe10052));}(_0x182431===_0x537be1(0x2d8)||_0x182431===_0x537be1(0x33a))&&console[_0x537be1(0x361)]('\x20\x20'+a31_0x185d3c[_0x537be1(0x1f2)](_0x537be1(0x15a)+_0x529014+_0x537be1(0x216)+_0xe10052)),_0x182431==='all'&&console['error']('\x20\x20'+a31_0x185d3c[_0x537be1(0x1f2)](_0x537be1(0x15a)+_0x529014+_0x537be1(0x155)+_0xe10052));}[a31_0x42adf9(0x25b)](_0x2a14ea){const _0x442874=a31_0x42adf9,{master:_0x26d612}=_0x2a14ea,_0x4d3989=_0x26d612[_0x442874(0x358)]?a31_0x185d3c[_0x442874(0x28f)]('✔'):a31_0x185d3c['red']('✘');console[_0x442874(0x361)]('\x0a'+a31_0x185d3c[_0x442874(0x1f2)]('Master\x20Table')),console[_0x442874(0x361)](_0x4d3989+'\x20'+a31_0x185d3c[_0x442874(0x35b)](_0x26d612['database']+'.'+_0x26d612[_0x442874(0x36d)])),_0x26d612[_0x442874(0x358)]?_0x26d612[_0x442874(0x25d)]!==undefined&&console[_0x442874(0x361)]('\x20\x20'+a31_0x185d3c['dim'](_0x442874(0x23b))+'\x20'+a31_0x185d3c['cyan'](formatRows(_0x26d612[_0x442874(0x25d)]))):console[_0x442874(0x361)]('\x20\x20'+a31_0x185d3c[_0x442874(0x36e)](_0x442874(0x226))+'\x20'+_0x26d612[_0x442874(0x1ff)]);}[a31_0x42adf9(0x244)](_0x4f7a73){const _0x37fe29=a31_0x42adf9;if(_0x4f7a73[_0x37fe29(0x27b)][_0x37fe29(0x1f1)]===0x0)return;console[_0x37fe29(0x361)]('\x0a'+a31_0x185d3c['dim']('Attributes'));for(const _0xed3ed7 of _0x4f7a73[_0x37fe29(0x27b)]){const _0x49e367=_0xed3ed7[_0x37fe29(0x358)]?a31_0x185d3c[_0x37fe29(0x28f)]('✔'):a31_0x185d3c[_0x37fe29(0x36e)]('✘');let _0x43759f='';if(_0xed3ed7[_0x37fe29(0x358)]&&_0xed3ed7[_0x37fe29(0x1ca)]!==undefined&&_0xed3ed7[_0x37fe29(0x2c3)]!==undefined){const _0xe238b0=_0xed3ed7[_0x37fe29(0x2c3)][_0x37fe29(0x1f3)](0x1),_0x1354b4=_0xed3ed7[_0x37fe29(0x2c3)]>=0x50?a31_0x185d3c['green']:_0xed3ed7[_0x37fe29(0x2c3)]>=0x32?a31_0x185d3c[_0x37fe29(0x328)]:a31_0x185d3c['red'];_0x43759f='\x20'+a31_0x185d3c[_0x37fe29(0x1f2)]('Coverage:')+'\x20'+_0x1354b4(_0xe238b0+'%')+'\x20('+formatRows(_0xed3ed7[_0x37fe29(0x1ca)])+_0x37fe29(0x19c);}console[_0x37fe29(0x361)](_0x49e367+'\x20'+a31_0x185d3c[_0x37fe29(0x35b)](_0xed3ed7['name'])+_0x43759f),console[_0x37fe29(0x361)]('\x20\x20'+a31_0x185d3c['dim']('Source:')+'\x20'+a31_0x185d3c[_0x37fe29(0x35b)](_0xed3ed7['database']+'.'+_0xed3ed7['table']));const _0x521bf8=_0xed3ed7[_0x37fe29(0x275)]===_0xed3ed7['foreignKey']?a31_0x185d3c['dim'](_0x37fe29(0x310))+'\x20'+_0xed3ed7['joinKey']:a31_0x185d3c[_0x37fe29(0x1f2)](_0x37fe29(0x194))+'\x20'+_0xed3ed7['joinKey']+_0x37fe29(0x15f)+_0xed3ed7['foreignKey'];console['error']('\x20\x20'+_0x521bf8),console[_0x37fe29(0x361)]('\x20\x20'+a31_0x185d3c[_0x37fe29(0x1f2)](_0x37fe29(0x15c))),this[_0x37fe29(0x1fc)](_0xed3ed7[_0x37fe29(0x198)]),!_0xed3ed7[_0x37fe29(0x358)]&&console[_0x37fe29(0x361)]('\x20\x20'+a31_0x185d3c[_0x37fe29(0x36e)](_0x37fe29(0x226))+'\x20'+_0xed3ed7[_0x37fe29(0x1ff)]);}}[a31_0x42adf9(0x170)](_0x11c730,_0x3b454a){const _0x41f330=a31_0x42adf9;if(_0x11c730[_0x41f330(0x2d8)][_0x41f330(0x1f1)]===0x0)return;console[_0x41f330(0x361)]('\x0a'+a31_0x185d3c[_0x41f330(0x1f2)](_0x41f330(0x175))+'\x20'+a31_0x185d3c[_0x41f330(0x1f2)]('('+_0x3b454a+')'));for(const _0xc86e0a of _0x11c730[_0x41f330(0x2d8)]){const _0x28ebfc=_0xc86e0a[_0x41f330(0x358)]?a31_0x185d3c['green']('✔'):a31_0x185d3c[_0x41f330(0x36e)]('✘');let _0x3ee0f7='';if(_0xc86e0a['schemaValid']&&_0xc86e0a[_0x41f330(0x318)]!==undefined&&_0xc86e0a[_0x41f330(0x2fe)]!==undefined){const _0x49c22f=_0xc86e0a[_0x41f330(0x1a9)]?.[_0x41f330(0x1f3)](0x1)||'?',_0xfeb62f=(_0xc86e0a[_0x41f330(0x1a9)]??0x0)>=0x32?a31_0x185d3c[_0x41f330(0x28f)]:(_0xc86e0a[_0x41f330(0x1a9)]??0x0)>=0x14?a31_0x185d3c['yellow']:a31_0x185d3c[_0x41f330(0x36e)];_0x3ee0f7='\x20'+a31_0x185d3c['dim']('Customers:')+'\x20'+_0xfeb62f(formatRows(_0xc86e0a['customersWithEvents']))+'\x20('+_0x49c22f+'%)\x20'+a31_0x185d3c['dim'](_0x41f330(0x2dd))+'\x20'+a31_0x185d3c[_0x41f330(0x307)](formatRows(_0xc86e0a[_0x41f330(0x2fe)]));}console['error'](_0x28ebfc+'\x20'+a31_0x185d3c[_0x41f330(0x35b)](_0xc86e0a[_0x41f330(0x321)])+_0x3ee0f7),console['error']('\x20\x20'+a31_0x185d3c[_0x41f330(0x1f2)](_0x41f330(0x332))+'\x20'+a31_0x185d3c[_0x41f330(0x35b)](_0xc86e0a['database']+'.'+_0xc86e0a[_0x41f330(0x36d)]));const _0x45c609=_0xc86e0a[_0x41f330(0x275)]===_0xc86e0a[_0x41f330(0x26c)]?a31_0x185d3c[_0x41f330(0x1f2)]('Join\x20on:')+'\x20'+_0xc86e0a[_0x41f330(0x275)]:a31_0x185d3c[_0x41f330(0x1f2)](_0x41f330(0x194))+'\x20'+_0xc86e0a[_0x41f330(0x275)]+_0x41f330(0x15f)+_0xc86e0a[_0x41f330(0x26c)];console[_0x41f330(0x361)]('\x20\x20'+_0x45c609),console[_0x41f330(0x361)]('\x20\x20'+a31_0x185d3c['dim'](_0x41f330(0x15c))),this[_0x41f330(0x1fc)](_0xc86e0a['columns']),!_0xc86e0a[_0x41f330(0x358)]&&console[_0x41f330(0x361)]('\x20\x20'+a31_0x185d3c[_0x41f330(0x36e)](_0x41f330(0x226))+'\x20'+_0xc86e0a['schemaError']);}}[a31_0x42adf9(0x1fc)](_0x2e7324){const _0x1388cc=a31_0x42adf9;for(const _0x424c29 of _0x2e7324){_0x424c29[_0x1388cc(0x33f)]===_0x424c29[_0x1388cc(0x1d8)]||_0x424c29['column']==='*'?console[_0x1388cc(0x361)](_0x1388cc(0x1a0)+_0x424c29[_0x1388cc(0x33f)]):console[_0x1388cc(0x361)](_0x1388cc(0x1a0)+_0x424c29[_0x1388cc(0x33f)]+'\x20'+a31_0x185d3c[_0x1388cc(0x1f2)]('('+_0x424c29['column']+')'));}}[a31_0x42adf9(0x23a)](_0x443d36){const _0x4f1c09=a31_0x42adf9;console['error']('─'[_0x4f1c09(0x1fb)](0x3c));if(_0x443d36[_0x4f1c09(0x25c)][_0x4f1c09(0x1f1)]>0x0){console['error']('\x0a'+a31_0x185d3c[_0x4f1c09(0x36e)](_0x4f1c09(0x2d6)));for(const _0x482073 of _0x443d36[_0x4f1c09(0x25c)]){console[_0x4f1c09(0x361)]('\x20\x20'+a31_0x185d3c[_0x4f1c09(0x36e)]('•')+'\x20'+_0x482073);}}_0x443d36[_0x4f1c09(0x30e)]&&console[_0x4f1c09(0x361)]('\x0a'+a31_0x185d3c[_0x4f1c09(0x28f)]('✔')+_0x4f1c09(0x2c1));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a31_0x42adf9(0x30f);['description']=a31_0x42adf9(0x35a);async[a31_0x42adf9(0x201)](_0x10bafc){const _0x3f0d57=a31_0x42adf9,{options:_0x5306e9,args:_0x910c0b,tdx:_0x298697}=_0x10bafc,_0x4b1348=_0x5306e9,_0x6ebef5=_0x910c0b[0x0]||_0x5306e9[_0x3f0d57(0x15e)];if(!_0x6ebef5)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x3f0d57(0x2fc)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x3f0d57(0x1b2)+_0x3f0d57(0x166)+_0x3f0d57(0x1bd)),0x1;if(!_0x4b1348[_0x3f0d57(0x292)]&&!_0x4b1348[_0x3f0d57(0x330)]&&!_0x4b1348['behavior']&&!_0x4b1348[_0x3f0d57(0x2a3)])return console[_0x3f0d57(0x361)](a31_0x185d3c['red'](_0x3f0d57(0x1c6))),console[_0x3f0d57(0x361)](_0x3f0d57(0x2f5)),console[_0x3f0d57(0x361)](_0x3f0d57(0x1a6)),console[_0x3f0d57(0x361)](_0x3f0d57(0x27c)),console[_0x3f0d57(0x361)](_0x3f0d57(0x305)),console[_0x3f0d57(0x361)](_0x3f0d57(0x340)),console[_0x3f0d57(0x361)](_0x3f0d57(0x182)),0x1;const _0x4822f8=resolveYamlFile(_0x6ebef5);if(!existsSync(_0x4822f8))return showFileNotFoundError(_0x4822f8,_0x6ebef5),0x1;_0x4b1348[_0x3f0d57(0x24b)]&&(console['error'](_0x3f0d57(0x29b)+_0x4b1348[_0x3f0d57(0x36a)]),console[_0x3f0d57(0x361)](_0x3f0d57(0x2b4)+_0x4822f8));let _0x347e56;try{_0x347e56=readFileSync(_0x4822f8,_0x3f0d57(0x21f));}catch(_0x1daad7){const _0x1ff2d0=_0x1daad7 instanceof Error?_0x1daad7[_0x3f0d57(0x1f5)]:String(_0x1daad7);return console['error'](_0x3f0d57(0x2be)+_0x1ff2d0),0x1;}let _0x29f177;try{_0x29f177=parseDef(_0x347e56);}catch(_0xf38612){const _0x5d98ab=_0xf38612 instanceof Error?_0xf38612[_0x3f0d57(0x1f5)]:String(_0xf38612);return console['error'](a31_0x185d3c[_0x3f0d57(0x36e)](_0x3f0d57(0x19b)+_0x5d98ab)),0x1;}if(_0x4b1348['attribute']===!![]||_0x4b1348[_0x3f0d57(0x330)]===''){const _0x149a25=_0x29f177[_0x3f0d57(0x27b)]?.['map'](_0x23c3a7=>_0x23c3a7[_0x3f0d57(0x321)])||[];if(_0x149a25[_0x3f0d57(0x1f1)]===0x0)console[_0x3f0d57(0x361)](a31_0x185d3c[_0x3f0d57(0x36e)](_0x3f0d57(0x365)));else{console[_0x3f0d57(0x361)](a31_0x185d3c['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x3f0d57(0x361)](_0x3f0d57(0x200));for(const _0x15d292 of _0x149a25){console[_0x3f0d57(0x361)]('\x20\x20'+a31_0x185d3c[_0x3f0d57(0x307)](_0x15d292));}console[_0x3f0d57(0x361)](_0x3f0d57(0x2ae)+_0x6ebef5+_0x3f0d57(0x260)+_0x149a25[0x0]+'\x22');}return 0x1;}if(_0x4b1348[_0x3f0d57(0x264)]===!![]||_0x4b1348[_0x3f0d57(0x264)]===''){const _0x301ed5=_0x29f177[_0x3f0d57(0x2d8)]?.['map'](_0x5abba4=>_0x5abba4['name'])||[];if(_0x301ed5['length']===0x0)console[_0x3f0d57(0x361)](a31_0x185d3c[_0x3f0d57(0x36e)](_0x3f0d57(0x296)));else{console['error'](a31_0x185d3c[_0x3f0d57(0x36e)](_0x3f0d57(0x1bc))),console[_0x3f0d57(0x361)](_0x3f0d57(0x2aa));for(const _0x24e37c of _0x301ed5){console['error']('\x20\x20'+a31_0x185d3c[_0x3f0d57(0x307)](_0x24e37c));}console[_0x3f0d57(0x361)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x6ebef5+_0x3f0d57(0x29c)+_0x301ed5[0x0]+'\x22');}return 0x1;}const _0xac0727=createCommandSpinner(a31_0x185d3c[_0x3f0d57(0x1f2)](_0x3f0d57(0x269)),{'verbose':_0x4b1348[_0x3f0d57(0x24b)]});_0xac0727[_0x3f0d57(0x222)]();const _0x474053={'onProgress':_0x18f01c=>{const _0x766ea9=_0x3f0d57;_0xac0727[_0x766ea9(0x270)]=formatProgressMessage(_0x18f01c);}};if(_0x4b1348[_0x3f0d57(0x292)])_0x474053[_0x3f0d57(0x292)]=!![];if(_0x4b1348[_0x3f0d57(0x330)]&&typeof _0x4b1348['attribute']===_0x3f0d57(0x203))_0x474053[_0x3f0d57(0x330)]=_0x4b1348['attribute'];if(_0x4b1348['behavior']&&typeof _0x4b1348[_0x3f0d57(0x264)]==='string')_0x474053['behavior']=_0x4b1348[_0x3f0d57(0x264)];if(_0x4b1348[_0x3f0d57(0x2a3)])_0x474053[_0x3f0d57(0x2a3)]=!![];if(_0x4b1348[_0x3f0d57(0x171)])_0x474053[_0x3f0d57(0x171)]=_0x4b1348[_0x3f0d57(0x171)];let _0x12bf0f;try{_0x12bf0f=await _0x298697[_0x3f0d57(0x271)][_0x3f0d57(0x34c)](_0x347e56,_0x474053),_0xac0727[_0x3f0d57(0x319)]();}catch(_0x84ffc8){_0xac0727[_0x3f0d57(0x319)]();throw _0x84ffc8;}return await this[_0x3f0d57(0x1e8)](_0x12bf0f,{'master':_0x4b1348[_0x3f0d57(0x292)],'attribute':typeof _0x4b1348[_0x3f0d57(0x330)]==='string'?_0x4b1348[_0x3f0d57(0x330)]:undefined,'behavior':typeof _0x4b1348[_0x3f0d57(0x264)]===_0x3f0d57(0x203)?_0x4b1348[_0x3f0d57(0x264)]:undefined,'enriched':_0x4b1348['enriched']}),_0x12bf0f[_0x3f0d57(0x30e)]?0x0:0x1;}async[a31_0x42adf9(0x1e8)](_0x4ba52b,_0xd4d556){const _0x284094=a31_0x42adf9;console[_0x284094(0x361)]('\x0a'+a31_0x185d3c[_0x284094(0x35b)]('Preview:')+'\x20'+_0x4ba52b[_0x284094(0x321)]),console[_0x284094(0x361)]('═'['repeat'](0x3c));if(_0xd4d556['master']&&_0x4ba52b['sampleData']){const _0x22ee7b=a31_0x185d3c[_0x284094(0x1f2)](_0x284094(0x313))+'\x20'+a31_0x185d3c[_0x284094(0x35b)](_0x4ba52b[_0x284094(0x292)][_0x284094(0x320)]+'.'+_0x4ba52b['master'][_0x284094(0x36d)]);await this[_0x284094(0x28b)](_0x22ee7b,_0x4ba52b[_0x284094(0x324)]);}else{if(_0xd4d556[_0x284094(0x330)]&&_0x4ba52b['sampleData']){const _0x4cb336=a31_0x185d3c[_0x284094(0x1f2)](_0x284094(0x233))+'\x20'+a31_0x185d3c['bold'](_0xd4d556[_0x284094(0x330)]);await this[_0x284094(0x28b)](_0x4cb336,_0x4ba52b[_0x284094(0x324)]);}else{if(_0xd4d556[_0x284094(0x264)]&&_0x4ba52b['sampleData']){const _0x566e9c=a31_0x185d3c[_0x284094(0x1f2)](_0x284094(0x32e))+'\x20'+a31_0x185d3c[_0x284094(0x35b)](_0xd4d556[_0x284094(0x264)]);await this[_0x284094(0x28b)](_0x566e9c,_0x4ba52b[_0x284094(0x324)]);}else{if(_0xd4d556[_0x284094(0x2a3)]&&_0x4ba52b[_0x284094(0x324)]){const _0x22687c=a31_0x185d3c['dim'](_0x284094(0x26a))+'\x20'+a31_0x185d3c[_0x284094(0x35b)](_0x284094(0x202));await this[_0x284094(0x28b)](_0x22687c,_0x4ba52b[_0x284094(0x324)]);}else!_0x4ba52b[_0x284094(0x324)]&&console[_0x284094(0x361)](_0x284094(0x323));}}}if(_0x4ba52b[_0x284094(0x25c)][_0x284094(0x1f1)]>0x0){console['error']('─'['repeat'](0x3c)),console[_0x284094(0x361)]('\x0a'+a31_0x185d3c[_0x284094(0x36e)](_0x284094(0x2d6)));for(const _0x335f41 of _0x4ba52b[_0x284094(0x25c)]){console[_0x284094(0x361)]('\x20\x20'+a31_0x185d3c[_0x284094(0x36e)]('•')+'\x20'+_0x335f41);}}}async[a31_0x42adf9(0x28b)](_0x59453f,_0x32199a){const _0x3a9152=a31_0x42adf9;if(_0x32199a[_0x3a9152(0x1f1)]===0x0){console[_0x3a9152(0x361)]('\x0a'+_0x59453f),console[_0x3a9152(0x361)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x3a9152(0x361)]('\x0a'+_0x59453f);const _0x1ff080=Object['keys'](_0x32199a[0x0])[_0x3a9152(0x2f8)](_0x1bd8bb=>({'name':_0x1bd8bb,'type':typeof _0x32199a[0x0][_0x1bd8bb]===_0x3a9152(0x21e)?_0x3a9152(0x231):_0x3a9152(0x312)})),_0x41d234={'queryId':_0x3a9152(0x1a7),'columns':_0x1ff080,'data':_0x32199a,'stats':{'state':_0x3a9152(0x347),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x32199a['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x4c1cac=formatAsTable(_0x41d234,_0x32199a['length'],!![]);await writeOutput(_0x4c1cac,undefined,_0x3a9152(0x36d));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x1dc);['description']=a31_0x42adf9(0x2bd);async[a31_0x42adf9(0x201)](_0x2a2d0f){const _0x29624c=a31_0x42adf9,{options:_0x47d4cd,args:_0x5e75b1,tdx:_0x480d90}=_0x2a2d0f,_0x461f4a=_0x47d4cd,_0x424ecb=_0x5e75b1[0x0]||_0x47d4cd[_0x29624c(0x15e)];if(!_0x424ecb)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x29624c(0x326)),0x1;const _0x381d83=resolveYamlFile(_0x424ecb);if(existsSync(_0x381d83)){_0x461f4a['verbose']&&console[_0x29624c(0x361)]('Found\x20YAML\x20file:\x20'+_0x381d83);let _0x1e1803;try{_0x1e1803=readFileSync(_0x381d83,_0x29624c(0x21f));}catch(_0x2e39d7){const _0x4697e2=_0x2e39d7 instanceof Error?_0x2e39d7['message']:String(_0x2e39d7);return console['error'](_0x29624c(0x2be)+_0x4697e2),0x1;}const _0x1d9883=await withSpinner(_0x29624c(0x16c),()=>_0x480d90[_0x29624c(0x271)][_0x29624c(0x189)](_0x1e1803),{'verbose':_0x461f4a[_0x29624c(0x24b)]}),_0x3b3201=_0x1d9883[_0x29624c(0x25a)],{isNew:_0x2956f8,name:_0x2e8383,hasChanges:_0x18f0c4,diffFormatted:_0x423f04}=_0x3b3201;if(_0x18f0c4){_0x2956f8?console[_0x29624c(0x361)](_0x29624c(0x1a2)+_0x2e8383+'\x27:'):console['error'](_0x29624c(0x1ba)+_0x2e8383+'\x27:');console[_0x29624c(0x361)]('─'[_0x29624c(0x1fb)](0x3c)),console[_0x29624c(0x361)](_0x423f04),console[_0x29624c(0x361)]('─'['repeat'](0x3c));const _0x28f5e4=_0x2956f8?_0x29624c(0x249)+_0x2e8383+'\x27\x20and\x20run\x20workflow?':_0x29624c(0x284)+_0x2e8383+_0x29624c(0x2fb);if(!_0x461f4a['yes']){if(!isInteractive())return console[_0x29624c(0x361)](a31_0x185d3c[_0x29624c(0x36e)]('\x0aError:'),_0x29624c(0x163)),console[_0x29624c(0x361)](a31_0x185d3c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5a78e2=await confirmKey(_0x28f5e4);if(!_0x5a78e2)return console[_0x29624c(0x361)](a31_0x185d3c[_0x29624c(0x328)]('Aborted.')),0x1;}const _0x45b157=_0x2956f8?_0x29624c(0x1ee):_0x29624c(0x259);await withSpinner(_0x45b157+'\x20parent\x20segment\x20\x27'+_0x2e8383+'\x27...',()=>_0x3b3201[_0x29624c(0x1ab)](),{'verbose':_0x461f4a[_0x29624c(0x24b)]});const _0x219304=_0x2956f8?'Created':'Updated';console[_0x29624c(0x361)]('✔\x20'+_0x219304+_0x29624c(0x342)+_0x2e8383+'\x27');}else console['error'](_0x29624c(0x2e4)+_0x2e8383+_0x29624c(0x298));}const _0x57bb96=await withSpinner(_0x29624c(0x187)+_0x424ecb+_0x29624c(0x1e2),()=>_0x480d90[_0x29624c(0x271)]['runParent'](_0x424ecb),{'verbose':_0x461f4a[_0x29624c(0x24b)]}),_0x80dd27=_0x57bb96['data'],_0x5441eb=getConsoleUrl(_0x461f4a[_0x29624c(0x36a)],_0x29624c(0x186)+_0x80dd27['workflowId']+_0x29624c(0x22a)+_0x80dd27[_0x29624c(0x247)]+_0x29624c(0x235)+_0x80dd27[_0x29624c(0x263)]);return console[_0x29624c(0x361)](_0x29624c(0x1de)),console[_0x29624c(0x361)]('\x20\x20'+a31_0x185d3c[_0x29624c(0x1f2)](_0x29624c(0x195))+'\x20'+_0x80dd27['audienceId']),console['error']('\x20\x20'+a31_0x185d3c[_0x29624c(0x1f2)](_0x29624c(0x2e0))+'\x20'+_0x80dd27['status']),console['error']('\x20\x20'+a31_0x185d3c[_0x29624c(0x1f2)](_0x29624c(0x240))+'\x20'+_0x80dd27[_0x29624c(0x247)]),console[_0x29624c(0x361)]('\x20\x20'+a31_0x185d3c[_0x29624c(0x1f2)](_0x29624c(0x258))+'\x20'+_0x80dd27[_0x29624c(0x263)]),console[_0x29624c(0x361)]('\x20\x20'+_0x5441eb),console[_0x29624c(0x361)]('\x0a'+a31_0x185d3c[_0x29624c(0x1f2)](_0x29624c(0x357))+_0x29624c(0x2a7)+_0x80dd27[_0x29624c(0x263)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x285);['description']=a31_0x42adf9(0x348);async[a31_0x42adf9(0x201)](_0x54dc20){const _0x164b50=a31_0x42adf9,{options:_0x4974e5,args:_0x12c695,tdx:_0x2badb0}=_0x54dc20,_0x520282=_0x12c695[0x0]||_0x4974e5[_0x164b50(0x15e)];if(!_0x520282)return showParentSegmentNotSetError(_0x164b50(0x245)+_0x164b50(0x1c9)),0x1;_0x4974e5[_0x164b50(0x24b)]&&(console[_0x164b50(0x361)](_0x164b50(0x29b)+_0x4974e5[_0x164b50(0x36a)]),console[_0x164b50(0x361)](_0x164b50(0x23d)+_0x520282));const _0x245070=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x520282+'\x27...',()=>_0x2badb0['segment'][_0x164b50(0x2e7)](_0x520282),{'verbose':_0x4974e5[_0x164b50(0x24b)]}),_0x4657f1=_0x245070[_0x164b50(0x25a)];console[_0x164b50(0x361)](_0x164b50(0x2d0)+_0x4657f1[_0x164b50(0x1f1)]+_0x164b50(0x219)+(_0x4657f1[_0x164b50(0x1f1)]!==0x1?'s':''));if(_0x4974e5['json']||_0x4974e5[_0x164b50(0x18d)])return await handleSDKOutput(_0x4657f1,_0x4974e5),0x0;return displayFieldsHumanReadable(_0x4657f1,_0x520282),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x1db);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x338);async[a31_0x42adf9(0x201)](_0x462583){const _0x54c38d=a31_0x42adf9,{options:_0x179814,args:_0x2515dc,tdx:_0x514b02}=_0x462583,_0x43f1ec=_0x179814,_0x1c8bf2=_0x2515dc[0x0]||_0x179814[_0x54c38d(0x15e)];if(!_0x1c8bf2)return showParentSegmentNotSetError(_0x54c38d(0x2ef)+_0x54c38d(0x1fe)+_0x54c38d(0x33d)+_0x54c38d(0x2f2)),0x1;_0x179814[_0x54c38d(0x24b)]&&(console[_0x54c38d(0x361)]('Site:\x20'+_0x179814[_0x54c38d(0x36a)]),console[_0x54c38d(0x361)]('Parent\x20segment:\x20'+_0x1c8bf2));const _0x195bbd=await withSpinner(_0x54c38d(0x2a4)+_0x1c8bf2+_0x54c38d(0x1e2),()=>_0x514b02['segment'][_0x54c38d(0x169)](_0x1c8bf2),{'verbose':_0x179814['verbose']}),_0x5316ba=_0x195bbd['data'];if(_0x43f1ec[_0x54c38d(0x225)]){const _0x10a8ce=getConsoleNextUrl(_0x43f1ec['site'],_0x54c38d(0x246)+_0x5316ba['id']);return console['error'](a31_0x185d3c[_0x54c38d(0x28f)]('✔')+_0x54c38d(0x2d1)+a31_0x185d3c[_0x54c38d(0x307)](_0x10a8ce)),openBrowser(_0x10a8ce),0x0;}return await handleSingleObjectOutput(_0x5316ba,_0x179814),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x262);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x30c);async[a31_0x42adf9(0x201)](_0x4e8bc8){const _0x4991be=a31_0x42adf9,{options:_0xabeafd,args:_0x53a0ee,tdx:_0xf8a1dd}=_0x4e8bc8,_0x35b880=_0xabeafd,_0x2f1d62=_0x53a0ee[0x0]||_0xabeafd[_0x4991be(0x15e)];if(!_0x2f1d62)return showParentSegmentNotSetError(_0x4991be(0x36b)+_0x4991be(0x272)+'Options:\x0a'+_0x4991be(0x2fa)),0x1;_0xabeafd[_0x4991be(0x24b)]&&(console[_0x4991be(0x361)](_0x4991be(0x29b)+_0xabeafd[_0x4991be(0x36a)]),console[_0x4991be(0x361)]('Parent\x20segment:\x20'+_0x2f1d62));const _0x2ace14=await withSpinner(_0x4991be(0x1e5)+_0x2f1d62+'\x27...',()=>_0xf8a1dd[_0x4991be(0x271)][_0x4991be(0x183)](_0x2f1d62),{'verbose':_0xabeafd[_0x4991be(0x24b)]}),_0x33df6e=_0x2ace14[_0x4991be(0x25a)],_0xa5f04c=_0xf8a1dd[_0x4991be(0x271)][_0x4991be(0x217)](_0x33df6e);if(_0x35b880[_0x4991be(0x218)]){const _0x4b80e5=await this[_0x4991be(0x32c)](_0x4e8bc8,_0x2f1d62,_0x33df6e,_0xa5f04c),_0x42a97c=this['formatSchemaJson'](_0x4b80e5);writeFileSync(_0x35b880['output'],_0x42a97c);const _0x6fdab3=_0x4b80e5[_0x4991be(0x300)][_0x4991be(0x198)][_0x4991be(0x1f1)]+_0x4b80e5[_0x4991be(0x2d8)][_0x4991be(0x2d3)]((_0x1d81fe,_0x329b19)=>_0x1d81fe+_0x329b19[_0x4991be(0x198)][_0x4991be(0x1f1)],0x0),_0x57f1fa=_0x4b80e5['behaviors'][_0x4991be(0x1ed)](_0x1e32bb=>_0x1e32bb[_0x4991be(0x198)][_0x4991be(0x1f1)]===0x0)['length'];return console[_0x4991be(0x206)](_0x4991be(0x2c0)+_0x35b880['output']),console[_0x4991be(0x206)]('\x20\x20Database:\x20'+_0xa5f04c),console[_0x4991be(0x206)](_0x4991be(0x199)+_0x4b80e5[_0x4991be(0x2d8)]['length']+_0x4991be(0x2ab)),console[_0x4991be(0x206)](_0x4991be(0x2b0)+_0x6fdab3+_0x4991be(0x280)),_0x57f1fa>0x0&&console[_0x4991be(0x206)](_0x4991be(0x31f)+_0x57f1fa+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x4991be(0x361)]('\x0a'+a31_0x185d3c['bold']('Output\x20Database:')+'\x20'+a31_0x185d3c[_0x4991be(0x307)](_0xa5f04c));const _0x10a4a6=await withSpinner('Fetching\x20customers\x20schema...',()=>_0xf8a1dd[_0x4991be(0x271)][_0x4991be(0x304)](_0x33df6e),{'verbose':_0xabeafd[_0x4991be(0x24b)]});console['error']('\x0a'+a31_0x185d3c[_0x4991be(0x35b)](_0x4991be(0x300))+'\x20'+a31_0x185d3c[_0x4991be(0x1f2)]('('+_0xa5f04c+_0x4991be(0x2f6)));const _0x5ab59c=await executeSchemaQuery(_0x10a4a6[_0x4991be(0x25a)],_0xf8a1dd,_0xabeafd);await handleQueryOutput(_0x5ab59c,_0xabeafd);const _0x12fc0f=await withSpinner('Fetching\x20behavior\x20list...',()=>_0xf8a1dd[_0x4991be(0x271)][_0x4991be(0x2d4)](_0x33df6e),{'verbose':_0xabeafd['verbose']});for(const _0x56b058 of _0x12fc0f['data']){const _0x28a571=_0x4991be(0x196)+_0x56b058[_0x4991be(0x156)]()[_0x4991be(0x1cd)](/\s+/g,'_'),_0x2cc430=_0x4991be(0x266)+_0xa5f04c+'.'+_0x28a571;console[_0x4991be(0x361)]('\x0a'+a31_0x185d3c[_0x4991be(0x35b)](_0x56b058)+'\x20'+a31_0x185d3c['dim']('('+_0xa5f04c+'.'+_0x28a571+')'));try{const _0x1322e2=await executeSchemaQuery(_0x2cc430,_0xf8a1dd,_0xabeafd);await handleQueryOutput(_0x1322e2,_0xabeafd);}catch{console[_0x4991be(0x361)](a31_0x185d3c[_0x4991be(0x328)](_0x4991be(0x20e)));}}return 0x0;}async[a31_0x42adf9(0x32c)](_0x1e3381,_0x5209d4,_0x15bf9b,_0x12579c){const _0x23f6cd=a31_0x42adf9,{options:_0x34e9ba,tdx:_0x5ee9a4}=_0x1e3381,_0xdd2345=await withSpinner(_0x23f6cd(0x16d),()=>_0x5ee9a4[_0x23f6cd(0x271)][_0x23f6cd(0x304)](_0x15bf9b),{'verbose':_0x34e9ba[_0x23f6cd(0x24b)]}),_0x9acb00=await executeSchemaQuery(_0xdd2345['data'],_0x5ee9a4,_0x34e9ba),_0x5934b6=_0x9acb00[_0x23f6cd(0x25a)][_0x23f6cd(0x2f8)](_0x3df1f8=>({'name':_0x3df1f8[_0x23f6cd(0x288)],'type':_0x3df1f8[_0x23f6cd(0x2ac)]})),_0x46d300=await withSpinner(_0x23f6cd(0x20c),()=>_0x5ee9a4['segment']['getBehaviorNames'](_0x15bf9b),{'verbose':_0x34e9ba[_0x23f6cd(0x24b)]}),_0x4392d6=[];for(const _0x166c9f of _0x46d300[_0x23f6cd(0x25a)]){const _0x37a0b9='behavior_'+_0x166c9f[_0x23f6cd(0x156)]()[_0x23f6cd(0x1cd)](/\s+/g,'_'),_0x138343='SELECT\x20*\x20FROM\x20'+_0x12579c+'.'+_0x37a0b9;let _0x4e429c=[];try{const _0x3b41e2=await executeSchemaQuery(_0x138343,_0x5ee9a4,_0x34e9ba);_0x4e429c=_0x3b41e2['data'][_0x23f6cd(0x2f8)](_0x3ab11f=>({'name':_0x3ab11f[_0x23f6cd(0x288)],'type':_0x3ab11f[_0x23f6cd(0x2ac)]}));}catch{}_0x4392d6[_0x23f6cd(0x2f0)]({'table':_0x37a0b9,'columns':_0x4e429c});}return{'database':_0x12579c,'parent_segment':_0x5209d4,'parent_id':_0x15bf9b,'customers':{'table':_0x23f6cd(0x300),'columns':_0x5934b6},'behaviors':_0x4392d6};}[a31_0x42adf9(0x1e7)](_0x1539b5){const _0x4d3742=a31_0x42adf9,_0x1ae8df=_0x2a4e22=>{const _0x4d813e=a31_0x4265;if(_0x2a4e22[_0x4d813e(0x1f1)]===0x0)return'[]';const _0x1e1731=_0x2a4e22[_0x4d813e(0x2f8)](_0x2043ed=>_0x4d813e(0x2b9)+_0x2043ed[_0x4d813e(0x321)]+_0x4d813e(0x18c)+_0x2043ed[_0x4d813e(0x1d5)]+_0x4d813e(0x2f3));return'[\x0a'+_0x1e1731[_0x4d813e(0x208)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x2af292=_0x1539b5[_0x4d3742(0x2d8)][_0x4d3742(0x2f8)](_0xf57111=>{const _0x5423a8=_0x4d3742;return _0x5423a8(0x34e)+_0xf57111[_0x5423a8(0x36d)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x1ae8df(_0xf57111[_0x5423a8(0x198)])[_0x5423a8(0x1cd)](/^/gm,'\x20\x20')[_0x5423a8(0x165)]()+'\x0a\x20\x20\x20\x20}';})[_0x4d3742(0x208)](',\x0a');return _0x4d3742(0x1e3)+_0x1539b5[_0x4d3742(0x320)]+_0x4d3742(0x28d)+_0x1539b5[_0x4d3742(0x248)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x1539b5[_0x4d3742(0x223)]+_0x4d3742(0x2da)+_0x1539b5[_0x4d3742(0x300)][_0x4d3742(0x36d)]+_0x4d3742(0x281)+_0x1ae8df(_0x1539b5[_0x4d3742(0x300)][_0x4d3742(0x198)])['replace'](/^/gm,'\x20\x20')['trim']()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x2af292+_0x4d3742(0x2b5);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a31_0x42adf9(0x19a);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x1ce);async[a31_0x42adf9(0x201)](_0x2afc6c){const _0x151491=a31_0x42adf9,{options:_0x190599,args:_0x30023d,tdx:_0xffeab0}=_0x2afc6c,_0x38e809=_0x30023d[0x0]||_0x190599[_0x151491(0x15e)];if(!_0x38e809)return showParentSegmentNotSetError(_0x151491(0x26e)+_0x151491(0x2f7)),0x1;_0x190599[_0x151491(0x24b)]&&(console[_0x151491(0x361)](_0x151491(0x29b)+_0x190599[_0x151491(0x36a)]),console[_0x151491(0x361)](_0x151491(0x23d)+_0x38e809));const _0x2e1779=await withSpinner(_0x151491(0x1e5)+_0x38e809+_0x151491(0x1e2),()=>_0xffeab0[_0x151491(0x271)][_0x151491(0x183)](_0x38e809),{'verbose':_0x190599[_0x151491(0x24b)]}),_0x3d1617=_0x2e1779[_0x151491(0x25a)],_0x6efa09=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x38e809+'\x27...',()=>_0xffeab0[_0x151491(0x271)][_0x151491(0x304)](_0x3d1617),{'verbose':_0x190599[_0x151491(0x24b)]}),_0x1d0049=_0x6efa09[_0x151491(0x25a)];return _0x190599[_0x151491(0x1c2)]===_0x151491(0x229)||_0x190599[_0x151491(0x1c2)]===_0x151491(0x18d)?await handleSDKOutput([{'sql':_0x1d0049}],_0x190599):console[_0x151491(0x206)](_0x1d0049),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x2ee);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x265);async['execute'](_0x2eff07){const _0x45a7fe=a31_0x42adf9,{options:_0x2b35a8,args:_0x3d7aad,tdx:_0x411ea7}=_0x2eff07,_0x58f04e=_0x3d7aad[0x0]||_0x2b35a8['parentSegment'];if(!_0x58f04e)return showParentSegmentNotSetError(_0x45a7fe(0x2fd)+_0x45a7fe(0x1d0)),0x1;_0x2b35a8[_0x45a7fe(0x24b)]&&(console[_0x45a7fe(0x361)](_0x45a7fe(0x29b)+_0x2b35a8['site']),console['error'](_0x45a7fe(0x23d)+_0x58f04e));const _0x503069=await withSpinner(_0x45a7fe(0x1e5)+_0x58f04e+_0x45a7fe(0x1e2),()=>_0x411ea7[_0x45a7fe(0x271)]['resolveParentId'](_0x58f04e),{'verbose':_0x2b35a8[_0x45a7fe(0x24b)]}),_0x250af7=_0x503069[_0x45a7fe(0x25a)],_0x5263c0=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x58f04e+_0x45a7fe(0x1e2),()=>_0x411ea7[_0x45a7fe(0x271)][_0x45a7fe(0x304)](_0x250af7),{'verbose':_0x2b35a8['verbose']});let _0x325087=_0x5263c0['data'];const _0x83e716=resolveLimit(_0x2b35a8[_0x45a7fe(0x333)],DEFAULT_DISPLAY_LIMIT),_0x582404=/\bLIMIT\s+\d+/i[_0x45a7fe(0x2a5)](_0x325087);!_0x582404&&(_0x325087=_0x325087['trim']()[_0x45a7fe(0x1cd)](/;+$/,''),_0x325087=_0x45a7fe(0x250)+_0x325087+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x83e716);_0x2b35a8[_0x45a7fe(0x24b)]&&console[_0x45a7fe(0x361)]('SQL\x20query:\x0a'+_0x325087);const _0x42b6df=await withProgressSpinner(_0x45a7fe(0x29f),async _0x233d92=>{const _0x313fde=_0x45a7fe,_0x20bd62=await _0x411ea7[_0x313fde(0x35f)][_0x313fde(0x201)](_0x325087,{'catalog':'td','schema':_0x313fde(0x31b),'onJobId':_0x2c4d16=>{_0x233d92['setJobId'](_0x2c4d16);}});return _0x20bd62;},{'verbose':_0x2b35a8[_0x45a7fe(0x24b)]}),_0x4c9194=_0x42b6df[_0x45a7fe(0x25a)],_0x358e38=_0x4c9194[_0x45a7fe(0x17e)]?'\x20[Job\x20ID:\x20'+_0x4c9194[_0x45a7fe(0x17e)]+']':'';return console[_0x45a7fe(0x361)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x4c9194[_0x45a7fe(0x234)]['processedRows'][_0x45a7fe(0x21b)]()+_0x45a7fe(0x331)+(_0x45a7fe(0x1b6)+formatElapsed(_0x4c9194[_0x45a7fe(0x234)][_0x45a7fe(0x1d2)])+_0x358e38)),await handleQueryOutput(_0x4c9194,_0x2b35a8),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x2bc);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x18e);async['execute'](_0x20cd3d){const _0x150e21=a31_0x42adf9,{options:_0x203f55,args:_0xf44655,tdx:_0x421617}=_0x20cd3d,_0xbaccce=_0xf44655[0x0],_0x30198d=await withSpinner(_0xbaccce?_0x150e21(0x2a0)+_0xbaccce+_0x150e21(0x1e2):_0x150e21(0x1fa),()=>_0x421617['realtime'][_0x150e21(0x2cc)](),{'verbose':_0x203f55[_0x150e21(0x24b)]});let _0x4e68e6=_0x30198d[_0x150e21(0x25a)]['filter'](_0x28e6de=>_0x28e6de[_0x150e21(0x1a5)]);if(_0xbaccce){const _0x742e98=_0xbaccce[_0x150e21(0x1cd)](/[.+^${}()|[\]\\]/g,_0x150e21(0x241))[_0x150e21(0x1cd)](/\*/g,'.*')[_0x150e21(0x1cd)](/\?/g,'.'),_0x582b31=new RegExp('^'+_0x742e98+'$','i');_0x4e68e6=_0x4e68e6[_0x150e21(0x1ed)](_0x4db5a9=>_0x582b31['test'](_0x4db5a9['name']));}_0x4e68e6[_0x150e21(0x1cc)]((_0x568b66,_0x3d23dc)=>_0x568b66['name']['localeCompare'](_0x3d23dc[_0x150e21(0x321)])),console[_0x150e21(0x361)]('✔\x20Found\x20'+_0x4e68e6[_0x150e21(0x1f1)]+'\x20RT-enabled\x20parent\x20segment'+(_0x4e68e6[_0x150e21(0x1f1)]!==0x1?'s':''));const _0x35d395=_0x162dac=>{const _0x13b0ef=_0x150e21;return getConsoleNextUrl(_0x203f55[_0x13b0ef(0x36a)],'/app/dw/parentSegments/'+_0x162dac);};if(_0x203f55[_0x150e21(0x1c2)]===_0x150e21(0x229)||_0x203f55[_0x150e21(0x1c2)]===_0x150e21(0x18d)){const _0x3711b4=_0x4e68e6[_0x150e21(0x2f8)](_0x582a1d=>({..._0x582a1d,'url':_0x35d395(_0x582a1d['id'])}));await handleSDKOutput(_0x3711b4,_0x203f55);}else{if(_0x4e68e6[_0x150e21(0x1f1)]===0x0)console[_0x150e21(0x206)](_0x150e21(0x2b3));else for(const _0x28de34 of _0x4e68e6){const _0x3cc63e=_0x28de34[_0x150e21(0x1a1)]?a31_0x185d3c[_0x150e21(0x1f2)]('\x20('+formatRows(_0x28de34[_0x150e21(0x1a1)])+')'):'',_0x43e30a=hyperlink(_0x28de34[_0x150e21(0x321)],_0x35d395(_0x28de34['id']));console[_0x150e21(0x206)]('⚡\x20'+_0x43e30a+_0x3cc63e);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x42adf9(0x321)]='ps:rt:validate';[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x2db);async[a31_0x42adf9(0x201)](_0x11e455){const _0x46d62a=a31_0x42adf9,{options:_0x34246c,args:_0x4399f1,tdx:_0x3d6d0f}=_0x11e455,_0x41eba1=_0x4399f1[0x0]||_0x34246c[_0x46d62a(0x15e)];if(!_0x41eba1)return showParentSegmentNotSetError(_0x46d62a(0x1c4)+_0x46d62a(0x33e)),0x1;const _0x2b2141=resolveYamlFile(_0x41eba1);if(!existsSync(_0x2b2141))return showFileNotFoundError(_0x2b2141,_0x41eba1),0x1;let _0x4f95d6;try{_0x4f95d6=readFileSync(_0x2b2141,_0x46d62a(0x21f));}catch(_0x55bbf3){const _0x2cbd10=_0x55bbf3 instanceof Error?_0x55bbf3[_0x46d62a(0x1f5)]:String(_0x55bbf3);return console[_0x46d62a(0x361)](_0x46d62a(0x2be)+_0x2cbd10),0x1;}const _0x48bcb9=createCommandSpinner(a31_0x185d3c['dim'](_0x46d62a(0x224)),{'verbose':_0x34246c[_0x46d62a(0x24b)]});_0x48bcb9[_0x46d62a(0x222)]();const _0x5a33c7={'realtime':!![],'onProgress':_0x500a56=>{const _0x4300d7=_0x46d62a;_0x48bcb9[_0x4300d7(0x270)]=formatProgressMessage(_0x500a56);}};let _0x150c54;try{_0x150c54=await _0x3d6d0f[_0x46d62a(0x271)]['validateParentYaml'](_0x4f95d6,_0x5a33c7),_0x48bcb9[_0x46d62a(0x319)]();}catch(_0xc771b8){_0x48bcb9[_0x46d62a(0x319)]();throw _0xc771b8;}console['error']('\x0a'+a31_0x185d3c[_0x46d62a(0x35b)](_0x46d62a(0x2c4))+'\x20'+_0x150c54[_0x46d62a(0x321)]),console[_0x46d62a(0x361)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x150c54),console[_0x46d62a(0x361)]('─'['repeat'](0x3c));if(_0x150c54['errors'][_0x46d62a(0x1f1)]>0x0){console[_0x46d62a(0x361)]('\x0a'+a31_0x185d3c[_0x46d62a(0x36e)](_0x46d62a(0x2d6)));for(const _0x529bcc of _0x150c54[_0x46d62a(0x25c)]){console['error']('\x20\x20'+a31_0x185d3c[_0x46d62a(0x36e)]('•')+'\x20'+_0x529bcc);}}return _0x150c54[_0x46d62a(0x30e)]&&console[_0x46d62a(0x361)]('\x0a'+a31_0x185d3c[_0x46d62a(0x28f)]('✔')+_0x46d62a(0x274)),_0x150c54[_0x46d62a(0x30e)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0x42adf9(0x295);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x1a8);async[a31_0x42adf9(0x201)](_0x145ae7){const _0x4956e4=a31_0x42adf9,{options:_0xbb52c,args:_0x1a1ed6,tdx:_0x5cf0e6}=_0x145ae7,_0x49de8f=_0x1a1ed6[0x0]||_0xbb52c[_0x4956e4(0x15e)];if(!_0x49de8f)return showParentSegmentNotSetError(_0x4956e4(0x290)+_0x4956e4(0x228)),0x1;_0xbb52c[_0x4956e4(0x24b)]&&(console['error'](_0x4956e4(0x29b)+_0xbb52c['site']),console[_0x4956e4(0x361)](_0x4956e4(0x23d)+_0x49de8f));const _0x468a45=await withSpinner(_0x4956e4(0x1e5)+_0x49de8f+_0x4956e4(0x1e2),()=>_0x5cf0e6[_0x4956e4(0x271)][_0x4956e4(0x183)](_0x49de8f),{'verbose':_0xbb52c[_0x4956e4(0x24b)]}),_0xbefb4b=_0x468a45['data'],_0x160259=await withSpinner(_0x4956e4(0x184)+_0x49de8f+'\x27...',()=>_0x5cf0e6['realtime']['listJourneys'](_0xbefb4b),{'verbose':_0xbb52c[_0x4956e4(0x24b)]}),_0x70a6=_0x160259[_0x4956e4(0x25a)];console[_0x4956e4(0x361)](_0x4956e4(0x2d0)+_0x70a6[_0x4956e4(0x1f1)]+'\x20RT\x20journey'+(_0x70a6[_0x4956e4(0x1f1)]!==0x1?'s':''));if(_0xbb52c['format']===_0x4956e4(0x229)||_0xbb52c['format']==='jsonl')await handleSDKOutput(_0x70a6,_0xbb52c);else{if(_0x70a6[_0x4956e4(0x1f1)]===0x0)console['log']('No\x20RT\x20journeys\x20found');else for(const _0x3663ed of _0x70a6){const _0x1b957f=_0x3663ed[_0x4956e4(0x1b1)]==='launched'?'🚀':'📝',_0x559424=_0x3663ed['paused']?a31_0x185d3c['yellow'](_0x4956e4(0x308)):'',_0x2c4a33=a31_0x185d3c[_0x4956e4(0x1f2)]('\x20('+_0x3663ed[_0x4956e4(0x2e6)]+'\x20stage'+(_0x3663ed[_0x4956e4(0x2e6)]!==0x1?'s':'')+')');console['log'](_0x1b957f+'\x20'+_0x3663ed['name']+_0x559424+_0x2c4a33);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x2d5);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x1ae);async[a31_0x42adf9(0x201)](_0x4abd8c){const _0x448e9f=a31_0x42adf9,{options:_0x55dbf7,args:_0x416a5f,tdx:_0x434061}=_0x4abd8c,_0xa8e498=_0x416a5f[0x0];if(!_0xa8e498)return console[_0x448e9f(0x361)](a31_0x185d3c['red'](_0x448e9f(0x22b))),console[_0x448e9f(0x361)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x448e9f(0x361)](a31_0x185d3c[_0x448e9f(0x1f2)](_0x448e9f(0x286))),0x1;_0x55dbf7[_0x448e9f(0x24b)]&&(console[_0x448e9f(0x361)](_0x448e9f(0x29b)+_0x55dbf7[_0x448e9f(0x36a)]),console[_0x448e9f(0x361)](_0x448e9f(0x177)+_0xa8e498));const _0x5f498f=await withSpinner(_0x448e9f(0x1ac)+_0xa8e498+_0x448e9f(0x1e2),()=>_0x434061[_0x448e9f(0x368)]['pauseJourney'](_0xa8e498),{'verbose':_0x55dbf7[_0x448e9f(0x24b)]}),_0x4bfdc0=_0x5f498f[_0x448e9f(0x25a)];console[_0x448e9f(0x361)](_0x448e9f(0x31d)+_0x4bfdc0[_0x448e9f(0x321)]+'\x27');if(_0x55dbf7[_0x448e9f(0x1c2)]===_0x448e9f(0x229)||_0x55dbf7[_0x448e9f(0x1c2)]===_0x448e9f(0x18d))await handleSDKOutput([_0x4bfdc0],_0x55dbf7);else{const _0x58cded=_0x4bfdc0[_0x448e9f(0x1b1)]===_0x448e9f(0x193)?'🚀':'📝',_0x2208a9=_0x4bfdc0[_0x448e9f(0x180)]?a31_0x185d3c['yellow'](_0x448e9f(0x308)):'';console[_0x448e9f(0x206)](_0x58cded+'\x20'+_0x4bfdc0['name']+_0x2208a9);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']=a31_0x42adf9(0x1bb);['description']=a31_0x42adf9(0x1b5);async[a31_0x42adf9(0x201)](_0x4d0b21){const _0x8c088d=a31_0x42adf9,{options:_0x1fa19c,args:_0x441593,tdx:_0x11a06a}=_0x4d0b21,_0x29137f=_0x441593[0x0];if(!_0x29137f)return console[_0x8c088d(0x361)](a31_0x185d3c[_0x8c088d(0x36e)](_0x8c088d(0x22b))),console[_0x8c088d(0x361)](_0x8c088d(0x2eb)),console[_0x8c088d(0x361)](a31_0x185d3c[_0x8c088d(0x1f2)](_0x8c088d(0x286))),0x1;_0x1fa19c[_0x8c088d(0x24b)]&&(console['error'](_0x8c088d(0x29b)+_0x1fa19c['site']),console[_0x8c088d(0x361)](_0x8c088d(0x177)+_0x29137f));const _0x2b601a=await withSpinner(_0x8c088d(0x2ff)+_0x29137f+'\x27...',()=>_0x11a06a[_0x8c088d(0x368)][_0x8c088d(0x334)](_0x29137f),{'verbose':_0x1fa19c[_0x8c088d(0x24b)]}),_0xec22e5=_0x2b601a[_0x8c088d(0x25a)];console[_0x8c088d(0x361)](_0x8c088d(0x2ad)+_0xec22e5[_0x8c088d(0x321)]+'\x27');if(_0x1fa19c[_0x8c088d(0x1c2)]==='json'||_0x1fa19c[_0x8c088d(0x1c2)]===_0x8c088d(0x18d))await handleSDKOutput([_0xec22e5],_0x1fa19c);else{const _0x2ebbf4=_0xec22e5[_0x8c088d(0x1b1)]===_0x8c088d(0x193)?'🚀':'📝',_0x7f7517=_0xec22e5[_0x8c088d(0x180)]?a31_0x185d3c['yellow'](_0x8c088d(0x308)):'';console[_0x8c088d(0x206)](_0x2ebbf4+'\x20'+_0xec22e5[_0x8c088d(0x321)]+_0x7f7517);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x1dd);['description']='Get\x20current\x20RT\x20configuration\x20version\x20status';async[a31_0x42adf9(0x201)](_0x5323f3){const _0x31378f=a31_0x42adf9,{options:_0x11fd13,args:_0x2f6562,tdx:_0x1c589a}=_0x5323f3,_0x2a7f78=_0x2f6562[0x0]||_0x11fd13[_0x31378f(0x15e)];if(!_0x2a7f78)return showParentSegmentNotSetError(_0x31378f(0x33b)+_0x31378f(0x279)),0x1;_0x11fd13[_0x31378f(0x24b)]&&(console[_0x31378f(0x361)](_0x31378f(0x29b)+_0x11fd13[_0x31378f(0x36a)]),console[_0x31378f(0x361)](_0x31378f(0x23d)+_0x2a7f78));const _0x7bd974=await withSpinner(_0x31378f(0x1e5)+_0x2a7f78+_0x31378f(0x1e2),()=>_0x1c589a[_0x31378f(0x271)][_0x31378f(0x183)](_0x2a7f78),{'verbose':_0x11fd13[_0x31378f(0x24b)]}),_0x5dbc48=_0x7bd974[_0x31378f(0x25a)],_0x25fe97=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0x2a7f78+_0x31378f(0x1e2),()=>_0x1c589a[_0x31378f(0x368)]['getCurrentConfigVersion'](_0x5dbc48),{'verbose':_0x11fd13[_0x31378f(0x24b)]}),_0x3c7652=_0x25fe97[_0x31378f(0x25a)];return console[_0x31378f(0x361)](_0x31378f(0x257)),_0x11fd13[_0x31378f(0x1c2)]===_0x31378f(0x229)||_0x11fd13[_0x31378f(0x1c2)]===_0x31378f(0x18d)?await handleSDKOutput([_0x3c7652],_0x11fd13):(console[_0x31378f(0x206)](_0x31378f(0x36c)+_0x3c7652['id']),console[_0x31378f(0x206)](_0x31378f(0x2ea)+_0x3c7652[_0x31378f(0x2b6)]),console[_0x31378f(0x206)]('identifier:\x20'+_0x3c7652[_0x31378f(0x214)]),console['log'](_0x31378f(0x1b8)+_0x3c7652[_0x31378f(0x289)]),console[_0x31378f(0x206)](_0x31378f(0x34f)+_0x3c7652[_0x31378f(0x28e)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x297);[a31_0x42adf9(0x2c9)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async['execute'](_0x2553bb){const _0x2d773b=a31_0x42adf9,{options:_0x4a80c4,args:_0xabf570,tdx:_0x569fb1}=_0x2553bb,_0x3f34b8=_0xabf570[0x0]||_0x4a80c4[_0x2d773b(0x15e)];if(!_0x3f34b8)return showParentSegmentNotSetError(_0x2d773b(0x2cd)+_0x2d773b(0x33c)),0x1;const _0x53a786=await withSpinner(_0x2d773b(0x1e5)+_0x3f34b8+_0x2d773b(0x1e2),()=>_0x569fb1[_0x2d773b(0x271)][_0x2d773b(0x183)](_0x3f34b8),{'verbose':_0x4a80c4['verbose']}),_0x4f052b=_0x53a786[_0x2d773b(0x25a)],_0xe297a0=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x3f34b8+_0x2d773b(0x1e2),()=>_0x569fb1[_0x2d773b(0x17b)][_0x2d773b(0x2cc)](_0x4f052b),{'verbose':_0x4a80c4[_0x2d773b(0x24b)]}),_0x1962f6=_0xe297a0[_0x2d773b(0x25a)];console[_0x2d773b(0x361)](_0x2d773b(0x2d0)+_0x1962f6[_0x2d773b(0x1f1)]+'\x20personalization\x20service'+(_0x1962f6[_0x2d773b(0x1f1)]!==0x1?'s':''));if(_0x4a80c4['format']==='json'||_0x4a80c4[_0x2d773b(0x1c2)]==='jsonl')await handleSDKOutput(_0x1962f6,_0x4a80c4);else{if(_0x1962f6[_0x2d773b(0x1f1)]===0x0)console['log'](_0x2d773b(0x21c)),console[_0x2d773b(0x361)](a31_0x185d3c[_0x2d773b(0x307)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0xaad135 of _0x1962f6){console[_0x2d773b(0x206)](a31_0x185d3c[_0x2d773b(0x35b)](_0xaad135[_0x2d773b(0x321)])+'\x20'+a31_0x185d3c[_0x2d773b(0x1f2)](_0x2d773b(0x1be)+_0xaad135['id']+')'));_0xaad135[_0x2d773b(0x2c9)]&&console[_0x2d773b(0x206)]('\x20\x20'+a31_0x185d3c[_0x2d773b(0x1f2)](_0xaad135[_0x2d773b(0x2c9)]));if(_0xaad135[_0x2d773b(0x20d)]&&_0xaad135[_0x2d773b(0x20d)][_0x2d773b(0x1f1)]>0x0)for(const _0x4bd44a of _0xaad135[_0x2d773b(0x20d)]){const _0xb64ab=_0x4bd44a[_0x2d773b(0x21d)]?.[_0x2d773b(0x1f1)]?_0x4bd44a['allowedIps']['join'](',\x20'):_0x2d773b(0x24a);console['log']('\x20\x20'+a31_0x185d3c[_0x2d773b(0x307)]('token:')+'\x20'+_0x4bd44a['name']+'\x20'+a31_0x185d3c[_0x2d773b(0x1f2)](_0x2d773b(0x1be)+_0x4bd44a['id']+')')),console[_0x2d773b(0x206)](_0x2d773b(0x32f)+a31_0x185d3c[_0x2d773b(0x1f2)](_0x2d773b(0x21a))+'\x20'+_0xb64ab);}else console[_0x2d773b(0x206)]('\x20\x20'+a31_0x185d3c[_0x2d773b(0x1f2)](_0x2d773b(0x1c8)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x1f6);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x23f);async[a31_0x42adf9(0x201)](_0x18665d){const _0x1eac2b=a31_0x42adf9,{options:_0x2406e0,args:_0x166978,tdx:_0x1fed30}=_0x18665d,_0x2a3849=_0x2406e0,_0x4ff566=_0x166978[0x0],_0x4d6257=_0x166978[0x1]||_0x2406e0[_0x1eac2b(0x15e)];if(!_0x4ff566)return console[_0x1eac2b(0x361)](_0x1eac2b(0x27d)),console[_0x1eac2b(0x361)](_0x1eac2b(0x197)),console[_0x1eac2b(0x361)](_0x1eac2b(0x273)),0x1;if(!_0x4d6257)return showParentSegmentNotSetError(_0x1eac2b(0x23e)+_0x1eac2b(0x273)),0x1;const _0x3fff2e=await withSpinner(_0x1eac2b(0x1e5)+_0x4d6257+_0x1eac2b(0x1e2),()=>_0x1fed30['segment'][_0x1eac2b(0x183)](_0x4d6257),{'verbose':_0x2406e0[_0x1eac2b(0x24b)]}),_0x4687ff=_0x3fff2e[_0x1eac2b(0x25a)],_0x33069f={'name':_0x4ff566,'description':_0x2a3849[_0x1eac2b(0x2c9)],'public':_0x2a3849[_0x1eac2b(0x278)]},_0x1f0a8c=await withSpinner(_0x1eac2b(0x2e9)+_0x4ff566+'\x27...',()=>_0x1fed30[_0x1eac2b(0x17b)][_0x1eac2b(0x2d9)](_0x4687ff,_0x33069f),{'verbose':_0x2406e0[_0x1eac2b(0x24b)]}),_0x30aa17=_0x1f0a8c['data'];return console['error'](_0x1eac2b(0x306)+_0x30aa17[_0x1eac2b(0x321)]+'\x27\x20with\x20ID:\x20'+_0x30aa17['id']),await handleSDKOutput([_0x30aa17],_0x2406e0),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a31_0x42adf9(0x23c);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x237);async['execute'](_0x343962){const _0x2fc65b=a31_0x42adf9,{options:_0x52e0bd,args:_0x3b33a0,tdx:_0x2098fb}=_0x343962,_0x162305=_0x3b33a0[0x0],_0x242f01=_0x3b33a0[0x1]||_0x52e0bd[_0x2fc65b(0x15e)];if(!_0x162305)return console[_0x2fc65b(0x361)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x2fc65b(0x361)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x2fc65b(0x361)](_0x2fc65b(0x366)),0x1;if(!_0x242f01)return showParentSegmentNotSetError(_0x2fc65b(0x2e1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x329ef7=await withSpinner(_0x2fc65b(0x1e5)+_0x242f01+'\x27...',()=>_0x2098fb[_0x2fc65b(0x271)][_0x2fc65b(0x183)](_0x242f01),{'verbose':_0x52e0bd[_0x2fc65b(0x24b)]}),_0x96dbd4=_0x329ef7[_0x2fc65b(0x25a)],_0x1337fa=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x162305+_0x2fc65b(0x1e2),()=>_0x2098fb[_0x2fc65b(0x17b)][_0x2fc65b(0x2d2)](_0x96dbd4,_0x162305),{'verbose':_0x52e0bd[_0x2fc65b(0x24b)]}),_0x3e56c7=_0x1337fa['data'];if(_0x52e0bd[_0x2fc65b(0x229)]||_0x52e0bd['jsonl'])await handleSDKOutput([_0x3e56c7],_0x52e0bd);else{console[_0x2fc65b(0x206)](a31_0x185d3c[_0x2fc65b(0x35b)](_0x3e56c7[_0x2fc65b(0x321)])+'\x20'+a31_0x185d3c[_0x2fc65b(0x1f2)](_0x2fc65b(0x1be)+_0x3e56c7['id']+')'));_0x3e56c7[_0x2fc65b(0x2c9)]&&console[_0x2fc65b(0x206)]('\x20\x20'+a31_0x185d3c[_0x2fc65b(0x1f2)](_0x3e56c7[_0x2fc65b(0x2c9)]));console[_0x2fc65b(0x206)]('\x20\x20'+a31_0x185d3c[_0x2fc65b(0x307)](_0x2fc65b(0x301))+'\x20'+(_0x3e56c7[_0x2fc65b(0x278)]?'yes':'no'));if(_0x3e56c7['tokens']&&_0x3e56c7[_0x2fc65b(0x20d)][_0x2fc65b(0x1f1)]>0x0)for(const _0xb37b4 of _0x3e56c7['tokens']){const _0x5d06b4=_0xb37b4['allowedIps']?.[_0x2fc65b(0x1f1)]?_0xb37b4[_0x2fc65b(0x21d)]['join'](',\x20'):_0x2fc65b(0x24a);console[_0x2fc65b(0x206)]('\x20\x20'+a31_0x185d3c[_0x2fc65b(0x307)]('token:')+'\x20'+_0xb37b4['name']+'\x20'+a31_0x185d3c[_0x2fc65b(0x1f2)](_0x2fc65b(0x1be)+_0xb37b4['id']+')')),console[_0x2fc65b(0x206)]('\x20\x20\x20\x20'+a31_0x185d3c['dim'](_0x2fc65b(0x21a))+'\x20'+_0x5d06b4);}else console['log']('\x20\x20'+a31_0x185d3c[_0x2fc65b(0x1f2)](_0x2fc65b(0x1c8)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x42adf9(0x321)]='ps:pz:service:delete';[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x373);async['execute'](_0x169ed1){const _0x3fadeb=a31_0x42adf9,{options:_0x580dd4,args:_0x7212df,tdx:_0x35ee25}=_0x169ed1,_0x10e857=_0x7212df[0x0],_0x1de62a=_0x7212df[0x1]||_0x580dd4[_0x3fadeb(0x15e)];if(!_0x10e857)return console[_0x3fadeb(0x361)](_0x3fadeb(0x2b8)),console[_0x3fadeb(0x361)](_0x3fadeb(0x283)),console[_0x3fadeb(0x361)](_0x3fadeb(0x359)),0x1;if(!_0x1de62a)return showParentSegmentNotSetError(_0x3fadeb(0x174)+_0x3fadeb(0x359)),0x1;const _0x4afad3=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1de62a+_0x3fadeb(0x1e2),()=>_0x35ee25['segment'][_0x3fadeb(0x183)](_0x1de62a),{'verbose':_0x580dd4[_0x3fadeb(0x24b)]}),_0x498bae=_0x4afad3[_0x3fadeb(0x25a)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x10e857+_0x3fadeb(0x1e2),()=>_0x35ee25[_0x3fadeb(0x17b)][_0x3fadeb(0x185)](_0x498bae,_0x10e857),{'verbose':_0x580dd4[_0x3fadeb(0x24b)]}),console[_0x3fadeb(0x361)](_0x3fadeb(0x1a3)+_0x10e857+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x42adf9(0x321)]='ps:pz:service:update';[a31_0x42adf9(0x2c9)]='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x42adf9(0x201)](_0x115e83){const _0x5f41ae=a31_0x42adf9,{options:_0x3a4a75,args:_0x1ab558,tdx:_0x54294c}=_0x115e83,_0x4515e2=_0x3a4a75,_0x49b439=_0x1ab558[0x0],_0xcdaaff=_0x1ab558[0x1]||_0x3a4a75[_0x5f41ae(0x15e)];if(!_0x49b439)return console[_0x5f41ae(0x361)](_0x5f41ae(0x2b8)),console[_0x5f41ae(0x361)](_0x5f41ae(0x346)),console[_0x5f41ae(0x361)](_0x5f41ae(0x209)),0x1;if(!_0x4515e2[_0x5f41ae(0x321)])return console['error'](_0x5f41ae(0x212)),console[_0x5f41ae(0x361)](_0x5f41ae(0x346)),0x1;if(!_0xcdaaff)return showParentSegmentNotSetError(_0x5f41ae(0x31a)+_0x5f41ae(0x209)),0x1;const _0x1bce71=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0xcdaaff+_0x5f41ae(0x1e2),()=>_0x54294c['segment'][_0x5f41ae(0x183)](_0xcdaaff),{'verbose':_0x3a4a75[_0x5f41ae(0x24b)]}),_0x59eb65=_0x1bce71[_0x5f41ae(0x25a)],_0x29e2e6={'name':_0x4515e2[_0x5f41ae(0x321)]};_0x4515e2[_0x5f41ae(0x2c9)]!==undefined&&(_0x29e2e6[_0x5f41ae(0x2c9)]=_0x4515e2[_0x5f41ae(0x2c9)]);const _0x35eb7d=await withSpinner('Updating\x20personalization\x20service\x20\x27'+_0x49b439+_0x5f41ae(0x1e2),()=>_0x54294c[_0x5f41ae(0x17b)]['patch'](_0x59eb65,_0x49b439,_0x29e2e6),{'verbose':_0x3a4a75[_0x5f41ae(0x24b)]}),_0x32a349=_0x35eb7d[_0x5f41ae(0x25a)];return console[_0x5f41ae(0x361)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x32a349[_0x5f41ae(0x321)]+'\x27'),await handleSDKOutput([_0x32a349],_0x3a4a75),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x26d);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x24e);async[a31_0x42adf9(0x201)](_0x4a23f8){const _0x3492bd=a31_0x42adf9,{options:_0x29aef4,args:_0x31114d,tdx:_0xfce688}=_0x4a23f8,_0x596405=_0x29aef4,_0x3e2cf2=_0x31114d[0x0],_0x2e2f76=_0x31114d[0x1],_0x82813a=_0x31114d[0x2]||_0x29aef4['parentSegment'];if(!_0x3e2cf2)return console[_0x3492bd(0x361)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x3492bd(0x361)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x3492bd(0x361)](_0x3492bd(0x213)),0x1;if(!_0x2e2f76)return console[_0x3492bd(0x361)](_0x3492bd(0x2b8)),console[_0x3492bd(0x361)](_0x3492bd(0x2d7)),console[_0x3492bd(0x361)](_0x3492bd(0x213)),0x1;if(!_0x82813a)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x3492bd(0x213)),0x1;const _0x3795d1=await withSpinner(_0x3492bd(0x1e5)+_0x82813a+'\x27...',()=>_0xfce688[_0x3492bd(0x271)][_0x3492bd(0x183)](_0x82813a),{'verbose':_0x29aef4['verbose']}),_0x56429f=_0x3795d1[_0x3492bd(0x25a)],_0x3c6039={'name':_0x3e2cf2};_0x596405[_0x3492bd(0x21d)]&&(_0x3c6039[_0x3492bd(0x21d)]=_0x596405[_0x3492bd(0x21d)][_0x3492bd(0x16e)](',')[_0x3492bd(0x2f8)](_0x22fa8a=>_0x22fa8a[_0x3492bd(0x165)]()));_0x596405[_0x3492bd(0x2c9)]&&(_0x3c6039['description']=_0x596405[_0x3492bd(0x2c9)]);const _0x363c28=await withSpinner(_0x3492bd(0x1d1)+_0x3e2cf2+'\x27\x20for\x20service\x20\x27'+_0x2e2f76+_0x3492bd(0x1e2),()=>_0xfce688['personalization'][_0x3492bd(0x1eb)](_0x56429f,_0x2e2f76,_0x3c6039),{'verbose':_0x29aef4[_0x3492bd(0x24b)]}),_0x70d7ce=_0x363c28[_0x3492bd(0x25a)];return console[_0x3492bd(0x361)](_0x3492bd(0x253)+_0x70d7ce[_0x3492bd(0x321)]+_0x3492bd(0x356)+_0x70d7ce['id']),_0x70d7ce[_0x3492bd(0x343)]&&(console[_0x3492bd(0x361)](a31_0x185d3c[_0x3492bd(0x328)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console['error'](a31_0x185d3c[_0x3492bd(0x307)](_0x70d7ce['value'])),console[_0x3492bd(0x361)]('')),await handleSDKOutput([_0x70d7ce],_0x29aef4),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x172);['description']=a31_0x42adf9(0x1c7);async[a31_0x42adf9(0x201)](_0x4edc35){const _0x3b37b4=a31_0x42adf9,{options:_0x4dd60c,args:_0x583dbf,tdx:_0x3cb766}=_0x4edc35,_0x391141=_0x583dbf[0x0],_0x3b6a04=_0x583dbf[0x1]||_0x4dd60c[_0x3b37b4(0x15e)];if(!_0x391141)return console[_0x3b37b4(0x361)]('Error:\x20Token\x20ID\x20is\x20required'),console['error'](_0x3b37b4(0x16f)),console[_0x3b37b4(0x361)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3b6a04)return showParentSegmentNotSetError(_0x3b37b4(0x22e)+_0x3b37b4(0x2e3)),0x1;const _0x4e6546=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b6a04+_0x3b37b4(0x1e2),()=>_0x3cb766['segment']['resolveParentId'](_0x3b6a04),{'verbose':_0x4dd60c[_0x3b37b4(0x24b)]}),_0x44351c=_0x4e6546[_0x3b37b4(0x25a)],_0x27e045=await withSpinner(_0x3b37b4(0x317),()=>_0x3cb766[_0x3b37b4(0x17b)][_0x3b37b4(0x2cc)](_0x44351c),{'verbose':_0x4dd60c['verbose']}),_0x409e4b=_0x27e045[_0x3b37b4(0x25a)];let _0x2c8171;for(const _0x4a6989 of _0x409e4b){if(_0x4a6989[_0x3b37b4(0x20d)]?.[_0x3b37b4(0x1e9)](_0x5a866a=>_0x5a866a['id']===_0x391141)){_0x2c8171=_0x4a6989['id'];break;}}if(!_0x2c8171)return console[_0x3b37b4(0x361)]('Error:\x20Token\x20\x27'+_0x391141+_0x3b37b4(0x335)),0x1;const _0x194c2c=await withSpinner('Deleting\x20token\x20\x27'+_0x391141+_0x3b37b4(0x1e2),()=>_0x3cb766[_0x3b37b4(0x17b)][_0x3b37b4(0x26b)](_0x44351c,_0x2c8171,_0x391141),{'verbose':_0x4dd60c[_0x3b37b4(0x24b)]}),_0x37a883=_0x194c2c['data'];return console['error'](_0x3b37b4(0x1cf)+(_0x37a883['name']||_0x391141)+'\x27'),await handleSDKOutput([_0x37a883],_0x4dd60c),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x34b);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x1b4);async['execute'](_0x279364){const _0x5a7e4d=a31_0x42adf9,{options:_0x47b4ce,args:_0x475cae,tdx:_0x21316c}=_0x279364,_0x3dc273=_0x475cae[0x0]||_0x47b4ce['parentSegment'];if(!_0x3dc273)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a'+_0x5a7e4d(0x35e)),0x1;const _0x362b6a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3dc273+_0x5a7e4d(0x1e2),()=>_0x21316c[_0x5a7e4d(0x271)][_0x5a7e4d(0x183)](_0x3dc273),{'verbose':_0x47b4ce[_0x5a7e4d(0x24b)]}),_0x3a5ff9=_0x362b6a[_0x5a7e4d(0x25a)],_0x31ba4d=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x3dc273+_0x5a7e4d(0x1e2),()=>_0x21316c[_0x5a7e4d(0x17b)][_0x5a7e4d(0x1af)](_0x3a5ff9),{'verbose':_0x47b4ce[_0x5a7e4d(0x24b)]}),_0xe1f103=_0x31ba4d[_0x5a7e4d(0x25a)];console[_0x5a7e4d(0x361)](_0x5a7e4d(0x2d0)+_0xe1f103[_0x5a7e4d(0x1f1)]+_0x5a7e4d(0x157)+(_0xe1f103[_0x5a7e4d(0x1f1)]!==0x1?'s':''));if(_0x47b4ce[_0x5a7e4d(0x1c2)]===_0x5a7e4d(0x229)||_0x47b4ce[_0x5a7e4d(0x1c2)]===_0x5a7e4d(0x18d))await handleSDKOutput(_0xe1f103,_0x47b4ce);else{if(_0xe1f103['length']===0x0)console['log']('No\x20personalizations\x20configured');else for(const _0x1947b9 of _0xe1f103){console[_0x5a7e4d(0x206)](a31_0x185d3c[_0x5a7e4d(0x35b)](_0x1947b9['name'])+'\x20'+a31_0x185d3c[_0x5a7e4d(0x1f2)](_0x5a7e4d(0x1be)+_0x1947b9['id']+')'));_0x1947b9['description']&&console['log']('\x20\x20'+a31_0x185d3c[_0x5a7e4d(0x1f2)](_0x1947b9[_0x5a7e4d(0x2c9)]));const _0x30d81b=_0x1947b9['sections']?.[_0x5a7e4d(0x1f1)]||0x0;console['log']('\x20\x20'+a31_0x185d3c['cyan'](_0x5a7e4d(0x25e))+'\x20'+_0x30d81b);if(_0x1947b9[_0x5a7e4d(0x22d)]&&_0x1947b9[_0x5a7e4d(0x22d)][_0x5a7e4d(0x1f1)]>0x0)for(const _0x2155d8 of _0x1947b9[_0x5a7e4d(0x22d)]){console[_0x5a7e4d(0x206)](_0x5a7e4d(0x1a0)+_0x2155d8[_0x5a7e4d(0x321)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x42adf9(0x321)]='ps:pz:show';[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x1f9);async[a31_0x42adf9(0x201)](_0x3a2139){const _0x2103c7=a31_0x42adf9,{options:_0x5c12af,args:_0x451c95,tdx:_0xa9139a}=_0x3a2139,_0x1e3330=_0x451c95[0x0];if(!_0x1e3330)return console[_0x2103c7(0x361)](_0x2103c7(0x17c)),console[_0x2103c7(0x361)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x52988f=await withSpinner(_0x2103c7(0x27f)+_0x1e3330+_0x2103c7(0x1e2),()=>_0xa9139a[_0x2103c7(0x17b)][_0x2103c7(0x167)](_0x1e3330),{'verbose':_0x5c12af['verbose']}),_0x493080=_0x52988f[_0x2103c7(0x25a)];console[_0x2103c7(0x361)]('✔\x20Found\x20personalization\x20\x27'+_0x493080[_0x2103c7(0x321)]+'\x27');if(_0x5c12af['format']==='json'||_0x5c12af[_0x2103c7(0x1c2)]===_0x2103c7(0x18d))await handleSDKOutput([_0x493080],_0x5c12af);else{console[_0x2103c7(0x206)](a31_0x185d3c[_0x2103c7(0x35b)](_0x493080[_0x2103c7(0x321)])+'\x20'+a31_0x185d3c['dim'](_0x2103c7(0x1be)+_0x493080['id']+')'));_0x493080[_0x2103c7(0x2c9)]&&console['log']('\x20\x20'+a31_0x185d3c[_0x2103c7(0x1f2)](_0x493080[_0x2103c7(0x2c9)]));_0x493080[_0x2103c7(0x2b6)]&&console[_0x2103c7(0x206)]('\x20\x20'+a31_0x185d3c[_0x2103c7(0x307)](_0x2103c7(0x267))+'\x20'+_0x493080[_0x2103c7(0x2b6)]);console[_0x2103c7(0x206)]('\x20\x20'+a31_0x185d3c[_0x2103c7(0x307)](_0x2103c7(0x350))+'\x20'+_0x493080[_0x2103c7(0x31e)]),console[_0x2103c7(0x206)]('\x20\x20'+a31_0x185d3c[_0x2103c7(0x307)](_0x2103c7(0x238))+'\x20'+_0x493080['updatedAt']);const _0x4b3499=_0x493080['sections']?.[_0x2103c7(0x1f1)]||0x0;console[_0x2103c7(0x206)]('\x20\x20'+a31_0x185d3c[_0x2103c7(0x307)](_0x2103c7(0x25e))+'\x20'+_0x4b3499);if(_0x493080[_0x2103c7(0x22d)]&&_0x493080[_0x2103c7(0x22d)]['length']>0x0)for(const _0x5f4da5 of _0x493080[_0x2103c7(0x22d)]){console['log']('\x20\x20\x20\x20'+a31_0x185d3c[_0x2103c7(0x35b)](_0x5f4da5['name'])+'\x20'+a31_0x185d3c['dim']('(id:\x20'+_0x5f4da5['id']+')')),_0x5f4da5[_0x2103c7(0x32a)]&&(console[_0x2103c7(0x206)]('\x20\x20\x20\x20\x20\x20'+a31_0x185d3c['cyan']('entryCriteria:')+'\x20'+_0x5f4da5['entryCriteria'][_0x2103c7(0x321)]),_0x5f4da5[_0x2103c7(0x32a)][_0x2103c7(0x32d)]?.[_0x2103c7(0x2ca)]&&console[_0x2103c7(0x206)](_0x2103c7(0x1e1)+a31_0x185d3c[_0x2103c7(0x307)](_0x2103c7(0x352))+'\x20'+_0x5f4da5[_0x2103c7(0x32a)]['keyEventCriteria'][_0x2103c7(0x2ca)])),_0x5f4da5[_0x2103c7(0x173)]&&console[_0x2103c7(0x206)](_0x2103c7(0x24f)+a31_0x185d3c[_0x2103c7(0x307)](_0x2103c7(0x190))+'\x20'+JSON[_0x2103c7(0x1bf)](_0x5f4da5['payload'])),_0x5f4da5[_0x2103c7(0x181)]&&console[_0x2103c7(0x206)]('\x20\x20\x20\x20\x20\x20'+a31_0x185d3c[_0x2103c7(0x307)]('includeSensitive:')+_0x2103c7(0x327));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x42adf9(0x321)]='ps:pz:delete';[a31_0x42adf9(0x2c9)]='Delete\x20a\x20realtime\x20personalization';async[a31_0x42adf9(0x201)](_0x920f45){const _0x461045=a31_0x42adf9,{options:_0x5063fb,args:_0x4fb6cd,tdx:_0xda93df}=_0x920f45,_0x3f8fae=_0x4fb6cd[0x0];if(!_0x3f8fae)return console[_0x461045(0x361)]('Error:\x20Personalization\x20ID\x20is\x20required'),console['error'](_0x461045(0x211)),0x1;return await withSpinner(_0x461045(0x2c7)+_0x3f8fae+_0x461045(0x1e2),()=>_0xda93df[_0x461045(0x17b)][_0x461045(0x293)](_0x3f8fae),{'verbose':_0x5063fb[_0x461045(0x24b)]}),console['error'](_0x461045(0x2a1)+_0x3f8fae+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0x42adf9(0x2df);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x344);async[a31_0x42adf9(0x201)](_0x2c2d9d){const _0x35982d=a31_0x42adf9,{options:_0x26b7cc,tdx:_0x18ef26}=_0x2c2d9d,_0xd2c7f0=_0x26b7cc;let _0x4afefb;if(_0xd2c7f0[_0x35982d(0x236)]){_0x4afefb=await loadJSON(_0xd2c7f0[_0x35982d(0x236)],!![]);if(!_0x4afefb[_0x35982d(0x2de)]?.[_0x35982d(0x277)])return console['error'](_0x35982d(0x1ef)),console[_0x35982d(0x361)](_0x35982d(0x34d)),console[_0x35982d(0x361)](_0x35982d(0x1f7)),0x1;}else{if(!_0xd2c7f0[_0x35982d(0x321)])return console[_0x35982d(0x361)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x35982d(0x361)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console['error'](_0x35982d(0x341)),0x1;if(_0xd2c7f0[_0x35982d(0x2c9)]===undefined)return console['error'](_0x35982d(0x188)),console[_0x35982d(0x361)](_0x35982d(0x31c)),console[_0x35982d(0x361)](_0x35982d(0x341)),0x1;if(_0xd2c7f0[_0x35982d(0x371)]===undefined)return console[_0x35982d(0x361)](_0x35982d(0x282)),console[_0x35982d(0x361)](_0x35982d(0x22f)),0x1;let _0xeaadaf=_0xd2c7f0[_0x35982d(0x2b6)];if(!_0xeaadaf&&_0x26b7cc['parentSegment']){const _0x2980ab=await withSpinner(_0x35982d(0x1e5)+_0x26b7cc[_0x35982d(0x15e)]+_0x35982d(0x1e2),()=>_0x18ef26[_0x35982d(0x271)][_0x35982d(0x183)](_0x26b7cc[_0x35982d(0x15e)]),{'verbose':_0x26b7cc[_0x35982d(0x24b)]});_0xeaadaf=_0x2980ab[_0x35982d(0x25a)];}let _0x5aba96;_0xd2c7f0[_0x35982d(0x22d)]&&(_0x5aba96=await loadJSON(_0xd2c7f0['sections'],![]));const _0x9bf2ad=_0xd2c7f0[_0x35982d(0x371)]===_0x35982d(0x243)?null:{'id':_0xd2c7f0[_0x35982d(0x371)],'type':'folder-segment'};_0x4afefb={'attributes':{'name':_0xd2c7f0[_0x35982d(0x321)],'description':_0xd2c7f0[_0x35982d(0x2c9)]||null,..._0xeaadaf!==undefined&&{'audienceId':_0xeaadaf},..._0x5aba96!==undefined&&{'sections':_0x5aba96}},'relationships':{'parentFolder':{'data':_0x9bf2ad}}};}const _0x22bf7a=await withSpinner(_0x35982d(0x242)+(_0x4afefb['attributes']?.[_0x35982d(0x321)]??'')+'\x27...',()=>_0x18ef26[_0x35982d(0x17b)][_0x35982d(0x337)](_0x4afefb),{'verbose':_0x26b7cc[_0x35982d(0x24b)]}),_0x3ec82d=_0x22bf7a['data'];return console[_0x35982d(0x361)]('✔\x20Created\x20personalization\x20\x27'+_0x3ec82d[_0x35982d(0x321)]+_0x35982d(0x356)+_0x3ec82d['id']),await handleSDKOutput([_0x3ec82d],_0x26b7cc),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x42adf9(0x321)]=a31_0x42adf9(0x24c);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x372);async[a31_0x42adf9(0x201)](_0x3bc9df){const _0x50089c=a31_0x42adf9,{options:_0x138f41,args:_0x36717a}=_0x3bc9df,_0x53293d=_0x138f41,_0xe49fc2=_0x36717a[0x0];if(!_0xe49fc2)return console['error'](_0x50089c(0x17c)),console[_0x50089c(0x361)](_0x50089c(0x251)),console['error'](_0x50089c(0x1c1)),0x1;let _0x44e7c9;if(_0x53293d[_0x50089c(0x236)])_0x44e7c9=await loadJSON(_0x53293d[_0x50089c(0x236)],!![]);else{if(!_0x53293d['name'])return console[_0x50089c(0x361)](_0x50089c(0x192)),console[_0x50089c(0x361)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x53293d[_0x50089c(0x2c9)]===undefined)return console[_0x50089c(0x361)](_0x50089c(0x188)),console[_0x50089c(0x361)](_0x50089c(0x251)),0x1;let _0x51ab82;_0x53293d[_0x50089c(0x22d)]&&(_0x51ab82=await loadJSON(_0x53293d[_0x50089c(0x22d)],![])),_0x44e7c9={'attributes':{'name':_0x53293d['name'],'description':_0x53293d[_0x50089c(0x2c9)]||null,..._0x51ab82!==undefined&&{'sections':_0x51ab82}}};}const {tdx:_0x355195}=_0x3bc9df,_0x21d7f5=await withSpinner('Patching\x20personalization\x20\x27'+_0xe49fc2+'\x27...',()=>_0x355195[_0x50089c(0x17b)]['patchPersonalization'](_0xe49fc2,_0x44e7c9),{'verbose':_0x138f41[_0x50089c(0x24b)]}),_0x142006=_0x21d7f5['data'];return console[_0x50089c(0x361)](_0x50089c(0x232)+_0x142006[_0x50089c(0x321)]+'\x27\x20(id:\x20'+_0x142006['id']+')'),await handleSDKOutput([_0x142006],_0x138f41),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x42adf9(0x34a);[a31_0x42adf9(0x2c9)]=a31_0x42adf9(0x17d);async[a31_0x42adf9(0x201)](_0x5c14dd){const _0x2eee4d=a31_0x42adf9,{options:_0xd859fb,args:_0xf9e84d}=_0x5c14dd,_0x53e874=_0xf9e84d[0x0]||_0xd859fb[_0x2eee4d(0x15e)];if(!_0x53e874)return showParentSegmentNotSetError(_0x2eee4d(0x1d3)+_0x2eee4d(0x349)),0x1;const _0x545511=resolveYamlFile(_0x53e874);if(!existsSync(_0x545511))return showFileNotFoundError(_0x545511,_0x53e874),0x1;let _0x37fb79;try{_0x37fb79=readFileSync(_0x545511,_0x2eee4d(0x21f));}catch(_0x3311e4){const _0x5b6757=_0x3311e4 instanceof Error?_0x3311e4['message']:String(_0x3311e4);return console[_0x2eee4d(0x361)](_0x2eee4d(0x2be)+_0x5b6757),0x1;}let _0x3f7afa;try{_0x3f7afa=parseDef(_0x37fb79);}catch(_0x4bc817){const _0x3c3b38=_0x4bc817 instanceof Error?_0x4bc817[_0x2eee4d(0x1f5)]:String(_0x4bc817);return console['error'](a31_0x185d3c[_0x2eee4d(0x36e)](_0x2eee4d(0x19b)+_0x3c3b38)),0x1;}if(_0x3f7afa[_0x2eee4d(0x1e6)]&&_0x3f7afa['personalization_services'][_0x2eee4d(0x1f1)]>0x0)return console[_0x2eee4d(0x361)](a31_0x185d3c[_0x2eee4d(0x328)](_0x2eee4d(0x2f1)+_0x545511)),console[_0x2eee4d(0x361)](a31_0x185d3c[_0x2eee4d(0x1f2)](_0x2eee4d(0x19d)+_0x3f7afa[_0x2eee4d(0x1e6)][_0x2eee4d(0x1f1)]+_0x2eee4d(0x1d6))),0x1;!_0x3f7afa[_0x2eee4d(0x368)]&&(_0x3f7afa['realtime']={'events':[{'name':_0x2eee4d(0x179),'source_table':_0x2eee4d(0x160)}],'attributes':[{'name':_0x2eee4d(0x364),'type':_0x2eee4d(0x27a)}],'id_stitching':{'primary_key':_0x3f7afa['master'][_0x2eee4d(0x36d)]===_0x2eee4d(0x300)?_0x2eee4d(0x2e5):_0x2eee4d(0x29d)}});_0x3f7afa[_0x2eee4d(0x1e6)]=[{'name':'My\x20Service','description':'Personalization\x20service\x20description','trigger_event':_0x2eee4d(0x179),'sections':[{'name':_0x2eee4d(0x2b7),'criteria':_0x2eee4d(0x32b),'attributes':[_0x2eee4d(0x364)]}]}];const _0x479c28=serializeDef(_0x3f7afa);return writeFileSync(_0x545511,_0x479c28,_0x2eee4d(0x21f)),console['error'](a31_0x185d3c[_0x2eee4d(0x28f)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x185d3c[_0x2eee4d(0x307)](_0x545511)),(!_0x3f7afa[_0x2eee4d(0x368)]||_0x37fb79[_0x2eee4d(0x20a)](_0x2eee4d(0x178))===-0x1)&&console[_0x2eee4d(0x361)](a31_0x185d3c[_0x2eee4d(0x28f)]('✔')+_0x2eee4d(0x2b1)),console[_0x2eee4d(0x361)]('\x0a'+a31_0x185d3c['dim'](_0x2eee4d(0x2b2))),console[_0x2eee4d(0x361)]('\x20\x201.\x20Edit\x20'+_0x545511+_0x2eee4d(0x1b7)),console[_0x2eee4d(0x361)](_0x2eee4d(0x367)+a31_0x185d3c[_0x2eee4d(0x1f2)](_0x2eee4d(0x311)+_0x53e874)+_0x2eee4d(0x29e)),0x0;}}
|