@treasuredata/tdx 0.28.2 → 0.28.3
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/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/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/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/use-command.js +1 -1
- package/dist/commands/user-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/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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/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/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-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/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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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/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/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/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/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 a26_0x3e1dba=a26_0x241c;(function(_0x1b70a2,_0x5f59ff){const _0x4e359c=a26_0x241c,_0x530b8f=_0x1b70a2();while(!![]){try{const _0xe81b65=parseInt(_0x4e359c(0x222))/0x1*(-parseInt(_0x4e359c(0x1ba))/0x2)+parseInt(_0x4e359c(0x289))/0x3+parseInt(_0x4e359c(0x1d2))/0x4+-parseInt(_0x4e359c(0x1ac))/0x5*(parseInt(_0x4e359c(0x2ad))/0x6)+-parseInt(_0x4e359c(0x20c))/0x7+-parseInt(_0x4e359c(0x28b))/0x8+parseInt(_0x4e359c(0x255))/0x9;if(_0xe81b65===_0x5f59ff)break;else _0x530b8f['push'](_0x530b8f['shift']());}catch(_0x115bb0){_0x530b8f['push'](_0x530b8f['shift']());}}}(a26_0x50f9,0x94a8b));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a26_0x151967 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}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 a26_0x4d135b 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=a26_0x3e1dba(0x1b2),LEGACY_PARENT_SEGMENT_DIR=a26_0x3e1dba(0x249);function a26_0x241c(_0x3d53ec,_0x3d74fb){_0x3d53ec=_0x3d53ec-0x171;const _0x50f912=a26_0x50f9();let _0x241ca8=_0x50f912[_0x3d53ec];return _0x241ca8;}function openBrowser(_0x381ec5){const _0x11be3e=a26_0x3e1dba,_0x15732f=process[_0x11be3e(0x2d7)],_0x267cc1=_0x15732f===_0x11be3e(0x2a0)?'open':_0x15732f===_0x11be3e(0x28f)?_0x11be3e(0x1e7):_0x11be3e(0x1e9);spawn(_0x267cc1,[_0x381ec5],{'detached':!![],'stdio':'ignore'})[_0x11be3e(0x2a2)]();}function a26_0x50f9(){const _0x5502d0=['\x20Opening\x20','\x20rows)','✔\x20Found\x20','To\x20cancel:','text','Events:','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','YAML\x20file:\x20','displayAttributesStats','👥\x20','setJobId','label','matchedCount','Personalization\x20service\x20description','\x20\x20Database:\x20','\x20=\x20','schemaValid','/\x20→\x20','Customers:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','segment:parent:fields','apply','displaySummary','workflowAttemptId','Overwrite\x20\x27','getParentSQL','sourceTableValid','Status:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','behavior','column_name','segment:parent:preview','platform','Error\x20reading\x20file:\x20','Error\x20parsing\x20YAML:\x20','true','endsWith','\x20\x20Columns:\x20','Pattern:\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','personalizationServices','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','repeat','description','use','FINISHED','interval','cyan','Apply\x20changes\x20to\x20\x27','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','allValid','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','No\x20RT-enabled\x20parent\x20segments\x20found','utf-8','/app/dw/parentSegments/','Behaviors','customerPercent','run','table','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x22,\x20\x22type\x22:\x20\x22','single','\x5c$&','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Output\x20Database:','addBehaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','status','Master\x20Table','sort','valid','\x0a\x20\x20\x20\x20]','Attempt:','To\x20view\x20sample\x20data:','.yml','\x20rows\x20','Validate:','stats','personalization_services','verbose','schemaError','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','enabled','displayPreviewHints','timezone','\x20behaviors','varchar','✔\x20Query\x20completed:\x20Processed\x20','Fetching\x20sample\x20data...','\x27\x20and\x20run\x20workflow?','\x20to\x20push\x20the\x20configuration','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20[Job\x20ID:\x20','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','displayBehaviorsStats','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment','segment:parent:view','pushParentYaml','\x22\x20}','join','realtime','\x20Configuration\x20is\x20valid','Available\x20attributes:','\x0aChanges\x20to\x20apply\x20to\x20\x27','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Attributes','/app/workflows/','realtime:','Fetching\x20customers\x20schema...','getParentFull','\x20\x20Tables:\x201\x20customers\x20+\x20','Validating\x20configuration...','joinKey','collectSchema','Updating','\x20RT-enabled\x20parent\x20segment','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x20configured','displayColumns','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','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','/{name}.yml\x0a','\x20--behavior\x20\x22','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','Updating\x20parent\x20segment\x20\x27','\x20Added\x20RT\x202.0\x20template\x20section','dirname','audienceId','Error:','-1d','all','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','415bhygRm','master','name','\x20\x201.\x20Edit\x20','attributesFile','`\x20to\x20download\x20the\x20configuration\x20first','parent_segments','Output\x20file:\x20','behaviors','listParents','push','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Create\x20parent\x20segment\x20\x27','green','16BOEoSS','string','toFixed','dim','stitchingKeys','displayValidateResults','last_page_viewed','sampleData','site','yes','\x20parent\x20segment\x20\x27','No\x20parent\x20segments\x20found','foreignKey','\x20No\x20changes\x20-\x20','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','message','Error:\x20File\x20not\x20found:\x20','validateParentYaml','errors','\x20tdx\x20wf\x20attempt\x20','keys','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Personalization:','\x20service(s)\x20configured','1156308QCLsCE','format','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Source:','length','No\x20parent\x20segments\x20match\x20pattern:\x20','%)\x20','formatSchemaJson','/attempt/','isDirectory','SELECT\x20*\x20FROM\x20','Creating','Resolving\x20parent\x20segment\x20\x27','\x27...','listFields','Error:\x20Parent\x20segment\x20name\x20is\x20required','Show\x20parent\x20segment\x20schema\x20(column\x20types)','segment:parent:desc','output','double','start','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','xdg-open','data','segment','customerGroup','Next\x20steps:','\x20--attribute\x20\x22','Coverage:','population','Fetching\x20SQL\x20for\x20\x27','database','tdx\x20ps\x20preview\x20','\x27\x20is\x20already\x20up\x20to\x20date','ID\x20Stitching:','Name:\x20','segment:parent:show','\x20\x20\x20\x20-\x20','yellow','\x0aNew\x20parent\x20segment\x20\x27','Creating\x20parent\x20segment\x20\x27','/\x20directories\x20exist.','list','tdx\x20ps\x20push\x20','My\x20Service','rowCount','columns','\x20parent\x20segment','Attribute:','Listing\x20personalization\x20services\x20for\x20\x27','runParent','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','RT\x202.0\x20Validate:','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','\x20RT\x20configuration\x20is\x20valid','enriched','Get\x20SQL\x20query\x20for\x20parent\x20segment','29120HfvcBX','customerGroupFile','toLowerCase','previewParentYaml','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','in\x20','addAttributes','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Created','SQL\x20query:\x0a','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','reduce','primaryKey','jobId','\x20total','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x0aNo\x20sample\x20data\x20available','user_id','Fetching\x20parent\x20segment\x20\x27','displayRealtimeInfo','112289dgCadi','\x20\x20\x20\x20','Aborted.','stop','column_type','Error:\x20--database\x20and\x20--table\x20are\x20required','behavior_','Listing\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20--enriched','Schema\x20saved\x20to\x20','List\x20available\x20fields\x20for\x20segmentation','\x27\x20is\x20up\x20to\x20date','attribute','segment:parent:push','Behavior:','getOutputDatabaseName','toLocaleString','idStitching','map','displayPreviewResults','red','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','customersWithEvents','segment:parent:list','\x20--attribute\x20\x22<name>\x22','events','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','Session:','Show\x20parent\x20segment\x20details','customers','realtime_enabled','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','trim','/\x20directory.\x0a','Columns:','sourceTableError','parent_segment','session','RT\x202.0:','/sessions/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','getBehaviorNames','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','Listing\x20fields\x20for\x20\x27','Master:','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x20Context\x20set:\x20','15212376bQoPeK','List\x20parent\x20segments','test','coveragePercent','totalEvents','.customers)','sections','Table:\x20','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','type','Master\x20+\x20Attributes','Analyzing\x20changes...','Join\x20on:','\x20\x202.\x20Run\x20','Fetching\x20current\x20configuration\x20for\x20\x27','Parent\x20segment:\x20','match','web','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','parentSegment','error','Site:\x20','Updated','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x20field','log','segment:parent:create','bold','/\x20and\x20','SELECT\x20*\x20FROM\x20(\x0a','personalization','Listing\x20parent\x20segments...','Errors:','resolveParentId','{\x0a\x20\x20\x22database\x22:\x20\x22','createParent','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','limit','\x20--behavior\x20\x22<name>\x22','addAttributesFile','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','replace','execute','workflowSessionId','✔\x20No\x20changes\x20-\x20\x27','<database>.<table>','Preview:','.yaml','\x0a✔\x20Workflow\x20started','segment:parent:run','\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','552510hdmQJk','Available\x20behaviors:','4833928bnbZEZ','attributes','Rows:','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','win32','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','\x20personalization\x20service','filter','\x0a⚠️\x20\x20Both\x20','behaviorsFile','Fetching\x20behavior\x20list...','parent_id','✔\x20Renamed\x20directory\x20to\x20','\x20\x20Note:\x20','localeCompare','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','updateParent','Found\x20YAML\x20file:\x20','pullParentYaml','using\x20the\x20default\x20path:\x20','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','darwin','Join:','unref','Default','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\x20is\x20already\x20up\x20to\x20date','Attributes:','displayMasterInfo','displaySampleData','\x20section','jsonl','scheduleType','\x20\x20\x20','3462xWSxoq','\x20kill','preview','column','segment:parent:pull','\x0aError:','Options:\x0a','\x20\x20No\x20sample\x20data\x20available','json','scheduleOption'];a26_0x50f9=function(){return _0x5502d0;};return a26_0x50f9();}function migrateLegacyDirectory(){const _0x5bc3ab=a26_0x3e1dba;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4e531c=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4e531c[_0x5bc3ab(0x1dc)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x5bc3ab(0x269)](a26_0x4d135b[_0x5bc3ab(0x1f9)](_0x5bc3ab(0x293)+LEGACY_PARENT_SEGMENT_DIR+_0x5bc3ab(0x271)+PARENT_SEGMENT_DIR+_0x5bc3ab(0x1fc))),console[_0x5bc3ab(0x269)](a26_0x4d135b[_0x5bc3ab(0x1bd)](_0x5bc3ab(0x238)+LEGACY_PARENT_SEGMENT_DIR+_0x5bc3ab(0x246))),![];console[_0x5bc3ab(0x269)](a26_0x4d135b['yellow']('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x5bc3ab(0x2c8)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x5bc3ab(0x269)](a26_0x4d135b[_0x5bc3ab(0x1b9)](_0x5bc3ab(0x297)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2ebbd1){const _0x46b711=_0x2ebbd1 instanceof Error?_0x2ebbd1['message']:String(_0x2ebbd1);return console[_0x5bc3ab(0x269)](a26_0x4d135b[_0x5bc3ab(0x237)]('✘\x20Failed\x20to\x20rename\x20directory:\x20'+_0x46b711+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a26_0x3e1dba(0x2f0)](_0x352d46){return migrateLegacyDirectory(),super['run'](_0x352d46);}}function resolveYamlFile(_0x225f20){const _0x56add1=a26_0x3e1dba;if(_0x225f20[_0x56add1(0x2db)]('.yml')||_0x225f20[_0x56add1(0x2db)](_0x56add1(0x285)))return _0x225f20;return a26_0x151967[_0x56add1(0x189)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x225f20)+_0x56add1(0x304));}function formatProgressMessage(_0x5ac2bf){const _0x3e4b79=a26_0x3e1dba,_0x320e54=_0x5ac2bf[_0x3e4b79(0x265)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x320e54){const [,_0x44e678,_0x521519,_0x16a590='']=_0x320e54;return a26_0x4d135b[_0x3e4b79(0x1bd)](_0x44e678+':')+'\x20'+_0x521519+a26_0x4d135b[_0x3e4b79(0x1bd)](_0x16a590);}return a26_0x4d135b[_0x3e4b79(0x1bd)](_0x5ac2bf);}function showFileNotFoundError(_0x56e69e,_0x438afa){const _0x49a928=a26_0x3e1dba;console['error'](a26_0x4d135b[_0x49a928(0x237)](_0x49a928(0x1ca)+_0x56e69e+'\x0a')),console[_0x49a928(0x269)](a26_0x4d135b[_0x49a928(0x2e6)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x438afa+_0x49a928(0x1b1)));}function displayRealtimeValidation(_0x20917c){const _0x79c225=a26_0x3e1dba;if(!_0x20917c['realtime'])return;const _0x5dea7f=_0x20917c['realtime'],_0x39daf2=_0x5dea7f[_0x79c225(0x176)]?a26_0x4d135b['green']('⚡\x20Enabled'):a26_0x4d135b[_0x79c225(0x1f9)]('⚡\x20Not\x20enabled');console[_0x79c225(0x269)]('\x0a'+a26_0x4d135b[_0x79c225(0x1bd)](_0x79c225(0x24b))+'\x20'+_0x39daf2);if(_0x5dea7f[_0x79c225(0x23e)]&&_0x5dea7f[_0x79c225(0x23e)][_0x79c225(0x1d7)]>0x0){console[_0x79c225(0x269)]('\x20\x20'+a26_0x4d135b['dim'](_0x79c225(0x2bc))+'\x20'+_0x5dea7f[_0x79c225(0x23e)][_0x79c225(0x1d7)]+_0x79c225(0x19c));for(const _0x4fca72 of _0x5dea7f['events']){const _0x4dd9f8=_0x4fca72[_0x79c225(0x2d1)]===![]?a26_0x4d135b[_0x79c225(0x237)]('✘'):a26_0x4d135b[_0x79c225(0x1b9)]('✔');console[_0x79c225(0x269)](_0x79c225(0x223)+_0x4dd9f8+'\x20'+_0x4fca72[_0x79c225(0x1ae)]),_0x4fca72[_0x79c225(0x248)]&&console['error']('\x20\x20\x20\x20\x20\x20'+a26_0x4d135b['red'](_0x4fca72[_0x79c225(0x248)]));}}if(_0x5dea7f[_0x79c225(0x28c)]&&_0x5dea7f[_0x79c225(0x28c)]['length']>0x0){console[_0x79c225(0x269)]('\x20\x20'+a26_0x4d135b[_0x79c225(0x1bd)](_0x79c225(0x2a6))+'\x20'+_0x5dea7f['attributes'][_0x79c225(0x1d7)]+_0x79c225(0x19c));for(const _0x328f28 of _0x5dea7f[_0x79c225(0x28c)]){const _0x395b5b=_0x328f28[_0x79c225(0x300)]?a26_0x4d135b[_0x79c225(0x1b9)]('✔'):a26_0x4d135b[_0x79c225(0x237)]('✘');console[_0x79c225(0x269)]('\x20\x20\x20\x20'+_0x395b5b+'\x20'+_0x328f28[_0x79c225(0x1ae)]+'\x20'+a26_0x4d135b['dim']('('+_0x328f28[_0x79c225(0x25e)]+')'));}}if(_0x5dea7f['idStitching']){const _0x563e23=_0x5dea7f['idStitching'][_0x79c225(0x1be)]?.[_0x79c225(0x1d7)]?'\x20+\x20['+_0x5dea7f[_0x79c225(0x234)]['stitchingKeys'][_0x79c225(0x189)](',\x20')+']':'';console[_0x79c225(0x269)]('\x20\x20'+a26_0x4d135b[_0x79c225(0x1bd)](_0x79c225(0x1f5))+'\x20'+_0x5dea7f[_0x79c225(0x234)][_0x79c225(0x219)]+_0x563e23);}if(_0x5dea7f['personalizationServices']&&_0x5dea7f[_0x79c225(0x2df)][_0x79c225(0x1d7)]>0x0){console[_0x79c225(0x269)]('\x20\x20'+a26_0x4d135b[_0x79c225(0x1bd)](_0x79c225(0x1d0))+'\x20'+_0x5dea7f['personalizationServices'][_0x79c225(0x1d7)]+'\x20service'+(_0x5dea7f[_0x79c225(0x2df)][_0x79c225(0x1d7)]!==0x1?'s':''));for(const _0x148ae7 of _0x5dea7f[_0x79c225(0x2df)]){console['error'](_0x79c225(0x1f8)+_0x148ae7[_0x79c225(0x1ae)]);}}}function showParentSegmentNotSetError(_0x35d67d){const _0x389efd=a26_0x3e1dba;console[_0x389efd(0x269)](a26_0x4d135b[_0x389efd(0x1f9)](_0x389efd(0x2ca))),console[_0x389efd(0x269)](_0x35d67d);}export class ParentSegmentListCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x23c);['description']=a26_0x3e1dba(0x256);async[a26_0x3e1dba(0x280)](_0x1e3aa9){const _0x103fc6=a26_0x3e1dba,{options:_0x23f71a,args:_0x2040fe,tdx:_0x39c4a3}=_0x1e3aa9,_0x53b499=_0x2040fe[0x0];_0x23f71a[_0x103fc6(0x173)]&&(console[_0x103fc6(0x269)](_0x103fc6(0x26a)+_0x23f71a[_0x103fc6(0x1c2)]),_0x53b499&&console[_0x103fc6(0x269)](_0x103fc6(0x2dd)+_0x53b499));const _0x4732d5=await withSpinner(_0x53b499?_0x103fc6(0x229)+_0x53b499+_0x103fc6(0x1e0):_0x103fc6(0x274),()=>_0x39c4a3[_0x103fc6(0x1eb)][_0x103fc6(0x1b5)](),{'verbose':_0x23f71a[_0x103fc6(0x173)]});let _0x333ad6=_0x4732d5['data'];if(_0x53b499){const _0x1c2c93=_0x53b499[_0x103fc6(0x27f)](/[.+^${}()|[\]\\]/g,_0x103fc6(0x2f6))['replace'](/\*/g,'.*')[_0x103fc6(0x27f)](/\?/g,'.'),_0x3a4672=new RegExp('^'+_0x1c2c93+'$','i');_0x333ad6=_0x333ad6[_0x103fc6(0x292)](_0x5ad211=>_0x3a4672['test'](_0x5ad211[_0x103fc6(0x28c)][_0x103fc6(0x1ae)]));}_0x333ad6[_0x103fc6(0x2ff)]((_0x549002,_0x3da814)=>_0x549002[_0x103fc6(0x28c)][_0x103fc6(0x1ae)][_0x103fc6(0x299)](_0x3da814[_0x103fc6(0x28c)][_0x103fc6(0x1ae)])),console['error'](_0x103fc6(0x2b9)+_0x333ad6[_0x103fc6(0x1d7)]+_0x103fc6(0x202)+(_0x333ad6[_0x103fc6(0x1d7)]!==0x1?'s':''));const _0x41174a=_0x395a74=>{const _0x464e42=_0x103fc6;return getConsoleNextUrl(_0x23f71a[_0x464e42(0x1c2)],_0x464e42(0x2ed)+_0x395a74);};if(_0x23f71a[_0x103fc6(0x1d3)]==='json'||_0x23f71a[_0x103fc6(0x1d3)]===_0x103fc6(0x2aa)){const _0xd371f5=_0x333ad6[_0x103fc6(0x235)](_0x2e2a0f=>({..._0x2e2a0f,'url':_0x41174a(_0x2e2a0f['id'])}));await handleSDKOutput(_0xd371f5,_0x23f71a);}else{if(_0x333ad6['length']===0x0)_0x53b499?console[_0x103fc6(0x26e)](_0x103fc6(0x1d8)+_0x53b499):console[_0x103fc6(0x26e)](_0x103fc6(0x1c5));else for(const _0x21c13a of _0x333ad6){const _0x2bb0ac=_0x21c13a['attributes'][_0x103fc6(0x1f0)]?a26_0x4d135b[_0x103fc6(0x1bd)]('\x20('+formatRows(_0x21c13a[_0x103fc6(0x28c)][_0x103fc6(0x1f0)])+')'):'',_0x2a92da=hyperlink(_0x21c13a['attributes'][_0x103fc6(0x1ae)],_0x41174a(_0x21c13a['id']));console[_0x103fc6(0x26e)](_0x103fc6(0x2c0)+_0x2a92da+_0x2bb0ac);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x26f);[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x1b7);async[a26_0x3e1dba(0x280)](_0x1cc63f){const _0x4d2a51=a26_0x3e1dba,{options:_0x186557,args:_0x562332,tdx:_0x2b9a76}=_0x1cc63f;console[_0x4d2a51(0x269)](_0x4d2a51(0x290)+_0x4d2a51(0x24e)+_0x4d2a51(0x2f8));const _0x49db19=_0x186557;if(_0x562332[_0x4d2a51(0x1d7)]===0x0)return console[_0x4d2a51(0x269)](a26_0x4d135b[_0x4d2a51(0x237)](_0x4d2a51(0x1e2))),console['error'](_0x4d2a51(0x214)),0x1;const _0x8aeefb=_0x562332[0x0];if(!_0x49db19[_0x4d2a51(0x1f2)]||!_0x49db19[_0x4d2a51(0x2f1)])return console[_0x4d2a51(0x269)](_0x4d2a51(0x227)),console['error'](_0x4d2a51(0x214)),0x1;_0x49db19[_0x4d2a51(0x173)]&&(console['error'](_0x4d2a51(0x26a)+_0x49db19[_0x4d2a51(0x1c2)]),console[_0x4d2a51(0x269)](_0x4d2a51(0x1f6)+_0x8aeefb),console[_0x4d2a51(0x269)]('Database:\x20'+_0x49db19[_0x4d2a51(0x1f2)]),console[_0x4d2a51(0x269)](_0x4d2a51(0x25c)+_0x49db19['table']));const _0xacfb3d=await loadJSONFromOptions(_0x49db19['attributes'],_0x49db19[_0x4d2a51(0x1b0)]),_0x4aaeb2=await loadJSONFromOptions(_0x49db19[_0x4d2a51(0x1b4)],_0x49db19[_0x4d2a51(0x294)]),_0x3eb1b2=await loadJSONFromOptions(_0x49db19[_0x4d2a51(0x1ec)],_0x49db19[_0x4d2a51(0x20d)]),_0x40ecbe={'name':_0x8aeefb,'description':_0x49db19['description'],'scheduleType':_0x49db19[_0x4d2a51(0x2ab)],'scheduleOption':_0x49db19[_0x4d2a51(0x2b6)],'timezone':_0x49db19[_0x4d2a51(0x178)],'master':{'parentDatabaseName':_0x49db19[_0x4d2a51(0x1f2)],'parentTableName':_0x49db19['table']},'attributes':_0xacfb3d,'behaviors':_0x4aaeb2,'customerGroup':_0x3eb1b2},_0x4900ec=await withSpinner(_0x4d2a51(0x1fb)+_0x8aeefb+_0x4d2a51(0x1e0),()=>_0x2b9a76[_0x4d2a51(0x1eb)][_0x4d2a51(0x278)](_0x40ecbe),{'verbose':_0x186557[_0x4d2a51(0x173)]}),_0x5943d7=_0x4900ec[_0x4d2a51(0x1ea)];return console[_0x4d2a51(0x269)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x5943d7['name']+'\x27\x20with\x20ID:\x20'+_0x5943d7['id']),await handleSDKOutput([_0x5943d7],_0x186557),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x21d);async['execute'](_0x231654){const _0x36fef2=a26_0x3e1dba,{options:_0x33ecac,args:_0x19df17,tdx:_0x39bcd7}=_0x231654;console[_0x36fef2(0x269)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+_0x36fef2(0x24e)+_0x36fef2(0x2f8));const _0x194b61=_0x33ecac;if(_0x19df17[_0x36fef2(0x1d7)]===0x0)return console[_0x36fef2(0x269)](a26_0x4d135b['red'](_0x36fef2(0x1e2))),console[_0x36fef2(0x269)](_0x36fef2(0x250)),0x1;const _0x2a3c40=_0x19df17[0x0];_0x194b61[_0x36fef2(0x173)]&&(console[_0x36fef2(0x269)](_0x36fef2(0x26a)+_0x194b61[_0x36fef2(0x1c2)]),console[_0x36fef2(0x269)](_0x36fef2(0x264)+_0x2a3c40));const _0x398981=await withSpinner(_0x36fef2(0x263)+_0x2a3c40+_0x36fef2(0x1e0),()=>_0x39bcd7[_0x36fef2(0x1eb)][_0x36fef2(0x193)](_0x2a3c40),{'verbose':_0x194b61[_0x36fef2(0x173)]}),_0x12b54e=_0x398981['data'],_0x2c1fb4=await loadJSONFromOptions(_0x194b61[_0x36fef2(0x213)],_0x194b61[_0x36fef2(0x27d)]),_0x4bfabb=await loadJSONFromOptions(_0x194b61[_0x36fef2(0x2fb)],_0x194b61['addBehaviorsFile']),_0x312552={'name':_0x12b54e[_0x36fef2(0x1ae)],'description':_0x194b61[_0x36fef2(0x2e2)]!==undefined?_0x194b61['description']:_0x12b54e[_0x36fef2(0x2e2)],'scheduleType':_0x194b61[_0x36fef2(0x2ab)]!==undefined?_0x194b61[_0x36fef2(0x2ab)]:_0x12b54e[_0x36fef2(0x2ab)],'scheduleOption':_0x194b61[_0x36fef2(0x2b6)]!==undefined?_0x194b61['scheduleOption']:_0x12b54e[_0x36fef2(0x2b6)],'timezone':_0x194b61[_0x36fef2(0x178)]!==undefined?_0x194b61['timezone']:_0x12b54e[_0x36fef2(0x178)],'master':_0x12b54e[_0x36fef2(0x1ad)],'attributes':_0x2c1fb4?[..._0x12b54e[_0x36fef2(0x28c)]||[],..._0x2c1fb4]:_0x12b54e[_0x36fef2(0x28c)],'behaviors':_0x4bfabb?[..._0x12b54e[_0x36fef2(0x1b4)]||[],..._0x4bfabb]:_0x12b54e[_0x36fef2(0x1b4)],'customerGroup':_0x12b54e[_0x36fef2(0x1ec)]},_0x5bb416=await withSpinner(_0x36fef2(0x1a4)+_0x2a3c40+_0x36fef2(0x1e0),()=>_0x39bcd7[_0x36fef2(0x1eb)][_0x36fef2(0x29b)](_0x2a3c40,_0x312552),{'verbose':_0x194b61[_0x36fef2(0x173)]}),_0x2b6e0a=_0x5bb416['data'];return console[_0x36fef2(0x269)]('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x2b6e0a['name']+'\x27'),await handleSDKOutput([_0x2b6e0a],_0x194b61),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x2b1);[a26_0x3e1dba(0x2e2)]='Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file';async[a26_0x3e1dba(0x280)](_0x470a2c){const _0x2464b8=a26_0x3e1dba,{options:_0x5aa22e,args:_0x186f68,tdx:_0x5bd157}=_0x470a2c,_0x28e1cb=_0x5aa22e,_0x50e5e4=_0x186f68[0x0]||_0x5aa22e[_0x2464b8(0x268)];if(!_0x50e5e4)return showParentSegmentNotSetError(_0x2464b8(0x211)+_0x2464b8(0x24d)),0x1;if(_0x28e1cb[_0x2464b8(0x2e3)]&&_0x28e1cb[_0x2464b8(0x1e5)])return console['error'](a26_0x4d135b[_0x2464b8(0x237)](_0x2464b8(0x1d4))),console['error'](a26_0x4d135b['dim'](_0x2464b8(0x184))),console['error'](a26_0x4d135b[_0x2464b8(0x1bd)](_0x2464b8(0x29e)+PARENT_SEGMENT_DIR+_0x2464b8(0x1a1))),console[_0x2464b8(0x269)](a26_0x4d135b[_0x2464b8(0x2e6)](_0x2464b8(0x27e))),0x1;const _0x210717=_0x28e1cb['output']||a26_0x151967[_0x2464b8(0x189)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x50e5e4)+_0x2464b8(0x304));_0x28e1cb[_0x2464b8(0x173)]&&(console[_0x2464b8(0x269)](_0x2464b8(0x26a)+_0x28e1cb[_0x2464b8(0x1c2)]),console['error'](_0x2464b8(0x264)+_0x50e5e4),console[_0x2464b8(0x269)](_0x2464b8(0x1b3)+_0x210717));const _0x52db54=await withSpinner(_0x2464b8(0x220)+_0x50e5e4+_0x2464b8(0x1e0),()=>_0x5bd157[_0x2464b8(0x1eb)][_0x2464b8(0x29d)](_0x50e5e4),{'verbose':_0x28e1cb[_0x2464b8(0x173)]}),_0x22066b=_0x52db54[_0x2464b8(0x1ea)];if(existsSync(_0x210717)){const _0xddc9a5=readFileSync(_0x210717,'utf-8'),_0x198727=generateDiff(_0xddc9a5,_0x22066b);if(!hasChanges(_0x198727))console[_0x2464b8(0x269)](a26_0x4d135b[_0x2464b8(0x1b9)]('✔')+_0x2464b8(0x1c7)+a26_0x4d135b['cyan'](_0x210717)+_0x2464b8(0x2a5));else{console[_0x2464b8(0x269)]('\x0aChanges\x20to\x20\x27'+_0x210717+'\x27:'),console[_0x2464b8(0x269)]('─'['repeat'](0x3c)),console[_0x2464b8(0x269)](formatDiffWithColors(_0x198727)),console[_0x2464b8(0x269)]('─'[_0x2464b8(0x2e1)](0x3c));if(!_0x28e1cb[_0x2464b8(0x1c3)]){if(!isInteractive())return console[_0x2464b8(0x269)](a26_0x4d135b[_0x2464b8(0x237)](_0x2464b8(0x2b2)),_0x2464b8(0x2e8)),console[_0x2464b8(0x269)](a26_0x4d135b['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x247ad2=await confirmKey(_0x2464b8(0x2cf)+_0x210717+'\x27?');if(!_0x247ad2)return console[_0x2464b8(0x269)](a26_0x4d135b['yellow']('Aborted.')),0x1;}writeFileSync(_0x210717,_0x22066b,_0x2464b8(0x2ec)),console[_0x2464b8(0x269)](a26_0x4d135b[_0x2464b8(0x1b9)]('✔')+_0x2464b8(0x1cf)+a26_0x4d135b['cyan'](_0x210717));}}else{const _0x123dd8=a26_0x151967[_0x2464b8(0x1a6)](_0x210717);!existsSync(_0x123dd8)&&mkdirSync(_0x123dd8,{'recursive':!![]}),writeFileSync(_0x210717,_0x22066b,_0x2464b8(0x2ec)),console[_0x2464b8(0x269)](a26_0x4d135b[_0x2464b8(0x1b9)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a26_0x4d135b[_0x2464b8(0x2e6)](_0x210717));}return saveSessionContext({'parent_segment':_0x50e5e4},_0x28e1cb[_0x2464b8(0x24a)]),console[_0x2464b8(0x269)](a26_0x4d135b[_0x2464b8(0x1b9)]('✔')+_0x2464b8(0x254)+a26_0x4d135b[_0x2464b8(0x1bd)](_0x2464b8(0x249))+_0x2464b8(0x2c6)+a26_0x4d135b[_0x2464b8(0x2e6)](_0x50e5e4)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x230);[a26_0x3e1dba(0x2e2)]='Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file';async[a26_0x3e1dba(0x280)](_0x21db49){const _0x2aebaf=a26_0x3e1dba,{options:_0x37fad4,args:_0x145ac3,tdx:_0xabb668}=_0x21db49,_0x35891a=_0x37fad4,_0x21ae78=_0x145ac3[0x0]||_0x37fad4[_0x2aebaf(0x268)];if(!_0x21ae78)return showParentSegmentNotSetError(_0x2aebaf(0x244)+_0x2aebaf(0x2fc)),0x1;const _0x2e903e=resolveYamlFile(_0x21ae78);if(!existsSync(_0x2e903e))return showFileNotFoundError(_0x2e903e,_0x21ae78),0x1;_0x35891a[_0x2aebaf(0x173)]&&(console['error'](_0x2aebaf(0x26a)+_0x35891a[_0x2aebaf(0x1c2)]),console[_0x2aebaf(0x269)](_0x2aebaf(0x2be)+_0x2e903e));let _0x1278da;try{_0x1278da=readFileSync(_0x2e903e,_0x2aebaf(0x2ec));}catch(_0x28ae3f){const _0x5ae95b=_0x28ae3f instanceof Error?_0x28ae3f[_0x2aebaf(0x1c9)]:String(_0x28ae3f);return console[_0x2aebaf(0x269)](_0x2aebaf(0x2d8)+_0x5ae95b),0x1;}const _0x5abd6f=await withSpinner(_0x2aebaf(0x260),()=>_0xabb668[_0x2aebaf(0x1eb)]['pushParentYaml'](_0x1278da),{'verbose':_0x35891a['verbose']}),_0x130c85=_0x5abd6f['data'],{isNew:_0x5ca9d7,name:_0x108a07,hasChanges:_0x407fbb,diffFormatted:_0x3d7bff}=_0x130c85;if(!_0x407fbb)return console[_0x2aebaf(0x269)](_0x2aebaf(0x282)+_0x108a07+_0x2aebaf(0x1f4)),0x0;_0x5ca9d7?console[_0x2aebaf(0x269)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x108a07+'\x27:'):console[_0x2aebaf(0x269)](_0x2aebaf(0x18d)+_0x108a07+'\x27:');console[_0x2aebaf(0x269)]('─'[_0x2aebaf(0x2e1)](0x3c)),console['error'](_0x3d7bff),console[_0x2aebaf(0x269)]('─'['repeat'](0x3c));const _0x2ca3fd=_0x5ca9d7?_0x2aebaf(0x1b8)+_0x108a07+'\x27?':_0x2aebaf(0x2e7)+_0x108a07+'\x27?';if(!_0x35891a[_0x2aebaf(0x1c3)]){if(!isInteractive())return console[_0x2aebaf(0x269)](a26_0x4d135b[_0x2aebaf(0x237)](_0x2aebaf(0x2b2)),_0x2aebaf(0x2e8)),console[_0x2aebaf(0x269)](a26_0x4d135b[_0x2aebaf(0x1bd)](_0x2aebaf(0x17f))),0x1;const _0x525974=await confirmKey(_0x2ca3fd);if(!_0x525974)return console[_0x2aebaf(0x269)](a26_0x4d135b['yellow'](_0x2aebaf(0x224))),0x1;}const _0x3e87f1=_0x5ca9d7?_0x2aebaf(0x1de):_0x2aebaf(0x198),_0x224dcc=await withSpinner(_0x3e87f1+_0x2aebaf(0x1c4)+_0x108a07+_0x2aebaf(0x1e0),()=>_0x130c85[_0x2aebaf(0x2cc)](),{'verbose':_0x35891a[_0x2aebaf(0x173)]}),_0x32a154=_0x224dcc['data'],_0x515f60=getConsoleNextUrl(_0x35891a['site'],'/app/dw/parentSegments/'+_0x32a154['id']),_0x254d1=_0x5ca9d7?'Created':'Updated';return console[_0x2aebaf(0x269)]('✔\x20'+_0x254d1+_0x2aebaf(0x1c4)+_0x32a154[_0x2aebaf(0x1ae)]+'\x27'),console[_0x2aebaf(0x269)]('\x20\x20'+_0x515f60),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x18e);async['execute'](_0x1ed134){const _0x37a77f=a26_0x3e1dba,{options:_0x4306fd,args:_0x108944,tdx:_0x5980f4}=_0x1ed134,_0x385868=_0x4306fd,_0x29b44d=_0x108944[0x0]||_0x4306fd['parentSegment'];if(!_0x29b44d)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'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x37a77f(0x2b3)+_0x37a77f(0x175)+_0x37a77f(0x28e)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0xc0409=resolveYamlFile(_0x29b44d);if(!existsSync(_0xc0409))return showFileNotFoundError(_0xc0409,_0x29b44d),0x1;_0x385868[_0x37a77f(0x173)]&&(console['error'](_0x37a77f(0x26a)+_0x385868[_0x37a77f(0x1c2)]),console[_0x37a77f(0x269)](_0x37a77f(0x2be)+_0xc0409));let _0x2e4492;try{_0x2e4492=readFileSync(_0xc0409,_0x37a77f(0x2ec));}catch(_0x1484dd){const _0x41786e=_0x1484dd instanceof Error?_0x1484dd[_0x37a77f(0x1c9)]:String(_0x1484dd);return console[_0x37a77f(0x269)](_0x37a77f(0x2d8)+_0x41786e),0x1;}const _0x1584f0=createCommandSpinner(a26_0x4d135b[_0x37a77f(0x1bd)](_0x37a77f(0x195)),{'verbose':_0x385868[_0x37a77f(0x173)]});_0x1584f0[_0x37a77f(0x1e7)]();const _0xae4255={'onProgress':_0x450bc3=>{const _0xa8c910=_0x37a77f;_0x1584f0[_0xa8c910(0x2bb)]=formatProgressMessage(_0x450bc3);}};if(_0x385868['master'])_0xae4255[_0x37a77f(0x1ad)]=!![];if(_0x385868[_0x37a77f(0x20a)])_0xae4255['enriched']=!![];_0x385868[_0x37a77f(0x22f)]&&(_0xae4255[_0x37a77f(0x22f)]=_0x385868[_0x37a77f(0x22f)]);_0x385868[_0x37a77f(0x2d4)]&&(_0xae4255[_0x37a77f(0x2d4)]=_0x385868[_0x37a77f(0x2d4)]);if(_0x385868[_0x37a77f(0x2e5)])_0xae4255[_0x37a77f(0x2e5)]=_0x385868['interval'];let _0x4bae6c;try{_0x4bae6c=await _0x5980f4[_0x37a77f(0x1eb)][_0x37a77f(0x1cb)](_0x2e4492,_0xae4255),_0x1584f0[_0x37a77f(0x225)]();}catch(_0x3941de){_0x1584f0[_0x37a77f(0x225)]();throw _0x3941de;}const _0x55d3fa=_0x385868[_0x37a77f(0x2e5)]||'-1d';return this[_0x37a77f(0x1bf)](_0x4bae6c,_0xae4255,_0xc0409,_0x55d3fa),_0x4bae6c['allValid']?0x0:0x1;}[a26_0x3e1dba(0x1bf)](_0x209e81,_0x4c0c4b,_0x35347f,_0x340ebb){const _0x2311ab=a26_0x3e1dba;console['error']('\x0a'+a26_0x4d135b[_0x2311ab(0x270)](_0x2311ab(0x306))+'\x20'+_0x209e81[_0x2311ab(0x1ae)]),console[_0x2311ab(0x269)]('═'[_0x2311ab(0x2e1)](0x3c)),this[_0x2311ab(0x2a7)](_0x209e81);if(typeof _0x4c0c4b[_0x2311ab(0x22f)]===_0x2311ab(0x1bb)){this[_0x2311ab(0x2bf)](_0x209e81),this[_0x2311ab(0x2cd)](_0x209e81),this[_0x2311ab(0x177)](_0x35347f,_0x340ebb,'attribute',_0x4c0c4b[_0x2311ab(0x22f)]);return;}if(_0x4c0c4b['attribute']===!![]){this[_0x2311ab(0x2bf)](_0x209e81),this[_0x2311ab(0x2cd)](_0x209e81),this[_0x2311ab(0x177)](_0x35347f,_0x340ebb,_0x2311ab(0x28c));return;}if(typeof _0x4c0c4b[_0x2311ab(0x2d4)]===_0x2311ab(0x1bb)){this['displayBehaviorsStats'](_0x209e81,_0x340ebb),this[_0x2311ab(0x2cd)](_0x209e81),this['displayPreviewHints'](_0x35347f,_0x340ebb,'behavior',_0x4c0c4b[_0x2311ab(0x2d4)]);return;}if(_0x4c0c4b[_0x2311ab(0x2d4)]===!![]){this['displayBehaviorsStats'](_0x209e81,_0x340ebb),this[_0x2311ab(0x2cd)](_0x209e81),this[_0x2311ab(0x177)](_0x35347f,_0x340ebb,_0x2311ab(0x1b4));return;}this[_0x2311ab(0x2bf)](_0x209e81),this['displayBehaviorsStats'](_0x209e81,_0x340ebb),this[_0x2311ab(0x221)](_0x209e81),this[_0x2311ab(0x2cd)](_0x209e81),this[_0x2311ab(0x177)](_0x35347f,_0x340ebb,_0x2311ab(0x1aa));}[a26_0x3e1dba(0x221)](_0x35e295){displayRealtimeValidation(_0x35e295);}[a26_0x3e1dba(0x177)](_0x2c15dc,_0x41d1d2,_0x24cdeb,_0x2edbae){const _0x29c164=a26_0x3e1dba;console['error']('\x0a'+a26_0x4d135b[_0x29c164(0x1bd)](_0x29c164(0x303)));const _0x54c7fc=_0x41d1d2!==_0x29c164(0x1a9)?'\x20--interval\x20'+_0x41d1d2:'';if(_0x24cdeb==='attribute'&&_0x2edbae)console['error']('\x20\x20'+a26_0x4d135b[_0x29c164(0x1bd)]('tdx\x20ps\x20preview\x20'+_0x2c15dc+_0x29c164(0x1ee)+_0x2edbae+'\x22'+_0x54c7fc));else{if(_0x24cdeb===_0x29c164(0x2d4)&&_0x2edbae)console[_0x29c164(0x269)]('\x20\x20'+a26_0x4d135b[_0x29c164(0x1bd)](_0x29c164(0x1f3)+_0x2c15dc+_0x29c164(0x1a2)+_0x2edbae+'\x22'+_0x54c7fc));else(_0x24cdeb===_0x29c164(0x28c)||_0x24cdeb===_0x29c164(0x1aa))&&console[_0x29c164(0x269)]('\x20\x20'+a26_0x4d135b['dim'](_0x29c164(0x1f3)+_0x2c15dc+_0x29c164(0x23d)+_0x54c7fc));}(_0x24cdeb==='behaviors'||_0x24cdeb===_0x29c164(0x1aa))&&console[_0x29c164(0x269)]('\x20\x20'+a26_0x4d135b[_0x29c164(0x1bd)](_0x29c164(0x1f3)+_0x2c15dc+_0x29c164(0x27c)+_0x54c7fc)),_0x24cdeb===_0x29c164(0x1aa)&&console[_0x29c164(0x269)]('\x20\x20'+a26_0x4d135b[_0x29c164(0x1bd)]('tdx\x20ps\x20preview\x20'+_0x2c15dc+_0x29c164(0x22b)+_0x54c7fc));}[a26_0x3e1dba(0x2a7)](_0x496ac6){const _0x13b5cf=a26_0x3e1dba,{master:_0x57cd42}=_0x496ac6,_0x28a31b=_0x57cd42[_0x13b5cf(0x2c7)]?a26_0x4d135b[_0x13b5cf(0x1b9)]('✔'):a26_0x4d135b[_0x13b5cf(0x237)]('✘');console['error']('\x0a'+a26_0x4d135b[_0x13b5cf(0x1bd)](_0x13b5cf(0x2fe))),console[_0x13b5cf(0x269)](_0x28a31b+'\x20'+a26_0x4d135b['bold'](_0x57cd42[_0x13b5cf(0x1f2)]+'.'+_0x57cd42['table'])),_0x57cd42[_0x13b5cf(0x2c7)]?_0x57cd42[_0x13b5cf(0x200)]!==undefined&&console[_0x13b5cf(0x269)]('\x20\x20'+a26_0x4d135b[_0x13b5cf(0x1bd)](_0x13b5cf(0x28d))+'\x20'+a26_0x4d135b[_0x13b5cf(0x2e6)](formatRows(_0x57cd42['rowCount']))):console[_0x13b5cf(0x269)]('\x20\x20'+a26_0x4d135b['red'](_0x13b5cf(0x1a8))+'\x20'+_0x57cd42[_0x13b5cf(0x174)]);}[a26_0x3e1dba(0x2bf)](_0x57d981){const _0x57d719=a26_0x3e1dba;if(_0x57d981[_0x57d719(0x28c)][_0x57d719(0x1d7)]===0x0)return;console[_0x57d719(0x269)]('\x0a'+a26_0x4d135b['dim'](_0x57d719(0x18f)));for(const _0x3aa996 of _0x57d981[_0x57d719(0x28c)]){const _0x21ecf1=_0x3aa996[_0x57d719(0x2c7)]?a26_0x4d135b[_0x57d719(0x1b9)]('✔'):a26_0x4d135b[_0x57d719(0x237)]('✘');let _0x3d113d='';if(_0x3aa996[_0x57d719(0x2c7)]&&_0x3aa996[_0x57d719(0x2c3)]!==undefined&&_0x3aa996[_0x57d719(0x258)]!==undefined){const _0x47796c=_0x3aa996[_0x57d719(0x258)][_0x57d719(0x1bc)](0x1),_0x122532=_0x3aa996[_0x57d719(0x258)]>=0x50?a26_0x4d135b[_0x57d719(0x1b9)]:_0x3aa996[_0x57d719(0x258)]>=0x32?a26_0x4d135b['yellow']:a26_0x4d135b['red'];_0x3d113d='\x20'+a26_0x4d135b[_0x57d719(0x1bd)](_0x57d719(0x1ef))+'\x20'+_0x122532(_0x47796c+'%')+'\x20('+formatRows(_0x3aa996['matchedCount'])+_0x57d719(0x2b8);}console[_0x57d719(0x269)](_0x21ecf1+'\x20'+a26_0x4d135b[_0x57d719(0x270)](_0x3aa996[_0x57d719(0x1ae)])+_0x3d113d),console[_0x57d719(0x269)]('\x20\x20'+a26_0x4d135b['dim'](_0x57d719(0x1d6))+'\x20'+a26_0x4d135b[_0x57d719(0x270)](_0x3aa996[_0x57d719(0x1f2)]+'.'+_0x3aa996[_0x57d719(0x2f1)]));const _0x15af0c=_0x3aa996['joinKey']===_0x3aa996[_0x57d719(0x1c6)]?a26_0x4d135b[_0x57d719(0x1bd)](_0x57d719(0x261))+'\x20'+_0x3aa996[_0x57d719(0x196)]:a26_0x4d135b[_0x57d719(0x1bd)](_0x57d719(0x2a1))+'\x20'+_0x3aa996[_0x57d719(0x196)]+'\x20=\x20'+_0x3aa996[_0x57d719(0x1c6)];console[_0x57d719(0x269)]('\x20\x20'+_0x15af0c),console[_0x57d719(0x269)]('\x20\x20'+a26_0x4d135b[_0x57d719(0x1bd)](_0x57d719(0x247))),this[_0x57d719(0x19d)](_0x3aa996[_0x57d719(0x201)]),!_0x3aa996['schemaValid']&&console[_0x57d719(0x269)]('\x20\x20'+a26_0x4d135b[_0x57d719(0x237)](_0x57d719(0x1a8))+'\x20'+_0x3aa996[_0x57d719(0x174)]);}}[a26_0x3e1dba(0x183)](_0x223435,_0x46078f){const _0x548d30=a26_0x3e1dba;if(_0x223435[_0x548d30(0x1b4)][_0x548d30(0x1d7)]===0x0)return;console[_0x548d30(0x269)]('\x0a'+a26_0x4d135b['dim'](_0x548d30(0x2ee))+'\x20'+a26_0x4d135b['dim']('('+_0x46078f+')'));for(const _0x331033 of _0x223435[_0x548d30(0x1b4)]){const _0x241b8a=_0x331033[_0x548d30(0x2c7)]?a26_0x4d135b[_0x548d30(0x1b9)]('✔'):a26_0x4d135b['red']('✘');let _0x17ce1b='';if(_0x331033[_0x548d30(0x2c7)]&&_0x331033[_0x548d30(0x23b)]!==undefined&&_0x331033[_0x548d30(0x259)]!==undefined){const _0x1a9f31=_0x331033['customerPercent']?.[_0x548d30(0x1bc)](0x1)||'?',_0x434574=(_0x331033[_0x548d30(0x2ef)]??0x0)>=0x32?a26_0x4d135b['green']:(_0x331033[_0x548d30(0x2ef)]??0x0)>=0x14?a26_0x4d135b[_0x548d30(0x1f9)]:a26_0x4d135b['red'];_0x17ce1b='\x20'+a26_0x4d135b[_0x548d30(0x1bd)](_0x548d30(0x2c9))+'\x20'+_0x434574(formatRows(_0x331033[_0x548d30(0x23b)]))+'\x20('+_0x1a9f31+_0x548d30(0x1d9)+a26_0x4d135b['dim'](_0x548d30(0x2bc))+'\x20'+a26_0x4d135b['cyan'](formatRows(_0x331033['totalEvents']));}console[_0x548d30(0x269)](_0x241b8a+'\x20'+a26_0x4d135b[_0x548d30(0x270)](_0x331033[_0x548d30(0x1ae)])+_0x17ce1b),console[_0x548d30(0x269)]('\x20\x20'+a26_0x4d135b[_0x548d30(0x1bd)](_0x548d30(0x1d6))+'\x20'+a26_0x4d135b[_0x548d30(0x270)](_0x331033[_0x548d30(0x1f2)]+'.'+_0x331033[_0x548d30(0x2f1)]));const _0xf6983=_0x331033[_0x548d30(0x196)]===_0x331033[_0x548d30(0x1c6)]?a26_0x4d135b[_0x548d30(0x1bd)](_0x548d30(0x261))+'\x20'+_0x331033[_0x548d30(0x196)]:a26_0x4d135b['dim']('Join:')+'\x20'+_0x331033[_0x548d30(0x196)]+_0x548d30(0x2c6)+_0x331033[_0x548d30(0x1c6)];console[_0x548d30(0x269)]('\x20\x20'+_0xf6983),console[_0x548d30(0x269)]('\x20\x20'+a26_0x4d135b[_0x548d30(0x1bd)](_0x548d30(0x247))),this[_0x548d30(0x19d)](_0x331033[_0x548d30(0x201)]),!_0x331033[_0x548d30(0x2c7)]&&console[_0x548d30(0x269)]('\x20\x20'+a26_0x4d135b[_0x548d30(0x237)](_0x548d30(0x1a8))+'\x20'+_0x331033[_0x548d30(0x174)]);}}[a26_0x3e1dba(0x19d)](_0x5e34b8){const _0x3a7bcd=a26_0x3e1dba;for(const _0x33e37e of _0x5e34b8){_0x33e37e['label']===_0x33e37e[_0x3a7bcd(0x2b0)]||_0x33e37e[_0x3a7bcd(0x2b0)]==='*'?console[_0x3a7bcd(0x269)](_0x3a7bcd(0x1f8)+_0x33e37e[_0x3a7bcd(0x2c2)]):console[_0x3a7bcd(0x269)](_0x3a7bcd(0x1f8)+_0x33e37e[_0x3a7bcd(0x2c2)]+'\x20'+a26_0x4d135b[_0x3a7bcd(0x1bd)]('('+_0x33e37e[_0x3a7bcd(0x2b0)]+')'));}}[a26_0x3e1dba(0x2cd)](_0x4e50cb){const _0x4a27a7=a26_0x3e1dba;console['error']('─'[_0x4a27a7(0x2e1)](0x3c));if(_0x4e50cb[_0x4a27a7(0x1cc)][_0x4a27a7(0x1d7)]>0x0){console[_0x4a27a7(0x269)]('\x0a'+a26_0x4d135b[_0x4a27a7(0x237)](_0x4a27a7(0x275)));for(const _0x52a1e1 of _0x4e50cb[_0x4a27a7(0x1cc)]){console[_0x4a27a7(0x269)]('\x20\x20'+a26_0x4d135b[_0x4a27a7(0x237)]('•')+'\x20'+_0x52a1e1);}}_0x4e50cb[_0x4a27a7(0x2e9)]&&console[_0x4a27a7(0x269)]('\x0a'+a26_0x4d135b[_0x4a27a7(0x1b9)]('✔')+_0x4a27a7(0x18b));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x2d6);[a26_0x3e1dba(0x2e2)]='Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration';async['execute'](_0x1fcd5c){const _0x3b4223=a26_0x3e1dba,{options:_0x17c226,args:_0x2cd8f1,tdx:_0x58c271}=_0x1fcd5c,_0xaeca30=_0x17c226,_0x166223=_0x2cd8f1[0x0]||_0x17c226[_0x3b4223(0x268)];if(!_0x166223)return showParentSegmentNotSetError(_0x3b4223(0x1ab)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+'Options\x20(one\x20required):\x0a'+_0x3b4223(0x2f7)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x3b4223(0x180)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x3b4223(0x25d)),0x1;if(!_0xaeca30[_0x3b4223(0x1ad)]&&!_0xaeca30[_0x3b4223(0x22f)]&&!_0xaeca30[_0x3b4223(0x2d4)]&&!_0xaeca30[_0x3b4223(0x20a)])return console['error'](a26_0x4d135b[_0x3b4223(0x237)](_0x3b4223(0x2f9))),console[_0x3b4223(0x269)](_0x3b4223(0x267)),console[_0x3b4223(0x269)]('Options:'),console[_0x3b4223(0x269)](_0x3b4223(0x19f)),console['error'](_0x3b4223(0x182)),console[_0x3b4223(0x269)](_0x3b4223(0x2a4)),console[_0x3b4223(0x269)]('\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data'),0x1;const _0x3fe59d=resolveYamlFile(_0x166223);if(!existsSync(_0x3fe59d))return showFileNotFoundError(_0x3fe59d,_0x166223),0x1;_0xaeca30[_0x3b4223(0x173)]&&(console[_0x3b4223(0x269)](_0x3b4223(0x26a)+_0xaeca30[_0x3b4223(0x1c2)]),console[_0x3b4223(0x269)](_0x3b4223(0x2be)+_0x3fe59d));let _0x2ea1fe;try{_0x2ea1fe=readFileSync(_0x3fe59d,'utf-8');}catch(_0x4a1976){const _0x31ebf8=_0x4a1976 instanceof Error?_0x4a1976[_0x3b4223(0x1c9)]:String(_0x4a1976);return console[_0x3b4223(0x269)]('Error\x20reading\x20file:\x20'+_0x31ebf8),0x1;}let _0x257995;try{_0x257995=parseDef(_0x2ea1fe);}catch(_0x287635){const _0x520e44=_0x287635 instanceof Error?_0x287635[_0x3b4223(0x1c9)]:String(_0x287635);return console[_0x3b4223(0x269)](a26_0x4d135b[_0x3b4223(0x237)]('Error\x20parsing\x20YAML:\x20'+_0x520e44)),0x1;}if(_0xaeca30[_0x3b4223(0x22f)]===!![]||_0xaeca30[_0x3b4223(0x22f)]===''){const _0x71427e=_0x257995[_0x3b4223(0x28c)]?.[_0x3b4223(0x235)](_0x3b7597=>_0x3b7597['name'])||[];if(_0x71427e[_0x3b4223(0x1d7)]===0x0)console['error'](a26_0x4d135b['red'](_0x3b4223(0x19e)));else{console[_0x3b4223(0x269)](a26_0x4d135b[_0x3b4223(0x237)]('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console['error'](_0x3b4223(0x18c));for(const _0x2983c2 of _0x71427e){console[_0x3b4223(0x269)]('\x20\x20'+a26_0x4d135b[_0x3b4223(0x2e6)](_0x2983c2));}console[_0x3b4223(0x269)](_0x3b4223(0x23a)+_0x166223+'\x20--attribute\x20\x22'+_0x71427e[0x0]+'\x22');}return 0x1;}if(_0xaeca30[_0x3b4223(0x2d4)]===!![]||_0xaeca30[_0x3b4223(0x2d4)]===''){const _0x3cfd27=_0x257995['behaviors']?.[_0x3b4223(0x235)](_0x47026d=>_0x47026d[_0x3b4223(0x1ae)])||[];if(_0x3cfd27['length']===0x0)console['error'](a26_0x4d135b[_0x3b4223(0x237)](_0x3b4223(0x19b)));else{console[_0x3b4223(0x269)](a26_0x4d135b[_0x3b4223(0x237)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console[_0x3b4223(0x269)](_0x3b4223(0x28a));for(const _0x4aa98d of _0x3cfd27){console['error']('\x20\x20'+a26_0x4d135b[_0x3b4223(0x2e6)](_0x4aa98d));}console[_0x3b4223(0x269)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x166223+_0x3b4223(0x1a2)+_0x3cfd27[0x0]+'\x22');}return 0x1;}const _0x35fef2=createCommandSpinner(a26_0x4d135b['dim'](_0x3b4223(0x17c)),{'verbose':_0xaeca30[_0x3b4223(0x173)]});_0x35fef2[_0x3b4223(0x1e7)]();const _0x2c5eb2={'onProgress':_0x168eda=>{const _0x2d41e3=_0x3b4223;_0x35fef2[_0x2d41e3(0x2bb)]=formatProgressMessage(_0x168eda);}};if(_0xaeca30[_0x3b4223(0x1ad)])_0x2c5eb2['master']=!![];if(_0xaeca30[_0x3b4223(0x22f)]&&typeof _0xaeca30[_0x3b4223(0x22f)]===_0x3b4223(0x1bb))_0x2c5eb2['attribute']=_0xaeca30[_0x3b4223(0x22f)];if(_0xaeca30[_0x3b4223(0x2d4)]&&typeof _0xaeca30[_0x3b4223(0x2d4)]===_0x3b4223(0x1bb))_0x2c5eb2[_0x3b4223(0x2d4)]=_0xaeca30[_0x3b4223(0x2d4)];if(_0xaeca30['enriched'])_0x2c5eb2['enriched']=!![];if(_0xaeca30['interval'])_0x2c5eb2[_0x3b4223(0x2e5)]=_0xaeca30['interval'];let _0x278f90;try{_0x278f90=await _0x58c271[_0x3b4223(0x1eb)][_0x3b4223(0x20f)](_0x2ea1fe,_0x2c5eb2),_0x35fef2[_0x3b4223(0x225)]();}catch(_0x50493c){_0x35fef2[_0x3b4223(0x225)]();throw _0x50493c;}return await this[_0x3b4223(0x236)](_0x278f90,{'master':_0xaeca30[_0x3b4223(0x1ad)],'attribute':typeof _0xaeca30[_0x3b4223(0x22f)]==='string'?_0xaeca30[_0x3b4223(0x22f)]:undefined,'behavior':typeof _0xaeca30[_0x3b4223(0x2d4)]==='string'?_0xaeca30[_0x3b4223(0x2d4)]:undefined,'enriched':_0xaeca30[_0x3b4223(0x20a)]}),_0x278f90['allValid']?0x0:0x1;}async[a26_0x3e1dba(0x236)](_0x5189d8,_0x4fa508){const _0x59b86c=a26_0x3e1dba;console['error']('\x0a'+a26_0x4d135b['bold'](_0x59b86c(0x284))+'\x20'+_0x5189d8['name']),console[_0x59b86c(0x269)]('═'[_0x59b86c(0x2e1)](0x3c));if(_0x4fa508['master']&&_0x5189d8[_0x59b86c(0x1c1)]){const _0x2ea278=a26_0x4d135b['dim'](_0x59b86c(0x252))+'\x20'+a26_0x4d135b[_0x59b86c(0x270)](_0x5189d8[_0x59b86c(0x1ad)][_0x59b86c(0x1f2)]+'.'+_0x5189d8['master'][_0x59b86c(0x2f1)]);await this[_0x59b86c(0x2a8)](_0x2ea278,_0x5189d8[_0x59b86c(0x1c1)]);}else{if(_0x4fa508['attribute']&&_0x5189d8[_0x59b86c(0x1c1)]){const _0x46ee22=a26_0x4d135b[_0x59b86c(0x1bd)](_0x59b86c(0x203))+'\x20'+a26_0x4d135b['bold'](_0x4fa508['attribute']);await this[_0x59b86c(0x2a8)](_0x46ee22,_0x5189d8['sampleData']);}else{if(_0x4fa508[_0x59b86c(0x2d4)]&&_0x5189d8[_0x59b86c(0x1c1)]){const _0x47a337=a26_0x4d135b[_0x59b86c(0x1bd)](_0x59b86c(0x231))+'\x20'+a26_0x4d135b[_0x59b86c(0x270)](_0x4fa508[_0x59b86c(0x2d4)]);await this[_0x59b86c(0x2a8)](_0x47a337,_0x5189d8[_0x59b86c(0x1c1)]);}else{if(_0x4fa508[_0x59b86c(0x20a)]&&_0x5189d8[_0x59b86c(0x1c1)]){const _0x244db9=a26_0x4d135b[_0x59b86c(0x1bd)]('Enriched:')+'\x20'+a26_0x4d135b[_0x59b86c(0x270)](_0x59b86c(0x25f));await this[_0x59b86c(0x2a8)](_0x244db9,_0x5189d8[_0x59b86c(0x1c1)]);}else!_0x5189d8[_0x59b86c(0x1c1)]&&console[_0x59b86c(0x269)](_0x59b86c(0x21e));}}}if(_0x5189d8[_0x59b86c(0x1cc)]['length']>0x0){console[_0x59b86c(0x269)]('─'[_0x59b86c(0x2e1)](0x3c)),console[_0x59b86c(0x269)]('\x0a'+a26_0x4d135b['red'](_0x59b86c(0x275)));for(const _0x167563 of _0x5189d8[_0x59b86c(0x1cc)]){console[_0x59b86c(0x269)]('\x20\x20'+a26_0x4d135b[_0x59b86c(0x237)]('•')+'\x20'+_0x167563);}}}async[a26_0x3e1dba(0x2a8)](_0x6fae60,_0x20a7b2){const _0x365bc8=a26_0x3e1dba;if(_0x20a7b2['length']===0x0){console['error']('\x0a'+_0x6fae60),console[_0x365bc8(0x269)](_0x365bc8(0x2b4));return;}console[_0x365bc8(0x269)]('\x0a'+_0x6fae60);const _0x5b5a3c=Object[_0x365bc8(0x1ce)](_0x20a7b2[0x0])[_0x365bc8(0x235)](_0x163317=>({'name':_0x163317,'type':typeof _0x20a7b2[0x0][_0x163317]==='number'?_0x365bc8(0x1e6):_0x365bc8(0x17a)})),_0x411752={'queryId':_0x365bc8(0x2af),'columns':_0x5b5a3c,'data':_0x20a7b2,'stats':{'state':_0x365bc8(0x2e4),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x20a7b2['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x1428e7=formatAsTable(_0x411752,_0x20a7b2[_0x365bc8(0x1d7)],!![]);await writeOutput(_0x1428e7,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a26_0x3e1dba(0x287);[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x279);async[a26_0x3e1dba(0x280)](_0x24ef76){const _0x97c0d8=a26_0x3e1dba,{options:_0xa69d68,args:_0x5131bf,tdx:_0xfd705e}=_0x24ef76,_0x3ac880=_0xa69d68,_0x27190e=_0x5131bf[0x0]||_0xa69d68['parentSegment'];if(!_0x27190e)return showParentSegmentNotSetError(_0x97c0d8(0x1e8)+_0x97c0d8(0x1d5)),0x1;const _0x30f428=resolveYamlFile(_0x27190e);if(existsSync(_0x30f428)){_0x3ac880[_0x97c0d8(0x173)]&&console[_0x97c0d8(0x269)](_0x97c0d8(0x29c)+_0x30f428);let _0x7d2cbb;try{_0x7d2cbb=readFileSync(_0x30f428,'utf-8');}catch(_0x261251){const _0x50acf1=_0x261251 instanceof Error?_0x261251[_0x97c0d8(0x1c9)]:String(_0x261251);return console[_0x97c0d8(0x269)]('Error\x20reading\x20file:\x20'+_0x50acf1),0x1;}const _0x4f971f=await withSpinner(_0x97c0d8(0x260),()=>_0xfd705e[_0x97c0d8(0x1eb)][_0x97c0d8(0x187)](_0x7d2cbb),{'verbose':_0x3ac880[_0x97c0d8(0x173)]}),_0x495cd1=_0x4f971f[_0x97c0d8(0x1ea)],{isNew:_0x38498a,name:_0x2cc166,hasChanges:_0x58cec3,diffFormatted:_0x38e538}=_0x495cd1;if(_0x58cec3){_0x38498a?console[_0x97c0d8(0x269)](_0x97c0d8(0x1fa)+_0x2cc166+'\x27:'):console[_0x97c0d8(0x269)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x2cc166+'\x27:');console['error']('─'[_0x97c0d8(0x2e1)](0x3c)),console[_0x97c0d8(0x269)](_0x38e538),console[_0x97c0d8(0x269)]('─'[_0x97c0d8(0x2e1)](0x3c));const _0x2109a6=_0x38498a?_0x97c0d8(0x1b8)+_0x2cc166+_0x97c0d8(0x17d):_0x97c0d8(0x2e7)+_0x2cc166+_0x97c0d8(0x17d);if(!_0x3ac880['yes']){if(!isInteractive())return console[_0x97c0d8(0x269)](a26_0x4d135b[_0x97c0d8(0x237)](_0x97c0d8(0x2b2)),_0x97c0d8(0x2e8)),console[_0x97c0d8(0x269)](a26_0x4d135b[_0x97c0d8(0x1bd)](_0x97c0d8(0x17f))),0x1;const _0x590089=await confirmKey(_0x2109a6);if(!_0x590089)return console[_0x97c0d8(0x269)](a26_0x4d135b[_0x97c0d8(0x1f9)]('Aborted.')),0x1;}const _0x3e1185=_0x38498a?_0x97c0d8(0x1de):_0x97c0d8(0x198);await withSpinner(_0x3e1185+_0x97c0d8(0x1c4)+_0x2cc166+_0x97c0d8(0x1e0),()=>_0x495cd1['apply'](),{'verbose':_0x3ac880[_0x97c0d8(0x173)]});const _0xa1c854=_0x38498a?_0x97c0d8(0x215):_0x97c0d8(0x26b);console[_0x97c0d8(0x269)]('✔\x20'+_0xa1c854+_0x97c0d8(0x1c4)+_0x2cc166+'\x27');}else console[_0x97c0d8(0x269)]('✔\x20No\x20changes\x20-\x20\x27'+_0x2cc166+_0x97c0d8(0x22e));}const _0x389e76=await withSpinner(_0x97c0d8(0x2de)+_0x27190e+_0x97c0d8(0x1e0),()=>_0xfd705e[_0x97c0d8(0x1eb)][_0x97c0d8(0x205)](_0x27190e),{'verbose':_0x3ac880['verbose']}),_0x4c5594=_0x389e76[_0x97c0d8(0x1ea)],_0x120499=getConsoleUrl(_0x3ac880[_0x97c0d8(0x1c2)],_0x97c0d8(0x190)+_0x4c5594['workflowId']+_0x97c0d8(0x24c)+_0x4c5594[_0x97c0d8(0x281)]+_0x97c0d8(0x1db)+_0x4c5594[_0x97c0d8(0x2ce)]);return console['error'](_0x97c0d8(0x286)),console[_0x97c0d8(0x269)]('\x20\x20'+a26_0x4d135b[_0x97c0d8(0x1bd)]('Audience\x20ID:')+'\x20'+_0x4c5594[_0x97c0d8(0x1a7)]),console[_0x97c0d8(0x269)]('\x20\x20'+a26_0x4d135b[_0x97c0d8(0x1bd)](_0x97c0d8(0x2d2))+'\x20'+_0x4c5594[_0x97c0d8(0x2fd)]),console['error']('\x20\x20'+a26_0x4d135b['dim'](_0x97c0d8(0x240))+'\x20'+_0x4c5594[_0x97c0d8(0x281)]),console[_0x97c0d8(0x269)]('\x20\x20'+a26_0x4d135b[_0x97c0d8(0x1bd)](_0x97c0d8(0x302))+'\x20'+_0x4c5594[_0x97c0d8(0x2ce)]),console[_0x97c0d8(0x269)]('\x20\x20'+_0x120499),console['error']('\x0a'+a26_0x4d135b[_0x97c0d8(0x1bd)](_0x97c0d8(0x2ba))+_0x97c0d8(0x1cd)+_0x4c5594[_0x97c0d8(0x2ce)]+_0x97c0d8(0x2ae)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x2cb);[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x22d);async[a26_0x3e1dba(0x280)](_0x2c54dc){const _0x193520=a26_0x3e1dba,{options:_0x1c2a45,args:_0x293fec,tdx:_0x524f3b}=_0x2c54dc,_0x1ec463=_0x293fec[0x0]||_0x1c2a45[_0x193520(0x268)];if(!_0x1ec463)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'+_0x193520(0x2f2)),0x1;_0x1c2a45['verbose']&&(console[_0x193520(0x269)](_0x193520(0x26a)+_0x1c2a45[_0x193520(0x1c2)]),console[_0x193520(0x269)](_0x193520(0x264)+_0x1ec463));const _0x1da029=await withSpinner(_0x193520(0x251)+_0x1ec463+_0x193520(0x1e0),()=>_0x524f3b['segment'][_0x193520(0x1e1)](_0x1ec463),{'verbose':_0x1c2a45[_0x193520(0x173)]}),_0x1fa44a=_0x1da029[_0x193520(0x1ea)];console[_0x193520(0x269)](_0x193520(0x2b9)+_0x1fa44a[_0x193520(0x1d7)]+_0x193520(0x26d)+(_0x1fa44a['length']!==0x1?'s':''));if(_0x1c2a45[_0x193520(0x2b5)]||_0x1c2a45[_0x193520(0x2aa)])return await handleSDKOutput(_0x1fa44a,_0x1c2a45),0x0;return displayFieldsHumanReadable(_0x1fa44a,_0x1ec463),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x186);[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x241);async[a26_0x3e1dba(0x280)](_0x4b046a){const _0x4cecce=a26_0x3e1dba,{options:_0x6f3e22,args:_0xef4c70,tdx:_0x536cb5}=_0x4b046a,_0x4c4787=_0x6f3e22,_0xc66606=_0xef4c70[0x0]||_0x6f3e22['parentSegment'];if(!_0xc66606)return showParentSegmentNotSetError(_0x4cecce(0x2f3)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x4cecce(0x2b3)+_0x4cecce(0x23f)),0x1;_0x6f3e22[_0x4cecce(0x173)]&&(console[_0x4cecce(0x269)](_0x4cecce(0x26a)+_0x6f3e22['site']),console[_0x4cecce(0x269)](_0x4cecce(0x264)+_0xc66606));const _0x4d9178=await withSpinner(_0x4cecce(0x220)+_0xc66606+_0x4cecce(0x1e0),()=>_0x536cb5[_0x4cecce(0x1eb)]['getParentFull'](_0xc66606),{'verbose':_0x6f3e22[_0x4cecce(0x173)]}),_0x39d0bf=_0x4d9178[_0x4cecce(0x1ea)];if(_0x4c4787[_0x4cecce(0x266)]){const _0x1bba2a=getConsoleNextUrl(_0x4c4787[_0x4cecce(0x1c2)],'/app/dw/parentSegments/'+_0x39d0bf['id']);return console['error'](a26_0x4d135b[_0x4cecce(0x1b9)]('✔')+_0x4cecce(0x2b7)+a26_0x4d135b[_0x4cecce(0x2e6)](_0x1bba2a)),openBrowser(_0x1bba2a),0x0;}return await handleSingleObjectOutput(_0x39d0bf,_0x6f3e22),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x1e4);[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x1e3);async[a26_0x3e1dba(0x280)](_0x607ad5){const _0x766005=a26_0x3e1dba,{options:_0x4b6e57,args:_0x9f6a5e,tdx:_0x50f380}=_0x607ad5,_0x399d07=_0x4b6e57,_0x576f19=_0x9f6a5e[0x0]||_0x4b6e57[_0x766005(0x268)];if(!_0x576f19)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x766005(0x2e0)),0x1;_0x4b6e57[_0x766005(0x173)]&&(console[_0x766005(0x269)](_0x766005(0x26a)+_0x4b6e57['site']),console['error'](_0x766005(0x264)+_0x576f19));const _0x2538d2=await withSpinner(_0x766005(0x1df)+_0x576f19+_0x766005(0x1e0),()=>_0x50f380[_0x766005(0x1eb)]['resolveParentId'](_0x576f19),{'verbose':_0x4b6e57[_0x766005(0x173)]}),_0x446b5f=_0x2538d2[_0x766005(0x1ea)],_0x2a8b09=_0x50f380[_0x766005(0x1eb)][_0x766005(0x232)](_0x446b5f);if(_0x399d07[_0x766005(0x1e5)]){const _0x235a71=await this[_0x766005(0x197)](_0x607ad5,_0x576f19,_0x446b5f,_0x2a8b09),_0x80eeb=this[_0x766005(0x1da)](_0x235a71);writeFileSync(_0x399d07[_0x766005(0x1e5)],_0x80eeb);const _0xfd102f=_0x235a71[_0x766005(0x242)][_0x766005(0x201)][_0x766005(0x1d7)]+_0x235a71[_0x766005(0x1b4)][_0x766005(0x218)]((_0x1881c8,_0x12b5f3)=>_0x1881c8+_0x12b5f3[_0x766005(0x201)][_0x766005(0x1d7)],0x0),_0xce9af6=_0x235a71[_0x766005(0x1b4)]['filter'](_0xfce6b=>_0xfce6b[_0x766005(0x201)]['length']===0x0)['length'];return console[_0x766005(0x26e)](_0x766005(0x22c)+_0x399d07[_0x766005(0x1e5)]),console['log'](_0x766005(0x2c5)+_0x2a8b09),console[_0x766005(0x26e)](_0x766005(0x194)+_0x235a71[_0x766005(0x1b4)]['length']+_0x766005(0x179)),console[_0x766005(0x26e)](_0x766005(0x2dc)+_0xfd102f+_0x766005(0x21b)),_0xce9af6>0x0&&console[_0x766005(0x26e)](_0x766005(0x298)+_0xce9af6+_0x766005(0x210)),0x0;}console[_0x766005(0x269)]('\x0a'+a26_0x4d135b[_0x766005(0x270)](_0x766005(0x2fa))+'\x20'+a26_0x4d135b[_0x766005(0x2e6)](_0x2a8b09));const _0x2da719=await withSpinner(_0x766005(0x192),()=>_0x50f380[_0x766005(0x1eb)][_0x766005(0x2d0)](_0x446b5f),{'verbose':_0x4b6e57[_0x766005(0x173)]});console[_0x766005(0x269)]('\x0a'+a26_0x4d135b[_0x766005(0x270)](_0x766005(0x242))+'\x20'+a26_0x4d135b[_0x766005(0x1bd)]('('+_0x2a8b09+_0x766005(0x25a)));const _0x21035e=await executeSchemaQuery(_0x2da719[_0x766005(0x1ea)],_0x50f380,_0x4b6e57);await handleQueryOutput(_0x21035e,_0x4b6e57);const _0x1f7d06=await withSpinner(_0x766005(0x295),()=>_0x50f380[_0x766005(0x1eb)]['getBehaviorNames'](_0x446b5f),{'verbose':_0x4b6e57['verbose']});for(const _0x54f16e of _0x1f7d06[_0x766005(0x1ea)]){const _0x57c0aa=_0x766005(0x228)+_0x54f16e[_0x766005(0x20e)]()[_0x766005(0x27f)](/\s+/g,'_'),_0x2f57a5=_0x766005(0x1dd)+_0x2a8b09+'.'+_0x57c0aa;console[_0x766005(0x269)]('\x0a'+a26_0x4d135b['bold'](_0x54f16e)+'\x20'+a26_0x4d135b[_0x766005(0x1bd)]('('+_0x2a8b09+'.'+_0x57c0aa+')'));try{const _0x25a9f7=await executeSchemaQuery(_0x2f57a5,_0x50f380,_0x4b6e57);await handleQueryOutput(_0x25a9f7,_0x4b6e57);}catch{console['error'](a26_0x4d135b[_0x766005(0x1f9)]('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a26_0x3e1dba(0x197)](_0x5e93f6,_0x4e16df,_0x1836ec,_0x39b278){const _0x2d7588=a26_0x3e1dba,{options:_0x30b9ca,tdx:_0x4fd214}=_0x5e93f6,_0x4c2ea2=await withSpinner(_0x2d7588(0x192),()=>_0x4fd214['segment'][_0x2d7588(0x2d0)](_0x1836ec),{'verbose':_0x30b9ca['verbose']}),_0x575c83=await executeSchemaQuery(_0x4c2ea2[_0x2d7588(0x1ea)],_0x4fd214,_0x30b9ca),_0x263699=_0x575c83[_0x2d7588(0x1ea)][_0x2d7588(0x235)](_0x37028d=>({'name':_0x37028d[_0x2d7588(0x2d5)],'type':_0x37028d[_0x2d7588(0x226)]})),_0x2017b5=await withSpinner(_0x2d7588(0x295),()=>_0x4fd214[_0x2d7588(0x1eb)][_0x2d7588(0x24f)](_0x1836ec),{'verbose':_0x30b9ca['verbose']}),_0x13b72c=[];for(const _0x101773 of _0x2017b5[_0x2d7588(0x1ea)]){const _0x5a3ae9='behavior_'+_0x101773['toLowerCase']()['replace'](/\s+/g,'_'),_0x4a7edf=_0x2d7588(0x1dd)+_0x39b278+'.'+_0x5a3ae9;let _0x2a3ed9=[];try{const _0x3edd28=await executeSchemaQuery(_0x4a7edf,_0x4fd214,_0x30b9ca);_0x2a3ed9=_0x3edd28[_0x2d7588(0x1ea)][_0x2d7588(0x235)](_0xe3fbc6=>({'name':_0xe3fbc6[_0x2d7588(0x2d5)],'type':_0xe3fbc6[_0x2d7588(0x226)]}));}catch{}_0x13b72c[_0x2d7588(0x1b6)]({'table':_0x5a3ae9,'columns':_0x2a3ed9});}return{'database':_0x39b278,'parent_segment':_0x4e16df,'parent_id':_0x1836ec,'customers':{'table':_0x2d7588(0x242),'columns':_0x263699},'behaviors':_0x13b72c};}[a26_0x3e1dba(0x1da)](_0x480ca8){const _0x50fc64=a26_0x3e1dba,_0x3c8579=_0x1b2d9d=>{const _0x4bfd54=a26_0x241c;if(_0x1b2d9d[_0x4bfd54(0x1d7)]===0x0)return'[]';const _0x5d75d5=_0x1b2d9d[_0x4bfd54(0x235)](_0x3a518f=>_0x4bfd54(0x22a)+_0x3a518f[_0x4bfd54(0x1ae)]+_0x4bfd54(0x2f4)+_0x3a518f[_0x4bfd54(0x25e)]+_0x4bfd54(0x188));return'[\x0a'+_0x5d75d5[_0x4bfd54(0x189)](',\x0a')+_0x4bfd54(0x301);},_0x331f5e=_0x480ca8[_0x50fc64(0x1b4)][_0x50fc64(0x235)](_0x32fd6b=>{const _0x4c1619=_0x50fc64;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x32fd6b[_0x4c1619(0x2f1)]+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20'+_0x3c8579(_0x32fd6b['columns'])[_0x4c1619(0x27f)](/^/gm,'\x20\x20')[_0x4c1619(0x245)]()+'\x0a\x20\x20\x20\x20}';})[_0x50fc64(0x189)](',\x0a');return _0x50fc64(0x277)+_0x480ca8[_0x50fc64(0x1f2)]+_0x50fc64(0x206)+_0x480ca8[_0x50fc64(0x249)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x480ca8[_0x50fc64(0x296)]+_0x50fc64(0x1a3)+_0x480ca8[_0x50fc64(0x242)][_0x50fc64(0x2f1)]+_0x50fc64(0x208)+_0x3c8579(_0x480ca8[_0x50fc64(0x242)][_0x50fc64(0x201)])[_0x50fc64(0x27f)](/^/gm,'\x20\x20')[_0x50fc64(0x245)]()+_0x50fc64(0x27a)+_0x331f5e+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]='segment:parent:sql';['description']=a26_0x3e1dba(0x20b);async['execute'](_0x383e20){const _0x4e4c5f=a26_0x3e1dba,{options:_0xe75af6,args:_0x2c1dc1,tdx:_0x40d3c5}=_0x383e20,_0x7d799a=_0x2c1dc1[0x0]||_0xe75af6[_0x4e4c5f(0x268)];if(!_0x7d799a)return showParentSegmentNotSetError(_0x4e4c5f(0x2bd)+_0x4e4c5f(0x253)),0x1;_0xe75af6[_0x4e4c5f(0x173)]&&(console[_0x4e4c5f(0x269)](_0x4e4c5f(0x26a)+_0xe75af6[_0x4e4c5f(0x1c2)]),console[_0x4e4c5f(0x269)]('Parent\x20segment:\x20'+_0x7d799a));const _0x539a30=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x7d799a+_0x4e4c5f(0x1e0),()=>_0x40d3c5['segment']['resolveParentId'](_0x7d799a),{'verbose':_0xe75af6[_0x4e4c5f(0x173)]}),_0x12a1e1=_0x539a30['data'],_0x3184a2=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x7d799a+_0x4e4c5f(0x1e0),()=>_0x40d3c5[_0x4e4c5f(0x1eb)]['getParentSQL'](_0x12a1e1),{'verbose':_0xe75af6[_0x4e4c5f(0x173)]}),_0x3fbbc1=_0x3184a2[_0x4e4c5f(0x1ea)];return _0xe75af6['format']===_0x4e4c5f(0x2b5)||_0xe75af6[_0x4e4c5f(0x1d3)]===_0x4e4c5f(0x2aa)?await handleSDKOutput([{'sql':_0x3fbbc1}],_0xe75af6):console['log'](_0x3fbbc1),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]=a26_0x3e1dba(0x1f7);['description']=a26_0x3e1dba(0x2d3);async[a26_0x3e1dba(0x280)](_0x3947bd){const _0x3ee091=a26_0x3e1dba,{options:_0x3f71c5,args:_0x3756f5,tdx:_0x5cc711}=_0x3947bd,_0x249f34=_0x3756f5[0x0]||_0x3f71c5[_0x3ee091(0x268)];if(!_0x249f34)return showParentSegmentNotSetError(_0x3ee091(0x19a)+'\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;_0x3f71c5[_0x3ee091(0x173)]&&(console['error'](_0x3ee091(0x26a)+_0x3f71c5[_0x3ee091(0x1c2)]),console[_0x3ee091(0x269)]('Parent\x20segment:\x20'+_0x249f34));const _0x5a2d85=await withSpinner(_0x3ee091(0x1df)+_0x249f34+_0x3ee091(0x1e0),()=>_0x5cc711[_0x3ee091(0x1eb)][_0x3ee091(0x276)](_0x249f34),{'verbose':_0x3f71c5[_0x3ee091(0x173)]}),_0x96c2fb=_0x5a2d85[_0x3ee091(0x1ea)],_0x1432a1=await withSpinner(_0x3ee091(0x1f1)+_0x249f34+_0x3ee091(0x1e0),()=>_0x5cc711[_0x3ee091(0x1eb)]['getParentSQL'](_0x96c2fb),{'verbose':_0x3f71c5[_0x3ee091(0x173)]});let _0x84cbfe=_0x1432a1[_0x3ee091(0x1ea)];const _0x1d98a4=resolveLimit(_0x3f71c5[_0x3ee091(0x27b)],DEFAULT_DISPLAY_LIMIT),_0x2becde=/\bLIMIT\s+\d+/i[_0x3ee091(0x257)](_0x84cbfe);!_0x2becde&&(_0x84cbfe=_0x84cbfe['trim']()['replace'](/;+$/,''),_0x84cbfe=_0x3ee091(0x272)+_0x84cbfe+_0x3ee091(0x29a)+_0x1d98a4);_0x3f71c5[_0x3ee091(0x173)]&&console[_0x3ee091(0x269)](_0x3ee091(0x216)+_0x84cbfe);const _0x59a3a4=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x3e6ab7=>{const _0x122457=_0x3ee091,_0x459a29=await _0x5cc711['query'][_0x122457(0x280)](_0x84cbfe,{'catalog':'td','schema':'information_schema','onJobId':_0x161032=>{const _0x3a49a9=_0x122457;_0x3e6ab7[_0x3a49a9(0x2c1)](_0x161032);}});return _0x459a29;},{'verbose':_0x3f71c5['verbose']}),_0x57ce4f=_0x59a3a4['data'],_0x1bc3a0=_0x57ce4f['jobId']?_0x3ee091(0x181)+_0x57ce4f[_0x3ee091(0x21a)]+']':'';return console[_0x3ee091(0x269)](_0x3ee091(0x17b)+_0x57ce4f[_0x3ee091(0x171)]['processedRows'][_0x3ee091(0x233)]()+_0x3ee091(0x305)+(_0x3ee091(0x212)+formatElapsed(_0x57ce4f[_0x3ee091(0x171)]['elapsedTimeMillis'])+_0x1bc3a0)),await handleQueryOutput(_0x57ce4f,_0x3f71c5),0x0;}}export class PSRtListCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]='ps:rt:list';[a26_0x3e1dba(0x2e2)]='List\x20parent\x20segments\x20with\x20RT\x202.0\x20status';async[a26_0x3e1dba(0x280)](_0x472114){const _0x14eb78=a26_0x3e1dba,{options:_0x476f44,args:_0x4d9b30,tdx:_0x36d195}=_0x472114,_0xce9c84=_0x4d9b30[0x0],_0x4bd92c=await withSpinner(_0xce9c84?_0x14eb78(0x239)+_0xce9c84+_0x14eb78(0x1e0):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x36d195['realtime'][_0x14eb78(0x1fd)](),{'verbose':_0x476f44[_0x14eb78(0x173)]});let _0x5a81dd=_0x4bd92c[_0x14eb78(0x1ea)]['filter'](_0x39325c=>_0x39325c[_0x14eb78(0x243)]);if(_0xce9c84){const _0x3abe22=_0xce9c84[_0x14eb78(0x27f)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x14eb78(0x27f)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1888a6=new RegExp('^'+_0x3abe22+'$','i');_0x5a81dd=_0x5a81dd[_0x14eb78(0x292)](_0x23d4f0=>_0x1888a6[_0x14eb78(0x257)](_0x23d4f0[_0x14eb78(0x1ae)]));}_0x5a81dd['sort']((_0x4cdd13,_0x220be9)=>_0x4cdd13['name']['localeCompare'](_0x220be9['name'])),console[_0x14eb78(0x269)](_0x14eb78(0x2b9)+_0x5a81dd[_0x14eb78(0x1d7)]+_0x14eb78(0x199)+(_0x5a81dd[_0x14eb78(0x1d7)]!==0x1?'s':''));const _0x2a5b8d=_0x52e448=>{const _0x54c1f1=_0x14eb78;return getConsoleNextUrl(_0x476f44['site'],_0x54c1f1(0x2ed)+_0x52e448);};if(_0x476f44[_0x14eb78(0x1d3)]==='json'||_0x476f44['format']===_0x14eb78(0x2aa)){const _0x18daa1=_0x5a81dd[_0x14eb78(0x235)](_0x2a159d=>({..._0x2a159d,'url':_0x2a5b8d(_0x2a159d['id'])}));await handleSDKOutput(_0x18daa1,_0x476f44);}else{if(_0x5a81dd[_0x14eb78(0x1d7)]===0x0)console[_0x14eb78(0x26e)](_0x14eb78(0x2eb));else for(const _0x6fc1d of _0x5a81dd){const _0x49218d=_0x6fc1d['population']?a26_0x4d135b[_0x14eb78(0x1bd)]('\x20('+formatRows(_0x6fc1d['population'])+')'):'',_0x161677=hyperlink(_0x6fc1d['name'],_0x2a5b8d(_0x6fc1d['id']));console[_0x14eb78(0x26e)]('⚡\x20'+_0x161677+_0x49218d);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a26_0x3e1dba(0x1ae)]='ps:rt:validate';[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x217);async[a26_0x3e1dba(0x280)](_0x24057f){const _0x1fb417=a26_0x3e1dba,{options:_0x533781,args:_0x2c5f8c,tdx:_0x4a02bb}=_0x24057f,_0x146fca=_0x2c5f8c[0x0]||_0x533781[_0x1fb417(0x268)];if(!_0x146fca)return showParentSegmentNotSetError(_0x1fb417(0x1a0)+_0x1fb417(0x288)),0x1;const _0x33a409=resolveYamlFile(_0x146fca);if(!existsSync(_0x33a409))return showFileNotFoundError(_0x33a409,_0x146fca),0x1;let _0x8bc976;try{_0x8bc976=readFileSync(_0x33a409,_0x1fb417(0x2ec));}catch(_0x3e6d5f){const _0x23f288=_0x3e6d5f instanceof Error?_0x3e6d5f[_0x1fb417(0x1c9)]:String(_0x3e6d5f);return console[_0x1fb417(0x269)]('Error\x20reading\x20file:\x20'+_0x23f288),0x1;}const _0x5a2e19=createCommandSpinner(a26_0x4d135b[_0x1fb417(0x1bd)]('Validating\x20RT\x20configuration...'),{'verbose':_0x533781['verbose']});_0x5a2e19[_0x1fb417(0x1e7)]();const _0x48ef13={'realtime':!![],'onProgress':_0x5eee3e=>{_0x5a2e19['text']=formatProgressMessage(_0x5eee3e);}};let _0x230ca7;try{_0x230ca7=await _0x4a02bb[_0x1fb417(0x1eb)][_0x1fb417(0x1cb)](_0x8bc976,_0x48ef13),_0x5a2e19[_0x1fb417(0x225)]();}catch(_0x17700f){_0x5a2e19[_0x1fb417(0x225)]();throw _0x17700f;}console[_0x1fb417(0x269)]('\x0a'+a26_0x4d135b[_0x1fb417(0x270)](_0x1fb417(0x207))+'\x20'+_0x230ca7[_0x1fb417(0x1ae)]),console[_0x1fb417(0x269)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x230ca7),console[_0x1fb417(0x269)]('─'['repeat'](0x3c));if(_0x230ca7[_0x1fb417(0x1cc)][_0x1fb417(0x1d7)]>0x0){console[_0x1fb417(0x269)]('\x0a'+a26_0x4d135b[_0x1fb417(0x237)](_0x1fb417(0x275)));for(const _0x4f5874 of _0x230ca7[_0x1fb417(0x1cc)]){console[_0x1fb417(0x269)]('\x20\x20'+a26_0x4d135b[_0x1fb417(0x237)]('•')+'\x20'+_0x4f5874);}}return _0x230ca7[_0x1fb417(0x2e9)]&&console[_0x1fb417(0x269)]('\x0a'+a26_0x4d135b['green']('✔')+_0x1fb417(0x209)),_0x230ca7[_0x1fb417(0x2e9)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a26_0x3e1dba(0x1ae)]='ps:pz:list';[a26_0x3e1dba(0x2e2)]=a26_0x3e1dba(0x26c);async[a26_0x3e1dba(0x280)](_0x470425){const _0x21ca28=a26_0x3e1dba,{options:_0xc0350c,args:_0x48b6d0,tdx:_0x585f67}=_0x470425,_0x24fa10=_0x48b6d0[0x0]||_0xc0350c[_0x21ca28(0x268)];if(!_0x24fa10)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment'),0x1;const _0x280ead=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x24fa10+_0x21ca28(0x1e0),()=>_0x585f67[_0x21ca28(0x1eb)]['resolveParentId'](_0x24fa10),{'verbose':_0xc0350c[_0x21ca28(0x173)]}),_0x4049ef=_0x280ead['data'],_0x358bf5=await withSpinner(_0x21ca28(0x204)+_0x24fa10+_0x21ca28(0x1e0),()=>_0x585f67[_0x21ca28(0x273)][_0x21ca28(0x1fd)](_0x4049ef),{'verbose':_0xc0350c[_0x21ca28(0x173)]}),_0x8ab2e7=_0x358bf5[_0x21ca28(0x1ea)];console['error']('✔\x20Found\x20'+_0x8ab2e7[_0x21ca28(0x1d7)]+_0x21ca28(0x291)+(_0x8ab2e7[_0x21ca28(0x1d7)]!==0x1?'s':''));if(_0xc0350c['format']===_0x21ca28(0x2b5)||_0xc0350c[_0x21ca28(0x1d3)]===_0x21ca28(0x2aa))await handleSDKOutput(_0x8ab2e7,_0xc0350c);else{if(_0x8ab2e7['length']===0x0)console[_0x21ca28(0x26e)]('No\x20personalization\x20services\x20configured'),console[_0x21ca28(0x269)](a26_0x4d135b['cyan'](_0x21ca28(0x29f)));else for(const _0x13e45b of _0x8ab2e7){const _0x400b5a=_0x13e45b[_0x21ca28(0x25b)]?.['length']||0x0,_0xda8591=_0x13e45b['trigger_event']?a26_0x4d135b[_0x21ca28(0x1bd)]('\x20trigger='+_0x13e45b['trigger_event']):'',_0x13f7a7=a26_0x4d135b['dim']('\x20('+_0x400b5a+_0x21ca28(0x2a9)+(_0x400b5a!==0x1?'s':'')+')');console[_0x21ca28(0x26e)]('\x20\x20'+_0x13e45b[_0x21ca28(0x1ae)]+_0xda8591+_0x13f7a7),_0x13e45b[_0x21ca28(0x2e2)]&&console['log'](_0x21ca28(0x223)+a26_0x4d135b[_0x21ca28(0x1bd)](_0x13e45b[_0x21ca28(0x2e2)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a26_0x3e1dba(0x1ae)]='ps:pz:init';['description']=a26_0x3e1dba(0x21c);async[a26_0x3e1dba(0x280)](_0x149ba5){const _0x23a2fd=a26_0x3e1dba,{options:_0xcc69d6,args:_0x3b003a}=_0x149ba5,_0x32a75e=_0x3b003a[0x0]||_0xcc69d6['parentSegment'];if(!_0x32a75e)return showParentSegmentNotSetError(_0x23a2fd(0x1c8)+_0x23a2fd(0x185)),0x1;const _0x2294d9=resolveYamlFile(_0x32a75e);if(!existsSync(_0x2294d9))return showFileNotFoundError(_0x2294d9,_0x32a75e),0x1;let _0x5e2e87;try{_0x5e2e87=readFileSync(_0x2294d9,'utf-8');}catch(_0x1060ef){const _0x2bac6d=_0x1060ef instanceof Error?_0x1060ef[_0x23a2fd(0x1c9)]:String(_0x1060ef);return console[_0x23a2fd(0x269)]('Error\x20reading\x20file:\x20'+_0x2bac6d),0x1;}let _0x4dbe97;try{_0x4dbe97=parseDef(_0x5e2e87);}catch(_0x172d1a){const _0x268309=_0x172d1a instanceof Error?_0x172d1a[_0x23a2fd(0x1c9)]:String(_0x172d1a);return console[_0x23a2fd(0x269)](a26_0x4d135b[_0x23a2fd(0x237)](_0x23a2fd(0x2d9)+_0x268309)),0x1;}if(_0x4dbe97[_0x23a2fd(0x172)]&&_0x4dbe97['personalization_services'][_0x23a2fd(0x1d7)]>0x0)return console[_0x23a2fd(0x269)](a26_0x4d135b['yellow'](_0x23a2fd(0x2ea)+_0x2294d9)),console[_0x23a2fd(0x269)](a26_0x4d135b[_0x23a2fd(0x1bd)](_0x23a2fd(0x2ac)+_0x4dbe97[_0x23a2fd(0x172)][_0x23a2fd(0x1d7)]+_0x23a2fd(0x1d1))),0x1;!_0x4dbe97[_0x23a2fd(0x18a)]&&(_0x4dbe97['realtime']={'events':[{'name':'page_view','source_table':_0x23a2fd(0x283)}],'attributes':[{'name':'last_page_viewed','type':_0x23a2fd(0x2f5)}],'id_stitching':{'primary_key':_0x4dbe97[_0x23a2fd(0x1ad)][_0x23a2fd(0x2f1)]===_0x23a2fd(0x242)?'td_client_id':_0x23a2fd(0x21f)}});_0x4dbe97['personalization_services']=[{'name':_0x23a2fd(0x1ff),'description':_0x23a2fd(0x2c4),'trigger_event':'page_view','sections':[{'name':_0x23a2fd(0x2a3),'criteria':_0x23a2fd(0x2da),'attributes':[_0x23a2fd(0x1c0)]}]}];const _0x375e9b=serializeDef(_0x4dbe97);return writeFileSync(_0x2294d9,_0x375e9b,_0x23a2fd(0x2ec)),console[_0x23a2fd(0x269)](a26_0x4d135b['green']('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a26_0x4d135b['cyan'](_0x2294d9)),(!_0x4dbe97[_0x23a2fd(0x18a)]||_0x5e2e87['indexOf'](_0x23a2fd(0x191))===-0x1)&&console[_0x23a2fd(0x269)](a26_0x4d135b['green']('✔')+_0x23a2fd(0x1a5)),console[_0x23a2fd(0x269)]('\x0a'+a26_0x4d135b[_0x23a2fd(0x1bd)](_0x23a2fd(0x1ed))),console[_0x23a2fd(0x269)](_0x23a2fd(0x1af)+_0x2294d9+'\x20to\x20configure\x20your\x20personalization\x20service'),console[_0x23a2fd(0x269)](_0x23a2fd(0x262)+a26_0x4d135b[_0x23a2fd(0x1bd)](_0x23a2fd(0x1fe)+_0x32a75e)+_0x23a2fd(0x17e)),0x0;}}
|
|
1
|
+
const a26_0x4cc703=a26_0x428a;(function(_0xf76de6,_0x28d9e9){const _0x181bf5=a26_0x428a,_0x1628f7=_0xf76de6();while(!![]){try{const _0x1bfdcf=-parseInt(_0x181bf5(0x1ae))/0x1*(parseInt(_0x181bf5(0xbf))/0x2)+parseInt(_0x181bf5(0xf7))/0x3*(-parseInt(_0x181bf5(0x15d))/0x4)+-parseInt(_0x181bf5(0x10b))/0x5+parseInt(_0x181bf5(0x19c))/0x6+-parseInt(_0x181bf5(0x20c))/0x7*(-parseInt(_0x181bf5(0x242))/0x8)+-parseInt(_0x181bf5(0x1c8))/0x9*(-parseInt(_0x181bf5(0x15c))/0xa)+parseInt(_0x181bf5(0xe4))/0xb*(parseInt(_0x181bf5(0x234))/0xc);if(_0x1bfdcf===_0x28d9e9)break;else _0x1628f7['push'](_0x1628f7['shift']());}catch(_0x547e29){_0x1628f7['push'](_0x1628f7['shift']());}}}(a26_0x7bf1,0xd3f98));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a26_0x40ee15 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}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 a26_0xc5b354 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=a26_0x4cc703(0x108),LEGACY_PARENT_SEGMENT_DIR=a26_0x4cc703(0xfa);function openBrowser(_0x11af2a){const _0x5383b7=a26_0x4cc703,_0xf57189=process['platform'],_0x308e41=_0xf57189===_0x5383b7(0x241)?'open':_0xf57189===_0x5383b7(0x12c)?_0x5383b7(0x128):_0x5383b7(0x1c2);spawn(_0x308e41,[_0x11af2a],{'detached':!![],'stdio':_0x5383b7(0x12b)})['unref']();}function migrateLegacyDirectory(){const _0x104742=a26_0x4cc703;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2415ce=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2415ce[_0x104742(0x21c)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x104742(0xd5)](a26_0xc5b354[_0x104742(0xc9)](_0x104742(0xce)+LEGACY_PARENT_SEGMENT_DIR+_0x104742(0x178)+PARENT_SEGMENT_DIR+_0x104742(0x177))),console[_0x104742(0xd5)](a26_0xc5b354['dim'](_0x104742(0x1f3)+LEGACY_PARENT_SEGMENT_DIR+_0x104742(0x23e))),![];console[_0x104742(0xd5)](a26_0xc5b354['yellow'](_0x104742(0x1ca)+LEGACY_PARENT_SEGMENT_DIR+_0x104742(0x134)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x104742(0xd5)](a26_0xc5b354[_0x104742(0x127)](_0x104742(0xc2)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x33d1db){const _0x529dc0=_0x33d1db instanceof Error?_0x33d1db['message']:String(_0x33d1db);return console[_0x104742(0xd5)](a26_0xc5b354['red'](_0x104742(0x110)+_0x529dc0+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x48dd48){return migrateLegacyDirectory(),super['run'](_0x48dd48);}}function resolveYamlFile(_0x5c0e7d){const _0x280efe=a26_0x4cc703;if(_0x5c0e7d[_0x280efe(0x117)]('.yml')||_0x5c0e7d[_0x280efe(0x117)]('.yaml'))return _0x5c0e7d;return a26_0x40ee15['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5c0e7d)+_0x280efe(0x118));}function a26_0x428a(_0x54c95f,_0xa70576){_0x54c95f=_0x54c95f-0xbf;const _0x7bf14a=a26_0x7bf1();let _0x428aa6=_0x7bf14a[_0x54c95f];return _0x428aa6;}function formatProgressMessage(_0x465d70){const _0x18eb64=a26_0x4cc703,_0x496c49=_0x465d70[_0x18eb64(0x1fd)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x496c49){const [,_0x49d811,_0x5280e1,_0x36b375='']=_0x496c49;return a26_0xc5b354[_0x18eb64(0x122)](_0x49d811+':')+'\x20'+_0x5280e1+a26_0xc5b354['dim'](_0x36b375);}return a26_0xc5b354[_0x18eb64(0x122)](_0x465d70);}function showFileNotFoundError(_0x30a7d5,_0x4312d7){const _0x19ff35=a26_0x4cc703;console[_0x19ff35(0xd5)](a26_0xc5b354[_0x19ff35(0x1b6)](_0x19ff35(0x1a1)+_0x30a7d5+'\x0a')),console[_0x19ff35(0xd5)](a26_0xc5b354[_0x19ff35(0x140)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x4312d7+_0x19ff35(0xc0)));}function displayRealtimeValidation(_0x13875d){const _0x474da6=a26_0x4cc703;if(!_0x13875d[_0x474da6(0x1e1)])return;const _0x1f607c=_0x13875d[_0x474da6(0x1e1)],_0x496776=_0x1f607c[_0x474da6(0x225)]?a26_0xc5b354[_0x474da6(0x127)]('⚡\x20Enabled'):a26_0xc5b354[_0x474da6(0xc9)]('⚡\x20Not\x20enabled');console['error']('\x0a'+a26_0xc5b354[_0x474da6(0x122)](_0x474da6(0x1d9))+'\x20'+_0x496776);if(_0x1f607c[_0x474da6(0x1de)]&&_0x1f607c[_0x474da6(0x1de)][_0x474da6(0x231)]>0x0){console[_0x474da6(0xd5)]('\x20\x20'+a26_0xc5b354[_0x474da6(0x122)](_0x474da6(0x1fb))+'\x20'+_0x1f607c[_0x474da6(0x1de)][_0x474da6(0x231)]+'\x20configured');for(const _0x17536a of _0x1f607c[_0x474da6(0x1de)]){const _0x266a4b=_0x17536a['sourceTableValid']===![]?a26_0xc5b354[_0x474da6(0x1b6)]('✘'):a26_0xc5b354['green']('✔');console[_0x474da6(0xd5)](_0x474da6(0xd0)+_0x266a4b+'\x20'+_0x17536a['name']),_0x17536a['sourceTableError']&&console['error'](_0x474da6(0x1c9)+a26_0xc5b354['red'](_0x17536a['sourceTableError']));}}if(_0x1f607c[_0x474da6(0x158)]&&_0x1f607c[_0x474da6(0x158)][_0x474da6(0x231)]>0x0){console[_0x474da6(0xd5)]('\x20\x20'+a26_0xc5b354[_0x474da6(0x122)](_0x474da6(0x1e7))+'\x20'+_0x1f607c['attributes'][_0x474da6(0x231)]+_0x474da6(0x20a));for(const _0x1d4181 of _0x1f607c[_0x474da6(0x158)]){const _0x1cf4e4=_0x1d4181[_0x474da6(0xf4)]?a26_0xc5b354[_0x474da6(0x127)]('✔'):a26_0xc5b354['red']('✘');console[_0x474da6(0xd5)](_0x474da6(0xd0)+_0x1cf4e4+'\x20'+_0x1d4181[_0x474da6(0x201)]+'\x20'+a26_0xc5b354['dim']('('+_0x1d4181['type']+')'));}}if(_0x1f607c[_0x474da6(0x135)]){const _0x266c99=_0x1f607c[_0x474da6(0x135)][_0x474da6(0x152)]?.[_0x474da6(0x231)]?_0x474da6(0xf5)+_0x1f607c['idStitching'][_0x474da6(0x152)][_0x474da6(0x185)](',\x20')+']':'';console['error']('\x20\x20'+a26_0xc5b354[_0x474da6(0x122)](_0x474da6(0x228))+'\x20'+_0x1f607c['idStitching'][_0x474da6(0x101)]+_0x266c99);}if(_0x1f607c['personalizationServices']&&_0x1f607c[_0x474da6(0x124)]['length']>0x0){console['error']('\x20\x20'+a26_0xc5b354['dim']('Personalization:')+'\x20'+_0x1f607c['personalizationServices'][_0x474da6(0x231)]+'\x20service'+(_0x1f607c['personalizationServices'][_0x474da6(0x231)]!==0x1?'s':''));for(const _0x365185 of _0x1f607c[_0x474da6(0x124)]){console[_0x474da6(0xd5)]('\x20\x20\x20\x20-\x20'+_0x365185[_0x474da6(0x201)]);}}}function showParentSegmentNotSetError(_0x25c42a){const _0x3a0668=a26_0x4cc703;console['error'](a26_0xc5b354['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x3a0668(0xd5)](_0x25c42a);}export class ParentSegmentListCommand extends BaseCommand{['name']=a26_0x4cc703(0x14b);[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x1b9);async[a26_0x4cc703(0x207)](_0x507f4b){const _0x1f80fc=a26_0x4cc703,{options:_0x419654,args:_0x940f95,tdx:_0x109ba4}=_0x507f4b,_0xa274ca=_0x940f95[0x0];_0x419654[_0x1f80fc(0x168)]&&(console[_0x1f80fc(0xd5)](_0x1f80fc(0x1f8)+_0x419654['site']),_0xa274ca&&console[_0x1f80fc(0xd5)](_0x1f80fc(0x1b1)+_0xa274ca));const _0x8c0cf9=await withSpinner(_0xa274ca?_0x1f80fc(0x22d)+_0xa274ca+_0x1f80fc(0x213):_0x1f80fc(0x189),()=>_0x109ba4[_0x1f80fc(0x1c6)]['listParents'](),{'verbose':_0x419654[_0x1f80fc(0x168)]});let _0x425dbe=_0x8c0cf9['data'];if(_0xa274ca){const _0x4ded0d=_0xa274ca[_0x1f80fc(0x219)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1f80fc(0x219)](/\*/g,'.*')[_0x1f80fc(0x219)](/\?/g,'.'),_0x4eda85=new RegExp('^'+_0x4ded0d+'$','i');_0x425dbe=_0x425dbe[_0x1f80fc(0x107)](_0xdeef1a=>_0x4eda85['test'](_0xdeef1a[_0x1f80fc(0x158)][_0x1f80fc(0x201)]));}_0x425dbe['sort']((_0x1ccd19,_0x52a080)=>_0x1ccd19['attributes'][_0x1f80fc(0x201)][_0x1f80fc(0x216)](_0x52a080[_0x1f80fc(0x158)]['name'])),console[_0x1f80fc(0xd5)](_0x1f80fc(0x233)+_0x425dbe[_0x1f80fc(0x231)]+_0x1f80fc(0x143)+(_0x425dbe[_0x1f80fc(0x231)]!==0x1?'s':''));const _0xd84909=_0x4813ec=>{return getConsoleNextUrl(_0x419654['site'],'/app/dw/parentSegments/'+_0x4813ec);};if(_0x419654[_0x1f80fc(0x224)]===_0x1f80fc(0x155)||_0x419654[_0x1f80fc(0x224)]==='jsonl'){const _0x4cee42=_0x425dbe[_0x1f80fc(0x13b)](_0x10ee0f=>({..._0x10ee0f,'url':_0xd84909(_0x10ee0f['id'])}));await handleSDKOutput(_0x4cee42,_0x419654);}else{if(_0x425dbe[_0x1f80fc(0x231)]===0x0)_0xa274ca?console[_0x1f80fc(0x160)](_0x1f80fc(0x1b7)+_0xa274ca):console['log'](_0x1f80fc(0xd2));else for(const _0x1989ba of _0x425dbe){const _0x324c0d=_0x1989ba[_0x1f80fc(0x158)][_0x1f80fc(0x229)]?a26_0xc5b354[_0x1f80fc(0x122)]('\x20('+formatRows(_0x1989ba['attributes'][_0x1f80fc(0x229)])+')'):'',_0x362ccd=hyperlink(_0x1989ba[_0x1f80fc(0x158)][_0x1f80fc(0x201)],_0xd84909(_0x1989ba['id']));console[_0x1f80fc(0x160)](_0x1f80fc(0x13e)+_0x362ccd+_0x324c0d);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x240);[a26_0x4cc703(0x23b)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async['execute'](_0x282633){const _0x409638=a26_0x4cc703,{options:_0x672db8,args:_0x53a254,tdx:_0x4130f5}=_0x282633;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x409638(0xc5)+'\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a');const _0x415d15=_0x672db8;if(_0x53a254[_0x409638(0x231)]===0x0)return console['error'](a26_0xc5b354['red'](_0x409638(0xf6))),console[_0x409638(0xd5)](_0x409638(0x1ce)),0x1;const _0xeed01f=_0x53a254[0x0];if(!_0x415d15['database']||!_0x415d15[_0x409638(0x113)])return console[_0x409638(0xd5)](_0x409638(0x1b3)),console[_0x409638(0xd5)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;_0x415d15[_0x409638(0x168)]&&(console['error'](_0x409638(0x1f8)+_0x415d15[_0x409638(0x161)]),console[_0x409638(0xd5)](_0x409638(0x245)+_0xeed01f),console[_0x409638(0xd5)]('Database:\x20'+_0x415d15['database']),console[_0x409638(0xd5)]('Table:\x20'+_0x415d15[_0x409638(0x113)]));const _0x2212a1=await loadJSONFromOptions(_0x415d15[_0x409638(0x158)],_0x415d15[_0x409638(0x1b8)]),_0x4656a7=await loadJSONFromOptions(_0x415d15['behaviors'],_0x415d15['behaviorsFile']),_0x4d96de=await loadJSONFromOptions(_0x415d15[_0x409638(0xda)],_0x415d15['customerGroupFile']),_0x2acfd3={'name':_0xeed01f,'description':_0x415d15[_0x409638(0x23b)],'scheduleType':_0x415d15[_0x409638(0x1fc)],'scheduleOption':_0x415d15[_0x409638(0xd3)],'timezone':_0x415d15[_0x409638(0x1fa)],'master':{'parentDatabaseName':_0x415d15[_0x409638(0xd4)],'parentTableName':_0x415d15[_0x409638(0x113)]},'attributes':_0x2212a1,'behaviors':_0x4656a7,'customerGroup':_0x4d96de},_0xff809e=await withSpinner(_0x409638(0x1d1)+_0xeed01f+_0x409638(0x213),()=>_0x4130f5[_0x409638(0x1c6)][_0x409638(0x18e)](_0x2acfd3),{'verbose':_0x672db8['verbose']}),_0x1abc49=_0xff809e[_0x409638(0x209)];return console['error']('✔\x20Created\x20parent\x20segment\x20\x27'+_0x1abc49[_0x409638(0x201)]+_0x409638(0x1c3)+_0x1abc49['id']),await handleSDKOutput([_0x1abc49],_0x672db8),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x145);['description']=a26_0x4cc703(0x193);async[a26_0x4cc703(0x207)](_0xf20781){const _0x1e4100=a26_0x4cc703,{options:_0x45c74e,args:_0x239302,tdx:_0x129803}=_0xf20781;console['error'](_0x1e4100(0x1f7)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x1e4100(0x1c0));const _0x15c474=_0x45c74e;if(_0x239302['length']===0x0)return console[_0x1e4100(0xd5)](a26_0xc5b354['red'](_0x1e4100(0xf6))),console['error'](_0x1e4100(0x146)),0x1;const _0x154b8c=_0x239302[0x0];_0x15c474[_0x1e4100(0x168)]&&(console[_0x1e4100(0xd5)](_0x1e4100(0x1f8)+_0x15c474[_0x1e4100(0x161)]),console[_0x1e4100(0xd5)](_0x1e4100(0xea)+_0x154b8c));const _0x371cb6=await withSpinner(_0x1e4100(0x12f)+_0x154b8c+_0x1e4100(0x213),()=>_0x129803['segment'][_0x1e4100(0x21f)](_0x154b8c),{'verbose':_0x15c474[_0x1e4100(0x168)]}),_0x9503f1=_0x371cb6[_0x1e4100(0x209)],_0x5a817a=await loadJSONFromOptions(_0x15c474[_0x1e4100(0xdc)],_0x15c474[_0x1e4100(0xcb)]),_0x50443e=await loadJSONFromOptions(_0x15c474[_0x1e4100(0x1b2)],_0x15c474['addBehaviorsFile']),_0x23e57b={'name':_0x9503f1[_0x1e4100(0x201)],'description':_0x15c474[_0x1e4100(0x23b)]!==undefined?_0x15c474[_0x1e4100(0x23b)]:_0x9503f1['description'],'scheduleType':_0x15c474[_0x1e4100(0x1fc)]!==undefined?_0x15c474['scheduleType']:_0x9503f1['scheduleType'],'scheduleOption':_0x15c474['scheduleOption']!==undefined?_0x15c474[_0x1e4100(0xd3)]:_0x9503f1[_0x1e4100(0xd3)],'timezone':_0x15c474[_0x1e4100(0x1fa)]!==undefined?_0x15c474['timezone']:_0x9503f1['timezone'],'master':_0x9503f1[_0x1e4100(0x1cf)],'attributes':_0x5a817a?[..._0x9503f1[_0x1e4100(0x158)]||[],..._0x5a817a]:_0x9503f1['attributes'],'behaviors':_0x50443e?[..._0x9503f1[_0x1e4100(0x16f)]||[],..._0x50443e]:_0x9503f1[_0x1e4100(0x16f)],'customerGroup':_0x9503f1['customerGroup']},_0x51d74b=await withSpinner(_0x1e4100(0x1a2)+_0x154b8c+_0x1e4100(0x213),()=>_0x129803[_0x1e4100(0x1c6)][_0x1e4100(0x1d0)](_0x154b8c,_0x23e57b),{'verbose':_0x15c474[_0x1e4100(0x168)]}),_0x46d5c2=_0x51d74b[_0x1e4100(0x209)];return console[_0x1e4100(0xd5)](_0x1e4100(0x114)+_0x46d5c2['name']+'\x27'),await handleSDKOutput([_0x46d5c2],_0x15c474),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a26_0x4cc703(0x201)]='segment:parent:pull';[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x23c);async['execute'](_0xb8a7b8){const _0x1d4c18=a26_0x4cc703,{options:_0x1142ed,args:_0x3e7753,tdx:_0x42a883}=_0xb8a7b8,_0x2f87f0=_0x1142ed,_0x882e07=_0x3e7753[0x0]||_0x1142ed[_0x1d4c18(0x1e6)];if(!_0x882e07)return showParentSegmentNotSetError(_0x1d4c18(0x121)+_0x1d4c18(0xc4)),0x1;if(_0x2f87f0['use']&&_0x2f87f0['output'])return console[_0x1d4c18(0xd5)](a26_0xc5b354[_0x1d4c18(0x1b6)](_0x1d4c18(0x112))),console[_0x1d4c18(0xd5)](a26_0xc5b354['dim'](_0x1d4c18(0x12e))),console[_0x1d4c18(0xd5)](a26_0xc5b354[_0x1d4c18(0x122)](_0x1d4c18(0x130)+PARENT_SEGMENT_DIR+_0x1d4c18(0x162))),console[_0x1d4c18(0xd5)](a26_0xc5b354[_0x1d4c18(0x140)](_0x1d4c18(0x1c5))),0x1;const _0x40de7f=_0x2f87f0['output']||a26_0x40ee15['join'](PARENT_SEGMENT_DIR,sanitizeFileName(_0x882e07)+_0x1d4c18(0x118));_0x2f87f0[_0x1d4c18(0x168)]&&(console[_0x1d4c18(0xd5)](_0x1d4c18(0x1f8)+_0x2f87f0[_0x1d4c18(0x161)]),console[_0x1d4c18(0xd5)](_0x1d4c18(0xea)+_0x882e07),console[_0x1d4c18(0xd5)](_0x1d4c18(0x21e)+_0x40de7f));const _0x552106=await withSpinner(_0x1d4c18(0x19b)+_0x882e07+'\x27...',()=>_0x42a883[_0x1d4c18(0x1c6)][_0x1d4c18(0x119)](_0x882e07),{'verbose':_0x2f87f0['verbose']}),_0x94f75e=_0x552106[_0x1d4c18(0x209)];if(existsSync(_0x40de7f)){const _0x332c23=readFileSync(_0x40de7f,_0x1d4c18(0x14a)),_0x24ac47=generateDiff(_0x332c23,_0x94f75e);if(!hasChanges(_0x24ac47))console[_0x1d4c18(0xd5)](a26_0xc5b354['green']('✔')+_0x1d4c18(0x10f)+a26_0xc5b354[_0x1d4c18(0x140)](_0x40de7f)+'\x20is\x20already\x20up\x20to\x20date');else{console['error'](_0x1d4c18(0x243)+_0x40de7f+'\x27:'),console[_0x1d4c18(0xd5)]('─'[_0x1d4c18(0x212)](0x3c)),console[_0x1d4c18(0xd5)](formatDiffWithColors(_0x24ac47)),console['error']('─'['repeat'](0x3c));if(!_0x2f87f0['yes']){if(!isInteractive())return console[_0x1d4c18(0xd5)](a26_0xc5b354[_0x1d4c18(0x1b6)](_0x1d4c18(0x200)),_0x1d4c18(0x1d7)),console[_0x1d4c18(0xd5)](a26_0xc5b354[_0x1d4c18(0x122)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4aafe2=await confirmKey(_0x1d4c18(0xd6)+_0x40de7f+'\x27?');if(!_0x4aafe2)return console[_0x1d4c18(0xd5)](a26_0xc5b354[_0x1d4c18(0xc9)](_0x1d4c18(0x123))),0x1;}writeFileSync(_0x40de7f,_0x94f75e,_0x1d4c18(0x14a)),console[_0x1d4c18(0xd5)](a26_0xc5b354['green']('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a26_0xc5b354['cyan'](_0x40de7f));}}else{const _0x2e65a2=a26_0x40ee15[_0x1d4c18(0x17f)](_0x40de7f);!existsSync(_0x2e65a2)&&mkdirSync(_0x2e65a2,{'recursive':!![]}),writeFileSync(_0x40de7f,_0x94f75e,'utf-8'),console[_0x1d4c18(0xd5)](a26_0xc5b354['green']('✔')+_0x1d4c18(0x166)+a26_0xc5b354['cyan'](_0x40de7f));}return saveSessionContext({'parent_segment':_0x882e07},_0x2f87f0[_0x1d4c18(0x15a)]),console[_0x1d4c18(0xd5)](a26_0xc5b354[_0x1d4c18(0x127)]('✔')+'\x20Context\x20set:\x20'+a26_0xc5b354[_0x1d4c18(0x122)](_0x1d4c18(0xfa))+_0x1d4c18(0x1dc)+a26_0xc5b354[_0x1d4c18(0x140)](_0x882e07)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a26_0x4cc703(0x201)]='segment:parent:push';['description']=a26_0x4cc703(0x12d);async['execute'](_0x5cdb6a){const _0x3d41da=a26_0x4cc703,{options:_0xeea499,args:_0x5e2174,tdx:_0x57edee}=_0x5cdb6a,_0x5b4b66=_0xeea499,_0x29f248=_0x5e2174[0x0]||_0xeea499['parentSegment'];if(!_0x29f248)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'+_0x3d41da(0x13c)),0x1;const _0x4b0f4f=resolveYamlFile(_0x29f248);if(!existsSync(_0x4b0f4f))return showFileNotFoundError(_0x4b0f4f,_0x29f248),0x1;_0x5b4b66[_0x3d41da(0x168)]&&(console[_0x3d41da(0xd5)]('Site:\x20'+_0x5b4b66[_0x3d41da(0x161)]),console['error'](_0x3d41da(0x11d)+_0x4b0f4f));let _0x4e65b6;try{_0x4e65b6=readFileSync(_0x4b0f4f,_0x3d41da(0x14a));}catch(_0x310f5f){const _0x1d8a60=_0x310f5f instanceof Error?_0x310f5f[_0x3d41da(0x14c)]:String(_0x310f5f);return console[_0x3d41da(0xd5)](_0x3d41da(0x10d)+_0x1d8a60),0x1;}const _0x48ce27=await withSpinner(_0x3d41da(0x16a),()=>_0x57edee['segment'][_0x3d41da(0x18a)](_0x4e65b6),{'verbose':_0x5b4b66[_0x3d41da(0x168)]}),_0x5c5bf8=_0x48ce27[_0x3d41da(0x209)],{isNew:_0xac13df,name:_0x31f603,hasChanges:_0x4a72fa,diffFormatted:_0x441052}=_0x5c5bf8;if(!_0x4a72fa)return console[_0x3d41da(0xd5)](_0x3d41da(0xfb)+_0x31f603+_0x3d41da(0xdb)),0x0;_0xac13df?console[_0x3d41da(0xd5)](_0x3d41da(0xe6)+_0x31f603+'\x27:'):console['error'](_0x3d41da(0x1ea)+_0x31f603+'\x27:');console[_0x3d41da(0xd5)]('─'[_0x3d41da(0x212)](0x3c)),console[_0x3d41da(0xd5)](_0x441052),console['error']('─'[_0x3d41da(0x212)](0x3c));const _0x13222e=_0xac13df?_0x3d41da(0x1ed)+_0x31f603+'\x27?':_0x3d41da(0x19e)+_0x31f603+'\x27?';if(!_0x5b4b66[_0x3d41da(0x205)]){if(!isInteractive())return console[_0x3d41da(0xd5)](a26_0xc5b354[_0x3d41da(0x1b6)](_0x3d41da(0x200)),_0x3d41da(0x1d7)),console[_0x3d41da(0xd5)](a26_0xc5b354[_0x3d41da(0x122)](_0x3d41da(0x106))),0x1;const _0x5d4d60=await confirmKey(_0x13222e);if(!_0x5d4d60)return console[_0x3d41da(0xd5)](a26_0xc5b354[_0x3d41da(0xc9)]('Aborted.')),0x1;}const _0x3bf173=_0xac13df?_0x3d41da(0x109):'Updating',_0x2cfe1e=await withSpinner(_0x3bf173+_0x3d41da(0x1ac)+_0x31f603+_0x3d41da(0x213),()=>_0x5c5bf8[_0x3d41da(0xeb)](),{'verbose':_0x5b4b66[_0x3d41da(0x168)]}),_0x584992=_0x2cfe1e['data'],_0x2bfa79=getConsoleNextUrl(_0x5b4b66[_0x3d41da(0x161)],_0x3d41da(0x1df)+_0x584992['id']),_0x30cdaa=_0xac13df?_0x3d41da(0x1ba):_0x3d41da(0x1be);return console['error']('✔\x20'+_0x30cdaa+'\x20parent\x20segment\x20\x27'+_0x584992['name']+'\x27'),console['error']('\x20\x20'+_0x2bfa79),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x10a);[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x227);async[a26_0x4cc703(0x207)](_0x2ef30a){const _0x2343da=a26_0x4cc703,{options:_0x4ee2f5,args:_0x288a52,tdx:_0x1dc694}=_0x2ef30a,_0x232f6a=_0x4ee2f5,_0xc3d4ae=_0x288a52[0x0]||_0x4ee2f5[_0x2343da(0x1e6)];if(!_0xc3d4ae)return showParentSegmentNotSetError(_0x2343da(0x203)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x2343da(0x10c)+_0x2343da(0x167)+_0x2343da(0x1a3)),0x1;const _0x55defe=resolveYamlFile(_0xc3d4ae);if(!existsSync(_0x55defe))return showFileNotFoundError(_0x55defe,_0xc3d4ae),0x1;_0x232f6a[_0x2343da(0x168)]&&(console[_0x2343da(0xd5)](_0x2343da(0x1f8)+_0x232f6a[_0x2343da(0x161)]),console[_0x2343da(0xd5)](_0x2343da(0x11d)+_0x55defe));let _0x27c3ba;try{_0x27c3ba=readFileSync(_0x55defe,'utf-8');}catch(_0x52c324){const _0x1d70a8=_0x52c324 instanceof Error?_0x52c324['message']:String(_0x52c324);return console[_0x2343da(0xd5)](_0x2343da(0x10d)+_0x1d70a8),0x1;}const _0x5a1501=createCommandSpinner(a26_0xc5b354['dim']('Validating\x20configuration...'),{'verbose':_0x232f6a[_0x2343da(0x168)]});_0x5a1501[_0x2343da(0x128)]();const _0x482b2d={'onProgress':_0x4f8264=>{_0x5a1501['text']=formatProgressMessage(_0x4f8264);}};if(_0x232f6a['master'])_0x482b2d['master']=!![];if(_0x232f6a[_0x2343da(0x163)])_0x482b2d[_0x2343da(0x163)]=!![];_0x232f6a[_0x2343da(0xcc)]&&(_0x482b2d['attribute']=_0x232f6a['attribute']);_0x232f6a[_0x2343da(0xf3)]&&(_0x482b2d['behavior']=_0x232f6a[_0x2343da(0xf3)]);if(_0x232f6a['interval'])_0x482b2d[_0x2343da(0x17c)]=_0x232f6a[_0x2343da(0x17c)];let _0x39585a;try{_0x39585a=await _0x1dc694[_0x2343da(0x1c6)][_0x2343da(0x136)](_0x27c3ba,_0x482b2d),_0x5a1501['stop']();}catch(_0x505606){_0x5a1501['stop']();throw _0x505606;}const _0x2c0099=_0x232f6a[_0x2343da(0x17c)]||_0x2343da(0x16d);return this[_0x2343da(0x100)](_0x39585a,_0x482b2d,_0x55defe,_0x2c0099),_0x39585a[_0x2343da(0x188)]?0x0:0x1;}[a26_0x4cc703(0x100)](_0x62b4c,_0x5748ef,_0x14365b,_0x5b3292){const _0x15c370=a26_0x4cc703;console[_0x15c370(0xd5)]('\x0a'+a26_0xc5b354[_0x15c370(0x102)](_0x15c370(0x1d6))+'\x20'+_0x62b4c[_0x15c370(0x201)]),console[_0x15c370(0xd5)]('═'['repeat'](0x3c)),this[_0x15c370(0x19d)](_0x62b4c);if(typeof _0x5748ef[_0x15c370(0xcc)]===_0x15c370(0x1f2)){this[_0x15c370(0xc3)](_0x62b4c),this[_0x15c370(0x1e8)](_0x62b4c),this[_0x15c370(0x169)](_0x14365b,_0x5b3292,_0x15c370(0xcc),_0x5748ef[_0x15c370(0xcc)]);return;}if(_0x5748ef['attribute']===!![]){this['displayAttributesStats'](_0x62b4c),this['displaySummary'](_0x62b4c),this['displayPreviewHints'](_0x14365b,_0x5b3292,_0x15c370(0x158));return;}if(typeof _0x5748ef[_0x15c370(0xf3)]==='string'){this[_0x15c370(0xf1)](_0x62b4c,_0x5b3292),this[_0x15c370(0x1e8)](_0x62b4c),this[_0x15c370(0x169)](_0x14365b,_0x5b3292,_0x15c370(0xf3),_0x5748ef[_0x15c370(0xf3)]);return;}if(_0x5748ef[_0x15c370(0xf3)]===!![]){this['displayBehaviorsStats'](_0x62b4c,_0x5b3292),this[_0x15c370(0x1e8)](_0x62b4c),this['displayPreviewHints'](_0x14365b,_0x5b3292,_0x15c370(0x16f));return;}this[_0x15c370(0xc3)](_0x62b4c),this[_0x15c370(0xf1)](_0x62b4c,_0x5b3292),this[_0x15c370(0x1ad)](_0x62b4c),this[_0x15c370(0x1e8)](_0x62b4c),this[_0x15c370(0x169)](_0x14365b,_0x5b3292,_0x15c370(0x22a));}[a26_0x4cc703(0x1ad)](_0xe2f043){displayRealtimeValidation(_0xe2f043);}[a26_0x4cc703(0x169)](_0x2cf937,_0x517ab9,_0x56590f,_0x1f75dc){const _0x1b8fa4=a26_0x4cc703;console[_0x1b8fa4(0xd5)]('\x0a'+a26_0xc5b354[_0x1b8fa4(0x122)](_0x1b8fa4(0xc7)));const _0x48d730=_0x517ab9!==_0x1b8fa4(0x16d)?_0x1b8fa4(0x141)+_0x517ab9:'';if(_0x56590f===_0x1b8fa4(0xcc)&&_0x1f75dc)console['error']('\x20\x20'+a26_0xc5b354[_0x1b8fa4(0x122)](_0x1b8fa4(0x21b)+_0x2cf937+_0x1b8fa4(0xd1)+_0x1f75dc+'\x22'+_0x48d730));else{if(_0x56590f===_0x1b8fa4(0xf3)&&_0x1f75dc)console[_0x1b8fa4(0xd5)]('\x20\x20'+a26_0xc5b354[_0x1b8fa4(0x122)](_0x1b8fa4(0x21b)+_0x2cf937+_0x1b8fa4(0x174)+_0x1f75dc+'\x22'+_0x48d730));else(_0x56590f==='attributes'||_0x56590f===_0x1b8fa4(0x22a))&&console[_0x1b8fa4(0xd5)]('\x20\x20'+a26_0xc5b354[_0x1b8fa4(0x122)](_0x1b8fa4(0x21b)+_0x2cf937+_0x1b8fa4(0x11c)+_0x48d730));}(_0x56590f===_0x1b8fa4(0x16f)||_0x56590f===_0x1b8fa4(0x22a))&&console[_0x1b8fa4(0xd5)]('\x20\x20'+a26_0xc5b354[_0x1b8fa4(0x122)](_0x1b8fa4(0x21b)+_0x2cf937+'\x20--behavior\x20\x22<name>\x22'+_0x48d730)),_0x56590f===_0x1b8fa4(0x22a)&&console[_0x1b8fa4(0xd5)]('\x20\x20'+a26_0xc5b354[_0x1b8fa4(0x122)](_0x1b8fa4(0x21b)+_0x2cf937+_0x1b8fa4(0x20b)+_0x48d730));}[a26_0x4cc703(0x19d)](_0x5490bc){const _0x6a43b3=a26_0x4cc703,{master:_0x4af903}=_0x5490bc,_0x3b9b7c=_0x4af903[_0x6a43b3(0x1d5)]?a26_0xc5b354['green']('✔'):a26_0xc5b354[_0x6a43b3(0x1b6)]('✘');console[_0x6a43b3(0xd5)]('\x0a'+a26_0xc5b354['dim']('Master\x20Table')),console[_0x6a43b3(0xd5)](_0x3b9b7c+'\x20'+a26_0xc5b354['bold'](_0x4af903[_0x6a43b3(0xd4)]+'.'+_0x4af903[_0x6a43b3(0x113)])),_0x4af903['schemaValid']?_0x4af903[_0x6a43b3(0x18d)]!==undefined&&console[_0x6a43b3(0xd5)]('\x20\x20'+a26_0xc5b354['dim']('Rows:')+'\x20'+a26_0xc5b354[_0x6a43b3(0x140)](formatRows(_0x4af903[_0x6a43b3(0x18d)]))):console[_0x6a43b3(0xd5)]('\x20\x20'+a26_0xc5b354[_0x6a43b3(0x1b6)](_0x6a43b3(0x1c7))+'\x20'+_0x4af903[_0x6a43b3(0x202)]);}[a26_0x4cc703(0xc3)](_0x58b6ae){const _0x3e94f7=a26_0x4cc703;if(_0x58b6ae['attributes'][_0x3e94f7(0x231)]===0x0)return;console[_0x3e94f7(0xd5)]('\x0a'+a26_0xc5b354[_0x3e94f7(0x122)](_0x3e94f7(0x17d)));for(const _0x57e422 of _0x58b6ae[_0x3e94f7(0x158)]){const _0x4e44fd=_0x57e422[_0x3e94f7(0x1d5)]?a26_0xc5b354[_0x3e94f7(0x127)]('✔'):a26_0xc5b354[_0x3e94f7(0x1b6)]('✘');let _0x475646='';if(_0x57e422['schemaValid']&&_0x57e422['matchedCount']!==undefined&&_0x57e422[_0x3e94f7(0xe5)]!==undefined){const _0x240ae2=_0x57e422[_0x3e94f7(0xe5)][_0x3e94f7(0x1f5)](0x1),_0x4e4f25=_0x57e422[_0x3e94f7(0xe5)]>=0x50?a26_0xc5b354[_0x3e94f7(0x127)]:_0x57e422[_0x3e94f7(0xe5)]>=0x32?a26_0xc5b354['yellow']:a26_0xc5b354[_0x3e94f7(0x1b6)];_0x475646='\x20'+a26_0xc5b354[_0x3e94f7(0x122)]('Coverage:')+'\x20'+_0x4e4f25(_0x240ae2+'%')+'\x20('+formatRows(_0x57e422[_0x3e94f7(0xc6)])+_0x3e94f7(0xdd);}console[_0x3e94f7(0xd5)](_0x4e44fd+'\x20'+a26_0xc5b354[_0x3e94f7(0x102)](_0x57e422[_0x3e94f7(0x201)])+_0x475646),console['error']('\x20\x20'+a26_0xc5b354[_0x3e94f7(0x122)](_0x3e94f7(0x1dd))+'\x20'+a26_0xc5b354[_0x3e94f7(0x102)](_0x57e422[_0x3e94f7(0xd4)]+'.'+_0x57e422[_0x3e94f7(0x113)]));const _0x3711fa=_0x57e422[_0x3e94f7(0x1ec)]===_0x57e422[_0x3e94f7(0x195)]?a26_0xc5b354[_0x3e94f7(0x122)](_0x3e94f7(0x192))+'\x20'+_0x57e422[_0x3e94f7(0x1ec)]:a26_0xc5b354['dim'](_0x3e94f7(0x111))+'\x20'+_0x57e422['joinKey']+_0x3e94f7(0x1dc)+_0x57e422[_0x3e94f7(0x195)];console['error']('\x20\x20'+_0x3711fa),console[_0x3e94f7(0xd5)]('\x20\x20'+a26_0xc5b354['dim'](_0x3e94f7(0x165))),this[_0x3e94f7(0x226)](_0x57e422[_0x3e94f7(0x208)]),!_0x57e422[_0x3e94f7(0x1d5)]&&console[_0x3e94f7(0xd5)]('\x20\x20'+a26_0xc5b354[_0x3e94f7(0x1b6)](_0x3e94f7(0x1c7))+'\x20'+_0x57e422[_0x3e94f7(0x202)]);}}[a26_0x4cc703(0xf1)](_0x181875,_0x4e29f2){const _0x125090=a26_0x4cc703;if(_0x181875[_0x125090(0x16f)]['length']===0x0)return;console[_0x125090(0xd5)]('\x0a'+a26_0xc5b354[_0x125090(0x122)]('Behaviors')+'\x20'+a26_0xc5b354[_0x125090(0x122)]('('+_0x4e29f2+')'));for(const _0x1cb215 of _0x181875[_0x125090(0x16f)]){const _0x17b0e6=_0x1cb215[_0x125090(0x1d5)]?a26_0xc5b354['green']('✔'):a26_0xc5b354[_0x125090(0x1b6)]('✘');let _0x39e4a2='';if(_0x1cb215[_0x125090(0x1d5)]&&_0x1cb215[_0x125090(0x116)]!==undefined&&_0x1cb215['totalEvents']!==undefined){const _0x404774=_0x1cb215['customerPercent']?.[_0x125090(0x1f5)](0x1)||'?',_0x738e6c=(_0x1cb215['customerPercent']??0x0)>=0x32?a26_0xc5b354[_0x125090(0x127)]:(_0x1cb215[_0x125090(0x13d)]??0x0)>=0x14?a26_0xc5b354[_0x125090(0xc9)]:a26_0xc5b354[_0x125090(0x1b6)];_0x39e4a2='\x20'+a26_0xc5b354['dim']('Customers:')+'\x20'+_0x738e6c(formatRows(_0x1cb215[_0x125090(0x116)]))+'\x20('+_0x404774+'%)\x20'+a26_0xc5b354[_0x125090(0x122)]('Events:')+'\x20'+a26_0xc5b354[_0x125090(0x140)](formatRows(_0x1cb215[_0x125090(0x1fe)]));}console[_0x125090(0xd5)](_0x17b0e6+'\x20'+a26_0xc5b354[_0x125090(0x102)](_0x1cb215['name'])+_0x39e4a2),console[_0x125090(0xd5)]('\x20\x20'+a26_0xc5b354[_0x125090(0x122)]('Source:')+'\x20'+a26_0xc5b354[_0x125090(0x102)](_0x1cb215[_0x125090(0xd4)]+'.'+_0x1cb215['table']));const _0x3a6f39=_0x1cb215[_0x125090(0x1ec)]===_0x1cb215['foreignKey']?a26_0xc5b354[_0x125090(0x122)](_0x125090(0x192))+'\x20'+_0x1cb215[_0x125090(0x1ec)]:a26_0xc5b354[_0x125090(0x122)](_0x125090(0x111))+'\x20'+_0x1cb215[_0x125090(0x1ec)]+_0x125090(0x1dc)+_0x1cb215[_0x125090(0x195)];console[_0x125090(0xd5)]('\x20\x20'+_0x3a6f39),console['error']('\x20\x20'+a26_0xc5b354[_0x125090(0x122)](_0x125090(0x165))),this['displayColumns'](_0x1cb215['columns']),!_0x1cb215['schemaValid']&&console[_0x125090(0xd5)]('\x20\x20'+a26_0xc5b354[_0x125090(0x1b6)](_0x125090(0x1c7))+'\x20'+_0x1cb215['schemaError']);}}[a26_0x4cc703(0x226)](_0x41fe69){const _0xafd3c=a26_0x4cc703;for(const _0x2fc30c of _0x41fe69){_0x2fc30c[_0xafd3c(0x1f1)]===_0x2fc30c['column']||_0x2fc30c['column']==='*'?console['error'](_0xafd3c(0x1bf)+_0x2fc30c[_0xafd3c(0x1f1)]):console[_0xafd3c(0xd5)]('\x20\x20\x20\x20-\x20'+_0x2fc30c[_0xafd3c(0x1f1)]+'\x20'+a26_0xc5b354[_0xafd3c(0x122)]('('+_0x2fc30c[_0xafd3c(0x13f)]+')'));}}[a26_0x4cc703(0x1e8)](_0x1a4b39){const _0x1e0923=a26_0x4cc703;console[_0x1e0923(0xd5)]('─'['repeat'](0x3c));if(_0x1a4b39[_0x1e0923(0x1a4)][_0x1e0923(0x231)]>0x0){console[_0x1e0923(0xd5)]('\x0a'+a26_0xc5b354[_0x1e0923(0x1b6)](_0x1e0923(0x181)));for(const _0x1d1fce of _0x1a4b39[_0x1e0923(0x1a4)]){console['error']('\x20\x20'+a26_0xc5b354[_0x1e0923(0x1b6)]('•')+'\x20'+_0x1d1fce);}}_0x1a4b39['allValid']&&console[_0x1e0923(0xd5)]('\x0a'+a26_0xc5b354[_0x1e0923(0x127)]('✔')+_0x1e0923(0x147));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x1a9);[a26_0x4cc703(0x23b)]=a26_0x4cc703(0xdf);async[a26_0x4cc703(0x207)](_0x49cfce){const _0x3500d8=a26_0x4cc703,{options:_0x5eb566,args:_0x57c197,tdx:_0x495288}=_0x49cfce,_0xebe09f=_0x5eb566,_0x4f0599=_0x57c197[0x0]||_0x5eb566['parentSegment'];if(!_0x4f0599)return showParentSegmentNotSetError(_0x3500d8(0x15f)+_0x3500d8(0x159)+_0x3500d8(0xe9)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+_0x3500d8(0xec)+_0x3500d8(0x244)+_0x3500d8(0x1e0)+_0x3500d8(0x1a3)),0x1;if(!_0xebe09f[_0x3500d8(0x1cf)]&&!_0xebe09f['attribute']&&!_0xebe09f[_0x3500d8(0xf3)]&&!_0xebe09f[_0x3500d8(0x163)])return console[_0x3500d8(0xd5)](a26_0xc5b354[_0x3500d8(0x1b6)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0x3500d8(0xd5)](_0x3500d8(0x22f)),console[_0x3500d8(0xd5)]('Options:'),console[_0x3500d8(0xd5)](_0x3500d8(0x237)),console[_0x3500d8(0xd5)](_0x3500d8(0x211)),console[_0x3500d8(0xd5)](_0x3500d8(0x11f)),console[_0x3500d8(0xd5)](_0x3500d8(0x1b5)),0x1;const _0x4b273e=resolveYamlFile(_0x4f0599);if(!existsSync(_0x4b273e))return showFileNotFoundError(_0x4b273e,_0x4f0599),0x1;_0xebe09f[_0x3500d8(0x168)]&&(console['error'](_0x3500d8(0x1f8)+_0xebe09f[_0x3500d8(0x161)]),console[_0x3500d8(0xd5)](_0x3500d8(0x11d)+_0x4b273e));let _0x185566;try{_0x185566=readFileSync(_0x4b273e,_0x3500d8(0x14a));}catch(_0x211e94){const _0xfb5754=_0x211e94 instanceof Error?_0x211e94[_0x3500d8(0x14c)]:String(_0x211e94);return console[_0x3500d8(0xd5)](_0x3500d8(0x10d)+_0xfb5754),0x1;}let _0x5200ec;try{_0x5200ec=parseDef(_0x185566);}catch(_0x52c61d){const _0x8efe3e=_0x52c61d instanceof Error?_0x52c61d[_0x3500d8(0x14c)]:String(_0x52c61d);return console[_0x3500d8(0xd5)](a26_0xc5b354[_0x3500d8(0x1b6)](_0x3500d8(0x11b)+_0x8efe3e)),0x1;}if(_0xebe09f[_0x3500d8(0xcc)]===!![]||_0xebe09f[_0x3500d8(0xcc)]===''){const _0x32be80=_0x5200ec['attributes']?.[_0x3500d8(0x13b)](_0x461182=>_0x461182[_0x3500d8(0x201)])||[];if(_0x32be80['length']===0x0)console['error'](a26_0xc5b354[_0x3500d8(0x1b6)](_0x3500d8(0x20e)));else{console[_0x3500d8(0xd5)](a26_0xc5b354[_0x3500d8(0x1b6)](_0x3500d8(0xe1))),console['error']('Available\x20attributes:');for(const _0x1b4aa4 of _0x32be80){console[_0x3500d8(0xd5)]('\x20\x20'+a26_0xc5b354[_0x3500d8(0x140)](_0x1b4aa4));}console[_0x3500d8(0xd5)](_0x3500d8(0x1e5)+_0x4f0599+_0x3500d8(0xd1)+_0x32be80[0x0]+'\x22');}return 0x1;}if(_0xebe09f[_0x3500d8(0xf3)]===!![]||_0xebe09f[_0x3500d8(0xf3)]===''){const _0x5ebff7=_0x5200ec['behaviors']?.[_0x3500d8(0x13b)](_0x4a183f=>_0x4a183f['name'])||[];if(_0x5ebff7[_0x3500d8(0x231)]===0x0)console[_0x3500d8(0xd5)](a26_0xc5b354[_0x3500d8(0x1b6)](_0x3500d8(0x22c)));else{console[_0x3500d8(0xd5)](a26_0xc5b354[_0x3500d8(0x1b6)]('Error:\x20--behavior\x20requires\x20a\x20name\x0a')),console['error'](_0x3500d8(0x194));for(const _0x47a03a of _0x5ebff7){console[_0x3500d8(0xd5)]('\x20\x20'+a26_0xc5b354[_0x3500d8(0x140)](_0x47a03a));}console[_0x3500d8(0xd5)](_0x3500d8(0x1e5)+_0x4f0599+_0x3500d8(0x174)+_0x5ebff7[0x0]+'\x22');}return 0x1;}const _0x33cf38=createCommandSpinner(a26_0xc5b354['dim'](_0x3500d8(0x236)),{'verbose':_0xebe09f[_0x3500d8(0x168)]});_0x33cf38[_0x3500d8(0x128)]();const _0x33cfc7={'onProgress':_0x5733f9=>{const _0x386f86=_0x3500d8;_0x33cf38[_0x386f86(0x1cd)]=formatProgressMessage(_0x5733f9);}};if(_0xebe09f[_0x3500d8(0x1cf)])_0x33cfc7[_0x3500d8(0x1cf)]=!![];if(_0xebe09f['attribute']&&typeof _0xebe09f[_0x3500d8(0xcc)]===_0x3500d8(0x1f2))_0x33cfc7[_0x3500d8(0xcc)]=_0xebe09f[_0x3500d8(0xcc)];if(_0xebe09f[_0x3500d8(0xf3)]&&typeof _0xebe09f[_0x3500d8(0xf3)]===_0x3500d8(0x1f2))_0x33cfc7['behavior']=_0xebe09f[_0x3500d8(0xf3)];if(_0xebe09f[_0x3500d8(0x163)])_0x33cfc7['enriched']=!![];if(_0xebe09f[_0x3500d8(0x17c)])_0x33cfc7[_0x3500d8(0x17c)]=_0xebe09f[_0x3500d8(0x17c)];let _0x1c2a95;try{_0x1c2a95=await _0x495288[_0x3500d8(0x1c6)]['previewParentYaml'](_0x185566,_0x33cfc7),_0x33cf38['stop']();}catch(_0x163078){_0x33cf38[_0x3500d8(0x199)]();throw _0x163078;}return await this[_0x3500d8(0x204)](_0x1c2a95,{'master':_0xebe09f['master'],'attribute':typeof _0xebe09f[_0x3500d8(0xcc)]===_0x3500d8(0x1f2)?_0xebe09f['attribute']:undefined,'behavior':typeof _0xebe09f['behavior']===_0x3500d8(0x1f2)?_0xebe09f['behavior']:undefined,'enriched':_0xebe09f[_0x3500d8(0x163)]}),_0x1c2a95[_0x3500d8(0x188)]?0x0:0x1;}async[a26_0x4cc703(0x204)](_0x5e1b05,_0x2e3f27){const _0x29a383=a26_0x4cc703;console[_0x29a383(0xd5)]('\x0a'+a26_0xc5b354['bold'](_0x29a383(0x1c4))+'\x20'+_0x5e1b05[_0x29a383(0x201)]),console['error']('═'['repeat'](0x3c));if(_0x2e3f27[_0x29a383(0x1cf)]&&_0x5e1b05[_0x29a383(0xef)]){const _0x5b2167=a26_0xc5b354[_0x29a383(0x122)](_0x29a383(0x21d))+'\x20'+a26_0xc5b354[_0x29a383(0x102)](_0x5e1b05[_0x29a383(0x1cf)][_0x29a383(0xd4)]+'.'+_0x5e1b05['master'][_0x29a383(0x113)]);await this[_0x29a383(0x1ab)](_0x5b2167,_0x5e1b05['sampleData']);}else{if(_0x2e3f27[_0x29a383(0xcc)]&&_0x5e1b05[_0x29a383(0xef)]){const _0xa76135=a26_0xc5b354[_0x29a383(0x122)](_0x29a383(0x20d))+'\x20'+a26_0xc5b354[_0x29a383(0x102)](_0x2e3f27[_0x29a383(0xcc)]);await this['displaySampleData'](_0xa76135,_0x5e1b05[_0x29a383(0xef)]);}else{if(_0x2e3f27[_0x29a383(0xf3)]&&_0x5e1b05['sampleData']){const _0x34389b=a26_0xc5b354['dim']('Behavior:')+'\x20'+a26_0xc5b354[_0x29a383(0x102)](_0x2e3f27[_0x29a383(0xf3)]);await this['displaySampleData'](_0x34389b,_0x5e1b05['sampleData']);}else{if(_0x2e3f27[_0x29a383(0x163)]&&_0x5e1b05['sampleData']){const _0xacff81=a26_0xc5b354[_0x29a383(0x122)](_0x29a383(0x1e2))+'\x20'+a26_0xc5b354[_0x29a383(0x102)](_0x29a383(0x164));await this[_0x29a383(0x1ab)](_0xacff81,_0x5e1b05[_0x29a383(0xef)]);}else!_0x5e1b05[_0x29a383(0xef)]&&console[_0x29a383(0xd5)](_0x29a383(0x1f6));}}}if(_0x5e1b05[_0x29a383(0x1a4)][_0x29a383(0x231)]>0x0){console[_0x29a383(0xd5)]('─'[_0x29a383(0x212)](0x3c)),console['error']('\x0a'+a26_0xc5b354['red']('Errors:'));for(const _0x288961 of _0x5e1b05['errors']){console[_0x29a383(0xd5)]('\x20\x20'+a26_0xc5b354['red']('•')+'\x20'+_0x288961);}}}async[a26_0x4cc703(0x1ab)](_0x5077f6,_0x350a51){const _0x64630b=a26_0x4cc703;if(_0x350a51[_0x64630b(0x231)]===0x0){console[_0x64630b(0xd5)]('\x0a'+_0x5077f6),console[_0x64630b(0xd5)](_0x64630b(0x125));return;}console[_0x64630b(0xd5)]('\x0a'+_0x5077f6);const _0x6b6628=Object[_0x64630b(0x218)](_0x350a51[0x0])[_0x64630b(0x13b)](_0x492c5d=>({'name':_0x492c5d,'type':typeof _0x350a51[0x0][_0x492c5d]===_0x64630b(0x223)?'double':'varchar'})),_0x2c5992={'queryId':'preview','columns':_0x6b6628,'data':_0x350a51,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x350a51['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x9b7c4=formatAsTable(_0x2c5992,_0x350a51[_0x64630b(0x231)],!![]);await writeOutput(_0x9b7c4,undefined,_0x64630b(0x113));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x196);[a26_0x4cc703(0x23b)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a26_0x4cc703(0x207)](_0x1f5647){const _0x31c589=a26_0x4cc703,{options:_0x19b013,args:_0x1630d8,tdx:_0x3c0aa0}=_0x1f5647,_0x3b7251=_0x19b013,_0x32b788=_0x1630d8[0x0]||_0x19b013[_0x31c589(0x1e6)];if(!_0x32b788)return showParentSegmentNotSetError(_0x31c589(0x210)+_0x31c589(0x186)),0x1;const _0x1e658f=resolveYamlFile(_0x32b788);if(existsSync(_0x1e658f)){_0x3b7251[_0x31c589(0x168)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x1e658f);let _0x2aed07;try{_0x2aed07=readFileSync(_0x1e658f,'utf-8');}catch(_0x1008a9){const _0x1bdb23=_0x1008a9 instanceof Error?_0x1008a9[_0x31c589(0x14c)]:String(_0x1008a9);return console[_0x31c589(0xd5)]('Error\x20reading\x20file:\x20'+_0x1bdb23),0x1;}const _0x11675f=await withSpinner(_0x31c589(0x16a),()=>_0x3c0aa0[_0x31c589(0x1c6)][_0x31c589(0x18a)](_0x2aed07),{'verbose':_0x3b7251[_0x31c589(0x168)]}),_0x5ef037=_0x11675f[_0x31c589(0x209)],{isNew:_0x11e283,name:_0x38f448,hasChanges:_0x507a7d,diffFormatted:_0x2ddbd3}=_0x5ef037;if(_0x507a7d){_0x11e283?console[_0x31c589(0xd5)](_0x31c589(0xe6)+_0x38f448+'\x27:'):console[_0x31c589(0xd5)](_0x31c589(0x1ea)+_0x38f448+'\x27:');console['error']('─'[_0x31c589(0x212)](0x3c)),console['error'](_0x2ddbd3),console['error']('─'[_0x31c589(0x212)](0x3c));const _0x5c7da5=_0x11e283?'Create\x20parent\x20segment\x20\x27'+_0x38f448+_0x31c589(0x221):_0x31c589(0x19e)+_0x38f448+_0x31c589(0x221);if(!_0x3b7251[_0x31c589(0x205)]){if(!isInteractive())return console[_0x31c589(0xd5)](a26_0xc5b354[_0x31c589(0x1b6)](_0x31c589(0x200)),_0x31c589(0x1d7)),console['error'](a26_0xc5b354[_0x31c589(0x122)](_0x31c589(0x106))),0x1;const _0x2857a8=await confirmKey(_0x5c7da5);if(!_0x2857a8)return console[_0x31c589(0xd5)](a26_0xc5b354['yellow'](_0x31c589(0x123))),0x1;}const _0x2f9053=_0x11e283?_0x31c589(0x109):'Updating';await withSpinner(_0x2f9053+_0x31c589(0x1ac)+_0x38f448+'\x27...',()=>_0x5ef037[_0x31c589(0xeb)](),{'verbose':_0x3b7251['verbose']});const _0x5183de=_0x11e283?_0x31c589(0x1ba):_0x31c589(0x1be);console[_0x31c589(0xd5)]('✔\x20'+_0x5183de+'\x20parent\x20segment\x20\x27'+_0x38f448+'\x27');}else console['error'](_0x31c589(0xfb)+_0x38f448+_0x31c589(0xe7));}const _0x5853b3=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x32b788+'\x27...',()=>_0x3c0aa0[_0x31c589(0x1c6)]['runParent'](_0x32b788),{'verbose':_0x3b7251['verbose']}),_0x3b793c=_0x5853b3[_0x31c589(0x209)],_0x1e9c38=getConsoleUrl(_0x3b7251[_0x31c589(0x161)],_0x31c589(0x19a)+_0x3b793c[_0x31c589(0xfd)]+_0x31c589(0x18b)+_0x3b793c['workflowSessionId']+_0x31c589(0x14d)+_0x3b793c[_0x31c589(0x173)]);return console['error']('\x0a✔\x20Workflow\x20started'),console[_0x31c589(0xd5)]('\x20\x20'+a26_0xc5b354['dim'](_0x31c589(0x1bd))+'\x20'+_0x3b793c[_0x31c589(0x16e)]),console[_0x31c589(0xd5)]('\x20\x20'+a26_0xc5b354[_0x31c589(0x122)](_0x31c589(0x179))+'\x20'+_0x3b793c[_0x31c589(0x239)]),console[_0x31c589(0xd5)]('\x20\x20'+a26_0xc5b354['dim'](_0x31c589(0x129))+'\x20'+_0x3b793c['workflowSessionId']),console[_0x31c589(0xd5)]('\x20\x20'+a26_0xc5b354[_0x31c589(0x122)](_0x31c589(0x133))+'\x20'+_0x3b793c[_0x31c589(0x173)]),console[_0x31c589(0xd5)]('\x20\x20'+_0x1e9c38),console[_0x31c589(0xd5)]('\x0a'+a26_0xc5b354[_0x31c589(0x122)]('To\x20cancel:')+'\x20tdx\x20wf\x20attempt\x20'+_0x3b793c[_0x31c589(0x173)]+_0x31c589(0x105)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a26_0x4cc703(0x201)]='segment:parent:fields';['description']='List\x20available\x20fields\x20for\x20segmentation';async[a26_0x4cc703(0x207)](_0x4c42ac){const _0x155ba4=a26_0x4cc703,{options:_0xbdaeed,args:_0x36cd96,tdx:_0x1c4ebc}=_0x4c42ac,_0xd86399=_0x36cd96[0x0]||_0xbdaeed['parentSegment'];if(!_0xd86399)return showParentSegmentNotSetError(_0x155ba4(0x1bc)+_0x155ba4(0x156)),0x1;_0xbdaeed[_0x155ba4(0x168)]&&(console['error'](_0x155ba4(0x1f8)+_0xbdaeed[_0x155ba4(0x161)]),console[_0x155ba4(0xd5)](_0x155ba4(0xea)+_0xd86399));const _0x5f312b=await withSpinner(_0x155ba4(0x172)+_0xd86399+_0x155ba4(0x213),()=>_0x1c4ebc[_0x155ba4(0x1c6)][_0x155ba4(0xfe)](_0xd86399),{'verbose':_0xbdaeed[_0x155ba4(0x168)]}),_0x186cf8=_0x5f312b[_0x155ba4(0x209)];console['error']('✔\x20Found\x20'+_0x186cf8[_0x155ba4(0x231)]+_0x155ba4(0x215)+(_0x186cf8['length']!==0x1?'s':''));if(_0xbdaeed['json']||_0xbdaeed[_0x155ba4(0x191)])return await handleSDKOutput(_0x186cf8,_0xbdaeed),0x0;return displayFieldsHumanReadable(_0x186cf8,_0xd86399),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x197);[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x149);async['execute'](_0x2a4d27){const _0x432fed=a26_0x4cc703,{options:_0x53ae75,args:_0x1f0cec,tdx:_0x31bb44}=_0x2a4d27,_0x6ab41=_0x53ae75,_0x26bd6c=_0x1f0cec[0x0]||_0x53ae75[_0x432fed(0x1e6)];if(!_0x26bd6c)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'+_0x432fed(0x151)+_0x432fed(0xd8)+_0x432fed(0x154)),0x1;_0x53ae75[_0x432fed(0x168)]&&(console[_0x432fed(0xd5)]('Site:\x20'+_0x53ae75[_0x432fed(0x161)]),console[_0x432fed(0xd5)](_0x432fed(0xea)+_0x26bd6c));const _0xc15d95=await withSpinner(_0x432fed(0x19b)+_0x26bd6c+'\x27...',()=>_0x31bb44[_0x432fed(0x1c6)][_0x432fed(0x21f)](_0x26bd6c),{'verbose':_0x53ae75[_0x432fed(0x168)]}),_0x46dc5d=_0xc15d95[_0x432fed(0x209)];if(_0x6ab41[_0x432fed(0x138)]){const _0x2477cc=getConsoleNextUrl(_0x6ab41[_0x432fed(0x161)],'/app/dw/parentSegments/'+_0x46dc5d['id']);return console['error'](a26_0xc5b354[_0x432fed(0x127)]('✔')+_0x432fed(0x238)+a26_0xc5b354['cyan'](_0x2477cc)),openBrowser(_0x2477cc),0x0;}return await handleSingleObjectOutput(_0x46dc5d,_0x53ae75),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x1d3);[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x15e);async[a26_0x4cc703(0x207)](_0x35b263){const _0x3971ea=a26_0x4cc703,{options:_0x3f1b4c,args:_0x35cf0,tdx:_0x176de7}=_0x35b263,_0x181c61=_0x3f1b4c,_0x13ab14=_0x35cf0[0x0]||_0x3f1b4c[_0x3971ea(0x1e6)];if(!_0x13ab14)return showParentSegmentNotSetError(_0x3971ea(0x1bb)+_0x3971ea(0x120)+_0x3971ea(0xd8)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x3f1b4c[_0x3971ea(0x168)]&&(console[_0x3971ea(0xd5)](_0x3971ea(0x1f8)+_0x3f1b4c['site']),console[_0x3971ea(0xd5)](_0x3971ea(0xea)+_0x13ab14));const _0xd516a1=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x13ab14+_0x3971ea(0x213),()=>_0x176de7[_0x3971ea(0x1c6)][_0x3971ea(0x1c1)](_0x13ab14),{'verbose':_0x3f1b4c[_0x3971ea(0x168)]}),_0x3e1fbc=_0xd516a1['data'],_0x16b162=_0x176de7['segment']['getOutputDatabaseName'](_0x3e1fbc);if(_0x181c61[_0x3971ea(0x1b0)]){const _0x6ee1f9=await this[_0x3971ea(0x103)](_0x35b263,_0x13ab14,_0x3e1fbc,_0x16b162),_0x2ab73b=this[_0x3971ea(0x176)](_0x6ee1f9);writeFileSync(_0x181c61[_0x3971ea(0x1b0)],_0x2ab73b);const _0x16c46b=_0x6ee1f9['customers']['columns']['length']+_0x6ee1f9['behaviors'][_0x3971ea(0x180)]((_0xf3823b,_0x2b4813)=>_0xf3823b+_0x2b4813[_0x3971ea(0x208)][_0x3971ea(0x231)],0x0),_0x53c7ed=_0x6ee1f9[_0x3971ea(0x16f)][_0x3971ea(0x107)](_0x4bbcae=>_0x4bbcae['columns']['length']===0x0)[_0x3971ea(0x231)];return console['log'](_0x3971ea(0x22e)+_0x181c61['output']),console[_0x3971ea(0x160)](_0x3971ea(0x144)+_0x16b162),console['log'](_0x3971ea(0x1a8)+_0x6ee1f9[_0x3971ea(0x16f)][_0x3971ea(0x231)]+_0x3971ea(0xf8)),console[_0x3971ea(0x160)](_0x3971ea(0x182)+_0x16c46b+_0x3971ea(0xc1)),_0x53c7ed>0x0&&console[_0x3971ea(0x160)](_0x3971ea(0x1f0)+_0x53c7ed+_0x3971ea(0x137)),0x0;}console['error']('\x0a'+a26_0xc5b354[_0x3971ea(0x102)]('Output\x20Database:')+'\x20'+a26_0xc5b354['cyan'](_0x16b162));const _0x301165=await withSpinner(_0x3971ea(0xe0),()=>_0x176de7[_0x3971ea(0x1c6)][_0x3971ea(0x1cc)](_0x3e1fbc),{'verbose':_0x3f1b4c[_0x3971ea(0x168)]});console[_0x3971ea(0xd5)]('\x0a'+a26_0xc5b354['bold'](_0x3971ea(0x115))+'\x20'+a26_0xc5b354[_0x3971ea(0x122)]('('+_0x16b162+_0x3971ea(0x222)));const _0x1e2ae2=await executeSchemaQuery(_0x301165[_0x3971ea(0x209)],_0x176de7,_0x3f1b4c);await handleQueryOutput(_0x1e2ae2,_0x3f1b4c);const _0xfaae90=await withSpinner(_0x3971ea(0x1eb),()=>_0x176de7['segment'][_0x3971ea(0xd9)](_0x3e1fbc),{'verbose':_0x3f1b4c[_0x3971ea(0x168)]});for(const _0x4a2def of _0xfaae90[_0x3971ea(0x209)]){const _0x58d349=_0x3971ea(0x1a7)+_0x4a2def[_0x3971ea(0xf9)]()[_0x3971ea(0x219)](/\s+/g,'_'),_0x2d4514='SELECT\x20*\x20FROM\x20'+_0x16b162+'.'+_0x58d349;console[_0x3971ea(0xd5)]('\x0a'+a26_0xc5b354[_0x3971ea(0x102)](_0x4a2def)+'\x20'+a26_0xc5b354[_0x3971ea(0x122)]('('+_0x16b162+'.'+_0x58d349+')'));try{const _0x48c018=await executeSchemaQuery(_0x2d4514,_0x176de7,_0x3f1b4c);await handleQueryOutput(_0x48c018,_0x3f1b4c);}catch{console[_0x3971ea(0xd5)](a26_0xc5b354['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a26_0x4cc703(0x103)](_0x1ce87b,_0x1c3c24,_0xa69b30,_0x443f7f){const _0x53cd32=a26_0x4cc703,{options:_0x36ace2,tdx:_0xd45a87}=_0x1ce87b,_0x5e4dc2=await withSpinner(_0x53cd32(0xe0),()=>_0xd45a87[_0x53cd32(0x1c6)]['getParentSQL'](_0xa69b30),{'verbose':_0x36ace2[_0x53cd32(0x168)]}),_0x396147=await executeSchemaQuery(_0x5e4dc2[_0x53cd32(0x209)],_0xd45a87,_0x36ace2),_0x252f7b=_0x396147[_0x53cd32(0x209)]['map'](_0xd682a0=>({'name':_0xd682a0[_0x53cd32(0x217)],'type':_0xd682a0[_0x53cd32(0x14f)]})),_0x3ce5a4=await withSpinner(_0x53cd32(0x1eb),()=>_0xd45a87[_0x53cd32(0x1c6)][_0x53cd32(0xd9)](_0xa69b30),{'verbose':_0x36ace2[_0x53cd32(0x168)]}),_0x19a15b=[];for(const _0x8cb910 of _0x3ce5a4[_0x53cd32(0x209)]){const _0x2e2fb5=_0x53cd32(0x1a7)+_0x8cb910['toLowerCase']()[_0x53cd32(0x219)](/\s+/g,'_'),_0x3736b0='SELECT\x20*\x20FROM\x20'+_0x443f7f+'.'+_0x2e2fb5;let _0x2d3c1e=[];try{const _0x53fd4a=await executeSchemaQuery(_0x3736b0,_0xd45a87,_0x36ace2);_0x2d3c1e=_0x53fd4a['data'][_0x53cd32(0x13b)](_0x465674=>({'name':_0x465674[_0x53cd32(0x217)],'type':_0x465674[_0x53cd32(0x14f)]}));}catch{}_0x19a15b['push']({'table':_0x2e2fb5,'columns':_0x2d3c1e});}return{'database':_0x443f7f,'parent_segment':_0x1c3c24,'parent_id':_0xa69b30,'customers':{'table':_0x53cd32(0x115),'columns':_0x252f7b},'behaviors':_0x19a15b};}[a26_0x4cc703(0x176)](_0x134dd3){const _0x2ec60c=a26_0x4cc703,_0x4618ec=_0x495874=>{const _0xf3305f=a26_0x428a;if(_0x495874[_0xf3305f(0x231)]===0x0)return'[]';const _0x4bdccd=_0x495874[_0xf3305f(0x13b)](_0xbf34ef=>_0xf3305f(0xcf)+_0xbf34ef['name']+'\x22,\x20\x22type\x22:\x20\x22'+_0xbf34ef[_0xf3305f(0x1ff)]+_0xf3305f(0x1a5));return'[\x0a'+_0x4bdccd[_0xf3305f(0x185)](',\x0a')+_0xf3305f(0x139);},_0x276641=_0x134dd3[_0x2ec60c(0x16f)][_0x2ec60c(0x13b)](_0x1b36ed=>{const _0x373243=_0x2ec60c;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x1b36ed[_0x373243(0x113)]+_0x373243(0x230)+_0x4618ec(_0x1b36ed['columns'])[_0x373243(0x219)](/^/gm,'\x20\x20')['trim']()+_0x373243(0x17a);})[_0x2ec60c(0x185)](',\x0a');return _0x2ec60c(0x1b4)+_0x134dd3[_0x2ec60c(0xd4)]+_0x2ec60c(0x22b)+_0x134dd3['parent_segment']+_0x2ec60c(0xff)+_0x134dd3['parent_id']+_0x2ec60c(0x23a)+_0x134dd3[_0x2ec60c(0x115)]['table']+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x4618ec(_0x134dd3[_0x2ec60c(0x115)][_0x2ec60c(0x208)])[_0x2ec60c(0x219)](/^/gm,'\x20\x20')['trim']()+_0x2ec60c(0x131)+_0x276641+_0x2ec60c(0xe2);}}export class ParentSegmentSQLCommand extends BaseCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x190);[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x11e);async[a26_0x4cc703(0x207)](_0x23e4a7){const _0x47dfa7=a26_0x4cc703,{options:_0xf77cd,args:_0x56c202,tdx:_0xd76d92}=_0x23e4a7,_0x8d3bca=_0x56c202[0x0]||_0xf77cd[_0x47dfa7(0x1e6)];if(!_0x8d3bca)return showParentSegmentNotSetError(_0x47dfa7(0x1a0)+_0x47dfa7(0xfc)),0x1;_0xf77cd[_0x47dfa7(0x168)]&&(console[_0x47dfa7(0xd5)](_0x47dfa7(0x1f8)+_0xf77cd['site']),console[_0x47dfa7(0xd5)](_0x47dfa7(0xea)+_0x8d3bca));const _0x1765d5=await withSpinner(_0x47dfa7(0x1e9)+_0x8d3bca+'\x27...',()=>_0xd76d92[_0x47dfa7(0x1c6)]['resolveParentId'](_0x8d3bca),{'verbose':_0xf77cd[_0x47dfa7(0x168)]}),_0x41e4b7=_0x1765d5[_0x47dfa7(0x209)],_0x2eb4c9=await withSpinner(_0x47dfa7(0x1ee)+_0x8d3bca+_0x47dfa7(0x213),()=>_0xd76d92[_0x47dfa7(0x1c6)]['getParentSQL'](_0x41e4b7),{'verbose':_0xf77cd[_0x47dfa7(0x168)]}),_0x556691=_0x2eb4c9[_0x47dfa7(0x209)];return _0xf77cd[_0x47dfa7(0x224)]===_0x47dfa7(0x155)||_0xf77cd[_0x47dfa7(0x224)]===_0x47dfa7(0x191)?await handleSDKOutput([{'sql':_0x556691}],_0xf77cd):console[_0x47dfa7(0x160)](_0x556691),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']='segment:parent:show';[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x1e3);async[a26_0x4cc703(0x207)](_0xec5d3){const _0x317817=a26_0x4cc703,{options:_0x20d909,args:_0x41fcae,tdx:_0x4d1899}=_0xec5d3,_0x61dc86=_0x41fcae[0x0]||_0x20d909[_0x317817(0x1e6)];if(!_0x61dc86)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'+'\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;_0x20d909[_0x317817(0x168)]&&(console[_0x317817(0xd5)]('Site:\x20'+_0x20d909['site']),console[_0x317817(0xd5)](_0x317817(0xea)+_0x61dc86));const _0x5adf8b=await withSpinner(_0x317817(0x1e9)+_0x61dc86+_0x317817(0x213),()=>_0x4d1899[_0x317817(0x1c6)][_0x317817(0x1c1)](_0x61dc86),{'verbose':_0x20d909[_0x317817(0x168)]}),_0x46c103=_0x5adf8b[_0x317817(0x209)],_0x538079=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x61dc86+_0x317817(0x213),()=>_0x4d1899[_0x317817(0x1c6)]['getParentSQL'](_0x46c103),{'verbose':_0x20d909[_0x317817(0x168)]});let _0x123fa3=_0x538079[_0x317817(0x209)];const _0x179a31=resolveLimit(_0x20d909[_0x317817(0x16c)],DEFAULT_DISPLAY_LIMIT),_0x508d3f=/\bLIMIT\s+\d+/i['test'](_0x123fa3);!_0x508d3f&&(_0x123fa3=_0x123fa3[_0x317817(0x206)]()[_0x317817(0x219)](/;+$/,''),_0x123fa3=_0x317817(0x132)+_0x123fa3+_0x317817(0xc8)+_0x179a31);_0x20d909[_0x317817(0x168)]&&console[_0x317817(0xd5)](_0x317817(0x170)+_0x123fa3);const _0x566088=await withProgressSpinner(_0x317817(0x175),async _0x4117c1=>{const _0x4d2eba=_0x317817,_0xaefa6b=await _0x4d1899[_0x4d2eba(0x14e)][_0x4d2eba(0x207)](_0x123fa3,{'catalog':'td','schema':_0x4d2eba(0x11a),'onJobId':_0x4a1057=>{const _0x3098f9=_0x4d2eba;_0x4117c1[_0x3098f9(0x16b)](_0x4a1057);}});return _0xaefa6b;},{'verbose':_0x20d909[_0x317817(0x168)]}),_0x370106=_0x566088[_0x317817(0x209)],_0x56a511=_0x370106['jobId']?_0x317817(0x235)+_0x370106[_0x317817(0x148)]+']':'';return console[_0x317817(0xd5)](_0x317817(0x18c)+_0x370106[_0x317817(0x1ef)]['processedRows']['toLocaleString']()+_0x317817(0x17b)+(_0x317817(0x153)+formatElapsed(_0x370106[_0x317817(0x1ef)][_0x317817(0xca)])+_0x56a511)),await handleQueryOutput(_0x370106,_0x20d909),0x0;}}export class PSRtListCommand extends BaseCommand{['name']='ps:rt:list';[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x20f);async[a26_0x4cc703(0x207)](_0xe934f4){const _0x3c845e=a26_0x4cc703,{options:_0x2eda7b,args:_0x33a480,tdx:_0x2d39ec}=_0xe934f4,_0x1a9b3e=_0x33a480[0x0],_0x6b899f=await withSpinner(_0x1a9b3e?_0x3c845e(0x1da)+_0x1a9b3e+_0x3c845e(0x213):_0x3c845e(0x142),()=>_0x2d39ec[_0x3c845e(0x1e1)][_0x3c845e(0x13a)](),{'verbose':_0x2eda7b[_0x3c845e(0x168)]});let _0x5df257=_0x6b899f[_0x3c845e(0x209)][_0x3c845e(0x107)](_0x353249=>_0x353249[_0x3c845e(0xf0)]);if(_0x1a9b3e){const _0xada4ef=_0x1a9b3e['replace'](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x3c845e(0x219)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4d434c=new RegExp('^'+_0xada4ef+'$','i');_0x5df257=_0x5df257[_0x3c845e(0x107)](_0xb4be55=>_0x4d434c[_0x3c845e(0x220)](_0xb4be55[_0x3c845e(0x201)]));}_0x5df257[_0x3c845e(0x21a)]((_0x198642,_0x3b9577)=>_0x198642['name']['localeCompare'](_0x3b9577[_0x3c845e(0x201)])),console[_0x3c845e(0xd5)]('✔\x20Found\x20'+_0x5df257[_0x3c845e(0x231)]+_0x3c845e(0xde)+(_0x5df257[_0x3c845e(0x231)]!==0x1?'s':''));const _0x104947=_0x1243b0=>{const _0x228143=_0x3c845e;return getConsoleNextUrl(_0x2eda7b['site'],_0x228143(0x1df)+_0x1243b0);};if(_0x2eda7b['format']==='json'||_0x2eda7b[_0x3c845e(0x224)]===_0x3c845e(0x191)){const _0x3dc182=_0x5df257['map'](_0x883376=>({..._0x883376,'url':_0x104947(_0x883376['id'])}));await handleSDKOutput(_0x3dc182,_0x2eda7b);}else{if(_0x5df257[_0x3c845e(0x231)]===0x0)console[_0x3c845e(0x160)](_0x3c845e(0xf2));else for(const _0x51a63d of _0x5df257){const _0x4faed0=_0x51a63d['population']?a26_0xc5b354[_0x3c845e(0x122)]('\x20('+formatRows(_0x51a63d['population'])+')'):'',_0x384f19=hyperlink(_0x51a63d['name'],_0x104947(_0x51a63d['id']));console[_0x3c845e(0x160)]('⚡\x20'+_0x384f19+_0x4faed0);}}return 0x0;}}function a26_0x7bf1(){const _0x5e9748=['72742RJhJXE','`\x20to\x20download\x20the\x20configuration\x20first','\x20total','✔\x20Renamed\x20directory\x20to\x20','displayAttributesStats','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','matchedCount','To\x20view\x20sample\x20data:','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','yellow','elapsedTimeMillis','addAttributesFile','attribute','\x20trigger=','\x0a⚠️\x20\x20Both\x20','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','\x20\x20\x20\x20','\x20--attribute\x20\x22','No\x20parent\x20segments\x20found','scheduleOption','database','error','Overwrite\x20\x27','tdx\x20ps\x20push\x20','Options:\x0a','getBehaviorNames','customerGroup','\x27\x20is\x20already\x20up\x20to\x20date','addAttributes','\x20rows)','\x20RT-enabled\x20parent\x20segment','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','Fetching\x20customers\x20schema...','Error:\x20--attribute\x20requires\x20a\x20name\x0a','\x0a\x20\x20]\x0a}\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment','117843EEjdBD','coveragePercent','\x0aNew\x20parent\x20segment\x20\x27','\x27\x20is\x20up\x20to\x20date','\x20personalization\x20service','Options\x20(one\x20required):\x0a','Parent\x20segment:\x20','apply','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','Validating\x20RT\x20configuration...','\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','sampleData','realtime_enabled','displayBehaviorsStats','No\x20RT-enabled\x20parent\x20segments\x20found','behavior','valid','\x20+\x20[','Error:\x20Parent\x20segment\x20name\x20is\x20required','72783siGhFx','\x20behaviors','toLowerCase','parent_segment','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','workflowId','listFields','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','displayValidateResults','primaryKey','bold','collectSchema','No\x20personalization\x20services\x20configured','\x20kill','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','filter','parent_segments','Creating','segment:parent:validate','7942535qinhSi','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Error\x20reading\x20file:\x20','\x20\x201.\x20Edit\x20','\x20No\x20changes\x20-\x20','✘\x20Failed\x20to\x20rename\x20directory:\x20','Join:','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','table','✔\x20Updated\x20parent\x20segment\x20\x27','customers','customersWithEvents','endsWith','.yml','pullParentYaml','information_schema','Error\x20parsing\x20YAML:\x20','\x20--attribute\x20\x22<name>\x22','YAML\x20file:\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','\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','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','dim','Aborted.','personalizationServices','\x20\x20No\x20sample\x20data\x20available','\x20section','green','start','Session:','ps:pz:list','ignore','win32','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Fetching\x20current\x20configuration\x20for\x20\x27','using\x20the\x20default\x20path:\x20','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','SELECT\x20*\x20FROM\x20(\x0a','Attempt:','/\x20→\x20','idStitching','validateParentYaml','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','web','\x0a\x20\x20\x20\x20]','list','map','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','customerPercent','👥\x20','column','cyan','\x20--interval\x20','Listing\x20RT-enabled\x20parent\x20segments...','\x20parent\x20segment','\x20\x20Database:\x20','segment:parent:update','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','\x20Configuration\x20is\x20valid','jobId','Show\x20parent\x20segment\x20details','utf-8','segment:parent:list','message','/attempt/','query','column_type','page_view','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','stitchingKeys','in\x20','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','json','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','indexOf','attributes','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','session','realtime:','2214530iULTKH','4lyfMaX','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','log','site','/{name}.yml\x0a','enriched','Master\x20+\x20Attributes','Columns:','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','verbose','displayPreviewHints','Analyzing\x20changes...','setJobId','limit','-1d','audienceId','behaviors','SQL\x20query:\x0a','My\x20Service','Listing\x20fields\x20for\x20\x27','workflowAttemptId','\x20--behavior\x20\x22','Executing\x20parent\x20segment\x20query...','formatSchemaJson','/\x20directories\x20exist.','/\x20and\x20','Status:','\x0a\x20\x20\x20\x20}','\x20rows\x20','interval','Attributes','Listing\x20personalization\x20services\x20for\x20\x27','dirname','reduce','Errors:','\x20\x20Columns:\x20','sections','\x20Added\x20personalization\x20template\x20to\x20','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','allValid','Listing\x20parent\x20segments...','pushParentYaml','/sessions/','✔\x20Query\x20completed:\x20Processed\x20','rowCount','createParent','<database>.<table>','segment:parent:sql','jsonl','Join\x20on:','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','Available\x20behaviors:','foreignKey','segment:parent:run','segment:parent:view','ps:pz:init','stop','/app/workflows/','Fetching\x20parent\x20segment\x20\x27','3525024xgtygP','displayMasterInfo','Apply\x20changes\x20to\x20\x27','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Error:\x20File\x20not\x20found:\x20','Updating\x20parent\x20segment\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','errors','\x22\x20}','last_page_viewed','behavior_','\x20\x20Tables:\x201\x20customers\x20+\x20','segment:parent:preview','ps:rt:validate','displaySampleData','\x20parent\x20segment\x20\x27','displayRealtimeInfo','45LPbuqn','\x20\x202.\x20Run\x20','output','Pattern:\x20','addBehaviors','Error:\x20--database\x20and\x20--table\x20are\x20required','{\x0a\x20\x20\x22database\x22:\x20\x22','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','red','No\x20parent\x20segments\x20match\x20pattern:\x20','attributesFile','List\x20parent\x20segments','Created','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','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Audience\x20ID:','Updated','\x20\x20\x20\x20-\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','resolveParentId','xdg-open','\x27\x20with\x20ID:\x20','Preview:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','segment','Error:','9rWhaUd','\x20\x20\x20\x20\x20\x20','\x0a⚠️\x20\x20Migrating:\x20','Personalization\x20service\x20description','getParentSQL','text','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','master','updateParent','Creating\x20parent\x20segment\x20\x27','personalization_services','segment:parent:desc','RT\x202.0\x20Validate:','schemaValid','Validate:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20to\x20configure\x20your\x20personalization\x20service','RT\x202.0:','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20service(s)\x20configured','\x20=\x20','Source:','events','/app/dw/parentSegments/','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','realtime','Enriched:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','\x0aUsage:\x20tdx\x20ps\x20preview\x20','parentSegment','Attributes:','displaySummary','Resolving\x20parent\x20segment\x20\x27','\x0aChanges\x20to\x20apply\x20to\x20\x27','Fetching\x20behavior\x20list...','joinKey','Create\x20parent\x20segment\x20\x27','Fetching\x20SQL\x20for\x20\x27','stats','\x20\x20Note:\x20','label','string','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','trigger_event','toFixed','\x0aNo\x20sample\x20data\x20available','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Site:\x20','Default','timezone','Events:','scheduleType','match','totalEvents','type','\x0aError:','name','schemaError','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','displayPreviewResults','yes','trim','execute','columns','data','\x20configured','\x20--enriched','579201PnnCUD','Attribute:','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','repeat','\x27...','single','\x20field','localeCompare','column_name','keys','replace','sort','tdx\x20ps\x20preview\x20','isDirectory','Master:','Output\x20file:\x20','getParentFull','test','\x27\x20and\x20run\x20workflow?','.customers)','number','format','enabled','displayColumns','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','ID\x20Stitching:','population','all','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','Listing\x20parent\x20segments\x20matching\x20\x27','Schema\x20saved\x20to\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','length','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','✔\x20Found\x20','2316OiOlJt','\x20[Job\x20ID:\x20','Fetching\x20sample\x20data...','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x20Opening\x20','status','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','description','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','/\x20directory.\x0a','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','segment:parent:create','darwin','120JXQzKS','\x0aChanges\x20to\x20\x27','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Name:\x20'];a26_0x7bf1=function(){return _0x5e9748;};return a26_0x7bf1();}export class PSRtValidateCommand extends BaseParentSegmentCommand{['name']=a26_0x4cc703(0x1aa);[a26_0x4cc703(0x23b)]=a26_0x4cc703(0x187);async[a26_0x4cc703(0x207)](_0x4a42a1){const _0x513d81=a26_0x4cc703,{options:_0xe1ae11,args:_0x5d559d,tdx:_0x56becf}=_0x4a42a1,_0x227cd0=_0x5d559d[0x0]||_0xe1ae11[_0x513d81(0x1e6)];if(!_0x227cd0)return showParentSegmentNotSetError(_0x513d81(0x23f)+_0x513d81(0xee)),0x1;const _0x3f2143=resolveYamlFile(_0x227cd0);if(!existsSync(_0x3f2143))return showFileNotFoundError(_0x3f2143,_0x227cd0),0x1;let _0x5b3e83;try{_0x5b3e83=readFileSync(_0x3f2143,_0x513d81(0x14a));}catch(_0x3c1365){const _0x58e693=_0x3c1365 instanceof Error?_0x3c1365['message']:String(_0x3c1365);return console['error']('Error\x20reading\x20file:\x20'+_0x58e693),0x1;}const _0x2dc178=createCommandSpinner(a26_0xc5b354[_0x513d81(0x122)](_0x513d81(0xed)),{'verbose':_0xe1ae11['verbose']});_0x2dc178[_0x513d81(0x128)]();const _0x2275c1={'realtime':!![],'onProgress':_0x18704e=>{const _0x53cb83=_0x513d81;_0x2dc178[_0x53cb83(0x1cd)]=formatProgressMessage(_0x18704e);}};let _0x5772a5;try{_0x5772a5=await _0x56becf['segment'][_0x513d81(0x136)](_0x5b3e83,_0x2275c1),_0x2dc178[_0x513d81(0x199)]();}catch(_0x292bf7){_0x2dc178[_0x513d81(0x199)]();throw _0x292bf7;}console[_0x513d81(0xd5)]('\x0a'+a26_0xc5b354[_0x513d81(0x102)](_0x513d81(0x1d4))+'\x20'+_0x5772a5[_0x513d81(0x201)]),console[_0x513d81(0xd5)]('═'['repeat'](0x3c)),displayRealtimeValidation(_0x5772a5),console[_0x513d81(0xd5)]('─'['repeat'](0x3c));if(_0x5772a5[_0x513d81(0x1a4)][_0x513d81(0x231)]>0x0){console[_0x513d81(0xd5)]('\x0a'+a26_0xc5b354[_0x513d81(0x1b6)]('Errors:'));for(const _0xd49ab of _0x5772a5[_0x513d81(0x1a4)]){console[_0x513d81(0xd5)]('\x20\x20'+a26_0xc5b354[_0x513d81(0x1b6)]('•')+'\x20'+_0xd49ab);}}return _0x5772a5[_0x513d81(0x188)]&&console['error']('\x0a'+a26_0xc5b354[_0x513d81(0x127)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x5772a5['allValid']?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x12a);['description']=a26_0x4cc703(0x1e4);async[a26_0x4cc703(0x207)](_0x213a0d){const _0x13d75a=a26_0x4cc703,{options:_0x56a19b,args:_0x44ab85,tdx:_0x530fc9}=_0x213a0d,_0x3844d0=_0x44ab85[0x0]||_0x56a19b[_0x13d75a(0x1e6)];if(!_0x3844d0)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+_0x13d75a(0xe3)),0x1;const _0x2307c5=await withSpinner(_0x13d75a(0x1e9)+_0x3844d0+_0x13d75a(0x213),()=>_0x530fc9['segment']['resolveParentId'](_0x3844d0),{'verbose':_0x56a19b['verbose']}),_0x21fea1=_0x2307c5['data'],_0x148486=await withSpinner(_0x13d75a(0x17e)+_0x3844d0+'\x27...',()=>_0x530fc9['personalization'][_0x13d75a(0x13a)](_0x21fea1),{'verbose':_0x56a19b[_0x13d75a(0x168)]}),_0x56a609=_0x148486[_0x13d75a(0x209)];console[_0x13d75a(0xd5)](_0x13d75a(0x233)+_0x56a609[_0x13d75a(0x231)]+_0x13d75a(0xe8)+(_0x56a609[_0x13d75a(0x231)]!==0x1?'s':''));if(_0x56a19b[_0x13d75a(0x224)]===_0x13d75a(0x155)||_0x56a19b[_0x13d75a(0x224)]===_0x13d75a(0x191))await handleSDKOutput(_0x56a609,_0x56a19b);else{if(_0x56a609[_0x13d75a(0x231)]===0x0)console[_0x13d75a(0x160)](_0x13d75a(0x104)),console['error'](a26_0xc5b354['cyan'](_0x13d75a(0x19f)));else for(const _0x1e92a8 of _0x56a609){const _0x408849=_0x1e92a8[_0x13d75a(0x183)]?.[_0x13d75a(0x231)]||0x0,_0x199500=_0x1e92a8[_0x13d75a(0x1f4)]?a26_0xc5b354[_0x13d75a(0x122)](_0x13d75a(0xcd)+_0x1e92a8[_0x13d75a(0x1f4)]):'',_0x3f15b2=a26_0xc5b354[_0x13d75a(0x122)]('\x20('+_0x408849+_0x13d75a(0x126)+(_0x408849!==0x1?'s':'')+')');console[_0x13d75a(0x160)]('\x20\x20'+_0x1e92a8[_0x13d75a(0x201)]+_0x199500+_0x3f15b2),_0x1e92a8[_0x13d75a(0x23b)]&&console['log'](_0x13d75a(0xd0)+a26_0xc5b354[_0x13d75a(0x122)](_0x1e92a8[_0x13d75a(0x23b)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a26_0x4cc703(0x201)]=a26_0x4cc703(0x198);[a26_0x4cc703(0x23b)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async['execute'](_0x24ebaa){const _0x4af99f=a26_0x4cc703,{options:_0x458b47,args:_0x459d30}=_0x24ebaa,_0x35e7e1=_0x459d30[0x0]||_0x458b47['parentSegment'];if(!_0x35e7e1)return showParentSegmentNotSetError(_0x4af99f(0x232)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x596a89=resolveYamlFile(_0x35e7e1);if(!existsSync(_0x596a89))return showFileNotFoundError(_0x596a89,_0x35e7e1),0x1;let _0x3fda37;try{_0x3fda37=readFileSync(_0x596a89,'utf-8');}catch(_0x386a82){const _0x5bbe40=_0x386a82 instanceof Error?_0x386a82[_0x4af99f(0x14c)]:String(_0x386a82);return console[_0x4af99f(0xd5)](_0x4af99f(0x10d)+_0x5bbe40),0x1;}let _0x523077;try{_0x523077=parseDef(_0x3fda37);}catch(_0x50adb6){const _0x30a280=_0x50adb6 instanceof Error?_0x50adb6[_0x4af99f(0x14c)]:String(_0x50adb6);return console[_0x4af99f(0xd5)](a26_0xc5b354[_0x4af99f(0x1b6)](_0x4af99f(0x11b)+_0x30a280)),0x1;}if(_0x523077[_0x4af99f(0x1d2)]&&_0x523077['personalization_services']['length']>0x0)return console['error'](a26_0xc5b354[_0x4af99f(0xc9)](_0x4af99f(0x23d)+_0x596a89)),console[_0x4af99f(0xd5)](a26_0xc5b354[_0x4af99f(0x122)]('\x20\x20\x20'+_0x523077['personalization_services']['length']+_0x4af99f(0x1db))),0x1;!_0x523077['realtime']&&(_0x523077[_0x4af99f(0x1e1)]={'events':[{'name':_0x4af99f(0x150),'source_table':_0x4af99f(0x18f)}],'attributes':[{'name':_0x4af99f(0x1a6),'type':_0x4af99f(0x214)}],'id_stitching':{'primary_key':_0x523077[_0x4af99f(0x1cf)][_0x4af99f(0x113)]==='customers'?'td_client_id':'user_id'}});_0x523077[_0x4af99f(0x1d2)]=[{'name':_0x4af99f(0x171),'description':_0x4af99f(0x1cb),'trigger_event':'page_view','sections':[{'name':_0x4af99f(0x1f9),'criteria':'true','attributes':[_0x4af99f(0x1a6)]}]}];const _0x325b4a=serializeDef(_0x523077);return writeFileSync(_0x596a89,_0x325b4a,_0x4af99f(0x14a)),console[_0x4af99f(0xd5)](a26_0xc5b354[_0x4af99f(0x127)]('✔')+_0x4af99f(0x184)+a26_0xc5b354[_0x4af99f(0x140)](_0x596a89)),(!_0x523077[_0x4af99f(0x1e1)]||_0x3fda37[_0x4af99f(0x157)](_0x4af99f(0x15b))===-0x1)&&console[_0x4af99f(0xd5)](a26_0xc5b354['green']('✔')+'\x20Added\x20RT\x202.0\x20template\x20section'),console[_0x4af99f(0xd5)]('\x0a'+a26_0xc5b354[_0x4af99f(0x122)]('Next\x20steps:')),console['error'](_0x4af99f(0x10e)+_0x596a89+_0x4af99f(0x1d8)),console['error'](_0x4af99f(0x1af)+a26_0xc5b354['dim'](_0x4af99f(0xd7)+_0x35e7e1)+'\x20to\x20push\x20the\x20configuration'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a27_0x3d1276=a27_0x173a;(function(_0x1dfce8,_0x895c7e){const _0x449c1d=a27_0x173a,_0x3554af=_0x1dfce8();while(!![]){try{const _0x570a22=parseInt(_0x449c1d(0x16c))/0x1*(-parseInt(_0x449c1d(0x199))/0x2)+-parseInt(_0x449c1d(0x17a))/0x3*(parseInt(_0x449c1d(0x16b))/0x4)+-parseInt(_0x449c1d(0x170))/0x5+parseInt(_0x449c1d(0x1b1))/0x6*(-parseInt(_0x449c1d(0x1bc))/0x7)+parseInt(_0x449c1d(0x15d))/0x8+-parseInt(_0x449c1d(0x162))/0x9*(-parseInt(_0x449c1d(0x1b4))/0xa)+parseInt(_0x449c1d(0x18d))/0xb*(parseInt(_0x449c1d(0x1a5))/0xc);if(_0x570a22===_0x895c7e)break;else _0x3554af['push'](_0x3554af['shift']());}catch(_0x64c450){_0x3554af['push'](_0x3554af['shift']());}}}(a27_0x5c36,0x4711f));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';function a27_0x5c36(){const _0xce877a=['database','Enter\x20site\x20name:','site','Default\x20profile\x20set\x20to:\x20','\x27\x20requires\x20API\x20key\x20validation.','parent_segment','password','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','Removal\x20cancelled','logLevel','Set\x20a\x20profile\x20configuration\x20value','tdx.json','confirm','Profile\x20name\x20cannot\x20be\x20empty','50039vUKnVE','log','profileName','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','us01','Changing\x20site\x20to\x20\x27','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','default','\x20Profile\x20\x27','Site\x20was\x20not\x20changed.','llm_agent','other','88980wIqEcO','\x20API\x20key\x20is\x20valid\x20(User:\x20','jobs','\x0aAvailable\x20profiles:','join','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','Enter\x20profile\x20name:','create','select','\x27\x20created','Remove\x20a\x20profile','warn','1548VayNsp','test','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','session','trim','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','\x20\x20-\x20','name','\x20API\x20key\x20removed\x20from\x20system\x20keychain','\x27\x20does\x20not\x20exist.\x20Create\x20it?','Enter\x20description\x20(optional):','split','12cyqMTF','green','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','10IseWfp','ERROR','text','\x0aOperation\x20cancelled','llm_project','length','tdx:\x20profile\x20remove','\x20--default\x27\x20to\x20save\x20permanently','219604KuxSkE','yellow','VALID_KEYS','Profile\x20\x27','dim','bold','\x27\x20removed\x20from\x20configuration','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','validate','Set\x20session\x20profile','/app/mp/ak','\x20\x20tdx\x20--profile\x20','customSite','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Validating\x20API\x20key...','2016352NwhQQy','You\x20can\x20find\x20your\x20API\x20key\x20at:','✗\x20Validation\x20failed:\x20','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','API\x20key\x20cannot\x20be\x20empty','3678507pECQFE','red','\x20\x20(no\x20profiles\x20found)','\x0aSetup\x20cancelled','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x27\x20does\x20not\x20exist.','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Session\x20profile\x20set\x20to:\x20','apiKey','12dtIOOz','6klLZFq','status','description','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','525970CftWey','error','Enter\x20your\x20TD\x20API\x20key:','Create\x20a\x20new\x20profile','profile','profile:remove','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','message','execute','tdx:\x20profile\x20create','521607EbYoFA','getUserInfo','Site\x20name\x20cannot\x20be\x20empty','tdx:\x20profile\x20set','Failed\x20to\x20remove\x20profile:\x20'];a27_0x5c36=function(){return _0xce877a;};return a27_0x5c36();}import{getConfigDir}from'../core/config.js';import*as a27_0x3c8cfe from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';function a27_0x173a(_0x1c8bae,_0xdcb550){_0x1c8bae=_0x1c8bae-0x152;const _0x5c3677=a27_0x5c36();let _0x173aaf=_0x5c3677[_0x1c8bae];return _0x173aaf;}import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a27_0x49a13a from'prompts';import a27_0xe88ae3 from'chalk';function validateProfileName(_0xae6ed){const _0x48c339=a27_0x173a;if(!_0xae6ed||!_0xae6ed[_0x48c339(0x1a9)]())return _0x48c339(0x18c);const _0x4e9a69=_0xae6ed[_0x48c339(0x1a9)]();if(!/^[a-zA-Z0-9_-]+$/[_0x48c339(0x1a6)](_0x4e9a69))return _0x48c339(0x1b3);if(profileExists(_0x4e9a69))return _0x48c339(0x1bf)+_0x4e9a69+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.';return!![];}export class ProfileCreateCommand extends BaseCommand{['name']='profile:create';[a27_0x3d1276(0x16e)]=a27_0x3d1276(0x173);async[a27_0x3d1276(0x178)](_0x495a9a){const _0x35c64d=a27_0x3d1276,{options:_0x1cfea7,args:_0x2c8196}=_0x495a9a;console[_0x35c64d(0x18e)](a27_0xe88ae3['bold'](_0x35c64d(0x179)));let _0x370a62;if(_0x2c8196[_0x35c64d(0x1b9)]>0x0&&_0x2c8196[0x0]){const _0x702131=_0x2c8196[0x0]['trim'](),_0x575b09=validateProfileName(_0x702131);if(_0x575b09!==!![])return console[_0x35c64d(0x171)](a27_0xe88ae3['red'](_0x575b09)),0x1;_0x370a62=_0x702131;}else{const _0x4bf925=await a27_0x49a13a({'type':'text','name':'profileName','message':_0x35c64d(0x19f),'validate':validateProfileName});if(!_0x4bf925[_0x35c64d(0x18f)])return console[_0x35c64d(0x18e)](_0x35c64d(0x165)),0x1;_0x370a62=_0x4bf925[_0x35c64d(0x18f)]['trim']();}const _0x15bb44=await a27_0x49a13a({'type':_0x35c64d(0x1b6),'name':_0x35c64d(0x16e),'message':_0x35c64d(0x1af)}),_0x32add7=_0x15bb44[_0x35c64d(0x16e)]?.[_0x35c64d(0x1a9)]()||undefined,_0x1c9abd=_0x1cfea7[_0x35c64d(0x181)]||_0x35c64d(0x191),{choices:_0x4abfdf,initialIndex:_0x3a0b60}=buildSiteChoices(_0x1c9abd),_0x22952c=await a27_0x49a13a({'type':_0x35c64d(0x1a1),'name':_0x35c64d(0x181),'message':_0x35c64d(0x19e)+_0x370a62+'\x27:','choices':_0x4abfdf,'initial':_0x3a0b60});if(!_0x22952c['site'])return console['log']('\x0aSetup\x20cancelled'),0x1;let _0x579ded;if(_0x22952c[_0x35c64d(0x181)]===_0x35c64d(0x198)){const _0x5121e8=await a27_0x49a13a({'type':'text','name':'customSite','message':_0x35c64d(0x180),'initial':_0x35c64d(0x191),'validate':_0x1b0266=>{const _0x46a1d9=_0x35c64d;if(!_0x1b0266||!_0x1b0266[_0x46a1d9(0x1a9)]())return _0x46a1d9(0x17c);if(!/^[a-z0-9-]+$/[_0x46a1d9(0x1a6)](_0x1b0266['trim']()))return _0x46a1d9(0x166);return!![];}});if(!_0x5121e8['customSite'])return console[_0x35c64d(0x18e)](_0x35c64d(0x165)),0x1;_0x579ded=_0x5121e8[_0x35c64d(0x15a)];}else _0x579ded=_0x22952c[_0x35c64d(0x181)];const _0x31163f=resolveSite(_0x579ded);console[_0x35c64d(0x18e)](_0x35c64d(0x155)+_0x31163f),console[_0x35c64d(0x18e)](_0x35c64d(0x15e)),console[_0x35c64d(0x18e)]('\x20\x20'+getConsoleUrl(_0x31163f,_0x35c64d(0x158)));const _0x282b55=await a27_0x49a13a({'type':_0x35c64d(0x185),'name':_0x35c64d(0x16a),'message':_0x35c64d(0x172),'validate':_0x2b3853=>{if(!_0x2b3853||!_0x2b3853['trim']())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x282b55[_0x35c64d(0x16a)])return console[_0x35c64d(0x18e)](_0x35c64d(0x165)),0x1;const _0x4127cd=_0x282b55[_0x35c64d(0x16a)];console[_0x35c64d(0x18e)](_0x35c64d(0x15c));try{const _0x3e88b8=TDX['create']({'site':_0x31163f,'apiKey':_0x4127cd[_0x35c64d(0x1a9)](),'logLevel':_0x1cfea7[_0x35c64d(0x188)]??LogLevel[_0x35c64d(0x1b5)]}),_0x28319b=await _0x3e88b8[_0x35c64d(0x19b)][_0x35c64d(0x17b)]();console['log'](a27_0xe88ae3[_0x35c64d(0x1b2)]('✓')+_0x35c64d(0x19a)+_0x28319b['email']+')');const _0x342d56=await isKeychainAvailable();_0x342d56?(await saveAPIKeyAsync(_0x4127cd[_0x35c64d(0x1a9)](),_0x31163f,_0x370a62),console[_0x35c64d(0x18e)](a27_0xe88ae3['green']('✓')+_0x35c64d(0x1a7)+_0x370a62+')')):(console['warn'](a27_0xe88ae3[_0x35c64d(0x1bd)](_0x35c64d(0x168))),console['warn'](a27_0xe88ae3[_0x35c64d(0x1bd)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x2cc4ef={'site':_0x31163f,..._0x32add7&&{'description':_0x32add7}};return saveProfileToUserConfig(_0x370a62,_0x2cc4ef),console[_0x35c64d(0x18e)](a27_0xe88ae3['green']('✓')+'\x20Profile\x20\x27'+_0x370a62+_0x35c64d(0x1a2)),console['log'](),console[_0x35c64d(0x18e)](_0x35c64d(0x193)),console[_0x35c64d(0x18e)](_0x35c64d(0x159)+_0x370a62+_0x35c64d(0x1aa)),console[_0x35c64d(0x18e)](_0x35c64d(0x159)+_0x370a62+_0x35c64d(0x186)),0x0;}catch(_0x42303c){if(_0x42303c instanceof HTTPClientError&&_0x42303c['status']===0x191)return printAuthError(_0x42303c),0x1;return console[_0x35c64d(0x171)](a27_0xe88ae3['red'](_0x35c64d(0x15f)+(_0x42303c instanceof Error?_0x42303c[_0x35c64d(0x177)]:String(_0x42303c)))),console['error'](_0x35c64d(0x15b)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a27_0x3d1276(0x1ac)]=a27_0x3d1276(0x175);[a27_0x3d1276(0x16e)]=a27_0x3d1276(0x1a3);[a27_0x3d1276(0x156)](_0x4eef08){const _0x35f674=a27_0x3d1276,{args:_0x2ea0b1}=_0x4eef08;if(_0x2ea0b1[_0x35f674(0x1b9)]===0x0)return _0x35f674(0x176);return undefined;}async['execute'](_0x30aed9){const _0x5008ab=a27_0x3d1276,{args:_0x32c1b9}=_0x30aed9,_0x521d49=_0x32c1b9[0x0];console['log'](a27_0xe88ae3[_0x5008ab(0x153)](_0x5008ab(0x1ba)));if(!profileExists(_0x521d49)){console[_0x5008ab(0x171)](a27_0xe88ae3[_0x5008ab(0x163)](_0x5008ab(0x1bf)+_0x521d49+_0x5008ab(0x167))),console[_0x5008ab(0x18e)](_0x5008ab(0x19c));const _0x1566b1=listProfiles();if(_0x1566b1['length']===0x0)console['log'](_0x5008ab(0x164));else for(const _0x559ba0 of _0x1566b1){console[_0x5008ab(0x18e)](_0x5008ab(0x1ab)+_0x559ba0[_0x5008ab(0x1ac)]);}return 0x1;}const _0x16eee5=await a27_0x49a13a({'type':_0x5008ab(0x18b),'name':_0x5008ab(0x18b),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x521d49+'\x27?','initial':![]});if(!_0x16eee5[_0x5008ab(0x18b)])return console[_0x5008ab(0x18e)](_0x5008ab(0x187)),0x0;try{removeProfileFromUserConfig(_0x521d49),console[_0x5008ab(0x18e)](a27_0xe88ae3[_0x5008ab(0x1b2)]('✓')+_0x5008ab(0x195)+_0x521d49+_0x5008ab(0x154));}catch(_0x404921){return console[_0x5008ab(0x171)](a27_0xe88ae3['red'](_0x5008ab(0x17e)+(_0x404921 instanceof Error?_0x404921[_0x5008ab(0x177)]:String(_0x404921)))),0x1;}const _0x17196a=await isKeychainAvailable();if(_0x17196a){const _0x4c29cf=await deleteKeychainAPIKey(_0x521d49);_0x4c29cf&&console[_0x5008ab(0x18e)](a27_0xe88ae3[_0x5008ab(0x1b2)]('✓')+_0x5008ab(0x1ad));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a27_0x3d1276(0x1ac)]='profile:set';[a27_0x3d1276(0x16e)]=a27_0x3d1276(0x189);static [a27_0x3d1276(0x1be)]=[a27_0x3d1276(0x181),a27_0x3d1276(0x17f),a27_0x3d1276(0x184),a27_0x3d1276(0x1b8),a27_0x3d1276(0x197),'description'];['validate'](_0x3f8888){const _0x4f29e9=a27_0x3d1276,{args:_0x282e09,options:_0x4f2b2c}=_0x3f8888,_0x1141f9=_0x4f2b2c['profile']||getActiveProfile();if(!_0x1141f9)return _0x4f29e9(0x190);if(_0x282e09[_0x4f29e9(0x1b9)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x4f29e9(0x1be)][_0x4f29e9(0x19d)](',\x20');const _0x1731bc=_0x282e09[0x0];if(!_0x1731bc['includes']('='))return _0x4f29e9(0x160)+ProfileSetCommand[_0x4f29e9(0x1be)][_0x4f29e9(0x19d)](',\x20');const [_0x309df2]=_0x1731bc[_0x4f29e9(0x1b0)]('=',0x2);if(!ProfileSetCommand[_0x4f29e9(0x1be)]['includes'](_0x309df2))return'Unknown\x20key\x20\x27'+_0x309df2+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x4f29e9(0x1be)][_0x4f29e9(0x19d)](',\x20');return undefined;}async[a27_0x3d1276(0x178)](_0x30f050){const _0x16c9c7=a27_0x3d1276,{args:_0x314559,options:_0x434e02}=_0x30f050,_0x526cd7=_0x434e02[_0x16c9c7(0x174)]||getActiveProfile(),[_0x149131,..._0x55d75c]=_0x314559[0x0]['split']('='),_0x1e298e=_0x55d75c['join']('=');console['log'](a27_0xe88ae3[_0x16c9c7(0x153)](_0x16c9c7(0x17d)));if(!profileExists(_0x526cd7)){const _0x24d83c=await a27_0x49a13a({'type':_0x16c9c7(0x18b),'name':'create','message':'Profile\x20\x27'+_0x526cd7+_0x16c9c7(0x1ae),'initial':!![]});if(!_0x24d83c[_0x16c9c7(0x1a0)])return console['log']('Operation\x20cancelled'),0x1;}const _0x5d33fd=loadProfile(_0x526cd7),_0x5a7129=_0x5d33fd?.['config']||{};if(_0x149131===_0x16c9c7(0x181)){const _0x5b6097=resolveSite(_0x1e298e);console[_0x16c9c7(0x18e)](_0x16c9c7(0x192)+_0x5b6097+_0x16c9c7(0x183)),console['log']('\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:'),console['log']('\x20\x20'+getConsoleUrl(_0x5b6097,_0x16c9c7(0x158)));const _0x53c92e=await a27_0x49a13a({'type':'password','name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x378ebf=>{const _0x30f136=_0x16c9c7;if(!_0x378ebf||!_0x378ebf['trim']())return _0x30f136(0x161);return!![];}});if(!_0x53c92e[_0x16c9c7(0x16a)])return console[_0x16c9c7(0x18e)](_0x16c9c7(0x1b7)),0x1;console[_0x16c9c7(0x18e)](_0x16c9c7(0x15c));try{const _0x18e3de=TDX[_0x16c9c7(0x1a0)]({'site':_0x5b6097,'apiKey':_0x53c92e['apiKey'][_0x16c9c7(0x1a9)](),'logLevel':_0x434e02[_0x16c9c7(0x188)]??LogLevel[_0x16c9c7(0x1b5)]}),_0x1f7f1a=await _0x18e3de[_0x16c9c7(0x19b)][_0x16c9c7(0x17b)]();console[_0x16c9c7(0x18e)](a27_0xe88ae3[_0x16c9c7(0x1b2)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x1f7f1a['email']+')');const _0x4138f2=await isKeychainAvailable();_0x4138f2?(await saveAPIKeyAsync(_0x53c92e[_0x16c9c7(0x16a)][_0x16c9c7(0x1a9)](),_0x5b6097,_0x526cd7),console['log'](a27_0xe88ae3[_0x16c9c7(0x1b2)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console[_0x16c9c7(0x1a4)](a27_0xe88ae3[_0x16c9c7(0x1bd)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x5a7129[_0x16c9c7(0x181)]=_0x5b6097;}catch(_0xe2d599){if(_0xe2d599 instanceof HTTPClientError&&_0xe2d599[_0x16c9c7(0x16d)]===0x191)return printAuthError(_0xe2d599),0x1;return console[_0x16c9c7(0x171)](a27_0xe88ae3[_0x16c9c7(0x163)]('✗\x20Validation\x20failed:\x20'+(_0xe2d599 instanceof Error?_0xe2d599[_0x16c9c7(0x177)]:String(_0xe2d599)))),console['error'](_0x16c9c7(0x196)),0x1;}}else _0x5a7129[_0x149131]=_0x1e298e||undefined;return saveProfileToUserConfig(_0x526cd7,_0x5a7129),console[_0x16c9c7(0x18e)](a27_0xe88ae3['green']('✓')+'\x20Profile\x20\x27'+_0x526cd7+'\x27\x20updated:\x20'+_0x149131+'='+(_0x1e298e||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{[a27_0x3d1276(0x1ac)]='profile:use';[a27_0x3d1276(0x16e)]=a27_0x3d1276(0x157);['validate'](_0x216000){const _0x13fc18=a27_0x3d1276,{args:_0x307aeb}=_0x216000;if(_0x307aeb[_0x13fc18(0x1b9)]===0x0)return _0x13fc18(0x16f);return undefined;}async[a27_0x3d1276(0x178)](_0x5d18fc){const _0x3b7456=a27_0x3d1276,{args:_0x16581c,options:_0x35d9a3}=_0x5d18fc,_0x3d3698=_0x16581c[0x0],_0x6b39ef=_0x35d9a3[_0x3b7456(0x194)];cleanExpiredSessions();if(!profileExists(_0x3d3698)){console['error'](a27_0xe88ae3[_0x3b7456(0x163)]('Profile\x20\x27'+_0x3d3698+_0x3b7456(0x167))),console[_0x3b7456(0x18e)](_0x3b7456(0x19c));const _0x1d8ef6=listProfiles();if(_0x1d8ef6[_0x3b7456(0x1b9)]===0x0)console[_0x3b7456(0x18e)](_0x3b7456(0x164));else for(const _0x223643 of _0x1d8ef6){console[_0x3b7456(0x18e)]('\x20\x20-\x20'+_0x223643[_0x3b7456(0x1ac)]);}return 0x1;}if(_0x6b39ef){const _0x3bf4e6=a27_0x3c8cfe[_0x3b7456(0x19d)](getConfigDir(),_0x3b7456(0x18a));return saveActiveProfileToUserConfig(_0x3d3698),console[_0x3b7456(0x18e)](_0x3b7456(0x182)+a27_0xe88ae3['green'](_0x3d3698)),console[_0x3b7456(0x18e)](a27_0xe88ae3['dim']('\x0aSaved\x20to:\x20'+_0x3bf4e6)),0x0;}const _0x17940a=getSessionID(_0x35d9a3[_0x3b7456(0x1a8)]);return saveSessionContext({'profile':_0x3d3698},_0x35d9a3[_0x3b7456(0x1a8)]),console[_0x3b7456(0x18e)](_0x3b7456(0x169)+a27_0xe88ae3[_0x3b7456(0x1b2)](_0x3d3698)+'\x20'+a27_0xe88ae3[_0x3b7456(0x152)]('(session:\x20'+_0x17940a+')')),console[_0x3b7456(0x18e)](a27_0xe88ae3['dim']('\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20'+_0x3d3698+_0x3b7456(0x1bb))),0x0;}}
|
|
1
|
+
const a27_0x1a9fc=a27_0x42d4;(function(_0x42d5e5,_0xf8e9a3){const _0x2b6c97=a27_0x42d4,_0x2c35d0=_0x42d5e5();while(!![]){try{const _0x4c77da=-parseInt(_0x2b6c97(0x178))/0x1*(-parseInt(_0x2b6c97(0x138))/0x2)+-parseInt(_0x2b6c97(0x13b))/0x3*(-parseInt(_0x2b6c97(0x154))/0x4)+parseInt(_0x2b6c97(0x15a))/0x5*(-parseInt(_0x2b6c97(0x153))/0x6)+-parseInt(_0x2b6c97(0x16e))/0x7*(-parseInt(_0x2b6c97(0x17d))/0x8)+parseInt(_0x2b6c97(0x12e))/0x9+parseInt(_0x2b6c97(0x17c))/0xa*(parseInt(_0x2b6c97(0x16d))/0xb)+-parseInt(_0x2b6c97(0x16b))/0xc;if(_0x4c77da===_0xf8e9a3)break;else _0x2c35d0['push'](_0x2c35d0['shift']());}catch(_0x523011){_0x2c35d0['push'](_0x2c35d0['shift']());}}}(a27_0x538f,0x39004));function a27_0x538f(){const _0xe12426=['Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','/app/mp/ak','create','6EOlZuQ','138788rfpONN','\x27\x20updated:\x20','API\x20key\x20cannot\x20be\x20empty','tdx:\x20profile\x20remove','\x20\x20(no\x20profiles\x20found)','parent_segment','1162955MTofme','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','Site\x20name\x20cannot\x20be\x20empty','database','Unknown\x20key\x20\x27','customSite','\x27\x20does\x20not\x20exist.\x20Create\x20it?','includes','password','\x0aSaved\x20to:\x20','red','\x20API\x20key\x20removed\x20from\x20system\x20keychain','log','Operation\x20cancelled','tdx.json','\x20Profile\x20\x27','jobs','12343752thGbSk','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','3668467JriiTB','7OwRyVE','description','us01','yellow','profile:set','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','execute','Remove\x20a\x20profile','email','confirm','13574kEOcMK','select','Changing\x20site\x20to\x20\x27','\x27.\x0a\x0aValid\x20keys:\x20','10ZhMMQa','2298136EpsfXr','bold','profileName','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','join','green','site','session','\x20\x20tdx\x20--profile\x20','Removal\x20cancelled','message','other','config','logLevel','validate','Validating\x20API\x20key...','Enter\x20site\x20name:','Create\x20a\x20new\x20profile','ERROR','\x0aAvailable\x20profiles:','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','profile:remove','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x27\x20created','Profile\x20name\x20cannot\x20be\x20empty','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','split','profile:create','profile','dim','profile:use','\x0aSetup\x20cancelled','warn','3779199dAxqai','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','name','(cleared)','llm_agent','default','Site\x20was\x20not\x20changed.','VALID_KEYS','Session\x20profile\x20set\x20to:\x20','26IddJxo','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x20\x20-\x20','24eHGSuH','trim','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Failed\x20to\x20remove\x20profile:\x20','text','✗\x20Validation\x20failed:\x20','You\x20can\x20find\x20your\x20API\x20key\x20at:','length','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','\x27\x20does\x20not\x20exist.','Profile\x20\x27','test','Enter\x20profile\x20name:','apiKey','Set\x20session\x20profile','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','getUserInfo','\x20API\x20key\x20is\x20valid\x20(User:\x20','error'];a27_0x538f=function(){return _0xe12426;};return a27_0x538f();}import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a27_0x143765 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a27_0x42d4(_0x3339af,_0xdd8d2d){_0x3339af=_0x3339af-0x12d;const _0x538f31=a27_0x538f();let _0x42d45b=_0x538f31[_0x3339af];return _0x42d45b;}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a27_0x234cb9 from'prompts';import a27_0x1adff7 from'chalk';function validateProfileName(_0x29d1ab){const _0x5be6c3=a27_0x42d4;if(!_0x29d1ab||!_0x29d1ab[_0x5be6c3(0x13c)]())return _0x5be6c3(0x197);const _0x1729b4=_0x29d1ab[_0x5be6c3(0x13c)]();if(!/^[a-zA-Z0-9_-]+$/[_0x5be6c3(0x146)](_0x1729b4))return _0x5be6c3(0x14b);if(profileExists(_0x1729b4))return _0x5be6c3(0x145)+_0x1729b4+_0x5be6c3(0x16c);return!![];}export class ProfileCreateCommand extends BaseCommand{[a27_0x1a9fc(0x131)]=a27_0x1a9fc(0x19a);['description']=a27_0x1a9fc(0x190);async[a27_0x1a9fc(0x174)](_0x5d4e90){const _0x429347=a27_0x1a9fc,{options:_0x5a607d,args:_0x313ff4}=_0x5d4e90;console[_0x429347(0x166)](a27_0x1adff7[_0x429347(0x17e)]('tdx:\x20profile\x20create'));let _0x4c353d;if(_0x313ff4[_0x429347(0x142)]>0x0&&_0x313ff4[0x0]){const _0xb97a3=_0x313ff4[0x0][_0x429347(0x13c)](),_0x5381f3=validateProfileName(_0xb97a3);if(_0x5381f3!==!![])return console[_0x429347(0x14f)](a27_0x1adff7[_0x429347(0x164)](_0x5381f3)),0x1;_0x4c353d=_0xb97a3;}else{const _0x8dcd9d=await a27_0x234cb9({'type':_0x429347(0x13f),'name':_0x429347(0x17f),'message':_0x429347(0x147),'validate':validateProfileName});if(!_0x8dcd9d['profileName'])return console['log'](_0x429347(0x19e)),0x1;_0x4c353d=_0x8dcd9d['profileName'][_0x429347(0x13c)]();}const _0x3fc097=await a27_0x234cb9({'type':_0x429347(0x13f),'name':_0x429347(0x16f),'message':'Enter\x20description\x20(optional):'}),_0x5f4f1c=_0x3fc097[_0x429347(0x16f)]?.[_0x429347(0x13c)]()||undefined,_0x54dbde=_0x5a607d[_0x429347(0x185)]||_0x429347(0x170),{choices:_0x3f755a,initialIndex:_0x428414}=buildSiteChoices(_0x54dbde),_0x253094=await a27_0x234cb9({'type':_0x429347(0x179),'name':'site','message':_0x429347(0x180)+_0x4c353d+'\x27:','choices':_0x3f755a,'initial':_0x428414});if(!_0x253094[_0x429347(0x185)])return console[_0x429347(0x166)]('\x0aSetup\x20cancelled'),0x1;let _0x4226da;if(_0x253094[_0x429347(0x185)]===_0x429347(0x18a)){const _0x139d08=await a27_0x234cb9({'type':_0x429347(0x13f),'name':'customSite','message':_0x429347(0x18f),'initial':_0x429347(0x170),'validate':_0x3d58fc=>{const _0x4d50e7=_0x429347;if(!_0x3d58fc||!_0x3d58fc[_0x4d50e7(0x13c)]())return _0x4d50e7(0x15c);if(!/^[a-z0-9-]+$/['test'](_0x3d58fc[_0x4d50e7(0x13c)]()))return _0x4d50e7(0x181);return!![];}});if(!_0x139d08['customSite'])return console['log'](_0x429347(0x19e)),0x1;_0x4226da=_0x139d08[_0x429347(0x15f)];}else _0x4226da=_0x253094['site'];const _0x246596=resolveSite(_0x4226da);console[_0x429347(0x166)]('\x0aSetting\x20up\x20authentication\x20for\x20site:\x20'+_0x246596),console['log'](_0x429347(0x141)),console[_0x429347(0x166)]('\x20\x20'+getConsoleUrl(_0x246596,'/app/mp/ak'));const _0x4c9a39=await a27_0x234cb9({'type':_0x429347(0x162),'name':_0x429347(0x148),'message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x1544f5=>{const _0x11f4f7=_0x429347;if(!_0x1544f5||!_0x1544f5[_0x11f4f7(0x13c)]())return _0x11f4f7(0x156);return!![];}});if(!_0x4c9a39[_0x429347(0x148)])return console[_0x429347(0x166)](_0x429347(0x19e)),0x1;const _0x3e08da=_0x4c9a39['apiKey'];console['log'](_0x429347(0x18e));try{const _0x5a0c21=TDX['create']({'site':_0x246596,'apiKey':_0x3e08da[_0x429347(0x13c)](),'logLevel':_0x5a607d['logLevel']??LogLevel[_0x429347(0x191)]}),_0x58018b=await _0x5a0c21['jobs'][_0x429347(0x14d)]();console[_0x429347(0x166)](a27_0x1adff7['green']('✓')+_0x429347(0x14e)+_0x58018b[_0x429347(0x176)]+')');const _0x563939=await isKeychainAvailable();_0x563939?(await saveAPIKeyAsync(_0x3e08da['trim'](),_0x246596,_0x4c353d),console[_0x429347(0x166)](a27_0x1adff7[_0x429347(0x184)]('✓')+_0x429347(0x182)+_0x4c353d+')')):(console['warn'](a27_0x1adff7[_0x429347(0x171)](_0x429347(0x193))),console[_0x429347(0x12d)](a27_0x1adff7[_0x429347(0x171)](_0x429347(0x12f))));const _0x5d58c3={'site':_0x246596,..._0x5f4f1c&&{'description':_0x5f4f1c}};return saveProfileToUserConfig(_0x4c353d,_0x5d58c3),console[_0x429347(0x166)](a27_0x1adff7[_0x429347(0x184)]('✓')+_0x429347(0x169)+_0x4c353d+_0x429347(0x196)),console['log'](),console[_0x429347(0x166)](_0x429347(0x139)),console[_0x429347(0x166)](_0x429347(0x187)+_0x4c353d+'\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication'),console[_0x429347(0x166)](_0x429347(0x187)+_0x4c353d+_0x429347(0x195)),0x0;}catch(_0x34c294){if(_0x34c294 instanceof HTTPClientError&&_0x34c294['status']===0x191)return printAuthError(_0x34c294),0x1;return console[_0x429347(0x14f)](a27_0x1adff7[_0x429347(0x164)](_0x429347(0x140)+(_0x34c294 instanceof Error?_0x34c294[_0x429347(0x189)]:String(_0x34c294)))),console[_0x429347(0x14f)](_0x429347(0x198)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a27_0x1a9fc(0x131)]=a27_0x1a9fc(0x194);[a27_0x1a9fc(0x16f)]=a27_0x1a9fc(0x175);[a27_0x1a9fc(0x18d)](_0x525c4b){const _0x46747e=a27_0x1a9fc,{args:_0xa11981}=_0x525c4b;if(_0xa11981[_0x46747e(0x142)]===0x0)return _0x46747e(0x15b);return undefined;}async[a27_0x1a9fc(0x174)](_0x10c79b){const _0x57482d=a27_0x1a9fc,{args:_0x5068b0}=_0x10c79b,_0x3b3c0b=_0x5068b0[0x0];console[_0x57482d(0x166)](a27_0x1adff7[_0x57482d(0x17e)](_0x57482d(0x157)));if(!profileExists(_0x3b3c0b)){console[_0x57482d(0x14f)](a27_0x1adff7[_0x57482d(0x164)](_0x57482d(0x145)+_0x3b3c0b+_0x57482d(0x144))),console[_0x57482d(0x166)](_0x57482d(0x192));const _0x5564ce=listProfiles();if(_0x5564ce['length']===0x0)console['log']('\x20\x20(no\x20profiles\x20found)');else for(const _0x14c784 of _0x5564ce){console[_0x57482d(0x166)](_0x57482d(0x13a)+_0x14c784[_0x57482d(0x131)]);}return 0x1;}const _0x449e77=await a27_0x234cb9({'type':'confirm','name':_0x57482d(0x177),'message':_0x57482d(0x143)+_0x3b3c0b+'\x27?','initial':![]});if(!_0x449e77['confirm'])return console[_0x57482d(0x166)](_0x57482d(0x188)),0x0;try{removeProfileFromUserConfig(_0x3b3c0b),console[_0x57482d(0x166)](a27_0x1adff7['green']('✓')+_0x57482d(0x169)+_0x3b3c0b+'\x27\x20removed\x20from\x20configuration');}catch(_0x31efe1){return console[_0x57482d(0x14f)](a27_0x1adff7['red'](_0x57482d(0x13e)+(_0x31efe1 instanceof Error?_0x31efe1[_0x57482d(0x189)]:String(_0x31efe1)))),0x1;}const _0x290682=await isKeychainAvailable();if(_0x290682){const _0x2c85fd=await deleteKeychainAPIKey(_0x3b3c0b);_0x2c85fd&&console[_0x57482d(0x166)](a27_0x1adff7[_0x57482d(0x184)]('✓')+_0x57482d(0x165));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a27_0x1a9fc(0x131)]=a27_0x1a9fc(0x172);['description']='Set\x20a\x20profile\x20configuration\x20value';static [a27_0x1a9fc(0x136)]=['site',a27_0x1a9fc(0x15d),a27_0x1a9fc(0x159),'llm_project',a27_0x1a9fc(0x133),a27_0x1a9fc(0x16f)];['validate'](_0x2a6f77){const _0x3453c5=a27_0x1a9fc,{args:_0x2cc7b3,options:_0x57db0a}=_0x2a6f77,_0xb30328=_0x57db0a['profile']||getActiveProfile();if(!_0xb30328)return _0x3453c5(0x130);if(_0x2cc7b3[_0x3453c5(0x142)]===0x0)return'Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS'][_0x3453c5(0x183)](',\x20');const _0x26e126=_0x2cc7b3[0x0];if(!_0x26e126[_0x3453c5(0x161)]('='))return _0x3453c5(0x13d)+ProfileSetCommand[_0x3453c5(0x136)][_0x3453c5(0x183)](',\x20');const [_0x24010e]=_0x26e126[_0x3453c5(0x199)]('=',0x2);if(!ProfileSetCommand[_0x3453c5(0x136)][_0x3453c5(0x161)](_0x24010e))return _0x3453c5(0x15e)+_0x24010e+_0x3453c5(0x17b)+ProfileSetCommand[_0x3453c5(0x136)]['join'](',\x20');return undefined;}async[a27_0x1a9fc(0x174)](_0x269bae){const _0x55d984=a27_0x1a9fc,{args:_0x5a2d25,options:_0x5cab5e}=_0x269bae,_0x551394=_0x5cab5e[_0x55d984(0x19b)]||getActiveProfile(),[_0x34ed82,..._0x51a786]=_0x5a2d25[0x0][_0x55d984(0x199)]('='),_0x1b2801=_0x51a786[_0x55d984(0x183)]('=');console[_0x55d984(0x166)](a27_0x1adff7[_0x55d984(0x17e)]('tdx:\x20profile\x20set'));if(!profileExists(_0x551394)){const _0x3c732b=await a27_0x234cb9({'type':_0x55d984(0x177),'name':_0x55d984(0x152),'message':_0x55d984(0x145)+_0x551394+_0x55d984(0x160),'initial':!![]});if(!_0x3c732b[_0x55d984(0x152)])return console[_0x55d984(0x166)](_0x55d984(0x167)),0x1;}const _0x408a6f=loadProfile(_0x551394),_0x7bec7f=_0x408a6f?.[_0x55d984(0x18b)]||{};if(_0x34ed82===_0x55d984(0x185)){const _0x269d13=resolveSite(_0x1b2801);console[_0x55d984(0x166)](_0x55d984(0x17a)+_0x269d13+'\x27\x20requires\x20API\x20key\x20validation.'),console[_0x55d984(0x166)](_0x55d984(0x14a)),console[_0x55d984(0x166)]('\x20\x20'+getConsoleUrl(_0x269d13,_0x55d984(0x151)));const _0x54e8f5=await a27_0x234cb9({'type':_0x55d984(0x162),'name':_0x55d984(0x148),'message':_0x55d984(0x173),'validate':_0x513398=>{const _0x3f9d67=_0x55d984;if(!_0x513398||!_0x513398[_0x3f9d67(0x13c)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x54e8f5[_0x55d984(0x148)])return console[_0x55d984(0x166)]('\x0aOperation\x20cancelled'),0x1;console[_0x55d984(0x166)](_0x55d984(0x18e));try{const _0x3cb111=TDX[_0x55d984(0x152)]({'site':_0x269d13,'apiKey':_0x54e8f5['apiKey'][_0x55d984(0x13c)](),'logLevel':_0x5cab5e[_0x55d984(0x18c)]??LogLevel[_0x55d984(0x191)]}),_0x218df9=await _0x3cb111[_0x55d984(0x16a)][_0x55d984(0x14d)]();console[_0x55d984(0x166)](a27_0x1adff7['green']('✓')+_0x55d984(0x14e)+_0x218df9['email']+')');const _0x4f8157=await isKeychainAvailable();_0x4f8157?(await saveAPIKeyAsync(_0x54e8f5[_0x55d984(0x148)][_0x55d984(0x13c)](),_0x269d13,_0x551394),console['log'](a27_0x1adff7[_0x55d984(0x184)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain')):console['warn'](a27_0x1adff7['yellow']('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x7bec7f[_0x55d984(0x185)]=_0x269d13;}catch(_0x4f6913){if(_0x4f6913 instanceof HTTPClientError&&_0x4f6913['status']===0x191)return printAuthError(_0x4f6913),0x1;return console['error'](a27_0x1adff7[_0x55d984(0x164)](_0x55d984(0x140)+(_0x4f6913 instanceof Error?_0x4f6913['message']:String(_0x4f6913)))),console[_0x55d984(0x14f)](_0x55d984(0x135)),0x1;}}else _0x7bec7f[_0x34ed82]=_0x1b2801||undefined;return saveProfileToUserConfig(_0x551394,_0x7bec7f),console['log'](a27_0x1adff7[_0x55d984(0x184)]('✓')+_0x55d984(0x169)+_0x551394+_0x55d984(0x155)+_0x34ed82+'='+(_0x1b2801||_0x55d984(0x132))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a27_0x1a9fc(0x131)]=a27_0x1a9fc(0x19d);[a27_0x1a9fc(0x16f)]=a27_0x1a9fc(0x149);[a27_0x1a9fc(0x18d)](_0x470631){const _0x36b81a=a27_0x1a9fc,{args:_0x101887}=_0x470631;if(_0x101887[_0x36b81a(0x142)]===0x0)return _0x36b81a(0x150);return undefined;}async['execute'](_0x576bba){const _0x42e012=a27_0x1a9fc,{args:_0x5bc209,options:_0x1a1013}=_0x576bba,_0x1db5a1=_0x5bc209[0x0],_0x59643f=_0x1a1013[_0x42e012(0x134)];cleanExpiredSessions();if(!profileExists(_0x1db5a1)){console[_0x42e012(0x14f)](a27_0x1adff7[_0x42e012(0x164)](_0x42e012(0x145)+_0x1db5a1+_0x42e012(0x144))),console[_0x42e012(0x166)](_0x42e012(0x192));const _0x27f12b=listProfiles();if(_0x27f12b[_0x42e012(0x142)]===0x0)console[_0x42e012(0x166)](_0x42e012(0x158));else for(const _0x3d23f0 of _0x27f12b){console[_0x42e012(0x166)]('\x20\x20-\x20'+_0x3d23f0[_0x42e012(0x131)]);}return 0x1;}if(_0x59643f){const _0x4d2969=a27_0x143765[_0x42e012(0x183)](getConfigDir(),_0x42e012(0x168));return saveActiveProfileToUserConfig(_0x1db5a1),console[_0x42e012(0x166)]('Default\x20profile\x20set\x20to:\x20'+a27_0x1adff7[_0x42e012(0x184)](_0x1db5a1)),console['log'](a27_0x1adff7[_0x42e012(0x19c)](_0x42e012(0x163)+_0x4d2969)),0x0;}const _0x408d72=getSessionID(_0x1a1013[_0x42e012(0x186)]);return saveSessionContext({'profile':_0x1db5a1},_0x1a1013[_0x42e012(0x186)]),console['log'](_0x42e012(0x137)+a27_0x1adff7[_0x42e012(0x184)](_0x1db5a1)+'\x20'+a27_0x1adff7[_0x42e012(0x19c)]('(session:\x20'+_0x408d72+')')),console[_0x42e012(0x166)](a27_0x1adff7[_0x42e012(0x19c)](_0x42e012(0x14c)+_0x1db5a1+'\x20--default\x27\x20to\x20save\x20permanently')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x3cd73a=a28_0x5073;(function(_0x5baf24,_0x511f06){const _0x4bec50=a28_0x5073,_0x5470e2=_0x5baf24();while(!![]){try{const _0xb7f881=-parseInt(_0x4bec50(0x1f6))/0x1+-parseInt(_0x4bec50(0x1fc))/0x2+-parseInt(_0x4bec50(0x1f3))/0x3*(-parseInt(_0x4bec50(0x1f4))/0x4)+-parseInt(_0x4bec50(0x1f5))/0x5+parseInt(_0x4bec50(0x1fa))/0x6+-parseInt(_0x4bec50(0x1fd))/0x7*(parseInt(_0x4bec50(0x200))/0x8)+parseInt(_0x4bec50(0x1f9))/0x9;if(_0xb7f881===_0x511f06)break;else _0x5470e2['push'](_0x5470e2['shift']());}catch(_0x2382c8){_0x5470e2['push'](_0x5470e2['shift']());}}}(a28_0x2fa0,0x923cc));function a28_0x2fa0(){const _0x1e5310=['config','2386772pwBSqM','2114bpKUSY','profiles','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','28664TpBJMd','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','description','List\x20all\x20available\x20profiles','scope','map','log','execute','255666vribNH','16gazyPv','2612170WpLwro','943847IFluTc','Error:\x20','name','30927204IMyHan','3380862JhjakH'];a28_0x2fa0=function(){return _0x1e5310;};return a28_0x2fa0();}function a28_0x5073(_0x3f40de,_0x549027){_0x3f40de=_0x3f40de-0x1ee;const _0x2fa071=a28_0x2fa0();let _0x5073e4=_0x2fa071[_0x3f40de];return _0x5073e4;}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a28_0x3cd73a(0x1f8)]=a28_0x3cd73a(0x1fe);[a28_0x3cd73a(0x202)]=a28_0x3cd73a(0x1ee);async[a28_0x3cd73a(0x1f2)](_0x47e020){const _0xb0fb60=a28_0x3cd73a,{options:_0x4f66ae}=_0x47e020;try{const _0x438f1b=listProfiles(),_0x456721=getActiveProfile();if(_0x438f1b['length']===0x0)return console[_0xb0fb60(0x1f1)](_0xb0fb60(0x201)),console['log'](_0xb0fb60(0x1ff)),console['log']('\x20\x20Global:\x20~/.config/tdx/tdx.json'),0x0;const _0x47b3ea=_0x438f1b[_0xb0fb60(0x1f0)](_0x877be4=>{const _0x5e3e7e=_0xb0fb60,_0x61184f=_0x877be4[_0x5e3e7e(0x1f8)]===_0x456721,_0x200e7b=getProfileParams(_0x877be4[_0x5e3e7e(0x1fb)]);return{'name':_0x877be4[_0x5e3e7e(0x1f8)],'active':_0x61184f,'scope':_0x877be4[_0x5e3e7e(0x1ef)],'description':_0x877be4['config'][_0x5e3e7e(0x202)]||'','params':_0x200e7b};});return await handleSDKOutput(_0x47b3ea,_0x4f66ae),0x0;}catch(_0x10c1b8){return _0x10c1b8 instanceof Error&&console['error'](_0xb0fb60(0x1f7)+_0x10c1b8['message']),0x1;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x1b2b6a=a29_0x2907;(function(_0x11d419,_0x4a9dd1){const _0x560532=a29_0x2907,_0x2ec3fd=_0x11d419();while(!![]){try{const _0x37492c=parseInt(_0x560532(0x1cf))/0x1+parseInt(_0x560532(0x1a2))/0x2+parseInt(_0x560532(0x1a1))/0x3*(parseInt(_0x560532(0x1aa))/0x4)+parseInt(_0x560532(0x1cb))/0x5*(-parseInt(_0x560532(0x1b3))/0x6)+parseInt(_0x560532(0x1ce))/0x7+parseInt(_0x560532(0x1b1))/0x8*(-parseInt(_0x560532(0x1a0))/0x9)+-parseInt(_0x560532(0x1c6))/0xa*(parseInt(_0x560532(0x1c5))/0xb);if(_0x37492c===_0x4a9dd1)break;else _0x2ec3fd['push'](_0x2ec3fd['shift']());}catch(_0x1d6923){_0x2ec3fd['push'](_0x2ec3fd['shift']());}}}(a29_0xd2c0,0xc1499));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';function a29_0xd2c0(){const _0xda2a72=['setJobId','originalMessage','57816TJKERT','jobId','18LyxsNr','No\x20SQL\x20provided','output','SQL:\x20','message','Site:\x20','Catalog:\x20','\x20rows\x20','\x20[Job\x20ID:\x20','in\x20','elapsedTimeMillis','Query\x20completed:\x20Processed\x20','Error:\x20','args','Statement\x20','query','verbose','setPhase','549626uXNWeQ','30dfHxqQ','site','execute','...','information_schema','1234015DJhoeS','state','Executing\x20query\x20[','5168163qcZkKi','1367830qwBauE','data','Executing\x20statement\x20','stats','1818egKVFG','1611222uZVUyL','997306nsEiEF','setExtra','join','options','length','error','totalSplits','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','4QpCdxS','Schema:\x20','file','\x20splits','name'];a29_0xd2c0=function(){return _0xda2a72;};return a29_0xd2c0();}import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';function a29_0x2907(_0x5d8321,_0x26764e){_0x5d8321=_0x5d8321-0x1a0;const _0xd2c060=a29_0xd2c0();let _0x290781=_0xd2c060[_0x5d8321];return _0x290781;}import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a29_0x1b2b6a(0x1ae)]=a29_0x1b2b6a(0x1c2);['description']='Run\x20Trino\x20queries\x20(streaming)';async[a29_0x1b2b6a(0x1c8)](_0x3c5d56){const _0x5ce625=a29_0x1b2b6a,{options:_0x5413eb,args:_0x647bc2,tdx:_0x4a057f}=_0x3c5d56,_0x2ff915=_0x647bc2[0x0],_0x14b852=_0x5413eb[_0x5ce625(0x1ac)];let _0x864ef1;try{if(_0x14b852)_0x864ef1=readSqlStatementsFromFile(_0x14b852);else{if(_0x2ff915==='-')_0x864ef1=await readSqlStatementsFromStdin();else{if(_0x2ff915&&isSqlFilePath(_0x2ff915))_0x864ef1=readSqlStatementsFromFile(_0x2ff915);else{if(_0x2ff915)_0x864ef1=splitSqlStatements(_0x2ff915);else throw new Error(_0x5ce625(0x1b4));}}}}catch(_0x1da554){return console[_0x5ce625(0x1a7)](_0x5ce625(0x1bf)+_0x1da554[_0x5ce625(0x1b7)]),0x1;}const _0x182775=_0x5413eb['database']||_0x5ce625(0x1ca),_0x537439=_0x5413eb['catalog'];try{const _0xe62960=[],_0x329516=!!_0x5413eb[_0x5ce625(0x1b5)];for(let _0x21c727=0x0;_0x21c727<_0x864ef1[_0x5ce625(0x1a6)];_0x21c727++){const _0x1246ae=_0x864ef1[_0x21c727],_0x1e530e=_0x21c727+0x1,_0x1bbf0b=_0x864ef1[_0x5ce625(0x1a6)],_0x45be67=_0x1bbf0b>0x1;_0x5413eb[_0x5ce625(0x1c3)]&&(console[_0x5ce625(0x1a7)]('\x0a'+(_0x45be67?_0x5ce625(0x1c1)+_0x1e530e+'/'+_0x1bbf0b+':':'')),console[_0x5ce625(0x1a7)](_0x5ce625(0x1b8)+_0x5413eb[_0x5ce625(0x1c7)]),console[_0x5ce625(0x1a7)](_0x5ce625(0x1b9)+(_0x537439||'td')),console['error'](_0x5ce625(0x1ab)+_0x182775),console[_0x5ce625(0x1a7)](_0x5ce625(0x1b6)+_0x1246ae));const _0x173852=_0x45be67?_0x5ce625(0x1d1)+_0x1e530e+'/'+_0x1bbf0b+_0x5ce625(0x1c9):'Executing\x20query...';try{const _0x4cfb44=await withProgressSpinner(_0x173852,async _0x3f06ef=>{const _0x268d11=_0x5ce625,_0x137940=await _0x4a057f[_0x268d11(0x1c2)][_0x268d11(0x1c8)](_0x1246ae,{'catalog':_0x537439,'schema':_0x182775,'onJobId':_0x5abaca=>{const _0x592d17=_0x268d11;_0x3f06ef[_0x592d17(0x1af)](_0x5abaca);},'onProgress':_0x588b73=>{const _0x4e66ce=_0x268d11;_0x3f06ef[_0x4e66ce(0x1c4)](_0x4e66ce(0x1cd)+_0x588b73[_0x4e66ce(0x1cc)]+']'),_0x3f06ef[_0x4e66ce(0x1a3)](formatRows(_0x588b73['processedRows'])+'\x20rows\x20'+_0x588b73['completedSplits']+'/'+_0x588b73[_0x4e66ce(0x1a8)]+_0x4e66ce(0x1ad));}});return _0x137940;},{'verbose':_0x5413eb['verbose']}),_0x58ee05=_0x4cfb44[_0x5ce625(0x1d0)],_0x2ff845=_0x58ee05[_0x5ce625(0x1b2)]?_0x5ce625(0x1bb)+_0x58ee05[_0x5ce625(0x1b2)]+']':'',_0x675db=_0x45be67?_0x5ce625(0x1c1)+_0x1e530e+'/'+_0x1bbf0b+'\x20-\x20':'';console[_0x5ce625(0x1a7)]('✔\x20'+_0x675db+_0x5ce625(0x1be)+formatRows(_0x58ee05[_0x5ce625(0x1d2)]['processedRows'])+_0x5ce625(0x1ba)+(_0x5ce625(0x1bc)+formatElapsed(_0x58ee05[_0x5ce625(0x1d2)][_0x5ce625(0x1bd)])+_0x2ff845));if(_0x45be67&&_0x329516){const _0x397833=resolveOutputOptions(_0x5413eb),_0x231c81=await formatQueryOutput(_0x58ee05,_0x397833);_0xe62960['push'](_0x231c81);}else await handleQueryOutput(_0x58ee05,_0x5413eb);}catch(_0x30d736){const _0x50bb94=_0x45be67?_0x5ce625(0x1c1)+_0x1e530e+'/'+_0x1bbf0b+':\x0a':'',_0x259474=_0x30d736 instanceof SDKError?_0x30d736[_0x5ce625(0x1b0)]:_0x30d736[_0x5ce625(0x1b7)];return console[_0x5ce625(0x1a7)](''+_0x50bb94+_0x259474),0x1;}}if(_0x864ef1[_0x5ce625(0x1a6)]>0x1&&_0x329516&&_0xe62960['length']>0x0){const _0x5a6a34=_0xe62960[_0x5ce625(0x1a4)]('\x0a');writeFileSync(_0x5413eb[_0x5ce625(0x1b5)],_0x5a6a34),console[_0x5ce625(0x1a7)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x5413eb[_0x5ce625(0x1b5)]);}return 0x0;}catch(_0x2f3da1){throw _0x2f3da1;}}['validate'](_0x5988cb){const _0x557c50=a29_0x1b2b6a,_0x1869c7=_0x5988cb[_0x557c50(0x1c0)][0x0],_0x27dc18=_0x5988cb[_0x557c50(0x1a5)]['file'];if(!_0x1869c7&&!_0x27dc18)return _0x557c50(0x1a9);if(_0x1869c7&&_0x27dc18)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
|