@treasuredata/tdx 0.9.6 → 0.9.7

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.
Files changed (123) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/client/cdp-api-client.js +1 -1
  6. package/dist/client/engage-api-client.js +1 -1
  7. package/dist/client/http-client.js +1 -1
  8. package/dist/client/llm-api-client.js +1 -1
  9. package/dist/client/rate-limiter.js +1 -1
  10. package/dist/client/td-api-client.js +1 -1
  11. package/dist/client/trino-api-client.js +1 -1
  12. package/dist/client/workflow-client.js +1 -1
  13. package/dist/commands/activations.js +1 -1
  14. package/dist/commands/agent-command.js +1 -1
  15. package/dist/commands/api-command.js +1 -1
  16. package/dist/commands/auth-command.js +1 -1
  17. package/dist/commands/chat-command.js +1 -1
  18. package/dist/commands/claude-command.js +1 -1
  19. package/dist/commands/claude-statusline-command.js +1 -1
  20. package/dist/commands/claude-usage-command.js +1 -1
  21. package/dist/commands/command.js +1 -1
  22. package/dist/commands/connection-command.js +1 -1
  23. package/dist/commands/context-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/describe.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/llm-command.js +1 -1
  30. package/dist/commands/llm-proxy.js +1 -1
  31. package/dist/commands/parent-segment-command.js +1 -1
  32. package/dist/commands/profiles-command.js +1 -1
  33. package/dist/commands/query-command.js +1 -1
  34. package/dist/commands/segment-command.js +1 -1
  35. package/dist/commands/segment-create-command.js +1 -1
  36. package/dist/commands/segment-fields-command.js +1 -1
  37. package/dist/commands/segment-pull-command.js +1 -1
  38. package/dist/commands/segment-push-command.js +1 -1
  39. package/dist/commands/segment-update-command.js +1 -1
  40. package/dist/commands/segment-use-command.js +1 -1
  41. package/dist/commands/segments.js +1 -1
  42. package/dist/commands/show.js +1 -1
  43. package/dist/commands/tables.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/config.js +1 -1
  49. package/dist/core/connection-cache.js +1 -1
  50. package/dist/core/credential-cache.js +1 -1
  51. package/dist/core/global-context.js +1 -1
  52. package/dist/core/keychain.js +1 -1
  53. package/dist/core/profile.js +1 -1
  54. package/dist/core/project-config.js +1 -1
  55. package/dist/core/session.js +1 -1
  56. package/dist/core/user-cache.js +1 -1
  57. package/dist/index.js +1 -1
  58. package/dist/proxy/anthropic-adapter.js +1 -1
  59. package/dist/proxy/claude-usage-tracker.js +1 -1
  60. package/dist/proxy/context-signature.js +1 -1
  61. package/dist/proxy/conversation-utils.js +1 -1
  62. package/dist/proxy/server.js +1 -1
  63. package/dist/proxy/session-cache.js +1 -1
  64. package/dist/sdk/agent/agent-yaml.js +1 -1
  65. package/dist/sdk/api.js +1 -1
  66. package/dist/sdk/connection-validator.js +1 -1
  67. package/dist/sdk/connection.js +1 -1
  68. package/dist/sdk/engage.js +1 -1
  69. package/dist/sdk/errors.js +1 -1
  70. package/dist/sdk/index.js +1 -1
  71. package/dist/sdk/job.js +1 -1
  72. package/dist/sdk/journey.js +1 -1
  73. package/dist/sdk/llm.js +1 -1
  74. package/dist/sdk/query.js +1 -1
  75. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  76. package/dist/sdk/segment/journey-yaml.d.ts +17 -11
  77. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  78. package/dist/sdk/segment/journey-yaml.js +1 -1
  79. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  80. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  81. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  82. package/dist/sdk/segment.js +1 -1
  83. package/dist/sdk/user.js +1 -1
  84. package/dist/sdk/workflow.js +1 -1
  85. package/dist/types/endpoints.js +1 -1
  86. package/dist/types/index.js +1 -1
  87. package/dist/utils/agent-config.js +1 -1
  88. package/dist/utils/agent-ref-parser.js +1 -1
  89. package/dist/utils/async.js +1 -1
  90. package/dist/utils/chat-cache.js +1 -1
  91. package/dist/utils/colors.js +1 -1
  92. package/dist/utils/command-output.js +1 -1
  93. package/dist/utils/constants.js +1 -1
  94. package/dist/utils/diff.js +1 -1
  95. package/dist/utils/fields-display.js +1 -1
  96. package/dist/utils/file-permissions.js +1 -1
  97. package/dist/utils/format-detector.js +1 -1
  98. package/dist/utils/formatters.js +1 -1
  99. package/dist/utils/journey-utils.d.ts +30 -0
  100. package/dist/utils/journey-utils.d.ts.map +1 -1
  101. package/dist/utils/journey-utils.js +1 -1
  102. package/dist/utils/journey-utils.js.map +1 -1
  103. package/dist/utils/json-loader.js +1 -1
  104. package/dist/utils/llm-backup-utils.js +1 -1
  105. package/dist/utils/model-aliases.js +1 -1
  106. package/dist/utils/model-factors.js +1 -1
  107. package/dist/utils/option-validation.js +1 -1
  108. package/dist/utils/port.js +1 -1
  109. package/dist/utils/process.js +1 -1
  110. package/dist/utils/prompt.js +1 -1
  111. package/dist/utils/segment-path-parser.js +1 -1
  112. package/dist/utils/segment-ref-parser.js +1 -1
  113. package/dist/utils/spinner.js +1 -1
  114. package/dist/utils/sql-parser.js +1 -1
  115. package/dist/utils/sse-parser.js +1 -1
  116. package/dist/utils/string-utils.js +1 -1
  117. package/dist/utils/table-ref-parser.js +1 -1
  118. package/dist/utils/tdx-config.js +1 -1
  119. package/dist/utils/tdx-logger.js +1 -1
  120. package/dist/utils/tree-formatter.js +1 -1
  121. package/dist/utils/version-check.js +1 -1
  122. package/dist/utils/workflow-utils.js +1 -1
  123. package/package.json +1 -1
