@treasuredata/tdx 2026.3.39 → 2026.3.41
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.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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/segment-validator.js.map +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/cdp.d.ts +3 -0
- package/dist/sdk/types/cdp.d.ts.map +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.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const 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;}}
|
|
1
|
+
const a32_0x15c085=a32_0x3e24;(function(_0x4753b4,_0x2c185c){const _0x5b10e0=a32_0x3e24,_0x5ab143=_0x4753b4();while(!![]){try{const _0x442f66=parseInt(_0x5b10e0(0x389))/0x1*(-parseInt(_0x5b10e0(0x3aa))/0x2)+parseInt(_0x5b10e0(0x221))/0x3+-parseInt(_0x5b10e0(0x21c))/0x4*(parseInt(_0x5b10e0(0x364))/0x5)+parseInt(_0x5b10e0(0x273))/0x6+-parseInt(_0x5b10e0(0x2c9))/0x7+parseInt(_0x5b10e0(0x36a))/0x8*(-parseInt(_0x5b10e0(0x1e3))/0x9)+parseInt(_0x5b10e0(0x359))/0xa*(parseInt(_0x5b10e0(0x2ff))/0xb);if(_0x442f66===_0x2c185c)break;else _0x5ab143['push'](_0x5ab143['shift']());}catch(_0x5adfa){_0x5ab143['push'](_0x5ab143['shift']());}}}(a32_0xa0d2,0x2d406));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a32_0x2a2036 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_0x108e3e 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=a32_0x15c085(0x3dc),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x13cc52){const _0x298ca1=a32_0x15c085,_0x37aefc=process[_0x298ca1(0x331)],_0x218ba9=_0x37aefc===_0x298ca1(0x3d5)?_0x298ca1(0x383):_0x37aefc===_0x298ca1(0x2f3)?_0x298ca1(0x203):_0x298ca1(0x249);spawn(_0x218ba9,[_0x13cc52],{'detached':!![],'stdio':'ignore'})['unref']();}function migrateLegacyDirectory(){const _0x57e875=a32_0x15c085;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2cf2ad=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2cf2ad['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x57e875(0x2b9)](a32_0x108e3e[_0x57e875(0x1e6)](_0x57e875(0x2f1)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0x57e875(0x1f7))),console[_0x57e875(0x2b9)](a32_0x108e3e[_0x57e875(0x232)](_0x57e875(0x382)+LEGACY_PARENT_SEGMENT_DIR+_0x57e875(0x256))),![];console[_0x57e875(0x2b9)](a32_0x108e3e['yellow'](_0x57e875(0x21d)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x57e875(0x2b9)](a32_0x108e3e[_0x57e875(0x3a8)](_0x57e875(0x22d)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4a1603){const _0x531fcf=_0x4a1603 instanceof Error?_0x4a1603['message']:String(_0x4a1603);return console[_0x57e875(0x2b9)](a32_0x108e3e['red'](_0x57e875(0x32e)+_0x531fcf+'\x0a')),![];}}function a32_0xa0d2(){const _0x388858=['Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','\x20No\x20changes\x20-\x20','displayRealtimeInfo','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','resolveParentId','Default','\x20kill','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','schemaValid','resumeJourney','attributes','column','Error:\x20--behavior\x20requires\x20a\x20name\x0a','Enriched:','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','customerPercent','Error\x20parsing\x20YAML:\x20','RT\x202.0\x20Validate:','\x20true','sort','state','Session:','allowedIps','validateParentYaml','cyan','\x20\x20Database:\x20','\x20tdx\x20wf\x20attempt\x20','-1d','keyEventCriteria','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Show\x20a\x20specific\x20realtime\x20personalization','number','single','segment:parent:pull','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','sections:','map','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Resolving\x20parent\x20segment\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','No\x20personalization\x20services\x20configured','Error:\x20Token\x20ID\x20is\x20required','ps:pz:service:token:create','Creating','\x0aError:','any','Created','\x20\x20Note:\x20','error','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Personalization:','message','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','Error:\x20Token\x20\x27','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','displayBehaviorsStats','Fetching\x20SQL\x20for\x20\x27','ps:pz:init','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Source:','idStitching','\x20rows)','\x20service(s)\x20configured','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','1715609fiozXw','segment:parent:show','ps:pz:service:delete','ps:rt:jn:list','✔\x20Updated\x20personalization\x20\x27','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','enriched','parentSegment','public:','\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','token:','\x20(paused)','column_name','\x20stage','split','\x20Configuration\x20is\x20valid','Finding\x20service\x20for\x20token...','\x20parent\x20segment','Options\x20(one\x20required):\x0a','\x20parent\x20segment\x20\x27','\x20=\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','workflowAttemptId','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Overwrite\x20\x27','/attempt/','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Output\x20Database:','Error:\x20--database\x20and\x20--table\x20are\x20required','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x20\x20\x20\x20-\x20','👥\x20','collectSchema','ps:rt:list','createPersonalization','trim','displaySummary','\x0a⚠️\x20\x20Both\x20','preview','win32','List\x20parent\x20segments','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','behavior_','length','Get\x20current\x20RT\x20configuration\x20version\x20status','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','getParentFull','behaviorsFile','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','✔\x20Updated\x20parent\x20segment\x20\x27','10978BvUWKr','string','createdAt','`\x20to\x20download\x20the\x20configuration\x20first','yes','customerGroupFile','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','apply','\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','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Name:\x20','Status:','Updating','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','✔\x20Found\x20personalization\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Apply\x20changes\x20to\x20\x27','Creating\x20token\x20\x27','description','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\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','Fetching\x20personalization\x20service\x20\x27','database','getPersonalization','Show\x20parent\x20segment\x20details','Creating\x20personalization\x20service\x20\x27','Updating\x20personalization\x20service\x20\x27','Delete\x20a\x20realtime\x20personalization','\x20[Job\x20ID:\x20','✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27','allValid','sourceTableError','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Error:','✔\x20Deleted\x20personalization\x20service\x20\x27','Available\x20attributes:','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','ps:pz:show','\x27\x20for\x20service\x20\x27','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','getCurrentConfigVersion','Fetching\x20sample\x20data...','\x27\x20is\x20already\x20up\x20to\x20date','\x20is\x20already\x20up\x20to\x20date','toLowerCase','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x0aNew\x20parent\x20segment\x20\x27','No\x20RT\x20journeys\x20found','platform','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Next\x20steps:','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','Error\x20reading\x20file:\x20','displayPreviewHints','<database>.<table>','interval','displayMasterInfo','keys','parentFolder','Errors:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','keyEventId:','segment:parent:desc','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','workflowSessionId','last_page_viewed','relationships','tdx\x20ps\x20push\x20','addAttributes','segment:parent:view','.yaml','rowCount','audienceId','Listing\x20fields\x20for\x20\x27','To\x20view\x20sample\x20data:','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','Deleting\x20token\x20\x27','scheduleType','segment:parent:push','FINISHED','table','\x20\x20Tables:\x201\x20customers\x20+\x20','null','sampleData','\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','value','no\x20tokens\x20configured','4330sFxcEv','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','created:','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20--behavior\x20\x22','includeSensitive','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20to\x20configure\x20your\x20personalization\x20service','\x5c$&','\x20\x20\x20\x20','page_view','631175xfdoLi','\x20\x20\x20\x20\x20\x20\x20\x20','✔\x20Deleted\x20personalization\x20\x27','Fetching\x20customers\x20schema...','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','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','573368Tfoojr','\x20--attribute\x20\x22<name>\x22','Attributes:','getOutputDatabaseName','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','formatSchemaJson','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x20rows\x20','Columns:','\x20RT\x20configuration\x20is\x20valid','Update\x20a\x20realtime\x20personalization\x20entity','\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','\x20total','pauseJourney','personalization_services','listPersonalizations','Attribute:','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Creating\x20parent\x20segment\x20\x27','identifier:\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','deletePersonalization','segment:parent:run','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','open','Updated','\x27\x20with\x20ID:\x20','Error:\x20File\x20not\x20found:\x20','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','patch','15vYiDjp','audienceId:\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','displayPreviewResults','segment:parent:fields','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','personalizationServices','ps:rt:validate','Attempt:','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','events','Show\x20personalization\x20service\x20details','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','YAML\x20file:\x20','population','\x20to\x20push\x20the\x20configuration','verbose','List\x20available\x20fields\x20for\x20segmentation','\x20personalization','✔\x20Created\x20parent\x20segment\x20\x27','file','Updating\x20parent\x20segment\x20\x27','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','ps:pz:service:list','customerGroup','/sessions/','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','customersWithEvents','Error:\x20Personalization\x20ID\x20is\x20required','✔\x20No\x20changes\x20-\x20\x27','green','previewParentYaml','1186DBKOXG','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','listFields','text','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','ps:rt:configuration_versions','addBehaviorsFile','payload','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','SELECT\x20*\x20FROM\x20','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','\x27...','site','\x20Added\x20RT\x202.0\x20template\x20section','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','\x0a✔\x20Workflow\x20started','jobId','join','\x20\x20\x20\x20\x20\x20','No\x20personalizations\x20configured','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','Listing\x20personalization\x20services\x20for\x20\x27','segment:parent:list','ID\x20Stitching:','output','use','No\x20RT-enabled\x20parent\x20segments\x20found','\x27\x20(id:\x20','\x20\x20\x20','repeat','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','realtime:','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','indexOf','type','Fetching\x20behavior\x20list...','.customers)','list','Delete\x20a\x20personalization\x20service','\x20--enriched','run','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','darwin','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','Validate:','.yml','Create\x20a\x20realtime\x20personalization\x20entity','keyEventId','column_type','parent_segments','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','Preview:','all','delete','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','Getting\x20personalization\x20\x27','\x20\x202.\x20Run\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','\x20personalization\x20service','Master:','ps:pz:delete','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Error:\x20Service\x20name\x20is\x20required','\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','Get\x20SQL\x20query\x20for\x20parent\x20segment','dirname','List\x20RT\x20journeys','Aborted.','behavior','elapsedTimeMillis','/app/dw/parentSegments/','Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.','Customers:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','information_schema','master','displayAttributesStats','Executing\x20parent\x20segment\x20query...','addAttributesFile','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','format','✔\x20Retrieved\x20RT\x20configuration\x20version','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','\x20--behavior\x20\x22<name>\x22','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Validating\x20RT\x20configuration...','jsonl','✔\x20Updated\x20personalization\x20service\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','bold','segment:parent:validate','td_client_id','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','Analyzing\x20changes...','\x20\x201.\x20Edit\x20','9JzYBYv','\x20--attribute\x20\x22','Events:','yellow','Join:','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','scheduleOption','RT\x20Journey\x20ID:\x20','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','joinKey','replace','Master\x20Table','To\x20cancel:','Options:\x0a','\x22\x20}','tdx\x20ps\x20preview\x20','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Create\x20parent\x20segment\x20\x27','/\x20directories\x20exist.','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Site:\x20','label','filter','double','No\x20parent\x20segments\x20match\x20pattern:\x20','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','sections','toLocaleString','coveragePercent','stop','start','Attributes','stringify','allowed\x20IPs:','data','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','customers','pushParentYaml','✔\x20Query\x20completed:\x20Processed\x20','log','valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','Join\x20on:','behaviors','✔\x20Created\x20token\x20\x27','segment','segment:parent:update','\x20Context\x20set:\x20','tokens','schemaError','runParent','Listing\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','realtime','4fhAkso','\x0a⚠️\x20\x20Migrating:\x20','ps:pz:service:create','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x20service','487941SeAtOo','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','\x20Opening\x20','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','displaySampleData','timezone','errors','test','stitchingKeys','setJobId','My\x20Service','✔\x20Renamed\x20directory\x20to\x20','folderId','getParentSQL','\x0aNo\x20sample\x20data\x20available','Listing\x20RT\x20journeys\x20for\x20\x27','dim','status:\x20','SELECT\x20*\x20FROM\x20(\x0a','stats','Pause\x20activations\x20in\x20an\x20RT\x20journey','personalization','name','localeCompare','launched','\x20Added\x20personalization\x20template\x20to\x20','createParent','folder-segment','realtime_enabled','addBehaviors','Creating\x20personalization\x20\x27','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','✔\x20Created\x20personalization\x20\x27','totalEvents','segment:parent:preview','red','getBehaviorNames','RT\x202.0:','xdg-open','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','\x27\x20is\x20up\x20to\x20date','Output\x20file:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','Patching\x20personalization\x20\x27','json','displayColumns','columns','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','status','Error:\x20Service\x20ID\x20is\x20required','/\x20directory.\x0a','utf-8','Error:\x20--attribute\x20requires\x20a\x20name\x0a','stageCount','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','in\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','Behavior:','session','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','ps:pz:service:token:delete','match','(id:\x20','Found\x20YAML\x20file:\x20','identifier','attribute','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20configured','Options:','execute','displayValidateResults','\x0a\x20\x20\x20\x20}','eventKind','true','updateParent','Table:\x20','Deleting\x20personalization\x20service\x20\x27','entryCriteria:','254742vJnEvY','✔\x20Created\x20personalization\x20service\x20\x27','\x0a\x20\x20]\x0a}\x0a','foreignKey','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20(requires\x20context)\x0a','Deleting\x20personalization\x20\x27','limit','✔\x20Found\x20','Error:\x20--name\x20is\x20required','ps:pz:list','ps:pz:service:update','includeSensitive:','Fetching\x20parent\x20segment\x20\x27','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x20RT\x20journey','Coverage:','paused','public','workflowId','updatedAt','\x27\x20and\x20run\x20workflow?'];a32_0xa0d2=function(){return _0x388858;};return a32_0xa0d2();}class BaseParentSegmentCommand extends BaseCommand{async[a32_0x15c085(0x3d3)](_0x4f61c6){const _0x267489=a32_0x15c085;return migrateLegacyDirectory(),super[_0x267489(0x3d3)](_0x4f61c6);}}function resolveYamlFile(_0x14df2f){const _0x33ed82=a32_0x15c085;if(_0x14df2f['endsWith'](_0x33ed82(0x3d8))||_0x14df2f['endsWith'](_0x33ed82(0x347)))return _0x14df2f;return a32_0x2a2036['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x14df2f)+_0x33ed82(0x3d8));}function a32_0x3e24(_0x3d9600,_0x176f0a){_0x3d9600=_0x3d9600-0x1d5;const _0xa0d28c=a32_0xa0d2();let _0x3e24ce=_0xa0d28c[_0x3d9600];return _0x3e24ce;}function formatProgressMessage(_0x1ccb82){const _0x2f983a=a32_0x15c085,_0xb2357c=_0x1ccb82[_0x2f983a(0x261)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xb2357c){const [,_0x245822,_0x3562c0,_0x102546='']=_0xb2357c;return a32_0x108e3e[_0x2f983a(0x232)](_0x245822+':')+'\x20'+_0x3562c0+a32_0x108e3e[_0x2f983a(0x232)](_0x102546);}return a32_0x108e3e[_0x2f983a(0x232)](_0x1ccb82);}function showFileNotFoundError(_0xe8fde7,_0x1b6da3){const _0x223d0e=a32_0x15c085;console['error'](a32_0x108e3e[_0x223d0e(0x246)](_0x223d0e(0x386)+_0xe8fde7+'\x0a')),console[_0x223d0e(0x2b9)](a32_0x108e3e['cyan'](_0x223d0e(0x328)+_0x1b6da3+_0x223d0e(0x302)));}function displayRealtimeValidation(_0x57a43c){const _0x58c1c6=a32_0x15c085;if(!_0x57a43c[_0x58c1c6(0x21b)])return;const _0x74c99e=_0x57a43c[_0x58c1c6(0x21b)],_0x3e52b9=_0x74c99e['enabled']?a32_0x108e3e[_0x58c1c6(0x3a8)]('⚡\x20Enabled'):a32_0x108e3e['yellow']('⚡\x20Not\x20enabled');console[_0x58c1c6(0x2b9)]('\x0a'+a32_0x108e3e[_0x58c1c6(0x232)](_0x58c1c6(0x248))+'\x20'+_0x3e52b9);if(_0x74c99e[_0x58c1c6(0x393)]&&_0x74c99e['events']['length']>0x0){console['error']('\x20\x20'+a32_0x108e3e[_0x58c1c6(0x232)](_0x58c1c6(0x1e5))+'\x20'+_0x74c99e['events'][_0x58c1c6(0x2f7)]+_0x58c1c6(0x268));for(const _0x2ce55a of _0x74c99e['events']){const _0x1aa4b7=_0x2ce55a['sourceTableValid']===![]?a32_0x108e3e['red']('✘'):a32_0x108e3e[_0x58c1c6(0x3a8)]('✔');console[_0x58c1c6(0x2b9)](_0x58c1c6(0x362)+_0x1aa4b7+'\x20'+_0x2ce55a[_0x58c1c6(0x238)]),_0x2ce55a[_0x58c1c6(0x31f)]&&console['error'](_0x58c1c6(0x3bd)+a32_0x108e3e[_0x58c1c6(0x246)](_0x2ce55a[_0x58c1c6(0x31f)]));}}if(_0x74c99e[_0x58c1c6(0x293)]&&_0x74c99e[_0x58c1c6(0x293)][_0x58c1c6(0x2f7)]>0x0){console[_0x58c1c6(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x58c1c6(0x232)](_0x58c1c6(0x36c))+'\x20'+_0x74c99e[_0x58c1c6(0x293)]['length']+'\x20configured');for(const _0x1aacae of _0x74c99e[_0x58c1c6(0x293)]){const _0x53d386=_0x1aacae[_0x58c1c6(0x20e)]?a32_0x108e3e['green']('✔'):a32_0x108e3e['red']('✘');console[_0x58c1c6(0x2b9)](_0x58c1c6(0x362)+_0x53d386+'\x20'+_0x1aacae[_0x58c1c6(0x238)]+'\x20'+a32_0x108e3e[_0x58c1c6(0x232)]('('+_0x1aacae[_0x58c1c6(0x3cd)]+')'));}}if(_0x74c99e[_0x58c1c6(0x2c5)]){const _0x4f0131=_0x74c99e[_0x58c1c6(0x2c5)][_0x58c1c6(0x22a)]?.[_0x58c1c6(0x2f7)]?'\x20+\x20['+_0x74c99e['idStitching'][_0x58c1c6(0x22a)][_0x58c1c6(0x3bc)](',\x20')+']':'';console['error']('\x20\x20'+a32_0x108e3e['dim'](_0x58c1c6(0x3c2))+'\x20'+_0x74c99e[_0x58c1c6(0x2c5)]['primaryKey']+_0x4f0131);}if(_0x74c99e[_0x58c1c6(0x38f)]&&_0x74c99e[_0x58c1c6(0x38f)][_0x58c1c6(0x2f7)]>0x0){console[_0x58c1c6(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x58c1c6(0x232)](_0x58c1c6(0x2bb))+'\x20'+_0x74c99e[_0x58c1c6(0x38f)][_0x58c1c6(0x2f7)]+_0x58c1c6(0x220)+(_0x74c99e[_0x58c1c6(0x38f)][_0x58c1c6(0x2f7)]!==0x1?'s':''));for(const _0x3fba41 of _0x74c99e[_0x58c1c6(0x38f)]){console[_0x58c1c6(0x2b9)](_0x58c1c6(0x2ea)+_0x3fba41[_0x58c1c6(0x238)]);}}}function showParentSegmentNotSetError(_0x2bb29a){const _0x22e881=a32_0x15c085;console[_0x22e881(0x2b9)](a32_0x108e3e['yellow'](_0x22e881(0x21f))),console[_0x22e881(0x2b9)](_0x2bb29a);}export class ParentSegmentListCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x3c1);['description']=a32_0x15c085(0x2f4);async['execute'](_0x8b928a){const _0xfb5790=a32_0x15c085,{options:_0x5ef748,args:_0x5079f6,tdx:_0x28e3ab}=_0x8b928a,_0xf4f2e7=_0x5079f6[0x0];_0x5ef748[_0xfb5790(0x399)]&&(console[_0xfb5790(0x2b9)]('Site:\x20'+_0x5ef748[_0xfb5790(0x3b7)]),_0xf4f2e7&&console['error']('Pattern:\x20'+_0xf4f2e7));const _0x399bd5=await withSpinner(_0xf4f2e7?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0xf4f2e7+_0xfb5790(0x3b6):_0xfb5790(0x219),()=>_0x28e3ab[_0xfb5790(0x213)]['listParents'](),{'verbose':_0x5ef748['verbose']});let _0x9489d7=_0x399bd5[_0xfb5790(0x207)];if(_0xf4f2e7){const _0x23d255=_0xf4f2e7[_0xfb5790(0x1ee)](/[.+^${}()|[\]\\]/g,_0xfb5790(0x361))[_0xfb5790(0x1ee)](/\*/g,'.*')[_0xfb5790(0x1ee)](/\?/g,'.'),_0x55be9c=new RegExp('^'+_0x23d255+'$','i');_0x9489d7=_0x9489d7['filter'](_0x44b847=>_0x55be9c[_0xfb5790(0x229)](_0x44b847[_0xfb5790(0x293)][_0xfb5790(0x238)]));}_0x9489d7[_0xfb5790(0x29c)]((_0x26afd5,_0x29233b)=>_0x26afd5[_0xfb5790(0x293)]['name'][_0xfb5790(0x239)](_0x29233b[_0xfb5790(0x293)]['name'])),console[_0xfb5790(0x2b9)](_0xfb5790(0x27b)+_0x9489d7['length']+_0xfb5790(0x2da)+(_0x9489d7[_0xfb5790(0x2f7)]!==0x1?'s':''));const _0x156572=_0x2971fc=>{const _0x2c964a=_0xfb5790;return getConsoleNextUrl(_0x5ef748[_0x2c964a(0x3b7)],'/app/dw/parentSegments/'+_0x2971fc);};if(_0x5ef748[_0xfb5790(0x3fc)]==='json'||_0x5ef748[_0xfb5790(0x3fc)]===_0xfb5790(0x1da)){const _0x87021a=_0x9489d7[_0xfb5790(0x2ad)](_0x38591e=>({..._0x38591e,'url':_0x156572(_0x38591e['id'])}));await handleSDKOutput(_0x87021a,_0x5ef748);}else{if(_0x9489d7[_0xfb5790(0x2f7)]===0x0)_0xf4f2e7?console[_0xfb5790(0x20d)](_0xfb5790(0x1fd)+_0xf4f2e7):console[_0xfb5790(0x20d)]('No\x20parent\x20segments\x20found');else for(const _0x4718fc of _0x9489d7){const _0x542e0e=_0x4718fc[_0xfb5790(0x293)][_0xfb5790(0x397)]?a32_0x108e3e['dim']('\x20('+formatRows(_0x4718fc['attributes'][_0xfb5790(0x397)])+')'):'',_0x3f123a=hyperlink(_0x4718fc[_0xfb5790(0x293)]['name'],_0x156572(_0x4718fc['id']));console['log'](_0xfb5790(0x2eb)+_0x3f123a+_0x542e0e);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a32_0x15c085(0x238)]='segment:parent:create';[a32_0x15c085(0x312)]=a32_0x15c085(0x35f);async[a32_0x15c085(0x26a)](_0x860df){const _0xb9d10d=a32_0x15c085,{options:_0xf45149,args:_0x5bbc1e,tdx:_0x2fa430}=_0x860df;console[_0xb9d10d(0x2b9)](_0xb9d10d(0x267)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0xb9d10d(0x37e));const _0x29fea2=_0xf45149;if(_0x5bbc1e[_0xb9d10d(0x2f7)]===0x0)return console[_0xb9d10d(0x2b9)](a32_0x108e3e[_0xb9d10d(0x246)](_0xb9d10d(0x2de))),console[_0xb9d10d(0x2b9)](_0xb9d10d(0x3a4)),0x1;const _0x5e4924=_0x5bbc1e[0x0];if(!_0x29fea2[_0xb9d10d(0x316)]||!_0x29fea2['table'])return console[_0xb9d10d(0x2b9)](_0xb9d10d(0x2e7)),console['error'](_0xb9d10d(0x3a4)),0x1;_0x29fea2[_0xb9d10d(0x399)]&&(console[_0xb9d10d(0x2b9)](_0xb9d10d(0x1f9)+_0x29fea2[_0xb9d10d(0x3b7)]),console['error'](_0xb9d10d(0x30a)+_0x5e4924),console[_0xb9d10d(0x2b9)]('Database:\x20'+_0x29fea2[_0xb9d10d(0x316)]),console[_0xb9d10d(0x2b9)](_0xb9d10d(0x270)+_0x29fea2['table']));const _0x15bca7=await loadJSONFromOptions(_0x29fea2[_0xb9d10d(0x293)],_0x29fea2['attributesFile']),_0x21a180=await loadJSONFromOptions(_0x29fea2[_0xb9d10d(0x211)],_0x29fea2[_0xb9d10d(0x2fc)]),_0x316753=await loadJSONFromOptions(_0x29fea2['customerGroup'],_0x29fea2[_0xb9d10d(0x304)]),_0x4b29ea={'name':_0x5e4924,'description':_0x29fea2['description'],'scheduleType':_0x29fea2[_0xb9d10d(0x34f)],'scheduleOption':_0x29fea2[_0xb9d10d(0x1e9)],'timezone':_0x29fea2[_0xb9d10d(0x227)],'master':{'parentDatabaseName':_0x29fea2[_0xb9d10d(0x316)],'parentTableName':_0x29fea2[_0xb9d10d(0x352)]},'attributes':_0x15bca7,'behaviors':_0x21a180,'customerGroup':_0x316753},_0x11bc76=await withSpinner(_0xb9d10d(0x37c)+_0x5e4924+_0xb9d10d(0x3b6),()=>_0x2fa430[_0xb9d10d(0x213)][_0xb9d10d(0x23c)](_0x4b29ea),{'verbose':_0xf45149[_0xb9d10d(0x399)]}),_0x2a0d97=_0x11bc76[_0xb9d10d(0x207)];return console[_0xb9d10d(0x2b9)](_0xb9d10d(0x39c)+_0x2a0d97[_0xb9d10d(0x238)]+_0xb9d10d(0x385)+_0x2a0d97['id']),await handleSDKOutput([_0x2a0d97],_0xf45149),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a32_0x15c085(0x214);['description']=a32_0x15c085(0x241);async[a32_0x15c085(0x26a)](_0x42d11c){const _0x51c9cb=a32_0x15c085,{options:_0x59f42b,args:_0x5b069b,tdx:_0x4c3bdd}=_0x42d11c;console['error'](_0x51c9cb(0x24d)+_0x51c9cb(0x1fe)+_0x51c9cb(0x37e));const _0x5f04a5=_0x59f42b;if(_0x5b069b[_0x51c9cb(0x2f7)]===0x0)return console['error'](a32_0x108e3e['red'](_0x51c9cb(0x2de))),console[_0x51c9cb(0x2b9)](_0x51c9cb(0x25a)),0x1;const _0x595a1c=_0x5b069b[0x0];_0x5f04a5['verbose']&&(console[_0x51c9cb(0x2b9)](_0x51c9cb(0x1f9)+_0x5f04a5[_0x51c9cb(0x3b7)]),console[_0x51c9cb(0x2b9)](_0x51c9cb(0x1f4)+_0x595a1c));const _0x26af5b=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x595a1c+_0x51c9cb(0x3b6),()=>_0x4c3bdd[_0x51c9cb(0x213)][_0x51c9cb(0x2fb)](_0x595a1c),{'verbose':_0x5f04a5[_0x51c9cb(0x399)]}),_0x622d28=_0x26af5b[_0x51c9cb(0x207)],_0x3dc113=await loadJSONFromOptions(_0x5f04a5[_0x51c9cb(0x345)],_0x5f04a5[_0x51c9cb(0x3fa)]),_0xdf9fcc=await loadJSONFromOptions(_0x5f04a5[_0x51c9cb(0x23f)],_0x5f04a5[_0x51c9cb(0x3b1)]),_0x616906={'name':_0x622d28[_0x51c9cb(0x238)],'description':_0x5f04a5[_0x51c9cb(0x312)]!==undefined?_0x5f04a5['description']:_0x622d28['description'],'scheduleType':_0x5f04a5[_0x51c9cb(0x34f)]!==undefined?_0x5f04a5[_0x51c9cb(0x34f)]:_0x622d28[_0x51c9cb(0x34f)],'scheduleOption':_0x5f04a5[_0x51c9cb(0x1e9)]!==undefined?_0x5f04a5['scheduleOption']:_0x622d28[_0x51c9cb(0x1e9)],'timezone':_0x5f04a5[_0x51c9cb(0x227)]!==undefined?_0x5f04a5[_0x51c9cb(0x227)]:_0x622d28['timezone'],'master':_0x622d28[_0x51c9cb(0x3f7)],'attributes':_0x3dc113?[..._0x622d28[_0x51c9cb(0x293)]||[],..._0x3dc113]:_0x622d28[_0x51c9cb(0x293)],'behaviors':_0xdf9fcc?[..._0x622d28['behaviors']||[],..._0xdf9fcc]:_0x622d28['behaviors'],'customerGroup':_0x622d28[_0x51c9cb(0x3a2)]},_0x310c92=await withSpinner(_0x51c9cb(0x39e)+_0x595a1c+_0x51c9cb(0x3b6),()=>_0x4c3bdd[_0x51c9cb(0x213)][_0x51c9cb(0x26f)](_0x595a1c,_0x616906),{'verbose':_0x5f04a5[_0x51c9cb(0x399)]}),_0x48686b=_0x310c92[_0x51c9cb(0x207)];return console[_0x51c9cb(0x2b9)](_0x51c9cb(0x2fe)+_0x48686b[_0x51c9cb(0x238)]+'\x27'),await handleSDKOutput([_0x48686b],_0x5f04a5),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x2aa);['description']=a32_0x15c085(0x297);async[a32_0x15c085(0x26a)](_0x540bd6){const _0x194c2f=a32_0x15c085,{options:_0x4d318a,args:_0x3d59cf,tdx:_0x50ee0e}=_0x540bd6,_0x1f6420=_0x4d318a,_0x228f6c=_0x3d59cf[0x0]||_0x4d318a[_0x194c2f(0x2d0)];if(!_0x228f6c)return showParentSegmentNotSetError(_0x194c2f(0x3b3)+_0x194c2f(0x266)),0x1;if(_0x1f6420[_0x194c2f(0x3c4)]&&_0x1f6420[_0x194c2f(0x3c3)])return console[_0x194c2f(0x2b9)](a32_0x108e3e[_0x194c2f(0x246)](_0x194c2f(0x3c9))),console[_0x194c2f(0x2b9)](a32_0x108e3e[_0x194c2f(0x232)](_0x194c2f(0x340))),console[_0x194c2f(0x2b9)](a32_0x108e3e['dim']('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x194c2f(0x2b9)](a32_0x108e3e[_0x194c2f(0x2a1)](_0x194c2f(0x3f4))),0x1;const _0x41c2f2=_0x1f6420[_0x194c2f(0x3c3)]||a32_0x2a2036[_0x194c2f(0x3bc)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x228f6c)+'.yml');_0x1f6420['verbose']&&(console['error'](_0x194c2f(0x1f9)+_0x1f6420[_0x194c2f(0x3b7)]),console[_0x194c2f(0x2b9)](_0x194c2f(0x1f4)+_0x228f6c),console[_0x194c2f(0x2b9)](_0x194c2f(0x24c)+_0x41c2f2));const _0x38cf54=await withSpinner(_0x194c2f(0x280)+_0x228f6c+_0x194c2f(0x3b6),()=>_0x50ee0e[_0x194c2f(0x213)]['pullParentYaml'](_0x228f6c),{'verbose':_0x1f6420[_0x194c2f(0x399)]}),_0x455723=_0x38cf54[_0x194c2f(0x207)];if(existsSync(_0x41c2f2)){const _0xdd8e92=readFileSync(_0x41c2f2,_0x194c2f(0x257)),_0x444d92=generateDiff(_0xdd8e92,_0x455723);if(!hasChanges(_0x444d92))console[_0x194c2f(0x2b9)](a32_0x108e3e[_0x194c2f(0x3a8)]('✔')+_0x194c2f(0x28a)+a32_0x108e3e[_0x194c2f(0x2a1)](_0x41c2f2)+_0x194c2f(0x32c));else{console[_0x194c2f(0x2b9)]('\x0aChanges\x20to\x20\x27'+_0x41c2f2+'\x27:'),console[_0x194c2f(0x2b9)]('─'['repeat'](0x3c)),console[_0x194c2f(0x2b9)](formatDiffWithColors(_0x444d92)),console[_0x194c2f(0x2b9)]('─'[_0x194c2f(0x3c8)](0x3c));if(!_0x1f6420['yes']){if(!isInteractive())return console[_0x194c2f(0x2b9)](a32_0x108e3e[_0x194c2f(0x246)](_0x194c2f(0x2b5)),_0x194c2f(0x3d4)),console[_0x194c2f(0x2b9)](a32_0x108e3e[_0x194c2f(0x232)](_0x194c2f(0x2e0))),0x1;const _0x124337=await confirmKey(_0x194c2f(0x2e2)+_0x41c2f2+'\x27?');if(!_0x124337)return console[_0x194c2f(0x2b9)](a32_0x108e3e['yellow'](_0x194c2f(0x3ee))),0x1;}writeFileSync(_0x41c2f2,_0x455723,'utf-8'),console[_0x194c2f(0x2b9)](a32_0x108e3e[_0x194c2f(0x3a8)]('✔')+_0x194c2f(0x2c8)+a32_0x108e3e[_0x194c2f(0x2a1)](_0x41c2f2));}}else{const _0x4bc48f=a32_0x2a2036[_0x194c2f(0x3ec)](_0x41c2f2);!existsSync(_0x4bc48f)&&mkdirSync(_0x4bc48f,{'recursive':!![]}),writeFileSync(_0x41c2f2,_0x455723,_0x194c2f(0x257)),console[_0x194c2f(0x2b9)](a32_0x108e3e['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a32_0x108e3e[_0x194c2f(0x2a1)](_0x41c2f2));}return saveSessionContext({'parent_segment':_0x228f6c},_0x1f6420[_0x194c2f(0x25e)]),console['error'](a32_0x108e3e[_0x194c2f(0x3a8)]('✔')+_0x194c2f(0x215)+a32_0x108e3e[_0x194c2f(0x232)]('parent_segment')+'\x20=\x20'+a32_0x108e3e[_0x194c2f(0x2a1)](_0x228f6c)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x350);[a32_0x15c085(0x312)]=a32_0x15c085(0x3fb);async[a32_0x15c085(0x26a)](_0xfee252){const _0x1208e6=a32_0x15c085,{options:_0x496d8f,args:_0x22264d,tdx:_0x5f23e7}=_0xfee252,_0x49dfe5=_0x496d8f,_0x51a950=_0x22264d[0x0]||_0x496d8f[_0x1208e6(0x2d0)];if(!_0x51a950)return showParentSegmentNotSetError(_0x1208e6(0x3b9)+_0x1208e6(0x242)),0x1;const _0x5f54d3=resolveYamlFile(_0x51a950);if(!existsSync(_0x5f54d3))return showFileNotFoundError(_0x5f54d3,_0x51a950),0x1;_0x49dfe5[_0x1208e6(0x399)]&&(console['error']('Site:\x20'+_0x49dfe5[_0x1208e6(0x3b7)]),console[_0x1208e6(0x2b9)]('YAML\x20file:\x20'+_0x5f54d3));let _0x558ff9;try{_0x558ff9=readFileSync(_0x5f54d3,_0x1208e6(0x257));}catch(_0x4ece15){const _0x31e3d1=_0x4ece15 instanceof Error?_0x4ece15[_0x1208e6(0x2bc)]:String(_0x4ece15);return console['error'](_0x1208e6(0x335)+_0x31e3d1),0x1;}const _0x3df462=await withSpinner(_0x1208e6(0x1e1),()=>_0x5f23e7['segment'][_0x1208e6(0x20b)](_0x558ff9),{'verbose':_0x49dfe5[_0x1208e6(0x399)]}),_0x3ffc55=_0x3df462[_0x1208e6(0x207)],{isNew:_0x4703c5,name:_0x294eaf,hasChanges:_0xb116f6,diffFormatted:_0x55e2ff}=_0x3ffc55;if(!_0xb116f6)return console['error'](_0x1208e6(0x3a7)+_0x294eaf+_0x1208e6(0x32b)),0x0;_0x4703c5?console['error'](_0x1208e6(0x32f)+_0x294eaf+'\x27:'):console[_0x1208e6(0x2b9)](_0x1208e6(0x24e)+_0x294eaf+'\x27:');console['error']('─'[_0x1208e6(0x3c8)](0x3c)),console['error'](_0x55e2ff),console[_0x1208e6(0x2b9)]('─'[_0x1208e6(0x3c8)](0x3c));const _0x23e280=_0x4703c5?_0x1208e6(0x1f6)+_0x294eaf+'\x27?':_0x1208e6(0x310)+_0x294eaf+'\x27?';if(!_0x49dfe5[_0x1208e6(0x303)]){if(!isInteractive())return console[_0x1208e6(0x2b9)](a32_0x108e3e[_0x1208e6(0x246)](_0x1208e6(0x2b5)),_0x1208e6(0x3d4)),console[_0x1208e6(0x2b9)](a32_0x108e3e[_0x1208e6(0x232)](_0x1208e6(0x2e0))),0x1;const _0x357ac1=await confirmKey(_0x23e280);if(!_0x357ac1)return console[_0x1208e6(0x2b9)](a32_0x108e3e[_0x1208e6(0x1e6)](_0x1208e6(0x3ee))),0x1;}const _0x95ce21=_0x4703c5?_0x1208e6(0x2b4):_0x1208e6(0x30c),_0x26d21f=await withSpinner(_0x95ce21+'\x20parent\x20segment\x20\x27'+_0x294eaf+_0x1208e6(0x3b6),()=>_0x3ffc55['apply'](),{'verbose':_0x49dfe5['verbose']}),_0x5d3467=_0x26d21f[_0x1208e6(0x207)],_0xfb882c=getConsoleNextUrl(_0x49dfe5[_0x1208e6(0x3b7)],_0x1208e6(0x3f1)+_0x5d3467['id']),_0x330eeb=_0x4703c5?_0x1208e6(0x2b7):_0x1208e6(0x384);return console[_0x1208e6(0x2b9)]('✔\x20'+_0x330eeb+_0x1208e6(0x2dc)+_0x5d3467[_0x1208e6(0x238)]+'\x27'),console[_0x1208e6(0x2b9)]('\x20\x20'+_0xfb882c),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x1de);[a32_0x15c085(0x312)]='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a32_0x15c085(0x26a)](_0x4a6ac5){const _0x48b78f=a32_0x15c085,{options:_0x383584,args:_0x98894c,tdx:_0x48c78e}=_0x4a6ac5,_0x1c6cdd=_0x383584,_0x241824=_0x98894c[0x0]||_0x383584['parentSegment'];if(!_0x241824)return showParentSegmentNotSetError(_0x48b78f(0x327)+_0x48b78f(0x1f5)+_0x48b78f(0x1f1)+_0x48b78f(0x2c3)+_0x48b78f(0x2e5)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x1fddef=resolveYamlFile(_0x241824);if(!existsSync(_0x1fddef))return showFileNotFoundError(_0x1fddef,_0x241824),0x1;_0x1c6cdd[_0x48b78f(0x399)]&&(console[_0x48b78f(0x2b9)](_0x48b78f(0x1f9)+_0x1c6cdd[_0x48b78f(0x3b7)]),console[_0x48b78f(0x2b9)](_0x48b78f(0x396)+_0x1fddef));let _0x238f1f;try{_0x238f1f=readFileSync(_0x1fddef,_0x48b78f(0x257));}catch(_0x251def){const _0x58acd3=_0x251def instanceof Error?_0x251def[_0x48b78f(0x2bc)]:String(_0x251def);return console[_0x48b78f(0x2b9)](_0x48b78f(0x335)+_0x58acd3),0x1;}const _0x148361=createCommandSpinner(a32_0x108e3e[_0x48b78f(0x232)]('Validating\x20configuration...'),{'verbose':_0x1c6cdd[_0x48b78f(0x399)]});_0x148361[_0x48b78f(0x203)]();const _0x123e0c={'onProgress':_0x5537e4=>{const _0x2d7b0a=_0x48b78f;_0x148361[_0x2d7b0a(0x3ae)]=formatProgressMessage(_0x5537e4);}};if(_0x1c6cdd['master'])_0x123e0c['master']=!![];if(_0x1c6cdd[_0x48b78f(0x2cf)])_0x123e0c['enriched']=!![];_0x1c6cdd[_0x48b78f(0x265)]&&(_0x123e0c[_0x48b78f(0x265)]=_0x1c6cdd[_0x48b78f(0x265)]);_0x1c6cdd[_0x48b78f(0x3ef)]&&(_0x123e0c[_0x48b78f(0x3ef)]=_0x1c6cdd[_0x48b78f(0x3ef)]);if(_0x1c6cdd[_0x48b78f(0x338)])_0x123e0c[_0x48b78f(0x338)]=_0x1c6cdd[_0x48b78f(0x338)];let _0x9eebf;try{_0x9eebf=await _0x48c78e[_0x48b78f(0x213)][_0x48b78f(0x2a0)](_0x238f1f,_0x123e0c),_0x148361[_0x48b78f(0x202)]();}catch(_0x4b5a5c){_0x148361[_0x48b78f(0x202)]();throw _0x4b5a5c;}const _0x56fc9c=_0x1c6cdd['interval']||_0x48b78f(0x2a4);return this[_0x48b78f(0x26b)](_0x9eebf,_0x123e0c,_0x1fddef,_0x56fc9c),_0x9eebf[_0x48b78f(0x31e)]?0x0:0x1;}[a32_0x15c085(0x26b)](_0x25d3ea,_0x30a1a8,_0x5bf71f,_0x54bc34){const _0x1bfcbb=a32_0x15c085;console[_0x1bfcbb(0x2b9)]('\x0a'+a32_0x108e3e[_0x1bfcbb(0x1dd)](_0x1bfcbb(0x3d7))+'\x20'+_0x25d3ea[_0x1bfcbb(0x238)]),console['error']('═'[_0x1bfcbb(0x3c8)](0x3c)),this[_0x1bfcbb(0x339)](_0x25d3ea);if(typeof _0x30a1a8[_0x1bfcbb(0x265)]===_0x1bfcbb(0x300)){this[_0x1bfcbb(0x3f8)](_0x25d3ea),this[_0x1bfcbb(0x2f0)](_0x25d3ea),this[_0x1bfcbb(0x336)](_0x5bf71f,_0x54bc34,'attribute',_0x30a1a8[_0x1bfcbb(0x265)]);return;}if(_0x30a1a8[_0x1bfcbb(0x265)]===!![]){this[_0x1bfcbb(0x3f8)](_0x25d3ea),this['displaySummary'](_0x25d3ea),this[_0x1bfcbb(0x336)](_0x5bf71f,_0x54bc34,_0x1bfcbb(0x293));return;}if(typeof _0x30a1a8[_0x1bfcbb(0x3ef)]==='string'){this[_0x1bfcbb(0x2c0)](_0x25d3ea,_0x54bc34),this['displaySummary'](_0x25d3ea),this['displayPreviewHints'](_0x5bf71f,_0x54bc34,_0x1bfcbb(0x3ef),_0x30a1a8['behavior']);return;}if(_0x30a1a8[_0x1bfcbb(0x3ef)]===!![]){this[_0x1bfcbb(0x2c0)](_0x25d3ea,_0x54bc34),this['displaySummary'](_0x25d3ea),this['displayPreviewHints'](_0x5bf71f,_0x54bc34,'behaviors');return;}this[_0x1bfcbb(0x3f8)](_0x25d3ea),this[_0x1bfcbb(0x2c0)](_0x25d3ea,_0x54bc34),this[_0x1bfcbb(0x28b)](_0x25d3ea),this[_0x1bfcbb(0x2f0)](_0x25d3ea),this[_0x1bfcbb(0x336)](_0x5bf71f,_0x54bc34,_0x1bfcbb(0x3df));}[a32_0x15c085(0x28b)](_0x38d3d5){displayRealtimeValidation(_0x38d3d5);}[a32_0x15c085(0x336)](_0x55beed,_0x147ff9,_0x10d3f1,_0x291445){const _0x4c79e6=a32_0x15c085;console['error']('\x0a'+a32_0x108e3e[_0x4c79e6(0x232)](_0x4c79e6(0x34b)));const _0x541141=_0x147ff9!==_0x4c79e6(0x2a4)?'\x20--interval\x20'+_0x147ff9:'';if(_0x10d3f1===_0x4c79e6(0x265)&&_0x291445)console[_0x4c79e6(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x4c79e6(0x232)](_0x4c79e6(0x1f3)+_0x55beed+_0x4c79e6(0x1e4)+_0x291445+'\x22'+_0x541141));else{if(_0x10d3f1===_0x4c79e6(0x3ef)&&_0x291445)console[_0x4c79e6(0x2b9)]('\x20\x20'+a32_0x108e3e['dim'](_0x4c79e6(0x1f3)+_0x55beed+_0x4c79e6(0x35d)+_0x291445+'\x22'+_0x541141));else(_0x10d3f1===_0x4c79e6(0x293)||_0x10d3f1===_0x4c79e6(0x3df))&&console['error']('\x20\x20'+a32_0x108e3e[_0x4c79e6(0x232)](_0x4c79e6(0x1f3)+_0x55beed+_0x4c79e6(0x36b)+_0x541141));}(_0x10d3f1===_0x4c79e6(0x211)||_0x10d3f1===_0x4c79e6(0x3df))&&console[_0x4c79e6(0x2b9)]('\x20\x20'+a32_0x108e3e['dim'](_0x4c79e6(0x1f3)+_0x55beed+_0x4c79e6(0x3ff)+_0x541141)),_0x10d3f1===_0x4c79e6(0x3df)&&console[_0x4c79e6(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x4c79e6(0x232)]('tdx\x20ps\x20preview\x20'+_0x55beed+_0x4c79e6(0x3d2)+_0x541141));}['displayMasterInfo'](_0x37cd4e){const _0x19cecd=a32_0x15c085,{master:_0x50dfcc}=_0x37cd4e,_0xb58424=_0x50dfcc[_0x19cecd(0x291)]?a32_0x108e3e[_0x19cecd(0x3a8)]('✔'):a32_0x108e3e[_0x19cecd(0x246)]('✘');console[_0x19cecd(0x2b9)]('\x0a'+a32_0x108e3e[_0x19cecd(0x232)](_0x19cecd(0x1ef))),console[_0x19cecd(0x2b9)](_0xb58424+'\x20'+a32_0x108e3e[_0x19cecd(0x1dd)](_0x50dfcc[_0x19cecd(0x316)]+'.'+_0x50dfcc[_0x19cecd(0x352)])),_0x50dfcc[_0x19cecd(0x291)]?_0x50dfcc[_0x19cecd(0x348)]!==undefined&&console[_0x19cecd(0x2b9)]('\x20\x20'+a32_0x108e3e['dim']('Rows:')+'\x20'+a32_0x108e3e[_0x19cecd(0x2a1)](formatRows(_0x50dfcc[_0x19cecd(0x348)]))):console[_0x19cecd(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x19cecd(0x246)]('Error:')+'\x20'+_0x50dfcc['schemaError']);}['displayAttributesStats'](_0x2328db){const _0x24e537=a32_0x15c085;if(_0x2328db[_0x24e537(0x293)][_0x24e537(0x2f7)]===0x0)return;console[_0x24e537(0x2b9)]('\x0a'+a32_0x108e3e[_0x24e537(0x232)](_0x24e537(0x204)));for(const _0x37c7dc of _0x2328db[_0x24e537(0x293)]){const _0x3efb13=_0x37c7dc['schemaValid']?a32_0x108e3e['green']('✔'):a32_0x108e3e['red']('✘');let _0xa062c2='';if(_0x37c7dc[_0x24e537(0x291)]&&_0x37c7dc['matchedCount']!==undefined&&_0x37c7dc[_0x24e537(0x201)]!==undefined){const _0x4d3e78=_0x37c7dc['coveragePercent']['toFixed'](0x1),_0x3fce11=_0x37c7dc[_0x24e537(0x201)]>=0x50?a32_0x108e3e[_0x24e537(0x3a8)]:_0x37c7dc[_0x24e537(0x201)]>=0x32?a32_0x108e3e[_0x24e537(0x1e6)]:a32_0x108e3e[_0x24e537(0x246)];_0xa062c2='\x20'+a32_0x108e3e['dim'](_0x24e537(0x283))+'\x20'+_0x3fce11(_0x4d3e78+'%')+'\x20('+formatRows(_0x37c7dc['matchedCount'])+_0x24e537(0x2c6);}console[_0x24e537(0x2b9)](_0x3efb13+'\x20'+a32_0x108e3e[_0x24e537(0x1dd)](_0x37c7dc['name'])+_0xa062c2),console[_0x24e537(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x24e537(0x232)](_0x24e537(0x2c4))+'\x20'+a32_0x108e3e[_0x24e537(0x1dd)](_0x37c7dc[_0x24e537(0x316)]+'.'+_0x37c7dc[_0x24e537(0x352)]));const _0x5d9c3a=_0x37c7dc[_0x24e537(0x1ed)]===_0x37c7dc[_0x24e537(0x276)]?a32_0x108e3e[_0x24e537(0x232)]('Join\x20on:')+'\x20'+_0x37c7dc['joinKey']:a32_0x108e3e[_0x24e537(0x232)](_0x24e537(0x1e7))+'\x20'+_0x37c7dc[_0x24e537(0x1ed)]+'\x20=\x20'+_0x37c7dc[_0x24e537(0x276)];console[_0x24e537(0x2b9)]('\x20\x20'+_0x5d9c3a),console['error']('\x20\x20'+a32_0x108e3e['dim'](_0x24e537(0x372))),this[_0x24e537(0x251)](_0x37c7dc[_0x24e537(0x252)]),!_0x37c7dc[_0x24e537(0x291)]&&console[_0x24e537(0x2b9)]('\x20\x20'+a32_0x108e3e['red']('Error:')+'\x20'+_0x37c7dc[_0x24e537(0x217)]);}}[a32_0x15c085(0x2c0)](_0x27f604,_0xc929a6){const _0x29cc24=a32_0x15c085;if(_0x27f604[_0x29cc24(0x211)][_0x29cc24(0x2f7)]===0x0)return;console['error']('\x0a'+a32_0x108e3e[_0x29cc24(0x232)]('Behaviors')+'\x20'+a32_0x108e3e[_0x29cc24(0x232)]('('+_0xc929a6+')'));for(const _0x2e750f of _0x27f604[_0x29cc24(0x211)]){const _0x3e3152=_0x2e750f[_0x29cc24(0x291)]?a32_0x108e3e[_0x29cc24(0x3a8)]('✔'):a32_0x108e3e[_0x29cc24(0x246)]('✘');let _0x2b0ec3='';if(_0x2e750f['schemaValid']&&_0x2e750f[_0x29cc24(0x3a5)]!==undefined&&_0x2e750f['totalEvents']!==undefined){const _0x48e6df=_0x2e750f[_0x29cc24(0x298)]?.['toFixed'](0x1)||'?',_0x4ba15a=(_0x2e750f['customerPercent']??0x0)>=0x32?a32_0x108e3e[_0x29cc24(0x3a8)]:(_0x2e750f[_0x29cc24(0x298)]??0x0)>=0x14?a32_0x108e3e[_0x29cc24(0x1e6)]:a32_0x108e3e[_0x29cc24(0x246)];_0x2b0ec3='\x20'+a32_0x108e3e[_0x29cc24(0x232)](_0x29cc24(0x3f3))+'\x20'+_0x4ba15a(formatRows(_0x2e750f['customersWithEvents']))+'\x20('+_0x48e6df+'%)\x20'+a32_0x108e3e['dim'](_0x29cc24(0x1e5))+'\x20'+a32_0x108e3e[_0x29cc24(0x2a1)](formatRows(_0x2e750f[_0x29cc24(0x244)]));}console[_0x29cc24(0x2b9)](_0x3e3152+'\x20'+a32_0x108e3e[_0x29cc24(0x1dd)](_0x2e750f['name'])+_0x2b0ec3),console[_0x29cc24(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x29cc24(0x232)](_0x29cc24(0x2c4))+'\x20'+a32_0x108e3e[_0x29cc24(0x1dd)](_0x2e750f[_0x29cc24(0x316)]+'.'+_0x2e750f[_0x29cc24(0x352)]));const _0x5513b0=_0x2e750f[_0x29cc24(0x1ed)]===_0x2e750f[_0x29cc24(0x276)]?a32_0x108e3e[_0x29cc24(0x232)](_0x29cc24(0x210))+'\x20'+_0x2e750f[_0x29cc24(0x1ed)]:a32_0x108e3e[_0x29cc24(0x232)](_0x29cc24(0x1e7))+'\x20'+_0x2e750f['joinKey']+_0x29cc24(0x2dd)+_0x2e750f[_0x29cc24(0x276)];console[_0x29cc24(0x2b9)]('\x20\x20'+_0x5513b0),console[_0x29cc24(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x29cc24(0x232)](_0x29cc24(0x372))),this['displayColumns'](_0x2e750f[_0x29cc24(0x252)]),!_0x2e750f[_0x29cc24(0x291)]&&console[_0x29cc24(0x2b9)]('\x20\x20'+a32_0x108e3e['red'](_0x29cc24(0x321))+'\x20'+_0x2e750f[_0x29cc24(0x217)]);}}[a32_0x15c085(0x251)](_0x5c732f){const _0x300a82=a32_0x15c085;for(const _0x3a051c of _0x5c732f){_0x3a051c[_0x300a82(0x1fa)]===_0x3a051c[_0x300a82(0x294)]||_0x3a051c[_0x300a82(0x294)]==='*'?console['error'](_0x300a82(0x2ea)+_0x3a051c[_0x300a82(0x1fa)]):console[_0x300a82(0x2b9)](_0x300a82(0x2ea)+_0x3a051c['label']+'\x20'+a32_0x108e3e[_0x300a82(0x232)]('('+_0x3a051c[_0x300a82(0x294)]+')'));}}['displaySummary'](_0xfbd124){const _0x4795b1=a32_0x15c085;console[_0x4795b1(0x2b9)]('─'['repeat'](0x3c));if(_0xfbd124[_0x4795b1(0x228)]['length']>0x0){console['error']('\x0a'+a32_0x108e3e[_0x4795b1(0x246)](_0x4795b1(0x33c)));for(const _0x35769e of _0xfbd124[_0x4795b1(0x228)]){console[_0x4795b1(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x4795b1(0x246)]('•')+'\x20'+_0x35769e);}}_0xfbd124['allValid']&&console[_0x4795b1(0x2b9)]('\x0a'+a32_0x108e3e['green']('✔')+_0x4795b1(0x2d8));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x245);[a32_0x15c085(0x312)]=a32_0x15c085(0x39f);async[a32_0x15c085(0x26a)](_0x41a4ed){const _0x1d6a4=a32_0x15c085,{options:_0x513199,args:_0x5ac210,tdx:_0x2f2adc}=_0x41a4ed,_0x1b2a99=_0x513199,_0x37e8e4=_0x5ac210[0x0]||_0x513199['parentSegment'];if(!_0x37e8e4)return showParentSegmentNotSetError(_0x1d6a4(0x253)+_0x1d6a4(0x21a)+_0x1d6a4(0x2db)+_0x1d6a4(0x370)+_0x1d6a4(0x36e)+_0x1d6a4(0x2f9)+_0x1d6a4(0x25c)+_0x1d6a4(0x35c)),0x1;if(!_0x1b2a99['master']&&!_0x1b2a99[_0x1d6a4(0x265)]&&!_0x1b2a99[_0x1d6a4(0x3ef)]&&!_0x1b2a99[_0x1d6a4(0x2cf)])return console[_0x1d6a4(0x2b9)](a32_0x108e3e[_0x1d6a4(0x246)](_0x1d6a4(0x1ec))),console['error'](_0x1d6a4(0x332)),console[_0x1d6a4(0x2b9)](_0x1d6a4(0x269)),console[_0x1d6a4(0x2b9)]('\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data'),console[_0x1d6a4(0x2b9)]('\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute'),console[_0x1d6a4(0x2b9)](_0x1d6a4(0x30f)),console[_0x1d6a4(0x2b9)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x24b464=resolveYamlFile(_0x37e8e4);if(!existsSync(_0x24b464))return showFileNotFoundError(_0x24b464,_0x37e8e4),0x1;_0x1b2a99[_0x1d6a4(0x399)]&&(console['error'](_0x1d6a4(0x1f9)+_0x1b2a99[_0x1d6a4(0x3b7)]),console[_0x1d6a4(0x2b9)](_0x1d6a4(0x396)+_0x24b464));let _0x23619e;try{_0x23619e=readFileSync(_0x24b464,_0x1d6a4(0x257));}catch(_0x1f9c5a){const _0x251d01=_0x1f9c5a instanceof Error?_0x1f9c5a['message']:String(_0x1f9c5a);return console[_0x1d6a4(0x2b9)](_0x1d6a4(0x335)+_0x251d01),0x1;}let _0x37cc2e;try{_0x37cc2e=parseDef(_0x23619e);}catch(_0x589a35){const _0x1ac432=_0x589a35 instanceof Error?_0x589a35[_0x1d6a4(0x2bc)]:String(_0x589a35);return console[_0x1d6a4(0x2b9)](a32_0x108e3e[_0x1d6a4(0x246)](_0x1d6a4(0x299)+_0x1ac432)),0x1;}if(_0x1b2a99[_0x1d6a4(0x265)]===!![]||_0x1b2a99[_0x1d6a4(0x265)]===''){const _0x20cdb7=_0x37cc2e[_0x1d6a4(0x293)]?.['map'](_0x58ab78=>_0x58ab78[_0x1d6a4(0x238)])||[];if(_0x20cdb7[_0x1d6a4(0x2f7)]===0x0)console[_0x1d6a4(0x2b9)](a32_0x108e3e['red'](_0x1d6a4(0x3cb)));else{console[_0x1d6a4(0x2b9)](a32_0x108e3e[_0x1d6a4(0x246)](_0x1d6a4(0x258))),console[_0x1d6a4(0x2b9)](_0x1d6a4(0x323));for(const _0x516fc1 of _0x20cdb7){console[_0x1d6a4(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x1d6a4(0x2a1)](_0x516fc1));}console[_0x1d6a4(0x2b9)](_0x1d6a4(0x1dc)+_0x37e8e4+_0x1d6a4(0x1e4)+_0x20cdb7[0x0]+'\x22');}return 0x1;}if(_0x1b2a99[_0x1d6a4(0x3ef)]===!![]||_0x1b2a99[_0x1d6a4(0x3ef)]===''){const _0x5ef32a=_0x37cc2e['behaviors']?.[_0x1d6a4(0x2ad)](_0x3eaf73=>_0x3eaf73[_0x1d6a4(0x238)])||[];if(_0x5ef32a[_0x1d6a4(0x2f7)]===0x0)console['error'](a32_0x108e3e[_0x1d6a4(0x246)]('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0x1d6a4(0x2b9)](a32_0x108e3e['red'](_0x1d6a4(0x295))),console[_0x1d6a4(0x2b9)]('Available\x20behaviors:');for(const _0x58673c of _0x5ef32a){console[_0x1d6a4(0x2b9)]('\x20\x20'+a32_0x108e3e['cyan'](_0x58673c));}console[_0x1d6a4(0x2b9)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x37e8e4+_0x1d6a4(0x35d)+_0x5ef32a[0x0]+'\x22');}return 0x1;}const _0x621876=createCommandSpinner(a32_0x108e3e[_0x1d6a4(0x232)](_0x1d6a4(0x32a)),{'verbose':_0x1b2a99[_0x1d6a4(0x399)]});_0x621876[_0x1d6a4(0x203)]();const _0x4acb1f={'onProgress':_0x5559b1=>{_0x621876['text']=formatProgressMessage(_0x5559b1);}};if(_0x1b2a99[_0x1d6a4(0x3f7)])_0x4acb1f[_0x1d6a4(0x3f7)]=!![];if(_0x1b2a99[_0x1d6a4(0x265)]&&typeof _0x1b2a99[_0x1d6a4(0x265)]===_0x1d6a4(0x300))_0x4acb1f[_0x1d6a4(0x265)]=_0x1b2a99[_0x1d6a4(0x265)];if(_0x1b2a99[_0x1d6a4(0x3ef)]&&typeof _0x1b2a99[_0x1d6a4(0x3ef)]===_0x1d6a4(0x300))_0x4acb1f['behavior']=_0x1b2a99['behavior'];if(_0x1b2a99['enriched'])_0x4acb1f[_0x1d6a4(0x2cf)]=!![];if(_0x1b2a99[_0x1d6a4(0x338)])_0x4acb1f[_0x1d6a4(0x338)]=_0x1b2a99[_0x1d6a4(0x338)];let _0x150ea1;try{_0x150ea1=await _0x2f2adc[_0x1d6a4(0x213)][_0x1d6a4(0x3a9)](_0x23619e,_0x4acb1f),_0x621876[_0x1d6a4(0x202)]();}catch(_0x5ac83f){_0x621876[_0x1d6a4(0x202)]();throw _0x5ac83f;}return await this[_0x1d6a4(0x38c)](_0x150ea1,{'master':_0x1b2a99[_0x1d6a4(0x3f7)],'attribute':typeof _0x1b2a99[_0x1d6a4(0x265)]===_0x1d6a4(0x300)?_0x1b2a99[_0x1d6a4(0x265)]:undefined,'behavior':typeof _0x1b2a99[_0x1d6a4(0x3ef)]===_0x1d6a4(0x300)?_0x1b2a99[_0x1d6a4(0x3ef)]:undefined,'enriched':_0x1b2a99[_0x1d6a4(0x2cf)]}),_0x150ea1['allValid']?0x0:0x1;}async['displayPreviewResults'](_0x460989,_0x26264b){const _0x1d9fb4=a32_0x15c085;console[_0x1d9fb4(0x2b9)]('\x0a'+a32_0x108e3e['bold'](_0x1d9fb4(0x3de))+'\x20'+_0x460989['name']),console[_0x1d9fb4(0x2b9)]('═'[_0x1d9fb4(0x3c8)](0x3c));if(_0x26264b[_0x1d9fb4(0x3f7)]&&_0x460989['sampleData']){const _0xf67e43=a32_0x108e3e[_0x1d9fb4(0x232)](_0x1d9fb4(0x3e6))+'\x20'+a32_0x108e3e[_0x1d9fb4(0x1dd)](_0x460989['master'][_0x1d9fb4(0x316)]+'.'+_0x460989[_0x1d9fb4(0x3f7)]['table']);await this[_0x1d9fb4(0x226)](_0xf67e43,_0x460989[_0x1d9fb4(0x355)]);}else{if(_0x26264b['attribute']&&_0x460989[_0x1d9fb4(0x355)]){const _0x1d707a=a32_0x108e3e[_0x1d9fb4(0x232)](_0x1d9fb4(0x37a))+'\x20'+a32_0x108e3e[_0x1d9fb4(0x1dd)](_0x26264b['attribute']);await this[_0x1d9fb4(0x226)](_0x1d707a,_0x460989[_0x1d9fb4(0x355)]);}else{if(_0x26264b[_0x1d9fb4(0x3ef)]&&_0x460989[_0x1d9fb4(0x355)]){const _0x3ab2ae=a32_0x108e3e['dim'](_0x1d9fb4(0x25d))+'\x20'+a32_0x108e3e[_0x1d9fb4(0x1dd)](_0x26264b[_0x1d9fb4(0x3ef)]);await this[_0x1d9fb4(0x226)](_0x3ab2ae,_0x460989['sampleData']);}else{if(_0x26264b['enriched']&&_0x460989[_0x1d9fb4(0x355)]){const _0x41ecd9=a32_0x108e3e[_0x1d9fb4(0x232)](_0x1d9fb4(0x296))+'\x20'+a32_0x108e3e[_0x1d9fb4(0x1dd)]('Master\x20+\x20Attributes');await this[_0x1d9fb4(0x226)](_0x41ecd9,_0x460989[_0x1d9fb4(0x355)]);}else!_0x460989['sampleData']&&console['error'](_0x1d9fb4(0x230));}}}if(_0x460989[_0x1d9fb4(0x228)]['length']>0x0){console[_0x1d9fb4(0x2b9)]('─'[_0x1d9fb4(0x3c8)](0x3c)),console[_0x1d9fb4(0x2b9)]('\x0a'+a32_0x108e3e['red']('Errors:'));for(const _0xd684fa of _0x460989[_0x1d9fb4(0x228)]){console['error']('\x20\x20'+a32_0x108e3e[_0x1d9fb4(0x246)]('•')+'\x20'+_0xd684fa);}}}async[a32_0x15c085(0x226)](_0xd72789,_0x1f91e5){const _0x26cd93=a32_0x15c085;if(_0x1f91e5[_0x26cd93(0x2f7)]===0x0){console[_0x26cd93(0x2b9)]('\x0a'+_0xd72789),console[_0x26cd93(0x2b9)]('\x20\x20No\x20sample\x20data\x20available');return;}console[_0x26cd93(0x2b9)]('\x0a'+_0xd72789);const _0x4317e8=Object[_0x26cd93(0x33a)](_0x1f91e5[0x0])['map'](_0x4cf659=>({'name':_0x4cf659,'type':typeof _0x1f91e5[0x0][_0x4cf659]===_0x26cd93(0x2a8)?_0x26cd93(0x1fc):'varchar'})),_0x18fbc4={'queryId':_0x26cd93(0x2f2),'columns':_0x4317e8,'data':_0x1f91e5,'stats':{'state':_0x26cd93(0x351),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1f91e5[_0x26cd93(0x2f7)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x428fb4=formatAsTable(_0x18fbc4,_0x1f91e5[_0x26cd93(0x2f7)],!![]);await writeOutput(_0x428fb4,undefined,_0x26cd93(0x352));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x381);[a32_0x15c085(0x312)]=a32_0x15c085(0x3f5);async[a32_0x15c085(0x26a)](_0x4d56cd){const _0x11e626=a32_0x15c085,{options:_0x525c90,args:_0x30618a,tdx:_0xee0da0}=_0x4d56cd,_0xd8dec7=_0x525c90,_0x5c7564=_0x30618a[0x0]||_0x525c90['parentSegment'];if(!_0x5c7564)return showParentSegmentNotSetError(_0x11e626(0x309)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x371785=resolveYamlFile(_0x5c7564);if(existsSync(_0x371785)){_0xd8dec7[_0x11e626(0x399)]&&console['error'](_0x11e626(0x263)+_0x371785);let _0x657b20;try{_0x657b20=readFileSync(_0x371785,'utf-8');}catch(_0x1af552){const _0x2ec419=_0x1af552 instanceof Error?_0x1af552['message']:String(_0x1af552);return console[_0x11e626(0x2b9)](_0x11e626(0x335)+_0x2ec419),0x1;}const _0x23b9ce=await withSpinner('Analyzing\x20changes...',()=>_0xee0da0['segment'][_0x11e626(0x20b)](_0x657b20),{'verbose':_0xd8dec7[_0x11e626(0x399)]}),_0x9ed141=_0x23b9ce['data'],{isNew:_0x416f65,name:_0x2093a6,hasChanges:_0x2ab1ec,diffFormatted:_0x28617a}=_0x9ed141;if(_0x2ab1ec){_0x416f65?console[_0x11e626(0x2b9)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x2093a6+'\x27:'):console[_0x11e626(0x2b9)](_0x11e626(0x24e)+_0x2093a6+'\x27:');console[_0x11e626(0x2b9)]('─'[_0x11e626(0x3c8)](0x3c)),console[_0x11e626(0x2b9)](_0x28617a),console[_0x11e626(0x2b9)]('─'[_0x11e626(0x3c8)](0x3c));const _0x3b3f69=_0x416f65?_0x11e626(0x1f6)+_0x2093a6+_0x11e626(0x288):'Apply\x20changes\x20to\x20\x27'+_0x2093a6+_0x11e626(0x288);if(!_0xd8dec7['yes']){if(!isInteractive())return console[_0x11e626(0x2b9)](a32_0x108e3e[_0x11e626(0x246)](_0x11e626(0x2b5)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x11e626(0x2b9)](a32_0x108e3e[_0x11e626(0x232)](_0x11e626(0x2e0))),0x1;const _0x30f9eb=await confirmKey(_0x3b3f69);if(!_0x30f9eb)return console['error'](a32_0x108e3e[_0x11e626(0x1e6)](_0x11e626(0x3ee))),0x1;}const _0x4194d0=_0x416f65?_0x11e626(0x2b4):'Updating';await withSpinner(_0x4194d0+'\x20parent\x20segment\x20\x27'+_0x2093a6+_0x11e626(0x3b6),()=>_0x9ed141[_0x11e626(0x307)](),{'verbose':_0xd8dec7[_0x11e626(0x399)]});const _0x548a3e=_0x416f65?_0x11e626(0x2b7):'Updated';console[_0x11e626(0x2b9)]('✔\x20'+_0x548a3e+_0x11e626(0x2dc)+_0x2093a6+'\x27');}else console['error'](_0x11e626(0x3a7)+_0x2093a6+_0x11e626(0x24b));}const _0x297738=await withSpinner(_0x11e626(0x30d)+_0x5c7564+_0x11e626(0x3b6),()=>_0xee0da0[_0x11e626(0x213)][_0x11e626(0x218)](_0x5c7564),{'verbose':_0xd8dec7[_0x11e626(0x399)]}),_0x58e194=_0x297738[_0x11e626(0x207)],_0x4a1990=getConsoleUrl(_0xd8dec7['site'],'/app/workflows/'+_0x58e194[_0x11e626(0x286)]+_0x11e626(0x3a3)+_0x58e194[_0x11e626(0x341)]+_0x11e626(0x2e3)+_0x58e194[_0x11e626(0x2df)]);return console[_0x11e626(0x2b9)](_0x11e626(0x3ba)),console['error']('\x20\x20'+a32_0x108e3e[_0x11e626(0x232)]('Audience\x20ID:')+'\x20'+_0x58e194[_0x11e626(0x349)]),console[_0x11e626(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x11e626(0x232)](_0x11e626(0x30b))+'\x20'+_0x58e194[_0x11e626(0x254)]),console[_0x11e626(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x11e626(0x232)](_0x11e626(0x29e))+'\x20'+_0x58e194['workflowSessionId']),console['error']('\x20\x20'+a32_0x108e3e['dim'](_0x11e626(0x391))+'\x20'+_0x58e194[_0x11e626(0x2df)]),console[_0x11e626(0x2b9)]('\x20\x20'+_0x4a1990),console[_0x11e626(0x2b9)]('\x0a'+a32_0x108e3e[_0x11e626(0x232)](_0x11e626(0x1f0))+_0x11e626(0x2a3)+_0x58e194['workflowAttemptId']+_0x11e626(0x28f)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x38d);[a32_0x15c085(0x312)]=a32_0x15c085(0x39a);async[a32_0x15c085(0x26a)](_0x23dbcd){const _0x39a620=a32_0x15c085,{options:_0x443358,args:_0x23ad48,tdx:_0x48779d}=_0x23dbcd,_0x2d46af=_0x23ad48[0x0]||_0x443358[_0x39a620(0x2d0)];if(!_0x2d46af)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'+_0x39a620(0x222)),0x1;_0x443358[_0x39a620(0x399)]&&(console[_0x39a620(0x2b9)](_0x39a620(0x1f9)+_0x443358[_0x39a620(0x3b7)]),console[_0x39a620(0x2b9)](_0x39a620(0x1f4)+_0x2d46af));const _0x4f1018=await withSpinner(_0x39a620(0x34a)+_0x2d46af+_0x39a620(0x3b6),()=>_0x48779d[_0x39a620(0x213)][_0x39a620(0x3ad)](_0x2d46af),{'verbose':_0x443358[_0x39a620(0x399)]}),_0x27dbdd=_0x4f1018[_0x39a620(0x207)];console['error'](_0x39a620(0x27b)+_0x27dbdd[_0x39a620(0x2f7)]+'\x20field'+(_0x27dbdd[_0x39a620(0x2f7)]!==0x1?'s':''));if(_0x443358[_0x39a620(0x250)]||_0x443358[_0x39a620(0x1da)])return await handleSDKOutput(_0x27dbdd,_0x443358),0x0;return displayFieldsHumanReadable(_0x27dbdd,_0x2d46af),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x346);[a32_0x15c085(0x312)]=a32_0x15c085(0x318);async[a32_0x15c085(0x26a)](_0x592005){const _0x1744da=a32_0x15c085,{options:_0x3cf31b,args:_0x1fda08,tdx:_0x4311fe}=_0x592005,_0x488e7e=_0x3cf31b,_0xbaecbc=_0x1fda08[0x0]||_0x3cf31b[_0x1744da(0x2d0)];if(!_0xbaecbc)return showParentSegmentNotSetError(_0x1744da(0x208)+_0x1744da(0x3af)+_0x1744da(0x1f1)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x3cf31b['verbose']&&(console[_0x1744da(0x2b9)](_0x1744da(0x1f9)+_0x3cf31b[_0x1744da(0x3b7)]),console[_0x1744da(0x2b9)](_0x1744da(0x1f4)+_0xbaecbc));const _0x29340a=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0xbaecbc+'\x27...',()=>_0x4311fe[_0x1744da(0x213)][_0x1744da(0x2fb)](_0xbaecbc),{'verbose':_0x3cf31b['verbose']}),_0x244b4f=_0x29340a['data'];if(_0x488e7e['web']){const _0x29d559=getConsoleNextUrl(_0x488e7e['site'],_0x1744da(0x3f1)+_0x244b4f['id']);return console[_0x1744da(0x2b9)](a32_0x108e3e[_0x1744da(0x3a8)]('✔')+_0x1744da(0x224)+a32_0x108e3e[_0x1744da(0x2a1)](_0x29d559)),openBrowser(_0x29d559),0x0;}return await handleSingleObjectOutput(_0x244b4f,_0x3cf31b),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x33f);[a32_0x15c085(0x312)]=a32_0x15c085(0x2e4);async[a32_0x15c085(0x26a)](_0x5de21c){const _0x60b1b7=a32_0x15c085,{options:_0x52a077,args:_0x5deb19,tdx:_0x315e97}=_0x5de21c,_0x1abe5a=_0x52a077,_0x544bdb=_0x5deb19[0x0]||_0x52a077[_0x60b1b7(0x2d0)];if(!_0x544bdb)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'+_0x60b1b7(0x356)+'Options:\x0a'+_0x60b1b7(0x38b)),0x1;_0x52a077[_0x60b1b7(0x399)]&&(console[_0x60b1b7(0x2b9)](_0x60b1b7(0x1f9)+_0x52a077[_0x60b1b7(0x3b7)]),console[_0x60b1b7(0x2b9)](_0x60b1b7(0x1f4)+_0x544bdb));const _0x1d3766=await withSpinner(_0x60b1b7(0x2af)+_0x544bdb+_0x60b1b7(0x3b6),()=>_0x315e97[_0x60b1b7(0x213)][_0x60b1b7(0x28d)](_0x544bdb),{'verbose':_0x52a077[_0x60b1b7(0x399)]}),_0x393db4=_0x1d3766['data'],_0xed67e2=_0x315e97[_0x60b1b7(0x213)][_0x60b1b7(0x36d)](_0x393db4);if(_0x1abe5a[_0x60b1b7(0x3c3)]){const _0x1be873=await this[_0x60b1b7(0x2ec)](_0x5de21c,_0x544bdb,_0x393db4,_0xed67e2),_0x4d7a09=this[_0x60b1b7(0x36f)](_0x1be873);writeFileSync(_0x1abe5a['output'],_0x4d7a09);const _0x13abd1=_0x1be873['customers']['columns']['length']+_0x1be873[_0x60b1b7(0x211)]['reduce']((_0x302d80,_0x2159c1)=>_0x302d80+_0x2159c1[_0x60b1b7(0x252)][_0x60b1b7(0x2f7)],0x0),_0x16e896=_0x1be873['behaviors'][_0x60b1b7(0x1fb)](_0x12dd6c=>_0x12dd6c['columns']['length']===0x0)[_0x60b1b7(0x2f7)];return console['log']('Schema\x20saved\x20to\x20'+_0x1abe5a['output']),console[_0x60b1b7(0x20d)](_0x60b1b7(0x2a2)+_0xed67e2),console[_0x60b1b7(0x20d)](_0x60b1b7(0x353)+_0x1be873['behaviors'][_0x60b1b7(0x2f7)]+'\x20behaviors'),console[_0x60b1b7(0x20d)]('\x20\x20Columns:\x20'+_0x13abd1+_0x60b1b7(0x376)),_0x16e896>0x0&&console[_0x60b1b7(0x20d)](_0x60b1b7(0x2b8)+_0x16e896+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console[_0x60b1b7(0x2b9)]('\x0a'+a32_0x108e3e[_0x60b1b7(0x1dd)](_0x60b1b7(0x2e6))+'\x20'+a32_0x108e3e[_0x60b1b7(0x2a1)](_0xed67e2));const _0x239892=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x315e97[_0x60b1b7(0x213)][_0x60b1b7(0x22f)](_0x393db4),{'verbose':_0x52a077[_0x60b1b7(0x399)]});console[_0x60b1b7(0x2b9)]('\x0a'+a32_0x108e3e[_0x60b1b7(0x1dd)](_0x60b1b7(0x20a))+'\x20'+a32_0x108e3e[_0x60b1b7(0x232)]('('+_0xed67e2+_0x60b1b7(0x3cf)));const _0x32a478=await executeSchemaQuery(_0x239892['data'],_0x315e97,_0x52a077);await handleQueryOutput(_0x32a478,_0x52a077);const _0x15735e=await withSpinner(_0x60b1b7(0x3ce),()=>_0x315e97['segment']['getBehaviorNames'](_0x393db4),{'verbose':_0x52a077[_0x60b1b7(0x399)]});for(const _0x2077fa of _0x15735e['data']){const _0x352ee4=_0x60b1b7(0x2f6)+_0x2077fa[_0x60b1b7(0x32d)]()[_0x60b1b7(0x1ee)](/\s+/g,'_'),_0x4de790=_0x60b1b7(0x3b4)+_0xed67e2+'.'+_0x352ee4;console['error']('\x0a'+a32_0x108e3e['bold'](_0x2077fa)+'\x20'+a32_0x108e3e[_0x60b1b7(0x232)]('('+_0xed67e2+'.'+_0x352ee4+')'));try{const _0xd2ad4d=await executeSchemaQuery(_0x4de790,_0x315e97,_0x52a077);await handleQueryOutput(_0xd2ad4d,_0x52a077);}catch{console[_0x60b1b7(0x2b9)](a32_0x108e3e[_0x60b1b7(0x1e6)](_0x60b1b7(0x2fd)));}}return 0x0;}async[a32_0x15c085(0x2ec)](_0x540f40,_0x386b0b,_0x305a26,_0xc74a10){const _0xb9f9a0=a32_0x15c085,{options:_0x194ef5,tdx:_0x2fb422}=_0x540f40,_0x2bcbff=await withSpinner(_0xb9f9a0(0x367),()=>_0x2fb422[_0xb9f9a0(0x213)]['getParentSQL'](_0x305a26),{'verbose':_0x194ef5[_0xb9f9a0(0x399)]}),_0x50275d=await executeSchemaQuery(_0x2bcbff[_0xb9f9a0(0x207)],_0x2fb422,_0x194ef5),_0x51f725=_0x50275d[_0xb9f9a0(0x207)][_0xb9f9a0(0x2ad)](_0x24d1ef=>({'name':_0x24d1ef[_0xb9f9a0(0x2d5)],'type':_0x24d1ef[_0xb9f9a0(0x3db)]})),_0x30c850=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x2fb422[_0xb9f9a0(0x213)][_0xb9f9a0(0x247)](_0x305a26),{'verbose':_0x194ef5[_0xb9f9a0(0x399)]}),_0x12e5e4=[];for(const _0x251c0b of _0x30c850[_0xb9f9a0(0x207)]){const _0x4c7023=_0xb9f9a0(0x2f6)+_0x251c0b[_0xb9f9a0(0x32d)]()['replace'](/\s+/g,'_'),_0x5adf48=_0xb9f9a0(0x3b4)+_0xc74a10+'.'+_0x4c7023;let _0x564027=[];try{const _0x2df6b9=await executeSchemaQuery(_0x5adf48,_0x2fb422,_0x194ef5);_0x564027=_0x2df6b9['data'][_0xb9f9a0(0x2ad)](_0x5ddff2=>({'name':_0x5ddff2[_0xb9f9a0(0x2d5)],'type':_0x5ddff2[_0xb9f9a0(0x3db)]}));}catch{}_0x12e5e4['push']({'table':_0x4c7023,'columns':_0x564027});}return{'database':_0xc74a10,'parent_segment':_0x386b0b,'parent_id':_0x305a26,'customers':{'table':_0xb9f9a0(0x20a),'columns':_0x51f725},'behaviors':_0x12e5e4};}[a32_0x15c085(0x36f)](_0x22c238){const _0x8efa07=a32_0x15c085,_0x24088f=_0x5b08a6=>{const _0x5677a2=a32_0x3e24;if(_0x5b08a6[_0x5677a2(0x2f7)]===0x0)return'[]';const _0x552570=_0x5b08a6[_0x5677a2(0x2ad)](_0x6abf70=>_0x5677a2(0x313)+_0x6abf70[_0x5677a2(0x238)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x6abf70[_0x5677a2(0x3cd)]+_0x5677a2(0x1f2));return'[\x0a'+_0x552570[_0x5677a2(0x3bc)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x2f4855=_0x22c238['behaviors'][_0x8efa07(0x2ad)](_0x225f83=>{const _0x276168=_0x8efa07;return _0x276168(0x3e1)+_0x225f83[_0x276168(0x352)]+_0x276168(0x2ce)+_0x24088f(_0x225f83[_0x276168(0x252)])[_0x276168(0x1ee)](/^/gm,'\x20\x20')[_0x276168(0x2ef)]()+_0x276168(0x26c);})[_0x8efa07(0x3bc)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x22c238[_0x8efa07(0x316)]+_0x8efa07(0x2ae)+_0x22c238['parent_segment']+_0x8efa07(0x2e9)+_0x22c238['parent_id']+_0x8efa07(0x37b)+_0x22c238['customers'][_0x8efa07(0x352)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x24088f(_0x22c238[_0x8efa07(0x20a)][_0x8efa07(0x252)])['replace'](/^/gm,'\x20\x20')[_0x8efa07(0x2ef)]()+_0x8efa07(0x34c)+_0x2f4855+_0x8efa07(0x275);}}export class ParentSegmentSQLCommand extends BaseCommand{[a32_0x15c085(0x238)]='segment:parent:sql';['description']=a32_0x15c085(0x3eb);async[a32_0x15c085(0x26a)](_0x1c4638){const _0x44aca2=a32_0x15c085,{options:_0x174776,args:_0x260628,tdx:_0x253b9f}=_0x1c4638,_0x171e96=_0x260628[0x0]||_0x174776[_0x44aca2(0x2d0)];if(!_0x171e96)return showParentSegmentNotSetError(_0x44aca2(0x2e1)+_0x44aca2(0x20f)),0x1;_0x174776[_0x44aca2(0x399)]&&(console[_0x44aca2(0x2b9)](_0x44aca2(0x1f9)+_0x174776['site']),console['error'](_0x44aca2(0x1f4)+_0x171e96));const _0x269dd9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x171e96+_0x44aca2(0x3b6),()=>_0x253b9f[_0x44aca2(0x213)][_0x44aca2(0x28d)](_0x171e96),{'verbose':_0x174776[_0x44aca2(0x399)]}),_0x516e5a=_0x269dd9[_0x44aca2(0x207)],_0x597014=await withSpinner(_0x44aca2(0x2c1)+_0x171e96+_0x44aca2(0x3b6),()=>_0x253b9f[_0x44aca2(0x213)][_0x44aca2(0x22f)](_0x516e5a),{'verbose':_0x174776[_0x44aca2(0x399)]}),_0x7ee09=_0x597014[_0x44aca2(0x207)];return _0x174776[_0x44aca2(0x3fc)]==='json'||_0x174776[_0x44aca2(0x3fc)]==='jsonl'?await handleSDKOutput([{'sql':_0x7ee09}],_0x174776):console[_0x44aca2(0x20d)](_0x7ee09),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x2ca);['description']=a32_0x15c085(0x320);async[a32_0x15c085(0x26a)](_0x4b1326){const _0x1a17a8=a32_0x15c085,{options:_0x2151da,args:_0x14e135,tdx:_0x35bcef}=_0x4b1326,_0x2d7727=_0x14e135[0x0]||_0x2151da[_0x1a17a8(0x2d0)];if(!_0x2d7727)return showParentSegmentNotSetError(_0x1a17a8(0x37f)+_0x1a17a8(0x2b0)),0x1;_0x2151da['verbose']&&(console[_0x1a17a8(0x2b9)]('Site:\x20'+_0x2151da[_0x1a17a8(0x3b7)]),console[_0x1a17a8(0x2b9)](_0x1a17a8(0x1f4)+_0x2d7727));const _0x470441=await withSpinner(_0x1a17a8(0x2af)+_0x2d7727+'\x27...',()=>_0x35bcef[_0x1a17a8(0x213)]['resolveParentId'](_0x2d7727),{'verbose':_0x2151da['verbose']}),_0x25b85c=_0x470441[_0x1a17a8(0x207)],_0x2e36ef=await withSpinner(_0x1a17a8(0x2c1)+_0x2d7727+_0x1a17a8(0x3b6),()=>_0x35bcef['segment'][_0x1a17a8(0x22f)](_0x25b85c),{'verbose':_0x2151da[_0x1a17a8(0x399)]});let _0x4dd066=_0x2e36ef[_0x1a17a8(0x207)];const _0x3fca40=resolveLimit(_0x2151da[_0x1a17a8(0x27a)],DEFAULT_DISPLAY_LIMIT),_0x1cbe38=/\bLIMIT\s+\d+/i[_0x1a17a8(0x229)](_0x4dd066);!_0x1cbe38&&(_0x4dd066=_0x4dd066[_0x1a17a8(0x2ef)]()[_0x1a17a8(0x1ee)](/;+$/,''),_0x4dd066=_0x1a17a8(0x234)+_0x4dd066+_0x1a17a8(0x28c)+_0x3fca40);_0x2151da[_0x1a17a8(0x399)]&&console[_0x1a17a8(0x2b9)]('SQL\x20query:\x0a'+_0x4dd066);const _0x37739e=await withProgressSpinner(_0x1a17a8(0x3f9),async _0x450673=>{const _0x309ce9=_0x1a17a8,_0x2f70f7=await _0x35bcef['query'][_0x309ce9(0x26a)](_0x4dd066,{'catalog':'td','schema':_0x309ce9(0x3f6),'onJobId':_0x1f5d51=>{const _0x5968ea=_0x309ce9;_0x450673[_0x5968ea(0x22b)](_0x1f5d51);}});return _0x2f70f7;},{'verbose':_0x2151da[_0x1a17a8(0x399)]}),_0x18632d=_0x37739e['data'],_0x80d827=_0x18632d['jobId']?_0x1a17a8(0x31c)+_0x18632d[_0x1a17a8(0x3bb)]+']':'';return console[_0x1a17a8(0x2b9)](_0x1a17a8(0x20c)+_0x18632d[_0x1a17a8(0x235)]['processedRows'][_0x1a17a8(0x200)]()+_0x1a17a8(0x371)+(_0x1a17a8(0x25b)+formatElapsed(_0x18632d['stats'][_0x1a17a8(0x3f0)])+_0x80d827)),await handleQueryOutput(_0x18632d,_0x2151da),0x0;}}export class PSRtListCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x2ed);[a32_0x15c085(0x312)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a32_0x15c085(0x26a)](_0x5a1b19){const _0x8573d=a32_0x15c085,{options:_0x109475,args:_0x4d9b01,tdx:_0x35d78b}=_0x5a1b19,_0x3fdf6c=_0x4d9b01[0x0],_0xc294f1=await withSpinner(_0x3fdf6c?_0x8573d(0x369)+_0x3fdf6c+'\x27...':'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x35d78b[_0x8573d(0x21b)][_0x8573d(0x3d0)](),{'verbose':_0x109475[_0x8573d(0x399)]});let _0x3dcb9d=_0xc294f1['data'][_0x8573d(0x1fb)](_0x24c3af=>_0x24c3af[_0x8573d(0x23e)]);if(_0x3fdf6c){const _0x2ab5d6=_0x3fdf6c[_0x8573d(0x1ee)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x8573d(0x1ee)](/\*/g,'.*')[_0x8573d(0x1ee)](/\?/g,'.'),_0x5c3a7b=new RegExp('^'+_0x2ab5d6+'$','i');_0x3dcb9d=_0x3dcb9d[_0x8573d(0x1fb)](_0x5bffbc=>_0x5c3a7b[_0x8573d(0x229)](_0x5bffbc['name']));}_0x3dcb9d[_0x8573d(0x29c)]((_0x599065,_0x4b6e1d)=>_0x599065[_0x8573d(0x238)][_0x8573d(0x239)](_0x4b6e1d[_0x8573d(0x238)])),console['error'](_0x8573d(0x27b)+_0x3dcb9d[_0x8573d(0x2f7)]+'\x20RT-enabled\x20parent\x20segment'+(_0x3dcb9d[_0x8573d(0x2f7)]!==0x1?'s':''));const _0x3ff052=_0x1161e6=>{const _0x45fd61=_0x8573d;return getConsoleNextUrl(_0x109475[_0x45fd61(0x3b7)],'/app/dw/parentSegments/'+_0x1161e6);};if(_0x109475[_0x8573d(0x3fc)]===_0x8573d(0x250)||_0x109475[_0x8573d(0x3fc)]===_0x8573d(0x1da)){const _0x5a60a7=_0x3dcb9d['map'](_0x4b6aac=>({..._0x4b6aac,'url':_0x3ff052(_0x4b6aac['id'])}));await handleSDKOutput(_0x5a60a7,_0x109475);}else{if(_0x3dcb9d[_0x8573d(0x2f7)]===0x0)console[_0x8573d(0x20d)](_0x8573d(0x3c5));else for(const _0x4f4c19 of _0x3dcb9d){const _0x8e9913=_0x4f4c19[_0x8573d(0x397)]?a32_0x108e3e[_0x8573d(0x232)]('\x20('+formatRows(_0x4f4c19[_0x8573d(0x397)])+')'):'',_0x52b9f5=hyperlink(_0x4f4c19['name'],_0x3ff052(_0x4f4c19['id']));console[_0x8573d(0x20d)]('⚡\x20'+_0x52b9f5+_0x8e9913);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x390);[a32_0x15c085(0x312)]=a32_0x15c085(0x1eb);async[a32_0x15c085(0x26a)](_0x376604){const _0x521a5e=a32_0x15c085,{options:_0xd4f1d4,args:_0x451ade,tdx:_0x4076b9}=_0x376604,_0x47ead7=_0x451ade[0x0]||_0xd4f1d4['parentSegment'];if(!_0x47ead7)return showParentSegmentNotSetError(_0x521a5e(0x1d6)+_0x521a5e(0x375)),0x1;const _0xfdf7c4=resolveYamlFile(_0x47ead7);if(!existsSync(_0xfdf7c4))return showFileNotFoundError(_0xfdf7c4,_0x47ead7),0x1;let _0x21891a;try{_0x21891a=readFileSync(_0xfdf7c4,_0x521a5e(0x257));}catch(_0x289173){const _0x46b074=_0x289173 instanceof Error?_0x289173[_0x521a5e(0x2bc)]:String(_0x289173);return console[_0x521a5e(0x2b9)](_0x521a5e(0x335)+_0x46b074),0x1;}const _0x4f7318=createCommandSpinner(a32_0x108e3e[_0x521a5e(0x232)](_0x521a5e(0x1d9)),{'verbose':_0xd4f1d4[_0x521a5e(0x399)]});_0x4f7318[_0x521a5e(0x203)]();const _0x1275b9={'realtime':!![],'onProgress':_0x460e3e=>{_0x4f7318['text']=formatProgressMessage(_0x460e3e);}};let _0x181464;try{_0x181464=await _0x4076b9['segment'][_0x521a5e(0x2a0)](_0x21891a,_0x1275b9),_0x4f7318[_0x521a5e(0x202)]();}catch(_0xa7d039){_0x4f7318[_0x521a5e(0x202)]();throw _0xa7d039;}console[_0x521a5e(0x2b9)]('\x0a'+a32_0x108e3e[_0x521a5e(0x1dd)](_0x521a5e(0x29a))+'\x20'+_0x181464['name']),console['error']('═'[_0x521a5e(0x3c8)](0x3c)),displayRealtimeValidation(_0x181464),console[_0x521a5e(0x2b9)]('─'[_0x521a5e(0x3c8)](0x3c));if(_0x181464[_0x521a5e(0x228)][_0x521a5e(0x2f7)]>0x0){console[_0x521a5e(0x2b9)]('\x0a'+a32_0x108e3e[_0x521a5e(0x246)]('Errors:'));for(const _0xd64288 of _0x181464[_0x521a5e(0x228)]){console[_0x521a5e(0x2b9)]('\x20\x20'+a32_0x108e3e[_0x521a5e(0x246)]('•')+'\x20'+_0xd64288);}}return _0x181464[_0x521a5e(0x31e)]&&console[_0x521a5e(0x2b9)]('\x0a'+a32_0x108e3e[_0x521a5e(0x3a8)]('✔')+_0x521a5e(0x373)),_0x181464[_0x521a5e(0x31e)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x2cc);[a32_0x15c085(0x312)]=a32_0x15c085(0x3ed);async[a32_0x15c085(0x26a)](_0x4e8123){const _0x213fac=a32_0x15c085,{options:_0x689e41,args:_0x1b11df,tdx:_0x112256}=_0x4e8123,_0x1fa9f1=_0x1b11df[0x0]||_0x689e41[_0x213fac(0x2d0)];if(!_0x1fa9f1)return showParentSegmentNotSetError(_0x213fac(0x3bf)+'\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;_0x689e41[_0x213fac(0x399)]&&(console['error'](_0x213fac(0x1f9)+_0x689e41[_0x213fac(0x3b7)]),console[_0x213fac(0x2b9)](_0x213fac(0x1f4)+_0x1fa9f1));const _0x207550=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x1fa9f1+_0x213fac(0x3b6),()=>_0x112256[_0x213fac(0x213)]['resolveParentId'](_0x1fa9f1),{'verbose':_0x689e41['verbose']}),_0x42fd7d=_0x207550[_0x213fac(0x207)],_0x36818c=await withSpinner(_0x213fac(0x231)+_0x1fa9f1+_0x213fac(0x3b6),()=>_0x112256[_0x213fac(0x21b)]['listJourneys'](_0x42fd7d),{'verbose':_0x689e41['verbose']}),_0x5ab3f2=_0x36818c[_0x213fac(0x207)];console[_0x213fac(0x2b9)]('✔\x20Found\x20'+_0x5ab3f2['length']+_0x213fac(0x282)+(_0x5ab3f2[_0x213fac(0x2f7)]!==0x1?'s':''));if(_0x689e41['format']===_0x213fac(0x250)||_0x689e41[_0x213fac(0x3fc)]===_0x213fac(0x1da))await handleSDKOutput(_0x5ab3f2,_0x689e41);else{if(_0x5ab3f2[_0x213fac(0x2f7)]===0x0)console[_0x213fac(0x20d)](_0x213fac(0x330));else for(const _0x1af7e6 of _0x5ab3f2){const _0x358b1c=_0x1af7e6[_0x213fac(0x29d)]===_0x213fac(0x23a)?'🚀':'📝',_0x206106=_0x1af7e6[_0x213fac(0x284)]?a32_0x108e3e[_0x213fac(0x1e6)](_0x213fac(0x2d4)):'',_0x1c9a30=a32_0x108e3e['dim']('\x20('+_0x1af7e6[_0x213fac(0x259)]+_0x213fac(0x2d6)+(_0x1af7e6[_0x213fac(0x259)]!==0x1?'s':'')+')');console[_0x213fac(0x20d)](_0x358b1c+'\x20'+_0x1af7e6[_0x213fac(0x238)]+_0x206106+_0x1c9a30);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{['name']='ps:rt:jn:pause';['description']=a32_0x15c085(0x236);async[a32_0x15c085(0x26a)](_0x2a7f39){const _0x2a54f7=a32_0x15c085,{options:_0x58cf39,args:_0x38b0d7,tdx:_0x24abe0}=_0x2a7f39,_0x2225c0=_0x38b0d7[0x0];if(!_0x2225c0)return console['error'](a32_0x108e3e[_0x2a54f7(0x246)](_0x2a54f7(0x223))),console['error'](_0x2a54f7(0x3e4)),console['error'](a32_0x108e3e[_0x2a54f7(0x232)](_0x2a54f7(0x3b5))),0x1;_0x58cf39[_0x2a54f7(0x399)]&&(console['error'](_0x2a54f7(0x1f9)+_0x58cf39['site']),console[_0x2a54f7(0x2b9)](_0x2a54f7(0x1ea)+_0x2225c0));const _0x5eca90=await withSpinner(_0x2a54f7(0x392)+_0x2225c0+_0x2a54f7(0x3b6),()=>_0x24abe0[_0x2a54f7(0x21b)][_0x2a54f7(0x377)](_0x2225c0),{'verbose':_0x58cf39[_0x2a54f7(0x399)]}),_0x215abb=_0x5eca90[_0x2a54f7(0x207)];console[_0x2a54f7(0x2b9)](_0x2a54f7(0x31d)+_0x215abb[_0x2a54f7(0x238)]+'\x27');if(_0x58cf39[_0x2a54f7(0x3fc)]===_0x2a54f7(0x250)||_0x58cf39[_0x2a54f7(0x3fc)]===_0x2a54f7(0x1da))await handleSDKOutput([_0x215abb],_0x58cf39);else{const _0xe5e6fe=_0x215abb['state']===_0x2a54f7(0x23a)?'🚀':'📝',_0x17b49a=_0x215abb['paused']?a32_0x108e3e[_0x2a54f7(0x1e6)]('\x20(paused)'):'';console[_0x2a54f7(0x20d)](_0xe5e6fe+'\x20'+_0x215abb[_0x2a54f7(0x238)]+_0x17b49a);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']='ps:rt:jn:resume';[a32_0x15c085(0x312)]=a32_0x15c085(0x281);async[a32_0x15c085(0x26a)](_0x18ffd8){const _0x4e7ce6=a32_0x15c085,{options:_0x1a5814,args:_0xbdaad6,tdx:_0xc2f191}=_0x18ffd8,_0x14df18=_0xbdaad6[0x0];if(!_0x14df18)return console['error'](a32_0x108e3e[_0x4e7ce6(0x246)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x4e7ce6(0x2b9)](_0x4e7ce6(0x225)),console[_0x4e7ce6(0x2b9)](a32_0x108e3e[_0x4e7ce6(0x232)](_0x4e7ce6(0x3b5))),0x1;_0x1a5814[_0x4e7ce6(0x399)]&&(console['error'](_0x4e7ce6(0x1f9)+_0x1a5814['site']),console['error'](_0x4e7ce6(0x1ea)+_0x14df18));const _0x1738cf=await withSpinner('Resuming\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x14df18+_0x4e7ce6(0x3b6),()=>_0xc2f191[_0x4e7ce6(0x21b)][_0x4e7ce6(0x292)](_0x14df18),{'verbose':_0x1a5814[_0x4e7ce6(0x399)]}),_0x4a948e=_0x1738cf[_0x4e7ce6(0x207)];console[_0x4e7ce6(0x2b9)](_0x4e7ce6(0x324)+_0x4a948e[_0x4e7ce6(0x238)]+'\x27');if(_0x1a5814[_0x4e7ce6(0x3fc)]===_0x4e7ce6(0x250)||_0x1a5814[_0x4e7ce6(0x3fc)]===_0x4e7ce6(0x1da))await handleSDKOutput([_0x4a948e],_0x1a5814);else{const _0x436f8c=_0x4a948e[_0x4e7ce6(0x29d)]===_0x4e7ce6(0x23a)?'🚀':'📝',_0x562c3f=_0x4a948e['paused']?a32_0x108e3e[_0x4e7ce6(0x1e6)](_0x4e7ce6(0x2d4)):'';console[_0x4e7ce6(0x20d)](_0x436f8c+'\x20'+_0x4a948e['name']+_0x562c3f);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a32_0x15c085(0x3b0);[a32_0x15c085(0x312)]=a32_0x15c085(0x2f8);async[a32_0x15c085(0x26a)](_0x5d5f04){const _0x33172f=a32_0x15c085,{options:_0x2c9d69,args:_0x3f3cec,tdx:_0x485c72}=_0x5d5f04,_0x2349d6=_0x3f3cec[0x0]||_0x2c9d69[_0x33172f(0x2d0)];if(!_0x2349d6)return showParentSegmentNotSetError('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'+_0x33172f(0x308)),0x1;_0x2c9d69[_0x33172f(0x399)]&&(console[_0x33172f(0x2b9)]('Site:\x20'+_0x2c9d69['site']),console[_0x33172f(0x2b9)](_0x33172f(0x1f4)+_0x2349d6));const _0x11da5d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2349d6+_0x33172f(0x3b6),()=>_0x485c72[_0x33172f(0x213)]['resolveParentId'](_0x2349d6),{'verbose':_0x2c9d69[_0x33172f(0x399)]}),_0x169a91=_0x11da5d['data'],_0x194d7d=await withSpinner(_0x33172f(0x277)+_0x2349d6+'\x27...',()=>_0x485c72['realtime'][_0x33172f(0x329)](_0x169a91),{'verbose':_0x2c9d69[_0x33172f(0x399)]}),_0x44226d=_0x194d7d[_0x33172f(0x207)];return console['error'](_0x33172f(0x3fd)),_0x2c9d69['format']===_0x33172f(0x250)||_0x2c9d69['format']===_0x33172f(0x1da)?await handleSDKOutput([_0x44226d],_0x2c9d69):(console[_0x33172f(0x20d)]('id:\x20'+_0x44226d['id']),console[_0x33172f(0x20d)](_0x33172f(0x38a)+_0x44226d['audienceId']),console['log'](_0x33172f(0x37d)+_0x44226d[_0x33172f(0x264)]),console[_0x33172f(0x20d)]('eventKind:\x20'+_0x44226d[_0x33172f(0x26d)]),console[_0x33172f(0x20d)](_0x33172f(0x233)+_0x44226d['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x3a1);[a32_0x15c085(0x312)]=a32_0x15c085(0x306);async[a32_0x15c085(0x26a)](_0xf21455){const _0x25db14=a32_0x15c085,{options:_0xa05e66,args:_0x24f6a1,tdx:_0x341f79}=_0xf21455,_0x155b42=_0x24f6a1[0x0]||_0xa05e66[_0x25db14(0x2d0)];if(!_0x155b42)return showParentSegmentNotSetError(_0x25db14(0x368)+_0x25db14(0x3ea)),0x1;const _0x14423d=await withSpinner(_0x25db14(0x2af)+_0x155b42+_0x25db14(0x3b6),()=>_0x341f79[_0x25db14(0x213)][_0x25db14(0x28d)](_0x155b42),{'verbose':_0xa05e66[_0x25db14(0x399)]}),_0xb3767a=_0x14423d[_0x25db14(0x207)],_0x23bb6b=await withSpinner(_0x25db14(0x3c0)+_0x155b42+_0x25db14(0x3b6),()=>_0x341f79[_0x25db14(0x237)]['list'](_0xb3767a),{'verbose':_0xa05e66[_0x25db14(0x399)]}),_0x56137b=_0x23bb6b[_0x25db14(0x207)];console[_0x25db14(0x2b9)]('✔\x20Found\x20'+_0x56137b['length']+_0x25db14(0x3e5)+(_0x56137b[_0x25db14(0x2f7)]!==0x1?'s':''));if(_0xa05e66[_0x25db14(0x3fc)]===_0x25db14(0x250)||_0xa05e66[_0x25db14(0x3fc)]===_0x25db14(0x1da))await handleSDKOutput(_0x56137b,_0xa05e66);else{if(_0x56137b[_0x25db14(0x2f7)]===0x0)console['log'](_0x25db14(0x2b1)),console[_0x25db14(0x2b9)](a32_0x108e3e[_0x25db14(0x2a1)](_0x25db14(0x1f8)));else for(const _0x3e6125 of _0x56137b){console[_0x25db14(0x20d)](a32_0x108e3e['bold'](_0x3e6125[_0x25db14(0x238)])+'\x20'+a32_0x108e3e[_0x25db14(0x232)](_0x25db14(0x262)+_0x3e6125['id']+')'));_0x3e6125['description']&&console[_0x25db14(0x20d)]('\x20\x20'+a32_0x108e3e['dim'](_0x3e6125[_0x25db14(0x312)]));if(_0x3e6125[_0x25db14(0x216)]&&_0x3e6125[_0x25db14(0x216)][_0x25db14(0x2f7)]>0x0)for(const _0x4c9d96 of _0x3e6125[_0x25db14(0x216)]){const _0x4af24c=_0x4c9d96[_0x25db14(0x29f)]?.[_0x25db14(0x2f7)]?_0x4c9d96[_0x25db14(0x29f)][_0x25db14(0x3bc)](',\x20'):_0x25db14(0x2b6);console[_0x25db14(0x20d)]('\x20\x20'+a32_0x108e3e['cyan'](_0x25db14(0x2d3))+'\x20'+_0x4c9d96[_0x25db14(0x238)]+'\x20'+a32_0x108e3e['dim'](_0x25db14(0x262)+_0x4c9d96['id']+')')),console['log'](_0x25db14(0x362)+a32_0x108e3e['dim'](_0x25db14(0x206))+'\x20'+_0x4af24c);}else console[_0x25db14(0x20d)]('\x20\x20'+a32_0x108e3e[_0x25db14(0x232)](_0x25db14(0x358)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x21e);[a32_0x15c085(0x312)]=a32_0x15c085(0x334);async['execute'](_0x562fb9){const _0x8e2f46=a32_0x15c085,{options:_0x21c433,args:_0x43dc7d,tdx:_0x386b1f}=_0x562fb9,_0x1c1f84=_0x21c433,_0x4bc7c2=_0x43dc7d[0x0],_0x4bddfc=_0x43dc7d[0x1]||_0x21c433[_0x8e2f46(0x2d0)];if(!_0x4bc7c2)return console[_0x8e2f46(0x2b9)](_0x8e2f46(0x3e9)),console[_0x8e2f46(0x2b9)](_0x8e2f46(0x2e8)),console[_0x8e2f46(0x2b9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x4bddfc)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a'+_0x8e2f46(0x2ab)),0x1;const _0x411413=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4bddfc+_0x8e2f46(0x3b6),()=>_0x386b1f[_0x8e2f46(0x213)][_0x8e2f46(0x28d)](_0x4bddfc),{'verbose':_0x21c433[_0x8e2f46(0x399)]}),_0x162813=_0x411413[_0x8e2f46(0x207)],_0xe48e1b={'name':_0x4bc7c2,'description':_0x1c1f84['description'],'public':_0x1c1f84[_0x8e2f46(0x285)]},_0x127180=await withSpinner(_0x8e2f46(0x319)+_0x4bc7c2+'\x27...',()=>_0x386b1f['personalization']['create'](_0x162813,_0xe48e1b),{'verbose':_0x21c433['verbose']}),_0x4caaeb=_0x127180['data'];return console['error'](_0x8e2f46(0x274)+_0x4caaeb[_0x8e2f46(0x238)]+_0x8e2f46(0x385)+_0x4caaeb['id']),await handleSDKOutput([_0x4caaeb],_0x21c433),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a32_0x15c085(0x238)]='ps:pz:service:show';['description']=a32_0x15c085(0x394);async[a32_0x15c085(0x26a)](_0x157ee9){const _0x5c5629=a32_0x15c085,{options:_0x3de01f,args:_0x5c6656,tdx:_0x3b8314}=_0x157ee9,_0x12be77=_0x5c6656[0x0],_0xd91de3=_0x5c6656[0x1]||_0x3de01f['parentSegment'];if(!_0x12be77)return console[_0x5c5629(0x2b9)](_0x5c5629(0x255)),console['error'](_0x5c5629(0x1e0)),console[_0x5c5629(0x2b9)](_0x5c5629(0x209)),0x1;if(!_0xd91de3)return showParentSegmentNotSetError(_0x5c5629(0x25f)+_0x5c5629(0x209)),0x1;const _0x4d472b=await withSpinner(_0x5c5629(0x2af)+_0xd91de3+'\x27...',()=>_0x3b8314[_0x5c5629(0x213)][_0x5c5629(0x28d)](_0xd91de3),{'verbose':_0x3de01f['verbose']}),_0x2d9db5=_0x4d472b[_0x5c5629(0x207)],_0x1bb1b6=await withSpinner(_0x5c5629(0x315)+_0x12be77+'\x27...',()=>_0x3b8314[_0x5c5629(0x237)]['get'](_0x2d9db5,_0x12be77),{'verbose':_0x3de01f[_0x5c5629(0x399)]}),_0x3e5ea5=_0x1bb1b6[_0x5c5629(0x207)];if(_0x3de01f[_0x5c5629(0x250)]||_0x3de01f[_0x5c5629(0x1da)])await handleSDKOutput([_0x3e5ea5],_0x3de01f);else{console['log'](a32_0x108e3e[_0x5c5629(0x1dd)](_0x3e5ea5[_0x5c5629(0x238)])+'\x20'+a32_0x108e3e['dim']('(id:\x20'+_0x3e5ea5['id']+')'));_0x3e5ea5[_0x5c5629(0x312)]&&console[_0x5c5629(0x20d)]('\x20\x20'+a32_0x108e3e['dim'](_0x3e5ea5['description']));console[_0x5c5629(0x20d)]('\x20\x20'+a32_0x108e3e['cyan'](_0x5c5629(0x2d1))+'\x20'+(_0x3e5ea5[_0x5c5629(0x285)]?_0x5c5629(0x303):'no'));if(_0x3e5ea5[_0x5c5629(0x216)]&&_0x3e5ea5['tokens'][_0x5c5629(0x2f7)]>0x0)for(const _0x4b4feb of _0x3e5ea5['tokens']){const _0x483be8=_0x4b4feb['allowedIps']?.[_0x5c5629(0x2f7)]?_0x4b4feb[_0x5c5629(0x29f)][_0x5c5629(0x3bc)](',\x20'):_0x5c5629(0x2b6);console['log']('\x20\x20'+a32_0x108e3e[_0x5c5629(0x2a1)](_0x5c5629(0x2d3))+'\x20'+_0x4b4feb[_0x5c5629(0x238)]+'\x20'+a32_0x108e3e[_0x5c5629(0x232)](_0x5c5629(0x262)+_0x4b4feb['id']+')')),console['log'](_0x5c5629(0x362)+a32_0x108e3e[_0x5c5629(0x232)](_0x5c5629(0x206))+'\x20'+_0x483be8);}else console[_0x5c5629(0x20d)]('\x20\x20'+a32_0x108e3e['dim']('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x2cb);['description']=a32_0x15c085(0x3d1);async[a32_0x15c085(0x26a)](_0x13eab3){const _0x1f0ada=a32_0x15c085,{options:_0x48712e,args:_0x4b3d34,tdx:_0x17d7a4}=_0x13eab3,_0x1bd5af=_0x4b3d34[0x0],_0x2a936a=_0x4b3d34[0x1]||_0x48712e[_0x1f0ada(0x2d0)];if(!_0x1bd5af)return console[_0x1f0ada(0x2b9)](_0x1f0ada(0x255)),console[_0x1f0ada(0x2b9)](_0x1f0ada(0x2a6)),console[_0x1f0ada(0x2b9)](_0x1f0ada(0x3ab)),0x1;if(!_0x2a936a)return showParentSegmentNotSetError(_0x1f0ada(0x3d6)+_0x1f0ada(0x3ab)),0x1;const _0x5e3009=await withSpinner(_0x1f0ada(0x2af)+_0x2a936a+'\x27...',()=>_0x17d7a4[_0x1f0ada(0x213)][_0x1f0ada(0x28d)](_0x2a936a),{'verbose':_0x48712e[_0x1f0ada(0x399)]}),_0x1551b5=_0x5e3009['data'];return await withSpinner(_0x1f0ada(0x271)+_0x1bd5af+_0x1f0ada(0x3b6),()=>_0x17d7a4['personalization'][_0x1f0ada(0x3e0)](_0x1551b5,_0x1bd5af),{'verbose':_0x48712e['verbose']}),console[_0x1f0ada(0x2b9)](_0x1f0ada(0x322)+_0x1bd5af+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{['name']=a32_0x15c085(0x27e);[a32_0x15c085(0x312)]=a32_0x15c085(0x3fe);async['execute'](_0x48c329){const _0x5307aa=a32_0x15c085,{options:_0x86f7fa,args:_0x452bbe,tdx:_0xb09b39}=_0x48c329,_0x2d1fea=_0x86f7fa,_0x3f8713=_0x452bbe[0x0],_0x21d61f=_0x452bbe[0x1]||_0x86f7fa['parentSegment'];if(!_0x3f8713)return console[_0x5307aa(0x2b9)](_0x5307aa(0x255)),console[_0x5307aa(0x2b9)](_0x5307aa(0x395)),console['error'](_0x5307aa(0x33d)),0x1;if(!_0x2d1fea[_0x5307aa(0x238)])return console['error'](_0x5307aa(0x27c)),console[_0x5307aa(0x2b9)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x21d61f)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a'+_0x5307aa(0x33d)),0x1;const _0x3492a0=await withSpinner(_0x5307aa(0x2af)+_0x21d61f+'\x27...',()=>_0xb09b39['segment'][_0x5307aa(0x28d)](_0x21d61f),{'verbose':_0x86f7fa[_0x5307aa(0x399)]}),_0x3958a7=_0x3492a0[_0x5307aa(0x207)],_0x5371b5={'name':_0x2d1fea[_0x5307aa(0x238)]};_0x2d1fea[_0x5307aa(0x312)]!==undefined&&(_0x5371b5[_0x5307aa(0x312)]=_0x2d1fea[_0x5307aa(0x312)]);const _0xa4f3bf=await withSpinner(_0x5307aa(0x31a)+_0x3f8713+_0x5307aa(0x3b6),()=>_0xb09b39[_0x5307aa(0x237)][_0x5307aa(0x388)](_0x3958a7,_0x3f8713,_0x5371b5),{'verbose':_0x86f7fa[_0x5307aa(0x399)]}),_0x4018af=_0xa4f3bf['data'];return console[_0x5307aa(0x2b9)](_0x5307aa(0x1db)+_0x4018af[_0x5307aa(0x238)]+'\x27'),await handleSDKOutput([_0x4018af],_0x86f7fa),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{['name']=a32_0x15c085(0x2b3);[a32_0x15c085(0x312)]=a32_0x15c085(0x1d5);async[a32_0x15c085(0x26a)](_0x1a5cbb){const _0xfb5c72=a32_0x15c085,{options:_0xfd78bd,args:_0x95e288,tdx:_0x48c5af}=_0x1a5cbb,_0x4a5a3d=_0xfd78bd,_0x2ebab0=_0x95e288[0x0],_0x3e8729=_0x95e288[0x1],_0x5a8aff=_0x95e288[0x2]||_0xfd78bd[_0xfb5c72(0x2d0)];if(!_0x2ebab0)return console[_0xfb5c72(0x2b9)]('Error:\x20Token\x20name\x20is\x20required'),console[_0xfb5c72(0x2b9)](_0xfb5c72(0x3a0)),console['error'](_0xfb5c72(0x24a)),0x1;if(!_0x3e8729)return console[_0xfb5c72(0x2b9)]('Error:\x20Service\x20ID\x20is\x20required'),console['error'](_0xfb5c72(0x3a0)),console[_0xfb5c72(0x2b9)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5a8aff)return showParentSegmentNotSetError(_0xfb5c72(0x290)+_0xfb5c72(0x24a)),0x1;const _0x355513=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5a8aff+_0xfb5c72(0x3b6),()=>_0x48c5af[_0xfb5c72(0x213)][_0xfb5c72(0x28d)](_0x5a8aff),{'verbose':_0xfd78bd['verbose']}),_0x3a442b=_0x355513[_0xfb5c72(0x207)],_0x71871a={'name':_0x2ebab0};_0x4a5a3d[_0xfb5c72(0x29f)]&&(_0x71871a[_0xfb5c72(0x29f)]=_0x4a5a3d[_0xfb5c72(0x29f)][_0xfb5c72(0x2d7)](',')[_0xfb5c72(0x2ad)](_0x54238e=>_0x54238e[_0xfb5c72(0x2ef)]()));_0x4a5a3d[_0xfb5c72(0x312)]&&(_0x71871a['description']=_0x4a5a3d[_0xfb5c72(0x312)]);const _0x2e5784=await withSpinner(_0xfb5c72(0x311)+_0x2ebab0+_0xfb5c72(0x326)+_0x3e8729+_0xfb5c72(0x3b6),()=>_0x48c5af['personalization']['createToken'](_0x3a442b,_0x3e8729,_0x71871a),{'verbose':_0xfd78bd['verbose']}),_0x460625=_0x2e5784[_0xfb5c72(0x207)];return console[_0xfb5c72(0x2b9)](_0xfb5c72(0x212)+_0x460625['name']+_0xfb5c72(0x385)+_0x460625['id']),_0x460625[_0xfb5c72(0x357)]&&(console[_0xfb5c72(0x2b9)](a32_0x108e3e[_0xfb5c72(0x1e6)](_0xfb5c72(0x305))),console[_0xfb5c72(0x2b9)](a32_0x108e3e[_0xfb5c72(0x2a1)](_0x460625[_0xfb5c72(0x357)])),console[_0xfb5c72(0x2b9)]('')),await handleSDKOutput([_0x460625],_0xfd78bd),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x260);[a32_0x15c085(0x312)]='Delete\x20a\x20token\x20from\x20a\x20personalization\x20service';async['execute'](_0x267be2){const _0x3c25f5=a32_0x15c085,{options:_0x1052df,args:_0x1ea78a,tdx:_0x8208a1}=_0x267be2,_0x2f3a29=_0x1ea78a[0x0],_0x32b9ff=_0x1ea78a[0x1]||_0x1052df[_0x3c25f5(0x2d0)];if(!_0x2f3a29)return console[_0x3c25f5(0x2b9)](_0x3c25f5(0x2b2)),console[_0x3c25f5(0x2b9)](_0x3c25f5(0x289)),console['error'](_0x3c25f5(0x34d)),0x1;if(!_0x32b9ff)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a'+_0x3c25f5(0x34d)),0x1;const _0x3f8196=await withSpinner(_0x3c25f5(0x2af)+_0x32b9ff+'\x27...',()=>_0x8208a1[_0x3c25f5(0x213)]['resolveParentId'](_0x32b9ff),{'verbose':_0x1052df[_0x3c25f5(0x399)]}),_0xcb4a7c=_0x3f8196[_0x3c25f5(0x207)],_0x2487ee=await withSpinner(_0x3c25f5(0x2d9),()=>_0x8208a1[_0x3c25f5(0x237)][_0x3c25f5(0x3d0)](_0xcb4a7c),{'verbose':_0x1052df[_0x3c25f5(0x399)]}),_0x28503f=_0x2487ee[_0x3c25f5(0x207)];let _0x24a7d5;for(const _0x22cf29 of _0x28503f){if(_0x22cf29[_0x3c25f5(0x216)]?.['some'](_0x18f8d9=>_0x18f8d9['id']===_0x2f3a29)){_0x24a7d5=_0x22cf29['id'];break;}}if(!_0x24a7d5)return console[_0x3c25f5(0x2b9)](_0x3c25f5(0x2be)+_0x2f3a29+_0x3c25f5(0x38e)),0x1;const _0x3b6701=await withSpinner(_0x3c25f5(0x34e)+_0x2f3a29+'\x27...',()=>_0x8208a1['personalization']['deleteToken'](_0xcb4a7c,_0x24a7d5,_0x2f3a29),{'verbose':_0x1052df[_0x3c25f5(0x399)]}),_0x31795c=_0x3b6701[_0x3c25f5(0x207)];return console[_0x3c25f5(0x2b9)]('✔\x20Deleted\x20token\x20\x27'+(_0x31795c[_0x3c25f5(0x238)]||_0x2f3a29)+'\x27'),await handleSDKOutput([_0x31795c],_0x1052df),0x0;}}export class PSPzListCommand extends BaseCommand{['name']=a32_0x15c085(0x27d);[a32_0x15c085(0x312)]=a32_0x15c085(0x2fa);async['execute'](_0x551886){const _0xf678db=a32_0x15c085,{options:_0x3f5722,args:_0x5983d8,tdx:_0x2366fe}=_0x551886,_0x28cf7b=_0x5983d8[0x0]||_0x3f5722['parentSegment'];if(!_0x28cf7b)return showParentSegmentNotSetError(_0xf678db(0x278)+_0xf678db(0x314)),0x1;const _0x19c45a=await withSpinner(_0xf678db(0x2af)+_0x28cf7b+'\x27...',()=>_0x2366fe[_0xf678db(0x213)][_0xf678db(0x28d)](_0x28cf7b),{'verbose':_0x3f5722[_0xf678db(0x399)]}),_0x1b5972=_0x19c45a[_0xf678db(0x207)],_0x3e69ef=await withSpinner('Listing\x20personalizations\x20for\x20\x27'+_0x28cf7b+'\x27...',()=>_0x2366fe[_0xf678db(0x237)][_0xf678db(0x379)](_0x1b5972),{'verbose':_0x3f5722[_0xf678db(0x399)]}),_0x5baa4b=_0x3e69ef[_0xf678db(0x207)];console[_0xf678db(0x2b9)](_0xf678db(0x27b)+_0x5baa4b[_0xf678db(0x2f7)]+_0xf678db(0x39b)+(_0x5baa4b['length']!==0x1?'s':''));if(_0x3f5722[_0xf678db(0x3fc)]===_0xf678db(0x250)||_0x3f5722[_0xf678db(0x3fc)]===_0xf678db(0x1da))await handleSDKOutput(_0x5baa4b,_0x3f5722);else{if(_0x5baa4b[_0xf678db(0x2f7)]===0x0)console[_0xf678db(0x20d)](_0xf678db(0x3be));else for(const _0x3e3a9f of _0x5baa4b){console[_0xf678db(0x20d)](a32_0x108e3e['bold'](_0x3e3a9f[_0xf678db(0x238)])+'\x20'+a32_0x108e3e['dim'](_0xf678db(0x262)+_0x3e3a9f['id']+')'));_0x3e3a9f[_0xf678db(0x312)]&&console[_0xf678db(0x20d)]('\x20\x20'+a32_0x108e3e[_0xf678db(0x232)](_0x3e3a9f[_0xf678db(0x312)]));const _0x22c415=_0x3e3a9f[_0xf678db(0x1ff)]?.['length']||0x0;console['log']('\x20\x20'+a32_0x108e3e[_0xf678db(0x2a1)](_0xf678db(0x2ac))+'\x20'+_0x22c415);if(_0x3e3a9f[_0xf678db(0x1ff)]&&_0x3e3a9f['sections'][_0xf678db(0x2f7)]>0x0)for(const _0x16d889 of _0x3e3a9f[_0xf678db(0x1ff)]){console['log'](_0xf678db(0x2ea)+_0x16d889[_0xf678db(0x238)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x325);[a32_0x15c085(0x312)]=a32_0x15c085(0x2a7);async[a32_0x15c085(0x26a)](_0x52196d){const _0xeecb27=a32_0x15c085,{options:_0x524a56,args:_0x3ea88d,tdx:_0xe4be41}=_0x52196d,_0x5c50dd=_0x3ea88d[0x0];if(!_0x5c50dd)return console[_0xeecb27(0x2b9)](_0xeecb27(0x3a6)),console['error'](_0xeecb27(0x387)),0x1;const _0x47fc1d=await withSpinner(_0xeecb27(0x3e2)+_0x5c50dd+_0xeecb27(0x3b6),()=>_0xe4be41['personalization'][_0xeecb27(0x317)](_0x5c50dd),{'verbose':_0x524a56[_0xeecb27(0x399)]}),_0x512eb6=_0x47fc1d['data'];console['error'](_0xeecb27(0x30e)+_0x512eb6['name']+'\x27');if(_0x524a56['format']===_0xeecb27(0x250)||_0x524a56[_0xeecb27(0x3fc)]==='jsonl')await handleSDKOutput([_0x512eb6],_0x524a56);else{console[_0xeecb27(0x20d)](a32_0x108e3e[_0xeecb27(0x1dd)](_0x512eb6['name'])+'\x20'+a32_0x108e3e[_0xeecb27(0x232)](_0xeecb27(0x262)+_0x512eb6['id']+')'));_0x512eb6[_0xeecb27(0x312)]&&console['log']('\x20\x20'+a32_0x108e3e[_0xeecb27(0x232)](_0x512eb6[_0xeecb27(0x312)]));_0x512eb6[_0xeecb27(0x349)]&&console[_0xeecb27(0x20d)]('\x20\x20'+a32_0x108e3e[_0xeecb27(0x2a1)]('audienceId:')+'\x20'+_0x512eb6['audienceId']);console[_0xeecb27(0x20d)]('\x20\x20'+a32_0x108e3e[_0xeecb27(0x2a1)](_0xeecb27(0x35b))+'\x20'+_0x512eb6[_0xeecb27(0x301)]),console[_0xeecb27(0x20d)]('\x20\x20'+a32_0x108e3e['cyan']('updated:')+'\x20'+_0x512eb6[_0xeecb27(0x287)]);const _0x2d5e31=_0x512eb6['sections']?.[_0xeecb27(0x2f7)]||0x0;console['log']('\x20\x20'+a32_0x108e3e[_0xeecb27(0x2a1)]('sections:')+'\x20'+_0x2d5e31);if(_0x512eb6[_0xeecb27(0x1ff)]&&_0x512eb6['sections'][_0xeecb27(0x2f7)]>0x0)for(const _0x226482 of _0x512eb6['sections']){console['log']('\x20\x20\x20\x20'+a32_0x108e3e[_0xeecb27(0x1dd)](_0x226482[_0xeecb27(0x238)])+'\x20'+a32_0x108e3e['dim'](_0xeecb27(0x262)+_0x226482['id']+')')),_0x226482['entryCriteria']&&(console[_0xeecb27(0x20d)]('\x20\x20\x20\x20\x20\x20'+a32_0x108e3e[_0xeecb27(0x2a1)](_0xeecb27(0x272))+'\x20'+_0x226482['entryCriteria'][_0xeecb27(0x238)]),_0x226482['entryCriteria']['keyEventCriteria']?.[_0xeecb27(0x3da)]&&console[_0xeecb27(0x20d)](_0xeecb27(0x365)+a32_0x108e3e[_0xeecb27(0x2a1)](_0xeecb27(0x33e))+'\x20'+_0x226482['entryCriteria'][_0xeecb27(0x2a5)][_0xeecb27(0x3da)])),_0x226482[_0xeecb27(0x3b2)]&&console[_0xeecb27(0x20d)]('\x20\x20\x20\x20\x20\x20'+a32_0x108e3e['cyan']('payload:')+'\x20'+JSON[_0xeecb27(0x205)](_0x226482[_0xeecb27(0x3b2)])),_0x226482[_0xeecb27(0x35e)]&&console['log'](_0xeecb27(0x3bd)+a32_0x108e3e[_0xeecb27(0x2a1)](_0xeecb27(0x27f))+_0xeecb27(0x29b));}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a32_0x15c085(0x238)]=a32_0x15c085(0x3e7);[a32_0x15c085(0x312)]=a32_0x15c085(0x31b);async[a32_0x15c085(0x26a)](_0x241579){const _0x28b5bb=a32_0x15c085,{options:_0x52784d,args:_0x29b0ed,tdx:_0xf68afb}=_0x241579,_0x512150=_0x29b0ed[0x0];if(!_0x512150)return console[_0x28b5bb(0x2b9)](_0x28b5bb(0x3a6)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>'),0x1;return await withSpinner(_0x28b5bb(0x279)+_0x512150+_0x28b5bb(0x3b6),()=>_0xf68afb[_0x28b5bb(0x237)][_0x28b5bb(0x380)](_0x512150),{'verbose':_0x52784d[_0x28b5bb(0x399)]}),console[_0x28b5bb(0x2b9)](_0x28b5bb(0x366)+_0x512150+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']='ps:pz:create';[a32_0x15c085(0x312)]=a32_0x15c085(0x3d9);async[a32_0x15c085(0x26a)](_0x40f2ea){const _0x4c3960=a32_0x15c085,{options:_0x580824,tdx:_0x4c9ada}=_0x40f2ea,_0x46bd9b=_0x580824;let _0x4083f7;if(_0x46bd9b['file']){_0x4083f7=await loadJSON(_0x46bd9b[_0x4c3960(0x39d)],!![]);if(!_0x4083f7[_0x4c3960(0x343)]?.[_0x4c3960(0x33b)])return console[_0x4c3960(0x2b9)](_0x4c3960(0x3f2)),console[_0x4c3960(0x2b9)](_0x4c3960(0x2ba)),console[_0x4c3960(0x2b9)]('\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(!_0x46bd9b['name'])return console[_0x4c3960(0x2b9)](_0x4c3960(0x3dd)),console['error'](_0x4c3960(0x2bd)),console['error'](_0x4c3960(0x1d8)),0x1;if(_0x46bd9b[_0x4c3960(0x312)]===undefined)return console[_0x4c3960(0x2b9)](_0x4c3960(0x35a)),console[_0x4c3960(0x2b9)](_0x4c3960(0x2bd)),console[_0x4c3960(0x2b9)](_0x4c3960(0x1d8)),0x1;if(_0x46bd9b[_0x4c3960(0x22e)]===undefined)return console[_0x4c3960(0x2b9)](_0x4c3960(0x2f5)),console[_0x4c3960(0x2b9)](_0x4c3960(0x1e8)),0x1;let _0x3ca92a=_0x46bd9b[_0x4c3960(0x349)];if(!_0x3ca92a&&_0x580824['parentSegment']){const _0x100881=await withSpinner(_0x4c3960(0x2af)+_0x580824[_0x4c3960(0x2d0)]+_0x4c3960(0x3b6),()=>_0x4c9ada[_0x4c3960(0x213)][_0x4c3960(0x28d)](_0x580824[_0x4c3960(0x2d0)]),{'verbose':_0x580824[_0x4c3960(0x399)]});_0x3ca92a=_0x100881[_0x4c3960(0x207)];}let _0x698842;_0x46bd9b[_0x4c3960(0x1ff)]&&(_0x698842=await loadJSON(_0x46bd9b['sections'],![]));const _0x2df516=_0x46bd9b['folderId']===_0x4c3960(0x354)?null:{'id':_0x46bd9b[_0x4c3960(0x22e)],'type':_0x4c3960(0x23d)};_0x4083f7={'attributes':{'name':_0x46bd9b['name'],'description':_0x46bd9b[_0x4c3960(0x312)]||null,..._0x3ca92a!==undefined&&{'audienceId':_0x3ca92a},..._0x698842!==undefined&&{'sections':_0x698842}},'relationships':{'parentFolder':{'data':_0x2df516}}};}const _0x339cfd=await withSpinner(_0x4c3960(0x240)+(_0x4083f7['attributes']?.[_0x4c3960(0x238)]??'')+_0x4c3960(0x3b6),()=>_0x4c9ada['personalization'][_0x4c3960(0x2ee)](_0x4083f7),{'verbose':_0x580824[_0x4c3960(0x399)]}),_0x62916e=_0x339cfd[_0x4c3960(0x207)];return console[_0x4c3960(0x2b9)](_0x4c3960(0x243)+_0x62916e[_0x4c3960(0x238)]+'\x27\x20with\x20ID:\x20'+_0x62916e['id']),await handleSDKOutput([_0x62916e],_0x580824),0x0;}}export class PSPzPatchCommand extends BaseCommand{['name']='ps:pz:patch';['description']=a32_0x15c085(0x374);async['execute'](_0x3a17c8){const _0x3690f7=a32_0x15c085,{options:_0x59107e,args:_0x32d7b5}=_0x3a17c8,_0x55b5b6=_0x59107e,_0x235e30=_0x32d7b5[0x0];if(!_0x235e30)return console['error'](_0x3690f7(0x3a6)),console[_0x3690f7(0x2b9)](_0x3690f7(0x3e8)),console[_0x3690f7(0x2b9)](_0x3690f7(0x3ac)),0x1;let _0x3e9250;if(_0x55b5b6[_0x3690f7(0x39d)])_0x3e9250=await loadJSON(_0x55b5b6[_0x3690f7(0x39d)],!![]);else{if(!_0x55b5b6[_0x3690f7(0x238)])return console[_0x3690f7(0x2b9)]('Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console[_0x3690f7(0x2b9)](_0x3690f7(0x3e8)),0x1;if(_0x55b5b6[_0x3690f7(0x312)]===undefined)return console[_0x3690f7(0x2b9)](_0x3690f7(0x35a)),console[_0x3690f7(0x2b9)](_0x3690f7(0x3e8)),0x1;let _0x7419e8;_0x55b5b6[_0x3690f7(0x1ff)]&&(_0x7419e8=await loadJSON(_0x55b5b6[_0x3690f7(0x1ff)],![])),_0x3e9250={'attributes':{'name':_0x55b5b6['name'],'description':_0x55b5b6[_0x3690f7(0x312)]||null,..._0x7419e8!==undefined&&{'sections':_0x7419e8}}};}const {tdx:_0xe75fc2}=_0x3a17c8,_0x315ce8=await withSpinner(_0x3690f7(0x24f)+_0x235e30+_0x3690f7(0x3b6),()=>_0xe75fc2['personalization']['patchPersonalization'](_0x235e30,_0x3e9250),{'verbose':_0x59107e[_0x3690f7(0x399)]}),_0x499ecc=_0x315ce8[_0x3690f7(0x207)];return console[_0x3690f7(0x2b9)](_0x3690f7(0x2cd)+_0x499ecc[_0x3690f7(0x238)]+_0x3690f7(0x3c6)+_0x499ecc['id']+')'),await handleSDKOutput([_0x499ecc],_0x59107e),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{['name']=a32_0x15c085(0x2c2);[a32_0x15c085(0x312)]=a32_0x15c085(0x2bf);async[a32_0x15c085(0x26a)](_0x468bbc){const _0x452498=a32_0x15c085,{options:_0xdfed51,args:_0x4d0767}=_0x468bbc,_0xd67837=_0x4d0767[0x0]||_0xdfed51[_0x452498(0x2d0)];if(!_0xd67837)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a'+_0x452498(0x2d2)),0x1;const _0x199208=resolveYamlFile(_0xd67837);if(!existsSync(_0x199208))return showFileNotFoundError(_0x199208,_0xd67837),0x1;let _0x3d7d6d;try{_0x3d7d6d=readFileSync(_0x199208,_0x452498(0x257));}catch(_0x40464a){const _0x557042=_0x40464a instanceof Error?_0x40464a['message']:String(_0x40464a);return console['error'](_0x452498(0x335)+_0x557042),0x1;}let _0x512338;try{_0x512338=parseDef(_0x3d7d6d);}catch(_0x289593){const _0x31408d=_0x289593 instanceof Error?_0x289593[_0x452498(0x2bc)]:String(_0x289593);return console[_0x452498(0x2b9)](a32_0x108e3e[_0x452498(0x246)](_0x452498(0x299)+_0x31408d)),0x1;}if(_0x512338[_0x452498(0x378)]&&_0x512338[_0x452498(0x378)][_0x452498(0x2f7)]>0x0)return console[_0x452498(0x2b9)](a32_0x108e3e[_0x452498(0x1e6)](_0x452498(0x1d7)+_0x199208)),console[_0x452498(0x2b9)](a32_0x108e3e[_0x452498(0x232)](_0x452498(0x3c7)+_0x512338[_0x452498(0x378)]['length']+_0x452498(0x2c7))),0x1;!_0x512338[_0x452498(0x21b)]&&(_0x512338[_0x452498(0x21b)]={'events':[{'name':_0x452498(0x363),'source_table':_0x452498(0x337)}],'attributes':[{'name':_0x452498(0x342),'type':_0x452498(0x2a9)}],'id_stitching':{'primary_key':_0x512338['master'][_0x452498(0x352)]==='customers'?_0x452498(0x1df):'user_id'}});_0x512338[_0x452498(0x378)]=[{'name':_0x452498(0x22c),'description':'Personalization\x20service\x20description','trigger_event':_0x452498(0x363),'sections':[{'name':_0x452498(0x28e),'criteria':_0x452498(0x26e),'attributes':['last_page_viewed']}]}];const _0x3cccb3=serializeDef(_0x512338);return writeFileSync(_0x199208,_0x3cccb3,_0x452498(0x257)),console[_0x452498(0x2b9)](a32_0x108e3e[_0x452498(0x3a8)]('✔')+_0x452498(0x23b)+a32_0x108e3e['cyan'](_0x199208)),(!_0x512338[_0x452498(0x21b)]||_0x3d7d6d[_0x452498(0x3cc)](_0x452498(0x3ca))===-0x1)&&console['error'](a32_0x108e3e[_0x452498(0x3a8)]('✔')+_0x452498(0x3b8)),console[_0x452498(0x2b9)]('\x0a'+a32_0x108e3e[_0x452498(0x232)](_0x452498(0x333))),console['error'](_0x452498(0x1e2)+_0x199208+_0x452498(0x360)),console['error'](_0x452498(0x3e3)+a32_0x108e3e[_0x452498(0x232)](_0x452498(0x344)+_0xd67837)+_0x452498(0x398)),0x0;}}
|