@treasuredata/tdx 2026.3.53 → 2026.4.55
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.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +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.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/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 +27 -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.d.ts +10 -0
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +61 -3
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +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/agent/types/agent-def.d.ts +43 -0
- package/dist/sdk/agent/types/agent-def.d.ts.map +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.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.d.ts +73 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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 +28 -1
- 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-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +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/index.d.ts +2 -2
- 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/llm.d.ts +158 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workflow.d.ts +26 -0
- package/dist/sdk/types/workflow.d.ts.map +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 +22 -0
- 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/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.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.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x2d63b8=a31_0x5a47;(function(_0x1d035a,_0xda3790){const _0xeefeea=a31_0x5a47,_0x222d5f=_0x1d035a();while(!![]){try{const _0x5de228=-parseInt(_0xeefeea(0xf7))/0x1*(-parseInt(_0xeefeea(0x240))/0x2)+parseInt(_0xeefeea(0x1a4))/0x3+parseInt(_0xeefeea(0x1ac))/0x4+-parseInt(_0xeefeea(0x133))/0x5*(parseInt(_0xeefeea(0x117))/0x6)+-parseInt(_0xeefeea(0x1f8))/0x7+-parseInt(_0xeefeea(0x1ee))/0x8*(-parseInt(_0xeefeea(0xf8))/0x9)+-parseInt(_0xeefeea(0x14c))/0xa;if(_0x5de228===_0xda3790)break;else _0x222d5f['push'](_0x222d5f['shift']());}catch(_0x51d646){_0x222d5f['push'](_0x222d5f['shift']());}}}(a31_0x3692,0x22ed1));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x141e1c 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_0x1fbc7e 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_0x2d63b8(0x21b),LEGACY_PARENT_SEGMENT_DIR=a31_0x2d63b8(0x236);function openBrowser(_0x50856c){const _0x14e4ff=a31_0x2d63b8,_0x3b3ad0=process[_0x14e4ff(0x25a)],_0x37726c=_0x3b3ad0===_0x14e4ff(0xb6)?_0x14e4ff(0x10f):_0x3b3ad0==='win32'?_0x14e4ff(0xe5):_0x14e4ff(0x1c3);spawn(_0x37726c,[_0x50856c],{'detached':!![],'stdio':_0x14e4ff(0x289)})[_0x14e4ff(0x254)]();}function migrateLegacyDirectory(){const _0x3a72b8=a31_0x2d63b8;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4cea3b=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4cea3b[_0x3a72b8(0x2b4)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a31_0x1fbc7e[_0x3a72b8(0x29a)](_0x3a72b8(0x27d)+LEGACY_PARENT_SEGMENT_DIR+_0x3a72b8(0x275)+PARENT_SEGMENT_DIR+_0x3a72b8(0x233))),console['error'](a31_0x1fbc7e['dim'](_0x3a72b8(0x169)+LEGACY_PARENT_SEGMENT_DIR+_0x3a72b8(0x1ae))),![];console[_0x3a72b8(0x17a)](a31_0x1fbc7e[_0x3a72b8(0x29a)](_0x3a72b8(0x1b8)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x3a72b8(0x17a)](a31_0x1fbc7e[_0x3a72b8(0xb5)](_0x3a72b8(0x20e)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x183512){const _0x3d9a34=_0x183512 instanceof Error?_0x183512[_0x3a72b8(0x1b6)]:String(_0x183512);return console['error'](a31_0x1fbc7e[_0x3a72b8(0x1d8)](_0x3a72b8(0x14d)+_0x3d9a34+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x2d63b8(0x271)](_0x4a4e3f){const _0x5998fb=a31_0x2d63b8;return migrateLegacyDirectory(),super[_0x5998fb(0x271)](_0x4a4e3f);}}function resolveYamlFile(_0x54cdde){const _0x325361=a31_0x2d63b8;if(_0x54cdde[_0x325361(0x1db)](_0x325361(0x194))||_0x54cdde[_0x325361(0x1db)](_0x325361(0x226)))return _0x54cdde;return a31_0x141e1c[_0x325361(0x19d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x54cdde)+_0x325361(0x194));}function formatProgressMessage(_0x5bd35d){const _0x3254b9=a31_0x2d63b8,_0x4cd20c=_0x5bd35d[_0x3254b9(0x19b)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4cd20c){const [,_0x16aaf0,_0xbf0c4d,_0x1f4de3='']=_0x4cd20c;return a31_0x1fbc7e[_0x3254b9(0x1a0)](_0x16aaf0+':')+'\x20'+_0xbf0c4d+a31_0x1fbc7e['dim'](_0x1f4de3);}return a31_0x1fbc7e[_0x3254b9(0x1a0)](_0x5bd35d);}function showFileNotFoundError(_0x5541b2,_0xd8327b){const _0x42f76e=a31_0x2d63b8;console[_0x42f76e(0x17a)](a31_0x1fbc7e[_0x42f76e(0x1d8)](_0x42f76e(0x205)+_0x5541b2+'\x0a')),console[_0x42f76e(0x17a)](a31_0x1fbc7e[_0x42f76e(0x26d)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0xd8327b+_0x42f76e(0x1b3)));}function displayRealtimeValidation(_0x376c1c){const _0x3d0d05=a31_0x2d63b8;if(!_0x376c1c['realtime'])return;const _0x5e871c=_0x376c1c[_0x3d0d05(0x27e)],_0x1ba166=_0x5e871c[_0x3d0d05(0xb7)]?a31_0x1fbc7e[_0x3d0d05(0xb5)](_0x3d0d05(0x1fc)):a31_0x1fbc7e[_0x3d0d05(0x29a)](_0x3d0d05(0x2b5));console[_0x3d0d05(0x17a)]('\x0a'+a31_0x1fbc7e[_0x3d0d05(0x1a0)](_0x3d0d05(0x116))+'\x20'+_0x1ba166);if(_0x5e871c[_0x3d0d05(0x18e)]&&_0x5e871c[_0x3d0d05(0x18e)][_0x3d0d05(0x1ba)]>0x0){console[_0x3d0d05(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x3d0d05(0x1a0)](_0x3d0d05(0x283))+'\x20'+_0x5e871c[_0x3d0d05(0x18e)][_0x3d0d05(0x1ba)]+_0x3d0d05(0x16f));for(const _0x4f350e of _0x5e871c['events']){const _0x35e486=_0x4f350e[_0x3d0d05(0x1e1)]===![]?a31_0x1fbc7e['red']('✘'):a31_0x1fbc7e[_0x3d0d05(0xb5)]('✔');console[_0x3d0d05(0x17a)](_0x3d0d05(0x25d)+_0x35e486+'\x20'+_0x4f350e[_0x3d0d05(0x105)]),_0x4f350e[_0x3d0d05(0x20d)]&&console['error'](_0x3d0d05(0x212)+a31_0x1fbc7e[_0x3d0d05(0x1d8)](_0x4f350e[_0x3d0d05(0x20d)]));}}if(_0x5e871c[_0x3d0d05(0x17d)]&&_0x5e871c[_0x3d0d05(0x17d)][_0x3d0d05(0x1ba)]>0x0){console[_0x3d0d05(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x3d0d05(0x1a0)](_0x3d0d05(0x195))+'\x20'+_0x5e871c['attributes'][_0x3d0d05(0x1ba)]+'\x20configured');for(const _0x39be07 of _0x5e871c[_0x3d0d05(0x17d)]){const _0x40a699=_0x39be07[_0x3d0d05(0x1f4)]?a31_0x1fbc7e[_0x3d0d05(0xb5)]('✔'):a31_0x1fbc7e['red']('✘');console[_0x3d0d05(0x17a)](_0x3d0d05(0x25d)+_0x40a699+'\x20'+_0x39be07['name']+'\x20'+a31_0x1fbc7e['dim']('('+_0x39be07[_0x3d0d05(0xa3)]+')'));}}if(_0x5e871c[_0x3d0d05(0x172)]){const _0x2a9907=_0x5e871c[_0x3d0d05(0x172)][_0x3d0d05(0x149)]?.[_0x3d0d05(0x1ba)]?'\x20+\x20['+_0x5e871c['idStitching'][_0x3d0d05(0x149)][_0x3d0d05(0x19d)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x1fbc7e[_0x3d0d05(0x1a0)](_0x3d0d05(0xd1))+'\x20'+_0x5e871c[_0x3d0d05(0x172)][_0x3d0d05(0x15d)]+_0x2a9907);}if(_0x5e871c[_0x3d0d05(0x12b)]&&_0x5e871c[_0x3d0d05(0x12b)][_0x3d0d05(0x1ba)]>0x0){console[_0x3d0d05(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x3d0d05(0x1a0)](_0x3d0d05(0x24a))+'\x20'+_0x5e871c[_0x3d0d05(0x12b)][_0x3d0d05(0x1ba)]+_0x3d0d05(0xfe)+(_0x5e871c[_0x3d0d05(0x12b)][_0x3d0d05(0x1ba)]!==0x1?'s':''));for(const _0x238a65 of _0x5e871c['personalizationServices']){console['error']('\x20\x20\x20\x20-\x20'+_0x238a65[_0x3d0d05(0x105)]);}}}function showParentSegmentNotSetError(_0x303562){const _0xfc80ed=a31_0x2d63b8;console[_0xfc80ed(0x17a)](a31_0x1fbc7e['yellow'](_0xfc80ed(0x12a))),console[_0xfc80ed(0x17a)](_0x303562);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x2d63b8(0x105)]='segment:parent:list';[a31_0x2d63b8(0x2ad)]='List\x20parent\x20segments';async['execute'](_0xcc8179){const _0x39cd55=a31_0x2d63b8,{options:_0x102a59,args:_0x56c44c,tdx:_0x5dfdfe}=_0xcc8179,_0x5a576b=_0x56c44c[0x0];_0x102a59['verbose']&&(console['error'](_0x39cd55(0x26b)+_0x102a59[_0x39cd55(0xe0)]),_0x5a576b&&console[_0x39cd55(0x17a)]('Pattern:\x20'+_0x5a576b));const _0x5904d7=await withSpinner(_0x5a576b?_0x39cd55(0x183)+_0x5a576b+'\x27...':'Listing\x20parent\x20segments...',()=>_0x5dfdfe[_0x39cd55(0xc6)][_0x39cd55(0x2b1)](),{'verbose':_0x102a59[_0x39cd55(0xfa)]});let _0x473323=_0x5904d7[_0x39cd55(0x244)];if(_0x5a576b){const _0x186abe=_0x5a576b[_0x39cd55(0x204)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x39cd55(0x204)](/\*/g,'.*')[_0x39cd55(0x204)](/\?/g,'.'),_0x45cc36=new RegExp('^'+_0x186abe+'$','i');_0x473323=_0x473323['filter'](_0x1b025a=>_0x45cc36[_0x39cd55(0xc8)](_0x1b025a[_0x39cd55(0x17d)]['name']));}_0x473323[_0x39cd55(0x248)]((_0x3c2bb2,_0x5706aa)=>_0x3c2bb2[_0x39cd55(0x17d)][_0x39cd55(0x105)][_0x39cd55(0xbd)](_0x5706aa[_0x39cd55(0x17d)][_0x39cd55(0x105)])),console[_0x39cd55(0x17a)](_0x39cd55(0x2b6)+_0x473323['length']+_0x39cd55(0x219)+(_0x473323[_0x39cd55(0x1ba)]!==0x1?'s':''));const _0x254632=_0x29ad69=>{const _0x1fe0f6=_0x39cd55;return getConsoleNextUrl(_0x102a59[_0x1fe0f6(0xe0)],_0x1fe0f6(0x132)+_0x29ad69);};if(_0x102a59['format']===_0x39cd55(0xeb)||_0x102a59[_0x39cd55(0xab)]===_0x39cd55(0xfd)){const _0x331f66=_0x473323[_0x39cd55(0x10b)](_0x34f855=>({..._0x34f855,'url':_0x254632(_0x34f855['id'])}));await handleSDKOutput(_0x331f66,_0x102a59);}else{if(_0x473323['length']===0x0)_0x5a576b?console[_0x39cd55(0x113)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x5a576b):console[_0x39cd55(0x113)](_0x39cd55(0x217));else for(const _0x3d8912 of _0x473323){const _0x5984e0=_0x3d8912[_0x39cd55(0x17d)][_0x39cd55(0x29d)]?a31_0x1fbc7e[_0x39cd55(0x1a0)]('\x20('+formatRows(_0x3d8912[_0x39cd55(0x17d)][_0x39cd55(0x29d)])+')'):'',_0x1a0ce8=hyperlink(_0x3d8912[_0x39cd55(0x17d)][_0x39cd55(0x105)],_0x254632(_0x3d8912['id']));console[_0x39cd55(0x113)]('👥\x20'+_0x1a0ce8+_0x5984e0);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x175);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x177);async[a31_0x2d63b8(0x25f)](_0x27e1cb){const _0x1a2e95=a31_0x2d63b8,{options:_0x13965f,args:_0x224b87,tdx:_0x45133f}=_0x27e1cb;console['error'](_0x1a2e95(0x24c)+_0x1a2e95(0x1c7)+_0x1a2e95(0x29b));const _0x334500=_0x13965f;if(_0x224b87[_0x1a2e95(0x1ba)]===0x0)return console[_0x1a2e95(0x17a)](a31_0x1fbc7e['red'](_0x1a2e95(0x288))),console[_0x1a2e95(0x17a)](_0x1a2e95(0xa8)),0x1;const _0x40a153=_0x224b87[0x0];if(!_0x334500['database']||!_0x334500[_0x1a2e95(0xca)])return console[_0x1a2e95(0x17a)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x1a2e95(0x17a)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x334500[_0x1a2e95(0xfa)]&&(console['error'](_0x1a2e95(0x26b)+_0x334500[_0x1a2e95(0xe0)]),console[_0x1a2e95(0x17a)]('Name:\x20'+_0x40a153),console[_0x1a2e95(0x17a)]('Database:\x20'+_0x334500[_0x1a2e95(0x139)]),console[_0x1a2e95(0x17a)](_0x1a2e95(0x2b0)+_0x334500[_0x1a2e95(0xca)]));const _0x24a790=await loadJSONFromOptions(_0x334500[_0x1a2e95(0x17d)],_0x334500[_0x1a2e95(0x196)]),_0x180e05=await loadJSONFromOptions(_0x334500[_0x1a2e95(0xda)],_0x334500['behaviorsFile']),_0x4fd2ef=await loadJSONFromOptions(_0x334500[_0x1a2e95(0x1af)],_0x334500[_0x1a2e95(0x1d7)]),_0x3ff590={'name':_0x40a153,'description':_0x334500[_0x1a2e95(0x2ad)],'scheduleType':_0x334500['scheduleType'],'scheduleOption':_0x334500['scheduleOption'],'timezone':_0x334500[_0x1a2e95(0x2b8)],'master':{'parentDatabaseName':_0x334500[_0x1a2e95(0x139)],'parentTableName':_0x334500['table']},'attributes':_0x24a790,'behaviors':_0x180e05,'customerGroup':_0x4fd2ef},_0xe8ba07=await withSpinner(_0x1a2e95(0x19e)+_0x40a153+_0x1a2e95(0x1ca),()=>_0x45133f[_0x1a2e95(0xc6)]['createParent'](_0x3ff590),{'verbose':_0x13965f['verbose']}),_0x3d0e20=_0xe8ba07[_0x1a2e95(0x244)];return console['error'](_0x1a2e95(0x253)+_0x3d0e20['name']+'\x27\x20with\x20ID:\x20'+_0x3d0e20['id']),await handleSDKOutput([_0x3d0e20],_0x13965f),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x148);['description']=a31_0x2d63b8(0xfb);async[a31_0x2d63b8(0x25f)](_0x196811){const _0x96e19e=a31_0x2d63b8,{options:_0x1f3dd1,args:_0x1d1e74,tdx:_0x450adc}=_0x196811;console[_0x96e19e(0x17a)](_0x96e19e(0x185)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x96e19e(0x29b));const _0x5782c6=_0x1f3dd1;if(_0x1d1e74[_0x96e19e(0x1ba)]===0x0)return console[_0x96e19e(0x17a)](a31_0x1fbc7e['red']('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x96e19e(0x17a)](_0x96e19e(0x1d3)),0x1;const _0x3b6355=_0x1d1e74[0x0];_0x5782c6[_0x96e19e(0xfa)]&&(console[_0x96e19e(0x17a)]('Site:\x20'+_0x5782c6['site']),console[_0x96e19e(0x17a)](_0x96e19e(0x119)+_0x3b6355));const _0x6187f7=await withSpinner(_0x96e19e(0x1d5)+_0x3b6355+_0x96e19e(0x1ca),()=>_0x450adc['segment']['getParentFull'](_0x3b6355),{'verbose':_0x5782c6[_0x96e19e(0xfa)]}),_0x34fab9=_0x6187f7[_0x96e19e(0x244)],_0x2c042e=await loadJSONFromOptions(_0x5782c6[_0x96e19e(0x297)],_0x5782c6[_0x96e19e(0xaf)]),_0x5f5101=await loadJSONFromOptions(_0x5782c6[_0x96e19e(0xe4)],_0x5782c6[_0x96e19e(0x11c)]),_0x55ef85={'name':_0x34fab9[_0x96e19e(0x105)],'description':_0x5782c6['description']!==undefined?_0x5782c6['description']:_0x34fab9[_0x96e19e(0x2ad)],'scheduleType':_0x5782c6[_0x96e19e(0x1be)]!==undefined?_0x5782c6[_0x96e19e(0x1be)]:_0x34fab9[_0x96e19e(0x1be)],'scheduleOption':_0x5782c6[_0x96e19e(0x20f)]!==undefined?_0x5782c6['scheduleOption']:_0x34fab9[_0x96e19e(0x20f)],'timezone':_0x5782c6['timezone']!==undefined?_0x5782c6['timezone']:_0x34fab9[_0x96e19e(0x2b8)],'master':_0x34fab9['master'],'attributes':_0x2c042e?[..._0x34fab9['attributes']||[],..._0x2c042e]:_0x34fab9[_0x96e19e(0x17d)],'behaviors':_0x5f5101?[..._0x34fab9[_0x96e19e(0xda)]||[],..._0x5f5101]:_0x34fab9[_0x96e19e(0xda)],'customerGroup':_0x34fab9[_0x96e19e(0x1af)]},_0xbf9870=await withSpinner(_0x96e19e(0x261)+_0x3b6355+_0x96e19e(0x1ca),()=>_0x450adc[_0x96e19e(0xc6)][_0x96e19e(0x12e)](_0x3b6355,_0x55ef85),{'verbose':_0x5782c6[_0x96e19e(0xfa)]}),_0x1de722=_0xbf9870[_0x96e19e(0x244)];return console[_0x96e19e(0x17a)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x1de722[_0x96e19e(0x105)]+'\x27'),await handleSDKOutput([_0x1de722],_0x5782c6),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x1e3);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x112);async[a31_0x2d63b8(0x25f)](_0x1c41da){const _0x585dda=a31_0x2d63b8,{options:_0x1a7022,args:_0x183831,tdx:_0x3c3069}=_0x1c41da,_0x4fcda3=_0x1a7022,_0x563de3=_0x183831[0x0]||_0x1a7022['parentSegment'];if(!_0x563de3)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'+_0x585dda(0x251)),0x1;if(_0x4fcda3['use']&&_0x4fcda3['output'])return console['error'](a31_0x1fbc7e[_0x585dda(0x1d8)](_0x585dda(0x1d2))),console['error'](a31_0x1fbc7e[_0x585dda(0x1a0)](_0x585dda(0xc0))),console[_0x585dda(0x17a)](a31_0x1fbc7e[_0x585dda(0x1a0)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x585dda(0x28b))),console[_0x585dda(0x17a)](a31_0x1fbc7e[_0x585dda(0x26d)](_0x585dda(0xbf))),0x1;const _0x38fe13=_0x4fcda3[_0x585dda(0x2ae)]||a31_0x141e1c[_0x585dda(0x19d)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x563de3)+_0x585dda(0x194));_0x4fcda3[_0x585dda(0xfa)]&&(console[_0x585dda(0x17a)](_0x585dda(0x26b)+_0x4fcda3[_0x585dda(0xe0)]),console['error'](_0x585dda(0x119)+_0x563de3),console[_0x585dda(0x17a)](_0x585dda(0x286)+_0x38fe13));const _0xb04746=await withSpinner(_0x585dda(0x104)+_0x563de3+'\x27...',()=>_0x3c3069['segment'][_0x585dda(0x23f)](_0x563de3),{'verbose':_0x4fcda3[_0x585dda(0xfa)]}),_0x1dc5b2=_0xb04746[_0x585dda(0x244)];if(existsSync(_0x38fe13)){const _0x3a821e=readFileSync(_0x38fe13,_0x585dda(0x28e)),_0x1adf4f=generateDiff(_0x3a821e,_0x1dc5b2);if(!hasChanges(_0x1adf4f))console[_0x585dda(0x17a)](a31_0x1fbc7e[_0x585dda(0xb5)]('✔')+_0x585dda(0x28d)+a31_0x1fbc7e[_0x585dda(0x26d)](_0x38fe13)+_0x585dda(0x127));else{console[_0x585dda(0x17a)](_0x585dda(0x241)+_0x38fe13+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x585dda(0x17a)](formatDiffWithColors(_0x1adf4f)),console[_0x585dda(0x17a)]('─'[_0x585dda(0x2bb)](0x3c));if(!_0x4fcda3[_0x585dda(0x1dd)]){if(!isInteractive())return console[_0x585dda(0x17a)](a31_0x1fbc7e[_0x585dda(0x1d8)](_0x585dda(0x1a7)),_0x585dda(0xe3)),console[_0x585dda(0x17a)](a31_0x1fbc7e[_0x585dda(0x1a0)](_0x585dda(0xe6))),0x1;const _0x432789=await confirmKey(_0x585dda(0x159)+_0x38fe13+'\x27?');if(!_0x432789)return console[_0x585dda(0x17a)](a31_0x1fbc7e['yellow']('Aborted.')),0x1;}writeFileSync(_0x38fe13,_0x1dc5b2,_0x585dda(0x28e)),console[_0x585dda(0x17a)](a31_0x1fbc7e[_0x585dda(0xb5)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x1fbc7e[_0x585dda(0x26d)](_0x38fe13));}}else{const _0x48ef4b=a31_0x141e1c['dirname'](_0x38fe13);!existsSync(_0x48ef4b)&&mkdirSync(_0x48ef4b,{'recursive':!![]}),writeFileSync(_0x38fe13,_0x1dc5b2,_0x585dda(0x28e)),console[_0x585dda(0x17a)](a31_0x1fbc7e['green']('✔')+_0x585dda(0x107)+a31_0x1fbc7e[_0x585dda(0x26d)](_0x38fe13));}return saveSessionContext({'parent_segment':_0x563de3},_0x4fcda3[_0x585dda(0x201)]),console['error'](a31_0x1fbc7e['green']('✔')+'\x20Context\x20set:\x20'+a31_0x1fbc7e[_0x585dda(0x1a0)](_0x585dda(0x236))+'\x20=\x20'+a31_0x1fbc7e['cyan'](_0x563de3)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';['description']='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a31_0x2d63b8(0x25f)](_0x8915f7){const _0x4925d6=a31_0x2d63b8,{options:_0x1d3851,args:_0x2c96be,tdx:_0x4c2f82}=_0x8915f7,_0x26e470=_0x1d3851,_0x5d0f3e=_0x2c96be[0x0]||_0x1d3851[_0x4925d6(0x1b7)];if(!_0x5d0f3e)return showParentSegmentNotSetError(_0x4925d6(0x178)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x231d17=resolveYamlFile(_0x5d0f3e);if(!existsSync(_0x231d17))return showFileNotFoundError(_0x231d17,_0x5d0f3e),0x1;_0x26e470['verbose']&&(console[_0x4925d6(0x17a)](_0x4925d6(0x26b)+_0x26e470[_0x4925d6(0xe0)]),console[_0x4925d6(0x17a)](_0x4925d6(0x192)+_0x231d17));let _0x1d946f;try{_0x1d946f=readFileSync(_0x231d17,'utf-8');}catch(_0x4f5a03){const _0x25ca0d=_0x4f5a03 instanceof Error?_0x4f5a03[_0x4925d6(0x1b6)]:String(_0x4f5a03);return console[_0x4925d6(0x17a)](_0x4925d6(0x162)+_0x25ca0d),0x1;}const _0x4a60ec=await withSpinner(_0x4925d6(0x17e),()=>_0x4c2f82[_0x4925d6(0xc6)]['pushParentYaml'](_0x1d946f),{'verbose':_0x26e470[_0x4925d6(0xfa)]}),_0x20ad12=_0x4a60ec['data'],{isNew:_0x2fb064,name:_0x2285b7,hasChanges:_0x39bf4e,diffFormatted:_0x4ef74c}=_0x20ad12;if(!_0x39bf4e)return console[_0x4925d6(0x17a)](_0x4925d6(0x292)+_0x2285b7+_0x4925d6(0x277)),0x0;_0x2fb064?console[_0x4925d6(0x17a)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x2285b7+'\x27:'):console[_0x4925d6(0x17a)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x2285b7+'\x27:');console[_0x4925d6(0x17a)]('─'[_0x4925d6(0x2bb)](0x3c)),console[_0x4925d6(0x17a)](_0x4ef74c),console[_0x4925d6(0x17a)]('─'[_0x4925d6(0x2bb)](0x3c));const _0x3eb6d5=_0x2fb064?_0x4925d6(0x276)+_0x2285b7+'\x27?':_0x4925d6(0x130)+_0x2285b7+'\x27?';if(!_0x26e470[_0x4925d6(0x1dd)]){if(!isInteractive())return console['error'](a31_0x1fbc7e[_0x4925d6(0x1d8)](_0x4925d6(0x1a7)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4925d6(0x17a)](a31_0x1fbc7e['dim'](_0x4925d6(0xe6))),0x1;const _0x490afc=await confirmKey(_0x3eb6d5);if(!_0x490afc)return console[_0x4925d6(0x17a)](a31_0x1fbc7e[_0x4925d6(0x29a)](_0x4925d6(0x22d))),0x1;}const _0x147b17=_0x2fb064?'Creating':_0x4925d6(0x1c4),_0x49183a=await withSpinner(_0x147b17+'\x20parent\x20segment\x20\x27'+_0x2285b7+_0x4925d6(0x1ca),()=>_0x20ad12[_0x4925d6(0x189)](),{'verbose':_0x26e470[_0x4925d6(0xfa)]}),_0x2cea49=_0x49183a['data'],_0x493835=getConsoleNextUrl(_0x26e470['site'],_0x4925d6(0x132)+_0x2cea49['id']),_0x17b236=_0x2fb064?_0x4925d6(0xde):_0x4925d6(0x100);return console[_0x4925d6(0x17a)]('✔\x20'+_0x17b236+_0x4925d6(0x268)+_0x2cea49[_0x4925d6(0x105)]+'\x27'),console[_0x4925d6(0x17a)]('\x20\x20'+_0x493835),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x17f);[a31_0x2d63b8(0x2ad)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async['execute'](_0x12563b){const _0x24bb49=a31_0x2d63b8,{options:_0x1ae7ea,args:_0x3acd1a,tdx:_0xbfeb69}=_0x12563b,_0x1431b7=_0x1ae7ea,_0x2ef54d=_0x3acd1a[0x0]||_0x1ae7ea[_0x24bb49(0x1b7)];if(!_0x2ef54d)return showParentSegmentNotSetError(_0x24bb49(0x1c8)+_0x24bb49(0x176)+'Options:\x0a'+_0x24bb49(0x27a)+_0x24bb49(0x28a)+_0x24bb49(0x249)),0x1;const _0x330a09=resolveYamlFile(_0x2ef54d);if(!existsSync(_0x330a09))return showFileNotFoundError(_0x330a09,_0x2ef54d),0x1;_0x1431b7['verbose']&&(console['error'](_0x24bb49(0x26b)+_0x1431b7[_0x24bb49(0xe0)]),console['error'](_0x24bb49(0x192)+_0x330a09));let _0x486765;try{_0x486765=readFileSync(_0x330a09,_0x24bb49(0x28e));}catch(_0x515d3e){const _0x5ee8e0=_0x515d3e instanceof Error?_0x515d3e[_0x24bb49(0x1b6)]:String(_0x515d3e);return console['error'](_0x24bb49(0x162)+_0x5ee8e0),0x1;}const _0x2f3208=createCommandSpinner(a31_0x1fbc7e[_0x24bb49(0x1a0)]('Validating\x20configuration...'),{'verbose':_0x1431b7['verbose']});_0x2f3208[_0x24bb49(0xe5)]();const _0x11842e={'onProgress':_0x312392=>{_0x2f3208['text']=formatProgressMessage(_0x312392);}};if(_0x1431b7[_0x24bb49(0x22b)])_0x11842e[_0x24bb49(0x22b)]=!![];if(_0x1431b7[_0x24bb49(0x16b)])_0x11842e[_0x24bb49(0x16b)]=!![];_0x1431b7['attribute']&&(_0x11842e['attribute']=_0x1431b7[_0x24bb49(0x279)]);_0x1431b7[_0x24bb49(0x168)]&&(_0x11842e[_0x24bb49(0x168)]=_0x1431b7[_0x24bb49(0x168)]);if(_0x1431b7['interval'])_0x11842e['interval']=_0x1431b7[_0x24bb49(0x299)];let _0x1c7695;try{_0x1c7695=await _0xbfeb69['segment'][_0x24bb49(0x1fe)](_0x486765,_0x11842e),_0x2f3208[_0x24bb49(0xaa)]();}catch(_0xbd05b9){_0x2f3208[_0x24bb49(0xaa)]();throw _0xbd05b9;}const _0x399081=_0x1431b7[_0x24bb49(0x299)]||'-1d';return this['displayValidateResults'](_0x1c7695,_0x11842e,_0x330a09,_0x399081),_0x1c7695[_0x24bb49(0x264)]?0x0:0x1;}[a31_0x2d63b8(0x273)](_0x3ef3f0,_0xee57d5,_0x440798,_0x3a26a4){const _0x3b5121=a31_0x2d63b8;console[_0x3b5121(0x17a)]('\x0a'+a31_0x1fbc7e[_0x3b5121(0x1f6)](_0x3b5121(0x12f))+'\x20'+_0x3ef3f0[_0x3b5121(0x105)]),console[_0x3b5121(0x17a)]('═'['repeat'](0x3c)),this['displayMasterInfo'](_0x3ef3f0);if(typeof _0xee57d5[_0x3b5121(0x279)]===_0x3b5121(0x171)){this[_0x3b5121(0x145)](_0x3ef3f0),this[_0x3b5121(0x23c)](_0x3ef3f0),this[_0x3b5121(0x2b3)](_0x440798,_0x3a26a4,'attribute',_0xee57d5['attribute']);return;}if(_0xee57d5[_0x3b5121(0x279)]===!![]){this[_0x3b5121(0x145)](_0x3ef3f0),this[_0x3b5121(0x23c)](_0x3ef3f0),this['displayPreviewHints'](_0x440798,_0x3a26a4,_0x3b5121(0x17d));return;}if(typeof _0xee57d5[_0x3b5121(0x168)]===_0x3b5121(0x171)){this[_0x3b5121(0x11a)](_0x3ef3f0,_0x3a26a4),this[_0x3b5121(0x23c)](_0x3ef3f0),this[_0x3b5121(0x2b3)](_0x440798,_0x3a26a4,_0x3b5121(0x168),_0xee57d5[_0x3b5121(0x168)]);return;}if(_0xee57d5[_0x3b5121(0x168)]===!![]){this['displayBehaviorsStats'](_0x3ef3f0,_0x3a26a4),this['displaySummary'](_0x3ef3f0),this[_0x3b5121(0x2b3)](_0x440798,_0x3a26a4,_0x3b5121(0xda));return;}this['displayAttributesStats'](_0x3ef3f0),this['displayBehaviorsStats'](_0x3ef3f0,_0x3a26a4),this['displayRealtimeInfo'](_0x3ef3f0),this[_0x3b5121(0x23c)](_0x3ef3f0),this['displayPreviewHints'](_0x440798,_0x3a26a4,'all');}[a31_0x2d63b8(0x1f9)](_0x2363aa){displayRealtimeValidation(_0x2363aa);}[a31_0x2d63b8(0x2b3)](_0x56da05,_0x361e8e,_0x535a6e,_0x38f0a8){const _0x406842=a31_0x2d63b8;console[_0x406842(0x17a)]('\x0a'+a31_0x1fbc7e[_0x406842(0x1a0)](_0x406842(0x15a)));const _0x28f966=_0x361e8e!==_0x406842(0x242)?_0x406842(0x10a)+_0x361e8e:'';if(_0x535a6e===_0x406842(0x279)&&_0x38f0a8)console[_0x406842(0x17a)]('\x20\x20'+a31_0x1fbc7e['dim'](_0x406842(0x13d)+_0x56da05+_0x406842(0x154)+_0x38f0a8+'\x22'+_0x28f966));else{if(_0x535a6e===_0x406842(0x168)&&_0x38f0a8)console['error']('\x20\x20'+a31_0x1fbc7e[_0x406842(0x1a0)](_0x406842(0x13d)+_0x56da05+_0x406842(0x260)+_0x38f0a8+'\x22'+_0x28f966));else(_0x535a6e===_0x406842(0x17d)||_0x535a6e===_0x406842(0x1eb))&&console['error']('\x20\x20'+a31_0x1fbc7e['dim']('tdx\x20ps\x20preview\x20'+_0x56da05+'\x20--attribute\x20\x22<name>\x22'+_0x28f966));}(_0x535a6e===_0x406842(0xda)||_0x535a6e===_0x406842(0x1eb))&&console[_0x406842(0x17a)]('\x20\x20'+a31_0x1fbc7e['dim'](_0x406842(0x13d)+_0x56da05+'\x20--behavior\x20\x22<name>\x22'+_0x28f966)),_0x535a6e===_0x406842(0x1eb)&&console[_0x406842(0x17a)]('\x20\x20'+a31_0x1fbc7e['dim'](_0x406842(0x13d)+_0x56da05+_0x406842(0x140)+_0x28f966));}['displayMasterInfo'](_0x14fc84){const _0x548b60=a31_0x2d63b8,{master:_0x18d77f}=_0x14fc84,_0x210911=_0x18d77f[_0x548b60(0x284)]?a31_0x1fbc7e[_0x548b60(0xb5)]('✔'):a31_0x1fbc7e[_0x548b60(0x1d8)]('✘');console[_0x548b60(0x17a)]('\x0a'+a31_0x1fbc7e[_0x548b60(0x1a0)](_0x548b60(0x1ab))),console['error'](_0x210911+'\x20'+a31_0x1fbc7e[_0x548b60(0x1f6)](_0x18d77f[_0x548b60(0x139)]+'.'+_0x18d77f[_0x548b60(0xca)])),_0x18d77f[_0x548b60(0x284)]?_0x18d77f[_0x548b60(0x222)]!==undefined&&console[_0x548b60(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x548b60(0x1a0)](_0x548b60(0x2ba))+'\x20'+a31_0x1fbc7e[_0x548b60(0x26d)](formatRows(_0x18d77f[_0x548b60(0x222)]))):console['error']('\x20\x20'+a31_0x1fbc7e[_0x548b60(0x1d8)](_0x548b60(0xdd))+'\x20'+_0x18d77f['schemaError']);}[a31_0x2d63b8(0x145)](_0x14814f){const _0x261327=a31_0x2d63b8;if(_0x14814f['attributes']['length']===0x0)return;console[_0x261327(0x17a)]('\x0a'+a31_0x1fbc7e[_0x261327(0x1a0)](_0x261327(0x227)));for(const _0xdbfecc of _0x14814f[_0x261327(0x17d)]){const _0x237019=_0xdbfecc['schemaValid']?a31_0x1fbc7e[_0x261327(0xb5)]('✔'):a31_0x1fbc7e[_0x261327(0x1d8)]('✘');let _0x300f55='';if(_0xdbfecc[_0x261327(0x284)]&&_0xdbfecc['matchedCount']!==undefined&&_0xdbfecc[_0x261327(0x1e2)]!==undefined){const _0x2f017e=_0xdbfecc[_0x261327(0x1e2)][_0x261327(0x26e)](0x1),_0x3f7fa6=_0xdbfecc[_0x261327(0x1e2)]>=0x50?a31_0x1fbc7e['green']:_0xdbfecc[_0x261327(0x1e2)]>=0x32?a31_0x1fbc7e['yellow']:a31_0x1fbc7e[_0x261327(0x1d8)];_0x300f55='\x20'+a31_0x1fbc7e[_0x261327(0x1a0)](_0x261327(0x2a0))+'\x20'+_0x3f7fa6(_0x2f017e+'%')+'\x20('+formatRows(_0xdbfecc[_0x261327(0x287)])+_0x261327(0x291);}console[_0x261327(0x17a)](_0x237019+'\x20'+a31_0x1fbc7e[_0x261327(0x1f6)](_0xdbfecc[_0x261327(0x105)])+_0x300f55),console[_0x261327(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x261327(0x1a0)](_0x261327(0xf6))+'\x20'+a31_0x1fbc7e['bold'](_0xdbfecc['database']+'.'+_0xdbfecc[_0x261327(0xca)]));const _0x590ed8=_0xdbfecc['joinKey']===_0xdbfecc[_0x261327(0x165)]?a31_0x1fbc7e[_0x261327(0x1a0)](_0x261327(0xb0))+'\x20'+_0xdbfecc[_0x261327(0x1cf)]:a31_0x1fbc7e[_0x261327(0x1a0)]('Join:')+'\x20'+_0xdbfecc['joinKey']+'\x20=\x20'+_0xdbfecc[_0x261327(0x165)];console[_0x261327(0x17a)]('\x20\x20'+_0x590ed8),console[_0x261327(0x17a)]('\x20\x20'+a31_0x1fbc7e['dim'](_0x261327(0x20c))),this[_0x261327(0x1c1)](_0xdbfecc[_0x261327(0x247)]),!_0xdbfecc[_0x261327(0x284)]&&console[_0x261327(0x17a)]('\x20\x20'+a31_0x1fbc7e['red']('Error:')+'\x20'+_0xdbfecc[_0x261327(0x265)]);}}[a31_0x2d63b8(0x11a)](_0x5ab28a,_0x2386c2){const _0x4877f4=a31_0x2d63b8;if(_0x5ab28a[_0x4877f4(0xda)][_0x4877f4(0x1ba)]===0x0)return;console[_0x4877f4(0x17a)]('\x0a'+a31_0x1fbc7e[_0x4877f4(0x1a0)](_0x4877f4(0x124))+'\x20'+a31_0x1fbc7e[_0x4877f4(0x1a0)]('('+_0x2386c2+')'));for(const _0x2891ed of _0x5ab28a[_0x4877f4(0xda)]){const _0x140918=_0x2891ed['schemaValid']?a31_0x1fbc7e[_0x4877f4(0xb5)]('✔'):a31_0x1fbc7e['red']('✘');let _0x455291='';if(_0x2891ed[_0x4877f4(0x284)]&&_0x2891ed['customersWithEvents']!==undefined&&_0x2891ed[_0x4877f4(0x18c)]!==undefined){const _0x1310aa=_0x2891ed[_0x4877f4(0x186)]?.['toFixed'](0x1)||'?',_0x17f3cb=(_0x2891ed[_0x4877f4(0x186)]??0x0)>=0x32?a31_0x1fbc7e[_0x4877f4(0xb5)]:(_0x2891ed[_0x4877f4(0x186)]??0x0)>=0x14?a31_0x1fbc7e[_0x4877f4(0x29a)]:a31_0x1fbc7e[_0x4877f4(0x1d8)];_0x455291='\x20'+a31_0x1fbc7e['dim'](_0x4877f4(0x136))+'\x20'+_0x17f3cb(formatRows(_0x2891ed[_0x4877f4(0xbc)]))+'\x20('+_0x1310aa+'%)\x20'+a31_0x1fbc7e['dim'](_0x4877f4(0x283))+'\x20'+a31_0x1fbc7e[_0x4877f4(0x26d)](formatRows(_0x2891ed['totalEvents']));}console['error'](_0x140918+'\x20'+a31_0x1fbc7e[_0x4877f4(0x1f6)](_0x2891ed[_0x4877f4(0x105)])+_0x455291),console['error']('\x20\x20'+a31_0x1fbc7e[_0x4877f4(0x1a0)](_0x4877f4(0xf6))+'\x20'+a31_0x1fbc7e[_0x4877f4(0x1f6)](_0x2891ed[_0x4877f4(0x139)]+'.'+_0x2891ed[_0x4877f4(0xca)]));const _0x345cdd=_0x2891ed['joinKey']===_0x2891ed[_0x4877f4(0x165)]?a31_0x1fbc7e[_0x4877f4(0x1a0)](_0x4877f4(0xb0))+'\x20'+_0x2891ed['joinKey']:a31_0x1fbc7e[_0x4877f4(0x1a0)]('Join:')+'\x20'+_0x2891ed['joinKey']+_0x4877f4(0x15c)+_0x2891ed[_0x4877f4(0x165)];console['error']('\x20\x20'+_0x345cdd),console[_0x4877f4(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x4877f4(0x1a0)](_0x4877f4(0x20c))),this[_0x4877f4(0x1c1)](_0x2891ed[_0x4877f4(0x247)]),!_0x2891ed['schemaValid']&&console[_0x4877f4(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x4877f4(0x1d8)](_0x4877f4(0xdd))+'\x20'+_0x2891ed['schemaError']);}}[a31_0x2d63b8(0x1c1)](_0xc9b137){const _0x2c8ba4=a31_0x2d63b8;for(const _0x52a4c6 of _0xc9b137){_0x52a4c6[_0x2c8ba4(0x190)]===_0x52a4c6[_0x2c8ba4(0x1ea)]||_0x52a4c6['column']==='*'?console['error'](_0x2c8ba4(0x150)+_0x52a4c6[_0x2c8ba4(0x190)]):console[_0x2c8ba4(0x17a)]('\x20\x20\x20\x20-\x20'+_0x52a4c6[_0x2c8ba4(0x190)]+'\x20'+a31_0x1fbc7e['dim']('('+_0x52a4c6[_0x2c8ba4(0x1ea)]+')'));}}['displaySummary'](_0x2dd087){const _0x2dec86=a31_0x2d63b8;console[_0x2dec86(0x17a)]('─'[_0x2dec86(0x2bb)](0x3c));if(_0x2dd087['errors'][_0x2dec86(0x1ba)]>0x0){console['error']('\x0a'+a31_0x1fbc7e[_0x2dec86(0x1d8)](_0x2dec86(0x2a7)));for(const _0xcf5b6c of _0x2dd087[_0x2dec86(0xff)]){console['error']('\x20\x20'+a31_0x1fbc7e['red']('•')+'\x20'+_0xcf5b6c);}}_0x2dd087[_0x2dec86(0x264)]&&console['error']('\x0a'+a31_0x1fbc7e[_0x2dec86(0xb5)]('✔')+_0x2dec86(0xa9));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0xbe);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0xf1);async[a31_0x2d63b8(0x25f)](_0x595802){const _0x25a6a1=a31_0x2d63b8,{options:_0x57236e,args:_0x5b3c70,tdx:_0x136887}=_0x595802,_0x12f7be=_0x57236e,_0x3579dc=_0x5b3c70[0x0]||_0x57236e[_0x25a6a1(0x1b7)];if(!_0x3579dc)return showParentSegmentNotSetError(_0x25a6a1(0x1a5)+_0x25a6a1(0x1a9)+_0x25a6a1(0x13a)+_0x25a6a1(0x1b2)+_0x25a6a1(0x1fa)+_0x25a6a1(0x229)+_0x25a6a1(0x167)+_0x25a6a1(0x249)),0x1;if(!_0x12f7be[_0x25a6a1(0x22b)]&&!_0x12f7be[_0x25a6a1(0x279)]&&!_0x12f7be['behavior']&&!_0x12f7be[_0x25a6a1(0x16b)])return console[_0x25a6a1(0x17a)](a31_0x1fbc7e['red']('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x25a6a1(0xf5)),console[_0x25a6a1(0x17a)]('Options:'),console[_0x25a6a1(0x17a)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x25a6a1(0x17a)](_0x25a6a1(0x223)),console['error'](_0x25a6a1(0x20a)),console['error'](_0x25a6a1(0xd0)),0x1;const _0x44822b=resolveYamlFile(_0x3579dc);if(!existsSync(_0x44822b))return showFileNotFoundError(_0x44822b,_0x3579dc),0x1;_0x12f7be[_0x25a6a1(0xfa)]&&(console[_0x25a6a1(0x17a)](_0x25a6a1(0x26b)+_0x12f7be[_0x25a6a1(0xe0)]),console[_0x25a6a1(0x17a)](_0x25a6a1(0x192)+_0x44822b));let _0x15b5b9;try{_0x15b5b9=readFileSync(_0x44822b,_0x25a6a1(0x28e));}catch(_0x24cbf0){const _0x51f560=_0x24cbf0 instanceof Error?_0x24cbf0[_0x25a6a1(0x1b6)]:String(_0x24cbf0);return console[_0x25a6a1(0x17a)]('Error\x20reading\x20file:\x20'+_0x51f560),0x1;}let _0x1c984b;try{_0x1c984b=parseDef(_0x15b5b9);}catch(_0x571513){const _0x2b19ac=_0x571513 instanceof Error?_0x571513[_0x25a6a1(0x1b6)]:String(_0x571513);return console[_0x25a6a1(0x17a)](a31_0x1fbc7e[_0x25a6a1(0x1d8)](_0x25a6a1(0xc1)+_0x2b19ac)),0x1;}if(_0x12f7be[_0x25a6a1(0x279)]===!![]||_0x12f7be[_0x25a6a1(0x279)]===''){const _0x5047bd=_0x1c984b[_0x25a6a1(0x17d)]?.['map'](_0x5131fa=>_0x5131fa[_0x25a6a1(0x105)])||[];if(_0x5047bd['length']===0x0)console[_0x25a6a1(0x17a)](a31_0x1fbc7e[_0x25a6a1(0x1d8)](_0x25a6a1(0x108)));else{console[_0x25a6a1(0x17a)](a31_0x1fbc7e[_0x25a6a1(0x1d8)](_0x25a6a1(0x1e9))),console[_0x25a6a1(0x17a)]('Available\x20attributes:');for(const _0x4b0f53 of _0x5047bd){console[_0x25a6a1(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x25a6a1(0x26d)](_0x4b0f53));}console[_0x25a6a1(0x17a)](_0x25a6a1(0x24e)+_0x3579dc+'\x20--attribute\x20\x22'+_0x5047bd[0x0]+'\x22');}return 0x1;}if(_0x12f7be['behavior']===!![]||_0x12f7be[_0x25a6a1(0x168)]===''){const _0x5918dd=_0x1c984b[_0x25a6a1(0xda)]?.[_0x25a6a1(0x10b)](_0xc2fa6b=>_0xc2fa6b[_0x25a6a1(0x105)])||[];if(_0x5918dd[_0x25a6a1(0x1ba)]===0x0)console[_0x25a6a1(0x17a)](a31_0x1fbc7e[_0x25a6a1(0x1d8)](_0x25a6a1(0x166)));else{console[_0x25a6a1(0x17a)](a31_0x1fbc7e[_0x25a6a1(0x1d8)](_0x25a6a1(0x28c))),console[_0x25a6a1(0x17a)]('Available\x20behaviors:');for(const _0x5ec022 of _0x5918dd){console[_0x25a6a1(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x25a6a1(0x26d)](_0x5ec022));}console[_0x25a6a1(0x17a)](_0x25a6a1(0x24e)+_0x3579dc+_0x25a6a1(0x260)+_0x5918dd[0x0]+'\x22');}return 0x1;}const _0x230f43=createCommandSpinner(a31_0x1fbc7e[_0x25a6a1(0x1a0)](_0x25a6a1(0x1a3)),{'verbose':_0x12f7be[_0x25a6a1(0xfa)]});_0x230f43[_0x25a6a1(0xe5)]();const _0x439e31={'onProgress':_0x114d66=>{const _0x305ff7=_0x25a6a1;_0x230f43[_0x305ff7(0x252)]=formatProgressMessage(_0x114d66);}};if(_0x12f7be[_0x25a6a1(0x22b)])_0x439e31[_0x25a6a1(0x22b)]=!![];if(_0x12f7be[_0x25a6a1(0x279)]&&typeof _0x12f7be[_0x25a6a1(0x279)]===_0x25a6a1(0x171))_0x439e31['attribute']=_0x12f7be['attribute'];if(_0x12f7be[_0x25a6a1(0x168)]&&typeof _0x12f7be[_0x25a6a1(0x168)]===_0x25a6a1(0x171))_0x439e31[_0x25a6a1(0x168)]=_0x12f7be[_0x25a6a1(0x168)];if(_0x12f7be['enriched'])_0x439e31[_0x25a6a1(0x16b)]=!![];if(_0x12f7be[_0x25a6a1(0x299)])_0x439e31[_0x25a6a1(0x299)]=_0x12f7be[_0x25a6a1(0x299)];let _0x12c94c;try{_0x12c94c=await _0x136887[_0x25a6a1(0xc6)][_0x25a6a1(0x22e)](_0x15b5b9,_0x439e31),_0x230f43[_0x25a6a1(0xaa)]();}catch(_0xee2761){_0x230f43['stop']();throw _0xee2761;}return await this[_0x25a6a1(0x2b7)](_0x12c94c,{'master':_0x12f7be[_0x25a6a1(0x22b)],'attribute':typeof _0x12f7be[_0x25a6a1(0x279)]===_0x25a6a1(0x171)?_0x12f7be[_0x25a6a1(0x279)]:undefined,'behavior':typeof _0x12f7be[_0x25a6a1(0x168)]==='string'?_0x12f7be['behavior']:undefined,'enriched':_0x12f7be[_0x25a6a1(0x16b)]}),_0x12c94c[_0x25a6a1(0x264)]?0x0:0x1;}async[a31_0x2d63b8(0x2b7)](_0x2bfee1,_0x5ebcc4){const _0x46e902=a31_0x2d63b8;console[_0x46e902(0x17a)]('\x0a'+a31_0x1fbc7e[_0x46e902(0x1f6)](_0x46e902(0x238))+'\x20'+_0x2bfee1['name']),console['error']('═'[_0x46e902(0x2bb)](0x3c));if(_0x5ebcc4['master']&&_0x2bfee1[_0x46e902(0x198)]){const _0x520af0=a31_0x1fbc7e['dim'](_0x46e902(0x1bc))+'\x20'+a31_0x1fbc7e[_0x46e902(0x1f6)](_0x2bfee1['master'][_0x46e902(0x139)]+'.'+_0x2bfee1[_0x46e902(0x22b)][_0x46e902(0xca)]);await this[_0x46e902(0x207)](_0x520af0,_0x2bfee1[_0x46e902(0x198)]);}else{if(_0x5ebcc4[_0x46e902(0x279)]&&_0x2bfee1[_0x46e902(0x198)]){const _0x28f634=a31_0x1fbc7e[_0x46e902(0x1a0)](_0x46e902(0x1b9))+'\x20'+a31_0x1fbc7e[_0x46e902(0x1f6)](_0x5ebcc4[_0x46e902(0x279)]);await this['displaySampleData'](_0x28f634,_0x2bfee1['sampleData']);}else{if(_0x5ebcc4[_0x46e902(0x168)]&&_0x2bfee1[_0x46e902(0x198)]){const _0x5a9a21=a31_0x1fbc7e[_0x46e902(0x1a0)](_0x46e902(0x143))+'\x20'+a31_0x1fbc7e[_0x46e902(0x1f6)](_0x5ebcc4[_0x46e902(0x168)]);await this['displaySampleData'](_0x5a9a21,_0x2bfee1[_0x46e902(0x198)]);}else{if(_0x5ebcc4['enriched']&&_0x2bfee1[_0x46e902(0x198)]){const _0x247b9c=a31_0x1fbc7e[_0x46e902(0x1a0)]('Enriched:')+'\x20'+a31_0x1fbc7e[_0x46e902(0x1f6)]('Master\x20+\x20Attributes');await this[_0x46e902(0x207)](_0x247b9c,_0x2bfee1['sampleData']);}else!_0x2bfee1[_0x46e902(0x198)]&&console[_0x46e902(0x17a)](_0x46e902(0x1c0));}}}if(_0x2bfee1[_0x46e902(0xff)]['length']>0x0){console['error']('─'['repeat'](0x3c)),console[_0x46e902(0x17a)]('\x0a'+a31_0x1fbc7e['red'](_0x46e902(0x2a7)));for(const _0x53b0da of _0x2bfee1['errors']){console[_0x46e902(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x46e902(0x1d8)]('•')+'\x20'+_0x53b0da);}}}async[a31_0x2d63b8(0x207)](_0x507476,_0x2eccf5){const _0x3dc61e=a31_0x2d63b8;if(_0x2eccf5[_0x3dc61e(0x1ba)]===0x0){console['error']('\x0a'+_0x507476),console[_0x3dc61e(0x17a)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x3dc61e(0x17a)]('\x0a'+_0x507476);const _0x2792fd=Object[_0x3dc61e(0x131)](_0x2eccf5[0x0])[_0x3dc61e(0x10b)](_0xa7693b=>({'name':_0xa7693b,'type':typeof _0x2eccf5[0x0][_0xa7693b]===_0x3dc61e(0x28f)?_0x3dc61e(0x259):_0x3dc61e(0x1f2)})),_0x285639={'queryId':'preview','columns':_0x2792fd,'data':_0x2eccf5,'stats':{'state':_0x3dc61e(0x122),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2eccf5['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x41e507=formatAsTable(_0x285639,_0x2eccf5[_0x3dc61e(0x1ba)],!![]);await writeOutput(_0x41e507,undefined,_0x3dc61e(0xca));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x272);[a31_0x2d63b8(0x2ad)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a31_0x2d63b8(0x25f)](_0x5f43ef){const _0x1221cd=a31_0x2d63b8,{options:_0x165d64,args:_0x166d33,tdx:_0x1e9e49}=_0x5f43ef,_0x4ea396=_0x165d64,_0x78b6e2=_0x166d33[0x0]||_0x165d64['parentSegment'];if(!_0x78b6e2)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x563bb6=resolveYamlFile(_0x78b6e2);if(existsSync(_0x563bb6)){_0x4ea396[_0x1221cd(0xfa)]&&console[_0x1221cd(0x17a)](_0x1221cd(0xed)+_0x563bb6);let _0xb81149;try{_0xb81149=readFileSync(_0x563bb6,_0x1221cd(0x28e));}catch(_0x5f4417){const _0x9e29ed=_0x5f4417 instanceof Error?_0x5f4417[_0x1221cd(0x1b6)]:String(_0x5f4417);return console[_0x1221cd(0x17a)]('Error\x20reading\x20file:\x20'+_0x9e29ed),0x1;}const _0x26b4b6=await withSpinner('Analyzing\x20changes...',()=>_0x1e9e49[_0x1221cd(0xc6)][_0x1221cd(0xce)](_0xb81149),{'verbose':_0x4ea396[_0x1221cd(0xfa)]}),_0x5b1956=_0x26b4b6[_0x1221cd(0x244)],{isNew:_0x9de6c1,name:_0x27d4e7,hasChanges:_0xcc7e,diffFormatted:_0x5c05c8}=_0x5b1956;if(_0xcc7e){_0x9de6c1?console[_0x1221cd(0x17a)](_0x1221cd(0x2b2)+_0x27d4e7+'\x27:'):console['error'](_0x1221cd(0x1b1)+_0x27d4e7+'\x27:');console[_0x1221cd(0x17a)]('─'[_0x1221cd(0x2bb)](0x3c)),console['error'](_0x5c05c8),console[_0x1221cd(0x17a)]('─'[_0x1221cd(0x2bb)](0x3c));const _0xf6c3f3=_0x9de6c1?_0x1221cd(0x276)+_0x27d4e7+_0x1221cd(0x1a1):_0x1221cd(0x130)+_0x27d4e7+_0x1221cd(0x1a1);if(!_0x4ea396[_0x1221cd(0x1dd)]){if(!isInteractive())return console['error'](a31_0x1fbc7e['red']('\x0aError:'),_0x1221cd(0xe3)),console[_0x1221cd(0x17a)](a31_0x1fbc7e[_0x1221cd(0x1a0)](_0x1221cd(0xe6))),0x1;const _0x2d9ff2=await confirmKey(_0xf6c3f3);if(!_0x2d9ff2)return console[_0x1221cd(0x17a)](a31_0x1fbc7e[_0x1221cd(0x29a)](_0x1221cd(0x22d))),0x1;}const _0x131768=_0x9de6c1?_0x1221cd(0x155):'Updating';await withSpinner(_0x131768+_0x1221cd(0x268)+_0x27d4e7+'\x27...',()=>_0x5b1956[_0x1221cd(0x189)](),{'verbose':_0x4ea396['verbose']});const _0x1090d3=_0x9de6c1?'Created':'Updated';console[_0x1221cd(0x17a)]('✔\x20'+_0x1090d3+_0x1221cd(0x268)+_0x27d4e7+'\x27');}else console[_0x1221cd(0x17a)]('✔\x20No\x20changes\x20-\x20\x27'+_0x27d4e7+'\x27\x20is\x20up\x20to\x20date');}const _0x1b2e32=await withSpinner(_0x1221cd(0x278)+_0x78b6e2+_0x1221cd(0x1ca),()=>_0x1e9e49[_0x1221cd(0xc6)][_0x1221cd(0x274)](_0x78b6e2),{'verbose':_0x4ea396[_0x1221cd(0xfa)]}),_0x3ae05a=_0x1b2e32[_0x1221cd(0x244)],_0x3b9f98=getConsoleUrl(_0x4ea396[_0x1221cd(0xe0)],_0x1221cd(0xa7)+_0x3ae05a[_0x1221cd(0x2a8)]+_0x1221cd(0x21a)+_0x3ae05a[_0x1221cd(0xb3)]+_0x1221cd(0x1de)+_0x3ae05a['workflowAttemptId']);return console['error'](_0x1221cd(0x163)),console[_0x1221cd(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x1221cd(0x1a0)]('Audience\x20ID:')+'\x20'+_0x3ae05a[_0x1221cd(0x281)]),console['error']('\x20\x20'+a31_0x1fbc7e[_0x1221cd(0x1a0)](_0x1221cd(0x214))+'\x20'+_0x3ae05a[_0x1221cd(0x1ed)]),console['error']('\x20\x20'+a31_0x1fbc7e['dim'](_0x1221cd(0xb8))+'\x20'+_0x3ae05a['workflowSessionId']),console[_0x1221cd(0x17a)]('\x20\x20'+a31_0x1fbc7e[_0x1221cd(0x1a0)](_0x1221cd(0x1b5))+'\x20'+_0x3ae05a[_0x1221cd(0x10e)]),console[_0x1221cd(0x17a)]('\x20\x20'+_0x3b9f98),console[_0x1221cd(0x17a)]('\x0a'+a31_0x1fbc7e[_0x1221cd(0x1a0)](_0x1221cd(0x16c))+_0x1221cd(0xc4)+_0x3ae05a[_0x1221cd(0x10e)]+_0x1221cd(0xf3)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x164);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x24f);async[a31_0x2d63b8(0x25f)](_0x4416b1){const _0x4468f0=a31_0x2d63b8,{options:_0x55243d,args:_0x3ce510,tdx:_0x4abffb}=_0x4416b1,_0x3566f2=_0x3ce510[0x0]||_0x55243d[_0x4468f0(0x1b7)];if(!_0x3566f2)return showParentSegmentNotSetError(_0x4468f0(0x232)+_0x4468f0(0x25b)),0x1;_0x55243d[_0x4468f0(0xfa)]&&(console['error'](_0x4468f0(0x26b)+_0x55243d['site']),console[_0x4468f0(0x17a)](_0x4468f0(0x119)+_0x3566f2));const _0x282755=await withSpinner(_0x4468f0(0xdb)+_0x3566f2+_0x4468f0(0x1ca),()=>_0x4abffb[_0x4468f0(0xc6)]['listFields'](_0x3566f2),{'verbose':_0x55243d[_0x4468f0(0xfa)]}),_0x40ceeb=_0x282755[_0x4468f0(0x244)];console[_0x4468f0(0x17a)](_0x4468f0(0x2b6)+_0x40ceeb['length']+_0x4468f0(0x14a)+(_0x40ceeb[_0x4468f0(0x1ba)]!==0x1?'s':''));if(_0x55243d[_0x4468f0(0xeb)]||_0x55243d[_0x4468f0(0xfd)])return await handleSDKOutput(_0x40ceeb,_0x55243d),0x0;return displayFieldsHumanReadable(_0x40ceeb,_0x3566f2),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a31_0x2d63b8(0x13e);[a31_0x2d63b8(0x2ad)]='Show\x20parent\x20segment\x20details';async[a31_0x2d63b8(0x25f)](_0x5a3131){const _0x215dac=a31_0x2d63b8,{options:_0x15d7fa,args:_0x3216b4,tdx:_0x49dca6}=_0x5a3131,_0x1edfe3=_0x15d7fa,_0x3bbb20=_0x3216b4[0x0]||_0x15d7fa['parentSegment'];if(!_0x3bbb20)return showParentSegmentNotSetError(_0x215dac(0x294)+_0x215dac(0x1e5)+_0x215dac(0x2b9)+_0x215dac(0x182)),0x1;_0x15d7fa[_0x215dac(0xfa)]&&(console[_0x215dac(0x17a)](_0x215dac(0x26b)+_0x15d7fa[_0x215dac(0xe0)]),console[_0x215dac(0x17a)]('Parent\x20segment:\x20'+_0x3bbb20));const _0x4c2ad6=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x3bbb20+_0x215dac(0x1ca),()=>_0x49dca6[_0x215dac(0xc6)][_0x215dac(0x224)](_0x3bbb20),{'verbose':_0x15d7fa[_0x215dac(0xfa)]}),_0x225ad3=_0x4c2ad6[_0x215dac(0x244)];if(_0x1edfe3[_0x215dac(0x1df)]){const _0x325cb3=getConsoleNextUrl(_0x1edfe3['site'],_0x215dac(0x132)+_0x225ad3['id']);return console[_0x215dac(0x17a)](a31_0x1fbc7e[_0x215dac(0xb5)]('✔')+'\x20Opening\x20'+a31_0x1fbc7e[_0x215dac(0x26d)](_0x325cb3)),openBrowser(_0x325cb3),0x0;}return await handleSingleObjectOutput(_0x225ad3,_0x15d7fa),0x0;}}function a31_0x5a47(_0x4c66de,_0x303a6b){_0x4c66de=_0x4c66de-0xa3;const _0x3692d4=a31_0x3692();let _0x5a4745=_0x3692d4[_0x4c66de];return _0x5a4745;}export class ParentSegmentDescCommand extends BaseCommand{['name']=a31_0x2d63b8(0x11b);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0xcf);async[a31_0x2d63b8(0x25f)](_0x1fba06){const _0x4b1145=a31_0x2d63b8,{options:_0x300523,args:_0x4bedc2,tdx:_0x40daa8}=_0x1fba06,_0x41590c=_0x300523,_0x382a88=_0x4bedc2[0x0]||_0x300523[_0x4b1145(0x1b7)];if(!_0x382a88)return showParentSegmentNotSetError('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'+'\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'+_0x4b1145(0x2b9)+_0x4b1145(0xd7)),0x1;_0x300523[_0x4b1145(0xfa)]&&(console[_0x4b1145(0x17a)](_0x4b1145(0x26b)+_0x300523['site']),console[_0x4b1145(0x17a)](_0x4b1145(0x119)+_0x382a88));const _0x6ce945=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x382a88+_0x4b1145(0x1ca),()=>_0x40daa8[_0x4b1145(0xc6)][_0x4b1145(0x11e)](_0x382a88),{'verbose':_0x300523[_0x4b1145(0xfa)]}),_0x4168d6=_0x6ce945[_0x4b1145(0x244)],_0x14a2cc=_0x40daa8[_0x4b1145(0xc6)]['getOutputDatabaseName'](_0x4168d6);if(_0x41590c[_0x4b1145(0x2ae)]){const _0x5e5272=await this[_0x4b1145(0x19a)](_0x1fba06,_0x382a88,_0x4168d6,_0x14a2cc),_0x57c53e=this[_0x4b1145(0x262)](_0x5e5272);writeFileSync(_0x41590c[_0x4b1145(0x2ae)],_0x57c53e);const _0x57fbf9=_0x5e5272[_0x4b1145(0x16a)][_0x4b1145(0x247)]['length']+_0x5e5272[_0x4b1145(0xda)][_0x4b1145(0x1e4)]((_0x435c8f,_0x42e262)=>_0x435c8f+_0x42e262[_0x4b1145(0x247)][_0x4b1145(0x1ba)],0x0),_0x13ff0d=_0x5e5272[_0x4b1145(0xda)]['filter'](_0x120f82=>_0x120f82['columns'][_0x4b1145(0x1ba)]===0x0)[_0x4b1145(0x1ba)];return console[_0x4b1145(0x113)](_0x4b1145(0x258)+_0x41590c['output']),console['log']('\x20\x20Database:\x20'+_0x14a2cc),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x5e5272[_0x4b1145(0xda)][_0x4b1145(0x1ba)]+_0x4b1145(0x267)),console[_0x4b1145(0x113)](_0x4b1145(0x285)+_0x57fbf9+_0x4b1145(0x121)),_0x13ff0d>0x0&&console[_0x4b1145(0x113)](_0x4b1145(0x158)+_0x13ff0d+_0x4b1145(0x161)),0x0;}console[_0x4b1145(0x17a)]('\x0a'+a31_0x1fbc7e['bold']('Output\x20Database:')+'\x20'+a31_0x1fbc7e['cyan'](_0x14a2cc));const _0x527863=await withSpinner(_0x4b1145(0x142),()=>_0x40daa8[_0x4b1145(0xc6)][_0x4b1145(0x14f)](_0x4168d6),{'verbose':_0x300523[_0x4b1145(0xfa)]});console[_0x4b1145(0x17a)]('\x0a'+a31_0x1fbc7e[_0x4b1145(0x1f6)](_0x4b1145(0x16a))+'\x20'+a31_0x1fbc7e['dim']('('+_0x14a2cc+'.customers)'));const _0x265548=await executeSchemaQuery(_0x527863[_0x4b1145(0x244)],_0x40daa8,_0x300523);await handleQueryOutput(_0x265548,_0x300523);const _0x4e385c=await withSpinner(_0x4b1145(0x298),()=>_0x40daa8[_0x4b1145(0xc6)][_0x4b1145(0x225)](_0x4168d6),{'verbose':_0x300523[_0x4b1145(0xfa)]});for(const _0x462bbe of _0x4e385c['data']){const _0x2f204c=_0x4b1145(0x2a5)+_0x462bbe['toLowerCase']()[_0x4b1145(0x204)](/\s+/g,'_'),_0x65e84f=_0x4b1145(0x203)+_0x14a2cc+'.'+_0x2f204c;console[_0x4b1145(0x17a)]('\x0a'+a31_0x1fbc7e[_0x4b1145(0x1f6)](_0x462bbe)+'\x20'+a31_0x1fbc7e['dim']('('+_0x14a2cc+'.'+_0x2f204c+')'));try{const _0x1213ca=await executeSchemaQuery(_0x65e84f,_0x40daa8,_0x300523);await handleQueryOutput(_0x1213ca,_0x300523);}catch{console[_0x4b1145(0x17a)](a31_0x1fbc7e[_0x4b1145(0x29a)](_0x4b1145(0xc9)));}}return 0x0;}async['collectSchema'](_0x5b695e,_0x1f5083,_0x5eaf6f,_0x445d02){const _0x58720e=a31_0x2d63b8,{options:_0x3d88ab,tdx:_0x1fdc05}=_0x5b695e,_0x3c9419=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x1fdc05[_0x58720e(0xc6)][_0x58720e(0x14f)](_0x5eaf6f),{'verbose':_0x3d88ab['verbose']}),_0x558a03=await executeSchemaQuery(_0x3c9419[_0x58720e(0x244)],_0x1fdc05,_0x3d88ab),_0x3955b0=_0x558a03[_0x58720e(0x244)][_0x58720e(0x10b)](_0x827598=>({'name':_0x827598[_0x58720e(0x237)],'type':_0x827598[_0x58720e(0x181)]})),_0x7b3fb9=await withSpinner(_0x58720e(0x298),()=>_0x1fdc05[_0x58720e(0xc6)]['getBehaviorNames'](_0x5eaf6f),{'verbose':_0x3d88ab[_0x58720e(0xfa)]}),_0x2ede0b=[];for(const _0xdd81ca of _0x7b3fb9[_0x58720e(0x244)]){const _0x550cc0=_0x58720e(0x2a5)+_0xdd81ca[_0x58720e(0x188)]()[_0x58720e(0x204)](/\s+/g,'_'),_0x380a7a=_0x58720e(0x203)+_0x445d02+'.'+_0x550cc0;let _0x123796=[];try{const _0x2933df=await executeSchemaQuery(_0x380a7a,_0x1fdc05,_0x3d88ab);_0x123796=_0x2933df[_0x58720e(0x244)]['map'](_0x4ad2ab=>({'name':_0x4ad2ab['column_name'],'type':_0x4ad2ab[_0x58720e(0x181)]}));}catch{}_0x2ede0b['push']({'table':_0x550cc0,'columns':_0x123796});}return{'database':_0x445d02,'parent_segment':_0x1f5083,'parent_id':_0x5eaf6f,'customers':{'table':'customers','columns':_0x3955b0},'behaviors':_0x2ede0b};}['formatSchemaJson'](_0x1fb24c){const _0x4014f5=a31_0x2d63b8,_0x58713c=_0x183ec1=>{const _0x5d929a=a31_0x5a47;if(_0x183ec1[_0x5d929a(0x1ba)]===0x0)return'[]';const _0x2f346b=_0x183ec1[_0x5d929a(0x10b)](_0x36148a=>_0x5d929a(0x152)+_0x36148a[_0x5d929a(0x105)]+_0x5d929a(0x1fd)+_0x36148a[_0x5d929a(0xa3)]+_0x5d929a(0x1ad));return'[\x0a'+_0x2f346b['join'](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x4c1789=_0x1fb24c['behaviors'][_0x4014f5(0x10b)](_0x3e2326=>{const _0x333abb=_0x4014f5;return _0x333abb(0xd4)+_0x3e2326[_0x333abb(0xca)]+_0x333abb(0x1a8)+_0x58713c(_0x3e2326['columns'])[_0x333abb(0x204)](/^/gm,'\x20\x20')[_0x333abb(0x2bc)]()+_0x333abb(0x14e);})['join'](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x1fb24c[_0x4014f5(0x139)]+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x1fb24c['parent_segment']+_0x4014f5(0x22f)+_0x1fb24c['parent_id']+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x1fb24c[_0x4014f5(0x16a)]['table']+_0x4014f5(0x102)+_0x58713c(_0x1fb24c[_0x4014f5(0x16a)][_0x4014f5(0x247)])[_0x4014f5(0x204)](/^/gm,'\x20\x20')[_0x4014f5(0x2bc)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x4c1789+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x125);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x146);async[a31_0x2d63b8(0x25f)](_0x241f21){const _0x5e2d1c=a31_0x2d63b8,{options:_0x2e8aa3,args:_0x4102cd,tdx:_0xd879fd}=_0x241f21,_0x19dbec=_0x4102cd[0x0]||_0x2e8aa3[_0x5e2d1c(0x1b7)];if(!_0x19dbec)return showParentSegmentNotSetError(_0x5e2d1c(0x221)+_0x5e2d1c(0x120)),0x1;_0x2e8aa3[_0x5e2d1c(0xfa)]&&(console[_0x5e2d1c(0x17a)]('Site:\x20'+_0x2e8aa3[_0x5e2d1c(0xe0)]),console['error'](_0x5e2d1c(0x119)+_0x19dbec));const _0x3c5d49=await withSpinner(_0x5e2d1c(0x208)+_0x19dbec+'\x27...',()=>_0xd879fd[_0x5e2d1c(0xc6)][_0x5e2d1c(0x11e)](_0x19dbec),{'verbose':_0x2e8aa3[_0x5e2d1c(0xfa)]}),_0x5ca5de=_0x3c5d49[_0x5e2d1c(0x244)],_0x746cab=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x19dbec+_0x5e2d1c(0x1ca),()=>_0xd879fd[_0x5e2d1c(0xc6)]['getParentSQL'](_0x5ca5de),{'verbose':_0x2e8aa3[_0x5e2d1c(0xfa)]}),_0x2d7848=_0x746cab[_0x5e2d1c(0x244)];return _0x2e8aa3[_0x5e2d1c(0xab)]===_0x5e2d1c(0xeb)||_0x2e8aa3['format']===_0x5e2d1c(0xfd)?await handleSDKOutput([{'sql':_0x2d7848}],_0x2e8aa3):console[_0x5e2d1c(0x113)](_0x2d7848),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0xdc);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x191);async[a31_0x2d63b8(0x25f)](_0x223a85){const _0x496253=a31_0x2d63b8,{options:_0x162615,args:_0x44bdc0,tdx:_0x4d7dc6}=_0x223a85,_0x773ba1=_0x44bdc0[0x0]||_0x162615[_0x496253(0x1b7)];if(!_0x773ba1)return showParentSegmentNotSetError(_0x496253(0x220)+_0x496253(0x26c)),0x1;_0x162615[_0x496253(0xfa)]&&(console[_0x496253(0x17a)](_0x496253(0x26b)+_0x162615['site']),console['error'](_0x496253(0x119)+_0x773ba1));const _0x246b33=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x773ba1+'\x27...',()=>_0x4d7dc6[_0x496253(0xc6)][_0x496253(0x11e)](_0x773ba1),{'verbose':_0x162615[_0x496253(0xfa)]}),_0x4ae083=_0x246b33['data'],_0x345da3=await withSpinner(_0x496253(0xc7)+_0x773ba1+_0x496253(0x1ca),()=>_0x4d7dc6['segment'][_0x496253(0x14f)](_0x4ae083),{'verbose':_0x162615[_0x496253(0xfa)]});let _0x261aec=_0x345da3[_0x496253(0x244)];const _0x1092a0=resolveLimit(_0x162615['limit'],DEFAULT_DISPLAY_LIMIT),_0xb1b46c=/\bLIMIT\s+\d+/i[_0x496253(0xc8)](_0x261aec);!_0xb1b46c&&(_0x261aec=_0x261aec['trim']()[_0x496253(0x204)](/;+$/,''),_0x261aec=_0x496253(0x246)+_0x261aec+_0x496253(0x135)+_0x1092a0);_0x162615[_0x496253(0xfa)]&&console[_0x496253(0x17a)](_0x496253(0x1ec)+_0x261aec);const _0x84431b=await withProgressSpinner(_0x496253(0xe1),async _0x16c41d=>{const _0x42305b=_0x496253,_0x152a0c=await _0x4d7dc6[_0x42305b(0x1b0)][_0x42305b(0x25f)](_0x261aec,{'catalog':'td','schema':_0x42305b(0x101),'onJobId':_0x30a191=>{const _0x33c133=_0x42305b;_0x16c41d[_0x33c133(0x1f5)](_0x30a191);}});return _0x152a0c;},{'verbose':_0x162615['verbose']}),_0x4995a7=_0x84431b[_0x496253(0x244)],_0x519e10=_0x4995a7[_0x496253(0x138)]?_0x496253(0x1f3)+_0x4995a7[_0x496253(0x138)]+']':'';return console['error'](_0x496253(0x1cc)+_0x4995a7[_0x496253(0x250)][_0x496253(0x209)]['toLocaleString']()+_0x496253(0x293)+(_0x496253(0x266)+formatElapsed(_0x4995a7[_0x496253(0x250)]['elapsedTimeMillis'])+_0x519e10)),await handleQueryOutput(_0x4995a7,_0x162615),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x1f1);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x231);async[a31_0x2d63b8(0x25f)](_0x1b534a){const _0x118f27=a31_0x2d63b8,{options:_0x497237,args:_0x5803b3,tdx:_0x385af8}=_0x1b534a,_0x47788c=_0x5803b3[0x0],_0x3c9c40=await withSpinner(_0x47788c?_0x118f27(0xad)+_0x47788c+'\x27...':_0x118f27(0x2a2),()=>_0x385af8[_0x118f27(0x27e)]['list'](),{'verbose':_0x497237['verbose']});let _0x45af2b=_0x3c9c40[_0x118f27(0x244)][_0x118f27(0x2a1)](_0x80b3b9=>_0x80b3b9['realtime_enabled']);if(_0x47788c){const _0x33f383=_0x47788c[_0x118f27(0x204)](/[.+^${}()|[\]\\]/g,_0x118f27(0xe8))[_0x118f27(0x204)](/\*/g,'.*')[_0x118f27(0x204)](/\?/g,'.'),_0x2415a5=new RegExp('^'+_0x33f383+'$','i');_0x45af2b=_0x45af2b[_0x118f27(0x2a1)](_0x5cb449=>_0x2415a5[_0x118f27(0xc8)](_0x5cb449['name']));}_0x45af2b[_0x118f27(0x248)]((_0x1daab6,_0x165e1e)=>_0x1daab6[_0x118f27(0x105)][_0x118f27(0xbd)](_0x165e1e['name'])),console['error'](_0x118f27(0x2b6)+_0x45af2b[_0x118f27(0x1ba)]+_0x118f27(0x23b)+(_0x45af2b[_0x118f27(0x1ba)]!==0x1?'s':''));const _0x55b17b=_0x2bdd78=>{const _0x3c4138=_0x118f27;return getConsoleNextUrl(_0x497237[_0x3c4138(0xe0)],_0x3c4138(0x132)+_0x2bdd78);};if(_0x497237['format']===_0x118f27(0xeb)||_0x497237['format']===_0x118f27(0xfd)){const _0x4c3f22=_0x45af2b[_0x118f27(0x10b)](_0x17dee7=>({..._0x17dee7,'url':_0x55b17b(_0x17dee7['id'])}));await handleSDKOutput(_0x4c3f22,_0x497237);}else{if(_0x45af2b[_0x118f27(0x1ba)]===0x0)console[_0x118f27(0x113)](_0x118f27(0x245));else for(const _0x11e9e1 of _0x45af2b){const _0x2ef2f6=_0x11e9e1[_0x118f27(0x29d)]?a31_0x1fbc7e[_0x118f27(0x1a0)]('\x20('+formatRows(_0x11e9e1[_0x118f27(0x29d)])+')'):'',_0x30efd2=hyperlink(_0x11e9e1[_0x118f27(0x105)],_0x55b17b(_0x11e9e1['id']));console[_0x118f27(0x113)]('⚡\x20'+_0x30efd2+_0x2ef2f6);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x18d);['description']='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async['execute'](_0x4c7cdd){const _0x2bb5d9=a31_0x2d63b8,{options:_0xacc708,args:_0x137e24,tdx:_0x4d090e}=_0x4c7cdd,_0x33dd04=_0x137e24[0x0]||_0xacc708[_0x2bb5d9(0x1b7)];if(!_0x33dd04)return showParentSegmentNotSetError(_0x2bb5d9(0xb2)+_0x2bb5d9(0x1bb)),0x1;const _0x4e3b70=resolveYamlFile(_0x33dd04);if(!existsSync(_0x4e3b70))return showFileNotFoundError(_0x4e3b70,_0x33dd04),0x1;let _0x257d78;try{_0x257d78=readFileSync(_0x4e3b70,_0x2bb5d9(0x28e));}catch(_0x392269){const _0x2deaf9=_0x392269 instanceof Error?_0x392269[_0x2bb5d9(0x1b6)]:String(_0x392269);return console[_0x2bb5d9(0x17a)](_0x2bb5d9(0x162)+_0x2deaf9),0x1;}const _0x29ad83=createCommandSpinner(a31_0x1fbc7e[_0x2bb5d9(0x1a0)]('Validating\x20RT\x20configuration...'),{'verbose':_0xacc708[_0x2bb5d9(0xfa)]});_0x29ad83[_0x2bb5d9(0xe5)]();const _0x468114={'realtime':!![],'onProgress':_0x58b28d=>{const _0x123d9f=_0x2bb5d9;_0x29ad83[_0x123d9f(0x252)]=formatProgressMessage(_0x58b28d);}};let _0x126600;try{_0x126600=await _0x4d090e['segment'][_0x2bb5d9(0x1fe)](_0x257d78,_0x468114),_0x29ad83['stop']();}catch(_0x5e8f5d){_0x29ad83[_0x2bb5d9(0xaa)]();throw _0x5e8f5d;}console[_0x2bb5d9(0x17a)]('\x0a'+a31_0x1fbc7e['bold'](_0x2bb5d9(0x103))+'\x20'+_0x126600[_0x2bb5d9(0x105)]),console[_0x2bb5d9(0x17a)]('═'[_0x2bb5d9(0x2bb)](0x3c)),displayRealtimeValidation(_0x126600),console[_0x2bb5d9(0x17a)]('─'[_0x2bb5d9(0x2bb)](0x3c));if(_0x126600['errors']['length']>0x0){console[_0x2bb5d9(0x17a)]('\x0a'+a31_0x1fbc7e[_0x2bb5d9(0x1d8)](_0x2bb5d9(0x2a7)));for(const _0x4c07ff of _0x126600[_0x2bb5d9(0xff)]){console['error']('\x20\x20'+a31_0x1fbc7e[_0x2bb5d9(0x1d8)]('•')+'\x20'+_0x4c07ff);}}return _0x126600[_0x2bb5d9(0x264)]&&console['error']('\x0a'+a31_0x1fbc7e[_0x2bb5d9(0xb5)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x126600[_0x2bb5d9(0x264)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x2d63b8(0x105)]='ps:rt:jn:list';[a31_0x2d63b8(0x2ad)]='List\x20RT\x20journeys';async[a31_0x2d63b8(0x25f)](_0xf63dae){const _0x388fca=a31_0x2d63b8,{options:_0x50ab63,args:_0x2541bb,tdx:_0xa0af4d}=_0xf63dae,_0x566988=_0x2541bb[0x0]||_0x50ab63[_0x388fca(0x1b7)];if(!_0x566988)return showParentSegmentNotSetError('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'+'\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;_0x50ab63[_0x388fca(0xfa)]&&(console[_0x388fca(0x17a)](_0x388fca(0x26b)+_0x50ab63['site']),console[_0x388fca(0x17a)](_0x388fca(0x119)+_0x566988));const _0x501c9c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x566988+_0x388fca(0x1ca),()=>_0xa0af4d['segment'][_0x388fca(0x11e)](_0x566988),{'verbose':_0x50ab63['verbose']}),_0x3bd6a5=_0x501c9c['data'],_0xb46591=await withSpinner(_0x388fca(0x269)+_0x566988+_0x388fca(0x1ca),()=>_0xa0af4d[_0x388fca(0x27e)][_0x388fca(0x1dc)](_0x3bd6a5),{'verbose':_0x50ab63[_0x388fca(0xfa)]}),_0x195ff4=_0xb46591['data'];console['error'](_0x388fca(0x2b6)+_0x195ff4[_0x388fca(0x1ba)]+_0x388fca(0x106)+(_0x195ff4['length']!==0x1?'s':''));if(_0x50ab63[_0x388fca(0xab)]===_0x388fca(0xeb)||_0x50ab63['format']===_0x388fca(0xfd))await handleSDKOutput(_0x195ff4,_0x50ab63);else{if(_0x195ff4['length']===0x0)console['log'](_0x388fca(0x2aa));else for(const _0x22d70e of _0x195ff4){const _0x343875=_0x22d70e[_0x388fca(0x1d1)]===_0x388fca(0x1f7)?'🚀':'📝',_0x3b4643=_0x22d70e[_0x388fca(0x16d)]?a31_0x1fbc7e[_0x388fca(0x29a)](_0x388fca(0x14b)):'',_0x4431a6=a31_0x1fbc7e['dim']('\x20('+_0x22d70e[_0x388fca(0x11f)]+_0x388fca(0x1cb)+(_0x22d70e[_0x388fca(0x11f)]!==0x1?'s':'')+')');console[_0x388fca(0x113)](_0x343875+'\x20'+_0x22d70e['name']+_0x3b4643+_0x4431a6);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x2d63b8(0x105)]='ps:rt:jn:pause';[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0xc3);async['execute'](_0x4e4e58){const _0x327b81=a31_0x2d63b8,{options:_0x1e453d,args:_0x57d91b,tdx:_0x322a71}=_0x4e4e58,_0x1455dc=_0x57d91b[0x0];if(!_0x1455dc)return console['error'](a31_0x1fbc7e[_0x327b81(0x1d8)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console['error']('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console['error'](a31_0x1fbc7e[_0x327b81(0x1a0)](_0x327b81(0x234))),0x1;_0x1e453d[_0x327b81(0xfa)]&&(console['error'](_0x327b81(0x26b)+_0x1e453d['site']),console[_0x327b81(0x17a)]('RT\x20Journey\x20ID:\x20'+_0x1455dc));const _0x227acd=await withSpinner(_0x327b81(0x1fb)+_0x1455dc+_0x327b81(0x1ca),()=>_0x322a71[_0x327b81(0x27e)]['pauseJourney'](_0x1455dc),{'verbose':_0x1e453d[_0x327b81(0xfa)]}),_0x4cebc9=_0x227acd['data'];console[_0x327b81(0x17a)](_0x327b81(0x151)+_0x4cebc9['name']+'\x27');if(_0x1e453d[_0x327b81(0xab)]===_0x327b81(0xeb)||_0x1e453d[_0x327b81(0xab)]==='jsonl')await handleSDKOutput([_0x4cebc9],_0x1e453d);else{const _0x4ff414=_0x4cebc9['state']===_0x327b81(0x1f7)?'🚀':'📝',_0x1ea22f=_0x4cebc9['paused']?a31_0x1fbc7e[_0x327b81(0x29a)]('\x20(paused)'):'';console[_0x327b81(0x113)](_0x4ff414+'\x20'+_0x4cebc9['name']+_0x1ea22f);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0xf9);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x2af);async[a31_0x2d63b8(0x25f)](_0x1ac1f5){const _0x4eaaf7=a31_0x2d63b8,{options:_0x4c6f9c,args:_0x489c94,tdx:_0x286d48}=_0x1ac1f5,_0x1cd79a=_0x489c94[0x0];if(!_0x1cd79a)return console['error'](a31_0x1fbc7e[_0x4eaaf7(0x1d8)](_0x4eaaf7(0xd5))),console[_0x4eaaf7(0x17a)](_0x4eaaf7(0x137)),console[_0x4eaaf7(0x17a)](a31_0x1fbc7e[_0x4eaaf7(0x1a0)](_0x4eaaf7(0x234))),0x1;_0x4c6f9c['verbose']&&(console[_0x4eaaf7(0x17a)](_0x4eaaf7(0x26b)+_0x4c6f9c['site']),console[_0x4eaaf7(0x17a)](_0x4eaaf7(0x114)+_0x1cd79a));const _0x79c81c=await withSpinner(_0x4eaaf7(0x19c)+_0x1cd79a+_0x4eaaf7(0x1ca),()=>_0x286d48[_0x4eaaf7(0x27e)]['resumeJourney'](_0x1cd79a),{'verbose':_0x4c6f9c[_0x4eaaf7(0xfa)]}),_0x47e265=_0x79c81c[_0x4eaaf7(0x244)];console[_0x4eaaf7(0x17a)](_0x4eaaf7(0x144)+_0x47e265[_0x4eaaf7(0x105)]+'\x27');if(_0x4c6f9c[_0x4eaaf7(0xab)]===_0x4eaaf7(0xeb)||_0x4c6f9c[_0x4eaaf7(0xab)]===_0x4eaaf7(0xfd))await handleSDKOutput([_0x47e265],_0x4c6f9c);else{const _0x37c4f4=_0x47e265[_0x4eaaf7(0x1d1)]===_0x4eaaf7(0x1f7)?'🚀':'📝',_0x38f405=_0x47e265[_0x4eaaf7(0x16d)]?a31_0x1fbc7e['yellow'](_0x4eaaf7(0x14b)):'';console['log'](_0x37c4f4+'\x20'+_0x47e265[_0x4eaaf7(0x105)]+_0x38f405);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x2a4);['description']=a31_0x2d63b8(0xcb);async[a31_0x2d63b8(0x25f)](_0x412ec1){const _0x21b7dc=a31_0x2d63b8,{options:_0x1e4c5d,args:_0x53da4a,tdx:_0x27cdb2}=_0x412ec1,_0x559d2c=_0x53da4a[0x0]||_0x1e4c5d[_0x21b7dc(0x1b7)];if(!_0x559d2c)return showParentSegmentNotSetError(_0x21b7dc(0xb1)+_0x21b7dc(0x170)),0x1;_0x1e4c5d['verbose']&&(console[_0x21b7dc(0x17a)](_0x21b7dc(0x26b)+_0x1e4c5d[_0x21b7dc(0xe0)]),console[_0x21b7dc(0x17a)]('Parent\x20segment:\x20'+_0x559d2c));const _0x1ab630=await withSpinner(_0x21b7dc(0x208)+_0x559d2c+_0x21b7dc(0x1ca),()=>_0x27cdb2[_0x21b7dc(0xc6)][_0x21b7dc(0x11e)](_0x559d2c),{'verbose':_0x1e4c5d[_0x21b7dc(0xfa)]}),_0x2704da=_0x1ab630[_0x21b7dc(0x244)],_0x452393=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0x559d2c+_0x21b7dc(0x1ca),()=>_0x27cdb2[_0x21b7dc(0x27e)][_0x21b7dc(0x141)](_0x2704da),{'verbose':_0x1e4c5d[_0x21b7dc(0xfa)]}),_0x42f9d2=_0x452393['data'];return console[_0x21b7dc(0x17a)](_0x21b7dc(0x263)),_0x1e4c5d[_0x21b7dc(0xab)]===_0x21b7dc(0xeb)||_0x1e4c5d['format']===_0x21b7dc(0xfd)?await handleSDKOutput([_0x42f9d2],_0x1e4c5d):(console[_0x21b7dc(0x113)](_0x21b7dc(0x255)+_0x42f9d2['id']),console[_0x21b7dc(0x113)]('audienceId:\x20'+_0x42f9d2[_0x21b7dc(0x281)]),console['log'](_0x21b7dc(0xac)+_0x42f9d2[_0x21b7dc(0xba)]),console[_0x21b7dc(0x113)](_0x21b7dc(0x17c)+_0x42f9d2[_0x21b7dc(0x180)]),console[_0x21b7dc(0x113)](_0x21b7dc(0x256)+_0x42f9d2[_0x21b7dc(0x1ed)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0xf2);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x257);async[a31_0x2d63b8(0x25f)](_0x38ea1f){const _0x6de875=a31_0x2d63b8,{options:_0x41289a,args:_0x35e621,tdx:_0x28a522}=_0x38ea1f,_0x4feff0=_0x35e621[0x0]||_0x41289a['parentSegment'];if(!_0x4feff0)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'+_0x6de875(0x26f)),0x1;const _0x4693d9=await withSpinner(_0x6de875(0x208)+_0x4feff0+_0x6de875(0x1ca),()=>_0x28a522[_0x6de875(0xc6)][_0x6de875(0x11e)](_0x4feff0),{'verbose':_0x41289a[_0x6de875(0xfa)]}),_0x17c185=_0x4693d9[_0x6de875(0x244)],_0x1cd77d=await withSpinner(_0x6de875(0x13c)+_0x4feff0+_0x6de875(0x1ca),()=>_0x28a522['personalization'][_0x6de875(0x128)](_0x17c185),{'verbose':_0x41289a[_0x6de875(0xfa)]}),_0xb905d1=_0x1cd77d['data'];console[_0x6de875(0x17a)](_0x6de875(0x2b6)+_0xb905d1[_0x6de875(0x1ba)]+'\x20personalization\x20service'+(_0xb905d1[_0x6de875(0x1ba)]!==0x1?'s':''));if(_0x41289a[_0x6de875(0xab)]===_0x6de875(0xeb)||_0x41289a['format']==='jsonl')await handleSDKOutput(_0xb905d1,_0x41289a);else{if(_0xb905d1[_0x6de875(0x1ba)]===0x0)console[_0x6de875(0x113)](_0x6de875(0x18b)),console['error'](a31_0x1fbc7e['cyan'](_0x6de875(0x1aa)));else for(const _0x366d0e of _0xb905d1){console[_0x6de875(0x113)](a31_0x1fbc7e[_0x6de875(0x1f6)](_0x366d0e[_0x6de875(0x105)])+'\x20'+a31_0x1fbc7e[_0x6de875(0x1a0)](_0x6de875(0x129)+_0x366d0e['id']+')'));_0x366d0e[_0x6de875(0x2ad)]&&console[_0x6de875(0x113)]('\x20\x20'+a31_0x1fbc7e[_0x6de875(0x1a0)](_0x366d0e[_0x6de875(0x2ad)]));if(_0x366d0e[_0x6de875(0x290)]&&_0x366d0e[_0x6de875(0x290)][_0x6de875(0x1ba)]>0x0)for(const _0x20412e of _0x366d0e[_0x6de875(0x290)]){const _0x425f0b=_0x20412e['allowedIps']?.[_0x6de875(0x1ba)]?_0x20412e[_0x6de875(0x24d)][_0x6de875(0x19d)](',\x20'):_0x6de875(0x18a);console[_0x6de875(0x113)]('\x20\x20'+a31_0x1fbc7e['cyan'](_0x6de875(0x211))+'\x20'+_0x20412e[_0x6de875(0x105)]+'\x20'+a31_0x1fbc7e[_0x6de875(0x1a0)](_0x6de875(0x129)+_0x20412e['id']+')')),console[_0x6de875(0x113)](_0x6de875(0x25d)+a31_0x1fbc7e[_0x6de875(0x1a0)](_0x6de875(0x16e))+'\x20'+_0x425f0b);}else console['log']('\x20\x20'+a31_0x1fbc7e[_0x6de875(0x1a0)](_0x6de875(0x1d4)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x2a6);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x10d);async['execute'](_0x168b17){const _0x3ea8db=a31_0x2d63b8,{options:_0x39894f,args:_0x38a3db,tdx:_0x3b3dbe}=_0x168b17,_0x3ef330=_0x39894f,_0x40f8f7=_0x38a3db[0x0],_0x397bbf=_0x38a3db[0x1]||_0x39894f[_0x3ea8db(0x1b7)];if(!_0x40f8f7)return console[_0x3ea8db(0x17a)](_0x3ea8db(0x21c)),console[_0x3ea8db(0x17a)](_0x3ea8db(0x210)),console['error'](_0x3ea8db(0x24b)),0x1;if(!_0x397bbf)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x3ea8db(0x24b)),0x1;const _0x2540f6=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x397bbf+'\x27...',()=>_0x3b3dbe['segment'][_0x3ea8db(0x11e)](_0x397bbf),{'verbose':_0x39894f[_0x3ea8db(0xfa)]}),_0x308bd2=_0x2540f6[_0x3ea8db(0x244)],_0x607865={'name':_0x40f8f7,'description':_0x3ef330[_0x3ea8db(0x2ad)],'public':_0x3ef330['public']},_0x332c8d=await withSpinner(_0x3ea8db(0x13b)+_0x40f8f7+_0x3ea8db(0x1ca),()=>_0x3b3dbe[_0x3ea8db(0x199)][_0x3ea8db(0x2a3)](_0x308bd2,_0x607865),{'verbose':_0x39894f['verbose']}),_0x232931=_0x332c8d[_0x3ea8db(0x244)];return console['error'](_0x3ea8db(0x12c)+_0x232931[_0x3ea8db(0x105)]+_0x3ea8db(0x187)+_0x232931['id']),await handleSDKOutput([_0x232931],_0x39894f),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0xe7);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x193);async[a31_0x2d63b8(0x25f)](_0x36cad8){const _0x22bef7=a31_0x2d63b8,{options:_0x3f9cf8,args:_0x1756d5,tdx:_0x129aef}=_0x36cad8,_0x4d0c9d=_0x1756d5[0x0],_0x539c40=_0x1756d5[0x1]||_0x3f9cf8[_0x22bef7(0x1b7)];if(!_0x4d0c9d)return console[_0x22bef7(0x17a)](_0x22bef7(0xfc)),console[_0x22bef7(0x17a)](_0x22bef7(0x179)),console[_0x22bef7(0x17a)](_0x22bef7(0x1e7)),0x1;if(!_0x539c40)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x22bef7(0x1e7)),0x1;const _0x4db08c=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x539c40+'\x27...',()=>_0x129aef[_0x22bef7(0xc6)][_0x22bef7(0x11e)](_0x539c40),{'verbose':_0x3f9cf8[_0x22bef7(0xfa)]}),_0x48451b=_0x4db08c[_0x22bef7(0x244)],_0x15d739=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x4d0c9d+_0x22bef7(0x1ca),()=>_0x129aef[_0x22bef7(0x199)]['get'](_0x48451b,_0x4d0c9d),{'verbose':_0x3f9cf8[_0x22bef7(0xfa)]}),_0x4c1534=_0x15d739[_0x22bef7(0x244)];if(_0x3f9cf8[_0x22bef7(0xeb)]||_0x3f9cf8[_0x22bef7(0xfd)])await handleSDKOutput([_0x4c1534],_0x3f9cf8);else{console['log'](a31_0x1fbc7e[_0x22bef7(0x1f6)](_0x4c1534['name'])+'\x20'+a31_0x1fbc7e[_0x22bef7(0x1a0)](_0x22bef7(0x129)+_0x4c1534['id']+')'));_0x4c1534[_0x22bef7(0x2ad)]&&console[_0x22bef7(0x113)]('\x20\x20'+a31_0x1fbc7e['dim'](_0x4c1534[_0x22bef7(0x2ad)]));console[_0x22bef7(0x113)]('\x20\x20'+a31_0x1fbc7e['cyan'](_0x22bef7(0x29e))+'\x20'+(_0x4c1534[_0x22bef7(0x1c9)]?_0x22bef7(0x1dd):'no'));if(_0x4c1534['tokens']&&_0x4c1534['tokens']['length']>0x0)for(const _0x5dc4dd of _0x4c1534[_0x22bef7(0x290)]){const _0x3c86db=_0x5dc4dd['allowedIps']?.[_0x22bef7(0x1ba)]?_0x5dc4dd[_0x22bef7(0x24d)]['join'](',\x20'):_0x22bef7(0x18a);console['log']('\x20\x20'+a31_0x1fbc7e[_0x22bef7(0x26d)]('token:')+'\x20'+_0x5dc4dd[_0x22bef7(0x105)]+'\x20'+a31_0x1fbc7e[_0x22bef7(0x1a0)](_0x22bef7(0x129)+_0x5dc4dd['id']+')')),console[_0x22bef7(0x113)](_0x22bef7(0x25d)+a31_0x1fbc7e['dim'](_0x22bef7(0x16e))+'\x20'+_0x3c86db);}else console[_0x22bef7(0x113)]('\x20\x20'+a31_0x1fbc7e[_0x22bef7(0x1a0)]('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0xd2);['description']=a31_0x2d63b8(0x1ef);async[a31_0x2d63b8(0x25f)](_0x2afb0a){const _0x47fd10=a31_0x2d63b8,{options:_0x822b13,args:_0x538539,tdx:_0x190181}=_0x2afb0a,_0x29a57c=_0x538539[0x0],_0x47d70b=_0x538539[0x1]||_0x822b13[_0x47fd10(0x1b7)];if(!_0x29a57c)return console[_0x47fd10(0x17a)]('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x47fd10(0x200)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x47d70b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x47fd10(0x25e)),0x1;const _0x2460ae=await withSpinner(_0x47fd10(0x208)+_0x47d70b+'\x27...',()=>_0x190181[_0x47fd10(0xc6)][_0x47fd10(0x11e)](_0x47d70b),{'verbose':_0x822b13['verbose']}),_0x203926=_0x2460ae[_0x47fd10(0x244)];return await withSpinner(_0x47fd10(0x213)+_0x29a57c+'\x27...',()=>_0x190181[_0x47fd10(0x199)][_0x47fd10(0x29f)](_0x203926,_0x29a57c),{'verbose':_0x822b13[_0x47fd10(0xfa)]}),console['error'](_0x47fd10(0xae)+_0x29a57c+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0x134);['description']='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x2d63b8(0x25f)](_0xedb1a0){const _0x990501=a31_0x2d63b8,{options:_0xe83d8,args:_0x130808,tdx:_0x3b645f}=_0xedb1a0,_0x2629ac=_0xe83d8,_0x10cdcf=_0x130808[0x0],_0x1f3c3f=_0x130808[0x1]||_0xe83d8['parentSegment'];if(!_0x10cdcf)return console[_0x990501(0x17a)](_0x990501(0xfc)),console[_0x990501(0x17a)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),console[_0x990501(0x17a)](_0x990501(0x21e)),0x1;if(!_0x2629ac['name'])return console[_0x990501(0x17a)](_0x990501(0xea)),console[_0x990501(0x17a)](_0x990501(0x1d9)),0x1;if(!_0x1f3c3f)return showParentSegmentNotSetError(_0x990501(0x215)+_0x990501(0x21e)),0x1;const _0x1009dc=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1f3c3f+'\x27...',()=>_0x3b645f['segment'][_0x990501(0x11e)](_0x1f3c3f),{'verbose':_0xe83d8[_0x990501(0xfa)]}),_0x1e8127=_0x1009dc['data'],_0x505ef9={'name':_0x2629ac[_0x990501(0x105)]};_0x2629ac[_0x990501(0x2ad)]!==undefined&&(_0x505ef9[_0x990501(0x2ad)]=_0x2629ac['description']);const _0x58711d=await withSpinner(_0x990501(0x1e8)+_0x10cdcf+'\x27...',()=>_0x3b645f[_0x990501(0x199)][_0x990501(0x2a9)](_0x1e8127,_0x10cdcf,_0x505ef9),{'verbose':_0xe83d8[_0x990501(0xfa)]}),_0x1b1790=_0x58711d[_0x990501(0x244)];return console[_0x990501(0x17a)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x1b1790[_0x990501(0x105)]+'\x27'),await handleSDKOutput([_0x1b1790],_0xe83d8),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x2d63b8(0x105)]='ps:pz:service:token:create';[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0xc2);async[a31_0x2d63b8(0x25f)](_0x36e9c7){const _0x2bb471=a31_0x2d63b8,{options:_0x3cf6d5,args:_0x32854c,tdx:_0x1089cf}=_0x36e9c7,_0x4d4201=_0x3cf6d5,_0x5e4f75=_0x32854c[0x0],_0x151be8=_0x32854c[0x1],_0x4c4f0b=_0x32854c[0x2]||_0x3cf6d5[_0x2bb471(0x1b7)];if(!_0x5e4f75)return console[_0x2bb471(0x17a)](_0x2bb471(0x23e)),console['error'](_0x2bb471(0xd9)),console['error'](_0x2bb471(0x29c)),0x1;if(!_0x151be8)return console['error'](_0x2bb471(0xfc)),console['error'](_0x2bb471(0xd9)),console[_0x2bb471(0x17a)](_0x2bb471(0x29c)),0x1;if(!_0x4c4f0b)return showParentSegmentNotSetError(_0x2bb471(0xc5)+_0x2bb471(0x29c)),0x1;const _0x4ef425=await withSpinner(_0x2bb471(0x208)+_0x4c4f0b+_0x2bb471(0x1ca),()=>_0x1089cf['segment'][_0x2bb471(0x11e)](_0x4c4f0b),{'verbose':_0x3cf6d5[_0x2bb471(0xfa)]}),_0x5499a5=_0x4ef425[_0x2bb471(0x244)],_0x5cfb3f={'name':_0x5e4f75};_0x4d4201['allowedIps']&&(_0x5cfb3f[_0x2bb471(0x24d)]=_0x4d4201[_0x2bb471(0x24d)]['split'](',')[_0x2bb471(0x10b)](_0x2e7ec1=>_0x2e7ec1['trim']()));_0x4d4201[_0x2bb471(0x2ad)]&&(_0x5cfb3f[_0x2bb471(0x2ad)]=_0x4d4201['description']);const _0x30cdc1=await withSpinner(_0x2bb471(0x15f)+_0x5e4f75+_0x2bb471(0x230)+_0x151be8+_0x2bb471(0x1ca),()=>_0x1089cf[_0x2bb471(0x199)]['createToken'](_0x5499a5,_0x151be8,_0x5cfb3f),{'verbose':_0x3cf6d5[_0x2bb471(0xfa)]}),_0x5793c7=_0x30cdc1[_0x2bb471(0x244)];return console['error'](_0x2bb471(0x1c2)+_0x5793c7['name']+'\x27\x20with\x20ID:\x20'+_0x5793c7['id']),_0x5793c7['value']&&(console[_0x2bb471(0x17a)](a31_0x1fbc7e[_0x2bb471(0x29a)](_0x2bb471(0xb9))),console[_0x2bb471(0x17a)](a31_0x1fbc7e['cyan'](_0x5793c7[_0x2bb471(0x1d6)])),console[_0x2bb471(0x17a)]('')),await handleSDKOutput([_0x5793c7],_0x3cf6d5),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x2d63b8(0x105)]='ps:pz:service:token:delete';['description']=a31_0x2d63b8(0x118);async[a31_0x2d63b8(0x25f)](_0x13cece){const _0x42f491=a31_0x2d63b8,{options:_0x55a738,args:_0x5bf33e,tdx:_0x4b5f1d}=_0x13cece,_0x3eb644=_0x5bf33e[0x0],_0x14576e=_0x5bf33e[0x1]||_0x55a738[_0x42f491(0x1b7)];if(!_0x3eb644)return console[_0x42f491(0x17a)](_0x42f491(0x1bd)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x42f491(0x17a)](_0x42f491(0x202)),0x1;if(!_0x14576e)return showParentSegmentNotSetError(_0x42f491(0xbb)+_0x42f491(0x202)),0x1;const _0x35292e=await withSpinner(_0x42f491(0x208)+_0x14576e+'\x27...',()=>_0x4b5f1d[_0x42f491(0xc6)][_0x42f491(0x11e)](_0x14576e),{'verbose':_0x55a738[_0x42f491(0xfa)]}),_0x392248=_0x35292e[_0x42f491(0x244)],_0x338719=await withSpinner(_0x42f491(0x1a2),()=>_0x4b5f1d[_0x42f491(0x199)][_0x42f491(0x128)](_0x392248),{'verbose':_0x55a738[_0x42f491(0xfa)]}),_0x38bbbb=_0x338719[_0x42f491(0x244)];let _0x3b3578;for(const _0x4f5a3a of _0x38bbbb){if(_0x4f5a3a[_0x42f491(0x290)]?.[_0x42f491(0x10c)](_0x325a0e=>_0x325a0e['id']===_0x3eb644)){_0x3b3578=_0x4f5a3a['id'];break;}}if(!_0x3b3578)return console[_0x42f491(0x17a)](_0x42f491(0x13f)+_0x3eb644+'\x27\x20not\x20found\x20in\x20any\x20personalization\x20service'),0x1;const _0x42d39c=await withSpinner(_0x42f491(0xd8)+_0x3eb644+_0x42f491(0x1ca),()=>_0x4b5f1d[_0x42f491(0x199)]['deleteToken'](_0x392248,_0x3b3578,_0x3eb644),{'verbose':_0x55a738[_0x42f491(0xfa)]}),_0x34f63c=_0x42d39c[_0x42f491(0x244)];return console['error'](_0x42f491(0x197)+(_0x34f63c[_0x42f491(0x105)]||_0x3eb644)+'\x27'),await handleSDKOutput([_0x34f63c],_0x55a738),0x0;}}export class PSPzListCommand extends BaseCommand{['name']='ps:pz:list';[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x15b);async['execute'](_0x2850dd){const _0x164894=a31_0x2d63b8,{options:_0x43e767,args:_0x45fbb4,tdx:_0x252755}=_0x2850dd,_0x2745a4=_0x45fbb4[0x0]||_0x43e767[_0x164894(0x1b7)];if(!_0x2745a4)return showParentSegmentNotSetError(_0x164894(0x26a)+_0x164894(0x1f0)),0x1;const _0x363417=await withSpinner(_0x164894(0x208)+_0x2745a4+_0x164894(0x1ca),()=>_0x252755['segment'][_0x164894(0x11e)](_0x2745a4),{'verbose':_0x43e767['verbose']}),_0x3c8012=_0x363417[_0x164894(0x244)],_0x4111f5=await withSpinner(_0x164894(0xd3)+_0x2745a4+_0x164894(0x1ca),()=>_0x252755[_0x164894(0x199)][_0x164894(0x19f)](_0x3c8012),{'verbose':_0x43e767[_0x164894(0xfa)]}),_0x216b37=_0x4111f5[_0x164894(0x244)];console[_0x164894(0x17a)]('✔\x20Found\x20'+_0x216b37[_0x164894(0x1ba)]+_0x164894(0x2ac)+(_0x216b37[_0x164894(0x1ba)]!==0x1?'s':''));if(_0x43e767['format']===_0x164894(0xeb)||_0x43e767[_0x164894(0xab)]===_0x164894(0xfd))await handleSDKOutput(_0x216b37,_0x43e767);else{if(_0x216b37['length']===0x0)console[_0x164894(0x113)]('No\x20personalizations\x20configured');else for(const _0x488413 of _0x216b37){console[_0x164894(0x113)](a31_0x1fbc7e[_0x164894(0x1f6)](_0x488413[_0x164894(0x105)])+'\x20'+a31_0x1fbc7e[_0x164894(0x1a0)](_0x164894(0x129)+_0x488413['id']+')'));_0x488413[_0x164894(0x2ad)]&&console[_0x164894(0x113)]('\x20\x20'+a31_0x1fbc7e[_0x164894(0x1a0)](_0x488413[_0x164894(0x2ad)]));const _0x14a339=_0x488413['sections']?.[_0x164894(0x1ba)]||0x0;console[_0x164894(0x113)]('\x20\x20'+a31_0x1fbc7e[_0x164894(0x26d)](_0x164894(0x296))+'\x20'+_0x14a339);if(_0x488413[_0x164894(0x11d)]&&_0x488413['sections'][_0x164894(0x1ba)]>0x0)for(const _0x280ed6 of _0x488413[_0x164894(0x11d)]){console[_0x164894(0x113)](_0x164894(0x150)+_0x280ed6[_0x164894(0x105)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{['name']=a31_0x2d63b8(0x12d);['description']=a31_0x2d63b8(0x1ff);async['execute'](_0x51f96a){const _0x2be565=a31_0x2d63b8,{options:_0x430df8,args:_0x22f17b,tdx:_0x36bc1c}=_0x51f96a,_0x241422=_0x22f17b[0x0];if(!_0x241422)return console['error']('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x2be565(0x17a)](_0x2be565(0x22c)),0x1;const _0x10b75b=await withSpinner(_0x2be565(0x109)+_0x241422+_0x2be565(0x1ca),()=>_0x36bc1c[_0x2be565(0x199)][_0x2be565(0x1bf)](_0x241422),{'verbose':_0x430df8[_0x2be565(0xfa)]}),_0x3baa5e=_0x10b75b[_0x2be565(0x244)];console[_0x2be565(0x17a)](_0x2be565(0x23d)+_0x3baa5e[_0x2be565(0x105)]+'\x27');if(_0x430df8[_0x2be565(0xab)]==='json'||_0x430df8['format']===_0x2be565(0xfd))await handleSDKOutput([_0x3baa5e],_0x430df8);else{console[_0x2be565(0x113)](a31_0x1fbc7e[_0x2be565(0x1f6)](_0x3baa5e[_0x2be565(0x105)])+'\x20'+a31_0x1fbc7e[_0x2be565(0x1a0)](_0x2be565(0x129)+_0x3baa5e['id']+')'));_0x3baa5e[_0x2be565(0x2ad)]&&console['log']('\x20\x20'+a31_0x1fbc7e[_0x2be565(0x1a0)](_0x3baa5e[_0x2be565(0x2ad)]));_0x3baa5e[_0x2be565(0x281)]&&console[_0x2be565(0x113)]('\x20\x20'+a31_0x1fbc7e['cyan'](_0x2be565(0x174))+'\x20'+_0x3baa5e[_0x2be565(0x281)]);console[_0x2be565(0x113)]('\x20\x20'+a31_0x1fbc7e[_0x2be565(0x26d)](_0x2be565(0x157))+'\x20'+_0x3baa5e[_0x2be565(0x1b4)]),console[_0x2be565(0x113)]('\x20\x20'+a31_0x1fbc7e[_0x2be565(0x26d)](_0x2be565(0x23a))+'\x20'+_0x3baa5e[_0x2be565(0x21d)]);const _0x402c66=_0x3baa5e[_0x2be565(0x11d)]?.[_0x2be565(0x1ba)]||0x0;console['log']('\x20\x20'+a31_0x1fbc7e[_0x2be565(0x26d)](_0x2be565(0x296))+'\x20'+_0x402c66);if(_0x3baa5e[_0x2be565(0x11d)]&&_0x3baa5e[_0x2be565(0x11d)][_0x2be565(0x1ba)]>0x0)for(const _0x2a866f of _0x3baa5e['sections']){console[_0x2be565(0x113)](_0x2be565(0x25d)+a31_0x1fbc7e['bold'](_0x2a866f['name'])+'\x20'+a31_0x1fbc7e[_0x2be565(0x1a0)](_0x2be565(0x129)+_0x2a866f['id']+')')),_0x2a866f[_0x2be565(0x243)]&&(console[_0x2be565(0x113)](_0x2be565(0x212)+a31_0x1fbc7e[_0x2be565(0x26d)]('entryCriteria:')+'\x20'+_0x2a866f[_0x2be565(0x243)]['name']),_0x2a866f[_0x2be565(0x243)][_0x2be565(0x2ab)]?.[_0x2be565(0x111)]&&console[_0x2be565(0x113)](_0x2be565(0x27b)+a31_0x1fbc7e[_0x2be565(0x26d)]('keyEventId:')+'\x20'+_0x2a866f[_0x2be565(0x243)][_0x2be565(0x2ab)][_0x2be565(0x111)])),_0x2a866f[_0x2be565(0xcc)]&&console[_0x2be565(0x113)](_0x2be565(0x212)+a31_0x1fbc7e[_0x2be565(0x26d)](_0x2be565(0x17b))+'\x20'+JSON[_0x2be565(0x1c6)](_0x2a866f[_0x2be565(0xcc)])),_0x2a866f[_0x2be565(0x160)]&&console[_0x2be565(0x113)](_0x2be565(0x212)+a31_0x1fbc7e[_0x2be565(0x26d)]('includeSensitive:')+_0x2be565(0x1d0));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x2d63b8(0x105)]=a31_0x2d63b8(0xa5);[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x239);async[a31_0x2d63b8(0x25f)](_0x3becd4){const _0x39b0a5=a31_0x2d63b8,{options:_0x165978,args:_0x1b1644,tdx:_0x31d69c}=_0x3becd4,_0x5091ea=_0x1b1644[0x0];if(!_0x5091ea)return console[_0x39b0a5(0x17a)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x39b0a5(0x17a)]('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x39b0a5(0x21f)+_0x5091ea+_0x39b0a5(0x1ca),()=>_0x31d69c[_0x39b0a5(0x199)]['deletePersonalization'](_0x5091ea),{'verbose':_0x165978['verbose']}),console[_0x39b0a5(0x17a)](_0x39b0a5(0xe9)+_0x5091ea+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x2d63b8(0x105)]='ps:pz:create';['description']=a31_0x2d63b8(0x18f);async['execute'](_0x97715d){const _0x2c6e77=a31_0x2d63b8,{options:_0x47d8ff,tdx:_0x2bf312}=_0x97715d,_0x3bb138=_0x47d8ff;let _0x17f2f6;if(_0x3bb138[_0x2c6e77(0x110)]){_0x17f2f6=await loadJSON(_0x3bb138[_0x2c6e77(0x110)],!![]);if(!_0x17f2f6[_0x2c6e77(0x184)]?.[_0x2c6e77(0x123)])return console[_0x2c6e77(0x17a)](_0x2c6e77(0x1e6)),console[_0x2c6e77(0x17a)](_0x2c6e77(0x20b)),console[_0x2c6e77(0x17a)](_0x2c6e77(0xd6)),0x1;}else{if(!_0x3bb138[_0x2c6e77(0x105)])return console[_0x2c6e77(0x17a)](_0x2c6e77(0x126)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x2c6e77(0x17a)](_0x2c6e77(0x1cd)),0x1;if(_0x3bb138[_0x2c6e77(0x2ad)]===undefined)return console['error'](_0x2c6e77(0x206)),console[_0x2c6e77(0x17a)](_0x2c6e77(0x1da)),console[_0x2c6e77(0x17a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x3bb138[_0x2c6e77(0x216)]===undefined)return console[_0x2c6e77(0x17a)]('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console['error']('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x5239b5=_0x3bb138[_0x2c6e77(0x281)];if(!_0x5239b5&&_0x47d8ff[_0x2c6e77(0x1b7)]){const _0x78ec60=await withSpinner(_0x2c6e77(0x208)+_0x47d8ff['parentSegment']+_0x2c6e77(0x1ca),()=>_0x2bf312[_0x2c6e77(0xc6)]['resolveParentId'](_0x47d8ff['parentSegment']),{'verbose':_0x47d8ff[_0x2c6e77(0xfa)]});_0x5239b5=_0x78ec60['data'];}let _0x1b4f74;_0x3bb138[_0x2c6e77(0x11d)]&&(_0x1b4f74=await loadJSON(_0x3bb138[_0x2c6e77(0x11d)],![]));const _0x1f2da6=_0x3bb138[_0x2c6e77(0x216)]===_0x2c6e77(0xec)?null:{'id':_0x3bb138['folderId'],'type':'folder-segment'};_0x17f2f6={'attributes':{'name':_0x3bb138[_0x2c6e77(0x105)],'description':_0x3bb138[_0x2c6e77(0x2ad)]||null,..._0x5239b5!==undefined&&{'audienceId':_0x5239b5},..._0x1b4f74!==undefined&&{'sections':_0x1b4f74}},'relationships':{'parentFolder':{'data':_0x1f2da6}}};}const _0x129ada=await withSpinner(_0x2c6e77(0x173)+(_0x17f2f6[_0x2c6e77(0x17d)]?.[_0x2c6e77(0x105)]??'')+_0x2c6e77(0x1ca),()=>_0x2bf312[_0x2c6e77(0x199)][_0x2c6e77(0x27f)](_0x17f2f6),{'verbose':_0x47d8ff[_0x2c6e77(0xfa)]}),_0x54bf05=_0x129ada[_0x2c6e77(0x244)];return console['error'](_0x2c6e77(0xf4)+_0x54bf05[_0x2c6e77(0x105)]+_0x2c6e77(0x187)+_0x54bf05['id']),await handleSDKOutput([_0x54bf05],_0x47d8ff),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x2d63b8(0x105)]='ps:pz:patch';[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x15e);async[a31_0x2d63b8(0x25f)](_0x15e482){const _0xd81c92=a31_0x2d63b8,{options:_0x3fab72,args:_0x24533e}=_0x15e482,_0x34887d=_0x3fab72,_0x5b87ca=_0x24533e[0x0];if(!_0x5b87ca)return console[_0xd81c92(0x17a)](_0xd81c92(0xa6)),console[_0xd81c92(0x17a)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0xd81c92(0x17a)](_0xd81c92(0x282)),0x1;let _0x1d242b;if(_0x34887d['file'])_0x1d242b=await loadJSON(_0x34887d['file'],!![]);else{if(!_0x34887d[_0xd81c92(0x105)])return console[_0xd81c92(0x17a)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0xd81c92(0xa4)),0x1;if(_0x34887d[_0xd81c92(0x2ad)]===undefined)return console['error'](_0xd81c92(0x206)),console[_0xd81c92(0x17a)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x20d998;_0x34887d['sections']&&(_0x20d998=await loadJSON(_0x34887d[_0xd81c92(0x11d)],![])),_0x1d242b={'attributes':{'name':_0x34887d['name'],'description':_0x34887d[_0xd81c92(0x2ad)]||null,..._0x20d998!==undefined&&{'sections':_0x20d998}}};}const {tdx:_0x56c699}=_0x15e482,_0x3e3264=await withSpinner('Patching\x20personalization\x20\x27'+_0x5b87ca+_0xd81c92(0x1ca),()=>_0x56c699['personalization'][_0xd81c92(0x1e0)](_0x5b87ca,_0x1d242b),{'verbose':_0x3fab72[_0xd81c92(0xfa)]}),_0x5d9dd3=_0x3e3264[_0xd81c92(0x244)];return console[_0xd81c92(0x17a)](_0xd81c92(0x270)+_0x5d9dd3[_0xd81c92(0x105)]+_0xd81c92(0xf0)+_0x5d9dd3['id']+')'),await handleSDKOutput([_0x5d9dd3],_0x3fab72),0x0;}}function a31_0x3692(){const _0x187784=['totalEvents','ps:rt:validate','events','Create\x20a\x20realtime\x20personalization\x20entity','label','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','YAML\x20file:\x20','Show\x20personalization\x20service\x20details','.yml','Attributes:','attributesFile','✔\x20Deleted\x20token\x20\x27','sampleData','personalization','collectSchema','match','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','join','Creating\x20parent\x20segment\x20\x27','listPersonalizations','dim','\x27\x20and\x20run\x20workflow?','Finding\x20service\x20for\x20token...','Fetching\x20sample\x20data...','754623RnpzqC','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','indexOf','\x0aError:','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Master\x20Table','784156cFcDBF','\x22\x20}','/\x20directory.\x0a','customerGroup','query','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','`\x20to\x20download\x20the\x20configuration\x20first','createdAt','Attempt:','message','parentSegment','\x0a⚠️\x20\x20Migrating:\x20','Attribute:','length','\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','Master:','Error:\x20Token\x20ID\x20is\x20required','scheduleType','getPersonalization','\x0aNo\x20sample\x20data\x20available','displayColumns','✔\x20Created\x20token\x20\x27','xdg-open','Updating','\x20Added\x20RT\x202.0\x20template\x20section','stringify','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','public','\x27...','\x20stage','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','true','joinKey','\x20true','state','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','no\x20tokens\x20configured','Fetching\x20current\x20configuration\x20for\x20\x27','value','customerGroupFile','red','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','endsWith','listJourneys','yes','/attempt/','web','patchPersonalization','sourceTableValid','coveragePercent','segment:parent:pull','reduce','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Updating\x20personalization\x20service\x20\x27','Error:\x20--attribute\x20requires\x20a\x20name\x0a','column','all','SQL\x20query:\x0a','status','880YjsjBK','Delete\x20a\x20personalization\x20service','\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','ps:rt:list','varchar','\x20[Job\x20ID:\x20','valid','setJobId','bold','launched','453537ZhVzUX','displayRealtimeInfo','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','⚡\x20Enabled','\x22,\x20\x22type\x22:\x20\x22','validateParentYaml','Show\x20a\x20specific\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','session','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','SELECT\x20*\x20FROM\x20','replace','Error:\x20File\x20not\x20found:\x20','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','displaySampleData','Resolving\x20parent\x20segment\x20\x27','processedRows','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Columns:','sourceTableError','✔\x20Renamed\x20directory\x20to\x20','scheduleOption','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','token:','\x20\x20\x20\x20\x20\x20','Deleting\x20personalization\x20service\x20\x27','Status:','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','folderId','No\x20parent\x20segments\x20found','single','\x20parent\x20segment','/sessions/','parent_segments','Error:\x20Service\x20name\x20is\x20required','updatedAt','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Deleting\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','rowCount','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','getParentFull','getBehaviorNames','.yaml','Attributes','personalization_services','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','page_view','master','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Aborted.','previewParentYaml','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x27\x20for\x20service\x20\x27','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','/\x20directories\x20exist.','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Next\x20steps:','parent_segment','column_name','Preview:','Delete\x20a\x20realtime\x20personalization','updated:','\x20RT-enabled\x20parent\x20segment','displaySummary','✔\x20Found\x20personalization\x20\x27','Error:\x20Token\x20name\x20is\x20required','pullParentYaml','58MkhxhP','\x0aChanges\x20to\x20\x27','-1d','entryCriteria','data','No\x20RT-enabled\x20parent\x20segments\x20found','SELECT\x20*\x20FROM\x20(\x0a','columns','sort','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Personalization:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','allowedIps','\x0aUsage:\x20tdx\x20ps\x20preview\x20','List\x20available\x20fields\x20for\x20segmentation','stats','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','text','✔\x20Created\x20parent\x20segment\x20\x27','unref','id:\x20','status:\x20','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','Schema\x20saved\x20to\x20','double','platform','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','My\x20Service','\x20\x20\x20\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','execute','\x20--behavior\x20\x22','Updating\x20parent\x20segment\x20\x27','formatSchemaJson','✔\x20Retrieved\x20RT\x20configuration\x20version','allValid','schemaError','in\x20','\x20behaviors','\x20parent\x20segment\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','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','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','cyan','toFixed','\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','✔\x20Updated\x20personalization\x20\x27','run','segment:parent:run','displayValidateResults','runParent','/\x20and\x20','Create\x20parent\x20segment\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','attribute','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20\x20\x20\x20\x20\x20\x20','Personalization\x20service\x20description','\x0a⚠️\x20\x20Both\x20','realtime','createPersonalization','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','audienceId','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Events:','schemaValid','\x20\x20Columns:\x20','Output\x20file:\x20','matchedCount','Error:\x20Parent\x20segment\x20name\x20is\x20required','ignore','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','/{name}.yml\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20No\x20changes\x20-\x20','utf-8','number','tokens','\x20rows)','✔\x20No\x20changes\x20-\x20\x27','\x20rows\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20\x202.\x20Run\x20','sections:','addAttributes','Fetching\x20behavior\x20list...','interval','yellow','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','population','public:','delete','Coverage:','filter','Listing\x20RT-enabled\x20parent\x20segments...','create','ps:rt:configuration_versions','behavior_','ps:pz:service:create','Errors:','workflowId','patch','No\x20RT\x20journeys\x20found','keyEventCriteria','\x20personalization','description','output','Resume\x20activations\x20in\x20an\x20RT\x20journey','Table:\x20','listParents','\x0aNew\x20parent\x20segment\x20\x27','displayPreviewHints','isDirectory','⚡\x20Not\x20enabled','✔\x20Found\x20','displayPreviewResults','timezone','Options:\x0a','Rows:','repeat','trim','type','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','ps:pz:delete','Error:\x20Personalization\x20ID\x20is\x20required','/app/workflows/','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x20Configuration\x20is\x20valid','stop','format','identifier:\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','✔\x20Deleted\x20personalization\x20service\x20\x27','addAttributesFile','Join\x20on:','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','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','workflowSessionId','td_client_id','green','darwin','enabled','Session:','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','identifier','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','customersWithEvents','localeCompare','segment:parent:preview','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Error\x20parsing\x20YAML:\x20','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Pause\x20activations\x20in\x20an\x20RT\x20journey','\x20tdx\x20wf\x20attempt\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','segment','Fetching\x20SQL\x20for\x20\x27','test','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','table','Get\x20current\x20RT\x20configuration\x20version\x20status','payload','last_page_viewed','pushParentYaml','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','ID\x20Stitching:','ps:pz:service:delete','Listing\x20personalizations\x20for\x20\x27','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','\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}','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Deleting\x20token\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','behaviors','Listing\x20fields\x20for\x20\x27','segment:parent:show','Error:','Created','\x20to\x20configure\x20your\x20personalization\x20service','site','Executing\x20parent\x20segment\x20query...','user_id','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','addBehaviors','start','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','ps:pz:service:show','\x5c$&','✔\x20Deleted\x20personalization\x20\x27','Error:\x20--name\x20is\x20required','json','null','Found\x20YAML\x20file:\x20','realtime:','Default','\x27\x20(id:\x20','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','ps:pz:service:list','\x20kill','✔\x20Created\x20personalization\x20\x27','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Source:','1763WQjRsY','10179rOnBbS','ps:rt:jn:resume','verbose','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Error:\x20Service\x20ID\x20is\x20required','jsonl','\x20service','errors','Updated','information_schema','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','RT\x202.0\x20Validate:','Fetching\x20parent\x20segment\x20\x27','name','\x20RT\x20journey','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Getting\x20personalization\x20\x27','\x20--interval\x20','map','some','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','workflowAttemptId','open','file','keyEventId','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','log','RT\x20Journey\x20ID:\x20','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','RT\x202.0:','23340IuJmeA','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Parent\x20segment:\x20','displayBehaviorsStats','segment:parent:desc','addBehaviorsFile','sections','resolveParentId','stageCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20total','FINISHED','parentFolder','Behaviors','segment:parent:sql','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20is\x20already\x20up\x20to\x20date','list','(id:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','personalizationServices','✔\x20Created\x20personalization\x20service\x20\x27','ps:pz:show','updateParent','Validate:','Apply\x20changes\x20to\x20\x27','keys','/app/dw/parentSegments/','230spECwQ','ps:pz:service:update','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Customers:','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','jobId','database','Options\x20(one\x20required):\x0a','Creating\x20personalization\x20service\x20\x27','Listing\x20personalization\x20services\x20for\x20\x27','tdx\x20ps\x20preview\x20','segment:parent:view','Error:\x20Token\x20\x27','\x20--enriched','getCurrentConfigVersion','Fetching\x20customers\x20schema...','Behavior:','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','displayAttributesStats','Get\x20SQL\x20query\x20for\x20parent\x20segment','\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','segment:parent:update','stitchingKeys','\x20field','\x20(paused)','2363290dWtaCm','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0a\x20\x20\x20\x20}','getParentSQL','\x20\x20\x20\x20-\x20','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20service(s)\x20configured','\x20--attribute\x20\x22','Creating','\x20\x201.\x20Edit\x20','created:','\x20\x20Note:\x20','Overwrite\x20\x27','To\x20view\x20sample\x20data:','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','\x20=\x20','primaryKey','Update\x20a\x20realtime\x20personalization\x20entity','Creating\x20token\x20\x27','includeSensitive','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Error\x20reading\x20file:\x20','\x0a✔\x20Workflow\x20started','segment:parent:fields','foreignKey','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','behavior','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','customers','enriched','To\x20cancel:','paused','allowed\x20IPs:','\x20configured','\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','string','idStitching','Creating\x20personalization\x20\x27','audienceId:','segment:parent:create','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','error','payload:','eventKind:\x20','attributes','Analyzing\x20changes...','segment:parent:validate','eventKind','column_type','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Listing\x20parent\x20segments\x20matching\x20\x27','relationships','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','customerPercent','\x27\x20with\x20ID:\x20','toLowerCase','apply','any','No\x20personalization\x20services\x20configured'];a31_0x3692=function(){return _0x187784;};return a31_0x3692();}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x2d63b8(0x105)]='ps:pz:init';[a31_0x2d63b8(0x2ad)]=a31_0x2d63b8(0x280);async['execute'](_0x377fec){const _0x3cb99b=a31_0x2d63b8,{options:_0x5c153b,args:_0x1c25fc}=_0x377fec,_0x57f529=_0x1c25fc[0x0]||_0x5c153b[_0x3cb99b(0x1b7)];if(!_0x57f529)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'+_0x3cb99b(0x147)),0x1;const _0x4b6e8d=resolveYamlFile(_0x57f529);if(!existsSync(_0x4b6e8d))return showFileNotFoundError(_0x4b6e8d,_0x57f529),0x1;let _0x4eddad;try{_0x4eddad=readFileSync(_0x4b6e8d,_0x3cb99b(0x28e));}catch(_0x23c4f4){const _0x4c64a4=_0x23c4f4 instanceof Error?_0x23c4f4[_0x3cb99b(0x1b6)]:String(_0x23c4f4);return console[_0x3cb99b(0x17a)](_0x3cb99b(0x162)+_0x4c64a4),0x1;}let _0x2f92d1;try{_0x2f92d1=parseDef(_0x4eddad);}catch(_0x246659){const _0x2deac8=_0x246659 instanceof Error?_0x246659[_0x3cb99b(0x1b6)]:String(_0x246659);return console['error'](a31_0x1fbc7e[_0x3cb99b(0x1d8)](_0x3cb99b(0xc1)+_0x2deac8)),0x1;}if(_0x2f92d1[_0x3cb99b(0x228)]&&_0x2f92d1[_0x3cb99b(0x228)][_0x3cb99b(0x1ba)]>0x0)return console[_0x3cb99b(0x17a)](a31_0x1fbc7e[_0x3cb99b(0x29a)](_0x3cb99b(0x115)+_0x4b6e8d)),console['error'](a31_0x1fbc7e[_0x3cb99b(0x1a0)]('\x20\x20\x20'+_0x2f92d1[_0x3cb99b(0x228)][_0x3cb99b(0x1ba)]+_0x3cb99b(0x153))),0x1;!_0x2f92d1[_0x3cb99b(0x27e)]&&(_0x2f92d1[_0x3cb99b(0x27e)]={'events':[{'name':_0x3cb99b(0x22a),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x3cb99b(0xcd),'type':_0x3cb99b(0x218)}],'id_stitching':{'primary_key':_0x2f92d1[_0x3cb99b(0x22b)][_0x3cb99b(0xca)]===_0x3cb99b(0x16a)?_0x3cb99b(0xb4):_0x3cb99b(0xe2)}});_0x2f92d1[_0x3cb99b(0x228)]=[{'name':_0x3cb99b(0x25c),'description':_0x3cb99b(0x27c),'trigger_event':_0x3cb99b(0x22a),'sections':[{'name':_0x3cb99b(0xef),'criteria':_0x3cb99b(0x1ce),'attributes':['last_page_viewed']}]}];const _0x16737f=serializeDef(_0x2f92d1);return writeFileSync(_0x4b6e8d,_0x16737f,_0x3cb99b(0x28e)),console[_0x3cb99b(0x17a)](a31_0x1fbc7e[_0x3cb99b(0xb5)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a31_0x1fbc7e[_0x3cb99b(0x26d)](_0x4b6e8d)),(!_0x2f92d1['realtime']||_0x4eddad[_0x3cb99b(0x1a6)](_0x3cb99b(0xee))===-0x1)&&console[_0x3cb99b(0x17a)](a31_0x1fbc7e[_0x3cb99b(0xb5)]('✔')+_0x3cb99b(0x1c5)),console[_0x3cb99b(0x17a)]('\x0a'+a31_0x1fbc7e[_0x3cb99b(0x1a0)](_0x3cb99b(0x235))),console['error'](_0x3cb99b(0x156)+_0x4b6e8d+_0x3cb99b(0xdf)),console['error'](_0x3cb99b(0x295)+a31_0x1fbc7e[_0x3cb99b(0x1a0)]('tdx\x20ps\x20push\x20'+_0x57f529)+'\x20to\x20push\x20the\x20configuration'),0x0;}}
|
|
1
|
+
const a31_0x23ba89=a31_0x1186;(function(_0x251df9,_0x559f65){const _0x149442=a31_0x1186,_0x45bc40=_0x251df9();while(!![]){try{const _0x10a0fa=-parseInt(_0x149442(0x21a))/0x1+parseInt(_0x149442(0x271))/0x2+parseInt(_0x149442(0x27e))/0x3+-parseInt(_0x149442(0x2f1))/0x4*(-parseInt(_0x149442(0x39a))/0x5)+-parseInt(_0x149442(0x261))/0x6+parseInt(_0x149442(0x26d))/0x7*(parseInt(_0x149442(0x1c5))/0x8)+parseInt(_0x149442(0x32d))/0x9*(-parseInt(_0x149442(0x33d))/0xa);if(_0x10a0fa===_0x559f65)break;else _0x45bc40['push'](_0x45bc40['shift']());}catch(_0x25567e){_0x45bc40['push'](_0x45bc40['shift']());}}}(a31_0x1c60,0x48117));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x5fc94f 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_0x22e59c 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_0x23ba89(0x293),LEGACY_PARENT_SEGMENT_DIR=a31_0x23ba89(0x28e);function openBrowser(_0x2e0509){const _0x58c71e=a31_0x23ba89,_0x1d1e7b=process[_0x58c71e(0x2c3)],_0x9c3fc2=_0x1d1e7b==='darwin'?_0x58c71e(0x1ec):_0x1d1e7b===_0x58c71e(0x361)?'start':'xdg-open';spawn(_0x9c3fc2,[_0x2e0509],{'detached':!![],'stdio':_0x58c71e(0x276)})[_0x58c71e(0x243)]();}function migrateLegacyDirectory(){const _0xb9499d=a31_0x23ba89;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x32f96c=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x32f96c[_0xb9499d(0x23b)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xb9499d(0x1b0)](a31_0x22e59c[_0xb9499d(0x1e8)]('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0xb9499d(0x302))),console['error'](a31_0x22e59c['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0xb9499d(0x266))),![];console[_0xb9499d(0x1b0)](a31_0x22e59c[_0xb9499d(0x1e8)](_0xb9499d(0x2c0)+LEGACY_PARENT_SEGMENT_DIR+_0xb9499d(0x213)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xb9499d(0x1b0)](a31_0x22e59c['green'](_0xb9499d(0x21d)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x200308){const _0x10b6e0=_0x200308 instanceof Error?_0x200308[_0xb9499d(0x39b)]:String(_0x200308);return console['error'](a31_0x22e59c[_0xb9499d(0x38e)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x10b6e0+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x23ba89(0x330)](_0x204276){const _0xf33767=a31_0x23ba89;return migrateLegacyDirectory(),super[_0xf33767(0x330)](_0x204276);}}function resolveYamlFile(_0x1a34b4){const _0x65628b=a31_0x23ba89;if(_0x1a34b4[_0x65628b(0x217)](_0x65628b(0x257))||_0x1a34b4[_0x65628b(0x217)](_0x65628b(0x223)))return _0x1a34b4;return a31_0x5fc94f[_0x65628b(0x301)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x1a34b4)+_0x65628b(0x257));}function formatProgressMessage(_0x1bef4e){const _0x50d9ee=a31_0x23ba89,_0x3c5800=_0x1bef4e[_0x50d9ee(0x1a4)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3c5800){const [,_0x5e4027,_0x4f88e8,_0xd87cd2='']=_0x3c5800;return a31_0x22e59c[_0x50d9ee(0x297)](_0x5e4027+':')+'\x20'+_0x4f88e8+a31_0x22e59c[_0x50d9ee(0x297)](_0xd87cd2);}return a31_0x22e59c[_0x50d9ee(0x297)](_0x1bef4e);}function a31_0x1186(_0x395e1d,_0x52af27){_0x395e1d=_0x395e1d-0x1a2;const _0x1c6034=a31_0x1c60();let _0x11866c=_0x1c6034[_0x395e1d];return _0x11866c;}function a31_0x1c60(){const _0x280f1b=['No\x20parent\x20segments\x20match\x20pattern:\x20','last_page_viewed','4KOngvW','Attempt:','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Analyzing\x20changes...','Updating','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','✔\x20Query\x20completed:\x20Processed\x20','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','realtime:','Schema\x20saved\x20to\x20','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Error\x20reading\x20file:\x20','\x20stage','execute','Create\x20a\x20realtime\x20personalization\x20entity','state','join','/\x20directories\x20exist.','keyEventCriteria','displaySummary','columns','Update\x20a\x20realtime\x20personalization\x20entity','Table:\x20','\x20behaviors','Creating\x20token\x20\x27','map','ps:rt:configuration_versions','\x20(paused)','previewParentYaml','Creating\x20parent\x20segment\x20\x27','description','\x20--enriched','paused','Fetching\x20current\x20configuration\x20for\x20\x27','\x20--attribute\x20\x22<name>\x22','ps:rt:validate','getOutputDatabaseName','\x27\x20and\x20run\x20workflow?','text','Error:\x20Service\x20name\x20is\x20required','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20parent\x20segment\x20\x27','scheduleOption','patch','Next\x20steps:','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','deletePersonalization','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','⚡\x20Enabled','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','deleteToken','Master\x20+\x20Attributes','jsonl','behaviors','foreignKey','errors','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Behavior:','pauseJourney','72783GFprNJ','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','run','No\x20RT-enabled\x20parent\x20segments\x20found','sections','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Rows:','attributes','customerGroupFile','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','Apply\x20changes\x20to\x20\x27','No\x20personalization\x20services\x20configured','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','events','600kDSQln','some','\x20personalization\x20service','displayMasterInfo','log','Options\x20(one\x20required):\x0a','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','ps:rt:list','✔\x20Retrieved\x20RT\x20configuration\x20version','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','Columns:','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','value','Create\x20parent\x20segment\x20\x27','tdx\x20ps\x20push\x20','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','segment:parent:list','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','schemaError','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','listPersonalizations','Get\x20SQL\x20query\x20for\x20parent\x20segment','createToken','name','Finding\x20service\x20for\x20token...','Site:\x20','behavior','replace','idStitching','test','listJourneys','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','entryCriteria','scheduleType','win32','format','Created','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','tokens','personalizationServices','To\x20view\x20sample\x20data:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','dirname','\x20Configuration\x20is\x20valid','\x20Added\x20personalization\x20template\x20to\x20','list','keys','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','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','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','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','launched','status','enriched','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','sourceTableValid','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Fetching\x20SQL\x20for\x20\x27','ps:rt:jn:resume','Patching\x20personalization\x20\x27','string','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','json','\x20+\x20[','YAML\x20file:\x20','Delete\x20a\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','attribute','pushParentYaml','Default','start','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Options:\x0a','repeat','jobId','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','red','customerPercent','Updating\x20personalization\x20service\x20\x27','Updating\x20parent\x20segment\x20\x27','segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\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','\x22\x20}','/{name}.yml\x0a','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','realtime','addBehaviorsFile','914005OHVjBJ','message','keyEventId','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','page_view','relationships','\x20configured','indexOf','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','token:','folder-segment','label','\x20No\x20changes\x20-\x20','\x20\x20Note:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','null','\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\x20Database:\x20','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','schemaValid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','file','Attributes:','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','enabled','td_client_id','apply','segment:parent:fields','ps:pz:service:list','match','green','addAttributesFile','\x22,\x20\x22type\x22:\x20\x22','Creating','toLowerCase','listFields','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','\x20\x201.\x20Edit\x20','any','\x0aChanges\x20to\x20\x27','\x20RT-enabled\x20parent\x20segment','error','Deleting\x20token\x20\x27','all','web','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','information_schema','✔\x20Created\x20personalization\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','✔\x20Deleted\x20personalization\x20\x27','Error:\x20Service\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','push','\x0aChanges\x20to\x20apply\x20to\x20\x27','workflowId','/app/workflows/','Validating\x20configuration...','getParentFull','id:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','runParent','80gwPPFD','delete','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:run','no\x20tokens\x20configured','\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\x20\x20\x20','✔\x20Found\x20','Available\x20attributes:','Errors:','\x20\x20Columns:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Personalization:','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','output','behaviorsFile','ps:pz:service:delete','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','SELECT\x20*\x20FROM\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','column','stop','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','ps:pz:init','createParent','/app/dw/parentSegments/','customersWithEvents','created:','\x27...','getCurrentConfigVersion','Fetching\x20sample\x20data...','stringify','Status:','\x20rows\x20','yellow','/attempt/','\x20service','\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}','open','Available\x20behaviors:','segment:parent:preview','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x27\x20is\x20already\x20up\x20to\x20date','audienceId','user_id','Error:\x20Token\x20\x27','Parent\x20segment:\x20','double','Deleting\x20personalization\x20\x27','Creating\x20personalization\x20\x27','\x20service(s)\x20configured','addAttributes','Show\x20parent\x20segment\x20schema\x20(column\x20types)','joinKey','split','✔\x20Deleted\x20personalization\x20service\x20\x27','Found\x20YAML\x20file:\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20total','payload','Validating\x20RT\x20configuration...','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','resolveParentId','validateParentYaml','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Audience\x20ID:','\x27\x20with\x20ID:\x20','ps:pz:service:update','column_type','addBehaviors','\x20Context\x20set:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','utf-8','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','yes','matchedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','/\x20→\x20','bold','Resolving\x20parent\x20segment\x20\x27','toFixed','endsWith','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','behavior_','153872YVIwZL','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x20parent\x20segment\x20\x27','✔\x20Renamed\x20directory\x20to\x20','ps:pz:delete','Error:','\x20\x20\x20\x20-\x20','timezone','getBehaviorNames','.yaml','\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','workflowAttemptId','displayColumns','segment:parent:validate','displaySampleData','Overwrite\x20\x27','-1d','✔\x20Updated\x20personalization\x20service\x20\x27','Getting\x20personalization\x20\x27','public','✔\x20Created\x20token\x20\x27','limit','session','\x0a\x20\x20]\x0a}\x0a','No\x20RT\x20journeys\x20found','column_name','site','updated:','single','ps:pz:patch','audienceId:','sections:','RT\x202.0:','isDirectory','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','\x5c$&','entryCriteria:','master','Events:','personalization_services','customers','unref','interval','listParents','identifier:\x20','allValid','Join\x20on:','totalEvents','resumeJourney','audienceId:\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Listing\x20personalizations\x20for\x20\x27','ps:rt:jn:list','✔\x20No\x20changes\x20-\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','createdAt','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','⚡\x20Not\x20enabled','Error:\x20--attribute\x20requires\x20a\x20name\x0a','.yml','Creating\x20personalization\x20service\x20\x27','ps:pz:create','folderId','filter','\x20to\x20push\x20the\x20configuration','create','localeCompare','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','/sessions/','1260936xCuOXk','get','Master\x20Table','personalization','\x20[Job\x20ID:\x20','/\x20directory.\x0a','stats','{\x0a\x20\x20\x22database\x22:\x20\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','coveragePercent','includeSensitive:','cyan','197309kCbxIx','✔\x20Updated\x20parent\x20segment\x20\x27','stageCount','\x20\x20\x20\x20\x20\x20','832042wVOZbT','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0aNo\x20sample\x20data\x20available','Validate:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','ignore','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','parent_id','\x0a\x20\x20\x20\x20}','\x20--attribute\x20\x22','updatedAt','Listing\x20parent\x20segments\x20matching\x20\x27','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','791241FQomlK','valid','\x20rows)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20RT\x20configuration\x20is\x20valid','Source:','.customers)','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x202.\x20Run\x20','allowed\x20IPs:','\x20RT\x20journey','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','(id:\x20','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','payload:','ps:pz:service:show','parent_segment','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','displayPreviewResults','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','trim','parent_segments','in\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','dim','\x20--behavior\x20\x22','\x20true','\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','ps:pz:service:token:delete','✔\x20Updated\x20personalization\x20\x27','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','\x20is\x20already\x20up\x20to\x20date','✔\x20Found\x20personalization\x20\x27','\x20--behavior\x20\x22<name>\x22','\x20\x20\x20\x20\x20\x20\x20\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','\x20personalization','collectSchema','parentSegment','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','updateParent','table','✔\x20Deleted\x20token\x20\x27','setJobId','primaryKey','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','includeSensitive','FINISHED','displayRealtimeInfo','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','displayBehaviorsStats','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x0aNew\x20parent\x20segment\x20\x27','List\x20RT\x20journeys','Deleting\x20personalization\x20service\x20\x27','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','tdx\x20ps\x20preview\x20','sampleData','\x20--interval\x20','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Fetching\x20behavior\x20list...','database','displayPreviewHints','\x0a⚠️\x20\x20Migrating:\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','platform','keyEventId:','displayValidateResults','Enriched:','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','length','attributesFile','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','varchar','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','processedRows','\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','No\x20personalizations\x20configured','displayAttributesStats','Fetching\x20customers\x20schema...','type','`\x20to\x20download\x20the\x20configuration\x20first','data','Error\x20parsing\x20YAML:\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20Opening\x20','Options:','workflowSessionId','Error:\x20Token\x20ID\x20is\x20required','getParentSQL','Error:\x20Personalization\x20ID\x20is\x20required','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','\x20=\x20','formatSchemaJson','RT\x20Journey\x20ID:\x20','verbose','Show\x20a\x20specific\x20realtime\x20personalization','Join:','SQL\x20query:\x0a','allowedIps','use','population','parentFolder','Updated','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Aborted.','rowCount','stitchingKeys','Master:'];a31_0x1c60=function(){return _0x280f1b;};return a31_0x1c60();}function showFileNotFoundError(_0x3855b3,_0x327783){const _0x566112=a31_0x23ba89;console['error'](a31_0x22e59c[_0x566112(0x38e)]('Error:\x20File\x20not\x20found:\x20'+_0x3855b3+'\x0a')),console['error'](a31_0x22e59c[_0x566112(0x26c)](_0x566112(0x31e)+_0x327783+_0x566112(0x2d3)));}function displayRealtimeValidation(_0x5504c1){const _0x498dd6=a31_0x23ba89;if(!_0x5504c1['realtime'])return;const _0x57e155=_0x5504c1['realtime'],_0x250e6f=_0x57e155[_0x498dd6(0x3b3)]?a31_0x22e59c[_0x498dd6(0x1a5)](_0x498dd6(0x321)):a31_0x22e59c[_0x498dd6(0x1e8)](_0x498dd6(0x255));console[_0x498dd6(0x1b0)]('\x0a'+a31_0x22e59c['dim'](_0x498dd6(0x23a))+'\x20'+_0x250e6f);if(_0x57e155[_0x498dd6(0x33c)]&&_0x57e155[_0x498dd6(0x33c)][_0x498dd6(0x2c8)]>0x0){console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x498dd6(0x297)](_0x498dd6(0x240))+'\x20'+_0x57e155[_0x498dd6(0x33c)][_0x498dd6(0x2c8)]+_0x498dd6(0x3a0));for(const _0x4ab307 of _0x57e155['events']){const _0x50314e=_0x4ab307[_0x498dd6(0x379)]===![]?a31_0x22e59c[_0x498dd6(0x38e)]('✘'):a31_0x22e59c[_0x498dd6(0x1a5)]('✔');console[_0x498dd6(0x1b0)](_0x498dd6(0x1cb)+_0x50314e+'\x20'+_0x4ab307['name']),_0x4ab307['sourceTableError']&&console['error'](_0x498dd6(0x270)+a31_0x22e59c[_0x498dd6(0x38e)](_0x4ab307['sourceTableError']));}}if(_0x57e155['attributes']&&_0x57e155[_0x498dd6(0x336)][_0x498dd6(0x2c8)]>0x0){console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x498dd6(0x297)](_0x498dd6(0x3b1))+'\x20'+_0x57e155[_0x498dd6(0x336)][_0x498dd6(0x2c8)]+_0x498dd6(0x3a0));for(const _0x5d7f28 of _0x57e155[_0x498dd6(0x336)]){const _0x5b285b=_0x5d7f28[_0x498dd6(0x27f)]?a31_0x22e59c[_0x498dd6(0x1a5)]('✔'):a31_0x22e59c[_0x498dd6(0x38e)]('✘');console[_0x498dd6(0x1b0)]('\x20\x20\x20\x20'+_0x5b285b+'\x20'+_0x5d7f28[_0x498dd6(0x356)]+'\x20'+a31_0x22e59c['dim']('('+_0x5d7f28['type']+')'));}}if(_0x57e155[_0x498dd6(0x35b)]){const _0x2251d6=_0x57e155[_0x498dd6(0x35b)][_0x498dd6(0x2ed)]?.['length']?_0x498dd6(0x381)+_0x57e155[_0x498dd6(0x35b)][_0x498dd6(0x2ed)][_0x498dd6(0x301)](',\x20')+']':'';console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x498dd6(0x297)]('ID\x20Stitching:')+'\x20'+_0x57e155[_0x498dd6(0x35b)][_0x498dd6(0x2ac)]+_0x2251d6);}if(_0x57e155[_0x498dd6(0x366)]&&_0x57e155[_0x498dd6(0x366)]['length']>0x0){console[_0x498dd6(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0x498dd6(0x1d1))+'\x20'+_0x57e155['personalizationServices']['length']+_0x498dd6(0x1ea)+(_0x57e155[_0x498dd6(0x366)][_0x498dd6(0x2c8)]!==0x1?'s':''));for(const _0x31ecc7 of _0x57e155[_0x498dd6(0x366)]){console[_0x498dd6(0x1b0)]('\x20\x20\x20\x20-\x20'+_0x31ecc7[_0x498dd6(0x356)]);}}}function showParentSegmentNotSetError(_0x48481a){const _0x418566=a31_0x23ba89;console[_0x418566(0x1b0)](a31_0x22e59c[_0x418566(0x1e8)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x418566(0x1b0)](_0x48481a);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x34e);[a31_0x23ba89(0x30f)]='List\x20parent\x20segments';async['execute'](_0x47999f){const _0x4f7fce=a31_0x23ba89,{options:_0x33c934,args:_0x5068b8,tdx:_0x2ec48a}=_0x47999f,_0x58431f=_0x5068b8[0x0];_0x33c934[_0x4f7fce(0x2e1)]&&(console[_0x4f7fce(0x1b0)](_0x4f7fce(0x358)+_0x33c934['site']),_0x58431f&&console['error']('Pattern:\x20'+_0x58431f));const _0x15b2f5=await withSpinner(_0x58431f?_0x4f7fce(0x27c)+_0x58431f+'\x27...':'Listing\x20parent\x20segments...',()=>_0x2ec48a['segment'][_0x4f7fce(0x245)](),{'verbose':_0x33c934[_0x4f7fce(0x2e1)]});let _0x352124=_0x15b2f5[_0x4f7fce(0x2d4)];if(_0x58431f){const _0x5003e5=_0x58431f[_0x4f7fce(0x35a)](/[.+^${}()|[\]\\]/g,_0x4f7fce(0x23d))[_0x4f7fce(0x35a)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4db75d=new RegExp('^'+_0x5003e5+'$','i');_0x352124=_0x352124[_0x4f7fce(0x25b)](_0x2fdb37=>_0x4db75d[_0x4f7fce(0x35c)](_0x2fdb37[_0x4f7fce(0x336)]['name']));}_0x352124['sort']((_0x130d5c,_0x19649d)=>_0x130d5c['attributes'][_0x4f7fce(0x356)]['localeCompare'](_0x19649d[_0x4f7fce(0x336)][_0x4f7fce(0x356)])),console['error'](_0x4f7fce(0x1cc)+_0x352124[_0x4f7fce(0x2c8)]+'\x20parent\x20segment'+(_0x352124[_0x4f7fce(0x2c8)]!==0x1?'s':''));const _0x2c4b8c=_0x4aabca=>{const _0x3b61a9=_0x4f7fce;return getConsoleNextUrl(_0x33c934[_0x3b61a9(0x234)],_0x3b61a9(0x1df)+_0x4aabca);};if(_0x33c934['format']==='json'||_0x33c934[_0x4f7fce(0x362)]===_0x4f7fce(0x326)){const _0x29e773=_0x352124[_0x4f7fce(0x30a)](_0x476b34=>({..._0x476b34,'url':_0x2c4b8c(_0x476b34['id'])}));await handleSDKOutput(_0x29e773,_0x33c934);}else{if(_0x352124[_0x4f7fce(0x2c8)]===0x0)_0x58431f?console[_0x4f7fce(0x341)](_0x4f7fce(0x2ef)+_0x58431f):console[_0x4f7fce(0x341)]('No\x20parent\x20segments\x20found');else for(const _0x5dbcef of _0x352124){const _0x4b4d90=_0x5dbcef[_0x4f7fce(0x336)][_0x4f7fce(0x2e7)]?a31_0x22e59c['dim']('\x20('+formatRows(_0x5dbcef[_0x4f7fce(0x336)]['population'])+')'):'',_0x5c472c=hyperlink(_0x5dbcef['attributes'][_0x4f7fce(0x356)],_0x2c4b8c(_0x5dbcef['id']));console[_0x4f7fce(0x341)]('👥\x20'+_0x5c472c+_0x4b4d90);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:create';[a31_0x23ba89(0x30f)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a31_0x23ba89(0x2fe)](_0x113375){const _0x29d879=a31_0x23ba89,{options:_0x380107,args:_0x39c1c9,tdx:_0xf873e5}=_0x113375;console[_0x29d879(0x1b0)](_0x29d879(0x275)+_0x29d879(0x3a9)+_0x29d879(0x368));const _0x490636=_0x380107;if(_0x39c1c9['length']===0x0)return console[_0x29d879(0x1b0)](a31_0x22e59c['red'](_0x29d879(0x319))),console[_0x29d879(0x1b0)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0x51bd0e=_0x39c1c9[0x0];if(!_0x490636['database']||!_0x490636[_0x29d879(0x2a9)])return console[_0x29d879(0x1b0)](_0x29d879(0x343)),console[_0x29d879(0x1b0)](_0x29d879(0x3a2)),0x1;_0x490636[_0x29d879(0x2e1)]&&(console['error'](_0x29d879(0x358)+_0x490636[_0x29d879(0x234)]),console['error']('Name:\x20'+_0x51bd0e),console['error']('Database:\x20'+_0x490636[_0x29d879(0x2be)]),console[_0x29d879(0x1b0)](_0x29d879(0x307)+_0x490636['table']));const _0x58b4d5=await loadJSONFromOptions(_0x490636[_0x29d879(0x336)],_0x490636[_0x29d879(0x2c9)]),_0x3e6477=await loadJSONFromOptions(_0x490636[_0x29d879(0x327)],_0x490636[_0x29d879(0x1d4)]),_0x5c9c5f=await loadJSONFromOptions(_0x490636['customerGroup'],_0x490636[_0x29d879(0x337)]),_0x3af1d0={'name':_0x51bd0e,'description':_0x490636[_0x29d879(0x30f)],'scheduleType':_0x490636[_0x29d879(0x360)],'scheduleOption':_0x490636['scheduleOption'],'timezone':_0x490636[_0x29d879(0x221)],'master':{'parentDatabaseName':_0x490636[_0x29d879(0x2be)],'parentTableName':_0x490636['table']},'attributes':_0x58b4d5,'behaviors':_0x3e6477,'customerGroup':_0x5c9c5f},_0x445ff1=await withSpinner(_0x29d879(0x30e)+_0x51bd0e+_0x29d879(0x1e2),()=>_0xf873e5[_0x29d879(0x392)][_0x29d879(0x1de)](_0x3af1d0),{'verbose':_0x380107[_0x29d879(0x2e1)]}),_0x58d79c=_0x445ff1[_0x29d879(0x2d4)];return console[_0x29d879(0x1b0)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x58d79c['name']+'\x27\x20with\x20ID:\x20'+_0x58d79c['id']),await handleSDKOutput([_0x58d79c],_0x380107),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2b1);async[a31_0x23ba89(0x2fe)](_0x15c3e2){const _0x2a4ffd=a31_0x23ba89,{options:_0x51c624,args:_0x39781e,tdx:_0x3bf1b3}=_0x15c3e2;console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x1d8)+_0x2a4ffd(0x3a9)+_0x2a4ffd(0x368));const _0x47345f=_0x51c624;if(_0x39781e[_0x2a4ffd(0x2c8)]===0x0)return console[_0x2a4ffd(0x1b0)](a31_0x22e59c[_0x2a4ffd(0x38e)](_0x2a4ffd(0x319))),console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x277)),0x1;const _0xb2491f=_0x39781e[0x0];_0x47345f[_0x2a4ffd(0x2e1)]&&(console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x358)+_0x47345f[_0x2a4ffd(0x234)]),console[_0x2a4ffd(0x1b0)]('Parent\x20segment:\x20'+_0xb2491f));const _0x29b393=await withSpinner(_0x2a4ffd(0x312)+_0xb2491f+'\x27...',()=>_0x3bf1b3[_0x2a4ffd(0x392)][_0x2a4ffd(0x1c1)](_0xb2491f),{'verbose':_0x47345f['verbose']}),_0x19fd51=_0x29b393[_0x2a4ffd(0x2d4)],_0x156e32=await loadJSONFromOptions(_0x47345f[_0x2a4ffd(0x1f9)],_0x47345f[_0x2a4ffd(0x1a6)]),_0x4e419a=await loadJSONFromOptions(_0x47345f[_0x2a4ffd(0x20b)],_0x47345f[_0x2a4ffd(0x399)]),_0x55ab13={'name':_0x19fd51[_0x2a4ffd(0x356)],'description':_0x47345f[_0x2a4ffd(0x30f)]!==undefined?_0x47345f[_0x2a4ffd(0x30f)]:_0x19fd51['description'],'scheduleType':_0x47345f[_0x2a4ffd(0x360)]!==undefined?_0x47345f[_0x2a4ffd(0x360)]:_0x19fd51[_0x2a4ffd(0x360)],'scheduleOption':_0x47345f[_0x2a4ffd(0x31b)]!==undefined?_0x47345f[_0x2a4ffd(0x31b)]:_0x19fd51[_0x2a4ffd(0x31b)],'timezone':_0x47345f[_0x2a4ffd(0x221)]!==undefined?_0x47345f[_0x2a4ffd(0x221)]:_0x19fd51[_0x2a4ffd(0x221)],'master':_0x19fd51[_0x2a4ffd(0x23f)],'attributes':_0x156e32?[..._0x19fd51['attributes']||[],..._0x156e32]:_0x19fd51[_0x2a4ffd(0x336)],'behaviors':_0x4e419a?[..._0x19fd51['behaviors']||[],..._0x4e419a]:_0x19fd51[_0x2a4ffd(0x327)],'customerGroup':_0x19fd51['customerGroup']},_0x12b6d4=await withSpinner(_0x2a4ffd(0x391)+_0xb2491f+'\x27...',()=>_0x3bf1b3[_0x2a4ffd(0x392)][_0x2a4ffd(0x2a8)](_0xb2491f,_0x55ab13),{'verbose':_0x47345f[_0x2a4ffd(0x2e1)]}),_0x473869=_0x12b6d4['data'];return console[_0x2a4ffd(0x1b0)](_0x2a4ffd(0x26e)+_0x473869['name']+'\x27'),await handleSDKOutput([_0x473869],_0x47345f),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]='segment:parent:pull';['description']=a31_0x23ba89(0x32a);async[a31_0x23ba89(0x2fe)](_0xbeed68){const _0x4038bd=a31_0x23ba89,{options:_0x2ce326,args:_0x194318,tdx:_0x5a62ce}=_0xbeed68,_0x44983f=_0x2ce326,_0x534829=_0x194318[0x0]||_0x2ce326[_0x4038bd(0x2a6)];if(!_0x534829)return showParentSegmentNotSetError(_0x4038bd(0x344)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x44983f[_0x4038bd(0x2e6)]&&_0x44983f[_0x4038bd(0x1d3)])return console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x38e)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x297)](_0x4038bd(0x320))),console['error'](a31_0x22e59c[_0x4038bd(0x297)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x4038bd(0x396))),console[_0x4038bd(0x1b0)](a31_0x22e59c['cyan']('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x59d726=_0x44983f['output']||a31_0x5fc94f[_0x4038bd(0x301)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x534829)+_0x4038bd(0x257));_0x44983f[_0x4038bd(0x2e1)]&&(console[_0x4038bd(0x1b0)](_0x4038bd(0x358)+_0x44983f[_0x4038bd(0x234)]),console[_0x4038bd(0x1b0)](_0x4038bd(0x1f4)+_0x534829),console['error']('Output\x20file:\x20'+_0x59d726));const _0x4bee4d=await withSpinner(_0x4038bd(0x31a)+_0x534829+_0x4038bd(0x1e2),()=>_0x5a62ce[_0x4038bd(0x392)]['pullParentYaml'](_0x534829),{'verbose':_0x44983f[_0x4038bd(0x2e1)]}),_0x17c4ce=_0x4bee4d[_0x4038bd(0x2d4)];if(existsSync(_0x59d726)){const _0x567aaa=readFileSync(_0x59d726,_0x4038bd(0x20e)),_0x140735=generateDiff(_0x567aaa,_0x17c4ce);if(!hasChanges(_0x140735))console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+_0x4038bd(0x3a6)+a31_0x22e59c[_0x4038bd(0x26c)](_0x59d726)+_0x4038bd(0x29f));else{console[_0x4038bd(0x1b0)](_0x4038bd(0x1ae)+_0x59d726+'\x27:'),console[_0x4038bd(0x1b0)]('─'[_0x4038bd(0x38b)](0x3c)),console[_0x4038bd(0x1b0)](formatDiffWithColors(_0x140735)),console[_0x4038bd(0x1b0)]('─'[_0x4038bd(0x38b)](0x3c));if(!_0x44983f[_0x4038bd(0x210)]){if(!isInteractive())return console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x38e)](_0x4038bd(0x32e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x297)](_0x4038bd(0x378))),0x1;const _0x426313=await confirmKey(_0x4038bd(0x229)+_0x59d726+'\x27?');if(!_0x426313)return console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1e8)](_0x4038bd(0x2eb))),0x1;}writeFileSync(_0x59d726,_0x17c4ce,'utf-8'),console['error'](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x22e59c[_0x4038bd(0x26c)](_0x59d726));}}else{const _0x50c92c=a31_0x5fc94f[_0x4038bd(0x369)](_0x59d726);!existsSync(_0x50c92c)&&mkdirSync(_0x50c92c,{'recursive':!![]}),writeFileSync(_0x59d726,_0x17c4ce,'utf-8'),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+_0x4038bd(0x254)+a31_0x22e59c[_0x4038bd(0x26c)](_0x59d726));}return saveSessionContext({'parent_segment':_0x534829},_0x44983f[_0x4038bd(0x230)]),console[_0x4038bd(0x1b0)](a31_0x22e59c[_0x4038bd(0x1a5)]('✔')+_0x4038bd(0x20c)+a31_0x22e59c[_0x4038bd(0x297)](_0x4038bd(0x28e))+_0x4038bd(0x2de)+a31_0x22e59c[_0x4038bd(0x26c)](_0x534829)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x29d);async[a31_0x23ba89(0x2fe)](_0x1e3991){const _0x39cc5a=a31_0x23ba89,{options:_0x4a5cb0,args:_0x4492f3,tdx:_0x43b593}=_0x1e3991,_0x23f7b5=_0x4a5cb0,_0x1c7111=_0x4492f3[0x0]||_0x4a5cb0[_0x39cc5a(0x2a6)];if(!_0x1c7111)return showParentSegmentNotSetError(_0x39cc5a(0x2a7)+_0x39cc5a(0x393)),0x1;const _0xe58672=resolveYamlFile(_0x1c7111);if(!existsSync(_0xe58672))return showFileNotFoundError(_0xe58672,_0x1c7111),0x1;_0x23f7b5['verbose']&&(console[_0x39cc5a(0x1b0)](_0x39cc5a(0x358)+_0x23f7b5[_0x39cc5a(0x234)]),console[_0x39cc5a(0x1b0)](_0x39cc5a(0x382)+_0xe58672));let _0xcee19f;try{_0xcee19f=readFileSync(_0xe58672,_0x39cc5a(0x20e));}catch(_0x3bcb66){const _0x15df9f=_0x3bcb66 instanceof Error?_0x3bcb66[_0x39cc5a(0x39b)]:String(_0x3bcb66);return console[_0x39cc5a(0x1b0)](_0x39cc5a(0x2fc)+_0x15df9f),0x1;}const _0x111f16=await withSpinner(_0x39cc5a(0x2f4),()=>_0x43b593[_0x39cc5a(0x392)][_0x39cc5a(0x386)](_0xcee19f),{'verbose':_0x23f7b5[_0x39cc5a(0x2e1)]}),_0x50ccda=_0x111f16['data'],{isNew:_0x218bc4,name:_0x574d64,hasChanges:_0x5003a9,diffFormatted:_0x100e79}=_0x50ccda;if(!_0x5003a9)return console[_0x39cc5a(0x1b0)](_0x39cc5a(0x251)+_0x574d64+_0x39cc5a(0x1f0)),0x0;_0x218bc4?console[_0x39cc5a(0x1b0)](_0x39cc5a(0x2b5)+_0x574d64+'\x27:'):console[_0x39cc5a(0x1b0)](_0x39cc5a(0x1bd)+_0x574d64+'\x27:');console[_0x39cc5a(0x1b0)]('─'[_0x39cc5a(0x38b)](0x3c)),console[_0x39cc5a(0x1b0)](_0x100e79),console[_0x39cc5a(0x1b0)]('─'['repeat'](0x3c));const _0x256fea=_0x218bc4?_0x39cc5a(0x34b)+_0x574d64+'\x27?':_0x39cc5a(0x339)+_0x574d64+'\x27?';if(!_0x23f7b5['yes']){if(!isInteractive())return console[_0x39cc5a(0x1b0)](a31_0x22e59c[_0x39cc5a(0x38e)](_0x39cc5a(0x32e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a31_0x22e59c[_0x39cc5a(0x297)](_0x39cc5a(0x378))),0x1;const _0x3f76f5=await confirmKey(_0x256fea);if(!_0x3f76f5)return console['error'](a31_0x22e59c['yellow'](_0x39cc5a(0x2eb))),0x1;}const _0x489d18=_0x218bc4?'Creating':'Updating',_0x339b37=await withSpinner(_0x489d18+_0x39cc5a(0x21c)+_0x574d64+_0x39cc5a(0x1e2),()=>_0x50ccda[_0x39cc5a(0x3b5)](),{'verbose':_0x23f7b5['verbose']}),_0x4527ea=_0x339b37['data'],_0x1b57a6=getConsoleNextUrl(_0x23f7b5[_0x39cc5a(0x234)],_0x39cc5a(0x1df)+_0x4527ea['id']),_0x5935f5=_0x218bc4?'Created':_0x39cc5a(0x2e9);return console['error']('✔\x20'+_0x5935f5+_0x39cc5a(0x21c)+_0x4527ea['name']+'\x27'),console['error']('\x20\x20'+_0x1b57a6),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0x23ba89(0x227);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2ca);async['execute'](_0x9a4c74){const _0x2acef2=a31_0x23ba89,{options:_0x18eac8,args:_0x227b3c,tdx:_0x274682}=_0x9a4c74,_0x106472=_0x18eac8,_0x57054a=_0x227b3c[0x0]||_0x18eac8[_0x2acef2(0x2a6)];if(!_0x57054a)return showParentSegmentNotSetError(_0x2acef2(0x38d)+_0x2acef2(0x212)+_0x2acef2(0x38a)+_0x2acef2(0x295)+_0x2acef2(0x2b8)+_0x2acef2(0x322)),0x1;const _0x3c7519=resolveYamlFile(_0x57054a);if(!existsSync(_0x3c7519))return showFileNotFoundError(_0x3c7519,_0x57054a),0x1;_0x106472[_0x2acef2(0x2e1)]&&(console[_0x2acef2(0x1b0)](_0x2acef2(0x358)+_0x106472['site']),console['error'](_0x2acef2(0x382)+_0x3c7519));let _0x3666cd;try{_0x3666cd=readFileSync(_0x3c7519,_0x2acef2(0x20e));}catch(_0x1f6efe){const _0x3bdced=_0x1f6efe instanceof Error?_0x1f6efe[_0x2acef2(0x39b)]:String(_0x1f6efe);return console['error'](_0x2acef2(0x2fc)+_0x3bdced),0x1;}const _0x1861cc=createCommandSpinner(a31_0x22e59c[_0x2acef2(0x297)](_0x2acef2(0x1c0)),{'verbose':_0x106472[_0x2acef2(0x2e1)]});_0x1861cc[_0x2acef2(0x388)]();const _0x25d27f={'onProgress':_0x4f1d69=>{_0x1861cc['text']=formatProgressMessage(_0x4f1d69);}};if(_0x106472['master'])_0x25d27f[_0x2acef2(0x23f)]=!![];if(_0x106472[_0x2acef2(0x376)])_0x25d27f[_0x2acef2(0x376)]=!![];_0x106472[_0x2acef2(0x385)]&&(_0x25d27f[_0x2acef2(0x385)]=_0x106472[_0x2acef2(0x385)]);_0x106472[_0x2acef2(0x359)]&&(_0x25d27f[_0x2acef2(0x359)]=_0x106472[_0x2acef2(0x359)]);if(_0x106472[_0x2acef2(0x244)])_0x25d27f[_0x2acef2(0x244)]=_0x106472[_0x2acef2(0x244)];let _0x514d80;try{_0x514d80=await _0x274682[_0x2acef2(0x392)][_0x2acef2(0x205)](_0x3666cd,_0x25d27f),_0x1861cc[_0x2acef2(0x1db)]();}catch(_0x3003ba){_0x1861cc['stop']();throw _0x3003ba;}const _0x420c96=_0x106472[_0x2acef2(0x244)]||_0x2acef2(0x22a);return this[_0x2acef2(0x2c5)](_0x514d80,_0x25d27f,_0x3c7519,_0x420c96),_0x514d80[_0x2acef2(0x247)]?0x0:0x1;}[a31_0x23ba89(0x2c5)](_0xe0fd40,_0x2711b8,_0x3be933,_0x99a304){const _0x68531a=a31_0x23ba89;console[_0x68531a(0x1b0)]('\x0a'+a31_0x22e59c['bold'](_0x68531a(0x274))+'\x20'+_0xe0fd40[_0x68531a(0x356)]),console['error']('═'[_0x68531a(0x38b)](0x3c)),this[_0x68531a(0x340)](_0xe0fd40);if(typeof _0x2711b8[_0x68531a(0x385)]===_0x68531a(0x37e)){this[_0x68531a(0x2d0)](_0xe0fd40),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x385),_0x2711b8[_0x68531a(0x385)]);return;}if(_0x2711b8[_0x68531a(0x385)]===!![]){this[_0x68531a(0x2d0)](_0xe0fd40),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x336));return;}if(typeof _0x2711b8['behavior']===_0x68531a(0x37e)){this['displayBehaviorsStats'](_0xe0fd40,_0x99a304),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,'behavior',_0x2711b8['behavior']);return;}if(_0x2711b8[_0x68531a(0x359)]===!![]){this[_0x68531a(0x2b3)](_0xe0fd40,_0x99a304),this[_0x68531a(0x304)](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x327));return;}this[_0x68531a(0x2d0)](_0xe0fd40),this[_0x68531a(0x2b3)](_0xe0fd40,_0x99a304),this['displayRealtimeInfo'](_0xe0fd40),this['displaySummary'](_0xe0fd40),this[_0x68531a(0x2bf)](_0x3be933,_0x99a304,_0x68531a(0x1b2));}[a31_0x23ba89(0x2b0)](_0x4a273d){displayRealtimeValidation(_0x4a273d);}[a31_0x23ba89(0x2bf)](_0x163b3d,_0x2c148c,_0x261246,_0x2e5075){const _0x56d592=a31_0x23ba89;console[_0x56d592(0x1b0)]('\x0a'+a31_0x22e59c[_0x56d592(0x297)](_0x56d592(0x367)));const _0x36b6a4=_0x2c148c!==_0x56d592(0x22a)?_0x56d592(0x2bb)+_0x2c148c:'';if(_0x261246===_0x56d592(0x385)&&_0x2e5075)console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0x56d592(0x2b9)+_0x163b3d+_0x56d592(0x27a)+_0x2e5075+'\x22'+_0x36b6a4));else{if(_0x261246==='behavior'&&_0x2e5075)console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0x56d592(0x2b9)+_0x163b3d+'\x20--behavior\x20\x22'+_0x2e5075+'\x22'+_0x36b6a4));else(_0x261246===_0x56d592(0x336)||_0x261246==='all')&&console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x56d592(0x297)](_0x56d592(0x2b9)+_0x163b3d+_0x56d592(0x313)+_0x36b6a4));}(_0x261246===_0x56d592(0x327)||_0x261246===_0x56d592(0x1b2))&&console[_0x56d592(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x56d592(0x297)]('tdx\x20ps\x20preview\x20'+_0x163b3d+_0x56d592(0x2a1)+_0x36b6a4)),_0x261246===_0x56d592(0x1b2)&&console['error']('\x20\x20'+a31_0x22e59c[_0x56d592(0x297)](_0x56d592(0x2b9)+_0x163b3d+_0x56d592(0x310)+_0x36b6a4));}['displayMasterInfo'](_0x10d4a8){const _0x261890=a31_0x23ba89,{master:_0x47ef60}=_0x10d4a8,_0x4d0f74=_0x47ef60[_0x261890(0x3ae)]?a31_0x22e59c[_0x261890(0x1a5)]('✔'):a31_0x22e59c[_0x261890(0x38e)]('✘');console['error']('\x0a'+a31_0x22e59c[_0x261890(0x297)](_0x261890(0x263))),console[_0x261890(0x1b0)](_0x4d0f74+'\x20'+a31_0x22e59c[_0x261890(0x214)](_0x47ef60[_0x261890(0x2be)]+'.'+_0x47ef60[_0x261890(0x2a9)])),_0x47ef60[_0x261890(0x3ae)]?_0x47ef60[_0x261890(0x2ec)]!==undefined&&console[_0x261890(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x261890(0x297)](_0x261890(0x335))+'\x20'+a31_0x22e59c[_0x261890(0x26c)](formatRows(_0x47ef60[_0x261890(0x2ec)]))):console[_0x261890(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x261890(0x38e)](_0x261890(0x21f))+'\x20'+_0x47ef60[_0x261890(0x351)]);}[a31_0x23ba89(0x2d0)](_0x50cfbb){const _0x189c48=a31_0x23ba89;if(_0x50cfbb[_0x189c48(0x336)][_0x189c48(0x2c8)]===0x0)return;console[_0x189c48(0x1b0)]('\x0a'+a31_0x22e59c[_0x189c48(0x297)]('Attributes'));for(const _0x5303d9 of _0x50cfbb[_0x189c48(0x336)]){const _0x482582=_0x5303d9['schemaValid']?a31_0x22e59c[_0x189c48(0x1a5)]('✔'):a31_0x22e59c[_0x189c48(0x38e)]('✘');let _0x431d4f='';if(_0x5303d9[_0x189c48(0x3ae)]&&_0x5303d9[_0x189c48(0x211)]!==undefined&&_0x5303d9[_0x189c48(0x26a)]!==undefined){const _0x3f014e=_0x5303d9[_0x189c48(0x26a)][_0x189c48(0x216)](0x1),_0x432e1e=_0x5303d9[_0x189c48(0x26a)]>=0x50?a31_0x22e59c['green']:_0x5303d9['coveragePercent']>=0x32?a31_0x22e59c['yellow']:a31_0x22e59c[_0x189c48(0x38e)];_0x431d4f='\x20'+a31_0x22e59c[_0x189c48(0x297)]('Coverage:')+'\x20'+_0x432e1e(_0x3f014e+'%')+'\x20('+formatRows(_0x5303d9['matchedCount'])+_0x189c48(0x280);}console[_0x189c48(0x1b0)](_0x482582+'\x20'+a31_0x22e59c[_0x189c48(0x214)](_0x5303d9[_0x189c48(0x356)])+_0x431d4f),console['error']('\x20\x20'+a31_0x22e59c[_0x189c48(0x297)]('Source:')+'\x20'+a31_0x22e59c[_0x189c48(0x214)](_0x5303d9[_0x189c48(0x2be)]+'.'+_0x5303d9[_0x189c48(0x2a9)]));const _0xcd6c72=_0x5303d9[_0x189c48(0x1fb)]===_0x5303d9[_0x189c48(0x328)]?a31_0x22e59c['dim'](_0x189c48(0x248))+'\x20'+_0x5303d9['joinKey']:a31_0x22e59c[_0x189c48(0x297)](_0x189c48(0x2e3))+'\x20'+_0x5303d9[_0x189c48(0x1fb)]+'\x20=\x20'+_0x5303d9[_0x189c48(0x328)];console['error']('\x20\x20'+_0xcd6c72),console['error']('\x20\x20'+a31_0x22e59c['dim'](_0x189c48(0x348))),this[_0x189c48(0x226)](_0x5303d9['columns']),!_0x5303d9['schemaValid']&&console['error']('\x20\x20'+a31_0x22e59c[_0x189c48(0x38e)](_0x189c48(0x21f))+'\x20'+_0x5303d9['schemaError']);}}[a31_0x23ba89(0x2b3)](_0x123f0a,_0x30ae64){const _0xcc1c07=a31_0x23ba89;if(_0x123f0a[_0xcc1c07(0x327)][_0xcc1c07(0x2c8)]===0x0)return;console[_0xcc1c07(0x1b0)]('\x0a'+a31_0x22e59c['dim']('Behaviors')+'\x20'+a31_0x22e59c[_0xcc1c07(0x297)]('('+_0x30ae64+')'));for(const _0x1c5da0 of _0x123f0a[_0xcc1c07(0x327)]){const _0x767daa=_0x1c5da0[_0xcc1c07(0x3ae)]?a31_0x22e59c['green']('✔'):a31_0x22e59c[_0xcc1c07(0x38e)]('✘');let _0x542674='';if(_0x1c5da0[_0xcc1c07(0x3ae)]&&_0x1c5da0[_0xcc1c07(0x1e0)]!==undefined&&_0x1c5da0[_0xcc1c07(0x249)]!==undefined){const _0x352073=_0x1c5da0[_0xcc1c07(0x38f)]?.[_0xcc1c07(0x216)](0x1)||'?',_0x48c840=(_0x1c5da0[_0xcc1c07(0x38f)]??0x0)>=0x32?a31_0x22e59c[_0xcc1c07(0x1a5)]:(_0x1c5da0['customerPercent']??0x0)>=0x14?a31_0x22e59c[_0xcc1c07(0x1e8)]:a31_0x22e59c[_0xcc1c07(0x38e)];_0x542674='\x20'+a31_0x22e59c[_0xcc1c07(0x297)]('Customers:')+'\x20'+_0x48c840(formatRows(_0x1c5da0['customersWithEvents']))+'\x20('+_0x352073+'%)\x20'+a31_0x22e59c['dim']('Events:')+'\x20'+a31_0x22e59c[_0xcc1c07(0x26c)](formatRows(_0x1c5da0[_0xcc1c07(0x249)]));}console[_0xcc1c07(0x1b0)](_0x767daa+'\x20'+a31_0x22e59c['bold'](_0x1c5da0['name'])+_0x542674),console[_0xcc1c07(0x1b0)]('\x20\x20'+a31_0x22e59c[_0xcc1c07(0x297)](_0xcc1c07(0x283))+'\x20'+a31_0x22e59c['bold'](_0x1c5da0[_0xcc1c07(0x2be)]+'.'+_0x1c5da0[_0xcc1c07(0x2a9)]));const _0x76889b=_0x1c5da0[_0xcc1c07(0x1fb)]===_0x1c5da0[_0xcc1c07(0x328)]?a31_0x22e59c[_0xcc1c07(0x297)](_0xcc1c07(0x248))+'\x20'+_0x1c5da0[_0xcc1c07(0x1fb)]:a31_0x22e59c[_0xcc1c07(0x297)](_0xcc1c07(0x2e3))+'\x20'+_0x1c5da0[_0xcc1c07(0x1fb)]+_0xcc1c07(0x2de)+_0x1c5da0[_0xcc1c07(0x328)];console['error']('\x20\x20'+_0x76889b),console[_0xcc1c07(0x1b0)]('\x20\x20'+a31_0x22e59c['dim'](_0xcc1c07(0x348))),this[_0xcc1c07(0x226)](_0x1c5da0[_0xcc1c07(0x305)]),!_0x1c5da0[_0xcc1c07(0x3ae)]&&console['error']('\x20\x20'+a31_0x22e59c[_0xcc1c07(0x38e)]('Error:')+'\x20'+_0x1c5da0[_0xcc1c07(0x351)]);}}[a31_0x23ba89(0x226)](_0xa4480a){const _0x3f1169=a31_0x23ba89;for(const _0x42a284 of _0xa4480a){_0x42a284[_0x3f1169(0x3a5)]===_0x42a284[_0x3f1169(0x1da)]||_0x42a284[_0x3f1169(0x1da)]==='*'?console[_0x3f1169(0x1b0)](_0x3f1169(0x220)+_0x42a284[_0x3f1169(0x3a5)]):console[_0x3f1169(0x1b0)]('\x20\x20\x20\x20-\x20'+_0x42a284[_0x3f1169(0x3a5)]+'\x20'+a31_0x22e59c['dim']('('+_0x42a284[_0x3f1169(0x1da)]+')'));}}[a31_0x23ba89(0x304)](_0x2a14a7){const _0x2d74c3=a31_0x23ba89;console[_0x2d74c3(0x1b0)]('─'[_0x2d74c3(0x38b)](0x3c));if(_0x2a14a7[_0x2d74c3(0x329)][_0x2d74c3(0x2c8)]>0x0){console[_0x2d74c3(0x1b0)]('\x0a'+a31_0x22e59c[_0x2d74c3(0x38e)](_0x2d74c3(0x1ce)));for(const _0x3465f2 of _0x2a14a7['errors']){console[_0x2d74c3(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x2d74c3(0x38e)]('•')+'\x20'+_0x3465f2);}}_0x2a14a7['allValid']&&console[_0x2d74c3(0x1b0)]('\x0a'+a31_0x22e59c[_0x2d74c3(0x1a5)]('✔')+_0x2d74c3(0x36a));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1ee);['description']=a31_0x23ba89(0x2ea);async[a31_0x23ba89(0x2fe)](_0x1abb0e){const _0x750d92=a31_0x23ba89,{options:_0x470d76,args:_0xe33ab6,tdx:_0x50d9be}=_0x1abb0e,_0x4e83df=_0x470d76,_0x45ec09=_0xe33ab6[0x0]||_0x470d76[_0x750d92(0x2a6)];if(!_0x45ec09)return showParentSegmentNotSetError(_0x750d92(0x27d)+_0x750d92(0x32f)+_0x750d92(0x342)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x750d92(0x36f)+_0x750d92(0x2f3)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x750d92(0x322)),0x1;if(!_0x4e83df[_0x750d92(0x23f)]&&!_0x4e83df[_0x750d92(0x385)]&&!_0x4e83df[_0x750d92(0x359)]&&!_0x4e83df[_0x750d92(0x376)])return console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x750d92(0x1b0)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x750d92(0x1b0)](_0x750d92(0x2d8)),console['error'](_0x750d92(0x296)),console[_0x750d92(0x1b0)](_0x750d92(0x20f)),console[_0x750d92(0x1b0)](_0x750d92(0x352)),console[_0x750d92(0x1b0)](_0x750d92(0x1ff)),0x1;const _0x31c81d=resolveYamlFile(_0x45ec09);if(!existsSync(_0x31c81d))return showFileNotFoundError(_0x31c81d,_0x45ec09),0x1;_0x4e83df[_0x750d92(0x2e1)]&&(console[_0x750d92(0x1b0)](_0x750d92(0x358)+_0x4e83df[_0x750d92(0x234)]),console['error'](_0x750d92(0x382)+_0x31c81d));let _0xabf0a7;try{_0xabf0a7=readFileSync(_0x31c81d,_0x750d92(0x20e));}catch(_0x4dbf23){const _0x51e17f=_0x4dbf23 instanceof Error?_0x4dbf23[_0x750d92(0x39b)]:String(_0x4dbf23);return console[_0x750d92(0x1b0)](_0x750d92(0x2fc)+_0x51e17f),0x1;}let _0x19bc7b;try{_0x19bc7b=parseDef(_0xabf0a7);}catch(_0x452ae2){const _0xb35299=_0x452ae2 instanceof Error?_0x452ae2['message']:String(_0x452ae2);return console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)]('Error\x20parsing\x20YAML:\x20'+_0xb35299)),0x1;}if(_0x4e83df[_0x750d92(0x385)]===!![]||_0x4e83df[_0x750d92(0x385)]===''){const _0x32906c=_0x19bc7b['attributes']?.[_0x750d92(0x30a)](_0x1b7203=>_0x1b7203[_0x750d92(0x356)])||[];if(_0x32906c[_0x750d92(0x2c8)]===0x0)console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)](_0x750d92(0x2d6)));else{console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)](_0x750d92(0x256))),console[_0x750d92(0x1b0)](_0x750d92(0x1cd));for(const _0x2fae6d of _0x32906c){console['error']('\x20\x20'+a31_0x22e59c[_0x750d92(0x26c)](_0x2fae6d));}console[_0x750d92(0x1b0)](_0x750d92(0x2c1)+_0x45ec09+_0x750d92(0x27a)+_0x32906c[0x0]+'\x22');}return 0x1;}if(_0x4e83df[_0x750d92(0x359)]===!![]||_0x4e83df['behavior']===''){const _0x4a2bd2=_0x19bc7b[_0x750d92(0x327)]?.['map'](_0x38d275=>_0x38d275[_0x750d92(0x356)])||[];if(_0x4a2bd2[_0x750d92(0x2c8)]===0x0)console['error'](a31_0x22e59c[_0x750d92(0x38e)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x750d92(0x1b0)](a31_0x22e59c[_0x750d92(0x38e)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x750d92(0x1ed));for(const _0x54963e of _0x4a2bd2){console['error']('\x20\x20'+a31_0x22e59c[_0x750d92(0x26c)](_0x54963e));}console[_0x750d92(0x1b0)](_0x750d92(0x2c1)+_0x45ec09+_0x750d92(0x298)+_0x4a2bd2[0x0]+'\x22');}return 0x1;}const _0x2cbef2=createCommandSpinner(a31_0x22e59c[_0x750d92(0x297)](_0x750d92(0x1e4)),{'verbose':_0x4e83df[_0x750d92(0x2e1)]});_0x2cbef2[_0x750d92(0x388)]();const _0x3a0f83={'onProgress':_0xc1c9ac=>{const _0x1312cd=_0x750d92;_0x2cbef2[_0x1312cd(0x317)]=formatProgressMessage(_0xc1c9ac);}};if(_0x4e83df['master'])_0x3a0f83['master']=!![];if(_0x4e83df[_0x750d92(0x385)]&&typeof _0x4e83df[_0x750d92(0x385)]===_0x750d92(0x37e))_0x3a0f83[_0x750d92(0x385)]=_0x4e83df['attribute'];if(_0x4e83df['behavior']&&typeof _0x4e83df[_0x750d92(0x359)]===_0x750d92(0x37e))_0x3a0f83[_0x750d92(0x359)]=_0x4e83df[_0x750d92(0x359)];if(_0x4e83df[_0x750d92(0x376)])_0x3a0f83[_0x750d92(0x376)]=!![];if(_0x4e83df[_0x750d92(0x244)])_0x3a0f83[_0x750d92(0x244)]=_0x4e83df[_0x750d92(0x244)];let _0x5ef191;try{_0x5ef191=await _0x50d9be['segment'][_0x750d92(0x30d)](_0xabf0a7,_0x3a0f83),_0x2cbef2[_0x750d92(0x1db)]();}catch(_0x1c1515){_0x2cbef2[_0x750d92(0x1db)]();throw _0x1c1515;}return await this[_0x750d92(0x290)](_0x5ef191,{'master':_0x4e83df[_0x750d92(0x23f)],'attribute':typeof _0x4e83df['attribute']===_0x750d92(0x37e)?_0x4e83df[_0x750d92(0x385)]:undefined,'behavior':typeof _0x4e83df[_0x750d92(0x359)]===_0x750d92(0x37e)?_0x4e83df['behavior']:undefined,'enriched':_0x4e83df['enriched']}),_0x5ef191[_0x750d92(0x247)]?0x0:0x1;}async['displayPreviewResults'](_0x283084,_0x417c4e){const _0x49ed01=a31_0x23ba89;console[_0x49ed01(0x1b0)]('\x0a'+a31_0x22e59c[_0x49ed01(0x214)]('Preview:')+'\x20'+_0x283084['name']),console['error']('═'['repeat'](0x3c));if(_0x417c4e[_0x49ed01(0x23f)]&&_0x283084['sampleData']){const _0x997b2=a31_0x22e59c[_0x49ed01(0x297)](_0x49ed01(0x2ee))+'\x20'+a31_0x22e59c['bold'](_0x283084[_0x49ed01(0x23f)]['database']+'.'+_0x283084[_0x49ed01(0x23f)]['table']);await this[_0x49ed01(0x228)](_0x997b2,_0x283084[_0x49ed01(0x2ba)]);}else{if(_0x417c4e[_0x49ed01(0x385)]&&_0x283084[_0x49ed01(0x2ba)]){const _0x24a20a=a31_0x22e59c[_0x49ed01(0x297)]('Attribute:')+'\x20'+a31_0x22e59c[_0x49ed01(0x214)](_0x417c4e['attribute']);await this['displaySampleData'](_0x24a20a,_0x283084[_0x49ed01(0x2ba)]);}else{if(_0x417c4e['behavior']&&_0x283084['sampleData']){const _0x59a4d3=a31_0x22e59c['dim'](_0x49ed01(0x32b))+'\x20'+a31_0x22e59c[_0x49ed01(0x214)](_0x417c4e[_0x49ed01(0x359)]);await this[_0x49ed01(0x228)](_0x59a4d3,_0x283084[_0x49ed01(0x2ba)]);}else{if(_0x417c4e[_0x49ed01(0x376)]&&_0x283084['sampleData']){const _0x1a0506=a31_0x22e59c['dim'](_0x49ed01(0x2c6))+'\x20'+a31_0x22e59c['bold'](_0x49ed01(0x325));await this[_0x49ed01(0x228)](_0x1a0506,_0x283084[_0x49ed01(0x2ba)]);}else!_0x283084[_0x49ed01(0x2ba)]&&console[_0x49ed01(0x1b0)](_0x49ed01(0x273));}}}if(_0x283084[_0x49ed01(0x329)][_0x49ed01(0x2c8)]>0x0){console['error']('─'[_0x49ed01(0x38b)](0x3c)),console['error']('\x0a'+a31_0x22e59c['red'](_0x49ed01(0x1ce)));for(const _0x2c61b6 of _0x283084[_0x49ed01(0x329)]){console[_0x49ed01(0x1b0)]('\x20\x20'+a31_0x22e59c['red']('•')+'\x20'+_0x2c61b6);}}}async[a31_0x23ba89(0x228)](_0x4910bf,_0x519d78){const _0x49e992=a31_0x23ba89;if(_0x519d78['length']===0x0){console['error']('\x0a'+_0x4910bf),console[_0x49e992(0x1b0)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x49e992(0x1b0)]('\x0a'+_0x4910bf);const _0x2c9d65=Object[_0x49e992(0x36d)](_0x519d78[0x0])[_0x49e992(0x30a)](_0x3c3155=>({'name':_0x3c3155,'type':typeof _0x519d78[0x0][_0x3c3155]==='number'?_0x49e992(0x1f5):_0x49e992(0x2cb)})),_0xc64114={'queryId':'preview','columns':_0x2c9d65,'data':_0x519d78,'stats':{'state':_0x49e992(0x2af),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x519d78[_0x49e992(0x2c8)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x545c7d=formatAsTable(_0xc64114,_0x519d78[_0x49e992(0x2c8)],!![]);await writeOutput(_0x545c7d,undefined,_0x49e992(0x2a9));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1c8);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x1d2);async[a31_0x23ba89(0x2fe)](_0x5d25f3){const _0x45073b=a31_0x23ba89,{options:_0x4e618c,args:_0xe9563c,tdx:_0x421cc1}=_0x5d25f3,_0x6fc20=_0x4e618c,_0x2c0ed4=_0xe9563c[0x0]||_0x4e618c[_0x45073b(0x2a6)];if(!_0x2c0ed4)return showParentSegmentNotSetError(_0x45073b(0x24e)+_0x45073b(0x3af)),0x1;const _0x453946=resolveYamlFile(_0x2c0ed4);if(existsSync(_0x453946)){_0x6fc20[_0x45073b(0x2e1)]&&console['error'](_0x45073b(0x1fe)+_0x453946);let _0x21c1ed;try{_0x21c1ed=readFileSync(_0x453946,_0x45073b(0x20e));}catch(_0x20012f){const _0x74296c=_0x20012f instanceof Error?_0x20012f[_0x45073b(0x39b)]:String(_0x20012f);return console[_0x45073b(0x1b0)](_0x45073b(0x2fc)+_0x74296c),0x1;}const _0x5ccad4=await withSpinner(_0x45073b(0x2f4),()=>_0x421cc1[_0x45073b(0x392)][_0x45073b(0x386)](_0x21c1ed),{'verbose':_0x6fc20['verbose']}),_0x36ef1f=_0x5ccad4[_0x45073b(0x2d4)],{isNew:_0x1e3dbc,name:_0x335ea7,hasChanges:_0x24836a,diffFormatted:_0x254859}=_0x36ef1f;if(_0x24836a){_0x1e3dbc?console['error'](_0x45073b(0x2b5)+_0x335ea7+'\x27:'):console[_0x45073b(0x1b0)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x335ea7+'\x27:');console[_0x45073b(0x1b0)]('─'[_0x45073b(0x38b)](0x3c)),console[_0x45073b(0x1b0)](_0x254859),console[_0x45073b(0x1b0)]('─'[_0x45073b(0x38b)](0x3c));const _0x151431=_0x1e3dbc?_0x45073b(0x34b)+_0x335ea7+_0x45073b(0x316):_0x45073b(0x339)+_0x335ea7+_0x45073b(0x316);if(!_0x6fc20[_0x45073b(0x210)]){if(!isInteractive())return console[_0x45073b(0x1b0)](a31_0x22e59c[_0x45073b(0x38e)](_0x45073b(0x32e)),_0x45073b(0x272)),console[_0x45073b(0x1b0)](a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x378))),0x1;const _0x3e3f0d=await confirmKey(_0x151431);if(!_0x3e3f0d)return console[_0x45073b(0x1b0)](a31_0x22e59c[_0x45073b(0x1e8)]('Aborted.')),0x1;}const _0x5cb552=_0x1e3dbc?_0x45073b(0x1a8):_0x45073b(0x2f5);await withSpinner(_0x5cb552+_0x45073b(0x21c)+_0x335ea7+'\x27...',()=>_0x36ef1f[_0x45073b(0x3b5)](),{'verbose':_0x6fc20['verbose']});const _0x57560c=_0x1e3dbc?_0x45073b(0x363):_0x45073b(0x2e9);console[_0x45073b(0x1b0)]('✔\x20'+_0x57560c+_0x45073b(0x21c)+_0x335ea7+'\x27');}else console[_0x45073b(0x1b0)](_0x45073b(0x251)+_0x335ea7+'\x27\x20is\x20up\x20to\x20date');}const _0x14f608=await withSpinner(_0x45073b(0x34f)+_0x2c0ed4+_0x45073b(0x1e2),()=>_0x421cc1['segment'][_0x45073b(0x1c4)](_0x2c0ed4),{'verbose':_0x6fc20['verbose']}),_0x101009=_0x14f608[_0x45073b(0x2d4)],_0x5b1341=getConsoleUrl(_0x6fc20['site'],_0x45073b(0x1bf)+_0x101009[_0x45073b(0x1be)]+_0x45073b(0x260)+_0x101009['workflowSessionId']+_0x45073b(0x1e9)+_0x101009[_0x45073b(0x225)]);return console['error']('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x207))+'\x20'+_0x101009['audienceId']),console[_0x45073b(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x1e6))+'\x20'+_0x101009[_0x45073b(0x375)]),console[_0x45073b(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)]('Session:')+'\x20'+_0x101009[_0x45073b(0x2d9)]),console[_0x45073b(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x45073b(0x297)](_0x45073b(0x2f2))+'\x20'+_0x101009[_0x45073b(0x225)]),console['error']('\x20\x20'+_0x5b1341),console[_0x45073b(0x1b0)]('\x0a'+a31_0x22e59c[_0x45073b(0x297)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x101009[_0x45073b(0x225)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1a2);[a31_0x23ba89(0x30f)]='List\x20available\x20fields\x20for\x20segmentation';async[a31_0x23ba89(0x2fe)](_0x30711d){const _0x28cf99=a31_0x23ba89,{options:_0x22cab7,args:_0x2a3d86,tdx:_0x42b5e7}=_0x30711d,_0x42e531=_0x2a3d86[0x0]||_0x22cab7['parentSegment'];if(!_0x42e531)return showParentSegmentNotSetError(_0x28cf99(0x1b5)+_0x28cf99(0x1c3)),0x1;_0x22cab7[_0x28cf99(0x2e1)]&&(console[_0x28cf99(0x1b0)]('Site:\x20'+_0x22cab7[_0x28cf99(0x234)]),console[_0x28cf99(0x1b0)]('Parent\x20segment:\x20'+_0x42e531));const _0x16583e=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x42e531+_0x28cf99(0x1e2),()=>_0x42b5e7[_0x28cf99(0x392)][_0x28cf99(0x1aa)](_0x42e531),{'verbose':_0x22cab7['verbose']}),_0x44dc82=_0x16583e[_0x28cf99(0x2d4)];console['error'](_0x28cf99(0x1cc)+_0x44dc82[_0x28cf99(0x2c8)]+'\x20field'+(_0x44dc82[_0x28cf99(0x2c8)]!==0x1?'s':''));if(_0x22cab7[_0x28cf99(0x380)]||_0x22cab7[_0x28cf99(0x326)])return await handleSDKOutput(_0x44dc82,_0x22cab7),0x0;return displayFieldsHumanReadable(_0x44dc82,_0x42e531),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:view';[a31_0x23ba89(0x30f)]='Show\x20parent\x20segment\x20details';async[a31_0x23ba89(0x2fe)](_0x2dd3cc){const _0x2c31fc=a31_0x23ba89,{options:_0x4a5988,args:_0x478119,tdx:_0x5ad8e7}=_0x2dd3cc,_0xbd843d=_0x4a5988,_0x265c37=_0x478119[0x0]||_0x4a5988[_0x2c31fc(0x2a6)];if(!_0x265c37)return showParentSegmentNotSetError(_0x2c31fc(0x1d0)+_0x2c31fc(0x281)+_0x2c31fc(0x38a)+_0x2c31fc(0x37f)),0x1;_0x4a5988[_0x2c31fc(0x2e1)]&&(console[_0x2c31fc(0x1b0)](_0x2c31fc(0x358)+_0x4a5988[_0x2c31fc(0x234)]),console[_0x2c31fc(0x1b0)](_0x2c31fc(0x1f4)+_0x265c37));const _0x54c25d=await withSpinner(_0x2c31fc(0x31a)+_0x265c37+_0x2c31fc(0x1e2),()=>_0x5ad8e7['segment'][_0x2c31fc(0x1c1)](_0x265c37),{'verbose':_0x4a5988[_0x2c31fc(0x2e1)]}),_0x120042=_0x54c25d[_0x2c31fc(0x2d4)];if(_0xbd843d[_0x2c31fc(0x1b3)]){const _0x1adb22=getConsoleNextUrl(_0xbd843d[_0x2c31fc(0x234)],_0x2c31fc(0x1df)+_0x120042['id']);return console[_0x2c31fc(0x1b0)](a31_0x22e59c[_0x2c31fc(0x1a5)]('✔')+_0x2c31fc(0x2d7)+a31_0x22e59c[_0x2c31fc(0x26c)](_0x1adb22)),openBrowser(_0x1adb22),0x0;}return await handleSingleObjectOutput(_0x120042,_0x4a5988),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:desc';['description']=a31_0x23ba89(0x1fa);async[a31_0x23ba89(0x2fe)](_0x14136a){const _0x3ededa=a31_0x23ba89,{options:_0x3db31a,args:_0x3fc63e,tdx:_0x3709c3}=_0x14136a,_0x1082e3=_0x3db31a,_0xcba8ec=_0x3fc63e[0x0]||_0x3db31a[_0x3ededa(0x2a6)];if(!_0xcba8ec)return showParentSegmentNotSetError(_0x3ededa(0x372)+_0x3ededa(0x3ab)+'Options:\x0a'+_0x3ededa(0x24d)),0x1;_0x3db31a[_0x3ededa(0x2e1)]&&(console[_0x3ededa(0x1b0)]('Site:\x20'+_0x3db31a[_0x3ededa(0x234)]),console[_0x3ededa(0x1b0)](_0x3ededa(0x1f4)+_0xcba8ec));const _0x35c7e2=await withSpinner(_0x3ededa(0x215)+_0xcba8ec+'\x27...',()=>_0x3709c3['segment'][_0x3ededa(0x204)](_0xcba8ec),{'verbose':_0x3db31a[_0x3ededa(0x2e1)]}),_0x443f9c=_0x35c7e2['data'],_0x3e5c04=_0x3709c3[_0x3ededa(0x392)][_0x3ededa(0x315)](_0x443f9c);if(_0x1082e3['output']){const _0x850490=await this[_0x3ededa(0x2a5)](_0x14136a,_0xcba8ec,_0x443f9c,_0x3e5c04),_0x4a9b89=this[_0x3ededa(0x2df)](_0x850490);writeFileSync(_0x1082e3[_0x3ededa(0x1d3)],_0x4a9b89);const _0x35cf16=_0x850490[_0x3ededa(0x242)]['columns'][_0x3ededa(0x2c8)]+_0x850490['behaviors']['reduce']((_0x38a848,_0x5e248f)=>_0x38a848+_0x5e248f[_0x3ededa(0x305)][_0x3ededa(0x2c8)],0x0),_0x271a2a=_0x850490[_0x3ededa(0x327)]['filter'](_0x49ae73=>_0x49ae73['columns'][_0x3ededa(0x2c8)]===0x0)['length'];return console[_0x3ededa(0x341)](_0x3ededa(0x2fa)+_0x1082e3[_0x3ededa(0x1d3)]),console[_0x3ededa(0x341)](_0x3ededa(0x3ac)+_0x3e5c04),console['log']('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x850490['behaviors']['length']+_0x3ededa(0x308)),console['log'](_0x3ededa(0x1cf)+_0x35cf16+_0x3ededa(0x200)),_0x271a2a>0x0&&console['log'](_0x3ededa(0x3a7)+_0x271a2a+_0x3ededa(0x1d6)),0x0;}console['error']('\x0a'+a31_0x22e59c[_0x3ededa(0x214)]('Output\x20Database:')+'\x20'+a31_0x22e59c[_0x3ededa(0x26c)](_0x3e5c04));const _0x4b086c=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x3709c3[_0x3ededa(0x392)][_0x3ededa(0x2db)](_0x443f9c),{'verbose':_0x3db31a[_0x3ededa(0x2e1)]});console[_0x3ededa(0x1b0)]('\x0a'+a31_0x22e59c[_0x3ededa(0x214)]('customers')+'\x20'+a31_0x22e59c[_0x3ededa(0x297)]('('+_0x3e5c04+_0x3ededa(0x284)));const _0xf6acce=await executeSchemaQuery(_0x4b086c[_0x3ededa(0x2d4)],_0x3709c3,_0x3db31a);await handleQueryOutput(_0xf6acce,_0x3db31a);const _0x658449=await withSpinner(_0x3ededa(0x2bd),()=>_0x3709c3['segment'][_0x3ededa(0x222)](_0x443f9c),{'verbose':_0x3db31a[_0x3ededa(0x2e1)]});for(const _0x49e2c0 of _0x658449[_0x3ededa(0x2d4)]){const _0x3affdc=_0x3ededa(0x219)+_0x49e2c0[_0x3ededa(0x1a9)]()['replace'](/\s+/g,'_'),_0x4bac12=_0x3ededa(0x1d7)+_0x3e5c04+'.'+_0x3affdc;console[_0x3ededa(0x1b0)]('\x0a'+a31_0x22e59c[_0x3ededa(0x214)](_0x49e2c0)+'\x20'+a31_0x22e59c[_0x3ededa(0x297)]('('+_0x3e5c04+'.'+_0x3affdc+')'));try{const _0x2a748a=await executeSchemaQuery(_0x4bac12,_0x3709c3,_0x3db31a);await handleQueryOutput(_0x2a748a,_0x3db31a);}catch{console[_0x3ededa(0x1b0)](a31_0x22e59c[_0x3ededa(0x1e8)](_0x3ededa(0x1ef)));}}return 0x0;}async[a31_0x23ba89(0x2a5)](_0x412990,_0x2aae4f,_0x2af3cb,_0x3a419b){const _0x6f238a=a31_0x23ba89,{options:_0x1be676,tdx:_0x19731c}=_0x412990,_0x4b95ef=await withSpinner(_0x6f238a(0x2d1),()=>_0x19731c[_0x6f238a(0x392)][_0x6f238a(0x2db)](_0x2af3cb),{'verbose':_0x1be676[_0x6f238a(0x2e1)]}),_0x357827=await executeSchemaQuery(_0x4b95ef['data'],_0x19731c,_0x1be676),_0x50cac4=_0x357827[_0x6f238a(0x2d4)][_0x6f238a(0x30a)](_0x192c89=>({'name':_0x192c89[_0x6f238a(0x233)],'type':_0x192c89[_0x6f238a(0x20a)]})),_0x584924=await withSpinner(_0x6f238a(0x2bd),()=>_0x19731c['segment'][_0x6f238a(0x222)](_0x2af3cb),{'verbose':_0x1be676[_0x6f238a(0x2e1)]}),_0x2c0f96=[];for(const _0x38b27c of _0x584924[_0x6f238a(0x2d4)]){const _0x197ed8=_0x6f238a(0x219)+_0x38b27c[_0x6f238a(0x1a9)]()['replace'](/\s+/g,'_'),_0x32db1f=_0x6f238a(0x1d7)+_0x3a419b+'.'+_0x197ed8;let _0x47cab5=[];try{const _0x27d95e=await executeSchemaQuery(_0x32db1f,_0x19731c,_0x1be676);_0x47cab5=_0x27d95e['data'][_0x6f238a(0x30a)](_0x579f89=>({'name':_0x579f89[_0x6f238a(0x233)],'type':_0x579f89['column_type']}));}catch{}_0x2c0f96[_0x6f238a(0x1bc)]({'table':_0x197ed8,'columns':_0x47cab5});}return{'database':_0x3a419b,'parent_segment':_0x2aae4f,'parent_id':_0x2af3cb,'customers':{'table':_0x6f238a(0x242),'columns':_0x50cac4},'behaviors':_0x2c0f96};}[a31_0x23ba89(0x2df)](_0x11b762){const _0x285f4c=a31_0x23ba89,_0xcf1f1d=_0x3f0d1f=>{const _0x3b2dd6=a31_0x1186;if(_0x3f0d1f[_0x3b2dd6(0x2c8)]===0x0)return'[]';const _0x232ea2=_0x3f0d1f[_0x3b2dd6(0x30a)](_0x1cc6e2=>_0x3b2dd6(0x373)+_0x1cc6e2[_0x3b2dd6(0x356)]+_0x3b2dd6(0x1a7)+_0x1cc6e2[_0x3b2dd6(0x2d2)]+_0x3b2dd6(0x395));return'[\x0a'+_0x232ea2[_0x3b2dd6(0x301)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0xf26e24=_0x11b762[_0x285f4c(0x327)][_0x285f4c(0x30a)](_0x3c3ee7=>{const _0x906597=_0x285f4c;return _0x906597(0x35e)+_0x3c3ee7[_0x906597(0x2a9)]+_0x906597(0x1c7)+_0xcf1f1d(_0x3c3ee7[_0x906597(0x305)])[_0x906597(0x35a)](/^/gm,'\x20\x20')[_0x906597(0x292)]()+_0x906597(0x279);})['join'](',\x0a');return _0x285f4c(0x268)+_0x11b762['database']+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x11b762[_0x285f4c(0x28e)]+_0x285f4c(0x334)+_0x11b762[_0x285f4c(0x278)]+_0x285f4c(0x2c7)+_0x11b762['customers'][_0x285f4c(0x2a9)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0xcf1f1d(_0x11b762[_0x285f4c(0x242)][_0x285f4c(0x305)])[_0x285f4c(0x35a)](/^/gm,'\x20\x20')[_0x285f4c(0x292)]()+_0x285f4c(0x39d)+_0xf26e24+_0x285f4c(0x231);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:sql';['description']=a31_0x23ba89(0x354);async[a31_0x23ba89(0x2fe)](_0x32980b){const _0x2061d0=a31_0x23ba89,{options:_0x39a2b8,args:_0x42ddbb,tdx:_0x586cd0}=_0x32980b,_0x3aa8c9=_0x42ddbb[0x0]||_0x39a2b8[_0x2061d0(0x2a6)];if(!_0x3aa8c9)return showParentSegmentNotSetError(_0x2061d0(0x28b)+_0x2061d0(0x1bb)),0x1;_0x39a2b8[_0x2061d0(0x2e1)]&&(console['error'](_0x2061d0(0x358)+_0x39a2b8[_0x2061d0(0x234)]),console['error'](_0x2061d0(0x1f4)+_0x3aa8c9));const _0x3aa6c4=await withSpinner(_0x2061d0(0x215)+_0x3aa8c9+_0x2061d0(0x1e2),()=>_0x586cd0['segment'][_0x2061d0(0x204)](_0x3aa8c9),{'verbose':_0x39a2b8[_0x2061d0(0x2e1)]}),_0x50ea93=_0x3aa6c4[_0x2061d0(0x2d4)],_0x1a7a41=await withSpinner(_0x2061d0(0x37b)+_0x3aa8c9+_0x2061d0(0x1e2),()=>_0x586cd0[_0x2061d0(0x392)][_0x2061d0(0x2db)](_0x50ea93),{'verbose':_0x39a2b8[_0x2061d0(0x2e1)]}),_0x43b7a5=_0x1a7a41[_0x2061d0(0x2d4)];return _0x39a2b8[_0x2061d0(0x362)]===_0x2061d0(0x380)||_0x39a2b8[_0x2061d0(0x362)]===_0x2061d0(0x326)?await handleSDKOutput([{'sql':_0x43b7a5}],_0x39a2b8):console[_0x2061d0(0x341)](_0x43b7a5),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x23ba89(0x356)]='segment:parent:show';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x397);async[a31_0x23ba89(0x2fe)](_0x47e87b){const _0x56a6df=a31_0x23ba89,{options:_0x3b1368,args:_0x1a348d,tdx:_0x4ceae1}=_0x47e87b,_0x3eb190=_0x1a348d[0x0]||_0x3b1368[_0x56a6df(0x2a6)];if(!_0x3eb190)return showParentSegmentNotSetError(_0x56a6df(0x37a)+_0x56a6df(0x20d)),0x1;_0x3b1368[_0x56a6df(0x2e1)]&&(console[_0x56a6df(0x1b0)](_0x56a6df(0x358)+_0x3b1368['site']),console[_0x56a6df(0x1b0)](_0x56a6df(0x1f4)+_0x3eb190));const _0x1fdb2b=await withSpinner(_0x56a6df(0x215)+_0x3eb190+_0x56a6df(0x1e2),()=>_0x4ceae1[_0x56a6df(0x392)][_0x56a6df(0x204)](_0x3eb190),{'verbose':_0x3b1368[_0x56a6df(0x2e1)]}),_0x313dfa=_0x1fdb2b['data'],_0xe47c31=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x3eb190+_0x56a6df(0x1e2),()=>_0x4ceae1['segment'][_0x56a6df(0x2db)](_0x313dfa),{'verbose':_0x3b1368[_0x56a6df(0x2e1)]});let _0x1667e7=_0xe47c31[_0x56a6df(0x2d4)];const _0x35b366=resolveLimit(_0x3b1368[_0x56a6df(0x22f)],DEFAULT_DISPLAY_LIMIT),_0x7d7c05=/\bLIMIT\s+\d+/i[_0x56a6df(0x35c)](_0x1667e7);!_0x7d7c05&&(_0x1667e7=_0x1667e7['trim']()['replace'](/;+$/,''),_0x1667e7='SELECT\x20*\x20FROM\x20(\x0a'+_0x1667e7+_0x56a6df(0x269)+_0x35b366);_0x3b1368[_0x56a6df(0x2e1)]&&console[_0x56a6df(0x1b0)](_0x56a6df(0x2e4)+_0x1667e7);const _0x8844f8=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x42b34a=>{const _0x54f240=_0x56a6df,_0x3970b9=await _0x4ceae1['query'][_0x54f240(0x2fe)](_0x1667e7,{'catalog':'td','schema':_0x54f240(0x1b6),'onJobId':_0xc41a30=>{const _0x314361=_0x54f240;_0x42b34a[_0x314361(0x2ab)](_0xc41a30);}});return _0x3970b9;},{'verbose':_0x3b1368[_0x56a6df(0x2e1)]}),_0x524af4=_0x8844f8['data'],_0x48ad96=_0x524af4[_0x56a6df(0x38c)]?_0x56a6df(0x265)+_0x524af4[_0x56a6df(0x38c)]+']':'';return console[_0x56a6df(0x1b0)](_0x56a6df(0x2f7)+_0x524af4[_0x56a6df(0x267)][_0x56a6df(0x2cd)]['toLocaleString']()+_0x56a6df(0x1e7)+(_0x56a6df(0x294)+formatElapsed(_0x524af4[_0x56a6df(0x267)]['elapsedTimeMillis'])+_0x48ad96)),await handleQueryOutput(_0x524af4,_0x3b1368),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x345);[a31_0x23ba89(0x30f)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0x23ba89(0x2fe)](_0x4b51b6){const _0x591fa7=a31_0x23ba89,{options:_0x451240,args:_0x11bbe5,tdx:_0x2d7e6c}=_0x4b51b6,_0x4c23a9=_0x11bbe5[0x0],_0x51c27a=await withSpinner(_0x4c23a9?_0x591fa7(0x1dc)+_0x4c23a9+_0x591fa7(0x1e2):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x2d7e6c['realtime']['list'](),{'verbose':_0x451240[_0x591fa7(0x2e1)]});let _0x5bacb1=_0x51c27a[_0x591fa7(0x2d4)][_0x591fa7(0x25b)](_0x4fa305=>_0x4fa305['realtime_enabled']);if(_0x4c23a9){const _0x4cc6c8=_0x4c23a9[_0x591fa7(0x35a)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x591fa7(0x35a)](/\?/g,'.'),_0xd2b492=new RegExp('^'+_0x4cc6c8+'$','i');_0x5bacb1=_0x5bacb1[_0x591fa7(0x25b)](_0x9a2651=>_0xd2b492[_0x591fa7(0x35c)](_0x9a2651[_0x591fa7(0x356)]));}_0x5bacb1['sort']((_0x319bb6,_0x22f773)=>_0x319bb6['name'][_0x591fa7(0x25e)](_0x22f773[_0x591fa7(0x356)])),console[_0x591fa7(0x1b0)](_0x591fa7(0x1cc)+_0x5bacb1[_0x591fa7(0x2c8)]+_0x591fa7(0x1af)+(_0x5bacb1[_0x591fa7(0x2c8)]!==0x1?'s':''));const _0xa1a89c=_0x2bd72b=>{const _0x5c0ac3=_0x591fa7;return getConsoleNextUrl(_0x451240[_0x5c0ac3(0x234)],_0x5c0ac3(0x1df)+_0x2bd72b);};if(_0x451240[_0x591fa7(0x362)]===_0x591fa7(0x380)||_0x451240[_0x591fa7(0x362)]===_0x591fa7(0x326)){const _0x5392e2=_0x5bacb1[_0x591fa7(0x30a)](_0x13efcc=>({..._0x13efcc,'url':_0xa1a89c(_0x13efcc['id'])}));await handleSDKOutput(_0x5392e2,_0x451240);}else{if(_0x5bacb1[_0x591fa7(0x2c8)]===0x0)console[_0x591fa7(0x341)](_0x591fa7(0x331));else for(const _0x3f5d5b of _0x5bacb1){const _0x197ecf=_0x3f5d5b[_0x591fa7(0x2e7)]?a31_0x22e59c[_0x591fa7(0x297)]('\x20('+formatRows(_0x3f5d5b['population'])+')'):'',_0x3e75ea=hyperlink(_0x3f5d5b[_0x591fa7(0x356)],_0xa1a89c(_0x3f5d5b['id']));console['log']('⚡\x20'+_0x3e75ea+_0x197ecf);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x314);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x389);async['execute'](_0x57d712){const _0x1aaa9d=a31_0x23ba89,{options:_0x4893a1,args:_0x5eefce,tdx:_0x423178}=_0x57d712,_0x396528=_0x5eefce[0x0]||_0x4893a1[_0x1aaa9d(0x2a6)];if(!_0x396528)return showParentSegmentNotSetError(_0x1aaa9d(0x2ad)+'\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'),0x1;const _0x3bf455=resolveYamlFile(_0x396528);if(!existsSync(_0x3bf455))return showFileNotFoundError(_0x3bf455,_0x396528),0x1;let _0xdcecbf;try{_0xdcecbf=readFileSync(_0x3bf455,'utf-8');}catch(_0x559dcb){const _0x54a1f4=_0x559dcb instanceof Error?_0x559dcb['message']:String(_0x559dcb);return console[_0x1aaa9d(0x1b0)](_0x1aaa9d(0x2fc)+_0x54a1f4),0x1;}const _0x5bc9ca=createCommandSpinner(a31_0x22e59c[_0x1aaa9d(0x297)](_0x1aaa9d(0x202)),{'verbose':_0x4893a1[_0x1aaa9d(0x2e1)]});_0x5bc9ca['start']();const _0x4b5344={'realtime':!![],'onProgress':_0x2fa102=>{const _0x413bd9=_0x1aaa9d;_0x5bc9ca[_0x413bd9(0x317)]=formatProgressMessage(_0x2fa102);}};let _0x1bfa0c;try{_0x1bfa0c=await _0x423178[_0x1aaa9d(0x392)][_0x1aaa9d(0x205)](_0xdcecbf,_0x4b5344),_0x5bc9ca[_0x1aaa9d(0x1db)]();}catch(_0x2a5d20){_0x5bc9ca['stop']();throw _0x2a5d20;}console[_0x1aaa9d(0x1b0)]('\x0a'+a31_0x22e59c[_0x1aaa9d(0x214)]('RT\x202.0\x20Validate:')+'\x20'+_0x1bfa0c[_0x1aaa9d(0x356)]),console[_0x1aaa9d(0x1b0)]('═'[_0x1aaa9d(0x38b)](0x3c)),displayRealtimeValidation(_0x1bfa0c),console[_0x1aaa9d(0x1b0)]('─'[_0x1aaa9d(0x38b)](0x3c));if(_0x1bfa0c[_0x1aaa9d(0x329)][_0x1aaa9d(0x2c8)]>0x0){console[_0x1aaa9d(0x1b0)]('\x0a'+a31_0x22e59c[_0x1aaa9d(0x38e)](_0x1aaa9d(0x1ce)));for(const _0x51280b of _0x1bfa0c['errors']){console[_0x1aaa9d(0x1b0)]('\x20\x20'+a31_0x22e59c[_0x1aaa9d(0x38e)]('•')+'\x20'+_0x51280b);}}return _0x1bfa0c[_0x1aaa9d(0x247)]&&console[_0x1aaa9d(0x1b0)]('\x0a'+a31_0x22e59c[_0x1aaa9d(0x1a5)]('✔')+_0x1aaa9d(0x282)),_0x1bfa0c[_0x1aaa9d(0x247)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x250);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2b6);async['execute'](_0x593a53){const _0x46fcef=a31_0x23ba89,{options:_0x3bbec0,args:_0x359c8f,tdx:_0x179f74}=_0x593a53,_0x3aef7f=_0x359c8f[0x0]||_0x3bbec0['parentSegment'];if(!_0x3aef7f)return showParentSegmentNotSetError(_0x46fcef(0x36e)+_0x46fcef(0x2ce)),0x1;_0x3bbec0[_0x46fcef(0x2e1)]&&(console[_0x46fcef(0x1b0)](_0x46fcef(0x358)+_0x3bbec0['site']),console[_0x46fcef(0x1b0)](_0x46fcef(0x1f4)+_0x3aef7f));const _0x18892b=await withSpinner(_0x46fcef(0x215)+_0x3aef7f+_0x46fcef(0x1e2),()=>_0x179f74['segment'][_0x46fcef(0x204)](_0x3aef7f),{'verbose':_0x3bbec0[_0x46fcef(0x2e1)]}),_0x242cd5=_0x18892b[_0x46fcef(0x2d4)],_0x405f0a=await withSpinner('Listing\x20RT\x20journeys\x20for\x20\x27'+_0x3aef7f+_0x46fcef(0x1e2),()=>_0x179f74['realtime'][_0x46fcef(0x35d)](_0x242cd5),{'verbose':_0x3bbec0['verbose']}),_0x403d37=_0x405f0a[_0x46fcef(0x2d4)];console[_0x46fcef(0x1b0)](_0x46fcef(0x1cc)+_0x403d37[_0x46fcef(0x2c8)]+_0x46fcef(0x288)+(_0x403d37[_0x46fcef(0x2c8)]!==0x1?'s':''));if(_0x3bbec0[_0x46fcef(0x362)]==='json'||_0x3bbec0[_0x46fcef(0x362)]==='jsonl')await handleSDKOutput(_0x403d37,_0x3bbec0);else{if(_0x403d37[_0x46fcef(0x2c8)]===0x0)console[_0x46fcef(0x341)](_0x46fcef(0x232));else for(const _0x1944b4 of _0x403d37){const _0x31b68e=_0x1944b4['state']===_0x46fcef(0x374)?'🚀':'📝',_0x367f48=_0x1944b4[_0x46fcef(0x311)]?a31_0x22e59c[_0x46fcef(0x1e8)](_0x46fcef(0x30c)):'',_0x6bc777=a31_0x22e59c[_0x46fcef(0x297)]('\x20('+_0x1944b4[_0x46fcef(0x26f)]+_0x46fcef(0x2fd)+(_0x1944b4[_0x46fcef(0x26f)]!==0x1?'s':'')+')');console[_0x46fcef(0x341)](_0x31b68e+'\x20'+_0x1944b4['name']+_0x367f48+_0x6bc777);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:rt:jn:pause';[a31_0x23ba89(0x30f)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x23ba89(0x2fe)](_0x243f1a){const _0x363e67=a31_0x23ba89,{options:_0x3953f8,args:_0x5ed4af,tdx:_0x503508}=_0x243f1a,_0x439975=_0x5ed4af[0x0];if(!_0x439975)return console[_0x363e67(0x1b0)](a31_0x22e59c[_0x363e67(0x38e)](_0x363e67(0x2bc))),console['error']('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x363e67(0x1b0)](a31_0x22e59c['dim'](_0x363e67(0x21b))),0x1;_0x3953f8[_0x363e67(0x2e1)]&&(console[_0x363e67(0x1b0)](_0x363e67(0x358)+_0x3953f8[_0x363e67(0x234)]),console['error'](_0x363e67(0x2e0)+_0x439975));const _0x36be86=await withSpinner(_0x363e67(0x289)+_0x439975+'\x27...',()=>_0x503508[_0x363e67(0x398)][_0x363e67(0x32c)](_0x439975),{'verbose':_0x3953f8[_0x363e67(0x2e1)]}),_0x5433ef=_0x36be86[_0x363e67(0x2d4)];console[_0x363e67(0x1b0)](_0x363e67(0x2c2)+_0x5433ef[_0x363e67(0x356)]+'\x27');if(_0x3953f8[_0x363e67(0x362)]===_0x363e67(0x380)||_0x3953f8[_0x363e67(0x362)]===_0x363e67(0x326))await handleSDKOutput([_0x5433ef],_0x3953f8);else{const _0x30f295=_0x5433ef[_0x363e67(0x300)]==='launched'?'🚀':'📝',_0x5aad69=_0x5433ef[_0x363e67(0x311)]?a31_0x22e59c[_0x363e67(0x1e8)](_0x363e67(0x30c)):'';console['log'](_0x30f295+'\x20'+_0x5433ef['name']+_0x5aad69);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x37c);[a31_0x23ba89(0x30f)]='Resume\x20activations\x20in\x20an\x20RT\x20journey';async[a31_0x23ba89(0x2fe)](_0x43c6a0){const _0x386f41=a31_0x23ba89,{options:_0x2967b7,args:_0x329faf,tdx:_0x3f2267}=_0x43c6a0,_0xfa0b28=_0x329faf[0x0];if(!_0xfa0b28)return console[_0x386f41(0x1b0)](a31_0x22e59c[_0x386f41(0x38e)](_0x386f41(0x2bc))),console['error'](_0x386f41(0x23c)),console[_0x386f41(0x1b0)](a31_0x22e59c[_0x386f41(0x297)](_0x386f41(0x21b))),0x1;_0x2967b7[_0x386f41(0x2e1)]&&(console[_0x386f41(0x1b0)](_0x386f41(0x358)+_0x2967b7['site']),console[_0x386f41(0x1b0)](_0x386f41(0x2e0)+_0xfa0b28));const _0x313b2a=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0xfa0b28+'\x27...',()=>_0x3f2267[_0x386f41(0x398)][_0x386f41(0x24a)](_0xfa0b28),{'verbose':_0x2967b7[_0x386f41(0x2e1)]}),_0x1eb1c6=_0x313b2a[_0x386f41(0x2d4)];console[_0x386f41(0x1b0)](_0x386f41(0x2fb)+_0x1eb1c6[_0x386f41(0x356)]+'\x27');if(_0x2967b7[_0x386f41(0x362)]===_0x386f41(0x380)||_0x2967b7[_0x386f41(0x362)]===_0x386f41(0x326))await handleSDKOutput([_0x1eb1c6],_0x2967b7);else{const _0x31936d=_0x1eb1c6[_0x386f41(0x300)]===_0x386f41(0x374)?'🚀':'📝',_0x36fb9c=_0x1eb1c6['paused']?a31_0x22e59c[_0x386f41(0x1e8)](_0x386f41(0x30c)):'';console[_0x386f41(0x341)](_0x31936d+'\x20'+_0x1eb1c6[_0x386f41(0x356)]+_0x36fb9c);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x30b);[a31_0x23ba89(0x30f)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async['execute'](_0x52250d){const _0x9a3d64=a31_0x23ba89,{options:_0xdf500,args:_0x2c0e18,tdx:_0x3d6741}=_0x52250d,_0x87b02d=_0x2c0e18[0x0]||_0xdf500[_0x9a3d64(0x2a6)];if(!_0x87b02d)return showParentSegmentNotSetError(_0x9a3d64(0x28f)+_0x9a3d64(0x394)),0x1;_0xdf500['verbose']&&(console[_0x9a3d64(0x1b0)](_0x9a3d64(0x358)+_0xdf500[_0x9a3d64(0x234)]),console[_0x9a3d64(0x1b0)]('Parent\x20segment:\x20'+_0x87b02d));const _0x485441=await withSpinner(_0x9a3d64(0x215)+_0x87b02d+'\x27...',()=>_0x3d6741[_0x9a3d64(0x392)][_0x9a3d64(0x204)](_0x87b02d),{'verbose':_0xdf500[_0x9a3d64(0x2e1)]}),_0x1cdd22=_0x485441['data'],_0x20919f=await withSpinner(_0x9a3d64(0x349)+_0x87b02d+_0x9a3d64(0x1e2),()=>_0x3d6741[_0x9a3d64(0x398)][_0x9a3d64(0x1e3)](_0x1cdd22),{'verbose':_0xdf500[_0x9a3d64(0x2e1)]}),_0xd8ce05=_0x20919f[_0x9a3d64(0x2d4)];return console[_0x9a3d64(0x1b0)](_0x9a3d64(0x346)),_0xdf500[_0x9a3d64(0x362)]==='json'||_0xdf500[_0x9a3d64(0x362)]==='jsonl'?await handleSDKOutput([_0xd8ce05],_0xdf500):(console['log'](_0x9a3d64(0x1c2)+_0xd8ce05['id']),console[_0x9a3d64(0x341)](_0x9a3d64(0x24b)+_0xd8ce05[_0x9a3d64(0x1f1)]),console[_0x9a3d64(0x341)](_0x9a3d64(0x246)+_0xd8ce05['identifier']),console[_0x9a3d64(0x341)]('eventKind:\x20'+_0xd8ce05['eventKind']),console[_0x9a3d64(0x341)]('status:\x20'+_0xd8ce05[_0x9a3d64(0x375)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1a3);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x2f6);async['execute'](_0x4b1cbf){const _0x1010a1=a31_0x23ba89,{options:_0x5603a8,args:_0x1a9789,tdx:_0x396cbb}=_0x4b1cbf,_0x5c2fd1=_0x1a9789[0x0]||_0x5603a8['parentSegment'];if(!_0x5c2fd1)return showParentSegmentNotSetError(_0x1010a1(0x2f8)+_0x1010a1(0x1ca)),0x1;const _0x266ab9=await withSpinner(_0x1010a1(0x215)+_0x5c2fd1+'\x27...',()=>_0x396cbb[_0x1010a1(0x392)]['resolveParentId'](_0x5c2fd1),{'verbose':_0x5603a8[_0x1010a1(0x2e1)]}),_0x44f748=_0x266ab9[_0x1010a1(0x2d4)],_0x398eb9=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x5c2fd1+_0x1010a1(0x1e2),()=>_0x396cbb['personalization']['list'](_0x44f748),{'verbose':_0x5603a8['verbose']}),_0x30dff9=_0x398eb9[_0x1010a1(0x2d4)];console[_0x1010a1(0x1b0)](_0x1010a1(0x1cc)+_0x30dff9['length']+_0x1010a1(0x33f)+(_0x30dff9[_0x1010a1(0x2c8)]!==0x1?'s':''));if(_0x5603a8[_0x1010a1(0x362)]===_0x1010a1(0x380)||_0x5603a8[_0x1010a1(0x362)]===_0x1010a1(0x326))await handleSDKOutput(_0x30dff9,_0x5603a8);else{if(_0x30dff9['length']===0x0)console[_0x1010a1(0x341)](_0x1010a1(0x33a)),console['error'](a31_0x22e59c[_0x1010a1(0x26c)](_0x1010a1(0x2b4)));else for(const _0x537f12 of _0x30dff9){console[_0x1010a1(0x341)](a31_0x22e59c[_0x1010a1(0x214)](_0x537f12[_0x1010a1(0x356)])+'\x20'+a31_0x22e59c['dim'](_0x1010a1(0x28a)+_0x537f12['id']+')'));_0x537f12[_0x1010a1(0x30f)]&&console[_0x1010a1(0x341)]('\x20\x20'+a31_0x22e59c[_0x1010a1(0x297)](_0x537f12[_0x1010a1(0x30f)]));if(_0x537f12['tokens']&&_0x537f12['tokens'][_0x1010a1(0x2c8)]>0x0)for(const _0x4ce2f7 of _0x537f12['tokens']){const _0x17d5cd=_0x4ce2f7[_0x1010a1(0x2e5)]?.[_0x1010a1(0x2c8)]?_0x4ce2f7['allowedIps'][_0x1010a1(0x301)](',\x20'):_0x1010a1(0x1ad);console['log']('\x20\x20'+a31_0x22e59c['cyan']('token:')+'\x20'+_0x4ce2f7['name']+'\x20'+a31_0x22e59c[_0x1010a1(0x297)](_0x1010a1(0x28a)+_0x4ce2f7['id']+')')),console[_0x1010a1(0x341)](_0x1010a1(0x1cb)+a31_0x22e59c[_0x1010a1(0x297)](_0x1010a1(0x287))+'\x20'+_0x17d5cd);}else console['log']('\x20\x20'+a31_0x22e59c[_0x1010a1(0x297)]('no\x20tokens\x20configured'));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:service:create';[a31_0x23ba89(0x30f)]='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async[a31_0x23ba89(0x2fe)](_0x225440){const _0x1e1f04=a31_0x23ba89,{options:_0x5005d6,args:_0x25d50a,tdx:_0x48e4f6}=_0x225440,_0x4cee39=_0x5005d6,_0x418797=_0x25d50a[0x0],_0x925db5=_0x25d50a[0x1]||_0x5005d6[_0x1e1f04(0x2a6)];if(!_0x418797)return console[_0x1e1f04(0x1b0)](_0x1e1f04(0x318)),console[_0x1e1f04(0x1b0)](_0x1e1f04(0x206)),console['error'](_0x1e1f04(0x370)),0x1;if(!_0x925db5)return showParentSegmentNotSetError(_0x1e1f04(0x364)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x223496=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x925db5+_0x1e1f04(0x1e2),()=>_0x48e4f6['segment'][_0x1e1f04(0x204)](_0x925db5),{'verbose':_0x5005d6[_0x1e1f04(0x2e1)]}),_0x2ee2e5=_0x223496[_0x1e1f04(0x2d4)],_0x26bd1c={'name':_0x418797,'description':_0x4cee39[_0x1e1f04(0x30f)],'public':_0x4cee39[_0x1e1f04(0x22d)]},_0x925264=await withSpinner(_0x1e1f04(0x258)+_0x418797+_0x1e1f04(0x1e2),()=>_0x48e4f6['personalization'][_0x1e1f04(0x25d)](_0x2ee2e5,_0x26bd1c),{'verbose':_0x5005d6['verbose']}),_0x2c7076=_0x925264[_0x1e1f04(0x2d4)];return console[_0x1e1f04(0x1b0)]('✔\x20Created\x20personalization\x20service\x20\x27'+_0x2c7076['name']+_0x1e1f04(0x208)+_0x2c7076['id']),await handleSDKOutput([_0x2c7076],_0x5005d6),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{['name']=a31_0x23ba89(0x28d);[a31_0x23ba89(0x30f)]='Show\x20personalization\x20service\x20details';async[a31_0x23ba89(0x2fe)](_0x54005c){const _0x2786ca=a31_0x23ba89,{options:_0x67e034,args:_0x36bb9c,tdx:_0x317ce0}=_0x54005c,_0x4d328b=_0x36bb9c[0x0],_0x207faf=_0x36bb9c[0x1]||_0x67e034[_0x2786ca(0x2a6)];if(!_0x4d328b)return console[_0x2786ca(0x1b0)](_0x2786ca(0x1ba)),console['error'](_0x2786ca(0x33b)),console[_0x2786ca(0x1b0)](_0x2786ca(0x377)),0x1;if(!_0x207faf)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x2786ca(0x377)),0x1;const _0x4e6516=await withSpinner(_0x2786ca(0x215)+_0x207faf+_0x2786ca(0x1e2),()=>_0x317ce0[_0x2786ca(0x392)][_0x2786ca(0x204)](_0x207faf),{'verbose':_0x67e034[_0x2786ca(0x2e1)]}),_0x59d3fa=_0x4e6516['data'],_0x4d478f=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x4d328b+_0x2786ca(0x1e2),()=>_0x317ce0[_0x2786ca(0x264)][_0x2786ca(0x262)](_0x59d3fa,_0x4d328b),{'verbose':_0x67e034[_0x2786ca(0x2e1)]}),_0x5da95b=_0x4d478f['data'];if(_0x67e034[_0x2786ca(0x380)]||_0x67e034[_0x2786ca(0x326)])await handleSDKOutput([_0x5da95b],_0x67e034);else{console['log'](a31_0x22e59c[_0x2786ca(0x214)](_0x5da95b['name'])+'\x20'+a31_0x22e59c['dim'](_0x2786ca(0x28a)+_0x5da95b['id']+')'));_0x5da95b[_0x2786ca(0x30f)]&&console[_0x2786ca(0x341)]('\x20\x20'+a31_0x22e59c[_0x2786ca(0x297)](_0x5da95b[_0x2786ca(0x30f)]));console[_0x2786ca(0x341)]('\x20\x20'+a31_0x22e59c['cyan']('public:')+'\x20'+(_0x5da95b[_0x2786ca(0x22d)]?_0x2786ca(0x210):'no'));if(_0x5da95b[_0x2786ca(0x365)]&&_0x5da95b[_0x2786ca(0x365)]['length']>0x0)for(const _0x44e33e of _0x5da95b[_0x2786ca(0x365)]){const _0x1327be=_0x44e33e[_0x2786ca(0x2e5)]?.[_0x2786ca(0x2c8)]?_0x44e33e[_0x2786ca(0x2e5)][_0x2786ca(0x301)](',\x20'):'any';console[_0x2786ca(0x341)]('\x20\x20'+a31_0x22e59c[_0x2786ca(0x26c)](_0x2786ca(0x3a3))+'\x20'+_0x44e33e[_0x2786ca(0x356)]+'\x20'+a31_0x22e59c[_0x2786ca(0x297)](_0x2786ca(0x28a)+_0x44e33e['id']+')')),console[_0x2786ca(0x341)](_0x2786ca(0x1cb)+a31_0x22e59c['dim'](_0x2786ca(0x287))+'\x20'+_0x1327be);}else console['log']('\x20\x20'+a31_0x22e59c[_0x2786ca(0x297)](_0x2786ca(0x1c9)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x1d5);[a31_0x23ba89(0x30f)]='Delete\x20a\x20personalization\x20service';async[a31_0x23ba89(0x2fe)](_0x493a46){const _0x4c26ee=a31_0x23ba89,{options:_0x2307e7,args:_0x1da824,tdx:_0x1a51ad}=_0x493a46,_0x44c792=_0x1da824[0x0],_0x1afad9=_0x1da824[0x1]||_0x2307e7[_0x4c26ee(0x2a6)];if(!_0x44c792)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0x4c26ee(0x29e)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x1afad9)return showParentSegmentNotSetError(_0x4c26ee(0x2b2)+_0x4c26ee(0x1b8)),0x1;const _0x5b3423=await withSpinner(_0x4c26ee(0x215)+_0x1afad9+_0x4c26ee(0x1e2),()=>_0x1a51ad[_0x4c26ee(0x392)][_0x4c26ee(0x204)](_0x1afad9),{'verbose':_0x2307e7['verbose']}),_0x1eeb7f=_0x5b3423[_0x4c26ee(0x2d4)];return await withSpinner(_0x4c26ee(0x2b7)+_0x44c792+_0x4c26ee(0x1e2),()=>_0x1a51ad[_0x4c26ee(0x264)][_0x4c26ee(0x1c6)](_0x1eeb7f,_0x44c792),{'verbose':_0x2307e7[_0x4c26ee(0x2e1)]}),console[_0x4c26ee(0x1b0)](_0x4c26ee(0x1fd)+_0x44c792+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x209);['description']='Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description';async[a31_0x23ba89(0x2fe)](_0x5d5391){const _0x2150ee=a31_0x23ba89,{options:_0x5e8d34,args:_0x345432,tdx:_0x196cba}=_0x5d5391,_0x59693a=_0x5e8d34,_0x4eabfe=_0x345432[0x0],_0x2161a6=_0x345432[0x1]||_0x5e8d34[_0x2150ee(0x2a6)];if(!_0x4eabfe)return console['error'](_0x2150ee(0x1ba)),console[_0x2150ee(0x1b0)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),console[_0x2150ee(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x59693a[_0x2150ee(0x356)])return console[_0x2150ee(0x1b0)]('Error:\x20--name\x20is\x20required'),console[_0x2150ee(0x1b0)](_0x2150ee(0x2a3)),0x1;if(!_0x2161a6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x2150ee(0x1d9)),0x1;const _0x364fbd=await withSpinner(_0x2150ee(0x215)+_0x2161a6+_0x2150ee(0x1e2),()=>_0x196cba[_0x2150ee(0x392)][_0x2150ee(0x204)](_0x2161a6),{'verbose':_0x5e8d34[_0x2150ee(0x2e1)]}),_0x1cad68=_0x364fbd[_0x2150ee(0x2d4)],_0x511fe8={'name':_0x59693a['name']};_0x59693a[_0x2150ee(0x30f)]!==undefined&&(_0x511fe8[_0x2150ee(0x30f)]=_0x59693a['description']);const _0x370d1e=await withSpinner(_0x2150ee(0x390)+_0x4eabfe+'\x27...',()=>_0x196cba[_0x2150ee(0x264)][_0x2150ee(0x31c)](_0x1cad68,_0x4eabfe,_0x511fe8),{'verbose':_0x5e8d34[_0x2150ee(0x2e1)]}),_0x4ed671=_0x370d1e[_0x2150ee(0x2d4)];return console[_0x2150ee(0x1b0)](_0x2150ee(0x22b)+_0x4ed671[_0x2150ee(0x356)]+'\x27'),await handleSDKOutput([_0x4ed671],_0x5e8d34),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:service:token:create';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x203);async[a31_0x23ba89(0x2fe)](_0x47ffc8){const _0x5bedfa=a31_0x23ba89,{options:_0x451e48,args:_0x470176,tdx:_0x931066}=_0x47ffc8,_0xfe7c5d=_0x451e48,_0x377f56=_0x470176[0x0],_0x308e87=_0x470176[0x1],_0x5983e4=_0x470176[0x2]||_0x451e48[_0x5bedfa(0x2a6)];if(!_0x377f56)return console[_0x5bedfa(0x1b0)]('Error:\x20Token\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x5bedfa(0x1b0)](_0x5bedfa(0x323)),0x1;if(!_0x308e87)return console[_0x5bedfa(0x1b0)](_0x5bedfa(0x1ba)),console[_0x5bedfa(0x1b0)](_0x5bedfa(0x1b4)),console[_0x5bedfa(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5983e4)return showParentSegmentNotSetError(_0x5bedfa(0x384)+_0x5bedfa(0x323)),0x1;const _0x230b1e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5983e4+_0x5bedfa(0x1e2),()=>_0x931066[_0x5bedfa(0x392)][_0x5bedfa(0x204)](_0x5983e4),{'verbose':_0x451e48[_0x5bedfa(0x2e1)]}),_0xda185c=_0x230b1e[_0x5bedfa(0x2d4)],_0x3d7d85={'name':_0x377f56};_0xfe7c5d[_0x5bedfa(0x2e5)]&&(_0x3d7d85['allowedIps']=_0xfe7c5d[_0x5bedfa(0x2e5)][_0x5bedfa(0x1fc)](',')[_0x5bedfa(0x30a)](_0x40f323=>_0x40f323[_0x5bedfa(0x292)]()));_0xfe7c5d[_0x5bedfa(0x30f)]&&(_0x3d7d85[_0x5bedfa(0x30f)]=_0xfe7c5d[_0x5bedfa(0x30f)]);const _0x32e4c8=await withSpinner(_0x5bedfa(0x309)+_0x377f56+'\x27\x20for\x20service\x20\x27'+_0x308e87+_0x5bedfa(0x1e2),()=>_0x931066[_0x5bedfa(0x264)][_0x5bedfa(0x355)](_0xda185c,_0x308e87,_0x3d7d85),{'verbose':_0x451e48[_0x5bedfa(0x2e1)]}),_0x4c71d5=_0x32e4c8[_0x5bedfa(0x2d4)];return console[_0x5bedfa(0x1b0)](_0x5bedfa(0x22e)+_0x4c71d5['name']+'\x27\x20with\x20ID:\x20'+_0x4c71d5['id']),_0x4c71d5[_0x5bedfa(0x34a)]&&(console['error'](a31_0x22e59c[_0x5bedfa(0x1e8)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x5bedfa(0x1b0)](a31_0x22e59c[_0x5bedfa(0x26c)](_0x4c71d5['value'])),console[_0x5bedfa(0x1b0)]('')),await handleSDKOutput([_0x4c71d5],_0x451e48),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x29b);['description']=a31_0x23ba89(0x347);async['execute'](_0x30ad8c){const _0x335b2c=a31_0x23ba89,{options:_0x1d6db2,args:_0x3cbfe3,tdx:_0x20b51e}=_0x30ad8c,_0x188d7c=_0x3cbfe3[0x0],_0x3f5b20=_0x3cbfe3[0x1]||_0x1d6db2[_0x335b2c(0x2a6)];if(!_0x188d7c)return console[_0x335b2c(0x1b0)](_0x335b2c(0x2da)),console['error'](_0x335b2c(0x3a8)),console[_0x335b2c(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3f5b20)return showParentSegmentNotSetError(_0x335b2c(0x218)+_0x335b2c(0x2dd)),0x1;const _0xd40b4f=await withSpinner(_0x335b2c(0x215)+_0x3f5b20+_0x335b2c(0x1e2),()=>_0x20b51e[_0x335b2c(0x392)]['resolveParentId'](_0x3f5b20),{'verbose':_0x1d6db2[_0x335b2c(0x2e1)]}),_0x59338c=_0xd40b4f[_0x335b2c(0x2d4)],_0x2bfe40=await withSpinner(_0x335b2c(0x357),()=>_0x20b51e[_0x335b2c(0x264)][_0x335b2c(0x36c)](_0x59338c),{'verbose':_0x1d6db2['verbose']}),_0x262c96=_0x2bfe40[_0x335b2c(0x2d4)];let _0x25a740;for(const _0x50f08c of _0x262c96){if(_0x50f08c[_0x335b2c(0x365)]?.[_0x335b2c(0x33e)](_0x318385=>_0x318385['id']===_0x188d7c)){_0x25a740=_0x50f08c['id'];break;}}if(!_0x25a740)return console[_0x335b2c(0x1b0)](_0x335b2c(0x1f3)+_0x188d7c+_0x335b2c(0x1ab)),0x1;const _0x230cf1=await withSpinner(_0x335b2c(0x1b1)+_0x188d7c+_0x335b2c(0x1e2),()=>_0x20b51e[_0x335b2c(0x264)][_0x335b2c(0x324)](_0x59338c,_0x25a740,_0x188d7c),{'verbose':_0x1d6db2[_0x335b2c(0x2e1)]}),_0x2f9681=_0x230cf1['data'];return console[_0x335b2c(0x1b0)](_0x335b2c(0x2aa)+(_0x2f9681[_0x335b2c(0x356)]||_0x188d7c)+'\x27'),await handleSDKOutput([_0x2f9681],_0x1d6db2),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:list';[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x3ad);async[a31_0x23ba89(0x2fe)](_0x5a187a){const _0x54f559=a31_0x23ba89,{options:_0x21eb0b,args:_0x4fdb51,tdx:_0x463da4}=_0x5a187a,_0x55d6db=_0x4fdb51[0x0]||_0x21eb0b['parentSegment'];if(!_0x55d6db)return showParentSegmentNotSetError(_0x54f559(0x3b2)+_0x54f559(0x29a)),0x1;const _0x18f8e0=await withSpinner(_0x54f559(0x215)+_0x55d6db+_0x54f559(0x1e2),()=>_0x463da4[_0x54f559(0x392)][_0x54f559(0x204)](_0x55d6db),{'verbose':_0x21eb0b[_0x54f559(0x2e1)]}),_0x40a45c=_0x18f8e0['data'],_0x2ca500=await withSpinner(_0x54f559(0x24f)+_0x55d6db+_0x54f559(0x1e2),()=>_0x463da4[_0x54f559(0x264)][_0x54f559(0x353)](_0x40a45c),{'verbose':_0x21eb0b[_0x54f559(0x2e1)]}),_0x38fee8=_0x2ca500[_0x54f559(0x2d4)];console[_0x54f559(0x1b0)](_0x54f559(0x1cc)+_0x38fee8['length']+_0x54f559(0x2a4)+(_0x38fee8[_0x54f559(0x2c8)]!==0x1?'s':''));if(_0x21eb0b[_0x54f559(0x362)]===_0x54f559(0x380)||_0x21eb0b['format']===_0x54f559(0x326))await handleSDKOutput(_0x38fee8,_0x21eb0b);else{if(_0x38fee8[_0x54f559(0x2c8)]===0x0)console['log'](_0x54f559(0x2cf));else for(const _0x30c22f of _0x38fee8){console['log'](a31_0x22e59c['bold'](_0x30c22f[_0x54f559(0x356)])+'\x20'+a31_0x22e59c[_0x54f559(0x297)]('(id:\x20'+_0x30c22f['id']+')'));_0x30c22f['description']&&console[_0x54f559(0x341)]('\x20\x20'+a31_0x22e59c['dim'](_0x30c22f[_0x54f559(0x30f)]));const _0x4f72c2=_0x30c22f[_0x54f559(0x332)]?.[_0x54f559(0x2c8)]||0x0;console[_0x54f559(0x341)]('\x20\x20'+a31_0x22e59c[_0x54f559(0x26c)](_0x54f559(0x239))+'\x20'+_0x4f72c2);if(_0x30c22f['sections']&&_0x30c22f['sections'][_0x54f559(0x2c8)]>0x0)for(const _0x1ad0f5 of _0x30c22f[_0x54f559(0x332)]){console['log'](_0x54f559(0x220)+_0x1ad0f5['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x23ba89(0x356)]='ps:pz:show';['description']=a31_0x23ba89(0x2e2);async[a31_0x23ba89(0x2fe)](_0x1a5882){const _0x5dbe7f=a31_0x23ba89,{options:_0x2176a2,args:_0x257c56,tdx:_0x3f376b}=_0x1a5882,_0x396539=_0x257c56[0x0];if(!_0x396539)return console[_0x5dbe7f(0x1b0)](_0x5dbe7f(0x2dc)),console[_0x5dbe7f(0x1b0)](_0x5dbe7f(0x25f)),0x1;const _0x35a984=await withSpinner(_0x5dbe7f(0x22c)+_0x396539+_0x5dbe7f(0x1e2),()=>_0x3f376b[_0x5dbe7f(0x264)]['getPersonalization'](_0x396539),{'verbose':_0x2176a2[_0x5dbe7f(0x2e1)]}),_0x49c568=_0x35a984['data'];console['error'](_0x5dbe7f(0x2a0)+_0x49c568[_0x5dbe7f(0x356)]+'\x27');if(_0x2176a2[_0x5dbe7f(0x362)]===_0x5dbe7f(0x380)||_0x2176a2['format']===_0x5dbe7f(0x326))await handleSDKOutput([_0x49c568],_0x2176a2);else{console[_0x5dbe7f(0x341)](a31_0x22e59c['bold'](_0x49c568['name'])+'\x20'+a31_0x22e59c[_0x5dbe7f(0x297)](_0x5dbe7f(0x28a)+_0x49c568['id']+')'));_0x49c568[_0x5dbe7f(0x30f)]&&console['log']('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x297)](_0x49c568[_0x5dbe7f(0x30f)]));_0x49c568['audienceId']&&console[_0x5dbe7f(0x341)]('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x238))+'\x20'+_0x49c568['audienceId']);console['log']('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x1e1))+'\x20'+_0x49c568[_0x5dbe7f(0x253)]),console[_0x5dbe7f(0x341)]('\x20\x20'+a31_0x22e59c['cyan'](_0x5dbe7f(0x235))+'\x20'+_0x49c568[_0x5dbe7f(0x27b)]);const _0x5e214b=_0x49c568[_0x5dbe7f(0x332)]?.[_0x5dbe7f(0x2c8)]||0x0;console[_0x5dbe7f(0x341)]('\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x239))+'\x20'+_0x5e214b);if(_0x49c568[_0x5dbe7f(0x332)]&&_0x49c568[_0x5dbe7f(0x332)][_0x5dbe7f(0x2c8)]>0x0)for(const _0x452bf8 of _0x49c568[_0x5dbe7f(0x332)]){console[_0x5dbe7f(0x341)](_0x5dbe7f(0x1cb)+a31_0x22e59c['bold'](_0x452bf8[_0x5dbe7f(0x356)])+'\x20'+a31_0x22e59c[_0x5dbe7f(0x297)](_0x5dbe7f(0x28a)+_0x452bf8['id']+')')),_0x452bf8[_0x5dbe7f(0x35f)]&&(console[_0x5dbe7f(0x341)]('\x20\x20\x20\x20\x20\x20'+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x23e))+'\x20'+_0x452bf8['entryCriteria'][_0x5dbe7f(0x356)]),_0x452bf8['entryCriteria']['keyEventCriteria']?.[_0x5dbe7f(0x39c)]&&console[_0x5dbe7f(0x341)](_0x5dbe7f(0x2a2)+a31_0x22e59c['cyan'](_0x5dbe7f(0x2c4))+'\x20'+_0x452bf8[_0x5dbe7f(0x35f)][_0x5dbe7f(0x303)][_0x5dbe7f(0x39c)])),_0x452bf8[_0x5dbe7f(0x201)]&&console['log'](_0x5dbe7f(0x270)+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x28c))+'\x20'+JSON[_0x5dbe7f(0x1e5)](_0x452bf8['payload'])),_0x452bf8[_0x5dbe7f(0x2ae)]&&console[_0x5dbe7f(0x341)](_0x5dbe7f(0x270)+a31_0x22e59c[_0x5dbe7f(0x26c)](_0x5dbe7f(0x26b))+_0x5dbe7f(0x299));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x21e);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x383);async[a31_0x23ba89(0x2fe)](_0x2a3cee){const _0x218291=a31_0x23ba89,{options:_0x4670f6,args:_0x300c0f,tdx:_0x15b7f4}=_0x2a3cee,_0x41c3d4=_0x300c0f[0x0];if(!_0x41c3d4)return console[_0x218291(0x1b0)](_0x218291(0x2dc)),console[_0x218291(0x1b0)](_0x218291(0x350)),0x1;return await withSpinner(_0x218291(0x1f6)+_0x41c3d4+_0x218291(0x1e2),()=>_0x15b7f4[_0x218291(0x264)][_0x218291(0x31f)](_0x41c3d4),{'verbose':_0x4670f6[_0x218291(0x2e1)]}),console[_0x218291(0x1b0)](_0x218291(0x1b9)+_0x41c3d4+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x259);['description']=a31_0x23ba89(0x2ff);async[a31_0x23ba89(0x2fe)](_0x22cfe9){const _0x40f0c2=a31_0x23ba89,{options:_0x4ac44f,tdx:_0x1e728f}=_0x22cfe9,_0x59af9d=_0x4ac44f;let _0x33dd9c;if(_0x59af9d[_0x40f0c2(0x3b0)]){_0x33dd9c=await loadJSON(_0x59af9d[_0x40f0c2(0x3b0)],!![]);if(!_0x33dd9c[_0x40f0c2(0x39f)]?.[_0x40f0c2(0x2e8)])return console[_0x40f0c2(0x1b0)](_0x40f0c2(0x333)),console[_0x40f0c2(0x1b0)]('Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:'),console[_0x40f0c2(0x1b0)](_0x40f0c2(0x1eb)),0x1;}else{if(!_0x59af9d[_0x40f0c2(0x356)])return console[_0x40f0c2(0x1b0)](_0x40f0c2(0x285)),console['error'](_0x40f0c2(0x34d)),console['error'](_0x40f0c2(0x2cc)),0x1;if(_0x59af9d[_0x40f0c2(0x30f)]===undefined)return console['error'](_0x40f0c2(0x291)),console[_0x40f0c2(0x1b0)](_0x40f0c2(0x34d)),console[_0x40f0c2(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0x59af9d[_0x40f0c2(0x25a)]===undefined)return console['error']('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console[_0x40f0c2(0x1b0)]('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0xd6ff1d=_0x59af9d[_0x40f0c2(0x1f1)];if(!_0xd6ff1d&&_0x4ac44f[_0x40f0c2(0x2a6)]){const _0x3d1384=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ac44f['parentSegment']+_0x40f0c2(0x1e2),()=>_0x1e728f[_0x40f0c2(0x392)][_0x40f0c2(0x204)](_0x4ac44f[_0x40f0c2(0x2a6)]),{'verbose':_0x4ac44f[_0x40f0c2(0x2e1)]});_0xd6ff1d=_0x3d1384['data'];}let _0x347770;_0x59af9d[_0x40f0c2(0x332)]&&(_0x347770=await loadJSON(_0x59af9d[_0x40f0c2(0x332)],![]));const _0x207da7=_0x59af9d[_0x40f0c2(0x25a)]===_0x40f0c2(0x3aa)?null:{'id':_0x59af9d[_0x40f0c2(0x25a)],'type':_0x40f0c2(0x3a4)};_0x33dd9c={'attributes':{'name':_0x59af9d[_0x40f0c2(0x356)],'description':_0x59af9d[_0x40f0c2(0x30f)]||null,..._0xd6ff1d!==undefined&&{'audienceId':_0xd6ff1d},..._0x347770!==undefined&&{'sections':_0x347770}},'relationships':{'parentFolder':{'data':_0x207da7}}};}const _0x4a0b57=await withSpinner(_0x40f0c2(0x1f7)+(_0x33dd9c[_0x40f0c2(0x336)]?.[_0x40f0c2(0x356)]??'')+'\x27...',()=>_0x1e728f['personalization']['createPersonalization'](_0x33dd9c),{'verbose':_0x4ac44f[_0x40f0c2(0x2e1)]}),_0x120613=_0x4a0b57[_0x40f0c2(0x2d4)];return console[_0x40f0c2(0x1b0)](_0x40f0c2(0x1b7)+_0x120613['name']+'\x27\x20with\x20ID:\x20'+_0x120613['id']),await handleSDKOutput([_0x120613],_0x4ac44f),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x23ba89(0x356)]=a31_0x23ba89(0x237);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x306);async['execute'](_0x4eb9a0){const _0x23654c=a31_0x23ba89,{options:_0x2351db,args:_0x28ceb1}=_0x4eb9a0,_0x5427ae=_0x2351db,_0x2681b5=_0x28ceb1[0x0];if(!_0x2681b5)return console['error'](_0x23654c(0x2dc)),console[_0x23654c(0x1b0)](_0x23654c(0x24c)),console[_0x23654c(0x1b0)](_0x23654c(0x371)),0x1;let _0x560938;if(_0x5427ae[_0x23654c(0x3b0)])_0x560938=await loadJSON(_0x5427ae['file'],!![]);else{if(!_0x5427ae[_0x23654c(0x356)])return console[_0x23654c(0x1b0)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x23654c(0x1b0)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;if(_0x5427ae[_0x23654c(0x30f)]===undefined)return console[_0x23654c(0x1b0)](_0x23654c(0x291)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),0x1;let _0x48d9c9;_0x5427ae[_0x23654c(0x332)]&&(_0x48d9c9=await loadJSON(_0x5427ae['sections'],![])),_0x560938={'attributes':{'name':_0x5427ae[_0x23654c(0x356)],'description':_0x5427ae[_0x23654c(0x30f)]||null,..._0x48d9c9!==undefined&&{'sections':_0x48d9c9}}};}const {tdx:_0x20a349}=_0x4eb9a0,_0x434fba=await withSpinner(_0x23654c(0x37d)+_0x2681b5+_0x23654c(0x1e2),()=>_0x20a349[_0x23654c(0x264)]['patchPersonalization'](_0x2681b5,_0x560938),{'verbose':_0x2351db[_0x23654c(0x2e1)]}),_0x488add=_0x434fba['data'];return console[_0x23654c(0x1b0)](_0x23654c(0x29c)+_0x488add['name']+'\x27\x20(id:\x20'+_0x488add['id']+')'),await handleSDKOutput([_0x488add],_0x2351db),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a31_0x23ba89(0x1dd);[a31_0x23ba89(0x30f)]=a31_0x23ba89(0x252);async['execute'](_0x2bca30){const _0x5504d1=a31_0x23ba89,{options:_0xc65b56,args:_0x56a22f}=_0x2bca30,_0x2a0b4d=_0x56a22f[0x0]||_0xc65b56[_0x5504d1(0x2a6)];if(!_0x2a0b4d)return showParentSegmentNotSetError(_0x5504d1(0x338)+_0x5504d1(0x224)),0x1;const _0xc2ebb0=resolveYamlFile(_0x2a0b4d);if(!existsSync(_0xc2ebb0))return showFileNotFoundError(_0xc2ebb0,_0x2a0b4d),0x1;let _0x44c730;try{_0x44c730=readFileSync(_0xc2ebb0,_0x5504d1(0x20e));}catch(_0x21389c){const _0x28c5f9=_0x21389c instanceof Error?_0x21389c[_0x5504d1(0x39b)]:String(_0x21389c);return console[_0x5504d1(0x1b0)](_0x5504d1(0x2fc)+_0x28c5f9),0x1;}let _0x37ffb0;try{_0x37ffb0=parseDef(_0x44c730);}catch(_0x4c9ba5){const _0x1f2eec=_0x4c9ba5 instanceof Error?_0x4c9ba5[_0x5504d1(0x39b)]:String(_0x4c9ba5);return console['error'](a31_0x22e59c[_0x5504d1(0x38e)](_0x5504d1(0x2d5)+_0x1f2eec)),0x1;}if(_0x37ffb0['personalization_services']&&_0x37ffb0['personalization_services'][_0x5504d1(0x2c8)]>0x0)return console[_0x5504d1(0x1b0)](a31_0x22e59c['yellow']('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0xc2ebb0)),console[_0x5504d1(0x1b0)](a31_0x22e59c[_0x5504d1(0x297)]('\x20\x20\x20'+_0x37ffb0[_0x5504d1(0x241)][_0x5504d1(0x2c8)]+_0x5504d1(0x1f8))),0x1;!_0x37ffb0['realtime']&&(_0x37ffb0[_0x5504d1(0x398)]={'events':[{'name':_0x5504d1(0x39e),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x5504d1(0x2f0),'type':_0x5504d1(0x236)}],'id_stitching':{'primary_key':_0x37ffb0[_0x5504d1(0x23f)][_0x5504d1(0x2a9)]==='customers'?_0x5504d1(0x3b4):_0x5504d1(0x1f2)}});_0x37ffb0['personalization_services']=[{'name':'My\x20Service','description':'Personalization\x20service\x20description','trigger_event':_0x5504d1(0x39e),'sections':[{'name':_0x5504d1(0x387),'criteria':'true','attributes':['last_page_viewed']}]}];const _0x410bb3=serializeDef(_0x37ffb0);return writeFileSync(_0xc2ebb0,_0x410bb3,_0x5504d1(0x20e)),console[_0x5504d1(0x1b0)](a31_0x22e59c[_0x5504d1(0x1a5)]('✔')+_0x5504d1(0x36b)+a31_0x22e59c[_0x5504d1(0x26c)](_0xc2ebb0)),(!_0x37ffb0['realtime']||_0x44c730[_0x5504d1(0x3a1)](_0x5504d1(0x2f9))===-0x1)&&console['error'](a31_0x22e59c[_0x5504d1(0x1a5)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x5504d1(0x1b0)]('\x0a'+a31_0x22e59c[_0x5504d1(0x297)](_0x5504d1(0x31d))),console[_0x5504d1(0x1b0)](_0x5504d1(0x1ac)+_0xc2ebb0+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x5504d1(0x1b0)](_0x5504d1(0x286)+a31_0x22e59c[_0x5504d1(0x297)](_0x5504d1(0x34c)+_0x2a0b4d)+_0x5504d1(0x25c)),0x0;}}
|