@treasuredata/tdx 2026.4.10 → 2026.4.11
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/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/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0xe8811a=a31_0x28cc;(function(_0x399502,_0x593542){const _0x27b4f1=a31_0x28cc,_0x2afb40=_0x399502();while(!![]){try{const _0x2bd6fe=parseInt(_0x27b4f1(0x1ee))/0x1+-parseInt(_0x27b4f1(0x26c))/0x2+parseInt(_0x27b4f1(0x2a8))/0x3*(-parseInt(_0x27b4f1(0x112))/0x4)+parseInt(_0x27b4f1(0x2f0))/0x5*(-parseInt(_0x27b4f1(0x1a1))/0x6)+-parseInt(_0x27b4f1(0x1ba))/0x7*(parseInt(_0x27b4f1(0x141))/0x8)+parseInt(_0x27b4f1(0x2df))/0x9+parseInt(_0x27b4f1(0x124))/0xa;if(_0x2bd6fe===_0x593542)break;else _0x2afb40['push'](_0x2afb40['shift']());}catch(_0x4e1bf5){_0x2afb40['push'](_0x2afb40['shift']());}}}(a31_0x1ad1,0x2b2f6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0xc9ebda 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';function a31_0x1ad1(){const _0xaa1fd4=['allowed\x20IPs:','includeSensitive','\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:','push','41577QLUCxW','ps:pz:show','To\x20view\x20sample\x20data:','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','pullParentYaml','enabled','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','Join:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20personalization','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','getParentSQL','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','relationships','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','toFixed','segment','ps:pz:service:show','sort','any','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','message','Source:','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','sections','Updating','Listing\x20RT-enabled\x20parent\x20segments...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','personalization','entryCriteria','getPersonalization','✔\x20Updated\x20personalization\x20\x27','processedRows','payload:','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','displayValidateResults','Fetching\x20customers\x20schema...','/{name}.yml\x0a','Options:\x0a','tokens','Show\x20personalization\x20service\x20details','idStitching','\x20to\x20push\x20the\x20configuration','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','Pattern:\x20','Error:','in\x20','\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}','Show\x20a\x20specific\x20realtime\x20personalization','paused','type','execute','\x20Configuration\x20is\x20valid','SELECT\x20*\x20FROM\x20(\x0a','\x22,\x20\x22type\x22:\x20\x22','\x27...','attribute','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Error:\x20--behavior\x20requires\x20a\x20name\x0a','(id:\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x5c$&','\x27\x20(id:\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Aborted.','public:','\x0aChanges\x20to\x20\x27','/\x20and\x20','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27','Master:','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','addBehaviorsFile','Found\x20YAML\x20file:\x20','delete','\x20rows\x20','\x20RT\x20journey','\x20\x202.\x20Run\x20','\x0aUsage:\x20tdx\x20ps\x20preview\x20','runParent','\x20Opening\x20','stats','behaviors','\x20is\x20already\x20up\x20to\x20date','✔\x20Found\x20','query','Output\x20Database:','.customers)','displayPreviewHints','listParents','✔\x20Deleted\x20token\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','previewParentYaml','Behavior:','parent_segments','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','launched','✔\x20Created\x20personalization\x20\x27','log','json','Coverage:','-1d','⚡\x20Enabled','ps:rt:jn:pause','Deleting\x20personalization\x20\x27','\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\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','status:\x20','localeCompare','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','Listing\x20personalization\x20services\x20for\x20\x27','name','ps:pz:service:create','public','limit','Attributes:','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','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','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','Events:','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','Listing\x20parent\x20segments...','test','641492xqxPOH','sourceTableValid','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','addAttributesFile','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','ID\x20Stitching:','Deleting\x20token\x20\x27','realtime_enabled','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x0aError:','Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]','audienceId:\x20','attributesFile','displaySampleData','✔\x20Retrieved\x20RT\x20configuration\x20version','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','listPersonalizations','ps:rt:validate','Output\x20file:\x20','workflowId','audienceId:','List\x20available\x20fields\x20for\x20segmentation','start','totalEvents','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','attributes','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','session','segment:parent:validate','RT\x20Journey\x20ID:\x20','column_name','varchar','repeat','No\x20parent\x20segments\x20found','✔\x20Created\x20personalization\x20service\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x20\x20Tables:\x201\x20customers\x20+\x20','parent_segment','Errors:','/app/dw/parentSegments/','run','jsonl','✔\x20No\x20changes\x20-\x20\x27','joinKey','ps:rt:list','Behaviors','utf-8','\x20RT-enabled\x20parent\x20segment','Error:\x20Parent\x20segment\x20name\x20is\x20required','get','Name:\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Attributes','Error:\x20Token\x20\x27','indexOf','522597dTouCY','schemaValid','\x20\x20\x20\x20-\x20','description','✔\x20Created\x20parent\x20segment\x20\x27','Validate:','\x20\x20\x20','green','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','replace','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x27\x20with\x20ID:\x20','No\x20RT-enabled\x20parent\x20segments\x20found','Patching\x20personalization\x20\x27','validateParentYaml','includeSensitive:','segment:parent:run','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','rowCount','enriched','Delete\x20a\x20realtime\x20personalization','collectSchema','/\x20directory.\x0a','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','Updated','.yml','updateParent','Personalization\x20service\x20description','segment:parent:update','\x20rows)','Enriched:','Created','No\x20personalizations\x20configured','displayBehaviorsStats','label','deletePersonalization','displayMasterInfo','RT\x202.0\x20Validate:','primaryKey','master','Preview:','trim','ps:pz:service:delete','\x20=\x20','\x27\x20and\x20run\x20workflow?','\x20\x20\x20\x20','jobId','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Available\x20behaviors:','Apply\x20changes\x20to\x20\x27','Audience\x20ID:','valid','Pause\x20activations\x20in\x20an\x20RT\x20journey','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','xdg-open','2067156CLjdIk','\x20total','interval','Fetching\x20SQL\x20for\x20\x27','behavior','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20No\x20changes\x20-\x20','personalizationServices','endsWith','tdx\x20ps\x20preview\x20','parent_id','dirname','\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','ps:pz:init','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context','reduce','15ggLmpW','Creating','\x0a⚠️\x20\x20Migrating:\x20','\x20configured','red','isDirectory','pauseJourney','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','dim','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','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','ps:rt:configuration_versions','Error\x20reading\x20file:\x20','customerGroup','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','folder-segment','Update\x20a\x20realtime\x20personalization\x20entity','\x20--behavior\x20\x22','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','ps:pz:patch','all','sections:','allValid','Fetching\x20sample\x20data...','\x20\x20\x20\x20\x20\x20','coveragePercent','\x0aNew\x20parent\x20segment\x20\x27','Overwrite\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','customerGroupFile','\x0aChanges\x20to\x20apply\x20to\x20\x27','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','state','Validating\x20RT\x20configuration...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context','keyEventId','columns','Table:\x20','/attempt/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Fetching\x20current\x20configuration\x20for\x20\x27','null','\x22\x20}','✔\x20Deleted\x20personalization\x20service\x20\x27','join','\x20to\x20configure\x20your\x20personalization\x20service','token:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','pushParentYaml','information_schema','table','✔\x20Renamed\x20directory\x20to\x20','Error:\x20Token\x20ID\x20is\x20required','error','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','Error:\x20Service\x20ID\x20is\x20required','Finding\x20service\x20for\x20token...','segment:parent:show','page_view','displayPreviewResults','file','timezone','verbose','realtime','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x27\x20is\x20already\x20up\x20to\x20date','Listing\x20personalizations\x20for\x20\x27','8DqbEkR','data','\x20service','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','createToken','Error:\x20--database\x20and\x20--table\x20are\x20required','Status:','Creating\x20token\x20\x27','use','Fetching\x20parent\x20segment\x20\x27','displayRealtimeInfo','\x20tdx\x20wf\x20attempt\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','string','no\x20tokens\x20configured','\x20personalization\x20service','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','segment:parent:sql','9838060WVtaoE','Fetching\x20behavior\x20list...','apply','customerPercent','Personalization:','tdx\x20ps\x20push\x20','Session:','Show\x20parent\x20segment\x20schema\x20(column\x20types)','segment:parent:push','schemaError','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','list','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','Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment','\x0a✔\x20Workflow\x20started','workflowAttemptId','listFields','✔\x20Deleted\x20personalization\x20\x27','displayAttributesStats','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','Attribute:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]','Attempt:','\x20\x20Note:\x20','parentSegment','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','✔\x20Updated\x20parent\x20segment\x20\x27','status','segment:parent:create','80NfZxAg','SELECT\x20*\x20FROM\x20','resolveParentId','behavior_','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Rows:','/app/workflows/','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','keyEventCriteria','single','format','\x20\x201.\x20Edit\x20','\x0a⚠️\x20\x20Both\x20','\x20Added\x20personalization\x20template\x20to\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','database','population','Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','Options\x20(one\x20required):\x0a','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','true','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','toLowerCase','\x20Added\x20RT\x202.0\x20template\x20section','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x0a\x20\x20\x20\x20]','Getting\x20RT\x20configuration\x20version\x20for\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','foreignKey','To\x20cancel:','customers','patch','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','bold','sourceTableError','events','getOutputDatabaseName','addBehaviors','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Customers:','personalization_services','Show\x20parent\x20segment\x20details','output','customersWithEvents','\x20--attribute\x20\x22<name>\x22','YAML\x20file:\x20','Resume\x20activations\x20in\x20an\x20RT\x20journey','\x27\x20for\x20service\x20\x27','cyan','stringify','Parent\x20segment:\x20','displayColumns','Getting\x20personalization\x20\x27','SQL\x20query:\x0a','some','getParentFull','split','map','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','platform','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','Get\x20current\x20RT\x20configuration\x20version\x20status','folderId','deleteToken','filter','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','errors','Creating\x20personalization\x20\x27','scheduleOption','Creating\x20parent\x20segment\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Resolving\x20parent\x20segment\x20\x27','/sessions/','👥\x20','audienceId','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','using\x20the\x20default\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\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','\x20\x20Database:\x20','addAttributes','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Error:\x20Personalization\x20ID\x20is\x20required','✔\x20Found\x20personalization\x20\x27','displaySummary','column_type','getBehaviorNames','Creating\x20personalization\x20service\x20\x27','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','created:','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','403134rMqLhx','length','identifier','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','open','yellow','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','ps:rt:jn:list','ps:pz:delete','<database>.<table>','keyEventId:','%)\x20','realtime:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','darwin','workflowSessionId','\x20RT\x20configuration\x20is\x20valid','entryCriteria:','segment:parent:list','Updating\x20personalization\x20service\x20\x27','stageCount','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','sampleData','unref','145229owCVeH','\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','last_page_viewed','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','text','\x20--attribute\x20\x22','Master\x20Table','\x20service(s)\x20configured','value','Analyzing\x20changes...','Listing\x20RT\x20journeys\x20for\x20\x27','segment:parent:preview','Default','payload','keys','List\x20RT\x20journeys','Create\x20a\x20token\x20for\x20a\x20personalization\x20service','Deleting\x20personalization\x20service\x20\x27','⚡\x20Not\x20enabled','toLocaleString','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20+\x20[','\x20(paused)','td_client_id','yes','createPersonalization','Error\x20parsing\x20YAML:\x20','formatSchemaJson','site','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','ps:pz:create','\x20Context\x20set:\x20','patchPersonalization','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','allowedIps','segment:parent:fields','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','column','number','updated:','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','stop','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','✔\x20Created\x20token\x20\x27','scheduleType','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Site:\x20','Create\x20parent\x20segment\x20\x27'];a31_0x1ad1=function(){return _0xaa1fd4;};return a31_0x1ad1();}import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';function a31_0x28cc(_0x48296,_0x300887){_0x48296=_0x48296-0xfe;const _0x1ad1c4=a31_0x1ad1();let _0x28cc9a=_0x1ad1c4[_0x48296];return _0x28cc9a;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x4d24f3 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0xe8811a(0x24f),LEGACY_PARENT_SEGMENT_DIR=a31_0xe8811a(0x296);function openBrowser(_0x382c65){const _0x553f78=a31_0xe8811a,_0x275983=process[_0x553f78(0x180)],_0x31da0e=_0x275983===_0x553f78(0x1b0)?_0x553f78(0x1a6):_0x275983==='win32'?_0x553f78(0x283):_0x553f78(0x2de);spawn(_0x31da0e,[_0x382c65],{'detached':!![],'stdio':'ignore'})[_0x553f78(0x1b9)]();}function migrateLegacyDirectory(){const _0x11a27c=a31_0xe8811a;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x39f095=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x39f095[_0x11a27c(0x2f5)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x1a7)](_0x11a27c(0x14f)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x234)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x2f8)](_0x11a27c(0x16b)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x2be))),![];console[_0x11a27c(0x104)](a31_0x4d24f3['yellow'](_0x11a27c(0x2f2)+LEGACY_PARENT_SEGMENT_DIR+_0x11a27c(0x182)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x11a27c(0x104)](a31_0x4d24f3['green'](_0x11a27c(0x102)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0xf34599){const _0x26aaa3=_0xf34599 instanceof Error?_0xf34599[_0x11a27c(0x205)]:String(_0xf34599);return console[_0x11a27c(0x104)](a31_0x4d24f3[_0x11a27c(0x2f4)](_0x11a27c(0x1fe)+_0x26aaa3+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0xe8811a(0x299)](_0x38ba4e){const _0x366a8d=a31_0xe8811a;return migrateLegacyDirectory(),super[_0x366a8d(0x299)](_0x38ba4e);}}function resolveYamlFile(_0x5488e3){const _0x242ba4=a31_0xe8811a;if(_0x5488e3[_0x242ba4(0x2e7)](_0x242ba4(0x2c1))||_0x5488e3[_0x242ba4(0x2e7)]('.yaml'))return _0x5488e3;return a31_0xc9ebda[_0x242ba4(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5488e3)+'.yml');}function formatProgressMessage(_0x26fc3b){const _0x52c1ab=a31_0xe8811a,_0x9ba4e5=_0x26fc3b['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x9ba4e5){const [,_0x2e4bc1,_0x25afb9,_0x1fedd8='']=_0x9ba4e5;return a31_0x4d24f3[_0x52c1ab(0x2f8)](_0x2e4bc1+':')+'\x20'+_0x25afb9+a31_0x4d24f3['dim'](_0x1fedd8);}return a31_0x4d24f3['dim'](_0x26fc3b);}function showFileNotFoundError(_0x221c3d,_0x222ea3){const _0x23d3d4=a31_0xe8811a;console[_0x23d3d4(0x104)](a31_0x4d24f3[_0x23d3d4(0x2f4)]('Error:\x20File\x20not\x20found:\x20'+_0x221c3d+'\x0a')),console[_0x23d3d4(0x104)](a31_0x4d24f3[_0x23d3d4(0x175)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x222ea3+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x58d8aa){const _0x5bf396=a31_0xe8811a;if(!_0x58d8aa['realtime'])return;const _0x48db8b=_0x58d8aa[_0x5bf396(0x10e)],_0x455d74=_0x48db8b[_0x5bf396(0x1f3)]?a31_0x4d24f3[_0x5bf396(0x2af)](_0x5bf396(0x257)):a31_0x4d24f3[_0x5bf396(0x1a7)](_0x5bf396(0x1cc));console['error']('\x0a'+a31_0x4d24f3[_0x5bf396(0x2f8)]('RT\x202.0:')+'\x20'+_0x455d74);if(_0x48db8b[_0x5bf396(0x168)]&&_0x48db8b[_0x5bf396(0x168)][_0x5bf396(0x1a2)]>0x0){console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x5bf396(0x268))+'\x20'+_0x48db8b[_0x5bf396(0x168)][_0x5bf396(0x1a2)]+'\x20configured');for(const _0x3dcb41 of _0x48db8b[_0x5bf396(0x168)]){const _0x268da7=_0x3dcb41[_0x5bf396(0x26d)]===![]?a31_0x4d24f3['red']('✘'):a31_0x4d24f3[_0x5bf396(0x2af)]('✔');console['error'](_0x5bf396(0x2d5)+_0x268da7+'\x20'+_0x3dcb41[_0x5bf396(0x260)]),_0x3dcb41['sourceTableError']&&console[_0x5bf396(0x104)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f4)](_0x3dcb41[_0x5bf396(0x167)]));}}if(_0x48db8b[_0x5bf396(0x289)]&&_0x48db8b[_0x5bf396(0x289)][_0x5bf396(0x1a2)]>0x0){console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x5bf396(0x264))+'\x20'+_0x48db8b[_0x5bf396(0x289)]['length']+_0x5bf396(0x2f3));for(const _0x50cf85 of _0x48db8b[_0x5bf396(0x289)]){const _0x116595=_0x50cf85[_0x5bf396(0x2db)]?a31_0x4d24f3['green']('✔'):a31_0x4d24f3[_0x5bf396(0x2f4)]('✘');console['error'](_0x5bf396(0x2d5)+_0x116595+'\x20'+_0x50cf85[_0x5bf396(0x260)]+'\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)]('('+_0x50cf85['type']+')'));}}if(_0x48db8b['idStitching']){const _0xcaa1ed=_0x48db8b[_0x5bf396(0x21a)]['stitchingKeys']?.['length']?_0x5bf396(0x1cf)+_0x48db8b['idStitching']['stitchingKeys'][_0x5bf396(0x31f)](',\x20')+']':'';console[_0x5bf396(0x104)]('\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)](_0x5bf396(0x272))+'\x20'+_0x48db8b['idStitching'][_0x5bf396(0x2ce)]+_0xcaa1ed);}if(_0x48db8b[_0x5bf396(0x2e6)]&&_0x48db8b[_0x5bf396(0x2e6)]['length']>0x0){console['error']('\x20\x20'+a31_0x4d24f3[_0x5bf396(0x2f8)](_0x5bf396(0x128))+'\x20'+_0x48db8b[_0x5bf396(0x2e6)][_0x5bf396(0x1a2)]+_0x5bf396(0x114)+(_0x48db8b[_0x5bf396(0x2e6)]['length']!==0x1?'s':''));for(const _0x1ba09c of _0x48db8b[_0x5bf396(0x2e6)]){console[_0x5bf396(0x104)](_0x5bf396(0x2aa)+_0x1ba09c['name']);}}}function showParentSegmentNotSetError(_0x5f3896){const _0x46ac8d=a31_0xe8811a;console[_0x46ac8d(0x104)](a31_0x4d24f3['yellow'](_0x46ac8d(0x2b0))),console[_0x46ac8d(0x104)](_0x5f3896);}export class ParentSegmentListCommand extends BaseCommand{['name']=a31_0xe8811a(0x1b4);[a31_0xe8811a(0x2ab)]='List\x20parent\x20segments';async[a31_0xe8811a(0x224)](_0xe8bcf9){const _0x206725=a31_0xe8811a,{options:_0x4830f2,args:_0x47bae4,tdx:_0x46f19b}=_0xe8bcf9,_0x4197d0=_0x47bae4[0x0];_0x4830f2['verbose']&&(console[_0x206725(0x104)](_0x206725(0x1e8)+_0x4830f2[_0x206725(0x1d6)]),_0x4197d0&&console[_0x206725(0x104)](_0x206725(0x21d)+_0x4197d0));const _0x57795a=await withSpinner(_0x4197d0?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x4197d0+_0x206725(0x228):_0x206725(0x26a),()=>_0x46f19b[_0x206725(0x200)][_0x206725(0x24a)](),{'verbose':_0x4830f2[_0x206725(0x10d)]});let _0x4edcd6=_0x57795a[_0x206725(0x113)];if(_0x4197d0){const _0xbc74e9=_0x4197d0[_0x206725(0x2b1)](/[.+^${}()|[\]\\]/g,_0x206725(0x22e))[_0x206725(0x2b1)](/\*/g,'.*')[_0x206725(0x2b1)](/\?/g,'.'),_0x54572f=new RegExp('^'+_0xbc74e9+'$','i');_0x4edcd6=_0x4edcd6[_0x206725(0x186)](_0x211e0c=>_0x54572f['test'](_0x211e0c[_0x206725(0x289)]['name']));}_0x4edcd6[_0x206725(0x202)]((_0x2cf43b,_0x206051)=>_0x2cf43b[_0x206725(0x289)][_0x206725(0x260)][_0x206725(0x25d)](_0x206051['attributes'][_0x206725(0x260)])),console[_0x206725(0x104)]('✔\x20Found\x20'+_0x4edcd6[_0x206725(0x1a2)]+'\x20parent\x20segment'+(_0x4edcd6[_0x206725(0x1a2)]!==0x1?'s':''));const _0x3adcdd=_0x408bb2=>{const _0x5124e7=_0x206725;return getConsoleNextUrl(_0x4830f2['site'],_0x5124e7(0x298)+_0x408bb2);};if(_0x4830f2['format']===_0x206725(0x254)||_0x4830f2['format']===_0x206725(0x29a)){const _0x46501e=_0x4edcd6['map'](_0x15efbb=>({..._0x15efbb,'url':_0x3adcdd(_0x15efbb['id'])}));await handleSDKOutput(_0x46501e,_0x4830f2);}else{if(_0x4edcd6[_0x206725(0x1a2)]===0x0)_0x4197d0?console[_0x206725(0x253)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x4197d0):console[_0x206725(0x253)](_0x206725(0x291));else for(const _0x519051 of _0x4edcd6){const _0x780ace=_0x519051[_0x206725(0x289)][_0x206725(0x154)]?a31_0x4d24f3[_0x206725(0x2f8)]('\x20('+formatRows(_0x519051[_0x206725(0x289)][_0x206725(0x154)])+')'):'',_0x4634a8=hyperlink(_0x519051['attributes'][_0x206725(0x260)],_0x3adcdd(_0x519051['id']));console['log'](_0x206725(0x18f)+_0x4634a8+_0x780ace);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x140);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x115);async[a31_0xe8811a(0x224)](_0x48d1de){const _0x12a22e=a31_0xe8811a,{options:_0x3d077c,args:_0xcd7f1c,tdx:_0x122b24}=_0x48d1de;console[_0x12a22e(0x104)](_0x12a22e(0x191)+_0x12a22e(0x269)+_0x12a22e(0x213));const _0x5758f6=_0x3d077c;if(_0xcd7f1c['length']===0x0)return console[_0x12a22e(0x104)](a31_0x4d24f3['red'](_0x12a22e(0x2a1))),console[_0x12a22e(0x104)](_0x12a22e(0x294)),0x1;const _0x136c57=_0xcd7f1c[0x0];if(!_0x5758f6[_0x12a22e(0x153)]||!_0x5758f6[_0x12a22e(0x101)])return console['error'](_0x12a22e(0x117)),console[_0x12a22e(0x104)](_0x12a22e(0x294)),0x1;_0x5758f6['verbose']&&(console[_0x12a22e(0x104)](_0x12a22e(0x1e8)+_0x5758f6[_0x12a22e(0x1d6)]),console[_0x12a22e(0x104)](_0x12a22e(0x2a3)+_0x136c57),console['error']('Database:\x20'+_0x5758f6[_0x12a22e(0x153)]),console[_0x12a22e(0x104)](_0x12a22e(0x318)+_0x5758f6['table']));const _0x1ef626=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x289)],_0x5758f6[_0x12a22e(0x279)]),_0x4a5cbd=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x243)],_0x5758f6['behaviorsFile']),_0x5810f0=await loadJSONFromOptions(_0x5758f6[_0x12a22e(0x2fd)],_0x5758f6[_0x12a22e(0x30e)]),_0x39147d={'name':_0x136c57,'description':_0x5758f6[_0x12a22e(0x2ab)],'scheduleType':_0x5758f6['scheduleType'],'scheduleOption':_0x5758f6[_0x12a22e(0x18a)],'timezone':_0x5758f6[_0x12a22e(0x10c)],'master':{'parentDatabaseName':_0x5758f6['database'],'parentTableName':_0x5758f6[_0x12a22e(0x101)]},'attributes':_0x1ef626,'behaviors':_0x4a5cbd,'customerGroup':_0x5810f0},_0x44186f=await withSpinner(_0x12a22e(0x18b)+_0x136c57+_0x12a22e(0x228),()=>_0x122b24[_0x12a22e(0x200)]['createParent'](_0x39147d),{'verbose':_0x3d077c[_0x12a22e(0x10d)]}),_0x1a5d34=_0x44186f[_0x12a22e(0x113)];return console[_0x12a22e(0x104)](_0x12a22e(0x2ac)+_0x1a5d34[_0x12a22e(0x260)]+_0x12a22e(0x2b3)+_0x1a5d34['id']),await handleSDKOutput([_0x1a5d34],_0x3d077c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a31_0xe8811a(0x2c4);['description']=a31_0xe8811a(0x2a4);async['execute'](_0x2e5264){const _0x2d0ad1=a31_0xe8811a,{options:_0x7d13f3,args:_0x578566,tdx:_0x5dce0d}=_0x2e5264;console['error'](_0x2d0ad1(0x208)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x2d0ad1(0x213));const _0x8840d=_0x7d13f3;if(_0x578566[_0x2d0ad1(0x1a2)]===0x0)return console[_0x2d0ad1(0x104)](a31_0x4d24f3[_0x2d0ad1(0x2f4)](_0x2d0ad1(0x2a1))),console[_0x2d0ad1(0x104)](_0x2d0ad1(0x1a0)),0x1;const _0x47a253=_0x578566[0x0];_0x8840d[_0x2d0ad1(0x10d)]&&(console['error'](_0x2d0ad1(0x1e8)+_0x8840d['site']),console[_0x2d0ad1(0x104)](_0x2d0ad1(0x177)+_0x47a253));const _0x50f900=await withSpinner(_0x2d0ad1(0x31b)+_0x47a253+_0x2d0ad1(0x228),()=>_0x5dce0d[_0x2d0ad1(0x200)][_0x2d0ad1(0x17c)](_0x47a253),{'verbose':_0x8840d[_0x2d0ad1(0x10d)]}),_0x262dd8=_0x50f900[_0x2d0ad1(0x113)],_0x2880f7=await loadJSONFromOptions(_0x8840d[_0x2d0ad1(0x196)],_0x8840d[_0x2d0ad1(0x26f)]),_0x1a1249=await loadJSONFromOptions(_0x8840d[_0x2d0ad1(0x16a)],_0x8840d[_0x2d0ad1(0x239)]),_0x153df0={'name':_0x262dd8[_0x2d0ad1(0x260)],'description':_0x8840d[_0x2d0ad1(0x2ab)]!==undefined?_0x8840d['description']:_0x262dd8[_0x2d0ad1(0x2ab)],'scheduleType':_0x8840d[_0x2d0ad1(0x1e6)]!==undefined?_0x8840d[_0x2d0ad1(0x1e6)]:_0x262dd8['scheduleType'],'scheduleOption':_0x8840d[_0x2d0ad1(0x18a)]!==undefined?_0x8840d['scheduleOption']:_0x262dd8['scheduleOption'],'timezone':_0x8840d['timezone']!==undefined?_0x8840d[_0x2d0ad1(0x10c)]:_0x262dd8[_0x2d0ad1(0x10c)],'master':_0x262dd8[_0x2d0ad1(0x2cf)],'attributes':_0x2880f7?[..._0x262dd8[_0x2d0ad1(0x289)]||[],..._0x2880f7]:_0x262dd8[_0x2d0ad1(0x289)],'behaviors':_0x1a1249?[..._0x262dd8['behaviors']||[],..._0x1a1249]:_0x262dd8['behaviors'],'customerGroup':_0x262dd8[_0x2d0ad1(0x2fd)]},_0x40d113=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x47a253+_0x2d0ad1(0x228),()=>_0x5dce0d['segment'][_0x2d0ad1(0x2c2)](_0x47a253,_0x153df0),{'verbose':_0x8840d[_0x2d0ad1(0x10d)]}),_0x4535f9=_0x40d113[_0x2d0ad1(0x113)];return console[_0x2d0ad1(0x104)](_0x2d0ad1(0x13e)+_0x4535f9[_0x2d0ad1(0x260)]+'\x27'),await handleSDKOutput([_0x4535f9],_0x8840d),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]='segment:parent:pull';['description']='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a31_0xe8811a(0x224)](_0x441702){const _0x27ac51=a31_0xe8811a,{options:_0x5ac53a,args:_0x4ada1d,tdx:_0x7df8d6}=_0x441702,_0x3732d3=_0x5ac53a,_0x4ca81a=_0x4ada1d[0x0]||_0x5ac53a[_0x27ac51(0x13c)];if(!_0x4ca81a)return showParentSegmentNotSetError(_0x27ac51(0x1fb)+_0x27ac51(0x193)),0x1;if(_0x3732d3[_0x27ac51(0x11a)]&&_0x3732d3[_0x27ac51(0x16f)])return console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2f4)](_0x27ac51(0x275))),console['error'](a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x27c))),console['error'](a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x192)+PARENT_SEGMENT_DIR+_0x27ac51(0x216))),console[_0x27ac51(0x104)](a31_0x4d24f3['cyan'](_0x27ac51(0x1f7))),0x1;const _0x5ebfe3=_0x3732d3[_0x27ac51(0x16f)]||a31_0xc9ebda[_0x27ac51(0x31f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x4ca81a)+'.yml');_0x3732d3[_0x27ac51(0x10d)]&&(console[_0x27ac51(0x104)](_0x27ac51(0x1e8)+_0x3732d3[_0x27ac51(0x1d6)]),console[_0x27ac51(0x104)](_0x27ac51(0x177)+_0x4ca81a),console['error'](_0x27ac51(0x27f)+_0x5ebfe3));const _0x46e41f=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x4ca81a+'\x27...',()=>_0x7df8d6[_0x27ac51(0x200)][_0x27ac51(0x1f2)](_0x4ca81a),{'verbose':_0x3732d3[_0x27ac51(0x10d)]}),_0x166dbf=_0x46e41f[_0x27ac51(0x113)];if(existsSync(_0x5ebfe3)){const _0xbf99d=readFileSync(_0x5ebfe3,_0x27ac51(0x29f)),_0x9497da=generateDiff(_0xbf99d,_0x166dbf);if(!hasChanges(_0x9497da))console[_0x27ac51(0x104)](a31_0x4d24f3['green']('✔')+_0x27ac51(0x2e5)+a31_0x4d24f3[_0x27ac51(0x175)](_0x5ebfe3)+_0x27ac51(0x244));else{console['error'](_0x27ac51(0x233)+_0x5ebfe3+'\x27:'),console[_0x27ac51(0x104)]('─'[_0x27ac51(0x290)](0x3c)),console[_0x27ac51(0x104)](formatDiffWithColors(_0x9497da)),console[_0x27ac51(0x104)]('─'['repeat'](0x3c));if(!_0x3732d3['yes']){if(!isInteractive())return console['error'](a31_0x4d24f3['red'](_0x27ac51(0x276)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2f8)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x41067a=await confirmKey(_0x27ac51(0x30c)+_0x5ebfe3+'\x27?');if(!_0x41067a)return console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x1a7)](_0x27ac51(0x231))),0x1;}writeFileSync(_0x5ebfe3,_0x166dbf,'utf-8'),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x22d)+a31_0x4d24f3[_0x27ac51(0x175)](_0x5ebfe3));}}else{const _0x13a648=a31_0xc9ebda[_0x27ac51(0x2ea)](_0x5ebfe3);!existsSync(_0x13a648)&&mkdirSync(_0x13a648,{'recursive':!![]}),writeFileSync(_0x5ebfe3,_0x166dbf,_0x27ac51(0x29f)),console[_0x27ac51(0x104)](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x22d)+a31_0x4d24f3['cyan'](_0x5ebfe3));}return saveSessionContext({'parent_segment':_0x4ca81a},_0x3732d3[_0x27ac51(0x28b)]),console['error'](a31_0x4d24f3[_0x27ac51(0x2af)]('✔')+_0x27ac51(0x1d9)+a31_0x4d24f3[_0x27ac51(0x2f8)](_0x27ac51(0x296))+_0x27ac51(0x2d3)+a31_0x4d24f3['cyan'](_0x4ca81a)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x12c);[a31_0xe8811a(0x2ab)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async['execute'](_0x10935f){const _0x4ffbac=a31_0xe8811a,{options:_0x37bd82,args:_0x4c5afa,tdx:_0x33c72b}=_0x10935f,_0x37951d=_0x37bd82,_0x42dffc=_0x4c5afa[0x0]||_0x37bd82[_0x4ffbac(0x13c)];if(!_0x42dffc)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'+_0x4ffbac(0x31a)),0x1;const _0x4fb7c3=resolveYamlFile(_0x42dffc);if(!existsSync(_0x4fb7c3))return showFileNotFoundError(_0x4fb7c3,_0x42dffc),0x1;_0x37951d[_0x4ffbac(0x10d)]&&(console['error'](_0x4ffbac(0x1e8)+_0x37951d[_0x4ffbac(0x1d6)]),console[_0x4ffbac(0x104)](_0x4ffbac(0x172)+_0x4fb7c3));let _0x39e905;try{_0x39e905=readFileSync(_0x4fb7c3,_0x4ffbac(0x29f));}catch(_0x22c7e9){const _0x4e6efc=_0x22c7e9 instanceof Error?_0x22c7e9[_0x4ffbac(0x205)]:String(_0x22c7e9);return console[_0x4ffbac(0x104)]('Error\x20reading\x20file:\x20'+_0x4e6efc),0x1;}const _0x1ad64b=await withSpinner('Analyzing\x20changes...',()=>_0x33c72b[_0x4ffbac(0x200)][_0x4ffbac(0xff)](_0x39e905),{'verbose':_0x37951d[_0x4ffbac(0x10d)]}),_0x2cd78d=_0x1ad64b[_0x4ffbac(0x113)],{isNew:_0x1a8ba5,name:_0xeeac11,hasChanges:_0x42cb30,diffFormatted:_0x3660de}=_0x2cd78d;if(!_0x42cb30)return console['error'](_0x4ffbac(0x29b)+_0xeeac11+_0x4ffbac(0x110)),0x0;_0x1a8ba5?console[_0x4ffbac(0x104)](_0x4ffbac(0x30b)+_0xeeac11+'\x27:'):console[_0x4ffbac(0x104)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0xeeac11+'\x27:');console[_0x4ffbac(0x104)]('─'['repeat'](0x3c)),console[_0x4ffbac(0x104)](_0x3660de),console[_0x4ffbac(0x104)]('─'[_0x4ffbac(0x290)](0x3c));const _0xb4dcf2=_0x1a8ba5?'Create\x20parent\x20segment\x20\x27'+_0xeeac11+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0xeeac11+'\x27?';if(!_0x37951d['yes']){if(!isInteractive())return console[_0x4ffbac(0x104)](a31_0x4d24f3[_0x4ffbac(0x2f4)]('\x0aError:'),_0x4ffbac(0x17f)),console[_0x4ffbac(0x104)](a31_0x4d24f3['dim'](_0x4ffbac(0x18c))),0x1;const _0x1fb097=await confirmKey(_0xb4dcf2);if(!_0x1fb097)return console[_0x4ffbac(0x104)](a31_0x4d24f3[_0x4ffbac(0x1a7)](_0x4ffbac(0x231))),0x1;}const _0x97f7b9=_0x1a8ba5?_0x4ffbac(0x2f1):'Updating',_0x2de5dc=await withSpinner(_0x97f7b9+'\x20parent\x20segment\x20\x27'+_0xeeac11+_0x4ffbac(0x228),()=>_0x2cd78d[_0x4ffbac(0x126)](),{'verbose':_0x37951d[_0x4ffbac(0x10d)]}),_0x4865d1=_0x2de5dc[_0x4ffbac(0x113)],_0x5b9d2e=getConsoleNextUrl(_0x37951d[_0x4ffbac(0x1d6)],_0x4ffbac(0x298)+_0x4865d1['id']),_0x5d341c=_0x1a8ba5?_0x4ffbac(0x2c7):_0x4ffbac(0x2c0);return console[_0x4ffbac(0x104)]('✔\x20'+_0x5d341c+'\x20parent\x20segment\x20\x27'+_0x4865d1[_0x4ffbac(0x260)]+'\x27'),console[_0x4ffbac(0x104)]('\x20\x20'+_0x5b9d2e),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a31_0xe8811a(0x28c);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x310);async[a31_0xe8811a(0x224)](_0x298b1b){const _0x44e3c8=a31_0xe8811a,{options:_0x556d1e,args:_0xa2ba26,tdx:_0x4b3b49}=_0x298b1b,_0x42a736=_0x556d1e,_0xceab0a=_0xa2ba26[0x0]||_0x556d1e[_0x44e3c8(0x13c)];if(!_0xceab0a)return showParentSegmentNotSetError(_0x44e3c8(0x22a)+_0x44e3c8(0x1af)+_0x44e3c8(0x217)+_0x44e3c8(0x230)+_0x44e3c8(0x187)+_0x44e3c8(0x149)),0x1;const _0x2cb1bc=resolveYamlFile(_0xceab0a);if(!existsSync(_0x2cb1bc))return showFileNotFoundError(_0x2cb1bc,_0xceab0a),0x1;_0x42a736[_0x44e3c8(0x10d)]&&(console[_0x44e3c8(0x104)](_0x44e3c8(0x1e8)+_0x42a736[_0x44e3c8(0x1d6)]),console['error']('YAML\x20file:\x20'+_0x2cb1bc));let _0x1cff53;try{_0x1cff53=readFileSync(_0x2cb1bc,'utf-8');}catch(_0x637644){const _0x10860c=_0x637644 instanceof Error?_0x637644[_0x44e3c8(0x205)]:String(_0x637644);return console[_0x44e3c8(0x104)](_0x44e3c8(0x2fc)+_0x10860c),0x1;}const _0x5b6477=createCommandSpinner(a31_0x4d24f3['dim']('Validating\x20configuration...'),{'verbose':_0x42a736[_0x44e3c8(0x10d)]});_0x5b6477[_0x44e3c8(0x283)]();const _0x5e8b90={'onProgress':_0x202528=>{const _0x1e9f2b=_0x44e3c8;_0x5b6477[_0x1e9f2b(0x1be)]=formatProgressMessage(_0x202528);}};if(_0x42a736[_0x44e3c8(0x2cf)])_0x5e8b90[_0x44e3c8(0x2cf)]=!![];if(_0x42a736['enriched'])_0x5e8b90[_0x44e3c8(0x2bb)]=!![];_0x42a736[_0x44e3c8(0x229)]&&(_0x5e8b90[_0x44e3c8(0x229)]=_0x42a736[_0x44e3c8(0x229)]);_0x42a736[_0x44e3c8(0x2e3)]&&(_0x5e8b90[_0x44e3c8(0x2e3)]=_0x42a736['behavior']);if(_0x42a736[_0x44e3c8(0x2e1)])_0x5e8b90[_0x44e3c8(0x2e1)]=_0x42a736[_0x44e3c8(0x2e1)];let _0x3ac25c;try{_0x3ac25c=await _0x4b3b49['segment'][_0x44e3c8(0x2b6)](_0x1cff53,_0x5e8b90),_0x5b6477[_0x44e3c8(0x1e3)]();}catch(_0x20040e){_0x5b6477[_0x44e3c8(0x1e3)]();throw _0x20040e;}const _0x1a3a7b=_0x42a736['interval']||_0x44e3c8(0x256);return this[_0x44e3c8(0x214)](_0x3ac25c,_0x5e8b90,_0x2cb1bc,_0x1a3a7b),_0x3ac25c[_0x44e3c8(0x307)]?0x0:0x1;}[a31_0xe8811a(0x214)](_0x5c5b2c,_0x271685,_0x1893e9,_0x5c4aac){const _0x3bea28=a31_0xe8811a;console['error']('\x0a'+a31_0x4d24f3[_0x3bea28(0x166)](_0x3bea28(0x2ad))+'\x20'+_0x5c5b2c[_0x3bea28(0x260)]),console[_0x3bea28(0x104)]('═'[_0x3bea28(0x290)](0x3c)),this[_0x3bea28(0x2cc)](_0x5c5b2c);if(typeof _0x271685[_0x3bea28(0x229)]==='string'){this[_0x3bea28(0x136)](_0x5c5b2c),this[_0x3bea28(0x19a)](_0x5c5b2c),this['displayPreviewHints'](_0x1893e9,_0x5c4aac,_0x3bea28(0x229),_0x271685[_0x3bea28(0x229)]);return;}if(_0x271685[_0x3bea28(0x229)]===!![]){this[_0x3bea28(0x136)](_0x5c5b2c),this['displaySummary'](_0x5c5b2c),this['displayPreviewHints'](_0x1893e9,_0x5c4aac,_0x3bea28(0x289));return;}if(typeof _0x271685[_0x3bea28(0x2e3)]===_0x3bea28(0x11f)){this[_0x3bea28(0x2c9)](_0x5c5b2c,_0x5c4aac),this['displaySummary'](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,_0x3bea28(0x2e3),_0x271685[_0x3bea28(0x2e3)]);return;}if(_0x271685[_0x3bea28(0x2e3)]===!![]){this['displayBehaviorsStats'](_0x5c5b2c,_0x5c4aac),this[_0x3bea28(0x19a)](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,_0x3bea28(0x243));return;}this[_0x3bea28(0x136)](_0x5c5b2c),this[_0x3bea28(0x2c9)](_0x5c5b2c,_0x5c4aac),this[_0x3bea28(0x11c)](_0x5c5b2c),this[_0x3bea28(0x19a)](_0x5c5b2c),this[_0x3bea28(0x249)](_0x1893e9,_0x5c4aac,'all');}[a31_0xe8811a(0x11c)](_0x525228){displayRealtimeValidation(_0x525228);}[a31_0xe8811a(0x249)](_0x398a44,_0x20b5de,_0x24b242,_0x1be27b){const _0x50d527=a31_0xe8811a;console[_0x50d527(0x104)]('\x0a'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x1f0)));const _0x3914ff=_0x20b5de!=='-1d'?'\x20--interval\x20'+_0x20b5de:'';if(_0x24b242===_0x50d527(0x229)&&_0x1be27b)console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3['dim']('tdx\x20ps\x20preview\x20'+_0x398a44+'\x20--attribute\x20\x22'+_0x1be27b+'\x22'+_0x3914ff));else{if(_0x24b242==='behavior'&&_0x1be27b)console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x2e8)+_0x398a44+_0x50d527(0x301)+_0x1be27b+'\x22'+_0x3914ff));else(_0x24b242===_0x50d527(0x289)||_0x24b242===_0x50d527(0x305))&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x50d527(0x2e8)+_0x398a44+_0x50d527(0x171)+_0x3914ff));}(_0x24b242==='behaviors'||_0x24b242===_0x50d527(0x305))&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)](_0x50d527(0x2e8)+_0x398a44+'\x20--behavior\x20\x22<name>\x22'+_0x3914ff)),_0x24b242===_0x50d527(0x305)&&console[_0x50d527(0x104)]('\x20\x20'+a31_0x4d24f3[_0x50d527(0x2f8)]('tdx\x20ps\x20preview\x20'+_0x398a44+'\x20--enriched'+_0x3914ff));}[a31_0xe8811a(0x2cc)](_0xd09171){const _0x2fe0fe=a31_0xe8811a,{master:_0x21b55f}=_0xd09171,_0x51f0a8=_0x21b55f[_0x2fe0fe(0x2a9)]?a31_0x4d24f3[_0x2fe0fe(0x2af)]('✔'):a31_0x4d24f3['red']('✘');console[_0x2fe0fe(0x104)]('\x0a'+a31_0x4d24f3[_0x2fe0fe(0x2f8)](_0x2fe0fe(0x1c0))),console[_0x2fe0fe(0x104)](_0x51f0a8+'\x20'+a31_0x4d24f3[_0x2fe0fe(0x166)](_0x21b55f[_0x2fe0fe(0x153)]+'.'+_0x21b55f[_0x2fe0fe(0x101)])),_0x21b55f[_0x2fe0fe(0x2a9)]?_0x21b55f['rowCount']!==undefined&&console[_0x2fe0fe(0x104)]('\x20\x20'+a31_0x4d24f3[_0x2fe0fe(0x2f8)](_0x2fe0fe(0x147))+'\x20'+a31_0x4d24f3['cyan'](formatRows(_0x21b55f[_0x2fe0fe(0x2ba)]))):console['error']('\x20\x20'+a31_0x4d24f3['red']('Error:')+'\x20'+_0x21b55f[_0x2fe0fe(0x12d)]);}['displayAttributesStats'](_0x4cca46){const _0x58c03b=a31_0xe8811a;if(_0x4cca46[_0x58c03b(0x289)][_0x58c03b(0x1a2)]===0x0)return;console[_0x58c03b(0x104)]('\x0a'+a31_0x4d24f3[_0x58c03b(0x2f8)](_0x58c03b(0x2a5)));for(const _0x1e3a79 of _0x4cca46[_0x58c03b(0x289)]){const _0x1442ff=_0x1e3a79[_0x58c03b(0x2a9)]?a31_0x4d24f3['green']('✔'):a31_0x4d24f3[_0x58c03b(0x2f4)]('✘');let _0x497d00='';if(_0x1e3a79['schemaValid']&&_0x1e3a79['matchedCount']!==undefined&&_0x1e3a79['coveragePercent']!==undefined){const _0x33a206=_0x1e3a79[_0x58c03b(0x30a)]['toFixed'](0x1),_0x161dd7=_0x1e3a79[_0x58c03b(0x30a)]>=0x50?a31_0x4d24f3[_0x58c03b(0x2af)]:_0x1e3a79[_0x58c03b(0x30a)]>=0x32?a31_0x4d24f3['yellow']:a31_0x4d24f3['red'];_0x497d00='\x20'+a31_0x4d24f3[_0x58c03b(0x2f8)](_0x58c03b(0x255))+'\x20'+_0x161dd7(_0x33a206+'%')+'\x20('+formatRows(_0x1e3a79['matchedCount'])+_0x58c03b(0x2c5);}console[_0x58c03b(0x104)](_0x1442ff+'\x20'+a31_0x4d24f3[_0x58c03b(0x166)](_0x1e3a79['name'])+_0x497d00),console['error']('\x20\x20'+a31_0x4d24f3['dim'](_0x58c03b(0x206))+'\x20'+a31_0x4d24f3[_0x58c03b(0x166)](_0x1e3a79[_0x58c03b(0x153)]+'.'+_0x1e3a79[_0x58c03b(0x101)]));const _0x288de7=_0x1e3a79['joinKey']===_0x1e3a79['foreignKey']?a31_0x4d24f3['dim']('Join\x20on:')+'\x20'+_0x1e3a79[_0x58c03b(0x29c)]:a31_0x4d24f3[_0x58c03b(0x2f8)]('Join:')+'\x20'+_0x1e3a79[_0x58c03b(0x29c)]+'\x20=\x20'+_0x1e3a79[_0x58c03b(0x161)];console['error']('\x20\x20'+_0x288de7),console[_0x58c03b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x58c03b(0x2f8)]('Columns:')),this[_0x58c03b(0x178)](_0x1e3a79['columns']),!_0x1e3a79[_0x58c03b(0x2a9)]&&console[_0x58c03b(0x104)]('\x20\x20'+a31_0x4d24f3['red']('Error:')+'\x20'+_0x1e3a79['schemaError']);}}[a31_0xe8811a(0x2c9)](_0x57978b,_0x136e7f){const _0x14f79b=a31_0xe8811a;if(_0x57978b[_0x14f79b(0x243)]['length']===0x0)return;console[_0x14f79b(0x104)]('\x0a'+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x29e))+'\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)]('('+_0x136e7f+')'));for(const _0x334533 of _0x57978b['behaviors']){const _0x3add9c=_0x334533[_0x14f79b(0x2a9)]?a31_0x4d24f3[_0x14f79b(0x2af)]('✔'):a31_0x4d24f3[_0x14f79b(0x2f4)]('✘');let _0x73bcfe='';if(_0x334533[_0x14f79b(0x2a9)]&&_0x334533[_0x14f79b(0x170)]!==undefined&&_0x334533[_0x14f79b(0x284)]!==undefined){const _0xbf5d6e=_0x334533[_0x14f79b(0x127)]?.[_0x14f79b(0x1ff)](0x1)||'?',_0xb84b06=(_0x334533[_0x14f79b(0x127)]??0x0)>=0x32?a31_0x4d24f3[_0x14f79b(0x2af)]:(_0x334533[_0x14f79b(0x127)]??0x0)>=0x14?a31_0x4d24f3[_0x14f79b(0x1a7)]:a31_0x4d24f3[_0x14f79b(0x2f4)];_0x73bcfe='\x20'+a31_0x4d24f3['dim'](_0x14f79b(0x16c))+'\x20'+_0xb84b06(formatRows(_0x334533[_0x14f79b(0x170)]))+'\x20('+_0xbf5d6e+_0x14f79b(0x1ad)+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x268))+'\x20'+a31_0x4d24f3[_0x14f79b(0x175)](formatRows(_0x334533[_0x14f79b(0x284)]));}console[_0x14f79b(0x104)](_0x3add9c+'\x20'+a31_0x4d24f3[_0x14f79b(0x166)](_0x334533[_0x14f79b(0x260)])+_0x73bcfe),console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)](_0x14f79b(0x206))+'\x20'+a31_0x4d24f3[_0x14f79b(0x166)](_0x334533[_0x14f79b(0x153)]+'.'+_0x334533[_0x14f79b(0x101)]));const _0x49dd12=_0x334533[_0x14f79b(0x29c)]===_0x334533['foreignKey']?a31_0x4d24f3[_0x14f79b(0x2f8)]('Join\x20on:')+'\x20'+_0x334533['joinKey']:a31_0x4d24f3['dim'](_0x14f79b(0x1f6))+'\x20'+_0x334533['joinKey']+_0x14f79b(0x2d3)+_0x334533[_0x14f79b(0x161)];console[_0x14f79b(0x104)]('\x20\x20'+_0x49dd12),console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f8)]('Columns:')),this[_0x14f79b(0x178)](_0x334533['columns']),!_0x334533[_0x14f79b(0x2a9)]&&console[_0x14f79b(0x104)]('\x20\x20'+a31_0x4d24f3[_0x14f79b(0x2f4)](_0x14f79b(0x21e))+'\x20'+_0x334533[_0x14f79b(0x12d)]);}}[a31_0xe8811a(0x178)](_0x57fbb3){const _0xcc2c48=a31_0xe8811a;for(const _0x6525dc of _0x57fbb3){_0x6525dc['label']===_0x6525dc[_0xcc2c48(0x1df)]||_0x6525dc['column']==='*'?console[_0xcc2c48(0x104)](_0xcc2c48(0x2aa)+_0x6525dc[_0xcc2c48(0x2ca)]):console[_0xcc2c48(0x104)](_0xcc2c48(0x2aa)+_0x6525dc['label']+'\x20'+a31_0x4d24f3[_0xcc2c48(0x2f8)]('('+_0x6525dc[_0xcc2c48(0x1df)]+')'));}}['displaySummary'](_0x51ae29){const _0x2386fb=a31_0xe8811a;console[_0x2386fb(0x104)]('─'[_0x2386fb(0x290)](0x3c));if(_0x51ae29[_0x2386fb(0x188)][_0x2386fb(0x1a2)]>0x0){console[_0x2386fb(0x104)]('\x0a'+a31_0x4d24f3[_0x2386fb(0x2f4)](_0x2386fb(0x297)));for(const _0x291498 of _0x51ae29[_0x2386fb(0x188)]){console[_0x2386fb(0x104)]('\x20\x20'+a31_0x4d24f3['red']('•')+'\x20'+_0x291498);}}_0x51ae29[_0x2386fb(0x307)]&&console['error']('\x0a'+a31_0x4d24f3[_0x2386fb(0x2af)]('✔')+_0x2386fb(0x225));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1c5);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x1a5);async[a31_0xe8811a(0x224)](_0x291d63){const _0x424872=a31_0xe8811a,{options:_0x24c2c3,args:_0x321949,tdx:_0x544c93}=_0x291d63,_0x325322=_0x24c2c3,_0x1f7d24=_0x321949[0x0]||_0x24c2c3[_0x424872(0x13c)];if(!_0x1f7d24)return showParentSegmentNotSetError(_0x424872(0x235)+_0x424872(0x204)+_0x424872(0x157)+_0x424872(0x1e2)+_0x424872(0x1de)+_0x424872(0x197)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x424872(0x149)),0x1;if(!_0x325322[_0x424872(0x2cf)]&&!_0x325322[_0x424872(0x229)]&&!_0x325322[_0x424872(0x2e3)]&&!_0x325322['enriched'])return console['error'](a31_0x4d24f3[_0x424872(0x2f4)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console['error'](_0x424872(0x1e4)),console[_0x424872(0x104)]('Options:'),console[_0x424872(0x104)](_0x424872(0x14a)),console['error'](_0x424872(0x151)),console['error'](_0x424872(0x1d7)),console[_0x424872(0x104)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x315884=resolveYamlFile(_0x1f7d24);if(!existsSync(_0x315884))return showFileNotFoundError(_0x315884,_0x1f7d24),0x1;_0x325322[_0x424872(0x10d)]&&(console[_0x424872(0x104)](_0x424872(0x1e8)+_0x325322[_0x424872(0x1d6)]),console[_0x424872(0x104)](_0x424872(0x172)+_0x315884));let _0x71ca70;try{_0x71ca70=readFileSync(_0x315884,_0x424872(0x29f));}catch(_0x1d95fc){const _0x118f77=_0x1d95fc instanceof Error?_0x1d95fc['message']:String(_0x1d95fc);return console[_0x424872(0x104)](_0x424872(0x2fc)+_0x118f77),0x1;}let _0x4c5e32;try{_0x4c5e32=parseDef(_0x71ca70);}catch(_0x48cf68){const _0x3ee35d=_0x48cf68 instanceof Error?_0x48cf68[_0x424872(0x205)]:String(_0x48cf68);return console['error'](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x1d4)+_0x3ee35d)),0x1;}if(_0x325322[_0x424872(0x229)]===!![]||_0x325322[_0x424872(0x229)]===''){const _0x32e4be=_0x4c5e32[_0x424872(0x289)]?.[_0x424872(0x17e)](_0x39795f=>_0x39795f[_0x424872(0x260)])||[];if(_0x32e4be[_0x424872(0x1a2)]===0x0)console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x2ec)));else{console[_0x424872(0x104)](a31_0x4d24f3['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x424872(0x104)]('Available\x20attributes:');for(const _0x38ba33 of _0x32e4be){console[_0x424872(0x104)]('\x20\x20'+a31_0x4d24f3[_0x424872(0x175)](_0x38ba33));}console[_0x424872(0x104)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x1f7d24+_0x424872(0x1bf)+_0x32e4be[0x0]+'\x22');}return 0x1;}if(_0x325322['behavior']===!![]||_0x325322[_0x424872(0x2e3)]===''){const _0x250550=_0x4c5e32[_0x424872(0x243)]?.[_0x424872(0x17e)](_0x255483=>_0x255483[_0x424872(0x260)])||[];if(_0x250550['length']===0x0)console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x19e)));else{console[_0x424872(0x104)](a31_0x4d24f3[_0x424872(0x2f4)](_0x424872(0x22b))),console[_0x424872(0x104)](_0x424872(0x2d8));for(const _0x5ea291 of _0x250550){console[_0x424872(0x104)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x5ea291));}console[_0x424872(0x104)](_0x424872(0x23f)+_0x1f7d24+_0x424872(0x301)+_0x250550[0x0]+'\x22');}return 0x1;}const _0x34968f=createCommandSpinner(a31_0x4d24f3[_0x424872(0x2f8)](_0x424872(0x308)),{'verbose':_0x325322[_0x424872(0x10d)]});_0x34968f[_0x424872(0x283)]();const _0x114c5f={'onProgress':_0x4ada37=>{const _0x296c0b=_0x424872;_0x34968f[_0x296c0b(0x1be)]=formatProgressMessage(_0x4ada37);}};if(_0x325322[_0x424872(0x2cf)])_0x114c5f['master']=!![];if(_0x325322['attribute']&&typeof _0x325322[_0x424872(0x229)]==='string')_0x114c5f[_0x424872(0x229)]=_0x325322[_0x424872(0x229)];if(_0x325322[_0x424872(0x2e3)]&&typeof _0x325322['behavior']===_0x424872(0x11f))_0x114c5f['behavior']=_0x325322[_0x424872(0x2e3)];if(_0x325322[_0x424872(0x2bb)])_0x114c5f[_0x424872(0x2bb)]=!![];if(_0x325322['interval'])_0x114c5f[_0x424872(0x2e1)]=_0x325322[_0x424872(0x2e1)];let _0x5c6012;try{_0x5c6012=await _0x544c93['segment'][_0x424872(0x24d)](_0x71ca70,_0x114c5f),_0x34968f['stop']();}catch(_0x4da99e){_0x34968f['stop']();throw _0x4da99e;}return await this[_0x424872(0x10a)](_0x5c6012,{'master':_0x325322['master'],'attribute':typeof _0x325322[_0x424872(0x229)]===_0x424872(0x11f)?_0x325322[_0x424872(0x229)]:undefined,'behavior':typeof _0x325322[_0x424872(0x2e3)]===_0x424872(0x11f)?_0x325322['behavior']:undefined,'enriched':_0x325322[_0x424872(0x2bb)]}),_0x5c6012[_0x424872(0x307)]?0x0:0x1;}async['displayPreviewResults'](_0x599e1e,_0x3326b8){const _0x22c1ae=a31_0xe8811a;console[_0x22c1ae(0x104)]('\x0a'+a31_0x4d24f3['bold'](_0x22c1ae(0x2d0))+'\x20'+_0x599e1e['name']),console[_0x22c1ae(0x104)]('═'[_0x22c1ae(0x290)](0x3c));if(_0x3326b8[_0x22c1ae(0x2cf)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x13ca22=a31_0x4d24f3['dim'](_0x22c1ae(0x237))+'\x20'+a31_0x4d24f3[_0x22c1ae(0x166)](_0x599e1e['master'][_0x22c1ae(0x153)]+'.'+_0x599e1e[_0x22c1ae(0x2cf)][_0x22c1ae(0x101)]);await this[_0x22c1ae(0x27a)](_0x13ca22,_0x599e1e['sampleData']);}else{if(_0x3326b8['attribute']&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x528890=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x138))+'\x20'+a31_0x4d24f3['bold'](_0x3326b8[_0x22c1ae(0x229)]);await this[_0x22c1ae(0x27a)](_0x528890,_0x599e1e[_0x22c1ae(0x1b8)]);}else{if(_0x3326b8[_0x22c1ae(0x2e3)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x390e4c=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x24e))+'\x20'+a31_0x4d24f3['bold'](_0x3326b8['behavior']);await this[_0x22c1ae(0x27a)](_0x390e4c,_0x599e1e[_0x22c1ae(0x1b8)]);}else{if(_0x3326b8[_0x22c1ae(0x2bb)]&&_0x599e1e[_0x22c1ae(0x1b8)]){const _0x356add=a31_0x4d24f3[_0x22c1ae(0x2f8)](_0x22c1ae(0x2c6))+'\x20'+a31_0x4d24f3[_0x22c1ae(0x166)]('Master\x20+\x20Attributes');await this[_0x22c1ae(0x27a)](_0x356add,_0x599e1e['sampleData']);}else!_0x599e1e[_0x22c1ae(0x1b8)]&&console[_0x22c1ae(0x104)]('\x0aNo\x20sample\x20data\x20available');}}}if(_0x599e1e['errors'][_0x22c1ae(0x1a2)]>0x0){console['error']('─'[_0x22c1ae(0x290)](0x3c)),console[_0x22c1ae(0x104)]('\x0a'+a31_0x4d24f3[_0x22c1ae(0x2f4)](_0x22c1ae(0x297)));for(const _0x21b436 of _0x599e1e[_0x22c1ae(0x188)]){console[_0x22c1ae(0x104)]('\x20\x20'+a31_0x4d24f3[_0x22c1ae(0x2f4)]('•')+'\x20'+_0x21b436);}}}async[a31_0xe8811a(0x27a)](_0x38542a,_0x3069e9){const _0x5944d3=a31_0xe8811a;if(_0x3069e9[_0x5944d3(0x1a2)]===0x0){console['error']('\x0a'+_0x38542a),console['error']('\x20\x20No\x20sample\x20data\x20available');return;}console['error']('\x0a'+_0x38542a);const _0xad1841=Object[_0x5944d3(0x1c8)](_0x3069e9[0x0])[_0x5944d3(0x17e)](_0x158479=>({'name':_0x158479,'type':typeof _0x3069e9[0x0][_0x158479]===_0x5944d3(0x1e0)?'double':_0x5944d3(0x28f)})),_0x2aa2ff={'queryId':'preview','columns':_0xad1841,'data':_0x3069e9,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x3069e9['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x5434de=formatAsTable(_0x2aa2ff,_0x3069e9[_0x5944d3(0x1a2)],!![]);await writeOutput(_0x5434de,undefined,_0x5944d3(0x101));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a31_0xe8811a(0x2b8);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x15a);async[a31_0xe8811a(0x224)](_0x18e0f8){const _0x182949=a31_0xe8811a,{options:_0xc70f0b,args:_0x299eca,tdx:_0x53512f}=_0x18e0f8,_0xffcd71=_0xc70f0b,_0x54e49e=_0x299eca[0x0]||_0xc70f0b[_0x182949(0x13c)];if(!_0x54e49e)return showParentSegmentNotSetError(_0x182949(0x137)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x239028=resolveYamlFile(_0x54e49e);if(existsSync(_0x239028)){_0xffcd71[_0x182949(0x10d)]&&console['error'](_0x182949(0x23a)+_0x239028);let _0x1bfd9b;try{_0x1bfd9b=readFileSync(_0x239028,_0x182949(0x29f));}catch(_0x54b4bc){const _0x50eb9d=_0x54b4bc instanceof Error?_0x54b4bc['message']:String(_0x54b4bc);return console[_0x182949(0x104)](_0x182949(0x2fc)+_0x50eb9d),0x1;}const _0x11548b=await withSpinner(_0x182949(0x1c3),()=>_0x53512f[_0x182949(0x200)]['pushParentYaml'](_0x1bfd9b),{'verbose':_0xffcd71[_0x182949(0x10d)]}),_0x20f759=_0x11548b['data'],{isNew:_0x35df1c,name:_0x42e0eb,hasChanges:_0x162864,diffFormatted:_0x298e18}=_0x20f759;if(_0x162864){_0x35df1c?console[_0x182949(0x104)](_0x182949(0x30b)+_0x42e0eb+'\x27:'):console[_0x182949(0x104)](_0x182949(0x30f)+_0x42e0eb+'\x27:');console[_0x182949(0x104)]('─'[_0x182949(0x290)](0x3c)),console[_0x182949(0x104)](_0x298e18),console['error']('─'['repeat'](0x3c));const _0x35876b=_0x35df1c?_0x182949(0x1e9)+_0x42e0eb+_0x182949(0x2d4):_0x182949(0x2d9)+_0x42e0eb+_0x182949(0x2d4);if(!_0xffcd71[_0x182949(0x1d2)]){if(!isInteractive())return console['error'](a31_0x4d24f3[_0x182949(0x2f4)](_0x182949(0x276)),_0x182949(0x17f)),console[_0x182949(0x104)](a31_0x4d24f3['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2c9ad9=await confirmKey(_0x35876b);if(!_0x2c9ad9)return console[_0x182949(0x104)](a31_0x4d24f3['yellow'](_0x182949(0x231))),0x1;}const _0x31417f=_0x35df1c?_0x182949(0x2f1):_0x182949(0x20a);await withSpinner(_0x31417f+'\x20parent\x20segment\x20\x27'+_0x42e0eb+'\x27...',()=>_0x20f759[_0x182949(0x126)](),{'verbose':_0xffcd71[_0x182949(0x10d)]});const _0x1193c2=_0x35df1c?_0x182949(0x2c7):'Updated';console[_0x182949(0x104)]('✔\x20'+_0x1193c2+'\x20parent\x20segment\x20\x27'+_0x42e0eb+'\x27');}else console[_0x182949(0x104)](_0x182949(0x29b)+_0x42e0eb+_0x182949(0x181));}const _0x1e564d=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x54e49e+_0x182949(0x228),()=>_0x53512f[_0x182949(0x200)][_0x182949(0x240)](_0x54e49e),{'verbose':_0xffcd71[_0x182949(0x10d)]}),_0x37037a=_0x1e564d[_0x182949(0x113)],_0x1bead1=getConsoleUrl(_0xffcd71[_0x182949(0x1d6)],_0x182949(0x148)+_0x37037a[_0x182949(0x280)]+_0x182949(0x18e)+_0x37037a[_0x182949(0x1b1)]+_0x182949(0x319)+_0x37037a['workflowAttemptId']);return console['error'](_0x182949(0x132)),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x2da))+'\x20'+_0x37037a[_0x182949(0x190)]),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x118))+'\x20'+_0x37037a[_0x182949(0x13f)]),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3['dim'](_0x182949(0x12a))+'\x20'+_0x37037a['workflowSessionId']),console[_0x182949(0x104)]('\x20\x20'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x13a))+'\x20'+_0x37037a['workflowAttemptId']),console[_0x182949(0x104)]('\x20\x20'+_0x1bead1),console[_0x182949(0x104)]('\x0a'+a31_0x4d24f3[_0x182949(0x2f8)](_0x182949(0x162))+_0x182949(0x11d)+_0x37037a[_0x182949(0x133)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1dd);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x282);async[a31_0xe8811a(0x224)](_0x23f7eb){const _0x1cf8e8=a31_0xe8811a,{options:_0x3e494b,args:_0x437fbc,tdx:_0x1a2ffe}=_0x23f7eb,_0x330a55=_0x437fbc[0x0]||_0x3e494b[_0x1cf8e8(0x13c)];if(!_0x330a55)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'+_0x1cf8e8(0x20c)),0x1;_0x3e494b[_0x1cf8e8(0x10d)]&&(console['error']('Site:\x20'+_0x3e494b[_0x1cf8e8(0x1d6)]),console[_0x1cf8e8(0x104)]('Parent\x20segment:\x20'+_0x330a55));const _0x143828=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x330a55+_0x1cf8e8(0x228),()=>_0x1a2ffe[_0x1cf8e8(0x200)][_0x1cf8e8(0x134)](_0x330a55),{'verbose':_0x3e494b['verbose']}),_0xa603c3=_0x143828['data'];console[_0x1cf8e8(0x104)](_0x1cf8e8(0x245)+_0xa603c3[_0x1cf8e8(0x1a2)]+'\x20field'+(_0xa603c3[_0x1cf8e8(0x1a2)]!==0x1?'s':''));if(_0x3e494b[_0x1cf8e8(0x254)]||_0x3e494b[_0x1cf8e8(0x29a)])return await handleSDKOutput(_0xa603c3,_0x3e494b),0x0;return displayFieldsHumanReadable(_0xa603c3,_0x330a55),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0xe8811a(0x260)]='segment:parent:view';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x16e);async[a31_0xe8811a(0x224)](_0x1d9121){const _0x429e89=a31_0xe8811a,{options:_0x1ea218,args:_0xb7ad30,tdx:_0x3f9330}=_0x1d9121,_0x47eed8=_0x1ea218,_0x4b2d5a=_0xb7ad30[0x0]||_0x1ea218['parentSegment'];if(!_0x4b2d5a)return showParentSegmentNotSetError(_0x429e89(0x1e7)+_0x429e89(0x30d)+_0x429e89(0x217)+_0x429e89(0x11e)),0x1;_0x1ea218[_0x429e89(0x10d)]&&(console[_0x429e89(0x104)]('Site:\x20'+_0x1ea218[_0x429e89(0x1d6)]),console['error']('Parent\x20segment:\x20'+_0x4b2d5a));const _0x3eaf6a=await withSpinner(_0x429e89(0x11b)+_0x4b2d5a+_0x429e89(0x228),()=>_0x3f9330[_0x429e89(0x200)][_0x429e89(0x17c)](_0x4b2d5a),{'verbose':_0x1ea218['verbose']}),_0x98fa35=_0x3eaf6a[_0x429e89(0x113)];if(_0x47eed8['web']){const _0x1d935a=getConsoleNextUrl(_0x47eed8[_0x429e89(0x1d6)],_0x429e89(0x298)+_0x98fa35['id']);return console['error'](a31_0x4d24f3[_0x429e89(0x2af)]('✔')+_0x429e89(0x241)+a31_0x4d24f3[_0x429e89(0x175)](_0x1d935a)),openBrowser(_0x1d935a),0x0;}return await handleSingleObjectOutput(_0x98fa35,_0x1ea218),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']='segment:parent:desc';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x12b);async[a31_0xe8811a(0x224)](_0x74013e){const _0x169d16=a31_0xe8811a,{options:_0x4d8fc5,args:_0x20e531,tdx:_0x62d88}=_0x74013e,_0x143375=_0x4d8fc5,_0x296d32=_0x20e531[0x0]||_0x4d8fc5['parentSegment'];if(!_0x296d32)return showParentSegmentNotSetError(_0x169d16(0x1db)+_0x169d16(0x1bb)+_0x169d16(0x217)+_0x169d16(0x314)),0x1;_0x4d8fc5[_0x169d16(0x10d)]&&(console[_0x169d16(0x104)]('Site:\x20'+_0x4d8fc5[_0x169d16(0x1d6)]),console[_0x169d16(0x104)](_0x169d16(0x177)+_0x296d32));const _0x66220f=await withSpinner(_0x169d16(0x18d)+_0x296d32+_0x169d16(0x228),()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x143)](_0x296d32),{'verbose':_0x4d8fc5[_0x169d16(0x10d)]}),_0x13eecf=_0x66220f['data'],_0xff14d7=_0x62d88[_0x169d16(0x200)][_0x169d16(0x169)](_0x13eecf);if(_0x143375[_0x169d16(0x16f)]){const _0x4e8f9b=await this[_0x169d16(0x2bd)](_0x74013e,_0x296d32,_0x13eecf,_0xff14d7),_0x208f87=this[_0x169d16(0x1d5)](_0x4e8f9b);writeFileSync(_0x143375[_0x169d16(0x16f)],_0x208f87);const _0x1a7b2c=_0x4e8f9b[_0x169d16(0x163)][_0x169d16(0x317)][_0x169d16(0x1a2)]+_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x2ef)]((_0x2d2d45,_0xc2f568)=>_0x2d2d45+_0xc2f568[_0x169d16(0x317)][_0x169d16(0x1a2)],0x0),_0x5870f4=_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x186)](_0x4fb25e=>_0x4fb25e[_0x169d16(0x317)][_0x169d16(0x1a2)]===0x0)[_0x169d16(0x1a2)];return console[_0x169d16(0x253)]('Schema\x20saved\x20to\x20'+_0x143375[_0x169d16(0x16f)]),console['log'](_0x169d16(0x195)+_0xff14d7),console[_0x169d16(0x253)](_0x169d16(0x295)+_0x4e8f9b[_0x169d16(0x243)][_0x169d16(0x1a2)]+'\x20behaviors'),console[_0x169d16(0x253)]('\x20\x20Columns:\x20'+_0x1a7b2c+_0x169d16(0x2e0)),_0x5870f4>0x0&&console[_0x169d16(0x253)](_0x169d16(0x13b)+_0x5870f4+_0x169d16(0x1f1)),0x0;}console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3['bold'](_0x169d16(0x247))+'\x20'+a31_0x4d24f3[_0x169d16(0x175)](_0xff14d7));const _0x923671=await withSpinner(_0x169d16(0x215),()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x1fa)](_0x13eecf),{'verbose':_0x4d8fc5[_0x169d16(0x10d)]});console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3[_0x169d16(0x166)]('customers')+'\x20'+a31_0x4d24f3[_0x169d16(0x2f8)]('('+_0xff14d7+_0x169d16(0x248)));const _0x5f57c5=await executeSchemaQuery(_0x923671[_0x169d16(0x113)],_0x62d88,_0x4d8fc5);await handleQueryOutput(_0x5f57c5,_0x4d8fc5);const _0x229e4b=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x62d88[_0x169d16(0x200)][_0x169d16(0x19c)](_0x13eecf),{'verbose':_0x4d8fc5['verbose']});for(const _0x44933a of _0x229e4b['data']){const _0x522575='behavior_'+_0x44933a[_0x169d16(0x15b)]()['replace'](/\s+/g,'_'),_0xb368c8=_0x169d16(0x142)+_0xff14d7+'.'+_0x522575;console[_0x169d16(0x104)]('\x0a'+a31_0x4d24f3[_0x169d16(0x166)](_0x44933a)+'\x20'+a31_0x4d24f3['dim']('('+_0xff14d7+'.'+_0x522575+')'));try{const _0x5d4014=await executeSchemaQuery(_0xb368c8,_0x62d88,_0x4d8fc5);await handleQueryOutput(_0x5d4014,_0x4d8fc5);}catch{console[_0x169d16(0x104)](a31_0x4d24f3['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a31_0xe8811a(0x2bd)](_0x26a622,_0x1c8927,_0x580e98,_0xda79fe){const _0x2f2ece=a31_0xe8811a,{options:_0x1c5132,tdx:_0x17707b}=_0x26a622,_0x4aad78=await withSpinner(_0x2f2ece(0x215),()=>_0x17707b['segment'][_0x2f2ece(0x1fa)](_0x580e98),{'verbose':_0x1c5132[_0x2f2ece(0x10d)]}),_0x26a38a=await executeSchemaQuery(_0x4aad78[_0x2f2ece(0x113)],_0x17707b,_0x1c5132),_0x1278c0=_0x26a38a[_0x2f2ece(0x113)][_0x2f2ece(0x17e)](_0x1b649b=>({'name':_0x1b649b[_0x2f2ece(0x28e)],'type':_0x1b649b[_0x2f2ece(0x19b)]})),_0x307a91=await withSpinner(_0x2f2ece(0x125),()=>_0x17707b[_0x2f2ece(0x200)][_0x2f2ece(0x19c)](_0x580e98),{'verbose':_0x1c5132[_0x2f2ece(0x10d)]}),_0x429c39=[];for(const _0x3ce39e of _0x307a91[_0x2f2ece(0x113)]){const _0x453fa7=_0x2f2ece(0x144)+_0x3ce39e[_0x2f2ece(0x15b)]()['replace'](/\s+/g,'_'),_0x1ffd2d='SELECT\x20*\x20FROM\x20'+_0xda79fe+'.'+_0x453fa7;let _0x1a498c=[];try{const _0x3f967d=await executeSchemaQuery(_0x1ffd2d,_0x17707b,_0x1c5132);_0x1a498c=_0x3f967d[_0x2f2ece(0x113)][_0x2f2ece(0x17e)](_0x59dfc0=>({'name':_0x59dfc0[_0x2f2ece(0x28e)],'type':_0x59dfc0[_0x2f2ece(0x19b)]}));}catch{}_0x429c39[_0x2f2ece(0x1ed)]({'table':_0x453fa7,'columns':_0x1a498c});}return{'database':_0xda79fe,'parent_segment':_0x1c8927,'parent_id':_0x580e98,'customers':{'table':_0x2f2ece(0x163),'columns':_0x1278c0},'behaviors':_0x429c39};}[a31_0xe8811a(0x1d5)](_0x43db26){const _0x5be76f=a31_0xe8811a,_0x2856e7=_0x42b6cc=>{const _0x3af1a1=a31_0x28cc;if(_0x42b6cc['length']===0x0)return'[]';const _0x2d200d=_0x42b6cc['map'](_0x1df1c0=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x1df1c0[_0x3af1a1(0x260)]+_0x3af1a1(0x227)+_0x1df1c0[_0x3af1a1(0x223)]+_0x3af1a1(0x31d));return'[\x0a'+_0x2d200d[_0x3af1a1(0x31f)](',\x0a')+_0x3af1a1(0x15e);},_0x10cfa4=_0x43db26['behaviors'][_0x5be76f(0x17e)](_0x12ff4e=>{const _0x82339e=_0x5be76f;return _0x82339e(0x13d)+_0x12ff4e[_0x82339e(0x101)]+_0x82339e(0x145)+_0x2856e7(_0x12ff4e['columns'])['replace'](/^/gm,'\x20\x20')[_0x82339e(0x2d1)]()+'\x0a\x20\x20\x20\x20}';})['join'](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x43db26[_0x5be76f(0x153)]+_0x5be76f(0x12e)+_0x43db26[_0x5be76f(0x296)]+_0x5be76f(0x2d7)+_0x43db26[_0x5be76f(0x2e9)]+_0x5be76f(0x1a4)+_0x43db26[_0x5be76f(0x163)][_0x5be76f(0x101)]+_0x5be76f(0x1b7)+_0x2856e7(_0x43db26['customers']['columns'])['replace'](/^/gm,'\x20\x20')[_0x5be76f(0x2d1)]()+_0x5be76f(0x2b2)+_0x10cfa4+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x123);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2e4);async['execute'](_0x55b739){const _0x46b727=a31_0xe8811a,{options:_0x494111,args:_0x24f0d9,tdx:_0x358ecf}=_0x55b739,_0x766379=_0x24f0d9[0x0]||_0x494111[_0x46b727(0x13c)];if(!_0x766379)return showParentSegmentNotSetError(_0x46b727(0x25b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x494111['verbose']&&(console[_0x46b727(0x104)](_0x46b727(0x1e8)+_0x494111[_0x46b727(0x1d6)]),console['error'](_0x46b727(0x177)+_0x766379));const _0x580bb4=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x766379+_0x46b727(0x228),()=>_0x358ecf['segment']['resolveParentId'](_0x766379),{'verbose':_0x494111[_0x46b727(0x10d)]}),_0x3c7240=_0x580bb4[_0x46b727(0x113)],_0xfd1b59=await withSpinner(_0x46b727(0x2e2)+_0x766379+'\x27...',()=>_0x358ecf[_0x46b727(0x200)][_0x46b727(0x1fa)](_0x3c7240),{'verbose':_0x494111[_0x46b727(0x10d)]}),_0x18f1fe=_0xfd1b59[_0x46b727(0x113)];return _0x494111[_0x46b727(0x14d)]===_0x46b727(0x254)||_0x494111[_0x46b727(0x14d)]===_0x46b727(0x29a)?await handleSDKOutput([{'sql':_0x18f1fe}],_0x494111):console[_0x46b727(0x253)](_0x18f1fe),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a31_0xe8811a(0x108);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x15d);async[a31_0xe8811a(0x224)](_0x2570ec){const _0x4b698c=a31_0xe8811a,{options:_0x3ff45b,args:_0x5a2cbd,tdx:_0x768115}=_0x2570ec,_0x56438f=_0x5a2cbd[0x0]||_0x3ff45b[_0x4b698c(0x13c)];if(!_0x56438f)return showParentSegmentNotSetError(_0x4b698c(0x270)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x3ff45b[_0x4b698c(0x10d)]&&(console['error']('Site:\x20'+_0x3ff45b[_0x4b698c(0x1d6)]),console[_0x4b698c(0x104)](_0x4b698c(0x177)+_0x56438f));const _0x5d9327=await withSpinner(_0x4b698c(0x18d)+_0x56438f+_0x4b698c(0x228),()=>_0x768115[_0x4b698c(0x200)][_0x4b698c(0x143)](_0x56438f),{'verbose':_0x3ff45b[_0x4b698c(0x10d)]}),_0x4f89d7=_0x5d9327[_0x4b698c(0x113)],_0x1f7f5d=await withSpinner(_0x4b698c(0x2e2)+_0x56438f+'\x27...',()=>_0x768115[_0x4b698c(0x200)][_0x4b698c(0x1fa)](_0x4f89d7),{'verbose':_0x3ff45b[_0x4b698c(0x10d)]});let _0x583df6=_0x1f7f5d[_0x4b698c(0x113)];const _0xb7473e=resolveLimit(_0x3ff45b[_0x4b698c(0x263)],DEFAULT_DISPLAY_LIMIT),_0x551224=/\bLIMIT\s+\d+/i['test'](_0x583df6);!_0x551224&&(_0x583df6=_0x583df6['trim']()[_0x4b698c(0x2b1)](/;+$/,''),_0x583df6=_0x4b698c(0x226)+_0x583df6+_0x4b698c(0x10f)+_0xb7473e);_0x3ff45b[_0x4b698c(0x10d)]&&console[_0x4b698c(0x104)](_0x4b698c(0x17a)+_0x583df6);const _0x14b2d7=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x19b9d9=>{const _0x4e8b2f=_0x4b698c,_0x3487d7=await _0x768115[_0x4e8b2f(0x246)]['execute'](_0x583df6,{'catalog':'td','schema':_0x4e8b2f(0x100),'onJobId':_0x32deec=>{_0x19b9d9['setJobId'](_0x32deec);}});return _0x3487d7;},{'verbose':_0x3ff45b[_0x4b698c(0x10d)]}),_0x2a9d24=_0x14b2d7[_0x4b698c(0x113)],_0x355c48=_0x2a9d24[_0x4b698c(0x2d6)]?_0x4b698c(0x285)+_0x2a9d24[_0x4b698c(0x2d6)]+']':'';return console[_0x4b698c(0x104)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x2a9d24[_0x4b698c(0x242)][_0x4b698c(0x211)][_0x4b698c(0x1cd)]()+_0x4b698c(0x23c)+(_0x4b698c(0x21f)+formatElapsed(_0x2a9d24[_0x4b698c(0x242)]['elapsedTimeMillis'])+_0x355c48)),await handleQueryOutput(_0x2a9d24,_0x3ff45b),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x29d);[a31_0xe8811a(0x2ab)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a31_0xe8811a(0x224)](_0x3951ed){const _0x7860e1=a31_0xe8811a,{options:_0x2ebda6,args:_0x5f4def,tdx:_0x5b7c27}=_0x3951ed,_0x161aa6=_0x5f4def[0x0],_0x4935ff=await withSpinner(_0x161aa6?_0x7860e1(0x105)+_0x161aa6+_0x7860e1(0x228):_0x7860e1(0x20b),()=>_0x5b7c27['realtime'][_0x7860e1(0x12f)](),{'verbose':_0x2ebda6[_0x7860e1(0x10d)]});let _0x4f5b22=_0x4935ff[_0x7860e1(0x113)]['filter'](_0x4a8514=>_0x4a8514[_0x7860e1(0x274)]);if(_0x161aa6){const _0x4def17=_0x161aa6[_0x7860e1(0x2b1)](/[.+^${}()|[\]\\]/g,_0x7860e1(0x22e))[_0x7860e1(0x2b1)](/\*/g,'.*')[_0x7860e1(0x2b1)](/\?/g,'.'),_0x227058=new RegExp('^'+_0x4def17+'$','i');_0x4f5b22=_0x4f5b22[_0x7860e1(0x186)](_0x53adc9=>_0x227058[_0x7860e1(0x26b)](_0x53adc9[_0x7860e1(0x260)]));}_0x4f5b22[_0x7860e1(0x202)]((_0x2743a0,_0x3a6e8d)=>_0x2743a0[_0x7860e1(0x260)][_0x7860e1(0x25d)](_0x3a6e8d[_0x7860e1(0x260)])),console[_0x7860e1(0x104)](_0x7860e1(0x245)+_0x4f5b22[_0x7860e1(0x1a2)]+_0x7860e1(0x2a0)+(_0x4f5b22['length']!==0x1?'s':''));const _0x216b7b=_0x495452=>{const _0x2c324b=_0x7860e1;return getConsoleNextUrl(_0x2ebda6[_0x2c324b(0x1d6)],_0x2c324b(0x298)+_0x495452);};if(_0x2ebda6[_0x7860e1(0x14d)]==='json'||_0x2ebda6[_0x7860e1(0x14d)]===_0x7860e1(0x29a)){const _0x5b1ce1=_0x4f5b22[_0x7860e1(0x17e)](_0x200bb6=>({..._0x200bb6,'url':_0x216b7b(_0x200bb6['id'])}));await handleSDKOutput(_0x5b1ce1,_0x2ebda6);}else{if(_0x4f5b22['length']===0x0)console['log'](_0x7860e1(0x2b4));else for(const _0x26ed49 of _0x4f5b22){const _0x56bdb8=_0x26ed49['population']?a31_0x4d24f3[_0x7860e1(0x2f8)]('\x20('+formatRows(_0x26ed49[_0x7860e1(0x154)])+')'):'',_0x4224e8=hyperlink(_0x26ed49[_0x7860e1(0x260)],_0x216b7b(_0x26ed49['id']));console['log']('⚡\x20'+_0x4224e8+_0x56bdb8);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x27e);['description']=a31_0xe8811a(0x287);async['execute'](_0x12a9a4){const _0x5ccba2=a31_0xe8811a,{options:_0x55b1bc,args:_0x5e6b9f,tdx:_0x319bc4}=_0x12a9a4,_0x3310af=_0x5e6b9f[0x0]||_0x55b1bc['parentSegment'];if(!_0x3310af)return showParentSegmentNotSetError(_0x5ccba2(0x21c)+_0x5ccba2(0x194)),0x1;const _0x126a91=resolveYamlFile(_0x3310af);if(!existsSync(_0x126a91))return showFileNotFoundError(_0x126a91,_0x3310af),0x1;let _0x63bc18;try{_0x63bc18=readFileSync(_0x126a91,_0x5ccba2(0x29f));}catch(_0x3c3cd5){const _0x5089c9=_0x3c3cd5 instanceof Error?_0x3c3cd5[_0x5ccba2(0x205)]:String(_0x3c3cd5);return console[_0x5ccba2(0x104)]('Error\x20reading\x20file:\x20'+_0x5089c9),0x1;}const _0xd70d02=createCommandSpinner(a31_0x4d24f3[_0x5ccba2(0x2f8)](_0x5ccba2(0x312)),{'verbose':_0x55b1bc['verbose']});_0xd70d02['start']();const _0x3eb533={'realtime':!![],'onProgress':_0x4af32d=>{const _0x33bbfe=_0x5ccba2;_0xd70d02[_0x33bbfe(0x1be)]=formatProgressMessage(_0x4af32d);}};let _0x1246bb;try{_0x1246bb=await _0x319bc4[_0x5ccba2(0x200)][_0x5ccba2(0x2b6)](_0x63bc18,_0x3eb533),_0xd70d02[_0x5ccba2(0x1e3)]();}catch(_0x5246fc){_0xd70d02[_0x5ccba2(0x1e3)]();throw _0x5246fc;}console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3[_0x5ccba2(0x166)](_0x5ccba2(0x2cd))+'\x20'+_0x1246bb[_0x5ccba2(0x260)]),console[_0x5ccba2(0x104)]('═'[_0x5ccba2(0x290)](0x3c)),displayRealtimeValidation(_0x1246bb),console[_0x5ccba2(0x104)]('─'['repeat'](0x3c));if(_0x1246bb['errors'][_0x5ccba2(0x1a2)]>0x0){console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3['red'](_0x5ccba2(0x297)));for(const _0xd52bf1 of _0x1246bb[_0x5ccba2(0x188)]){console['error']('\x20\x20'+a31_0x4d24f3[_0x5ccba2(0x2f4)]('•')+'\x20'+_0xd52bf1);}}return _0x1246bb['allValid']&&console[_0x5ccba2(0x104)]('\x0a'+a31_0x4d24f3[_0x5ccba2(0x2af)]('✔')+_0x5ccba2(0x1b2)),_0x1246bb[_0x5ccba2(0x307)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1a9);['description']=a31_0xe8811a(0x1c9);async[a31_0xe8811a(0x224)](_0x5f3c43){const _0x5aed30=a31_0xe8811a,{options:_0x2b81ea,args:_0x22d9b5,tdx:_0x309d44}=_0x5f3c43,_0x32a5c0=_0x22d9b5[0x0]||_0x2b81ea['parentSegment'];if(!_0x32a5c0)return showParentSegmentNotSetError(_0x5aed30(0x2fa)+'\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;_0x2b81ea[_0x5aed30(0x10d)]&&(console[_0x5aed30(0x104)]('Site:\x20'+_0x2b81ea[_0x5aed30(0x1d6)]),console[_0x5aed30(0x104)](_0x5aed30(0x177)+_0x32a5c0));const _0x270803=await withSpinner(_0x5aed30(0x18d)+_0x32a5c0+_0x5aed30(0x228),()=>_0x309d44[_0x5aed30(0x200)]['resolveParentId'](_0x32a5c0),{'verbose':_0x2b81ea[_0x5aed30(0x10d)]}),_0x3505d1=_0x270803[_0x5aed30(0x113)],_0x2a0c43=await withSpinner(_0x5aed30(0x1c4)+_0x32a5c0+'\x27...',()=>_0x309d44[_0x5aed30(0x10e)]['listJourneys'](_0x3505d1),{'verbose':_0x2b81ea[_0x5aed30(0x10d)]}),_0x146296=_0x2a0c43[_0x5aed30(0x113)];console['error'](_0x5aed30(0x245)+_0x146296[_0x5aed30(0x1a2)]+_0x5aed30(0x23d)+(_0x146296['length']!==0x1?'s':''));if(_0x2b81ea[_0x5aed30(0x14d)]===_0x5aed30(0x254)||_0x2b81ea['format']===_0x5aed30(0x29a))await handleSDKOutput(_0x146296,_0x2b81ea);else{if(_0x146296['length']===0x0)console['log']('No\x20RT\x20journeys\x20found');else for(const _0x5b84af of _0x146296){const _0x1a18a1=_0x5b84af[_0x5aed30(0x311)]===_0x5aed30(0x251)?'🚀':'📝',_0x54aa1e=_0x5b84af[_0x5aed30(0x222)]?a31_0x4d24f3[_0x5aed30(0x1a7)](_0x5aed30(0x1d0)):'',_0x4ef998=a31_0x4d24f3[_0x5aed30(0x2f8)]('\x20('+_0x5b84af[_0x5aed30(0x1b6)]+'\x20stage'+(_0x5b84af['stageCount']!==0x1?'s':'')+')');console['log'](_0x1a18a1+'\x20'+_0x5b84af[_0x5aed30(0x260)]+_0x54aa1e+_0x4ef998);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x258);['description']=a31_0xe8811a(0x2dc);async[a31_0xe8811a(0x224)](_0x52927e){const _0x547e90=a31_0xe8811a,{options:_0x4d4db5,args:_0x1fd824,tdx:_0x212165}=_0x52927e,_0xacc183=_0x1fd824[0x0];if(!_0xacc183)return console[_0x547e90(0x104)](a31_0x4d24f3[_0x547e90(0x2f4)]('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x547e90(0x104)](_0x547e90(0x122)),console['error'](a31_0x4d24f3[_0x547e90(0x2f8)](_0x547e90(0x288))),0x1;_0x4d4db5['verbose']&&(console['error'](_0x547e90(0x1e8)+_0x4d4db5[_0x547e90(0x1d6)]),console[_0x547e90(0x104)](_0x547e90(0x28d)+_0xacc183));const _0x10e1e1=await withSpinner(_0x547e90(0x28a)+_0xacc183+_0x547e90(0x228),()=>_0x212165['realtime'][_0x547e90(0x2f6)](_0xacc183),{'verbose':_0x4d4db5[_0x547e90(0x10d)]}),_0x1def9d=_0x10e1e1[_0x547e90(0x113)];console['error']('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x1def9d[_0x547e90(0x260)]+'\x27');if(_0x4d4db5[_0x547e90(0x14d)]==='json'||_0x4d4db5[_0x547e90(0x14d)]===_0x547e90(0x29a))await handleSDKOutput([_0x1def9d],_0x4d4db5);else{const _0x5c7cd4=_0x1def9d['state']===_0x547e90(0x251)?'🚀':'📝',_0x429911=_0x1def9d[_0x547e90(0x222)]?a31_0x4d24f3[_0x547e90(0x1a7)]('\x20(paused)'):'';console[_0x547e90(0x253)](_0x5c7cd4+'\x20'+_0x1def9d[_0x547e90(0x260)]+_0x429911);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{['name']='ps:rt:jn:resume';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x173);async[a31_0xe8811a(0x224)](_0x3541f8){const _0x10a788=a31_0xe8811a,{options:_0x593d5c,args:_0x3ca34a,tdx:_0x395986}=_0x3541f8,_0xdb571c=_0x3ca34a[0x0];if(!_0xdb571c)return console['error'](a31_0x4d24f3[_0x10a788(0x2f4)](_0x10a788(0x2bf))),console[_0x10a788(0x104)](_0x10a788(0x302)),console[_0x10a788(0x104)](a31_0x4d24f3['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x593d5c[_0x10a788(0x10d)]&&(console[_0x10a788(0x104)](_0x10a788(0x1e8)+_0x593d5c['site']),console[_0x10a788(0x104)](_0x10a788(0x28d)+_0xdb571c));const _0x234646=await withSpinner(_0x10a788(0x1a8)+_0xdb571c+_0x10a788(0x228),()=>_0x395986[_0x10a788(0x10e)]['resumeJourney'](_0xdb571c),{'verbose':_0x593d5c['verbose']}),_0x1fa8a1=_0x234646[_0x10a788(0x113)];console[_0x10a788(0x104)](_0x10a788(0x236)+_0x1fa8a1[_0x10a788(0x260)]+'\x27');if(_0x593d5c['format']==='json'||_0x593d5c[_0x10a788(0x14d)]===_0x10a788(0x29a))await handleSDKOutput([_0x1fa8a1],_0x593d5c);else{const _0x2683d4=_0x1fa8a1[_0x10a788(0x311)]===_0x10a788(0x251)?'🚀':'📝',_0x2af501=_0x1fa8a1[_0x10a788(0x222)]?a31_0x4d24f3['yellow'](_0x10a788(0x1d0)):'';console[_0x10a788(0x253)](_0x2683d4+'\x20'+_0x1fa8a1[_0x10a788(0x260)]+_0x2af501);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{['name']=a31_0xe8811a(0x2fb);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x183);async[a31_0xe8811a(0x224)](_0x298986){const _0x2a2fde=a31_0xe8811a,{options:_0x3b0a63,args:_0x370645,tdx:_0x668b7e}=_0x298986,_0xeb438f=_0x370645[0x0]||_0x3b0a63[_0x2a2fde(0x13c)];if(!_0xeb438f)return showParentSegmentNotSetError(_0x2a2fde(0x267)+_0x2a2fde(0x25a)),0x1;_0x3b0a63['verbose']&&(console[_0x2a2fde(0x104)](_0x2a2fde(0x1e8)+_0x3b0a63['site']),console[_0x2a2fde(0x104)](_0x2a2fde(0x177)+_0xeb438f));const _0x395087=await withSpinner(_0x2a2fde(0x18d)+_0xeb438f+_0x2a2fde(0x228),()=>_0x668b7e[_0x2a2fde(0x200)][_0x2a2fde(0x143)](_0xeb438f),{'verbose':_0x3b0a63['verbose']}),_0x5766ad=_0x395087['data'],_0xcc9d9b=await withSpinner(_0x2a2fde(0x15f)+_0xeb438f+_0x2a2fde(0x228),()=>_0x668b7e[_0x2a2fde(0x10e)]['getCurrentConfigVersion'](_0x5766ad),{'verbose':_0x3b0a63[_0x2a2fde(0x10d)]}),_0x40219a=_0xcc9d9b[_0x2a2fde(0x113)];return console[_0x2a2fde(0x104)](_0x2a2fde(0x27b)),_0x3b0a63[_0x2a2fde(0x14d)]===_0x2a2fde(0x254)||_0x3b0a63[_0x2a2fde(0x14d)]==='jsonl'?await handleSDKOutput([_0x40219a],_0x3b0a63):(console[_0x2a2fde(0x253)]('id:\x20'+_0x40219a['id']),console[_0x2a2fde(0x253)](_0x2a2fde(0x278)+_0x40219a['audienceId']),console[_0x2a2fde(0x253)]('identifier:\x20'+_0x40219a[_0x2a2fde(0x1a3)]),console[_0x2a2fde(0x253)]('eventKind:\x20'+_0x40219a['eventKind']),console[_0x2a2fde(0x253)](_0x2a2fde(0x25c)+_0x40219a[_0x2a2fde(0x13f)])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:list';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2f7);async[a31_0xe8811a(0x224)](_0x57ba45){const _0x3b834a=a31_0xe8811a,{options:_0x2f8524,args:_0x5356bf,tdx:_0x9ec086}=_0x57ba45,_0x59d425=_0x5356bf[0x0]||_0x2f8524['parentSegment'];if(!_0x59d425)return showParentSegmentNotSetError(_0x3b834a(0x2dd)+_0x3b834a(0x1ce)),0x1;const _0x283810=await withSpinner(_0x3b834a(0x18d)+_0x59d425+_0x3b834a(0x228),()=>_0x9ec086['segment'][_0x3b834a(0x143)](_0x59d425),{'verbose':_0x2f8524['verbose']}),_0xa1209a=_0x283810[_0x3b834a(0x113)],_0x16e49b=await withSpinner(_0x3b834a(0x25f)+_0x59d425+_0x3b834a(0x228),()=>_0x9ec086[_0x3b834a(0x20d)]['list'](_0xa1209a),{'verbose':_0x2f8524[_0x3b834a(0x10d)]}),_0x473c72=_0x16e49b['data'];console[_0x3b834a(0x104)](_0x3b834a(0x245)+_0x473c72[_0x3b834a(0x1a2)]+_0x3b834a(0x121)+(_0x473c72[_0x3b834a(0x1a2)]!==0x1?'s':''));if(_0x2f8524[_0x3b834a(0x14d)]===_0x3b834a(0x254)||_0x2f8524['format']==='jsonl')await handleSDKOutput(_0x473c72,_0x2f8524);else{if(_0x473c72[_0x3b834a(0x1a2)]===0x0)console[_0x3b834a(0x253)]('No\x20personalization\x20services\x20configured'),console['error'](a31_0x4d24f3[_0x3b834a(0x175)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x2a2118 of _0x473c72){console[_0x3b834a(0x253)](a31_0x4d24f3[_0x3b834a(0x166)](_0x2a2118[_0x3b834a(0x260)])+'\x20'+a31_0x4d24f3['dim'](_0x3b834a(0x22c)+_0x2a2118['id']+')'));_0x2a2118['description']&&console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x2a2118[_0x3b834a(0x2ab)]));if(_0x2a2118[_0x3b834a(0x218)]&&_0x2a2118[_0x3b834a(0x218)][_0x3b834a(0x1a2)]>0x0)for(const _0x57a6ed of _0x2a2118[_0x3b834a(0x218)]){const _0x340b43=_0x57a6ed[_0x3b834a(0x1dc)]?.[_0x3b834a(0x1a2)]?_0x57a6ed[_0x3b834a(0x1dc)][_0x3b834a(0x31f)](',\x20'):_0x3b834a(0x203);console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x3b834a(0x321))+'\x20'+_0x57a6ed[_0x3b834a(0x260)]+'\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x3b834a(0x22c)+_0x57a6ed['id']+')')),console[_0x3b834a(0x253)](_0x3b834a(0x2d5)+a31_0x4d24f3['dim'](_0x3b834a(0x1ea))+'\x20'+_0x340b43);}else console[_0x3b834a(0x253)]('\x20\x20'+a31_0x4d24f3[_0x3b834a(0x2f8)](_0x3b834a(0x120)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x261);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x131);async[a31_0xe8811a(0x224)](_0x44150f){const _0x4a97d0=a31_0xe8811a,{options:_0x5e6e75,args:_0x1af8fa,tdx:_0xfa932b}=_0x44150f,_0x242205=_0x5e6e75,_0x29eb48=_0x1af8fa[0x0],_0x276845=_0x1af8fa[0x1]||_0x5e6e75[_0x4a97d0(0x13c)];if(!_0x29eb48)return console[_0x4a97d0(0x104)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x4a97d0(0x104)](_0x4a97d0(0x286)),console[_0x4a97d0(0x104)](_0x4a97d0(0x1f9)),0x1;if(!_0x276845)return showParentSegmentNotSetError(_0x4a97d0(0x160)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x3ad689=await withSpinner(_0x4a97d0(0x18d)+_0x276845+'\x27...',()=>_0xfa932b[_0x4a97d0(0x200)][_0x4a97d0(0x143)](_0x276845),{'verbose':_0x5e6e75[_0x4a97d0(0x10d)]}),_0x2f33b0=_0x3ad689[_0x4a97d0(0x113)],_0x486bcd={'name':_0x29eb48,'description':_0x242205[_0x4a97d0(0x2ab)],'public':_0x242205[_0x4a97d0(0x262)]},_0x3a016f=await withSpinner(_0x4a97d0(0x19d)+_0x29eb48+_0x4a97d0(0x228),()=>_0xfa932b[_0x4a97d0(0x20d)]['create'](_0x2f33b0,_0x486bcd),{'verbose':_0x5e6e75[_0x4a97d0(0x10d)]}),_0x473f6e=_0x3a016f[_0x4a97d0(0x113)];return console['error'](_0x4a97d0(0x292)+_0x473f6e['name']+_0x4a97d0(0x2b3)+_0x473f6e['id']),await handleSDKOutput([_0x473f6e],_0x5e6e75),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x201);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x219);async[a31_0xe8811a(0x224)](_0x385e52){const _0x52727f=a31_0xe8811a,{options:_0x54dc5a,args:_0x10f8d3,tdx:_0x3f95f5}=_0x385e52,_0x5f4ae7=_0x10f8d3[0x0],_0x1533d2=_0x10f8d3[0x1]||_0x54dc5a[_0x52727f(0x13c)];if(!_0x5f4ae7)return console['error'](_0x52727f(0x106)),console[_0x52727f(0x104)](_0x52727f(0x303)),console[_0x52727f(0x104)](_0x52727f(0x1f4)),0x1;if(!_0x1533d2)return showParentSegmentNotSetError(_0x52727f(0x1fd)+_0x52727f(0x1f4)),0x1;const _0x50abd9=await withSpinner(_0x52727f(0x18d)+_0x1533d2+_0x52727f(0x228),()=>_0x3f95f5[_0x52727f(0x200)][_0x52727f(0x143)](_0x1533d2),{'verbose':_0x54dc5a[_0x52727f(0x10d)]}),_0xb9abd5=_0x50abd9[_0x52727f(0x113)],_0x51c209=await withSpinner('Fetching\x20personalization\x20service\x20\x27'+_0x5f4ae7+_0x52727f(0x228),()=>_0x3f95f5[_0x52727f(0x20d)][_0x52727f(0x2a2)](_0xb9abd5,_0x5f4ae7),{'verbose':_0x54dc5a[_0x52727f(0x10d)]}),_0x357a76=_0x51c209[_0x52727f(0x113)];if(_0x54dc5a[_0x52727f(0x254)]||_0x54dc5a['jsonl'])await handleSDKOutput([_0x357a76],_0x54dc5a);else{console['log'](a31_0x4d24f3[_0x52727f(0x166)](_0x357a76['name'])+'\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x22c)+_0x357a76['id']+')'));_0x357a76[_0x52727f(0x2ab)]&&console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3['dim'](_0x357a76['description']));console['log']('\x20\x20'+a31_0x4d24f3[_0x52727f(0x175)](_0x52727f(0x232))+'\x20'+(_0x357a76[_0x52727f(0x262)]?'yes':'no'));if(_0x357a76[_0x52727f(0x218)]&&_0x357a76['tokens'][_0x52727f(0x1a2)]>0x0)for(const _0x18f90a of _0x357a76[_0x52727f(0x218)]){const _0x4b2ee8=_0x18f90a[_0x52727f(0x1dc)]?.['length']?_0x18f90a[_0x52727f(0x1dc)]['join'](',\x20'):_0x52727f(0x203);console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3['cyan'](_0x52727f(0x321))+'\x20'+_0x18f90a[_0x52727f(0x260)]+'\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x22c)+_0x18f90a['id']+')')),console[_0x52727f(0x253)](_0x52727f(0x2d5)+a31_0x4d24f3['dim'](_0x52727f(0x1ea))+'\x20'+_0x4b2ee8);}else console[_0x52727f(0x253)]('\x20\x20'+a31_0x4d24f3[_0x52727f(0x2f8)](_0x52727f(0x120)));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{['name']=a31_0xe8811a(0x2d2);['description']='Delete\x20a\x20personalization\x20service';async['execute'](_0x21073e){const _0x143f3c=a31_0xe8811a,{options:_0x3f5b18,args:_0x127d34,tdx:_0x4092a0}=_0x21073e,_0x2d5859=_0x127d34[0x0],_0x330a6b=_0x127d34[0x1]||_0x3f5b18[_0x143f3c(0x13c)];if(!_0x2d5859)return console[_0x143f3c(0x104)](_0x143f3c(0x106)),console[_0x143f3c(0x104)](_0x143f3c(0x1bd)),console[_0x143f3c(0x104)](_0x143f3c(0x2ee)),0x1;if(!_0x330a6b)return showParentSegmentNotSetError(_0x143f3c(0x266)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x10f31f=await withSpinner(_0x143f3c(0x18d)+_0x330a6b+_0x143f3c(0x228),()=>_0x4092a0[_0x143f3c(0x200)][_0x143f3c(0x143)](_0x330a6b),{'verbose':_0x3f5b18[_0x143f3c(0x10d)]}),_0x399f17=_0x10f31f[_0x143f3c(0x113)];return await withSpinner(_0x143f3c(0x1cb)+_0x2d5859+_0x143f3c(0x228),()=>_0x4092a0[_0x143f3c(0x20d)][_0x143f3c(0x23b)](_0x399f17,_0x2d5859),{'verbose':_0x3f5b18[_0x143f3c(0x10d)]}),console['error'](_0x143f3c(0x31e)+_0x2d5859+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:update';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x152);async[a31_0xe8811a(0x224)](_0x21aefe){const _0x395829=a31_0xe8811a,{options:_0x334de9,args:_0x3747b7,tdx:_0x34724b}=_0x21aefe,_0x3f462e=_0x334de9,_0x1a4678=_0x3747b7[0x0],_0x23d8c3=_0x3747b7[0x1]||_0x334de9['parentSegment'];if(!_0x1a4678)return console[_0x395829(0x104)](_0x395829(0x106)),console[_0x395829(0x104)](_0x395829(0x293)),console[_0x395829(0x104)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x3f462e[_0x395829(0x260)])return console[_0x395829(0x104)]('Error:\x20--name\x20is\x20required'),console['error'](_0x395829(0x293)),0x1;if(!_0x23d8c3)return showParentSegmentNotSetError(_0x395829(0x250)+_0x395829(0xfe)),0x1;const _0x9058e4=await withSpinner(_0x395829(0x18d)+_0x23d8c3+_0x395829(0x228),()=>_0x34724b['segment'][_0x395829(0x143)](_0x23d8c3),{'verbose':_0x334de9[_0x395829(0x10d)]}),_0xf315a9=_0x9058e4[_0x395829(0x113)],_0x3879b6={'name':_0x3f462e[_0x395829(0x260)]};_0x3f462e['description']!==undefined&&(_0x3879b6[_0x395829(0x2ab)]=_0x3f462e[_0x395829(0x2ab)]);const _0x47f5e7=await withSpinner(_0x395829(0x1b5)+_0x1a4678+_0x395829(0x228),()=>_0x34724b['personalization'][_0x395829(0x164)](_0xf315a9,_0x1a4678,_0x3879b6),{'verbose':_0x334de9[_0x395829(0x10d)]}),_0x4f7056=_0x47f5e7[_0x395829(0x113)];return console[_0x395829(0x104)]('✔\x20Updated\x20personalization\x20service\x20\x27'+_0x4f7056[_0x395829(0x260)]+'\x27'),await handleSDKOutput([_0x4f7056],_0x334de9),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:token:create';[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x1ca);async[a31_0xe8811a(0x224)](_0x2f8de8){const _0x4a2a18=a31_0xe8811a,{options:_0x5794f9,args:_0x21ab0f,tdx:_0x280647}=_0x2f8de8,_0x478392=_0x5794f9,_0x202918=_0x21ab0f[0x0],_0x3339ce=_0x21ab0f[0x1],_0x57f975=_0x21ab0f[0x2]||_0x5794f9[_0x4a2a18(0x13c)];if(!_0x202918)return console[_0x4a2a18(0x104)]('Error:\x20Token\x20name\x20is\x20required'),console[_0x4a2a18(0x104)](_0x4a2a18(0x2f9)),console['error'](_0x4a2a18(0x156)),0x1;if(!_0x3339ce)return console[_0x4a2a18(0x104)]('Error:\x20Service\x20ID\x20is\x20required'),console[_0x4a2a18(0x104)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x4a2a18(0x104)](_0x4a2a18(0x156)),0x1;if(!_0x57f975)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a'+_0x4a2a18(0x156)),0x1;const _0x31a243=await withSpinner(_0x4a2a18(0x18d)+_0x57f975+_0x4a2a18(0x228),()=>_0x280647[_0x4a2a18(0x200)]['resolveParentId'](_0x57f975),{'verbose':_0x5794f9[_0x4a2a18(0x10d)]}),_0x2661fa=_0x31a243[_0x4a2a18(0x113)],_0x44defe={'name':_0x202918};_0x478392[_0x4a2a18(0x1dc)]&&(_0x44defe[_0x4a2a18(0x1dc)]=_0x478392[_0x4a2a18(0x1dc)][_0x4a2a18(0x17d)](',')[_0x4a2a18(0x17e)](_0x4c37f7=>_0x4c37f7[_0x4a2a18(0x2d1)]()));_0x478392[_0x4a2a18(0x2ab)]&&(_0x44defe[_0x4a2a18(0x2ab)]=_0x478392[_0x4a2a18(0x2ab)]);const _0x258880=await withSpinner(_0x4a2a18(0x119)+_0x202918+_0x4a2a18(0x174)+_0x3339ce+_0x4a2a18(0x228),()=>_0x280647['personalization'][_0x4a2a18(0x116)](_0x2661fa,_0x3339ce,_0x44defe),{'verbose':_0x5794f9['verbose']}),_0x173836=_0x258880['data'];return console[_0x4a2a18(0x104)](_0x4a2a18(0x1e5)+_0x173836[_0x4a2a18(0x260)]+_0x4a2a18(0x2b3)+_0x173836['id']),_0x173836[_0x4a2a18(0x1c2)]&&(console[_0x4a2a18(0x104)](a31_0x4d24f3[_0x4a2a18(0x1a7)](_0x4a2a18(0x1ec))),console['error'](a31_0x4d24f3['cyan'](_0x173836[_0x4a2a18(0x1c2)])),console['error']('')),await handleSDKOutput([_0x173836],_0x5794f9),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:service:token:delete';['description']=a31_0xe8811a(0x238);async[a31_0xe8811a(0x224)](_0x51b012){const _0x59d610=a31_0xe8811a,{options:_0x46f7fc,args:_0x1923fd,tdx:_0x15f1c}=_0x51b012,_0x11d6c4=_0x1923fd[0x0],_0x7dd43e=_0x1923fd[0x1]||_0x46f7fc[_0x59d610(0x13c)];if(!_0x11d6c4)return console['error'](_0x59d610(0x103)),console[_0x59d610(0x104)](_0x59d610(0x139)),console[_0x59d610(0x104)](_0x59d610(0x315)),0x1;if(!_0x7dd43e)return showParentSegmentNotSetError(_0x59d610(0x2b9)+_0x59d610(0x315)),0x1;const _0x52a56f=await withSpinner(_0x59d610(0x18d)+_0x7dd43e+_0x59d610(0x228),()=>_0x15f1c[_0x59d610(0x200)][_0x59d610(0x143)](_0x7dd43e),{'verbose':_0x46f7fc['verbose']}),_0x3a9081=_0x52a56f[_0x59d610(0x113)],_0x4eaf10=await withSpinner(_0x59d610(0x107),()=>_0x15f1c['personalization'][_0x59d610(0x12f)](_0x3a9081),{'verbose':_0x46f7fc[_0x59d610(0x10d)]}),_0x1bbec6=_0x4eaf10[_0x59d610(0x113)];let _0x3a8b57;for(const _0x255733 of _0x1bbec6){if(_0x255733['tokens']?.[_0x59d610(0x17b)](_0x4e56cd=>_0x4e56cd['id']===_0x11d6c4)){_0x3a8b57=_0x255733['id'];break;}}if(!_0x3a8b57)return console[_0x59d610(0x104)](_0x59d610(0x2a6)+_0x11d6c4+_0x59d610(0x2fe)),0x1;const _0x4f8f61=await withSpinner(_0x59d610(0x273)+_0x11d6c4+_0x59d610(0x228),()=>_0x15f1c['personalization'][_0x59d610(0x185)](_0x3a9081,_0x3a8b57,_0x11d6c4),{'verbose':_0x46f7fc[_0x59d610(0x10d)]}),_0x42c3ed=_0x4f8f61['data'];return console[_0x59d610(0x104)](_0x59d610(0x24b)+(_0x42c3ed[_0x59d610(0x260)]||_0x11d6c4)+'\x27'),await handleSDKOutput([_0x42c3ed],_0x46f7fc),0x0;}}export class PSPzListCommand extends BaseCommand{[a31_0xe8811a(0x260)]='ps:pz:list';[a31_0xe8811a(0x2ab)]='List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment';async['execute'](_0x2e71c6){const _0x4ba230=a31_0xe8811a,{options:_0x2e6d4d,args:_0x49ccf0,tdx:_0x12231b}=_0x2e71c6,_0x46a100=_0x49ccf0[0x0]||_0x2e6d4d[_0x4ba230(0x13c)];if(!_0x46a100)return showParentSegmentNotSetError(_0x4ba230(0x130)+'\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 _0x40eb64=await withSpinner(_0x4ba230(0x18d)+_0x46a100+'\x27...',()=>_0x12231b[_0x4ba230(0x200)][_0x4ba230(0x143)](_0x46a100),{'verbose':_0x2e6d4d[_0x4ba230(0x10d)]}),_0x54e7c3=_0x40eb64[_0x4ba230(0x113)],_0x5900fd=await withSpinner(_0x4ba230(0x111)+_0x46a100+_0x4ba230(0x228),()=>_0x12231b[_0x4ba230(0x20d)][_0x4ba230(0x27d)](_0x54e7c3),{'verbose':_0x2e6d4d[_0x4ba230(0x10d)]}),_0x21aa7a=_0x5900fd[_0x4ba230(0x113)];console[_0x4ba230(0x104)]('✔\x20Found\x20'+_0x21aa7a[_0x4ba230(0x1a2)]+_0x4ba230(0x1f8)+(_0x21aa7a[_0x4ba230(0x1a2)]!==0x1?'s':''));if(_0x2e6d4d[_0x4ba230(0x14d)]===_0x4ba230(0x254)||_0x2e6d4d[_0x4ba230(0x14d)]==='jsonl')await handleSDKOutput(_0x21aa7a,_0x2e6d4d);else{if(_0x21aa7a['length']===0x0)console['log'](_0x4ba230(0x2c8));else for(const _0x4824de of _0x21aa7a){console['log'](a31_0x4d24f3[_0x4ba230(0x166)](_0x4824de[_0x4ba230(0x260)])+'\x20'+a31_0x4d24f3[_0x4ba230(0x2f8)]('(id:\x20'+_0x4824de['id']+')'));_0x4824de[_0x4ba230(0x2ab)]&&console['log']('\x20\x20'+a31_0x4d24f3['dim'](_0x4824de[_0x4ba230(0x2ab)]));const _0x27cbbe=_0x4824de[_0x4ba230(0x209)]?.['length']||0x0;console[_0x4ba230(0x253)]('\x20\x20'+a31_0x4d24f3[_0x4ba230(0x175)](_0x4ba230(0x306))+'\x20'+_0x27cbbe);if(_0x4824de['sections']&&_0x4824de['sections']['length']>0x0)for(const _0xa9abf7 of _0x4824de['sections']){console['log'](_0x4ba230(0x2aa)+_0xa9abf7[_0x4ba230(0x260)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1ef);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x221);async['execute'](_0x35068c){const _0x504eb0=a31_0xe8811a,{options:_0x21c3c6,args:_0x6bf0ad,tdx:_0x22d54c}=_0x35068c,_0x767a9f=_0x6bf0ad[0x0];if(!_0x767a9f)return console[_0x504eb0(0x104)](_0x504eb0(0x198)),console['error'](_0x504eb0(0x1f5)),0x1;const _0x1a6e8b=await withSpinner(_0x504eb0(0x179)+_0x767a9f+'\x27...',()=>_0x22d54c[_0x504eb0(0x20d)][_0x504eb0(0x20f)](_0x767a9f),{'verbose':_0x21c3c6[_0x504eb0(0x10d)]}),_0x305198=_0x1a6e8b[_0x504eb0(0x113)];console[_0x504eb0(0x104)](_0x504eb0(0x199)+_0x305198[_0x504eb0(0x260)]+'\x27');if(_0x21c3c6[_0x504eb0(0x14d)]===_0x504eb0(0x254)||_0x21c3c6['format']==='jsonl')await handleSDKOutput([_0x305198],_0x21c3c6);else{console[_0x504eb0(0x253)](a31_0x4d24f3[_0x504eb0(0x166)](_0x305198[_0x504eb0(0x260)])+'\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)]('(id:\x20'+_0x305198['id']+')'));_0x305198[_0x504eb0(0x2ab)]&&console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)](_0x305198[_0x504eb0(0x2ab)]));_0x305198[_0x504eb0(0x190)]&&console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x281))+'\x20'+_0x305198[_0x504eb0(0x190)]);console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x19f))+'\x20'+_0x305198['createdAt']),console[_0x504eb0(0x253)]('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1e1))+'\x20'+_0x305198['updatedAt']);const _0x2cb86a=_0x305198['sections']?.[_0x504eb0(0x1a2)]||0x0;console['log']('\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x306))+'\x20'+_0x2cb86a);if(_0x305198[_0x504eb0(0x209)]&&_0x305198['sections'][_0x504eb0(0x1a2)]>0x0)for(const _0xfd070e of _0x305198[_0x504eb0(0x209)]){console[_0x504eb0(0x253)]('\x20\x20\x20\x20'+a31_0x4d24f3['bold'](_0xfd070e[_0x504eb0(0x260)])+'\x20'+a31_0x4d24f3[_0x504eb0(0x2f8)](_0x504eb0(0x22c)+_0xfd070e['id']+')')),_0xfd070e[_0x504eb0(0x20e)]&&(console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1b3))+'\x20'+_0xfd070e[_0x504eb0(0x20e)][_0x504eb0(0x260)]),_0xfd070e[_0x504eb0(0x20e)][_0x504eb0(0x14b)]?.[_0x504eb0(0x316)]&&console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3[_0x504eb0(0x175)](_0x504eb0(0x1ac))+'\x20'+_0xfd070e[_0x504eb0(0x20e)]['keyEventCriteria']['keyEventId'])),_0xfd070e['payload']&&console[_0x504eb0(0x253)](_0x504eb0(0x309)+a31_0x4d24f3['cyan'](_0x504eb0(0x212))+'\x20'+JSON[_0x504eb0(0x176)](_0xfd070e[_0x504eb0(0x1c7)])),_0xfd070e[_0x504eb0(0x1eb)]&&console[_0x504eb0(0x253)]('\x20\x20\x20\x20\x20\x20'+a31_0x4d24f3['cyan'](_0x504eb0(0x2b7))+'\x20true');}}return 0x0;}}export class PSPzDeleteCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x1aa);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x2bc);async['execute'](_0x351c52){const _0x2706f0=a31_0xe8811a,{options:_0x11e966,args:_0x43e53d,tdx:_0x19ad4d}=_0x351c52,_0x1f5ba6=_0x43e53d[0x0];if(!_0x1f5ba6)return console[_0x2706f0(0x104)](_0x2706f0(0x198)),console['error'](_0x2706f0(0x26e)),0x1;return await withSpinner(_0x2706f0(0x259)+_0x1f5ba6+_0x2706f0(0x228),()=>_0x19ad4d['personalization'][_0x2706f0(0x2cb)](_0x1f5ba6),{'verbose':_0x11e966[_0x2706f0(0x10d)]}),console[_0x2706f0(0x104)](_0x2706f0(0x135)+_0x1f5ba6+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{['name']=a31_0xe8811a(0x1d8);[a31_0xe8811a(0x2ab)]='Create\x20a\x20realtime\x20personalization\x20entity';async[a31_0xe8811a(0x224)](_0x3b8fcd){const _0x12399c=a31_0xe8811a,{options:_0x3d0091,tdx:_0x5a4283}=_0x3b8fcd,_0x3e8616=_0x3d0091;let _0x28e9f0;if(_0x3e8616[_0x12399c(0x10b)]){_0x28e9f0=await loadJSON(_0x3e8616[_0x12399c(0x10b)],!![]);if(!_0x28e9f0[_0x12399c(0x1fc)]?.['parentFolder'])return console['error']('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x12399c(0x104)](_0x12399c(0x271)),console[_0x12399c(0x104)](_0x12399c(0x220)),0x1;}else{if(!_0x3e8616[_0x12399c(0x260)])return console['error'](_0x12399c(0x165)),console['error'](_0x12399c(0x277)),console[_0x12399c(0x104)](_0x12399c(0x25e)),0x1;if(_0x3e8616[_0x12399c(0x2ab)]===undefined)return console[_0x12399c(0x104)](_0x12399c(0x207)),console[_0x12399c(0x104)](_0x12399c(0x277)),console[_0x12399c(0x104)](_0x12399c(0x25e)),0x1;if(_0x3e8616[_0x12399c(0x184)]===undefined)return console[_0x12399c(0x104)](_0x12399c(0x155)),console[_0x12399c(0x104)](_0x12399c(0x2eb)),0x1;let _0x1f62c6=_0x3e8616[_0x12399c(0x190)];if(!_0x1f62c6&&_0x3d0091[_0x12399c(0x13c)]){const _0x57e038=await withSpinner(_0x12399c(0x18d)+_0x3d0091['parentSegment']+_0x12399c(0x228),()=>_0x5a4283[_0x12399c(0x200)][_0x12399c(0x143)](_0x3d0091['parentSegment']),{'verbose':_0x3d0091['verbose']});_0x1f62c6=_0x57e038[_0x12399c(0x113)];}let _0x36fb59;_0x3e8616['sections']&&(_0x36fb59=await loadJSON(_0x3e8616[_0x12399c(0x209)],![]));const _0x3bea13=_0x3e8616[_0x12399c(0x184)]===_0x12399c(0x31c)?null:{'id':_0x3e8616[_0x12399c(0x184)],'type':_0x12399c(0x2ff)};_0x28e9f0={'attributes':{'name':_0x3e8616[_0x12399c(0x260)],'description':_0x3e8616[_0x12399c(0x2ab)]||null,..._0x1f62c6!==undefined&&{'audienceId':_0x1f62c6},..._0x36fb59!==undefined&&{'sections':_0x36fb59}},'relationships':{'parentFolder':{'data':_0x3bea13}}};}const _0xc355fb=await withSpinner(_0x12399c(0x189)+(_0x28e9f0[_0x12399c(0x289)]?.[_0x12399c(0x260)]??'')+_0x12399c(0x228),()=>_0x5a4283['personalization'][_0x12399c(0x1d3)](_0x28e9f0),{'verbose':_0x3d0091['verbose']}),_0x397b67=_0xc355fb[_0x12399c(0x113)];return console[_0x12399c(0x104)](_0x12399c(0x252)+_0x397b67[_0x12399c(0x260)]+_0x12399c(0x2b3)+_0x397b67['id']),await handleSDKOutput([_0x397b67],_0x3d0091),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x304);[a31_0xe8811a(0x2ab)]=a31_0xe8811a(0x300);async[a31_0xe8811a(0x224)](_0xfc5914){const _0x4d8215=a31_0xe8811a,{options:_0x50109b,args:_0x26737e}=_0xfc5914,_0x3e9fcc=_0x50109b,_0x5a6f57=_0x26737e[0x0];if(!_0x5a6f57)return console[_0x4d8215(0x104)]('Error:\x20Personalization\x20ID\x20is\x20required'),console[_0x4d8215(0x104)](_0x4d8215(0x146)),console[_0x4d8215(0x104)](_0x4d8215(0x313)),0x1;let _0x40021c;if(_0x3e9fcc[_0x4d8215(0x10b)])_0x40021c=await loadJSON(_0x3e9fcc['file'],!![]);else{if(!_0x3e9fcc[_0x4d8215(0x260)])return console[_0x4d8215(0x104)](_0x4d8215(0x165)),console['error'](_0x4d8215(0x146)),0x1;if(_0x3e9fcc[_0x4d8215(0x2ab)]===undefined)return console[_0x4d8215(0x104)](_0x4d8215(0x207)),console[_0x4d8215(0x104)](_0x4d8215(0x146)),0x1;let _0x5be9f3;_0x3e9fcc['sections']&&(_0x5be9f3=await loadJSON(_0x3e9fcc[_0x4d8215(0x209)],![])),_0x40021c={'attributes':{'name':_0x3e9fcc[_0x4d8215(0x260)],'description':_0x3e9fcc[_0x4d8215(0x2ab)]||null,..._0x5be9f3!==undefined&&{'sections':_0x5be9f3}}};}const {tdx:_0x49d668}=_0xfc5914,_0x325fdb=await withSpinner(_0x4d8215(0x2b5)+_0x5a6f57+_0x4d8215(0x228),()=>_0x49d668[_0x4d8215(0x20d)][_0x4d8215(0x1da)](_0x5a6f57,_0x40021c),{'verbose':_0x50109b[_0x4d8215(0x10d)]}),_0x287adf=_0x325fdb['data'];return console[_0x4d8215(0x104)](_0x4d8215(0x210)+_0x287adf['name']+_0x4d8215(0x22f)+_0x287adf['id']+')'),await handleSDKOutput([_0x287adf],_0x50109b),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0xe8811a(0x260)]=a31_0xe8811a(0x2ed);['description']='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a31_0xe8811a(0x224)](_0x18b559){const _0x44d3d5=a31_0xe8811a,{options:_0x1daa1f,args:_0x63c903}=_0x18b559,_0x2b5aa2=_0x63c903[0x0]||_0x1daa1f[_0x44d3d5(0x13c)];if(!_0x2b5aa2)return showParentSegmentNotSetError(_0x44d3d5(0x265)+_0x44d3d5(0x24c)),0x1;const _0x3fc678=resolveYamlFile(_0x2b5aa2);if(!existsSync(_0x3fc678))return showFileNotFoundError(_0x3fc678,_0x2b5aa2),0x1;let _0x3d4262;try{_0x3d4262=readFileSync(_0x3fc678,_0x44d3d5(0x29f));}catch(_0xbcd1f5){const _0x37581d=_0xbcd1f5 instanceof Error?_0xbcd1f5[_0x44d3d5(0x205)]:String(_0xbcd1f5);return console[_0x44d3d5(0x104)](_0x44d3d5(0x2fc)+_0x37581d),0x1;}let _0x5da684;try{_0x5da684=parseDef(_0x3d4262);}catch(_0x29d0fd){const _0x27d583=_0x29d0fd instanceof Error?_0x29d0fd['message']:String(_0x29d0fd);return console['error'](a31_0x4d24f3[_0x44d3d5(0x2f4)](_0x44d3d5(0x1d4)+_0x27d583)),0x1;}if(_0x5da684[_0x44d3d5(0x16d)]&&_0x5da684['personalization_services'][_0x44d3d5(0x1a2)]>0x0)return console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x1a7)](_0x44d3d5(0x158)+_0x3fc678)),console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x2f8)](_0x44d3d5(0x2ae)+_0x5da684[_0x44d3d5(0x16d)][_0x44d3d5(0x1a2)]+_0x44d3d5(0x1c1))),0x1;!_0x5da684[_0x44d3d5(0x10e)]&&(_0x5da684[_0x44d3d5(0x10e)]={'events':[{'name':_0x44d3d5(0x109),'source_table':_0x44d3d5(0x1ab)}],'attributes':[{'name':_0x44d3d5(0x1bc),'type':_0x44d3d5(0x14c)}],'id_stitching':{'primary_key':_0x5da684[_0x44d3d5(0x2cf)][_0x44d3d5(0x101)]===_0x44d3d5(0x163)?_0x44d3d5(0x1d1):'user_id'}});_0x5da684[_0x44d3d5(0x16d)]=[{'name':'My\x20Service','description':_0x44d3d5(0x2c3),'trigger_event':_0x44d3d5(0x109),'sections':[{'name':_0x44d3d5(0x1c6),'criteria':_0x44d3d5(0x159),'attributes':[_0x44d3d5(0x1bc)]}]}];const _0x16b3cf=serializeDef(_0x5da684);return writeFileSync(_0x3fc678,_0x16b3cf,'utf-8'),console[_0x44d3d5(0x104)](a31_0x4d24f3[_0x44d3d5(0x2af)]('✔')+_0x44d3d5(0x150)+a31_0x4d24f3[_0x44d3d5(0x175)](_0x3fc678)),(!_0x5da684[_0x44d3d5(0x10e)]||_0x3d4262[_0x44d3d5(0x2a7)](_0x44d3d5(0x1ae))===-0x1)&&console['error'](a31_0x4d24f3['green']('✔')+_0x44d3d5(0x15c)),console[_0x44d3d5(0x104)]('\x0a'+a31_0x4d24f3['dim']('Next\x20steps:')),console['error'](_0x44d3d5(0x14e)+_0x3fc678+_0x44d3d5(0x320)),console[_0x44d3d5(0x104)](_0x44d3d5(0x23e)+a31_0x4d24f3[_0x44d3d5(0x2f8)](_0x44d3d5(0x129)+_0x2b5aa2)+_0x44d3d5(0x21b)),0x0;}}
|
|
1
|
+
const a31_0x1e12b4=a31_0x556b;(function(_0x50b561,_0x2955b6){const _0x188320=a31_0x556b,_0x5181d5=_0x50b561();while(!![]){try{const _0x356890=-parseInt(_0x188320(0x29c))/0x1*(parseInt(_0x188320(0xa7))/0x2)+parseInt(_0x188320(0x25f))/0x3+parseInt(_0x188320(0xe1))/0x4+parseInt(_0x188320(0xd1))/0x5*(-parseInt(_0x188320(0x186))/0x6)+-parseInt(_0x188320(0x229))/0x7*(-parseInt(_0x188320(0x1db))/0x8)+-parseInt(_0x188320(0x106))/0x9*(-parseInt(_0x188320(0x1bc))/0xa)+-parseInt(_0x188320(0x208))/0xb*(parseInt(_0x188320(0x272))/0xc);if(_0x356890===_0x2955b6)break;else _0x5181d5['push'](_0x5181d5['shift']());}catch(_0xe006be){_0x5181d5['push'](_0x5181d5['shift']());}}}(a31_0x52a9,0x9f169));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a31_0x572ad6 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions,loadJSON}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a31_0x46217b from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a31_0x1e12b4(0x269),LEGACY_PARENT_SEGMENT_DIR=a31_0x1e12b4(0xf2);function openBrowser(_0x1f2dd2){const _0x2b063d=a31_0x1e12b4,_0x5ae149=process['platform'],_0x5a17db=_0x5ae149===_0x2b063d(0x1de)?_0x2b063d(0x1c9):_0x5ae149===_0x2b063d(0x184)?_0x2b063d(0x1e4):'xdg-open';spawn(_0x5a17db,[_0x1f2dd2],{'detached':!![],'stdio':_0x2b063d(0x243)})[_0x2b063d(0x1fe)]();}function migrateLegacyDirectory(){const _0x42117e=a31_0x1e12b4;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x3c0b70=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x3c0b70[_0x42117e(0xb3)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x42117e(0x9a)](a31_0x46217b[_0x42117e(0x289)](_0x42117e(0x120)+LEGACY_PARENT_SEGMENT_DIR+_0x42117e(0x1a5)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console['error'](a31_0x46217b[_0x42117e(0x140)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console['error'](a31_0x46217b[_0x42117e(0x289)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x42117e(0x210)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x42117e(0x9a)](a31_0x46217b[_0x42117e(0x1a7)](_0x42117e(0x105)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x1e6cd4){const _0x31f3bd=_0x1e6cd4 instanceof Error?_0x1e6cd4['message']:String(_0x1e6cd4);return console['error'](a31_0x46217b[_0x42117e(0xba)](_0x42117e(0x173)+_0x31f3bd+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a31_0x1e12b4(0x1da)](_0x4f76bd){const _0x471c8d=a31_0x1e12b4;return migrateLegacyDirectory(),super[_0x471c8d(0x1da)](_0x4f76bd);}}function resolveYamlFile(_0x40cdfc){const _0x1a510c=a31_0x1e12b4;if(_0x40cdfc['endsWith'](_0x1a510c(0x14f))||_0x40cdfc[_0x1a510c(0x1d7)]('.yaml'))return _0x40cdfc;return a31_0x572ad6[_0x1a510c(0x161)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x40cdfc)+_0x1a510c(0x14f));}function formatProgressMessage(_0x4a22f9){const _0x271464=_0x4a22f9['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x271464){const [,_0xf1f677,_0x201e5f,_0x55a59a='']=_0x271464;return a31_0x46217b['dim'](_0xf1f677+':')+'\x20'+_0x201e5f+a31_0x46217b['dim'](_0x55a59a);}return a31_0x46217b['dim'](_0x4a22f9);}function showFileNotFoundError(_0x15a3aa,_0x27842e){const _0xc28726=a31_0x1e12b4;console[_0xc28726(0x9a)](a31_0x46217b[_0xc28726(0xba)](_0xc28726(0x14a)+_0x15a3aa+'\x0a')),console['error'](a31_0x46217b['cyan']('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x27842e+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x2343cf){const _0x434e8a=a31_0x1e12b4;if(!_0x2343cf['realtime'])return;const _0x5a0ec7=_0x2343cf[_0x434e8a(0x113)],_0x33be76=_0x5a0ec7[_0x434e8a(0x16e)]?a31_0x46217b[_0x434e8a(0x1a7)]('⚡\x20Enabled'):a31_0x46217b[_0x434e8a(0x289)](_0x434e8a(0x29b));console['error']('\x0a'+a31_0x46217b['dim'](_0x434e8a(0xb0))+'\x20'+_0x33be76);if(_0x5a0ec7[_0x434e8a(0x13f)]&&_0x5a0ec7[_0x434e8a(0x13f)][_0x434e8a(0x179)]>0x0){console[_0x434e8a(0x9a)]('\x20\x20'+a31_0x46217b[_0x434e8a(0x140)](_0x434e8a(0x207))+'\x20'+_0x5a0ec7['events'][_0x434e8a(0x179)]+_0x434e8a(0x119));for(const _0x243795 of _0x5a0ec7[_0x434e8a(0x13f)]){const _0xc463ee=_0x243795['sourceTableValid']===![]?a31_0x46217b[_0x434e8a(0xba)]('✘'):a31_0x46217b[_0x434e8a(0x1a7)]('✔');console[_0x434e8a(0x9a)]('\x20\x20\x20\x20'+_0xc463ee+'\x20'+_0x243795['name']),_0x243795[_0x434e8a(0x121)]&&console['error'](_0x434e8a(0x154)+a31_0x46217b[_0x434e8a(0xba)](_0x243795[_0x434e8a(0x121)]));}}if(_0x5a0ec7[_0x434e8a(0xd9)]&&_0x5a0ec7[_0x434e8a(0xd9)]['length']>0x0){console[_0x434e8a(0x9a)]('\x20\x20'+a31_0x46217b[_0x434e8a(0x140)](_0x434e8a(0x138))+'\x20'+_0x5a0ec7['attributes']['length']+_0x434e8a(0x119));for(const _0x285d27 of _0x5a0ec7[_0x434e8a(0xd9)]){const _0xe28c07=_0x285d27[_0x434e8a(0x209)]?a31_0x46217b[_0x434e8a(0x1a7)]('✔'):a31_0x46217b[_0x434e8a(0xba)]('✘');console[_0x434e8a(0x9a)](_0x434e8a(0x131)+_0xe28c07+'\x20'+_0x285d27[_0x434e8a(0x1ef)]+'\x20'+a31_0x46217b[_0x434e8a(0x140)]('('+_0x285d27['type']+')'));}}if(_0x5a0ec7[_0x434e8a(0x85)]){const _0x4df70b=_0x5a0ec7['idStitching'][_0x434e8a(0x19d)]?.[_0x434e8a(0x179)]?_0x434e8a(0xa4)+_0x5a0ec7[_0x434e8a(0x85)][_0x434e8a(0x19d)][_0x434e8a(0x161)](',\x20')+']':'';console['error']('\x20\x20'+a31_0x46217b[_0x434e8a(0x140)](_0x434e8a(0x17c))+'\x20'+_0x5a0ec7[_0x434e8a(0x85)]['primaryKey']+_0x4df70b);}if(_0x5a0ec7[_0x434e8a(0x1d5)]&&_0x5a0ec7['personalizationServices'][_0x434e8a(0x179)]>0x0){console[_0x434e8a(0x9a)]('\x20\x20'+a31_0x46217b[_0x434e8a(0x140)](_0x434e8a(0x1f9))+'\x20'+_0x5a0ec7[_0x434e8a(0x1d5)][_0x434e8a(0x179)]+_0x434e8a(0x12d)+(_0x5a0ec7[_0x434e8a(0x1d5)]['length']!==0x1?'s':''));for(const _0x3261de of _0x5a0ec7[_0x434e8a(0x1d5)]){console[_0x434e8a(0x9a)]('\x20\x20\x20\x20-\x20'+_0x3261de[_0x434e8a(0x1ef)]);}}}function showParentSegmentNotSetError(_0x262f35){const _0x3ddaae=a31_0x1e12b4;console['error'](a31_0x46217b[_0x3ddaae(0x289)](_0x3ddaae(0xb9))),console[_0x3ddaae(0x9a)](_0x262f35);}export class ParentSegmentListCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]='segment:parent:list';[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x1be);async['execute'](_0x5f6ca3){const _0x35542e=a31_0x1e12b4,{options:_0xf02418,args:_0xdfe34b,tdx:_0x26f0ea}=_0x5f6ca3,_0x3f9380=_0xdfe34b[0x0];_0xf02418[_0x35542e(0x24c)]&&(console[_0x35542e(0x9a)](_0x35542e(0xf3)+_0xf02418[_0x35542e(0x29d)]),_0x3f9380&&console[_0x35542e(0x9a)](_0x35542e(0xa5)+_0x3f9380));const _0x543d20=await withSpinner(_0x3f9380?_0x35542e(0x1b9)+_0x3f9380+'\x27...':_0x35542e(0x1dc),()=>_0x26f0ea[_0x35542e(0x1ee)][_0x35542e(0x25e)](),{'verbose':_0xf02418['verbose']});let _0x563eb5=_0x543d20['data'];if(_0x3f9380){const _0x224479=_0x3f9380['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x35542e(0x192)](/\*/g,'.*')[_0x35542e(0x192)](/\?/g,'.'),_0x2a3234=new RegExp('^'+_0x224479+'$','i');_0x563eb5=_0x563eb5['filter'](_0x1d2cb7=>_0x2a3234[_0x35542e(0x23a)](_0x1d2cb7[_0x35542e(0xd9)][_0x35542e(0x1ef)]));}_0x563eb5[_0x35542e(0x215)]((_0x573299,_0x283f75)=>_0x573299['attributes'][_0x35542e(0x1ef)]['localeCompare'](_0x283f75['attributes']['name'])),console['error'](_0x35542e(0x1ad)+_0x563eb5['length']+'\x20parent\x20segment'+(_0x563eb5[_0x35542e(0x179)]!==0x1?'s':''));const _0x4b7099=_0x3f2347=>{const _0x587b47=_0x35542e;return getConsoleNextUrl(_0xf02418[_0x587b47(0x29d)],'/app/dw/parentSegments/'+_0x3f2347);};if(_0xf02418[_0x35542e(0xc5)]==='json'||_0xf02418[_0x35542e(0xc5)]==='jsonl'){const _0x1f2965=_0x563eb5[_0x35542e(0x16f)](_0x44f700=>({..._0x44f700,'url':_0x4b7099(_0x44f700['id'])}));await handleSDKOutput(_0x1f2965,_0xf02418);}else{if(_0x563eb5['length']===0x0)_0x3f9380?console['log']('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x3f9380):console[_0x35542e(0xc0)](_0x35542e(0x1f0));else for(const _0x419e3a of _0x563eb5){const _0x34f0f6=_0x419e3a[_0x35542e(0xd9)][_0x35542e(0x1af)]?a31_0x46217b[_0x35542e(0x140)]('\x20('+formatRows(_0x419e3a[_0x35542e(0xd9)][_0x35542e(0x1af)])+')'):'',_0x33ef3b=hyperlink(_0x419e3a[_0x35542e(0xd9)][_0x35542e(0x1ef)],_0x4b7099(_0x419e3a['id']));console['log'](_0x35542e(0xeb)+_0x33ef3b+_0x34f0f6);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x93);['description']=a31_0x1e12b4(0x22a);async['execute'](_0x484c9f){const _0x4f80aa=a31_0x1e12b4,{options:_0x209687,args:_0x59f526,tdx:_0x4e8f31}=_0x484c9f;console[_0x4f80aa(0x9a)]('\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'+_0x4f80aa(0x19e));const _0x3f5d42=_0x209687;if(_0x59f526[_0x4f80aa(0x179)]===0x0)return console[_0x4f80aa(0x9a)](a31_0x46217b[_0x4f80aa(0xba)](_0x4f80aa(0x157))),console[_0x4f80aa(0x9a)](_0x4f80aa(0x1df)),0x1;const _0x407915=_0x59f526[0x0];if(!_0x3f5d42[_0x4f80aa(0x10a)]||!_0x3f5d42['table'])return console[_0x4f80aa(0x9a)](_0x4f80aa(0x276)),console[_0x4f80aa(0x9a)](_0x4f80aa(0x1df)),0x1;_0x3f5d42[_0x4f80aa(0x24c)]&&(console[_0x4f80aa(0x9a)]('Site:\x20'+_0x3f5d42[_0x4f80aa(0x29d)]),console[_0x4f80aa(0x9a)](_0x4f80aa(0x19b)+_0x407915),console[_0x4f80aa(0x9a)](_0x4f80aa(0xa1)+_0x3f5d42[_0x4f80aa(0x10a)]),console[_0x4f80aa(0x9a)]('Table:\x20'+_0x3f5d42[_0x4f80aa(0x111)]));const _0x387c30=await loadJSONFromOptions(_0x3f5d42['attributes'],_0x3f5d42[_0x4f80aa(0x212)]),_0x47ad18=await loadJSONFromOptions(_0x3f5d42[_0x4f80aa(0xd0)],_0x3f5d42['behaviorsFile']),_0x5e20a6=await loadJSONFromOptions(_0x3f5d42[_0x4f80aa(0x1d9)],_0x3f5d42[_0x4f80aa(0x1ea)]),_0x321339={'name':_0x407915,'description':_0x3f5d42[_0x4f80aa(0x18c)],'scheduleType':_0x3f5d42[_0x4f80aa(0x28d)],'scheduleOption':_0x3f5d42[_0x4f80aa(0xee)],'timezone':_0x3f5d42['timezone'],'master':{'parentDatabaseName':_0x3f5d42[_0x4f80aa(0x10a)],'parentTableName':_0x3f5d42[_0x4f80aa(0x111)]},'attributes':_0x387c30,'behaviors':_0x47ad18,'customerGroup':_0x5e20a6},_0x11da11=await withSpinner(_0x4f80aa(0xc4)+_0x407915+'\x27...',()=>_0x4e8f31[_0x4f80aa(0x1ee)][_0x4f80aa(0x295)](_0x321339),{'verbose':_0x209687[_0x4f80aa(0x24c)]}),_0x2cbed3=_0x11da11[_0x4f80aa(0x22f)];return console[_0x4f80aa(0x9a)](_0x4f80aa(0xbc)+_0x2cbed3[_0x4f80aa(0x1ef)]+'\x27\x20with\x20ID:\x20'+_0x2cbed3['id']),await handleSDKOutput([_0x2cbed3],_0x209687),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x23b);['description']=a31_0x1e12b4(0x170);async[a31_0x1e12b4(0x26e)](_0x2e5013){const _0x21f8a2=a31_0x1e12b4,{options:_0x301bd2,args:_0x3655c,tdx:_0x2586b3}=_0x2e5013;console['error'](_0x21f8a2(0x16d)+_0x21f8a2(0x25b)+_0x21f8a2(0x19e));const _0x468e80=_0x301bd2;if(_0x3655c[_0x21f8a2(0x179)]===0x0)return console[_0x21f8a2(0x9a)](a31_0x46217b[_0x21f8a2(0xba)](_0x21f8a2(0x157))),console['error'](_0x21f8a2(0x174)),0x1;const _0x3d93b6=_0x3655c[0x0];_0x468e80[_0x21f8a2(0x24c)]&&(console['error'](_0x21f8a2(0xf3)+_0x468e80[_0x21f8a2(0x29d)]),console[_0x21f8a2(0x9a)]('Parent\x20segment:\x20'+_0x3d93b6));const _0x4517d4=await withSpinner('Fetching\x20current\x20configuration\x20for\x20\x27'+_0x3d93b6+_0x21f8a2(0x14d),()=>_0x2586b3[_0x21f8a2(0x1ee)]['getParentFull'](_0x3d93b6),{'verbose':_0x468e80[_0x21f8a2(0x24c)]}),_0x3c44cb=_0x4517d4[_0x21f8a2(0x22f)],_0x45dab8=await loadJSONFromOptions(_0x468e80[_0x21f8a2(0x149)],_0x468e80[_0x21f8a2(0x28f)]),_0x268ef2=await loadJSONFromOptions(_0x468e80[_0x21f8a2(0x187)],_0x468e80[_0x21f8a2(0x220)]),_0x1eceeb={'name':_0x3c44cb[_0x21f8a2(0x1ef)],'description':_0x468e80[_0x21f8a2(0x18c)]!==undefined?_0x468e80[_0x21f8a2(0x18c)]:_0x3c44cb[_0x21f8a2(0x18c)],'scheduleType':_0x468e80[_0x21f8a2(0x28d)]!==undefined?_0x468e80[_0x21f8a2(0x28d)]:_0x3c44cb[_0x21f8a2(0x28d)],'scheduleOption':_0x468e80['scheduleOption']!==undefined?_0x468e80[_0x21f8a2(0xee)]:_0x3c44cb['scheduleOption'],'timezone':_0x468e80[_0x21f8a2(0x20a)]!==undefined?_0x468e80[_0x21f8a2(0x20a)]:_0x3c44cb[_0x21f8a2(0x20a)],'master':_0x3c44cb['master'],'attributes':_0x45dab8?[..._0x3c44cb['attributes']||[],..._0x45dab8]:_0x3c44cb[_0x21f8a2(0xd9)],'behaviors':_0x268ef2?[..._0x3c44cb[_0x21f8a2(0xd0)]||[],..._0x268ef2]:_0x3c44cb[_0x21f8a2(0xd0)],'customerGroup':_0x3c44cb[_0x21f8a2(0x1d9)]},_0x45c34f=await withSpinner(_0x21f8a2(0x188)+_0x3d93b6+'\x27...',()=>_0x2586b3[_0x21f8a2(0x1ee)][_0x21f8a2(0x94)](_0x3d93b6,_0x1eceeb),{'verbose':_0x468e80[_0x21f8a2(0x24c)]}),_0x555ee7=_0x45c34f[_0x21f8a2(0x22f)];return console[_0x21f8a2(0x9a)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x555ee7['name']+'\x27'),await handleSDKOutput([_0x555ee7],_0x468e80),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a31_0x1e12b4(0xea);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x129);async['execute'](_0x5c845d){const _0x2a65ab=a31_0x1e12b4,{options:_0xd35458,args:_0x4bd3d2,tdx:_0x31960e}=_0x5c845d,_0x3f0cbe=_0xd35458,_0x337057=_0x4bd3d2[0x0]||_0xd35458[_0x2a65ab(0x1ce)];if(!_0x337057)return showParentSegmentNotSetError(_0x2a65ab(0x27d)+_0x2a65ab(0x1ba)),0x1;if(_0x3f0cbe[_0x2a65ab(0xb2)]&&_0x3f0cbe[_0x2a65ab(0x114)])return console[_0x2a65ab(0x9a)](a31_0x46217b[_0x2a65ab(0xba)](_0x2a65ab(0x254))),console[_0x2a65ab(0x9a)](a31_0x46217b[_0x2a65ab(0x140)](_0x2a65ab(0x283))),console['error'](a31_0x46217b[_0x2a65ab(0x140)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x2a65ab(0xca))),console['error'](a31_0x46217b['cyan'](_0x2a65ab(0x198))),0x1;const _0x247055=_0x3f0cbe[_0x2a65ab(0x114)]||a31_0x572ad6[_0x2a65ab(0x161)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x337057)+'.yml');_0x3f0cbe[_0x2a65ab(0x24c)]&&(console[_0x2a65ab(0x9a)](_0x2a65ab(0xf3)+_0x3f0cbe[_0x2a65ab(0x29d)]),console[_0x2a65ab(0x9a)](_0x2a65ab(0xf8)+_0x337057),console[_0x2a65ab(0x9a)](_0x2a65ab(0x29f)+_0x247055));const _0x261d67=await withSpinner(_0x2a65ab(0x17f)+_0x337057+'\x27...',()=>_0x31960e[_0x2a65ab(0x1ee)][_0x2a65ab(0x16c)](_0x337057),{'verbose':_0x3f0cbe['verbose']}),_0x2cfd87=_0x261d67[_0x2a65ab(0x22f)];if(existsSync(_0x247055)){const _0x484189=readFileSync(_0x247055,_0x2a65ab(0x288)),_0x683c91=generateDiff(_0x484189,_0x2cfd87);if(!hasChanges(_0x683c91))console[_0x2a65ab(0x9a)](a31_0x46217b['green']('✔')+_0x2a65ab(0x133)+a31_0x46217b[_0x2a65ab(0x228)](_0x247055)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x2a65ab(0x9a)](_0x2a65ab(0xde)+_0x247055+'\x27:'),console[_0x2a65ab(0x9a)]('─'['repeat'](0x3c)),console[_0x2a65ab(0x9a)](formatDiffWithColors(_0x683c91)),console['error']('─'['repeat'](0x3c));if(!_0x3f0cbe[_0x2a65ab(0x25a)]){if(!isInteractive())return console[_0x2a65ab(0x9a)](a31_0x46217b[_0x2a65ab(0xba)]('\x0aError:'),_0x2a65ab(0x155)),console['error'](a31_0x46217b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x491f98=await confirmKey(_0x2a65ab(0xce)+_0x247055+'\x27?');if(!_0x491f98)return console['error'](a31_0x46217b['yellow'](_0x2a65ab(0x127))),0x1;}writeFileSync(_0x247055,_0x2cfd87,'utf-8'),console[_0x2a65ab(0x9a)](a31_0x46217b[_0x2a65ab(0x1a7)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a31_0x46217b['cyan'](_0x247055));}}else{const _0x48b52d=a31_0x572ad6[_0x2a65ab(0xf4)](_0x247055);!existsSync(_0x48b52d)&&mkdirSync(_0x48b52d,{'recursive':!![]}),writeFileSync(_0x247055,_0x2cfd87,_0x2a65ab(0x288)),console[_0x2a65ab(0x9a)](a31_0x46217b[_0x2a65ab(0x1a7)]('✔')+_0x2a65ab(0x1a6)+a31_0x46217b[_0x2a65ab(0x228)](_0x247055));}return saveSessionContext({'parent_segment':_0x337057},_0x3f0cbe['session']),console[_0x2a65ab(0x9a)](a31_0x46217b['green']('✔')+_0x2a65ab(0x16a)+a31_0x46217b[_0x2a65ab(0x140)](_0x2a65ab(0xf2))+_0x2a65ab(0x162)+a31_0x46217b[_0x2a65ab(0x228)](_0x337057)),0x0;}}function a31_0x52a9(){const _0xf57bb5=['json','segment:parent:preview','Updating','Available\x20behaviors:','\x20\x20\x20','token:','Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','sections','addAttributes','Error:\x20File\x20not\x20found:\x20','Validating\x20configuration...','Updating\x20personalization\x20service\x20\x27','\x27...','displayPreviewHints','.yml','value','Error:','sampleData','Get\x20current\x20RT\x20configuration\x20version\x20status','\x20\x20\x20\x20\x20\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','entryCriteria:','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x27\x20not\x20found\x20in\x20any\x20personalization\x20service','Listing\x20personalization\x20services\x20for\x20\x27','no\x20tokens\x20configured','✔\x20Updated\x20personalization\x20service\x20\x27','allValid','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aNew\x20parent\x20segment\x20\x27','ps:pz:list','Creating\x20personalization\x20\x27','join','\x20=\x20','Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs','Apply\x20changes\x20to\x20\x27','delete','ps:rt:configuration_versions','Error:\x20Service\x20ID\x20is\x20required','✔\x20Found\x20personalization\x20\x27','\x20\x20Note:\x20','\x20Context\x20set:\x20','Preview:','pullParentYaml','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','enabled','map','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Options:','deleteToken','✘\x20Failed\x20to\x20rename\x20directory:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Fetching\x20sample\x20data...','column','\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','\x20service(s)\x20configured','length','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20Added\x20personalization\x20template\x20to\x20','ID\x20Stitching:','displayBehaviorsStats','resolveParentId','Fetching\x20parent\x20segment\x20\x27','Listing\x20RT\x20journeys\x20for\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Error:\x20--name\x20is\x20required','stringify','win32','type','48378EHvHbu','addBehaviors','Updating\x20parent\x20segment\x20\x27','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','/app/workflows/','displayRealtimeInfo','description','✔\x20Query\x20completed:\x20Processed\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','\x20\x20Database:\x20','Schema\x20saved\x20to\x20','audienceId','replace','behavior_','No\x20RT\x20journeys\x20found','push','List\x20RT\x20journeys','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','includeSensitive:','master','Name:\x20','displayValidateResults','stitchingKeys','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Getting\x20personalization\x20\x27','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','\x0a\x20\x20]\x0a}\x0a','segment:parent:sql','getCurrentConfigVersion','Error:\x20--name\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)','/\x20and\x20','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','green','✔\x20Created\x20personalization\x20service\x20\x27','string','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]\x0a','Update\x20a\x20personalization\x20service\x20name\x20and/or\x20description','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','✔\x20Found\x20','\x27\x20and\x20run\x20workflow?','population','Default','Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID,\x20then\x20add:','Usage:\x20tdx\x20ps\x20rt\x20jn\x20pause_activations\x20<journeyId>\x0a','filter','tokens','To\x20view\x20sample\x20data:','ps:pz:create','YAML\x20file:\x20','workflowAttemptId','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20Personalization\x20ID\x20is\x20required','10370iLJUyB','\x20tdx\x20wf\x20attempt\x20','List\x20parent\x20segments','Behaviors','✔\x20Retrieved\x20RT\x20configuration\x20version','✔\x20Created\x20token\x20\x27','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','Coverage:','behavior','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x0aNo\x20sample\x20data\x20available','keyEventId:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context','open','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','entryCriteria','getParentFull','totalEvents','parentSegment','List\x20available\x20fields\x20for\x20segmentation','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','any','validateParentYaml','limit','elapsedTimeMillis','personalizationServices','Delete\x20a\x20token\x20from\x20a\x20personalization\x20service','endsWith','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','customerGroup','run','5551528iMjylq','Listing\x20parent\x20segments...','paused','darwin','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Updated','split','create','matchedCount','start','allowed\x20IPs:','file','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','listPersonalizations','Listing\x20fields\x20for\x20\x27','customerGroupFile','apply','\x20--attribute\x20\x22<name>\x22','Update\x20a\x20realtime\x20personalization\x20entity','segment','name','No\x20parent\x20segments\x20found','\x20stage','joinKey','localeCompare','✔\x20Deleted\x20token\x20\x27','\x22,\x20\x22type\x22:\x20\x22','td_client_id','trim','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]','Personalization:','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Usage:\x20tdx\x20ps\x20pz\x20show\x20<personalization_id>','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','\x20--attribute\x20\x22','unref','Error\x20reading\x20file:\x20','ps:pz:patch','includeSensitive','state','errors','Error:\x20Token\x20\x27','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Events:','11LMfRlO','valid','timezone','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','keyEventId','realtime_enabled','\x20--interval\x20','/\x20→\x20','Executing\x20parent\x20segment\x20query...','attributesFile','\x0aUsage:\x20tdx\x20ps\x20preview\x20','List\x20realtime\x20personalizations\x20for\x20a\x20parent\x20segment','sort','.customers)','Usage:\x20tdx\x20ps\x20pz\x20delete\x20<personalization_id>','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20personalizations\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','rowCount','\x20Opening\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--file\x20<path>','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','addBehaviorsFile','toFixed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','\x20\x20No\x20sample\x20data\x20available','\x20(paused)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context','ps:pz:service:token:create','toLocaleString','cyan','7TquLbl','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20[Job\x20ID:\x20','Fetching\x20customers\x20schema...','displaySummary','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','data','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','✔\x20Updated\x20personalization\x20\x27','Analyzing\x20changes...','formatSchemaJson','folderId','\x27\x20with\x20ID:\x20','\x20to\x20push\x20the\x20configuration','listJourneys','realtime:','test','segment:parent:update','pauseJourney','ps:pz:show','Columns:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context','getPersonalization','ps:pz:init','id:\x20','ignore','displayMasterInfo','displayAttributesStats','foreignKey','Resuming\x20activations\x20for\x20RT\x20journey\x20\x27','all','relationships','bold','jsonl','verbose','folder-segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>','\x20total','collectSchema','resumeJourney','ps:rt:jn:list','Session:','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','/attempt/','Created','attribute','Validating\x20RT\x20configuration...','yes','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x0aError:','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','listParents','3246060ONOfVO','\x20RT-enabled\x20parent\x20segment','Status:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','parentFolder','ps:pz:service:token:delete','Create\x20a\x20realtime\x20personalization\x20entity','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','schemaValid','Master:','parent_segments','-1d','segment:parent:view','last_page_viewed','Error:\x20Token\x20name\x20is\x20required','execute','Join\x20on:','jobId','page_view','20425116wxmNrq','FINISHED','column_type','audienceId:\x20','Error:\x20--database\x20and\x20--table\x20are\x20required','/app/dw/parentSegments/','Fetching\x20personalization\x20service\x20\x27','\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','Validate:','/sessions/','Delete\x20a\x20realtime\x20personalization','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','single','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x22\x20}','displayColumns','eventKind','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','interval','Patching\x20personalization\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]','utf-8','yellow','\x20\x202.\x20Run\x20','created:','Options\x20(one\x20required):\x0a','scheduleType','processedRows','addAttributesFile','in\x20','Fetching\x20behavior\x20list...','updatedAt','label','SELECT\x20*\x20FROM\x20(\x0a','createParent','varchar','Resume\x20activations\x20in\x20an\x20RT\x20journey','public:','workflowId','Error:\x20Token\x20ID\x20is\x20required','⚡\x20Not\x20enabled','14047YGuwGl','site','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','Output\x20file:\x20','payload','eventKind:\x20','customerPercent','status:\x20','tdx\x20ps\x20preview\x20','idStitching','Next\x20steps:','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]','getParentSQL','displayPreviewResults','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','ps:rt:validate','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]\x0a','Creating','Error:\x20--attribute\x20requires\x20a\x20name\x0a','ps:pz:service:delete','personalization','Error\x20parsing\x20YAML:\x20','segment:parent:fields','segment:parent:create','updateParent','To\x20cancel:','segment:parent:show','Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]\x0a','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','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','error','columns','customers','Listing\x20RT-enabled\x20parent\x20segments...','Listing\x20personalizations\x20for\x20\x27','Rows:','SELECT\x20*\x20FROM\x20','Database:\x20','Create\x20parent\x20segment\x20\x27','stop','\x20+\x20[','Pattern:\x20','✔\x20No\x20changes\x20-\x20\x27','6FPKczc','\x20personalization','Usage:\x20tdx\x20ps\x20rt\x20jn\x20resume_activations\x20<journeyId>\x0a','segment:parent:run','ps:pz:service:update','Show\x20a\x20specific\x20realtime\x20personalization','RT\x20Journey\x20ID:\x20','(id:\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','RT\x202.0:','repeat','use','isDirectory','Source:','<database>.<table>','\x27\x20(id:\x20','enriched','\x20\x20\x20\x20\x20\x20\x20\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','red','Pause\x20activations\x20in\x20an\x20RT\x20journey','✔\x20Created\x20parent\x20segment\x20\x27','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','payload:','Customers:','log','schemaError','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Creating\x20parent\x20segment\x20\x27','format','\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20[parent_segment]','\x20RT\x20configuration\x20is\x20valid','Personalization\x20service\x20description','/{name}.yml\x0a','Resolving\x20parent\x20segment\x20\x27','workflowSessionId','\x20\x20\x20\x20-\x20','Overwrite\x20\x27','Fetching\x20SQL\x20for\x20\x27','behaviors','50qDnlsp','\x20--behavior\x20\x22','ps:rt:jn:pause','get','\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:','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','launched','attributes','previewParentYaml','SQL\x20query:\x0a','ps:pz:service:list','reduce','\x0aChanges\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20\x20#\x20Uses\x20context','Deleting\x20token\x20\x27','2047176guNHCB','Delete\x20a\x20personalization\x20service','{\x0a\x20\x20\x22database\x22:\x20\x22','list','ps:rt:list','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','Usage:\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20[parent_segment]\x0a','segment:parent:pull','👥\x20','\x20--enriched','segment:parent:desc','scheduleOption','setJobId','\x20kill','No\x20personalizations\x20configured','parent_segment','Site:\x20','dirname','Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]','\x20to\x20configure\x20your\x20personalization\x20service','number','Parent\x20segment:\x20','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','double','personalization_services','Deleting\x20personalization\x20service\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20rows)','\x27\x20is\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20pz\x20service\x20show\x20<service_id>\x20[parent_segment]\x0a','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a','runParent','✔\x20Renamed\x20directory\x20to\x20','1638XHyHgh','text','pushParentYaml','allowedIps','database','\x0aChanges\x20to\x20apply\x20to\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','\x20personalization\x20service','Audience\x20ID:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','sections:','table','message','realtime','output','createdAt','Show\x20parent\x20segment\x20details','audienceId:','keyEventCriteria','\x20configured','Get\x20SQL\x20query\x20for\x20parent\x20segment','\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}','RT\x202.0\x20Validate:','information_schema','ps:pz:delete','Finding\x20service\x20for\x20token...','\x0a⚠️\x20\x20Both\x20','sourceTableError','parent_id','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','column_name','user_id','coveragePercent','Aborted.','\x20true','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20Configuration\x20is\x20valid','Pausing\x20activations\x20for\x20RT\x20journey\x20\x27','displaySampleData','\x20service','Found\x20YAML\x20file:\x20','tdx\x20ps\x20push\x20','Creating\x20token\x20\x27','\x20\x20\x20\x20','\x5c$&','\x20No\x20changes\x20-\x20','Options:\x0a','public','Enriched:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Attributes:','\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','ps:rt:jn:resume','customersWithEvents','My\x20Service','stageCount','\x0a\x20\x20\x20\x20]','events','dim'];a31_0x52a9=function(){return _0xf57bb5;};return a31_0x52a9();}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a31_0x1e12b4(0x1ef)]='segment:parent:push';['description']=a31_0x1e12b4(0xe7);async[a31_0x1e12b4(0x26e)](_0x19bd55){const _0x44fa3b=a31_0x1e12b4,{options:_0x2906e3,args:_0x200776,tdx:_0x486c72}=_0x19bd55,_0x2ddd9d=_0x2906e3,_0x2a8d67=_0x200776[0x0]||_0x2906e3[_0x44fa3b(0x1ce)];if(!_0x2a8d67)return showParentSegmentNotSetError(_0x44fa3b(0xd7)+_0x44fa3b(0x137)),0x1;const _0x2262c3=resolveYamlFile(_0x2a8d67);if(!existsSync(_0x2262c3))return showFileNotFoundError(_0x2262c3,_0x2a8d67),0x1;_0x2ddd9d[_0x44fa3b(0x24c)]&&(console[_0x44fa3b(0x9a)](_0x44fa3b(0xf3)+_0x2ddd9d[_0x44fa3b(0x29d)]),console[_0x44fa3b(0x9a)](_0x44fa3b(0x1b7)+_0x2262c3));let _0x5a56c1;try{_0x5a56c1=readFileSync(_0x2262c3,'utf-8');}catch(_0x5264a6){const _0x12bb8c=_0x5264a6 instanceof Error?_0x5264a6[_0x44fa3b(0x112)]:String(_0x5264a6);return console[_0x44fa3b(0x9a)]('Error\x20reading\x20file:\x20'+_0x12bb8c),0x1;}const _0x4c8c33=await withSpinner(_0x44fa3b(0x233),()=>_0x486c72[_0x44fa3b(0x1ee)]['pushParentYaml'](_0x5a56c1),{'verbose':_0x2ddd9d[_0x44fa3b(0x24c)]}),_0x210728=_0x4c8c33['data'],{isNew:_0x4b4427,name:_0x58dd8a,hasChanges:_0x149748,diffFormatted:_0x3ab975}=_0x210728;if(!_0x149748)return console[_0x44fa3b(0x9a)](_0x44fa3b(0xa6)+_0x58dd8a+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x4b4427?console[_0x44fa3b(0x9a)](_0x44fa3b(0x15e)+_0x58dd8a+'\x27:'):console['error'](_0x44fa3b(0x10b)+_0x58dd8a+'\x27:');console[_0x44fa3b(0x9a)]('─'['repeat'](0x3c)),console[_0x44fa3b(0x9a)](_0x3ab975),console[_0x44fa3b(0x9a)]('─'[_0x44fa3b(0xb1)](0x3c));const _0x5b8ebc=_0x4b4427?_0x44fa3b(0xa2)+_0x58dd8a+'\x27?':_0x44fa3b(0x164)+_0x58dd8a+'\x27?';if(!_0x2ddd9d[_0x44fa3b(0x25a)]){if(!isInteractive())return console['error'](a31_0x46217b[_0x44fa3b(0xba)]('\x0aError:'),_0x44fa3b(0x155)),console[_0x44fa3b(0x9a)](a31_0x46217b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2c6a57=await confirmKey(_0x5b8ebc);if(!_0x2c6a57)return console[_0x44fa3b(0x9a)](a31_0x46217b['yellow'](_0x44fa3b(0x127))),0x1;}const _0x1905c9=_0x4b4427?_0x44fa3b(0x8d):_0x44fa3b(0x143),_0x145164=await withSpinner(_0x1905c9+'\x20parent\x20segment\x20\x27'+_0x58dd8a+_0x44fa3b(0x14d),()=>_0x210728[_0x44fa3b(0x1eb)](),{'verbose':_0x2ddd9d[_0x44fa3b(0x24c)]}),_0x5b663b=_0x145164['data'],_0x5d5155=getConsoleNextUrl(_0x2ddd9d[_0x44fa3b(0x29d)],_0x44fa3b(0x277)+_0x5b663b['id']),_0x234928=_0x4b4427?_0x44fa3b(0x257):_0x44fa3b(0x1e0);return console[_0x44fa3b(0x9a)]('✔\x20'+_0x234928+'\x20parent\x20segment\x20\x27'+_0x5b663b['name']+'\x27'),console[_0x44fa3b(0x9a)]('\x20\x20'+_0x5d5155),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a31_0x1e12b4(0x1ef)]='segment:parent:validate';['description']=a31_0x1e12b4(0x102);async['execute'](_0x5b31b5){const _0x375293=a31_0x1e12b4,{options:_0x19b8ad,args:_0x1da154,tdx:_0x3c3906}=_0x5b31b5,_0x1bfb98=_0x19b8ad,_0x3454cd=_0x1da154[0x0]||_0x19b8ad['parentSegment'];if(!_0x3454cd)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+_0x375293(0x10f)+'Options:\x0a'+_0x375293(0x1fc)+_0x375293(0x21f)+_0x375293(0x206)),0x1;const _0x21f7f0=resolveYamlFile(_0x3454cd);if(!existsSync(_0x21f7f0))return showFileNotFoundError(_0x21f7f0,_0x3454cd),0x1;_0x1bfb98[_0x375293(0x24c)]&&(console['error'](_0x375293(0xf3)+_0x1bfb98['site']),console[_0x375293(0x9a)](_0x375293(0x1b7)+_0x21f7f0));let _0x855245;try{_0x855245=readFileSync(_0x21f7f0,_0x375293(0x288));}catch(_0x30ed3b){const _0x30dc11=_0x30ed3b instanceof Error?_0x30ed3b['message']:String(_0x30ed3b);return console[_0x375293(0x9a)]('Error\x20reading\x20file:\x20'+_0x30dc11),0x1;}const _0xb0f85b=createCommandSpinner(a31_0x46217b['dim'](_0x375293(0x14b)),{'verbose':_0x1bfb98[_0x375293(0x24c)]});_0xb0f85b[_0x375293(0x1e4)]();const _0x2a0835={'onProgress':_0xdf31a9=>{const _0x1b9715=_0x375293;_0xb0f85b[_0x1b9715(0x107)]=formatProgressMessage(_0xdf31a9);}};if(_0x1bfb98[_0x375293(0x19a)])_0x2a0835['master']=!![];if(_0x1bfb98[_0x375293(0xb7)])_0x2a0835['enriched']=!![];_0x1bfb98['attribute']&&(_0x2a0835[_0x375293(0x258)]=_0x1bfb98[_0x375293(0x258)]);_0x1bfb98[_0x375293(0x1c4)]&&(_0x2a0835[_0x375293(0x1c4)]=_0x1bfb98[_0x375293(0x1c4)]);if(_0x1bfb98[_0x375293(0x284)])_0x2a0835[_0x375293(0x284)]=_0x1bfb98[_0x375293(0x284)];let _0x166fc7;try{_0x166fc7=await _0x3c3906[_0x375293(0x1ee)][_0x375293(0x1d2)](_0x855245,_0x2a0835),_0xb0f85b['stop']();}catch(_0x25ce01){_0xb0f85b[_0x375293(0xa3)]();throw _0x25ce01;}const _0xb734fb=_0x1bfb98['interval']||_0x375293(0x26a);return this[_0x375293(0x19c)](_0x166fc7,_0x2a0835,_0x21f7f0,_0xb734fb),_0x166fc7[_0x375293(0x15c)]?0x0:0x1;}[a31_0x1e12b4(0x19c)](_0x56fae3,_0x4460d7,_0x283ba2,_0x2afe5a){const _0x2f3df6=a31_0x1e12b4;console[_0x2f3df6(0x9a)]('\x0a'+a31_0x46217b['bold'](_0x2f3df6(0x27a))+'\x20'+_0x56fae3['name']),console[_0x2f3df6(0x9a)]('═'[_0x2f3df6(0xb1)](0x3c)),this[_0x2f3df6(0x244)](_0x56fae3);if(typeof _0x4460d7[_0x2f3df6(0x258)]===_0x2f3df6(0x1a9)){this['displayAttributesStats'](_0x56fae3),this[_0x2f3df6(0x22d)](_0x56fae3),this[_0x2f3df6(0x14e)](_0x283ba2,_0x2afe5a,'attribute',_0x4460d7[_0x2f3df6(0x258)]);return;}if(_0x4460d7[_0x2f3df6(0x258)]===!![]){this[_0x2f3df6(0x245)](_0x56fae3),this[_0x2f3df6(0x22d)](_0x56fae3),this['displayPreviewHints'](_0x283ba2,_0x2afe5a,_0x2f3df6(0xd9));return;}if(typeof _0x4460d7[_0x2f3df6(0x1c4)]===_0x2f3df6(0x1a9)){this[_0x2f3df6(0x17d)](_0x56fae3,_0x2afe5a),this[_0x2f3df6(0x22d)](_0x56fae3),this[_0x2f3df6(0x14e)](_0x283ba2,_0x2afe5a,_0x2f3df6(0x1c4),_0x4460d7[_0x2f3df6(0x1c4)]);return;}if(_0x4460d7[_0x2f3df6(0x1c4)]===!![]){this[_0x2f3df6(0x17d)](_0x56fae3,_0x2afe5a),this[_0x2f3df6(0x22d)](_0x56fae3),this[_0x2f3df6(0x14e)](_0x283ba2,_0x2afe5a,_0x2f3df6(0xd0));return;}this[_0x2f3df6(0x245)](_0x56fae3),this[_0x2f3df6(0x17d)](_0x56fae3,_0x2afe5a),this['displayRealtimeInfo'](_0x56fae3),this['displaySummary'](_0x56fae3),this[_0x2f3df6(0x14e)](_0x283ba2,_0x2afe5a,_0x2f3df6(0x248));}[a31_0x1e12b4(0x18b)](_0x4087d5){displayRealtimeValidation(_0x4087d5);}[a31_0x1e12b4(0x14e)](_0x19d374,_0x1637b7,_0x15f0a4,_0xd1e00f){const _0x26a2bc=a31_0x1e12b4;console[_0x26a2bc(0x9a)]('\x0a'+a31_0x46217b[_0x26a2bc(0x140)](_0x26a2bc(0x1b5)));const _0x149ab0=_0x1637b7!=='-1d'?_0x26a2bc(0x20f)+_0x1637b7:'';if(_0x15f0a4==='attribute'&&_0xd1e00f)console[_0x26a2bc(0x9a)]('\x20\x20'+a31_0x46217b[_0x26a2bc(0x140)]('tdx\x20ps\x20preview\x20'+_0x19d374+_0x26a2bc(0x1fd)+_0xd1e00f+'\x22'+_0x149ab0));else{if(_0x15f0a4===_0x26a2bc(0x1c4)&&_0xd1e00f)console[_0x26a2bc(0x9a)]('\x20\x20'+a31_0x46217b[_0x26a2bc(0x140)](_0x26a2bc(0x84)+_0x19d374+_0x26a2bc(0xd2)+_0xd1e00f+'\x22'+_0x149ab0));else(_0x15f0a4===_0x26a2bc(0xd9)||_0x15f0a4===_0x26a2bc(0x248))&&console[_0x26a2bc(0x9a)]('\x20\x20'+a31_0x46217b[_0x26a2bc(0x140)](_0x26a2bc(0x84)+_0x19d374+_0x26a2bc(0x1ec)+_0x149ab0));}(_0x15f0a4===_0x26a2bc(0xd0)||_0x15f0a4===_0x26a2bc(0x248))&&console[_0x26a2bc(0x9a)]('\x20\x20'+a31_0x46217b[_0x26a2bc(0x140)](_0x26a2bc(0x84)+_0x19d374+'\x20--behavior\x20\x22<name>\x22'+_0x149ab0)),_0x15f0a4==='all'&&console[_0x26a2bc(0x9a)]('\x20\x20'+a31_0x46217b[_0x26a2bc(0x140)]('tdx\x20ps\x20preview\x20'+_0x19d374+_0x26a2bc(0xec)+_0x149ab0));}[a31_0x1e12b4(0x244)](_0x40db00){const _0x182410=a31_0x1e12b4,{master:_0x22cb7a}=_0x40db00,_0x4d4f72=_0x22cb7a[_0x182410(0x267)]?a31_0x46217b['green']('✔'):a31_0x46217b[_0x182410(0xba)]('✘');console[_0x182410(0x9a)]('\x0a'+a31_0x46217b[_0x182410(0x140)]('Master\x20Table')),console[_0x182410(0x9a)](_0x4d4f72+'\x20'+a31_0x46217b[_0x182410(0x24a)](_0x22cb7a[_0x182410(0x10a)]+'.'+_0x22cb7a[_0x182410(0x111)])),_0x22cb7a['schemaValid']?_0x22cb7a['rowCount']!==undefined&&console[_0x182410(0x9a)]('\x20\x20'+a31_0x46217b[_0x182410(0x140)](_0x182410(0x9f))+'\x20'+a31_0x46217b[_0x182410(0x228)](formatRows(_0x22cb7a[_0x182410(0x21b)]))):console['error']('\x20\x20'+a31_0x46217b[_0x182410(0xba)](_0x182410(0x151))+'\x20'+_0x22cb7a[_0x182410(0xc1)]);}[a31_0x1e12b4(0x245)](_0x5cc754){const _0x231d25=a31_0x1e12b4;if(_0x5cc754['attributes']['length']===0x0)return;console['error']('\x0a'+a31_0x46217b[_0x231d25(0x140)]('Attributes'));for(const _0x594c2b of _0x5cc754[_0x231d25(0xd9)]){const _0x309e3f=_0x594c2b['schemaValid']?a31_0x46217b[_0x231d25(0x1a7)]('✔'):a31_0x46217b[_0x231d25(0xba)]('✘');let _0x55e913='';if(_0x594c2b[_0x231d25(0x267)]&&_0x594c2b[_0x231d25(0x1e3)]!==undefined&&_0x594c2b[_0x231d25(0x126)]!==undefined){const _0x2906d6=_0x594c2b[_0x231d25(0x126)]['toFixed'](0x1),_0x288630=_0x594c2b[_0x231d25(0x126)]>=0x50?a31_0x46217b[_0x231d25(0x1a7)]:_0x594c2b[_0x231d25(0x126)]>=0x32?a31_0x46217b[_0x231d25(0x289)]:a31_0x46217b[_0x231d25(0xba)];_0x55e913='\x20'+a31_0x46217b[_0x231d25(0x140)](_0x231d25(0x1c3))+'\x20'+_0x288630(_0x2906d6+'%')+'\x20('+formatRows(_0x594c2b['matchedCount'])+_0x231d25(0xff);}console[_0x231d25(0x9a)](_0x309e3f+'\x20'+a31_0x46217b['bold'](_0x594c2b[_0x231d25(0x1ef)])+_0x55e913),console[_0x231d25(0x9a)]('\x20\x20'+a31_0x46217b['dim'](_0x231d25(0xb4))+'\x20'+a31_0x46217b[_0x231d25(0x24a)](_0x594c2b[_0x231d25(0x10a)]+'.'+_0x594c2b[_0x231d25(0x111)]));const _0x2f999b=_0x594c2b[_0x231d25(0x1f2)]===_0x594c2b[_0x231d25(0x246)]?a31_0x46217b['dim'](_0x231d25(0x26f))+'\x20'+_0x594c2b[_0x231d25(0x1f2)]:a31_0x46217b[_0x231d25(0x140)](_0x231d25(0xd6))+'\x20'+_0x594c2b[_0x231d25(0x1f2)]+_0x231d25(0x162)+_0x594c2b['foreignKey'];console[_0x231d25(0x9a)]('\x20\x20'+_0x2f999b),console[_0x231d25(0x9a)]('\x20\x20'+a31_0x46217b['dim'](_0x231d25(0x23e))),this['displayColumns'](_0x594c2b[_0x231d25(0x9b)]),!_0x594c2b[_0x231d25(0x267)]&&console['error']('\x20\x20'+a31_0x46217b[_0x231d25(0xba)]('Error:')+'\x20'+_0x594c2b[_0x231d25(0xc1)]);}}['displayBehaviorsStats'](_0x3a64be,_0x543e9f){const _0x59b8ad=a31_0x1e12b4;if(_0x3a64be[_0x59b8ad(0xd0)][_0x59b8ad(0x179)]===0x0)return;console['error']('\x0a'+a31_0x46217b[_0x59b8ad(0x140)](_0x59b8ad(0x1bf))+'\x20'+a31_0x46217b[_0x59b8ad(0x140)]('('+_0x543e9f+')'));for(const _0x5340fd of _0x3a64be[_0x59b8ad(0xd0)]){const _0x204ba8=_0x5340fd[_0x59b8ad(0x267)]?a31_0x46217b[_0x59b8ad(0x1a7)]('✔'):a31_0x46217b[_0x59b8ad(0xba)]('✘');let _0x56307f='';if(_0x5340fd[_0x59b8ad(0x267)]&&_0x5340fd[_0x59b8ad(0x13b)]!==undefined&&_0x5340fd[_0x59b8ad(0x1cd)]!==undefined){const _0x329b2c=_0x5340fd[_0x59b8ad(0x2a2)]?.[_0x59b8ad(0x221)](0x1)||'?',_0x1c46a3=(_0x5340fd[_0x59b8ad(0x2a2)]??0x0)>=0x32?a31_0x46217b['green']:(_0x5340fd['customerPercent']??0x0)>=0x14?a31_0x46217b['yellow']:a31_0x46217b[_0x59b8ad(0xba)];_0x56307f='\x20'+a31_0x46217b[_0x59b8ad(0x140)](_0x59b8ad(0xbf))+'\x20'+_0x1c46a3(formatRows(_0x5340fd[_0x59b8ad(0x13b)]))+'\x20('+_0x329b2c+'%)\x20'+a31_0x46217b['dim'](_0x59b8ad(0x207))+'\x20'+a31_0x46217b[_0x59b8ad(0x228)](formatRows(_0x5340fd[_0x59b8ad(0x1cd)]));}console[_0x59b8ad(0x9a)](_0x204ba8+'\x20'+a31_0x46217b[_0x59b8ad(0x24a)](_0x5340fd[_0x59b8ad(0x1ef)])+_0x56307f),console[_0x59b8ad(0x9a)]('\x20\x20'+a31_0x46217b[_0x59b8ad(0x140)](_0x59b8ad(0xb4))+'\x20'+a31_0x46217b[_0x59b8ad(0x24a)](_0x5340fd['database']+'.'+_0x5340fd[_0x59b8ad(0x111)]));const _0x26fd02=_0x5340fd[_0x59b8ad(0x1f2)]===_0x5340fd[_0x59b8ad(0x246)]?a31_0x46217b['dim'](_0x59b8ad(0x26f))+'\x20'+_0x5340fd[_0x59b8ad(0x1f2)]:a31_0x46217b[_0x59b8ad(0x140)](_0x59b8ad(0xd6))+'\x20'+_0x5340fd[_0x59b8ad(0x1f2)]+_0x59b8ad(0x162)+_0x5340fd[_0x59b8ad(0x246)];console['error']('\x20\x20'+_0x26fd02),console[_0x59b8ad(0x9a)]('\x20\x20'+a31_0x46217b[_0x59b8ad(0x140)]('Columns:')),this[_0x59b8ad(0x281)](_0x5340fd[_0x59b8ad(0x9b)]),!_0x5340fd[_0x59b8ad(0x267)]&&console[_0x59b8ad(0x9a)]('\x20\x20'+a31_0x46217b[_0x59b8ad(0xba)]('Error:')+'\x20'+_0x5340fd[_0x59b8ad(0xc1)]);}}[a31_0x1e12b4(0x281)](_0x416d7f){const _0x20c00e=a31_0x1e12b4;for(const _0x147f0d of _0x416d7f){_0x147f0d[_0x20c00e(0x293)]===_0x147f0d['column']||_0x147f0d[_0x20c00e(0x176)]==='*'?console[_0x20c00e(0x9a)](_0x20c00e(0xcd)+_0x147f0d[_0x20c00e(0x293)]):console['error'](_0x20c00e(0xcd)+_0x147f0d[_0x20c00e(0x293)]+'\x20'+a31_0x46217b[_0x20c00e(0x140)]('('+_0x147f0d[_0x20c00e(0x176)]+')'));}}[a31_0x1e12b4(0x22d)](_0x448d69){const _0x666ae9=a31_0x1e12b4;console[_0x666ae9(0x9a)]('─'[_0x666ae9(0xb1)](0x3c));if(_0x448d69[_0x666ae9(0x203)][_0x666ae9(0x179)]>0x0){console[_0x666ae9(0x9a)]('\x0a'+a31_0x46217b[_0x666ae9(0xba)]('Errors:'));for(const _0x2156a3 of _0x448d69[_0x666ae9(0x203)]){console[_0x666ae9(0x9a)]('\x20\x20'+a31_0x46217b['red']('•')+'\x20'+_0x2156a3);}}_0x448d69[_0x666ae9(0x15c)]&&console[_0x666ae9(0x9a)]('\x0a'+a31_0x46217b[_0x666ae9(0x1a7)]('✔')+_0x666ae9(0x12a));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x142);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x1d0);async[a31_0x1e12b4(0x26e)](_0x3d8f16){const _0x13562f=a31_0x1e12b4,{options:_0x2d2397,args:_0x2384fa,tdx:_0x68185c}=_0x3d8f16,_0xce18c9=_0x2d2397,_0x3c50a0=_0x2384fa[0x0]||_0x2d2397['parentSegment'];if(!_0x3c50a0)return showParentSegmentNotSetError(_0x13562f(0x21a)+_0x13562f(0x222)+_0x13562f(0x28c)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x13562f(0x181)+_0x13562f(0x27f)+_0x13562f(0x206)),0x1;if(!_0xce18c9[_0x13562f(0x19a)]&&!_0xce18c9[_0x13562f(0x258)]&&!_0xce18c9[_0x13562f(0x1c4)]&&!_0xce18c9[_0x13562f(0xb7)])return console[_0x13562f(0x9a)](a31_0x46217b[_0x13562f(0xba)](_0x13562f(0x1fa))),console['error'](_0x13562f(0xaf)),console[_0x13562f(0x9a)](_0x13562f(0x171)),console[_0x13562f(0x9a)](_0x13562f(0x17a)),console[_0x13562f(0x9a)](_0x13562f(0x8a)),console['error'](_0x13562f(0x1d8)),console['error'](_0x13562f(0x1e7)),0x1;const _0x19357d=resolveYamlFile(_0x3c50a0);if(!existsSync(_0x19357d))return showFileNotFoundError(_0x19357d,_0x3c50a0),0x1;_0xce18c9['verbose']&&(console[_0x13562f(0x9a)](_0x13562f(0xf3)+_0xce18c9[_0x13562f(0x29d)]),console['error']('YAML\x20file:\x20'+_0x19357d));let _0x437ba7;try{_0x437ba7=readFileSync(_0x19357d,'utf-8');}catch(_0x7d0758){const _0x4d02c4=_0x7d0758 instanceof Error?_0x7d0758[_0x13562f(0x112)]:String(_0x7d0758);return console[_0x13562f(0x9a)]('Error\x20reading\x20file:\x20'+_0x4d02c4),0x1;}let _0x2a7ed0;try{_0x2a7ed0=parseDef(_0x437ba7);}catch(_0x308b4e){const _0x1baf4d=_0x308b4e instanceof Error?_0x308b4e['message']:String(_0x308b4e);return console[_0x13562f(0x9a)](a31_0x46217b['red']('Error\x20parsing\x20YAML:\x20'+_0x1baf4d)),0x1;}if(_0xce18c9[_0x13562f(0x258)]===!![]||_0xce18c9[_0x13562f(0x258)]===''){const _0x587bc5=_0x2a7ed0[_0x13562f(0xd9)]?.[_0x13562f(0x16f)](_0xc44c46=>_0xc44c46['name'])||[];if(_0x587bc5['length']===0x0)console[_0x13562f(0x9a)](a31_0x46217b['red'](_0x13562f(0xc2)));else{console[_0x13562f(0x9a)](a31_0x46217b['red'](_0x13562f(0x8e))),console['error']('Available\x20attributes:');for(const _0x4728d2 of _0x587bc5){console[_0x13562f(0x9a)]('\x20\x20'+a31_0x46217b['cyan'](_0x4728d2));}console[_0x13562f(0x9a)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x3c50a0+_0x13562f(0x1fd)+_0x587bc5[0x0]+'\x22');}return 0x1;}if(_0xce18c9[_0x13562f(0x1c4)]===!![]||_0xce18c9['behavior']===''){const _0x5040a7=_0x2a7ed0[_0x13562f(0xd0)]?.['map'](_0x1a08c0=>_0x1a08c0[_0x13562f(0x1ef)])||[];if(_0x5040a7[_0x13562f(0x179)]===0x0)console['error'](a31_0x46217b[_0x13562f(0xba)](_0x13562f(0xc3)));else{console['error'](a31_0x46217b[_0x13562f(0xba)](_0x13562f(0xfe))),console[_0x13562f(0x9a)](_0x13562f(0x144));for(const _0x22906e of _0x5040a7){console[_0x13562f(0x9a)]('\x20\x20'+a31_0x46217b[_0x13562f(0x228)](_0x22906e));}console[_0x13562f(0x9a)](_0x13562f(0x213)+_0x3c50a0+_0x13562f(0xd2)+_0x5040a7[0x0]+'\x22');}return 0x1;}const _0x42eb99=createCommandSpinner(a31_0x46217b['dim'](_0x13562f(0x175)),{'verbose':_0xce18c9[_0x13562f(0x24c)]});_0x42eb99[_0x13562f(0x1e4)]();const _0x2af286={'onProgress':_0x3a7ec1=>{const _0x1e876d=_0x13562f;_0x42eb99[_0x1e876d(0x107)]=formatProgressMessage(_0x3a7ec1);}};if(_0xce18c9['master'])_0x2af286[_0x13562f(0x19a)]=!![];if(_0xce18c9['attribute']&&typeof _0xce18c9[_0x13562f(0x258)]===_0x13562f(0x1a9))_0x2af286[_0x13562f(0x258)]=_0xce18c9[_0x13562f(0x258)];if(_0xce18c9[_0x13562f(0x1c4)]&&typeof _0xce18c9[_0x13562f(0x1c4)]==='string')_0x2af286[_0x13562f(0x1c4)]=_0xce18c9[_0x13562f(0x1c4)];if(_0xce18c9[_0x13562f(0xb7)])_0x2af286['enriched']=!![];if(_0xce18c9['interval'])_0x2af286[_0x13562f(0x284)]=_0xce18c9[_0x13562f(0x284)];let _0x2ffb7d;try{_0x2ffb7d=await _0x68185c[_0x13562f(0x1ee)][_0x13562f(0xda)](_0x437ba7,_0x2af286),_0x42eb99[_0x13562f(0xa3)]();}catch(_0xf73fdf){_0x42eb99[_0x13562f(0xa3)]();throw _0xf73fdf;}return await this[_0x13562f(0x89)](_0x2ffb7d,{'master':_0xce18c9['master'],'attribute':typeof _0xce18c9[_0x13562f(0x258)]==='string'?_0xce18c9['attribute']:undefined,'behavior':typeof _0xce18c9[_0x13562f(0x1c4)]===_0x13562f(0x1a9)?_0xce18c9[_0x13562f(0x1c4)]:undefined,'enriched':_0xce18c9[_0x13562f(0xb7)]}),_0x2ffb7d[_0x13562f(0x15c)]?0x0:0x1;}async[a31_0x1e12b4(0x89)](_0x3f323e,_0x332a6f){const _0xd4c913=a31_0x1e12b4;console['error']('\x0a'+a31_0x46217b[_0xd4c913(0x24a)](_0xd4c913(0x16b))+'\x20'+_0x3f323e[_0xd4c913(0x1ef)]),console[_0xd4c913(0x9a)]('═'[_0xd4c913(0xb1)](0x3c));if(_0x332a6f[_0xd4c913(0x19a)]&&_0x3f323e[_0xd4c913(0x152)]){const _0x5dfcc2=a31_0x46217b[_0xd4c913(0x140)](_0xd4c913(0x268))+'\x20'+a31_0x46217b[_0xd4c913(0x24a)](_0x3f323e[_0xd4c913(0x19a)][_0xd4c913(0x10a)]+'.'+_0x3f323e[_0xd4c913(0x19a)][_0xd4c913(0x111)]);await this['displaySampleData'](_0x5dfcc2,_0x3f323e['sampleData']);}else{if(_0x332a6f[_0xd4c913(0x258)]&&_0x3f323e[_0xd4c913(0x152)]){const _0x5c3b70=a31_0x46217b['dim']('Attribute:')+'\x20'+a31_0x46217b[_0xd4c913(0x24a)](_0x332a6f[_0xd4c913(0x258)]);await this[_0xd4c913(0x12c)](_0x5c3b70,_0x3f323e[_0xd4c913(0x152)]);}else{if(_0x332a6f[_0xd4c913(0x1c4)]&&_0x3f323e[_0xd4c913(0x152)]){const _0x5ad0eb=a31_0x46217b['dim']('Behavior:')+'\x20'+a31_0x46217b[_0xd4c913(0x24a)](_0x332a6f['behavior']);await this[_0xd4c913(0x12c)](_0x5ad0eb,_0x3f323e[_0xd4c913(0x152)]);}else{if(_0x332a6f[_0xd4c913(0xb7)]&&_0x3f323e[_0xd4c913(0x152)]){const _0x1d4236=a31_0x46217b[_0xd4c913(0x140)](_0xd4c913(0x136))+'\x20'+a31_0x46217b[_0xd4c913(0x24a)]('Master\x20+\x20Attributes');await this[_0xd4c913(0x12c)](_0x1d4236,_0x3f323e[_0xd4c913(0x152)]);}else!_0x3f323e[_0xd4c913(0x152)]&&console[_0xd4c913(0x9a)](_0xd4c913(0x1c6));}}}if(_0x3f323e[_0xd4c913(0x203)]['length']>0x0){console[_0xd4c913(0x9a)]('─'['repeat'](0x3c)),console['error']('\x0a'+a31_0x46217b[_0xd4c913(0xba)]('Errors:'));for(const _0x40b1d7 of _0x3f323e[_0xd4c913(0x203)]){console[_0xd4c913(0x9a)]('\x20\x20'+a31_0x46217b['red']('•')+'\x20'+_0x40b1d7);}}}async[a31_0x1e12b4(0x12c)](_0x38a041,_0x38c61c){const _0x5d6a5f=a31_0x1e12b4;if(_0x38c61c[_0x5d6a5f(0x179)]===0x0){console['error']('\x0a'+_0x38a041),console['error'](_0x5d6a5f(0x223));return;}console[_0x5d6a5f(0x9a)]('\x0a'+_0x38a041);const _0x1e7bba=Object['keys'](_0x38c61c[0x0])[_0x5d6a5f(0x16f)](_0x5c8dd4=>({'name':_0x5c8dd4,'type':typeof _0x38c61c[0x0][_0x5c8dd4]===_0x5d6a5f(0xf7)?_0x5d6a5f(0xfb):_0x5d6a5f(0x296)})),_0x382ebb={'queryId':'preview','columns':_0x1e7bba,'data':_0x38c61c,'stats':{'state':_0x5d6a5f(0x273),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x38c61c[_0x5d6a5f(0x179)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x2987c4=formatAsTable(_0x382ebb,_0x38c61c[_0x5d6a5f(0x179)],!![]);await writeOutput(_0x2987c4,undefined,_0x5d6a5f(0x111));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0xaa);[a31_0x1e12b4(0x18c)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a31_0x1e12b4(0x26e)](_0x17dae5){const _0x59e833=a31_0x1e12b4,{options:_0x4e8ef6,args:_0x41f17a,tdx:_0x5bf404}=_0x17dae5,_0x1610bf=_0x4e8ef6,_0x10dc37=_0x41f17a[0x0]||_0x4e8ef6[_0x59e833(0x1ce)];if(!_0x10dc37)return showParentSegmentNotSetError(_0x59e833(0x231)+_0x59e833(0x262)),0x1;const _0x28456f=resolveYamlFile(_0x10dc37);if(existsSync(_0x28456f)){_0x1610bf['verbose']&&console[_0x59e833(0x9a)](_0x59e833(0x12e)+_0x28456f);let _0x28467d;try{_0x28467d=readFileSync(_0x28456f,_0x59e833(0x288));}catch(_0x2f5ab2){const _0x45ac2f=_0x2f5ab2 instanceof Error?_0x2f5ab2[_0x59e833(0x112)]:String(_0x2f5ab2);return console['error'](_0x59e833(0x1ff)+_0x45ac2f),0x1;}const _0x358ecb=await withSpinner(_0x59e833(0x233),()=>_0x5bf404[_0x59e833(0x1ee)][_0x59e833(0x108)](_0x28467d),{'verbose':_0x1610bf['verbose']}),_0x51bf9e=_0x358ecb[_0x59e833(0x22f)],{isNew:_0x1de039,name:_0x31eb6d,hasChanges:_0x40ae33,diffFormatted:_0x221ecd}=_0x51bf9e;if(_0x40ae33){_0x1de039?console[_0x59e833(0x9a)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x31eb6d+'\x27:'):console[_0x59e833(0x9a)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x31eb6d+'\x27:');console[_0x59e833(0x9a)]('─'['repeat'](0x3c)),console[_0x59e833(0x9a)](_0x221ecd),console[_0x59e833(0x9a)]('─'[_0x59e833(0xb1)](0x3c));const _0x30af0c=_0x1de039?_0x59e833(0xa2)+_0x31eb6d+_0x59e833(0x1ae):_0x59e833(0x164)+_0x31eb6d+'\x27\x20and\x20run\x20workflow?';if(!_0x1610bf[_0x59e833(0x25a)]){if(!isInteractive())return console[_0x59e833(0x9a)](a31_0x46217b['red'](_0x59e833(0x25c)),_0x59e833(0x155)),console[_0x59e833(0x9a)](a31_0x46217b[_0x59e833(0x140)](_0x59e833(0x15d))),0x1;const _0x41d446=await confirmKey(_0x30af0c);if(!_0x41d446)return console['error'](a31_0x46217b[_0x59e833(0x289)](_0x59e833(0x127))),0x1;}const _0x4c13f8=_0x1de039?_0x59e833(0x8d):'Updating';await withSpinner(_0x4c13f8+'\x20parent\x20segment\x20\x27'+_0x31eb6d+_0x59e833(0x14d),()=>_0x51bf9e[_0x59e833(0x1eb)](),{'verbose':_0x1610bf[_0x59e833(0x24c)]});const _0x2c7175=_0x1de039?'Created':'Updated';console[_0x59e833(0x9a)]('✔\x20'+_0x2c7175+_0x59e833(0xc6)+_0x31eb6d+'\x27');}else console[_0x59e833(0x9a)]('✔\x20No\x20changes\x20-\x20\x27'+_0x31eb6d+_0x59e833(0x100));}const _0x574d2d=await withSpinner(_0x59e833(0x1a0)+_0x10dc37+_0x59e833(0x14d),()=>_0x5bf404[_0x59e833(0x1ee)][_0x59e833(0x104)](_0x10dc37),{'verbose':_0x1610bf[_0x59e833(0x24c)]}),_0xcd9714=_0x574d2d[_0x59e833(0x22f)],_0x4114e4=getConsoleUrl(_0x1610bf[_0x59e833(0x29d)],_0x59e833(0x18a)+_0xcd9714[_0x59e833(0x299)]+_0x59e833(0x27b)+_0xcd9714[_0x59e833(0xcc)]+_0x59e833(0x256)+_0xcd9714[_0x59e833(0x1b8)]);return console[_0x59e833(0x9a)]('\x0a✔\x20Workflow\x20started'),console[_0x59e833(0x9a)]('\x20\x20'+a31_0x46217b[_0x59e833(0x140)](_0x59e833(0x10e))+'\x20'+_0xcd9714[_0x59e833(0x191)]),console['error']('\x20\x20'+a31_0x46217b[_0x59e833(0x140)](_0x59e833(0x261))+'\x20'+_0xcd9714['status']),console[_0x59e833(0x9a)]('\x20\x20'+a31_0x46217b[_0x59e833(0x140)](_0x59e833(0x253))+'\x20'+_0xcd9714[_0x59e833(0xcc)]),console[_0x59e833(0x9a)]('\x20\x20'+a31_0x46217b[_0x59e833(0x140)]('Attempt:')+'\x20'+_0xcd9714[_0x59e833(0x1b8)]),console[_0x59e833(0x9a)]('\x20\x20'+_0x4114e4),console['error']('\x0a'+a31_0x46217b[_0x59e833(0x140)](_0x59e833(0x95))+_0x59e833(0x1bd)+_0xcd9714[_0x59e833(0x1b8)]+_0x59e833(0xf0)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x92);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x1cf);async[a31_0x1e12b4(0x26e)](_0x5da118){const _0x3edfeb=a31_0x1e12b4,{options:_0x15e816,args:_0x3e4857,tdx:_0x387f2c}=_0x5da118,_0x1e7501=_0x3e4857[0x0]||_0x15e816[_0x3edfeb(0x1ce)];if(!_0x1e7501)return showParentSegmentNotSetError(_0x3edfeb(0x20c)+_0x3edfeb(0x266)),0x1;_0x15e816[_0x3edfeb(0x24c)]&&(console[_0x3edfeb(0x9a)](_0x3edfeb(0xf3)+_0x15e816[_0x3edfeb(0x29d)]),console[_0x3edfeb(0x9a)](_0x3edfeb(0xf8)+_0x1e7501));const _0x878b3=await withSpinner(_0x3edfeb(0x1e9)+_0x1e7501+_0x3edfeb(0x14d),()=>_0x387f2c[_0x3edfeb(0x1ee)]['listFields'](_0x1e7501),{'verbose':_0x15e816[_0x3edfeb(0x24c)]}),_0x5bf17e=_0x878b3[_0x3edfeb(0x22f)];console[_0x3edfeb(0x9a)](_0x3edfeb(0x1ad)+_0x5bf17e[_0x3edfeb(0x179)]+'\x20field'+(_0x5bf17e[_0x3edfeb(0x179)]!==0x1?'s':''));if(_0x15e816[_0x3edfeb(0x141)]||_0x15e816[_0x3edfeb(0x24b)])return await handleSDKOutput(_0x5bf17e,_0x15e816),0x0;return displayFieldsHumanReadable(_0x5bf17e,_0x1e7501),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x26b);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x116);async['execute'](_0x3b6b6d){const _0x4a3e1f=a31_0x1e12b4,{options:_0x58854d,args:_0x2fd60c,tdx:_0x585e64}=_0x3b6b6d,_0x559522=_0x58854d,_0x354a6c=_0x2fd60c[0x0]||_0x58854d[_0x4a3e1f(0x1ce)];if(!_0x354a6c)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a'+_0x4a3e1f(0x10c)+_0x4a3e1f(0x134)+_0x4a3e1f(0x123)),0x1;_0x58854d['verbose']&&(console[_0x4a3e1f(0x9a)](_0x4a3e1f(0xf3)+_0x58854d['site']),console['error'](_0x4a3e1f(0xf8)+_0x354a6c));const _0x435900=await withSpinner(_0x4a3e1f(0x17f)+_0x354a6c+_0x4a3e1f(0x14d),()=>_0x585e64[_0x4a3e1f(0x1ee)][_0x4a3e1f(0x1cc)](_0x354a6c),{'verbose':_0x58854d['verbose']}),_0x3e54f8=_0x435900['data'];if(_0x559522['web']){const _0x1ddfa3=getConsoleNextUrl(_0x559522[_0x4a3e1f(0x29d)],_0x4a3e1f(0x277)+_0x3e54f8['id']);return console[_0x4a3e1f(0x9a)](a31_0x46217b[_0x4a3e1f(0x1a7)]('✔')+_0x4a3e1f(0x21c)+a31_0x46217b[_0x4a3e1f(0x228)](_0x1ddfa3)),openBrowser(_0x1ddfa3),0x0;}return await handleSingleObjectOutput(_0x3e54f8,_0x58854d),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0xed);[a31_0x1e12b4(0x18c)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a31_0x1e12b4(0x26e)](_0x341856){const _0x117e7b=a31_0x1e12b4,{options:_0x7a4a92,args:_0x14ea5f,tdx:_0x411fbd}=_0x341856,_0xff3941=_0x7a4a92,_0x50a47f=_0x14ea5f[0x0]||_0x7a4a92[_0x117e7b(0x1ce)];if(!_0x50a47f)return showParentSegmentNotSetError(_0x117e7b(0x1c2)+_0x117e7b(0x18e)+_0x117e7b(0x134)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x7a4a92[_0x117e7b(0x24c)]&&(console['error'](_0x117e7b(0xf3)+_0x7a4a92[_0x117e7b(0x29d)]),console['error'](_0x117e7b(0xf8)+_0x50a47f));const _0x40a35b=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x50a47f+_0x117e7b(0x14d),()=>_0x411fbd[_0x117e7b(0x1ee)]['resolveParentId'](_0x50a47f),{'verbose':_0x7a4a92[_0x117e7b(0x24c)]}),_0x52e85e=_0x40a35b['data'],_0x5a2ab9=_0x411fbd['segment']['getOutputDatabaseName'](_0x52e85e);if(_0xff3941[_0x117e7b(0x114)]){const _0x1dcd3e=await this[_0x117e7b(0x250)](_0x341856,_0x50a47f,_0x52e85e,_0x5a2ab9),_0x59d74b=this['formatSchemaJson'](_0x1dcd3e);writeFileSync(_0xff3941['output'],_0x59d74b);const _0x24ff61=_0x1dcd3e['customers'][_0x117e7b(0x9b)]['length']+_0x1dcd3e['behaviors'][_0x117e7b(0xdd)]((_0x1bf47b,_0x57a7ef)=>_0x1bf47b+_0x57a7ef[_0x117e7b(0x9b)][_0x117e7b(0x179)],0x0),_0x2d8412=_0x1dcd3e[_0x117e7b(0xd0)][_0x117e7b(0x1b3)](_0x5b43bb=>_0x5b43bb[_0x117e7b(0x9b)][_0x117e7b(0x179)]===0x0)[_0x117e7b(0x179)];return console[_0x117e7b(0xc0)](_0x117e7b(0x190)+_0xff3941['output']),console['log'](_0x117e7b(0x18f)+_0x5a2ab9),console[_0x117e7b(0xc0)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x1dcd3e[_0x117e7b(0xd0)][_0x117e7b(0x179)]+'\x20behaviors'),console[_0x117e7b(0xc0)]('\x20\x20Columns:\x20'+_0x24ff61+_0x117e7b(0x24f)),_0x2d8412>0x0&&console['log'](_0x117e7b(0x169)+_0x2d8412+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console['error']('\x0a'+a31_0x46217b['bold']('Output\x20Database:')+'\x20'+a31_0x46217b['cyan'](_0x5a2ab9));const _0x453fb9=await withSpinner(_0x117e7b(0x22c),()=>_0x411fbd[_0x117e7b(0x1ee)]['getParentSQL'](_0x52e85e),{'verbose':_0x7a4a92[_0x117e7b(0x24c)]});console[_0x117e7b(0x9a)]('\x0a'+a31_0x46217b['bold']('customers')+'\x20'+a31_0x46217b[_0x117e7b(0x140)]('('+_0x5a2ab9+_0x117e7b(0x216)));const _0x2cd9d1=await executeSchemaQuery(_0x453fb9[_0x117e7b(0x22f)],_0x411fbd,_0x7a4a92);await handleQueryOutput(_0x2cd9d1,_0x7a4a92);const _0x180e92=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x411fbd[_0x117e7b(0x1ee)]['getBehaviorNames'](_0x52e85e),{'verbose':_0x7a4a92['verbose']});for(const _0x3397ef of _0x180e92[_0x117e7b(0x22f)]){const _0x11e1b0=_0x117e7b(0x193)+_0x3397ef['toLowerCase']()[_0x117e7b(0x192)](/\s+/g,'_'),_0xfcc253=_0x117e7b(0xa0)+_0x5a2ab9+'.'+_0x11e1b0;console['error']('\x0a'+a31_0x46217b[_0x117e7b(0x24a)](_0x3397ef)+'\x20'+a31_0x46217b['dim']('('+_0x5a2ab9+'.'+_0x11e1b0+')'));try{const _0x34fdc5=await executeSchemaQuery(_0xfcc253,_0x411fbd,_0x7a4a92);await handleQueryOutput(_0x34fdc5,_0x7a4a92);}catch{console[_0x117e7b(0x9a)](a31_0x46217b[_0x117e7b(0x289)](_0x117e7b(0xbd)));}}return 0x0;}async[a31_0x1e12b4(0x250)](_0x39170b,_0x180b4a,_0x1dadd8,_0x37ca52){const _0x1cdfd3=a31_0x1e12b4,{options:_0x5684e4,tdx:_0x49e480}=_0x39170b,_0x1f8712=await withSpinner(_0x1cdfd3(0x22c),()=>_0x49e480[_0x1cdfd3(0x1ee)][_0x1cdfd3(0x88)](_0x1dadd8),{'verbose':_0x5684e4[_0x1cdfd3(0x24c)]}),_0x3bdef8=await executeSchemaQuery(_0x1f8712[_0x1cdfd3(0x22f)],_0x49e480,_0x5684e4),_0x2a17e0=_0x3bdef8['data']['map'](_0x48bf64=>({'name':_0x48bf64[_0x1cdfd3(0x124)],'type':_0x48bf64[_0x1cdfd3(0x274)]})),_0x5e067f=await withSpinner(_0x1cdfd3(0x291),()=>_0x49e480[_0x1cdfd3(0x1ee)]['getBehaviorNames'](_0x1dadd8),{'verbose':_0x5684e4[_0x1cdfd3(0x24c)]}),_0x227aa5=[];for(const _0x58b212 of _0x5e067f['data']){const _0x573c99='behavior_'+_0x58b212['toLowerCase']()['replace'](/\s+/g,'_'),_0x595254='SELECT\x20*\x20FROM\x20'+_0x37ca52+'.'+_0x573c99;let _0x23f0a9=[];try{const _0x3e590b=await executeSchemaQuery(_0x595254,_0x49e480,_0x5684e4);_0x23f0a9=_0x3e590b['data']['map'](_0x17cf4b=>({'name':_0x17cf4b[_0x1cdfd3(0x124)],'type':_0x17cf4b[_0x1cdfd3(0x274)]}));}catch{}_0x227aa5[_0x1cdfd3(0x195)]({'table':_0x573c99,'columns':_0x23f0a9});}return{'database':_0x37ca52,'parent_segment':_0x180b4a,'parent_id':_0x1dadd8,'customers':{'table':_0x1cdfd3(0x9c),'columns':_0x2a17e0},'behaviors':_0x227aa5};}[a31_0x1e12b4(0x234)](_0x4649d4){const _0xc2dc58=a31_0x1e12b4,_0x40111e=_0x5b2253=>{const _0x20c577=a31_0x556b;if(_0x5b2253[_0x20c577(0x179)]===0x0)return'[]';const _0x6980cc=_0x5b2253[_0x20c577(0x16f)](_0x56bb5d=>_0x20c577(0x1c5)+_0x56bb5d['name']+_0x20c577(0x1f5)+_0x56bb5d[_0x20c577(0x185)]+_0x20c577(0x280));return'[\x0a'+_0x6980cc[_0x20c577(0x161)](',\x0a')+_0x20c577(0x13e);},_0x5a23db=_0x4649d4[_0xc2dc58(0xd0)][_0xc2dc58(0x16f)](_0x1c10b9=>{const _0x28a9ae=_0xc2dc58;return _0x28a9ae(0x21e)+_0x1c10b9[_0x28a9ae(0x111)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x40111e(_0x1c10b9[_0x28a9ae(0x9b)])['replace'](/^/gm,'\x20\x20')[_0x28a9ae(0x1f7)]()+'\x0a\x20\x20\x20\x20}';})[_0xc2dc58(0x161)](',\x0a');return _0xc2dc58(0xe3)+_0x4649d4[_0xc2dc58(0x10a)]+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x4649d4[_0xc2dc58(0xf2)]+_0xc2dc58(0xf9)+_0x4649d4[_0xc2dc58(0x122)]+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x4649d4['customers'][_0xc2dc58(0x111)]+_0xc2dc58(0xe8)+_0x40111e(_0x4649d4[_0xc2dc58(0x9c)][_0xc2dc58(0x9b)])[_0xc2dc58(0x192)](/^/gm,'\x20\x20')['trim']()+_0xc2dc58(0x230)+_0x5a23db+_0xc2dc58(0x1a1);}}export class ParentSegmentSQLCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x1a2);['description']=a31_0x1e12b4(0x11a);async[a31_0x1e12b4(0x26e)](_0x4bc1a9){const _0x1339f5=a31_0x1e12b4,{options:_0x5d5eb2,args:_0x1b8438,tdx:_0x5d89f4}=_0x4bc1a9,_0x197d9a=_0x1b8438[0x0]||_0x5d5eb2[_0x1339f5(0x1ce)];if(!_0x197d9a)return showParentSegmentNotSetError(_0x1339f5(0xfa)+_0x1339f5(0xd5)),0x1;_0x5d5eb2[_0x1339f5(0x24c)]&&(console[_0x1339f5(0x9a)]('Site:\x20'+_0x5d5eb2[_0x1339f5(0x29d)]),console[_0x1339f5(0x9a)](_0x1339f5(0xf8)+_0x197d9a));const _0x43872e=await withSpinner(_0x1339f5(0xcb)+_0x197d9a+'\x27...',()=>_0x5d89f4[_0x1339f5(0x1ee)][_0x1339f5(0x17e)](_0x197d9a),{'verbose':_0x5d5eb2[_0x1339f5(0x24c)]}),_0x33ffad=_0x43872e[_0x1339f5(0x22f)],_0x5236dc=await withSpinner(_0x1339f5(0xcf)+_0x197d9a+_0x1339f5(0x14d),()=>_0x5d89f4[_0x1339f5(0x1ee)][_0x1339f5(0x88)](_0x33ffad),{'verbose':_0x5d5eb2[_0x1339f5(0x24c)]}),_0x10c1c4=_0x5236dc['data'];return _0x5d5eb2[_0x1339f5(0xc5)]===_0x1339f5(0x141)||_0x5d5eb2['format']===_0x1339f5(0x24b)?await handleSDKOutput([{'sql':_0x10c1c4}],_0x5d5eb2):console['log'](_0x10c1c4),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x96);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async[a31_0x1e12b4(0x26e)](_0x278c2b){const _0x3c1ff4=a31_0x1e12b4,{options:_0x516665,args:_0x50cd30,tdx:_0x155154}=_0x278c2b,_0x2edc36=_0x50cd30[0x0]||_0x516665[_0x3c1ff4(0x1ce)];if(!_0x2edc36)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x3c1ff4(0x197)),0x1;_0x516665[_0x3c1ff4(0x24c)]&&(console[_0x3c1ff4(0x9a)](_0x3c1ff4(0xf3)+_0x516665[_0x3c1ff4(0x29d)]),console[_0x3c1ff4(0x9a)](_0x3c1ff4(0xf8)+_0x2edc36));const _0x3ccf45=await withSpinner(_0x3c1ff4(0xcb)+_0x2edc36+_0x3c1ff4(0x14d),()=>_0x155154[_0x3c1ff4(0x1ee)][_0x3c1ff4(0x17e)](_0x2edc36),{'verbose':_0x516665[_0x3c1ff4(0x24c)]}),_0x13d79d=_0x3ccf45[_0x3c1ff4(0x22f)],_0x491618=await withSpinner(_0x3c1ff4(0xcf)+_0x2edc36+_0x3c1ff4(0x14d),()=>_0x155154[_0x3c1ff4(0x1ee)][_0x3c1ff4(0x88)](_0x13d79d),{'verbose':_0x516665[_0x3c1ff4(0x24c)]});let _0xe73a7=_0x491618[_0x3c1ff4(0x22f)];const _0x26a2ba=resolveLimit(_0x516665[_0x3c1ff4(0x1d3)],DEFAULT_DISPLAY_LIMIT),_0x3b4e58=/\bLIMIT\s+\d+/i['test'](_0xe73a7);!_0x3b4e58&&(_0xe73a7=_0xe73a7[_0x3c1ff4(0x1f7)]()[_0x3c1ff4(0x192)](/;+$/,''),_0xe73a7=_0x3c1ff4(0x294)+_0xe73a7+_0x3c1ff4(0x255)+_0x26a2ba);_0x516665['verbose']&&console[_0x3c1ff4(0x9a)](_0x3c1ff4(0xdb)+_0xe73a7);const _0x421f90=await withProgressSpinner(_0x3c1ff4(0x211),async _0x410374=>{const _0x567f03=_0x3c1ff4,_0x3b7888=await _0x155154['query'][_0x567f03(0x26e)](_0xe73a7,{'catalog':'td','schema':_0x567f03(0x11d),'onJobId':_0x60a866=>{const _0xf56e8d=_0x567f03;_0x410374[_0xf56e8d(0xef)](_0x60a866);}});return _0x3b7888;},{'verbose':_0x516665[_0x3c1ff4(0x24c)]}),_0x28201d=_0x421f90[_0x3c1ff4(0x22f)],_0xcd895=_0x28201d[_0x3c1ff4(0x270)]?_0x3c1ff4(0x22b)+_0x28201d[_0x3c1ff4(0x270)]+']':'';return console[_0x3c1ff4(0x9a)](_0x3c1ff4(0x18d)+_0x28201d['stats'][_0x3c1ff4(0x28e)][_0x3c1ff4(0x227)]()+'\x20rows\x20'+(_0x3c1ff4(0x290)+formatElapsed(_0x28201d['stats'][_0x3c1ff4(0x1d4)])+_0xcd895)),await handleQueryOutput(_0x28201d,_0x516665),0x0;}}export class PSRtListCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0xe5);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x1ac);async['execute'](_0x327aac){const _0x4d06e5=a31_0x1e12b4,{options:_0x1fcae1,args:_0x378f6b,tdx:_0xb0e15e}=_0x327aac,_0x54c6fa=_0x378f6b[0x0],_0xa0bac4=await withSpinner(_0x54c6fa?_0x4d06e5(0x1ca)+_0x54c6fa+_0x4d06e5(0x14d):_0x4d06e5(0x9d),()=>_0xb0e15e[_0x4d06e5(0x113)][_0x4d06e5(0xe4)](),{'verbose':_0x1fcae1['verbose']});let _0x12be4e=_0xa0bac4[_0x4d06e5(0x22f)][_0x4d06e5(0x1b3)](_0x1c7830=>_0x1c7830[_0x4d06e5(0x20e)]);if(_0x54c6fa){const _0x153e5a=_0x54c6fa[_0x4d06e5(0x192)](/[.+^${}()|[\]\\]/g,_0x4d06e5(0x132))[_0x4d06e5(0x192)](/\*/g,'.*')[_0x4d06e5(0x192)](/\?/g,'.'),_0xc5e547=new RegExp('^'+_0x153e5a+'$','i');_0x12be4e=_0x12be4e[_0x4d06e5(0x1b3)](_0x466392=>_0xc5e547[_0x4d06e5(0x23a)](_0x466392[_0x4d06e5(0x1ef)]));}_0x12be4e[_0x4d06e5(0x215)]((_0x55da40,_0x321716)=>_0x55da40[_0x4d06e5(0x1ef)][_0x4d06e5(0x1f3)](_0x321716[_0x4d06e5(0x1ef)])),console[_0x4d06e5(0x9a)](_0x4d06e5(0x1ad)+_0x12be4e[_0x4d06e5(0x179)]+_0x4d06e5(0x260)+(_0x12be4e[_0x4d06e5(0x179)]!==0x1?'s':''));const _0x582b24=_0xaeca60=>{const _0x3e1636=_0x4d06e5;return getConsoleNextUrl(_0x1fcae1[_0x3e1636(0x29d)],_0x3e1636(0x277)+_0xaeca60);};if(_0x1fcae1[_0x4d06e5(0xc5)]===_0x4d06e5(0x141)||_0x1fcae1['format']==='jsonl'){const _0x150470=_0x12be4e['map'](_0x39c9ea=>({..._0x39c9ea,'url':_0x582b24(_0x39c9ea['id'])}));await handleSDKOutput(_0x150470,_0x1fcae1);}else{if(_0x12be4e[_0x4d06e5(0x179)]===0x0)console[_0x4d06e5(0xc0)]('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x3d8147 of _0x12be4e){const _0x5748fb=_0x3d8147[_0x4d06e5(0x1af)]?a31_0x46217b[_0x4d06e5(0x140)]('\x20('+formatRows(_0x3d8147['population'])+')'):'',_0x14f80c=hyperlink(_0x3d8147['name'],_0x582b24(_0x3d8147['id']));console[_0x4d06e5(0xc0)]('⚡\x20'+_0x14f80c+_0x5748fb);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x8b);['description']='Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML';async[a31_0x1e12b4(0x26e)](_0x5de0ee){const _0xe455c0=a31_0x1e12b4,{options:_0xc83bd2,args:_0x276f41,tdx:_0x35442f}=_0x5de0ee,_0x27e9df=_0x276f41[0x0]||_0xc83bd2[_0xe455c0(0x1ce)];if(!_0x27e9df)return showParentSegmentNotSetError(_0xe455c0(0x205)+_0xe455c0(0x139)),0x1;const _0x3fd5ee=resolveYamlFile(_0x27e9df);if(!existsSync(_0x3fd5ee))return showFileNotFoundError(_0x3fd5ee,_0x27e9df),0x1;let _0x3208ae;try{_0x3208ae=readFileSync(_0x3fd5ee,'utf-8');}catch(_0xacf590){const _0x3eb76c=_0xacf590 instanceof Error?_0xacf590[_0xe455c0(0x112)]:String(_0xacf590);return console[_0xe455c0(0x9a)](_0xe455c0(0x1ff)+_0x3eb76c),0x1;}const _0x307dee=createCommandSpinner(a31_0x46217b['dim'](_0xe455c0(0x259)),{'verbose':_0xc83bd2[_0xe455c0(0x24c)]});_0x307dee[_0xe455c0(0x1e4)]();const _0xe75c05={'realtime':!![],'onProgress':_0x4e769a=>{_0x307dee['text']=formatProgressMessage(_0x4e769a);}};let _0x2ec1dc;try{_0x2ec1dc=await _0x35442f[_0xe455c0(0x1ee)][_0xe455c0(0x1d2)](_0x3208ae,_0xe75c05),_0x307dee['stop']();}catch(_0x3a9783){_0x307dee[_0xe455c0(0xa3)]();throw _0x3a9783;}console[_0xe455c0(0x9a)]('\x0a'+a31_0x46217b['bold'](_0xe455c0(0x11c))+'\x20'+_0x2ec1dc[_0xe455c0(0x1ef)]),console[_0xe455c0(0x9a)]('═'[_0xe455c0(0xb1)](0x3c)),displayRealtimeValidation(_0x2ec1dc),console[_0xe455c0(0x9a)]('─'[_0xe455c0(0xb1)](0x3c));if(_0x2ec1dc[_0xe455c0(0x203)][_0xe455c0(0x179)]>0x0){console[_0xe455c0(0x9a)]('\x0a'+a31_0x46217b['red']('Errors:'));for(const _0x38a1da of _0x2ec1dc['errors']){console[_0xe455c0(0x9a)]('\x20\x20'+a31_0x46217b[_0xe455c0(0xba)]('•')+'\x20'+_0x38a1da);}}return _0x2ec1dc[_0xe455c0(0x15c)]&&console[_0xe455c0(0x9a)]('\x0a'+a31_0x46217b[_0xe455c0(0x1a7)]('✔')+_0xe455c0(0xc8)),_0x2ec1dc[_0xe455c0(0x15c)]?0x0:0x1;}}export class PSRtJnListCommand extends BaseCommand{['name']=a31_0x1e12b4(0x252);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x196);async[a31_0x1e12b4(0x26e)](_0x977b72){const _0x29e733=a31_0x1e12b4,{options:_0x4206f6,args:_0x72d93a,tdx:_0xa83de}=_0x977b72,_0x3f2ffc=_0x72d93a[0x0]||_0x4206f6[_0x29e733(0x1ce)];if(!_0x3f2ffc)return showParentSegmentNotSetError(_0x29e733(0x25d)+'\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;_0x4206f6[_0x29e733(0x24c)]&&(console[_0x29e733(0x9a)](_0x29e733(0xf3)+_0x4206f6[_0x29e733(0x29d)]),console[_0x29e733(0x9a)]('Parent\x20segment:\x20'+_0x3f2ffc));const _0x58e7a7=await withSpinner(_0x29e733(0xcb)+_0x3f2ffc+_0x29e733(0x14d),()=>_0xa83de[_0x29e733(0x1ee)]['resolveParentId'](_0x3f2ffc),{'verbose':_0x4206f6[_0x29e733(0x24c)]}),_0x2c61f3=_0x58e7a7['data'],_0x251423=await withSpinner(_0x29e733(0x180)+_0x3f2ffc+_0x29e733(0x14d),()=>_0xa83de[_0x29e733(0x113)][_0x29e733(0x238)](_0x2c61f3),{'verbose':_0x4206f6['verbose']}),_0x2b993b=_0x251423[_0x29e733(0x22f)];console[_0x29e733(0x9a)](_0x29e733(0x1ad)+_0x2b993b[_0x29e733(0x179)]+'\x20RT\x20journey'+(_0x2b993b[_0x29e733(0x179)]!==0x1?'s':''));if(_0x4206f6['format']===_0x29e733(0x141)||_0x4206f6[_0x29e733(0xc5)]===_0x29e733(0x24b))await handleSDKOutput(_0x2b993b,_0x4206f6);else{if(_0x2b993b[_0x29e733(0x179)]===0x0)console['log'](_0x29e733(0x194));else for(const _0x347844 of _0x2b993b){const _0x3f5c50=_0x347844[_0x29e733(0x202)]===_0x29e733(0xd8)?'🚀':'📝',_0x178b21=_0x347844[_0x29e733(0x1dd)]?a31_0x46217b[_0x29e733(0x289)](_0x29e733(0x224)):'',_0x5d5034=a31_0x46217b['dim']('\x20('+_0x347844[_0x29e733(0x13d)]+_0x29e733(0x1f1)+(_0x347844[_0x29e733(0x13d)]!==0x1?'s':'')+')');console[_0x29e733(0xc0)](_0x3f5c50+'\x20'+_0x347844[_0x29e733(0x1ef)]+_0x178b21+_0x5d5034);}}return 0x0;}}export class PSRtJnPauseCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0xd3);['description']=a31_0x1e12b4(0xbb);async[a31_0x1e12b4(0x26e)](_0x36d5fd){const _0x4eb7ca=a31_0x1e12b4,{options:_0x1fc290,args:_0x3af277,tdx:_0x1121f5}=_0x36d5fd,_0x35b180=_0x3af277[0x0];if(!_0x35b180)return console['error'](a31_0x46217b['red'](_0x4eb7ca(0x103))),console[_0x4eb7ca(0x9a)](_0x4eb7ca(0x1b2)),console[_0x4eb7ca(0x9a)](a31_0x46217b['dim']('Tip:\x20Use\x20`tdx\x20ps\x20rt\x20jn\x20list\x20<parent_segment>`\x20to\x20find\x20journey\x20IDs')),0x1;_0x1fc290[_0x4eb7ca(0x24c)]&&(console[_0x4eb7ca(0x9a)](_0x4eb7ca(0xf3)+_0x1fc290[_0x4eb7ca(0x29d)]),console[_0x4eb7ca(0x9a)](_0x4eb7ca(0xad)+_0x35b180));const _0x3d78f5=await withSpinner(_0x4eb7ca(0x12b)+_0x35b180+'\x27...',()=>_0x1121f5[_0x4eb7ca(0x113)][_0x4eb7ca(0x23c)](_0x35b180),{'verbose':_0x1fc290[_0x4eb7ca(0x24c)]}),_0x5b1179=_0x3d78f5[_0x4eb7ca(0x22f)];console[_0x4eb7ca(0x9a)]('✔\x20Paused\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x5b1179['name']+'\x27');if(_0x1fc290[_0x4eb7ca(0xc5)]===_0x4eb7ca(0x141)||_0x1fc290[_0x4eb7ca(0xc5)]===_0x4eb7ca(0x24b))await handleSDKOutput([_0x5b1179],_0x1fc290);else{const _0x48c79b=_0x5b1179[_0x4eb7ca(0x202)]===_0x4eb7ca(0xd8)?'🚀':'📝',_0x10c337=_0x5b1179[_0x4eb7ca(0x1dd)]?a31_0x46217b[_0x4eb7ca(0x289)](_0x4eb7ca(0x224)):'';console[_0x4eb7ca(0xc0)](_0x48c79b+'\x20'+_0x5b1179[_0x4eb7ca(0x1ef)]+_0x10c337);}return 0x0;}}export class PSRtJnResumeCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x13a);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x297);async[a31_0x1e12b4(0x26e)](_0x49e50d){const _0x20558d=a31_0x1e12b4,{options:_0x4e0b6d,args:_0x2b4650,tdx:_0x52274d}=_0x49e50d,_0x2c7f14=_0x2b4650[0x0];if(!_0x2c7f14)return console[_0x20558d(0x9a)](a31_0x46217b['red']('Error:\x20RT\x20journey\x20ID\x20is\x20required\x0a')),console[_0x20558d(0x9a)](_0x20558d(0xa9)),console[_0x20558d(0x9a)](a31_0x46217b['dim'](_0x20558d(0x163))),0x1;_0x4e0b6d['verbose']&&(console['error'](_0x20558d(0xf3)+_0x4e0b6d['site']),console[_0x20558d(0x9a)](_0x20558d(0xad)+_0x2c7f14));const _0x5e6e5a=await withSpinner(_0x20558d(0x247)+_0x2c7f14+_0x20558d(0x14d),()=>_0x52274d[_0x20558d(0x113)][_0x20558d(0x251)](_0x2c7f14),{'verbose':_0x4e0b6d[_0x20558d(0x24c)]}),_0x2b95dd=_0x5e6e5a[_0x20558d(0x22f)];console[_0x20558d(0x9a)]('✔\x20Resumed\x20activations\x20for\x20RT\x20journey\x20\x27'+_0x2b95dd[_0x20558d(0x1ef)]+'\x27');if(_0x4e0b6d['format']===_0x20558d(0x141)||_0x4e0b6d['format']==='jsonl')await handleSDKOutput([_0x2b95dd],_0x4e0b6d);else{const _0x5e35ad=_0x2b95dd[_0x20558d(0x202)]==='launched'?'🚀':'📝',_0x5f0ffa=_0x2b95dd['paused']?a31_0x46217b['yellow']('\x20(paused)'):'';console[_0x20558d(0xc0)](_0x5e35ad+'\x20'+_0x2b95dd[_0x20558d(0x1ef)]+_0x5f0ffa);}return 0x0;}}export class PSRtConfigVersionCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x166);['description']=a31_0x1e12b4(0x153);async[a31_0x1e12b4(0x26e)](_0x4d2a77){const _0x5649cf=a31_0x1e12b4,{options:_0x47f9f1,args:_0x444bd8,tdx:_0x37344c}=_0x4d2a77,_0x240962=_0x444bd8[0x0]||_0x47f9f1[_0x5649cf(0x1ce)];if(!_0x240962)return showParentSegmentNotSetError(_0x5649cf(0x22e)+_0x5649cf(0x279)),0x1;_0x47f9f1[_0x5649cf(0x24c)]&&(console['error'](_0x5649cf(0xf3)+_0x47f9f1['site']),console['error'](_0x5649cf(0xf8)+_0x240962));const _0x50195c=await withSpinner(_0x5649cf(0xcb)+_0x240962+_0x5649cf(0x14d),()=>_0x37344c[_0x5649cf(0x1ee)][_0x5649cf(0x17e)](_0x240962),{'verbose':_0x47f9f1[_0x5649cf(0x24c)]}),_0x4ce7b2=_0x50195c[_0x5649cf(0x22f)],_0x8c19b=await withSpinner('Getting\x20RT\x20configuration\x20version\x20for\x20\x27'+_0x240962+_0x5649cf(0x14d),()=>_0x37344c[_0x5649cf(0x113)][_0x5649cf(0x1a3)](_0x4ce7b2),{'verbose':_0x47f9f1[_0x5649cf(0x24c)]}),_0xef17b2=_0x8c19b[_0x5649cf(0x22f)];return console[_0x5649cf(0x9a)](_0x5649cf(0x1c0)),_0x47f9f1[_0x5649cf(0xc5)]==='json'||_0x47f9f1[_0x5649cf(0xc5)]===_0x5649cf(0x24b)?await handleSDKOutput([_0xef17b2],_0x47f9f1):(console[_0x5649cf(0xc0)](_0x5649cf(0x242)+_0xef17b2['id']),console['log'](_0x5649cf(0x275)+_0xef17b2[_0x5649cf(0x191)]),console[_0x5649cf(0xc0)]('identifier:\x20'+_0xef17b2['identifier']),console[_0x5649cf(0xc0)](_0x5649cf(0x2a1)+_0xef17b2[_0x5649cf(0x282)]),console['log'](_0x5649cf(0x83)+_0xef17b2['status'])),0x0;}}export class PSPzServiceListCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0xdc);[a31_0x1e12b4(0x18c)]='List\x20personalization\x20services\x20for\x20a\x20parent\x20segment';async[a31_0x1e12b4(0x26e)](_0x3b3990){const _0x508685=a31_0x1e12b4,{options:_0x528fae,args:_0x4811da,tdx:_0x529760}=_0x3b3990,_0x3e9e62=_0x4811da[0x0]||_0x528fae[_0x508685(0x1ce)];if(!_0x3e9e62)return showParentSegmentNotSetError(_0x508685(0x189)+_0x508685(0x218)),0x1;const _0x18f59f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3e9e62+_0x508685(0x14d),()=>_0x529760['segment']['resolveParentId'](_0x3e9e62),{'verbose':_0x528fae['verbose']}),_0x2ff720=_0x18f59f[_0x508685(0x22f)],_0x5acdab=await withSpinner(_0x508685(0x159)+_0x3e9e62+'\x27...',()=>_0x529760[_0x508685(0x90)][_0x508685(0xe4)](_0x2ff720),{'verbose':_0x528fae[_0x508685(0x24c)]}),_0x42fb5c=_0x5acdab['data'];console[_0x508685(0x9a)](_0x508685(0x1ad)+_0x42fb5c['length']+_0x508685(0x10d)+(_0x42fb5c[_0x508685(0x179)]!==0x1?'s':''));if(_0x528fae[_0x508685(0xc5)]===_0x508685(0x141)||_0x528fae[_0x508685(0xc5)]===_0x508685(0x24b))await handleSDKOutput(_0x42fb5c,_0x528fae);else{if(_0x42fb5c[_0x508685(0x179)]===0x0)console['log']('No\x20personalization\x20services\x20configured'),console[_0x508685(0x9a)](a31_0x46217b[_0x508685(0x228)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20service\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x12fb5a of _0x42fb5c){console[_0x508685(0xc0)](a31_0x46217b[_0x508685(0x24a)](_0x12fb5a[_0x508685(0x1ef)])+'\x20'+a31_0x46217b['dim'](_0x508685(0xae)+_0x12fb5a['id']+')'));_0x12fb5a[_0x508685(0x18c)]&&console['log']('\x20\x20'+a31_0x46217b[_0x508685(0x140)](_0x12fb5a[_0x508685(0x18c)]));if(_0x12fb5a[_0x508685(0x1b4)]&&_0x12fb5a[_0x508685(0x1b4)][_0x508685(0x179)]>0x0)for(const _0x38fbab of _0x12fb5a[_0x508685(0x1b4)]){const _0xeaca4d=_0x38fbab[_0x508685(0x109)]?.[_0x508685(0x179)]?_0x38fbab[_0x508685(0x109)][_0x508685(0x161)](',\x20'):_0x508685(0x1d1);console[_0x508685(0xc0)]('\x20\x20'+a31_0x46217b['cyan']('token:')+'\x20'+_0x38fbab[_0x508685(0x1ef)]+'\x20'+a31_0x46217b[_0x508685(0x140)](_0x508685(0xae)+_0x38fbab['id']+')')),console['log'](_0x508685(0x131)+a31_0x46217b['dim'](_0x508685(0x1e5))+'\x20'+_0xeaca4d);}else console[_0x508685(0xc0)]('\x20\x20'+a31_0x46217b[_0x508685(0x140)](_0x508685(0x15a)));}}return 0x0;}}export class PSPzServiceCreateCommand extends BaseCommand{['name']='ps:pz:service:create';['description']='Create\x20a\x20personalization\x20service\x20for\x20a\x20parent\x20segment';async[a31_0x1e12b4(0x26e)](_0x48ca12){const _0x3787f5=a31_0x1e12b4,{options:_0x2c14ca,args:_0x5f0273,tdx:_0x4967f3}=_0x48ca12,_0x3a014f=_0x2c14ca,_0xc74b92=_0x5f0273[0x0],_0x526f71=_0x5f0273[0x1]||_0x2c14ca[_0x3787f5(0x1ce)];if(!_0xc74b92)return console[_0x3787f5(0x9a)]('Error:\x20Service\x20name\x20is\x20required'),console[_0x3787f5(0x9a)](_0x3787f5(0xc7)),console[_0x3787f5(0x9a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20create\x20<name>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x526f71)return showParentSegmentNotSetError(_0x3787f5(0x8c)+_0x3787f5(0x225)),0x1;const _0x2cf416=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x526f71+_0x3787f5(0x14d),()=>_0x4967f3[_0x3787f5(0x1ee)]['resolveParentId'](_0x526f71),{'verbose':_0x2c14ca[_0x3787f5(0x24c)]}),_0x12909d=_0x2cf416[_0x3787f5(0x22f)],_0x3e90ab={'name':_0xc74b92,'description':_0x3a014f[_0x3787f5(0x18c)],'public':_0x3a014f[_0x3787f5(0x135)]},_0x207f3f=await withSpinner('Creating\x20personalization\x20service\x20\x27'+_0xc74b92+_0x3787f5(0x14d),()=>_0x4967f3[_0x3787f5(0x90)][_0x3787f5(0x1e2)](_0x12909d,_0x3e90ab),{'verbose':_0x2c14ca['verbose']}),_0x11638b=_0x207f3f[_0x3787f5(0x22f)];return console[_0x3787f5(0x9a)](_0x3787f5(0x1a8)+_0x11638b[_0x3787f5(0x1ef)]+'\x27\x20with\x20ID:\x20'+_0x11638b['id']),await handleSDKOutput([_0x11638b],_0x2c14ca),0x0;}}export class PSPzServiceShowCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]='ps:pz:service:show';['description']='Show\x20personalization\x20service\x20details';async['execute'](_0x2fd54c){const _0x1c0287=a31_0x1e12b4,{options:_0xeefe,args:_0x4fac82,tdx:_0x5b9243}=_0x2fd54c,_0x33bcac=_0x4fac82[0x0],_0x1560d5=_0x4fac82[0x1]||_0xeefe[_0x1c0287(0x1ce)];if(!_0x33bcac)return console[_0x1c0287(0x9a)](_0x1c0287(0x167)),console[_0x1c0287(0x9a)](_0x1c0287(0x287)),console[_0x1c0287(0x9a)](_0x1c0287(0xdf)),0x1;if(!_0x1560d5)return showParentSegmentNotSetError(_0x1c0287(0x101)+_0x1c0287(0xdf)),0x1;const _0x578f1b=await withSpinner(_0x1c0287(0xcb)+_0x1560d5+_0x1c0287(0x14d),()=>_0x5b9243[_0x1c0287(0x1ee)][_0x1c0287(0x17e)](_0x1560d5),{'verbose':_0xeefe[_0x1c0287(0x24c)]}),_0x197baf=_0x578f1b[_0x1c0287(0x22f)],_0x13aa17=await withSpinner(_0x1c0287(0x278)+_0x33bcac+_0x1c0287(0x14d),()=>_0x5b9243[_0x1c0287(0x90)][_0x1c0287(0xd4)](_0x197baf,_0x33bcac),{'verbose':_0xeefe[_0x1c0287(0x24c)]}),_0x492fd6=_0x13aa17['data'];if(_0xeefe[_0x1c0287(0x141)]||_0xeefe['jsonl'])await handleSDKOutput([_0x492fd6],_0xeefe);else{console['log'](a31_0x46217b['bold'](_0x492fd6[_0x1c0287(0x1ef)])+'\x20'+a31_0x46217b[_0x1c0287(0x140)](_0x1c0287(0xae)+_0x492fd6['id']+')'));_0x492fd6[_0x1c0287(0x18c)]&&console['log']('\x20\x20'+a31_0x46217b[_0x1c0287(0x140)](_0x492fd6[_0x1c0287(0x18c)]));console['log']('\x20\x20'+a31_0x46217b[_0x1c0287(0x228)](_0x1c0287(0x298))+'\x20'+(_0x492fd6[_0x1c0287(0x135)]?_0x1c0287(0x25a):'no'));if(_0x492fd6[_0x1c0287(0x1b4)]&&_0x492fd6['tokens']['length']>0x0)for(const _0x190399 of _0x492fd6[_0x1c0287(0x1b4)]){const _0x40e1a3=_0x190399['allowedIps']?.[_0x1c0287(0x179)]?_0x190399[_0x1c0287(0x109)][_0x1c0287(0x161)](',\x20'):_0x1c0287(0x1d1);console[_0x1c0287(0xc0)]('\x20\x20'+a31_0x46217b[_0x1c0287(0x228)](_0x1c0287(0x146))+'\x20'+_0x190399[_0x1c0287(0x1ef)]+'\x20'+a31_0x46217b['dim'](_0x1c0287(0xae)+_0x190399['id']+')')),console[_0x1c0287(0xc0)](_0x1c0287(0x131)+a31_0x46217b[_0x1c0287(0x140)]('allowed\x20IPs:')+'\x20'+_0x40e1a3);}else console[_0x1c0287(0xc0)]('\x20\x20'+a31_0x46217b['dim']('no\x20tokens\x20configured'));}return 0x0;}}export class PSPzServiceDeleteCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x8f);['description']=a31_0x1e12b4(0xe2);async[a31_0x1e12b4(0x26e)](_0x473ea5){const _0x27cf57=a31_0x1e12b4,{options:_0x249668,args:_0x4a077b,tdx:_0x1618d4}=_0x473ea5,_0x542052=_0x4a077b[0x0],_0x36f913=_0x4a077b[0x1]||_0x249668[_0x27cf57(0x1ce)];if(!_0x542052)return console[_0x27cf57(0x9a)](_0x27cf57(0x167)),console[_0x27cf57(0x9a)](_0x27cf57(0x1f8)),console[_0x27cf57(0x9a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x36f913)return showParentSegmentNotSetError(_0x27cf57(0xe9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20delete\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x5164fc=await withSpinner(_0x27cf57(0xcb)+_0x36f913+'\x27...',()=>_0x1618d4[_0x27cf57(0x1ee)][_0x27cf57(0x17e)](_0x36f913),{'verbose':_0x249668[_0x27cf57(0x24c)]}),_0x2e7521=_0x5164fc[_0x27cf57(0x22f)];return await withSpinner(_0x27cf57(0xfd)+_0x542052+'\x27...',()=>_0x1618d4[_0x27cf57(0x90)][_0x27cf57(0x165)](_0x2e7521,_0x542052),{'verbose':_0x249668[_0x27cf57(0x24c)]}),console['error']('✔\x20Deleted\x20personalization\x20service\x20\x27'+_0x542052+'\x27'),0x0;}}export class PSPzServiceUpdateCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0xab);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x1ab);async[a31_0x1e12b4(0x26e)](_0x2e0c48){const _0x257382=a31_0x1e12b4,{options:_0x2dc026,args:_0x7bcc0,tdx:_0x7b38e9}=_0x2e0c48,_0x3e8e35=_0x2dc026,_0x25950f=_0x7bcc0[0x0],_0x3061cd=_0x7bcc0[0x1]||_0x2dc026[_0x257382(0x1ce)];if(!_0x25950f)return console['error']('Error:\x20Service\x20ID\x20is\x20required'),console[_0x257382(0x9a)](_0x257382(0xf5)),console[_0x257382(0x9a)](_0x257382(0x23f)),0x1;if(!_0x3e8e35[_0x257382(0x1ef)])return console[_0x257382(0x9a)](_0x257382(0x182)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20[parent_segment]\x20--name\x20<name>\x20[--description\x20<text>]'),0x1;if(!_0x3061cd)return showParentSegmentNotSetError(_0x257382(0xe6)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20update\x20<service_id>\x20--name\x20<name>\x20\x20#\x20Uses\x20context'),0x1;const _0x5cd92f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3061cd+'\x27...',()=>_0x7b38e9['segment']['resolveParentId'](_0x3061cd),{'verbose':_0x2dc026[_0x257382(0x24c)]}),_0x49aecc=_0x5cd92f[_0x257382(0x22f)],_0x237f56={'name':_0x3e8e35[_0x257382(0x1ef)]};_0x3e8e35['description']!==undefined&&(_0x237f56[_0x257382(0x18c)]=_0x3e8e35[_0x257382(0x18c)]);const _0x3b8485=await withSpinner(_0x257382(0x14c)+_0x25950f+_0x257382(0x14d),()=>_0x7b38e9['personalization']['patch'](_0x49aecc,_0x25950f,_0x237f56),{'verbose':_0x2dc026[_0x257382(0x24c)]}),_0x5807e9=_0x3b8485[_0x257382(0x22f)];return console[_0x257382(0x9a)](_0x257382(0x15b)+_0x5807e9[_0x257382(0x1ef)]+'\x27'),await handleSDKOutput([_0x5807e9],_0x2dc026),0x0;}}export class PSPzServiceTokenCreateCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x226);[a31_0x1e12b4(0x18c)]='Create\x20a\x20token\x20for\x20a\x20personalization\x20service';async[a31_0x1e12b4(0x26e)](_0xb86632){const _0x431b54=a31_0x1e12b4,{options:_0x1e7754,args:_0x41506e,tdx:_0x3950a7}=_0xb86632,_0x530110=_0x1e7754,_0x552bba=_0x41506e[0x0],_0x10d736=_0x41506e[0x1],_0x211ef3=_0x41506e[0x2]||_0x1e7754[_0x431b54(0x1ce)];if(!_0x552bba)return console['error'](_0x431b54(0x26d)),console[_0x431b54(0x9a)](_0x431b54(0x87)),console[_0x431b54(0x9a)](_0x431b54(0x1c8)),0x1;if(!_0x10d736)return console[_0x431b54(0x9a)](_0x431b54(0x167)),console[_0x431b54(0x9a)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20[parent_segment]'),console[_0x431b54(0x9a)](_0x431b54(0x1c8)),0x1;if(!_0x211ef3)return showParentSegmentNotSetError(_0x431b54(0x1aa)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20create\x20<name>\x20<service_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x114e9d=await withSpinner(_0x431b54(0xcb)+_0x211ef3+'\x27...',()=>_0x3950a7['segment'][_0x431b54(0x17e)](_0x211ef3),{'verbose':_0x1e7754['verbose']}),_0x5c9c93=_0x114e9d[_0x431b54(0x22f)],_0x207c23={'name':_0x552bba};_0x530110['allowedIps']&&(_0x207c23[_0x431b54(0x109)]=_0x530110[_0x431b54(0x109)][_0x431b54(0x1e1)](',')['map'](_0x5d9716=>_0x5d9716[_0x431b54(0x1f7)]()));_0x530110[_0x431b54(0x18c)]&&(_0x207c23[_0x431b54(0x18c)]=_0x530110[_0x431b54(0x18c)]);const _0x217092=await withSpinner(_0x431b54(0x130)+_0x552bba+'\x27\x20for\x20service\x20\x27'+_0x10d736+_0x431b54(0x14d),()=>_0x3950a7['personalization']['createToken'](_0x5c9c93,_0x10d736,_0x207c23),{'verbose':_0x1e7754[_0x431b54(0x24c)]}),_0x520d7c=_0x217092['data'];return console[_0x431b54(0x9a)](_0x431b54(0x1c1)+_0x520d7c['name']+_0x431b54(0x236)+_0x520d7c['id']),_0x520d7c['value']&&(console[_0x431b54(0x9a)](a31_0x46217b[_0x431b54(0x289)]('\x0a⚠\x20Save\x20this\x20token\x20value\x20-\x20it\x20will\x20not\x20be\x20shown\x20again:')),console[_0x431b54(0x9a)](a31_0x46217b['cyan'](_0x520d7c[_0x431b54(0x150)])),console[_0x431b54(0x9a)]('')),await handleSDKOutput([_0x520d7c],_0x1e7754),0x0;}}export class PSPzServiceTokenDeleteCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x264);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x1d6);async[a31_0x1e12b4(0x26e)](_0x12d3eb){const _0x5e636a=a31_0x1e12b4,{options:_0x266a00,args:_0x575fec,tdx:_0x223079}=_0x12d3eb,_0x3043a7=_0x575fec[0x0],_0x5b0033=_0x575fec[0x1]||_0x266a00[_0x5e636a(0x1ce)];if(!_0x3043a7)return console[_0x5e636a(0x9a)](_0x5e636a(0x29a)),console[_0x5e636a(0x9a)]('Usage:\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20[parent_segment]'),console[_0x5e636a(0x9a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;if(!_0x5b0033)return showParentSegmentNotSetError(_0x5e636a(0x97)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20service\x20token\x20delete\x20<token_id>\x20\x20#\x20Uses\x20context'),0x1;const _0x489b23=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5b0033+_0x5e636a(0x14d),()=>_0x223079[_0x5e636a(0x1ee)][_0x5e636a(0x17e)](_0x5b0033),{'verbose':_0x266a00['verbose']}),_0x29194d=_0x489b23['data'],_0x1aba81=await withSpinner(_0x5e636a(0x11f),()=>_0x223079[_0x5e636a(0x90)][_0x5e636a(0xe4)](_0x29194d),{'verbose':_0x266a00[_0x5e636a(0x24c)]}),_0x5eea64=_0x1aba81['data'];let _0xdcf890;for(const _0x51d6c6 of _0x5eea64){if(_0x51d6c6[_0x5e636a(0x1b4)]?.['some'](_0x586f00=>_0x586f00['id']===_0x3043a7)){_0xdcf890=_0x51d6c6['id'];break;}}if(!_0xdcf890)return console[_0x5e636a(0x9a)](_0x5e636a(0x204)+_0x3043a7+_0x5e636a(0x158)),0x1;const _0x9c8cc=await withSpinner(_0x5e636a(0xe0)+_0x3043a7+_0x5e636a(0x14d),()=>_0x223079['personalization'][_0x5e636a(0x172)](_0x29194d,_0xdcf890,_0x3043a7),{'verbose':_0x266a00[_0x5e636a(0x24c)]}),_0x4e3096=_0x9c8cc['data'];return console[_0x5e636a(0x9a)](_0x5e636a(0x1f4)+(_0x4e3096[_0x5e636a(0x1ef)]||_0x3043a7)+'\x27'),await handleSDKOutput([_0x4e3096],_0x266a00),0x0;}}export class PSPzListCommand extends BaseCommand{['name']=a31_0x1e12b4(0x15f);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x214);async['execute'](_0x2aec80){const _0x1eb2c7=a31_0x1e12b4,{options:_0x48d86e,args:_0x5e7d50,tdx:_0x30bb61}=_0x2aec80,_0x274227=_0x5e7d50[0x0]||_0x48d86e[_0x1eb2c7(0x1ce)];if(!_0x274227)return showParentSegmentNotSetError(_0x1eb2c7(0x29e)+_0x1eb2c7(0x219)),0x1;const _0x3649e5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x274227+_0x1eb2c7(0x14d),()=>_0x30bb61[_0x1eb2c7(0x1ee)][_0x1eb2c7(0x17e)](_0x274227),{'verbose':_0x48d86e['verbose']}),_0x204f67=_0x3649e5[_0x1eb2c7(0x22f)],_0x445d22=await withSpinner(_0x1eb2c7(0x9e)+_0x274227+_0x1eb2c7(0x14d),()=>_0x30bb61['personalization'][_0x1eb2c7(0x1e8)](_0x204f67),{'verbose':_0x48d86e[_0x1eb2c7(0x24c)]}),_0x2227ca=_0x445d22['data'];console[_0x1eb2c7(0x9a)](_0x1eb2c7(0x1ad)+_0x2227ca['length']+_0x1eb2c7(0xa8)+(_0x2227ca[_0x1eb2c7(0x179)]!==0x1?'s':''));if(_0x48d86e[_0x1eb2c7(0xc5)]==='json'||_0x48d86e[_0x1eb2c7(0xc5)]===_0x1eb2c7(0x24b))await handleSDKOutput(_0x2227ca,_0x48d86e);else{if(_0x2227ca['length']===0x0)console['log'](_0x1eb2c7(0xf1));else for(const _0x49a8a6 of _0x2227ca){console[_0x1eb2c7(0xc0)](a31_0x46217b[_0x1eb2c7(0x24a)](_0x49a8a6['name'])+'\x20'+a31_0x46217b[_0x1eb2c7(0x140)](_0x1eb2c7(0xae)+_0x49a8a6['id']+')'));_0x49a8a6[_0x1eb2c7(0x18c)]&&console[_0x1eb2c7(0xc0)]('\x20\x20'+a31_0x46217b['dim'](_0x49a8a6[_0x1eb2c7(0x18c)]));const _0x36e680=_0x49a8a6[_0x1eb2c7(0x148)]?.[_0x1eb2c7(0x179)]||0x0;console['log']('\x20\x20'+a31_0x46217b['cyan'](_0x1eb2c7(0x110))+'\x20'+_0x36e680);if(_0x49a8a6[_0x1eb2c7(0x148)]&&_0x49a8a6['sections'][_0x1eb2c7(0x179)]>0x0)for(const _0x4fff02 of _0x49a8a6['sections']){console['log'](_0x1eb2c7(0xcd)+_0x4fff02[_0x1eb2c7(0x1ef)]);}}}return 0x0;}}export class PSPzShowCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x23d);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0xac);async[a31_0x1e12b4(0x26e)](_0x23e250){const _0x548da8=a31_0x1e12b4,{options:_0x56b8c1,args:_0x4ccc3a,tdx:_0x7360a9}=_0x23e250,_0x20ab73=_0x4ccc3a[0x0];if(!_0x20ab73)return console[_0x548da8(0x9a)](_0x548da8(0x1bb)),console[_0x548da8(0x9a)](_0x548da8(0x1fb)),0x1;const _0x1d9b36=await withSpinner(_0x548da8(0x19f)+_0x20ab73+_0x548da8(0x14d),()=>_0x7360a9[_0x548da8(0x90)][_0x548da8(0x240)](_0x20ab73),{'verbose':_0x56b8c1[_0x548da8(0x24c)]}),_0x35e1ad=_0x1d9b36[_0x548da8(0x22f)];console[_0x548da8(0x9a)](_0x548da8(0x168)+_0x35e1ad[_0x548da8(0x1ef)]+'\x27');if(_0x56b8c1[_0x548da8(0xc5)]==='json'||_0x56b8c1[_0x548da8(0xc5)]==='jsonl')await handleSDKOutput([_0x35e1ad],_0x56b8c1);else{console['log'](a31_0x46217b[_0x548da8(0x24a)](_0x35e1ad[_0x548da8(0x1ef)])+'\x20'+a31_0x46217b[_0x548da8(0x140)](_0x548da8(0xae)+_0x35e1ad['id']+')'));_0x35e1ad['description']&&console[_0x548da8(0xc0)]('\x20\x20'+a31_0x46217b[_0x548da8(0x140)](_0x35e1ad[_0x548da8(0x18c)]));_0x35e1ad[_0x548da8(0x191)]&&console['log']('\x20\x20'+a31_0x46217b[_0x548da8(0x228)](_0x548da8(0x117))+'\x20'+_0x35e1ad['audienceId']);console[_0x548da8(0xc0)]('\x20\x20'+a31_0x46217b['cyan'](_0x548da8(0x28b))+'\x20'+_0x35e1ad[_0x548da8(0x115)]),console[_0x548da8(0xc0)]('\x20\x20'+a31_0x46217b[_0x548da8(0x228)]('updated:')+'\x20'+_0x35e1ad[_0x548da8(0x292)]);const _0x2aab85=_0x35e1ad[_0x548da8(0x148)]?.[_0x548da8(0x179)]||0x0;console[_0x548da8(0xc0)]('\x20\x20'+a31_0x46217b['cyan']('sections:')+'\x20'+_0x2aab85);if(_0x35e1ad['sections']&&_0x35e1ad[_0x548da8(0x148)]['length']>0x0)for(const _0x4440bb of _0x35e1ad[_0x548da8(0x148)]){console[_0x548da8(0xc0)](_0x548da8(0x131)+a31_0x46217b[_0x548da8(0x24a)](_0x4440bb[_0x548da8(0x1ef)])+'\x20'+a31_0x46217b[_0x548da8(0x140)](_0x548da8(0xae)+_0x4440bb['id']+')')),_0x4440bb['entryCriteria']&&(console[_0x548da8(0xc0)]('\x20\x20\x20\x20\x20\x20'+a31_0x46217b['cyan'](_0x548da8(0x156))+'\x20'+_0x4440bb[_0x548da8(0x1cb)]['name']),_0x4440bb[_0x548da8(0x1cb)][_0x548da8(0x118)]?.[_0x548da8(0x20d)]&&console['log'](_0x548da8(0xb8)+a31_0x46217b['cyan'](_0x548da8(0x1c7))+'\x20'+_0x4440bb[_0x548da8(0x1cb)][_0x548da8(0x118)][_0x548da8(0x20d)])),_0x4440bb[_0x548da8(0x2a0)]&&console[_0x548da8(0xc0)](_0x548da8(0x154)+a31_0x46217b['cyan'](_0x548da8(0xbe))+'\x20'+JSON[_0x548da8(0x183)](_0x4440bb['payload'])),_0x4440bb[_0x548da8(0x201)]&&console[_0x548da8(0xc0)]('\x20\x20\x20\x20\x20\x20'+a31_0x46217b[_0x548da8(0x228)](_0x548da8(0x199))+_0x548da8(0x128));}}return 0x0;}}function a31_0x556b(_0x1edab1,_0x37c64b){_0x1edab1=_0x1edab1-0x83;const _0x52a9c3=a31_0x52a9();let _0x556b9f=_0x52a9c3[_0x1edab1];return _0x556b9f;}export class PSPzDeleteCommand extends BaseCommand{['name']=a31_0x1e12b4(0x11e);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x27c);async[a31_0x1e12b4(0x26e)](_0x42b74a){const _0x5476ff=a31_0x1e12b4,{options:_0x2c4c5a,args:_0x5c5f0f,tdx:_0x1c6883}=_0x42b74a,_0x42af93=_0x5c5f0f[0x0];if(!_0x42af93)return console[_0x5476ff(0x9a)](_0x5476ff(0x1bb)),console[_0x5476ff(0x9a)](_0x5476ff(0x217)),0x1;return await withSpinner('Deleting\x20personalization\x20\x27'+_0x42af93+_0x5476ff(0x14d),()=>_0x1c6883['personalization']['deletePersonalization'](_0x42af93),{'verbose':_0x2c4c5a[_0x5476ff(0x24c)]}),console[_0x5476ff(0x9a)]('✔\x20Deleted\x20personalization\x20\x27'+_0x42af93+'\x27'),0x0;}}export class PSPzCreateCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x1b6);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x265);async[a31_0x1e12b4(0x26e)](_0x2acc9c){const _0x12c876=a31_0x1e12b4,{options:_0xc22949,tdx:_0x4be2f0}=_0x2acc9c,_0xec82f2=_0xc22949;let _0x4d75f0;if(_0xec82f2[_0x12c876(0x1e6)]){_0x4d75f0=await loadJSON(_0xec82f2[_0x12c876(0x1e6)],!![]);if(!_0x4d75f0[_0x12c876(0x249)]?.[_0x12c876(0x263)])return console[_0x12c876(0x9a)]('Error:\x20\x22relationships.parentFolder\x22\x20is\x20required\x20in\x20the\x20JSON\x20file.'),console[_0x12c876(0x9a)](_0x12c876(0x1b1)),console['error'](_0x12c876(0x11b)),0x1;}else{if(!_0xec82f2['name'])return console[_0x12c876(0x9a)](_0x12c876(0x1a4)),console['error']('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x12c876(0x9a)](_0x12c876(0x24e)),0x1;if(_0xec82f2[_0x12c876(0x18c)]===undefined)return console[_0x12c876(0x9a)](_0x12c876(0x147)),console[_0x12c876(0x9a)]('Usage:\x20tdx\x20ps\x20pz\x20create\x20--name\x20<name>\x20--description\x20<desc>\x20--folder-id\x20<id>\x20[options]'),console[_0x12c876(0x9a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20create\x20--file\x20<path>'),0x1;if(_0xec82f2[_0x12c876(0x235)]===undefined)return console[_0x12c876(0x9a)]('Error:\x20--folder-id\x20is\x20required.\x20Use\x20`tdx\x20ps\x20folder\x20list\x20<name>`\x20to\x20find\x20the\x20folder\x20ID.'),console['error']('\x20\x20\x20\x20\x20\x20\x20Pass\x20null\x20to\x20place\x20in\x20the\x20root\x20folder.'),0x1;let _0x28dc5e=_0xec82f2[_0x12c876(0x191)];if(!_0x28dc5e&&_0xc22949[_0x12c876(0x1ce)]){const _0x3cd481=await withSpinner(_0x12c876(0xcb)+_0xc22949[_0x12c876(0x1ce)]+_0x12c876(0x14d),()=>_0x4be2f0[_0x12c876(0x1ee)][_0x12c876(0x17e)](_0xc22949[_0x12c876(0x1ce)]),{'verbose':_0xc22949[_0x12c876(0x24c)]});_0x28dc5e=_0x3cd481[_0x12c876(0x22f)];}let _0x4b5d6c;_0xec82f2[_0x12c876(0x148)]&&(_0x4b5d6c=await loadJSON(_0xec82f2[_0x12c876(0x148)],![]));const _0x355018=_0xec82f2[_0x12c876(0x235)]==='null'?null:{'id':_0xec82f2['folderId'],'type':_0x12c876(0x24d)};_0x4d75f0={'attributes':{'name':_0xec82f2[_0x12c876(0x1ef)],'description':_0xec82f2[_0x12c876(0x18c)]||null,..._0x28dc5e!==undefined&&{'audienceId':_0x28dc5e},..._0x4b5d6c!==undefined&&{'sections':_0x4b5d6c}},'relationships':{'parentFolder':{'data':_0x355018}}};}const _0x13fc7f=await withSpinner(_0x12c876(0x160)+(_0x4d75f0[_0x12c876(0xd9)]?.[_0x12c876(0x1ef)]??'')+'\x27...',()=>_0x4be2f0['personalization']['createPersonalization'](_0x4d75f0),{'verbose':_0xc22949['verbose']}),_0x309750=_0x13fc7f['data'];return console['error']('✔\x20Created\x20personalization\x20\x27'+_0x309750[_0x12c876(0x1ef)]+_0x12c876(0x236)+_0x309750['id']),await handleSDKOutput([_0x309750],_0xc22949),0x0;}}export class PSPzPatchCommand extends BaseCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x200);['description']=a31_0x1e12b4(0x1ed);async[a31_0x1e12b4(0x26e)](_0x21402f){const _0x1d75ab=a31_0x1e12b4,{options:_0x7a2cd9,args:_0x44beb2}=_0x21402f,_0x30ff55=_0x7a2cd9,_0x319e97=_0x44beb2[0x0];if(!_0x319e97)return console['error'](_0x1d75ab(0x1bb)),console[_0x1d75ab(0x9a)]('Usage:\x20tdx\x20ps\x20pz\x20patch\x20<id>\x20--name\x20<name>\x20--description\x20<desc>\x20[--sections\x20<json>]'),console[_0x1d75ab(0x9a)](_0x1d75ab(0x21d)),0x1;let _0x3bf038;if(_0x30ff55[_0x1d75ab(0x1e6)])_0x3bf038=await loadJSON(_0x30ff55[_0x1d75ab(0x1e6)],!![]);else{if(!_0x30ff55[_0x1d75ab(0x1ef)])return console[_0x1d75ab(0x9a)](_0x1d75ab(0x1a4)),console[_0x1d75ab(0x9a)](_0x1d75ab(0x286)),0x1;if(_0x30ff55[_0x1d75ab(0x18c)]===undefined)return console[_0x1d75ab(0x9a)]('Error:\x20--description\x20is\x20required\x20(or\x20use\x20--file\x20for\x20a\x20full\x20request\x20body)'),console['error'](_0x1d75ab(0x286)),0x1;let _0x479cd3;_0x30ff55['sections']&&(_0x479cd3=await loadJSON(_0x30ff55['sections'],![])),_0x3bf038={'attributes':{'name':_0x30ff55[_0x1d75ab(0x1ef)],'description':_0x30ff55['description']||null,..._0x479cd3!==undefined&&{'sections':_0x479cd3}}};}const {tdx:_0x35a92c}=_0x21402f,_0x5b09dc=await withSpinner(_0x1d75ab(0x285)+_0x319e97+'\x27...',()=>_0x35a92c[_0x1d75ab(0x90)]['patchPersonalization'](_0x319e97,_0x3bf038),{'verbose':_0x7a2cd9['verbose']}),_0x4e4b76=_0x5b09dc[_0x1d75ab(0x22f)];return console[_0x1d75ab(0x9a)](_0x1d75ab(0x232)+_0x4e4b76['name']+_0x1d75ab(0xb6)+_0x4e4b76['id']+')'),await handleSDKOutput([_0x4e4b76],_0x7a2cd9),0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a31_0x1e12b4(0x1ef)]=a31_0x1e12b4(0x241);[a31_0x1e12b4(0x18c)]=a31_0x1e12b4(0x99);async[a31_0x1e12b4(0x26e)](_0xf9289){const _0x572e77=a31_0x1e12b4,{options:_0x20c182,args:_0x20a5af}=_0xf9289,_0x2fa355=_0x20a5af[0x0]||_0x20c182[_0x572e77(0x1ce)];if(!_0x2fa355)return showParentSegmentNotSetError(_0x572e77(0x98)+_0x572e77(0x177)),0x1;const _0x1a0a85=resolveYamlFile(_0x2fa355);if(!existsSync(_0x1a0a85))return showFileNotFoundError(_0x1a0a85,_0x2fa355),0x1;let _0x153902;try{_0x153902=readFileSync(_0x1a0a85,_0x572e77(0x288));}catch(_0x412c41){const _0x20348d=_0x412c41 instanceof Error?_0x412c41[_0x572e77(0x112)]:String(_0x412c41);return console[_0x572e77(0x9a)]('Error\x20reading\x20file:\x20'+_0x20348d),0x1;}let _0x4378a9;try{_0x4378a9=parseDef(_0x153902);}catch(_0x3559cd){const _0x47a275=_0x3559cd instanceof Error?_0x3559cd[_0x572e77(0x112)]:String(_0x3559cd);return console[_0x572e77(0x9a)](a31_0x46217b[_0x572e77(0xba)](_0x572e77(0x91)+_0x47a275)),0x1;}if(_0x4378a9[_0x572e77(0xfc)]&&_0x4378a9[_0x572e77(0xfc)]['length']>0x0)return console[_0x572e77(0x9a)](a31_0x46217b['yellow'](_0x572e77(0x20b)+_0x1a0a85)),console[_0x572e77(0x9a)](a31_0x46217b[_0x572e77(0x140)](_0x572e77(0x145)+_0x4378a9[_0x572e77(0xfc)][_0x572e77(0x179)]+_0x572e77(0x178))),0x1;!_0x4378a9[_0x572e77(0x113)]&&(_0x4378a9[_0x572e77(0x113)]={'events':[{'name':_0x572e77(0x271),'source_table':_0x572e77(0xb5)}],'attributes':[{'name':_0x572e77(0x26c),'type':_0x572e77(0x27e)}],'id_stitching':{'primary_key':_0x4378a9[_0x572e77(0x19a)][_0x572e77(0x111)]===_0x572e77(0x9c)?_0x572e77(0x1f6):_0x572e77(0x125)}});_0x4378a9[_0x572e77(0xfc)]=[{'name':_0x572e77(0x13c),'description':_0x572e77(0xc9),'trigger_event':'page_view','sections':[{'name':_0x572e77(0x1b0),'criteria':'true','attributes':['last_page_viewed']}]}];const _0x591046=serializeDef(_0x4378a9);return writeFileSync(_0x1a0a85,_0x591046,_0x572e77(0x288)),console[_0x572e77(0x9a)](a31_0x46217b[_0x572e77(0x1a7)]('✔')+_0x572e77(0x17b)+a31_0x46217b[_0x572e77(0x228)](_0x1a0a85)),(!_0x4378a9['realtime']||_0x153902['indexOf'](_0x572e77(0x239))===-0x1)&&console[_0x572e77(0x9a)](a31_0x46217b[_0x572e77(0x1a7)]('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x572e77(0x9a)]('\x0a'+a31_0x46217b[_0x572e77(0x140)](_0x572e77(0x86))),console[_0x572e77(0x9a)]('\x20\x201.\x20Edit\x20'+_0x1a0a85+_0x572e77(0xf6)),console[_0x572e77(0x9a)](_0x572e77(0x28a)+a31_0x46217b['dim'](_0x572e77(0x12f)+_0x2fa355)+_0x572e77(0x237)),0x0;}}
|