@treasuredata/tdx 2026.3.38 → 2026.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-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.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/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/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/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.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +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.d.ts +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/github-releases.js.map +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a32_0x308022=a32_0x4528;(function(_0x162ec0,_0x1debc9){const _0x5daa22=a32_0x4528,_0x24ccf8=_0x162ec0();while(!![]){try{const _0x2fb1ff=parseInt(_0x5daa22(0x34a))/0x1+parseInt(_0x5daa22(0x402))/0x2+parseInt(_0x5daa22(0x401))/0x3*(parseInt(_0x5daa22(0x3dd))/0x4)+parseInt(_0x5daa22(0x35a))/0x5+parseInt(_0x5daa22(0x382))/0x6+-parseInt(_0x5daa22(0x3a7))/0x7*(parseInt(_0x5daa22(0x342))/0x8)+-parseInt(_0x5daa22(0x30c))/0x9;if(_0x2fb1ff===_0x1debc9)break;else _0x24ccf8['push'](_0x24ccf8['shift']());}catch(_0x5f03ed){_0x24ccf8['push'](_0x24ccf8['shift']());}}}(a32_0x45ed,0x6bb77));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0xb486ae 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 a32_0x1c520c from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';function a32_0x4528(_0x9d4313,_0x2aa166){_0x9d4313=_0x9d4313-0x1e4;const _0x45eda0=a32_0x45ed();let _0x452825=_0x45eda0[_0x9d4313];return _0x452825;}import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a32_0x308022(0x2b8),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x3d156f){const _0x14e462=a32_0x308022,_0x27b92d=process[_0x14e462(0x235)],_0x12bbb7=_0x27b92d===_0x14e462(0x310)?_0x14e462(0x30f):_0x27b92d===_0x14e462(0x3ca)?_0x14e462(0x3fa):_0x14e462(0x323);spawn(_0x12bbb7,[_0x3d156f],{'detached':!![],'stdio':_0x14e462(0x3cc)})['unref']();}function migrateLegacyDirectory(){const _0x133788=a32_0x308022;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x11ac55=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x11ac55[_0x133788(0x284)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x133788(0x30e)](a32_0x1c520c['yellow'](_0x133788(0x2bc)+LEGACY_PARENT_SEGMENT_DIR+_0x133788(0x253)+PARENT_SEGMENT_DIR+_0x133788(0x3e5))),console['error'](a32_0x1c520c[_0x133788(0x1e5)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x133788(0x2f5))),![];console[_0x133788(0x30e)](a32_0x1c520c['yellow'](_0x133788(0x330)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x133788(0x30e)](a32_0x1c520c[_0x133788(0x335)](_0x133788(0x2d0)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x3206d5){const _0x4a376a=_0x3206d5 instanceof Error?_0x3206d5[_0x133788(0x391)]:String(_0x3206d5);return console[_0x133788(0x30e)](a32_0x1c520c[_0x133788(0x27c)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x4a376a+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x308022(0x250)](_0x2f2f58){return migrateLegacyDirectory(),super['run'](_0x2f2f58);}}function resolveYamlFile(_0x40a102){const _0xa0938e=a32_0x308022;if(_0x40a102[_0xa0938e(0x271)](_0xa0938e(0x365))||_0x40a102[_0xa0938e(0x271)]('.yaml'))return _0x40a102;return a32_0xb486ae['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x40a102)+_0xa0938e(0x365));}function formatProgressMessage(_0x47e3db){const _0x158053=a32_0x308022,_0x1a1718=_0x47e3db[_0x158053(0x2b6)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x1a1718){const [,_0x5da343,_0xb429d3,_0x4a25e7='']=_0x1a1718;return a32_0x1c520c[_0x158053(0x1e5)](_0x5da343+':')+'\x20'+_0xb429d3+a32_0x1c520c['dim'](_0x4a25e7);}return a32_0x1c520c[_0x158053(0x1e5)](_0x47e3db);}function showFileNotFoundError(_0x3986a9,_0x1c2f6f){const _0x4b322a=a32_0x308022;console['error'](a32_0x1c520c[_0x4b322a(0x27c)](_0x4b322a(0x2da)+_0x3986a9+'\x0a')),console[_0x4b322a(0x30e)](a32_0x1c520c[_0x4b322a(0x2e9)](_0x4b322a(0x2ed)+_0x1c2f6f+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x5b4bb2){const _0xbba4c5=a32_0x308022;if(!_0x5b4bb2['realtime'])return;const _0x1f7fbc=_0x5b4bb2[_0xbba4c5(0x3ec)],_0x3c0f48=_0x1f7fbc[_0xbba4c5(0x1e8)]?a32_0x1c520c['green'](_0xbba4c5(0x363)):a32_0x1c520c[_0xbba4c5(0x1f2)](_0xbba4c5(0x321));console[_0xbba4c5(0x30e)]('\x0a'+a32_0x1c520c[_0xbba4c5(0x1e5)](_0xbba4c5(0x2c3))+'\x20'+_0x3c0f48);if(_0x1f7fbc[_0xbba4c5(0x346)]&&_0x1f7fbc[_0xbba4c5(0x346)][_0xbba4c5(0x3f5)]>0x0){console[_0xbba4c5(0x30e)]('\x20\x20'+a32_0x1c520c[_0xbba4c5(0x1e5)](_0xbba4c5(0x3aa))+'\x20'+_0x1f7fbc['events'][_0xbba4c5(0x3f5)]+_0xbba4c5(0x24d));for(const _0x42043f of _0x1f7fbc[_0xbba4c5(0x346)]){const _0x14b003=_0x42043f['sourceTableValid']===![]?a32_0x1c520c[_0xbba4c5(0x27c)]('✘'):a32_0x1c520c['green']('✔');console[_0xbba4c5(0x30e)](_0xbba4c5(0x22d)+_0x14b003+'\x20'+_0x42043f['name']),_0x42043f[_0xbba4c5(0x34d)]&&console['error'](_0xbba4c5(0x287)+a32_0x1c520c[_0xbba4c5(0x27c)](_0x42043f[_0xbba4c5(0x34d)]));}}if(_0x1f7fbc[_0xbba4c5(0x2bf)]&&_0x1f7fbc[_0xbba4c5(0x2bf)][_0xbba4c5(0x3f5)]>0x0){console[_0xbba4c5(0x30e)]('\x20\x20'+a32_0x1c520c['dim'](_0xbba4c5(0x279))+'\x20'+_0x1f7fbc[_0xbba4c5(0x2bf)][_0xbba4c5(0x3f5)]+_0xbba4c5(0x24d));for(const _0x1babe3 of _0x1f7fbc[_0xbba4c5(0x2bf)]){const _0x7f2b2b=_0x1babe3[_0xbba4c5(0x267)]?a32_0x1c520c[_0xbba4c5(0x335)]('✔'):a32_0x1c520c[_0xbba4c5(0x27c)]('✘');console['error'](_0xbba4c5(0x22d)+_0x7f2b2b+'\x20'+_0x1babe3[_0xbba4c5(0x33c)]+'\x20'+a32_0x1c520c[_0xbba4c5(0x1e5)]('('+_0x1babe3[_0xbba4c5(0x1f5)]+')'));}}if(_0x1f7fbc[_0xbba4c5(0x23e)]){const _0xe62560=_0x1f7fbc['idStitching'][_0xbba4c5(0x277)]?.[_0xbba4c5(0x3f5)]?_0xbba4c5(0x23a)+_0x1f7fbc['idStitching'][_0xbba4c5(0x277)][_0xbba4c5(0x3c1)](',\x20')+']':'';console['error']('\x20\x20'+a32_0x1c520c[_0xbba4c5(0x1e5)](_0xbba4c5(0x24e))+'\x20'+_0x1f7fbc[_0xbba4c5(0x23e)][_0xbba4c5(0x337)]+_0xe62560);}if(_0x1f7fbc[_0xbba4c5(0x2e7)]&&_0x1f7fbc[_0xbba4c5(0x2e7)][_0xbba4c5(0x3f5)]>0x0){console[_0xbba4c5(0x30e)]('\x20\x20'+a32_0x1c520c[_0xbba4c5(0x1e5)](_0xbba4c5(0x373))+'\x20'+_0x1f7fbc[_0xbba4c5(0x2e7)][_0xbba4c5(0x3f5)]+_0xbba4c5(0x2c0)+(_0x1f7fbc['personalizationServices'][_0xbba4c5(0x3f5)]!==0x1?'s':''));for(const _0x15da11 of _0x1f7fbc['personalizationServices']){console[_0xbba4c5(0x30e)]('\x20\x20\x20\x20-\x20'+_0x15da11[_0xbba4c5(0x33c)]);}}}function showParentSegmentNotSetError(_0x3428dd){const _0x14e31c=a32_0x308022;console[_0x14e31c(0x30e)](a32_0x1c520c[_0x14e31c(0x1f2)](_0x14e31c(0x3db))),console['error'](_0x3428dd);}export class ParentSegmentListCommand extends BaseCommand{[a32_0x308022(0x33c)]='segment:parent:list';['description']=a32_0x308022(0x331);async[a32_0x308022(0x2df)](_0x2ded60){const _0x2c1f65=a32_0x308022,{options:_0xa80115,args:_0x4acb58,tdx:_0x52b520}=_0x2ded60,_0x4a1ea1=_0x4acb58[0x0];_0xa80115['verbose']&&(console['error'](_0x2c1f65(0x36b)+_0xa80115[_0x2c1f65(0x205)]),_0x4a1ea1&&console[_0x2c1f65(0x30e)](_0x2c1f65(0x3ed)+_0x4a1ea1));const _0x29193a=await withSpinner(_0x4a1ea1?_0x2c1f65(0x36e)+_0x4a1ea1+'\x27...':_0x2c1f65(0x26b),()=>_0x52b520[_0x2c1f65(0x2a1)]['listParents'](),{'verbose':_0xa80115[_0x2c1f65(0x384)]});let _0x5077e7=_0x29193a[_0x2c1f65(0x252)];if(_0x4a1ea1){const _0x16ed0c=_0x4a1ea1[_0x2c1f65(0x296)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1cef75=new RegExp('^'+_0x16ed0c+'$','i');_0x5077e7=_0x5077e7['filter'](_0x1c5ca3=>_0x1cef75[_0x2c1f65(0x3f6)](_0x1c5ca3[_0x2c1f65(0x2bf)][_0x2c1f65(0x33c)]));}_0x5077e7[_0x2c1f65(0x386)]((_0x530b3e,_0x371689)=>_0x530b3e[_0x2c1f65(0x2bf)][_0x2c1f65(0x33c)][_0x2c1f65(0x306)](_0x371689[_0x2c1f65(0x2bf)][_0x2c1f65(0x33c)])),console['error'](_0x2c1f65(0x2fa)+_0x5077e7['length']+_0x2c1f65(0x1f6)+(_0x5077e7['length']!==0x1?'s':''));const _0x1ff387=_0x4cedbf=>{const _0xa23c00=_0x2c1f65;return getConsoleNextUrl(_0xa80115['site'],_0xa23c00(0x315)+_0x4cedbf);};if(_0xa80115[_0x2c1f65(0x2ab)]==='json'||_0xa80115['format']==='jsonl'){const _0x5a2f0f=_0x5077e7[_0x2c1f65(0x273)](_0x4d42b5=>({..._0x4d42b5,'url':_0x1ff387(_0x4d42b5['id'])}));await handleSDKOutput(_0x5a2f0f,_0xa80115);}else{if(_0x5077e7[_0x2c1f65(0x3f5)]===0x0)_0x4a1ea1?console[_0x2c1f65(0x3d2)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4a1ea1):console[_0x2c1f65(0x3d2)]('No\x20parent\x20segments\x20found');else for(const _0x4f908e of _0x5077e7){const _0x3eb8f1=_0x4f908e[_0x2c1f65(0x2bf)][_0x2c1f65(0x2b0)]?a32_0x1c520c[_0x2c1f65(0x1e5)]('\x20('+formatRows(_0x4f908e['attributes'][_0x2c1f65(0x2b0)])+')'):'',_0xd973eb=hyperlink(_0x4f908e[_0x2c1f65(0x2bf)][_0x2c1f65(0x33c)],_0x1ff387(_0x4f908e['id']));console['log']('👥\x20'+_0xd973eb+_0x3eb8f1);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x336);[a32_0x308022(0x24f)]=a32_0x308022(0x219);async[a32_0x308022(0x2df)](_0x4b3bb8){const _0x1b3396=a32_0x308022,{options:_0x3bf3a9,args:_0x5f338b,tdx:_0x33c9c7}=_0x4b3bb8;console[_0x1b3396(0x30e)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x1b3396(0x2eb)+_0x1b3396(0x215));const _0x1f0857=_0x3bf3a9;if(_0x5f338b['length']===0x0)return console[_0x1b3396(0x30e)](a32_0x1c520c[_0x1b3396(0x27c)](_0x1b3396(0x2c6))),console['error'](_0x1b3396(0x254)),0x1;const _0x19dcea=_0x5f338b[0x0];if(!_0x1f0857[_0x1b3396(0x356)]||!_0x1f0857[_0x1b3396(0x3f7)])return console[_0x1b3396(0x30e)](_0x1b3396(0x2d5)),console[_0x1b3396(0x30e)](_0x1b3396(0x254)),0x1;_0x1f0857[_0x1b3396(0x384)]&&(console[_0x1b3396(0x30e)](_0x1b3396(0x36b)+_0x1f0857[_0x1b3396(0x205)]),console[_0x1b3396(0x30e)](_0x1b3396(0x28c)+_0x19dcea),console[_0x1b3396(0x30e)]('Database:\x20'+_0x1f0857['database']),console[_0x1b3396(0x30e)](_0x1b3396(0x34c)+_0x1f0857[_0x1b3396(0x3f7)]));const _0x9412f=await loadJSONFromOptions(_0x1f0857[_0x1b3396(0x2bf)],_0x1f0857[_0x1b3396(0x3a5)]),_0x38338f=await loadJSONFromOptions(_0x1f0857[_0x1b3396(0x231)],_0x1f0857[_0x1b3396(0x226)]),_0x46b228=await loadJSONFromOptions(_0x1f0857['customerGroup'],_0x1f0857[_0x1b3396(0x2ce)]),_0xf1e508={'name':_0x19dcea,'description':_0x1f0857[_0x1b3396(0x24f)],'scheduleType':_0x1f0857['scheduleType'],'scheduleOption':_0x1f0857[_0x1b3396(0x339)],'timezone':_0x1f0857['timezone'],'master':{'parentDatabaseName':_0x1f0857[_0x1b3396(0x356)],'parentTableName':_0x1f0857[_0x1b3396(0x3f7)]},'attributes':_0x9412f,'behaviors':_0x38338f,'customerGroup':_0x46b228},_0x3dfb1b=await withSpinner(_0x1b3396(0x2e0)+_0x19dcea+_0x1b3396(0x355),()=>_0x33c9c7[_0x1b3396(0x2a1)][_0x1b3396(0x3dc)](_0xf1e508),{'verbose':_0x3bf3a9[_0x1b3396(0x384)]}),_0x428249=_0x3dfb1b[_0x1b3396(0x252)];return console[_0x1b3396(0x30e)](_0x1b3396(0x3a2)+_0x428249['name']+_0x1b3396(0x234)+_0x428249['id']),await handleSDKOutput([_0x428249],_0x3bf3a9),0x0;}}function a32_0x45ed(){const _0x303c5e=['database','createPersonalization','\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','timezone','3582810dYaERi','\x20--behavior\x20\x22','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','ps:rt:configuration_versions','Analyzing\x20changes...','Master\x20Table','segment:parent:pull','resolveParentId','⚡\x20Enabled','segment:parent:push','.yml','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Join:','\x20service(s)\x20configured','Output\x20Database:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','Site:\x20','No\x20personalization\x20services\x20configured','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Listing\x20parent\x20segments\x20matching\x20\x27','split','value','displayRealtimeInfo','Errors:','Personalization:','varchar','td_client_id','\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','SELECT\x20*\x20FROM\x20','Validate:','in\x20','filter','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','segment:parent:preview','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20\x20\x20\x20\x20\x20\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','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','3784212zZaESz','customers','verbose','Personalization\x20service\x20description','sort','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','token:','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','segment:parent:view','segment:parent:fields','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','joinKey','message','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','✔\x20Query\x20completed:\x20Processed\x20','output','\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','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','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','query','Error:\x20Personalization\x20ID\x20is\x20required','create','Error:\x20--name\x20is\x20required','Options:\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','getBehaviorNames','Finding\x20service\x20for\x20token...','relationships','getParentFull','✔\x20Created\x20parent\x20segment\x20\x27','use','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','attributesFile','toFixed','7gEmWCH','realtime_enabled','Error:\x20Token\x20ID\x20is\x20required','Events:','collectSchema','Error\x20reading\x20file:\x20','Listing\x20RT-enabled\x20parent\x20segments...','updatedAt','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Validating\x20RT\x20configuration...','\x27\x20and\x20run\x20workflow?','repeat','Attributes','tdx\x20ps\x20push\x20','Fetching\x20current\x20configuration\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','Fetching\x20sample\x20data...','Default','\x20personalization\x20service','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','launched','listFields','interval','/sessions/','✔\x20Deleted\x20personalization\x20\x27','Audience\x20ID:','join','Executing\x20parent\x20segment\x20query...','Apply\x20changes\x20to\x20\x27','matchedCount','\x20personalization','\x20\x20No\x20sample\x20data\x20available','Fetching\x20personalization\x20service\x20\x27','public','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','win32','✔\x20Created\x20personalization\x20\x27','ignore','patch','Error:\x20Token\x20name\x20is\x20required','column_type','Rows:','state','log','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20--attribute\x20\x22<name>\x22','any','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','pauseJourney','updated:','toLowerCase','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','createParent','2856520TwQPIG','pullParentYaml','string','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','list','true','user_id','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','/\x20directories\x20exist.','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x27\x20for\x20service\x20\x27','addAttributes','Parent\x20segment:\x20','customerPercent','ps:pz:service:update','realtime','Pattern:\x20','ps:rt:validate','displayMasterInfo','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','utf-8','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','audienceId:\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','length','test','table','ps:pz:delete','allowedIps','start','Show\x20parent\x20segment\x20details','entryCriteria:','Created','audienceId:','column_name','/attempt/','3tLejxQ','1227372PUBztJ','sections:','ps:rt:jn:list','No\x20RT\x20journeys\x20found','dim','Resume\x20activations\x20in\x20an\x20RT\x20journey','Overwrite\x20\x27','enabled','all','paused','tdx\x20ps\x20preview\x20','\x20behaviors','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','page_view','totalEvents','Updating','yellow','Error\x20parsing\x20YAML:\x20','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','type','\x20parent\x20segment','List\x20available\x20fields\x20for\x20segmentation','✔\x20Updated\x20personalization\x20service\x20\x27','\x20total','Error:\x20Service\x20name\x20is\x20required','✔\x20Deleted\x20personalization\x20service\x20\x27','Creating','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','%)\x20','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','displayPreviewHints','null','Create\x20parent\x20segment\x20\x27','Aborted.','site','errors','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','formatSchemaJson','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','ps:pz:patch','addAttributesFile','getCurrentConfigVersion','patchPersonalization','validateParentYaml','Delete\x20a\x20realtime\x20personalization','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','keys','My\x20Service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x20RT-enabled\x20parent\x20segment','Preview:','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','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','ps:pz:create','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20--behavior\x20\x22<name>\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','\x20parent\x20segment\x20\x27','Delete\x20a\x20personalization\x20service','✔\x20No\x20changes\x20-\x20\x27','Join\x20on:','information_schema','behaviorsFile','YAML\x20file:\x20','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','attribute','segment:parent:sql','Patching\x20personalization\x20\x27','Enriched:','\x20\x20\x20\x20','\x0aChanges\x20to\x20apply\x20to\x20\x27','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','file','behaviors','\x20to\x20push\x20the\x20configuration','✔\x20Created\x20personalization\x20service\x20\x27','\x27\x20with\x20ID:\x20','platform','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Behavior:','\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','some','\x20+\x20[','payload','identifier','elapsedTimeMillis','idStitching','displaySummary','column','\x20(paused)','Fetching\x20behavior\x20list...','workflowAttemptId','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','limit','No\x20personalizations\x20configured','\x20--attribute\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20configured','ID\x20Stitching:','description','run','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','data','/\x20and\x20','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','getPersonalization','displayPreviewResults','ps:rt:list','\x0aNew\x20parent\x20segment\x20\x27','Session:','SQL\x20query:\x0a','public:','no\x20tokens\x20configured','Resolving\x20parent\x20segment\x20\x27','foreignKey','RT\x202.0\x20Validate:','preview','Error:','keyEventId','Creating\x20token\x20\x27','stop','\x20field','valid','enriched','Update\x20a\x20realtime\x20personalization\x20entity','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','Listing\x20parent\x20segments...','processedRows','deleteToken','workflowId','ps:pz:service:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','endsWith','-1d','map','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','text','stitchingKeys','\x20tdx\x20wf\x20attempt\x20','Attributes:','audienceId','addBehaviors','red','parent_segment','Show\x20personalization\x20service\x20details','schemaValid','stats','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','includeSensitive','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','isDirectory','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20','{\x0a\x20\x20\x22database\x22:\x20\x22','displayBehaviorsStats','status','payload:','Name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','resumeJourney','displayValidateResults','Updating\x20personalization\x20service\x20\x27','Columns:','\x0aError:','✔\x20Updated\x20parent\x20segment\x20\x27','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','✔\x20Retrieved\x20RT\x20configuration\x20version','replace','trim','getParentSQL','Show\x20parent\x20segment\x20schema\x20(column\x20types)','segment:parent:show','eventKind','ps:pz:service:create','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Updating\x20parent\x20segment\x20\x27','Creating\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','segment','tokens','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','coveragePercent','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','ps:pz:show','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Deleting\x20personalization\x20\x27','indexOf','allValid','format','ps:pz:service:token:delete','Error:\x20Service\x20ID\x20is\x20required','rowCount','\x20rows\x20','population','sections','apply','ps:pz:service:token:create','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','parent_id','match','folder-segment','parent_segments','\x20=\x20','includeSensitive:','realtime:','\x0a⚠️\x20\x20Both\x20','Output\x20file:\x20','behavior','attributes','\x20service','✔\x20Deleted\x20token\x20\x27','Master\x20+\x20Attributes','RT\x202.0:','FINISHED','Fetching\x20SQL\x20for\x20\x27','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x0aNo\x20sample\x20data\x20available','updateParent','segment:parent:update','keyEventId:','Available\x20behaviors:','Creating\x20personalization\x20service\x20\x27','\x22,\x20\x22type\x22:\x20\x22','customerGroupFile','Listing\x20personalizations\x20for\x20\x27','✔\x20Renamed\x20directory\x20to\x20','sampleData','\x20\x20\x20\x20-\x20','\x20Configuration\x20is\x20valid','\x0a\x20\x20\x20\x20}','Error:\x20--database\x20and\x20--table\x20are\x20required','Updated','Coverage:','\x20--interval\x20','scheduleType','Error:\x20File\x20not\x20found:\x20','toLocaleString','Status:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','execute','Creating\x20parent\x20segment\x20\x27','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','reduce','displaySampleData','parentSegment','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','ps:pz:service:list','personalizationServices','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','cyan','status:\x20','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','\x0aUsage:\x20tdx\x20ps\x20preview\x20','push','segment:parent:run','workflowSessionId','allowed\x20IPs:','\x20No\x20changes\x20-\x20','/\x20directory.\x0a','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','ps:rt:jn:resume','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','✔\x20Found\x20','label','Next\x20steps:','jsonl','Fetching\x20parent\x20segment\x20\x27','pushParentYaml','\x27\x20(id:\x20','folderId','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','eventKind:\x20','Options\x20(one\x20required):\x0a','RT\x20Journey\x20ID:\x20','localeCompare','Found\x20YAML\x20file:\x20','master','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','jobId','\x20to\x20configure\x20your\x20personalization\x20service','20718990GoLYjA','stringify','error','open','darwin','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Listing\x20fields\x20for\x20\x27','stageCount','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','/app/dw/parentSegments/','Options:','To\x20view\x20sample\x20data:','columns','\x22\x20}','get','last_page_viewed','Schema\x20saved\x20to\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','entryCriteria','Listing\x20RT\x20journeys\x20for\x20\x27','bold','⚡\x20Not\x20enabled','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','xdg-open','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','behavior_','\x20true','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','/{name}.yml\x0a','\x20RT\x20journey','yes','listJourneys','\x20\x201.\x20Edit\x20','SELECT\x20*\x20FROM\x20(\x0a','personalization_services','schemaError','\x0a⚠️\x20\x20Migrating:\x20','List\x20parent\x20segments','displayColumns','\x20is\x20already\x20up\x20to\x20date','\x20RT\x20configuration\x20is\x20valid','green','segment:parent:create','primaryKey','single','scheduleOption','delete','ps:pz:list','name','\x20\x20Note:\x20','createdAt','(id:\x20','To\x20cancel:','using\x20the\x20default\x20path:\x20','1979048PscqHG','<database>.<table>','Behaviors','Error:\x20Token\x20\x27','events','Create\x20a\x20realtime\x20personalization\x20entity','Customers:','displayAttributesStats','315618pxaYxU','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Table:\x20','sourceTableError','personalization','Validating\x20configuration...','json','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\x27...'];a32_0x45ed=function(){return _0x303c5e;};return a32_0x45ed();}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a32_0x308022(0x2c9);['description']=a32_0x308022(0x21b);async[a32_0x308022(0x2df)](_0x2e9995){const _0x2724aa=a32_0x308022,{options:_0x45e3da,args:_0x5e44cd,tdx:_0x194e28}=_0x2e9995;console[_0x2724aa(0x30e)](_0x2724aa(0x3e6)+_0x2724aa(0x2eb)+_0x2724aa(0x215));const _0x2ec09a=_0x45e3da;if(_0x5e44cd['length']===0x0)return console['error'](a32_0x1c520c[_0x2724aa(0x27c)](_0x2724aa(0x2c6))),console[_0x2724aa(0x30e)](_0x2724aa(0x2e8)),0x1;const _0x385635=_0x5e44cd[0x0];_0x2ec09a[_0x2724aa(0x384)]&&(console[_0x2724aa(0x30e)](_0x2724aa(0x36b)+_0x2ec09a[_0x2724aa(0x205)]),console[_0x2724aa(0x30e)]('Parent\x20segment:\x20'+_0x385635));const _0x18842d=await withSpinner(_0x2724aa(0x3b5)+_0x385635+_0x2724aa(0x355),()=>_0x194e28[_0x2724aa(0x2a1)][_0x2724aa(0x3a1)](_0x385635),{'verbose':_0x2ec09a[_0x2724aa(0x384)]}),_0x526635=_0x18842d[_0x2724aa(0x252)],_0x6dd110=await loadJSONFromOptions(_0x2ec09a[_0x2724aa(0x3e8)],_0x2ec09a[_0x2724aa(0x20b)]),_0x2c44c9=await loadJSONFromOptions(_0x2ec09a[_0x2724aa(0x27b)],_0x2ec09a['addBehaviorsFile']),_0x1b0b50={'name':_0x526635[_0x2724aa(0x33c)],'description':_0x2ec09a[_0x2724aa(0x24f)]!==undefined?_0x2ec09a[_0x2724aa(0x24f)]:_0x526635[_0x2724aa(0x24f)],'scheduleType':_0x2ec09a['scheduleType']!==undefined?_0x2ec09a['scheduleType']:_0x526635[_0x2724aa(0x2d9)],'scheduleOption':_0x2ec09a[_0x2724aa(0x339)]!==undefined?_0x2ec09a[_0x2724aa(0x339)]:_0x526635[_0x2724aa(0x339)],'timezone':_0x2ec09a['timezone']!==undefined?_0x2ec09a[_0x2724aa(0x359)]:_0x526635[_0x2724aa(0x359)],'master':_0x526635[_0x2724aa(0x308)],'attributes':_0x6dd110?[..._0x526635[_0x2724aa(0x2bf)]||[],..._0x6dd110]:_0x526635['attributes'],'behaviors':_0x2c44c9?[..._0x526635[_0x2724aa(0x231)]||[],..._0x2c44c9]:_0x526635[_0x2724aa(0x231)],'customerGroup':_0x526635['customerGroup']},_0x1a54f1=await withSpinner(_0x2724aa(0x29e)+_0x385635+_0x2724aa(0x355),()=>_0x194e28['segment'][_0x2724aa(0x2c8)](_0x385635,_0x1b0b50),{'verbose':_0x2ec09a[_0x2724aa(0x384)]}),_0x11bd15=_0x1a54f1['data'];return console[_0x2724aa(0x30e)](_0x2724aa(0x293)+_0x11bd15['name']+'\x27'),await handleSDKOutput([_0x11bd15],_0x2ec09a),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a32_0x308022(0x361);[a32_0x308022(0x24f)]=a32_0x308022(0x366);async[a32_0x308022(0x2df)](_0x4599fb){const _0x16b1c1=a32_0x308022,{options:_0x1971da,args:_0xd0be43,tdx:_0x4544e3}=_0x4599fb,_0x4a1d25=_0x1971da,_0x42fbe3=_0xd0be43[0x0]||_0x1971da[_0x16b1c1(0x2e4)];if(!_0x42fbe3)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'+_0x16b1c1(0x3d4)),0x1;if(_0x4a1d25[_0x16b1c1(0x3a3)]&&_0x4a1d25[_0x16b1c1(0x394)])return console[_0x16b1c1(0x30e)](a32_0x1c520c[_0x16b1c1(0x27c)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console['error'](a32_0x1c520c[_0x16b1c1(0x1e5)]('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console['error'](a32_0x1c520c[_0x16b1c1(0x1e5)](_0x16b1c1(0x341)+PARENT_SEGMENT_DIR+_0x16b1c1(0x328))),console[_0x16b1c1(0x30e)](a32_0x1c520c[_0x16b1c1(0x2e9)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x444a2f=_0x4a1d25[_0x16b1c1(0x394)]||a32_0xb486ae[_0x16b1c1(0x3c1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x42fbe3)+'.yml');_0x4a1d25[_0x16b1c1(0x384)]&&(console[_0x16b1c1(0x30e)]('Site:\x20'+_0x4a1d25[_0x16b1c1(0x205)]),console[_0x16b1c1(0x30e)](_0x16b1c1(0x3e9)+_0x42fbe3),console[_0x16b1c1(0x30e)](_0x16b1c1(0x2bd)+_0x444a2f));const _0x1aff73=await withSpinner(_0x16b1c1(0x2fe)+_0x42fbe3+'\x27...',()=>_0x4544e3[_0x16b1c1(0x2a1)][_0x16b1c1(0x3de)](_0x42fbe3),{'verbose':_0x4a1d25[_0x16b1c1(0x384)]}),_0x3359c5=_0x1aff73[_0x16b1c1(0x252)];if(existsSync(_0x444a2f)){const _0x129764=readFileSync(_0x444a2f,_0x16b1c1(0x3f1)),_0x1b7f40=generateDiff(_0x129764,_0x3359c5);if(!hasChanges(_0x1b7f40))console[_0x16b1c1(0x30e)](a32_0x1c520c[_0x16b1c1(0x335)]('✔')+_0x16b1c1(0x2f4)+a32_0x1c520c[_0x16b1c1(0x2e9)](_0x444a2f)+_0x16b1c1(0x333));else{console[_0x16b1c1(0x30e)]('\x0aChanges\x20to\x20\x27'+_0x444a2f+'\x27:'),console[_0x16b1c1(0x30e)]('─'[_0x16b1c1(0x3b2)](0x3c)),console[_0x16b1c1(0x30e)](formatDiffWithColors(_0x1b7f40)),console[_0x16b1c1(0x30e)]('─'[_0x16b1c1(0x3b2)](0x3c));if(!_0x4a1d25[_0x16b1c1(0x32a)]){if(!isInteractive())return console[_0x16b1c1(0x30e)](a32_0x1c520c['red'](_0x16b1c1(0x292)),_0x16b1c1(0x210)),console[_0x16b1c1(0x30e)](a32_0x1c520c[_0x16b1c1(0x1e5)](_0x16b1c1(0x2dd))),0x1;const _0x294a61=await confirmKey(_0x16b1c1(0x1e7)+_0x444a2f+'\x27?');if(!_0x294a61)return console[_0x16b1c1(0x30e)](a32_0x1c520c[_0x16b1c1(0x1f2)]('Aborted.')),0x1;}writeFileSync(_0x444a2f,_0x3359c5,_0x16b1c1(0x3f1)),console['error'](a32_0x1c520c['green']('✔')+_0x16b1c1(0x283)+a32_0x1c520c['cyan'](_0x444a2f));}}else{const _0x205b75=a32_0xb486ae['dirname'](_0x444a2f);!existsSync(_0x205b75)&&mkdirSync(_0x205b75,{'recursive':!![]}),writeFileSync(_0x444a2f,_0x3359c5,_0x16b1c1(0x3f1)),console[_0x16b1c1(0x30e)](a32_0x1c520c[_0x16b1c1(0x335)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a32_0x1c520c[_0x16b1c1(0x2e9)](_0x444a2f));}return saveSessionContext({'parent_segment':_0x42fbe3},_0x4a1d25['session']),console[_0x16b1c1(0x30e)](a32_0x1c520c[_0x16b1c1(0x335)]('✔')+'\x20Context\x20set:\x20'+a32_0x1c520c[_0x16b1c1(0x1e5)]('parent_segment')+_0x16b1c1(0x2b9)+a32_0x1c520c[_0x16b1c1(0x2e9)](_0x42fbe3)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']=a32_0x308022(0x364);['description']=a32_0x308022(0x39d);async[a32_0x308022(0x2df)](_0x26b30b){const _0x2b96b3=a32_0x308022,{options:_0x3c6815,args:_0x5da69f,tdx:_0x274c34}=_0x26b30b,_0xf7c70d=_0x3c6815,_0x490dfa=_0x5da69f[0x0]||_0x3c6815[_0x2b96b3(0x2e4)];if(!_0x490dfa)return showParentSegmentNotSetError(_0x2b96b3(0x2a0)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x132f8c=resolveYamlFile(_0x490dfa);if(!existsSync(_0x132f8c))return showFileNotFoundError(_0x132f8c,_0x490dfa),0x1;_0xf7c70d[_0x2b96b3(0x384)]&&(console[_0x2b96b3(0x30e)](_0x2b96b3(0x36b)+_0xf7c70d[_0x2b96b3(0x205)]),console['error'](_0x2b96b3(0x227)+_0x132f8c));let _0x202740;try{_0x202740=readFileSync(_0x132f8c,_0x2b96b3(0x3f1));}catch(_0x1e04e0){const _0x5213d9=_0x1e04e0 instanceof Error?_0x1e04e0['message']:String(_0x1e04e0);return console[_0x2b96b3(0x30e)](_0x2b96b3(0x3ac)+_0x5213d9),0x1;}const _0x4a3ef1=await withSpinner('Analyzing\x20changes...',()=>_0x274c34['segment'][_0x2b96b3(0x2ff)](_0x202740),{'verbose':_0xf7c70d[_0x2b96b3(0x384)]}),_0x35d393=_0x4a3ef1['data'],{isNew:_0x1e4db5,name:_0x5506e2,hasChanges:_0x3586b4,diffFormatted:_0x302db9}=_0x35d393;if(!_0x3586b4)return console['error'](_0x2b96b3(0x223)+_0x5506e2+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x1e4db5?console[_0x2b96b3(0x30e)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x5506e2+'\x27:'):console['error'](_0x2b96b3(0x22e)+_0x5506e2+'\x27:');console[_0x2b96b3(0x30e)]('─'['repeat'](0x3c)),console[_0x2b96b3(0x30e)](_0x302db9),console[_0x2b96b3(0x30e)]('─'['repeat'](0x3c));const _0x19fa1c=_0x1e4db5?_0x2b96b3(0x203)+_0x5506e2+'\x27?':_0x2b96b3(0x3c3)+_0x5506e2+'\x27?';if(!_0xf7c70d['yes']){if(!isInteractive())return console['error'](a32_0x1c520c['red'](_0x2b96b3(0x292)),_0x2b96b3(0x210)),console[_0x2b96b3(0x30e)](a32_0x1c520c[_0x2b96b3(0x1e5)](_0x2b96b3(0x2dd))),0x1;const _0x2ffcbc=await confirmKey(_0x19fa1c);if(!_0x2ffcbc)return console[_0x2b96b3(0x30e)](a32_0x1c520c[_0x2b96b3(0x1f2)](_0x2b96b3(0x204))),0x1;}const _0x585534=_0x1e4db5?_0x2b96b3(0x1fc):'Updating',_0x1181b8=await withSpinner(_0x585534+_0x2b96b3(0x221)+_0x5506e2+_0x2b96b3(0x355),()=>_0x35d393['apply'](),{'verbose':_0xf7c70d[_0x2b96b3(0x384)]}),_0x6ec124=_0x1181b8[_0x2b96b3(0x252)],_0x145b08=getConsoleNextUrl(_0xf7c70d[_0x2b96b3(0x205)],_0x2b96b3(0x315)+_0x6ec124['id']),_0x8ff9a6=_0x1e4db5?_0x2b96b3(0x3fd):'Updated';return console[_0x2b96b3(0x30e)]('✔\x20'+_0x8ff9a6+'\x20parent\x20segment\x20\x27'+_0x6ec124[_0x2b96b3(0x33c)]+'\x27'),console[_0x2b96b3(0x30e)]('\x20\x20'+_0x145b08),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a32_0x308022(0x33c)]='segment:parent:validate';[a32_0x308022(0x24f)]=a32_0x308022(0x244);async[a32_0x308022(0x2df)](_0xa33e2d){const _0x17d5b5=a32_0x308022,{options:_0x22f783,args:_0x9c3dfc,tdx:_0x51a1b2}=_0xa33e2d,_0x26e08d=_0x22f783,_0x2bfac8=_0x9c3dfc[0x0]||_0x22f783[_0x17d5b5(0x2e4)];if(!_0x2bfac8)return showParentSegmentNotSetError(_0x17d5b5(0x274)+_0x17d5b5(0x396)+_0x17d5b5(0x39c)+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x17d5b5(0x311)),0x1;const _0x280f26=resolveYamlFile(_0x2bfac8);if(!existsSync(_0x280f26))return showFileNotFoundError(_0x280f26,_0x2bfac8),0x1;_0x26e08d['verbose']&&(console['error']('Site:\x20'+_0x26e08d[_0x17d5b5(0x205)]),console['error']('YAML\x20file:\x20'+_0x280f26));let _0x3db978;try{_0x3db978=readFileSync(_0x280f26,'utf-8');}catch(_0x4cbb85){const _0x1e76f2=_0x4cbb85 instanceof Error?_0x4cbb85[_0x17d5b5(0x391)]:String(_0x4cbb85);return console[_0x17d5b5(0x30e)](_0x17d5b5(0x3ac)+_0x1e76f2),0x1;}const _0x43e6da=createCommandSpinner(a32_0x1c520c['dim'](_0x17d5b5(0x34f)),{'verbose':_0x26e08d['verbose']});_0x43e6da[_0x17d5b5(0x3fa)]();const _0x485afe={'onProgress':_0x4a7234=>{const _0x508cfb=_0x17d5b5;_0x43e6da[_0x508cfb(0x276)]=formatProgressMessage(_0x4a7234);}};if(_0x26e08d['master'])_0x485afe[_0x17d5b5(0x308)]=!![];if(_0x26e08d['enriched'])_0x485afe['enriched']=!![];_0x26e08d[_0x17d5b5(0x229)]&&(_0x485afe[_0x17d5b5(0x229)]=_0x26e08d[_0x17d5b5(0x229)]);_0x26e08d[_0x17d5b5(0x2be)]&&(_0x485afe['behavior']=_0x26e08d[_0x17d5b5(0x2be)]);if(_0x26e08d[_0x17d5b5(0x3bd)])_0x485afe[_0x17d5b5(0x3bd)]=_0x26e08d[_0x17d5b5(0x3bd)];let _0x2e94a0;try{_0x2e94a0=await _0x51a1b2[_0x17d5b5(0x2a1)][_0x17d5b5(0x20e)](_0x3db978,_0x485afe),_0x43e6da[_0x17d5b5(0x265)]();}catch(_0x4e72f9){_0x43e6da[_0x17d5b5(0x265)]();throw _0x4e72f9;}const _0x296a8e=_0x26e08d[_0x17d5b5(0x3bd)]||'-1d';return this['displayValidateResults'](_0x2e94a0,_0x485afe,_0x280f26,_0x296a8e),_0x2e94a0[_0x17d5b5(0x2aa)]?0x0:0x1;}[a32_0x308022(0x28f)](_0x26cfc0,_0x1e7551,_0x247c31,_0x1addc0){const _0x2636be=a32_0x308022;console['error']('\x0a'+a32_0x1c520c[_0x2636be(0x320)](_0x2636be(0x378))+'\x20'+_0x26cfc0['name']),console[_0x2636be(0x30e)]('═'[_0x2636be(0x3b2)](0x3c)),this[_0x2636be(0x3ef)](_0x26cfc0);if(typeof _0x1e7551[_0x2636be(0x229)]===_0x2636be(0x3df)){this[_0x2636be(0x349)](_0x26cfc0),this[_0x2636be(0x23f)](_0x26cfc0),this[_0x2636be(0x201)](_0x247c31,_0x1addc0,_0x2636be(0x229),_0x1e7551[_0x2636be(0x229)]);return;}if(_0x1e7551[_0x2636be(0x229)]===!![]){this[_0x2636be(0x349)](_0x26cfc0),this['displaySummary'](_0x26cfc0),this['displayPreviewHints'](_0x247c31,_0x1addc0,_0x2636be(0x2bf));return;}if(typeof _0x1e7551[_0x2636be(0x2be)]==='string'){this['displayBehaviorsStats'](_0x26cfc0,_0x1addc0),this['displaySummary'](_0x26cfc0),this[_0x2636be(0x201)](_0x247c31,_0x1addc0,_0x2636be(0x2be),_0x1e7551[_0x2636be(0x2be)]);return;}if(_0x1e7551[_0x2636be(0x2be)]===!![]){this[_0x2636be(0x289)](_0x26cfc0,_0x1addc0),this['displaySummary'](_0x26cfc0),this[_0x2636be(0x201)](_0x247c31,_0x1addc0,_0x2636be(0x231));return;}this[_0x2636be(0x349)](_0x26cfc0),this[_0x2636be(0x289)](_0x26cfc0,_0x1addc0),this[_0x2636be(0x371)](_0x26cfc0),this[_0x2636be(0x23f)](_0x26cfc0),this['displayPreviewHints'](_0x247c31,_0x1addc0,'all');}['displayRealtimeInfo'](_0x5e659d){displayRealtimeValidation(_0x5e659d);}[a32_0x308022(0x201)](_0x2fbb55,_0x20d38f,_0x4fcfda,_0xe1307a){const _0x41cb45=a32_0x308022;console['error']('\x0a'+a32_0x1c520c['dim'](_0x41cb45(0x317)));const _0x390d30=_0x20d38f!==_0x41cb45(0x272)?_0x41cb45(0x2d8)+_0x20d38f:'';if(_0x4fcfda===_0x41cb45(0x229)&&_0xe1307a)console['error']('\x20\x20'+a32_0x1c520c['dim'](_0x41cb45(0x1eb)+_0x2fbb55+'\x20--attribute\x20\x22'+_0xe1307a+'\x22'+_0x390d30));else{if(_0x4fcfda===_0x41cb45(0x2be)&&_0xe1307a)console['error']('\x20\x20'+a32_0x1c520c['dim'](_0x41cb45(0x1eb)+_0x2fbb55+_0x41cb45(0x35b)+_0xe1307a+'\x22'+_0x390d30));else(_0x4fcfda===_0x41cb45(0x2bf)||_0x4fcfda===_0x41cb45(0x1e9))&&console[_0x41cb45(0x30e)]('\x20\x20'+a32_0x1c520c[_0x41cb45(0x1e5)](_0x41cb45(0x1eb)+_0x2fbb55+_0x41cb45(0x3d5)+_0x390d30));}(_0x4fcfda===_0x41cb45(0x231)||_0x4fcfda===_0x41cb45(0x1e9))&&console[_0x41cb45(0x30e)]('\x20\x20'+a32_0x1c520c[_0x41cb45(0x1e5)](_0x41cb45(0x1eb)+_0x2fbb55+_0x41cb45(0x21d)+_0x390d30)),_0x4fcfda===_0x41cb45(0x1e9)&&console[_0x41cb45(0x30e)]('\x20\x20'+a32_0x1c520c[_0x41cb45(0x1e5)](_0x41cb45(0x1eb)+_0x2fbb55+'\x20--enriched'+_0x390d30));}[a32_0x308022(0x3ef)](_0x3b1442){const _0x4d00d6=a32_0x308022,{master:_0x196a8d}=_0x3b1442,_0x3aa9f9=_0x196a8d[_0x4d00d6(0x27f)]?a32_0x1c520c[_0x4d00d6(0x335)]('✔'):a32_0x1c520c[_0x4d00d6(0x27c)]('✘');console[_0x4d00d6(0x30e)]('\x0a'+a32_0x1c520c[_0x4d00d6(0x1e5)](_0x4d00d6(0x360))),console[_0x4d00d6(0x30e)](_0x3aa9f9+'\x20'+a32_0x1c520c[_0x4d00d6(0x320)](_0x196a8d[_0x4d00d6(0x356)]+'.'+_0x196a8d[_0x4d00d6(0x3f7)])),_0x196a8d[_0x4d00d6(0x27f)]?_0x196a8d['rowCount']!==undefined&&console[_0x4d00d6(0x30e)]('\x20\x20'+a32_0x1c520c[_0x4d00d6(0x1e5)](_0x4d00d6(0x3d0))+'\x20'+a32_0x1c520c['cyan'](formatRows(_0x196a8d[_0x4d00d6(0x2ae)]))):console['error']('\x20\x20'+a32_0x1c520c[_0x4d00d6(0x27c)](_0x4d00d6(0x262))+'\x20'+_0x196a8d[_0x4d00d6(0x32f)]);}[a32_0x308022(0x349)](_0x65f71d){const _0x558292=a32_0x308022;if(_0x65f71d['attributes'][_0x558292(0x3f5)]===0x0)return;console['error']('\x0a'+a32_0x1c520c[_0x558292(0x1e5)](_0x558292(0x3b3)));for(const _0x4ca4d6 of _0x65f71d[_0x558292(0x2bf)]){const _0x477092=_0x4ca4d6[_0x558292(0x27f)]?a32_0x1c520c[_0x558292(0x335)]('✔'):a32_0x1c520c[_0x558292(0x27c)]('✘');let _0x374a77='';if(_0x4ca4d6[_0x558292(0x27f)]&&_0x4ca4d6['matchedCount']!==undefined&&_0x4ca4d6[_0x558292(0x2a4)]!==undefined){const _0x1b6916=_0x4ca4d6[_0x558292(0x2a4)][_0x558292(0x3a6)](0x1),_0x59727d=_0x4ca4d6[_0x558292(0x2a4)]>=0x50?a32_0x1c520c['green']:_0x4ca4d6[_0x558292(0x2a4)]>=0x32?a32_0x1c520c[_0x558292(0x1f2)]:a32_0x1c520c['red'];_0x374a77='\x20'+a32_0x1c520c[_0x558292(0x1e5)](_0x558292(0x2d7))+'\x20'+_0x59727d(_0x1b6916+'%')+'\x20('+formatRows(_0x4ca4d6[_0x558292(0x3c4)])+'\x20rows)';}console[_0x558292(0x30e)](_0x477092+'\x20'+a32_0x1c520c[_0x558292(0x320)](_0x4ca4d6[_0x558292(0x33c)])+_0x374a77),console[_0x558292(0x30e)]('\x20\x20'+a32_0x1c520c['dim']('Source:')+'\x20'+a32_0x1c520c['bold'](_0x4ca4d6[_0x558292(0x356)]+'.'+_0x4ca4d6[_0x558292(0x3f7)]));const _0x2a06c8=_0x4ca4d6[_0x558292(0x390)]===_0x4ca4d6[_0x558292(0x25f)]?a32_0x1c520c[_0x558292(0x1e5)](_0x558292(0x224))+'\x20'+_0x4ca4d6[_0x558292(0x390)]:a32_0x1c520c[_0x558292(0x1e5)](_0x558292(0x367))+'\x20'+_0x4ca4d6[_0x558292(0x390)]+_0x558292(0x2b9)+_0x4ca4d6[_0x558292(0x25f)];console[_0x558292(0x30e)]('\x20\x20'+_0x2a06c8),console[_0x558292(0x30e)]('\x20\x20'+a32_0x1c520c['dim'](_0x558292(0x291))),this[_0x558292(0x332)](_0x4ca4d6['columns']),!_0x4ca4d6[_0x558292(0x27f)]&&console['error']('\x20\x20'+a32_0x1c520c[_0x558292(0x27c)](_0x558292(0x262))+'\x20'+_0x4ca4d6[_0x558292(0x32f)]);}}[a32_0x308022(0x289)](_0x438443,_0x1002c8){const _0x221df7=a32_0x308022;if(_0x438443['behaviors'][_0x221df7(0x3f5)]===0x0)return;console['error']('\x0a'+a32_0x1c520c[_0x221df7(0x1e5)](_0x221df7(0x344))+'\x20'+a32_0x1c520c[_0x221df7(0x1e5)]('('+_0x1002c8+')'));for(const _0x4afb4b of _0x438443[_0x221df7(0x231)]){const _0x36f57d=_0x4afb4b[_0x221df7(0x27f)]?a32_0x1c520c['green']('✔'):a32_0x1c520c[_0x221df7(0x27c)]('✘');let _0x15e917='';if(_0x4afb4b['schemaValid']&&_0x4afb4b['customersWithEvents']!==undefined&&_0x4afb4b[_0x221df7(0x1f0)]!==undefined){const _0xac2808=_0x4afb4b[_0x221df7(0x3ea)]?.[_0x221df7(0x3a6)](0x1)||'?',_0xe89814=(_0x4afb4b[_0x221df7(0x3ea)]??0x0)>=0x32?a32_0x1c520c[_0x221df7(0x335)]:(_0x4afb4b[_0x221df7(0x3ea)]??0x0)>=0x14?a32_0x1c520c['yellow']:a32_0x1c520c[_0x221df7(0x27c)];_0x15e917='\x20'+a32_0x1c520c[_0x221df7(0x1e5)](_0x221df7(0x348))+'\x20'+_0xe89814(formatRows(_0x4afb4b['customersWithEvents']))+'\x20('+_0xac2808+_0x221df7(0x1ff)+a32_0x1c520c[_0x221df7(0x1e5)](_0x221df7(0x3aa))+'\x20'+a32_0x1c520c['cyan'](formatRows(_0x4afb4b['totalEvents']));}console[_0x221df7(0x30e)](_0x36f57d+'\x20'+a32_0x1c520c[_0x221df7(0x320)](_0x4afb4b[_0x221df7(0x33c)])+_0x15e917),console[_0x221df7(0x30e)]('\x20\x20'+a32_0x1c520c[_0x221df7(0x1e5)]('Source:')+'\x20'+a32_0x1c520c[_0x221df7(0x320)](_0x4afb4b[_0x221df7(0x356)]+'.'+_0x4afb4b[_0x221df7(0x3f7)]));const _0x557f80=_0x4afb4b[_0x221df7(0x390)]===_0x4afb4b[_0x221df7(0x25f)]?a32_0x1c520c[_0x221df7(0x1e5)]('Join\x20on:')+'\x20'+_0x4afb4b[_0x221df7(0x390)]:a32_0x1c520c['dim'](_0x221df7(0x367))+'\x20'+_0x4afb4b[_0x221df7(0x390)]+'\x20=\x20'+_0x4afb4b[_0x221df7(0x25f)];console[_0x221df7(0x30e)]('\x20\x20'+_0x557f80),console[_0x221df7(0x30e)]('\x20\x20'+a32_0x1c520c[_0x221df7(0x1e5)](_0x221df7(0x291))),this[_0x221df7(0x332)](_0x4afb4b[_0x221df7(0x318)]),!_0x4afb4b[_0x221df7(0x27f)]&&console['error']('\x20\x20'+a32_0x1c520c[_0x221df7(0x27c)]('Error:')+'\x20'+_0x4afb4b[_0x221df7(0x32f)]);}}[a32_0x308022(0x332)](_0x5a1d6f){const _0x1b80bb=a32_0x308022;for(const _0x156f02 of _0x5a1d6f){_0x156f02['label']===_0x156f02['column']||_0x156f02['column']==='*'?console[_0x1b80bb(0x30e)](_0x1b80bb(0x2d2)+_0x156f02[_0x1b80bb(0x2fb)]):console[_0x1b80bb(0x30e)]('\x20\x20\x20\x20-\x20'+_0x156f02[_0x1b80bb(0x2fb)]+'\x20'+a32_0x1c520c['dim']('('+_0x156f02[_0x1b80bb(0x240)]+')'));}}[a32_0x308022(0x23f)](_0x533e1d){const _0x3ea4c7=a32_0x308022;console[_0x3ea4c7(0x30e)]('─'['repeat'](0x3c));if(_0x533e1d[_0x3ea4c7(0x206)][_0x3ea4c7(0x3f5)]>0x0){console[_0x3ea4c7(0x30e)]('\x0a'+a32_0x1c520c[_0x3ea4c7(0x27c)](_0x3ea4c7(0x372)));for(const _0x239a38 of _0x533e1d[_0x3ea4c7(0x206)]){console[_0x3ea4c7(0x30e)]('\x20\x20'+a32_0x1c520c['red']('•')+'\x20'+_0x239a38);}}_0x533e1d['allValid']&&console['error']('\x0a'+a32_0x1c520c[_0x3ea4c7(0x335)]('✔')+_0x3ea4c7(0x2d3));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a32_0x308022(0x37c);[a32_0x308022(0x24f)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async[a32_0x308022(0x2df)](_0x1f8148){const _0x532bc1=a32_0x308022,{options:_0xe0688c,args:_0x41a88e,tdx:_0x2d2ca0}=_0x1f8148,_0x3a07d3=_0xe0688c,_0xc38da4=_0x41a88e[0x0]||_0xe0688c[_0x532bc1(0x2e4)];if(!_0xc38da4)return showParentSegmentNotSetError(_0x532bc1(0x3d3)+_0x532bc1(0x380)+_0x532bc1(0x304)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x532bc1(0x251)+_0x532bc1(0x38e)+_0x532bc1(0x2ec)+_0x532bc1(0x311)),0x1;if(!_0x3a07d3[_0x532bc1(0x308)]&&!_0x3a07d3['attribute']&&!_0x3a07d3[_0x532bc1(0x2be)]&&!_0x3a07d3[_0x532bc1(0x268)])return console[_0x532bc1(0x30e)](a32_0x1c520c[_0x532bc1(0x27c)](_0x532bc1(0x2e1))),console[_0x532bc1(0x30e)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x532bc1(0x30e)](_0x532bc1(0x316)),console['error'](_0x532bc1(0x3ba)),console['error']('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x532bc1(0x30e)](_0x532bc1(0x3d7)),console[_0x532bc1(0x30e)](_0x532bc1(0x302)),0x1;const _0xb4548c=resolveYamlFile(_0xc38da4);if(!existsSync(_0xb4548c))return showFileNotFoundError(_0xb4548c,_0xc38da4),0x1;_0x3a07d3[_0x532bc1(0x384)]&&(console[_0x532bc1(0x30e)](_0x532bc1(0x36b)+_0x3a07d3['site']),console[_0x532bc1(0x30e)](_0x532bc1(0x227)+_0xb4548c));let _0x3c9459;try{_0x3c9459=readFileSync(_0xb4548c,'utf-8');}catch(_0x4fe355){const _0x2fe496=_0x4fe355 instanceof Error?_0x4fe355[_0x532bc1(0x391)]:String(_0x4fe355);return console[_0x532bc1(0x30e)](_0x532bc1(0x3ac)+_0x2fe496),0x1;}let _0x5caf3c;try{_0x5caf3c=parseDef(_0x3c9459);}catch(_0x545342){const _0x47ab58=_0x545342 instanceof Error?_0x545342['message']:String(_0x545342);return console[_0x532bc1(0x30e)](a32_0x1c520c[_0x532bc1(0x27c)](_0x532bc1(0x1f3)+_0x47ab58)),0x1;}if(_0x3a07d3[_0x532bc1(0x229)]===!![]||_0x3a07d3[_0x532bc1(0x229)]===''){const _0x2bba80=_0x5caf3c['attributes']?.[_0x532bc1(0x273)](_0x32a181=>_0x32a181['name'])||[];if(_0x2bba80['length']===0x0)console[_0x532bc1(0x30e)](a32_0x1c520c[_0x532bc1(0x27c)](_0x532bc1(0x247)));else{console['error'](a32_0x1c520c[_0x532bc1(0x27c)](_0x532bc1(0x285))),console[_0x532bc1(0x30e)]('Available\x20attributes:');for(const _0x51d2cb of _0x2bba80){console[_0x532bc1(0x30e)]('\x20\x20'+a32_0x1c520c['cyan'](_0x51d2cb));}console[_0x532bc1(0x30e)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0xc38da4+_0x532bc1(0x24a)+_0x2bba80[0x0]+'\x22');}return 0x1;}if(_0x3a07d3[_0x532bc1(0x2be)]===!![]||_0x3a07d3[_0x532bc1(0x2be)]===''){const _0x4a5aef=_0x5caf3c['behaviors']?.[_0x532bc1(0x273)](_0x636e75=>_0x636e75[_0x532bc1(0x33c)])||[];if(_0x4a5aef[_0x532bc1(0x3f5)]===0x0)console[_0x532bc1(0x30e)](a32_0x1c520c['red'](_0x532bc1(0x1ed)));else{console['error'](a32_0x1c520c[_0x532bc1(0x27c)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x532bc1(0x30e)](_0x532bc1(0x2cb));for(const _0x38a1c3 of _0x4a5aef){console['error']('\x20\x20'+a32_0x1c520c[_0x532bc1(0x2e9)](_0x38a1c3));}console[_0x532bc1(0x30e)](_0x532bc1(0x2ef)+_0xc38da4+'\x20--behavior\x20\x22'+_0x4a5aef[0x0]+'\x22');}return 0x1;}const _0x57dea6=createCommandSpinner(a32_0x1c520c[_0x532bc1(0x1e5)](_0x532bc1(0x3b7)),{'verbose':_0x3a07d3[_0x532bc1(0x384)]});_0x57dea6['start']();const _0x1976c3={'onProgress':_0x42ea68=>{const _0x3081ee=_0x532bc1;_0x57dea6[_0x3081ee(0x276)]=formatProgressMessage(_0x42ea68);}};if(_0x3a07d3[_0x532bc1(0x308)])_0x1976c3['master']=!![];if(_0x3a07d3[_0x532bc1(0x229)]&&typeof _0x3a07d3['attribute']===_0x532bc1(0x3df))_0x1976c3[_0x532bc1(0x229)]=_0x3a07d3['attribute'];if(_0x3a07d3['behavior']&&typeof _0x3a07d3[_0x532bc1(0x2be)]===_0x532bc1(0x3df))_0x1976c3[_0x532bc1(0x2be)]=_0x3a07d3['behavior'];if(_0x3a07d3['enriched'])_0x1976c3[_0x532bc1(0x268)]=!![];if(_0x3a07d3[_0x532bc1(0x3bd)])_0x1976c3[_0x532bc1(0x3bd)]=_0x3a07d3['interval'];let _0x3b7289;try{_0x3b7289=await _0x2d2ca0['segment']['previewParentYaml'](_0x3c9459,_0x1976c3),_0x57dea6['stop']();}catch(_0x36e80e){_0x57dea6[_0x532bc1(0x265)]();throw _0x36e80e;}return await this[_0x532bc1(0x257)](_0x3b7289,{'master':_0x3a07d3['master'],'attribute':typeof _0x3a07d3[_0x532bc1(0x229)]===_0x532bc1(0x3df)?_0x3a07d3[_0x532bc1(0x229)]:undefined,'behavior':typeof _0x3a07d3[_0x532bc1(0x2be)]===_0x532bc1(0x3df)?_0x3a07d3[_0x532bc1(0x2be)]:undefined,'enriched':_0x3a07d3[_0x532bc1(0x268)]}),_0x3b7289[_0x532bc1(0x2aa)]?0x0:0x1;}async[a32_0x308022(0x257)](_0x274e42,_0x4c16e2){const _0x36f715=a32_0x308022;console[_0x36f715(0x30e)]('\x0a'+a32_0x1c520c[_0x36f715(0x320)](_0x36f715(0x217))+'\x20'+_0x274e42[_0x36f715(0x33c)]),console[_0x36f715(0x30e)]('═'['repeat'](0x3c));if(_0x4c16e2['master']&&_0x274e42['sampleData']){const _0xc60370=a32_0x1c520c[_0x36f715(0x1e5)]('Master:')+'\x20'+a32_0x1c520c[_0x36f715(0x320)](_0x274e42[_0x36f715(0x308)][_0x36f715(0x356)]+'.'+_0x274e42[_0x36f715(0x308)][_0x36f715(0x3f7)]);await this[_0x36f715(0x2e3)](_0xc60370,_0x274e42[_0x36f715(0x2d1)]);}else{if(_0x4c16e2[_0x36f715(0x229)]&&_0x274e42[_0x36f715(0x2d1)]){const _0x4b7396=a32_0x1c520c[_0x36f715(0x1e5)]('Attribute:')+'\x20'+a32_0x1c520c[_0x36f715(0x320)](_0x4c16e2[_0x36f715(0x229)]);await this['displaySampleData'](_0x4b7396,_0x274e42[_0x36f715(0x2d1)]);}else{if(_0x4c16e2[_0x36f715(0x2be)]&&_0x274e42['sampleData']){const _0x761e0c=a32_0x1c520c[_0x36f715(0x1e5)](_0x36f715(0x237))+'\x20'+a32_0x1c520c['bold'](_0x4c16e2['behavior']);await this[_0x36f715(0x2e3)](_0x761e0c,_0x274e42[_0x36f715(0x2d1)]);}else{if(_0x4c16e2[_0x36f715(0x268)]&&_0x274e42[_0x36f715(0x2d1)]){const _0x482cdf=a32_0x1c520c['dim'](_0x36f715(0x22c))+'\x20'+a32_0x1c520c[_0x36f715(0x320)](_0x36f715(0x2c2));await this[_0x36f715(0x2e3)](_0x482cdf,_0x274e42[_0x36f715(0x2d1)]);}else!_0x274e42['sampleData']&&console[_0x36f715(0x30e)](_0x36f715(0x2c7));}}}if(_0x274e42[_0x36f715(0x206)][_0x36f715(0x3f5)]>0x0){console[_0x36f715(0x30e)]('─'['repeat'](0x3c)),console['error']('\x0a'+a32_0x1c520c[_0x36f715(0x27c)](_0x36f715(0x372)));for(const _0x57b02a of _0x274e42[_0x36f715(0x206)]){console[_0x36f715(0x30e)]('\x20\x20'+a32_0x1c520c[_0x36f715(0x27c)]('•')+'\x20'+_0x57b02a);}}}async[a32_0x308022(0x2e3)](_0x175fa8,_0x79c51){const _0x23a9d8=a32_0x308022;if(_0x79c51[_0x23a9d8(0x3f5)]===0x0){console[_0x23a9d8(0x30e)]('\x0a'+_0x175fa8),console[_0x23a9d8(0x30e)](_0x23a9d8(0x3c6));return;}console[_0x23a9d8(0x30e)]('\x0a'+_0x175fa8);const _0xed8729=Object[_0x23a9d8(0x211)](_0x79c51[0x0])['map'](_0x579ac0=>({'name':_0x579ac0,'type':typeof _0x79c51[0x0][_0x579ac0]==='number'?'double':_0x23a9d8(0x374)})),_0x4f6c01={'queryId':_0x23a9d8(0x261),'columns':_0xed8729,'data':_0x79c51,'stats':{'state':_0x23a9d8(0x2c4),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x79c51[_0x23a9d8(0x3f5)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x3799d6=formatAsTable(_0x4f6c01,_0x79c51['length'],!![]);await writeOutput(_0x3799d6,undefined,_0x23a9d8(0x3f7));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x2f1);[a32_0x308022(0x24f)]=a32_0x308022(0x352);async[a32_0x308022(0x2df)](_0x323302){const _0x483184=a32_0x308022,{options:_0x3e36c4,args:_0x1b59e9,tdx:_0x3338b7}=_0x323302,_0x452375=_0x3e36c4,_0x38490a=_0x1b59e9[0x0]||_0x3e36c4['parentSegment'];if(!_0x38490a)return showParentSegmentNotSetError(_0x483184(0x35d)+_0x483184(0x286)),0x1;const _0x46839b=resolveYamlFile(_0x38490a);if(existsSync(_0x46839b)){_0x452375[_0x483184(0x384)]&&console[_0x483184(0x30e)](_0x483184(0x307)+_0x46839b);let _0x2f6f25;try{_0x2f6f25=readFileSync(_0x46839b,_0x483184(0x3f1));}catch(_0x52d345){const _0x1d5871=_0x52d345 instanceof Error?_0x52d345[_0x483184(0x391)]:String(_0x52d345);return console[_0x483184(0x30e)]('Error\x20reading\x20file:\x20'+_0x1d5871),0x1;}const _0x210aea=await withSpinner(_0x483184(0x35f),()=>_0x3338b7[_0x483184(0x2a1)][_0x483184(0x2ff)](_0x2f6f25),{'verbose':_0x452375[_0x483184(0x384)]}),_0x49834f=_0x210aea[_0x483184(0x252)],{isNew:_0x18a834,name:_0x29640e,hasChanges:_0x196b62,diffFormatted:_0x32697e}=_0x49834f;if(_0x196b62){_0x18a834?console[_0x483184(0x30e)](_0x483184(0x259)+_0x29640e+'\x27:'):console[_0x483184(0x30e)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x29640e+'\x27:');console[_0x483184(0x30e)]('─'[_0x483184(0x3b2)](0x3c)),console['error'](_0x32697e),console[_0x483184(0x30e)]('─'[_0x483184(0x3b2)](0x3c));const _0xa0736b=_0x18a834?_0x483184(0x203)+_0x29640e+_0x483184(0x3b1):_0x483184(0x3c3)+_0x29640e+'\x27\x20and\x20run\x20workflow?';if(!_0x452375[_0x483184(0x32a)]){if(!isInteractive())return console[_0x483184(0x30e)](a32_0x1c520c[_0x483184(0x27c)](_0x483184(0x292)),_0x483184(0x210)),console[_0x483184(0x30e)](a32_0x1c520c['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x7f6bdb=await confirmKey(_0xa0736b);if(!_0x7f6bdb)return console[_0x483184(0x30e)](a32_0x1c520c[_0x483184(0x1f2)](_0x483184(0x204))),0x1;}const _0x3a75f8=_0x18a834?'Creating':_0x483184(0x1f1);await withSpinner(_0x3a75f8+_0x483184(0x221)+_0x29640e+'\x27...',()=>_0x49834f[_0x483184(0x2b2)](),{'verbose':_0x452375['verbose']});const _0x446605=_0x18a834?_0x483184(0x3fd):_0x483184(0x2d6);console['error']('✔\x20'+_0x446605+_0x483184(0x221)+_0x29640e+'\x27');}else console[_0x483184(0x30e)](_0x483184(0x223)+_0x29640e+'\x27\x20is\x20up\x20to\x20date');}const _0x208505=await withSpinner(_0x483184(0x246)+_0x38490a+_0x483184(0x355),()=>_0x3338b7[_0x483184(0x2a1)]['runParent'](_0x38490a),{'verbose':_0x452375[_0x483184(0x384)]}),_0x43cf74=_0x208505[_0x483184(0x252)],_0x2f5a95=getConsoleUrl(_0x452375[_0x483184(0x205)],'/app/workflows/'+_0x43cf74[_0x483184(0x26e)]+_0x483184(0x3be)+_0x43cf74[_0x483184(0x2f2)]+_0x483184(0x400)+_0x43cf74[_0x483184(0x243)]);return console[_0x483184(0x30e)]('\x0a✔\x20Workflow\x20started'),console[_0x483184(0x30e)]('\x20\x20'+a32_0x1c520c[_0x483184(0x1e5)](_0x483184(0x3c0))+'\x20'+_0x43cf74[_0x483184(0x27a)]),console[_0x483184(0x30e)]('\x20\x20'+a32_0x1c520c[_0x483184(0x1e5)](_0x483184(0x2dc))+'\x20'+_0x43cf74[_0x483184(0x28a)]),console['error']('\x20\x20'+a32_0x1c520c[_0x483184(0x1e5)](_0x483184(0x25a))+'\x20'+_0x43cf74[_0x483184(0x2f2)]),console['error']('\x20\x20'+a32_0x1c520c['dim']('Attempt:')+'\x20'+_0x43cf74[_0x483184(0x243)]),console[_0x483184(0x30e)]('\x20\x20'+_0x2f5a95),console[_0x483184(0x30e)]('\x0a'+a32_0x1c520c[_0x483184(0x1e5)](_0x483184(0x340))+_0x483184(0x278)+_0x43cf74[_0x483184(0x243)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x38d);[a32_0x308022(0x24f)]=a32_0x308022(0x1f7);async[a32_0x308022(0x2df)](_0x6f2d1c){const _0x333e7c=a32_0x308022,{options:_0x3c6682,args:_0x2ec38e,tdx:_0x2e61d6}=_0x6f2d1c,_0x65c314=_0x2ec38e[0x0]||_0x3c6682[_0x333e7c(0x2e4)];if(!_0x65c314)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x333e7c(0x213)),0x1;_0x3c6682[_0x333e7c(0x384)]&&(console[_0x333e7c(0x30e)](_0x333e7c(0x36b)+_0x3c6682[_0x333e7c(0x205)]),console['error']('Parent\x20segment:\x20'+_0x65c314));const _0x926191=await withSpinner(_0x333e7c(0x312)+_0x65c314+'\x27...',()=>_0x2e61d6[_0x333e7c(0x2a1)][_0x333e7c(0x3bc)](_0x65c314),{'verbose':_0x3c6682['verbose']}),_0x50ad2e=_0x926191[_0x333e7c(0x252)];console[_0x333e7c(0x30e)]('✔\x20Found\x20'+_0x50ad2e['length']+_0x333e7c(0x266)+(_0x50ad2e[_0x333e7c(0x3f5)]!==0x1?'s':''));if(_0x3c6682[_0x333e7c(0x350)]||_0x3c6682[_0x333e7c(0x2fd)])return await handleSDKOutput(_0x50ad2e,_0x3c6682),0x0;return displayFieldsHumanReadable(_0x50ad2e,_0x65c314),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x38c);[a32_0x308022(0x24f)]=a32_0x308022(0x3fb);async[a32_0x308022(0x2df)](_0x3f6362){const _0x5b4e23=a32_0x308022,{options:_0x32c003,args:_0x320fda,tdx:_0x141b8e}=_0x3f6362,_0x40d01f=_0x32c003,_0xebbaf8=_0x320fda[0x0]||_0x32c003[_0x5b4e23(0x2e4)];if(!_0xebbaf8)return showParentSegmentNotSetError(_0x5b4e23(0x29d)+_0x5b4e23(0x37e)+'Options:\x0a'+_0x5b4e23(0x281)),0x1;_0x32c003['verbose']&&(console[_0x5b4e23(0x30e)](_0x5b4e23(0x36b)+_0x32c003['site']),console['error'](_0x5b4e23(0x3e9)+_0xebbaf8));const _0x425d1d=await withSpinner(_0x5b4e23(0x2fe)+_0xebbaf8+_0x5b4e23(0x355),()=>_0x141b8e['segment'][_0x5b4e23(0x3a1)](_0xebbaf8),{'verbose':_0x32c003['verbose']}),_0x4f359d=_0x425d1d[_0x5b4e23(0x252)];if(_0x40d01f['web']){const _0x5f27d4=getConsoleNextUrl(_0x40d01f[_0x5b4e23(0x205)],'/app/dw/parentSegments/'+_0x4f359d['id']);return console['error'](a32_0x1c520c['green']('✔')+'\x20Opening\x20'+a32_0x1c520c[_0x5b4e23(0x2e9)](_0x5f27d4)),openBrowser(_0x5f27d4),0x0;}return await handleSingleObjectOutput(_0x4f359d,_0x32c003),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';['description']=a32_0x308022(0x299);async[a32_0x308022(0x2df)](_0x435157){const _0xa53716=a32_0x308022,{options:_0x3ea2a5,args:_0x3e754b,tdx:_0x4b408c}=_0x435157,_0x6eb437=_0x3ea2a5,_0x123f63=_0x3e754b[0x0]||_0x3ea2a5['parentSegment'];if(!_0x123f63)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'+_0xa53716(0x324)+_0xa53716(0x39c)+_0xa53716(0x31d)),0x1;_0x3ea2a5[_0xa53716(0x384)]&&(console['error'](_0xa53716(0x36b)+_0x3ea2a5[_0xa53716(0x205)]),console['error']('Parent\x20segment:\x20'+_0x123f63));const _0xd7aa9c=await withSpinner(_0xa53716(0x25e)+_0x123f63+_0xa53716(0x355),()=>_0x4b408c['segment'][_0xa53716(0x362)](_0x123f63),{'verbose':_0x3ea2a5[_0xa53716(0x384)]}),_0x1ec6ba=_0xd7aa9c[_0xa53716(0x252)],_0x424a86=_0x4b408c['segment']['getOutputDatabaseName'](_0x1ec6ba);if(_0x6eb437[_0xa53716(0x394)]){const _0x374356=await this[_0xa53716(0x3ab)](_0x435157,_0x123f63,_0x1ec6ba,_0x424a86),_0x246ab2=this[_0xa53716(0x208)](_0x374356);writeFileSync(_0x6eb437[_0xa53716(0x394)],_0x246ab2);const _0x39416a=_0x374356[_0xa53716(0x383)][_0xa53716(0x318)][_0xa53716(0x3f5)]+_0x374356[_0xa53716(0x231)][_0xa53716(0x2e2)]((_0x1f821d,_0xb8b40a)=>_0x1f821d+_0xb8b40a['columns'][_0xa53716(0x3f5)],0x0),_0xaa284b=_0x374356[_0xa53716(0x231)][_0xa53716(0x37a)](_0xaa0e20=>_0xaa0e20[_0xa53716(0x318)][_0xa53716(0x3f5)]===0x0)[_0xa53716(0x3f5)];return console[_0xa53716(0x3d2)](_0xa53716(0x31c)+_0x6eb437['output']),console[_0xa53716(0x3d2)]('\x20\x20Database:\x20'+_0x424a86),console[_0xa53716(0x3d2)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x374356[_0xa53716(0x231)][_0xa53716(0x3f5)]+_0xa53716(0x1ec)),console[_0xa53716(0x3d2)]('\x20\x20Columns:\x20'+_0x39416a+_0xa53716(0x1f9)),_0xaa284b>0x0&&console['log'](_0xa53716(0x33d)+_0xaa284b+_0xa53716(0x24c)),0x0;}console[_0xa53716(0x30e)]('\x0a'+a32_0x1c520c[_0xa53716(0x320)](_0xa53716(0x369))+'\x20'+a32_0x1c520c['cyan'](_0x424a86));const _0xcfb0c5=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x4b408c[_0xa53716(0x2a1)]['getParentSQL'](_0x1ec6ba),{'verbose':_0x3ea2a5[_0xa53716(0x384)]});console[_0xa53716(0x30e)]('\x0a'+a32_0x1c520c[_0xa53716(0x320)](_0xa53716(0x383))+'\x20'+a32_0x1c520c[_0xa53716(0x1e5)]('('+_0x424a86+'.customers)'));const _0xf8ddc4=await executeSchemaQuery(_0xcfb0c5[_0xa53716(0x252)],_0x4b408c,_0x3ea2a5);await handleQueryOutput(_0xf8ddc4,_0x3ea2a5);const _0x3577e7=await withSpinner(_0xa53716(0x242),()=>_0x4b408c[_0xa53716(0x2a1)][_0xa53716(0x39e)](_0x1ec6ba),{'verbose':_0x3ea2a5[_0xa53716(0x384)]});for(const _0x483c0e of _0x3577e7['data']){const _0x426319=_0xa53716(0x325)+_0x483c0e['toLowerCase']()[_0xa53716(0x296)](/\s+/g,'_'),_0x3cd7c8=_0xa53716(0x377)+_0x424a86+'.'+_0x426319;console[_0xa53716(0x30e)]('\x0a'+a32_0x1c520c[_0xa53716(0x320)](_0x483c0e)+'\x20'+a32_0x1c520c['dim']('('+_0x424a86+'.'+_0x426319+')'));try{const _0x53a9f6=await executeSchemaQuery(_0x3cd7c8,_0x4b408c,_0x3ea2a5);await handleQueryOutput(_0x53a9f6,_0x3ea2a5);}catch{console[_0xa53716(0x30e)](a32_0x1c520c[_0xa53716(0x1f2)](_0xa53716(0x2f6)));}}return 0x0;}async['collectSchema'](_0x2c761d,_0x411bdc,_0x26c471,_0x1a11f7){const _0x53b73a=a32_0x308022,{options:_0x1ba72e,tdx:_0x1c39b1}=_0x2c761d,_0x149faa=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x1c39b1[_0x53b73a(0x2a1)]['getParentSQL'](_0x26c471),{'verbose':_0x1ba72e[_0x53b73a(0x384)]}),_0x582e08=await executeSchemaQuery(_0x149faa[_0x53b73a(0x252)],_0x1c39b1,_0x1ba72e),_0x1fac2b=_0x582e08[_0x53b73a(0x252)][_0x53b73a(0x273)](_0x48ddff=>({'name':_0x48ddff['column_name'],'type':_0x48ddff['column_type']})),_0x3570a2=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x1c39b1[_0x53b73a(0x2a1)][_0x53b73a(0x39e)](_0x26c471),{'verbose':_0x1ba72e[_0x53b73a(0x384)]}),_0x4083ad=[];for(const _0x139e3b of _0x3570a2[_0x53b73a(0x252)]){const _0x28bea2='behavior_'+_0x139e3b[_0x53b73a(0x3da)]()[_0x53b73a(0x296)](/\s+/g,'_'),_0x7f31f0=_0x53b73a(0x377)+_0x1a11f7+'.'+_0x28bea2;let _0x64ea96=[];try{const _0x3a2e63=await executeSchemaQuery(_0x7f31f0,_0x1c39b1,_0x1ba72e);_0x64ea96=_0x3a2e63[_0x53b73a(0x252)][_0x53b73a(0x273)](_0x17eebd=>({'name':_0x17eebd[_0x53b73a(0x3ff)],'type':_0x17eebd[_0x53b73a(0x3cf)]}));}catch{}_0x4083ad[_0x53b73a(0x2f0)]({'table':_0x28bea2,'columns':_0x64ea96});}return{'database':_0x1a11f7,'parent_segment':_0x411bdc,'parent_id':_0x26c471,'customers':{'table':_0x53b73a(0x383),'columns':_0x1fac2b},'behaviors':_0x4083ad};}['formatSchemaJson'](_0x6a39fb){const _0x2bb9da=a32_0x308022,_0x4ce8ad=_0x52e0dd=>{const _0x1307f9=a32_0x4528;if(_0x52e0dd[_0x1307f9(0x3f5)]===0x0)return'[]';const _0x4e0602=_0x52e0dd[_0x1307f9(0x273)](_0x41d6f9=>_0x1307f9(0x351)+_0x41d6f9[_0x1307f9(0x33c)]+_0x1307f9(0x2cd)+_0x41d6f9[_0x1307f9(0x1f5)]+_0x1307f9(0x319));return'[\x0a'+_0x4e0602[_0x1307f9(0x3c1)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x3f7753=_0x6a39fb[_0x2bb9da(0x231)][_0x2bb9da(0x273)](_0x16aa96=>{const _0x4f81b6=_0x2bb9da;return _0x4f81b6(0x2e5)+_0x16aa96[_0x4f81b6(0x3f7)]+_0x4f81b6(0x388)+_0x4ce8ad(_0x16aa96[_0x4f81b6(0x318)])[_0x4f81b6(0x296)](/^/gm,'\x20\x20')[_0x4f81b6(0x297)]()+_0x4f81b6(0x2d4);})[_0x2bb9da(0x3c1)](',\x0a');return _0x2bb9da(0x288)+_0x6a39fb[_0x2bb9da(0x356)]+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x6a39fb[_0x2bb9da(0x27d)]+_0x2bb9da(0x294)+_0x6a39fb[_0x2bb9da(0x2b5)]+_0x2bb9da(0x2a5)+_0x6a39fb['customers'][_0x2bb9da(0x3f7)]+_0x2bb9da(0x1fd)+_0x4ce8ad(_0x6a39fb[_0x2bb9da(0x383)][_0x2bb9da(0x318)])['replace'](/^/gm,'\x20\x20')[_0x2bb9da(0x297)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x3f7753+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x22a);[a32_0x308022(0x24f)]=a32_0x308022(0x21c);async['execute'](_0xed4275){const _0x4754ea=a32_0x308022,{options:_0x623540,args:_0x115112,tdx:_0xbc98e3}=_0xed4275,_0xa179db=_0x115112[0x0]||_0x623540[_0x4754ea(0x2e4)];if(!_0xa179db)return showParentSegmentNotSetError(_0x4754ea(0x38b)+_0x4754ea(0x28d)),0x1;_0x623540[_0x4754ea(0x384)]&&(console['error'](_0x4754ea(0x36b)+_0x623540[_0x4754ea(0x205)]),console[_0x4754ea(0x30e)](_0x4754ea(0x3e9)+_0xa179db));const _0x567fe5=await withSpinner(_0x4754ea(0x25e)+_0xa179db+_0x4754ea(0x355),()=>_0xbc98e3['segment'][_0x4754ea(0x362)](_0xa179db),{'verbose':_0x623540[_0x4754ea(0x384)]}),_0x488e38=_0x567fe5[_0x4754ea(0x252)],_0x290fd9=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0xa179db+_0x4754ea(0x355),()=>_0xbc98e3[_0x4754ea(0x2a1)][_0x4754ea(0x298)](_0x488e38),{'verbose':_0x623540[_0x4754ea(0x384)]}),_0x4b5f04=_0x290fd9[_0x4754ea(0x252)];return _0x623540[_0x4754ea(0x2ab)]===_0x4754ea(0x350)||_0x623540[_0x4754ea(0x2ab)]===_0x4754ea(0x2fd)?await handleSDKOutput([{'sql':_0x4b5f04}],_0x623540):console['log'](_0x4b5f04),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x29a);['description']=a32_0x308022(0x3f2);async['execute'](_0xf03218){const _0x2c786c=a32_0x308022,{options:_0x37c941,args:_0x247af,tdx:_0x220357}=_0xf03218,_0x49b07=_0x247af[0x0]||_0x37c941[_0x2c786c(0x2e4)];if(!_0x49b07)return showParentSegmentNotSetError(_0x2c786c(0x37b)+_0x2c786c(0x21e)),0x1;_0x37c941[_0x2c786c(0x384)]&&(console[_0x2c786c(0x30e)](_0x2c786c(0x36b)+_0x37c941[_0x2c786c(0x205)]),console[_0x2c786c(0x30e)](_0x2c786c(0x3e9)+_0x49b07));const _0x91bf5e=await withSpinner(_0x2c786c(0x25e)+_0x49b07+_0x2c786c(0x355),()=>_0x220357[_0x2c786c(0x2a1)]['resolveParentId'](_0x49b07),{'verbose':_0x37c941[_0x2c786c(0x384)]}),_0x196a48=_0x91bf5e[_0x2c786c(0x252)],_0x2d911b=await withSpinner(_0x2c786c(0x2c5)+_0x49b07+_0x2c786c(0x355),()=>_0x220357[_0x2c786c(0x2a1)][_0x2c786c(0x298)](_0x196a48),{'verbose':_0x37c941[_0x2c786c(0x384)]});let _0x431ed1=_0x2d911b[_0x2c786c(0x252)];const _0x171e55=resolveLimit(_0x37c941[_0x2c786c(0x248)],DEFAULT_DISPLAY_LIMIT),_0x1ff42f=/\bLIMIT\s+\d+/i[_0x2c786c(0x3f6)](_0x431ed1);!_0x1ff42f&&(_0x431ed1=_0x431ed1[_0x2c786c(0x297)]()['replace'](/;+$/,''),_0x431ed1=_0x2c786c(0x32d)+_0x431ed1+_0x2c786c(0x35c)+_0x171e55);_0x37c941[_0x2c786c(0x384)]&&console['error'](_0x2c786c(0x25b)+_0x431ed1);const _0x53a7bb=await withProgressSpinner(_0x2c786c(0x3c2),async _0x3189e4=>{const _0x28dd2d=_0x2c786c,_0x530d4b=await _0x220357[_0x28dd2d(0x398)][_0x28dd2d(0x2df)](_0x431ed1,{'catalog':'td','schema':_0x28dd2d(0x225),'onJobId':_0x6f32d0=>{_0x3189e4['setJobId'](_0x6f32d0);}});return _0x530d4b;},{'verbose':_0x37c941[_0x2c786c(0x384)]}),_0x3c7a04=_0x53a7bb['data'],_0xd41f74=_0x3c7a04[_0x2c786c(0x30a)]?'\x20[Job\x20ID:\x20'+_0x3c7a04[_0x2c786c(0x30a)]+']':'';return console[_0x2c786c(0x30e)](_0x2c786c(0x393)+_0x3c7a04[_0x2c786c(0x280)][_0x2c786c(0x26c)][_0x2c786c(0x2db)]()+_0x2c786c(0x2af)+(_0x2c786c(0x379)+formatElapsed(_0x3c7a04[_0x2c786c(0x280)][_0x2c786c(0x23d)])+_0xd41f74)),await handleQueryOutput(_0x3c7a04,_0x37c941),0x0;}}export class PSRtListCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x258);[a32_0x308022(0x24f)]=a32_0x308022(0x1f4);async[a32_0x308022(0x2df)](_0x54d064){const _0x503def=a32_0x308022,{options:_0x22ebf4,args:_0x51bf64,tdx:_0x5dc2d2}=_0x54d064,_0x122a0d=_0x51bf64[0x0],_0x3bc753=await withSpinner(_0x122a0d?_0x503def(0x3f0)+_0x122a0d+'\x27...':_0x503def(0x3ad),()=>_0x5dc2d2[_0x503def(0x3ec)]['list'](),{'verbose':_0x22ebf4['verbose']});let _0x4f17e3=_0x3bc753[_0x503def(0x252)][_0x503def(0x37a)](_0x4b8ed4=>_0x4b8ed4[_0x503def(0x3a8)]);if(_0x122a0d){const _0x3767a7=_0x122a0d['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x503def(0x296)](/\*/g,'.*')[_0x503def(0x296)](/\?/g,'.'),_0x37a0ef=new RegExp('^'+_0x3767a7+'$','i');_0x4f17e3=_0x4f17e3['filter'](_0x5462cf=>_0x37a0ef[_0x503def(0x3f6)](_0x5462cf[_0x503def(0x33c)]));}_0x4f17e3[_0x503def(0x386)]((_0x26d200,_0x374182)=>_0x26d200[_0x503def(0x33c)][_0x503def(0x306)](_0x374182[_0x503def(0x33c)])),console[_0x503def(0x30e)](_0x503def(0x2fa)+_0x4f17e3[_0x503def(0x3f5)]+_0x503def(0x216)+(_0x4f17e3['length']!==0x1?'s':''));const _0x2ada6f=_0xfb132b=>{const _0x19bd76=_0x503def;return getConsoleNextUrl(_0x22ebf4[_0x19bd76(0x205)],'/app/dw/parentSegments/'+_0xfb132b);};if(_0x22ebf4[_0x503def(0x2ab)]==='json'||_0x22ebf4[_0x503def(0x2ab)]===_0x503def(0x2fd)){const _0x26e266=_0x4f17e3['map'](_0x5e6760=>({..._0x5e6760,'url':_0x2ada6f(_0x5e6760['id'])}));await handleSDKOutput(_0x26e266,_0x22ebf4);}else{if(_0x4f17e3['length']===0x0)console[_0x503def(0x3d2)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x56a186 of _0x4f17e3){const _0x33747f=_0x56a186[_0x503def(0x2b0)]?a32_0x1c520c[_0x503def(0x1e5)]('\x20('+formatRows(_0x56a186[_0x503def(0x2b0)])+')'):'',_0x1591f4=hyperlink(_0x56a186[_0x503def(0x33c)],_0x2ada6f(_0x56a186['id']));console[_0x503def(0x3d2)]('⚡\x20'+_0x1591f4+_0x33747f);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x3ee);['description']='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a32_0x308022(0x2df)](_0x4f9038){const _0x65a06b=a32_0x308022,{options:_0x4c8d24,args:_0x5c11ac,tdx:_0x1adc23}=_0x4f9038,_0x2e41e2=_0x5c11ac[0x0]||_0x4c8d24['parentSegment'];if(!_0x2e41e2)return showParentSegmentNotSetError(_0x65a06b(0x218)+_0x65a06b(0x358)),0x1;const _0x3f6cea=resolveYamlFile(_0x2e41e2);if(!existsSync(_0x3f6cea))return showFileNotFoundError(_0x3f6cea,_0x2e41e2),0x1;let _0x5f2fcc;try{_0x5f2fcc=readFileSync(_0x3f6cea,'utf-8');}catch(_0x41f057){const _0x759dbb=_0x41f057 instanceof Error?_0x41f057[_0x65a06b(0x391)]:String(_0x41f057);return console[_0x65a06b(0x30e)]('Error\x20reading\x20file:\x20'+_0x759dbb),0x1;}const _0x2460be=createCommandSpinner(a32_0x1c520c[_0x65a06b(0x1e5)](_0x65a06b(0x3b0)),{'verbose':_0x4c8d24[_0x65a06b(0x384)]});_0x2460be['start']();const _0x435971={'realtime':!![],'onProgress':_0x4fbbed=>{const _0x50db30=_0x65a06b;_0x2460be[_0x50db30(0x276)]=formatProgressMessage(_0x4fbbed);}};let _0x2eab3f;try{_0x2eab3f=await _0x1adc23['segment'][_0x65a06b(0x20e)](_0x5f2fcc,_0x435971),_0x2460be[_0x65a06b(0x265)]();}catch(_0x27c7b4){_0x2460be[_0x65a06b(0x265)]();throw _0x27c7b4;}console[_0x65a06b(0x30e)]('\x0a'+a32_0x1c520c['bold'](_0x65a06b(0x260))+'\x20'+_0x2eab3f[_0x65a06b(0x33c)]),console[_0x65a06b(0x30e)]('═'[_0x65a06b(0x3b2)](0x3c)),displayRealtimeValidation(_0x2eab3f),console[_0x65a06b(0x30e)]('─'[_0x65a06b(0x3b2)](0x3c));if(_0x2eab3f[_0x65a06b(0x206)][_0x65a06b(0x3f5)]>0x0){console[_0x65a06b(0x30e)]('\x0a'+a32_0x1c520c[_0x65a06b(0x27c)](_0x65a06b(0x372)));for(const _0x4a172e of _0x2eab3f[_0x65a06b(0x206)]){console[_0x65a06b(0x30e)]('\x20\x20'+a32_0x1c520c[_0x65a06b(0x27c)]('•')+'\x20'+_0x4a172e);}}return _0x2eab3f[_0x65a06b(0x2aa)]&&console[_0x65a06b(0x30e)]('\x0a'+a32_0x1c520c['green']('✔')+_0x65a06b(0x334)),_0x2eab3f['allValid']?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x404);[a32_0x308022(0x24f)]='List\x20RT\x20journeys';async[a32_0x308022(0x2df)](_0x136113){const _0x505196=a32_0x308022,{options:_0x38fb5b,args:_0xc72739,tdx:_0x4b4ca0}=_0x136113,_0x150197=_0xc72739[0x0]||_0x38fb5b[_0x505196(0x2e4)];if(!_0x150197)return showParentSegmentNotSetError(_0x505196(0x397)+'\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;_0x38fb5b['verbose']&&(console[_0x505196(0x30e)](_0x505196(0x36b)+_0x38fb5b[_0x505196(0x205)]),console[_0x505196(0x30e)](_0x505196(0x3e9)+_0x150197));const _0x1b232e=await withSpinner(_0x505196(0x25e)+_0x150197+_0x505196(0x355),()=>_0x4b4ca0['segment'][_0x505196(0x362)](_0x150197),{'verbose':_0x38fb5b[_0x505196(0x384)]}),_0x342ead=_0x1b232e[_0x505196(0x252)],_0x3f9517=await withSpinner(_0x505196(0x31f)+_0x150197+_0x505196(0x355),()=>_0x4b4ca0['realtime'][_0x505196(0x32b)](_0x342ead),{'verbose':_0x38fb5b['verbose']}),_0x5399f7=_0x3f9517[_0x505196(0x252)];console['error'](_0x505196(0x2fa)+_0x5399f7[_0x505196(0x3f5)]+_0x505196(0x329)+(_0x5399f7['length']!==0x1?'s':''));if(_0x38fb5b[_0x505196(0x2ab)]===_0x505196(0x350)||_0x38fb5b[_0x505196(0x2ab)]===_0x505196(0x2fd))await handleSDKOutput(_0x5399f7,_0x38fb5b);else{if(_0x5399f7[_0x505196(0x3f5)]===0x0)console[_0x505196(0x3d2)](_0x505196(0x1e4));else for(const _0x448393 of _0x5399f7){const _0x22296f=_0x448393[_0x505196(0x3d1)]==='launched'?'🚀':'📝',_0x52e8b1=_0x448393[_0x505196(0x1ea)]?a32_0x1c520c[_0x505196(0x1f2)](_0x505196(0x241)):'',_0x150f6c=a32_0x1c520c[_0x505196(0x1e5)]('\x20('+_0x448393[_0x505196(0x313)]+'\x20stage'+(_0x448393[_0x505196(0x313)]!==0x1?'s':'')+')');console[_0x505196(0x3d2)](_0x22296f+'\x20'+_0x448393[_0x505196(0x33c)]+_0x52e8b1+_0x150f6c);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a32_0x308022(0x33c)]='ps:rt:jn:pause';[a32_0x308022(0x24f)]='Pause\x20activations\x20in\x20an\x20RT\x20journey';async[a32_0x308022(0x2df)](_0x31c195){const _0x19242a=a32_0x308022,{options:_0x465eac,args:_0x3d3695,tdx:_0x2136e3}=_0x31c195,_0x115fc7=_0x3d3695[0x0];if(!_0x115fc7)return console['error'](a32_0x1c520c[_0x19242a(0x27c)](_0x19242a(0x2f9))),console[_0x19242a(0x30e)](_0x19242a(0x314)),console['error'](a32_0x1c520c[_0x19242a(0x1e5)](_0x19242a(0x392))),0x1;_0x465eac[_0x19242a(0x384)]&&(console['error'](_0x19242a(0x36b)+_0x465eac[_0x19242a(0x205)]),console[_0x19242a(0x30e)](_0x19242a(0x305)+_0x115fc7));const _0x22ef91=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x115fc7+_0x19242a(0x355),()=>_0x2136e3[_0x19242a(0x3ec)][_0x19242a(0x3d8)](_0x115fc7),{'verbose':_0x465eac[_0x19242a(0x384)]}),_0x34faef=_0x22ef91[_0x19242a(0x252)];console[_0x19242a(0x30e)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x34faef[_0x19242a(0x33c)]+'\x27');if(_0x465eac[_0x19242a(0x2ab)]===_0x19242a(0x350)||_0x465eac[_0x19242a(0x2ab)]===_0x19242a(0x2fd))await handleSDKOutput([_0x34faef],_0x465eac);else{const _0x51c1c5=_0x34faef[_0x19242a(0x3d1)]===_0x19242a(0x3bb)?'🚀':'📝',_0x31468c=_0x34faef[_0x19242a(0x1ea)]?a32_0x1c520c['yellow'](_0x19242a(0x241)):'';console[_0x19242a(0x3d2)](_0x51c1c5+'\x20'+_0x34faef[_0x19242a(0x33c)]+_0x31468c);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x2f8);[a32_0x308022(0x24f)]=a32_0x308022(0x1e6);async[a32_0x308022(0x2df)](_0x2ebcca){const _0x325bb4=a32_0x308022,{options:_0x3b1b86,args:_0x5beccc,tdx:_0x244688}=_0x2ebcca,_0x39e3d5=_0x5beccc[0x0];if(!_0x39e3d5)return console['error'](a32_0x1c520c[_0x325bb4(0x27c)](_0x325bb4(0x2f9))),console[_0x325bb4(0x30e)](_0x325bb4(0x3f4)),console[_0x325bb4(0x30e)](a32_0x1c520c[_0x325bb4(0x1e5)](_0x325bb4(0x392))),0x1;_0x3b1b86['verbose']&&(console[_0x325bb4(0x30e)](_0x325bb4(0x36b)+_0x3b1b86[_0x325bb4(0x205)]),console[_0x325bb4(0x30e)](_0x325bb4(0x305)+_0x39e3d5));const _0x30cdee=await withSpinner(_0x325bb4(0x38a)+_0x39e3d5+_0x325bb4(0x355),()=>_0x244688[_0x325bb4(0x3ec)][_0x325bb4(0x28e)](_0x39e3d5),{'verbose':_0x3b1b86[_0x325bb4(0x384)]}),_0x2481e6=_0x30cdee['data'];console[_0x325bb4(0x30e)](_0x325bb4(0x207)+_0x2481e6[_0x325bb4(0x33c)]+'\x27');if(_0x3b1b86[_0x325bb4(0x2ab)]===_0x325bb4(0x350)||_0x3b1b86[_0x325bb4(0x2ab)]==='jsonl')await handleSDKOutput([_0x2481e6],_0x3b1b86);else{const _0xdd2ed2=_0x2481e6[_0x325bb4(0x3d1)]===_0x325bb4(0x3bb)?'🚀':'📝',_0xb936d5=_0x2481e6['paused']?a32_0x1c520c[_0x325bb4(0x1f2)](_0x325bb4(0x241)):'';console[_0x325bb4(0x3d2)](_0xdd2ed2+'\x20'+_0x2481e6['name']+_0xb936d5);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x35e);[a32_0x308022(0x24f)]='Get\x20current\x20RT\x20configuration\x20version\x20status';async[a32_0x308022(0x2df)](_0x20c32d){const _0x41c45a=a32_0x308022,{options:_0x13273f,args:_0x11c1ff,tdx:_0x175694}=_0x20c32d,_0x275236=_0x11c1ff[0x0]||_0x13273f['parentSegment'];if(!_0x275236)return showParentSegmentNotSetError(_0x41c45a(0x26a)+_0x41c45a(0x376)),0x1;_0x13273f[_0x41c45a(0x384)]&&(console[_0x41c45a(0x30e)]('Site:\x20'+_0x13273f[_0x41c45a(0x205)]),console[_0x41c45a(0x30e)](_0x41c45a(0x3e9)+_0x275236));const _0x4cbb16=await withSpinner(_0x41c45a(0x25e)+_0x275236+_0x41c45a(0x355),()=>_0x175694[_0x41c45a(0x2a1)][_0x41c45a(0x362)](_0x275236),{'verbose':_0x13273f[_0x41c45a(0x384)]}),_0x5f0cda=_0x4cbb16[_0x41c45a(0x252)],_0x13fbb6=await withSpinner(_0x41c45a(0x2a7)+_0x275236+_0x41c45a(0x355),()=>_0x175694['realtime'][_0x41c45a(0x20c)](_0x5f0cda),{'verbose':_0x13273f[_0x41c45a(0x384)]}),_0x516f81=_0x13fbb6[_0x41c45a(0x252)];return console[_0x41c45a(0x30e)](_0x41c45a(0x295)),_0x13273f[_0x41c45a(0x2ab)]==='json'||_0x13273f[_0x41c45a(0x2ab)]===_0x41c45a(0x2fd)?await handleSDKOutput([_0x516f81],_0x13273f):(console[_0x41c45a(0x3d2)]('id:\x20'+_0x516f81['id']),console[_0x41c45a(0x3d2)](_0x41c45a(0x3f3)+_0x516f81[_0x41c45a(0x27a)]),console[_0x41c45a(0x3d2)]('identifier:\x20'+_0x516f81[_0x41c45a(0x23c)]),console[_0x41c45a(0x3d2)](_0x41c45a(0x303)+_0x516f81[_0x41c45a(0x29b)]),console[_0x41c45a(0x3d2)](_0x41c45a(0x2ea)+_0x516f81[_0x41c45a(0x28a)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x2e6);[a32_0x308022(0x24f)]=a32_0x308022(0x214);async[a32_0x308022(0x2df)](_0x15e0a3){const _0x7535d3=a32_0x308022,{options:_0xcb64ab,args:_0x7a89ac,tdx:_0x5593ab}=_0x15e0a3,_0x55a348=_0x7a89ac[0x0]||_0xcb64ab[_0x7535d3(0x2e4)];if(!_0x55a348)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'+_0x7535d3(0x238)),0x1;const _0x31a81a=await withSpinner(_0x7535d3(0x25e)+_0x55a348+_0x7535d3(0x355),()=>_0x5593ab[_0x7535d3(0x2a1)][_0x7535d3(0x362)](_0x55a348),{'verbose':_0xcb64ab[_0x7535d3(0x384)]}),_0x336f83=_0x31a81a[_0x7535d3(0x252)],_0x2ab821=await withSpinner('Listing\x20personalization\x20services\x20for\x20\x27'+_0x55a348+'\x27...',()=>_0x5593ab[_0x7535d3(0x34e)][_0x7535d3(0x3e1)](_0x336f83),{'verbose':_0xcb64ab[_0x7535d3(0x384)]}),_0x3984e7=_0x2ab821[_0x7535d3(0x252)];console[_0x7535d3(0x30e)]('✔\x20Found\x20'+_0x3984e7['length']+_0x7535d3(0x3b9)+(_0x3984e7[_0x7535d3(0x3f5)]!==0x1?'s':''));if(_0xcb64ab[_0x7535d3(0x2ab)]===_0x7535d3(0x350)||_0xcb64ab[_0x7535d3(0x2ab)]===_0x7535d3(0x2fd))await handleSDKOutput(_0x3984e7,_0xcb64ab);else{if(_0x3984e7[_0x7535d3(0x3f5)]===0x0)console[_0x7535d3(0x3d2)](_0x7535d3(0x36c)),console['error'](a32_0x1c520c[_0x7535d3(0x2e9)](_0x7535d3(0x309)));else for(const _0x558fd5 of _0x3984e7){console[_0x7535d3(0x3d2)](a32_0x1c520c['bold'](_0x558fd5['name'])+'\x20'+a32_0x1c520c[_0x7535d3(0x1e5)]('(id:\x20'+_0x558fd5['id']+')'));_0x558fd5[_0x7535d3(0x24f)]&&console[_0x7535d3(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x7535d3(0x1e5)](_0x558fd5['description']));if(_0x558fd5[_0x7535d3(0x2a2)]&&_0x558fd5[_0x7535d3(0x2a2)][_0x7535d3(0x3f5)]>0x0)for(const _0x8fd637 of _0x558fd5[_0x7535d3(0x2a2)]){const _0x84599c=_0x8fd637[_0x7535d3(0x3f9)]?.[_0x7535d3(0x3f5)]?_0x8fd637[_0x7535d3(0x3f9)][_0x7535d3(0x3c1)](',\x20'):_0x7535d3(0x3d6);console[_0x7535d3(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x7535d3(0x2e9)](_0x7535d3(0x389))+'\x20'+_0x8fd637[_0x7535d3(0x33c)]+'\x20'+a32_0x1c520c[_0x7535d3(0x1e5)]('(id:\x20'+_0x8fd637['id']+')')),console[_0x7535d3(0x3d2)]('\x20\x20\x20\x20'+a32_0x1c520c[_0x7535d3(0x1e5)](_0x7535d3(0x2f3))+'\x20'+_0x84599c);}else console['log']('\x20\x20'+a32_0x1c520c[_0x7535d3(0x1e5)](_0x7535d3(0x25d)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x29c);[a32_0x308022(0x24f)]='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async[a32_0x308022(0x2df)](_0x4852fc){const _0x3bd4b7=a32_0x308022,{options:_0x406619,args:_0x223d38,tdx:_0x40cfbf}=_0x4852fc,_0x4d9e0f=_0x406619,_0x4c97e5=_0x223d38[0x0],_0x42146d=_0x223d38[0x1]||_0x406619[_0x3bd4b7(0x2e4)];if(!_0x4c97e5)return console[_0x3bd4b7(0x30e)](_0x3bd4b7(0x1fa)),console[_0x3bd4b7(0x30e)](_0x3bd4b7(0x275)),console[_0x3bd4b7(0x30e)](_0x3bd4b7(0x2ee)),0x1;if(!_0x42146d)return showParentSegmentNotSetError(_0x3bd4b7(0x3b6)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x328a42=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x42146d+_0x3bd4b7(0x355),()=>_0x40cfbf[_0x3bd4b7(0x2a1)]['resolveParentId'](_0x42146d),{'verbose':_0x406619[_0x3bd4b7(0x384)]}),_0x1ed631=_0x328a42[_0x3bd4b7(0x252)],_0x1a9219={'name':_0x4c97e5,'description':_0x4d9e0f[_0x3bd4b7(0x24f)],'public':_0x4d9e0f[_0x3bd4b7(0x3c8)]},_0xe1831f=await withSpinner(_0x3bd4b7(0x2cc)+_0x4c97e5+'\x27...',()=>_0x40cfbf[_0x3bd4b7(0x34e)][_0x3bd4b7(0x39a)](_0x1ed631,_0x1a9219),{'verbose':_0x406619['verbose']}),_0x4fef0e=_0xe1831f[_0x3bd4b7(0x252)];return console['error'](_0x3bd4b7(0x233)+_0x4fef0e[_0x3bd4b7(0x33c)]+_0x3bd4b7(0x234)+_0x4fef0e['id']),await handleSDKOutput([_0x4fef0e],_0x406619),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x26f);[a32_0x308022(0x24f)]=a32_0x308022(0x27e);async['execute'](_0x1275a6){const _0x64cc78=a32_0x308022,{options:_0x3c712c,args:_0x2fec09,tdx:_0x3835b1}=_0x1275a6,_0x3afbeb=_0x2fec09[0x0],_0x36cb0c=_0x2fec09[0x1]||_0x3c712c[_0x64cc78(0x2e4)];if(!_0x3afbeb)return console[_0x64cc78(0x30e)](_0x64cc78(0x2ad)),console[_0x64cc78(0x30e)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]'),console[_0x64cc78(0x30e)](_0x64cc78(0x3e0)),0x1;if(!_0x36cb0c)return showParentSegmentNotSetError(_0x64cc78(0x220)+_0x64cc78(0x3e0)),0x1;const _0x4fcd07=await withSpinner(_0x64cc78(0x25e)+_0x36cb0c+_0x64cc78(0x355),()=>_0x3835b1['segment'][_0x64cc78(0x362)](_0x36cb0c),{'verbose':_0x3c712c[_0x64cc78(0x384)]}),_0x2b561d=_0x4fcd07['data'],_0x289480=await withSpinner(_0x64cc78(0x3c7)+_0x3afbeb+'\x27...',()=>_0x3835b1['personalization'][_0x64cc78(0x31a)](_0x2b561d,_0x3afbeb),{'verbose':_0x3c712c[_0x64cc78(0x384)]}),_0x132aac=_0x289480[_0x64cc78(0x252)];if(_0x3c712c[_0x64cc78(0x350)]||_0x3c712c[_0x64cc78(0x2fd)])await handleSDKOutput([_0x132aac],_0x3c712c);else{console[_0x64cc78(0x3d2)](a32_0x1c520c['bold'](_0x132aac[_0x64cc78(0x33c)])+'\x20'+a32_0x1c520c[_0x64cc78(0x1e5)](_0x64cc78(0x33f)+_0x132aac['id']+')'));_0x132aac['description']&&console[_0x64cc78(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x64cc78(0x1e5)](_0x132aac[_0x64cc78(0x24f)]));console[_0x64cc78(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x64cc78(0x2e9)](_0x64cc78(0x25c))+'\x20'+(_0x132aac[_0x64cc78(0x3c8)]?'yes':'no'));if(_0x132aac[_0x64cc78(0x2a2)]&&_0x132aac[_0x64cc78(0x2a2)][_0x64cc78(0x3f5)]>0x0)for(const _0x478bbc of _0x132aac[_0x64cc78(0x2a2)]){const _0x4151ec=_0x478bbc[_0x64cc78(0x3f9)]?.['length']?_0x478bbc[_0x64cc78(0x3f9)]['join'](',\x20'):_0x64cc78(0x3d6);console[_0x64cc78(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x64cc78(0x2e9)](_0x64cc78(0x389))+'\x20'+_0x478bbc[_0x64cc78(0x33c)]+'\x20'+a32_0x1c520c[_0x64cc78(0x1e5)](_0x64cc78(0x33f)+_0x478bbc['id']+')')),console[_0x64cc78(0x3d2)](_0x64cc78(0x22d)+a32_0x1c520c['dim'](_0x64cc78(0x2f3))+'\x20'+_0x4151ec);}else console[_0x64cc78(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x64cc78(0x1e5)](_0x64cc78(0x25d)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']='ps:pz:service:delete';[a32_0x308022(0x24f)]=a32_0x308022(0x222);async[a32_0x308022(0x2df)](_0x1d96df){const _0x8d98d5=a32_0x308022,{options:_0x522cc8,args:_0xf46ea5,tdx:_0x477f81}=_0x1d96df,_0x42dff5=_0xf46ea5[0x0],_0x1b5e98=_0xf46ea5[0x1]||_0x522cc8[_0x8d98d5(0x2e4)];if(!_0x42dff5)return console[_0x8d98d5(0x30e)](_0x8d98d5(0x2ad)),console[_0x8d98d5(0x30e)](_0x8d98d5(0x3a4)),console['error'](_0x8d98d5(0x2f7)),0x1;if(!_0x1b5e98)return showParentSegmentNotSetError(_0x8d98d5(0x236)+_0x8d98d5(0x2f7)),0x1;const _0x16d2e4=await withSpinner(_0x8d98d5(0x25e)+_0x1b5e98+'\x27...',()=>_0x477f81[_0x8d98d5(0x2a1)][_0x8d98d5(0x362)](_0x1b5e98),{'verbose':_0x522cc8[_0x8d98d5(0x384)]}),_0x281871=_0x16d2e4['data'];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x42dff5+_0x8d98d5(0x355),()=>_0x477f81[_0x8d98d5(0x34e)][_0x8d98d5(0x33a)](_0x281871,_0x42dff5),{'verbose':_0x522cc8[_0x8d98d5(0x384)]}),console[_0x8d98d5(0x30e)](_0x8d98d5(0x1fb)+_0x42dff5+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a32_0x308022(0x3eb);[a32_0x308022(0x24f)]=a32_0x308022(0x354);async[a32_0x308022(0x2df)](_0x39c90b){const _0x141018=a32_0x308022,{options:_0x240eda,args:_0x504265,tdx:_0x34042f}=_0x39c90b,_0x131574=_0x240eda,_0x2a20f6=_0x504265[0x0],_0x1a3088=_0x504265[0x1]||_0x240eda['parentSegment'];if(!_0x2a20f6)return console['error'](_0x141018(0x2ad)),console[_0x141018(0x30e)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),console['error'](_0x141018(0x36a)),0x1;if(!_0x131574['name'])return console[_0x141018(0x30e)](_0x141018(0x39b)),console[_0x141018(0x30e)](_0x141018(0x1fe)),0x1;if(!_0x1a3088)return showParentSegmentNotSetError(_0x141018(0x21f)+_0x141018(0x36a)),0x1;const _0x5ac4dd=await withSpinner(_0x141018(0x25e)+_0x1a3088+_0x141018(0x355),()=>_0x34042f[_0x141018(0x2a1)]['resolveParentId'](_0x1a3088),{'verbose':_0x240eda['verbose']}),_0xd054a0=_0x5ac4dd[_0x141018(0x252)],_0x11ee38={'name':_0x131574[_0x141018(0x33c)]};_0x131574['description']!==undefined&&(_0x11ee38[_0x141018(0x24f)]=_0x131574[_0x141018(0x24f)]);const _0x1b52cb=await withSpinner(_0x141018(0x290)+_0x2a20f6+_0x141018(0x355),()=>_0x34042f[_0x141018(0x34e)][_0x141018(0x3cd)](_0xd054a0,_0x2a20f6,_0x11ee38),{'verbose':_0x240eda[_0x141018(0x384)]}),_0x3fea91=_0x1b52cb[_0x141018(0x252)];return console['error'](_0x141018(0x1f8)+_0x3fea91[_0x141018(0x33c)]+'\x27'),await handleSDKOutput([_0x3fea91],_0x240eda),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x2b3);[a32_0x308022(0x24f)]=a32_0x308022(0x2b4);async['execute'](_0x3ffbd1){const _0x36f622=a32_0x308022,{options:_0x19758d,args:_0x2feb37,tdx:_0x1c2af2}=_0x3ffbd1,_0x42f858=_0x19758d,_0x444cdc=_0x2feb37[0x0],_0xfe1778=_0x2feb37[0x1],_0x7e28b9=_0x2feb37[0x2]||_0x19758d[_0x36f622(0x2e4)];if(!_0x444cdc)return console[_0x36f622(0x30e)](_0x36f622(0x3ce)),console['error'](_0x36f622(0x255)),console[_0x36f622(0x30e)](_0x36f622(0x270)),0x1;if(!_0xfe1778)return console[_0x36f622(0x30e)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x36f622(0x30e)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console['error'](_0x36f622(0x270)),0x1;if(!_0x7e28b9)return showParentSegmentNotSetError(_0x36f622(0x2a3)+_0x36f622(0x270)),0x1;const _0x58d123=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x7e28b9+_0x36f622(0x355),()=>_0x1c2af2['segment'][_0x36f622(0x362)](_0x7e28b9),{'verbose':_0x19758d['verbose']}),_0x3d0f4d=_0x58d123[_0x36f622(0x252)],_0x368bdd={'name':_0x444cdc};_0x42f858['allowedIps']&&(_0x368bdd['allowedIps']=_0x42f858['allowedIps'][_0x36f622(0x36f)](',')['map'](_0x5d9e63=>_0x5d9e63['trim']()));_0x42f858[_0x36f622(0x24f)]&&(_0x368bdd['description']=_0x42f858['description']);const _0x135a60=await withSpinner(_0x36f622(0x264)+_0x444cdc+_0x36f622(0x3e7)+_0xfe1778+_0x36f622(0x355),()=>_0x1c2af2[_0x36f622(0x34e)]['createToken'](_0x3d0f4d,_0xfe1778,_0x368bdd),{'verbose':_0x19758d[_0x36f622(0x384)]}),_0x1f7843=_0x135a60[_0x36f622(0x252)];return console[_0x36f622(0x30e)]('✔\x20Created\x20token\x20\x27'+_0x1f7843['name']+'\x27\x20with\x20ID:\x20'+_0x1f7843['id']),_0x1f7843[_0x36f622(0x370)]&&(console[_0x36f622(0x30e)](a32_0x1c520c[_0x36f622(0x1f2)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x36f622(0x30e)](a32_0x1c520c['cyan'](_0x1f7843[_0x36f622(0x370)])),console[_0x36f622(0x30e)]('')),await handleSDKOutput([_0x1f7843],_0x19758d),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{['name']=a32_0x308022(0x2ac);[a32_0x308022(0x24f)]=a32_0x308022(0x22f);async[a32_0x308022(0x2df)](_0x3fbb1f){const _0xe5b550=a32_0x308022,{options:_0x400dfa,args:_0xcf9dad,tdx:_0x1f1d10}=_0x3fbb1f,_0x9a97f3=_0xcf9dad[0x0],_0x56e68b=_0xcf9dad[0x1]||_0x400dfa[_0xe5b550(0x2e4)];if(!_0x9a97f3)return console[_0xe5b550(0x30e)](_0xe5b550(0x3a9)),console[_0xe5b550(0x30e)](_0xe5b550(0x387)),console[_0xe5b550(0x30e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x56e68b)return showParentSegmentNotSetError(_0xe5b550(0x327)+_0xe5b550(0x34b)),0x1;const _0x288ca0=await withSpinner(_0xe5b550(0x25e)+_0x56e68b+_0xe5b550(0x355),()=>_0x1f1d10[_0xe5b550(0x2a1)][_0xe5b550(0x362)](_0x56e68b),{'verbose':_0x400dfa[_0xe5b550(0x384)]}),_0x29f241=_0x288ca0['data'],_0x353deb=await withSpinner(_0xe5b550(0x39f),()=>_0x1f1d10[_0xe5b550(0x34e)]['list'](_0x29f241),{'verbose':_0x400dfa['verbose']}),_0x2f503a=_0x353deb[_0xe5b550(0x252)];let _0x1636eb;for(const _0x4f84cf of _0x2f503a){if(_0x4f84cf[_0xe5b550(0x2a2)]?.[_0xe5b550(0x239)](_0x294b24=>_0x294b24['id']===_0x9a97f3)){_0x1636eb=_0x4f84cf['id'];break;}}if(!_0x1636eb)return console[_0xe5b550(0x30e)](_0xe5b550(0x345)+_0x9a97f3+_0xe5b550(0x245)),0x1;const _0x1af9b1=await withSpinner('Deleting\x20token\x20\x27'+_0x9a97f3+_0xe5b550(0x355),()=>_0x1f1d10[_0xe5b550(0x34e)][_0xe5b550(0x26d)](_0x29f241,_0x1636eb,_0x9a97f3),{'verbose':_0x400dfa['verbose']}),_0x10fb34=_0x1af9b1[_0xe5b550(0x252)];return console['error'](_0xe5b550(0x2c1)+(_0x10fb34[_0xe5b550(0x33c)]||_0x9a97f3)+'\x27'),await handleSDKOutput([_0x10fb34],_0x400dfa),0x0;}}export class PSPzListCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x33b);['description']='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async['execute'](_0x3b5e5b){const _0x5ccb1c=a32_0x308022,{options:_0x217613,args:_0xe4e59,tdx:_0x2fa393}=_0x3b5e5b,_0x404071=_0xe4e59[0x0]||_0x217613['parentSegment'];if(!_0x404071)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a'+'\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'),0x1;const _0x4fa72f=await withSpinner(_0x5ccb1c(0x25e)+_0x404071+'\x27...',()=>_0x2fa393[_0x5ccb1c(0x2a1)][_0x5ccb1c(0x362)](_0x404071),{'verbose':_0x217613['verbose']}),_0x2766be=_0x4fa72f[_0x5ccb1c(0x252)],_0x40937b=await withSpinner(_0x5ccb1c(0x2cf)+_0x404071+_0x5ccb1c(0x355),()=>_0x2fa393[_0x5ccb1c(0x34e)]['listPersonalizations'](_0x2766be),{'verbose':_0x217613[_0x5ccb1c(0x384)]}),_0x4ee661=_0x40937b[_0x5ccb1c(0x252)];console[_0x5ccb1c(0x30e)](_0x5ccb1c(0x2fa)+_0x4ee661['length']+_0x5ccb1c(0x3c5)+(_0x4ee661[_0x5ccb1c(0x3f5)]!==0x1?'s':''));if(_0x217613[_0x5ccb1c(0x2ab)]===_0x5ccb1c(0x350)||_0x217613[_0x5ccb1c(0x2ab)]==='jsonl')await handleSDKOutput(_0x4ee661,_0x217613);else{if(_0x4ee661[_0x5ccb1c(0x3f5)]===0x0)console[_0x5ccb1c(0x3d2)](_0x5ccb1c(0x249));else for(const _0x137866 of _0x4ee661){console[_0x5ccb1c(0x3d2)](a32_0x1c520c['bold'](_0x137866[_0x5ccb1c(0x33c)])+'\x20'+a32_0x1c520c[_0x5ccb1c(0x1e5)](_0x5ccb1c(0x33f)+_0x137866['id']+')'));_0x137866[_0x5ccb1c(0x24f)]&&console[_0x5ccb1c(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x5ccb1c(0x1e5)](_0x137866['description']));const _0x3ad9c7=_0x137866[_0x5ccb1c(0x2b1)]?.[_0x5ccb1c(0x3f5)]||0x0;console[_0x5ccb1c(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x5ccb1c(0x2e9)]('sections:')+'\x20'+_0x3ad9c7);if(_0x137866['sections']&&_0x137866[_0x5ccb1c(0x2b1)]['length']>0x0)for(const _0x2b804a of _0x137866[_0x5ccb1c(0x2b1)]){console[_0x5ccb1c(0x3d2)](_0x5ccb1c(0x2d2)+_0x2b804a[_0x5ccb1c(0x33c)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x2a6);[a32_0x308022(0x24f)]='Show\x20a\x20specific\x20realtime\x20personalization';async[a32_0x308022(0x2df)](_0x1854d4){const _0x3aa3b0=a32_0x308022,{options:_0x21957f,args:_0x3be86f,tdx:_0x4373ed}=_0x1854d4,_0x5aa03a=_0x3be86f[0x0];if(!_0x5aa03a)return console[_0x3aa3b0(0x30e)](_0x3aa3b0(0x399)),console[_0x3aa3b0(0x30e)](_0x3aa3b0(0x228)),0x1;const _0x15859e=await withSpinner('Getting\x20personalization\x20\x27'+_0x5aa03a+'\x27...',()=>_0x4373ed[_0x3aa3b0(0x34e)][_0x3aa3b0(0x256)](_0x5aa03a),{'verbose':_0x21957f[_0x3aa3b0(0x384)]}),_0x4b4f2d=_0x15859e[_0x3aa3b0(0x252)];console[_0x3aa3b0(0x30e)]('✔\x20Found\x20personalization\x20\x27'+_0x4b4f2d['name']+'\x27');if(_0x21957f[_0x3aa3b0(0x2ab)]===_0x3aa3b0(0x350)||_0x21957f[_0x3aa3b0(0x2ab)]===_0x3aa3b0(0x2fd))await handleSDKOutput([_0x4b4f2d],_0x21957f);else{console[_0x3aa3b0(0x3d2)](a32_0x1c520c[_0x3aa3b0(0x320)](_0x4b4f2d['name'])+'\x20'+a32_0x1c520c[_0x3aa3b0(0x1e5)]('(id:\x20'+_0x4b4f2d['id']+')'));_0x4b4f2d[_0x3aa3b0(0x24f)]&&console[_0x3aa3b0(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x3aa3b0(0x1e5)](_0x4b4f2d[_0x3aa3b0(0x24f)]));_0x4b4f2d[_0x3aa3b0(0x27a)]&&console[_0x3aa3b0(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x3aa3b0(0x2e9)](_0x3aa3b0(0x3fe))+'\x20'+_0x4b4f2d[_0x3aa3b0(0x27a)]);console[_0x3aa3b0(0x3d2)]('\x20\x20'+a32_0x1c520c[_0x3aa3b0(0x2e9)]('created:')+'\x20'+_0x4b4f2d[_0x3aa3b0(0x33e)]),console[_0x3aa3b0(0x3d2)]('\x20\x20'+a32_0x1c520c['cyan'](_0x3aa3b0(0x3d9))+'\x20'+_0x4b4f2d[_0x3aa3b0(0x3ae)]);const _0x216392=_0x4b4f2d[_0x3aa3b0(0x2b1)]?.['length']||0x0;console['log']('\x20\x20'+a32_0x1c520c[_0x3aa3b0(0x2e9)](_0x3aa3b0(0x403))+'\x20'+_0x216392);if(_0x4b4f2d[_0x3aa3b0(0x2b1)]&&_0x4b4f2d[_0x3aa3b0(0x2b1)][_0x3aa3b0(0x3f5)]>0x0)for(const _0x1f23ad of _0x4b4f2d[_0x3aa3b0(0x2b1)]){console[_0x3aa3b0(0x3d2)]('\x20\x20\x20\x20'+a32_0x1c520c['bold'](_0x1f23ad[_0x3aa3b0(0x33c)])+'\x20'+a32_0x1c520c[_0x3aa3b0(0x1e5)](_0x3aa3b0(0x33f)+_0x1f23ad['id']+')')),_0x1f23ad[_0x3aa3b0(0x31e)]&&(console[_0x3aa3b0(0x3d2)](_0x3aa3b0(0x287)+a32_0x1c520c[_0x3aa3b0(0x2e9)](_0x3aa3b0(0x3fc))+'\x20'+_0x1f23ad['entryCriteria'][_0x3aa3b0(0x33c)]),_0x1f23ad[_0x3aa3b0(0x31e)]['keyEventCriteria']?.[_0x3aa3b0(0x263)]&&console[_0x3aa3b0(0x3d2)](_0x3aa3b0(0x37f)+a32_0x1c520c['cyan'](_0x3aa3b0(0x2ca))+'\x20'+_0x1f23ad['entryCriteria']['keyEventCriteria']['keyEventId'])),_0x1f23ad[_0x3aa3b0(0x23b)]&&console[_0x3aa3b0(0x3d2)]('\x20\x20\x20\x20\x20\x20'+a32_0x1c520c[_0x3aa3b0(0x2e9)](_0x3aa3b0(0x28b))+'\x20'+JSON[_0x3aa3b0(0x30d)](_0x1f23ad[_0x3aa3b0(0x23b)])),_0x1f23ad[_0x3aa3b0(0x282)]&&console[_0x3aa3b0(0x3d2)]('\x20\x20\x20\x20\x20\x20'+a32_0x1c520c[_0x3aa3b0(0x2e9)](_0x3aa3b0(0x2ba))+_0x3aa3b0(0x326));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x3f8);['description']=a32_0x308022(0x20f);async['execute'](_0x58432b){const _0x18070d=a32_0x308022,{options:_0x2d4780,args:_0x2a8c8f,tdx:_0x500406}=_0x58432b,_0x31195e=_0x2a8c8f[0x0];if(!_0x31195e)return console[_0x18070d(0x30e)](_0x18070d(0x399)),console['error'](_0x18070d(0x37d)),0x1;return await withSpinner(_0x18070d(0x2a8)+_0x31195e+_0x18070d(0x355),()=>_0x500406[_0x18070d(0x34e)]['deletePersonalization'](_0x31195e),{'verbose':_0x2d4780['verbose']}),console['error'](_0x18070d(0x3bf)+_0x31195e+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a32_0x308022(0x21a);[a32_0x308022(0x24f)]=a32_0x308022(0x347);async[a32_0x308022(0x2df)](_0x15f8d0){const _0x46adaf=a32_0x308022,{options:_0x266f94,tdx:_0x3ea3fa}=_0x15f8d0,_0x52e4c6=_0x266f94;let _0x27107f;if(_0x52e4c6['file']){_0x27107f=await loadJSON(_0x52e4c6['file'],!![]);if(!_0x27107f[_0x46adaf(0x3a0)]?.['parentFolder'])return console[_0x46adaf(0x30e)](_0x46adaf(0x353)),console['error'](_0x46adaf(0x1ee)),console[_0x46adaf(0x30e)]('\x20\x20\x22relationships\x22:\x20{\x20\x22parentFolder\x22:\x20{\x20\x22data\x22:\x20{\x20\x22id\x22:\x20\x22<id>\x22,\x20\x22type\x22:\x20\x22folder-segment\x22\x20}\x20}\x20}'),0x1;}else{if(!_0x52e4c6[_0x46adaf(0x33c)])return console['error'](_0x46adaf(0x381)),console[_0x46adaf(0x30e)](_0x46adaf(0x3af)),console[_0x46adaf(0x30e)](_0x46adaf(0x24b)),0x1;if(_0x52e4c6['description']===undefined)return console['error'](_0x46adaf(0x3c9)),console[_0x46adaf(0x30e)](_0x46adaf(0x3af)),console[_0x46adaf(0x30e)](_0x46adaf(0x24b)),0x1;if(_0x52e4c6[_0x46adaf(0x301)]===undefined)return console[_0x46adaf(0x30e)](_0x46adaf(0x3e4)),console['error'](_0x46adaf(0x38f)),0x1;let _0xb6ead8=_0x52e4c6[_0x46adaf(0x27a)];if(!_0xb6ead8&&_0x266f94[_0x46adaf(0x2e4)]){const _0x1d802a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x266f94['parentSegment']+_0x46adaf(0x355),()=>_0x3ea3fa[_0x46adaf(0x2a1)]['resolveParentId'](_0x266f94['parentSegment']),{'verbose':_0x266f94[_0x46adaf(0x384)]});_0xb6ead8=_0x1d802a['data'];}let _0x3db9a4;_0x52e4c6[_0x46adaf(0x2b1)]&&(_0x3db9a4=await loadJSON(_0x52e4c6[_0x46adaf(0x2b1)],![]));const _0x26a13d=_0x52e4c6['folderId']===_0x46adaf(0x202)?null:{'id':_0x52e4c6[_0x46adaf(0x301)],'type':_0x46adaf(0x2b7)};_0x27107f={'attributes':{'name':_0x52e4c6[_0x46adaf(0x33c)],'description':_0x52e4c6['description']||null,..._0xb6ead8!==undefined&&{'audienceId':_0xb6ead8},..._0x3db9a4!==undefined&&{'sections':_0x3db9a4}},'relationships':{'parentFolder':{'data':_0x26a13d}}};}const _0x14bee2=await withSpinner(_0x46adaf(0x29f)+(_0x27107f[_0x46adaf(0x2bf)]?.[_0x46adaf(0x33c)]??'')+'\x27...',()=>_0x3ea3fa[_0x46adaf(0x34e)][_0x46adaf(0x357)](_0x27107f),{'verbose':_0x266f94[_0x46adaf(0x384)]}),_0x23f7f7=_0x14bee2[_0x46adaf(0x252)];return console[_0x46adaf(0x30e)](_0x46adaf(0x3cb)+_0x23f7f7[_0x46adaf(0x33c)]+_0x46adaf(0x234)+_0x23f7f7['id']),await handleSDKOutput([_0x23f7f7],_0x266f94),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x308022(0x33c)]=a32_0x308022(0x20a);[a32_0x308022(0x24f)]=a32_0x308022(0x269);async[a32_0x308022(0x2df)](_0x34f314){const _0xc98748=a32_0x308022,{options:_0x5efddf,args:_0x57daf1}=_0x34f314,_0x7014bb=_0x5efddf,_0x38bd78=_0x57daf1[0x0];if(!_0x38bd78)return console[_0xc98748(0x30e)](_0xc98748(0x399)),console[_0xc98748(0x30e)](_0xc98748(0x2de)),console[_0xc98748(0x30e)](_0xc98748(0x36d)),0x1;let _0x4f6f16;if(_0x7014bb[_0xc98748(0x230)])_0x4f6f16=await loadJSON(_0x7014bb[_0xc98748(0x230)],!![]);else{if(!_0x7014bb[_0xc98748(0x33c)])return console[_0xc98748(0x30e)](_0xc98748(0x381)),console['error'](_0xc98748(0x2de)),0x1;if(_0x7014bb[_0xc98748(0x24f)]===undefined)return console[_0xc98748(0x30e)](_0xc98748(0x3c9)),console[_0xc98748(0x30e)](_0xc98748(0x2de)),0x1;let _0x320f6f;_0x7014bb[_0xc98748(0x2b1)]&&(_0x320f6f=await loadJSON(_0x7014bb['sections'],![])),_0x4f6f16={'attributes':{'name':_0x7014bb[_0xc98748(0x33c)],'description':_0x7014bb[_0xc98748(0x24f)]||null,..._0x320f6f!==undefined&&{'sections':_0x320f6f}}};}const {tdx:_0x3d8932}=_0x34f314,_0x523995=await withSpinner(_0xc98748(0x22b)+_0x38bd78+_0xc98748(0x355),()=>_0x3d8932[_0xc98748(0x34e)][_0xc98748(0x20d)](_0x38bd78,_0x4f6f16),{'verbose':_0x5efddf['verbose']}),_0x33519f=_0x523995[_0xc98748(0x252)];return console[_0xc98748(0x30e)]('✔\x20Updated\x20personalization\x20\x27'+_0x33519f['name']+_0xc98748(0x300)+_0x33519f['id']+')'),await handleSDKOutput([_0x33519f],_0x5efddf),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x308022(0x33c)]='ps:pz:init';['description']=a32_0x308022(0x322);async[a32_0x308022(0x2df)](_0x15b703){const _0x2d2085=a32_0x308022,{options:_0x54c3ac,args:_0x3da215}=_0x15b703,_0x54bdf0=_0x3da215[0x0]||_0x54c3ac[_0x2d2085(0x2e4)];if(!_0x54bdf0)return showParentSegmentNotSetError(_0x2d2085(0x209)+_0x2d2085(0x395)),0x1;const _0x10331d=resolveYamlFile(_0x54bdf0);if(!existsSync(_0x10331d))return showFileNotFoundError(_0x10331d,_0x54bdf0),0x1;let _0x15c979;try{_0x15c979=readFileSync(_0x10331d,_0x2d2085(0x3f1));}catch(_0x544ace){const _0x3452f2=_0x544ace instanceof Error?_0x544ace['message']:String(_0x544ace);return console['error'](_0x2d2085(0x3ac)+_0x3452f2),0x1;}let _0x3c19ee;try{_0x3c19ee=parseDef(_0x15c979);}catch(_0x2948d8){const _0x517ef7=_0x2948d8 instanceof Error?_0x2948d8[_0x2d2085(0x391)]:String(_0x2948d8);return console[_0x2d2085(0x30e)](a32_0x1c520c[_0x2d2085(0x27c)](_0x2d2085(0x1f3)+_0x517ef7)),0x1;}if(_0x3c19ee[_0x2d2085(0x32e)]&&_0x3c19ee[_0x2d2085(0x32e)][_0x2d2085(0x3f5)]>0x0)return console[_0x2d2085(0x30e)](a32_0x1c520c[_0x2d2085(0x1f2)](_0x2d2085(0x200)+_0x10331d)),console['error'](a32_0x1c520c[_0x2d2085(0x1e5)]('\x20\x20\x20'+_0x3c19ee['personalization_services']['length']+_0x2d2085(0x368))),0x1;!_0x3c19ee[_0x2d2085(0x3ec)]&&(_0x3c19ee[_0x2d2085(0x3ec)]={'events':[{'name':_0x2d2085(0x1ef),'source_table':_0x2d2085(0x343)}],'attributes':[{'name':_0x2d2085(0x31b),'type':_0x2d2085(0x338)}],'id_stitching':{'primary_key':_0x3c19ee[_0x2d2085(0x308)]['table']===_0x2d2085(0x383)?_0x2d2085(0x375):_0x2d2085(0x3e3)}});_0x3c19ee[_0x2d2085(0x32e)]=[{'name':_0x2d2085(0x212),'description':_0x2d2085(0x385),'trigger_event':'page_view','sections':[{'name':_0x2d2085(0x3b8),'criteria':_0x2d2085(0x3e2),'attributes':[_0x2d2085(0x31b)]}]}];const _0x1649fc=serializeDef(_0x3c19ee);return writeFileSync(_0x10331d,_0x1649fc,'utf-8'),console['error'](a32_0x1c520c['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a32_0x1c520c[_0x2d2085(0x2e9)](_0x10331d)),(!_0x3c19ee[_0x2d2085(0x3ec)]||_0x15c979[_0x2d2085(0x2a9)](_0x2d2085(0x2bb))===-0x1)&&console[_0x2d2085(0x30e)](a32_0x1c520c[_0x2d2085(0x335)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x2d2085(0x30e)]('\x0a'+a32_0x1c520c[_0x2d2085(0x1e5)](_0x2d2085(0x2fc))),console[_0x2d2085(0x30e)](_0x2d2085(0x32c)+_0x10331d+_0x2d2085(0x30b)),console['error']('\x20\x202.\x20Run\x20'+a32_0x1c520c[_0x2d2085(0x1e5)](_0x2d2085(0x3b4)+_0x54bdf0)+_0x2d2085(0x232)),0x0;}}
|
|
1
|
+
const a32_0x51f12c=a32_0x1aab;(function(_0x160221,_0x4f9c37){const _0x23654a=a32_0x1aab,_0x3efb63=_0x160221();while(!![]){try{const _0x5a4532=-parseInt(_0x23654a(0x210))/0x1*(parseInt(_0x23654a(0x230))/0x2)+parseInt(_0x23654a(0x12b))/0x3*(parseInt(_0x23654a(0x165))/0x4)+parseInt(_0x23654a(0x11d))/0x5+parseInt(_0x23654a(0xe8))/0x6*(-parseInt(_0x23654a(0x1de))/0x7)+parseInt(_0x23654a(0x91))/0x8+parseInt(_0x23654a(0x198))/0x9*(parseInt(_0x23654a(0x254))/0xa)+parseInt(_0x23654a(0xcf))/0xb;if(_0x5a4532===_0x4f9c37)break;else _0x3efb63['push'](_0x3efb63['shift']());}catch(_0x22ebd3){_0x3efb63['push'](_0x3efb63['shift']());}}}(a32_0x44ac,0xc6b39));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x4881da from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a32_0x1aab(_0x35ae26,_0x4ef574){_0x35ae26=_0x35ae26-0x8a;const _0x44acb5=a32_0x44ac();let _0x1aabd1=_0x44acb5[_0x35ae26];return _0x1aabd1;}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 a32_0x265203 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='parent_segments',LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x9e23c5){const _0x582b67=a32_0x1aab,_0x91000c=process[_0x582b67(0x113)],_0x2d2a0e=_0x91000c===_0x582b67(0x158)?_0x582b67(0x1e5):_0x91000c==='win32'?'start':_0x582b67(0x223);spawn(_0x2d2a0e,[_0x9e23c5],{'detached':!![],'stdio':_0x582b67(0x1dc)})['unref']();}function migrateLegacyDirectory(){const _0x415c9a=a32_0x1aab;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2ba7b9=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2ba7b9[_0x415c9a(0x1f4)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x415c9a(0x25f)](a32_0x265203['yellow'](_0x415c9a(0x14d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x415c9a(0x25f)](a32_0x265203[_0x415c9a(0x1c2)](_0x415c9a(0x1a4)+LEGACY_PARENT_SEGMENT_DIR+_0x415c9a(0x8b))),![];console[_0x415c9a(0x25f)](a32_0x265203[_0x415c9a(0xb5)](_0x415c9a(0x241)+LEGACY_PARENT_SEGMENT_DIR+_0x415c9a(0x21f)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x415c9a(0x25f)](a32_0x265203['green']('✔\x20Renamed\x20directory\x20to\x20'+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x43092a){const _0x54dd3b=_0x43092a instanceof Error?_0x43092a[_0x415c9a(0x183)]:String(_0x43092a);return console[_0x415c9a(0x25f)](a32_0x265203[_0x415c9a(0x153)](_0x415c9a(0x219)+_0x54dd3b+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x51f12c(0x186)](_0xe95cde){return migrateLegacyDirectory(),super['run'](_0xe95cde);}}function resolveYamlFile(_0x5bc596){const _0x1c64a4=a32_0x51f12c;if(_0x5bc596[_0x1c64a4(0x25a)](_0x1c64a4(0xde))||_0x5bc596[_0x1c64a4(0x25a)](_0x1c64a4(0x9c)))return _0x5bc596;return a32_0x4881da[_0x1c64a4(0x97)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5bc596)+_0x1c64a4(0xde));}function formatProgressMessage(_0x20d14c){const _0xcdd987=a32_0x51f12c,_0x7749c7=_0x20d14c[_0xcdd987(0xc9)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x7749c7){const [,_0x86f448,_0x5433d7,_0x5b91a2='']=_0x7749c7;return a32_0x265203[_0xcdd987(0x1c2)](_0x86f448+':')+'\x20'+_0x5433d7+a32_0x265203[_0xcdd987(0x1c2)](_0x5b91a2);}return a32_0x265203[_0xcdd987(0x1c2)](_0x20d14c);}function showFileNotFoundError(_0x29713b,_0xa66799){const _0x513052=a32_0x51f12c;console[_0x513052(0x25f)](a32_0x265203[_0x513052(0x153)](_0x513052(0x268)+_0x29713b+'\x0a')),console['error'](a32_0x265203[_0x513052(0xcd)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0xa66799+_0x513052(0xab)));}function displayRealtimeValidation(_0xa97455){const _0x7fed1d=a32_0x51f12c;if(!_0xa97455[_0x7fed1d(0x23e)])return;const _0x5c0b28=_0xa97455['realtime'],_0x51a62e=_0x5c0b28[_0x7fed1d(0x1ef)]?a32_0x265203['green']('⚡\x20Enabled'):a32_0x265203['yellow'](_0x7fed1d(0x19c));console[_0x7fed1d(0x25f)]('\x0a'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0x213))+'\x20'+_0x51a62e);if(_0x5c0b28[_0x7fed1d(0x121)]&&_0x5c0b28[_0x7fed1d(0x121)][_0x7fed1d(0x1ad)]>0x0){console[_0x7fed1d(0x25f)]('\x20\x20'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0xfb))+'\x20'+_0x5c0b28[_0x7fed1d(0x121)][_0x7fed1d(0x1ad)]+_0x7fed1d(0x1e3));for(const _0x30ca65 of _0x5c0b28['events']){const _0x13730a=_0x30ca65['sourceTableValid']===![]?a32_0x265203['red']('✘'):a32_0x265203[_0x7fed1d(0xff)]('✔');console[_0x7fed1d(0x25f)](_0x7fed1d(0x1cd)+_0x13730a+'\x20'+_0x30ca65[_0x7fed1d(0x282)]),_0x30ca65[_0x7fed1d(0x127)]&&console[_0x7fed1d(0x25f)](_0x7fed1d(0x202)+a32_0x265203[_0x7fed1d(0x153)](_0x30ca65[_0x7fed1d(0x127)]));}}if(_0x5c0b28[_0x7fed1d(0x170)]&&_0x5c0b28['attributes'][_0x7fed1d(0x1ad)]>0x0){console[_0x7fed1d(0x25f)]('\x20\x20'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0xa9))+'\x20'+_0x5c0b28['attributes']['length']+_0x7fed1d(0x1e3));for(const _0x4723cf of _0x5c0b28[_0x7fed1d(0x170)]){const _0x5bba1c=_0x4723cf[_0x7fed1d(0x263)]?a32_0x265203[_0x7fed1d(0xff)]('✔'):a32_0x265203['red']('✘');console['error'](_0x7fed1d(0x1cd)+_0x5bba1c+'\x20'+_0x4723cf[_0x7fed1d(0x282)]+'\x20'+a32_0x265203[_0x7fed1d(0x1c2)]('('+_0x4723cf['type']+')'));}}if(_0x5c0b28['idStitching']){const _0x4f81d1=_0x5c0b28[_0x7fed1d(0xe5)][_0x7fed1d(0xc0)]?.[_0x7fed1d(0x1ad)]?_0x7fed1d(0x258)+_0x5c0b28[_0x7fed1d(0xe5)]['stitchingKeys']['join'](',\x20')+']':'';console['error']('\x20\x20'+a32_0x265203['dim'](_0x7fed1d(0x125))+'\x20'+_0x5c0b28[_0x7fed1d(0xe5)]['primaryKey']+_0x4f81d1);}if(_0x5c0b28['personalizationServices']&&_0x5c0b28[_0x7fed1d(0xf9)][_0x7fed1d(0x1ad)]>0x0){console['error']('\x20\x20'+a32_0x265203[_0x7fed1d(0x1c2)](_0x7fed1d(0x1f9))+'\x20'+_0x5c0b28['personalizationServices'][_0x7fed1d(0x1ad)]+_0x7fed1d(0x237)+(_0x5c0b28[_0x7fed1d(0xf9)][_0x7fed1d(0x1ad)]!==0x1?'s':''));for(const _0x3acab8 of _0x5c0b28[_0x7fed1d(0xf9)]){console[_0x7fed1d(0x25f)](_0x7fed1d(0x25b)+_0x3acab8[_0x7fed1d(0x282)]);}}}function showParentSegmentNotSetError(_0x548746){const _0x2b66d3=a32_0x51f12c;console['error'](a32_0x265203['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x2b66d3(0x25f)](_0x548746);}export class ParentSegmentListCommand extends BaseCommand{[a32_0x51f12c(0x282)]='segment:parent:list';[a32_0x51f12c(0x12a)]='List\x20parent\x20segments';async[a32_0x51f12c(0x1fc)](_0x13b280){const _0x119b08=a32_0x51f12c,{options:_0x72b8af,args:_0x1d56e2,tdx:_0x188561}=_0x13b280,_0x4c6774=_0x1d56e2[0x0];_0x72b8af[_0x119b08(0x188)]&&(console['error'](_0x119b08(0x267)+_0x72b8af[_0x119b08(0xa0)]),_0x4c6774&&console[_0x119b08(0x25f)](_0x119b08(0x179)+_0x4c6774));const _0x81fb71=await withSpinner(_0x4c6774?_0x119b08(0xc4)+_0x4c6774+_0x119b08(0x138):_0x119b08(0x1b2),()=>_0x188561['segment'][_0x119b08(0x215)](),{'verbose':_0x72b8af[_0x119b08(0x188)]});let _0x2b8af4=_0x81fb71[_0x119b08(0xef)];if(_0x4c6774){const _0x497db2=_0x4c6774[_0x119b08(0xf6)](/[.+^${}()|[\]\\]/g,_0x119b08(0x1fd))[_0x119b08(0xf6)](/\*/g,'.*')['replace'](/\?/g,'.'),_0xa343c4=new RegExp('^'+_0x497db2+'$','i');_0x2b8af4=_0x2b8af4[_0x119b08(0x21d)](_0x3dabe7=>_0xa343c4[_0x119b08(0x1f5)](_0x3dabe7[_0x119b08(0x170)][_0x119b08(0x282)]));}_0x2b8af4[_0x119b08(0xbc)]((_0x3569e7,_0x43c6fd)=>_0x3569e7[_0x119b08(0x170)][_0x119b08(0x282)]['localeCompare'](_0x43c6fd[_0x119b08(0x170)][_0x119b08(0x282)])),console['error']('✔\x20Found\x20'+_0x2b8af4[_0x119b08(0x1ad)]+'\x20parent\x20segment'+(_0x2b8af4[_0x119b08(0x1ad)]!==0x1?'s':''));const _0x366601=_0x405c2a=>{const _0x2bb619=_0x119b08;return getConsoleNextUrl(_0x72b8af[_0x2bb619(0xa0)],'/app/dw/parentSegments/'+_0x405c2a);};if(_0x72b8af[_0x119b08(0x1bc)]===_0x119b08(0x1c6)||_0x72b8af[_0x119b08(0x1bc)]==='jsonl'){const _0x87c8f2=_0x2b8af4[_0x119b08(0xe1)](_0x18728e=>({..._0x18728e,'url':_0x366601(_0x18728e['id'])}));await handleSDKOutput(_0x87c8f2,_0x72b8af);}else{if(_0x2b8af4[_0x119b08(0x1ad)]===0x0)_0x4c6774?console[_0x119b08(0x16d)](_0x119b08(0x199)+_0x4c6774):console[_0x119b08(0x16d)]('No\x20parent\x20segments\x20found');else for(const _0x1e11af of _0x2b8af4){const _0x585df1=_0x1e11af[_0x119b08(0x170)]['population']?a32_0x265203[_0x119b08(0x1c2)]('\x20('+formatRows(_0x1e11af[_0x119b08(0x170)][_0x119b08(0xee)])+')'):'',_0x5d23f1=hyperlink(_0x1e11af[_0x119b08(0x170)][_0x119b08(0x282)],_0x366601(_0x1e11af['id']));console['log'](_0x119b08(0x1d3)+_0x5d23f1+_0x585df1);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a32_0x51f12c(0x282)]='segment:parent:create';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xda);async['execute'](_0x2d30e8){const _0x2e96af=a32_0x51f12c,{options:_0xd0880e,args:_0x1c5773,tdx:_0x59896f}=_0x2d30e8;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2e96af(0x1c5));const _0x568387=_0xd0880e;if(_0x1c5773[_0x2e96af(0x1ad)]===0x0)return console[_0x2e96af(0x25f)](a32_0x265203[_0x2e96af(0x153)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x2e96af(0x25f)](_0x2e96af(0x1bd)),0x1;const _0x1b7e2a=_0x1c5773[0x0];if(!_0x568387['database']||!_0x568387[_0x2e96af(0x203)])return console[_0x2e96af(0x25f)](_0x2e96af(0x1d0)),console[_0x2e96af(0x25f)](_0x2e96af(0x1bd)),0x1;_0x568387[_0x2e96af(0x188)]&&(console[_0x2e96af(0x25f)]('Site:\x20'+_0x568387[_0x2e96af(0xa0)]),console[_0x2e96af(0x25f)](_0x2e96af(0x200)+_0x1b7e2a),console[_0x2e96af(0x25f)](_0x2e96af(0x1b3)+_0x568387[_0x2e96af(0x197)]),console[_0x2e96af(0x25f)](_0x2e96af(0x249)+_0x568387[_0x2e96af(0x203)]));const _0x5a9a56=await loadJSONFromOptions(_0x568387[_0x2e96af(0x170)],_0x568387[_0x2e96af(0x235)]),_0x3fab6a=await loadJSONFromOptions(_0x568387[_0x2e96af(0x144)],_0x568387['behaviorsFile']),_0x1a50b2=await loadJSONFromOptions(_0x568387['customerGroup'],_0x568387['customerGroupFile']),_0xb5475e={'name':_0x1b7e2a,'description':_0x568387['description'],'scheduleType':_0x568387['scheduleType'],'scheduleOption':_0x568387[_0x2e96af(0x240)],'timezone':_0x568387[_0x2e96af(0x174)],'master':{'parentDatabaseName':_0x568387[_0x2e96af(0x197)],'parentTableName':_0x568387[_0x2e96af(0x203)]},'attributes':_0x5a9a56,'behaviors':_0x3fab6a,'customerGroup':_0x1a50b2},_0x3529a8=await withSpinner(_0x2e96af(0x1b9)+_0x1b7e2a+'\x27...',()=>_0x59896f[_0x2e96af(0x1c1)][_0x2e96af(0x28f)](_0xb5475e),{'verbose':_0xd0880e[_0x2e96af(0x188)]}),_0x318823=_0x3529a8[_0x2e96af(0xef)];return console[_0x2e96af(0x25f)](_0x2e96af(0x15e)+_0x318823[_0x2e96af(0x282)]+_0x2e96af(0x225)+_0x318823['id']),await handleSDKOutput([_0x318823],_0xd0880e),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xea);[a32_0x51f12c(0x12a)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a32_0x51f12c(0x1fc)](_0x3ade76){const _0x1d0bd4=a32_0x51f12c,{options:_0x1e083b,args:_0x1e44ec,tdx:_0x173f3e}=_0x3ade76;console[_0x1d0bd4(0x25f)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x1d0bd4(0x152)+_0x1d0bd4(0x1c5));const _0x2082dc=_0x1e083b;if(_0x1e44ec[_0x1d0bd4(0x1ad)]===0x0)return console[_0x1d0bd4(0x25f)](a32_0x265203[_0x1d0bd4(0x153)](_0x1d0bd4(0x1db))),console[_0x1d0bd4(0x25f)](_0x1d0bd4(0x23c)),0x1;const _0x3dc74c=_0x1e44ec[0x0];_0x2082dc['verbose']&&(console[_0x1d0bd4(0x25f)](_0x1d0bd4(0x267)+_0x2082dc['site']),console[_0x1d0bd4(0x25f)]('Parent\x20segment:\x20'+_0x3dc74c));const _0x3ccc61=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x3dc74c+_0x1d0bd4(0x138),()=>_0x173f3e[_0x1d0bd4(0x1c1)][_0x1d0bd4(0x195)](_0x3dc74c),{'verbose':_0x2082dc[_0x1d0bd4(0x188)]}),_0x1d4ed4=_0x3ccc61[_0x1d0bd4(0xef)],_0x13a08c=await loadJSONFromOptions(_0x2082dc[_0x1d0bd4(0x16e)],_0x2082dc[_0x1d0bd4(0x160)]),_0x493ff0=await loadJSONFromOptions(_0x2082dc['addBehaviors'],_0x2082dc[_0x1d0bd4(0x1c9)]),_0x103f8b={'name':_0x1d4ed4[_0x1d0bd4(0x282)],'description':_0x2082dc['description']!==undefined?_0x2082dc[_0x1d0bd4(0x12a)]:_0x1d4ed4['description'],'scheduleType':_0x2082dc[_0x1d0bd4(0x292)]!==undefined?_0x2082dc[_0x1d0bd4(0x292)]:_0x1d4ed4[_0x1d0bd4(0x292)],'scheduleOption':_0x2082dc[_0x1d0bd4(0x240)]!==undefined?_0x2082dc[_0x1d0bd4(0x240)]:_0x1d4ed4[_0x1d0bd4(0x240)],'timezone':_0x2082dc[_0x1d0bd4(0x174)]!==undefined?_0x2082dc[_0x1d0bd4(0x174)]:_0x1d4ed4[_0x1d0bd4(0x174)],'master':_0x1d4ed4['master'],'attributes':_0x13a08c?[..._0x1d4ed4[_0x1d0bd4(0x170)]||[],..._0x13a08c]:_0x1d4ed4[_0x1d0bd4(0x170)],'behaviors':_0x493ff0?[..._0x1d4ed4[_0x1d0bd4(0x144)]||[],..._0x493ff0]:_0x1d4ed4[_0x1d0bd4(0x144)],'customerGroup':_0x1d4ed4['customerGroup']},_0x1115e7=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x3dc74c+_0x1d0bd4(0x138),()=>_0x173f3e[_0x1d0bd4(0x1c1)]['updateParent'](_0x3dc74c,_0x103f8b),{'verbose':_0x2082dc['verbose']}),_0xe5322b=_0x1115e7[_0x1d0bd4(0xef)];return console['error'](_0x1d0bd4(0x143)+_0xe5322b[_0x1d0bd4(0x282)]+'\x27'),await handleSDKOutput([_0xe5322b],_0x2082dc),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xa7);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x159);async['execute'](_0x10aadd){const _0xc1ae91=a32_0x51f12c,{options:_0x1cac9c,args:_0x376406,tdx:_0x480704}=_0x10aadd,_0x12855a=_0x1cac9c,_0x3ab13d=_0x376406[0x0]||_0x1cac9c[_0xc1ae91(0x196)];if(!_0x3ab13d)return showParentSegmentNotSetError(_0xc1ae91(0x277)+_0xc1ae91(0xb7)),0x1;if(_0x12855a['use']&&_0x12855a[_0xc1ae91(0x96)])return console['error'](a32_0x265203[_0xc1ae91(0x153)](_0xc1ae91(0xbe))),console['error'](a32_0x265203[_0xc1ae91(0x1c2)](_0xc1ae91(0x1f0))),console['error'](a32_0x265203[_0xc1ae91(0x1c2)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xcd)](_0xc1ae91(0x27e))),0x1;const _0x26ef58=_0x12855a['output']||a32_0x4881da[_0xc1ae91(0x97)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3ab13d)+_0xc1ae91(0xde));_0x12855a[_0xc1ae91(0x188)]&&(console[_0xc1ae91(0x25f)](_0xc1ae91(0x267)+_0x12855a[_0xc1ae91(0xa0)]),console[_0xc1ae91(0x25f)](_0xc1ae91(0x234)+_0x3ab13d),console[_0xc1ae91(0x25f)](_0xc1ae91(0x1e7)+_0x26ef58));const _0x431f16=await withSpinner(_0xc1ae91(0xd0)+_0x3ab13d+_0xc1ae91(0x138),()=>_0x480704[_0xc1ae91(0x1c1)][_0xc1ae91(0xf7)](_0x3ab13d),{'verbose':_0x12855a[_0xc1ae91(0x188)]}),_0x3a8b52=_0x431f16[_0xc1ae91(0xef)];if(existsSync(_0x26ef58)){const _0x4a3f8b=readFileSync(_0x26ef58,_0xc1ae91(0x1f8)),_0x36b1d9=generateDiff(_0x4a3f8b,_0x3a8b52);if(!hasChanges(_0x36b1d9))console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xff)]('✔')+_0xc1ae91(0x222)+a32_0x265203[_0xc1ae91(0xcd)](_0x26ef58)+_0xc1ae91(0xbd));else{console[_0xc1ae91(0x25f)](_0xc1ae91(0x9f)+_0x26ef58+'\x27:'),console[_0xc1ae91(0x25f)]('─'[_0xc1ae91(0x12e)](0x3c)),console[_0xc1ae91(0x25f)](formatDiffWithColors(_0x36b1d9)),console[_0xc1ae91(0x25f)]('─'[_0xc1ae91(0x12e)](0x3c));if(!_0x12855a[_0xc1ae91(0x21e)]){if(!isInteractive())return console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0x153)](_0xc1ae91(0x18e)),_0xc1ae91(0x173)),console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0x1c2)](_0xc1ae91(0x26c))),0x1;const _0x56e208=await confirmKey(_0xc1ae91(0x1df)+_0x26ef58+'\x27?');if(!_0x56e208)return console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xb5)]('Aborted.')),0x1;}writeFileSync(_0x26ef58,_0x3a8b52,_0xc1ae91(0x1f8)),console['error'](a32_0x265203['green']('✔')+_0xc1ae91(0x1ec)+a32_0x265203[_0xc1ae91(0xcd)](_0x26ef58));}}else{const _0x31e5ae=a32_0x4881da['dirname'](_0x26ef58);!existsSync(_0x31e5ae)&&mkdirSync(_0x31e5ae,{'recursive':!![]}),writeFileSync(_0x26ef58,_0x3a8b52,_0xc1ae91(0x1f8)),console['error'](a32_0x265203['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a32_0x265203[_0xc1ae91(0xcd)](_0x26ef58));}return saveSessionContext({'parent_segment':_0x3ab13d},_0x12855a[_0xc1ae91(0x142)]),console[_0xc1ae91(0x25f)](a32_0x265203[_0xc1ae91(0xff)]('✔')+_0xc1ae91(0x11f)+a32_0x265203[_0xc1ae91(0x1c2)](_0xc1ae91(0x207))+_0xc1ae91(0x100)+a32_0x265203['cyan'](_0x3ab13d)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1ca);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x1a1);async[a32_0x51f12c(0x1fc)](_0x245edf){const _0x4844bd=a32_0x51f12c,{options:_0x3fe2ab,args:_0x50751f,tdx:_0x3496af}=_0x245edf,_0x25fc42=_0x3fe2ab,_0x4864f8=_0x50751f[0x0]||_0x3fe2ab[_0x4844bd(0x196)];if(!_0x4864f8)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+_0x4844bd(0x255)),0x1;const _0xae1bfe=resolveYamlFile(_0x4864f8);if(!existsSync(_0xae1bfe))return showFileNotFoundError(_0xae1bfe,_0x4864f8),0x1;_0x25fc42[_0x4844bd(0x188)]&&(console[_0x4844bd(0x25f)](_0x4844bd(0x267)+_0x25fc42['site']),console[_0x4844bd(0x25f)](_0x4844bd(0x295)+_0xae1bfe));let _0x56291e;try{_0x56291e=readFileSync(_0xae1bfe,_0x4844bd(0x1f8));}catch(_0x55bd39){const _0x2f60e2=_0x55bd39 instanceof Error?_0x55bd39[_0x4844bd(0x183)]:String(_0x55bd39);return console[_0x4844bd(0x25f)](_0x4844bd(0x1d1)+_0x2f60e2),0x1;}const _0x22944b=await withSpinner(_0x4844bd(0x270),()=>_0x3496af['segment'][_0x4844bd(0x285)](_0x56291e),{'verbose':_0x25fc42[_0x4844bd(0x188)]}),_0x5c508b=_0x22944b['data'],{isNew:_0x376f43,name:_0x2e2463,hasChanges:_0x461801,diffFormatted:_0x3d15d7}=_0x5c508b;if(!_0x461801)return console[_0x4844bd(0x25f)](_0x4844bd(0x178)+_0x2e2463+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x376f43?console[_0x4844bd(0x25f)](_0x4844bd(0x10d)+_0x2e2463+'\x27:'):console[_0x4844bd(0x25f)](_0x4844bd(0x1a6)+_0x2e2463+'\x27:');console[_0x4844bd(0x25f)]('─'[_0x4844bd(0x12e)](0x3c)),console[_0x4844bd(0x25f)](_0x3d15d7),console[_0x4844bd(0x25f)]('─'[_0x4844bd(0x12e)](0x3c));const _0x2e78d0=_0x376f43?_0x4844bd(0x109)+_0x2e2463+'\x27?':_0x4844bd(0x92)+_0x2e2463+'\x27?';if(!_0x25fc42['yes']){if(!isInteractive())return console[_0x4844bd(0x25f)](a32_0x265203[_0x4844bd(0x153)](_0x4844bd(0x18e)),_0x4844bd(0x173)),console[_0x4844bd(0x25f)](a32_0x265203[_0x4844bd(0x1c2)](_0x4844bd(0x26c))),0x1;const _0x5d3e27=await confirmKey(_0x2e78d0);if(!_0x5d3e27)return console[_0x4844bd(0x25f)](a32_0x265203['yellow'](_0x4844bd(0x126))),0x1;}const _0x29e088=_0x376f43?_0x4844bd(0x19e):_0x4844bd(0x1f6),_0x30e783=await withSpinner(_0x29e088+_0x4844bd(0x19b)+_0x2e2463+_0x4844bd(0x138),()=>_0x5c508b[_0x4844bd(0x10a)](),{'verbose':_0x25fc42[_0x4844bd(0x188)]}),_0x501256=_0x30e783['data'],_0x36c14b=getConsoleNextUrl(_0x25fc42[_0x4844bd(0xa0)],'/app/dw/parentSegments/'+_0x501256['id']),_0x59925a=_0x376f43?_0x4844bd(0x1bf):_0x4844bd(0x1cf);return console[_0x4844bd(0x25f)]('✔\x20'+_0x59925a+_0x4844bd(0x19b)+_0x501256[_0x4844bd(0x282)]+'\x27'),console[_0x4844bd(0x25f)]('\x20\x20'+_0x36c14b),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]='segment:parent:validate';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x10c);async[a32_0x51f12c(0x1fc)](_0x267d0f){const _0x1e16b3=a32_0x51f12c,{options:_0x34fd99,args:_0x8a819a,tdx:_0x35d479}=_0x267d0f,_0x263d15=_0x34fd99,_0x409a1d=_0x8a819a[0x0]||_0x34fd99[_0x1e16b3(0x196)];if(!_0x409a1d)return showParentSegmentNotSetError(_0x1e16b3(0x22b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x1e16b3(0x122)+_0x1e16b3(0x1e2)+_0x1e16b3(0x28c)+_0x1e16b3(0x18c)),0x1;const _0x414879=resolveYamlFile(_0x409a1d);if(!existsSync(_0x414879))return showFileNotFoundError(_0x414879,_0x409a1d),0x1;_0x263d15[_0x1e16b3(0x188)]&&(console[_0x1e16b3(0x25f)](_0x1e16b3(0x267)+_0x263d15['site']),console[_0x1e16b3(0x25f)](_0x1e16b3(0x295)+_0x414879));let _0x555a9d;try{_0x555a9d=readFileSync(_0x414879,_0x1e16b3(0x1f8));}catch(_0x5522bb){const _0x9cf894=_0x5522bb instanceof Error?_0x5522bb['message']:String(_0x5522bb);return console[_0x1e16b3(0x25f)]('Error\x20reading\x20file:\x20'+_0x9cf894),0x1;}const _0xa2617a=createCommandSpinner(a32_0x265203[_0x1e16b3(0x1c2)](_0x1e16b3(0x13b)),{'verbose':_0x263d15[_0x1e16b3(0x188)]});_0xa2617a[_0x1e16b3(0x17a)]();const _0x190988={'onProgress':_0x184a1f=>{const _0x35d432=_0x1e16b3;_0xa2617a[_0x35d432(0x190)]=formatProgressMessage(_0x184a1f);}};if(_0x263d15['master'])_0x190988[_0x1e16b3(0x257)]=!![];if(_0x263d15[_0x1e16b3(0x22c)])_0x190988[_0x1e16b3(0x22c)]=!![];_0x263d15[_0x1e16b3(0x8e)]&&(_0x190988[_0x1e16b3(0x8e)]=_0x263d15[_0x1e16b3(0x8e)]);_0x263d15[_0x1e16b3(0x94)]&&(_0x190988[_0x1e16b3(0x94)]=_0x263d15['behavior']);if(_0x263d15[_0x1e16b3(0x208)])_0x190988['interval']=_0x263d15[_0x1e16b3(0x208)];let _0x4d16f4;try{_0x4d16f4=await _0x35d479['segment'][_0x1e16b3(0xbb)](_0x555a9d,_0x190988),_0xa2617a[_0x1e16b3(0x1ea)]();}catch(_0x138af0){_0xa2617a[_0x1e16b3(0x1ea)]();throw _0x138af0;}const _0xe6a79b=_0x263d15[_0x1e16b3(0x208)]||'-1d';return this[_0x1e16b3(0x192)](_0x4d16f4,_0x190988,_0x414879,_0xe6a79b),_0x4d16f4[_0x1e16b3(0x220)]?0x0:0x1;}[a32_0x51f12c(0x192)](_0x428431,_0x5193b4,_0x585104,_0x3f5a5c){const _0x326e5d=a32_0x51f12c;console[_0x326e5d(0x25f)]('\x0a'+a32_0x265203[_0x326e5d(0x27a)](_0x326e5d(0xce))+'\x20'+_0x428431[_0x326e5d(0x282)]),console[_0x326e5d(0x25f)]('═'[_0x326e5d(0x12e)](0x3c)),this[_0x326e5d(0x13c)](_0x428431);if(typeof _0x5193b4[_0x326e5d(0x8e)]==='string'){this['displayAttributesStats'](_0x428431),this[_0x326e5d(0x110)](_0x428431),this[_0x326e5d(0xdf)](_0x585104,_0x3f5a5c,_0x326e5d(0x8e),_0x5193b4[_0x326e5d(0x8e)]);return;}if(_0x5193b4['attribute']===!![]){this[_0x326e5d(0xdb)](_0x428431),this[_0x326e5d(0x110)](_0x428431),this[_0x326e5d(0xdf)](_0x585104,_0x3f5a5c,_0x326e5d(0x170));return;}if(typeof _0x5193b4[_0x326e5d(0x94)]==='string'){this[_0x326e5d(0x18d)](_0x428431,_0x3f5a5c),this[_0x326e5d(0x110)](_0x428431),this['displayPreviewHints'](_0x585104,_0x3f5a5c,'behavior',_0x5193b4[_0x326e5d(0x94)]);return;}if(_0x5193b4[_0x326e5d(0x94)]===!![]){this[_0x326e5d(0x18d)](_0x428431,_0x3f5a5c),this['displaySummary'](_0x428431),this['displayPreviewHints'](_0x585104,_0x3f5a5c,_0x326e5d(0x144));return;}this['displayAttributesStats'](_0x428431),this[_0x326e5d(0x18d)](_0x428431,_0x3f5a5c),this[_0x326e5d(0xe6)](_0x428431),this[_0x326e5d(0x110)](_0x428431),this[_0x326e5d(0xdf)](_0x585104,_0x3f5a5c,_0x326e5d(0x1a3));}[a32_0x51f12c(0xe6)](_0x25321c){displayRealtimeValidation(_0x25321c);}[a32_0x51f12c(0xdf)](_0x29a28d,_0x4544bc,_0x36bcde,_0x1fc394){const _0x58a540=a32_0x51f12c;console[_0x58a540(0x25f)]('\x0a'+a32_0x265203[_0x58a540(0x1c2)]('To\x20view\x20sample\x20data:'));const _0x488e1a=_0x4544bc!==_0x58a540(0x25e)?_0x58a540(0x105)+_0x4544bc:'';if(_0x36bcde==='attribute'&&_0x1fc394)console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)](_0x58a540(0x28a)+_0x29a28d+_0x58a540(0x251)+_0x1fc394+'\x22'+_0x488e1a));else{if(_0x36bcde===_0x58a540(0x94)&&_0x1fc394)console['error']('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)]('tdx\x20ps\x20preview\x20'+_0x29a28d+_0x58a540(0x15f)+_0x1fc394+'\x22'+_0x488e1a));else(_0x36bcde===_0x58a540(0x170)||_0x36bcde===_0x58a540(0x1a3))&&console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)](_0x58a540(0x28a)+_0x29a28d+_0x58a540(0x20b)+_0x488e1a));}(_0x36bcde===_0x58a540(0x144)||_0x36bcde===_0x58a540(0x1a3))&&console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)]('tdx\x20ps\x20preview\x20'+_0x29a28d+'\x20--behavior\x20\x22<name>\x22'+_0x488e1a)),_0x36bcde===_0x58a540(0x1a3)&&console[_0x58a540(0x25f)]('\x20\x20'+a32_0x265203[_0x58a540(0x1c2)](_0x58a540(0x28a)+_0x29a28d+_0x58a540(0x26a)+_0x488e1a));}[a32_0x51f12c(0x13c)](_0x18f986){const _0x5668ba=a32_0x51f12c,{master:_0x278de4}=_0x18f986,_0x4c56b6=_0x278de4[_0x5668ba(0x247)]?a32_0x265203['green']('✔'):a32_0x265203[_0x5668ba(0x153)]('✘');console[_0x5668ba(0x25f)]('\x0a'+a32_0x265203[_0x5668ba(0x1c2)]('Master\x20Table')),console[_0x5668ba(0x25f)](_0x4c56b6+'\x20'+a32_0x265203[_0x5668ba(0x27a)](_0x278de4[_0x5668ba(0x197)]+'.'+_0x278de4[_0x5668ba(0x203)])),_0x278de4[_0x5668ba(0x247)]?_0x278de4[_0x5668ba(0x1dd)]!==undefined&&console[_0x5668ba(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5668ba(0x106))+'\x20'+a32_0x265203[_0x5668ba(0xcd)](formatRows(_0x278de4[_0x5668ba(0x1dd)]))):console[_0x5668ba(0x25f)]('\x20\x20'+a32_0x265203[_0x5668ba(0x153)]('Error:')+'\x20'+_0x278de4[_0x5668ba(0x9e)]);}['displayAttributesStats'](_0x3dba7f){const _0x428457=a32_0x51f12c;if(_0x3dba7f[_0x428457(0x170)]['length']===0x0)return;console[_0x428457(0x25f)]('\x0a'+a32_0x265203['dim'](_0x428457(0xec)));for(const _0x38e49f of _0x3dba7f[_0x428457(0x170)]){const _0xbd7421=_0x38e49f['schemaValid']?a32_0x265203[_0x428457(0xff)]('✔'):a32_0x265203[_0x428457(0x153)]('✘');let _0x3bc990='';if(_0x38e49f[_0x428457(0x247)]&&_0x38e49f[_0x428457(0x1d7)]!==undefined&&_0x38e49f[_0x428457(0xb0)]!==undefined){const _0x40e768=_0x38e49f[_0x428457(0xb0)]['toFixed'](0x1),_0x3b11f6=_0x38e49f[_0x428457(0xb0)]>=0x50?a32_0x265203[_0x428457(0xff)]:_0x38e49f[_0x428457(0xb0)]>=0x32?a32_0x265203[_0x428457(0xb5)]:a32_0x265203[_0x428457(0x153)];_0x3bc990='\x20'+a32_0x265203[_0x428457(0x1c2)](_0x428457(0x260))+'\x20'+_0x3b11f6(_0x40e768+'%')+'\x20('+formatRows(_0x38e49f[_0x428457(0x1d7)])+_0x428457(0x28b);}console[_0x428457(0x25f)](_0xbd7421+'\x20'+a32_0x265203[_0x428457(0x27a)](_0x38e49f[_0x428457(0x282)])+_0x3bc990),console[_0x428457(0x25f)]('\x20\x20'+a32_0x265203[_0x428457(0x1c2)](_0x428457(0x1f3))+'\x20'+a32_0x265203[_0x428457(0x27a)](_0x38e49f['database']+'.'+_0x38e49f[_0x428457(0x203)]));const _0x341036=_0x38e49f[_0x428457(0x141)]===_0x38e49f['foreignKey']?a32_0x265203['dim'](_0x428457(0x1c4))+'\x20'+_0x38e49f['joinKey']:a32_0x265203[_0x428457(0x1c2)]('Join:')+'\x20'+_0x38e49f[_0x428457(0x141)]+_0x428457(0x100)+_0x38e49f[_0x428457(0x120)];console['error']('\x20\x20'+_0x341036),console[_0x428457(0x25f)]('\x20\x20'+a32_0x265203[_0x428457(0x1c2)](_0x428457(0x22f))),this['displayColumns'](_0x38e49f[_0x428457(0x17f)]),!_0x38e49f['schemaValid']&&console[_0x428457(0x25f)]('\x20\x20'+a32_0x265203[_0x428457(0x153)](_0x428457(0x163))+'\x20'+_0x38e49f[_0x428457(0x9e)]);}}[a32_0x51f12c(0x18d)](_0x43d3f7,_0x1a2d1a){const _0x4dc6b1=a32_0x51f12c;if(_0x43d3f7[_0x4dc6b1(0x144)][_0x4dc6b1(0x1ad)]===0x0)return;console[_0x4dc6b1(0x25f)]('\x0a'+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x14a))+'\x20'+a32_0x265203[_0x4dc6b1(0x1c2)]('('+_0x1a2d1a+')'));for(const _0x5d4b21 of _0x43d3f7[_0x4dc6b1(0x144)]){const _0x223cf9=_0x5d4b21[_0x4dc6b1(0x247)]?a32_0x265203[_0x4dc6b1(0xff)]('✔'):a32_0x265203['red']('✘');let _0x458311='';if(_0x5d4b21[_0x4dc6b1(0x247)]&&_0x5d4b21[_0x4dc6b1(0x27f)]!==undefined&&_0x5d4b21['totalEvents']!==undefined){const _0x3fbd1d=_0x5d4b21[_0x4dc6b1(0x1fe)]?.[_0x4dc6b1(0x19a)](0x1)||'?',_0x43afe2=(_0x5d4b21[_0x4dc6b1(0x1fe)]??0x0)>=0x32?a32_0x265203['green']:(_0x5d4b21[_0x4dc6b1(0x1fe)]??0x0)>=0x14?a32_0x265203[_0x4dc6b1(0xb5)]:a32_0x265203['red'];_0x458311='\x20'+a32_0x265203[_0x4dc6b1(0x1c2)]('Customers:')+'\x20'+_0x43afe2(formatRows(_0x5d4b21[_0x4dc6b1(0x27f)]))+'\x20('+_0x3fbd1d+_0x4dc6b1(0x24d)+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0xfb))+'\x20'+a32_0x265203[_0x4dc6b1(0xcd)](formatRows(_0x5d4b21[_0x4dc6b1(0x1d2)]));}console[_0x4dc6b1(0x25f)](_0x223cf9+'\x20'+a32_0x265203[_0x4dc6b1(0x27a)](_0x5d4b21[_0x4dc6b1(0x282)])+_0x458311),console[_0x4dc6b1(0x25f)]('\x20\x20'+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x1f3))+'\x20'+a32_0x265203[_0x4dc6b1(0x27a)](_0x5d4b21[_0x4dc6b1(0x197)]+'.'+_0x5d4b21[_0x4dc6b1(0x203)]));const _0x3b7ff1=_0x5d4b21['joinKey']===_0x5d4b21['foreignKey']?a32_0x265203[_0x4dc6b1(0x1c2)]('Join\x20on:')+'\x20'+_0x5d4b21[_0x4dc6b1(0x141)]:a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x104))+'\x20'+_0x5d4b21[_0x4dc6b1(0x141)]+_0x4dc6b1(0x100)+_0x5d4b21[_0x4dc6b1(0x120)];console[_0x4dc6b1(0x25f)]('\x20\x20'+_0x3b7ff1),console[_0x4dc6b1(0x25f)]('\x20\x20'+a32_0x265203[_0x4dc6b1(0x1c2)](_0x4dc6b1(0x22f))),this[_0x4dc6b1(0x130)](_0x5d4b21[_0x4dc6b1(0x17f)]),!_0x5d4b21['schemaValid']&&console[_0x4dc6b1(0x25f)]('\x20\x20'+a32_0x265203[_0x4dc6b1(0x153)](_0x4dc6b1(0x163))+'\x20'+_0x5d4b21['schemaError']);}}['displayColumns'](_0xaae546){const _0x50d1bb=a32_0x51f12c;for(const _0x134e24 of _0xaae546){_0x134e24['label']===_0x134e24[_0x50d1bb(0x8c)]||_0x134e24[_0x50d1bb(0x8c)]==='*'?console[_0x50d1bb(0x25f)](_0x50d1bb(0x25b)+_0x134e24[_0x50d1bb(0x24b)]):console['error'](_0x50d1bb(0x25b)+_0x134e24[_0x50d1bb(0x24b)]+'\x20'+a32_0x265203[_0x50d1bb(0x1c2)]('('+_0x134e24[_0x50d1bb(0x8c)]+')'));}}[a32_0x51f12c(0x110)](_0x1effa2){const _0x353c99=a32_0x51f12c;console[_0x353c99(0x25f)]('─'[_0x353c99(0x12e)](0x3c));if(_0x1effa2[_0x353c99(0x232)][_0x353c99(0x1ad)]>0x0){console[_0x353c99(0x25f)]('\x0a'+a32_0x265203[_0x353c99(0x153)]('Errors:'));for(const _0x13dfbd of _0x1effa2[_0x353c99(0x232)]){console[_0x353c99(0x25f)]('\x20\x20'+a32_0x265203['red']('•')+'\x20'+_0x13dfbd);}}_0x1effa2[_0x353c99(0x220)]&&console[_0x353c99(0x25f)]('\x0a'+a32_0x265203[_0x353c99(0xff)]('✔')+_0x353c99(0x148));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1a7);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xfe);async['execute'](_0x1872d6){const _0x43c954=a32_0x51f12c,{options:_0x33745a,args:_0x5a3624,tdx:_0x4e27ae}=_0x1872d6,_0x5c6c2c=_0x33745a,_0x476823=_0x5a3624[0x0]||_0x33745a[_0x43c954(0x196)];if(!_0x476823)return showParentSegmentNotSetError(_0x43c954(0x10e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0x43c954(0xe7)+_0x43c954(0x149)+_0x43c954(0xf8)+_0x43c954(0x274)+_0x43c954(0xd7)+_0x43c954(0x18c)),0x1;if(!_0x5c6c2c[_0x43c954(0x257)]&&!_0x5c6c2c[_0x43c954(0x8e)]&&!_0x5c6c2c[_0x43c954(0x94)]&&!_0x5c6c2c[_0x43c954(0x22c)])return console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0x239))),console[_0x43c954(0x25f)](_0x43c954(0xaf)),console[_0x43c954(0x25f)](_0x43c954(0x24f)),console[_0x43c954(0x25f)](_0x43c954(0x17b)),console[_0x43c954(0x25f)](_0x43c954(0x132)),console[_0x43c954(0x25f)]('\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior'),console[_0x43c954(0x25f)](_0x43c954(0x15c)),0x1;const _0x2b3a44=resolveYamlFile(_0x476823);if(!existsSync(_0x2b3a44))return showFileNotFoundError(_0x2b3a44,_0x476823),0x1;_0x5c6c2c['verbose']&&(console[_0x43c954(0x25f)](_0x43c954(0x267)+_0x5c6c2c['site']),console['error'](_0x43c954(0x295)+_0x2b3a44));let _0x414606;try{_0x414606=readFileSync(_0x2b3a44,_0x43c954(0x1f8));}catch(_0x3b9746){const _0x1de781=_0x3b9746 instanceof Error?_0x3b9746['message']:String(_0x3b9746);return console[_0x43c954(0x25f)]('Error\x20reading\x20file:\x20'+_0x1de781),0x1;}let _0x5ad31d;try{_0x5ad31d=parseDef(_0x414606);}catch(_0x31f7f9){const _0x57a9d0=_0x31f7f9 instanceof Error?_0x31f7f9[_0x43c954(0x183)]:String(_0x31f7f9);return console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0x99)+_0x57a9d0)),0x1;}if(_0x5c6c2c['attribute']===!![]||_0x5c6c2c[_0x43c954(0x8e)]===''){const _0xf3fa1b=_0x5ad31d[_0x43c954(0x170)]?.[_0x43c954(0xe1)](_0x2c38f7=>_0x2c38f7[_0x43c954(0x282)])||[];if(_0xf3fa1b[_0x43c954(0x1ad)]===0x0)console[_0x43c954(0x25f)](a32_0x265203['red'](_0x43c954(0xdd)));else{console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0xc1))),console['error']('Available\x20attributes:');for(const _0x35f23f of _0xf3fa1b){console[_0x43c954(0x25f)]('\x20\x20'+a32_0x265203[_0x43c954(0xcd)](_0x35f23f));}console[_0x43c954(0x25f)](_0x43c954(0x276)+_0x476823+_0x43c954(0x251)+_0xf3fa1b[0x0]+'\x22');}return 0x1;}if(_0x5c6c2c[_0x43c954(0x94)]===!![]||_0x5c6c2c[_0x43c954(0x94)]===''){const _0x1492b0=_0x5ad31d[_0x43c954(0x144)]?.[_0x43c954(0xe1)](_0x170805=>_0x170805[_0x43c954(0x282)])||[];if(_0x1492b0[_0x43c954(0x1ad)]===0x0)console[_0x43c954(0x25f)](a32_0x265203['red'](_0x43c954(0x1e0)));else{console[_0x43c954(0x25f)](a32_0x265203[_0x43c954(0x153)](_0x43c954(0xb8))),console['error']('Available\x20behaviors:');for(const _0x4198b3 of _0x1492b0){console[_0x43c954(0x25f)]('\x20\x20'+a32_0x265203[_0x43c954(0xcd)](_0x4198b3));}console[_0x43c954(0x25f)](_0x43c954(0x276)+_0x476823+_0x43c954(0x15f)+_0x1492b0[0x0]+'\x22');}return 0x1;}const _0x4e15aa=createCommandSpinner(a32_0x265203[_0x43c954(0x1c2)](_0x43c954(0xc8)),{'verbose':_0x5c6c2c[_0x43c954(0x188)]});_0x4e15aa[_0x43c954(0x17a)]();const _0x2987f3={'onProgress':_0x53adeb=>{const _0x3b5aaf=_0x43c954;_0x4e15aa[_0x3b5aaf(0x190)]=formatProgressMessage(_0x53adeb);}};if(_0x5c6c2c[_0x43c954(0x257)])_0x2987f3[_0x43c954(0x257)]=!![];if(_0x5c6c2c[_0x43c954(0x8e)]&&typeof _0x5c6c2c[_0x43c954(0x8e)]===_0x43c954(0x18f))_0x2987f3[_0x43c954(0x8e)]=_0x5c6c2c[_0x43c954(0x8e)];if(_0x5c6c2c['behavior']&&typeof _0x5c6c2c[_0x43c954(0x94)]===_0x43c954(0x18f))_0x2987f3['behavior']=_0x5c6c2c['behavior'];if(_0x5c6c2c[_0x43c954(0x22c)])_0x2987f3[_0x43c954(0x22c)]=!![];if(_0x5c6c2c['interval'])_0x2987f3[_0x43c954(0x208)]=_0x5c6c2c[_0x43c954(0x208)];let _0x37e0b2;try{_0x37e0b2=await _0x4e27ae[_0x43c954(0x1c1)][_0x43c954(0x9d)](_0x414606,_0x2987f3),_0x4e15aa[_0x43c954(0x1ea)]();}catch(_0x162d3e){_0x4e15aa[_0x43c954(0x1ea)]();throw _0x162d3e;}return await this['displayPreviewResults'](_0x37e0b2,{'master':_0x5c6c2c[_0x43c954(0x257)],'attribute':typeof _0x5c6c2c[_0x43c954(0x8e)]==='string'?_0x5c6c2c[_0x43c954(0x8e)]:undefined,'behavior':typeof _0x5c6c2c[_0x43c954(0x94)]===_0x43c954(0x18f)?_0x5c6c2c[_0x43c954(0x94)]:undefined,'enriched':_0x5c6c2c[_0x43c954(0x22c)]}),_0x37e0b2[_0x43c954(0x220)]?0x0:0x1;}async[a32_0x51f12c(0x294)](_0xea5b1b,_0x23a5cc){const _0x2ca8a2=a32_0x51f12c;console['error']('\x0a'+a32_0x265203[_0x2ca8a2(0x27a)](_0x2ca8a2(0x172))+'\x20'+_0xea5b1b[_0x2ca8a2(0x282)]),console[_0x2ca8a2(0x25f)]('═'[_0x2ca8a2(0x12e)](0x3c));if(_0x23a5cc[_0x2ca8a2(0x257)]&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x27fb72=a32_0x265203[_0x2ca8a2(0x1c2)](_0x2ca8a2(0xf0))+'\x20'+a32_0x265203[_0x2ca8a2(0x27a)](_0xea5b1b[_0x2ca8a2(0x257)][_0x2ca8a2(0x197)]+'.'+_0xea5b1b[_0x2ca8a2(0x257)][_0x2ca8a2(0x203)]);await this[_0x2ca8a2(0x189)](_0x27fb72,_0xea5b1b[_0x2ca8a2(0x269)]);}else{if(_0x23a5cc['attribute']&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x2a8ce8=a32_0x265203[_0x2ca8a2(0x1c2)](_0x2ca8a2(0x151))+'\x20'+a32_0x265203[_0x2ca8a2(0x27a)](_0x23a5cc['attribute']);await this[_0x2ca8a2(0x189)](_0x2a8ce8,_0xea5b1b[_0x2ca8a2(0x269)]);}else{if(_0x23a5cc[_0x2ca8a2(0x94)]&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x2ad307=a32_0x265203[_0x2ca8a2(0x1c2)](_0x2ca8a2(0xa4))+'\x20'+a32_0x265203['bold'](_0x23a5cc[_0x2ca8a2(0x94)]);await this['displaySampleData'](_0x2ad307,_0xea5b1b[_0x2ca8a2(0x269)]);}else{if(_0x23a5cc[_0x2ca8a2(0x22c)]&&_0xea5b1b[_0x2ca8a2(0x269)]){const _0x3fcc29=a32_0x265203['dim'](_0x2ca8a2(0x1e4))+'\x20'+a32_0x265203['bold']('Master\x20+\x20Attributes');await this[_0x2ca8a2(0x189)](_0x3fcc29,_0xea5b1b[_0x2ca8a2(0x269)]);}else!_0xea5b1b[_0x2ca8a2(0x269)]&&console[_0x2ca8a2(0x25f)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0xea5b1b[_0x2ca8a2(0x232)][_0x2ca8a2(0x1ad)]>0x0){console[_0x2ca8a2(0x25f)]('─'['repeat'](0x3c)),console[_0x2ca8a2(0x25f)]('\x0a'+a32_0x265203[_0x2ca8a2(0x153)](_0x2ca8a2(0x161)));for(const _0xd9989 of _0xea5b1b[_0x2ca8a2(0x232)]){console[_0x2ca8a2(0x25f)]('\x20\x20'+a32_0x265203['red']('•')+'\x20'+_0xd9989);}}}async[a32_0x51f12c(0x189)](_0x202c6c,_0x2024b8){const _0x2153ad=a32_0x51f12c;if(_0x2024b8[_0x2153ad(0x1ad)]===0x0){console[_0x2153ad(0x25f)]('\x0a'+_0x202c6c),console[_0x2153ad(0x25f)](_0x2153ad(0x146));return;}console['error']('\x0a'+_0x202c6c);const _0x3ec699=Object['keys'](_0x2024b8[0x0])['map'](_0x149fbf=>({'name':_0x149fbf,'type':typeof _0x2024b8[0x0][_0x149fbf]==='number'?_0x2153ad(0x108):'varchar'})),_0x52d074={'queryId':_0x2153ad(0x177),'columns':_0x3ec699,'data':_0x2024b8,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x2024b8[_0x2153ad(0x1ad)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x56be66=formatAsTable(_0x52d074,_0x2024b8['length'],!![]);await writeOutput(_0x56be66,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x23b);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xc2);async['execute'](_0x59b7f0){const _0x5d50ae=a32_0x51f12c,{options:_0x54fe5d,args:_0x494c6d,tdx:_0x568dc6}=_0x59b7f0,_0x28963a=_0x54fe5d,_0x1105a4=_0x494c6d[0x0]||_0x54fe5d['parentSegment'];if(!_0x1105a4)return showParentSegmentNotSetError(_0x5d50ae(0x9a)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0xcd3402=resolveYamlFile(_0x1105a4);if(existsSync(_0xcd3402)){_0x28963a[_0x5d50ae(0x188)]&&console['error'](_0x5d50ae(0x166)+_0xcd3402);let _0xc647a6;try{_0xc647a6=readFileSync(_0xcd3402,_0x5d50ae(0x1f8));}catch(_0x266561){const _0x20c604=_0x266561 instanceof Error?_0x266561['message']:String(_0x266561);return console['error'](_0x5d50ae(0x1d1)+_0x20c604),0x1;}const _0x3e9861=await withSpinner(_0x5d50ae(0x270),()=>_0x568dc6[_0x5d50ae(0x1c1)][_0x5d50ae(0x285)](_0xc647a6),{'verbose':_0x28963a['verbose']}),_0x253818=_0x3e9861[_0x5d50ae(0xef)],{isNew:_0x414ed6,name:_0x536829,hasChanges:_0x5b8f71,diffFormatted:_0x1c36a3}=_0x253818;if(_0x5b8f71){_0x414ed6?console[_0x5d50ae(0x25f)](_0x5d50ae(0x10d)+_0x536829+'\x27:'):console[_0x5d50ae(0x25f)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x536829+'\x27:');console[_0x5d50ae(0x25f)]('─'[_0x5d50ae(0x12e)](0x3c)),console[_0x5d50ae(0x25f)](_0x1c36a3),console[_0x5d50ae(0x25f)]('─'['repeat'](0x3c));const _0xde7371=_0x414ed6?'Create\x20parent\x20segment\x20\x27'+_0x536829+_0x5d50ae(0x211):_0x5d50ae(0x92)+_0x536829+_0x5d50ae(0x211);if(!_0x28963a[_0x5d50ae(0x21e)]){if(!isInteractive())return console['error'](a32_0x265203[_0x5d50ae(0x153)](_0x5d50ae(0x18e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5d50ae(0x25f)](a32_0x265203['dim'](_0x5d50ae(0x26c))),0x1;const _0x3443dd=await confirmKey(_0xde7371);if(!_0x3443dd)return console[_0x5d50ae(0x25f)](a32_0x265203[_0x5d50ae(0xb5)]('Aborted.')),0x1;}const _0xbeea8e=_0x414ed6?_0x5d50ae(0x19e):_0x5d50ae(0x1f6);await withSpinner(_0xbeea8e+_0x5d50ae(0x19b)+_0x536829+_0x5d50ae(0x138),()=>_0x253818[_0x5d50ae(0x10a)](),{'verbose':_0x28963a[_0x5d50ae(0x188)]});const _0x556a4f=_0x414ed6?_0x5d50ae(0x1bf):_0x5d50ae(0x1cf);console['error']('✔\x20'+_0x556a4f+_0x5d50ae(0x19b)+_0x536829+'\x27');}else console[_0x5d50ae(0x25f)](_0x5d50ae(0x178)+_0x536829+'\x27\x20is\x20up\x20to\x20date');}const _0x4e63bb=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x1105a4+_0x5d50ae(0x138),()=>_0x568dc6[_0x5d50ae(0x1c1)]['runParent'](_0x1105a4),{'verbose':_0x28963a[_0x5d50ae(0x188)]}),_0x24b90b=_0x4e63bb['data'],_0x49143f=getConsoleUrl(_0x28963a[_0x5d50ae(0xa0)],_0x5d50ae(0x233)+_0x24b90b[_0x5d50ae(0x1c7)]+_0x5d50ae(0x291)+_0x24b90b[_0x5d50ae(0x131)]+_0x5d50ae(0x217)+_0x24b90b['workflowAttemptId']);return console[_0x5d50ae(0x25f)](_0x5d50ae(0x1fb)),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5d50ae(0x181))+'\x20'+_0x24b90b[_0x5d50ae(0x231)]),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5d50ae(0x21c))+'\x20'+_0x24b90b[_0x5d50ae(0x252)]),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203['dim'](_0x5d50ae(0x1f1))+'\x20'+_0x24b90b[_0x5d50ae(0x131)]),console[_0x5d50ae(0x25f)]('\x20\x20'+a32_0x265203[_0x5d50ae(0x1c2)](_0x5d50ae(0x95))+'\x20'+_0x24b90b[_0x5d50ae(0x1d8)]),console[_0x5d50ae(0x25f)]('\x20\x20'+_0x49143f),console[_0x5d50ae(0x25f)]('\x0a'+a32_0x265203[_0x5d50ae(0x1c2)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x24b90b[_0x5d50ae(0x1d8)]+_0x5d50ae(0x17c)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1ac);['description']=a32_0x51f12c(0x10f);async[a32_0x51f12c(0x1fc)](_0x5e6202){const _0x3a5523=a32_0x51f12c,{options:_0x9cc5c0,args:_0x23fb33,tdx:_0x2ecef6}=_0x5e6202,_0x24e1b1=_0x23fb33[0x0]||_0x9cc5c0['parentSegment'];if(!_0x24e1b1)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x9cc5c0[_0x3a5523(0x188)]&&(console[_0x3a5523(0x25f)]('Site:\x20'+_0x9cc5c0['site']),console['error']('Parent\x20segment:\x20'+_0x24e1b1));const _0x1fdbbb=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x24e1b1+_0x3a5523(0x138),()=>_0x2ecef6['segment']['listFields'](_0x24e1b1),{'verbose':_0x9cc5c0[_0x3a5523(0x188)]}),_0x2c5771=_0x1fdbbb[_0x3a5523(0xef)];console[_0x3a5523(0x25f)]('✔\x20Found\x20'+_0x2c5771[_0x3a5523(0x1ad)]+_0x3a5523(0x218)+(_0x2c5771[_0x3a5523(0x1ad)]!==0x1?'s':''));if(_0x9cc5c0[_0x3a5523(0x1c6)]||_0x9cc5c0[_0x3a5523(0x114)])return await handleSDKOutput(_0x2c5771,_0x9cc5c0),0x0;return displayFieldsHumanReadable(_0x2c5771,_0x24e1b1),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x212);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xcb);async[a32_0x51f12c(0x1fc)](_0xccec80){const _0x321e0a=a32_0x51f12c,{options:_0xeedeee,args:_0x36d658,tdx:_0x17c07b}=_0xccec80,_0x5c6423=_0xeedeee,_0x4a8e4b=_0x36d658[0x0]||_0xeedeee[_0x321e0a(0x196)];if(!_0x4a8e4b)return showParentSegmentNotSetError(_0x321e0a(0x20e)+_0x321e0a(0x22e)+_0x321e0a(0x122)+_0x321e0a(0x278)),0x1;_0xeedeee[_0x321e0a(0x188)]&&(console[_0x321e0a(0x25f)](_0x321e0a(0x267)+_0xeedeee[_0x321e0a(0xa0)]),console[_0x321e0a(0x25f)](_0x321e0a(0x234)+_0x4a8e4b));const _0x587e9a=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4a8e4b+_0x321e0a(0x138),()=>_0x17c07b['segment'][_0x321e0a(0x195)](_0x4a8e4b),{'verbose':_0xeedeee[_0x321e0a(0x188)]}),_0x37f44c=_0x587e9a[_0x321e0a(0xef)];if(_0x5c6423[_0x321e0a(0x137)]){const _0x267d9b=getConsoleNextUrl(_0x5c6423[_0x321e0a(0xa0)],'/app/dw/parentSegments/'+_0x37f44c['id']);return console[_0x321e0a(0x25f)](a32_0x265203[_0x321e0a(0xff)]('✔')+_0x321e0a(0x124)+a32_0x265203[_0x321e0a(0xcd)](_0x267d9b)),openBrowser(_0x267d9b),0x0;}return await handleSingleObjectOutput(_0x37f44c,_0xeedeee),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x139);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x13a);async[a32_0x51f12c(0x1fc)](_0x18eb0c){const _0x1ff74a=a32_0x51f12c,{options:_0x4e5fd3,args:_0x58c734,tdx:_0x5ca95d}=_0x18eb0c,_0x4adf28=_0x4e5fd3,_0x2adadf=_0x58c734[0x0]||_0x4e5fd3[_0x1ff74a(0x196)];if(!_0x2adadf)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'+_0x1ff74a(0x1da)+'Options:\x0a'+_0x1ff74a(0x17e)),0x1;_0x4e5fd3[_0x1ff74a(0x188)]&&(console[_0x1ff74a(0x25f)](_0x1ff74a(0x267)+_0x4e5fd3[_0x1ff74a(0xa0)]),console[_0x1ff74a(0x25f)](_0x1ff74a(0x234)+_0x2adadf));const _0x5da166=await withSpinner(_0x1ff74a(0x168)+_0x2adadf+_0x1ff74a(0x138),()=>_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0x242)](_0x2adadf),{'verbose':_0x4e5fd3[_0x1ff74a(0x188)]}),_0x9a90b8=_0x5da166[_0x1ff74a(0xef)],_0x4f4b06=_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0x1c0)](_0x9a90b8);if(_0x4adf28[_0x1ff74a(0x96)]){const _0x11f99c=await this[_0x1ff74a(0x287)](_0x18eb0c,_0x2adadf,_0x9a90b8,_0x4f4b06),_0x109365=this[_0x1ff74a(0x281)](_0x11f99c);writeFileSync(_0x4adf28[_0x1ff74a(0x96)],_0x109365);const _0x3d3e9a=_0x11f99c[_0x1ff74a(0x204)][_0x1ff74a(0x17f)][_0x1ff74a(0x1ad)]+_0x11f99c[_0x1ff74a(0x144)][_0x1ff74a(0x20a)]((_0xb5fadd,_0x42a2e0)=>_0xb5fadd+_0x42a2e0[_0x1ff74a(0x17f)][_0x1ff74a(0x1ad)],0x0),_0x393f=_0x11f99c[_0x1ff74a(0x144)][_0x1ff74a(0x21d)](_0x12d309=>_0x12d309['columns'][_0x1ff74a(0x1ad)]===0x0)[_0x1ff74a(0x1ad)];return console[_0x1ff74a(0x16d)](_0x1ff74a(0x15a)+_0x4adf28[_0x1ff74a(0x96)]),console['log'](_0x1ff74a(0xa6)+_0x4f4b06),console['log'](_0x1ff74a(0xba)+_0x11f99c['behaviors']['length']+_0x1ff74a(0x10b)),console[_0x1ff74a(0x16d)](_0x1ff74a(0xf1)+_0x3d3e9a+'\x20total'),_0x393f>0x0&&console[_0x1ff74a(0x16d)]('\x20\x20Note:\x20'+_0x393f+_0x1ff74a(0x229)),0x0;}console[_0x1ff74a(0x25f)]('\x0a'+a32_0x265203[_0x1ff74a(0x27a)](_0x1ff74a(0xfc))+'\x20'+a32_0x265203[_0x1ff74a(0xcd)](_0x4f4b06));const _0x31c1e7=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0x1e9)](_0x9a90b8),{'verbose':_0x4e5fd3[_0x1ff74a(0x188)]});console[_0x1ff74a(0x25f)]('\x0a'+a32_0x265203[_0x1ff74a(0x27a)]('customers')+'\x20'+a32_0x265203[_0x1ff74a(0x1c2)]('('+_0x4f4b06+_0x1ff74a(0x118)));const _0x2aa6b1=await executeSchemaQuery(_0x31c1e7[_0x1ff74a(0xef)],_0x5ca95d,_0x4e5fd3);await handleQueryOutput(_0x2aa6b1,_0x4e5fd3);const _0x4ffb02=await withSpinner(_0x1ff74a(0x250),()=>_0x5ca95d[_0x1ff74a(0x1c1)][_0x1ff74a(0xc7)](_0x9a90b8),{'verbose':_0x4e5fd3[_0x1ff74a(0x188)]});for(const _0x580f89 of _0x4ffb02[_0x1ff74a(0xef)]){const _0x4a7bce='behavior_'+_0x580f89[_0x1ff74a(0x27d)]()[_0x1ff74a(0xf6)](/\s+/g,'_'),_0x5c9941=_0x1ff74a(0x228)+_0x4f4b06+'.'+_0x4a7bce;console['error']('\x0a'+a32_0x265203['bold'](_0x580f89)+'\x20'+a32_0x265203[_0x1ff74a(0x1c2)]('('+_0x4f4b06+'.'+_0x4a7bce+')'));try{const _0x2d6257=await executeSchemaQuery(_0x5c9941,_0x5ca95d,_0x4e5fd3);await handleQueryOutput(_0x2d6257,_0x4e5fd3);}catch{console['error'](a32_0x265203[_0x1ff74a(0xb5)](_0x1ff74a(0x20c)));}}return 0x0;}async[a32_0x51f12c(0x287)](_0x19e6da,_0x1fdfdd,_0x2ff90e,_0x28ce83){const _0x20befb=a32_0x51f12c,{options:_0x1b6d65,tdx:_0x20dc90}=_0x19e6da,_0x42cb5e=await withSpinner(_0x20befb(0x1e8),()=>_0x20dc90[_0x20befb(0x1c1)]['getParentSQL'](_0x2ff90e),{'verbose':_0x1b6d65[_0x20befb(0x188)]}),_0x4c769b=await executeSchemaQuery(_0x42cb5e[_0x20befb(0xef)],_0x20dc90,_0x1b6d65),_0x5b47a2=_0x4c769b[_0x20befb(0xef)][_0x20befb(0xe1)](_0x7a730a=>({'name':_0x7a730a[_0x20befb(0x26d)],'type':_0x7a730a[_0x20befb(0x1ed)]})),_0x1362a0=await withSpinner(_0x20befb(0x250),()=>_0x20dc90[_0x20befb(0x1c1)][_0x20befb(0xc7)](_0x2ff90e),{'verbose':_0x1b6d65[_0x20befb(0x188)]}),_0x3d9ddb=[];for(const _0x1d258c of _0x1362a0[_0x20befb(0xef)]){const _0x5901f1=_0x20befb(0xca)+_0x1d258c[_0x20befb(0x27d)]()[_0x20befb(0xf6)](/\s+/g,'_'),_0x494731=_0x20befb(0x228)+_0x28ce83+'.'+_0x5901f1;let _0x81b53c=[];try{const _0x477bf9=await executeSchemaQuery(_0x494731,_0x20dc90,_0x1b6d65);_0x81b53c=_0x477bf9[_0x20befb(0xef)][_0x20befb(0xe1)](_0x1f4fba=>({'name':_0x1f4fba[_0x20befb(0x26d)],'type':_0x1f4fba[_0x20befb(0x1ed)]}));}catch{}_0x3d9ddb['push']({'table':_0x5901f1,'columns':_0x81b53c});}return{'database':_0x28ce83,'parent_segment':_0x1fdfdd,'parent_id':_0x2ff90e,'customers':{'table':_0x20befb(0x204),'columns':_0x5b47a2},'behaviors':_0x3d9ddb};}[a32_0x51f12c(0x281)](_0x3256ed){const _0x52d2e5=a32_0x51f12c,_0xa5ef0c=_0x20aee1=>{const _0x2b14d2=a32_0x1aab;if(_0x20aee1[_0x2b14d2(0x1ad)]===0x0)return'[]';const _0x1c7c01=_0x20aee1['map'](_0x13c0ee=>_0x2b14d2(0x22d)+_0x13c0ee['name']+'\x22,\x20\x22type\x22:\x20\x22'+_0x13c0ee[_0x2b14d2(0x90)]+_0x2b14d2(0x134));return'[\x0a'+_0x1c7c01[_0x2b14d2(0x97)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x3e742d=_0x3256ed['behaviors']['map'](_0x5d8564=>{const _0x543821=a32_0x1aab;return _0x543821(0xaa)+_0x5d8564[_0x543821(0x203)]+_0x543821(0x17d)+_0xa5ef0c(_0x5d8564['columns'])['replace'](/^/gm,'\x20\x20')[_0x543821(0x14e)]()+_0x543821(0x133);})[_0x52d2e5(0x97)](',\x0a');return _0x52d2e5(0x107)+_0x3256ed[_0x52d2e5(0x197)]+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x3256ed[_0x52d2e5(0x207)]+_0x52d2e5(0x8a)+_0x3256ed[_0x52d2e5(0x272)]+_0x52d2e5(0x16b)+_0x3256ed['customers'][_0x52d2e5(0x203)]+_0x52d2e5(0x1a0)+_0xa5ef0c(_0x3256ed[_0x52d2e5(0x204)][_0x52d2e5(0x17f)])[_0x52d2e5(0xf6)](/^/gm,'\x20\x20')[_0x52d2e5(0x14e)]()+_0x52d2e5(0xc5)+_0x3e742d+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x216);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x129);async['execute'](_0x561e88){const _0x274d2e=a32_0x51f12c,{options:_0x553177,args:_0x28461d,tdx:_0x56d698}=_0x561e88,_0x5217a6=_0x28461d[0x0]||_0x553177[_0x274d2e(0x196)];if(!_0x5217a6)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x274d2e(0x24a)),0x1;_0x553177[_0x274d2e(0x188)]&&(console['error'](_0x274d2e(0x267)+_0x553177[_0x274d2e(0xa0)]),console['error'](_0x274d2e(0x234)+_0x5217a6));const _0xf9e4bd=await withSpinner(_0x274d2e(0x168)+_0x5217a6+'\x27...',()=>_0x56d698['segment']['resolveParentId'](_0x5217a6),{'verbose':_0x553177[_0x274d2e(0x188)]}),_0xc3f436=_0xf9e4bd[_0x274d2e(0xef)],_0xe61fa=await withSpinner(_0x274d2e(0x246)+_0x5217a6+'\x27...',()=>_0x56d698['segment']['getParentSQL'](_0xc3f436),{'verbose':_0x553177[_0x274d2e(0x188)]}),_0x3e12d4=_0xe61fa[_0x274d2e(0xef)];return _0x553177[_0x274d2e(0x1bc)]===_0x274d2e(0x1c6)||_0x553177[_0x274d2e(0x1bc)]==='jsonl'?await handleSDKOutput([{'sql':_0x3e12d4}],_0x553177):console['log'](_0x3e12d4),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a32_0x51f12c(0xae);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x16f);async['execute'](_0x3ec6ad){const _0x18bc2e=a32_0x51f12c,{options:_0x332ead,args:_0x37a482,tdx:_0x49d3a2}=_0x3ec6ad,_0x42de4b=_0x37a482[0x0]||_0x332ead[_0x18bc2e(0x196)];if(!_0x42de4b)return showParentSegmentNotSetError(_0x18bc2e(0x1af)+_0x18bc2e(0x1d5)),0x1;_0x332ead['verbose']&&(console['error']('Site:\x20'+_0x332ead[_0x18bc2e(0xa0)]),console[_0x18bc2e(0x25f)](_0x18bc2e(0x234)+_0x42de4b));const _0x1a0be7=await withSpinner(_0x18bc2e(0x168)+_0x42de4b+_0x18bc2e(0x138),()=>_0x49d3a2[_0x18bc2e(0x1c1)][_0x18bc2e(0x242)](_0x42de4b),{'verbose':_0x332ead[_0x18bc2e(0x188)]}),_0x531a6e=_0x1a0be7[_0x18bc2e(0xef)],_0x5e1e3f=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x42de4b+'\x27...',()=>_0x49d3a2[_0x18bc2e(0x1c1)]['getParentSQL'](_0x531a6e),{'verbose':_0x332ead[_0x18bc2e(0x188)]});let _0x6d092e=_0x5e1e3f[_0x18bc2e(0xef)];const _0x4655ce=resolveLimit(_0x332ead[_0x18bc2e(0x248)],DEFAULT_DISPLAY_LIMIT),_0x36e2e1=/\bLIMIT\s+\d+/i[_0x18bc2e(0x1f5)](_0x6d092e);!_0x36e2e1&&(_0x6d092e=_0x6d092e[_0x18bc2e(0x14e)]()[_0x18bc2e(0xf6)](/;+$/,''),_0x6d092e='SELECT\x20*\x20FROM\x20(\x0a'+_0x6d092e+_0x18bc2e(0x1eb)+_0x4655ce);_0x332ead[_0x18bc2e(0x188)]&&console[_0x18bc2e(0x25f)]('SQL\x20query:\x0a'+_0x6d092e);const _0x52cd6c=await withProgressSpinner(_0x18bc2e(0x209),async _0x402f25=>{const _0x4c1b2d=_0x18bc2e,_0x35cacd=await _0x49d3a2[_0x4c1b2d(0x26e)]['execute'](_0x6d092e,{'catalog':'td','schema':_0x4c1b2d(0x116),'onJobId':_0x70e7f=>{const _0x1a3716=_0x4c1b2d;_0x402f25[_0x1a3716(0xc3)](_0x70e7f);}});return _0x35cacd;},{'verbose':_0x332ead['verbose']}),_0x46f318=_0x52cd6c['data'],_0x5e98e7=_0x46f318['jobId']?_0x18bc2e(0x12c)+_0x46f318['jobId']+']':'';return console[_0x18bc2e(0x25f)](_0x18bc2e(0x264)+_0x46f318[_0x18bc2e(0xe9)][_0x18bc2e(0x28d)][_0x18bc2e(0x19d)]()+'\x20rows\x20'+(_0x18bc2e(0x286)+formatElapsed(_0x46f318['stats']['elapsedTimeMillis'])+_0x5e98e7)),await handleQueryOutput(_0x46f318,_0x332ead),0x0;}}export class PSRtListCommand extends BaseCommand{['name']=a32_0x51f12c(0x1b1);[a32_0x51f12c(0x12a)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a32_0x51f12c(0x1fc)](_0x511fea){const _0x4ea294=a32_0x51f12c,{options:_0x4295e4,args:_0x417558,tdx:_0x146eb7}=_0x511fea,_0x9aa44f=_0x417558[0x0],_0x25076a=await withSpinner(_0x9aa44f?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x9aa44f+_0x4ea294(0x138):_0x4ea294(0x1bb),()=>_0x146eb7['realtime'][_0x4ea294(0x227)](),{'verbose':_0x4295e4['verbose']});let _0x2fd71b=_0x25076a[_0x4ea294(0xef)]['filter'](_0x3c3f6b=>_0x3c3f6b[_0x4ea294(0x23a)]);if(_0x9aa44f){const _0x5c06c1=_0x9aa44f[_0x4ea294(0xf6)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x4ea294(0xf6)](/\*/g,'.*')[_0x4ea294(0xf6)](/\?/g,'.'),_0x44d583=new RegExp('^'+_0x5c06c1+'$','i');_0x2fd71b=_0x2fd71b[_0x4ea294(0x21d)](_0x2761b5=>_0x44d583[_0x4ea294(0x1f5)](_0x2761b5[_0x4ea294(0x282)]));}_0x2fd71b['sort']((_0x219a6a,_0x5f5a54)=>_0x219a6a[_0x4ea294(0x282)][_0x4ea294(0x1ff)](_0x5f5a54['name'])),console[_0x4ea294(0x25f)](_0x4ea294(0x245)+_0x2fd71b[_0x4ea294(0x1ad)]+_0x4ea294(0x194)+(_0x2fd71b[_0x4ea294(0x1ad)]!==0x1?'s':''));const _0x2946f6=_0x43153a=>{const _0x24171d=_0x4ea294;return getConsoleNextUrl(_0x4295e4[_0x24171d(0xa0)],_0x24171d(0x140)+_0x43153a);};if(_0x4295e4['format']===_0x4ea294(0x1c6)||_0x4295e4[_0x4ea294(0x1bc)]==='jsonl'){const _0xf46f1f=_0x2fd71b[_0x4ea294(0xe1)](_0x14eee9=>({..._0x14eee9,'url':_0x2946f6(_0x14eee9['id'])}));await handleSDKOutput(_0xf46f1f,_0x4295e4);}else{if(_0x2fd71b[_0x4ea294(0x1ad)]===0x0)console[_0x4ea294(0x16d)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x3c1c37 of _0x2fd71b){const _0x2656c9=_0x3c1c37[_0x4ea294(0xee)]?a32_0x265203[_0x4ea294(0x1c2)]('\x20('+formatRows(_0x3c1c37['population'])+')'):'',_0x533db6=hyperlink(_0x3c1c37[_0x4ea294(0x282)],_0x2946f6(_0x3c1c37['id']));console[_0x4ea294(0x16d)]('⚡\x20'+_0x533db6+_0x2656c9);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]='ps:rt:validate';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x1ae);async[a32_0x51f12c(0x1fc)](_0x3fb16a){const _0x27de8f=a32_0x51f12c,{options:_0xd9a7ca,args:_0x27bc83,tdx:_0x1d14bd}=_0x3fb16a,_0x3badab=_0x27bc83[0x0]||_0xd9a7ca['parentSegment'];if(!_0x3badab)return showParentSegmentNotSetError(_0x27de8f(0xb1)+_0x27de8f(0x1a8)),0x1;const _0x41b119=resolveYamlFile(_0x3badab);if(!existsSync(_0x41b119))return showFileNotFoundError(_0x41b119,_0x3badab),0x1;let _0x3a55cc;try{_0x3a55cc=readFileSync(_0x41b119,_0x27de8f(0x1f8));}catch(_0x98a121){const _0x280657=_0x98a121 instanceof Error?_0x98a121['message']:String(_0x98a121);return console[_0x27de8f(0x25f)]('Error\x20reading\x20file:\x20'+_0x280657),0x1;}const _0x3e6978=createCommandSpinner(a32_0x265203['dim'](_0x27de8f(0x175)),{'verbose':_0xd9a7ca[_0x27de8f(0x188)]});_0x3e6978[_0x27de8f(0x17a)]();const _0x5d8222={'realtime':!![],'onProgress':_0x5a3839=>{const _0x4a5fb2=_0x27de8f;_0x3e6978[_0x4a5fb2(0x190)]=formatProgressMessage(_0x5a3839);}};let _0x51ead6;try{_0x51ead6=await _0x1d14bd[_0x27de8f(0x1c1)]['validateParentYaml'](_0x3a55cc,_0x5d8222),_0x3e6978['stop']();}catch(_0x5d86ca){_0x3e6978[_0x27de8f(0x1ea)]();throw _0x5d86ca;}console['error']('\x0a'+a32_0x265203['bold']('RT\x202.0\x20Validate:')+'\x20'+_0x51ead6[_0x27de8f(0x282)]),console[_0x27de8f(0x25f)]('═'[_0x27de8f(0x12e)](0x3c)),displayRealtimeValidation(_0x51ead6),console['error']('─'['repeat'](0x3c));if(_0x51ead6['errors']['length']>0x0){console['error']('\x0a'+a32_0x265203[_0x27de8f(0x153)](_0x27de8f(0x161)));for(const _0x1d5b2b of _0x51ead6['errors']){console[_0x27de8f(0x25f)]('\x20\x20'+a32_0x265203['red']('•')+'\x20'+_0x1d5b2b);}}return _0x51ead6[_0x27de8f(0x220)]&&console['error']('\x0a'+a32_0x265203[_0x27de8f(0xff)]('✔')+_0x27de8f(0xf3)),_0x51ead6[_0x27de8f(0x220)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x16a);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x150);async[a32_0x51f12c(0x1fc)](_0x3f89d1){const _0x1e8570=a32_0x51f12c,{options:_0x49ff2e,args:_0xd3cb57,tdx:_0x331865}=_0x3f89d1,_0xa525e6=_0xd3cb57[0x0]||_0x49ff2e[_0x1e8570(0x196)];if(!_0xa525e6)return showParentSegmentNotSetError(_0x1e8570(0x187)+_0x1e8570(0x101)),0x1;_0x49ff2e[_0x1e8570(0x188)]&&(console[_0x1e8570(0x25f)](_0x1e8570(0x267)+_0x49ff2e[_0x1e8570(0xa0)]),console['error'](_0x1e8570(0x234)+_0xa525e6));const _0x84a0a1=await withSpinner(_0x1e8570(0x168)+_0xa525e6+_0x1e8570(0x138),()=>_0x331865[_0x1e8570(0x1c1)][_0x1e8570(0x242)](_0xa525e6),{'verbose':_0x49ff2e['verbose']}),_0x175748=_0x84a0a1[_0x1e8570(0xef)],_0x48a754=await withSpinner(_0x1e8570(0x288)+_0xa525e6+_0x1e8570(0x138),()=>_0x331865[_0x1e8570(0x23e)][_0x1e8570(0x221)](_0x175748),{'verbose':_0x49ff2e[_0x1e8570(0x188)]}),_0x2f089f=_0x48a754['data'];console[_0x1e8570(0x25f)]('✔\x20Found\x20'+_0x2f089f[_0x1e8570(0x1ad)]+_0x1e8570(0x1fa)+(_0x2f089f[_0x1e8570(0x1ad)]!==0x1?'s':''));if(_0x49ff2e[_0x1e8570(0x1bc)]===_0x1e8570(0x1c6)||_0x49ff2e[_0x1e8570(0x1bc)]===_0x1e8570(0x114))await handleSDKOutput(_0x2f089f,_0x49ff2e);else{if(_0x2f089f['length']===0x0)console[_0x1e8570(0x16d)](_0x1e8570(0x266));else for(const _0x5f2783 of _0x2f089f){const _0x22b0b9=_0x5f2783[_0x1e8570(0xed)]===_0x1e8570(0x236)?'🚀':'📝',_0x1174e6=_0x5f2783['paused']?a32_0x265203[_0x1e8570(0xb5)]('\x20(paused)'):'',_0x48271a=a32_0x265203[_0x1e8570(0x1c2)]('\x20('+_0x5f2783[_0x1e8570(0x205)]+_0x1e8570(0x193)+(_0x5f2783['stageCount']!==0x1?'s':'')+')');console[_0x1e8570(0x16d)](_0x22b0b9+'\x20'+_0x5f2783['name']+_0x1174e6+_0x48271a);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:rt:jn:pause';['description']='Pause\x20activations\x20in\x20an\x20RT\x20journey';async['execute'](_0x430802){const _0x946d9a=a32_0x51f12c,{options:_0x43d8b2,args:_0x1b6957,tdx:_0x4dfa0f}=_0x430802,_0x185aa3=_0x1b6957[0x0];if(!_0x185aa3)return console[_0x946d9a(0x25f)](a32_0x265203[_0x946d9a(0x153)](_0x946d9a(0x293))),console[_0x946d9a(0x25f)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a'),console[_0x946d9a(0x25f)](a32_0x265203[_0x946d9a(0x1c2)](_0x946d9a(0x224))),0x1;_0x43d8b2[_0x946d9a(0x188)]&&(console['error'](_0x946d9a(0x267)+_0x43d8b2[_0x946d9a(0xa0)]),console[_0x946d9a(0x25f)](_0x946d9a(0x182)+_0x185aa3));const _0x46f157=await withSpinner('Pausing\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x185aa3+_0x946d9a(0x138),()=>_0x4dfa0f['realtime'][_0x946d9a(0x1aa)](_0x185aa3),{'verbose':_0x43d8b2[_0x946d9a(0x188)]}),_0x21fa87=_0x46f157[_0x946d9a(0xef)];console[_0x946d9a(0x25f)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x21fa87[_0x946d9a(0x282)]+'\x27');if(_0x43d8b2[_0x946d9a(0x1bc)]===_0x946d9a(0x1c6)||_0x43d8b2[_0x946d9a(0x1bc)]===_0x946d9a(0x114))await handleSDKOutput([_0x21fa87],_0x43d8b2);else{const _0x5270a0=_0x21fa87[_0x946d9a(0xed)]==='launched'?'🚀':'📝',_0x5b4135=_0x21fa87[_0x946d9a(0x1d9)]?a32_0x265203['yellow']('\x20(paused)'):'';console[_0x946d9a(0x16d)](_0x5270a0+'\x20'+_0x21fa87[_0x946d9a(0x282)]+_0x5b4135);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1b4);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x290);async[a32_0x51f12c(0x1fc)](_0x7f2ee1){const _0x55eedd=a32_0x51f12c,{options:_0x27accb,args:_0x373912,tdx:_0x281a88}=_0x7f2ee1,_0x10c125=_0x373912[0x0];if(!_0x10c125)return console[_0x55eedd(0x25f)](a32_0x265203[_0x55eedd(0x153)](_0x55eedd(0x293))),console[_0x55eedd(0x25f)]('Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a'),console[_0x55eedd(0x25f)](a32_0x265203[_0x55eedd(0x1c2)]('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x27accb['verbose']&&(console[_0x55eedd(0x25f)]('Site:\x20'+_0x27accb[_0x55eedd(0xa0)]),console['error'](_0x55eedd(0x182)+_0x10c125));const _0x366fd0=await withSpinner(_0x55eedd(0x185)+_0x10c125+_0x55eedd(0x138),()=>_0x281a88[_0x55eedd(0x23e)][_0x55eedd(0xb2)](_0x10c125),{'verbose':_0x27accb[_0x55eedd(0x188)]}),_0x9be421=_0x366fd0['data'];console[_0x55eedd(0x25f)](_0x55eedd(0x275)+_0x9be421[_0x55eedd(0x282)]+'\x27');if(_0x27accb[_0x55eedd(0x1bc)]==='json'||_0x27accb['format']===_0x55eedd(0x114))await handleSDKOutput([_0x9be421],_0x27accb);else{const _0x4658ca=_0x9be421[_0x55eedd(0xed)]===_0x55eedd(0x236)?'🚀':'📝',_0x165dbb=_0x9be421[_0x55eedd(0x1d9)]?a32_0x265203['yellow']('\x20(paused)'):'';console['log'](_0x4658ca+'\x20'+_0x9be421[_0x55eedd(0x282)]+_0x165dbb);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1ee);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x12d);async[a32_0x51f12c(0x1fc)](_0x879e87){const _0x4de90e=a32_0x51f12c,{options:_0x485c67,args:_0x306944,tdx:_0x314470}=_0x879e87,_0x57cbb7=_0x306944[0x0]||_0x485c67[_0x4de90e(0x196)];if(!_0x57cbb7)return showParentSegmentNotSetError(_0x4de90e(0x136)+'\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'),0x1;_0x485c67[_0x4de90e(0x188)]&&(console[_0x4de90e(0x25f)]('Site:\x20'+_0x485c67['site']),console[_0x4de90e(0x25f)](_0x4de90e(0x234)+_0x57cbb7));const _0x46d796=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x57cbb7+'\x27...',()=>_0x314470[_0x4de90e(0x1c1)][_0x4de90e(0x242)](_0x57cbb7),{'verbose':_0x485c67[_0x4de90e(0x188)]}),_0x4ec27f=_0x46d796['data'],_0xe827d6=await withSpinner(_0x4de90e(0x12f)+_0x57cbb7+_0x4de90e(0x138),()=>_0x314470[_0x4de90e(0x23e)]['getCurrentConfigVersion'](_0x4ec27f),{'verbose':_0x485c67['verbose']}),_0x1357eb=_0xe827d6[_0x4de90e(0xef)];return console[_0x4de90e(0x25f)](_0x4de90e(0x238)),_0x485c67[_0x4de90e(0x1bc)]===_0x4de90e(0x1c6)||_0x485c67[_0x4de90e(0x1bc)]==='jsonl'?await handleSDKOutput([_0x1357eb],_0x485c67):(console['log'](_0x4de90e(0x1b8)+_0x1357eb['id']),console['log'](_0x4de90e(0x27c)+_0x1357eb[_0x4de90e(0x231)]),console[_0x4de90e(0x16d)](_0x4de90e(0x11e)+_0x1357eb[_0x4de90e(0xb4)]),console[_0x4de90e(0x16d)]('eventKind:\x20'+_0x1357eb[_0x4de90e(0xf5)]),console[_0x4de90e(0x16d)]('status:\x20'+_0x1357eb[_0x4de90e(0x252)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{['name']=a32_0x51f12c(0x112);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x21a);async[a32_0x51f12c(0x1fc)](_0x44a1b3){const _0xf7cfdd=a32_0x51f12c,{options:_0x1fbc69,args:_0x1293fa,tdx:_0x4d4de4}=_0x44a1b3,_0x8df2e4=_0x1293fa[0x0]||_0x1fbc69[_0xf7cfdd(0x196)];if(!_0x8df2e4)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'+_0xf7cfdd(0x13f)),0x1;const _0xd30369=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x8df2e4+_0xf7cfdd(0x138),()=>_0x4d4de4[_0xf7cfdd(0x1c1)]['resolveParentId'](_0x8df2e4),{'verbose':_0x1fbc69['verbose']}),_0x1392d8=_0xd30369[_0xf7cfdd(0xef)],_0x2d7f44=await withSpinner(_0xf7cfdd(0x1ba)+_0x8df2e4+_0xf7cfdd(0x138),()=>_0x4d4de4[_0xf7cfdd(0x8f)][_0xf7cfdd(0x227)](_0x1392d8),{'verbose':_0x1fbc69['verbose']}),_0x4c51d5=_0x2d7f44[_0xf7cfdd(0xef)];console[_0xf7cfdd(0x25f)](_0xf7cfdd(0x245)+_0x4c51d5[_0xf7cfdd(0x1ad)]+'\x20personalization\x20service'+(_0x4c51d5[_0xf7cfdd(0x1ad)]!==0x1?'s':''));if(_0x1fbc69[_0xf7cfdd(0x1bc)]===_0xf7cfdd(0x1c6)||_0x1fbc69[_0xf7cfdd(0x1bc)]===_0xf7cfdd(0x114))await handleSDKOutput(_0x4c51d5,_0x1fbc69);else{if(_0x4c51d5[_0xf7cfdd(0x1ad)]===0x0)console[_0xf7cfdd(0x16d)](_0xf7cfdd(0x171)),console[_0xf7cfdd(0x25f)](a32_0x265203['cyan'](_0xf7cfdd(0x117)));else for(const _0x183470 of _0x4c51d5){console['log'](a32_0x265203[_0xf7cfdd(0x27a)](_0x183470[_0xf7cfdd(0x282)])+'\x20'+a32_0x265203[_0xf7cfdd(0x1c2)](_0xf7cfdd(0x23f)+_0x183470['id']+')'));_0x183470[_0xf7cfdd(0x12a)]&&console[_0xf7cfdd(0x16d)]('\x20\x20'+a32_0x265203[_0xf7cfdd(0x1c2)](_0x183470['description']));if(_0x183470[_0xf7cfdd(0x111)]&&_0x183470[_0xf7cfdd(0x111)][_0xf7cfdd(0x1ad)]>0x0)for(const _0xe095f5 of _0x183470[_0xf7cfdd(0x111)]){const _0x529049=_0xe095f5[_0xf7cfdd(0xb9)]?.[_0xf7cfdd(0x1ad)]?_0xe095f5[_0xf7cfdd(0xb9)]['join'](',\x20'):_0xf7cfdd(0x1d6);console[_0xf7cfdd(0x16d)]('\x20\x20'+a32_0x265203[_0xf7cfdd(0xcd)]('token:')+'\x20'+_0xe095f5['name']+'\x20'+a32_0x265203['dim'](_0xf7cfdd(0x23f)+_0xe095f5['id']+')')),console[_0xf7cfdd(0x16d)](_0xf7cfdd(0x1cd)+a32_0x265203[_0xf7cfdd(0x1c2)](_0xf7cfdd(0x103))+'\x20'+_0x529049);}else console[_0xf7cfdd(0x16d)]('\x20\x20'+a32_0x265203['dim'](_0xf7cfdd(0x243)));}}return 0x0;}}function a32_0x44ac(){const _0x3f0baa=['Events:','Output\x20Database:','ps:pz:show','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','green','\x20=\x20','\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','Default','allowed\x20IPs:','Join:','\x20--interval\x20','Rows:','{\x0a\x20\x20\x22database\x22:\x20\x22','double','Create\x20parent\x20segment\x20\x27','apply','\x20behaviors','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','\x0aNew\x20parent\x20segment\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','List\x20available\x20fields\x20for\x20segmentation','displaySummary','tokens','ps:pz:service:list','platform','jsonl','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','information_schema','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','.customers)','\x20\x20\x20\x20\x20\x20\x20\x20','\x20true','createToken','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','3797225foTRRW','identifier:\x20','\x20Context\x20set:\x20','foreignKey','events','Options:\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','\x20Opening\x20','ID\x20Stitching:','Aborted.','sourceTableError','Creating\x20token\x20\x27','Get\x20SQL\x20query\x20for\x20parent\x20segment','description','3uiPACX','\x20[Job\x20ID:\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','repeat','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','displayColumns','workflowSessionId','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','\x0a\x20\x20\x20\x20}','\x22\x20}','Update\x20a\x20realtime\x20personalization\x20entity','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','web','\x27...','segment:parent:desc','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Validating\x20configuration...','displayMasterInfo','personalization_services','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\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','/app/dw/parentSegments/','joinKey','session','✔\x20Updated\x20parent\x20segment\x20\x27','behaviors','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','\x20\x20No\x20sample\x20data\x20available','✔\x20Updated\x20personalization\x20\x27','\x20Configuration\x20is\x20valid','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Behaviors','audienceId:','patch','\x0a⚠️\x20\x20Both\x20','trim','ps:pz:patch','List\x20RT\x20journeys','Attribute:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','red','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','relationships','darwin','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','Schema\x20saved\x20to\x20','sections:','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','✔\x20Deleted\x20personalization\x20\x27','✔\x20Created\x20parent\x20segment\x20\x27','\x20--behavior\x20\x22','addAttributesFile','Errors:','\x20service(s)\x20configured','Error:','✔\x20Deleted\x20token\x20\x27','6091828LoiADW','Found\x20YAML\x20file:\x20','Deleting\x20personalization\x20\x27','Resolving\x20parent\x20segment\x20\x27','Error:\x20Service\x20name\x20is\x20required','ps:rt:jn:list','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Create\x20a\x20realtime\x20personalization\x20entity','log','addAttributes','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','attributes','No\x20personalization\x20services\x20configured','Preview:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','timezone','Validating\x20RT\x20configuration...','Error:\x20Service\x20ID\x20is\x20required','preview','✔\x20No\x20changes\x20-\x20\x27','Pattern:\x20','start','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20kill','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','columns','\x20personalization','Audience\x20ID:','RT\x20Journey\x20ID:\x20','message','ps:pz:list','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','run','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','verbose','displaySampleData','\x27\x20for\x20service\x20\x27','\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','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','displayBehaviorsStats','\x0aError:','string','text','Listing\x20personalizations\x20for\x20\x27','displayValidateResults','\x20stage','\x20RT-enabled\x20parent\x20segment','getParentFull','parentSegment','database','3609UBExwR','No\x20parent\x20segments\x20match\x20pattern:\x20','toFixed','\x20parent\x20segment\x20\x27','⚡\x20Not\x20enabled','toLocaleString','Creating','createPersonalization','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Error:\x20Token\x20\x27','all','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','get','\x0aChanges\x20to\x20apply\x20to\x20\x27','segment:parent:preview','\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','value','pauseJourney','entryCriteria:','segment:parent:fields','length','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','public:','ps:rt:list','Listing\x20parent\x20segments...','Database:\x20','ps:rt:jn:resume','token:','Updating\x20personalization\x20service\x20\x27','Error:\x20--name\x20is\x20required','id:\x20','Creating\x20parent\x20segment\x20\x27','Listing\x20personalization\x20services\x20for\x20\x27','Listing\x20RT-enabled\x20parent\x20segments...','format','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','Created','getOutputDatabaseName','segment','dim','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Join\x20on:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','json','workflowId','My\x20Service','addBehaviorsFile','segment:parent:push','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','\x20\x20\x20\x20','getPersonalization','Updated','Error:\x20--database\x20and\x20--table\x20are\x20required','Error\x20reading\x20file:\x20','totalEvents','👥\x20','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','any','matchedCount','workflowAttemptId','paused','\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','Error:\x20Parent\x20segment\x20name\x20is\x20required','ignore','rowCount','2310427QtesSR','Overwrite\x20\x27','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','ps:pz:init','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20configured','Enriched:','open','split','Output\x20file:\x20','Fetching\x20customers\x20schema...','getParentSQL','stop','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','column_type','ps:rt:configuration_versions','enabled','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Session:','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Source:','isDirectory','test','Updating','\x20\x201.\x20Edit\x20','utf-8','Personalization:','\x20RT\x20journey','\x0a✔\x20Workflow\x20started','execute','\x5c$&','customerPercent','localeCompare','Name:\x20','ps:pz:service:update','\x20\x20\x20\x20\x20\x20','table','customers','stageCount','listPersonalizations','parent_segment','interval','Executing\x20parent\x20segment\x20query...','reduce','\x20--attribute\x20\x22<name>\x22','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','33ARBtnJ','\x27\x20and\x20run\x20workflow?','segment:parent:view','RT\x202.0:','✔\x20Deleted\x20personalization\x20service\x20\x27','listParents','segment:parent:sql','/attempt/','\x20field','✘\x20Failed\x20to\x20rename\x20directory:\x20','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Status:','filter','yes','/\x20→\x20','allValid','listJourneys','\x20No\x20changes\x20-\x20','xdg-open','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x27\x20with\x20ID:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','list','SELECT\x20*\x20FROM\x20','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','enriched','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','Columns:','95034TrYBWY','audienceId','errors','/app/workflows/','Parent\x20segment:\x20','attributesFile','launched','\x20service','✔\x20Retrieved\x20RT\x20configuration\x20version','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','realtime_enabled','segment:parent:run','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','deleteToken','realtime','(id:\x20','scheduleOption','\x0a⚠️\x20\x20Migrating:\x20','resolveParentId','no\x20tokens\x20configured','Delete\x20a\x20personalization\x20service','✔\x20Found\x20','Fetching\x20SQL\x20for\x20\x27','schemaValid','limit','Table:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','label','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','%)\x20','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','Options:','Fetching\x20behavior\x20list...','\x20--attribute\x20\x22','status','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','860dpHZPk','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Error:\x20Personalization\x20ID\x20is\x20required','master','\x20+\x20[','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','endsWith','\x20\x20\x20\x20-\x20','✔\x20Created\x20personalization\x20service\x20\x27','realtime:','-1d','error','Coverage:','page_view','indexOf','valid','✔\x20Query\x20completed:\x20Processed\x20','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','No\x20RT\x20journeys\x20found','Site:\x20','Error:\x20File\x20not\x20found:\x20','sampleData','\x20--enriched','sections','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','column_name','query','payload','Analyzing\x20changes...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','parent_id','keyEventId','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Creating\x20personalization\x20service\x20\x27','bold','file','audienceId:\x20','toLowerCase','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','customersWithEvents','includeSensitive:','formatSchemaJson','name','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','✔\x20Found\x20personalization\x20\x27','pushParentYaml','in\x20','collectSchema','Listing\x20RT\x20journeys\x20for\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','tdx\x20ps\x20preview\x20','\x20rows)','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','processedRows','<database>.<table>','createParent','Resume\x20activations\x20in\x20an\x20RT\x20journey','/sessions/','scheduleType','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','displayPreviewResults','YAML\x20file:\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','/\x20directory.\x0a','column','payload:','attribute','personalization','type','7800104gRmtJl','Apply\x20changes\x20to\x20\x27','ps:pz:service:token:create','behavior','Attempt:','output','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','Error\x20parsing\x20YAML:\x20','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Error:\x20Token\x20ID\x20is\x20required','.yaml','previewParentYaml','schemaError','\x0aChanges\x20to\x20\x27','site','includeSensitive','\x20Added\x20personalization\x20template\x20to\x20','Getting\x20personalization\x20\x27','Behavior:','\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\x20Database:\x20','segment:parent:pull','ps:pz:service:delete','Attributes:','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','`\x20to\x20download\x20the\x20configuration\x20first','Next\x20steps:','single','segment:parent:show','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','coveragePercent','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','resumeJourney','No\x20personalizations\x20configured','identifier','yellow','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20--behavior\x20requires\x20a\x20name\x0a','allowedIps','\x20\x20Tables:\x201\x20customers\x20+\x20','validateParentYaml','sort','\x20is\x20already\x20up\x20to\x20date','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','updatedAt','stitchingKeys','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','setJobId','Listing\x20parent\x20segments\x20matching\x20\x27','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Finding\x20service\x20for\x20token...','getBehaviorNames','Fetching\x20sample\x20data...','match','behavior_','Show\x20parent\x20segment\x20details','entryCriteria','cyan','Validate:','4513135ILeDOs','Fetching\x20parent\x20segment\x20\x27','ps:pz:delete','Creating\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','keyEventCriteria','create','some','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','folderId','updated:','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','displayAttributesStats','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','.yml','displayPreviewHints','deletePersonalization','map','Personalization\x20service\x20description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','Delete\x20a\x20realtime\x20personalization','idStitching','displayRealtimeInfo','Options\x20(one\x20required):\x0a','24iViVwb','stats','segment:parent:update','last_page_viewed','Attributes','state','population','data','Master:','\x20\x20Columns:\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','\x20RT\x20configuration\x20is\x20valid','parentFolder','eventKind','replace','pullParentYaml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','personalizationServices','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'];a32_0x44ac=function(){return _0x3f0baa;};return a32_0x44ac();}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:service:create';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x13e);async[a32_0x51f12c(0x1fc)](_0x41d339){const _0x1ab3bc=a32_0x51f12c,{options:_0x58c94a,args:_0xcf4ce2,tdx:_0x41f3f4}=_0x41d339,_0x6b71db=_0x58c94a,_0x46de47=_0xcf4ce2[0x0],_0x4ee936=_0xcf4ce2[0x1]||_0x58c94a['parentSegment'];if(!_0x46de47)return console[_0x1ab3bc(0x25f)](_0x1ab3bc(0x169)),console[_0x1ab3bc(0x25f)](_0x1ab3bc(0x154)),console[_0x1ab3bc(0x25f)](_0x1ab3bc(0xe3)),0x1;if(!_0x4ee936)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x1ab3bc(0xe3)),0x1;const _0x1512d9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ee936+_0x1ab3bc(0x138),()=>_0x41f3f4['segment'][_0x1ab3bc(0x242)](_0x4ee936),{'verbose':_0x58c94a['verbose']}),_0x317c8f=_0x1512d9[_0x1ab3bc(0xef)],_0x387603={'name':_0x46de47,'description':_0x6b71db[_0x1ab3bc(0x12a)],'public':_0x6b71db['public']},_0x40c82c=await withSpinner(_0x1ab3bc(0x279)+_0x46de47+_0x1ab3bc(0x138),()=>_0x41f3f4[_0x1ab3bc(0x8f)][_0x1ab3bc(0xd5)](_0x317c8f,_0x387603),{'verbose':_0x58c94a[_0x1ab3bc(0x188)]}),_0x29d4e5=_0x40c82c['data'];return console[_0x1ab3bc(0x25f)](_0x1ab3bc(0x25c)+_0x29d4e5[_0x1ab3bc(0x282)]+_0x1ab3bc(0x225)+_0x29d4e5['id']),await handleSDKOutput([_0x29d4e5],_0x58c94a),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:service:show';[a32_0x51f12c(0x12a)]='Show\x20personalization\x20service\x20details';async['execute'](_0x7345e6){const _0x1339d7=a32_0x51f12c,{options:_0x3c6df7,args:_0x4848e5,tdx:_0x41c7d3}=_0x7345e6,_0x55159a=_0x4848e5[0x0],_0x534041=_0x4848e5[0x1]||_0x3c6df7[_0x1339d7(0x196)];if(!_0x55159a)return console['error'](_0x1339d7(0x176)),console[_0x1339d7(0x25f)](_0x1339d7(0x226)),console['error'](_0x1339d7(0x123)),0x1;if(!_0x534041)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a'+_0x1339d7(0x123)),0x1;const _0x1c3648=await withSpinner(_0x1339d7(0x168)+_0x534041+'\x27...',()=>_0x41c7d3['segment'][_0x1339d7(0x242)](_0x534041),{'verbose':_0x3c6df7['verbose']}),_0x23bae1=_0x1c3648['data'],_0x909a46=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x55159a+'\x27...',()=>_0x41c7d3['personalization'][_0x1339d7(0x1a5)](_0x23bae1,_0x55159a),{'verbose':_0x3c6df7[_0x1339d7(0x188)]}),_0x15156c=_0x909a46[_0x1339d7(0xef)];if(_0x3c6df7[_0x1339d7(0x1c6)]||_0x3c6df7[_0x1339d7(0x114)])await handleSDKOutput([_0x15156c],_0x3c6df7);else{console[_0x1339d7(0x16d)](a32_0x265203[_0x1339d7(0x27a)](_0x15156c[_0x1339d7(0x282)])+'\x20'+a32_0x265203[_0x1339d7(0x1c2)](_0x1339d7(0x23f)+_0x15156c['id']+')'));_0x15156c['description']&&console['log']('\x20\x20'+a32_0x265203['dim'](_0x15156c[_0x1339d7(0x12a)]));console[_0x1339d7(0x16d)]('\x20\x20'+a32_0x265203['cyan'](_0x1339d7(0x1b0))+'\x20'+(_0x15156c['public']?_0x1339d7(0x21e):'no'));if(_0x15156c[_0x1339d7(0x111)]&&_0x15156c['tokens'][_0x1339d7(0x1ad)]>0x0)for(const _0x228923 of _0x15156c[_0x1339d7(0x111)]){const _0x3ae8c3=_0x228923['allowedIps']?.[_0x1339d7(0x1ad)]?_0x228923['allowedIps'][_0x1339d7(0x97)](',\x20'):'any';console[_0x1339d7(0x16d)]('\x20\x20'+a32_0x265203[_0x1339d7(0xcd)](_0x1339d7(0x1b5))+'\x20'+_0x228923[_0x1339d7(0x282)]+'\x20'+a32_0x265203[_0x1339d7(0x1c2)](_0x1339d7(0x23f)+_0x228923['id']+')')),console[_0x1339d7(0x16d)](_0x1339d7(0x1cd)+a32_0x265203['dim'](_0x1339d7(0x103))+'\x20'+_0x3ae8c3);}else console['log']('\x20\x20'+a32_0x265203[_0x1339d7(0x1c2)](_0x1339d7(0x243)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xa8);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x244);async['execute'](_0x113f10){const _0x3cb874=a32_0x51f12c,{options:_0x70c816,args:_0x432b90,tdx:_0x292468}=_0x113f10,_0x3a0e54=_0x432b90[0x0],_0x82a8cd=_0x432b90[0x1]||_0x70c816[_0x3cb874(0x196)];if(!_0x3a0e54)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x3cb874(0x25f)](_0x3cb874(0x1f2)),console[_0x3cb874(0x25f)](_0x3cb874(0x22a)),0x1;if(!_0x82a8cd)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a'+_0x3cb874(0x22a)),0x1;const _0x3b7628=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x82a8cd+_0x3cb874(0x138),()=>_0x292468[_0x3cb874(0x1c1)][_0x3cb874(0x242)](_0x82a8cd),{'verbose':_0x70c816['verbose']}),_0x16bc74=_0x3b7628[_0x3cb874(0xef)];return await withSpinner('Deleting\x20personalization\x20service\x20\x27'+_0x3a0e54+'\x27...',()=>_0x292468[_0x3cb874(0x8f)]['delete'](_0x16bc74,_0x3a0e54),{'verbose':_0x70c816[_0x3cb874(0x188)]}),console['error'](_0x3cb874(0x214)+_0x3a0e54+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a32_0x51f12c(0x201);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x283);async[a32_0x51f12c(0x1fc)](_0x5494b7){const _0x18596c=a32_0x51f12c,{options:_0x2d8d20,args:_0x5b491c,tdx:_0xf06359}=_0x5494b7,_0x178c0d=_0x2d8d20,_0x56eae9=_0x5b491c[0x0],_0x10e87b=_0x5b491c[0x1]||_0x2d8d20['parentSegment'];if(!_0x56eae9)return console[_0x18596c(0x25f)](_0x18596c(0x176)),console['error'](_0x18596c(0x145)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x178c0d[_0x18596c(0x282)])return console[_0x18596c(0x25f)](_0x18596c(0x1b7)),console[_0x18596c(0x25f)](_0x18596c(0x145)),0x1;if(!_0x10e87b)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x18596c(0x289)),0x1;const _0x22e1ce=await withSpinner(_0x18596c(0x168)+_0x10e87b+'\x27...',()=>_0xf06359[_0x18596c(0x1c1)]['resolveParentId'](_0x10e87b),{'verbose':_0x2d8d20[_0x18596c(0x188)]}),_0x5105b7=_0x22e1ce['data'],_0x24f841={'name':_0x178c0d[_0x18596c(0x282)]};_0x178c0d[_0x18596c(0x12a)]!==undefined&&(_0x24f841[_0x18596c(0x12a)]=_0x178c0d[_0x18596c(0x12a)]);const _0x1bd9d2=await withSpinner(_0x18596c(0x1b6)+_0x56eae9+'\x27...',()=>_0xf06359[_0x18596c(0x8f)][_0x18596c(0x14c)](_0x5105b7,_0x56eae9,_0x24f841),{'verbose':_0x2d8d20[_0x18596c(0x188)]}),_0x3d570d=_0x1bd9d2[_0x18596c(0xef)];return console[_0x18596c(0x25f)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x3d570d[_0x18596c(0x282)]+'\x27'),await handleSDKOutput([_0x3d570d],_0x2d8d20),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a32_0x51f12c(0x93);['description']='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a32_0x51f12c(0x1fc)](_0x47ef89){const _0x3b0558=a32_0x51f12c,{options:_0x30c0b9,args:_0x10b918,tdx:_0x45aedf}=_0x47ef89,_0x3f736f=_0x30c0b9,_0x3fdbfd=_0x10b918[0x0],_0x358b2d=_0x10b918[0x1],_0x2f572a=_0x10b918[0x2]||_0x30c0b9[_0x3b0558(0x196)];if(!_0x3fdbfd)return console[_0x3b0558(0x25f)]('Error:\x20Token\x20name\x20is\x20required'),console['error'](_0x3b0558(0x11c)),console['error'](_0x3b0558(0x155)),0x1;if(!_0x358b2d)return console['error'](_0x3b0558(0x176)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x3b0558(0x25f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x2f572a)return showParentSegmentNotSetError(_0x3b0558(0xb6)+_0x3b0558(0x155)),0x1;const _0x1aabee=await withSpinner(_0x3b0558(0x168)+_0x2f572a+_0x3b0558(0x138),()=>_0x45aedf['segment'][_0x3b0558(0x242)](_0x2f572a),{'verbose':_0x30c0b9[_0x3b0558(0x188)]}),_0xd0655d=_0x1aabee[_0x3b0558(0xef)],_0x201266={'name':_0x3fdbfd};_0x3f736f['allowedIps']&&(_0x201266['allowedIps']=_0x3f736f[_0x3b0558(0xb9)][_0x3b0558(0x1e6)](',')['map'](_0x4febe1=>_0x4febe1['trim']()));_0x3f736f[_0x3b0558(0x12a)]&&(_0x201266[_0x3b0558(0x12a)]=_0x3f736f['description']);const _0x304dee=await withSpinner(_0x3b0558(0x128)+_0x3fdbfd+_0x3b0558(0x18a)+_0x358b2d+_0x3b0558(0x138),()=>_0x45aedf['personalization'][_0x3b0558(0x11b)](_0xd0655d,_0x358b2d,_0x201266),{'verbose':_0x30c0b9[_0x3b0558(0x188)]}),_0x40a07b=_0x304dee['data'];return console[_0x3b0558(0x25f)]('✔\x20Created\x20token\x20\x27'+_0x40a07b[_0x3b0558(0x282)]+'\x27\x20with\x20ID:\x20'+_0x40a07b['id']),_0x40a07b['value']&&(console[_0x3b0558(0x25f)](a32_0x265203[_0x3b0558(0xb5)](_0x3b0558(0x1be))),console[_0x3b0558(0x25f)](a32_0x265203[_0x3b0558(0xcd)](_0x40a07b[_0x3b0558(0x1a9)])),console[_0x3b0558(0x25f)]('')),await handleSDKOutput([_0x40a07b],_0x30c0b9),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:service:token:delete';[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x259);async[a32_0x51f12c(0x1fc)](_0x8041a5){const _0x378832=a32_0x51f12c,{options:_0x543cf1,args:_0x418d68,tdx:_0x3eca5c}=_0x8041a5,_0x473042=_0x418d68[0x0],_0x43b158=_0x418d68[0x1]||_0x543cf1['parentSegment'];if(!_0x473042)return console[_0x378832(0x25f)](_0x378832(0x9b)),console['error'](_0x378832(0x115)),console[_0x378832(0x25f)](_0x378832(0xfa)),0x1;if(!_0x43b158)return showParentSegmentNotSetError(_0x378832(0x1cb)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x5c421f=await withSpinner(_0x378832(0x168)+_0x43b158+_0x378832(0x138),()=>_0x3eca5c[_0x378832(0x1c1)][_0x378832(0x242)](_0x43b158),{'verbose':_0x543cf1['verbose']}),_0x5dcd2a=_0x5c421f[_0x378832(0xef)],_0x588f91=await withSpinner(_0x378832(0xc6),()=>_0x3eca5c[_0x378832(0x8f)][_0x378832(0x227)](_0x5dcd2a),{'verbose':_0x543cf1['verbose']}),_0x7a167c=_0x588f91['data'];let _0x62c3a6;for(const _0x7358be of _0x7a167c){if(_0x7358be[_0x378832(0x111)]?.[_0x378832(0xd6)](_0x4c7701=>_0x4c7701['id']===_0x473042)){_0x62c3a6=_0x7358be['id'];break;}}if(!_0x62c3a6)return console[_0x378832(0x25f)](_0x378832(0x1a2)+_0x473042+_0x378832(0x21b)),0x1;const _0x2aba88=await withSpinner('Deleting\x20token\x20\x27'+_0x473042+_0x378832(0x138),()=>_0x3eca5c[_0x378832(0x8f)][_0x378832(0x23d)](_0x5dcd2a,_0x62c3a6,_0x473042),{'verbose':_0x543cf1[_0x378832(0x188)]}),_0x462e79=_0x2aba88[_0x378832(0xef)];return console[_0x378832(0x25f)](_0x378832(0x164)+(_0x462e79[_0x378832(0x282)]||_0x473042)+'\x27'),await handleSDKOutput([_0x462e79],_0x543cf1),0x0;}}export class PSPzListCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x184);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x24c);async[a32_0x51f12c(0x1fc)](_0x2adf10){const _0x333418=a32_0x51f12c,{options:_0x5c97a5,args:_0x1c255b,tdx:_0x4e4fd5}=_0x2adf10,_0x5515f5=_0x1c255b[0x0]||_0x5c97a5[_0x333418(0x196)];if(!_0x5515f5)return showParentSegmentNotSetError(_0x333418(0xf2)+'\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'),0x1;const _0x3808c6=await withSpinner(_0x333418(0x168)+_0x5515f5+'\x27...',()=>_0x4e4fd5[_0x333418(0x1c1)][_0x333418(0x242)](_0x5515f5),{'verbose':_0x5c97a5[_0x333418(0x188)]}),_0xf75d52=_0x3808c6[_0x333418(0xef)],_0x545a86=await withSpinner(_0x333418(0x191)+_0x5515f5+_0x333418(0x138),()=>_0x4e4fd5[_0x333418(0x8f)][_0x333418(0x206)](_0xf75d52),{'verbose':_0x5c97a5['verbose']}),_0x33892a=_0x545a86[_0x333418(0xef)];console[_0x333418(0x25f)]('✔\x20Found\x20'+_0x33892a[_0x333418(0x1ad)]+_0x333418(0x180)+(_0x33892a[_0x333418(0x1ad)]!==0x1?'s':''));if(_0x5c97a5[_0x333418(0x1bc)]===_0x333418(0x1c6)||_0x5c97a5[_0x333418(0x1bc)]===_0x333418(0x114))await handleSDKOutput(_0x33892a,_0x5c97a5);else{if(_0x33892a[_0x333418(0x1ad)]===0x0)console['log'](_0x333418(0xb3));else for(const _0x3de453 of _0x33892a){console[_0x333418(0x16d)](a32_0x265203[_0x333418(0x27a)](_0x3de453[_0x333418(0x282)])+'\x20'+a32_0x265203[_0x333418(0x1c2)]('(id:\x20'+_0x3de453['id']+')'));_0x3de453[_0x333418(0x12a)]&&console[_0x333418(0x16d)]('\x20\x20'+a32_0x265203[_0x333418(0x1c2)](_0x3de453[_0x333418(0x12a)]));const _0x179f6d=_0x3de453['sections']?.[_0x333418(0x1ad)]||0x0;console[_0x333418(0x16d)]('\x20\x20'+a32_0x265203[_0x333418(0xcd)]('sections:')+'\x20'+_0x179f6d);if(_0x3de453[_0x333418(0x26b)]&&_0x3de453[_0x333418(0x26b)][_0x333418(0x1ad)]>0x0)for(const _0x530175 of _0x3de453['sections']){console[_0x333418(0x16d)]('\x20\x20\x20\x20-\x20'+_0x530175['name']);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0xfd);[a32_0x51f12c(0x12a)]='Show\x20a\x20specific\x20realtime\x20personalization';async[a32_0x51f12c(0x1fc)](_0x4b66ca){const _0x200e75=a32_0x51f12c,{options:_0x34ab9d,args:_0x646ac,tdx:_0x36f75d}=_0x4b66ca,_0x176c5f=_0x646ac[0x0];if(!_0x176c5f)return console[_0x200e75(0x25f)](_0x200e75(0x256)),console[_0x200e75(0x25f)]('Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>'),0x1;const _0x36ab4d=await withSpinner(_0x200e75(0xa3)+_0x176c5f+_0x200e75(0x138),()=>_0x36f75d['personalization'][_0x200e75(0x1ce)](_0x176c5f),{'verbose':_0x34ab9d['verbose']}),_0x20e0d8=_0x36ab4d['data'];console[_0x200e75(0x25f)](_0x200e75(0x284)+_0x20e0d8[_0x200e75(0x282)]+'\x27');if(_0x34ab9d[_0x200e75(0x1bc)]===_0x200e75(0x1c6)||_0x34ab9d[_0x200e75(0x1bc)]==='jsonl')await handleSDKOutput([_0x20e0d8],_0x34ab9d);else{console[_0x200e75(0x16d)](a32_0x265203['bold'](_0x20e0d8[_0x200e75(0x282)])+'\x20'+a32_0x265203['dim'](_0x200e75(0x23f)+_0x20e0d8['id']+')'));_0x20e0d8[_0x200e75(0x12a)]&&console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203['dim'](_0x20e0d8[_0x200e75(0x12a)]));_0x20e0d8[_0x200e75(0x231)]&&console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0x14b))+'\x20'+_0x20e0d8[_0x200e75(0x231)]);console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203[_0x200e75(0xcd)]('created:')+'\x20'+_0x20e0d8['createdAt']),console[_0x200e75(0x16d)]('\x20\x20'+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0xd9))+'\x20'+_0x20e0d8[_0x200e75(0xbf)]);const _0x41b3ab=_0x20e0d8[_0x200e75(0x26b)]?.[_0x200e75(0x1ad)]||0x0;console['log']('\x20\x20'+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0x15b))+'\x20'+_0x41b3ab);if(_0x20e0d8[_0x200e75(0x26b)]&&_0x20e0d8[_0x200e75(0x26b)][_0x200e75(0x1ad)]>0x0)for(const _0x26fa48 of _0x20e0d8['sections']){console[_0x200e75(0x16d)]('\x20\x20\x20\x20'+a32_0x265203[_0x200e75(0x27a)](_0x26fa48[_0x200e75(0x282)])+'\x20'+a32_0x265203['dim'](_0x200e75(0x23f)+_0x26fa48['id']+')')),_0x26fa48[_0x200e75(0xcc)]&&(console[_0x200e75(0x16d)](_0x200e75(0x202)+a32_0x265203['cyan'](_0x200e75(0x1ab))+'\x20'+_0x26fa48[_0x200e75(0xcc)]['name']),_0x26fa48[_0x200e75(0xcc)][_0x200e75(0xd4)]?.[_0x200e75(0x273)]&&console[_0x200e75(0x16d)](_0x200e75(0x119)+a32_0x265203[_0x200e75(0xcd)]('keyEventId:')+'\x20'+_0x26fa48[_0x200e75(0xcc)][_0x200e75(0xd4)][_0x200e75(0x273)])),_0x26fa48[_0x200e75(0x26f)]&&console[_0x200e75(0x16d)](_0x200e75(0x202)+a32_0x265203[_0x200e75(0xcd)](_0x200e75(0x8d))+'\x20'+JSON['stringify'](_0x26fa48[_0x200e75(0x26f)])),_0x26fa48[_0x200e75(0xa1)]&&console[_0x200e75(0x16d)](_0x200e75(0x202)+a32_0x265203['cyan'](_0x200e75(0x280))+_0x200e75(0x11a));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{['name']=a32_0x51f12c(0xd1);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0xe4);async[a32_0x51f12c(0x1fc)](_0x1170d6){const _0x3c6ef2=a32_0x51f12c,{options:_0x1c220a,args:_0x57918a,tdx:_0x2e93a2}=_0x1170d6,_0x2cdc71=_0x57918a[0x0];if(!_0x2cdc71)return console['error'](_0x3c6ef2(0x256)),console[_0x3c6ef2(0x25f)](_0x3c6ef2(0x20d)),0x1;return await withSpinner(_0x3c6ef2(0x167)+_0x2cdc71+'\x27...',()=>_0x2e93a2['personalization'][_0x3c6ef2(0xe0)](_0x2cdc71),{'verbose':_0x1c220a['verbose']}),console['error'](_0x3c6ef2(0x15d)+_0x2cdc71+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a32_0x51f12c(0x282)]='ps:pz:create';['description']=a32_0x51f12c(0x16c);async[a32_0x51f12c(0x1fc)](_0x386d41){const _0x18a867=a32_0x51f12c,{options:_0x2ba36e,tdx:_0x158b39}=_0x386d41,_0xc6502c=_0x2ba36e;let _0x13b196;if(_0xc6502c['file']){_0x13b196=await loadJSON(_0xc6502c[_0x18a867(0x27b)],!![]);if(!_0x13b196[_0x18a867(0x157)]?.[_0x18a867(0xf4)])return console[_0x18a867(0x25f)](_0x18a867(0x20f)),console[_0x18a867(0x25f)](_0x18a867(0x265)),console['error'](_0x18a867(0xa5)),0x1;}else{if(!_0xc6502c[_0x18a867(0x282)])return console[_0x18a867(0x25f)](_0x18a867(0x1d4)),console[_0x18a867(0x25f)](_0x18a867(0x1cc)),console[_0x18a867(0x25f)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0xc6502c['description']===undefined)return console['error'](_0x18a867(0x1c3)),console[_0x18a867(0x25f)](_0x18a867(0x1cc)),console['error'](_0x18a867(0x271)),0x1;if(_0xc6502c[_0x18a867(0xd8)]===undefined)return console['error'](_0x18a867(0x253)),console[_0x18a867(0x25f)](_0x18a867(0x156)),0x1;let _0x5980cd=_0xc6502c[_0x18a867(0x231)];if(!_0x5980cd&&_0x2ba36e[_0x18a867(0x196)]){const _0x5a9e14=await withSpinner(_0x18a867(0x168)+_0x2ba36e[_0x18a867(0x196)]+_0x18a867(0x138),()=>_0x158b39[_0x18a867(0x1c1)][_0x18a867(0x242)](_0x2ba36e['parentSegment']),{'verbose':_0x2ba36e[_0x18a867(0x188)]});_0x5980cd=_0x5a9e14['data'];}let _0x249dda;_0xc6502c[_0x18a867(0x26b)]&&(_0x249dda=await loadJSON(_0xc6502c[_0x18a867(0x26b)],![]));const _0x3ad584=_0xc6502c['folderId']==='null'?null:{'id':_0xc6502c[_0x18a867(0xd8)],'type':'folder-segment'};_0x13b196={'attributes':{'name':_0xc6502c['name'],'description':_0xc6502c[_0x18a867(0x12a)]||null,..._0x5980cd!==undefined&&{'audienceId':_0x5980cd},..._0x249dda!==undefined&&{'sections':_0x249dda}},'relationships':{'parentFolder':{'data':_0x3ad584}}};}const _0x2c916e=await withSpinner(_0x18a867(0xd2)+(_0x13b196[_0x18a867(0x170)]?.[_0x18a867(0x282)]??'')+_0x18a867(0x138),()=>_0x158b39[_0x18a867(0x8f)][_0x18a867(0x19f)](_0x13b196),{'verbose':_0x2ba36e[_0x18a867(0x188)]}),_0x1f7069=_0x2c916e[_0x18a867(0xef)];return console[_0x18a867(0x25f)]('✔\x20Created\x20personalization\x20\x27'+_0x1f7069['name']+_0x18a867(0x225)+_0x1f7069['id']),await handleSDKOutput([_0x1f7069],_0x2ba36e),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x14f);[a32_0x51f12c(0x12a)]=a32_0x51f12c(0x135);async[a32_0x51f12c(0x1fc)](_0x1cf496){const _0xecdc0f=a32_0x51f12c,{options:_0x397cc2,args:_0x4a174e}=_0x1cf496,_0x49637c=_0x397cc2,_0x423d82=_0x4a174e[0x0];if(!_0x423d82)return console[_0xecdc0f(0x25f)](_0xecdc0f(0x256)),console[_0xecdc0f(0x25f)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0xecdc0f(0x25f)](_0xecdc0f(0x98)),0x1;let _0xad3a56;if(_0x49637c[_0xecdc0f(0x27b)])_0xad3a56=await loadJSON(_0x49637c['file'],!![]);else{if(!_0x49637c['name'])return console[_0xecdc0f(0x25f)](_0xecdc0f(0x1d4)),console[_0xecdc0f(0x25f)](_0xecdc0f(0xd3)),0x1;if(_0x49637c[_0xecdc0f(0x12a)]===undefined)return console[_0xecdc0f(0x25f)](_0xecdc0f(0x1c3)),console['error'](_0xecdc0f(0xd3)),0x1;let _0x1bab98;_0x49637c['sections']&&(_0x1bab98=await loadJSON(_0x49637c['sections'],![])),_0xad3a56={'attributes':{'name':_0x49637c[_0xecdc0f(0x282)],'description':_0x49637c[_0xecdc0f(0x12a)]||null,..._0x1bab98!==undefined&&{'sections':_0x1bab98}}};}const {tdx:_0xf1724d}=_0x1cf496,_0x2b0af8=await withSpinner('Patching\x20personalization\x20\x27'+_0x423d82+_0xecdc0f(0x138),()=>_0xf1724d[_0xecdc0f(0x8f)]['patchPersonalization'](_0x423d82,_0xad3a56),{'verbose':_0x397cc2[_0xecdc0f(0x188)]}),_0x5ea57b=_0x2b0af8[_0xecdc0f(0xef)];return console['error'](_0xecdc0f(0x147)+_0x5ea57b[_0xecdc0f(0x282)]+'\x27\x20(id:\x20'+_0x5ea57b['id']+')'),await handleSDKOutput([_0x5ea57b],_0x397cc2),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a32_0x51f12c(0x282)]=a32_0x51f12c(0x1e1);[a32_0x51f12c(0x12a)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a32_0x51f12c(0x1fc)](_0x1bfe3d){const _0x10579b=a32_0x51f12c,{options:_0xe69f50,args:_0xb32b66}=_0x1bfe3d,_0x249ccd=_0xb32b66[0x0]||_0xe69f50[_0x10579b(0x196)];if(!_0x249ccd)return showParentSegmentNotSetError(_0x10579b(0x24e)+_0x10579b(0x18b)),0x1;const _0x5775c1=resolveYamlFile(_0x249ccd);if(!existsSync(_0x5775c1))return showFileNotFoundError(_0x5775c1,_0x249ccd),0x1;let _0x12047a;try{_0x12047a=readFileSync(_0x5775c1,'utf-8');}catch(_0x2a134b){const _0x3a1dce=_0x2a134b instanceof Error?_0x2a134b['message']:String(_0x2a134b);return console[_0x10579b(0x25f)](_0x10579b(0x1d1)+_0x3a1dce),0x1;}let _0x36a1c9;try{_0x36a1c9=parseDef(_0x12047a);}catch(_0x54f055){const _0x37126b=_0x54f055 instanceof Error?_0x54f055[_0x10579b(0x183)]:String(_0x54f055);return console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0x153)](_0x10579b(0x99)+_0x37126b)),0x1;}if(_0x36a1c9[_0x10579b(0x13d)]&&_0x36a1c9['personalization_services']['length']>0x0)return console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0xb5)](_0x10579b(0xdc)+_0x5775c1)),console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0x1c2)]('\x20\x20\x20'+_0x36a1c9['personalization_services'][_0x10579b(0x1ad)]+_0x10579b(0x162))),0x1;!_0x36a1c9['realtime']&&(_0x36a1c9[_0x10579b(0x23e)]={'events':[{'name':_0x10579b(0x261),'source_table':_0x10579b(0x28e)}],'attributes':[{'name':_0x10579b(0xeb),'type':_0x10579b(0xad)}],'id_stitching':{'primary_key':_0x36a1c9[_0x10579b(0x257)][_0x10579b(0x203)]===_0x10579b(0x204)?'td_client_id':'user_id'}});_0x36a1c9[_0x10579b(0x13d)]=[{'name':_0x10579b(0x1c8),'description':_0x10579b(0xe2),'trigger_event':_0x10579b(0x261),'sections':[{'name':_0x10579b(0x102),'criteria':'true','attributes':['last_page_viewed']}]}];const _0x5bc5dc=serializeDef(_0x36a1c9);return writeFileSync(_0x5775c1,_0x5bc5dc,'utf-8'),console['error'](a32_0x265203[_0x10579b(0xff)]('✔')+_0x10579b(0xa2)+a32_0x265203[_0x10579b(0xcd)](_0x5775c1)),(!_0x36a1c9[_0x10579b(0x23e)]||_0x12047a[_0x10579b(0x262)](_0x10579b(0x25d))===-0x1)&&console[_0x10579b(0x25f)](a32_0x265203[_0x10579b(0xff)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x10579b(0x25f)]('\x0a'+a32_0x265203[_0x10579b(0x1c2)](_0x10579b(0xac))),console[_0x10579b(0x25f)](_0x10579b(0x1f7)+_0x5775c1+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x10579b(0x25f)]('\x20\x202.\x20Run\x20'+a32_0x265203[_0x10579b(0x1c2)]('tdx\x20ps\x20push\x20'+_0x249ccd)+'\x20to\x20push\x20the\x20configuration'),0x0;}}
|