@treasuredata/tdx 0.23.1 → 0.24.0

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 (164) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/chat-command.js +1 -1
  11. package/dist/commands/claude-command.js +1 -1
  12. package/dist/commands/claude-statusline-command.js +1 -1
  13. package/dist/commands/claude-usage-command.js +1 -1
  14. package/dist/commands/command.js +1 -1
  15. package/dist/commands/connection-command.js +1 -1
  16. package/dist/commands/databases.js +1 -1
  17. package/dist/commands/describe.js +1 -1
  18. package/dist/commands/engage-command.js +1 -1
  19. package/dist/commands/job-command.js +1 -1
  20. package/dist/commands/journey-command.js +1 -1
  21. package/dist/commands/journey-validate-command.js +1 -1
  22. package/dist/commands/llm-command.js +1 -1
  23. package/dist/commands/mcp-command.js +1 -1
  24. package/dist/commands/parent-segment-command.js +1 -1
  25. package/dist/commands/profile-command.js +1 -1
  26. package/dist/commands/profiles-command.js +1 -1
  27. package/dist/commands/query-command.js +1 -1
  28. package/dist/commands/schedule-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/status-command.js +1 -1
  40. package/dist/commands/tables.js +1 -1
  41. package/dist/commands/unset-command.js +1 -1
  42. package/dist/commands/use-command.js +1 -1
  43. package/dist/commands/user-command.js +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/core/auth.js +1 -1
  46. package/dist/core/command-output.js +1 -1
  47. package/dist/core/config.js +1 -1
  48. package/dist/core/connection-cache.js +1 -1
  49. package/dist/core/constants.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/core/version.js +1 -1
  58. package/dist/index.js +1 -1
  59. package/dist/mcp/server.js +1 -1
  60. package/dist/mcp/tools/index.js +1 -1
  61. package/dist/mcp/tools/tdx-run.js +1 -1
  62. package/dist/mcp/tools/tdx-search.js +1 -1
  63. package/dist/mcp/utils.js +1 -1
  64. package/dist/proxy/claude-usage-tracker.js +1 -1
  65. package/dist/proxy/passthrough-server.js +1 -1
  66. package/dist/proxy/sse-usage-parser.js +1 -1
  67. package/dist/sdk/agent/agent-config.js +1 -1
  68. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  69. package/dist/sdk/agent/agent-yaml.js +1 -1
  70. package/dist/sdk/agent/test/evaluator.js +1 -1
  71. package/dist/sdk/agent/test/executor.js +1 -1
  72. package/dist/sdk/agent/test/index.js +1 -1
  73. package/dist/sdk/agent/test/output.js +1 -1
  74. package/dist/sdk/agent/test/parser.js +1 -1
  75. package/dist/sdk/api.js +1 -1
  76. package/dist/sdk/client/cdp-api-client.js +1 -1
  77. package/dist/sdk/client/endpoints.js +1 -1
  78. package/dist/sdk/client/engage-api-client.js +1 -1
  79. package/dist/sdk/client/http-client.js +1 -1
  80. package/dist/sdk/client/llm-api-client.js +1 -1
  81. package/dist/sdk/client/rate-limiter.js +1 -1
  82. package/dist/sdk/client/td-api-client.js +1 -1
  83. package/dist/sdk/client/trino-api-client.js +1 -1
  84. package/dist/sdk/client/workflow-client.js +1 -1
  85. package/dist/sdk/connection-validator.js +1 -1
  86. package/dist/sdk/connection.js +1 -1
  87. package/dist/sdk/engage.js +1 -1
  88. package/dist/sdk/errors.js +1 -1
  89. package/dist/sdk/index.js +1 -1
  90. package/dist/sdk/io/index.js +1 -1
  91. package/dist/sdk/io/node-filesystem.js +1 -1
  92. package/dist/sdk/job.js +1 -1
  93. package/dist/sdk/journey.js +1 -1
  94. package/dist/sdk/llm/chat-cache.js +1 -1
  95. package/dist/sdk/llm/index.js +1 -1
  96. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  97. package/dist/sdk/llm/model-factors.js +1 -1
  98. package/dist/sdk/query/index.js +1 -1
  99. package/dist/sdk/query/sql-parser.js +1 -1
  100. package/dist/sdk/schedule.js +1 -1
  101. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  102. package/dist/sdk/segment/fields-display.js +1 -1
  103. package/dist/sdk/segment/file-discovery.js +1 -1
  104. package/dist/sdk/segment/journey-utils.js +1 -1
  105. package/dist/sdk/segment/journey-yaml.js +1 -1
  106. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  107. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  108. package/dist/sdk/segment/pull-workflow.js +1 -1
  109. package/dist/sdk/segment/push-workflow.js +1 -1
  110. package/dist/sdk/segment/resolution-context.js +1 -1
  111. package/dist/sdk/segment/segment-path-parser.js +1 -1
  112. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  113. package/dist/sdk/segment/target-resolution.js +1 -1
  114. package/dist/sdk/segment/tdx-config.js +1 -1
  115. package/dist/sdk/segment/validate-files.js +1 -1
  116. package/dist/sdk/segment/yaml-validator.js +1 -1
  117. package/dist/sdk/segment.js +1 -1
  118. package/dist/sdk/types/index.js +1 -1
  119. package/dist/sdk/types/progress.js +1 -1
  120. package/dist/sdk/user.js +1 -1
  121. package/dist/sdk/util/format-detector.js +1 -1
  122. package/dist/sdk/util/formatters.js +1 -1
  123. package/dist/sdk/util/index.js +1 -1
  124. package/dist/sdk/util/tree-formatter.js +1 -1
  125. package/dist/sdk/workflow/archive-validation.js +1 -1
  126. package/dist/sdk/workflow/clone-workflow.js +1 -1
  127. package/dist/sdk/workflow/index.js +1 -1
  128. package/dist/sdk/workflow/pull-workflow.js +1 -1
  129. package/dist/sdk/workflow/push-workflow.js +1 -1
  130. package/dist/sdk/workflow/tdx-config.js +1 -1
  131. package/dist/sdk/workflow/workflow-utils.js +1 -1
  132. package/dist/test-utils/command-runner.js +1 -1
  133. package/dist/test-utils/factories.js +1 -1
  134. package/dist/test-utils/fixtures.js +1 -1
  135. package/dist/test-utils/http-mock.js +1 -1
  136. package/dist/test-utils/index.js +1 -1
  137. package/dist/utils/async.js +1 -1
  138. package/dist/utils/colors.js +1 -1
  139. package/dist/utils/diff.js +1 -1
  140. package/dist/utils/file-permissions.js +1 -1
  141. package/dist/utils/global-cache.js +1 -1
  142. package/dist/utils/json-loader.js +1 -1
  143. package/dist/utils/local-cache.js +1 -1
  144. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  145. package/dist/utils/logger/formatters/index.js +1 -1
  146. package/dist/utils/logger/handlers/console-handler.js +1 -1
  147. package/dist/utils/logger/handlers/file-handler.js +1 -1
  148. package/dist/utils/logger/handlers/index.js +1 -1
  149. package/dist/utils/logger/handlers/null-handler.js +1 -1
  150. package/dist/utils/logger/index.js +1 -1
  151. package/dist/utils/logger/logger.js +1 -1
  152. package/dist/utils/logger/types.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/process.js.map +1 -1
  157. package/dist/utils/prompt.js +1 -1
  158. package/dist/utils/spinner.js +1 -1
  159. package/dist/utils/sse-parser.js +1 -1
  160. package/dist/utils/string-utils.js +1 -1
  161. package/dist/utils/table-ref-parser.js +1 -1
  162. package/dist/utils/tdx-logger.js +1 -1
  163. package/dist/utils/version-check.js +1 -1
  164. package/package.json +1 -1