@@ -1 +1 @@
1
- const a29_0x150261=a29_0x1973;(function(_0x37192a,_0x55397f){const _0x4366d1=a29_0x1973,_0x147f52=_0x37192a();while(!![]){try{const _0x1d646b=parseInt(_0x4366d1(0x251))/0x1*(-parseInt(_0x4366d1(0x242))/0x2)+parseInt(_0x4366d1(0x282))/0x3*(-parseInt(_0x4366d1(0x1d0))/0x4)+-parseInt(_0x4366d1(0x1a5))/0x5+-parseInt(_0x4366d1(0x1ce))/0x6*(-parseInt(_0x4366d1(0x203))/0x7)+-parseInt(_0x4366d1(0x238))/0x8*(-parseInt(_0x4366d1(0x219))/0x9)+-parseInt(_0x4366d1(0x23f))/0xa+parseInt(_0x4366d1(0x1dd))/0xb*(parseInt(_0x4366d1(0x1eb))/0xc);if(_0x1d646b===_0x55397f)break;else _0x147f52['push'](_0x147f52['shift']());}catch(_0x28edeb){_0x147f52['push'](_0x147f52['shift']());}}}(a29_0x3970,0x89ef7));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';function a29_0x3970(){const _0x22730c=['Options\x20(one\x20required):\x0a','attribute','\x27\x20is\x20up\x20to\x20date','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Resolving\x20parent\x20segment\x20\x27','Show\x20parent\x20segment\x20schema\x20(column\x20types)','\x20tdx\x20wf\x20attempt\x20','Attempt:','displaySummary','number','customerGroup','segment:parent:fields','sampleData','\x20kill','message','segment:parent:show','run','Found\x20YAML\x20file:\x20','\x20--attribute\x20\x22<name>\x22','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Listing\x20parent\x20segments\x20matching\x20\x27','.yml','cyan','enriched','segment:parent:push','execute','Site:\x20','varchar','table','segment:parent:list','segment:parent:preview','✔\x20Found\x20','getParentFull','Aborted.','parentSegment','Analyzing\x20changes...','\x20No\x20changes\x20-\x20','start','Errors:','text','in\x20','Fetching\x20sample\x20data...','schemaError','dim','33249IvWFWn','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','\x0aUsage:\x20tdx\x20ps\x20preview\x20','ignore','\x20rows\x20','runParent','preview','Rows:','status','/attempt/','joinKey','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','segment:parent:pull','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','Master:','/app/dw/parentSegments/','/\x20directory.\x0a','matchedCount','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','displayColumns','columns','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','pullParentYaml','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x20\x20\x20\x20-\x20','interval','Updating','trim','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','segment:parent:update','Parent\x20segment:\x20','Options:\x0a','query','listFields','Fetching\x20SQL\x20for\x20\x27','localeCompare','\x20--behavior\x20\x22<name>\x22','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','-1d','SELECT\x20*\x20FROM\x20(\x0a','verbose','coveragePercent','log','\x0a✔\x20Workflow\x20started','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','No\x20parent\x20segments\x20found','join','session','format','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','`\x20to\x20download\x20the\x20configuration\x20first','tdx\x20segment\x20parent\x20preview\x20','Preview:','Master\x20Table','label','segment','segment:parent:desc','\x20rows)','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','yes','isDirectory','/\x20and\x20','addAttributesFile','parent_segments','repeat','jsonl','Creating','platform','Created','Status:','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','unref','Listing\x20fields\x20for\x20\x27','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20Context\x20set:\x20','FINISHED','\x0aNew\x20parent\x20segment\x20\x27','bold','\x20--attribute\x20\x22','SQL\x20query:\x0a','previewParentYaml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','information_schema','2532115nmZUdv','parent_segment','output','\x27\x20is\x20already\x20up\x20to\x20date','Updated','endsWith','Updating\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','resolveParentId','displayPreviewHints','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','allValid','Fetching\x20parent\x20segment\x20\x27','Columns:','win32','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','behavior','behaviors','Error:\x20--behavior\x20requires\x20a\x20name\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','\x0aChanges\x20to\x20apply\x20to\x20\x27','customerGroupFile','\x20=\x20','attributes','Create\x20parent\x20segment\x20\x27','To\x20view\x20sample\x20data:','Master\x20+\x20Attributes','Name:\x20','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','string','sort','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','customerPercent','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','elapsedTimeMillis','displaySampleData','green','/{name}.yml\x0a','attributesFile','open','6cRFSyl','workflowSessionId','148KdFvHi','Join\x20on:','toLocaleString','Pattern:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Get\x20SQL\x20query\x20for\x20parent\x20segment','addBehaviors','stop','double','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','No\x20parent\x20segments\x20match\x20pattern:\x20','11675026hteXYx','\x0a⚠️\x20\x20Both\x20','xdg-open','workflowId','Options:','web','error','\x27...','Events:','\x0aNo\x20sample\x20data\x20available','darwin','replace','Behaviors','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment','24QNqqKf','Join:','timezone','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Creating\x20parent\x20segment\x20\x27','segment:parent:sql','👥\x20','displayPreviewResults','toFixed','\x20Opening\x20','Audience\x20ID:','Error:\x20--database\x20and\x20--table\x20are\x20required','.yaml','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','\x0a⚠️\x20\x20Migrating:\x20','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','foreignKey','jobId','scheduleOption','limit','displayBehaviorsStats','✔\x20Renamed\x20directory\x20to\x20','\x20field','1688659hsbdrE','yellow','audienceId','keys','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','segment:parent:create','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','errors','\x20Configuration\x20is\x20valid','validateParentYaml','behaviorsFile','name','createParent','data','displayValidateResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','rowCount','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Error:\x20Parent\x20segment\x20name\x20is\x20required','✔\x20Updated\x20parent\x20segment\x20\x27','red','\x20--interval\x20','9tqNLLa','%)\x20','segment:parent:run','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:\x20File\x20not\x20found:\x20','test','schemaValid','description','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','Output\x20file:\x20','✔\x20No\x20changes\x20-\x20\x27','Error:','totalEvents','map','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','database','length','population','List\x20parent\x20segments','Available\x20behaviors:','displayAttributesStats','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','processedRows','column','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','\x5c$&','apply','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','site','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','listParents','2885192zDmSDe','Behavior:','/sessions/','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','all','setJobId','customersWithEvents','1894640vxzOBm','YAML\x20file:\x20','workflowAttemptId','34UuSXYY','Error\x20reading\x20file:\x20','scheduleType','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','\x20--enriched','utf-8','\x20--behavior\x20\x22','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','json','Fetching\x20current\x20configuration\x20for\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','\x20\x20No\x20sample\x20data\x20available','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','\x20parent\x20segment\x20\x27','Source:','61981pNUbHy','master','List\x20available\x20fields\x20for\x20segmentation','segment:parent:validate','stats'];a29_0x3970=function(){return _0x22730c;};return a29_0x3970();}function a29_0x1973(_0x246fc5,_0x67c0d3){_0x246fc5=_0x246fc5-0x194;const _0x3970b1=a29_0x3970();let _0x1973ec=_0x3970b1[_0x246fc5];return _0x1973ec;}import{spawn}from'child_process';import a29_0x2a32a5 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,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'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x52c60f from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a29_0x150261(0x2c4),LEGACY_PARENT_SEGMENT_DIR=a29_0x150261(0x1a6);function openBrowser(_0x2e3638){const _0x3d5f67=a29_0x150261,_0x44a277=process[_0x3d5f67(0x195)],_0x2278a6=_0x44a277===_0x3d5f67(0x1e7)?_0x3d5f67(0x1cd):_0x44a277===_0x3d5f67(0x1b3)?_0x3d5f67(0x27b):_0x3d5f67(0x1df);spawn(_0x2278a6,[_0x2e3638],{'detached':!![],'stdio':_0x3d5f67(0x285)})[_0x3d5f67(0x199)]();}function migrateLegacyDirectory(){const _0xf2a17a=a29_0x150261;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x52e786=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x52e786[_0xf2a17a(0x2c1)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x204)](_0xf2a17a(0x1de)+LEGACY_PARENT_SEGMENT_DIR+_0xf2a17a(0x2c2)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x281)](_0xf2a17a(0x1f9)+LEGACY_PARENT_SEGMENT_DIR+_0xf2a17a(0x292))),![];console[_0xf2a17a(0x1e3)](a29_0x52c60f['yellow'](_0xf2a17a(0x1fa)+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console['error'](a29_0x52c60f['green'](_0xf2a17a(0x201)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x4185c2){const _0x6a5d11=_0x4185c2 instanceof Error?_0x4185c2[_0xf2a17a(0x264)]:String(_0x4185c2);return console[_0xf2a17a(0x1e3)](a29_0x52c60f[_0xf2a17a(0x217)](_0xf2a17a(0x2b5)+_0x6a5d11+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x150261(0x266)](_0x43ac04){return migrateLegacyDirectory(),super['run'](_0x43ac04);}}function resolveYamlFile(_0x456d46){const _0xc9ea4=a29_0x150261;if(_0x456d46[_0xc9ea4(0x1aa)](_0xc9ea4(0x26b))||_0x456d46[_0xc9ea4(0x1aa)](_0xc9ea4(0x1f7)))return _0x456d46;return a29_0x2a32a5[_0xc9ea4(0x2b2)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x456d46)+_0xc9ea4(0x26b));}function formatProgressMessage(_0x5358c7){const _0x1ff317=a29_0x150261,_0x5c8af0=_0x5358c7['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x5c8af0){const [,_0x2b9b55,_0x1d6216,_0x1fb01b='']=_0x5c8af0;return a29_0x52c60f['dim'](_0x2b9b55+':')+'\x20'+_0x1d6216+a29_0x52c60f[_0x1ff317(0x281)](_0x1fb01b);}return a29_0x52c60f[_0x1ff317(0x281)](_0x5358c7);}function showFileNotFoundError(_0xeb605d,_0x4f4893){const _0x164de9=a29_0x150261;console[_0x164de9(0x1e3)](a29_0x52c60f['red'](_0x164de9(0x21d)+_0xeb605d+'\x0a')),console[_0x164de9(0x1e3)](a29_0x52c60f[_0x164de9(0x26c)](_0x164de9(0x298)+_0x4f4893+_0x164de9(0x2b7)));}function showParentSegmentNotSetError(_0x23852c){const _0x20fdf0=a29_0x150261;console[_0x20fdf0(0x1e3)](a29_0x52c60f['yellow'](_0x20fdf0(0x1b8))),console['error'](_0x23852c);}export class ParentSegmentListCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x273);['description']=a29_0x150261(0x22b);async[a29_0x150261(0x26f)](_0x82a9f4){const _0x4104b3=a29_0x150261,{options:_0x3cf10c,args:_0x3d8462,tdx:_0x3ed425}=_0x82a9f4,_0x3da3c4=_0x3d8462[0x0];_0x3cf10c['verbose']&&(console[_0x4104b3(0x1e3)]('Site:\x20'+_0x3cf10c['site']),_0x3da3c4&&console[_0x4104b3(0x1e3)](_0x4104b3(0x1d3)+_0x3da3c4));const _0x4db5a3=await withSpinner(_0x3da3c4?_0x4104b3(0x26a)+_0x3da3c4+_0x4104b3(0x1e4):'Listing\x20parent\x20segments...',()=>_0x3ed425[_0x4104b3(0x2bc)][_0x4104b3(0x237)](),{'verbose':_0x3cf10c['verbose']});let _0xfa9e11=_0x4db5a3[_0x4104b3(0x210)];if(_0x3da3c4){const _0x3779c8=_0x3da3c4[_0x4104b3(0x1e8)](/[.+^${}()|[\]\\]/g,_0x4104b3(0x232))[_0x4104b3(0x1e8)](/\*/g,'.*')[_0x4104b3(0x1e8)](/\?/g,'.'),_0x43b58b=new RegExp('^'+_0x3779c8+'$','i');_0xfa9e11=_0xfa9e11['filter'](_0x41df55=>_0x43b58b[_0x4104b3(0x21e)](_0x41df55[_0x4104b3(0x1bc)][_0x4104b3(0x20e)]));}_0xfa9e11[_0x4104b3(0x1c3)]((_0xacce9f,_0x5bf1a6)=>_0xacce9f[_0x4104b3(0x1bc)][_0x4104b3(0x20e)][_0x4104b3(0x2a6)](_0x5bf1a6[_0x4104b3(0x1bc)][_0x4104b3(0x20e)])),console[_0x4104b3(0x1e3)](_0x4104b3(0x275)+_0xfa9e11[_0x4104b3(0x229)]+'\x20parent\x20segment'+(_0xfa9e11[_0x4104b3(0x229)]!==0x1?'s':''));if(_0x3cf10c[_0x4104b3(0x2b4)]===_0x4104b3(0x24a)||_0x3cf10c[_0x4104b3(0x2b4)]===_0x4104b3(0x2c6))await handleSDKOutput(_0xfa9e11,_0x3cf10c);else{if(_0xfa9e11['length']===0x0)_0x3da3c4?console[_0x4104b3(0x2ad)](_0x4104b3(0x1dc)+_0x3da3c4):console[_0x4104b3(0x2ad)](_0x4104b3(0x2b1));else for(const _0xc8b631 of _0xfa9e11){const _0x2ae177=_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x22a)]?a29_0x52c60f[_0x4104b3(0x281)]('\x20('+formatRows(_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x22a)])+')'):'';console[_0x4104b3(0x2ad)](_0x4104b3(0x1f1)+_0xc8b631[_0x4104b3(0x1bc)][_0x4104b3(0x20e)]+_0x2ae177);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x208);[a29_0x150261(0x220)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x150261(0x26f)](_0x26ef50){const _0x5df90d=a29_0x150261,{options:_0x477305,args:_0x458d0f,tdx:_0x1278cf}=_0x26ef50;console[_0x5df90d(0x1e3)](_0x5df90d(0x2b0)+_0x5df90d(0x22e)+_0x5df90d(0x283));const _0x5894e6=_0x477305;if(_0x458d0f[_0x5df90d(0x229)]===0x0)return console[_0x5df90d(0x1e3)](a29_0x52c60f[_0x5df90d(0x217)]('Error:\x20Parent\x20segment\x20name\x20is\x20required')),console[_0x5df90d(0x1e3)](_0x5df90d(0x249)),0x1;const _0x1845b5=_0x458d0f[0x0];if(!_0x5894e6['database']||!_0x5894e6['table'])return console[_0x5df90d(0x1e3)](_0x5df90d(0x1f6)),console[_0x5df90d(0x1e3)](_0x5df90d(0x249)),0x1;_0x5894e6[_0x5df90d(0x2ab)]&&(console['error']('Site:\x20'+_0x5894e6[_0x5df90d(0x235)]),console[_0x5df90d(0x1e3)](_0x5df90d(0x1c0)+_0x1845b5),console[_0x5df90d(0x1e3)]('Database:\x20'+_0x5894e6[_0x5df90d(0x228)]),console[_0x5df90d(0x1e3)]('Table:\x20'+_0x5894e6[_0x5df90d(0x272)]));const _0x59e561=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x1bc)],_0x5894e6[_0x5df90d(0x1cc)]),_0x14aba1=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x1b6)],_0x5894e6[_0x5df90d(0x20d)]),_0x4506da=await loadJSONFromOptions(_0x5894e6[_0x5df90d(0x260)],_0x5894e6[_0x5df90d(0x1ba)]),_0x53fcd5={'name':_0x1845b5,'description':_0x5894e6['description'],'scheduleType':_0x5894e6[_0x5df90d(0x244)],'scheduleOption':_0x5894e6[_0x5df90d(0x1fe)],'timezone':_0x5894e6[_0x5df90d(0x1ed)],'master':{'parentDatabaseName':_0x5894e6[_0x5df90d(0x228)],'parentTableName':_0x5894e6['table']},'attributes':_0x59e561,'behaviors':_0x14aba1,'customerGroup':_0x4506da},_0x8391dc=await withSpinner(_0x5df90d(0x1ef)+_0x1845b5+_0x5df90d(0x1e4),()=>_0x1278cf[_0x5df90d(0x2bc)][_0x5df90d(0x20f)](_0x53fcd5),{'verbose':_0x477305[_0x5df90d(0x2ab)]}),_0x476bbf=_0x8391dc[_0x5df90d(0x210)];return console[_0x5df90d(0x1e3)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x476bbf[_0x5df90d(0x20e)]+'\x27\x20with\x20ID:\x20'+_0x476bbf['id']),await handleSDKOutput([_0x476bbf],_0x477305),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']=a29_0x150261(0x2a0);[a29_0x150261(0x220)]=a29_0x150261(0x1f8);async[a29_0x150261(0x26f)](_0x567e1e){const _0x57f714=a29_0x150261,{options:_0x14bfc4,args:_0x262723,tdx:_0x23d400}=_0x567e1e;console[_0x57f714(0x1e3)](_0x57f714(0x1d6)+_0x57f714(0x22e)+_0x57f714(0x283));const _0x12e8eb=_0x14bfc4;if(_0x262723['length']===0x0)return console[_0x57f714(0x1e3)](a29_0x52c60f[_0x57f714(0x217)](_0x57f714(0x215))),console[_0x57f714(0x1e3)](_0x57f714(0x1c1)),0x1;const _0x158e88=_0x262723[0x0];_0x12e8eb['verbose']&&(console[_0x57f714(0x1e3)](_0x57f714(0x270)+_0x12e8eb[_0x57f714(0x235)]),console['error'](_0x57f714(0x2a1)+_0x158e88));const _0x2d2a16=await withSpinner(_0x57f714(0x24b)+_0x158e88+'\x27...',()=>_0x23d400['segment'][_0x57f714(0x276)](_0x158e88),{'verbose':_0x12e8eb[_0x57f714(0x2ab)]}),_0x1b5014=_0x2d2a16[_0x57f714(0x210)],_0x4db47d=await loadJSONFromOptions(_0x12e8eb['addAttributes'],_0x12e8eb[_0x57f714(0x2c3)]),_0x5b3671=await loadJSONFromOptions(_0x12e8eb[_0x57f714(0x1d8)],_0x12e8eb['addBehaviorsFile']),_0x5a638b={'name':_0x1b5014[_0x57f714(0x20e)],'description':_0x12e8eb[_0x57f714(0x220)]!==undefined?_0x12e8eb[_0x57f714(0x220)]:_0x1b5014[_0x57f714(0x220)],'scheduleType':_0x12e8eb[_0x57f714(0x244)]!==undefined?_0x12e8eb[_0x57f714(0x244)]:_0x1b5014[_0x57f714(0x244)],'scheduleOption':_0x12e8eb['scheduleOption']!==undefined?_0x12e8eb[_0x57f714(0x1fe)]:_0x1b5014[_0x57f714(0x1fe)],'timezone':_0x12e8eb['timezone']!==undefined?_0x12e8eb[_0x57f714(0x1ed)]:_0x1b5014[_0x57f714(0x1ed)],'master':_0x1b5014[_0x57f714(0x252)],'attributes':_0x4db47d?[..._0x1b5014['attributes']||[],..._0x4db47d]:_0x1b5014[_0x57f714(0x1bc)],'behaviors':_0x5b3671?[..._0x1b5014[_0x57f714(0x1b6)]||[],..._0x5b3671]:_0x1b5014[_0x57f714(0x1b6)],'customerGroup':_0x1b5014[_0x57f714(0x260)]},_0x5e5d44=await withSpinner(_0x57f714(0x1ab)+_0x158e88+'\x27...',()=>_0x23d400[_0x57f714(0x2bc)]['updateParent'](_0x158e88,_0x5a638b),{'verbose':_0x12e8eb[_0x57f714(0x2ab)]}),_0x21a381=_0x5e5d44[_0x57f714(0x210)];return console[_0x57f714(0x1e3)](_0x57f714(0x216)+_0x21a381[_0x57f714(0x20e)]+'\x27'),await handleSDKOutput([_0x21a381],_0x12e8eb),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x28e);[a29_0x150261(0x220)]=a29_0x150261(0x23b);async['execute'](_0xb6a4a3){const _0x4b3d4e=a29_0x150261,{options:_0xf09f0f,args:_0x50760d,tdx:_0x3698f0}=_0xb6a4a3,_0x563811=_0xf09f0f,_0x23e2a5=_0x50760d[0x0]||_0xf09f0f[_0x4b3d4e(0x278)];if(!_0x23e2a5)return showParentSegmentNotSetError(_0x4b3d4e(0x209)+_0x4b3d4e(0x1c5)),0x1;if(_0x563811['use']&&_0x563811[_0x4b3d4e(0x1a7)])return console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x217)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x281)](_0x4b3d4e(0x221))),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x281)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+_0x4b3d4e(0x1cb))),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x26c)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x2b2565=_0x563811['output']||a29_0x2a32a5[_0x4b3d4e(0x2b2)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x23e2a5)+_0x4b3d4e(0x26b));_0x563811['verbose']&&(console[_0x4b3d4e(0x1e3)](_0x4b3d4e(0x270)+_0x563811[_0x4b3d4e(0x235)]),console[_0x4b3d4e(0x1e3)]('Parent\x20segment:\x20'+_0x23e2a5),console[_0x4b3d4e(0x1e3)](_0x4b3d4e(0x222)+_0x2b2565));const _0x464140=await withSpinner(_0x4b3d4e(0x1b1)+_0x23e2a5+_0x4b3d4e(0x1e4),()=>_0x3698f0[_0x4b3d4e(0x2bc)][_0x4b3d4e(0x299)](_0x23e2a5),{'verbose':_0x563811[_0x4b3d4e(0x2ab)]}),_0x11c077=_0x464140[_0x4b3d4e(0x210)];if(existsSync(_0x2b2565)){const _0x231662=readFileSync(_0x2b2565,'utf-8'),_0x2dcfd9=generateDiff(_0x231662,_0x11c077);if(!hasChanges(_0x2dcfd9))console[_0x4b3d4e(0x1e3)](a29_0x52c60f['green']('✔')+_0x4b3d4e(0x27a)+a29_0x52c60f['cyan'](_0x2b2565)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x4b3d4e(0x1e3)]('\x0aChanges\x20to\x20\x27'+_0x2b2565+'\x27:'),console['error']('─'[_0x4b3d4e(0x2c5)](0x3c)),console[_0x4b3d4e(0x1e3)](formatDiffWithColors(_0x2dcfd9)),console[_0x4b3d4e(0x1e3)]('─'[_0x4b3d4e(0x2c5)](0x3c));if(!_0x563811[_0x4b3d4e(0x2c0)]){const _0x3c9d05=await confirmKey('Overwrite\x20\x27'+_0x2b2565+'\x27?');if(!_0x3c9d05)return console[_0x4b3d4e(0x1e3)]('Aborted.'),0x1;}writeFileSync(_0x2b2565,_0x11c077,_0x4b3d4e(0x247)),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a29_0x52c60f[_0x4b3d4e(0x26c)](_0x2b2565));}}else{const _0x8c6968=a29_0x2a32a5['dirname'](_0x2b2565);!existsSync(_0x8c6968)&&mkdirSync(_0x8c6968,{'recursive':!![]}),writeFileSync(_0x2b2565,_0x11c077,_0x4b3d4e(0x247)),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+_0x4b3d4e(0x269)+a29_0x52c60f[_0x4b3d4e(0x26c)](_0x2b2565));}return saveSessionContext({'parent_segment':_0x23e2a5},_0x563811[_0x4b3d4e(0x2b3)]),console[_0x4b3d4e(0x1e3)](a29_0x52c60f[_0x4b3d4e(0x1ca)]('✔')+_0x4b3d4e(0x19c)+a29_0x52c60f['dim'](_0x4b3d4e(0x1a6))+_0x4b3d4e(0x1bb)+a29_0x52c60f['cyan'](_0x23e2a5)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x26e);[a29_0x150261(0x220)]=a29_0x150261(0x2af);async[a29_0x150261(0x26f)](_0x5ef96b){const _0xd2b4e7=a29_0x150261,{options:_0x218311,args:_0x4edaf8,tdx:_0x2c6794}=_0x5ef96b,_0x43c29b=_0x218311,_0xd17189=_0x4edaf8[0x0]||_0x218311['parentSegment'];if(!_0xd17189)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'+_0xd2b4e7(0x245)),0x1;const _0x4dad05=resolveYamlFile(_0xd17189);if(!existsSync(_0x4dad05))return showFileNotFoundError(_0x4dad05,_0xd17189),0x1;_0x43c29b[_0xd2b4e7(0x2ab)]&&(console['error']('Site:\x20'+_0x43c29b['site']),console[_0xd2b4e7(0x1e3)]('YAML\x20file:\x20'+_0x4dad05));let _0x3dc53a;try{_0x3dc53a=readFileSync(_0x4dad05,_0xd2b4e7(0x247));}catch(_0x286856){const _0x5237bb=_0x286856 instanceof Error?_0x286856['message']:String(_0x286856);return console[_0xd2b4e7(0x1e3)]('Error\x20reading\x20file:\x20'+_0x5237bb),0x1;}const _0x4172d6=await withSpinner('Analyzing\x20changes...',()=>_0x2c6794['segment']['pushParentYaml'](_0x3dc53a),{'verbose':_0x43c29b[_0xd2b4e7(0x2ab)]}),_0x4f317b=_0x4172d6[_0xd2b4e7(0x210)],{isNew:_0x36d947,name:_0x2a2bf2,hasChanges:_0x30f7fd,diffFormatted:_0x1f6806}=_0x4f317b;if(!_0x30f7fd)return console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x223)+_0x2a2bf2+_0xd2b4e7(0x1a8)),0x0;_0x36d947?console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x19e)+_0x2a2bf2+'\x27:'):console[_0xd2b4e7(0x1e3)](_0xd2b4e7(0x1b9)+_0x2a2bf2+'\x27:');console[_0xd2b4e7(0x1e3)]('─'[_0xd2b4e7(0x2c5)](0x3c)),console[_0xd2b4e7(0x1e3)](_0x1f6806),console['error']('─'['repeat'](0x3c));const _0x3c4d40=_0x36d947?_0xd2b4e7(0x1bd)+_0x2a2bf2+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2a2bf2+'\x27?';if(!_0x43c29b[_0xd2b4e7(0x2c0)]){const _0x5e05dd=await confirmKey(_0x3c4d40);if(!_0x5e05dd)return console['error'](_0xd2b4e7(0x277)),0x1;}const _0x31c5b0=_0x36d947?_0xd2b4e7(0x194):_0xd2b4e7(0x29d),_0x55a083=await withSpinner(_0x31c5b0+'\x20parent\x20segment\x20\x27'+_0x2a2bf2+_0xd2b4e7(0x1e4),()=>_0x4f317b[_0xd2b4e7(0x233)](),{'verbose':_0x43c29b[_0xd2b4e7(0x2ab)]}),_0x3c720c=_0x55a083[_0xd2b4e7(0x210)],_0x4b7c33=getConsoleNextUrl(_0x43c29b[_0xd2b4e7(0x235)],_0xd2b4e7(0x291)+_0x3c720c['id']),_0x5c7401=_0x36d947?_0xd2b4e7(0x196):_0xd2b4e7(0x1a9);return console[_0xd2b4e7(0x1e3)]('✔\x20'+_0x5c7401+'\x20parent\x20segment\x20\x27'+_0x3c720c[_0xd2b4e7(0x20e)]+'\x27'),console[_0xd2b4e7(0x1e3)]('\x20\x20'+_0x4b7c33),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x254);[a29_0x150261(0x220)]=a29_0x150261(0x227);async['execute'](_0xf27a1d){const _0x165c79=a29_0x150261,{options:_0x53a807,args:_0x2acde1,tdx:_0x549d20}=_0xf27a1d,_0x41d309=_0x53a807,_0x4dda91=_0x2acde1[0x0]||_0x53a807[_0x165c79(0x278)];if(!_0x4dda91)return showParentSegmentNotSetError(_0x165c79(0x29f)+_0x165c79(0x24e)+'Options:\x0a'+_0x165c79(0x234)+_0x165c79(0x1b4)+_0x165c79(0x19b)),0x1;const _0xea4e66=resolveYamlFile(_0x4dda91);if(!existsSync(_0xea4e66))return showFileNotFoundError(_0xea4e66,_0x4dda91),0x1;_0x41d309[_0x165c79(0x2ab)]&&(console[_0x165c79(0x1e3)]('Site:\x20'+_0x41d309[_0x165c79(0x235)]),console[_0x165c79(0x1e3)]('YAML\x20file:\x20'+_0xea4e66));let _0x36b9ea;try{_0x36b9ea=readFileSync(_0xea4e66,_0x165c79(0x247));}catch(_0x1939c7){const _0x40ae07=_0x1939c7 instanceof Error?_0x1939c7[_0x165c79(0x264)]:String(_0x1939c7);return console[_0x165c79(0x1e3)](_0x165c79(0x243)+_0x40ae07),0x1;}const _0x258325=createCommandSpinner(a29_0x52c60f[_0x165c79(0x281)]('Validating\x20configuration...'),{'verbose':_0x41d309[_0x165c79(0x2ab)]});_0x258325[_0x165c79(0x27b)]();const _0x3033d5={'onProgress':_0xb544c=>{const _0x4d6c9e=_0x165c79;_0x258325[_0x4d6c9e(0x27d)]=formatProgressMessage(_0xb544c);}};if(_0x41d309[_0x165c79(0x252)])_0x3033d5[_0x165c79(0x252)]=!![];if(_0x41d309[_0x165c79(0x26d)])_0x3033d5['enriched']=!![];_0x41d309[_0x165c79(0x257)]&&(_0x3033d5[_0x165c79(0x257)]=_0x41d309[_0x165c79(0x257)]);_0x41d309[_0x165c79(0x1b5)]&&(_0x3033d5[_0x165c79(0x1b5)]=_0x41d309[_0x165c79(0x1b5)]);if(_0x41d309[_0x165c79(0x29c)])_0x3033d5[_0x165c79(0x29c)]=_0x41d309[_0x165c79(0x29c)];let _0x490373;try{_0x490373=await _0x549d20['segment'][_0x165c79(0x20c)](_0x36b9ea,_0x3033d5),_0x258325[_0x165c79(0x1d9)]();}catch(_0x1465f2){_0x258325[_0x165c79(0x1d9)]();throw _0x1465f2;}const _0x2aff3d=_0x41d309[_0x165c79(0x29c)]||_0x165c79(0x2a9);return this[_0x165c79(0x211)](_0x490373,_0x3033d5,_0xea4e66,_0x2aff3d),_0x490373[_0x165c79(0x1b0)]?0x0:0x1;}['displayValidateResults'](_0x4035aa,_0x348e84,_0x1d8759,_0xfdb20d){const _0x2812c4=a29_0x150261;console[_0x2812c4(0x1e3)]('\x0a'+a29_0x52c60f[_0x2812c4(0x19f)]('Validate:')+'\x20'+_0x4035aa[_0x2812c4(0x20e)]),console[_0x2812c4(0x1e3)]('═'[_0x2812c4(0x2c5)](0x3c)),this['displayMasterInfo'](_0x4035aa);if(typeof _0x348e84[_0x2812c4(0x257)]==='string'){this[_0x2812c4(0x22d)](_0x4035aa),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x257),_0x348e84[_0x2812c4(0x257)]);return;}if(_0x348e84[_0x2812c4(0x257)]===!![]){this[_0x2812c4(0x22d)](_0x4035aa),this['displaySummary'](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1bc));return;}if(typeof _0x348e84['behavior']===_0x2812c4(0x1c2)){this['displayBehaviorsStats'](_0x4035aa,_0xfdb20d),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1b5),_0x348e84[_0x2812c4(0x1b5)]);return;}if(_0x348e84[_0x2812c4(0x1b5)]===!![]){this[_0x2812c4(0x200)](_0x4035aa,_0xfdb20d),this[_0x2812c4(0x25e)](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x1b6));return;}this[_0x2812c4(0x22d)](_0x4035aa),this[_0x2812c4(0x200)](_0x4035aa,_0xfdb20d),this['displaySummary'](_0x4035aa),this[_0x2812c4(0x1ae)](_0x1d8759,_0xfdb20d,_0x2812c4(0x23c));}[a29_0x150261(0x1ae)](_0x27637d,_0x2ab7cd,_0x4ef1e5,_0x4a137c){const _0x22e609=a29_0x150261;console[_0x22e609(0x1e3)]('\x0a'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x1be)));const _0x1c343f=_0x2ab7cd!==_0x22e609(0x2a9)?_0x22e609(0x218)+_0x2ab7cd:'';if(_0x4ef1e5==='attribute'&&_0x4a137c)console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x1a0)+_0x4a137c+'\x22'+_0x1c343f));else{if(_0x4ef1e5==='behavior'&&_0x4a137c)console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x248)+_0x4a137c+'\x22'+_0x1c343f));else(_0x4ef1e5===_0x22e609(0x1bc)||_0x4ef1e5==='all')&&console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x268)+_0x1c343f));}(_0x4ef1e5===_0x22e609(0x1b6)||_0x4ef1e5===_0x22e609(0x23c))&&console['error']('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x2a7)+_0x1c343f)),_0x4ef1e5===_0x22e609(0x23c)&&console[_0x22e609(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x22e609(0x281)](_0x22e609(0x2b8)+_0x27637d+_0x22e609(0x246)+_0x1c343f));}['displayMasterInfo'](_0xe466e0){const _0x2f1f63=a29_0x150261,{master:_0x562001}=_0xe466e0,_0x39c8d8=_0x562001[_0x2f1f63(0x21f)]?a29_0x52c60f[_0x2f1f63(0x1ca)]('✔'):a29_0x52c60f[_0x2f1f63(0x217)]('✘');console['error']('\x0a'+a29_0x52c60f[_0x2f1f63(0x281)](_0x2f1f63(0x2ba))),console['error'](_0x39c8d8+'\x20'+a29_0x52c60f[_0x2f1f63(0x19f)](_0x562001['database']+'.'+_0x562001['table'])),_0x562001[_0x2f1f63(0x21f)]?_0x562001['rowCount']!==undefined&&console[_0x2f1f63(0x1e3)]('\x20\x20'+a29_0x52c60f['dim'](_0x2f1f63(0x289))+'\x20'+a29_0x52c60f[_0x2f1f63(0x26c)](formatRows(_0x562001[_0x2f1f63(0x213)]))):console[_0x2f1f63(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x2f1f63(0x217)](_0x2f1f63(0x224))+'\x20'+_0x562001[_0x2f1f63(0x280)]);}[a29_0x150261(0x22d)](_0x205015){const _0x47f8b3=a29_0x150261;if(_0x205015[_0x47f8b3(0x1bc)][_0x47f8b3(0x229)]===0x0)return;console[_0x47f8b3(0x1e3)]('\x0a'+a29_0x52c60f[_0x47f8b3(0x281)]('Attributes'));for(const _0x27d9b8 of _0x205015[_0x47f8b3(0x1bc)]){const _0xb2bf99=_0x27d9b8[_0x47f8b3(0x21f)]?a29_0x52c60f[_0x47f8b3(0x1ca)]('✔'):a29_0x52c60f[_0x47f8b3(0x217)]('✘');let _0x41c5e5='';if(_0x27d9b8[_0x47f8b3(0x21f)]&&_0x27d9b8[_0x47f8b3(0x293)]!==undefined&&_0x27d9b8[_0x47f8b3(0x2ac)]!==undefined){const _0x4727e4=_0x27d9b8[_0x47f8b3(0x2ac)][_0x47f8b3(0x1f3)](0x1),_0x5a3912=_0x27d9b8[_0x47f8b3(0x2ac)]>=0x50?a29_0x52c60f['green']:_0x27d9b8[_0x47f8b3(0x2ac)]>=0x32?a29_0x52c60f[_0x47f8b3(0x204)]:a29_0x52c60f['red'];_0x41c5e5='\x20'+a29_0x52c60f[_0x47f8b3(0x281)]('Coverage:')+'\x20'+_0x5a3912(_0x4727e4+'%')+'\x20('+formatRows(_0x27d9b8[_0x47f8b3(0x293)])+_0x47f8b3(0x2be);}console['error'](_0xb2bf99+'\x20'+a29_0x52c60f[_0x47f8b3(0x19f)](_0x27d9b8[_0x47f8b3(0x20e)])+_0x41c5e5),console[_0x47f8b3(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x250))+'\x20'+a29_0x52c60f[_0x47f8b3(0x19f)](_0x27d9b8['database']+'.'+_0x27d9b8['table']));const _0x24abd6=_0x27d9b8[_0x47f8b3(0x28c)]===_0x27d9b8[_0x47f8b3(0x1fc)]?a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1d1))+'\x20'+_0x27d9b8[_0x47f8b3(0x28c)]:a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1ec))+'\x20'+_0x27d9b8[_0x47f8b3(0x28c)]+_0x47f8b3(0x1bb)+_0x27d9b8['foreignKey'];console[_0x47f8b3(0x1e3)]('\x20\x20'+_0x24abd6),console['error']('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x281)](_0x47f8b3(0x1b2))),this[_0x47f8b3(0x296)](_0x27d9b8[_0x47f8b3(0x297)]),!_0x27d9b8[_0x47f8b3(0x21f)]&&console[_0x47f8b3(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x47f8b3(0x217)](_0x47f8b3(0x224))+'\x20'+_0x27d9b8[_0x47f8b3(0x280)]);}}[a29_0x150261(0x200)](_0x593165,_0x47251b){const _0x3a9254=a29_0x150261;if(_0x593165[_0x3a9254(0x1b6)]['length']===0x0)return;console[_0x3a9254(0x1e3)]('\x0a'+a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x1e9))+'\x20'+a29_0x52c60f['dim']('('+_0x47251b+')'));for(const _0x265f00 of _0x593165['behaviors']){const _0x39ab25=_0x265f00[_0x3a9254(0x21f)]?a29_0x52c60f[_0x3a9254(0x1ca)]('✔'):a29_0x52c60f[_0x3a9254(0x217)]('✘');let _0x39b1ec='';if(_0x265f00[_0x3a9254(0x21f)]&&_0x265f00['customersWithEvents']!==undefined&&_0x265f00[_0x3a9254(0x225)]!==undefined){const _0xedd7da=_0x265f00['customerPercent']?.[_0x3a9254(0x1f3)](0x1)||'?',_0x301dcd=(_0x265f00[_0x3a9254(0x1c6)]??0x0)>=0x32?a29_0x52c60f[_0x3a9254(0x1ca)]:(_0x265f00['customerPercent']??0x0)>=0x14?a29_0x52c60f[_0x3a9254(0x204)]:a29_0x52c60f[_0x3a9254(0x217)];_0x39b1ec='\x20'+a29_0x52c60f[_0x3a9254(0x281)]('Customers:')+'\x20'+_0x301dcd(formatRows(_0x265f00[_0x3a9254(0x23e)]))+'\x20('+_0xedd7da+_0x3a9254(0x21a)+a29_0x52c60f['dim'](_0x3a9254(0x1e5))+'\x20'+a29_0x52c60f['cyan'](formatRows(_0x265f00[_0x3a9254(0x225)]));}console[_0x3a9254(0x1e3)](_0x39ab25+'\x20'+a29_0x52c60f[_0x3a9254(0x19f)](_0x265f00['name'])+_0x39b1ec),console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x250))+'\x20'+a29_0x52c60f[_0x3a9254(0x19f)](_0x265f00[_0x3a9254(0x228)]+'.'+_0x265f00[_0x3a9254(0x272)]));const _0x3258d8=_0x265f00[_0x3a9254(0x28c)]===_0x265f00[_0x3a9254(0x1fc)]?a29_0x52c60f['dim']('Join\x20on:')+'\x20'+_0x265f00[_0x3a9254(0x28c)]:a29_0x52c60f[_0x3a9254(0x281)](_0x3a9254(0x1ec))+'\x20'+_0x265f00[_0x3a9254(0x28c)]+_0x3a9254(0x1bb)+_0x265f00[_0x3a9254(0x1fc)];console[_0x3a9254(0x1e3)]('\x20\x20'+_0x3258d8),console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x281)]('Columns:')),this[_0x3a9254(0x296)](_0x265f00[_0x3a9254(0x297)]),!_0x265f00['schemaValid']&&console[_0x3a9254(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3a9254(0x217)]('Error:')+'\x20'+_0x265f00[_0x3a9254(0x280)]);}}[a29_0x150261(0x296)](_0x109152){const _0x3d1bdd=a29_0x150261;for(const _0x2ddff6 of _0x109152){_0x2ddff6[_0x3d1bdd(0x2bb)]===_0x2ddff6[_0x3d1bdd(0x230)]||_0x2ddff6['column']==='*'?console[_0x3d1bdd(0x1e3)](_0x3d1bdd(0x29b)+_0x2ddff6[_0x3d1bdd(0x2bb)]):console['error'](_0x3d1bdd(0x29b)+_0x2ddff6['label']+'\x20'+a29_0x52c60f['dim']('('+_0x2ddff6[_0x3d1bdd(0x230)]+')'));}}['displaySummary'](_0x1edbde){const _0x53809b=a29_0x150261;console[_0x53809b(0x1e3)]('─'[_0x53809b(0x2c5)](0x3c));if(_0x1edbde[_0x53809b(0x20a)][_0x53809b(0x229)]>0x0){console['error']('\x0a'+a29_0x52c60f[_0x53809b(0x217)](_0x53809b(0x27c)));for(const _0x517759 of _0x1edbde['errors']){console[_0x53809b(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x53809b(0x217)]('•')+'\x20'+_0x517759);}}_0x1edbde[_0x53809b(0x1b0)]&&console[_0x53809b(0x1e3)]('\x0a'+a29_0x52c60f['green']('✔')+_0x53809b(0x20b));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x274);[a29_0x150261(0x220)]=a29_0x150261(0x207);async[a29_0x150261(0x26f)](_0x172888){const _0x1cdb90=a29_0x150261,{options:_0x347c99,args:_0x2f081e,tdx:_0xc5468}=_0x172888,_0x271137=_0x347c99,_0x558938=_0x2f081e[0x0]||_0x347c99[_0x1cdb90(0x278)];if(!_0x558938)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+_0x1cdb90(0x212)+_0x1cdb90(0x256)+_0x1cdb90(0x1d4)+_0x1cdb90(0x198)+'\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a'+_0x1cdb90(0x1c4)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x271137[_0x1cdb90(0x252)]&&!_0x271137[_0x1cdb90(0x257)]&&!_0x271137[_0x1cdb90(0x1b5)]&&!_0x271137['enriched'])return console['error'](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x294))),console['error'](_0x1cdb90(0x28d)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1e1)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x2b6)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1a3)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x259)),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x1af)),0x1;const _0xe60df0=resolveYamlFile(_0x558938);if(!existsSync(_0xe60df0))return showFileNotFoundError(_0xe60df0,_0x558938),0x1;_0x271137[_0x1cdb90(0x2ab)]&&(console[_0x1cdb90(0x1e3)]('Site:\x20'+_0x271137[_0x1cdb90(0x235)]),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x240)+_0xe60df0));let _0x4363d2;try{_0x4363d2=readFileSync(_0xe60df0,'utf-8');}catch(_0xb76b26){const _0x5e45ef=_0xb76b26 instanceof Error?_0xb76b26['message']:String(_0xb76b26);return console[_0x1cdb90(0x1e3)](_0x1cdb90(0x243)+_0x5e45ef),0x1;}let _0x161794;try{_0x161794=parseYamlString(_0x4363d2);}catch(_0x3f4daf){const _0x51b59b=_0x3f4daf instanceof Error?_0x3f4daf[_0x1cdb90(0x264)]:String(_0x3f4daf);return console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)]('Error\x20parsing\x20YAML:\x20'+_0x51b59b)),0x1;}if(_0x271137[_0x1cdb90(0x257)]===!![]||_0x271137[_0x1cdb90(0x257)]===''){const _0x31bb7d=_0x161794[_0x1cdb90(0x1bc)]?.[_0x1cdb90(0x226)](_0x16cb33=>_0x16cb33['name'])||[];if(_0x31bb7d[_0x1cdb90(0x229)]===0x0)console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x236)));else{console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x214))),console[_0x1cdb90(0x1e3)]('Available\x20attributes:');for(const _0x1e6bfd of _0x31bb7d){console['error']('\x20\x20'+a29_0x52c60f[_0x1cdb90(0x26c)](_0x1e6bfd));}console['error'](_0x1cdb90(0x284)+_0x558938+'\x20--attribute\x20\x22'+_0x31bb7d[0x0]+'\x22');}return 0x1;}if(_0x271137[_0x1cdb90(0x1b5)]===!![]||_0x271137[_0x1cdb90(0x1b5)]===''){const _0x797410=_0x161794[_0x1cdb90(0x1b6)]?.[_0x1cdb90(0x226)](_0x62d260=>_0x62d260['name'])||[];if(_0x797410[_0x1cdb90(0x229)]===0x0)console[_0x1cdb90(0x1e3)](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x2a8)));else{console['error'](a29_0x52c60f[_0x1cdb90(0x217)](_0x1cdb90(0x1b7))),console[_0x1cdb90(0x1e3)](_0x1cdb90(0x22c));for(const _0xa8460 of _0x797410){console[_0x1cdb90(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x1cdb90(0x26c)](_0xa8460));}console[_0x1cdb90(0x1e3)](_0x1cdb90(0x284)+_0x558938+_0x1cdb90(0x248)+_0x797410[0x0]+'\x22');}return 0x1;}const _0x351945=createCommandSpinner(a29_0x52c60f[_0x1cdb90(0x281)](_0x1cdb90(0x27f)),{'verbose':_0x271137['verbose']});_0x351945[_0x1cdb90(0x27b)]();const _0x164810={'onProgress':_0x1b2aa9=>{const _0x56ec26=_0x1cdb90;_0x351945[_0x56ec26(0x27d)]=formatProgressMessage(_0x1b2aa9);}};if(_0x271137[_0x1cdb90(0x252)])_0x164810[_0x1cdb90(0x252)]=!![];if(_0x271137['attribute']&&typeof _0x271137[_0x1cdb90(0x257)]===_0x1cdb90(0x1c2))_0x164810['attribute']=_0x271137[_0x1cdb90(0x257)];if(_0x271137[_0x1cdb90(0x1b5)]&&typeof _0x271137[_0x1cdb90(0x1b5)]===_0x1cdb90(0x1c2))_0x164810[_0x1cdb90(0x1b5)]=_0x271137[_0x1cdb90(0x1b5)];if(_0x271137[_0x1cdb90(0x26d)])_0x164810[_0x1cdb90(0x26d)]=!![];if(_0x271137[_0x1cdb90(0x29c)])_0x164810['interval']=_0x271137[_0x1cdb90(0x29c)];let _0x331579;try{_0x331579=await _0xc5468[_0x1cdb90(0x2bc)][_0x1cdb90(0x1a2)](_0x4363d2,_0x164810),_0x351945[_0x1cdb90(0x1d9)]();}catch(_0x3204ab){_0x351945[_0x1cdb90(0x1d9)]();throw _0x3204ab;}return await this['displayPreviewResults'](_0x331579,{'master':_0x271137[_0x1cdb90(0x252)],'attribute':typeof _0x271137[_0x1cdb90(0x257)]===_0x1cdb90(0x1c2)?_0x271137['attribute']:undefined,'behavior':typeof _0x271137[_0x1cdb90(0x1b5)]==='string'?_0x271137[_0x1cdb90(0x1b5)]:undefined,'enriched':_0x271137[_0x1cdb90(0x26d)]}),_0x331579[_0x1cdb90(0x1b0)]?0x0:0x1;}async[a29_0x150261(0x1f2)](_0x5ea2a2,_0x5ea779){const _0x3bf4f9=a29_0x150261;console['error']('\x0a'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x3bf4f9(0x2b9))+'\x20'+_0x5ea2a2[_0x3bf4f9(0x20e)]),console[_0x3bf4f9(0x1e3)]('═'[_0x3bf4f9(0x2c5)](0x3c));if(_0x5ea779[_0x3bf4f9(0x252)]&&_0x5ea2a2[_0x3bf4f9(0x262)]){const _0x5415bc=a29_0x52c60f['dim'](_0x3bf4f9(0x290))+'\x20'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x5ea2a2[_0x3bf4f9(0x252)][_0x3bf4f9(0x228)]+'.'+_0x5ea2a2[_0x3bf4f9(0x252)]['table']);await this[_0x3bf4f9(0x1c9)](_0x5415bc,_0x5ea2a2[_0x3bf4f9(0x262)]);}else{if(_0x5ea779[_0x3bf4f9(0x257)]&&_0x5ea2a2['sampleData']){const _0x374e6e=a29_0x52c60f['dim']('Attribute:')+'\x20'+a29_0x52c60f['bold'](_0x5ea779[_0x3bf4f9(0x257)]);await this[_0x3bf4f9(0x1c9)](_0x374e6e,_0x5ea2a2['sampleData']);}else{if(_0x5ea779[_0x3bf4f9(0x1b5)]&&_0x5ea2a2[_0x3bf4f9(0x262)]){const _0x3b3977=a29_0x52c60f[_0x3bf4f9(0x281)](_0x3bf4f9(0x239))+'\x20'+a29_0x52c60f[_0x3bf4f9(0x19f)](_0x5ea779['behavior']);await this[_0x3bf4f9(0x1c9)](_0x3b3977,_0x5ea2a2[_0x3bf4f9(0x262)]);}else{if(_0x5ea779[_0x3bf4f9(0x26d)]&&_0x5ea2a2['sampleData']){const _0x2199e3=a29_0x52c60f['dim']('Enriched:')+'\x20'+a29_0x52c60f['bold'](_0x3bf4f9(0x1bf));await this[_0x3bf4f9(0x1c9)](_0x2199e3,_0x5ea2a2[_0x3bf4f9(0x262)]);}else!_0x5ea2a2[_0x3bf4f9(0x262)]&&console['error'](_0x3bf4f9(0x1e6));}}}if(_0x5ea2a2[_0x3bf4f9(0x20a)][_0x3bf4f9(0x229)]>0x0){console[_0x3bf4f9(0x1e3)]('─'[_0x3bf4f9(0x2c5)](0x3c)),console[_0x3bf4f9(0x1e3)]('\x0a'+a29_0x52c60f['red'](_0x3bf4f9(0x27c)));for(const _0x576aa0 of _0x5ea2a2['errors']){console['error']('\x20\x20'+a29_0x52c60f[_0x3bf4f9(0x217)]('•')+'\x20'+_0x576aa0);}}}async[a29_0x150261(0x1c9)](_0x3e14df,_0x571b8f){const _0x5373fc=a29_0x150261;if(_0x571b8f[_0x5373fc(0x229)]===0x0){console[_0x5373fc(0x1e3)]('\x0a'+_0x3e14df),console[_0x5373fc(0x1e3)](_0x5373fc(0x24d));return;}console[_0x5373fc(0x1e3)]('\x0a'+_0x3e14df);const _0x57168c=Object[_0x5373fc(0x206)](_0x571b8f[0x0])['map'](_0x5c6e7d=>({'name':_0x5c6e7d,'type':typeof _0x571b8f[0x0][_0x5c6e7d]===_0x5373fc(0x25f)?_0x5373fc(0x1da):_0x5373fc(0x271)})),_0x1b7e2b={'queryId':_0x5373fc(0x288),'columns':_0x57168c,'data':_0x571b8f,'stats':{'state':_0x5373fc(0x19d),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x571b8f[_0x5373fc(0x229)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x2decf8=formatAsTable(_0x1b7e2b,_0x571b8f[_0x5373fc(0x229)],!![]);await writeOutput(_0x2decf8,undefined,_0x5373fc(0x272));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x21b);[a29_0x150261(0x220)]=a29_0x150261(0x295);async[a29_0x150261(0x26f)](_0x309859){const _0x3909d8=a29_0x150261,{options:_0x4c9793,args:_0x230c02,tdx:_0x2d6d0f}=_0x309859,_0x4efef9=_0x4c9793,_0x5f46d1=_0x230c02[0x0]||_0x4c9793[_0x3909d8(0x278)];if(!_0x5f46d1)return showParentSegmentNotSetError(_0x3909d8(0x1d5)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x1e1aff=resolveYamlFile(_0x5f46d1);if(existsSync(_0x1e1aff)){_0x4efef9[_0x3909d8(0x2ab)]&&console[_0x3909d8(0x1e3)](_0x3909d8(0x267)+_0x1e1aff);let _0x3557e;try{_0x3557e=readFileSync(_0x1e1aff,_0x3909d8(0x247));}catch(_0x359ddc){const _0x25d8cc=_0x359ddc instanceof Error?_0x359ddc['message']:String(_0x359ddc);return console[_0x3909d8(0x1e3)](_0x3909d8(0x243)+_0x25d8cc),0x1;}const _0x4f6c41=await withSpinner(_0x3909d8(0x279),()=>_0x2d6d0f[_0x3909d8(0x2bc)]['pushParentYaml'](_0x3557e),{'verbose':_0x4efef9['verbose']}),_0x1c8269=_0x4f6c41[_0x3909d8(0x210)],{isNew:_0x1f0599,name:_0x21ef94,hasChanges:_0x346068,diffFormatted:_0x535ee7}=_0x1c8269;if(_0x346068){_0x1f0599?console['error'](_0x3909d8(0x19e)+_0x21ef94+'\x27:'):console['error'](_0x3909d8(0x1b9)+_0x21ef94+'\x27:');console['error']('─'[_0x3909d8(0x2c5)](0x3c)),console[_0x3909d8(0x1e3)](_0x535ee7),console['error']('─'[_0x3909d8(0x2c5)](0x3c));const _0x4b9f9a=_0x1f0599?_0x3909d8(0x1bd)+_0x21ef94+'\x27\x20and\x20run\x20workflow?':'Apply\x20changes\x20to\x20\x27'+_0x21ef94+'\x27\x20and\x20run\x20workflow?';if(!_0x4efef9['yes']){const _0x38144e=await confirmKey(_0x4b9f9a);if(!_0x38144e)return console[_0x3909d8(0x1e3)]('Aborted.'),0x1;}const _0x2a3caa=_0x1f0599?_0x3909d8(0x194):'Updating';await withSpinner(_0x2a3caa+_0x3909d8(0x24f)+_0x21ef94+_0x3909d8(0x1e4),()=>_0x1c8269[_0x3909d8(0x233)](),{'verbose':_0x4efef9[_0x3909d8(0x2ab)]});const _0x498d9a=_0x1f0599?_0x3909d8(0x196):_0x3909d8(0x1a9);console[_0x3909d8(0x1e3)]('✔\x20'+_0x498d9a+_0x3909d8(0x24f)+_0x21ef94+'\x27');}else console[_0x3909d8(0x1e3)](_0x3909d8(0x223)+_0x21ef94+_0x3909d8(0x258));}const _0xf82416=await withSpinner(_0x3909d8(0x1fb)+_0x5f46d1+'\x27...',()=>_0x2d6d0f[_0x3909d8(0x2bc)][_0x3909d8(0x287)](_0x5f46d1),{'verbose':_0x4efef9[_0x3909d8(0x2ab)]}),_0x585df9=_0xf82416[_0x3909d8(0x210)],_0x2e17b8=getConsoleUrl(_0x4efef9[_0x3909d8(0x235)],'/app/workflows/'+_0x585df9[_0x3909d8(0x1e0)]+_0x3909d8(0x23a)+_0x585df9['workflowSessionId']+_0x3909d8(0x28b)+_0x585df9[_0x3909d8(0x241)]);return console['error'](_0x3909d8(0x2ae)),console['error']('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)](_0x3909d8(0x1f5))+'\x20'+_0x585df9[_0x3909d8(0x205)]),console[_0x3909d8(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)](_0x3909d8(0x197))+'\x20'+_0x585df9[_0x3909d8(0x28a)]),console[_0x3909d8(0x1e3)]('\x20\x20'+a29_0x52c60f[_0x3909d8(0x281)]('Session:')+'\x20'+_0x585df9[_0x3909d8(0x1cf)]),console['error']('\x20\x20'+a29_0x52c60f['dim'](_0x3909d8(0x25d))+'\x20'+_0x585df9['workflowAttemptId']),console['error']('\x20\x20'+_0x2e17b8),console[_0x3909d8(0x1e3)]('\x0a'+a29_0x52c60f[_0x3909d8(0x281)]('To\x20cancel:')+_0x3909d8(0x25c)+_0x585df9['workflowAttemptId']+_0x3909d8(0x263)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x261);[a29_0x150261(0x220)]=a29_0x150261(0x253);async[a29_0x150261(0x26f)](_0x17aacb){const _0x59fc87=a29_0x150261,{options:_0x59975c,args:_0x2bf33a,tdx:_0xc643bd}=_0x17aacb,_0x3d88a9=_0x2bf33a[0x0]||_0x59975c[_0x59fc87(0x278)];if(!_0x3d88a9)return showParentSegmentNotSetError(_0x59fc87(0x1ac)+_0x59fc87(0x29a)),0x1;_0x59975c['verbose']&&(console[_0x59fc87(0x1e3)](_0x59fc87(0x270)+_0x59975c['site']),console[_0x59fc87(0x1e3)](_0x59fc87(0x2a1)+_0x3d88a9));const _0x5645f2=await withSpinner(_0x59fc87(0x19a)+_0x3d88a9+'\x27...',()=>_0xc643bd['segment'][_0x59fc87(0x2a4)](_0x3d88a9),{'verbose':_0x59975c[_0x59fc87(0x2ab)]}),_0x186a57=_0x5645f2[_0x59fc87(0x210)];console[_0x59fc87(0x1e3)](_0x59fc87(0x275)+_0x186a57[_0x59fc87(0x229)]+_0x59fc87(0x202)+(_0x186a57[_0x59fc87(0x229)]!==0x1?'s':''));if(_0x59975c[_0x59fc87(0x24a)]||_0x59975c[_0x59fc87(0x2c6)])return await handleSDKOutput(_0x186a57,_0x59975c),0x0;return displayFieldsHumanReadable(_0x186a57,_0x3d88a9),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']='segment:parent:view';[a29_0x150261(0x220)]='Show\x20parent\x20segment\x20details';async[a29_0x150261(0x26f)](_0x2c09d0){const _0x359993=a29_0x150261,{options:_0x431d38,args:_0x5a90ae,tdx:_0x582302}=_0x2c09d0,_0x517da5=_0x431d38,_0x411d21=_0x5a90ae[0x0]||_0x431d38[_0x359993(0x278)];if(!_0x411d21)return showParentSegmentNotSetError(_0x359993(0x1ee)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a'+_0x359993(0x2a2)+_0x359993(0x1c7)),0x1;_0x431d38[_0x359993(0x2ab)]&&(console[_0x359993(0x1e3)]('Site:\x20'+_0x431d38[_0x359993(0x235)]),console[_0x359993(0x1e3)]('Parent\x20segment:\x20'+_0x411d21));const _0x2ccb38=await withSpinner(_0x359993(0x1b1)+_0x411d21+'\x27...',()=>_0x582302['segment'][_0x359993(0x276)](_0x411d21),{'verbose':_0x431d38[_0x359993(0x2ab)]}),_0x53796a=_0x2ccb38[_0x359993(0x210)];if(_0x517da5[_0x359993(0x1e2)]){const _0x1fbec3=getConsoleNextUrl(_0x517da5[_0x359993(0x235)],_0x359993(0x291)+_0x53796a['id']);return console['error'](a29_0x52c60f[_0x359993(0x1ca)]('✔')+_0x359993(0x1f4)+a29_0x52c60f[_0x359993(0x26c)](_0x1fbec3)),openBrowser(_0x1fbec3),0x0;}return await handleSingleObjectOutput(_0x53796a,_0x431d38),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{['name']=a29_0x150261(0x2bd);[a29_0x150261(0x220)]=a29_0x150261(0x25b);async['execute'](_0x70b310){const _0x8fc6b9=a29_0x150261,{options:_0x47bc42,args:_0x1993df,tdx:_0x32bc75}=_0x70b310,_0x373a46=_0x1993df[0x0]||_0x47bc42['parentSegment'];if(!_0x373a46)return showParentSegmentNotSetError(_0x8fc6b9(0x2bf)+_0x8fc6b9(0x1ea)),0x1;_0x47bc42[_0x8fc6b9(0x2ab)]&&(console[_0x8fc6b9(0x1e3)](_0x8fc6b9(0x270)+_0x47bc42[_0x8fc6b9(0x235)]),console['error'](_0x8fc6b9(0x2a1)+_0x373a46));const _0x2a6ccb=await withSpinner(_0x8fc6b9(0x25a)+_0x373a46+_0x8fc6b9(0x1e4),()=>_0x32bc75[_0x8fc6b9(0x2bc)][_0x8fc6b9(0x1ad)](_0x373a46),{'verbose':_0x47bc42[_0x8fc6b9(0x2ab)]}),_0x332a4b=_0x2a6ccb[_0x8fc6b9(0x210)],_0x22aa12=await withSpinner(_0x8fc6b9(0x2a5)+_0x373a46+_0x8fc6b9(0x1e4),()=>_0x32bc75[_0x8fc6b9(0x2bc)]['getParentSQL'](_0x332a4b),{'verbose':_0x47bc42[_0x8fc6b9(0x2ab)]}),_0x1fbe23=await executeSchemaQuery(_0x22aa12['data'],_0x32bc75,_0x47bc42);return await handleQueryOutput(_0x1fbe23,_0x47bc42),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x1f0);[a29_0x150261(0x220)]=a29_0x150261(0x1d7);async[a29_0x150261(0x26f)](_0x1500c4){const _0x21ed56=a29_0x150261,{options:_0x3b8d7c,args:_0x5b7b0f,tdx:_0x504a15}=_0x1500c4,_0x58a8a3=_0x5b7b0f[0x0]||_0x3b8d7c[_0x21ed56(0x278)];if(!_0x58a8a3)return showParentSegmentNotSetError(_0x21ed56(0x28f)+_0x21ed56(0x24c)),0x1;_0x3b8d7c[_0x21ed56(0x2ab)]&&(console[_0x21ed56(0x1e3)](_0x21ed56(0x270)+_0x3b8d7c[_0x21ed56(0x235)]),console['error'](_0x21ed56(0x2a1)+_0x58a8a3));const _0x5e9fb7=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x58a8a3+_0x21ed56(0x1e4),()=>_0x504a15[_0x21ed56(0x2bc)]['resolveParentId'](_0x58a8a3),{'verbose':_0x3b8d7c[_0x21ed56(0x2ab)]}),_0xbcc481=_0x5e9fb7[_0x21ed56(0x210)],_0xb77947=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x58a8a3+_0x21ed56(0x1e4),()=>_0x504a15['segment']['getParentSQL'](_0xbcc481),{'verbose':_0x3b8d7c[_0x21ed56(0x2ab)]}),_0x1c07e1=_0xb77947['data'];return _0x3b8d7c[_0x21ed56(0x2b4)]==='json'||_0x3b8d7c[_0x21ed56(0x2b4)]===_0x21ed56(0x2c6)?await handleSDKOutput([{'sql':_0x1c07e1}],_0x3b8d7c):console[_0x21ed56(0x2ad)](_0x1c07e1),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a29_0x150261(0x20e)]=a29_0x150261(0x265);['description']='Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x2463b7){const _0x58af4a=a29_0x150261,{options:_0x9db99d,args:_0x12b1f6,tdx:_0x338d0a}=_0x2463b7,_0x5194f3=_0x12b1f6[0x0]||_0x9db99d[_0x58af4a(0x278)];if(!_0x5194f3)return showParentSegmentNotSetError(_0x58af4a(0x21c)+_0x58af4a(0x1db)),0x1;_0x9db99d['verbose']&&(console[_0x58af4a(0x1e3)](_0x58af4a(0x270)+_0x9db99d[_0x58af4a(0x235)]),console[_0x58af4a(0x1e3)](_0x58af4a(0x2a1)+_0x5194f3));const _0xd6a439=await withSpinner(_0x58af4a(0x25a)+_0x5194f3+'\x27...',()=>_0x338d0a['segment'][_0x58af4a(0x1ad)](_0x5194f3),{'verbose':_0x9db99d[_0x58af4a(0x2ab)]}),_0x28b0ba=_0xd6a439[_0x58af4a(0x210)],_0x3dcf14=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x5194f3+_0x58af4a(0x1e4),()=>_0x338d0a[_0x58af4a(0x2bc)]['getParentSQL'](_0x28b0ba),{'verbose':_0x9db99d[_0x58af4a(0x2ab)]});let _0x5658a3=_0x3dcf14['data'];const _0x3244b5=resolveLimit(_0x9db99d[_0x58af4a(0x1ff)],DEFAULT_DISPLAY_LIMIT),_0x1681c1=/\bLIMIT\s+\d+/i[_0x58af4a(0x21e)](_0x5658a3);!_0x1681c1&&(_0x5658a3=_0x5658a3[_0x58af4a(0x29e)]()[_0x58af4a(0x1e8)](/;+$/,''),_0x5658a3=_0x58af4a(0x2aa)+_0x5658a3+_0x58af4a(0x231)+_0x3244b5);_0x9db99d['verbose']&&console[_0x58af4a(0x1e3)](_0x58af4a(0x1a1)+_0x5658a3);const _0x39d255=await withQuerySpinner('Executing\x20parent\x20segment\x20query...',async _0x18a056=>{const _0x593c81=_0x58af4a,_0xee98e2=await _0x338d0a[_0x593c81(0x2a3)]['execute'](_0x5658a3,{'catalog':'td','schema':_0x593c81(0x1a4),'onJobId':_0x1c0bf7=>{const _0x167e2f=_0x593c81;_0x18a056[_0x167e2f(0x23d)](_0x1c0bf7);}});return _0xee98e2;},{'verbose':_0x9db99d[_0x58af4a(0x2ab)]}),_0x2ef5c2=_0x39d255[_0x58af4a(0x210)],_0x100b99=_0x2ef5c2[_0x58af4a(0x1fd)]?'\x20[Job\x20ID:\x20'+_0x2ef5c2[_0x58af4a(0x1fd)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x2ef5c2[_0x58af4a(0x255)][_0x58af4a(0x22f)][_0x58af4a(0x1d2)]()+_0x58af4a(0x286)+(_0x58af4a(0x27e)+formatElapsed(_0x2ef5c2[_0x58af4a(0x255)][_0x58af4a(0x1c8)])+_0x100b99)),await handleQueryOutput(_0x2ef5c2,_0x9db99d),0x0;}}
1
+ const a29_0x40f8eb=a29_0x50ab;(function(_0xed943d,_0x6dd519){const _0x1b2c84=a29_0x50ab,_0x38eae3=_0xed943d();while(!![]){try{const _0x34e60e=parseInt(_0x1b2c84(0x18c))/0x1+-parseInt(_0x1b2c84(0x14f))/0x2+-parseInt(_0x1b2c84(0x1e8))/0x3+-parseInt(_0x1b2c84(0x100))/0x4+parseInt(_0x1b2c84(0x1b0))/0x5+parseInt(_0x1b2c84(0x1c3))/0x6*(-parseInt(_0x1b2c84(0x117))/0x7)+-parseInt(_0x1b2c84(0x15b))/0x8*(-parseInt(_0x1b2c84(0xfb))/0x9);if(_0x34e60e===_0x6dd519)break;else _0x38eae3['push'](_0x38eae3['shift']());}catch(_0x3740dd){_0x38eae3['push'](_0x38eae3['shift']());}}}(a29_0x2ecd,0x663a6));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a29_0x472bdf from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,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'../types/endpoints.js';import{formatRows,formatAsTable}from'../utils/formatters.js';function a29_0x50ab(_0x4cabf5,_0x20ebf7){_0x4cabf5=_0x4cabf5-0xc8;const _0x2ecd1=a29_0x2ecd();let _0x50abbb=_0x2ecd1[_0x4cabf5];return _0x50abbb;}import{parseYamlString}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import a29_0x41d2e6 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../utils/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a29_0x40f8eb(0xec),LEGACY_PARENT_SEGMENT_DIR=a29_0x40f8eb(0x1b9);function openBrowser(_0x297555){const _0x145855=a29_0x40f8eb,_0x254dcb=process['platform'],_0x12f9a9=_0x254dcb===_0x145855(0x177)?'open':_0x254dcb===_0x145855(0x104)?'start':_0x145855(0xd2);spawn(_0x12f9a9,[_0x297555],{'detached':!![],'stdio':'ignore'})['unref']();}function migrateLegacyDirectory(){const _0xdb72cb=a29_0x40f8eb;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x568103=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x568103['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console['error'](a29_0x41d2e6[_0xdb72cb(0x1af)](_0xdb72cb(0x105)+LEGACY_PARENT_SEGMENT_DIR+'/\x20and\x20'+PARENT_SEGMENT_DIR+_0xdb72cb(0x15d))),console[_0xdb72cb(0x150)](a29_0x41d2e6[_0xdb72cb(0x186)](_0xdb72cb(0x164)+LEGACY_PARENT_SEGMENT_DIR+_0xdb72cb(0x119))),![];console['error'](a29_0x41d2e6[_0xdb72cb(0x1af)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20→\x20'+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0xdb72cb(0x150)](a29_0x41d2e6[_0xdb72cb(0x10e)](_0xdb72cb(0x109)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2d0786){const _0x542f0b=_0x2d0786 instanceof Error?_0x2d0786['message']:String(_0x2d0786);return console[_0xdb72cb(0x150)](a29_0x41d2e6['red'](_0xdb72cb(0x17c)+_0x542f0b+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a29_0x40f8eb(0x16e)](_0x396a4e){return migrateLegacyDirectory(),super['run'](_0x396a4e);}}function resolveYamlFile(_0x525bc3){const _0x511f8d=a29_0x40f8eb;if(_0x525bc3[_0x511f8d(0x1ce)](_0x511f8d(0xe9))||_0x525bc3['endsWith'](_0x511f8d(0x162)))return _0x525bc3;return a29_0x472bdf[_0x511f8d(0x1b1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x525bc3)+'.yml');}function formatProgressMessage(_0x3d2e91){const _0x4e29a4=a29_0x40f8eb,_0x3c1505=_0x3d2e91[_0x4e29a4(0xe1)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x3c1505){const [,_0x4acbc0,_0x160344,_0x42194c='']=_0x3c1505;return a29_0x41d2e6['dim'](_0x4acbc0+':')+'\x20'+_0x160344+a29_0x41d2e6[_0x4e29a4(0x186)](_0x42194c);}return a29_0x41d2e6['dim'](_0x3d2e91);}function showFileNotFoundError(_0x4ac263,_0x5e16c4){const _0x48b024=a29_0x40f8eb;console[_0x48b024(0x150)](a29_0x41d2e6[_0x48b024(0xf4)]('Error:\x20File\x20not\x20found:\x20'+_0x4ac263+'\x0a')),console[_0x48b024(0x150)](a29_0x41d2e6[_0x48b024(0x18b)](_0x48b024(0x1ab)+_0x5e16c4+_0x48b024(0x120)));}function showParentSegmentNotSetError(_0x4d65d1){const _0x5cc931=a29_0x40f8eb;console[_0x5cc931(0x150)](a29_0x41d2e6[_0x5cc931(0x1af)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a')),console[_0x5cc931(0x150)](_0x4d65d1);}function a29_0x2ecd(){const _0x448cd5=['trim','Options:\x0a','sampleData','Master\x20+\x20Attributes','addAttributesFile','double','8KfXZOy','varchar','/\x20directories\x20exist.','\x0aChanges\x20to\x20apply\x20to\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Created','\x20\x20\x20\x20-\x20','.yaml','Options:','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','totalEvents','displayValidateResults','\x27\x20with\x20ID:\x20','\x20parent\x20segment\x20\x27','session','segment','errors','\x20Configuration\x20is\x20valid','execute','run','allValid','Attributes','\x20rows\x20','Preview:','displayColumns','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Fetching\x20SQL\x20for\x20\x27','yes','darwin','\x20\x20No\x20sample\x20data\x20available','format','tdx\x20segment\x20parent\x20preview\x20','Options\x20(one\x20required):\x0a','✘\x20Failed\x20to\x20rename\x20directory:\x20','\x20[Job\x20ID:\x20','Source:','interval','columns','displaySampleData','timezone','Fetching\x20current\x20configuration\x20for\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','/app/dw/parentSegments/','dim','Overwrite\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','parentSegment','attributes','cyan','621614NdiWVn','start','To\x20cancel:','Output\x20file:\x20','label','addAttributes','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','getParentSQL','rowCount','segment:parent:pull','dirname','pullParentYaml','coveragePercent','behavior','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','addBehaviorsFile','segment:parent:update','foreignKey','using\x20the\x20default\x20path:\x20','segment:parent:run','Session:','Database:\x20','getParentFull','output','Updated','Listing\x20fields\x20for\x20\x27','displayPreviewResults','segment:parent:push','population','\x20Opening\x20','column','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','validateParentYaml','status','displayPreviewHints','yellow','3736420iMCmeG','join','Show\x20parent\x20segment\x20details','enriched','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','segment:parent:view','bold','\x20--attribute\x20\x22','filter','parent_segment','\x20--behavior\x20\x22<name>\x22','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','apply','segment:parent:show','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','workflowId','data','joinKey','1899462wjTfVo','Resolving\x20parent\x20segment\x20\x27','Error:\x20--behavior\x20requires\x20a\x20name\x0a','/app/workflows/','To\x20view\x20sample\x20data:','segment:parent:validate','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Analyzing\x20changes...','repeat','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20--behavior\x20\x22','endsWith','table','behaviors','localeCompare','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','workflowSessionId','Fetching\x20sample\x20data...','Join:','Enriched:','site','keys','scheduleOption','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','No\x20parent\x20segments\x20found','stop','sort','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','displaySummary','addBehaviors','segment:parent:desc','✔\x20Found\x20','👥\x20','matchedCount','Validating\x20configuration...','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','1022337pOIFBH','Parent\x20segment:\x20','✔\x20No\x20changes\x20-\x20\x27','Status:','name','jobId','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','\x20--attribute\x20\x22<name>\x22','Listing\x20parent\x20segments...','\x0aChanges\x20to\x20\x27','No\x20parent\x20segments\x20match\x20pattern:\x20','verbose','web','xdg-open','FINISHED','information_schema','Master\x20Table','\x27...','Create\x20parent\x20segment\x20\x27','Rows:','Attempt:','customerGroupFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','displayMasterInfo','attribute','\x20rows)','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','toLocaleString','match','scheduleType','workflowAttemptId','pushParentYaml','\x20=\x20','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','Join\x20on:','displayBehaviorsStats','.yml','createParent','\x27\x20and\x20run\x20workflow?','parent_segments','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x0aNo\x20sample\x20data\x20available','Site:\x20','use','all','setJobId','-1d','red','updateParent','✔\x20Created\x20parent\x20segment\x20\x27','attributesFile','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','Columns:','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','3427983tqDufw','customersWithEvents','Error:','Fetching\x20parent\x20segment\x20\x27','text','936924BbcOgG','\x20kill','map','Executing\x20parent\x20segment\x20query...','win32','\x0a⚠️\x20\x20Both\x20','Table:\x20','preview','elapsedTimeMillis','✔\x20Renamed\x20directory\x20to\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','SELECT\x20*\x20FROM\x20(\x0a','Available\x20attributes:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','green','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Validate:','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','in\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','toFixed','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Error:\x20--attribute\x20requires\x20a\x20name\x0a','14fzMdMw','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','/\x20directory.\x0a','schemaValid','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20(requires\x20context)\x0a','\x20Context\x20set:\x20','jsonl','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','`\x20to\x20download\x20the\x20configuration\x20first','message','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Updating','json','master','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','customerPercent','number','\x0aUsage:\x20tdx\x20ps\x20preview\x20','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','schemaError','\x0aNew\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Errors:','Audience\x20ID:','\x27\x20is\x20already\x20up\x20to\x20date','Attribute:','log','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20--database\x20and\x20--table\x20are\x20required','database','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','length','\x5c$&','Error\x20parsing\x20YAML:\x20','Behavior:','customerGroup','/attempt/','Creating','string','description','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Name:\x20','Error\x20reading\x20file:\x20','resolveParentId','\x20tdx\x20wf\x20attempt\x20','segment:parent:create','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20field','displayAttributesStats','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','replace','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','YAML\x20file:\x20','245790hrsbOQ','error','Aborted.','segment:parent:sql','utf-8','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'];a29_0x2ecd=function(){return _0x448cd5;};return a29_0x2ecd();}export class ParentSegmentListCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]='segment:parent:list';[a29_0x40f8eb(0x13f)]='List\x20parent\x20segments';async['execute'](_0x1132df){const _0x301d7e=a29_0x40f8eb,{options:_0x3caca1,args:_0x3f120a,tdx:_0x15e29e}=_0x1132df,_0x1239bc=_0x3f120a[0x0];_0x3caca1['verbose']&&(console['error'](_0x301d7e(0xef)+_0x3caca1[_0x301d7e(0x1d8)]),_0x1239bc&&console[_0x301d7e(0x150)]('Pattern:\x20'+_0x1239bc));const _0x411a92=await withSpinner(_0x1239bc?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x1239bc+_0x301d7e(0xd6):_0x301d7e(0xcd),()=>_0x15e29e[_0x301d7e(0x16a)]['listParents'](),{'verbose':_0x3caca1['verbose']});let _0x538f4f=_0x411a92[_0x301d7e(0x1c1)];if(_0x1239bc){const _0xba3478=_0x1239bc[_0x301d7e(0x14c)](/[.+^${}()|[\]\\]/g,_0x301d7e(0x138))[_0x301d7e(0x14c)](/\*/g,'.*')[_0x301d7e(0x14c)](/\?/g,'.'),_0x2a5316=new RegExp('^'+_0xba3478+'$','i');_0x538f4f=_0x538f4f[_0x301d7e(0x1b8)](_0x2af384=>_0x2a5316['test'](_0x2af384[_0x301d7e(0x18a)][_0x301d7e(0xc9)]));}_0x538f4f[_0x301d7e(0x1de)]((_0x3360f3,_0x4ca1a4)=>_0x3360f3['attributes'][_0x301d7e(0xc9)][_0x301d7e(0x1d1)](_0x4ca1a4[_0x301d7e(0x18a)][_0x301d7e(0xc9)])),console[_0x301d7e(0x150)](_0x301d7e(0x1e3)+_0x538f4f[_0x301d7e(0x137)]+'\x20parent\x20segment'+(_0x538f4f[_0x301d7e(0x137)]!==0x1?'s':''));if(_0x3caca1[_0x301d7e(0x179)]===_0x301d7e(0x124)||_0x3caca1[_0x301d7e(0x179)]===_0x301d7e(0x11d))await handleSDKOutput(_0x538f4f,_0x3caca1);else{if(_0x538f4f[_0x301d7e(0x137)]===0x0)_0x1239bc?console[_0x301d7e(0x132)](_0x301d7e(0xcf)+_0x1239bc):console['log'](_0x301d7e(0x1dc));else for(const _0x44b2b3 of _0x538f4f){const _0x524f11=_0x44b2b3[_0x301d7e(0x18a)][_0x301d7e(0x1a8)]?a29_0x41d2e6[_0x301d7e(0x186)]('\x20('+formatRows(_0x44b2b3[_0x301d7e(0x18a)]['population'])+')'):'';console['log'](_0x301d7e(0x1e4)+_0x44b2b3[_0x301d7e(0x18a)][_0x301d7e(0xc9)]+_0x524f11);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x145);[a29_0x40f8eb(0x13f)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x40f8eb(0x16d)](_0x2e59ee){const _0x4a5f83=a29_0x40f8eb,{options:_0x4a0df4,args:_0x4a2c3f,tdx:_0x409151}=_0x2e59ee;console['error'](_0x4a5f83(0x1b4)+_0x4a5f83(0x11f)+_0x4a5f83(0x10a));const _0x1675ef=_0x4a0df4;if(_0x4a2c3f[_0x4a5f83(0x137)]===0x0)return console[_0x4a5f83(0x150)](a29_0x41d2e6[_0x4a5f83(0xf4)](_0x4a5f83(0xdb))),console[_0x4a5f83(0x150)](_0x4a5f83(0xf8)),0x1;const _0x2c3893=_0x4a2c3f[0x0];if(!_0x1675ef[_0x4a5f83(0x135)]||!_0x1675ef['table'])return console[_0x4a5f83(0x150)](_0x4a5f83(0x134)),console[_0x4a5f83(0x150)](_0x4a5f83(0xf8)),0x1;_0x1675ef[_0x4a5f83(0xd0)]&&(console['error'](_0x4a5f83(0xef)+_0x1675ef[_0x4a5f83(0x1d8)]),console[_0x4a5f83(0x150)](_0x4a5f83(0x141)+_0x2c3893),console[_0x4a5f83(0x150)](_0x4a5f83(0x1a1)+_0x1675ef[_0x4a5f83(0x135)]),console[_0x4a5f83(0x150)](_0x4a5f83(0x106)+_0x1675ef[_0x4a5f83(0x1cf)]));const _0x4fce96=await loadJSONFromOptions(_0x1675ef[_0x4a5f83(0x18a)],_0x1675ef[_0x4a5f83(0xf7)]),_0x492fa2=await loadJSONFromOptions(_0x1675ef['behaviors'],_0x1675ef['behaviorsFile']),_0x56ab63=await loadJSONFromOptions(_0x1675ef['customerGroup'],_0x1675ef[_0x4a5f83(0xda)]),_0x273d9b={'name':_0x2c3893,'description':_0x1675ef[_0x4a5f83(0x13f)],'scheduleType':_0x1675ef[_0x4a5f83(0xe2)],'scheduleOption':_0x1675ef[_0x4a5f83(0x1da)],'timezone':_0x1675ef['timezone'],'master':{'parentDatabaseName':_0x1675ef['database'],'parentTableName':_0x1675ef[_0x4a5f83(0x1cf)]},'attributes':_0x4fce96,'behaviors':_0x492fa2,'customerGroup':_0x56ab63},_0x269b25=await withSpinner('Creating\x20parent\x20segment\x20\x27'+_0x2c3893+_0x4a5f83(0xd6),()=>_0x409151[_0x4a5f83(0x16a)][_0x4a5f83(0xea)](_0x273d9b),{'verbose':_0x4a0df4[_0x4a5f83(0xd0)]}),_0xbce3ff=_0x269b25[_0x4a5f83(0x1c1)];return console[_0x4a5f83(0x150)](_0x4a5f83(0xf6)+_0xbce3ff[_0x4a5f83(0xc9)]+_0x4a5f83(0x167)+_0xbce3ff['id']),await handleSDKOutput([_0xbce3ff],_0x4a0df4),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x19c);['description']='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a29_0x40f8eb(0x16d)](_0x298316){const _0x4b278d=a29_0x40f8eb,{options:_0x17023b,args:_0x211bb3,tdx:_0x28afdc}=_0x298316;console[_0x4b278d(0x150)]('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a'+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x4b278d(0x10a));const _0x239e8d=_0x17023b;if(_0x211bb3[_0x4b278d(0x137)]===0x0)return console[_0x4b278d(0x150)](a29_0x41d2e6[_0x4b278d(0xf4)](_0x4b278d(0xdb))),console[_0x4b278d(0x150)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x24ce1c=_0x211bb3[0x0];_0x239e8d[_0x4b278d(0xd0)]&&(console[_0x4b278d(0x150)](_0x4b278d(0xef)+_0x239e8d[_0x4b278d(0x1d8)]),console[_0x4b278d(0x150)]('Parent\x20segment:\x20'+_0x24ce1c));const _0x1992cd=await withSpinner(_0x4b278d(0x183)+_0x24ce1c+_0x4b278d(0xd6),()=>_0x28afdc[_0x4b278d(0x16a)][_0x4b278d(0x1a2)](_0x24ce1c),{'verbose':_0x239e8d['verbose']}),_0x3989d3=_0x1992cd[_0x4b278d(0x1c1)],_0x220a33=await loadJSONFromOptions(_0x239e8d[_0x4b278d(0x191)],_0x239e8d[_0x4b278d(0x159)]),_0x9dfcb7=await loadJSONFromOptions(_0x239e8d[_0x4b278d(0x1e1)],_0x239e8d[_0x4b278d(0x19b)]),_0x431b86={'name':_0x3989d3['name'],'description':_0x239e8d[_0x4b278d(0x13f)]!==undefined?_0x239e8d[_0x4b278d(0x13f)]:_0x3989d3['description'],'scheduleType':_0x239e8d['scheduleType']!==undefined?_0x239e8d['scheduleType']:_0x3989d3[_0x4b278d(0xe2)],'scheduleOption':_0x239e8d[_0x4b278d(0x1da)]!==undefined?_0x239e8d['scheduleOption']:_0x3989d3[_0x4b278d(0x1da)],'timezone':_0x239e8d[_0x4b278d(0x182)]!==undefined?_0x239e8d[_0x4b278d(0x182)]:_0x3989d3[_0x4b278d(0x182)],'master':_0x3989d3[_0x4b278d(0x125)],'attributes':_0x220a33?[..._0x3989d3['attributes']||[],..._0x220a33]:_0x3989d3[_0x4b278d(0x18a)],'behaviors':_0x9dfcb7?[..._0x3989d3['behaviors']||[],..._0x9dfcb7]:_0x3989d3['behaviors'],'customerGroup':_0x3989d3[_0x4b278d(0x13b)]},_0x2cfac9=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x24ce1c+_0x4b278d(0xd6),()=>_0x28afdc[_0x4b278d(0x16a)][_0x4b278d(0xf5)](_0x24ce1c,_0x431b86),{'verbose':_0x239e8d[_0x4b278d(0xd0)]}),_0x361586=_0x2cfac9[_0x4b278d(0x1c1)];return console[_0x4b278d(0x150)](_0x4b278d(0x11e)+_0x361586[_0x4b278d(0xc9)]+'\x27'),await handleSDKOutput([_0x361586],_0x239e8d),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a29_0x40f8eb(0x195);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x113);async[a29_0x40f8eb(0x16d)](_0x4536b8){const _0x284086=a29_0x40f8eb,{options:_0x1caaea,args:_0x1a373d,tdx:_0x44b604}=_0x4536b8,_0x500b5c=_0x1caaea,_0x3b0866=_0x1a373d[0x0]||_0x1caaea[_0x284086(0x189)];if(!_0x3b0866)return showParentSegmentNotSetError(_0x284086(0x19a)+_0x284086(0x133)),0x1;if(_0x500b5c[_0x284086(0xf0)]&&_0x500b5c[_0x284086(0x1a3)])return console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0xf4)](_0x284086(0x12a))),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x1db))),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x19e)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console['error'](a29_0x41d2e6[_0x284086(0x18b)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x20b4c5=_0x500b5c['output']||a29_0x472bdf[_0x284086(0x1b1)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x3b0866)+_0x284086(0xe9));_0x500b5c['verbose']&&(console[_0x284086(0x150)](_0x284086(0xef)+_0x500b5c['site']),console[_0x284086(0x150)](_0x284086(0x1e9)+_0x3b0866),console['error'](_0x284086(0x18f)+_0x20b4c5));const _0x4b79ae=await withSpinner(_0x284086(0xfe)+_0x3b0866+_0x284086(0xd6),()=>_0x44b604[_0x284086(0x16a)][_0x284086(0x197)](_0x3b0866),{'verbose':_0x500b5c[_0x284086(0xd0)]}),_0x5c4acc=_0x4b79ae[_0x284086(0x1c1)];if(existsSync(_0x20b4c5)){const _0xd507f=readFileSync(_0x20b4c5,_0x284086(0x153)),_0x47e1c6=generateDiff(_0xd507f,_0x5c4acc);if(!hasChanges(_0x47e1c6))console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x10e)]('✔')+'\x20No\x20changes\x20-\x20'+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5)+'\x20is\x20already\x20up\x20to\x20date');else{console[_0x284086(0x150)](_0x284086(0xce)+_0x20b4c5+'\x27:'),console['error']('─'[_0x284086(0x1cb)](0x3c)),console[_0x284086(0x150)](formatDiffWithColors(_0x47e1c6)),console[_0x284086(0x150)]('─'[_0x284086(0x1cb)](0x3c));if(!_0x500b5c[_0x284086(0x176)]){const _0x186bbd=await confirmKey(_0x284086(0x187)+_0x20b4c5+'\x27?');if(!_0x186bbd)return console['error'](_0x284086(0x151)),0x1;}writeFileSync(_0x20b4c5,_0x5c4acc,_0x284086(0x153)),console['error'](a29_0x41d2e6['green']('✔')+_0x284086(0x154)+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5));}}else{const _0x752fcd=a29_0x472bdf[_0x284086(0x196)](_0x20b4c5);!existsSync(_0x752fcd)&&mkdirSync(_0x752fcd,{'recursive':!![]}),writeFileSync(_0x20b4c5,_0x5c4acc,'utf-8'),console[_0x284086(0x150)](a29_0x41d2e6['green']('✔')+_0x284086(0x154)+a29_0x41d2e6[_0x284086(0x18b)](_0x20b4c5));}return saveSessionContext({'parent_segment':_0x3b0866},_0x500b5c[_0x284086(0x169)]),console[_0x284086(0x150)](a29_0x41d2e6[_0x284086(0x10e)]('✔')+_0x284086(0x11c)+a29_0x41d2e6[_0x284086(0x186)](_0x284086(0x1b9))+_0x284086(0xe5)+a29_0x41d2e6[_0x284086(0x18b)](_0x3b0866)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1a7);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x122);async[a29_0x40f8eb(0x16d)](_0x5d35a1){const _0x539592=a29_0x40f8eb,{options:_0x1d2ac8,args:_0x28e1f9,tdx:_0x433630}=_0x5d35a1,_0x3667a3=_0x1d2ac8,_0x4ee828=_0x28e1f9[0x0]||_0x1d2ac8[_0x539592(0x189)];if(!_0x4ee828)return showParentSegmentNotSetError(_0x539592(0x12d)+_0x539592(0x140)),0x1;const _0x18cab9=resolveYamlFile(_0x4ee828);if(!existsSync(_0x18cab9))return showFileNotFoundError(_0x18cab9,_0x4ee828),0x1;_0x3667a3[_0x539592(0xd0)]&&(console[_0x539592(0x150)]('Site:\x20'+_0x3667a3[_0x539592(0x1d8)]),console[_0x539592(0x150)]('YAML\x20file:\x20'+_0x18cab9));let _0x248a5e;try{_0x248a5e=readFileSync(_0x18cab9,_0x539592(0x153));}catch(_0x309abc){const _0x3a1b04=_0x309abc instanceof Error?_0x309abc['message']:String(_0x309abc);return console['error'](_0x539592(0x142)+_0x3a1b04),0x1;}const _0x34927b=await withSpinner(_0x539592(0x1ca),()=>_0x433630[_0x539592(0x16a)][_0x539592(0xe4)](_0x248a5e),{'verbose':_0x3667a3[_0x539592(0xd0)]}),_0x165eb9=_0x34927b[_0x539592(0x1c1)],{isNew:_0x4c33fa,name:_0x16e00b,hasChanges:_0x3591dc,diffFormatted:_0x13a5e5}=_0x165eb9;if(!_0x3591dc)return console[_0x539592(0x150)](_0x539592(0x1ea)+_0x16e00b+_0x539592(0x130)),0x0;_0x4c33fa?console[_0x539592(0x150)](_0x539592(0x12c)+_0x16e00b+'\x27:'):console[_0x539592(0x150)](_0x539592(0x15e)+_0x16e00b+'\x27:');console[_0x539592(0x150)]('─'['repeat'](0x3c)),console[_0x539592(0x150)](_0x13a5e5),console[_0x539592(0x150)]('─'[_0x539592(0x1cb)](0x3c));const _0x2045c6=_0x4c33fa?_0x539592(0xd7)+_0x16e00b+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x16e00b+'\x27?';if(!_0x3667a3['yes']){const _0x1a1a65=await confirmKey(_0x2045c6);if(!_0x1a1a65)return console[_0x539592(0x150)](_0x539592(0x151)),0x1;}const _0x239b43=_0x4c33fa?_0x539592(0x13d):_0x539592(0x123),_0x54dd5e=await withSpinner(_0x239b43+_0x539592(0x168)+_0x16e00b+_0x539592(0xd6),()=>_0x165eb9[_0x539592(0x1bd)](),{'verbose':_0x3667a3['verbose']}),_0x558eb8=_0x54dd5e['data'],_0x420450=getConsoleNextUrl(_0x3667a3[_0x539592(0x1d8)],_0x539592(0x185)+_0x558eb8['id']),_0x5c3013=_0x4c33fa?_0x539592(0x160):_0x539592(0x1a4);return console[_0x539592(0x150)]('✔\x20'+_0x5c3013+'\x20parent\x20segment\x20\x27'+_0x558eb8['name']+'\x27'),console[_0x539592(0x150)]('\x20\x20'+_0x420450),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1c8);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x14b);async['execute'](_0x51d84a){const _0x1dadcc=a29_0x40f8eb,{options:_0x316207,args:_0x493362,tdx:_0x421eab}=_0x51d84a,_0x4ff92b=_0x316207,_0x348844=_0x493362[0x0]||_0x316207['parentSegment'];if(!_0x348844)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'+_0x1dadcc(0x115)+_0x1dadcc(0x156)+_0x1dadcc(0x111)+_0x1dadcc(0x1d2)+_0x1dadcc(0x146)),0x1;const _0x54ebef=resolveYamlFile(_0x348844);if(!existsSync(_0x54ebef))return showFileNotFoundError(_0x54ebef,_0x348844),0x1;_0x4ff92b[_0x1dadcc(0xd0)]&&(console[_0x1dadcc(0x150)](_0x1dadcc(0xef)+_0x4ff92b[_0x1dadcc(0x1d8)]),console[_0x1dadcc(0x150)]('YAML\x20file:\x20'+_0x54ebef));let _0x279df6;try{_0x279df6=readFileSync(_0x54ebef,_0x1dadcc(0x153));}catch(_0x17a6d6){const _0x57264c=_0x17a6d6 instanceof Error?_0x17a6d6[_0x1dadcc(0x121)]:String(_0x17a6d6);return console['error'](_0x1dadcc(0x142)+_0x57264c),0x1;}const _0x106f65=createCommandSpinner(a29_0x41d2e6[_0x1dadcc(0x186)](_0x1dadcc(0x1e6)),{'verbose':_0x4ff92b[_0x1dadcc(0xd0)]});_0x106f65[_0x1dadcc(0x18d)]();const _0x435aa0={'onProgress':_0xae780f=>{_0x106f65['text']=formatProgressMessage(_0xae780f);}};if(_0x4ff92b[_0x1dadcc(0x125)])_0x435aa0['master']=!![];if(_0x4ff92b[_0x1dadcc(0x1b3)])_0x435aa0['enriched']=!![];_0x4ff92b['attribute']&&(_0x435aa0['attribute']=_0x4ff92b[_0x1dadcc(0xdd)]);_0x4ff92b[_0x1dadcc(0x199)]&&(_0x435aa0[_0x1dadcc(0x199)]=_0x4ff92b[_0x1dadcc(0x199)]);if(_0x4ff92b['interval'])_0x435aa0[_0x1dadcc(0x17f)]=_0x4ff92b[_0x1dadcc(0x17f)];let _0x26f5af;try{_0x26f5af=await _0x421eab[_0x1dadcc(0x16a)][_0x1dadcc(0x1ac)](_0x279df6,_0x435aa0),_0x106f65[_0x1dadcc(0x1dd)]();}catch(_0x2a91ec){_0x106f65['stop']();throw _0x2a91ec;}const _0x316c27=_0x4ff92b[_0x1dadcc(0x17f)]||_0x1dadcc(0xf3);return this[_0x1dadcc(0x166)](_0x26f5af,_0x435aa0,_0x54ebef,_0x316c27),_0x26f5af[_0x1dadcc(0x16f)]?0x0:0x1;}[a29_0x40f8eb(0x166)](_0x114fdf,_0x1f281a,_0x1c3cd9,_0x33516c){const _0x24694b=a29_0x40f8eb;console['error']('\x0a'+a29_0x41d2e6[_0x24694b(0x1b6)](_0x24694b(0x110))+'\x20'+_0x114fdf[_0x24694b(0xc9)]),console[_0x24694b(0x150)]('═'[_0x24694b(0x1cb)](0x3c)),this[_0x24694b(0xdc)](_0x114fdf);if(typeof _0x1f281a['attribute']===_0x24694b(0x13e)){this[_0x24694b(0x149)](_0x114fdf),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'attribute',_0x1f281a[_0x24694b(0xdd)]);return;}if(_0x1f281a[_0x24694b(0xdd)]===!![]){this['displayAttributesStats'](_0x114fdf),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'attributes');return;}if(typeof _0x1f281a['behavior']==='string'){this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this[_0x24694b(0x1e0)](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,'behavior',_0x1f281a[_0x24694b(0x199)]);return;}if(_0x1f281a['behavior']===!![]){this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this['displaySummary'](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,_0x24694b(0x1d0));return;}this[_0x24694b(0x149)](_0x114fdf),this[_0x24694b(0xe8)](_0x114fdf,_0x33516c),this['displaySummary'](_0x114fdf),this[_0x24694b(0x1ae)](_0x1c3cd9,_0x33516c,_0x24694b(0xf1));}['displayPreviewHints'](_0x2b0c01,_0x1ae73b,_0x3f2ad3,_0x5ca8e6){const _0x496380=a29_0x40f8eb;console[_0x496380(0x150)]('\x0a'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x1c7)));const _0x1276b4=_0x1ae73b!==_0x496380(0xf3)?'\x20--interval\x20'+_0x1ae73b:'';if(_0x3f2ad3===_0x496380(0xdd)&&_0x5ca8e6)console['error']('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1b7)+_0x5ca8e6+'\x22'+_0x1276b4));else{if(_0x3f2ad3==='behavior'&&_0x5ca8e6)console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1cd)+_0x5ca8e6+'\x22'+_0x1276b4));else(_0x3f2ad3===_0x496380(0x18a)||_0x3f2ad3==='all')&&console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0xcc)+_0x1276b4));}(_0x3f2ad3===_0x496380(0x1d0)||_0x3f2ad3==='all')&&console['error']('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+_0x496380(0x1ba)+_0x1276b4)),_0x3f2ad3==='all'&&console[_0x496380(0x150)]('\x20\x20'+a29_0x41d2e6[_0x496380(0x186)](_0x496380(0x17a)+_0x2b0c01+'\x20--enriched'+_0x1276b4));}['displayMasterInfo'](_0x43c874){const _0x55d245=a29_0x40f8eb,{master:_0x3a2ec8}=_0x43c874,_0x4a986a=_0x3a2ec8['schemaValid']?a29_0x41d2e6[_0x55d245(0x10e)]('✔'):a29_0x41d2e6['red']('✘');console[_0x55d245(0x150)]('\x0a'+a29_0x41d2e6[_0x55d245(0x186)](_0x55d245(0xd5))),console[_0x55d245(0x150)](_0x4a986a+'\x20'+a29_0x41d2e6[_0x55d245(0x1b6)](_0x3a2ec8['database']+'.'+_0x3a2ec8[_0x55d245(0x1cf)])),_0x3a2ec8[_0x55d245(0x11a)]?_0x3a2ec8[_0x55d245(0x194)]!==undefined&&console[_0x55d245(0x150)]('\x20\x20'+a29_0x41d2e6[_0x55d245(0x186)](_0x55d245(0xd8))+'\x20'+a29_0x41d2e6[_0x55d245(0x18b)](formatRows(_0x3a2ec8['rowCount']))):console['error']('\x20\x20'+a29_0x41d2e6[_0x55d245(0xf4)]('Error:')+'\x20'+_0x3a2ec8[_0x55d245(0x12b)]);}[a29_0x40f8eb(0x149)](_0x288cca){const _0xd4c3eb=a29_0x40f8eb;if(_0x288cca[_0xd4c3eb(0x18a)]['length']===0x0)return;console[_0xd4c3eb(0x150)]('\x0a'+a29_0x41d2e6['dim'](_0xd4c3eb(0x170)));for(const _0x38e72a of _0x288cca[_0xd4c3eb(0x18a)]){const _0x2f5ea0=_0x38e72a[_0xd4c3eb(0x11a)]?a29_0x41d2e6[_0xd4c3eb(0x10e)]('✔'):a29_0x41d2e6[_0xd4c3eb(0xf4)]('✘');let _0x3d7004='';if(_0x38e72a[_0xd4c3eb(0x11a)]&&_0x38e72a[_0xd4c3eb(0x1e5)]!==undefined&&_0x38e72a['coveragePercent']!==undefined){const _0x4ec3cf=_0x38e72a[_0xd4c3eb(0x198)][_0xd4c3eb(0x114)](0x1),_0x1135b7=_0x38e72a[_0xd4c3eb(0x198)]>=0x50?a29_0x41d2e6[_0xd4c3eb(0x10e)]:_0x38e72a['coveragePercent']>=0x32?a29_0x41d2e6[_0xd4c3eb(0x1af)]:a29_0x41d2e6[_0xd4c3eb(0xf4)];_0x3d7004='\x20'+a29_0x41d2e6['dim']('Coverage:')+'\x20'+_0x1135b7(_0x4ec3cf+'%')+'\x20('+formatRows(_0x38e72a[_0xd4c3eb(0x1e5)])+_0xd4c3eb(0xde);}console['error'](_0x2f5ea0+'\x20'+a29_0x41d2e6['bold'](_0x38e72a[_0xd4c3eb(0xc9)])+_0x3d7004),console[_0xd4c3eb(0x150)]('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0x186)](_0xd4c3eb(0x17e))+'\x20'+a29_0x41d2e6[_0xd4c3eb(0x1b6)](_0x38e72a[_0xd4c3eb(0x135)]+'.'+_0x38e72a[_0xd4c3eb(0x1cf)]));const _0x3acd82=_0x38e72a[_0xd4c3eb(0x1c2)]===_0x38e72a[_0xd4c3eb(0x19d)]?a29_0x41d2e6[_0xd4c3eb(0x186)](_0xd4c3eb(0xe7))+'\x20'+_0x38e72a[_0xd4c3eb(0x1c2)]:a29_0x41d2e6['dim'](_0xd4c3eb(0x1d6))+'\x20'+_0x38e72a[_0xd4c3eb(0x1c2)]+_0xd4c3eb(0xe5)+_0x38e72a[_0xd4c3eb(0x19d)];console['error']('\x20\x20'+_0x3acd82),console[_0xd4c3eb(0x150)]('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0x186)]('Columns:')),this[_0xd4c3eb(0x173)](_0x38e72a[_0xd4c3eb(0x180)]),!_0x38e72a['schemaValid']&&console['error']('\x20\x20'+a29_0x41d2e6[_0xd4c3eb(0xf4)](_0xd4c3eb(0xfd))+'\x20'+_0x38e72a[_0xd4c3eb(0x12b)]);}}[a29_0x40f8eb(0xe8)](_0x21a423,_0x4b2fc3){const _0x29a054=a29_0x40f8eb;if(_0x21a423[_0x29a054(0x1d0)][_0x29a054(0x137)]===0x0)return;console[_0x29a054(0x150)]('\x0a'+a29_0x41d2e6[_0x29a054(0x186)]('Behaviors')+'\x20'+a29_0x41d2e6['dim']('('+_0x4b2fc3+')'));for(const _0x459e71 of _0x21a423[_0x29a054(0x1d0)]){const _0x5664c0=_0x459e71[_0x29a054(0x11a)]?a29_0x41d2e6[_0x29a054(0x10e)]('✔'):a29_0x41d2e6[_0x29a054(0xf4)]('✘');let _0x5398da='';if(_0x459e71['schemaValid']&&_0x459e71['customersWithEvents']!==undefined&&_0x459e71[_0x29a054(0x165)]!==undefined){const _0x43a2df=_0x459e71['customerPercent']?.[_0x29a054(0x114)](0x1)||'?',_0x114923=(_0x459e71[_0x29a054(0x127)]??0x0)>=0x32?a29_0x41d2e6[_0x29a054(0x10e)]:(_0x459e71[_0x29a054(0x127)]??0x0)>=0x14?a29_0x41d2e6[_0x29a054(0x1af)]:a29_0x41d2e6[_0x29a054(0xf4)];_0x5398da='\x20'+a29_0x41d2e6[_0x29a054(0x186)]('Customers:')+'\x20'+_0x114923(formatRows(_0x459e71[_0x29a054(0xfc)]))+'\x20('+_0x43a2df+'%)\x20'+a29_0x41d2e6[_0x29a054(0x186)]('Events:')+'\x20'+a29_0x41d2e6[_0x29a054(0x18b)](formatRows(_0x459e71[_0x29a054(0x165)]));}console[_0x29a054(0x150)](_0x5664c0+'\x20'+a29_0x41d2e6['bold'](_0x459e71[_0x29a054(0xc9)])+_0x5398da),console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6[_0x29a054(0x186)](_0x29a054(0x17e))+'\x20'+a29_0x41d2e6[_0x29a054(0x1b6)](_0x459e71[_0x29a054(0x135)]+'.'+_0x459e71[_0x29a054(0x1cf)]));const _0x1c4ce6=_0x459e71['joinKey']===_0x459e71[_0x29a054(0x19d)]?a29_0x41d2e6[_0x29a054(0x186)](_0x29a054(0xe7))+'\x20'+_0x459e71[_0x29a054(0x1c2)]:a29_0x41d2e6[_0x29a054(0x186)]('Join:')+'\x20'+_0x459e71[_0x29a054(0x1c2)]+_0x29a054(0xe5)+_0x459e71[_0x29a054(0x19d)];console[_0x29a054(0x150)]('\x20\x20'+_0x1c4ce6),console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x29a054(0xf9))),this[_0x29a054(0x173)](_0x459e71[_0x29a054(0x180)]),!_0x459e71[_0x29a054(0x11a)]&&console[_0x29a054(0x150)]('\x20\x20'+a29_0x41d2e6[_0x29a054(0xf4)](_0x29a054(0xfd))+'\x20'+_0x459e71[_0x29a054(0x12b)]);}}[a29_0x40f8eb(0x173)](_0x545e74){const _0x4fa933=a29_0x40f8eb;for(const _0x233475 of _0x545e74){_0x233475[_0x4fa933(0x190)]===_0x233475[_0x4fa933(0x1aa)]||_0x233475[_0x4fa933(0x1aa)]==='*'?console[_0x4fa933(0x150)](_0x4fa933(0x161)+_0x233475[_0x4fa933(0x190)]):console[_0x4fa933(0x150)](_0x4fa933(0x161)+_0x233475['label']+'\x20'+a29_0x41d2e6[_0x4fa933(0x186)]('('+_0x233475['column']+')'));}}[a29_0x40f8eb(0x1e0)](_0x3b4b4f){const _0x34223e=a29_0x40f8eb;console[_0x34223e(0x150)]('─'['repeat'](0x3c));if(_0x3b4b4f[_0x34223e(0x16b)][_0x34223e(0x137)]>0x0){console[_0x34223e(0x150)]('\x0a'+a29_0x41d2e6[_0x34223e(0xf4)](_0x34223e(0x12e)));for(const _0x340a24 of _0x3b4b4f[_0x34223e(0x16b)]){console[_0x34223e(0x150)]('\x20\x20'+a29_0x41d2e6[_0x34223e(0xf4)]('•')+'\x20'+_0x340a24);}}_0x3b4b4f[_0x34223e(0x16f)]&&console[_0x34223e(0x150)]('\x0a'+a29_0x41d2e6['green']('✔')+_0x34223e(0x16c));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]='segment:parent:preview';[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x1cc);async[a29_0x40f8eb(0x16d)](_0x2c2ae1){const _0x4eccba=a29_0x40f8eb,{options:_0x1911fc,args:_0x469143,tdx:_0x4cb438}=_0x2c2ae1,_0x58d2f6=_0x1911fc,_0x4aea51=_0x469143[0x0]||_0x1911fc['parentSegment'];if(!_0x4aea51)return showParentSegmentNotSetError(_0x4eccba(0x1d3)+_0x4eccba(0x1df)+_0x4eccba(0x17b)+_0x4eccba(0x136)+_0x4eccba(0x1bc)+_0x4eccba(0x1e7)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x58d2f6[_0x4eccba(0x125)]&&!_0x58d2f6[_0x4eccba(0xdd)]&&!_0x58d2f6['behavior']&&!_0x58d2f6[_0x4eccba(0x1b3)])return console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x118))),console['error']('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x4eccba(0x150)](_0x4eccba(0x163)),console['error'](_0x4eccba(0x1c9)),console[_0x4eccba(0x150)](_0x4eccba(0x126)),console['error'](_0x4eccba(0x1bf)),console[_0x4eccba(0x150)](_0x4eccba(0x1bb)),0x1;const _0x30c199=resolveYamlFile(_0x4aea51);if(!existsSync(_0x30c199))return showFileNotFoundError(_0x30c199,_0x4aea51),0x1;_0x58d2f6[_0x4eccba(0xd0)]&&(console[_0x4eccba(0x150)](_0x4eccba(0xef)+_0x58d2f6['site']),console[_0x4eccba(0x150)](_0x4eccba(0x14e)+_0x30c199));let _0x426dd6;try{_0x426dd6=readFileSync(_0x30c199,'utf-8');}catch(_0x3395be){const _0x1c89b1=_0x3395be instanceof Error?_0x3395be[_0x4eccba(0x121)]:String(_0x3395be);return console[_0x4eccba(0x150)](_0x4eccba(0x142)+_0x1c89b1),0x1;}let _0x6f0a6a;try{_0x6f0a6a=parseYamlString(_0x426dd6);}catch(_0x51b447){const _0x12ee5b=_0x51b447 instanceof Error?_0x51b447['message']:String(_0x51b447);return console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x139)+_0x12ee5b)),0x1;}if(_0x58d2f6[_0x4eccba(0xdd)]===!![]||_0x58d2f6[_0x4eccba(0xdd)]===''){const _0x4af48f=_0x6f0a6a[_0x4eccba(0x18a)]?.[_0x4eccba(0x102)](_0x1ea509=>_0x1ea509[_0x4eccba(0xc9)])||[];if(_0x4af48f[_0x4eccba(0x137)]===0x0)console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)]('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x116))),console[_0x4eccba(0x150)](_0x4eccba(0x10c));for(const _0x238a35 of _0x4af48f){console[_0x4eccba(0x150)]('\x20\x20'+a29_0x41d2e6[_0x4eccba(0x18b)](_0x238a35));}console[_0x4eccba(0x150)](_0x4eccba(0x129)+_0x4aea51+_0x4eccba(0x1b7)+_0x4af48f[0x0]+'\x22');}return 0x1;}if(_0x58d2f6[_0x4eccba(0x199)]===!![]||_0x58d2f6[_0x4eccba(0x199)]===''){const _0x58c80b=_0x6f0a6a[_0x4eccba(0x1d0)]?.['map'](_0x53ff49=>_0x53ff49[_0x4eccba(0xc9)])||[];if(_0x58c80b[_0x4eccba(0x137)]===0x0)console[_0x4eccba(0x150)](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x14d)));else{console['error'](a29_0x41d2e6[_0x4eccba(0xf4)](_0x4eccba(0x1c5))),console[_0x4eccba(0x150)]('Available\x20behaviors:');for(const _0x77bd1c of _0x58c80b){console[_0x4eccba(0x150)]('\x20\x20'+a29_0x41d2e6['cyan'](_0x77bd1c));}console['error'](_0x4eccba(0x129)+_0x4aea51+'\x20--behavior\x20\x22'+_0x58c80b[0x0]+'\x22');}return 0x1;}const _0x10567b=createCommandSpinner(a29_0x41d2e6[_0x4eccba(0x186)](_0x4eccba(0x1d5)),{'verbose':_0x58d2f6[_0x4eccba(0xd0)]});_0x10567b[_0x4eccba(0x18d)]();const _0x499fe7={'onProgress':_0x3b3214=>{const _0x5414f=_0x4eccba;_0x10567b[_0x5414f(0xff)]=formatProgressMessage(_0x3b3214);}};if(_0x58d2f6['master'])_0x499fe7[_0x4eccba(0x125)]=!![];if(_0x58d2f6[_0x4eccba(0xdd)]&&typeof _0x58d2f6['attribute']===_0x4eccba(0x13e))_0x499fe7[_0x4eccba(0xdd)]=_0x58d2f6[_0x4eccba(0xdd)];if(_0x58d2f6['behavior']&&typeof _0x58d2f6['behavior']==='string')_0x499fe7[_0x4eccba(0x199)]=_0x58d2f6[_0x4eccba(0x199)];if(_0x58d2f6[_0x4eccba(0x1b3)])_0x499fe7[_0x4eccba(0x1b3)]=!![];if(_0x58d2f6[_0x4eccba(0x17f)])_0x499fe7[_0x4eccba(0x17f)]=_0x58d2f6['interval'];let _0x1d6b1d;try{_0x1d6b1d=await _0x4cb438[_0x4eccba(0x16a)]['previewParentYaml'](_0x426dd6,_0x499fe7),_0x10567b['stop']();}catch(_0x3c13f){_0x10567b['stop']();throw _0x3c13f;}return await this[_0x4eccba(0x1a6)](_0x1d6b1d,{'master':_0x58d2f6[_0x4eccba(0x125)],'attribute':typeof _0x58d2f6[_0x4eccba(0xdd)]===_0x4eccba(0x13e)?_0x58d2f6[_0x4eccba(0xdd)]:undefined,'behavior':typeof _0x58d2f6[_0x4eccba(0x199)]===_0x4eccba(0x13e)?_0x58d2f6['behavior']:undefined,'enriched':_0x58d2f6[_0x4eccba(0x1b3)]}),_0x1d6b1d['allValid']?0x0:0x1;}async[a29_0x40f8eb(0x1a6)](_0x4771d1,_0x4faf21){const _0x3ef47e=a29_0x40f8eb;console[_0x3ef47e(0x150)]('\x0a'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x3ef47e(0x172))+'\x20'+_0x4771d1['name']),console['error']('═'['repeat'](0x3c));if(_0x4faf21[_0x3ef47e(0x125)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x1e8b86=a29_0x41d2e6[_0x3ef47e(0x186)]('Master:')+'\x20'+a29_0x41d2e6['bold'](_0x4771d1[_0x3ef47e(0x125)][_0x3ef47e(0x135)]+'.'+_0x4771d1['master']['table']);await this[_0x3ef47e(0x181)](_0x1e8b86,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21[_0x3ef47e(0xdd)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x18e5ef=a29_0x41d2e6[_0x3ef47e(0x186)](_0x3ef47e(0x131))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x4faf21[_0x3ef47e(0xdd)]);await this[_0x3ef47e(0x181)](_0x18e5ef,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21[_0x3ef47e(0x199)]&&_0x4771d1[_0x3ef47e(0x157)]){const _0x4ec2f1=a29_0x41d2e6['dim'](_0x3ef47e(0x13a))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x4faf21['behavior']);await this[_0x3ef47e(0x181)](_0x4ec2f1,_0x4771d1[_0x3ef47e(0x157)]);}else{if(_0x4faf21['enriched']&&_0x4771d1[_0x3ef47e(0x157)]){const _0x29020d=a29_0x41d2e6[_0x3ef47e(0x186)](_0x3ef47e(0x1d7))+'\x20'+a29_0x41d2e6[_0x3ef47e(0x1b6)](_0x3ef47e(0x158));await this[_0x3ef47e(0x181)](_0x29020d,_0x4771d1[_0x3ef47e(0x157)]);}else!_0x4771d1['sampleData']&&console[_0x3ef47e(0x150)](_0x3ef47e(0xee));}}}if(_0x4771d1[_0x3ef47e(0x16b)][_0x3ef47e(0x137)]>0x0){console['error']('─'[_0x3ef47e(0x1cb)](0x3c)),console[_0x3ef47e(0x150)]('\x0a'+a29_0x41d2e6[_0x3ef47e(0xf4)](_0x3ef47e(0x12e)));for(const _0x1a6cef of _0x4771d1[_0x3ef47e(0x16b)]){console[_0x3ef47e(0x150)]('\x20\x20'+a29_0x41d2e6[_0x3ef47e(0xf4)]('•')+'\x20'+_0x1a6cef);}}}async[a29_0x40f8eb(0x181)](_0x2aae97,_0x1dc80f){const _0x36f6f9=a29_0x40f8eb;if(_0x1dc80f['length']===0x0){console[_0x36f6f9(0x150)]('\x0a'+_0x2aae97),console['error'](_0x36f6f9(0x178));return;}console[_0x36f6f9(0x150)]('\x0a'+_0x2aae97);const _0x44d5dd=Object[_0x36f6f9(0x1d9)](_0x1dc80f[0x0])['map'](_0xa10959=>({'name':_0xa10959,'type':typeof _0x1dc80f[0x0][_0xa10959]===_0x36f6f9(0x128)?_0x36f6f9(0x15a):_0x36f6f9(0x15c)})),_0x116e7b={'queryId':_0x36f6f9(0x107),'columns':_0x44d5dd,'data':_0x1dc80f,'stats':{'state':_0x36f6f9(0xd3),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x1dc80f[_0x36f6f9(0x137)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x41ac44=formatAsTable(_0x116e7b,_0x1dc80f[_0x36f6f9(0x137)],!![]);await writeOutput(_0x41ac44,undefined,_0x36f6f9(0x1cf));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x19f);[a29_0x40f8eb(0x13f)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a29_0x40f8eb(0x16d)](_0x44c385){const _0x3e5739=a29_0x40f8eb,{options:_0x7f0e4f,args:_0x4faa3f,tdx:_0x5a68b0}=_0x44c385,_0x266fc2=_0x7f0e4f,_0x266798=_0x4faa3f[0x0]||_0x7f0e4f[_0x3e5739(0x189)];if(!_0x266798)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a'+_0x3e5739(0xdf)),0x1;const _0x2e7496=resolveYamlFile(_0x266798);if(existsSync(_0x2e7496)){_0x266fc2[_0x3e5739(0xd0)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x2e7496);let _0x1d3b25;try{_0x1d3b25=readFileSync(_0x2e7496,_0x3e5739(0x153));}catch(_0x41b2d9){const _0x2d8e2f=_0x41b2d9 instanceof Error?_0x41b2d9[_0x3e5739(0x121)]:String(_0x41b2d9);return console[_0x3e5739(0x150)](_0x3e5739(0x142)+_0x2d8e2f),0x1;}const _0x2b3410=await withSpinner(_0x3e5739(0x1ca),()=>_0x5a68b0[_0x3e5739(0x16a)]['pushParentYaml'](_0x1d3b25),{'verbose':_0x266fc2[_0x3e5739(0xd0)]}),_0x280227=_0x2b3410[_0x3e5739(0x1c1)],{isNew:_0x3b27d6,name:_0x7680a7,hasChanges:_0x32e952,diffFormatted:_0x37737e}=_0x280227;if(_0x32e952){_0x3b27d6?console['error'](_0x3e5739(0x12c)+_0x7680a7+'\x27:'):console[_0x3e5739(0x150)](_0x3e5739(0x15e)+_0x7680a7+'\x27:');console['error']('─'[_0x3e5739(0x1cb)](0x3c)),console[_0x3e5739(0x150)](_0x37737e),console['error']('─'['repeat'](0x3c));const _0x4e44d2=_0x3b27d6?_0x3e5739(0xd7)+_0x7680a7+_0x3e5739(0xeb):'Apply\x20changes\x20to\x20\x27'+_0x7680a7+'\x27\x20and\x20run\x20workflow?';if(!_0x266fc2[_0x3e5739(0x176)]){const _0x4d8a75=await confirmKey(_0x4e44d2);if(!_0x4d8a75)return console[_0x3e5739(0x150)](_0x3e5739(0x151)),0x1;}const _0x41605f=_0x3b27d6?_0x3e5739(0x13d):_0x3e5739(0x123);await withSpinner(_0x41605f+'\x20parent\x20segment\x20\x27'+_0x7680a7+_0x3e5739(0xd6),()=>_0x280227[_0x3e5739(0x1bd)](),{'verbose':_0x266fc2[_0x3e5739(0xd0)]});const _0xba39f6=_0x3b27d6?_0x3e5739(0x160):_0x3e5739(0x1a4);console[_0x3e5739(0x150)]('✔\x20'+_0xba39f6+_0x3e5739(0x168)+_0x7680a7+'\x27');}else console[_0x3e5739(0x150)](_0x3e5739(0x1ea)+_0x7680a7+'\x27\x20is\x20up\x20to\x20date');}const _0x15f8f0=await withSpinner(_0x3e5739(0xfa)+_0x266798+'\x27...',()=>_0x5a68b0['segment']['runParent'](_0x266798),{'verbose':_0x266fc2['verbose']}),_0x5b572e=_0x15f8f0['data'],_0x403570=getConsoleUrl(_0x266fc2[_0x3e5739(0x1d8)],_0x3e5739(0x1c6)+_0x5b572e[_0x3e5739(0x1c0)]+'/sessions/'+_0x5b572e[_0x3e5739(0x1d4)]+_0x3e5739(0x13c)+_0x5b572e[_0x3e5739(0xe3)]);return console[_0x3e5739(0x150)]('\x0a✔\x20Workflow\x20started'),console['error']('\x20\x20'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x12f))+'\x20'+_0x5b572e['audienceId']),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x3e5739(0xc8))+'\x20'+_0x5b572e[_0x3e5739(0x1ad)]),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x1a0))+'\x20'+_0x5b572e[_0x3e5739(0x1d4)]),console[_0x3e5739(0x150)]('\x20\x20'+a29_0x41d2e6['dim'](_0x3e5739(0xd9))+'\x20'+_0x5b572e['workflowAttemptId']),console[_0x3e5739(0x150)]('\x20\x20'+_0x403570),console['error']('\x0a'+a29_0x41d2e6[_0x3e5739(0x186)](_0x3e5739(0x18e))+_0x3e5739(0x144)+_0x5b572e[_0x3e5739(0xe3)]+_0x3e5739(0x101)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{['name']='segment:parent:fields';[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x15f);async['execute'](_0x4f55db){const _0x48b4ff=a29_0x40f8eb,{options:_0x358f51,args:_0x458ea4,tdx:_0x54c37e}=_0x4f55db,_0xd2d729=_0x458ea4[0x0]||_0x358f51[_0x48b4ff(0x189)];if(!_0xd2d729)return showParentSegmentNotSetError(_0x48b4ff(0xe6)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment'),0x1;_0x358f51[_0x48b4ff(0xd0)]&&(console[_0x48b4ff(0x150)](_0x48b4ff(0xef)+_0x358f51['site']),console[_0x48b4ff(0x150)](_0x48b4ff(0x1e9)+_0xd2d729));const _0xd5f563=await withSpinner(_0x48b4ff(0x1a5)+_0xd2d729+_0x48b4ff(0xd6),()=>_0x54c37e['segment']['listFields'](_0xd2d729),{'verbose':_0x358f51['verbose']}),_0x29a818=_0xd5f563[_0x48b4ff(0x1c1)];console[_0x48b4ff(0x150)](_0x48b4ff(0x1e3)+_0x29a818[_0x48b4ff(0x137)]+_0x48b4ff(0x148)+(_0x29a818[_0x48b4ff(0x137)]!==0x1?'s':''));if(_0x358f51[_0x48b4ff(0x124)]||_0x358f51[_0x48b4ff(0x11d)])return await handleSDKOutput(_0x29a818,_0x358f51),0x0;return displayFieldsHumanReadable(_0x29a818,_0xd2d729),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1b5);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x1b2);async[a29_0x40f8eb(0x16d)](_0x100e1a){const _0x2f0d0f=a29_0x40f8eb,{options:_0x590afe,args:_0xf1830a,tdx:_0x10f113}=_0x100e1a,_0x43376e=_0x590afe,_0x471c00=_0xf1830a[0x0]||_0x590afe['parentSegment'];if(!_0x471c00)return showParentSegmentNotSetError(_0x2f0d0f(0x174)+_0x2f0d0f(0x188)+_0x2f0d0f(0x156)+_0x2f0d0f(0xed)),0x1;_0x590afe[_0x2f0d0f(0xd0)]&&(console[_0x2f0d0f(0x150)](_0x2f0d0f(0xef)+_0x590afe[_0x2f0d0f(0x1d8)]),console[_0x2f0d0f(0x150)]('Parent\x20segment:\x20'+_0x471c00));const _0xb0d279=await withSpinner(_0x2f0d0f(0xfe)+_0x471c00+_0x2f0d0f(0xd6),()=>_0x10f113['segment']['getParentFull'](_0x471c00),{'verbose':_0x590afe['verbose']}),_0x2f27a7=_0xb0d279[_0x2f0d0f(0x1c1)];if(_0x43376e[_0x2f0d0f(0xd1)]){const _0x18f041=getConsoleNextUrl(_0x43376e[_0x2f0d0f(0x1d8)],_0x2f0d0f(0x185)+_0x2f27a7['id']);return console[_0x2f0d0f(0x150)](a29_0x41d2e6['green']('✔')+_0x2f0d0f(0x1a9)+a29_0x41d2e6[_0x2f0d0f(0x18b)](_0x18f041)),openBrowser(_0x18f041),0x0;}return await handleSingleObjectOutput(_0x2f27a7,_0x590afe),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a29_0x40f8eb(0xc9)]=a29_0x40f8eb(0x1e2);[a29_0x40f8eb(0x13f)]='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a29_0x40f8eb(0x16d)](_0x5f1941){const _0x1fd189=a29_0x40f8eb,{options:_0xe61666,args:_0x14bde8,tdx:_0x11f654}=_0x5f1941,_0x514f42=_0x14bde8[0x0]||_0xe61666[_0x1fd189(0x189)];if(!_0x514f42)return showParentSegmentNotSetError(_0x1fd189(0x11b)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20specific\x20parent\x20segment'),0x1;_0xe61666[_0x1fd189(0xd0)]&&(console[_0x1fd189(0x150)](_0x1fd189(0xef)+_0xe61666['site']),console[_0x1fd189(0x150)](_0x1fd189(0x1e9)+_0x514f42));const _0x70b853=await withSpinner(_0x1fd189(0x1c4)+_0x514f42+_0x1fd189(0xd6),()=>_0x11f654['segment'][_0x1fd189(0x143)](_0x514f42),{'verbose':_0xe61666[_0x1fd189(0xd0)]}),_0x1d6e9a=_0x70b853[_0x1fd189(0x1c1)],_0x15b9e4=await withSpinner(_0x1fd189(0x175)+_0x514f42+_0x1fd189(0xd6),()=>_0x11f654['segment']['getParentSQL'](_0x1d6e9a),{'verbose':_0xe61666[_0x1fd189(0xd0)]}),_0x1dde82=await executeSchemaQuery(_0x15b9e4[_0x1fd189(0x1c1)],_0x11f654,_0xe61666);return await handleQueryOutput(_0x1dde82,_0xe61666),0x0;}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a29_0x40f8eb(0x152);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x147);async[a29_0x40f8eb(0x16d)](_0x3b0a65){const _0x3ca9b6=a29_0x40f8eb,{options:_0x339dda,args:_0x26f6e8,tdx:_0x4132a1}=_0x3b0a65,_0x2d7557=_0x26f6e8[0x0]||_0x339dda[_0x3ca9b6(0x189)];if(!_0x2d7557)return showParentSegmentNotSetError(_0x3ca9b6(0xcb)+_0x3ca9b6(0x184)),0x1;_0x339dda[_0x3ca9b6(0xd0)]&&(console[_0x3ca9b6(0x150)](_0x3ca9b6(0xef)+_0x339dda[_0x3ca9b6(0x1d8)]),console[_0x3ca9b6(0x150)](_0x3ca9b6(0x1e9)+_0x2d7557));const _0x3f454b=await withSpinner(_0x3ca9b6(0x1c4)+_0x2d7557+'\x27...',()=>_0x4132a1[_0x3ca9b6(0x16a)]['resolveParentId'](_0x2d7557),{'verbose':_0x339dda[_0x3ca9b6(0xd0)]}),_0x6554de=_0x3f454b[_0x3ca9b6(0x1c1)],_0x4176c3=await withSpinner(_0x3ca9b6(0x175)+_0x2d7557+_0x3ca9b6(0xd6),()=>_0x4132a1[_0x3ca9b6(0x16a)]['getParentSQL'](_0x6554de),{'verbose':_0x339dda[_0x3ca9b6(0xd0)]}),_0x8b436f=_0x4176c3[_0x3ca9b6(0x1c1)];return _0x339dda[_0x3ca9b6(0x179)]===_0x3ca9b6(0x124)||_0x339dda[_0x3ca9b6(0x179)]===_0x3ca9b6(0x11d)?await handleSDKOutput([{'sql':_0x8b436f}],_0x339dda):console[_0x3ca9b6(0x132)](_0x8b436f),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a29_0x40f8eb(0x1be);[a29_0x40f8eb(0x13f)]=a29_0x40f8eb(0x10d);async[a29_0x40f8eb(0x16d)](_0x214782){const _0xa18f52=a29_0x40f8eb,{options:_0x37390d,args:_0x1166ad,tdx:_0x20c0a6}=_0x214782,_0x2354b8=_0x1166ad[0x0]||_0x37390d[_0xa18f52(0x189)];if(!_0x2354b8)return showParentSegmentNotSetError(_0xa18f52(0x192)+_0xa18f52(0x14a)),0x1;_0x37390d[_0xa18f52(0xd0)]&&(console[_0xa18f52(0x150)]('Site:\x20'+_0x37390d[_0xa18f52(0x1d8)]),console[_0xa18f52(0x150)](_0xa18f52(0x1e9)+_0x2354b8));const _0x484071=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2354b8+_0xa18f52(0xd6),()=>_0x20c0a6[_0xa18f52(0x16a)][_0xa18f52(0x143)](_0x2354b8),{'verbose':_0x37390d[_0xa18f52(0xd0)]}),_0x27513f=_0x484071['data'],_0x3ac2f3=await withSpinner(_0xa18f52(0x175)+_0x2354b8+'\x27...',()=>_0x20c0a6[_0xa18f52(0x16a)][_0xa18f52(0x193)](_0x27513f),{'verbose':_0x37390d['verbose']});let _0x3d2955=_0x3ac2f3[_0xa18f52(0x1c1)];const _0x42d53c=resolveLimit(_0x37390d['limit'],DEFAULT_DISPLAY_LIMIT),_0x399803=/\bLIMIT\s+\d+/i['test'](_0x3d2955);!_0x399803&&(_0x3d2955=_0x3d2955[_0xa18f52(0x155)]()['replace'](/;+$/,''),_0x3d2955=_0xa18f52(0x10b)+_0x3d2955+_0xa18f52(0x10f)+_0x42d53c);_0x37390d['verbose']&&console[_0xa18f52(0x150)]('SQL\x20query:\x0a'+_0x3d2955);const _0x449475=await withQuerySpinner(_0xa18f52(0x103),async _0x3a7346=>{const _0xcac343=_0xa18f52,_0x44539f=await _0x20c0a6['query'][_0xcac343(0x16d)](_0x3d2955,{'catalog':'td','schema':_0xcac343(0xd4),'onJobId':_0x5c6e18=>{const _0x546c56=_0xcac343;_0x3a7346[_0x546c56(0xf2)](_0x5c6e18);}});return _0x44539f;},{'verbose':_0x37390d['verbose']}),_0x48d9cd=_0x449475[_0xa18f52(0x1c1)],_0x28d752=_0x48d9cd['jobId']?_0xa18f52(0x17d)+_0x48d9cd[_0xa18f52(0xca)]+']':'';return console[_0xa18f52(0x150)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x48d9cd['stats']['processedRows'][_0xa18f52(0xe0)]()+_0xa18f52(0x171)+(_0xa18f52(0x112)+formatElapsed(_0x48d9cd['stats'][_0xa18f52(0x108)])+_0x28d752)),await handleQueryOutput(_0x48d9cd,_0x37390d),0x0;}}
@@ -1 +1 @@
1
- const a30_0xb4cc3=a30_0x3119;(function(_0x458094,_0x2c6514){const _0x2bdbef=a30_0x3119,_0x107b61=_0x458094();while(!![]){try{const _0x17a791=parseInt(_0x2bdbef(0x83))/0x1+-parseInt(_0x2bdbef(0x80))/0x2*(-parseInt(_0x2bdbef(0x7d))/0x3)+-parseInt(_0x2bdbef(0x7f))/0x4+parseInt(_0x2bdbef(0x84))/0x5+-parseInt(_0x2bdbef(0x79))/0x6+parseInt(_0x2bdbef(0x78))/0x7*(parseInt(_0x2bdbef(0x7e))/0x8)+parseInt(_0x2bdbef(0x86))/0x9*(parseInt(_0x2bdbef(0x82))/0xa);if(_0x17a791===_0x2c6514)break;else _0x107b61['push'](_0x107b61['shift']());}catch(_0x4dfb42){_0x107b61['push'](_0x107b61['shift']());}}}(a30_0x146c,0xd12f3));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';function a30_0x3119(_0x5ba88e,_0x1e47ba){_0x5ba88e=_0x5ba88e-0x71;const _0x146c26=a30_0x146c();let _0x3119d4=_0x146c26[_0x5ba88e];return _0x3119d4;}function a30_0x146c(){const _0x419424=['error','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','config','length','7obFIFm','3908916aUqwYT','name','\x20\x20Global:\x20~/.config/tdx/tdx.json','execute','198hKhdFL','1401096qSISIm','4844236mXnoEM','12552GdnHcZ','map','1420VaJCuU','991026FYTbET','3785735SeegAt','scope','24201oBYlpr','description','profiles','Error:\x20','List\x20all\x20available\x20profiles','log','message'];a30_0x146c=function(){return _0x419424;};return a30_0x146c();}import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0xb4cc3(0x7a)]=a30_0xb4cc3(0x88);[a30_0xb4cc3(0x87)]=a30_0xb4cc3(0x71);async[a30_0xb4cc3(0x7c)](_0x5ce911){const _0x2e63d5=a30_0xb4cc3,{options:_0x3bf9a5}=_0x5ce911;try{const _0x114e64=listProfiles(),_0x1b3be0=getActiveProfile();if(_0x114e64[_0x2e63d5(0x77)]===0x0)return console['log']('No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a'),console[_0x2e63d5(0x72)](_0x2e63d5(0x75)),console[_0x2e63d5(0x72)](_0x2e63d5(0x7b)),0x0;const _0x893313=_0x114e64[_0x2e63d5(0x81)](_0x5408b4=>{const _0x1d83e8=_0x2e63d5,_0x1f3bd6=_0x5408b4['name']===_0x1b3be0,_0xdbfd8c=getProfileParams(_0x5408b4[_0x1d83e8(0x76)]);return{'name':_0x5408b4[_0x1d83e8(0x7a)],'active':_0x1f3bd6,'scope':_0x5408b4[_0x1d83e8(0x85)],'description':_0x5408b4[_0x1d83e8(0x76)][_0x1d83e8(0x87)]||'','params':_0xdbfd8c};});return await handleSDKOutput(_0x893313,_0x3bf9a5),0x0;}catch(_0x83faa8){return _0x83faa8 instanceof Error&&console[_0x2e63d5(0x74)](_0x2e63d5(0x89)+_0x83faa8[_0x2e63d5(0x73)]),0x1;}}}
1
+ const a30_0x11d6eb=a30_0x2519;function a30_0x2519(_0x42473f,_0x4a1943){_0x42473f=_0x42473f-0x175;const _0x24cd29=a30_0x24cd();let _0x251973=_0x24cd29[_0x42473f];return _0x251973;}(function(_0x4a1bc3,_0x49a1b9){const _0x4bbc78=a30_0x2519,_0x14ae66=_0x4a1bc3();while(!![]){try{const _0x1b2b4f=parseInt(_0x4bbc78(0x180))/0x1*(parseInt(_0x4bbc78(0x18a))/0x2)+parseInt(_0x4bbc78(0x183))/0x3*(-parseInt(_0x4bbc78(0x17c))/0x4)+parseInt(_0x4bbc78(0x182))/0x5+-parseInt(_0x4bbc78(0x18c))/0x6*(parseInt(_0x4bbc78(0x176))/0x7)+parseInt(_0x4bbc78(0x18d))/0x8*(-parseInt(_0x4bbc78(0x17e))/0x9)+-parseInt(_0x4bbc78(0x175))/0xa+parseInt(_0x4bbc78(0x188))/0xb*(parseInt(_0x4bbc78(0x184))/0xc);if(_0x1b2b4f===_0x49a1b9)break;else _0x14ae66['push'](_0x14ae66['shift']());}catch(_0x530ac0){_0x14ae66['push'](_0x14ae66['shift']());}}}(a30_0x24cd,0xe7262));function a30_0x24cd(){const _0x37ed10=['3UunkLQ','15901296MSeOsU','execute','log','List\x20all\x20available\x20profiles','22dkRMjW','error','58IynkEP','length','12UCXJth','941776kbpmno','8950140JCsgrS','2734074BejBmQ','profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','message','\x20\x20Global:\x20~/.config/tdx/tdx.json','6039084FFoixl','config','27IyMUCK','name','8927VIcilc','Error:\x20','7884010RLHseC'];a30_0x24cd=function(){return _0x37ed10;};return a30_0x24cd();}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../utils/command-output.js';export class ProfilesCommand extends BaseCommand{[a30_0x11d6eb(0x17f)]=a30_0x11d6eb(0x177);['description']=a30_0x11d6eb(0x187);async[a30_0x11d6eb(0x185)](_0x422c61){const _0x4ea1c8=a30_0x11d6eb,{options:_0x1e0332}=_0x422c61;try{const _0x5db41e=listProfiles(),_0x12aaba=getActiveProfile();if(_0x5db41e[_0x4ea1c8(0x18b)]===0x0)return console[_0x4ea1c8(0x186)](_0x4ea1c8(0x178)),console[_0x4ea1c8(0x186)](_0x4ea1c8(0x179)),console[_0x4ea1c8(0x186)](_0x4ea1c8(0x17b)),0x0;const _0x3c9510=_0x5db41e['map'](_0x155a62=>{const _0x4e8b3f=_0x4ea1c8,_0x2b9744=_0x155a62[_0x4e8b3f(0x17f)]===_0x12aaba,_0x195fc3=getProfileParams(_0x155a62[_0x4e8b3f(0x17d)]);return{'name':_0x155a62[_0x4e8b3f(0x17f)],'active':_0x2b9744,'scope':_0x155a62['scope'],'description':_0x155a62[_0x4e8b3f(0x17d)]['description']||'','params':_0x195fc3};});return await handleSDKOutput(_0x3c9510,_0x1e0332),0x0;}catch(_0x10c979){return _0x10c979 instanceof Error&&console[_0x4ea1c8(0x189)](_0x4ea1c8(0x181)+_0x10c979[_0x4ea1c8(0x17a)]),0x1;}}}
@@ -1 +1 @@
1
- const a31_0xd30a8d=a31_0xf0cf;(function(_0x720062,_0x1fb136){const _0x1654ce=a31_0xf0cf,_0x470ac3=_0x720062();while(!![]){try{const _0x42aeac=-parseInt(_0x1654ce(0x19c))/0x1*(parseInt(_0x1654ce(0x1a3))/0x2)+-parseInt(_0x1654ce(0x18f))/0x3*(parseInt(_0x1654ce(0x1a5))/0x4)+-parseInt(_0x1654ce(0x17c))/0x5*(parseInt(_0x1654ce(0x17d))/0x6)+-parseInt(_0x1654ce(0x1ad))/0x7+-parseInt(_0x1654ce(0x192))/0x8+parseInt(_0x1654ce(0x1af))/0x9+parseInt(_0x1654ce(0x18e))/0xa;if(_0x42aeac===_0x1fb136)break;else _0x470ac3['push'](_0x470ac3['shift']());}catch(_0x12b79d){_0x470ac3['push'](_0x470ac3['shift']());}}}(a31_0x4e1c,0xd279e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0x4e1c(){const _0x2de3ee=['39205460nPlVIF','5145ROdGtk','\x20-\x20','data','6737592JisGUD','query','validate','message','totalSplits','state','in\x20','file','Query\x20completed:\x20Processed\x20','database','1znqMND','...','originalMessage','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','Executing\x20statement\x20','processedRows','catalog','2227878VXNVAN','site','724LyNIvU','push','Executing\x20query...','completedSplits','setExtra','\x20rows\x20','length','error','4468247bkarQR','name','3476304sDsvvm','elapsedTimeMillis','10JAwgFK','1619454SLfIbt','Site:\x20','jobId','output','Statement\x20','Executing\x20query\x20[','SQL:\x20','\x20[Job\x20ID:\x20','No\x20SQL\x20provided','Run\x20Trino\x20queries\x20(streaming)','join','stats','Schema:\x20','Error:\x20','verbose','Catalog:\x20','setJobId'];a31_0x4e1c=function(){return _0x2de3ee;};return a31_0x4e1c();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';function a31_0xf0cf(_0x531163,_0x3f389f){_0x531163=_0x531163-0x17b;const _0x4e1cb5=a31_0x4e1c();let _0xf0cf7d=_0x4e1cb5[_0x531163];return _0xf0cf7d;}import{writeFileSync}from'fs';import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{[a31_0xd30a8d(0x1ae)]='query';['description']=a31_0xd30a8d(0x186);async['execute'](_0x388393){const _0x4260b4=a31_0xd30a8d,{options:_0x13a22b,args:_0x1eea92,tdx:_0x4965f6}=_0x388393,_0x2c2d4b=_0x1eea92[0x0],_0x346d53=_0x13a22b[_0x4260b4(0x199)];let _0x216cd9;try{if(_0x346d53)_0x216cd9=readSqlStatementsFromFile(_0x346d53);else{if(_0x2c2d4b==='-')_0x216cd9=await readSqlStatementsFromStdin();else{if(_0x2c2d4b&&isSqlFilePath(_0x2c2d4b))_0x216cd9=readSqlStatementsFromFile(_0x2c2d4b);else{if(_0x2c2d4b)_0x216cd9=splitSqlStatements(_0x2c2d4b);else throw new Error(_0x4260b4(0x185));}}}}catch(_0x4c9356){return console['error'](_0x4260b4(0x18a)+_0x4c9356[_0x4260b4(0x195)]),0x1;}const _0x8d9371=_0x13a22b[_0x4260b4(0x19b)]||'information_schema',_0x2695df=_0x13a22b[_0x4260b4(0x1a2)];try{const _0x50c189=[],_0x42e3d2=!!_0x13a22b['output'];for(let _0x42216e=0x0;_0x42216e<_0x216cd9['length'];_0x42216e++){const _0x479e07=_0x216cd9[_0x42216e],_0x2f5a82=_0x42216e+0x1,_0x92c747=_0x216cd9[_0x4260b4(0x1ab)],_0x4b03f4=_0x92c747>0x1;_0x13a22b[_0x4260b4(0x18b)]&&(console[_0x4260b4(0x1ac)]('\x0a'+(_0x4b03f4?_0x4260b4(0x181)+_0x2f5a82+'/'+_0x92c747+':':'')),console[_0x4260b4(0x1ac)](_0x4260b4(0x17e)+_0x13a22b[_0x4260b4(0x1a4)]),console[_0x4260b4(0x1ac)](_0x4260b4(0x18c)+(_0x2695df||'td')),console[_0x4260b4(0x1ac)](_0x4260b4(0x189)+_0x8d9371),console[_0x4260b4(0x1ac)](_0x4260b4(0x183)+_0x479e07));const _0x800fc2=_0x4b03f4?_0x4260b4(0x1a0)+_0x2f5a82+'/'+_0x92c747+_0x4260b4(0x19d):_0x4260b4(0x1a7);try{const _0x333b22=await withQuerySpinner(_0x800fc2,async _0x42eebc=>{const _0xb7de0a=_0x4260b4,_0x241a6b=await _0x4965f6[_0xb7de0a(0x193)]['execute'](_0x479e07,{'catalog':_0x2695df,'schema':_0x8d9371,'onJobId':_0x33445f=>{const _0x275c1c=_0xb7de0a;_0x42eebc[_0x275c1c(0x18d)](_0x33445f);},'onProgress':_0xa68a8=>{const _0x4f22ac=_0xb7de0a;_0x42eebc['setPhase'](_0x4f22ac(0x182)+_0xa68a8[_0x4f22ac(0x197)]+']'),_0x42eebc[_0x4f22ac(0x1a9)](formatRows(_0xa68a8['processedRows'])+_0x4f22ac(0x1aa)+_0xa68a8[_0x4f22ac(0x1a8)]+'/'+_0xa68a8[_0x4f22ac(0x196)]+'\x20splits');}});return _0x241a6b;},{'verbose':_0x13a22b[_0x4260b4(0x18b)]}),_0x29428d=_0x333b22[_0x4260b4(0x191)],_0x3a04b3=_0x29428d[_0x4260b4(0x17f)]?_0x4260b4(0x184)+_0x29428d[_0x4260b4(0x17f)]+']':'',_0x3a335b=_0x4b03f4?'Statement\x20'+_0x2f5a82+'/'+_0x92c747+_0x4260b4(0x190):'';console[_0x4260b4(0x1ac)]('✔\x20'+_0x3a335b+_0x4260b4(0x19a)+formatRows(_0x29428d['stats'][_0x4260b4(0x1a1)])+'\x20rows\x20'+(_0x4260b4(0x198)+formatElapsed(_0x29428d[_0x4260b4(0x188)][_0x4260b4(0x17b)])+_0x3a04b3));if(_0x4b03f4&&_0x42e3d2){const _0xf1c2e=resolveOutputOptions(_0x13a22b),_0x3c4721=await formatQueryOutput(_0x29428d,_0xf1c2e);_0x50c189[_0x4260b4(0x1a6)](_0x3c4721);}else await handleQueryOutput(_0x29428d,_0x13a22b);}catch(_0x402434){const _0x4bb563=_0x4b03f4?_0x4260b4(0x181)+_0x2f5a82+'/'+_0x92c747+':\x0a':'',_0x46c4a5=_0x402434 instanceof SDKError?_0x402434[_0x4260b4(0x19e)]:_0x402434[_0x4260b4(0x195)];return console[_0x4260b4(0x1ac)](''+_0x4bb563+_0x46c4a5),0x1;}}if(_0x216cd9[_0x4260b4(0x1ab)]>0x1&&_0x42e3d2&&_0x50c189[_0x4260b4(0x1ab)]>0x0){const _0x244666=_0x50c189[_0x4260b4(0x187)]('\x0a');writeFileSync(_0x13a22b[_0x4260b4(0x180)],_0x244666),console[_0x4260b4(0x1ac)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x13a22b[_0x4260b4(0x180)]);}return 0x0;}catch(_0x453255){throw _0x453255;}}[a31_0xd30a8d(0x194)](_0x493ad8){const _0x49ec27=a31_0xd30a8d,_0x2c865b=_0x493ad8['args'][0x0],_0x3148a2=_0x493ad8['options'][_0x49ec27(0x199)];if(!_0x2c865b&&!_0x3148a2)return _0x49ec27(0x19f);if(_0x2c865b&&_0x3148a2)return'Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option';return undefined;}}
1
+ const a31_0x170cb1=a31_0x2f8b;(function(_0x449f29,_0x91ac80){const _0x3af3ff=a31_0x2f8b,_0x5557e6=_0x449f29();while(!![]){try{const _0xe47cc1=-parseInt(_0x3af3ff(0xae))/0x1+parseInt(_0x3af3ff(0x95))/0x2*(-parseInt(_0x3af3ff(0xa1))/0x3)+parseInt(_0x3af3ff(0xa3))/0x4+parseInt(_0x3af3ff(0x8b))/0x5+-parseInt(_0x3af3ff(0xb0))/0x6+-parseInt(_0x3af3ff(0xac))/0x7*(parseInt(_0x3af3ff(0xa8))/0x8)+-parseInt(_0x3af3ff(0x8f))/0x9;if(_0xe47cc1===_0x91ac80)break;else _0x5557e6['push'](_0x5557e6['shift']());}catch(_0x2b4459){_0x5557e6['push'](_0x5557e6['shift']());}}}(a31_0x76bc,0x55220));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a31_0x76bc(){const _0x4ac6ea=['2952yUpbBw','options','2784900rfBrqM','Executing\x20query\x20[','\x20rows\x20','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','originalMessage','4251608XfIDtO','Statement\x20','args','\x0aAll\x20results\x20saved\x20to\x20','7pvvjTS','processedRows','111428WLBgci','site','205740THtwFF','length','output','completedSplits','catalog','in\x20','file','verbose','Executing\x20statement\x20','stats','\x20splits','3472000oqVUey','Executing\x20query...','setJobId','description','1927800PEhacO','Schema:\x20','Catalog:\x20','SQL:\x20','jobId','information_schema','306QIPpHY','\x20[Job\x20ID:\x20','setExtra','Error:\x20','totalSplits','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','error','join','state','Site:\x20','data','No\x20SQL\x20provided'];a31_0x76bc=function(){return _0x4ac6ea;};return a31_0x76bc();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../utils/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../utils/sql-parser.js';import{writeFileSync}from'fs';function a31_0x2f8b(_0x440bdd,_0x4c9a0a){_0x440bdd=_0x440bdd-0x8b;const _0x76bcbd=a31_0x76bc();let _0x2f8b70=_0x76bcbd[_0x440bdd];return _0x2f8b70;}import{withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../utils/formatters.js';export class QueryCommand extends BaseCommand{['name']='query';[a31_0x170cb1(0x8e)]='Run\x20Trino\x20queries\x20(streaming)';async['execute'](_0x1250bf){const _0x276aaf=a31_0x170cb1,{options:_0x52ce07,args:_0x3ef05c,tdx:_0x4a2809}=_0x1250bf,_0x36e29f=_0x3ef05c[0x0],_0x19ba08=_0x52ce07[_0x276aaf(0xb6)];let _0x486636;try{if(_0x19ba08)_0x486636=readSqlStatementsFromFile(_0x19ba08);else{if(_0x36e29f==='-')_0x486636=await readSqlStatementsFromStdin();else{if(_0x36e29f&&isSqlFilePath(_0x36e29f))_0x486636=readSqlStatementsFromFile(_0x36e29f);else{if(_0x36e29f)_0x486636=splitSqlStatements(_0x36e29f);else throw new Error(_0x276aaf(0xa0));}}}}catch(_0x554be8){return console[_0x276aaf(0x9b)](_0x276aaf(0x98)+_0x554be8['message']),0x1;}const _0x1e4a72=_0x52ce07['database']||_0x276aaf(0x94),_0x77c19a=_0x52ce07[_0x276aaf(0xb4)];try{const _0x169336=[],_0x1c87e1=!!_0x52ce07[_0x276aaf(0xb2)];for(let _0x2ba2fe=0x0;_0x2ba2fe<_0x486636[_0x276aaf(0xb1)];_0x2ba2fe++){const _0x1968e6=_0x486636[_0x2ba2fe],_0x3bcf71=_0x2ba2fe+0x1,_0x3914ac=_0x486636['length'],_0x4cd0ff=_0x3914ac>0x1;_0x52ce07[_0x276aaf(0xb7)]&&(console[_0x276aaf(0x9b)]('\x0a'+(_0x4cd0ff?_0x276aaf(0xa9)+_0x3bcf71+'/'+_0x3914ac+':':'')),console[_0x276aaf(0x9b)](_0x276aaf(0x9e)+_0x52ce07[_0x276aaf(0xaf)]),console[_0x276aaf(0x9b)](_0x276aaf(0x91)+(_0x77c19a||'td')),console[_0x276aaf(0x9b)](_0x276aaf(0x90)+_0x1e4a72),console['error'](_0x276aaf(0x92)+_0x1968e6));const _0x1fb0b4=_0x4cd0ff?_0x276aaf(0xb8)+_0x3bcf71+'/'+_0x3914ac+'...':_0x276aaf(0x8c);try{const _0x2ff9ad=await withQuerySpinner(_0x1fb0b4,async _0xe0bfa5=>{const _0x3262c0=await _0x4a2809['query']['execute'](_0x1968e6,{'catalog':_0x77c19a,'schema':_0x1e4a72,'onJobId':_0x361d3d=>{const _0x371330=a31_0x2f8b;_0xe0bfa5[_0x371330(0x8d)](_0x361d3d);},'onProgress':_0x3cb370=>{const _0x421f9f=a31_0x2f8b;_0xe0bfa5['setPhase'](_0x421f9f(0xa4)+_0x3cb370[_0x421f9f(0x9d)]+']'),_0xe0bfa5[_0x421f9f(0x97)](formatRows(_0x3cb370[_0x421f9f(0xad)])+_0x421f9f(0xa5)+_0x3cb370[_0x421f9f(0xb3)]+'/'+_0x3cb370[_0x421f9f(0x99)]+_0x421f9f(0xba));}});return _0x3262c0;},{'verbose':_0x52ce07[_0x276aaf(0xb7)]}),_0xb47234=_0x2ff9ad[_0x276aaf(0x9f)],_0x29d39f=_0xb47234[_0x276aaf(0x93)]?_0x276aaf(0x96)+_0xb47234[_0x276aaf(0x93)]+']':'',_0x5324d2=_0x4cd0ff?_0x276aaf(0xa9)+_0x3bcf71+'/'+_0x3914ac+'\x20-\x20':'';console[_0x276aaf(0x9b)]('✔\x20'+_0x5324d2+'Query\x20completed:\x20Processed\x20'+formatRows(_0xb47234[_0x276aaf(0xb9)]['processedRows'])+_0x276aaf(0xa5)+(_0x276aaf(0xb5)+formatElapsed(_0xb47234[_0x276aaf(0xb9)]['elapsedTimeMillis'])+_0x29d39f));if(_0x4cd0ff&&_0x1c87e1){const _0x77f59b=resolveOutputOptions(_0x52ce07),_0x462cfa=await formatQueryOutput(_0xb47234,_0x77f59b);_0x169336['push'](_0x462cfa);}else await handleQueryOutput(_0xb47234,_0x52ce07);}catch(_0x26f30b){const _0x37cafe=_0x4cd0ff?_0x276aaf(0xa9)+_0x3bcf71+'/'+_0x3914ac+':\x0a':'',_0x309659=_0x26f30b instanceof SDKError?_0x26f30b[_0x276aaf(0xa7)]:_0x26f30b['message'];return console[_0x276aaf(0x9b)](''+_0x37cafe+_0x309659),0x1;}}if(_0x486636[_0x276aaf(0xb1)]>0x1&&_0x1c87e1&&_0x169336[_0x276aaf(0xb1)]>0x0){const _0x377729=_0x169336[_0x276aaf(0x9c)]('\x0a');writeFileSync(_0x52ce07['output'],_0x377729),console[_0x276aaf(0x9b)](_0x276aaf(0xab)+_0x52ce07[_0x276aaf(0xb2)]);}return 0x0;}catch(_0x3cd33c){throw _0x3cd33c;}}['validate'](_0x1c3221){const _0x579129=a31_0x170cb1,_0x3ea4b1=_0x1c3221[_0x579129(0xaa)][0x0],_0x3a6c6f=_0x1c3221[_0x579129(0xa2)][_0x579129(0xb6)];if(!_0x3ea4b1&&!_0x3a6c6f)return _0x579129(0xa6);if(_0x3ea4b1&&_0x3a6c6f)return _0x579129(0x9a);return undefined;}}
@@ -1 +1 @@
1
- const a32_0x28d401=a32_0x266a;(function(_0x2e054a,_0x55d996){const _0x26621f=a32_0x266a,_0x16327d=_0x2e054a();while(!![]){try{const _0x4df906=parseInt(_0x26621f(0xee))/0x1+-parseInt(_0x26621f(0x113))/0x2+-parseInt(_0x26621f(0xd4))/0x3+parseInt(_0x26621f(0x141))/0x4+-parseInt(_0x26621f(0x12f))/0x5+parseInt(_0x26621f(0x14c))/0x6+-parseInt(_0x26621f(0x114))/0x7*(-parseInt(_0x26621f(0x10a))/0x8);if(_0x4df906===_0x55d996)break;else _0x16327d['push'](_0x16327d['shift']());}catch(_0x22db8b){_0x16327d['push'](_0x16327d['shift']());}}}(a32_0x3367,0xdd9d4));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';function a32_0x266a(_0x250dcc,_0x3e9e5e){_0x250dcc=_0x250dcc-0xd1;const _0x3367b6=a32_0x3367();let _0x266a4b=_0x3367b6[_0x250dcc];return _0x266a4b;}function a32_0x3367(){const _0xae9047=['Creating\x20folder\x20\x27','segment:desc','INVALID_ARGUMENT','in\x20','segmentName','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','/e/','limit','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20Segment\x20name:\x20','\x27...','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','8489640DGpdfR','Resolving\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','resolveParentId','segment:folder:list','cause','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','code','✖\x20Query\x20failed\x20[','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Executing\x20segment\x20query...','includes','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20view\x20-w','listFolders','Listing\x20folders\x20for\x20parent\x20\x27','type','7080300yySjNf','Folder\x20ID\x20missing\x20from\x20resolved\x20path','test','name','Folder\x20ID:\x20','Parent\x20ID:\x20','\x20\x20Cause:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20[Job\x20ID:\x20','parentSegment','Segment\x20ID\x20missing\x20from\x20resolved\x20path','5085288IrTMOK','fullPath','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','getFolder','execute','message','Resolved\x20folder\x20ID:\x20','error','length','Usage:\x20tdx\x20sg\x20desc\x20<name>','SEGMENT_NOT_FOUND','Segment\x20ID:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:sql','getParent','Folder\x20name:\x20','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','replace','segment:folder:create','verbose','query','information_schema','Use:\x20tdx\x20ps\x20show','folder','getSegmentSQL','SQL\x20query:\x0a','4743009vZvXAo','Parent\x20name:\x20','log','Resolved\x20type:\x20','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','\x20folder','\x20rows\x20','Resolving\x20path\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','stats','Fetching\x20folder\x20details...','parent','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Create\x20segment\x20folder\x20for\x20organization','processedRows','\x20\x20Full\x20path:\x20','Resolving\x20parent\x20folder\x20\x27','resolveFolderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','SELECT\x20*\x20FROM\x20(\x0a','segment:describe','\x20Opening\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','✔\x20Created\x20folder\x20\x27','\x20\x20Folder\x20path:\x20','1706647eKzJPx','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','Fetching\x20parent\x20segment\x20details...','trim','parentId','Resolved\x20parent\x20ID:\x20','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','elapsedTimeMillis','Error:\x20','segmentId','folderPath','segment:folder:show','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','resolvePathToResource','Use:\x20tdx\x20ps\x20sql','Site:\x20','jobId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','folderId','Resolved\x20YAML\x20file:\x20','Show\x20segment\x20folder\x20details','createFolder','format','10944040tzSvLT','web','site','segment','Parent\x20segment:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Examples:','Resolving\x20parent\x20segment\x20\x27','url','3011224aFZDkP','7jhpthX','Usage:\x20tdx\x20sg\x20show\x20<name>','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','parentFolder','data','Get\x20SQL\x20query\x20for\x20child\x20segment','description','Fetching\x20SQL\x20for\x20segment...','(root)','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20folder\x20\x27','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Target\x20path:\x20','/app/ps/'];a32_0x3367=function(){return _0xae9047;};return a32_0x3367();}import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0x12689e from'chalk';function resolveSegmentTarget(_0x204d59,_0x4e88c4,_0x5d9cfd){const _0xe3949=a32_0x266a;if(isYamlFilePath(_0x204d59))try{const _0x3431fd=resolveYamlFilePath(_0x204d59);return _0x5d9cfd&&(console['error'](_0xe3949(0x106)+_0x204d59),console[_0xe3949(0x153)]('\x20\x20Parent\x20segment:\x20'+_0x3431fd[_0xe3949(0x14a)]),console['error'](_0xe3949(0x12c)+_0x3431fd[_0xe3949(0x127)]),console[_0xe3949(0x153)](_0xe3949(0xed)+(_0x3431fd[_0xe3949(0xfb)]||_0xe3949(0x11c))),console[_0xe3949(0x153)](_0xe3949(0xe4)+_0x3431fd[_0xe3949(0x14d)])),_0x3431fd[_0xe3949(0x14d)];}catch(_0x11be9b){throw new SDKError(ErrorCode[_0xe3949(0x125)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x11be9b[_0xe3949(0x151)]);}if(!_0x4e88c4)throw new SDKError(ErrorCode[_0xe3949(0x125)],_0xe3949(0x148));return _0x4e88c4+'/'+_0x204d59;}export class SegmentDescribeCommand extends BaseCommand{['name']=a32_0x28d401(0xe9);[a32_0x28d401(0x11a)]=a32_0x28d401(0x13c);async[a32_0x28d401(0x150)](_0x38ac9e){const _0x128376=a32_0x28d401,{options:_0x32f4b0,args:_0x3e3860,tdx:_0x4265d1}=_0x38ac9e,_0x44c53f=_0x3e3860[0x0],_0x4dac72=!_0x44c53f&&!!_0x32f4b0[_0x128376(0x14a)],_0x1a8104=_0x44c53f||_0x32f4b0[_0x128376(0x14a)];if(!_0x1a8104)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x128376(0x153)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error'](_0x128376(0x110)),console[_0x128376(0x153)](_0x128376(0xef)),console[_0x128376(0x153)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console['error'](_0x128376(0x120)),console[_0x128376(0x153)](_0x128376(0x138)),0x1;try{const _0x9a4b65=_0x32f4b0['segmentPath'];let _0x48a091=_0x1a8104;!_0x4dac72&&_0x9a4b65&&!_0x1a8104[_0x128376(0x13b)]('/')&&(_0x48a091=_0x9a4b65+'/'+_0x1a8104,_0x32f4b0[_0x128376(0x160)]&&console['error'](_0x128376(0xf6)+_0x48a091));const _0xa213df=await withSpinner(_0x128376(0xdc)+_0x48a091+'\x27...',()=>_0x4265d1[_0x128376(0x10d)][_0x128376(0xfe)](_0x48a091),{'verbose':_0x32f4b0[_0x128376(0x160)]}),_0x5c4540=_0xa213df[_0x128376(0x118)];_0x32f4b0[_0x128376(0x160)]&&(console['error'](_0x128376(0xd7)+_0x5c4540[_0x128376(0x140)]),console[_0x128376(0x153)]('Parent\x20ID:\x20'+_0x5c4540['parentId']),_0x5c4540['folderId']&&console[_0x128376(0x153)](_0x128376(0x145)+_0x5c4540[_0x128376(0x105)]),_0x5c4540['segmentId']&&console[_0x128376(0x153)](_0x128376(0x157)+_0x5c4540['segmentId']));if(_0x5c4540[_0x128376(0x140)]===_0x128376(0xe0)){const _0x281c1d=await withSpinner(_0x128376(0xf1),()=>_0x4265d1[_0x128376(0x10d)][_0x128376(0x15b)](_0x5c4540[_0x128376(0xf3)]),{'verbose':_0x32f4b0[_0x128376(0x160)]});await handleSingleObjectOutput(_0x281c1d['data'],_0x32f4b0);}else{if(_0x5c4540[_0x128376(0x140)]===_0x128376(0xd1)){if(!_0x5c4540[_0x128376(0x105)])throw new SDKError(ErrorCode[_0x128376(0x11d)],_0x128376(0x142));const _0x596ad9=await withSpinner(_0x128376(0xdf),()=>_0x4265d1[_0x128376(0x10d)][_0x128376(0x14f)](_0x5c4540['folderId']),{'verbose':_0x32f4b0[_0x128376(0x160)]});await handleSingleObjectOutput(_0x596ad9[_0x128376(0x118)],_0x32f4b0);}else{if(_0x5c4540['type']==='segment'){if(!_0x5c4540[_0x128376(0xfa)])throw new SDKError(ErrorCode[_0x128376(0x156)],_0x128376(0x14b));const _0x1b1fe=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4265d1[_0x128376(0x10d)]['getSegment'](_0x5c4540['parentId'],_0x5c4540['segmentId']),{'verbose':_0x32f4b0[_0x128376(0x160)]});await handleSingleObjectOutput(_0x1b1fe[_0x128376(0x118)],_0x32f4b0);}}}return 0x0;}catch(_0x47c58a){if(_0x47c58a instanceof SDKError)return console[_0x128376(0x153)](_0x128376(0xf9)+_0x47c58a[_0x128376(0x151)]),_0x47c58a[_0x128376(0x134)]&&console[_0x128376(0x153)](_0x128376(0x147)+_0x47c58a[_0x128376(0x134)]),0x1;throw _0x47c58a;}}}export class SegmentShowCommand extends BaseCommand{[a32_0x28d401(0x144)]='segment:show';['description']=a32_0x28d401(0x14e);async[a32_0x28d401(0x150)](_0x145604){const _0x5d0924=a32_0x28d401,{options:_0x2dea5b,args:_0x5cdf7e,tdx:_0x139f35}=_0x145604,_0x4dd051=_0x5cdf7e[0x0];if(!_0x4dd051)return console[_0x5d0924(0x153)](_0x5d0924(0xf7)),console[_0x5d0924(0x153)](_0x5d0924(0x115)),console[_0x5d0924(0x153)](_0x5d0924(0xe7)),console[_0x5d0924(0x153)](_0x5d0924(0x110)),console[_0x5d0924(0x153)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x5d0924(0x153)](_0x5d0924(0x135)),0x1;try{const _0x5f17bc=_0x2dea5b[_0x5d0924(0x14a)],_0x1f78f7=resolveSegmentTarget(_0x4dd051,_0x5f17bc,_0x2dea5b[_0x5d0924(0x160)]);_0x2dea5b['verbose']&&console[_0x5d0924(0x153)](_0x5d0924(0x121)+_0x1f78f7);const _0x140569=await withSpinner(_0x5d0924(0x130)+_0x4dd051+_0x5d0924(0x12d),()=>_0x139f35[_0x5d0924(0x10d)][_0x5d0924(0xfe)](_0x1f78f7),{'verbose':_0x2dea5b[_0x5d0924(0x160)]}),_0x1e9512=_0x140569['data'];_0x2dea5b[_0x5d0924(0x160)]&&(console[_0x5d0924(0x153)](_0x5d0924(0xd7)+_0x1e9512[_0x5d0924(0x140)]),console[_0x5d0924(0x153)](_0x5d0924(0x146)+_0x1e9512[_0x5d0924(0xf3)]));if(_0x1e9512['type']==='folder')return console['error']('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error'](_0x5d0924(0x12e)),0x1;if(_0x1e9512[_0x5d0924(0x140)]===_0x5d0924(0xe0))return console[_0x5d0924(0x153)](_0x5d0924(0x103)),console[_0x5d0924(0x153)](_0x5d0924(0x163)),0x1;if(!_0x1e9512['segmentId'])throw new SDKError(ErrorCode[_0x5d0924(0x156)],_0x5d0924(0x14b));const _0x10a4a5=await withSpinner(_0x5d0924(0x11b),()=>_0x139f35[_0x5d0924(0x10d)][_0x5d0924(0xd2)](_0x1e9512[_0x5d0924(0xf3)],_0x1e9512[_0x5d0924(0xfa)]),{'verbose':_0x2dea5b['verbose']});let _0x43ea29=_0x10a4a5[_0x5d0924(0x118)];const _0x38f78e=resolveLimit(_0x2dea5b[_0x5d0924(0x12a)],DEFAULT_DISPLAY_LIMIT),_0x3f8aef=/\bLIMIT\s+\d+/i[_0x5d0924(0x143)](_0x43ea29);!_0x3f8aef&&(_0x43ea29=_0x43ea29[_0x5d0924(0xf2)]()[_0x5d0924(0x15e)](/;+$/,''),_0x43ea29=_0x5d0924(0xe8)+_0x43ea29+'\x0a)\x20AS\x20segment_query\x0aLIMIT\x20'+_0x38f78e);_0x2dea5b['verbose']&&console[_0x5d0924(0x153)](_0x5d0924(0xd3)+_0x43ea29);const _0x562a85=await withQuerySpinner(_0x5d0924(0x13a),async _0x15da98=>{const _0x140f1e=_0x5d0924,_0x5c4b2e=await _0x139f35[_0x140f1e(0x161)][_0x140f1e(0x150)](_0x43ea29,{'catalog':'td','schema':_0x140f1e(0x162),'onJobId':_0x5ab43=>{_0x15da98['setJobId'](_0x5ab43);}});return _0x5c4b2e;},{'verbose':_0x2dea5b['verbose']}),_0x59ac25=_0x562a85[_0x5d0924(0x118)],_0x4c19cc=_0x59ac25[_0x5d0924(0x101)]?_0x5d0924(0x149)+_0x59ac25[_0x5d0924(0x101)]+']':'';return console[_0x5d0924(0x153)]('✔\x20Query\x20completed:\x20Processed\x20'+_0x59ac25[_0x5d0924(0xde)][_0x5d0924(0xe3)]['toLocaleString']()+_0x5d0924(0xdb)+(_0x5d0924(0x126)+formatElapsed(_0x59ac25[_0x5d0924(0xde)][_0x5d0924(0xf8)])+_0x4c19cc)),await handleQueryOutput(_0x59ac25,_0x2dea5b),0x0;}catch(_0x3eca53){if(_0x3eca53 instanceof SDKError)return console[_0x5d0924(0x153)](_0x5d0924(0x137)+_0x3eca53[_0x5d0924(0x136)]+']'),console['error']('\x0a'+_0x3eca53[_0x5d0924(0x151)]),0x1;throw _0x3eca53;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x133);[a32_0x28d401(0x11a)]=a32_0x28d401(0x102);async[a32_0x28d401(0x150)](_0x2bde74){const _0x2d0375=a32_0x28d401,{options:_0x3b0fcd,args:_0x4c298d,tdx:_0x16a7cc}=_0x2bde74;if(_0x4c298d[_0x2d0375(0x154)]===0x0)return console[_0x2d0375(0x153)](_0x2d0375(0x159)),console[_0x2d0375(0x153)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x29290f=_0x4c298d[0x0];try{_0x3b0fcd['verbose']&&(console[_0x2d0375(0x153)]('Site:\x20'+_0x3b0fcd[_0x2d0375(0x10c)]),console['error'](_0x2d0375(0xd5)+_0x29290f));const _0x233ce6=await withSpinner(_0x2d0375(0x111)+_0x29290f+_0x2d0375(0x12d),()=>_0x16a7cc[_0x2d0375(0x10d)][_0x2d0375(0x132)](_0x29290f),{'verbose':_0x3b0fcd[_0x2d0375(0x160)]}),_0x4bd9dd=_0x233ce6[_0x2d0375(0x118)];_0x3b0fcd[_0x2d0375(0x160)]&&console['error'](_0x2d0375(0xf4)+_0x4bd9dd);const _0x2c480b=await withSpinner(_0x2d0375(0x13f)+_0x29290f+_0x2d0375(0x12d),()=>_0x16a7cc[_0x2d0375(0x10d)][_0x2d0375(0x13e)](_0x4bd9dd),{'verbose':_0x3b0fcd[_0x2d0375(0x160)]}),_0x21493e=_0x2c480b[_0x2d0375(0x118)];return console[_0x2d0375(0x153)]('✔\x20Found\x20'+_0x21493e[_0x2d0375(0x154)]+_0x2d0375(0xda)+(_0x21493e['length']!==0x1?'s':'')),await handleSDKOutput(_0x21493e,_0x3b0fcd),0x0;}catch(_0x3eeb98){if(_0x3eeb98 instanceof SDKError)return console[_0x2d0375(0x153)](_0x2d0375(0xf9)+_0x3eeb98[_0x2d0375(0x151)]),_0x3eeb98[_0x2d0375(0x134)]&&console[_0x2d0375(0x153)]('\x20\x20Cause:\x20'+_0x3eeb98['cause']),0x1;throw _0x3eeb98;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0xfc);[a32_0x28d401(0x11a)]=a32_0x28d401(0x107);async[a32_0x28d401(0x150)](_0x5d3765){const _0x3a3634=a32_0x28d401,{options:_0x28a41e,args:_0x7883ae,tdx:_0x3686fd}=_0x5d3765;if(_0x7883ae['length']===0x0)return console[_0x3a3634(0x153)](_0x3a3634(0xd8)),console[_0x3a3634(0x153)](_0x3a3634(0x131)),0x1;try{const {parentId:_0x4c6cfe,childId:_0x1742a3}=parseSegmentRef(_0x7883ae[0x0]);_0x28a41e['verbose']&&(console[_0x3a3634(0x153)](_0x3a3634(0x100)+_0x28a41e[_0x3a3634(0x10c)]),console['error'](_0x3a3634(0xd5)+_0x4c6cfe),_0x1742a3&&console[_0x3a3634(0x153)](_0x3a3634(0x15c)+_0x1742a3));if(!_0x1742a3)return console['error'](_0x3a3634(0xd9)),0x1;const _0x235874=await withSpinner(_0x3a3634(0x111)+_0x4c6cfe+_0x3a3634(0x12d),()=>_0x3686fd[_0x3a3634(0x10d)]['resolveParentId'](_0x4c6cfe),{'verbose':_0x28a41e[_0x3a3634(0x160)]}),_0x3e52ff=_0x235874[_0x3a3634(0x118)];_0x28a41e[_0x3a3634(0x160)]&&console['error'](_0x3a3634(0xf4)+_0x3e52ff);const _0x9e38ab=await withSpinner('Resolving\x20folder\x20\x27'+_0x1742a3+_0x3a3634(0x12d),()=>_0x3686fd['segment'][_0x3a3634(0xe6)](_0x3e52ff,_0x1742a3),{'verbose':_0x28a41e[_0x3a3634(0x160)]}),_0x11147a=_0x9e38ab[_0x3a3634(0x118)];_0x28a41e[_0x3a3634(0x160)]&&console[_0x3a3634(0x153)](_0x3a3634(0x152)+_0x11147a);const _0x591ded=await withSpinner(_0x3a3634(0x11e)+_0x1742a3+_0x3a3634(0x12d),()=>_0x3686fd[_0x3a3634(0x10d)][_0x3a3634(0x14f)](_0x11147a),{'verbose':_0x28a41e[_0x3a3634(0x160)]});return await handleSDKOutput([_0x591ded[_0x3a3634(0x118)]],_0x28a41e),0x0;}catch(_0x4d215b){if(_0x4d215b instanceof SDKError)return console['error'](_0x3a3634(0xf9)+_0x4d215b[_0x3a3634(0x151)]),_0x4d215b['cause']&&console[_0x3a3634(0x153)](_0x3a3634(0x147)+_0x4d215b[_0x3a3634(0x134)]),0x1;throw _0x4d215b;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x15a);[a32_0x28d401(0x11a)]=a32_0x28d401(0x119);async['execute'](_0x18c7b3){const _0x11dfc1=a32_0x28d401,{options:_0x35a619,args:_0x5a3652,tdx:_0x24576d}=_0x18c7b3,_0x29664b=_0x5a3652[0x0];if(!_0x29664b)return console['error'](_0x11dfc1(0xf7)),console[_0x11dfc1(0x153)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>'),console[_0x11dfc1(0x153)]('Examples:'),console[_0x11dfc1(0x153)](_0x11dfc1(0x116)),console[_0x11dfc1(0x153)](_0x11dfc1(0x11f)),0x1;try{const _0x23e707=_0x35a619[_0x11dfc1(0x14a)],_0x30ca6f=resolveSegmentTarget(_0x29664b,_0x23e707,_0x35a619[_0x11dfc1(0x160)]);_0x35a619[_0x11dfc1(0x160)]&&console['error'](_0x11dfc1(0x121)+_0x30ca6f);const _0x1b39c6=await withSpinner('Resolving\x20\x27'+_0x29664b+_0x11dfc1(0x12d),()=>_0x24576d[_0x11dfc1(0x10d)][_0x11dfc1(0xfe)](_0x30ca6f),{'verbose':_0x35a619[_0x11dfc1(0x160)]}),_0xc8d33=_0x1b39c6[_0x11dfc1(0x118)];_0x35a619[_0x11dfc1(0x160)]&&(console[_0x11dfc1(0x153)](_0x11dfc1(0xd7)+_0xc8d33[_0x11dfc1(0x140)]),console['error'](_0x11dfc1(0x146)+_0xc8d33['parentId']));if(_0xc8d33['type']===_0x11dfc1(0xd1))return console[_0x11dfc1(0x153)]('Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.'),console[_0x11dfc1(0x153)]('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0xc8d33[_0x11dfc1(0x140)]===_0x11dfc1(0xe0))return console['error'](_0x11dfc1(0x15d)),console[_0x11dfc1(0x153)](_0x11dfc1(0xff)),0x1;if(!_0xc8d33['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x11dfc1(0x14b));const _0x44b903=await withSpinner(_0x11dfc1(0x11b),()=>_0x24576d['segment']['getSegmentSQL'](_0xc8d33['parentId'],_0xc8d33[_0x11dfc1(0xfa)]),{'verbose':_0x35a619[_0x11dfc1(0x160)]}),_0xfc4579=_0x44b903[_0x11dfc1(0x118)];return _0x35a619[_0x11dfc1(0x109)]==='json'||_0x35a619['format']==='jsonl'?await handleSDKOutput([{'sql':_0xfc4579}],_0x35a619):console[_0x11dfc1(0xd6)](_0xfc4579),0x0;}catch(_0xdf1da6){if(_0xdf1da6 instanceof SDKError)return console[_0x11dfc1(0x153)]('Error:\x20'+_0xdf1da6['message']),_0xdf1da6['cause']&&console[_0x11dfc1(0x153)](_0x11dfc1(0x147)+_0xdf1da6[_0x11dfc1(0x134)]),0x1;throw _0xdf1da6;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x15f);[a32_0x28d401(0x11a)]=a32_0x28d401(0xe2);async['execute'](_0x59982c){const _0x456bb3=a32_0x28d401,{options:_0x514ecf,args:_0x4c978a,tdx:_0x587acc}=_0x59982c,_0x4b2da4=_0x514ecf;if(_0x4c978a[_0x456bb3(0x154)]<0x2)return console[_0x456bb3(0x153)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x4e6f50=_0x4c978a[0x0],_0x1dd98f=_0x4c978a[0x1];_0x4b2da4['verbose']&&(console[_0x456bb3(0x153)]('Site:\x20'+_0x4b2da4[_0x456bb3(0x10c)]),console[_0x456bb3(0x153)](_0x456bb3(0x10e)+_0x4e6f50),console[_0x456bb3(0x153)](_0x456bb3(0x15c)+_0x1dd98f));let _0x1b2389;if(_0x4b2da4['parentFolder']){const _0x4f64cc=_0x4b2da4[_0x456bb3(0x117)],_0x487ec8=await withSpinner(_0x456bb3(0x111)+_0x4e6f50+_0x456bb3(0x12d),()=>_0x587acc[_0x456bb3(0x10d)][_0x456bb3(0x132)](_0x4e6f50),{'verbose':_0x4b2da4[_0x456bb3(0x160)]}),_0x3a5295=_0x487ec8[_0x456bb3(0x118)],_0x4c1421=await withSpinner(_0x456bb3(0xe5)+_0x4f64cc+_0x456bb3(0x12d),()=>_0x587acc[_0x456bb3(0x10d)]['resolveFolderId'](_0x3a5295,_0x4f64cc),{'verbose':_0x4b2da4[_0x456bb3(0x160)]});_0x1b2389=_0x4c1421[_0x456bb3(0x118)],_0x4b2da4[_0x456bb3(0x160)]&&console[_0x456bb3(0x153)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x1b2389);}const _0x37244c={'name':_0x1dd98f,'description':_0x4b2da4['description'],'parentFolderId':_0x1b2389},_0x56e5b2=await withSpinner(_0x456bb3(0x123)+_0x1dd98f+_0x456bb3(0x12d),()=>_0x587acc[_0x456bb3(0x10d)][_0x456bb3(0x108)](_0x4e6f50,_0x37244c),{'verbose':_0x4b2da4['verbose']}),_0x1cee26=_0x56e5b2['data'];return console['error'](_0x456bb3(0xec)+_0x1cee26[_0x456bb3(0x144)]+'\x27\x20with\x20ID:\x20'+_0x1cee26['id']),await handleSDKOutput([_0x1cee26],_0x4b2da4),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0x28d401(0x144)]='segment:view';['description']='Show\x20folder\x20or\x20child\x20segment\x20details';async[a32_0x28d401(0x150)](_0x3ba4ab){const _0x3c5752=a32_0x28d401,{options:_0x16752e,args:_0xf4458f,tdx:_0x40cd04}=_0x3ba4ab,_0x4d50a3=_0xf4458f[0x0];if(!_0x4d50a3)return console[_0x3c5752(0x153)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x3c5752(0x153)](_0x3c5752(0x10f)),console[_0x3c5752(0x153)](_0x3c5752(0xeb)),console[_0x3c5752(0x153)]('Options:'),console[_0x3c5752(0x153)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x3c5752(0x153)](_0x3c5752(0x110)),console[_0x3c5752(0x153)](_0x3c5752(0x128)),console[_0x3c5752(0x153)](_0x3c5752(0x104)),console['error'](_0x3c5752(0xf5)),console['error'](_0x3c5752(0xfd)),0x1;try{const _0x40659f=_0x16752e['parentSegment'],_0x2072d5=resolveSegmentTarget(_0x4d50a3,_0x40659f,_0x16752e[_0x3c5752(0x160)]);_0x16752e[_0x3c5752(0x160)]&&console[_0x3c5752(0x153)](_0x3c5752(0x121)+_0x2072d5);const _0x260d3e=await withSpinner(_0x3c5752(0x130)+_0x4d50a3+_0x3c5752(0x12d),()=>_0x40cd04[_0x3c5752(0x10d)]['resolvePathToResource'](_0x2072d5),{'verbose':_0x16752e[_0x3c5752(0x160)]}),_0x1467fc=_0x260d3e[_0x3c5752(0x118)];_0x16752e[_0x3c5752(0x160)]&&(console['error'](_0x3c5752(0xd7)+_0x1467fc[_0x3c5752(0x140)]),console['error']('Parent\x20ID:\x20'+_0x1467fc[_0x3c5752(0xf3)]),_0x1467fc[_0x3c5752(0x105)]&&console[_0x3c5752(0x153)]('Folder\x20ID:\x20'+_0x1467fc[_0x3c5752(0x105)]),_0x1467fc[_0x3c5752(0xfa)]&&console[_0x3c5752(0x153)](_0x3c5752(0x157)+_0x1467fc[_0x3c5752(0xfa)]));if(_0x16752e[_0x3c5752(0x10b)]){if(_0x1467fc['type']===_0x3c5752(0xd1))return console[_0x3c5752(0x153)](_0x3c5752(0x158)),0x1;if(_0x1467fc[_0x3c5752(0x140)]===_0x3c5752(0xe0))return console[_0x3c5752(0x153)](_0x3c5752(0x139)),console[_0x3c5752(0x153)](_0x3c5752(0x13d)),0x1;if(!_0x1467fc['segmentId'])throw new SDKError(ErrorCode[_0x3c5752(0x156)],_0x3c5752(0x14b));const _0x5071bb=getConsoleNextUrl(_0x16752e['site'],_0x3c5752(0x122)+_0x1467fc[_0x3c5752(0xf3)]+_0x3c5752(0x129)+_0x1467fc[_0x3c5752(0xfa)]);return console[_0x3c5752(0x153)](a32_0x12689e['green']('✔')+_0x3c5752(0xea)+a32_0x12689e['cyan'](_0x5071bb)),openBrowser(_0x5071bb),0x0;}if(_0x1467fc[_0x3c5752(0x140)]===_0x3c5752(0xd1)){if(!_0x1467fc['folderId'])throw new SDKError(ErrorCode[_0x3c5752(0x11d)],_0x3c5752(0x142));const _0x46a5c0=await withSpinner(_0x3c5752(0xdf),()=>_0x40cd04[_0x3c5752(0x10d)][_0x3c5752(0x14f)](_0x1467fc['folderId']),{'verbose':_0x16752e[_0x3c5752(0x160)]});await handleSingleObjectOutput(_0x46a5c0[_0x3c5752(0x118)],_0x16752e);}else{if(_0x1467fc['type']===_0x3c5752(0x10d)){if(!_0x1467fc[_0x3c5752(0xfa)])throw new SDKError(ErrorCode[_0x3c5752(0x156)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x8a6a2b=await withSpinner('Fetching\x20segment\x20details...',()=>_0x40cd04[_0x3c5752(0x10d)]['getSegment'](_0x1467fc[_0x3c5752(0xf3)],_0x1467fc['segmentId']),{'verbose':_0x16752e[_0x3c5752(0x160)]}),_0xc08f33=getConsoleNextUrl(_0x16752e['site'],_0x3c5752(0x122)+_0x1467fc['parentId']+_0x3c5752(0x129)+_0x1467fc['segmentId']),_0x287425=_0x8a6a2b[_0x3c5752(0x118)];_0x287425[_0x3c5752(0x112)]=_0xc08f33,await handleSingleObjectOutput(_0x287425,_0x16752e);}else return console[_0x3c5752(0x153)](_0x3c5752(0xe1)),console['error']('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x52c451){if(_0x52c451 instanceof SDKError)return console['error'](_0x3c5752(0xf9)+_0x52c451['message']),_0x52c451[_0x3c5752(0x134)]&&console[_0x3c5752(0x153)](_0x3c5752(0x147)+_0x52c451[_0x3c5752(0x134)]),0x1;throw _0x52c451;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0x28d401(0x144)]=a32_0x28d401(0x124);[a32_0x28d401(0x11a)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a32_0x28d401(0x150)](_0x202b9d){const _0x1f8db1=a32_0x28d401,{options:_0x3a36ae,args:_0x3aba07,tdx:_0xdb7bc9}=_0x202b9d,_0xa74abb=_0x3aba07[0x0];if(!_0xa74abb)return console[_0x1f8db1(0x153)](_0x1f8db1(0xf7)),console[_0x1f8db1(0x153)](_0x1f8db1(0x155)),console[_0x1f8db1(0x153)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x1f8db1(0x153)]('Examples:'),console[_0x1f8db1(0x153)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x77b4ef=_0x3a36ae['parentSegment'],_0x54ddbf=resolveSegmentTarget(_0xa74abb,_0x77b4ef,_0x3a36ae[_0x1f8db1(0x160)]);_0x3a36ae[_0x1f8db1(0x160)]&&console['error'](_0x1f8db1(0x121)+_0x54ddbf);const _0x236a18=await withSpinner(_0x1f8db1(0x130)+_0xa74abb+_0x1f8db1(0x12d),()=>_0xdb7bc9['segment']['resolvePathToResource'](_0x54ddbf),{'verbose':_0x3a36ae['verbose']}),_0x4b6e9b=_0x236a18[_0x1f8db1(0x118)];_0x3a36ae[_0x1f8db1(0x160)]&&(console['error']('Resolved\x20type:\x20'+_0x4b6e9b[_0x1f8db1(0x140)]),console[_0x1f8db1(0x153)](_0x1f8db1(0x146)+_0x4b6e9b[_0x1f8db1(0xf3)]));if(_0x4b6e9b[_0x1f8db1(0x140)]===_0x1f8db1(0xd1))return console[_0x1f8db1(0x153)](_0x1f8db1(0xf0)),console[_0x1f8db1(0x153)](_0x1f8db1(0xdd)),0x1;if(_0x4b6e9b[_0x1f8db1(0x140)]==='parent')return console[_0x1f8db1(0x153)](_0x1f8db1(0x12b)),console[_0x1f8db1(0x153)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x4b6e9b[_0x1f8db1(0xfa)])throw new SDKError(ErrorCode[_0x1f8db1(0x156)],_0x1f8db1(0x14b));const _0x576ad1=await withSpinner(_0x1f8db1(0x11b),()=>_0xdb7bc9[_0x1f8db1(0x10d)][_0x1f8db1(0xd2)](_0x4b6e9b[_0x1f8db1(0xf3)],_0x4b6e9b[_0x1f8db1(0xfa)]),{'verbose':_0x3a36ae[_0x1f8db1(0x160)]}),_0x2ef26c=_0x576ad1[_0x1f8db1(0x118)],_0x2b6f91=await executeSchemaQuery(_0x2ef26c,_0xdb7bc9,_0x3a36ae);return await handleQueryOutput(_0x2b6f91,_0x3a36ae),0x0;}catch(_0x2a25ec){if(_0x2a25ec instanceof SDKError)return console[_0x1f8db1(0x153)]('Error:\x20'+_0x2a25ec[_0x1f8db1(0x151)]),_0x2a25ec[_0x1f8db1(0x134)]&&console['error']('\x20\x20Cause:\x20'+_0x2a25ec[_0x1f8db1(0x134)]),0x1;throw _0x2a25ec;}}}
1
+ const a32_0xc1877c=a32_0x1cbf;(function(_0x1d82a7,_0x1135d1){const _0xa2dec8=a32_0x1cbf,_0x3089ed=_0x1d82a7();while(!![]){try{const _0x409b81=-parseInt(_0xa2dec8(0x1da))/0x1*(-parseInt(_0xa2dec8(0x1f7))/0x2)+parseInt(_0xa2dec8(0x208))/0x3*(-parseInt(_0xa2dec8(0x1b1))/0x4)+parseInt(_0xa2dec8(0x1cc))/0x5+-parseInt(_0xa2dec8(0x232))/0x6+-parseInt(_0xa2dec8(0x1f6))/0x7*(-parseInt(_0xa2dec8(0x21f))/0x8)+parseInt(_0xa2dec8(0x1b3))/0x9+-parseInt(_0xa2dec8(0x22d))/0xa*(parseInt(_0xa2dec8(0x225))/0xb);if(_0x409b81===_0x1135d1)break;else _0x3089ed['push'](_0x3089ed['shift']());}catch(_0x5e2eac){_0x3089ed['push'](_0x3089ed['shift']());}}}(a32_0x53dc,0xf3c7a));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a32_0x1cbf(_0x1ef2d7,_0x2260c7){_0x1ef2d7=_0x1ef2d7-0x1af;const _0x53dc37=a32_0x53dc();let _0x1cbf10=_0x53dc37[_0x1ef2d7];return _0x1cbf10;}import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner,withQuerySpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../utils/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';import{executeSchemaQuery}from'../utils/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{getConsoleNextUrl}from'../types/endpoints.js';import{openBrowser}from'../utils/process.js';import a32_0x95fa24 from'chalk';function resolveSegmentTarget(_0xffc000,_0x3ae390,_0x15298e){const _0x22c1c9=a32_0x1cbf;if(isYamlFilePath(_0xffc000))try{const _0x63f7e2=resolveYamlFilePath(_0xffc000);return _0x15298e&&(console['error']('Resolved\x20YAML\x20file:\x20'+_0xffc000),console['error'](_0x22c1c9(0x1b0)+_0x63f7e2['parentSegment']),console[_0x22c1c9(0x23d)]('\x20\x20Segment\x20name:\x20'+_0x63f7e2[_0x22c1c9(0x1e0)]),console[_0x22c1c9(0x23d)]('\x20\x20Folder\x20path:\x20'+(_0x63f7e2['folderPath']||'(root)')),console[_0x22c1c9(0x23d)](_0x22c1c9(0x1e8)+_0x63f7e2['fullPath'])),_0x63f7e2['fullPath'];}catch(_0x4ff906){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x22c1c9(0x1d5)+_0x4ff906[_0x22c1c9(0x1e1)]);}if(!_0x3ae390)throw new SDKError(ErrorCode[_0x22c1c9(0x1d0)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x3ae390+'/'+_0xffc000;}export class SegmentDescribeCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x215);[a32_0xc1877c(0x1c5)]='Show\x20segment\x20or\x20folder\x20details';async[a32_0xc1877c(0x207)](_0x21f0e5){const _0x433937=a32_0xc1877c,{options:_0x40d9ba,args:_0x4390e7,tdx:_0x53a7a4}=_0x21f0e5,_0x3fdaab=_0x4390e7[0x0],_0x446102=!_0x3fdaab&&!!_0x40d9ba[_0x433937(0x20e)],_0x28075e=_0x3fdaab||_0x40d9ba[_0x433937(0x20e)];if(!_0x28075e)return console[_0x433937(0x23d)](_0x433937(0x1d4)),console[_0x433937(0x23d)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x433937(0x23d)](_0x433937(0x1b5)),console[_0x433937(0x23d)](_0x433937(0x200)),console['error'](_0x433937(0x210)),console[_0x433937(0x23d)](_0x433937(0x1d2)),console[_0x433937(0x23d)](_0x433937(0x1e7)),0x1;try{const _0x226069=_0x40d9ba['segmentPath'];let _0x5c4325=_0x28075e;!_0x446102&&_0x226069&&!_0x28075e[_0x433937(0x1c9)]('/')&&(_0x5c4325=_0x226069+'/'+_0x28075e,_0x40d9ba['verbose']&&console[_0x433937(0x23d)](_0x433937(0x236)+_0x5c4325));const _0x89d284=await withSpinner(_0x433937(0x229)+_0x5c4325+'\x27...',()=>_0x53a7a4[_0x433937(0x1c2)]['resolvePathToResource'](_0x5c4325),{'verbose':_0x40d9ba[_0x433937(0x1cb)]}),_0x1e9674=_0x89d284['data'];_0x40d9ba[_0x433937(0x1cb)]&&(console[_0x433937(0x23d)](_0x433937(0x1eb)+_0x1e9674[_0x433937(0x228)]),console[_0x433937(0x23d)]('Parent\x20ID:\x20'+_0x1e9674[_0x433937(0x20c)]),_0x1e9674[_0x433937(0x209)]&&console[_0x433937(0x23d)](_0x433937(0x22b)+_0x1e9674[_0x433937(0x209)]),_0x1e9674['segmentId']&&console[_0x433937(0x23d)]('Segment\x20ID:\x20'+_0x1e9674[_0x433937(0x1fb)]));if(_0x1e9674[_0x433937(0x228)]==='parent'){const _0x48c5cc=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x53a7a4[_0x433937(0x1c2)][_0x433937(0x234)](_0x1e9674[_0x433937(0x20c)]),{'verbose':_0x40d9ba[_0x433937(0x1cb)]});await handleSingleObjectOutput(_0x48c5cc['data'],_0x40d9ba);}else{if(_0x1e9674[_0x433937(0x228)]===_0x433937(0x1d6)){if(!_0x1e9674[_0x433937(0x209)])throw new SDKError(ErrorCode[_0x433937(0x204)],_0x433937(0x1d3));const _0x50bc25=await withSpinner(_0x433937(0x1b6),()=>_0x53a7a4['segment']['getFolder'](_0x1e9674[_0x433937(0x209)]),{'verbose':_0x40d9ba[_0x433937(0x1cb)]});await handleSingleObjectOutput(_0x50bc25[_0x433937(0x23b)],_0x40d9ba);}else{if(_0x1e9674['type']==='segment'){if(!_0x1e9674[_0x433937(0x1fb)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1af701=await withSpinner(_0x433937(0x1cf),()=>_0x53a7a4[_0x433937(0x1c2)][_0x433937(0x20b)](_0x1e9674[_0x433937(0x20c)],_0x1e9674[_0x433937(0x1fb)]),{'verbose':_0x40d9ba[_0x433937(0x1cb)]});await handleSingleObjectOutput(_0x1af701[_0x433937(0x23b)],_0x40d9ba);}}}return 0x0;}catch(_0x3f590c){if(_0x3f590c instanceof SDKError)return console[_0x433937(0x23d)](_0x433937(0x1ec)+_0x3f590c[_0x433937(0x1e1)]),_0x3f590c[_0x433937(0x1bf)]&&console[_0x433937(0x23d)]('\x20\x20Cause:\x20'+_0x3f590c[_0x433937(0x1bf)]),0x1;throw _0x3f590c;}}}function a32_0x53dc(){const _0x2d5bce=['listFolders','✖\x20Query\x20failed\x20[','Use:\x20tdx\x20ps\x20sql','Resolved\x20parent\x20folder\x20ID:\x20','segment:describe','length','name','segment:view','json','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Show\x20segment\x20folder\x20details','getFolder','Get\x20SQL\x20query\x20for\x20child\x20segment','segment:folder:list','1012376qDkrNs','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','Fetching\x20SQL\x20for\x20segment...','✔\x20Query\x20completed:\x20Processed\x20','Target\x20path:\x20','toLocaleString','654115sAmzob','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','type','Resolving\x20path\x20\x27','Create\x20segment\x20folder\x20for\x20organization','Folder\x20ID:\x20','jsonl','90oXBYSj','Parent\x20name:\x20','Usage:\x20tdx\x20sg\x20desc\x20<name>','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Resolving\x20parent\x20folder\x20\x27','8544552ieqJGU','processedRows','getParent','Parent\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','/e/','\x20folder','Parent\x20segment:\x20','✔\x20Created\x20folder\x20\x27','data','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','error','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','url','Creating\x20folder\x20\x27','resolveParentId','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20Parent\x20segment:\x20','25948JiQluz','getSegmentSQL','11528298wOfXwV','Error:\x20Parent\x20segment\x20name\x20is\x20required','Examples:','Fetching\x20folder\x20details...','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','in\x20','site','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','Resolved\x20folder\x20ID:\x20','parentFolder','Error:\x20Folder\x20reference\x20is\x20required','cause','createFolder','\x20\x20Cause:\x20','segment','SEGMENT_NOT_FOUND','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','description','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Segment\x20ID:\x20','/app/ps/','includes','Resolving\x20\x27','verbose','7947470bCjQaK','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Show\x20child\x20segment\x20schema\x20(column\x20types)','Fetching\x20segment\x20details...','INVALID_ARGUMENT','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20Path\x20or\x20name\x20is\x20required','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','folder','\x20[Job\x20ID:\x20','code','segment:folder:create','1TYDaOG','log','\x20Opening\x20','Resolving\x20folder\x20\x27','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','segmentName','message','\x20rows\x20','Options:','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','web','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20Full\x20path:\x20','Usage:\x20tdx\x20sg\x20show\x20<name>','cyan','Resolved\x20type:\x20','Error:\x20','trim','parent','Resolving\x20parent\x20segment\x20\x27','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','jobId','7jmujzW','3593314XWnokp','replace','Folder\x20name:\x20','\x27...','segmentId','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','stats','format','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Site:\x20','SELECT\x20*\x20FROM\x20(\x0a','resolvePathToResource','SEGMENT_FOLDER_NOT_FOUND','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','segment:sql','execute','849AZCjrC','folderId','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','getSegment','parentId','Listing\x20folders\x20for\x20parent\x20\x27','parentSegment','resolveFolderId','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'];a32_0x53dc=function(){return _0x2d5bce;};return a32_0x53dc();}export class SegmentShowCommand extends BaseCommand{[a32_0xc1877c(0x217)]='segment:show';[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x1f0);async[a32_0xc1877c(0x207)](_0x7278b5){const _0x30141f=a32_0xc1877c,{options:_0x21d7a3,args:_0x5ca12d,tdx:_0x5ad73e}=_0x7278b5,_0x21fd4c=_0x5ca12d[0x0];if(!_0x21fd4c)return console[_0x30141f(0x23d)](_0x30141f(0x21a)),console[_0x30141f(0x23d)](_0x30141f(0x1e9)),console[_0x30141f(0x23d)](_0x30141f(0x205)),console[_0x30141f(0x23d)](_0x30141f(0x1b5)),console[_0x30141f(0x23d)](_0x30141f(0x1fc)),console['error'](_0x30141f(0x1c6)),0x1;try{const _0x57ecb4=_0x21d7a3[_0x30141f(0x20e)],_0x35870f=resolveSegmentTarget(_0x21fd4c,_0x57ecb4,_0x21d7a3[_0x30141f(0x1cb)]);_0x21d7a3[_0x30141f(0x1cb)]&&console[_0x30141f(0x23d)]('Target\x20path:\x20'+_0x35870f);const _0x482a06=await withSpinner('Resolving\x20\x27'+_0x21fd4c+_0x30141f(0x1fa),()=>_0x5ad73e[_0x30141f(0x1c2)][_0x30141f(0x203)](_0x35870f),{'verbose':_0x21d7a3[_0x30141f(0x1cb)]}),_0x2521b3=_0x482a06[_0x30141f(0x23b)];_0x21d7a3[_0x30141f(0x1cb)]&&(console[_0x30141f(0x23d)](_0x30141f(0x1eb)+_0x2521b3[_0x30141f(0x228)]),console[_0x30141f(0x23d)]('Parent\x20ID:\x20'+_0x2521b3[_0x30141f(0x20c)]));if(_0x2521b3[_0x30141f(0x228)]===_0x30141f(0x1d6))return console['error'](_0x30141f(0x23c)),console[_0x30141f(0x23d)](_0x30141f(0x1d1)),0x1;if(_0x2521b3['type']===_0x30141f(0x1ee))return console[_0x30141f(0x23d)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x30141f(0x23d)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x2521b3[_0x30141f(0x1fb)])throw new SDKError(ErrorCode[_0x30141f(0x1c3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x391019=await withSpinner(_0x30141f(0x221),()=>_0x5ad73e['segment']['getSegmentSQL'](_0x2521b3[_0x30141f(0x20c)],_0x2521b3[_0x30141f(0x1fb)]),{'verbose':_0x21d7a3['verbose']});let _0x11e953=_0x391019['data'];const _0x49262c=resolveLimit(_0x21d7a3['limit'],DEFAULT_DISPLAY_LIMIT),_0xe09b8b=/\bLIMIT\s+\d+/i['test'](_0x11e953);!_0xe09b8b&&(_0x11e953=_0x11e953[_0x30141f(0x1ed)]()[_0x30141f(0x1f8)](/;+$/,''),_0x11e953=_0x30141f(0x202)+_0x11e953+_0x30141f(0x1f2)+_0x49262c);_0x21d7a3['verbose']&&console[_0x30141f(0x23d)]('SQL\x20query:\x0a'+_0x11e953);const _0x1a70a8=await withQuerySpinner('Executing\x20segment\x20query...',async _0x177b88=>{const _0x12e0ab=_0x30141f,_0x527e8d=await _0x5ad73e['query'][_0x12e0ab(0x207)](_0x11e953,{'catalog':'td','schema':'information_schema','onJobId':_0x2de244=>{_0x177b88['setJobId'](_0x2de244);}});return _0x527e8d;},{'verbose':_0x21d7a3[_0x30141f(0x1cb)]}),_0x442638=_0x1a70a8['data'],_0x51950f=_0x442638[_0x30141f(0x1f5)]?_0x30141f(0x1d7)+_0x442638['jobId']+']':'';return console[_0x30141f(0x23d)](_0x30141f(0x222)+_0x442638[_0x30141f(0x1fe)][_0x30141f(0x233)][_0x30141f(0x224)]()+_0x30141f(0x1e2)+(_0x30141f(0x1b8)+formatElapsed(_0x442638[_0x30141f(0x1fe)]['elapsedTimeMillis'])+_0x51950f)),await handleQueryOutput(_0x442638,_0x21d7a3),0x0;}catch(_0x497ada){if(_0x497ada instanceof SDKError)return console[_0x30141f(0x23d)](_0x30141f(0x212)+_0x497ada[_0x30141f(0x1d8)]+']'),console[_0x30141f(0x23d)]('\x0a'+_0x497ada[_0x30141f(0x1e1)]),0x1;throw _0x497ada;}}}export class SegmentFolderListCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x21e);[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x1af);async['execute'](_0x3ef930){const _0x2e3f94=a32_0xc1877c,{options:_0x2c4942,args:_0x932415,tdx:_0x47978a}=_0x3ef930;if(_0x932415[_0x2e3f94(0x216)]===0x0)return console[_0x2e3f94(0x23d)](_0x2e3f94(0x1b4)),console['error'](_0x2e3f94(0x1bb)),0x1;const _0x14602b=_0x932415[0x0];try{_0x2c4942[_0x2e3f94(0x1cb)]&&(console[_0x2e3f94(0x23d)]('Site:\x20'+_0x2c4942['site']),console[_0x2e3f94(0x23d)]('Parent\x20name:\x20'+_0x14602b));const _0x3ff233=await withSpinner(_0x2e3f94(0x1ef)+_0x14602b+_0x2e3f94(0x1fa),()=>_0x47978a[_0x2e3f94(0x1c2)][_0x2e3f94(0x241)](_0x14602b),{'verbose':_0x2c4942[_0x2e3f94(0x1cb)]}),_0x489c57=_0x3ff233[_0x2e3f94(0x23b)];_0x2c4942['verbose']&&console[_0x2e3f94(0x23d)]('Resolved\x20parent\x20ID:\x20'+_0x489c57);const _0x13db6f=await withSpinner(_0x2e3f94(0x20d)+_0x14602b+'\x27...',()=>_0x47978a[_0x2e3f94(0x1c2)][_0x2e3f94(0x211)](_0x489c57),{'verbose':_0x2c4942[_0x2e3f94(0x1cb)]}),_0x2a8a68=_0x13db6f[_0x2e3f94(0x23b)];return console['error']('✔\x20Found\x20'+_0x2a8a68[_0x2e3f94(0x216)]+_0x2e3f94(0x238)+(_0x2a8a68[_0x2e3f94(0x216)]!==0x1?'s':'')),await handleSDKOutput(_0x2a8a68,_0x2c4942),0x0;}catch(_0x2ddf7e){if(_0x2ddf7e instanceof SDKError)return console[_0x2e3f94(0x23d)](_0x2e3f94(0x1ec)+_0x2ddf7e['message']),_0x2ddf7e[_0x2e3f94(0x1bf)]&&console[_0x2e3f94(0x23d)](_0x2e3f94(0x1c1)+_0x2ddf7e[_0x2e3f94(0x1bf)]),0x1;throw _0x2ddf7e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a32_0xc1877c(0x217)]='segment:folder:show';[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x21b);async[a32_0xc1877c(0x207)](_0x1aa2b2){const _0x16d238=a32_0xc1877c,{options:_0x3db378,args:_0x51d987,tdx:_0x1deeab}=_0x1aa2b2;if(_0x51d987['length']===0x0)return console['error'](_0x16d238(0x1be)),console[_0x16d238(0x23d)](_0x16d238(0x1f3)),0x1;try{const {parentId:_0x3dd5f5,childId:_0x308439}=parseSegmentRef(_0x51d987[0x0]);_0x3db378['verbose']&&(console['error'](_0x16d238(0x201)+_0x3db378[_0x16d238(0x1b9)]),console[_0x16d238(0x23d)](_0x16d238(0x22e)+_0x3dd5f5),_0x308439&&console[_0x16d238(0x23d)]('Folder\x20name:\x20'+_0x308439));if(!_0x308439)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x24ed1a=await withSpinner(_0x16d238(0x1ef)+_0x3dd5f5+_0x16d238(0x1fa),()=>_0x1deeab[_0x16d238(0x1c2)]['resolveParentId'](_0x3dd5f5),{'verbose':_0x3db378[_0x16d238(0x1cb)]}),_0x200eb9=_0x24ed1a[_0x16d238(0x23b)];_0x3db378[_0x16d238(0x1cb)]&&console[_0x16d238(0x23d)]('Resolved\x20parent\x20ID:\x20'+_0x200eb9);const _0xba5984=await withSpinner(_0x16d238(0x1dd)+_0x308439+_0x16d238(0x1fa),()=>_0x1deeab[_0x16d238(0x1c2)]['resolveFolderId'](_0x200eb9,_0x308439),{'verbose':_0x3db378[_0x16d238(0x1cb)]}),_0x5ae3c5=_0xba5984[_0x16d238(0x23b)];_0x3db378[_0x16d238(0x1cb)]&&console[_0x16d238(0x23d)](_0x16d238(0x1bc)+_0x5ae3c5);const _0x1b4980=await withSpinner('Fetching\x20folder\x20\x27'+_0x308439+_0x16d238(0x1fa),()=>_0x1deeab[_0x16d238(0x1c2)][_0x16d238(0x21c)](_0x5ae3c5),{'verbose':_0x3db378[_0x16d238(0x1cb)]});return await handleSDKOutput([_0x1b4980['data']],_0x3db378),0x0;}catch(_0x4dadcb){if(_0x4dadcb instanceof SDKError)return console['error']('Error:\x20'+_0x4dadcb[_0x16d238(0x1e1)]),_0x4dadcb[_0x16d238(0x1bf)]&&console['error'](_0x16d238(0x1c1)+_0x4dadcb['cause']),0x1;throw _0x4dadcb;}}}export class SegmentSQLCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x206);[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x21d);async[a32_0xc1877c(0x207)](_0x4c4d04){const _0x5e5785=a32_0xc1877c,{options:_0x330049,args:_0xd5b603,tdx:_0x347c1e}=_0x4c4d04,_0x3905d1=_0xd5b603[0x0];if(!_0x3905d1)return console[_0x5e5785(0x23d)](_0x5e5785(0x21a)),console[_0x5e5785(0x23d)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x5e5785(0x23d)](_0x5e5785(0x226)),console[_0x5e5785(0x23d)](_0x5e5785(0x1b5)),console['error']('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console['error']('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x11bee0=_0x330049[_0x5e5785(0x20e)],_0x5dc052=resolveSegmentTarget(_0x3905d1,_0x11bee0,_0x330049[_0x5e5785(0x1cb)]);_0x330049['verbose']&&console[_0x5e5785(0x23d)](_0x5e5785(0x223)+_0x5dc052);const _0x58888e=await withSpinner(_0x5e5785(0x1ca)+_0x3905d1+'\x27...',()=>_0x347c1e[_0x5e5785(0x1c2)][_0x5e5785(0x203)](_0x5dc052),{'verbose':_0x330049[_0x5e5785(0x1cb)]}),_0x5ee736=_0x58888e[_0x5e5785(0x23b)];_0x330049['verbose']&&(console[_0x5e5785(0x23d)]('Resolved\x20type:\x20'+_0x5ee736[_0x5e5785(0x228)]),console[_0x5e5785(0x23d)](_0x5e5785(0x235)+_0x5ee736[_0x5e5785(0x20c)]));if(_0x5ee736[_0x5e5785(0x228)]===_0x5e5785(0x1d6))return console[_0x5e5785(0x23d)](_0x5e5785(0x1df)),console['error'](_0x5e5785(0x1de)),0x1;if(_0x5ee736[_0x5e5785(0x228)]==='parent')return console[_0x5e5785(0x23d)](_0x5e5785(0x1b7)),console['error'](_0x5e5785(0x213)),0x1;if(!_0x5ee736['segmentId'])throw new SDKError(ErrorCode[_0x5e5785(0x1c3)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x30852e=await withSpinner(_0x5e5785(0x221),()=>_0x347c1e[_0x5e5785(0x1c2)]['getSegmentSQL'](_0x5ee736[_0x5e5785(0x20c)],_0x5ee736['segmentId']),{'verbose':_0x330049[_0x5e5785(0x1cb)]}),_0x3a277f=_0x30852e[_0x5e5785(0x23b)];return _0x330049['format']===_0x5e5785(0x219)||_0x330049[_0x5e5785(0x1ff)]===_0x5e5785(0x22c)?await handleSDKOutput([{'sql':_0x3a277f}],_0x330049):console[_0x5e5785(0x1db)](_0x3a277f),0x0;}catch(_0x18ffb5){if(_0x18ffb5 instanceof SDKError)return console[_0x5e5785(0x23d)](_0x5e5785(0x1ec)+_0x18ffb5[_0x5e5785(0x1e1)]),_0x18ffb5['cause']&&console['error'](_0x5e5785(0x1c1)+_0x18ffb5['cause']),0x1;throw _0x18ffb5;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x1d9);[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x22a);async[a32_0xc1877c(0x207)](_0x5c7651){const _0x4abccb=a32_0xc1877c,{options:_0x3cd2d7,args:_0xa20891,tdx:_0x32f1da}=_0x5c7651,_0xa8ef0c=_0x3cd2d7;if(_0xa20891[_0x4abccb(0x216)]<0x2)return console[_0x4abccb(0x23d)](_0x4abccb(0x20a)),console[_0x4abccb(0x23d)](_0x4abccb(0x1f1)),0x1;const _0x54e3b2=_0xa20891[0x0],_0x435966=_0xa20891[0x1];_0xa8ef0c[_0x4abccb(0x1cb)]&&(console[_0x4abccb(0x23d)](_0x4abccb(0x201)+_0xa8ef0c[_0x4abccb(0x1b9)]),console[_0x4abccb(0x23d)](_0x4abccb(0x239)+_0x54e3b2),console['error'](_0x4abccb(0x1f9)+_0x435966));let _0xa9df17;if(_0xa8ef0c[_0x4abccb(0x1bd)]){const _0x38f0d2=_0xa8ef0c[_0x4abccb(0x1bd)],_0x519b24=await withSpinner(_0x4abccb(0x1ef)+_0x54e3b2+'\x27...',()=>_0x32f1da[_0x4abccb(0x1c2)][_0x4abccb(0x241)](_0x54e3b2),{'verbose':_0xa8ef0c[_0x4abccb(0x1cb)]}),_0x2f8b32=_0x519b24['data'],_0x23c8c8=await withSpinner(_0x4abccb(0x231)+_0x38f0d2+'\x27...',()=>_0x32f1da[_0x4abccb(0x1c2)][_0x4abccb(0x20f)](_0x2f8b32,_0x38f0d2),{'verbose':_0xa8ef0c[_0x4abccb(0x1cb)]});_0xa9df17=_0x23c8c8[_0x4abccb(0x23b)],_0xa8ef0c[_0x4abccb(0x1cb)]&&console[_0x4abccb(0x23d)](_0x4abccb(0x214)+_0xa9df17);}const _0x1dc577={'name':_0x435966,'description':_0xa8ef0c[_0x4abccb(0x1c5)],'parentFolderId':_0xa9df17},_0x2fa52d=await withSpinner(_0x4abccb(0x240)+_0x435966+'\x27...',()=>_0x32f1da[_0x4abccb(0x1c2)][_0x4abccb(0x1c0)](_0x54e3b2,_0x1dc577),{'verbose':_0xa8ef0c[_0x4abccb(0x1cb)]}),_0x1a9516=_0x2fa52d['data'];return console[_0x4abccb(0x23d)](_0x4abccb(0x23a)+_0x1a9516[_0x4abccb(0x217)]+'\x27\x20with\x20ID:\x20'+_0x1a9516['id']),await handleSDKOutput([_0x1a9516],_0xa8ef0c),0x0;}}export class SegmentViewCommand extends BaseCommand{[a32_0xc1877c(0x217)]=a32_0xc1877c(0x218);[a32_0xc1877c(0x1c5)]='Show\x20folder\x20or\x20child\x20segment\x20details';async[a32_0xc1877c(0x207)](_0x5c5324){const _0x496235=a32_0xc1877c,{options:_0x37489d,args:_0x17bed8,tdx:_0x210262}=_0x5c5324,_0xc9ecd1=_0x17bed8[0x0];if(!_0xc9ecd1)return console[_0x496235(0x23d)](_0x496235(0x1cd)),console[_0x496235(0x23d)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x496235(0x23d)](_0x496235(0x1e6)),console['error'](_0x496235(0x1e3)),console[_0x496235(0x23d)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x496235(0x23d)]('Examples:'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x496235(0x23d)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x496235(0x23d)](_0x496235(0x227)),console[_0x496235(0x23d)](_0x496235(0x1f4)),0x1;try{const _0x15bfcb=_0x37489d[_0x496235(0x20e)],_0x1974d3=resolveSegmentTarget(_0xc9ecd1,_0x15bfcb,_0x37489d[_0x496235(0x1cb)]);_0x37489d['verbose']&&console[_0x496235(0x23d)](_0x496235(0x223)+_0x1974d3);const _0x28fcc8=await withSpinner(_0x496235(0x1ca)+_0xc9ecd1+_0x496235(0x1fa),()=>_0x210262[_0x496235(0x1c2)][_0x496235(0x203)](_0x1974d3),{'verbose':_0x37489d[_0x496235(0x1cb)]}),_0x2a023d=_0x28fcc8[_0x496235(0x23b)];_0x37489d[_0x496235(0x1cb)]&&(console[_0x496235(0x23d)](_0x496235(0x1eb)+_0x2a023d[_0x496235(0x228)]),console['error'](_0x496235(0x235)+_0x2a023d[_0x496235(0x20c)]),_0x2a023d[_0x496235(0x209)]&&console['error'](_0x496235(0x22b)+_0x2a023d['folderId']),_0x2a023d[_0x496235(0x1fb)]&&console[_0x496235(0x23d)](_0x496235(0x1c7)+_0x2a023d[_0x496235(0x1fb)]));if(_0x37489d[_0x496235(0x1e5)]){if(_0x2a023d[_0x496235(0x228)]===_0x496235(0x1d6))return console[_0x496235(0x23d)](_0x496235(0x1fd)),0x1;if(_0x2a023d[_0x496235(0x228)]===_0x496235(0x1ee))return console[_0x496235(0x23d)](_0x496235(0x23e)),console['error']('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x2a023d[_0x496235(0x1fb)])throw new SDKError(ErrorCode[_0x496235(0x1c3)],_0x496235(0x1ba));const _0x2d44de=getConsoleNextUrl(_0x37489d[_0x496235(0x1b9)],_0x496235(0x1c8)+_0x2a023d[_0x496235(0x20c)]+_0x496235(0x237)+_0x2a023d[_0x496235(0x1fb)]);return console[_0x496235(0x23d)](a32_0x95fa24['green']('✔')+_0x496235(0x1dc)+a32_0x95fa24[_0x496235(0x1ea)](_0x2d44de)),openBrowser(_0x2d44de),0x0;}if(_0x2a023d['type']===_0x496235(0x1d6)){if(!_0x2a023d[_0x496235(0x209)])throw new SDKError(ErrorCode[_0x496235(0x204)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x113cc1=await withSpinner(_0x496235(0x1b6),()=>_0x210262['segment']['getFolder'](_0x2a023d[_0x496235(0x209)]),{'verbose':_0x37489d[_0x496235(0x1cb)]});await handleSingleObjectOutput(_0x113cc1['data'],_0x37489d);}else{if(_0x2a023d['type']==='segment'){if(!_0x2a023d[_0x496235(0x1fb)])throw new SDKError(ErrorCode[_0x496235(0x1c3)],_0x496235(0x1ba));const _0x5218ff=await withSpinner('Fetching\x20segment\x20details...',()=>_0x210262[_0x496235(0x1c2)][_0x496235(0x20b)](_0x2a023d['parentId'],_0x2a023d[_0x496235(0x1fb)]),{'verbose':_0x37489d[_0x496235(0x1cb)]}),_0x9c55d=getConsoleNextUrl(_0x37489d[_0x496235(0x1b9)],'/app/ps/'+_0x2a023d['parentId']+_0x496235(0x237)+_0x2a023d['segmentId']),_0x62c8dd=_0x5218ff['data'];_0x62c8dd[_0x496235(0x23f)]=_0x9c55d,await handleSingleObjectOutput(_0x62c8dd,_0x37489d);}else return console[_0x496235(0x23d)](_0x496235(0x230)),console[_0x496235(0x23d)]('Use:\x20tdx\x20ps\x20view'),0x1;}return 0x0;}catch(_0x27f740){if(_0x27f740 instanceof SDKError)return console[_0x496235(0x23d)](_0x496235(0x1ec)+_0x27f740['message']),_0x27f740[_0x496235(0x1bf)]&&console[_0x496235(0x23d)](_0x496235(0x1c1)+_0x27f740[_0x496235(0x1bf)]),0x1;throw _0x27f740;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a32_0xc1877c(0x217)]='segment:desc';[a32_0xc1877c(0x1c5)]=a32_0xc1877c(0x1ce);async['execute'](_0x1124be){const _0x52515e=a32_0xc1877c,{options:_0x137362,args:_0x398f56,tdx:_0x1a29ec}=_0x1124be,_0x461d72=_0x398f56[0x0];if(!_0x461d72)return console[_0x52515e(0x23d)](_0x52515e(0x21a)),console['error'](_0x52515e(0x22f)),console[_0x52515e(0x23d)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>'),console[_0x52515e(0x23d)](_0x52515e(0x1b5)),console[_0x52515e(0x23d)](_0x52515e(0x220)),console[_0x52515e(0x23d)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0xf4b668=_0x137362['parentSegment'],_0x14ccbf=resolveSegmentTarget(_0x461d72,_0xf4b668,_0x137362['verbose']);_0x137362[_0x52515e(0x1cb)]&&console[_0x52515e(0x23d)](_0x52515e(0x223)+_0x14ccbf);const _0x22d04e=await withSpinner('Resolving\x20\x27'+_0x461d72+_0x52515e(0x1fa),()=>_0x1a29ec[_0x52515e(0x1c2)][_0x52515e(0x203)](_0x14ccbf),{'verbose':_0x137362[_0x52515e(0x1cb)]}),_0x3edbd4=_0x22d04e[_0x52515e(0x23b)];_0x137362[_0x52515e(0x1cb)]&&(console['error'](_0x52515e(0x1eb)+_0x3edbd4[_0x52515e(0x228)]),console['error'](_0x52515e(0x235)+_0x3edbd4[_0x52515e(0x20c)]));if(_0x3edbd4[_0x52515e(0x228)]===_0x52515e(0x1d6))return console['error'](_0x52515e(0x1e4)),console[_0x52515e(0x23d)](_0x52515e(0x1de)),0x1;if(_0x3edbd4[_0x52515e(0x228)]===_0x52515e(0x1ee))return console[_0x52515e(0x23d)](_0x52515e(0x1c4)),console[_0x52515e(0x23d)]('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x3edbd4[_0x52515e(0x1fb)])throw new SDKError(ErrorCode[_0x52515e(0x1c3)],_0x52515e(0x1ba));const _0x25f564=await withSpinner(_0x52515e(0x221),()=>_0x1a29ec['segment'][_0x52515e(0x1b2)](_0x3edbd4[_0x52515e(0x20c)],_0x3edbd4[_0x52515e(0x1fb)]),{'verbose':_0x137362[_0x52515e(0x1cb)]}),_0x4bbb7d=_0x25f564[_0x52515e(0x23b)],_0x1d7132=await executeSchemaQuery(_0x4bbb7d,_0x1a29ec,_0x137362);return await handleQueryOutput(_0x1d7132,_0x137362),0x0;}catch(_0x2f76fa){if(_0x2f76fa instanceof SDKError)return console[_0x52515e(0x23d)]('Error:\x20'+_0x2f76fa[_0x52515e(0x1e1)]),_0x2f76fa[_0x52515e(0x1bf)]&&console[_0x52515e(0x23d)](_0x52515e(0x1c1)+_0x2f76fa[_0x52515e(0x1bf)]),0x1;throw _0x2f76fa;}}}
@@ -1 +1 @@
1
- const a33_0x56a4db=a33_0x162a;(function(_0x1d7522,_0x30009d){const _0x54bdb6=a33_0x162a,_0x3f13d2=_0x1d7522();while(!![]){try{const _0x100e17=-parseInt(_0x54bdb6(0x106))/0x1+parseInt(_0x54bdb6(0xf0))/0x2+parseInt(_0x54bdb6(0xf4))/0x3+-parseInt(_0x54bdb6(0x11a))/0x4*(parseInt(_0x54bdb6(0x10a))/0x5)+-parseInt(_0x54bdb6(0x112))/0x6*(parseInt(_0x54bdb6(0xfb))/0x7)+-parseInt(_0x54bdb6(0x10d))/0x8*(parseInt(_0x54bdb6(0xeb))/0x9)+parseInt(_0x54bdb6(0x10b))/0xa*(parseInt(_0x54bdb6(0x11c))/0xb);if(_0x100e17===_0x30009d)break;else _0x3f13d2['push'](_0x3f13d2['shift']());}catch(_0x5e54ee){_0x3f13d2['push'](_0x3f13d2['shift']());}}}(a33_0x1f63,0x8044d));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';function a33_0x162a(_0x312a79,_0x43abef){_0x312a79=_0x312a79-0xea;const _0x1f6327=a33_0x1f63();let _0x162abd=_0x1f6327[_0x312a79];return _0x162abd;}import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';import a33_0x96a0fa from'chalk';export class SegmentCreateCommand extends BaseCommand{[a33_0x56a4db(0xf9)]=a33_0x56a4db(0xfa);[a33_0x56a4db(0x102)]=a33_0x56a4db(0xea);async['execute'](_0x5708dc){const _0x32433b=a33_0x56a4db;console[_0x32433b(0xf8)](a33_0x96a0fa[_0x32433b(0xf6)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console['error'](a33_0x96a0fa[_0x32433b(0xf6)](_0x32433b(0x110)));const {options:_0x2e3aa6,args:_0x5862ff,tdx:_0x4b21a5}=_0x5708dc,_0x368d95=_0x2e3aa6;if(_0x5862ff[_0x32433b(0x101)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x32433b(0xf8)]('Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]'),console['error'](_0x32433b(0x108)),console[_0x32433b(0xf8)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x32433b(0xf8)](_0x32433b(0xee)),console['error']('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x2a2c52=_0x5862ff[0x0],_0x1a2a57=_0x2e3aa6[_0x32433b(0xf3)];let _0x5e4b95=_0x2a2c52;_0x1a2a57&&!_0x2a2c52[_0x32433b(0xf2)]('/')&&(_0x5e4b95=_0x1a2a57+'/'+_0x2a2c52,_0x368d95['verbose']&&console[_0x32433b(0xf8)]('Resolved\x20relative\x20path\x20to:\x20'+_0x5e4b95));const _0x9d74b3=parsePath(_0x5e4b95);if(_0x9d74b3[_0x32433b(0xfc)]['length']<0x2)return console['error'](_0x32433b(0x118)),console[_0x32433b(0xf8)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x234e30=_0x9d74b3['segments'][0x0],_0x549cc7=getBaseName(_0x5e4b95),_0x58e913=getParentPath(_0x5e4b95);_0x368d95[_0x32433b(0x107)]&&(console[_0x32433b(0xf8)]('Site:\x20'+_0x368d95['site']),console[_0x32433b(0xf8)](_0x32433b(0x119)+_0x5e4b95),console[_0x32433b(0xf8)](_0x32433b(0x111)+_0x234e30),console['error']('Segment\x20name:\x20'+_0x549cc7),console[_0x32433b(0xf8)](_0x32433b(0xef)+_0x58e913));const _0x3eedd2=await withSpinner(_0x32433b(0x10c)+_0x234e30+'\x27...',()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0xf1)](_0x234e30),{'verbose':_0x368d95[_0x32433b(0x107)]}),_0x4142a3=_0x3eedd2[_0x32433b(0x104)];let _0x7e93f4;if(_0x9d74b3[_0x32433b(0xfc)][_0x32433b(0x101)]>0x2){const _0x16d671=await withSpinner(_0x32433b(0x113)+_0x58e913+_0x32433b(0xfe),()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0xff)](_0x58e913),{'verbose':_0x368d95[_0x32433b(0x107)]}),_0x46d54d=_0x16d671[_0x32433b(0x104)];if(_0x46d54d[_0x32433b(0x11b)]!==_0x32433b(0x105)&&_0x46d54d[_0x32433b(0x11b)]!==_0x32433b(0x11d))return console[_0x32433b(0xf8)]('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x7e93f4=_0x46d54d[_0x32433b(0xf5)];}else{if(_0x368d95[_0x32433b(0x105)]){const _0x5e4c5e=await withSpinner(_0x32433b(0x100)+_0x368d95[_0x32433b(0x105)]+'\x27...',()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0x10f)](_0x4142a3,_0x368d95[_0x32433b(0x105)]),{'verbose':_0x368d95['verbose']});_0x7e93f4=_0x5e4c5e[_0x32433b(0x104)];}}_0x368d95[_0x32433b(0x107)]&&_0x7e93f4&&console[_0x32433b(0xf8)](_0x32433b(0xf7)+_0x7e93f4);const _0x37c101=await loadJSONFromOptions(_0x368d95[_0x32433b(0x116)],_0x368d95[_0x32433b(0xed)]),_0x4cec55={'name':_0x549cc7,'description':_0x368d95['description'],'rule':_0x37c101,'kind':_0x368d95['kind']!==undefined?parseInt(_0x368d95[_0x32433b(0x115)],0xa):undefined,'isVisible':_0x368d95[_0x32433b(0x10e)]?![]:undefined,'segmentFolderId':_0x7e93f4,'countPopulation':_0x368d95[_0x32433b(0x109)]?![]:undefined},_0x582f50=await withSpinner(_0x32433b(0xec)+_0x549cc7+_0x32433b(0xfe),()=>_0x4b21a5[_0x32433b(0x117)][_0x32433b(0xfd)](_0x4142a3,_0x4cec55),{'verbose':_0x368d95['verbose']}),_0x2adef7=_0x582f50[_0x32433b(0x104)];return console['error'](_0x32433b(0x103)+_0x2adef7[_0x32433b(0xf9)]+'\x27\x20with\x20ID:\x20'+_0x2adef7['id']),_0x5e4b95!==_0x2a2c52&&console[_0x32433b(0xf8)](_0x32433b(0x114)+_0x5e4b95),await handleSDKOutput([_0x2adef7],_0x368d95),0x0;}}function a33_0x1f63(){const _0x34183c=['6BSdrwp','Resolving\x20folder\x20path\x20\x27','\x20\x20\x20Path:\x20','kind','rule','segment','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Target\x20path:\x20','12cORNuB','type','11yKCELU','parent','Create\x20child\x20segment\x20with\x20filtering\x20rules','515709halhEl','Creating\x20segment\x20\x27','ruleFile','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','Parent\x20path:\x20','1046014yAEhni','resolveParentId','includes','segmentPath','2600898LfskzM','folderId','yellow','Resolved\x20folder\x20ID:\x20','error','name','segment:create','1825943SDnCeH','segments','createSegment','\x27...','resolvePathToResource','Resolving\x20folder\x20\x27','length','description','✔\x20Created\x20segment\x20\x27','data','folder','525591ESQIAb','verbose','Examples:','noCountPopulation','497775zOEWLH','2778220ucUeAH','Resolving\x20parent\x20segment\x20\x27','8gvCRZy','invisible','resolveFolderId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Parent:\x20'];a33_0x1f63=function(){return _0x34183c;};return a33_0x1f63();}
1
+ const a33_0x479e82=a33_0x4227;function a33_0x4227(_0x75a761,_0x3b0fd9){_0x75a761=_0x75a761-0x195;const _0x5cb8d8=a33_0x5cb8();let _0x4227e4=_0x5cb8d8[_0x75a761];return _0x4227e4;}(function(_0x4fe187,_0x2d5861){const _0x26a637=a33_0x4227,_0x129567=_0x4fe187();while(!![]){try{const _0x35c9fc=parseInt(_0x26a637(0x1a4))/0x1*(-parseInt(_0x26a637(0x199))/0x2)+parseInt(_0x26a637(0x1b6))/0x3*(parseInt(_0x26a637(0x1b4))/0x4)+parseInt(_0x26a637(0x1c2))/0x5*(parseInt(_0x26a637(0x1cb))/0x6)+parseInt(_0x26a637(0x1bf))/0x7*(-parseInt(_0x26a637(0x1ae))/0x8)+-parseInt(_0x26a637(0x1ab))/0x9*(-parseInt(_0x26a637(0x19d))/0xa)+-parseInt(_0x26a637(0x1ba))/0xb*(parseInt(_0x26a637(0x1b7))/0xc)+parseInt(_0x26a637(0x1c9))/0xd;if(_0x35c9fc===_0x2d5861)break;else _0x129567['push'](_0x129567['shift']());}catch(_0x49c696){_0x129567['push'](_0x129567['shift']());}}}(a33_0x5cb8,0x4a1ec));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../utils/segment-path-parser.js';function a33_0x5cb8(){const _0x26dfab=['\x20\x20\x20Path:\x20','resolveParentId','\x27\x20with\x20ID:\x20','83280eJMdtm','Resolved\x20folder\x20ID:\x20','resolveFolderId','Resolved\x20relative\x20path\x20to:\x20','Segment\x20name:\x20','segment:create','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','100gLfqTV','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','Site:\x20','type','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','folder','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','9ZJkBXc','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','376tRTdnA','Resolving\x20folder\x20path\x20\x27','✔\x20Created\x20segment\x20\x27','kind','\x27...','Examples:','4KsHDVl','execute','1512591rkAdfZ','20508qEdlrE','Parent:\x20','name','3773COkDHU','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','data','yellow','length','21007awvWEJ','Resolving\x20folder\x20\x27','Parent\x20path:\x20','1133400qOZWyU','segmentPath','includes','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','error','Creating\x20segment\x20\x27','6518785cdiaEF','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','12HDimdY','verbose','Target\x20path:\x20','Resolving\x20parent\x20segment\x20\x27','segments','segment','Create\x20child\x20segment\x20with\x20filtering\x20rules','8730BThrdg'];a33_0x5cb8=function(){return _0x26dfab;};return a33_0x5cb8();}import a33_0x190d02 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a33_0x479e82(0x1b9)]=a33_0x479e82(0x1a2);['description']=a33_0x479e82(0x198);async[a33_0x479e82(0x1b5)](_0x159dca){const _0x498014=a33_0x479e82;console[_0x498014(0x1c7)](a33_0x190d02[_0x498014(0x1bd)](_0x498014(0x1a8))),console[_0x498014(0x1c7)](a33_0x190d02[_0x498014(0x1bd)](_0x498014(0x1ac)));const {options:_0x269ea5,args:_0x3b63cb,tdx:_0x8e773d}=_0x159dca,_0x346190=_0x269ea5;if(_0x3b63cb[_0x498014(0x1be)]===0x0)return console[_0x498014(0x1c7)](_0x498014(0x1c6)),console[_0x498014(0x1c7)](_0x498014(0x1a3)),console[_0x498014(0x1c7)](_0x498014(0x1b3)),console[_0x498014(0x1c7)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x498014(0x1c7)](_0x498014(0x1aa)),console[_0x498014(0x1c7)](_0x498014(0x1c5)),0x1;const _0x1bce5d=_0x3b63cb[0x0],_0x5c245b=_0x269ea5[_0x498014(0x1c3)];let _0x43f34e=_0x1bce5d;_0x5c245b&&!_0x1bce5d[_0x498014(0x1c4)]('/')&&(_0x43f34e=_0x5c245b+'/'+_0x1bce5d,_0x346190[_0x498014(0x1cc)]&&console[_0x498014(0x1c7)](_0x498014(0x1a0)+_0x43f34e));const _0x1741be=parsePath(_0x43f34e);if(_0x1741be[_0x498014(0x196)]['length']<0x2)return console[_0x498014(0x1c7)](_0x498014(0x1bb)),console[_0x498014(0x1c7)](_0x498014(0x1a5)),0x1;const _0x3f6ab2=_0x1741be[_0x498014(0x196)][0x0],_0x31fe00=getBaseName(_0x43f34e),_0x5572b5=getParentPath(_0x43f34e);_0x346190[_0x498014(0x1cc)]&&(console[_0x498014(0x1c7)](_0x498014(0x1a6)+_0x346190['site']),console[_0x498014(0x1c7)](_0x498014(0x1cd)+_0x43f34e),console[_0x498014(0x1c7)](_0x498014(0x1b8)+_0x3f6ab2),console[_0x498014(0x1c7)](_0x498014(0x1a1)+_0x31fe00),console[_0x498014(0x1c7)](_0x498014(0x1c1)+_0x5572b5));const _0x52f002=await withSpinner(_0x498014(0x195)+_0x3f6ab2+_0x498014(0x1b2),()=>_0x8e773d[_0x498014(0x197)][_0x498014(0x19b)](_0x3f6ab2),{'verbose':_0x346190[_0x498014(0x1cc)]}),_0x138db5=_0x52f002[_0x498014(0x1bc)];let _0x23924a;if(_0x1741be['segments'][_0x498014(0x1be)]>0x2){const _0x292565=await withSpinner(_0x498014(0x1af)+_0x5572b5+'\x27...',()=>_0x8e773d['segment']['resolvePathToResource'](_0x5572b5),{'verbose':_0x346190[_0x498014(0x1cc)]}),_0x226382=_0x292565['data'];if(_0x226382[_0x498014(0x1a7)]!==_0x498014(0x1a9)&&_0x226382['type']!=='parent')return console['error'](_0x498014(0x1ca)),0x1;_0x23924a=_0x226382['folderId'];}else{if(_0x346190[_0x498014(0x1a9)]){const _0x214d8f=await withSpinner(_0x498014(0x1c0)+_0x346190[_0x498014(0x1a9)]+_0x498014(0x1b2),()=>_0x8e773d['segment'][_0x498014(0x19f)](_0x138db5,_0x346190['folder']),{'verbose':_0x346190[_0x498014(0x1cc)]});_0x23924a=_0x214d8f[_0x498014(0x1bc)];}}_0x346190[_0x498014(0x1cc)]&&_0x23924a&&console['error'](_0x498014(0x19e)+_0x23924a);const _0x564c54=await loadJSONFromOptions(_0x346190['rule'],_0x346190['ruleFile']),_0xb2e2f6={'name':_0x31fe00,'description':_0x346190[_0x498014(0x1ad)],'rule':_0x564c54,'kind':_0x346190[_0x498014(0x1b1)]!==undefined?parseInt(_0x346190[_0x498014(0x1b1)],0xa):undefined,'isVisible':_0x346190['invisible']?![]:undefined,'segmentFolderId':_0x23924a,'countPopulation':_0x346190['noCountPopulation']?![]:undefined},_0x4b4e67=await withSpinner(_0x498014(0x1c8)+_0x31fe00+'\x27...',()=>_0x8e773d[_0x498014(0x197)]['createSegment'](_0x138db5,_0xb2e2f6),{'verbose':_0x346190['verbose']}),_0x58d4f7=_0x4b4e67['data'];return console[_0x498014(0x1c7)](_0x498014(0x1b0)+_0x58d4f7[_0x498014(0x1b9)]+_0x498014(0x19c)+_0x58d4f7['id']),_0x43f34e!==_0x1bce5d&&console[_0x498014(0x1c7)](_0x498014(0x19a)+_0x43f34e),await handleSDKOutput([_0x58d4f7],_0x346190),0x0;}}
@@ -1 +1 @@
1
- const a34_0x6bb92a=a34_0x16f0;(function(_0x4de1a8,_0x18ffbe){const _0x539acf=a34_0x16f0,_0x5b26b1=_0x4de1a8();while(!![]){try{const _0x40f349=-parseInt(_0x539acf(0xcb))/0x1+-parseInt(_0x539acf(0xc5))/0x2*(-parseInt(_0x539acf(0xd7))/0x3)+parseInt(_0x539acf(0xd6))/0x4*(-parseInt(_0x539acf(0xd9))/0x5)+-parseInt(_0x539acf(0xc8))/0x6+-parseInt(_0x539acf(0xc3))/0x7+-parseInt(_0x539acf(0xc4))/0x8*(-parseInt(_0x539acf(0xcc))/0x9)+-parseInt(_0x539acf(0xc6))/0xa*(-parseInt(_0x539acf(0xdb))/0xb);if(_0x40f349===_0x18ffbe)break;else _0x5b26b1['push'](_0x5b26b1['shift']());}catch(_0x328f10){_0x5b26b1['push'](_0x5b26b1['shift']());}}}(a34_0x200c,0x8a997));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';function a34_0x200c(){const _0x5866df=['✔\x20Found\x20','parentSegment','62768jDRxPe','246yNOzHU','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','130GWBqDa','jsonl','14081518sRACmm','listFields','length','\x27...','name','description','error','List\x20available\x20fields\x20for\x20segmentation','911015HGOuST','6440RxWYcP','660TLabxk','10sxGfrs','segment','4078434pmLSCm','Listing\x20fields\x20for\x20\x27','Parent\x20segment:\x20','329034SZZAhQ','9027SeOoei','Error:\x20Parent\x20segment\x20name\x20is\x20required','json','segment:fields','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','data','verbose','execute'];a34_0x200c=function(){return _0x5866df;};return a34_0x200c();}function a34_0x16f0(_0x13648b,_0x216722){_0x13648b=_0x13648b-0xc1;const _0x200c88=a34_0x200c();let _0x16f054=_0x200c88[_0x13648b];return _0x16f054;}import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a34_0x6bb92a(0xdf)]=a34_0x6bb92a(0xcf);[a34_0x6bb92a(0xe0)]=a34_0x6bb92a(0xc2);async[a34_0x6bb92a(0xd3)](_0x5a0065){const _0x389c99=a34_0x6bb92a,{options:_0x4bdd2f,args:_0xe6a9ea,tdx:_0x5e6e6b}=_0x5a0065,_0x54a16a=_0xe6a9ea[0x0]||_0x4bdd2f[_0x389c99(0xd5)];if(!_0x54a16a)return console['error'](_0x389c99(0xcd)),console['error'](_0x389c99(0xd8)),console[_0x389c99(0xc1)](_0x389c99(0xd0)),0x1;_0x4bdd2f[_0x389c99(0xd2)]&&(console['error']('Site:\x20'+_0x4bdd2f['site']),console[_0x389c99(0xc1)](_0x389c99(0xca)+_0x54a16a));const _0x2f82ee=await withSpinner(_0x389c99(0xc9)+_0x54a16a+_0x389c99(0xde),()=>_0x5e6e6b[_0x389c99(0xc7)][_0x389c99(0xdc)](_0x54a16a),{'verbose':_0x4bdd2f[_0x389c99(0xd2)]}),_0x43470d=_0x2f82ee[_0x389c99(0xd1)];console[_0x389c99(0xc1)](_0x389c99(0xd4)+_0x43470d[_0x389c99(0xdd)]+'\x20field'+(_0x43470d[_0x389c99(0xdd)]!==0x1?'s':''));if(_0x4bdd2f[_0x389c99(0xce)]||_0x4bdd2f[_0x389c99(0xda)])return await handleSDKOutput(_0x43470d,_0x4bdd2f),0x0;return displayFieldsHumanReadable(_0x43470d,_0x54a16a),0x0;}}
1
+ function a34_0x12b5(_0x4a0e34,_0x1da1fa){_0x4a0e34=_0x4a0e34-0x78;const _0x95b7fa=a34_0x95b7();let _0x12b598=_0x95b7fa[_0x4a0e34];return _0x12b598;}function a34_0x95b7(){const _0x4b7dc1=['✔\x20Found\x20','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Site:\x20','Parent\x20segment:\x20','listFields','585485AMKnaB','2884608ajYiHI','List\x20available\x20fields\x20for\x20segmentation','8OltmjU','data','error','68611BwyTqw','length','execute','jsonl','name','2808984IrbxKg','site','2463272IeNrwI','1283320FwxHmo','json','parentSegment','segment:fields','verbose','14555241uqgHRC','Error:\x20Parent\x20segment\x20name\x20is\x20required','30xxSqpV','\x27...'];a34_0x95b7=function(){return _0x4b7dc1;};return a34_0x95b7();}const a34_0x1c7c84=a34_0x12b5;(function(_0x4b85d6,_0x591e3a){const _0x4d4b6b=a34_0x12b5,_0x34c7eb=_0x4b85d6();while(!![]){try{const _0x8e3d8e=-parseInt(_0x4d4b6b(0x8e))/0x1*(-parseInt(_0x4d4b6b(0x80))/0x2)+parseInt(_0x4d4b6b(0x89))/0x3+parseInt(_0x4d4b6b(0x79))/0x4+-parseInt(_0x4d4b6b(0x88))/0x5+parseInt(_0x4d4b6b(0x93))/0x6+-parseInt(_0x4d4b6b(0x78))/0x7+parseInt(_0x4d4b6b(0x8b))/0x8*(-parseInt(_0x4d4b6b(0x7e))/0x9);if(_0x8e3d8e===_0x591e3a)break;else _0x34c7eb['push'](_0x34c7eb['shift']());}catch(_0x2f14e6){_0x34c7eb['push'](_0x34c7eb['shift']());}}}(a34_0x95b7,0xa94cd));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../utils/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a34_0x1c7c84(0x92)]=a34_0x1c7c84(0x7c);['description']=a34_0x1c7c84(0x8a);async[a34_0x1c7c84(0x90)](_0x4d7074){const _0x470f90=a34_0x1c7c84,{options:_0x43cc73,args:_0x1a86bf,tdx:_0x5b6803}=_0x4d7074,_0x1c015e=_0x1a86bf[0x0]||_0x43cc73[_0x470f90(0x7b)];if(!_0x1c015e)return console[_0x470f90(0x8d)](_0x470f90(0x7f)),console['error'](_0x470f90(0x83)),console['error'](_0x470f90(0x84)),0x1;_0x43cc73[_0x470f90(0x7d)]&&(console[_0x470f90(0x8d)](_0x470f90(0x85)+_0x43cc73[_0x470f90(0x94)]),console[_0x470f90(0x8d)](_0x470f90(0x86)+_0x1c015e));const _0x2191dd=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x1c015e+_0x470f90(0x81),()=>_0x5b6803['segment'][_0x470f90(0x87)](_0x1c015e),{'verbose':_0x43cc73[_0x470f90(0x7d)]}),_0x5dc174=_0x2191dd[_0x470f90(0x8c)];console[_0x470f90(0x8d)](_0x470f90(0x82)+_0x5dc174[_0x470f90(0x8f)]+'\x20field'+(_0x5dc174[_0x470f90(0x8f)]!==0x1?'s':''));if(_0x43cc73[_0x470f90(0x7a)]||_0x43cc73[_0x470f90(0x91)])return await handleSDKOutput(_0x5dc174,_0x43cc73),0x0;return displayFieldsHumanReadable(_0x5dc174,_0x1c015e),0x0;}}