@@ -1 +1 @@
1
- const a22_0x1a5e68=a22_0x1aab;(function(_0x76610d,_0x6e1fe9){const _0x5a93d1=a22_0x1aab,_0x2a1ead=_0x76610d();while(!![]){try{const _0x26df42=parseInt(_0x5a93d1(0x1b8))/0x1+parseInt(_0x5a93d1(0x296))/0x2+-parseInt(_0x5a93d1(0x1e2))/0x3*(parseInt(_0x5a93d1(0x24a))/0x4)+-parseInt(_0x5a93d1(0x208))/0x5+-parseInt(_0x5a93d1(0x1f1))/0x6*(-parseInt(_0x5a93d1(0x1f8))/0x7)+-parseInt(_0x5a93d1(0x23b))/0x8*(parseInt(_0x5a93d1(0x252))/0x9)+parseInt(_0x5a93d1(0x1d4))/0xa*(parseInt(_0x5a93d1(0x224))/0xb);if(_0x26df42===_0x6e1fe9)break;else _0x2a1ead['push'](_0x2a1ead['shift']());}catch(_0x570dda){_0x2a1ead['push'](_0x2a1ead['shift']());}}}(a22_0x3772,0x7da45));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x3c811b from'path';function a22_0x3772(){const _0x2dfa33=['Apply\x20changes\x20to\x20\x27','behaviorsFile','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','using\x20the\x20default\x20path:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Source:','utf-8','message','Updating','\x20Opening\x20','Listing\x20parent\x20segments\x20matching\x20\x27','\x0aUsage:\x20tdx\x20ps\x20preview\x20','master','\x20\x20Columns:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','stats','yes','sort','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','✔\x20Found\x20','\x20Context\x20set:\x20','elapsedTimeMillis','name','pushParentYaml','\x20\x20\x20\x20-\x20','\x20rows\x20','totalEvents','\x5c$&','json','scheduleOption','Fetching\x20parent\x20segment\x20\x27','jsonl','/\x20→\x20','displayBehaviorsStats','customerGroup','Output\x20Database:','platform','description','status','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','previewParentYaml','validateParentYaml','Error\x20parsing\x20YAML:\x20','length','use','Listing\x20fields\x20for\x20\x27','collectSchema','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','ignore','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','Options:','start','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','\x20--enriched','✔\x20Renamed\x20directory\x20to\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','segment:parent:view','Schema\x20saved\x20to\x20','map','\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:\x20No\x20behaviors\x20defined\x20in\x20configuration','130970QLoRZc','behavior','column','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','timezone','Updating\x20parent\x20segment\x20\x27','\x20\x20No\x20sample\x20data\x20available','displayValidateResults','\x20--attribute\x20\x22<name>\x22','workflowSessionId','SELECT\x20*\x20FROM\x20','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','all','displayPreviewHints','\x0aChanges\x20to\x20\x27','runParent','\x0aChanges\x20to\x20apply\x20to\x20\x27','joinKey','\x20=\x20','test','\x20\x20Database:\x20','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','trim','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','Pattern:\x20','customerGroupFile','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','repeat','\x22\x20}','Fetching\x20sample\x20data...','Created','segment:parent:desc','toLowerCase','displayColumns','audienceId','YAML\x20file:\x20','\x27\x20and\x20run\x20workflow?','open','Found\x20YAML\x20file:\x20','\x20--interval\x20','Error\x20reading\x20file:\x20','/attempt/','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','Available\x20attributes:','\x0aNo\x20sample\x20data\x20available','processedRows','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','/\x20directories\x20exist.','Error:\x20--behavior\x20requires\x20a\x20name\x0a','matchedCount','sampleData','workflowAttemptId','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','parentSegment','Listing\x20parent\x20segments...','column_name','\x20--behavior\x20\x22','Fetching\x20current\x20configuration\x20for\x20\x27','Behaviors','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','/sessions/','No\x20parent\x20segments\x20found','Error:\x20Parent\x20segment\x20name\x20is\x20required','format','foreignKey','Audience\x20ID:','match','displaySampleData','Options:\x0a','formatSchemaJson','\x0a⚠️\x20\x20Migrating:\x20','behaviors','SELECT\x20*\x20FROM\x20(\x0a','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','/app/workflows/','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','\x20rows)','bold','jobId','double','schemaValid','Database:\x20','allValid','attributesFile','parent_segment','\x0a⚠️\x20\x20Both\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','Columns:','displayMasterInfo','isDirectory','addAttributes','Output\x20file:\x20','\x20parent\x20segment\x20\x27','segment','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','✔\x20Query\x20completed:\x20Processed\x20','darwin','table','addBehaviors','\x20\x20Tables:\x201\x20customers\x20+\x20','rowCount','Join:','resolveParentId','parent_segments','Options\x20(one\x20required):\x0a','Attributes','.yaml','Executing\x20parent\x20segment\x20query...','\x27...','number','656399FtCGkd','\x27\x20with\x20ID:\x20','segment:parent:show','population','segment:parent:sql','\x0a\x20\x20]\x0a}\x0a','Errors:','output','\x20--attribute\x20\x22','apply','updateParent','Attempt:','Enriched:','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','setJobId','displayPreviewResults','✔\x20Updated\x20parent\x20segment\x20\x27','Creating','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','join','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','replace','coveragePercent','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Attribute:','string','addBehaviorsFile','getBehaviorNames','530XUJXxa','type','schemaError','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','.yml','verbose','Error:\x20File\x20not\x20found:\x20','execute','`\x20to\x20download\x20the\x20configuration\x20first','customersWithEvents','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','columns','Updated','toFixed','429zDXfYH','\x0aNew\x20parent\x20segment\x20\x27','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','database','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','errors','site','/\x20and\x20','web','tdx\x20segment\x20parent\x20preview\x20','segment:parent:run','Resolving\x20parent\x20segment\x20\x27','\x20total','1343334zlzyhw','FINISHED','interval','green','displayAttributesStats','customers','limit','7IgAeDC','attributes','column_type','in\x20','segment:parent:create','segment:parent:preview','log','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','enriched','session','/app/dw/parentSegments/','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','/{name}.yml\x0a','To\x20cancel:','\x20\x20Note:\x20','1838550NpOBLE','\x20kill','Error:','\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','To\x20view\x20sample\x20data:','Creating\x20parent\x20segment\x20\x27','preview','workflowId','✘\x20Failed\x20to\x20rename\x20directory:\x20','displaySummary','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','listParents','listFields','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','Fetching\x20behavior\x20list...','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','attribute','\x0a✔\x20Workflow\x20started','Create\x20parent\x20segment\x20\x27','Overwrite\x20\x27','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','cyan','parent_id','Preview:','203060TqkDyW','customerPercent','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','localeCompare','endsWith','win32','dirname','error','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','dim','pullParentYaml','varchar','getParentSQL','getOutputDatabaseName','Available\x20behaviors:','scheduleType','red','stop','run','\x20parent\x20segment','filter','data','Analyzing\x20changes...','284264KEnEtS','Site:\x20','Parent\x20segment:\x20','Table:\x20','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Fetching\x20customers\x20schema...','getParentFull','\x27\x20is\x20already\x20up\x20to\x20date','text','List\x20parent\x20segments','information_schema','\x0aError:','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','Aborted.','24172itJPBW','behavior_','\x20behaviors','Status:','query','Name:\x20','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','45dUfZUC','%)\x20','toLocaleString','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires'];a22_0x3772=function(){return _0x2dfa33;};return a22_0x3772();}import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';function a22_0x1aab(_0xb85020,_0x2de41f){_0xb85020=_0xb85020-0x18f;const _0x37726e=a22_0x3772();let _0x1aab7e=_0x37726e[_0xb85020];return _0x1aab7e;}import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x5b42bc from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a22_0x1a5e68(0x1b1),LEGACY_PARENT_SEGMENT_DIR=a22_0x1a5e68(0x19e);function openBrowser(_0x2ca94f){const _0x248c35=a22_0x1a5e68,_0x166219=process[_0x248c35(0x27b)],_0x5dfcdb=_0x166219===_0x248c35(0x1aa)?_0x248c35(0x2bb):_0x166219===_0x248c35(0x229)?_0x248c35(0x28b):'xdg-open';spawn(_0x5dfcdb,[_0x2ca94f],{'detached':!![],'stdio':_0x248c35(0x288)})['unref']();}function migrateLegacyDirectory(){const _0x506e62=a22_0x1a5e68;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x4907c6=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x4907c6[_0x506e62(0x1a3)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x506e62(0x22b)](a22_0x5b42bc[_0x506e62(0x1ff)](_0x506e62(0x19f)+LEGACY_PARENT_SEGMENT_DIR+_0x506e62(0x1eb)+PARENT_SEGMENT_DIR+_0x506e62(0x2c5))),console[_0x506e62(0x22b)](a22_0x5b42bc[_0x506e62(0x22d)]('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+'/\x20directory.\x0a')),![];console['error'](a22_0x5b42bc[_0x506e62(0x1ff)](_0x506e62(0x2dc)+LEGACY_PARENT_SEGMENT_DIR+_0x506e62(0x277)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x506e62(0x22b)](a22_0x5b42bc[_0x506e62(0x1f4)](_0x506e62(0x28f)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0xfe764a){const _0x2d34fb=_0xfe764a instanceof Error?_0xfe764a[_0x506e62(0x25e)]:String(_0xfe764a);return console[_0x506e62(0x22b)](a22_0x5b42bc[_0x506e62(0x234)](_0x506e62(0x211)+_0x2d34fb+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x39d18f){const _0x31a6f4=a22_0x1a5e68;return migrateLegacyDirectory(),super[_0x31a6f4(0x236)](_0x39d18f);}}function resolveYamlFile(_0x14a3c7){const _0x2332e3=a22_0x1a5e68;if(_0x14a3c7[_0x2332e3(0x228)](_0x2332e3(0x1d8))||_0x14a3c7[_0x2332e3(0x228)](_0x2332e3(0x1b4)))return _0x14a3c7;return a22_0x3c811b[_0x2332e3(0x1cb)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x14a3c7)+_0x2332e3(0x1d8));}function formatProgressMessage(_0x50418a){const _0x44f13c=a22_0x1a5e68,_0x2743c4=_0x50418a[_0x44f13c(0x2d8)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x2743c4){const [,_0x28038a,_0x40a9eb,_0x4e180f='']=_0x2743c4;return a22_0x5b42bc['dim'](_0x28038a+':')+'\x20'+_0x40a9eb+a22_0x5b42bc[_0x44f13c(0x22d)](_0x4e180f);}return a22_0x5b42bc['dim'](_0x50418a);}function showFileNotFoundError(_0x2011d1,_0x3becf2){const _0x539c28=a22_0x1a5e68;console[_0x539c28(0x22b)](a22_0x5b42bc['red'](_0x539c28(0x1da)+_0x2011d1+'\x0a')),console['error'](a22_0x5b42bc[_0x539c28(0x221)](_0x539c28(0x27e)+_0x3becf2+_0x539c28(0x1dc)));}function showParentSegmentNotSetError(_0x420650){const _0x3e56d9=a22_0x1a5e68;console[_0x3e56d9(0x22b)](a22_0x5b42bc[_0x3e56d9(0x1ff)](_0x3e56d9(0x2c0))),console['error'](_0x420650);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x1a5e68(0x26d)]='segment:parent:list';[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x244);async[a22_0x1a5e68(0x1db)](_0x5776c1){const _0x52898e=a22_0x1a5e68,{options:_0x3ab449,args:_0x5deb13,tdx:_0xb7be4c}=_0x5776c1,_0x521ffb=_0x5deb13[0x0];_0x3ab449[_0x52898e(0x1d9)]&&(console[_0x52898e(0x22b)](_0x52898e(0x23c)+_0x3ab449[_0x52898e(0x1ea)]),_0x521ffb&&console[_0x52898e(0x22b)](_0x52898e(0x2ae)+_0x521ffb));const _0x3ffeeb=await withSpinner(_0x521ffb?_0x52898e(0x261)+_0x521ffb+'\x27...':_0x52898e(0x2cc),()=>_0xb7be4c[_0x52898e(0x1a7)][_0x52898e(0x217)](),{'verbose':_0x3ab449['verbose']});let _0x1615ef=_0x3ffeeb[_0x52898e(0x239)];if(_0x521ffb){const _0x33ff65=_0x521ffb[_0x52898e(0x1cd)](/[.+^${}()|[\]\\]/g,_0x52898e(0x272))[_0x52898e(0x1cd)](/\*/g,'.*')[_0x52898e(0x1cd)](/\?/g,'.'),_0x5ae44a=new RegExp('^'+_0x33ff65+'$','i');_0x1615ef=_0x1615ef[_0x52898e(0x238)](_0x5f123f=>_0x5ae44a[_0x52898e(0x2a9)](_0x5f123f['attributes'][_0x52898e(0x26d)]));}_0x1615ef[_0x52898e(0x268)]((_0x3bf65d,_0x1a8e4f)=>_0x3bf65d['attributes'][_0x52898e(0x26d)][_0x52898e(0x227)](_0x1a8e4f['attributes'][_0x52898e(0x26d)])),console[_0x52898e(0x22b)](_0x52898e(0x26a)+_0x1615ef['length']+_0x52898e(0x237)+(_0x1615ef[_0x52898e(0x283)]!==0x1?'s':''));const _0x3f8b27=_0x26064a=>{const _0x354ef1=_0x52898e;return getConsoleNextUrl(_0x3ab449['site'],_0x354ef1(0x203)+_0x26064a);};if(_0x3ab449[_0x52898e(0x2d5)]===_0x52898e(0x273)||_0x3ab449[_0x52898e(0x2d5)]===_0x52898e(0x276)){const _0x2b1fb6=_0x1615ef[_0x52898e(0x293)](_0x3f3c82=>({..._0x3f3c82,'url':_0x3f8b27(_0x3f3c82['id'])}));await handleSDKOutput(_0x2b1fb6,_0x3ab449);}else{if(_0x1615ef[_0x52898e(0x283)]===0x0)_0x521ffb?console[_0x52898e(0x1fe)]('No\x20parent\x20segments\x20match\x20pattern:\x20'+_0x521ffb):console[_0x52898e(0x1fe)](_0x52898e(0x2d3));else for(const _0x122bd8 of _0x1615ef){const _0x539a07=_0x122bd8[_0x52898e(0x1f9)][_0x52898e(0x1bb)]?a22_0x5b42bc['dim']('\x20('+formatRows(_0x122bd8[_0x52898e(0x1f9)]['population'])+')'):'',_0x19284f=hyperlink(_0x122bd8[_0x52898e(0x1f9)][_0x52898e(0x26d)],_0x3f8b27(_0x122bd8['id']));console[_0x52898e(0x1fe)]('👥\x20'+_0x19284f+_0x539a07);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{['name']=a22_0x1a5e68(0x1fc);[a22_0x1a5e68(0x27c)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a22_0x1a5e68(0x1db)](_0x1a2f01){const _0x35724a=a22_0x1a5e68,{options:_0x499723,args:_0x4499ed,tdx:_0x2532df}=_0x1a2f01;console['error']('\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a'+_0x35724a(0x21b)+_0x35724a(0x251));const _0x3b357e=_0x499723;if(_0x4499ed[_0x35724a(0x283)]===0x0)return console[_0x35724a(0x22b)](a22_0x5b42bc['red'](_0x35724a(0x2d4))),console[_0x35724a(0x22b)](_0x35724a(0x269)),0x1;const _0x43d71f=_0x4499ed[0x0];if(!_0x3b357e[_0x35724a(0x1e6)]||!_0x3b357e[_0x35724a(0x1ab)])return console[_0x35724a(0x22b)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console['error'](_0x35724a(0x269)),0x1;_0x3b357e[_0x35724a(0x1d9)]&&(console[_0x35724a(0x22b)](_0x35724a(0x23c)+_0x3b357e[_0x35724a(0x1ea)]),console[_0x35724a(0x22b)](_0x35724a(0x24f)+_0x43d71f),console['error'](_0x35724a(0x19b)+_0x3b357e['database']),console['error'](_0x35724a(0x23e)+_0x3b357e[_0x35724a(0x1ab)]));const _0x32fd5c=await loadJSONFromOptions(_0x3b357e['attributes'],_0x3b357e[_0x35724a(0x19d)]),_0xf9abfb=await loadJSONFromOptions(_0x3b357e['behaviors'],_0x3b357e[_0x35724a(0x258)]),_0x2bdc9f=await loadJSONFromOptions(_0x3b357e[_0x35724a(0x279)],_0x3b357e[_0x35724a(0x2af)]),_0x573bf1={'name':_0x43d71f,'description':_0x3b357e['description'],'scheduleType':_0x3b357e[_0x35724a(0x233)],'scheduleOption':_0x3b357e[_0x35724a(0x274)],'timezone':_0x3b357e[_0x35724a(0x29a)],'master':{'parentDatabaseName':_0x3b357e['database'],'parentTableName':_0x3b357e[_0x35724a(0x1ab)]},'attributes':_0x32fd5c,'behaviors':_0xf9abfb,'customerGroup':_0x2bdc9f},_0x422501=await withSpinner(_0x35724a(0x20e)+_0x43d71f+_0x35724a(0x1b6),()=>_0x2532df[_0x35724a(0x1a7)]['createParent'](_0x573bf1),{'verbose':_0x499723[_0x35724a(0x1d9)]}),_0xeaca83=_0x422501['data'];return console[_0x35724a(0x22b)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0xeaca83[_0x35724a(0x26d)]+_0x35724a(0x1b9)+_0xeaca83['id']),await handleSDKOutput([_0xeaca83],_0x499723),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x1a5e68(0x26d)]='segment:parent:update';[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x255);async[a22_0x1a5e68(0x1db)](_0x39e9a2){const _0x43fb86=a22_0x1a5e68,{options:_0x57331a,args:_0x8a5c81,tdx:_0x45baca}=_0x39e9a2;console[_0x43fb86(0x22b)](_0x43fb86(0x247)+'\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a'+_0x43fb86(0x251));const _0x10981a=_0x57331a;if(_0x8a5c81[_0x43fb86(0x283)]===0x0)return console[_0x43fb86(0x22b)](a22_0x5b42bc['red'](_0x43fb86(0x2d4))),console[_0x43fb86(0x22b)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x41a5d5=_0x8a5c81[0x0];_0x10981a['verbose']&&(console[_0x43fb86(0x22b)]('Site:\x20'+_0x10981a[_0x43fb86(0x1ea)]),console[_0x43fb86(0x22b)](_0x43fb86(0x23d)+_0x41a5d5));const _0x46c3b5=await withSpinner(_0x43fb86(0x2cf)+_0x41a5d5+_0x43fb86(0x1b6),()=>_0x45baca[_0x43fb86(0x1a7)][_0x43fb86(0x241)](_0x41a5d5),{'verbose':_0x10981a[_0x43fb86(0x1d9)]}),_0x1fd8b1=_0x46c3b5['data'],_0x185667=await loadJSONFromOptions(_0x10981a[_0x43fb86(0x1a4)],_0x10981a['addAttributesFile']),_0x1ff7a1=await loadJSONFromOptions(_0x10981a[_0x43fb86(0x1ac)],_0x10981a[_0x43fb86(0x1d2)]),_0x1f7b63={'name':_0x1fd8b1[_0x43fb86(0x26d)],'description':_0x10981a[_0x43fb86(0x27c)]!==undefined?_0x10981a[_0x43fb86(0x27c)]:_0x1fd8b1[_0x43fb86(0x27c)],'scheduleType':_0x10981a[_0x43fb86(0x233)]!==undefined?_0x10981a[_0x43fb86(0x233)]:_0x1fd8b1['scheduleType'],'scheduleOption':_0x10981a['scheduleOption']!==undefined?_0x10981a[_0x43fb86(0x274)]:_0x1fd8b1['scheduleOption'],'timezone':_0x10981a['timezone']!==undefined?_0x10981a[_0x43fb86(0x29a)]:_0x1fd8b1['timezone'],'master':_0x1fd8b1[_0x43fb86(0x263)],'attributes':_0x185667?[..._0x1fd8b1[_0x43fb86(0x1f9)]||[],..._0x185667]:_0x1fd8b1[_0x43fb86(0x1f9)],'behaviors':_0x1ff7a1?[..._0x1fd8b1[_0x43fb86(0x18f)]||[],..._0x1ff7a1]:_0x1fd8b1['behaviors'],'customerGroup':_0x1fd8b1[_0x43fb86(0x279)]},_0x2dcd32=await withSpinner(_0x43fb86(0x29b)+_0x41a5d5+'\x27...',()=>_0x45baca[_0x43fb86(0x1a7)][_0x43fb86(0x1c2)](_0x41a5d5,_0x1f7b63),{'verbose':_0x10981a[_0x43fb86(0x1d9)]}),_0x3a40c2=_0x2dcd32[_0x43fb86(0x239)];return console['error'](_0x43fb86(0x1c8)+_0x3a40c2[_0x43fb86(0x26d)]+'\x27'),await handleSDKOutput([_0x3a40c2],_0x10981a),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']='segment:parent:pull';['description']=a22_0x1a5e68(0x204);async[a22_0x1a5e68(0x1db)](_0x45b265){const _0x2a480d=a22_0x1a5e68,{options:_0xbfaf14,args:_0x5d2b75,tdx:_0x5cbe93}=_0x45b265,_0x250bb0=_0xbfaf14,_0x126721=_0x5d2b75[0x0]||_0xbfaf14[_0x2a480d(0x2cb)];if(!_0x126721)return showParentSegmentNotSetError(_0x2a480d(0x2c4)+_0x2a480d(0x213)),0x1;if(_0x250bb0[_0x2a480d(0x284)]&&_0x250bb0[_0x2a480d(0x1bf)])return console[_0x2a480d(0x22b)](a22_0x5b42bc[_0x2a480d(0x234)](_0x2a480d(0x1de))),console['error'](a22_0x5b42bc[_0x2a480d(0x22d)](_0x2a480d(0x256))),console[_0x2a480d(0x22b)](a22_0x5b42bc['dim'](_0x2a480d(0x25a)+PARENT_SEGMENT_DIR+_0x2a480d(0x205))),console[_0x2a480d(0x22b)](a22_0x5b42bc[_0x2a480d(0x221)](_0x2a480d(0x191))),0x1;const _0x13b2db=_0x250bb0[_0x2a480d(0x1bf)]||a22_0x3c811b[_0x2a480d(0x1cb)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x126721)+_0x2a480d(0x1d8));_0x250bb0['verbose']&&(console[_0x2a480d(0x22b)](_0x2a480d(0x23c)+_0x250bb0[_0x2a480d(0x1ea)]),console[_0x2a480d(0x22b)](_0x2a480d(0x23d)+_0x126721),console[_0x2a480d(0x22b)](_0x2a480d(0x1a5)+_0x13b2db));const _0x348895=await withSpinner(_0x2a480d(0x275)+_0x126721+_0x2a480d(0x1b6),()=>_0x5cbe93[_0x2a480d(0x1a7)][_0x2a480d(0x22e)](_0x126721),{'verbose':_0x250bb0[_0x2a480d(0x1d9)]}),_0x3ca4d9=_0x348895[_0x2a480d(0x239)];if(existsSync(_0x13b2db)){const _0x3dfbec=readFileSync(_0x13b2db,'utf-8'),_0xc95ea4=generateDiff(_0x3dfbec,_0x3ca4d9);if(!hasChanges(_0xc95ea4))console['error'](a22_0x5b42bc[_0x2a480d(0x1f4)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x5b42bc[_0x2a480d(0x221)](_0x13b2db)+_0x2a480d(0x20b));else{console['error'](_0x2a480d(0x2a4)+_0x13b2db+'\x27:'),console[_0x2a480d(0x22b)]('─'[_0x2a480d(0x2b1)](0x3c)),console[_0x2a480d(0x22b)](formatDiffWithColors(_0xc95ea4)),console[_0x2a480d(0x22b)]('─'[_0x2a480d(0x2b1)](0x3c));if(!_0x250bb0[_0x2a480d(0x267)]){if(!isInteractive())return console[_0x2a480d(0x22b)](a22_0x5b42bc['red'](_0x2a480d(0x246)),_0x2a480d(0x27f)),console[_0x2a480d(0x22b)](a22_0x5b42bc[_0x2a480d(0x22d)](_0x2a480d(0x200))),0x1;const _0x3fdac1=await confirmKey(_0x2a480d(0x21f)+_0x13b2db+'\x27?');if(!_0x3fdac1)return console[_0x2a480d(0x22b)](a22_0x5b42bc[_0x2a480d(0x1ff)](_0x2a480d(0x249))),0x1;}writeFileSync(_0x13b2db,_0x3ca4d9,_0x2a480d(0x25d)),console['error'](a22_0x5b42bc[_0x2a480d(0x1f4)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a22_0x5b42bc[_0x2a480d(0x221)](_0x13b2db));}}else{const _0x345b87=a22_0x3c811b[_0x2a480d(0x22a)](_0x13b2db);!existsSync(_0x345b87)&&mkdirSync(_0x345b87,{'recursive':!![]}),writeFileSync(_0x13b2db,_0x3ca4d9,_0x2a480d(0x25d)),console[_0x2a480d(0x22b)](a22_0x5b42bc[_0x2a480d(0x1f4)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a22_0x5b42bc[_0x2a480d(0x221)](_0x13b2db));}return saveSessionContext({'parent_segment':_0x126721},_0x250bb0[_0x2a480d(0x202)]),console['error'](a22_0x5b42bc[_0x2a480d(0x1f4)]('✔')+_0x2a480d(0x26b)+a22_0x5b42bc[_0x2a480d(0x22d)](_0x2a480d(0x19e))+_0x2a480d(0x2a8)+a22_0x5b42bc['cyan'](_0x126721)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x1a5e68(0x26d)]='segment:parent:push';[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x1ca);async[a22_0x1a5e68(0x1db)](_0x5a942d){const _0x941705=a22_0x1a5e68,{options:_0x4dde4e,args:_0x11ca82,tdx:_0x2c20d2}=_0x5a942d,_0x2a9b95=_0x4dde4e,_0xcd6f80=_0x11ca82[0x0]||_0x4dde4e[_0x941705(0x2cb)];if(!_0xcd6f80)return showParentSegmentNotSetError(_0x941705(0x248)+_0x941705(0x219)),0x1;const _0xc2e74b=resolveYamlFile(_0xcd6f80);if(!existsSync(_0xc2e74b))return showFileNotFoundError(_0xc2e74b,_0xcd6f80),0x1;_0x2a9b95[_0x941705(0x1d9)]&&(console['error'](_0x941705(0x23c)+_0x2a9b95[_0x941705(0x1ea)]),console[_0x941705(0x22b)](_0x941705(0x2b9)+_0xc2e74b));let _0x813a13;try{_0x813a13=readFileSync(_0xc2e74b,_0x941705(0x25d));}catch(_0x37051b){const _0x28b927=_0x37051b instanceof Error?_0x37051b['message']:String(_0x37051b);return console['error'](_0x941705(0x2be)+_0x28b927),0x1;}const _0x581508=await withSpinner(_0x941705(0x23a),()=>_0x2c20d2[_0x941705(0x1a7)][_0x941705(0x26e)](_0x813a13),{'verbose':_0x2a9b95['verbose']}),_0x32b566=_0x581508[_0x941705(0x239)],{isNew:_0xe798b5,name:_0x18688e,hasChanges:_0x383c21,diffFormatted:_0xb0eef}=_0x32b566;if(!_0x383c21)return console[_0x941705(0x22b)](_0x941705(0x250)+_0x18688e+_0x941705(0x242)),0x0;_0xe798b5?console['error'](_0x941705(0x1e3)+_0x18688e+'\x27:'):console[_0x941705(0x22b)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x18688e+'\x27:');console[_0x941705(0x22b)]('─'[_0x941705(0x2b1)](0x3c)),console[_0x941705(0x22b)](_0xb0eef),console[_0x941705(0x22b)]('─'[_0x941705(0x2b1)](0x3c));const _0x478cc0=_0xe798b5?'Create\x20parent\x20segment\x20\x27'+_0x18688e+'\x27?':_0x941705(0x257)+_0x18688e+'\x27?';if(!_0x2a9b95[_0x941705(0x267)]){if(!isInteractive())return console['error'](a22_0x5b42bc['red'](_0x941705(0x246)),_0x941705(0x27f)),console[_0x941705(0x22b)](a22_0x5b42bc[_0x941705(0x22d)](_0x941705(0x200))),0x1;const _0x1af078=await confirmKey(_0x478cc0);if(!_0x1af078)return console['error'](a22_0x5b42bc[_0x941705(0x1ff)](_0x941705(0x249))),0x1;}const _0xcefe86=_0xe798b5?'Creating':_0x941705(0x25f),_0xcd74c1=await withSpinner(_0xcefe86+_0x941705(0x1a6)+_0x18688e+'\x27...',()=>_0x32b566[_0x941705(0x1c1)](),{'verbose':_0x2a9b95[_0x941705(0x1d9)]}),_0x46e760=_0xcd74c1[_0x941705(0x239)],_0x5c9a2b=getConsoleNextUrl(_0x2a9b95[_0x941705(0x1ea)],_0x941705(0x203)+_0x46e760['id']),_0xc02b77=_0xe798b5?'Created':_0x941705(0x1e0);return console[_0x941705(0x22b)]('✔\x20'+_0xc02b77+_0x941705(0x1a6)+_0x46e760['name']+'\x27'),console[_0x941705(0x22b)]('\x20\x20'+_0x5c9a2b),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']='segment:parent:validate';[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x290);async[a22_0x1a5e68(0x1db)](_0x52ae4c){const _0x32bf30=a22_0x1a5e68,{options:_0x522e67,args:_0x344946,tdx:_0x5c0e88}=_0x52ae4c,_0x2eb85a=_0x522e67,_0x35f41f=_0x344946[0x0]||_0x522e67[_0x32bf30(0x2cb)];if(!_0x35f41f)return showParentSegmentNotSetError(_0x32bf30(0x215)+_0x32bf30(0x294)+_0x32bf30(0x2da)+_0x32bf30(0x1e5)+'\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a'+_0x32bf30(0x2ca)),0x1;const _0x53a23f=resolveYamlFile(_0x35f41f);if(!existsSync(_0x53a23f))return showFileNotFoundError(_0x53a23f,_0x35f41f),0x1;_0x2eb85a[_0x32bf30(0x1d9)]&&(console[_0x32bf30(0x22b)]('Site:\x20'+_0x2eb85a[_0x32bf30(0x1ea)]),console[_0x32bf30(0x22b)](_0x32bf30(0x2b9)+_0x53a23f));let _0x36bf4b;try{_0x36bf4b=readFileSync(_0x53a23f,_0x32bf30(0x25d));}catch(_0x1c9eb9){const _0x1ae161=_0x1c9eb9 instanceof Error?_0x1c9eb9[_0x32bf30(0x25e)]:String(_0x1c9eb9);return console[_0x32bf30(0x22b)](_0x32bf30(0x2be)+_0x1ae161),0x1;}const _0x2ae42f=createCommandSpinner(a22_0x5b42bc[_0x32bf30(0x22d)]('Validating\x20configuration...'),{'verbose':_0x2eb85a[_0x32bf30(0x1d9)]});_0x2ae42f[_0x32bf30(0x28b)]();const _0x248987={'onProgress':_0x4b3bb8=>{const _0x2d9d7a=_0x32bf30;_0x2ae42f[_0x2d9d7a(0x243)]=formatProgressMessage(_0x4b3bb8);}};if(_0x2eb85a[_0x32bf30(0x263)])_0x248987[_0x32bf30(0x263)]=!![];if(_0x2eb85a['enriched'])_0x248987[_0x32bf30(0x201)]=!![];_0x2eb85a[_0x32bf30(0x21c)]&&(_0x248987[_0x32bf30(0x21c)]=_0x2eb85a[_0x32bf30(0x21c)]);_0x2eb85a[_0x32bf30(0x297)]&&(_0x248987[_0x32bf30(0x297)]=_0x2eb85a[_0x32bf30(0x297)]);if(_0x2eb85a[_0x32bf30(0x1f3)])_0x248987[_0x32bf30(0x1f3)]=_0x2eb85a['interval'];let _0x187772;try{_0x187772=await _0x5c0e88['segment'][_0x32bf30(0x281)](_0x36bf4b,_0x248987),_0x2ae42f[_0x32bf30(0x235)]();}catch(_0x6549b0){_0x2ae42f[_0x32bf30(0x235)]();throw _0x6549b0;}const _0x17ad58=_0x2eb85a[_0x32bf30(0x1f3)]||'-1d';return this[_0x32bf30(0x29d)](_0x187772,_0x248987,_0x53a23f,_0x17ad58),_0x187772[_0x32bf30(0x19c)]?0x0:0x1;}[a22_0x1a5e68(0x29d)](_0x4a64a9,_0x2c9ab7,_0x4db98c,_0x2898a2){const _0x1aa65c=a22_0x1a5e68;console[_0x1aa65c(0x22b)]('\x0a'+a22_0x5b42bc[_0x1aa65c(0x197)]('Validate:')+'\x20'+_0x4a64a9[_0x1aa65c(0x26d)]),console[_0x1aa65c(0x22b)]('═'[_0x1aa65c(0x2b1)](0x3c)),this['displayMasterInfo'](_0x4a64a9);if(typeof _0x2c9ab7[_0x1aa65c(0x21c)]==='string'){this[_0x1aa65c(0x1f5)](_0x4a64a9),this[_0x1aa65c(0x212)](_0x4a64a9),this[_0x1aa65c(0x2a3)](_0x4db98c,_0x2898a2,'attribute',_0x2c9ab7[_0x1aa65c(0x21c)]);return;}if(_0x2c9ab7[_0x1aa65c(0x21c)]===!![]){this[_0x1aa65c(0x1f5)](_0x4a64a9),this[_0x1aa65c(0x212)](_0x4a64a9),this[_0x1aa65c(0x2a3)](_0x4db98c,_0x2898a2,'attributes');return;}if(typeof _0x2c9ab7[_0x1aa65c(0x297)]===_0x1aa65c(0x1d1)){this[_0x1aa65c(0x278)](_0x4a64a9,_0x2898a2),this[_0x1aa65c(0x212)](_0x4a64a9),this[_0x1aa65c(0x2a3)](_0x4db98c,_0x2898a2,_0x1aa65c(0x297),_0x2c9ab7[_0x1aa65c(0x297)]);return;}if(_0x2c9ab7[_0x1aa65c(0x297)]===!![]){this['displayBehaviorsStats'](_0x4a64a9,_0x2898a2),this[_0x1aa65c(0x212)](_0x4a64a9),this['displayPreviewHints'](_0x4db98c,_0x2898a2,_0x1aa65c(0x18f));return;}this[_0x1aa65c(0x1f5)](_0x4a64a9),this['displayBehaviorsStats'](_0x4a64a9,_0x2898a2),this[_0x1aa65c(0x212)](_0x4a64a9),this[_0x1aa65c(0x2a3)](_0x4db98c,_0x2898a2,_0x1aa65c(0x2a2));}['displayPreviewHints'](_0x4b9d83,_0x3dc7ea,_0x42b611,_0x44a37b){const _0x14fc39=a22_0x1a5e68;console[_0x14fc39(0x22b)]('\x0a'+a22_0x5b42bc[_0x14fc39(0x22d)](_0x14fc39(0x20d)));const _0x2b1e4b=_0x3dc7ea!=='-1d'?_0x14fc39(0x2bd)+_0x3dc7ea:'';if(_0x42b611===_0x14fc39(0x21c)&&_0x44a37b)console[_0x14fc39(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x14fc39(0x22d)](_0x14fc39(0x1ed)+_0x4b9d83+_0x14fc39(0x1c0)+_0x44a37b+'\x22'+_0x2b1e4b));else{if(_0x42b611==='behavior'&&_0x44a37b)console[_0x14fc39(0x22b)]('\x20\x20'+a22_0x5b42bc['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x4b9d83+'\x20--behavior\x20\x22'+_0x44a37b+'\x22'+_0x2b1e4b));else(_0x42b611==='attributes'||_0x42b611==='all')&&console[_0x14fc39(0x22b)]('\x20\x20'+a22_0x5b42bc['dim'](_0x14fc39(0x1ed)+_0x4b9d83+_0x14fc39(0x29e)+_0x2b1e4b));}(_0x42b611===_0x14fc39(0x18f)||_0x42b611===_0x14fc39(0x2a2))&&console['error']('\x20\x20'+a22_0x5b42bc[_0x14fc39(0x22d)](_0x14fc39(0x1ed)+_0x4b9d83+'\x20--behavior\x20\x22<name>\x22'+_0x2b1e4b)),_0x42b611==='all'&&console[_0x14fc39(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x14fc39(0x22d)](_0x14fc39(0x1ed)+_0x4b9d83+_0x14fc39(0x28e)+_0x2b1e4b));}[a22_0x1a5e68(0x1a2)](_0x3cafea){const _0x5589e6=a22_0x1a5e68,{master:_0x4e9bec}=_0x3cafea,_0x2e4ac6=_0x4e9bec[_0x5589e6(0x19a)]?a22_0x5b42bc[_0x5589e6(0x1f4)]('✔'):a22_0x5b42bc['red']('✘');console[_0x5589e6(0x22b)]('\x0a'+a22_0x5b42bc[_0x5589e6(0x22d)]('Master\x20Table')),console['error'](_0x2e4ac6+'\x20'+a22_0x5b42bc[_0x5589e6(0x197)](_0x4e9bec['database']+'.'+_0x4e9bec[_0x5589e6(0x1ab)])),_0x4e9bec[_0x5589e6(0x19a)]?_0x4e9bec[_0x5589e6(0x1ae)]!==undefined&&console[_0x5589e6(0x22b)]('\x20\x20'+a22_0x5b42bc['dim']('Rows:')+'\x20'+a22_0x5b42bc[_0x5589e6(0x221)](formatRows(_0x4e9bec[_0x5589e6(0x1ae)]))):console['error']('\x20\x20'+a22_0x5b42bc[_0x5589e6(0x234)]('Error:')+'\x20'+_0x4e9bec['schemaError']);}[a22_0x1a5e68(0x1f5)](_0x59e3de){const _0x3a8f39=a22_0x1a5e68;if(_0x59e3de['attributes'][_0x3a8f39(0x283)]===0x0)return;console['error']('\x0a'+a22_0x5b42bc[_0x3a8f39(0x22d)](_0x3a8f39(0x1b3)));for(const _0x58ac48 of _0x59e3de[_0x3a8f39(0x1f9)]){const _0x20a927=_0x58ac48['schemaValid']?a22_0x5b42bc['green']('✔'):a22_0x5b42bc[_0x3a8f39(0x234)]('✘');let _0x413922='';if(_0x58ac48[_0x3a8f39(0x19a)]&&_0x58ac48[_0x3a8f39(0x2c7)]!==undefined&&_0x58ac48[_0x3a8f39(0x1ce)]!==undefined){const _0x4b8c8c=_0x58ac48['coveragePercent'][_0x3a8f39(0x1e1)](0x1),_0xb48b51=_0x58ac48[_0x3a8f39(0x1ce)]>=0x50?a22_0x5b42bc[_0x3a8f39(0x1f4)]:_0x58ac48[_0x3a8f39(0x1ce)]>=0x32?a22_0x5b42bc['yellow']:a22_0x5b42bc[_0x3a8f39(0x234)];_0x413922='\x20'+a22_0x5b42bc[_0x3a8f39(0x22d)]('Coverage:')+'\x20'+_0xb48b51(_0x4b8c8c+'%')+'\x20('+formatRows(_0x58ac48[_0x3a8f39(0x2c7)])+_0x3a8f39(0x196);}console['error'](_0x20a927+'\x20'+a22_0x5b42bc[_0x3a8f39(0x197)](_0x58ac48[_0x3a8f39(0x26d)])+_0x413922),console[_0x3a8f39(0x22b)]('\x20\x20'+a22_0x5b42bc['dim'](_0x3a8f39(0x25c))+'\x20'+a22_0x5b42bc[_0x3a8f39(0x197)](_0x58ac48[_0x3a8f39(0x1e6)]+'.'+_0x58ac48[_0x3a8f39(0x1ab)]));const _0x186619=_0x58ac48['joinKey']===_0x58ac48[_0x3a8f39(0x2d6)]?a22_0x5b42bc['dim']('Join\x20on:')+'\x20'+_0x58ac48[_0x3a8f39(0x2a7)]:a22_0x5b42bc[_0x3a8f39(0x22d)](_0x3a8f39(0x1af))+'\x20'+_0x58ac48[_0x3a8f39(0x2a7)]+_0x3a8f39(0x2a8)+_0x58ac48['foreignKey'];console[_0x3a8f39(0x22b)]('\x20\x20'+_0x186619),console[_0x3a8f39(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x3a8f39(0x22d)]('Columns:')),this[_0x3a8f39(0x2b7)](_0x58ac48['columns']),!_0x58ac48[_0x3a8f39(0x19a)]&&console['error']('\x20\x20'+a22_0x5b42bc[_0x3a8f39(0x234)](_0x3a8f39(0x20a))+'\x20'+_0x58ac48[_0x3a8f39(0x1d6)]);}}[a22_0x1a5e68(0x278)](_0x2d4207,_0x14f038){const _0x545bdd=a22_0x1a5e68;if(_0x2d4207[_0x545bdd(0x18f)][_0x545bdd(0x283)]===0x0)return;console[_0x545bdd(0x22b)]('\x0a'+a22_0x5b42bc[_0x545bdd(0x22d)](_0x545bdd(0x2d0))+'\x20'+a22_0x5b42bc[_0x545bdd(0x22d)]('('+_0x14f038+')'));for(const _0x571e54 of _0x2d4207['behaviors']){const _0x3a5079=_0x571e54[_0x545bdd(0x19a)]?a22_0x5b42bc['green']('✔'):a22_0x5b42bc[_0x545bdd(0x234)]('✘');let _0x1c280a='';if(_0x571e54[_0x545bdd(0x19a)]&&_0x571e54['customersWithEvents']!==undefined&&_0x571e54['totalEvents']!==undefined){const _0x4f756e=_0x571e54[_0x545bdd(0x225)]?.[_0x545bdd(0x1e1)](0x1)||'?',_0x1f82e3=(_0x571e54['customerPercent']??0x0)>=0x32?a22_0x5b42bc[_0x545bdd(0x1f4)]:(_0x571e54[_0x545bdd(0x225)]??0x0)>=0x14?a22_0x5b42bc[_0x545bdd(0x1ff)]:a22_0x5b42bc['red'];_0x1c280a='\x20'+a22_0x5b42bc['dim']('Customers:')+'\x20'+_0x1f82e3(formatRows(_0x571e54[_0x545bdd(0x1dd)]))+'\x20('+_0x4f756e+_0x545bdd(0x253)+a22_0x5b42bc[_0x545bdd(0x22d)]('Events:')+'\x20'+a22_0x5b42bc[_0x545bdd(0x221)](formatRows(_0x571e54[_0x545bdd(0x271)]));}console[_0x545bdd(0x22b)](_0x3a5079+'\x20'+a22_0x5b42bc[_0x545bdd(0x197)](_0x571e54[_0x545bdd(0x26d)])+_0x1c280a),console['error']('\x20\x20'+a22_0x5b42bc[_0x545bdd(0x22d)](_0x545bdd(0x25c))+'\x20'+a22_0x5b42bc[_0x545bdd(0x197)](_0x571e54[_0x545bdd(0x1e6)]+'.'+_0x571e54[_0x545bdd(0x1ab)]));const _0xe6a9ed=_0x571e54[_0x545bdd(0x2a7)]===_0x571e54[_0x545bdd(0x2d6)]?a22_0x5b42bc['dim']('Join\x20on:')+'\x20'+_0x571e54[_0x545bdd(0x2a7)]:a22_0x5b42bc['dim'](_0x545bdd(0x1af))+'\x20'+_0x571e54[_0x545bdd(0x2a7)]+_0x545bdd(0x2a8)+_0x571e54['foreignKey'];console['error']('\x20\x20'+_0xe6a9ed),console['error']('\x20\x20'+a22_0x5b42bc[_0x545bdd(0x22d)](_0x545bdd(0x1a1))),this['displayColumns'](_0x571e54[_0x545bdd(0x1df)]),!_0x571e54[_0x545bdd(0x19a)]&&console[_0x545bdd(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x545bdd(0x234)](_0x545bdd(0x20a))+'\x20'+_0x571e54[_0x545bdd(0x1d6)]);}}['displayColumns'](_0x500c87){const _0x169f99=a22_0x1a5e68;for(const _0x195846 of _0x500c87){_0x195846['label']===_0x195846[_0x169f99(0x298)]||_0x195846[_0x169f99(0x298)]==='*'?console[_0x169f99(0x22b)]('\x20\x20\x20\x20-\x20'+_0x195846['label']):console[_0x169f99(0x22b)](_0x169f99(0x26f)+_0x195846['label']+'\x20'+a22_0x5b42bc[_0x169f99(0x22d)]('('+_0x195846[_0x169f99(0x298)]+')'));}}[a22_0x1a5e68(0x212)](_0x3f741c){const _0x21f700=a22_0x1a5e68;console[_0x21f700(0x22b)]('─'['repeat'](0x3c));if(_0x3f741c[_0x21f700(0x1e9)]['length']>0x0){console[_0x21f700(0x22b)]('\x0a'+a22_0x5b42bc[_0x21f700(0x234)](_0x21f700(0x1be)));for(const _0x118ce1 of _0x3f741c[_0x21f700(0x1e9)]){console[_0x21f700(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x21f700(0x234)]('•')+'\x20'+_0x118ce1);}}_0x3f741c[_0x21f700(0x19c)]&&console[_0x21f700(0x22b)]('\x0a'+a22_0x5b42bc[_0x21f700(0x1f4)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{['name']=a22_0x1a5e68(0x1fd);[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x1e4);async[a22_0x1a5e68(0x1db)](_0x117356){const _0x2799f6=a22_0x1a5e68,{options:_0x41d032,args:_0x3aecc1,tdx:_0x41943a}=_0x117356,_0x2767d6=_0x41d032,_0x1bd7a1=_0x3aecc1[0x0]||_0x41d032['parentSegment'];if(!_0x1bd7a1)return showParentSegmentNotSetError(_0x2799f6(0x2b0)+_0x2799f6(0x289)+_0x2799f6(0x1b2)+_0x2799f6(0x1cf)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0x2799f6(0x2a1)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0x2799f6(0x2ca)),0x1;if(!_0x2767d6['master']&&!_0x2767d6['attribute']&&!_0x2767d6[_0x2799f6(0x297)]&&!_0x2767d6['enriched'])return console[_0x2799f6(0x22b)](a22_0x5b42bc[_0x2799f6(0x234)](_0x2799f6(0x214))),console[_0x2799f6(0x22b)]('Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a'),console[_0x2799f6(0x22b)](_0x2799f6(0x28a)),console[_0x2799f6(0x22b)](_0x2799f6(0x22c)),console[_0x2799f6(0x22b)](_0x2799f6(0x193)),console[_0x2799f6(0x22b)](_0x2799f6(0x287)),console['error'](_0x2799f6(0x1cc)),0x1;const _0x326e21=resolveYamlFile(_0x1bd7a1);if(!existsSync(_0x326e21))return showFileNotFoundError(_0x326e21,_0x1bd7a1),0x1;_0x2767d6[_0x2799f6(0x1d9)]&&(console[_0x2799f6(0x22b)](_0x2799f6(0x23c)+_0x2767d6['site']),console[_0x2799f6(0x22b)]('YAML\x20file:\x20'+_0x326e21));let _0x2ea257;try{_0x2ea257=readFileSync(_0x326e21,_0x2799f6(0x25d));}catch(_0x3fd762){const _0xadd95e=_0x3fd762 instanceof Error?_0x3fd762[_0x2799f6(0x25e)]:String(_0x3fd762);return console['error'](_0x2799f6(0x2be)+_0xadd95e),0x1;}let _0x175038;try{_0x175038=parseDef(_0x2ea257);}catch(_0x6e4868){const _0x168c44=_0x6e4868 instanceof Error?_0x6e4868[_0x2799f6(0x25e)]:String(_0x6e4868);return console[_0x2799f6(0x22b)](a22_0x5b42bc[_0x2799f6(0x234)](_0x2799f6(0x282)+_0x168c44)),0x1;}if(_0x2767d6[_0x2799f6(0x21c)]===!![]||_0x2767d6[_0x2799f6(0x21c)]===''){const _0x186427=_0x175038[_0x2799f6(0x1f9)]?.[_0x2799f6(0x293)](_0x36b126=>_0x36b126['name'])||[];if(_0x186427[_0x2799f6(0x283)]===0x0)console['error'](a22_0x5b42bc['red']('Error:\x20No\x20attributes\x20defined\x20in\x20configuration'));else{console[_0x2799f6(0x22b)](a22_0x5b42bc[_0x2799f6(0x234)](_0x2799f6(0x23f))),console[_0x2799f6(0x22b)](_0x2799f6(0x2c1));for(const _0x2afe4d of _0x186427){console['error']('\x20\x20'+a22_0x5b42bc[_0x2799f6(0x221)](_0x2afe4d));}console[_0x2799f6(0x22b)](_0x2799f6(0x262)+_0x1bd7a1+_0x2799f6(0x1c0)+_0x186427[0x0]+'\x22');}return 0x1;}if(_0x2767d6[_0x2799f6(0x297)]===!![]||_0x2767d6[_0x2799f6(0x297)]===''){const _0x46d051=_0x175038[_0x2799f6(0x18f)]?.[_0x2799f6(0x293)](_0x5d08f6=>_0x5d08f6[_0x2799f6(0x26d)])||[];if(_0x46d051['length']===0x0)console[_0x2799f6(0x22b)](a22_0x5b42bc[_0x2799f6(0x234)](_0x2799f6(0x295)));else{console[_0x2799f6(0x22b)](a22_0x5b42bc[_0x2799f6(0x234)](_0x2799f6(0x2c6))),console['error'](_0x2799f6(0x232));for(const _0xf063d2 of _0x46d051){console[_0x2799f6(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x2799f6(0x221)](_0xf063d2));}console[_0x2799f6(0x22b)](_0x2799f6(0x262)+_0x1bd7a1+_0x2799f6(0x2ce)+_0x46d051[0x0]+'\x22');}return 0x1;}const _0x27e612=createCommandSpinner(a22_0x5b42bc[_0x2799f6(0x22d)](_0x2799f6(0x2b3)),{'verbose':_0x2767d6[_0x2799f6(0x1d9)]});_0x27e612[_0x2799f6(0x28b)]();const _0x5bfcd3={'onProgress':_0x91d155=>{const _0x23aa58=_0x2799f6;_0x27e612[_0x23aa58(0x243)]=formatProgressMessage(_0x91d155);}};if(_0x2767d6[_0x2799f6(0x263)])_0x5bfcd3[_0x2799f6(0x263)]=!![];if(_0x2767d6[_0x2799f6(0x21c)]&&typeof _0x2767d6['attribute']==='string')_0x5bfcd3['attribute']=_0x2767d6[_0x2799f6(0x21c)];if(_0x2767d6['behavior']&&typeof _0x2767d6[_0x2799f6(0x297)]===_0x2799f6(0x1d1))_0x5bfcd3[_0x2799f6(0x297)]=_0x2767d6[_0x2799f6(0x297)];if(_0x2767d6[_0x2799f6(0x201)])_0x5bfcd3[_0x2799f6(0x201)]=!![];if(_0x2767d6['interval'])_0x5bfcd3[_0x2799f6(0x1f3)]=_0x2767d6['interval'];let _0x3bdece;try{_0x3bdece=await _0x41943a['segment'][_0x2799f6(0x280)](_0x2ea257,_0x5bfcd3),_0x27e612[_0x2799f6(0x235)]();}catch(_0x180d65){_0x27e612[_0x2799f6(0x235)]();throw _0x180d65;}return await this[_0x2799f6(0x1c7)](_0x3bdece,{'master':_0x2767d6[_0x2799f6(0x263)],'attribute':typeof _0x2767d6[_0x2799f6(0x21c)]===_0x2799f6(0x1d1)?_0x2767d6[_0x2799f6(0x21c)]:undefined,'behavior':typeof _0x2767d6['behavior']===_0x2799f6(0x1d1)?_0x2767d6['behavior']:undefined,'enriched':_0x2767d6[_0x2799f6(0x201)]}),_0x3bdece[_0x2799f6(0x19c)]?0x0:0x1;}async[a22_0x1a5e68(0x1c7)](_0x198ded,_0x524f0e){const _0x52312b=a22_0x1a5e68;console['error']('\x0a'+a22_0x5b42bc['bold'](_0x52312b(0x223))+'\x20'+_0x198ded[_0x52312b(0x26d)]),console[_0x52312b(0x22b)]('═'[_0x52312b(0x2b1)](0x3c));if(_0x524f0e[_0x52312b(0x263)]&&_0x198ded[_0x52312b(0x2c8)]){const _0x54b83f=a22_0x5b42bc[_0x52312b(0x22d)]('Master:')+'\x20'+a22_0x5b42bc[_0x52312b(0x197)](_0x198ded[_0x52312b(0x263)][_0x52312b(0x1e6)]+'.'+_0x198ded[_0x52312b(0x263)][_0x52312b(0x1ab)]);await this[_0x52312b(0x2d9)](_0x54b83f,_0x198ded[_0x52312b(0x2c8)]);}else{if(_0x524f0e[_0x52312b(0x21c)]&&_0x198ded['sampleData']){const _0xa980f8=a22_0x5b42bc[_0x52312b(0x22d)](_0x52312b(0x1d0))+'\x20'+a22_0x5b42bc['bold'](_0x524f0e['attribute']);await this[_0x52312b(0x2d9)](_0xa980f8,_0x198ded['sampleData']);}else{if(_0x524f0e[_0x52312b(0x297)]&&_0x198ded[_0x52312b(0x2c8)]){const _0x43e3ef=a22_0x5b42bc[_0x52312b(0x22d)]('Behavior:')+'\x20'+a22_0x5b42bc[_0x52312b(0x197)](_0x524f0e[_0x52312b(0x297)]);await this[_0x52312b(0x2d9)](_0x43e3ef,_0x198ded[_0x52312b(0x2c8)]);}else{if(_0x524f0e[_0x52312b(0x201)]&&_0x198ded[_0x52312b(0x2c8)]){const _0x43436f=a22_0x5b42bc[_0x52312b(0x22d)](_0x52312b(0x1c4))+'\x20'+a22_0x5b42bc[_0x52312b(0x197)]('Master\x20+\x20Attributes');await this['displaySampleData'](_0x43436f,_0x198ded['sampleData']);}else!_0x198ded[_0x52312b(0x2c8)]&&console[_0x52312b(0x22b)](_0x52312b(0x2c2));}}}if(_0x198ded[_0x52312b(0x1e9)][_0x52312b(0x283)]>0x0){console[_0x52312b(0x22b)]('─'['repeat'](0x3c)),console[_0x52312b(0x22b)]('\x0a'+a22_0x5b42bc['red'](_0x52312b(0x1be)));for(const _0x25d7ea of _0x198ded[_0x52312b(0x1e9)]){console[_0x52312b(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x52312b(0x234)]('•')+'\x20'+_0x25d7ea);}}}async[a22_0x1a5e68(0x2d9)](_0x1c3b82,_0x55f6f3){const _0x12dbad=a22_0x1a5e68;if(_0x55f6f3[_0x12dbad(0x283)]===0x0){console[_0x12dbad(0x22b)]('\x0a'+_0x1c3b82),console['error'](_0x12dbad(0x29c));return;}console[_0x12dbad(0x22b)]('\x0a'+_0x1c3b82);const _0xbec3a3=Object['keys'](_0x55f6f3[0x0])[_0x12dbad(0x293)](_0x4b4be5=>({'name':_0x4b4be5,'type':typeof _0x55f6f3[0x0][_0x4b4be5]===_0x12dbad(0x1b7)?_0x12dbad(0x199):_0x12dbad(0x22f)})),_0x48bd95={'queryId':_0x12dbad(0x20f),'columns':_0xbec3a3,'data':_0x55f6f3,'stats':{'state':_0x12dbad(0x1f2),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x55f6f3['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x18830b=formatAsTable(_0x48bd95,_0x55f6f3['length'],!![]);await writeOutput(_0x18830b,undefined,_0x12dbad(0x1ab));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a22_0x1a5e68(0x26d)]=a22_0x1a5e68(0x1ee);[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x2ad);async[a22_0x1a5e68(0x1db)](_0x3618d4){const _0x35c5a4=a22_0x1a5e68,{options:_0x45094c,args:_0x4c9ffc,tdx:_0xe8c731}=_0x3618d4,_0x184c43=_0x45094c,_0x17b596=_0x4c9ffc[0x0]||_0x45094c[_0x35c5a4(0x2cb)];if(!_0x17b596)return showParentSegmentNotSetError(_0x35c5a4(0x216)+_0x35c5a4(0x265)),0x1;const _0x313366=resolveYamlFile(_0x17b596);if(existsSync(_0x313366)){_0x184c43['verbose']&&console['error'](_0x35c5a4(0x2bc)+_0x313366);let _0x8af1ff;try{_0x8af1ff=readFileSync(_0x313366,_0x35c5a4(0x25d));}catch(_0x2ea9ca){const _0x432242=_0x2ea9ca instanceof Error?_0x2ea9ca[_0x35c5a4(0x25e)]:String(_0x2ea9ca);return console[_0x35c5a4(0x22b)]('Error\x20reading\x20file:\x20'+_0x432242),0x1;}const _0xacc99d=await withSpinner(_0x35c5a4(0x23a),()=>_0xe8c731['segment'][_0x35c5a4(0x26e)](_0x8af1ff),{'verbose':_0x184c43[_0x35c5a4(0x1d9)]}),_0xde1914=_0xacc99d[_0x35c5a4(0x239)],{isNew:_0x51db05,name:_0xb61b7a,hasChanges:_0x29824b,diffFormatted:_0x379143}=_0xde1914;if(_0x29824b){_0x51db05?console[_0x35c5a4(0x22b)](_0x35c5a4(0x1e3)+_0xb61b7a+'\x27:'):console['error'](_0x35c5a4(0x2a6)+_0xb61b7a+'\x27:');console[_0x35c5a4(0x22b)]('─'[_0x35c5a4(0x2b1)](0x3c)),console[_0x35c5a4(0x22b)](_0x379143),console[_0x35c5a4(0x22b)]('─'[_0x35c5a4(0x2b1)](0x3c));const _0x20d7d4=_0x51db05?_0x35c5a4(0x21e)+_0xb61b7a+_0x35c5a4(0x2ba):_0x35c5a4(0x257)+_0xb61b7a+_0x35c5a4(0x2ba);if(!_0x184c43['yes']){if(!isInteractive())return console[_0x35c5a4(0x22b)](a22_0x5b42bc[_0x35c5a4(0x234)](_0x35c5a4(0x246)),_0x35c5a4(0x27f)),console[_0x35c5a4(0x22b)](a22_0x5b42bc[_0x35c5a4(0x22d)](_0x35c5a4(0x200))),0x1;const _0x309b80=await confirmKey(_0x20d7d4);if(!_0x309b80)return console[_0x35c5a4(0x22b)](a22_0x5b42bc[_0x35c5a4(0x1ff)](_0x35c5a4(0x249))),0x1;}const _0x173866=_0x51db05?_0x35c5a4(0x1c9):_0x35c5a4(0x25f);await withSpinner(_0x173866+_0x35c5a4(0x1a6)+_0xb61b7a+_0x35c5a4(0x1b6),()=>_0xde1914['apply'](),{'verbose':_0x184c43[_0x35c5a4(0x1d9)]});const _0x158013=_0x51db05?_0x35c5a4(0x2b4):_0x35c5a4(0x1e0);console[_0x35c5a4(0x22b)]('✔\x20'+_0x158013+_0x35c5a4(0x1a6)+_0xb61b7a+'\x27');}else console[_0x35c5a4(0x22b)](_0x35c5a4(0x250)+_0xb61b7a+'\x27\x20is\x20up\x20to\x20date');}const _0x22a7c9=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x17b596+_0x35c5a4(0x1b6),()=>_0xe8c731[_0x35c5a4(0x1a7)][_0x35c5a4(0x2a5)](_0x17b596),{'verbose':_0x184c43[_0x35c5a4(0x1d9)]}),_0x3314d4=_0x22a7c9[_0x35c5a4(0x239)],_0x23e114=getConsoleUrl(_0x184c43[_0x35c5a4(0x1ea)],_0x35c5a4(0x194)+_0x3314d4[_0x35c5a4(0x210)]+_0x35c5a4(0x2d2)+_0x3314d4[_0x35c5a4(0x29f)]+_0x35c5a4(0x2bf)+_0x3314d4[_0x35c5a4(0x2c9)]);return console['error'](_0x35c5a4(0x21d)),console[_0x35c5a4(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x35c5a4(0x22d)](_0x35c5a4(0x2d7))+'\x20'+_0x3314d4[_0x35c5a4(0x2b8)]),console['error']('\x20\x20'+a22_0x5b42bc[_0x35c5a4(0x22d)](_0x35c5a4(0x24d))+'\x20'+_0x3314d4[_0x35c5a4(0x27d)]),console[_0x35c5a4(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x35c5a4(0x22d)]('Session:')+'\x20'+_0x3314d4[_0x35c5a4(0x29f)]),console[_0x35c5a4(0x22b)]('\x20\x20'+a22_0x5b42bc[_0x35c5a4(0x22d)](_0x35c5a4(0x1c3))+'\x20'+_0x3314d4[_0x35c5a4(0x2c9)]),console['error']('\x20\x20'+_0x23e114),console[_0x35c5a4(0x22b)]('\x0a'+a22_0x5b42bc[_0x35c5a4(0x22d)](_0x35c5a4(0x206))+'\x20tdx\x20wf\x20attempt\x20'+_0x3314d4['workflowAttemptId']+_0x35c5a4(0x209)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x1a5e68(0x26d)]='segment:parent:fields';[a22_0x1a5e68(0x27c)]='List\x20available\x20fields\x20for\x20segmentation';async[a22_0x1a5e68(0x1db)](_0x193537){const _0x3ed563=a22_0x1a5e68,{options:_0x43c008,args:_0xfe3187,tdx:_0x7ebe13}=_0x193537,_0x4925bb=_0xfe3187[0x0]||_0x43c008['parentSegment'];if(!_0x4925bb)return showParentSegmentNotSetError(_0x3ed563(0x1a8)+'\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;_0x43c008[_0x3ed563(0x1d9)]&&(console[_0x3ed563(0x22b)](_0x3ed563(0x23c)+_0x43c008[_0x3ed563(0x1ea)]),console[_0x3ed563(0x22b)](_0x3ed563(0x23d)+_0x4925bb));const _0x2b6ef5=await withSpinner(_0x3ed563(0x285)+_0x4925bb+_0x3ed563(0x1b6),()=>_0x7ebe13[_0x3ed563(0x1a7)][_0x3ed563(0x218)](_0x4925bb),{'verbose':_0x43c008[_0x3ed563(0x1d9)]}),_0xd1007f=_0x2b6ef5[_0x3ed563(0x239)];console[_0x3ed563(0x22b)](_0x3ed563(0x26a)+_0xd1007f[_0x3ed563(0x283)]+'\x20field'+(_0xd1007f[_0x3ed563(0x283)]!==0x1?'s':''));if(_0x43c008['json']||_0x43c008['jsonl'])return await handleSDKOutput(_0xd1007f,_0x43c008),0x0;return displayFieldsHumanReadable(_0xd1007f,_0x4925bb),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']=a22_0x1a5e68(0x291);[a22_0x1a5e68(0x27c)]='Show\x20parent\x20segment\x20details';async['execute'](_0x2aee42){const _0x518645=a22_0x1a5e68,{options:_0xc734a0,args:_0x2cdc0e,tdx:_0x1ed746}=_0x2aee42,_0x376361=_0xc734a0,_0x579209=_0x2cdc0e[0x0]||_0xc734a0['parentSegment'];if(!_0x579209)return showParentSegmentNotSetError(_0x518645(0x1c5)+_0x518645(0x299)+_0x518645(0x2da)+_0x518645(0x192)),0x1;_0xc734a0['verbose']&&(console[_0x518645(0x22b)](_0x518645(0x23c)+_0xc734a0[_0x518645(0x1ea)]),console[_0x518645(0x22b)](_0x518645(0x23d)+_0x579209));const _0x179d1e=await withSpinner(_0x518645(0x275)+_0x579209+_0x518645(0x1b6),()=>_0x1ed746[_0x518645(0x1a7)]['getParentFull'](_0x579209),{'verbose':_0xc734a0[_0x518645(0x1d9)]}),_0x3589d1=_0x179d1e[_0x518645(0x239)];if(_0x376361[_0x518645(0x1ec)]){const _0x51f903=getConsoleNextUrl(_0x376361[_0x518645(0x1ea)],_0x518645(0x203)+_0x3589d1['id']);return console[_0x518645(0x22b)](a22_0x5b42bc[_0x518645(0x1f4)]('✔')+_0x518645(0x260)+a22_0x5b42bc[_0x518645(0x221)](_0x51f903)),openBrowser(_0x51f903),0x0;}return await handleSingleObjectOutput(_0x3589d1,_0xc734a0),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x1a5e68(0x26d)]=a22_0x1a5e68(0x2b5);[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x1a0);async[a22_0x1a5e68(0x1db)](_0x189c90){const _0x4efba6=a22_0x1a5e68,{options:_0x1c9083,args:_0x36dc7b,tdx:_0x508982}=_0x189c90,_0x19b699=_0x1c9083,_0x28e70c=_0x36dc7b[0x0]||_0x1c9083[_0x4efba6(0x2cb)];if(!_0x28e70c)return showParentSegmentNotSetError(_0x4efba6(0x226)+_0x4efba6(0x195)+_0x4efba6(0x2da)+_0x4efba6(0x1e8)),0x1;_0x1c9083['verbose']&&(console['error']('Site:\x20'+_0x1c9083['site']),console[_0x4efba6(0x22b)](_0x4efba6(0x23d)+_0x28e70c));const _0x1d3216=await withSpinner(_0x4efba6(0x1ef)+_0x28e70c+_0x4efba6(0x1b6),()=>_0x508982[_0x4efba6(0x1a7)][_0x4efba6(0x1b0)](_0x28e70c),{'verbose':_0x1c9083[_0x4efba6(0x1d9)]}),_0x4658ce=_0x1d3216[_0x4efba6(0x239)],_0x42a37d=_0x508982[_0x4efba6(0x1a7)][_0x4efba6(0x231)](_0x4658ce);if(_0x19b699['output']){const _0x4cfcf1=await this['collectSchema'](_0x189c90,_0x28e70c,_0x4658ce,_0x42a37d),_0x1bce93=this['formatSchemaJson'](_0x4cfcf1);writeFileSync(_0x19b699['output'],_0x1bce93);const _0x833dc6=_0x4cfcf1['customers']['columns'][_0x4efba6(0x283)]+_0x4cfcf1[_0x4efba6(0x18f)]['reduce']((_0x1ca73d,_0x1a4057)=>_0x1ca73d+_0x1a4057['columns'][_0x4efba6(0x283)],0x0),_0x19126d=_0x4cfcf1['behaviors'][_0x4efba6(0x238)](_0x1be339=>_0x1be339[_0x4efba6(0x1df)][_0x4efba6(0x283)]===0x0)[_0x4efba6(0x283)];return console['log'](_0x4efba6(0x292)+_0x19b699['output']),console[_0x4efba6(0x1fe)](_0x4efba6(0x2aa)+_0x42a37d),console['log'](_0x4efba6(0x1ad)+_0x4cfcf1[_0x4efba6(0x18f)][_0x4efba6(0x283)]+_0x4efba6(0x24c)),console[_0x4efba6(0x1fe)](_0x4efba6(0x264)+_0x833dc6+_0x4efba6(0x1f0)),_0x19126d>0x0&&console['log'](_0x4efba6(0x207)+_0x19126d+_0x4efba6(0x220)),0x0;}console[_0x4efba6(0x22b)]('\x0a'+a22_0x5b42bc[_0x4efba6(0x197)](_0x4efba6(0x27a))+'\x20'+a22_0x5b42bc[_0x4efba6(0x221)](_0x42a37d));const _0xa01977=await withSpinner(_0x4efba6(0x240),()=>_0x508982[_0x4efba6(0x1a7)][_0x4efba6(0x230)](_0x4658ce),{'verbose':_0x1c9083[_0x4efba6(0x1d9)]});console['error']('\x0a'+a22_0x5b42bc[_0x4efba6(0x197)]('customers')+'\x20'+a22_0x5b42bc[_0x4efba6(0x22d)]('('+_0x42a37d+'.customers)'));const _0x31da49=await executeSchemaQuery(_0xa01977[_0x4efba6(0x239)],_0x508982,_0x1c9083);await handleQueryOutput(_0x31da49,_0x1c9083);const _0x14a8f1=await withSpinner('Fetching\x20behavior\x20list...',()=>_0x508982[_0x4efba6(0x1a7)][_0x4efba6(0x1d3)](_0x4658ce),{'verbose':_0x1c9083[_0x4efba6(0x1d9)]});for(const _0x49351e of _0x14a8f1[_0x4efba6(0x239)]){const _0x2c8c6b=_0x4efba6(0x24b)+_0x49351e[_0x4efba6(0x2b6)]()[_0x4efba6(0x1cd)](/\s+/g,'_'),_0x4a1b44=_0x4efba6(0x2a0)+_0x42a37d+'.'+_0x2c8c6b;console[_0x4efba6(0x22b)]('\x0a'+a22_0x5b42bc[_0x4efba6(0x197)](_0x49351e)+'\x20'+a22_0x5b42bc[_0x4efba6(0x22d)]('('+_0x42a37d+'.'+_0x2c8c6b+')'));try{const _0x1dadac=await executeSchemaQuery(_0x4a1b44,_0x508982,_0x1c9083);await handleQueryOutput(_0x1dadac,_0x1c9083);}catch{console[_0x4efba6(0x22b)](a22_0x5b42bc['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a22_0x1a5e68(0x286)](_0x29260a,_0x32902b,_0x23cc11,_0x27b049){const _0x44db20=a22_0x1a5e68,{options:_0x26cee8,tdx:_0x5eb09b}=_0x29260a,_0x108144=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x5eb09b[_0x44db20(0x1a7)][_0x44db20(0x230)](_0x23cc11),{'verbose':_0x26cee8[_0x44db20(0x1d9)]}),_0x18dfc1=await executeSchemaQuery(_0x108144[_0x44db20(0x239)],_0x5eb09b,_0x26cee8),_0x5110a0=_0x18dfc1['data'][_0x44db20(0x293)](_0x2bbb65=>({'name':_0x2bbb65[_0x44db20(0x2cd)],'type':_0x2bbb65[_0x44db20(0x1fa)]})),_0x42c9a7=await withSpinner(_0x44db20(0x21a),()=>_0x5eb09b[_0x44db20(0x1a7)][_0x44db20(0x1d3)](_0x23cc11),{'verbose':_0x26cee8[_0x44db20(0x1d9)]}),_0x1c9ecc=[];for(const _0x4af401 of _0x42c9a7[_0x44db20(0x239)]){const _0x5a6392=_0x44db20(0x24b)+_0x4af401['toLowerCase']()[_0x44db20(0x1cd)](/\s+/g,'_'),_0x2a5463='SELECT\x20*\x20FROM\x20'+_0x27b049+'.'+_0x5a6392;let _0x5facbe=[];try{const _0x5129be=await executeSchemaQuery(_0x2a5463,_0x5eb09b,_0x26cee8);_0x5facbe=_0x5129be[_0x44db20(0x239)]['map'](_0x34ad4a=>({'name':_0x34ad4a[_0x44db20(0x2cd)],'type':_0x34ad4a['column_type']}));}catch{}_0x1c9ecc['push']({'table':_0x5a6392,'columns':_0x5facbe});}return{'database':_0x27b049,'parent_segment':_0x32902b,'parent_id':_0x23cc11,'customers':{'table':_0x44db20(0x1f6),'columns':_0x5110a0},'behaviors':_0x1c9ecc};}[a22_0x1a5e68(0x2db)](_0x3f77b9){const _0x41c502=a22_0x1a5e68,_0x2a1a38=_0x1ae5b0=>{const _0x4c53c0=a22_0x1aab;if(_0x1ae5b0['length']===0x0)return'[]';const _0x492699=_0x1ae5b0[_0x4c53c0(0x293)](_0x361a39=>_0x4c53c0(0x1d7)+_0x361a39[_0x4c53c0(0x26d)]+'\x22,\x20\x22type\x22:\x20\x22'+_0x361a39[_0x4c53c0(0x1d5)]+_0x4c53c0(0x2b2));return'[\x0a'+_0x492699[_0x4c53c0(0x1cb)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x62457c=_0x3f77b9[_0x41c502(0x18f)][_0x41c502(0x293)](_0x98f948=>{const _0x151288=_0x41c502;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x98f948['table']+_0x151288(0x1e7)+_0x2a1a38(_0x98f948['columns'])[_0x151288(0x1cd)](/^/gm,'\x20\x20')[_0x151288(0x2ac)]()+'\x0a\x20\x20\x20\x20}';})[_0x41c502(0x1cb)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x3f77b9['database']+_0x41c502(0x2ab)+_0x3f77b9[_0x41c502(0x19e)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x3f77b9[_0x41c502(0x222)]+_0x41c502(0x28d)+_0x3f77b9['customers'][_0x41c502(0x1ab)]+'\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'+_0x2a1a38(_0x3f77b9[_0x41c502(0x1f6)][_0x41c502(0x1df)])[_0x41c502(0x1cd)](/^/gm,'\x20\x20')[_0x41c502(0x2ac)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x62457c+_0x41c502(0x1bd);}}export class ParentSegmentSQLCommand extends BaseCommand{[a22_0x1a5e68(0x26d)]=a22_0x1a5e68(0x1bc);['description']=a22_0x1a5e68(0x28c);async[a22_0x1a5e68(0x1db)](_0x23fbee){const _0x234d67=a22_0x1a5e68,{options:_0x38849d,args:_0x2465ea,tdx:_0x5b1ad4}=_0x23fbee,_0x549b0b=_0x2465ea[0x0]||_0x38849d[_0x234d67(0x2cb)];if(!_0x549b0b)return showParentSegmentNotSetError(_0x234d67(0x20c)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment'),0x1;_0x38849d[_0x234d67(0x1d9)]&&(console['error']('Site:\x20'+_0x38849d[_0x234d67(0x1ea)]),console['error']('Parent\x20segment:\x20'+_0x549b0b));const _0x3ac421=await withSpinner(_0x234d67(0x1ef)+_0x549b0b+_0x234d67(0x1b6),()=>_0x5b1ad4[_0x234d67(0x1a7)][_0x234d67(0x1b0)](_0x549b0b),{'verbose':_0x38849d['verbose']}),_0x3e8f46=_0x3ac421[_0x234d67(0x239)],_0x1eee6d=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x549b0b+_0x234d67(0x1b6),()=>_0x5b1ad4[_0x234d67(0x1a7)][_0x234d67(0x230)](_0x3e8f46),{'verbose':_0x38849d['verbose']}),_0x105a6d=_0x1eee6d[_0x234d67(0x239)];return _0x38849d['format']===_0x234d67(0x273)||_0x38849d[_0x234d67(0x2d5)]===_0x234d67(0x276)?await handleSDKOutput([{'sql':_0x105a6d}],_0x38849d):console[_0x234d67(0x1fe)](_0x105a6d),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x1a5e68(0x26d)]=a22_0x1a5e68(0x1ba);[a22_0x1a5e68(0x27c)]=a22_0x1a5e68(0x259);async[a22_0x1a5e68(0x1db)](_0x4dca3c){const _0x3782de=a22_0x1a5e68,{options:_0x22f05f,args:_0x56922d,tdx:_0x4f59fa}=_0x4dca3c,_0x34f292=_0x56922d[0x0]||_0x22f05f[_0x3782de(0x2cb)];if(!_0x34f292)return showParentSegmentNotSetError(_0x3782de(0x2d1)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x22f05f['verbose']&&(console[_0x3782de(0x22b)](_0x3782de(0x23c)+_0x22f05f[_0x3782de(0x1ea)]),console['error']('Parent\x20segment:\x20'+_0x34f292));const _0x47403a=await withSpinner(_0x3782de(0x1ef)+_0x34f292+_0x3782de(0x1b6),()=>_0x4f59fa[_0x3782de(0x1a7)][_0x3782de(0x1b0)](_0x34f292),{'verbose':_0x22f05f['verbose']}),_0x26f518=_0x47403a['data'],_0x2096a4=await withSpinner('Fetching\x20SQL\x20for\x20\x27'+_0x34f292+_0x3782de(0x1b6),()=>_0x4f59fa[_0x3782de(0x1a7)]['getParentSQL'](_0x26f518),{'verbose':_0x22f05f[_0x3782de(0x1d9)]});let _0x29c8d7=_0x2096a4[_0x3782de(0x239)];const _0x27a15e=resolveLimit(_0x22f05f[_0x3782de(0x1f7)],DEFAULT_DISPLAY_LIMIT),_0x3cdd46=/\bLIMIT\s+\d+/i[_0x3782de(0x2a9)](_0x29c8d7);!_0x3cdd46&&(_0x29c8d7=_0x29c8d7[_0x3782de(0x2ac)]()[_0x3782de(0x1cd)](/;+$/,''),_0x29c8d7=_0x3782de(0x190)+_0x29c8d7+_0x3782de(0x25b)+_0x27a15e);_0x22f05f[_0x3782de(0x1d9)]&&console['error']('SQL\x20query:\x0a'+_0x29c8d7);const _0x15b936=await withProgressSpinner(_0x3782de(0x1b5),async _0x4f63d4=>{const _0x40a3f9=_0x3782de,_0x50decf=await _0x4f59fa[_0x40a3f9(0x24e)][_0x40a3f9(0x1db)](_0x29c8d7,{'catalog':'td','schema':_0x40a3f9(0x245),'onJobId':_0x1b2313=>{const _0xa66366=_0x40a3f9;_0x4f63d4[_0xa66366(0x1c6)](_0x1b2313);}});return _0x50decf;},{'verbose':_0x22f05f[_0x3782de(0x1d9)]}),_0x40b550=_0x15b936['data'],_0x21c19c=_0x40b550['jobId']?'\x20[Job\x20ID:\x20'+_0x40b550[_0x3782de(0x198)]+']':'';return console[_0x3782de(0x22b)](_0x3782de(0x1a9)+_0x40b550[_0x3782de(0x266)][_0x3782de(0x2c3)][_0x3782de(0x254)]()+_0x3782de(0x270)+(_0x3782de(0x1fb)+formatElapsed(_0x40b550['stats'][_0x3782de(0x26c)])+_0x21c19c)),await handleQueryOutput(_0x40b550,_0x22f05f),0x0;}}
1
+ const a22_0x46b216=a22_0xd58f;(function(_0xddd773,_0x5f0453){const _0x2142e9=a22_0xd58f,_0x1b3907=_0xddd773();while(!![]){try{const _0x5a709e=-parseInt(_0x2142e9(0x1e9))/0x1*(parseInt(_0x2142e9(0x2e5))/0x2)+parseInt(_0x2142e9(0x2cb))/0x3+parseInt(_0x2142e9(0x21e))/0x4*(-parseInt(_0x2142e9(0x207))/0x5)+-parseInt(_0x2142e9(0x2d5))/0x6+-parseInt(_0x2142e9(0x26d))/0x7*(parseInt(_0x2142e9(0x30c))/0x8)+-parseInt(_0x2142e9(0x2c2))/0x9*(-parseInt(_0x2142e9(0x2e4))/0xa)+-parseInt(_0x2142e9(0x238))/0xb*(-parseInt(_0x2142e9(0x2c4))/0xc);if(_0x5a709e===_0x5f0453)break;else _0x1b3907['push'](_0x1b3907['shift']());}catch(_0x47625a){_0x1b3907['push'](_0x1b3907['shift']());}}}(a22_0x328c,0xe4ad3));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a22_0x487f45 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';function a22_0x328c(){const _0x3e16f0=['all','segment:parent:push','addAttributes','query','List\x20available\x20fields\x20for\x20segmentation','yes','✘\x20Failed\x20to\x20rename\x20directory:\x20','sort','Listing\x20fields\x20for\x20\x27','pushParentYaml','segment:parent:fields','toLocaleString','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','rowCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','createParent','\x20--attribute\x20\x22','Fetching\x20SQL\x20for\x20\x27','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Found\x20YAML\x20file:\x20','jsonl','map','customerPercent','toLowerCase','match','description','segment:parent:sql','Validating\x20configuration...','data','Master\x20+\x20Attributes','customers','To\x20cancel:','Error:\x20Parent\x20segment\x20name\x20is\x20required','allValid','Apply\x20changes\x20to\x20\x27','jobId','\x0aChanges\x20to\x20apply\x20to\x20\x27','audienceId','Enriched:','start','Error:\x20--behavior\x20requires\x20a\x20name\x0a','\x20--interval\x20','displayMasterInfo','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','column','segment:parent:validate','timezone','Database:\x20','interval','%)\x20','Options\x20(one\x20required):\x0a','\x20is\x20already\x20up\x20to\x20date','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','stop','dirname','getParentFull','SQL\x20query:\x0a','Fetching\x20parent\x20segment\x20\x27','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','\x20\x20No\x20sample\x20data\x20available','segment:parent:desc','customerGroup','Pattern:\x20','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a','execute','string','segment:parent:list','displayPreviewResults','✔\x20Updated\x20parent\x20segment\x20\x27','\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22','run','\x20--behavior\x20\x22','joinKey','Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a','displayAttributesStats','Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a','segment','162xRaMmZ','👥\x20','38992476gizDRD','\x20[Job\x20ID:\x20','✔\x20No\x20changes\x20-\x20\x27','scheduleOption','Fetching\x20customers\x20schema...','coveragePercent','\x20Configuration\x20is\x20valid','1059900ryARlF','cyan','use','\x20\x20Database:\x20','\x20=\x20','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x20rows\x20','`\x20to\x20download\x20the\x20configuration\x20first','sampleData','listFields','10370286jrhNAa','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a','table','Schema\x20saved\x20to\x20','segment:parent:show','darwin','displayValidateResults','\x27\x20is\x20already\x20up\x20to\x20date','displaySummary','reduce','Join:','Get\x20SQL\x20query\x20for\x20parent\x20segment','Events:','Overwrite\x20\x27','786340WqjWdn','406gWvspj','Columns:','Analyzing\x20changes...','filter','List\x20parent\x20segments','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','segment:parent:update','\x22,\x20\x22type\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','listParents','matchedCount','getBehaviorNames','double','column_type','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','trim','No\x20parent\x20segments\x20match\x20pattern:\x20','information_schema','length','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x20tdx\x20wf\x20attempt\x20','addAttributesFile','setJobId','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','errors','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','behaviors','\x20rows)','Updated','pullParentYaml','Site:\x20','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','scheduleType','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','Creating','addBehaviorsFile','\x0aNew\x20parent\x20segment\x20\x27','Master\x20Table','4488fMtRyv','label','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','message','\x0aChanges\x20to\x20\x27','behaviorsFile','status','FINISHED','Created','\x0aNo\x20sample\x20data\x20available','database','in\x20','limit','schemaValid','displayColumns','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','segment:parent:preview','ignore','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','platform','replace','Updating','formatSchemaJson','\x0a\x20\x20]\x0a}\x0a','Options:','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','Error:\x20File\x20not\x20found:\x20','Attributes','.customers)','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x0aUsage:\x20tdx\x20ps\x20preview\x20','log','type','\x20behaviors','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Fetching\x20sample\x20data...','columns','/attempt/','processedRows','master','YAML\x20file:\x20','segment:parent:pull','displayPreviewHints','477GXsCvJ','Errors:','\x20--enriched','join','Preview:','Error\x20reading\x20file:\x20','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','Parent\x20segment:\x20','segment:parent:run','Creating\x20parent\x20segment\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','segment:parent:create','\x27\x20is\x20up\x20to\x20date','/\x20→\x20','✔\x20Query\x20completed:\x20Processed\x20','utf-8','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','displayBehaviorsStats','yellow','enriched','\x20\x20\x20\x20-\x20','Source:','Error:\x20--database\x20and\x20--table\x20are\x20required','.yml','test','output','Behaviors','toFixed','/\x20and\x20','behavior','7595WTRHnU','Customers:','workflowSessionId','\x20parent\x20segment\x20\x27','parentSegment','Master:','attributes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','varchar','\x0aError:','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','localeCompare','Resolving\x20parent\x20segment\x20\x27','Fetching\x20current\x20configuration\x20for\x20\x27','\x0a✔\x20Workflow\x20started','isDirectory','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','runParent','Join\x20on:','workflowAttemptId','Error\x20parsing\x20YAML:\x20','resolveParentId','endsWith','4108XbjSkF','\x20field','\x27...','getOutputDatabaseName','text','population','verbose','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Create\x20parent\x20segment\x20\x27','push','name','repeat','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Attribute:','/sessions/','totalEvents','Fetching\x20behavior\x20list...','\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','validateParentYaml','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','No\x20parent\x20segments\x20found','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','✔\x20Renamed\x20directory\x20to\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','green','11NeZgil','.yaml','Error:','behavior_','displaySampleData','json','attribute','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','\x27\x20and\x20run\x20workflow?','keys','Available\x20behaviors:','attributesFile','Table:\x20','unref','Aborted.','✔\x20Found\x20','parent_segment','\x20Context\x20set:\x20','Rows:','/\x20directory.\x0a','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','collectSchema','open','tdx\x20segment\x20parent\x20preview\x20','\x0a\x20\x20\x20\x20}','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','dim','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser','format','Available\x20attributes:','\x20--attribute\x20\x22<name>\x22','site','stats','Options:\x0a','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','getParentSQL','bold','Validate:','/app/workflows/','addBehaviors','customersWithEvents','schemaError','Output\x20Database:','\x20Opening\x20','\x0a⚠️\x20\x20Both\x20','Coverage:','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','/app/dw/parentSegments/','previewParentYaml','customerGroupFile','8687CjEmzY','apply','foreignKey','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','error','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a'];a22_0x328c=function(){return _0x3e16f0;};return a22_0x328c();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a22_0x3237f9 from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR='parent_segments',LEGACY_PARENT_SEGMENT_DIR=a22_0x46b216(0x248);function openBrowser(_0x54ed21){const _0x1d3910=a22_0x46b216,_0x2f7135=process[_0x1d3910(0x31f)],_0x5f1f75=_0x2f7135===_0x1d3910(0x2db)?_0x1d3910(0x24e):_0x2f7135==='win32'?_0x1d3910(0x29a):'xdg-open';spawn(_0x5f1f75,[_0x54ed21],{'detached':!![],'stdio':_0x1d3910(0x31d)})[_0x1d3910(0x245)]();}function migrateLegacyDirectory(){const _0x57b9cd=a22_0x46b216;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x86c9a8=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x86c9a8[_0x57b9cd(0x216)]())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x57b9cd(0x271)](a22_0x3237f9['yellow'](_0x57b9cd(0x266)+LEGACY_PARENT_SEGMENT_DIR+_0x57b9cd(0x205)+PARENT_SEGMENT_DIR+'/\x20directories\x20exist.')),console['error'](a22_0x3237f9[_0x57b9cd(0x253)](_0x57b9cd(0x217)+LEGACY_PARENT_SEGMENT_DIR+_0x57b9cd(0x24b))),![];console[_0x57b9cd(0x271)](a22_0x3237f9[_0x57b9cd(0x1fb)]('\x0a⚠️\x20\x20Migrating:\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x57b9cd(0x1f6)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x57b9cd(0x271)](a22_0x3237f9['green'](_0x57b9cd(0x235)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x264f7e){const _0x25eadc=_0x264f7e instanceof Error?_0x264f7e[_0x57b9cd(0x30f)]:String(_0x264f7e);return console[_0x57b9cd(0x271)](a22_0x3237f9['red'](_0x57b9cd(0x279)+_0x25eadc+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a22_0x46b216(0x2bb)](_0x48a010){const _0x406e81=a22_0x46b216;return migrateLegacyDirectory(),super[_0x406e81(0x2bb)](_0x48a010);}}function resolveYamlFile(_0x5ce5e2){const _0x3628e1=a22_0x46b216;if(_0x5ce5e2[_0x3628e1(0x21d)](_0x3628e1(0x200))||_0x5ce5e2[_0x3628e1(0x21d)](_0x3628e1(0x239)))return _0x5ce5e2;return a22_0x487f45[_0x3628e1(0x1ec)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x5ce5e2)+_0x3628e1(0x200));}function formatProgressMessage(_0x138aaa){const _0x96c1cf=a22_0x46b216,_0x4bf42d=_0x138aaa[_0x96c1cf(0x28b)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x4bf42d){const [,_0x28b0d9,_0x49d883,_0x12f883='']=_0x4bf42d;return a22_0x3237f9[_0x96c1cf(0x253)](_0x28b0d9+':')+'\x20'+_0x49d883+a22_0x3237f9[_0x96c1cf(0x253)](_0x12f883);}return a22_0x3237f9[_0x96c1cf(0x253)](_0x138aaa);}function showFileNotFoundError(_0xdcb4ff,_0x129a7b){const _0x2536df=a22_0x46b216;console[_0x2536df(0x271)](a22_0x3237f9[_0x2536df(0x2b3)](_0x2536df(0x326)+_0xdcb4ff+'\x0a')),console['error'](a22_0x3237f9['cyan'](_0x2536df(0x2ea)+_0x129a7b+_0x2536df(0x2d2)));}function showParentSegmentNotSetError(_0x2939e9){const _0x8f6367=a22_0x46b216;console[_0x8f6367(0x271)](a22_0x3237f9['yellow'](_0x8f6367(0x24c))),console[_0x8f6367(0x271)](_0x2939e9);}export class ParentSegmentListCommand extends BaseCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x2b7);['description']=a22_0x46b216(0x2e9);async[a22_0x46b216(0x2b5)](_0x12a67){const _0x1cf8aa=a22_0x46b216,{options:_0x10697f,args:_0x361d7c,tdx:_0x3bf7f8}=_0x12a67,_0x58f1d3=_0x361d7c[0x0];_0x10697f[_0x1cf8aa(0x224)]&&(console[_0x1cf8aa(0x271)](_0x1cf8aa(0x304)+_0x10697f['site']),_0x58f1d3&&console['error'](_0x1cf8aa(0x2b2)+_0x58f1d3));const _0x1a95e8=await withSpinner(_0x58f1d3?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x58f1d3+_0x1cf8aa(0x220):'Listing\x20parent\x20segments...',()=>_0x3bf7f8[_0x1cf8aa(0x2c1)][_0x1cf8aa(0x2ee)](),{'verbose':_0x10697f['verbose']});let _0xd3824f=_0x1a95e8['data'];if(_0x58f1d3){const _0x57e0cb=_0x58f1d3[_0x1cf8aa(0x320)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1cf8aa(0x320)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x2c2a0c=new RegExp('^'+_0x57e0cb+'$','i');_0xd3824f=_0xd3824f[_0x1cf8aa(0x2e8)](_0x1355ef=>_0x2c2a0c['test'](_0x1355ef[_0x1cf8aa(0x20d)]['name']));}_0xd3824f[_0x1cf8aa(0x27a)]((_0x1605fd,_0x49fc2e)=>_0x1605fd[_0x1cf8aa(0x20d)][_0x1cf8aa(0x228)][_0x1cf8aa(0x212)](_0x49fc2e[_0x1cf8aa(0x20d)]['name'])),console[_0x1cf8aa(0x271)](_0x1cf8aa(0x247)+_0xd3824f[_0x1cf8aa(0x2f8)]+'\x20parent\x20segment'+(_0xd3824f[_0x1cf8aa(0x2f8)]!==0x1?'s':''));const _0x2da5a3=_0x6b6894=>{const _0x3e9520=_0x1cf8aa;return getConsoleNextUrl(_0x10697f[_0x3e9520(0x259)],'/app/dw/parentSegments/'+_0x6b6894);};if(_0x10697f['format']===_0x1cf8aa(0x23d)||_0x10697f[_0x1cf8aa(0x256)]===_0x1cf8aa(0x287)){const _0x109fa5=_0xd3824f[_0x1cf8aa(0x288)](_0x3f911b=>({..._0x3f911b,'url':_0x2da5a3(_0x3f911b['id'])}));await handleSDKOutput(_0x109fa5,_0x10697f);}else{if(_0xd3824f[_0x1cf8aa(0x2f8)]===0x0)_0x58f1d3?console[_0x1cf8aa(0x32b)](_0x1cf8aa(0x2f6)+_0x58f1d3):console['log'](_0x1cf8aa(0x233));else for(const _0xf04947 of _0xd3824f){const _0x3be9ac=_0xf04947[_0x1cf8aa(0x20d)][_0x1cf8aa(0x223)]?a22_0x3237f9[_0x1cf8aa(0x253)]('\x20('+formatRows(_0xf04947[_0x1cf8aa(0x20d)][_0x1cf8aa(0x223)])+')'):'',_0x5e8116=hyperlink(_0xf04947['attributes'][_0x1cf8aa(0x228)],_0x2da5a3(_0xf04947['id']));console[_0x1cf8aa(0x32b)](_0x1cf8aa(0x2c3)+_0x5e8116+_0x3be9ac);}}return 0x0;}}function a22_0xd58f(_0x3cc5bb,_0x4cce81){_0x3cc5bb=_0x3cc5bb-0x1e6;const _0x328c9d=a22_0x328c();let _0xd58f27=_0x328c9d[_0x3cc5bb];return _0xd58f27;}export class ParentSegmentCreateCommand extends BaseCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x1f4);[a22_0x46b216(0x28c)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a22_0x46b216(0x2b5)](_0x4e506c){const _0x7f8d0d=a22_0x46b216,{options:_0x4d1f72,args:_0x345834,tdx:_0x52d377}=_0x4e506c;console[_0x7f8d0d(0x271)](_0x7f8d0d(0x2f3)+_0x7f8d0d(0x254)+_0x7f8d0d(0x272));const _0x130754=_0x4d1f72;if(_0x345834[_0x7f8d0d(0x2f8)]===0x0)return console[_0x7f8d0d(0x271)](a22_0x3237f9[_0x7f8d0d(0x2b3)](_0x7f8d0d(0x293))),console[_0x7f8d0d(0x271)](_0x7f8d0d(0x31e)),0x1;const _0x54683d=_0x345834[0x0];if(!_0x130754[_0x7f8d0d(0x316)]||!_0x130754[_0x7f8d0d(0x2d8)])return console['error'](_0x7f8d0d(0x1ff)),console['error'](_0x7f8d0d(0x31e)),0x1;_0x130754[_0x7f8d0d(0x224)]&&(console[_0x7f8d0d(0x271)](_0x7f8d0d(0x304)+_0x130754[_0x7f8d0d(0x259)]),console[_0x7f8d0d(0x271)]('Name:\x20'+_0x54683d),console[_0x7f8d0d(0x271)](_0x7f8d0d(0x2a2)+_0x130754[_0x7f8d0d(0x316)]),console[_0x7f8d0d(0x271)](_0x7f8d0d(0x244)+_0x130754[_0x7f8d0d(0x2d8)]));const _0xa9b4dd=await loadJSONFromOptions(_0x130754[_0x7f8d0d(0x20d)],_0x130754[_0x7f8d0d(0x243)]),_0x2a51fd=await loadJSONFromOptions(_0x130754[_0x7f8d0d(0x300)],_0x130754[_0x7f8d0d(0x311)]),_0x2f57f2=await loadJSONFromOptions(_0x130754['customerGroup'],_0x130754[_0x7f8d0d(0x26c)]),_0x1b1345={'name':_0x54683d,'description':_0x130754[_0x7f8d0d(0x28c)],'scheduleType':_0x130754[_0x7f8d0d(0x306)],'scheduleOption':_0x130754['scheduleOption'],'timezone':_0x130754[_0x7f8d0d(0x2a1)],'master':{'parentDatabaseName':_0x130754[_0x7f8d0d(0x316)],'parentTableName':_0x130754[_0x7f8d0d(0x2d8)]},'attributes':_0xa9b4dd,'behaviors':_0x2a51fd,'customerGroup':_0x2f57f2},_0x4e859a=await withSpinner(_0x7f8d0d(0x1f2)+_0x54683d+_0x7f8d0d(0x220),()=>_0x52d377[_0x7f8d0d(0x2c1)][_0x7f8d0d(0x282)](_0x1b1345),{'verbose':_0x4d1f72['verbose']}),_0x374def=_0x4e859a['data'];return console[_0x7f8d0d(0x271)]('✔\x20Created\x20parent\x20segment\x20\x27'+_0x374def[_0x7f8d0d(0x228)]+'\x27\x20with\x20ID:\x20'+_0x374def['id']),await handleSDKOutput([_0x374def],_0x4d1f72),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x2eb);[a22_0x46b216(0x28c)]='Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a22_0x46b216(0x2b5)](_0x968a8c){const _0x4ec12b=a22_0x46b216,{options:_0x6efe74,args:_0x2c9527,tdx:_0x3cec37}=_0x968a8c;console['error']('\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'+_0x4ec12b(0x272));const _0x4713ee=_0x6efe74;if(_0x2c9527[_0x4ec12b(0x2f8)]===0x0)return console[_0x4ec12b(0x271)](a22_0x3237f9[_0x4ec12b(0x2b3)](_0x4ec12b(0x293))),console['error'](_0x4ec12b(0x2ff)),0x1;const _0x5899c9=_0x2c9527[0x0];_0x4713ee[_0x4ec12b(0x224)]&&(console[_0x4ec12b(0x271)](_0x4ec12b(0x304)+_0x4713ee[_0x4ec12b(0x259)]),console[_0x4ec12b(0x271)](_0x4ec12b(0x1f0)+_0x5899c9));const _0x152c3d=await withSpinner(_0x4ec12b(0x214)+_0x5899c9+_0x4ec12b(0x220),()=>_0x3cec37['segment'][_0x4ec12b(0x2aa)](_0x5899c9),{'verbose':_0x4713ee[_0x4ec12b(0x224)]}),_0x365308=_0x152c3d[_0x4ec12b(0x28f)],_0x1b0475=await loadJSONFromOptions(_0x4713ee[_0x4ec12b(0x275)],_0x4713ee[_0x4ec12b(0x2fb)]),_0x274fc6=await loadJSONFromOptions(_0x4713ee[_0x4ec12b(0x261)],_0x4713ee[_0x4ec12b(0x309)]),_0x246603={'name':_0x365308[_0x4ec12b(0x228)],'description':_0x4713ee[_0x4ec12b(0x28c)]!==undefined?_0x4713ee['description']:_0x365308['description'],'scheduleType':_0x4713ee['scheduleType']!==undefined?_0x4713ee['scheduleType']:_0x365308['scheduleType'],'scheduleOption':_0x4713ee[_0x4ec12b(0x2c7)]!==undefined?_0x4713ee[_0x4ec12b(0x2c7)]:_0x365308['scheduleOption'],'timezone':_0x4713ee[_0x4ec12b(0x2a1)]!==undefined?_0x4713ee[_0x4ec12b(0x2a1)]:_0x365308['timezone'],'master':_0x365308[_0x4ec12b(0x334)],'attributes':_0x1b0475?[..._0x365308[_0x4ec12b(0x20d)]||[],..._0x1b0475]:_0x365308[_0x4ec12b(0x20d)],'behaviors':_0x274fc6?[..._0x365308[_0x4ec12b(0x300)]||[],..._0x274fc6]:_0x365308['behaviors'],'customerGroup':_0x365308[_0x4ec12b(0x2b1)]},_0x481c69=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0x5899c9+_0x4ec12b(0x220),()=>_0x3cec37[_0x4ec12b(0x2c1)]['updateParent'](_0x5899c9,_0x246603),{'verbose':_0x4713ee[_0x4ec12b(0x224)]}),_0x75ec24=_0x481c69[_0x4ec12b(0x28f)];return console[_0x4ec12b(0x271)](_0x4ec12b(0x2b9)+_0x75ec24[_0x4ec12b(0x228)]+'\x27'),await handleSDKOutput([_0x75ec24],_0x4713ee),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{['name']=a22_0x46b216(0x1e7);[a22_0x46b216(0x28c)]=a22_0x46b216(0x329);async[a22_0x46b216(0x2b5)](_0xe675be){const _0x41f15c=a22_0x46b216,{options:_0x1e6547,args:_0x5c8f52,tdx:_0xcb81a0}=_0xe675be,_0x43b7ef=_0x1e6547,_0x43d412=_0x5c8f52[0x0]||_0x1e6547[_0x41f15c(0x20b)];if(!_0x43d412)return showParentSegmentNotSetError(_0x41f15c(0x2f9)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment'),0x1;if(_0x43b7ef[_0x41f15c(0x2cd)]&&_0x43b7ef['output'])return console[_0x41f15c(0x271)](a22_0x3237f9[_0x41f15c(0x2b3)](_0x41f15c(0x2c0))),console['error'](a22_0x3237f9['dim']('The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires')),console[_0x41f15c(0x271)](a22_0x3237f9[_0x41f15c(0x253)]('using\x20the\x20default\x20path:\x20'+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x41f15c(0x271)](a22_0x3237f9['cyan'](_0x41f15c(0x268))),0x1;const _0x278231=_0x43b7ef[_0x41f15c(0x202)]||a22_0x487f45[_0x41f15c(0x1ec)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x43d412)+'.yml');_0x43b7ef[_0x41f15c(0x224)]&&(console[_0x41f15c(0x271)](_0x41f15c(0x304)+_0x43b7ef['site']),console[_0x41f15c(0x271)](_0x41f15c(0x1f0)+_0x43d412),console[_0x41f15c(0x271)]('Output\x20file:\x20'+_0x278231));const _0x3b892d=await withSpinner(_0x41f15c(0x2ac)+_0x43d412+'\x27...',()=>_0xcb81a0['segment'][_0x41f15c(0x303)](_0x43d412),{'verbose':_0x43b7ef['verbose']}),_0x17695d=_0x3b892d[_0x41f15c(0x28f)];if(existsSync(_0x278231)){const _0x36d36a=readFileSync(_0x278231,_0x41f15c(0x1f8)),_0x2d9837=generateDiff(_0x36d36a,_0x17695d);if(!hasChanges(_0x2d9837))console['error'](a22_0x3237f9[_0x41f15c(0x237)]('✔')+'\x20No\x20changes\x20-\x20'+a22_0x3237f9[_0x41f15c(0x2cc)](_0x278231)+_0x41f15c(0x2a6));else{console['error'](_0x41f15c(0x310)+_0x278231+'\x27:'),console['error']('─'['repeat'](0x3c)),console['error'](formatDiffWithColors(_0x2d9837)),console['error']('─'[_0x41f15c(0x229)](0x3c));if(!_0x43b7ef['yes']){if(!isInteractive())return console[_0x41f15c(0x271)](a22_0x3237f9['red'](_0x41f15c(0x210)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x41f15c(0x271)](a22_0x3237f9[_0x41f15c(0x253)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xa512b3=await confirmKey(_0x41f15c(0x2e3)+_0x278231+'\x27?');if(!_0xa512b3)return console[_0x41f15c(0x271)](a22_0x3237f9[_0x41f15c(0x1fb)](_0x41f15c(0x246))),0x1;}writeFileSync(_0x278231,_0x17695d,_0x41f15c(0x1f8)),console[_0x41f15c(0x271)](a22_0x3237f9[_0x41f15c(0x237)]('✔')+_0x41f15c(0x325)+a22_0x3237f9[_0x41f15c(0x2cc)](_0x278231));}}else{const _0xc33baa=a22_0x487f45[_0x41f15c(0x2a9)](_0x278231);!existsSync(_0xc33baa)&&mkdirSync(_0xc33baa,{'recursive':!![]}),writeFileSync(_0x278231,_0x17695d,_0x41f15c(0x1f8)),console[_0x41f15c(0x271)](a22_0x3237f9[_0x41f15c(0x237)]('✔')+_0x41f15c(0x325)+a22_0x3237f9['cyan'](_0x278231));}return saveSessionContext({'parent_segment':_0x43d412},_0x43b7ef['session']),console[_0x41f15c(0x271)](a22_0x3237f9['green']('✔')+_0x41f15c(0x249)+a22_0x3237f9[_0x41f15c(0x253)]('parent_segment')+_0x41f15c(0x2cf)+a22_0x3237f9['cyan'](_0x43d412)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x274);[a22_0x46b216(0x28c)]=a22_0x46b216(0x32f);async['execute'](_0x592e08){const _0xfedcd9=a22_0x46b216,{options:_0x34ecaa,args:_0x593901,tdx:_0x45f823}=_0x592e08,_0x6d758=_0x34ecaa,_0x36b203=_0x593901[0x0]||_0x34ecaa[_0xfedcd9(0x20b)];if(!_0x36b203)return showParentSegmentNotSetError(_0xfedcd9(0x2f4)+_0xfedcd9(0x281)),0x1;const _0x29ec4e=resolveYamlFile(_0x36b203);if(!existsSync(_0x29ec4e))return showFileNotFoundError(_0x29ec4e,_0x36b203),0x1;_0x6d758[_0xfedcd9(0x224)]&&(console[_0xfedcd9(0x271)](_0xfedcd9(0x304)+_0x6d758['site']),console[_0xfedcd9(0x271)](_0xfedcd9(0x1e6)+_0x29ec4e));let _0x43540b;try{_0x43540b=readFileSync(_0x29ec4e,_0xfedcd9(0x1f8));}catch(_0x34727e){const _0x8e76a6=_0x34727e instanceof Error?_0x34727e['message']:String(_0x34727e);return console['error'](_0xfedcd9(0x1ee)+_0x8e76a6),0x1;}const _0x351ae1=await withSpinner(_0xfedcd9(0x2e7),()=>_0x45f823['segment']['pushParentYaml'](_0x43540b),{'verbose':_0x6d758['verbose']}),_0xcc388a=_0x351ae1[_0xfedcd9(0x28f)],{isNew:_0x4d9455,name:_0x2af3ab,hasChanges:_0x41c2ae,diffFormatted:_0x56ec1b}=_0xcc388a;if(!_0x41c2ae)return console[_0xfedcd9(0x271)](_0xfedcd9(0x2c6)+_0x2af3ab+_0xfedcd9(0x2dd)),0x0;_0x4d9455?console[_0xfedcd9(0x271)](_0xfedcd9(0x30a)+_0x2af3ab+'\x27:'):console[_0xfedcd9(0x271)](_0xfedcd9(0x297)+_0x2af3ab+'\x27:');console[_0xfedcd9(0x271)]('─'[_0xfedcd9(0x229)](0x3c)),console[_0xfedcd9(0x271)](_0x56ec1b),console[_0xfedcd9(0x271)]('─'[_0xfedcd9(0x229)](0x3c));const _0x338fc4=_0x4d9455?_0xfedcd9(0x226)+_0x2af3ab+'\x27?':'Apply\x20changes\x20to\x20\x27'+_0x2af3ab+'\x27?';if(!_0x6d758[_0xfedcd9(0x278)]){if(!isInteractive())return console[_0xfedcd9(0x271)](a22_0x3237f9['red'](_0xfedcd9(0x210)),_0xfedcd9(0x20e)),console[_0xfedcd9(0x271)](a22_0x3237f9[_0xfedcd9(0x253)](_0xfedcd9(0x251))),0x1;const _0x55d728=await confirmKey(_0x338fc4);if(!_0x55d728)return console[_0xfedcd9(0x271)](a22_0x3237f9['yellow'](_0xfedcd9(0x246))),0x1;}const _0x2380bf=_0x4d9455?_0xfedcd9(0x308):_0xfedcd9(0x321),_0x2c4e61=await withSpinner(_0x2380bf+_0xfedcd9(0x20a)+_0x2af3ab+'\x27...',()=>_0xcc388a[_0xfedcd9(0x26e)](),{'verbose':_0x6d758['verbose']}),_0x22df3e=_0x2c4e61[_0xfedcd9(0x28f)],_0x5bbf82=getConsoleNextUrl(_0x6d758[_0xfedcd9(0x259)],_0xfedcd9(0x26a)+_0x22df3e['id']),_0xfc1975=_0x4d9455?'Created':_0xfedcd9(0x302);return console['error']('✔\x20'+_0xfc1975+'\x20parent\x20segment\x20\x27'+_0x22df3e['name']+'\x27'),console['error']('\x20\x20'+_0x5bbf82),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{['name']=a22_0x46b216(0x2a0);[a22_0x46b216(0x28c)]=a22_0x46b216(0x1f9);async[a22_0x46b216(0x2b5)](_0x442fd0){const _0x59520f=a22_0x46b216,{options:_0x263b9e,args:_0x19a36d,tdx:_0x5ef384}=_0x442fd0,_0x423f81=_0x263b9e,_0x6554e4=_0x19a36d[0x0]||_0x263b9e[_0x59520f(0x20b)];if(!_0x6554e4)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+'\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a'+_0x59520f(0x211)+_0x59520f(0x30e)),0x1;const _0x4fef69=resolveYamlFile(_0x6554e4);if(!existsSync(_0x4fef69))return showFileNotFoundError(_0x4fef69,_0x6554e4),0x1;_0x423f81[_0x59520f(0x224)]&&(console[_0x59520f(0x271)](_0x59520f(0x304)+_0x423f81['site']),console[_0x59520f(0x271)]('YAML\x20file:\x20'+_0x4fef69));let _0x5d41b7;try{_0x5d41b7=readFileSync(_0x4fef69,_0x59520f(0x1f8));}catch(_0xe1d9d0){const _0x1481f7=_0xe1d9d0 instanceof Error?_0xe1d9d0['message']:String(_0xe1d9d0);return console[_0x59520f(0x271)]('Error\x20reading\x20file:\x20'+_0x1481f7),0x1;}const _0x2dd73f=createCommandSpinner(a22_0x3237f9['dim'](_0x59520f(0x28e)),{'verbose':_0x423f81[_0x59520f(0x224)]});_0x2dd73f[_0x59520f(0x29a)]();const _0x5e855c={'onProgress':_0x926242=>{const _0x323b85=_0x59520f;_0x2dd73f[_0x323b85(0x222)]=formatProgressMessage(_0x926242);}};if(_0x423f81[_0x59520f(0x334)])_0x5e855c[_0x59520f(0x334)]=!![];if(_0x423f81['enriched'])_0x5e855c[_0x59520f(0x1fc)]=!![];_0x423f81[_0x59520f(0x23e)]&&(_0x5e855c[_0x59520f(0x23e)]=_0x423f81[_0x59520f(0x23e)]);_0x423f81['behavior']&&(_0x5e855c[_0x59520f(0x206)]=_0x423f81['behavior']);if(_0x423f81[_0x59520f(0x2a3)])_0x5e855c['interval']=_0x423f81[_0x59520f(0x2a3)];let _0x307820;try{_0x307820=await _0x5ef384[_0x59520f(0x2c1)][_0x59520f(0x231)](_0x5d41b7,_0x5e855c),_0x2dd73f[_0x59520f(0x2a8)]();}catch(_0x142aac){_0x2dd73f[_0x59520f(0x2a8)]();throw _0x142aac;}const _0x30e109=_0x423f81[_0x59520f(0x2a3)]||'-1d';return this['displayValidateResults'](_0x307820,_0x5e855c,_0x4fef69,_0x30e109),_0x307820[_0x59520f(0x294)]?0x0:0x1;}[a22_0x46b216(0x2dc)](_0x58927e,_0x2ac168,_0x497b38,_0x234647){const _0x40d826=a22_0x46b216;console[_0x40d826(0x271)]('\x0a'+a22_0x3237f9[_0x40d826(0x25e)](_0x40d826(0x25f))+'\x20'+_0x58927e[_0x40d826(0x228)]),console[_0x40d826(0x271)]('═'[_0x40d826(0x229)](0x3c)),this[_0x40d826(0x29d)](_0x58927e);if(typeof _0x2ac168['attribute']==='string'){this[_0x40d826(0x2bf)](_0x58927e),this[_0x40d826(0x2de)](_0x58927e),this[_0x40d826(0x1e8)](_0x497b38,_0x234647,_0x40d826(0x23e),_0x2ac168['attribute']);return;}if(_0x2ac168[_0x40d826(0x23e)]===!![]){this[_0x40d826(0x2bf)](_0x58927e),this['displaySummary'](_0x58927e),this[_0x40d826(0x1e8)](_0x497b38,_0x234647,_0x40d826(0x20d));return;}if(typeof _0x2ac168[_0x40d826(0x206)]==='string'){this['displayBehaviorsStats'](_0x58927e,_0x234647),this[_0x40d826(0x2de)](_0x58927e),this[_0x40d826(0x1e8)](_0x497b38,_0x234647,_0x40d826(0x206),_0x2ac168['behavior']);return;}if(_0x2ac168[_0x40d826(0x206)]===!![]){this[_0x40d826(0x1fa)](_0x58927e,_0x234647),this[_0x40d826(0x2de)](_0x58927e),this[_0x40d826(0x1e8)](_0x497b38,_0x234647,_0x40d826(0x300));return;}this['displayAttributesStats'](_0x58927e),this[_0x40d826(0x1fa)](_0x58927e,_0x234647),this[_0x40d826(0x2de)](_0x58927e),this[_0x40d826(0x1e8)](_0x497b38,_0x234647,_0x40d826(0x273));}[a22_0x46b216(0x1e8)](_0x41caf7,_0x96bffc,_0xf0bbdb,_0x1ffce4){const _0x177e1d=a22_0x46b216;console[_0x177e1d(0x271)]('\x0a'+a22_0x3237f9[_0x177e1d(0x253)]('To\x20view\x20sample\x20data:'));const _0x1af936=_0x96bffc!=='-1d'?_0x177e1d(0x29c)+_0x96bffc:'';if(_0xf0bbdb===_0x177e1d(0x23e)&&_0x1ffce4)console['error']('\x20\x20'+a22_0x3237f9['dim'](_0x177e1d(0x24f)+_0x41caf7+_0x177e1d(0x283)+_0x1ffce4+'\x22'+_0x1af936));else{if(_0xf0bbdb===_0x177e1d(0x206)&&_0x1ffce4)console[_0x177e1d(0x271)]('\x20\x20'+a22_0x3237f9['dim'](_0x177e1d(0x24f)+_0x41caf7+_0x177e1d(0x2bc)+_0x1ffce4+'\x22'+_0x1af936));else(_0xf0bbdb==='attributes'||_0xf0bbdb==='all')&&console['error']('\x20\x20'+a22_0x3237f9[_0x177e1d(0x253)]('tdx\x20segment\x20parent\x20preview\x20'+_0x41caf7+_0x177e1d(0x258)+_0x1af936));}(_0xf0bbdb===_0x177e1d(0x300)||_0xf0bbdb===_0x177e1d(0x273))&&console['error']('\x20\x20'+a22_0x3237f9['dim']('tdx\x20segment\x20parent\x20preview\x20'+_0x41caf7+'\x20--behavior\x20\x22<name>\x22'+_0x1af936)),_0xf0bbdb===_0x177e1d(0x273)&&console[_0x177e1d(0x271)]('\x20\x20'+a22_0x3237f9[_0x177e1d(0x253)](_0x177e1d(0x24f)+_0x41caf7+_0x177e1d(0x1eb)+_0x1af936));}['displayMasterInfo'](_0x1c880d){const _0x167d95=a22_0x46b216,{master:_0x4ff340}=_0x1c880d,_0x2fe5b1=_0x4ff340[_0x167d95(0x319)]?a22_0x3237f9['green']('✔'):a22_0x3237f9['red']('✘');console[_0x167d95(0x271)]('\x0a'+a22_0x3237f9[_0x167d95(0x253)](_0x167d95(0x30b))),console[_0x167d95(0x271)](_0x2fe5b1+'\x20'+a22_0x3237f9[_0x167d95(0x25e)](_0x4ff340['database']+'.'+_0x4ff340[_0x167d95(0x2d8)])),_0x4ff340[_0x167d95(0x319)]?_0x4ff340[_0x167d95(0x280)]!==undefined&&console[_0x167d95(0x271)]('\x20\x20'+a22_0x3237f9[_0x167d95(0x253)](_0x167d95(0x24a))+'\x20'+a22_0x3237f9[_0x167d95(0x2cc)](formatRows(_0x4ff340['rowCount']))):console[_0x167d95(0x271)]('\x20\x20'+a22_0x3237f9[_0x167d95(0x2b3)]('Error:')+'\x20'+_0x4ff340['schemaError']);}['displayAttributesStats'](_0x2a8de5){const _0x7686d0=a22_0x46b216;if(_0x2a8de5[_0x7686d0(0x20d)][_0x7686d0(0x2f8)]===0x0)return;console[_0x7686d0(0x271)]('\x0a'+a22_0x3237f9[_0x7686d0(0x253)](_0x7686d0(0x327)));for(const _0x233d3f of _0x2a8de5[_0x7686d0(0x20d)]){const _0x5578fa=_0x233d3f['schemaValid']?a22_0x3237f9[_0x7686d0(0x237)]('✔'):a22_0x3237f9[_0x7686d0(0x2b3)]('✘');let _0x3c5481='';if(_0x233d3f[_0x7686d0(0x319)]&&_0x233d3f['matchedCount']!==undefined&&_0x233d3f[_0x7686d0(0x2c9)]!==undefined){const _0x3661eb=_0x233d3f[_0x7686d0(0x2c9)]['toFixed'](0x1),_0x2ee844=_0x233d3f['coveragePercent']>=0x50?a22_0x3237f9[_0x7686d0(0x237)]:_0x233d3f['coveragePercent']>=0x32?a22_0x3237f9['yellow']:a22_0x3237f9['red'];_0x3c5481='\x20'+a22_0x3237f9[_0x7686d0(0x253)](_0x7686d0(0x267))+'\x20'+_0x2ee844(_0x3661eb+'%')+'\x20('+formatRows(_0x233d3f[_0x7686d0(0x2ef)])+_0x7686d0(0x301);}console[_0x7686d0(0x271)](_0x5578fa+'\x20'+a22_0x3237f9['bold'](_0x233d3f[_0x7686d0(0x228)])+_0x3c5481),console[_0x7686d0(0x271)]('\x20\x20'+a22_0x3237f9['dim'](_0x7686d0(0x1fe))+'\x20'+a22_0x3237f9['bold'](_0x233d3f['database']+'.'+_0x233d3f[_0x7686d0(0x2d8)]));const _0x5c3c30=_0x233d3f[_0x7686d0(0x2bd)]===_0x233d3f['foreignKey']?a22_0x3237f9[_0x7686d0(0x253)](_0x7686d0(0x219))+'\x20'+_0x233d3f[_0x7686d0(0x2bd)]:a22_0x3237f9['dim'](_0x7686d0(0x2e0))+'\x20'+_0x233d3f[_0x7686d0(0x2bd)]+_0x7686d0(0x2cf)+_0x233d3f[_0x7686d0(0x26f)];console[_0x7686d0(0x271)]('\x20\x20'+_0x5c3c30),console['error']('\x20\x20'+a22_0x3237f9[_0x7686d0(0x253)](_0x7686d0(0x2e6))),this[_0x7686d0(0x31a)](_0x233d3f[_0x7686d0(0x331)]),!_0x233d3f[_0x7686d0(0x319)]&&console[_0x7686d0(0x271)]('\x20\x20'+a22_0x3237f9[_0x7686d0(0x2b3)](_0x7686d0(0x23a))+'\x20'+_0x233d3f[_0x7686d0(0x263)]);}}[a22_0x46b216(0x1fa)](_0x6fbaab,_0x3b4072){const _0x527456=a22_0x46b216;if(_0x6fbaab[_0x527456(0x300)][_0x527456(0x2f8)]===0x0)return;console[_0x527456(0x271)]('\x0a'+a22_0x3237f9[_0x527456(0x253)](_0x527456(0x203))+'\x20'+a22_0x3237f9[_0x527456(0x253)]('('+_0x3b4072+')'));for(const _0x1c4457 of _0x6fbaab['behaviors']){const _0x54ce5d=_0x1c4457[_0x527456(0x319)]?a22_0x3237f9[_0x527456(0x237)]('✔'):a22_0x3237f9['red']('✘');let _0x3bfd7a='';if(_0x1c4457[_0x527456(0x319)]&&_0x1c4457['customersWithEvents']!==undefined&&_0x1c4457[_0x527456(0x22d)]!==undefined){const _0x46691e=_0x1c4457[_0x527456(0x289)]?.[_0x527456(0x204)](0x1)||'?',_0x372e64=(_0x1c4457[_0x527456(0x289)]??0x0)>=0x32?a22_0x3237f9[_0x527456(0x237)]:(_0x1c4457['customerPercent']??0x0)>=0x14?a22_0x3237f9[_0x527456(0x1fb)]:a22_0x3237f9[_0x527456(0x2b3)];_0x3bfd7a='\x20'+a22_0x3237f9[_0x527456(0x253)](_0x527456(0x208))+'\x20'+_0x372e64(formatRows(_0x1c4457[_0x527456(0x262)]))+'\x20('+_0x46691e+_0x527456(0x2a4)+a22_0x3237f9[_0x527456(0x253)](_0x527456(0x2e2))+'\x20'+a22_0x3237f9[_0x527456(0x2cc)](formatRows(_0x1c4457['totalEvents']));}console[_0x527456(0x271)](_0x54ce5d+'\x20'+a22_0x3237f9[_0x527456(0x25e)](_0x1c4457[_0x527456(0x228)])+_0x3bfd7a),console['error']('\x20\x20'+a22_0x3237f9['dim'](_0x527456(0x1fe))+'\x20'+a22_0x3237f9[_0x527456(0x25e)](_0x1c4457[_0x527456(0x316)]+'.'+_0x1c4457['table']));const _0x5ca049=_0x1c4457[_0x527456(0x2bd)]===_0x1c4457['foreignKey']?a22_0x3237f9['dim'](_0x527456(0x219))+'\x20'+_0x1c4457[_0x527456(0x2bd)]:a22_0x3237f9['dim']('Join:')+'\x20'+_0x1c4457['joinKey']+'\x20=\x20'+_0x1c4457['foreignKey'];console['error']('\x20\x20'+_0x5ca049),console[_0x527456(0x271)]('\x20\x20'+a22_0x3237f9['dim'](_0x527456(0x2e6))),this[_0x527456(0x31a)](_0x1c4457[_0x527456(0x331)]),!_0x1c4457[_0x527456(0x319)]&&console[_0x527456(0x271)]('\x20\x20'+a22_0x3237f9[_0x527456(0x2b3)]('Error:')+'\x20'+_0x1c4457['schemaError']);}}[a22_0x46b216(0x31a)](_0x2b51e3){const _0x1660c5=a22_0x46b216;for(const _0x1a0db4 of _0x2b51e3){_0x1a0db4['label']===_0x1a0db4['column']||_0x1a0db4[_0x1660c5(0x29f)]==='*'?console[_0x1660c5(0x271)](_0x1660c5(0x1fd)+_0x1a0db4[_0x1660c5(0x30d)]):console[_0x1660c5(0x271)]('\x20\x20\x20\x20-\x20'+_0x1a0db4[_0x1660c5(0x30d)]+'\x20'+a22_0x3237f9['dim']('('+_0x1a0db4[_0x1660c5(0x29f)]+')'));}}[a22_0x46b216(0x2de)](_0x3df0ab){const _0x3af7ee=a22_0x46b216;console[_0x3af7ee(0x271)]('─'[_0x3af7ee(0x229)](0x3c));if(_0x3df0ab[_0x3af7ee(0x2fe)][_0x3af7ee(0x2f8)]>0x0){console['error']('\x0a'+a22_0x3237f9[_0x3af7ee(0x2b3)](_0x3af7ee(0x1ea)));for(const _0x879ca8 of _0x3df0ab['errors']){console[_0x3af7ee(0x271)]('\x20\x20'+a22_0x3237f9[_0x3af7ee(0x2b3)]('•')+'\x20'+_0x879ca8);}}_0x3df0ab[_0x3af7ee(0x294)]&&console[_0x3af7ee(0x271)]('\x0a'+a22_0x3237f9['green']('✔')+_0x3af7ee(0x2ca));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x31c);['description']=a22_0x46b216(0x230);async[a22_0x46b216(0x2b5)](_0x3b1d2c){const _0xabea6c=a22_0x46b216,{options:_0x134786,args:_0x22d5d7,tdx:_0x9cfede}=_0x3b1d2c,_0xa80af8=_0x134786,_0x1a51f3=_0x22d5d7[0x0]||_0x134786[_0xabea6c(0x20b)];if(!_0x1a51f3)return showParentSegmentNotSetError(_0xabea6c(0x2d6)+_0xabea6c(0x2d7)+_0xabea6c(0x2a5)+_0xabea6c(0x305)+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0xabea6c(0x32e)+'\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a'+_0xabea6c(0x30e)),0x1;if(!_0xa80af8['master']&&!_0xa80af8['attribute']&&!_0xa80af8[_0xabea6c(0x206)]&&!_0xa80af8[_0xabea6c(0x1fc)])return console[_0xabea6c(0x271)](a22_0x3237f9[_0xabea6c(0x2b3)](_0xabea6c(0x232))),console['error'](_0xabea6c(0x307)),console['error'](_0xabea6c(0x324)),console[_0xabea6c(0x271)](_0xabea6c(0x285)),console[_0xabea6c(0x271)](_0xabea6c(0x2ad)),console[_0xabea6c(0x271)](_0xabea6c(0x31b)),console['error'](_0xabea6c(0x2d0)),0x1;const _0x51e95b=resolveYamlFile(_0x1a51f3);if(!existsSync(_0x51e95b))return showFileNotFoundError(_0x51e95b,_0x1a51f3),0x1;_0xa80af8[_0xabea6c(0x224)]&&(console['error'](_0xabea6c(0x304)+_0xa80af8[_0xabea6c(0x259)]),console[_0xabea6c(0x271)](_0xabea6c(0x1e6)+_0x51e95b));let _0x291ff0;try{_0x291ff0=readFileSync(_0x51e95b,_0xabea6c(0x1f8));}catch(_0x397aef){const _0x1ef57d=_0x397aef instanceof Error?_0x397aef['message']:String(_0x397aef);return console['error'](_0xabea6c(0x1ee)+_0x1ef57d),0x1;}let _0x1c968a;try{_0x1c968a=parseDef(_0x291ff0);}catch(_0x2ff498){const _0x5dda37=_0x2ff498 instanceof Error?_0x2ff498[_0xabea6c(0x30f)]:String(_0x2ff498);return console[_0xabea6c(0x271)](a22_0x3237f9[_0xabea6c(0x2b3)](_0xabea6c(0x21b)+_0x5dda37)),0x1;}if(_0xa80af8[_0xabea6c(0x23e)]===!![]||_0xa80af8['attribute']===''){const _0x13762a=_0x1c968a[_0xabea6c(0x20d)]?.[_0xabea6c(0x288)](_0x1b7951=>_0x1b7951[_0xabea6c(0x228)])||[];if(_0x13762a[_0xabea6c(0x2f8)]===0x0)console[_0xabea6c(0x271)](a22_0x3237f9[_0xabea6c(0x2b3)](_0xabea6c(0x252)));else{console[_0xabea6c(0x271)](a22_0x3237f9['red'](_0xabea6c(0x225))),console[_0xabea6c(0x271)](_0xabea6c(0x257));for(const _0xfe6bf7 of _0x13762a){console[_0xabea6c(0x271)]('\x20\x20'+a22_0x3237f9[_0xabea6c(0x2cc)](_0xfe6bf7));}console[_0xabea6c(0x271)](_0xabea6c(0x32a)+_0x1a51f3+_0xabea6c(0x283)+_0x13762a[0x0]+'\x22');}return 0x1;}if(_0xa80af8['behavior']===!![]||_0xa80af8[_0xabea6c(0x206)]===''){const _0x589fef=_0x1c968a[_0xabea6c(0x300)]?.[_0xabea6c(0x288)](_0x212c9a=>_0x212c9a[_0xabea6c(0x228)])||[];if(_0x589fef[_0xabea6c(0x2f8)]===0x0)console[_0xabea6c(0x271)](a22_0x3237f9['red']('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console[_0xabea6c(0x271)](a22_0x3237f9[_0xabea6c(0x2b3)](_0xabea6c(0x29b))),console[_0xabea6c(0x271)](_0xabea6c(0x242));for(const _0x490c1f of _0x589fef){console[_0xabea6c(0x271)]('\x20\x20'+a22_0x3237f9['cyan'](_0x490c1f));}console[_0xabea6c(0x271)]('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x1a51f3+_0xabea6c(0x2bc)+_0x589fef[0x0]+'\x22');}return 0x1;}const _0x13a1af=createCommandSpinner(a22_0x3237f9[_0xabea6c(0x253)](_0xabea6c(0x330)),{'verbose':_0xa80af8[_0xabea6c(0x224)]});_0x13a1af[_0xabea6c(0x29a)]();const _0x1f3900={'onProgress':_0x3a9010=>{const _0x4a2dce=_0xabea6c;_0x13a1af[_0x4a2dce(0x222)]=formatProgressMessage(_0x3a9010);}};if(_0xa80af8[_0xabea6c(0x334)])_0x1f3900[_0xabea6c(0x334)]=!![];if(_0xa80af8[_0xabea6c(0x23e)]&&typeof _0xa80af8[_0xabea6c(0x23e)]===_0xabea6c(0x2b6))_0x1f3900[_0xabea6c(0x23e)]=_0xa80af8['attribute'];if(_0xa80af8['behavior']&&typeof _0xa80af8[_0xabea6c(0x206)]===_0xabea6c(0x2b6))_0x1f3900[_0xabea6c(0x206)]=_0xa80af8['behavior'];if(_0xa80af8[_0xabea6c(0x1fc)])_0x1f3900['enriched']=!![];if(_0xa80af8['interval'])_0x1f3900[_0xabea6c(0x2a3)]=_0xa80af8[_0xabea6c(0x2a3)];let _0x2a1462;try{_0x2a1462=await _0x9cfede['segment'][_0xabea6c(0x26b)](_0x291ff0,_0x1f3900),_0x13a1af['stop']();}catch(_0x37bdee){_0x13a1af[_0xabea6c(0x2a8)]();throw _0x37bdee;}return await this['displayPreviewResults'](_0x2a1462,{'master':_0xa80af8[_0xabea6c(0x334)],'attribute':typeof _0xa80af8[_0xabea6c(0x23e)]===_0xabea6c(0x2b6)?_0xa80af8[_0xabea6c(0x23e)]:undefined,'behavior':typeof _0xa80af8['behavior']===_0xabea6c(0x2b6)?_0xa80af8[_0xabea6c(0x206)]:undefined,'enriched':_0xa80af8[_0xabea6c(0x1fc)]}),_0x2a1462[_0xabea6c(0x294)]?0x0:0x1;}async[a22_0x46b216(0x2b8)](_0x357f2c,_0x4eb8af){const _0x5d11a3=a22_0x46b216;console['error']('\x0a'+a22_0x3237f9[_0x5d11a3(0x25e)](_0x5d11a3(0x1ed))+'\x20'+_0x357f2c[_0x5d11a3(0x228)]),console[_0x5d11a3(0x271)]('═'[_0x5d11a3(0x229)](0x3c));if(_0x4eb8af[_0x5d11a3(0x334)]&&_0x357f2c[_0x5d11a3(0x2d3)]){const _0x55b15b=a22_0x3237f9['dim'](_0x5d11a3(0x20c))+'\x20'+a22_0x3237f9[_0x5d11a3(0x25e)](_0x357f2c[_0x5d11a3(0x334)][_0x5d11a3(0x316)]+'.'+_0x357f2c['master'][_0x5d11a3(0x2d8)]);await this[_0x5d11a3(0x23c)](_0x55b15b,_0x357f2c[_0x5d11a3(0x2d3)]);}else{if(_0x4eb8af[_0x5d11a3(0x23e)]&&_0x357f2c['sampleData']){const _0xe95e15=a22_0x3237f9['dim'](_0x5d11a3(0x22b))+'\x20'+a22_0x3237f9[_0x5d11a3(0x25e)](_0x4eb8af['attribute']);await this[_0x5d11a3(0x23c)](_0xe95e15,_0x357f2c[_0x5d11a3(0x2d3)]);}else{if(_0x4eb8af['behavior']&&_0x357f2c[_0x5d11a3(0x2d3)]){const _0x4965f2=a22_0x3237f9['dim']('Behavior:')+'\x20'+a22_0x3237f9[_0x5d11a3(0x25e)](_0x4eb8af['behavior']);await this['displaySampleData'](_0x4965f2,_0x357f2c[_0x5d11a3(0x2d3)]);}else{if(_0x4eb8af[_0x5d11a3(0x1fc)]&&_0x357f2c[_0x5d11a3(0x2d3)]){const _0x358f8b=a22_0x3237f9[_0x5d11a3(0x253)](_0x5d11a3(0x299))+'\x20'+a22_0x3237f9[_0x5d11a3(0x25e)](_0x5d11a3(0x290));await this[_0x5d11a3(0x23c)](_0x358f8b,_0x357f2c[_0x5d11a3(0x2d3)]);}else!_0x357f2c[_0x5d11a3(0x2d3)]&&console[_0x5d11a3(0x271)](_0x5d11a3(0x315));}}}if(_0x357f2c[_0x5d11a3(0x2fe)][_0x5d11a3(0x2f8)]>0x0){console[_0x5d11a3(0x271)]('─'[_0x5d11a3(0x229)](0x3c)),console[_0x5d11a3(0x271)]('\x0a'+a22_0x3237f9[_0x5d11a3(0x2b3)](_0x5d11a3(0x1ea)));for(const _0x270dea of _0x357f2c[_0x5d11a3(0x2fe)]){console['error']('\x20\x20'+a22_0x3237f9[_0x5d11a3(0x2b3)]('•')+'\x20'+_0x270dea);}}}async[a22_0x46b216(0x23c)](_0x30edfe,_0x365301){const _0x33ad57=a22_0x46b216;if(_0x365301[_0x33ad57(0x2f8)]===0x0){console[_0x33ad57(0x271)]('\x0a'+_0x30edfe),console[_0x33ad57(0x271)](_0x33ad57(0x2af));return;}console[_0x33ad57(0x271)]('\x0a'+_0x30edfe);const _0x2f4eb5=Object[_0x33ad57(0x241)](_0x365301[0x0])[_0x33ad57(0x288)](_0x409e90=>({'name':_0x409e90,'type':typeof _0x365301[0x0][_0x409e90]==='number'?_0x33ad57(0x2f1):_0x33ad57(0x20f)})),_0x557cec={'queryId':'preview','columns':_0x2f4eb5,'data':_0x365301,'stats':{'state':_0x33ad57(0x313),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x365301[_0x33ad57(0x2f8)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x29b2ed=formatAsTable(_0x557cec,_0x365301[_0x33ad57(0x2f8)],!![]);await writeOutput(_0x29b2ed,undefined,'table');}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a22_0x46b216(0x1f1);[a22_0x46b216(0x28c)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a22_0x46b216(0x2b5)](_0x47f1a7){const _0xd13702=a22_0x46b216,{options:_0x1d63e8,args:_0x231c50,tdx:_0x1223af}=_0x47f1a7,_0x2e6657=_0x1d63e8,_0x307ec6=_0x231c50[0x0]||_0x1d63e8[_0xd13702(0x20b)];if(!_0x307ec6)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'+_0xd13702(0x270)),0x1;const _0x23143a=resolveYamlFile(_0x307ec6);if(existsSync(_0x23143a)){_0x2e6657['verbose']&&console[_0xd13702(0x271)](_0xd13702(0x286)+_0x23143a);let _0x598467;try{_0x598467=readFileSync(_0x23143a,_0xd13702(0x1f8));}catch(_0x2738d0){const _0x8a9242=_0x2738d0 instanceof Error?_0x2738d0[_0xd13702(0x30f)]:String(_0x2738d0);return console[_0xd13702(0x271)]('Error\x20reading\x20file:\x20'+_0x8a9242),0x1;}const _0xfd4f68=await withSpinner('Analyzing\x20changes...',()=>_0x1223af[_0xd13702(0x2c1)][_0xd13702(0x27c)](_0x598467),{'verbose':_0x2e6657[_0xd13702(0x224)]}),_0x4c86aa=_0xfd4f68[_0xd13702(0x28f)],{isNew:_0x192a17,name:_0x44ed70,hasChanges:_0xd5b08f,diffFormatted:_0x44536e}=_0x4c86aa;if(_0xd5b08f){_0x192a17?console[_0xd13702(0x271)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x44ed70+'\x27:'):console[_0xd13702(0x271)](_0xd13702(0x297)+_0x44ed70+'\x27:');console['error']('─'[_0xd13702(0x229)](0x3c)),console[_0xd13702(0x271)](_0x44536e),console[_0xd13702(0x271)]('─'[_0xd13702(0x229)](0x3c));const _0x498016=_0x192a17?'Create\x20parent\x20segment\x20\x27'+_0x44ed70+_0xd13702(0x240):_0xd13702(0x295)+_0x44ed70+_0xd13702(0x240);if(!_0x2e6657[_0xd13702(0x278)]){if(!isInteractive())return console[_0xd13702(0x271)](a22_0x3237f9[_0xd13702(0x2b3)]('\x0aError:'),_0xd13702(0x20e)),console[_0xd13702(0x271)](a22_0x3237f9[_0xd13702(0x253)](_0xd13702(0x251))),0x1;const _0x4efd2c=await confirmKey(_0x498016);if(!_0x4efd2c)return console['error'](a22_0x3237f9[_0xd13702(0x1fb)]('Aborted.')),0x1;}const _0x284517=_0x192a17?_0xd13702(0x308):'Updating';await withSpinner(_0x284517+_0xd13702(0x20a)+_0x44ed70+_0xd13702(0x220),()=>_0x4c86aa['apply'](),{'verbose':_0x2e6657['verbose']});const _0x78cb47=_0x192a17?_0xd13702(0x314):'Updated';console[_0xd13702(0x271)]('✔\x20'+_0x78cb47+'\x20parent\x20segment\x20\x27'+_0x44ed70+'\x27');}else console['error'](_0xd13702(0x2c6)+_0x44ed70+_0xd13702(0x1f5));}const _0x47e784=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x307ec6+_0xd13702(0x220),()=>_0x1223af[_0xd13702(0x2c1)][_0xd13702(0x218)](_0x307ec6),{'verbose':_0x2e6657[_0xd13702(0x224)]}),_0x28e746=_0x47e784[_0xd13702(0x28f)],_0x219b1d=getConsoleUrl(_0x2e6657['site'],_0xd13702(0x260)+_0x28e746['workflowId']+_0xd13702(0x22c)+_0x28e746['workflowSessionId']+_0xd13702(0x332)+_0x28e746[_0xd13702(0x21a)]);return console[_0xd13702(0x271)](_0xd13702(0x215)),console[_0xd13702(0x271)]('\x20\x20'+a22_0x3237f9[_0xd13702(0x253)]('Audience\x20ID:')+'\x20'+_0x28e746[_0xd13702(0x298)]),console[_0xd13702(0x271)]('\x20\x20'+a22_0x3237f9['dim']('Status:')+'\x20'+_0x28e746[_0xd13702(0x312)]),console[_0xd13702(0x271)]('\x20\x20'+a22_0x3237f9['dim']('Session:')+'\x20'+_0x28e746[_0xd13702(0x209)]),console['error']('\x20\x20'+a22_0x3237f9[_0xd13702(0x253)]('Attempt:')+'\x20'+_0x28e746[_0xd13702(0x21a)]),console[_0xd13702(0x271)]('\x20\x20'+_0x219b1d),console[_0xd13702(0x271)]('\x0a'+a22_0x3237f9['dim'](_0xd13702(0x292))+_0xd13702(0x2fa)+_0x28e746[_0xd13702(0x21a)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x27d);[a22_0x46b216(0x28c)]=a22_0x46b216(0x277);async[a22_0x46b216(0x2b5)](_0x1b9d18){const _0x45c51e=a22_0x46b216,{options:_0xf26f0f,args:_0x579ecd,tdx:_0x567b54}=_0x1b9d18,_0x462dc4=_0x579ecd[0x0]||_0xf26f0f[_0x45c51e(0x20b)];if(!_0x462dc4)return showParentSegmentNotSetError(_0x45c51e(0x269)+_0x45c51e(0x236)),0x1;_0xf26f0f['verbose']&&(console['error'](_0x45c51e(0x304)+_0xf26f0f[_0x45c51e(0x259)]),console[_0x45c51e(0x271)]('Parent\x20segment:\x20'+_0x462dc4));const _0x48c288=await withSpinner(_0x45c51e(0x27b)+_0x462dc4+_0x45c51e(0x220),()=>_0x567b54[_0x45c51e(0x2c1)][_0x45c51e(0x2d4)](_0x462dc4),{'verbose':_0xf26f0f[_0x45c51e(0x224)]}),_0x11b5b9=_0x48c288[_0x45c51e(0x28f)];console[_0x45c51e(0x271)]('✔\x20Found\x20'+_0x11b5b9['length']+_0x45c51e(0x21f)+(_0x11b5b9['length']!==0x1?'s':''));if(_0xf26f0f[_0x45c51e(0x23d)]||_0xf26f0f[_0x45c51e(0x287)])return await handleSDKOutput(_0x11b5b9,_0xf26f0f),0x0;return displayFieldsHumanReadable(_0x11b5b9,_0x462dc4),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{['name']='segment:parent:view';[a22_0x46b216(0x28c)]='Show\x20parent\x20segment\x20details';async[a22_0x46b216(0x2b5)](_0x36377a){const _0x1b591b=a22_0x46b216,{options:_0x1d09f9,args:_0x1bd069,tdx:_0xdff7b7}=_0x36377a,_0x2b178e=_0x1d09f9,_0x3822fd=_0x1bd069[0x0]||_0x1d09f9['parentSegment'];if(!_0x3822fd)return showParentSegmentNotSetError(_0x1b591b(0x1ef)+_0x1b591b(0x2ed)+_0x1b591b(0x25b)+_0x1b591b(0x255)),0x1;_0x1d09f9[_0x1b591b(0x224)]&&(console[_0x1b591b(0x271)](_0x1b591b(0x304)+_0x1d09f9[_0x1b591b(0x259)]),console['error']('Parent\x20segment:\x20'+_0x3822fd));const _0x1c3dae=await withSpinner(_0x1b591b(0x2ac)+_0x3822fd+_0x1b591b(0x220),()=>_0xdff7b7[_0x1b591b(0x2c1)][_0x1b591b(0x2aa)](_0x3822fd),{'verbose':_0x1d09f9[_0x1b591b(0x224)]}),_0x373196=_0x1c3dae[_0x1b591b(0x28f)];if(_0x2b178e['web']){const _0x17d06a=getConsoleNextUrl(_0x2b178e['site'],_0x1b591b(0x26a)+_0x373196['id']);return console[_0x1b591b(0x271)](a22_0x3237f9[_0x1b591b(0x237)]('✔')+_0x1b591b(0x265)+a22_0x3237f9[_0x1b591b(0x2cc)](_0x17d06a)),openBrowser(_0x17d06a),0x0;}return await handleSingleObjectOutput(_0x373196,_0x1d09f9),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x2b0);['description']='Show\x20parent\x20segment\x20schema\x20(column\x20types)';async[a22_0x46b216(0x2b5)](_0xd4e168){const _0x4748fc=a22_0x46b216,{options:_0x2d7c33,args:_0xe3a917,tdx:_0x2570c1}=_0xd4e168,_0x2b8e6a=_0x2d7c33,_0x2b9bed=_0xe3a917[0x0]||_0x2d7c33[_0x4748fc(0x20b)];if(!_0x2b9bed)return showParentSegmentNotSetError(_0x4748fc(0x2be)+_0x4748fc(0x2b4)+_0x4748fc(0x25b)+'\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path'),0x1;_0x2d7c33[_0x4748fc(0x224)]&&(console['error'](_0x4748fc(0x304)+_0x2d7c33[_0x4748fc(0x259)]),console[_0x4748fc(0x271)]('Parent\x20segment:\x20'+_0x2b9bed));const _0x24892d=await withSpinner(_0x4748fc(0x213)+_0x2b9bed+_0x4748fc(0x220),()=>_0x2570c1[_0x4748fc(0x2c1)]['resolveParentId'](_0x2b9bed),{'verbose':_0x2d7c33[_0x4748fc(0x224)]}),_0x45d60b=_0x24892d[_0x4748fc(0x28f)],_0x558591=_0x2570c1[_0x4748fc(0x2c1)][_0x4748fc(0x221)](_0x45d60b);if(_0x2b8e6a[_0x4748fc(0x202)]){const _0x562ca3=await this[_0x4748fc(0x24d)](_0xd4e168,_0x2b9bed,_0x45d60b,_0x558591),_0x37ba0e=this[_0x4748fc(0x322)](_0x562ca3);writeFileSync(_0x2b8e6a[_0x4748fc(0x202)],_0x37ba0e);const _0x179c17=_0x562ca3[_0x4748fc(0x291)][_0x4748fc(0x331)][_0x4748fc(0x2f8)]+_0x562ca3[_0x4748fc(0x300)][_0x4748fc(0x2df)]((_0x23ce02,_0x12c233)=>_0x23ce02+_0x12c233['columns'][_0x4748fc(0x2f8)],0x0),_0x45a5d3=_0x562ca3[_0x4748fc(0x300)][_0x4748fc(0x2e8)](_0x5a832e=>_0x5a832e['columns'][_0x4748fc(0x2f8)]===0x0)[_0x4748fc(0x2f8)];return console['log'](_0x4748fc(0x2d9)+_0x2b8e6a[_0x4748fc(0x202)]),console[_0x4748fc(0x32b)](_0x4748fc(0x2ce)+_0x558591),console[_0x4748fc(0x32b)]('\x20\x20Tables:\x201\x20customers\x20+\x20'+_0x562ca3[_0x4748fc(0x300)][_0x4748fc(0x2f8)]+_0x4748fc(0x32d)),console[_0x4748fc(0x32b)]('\x20\x20Columns:\x20'+_0x179c17+'\x20total'),_0x45a5d3>0x0&&console[_0x4748fc(0x32b)]('\x20\x20Note:\x20'+_0x45a5d3+_0x4748fc(0x22f)),0x0;}console[_0x4748fc(0x271)]('\x0a'+a22_0x3237f9['bold'](_0x4748fc(0x264))+'\x20'+a22_0x3237f9[_0x4748fc(0x2cc)](_0x558591));const _0x4c3ae7=await withSpinner(_0x4748fc(0x2c8),()=>_0x2570c1[_0x4748fc(0x2c1)][_0x4748fc(0x25d)](_0x45d60b),{'verbose':_0x2d7c33[_0x4748fc(0x224)]});console['error']('\x0a'+a22_0x3237f9[_0x4748fc(0x25e)]('customers')+'\x20'+a22_0x3237f9['dim']('('+_0x558591+_0x4748fc(0x328)));const _0x14b44f=await executeSchemaQuery(_0x4c3ae7[_0x4748fc(0x28f)],_0x2570c1,_0x2d7c33);await handleQueryOutput(_0x14b44f,_0x2d7c33);const _0x412205=await withSpinner(_0x4748fc(0x22e),()=>_0x2570c1[_0x4748fc(0x2c1)]['getBehaviorNames'](_0x45d60b),{'verbose':_0x2d7c33[_0x4748fc(0x224)]});for(const _0x466f88 of _0x412205['data']){const _0x4fd323='behavior_'+_0x466f88[_0x4748fc(0x28a)]()[_0x4748fc(0x320)](/\s+/g,'_'),_0x5b2a6b='SELECT\x20*\x20FROM\x20'+_0x558591+'.'+_0x4fd323;console[_0x4748fc(0x271)]('\x0a'+a22_0x3237f9['bold'](_0x466f88)+'\x20'+a22_0x3237f9[_0x4748fc(0x253)]('('+_0x558591+'.'+_0x4fd323+')'));try{const _0x45e00b=await executeSchemaQuery(_0x5b2a6b,_0x2570c1,_0x2d7c33);await handleQueryOutput(_0x45e00b,_0x2d7c33);}catch{console['error'](a22_0x3237f9['yellow'](_0x4748fc(0x25c)));}}return 0x0;}async[a22_0x46b216(0x24d)](_0x42e418,_0x527b6c,_0x32de30,_0x2fceae){const _0x5d7f53=a22_0x46b216,{options:_0x331948,tdx:_0x2c9220}=_0x42e418,_0x443135=await withSpinner(_0x5d7f53(0x2c8),()=>_0x2c9220[_0x5d7f53(0x2c1)]['getParentSQL'](_0x32de30),{'verbose':_0x331948[_0x5d7f53(0x224)]}),_0x5a6836=await executeSchemaQuery(_0x443135[_0x5d7f53(0x28f)],_0x2c9220,_0x331948),_0x1b13a5=_0x5a6836[_0x5d7f53(0x28f)][_0x5d7f53(0x288)](_0x1fa86f=>({'name':_0x1fa86f['column_name'],'type':_0x1fa86f[_0x5d7f53(0x2f2)]})),_0x46a0e3=await withSpinner(_0x5d7f53(0x22e),()=>_0x2c9220[_0x5d7f53(0x2c1)][_0x5d7f53(0x2f0)](_0x32de30),{'verbose':_0x331948[_0x5d7f53(0x224)]}),_0xf10163=[];for(const _0x4172b4 of _0x46a0e3[_0x5d7f53(0x28f)]){const _0x29bdde=_0x5d7f53(0x23b)+_0x4172b4[_0x5d7f53(0x28a)]()[_0x5d7f53(0x320)](/\s+/g,'_'),_0x2d6728='SELECT\x20*\x20FROM\x20'+_0x2fceae+'.'+_0x29bdde;let _0x4bc119=[];try{const _0x2312e0=await executeSchemaQuery(_0x2d6728,_0x2c9220,_0x331948);_0x4bc119=_0x2312e0[_0x5d7f53(0x28f)][_0x5d7f53(0x288)](_0x11860f=>({'name':_0x11860f['column_name'],'type':_0x11860f[_0x5d7f53(0x2f2)]}));}catch{}_0xf10163[_0x5d7f53(0x227)]({'table':_0x29bdde,'columns':_0x4bc119});}return{'database':_0x2fceae,'parent_segment':_0x527b6c,'parent_id':_0x32de30,'customers':{'table':_0x5d7f53(0x291),'columns':_0x1b13a5},'behaviors':_0xf10163};}[a22_0x46b216(0x322)](_0x293442){const _0x5a970f=a22_0x46b216,_0x4bd3e3=_0x3699d6=>{const _0xfafbc4=a22_0xd58f;if(_0x3699d6['length']===0x0)return'[]';const _0x231d9c=_0x3699d6[_0xfafbc4(0x288)](_0x2ea6b5=>_0xfafbc4(0x27f)+_0x2ea6b5[_0xfafbc4(0x228)]+_0xfafbc4(0x2ec)+_0x2ea6b5[_0xfafbc4(0x32c)]+'\x22\x20}');return'[\x0a'+_0x231d9c[_0xfafbc4(0x1ec)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x128265=_0x293442[_0x5a970f(0x300)][_0x5a970f(0x288)](_0x566c0e=>{const _0x3a87bc=_0x5a970f;return _0x3a87bc(0x2ba)+_0x566c0e[_0x3a87bc(0x2d8)]+_0x3a87bc(0x2fd)+_0x4bd3e3(_0x566c0e['columns'])['replace'](/^/gm,'\x20\x20')['trim']()+_0x3a87bc(0x250);})[_0x5a970f(0x1ec)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x293442[_0x5a970f(0x316)]+'\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22'+_0x293442[_0x5a970f(0x248)]+'\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22'+_0x293442['parent_id']+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x293442[_0x5a970f(0x291)][_0x5a970f(0x2d8)]+_0x5a970f(0x29e)+_0x4bd3e3(_0x293442[_0x5a970f(0x291)][_0x5a970f(0x331)])[_0x5a970f(0x320)](/^/gm,'\x20\x20')[_0x5a970f(0x2f5)]()+'\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a'+_0x128265+_0x5a970f(0x323);}}export class ParentSegmentSQLCommand extends BaseCommand{['name']=a22_0x46b216(0x28d);[a22_0x46b216(0x28c)]=a22_0x46b216(0x2e1);async[a22_0x46b216(0x2b5)](_0x239b95){const _0x529731=a22_0x46b216,{options:_0x3d8cc4,args:_0x3c3ed2,tdx:_0x470d9f}=_0x239b95,_0x155014=_0x3c3ed2[0x0]||_0x3d8cc4[_0x529731(0x20b)];if(!_0x155014)return showParentSegmentNotSetError(_0x529731(0x2a7)+_0x529731(0x23f)),0x1;_0x3d8cc4[_0x529731(0x224)]&&(console['error'](_0x529731(0x304)+_0x3d8cc4[_0x529731(0x259)]),console[_0x529731(0x271)](_0x529731(0x1f0)+_0x155014));const _0x4d0034=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x155014+'\x27...',()=>_0x470d9f[_0x529731(0x2c1)][_0x529731(0x21c)](_0x155014),{'verbose':_0x3d8cc4['verbose']}),_0x25193f=_0x4d0034[_0x529731(0x28f)],_0x4c0787=await withSpinner(_0x529731(0x284)+_0x155014+_0x529731(0x220),()=>_0x470d9f['segment'][_0x529731(0x25d)](_0x25193f),{'verbose':_0x3d8cc4['verbose']}),_0x280d0b=_0x4c0787[_0x529731(0x28f)];return _0x3d8cc4['format']===_0x529731(0x23d)||_0x3d8cc4[_0x529731(0x256)]===_0x529731(0x287)?await handleSDKOutput([{'sql':_0x280d0b}],_0x3d8cc4):console[_0x529731(0x32b)](_0x280d0b),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{[a22_0x46b216(0x228)]=a22_0x46b216(0x2da);[a22_0x46b216(0x28c)]=a22_0x46b216(0x234);async['execute'](_0x574afa){const _0x32fc83=a22_0x46b216,{options:_0x1cb753,args:_0x463292,tdx:_0x4fff31}=_0x574afa,_0x68ef21=_0x463292[0x0]||_0x1cb753[_0x32fc83(0x20b)];if(!_0x68ef21)return showParentSegmentNotSetError(_0x32fc83(0x2ae)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment'),0x1;_0x1cb753[_0x32fc83(0x224)]&&(console['error'](_0x32fc83(0x304)+_0x1cb753['site']),console[_0x32fc83(0x271)](_0x32fc83(0x1f0)+_0x68ef21));const _0x5662e8=await withSpinner(_0x32fc83(0x213)+_0x68ef21+_0x32fc83(0x220),()=>_0x4fff31[_0x32fc83(0x2c1)][_0x32fc83(0x21c)](_0x68ef21),{'verbose':_0x1cb753[_0x32fc83(0x224)]}),_0x3a9242=_0x5662e8['data'],_0x5b9ed9=await withSpinner(_0x32fc83(0x284)+_0x68ef21+_0x32fc83(0x220),()=>_0x4fff31[_0x32fc83(0x2c1)]['getParentSQL'](_0x3a9242),{'verbose':_0x1cb753[_0x32fc83(0x224)]});let _0x5d83fc=_0x5b9ed9[_0x32fc83(0x28f)];const _0x3918ed=resolveLimit(_0x1cb753[_0x32fc83(0x318)],DEFAULT_DISPLAY_LIMIT),_0x310247=/\bLIMIT\s+\d+/i[_0x32fc83(0x201)](_0x5d83fc);!_0x310247&&(_0x5d83fc=_0x5d83fc[_0x32fc83(0x2f5)]()['replace'](/;+$/,''),_0x5d83fc=_0x32fc83(0x1f3)+_0x5d83fc+_0x32fc83(0x22a)+_0x3918ed);_0x1cb753[_0x32fc83(0x224)]&&console[_0x32fc83(0x271)](_0x32fc83(0x2ab)+_0x5d83fc);const _0x5ec92d=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x3fa84d=>{const _0x1ee7e5=_0x32fc83,_0x581ec7=await _0x4fff31[_0x1ee7e5(0x276)][_0x1ee7e5(0x2b5)](_0x5d83fc,{'catalog':'td','schema':_0x1ee7e5(0x2f7),'onJobId':_0x42a67b=>{const _0x3d35fc=_0x1ee7e5;_0x3fa84d[_0x3d35fc(0x2fc)](_0x42a67b);}});return _0x581ec7;},{'verbose':_0x1cb753['verbose']}),_0x20a7d7=_0x5ec92d['data'],_0x5009b4=_0x20a7d7[_0x32fc83(0x296)]?_0x32fc83(0x2c5)+_0x20a7d7['jobId']+']':'';return console['error'](_0x32fc83(0x1f7)+_0x20a7d7['stats'][_0x32fc83(0x333)][_0x32fc83(0x27e)]()+_0x32fc83(0x2d1)+(_0x32fc83(0x317)+formatElapsed(_0x20a7d7[_0x32fc83(0x25a)]['elapsedTimeMillis'])+_0x5009b4)),await handleQueryOutput(_0x20a7d7,_0x1cb753),0x0;}}
@@ -1 +1 @@
1
- const a23_0x5400e5=a23_0x32ec;(function(_0x3fd948,_0x540bfe){const _0x2bea2e=a23_0x32ec,_0x14c174=_0x3fd948();while(!![]){try{const _0x571a8a=-parseInt(_0x2bea2e(0x1ac))/0x1+-parseInt(_0x2bea2e(0x187))/0x2*(-parseInt(_0x2bea2e(0x1b8))/0x3)+-parseInt(_0x2bea2e(0x191))/0x4*(parseInt(_0x2bea2e(0x1b0))/0x5)+-parseInt(_0x2bea2e(0x1ab))/0x6+-parseInt(_0x2bea2e(0x1a1))/0x7+parseInt(_0x2bea2e(0x16c))/0x8*(parseInt(_0x2bea2e(0x1a6))/0x9)+parseInt(_0x2bea2e(0x18f))/0xa;if(_0x571a8a===_0x540bfe)break;else _0x14c174['push'](_0x14c174['shift']());}catch(_0x2c7122){_0x14c174['push'](_0x14c174['shift']());}}}(a23_0x1cec,0x1c22b));function a23_0x1cec(){const _0xca4b0d=['115954rVPwrx','Failed\x20to\x20remove\x20profile:\x20','profileName','confirm','Session\x20profile\x20set\x20to:\x20','profile:use','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','3266060KOwndi','Enter\x20your\x20TD\x20API\x20key:','110468Gonmth','logLevel','Set\x20a\x20profile\x20configuration\x20value','tdx:\x20profile\x20remove','red','log','config','✗\x20Validation\x20failed:\x20','API\x20key\x20cannot\x20be\x20empty','test','/app/mp/ak','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','site','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Enter\x20site\x20name:','Profile\x20name\x20cannot\x20be\x20empty','281750JEXGlb','\x20\x20-\x20','password','yellow','includes','1836279RYedMw','tdx.json','\x20API\x20key\x20saved\x20to\x20system\x20keychain','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','green','1200150ziVDtT','177862YLJmtB','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','\x27\x20does\x20not\x20exist.\x20Create\x20it?','\x20Profile\x20\x27','10iAhhib','\x27\x20removed\x20from\x20configuration','trim','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','create','Profile\x20\x27','apiKey','customSite','3HxNWPG','llm_agent','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','\x20API\x20key\x20removed\x20from\x20system\x20keychain','Remove\x20a\x20profile','\x20--default\x27\x20to\x20save\x20permanently','Removal\x20cancelled','\x27\x20created','Unknown\x20key\x20\x27','split','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','us01','message','email','dim','\x27.\x0a\x0aValid\x20keys:\x20','(session:\x20','profile:create','\x27\x20requires\x20API\x20key\x20validation.','\x20\x20(no\x20profiles\x20found)','Validating\x20API\x20key...','\x0aSetup\x20cancelled','Set\x20session\x20profile','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','llm_project','length','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Operation\x20cancelled','\x27\x20does\x20not\x20exist.','8LcIhxH','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','text','ERROR','join','jobs','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','description','\x20\x20tdx\x20--profile\x20','status','VALID_KEYS','\x0aOperation\x20cancelled','session','validate','name','profile:set','getUserInfo','execute','profile','(cleared)','error','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Site\x20was\x20not\x20changed.','\x0aAvailable\x20profiles:','warn','tdx:\x20profile\x20create','bold'];a23_0x1cec=function(){return _0xca4b0d;};return a23_0x1cec();}import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a23_0x32ec(_0x41393d,_0x49abc0){_0x41393d=_0x41393d-0x165;const _0x1cec7e=a23_0x1cec();let _0x32ec65=_0x1cec7e[_0x41393d];return _0x32ec65;}import*as a23_0x42364d from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a23_0x144249 from'prompts';import a23_0x3193da from'chalk';function validateProfileName(_0x5aaffe){const _0x2bf7fd=a23_0x32ec;if(!_0x5aaffe||!_0x5aaffe[_0x2bf7fd(0x1b2)]())return _0x2bf7fd(0x1a0);const _0x1e020a=_0x5aaffe[_0x2bf7fd(0x1b2)]();if(!/^[a-zA-Z0-9_-]+$/[_0x2bf7fd(0x19a)](_0x1e020a))return _0x2bf7fd(0x1a9);if(profileExists(_0x1e020a))return _0x2bf7fd(0x1b5)+_0x1e020a+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.';return!![];}export class ProfileCreateCommand extends BaseCommand{[a23_0x5400e5(0x17a)]=a23_0x5400e5(0x1c9);[a23_0x5400e5(0x173)]='Create\x20a\x20new\x20profile';async[a23_0x5400e5(0x17d)](_0x25cc24){const _0x54658b=a23_0x5400e5,{options:_0x5e4ff8,args:_0x3bb2fa}=_0x25cc24;console['log'](a23_0x3193da[_0x54658b(0x186)](_0x54658b(0x185)));let _0x1f2544;if(_0x3bb2fa[_0x54658b(0x168)]>0x0&&_0x3bb2fa[0x0]){const _0x59a78b=_0x3bb2fa[0x0][_0x54658b(0x1b2)](),_0xa51dae=validateProfileName(_0x59a78b);if(_0xa51dae!==!![])return console[_0x54658b(0x180)](a23_0x3193da[_0x54658b(0x195)](_0xa51dae)),0x1;_0x1f2544=_0x59a78b;}else{const _0x2dbc99=await a23_0x144249({'type':_0x54658b(0x16e),'name':_0x54658b(0x189),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x2dbc99[_0x54658b(0x189)])return console[_0x54658b(0x196)]('\x0aSetup\x20cancelled'),0x1;_0x1f2544=_0x2dbc99['profileName'][_0x54658b(0x1b2)]();}const _0x2b3384=await a23_0x144249({'type':_0x54658b(0x16e),'name':_0x54658b(0x173),'message':'Enter\x20description\x20(optional):'}),_0x4f118d=_0x2b3384[_0x54658b(0x173)]?.['trim']()||undefined,_0x1ecaf6=_0x5e4ff8['site']||_0x54658b(0x1c3),{choices:_0x3b41f3,initialIndex:_0x600abd}=buildSiteChoices(_0x1ecaf6),_0x599530=await a23_0x144249({'type':'select','name':_0x54658b(0x19d),'message':_0x54658b(0x1ba)+_0x1f2544+'\x27:','choices':_0x3b41f3,'initial':_0x600abd});if(!_0x599530[_0x54658b(0x19d)])return console[_0x54658b(0x196)](_0x54658b(0x1cd)),0x1;let _0x5bf9e2;if(_0x599530[_0x54658b(0x19d)]==='other'){const _0x282274=await a23_0x144249({'type':'text','name':_0x54658b(0x1b7),'message':_0x54658b(0x19f),'initial':_0x54658b(0x1c3),'validate':_0x4ff7d0=>{const _0x7c13f=_0x54658b;if(!_0x4ff7d0||!_0x4ff7d0[_0x7c13f(0x1b2)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/['test'](_0x4ff7d0['trim']()))return'Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens';return!![];}});if(!_0x282274[_0x54658b(0x1b7)])return console[_0x54658b(0x196)](_0x54658b(0x1cd)),0x1;_0x5bf9e2=_0x282274[_0x54658b(0x1b7)];}else _0x5bf9e2=_0x599530[_0x54658b(0x19d)];const _0x2d8f00=resolveSite(_0x5bf9e2);console['log']('\x0aSetting\x20up\x20authentication\x20for\x20site:\x20'+_0x2d8f00),console[_0x54658b(0x196)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x54658b(0x196)]('\x20\x20'+getConsoleUrl(_0x2d8f00,_0x54658b(0x19b)));const _0x517f9d=await a23_0x144249({'type':_0x54658b(0x1a3),'name':'apiKey','message':_0x54658b(0x190),'validate':_0x15249e=>{const _0x1de047=_0x54658b;if(!_0x15249e||!_0x15249e[_0x1de047(0x1b2)]())return _0x1de047(0x199);return!![];}});if(!_0x517f9d[_0x54658b(0x1b6)])return console[_0x54658b(0x196)](_0x54658b(0x1cd)),0x1;const _0x3c3ddf=_0x517f9d[_0x54658b(0x1b6)];console[_0x54658b(0x196)](_0x54658b(0x1cc));try{const _0x455733=TDX[_0x54658b(0x1b4)]({'site':_0x2d8f00,'apiKey':_0x3c3ddf['trim'](),'logLevel':_0x5e4ff8[_0x54658b(0x192)]??LogLevel[_0x54658b(0x16f)]}),_0x333f7c=await _0x455733[_0x54658b(0x171)][_0x54658b(0x17c)]();console[_0x54658b(0x196)](a23_0x3193da[_0x54658b(0x1aa)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x333f7c[_0x54658b(0x1c5)]+')');const _0x54d053=await isKeychainAvailable();_0x54d053?(await saveAPIKeyAsync(_0x3c3ddf[_0x54658b(0x1b2)](),_0x2d8f00,_0x1f2544),console['log'](a23_0x3193da[_0x54658b(0x1aa)]('✓')+_0x54658b(0x1c2)+_0x1f2544+')')):(console[_0x54658b(0x184)](a23_0x3193da['yellow'](_0x54658b(0x19e))),console[_0x54658b(0x184)](a23_0x3193da[_0x54658b(0x1a4)]('\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.')));const _0x1187c8={'site':_0x2d8f00,..._0x4f118d&&{'description':_0x4f118d}};return saveProfileToUserConfig(_0x1f2544,_0x1187c8),console[_0x54658b(0x196)](a23_0x3193da[_0x54658b(0x1aa)]('✓')+_0x54658b(0x1af)+_0x1f2544+_0x54658b(0x1bf)),console[_0x54658b(0x196)](),console[_0x54658b(0x196)](_0x54658b(0x1ad)),console[_0x54658b(0x196)](_0x54658b(0x174)+_0x1f2544+_0x54658b(0x169)),console[_0x54658b(0x196)](_0x54658b(0x174)+_0x1f2544+_0x54658b(0x1b3)),0x0;}catch(_0x2ae75c){if(_0x2ae75c instanceof HTTPClientError&&_0x2ae75c['status']===0x191)return printAuthError(_0x2ae75c),0x1;return console[_0x54658b(0x180)](a23_0x3193da[_0x54658b(0x195)]('✗\x20Validation\x20failed:\x20'+(_0x2ae75c instanceof Error?_0x2ae75c[_0x54658b(0x1c4)]:String(_0x2ae75c)))),console[_0x54658b(0x180)](_0x54658b(0x18e)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a23_0x5400e5(0x17a)]='profile:remove';[a23_0x5400e5(0x173)]=a23_0x5400e5(0x1bc);[a23_0x5400e5(0x179)](_0x41a697){const _0x1d230a=a23_0x5400e5,{args:_0x4d9f2d}=_0x41a697;if(_0x4d9f2d[_0x1d230a(0x168)]===0x0)return _0x1d230a(0x16d);return undefined;}async[a23_0x5400e5(0x17d)](_0x14724c){const _0x2dfa69=a23_0x5400e5,{args:_0xa7162}=_0x14724c,_0x37eeb5=_0xa7162[0x0];console[_0x2dfa69(0x196)](a23_0x3193da[_0x2dfa69(0x186)](_0x2dfa69(0x194)));if(!profileExists(_0x37eeb5)){console[_0x2dfa69(0x180)](a23_0x3193da[_0x2dfa69(0x195)](_0x2dfa69(0x1b5)+_0x37eeb5+'\x27\x20does\x20not\x20exist.')),console['log'](_0x2dfa69(0x183));const _0x56cf98=listProfiles();if(_0x56cf98[_0x2dfa69(0x168)]===0x0)console[_0x2dfa69(0x196)](_0x2dfa69(0x1cb));else for(const _0x4683ff of _0x56cf98){console['log'](_0x2dfa69(0x1a2)+_0x4683ff[_0x2dfa69(0x17a)]);}return 0x1;}const _0x7d5af=await a23_0x144249({'type':_0x2dfa69(0x18a),'name':_0x2dfa69(0x18a),'message':_0x2dfa69(0x166)+_0x37eeb5+'\x27?','initial':![]});if(!_0x7d5af[_0x2dfa69(0x18a)])return console[_0x2dfa69(0x196)](_0x2dfa69(0x1be)),0x0;try{removeProfileFromUserConfig(_0x37eeb5),console[_0x2dfa69(0x196)](a23_0x3193da[_0x2dfa69(0x1aa)]('✓')+_0x2dfa69(0x1af)+_0x37eeb5+_0x2dfa69(0x1b1));}catch(_0x821c8b){return console[_0x2dfa69(0x180)](a23_0x3193da[_0x2dfa69(0x195)](_0x2dfa69(0x188)+(_0x821c8b instanceof Error?_0x821c8b[_0x2dfa69(0x1c4)]:String(_0x821c8b)))),0x1;}const _0x57b3bf=await isKeychainAvailable();if(_0x57b3bf){const _0x40faf6=await deleteKeychainAPIKey(_0x37eeb5);_0x40faf6&&console[_0x2dfa69(0x196)](a23_0x3193da[_0x2dfa69(0x1aa)]('✓')+_0x2dfa69(0x1bb));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x5400e5(0x17a)]=a23_0x5400e5(0x17b);[a23_0x5400e5(0x173)]=a23_0x5400e5(0x193);static [a23_0x5400e5(0x176)]=[a23_0x5400e5(0x19d),'database','parent_segment',a23_0x5400e5(0x167),a23_0x5400e5(0x1b9),'description'];[a23_0x5400e5(0x179)](_0x622d51){const _0xff066a=a23_0x5400e5,{args:_0x3a950,options:_0x236d1a}=_0x622d51,_0x23c2bd=_0x236d1a[_0xff066a(0x17e)]||getActiveProfile();if(!_0x23c2bd)return _0xff066a(0x19c);if(_0x3a950[_0xff066a(0x168)]===0x0)return _0xff066a(0x181)+ProfileSetCommand[_0xff066a(0x176)][_0xff066a(0x170)](',\x20');const _0x25344e=_0x3a950[0x0];if(!_0x25344e[_0xff066a(0x1a5)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand['VALID_KEYS']['join'](',\x20');const [_0x5277ce]=_0x25344e[_0xff066a(0x1c1)]('=',0x2);if(!ProfileSetCommand[_0xff066a(0x176)][_0xff066a(0x1a5)](_0x5277ce))return _0xff066a(0x1c0)+_0x5277ce+_0xff066a(0x1c7)+ProfileSetCommand['VALID_KEYS']['join'](',\x20');return undefined;}async[a23_0x5400e5(0x17d)](_0x34596d){const _0x4ca9d6=a23_0x5400e5,{args:_0x245765,options:_0x167f9c}=_0x34596d,_0x5238e0=_0x167f9c[_0x4ca9d6(0x17e)]||getActiveProfile(),[_0x240204,..._0x18dc40]=_0x245765[0x0][_0x4ca9d6(0x1c1)]('='),_0x3cc7bb=_0x18dc40[_0x4ca9d6(0x170)]('=');console['log'](a23_0x3193da[_0x4ca9d6(0x186)]('tdx:\x20profile\x20set'));if(!profileExists(_0x5238e0)){const _0x5c6890=await a23_0x144249({'type':'confirm','name':_0x4ca9d6(0x1b4),'message':_0x4ca9d6(0x1b5)+_0x5238e0+_0x4ca9d6(0x1ae),'initial':!![]});if(!_0x5c6890[_0x4ca9d6(0x1b4)])return console[_0x4ca9d6(0x196)](_0x4ca9d6(0x16a)),0x1;}const _0x2c8fab=loadProfile(_0x5238e0),_0x596ac0=_0x2c8fab?.[_0x4ca9d6(0x197)]||{};if(_0x240204===_0x4ca9d6(0x19d)){const _0x3760fe=resolveSite(_0x3cc7bb);console[_0x4ca9d6(0x196)]('Changing\x20site\x20to\x20\x27'+_0x3760fe+_0x4ca9d6(0x1ca)),console[_0x4ca9d6(0x196)](_0x4ca9d6(0x18d)),console[_0x4ca9d6(0x196)]('\x20\x20'+getConsoleUrl(_0x3760fe,_0x4ca9d6(0x19b)));const _0x3793d6=await a23_0x144249({'type':_0x4ca9d6(0x1a3),'name':_0x4ca9d6(0x1b6),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x1fc667=>{const _0x1eb86f=_0x4ca9d6;if(!_0x1fc667||!_0x1fc667['trim']())return _0x1eb86f(0x199);return!![];}});if(!_0x3793d6[_0x4ca9d6(0x1b6)])return console[_0x4ca9d6(0x196)](_0x4ca9d6(0x177)),0x1;console[_0x4ca9d6(0x196)]('Validating\x20API\x20key...');try{const _0x312581=TDX[_0x4ca9d6(0x1b4)]({'site':_0x3760fe,'apiKey':_0x3793d6[_0x4ca9d6(0x1b6)][_0x4ca9d6(0x1b2)](),'logLevel':_0x167f9c['logLevel']??LogLevel[_0x4ca9d6(0x16f)]}),_0x51127b=await _0x312581[_0x4ca9d6(0x171)][_0x4ca9d6(0x17c)]();console['log'](a23_0x3193da[_0x4ca9d6(0x1aa)]('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x51127b[_0x4ca9d6(0x1c5)]+')');const _0x119336=await isKeychainAvailable();_0x119336?(await saveAPIKeyAsync(_0x3793d6[_0x4ca9d6(0x1b6)][_0x4ca9d6(0x1b2)](),_0x3760fe,_0x5238e0),console[_0x4ca9d6(0x196)](a23_0x3193da[_0x4ca9d6(0x1aa)]('✓')+_0x4ca9d6(0x1a8))):console[_0x4ca9d6(0x184)](a23_0x3193da[_0x4ca9d6(0x1a4)](_0x4ca9d6(0x19e))),_0x596ac0['site']=_0x3760fe;}catch(_0x272d7f){if(_0x272d7f instanceof HTTPClientError&&_0x272d7f[_0x4ca9d6(0x175)]===0x191)return printAuthError(_0x272d7f),0x1;return console[_0x4ca9d6(0x180)](a23_0x3193da[_0x4ca9d6(0x195)](_0x4ca9d6(0x198)+(_0x272d7f instanceof Error?_0x272d7f[_0x4ca9d6(0x1c4)]:String(_0x272d7f)))),console[_0x4ca9d6(0x180)](_0x4ca9d6(0x182)),0x1;}}else _0x596ac0[_0x240204]=_0x3cc7bb||undefined;return saveProfileToUserConfig(_0x5238e0,_0x596ac0),console[_0x4ca9d6(0x196)](a23_0x3193da[_0x4ca9d6(0x1aa)]('✓')+'\x20Profile\x20\x27'+_0x5238e0+'\x27\x20updated:\x20'+_0x240204+'='+(_0x3cc7bb||_0x4ca9d6(0x17f))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a23_0x5400e5(0x17a)]=a23_0x5400e5(0x18c);[a23_0x5400e5(0x173)]=a23_0x5400e5(0x165);[a23_0x5400e5(0x179)](_0xe10810){const _0x299ee8=a23_0x5400e5,{args:_0x558b8f}=_0xe10810;if(_0x558b8f[_0x299ee8(0x168)]===0x0)return'Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]';return undefined;}async['execute'](_0x1cde41){const _0x2e0b24=a23_0x5400e5,{args:_0x3d8e56,options:_0x1c01b1}=_0x1cde41,_0x441cfe=_0x3d8e56[0x0],_0x5c4954=_0x1c01b1['default'];cleanExpiredSessions();if(!profileExists(_0x441cfe)){console[_0x2e0b24(0x180)](a23_0x3193da['red'](_0x2e0b24(0x1b5)+_0x441cfe+_0x2e0b24(0x16b))),console[_0x2e0b24(0x196)](_0x2e0b24(0x183));const _0xb3aae0=listProfiles();if(_0xb3aae0['length']===0x0)console[_0x2e0b24(0x196)](_0x2e0b24(0x1cb));else for(const _0x191787 of _0xb3aae0){console[_0x2e0b24(0x196)]('\x20\x20-\x20'+_0x191787[_0x2e0b24(0x17a)]);}return 0x1;}if(_0x5c4954){const _0x5e66fd=a23_0x42364d[_0x2e0b24(0x170)](getConfigDir(),_0x2e0b24(0x1a7));return saveActiveProfileToUserConfig(_0x441cfe),console['log']('Default\x20profile\x20set\x20to:\x20'+a23_0x3193da[_0x2e0b24(0x1aa)](_0x441cfe)),console['log'](a23_0x3193da[_0x2e0b24(0x1c6)]('\x0aSaved\x20to:\x20'+_0x5e66fd)),0x0;}const _0x9902bd=getSessionID(_0x1c01b1[_0x2e0b24(0x178)]);return saveSessionContext({'profile':_0x441cfe},_0x1c01b1[_0x2e0b24(0x178)]),console[_0x2e0b24(0x196)](_0x2e0b24(0x18b)+a23_0x3193da[_0x2e0b24(0x1aa)](_0x441cfe)+'\x20'+a23_0x3193da[_0x2e0b24(0x1c6)](_0x2e0b24(0x1c8)+_0x9902bd+')')),console['log'](a23_0x3193da['dim'](_0x2e0b24(0x172)+_0x441cfe+_0x2e0b24(0x1bd))),0x0;}}
1
+ const a23_0x64c92=a23_0x5d1b;(function(_0x402f60,_0x306c08){const _0x3999a4=a23_0x5d1b,_0x53a803=_0x402f60();while(!![]){try{const _0x527a8c=-parseInt(_0x3999a4(0x14f))/0x1+-parseInt(_0x3999a4(0x10d))/0x2+parseInt(_0x3999a4(0x120))/0x3*(-parseInt(_0x3999a4(0x121))/0x4)+-parseInt(_0x3999a4(0xf7))/0x5*(-parseInt(_0x3999a4(0xee))/0x6)+parseInt(_0x3999a4(0x144))/0x7+parseInt(_0x3999a4(0x117))/0x8*(parseInt(_0x3999a4(0x153))/0x9)+-parseInt(_0x3999a4(0x138))/0xa*(parseInt(_0x3999a4(0x113))/0xb);if(_0x527a8c===_0x306c08)break;else _0x53a803['push'](_0x53a803['shift']());}catch(_0xd48b57){_0x53a803['push'](_0x53a803['shift']());}}}(a23_0x41ab,0x83024));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import*as a23_0x236cb1 from'node:path';import{saveSessionContext,getSessionID,cleanExpiredSessions}from'../core/session.js';import{saveAPIKeyAsync,resolveSite}from'../core/config.js';import{getConsoleUrl}from'../sdk/client/endpoints.js';import{deleteKeychainAPIKey,isKeychainAvailable}from'../core/keychain.js';import{buildSiteChoices}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{TDX}from'../sdk/index.js';function a23_0x5d1b(_0x29899c,_0x3d6195){_0x29899c=_0x29899c-0xe4;const _0x41abf4=a23_0x41ab();let _0x5d1b04=_0x41abf4[_0x29899c];return _0x5d1b04;}function a23_0x41ab(){const _0x535e65=['\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','129LbkrDT','32484KCywAp','text','logLevel','dim','ERROR','tdx:\x20profile\x20create','log','\x20\x20-\x20','execute','Enter\x20your\x20TD\x20API\x20key:','Site\x20was\x20not\x20changed.','\x20API\x20key\x20saved\x20to\x20system\x20keychain','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','config','status','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','llm_project','profileName','select','tdx:\x20profile\x20set','database','name','129980UqTegR','\x0aAvailable\x20profiles:','red','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','message','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','site','warn','No\x20active\x20profile.\x20Use\x20--profile\x20flag\x20or\x20set\x20session\x20profile\x20with:\x20tdx\x20profile\x20use\x20<name>\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>','test','description','4367454iLNCRb','us01','create','Site\x20name\x20must\x20contain\x20only\x20lowercase\x20letters,\x20numbers,\x20and\x20hyphens','Enter\x20profile\x20name:','✗\x20Validation\x20failed:\x20','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','join','default','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','password','55302QkrjST','Profile\x20\x27','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','API\x20key\x20cannot\x20be\x20empty','4232997yghNRQ','Enter\x20description\x20(optional):','parent_segment','split','error','profile:use','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','profile:set','profile:remove','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','Remove\x20a\x20profile','222UHvhYU','confirm','\x0aSetup\x20cancelled','getUserInfo','Set\x20a\x20profile\x20configuration\x20value','green','length','\x20--default\x27\x20to\x20save\x20permanently','profile','109815vidXur','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','Set\x20session\x20profile','Select\x20Treasure\x20Data\x20site\x20for\x20profile\x20\x27','tdx.json','\x20\x20tdx\x20--profile\x20','\x20\x20(no\x20profiles\x20found)','Unknown\x20key\x20\x27','\x20API\x20key\x20is\x20valid\x20(User:\x20','validate','apiKey','Validating\x20API\x20key...','\x0aOperation\x20cancelled','(cleared)','(session:\x20','\x27\x20removed\x20from\x20configuration','\x27\x20requires\x20API\x20key\x20validation.','Operation\x20cancelled','VALID_KEYS','yellow','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','trim','553750SvxdBE','\x27.\x0a\x0aValid\x20keys:\x20','jobs','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Session\x20profile\x20set\x20to:\x20','profile:create','583dkONmu','session','email','tdx:\x20profile\x20remove','8wvFpwh','\x20Profile\x20\x27','bold','Removal\x20cancelled','includes','/app/mp/ak','customSite','\x27\x20created'];a23_0x41ab=function(){return _0x535e65;};return a23_0x41ab();}import{LogLevel}from'../utils/tdx-logger.js';import a23_0x5caf6b from'prompts';import a23_0x561b56 from'chalk';function validateProfileName(_0x34b118){const _0x21bb3e=a23_0x5d1b;if(!_0x34b118||!_0x34b118[_0x21bb3e(0x10c)]())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x413045=_0x34b118[_0x21bb3e(0x10c)]();if(!/^[a-zA-Z0-9_-]+$/[_0x21bb3e(0x142)](_0x413045))return _0x21bb3e(0x131);if(profileExists(_0x413045))return _0x21bb3e(0x150)+_0x413045+_0x21bb3e(0x12d);return!![];}export class ProfileCreateCommand extends BaseCommand{[a23_0x64c92(0x137)]=a23_0x64c92(0x112);['description']='Create\x20a\x20new\x20profile';async[a23_0x64c92(0x129)](_0x5dbde6){const _0xd746c7=a23_0x64c92,{options:_0x162a02,args:_0x1f25d8}=_0x5dbde6;console[_0xd746c7(0x127)](a23_0x561b56['bold'](_0xd746c7(0x126)));let _0x48d0b3;if(_0x1f25d8[_0xd746c7(0xf4)]>0x0&&_0x1f25d8[0x0]){const _0x1c7d07=_0x1f25d8[0x0]['trim'](),_0x38727b=validateProfileName(_0x1c7d07);if(_0x38727b!==!![])return console[_0xd746c7(0xe6)](a23_0x561b56['red'](_0x38727b)),0x1;_0x48d0b3=_0x1c7d07;}else{const _0x3d6341=await a23_0x5caf6b({'type':_0xd746c7(0x122),'name':_0xd746c7(0x133),'message':_0xd746c7(0x148),'validate':validateProfileName});if(!_0x3d6341[_0xd746c7(0x133)])return console['log'](_0xd746c7(0xf0)),0x1;_0x48d0b3=_0x3d6341[_0xd746c7(0x133)][_0xd746c7(0x10c)]();}const _0x407308=await a23_0x5caf6b({'type':'text','name':_0xd746c7(0x143),'message':_0xd746c7(0x154)}),_0x3ad2d6=_0x407308[_0xd746c7(0x143)]?.['trim']()||undefined,_0x111b41=_0x162a02['site']||'us01',{choices:_0x491858,initialIndex:_0x17c32e}=buildSiteChoices(_0x111b41),_0x31e399=await a23_0x5caf6b({'type':_0xd746c7(0x134),'name':'site','message':_0xd746c7(0xfa)+_0x48d0b3+'\x27:','choices':_0x491858,'initial':_0x17c32e});if(!_0x31e399[_0xd746c7(0x13f)])return console['log'](_0xd746c7(0xf0)),0x1;let _0x59f176;if(_0x31e399[_0xd746c7(0x13f)]==='other'){const _0xc374ee=await a23_0x5caf6b({'type':'text','name':_0xd746c7(0x11d),'message':'Enter\x20site\x20name:','initial':_0xd746c7(0x145),'validate':_0x17c9ce=>{const _0xa31a9=_0xd746c7;if(!_0x17c9ce||!_0x17c9ce[_0xa31a9(0x10c)]())return'Site\x20name\x20cannot\x20be\x20empty';if(!/^[a-z0-9-]+$/[_0xa31a9(0x142)](_0x17c9ce[_0xa31a9(0x10c)]()))return _0xa31a9(0x147);return!![];}});if(!_0xc374ee[_0xd746c7(0x11d)])return console[_0xd746c7(0x127)](_0xd746c7(0xf0)),0x1;_0x59f176=_0xc374ee['customSite'];}else _0x59f176=_0x31e399[_0xd746c7(0x13f)];const _0x4284e7=resolveSite(_0x59f176);console[_0xd746c7(0x127)](_0xd746c7(0x13b)+_0x4284e7),console['log']('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0xd746c7(0x127)]('\x20\x20'+getConsoleUrl(_0x4284e7,_0xd746c7(0x11c)));const _0x500260=await a23_0x5caf6b({'type':_0xd746c7(0x14e),'name':'apiKey','message':_0xd746c7(0x12a),'validate':_0x1e0fbb=>{const _0x50a953=_0xd746c7;if(!_0x1e0fbb||!_0x1e0fbb['trim']())return _0x50a953(0x152);return!![];}});if(!_0x500260[_0xd746c7(0x101)])return console['log'](_0xd746c7(0xf0)),0x1;const _0x40062e=_0x500260['apiKey'];console['log'](_0xd746c7(0x102));try{const _0x253c34=TDX[_0xd746c7(0x146)]({'site':_0x4284e7,'apiKey':_0x40062e[_0xd746c7(0x10c)](),'logLevel':_0x162a02[_0xd746c7(0x123)]??LogLevel[_0xd746c7(0x125)]}),_0x40a69c=await _0x253c34[_0xd746c7(0x10f)][_0xd746c7(0xf1)]();console[_0xd746c7(0x127)](a23_0x561b56['green']('✓')+'\x20API\x20key\x20is\x20valid\x20(User:\x20'+_0x40a69c[_0xd746c7(0x115)]+')');const _0x29a47a=await isKeychainAvailable();_0x29a47a?(await saveAPIKeyAsync(_0x40062e['trim'](),_0x4284e7,_0x48d0b3),console[_0xd746c7(0x127)](a23_0x561b56[_0xd746c7(0xf3)]('✓')+_0xd746c7(0x130)+_0x48d0b3+')')):(console[_0xd746c7(0x140)](a23_0x561b56[_0xd746c7(0x10a)](_0xd746c7(0x110))),console['warn'](a23_0x561b56[_0xd746c7(0x10a)](_0xd746c7(0xec))));const _0x40eb82={'site':_0x4284e7,..._0x3ad2d6&&{'description':_0x3ad2d6}};return saveProfileToUserConfig(_0x48d0b3,_0x40eb82),console[_0xd746c7(0x127)](a23_0x561b56[_0xd746c7(0xf3)]('✓')+_0xd746c7(0x118)+_0x48d0b3+_0xd746c7(0x11e)),console[_0xd746c7(0x127)](),console['log'](_0xd746c7(0xe8)),console[_0xd746c7(0x127)](_0xd746c7(0xfc)+_0x48d0b3+_0xd746c7(0x11f)),console[_0xd746c7(0x127)](_0xd746c7(0xfc)+_0x48d0b3+_0xd746c7(0x14a)),0x0;}catch(_0x115605){if(_0x115605 instanceof HTTPClientError&&_0x115605[_0xd746c7(0x12f)]===0x191)return printAuthError(_0x115605),0x1;return console['error'](a23_0x561b56[_0xd746c7(0x13a)](_0xd746c7(0x149)+(_0x115605 instanceof Error?_0x115605[_0xd746c7(0x13d)]:String(_0x115605)))),console[_0xd746c7(0xe6)](_0xd746c7(0x14d)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{['name']=a23_0x64c92(0xea);['description']=a23_0x64c92(0xed);[a23_0x64c92(0x100)](_0x44c8c2){const _0x52da22=a23_0x64c92,{args:_0x1c409f}=_0x44c8c2;if(_0x1c409f[_0x52da22(0xf4)]===0x0)return _0x52da22(0x151);return undefined;}async['execute'](_0x369279){const _0x2ce28f=a23_0x64c92,{args:_0x8eb593}=_0x369279,_0x33cce1=_0x8eb593[0x0];console['log'](a23_0x561b56[_0x2ce28f(0x119)](_0x2ce28f(0x116)));if(!profileExists(_0x33cce1)){console['error'](a23_0x561b56[_0x2ce28f(0x13a)](_0x2ce28f(0x150)+_0x33cce1+'\x27\x20does\x20not\x20exist.')),console[_0x2ce28f(0x127)]('\x0aAvailable\x20profiles:');const _0x4d2acf=listProfiles();if(_0x4d2acf[_0x2ce28f(0xf4)]===0x0)console[_0x2ce28f(0x127)](_0x2ce28f(0xfd));else for(const _0x3f4c6e of _0x4d2acf){console['log'](_0x2ce28f(0x128)+_0x3f4c6e[_0x2ce28f(0x137)]);}return 0x1;}const _0x4e92fd=await a23_0x5caf6b({'type':_0x2ce28f(0xef),'name':_0x2ce28f(0xef),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x33cce1+'\x27?','initial':![]});if(!_0x4e92fd[_0x2ce28f(0xef)])return console[_0x2ce28f(0x127)](_0x2ce28f(0x11a)),0x0;try{removeProfileFromUserConfig(_0x33cce1),console[_0x2ce28f(0x127)](a23_0x561b56[_0x2ce28f(0xf3)]('✓')+_0x2ce28f(0x118)+_0x33cce1+_0x2ce28f(0x106));}catch(_0x307ed4){return console[_0x2ce28f(0xe6)](a23_0x561b56['red']('Failed\x20to\x20remove\x20profile:\x20'+(_0x307ed4 instanceof Error?_0x307ed4[_0x2ce28f(0x13d)]:String(_0x307ed4)))),0x1;}const _0x390e63=await isKeychainAvailable();if(_0x390e63){const _0x3853bd=await deleteKeychainAPIKey(_0x33cce1);_0x3853bd&&console['log'](a23_0x561b56[_0x2ce28f(0xf3)]('✓')+'\x20API\x20key\x20removed\x20from\x20system\x20keychain');}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a23_0x64c92(0x137)]=a23_0x64c92(0xe9);[a23_0x64c92(0x143)]=a23_0x64c92(0xf2);static ['VALID_KEYS']=['site',a23_0x64c92(0x136),a23_0x64c92(0xe4),a23_0x64c92(0x132),'llm_agent',a23_0x64c92(0x143)];['validate'](_0x26640a){const _0x227eda=a23_0x64c92,{args:_0x45b084,options:_0x52efd6}=_0x26640a,_0x574f01=_0x52efd6[_0x227eda(0xf6)]||getActiveProfile();if(!_0x574f01)return _0x227eda(0x141);if(_0x45b084[_0x227eda(0xf4)]===0x0)return _0x227eda(0x13e)+ProfileSetCommand[_0x227eda(0x109)][_0x227eda(0x14b)](',\x20');const _0x361c00=_0x45b084[0x0];if(!_0x361c00[_0x227eda(0x11b)]('='))return'Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0x227eda(0x109)][_0x227eda(0x14b)](',\x20');const [_0x4a329b]=_0x361c00[_0x227eda(0xe5)]('=',0x2);if(!ProfileSetCommand[_0x227eda(0x109)]['includes'](_0x4a329b))return _0x227eda(0xfe)+_0x4a329b+_0x227eda(0x10e)+ProfileSetCommand[_0x227eda(0x109)][_0x227eda(0x14b)](',\x20');return undefined;}async[a23_0x64c92(0x129)](_0x1a036d){const _0x3bc8da=a23_0x64c92,{args:_0x2aab7e,options:_0xc4f0c}=_0x1a036d,_0x50579b=_0xc4f0c[_0x3bc8da(0xf6)]||getActiveProfile(),[_0x2722be,..._0x13997e]=_0x2aab7e[0x0][_0x3bc8da(0xe5)]('='),_0x19543b=_0x13997e[_0x3bc8da(0x14b)]('=');console[_0x3bc8da(0x127)](a23_0x561b56[_0x3bc8da(0x119)](_0x3bc8da(0x135)));if(!profileExists(_0x50579b)){const _0x1f525e=await a23_0x5caf6b({'type':_0x3bc8da(0xef),'name':_0x3bc8da(0x146),'message':'Profile\x20\x27'+_0x50579b+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x1f525e[_0x3bc8da(0x146)])return console[_0x3bc8da(0x127)](_0x3bc8da(0x108)),0x1;}const _0x7db20f=loadProfile(_0x50579b),_0x39cd95=_0x7db20f?.[_0x3bc8da(0x12e)]||{};if(_0x2722be===_0x3bc8da(0x13f)){const _0x516519=resolveSite(_0x19543b);console['log']('Changing\x20site\x20to\x20\x27'+_0x516519+_0x3bc8da(0x107)),console[_0x3bc8da(0x127)](_0x3bc8da(0xeb)),console[_0x3bc8da(0x127)]('\x20\x20'+getConsoleUrl(_0x516519,_0x3bc8da(0x11c)));const _0x13e410=await a23_0x5caf6b({'type':_0x3bc8da(0x14e),'name':_0x3bc8da(0x101),'message':_0x3bc8da(0x10b),'validate':_0x2efddd=>{const _0x1093ee=_0x3bc8da;if(!_0x2efddd||!_0x2efddd[_0x1093ee(0x10c)]())return _0x1093ee(0x152);return!![];}});if(!_0x13e410['apiKey'])return console[_0x3bc8da(0x127)](_0x3bc8da(0x103)),0x1;console[_0x3bc8da(0x127)](_0x3bc8da(0x102));try{const _0x37f8d4=TDX['create']({'site':_0x516519,'apiKey':_0x13e410[_0x3bc8da(0x101)]['trim'](),'logLevel':_0xc4f0c[_0x3bc8da(0x123)]??LogLevel[_0x3bc8da(0x125)]}),_0x219efc=await _0x37f8d4['jobs'][_0x3bc8da(0xf1)]();console[_0x3bc8da(0x127)](a23_0x561b56[_0x3bc8da(0xf3)]('✓')+_0x3bc8da(0xff)+_0x219efc[_0x3bc8da(0x115)]+')');const _0x103635=await isKeychainAvailable();_0x103635?(await saveAPIKeyAsync(_0x13e410['apiKey'][_0x3bc8da(0x10c)](),_0x516519,_0x50579b),console[_0x3bc8da(0x127)](a23_0x561b56['green']('✓')+_0x3bc8da(0x12c))):console[_0x3bc8da(0x140)](a23_0x561b56[_0x3bc8da(0x10a)]('⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.')),_0x39cd95[_0x3bc8da(0x13f)]=_0x516519;}catch(_0x33b0ec){if(_0x33b0ec instanceof HTTPClientError&&_0x33b0ec[_0x3bc8da(0x12f)]===0x191)return printAuthError(_0x33b0ec),0x1;return console[_0x3bc8da(0xe6)](a23_0x561b56['red'](_0x3bc8da(0x149)+(_0x33b0ec instanceof Error?_0x33b0ec[_0x3bc8da(0x13d)]:String(_0x33b0ec)))),console['error'](_0x3bc8da(0x12b)),0x1;}}else _0x39cd95[_0x2722be]=_0x19543b||undefined;return saveProfileToUserConfig(_0x50579b,_0x39cd95),console[_0x3bc8da(0x127)](a23_0x561b56[_0x3bc8da(0xf3)]('✓')+_0x3bc8da(0x118)+_0x50579b+'\x27\x20updated:\x20'+_0x2722be+'='+(_0x19543b||_0x3bc8da(0x104))),0x0;}}export class ProfileUseCommand extends BaseCommand{[a23_0x64c92(0x137)]=a23_0x64c92(0xe7);[a23_0x64c92(0x143)]=a23_0x64c92(0xf9);['validate'](_0x1a5393){const _0x20a683=a23_0x64c92,{args:_0x23ec01}=_0x1a5393;if(_0x23ec01[_0x20a683(0xf4)]===0x0)return _0x20a683(0x13c);return undefined;}async[a23_0x64c92(0x129)](_0x55dfdc){const _0x54b7ce=a23_0x64c92,{args:_0x5a42e9,options:_0x5944e6}=_0x55dfdc,_0x1f8a94=_0x5a42e9[0x0],_0x3bfc90=_0x5944e6[_0x54b7ce(0x14c)];cleanExpiredSessions();if(!profileExists(_0x1f8a94)){console[_0x54b7ce(0xe6)](a23_0x561b56['red'](_0x54b7ce(0x150)+_0x1f8a94+'\x27\x20does\x20not\x20exist.')),console['log'](_0x54b7ce(0x139));const _0x13f772=listProfiles();if(_0x13f772[_0x54b7ce(0xf4)]===0x0)console['log'](_0x54b7ce(0xfd));else for(const _0x4adfe6 of _0x13f772){console[_0x54b7ce(0x127)](_0x54b7ce(0x128)+_0x4adfe6[_0x54b7ce(0x137)]);}return 0x1;}if(_0x3bfc90){const _0x4bb55b=a23_0x236cb1[_0x54b7ce(0x14b)](getConfigDir(),_0x54b7ce(0xfb));return saveActiveProfileToUserConfig(_0x1f8a94),console[_0x54b7ce(0x127)]('Default\x20profile\x20set\x20to:\x20'+a23_0x561b56[_0x54b7ce(0xf3)](_0x1f8a94)),console[_0x54b7ce(0x127)](a23_0x561b56['dim']('\x0aSaved\x20to:\x20'+_0x4bb55b)),0x0;}const _0x178f1e=getSessionID(_0x5944e6['session']);return saveSessionContext({'profile':_0x1f8a94},_0x5944e6[_0x54b7ce(0x114)]),console['log'](_0x54b7ce(0x111)+a23_0x561b56[_0x54b7ce(0xf3)](_0x1f8a94)+'\x20'+a23_0x561b56[_0x54b7ce(0x124)](_0x54b7ce(0x105)+_0x178f1e+')')),console[_0x54b7ce(0x127)](a23_0x561b56[_0x54b7ce(0x124)](_0x54b7ce(0xf8)+_0x1f8a94+_0x54b7ce(0xf5))),0x0;}}
@@ -1 +1 @@
1
- function a24_0x5e96(_0x3c68d1,_0xa65d89){_0x3c68d1=_0x3c68d1-0x11e;const _0x3a0f66=a24_0x3a0f();let _0x5e969d=_0x3a0f66[_0x3c68d1];return _0x5e969d;}const a24_0x59bea7=a24_0x5e96;(function(_0x6685f7,_0x2b2b6d){const _0x191ee9=a24_0x5e96,_0xf362e6=_0x6685f7();while(!![]){try{const _0x4124b6=parseInt(_0x191ee9(0x134))/0x1*(-parseInt(_0x191ee9(0x122))/0x2)+parseInt(_0x191ee9(0x133))/0x3*(parseInt(_0x191ee9(0x12a))/0x4)+parseInt(_0x191ee9(0x12c))/0x5+parseInt(_0x191ee9(0x127))/0x6+-parseInt(_0x191ee9(0x12b))/0x7*(parseInt(_0x191ee9(0x12f))/0x8)+parseInt(_0x191ee9(0x125))/0x9+-parseInt(_0x191ee9(0x126))/0xa*(parseInt(_0x191ee9(0x11e))/0xb);if(_0x4124b6===_0x2b2b6d)break;else _0xf362e6['push'](_0xf362e6['shift']());}catch(_0x2d3350){_0xf362e6['push'](_0xf362e6['shift']());}}}(a24_0x3a0f,0x7fbab));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{['name']=a24_0x59bea7(0x124);[a24_0x59bea7(0x12e)]='List\x20all\x20available\x20profiles';async[a24_0x59bea7(0x120)](_0x1ebba3){const _0x572e98=a24_0x59bea7,{options:_0x550463}=_0x1ebba3;try{const _0x497b1f=listProfiles(),_0x500cb7=getActiveProfile();if(_0x497b1f['length']===0x0)return console[_0x572e98(0x11f)](_0x572e98(0x129)),console[_0x572e98(0x11f)]('\x20\x20Local:\x20\x20(project\x20folder)/tdx.json'),console[_0x572e98(0x11f)](_0x572e98(0x131)),0x0;const _0x20cef9=_0x497b1f[_0x572e98(0x128)](_0x35961d=>{const _0x52f259=_0x572e98,_0x268b8f=_0x35961d[_0x52f259(0x135)]===_0x500cb7,_0x9000c5=getProfileParams(_0x35961d[_0x52f259(0x123)]);return{'name':_0x35961d['name'],'active':_0x268b8f,'scope':_0x35961d[_0x52f259(0x12d)],'description':_0x35961d['config'][_0x52f259(0x12e)]||'','params':_0x9000c5};});return await handleSDKOutput(_0x20cef9,_0x550463),0x0;}catch(_0x294e75){return _0x294e75 instanceof Error&&console[_0x572e98(0x130)](_0x572e98(0x132)+_0x294e75[_0x572e98(0x121)]),0x1;}}}function a24_0x3a0f(){const _0x2524e1=['profiles','7356762zMEzuz','100790AmpWMO','5189766NAwCZf','map','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','424XjaXFE','6083cjybUL','1936745MFIhHP','scope','description','3496XdtzHf','error','\x20\x20Global:\x20~/.config/tdx/tdx.json','Error:\x20','9711RCkdoR','298msJDwE','name','814DHAETI','log','execute','message','5128QNZxCD','config'];a24_0x3a0f=function(){return _0x2524e1;};return a24_0x3a0f();}
1
+ const a24_0x7d51d7=a24_0x482b;function a24_0x482b(_0x4ddd7e,_0x214e55){_0x4ddd7e=_0x4ddd7e-0x153;const _0x3837c0=a24_0x3837();let _0x482b8a=_0x3837c0[_0x4ddd7e];return _0x482b8a;}(function(_0x28cf08,_0x56c660){const _0x4a6dec=a24_0x482b,_0x1eedb1=_0x28cf08();while(!![]){try{const _0x227a40=-parseInt(_0x4a6dec(0x169))/0x1*(-parseInt(_0x4a6dec(0x167))/0x2)+parseInt(_0x4a6dec(0x15f))/0x3+parseInt(_0x4a6dec(0x16a))/0x4*(parseInt(_0x4a6dec(0x164))/0x5)+-parseInt(_0x4a6dec(0x163))/0x6+parseInt(_0x4a6dec(0x161))/0x7*(-parseInt(_0x4a6dec(0x16b))/0x8)+-parseInt(_0x4a6dec(0x15a))/0x9*(-parseInt(_0x4a6dec(0x165))/0xa)+-parseInt(_0x4a6dec(0x15c))/0xb;if(_0x227a40===_0x56c660)break;else _0x1eedb1['push'](_0x1eedb1['shift']());}catch(_0x20f1d2){_0x1eedb1['push'](_0x1eedb1['shift']());}}}(a24_0x3837,0x4cd8f));import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput}from'../core/command-output.js';export class ProfilesCommand extends BaseCommand{[a24_0x7d51d7(0x168)]=a24_0x7d51d7(0x158);['description']=a24_0x7d51d7(0x155);async[a24_0x7d51d7(0x159)](_0x5730dd){const _0x420e59=a24_0x7d51d7,{options:_0x5362a8}=_0x5730dd;try{const _0x34feb4=listProfiles(),_0xe94500=getActiveProfile();if(_0x34feb4[_0x420e59(0x15e)]===0x0)return console['log'](_0x420e59(0x153)),console[_0x420e59(0x154)](_0x420e59(0x15d)),console[_0x420e59(0x154)](_0x420e59(0x166)),0x0;const _0x54aef2=_0x34feb4[_0x420e59(0x162)](_0x4da78c=>{const _0x358664=_0x420e59,_0x32ba98=_0x4da78c[_0x358664(0x168)]===_0xe94500,_0x402c98=getProfileParams(_0x4da78c[_0x358664(0x15b)]);return{'name':_0x4da78c['name'],'active':_0x32ba98,'scope':_0x4da78c[_0x358664(0x156)],'description':_0x4da78c[_0x358664(0x15b)][_0x358664(0x157)]||'','params':_0x402c98};});return await handleSDKOutput(_0x54aef2,_0x5362a8),0x0;}catch(_0x1cc758){return _0x1cc758 instanceof Error&&console[_0x420e59(0x160)]('Error:\x20'+_0x1cc758['message']),0x1;}}}function a24_0x3837(){const _0x4358a3=['729570HRhafd','\x20\x20Global:\x20~/.config/tdx/tdx.json','122RvGEqs','name','7528DIhkOY','237288PJwchh','112WKtupk','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','log','List\x20all\x20available\x20profiles','scope','description','profiles','execute','9IuDptq','config','6980325hNwMiU','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','length','1342857WcxhYk','error','204729dBPgpr','map','573360cNawsW','40ioVKsI'];a24_0x3837=function(){return _0x4358a3;};return a24_0x3837();}
@@ -1 +1 @@
1
- function a25_0x5011(){const _0x56b113=['Executing\x20query...','182824SlKTCr','Site:\x20','validate','30LwkZes','...','length','join','1928136bBgfBo','2792toczin','488tqCnQi','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','verbose','\x20splits','information_schema','totalSplits','state','7170570wpNErJ','Error:\x20','Statement\x20','setExtra','Executing\x20statement\x20','originalMessage','Schema:\x20','file','args','jobId','84066GBsjtA','name','Catalog:\x20','output','Executing\x20query\x20[','elapsedTimeMillis','28083STorvq','execute','Query\x20completed:\x20Processed\x20','Run\x20Trino\x20queries\x20(streaming)','query','setJobId','826880ZJimgL','processedRows','No\x20SQL\x20provided','7LbPqby','30348DWAPgG','\x20-\x20','message','data','error','options','push','in\x20'];a25_0x5011=function(){return _0x56b113;};return a25_0x5011();}const a25_0x59264a=a25_0x5e7c;function a25_0x5e7c(_0x572861,_0x4164aa){_0x572861=_0x572861-0x1e9;const _0x50119d=a25_0x5011();let _0x5e7ccb=_0x50119d[_0x572861];return _0x5e7ccb;}(function(_0x102a2a,_0x45f98e){const _0x4aa86d=a25_0x5e7c,_0x1b2738=_0x102a2a();while(!![]){try{const _0x5c38d5=parseInt(_0x4aa86d(0x20d))/0x1+parseInt(_0x4aa86d(0x214))/0x2+parseInt(_0x4aa86d(0x1fa))/0x3*(-parseInt(_0x4aa86d(0x216))/0x4)+-parseInt(_0x4aa86d(0x200))/0x5+parseInt(_0x4aa86d(0x1f4))/0x6*(-parseInt(_0x4aa86d(0x203))/0x7)+-parseInt(_0x4aa86d(0x215))/0x8*(parseInt(_0x4aa86d(0x204))/0x9)+parseInt(_0x4aa86d(0x210))/0xa*(parseInt(_0x4aa86d(0x1ea))/0xb);if(_0x5c38d5===_0x45f98e)break;else _0x1b2738['push'](_0x1b2738['shift']());}catch(_0x50183a){_0x1b2738['push'](_0x1b2738['shift']());}}}(a25_0x5011,0x93855));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a25_0x59264a(0x1f5)]='query';['description']=a25_0x59264a(0x1fd);async[a25_0x59264a(0x1fb)](_0x351703){const _0x728584=a25_0x59264a,{options:_0x39a3ec,args:_0x19e7c6,tdx:_0xd09c3b}=_0x351703,_0x1d81ff=_0x19e7c6[0x0],_0x127e18=_0x39a3ec[_0x728584(0x1f1)];let _0x22f000;try{if(_0x127e18)_0x22f000=readSqlStatementsFromFile(_0x127e18);else{if(_0x1d81ff==='-')_0x22f000=await readSqlStatementsFromStdin();else{if(_0x1d81ff&&isSqlFilePath(_0x1d81ff))_0x22f000=readSqlStatementsFromFile(_0x1d81ff);else{if(_0x1d81ff)_0x22f000=splitSqlStatements(_0x1d81ff);else throw new Error(_0x728584(0x202));}}}}catch(_0x19e664){return console['error'](_0x728584(0x1eb)+_0x19e664[_0x728584(0x206)]),0x1;}const _0x27ae16=_0x39a3ec['database']||_0x728584(0x21a),_0x279dc4=_0x39a3ec['catalog'];try{const _0x4dba24=[],_0x4b25ae=!!_0x39a3ec['output'];for(let _0x2cadaf=0x0;_0x2cadaf<_0x22f000[_0x728584(0x212)];_0x2cadaf++){const _0xd2eb4e=_0x22f000[_0x2cadaf],_0x5b621d=_0x2cadaf+0x1,_0x50b500=_0x22f000[_0x728584(0x212)],_0x532582=_0x50b500>0x1;_0x39a3ec[_0x728584(0x218)]&&(console[_0x728584(0x208)]('\x0a'+(_0x532582?_0x728584(0x1ec)+_0x5b621d+'/'+_0x50b500+':':'')),console['error'](_0x728584(0x20e)+_0x39a3ec['site']),console['error'](_0x728584(0x1f6)+(_0x279dc4||'td')),console[_0x728584(0x208)](_0x728584(0x1f0)+_0x27ae16),console[_0x728584(0x208)]('SQL:\x20'+_0xd2eb4e));const _0x1ab618=_0x532582?_0x728584(0x1ee)+_0x5b621d+'/'+_0x50b500+_0x728584(0x211):_0x728584(0x20c);try{const _0x1b17f0=await withProgressSpinner(_0x1ab618,async _0x3007ae=>{const _0x49cc11=_0x728584,_0x19849b=await _0xd09c3b[_0x49cc11(0x1fe)][_0x49cc11(0x1fb)](_0xd2eb4e,{'catalog':_0x279dc4,'schema':_0x27ae16,'onJobId':_0x13bd9f=>{const _0x49ae65=_0x49cc11;_0x3007ae[_0x49ae65(0x1ff)](_0x13bd9f);},'onProgress':_0x40efc1=>{const _0x475e33=_0x49cc11;_0x3007ae['setPhase'](_0x475e33(0x1f8)+_0x40efc1[_0x475e33(0x1e9)]+']'),_0x3007ae[_0x475e33(0x1ed)](formatRows(_0x40efc1[_0x475e33(0x201)])+'\x20rows\x20'+_0x40efc1['completedSplits']+'/'+_0x40efc1[_0x475e33(0x21b)]+_0x475e33(0x219));}});return _0x19849b;},{'verbose':_0x39a3ec[_0x728584(0x218)]}),_0x1db5e3=_0x1b17f0[_0x728584(0x207)],_0x2d845c=_0x1db5e3[_0x728584(0x1f3)]?'\x20[Job\x20ID:\x20'+_0x1db5e3[_0x728584(0x1f3)]+']':'',_0x3a0aa3=_0x532582?_0x728584(0x1ec)+_0x5b621d+'/'+_0x50b500+_0x728584(0x205):'';console[_0x728584(0x208)]('✔\x20'+_0x3a0aa3+_0x728584(0x1fc)+formatRows(_0x1db5e3['stats']['processedRows'])+'\x20rows\x20'+(_0x728584(0x20b)+formatElapsed(_0x1db5e3['stats'][_0x728584(0x1f9)])+_0x2d845c));if(_0x532582&&_0x4b25ae){const _0x1bdc6f=resolveOutputOptions(_0x39a3ec),_0x3ff7d2=await formatQueryOutput(_0x1db5e3,_0x1bdc6f);_0x4dba24[_0x728584(0x20a)](_0x3ff7d2);}else await handleQueryOutput(_0x1db5e3,_0x39a3ec);}catch(_0x25f512){const _0x1353da=_0x532582?_0x728584(0x1ec)+_0x5b621d+'/'+_0x50b500+':\x0a':'',_0xfb3782=_0x25f512 instanceof SDKError?_0x25f512[_0x728584(0x1ef)]:_0x25f512[_0x728584(0x206)];return console[_0x728584(0x208)](''+_0x1353da+_0xfb3782),0x1;}}if(_0x22f000['length']>0x1&&_0x4b25ae&&_0x4dba24['length']>0x0){const _0x19919e=_0x4dba24[_0x728584(0x213)]('\x0a');writeFileSync(_0x39a3ec[_0x728584(0x1f7)],_0x19919e),console[_0x728584(0x208)]('\x0aAll\x20results\x20saved\x20to\x20'+_0x39a3ec[_0x728584(0x1f7)]);}return 0x0;}catch(_0x206627){throw _0x206627;}}[a25_0x59264a(0x20f)](_0x493398){const _0x747375=a25_0x59264a,_0x5e43ae=_0x493398[_0x747375(0x1f2)][0x0],_0x5d8fda=_0x493398[_0x747375(0x209)][_0x747375(0x1f1)];if(!_0x5e43ae&&!_0x5d8fda)return'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';if(_0x5e43ae&&_0x5d8fda)return _0x747375(0x217);return undefined;}}
1
+ const a25_0x36ed8a=a25_0x29b7;function a25_0x29b7(_0x47eea3,_0xd94101){_0x47eea3=_0x47eea3-0xec;const _0xed797c=a25_0xed79();let _0x29b721=_0xed797c[_0x47eea3];return _0x29b721;}(function(_0x23a6a6,_0x4b07e0){const _0x39102a=a25_0x29b7,_0x17979f=_0x23a6a6();while(!![]){try{const _0x588e39=-parseInt(_0x39102a(0x11a))/0x1*(-parseInt(_0x39102a(0xf9))/0x2)+-parseInt(_0x39102a(0x117))/0x3+-parseInt(_0x39102a(0x11f))/0x4*(parseInt(_0x39102a(0x10e))/0x5)+-parseInt(_0x39102a(0xfd))/0x6+parseInt(_0x39102a(0xf8))/0x7+-parseInt(_0x39102a(0x10c))/0x8*(parseInt(_0x39102a(0xed))/0x9)+parseInt(_0x39102a(0xf2))/0xa;if(_0x588e39===_0x4b07e0)break;else _0x17979f['push'](_0x17979f['shift']());}catch(_0x14c5f3){_0x17979f['push'](_0x17979f['shift']());}}}(a25_0xed79,0x84d32));function a25_0xed79(){const _0x3f25aa=['53090mfwEMZ','processedRows','length','completedSplits','setExtra','elapsedTimeMillis','push','query','in\x20','2650266QWKAZL','verbose','SQL:\x20','16xXNYJm','No\x20SQL\x20provided','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','validate','jobId','404eWWqkj','Schema:\x20','54qWXBCV','originalMessage','Query\x20completed:\x20Processed\x20','stats','data','33275630ObVkTE','\x0aAll\x20results\x20saved\x20to\x20','...','Error:\x20','args','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','1677739yliaOZ','37024fpzSEa','Catalog:\x20','totalSplits','Executing\x20query...','1855728UKlGRg','error','description','file','output','Run\x20Trino\x20queries\x20(streaming)','Executing\x20statement\x20','message','database','catalog','setPhase','\x20rows\x20','\x20[Job\x20ID:\x20','Statement\x20','execute','1405672TMogSO','Executing\x20query\x20['];a25_0xed79=function(){return _0x3f25aa;};return a25_0xed79();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{['name']=a25_0x36ed8a(0x115);[a25_0x36ed8a(0xff)]=a25_0x36ed8a(0x102);async[a25_0x36ed8a(0x10b)](_0x21e5b4){const _0x23a95b=a25_0x36ed8a,{options:_0x51e405,args:_0x358c99,tdx:_0x1d19a0}=_0x21e5b4,_0x2179e8=_0x358c99[0x0],_0x4b8891=_0x51e405['file'];let _0x35812b;try{if(_0x4b8891)_0x35812b=readSqlStatementsFromFile(_0x4b8891);else{if(_0x2179e8==='-')_0x35812b=await readSqlStatementsFromStdin();else{if(_0x2179e8&&isSqlFilePath(_0x2179e8))_0x35812b=readSqlStatementsFromFile(_0x2179e8);else{if(_0x2179e8)_0x35812b=splitSqlStatements(_0x2179e8);else throw new Error(_0x23a95b(0x11b));}}}}catch(_0x554191){return console['error'](_0x23a95b(0xf5)+_0x554191[_0x23a95b(0x104)]),0x1;}const _0x216d2d=_0x51e405[_0x23a95b(0x105)]||'information_schema',_0x17b1d4=_0x51e405[_0x23a95b(0x106)];try{const _0x46258d=[],_0x17a13d=!!_0x51e405[_0x23a95b(0x101)];for(let _0x4bafa7=0x0;_0x4bafa7<_0x35812b['length'];_0x4bafa7++){const _0x4c5f1c=_0x35812b[_0x4bafa7],_0x39b786=_0x4bafa7+0x1,_0x45a18b=_0x35812b[_0x23a95b(0x110)],_0x1a6b62=_0x45a18b>0x1;_0x51e405[_0x23a95b(0x118)]&&(console['error']('\x0a'+(_0x1a6b62?_0x23a95b(0x10a)+_0x39b786+'/'+_0x45a18b+':':'')),console[_0x23a95b(0xfe)]('Site:\x20'+_0x51e405['site']),console[_0x23a95b(0xfe)](_0x23a95b(0xfa)+(_0x17b1d4||'td')),console[_0x23a95b(0xfe)](_0x23a95b(0xec)+_0x216d2d),console[_0x23a95b(0xfe)](_0x23a95b(0x119)+_0x4c5f1c));const _0x381883=_0x1a6b62?_0x23a95b(0x103)+_0x39b786+'/'+_0x45a18b+_0x23a95b(0xf4):_0x23a95b(0xfc);try{const _0x50bb3a=await withProgressSpinner(_0x381883,async _0x381270=>{const _0xf88e9b=_0x23a95b,_0x365f3d=await _0x1d19a0[_0xf88e9b(0x115)][_0xf88e9b(0x10b)](_0x4c5f1c,{'catalog':_0x17b1d4,'schema':_0x216d2d,'onJobId':_0x191c5f=>{_0x381270['setJobId'](_0x191c5f);},'onProgress':_0x4ffa38=>{const _0x3ecca2=_0xf88e9b;_0x381270[_0x3ecca2(0x107)](_0x3ecca2(0x10d)+_0x4ffa38['state']+']'),_0x381270[_0x3ecca2(0x112)](formatRows(_0x4ffa38[_0x3ecca2(0x10f)])+'\x20rows\x20'+_0x4ffa38[_0x3ecca2(0x111)]+'/'+_0x4ffa38[_0x3ecca2(0xfb)]+'\x20splits');}});return _0x365f3d;},{'verbose':_0x51e405[_0x23a95b(0x118)]}),_0x333798=_0x50bb3a[_0x23a95b(0xf1)],_0x55c390=_0x333798['jobId']?_0x23a95b(0x109)+_0x333798[_0x23a95b(0x11e)]+']':'',_0x34a725=_0x1a6b62?_0x23a95b(0x10a)+_0x39b786+'/'+_0x45a18b+'\x20-\x20':'';console[_0x23a95b(0xfe)]('✔\x20'+_0x34a725+_0x23a95b(0xef)+formatRows(_0x333798['stats'][_0x23a95b(0x10f)])+_0x23a95b(0x108)+(_0x23a95b(0x116)+formatElapsed(_0x333798[_0x23a95b(0xf0)][_0x23a95b(0x113)])+_0x55c390));if(_0x1a6b62&&_0x17a13d){const _0x45c197=resolveOutputOptions(_0x51e405),_0x523552=await formatQueryOutput(_0x333798,_0x45c197);_0x46258d[_0x23a95b(0x114)](_0x523552);}else await handleQueryOutput(_0x333798,_0x51e405);}catch(_0x7e80c6){const _0x534778=_0x1a6b62?_0x23a95b(0x10a)+_0x39b786+'/'+_0x45a18b+':\x0a':'',_0x3a4aac=_0x7e80c6 instanceof SDKError?_0x7e80c6[_0x23a95b(0xee)]:_0x7e80c6[_0x23a95b(0x104)];return console['error'](''+_0x534778+_0x3a4aac),0x1;}}if(_0x35812b['length']>0x1&&_0x17a13d&&_0x46258d[_0x23a95b(0x110)]>0x0){const _0x578972=_0x46258d['join']('\x0a');writeFileSync(_0x51e405[_0x23a95b(0x101)],_0x578972),console[_0x23a95b(0xfe)](_0x23a95b(0xf3)+_0x51e405[_0x23a95b(0x101)]);}return 0x0;}catch(_0x3f5888){throw _0x3f5888;}}[a25_0x36ed8a(0x11d)](_0x1b9ba8){const _0x39cb05=a25_0x36ed8a,_0x53d25e=_0x1b9ba8[_0x39cb05(0xf6)][0x0],_0x323790=_0x1b9ba8['options'][_0x39cb05(0x100)];if(!_0x53d25e&&!_0x323790)return _0x39cb05(0x11c);if(_0x53d25e&&_0x323790)return _0x39cb05(0xf7);return undefined;}}