@treasuredata/tdx 2026.3.21 → 2026.3.22

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 (203) 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/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.js +1 -1
  156. package/dist/sdk/types/index.js +1 -1
  157. package/dist/sdk/types/progress.js +1 -1
  158. package/dist/sdk/user.js +1 -1
  159. package/dist/sdk/util/format-detector.js +1 -1
  160. package/dist/sdk/util/formatters.js +1 -1
  161. package/dist/sdk/util/index.js +1 -1
  162. package/dist/sdk/util/paginate.js +1 -1
  163. package/dist/sdk/util/tree-formatter.js +1 -1
  164. package/dist/sdk/workflow/archive-validation.js +1 -1
  165. package/dist/sdk/workflow/clone-workflow.js +1 -1
  166. package/dist/sdk/workflow/index.js +1 -1
  167. package/dist/sdk/workflow/pull-workflow.js +1 -1
  168. package/dist/sdk/workflow/push-workflow.js +1 -1
  169. package/dist/sdk/workflow/tdx-config.js +1 -1
  170. package/dist/sdk/workflow/workflow-utils.js +1 -1
  171. package/dist/test-utils/command-runner.js +1 -1
  172. package/dist/test-utils/factories.js +1 -1
  173. package/dist/test-utils/fixtures.js +1 -1
  174. package/dist/test-utils/http-mock.js +1 -1
  175. package/dist/test-utils/index.js +1 -1
  176. package/dist/utils/async.js +1 -1
  177. package/dist/utils/colors.js +1 -1
  178. package/dist/utils/diff.js +1 -1
  179. package/dist/utils/file-permissions.js +1 -1
  180. package/dist/utils/file-reader.js +1 -1
  181. package/dist/utils/github-releases.js +1 -1
  182. package/dist/utils/global-cache.js +1 -1
  183. package/dist/utils/json-loader.js +1 -1
  184. package/dist/utils/local-cache.js +1 -1
  185. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  186. package/dist/utils/logger/formatters/index.js +1 -1
  187. package/dist/utils/logger/handlers/console-handler.js +1 -1
  188. package/dist/utils/logger/handlers/file-handler.js +1 -1
  189. package/dist/utils/logger/handlers/index.js +1 -1
  190. package/dist/utils/logger/handlers/null-handler.js +1 -1
  191. package/dist/utils/logger/index.js +1 -1
  192. package/dist/utils/logger/logger.js +1 -1
  193. package/dist/utils/logger/types.js +1 -1
  194. package/dist/utils/option-validation.js +1 -1
  195. package/dist/utils/process.js +1 -1
  196. package/dist/utils/prompt.js +1 -1
  197. package/dist/utils/spinner.js +1 -1
  198. package/dist/utils/sse-parser.js +1 -1
  199. package/dist/utils/string-utils.js +1 -1
  200. package/dist/utils/table-ref-parser.js +1 -1
  201. package/dist/utils/tdx-logger.js +1 -1
  202. package/dist/utils/version-check.js +1 -1
  203. package/package.json +1 -1
@@ -1 +1 @@
1
- const a30_0x391a0d=a30_0x48a9;(function(_0x62007a,_0x56b29f){const _0x529c3e=a30_0x48a9,_0x57ae3a=_0x62007a();while(!![]){try{const _0x276f95=-parseInt(_0x529c3e(0x11a))/0x1+parseInt(_0x529c3e(0x18f))/0x2+parseInt(_0x529c3e(0xd6))/0x3*(parseInt(_0x529c3e(0x188))/0x4)+-parseInt(_0x529c3e(0x184))/0x5*(-parseInt(_0x529c3e(0x14b))/0x6)+parseInt(_0x529c3e(0x1d3))/0x7+parseInt(_0x529c3e(0x1a1))/0x8*(-parseInt(_0x529c3e(0x122))/0x9)+-parseInt(_0x529c3e(0x181))/0xa;if(_0x276f95===_0x56b29f)break;else _0x57ae3a['push'](_0x57ae3a['shift']());}catch(_0x266099){_0x57ae3a['push'](_0x57ae3a['shift']());}}}(a30_0x1b3e,0x30aad));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0xc23dad from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a30_0x54ff4a from'chalk';function a30_0x1b3e(){const _0xc63c86=['\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','Master\x20+\x20Attributes','utf-8','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','\x20--behavior\x20\x22<name>\x22','Available\x20behaviors:','page_view','attribute','allValid','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','last_page_viewed','Attributes:','rowCount','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20','open','reduce','RT\x202.0\x20Validate:','use','sampleData','Fetching\x20customers\x20schema...','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','\x0a⚠️\x20\x20Both\x20','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','personalization','columns','Name:\x20','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','processedRows','true','\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','addBehaviorsFile','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','matchedCount','json','workflowId','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','toLocaleString','To\x20view\x20sample\x20data:','\x20\x20\x20\x20\x20\x20','segment:parent:create','\x20\x201.\x20Edit\x20','coveragePercent','customersWithEvents','YAML\x20file:\x20','behaviors','label','totalEvents','Overwrite\x20\x27','toFixed','execute','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','displayColumns','\x20--enriched','\x20behaviors','Personalization:','schemaError','data','trigger_event','joinKey','List\x20available\x20fields\x20for\x20segmentation','join','Default','\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','Customers:','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','status','\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML','\x27\x20is\x20up\x20to\x20date','length','site','red','scheduleOption','workflowAttemptId','segment:parent:fields','description','Listing\x20personalization\x20services\x20for\x20\x27','Updating','\x20\x20Columns:\x20','Master:','/\x20directory.\x0a','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','\x20RT-enabled\x20parent\x20segment','trim','green','\x0a\x20\x20\x20\x20}','\x20[Job\x20ID:\x20','Analyzing\x20changes...','\x20\x20Tables:\x201\x20customers\x20+\x20','\x20Added\x20RT\x202.0\x20template\x20section','displayMasterInfo','column_type','enriched','idStitching','Events:','segment:parent:list','displaySummary','displayPreviewHints','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','Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','✔\x20Created\x20parent\x20segment\x20\x27','repeat','tdx\x20ps\x20push\x20','toLowerCase','Fetching\x20behavior\x20list...','table','workflowSessionId','\x0aUsage:\x20tdx\x20ps\x20preview\x20','SELECT\x20*\x20FROM\x20(\x0a','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment','parentSegment','error','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','636gBqrlA','Next\x20steps:','List\x20parent\x20segments','\x20service(s)\x20configured','xdg-open','Error:','Fetching\x20parent\x20segment\x20\x27','updateParent','\x20Configuration\x20is\x20valid','parent_segment','format','Columns:','createParent','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','✔\x20Found\x20','Created','bold','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','information_schema','interval','limit','\x20=\x20','Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics','Join:','segment:parent:view','segment:parent:update','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','\x22,\x20\x22type\x22:\x20\x22','Error\x20parsing\x20YAML:\x20','type','\x20--attribute\x20\x22','Site:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','master','Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a','stop','list','test','tdx\x20ps\x20preview\x20','\x20rows\x20','segment','collectSchema','previewParentYaml','\x20to\x20configure\x20your\x20personalization\x20service','errors','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','customers','Errors:','✔\x20No\x20changes\x20-\x20\x27','\x20\x20\x20\x20-\x20','Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a','resolveParentId','foreignKey','segment:parent:validate','verbose','\x27\x20and\x20run\x20workflow?','Database:\x20','dim','/\x20→\x20','Creating\x20parent\x20segment\x20\x27','yellow','win32','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','\x0aNo\x20sample\x20data\x20available','/\x20and\x20','Enriched:','darwin','double','151065EkPBhY','attributes','Output\x20file:\x20','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','displayPreviewResults','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','single','Running\x20parent\x20segment\x20workflow\x20for\x20\x27','56421zNgtZH','-1d','Status:','session','\x20No\x20changes\x20-\x20','realtime:','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','Coverage:','replace','Table:\x20','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','Fetching\x20SQL\x20for\x20\x27','\x27\x20is\x20already\x20up\x20to\x20date','\x20trigger=','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','using\x20the\x20default\x20path:\x20','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','getBehaviorNames','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a','segment:parent:show','yes','keys','sourceTableValid','sourceTableError','getParentFull','preview','jsonl','Error:\x20Parent\x20segment\x20name\x20is\x20required','filter','message','Create\x20parent\x20segment\x20\x27','output','<database>.<table>','segment:parent:preview','formatSchemaJson','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','\x20\x20\x20\x20','Options:\x0a','\x20field','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','2047146ZSnYsH','\x20parent\x20segment','stats','setJobId','Options\x20(one\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','cyan','\x20configured','getParentSQL','\x20Opening\x20','Get\x20SQL\x20query\x20for\x20parent\x20segment','displayValidateResults','Schema\x20saved\x20to\x20','parent_segments','\x0aChanges\x20to\x20apply\x20to\x20\x27','No\x20personalization\x20services\x20configured','map','.yml','\x20service','Listing\x20parent\x20segments\x20matching\x20\x27','ps:pz:list','✘\x20Failed\x20to\x20rename\x20directory:\x20','name','schemaValid','SELECT\x20*\x20FROM\x20','\x27...','Source:','sort','No\x20parent\x20segments\x20match\x20pattern:\x20','.customers)','\x20parent\x20segment\x20\x27','displayAttributesStats','start','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','\x0a⚠️\x20\x20Migrating:\x20','ps:rt:validate','\x20--interval\x20','⚡\x20Not\x20enabled','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','segment:parent:desc','Creating','\x20to\x20push\x20the\x20configuration','Fetching\x20current\x20configuration\x20for\x20\x27','segment:parent:run','SQL\x20query:\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','personalizationServices','Show\x20parent\x20segment\x20schema\x20(column\x20types)','behavior','displayBehaviorsStats','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','customerGroupFile','✔\x20Renamed\x20directory\x20to\x20','5297310cyCRck','personalization_services','Aborted.','5NYtFrC','\x27\x20with\x20ID:\x20','localeCompare','RT\x202.0:','6172OcclcV','Attributes','\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22','jobId','validateParentYaml','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Apply\x20changes\x20to\x20\x27','367920GfjLrZ','events','/app/dw/parentSegments/','customerGroup','\x20is\x20already\x20up\x20to\x20date','platform','Validating\x20configuration...','\x20+\x20[','text','/app/workflows/','\x0aNew\x20parent\x20segment\x20\x27','\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)','✔\x20Query\x20completed:\x20Processed\x20','Listing\x20fields\x20for\x20\x27','Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20','valid','\x20tdx\x20wf\x20attempt\x20','all','8dtwyAq','👥\x20','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','\x20rows)','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','push','column','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','number','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dirname','Error:\x20--attribute\x20requires\x20a\x20name\x0a','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Attribute:','displaySampleData','\x0aError:','pushParentYaml','Error:\x20--behavior\x20requires\x20a\x20name\x0a','scheduleType','displayRealtimeInfo','addBehaviors','Output\x20Database:','elapsedTimeMillis','Parent\x20segment:\x20','segment:parent:pull','/\x20directories\x20exist.','\x20total','column_name','listFields','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','customerPercent','log','ignore','\x20\x20Note:\x20','apply','Join\x20on:','%)\x20','\x20--behavior\x20\x22','realtime','user_id','Rows:','realtime_enabled','Error\x20reading\x20file:\x20','/sessions/','timezone','ps:pz:init','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','238973xYbXzB','ID\x20Stitching:','\x0a✔\x20Workflow\x20started','population','listParents','runParent','behavior_','pullParentYaml','.yaml','ps:rt:list','sections','No\x20parent\x20segments\x20found','web','Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]','string','parent_id','\x20Context\x20set:\x20','\x20\x20No\x20sample\x20data\x20available','Resolving\x20parent\x20segment\x20\x27','database','Behaviors'];a30_0x1b3e=function(){return _0xc63c86;};return a30_0x1b3e();}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=a30_0x391a0d(0x158),LEGACY_PARENT_SEGMENT_DIR='parent_segment';function openBrowser(_0x3f0fdc){const _0x595b4a=a30_0x391a0d,_0x447e18=process[_0x595b4a(0x194)],_0x4076bd=_0x447e18===_0x595b4a(0x118)?_0x595b4a(0x1f6):_0x447e18===_0x595b4a(0x113)?_0x595b4a(0x16b):_0x595b4a(0xda);spawn(_0x4076bd,[_0x3f0fdc],{'detached':!![],'stdio':_0x595b4a(0x1c4)})['unref']();}function migrateLegacyDirectory(){const _0x422440=a30_0x391a0d;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x2af1e8=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x2af1e8['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x422440(0xd4)](a30_0x54ff4a['yellow'](_0x422440(0x1fd)+LEGACY_PARENT_SEGMENT_DIR+_0x422440(0x116)+PARENT_SEGMENT_DIR+_0x422440(0x1bb))),console[_0x422440(0xd4)](a30_0x54ff4a['dim']('\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x422440(0xb4))),![];console[_0x422440(0xd4)](a30_0x54ff4a[_0x422440(0x112)](_0x422440(0x16d)+LEGACY_PARENT_SEGMENT_DIR+_0x422440(0x110)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x422440(0xd4)](a30_0x54ff4a['green'](_0x422440(0x180)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x18e703){const _0x2e27bc=_0x18e703 instanceof Error?_0x18e703[_0x422440(0x140)]:String(_0x18e703);return console[_0x422440(0xd4)](a30_0x54ff4a['red'](_0x422440(0x160)+_0x2e27bc+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async['run'](_0x470d4e){return migrateLegacyDirectory(),super['run'](_0x470d4e);}}function resolveYamlFile(_0x170afa){const _0x2e7b15=a30_0x391a0d;if(_0x170afa[_0x2e7b15(0xd1)](_0x2e7b15(0x15c))||_0x170afa[_0x2e7b15(0xd1)](_0x2e7b15(0x1db)))return _0x170afa;return a30_0xc23dad[_0x2e7b15(0xa0)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x170afa)+'.yml');}function formatProgressMessage(_0x33c37e){const _0x37b8d1=a30_0x391a0d,_0x6ca384=_0x33c37e['match'](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0x6ca384){const [,_0x354987,_0x597b5b,_0x16b9da='']=_0x6ca384;return a30_0x54ff4a[_0x37b8d1(0x10f)](_0x354987+':')+'\x20'+_0x597b5b+a30_0x54ff4a[_0x37b8d1(0x10f)](_0x16b9da);}return a30_0x54ff4a[_0x37b8d1(0x10f)](_0x33c37e);}function showFileNotFoundError(_0x33e334,_0x365984){const _0x50dbb3=a30_0x391a0d;console[_0x50dbb3(0xd4)](a30_0x54ff4a[_0x50dbb3(0xab)]('Error:\x20File\x20not\x20found:\x20'+_0x33e334+'\x0a')),console[_0x50dbb3(0xd4)](a30_0x54ff4a['cyan'](_0x50dbb3(0x19d)+_0x365984+'`\x20to\x20download\x20the\x20configuration\x20first'));}function displayRealtimeValidation(_0x3af10a){const _0x16a90d=a30_0x391a0d;if(!_0x3af10a['realtime'])return;const _0x157f8a=_0x3af10a[_0x16a90d(0x1ca)],_0x104476=_0x157f8a['enabled']?a30_0x54ff4a[_0x16a90d(0xb8)]('⚡\x20Enabled'):a30_0x54ff4a['yellow'](_0x16a90d(0x170));console['error']('\x0a'+a30_0x54ff4a['dim'](_0x16a90d(0x187))+'\x20'+_0x104476);if(_0x157f8a[_0x16a90d(0x190)]&&_0x157f8a[_0x16a90d(0x190)][_0x16a90d(0xa9)]>0x0){console[_0x16a90d(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x16a90d(0x10f)](_0x16a90d(0xc2))+'\x20'+_0x157f8a[_0x16a90d(0x190)][_0x16a90d(0xa9)]+_0x16a90d(0x152));for(const _0x3aba20 of _0x157f8a[_0x16a90d(0x190)]){const _0x2d93a0=_0x3aba20[_0x16a90d(0x139)]===![]?a30_0x54ff4a[_0x16a90d(0xab)]('✘'):a30_0x54ff4a[_0x16a90d(0xb8)]('✔');console[_0x16a90d(0xd4)]('\x20\x20\x20\x20'+_0x2d93a0+'\x20'+_0x3aba20[_0x16a90d(0x161)]),_0x3aba20[_0x16a90d(0x13a)]&&console[_0x16a90d(0xd4)](_0x16a90d(0x20f)+a30_0x54ff4a[_0x16a90d(0xab)](_0x3aba20[_0x16a90d(0x13a)]));}}if(_0x157f8a[_0x16a90d(0x11b)]&&_0x157f8a[_0x16a90d(0x11b)]['length']>0x0){console[_0x16a90d(0xd4)]('\x20\x20'+a30_0x54ff4a['dim'](_0x16a90d(0x1f3))+'\x20'+_0x157f8a[_0x16a90d(0x11b)][_0x16a90d(0xa9)]+_0x16a90d(0x152));for(const _0x2e3528 of _0x157f8a[_0x16a90d(0x11b)]){const _0x1a5a09=_0x2e3528[_0x16a90d(0x19e)]?a30_0x54ff4a['green']('✔'):a30_0x54ff4a['red']('✘');console[_0x16a90d(0xd4)](_0x16a90d(0x147)+_0x1a5a09+'\x20'+_0x2e3528[_0x16a90d(0x161)]+'\x20'+a30_0x54ff4a[_0x16a90d(0x10f)]('('+_0x2e3528[_0x16a90d(0xf3)]+')'));}}if(_0x157f8a['idStitching']){const _0xa9a3f8=_0x157f8a['idStitching']['stitchingKeys']?.[_0x16a90d(0xa9)]?_0x16a90d(0x196)+_0x157f8a[_0x16a90d(0xc1)]['stitchingKeys'][_0x16a90d(0xa0)](',\x20')+']':'';console['error']('\x20\x20'+a30_0x54ff4a['dim'](_0x16a90d(0x1d4))+'\x20'+_0x157f8a[_0x16a90d(0xc1)]['primaryKey']+_0xa9a3f8);}if(_0x157f8a[_0x16a90d(0x17a)]&&_0x157f8a[_0x16a90d(0x17a)][_0x16a90d(0xa9)]>0x0){console[_0x16a90d(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x16a90d(0x10f)](_0x16a90d(0x9a))+'\x20'+_0x157f8a[_0x16a90d(0x17a)][_0x16a90d(0xa9)]+_0x16a90d(0x15d)+(_0x157f8a['personalizationServices'][_0x16a90d(0xa9)]!==0x1?'s':''));for(const _0x11e628 of _0x157f8a[_0x16a90d(0x17a)]){console[_0x16a90d(0xd4)]('\x20\x20\x20\x20-\x20'+_0x11e628[_0x16a90d(0x161)]);}}}function showParentSegmentNotSetError(_0x476e44){const _0x46e510=a30_0x391a0d;console[_0x46e510(0xd4)](a30_0x54ff4a[_0x46e510(0x112)](_0x46e510(0x1a8))),console[_0x46e510(0xd4)](_0x476e44);}export class ParentSegmentListCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0xc3);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0xd8);async['execute'](_0x459491){const _0x16734f=a30_0x391a0d,{options:_0x2a0758,args:_0x1f629e,tdx:_0x526c73}=_0x459491,_0x5ccbfb=_0x1f629e[0x0];_0x2a0758['verbose']&&(console['error'](_0x16734f(0xf5)+_0x2a0758[_0x16734f(0xaa)]),_0x5ccbfb&&console[_0x16734f(0xd4)]('Pattern:\x20'+_0x5ccbfb));const _0x207abe=await withSpinner(_0x5ccbfb?_0x16734f(0x15e)+_0x5ccbfb+'\x27...':'Listing\x20parent\x20segments...',()=>_0x526c73[_0x16734f(0xfe)][_0x16734f(0x1d7)](),{'verbose':_0x2a0758['verbose']});let _0x3b9556=_0x207abe['data'];if(_0x5ccbfb){const _0x4f1114=_0x5ccbfb[_0x16734f(0x12a)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x16734f(0x12a)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x24a4f1=new RegExp('^'+_0x4f1114+'$','i');_0x3b9556=_0x3b9556['filter'](_0x3481b8=>_0x24a4f1[_0x16734f(0xfb)](_0x3481b8[_0x16734f(0x11b)][_0x16734f(0x161)]));}_0x3b9556[_0x16734f(0x166)]((_0x48bcd4,_0x4a3516)=>_0x48bcd4['attributes'][_0x16734f(0x161)][_0x16734f(0x186)](_0x4a3516[_0x16734f(0x11b)][_0x16734f(0x161)])),console['error'](_0x16734f(0xe4)+_0x3b9556[_0x16734f(0xa9)]+_0x16734f(0x14c)+(_0x3b9556[_0x16734f(0xa9)]!==0x1?'s':''));const _0x2c698e=_0x4ef033=>{return getConsoleNextUrl(_0x2a0758['site'],'/app/dw/parentSegments/'+_0x4ef033);};if(_0x2a0758[_0x16734f(0xe0)]===_0x16734f(0x20a)||_0x2a0758[_0x16734f(0xe0)]===_0x16734f(0x13d)){const _0x23d26e=_0x3b9556[_0x16734f(0x15b)](_0x23f0d3=>({..._0x23f0d3,'url':_0x2c698e(_0x23f0d3['id'])}));await handleSDKOutput(_0x23d26e,_0x2a0758);}else{if(_0x3b9556[_0x16734f(0xa9)]===0x0)_0x5ccbfb?console['log'](_0x16734f(0x167)+_0x5ccbfb):console[_0x16734f(0x1c3)](_0x16734f(0x1de));else for(const _0x5aa2e8 of _0x3b9556){const _0x1c60f7=_0x5aa2e8[_0x16734f(0x11b)][_0x16734f(0x1d6)]?a30_0x54ff4a[_0x16734f(0x10f)]('\x20('+formatRows(_0x5aa2e8[_0x16734f(0x11b)][_0x16734f(0x1d6)])+')'):'',_0x2fc8f0=hyperlink(_0x5aa2e8[_0x16734f(0x11b)][_0x16734f(0x161)],_0x2c698e(_0x5aa2e8['id']));console[_0x16734f(0x1c3)](_0x16734f(0x1a2)+_0x2fc8f0+_0x1c60f7);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x210);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0xc7);async[a30_0x391a0d(0x94)](_0x385fcb){const _0x335f4a=a30_0x391a0d,{options:_0x40214e,args:_0x5d8279,tdx:_0x1e6795}=_0x385fcb;console['error'](_0x335f4a(0x178)+_0x335f4a(0x17e)+_0x335f4a(0x203));const _0x251537=_0x40214e;if(_0x5d8279['length']===0x0)return console['error'](a30_0x54ff4a[_0x335f4a(0xab)](_0x335f4a(0x13e))),console[_0x335f4a(0xd4)](_0x335f4a(0x1ad)),0x1;const _0x4039c7=_0x5d8279[0x0];if(!_0x251537[_0x335f4a(0x1e6)]||!_0x251537[_0x335f4a(0xcd)])return console[_0x335f4a(0xd4)]('Error:\x20--database\x20and\x20--table\x20are\x20required'),console[_0x335f4a(0xd4)](_0x335f4a(0x1ad)),0x1;_0x251537[_0x335f4a(0x10c)]&&(console['error'](_0x335f4a(0xf5)+_0x251537[_0x335f4a(0xaa)]),console[_0x335f4a(0xd4)](_0x335f4a(0x202)+_0x4039c7),console[_0x335f4a(0xd4)](_0x335f4a(0x10e)+_0x251537['database']),console['error'](_0x335f4a(0x12b)+_0x251537[_0x335f4a(0xcd)]));const _0x341afb=await loadJSONFromOptions(_0x251537[_0x335f4a(0x11b)],_0x251537['attributesFile']),_0x3bbef1=await loadJSONFromOptions(_0x251537[_0x335f4a(0x215)],_0x251537['behaviorsFile']),_0x32ce52=await loadJSONFromOptions(_0x251537[_0x335f4a(0x192)],_0x251537[_0x335f4a(0x17f)]),_0x35c982={'name':_0x4039c7,'description':_0x251537[_0x335f4a(0xaf)],'scheduleType':_0x251537[_0x335f4a(0x1b4)],'scheduleOption':_0x251537['scheduleOption'],'timezone':_0x251537[_0x335f4a(0x1d0)],'master':{'parentDatabaseName':_0x251537[_0x335f4a(0x1e6)],'parentTableName':_0x251537[_0x335f4a(0xcd)]},'attributes':_0x341afb,'behaviors':_0x3bbef1,'customerGroup':_0x32ce52},_0x2d5376=await withSpinner(_0x335f4a(0x111)+_0x4039c7+_0x335f4a(0x164),()=>_0x1e6795[_0x335f4a(0xfe)][_0x335f4a(0xe2)](_0x35c982),{'verbose':_0x40214e['verbose']}),_0x13444b=_0x2d5376[_0x335f4a(0x9c)];return console[_0x335f4a(0xd4)](_0x335f4a(0xc8)+_0x13444b[_0x335f4a(0x161)]+_0x335f4a(0x185)+_0x13444b['id']),await handleSDKOutput([_0x13444b],_0x40214e),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0xef);['description']=a30_0x391a0d(0xe3);async['execute'](_0x35a019){const _0x38c207=a30_0x391a0d,{options:_0x57225f,args:_0x44cc81,tdx:_0x111f05}=_0x35a019;console[_0x38c207(0xd4)](_0x38c207(0x132)+_0x38c207(0x17e)+_0x38c207(0x203));const _0x4c46c8=_0x57225f;if(_0x44cc81[_0x38c207(0xa9)]===0x0)return console[_0x38c207(0xd4)](a30_0x54ff4a[_0x38c207(0xab)](_0x38c207(0x13e))),console[_0x38c207(0xd4)](_0x38c207(0x1e0)),0x1;const _0xfbcd67=_0x44cc81[0x0];_0x4c46c8['verbose']&&(console[_0x38c207(0xd4)](_0x38c207(0xf5)+_0x4c46c8[_0x38c207(0xaa)]),console[_0x38c207(0xd4)](_0x38c207(0x1b9)+_0xfbcd67));const _0x43b056=await withSpinner(_0x38c207(0x175)+_0xfbcd67+_0x38c207(0x164),()=>_0x111f05[_0x38c207(0xfe)]['getParentFull'](_0xfbcd67),{'verbose':_0x4c46c8['verbose']}),_0x5506c8=_0x43b056[_0x38c207(0x9c)],_0x13fc09=await loadJSONFromOptions(_0x4c46c8['addAttributes'],_0x4c46c8['addAttributesFile']),_0x2e473d=await loadJSONFromOptions(_0x4c46c8[_0x38c207(0x1b6)],_0x4c46c8[_0x38c207(0x207)]),_0x4393af={'name':_0x5506c8[_0x38c207(0x161)],'description':_0x4c46c8['description']!==undefined?_0x4c46c8[_0x38c207(0xaf)]:_0x5506c8['description'],'scheduleType':_0x4c46c8[_0x38c207(0x1b4)]!==undefined?_0x4c46c8['scheduleType']:_0x5506c8[_0x38c207(0x1b4)],'scheduleOption':_0x4c46c8[_0x38c207(0xac)]!==undefined?_0x4c46c8['scheduleOption']:_0x5506c8[_0x38c207(0xac)],'timezone':_0x4c46c8[_0x38c207(0x1d0)]!==undefined?_0x4c46c8['timezone']:_0x5506c8[_0x38c207(0x1d0)],'master':_0x5506c8[_0x38c207(0xf7)],'attributes':_0x13fc09?[..._0x5506c8['attributes']||[],..._0x13fc09]:_0x5506c8[_0x38c207(0x11b)],'behaviors':_0x2e473d?[..._0x5506c8[_0x38c207(0x215)]||[],..._0x2e473d]:_0x5506c8[_0x38c207(0x215)],'customerGroup':_0x5506c8['customerGroup']},_0x9c5c72=await withSpinner('Updating\x20parent\x20segment\x20\x27'+_0xfbcd67+'\x27...',()=>_0x111f05[_0x38c207(0xfe)][_0x38c207(0xdd)](_0xfbcd67,_0x4393af),{'verbose':_0x4c46c8['verbose']}),_0x15191d=_0x9c5c72[_0x38c207(0x9c)];return console['error']('✔\x20Updated\x20parent\x20segment\x20\x27'+_0x15191d[_0x38c207(0x161)]+'\x27'),await handleSDKOutput([_0x15191d],_0x4c46c8),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x1ba);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x1a3);async['execute'](_0x5ba553){const _0x1b9c75=a30_0x391a0d,{options:_0x2f643c,args:_0x271e2f,tdx:_0x585d56}=_0x5ba553,_0x476753=_0x2f643c,_0x6b74f0=_0x271e2f[0x0]||_0x2f643c[_0x1b9c75(0xd3)];if(!_0x6b74f0)return showParentSegmentNotSetError(_0x1b9c75(0x1fc)+_0x1b9c75(0xf0)),0x1;if(_0x476753[_0x1b9c75(0x1f9)]&&_0x476753[_0x1b9c75(0x142)])return console[_0x1b9c75(0xd4)](a30_0x54ff4a['red']('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x1b9c75(0xd4)](a30_0x54ff4a[_0x1b9c75(0x10f)](_0x1b9c75(0x20c))),console['error'](a30_0x54ff4a['dim'](_0x1b9c75(0x131)+PARENT_SEGMENT_DIR+'/{name}.yml\x0a')),console[_0x1b9c75(0xd4)](a30_0x54ff4a[_0x1b9c75(0x151)]('Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u')),0x1;const _0x3de9eb=_0x476753['output']||a30_0xc23dad[_0x1b9c75(0xa0)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x6b74f0)+_0x1b9c75(0x15c));_0x476753[_0x1b9c75(0x10c)]&&(console[_0x1b9c75(0xd4)]('Site:\x20'+_0x476753[_0x1b9c75(0xaa)]),console['error']('Parent\x20segment:\x20'+_0x6b74f0),console['error'](_0x1b9c75(0x11c)+_0x3de9eb));const _0x416ef2=await withSpinner(_0x1b9c75(0xdc)+_0x6b74f0+_0x1b9c75(0x164),()=>_0x585d56[_0x1b9c75(0xfe)][_0x1b9c75(0x1da)](_0x6b74f0),{'verbose':_0x476753[_0x1b9c75(0x10c)]}),_0x7173ed=_0x416ef2[_0x1b9c75(0x9c)];if(existsSync(_0x3de9eb)){const _0x1be6c1=readFileSync(_0x3de9eb,_0x1b9c75(0x1ea)),_0x23139c=generateDiff(_0x1be6c1,_0x7173ed);if(!hasChanges(_0x23139c))console['error'](a30_0x54ff4a['green']('✔')+_0x1b9c75(0x126)+a30_0x54ff4a[_0x1b9c75(0x151)](_0x3de9eb)+_0x1b9c75(0x193));else{console[_0x1b9c75(0xd4)]('\x0aChanges\x20to\x20\x27'+_0x3de9eb+'\x27:'),console[_0x1b9c75(0xd4)]('─'[_0x1b9c75(0xc9)](0x3c)),console['error'](formatDiffWithColors(_0x23139c)),console[_0x1b9c75(0xd4)]('─'['repeat'](0x3c));if(!_0x476753[_0x1b9c75(0x137)]){if(!isInteractive())return console['error'](a30_0x54ff4a[_0x1b9c75(0xab)](_0x1b9c75(0x1b1)),_0x1b9c75(0xe7)),console['error'](a30_0x54ff4a['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x39e8d9=await confirmKey(_0x1b9c75(0x92)+_0x3de9eb+'\x27?');if(!_0x39e8d9)return console[_0x1b9c75(0xd4)](a30_0x54ff4a[_0x1b9c75(0x112)](_0x1b9c75(0x183))),0x1;}writeFileSync(_0x3de9eb,_0x7173ed,_0x1b9c75(0x1ea)),console[_0x1b9c75(0xd4)](a30_0x54ff4a[_0x1b9c75(0xb8)]('✔')+_0x1b9c75(0x1d2)+a30_0x54ff4a[_0x1b9c75(0x151)](_0x3de9eb));}}else{const _0x5b2d00=a30_0xc23dad[_0x1b9c75(0x1ab)](_0x3de9eb);!existsSync(_0x5b2d00)&&mkdirSync(_0x5b2d00,{'recursive':!![]}),writeFileSync(_0x3de9eb,_0x7173ed,_0x1b9c75(0x1ea)),console[_0x1b9c75(0xd4)](a30_0x54ff4a[_0x1b9c75(0xb8)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x54ff4a[_0x1b9c75(0x151)](_0x3de9eb));}return saveSessionContext({'parent_segment':_0x6b74f0},_0x476753[_0x1b9c75(0x125)]),console[_0x1b9c75(0xd4)](a30_0x54ff4a[_0x1b9c75(0xb8)]('✔')+_0x1b9c75(0x1e3)+a30_0x54ff4a[_0x1b9c75(0x10f)](_0x1b9c75(0xdf))+'\x20=\x20'+a30_0x54ff4a[_0x1b9c75(0x151)](_0x6b74f0)),0x0;}}function a30_0x48a9(_0x10915b,_0x1dce87){_0x10915b=_0x10915b-0x90;const _0x1b3ebc=a30_0x1b3e();let _0x48a92f=_0x1b3ebc[_0x10915b];return _0x48a92f;}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{['name']='segment:parent:push';[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x134);async[a30_0x391a0d(0x94)](_0x106d5c){const _0x5adbc3=a30_0x391a0d,{options:_0x30e238,args:_0x4fec93,tdx:_0xf53a31}=_0x106d5c,_0x391efe=_0x30e238,_0x4a8c18=_0x4fec93[0x0]||_0x30e238['parentSegment'];if(!_0x4a8c18)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment'),0x1;const _0x50156b=resolveYamlFile(_0x4a8c18);if(!existsSync(_0x50156b))return showFileNotFoundError(_0x50156b,_0x4a8c18),0x1;_0x391efe[_0x5adbc3(0x10c)]&&(console[_0x5adbc3(0xd4)]('Site:\x20'+_0x391efe['site']),console[_0x5adbc3(0xd4)](_0x5adbc3(0x214)+_0x50156b));let _0x1bb3b3;try{_0x1bb3b3=readFileSync(_0x50156b,_0x5adbc3(0x1ea));}catch(_0xf9cfc0){const _0x5e8c6e=_0xf9cfc0 instanceof Error?_0xf9cfc0[_0x5adbc3(0x140)]:String(_0xf9cfc0);return console[_0x5adbc3(0xd4)](_0x5adbc3(0x1ce)+_0x5e8c6e),0x1;}const _0x3ee736=await withSpinner(_0x5adbc3(0xbb),()=>_0xf53a31[_0x5adbc3(0xfe)][_0x5adbc3(0x1b2)](_0x1bb3b3),{'verbose':_0x391efe[_0x5adbc3(0x10c)]}),_0x46b04c=_0x3ee736[_0x5adbc3(0x9c)],{isNew:_0x4040e9,name:_0x17ea38,hasChanges:_0x562ce5,diffFormatted:_0x47dd3b}=_0x46b04c;if(!_0x562ce5)return console[_0x5adbc3(0xd4)]('✔\x20No\x20changes\x20-\x20\x27'+_0x17ea38+_0x5adbc3(0x12e)),0x0;_0x4040e9?console[_0x5adbc3(0xd4)](_0x5adbc3(0x199)+_0x17ea38+'\x27:'):console[_0x5adbc3(0xd4)](_0x5adbc3(0x159)+_0x17ea38+'\x27:');console['error']('─'[_0x5adbc3(0xc9)](0x3c)),console[_0x5adbc3(0xd4)](_0x47dd3b),console[_0x5adbc3(0xd4)]('─'['repeat'](0x3c));const _0x249e24=_0x4040e9?_0x5adbc3(0x141)+_0x17ea38+'\x27?':_0x5adbc3(0x18e)+_0x17ea38+'\x27?';if(!_0x391efe['yes']){if(!isInteractive())return console[_0x5adbc3(0xd4)](a30_0x54ff4a['red'](_0x5adbc3(0x1b1)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5adbc3(0xd4)](a30_0x54ff4a[_0x5adbc3(0x10f)](_0x5adbc3(0x1aa))),0x1;const _0x238215=await confirmKey(_0x249e24);if(!_0x238215)return console[_0x5adbc3(0xd4)](a30_0x54ff4a[_0x5adbc3(0x112)](_0x5adbc3(0x183))),0x1;}const _0x5e2fca=_0x4040e9?'Creating':'Updating',_0x2030ac=await withSpinner(_0x5e2fca+'\x20parent\x20segment\x20\x27'+_0x17ea38+_0x5adbc3(0x164),()=>_0x46b04c[_0x5adbc3(0x1c6)](),{'verbose':_0x391efe[_0x5adbc3(0x10c)]}),_0x3be32e=_0x2030ac[_0x5adbc3(0x9c)],_0x5d8320=getConsoleNextUrl(_0x391efe[_0x5adbc3(0xaa)],'/app/dw/parentSegments/'+_0x3be32e['id']),_0x226678=_0x4040e9?_0x5adbc3(0xe5):'Updated';return console[_0x5adbc3(0xd4)]('✔\x20'+_0x226678+'\x20parent\x20segment\x20\x27'+_0x3be32e[_0x5adbc3(0x161)]+'\x27'),console[_0x5adbc3(0xd4)]('\x20\x20'+_0x5d8320),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x10b);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0xec);async[a30_0x391a0d(0x94)](_0x18e2bc){const _0x4e7bd6=a30_0x391a0d,{options:_0x2e2f04,args:_0xaf48ba,tdx:_0x420f48}=_0x18e2bc,_0x158474=_0x2e2f04,_0x218f79=_0xaf48ba[0x0]||_0x2e2f04[_0x4e7bd6(0xd3)];if(!_0x218f79)return showParentSegmentNotSetError(_0x4e7bd6(0x150)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a'+_0x4e7bd6(0x148)+_0x4e7bd6(0x12c)+_0x4e7bd6(0x206)+_0x4e7bd6(0x95)),0x1;const _0x5656ea=resolveYamlFile(_0x218f79);if(!existsSync(_0x5656ea))return showFileNotFoundError(_0x5656ea,_0x218f79),0x1;_0x158474['verbose']&&(console[_0x4e7bd6(0xd4)](_0x4e7bd6(0xf5)+_0x158474[_0x4e7bd6(0xaa)]),console[_0x4e7bd6(0xd4)](_0x4e7bd6(0x214)+_0x5656ea));let _0x57c936;try{_0x57c936=readFileSync(_0x5656ea,_0x4e7bd6(0x1ea));}catch(_0xa73acb){const _0x250382=_0xa73acb instanceof Error?_0xa73acb[_0x4e7bd6(0x140)]:String(_0xa73acb);return console['error']('Error\x20reading\x20file:\x20'+_0x250382),0x1;}const _0x50f59d=createCommandSpinner(a30_0x54ff4a[_0x4e7bd6(0x10f)](_0x4e7bd6(0x195)),{'verbose':_0x158474[_0x4e7bd6(0x10c)]});_0x50f59d[_0x4e7bd6(0x16b)]();const _0x2750a3={'onProgress':_0x4f19a9=>{const _0x353c28=_0x4e7bd6;_0x50f59d[_0x353c28(0x197)]=formatProgressMessage(_0x4f19a9);}};if(_0x158474[_0x4e7bd6(0xf7)])_0x2750a3['master']=!![];if(_0x158474[_0x4e7bd6(0xc0)])_0x2750a3[_0x4e7bd6(0xc0)]=!![];_0x158474[_0x4e7bd6(0x1ef)]&&(_0x2750a3['attribute']=_0x158474['attribute']);_0x158474[_0x4e7bd6(0x17c)]&&(_0x2750a3[_0x4e7bd6(0x17c)]=_0x158474['behavior']);if(_0x158474['interval'])_0x2750a3[_0x4e7bd6(0xe9)]=_0x158474[_0x4e7bd6(0xe9)];let _0x275c0f;try{_0x275c0f=await _0x420f48[_0x4e7bd6(0xfe)][_0x4e7bd6(0x18c)](_0x57c936,_0x2750a3),_0x50f59d[_0x4e7bd6(0xf9)]();}catch(_0xe355bc){_0x50f59d['stop']();throw _0xe355bc;}const _0x36de41=_0x158474[_0x4e7bd6(0xe9)]||'-1d';return this[_0x4e7bd6(0x156)](_0x275c0f,_0x2750a3,_0x5656ea,_0x36de41),_0x275c0f[_0x4e7bd6(0x1f0)]?0x0:0x1;}[a30_0x391a0d(0x156)](_0x22a573,_0x573eca,_0x6a83c9,_0x1ed372){const _0xc89ea7=a30_0x391a0d;console[_0xc89ea7(0xd4)]('\x0a'+a30_0x54ff4a['bold']('Validate:')+'\x20'+_0x22a573[_0xc89ea7(0x161)]),console[_0xc89ea7(0xd4)]('═'[_0xc89ea7(0xc9)](0x3c)),this[_0xc89ea7(0xbe)](_0x22a573);if(typeof _0x573eca[_0xc89ea7(0x1ef)]===_0xc89ea7(0x1e1)){this[_0xc89ea7(0x16a)](_0x22a573),this[_0xc89ea7(0xc4)](_0x22a573),this[_0xc89ea7(0xc5)](_0x6a83c9,_0x1ed372,_0xc89ea7(0x1ef),_0x573eca[_0xc89ea7(0x1ef)]);return;}if(_0x573eca[_0xc89ea7(0x1ef)]===!![]){this[_0xc89ea7(0x16a)](_0x22a573),this[_0xc89ea7(0xc4)](_0x22a573),this[_0xc89ea7(0xc5)](_0x6a83c9,_0x1ed372,'attributes');return;}if(typeof _0x573eca[_0xc89ea7(0x17c)]===_0xc89ea7(0x1e1)){this[_0xc89ea7(0x17d)](_0x22a573,_0x1ed372),this[_0xc89ea7(0xc4)](_0x22a573),this[_0xc89ea7(0xc5)](_0x6a83c9,_0x1ed372,_0xc89ea7(0x17c),_0x573eca[_0xc89ea7(0x17c)]);return;}if(_0x573eca[_0xc89ea7(0x17c)]===!![]){this[_0xc89ea7(0x17d)](_0x22a573,_0x1ed372),this[_0xc89ea7(0xc4)](_0x22a573),this[_0xc89ea7(0xc5)](_0x6a83c9,_0x1ed372,_0xc89ea7(0x215));return;}this[_0xc89ea7(0x16a)](_0x22a573),this[_0xc89ea7(0x17d)](_0x22a573,_0x1ed372),this['displayRealtimeInfo'](_0x22a573),this['displaySummary'](_0x22a573),this['displayPreviewHints'](_0x6a83c9,_0x1ed372,'all');}[a30_0x391a0d(0x1b5)](_0x431072){displayRealtimeValidation(_0x431072);}['displayPreviewHints'](_0x4fcc89,_0x3fc864,_0x2142be,_0x33c6a7){const _0x10cc2b=a30_0x391a0d;console[_0x10cc2b(0xd4)]('\x0a'+a30_0x54ff4a[_0x10cc2b(0x10f)](_0x10cc2b(0x20e)));const _0x4e4d9d=_0x3fc864!==_0x10cc2b(0x123)?_0x10cc2b(0x16f)+_0x3fc864:'';if(_0x2142be===_0x10cc2b(0x1ef)&&_0x33c6a7)console[_0x10cc2b(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x10cc2b(0x10f)](_0x10cc2b(0xfc)+_0x4fcc89+_0x10cc2b(0xf4)+_0x33c6a7+'\x22'+_0x4e4d9d));else{if(_0x2142be===_0x10cc2b(0x17c)&&_0x33c6a7)console['error']('\x20\x20'+a30_0x54ff4a[_0x10cc2b(0x10f)](_0x10cc2b(0xfc)+_0x4fcc89+_0x10cc2b(0x1c9)+_0x33c6a7+'\x22'+_0x4e4d9d));else(_0x2142be===_0x10cc2b(0x11b)||_0x2142be===_0x10cc2b(0x1a0))&&console[_0x10cc2b(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x10cc2b(0x10f)]('tdx\x20ps\x20preview\x20'+_0x4fcc89+'\x20--attribute\x20\x22<name>\x22'+_0x4e4d9d));}(_0x2142be==='behaviors'||_0x2142be==='all')&&console['error']('\x20\x20'+a30_0x54ff4a[_0x10cc2b(0x10f)](_0x10cc2b(0xfc)+_0x4fcc89+_0x10cc2b(0x1ec)+_0x4e4d9d)),_0x2142be===_0x10cc2b(0x1a0)&&console[_0x10cc2b(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x10cc2b(0x10f)](_0x10cc2b(0xfc)+_0x4fcc89+_0x10cc2b(0x98)+_0x4e4d9d));}[a30_0x391a0d(0xbe)](_0x439d0d){const _0x468eb4=a30_0x391a0d,{master:_0x460161}=_0x439d0d,_0x2e120c=_0x460161[_0x468eb4(0x162)]?a30_0x54ff4a['green']('✔'):a30_0x54ff4a['red']('✘');console['error']('\x0a'+a30_0x54ff4a[_0x468eb4(0x10f)]('Master\x20Table')),console[_0x468eb4(0xd4)](_0x2e120c+'\x20'+a30_0x54ff4a[_0x468eb4(0xe6)](_0x460161[_0x468eb4(0x1e6)]+'.'+_0x460161['table'])),_0x460161[_0x468eb4(0x162)]?_0x460161[_0x468eb4(0x1f4)]!==undefined&&console[_0x468eb4(0xd4)]('\x20\x20'+a30_0x54ff4a['dim'](_0x468eb4(0x1cc))+'\x20'+a30_0x54ff4a[_0x468eb4(0x151)](formatRows(_0x460161[_0x468eb4(0x1f4)]))):console[_0x468eb4(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x468eb4(0xab)](_0x468eb4(0xdb))+'\x20'+_0x460161[_0x468eb4(0x9b)]);}[a30_0x391a0d(0x16a)](_0x3a6734){const _0x2dff05=a30_0x391a0d;if(_0x3a6734[_0x2dff05(0x11b)][_0x2dff05(0xa9)]===0x0)return;console['error']('\x0a'+a30_0x54ff4a['dim'](_0x2dff05(0x189)));for(const _0x333069 of _0x3a6734[_0x2dff05(0x11b)]){const _0xde2cc1=_0x333069[_0x2dff05(0x162)]?a30_0x54ff4a[_0x2dff05(0xb8)]('✔'):a30_0x54ff4a[_0x2dff05(0xab)]('✘');let _0x267a94='';if(_0x333069[_0x2dff05(0x162)]&&_0x333069[_0x2dff05(0x209)]!==undefined&&_0x333069['coveragePercent']!==undefined){const _0x1aa926=_0x333069[_0x2dff05(0x212)][_0x2dff05(0x93)](0x1),_0x58c773=_0x333069[_0x2dff05(0x212)]>=0x50?a30_0x54ff4a[_0x2dff05(0xb8)]:_0x333069[_0x2dff05(0x212)]>=0x32?a30_0x54ff4a[_0x2dff05(0x112)]:a30_0x54ff4a[_0x2dff05(0xab)];_0x267a94='\x20'+a30_0x54ff4a[_0x2dff05(0x10f)](_0x2dff05(0x129))+'\x20'+_0x58c773(_0x1aa926+'%')+'\x20('+formatRows(_0x333069['matchedCount'])+_0x2dff05(0x1a4);}console[_0x2dff05(0xd4)](_0xde2cc1+'\x20'+a30_0x54ff4a[_0x2dff05(0xe6)](_0x333069[_0x2dff05(0x161)])+_0x267a94),console[_0x2dff05(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x2dff05(0x10f)](_0x2dff05(0x165))+'\x20'+a30_0x54ff4a['bold'](_0x333069['database']+'.'+_0x333069[_0x2dff05(0xcd)]));const _0x4f55c2=_0x333069[_0x2dff05(0x9e)]===_0x333069['foreignKey']?a30_0x54ff4a[_0x2dff05(0x10f)](_0x2dff05(0x1c7))+'\x20'+_0x333069[_0x2dff05(0x9e)]:a30_0x54ff4a[_0x2dff05(0x10f)](_0x2dff05(0xed))+'\x20'+_0x333069[_0x2dff05(0x9e)]+_0x2dff05(0xeb)+_0x333069['foreignKey'];console['error']('\x20\x20'+_0x4f55c2),console['error']('\x20\x20'+a30_0x54ff4a[_0x2dff05(0x10f)](_0x2dff05(0xe1))),this[_0x2dff05(0x97)](_0x333069[_0x2dff05(0x201)]),!_0x333069['schemaValid']&&console[_0x2dff05(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x2dff05(0xab)]('Error:')+'\x20'+_0x333069['schemaError']);}}[a30_0x391a0d(0x17d)](_0x32d030,_0x15a8b5){const _0x11427d=a30_0x391a0d;if(_0x32d030[_0x11427d(0x215)][_0x11427d(0xa9)]===0x0)return;console[_0x11427d(0xd4)]('\x0a'+a30_0x54ff4a[_0x11427d(0x10f)](_0x11427d(0x1e7))+'\x20'+a30_0x54ff4a[_0x11427d(0x10f)]('('+_0x15a8b5+')'));for(const _0x2c9e59 of _0x32d030[_0x11427d(0x215)]){const _0x2131ca=_0x2c9e59[_0x11427d(0x162)]?a30_0x54ff4a[_0x11427d(0xb8)]('✔'):a30_0x54ff4a[_0x11427d(0xab)]('✘');let _0x1a496e='';if(_0x2c9e59['schemaValid']&&_0x2c9e59[_0x11427d(0x213)]!==undefined&&_0x2c9e59[_0x11427d(0x91)]!==undefined){const _0x434979=_0x2c9e59[_0x11427d(0x1c2)]?.['toFixed'](0x1)||'?',_0x57a1ba=(_0x2c9e59[_0x11427d(0x1c2)]??0x0)>=0x32?a30_0x54ff4a[_0x11427d(0xb8)]:(_0x2c9e59[_0x11427d(0x1c2)]??0x0)>=0x14?a30_0x54ff4a[_0x11427d(0x112)]:a30_0x54ff4a[_0x11427d(0xab)];_0x1a496e='\x20'+a30_0x54ff4a['dim'](_0x11427d(0xa3))+'\x20'+_0x57a1ba(formatRows(_0x2c9e59[_0x11427d(0x213)]))+'\x20('+_0x434979+_0x11427d(0x1c8)+a30_0x54ff4a['dim'](_0x11427d(0xc2))+'\x20'+a30_0x54ff4a[_0x11427d(0x151)](formatRows(_0x2c9e59[_0x11427d(0x91)]));}console['error'](_0x2131ca+'\x20'+a30_0x54ff4a[_0x11427d(0xe6)](_0x2c9e59[_0x11427d(0x161)])+_0x1a496e),console[_0x11427d(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x11427d(0x10f)](_0x11427d(0x165))+'\x20'+a30_0x54ff4a['bold'](_0x2c9e59[_0x11427d(0x1e6)]+'.'+_0x2c9e59[_0x11427d(0xcd)]));const _0x4f1e67=_0x2c9e59['joinKey']===_0x2c9e59[_0x11427d(0x10a)]?a30_0x54ff4a[_0x11427d(0x10f)](_0x11427d(0x1c7))+'\x20'+_0x2c9e59[_0x11427d(0x9e)]:a30_0x54ff4a[_0x11427d(0x10f)](_0x11427d(0xed))+'\x20'+_0x2c9e59[_0x11427d(0x9e)]+_0x11427d(0xeb)+_0x2c9e59[_0x11427d(0x10a)];console[_0x11427d(0xd4)]('\x20\x20'+_0x4f1e67),console[_0x11427d(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x11427d(0x10f)](_0x11427d(0xe1))),this[_0x11427d(0x97)](_0x2c9e59[_0x11427d(0x201)]),!_0x2c9e59[_0x11427d(0x162)]&&console[_0x11427d(0xd4)]('\x20\x20'+a30_0x54ff4a['red'](_0x11427d(0xdb))+'\x20'+_0x2c9e59[_0x11427d(0x9b)]);}}[a30_0x391a0d(0x97)](_0x518adb){const _0x59711e=a30_0x391a0d;for(const _0xbc813 of _0x518adb){_0xbc813[_0x59711e(0x90)]===_0xbc813['column']||_0xbc813[_0x59711e(0x1a7)]==='*'?console[_0x59711e(0xd4)](_0x59711e(0x107)+_0xbc813[_0x59711e(0x90)]):console[_0x59711e(0xd4)]('\x20\x20\x20\x20-\x20'+_0xbc813[_0x59711e(0x90)]+'\x20'+a30_0x54ff4a[_0x59711e(0x10f)]('('+_0xbc813[_0x59711e(0x1a7)]+')'));}}[a30_0x391a0d(0xc4)](_0x293d0e){const _0x358a6e=a30_0x391a0d;console['error']('─'[_0x358a6e(0xc9)](0x3c));if(_0x293d0e['errors'][_0x358a6e(0xa9)]>0x0){console[_0x358a6e(0xd4)]('\x0a'+a30_0x54ff4a[_0x358a6e(0xab)]('Errors:'));for(const _0x204d73 of _0x293d0e[_0x358a6e(0x102)]){console[_0x358a6e(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x358a6e(0xab)]('•')+'\x20'+_0x204d73);}}_0x293d0e[_0x358a6e(0x1f0)]&&console[_0x358a6e(0xd4)]('\x0a'+a30_0x54ff4a[_0x358a6e(0xb8)]('✔')+_0x358a6e(0xde));}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x144);['description']=a30_0x391a0d(0x1f1);async[a30_0x391a0d(0x94)](_0x35a05d){const _0xa765dd=a30_0x391a0d,{options:_0x23bef1,args:_0x203e74,tdx:_0x573904}=_0x35a05d,_0x724800=_0x23bef1,_0x254a23=_0x203e74[0x0]||_0x23bef1[_0xa765dd(0xd3)];if(!_0x254a23)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20preview\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20specific\x20parent\x20segment\x0a\x0a'+_0xa765dd(0x14f)+'\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a'+'\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a'+_0xa765dd(0x146)+_0xa765dd(0xd5)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;if(!_0x724800[_0xa765dd(0xf7)]&&!_0x724800[_0xa765dd(0x1ef)]&&!_0x724800['behavior']&&!_0x724800[_0xa765dd(0xc0)])return console['error'](a30_0x54ff4a[_0xa765dd(0xab)]('Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a')),console[_0xa765dd(0xd4)](_0xa765dd(0x1fe)),console[_0xa765dd(0xd4)]('Options:'),console[_0xa765dd(0xd4)](_0xa765dd(0x1bf)),console[_0xa765dd(0xd4)](_0xa765dd(0x103)),console[_0xa765dd(0xd4)](_0xa765dd(0x96)),console[_0xa765dd(0xd4)](_0xa765dd(0x1e8)),0x1;const _0x3ae510=resolveYamlFile(_0x254a23);if(!existsSync(_0x3ae510))return showFileNotFoundError(_0x3ae510,_0x254a23),0x1;_0x724800[_0xa765dd(0x10c)]&&(console[_0xa765dd(0xd4)]('Site:\x20'+_0x724800['site']),console[_0xa765dd(0xd4)](_0xa765dd(0x214)+_0x3ae510));let _0x53c8a7;try{_0x53c8a7=readFileSync(_0x3ae510,_0xa765dd(0x1ea));}catch(_0x5ad48e){const _0x332084=_0x5ad48e instanceof Error?_0x5ad48e['message']:String(_0x5ad48e);return console[_0xa765dd(0xd4)](_0xa765dd(0x1ce)+_0x332084),0x1;}let _0x44203e;try{_0x44203e=parseDef(_0x53c8a7);}catch(_0x2d74c5){const _0x311e28=_0x2d74c5 instanceof Error?_0x2d74c5[_0xa765dd(0x140)]:String(_0x2d74c5);return console[_0xa765dd(0xd4)](a30_0x54ff4a[_0xa765dd(0xab)](_0xa765dd(0xf2)+_0x311e28)),0x1;}if(_0x724800[_0xa765dd(0x1ef)]===!![]||_0x724800[_0xa765dd(0x1ef)]===''){const _0x484655=_0x44203e[_0xa765dd(0x11b)]?.[_0xa765dd(0x15b)](_0x58f4ef=>_0x58f4ef[_0xa765dd(0x161)])||[];if(_0x484655[_0xa765dd(0xa9)]===0x0)console[_0xa765dd(0xd4)](a30_0x54ff4a[_0xa765dd(0xab)](_0xa765dd(0x18d)));else{console['error'](a30_0x54ff4a['red'](_0xa765dd(0x1ac))),console[_0xa765dd(0xd4)]('Available\x20attributes:');for(const _0x2680c6 of _0x484655){console[_0xa765dd(0xd4)]('\x20\x20'+a30_0x54ff4a['cyan'](_0x2680c6));}console[_0xa765dd(0xd4)](_0xa765dd(0xcf)+_0x254a23+_0xa765dd(0xf4)+_0x484655[0x0]+'\x22');}return 0x1;}if(_0x724800[_0xa765dd(0x17c)]===!![]||_0x724800[_0xa765dd(0x17c)]===''){const _0x40b5b1=_0x44203e['behaviors']?.['map'](_0x26f4ff=>_0x26f4ff[_0xa765dd(0x161)])||[];if(_0x40b5b1[_0xa765dd(0xa9)]===0x0)console[_0xa765dd(0xd4)](a30_0x54ff4a['red']('Error:\x20No\x20behaviors\x20defined\x20in\x20configuration'));else{console['error'](a30_0x54ff4a['red'](_0xa765dd(0x1b3))),console['error'](_0xa765dd(0x1ed));for(const _0x40a1ea of _0x40b5b1){console[_0xa765dd(0xd4)]('\x20\x20'+a30_0x54ff4a[_0xa765dd(0x151)](_0x40a1ea));}console['error']('\x0aUsage:\x20tdx\x20ps\x20preview\x20'+_0x254a23+_0xa765dd(0x1c9)+_0x40b5b1[0x0]+'\x22');}return 0x1;}const _0x5250c6=createCommandSpinner(a30_0x54ff4a[_0xa765dd(0x10f)]('Fetching\x20sample\x20data...'),{'verbose':_0x724800['verbose']});_0x5250c6['start']();const _0x24d873={'onProgress':_0x576339=>{const _0x1c0478=_0xa765dd;_0x5250c6[_0x1c0478(0x197)]=formatProgressMessage(_0x576339);}};if(_0x724800[_0xa765dd(0xf7)])_0x24d873[_0xa765dd(0xf7)]=!![];if(_0x724800['attribute']&&typeof _0x724800['attribute']==='string')_0x24d873['attribute']=_0x724800[_0xa765dd(0x1ef)];if(_0x724800[_0xa765dd(0x17c)]&&typeof _0x724800[_0xa765dd(0x17c)]==='string')_0x24d873[_0xa765dd(0x17c)]=_0x724800[_0xa765dd(0x17c)];if(_0x724800[_0xa765dd(0xc0)])_0x24d873['enriched']=!![];if(_0x724800[_0xa765dd(0xe9)])_0x24d873[_0xa765dd(0xe9)]=_0x724800[_0xa765dd(0xe9)];let _0x9c921b;try{_0x9c921b=await _0x573904[_0xa765dd(0xfe)][_0xa765dd(0x100)](_0x53c8a7,_0x24d873),_0x5250c6[_0xa765dd(0xf9)]();}catch(_0x44401b){_0x5250c6[_0xa765dd(0xf9)]();throw _0x44401b;}return await this[_0xa765dd(0x11e)](_0x9c921b,{'master':_0x724800[_0xa765dd(0xf7)],'attribute':typeof _0x724800[_0xa765dd(0x1ef)]===_0xa765dd(0x1e1)?_0x724800[_0xa765dd(0x1ef)]:undefined,'behavior':typeof _0x724800[_0xa765dd(0x17c)]===_0xa765dd(0x1e1)?_0x724800['behavior']:undefined,'enriched':_0x724800[_0xa765dd(0xc0)]}),_0x9c921b[_0xa765dd(0x1f0)]?0x0:0x1;}async['displayPreviewResults'](_0x44e4fb,_0x19c453){const _0x1a26ee=a30_0x391a0d;console[_0x1a26ee(0xd4)]('\x0a'+a30_0x54ff4a[_0x1a26ee(0xe6)]('Preview:')+'\x20'+_0x44e4fb[_0x1a26ee(0x161)]),console[_0x1a26ee(0xd4)]('═'[_0x1a26ee(0xc9)](0x3c));if(_0x19c453[_0x1a26ee(0xf7)]&&_0x44e4fb['sampleData']){const _0x30f2b8=a30_0x54ff4a['dim'](_0x1a26ee(0xb3))+'\x20'+a30_0x54ff4a[_0x1a26ee(0xe6)](_0x44e4fb[_0x1a26ee(0xf7)]['database']+'.'+_0x44e4fb['master'][_0x1a26ee(0xcd)]);await this['displaySampleData'](_0x30f2b8,_0x44e4fb[_0x1a26ee(0x1fa)]);}else{if(_0x19c453[_0x1a26ee(0x1ef)]&&_0x44e4fb[_0x1a26ee(0x1fa)]){const _0x1751d9=a30_0x54ff4a['dim'](_0x1a26ee(0x1af))+'\x20'+a30_0x54ff4a[_0x1a26ee(0xe6)](_0x19c453[_0x1a26ee(0x1ef)]);await this['displaySampleData'](_0x1751d9,_0x44e4fb[_0x1a26ee(0x1fa)]);}else{if(_0x19c453[_0x1a26ee(0x17c)]&&_0x44e4fb['sampleData']){const _0x3d4c63=a30_0x54ff4a[_0x1a26ee(0x10f)]('Behavior:')+'\x20'+a30_0x54ff4a[_0x1a26ee(0xe6)](_0x19c453[_0x1a26ee(0x17c)]);await this['displaySampleData'](_0x3d4c63,_0x44e4fb[_0x1a26ee(0x1fa)]);}else{if(_0x19c453[_0x1a26ee(0xc0)]&&_0x44e4fb[_0x1a26ee(0x1fa)]){const _0x2b850f=a30_0x54ff4a[_0x1a26ee(0x10f)](_0x1a26ee(0x117))+'\x20'+a30_0x54ff4a[_0x1a26ee(0xe6)](_0x1a26ee(0x1e9));await this[_0x1a26ee(0x1b0)](_0x2b850f,_0x44e4fb[_0x1a26ee(0x1fa)]);}else!_0x44e4fb[_0x1a26ee(0x1fa)]&&console[_0x1a26ee(0xd4)](_0x1a26ee(0x115));}}}if(_0x44e4fb[_0x1a26ee(0x102)]['length']>0x0){console['error']('─'[_0x1a26ee(0xc9)](0x3c)),console[_0x1a26ee(0xd4)]('\x0a'+a30_0x54ff4a[_0x1a26ee(0xab)]('Errors:'));for(const _0x5c6fc3 of _0x44e4fb[_0x1a26ee(0x102)]){console[_0x1a26ee(0xd4)]('\x20\x20'+a30_0x54ff4a['red']('•')+'\x20'+_0x5c6fc3);}}}async[a30_0x391a0d(0x1b0)](_0x590761,_0xf55371){const _0x518c1b=a30_0x391a0d;if(_0xf55371[_0x518c1b(0xa9)]===0x0){console['error']('\x0a'+_0x590761),console['error'](_0x518c1b(0x1e4));return;}console[_0x518c1b(0xd4)]('\x0a'+_0x590761);const _0x3447d0=Object[_0x518c1b(0x138)](_0xf55371[0x0])[_0x518c1b(0x15b)](_0x1e0a2d=>({'name':_0x1e0a2d,'type':typeof _0xf55371[0x0][_0x1e0a2d]===_0x518c1b(0x1a9)?_0x518c1b(0x119):'varchar'})),_0x5bea7d={'queryId':_0x518c1b(0x13c),'columns':_0x3447d0,'data':_0xf55371,'stats':{'state':'FINISHED','queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0xf55371[_0x518c1b(0xa9)],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0x133cba=formatAsTable(_0x5bea7d,_0xf55371[_0x518c1b(0xa9)],!![]);await writeOutput(_0x133cba,undefined,_0x518c1b(0xcd));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{['name']=a30_0x391a0d(0x176);[a30_0x391a0d(0xaf)]='Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)';async[a30_0x391a0d(0x94)](_0x1ad214){const _0x4c10ab=a30_0x391a0d,{options:_0x5752c4,args:_0x22d0ae,tdx:_0x33f228}=_0x1ad214,_0x17721d=_0x5752c4,_0x80a89f=_0x22d0ae[0x0]||_0x5752c4[_0x4c10ab(0xd3)];if(!_0x80a89f)return showParentSegmentNotSetError(_0x4c10ab(0x11d)+_0x4c10ab(0xd2)),0x1;const _0x198e12=resolveYamlFile(_0x80a89f);if(existsSync(_0x198e12)){_0x17721d[_0x4c10ab(0x10c)]&&console['error']('Found\x20YAML\x20file:\x20'+_0x198e12);let _0x5a849d;try{_0x5a849d=readFileSync(_0x198e12,'utf-8');}catch(_0x10c496){const _0x5409ef=_0x10c496 instanceof Error?_0x10c496['message']:String(_0x10c496);return console[_0x4c10ab(0xd4)](_0x4c10ab(0x1ce)+_0x5409ef),0x1;}const _0x2e930a=await withSpinner(_0x4c10ab(0xbb),()=>_0x33f228[_0x4c10ab(0xfe)][_0x4c10ab(0x1b2)](_0x5a849d),{'verbose':_0x17721d['verbose']}),_0x51ded1=_0x2e930a[_0x4c10ab(0x9c)],{isNew:_0x4f6100,name:_0x38c509,hasChanges:_0x36942f,diffFormatted:_0x437960}=_0x51ded1;if(_0x36942f){_0x4f6100?console[_0x4c10ab(0xd4)]('\x0aNew\x20parent\x20segment\x20\x27'+_0x38c509+'\x27:'):console[_0x4c10ab(0xd4)](_0x4c10ab(0x159)+_0x38c509+'\x27:');console[_0x4c10ab(0xd4)]('─'[_0x4c10ab(0xc9)](0x3c)),console[_0x4c10ab(0xd4)](_0x437960),console[_0x4c10ab(0xd4)]('─'[_0x4c10ab(0xc9)](0x3c));const _0x45c4db=_0x4f6100?_0x4c10ab(0x141)+_0x38c509+_0x4c10ab(0x10d):_0x4c10ab(0x18e)+_0x38c509+'\x27\x20and\x20run\x20workflow?';if(!_0x17721d['yes']){if(!isInteractive())return console[_0x4c10ab(0xd4)](a30_0x54ff4a[_0x4c10ab(0xab)]('\x0aError:'),_0x4c10ab(0xe7)),console['error'](a30_0x54ff4a[_0x4c10ab(0x10f)](_0x4c10ab(0x1aa))),0x1;const _0x5f42f1=await confirmKey(_0x45c4db);if(!_0x5f42f1)return console['error'](a30_0x54ff4a[_0x4c10ab(0x112)](_0x4c10ab(0x183))),0x1;}const _0x79230f=_0x4f6100?_0x4c10ab(0x173):_0x4c10ab(0xb1);await withSpinner(_0x79230f+_0x4c10ab(0x169)+_0x38c509+_0x4c10ab(0x164),()=>_0x51ded1[_0x4c10ab(0x1c6)](),{'verbose':_0x17721d['verbose']});const _0x393506=_0x4f6100?_0x4c10ab(0xe5):'Updated';console[_0x4c10ab(0xd4)]('✔\x20'+_0x393506+'\x20parent\x20segment\x20\x27'+_0x38c509+'\x27');}else console[_0x4c10ab(0xd4)](_0x4c10ab(0x106)+_0x38c509+_0x4c10ab(0xa8));}const _0x3abe68=await withSpinner(_0x4c10ab(0x121)+_0x80a89f+_0x4c10ab(0x164),()=>_0x33f228[_0x4c10ab(0xfe)][_0x4c10ab(0x1d8)](_0x80a89f),{'verbose':_0x17721d[_0x4c10ab(0x10c)]}),_0x54f3e1=_0x3abe68['data'],_0xf8a1e=getConsoleUrl(_0x17721d['site'],_0x4c10ab(0x198)+_0x54f3e1[_0x4c10ab(0x20b)]+_0x4c10ab(0x1cf)+_0x54f3e1[_0x4c10ab(0xce)]+'/attempt/'+_0x54f3e1[_0x4c10ab(0xad)]);return console['error'](_0x4c10ab(0x1d5)),console['error']('\x20\x20'+a30_0x54ff4a[_0x4c10ab(0x10f)]('Audience\x20ID:')+'\x20'+_0x54f3e1['audienceId']),console[_0x4c10ab(0xd4)]('\x20\x20'+a30_0x54ff4a[_0x4c10ab(0x10f)](_0x4c10ab(0x124))+'\x20'+_0x54f3e1[_0x4c10ab(0xa6)]),console['error']('\x20\x20'+a30_0x54ff4a[_0x4c10ab(0x10f)]('Session:')+'\x20'+_0x54f3e1[_0x4c10ab(0xce)]),console['error']('\x20\x20'+a30_0x54ff4a[_0x4c10ab(0x10f)]('Attempt:')+'\x20'+_0x54f3e1[_0x4c10ab(0xad)]),console[_0x4c10ab(0xd4)]('\x20\x20'+_0xf8a1e),console[_0x4c10ab(0xd4)]('\x0a'+a30_0x54ff4a[_0x4c10ab(0x10f)]('To\x20cancel:')+_0x4c10ab(0x19f)+_0x54f3e1[_0x4c10ab(0xad)]+'\x20kill'),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0xae);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x9f);async['execute'](_0x3454bd){const _0x544dee=a30_0x391a0d,{options:_0xe6416c,args:_0x41a0a7,tdx:_0x105ab0}=_0x3454bd,_0x563d34=_0x41a0a7[0x0]||_0xe6416c[_0x544dee(0xd3)];if(!_0x563d34)return showParentSegmentNotSetError(_0x544dee(0xf8)+_0x544dee(0x1c1)),0x1;_0xe6416c[_0x544dee(0x10c)]&&(console[_0x544dee(0xd4)]('Site:\x20'+_0xe6416c[_0x544dee(0xaa)]),console['error']('Parent\x20segment:\x20'+_0x563d34));const _0x538e8e=await withSpinner(_0x544dee(0x19c)+_0x563d34+_0x544dee(0x164),()=>_0x105ab0[_0x544dee(0xfe)][_0x544dee(0x1be)](_0x563d34),{'verbose':_0xe6416c[_0x544dee(0x10c)]}),_0x210388=_0x538e8e[_0x544dee(0x9c)];console[_0x544dee(0xd4)](_0x544dee(0xe4)+_0x210388[_0x544dee(0xa9)]+_0x544dee(0x149)+(_0x210388['length']!==0x1?'s':''));if(_0xe6416c[_0x544dee(0x20a)]||_0xe6416c[_0x544dee(0x13d)])return await handleSDKOutput(_0x210388,_0xe6416c),0x0;return displayFieldsHumanReadable(_0x210388,_0x563d34),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0xee);['description']='Show\x20parent\x20segment\x20details';async[a30_0x391a0d(0x94)](_0x281452){const _0x1dbaee=a30_0x391a0d,{options:_0x376b4b,args:_0x4de71b,tdx:_0x62745}=_0x281452,_0x3e736c=_0x376b4b,_0x49906d=_0x4de71b[0x0]||_0x376b4b[_0x1dbaee(0xd3)];if(!_0x49906d)return showParentSegmentNotSetError(_0x1dbaee(0x179)+_0x1dbaee(0x1ff)+_0x1dbaee(0x148)+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x376b4b[_0x1dbaee(0x10c)]&&(console[_0x1dbaee(0xd4)](_0x1dbaee(0xf5)+_0x376b4b[_0x1dbaee(0xaa)]),console[_0x1dbaee(0xd4)]('Parent\x20segment:\x20'+_0x49906d));const _0x4ce74c=await withSpinner('Fetching\x20parent\x20segment\x20\x27'+_0x49906d+'\x27...',()=>_0x62745['segment'][_0x1dbaee(0x13b)](_0x49906d),{'verbose':_0x376b4b['verbose']}),_0x428e26=_0x4ce74c[_0x1dbaee(0x9c)];if(_0x3e736c[_0x1dbaee(0x1df)]){const _0x43f71b=getConsoleNextUrl(_0x3e736c['site'],_0x1dbaee(0x191)+_0x428e26['id']);return console[_0x1dbaee(0xd4)](a30_0x54ff4a['green']('✔')+_0x1dbaee(0x154)+a30_0x54ff4a[_0x1dbaee(0x151)](_0x43f71b)),openBrowser(_0x43f71b),0x0;}return await handleSingleObjectOutput(_0x428e26,_0x376b4b),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x172);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x17b);async[a30_0x391a0d(0x94)](_0x4bdbef){const _0x6b2877=a30_0x391a0d,{options:_0x563ffa,args:_0x9d83c8,tdx:_0x288ad0}=_0x4bdbef,_0xfcde96=_0x563ffa,_0x118fd9=_0x9d83c8[0x0]||_0x563ffa[_0x6b2877(0xd3)];if(!_0x118fd9)return showParentSegmentNotSetError(_0x6b2877(0xc6)+_0x6b2877(0xa2)+_0x6b2877(0x148)+_0x6b2877(0x208)),0x1;_0x563ffa[_0x6b2877(0x10c)]&&(console[_0x6b2877(0xd4)](_0x6b2877(0xf5)+_0x563ffa[_0x6b2877(0xaa)]),console[_0x6b2877(0xd4)]('Parent\x20segment:\x20'+_0x118fd9));const _0x41d7ad=await withSpinner(_0x6b2877(0x1e5)+_0x118fd9+_0x6b2877(0x164),()=>_0x288ad0[_0x6b2877(0xfe)][_0x6b2877(0x109)](_0x118fd9),{'verbose':_0x563ffa[_0x6b2877(0x10c)]}),_0x5f961b=_0x41d7ad[_0x6b2877(0x9c)],_0x213eff=_0x288ad0[_0x6b2877(0xfe)]['getOutputDatabaseName'](_0x5f961b);if(_0xfcde96['output']){const _0x25205b=await this['collectSchema'](_0x4bdbef,_0x118fd9,_0x5f961b,_0x213eff),_0x54b415=this[_0x6b2877(0x145)](_0x25205b);writeFileSync(_0xfcde96[_0x6b2877(0x142)],_0x54b415);const _0x1132e2=_0x25205b['customers'][_0x6b2877(0x201)][_0x6b2877(0xa9)]+_0x25205b[_0x6b2877(0x215)][_0x6b2877(0x1f7)]((_0x5e39d6,_0x3fb258)=>_0x5e39d6+_0x3fb258[_0x6b2877(0x201)][_0x6b2877(0xa9)],0x0),_0x28ad0e=_0x25205b['behaviors'][_0x6b2877(0x13f)](_0x32a122=>_0x32a122[_0x6b2877(0x201)][_0x6b2877(0xa9)]===0x0)['length'];return console['log'](_0x6b2877(0x157)+_0xfcde96[_0x6b2877(0x142)]),console['log']('\x20\x20Database:\x20'+_0x213eff),console[_0x6b2877(0x1c3)](_0x6b2877(0xbc)+_0x25205b[_0x6b2877(0x215)][_0x6b2877(0xa9)]+_0x6b2877(0x99)),console[_0x6b2877(0x1c3)](_0x6b2877(0xb2)+_0x1132e2+_0x6b2877(0x1bc)),_0x28ad0e>0x0&&console['log'](_0x6b2877(0x1c5)+_0x28ad0e+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console['error']('\x0a'+a30_0x54ff4a['bold'](_0x6b2877(0x1b7))+'\x20'+a30_0x54ff4a[_0x6b2877(0x151)](_0x213eff));const _0x5137dd=await withSpinner('Fetching\x20customers\x20schema...',()=>_0x288ad0[_0x6b2877(0xfe)]['getParentSQL'](_0x5f961b),{'verbose':_0x563ffa['verbose']});console[_0x6b2877(0xd4)]('\x0a'+a30_0x54ff4a['bold'](_0x6b2877(0x104))+'\x20'+a30_0x54ff4a[_0x6b2877(0x10f)]('('+_0x213eff+_0x6b2877(0x168)));const _0x453d65=await executeSchemaQuery(_0x5137dd[_0x6b2877(0x9c)],_0x288ad0,_0x563ffa);await handleQueryOutput(_0x453d65,_0x563ffa);const _0x76ba40=await withSpinner(_0x6b2877(0xcc),()=>_0x288ad0[_0x6b2877(0xfe)][_0x6b2877(0x133)](_0x5f961b),{'verbose':_0x563ffa[_0x6b2877(0x10c)]});for(const _0x396ac5 of _0x76ba40[_0x6b2877(0x9c)]){const _0x1a7332=_0x6b2877(0x1d9)+_0x396ac5[_0x6b2877(0xcb)]()[_0x6b2877(0x12a)](/\s+/g,'_'),_0x527bd6=_0x6b2877(0x163)+_0x213eff+'.'+_0x1a7332;console[_0x6b2877(0xd4)]('\x0a'+a30_0x54ff4a[_0x6b2877(0xe6)](_0x396ac5)+'\x20'+a30_0x54ff4a[_0x6b2877(0x10f)]('('+_0x213eff+'.'+_0x1a7332+')'));try{const _0xdf6e13=await executeSchemaQuery(_0x527bd6,_0x288ad0,_0x563ffa);await handleQueryOutput(_0xdf6e13,_0x563ffa);}catch{console[_0x6b2877(0xd4)](a30_0x54ff4a[_0x6b2877(0x112)](_0x6b2877(0x19a)));}}return 0x0;}async[a30_0x391a0d(0xff)](_0x3d6c33,_0x2087f4,_0x1cea7c,_0x597bbe){const _0x4f6b3a=a30_0x391a0d,{options:_0x3aa329,tdx:_0x3639cc}=_0x3d6c33,_0x33022f=await withSpinner(_0x4f6b3a(0x1fb),()=>_0x3639cc[_0x4f6b3a(0xfe)][_0x4f6b3a(0x153)](_0x1cea7c),{'verbose':_0x3aa329[_0x4f6b3a(0x10c)]}),_0x3c0a9c=await executeSchemaQuery(_0x33022f[_0x4f6b3a(0x9c)],_0x3639cc,_0x3aa329),_0x2574bd=_0x3c0a9c[_0x4f6b3a(0x9c)][_0x4f6b3a(0x15b)](_0x241f34=>({'name':_0x241f34[_0x4f6b3a(0x1bd)],'type':_0x241f34[_0x4f6b3a(0xbf)]})),_0x300b07=await withSpinner(_0x4f6b3a(0xcc),()=>_0x3639cc[_0x4f6b3a(0xfe)][_0x4f6b3a(0x133)](_0x1cea7c),{'verbose':_0x3aa329[_0x4f6b3a(0x10c)]}),_0x2a5a10=[];for(const _0x10bfbc of _0x300b07[_0x4f6b3a(0x9c)]){const _0x2ca6cb=_0x4f6b3a(0x1d9)+_0x10bfbc[_0x4f6b3a(0xcb)]()[_0x4f6b3a(0x12a)](/\s+/g,'_'),_0x4c5ff9=_0x4f6b3a(0x163)+_0x597bbe+'.'+_0x2ca6cb;let _0x3c28f3=[];try{const _0x2f67c5=await executeSchemaQuery(_0x4c5ff9,_0x3639cc,_0x3aa329);_0x3c28f3=_0x2f67c5[_0x4f6b3a(0x9c)]['map'](_0x4fe175=>({'name':_0x4fe175[_0x4f6b3a(0x1bd)],'type':_0x4fe175[_0x4f6b3a(0xbf)]}));}catch{}_0x2a5a10[_0x4f6b3a(0x1a6)]({'table':_0x2ca6cb,'columns':_0x3c28f3});}return{'database':_0x597bbe,'parent_segment':_0x2087f4,'parent_id':_0x1cea7c,'customers':{'table':'customers','columns':_0x2574bd},'behaviors':_0x2a5a10};}[a30_0x391a0d(0x145)](_0x16d4ef){const _0x1e749a=a30_0x391a0d,_0x1e00a1=_0x46e6e6=>{const _0x3ef2fa=a30_0x48a9;if(_0x46e6e6[_0x3ef2fa(0xa9)]===0x0)return'[]';const _0x28a5ce=_0x46e6e6[_0x3ef2fa(0x15b)](_0xf50ee5=>_0x3ef2fa(0x18a)+_0xf50ee5[_0x3ef2fa(0x161)]+_0x3ef2fa(0xf1)+_0xf50ee5['type']+'\x22\x20}');return'[\x0a'+_0x28a5ce[_0x3ef2fa(0xa0)](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x4cdbbf=_0x16d4ef[_0x1e749a(0x215)][_0x1e749a(0x15b)](_0x574962=>{const _0x2a2733=_0x1e749a;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x574962[_0x2a2733(0xcd)]+_0x2a2733(0x1eb)+_0x1e00a1(_0x574962[_0x2a2733(0x201)])[_0x2a2733(0x12a)](/^/gm,'\x20\x20')['trim']()+_0x2a2733(0xb9);})[_0x1e749a(0xa0)](',\x0a');return'{\x0a\x20\x20\x22database\x22:\x20\x22'+_0x16d4ef[_0x1e749a(0x1e6)]+_0x1e749a(0x1a5)+_0x16d4ef['parent_segment']+_0x1e749a(0xa4)+_0x16d4ef[_0x1e749a(0x1e2)]+_0x1e749a(0x1c0)+_0x16d4ef['customers'][_0x1e749a(0xcd)]+_0x1e749a(0x1f5)+_0x1e00a1(_0x16d4ef['customers'][_0x1e749a(0x201)])[_0x1e749a(0x12a)](/^/gm,'\x20\x20')[_0x1e749a(0xb7)]()+_0x1e749a(0xa5)+_0x4cdbbf+'\x0a\x20\x20]\x0a}\x0a';}}export class ParentSegmentSQLCommand extends BaseCommand{[a30_0x391a0d(0x161)]='segment:parent:sql';[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x155);async[a30_0x391a0d(0x94)](_0x99f3e2){const _0x53ccc4=a30_0x391a0d,{options:_0x9e2d09,args:_0x1a8e2d,tdx:_0x20d329}=_0x99f3e2,_0x18fa02=_0x1a8e2d[0x0]||_0x9e2d09[_0x53ccc4(0xd3)];if(!_0x18fa02)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a'+_0x53ccc4(0x171)),0x1;_0x9e2d09[_0x53ccc4(0x10c)]&&(console[_0x53ccc4(0xd4)](_0x53ccc4(0xf5)+_0x9e2d09[_0x53ccc4(0xaa)]),console[_0x53ccc4(0xd4)]('Parent\x20segment:\x20'+_0x18fa02));const _0x419277=await withSpinner(_0x53ccc4(0x1e5)+_0x18fa02+_0x53ccc4(0x164),()=>_0x20d329[_0x53ccc4(0xfe)][_0x53ccc4(0x109)](_0x18fa02),{'verbose':_0x9e2d09[_0x53ccc4(0x10c)]}),_0x4cf829=_0x419277[_0x53ccc4(0x9c)],_0x7409a0=await withSpinner(_0x53ccc4(0x12d)+_0x18fa02+_0x53ccc4(0x164),()=>_0x20d329[_0x53ccc4(0xfe)][_0x53ccc4(0x153)](_0x4cf829),{'verbose':_0x9e2d09[_0x53ccc4(0x10c)]}),_0xb681f9=_0x7409a0[_0x53ccc4(0x9c)];return _0x9e2d09[_0x53ccc4(0xe0)]==='json'||_0x9e2d09[_0x53ccc4(0xe0)]===_0x53ccc4(0x13d)?await handleSDKOutput([{'sql':_0xb681f9}],_0x9e2d09):console[_0x53ccc4(0x1c3)](_0xb681f9),0x0;}}export class ParentSegmentShowCommand extends BaseCommand{['name']=a30_0x391a0d(0x136);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x128);async[a30_0x391a0d(0x94)](_0x43e02d){const _0x1de051=a30_0x391a0d,{options:_0x366334,args:_0x212dc3,tdx:_0x16be82}=_0x43e02d,_0x3f111b=_0x212dc3[0x0]||_0x366334['parentSegment'];if(!_0x3f111b)return showParentSegmentNotSetError(_0x1de051(0x135)+_0x1de051(0xf6)),0x1;_0x366334[_0x1de051(0x10c)]&&(console[_0x1de051(0xd4)](_0x1de051(0xf5)+_0x366334[_0x1de051(0xaa)]),console[_0x1de051(0xd4)](_0x1de051(0x1b9)+_0x3f111b));const _0x1444cc=await withSpinner(_0x1de051(0x1e5)+_0x3f111b+'\x27...',()=>_0x16be82[_0x1de051(0xfe)][_0x1de051(0x109)](_0x3f111b),{'verbose':_0x366334[_0x1de051(0x10c)]}),_0x3d605d=_0x1444cc[_0x1de051(0x9c)],_0x23f8ad=await withSpinner(_0x1de051(0x12d)+_0x3f111b+_0x1de051(0x164),()=>_0x16be82['segment'][_0x1de051(0x153)](_0x3d605d),{'verbose':_0x366334['verbose']});let _0x2ac29b=_0x23f8ad['data'];const _0xe57078=resolveLimit(_0x366334[_0x1de051(0xea)],DEFAULT_DISPLAY_LIMIT),_0x6a3e31=/\bLIMIT\s+\d+/i[_0x1de051(0xfb)](_0x2ac29b);!_0x6a3e31&&(_0x2ac29b=_0x2ac29b['trim']()[_0x1de051(0x12a)](/;+$/,''),_0x2ac29b=_0x1de051(0xd0)+_0x2ac29b+_0x1de051(0x1ae)+_0xe57078);_0x366334['verbose']&&console[_0x1de051(0xd4)](_0x1de051(0x177)+_0x2ac29b);const _0x19229e=await withProgressSpinner('Executing\x20parent\x20segment\x20query...',async _0x304321=>{const _0x385983=_0x1de051,_0xf68d8a=await _0x16be82['query'][_0x385983(0x94)](_0x2ac29b,{'catalog':'td','schema':_0x385983(0xe8),'onJobId':_0x2b62d4=>{const _0x33ec05=_0x385983;_0x304321[_0x33ec05(0x14e)](_0x2b62d4);}});return _0xf68d8a;},{'verbose':_0x366334[_0x1de051(0x10c)]}),_0x2667ad=_0x19229e[_0x1de051(0x9c)],_0x109ff4=_0x2667ad['jobId']?_0x1de051(0xba)+_0x2667ad[_0x1de051(0x18b)]+']':'';return console[_0x1de051(0xd4)](_0x1de051(0x19b)+_0x2667ad[_0x1de051(0x14d)][_0x1de051(0x204)][_0x1de051(0x20d)]()+_0x1de051(0xfd)+('in\x20'+formatElapsed(_0x2667ad[_0x1de051(0x14d)][_0x1de051(0x1b8)])+_0x109ff4)),await handleQueryOutput(_0x2667ad,_0x366334),0x0;}}export class PSRtListCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x1dc);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x11f);async[a30_0x391a0d(0x94)](_0x24ba48){const _0x1a08f0=a30_0x391a0d,{options:_0x42c1cb,args:_0xe5552d,tdx:_0x2f2855}=_0x24ba48,_0x26ecff=_0xe5552d[0x0],_0x2a4d3b=await withSpinner(_0x26ecff?'Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27'+_0x26ecff+_0x1a08f0(0x164):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x2f2855['realtime'][_0x1a08f0(0xfa)](),{'verbose':_0x42c1cb[_0x1a08f0(0x10c)]});let _0x119651=_0x2a4d3b[_0x1a08f0(0x9c)][_0x1a08f0(0x13f)](_0x26835b=>_0x26835b[_0x1a08f0(0x1cd)]);if(_0x26ecff){const _0x18844d=_0x26ecff[_0x1a08f0(0x12a)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1a08f0(0x12a)](/\*/g,'.*')[_0x1a08f0(0x12a)](/\?/g,'.'),_0x2bf0d6=new RegExp('^'+_0x18844d+'$','i');_0x119651=_0x119651[_0x1a08f0(0x13f)](_0x5e8268=>_0x2bf0d6[_0x1a08f0(0xfb)](_0x5e8268['name']));}_0x119651[_0x1a08f0(0x166)]((_0x52158d,_0x55bf08)=>_0x52158d[_0x1a08f0(0x161)]['localeCompare'](_0x55bf08['name'])),console['error'](_0x1a08f0(0xe4)+_0x119651[_0x1a08f0(0xa9)]+_0x1a08f0(0xb6)+(_0x119651[_0x1a08f0(0xa9)]!==0x1?'s':''));const _0x7f5fcd=_0x2d6434=>{const _0x5cbe11=_0x1a08f0;return getConsoleNextUrl(_0x42c1cb[_0x5cbe11(0xaa)],_0x5cbe11(0x191)+_0x2d6434);};if(_0x42c1cb[_0x1a08f0(0xe0)]==='json'||_0x42c1cb[_0x1a08f0(0xe0)]==='jsonl'){const _0x53bdb1=_0x119651['map'](_0x511ac3=>({..._0x511ac3,'url':_0x7f5fcd(_0x511ac3['id'])}));await handleSDKOutput(_0x53bdb1,_0x42c1cb);}else{if(_0x119651[_0x1a08f0(0xa9)]===0x0)console['log']('No\x20RT-enabled\x20parent\x20segments\x20found');else for(const _0x3e7798 of _0x119651){const _0x4d2efc=_0x3e7798[_0x1a08f0(0x1d6)]?a30_0x54ff4a[_0x1a08f0(0x10f)]('\x20('+formatRows(_0x3e7798[_0x1a08f0(0x1d6)])+')'):'',_0x3526c5=hyperlink(_0x3e7798[_0x1a08f0(0x161)],_0x7f5fcd(_0x3e7798['id']));console[_0x1a08f0(0x1c3)]('⚡\x20'+_0x3526c5+_0x4d2efc);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x16e);['description']=a30_0x391a0d(0x114);async[a30_0x391a0d(0x94)](_0x476b82){const _0x4b5f16=a30_0x391a0d,{options:_0x5aca36,args:_0x355d9c,tdx:_0x254628}=_0x476b82,_0x3e0ea1=_0x355d9c[0x0]||_0x5aca36['parentSegment'];if(!_0x3e0ea1)return showParentSegmentNotSetError(_0x4b5f16(0x130)+_0x4b5f16(0x16c)),0x1;const _0x11c140=resolveYamlFile(_0x3e0ea1);if(!existsSync(_0x11c140))return showFileNotFoundError(_0x11c140,_0x3e0ea1),0x1;let _0x256eb1;try{_0x256eb1=readFileSync(_0x11c140,_0x4b5f16(0x1ea));}catch(_0x1602da){const _0x5a6c43=_0x1602da instanceof Error?_0x1602da[_0x4b5f16(0x140)]:String(_0x1602da);return console[_0x4b5f16(0xd4)](_0x4b5f16(0x1ce)+_0x5a6c43),0x1;}const _0x40a075=createCommandSpinner(a30_0x54ff4a[_0x4b5f16(0x10f)]('Validating\x20RT\x20configuration...'),{'verbose':_0x5aca36[_0x4b5f16(0x10c)]});_0x40a075['start']();const _0x4a6a79={'realtime':!![],'onProgress':_0x302941=>{_0x40a075['text']=formatProgressMessage(_0x302941);}};let _0x9cbf54;try{_0x9cbf54=await _0x254628[_0x4b5f16(0xfe)][_0x4b5f16(0x18c)](_0x256eb1,_0x4a6a79),_0x40a075[_0x4b5f16(0xf9)]();}catch(_0x5e431a){_0x40a075[_0x4b5f16(0xf9)]();throw _0x5e431a;}console[_0x4b5f16(0xd4)]('\x0a'+a30_0x54ff4a[_0x4b5f16(0xe6)](_0x4b5f16(0x1f8))+'\x20'+_0x9cbf54[_0x4b5f16(0x161)]),console[_0x4b5f16(0xd4)]('═'[_0x4b5f16(0xc9)](0x3c)),displayRealtimeValidation(_0x9cbf54),console[_0x4b5f16(0xd4)]('─'[_0x4b5f16(0xc9)](0x3c));if(_0x9cbf54[_0x4b5f16(0x102)][_0x4b5f16(0xa9)]>0x0){console['error']('\x0a'+a30_0x54ff4a['red'](_0x4b5f16(0x105)));for(const _0x2fa57d of _0x9cbf54[_0x4b5f16(0x102)]){console['error']('\x20\x20'+a30_0x54ff4a[_0x4b5f16(0xab)]('•')+'\x20'+_0x2fa57d);}}return _0x9cbf54['allValid']&&console['error']('\x0a'+a30_0x54ff4a[_0x4b5f16(0xb8)]('✔')+'\x20RT\x20configuration\x20is\x20valid'),_0x9cbf54['allValid']?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x15f);[a30_0x391a0d(0xaf)]=a30_0x391a0d(0x14a);async['execute'](_0x2a65c8){const _0x298a93=a30_0x391a0d,{options:_0x3f81b2,args:_0x538ea6,tdx:_0x4857dd}=_0x2a65c8,_0x2745f0=_0x538ea6[0x0]||_0x3f81b2[_0x298a93(0xd3)];if(!_0x2745f0)return showParentSegmentNotSetError(_0x298a93(0x108)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment'),0x1;const _0x1fde25=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2745f0+_0x298a93(0x164),()=>_0x4857dd[_0x298a93(0xfe)]['resolveParentId'](_0x2745f0),{'verbose':_0x3f81b2['verbose']}),_0x5a26ce=_0x1fde25['data'],_0x2226b7=await withSpinner(_0x298a93(0xb0)+_0x2745f0+_0x298a93(0x164),()=>_0x4857dd[_0x298a93(0x200)][_0x298a93(0xfa)](_0x5a26ce),{'verbose':_0x3f81b2[_0x298a93(0x10c)]}),_0x58b89e=_0x2226b7['data'];console[_0x298a93(0xd4)](_0x298a93(0xe4)+_0x58b89e[_0x298a93(0xa9)]+'\x20personalization\x20service'+(_0x58b89e[_0x298a93(0xa9)]!==0x1?'s':''));if(_0x3f81b2[_0x298a93(0xe0)]===_0x298a93(0x20a)||_0x3f81b2[_0x298a93(0xe0)]===_0x298a93(0x13d))await handleSDKOutput(_0x58b89e,_0x3f81b2);else{if(_0x58b89e['length']===0x0)console['log'](_0x298a93(0x15a)),console[_0x298a93(0xd4)](a30_0x54ff4a[_0x298a93(0x151)](_0x298a93(0xa7)));else for(const _0x2c86a7 of _0x58b89e){const _0x14d4e4=_0x2c86a7[_0x298a93(0x1dd)]?.[_0x298a93(0xa9)]||0x0,_0x57e785=_0x2c86a7[_0x298a93(0x9d)]?a30_0x54ff4a[_0x298a93(0x10f)](_0x298a93(0x12f)+_0x2c86a7['trigger_event']):'',_0x420e04=a30_0x54ff4a[_0x298a93(0x10f)]('\x20('+_0x14d4e4+'\x20section'+(_0x14d4e4!==0x1?'s':'')+')');console['log']('\x20\x20'+_0x2c86a7[_0x298a93(0x161)]+_0x57e785+_0x420e04),_0x2c86a7[_0x298a93(0xaf)]&&console[_0x298a93(0x1c3)]('\x20\x20\x20\x20'+a30_0x54ff4a[_0x298a93(0x10f)](_0x2c86a7['description']));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a30_0x391a0d(0x161)]=a30_0x391a0d(0x1d1);[a30_0x391a0d(0xaf)]='Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML';async[a30_0x391a0d(0x94)](_0x1ad917){const _0x5d46c7=a30_0x391a0d,{options:_0x5debf1,args:_0x482ebc}=_0x1ad917,_0x5ac28e=_0x482ebc[0x0]||_0x5debf1[_0x5d46c7(0xd3)];if(!_0x5ac28e)return showParentSegmentNotSetError(_0x5d46c7(0xb5)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0xcfcc1e=resolveYamlFile(_0x5ac28e);if(!existsSync(_0xcfcc1e))return showFileNotFoundError(_0xcfcc1e,_0x5ac28e),0x1;let _0x3d90da;try{_0x3d90da=readFileSync(_0xcfcc1e,'utf-8');}catch(_0x1fd78c){const _0x16895d=_0x1fd78c instanceof Error?_0x1fd78c[_0x5d46c7(0x140)]:String(_0x1fd78c);return console['error'](_0x5d46c7(0x1ce)+_0x16895d),0x1;}let _0x1beb1a;try{_0x1beb1a=parseDef(_0x3d90da);}catch(_0x516997){const _0x2e1ddf=_0x516997 instanceof Error?_0x516997['message']:String(_0x516997);return console['error'](a30_0x54ff4a[_0x5d46c7(0xab)](_0x5d46c7(0xf2)+_0x2e1ddf)),0x1;}if(_0x1beb1a[_0x5d46c7(0x182)]&&_0x1beb1a[_0x5d46c7(0x182)][_0x5d46c7(0xa9)]>0x0)return console['error'](a30_0x54ff4a[_0x5d46c7(0x112)]('⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20'+_0xcfcc1e)),console[_0x5d46c7(0xd4)](a30_0x54ff4a[_0x5d46c7(0x10f)]('\x20\x20\x20'+_0x1beb1a[_0x5d46c7(0x182)][_0x5d46c7(0xa9)]+_0x5d46c7(0xd9))),0x1;!_0x1beb1a[_0x5d46c7(0x1ca)]&&(_0x1beb1a[_0x5d46c7(0x1ca)]={'events':[{'name':_0x5d46c7(0x1ee),'source_table':_0x5d46c7(0x143)}],'attributes':[{'name':'last_page_viewed','type':_0x5d46c7(0x120)}],'id_stitching':{'primary_key':_0x1beb1a[_0x5d46c7(0xf7)]['table']===_0x5d46c7(0x104)?'td_client_id':_0x5d46c7(0x1cb)}});_0x1beb1a[_0x5d46c7(0x182)]=[{'name':'My\x20Service','description':'Personalization\x20service\x20description','trigger_event':_0x5d46c7(0x1ee),'sections':[{'name':_0x5d46c7(0xa1),'criteria':_0x5d46c7(0x205),'attributes':[_0x5d46c7(0x1f2)]}]}];const _0x452a3a=serializeDef(_0x1beb1a);return writeFileSync(_0xcfcc1e,_0x452a3a,_0x5d46c7(0x1ea)),console['error'](a30_0x54ff4a[_0x5d46c7(0xb8)]('✔')+'\x20Added\x20personalization\x20template\x20to\x20'+a30_0x54ff4a['cyan'](_0xcfcc1e)),(!_0x1beb1a['realtime']||_0x3d90da['indexOf'](_0x5d46c7(0x127))===-0x1)&&console['error'](a30_0x54ff4a[_0x5d46c7(0xb8)]('✔')+_0x5d46c7(0xbd)),console['error']('\x0a'+a30_0x54ff4a[_0x5d46c7(0x10f)](_0x5d46c7(0xd7))),console[_0x5d46c7(0xd4)](_0x5d46c7(0x211)+_0xcfcc1e+_0x5d46c7(0x101)),console['error']('\x20\x202.\x20Run\x20'+a30_0x54ff4a['dim'](_0x5d46c7(0xca)+_0x5ac28e)+_0x5d46c7(0x174)),0x0;}}
1
+ const a30_0x4c2f14=a30_0x5265;(function(_0x23b9a9,_0x4425d0){const _0x5c888a=a30_0x5265,_0x522749=_0x23b9a9();while(!![]){try{const _0x3a63a8=parseInt(_0x5c888a(0x235))/0x1+parseInt(_0x5c888a(0x115))/0x2*(parseInt(_0x5c888a(0x204))/0x3)+-parseInt(_0x5c888a(0x16e))/0x4*(parseInt(_0x5c888a(0x1c3))/0x5)+parseInt(_0x5c888a(0x1fe))/0x6+parseInt(_0x5c888a(0x1fb))/0x7+-parseInt(_0x5c888a(0x18a))/0x8+-parseInt(_0x5c888a(0x1ef))/0x9*(parseInt(_0x5c888a(0x1ec))/0xa);if(_0x3a63a8===_0x4425d0)break;else _0x522749['push'](_0x522749['shift']());}catch(_0x296e60){_0x522749['push'](_0x522749['shift']());}}}(a30_0x22a5,0xf13ea));import{writeFileSync,readFileSync,existsSync,mkdirSync,renameSync,statSync}from'fs';import{spawn}from'child_process';import a30_0x1eec83 from'path';import{BaseCommand}from'./command.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput,writeOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,createCommandSpinner,formatElapsed}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{getConsoleUrl,getConsoleNextUrl}from'../sdk/client/endpoints.js';import{formatRows,formatAsTable,hyperlink}from'../sdk/util/formatters.js';import{parseDef,serializeDef}from'../sdk/segment/parent-segment-yaml.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import a30_0x29defe from'chalk';import{displayFieldsHumanReadable,executeSchemaQuery}from'../sdk/segment/fields-display.js';function a30_0x5265(_0x4337a3,_0x27c509){_0x4337a3=_0x4337a3-0xf0;const _0x22a56c=a30_0x22a5();let _0x52656f=_0x22a56c[_0x4337a3];return _0x52656f;}import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';const PARENT_SEGMENT_DIR=a30_0x4c2f14(0x26b),LEGACY_PARENT_SEGMENT_DIR=a30_0x4c2f14(0x1fc);function openBrowser(_0x18bc94){const _0x509719=a30_0x4c2f14,_0x3e8106=process['platform'],_0x53a041=_0x3e8106===_0x509719(0x1eb)?_0x509719(0x253):_0x3e8106===_0x509719(0xfb)?'start':_0x509719(0x104);spawn(_0x53a041,[_0x18bc94],{'detached':!![],'stdio':_0x509719(0x13a)})[_0x509719(0x1b8)]();}function migrateLegacyDirectory(){const _0x2a1bbe=a30_0x4c2f14;if(!existsSync(LEGACY_PARENT_SEGMENT_DIR))return![];const _0x542ed4=statSync(LEGACY_PARENT_SEGMENT_DIR);if(!_0x542ed4['isDirectory']())return![];if(existsSync(PARENT_SEGMENT_DIR))return console[_0x2a1bbe(0x1a2)](a30_0x29defe['yellow']('\x0a⚠️\x20\x20Both\x20'+LEGACY_PARENT_SEGMENT_DIR+_0x2a1bbe(0x136)+PARENT_SEGMENT_DIR+_0x2a1bbe(0x1c2))),console[_0x2a1bbe(0x1a2)](a30_0x29defe[_0x2a1bbe(0x277)](_0x2a1bbe(0x267)+LEGACY_PARENT_SEGMENT_DIR+_0x2a1bbe(0x156))),![];console[_0x2a1bbe(0x1a2)](a30_0x29defe['yellow'](_0x2a1bbe(0x161)+LEGACY_PARENT_SEGMENT_DIR+_0x2a1bbe(0x1ab)+PARENT_SEGMENT_DIR+'/\x0a'));try{return renameSync(LEGACY_PARENT_SEGMENT_DIR,PARENT_SEGMENT_DIR),console[_0x2a1bbe(0x1a2)](a30_0x29defe[_0x2a1bbe(0x1c9)](_0x2a1bbe(0xf9)+PARENT_SEGMENT_DIR+'/\x0a')),!![];}catch(_0x2e490a){const _0x2e2983=_0x2e490a instanceof Error?_0x2e490a[_0x2a1bbe(0x19c)]:String(_0x2e490a);return console[_0x2a1bbe(0x1a2)](a30_0x29defe[_0x2a1bbe(0x11d)](_0x2a1bbe(0x19f)+_0x2e2983+'\x0a')),![];}}class BaseParentSegmentCommand extends BaseCommand{async[a30_0x4c2f14(0x26a)](_0x3d28a6){return migrateLegacyDirectory(),super['run'](_0x3d28a6);}}function resolveYamlFile(_0x13ec69){const _0x563da2=a30_0x4c2f14;if(_0x13ec69[_0x563da2(0x143)](_0x563da2(0x122))||_0x13ec69[_0x563da2(0x143)]('.yaml'))return _0x13ec69;return a30_0x1eec83[_0x563da2(0x25f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x13ec69)+'.yml');}function formatProgressMessage(_0x4352be){const _0x167651=a30_0x4c2f14,_0xedc309=_0x4352be[_0x167651(0x278)](/^(.+?):\s*(.+?)(\s*\(.+\))?$/);if(_0xedc309){const [,_0x1307af,_0x17cb5e,_0xdff0ec='']=_0xedc309;return a30_0x29defe[_0x167651(0x277)](_0x1307af+':')+'\x20'+_0x17cb5e+a30_0x29defe[_0x167651(0x277)](_0xdff0ec);}return a30_0x29defe['dim'](_0x4352be);}function showFileNotFoundError(_0x1d0634,_0x5109ef){const _0x466b5a=a30_0x4c2f14;console[_0x466b5a(0x1a2)](a30_0x29defe[_0x466b5a(0x11d)]('Error:\x20File\x20not\x20found:\x20'+_0x1d0634+'\x0a')),console[_0x466b5a(0x1a2)](a30_0x29defe[_0x466b5a(0x1da)]('Tip:\x20Run\x20`tdx\x20ps\x20pull\x20-u\x20'+_0x5109ef+_0x466b5a(0x133)));}function displayRealtimeValidation(_0x441788){const _0xc03d28=a30_0x4c2f14;if(!_0x441788[_0xc03d28(0x228)])return;const _0x12e11b=_0x441788[_0xc03d28(0x228)],_0x20336f=_0x12e11b[_0xc03d28(0x195)]?a30_0x29defe['green'](_0xc03d28(0x172)):a30_0x29defe[_0xc03d28(0x178)](_0xc03d28(0x263));console[_0xc03d28(0x1a2)]('\x0a'+a30_0x29defe[_0xc03d28(0x277)](_0xc03d28(0x237))+'\x20'+_0x20336f);if(_0x12e11b['events']&&_0x12e11b[_0xc03d28(0x215)][_0xc03d28(0x25e)]>0x0){console[_0xc03d28(0x1a2)]('\x20\x20'+a30_0x29defe[_0xc03d28(0x277)]('Events:')+'\x20'+_0x12e11b['events'][_0xc03d28(0x25e)]+_0xc03d28(0x1bf));for(const _0x1974d9 of _0x12e11b[_0xc03d28(0x215)]){const _0xa46096=_0x1974d9[_0xc03d28(0x12e)]===![]?a30_0x29defe[_0xc03d28(0x11d)]('✘'):a30_0x29defe['green']('✔');console[_0xc03d28(0x1a2)](_0xc03d28(0x130)+_0xa46096+'\x20'+_0x1974d9[_0xc03d28(0x202)]),_0x1974d9['sourceTableError']&&console[_0xc03d28(0x1a2)]('\x20\x20\x20\x20\x20\x20'+a30_0x29defe[_0xc03d28(0x11d)](_0x1974d9[_0xc03d28(0x24d)]));}}if(_0x12e11b[_0xc03d28(0x175)]&&_0x12e11b[_0xc03d28(0x175)][_0xc03d28(0x25e)]>0x0){console[_0xc03d28(0x1a2)]('\x20\x20'+a30_0x29defe['dim']('Attributes:')+'\x20'+_0x12e11b[_0xc03d28(0x175)][_0xc03d28(0x25e)]+_0xc03d28(0x1bf));for(const _0x37cae7 of _0x12e11b['attributes']){const _0x497a5e=_0x37cae7[_0xc03d28(0x176)]?a30_0x29defe[_0xc03d28(0x1c9)]('✔'):a30_0x29defe['red']('✘');console['error'](_0xc03d28(0x130)+_0x497a5e+'\x20'+_0x37cae7[_0xc03d28(0x202)]+'\x20'+a30_0x29defe[_0xc03d28(0x277)]('('+_0x37cae7['type']+')'));}}if(_0x12e11b[_0xc03d28(0x198)]){const _0x1c345e=_0x12e11b[_0xc03d28(0x198)]['stitchingKeys']?.['length']?_0xc03d28(0x15f)+_0x12e11b[_0xc03d28(0x198)]['stitchingKeys'][_0xc03d28(0x25f)](',\x20')+']':'';console[_0xc03d28(0x1a2)]('\x20\x20'+a30_0x29defe[_0xc03d28(0x277)]('ID\x20Stitching:')+'\x20'+_0x12e11b[_0xc03d28(0x198)][_0xc03d28(0x13d)]+_0x1c345e);}if(_0x12e11b['personalizationServices']&&_0x12e11b[_0xc03d28(0x132)]['length']>0x0){console['error']('\x20\x20'+a30_0x29defe[_0xc03d28(0x277)]('Personalization:')+'\x20'+_0x12e11b[_0xc03d28(0x132)][_0xc03d28(0x25e)]+'\x20service'+(_0x12e11b[_0xc03d28(0x132)][_0xc03d28(0x25e)]!==0x1?'s':''));for(const _0x3b33bf of _0x12e11b['personalizationServices']){console[_0xc03d28(0x1a2)]('\x20\x20\x20\x20-\x20'+_0x3b33bf[_0xc03d28(0x202)]);}}}function showParentSegmentNotSetError(_0x5820ca){const _0x329cdf=a30_0x4c2f14;console['error'](a30_0x29defe[_0x329cdf(0x178)](_0x329cdf(0x11e))),console['error'](_0x5820ca);}export class ParentSegmentListCommand extends BaseCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x23f);[a30_0x4c2f14(0x20e)]='List\x20parent\x20segments';async['execute'](_0x4714d3){const _0x3e6e9f=a30_0x4c2f14,{options:_0x5a33a1,args:_0x4ce601,tdx:_0x12a61a}=_0x4714d3,_0x1b7bf6=_0x4ce601[0x0];_0x5a33a1['verbose']&&(console[_0x3e6e9f(0x1a2)](_0x3e6e9f(0x184)+_0x5a33a1[_0x3e6e9f(0x260)]),_0x1b7bf6&&console[_0x3e6e9f(0x1a2)](_0x3e6e9f(0xf1)+_0x1b7bf6));const _0x3b807d=await withSpinner(_0x1b7bf6?'Listing\x20parent\x20segments\x20matching\x20\x27'+_0x1b7bf6+_0x3e6e9f(0x17c):'Listing\x20parent\x20segments...',()=>_0x12a61a[_0x3e6e9f(0x160)][_0x3e6e9f(0x11f)](),{'verbose':_0x5a33a1[_0x3e6e9f(0x248)]});let _0x1042eb=_0x3b807d['data'];if(_0x1b7bf6){const _0x48c611=_0x1b7bf6['replace'](/[.+^${}()|[\]\\]/g,_0x3e6e9f(0x279))['replace'](/\*/g,'.*')[_0x3e6e9f(0x241)](/\?/g,'.'),_0x1a2c4b=new RegExp('^'+_0x48c611+'$','i');_0x1042eb=_0x1042eb[_0x3e6e9f(0x262)](_0x674895=>_0x1a2c4b['test'](_0x674895[_0x3e6e9f(0x175)]['name']));}_0x1042eb['sort']((_0x1177d2,_0xcf65f8)=>_0x1177d2[_0x3e6e9f(0x175)]['name'][_0x3e6e9f(0x120)](_0xcf65f8[_0x3e6e9f(0x175)]['name'])),console[_0x3e6e9f(0x1a2)]('✔\x20Found\x20'+_0x1042eb[_0x3e6e9f(0x25e)]+_0x3e6e9f(0x272)+(_0x1042eb['length']!==0x1?'s':''));const _0xa87128=_0x4084bd=>{const _0x43c6d2=_0x3e6e9f;return getConsoleNextUrl(_0x5a33a1[_0x43c6d2(0x260)],_0x43c6d2(0x13e)+_0x4084bd);};if(_0x5a33a1[_0x3e6e9f(0x174)]===_0x3e6e9f(0x1a6)||_0x5a33a1['format']===_0x3e6e9f(0x19d)){const _0x22e3ce=_0x1042eb[_0x3e6e9f(0x22a)](_0x59cdbc=>({..._0x59cdbc,'url':_0xa87128(_0x59cdbc['id'])}));await handleSDKOutput(_0x22e3ce,_0x5a33a1);}else{if(_0x1042eb[_0x3e6e9f(0x25e)]===0x0)_0x1b7bf6?console[_0x3e6e9f(0x140)](_0x3e6e9f(0x242)+_0x1b7bf6):console['log']('No\x20parent\x20segments\x20found');else for(const _0x288be1 of _0x1042eb){const _0x4e8ea=_0x288be1[_0x3e6e9f(0x175)]['population']?a30_0x29defe[_0x3e6e9f(0x277)]('\x20('+formatRows(_0x288be1[_0x3e6e9f(0x175)][_0x3e6e9f(0x227)])+')'):'',_0xf14ea9=hyperlink(_0x288be1[_0x3e6e9f(0x175)][_0x3e6e9f(0x202)],_0xa87128(_0x288be1['id']));console['log'](_0x3e6e9f(0x221)+_0xf14ea9+_0x4e8ea);}}return 0x0;}}export class ParentSegmentCreateCommand extends BaseCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x189);[a30_0x4c2f14(0x20e)]='Create\x20new\x20parent\x20segment\x20(audience)\x20[DEPRECATED]';async[a30_0x4c2f14(0x23c)](_0x121ebc){const _0x3ca4a8=a30_0x4c2f14,{options:_0x45ef4c,args:_0x45ac82,tdx:_0x29b9a2}=_0x121ebc;console[_0x3ca4a8(0x1a2)](_0x3ca4a8(0x1e9)+_0x3ca4a8(0x1e4)+_0x3ca4a8(0x26c));const _0x4e7964=_0x45ef4c;if(_0x45ac82[_0x3ca4a8(0x25e)]===0x0)return console['error'](a30_0x29defe[_0x3ca4a8(0x11d)](_0x3ca4a8(0x14c))),console[_0x3ca4a8(0x1a2)]('Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>'),0x1;const _0xadd31f=_0x45ac82[0x0];if(!_0x4e7964[_0x3ca4a8(0x1cc)]||!_0x4e7964['table'])return console[_0x3ca4a8(0x1a2)](_0x3ca4a8(0x1e2)),console['error'](_0x3ca4a8(0x226)),0x1;_0x4e7964[_0x3ca4a8(0x248)]&&(console[_0x3ca4a8(0x1a2)](_0x3ca4a8(0x184)+_0x4e7964['site']),console[_0x3ca4a8(0x1a2)](_0x3ca4a8(0x1f2)+_0xadd31f),console[_0x3ca4a8(0x1a2)](_0x3ca4a8(0x154)+_0x4e7964[_0x3ca4a8(0x1cc)]),console[_0x3ca4a8(0x1a2)](_0x3ca4a8(0x19b)+_0x4e7964[_0x3ca4a8(0x207)]));const _0x132d41=await loadJSONFromOptions(_0x4e7964['attributes'],_0x4e7964[_0x3ca4a8(0x24f)]),_0x487630=await loadJSONFromOptions(_0x4e7964[_0x3ca4a8(0x106)],_0x4e7964[_0x3ca4a8(0x1ed)]),_0x53ada9=await loadJSONFromOptions(_0x4e7964[_0x3ca4a8(0x271)],_0x4e7964[_0x3ca4a8(0x173)]),_0x3093d0={'name':_0xadd31f,'description':_0x4e7964[_0x3ca4a8(0x20e)],'scheduleType':_0x4e7964[_0x3ca4a8(0x11c)],'scheduleOption':_0x4e7964[_0x3ca4a8(0x12b)],'timezone':_0x4e7964[_0x3ca4a8(0x18d)],'master':{'parentDatabaseName':_0x4e7964[_0x3ca4a8(0x1cc)],'parentTableName':_0x4e7964['table']},'attributes':_0x132d41,'behaviors':_0x487630,'customerGroup':_0x53ada9},_0x39d900=await withSpinner(_0x3ca4a8(0x17a)+_0xadd31f+_0x3ca4a8(0x17c),()=>_0x29b9a2[_0x3ca4a8(0x160)][_0x3ca4a8(0xf6)](_0x3093d0),{'verbose':_0x45ef4c[_0x3ca4a8(0x248)]}),_0x255cd8=_0x39d900['data'];return console[_0x3ca4a8(0x1a2)](_0x3ca4a8(0x1d1)+_0x255cd8[_0x3ca4a8(0x202)]+_0x3ca4a8(0x125)+_0x255cd8['id']),await handleSDKOutput([_0x255cd8],_0x45ef4c),0x0;}}export class ParentSegmentUpdateCommand extends BaseCommand{['name']='segment:parent:update';['description']=a30_0x4c2f14(0x171);async[a30_0x4c2f14(0x23c)](_0x2859d7){const _0x31d86b=a30_0x4c2f14,{options:_0x533848,args:_0x4e095a,tdx:_0x4793db}=_0x2859d7;console[_0x31d86b(0x1a2)](_0x31d86b(0x1e8)+_0x31d86b(0x1e4)+_0x31d86b(0x26c));const _0x123fc2=_0x533848;if(_0x4e095a[_0x31d86b(0x25e)]===0x0)return console[_0x31d86b(0x1a2)](a30_0x29defe[_0x31d86b(0x11d)](_0x31d86b(0x14c))),console[_0x31d86b(0x1a2)]('Usage:\x20tdx\x20segment\x20parent\x20update\x20<name>\x20[options]'),0x1;const _0x1662a8=_0x4e095a[0x0];_0x123fc2[_0x31d86b(0x248)]&&(console['error']('Site:\x20'+_0x123fc2[_0x31d86b(0x260)]),console[_0x31d86b(0x1a2)](_0x31d86b(0x274)+_0x1662a8));const _0xe77af3=await withSpinner(_0x31d86b(0x13c)+_0x1662a8+_0x31d86b(0x17c),()=>_0x4793db[_0x31d86b(0x160)][_0x31d86b(0x214)](_0x1662a8),{'verbose':_0x123fc2[_0x31d86b(0x248)]}),_0x3fa974=_0xe77af3['data'],_0x27a6c8=await loadJSONFromOptions(_0x123fc2['addAttributes'],_0x123fc2[_0x31d86b(0x26e)]),_0x2cf833=await loadJSONFromOptions(_0x123fc2[_0x31d86b(0x269)],_0x123fc2[_0x31d86b(0x14b)]),_0x3df7fb={'name':_0x3fa974[_0x31d86b(0x202)],'description':_0x123fc2[_0x31d86b(0x20e)]!==undefined?_0x123fc2[_0x31d86b(0x20e)]:_0x3fa974[_0x31d86b(0x20e)],'scheduleType':_0x123fc2[_0x31d86b(0x11c)]!==undefined?_0x123fc2[_0x31d86b(0x11c)]:_0x3fa974[_0x31d86b(0x11c)],'scheduleOption':_0x123fc2['scheduleOption']!==undefined?_0x123fc2[_0x31d86b(0x12b)]:_0x3fa974[_0x31d86b(0x12b)],'timezone':_0x123fc2[_0x31d86b(0x18d)]!==undefined?_0x123fc2[_0x31d86b(0x18d)]:_0x3fa974[_0x31d86b(0x18d)],'master':_0x3fa974[_0x31d86b(0x261)],'attributes':_0x27a6c8?[..._0x3fa974[_0x31d86b(0x175)]||[],..._0x27a6c8]:_0x3fa974['attributes'],'behaviors':_0x2cf833?[..._0x3fa974['behaviors']||[],..._0x2cf833]:_0x3fa974[_0x31d86b(0x106)],'customerGroup':_0x3fa974[_0x31d86b(0x271)]},_0x16458d=await withSpinner(_0x31d86b(0x168)+_0x1662a8+_0x31d86b(0x17c),()=>_0x4793db[_0x31d86b(0x160)][_0x31d86b(0x134)](_0x1662a8,_0x3df7fb),{'verbose':_0x123fc2[_0x31d86b(0x248)]}),_0x395237=_0x16458d[_0x31d86b(0x1cb)];return console[_0x31d86b(0x1a2)](_0x31d86b(0x153)+_0x395237[_0x31d86b(0x202)]+'\x27'),await handleSDKOutput([_0x395237],_0x123fc2),0x0;}}export class ParentSegmentPullCommand extends BaseParentSegmentCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x1ac);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0xf5);async[a30_0x4c2f14(0x23c)](_0x297a90){const _0x10a3e6=a30_0x4c2f14,{options:_0x348123,args:_0x5be12a,tdx:_0x2da38a}=_0x297a90,_0x66020e=_0x348123,_0x45f9fc=_0x5be12a[0x0]||_0x348123[_0x10a3e6(0x1af)];if(!_0x45f9fc)return showParentSegmentNotSetError(_0x10a3e6(0x24c)+_0x10a3e6(0x150)),0x1;if(_0x66020e['use']&&_0x66020e['output'])return console['error'](a30_0x29defe[_0x10a3e6(0x11d)]('Error:\x20-u\x20(--use)\x20and\x20-o\x20(--output)\x20cannot\x20be\x20used\x20together\x0a')),console[_0x10a3e6(0x1a2)](a30_0x29defe[_0x10a3e6(0x277)](_0x10a3e6(0x19e))),console[_0x10a3e6(0x1a2)](a30_0x29defe['dim'](_0x10a3e6(0x270)+PARENT_SEGMENT_DIR+_0x10a3e6(0x1fa))),console[_0x10a3e6(0x1a2)](a30_0x29defe[_0x10a3e6(0x1da)](_0x10a3e6(0x1b3))),0x1;const _0x561fb5=_0x66020e[_0x10a3e6(0x217)]||a30_0x1eec83[_0x10a3e6(0x25f)](PARENT_SEGMENT_DIR,sanitizeFileName(_0x45f9fc)+'.yml');_0x66020e[_0x10a3e6(0x248)]&&(console[_0x10a3e6(0x1a2)]('Site:\x20'+_0x66020e['site']),console[_0x10a3e6(0x1a2)]('Parent\x20segment:\x20'+_0x45f9fc),console[_0x10a3e6(0x1a2)](_0x10a3e6(0x24e)+_0x561fb5));const _0x53e34a=await withSpinner(_0x10a3e6(0x1f4)+_0x45f9fc+_0x10a3e6(0x17c),()=>_0x2da38a[_0x10a3e6(0x160)][_0x10a3e6(0x13f)](_0x45f9fc),{'verbose':_0x66020e[_0x10a3e6(0x248)]}),_0x49bd7a=_0x53e34a[_0x10a3e6(0x1cb)];if(existsSync(_0x561fb5)){const _0x10c675=readFileSync(_0x561fb5,_0x10a3e6(0x275)),_0x6aaa3a=generateDiff(_0x10c675,_0x49bd7a);if(!hasChanges(_0x6aaa3a))console[_0x10a3e6(0x1a2)](a30_0x29defe[_0x10a3e6(0x1c9)]('✔')+_0x10a3e6(0x1c5)+a30_0x29defe[_0x10a3e6(0x1da)](_0x561fb5)+_0x10a3e6(0x1a1));else{console['error'](_0x10a3e6(0x197)+_0x561fb5+'\x27:'),console[_0x10a3e6(0x1a2)]('─'[_0x10a3e6(0x21a)](0x3c)),console[_0x10a3e6(0x1a2)](formatDiffWithColors(_0x6aaa3a)),console['error']('─'[_0x10a3e6(0x21a)](0x3c));if(!_0x66020e[_0x10a3e6(0x23b)]){if(!isInteractive())return console['error'](a30_0x29defe[_0x10a3e6(0x11d)](_0x10a3e6(0x1ba)),_0x10a3e6(0x1f1)),console[_0x10a3e6(0x1a2)](a30_0x29defe[_0x10a3e6(0x277)](_0x10a3e6(0x1ad))),0x1;const _0x30aa47=await confirmKey(_0x10a3e6(0x250)+_0x561fb5+'\x27?');if(!_0x30aa47)return console[_0x10a3e6(0x1a2)](a30_0x29defe[_0x10a3e6(0x178)](_0x10a3e6(0xfd))),0x1;}writeFileSync(_0x561fb5,_0x49bd7a,'utf-8'),console[_0x10a3e6(0x1a2)](a30_0x29defe[_0x10a3e6(0x1c9)]('✔')+_0x10a3e6(0x135)+a30_0x29defe['cyan'](_0x561fb5));}}else{const _0x485c7c=a30_0x1eec83[_0x10a3e6(0x1d4)](_0x561fb5);!existsSync(_0x485c7c)&&mkdirSync(_0x485c7c,{'recursive':!![]}),writeFileSync(_0x561fb5,_0x49bd7a,'utf-8'),console[_0x10a3e6(0x1a2)](a30_0x29defe[_0x10a3e6(0x1c9)]('✔')+'\x20Saved\x20parent\x20segment\x20configuration\x20to\x20'+a30_0x29defe[_0x10a3e6(0x1da)](_0x561fb5));}return saveSessionContext({'parent_segment':_0x45f9fc},_0x66020e[_0x10a3e6(0x10e)]),console[_0x10a3e6(0x1a2)](a30_0x29defe['green']('✔')+_0x10a3e6(0x110)+a30_0x29defe[_0x10a3e6(0x277)](_0x10a3e6(0x1fc))+'\x20=\x20'+a30_0x29defe[_0x10a3e6(0x1da)](_0x45f9fc)),0x0;}}export class ParentSegmentPushCommand extends BaseParentSegmentCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x210);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0x1aa);async[a30_0x4c2f14(0x23c)](_0x5d0612){const _0x4f726e=a30_0x4c2f14,{options:_0x1eb16b,args:_0x55ff71,tdx:_0x40d998}=_0x5d0612,_0x595202=_0x1eb16b,_0xa6ec92=_0x55ff71[0x0]||_0x1eb16b['parentSegment'];if(!_0xa6ec92)return showParentSegmentNotSetError(_0x4f726e(0x239)+_0x4f726e(0x105)),0x1;const _0x70c280=resolveYamlFile(_0xa6ec92);if(!existsSync(_0x70c280))return showFileNotFoundError(_0x70c280,_0xa6ec92),0x1;_0x595202[_0x4f726e(0x248)]&&(console['error'](_0x4f726e(0x184)+_0x595202['site']),console[_0x4f726e(0x1a2)](_0x4f726e(0x13b)+_0x70c280));let _0x185f3e;try{_0x185f3e=readFileSync(_0x70c280,_0x4f726e(0x275));}catch(_0x25df7a){const _0x24204e=_0x25df7a instanceof Error?_0x25df7a[_0x4f726e(0x19c)]:String(_0x25df7a);return console[_0x4f726e(0x1a2)](_0x4f726e(0x14a)+_0x24204e),0x1;}const _0x561aed=await withSpinner('Analyzing\x20changes...',()=>_0x40d998[_0x4f726e(0x160)][_0x4f726e(0x209)](_0x185f3e),{'verbose':_0x595202['verbose']}),_0x41c379=_0x561aed[_0x4f726e(0x1cb)],{isNew:_0x30693b,name:_0x32e1c2,hasChanges:_0x3f8ddb,diffFormatted:_0x5babf9}=_0x41c379;if(!_0x3f8ddb)return console[_0x4f726e(0x1a2)]('✔\x20No\x20changes\x20-\x20\x27'+_0x32e1c2+'\x27\x20is\x20already\x20up\x20to\x20date'),0x0;_0x30693b?console['error'](_0x4f726e(0x100)+_0x32e1c2+'\x27:'):console[_0x4f726e(0x1a2)]('\x0aChanges\x20to\x20apply\x20to\x20\x27'+_0x32e1c2+'\x27:');console[_0x4f726e(0x1a2)]('─'[_0x4f726e(0x21a)](0x3c)),console[_0x4f726e(0x1a2)](_0x5babf9),console[_0x4f726e(0x1a2)]('─'[_0x4f726e(0x21a)](0x3c));const _0x554764=_0x30693b?'Create\x20parent\x20segment\x20\x27'+_0x32e1c2+'\x27?':_0x4f726e(0x129)+_0x32e1c2+'\x27?';if(!_0x595202[_0x4f726e(0x23b)]){if(!isInteractive())return console[_0x4f726e(0x1a2)](a30_0x29defe[_0x4f726e(0x11d)](_0x4f726e(0x1ba)),_0x4f726e(0x1f1)),console[_0x4f726e(0x1a2)](a30_0x29defe[_0x4f726e(0x277)](_0x4f726e(0x1ad))),0x1;const _0x508623=await confirmKey(_0x554764);if(!_0x508623)return console['error'](a30_0x29defe[_0x4f726e(0x178)]('Aborted.')),0x1;}const _0x2943bc=_0x30693b?'Creating':'Updating',_0x121cb4=await withSpinner(_0x2943bc+'\x20parent\x20segment\x20\x27'+_0x32e1c2+_0x4f726e(0x17c),()=>_0x41c379['apply'](),{'verbose':_0x595202['verbose']}),_0x2f1177=_0x121cb4['data'],_0x1a8c1d=getConsoleNextUrl(_0x595202[_0x4f726e(0x260)],_0x4f726e(0x13e)+_0x2f1177['id']),_0x455bc1=_0x30693b?'Created':_0x4f726e(0x1b7);return console[_0x4f726e(0x1a2)]('✔\x20'+_0x455bc1+_0x4f726e(0x22f)+_0x2f1177['name']+'\x27'),console[_0x4f726e(0x1a2)]('\x20\x20'+_0x1a8c1d),0x0;}}export class ParentSegmentValidateCommand extends BaseParentSegmentCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x16a);['description']='Validate\x20parent\x20segment\x20YAML\x20configuration\x20and\x20show\x20statistics';async[a30_0x4c2f14(0x23c)](_0x3c06d2){const _0x4fd736=a30_0x4c2f14,{options:_0x410252,args:_0xeabb49,tdx:_0x416dd7}=_0x3c06d2,_0x120001=_0x410252,_0x4b1f3c=_0xeabb49[0x0]||_0x410252['parentSegment'];if(!_0x4b1f3c)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'+_0x4fd736(0x21d)+_0x4fd736(0x1a0)+_0x4fd736(0x18b)+_0x4fd736(0x25b)+'\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)'),0x1;const _0x3020f1=resolveYamlFile(_0x4b1f3c);if(!existsSync(_0x3020f1))return showFileNotFoundError(_0x3020f1,_0x4b1f3c),0x1;_0x120001[_0x4fd736(0x248)]&&(console['error'](_0x4fd736(0x184)+_0x120001['site']),console[_0x4fd736(0x1a2)](_0x4fd736(0x13b)+_0x3020f1));let _0x7d770c;try{_0x7d770c=readFileSync(_0x3020f1,_0x4fd736(0x275));}catch(_0x4ad617){const _0x692f79=_0x4ad617 instanceof Error?_0x4ad617[_0x4fd736(0x19c)]:String(_0x4ad617);return console[_0x4fd736(0x1a2)](_0x4fd736(0x14a)+_0x692f79),0x1;}const _0xd75f53=createCommandSpinner(a30_0x29defe['dim']('Validating\x20configuration...'),{'verbose':_0x120001[_0x4fd736(0x248)]});_0xd75f53[_0x4fd736(0x159)]();const _0x4d37f8={'onProgress':_0x31b0f4=>{const _0x5f3355=_0x4fd736;_0xd75f53[_0x5f3355(0x212)]=formatProgressMessage(_0x31b0f4);}};if(_0x120001[_0x4fd736(0x261)])_0x4d37f8[_0x4fd736(0x261)]=!![];if(_0x120001['enriched'])_0x4d37f8['enriched']=!![];_0x120001[_0x4fd736(0x126)]&&(_0x4d37f8[_0x4fd736(0x126)]=_0x120001['attribute']);_0x120001[_0x4fd736(0x1db)]&&(_0x4d37f8[_0x4fd736(0x1db)]=_0x120001[_0x4fd736(0x1db)]);if(_0x120001[_0x4fd736(0x17d)])_0x4d37f8[_0x4fd736(0x17d)]=_0x120001[_0x4fd736(0x17d)];let _0x524892;try{_0x524892=await _0x416dd7[_0x4fd736(0x160)][_0x4fd736(0x1b6)](_0x7d770c,_0x4d37f8),_0xd75f53['stop']();}catch(_0x130f19){_0xd75f53[_0x4fd736(0x111)]();throw _0x130f19;}const _0x46d561=_0x120001[_0x4fd736(0x17d)]||_0x4fd736(0x146);return this['displayValidateResults'](_0x524892,_0x4d37f8,_0x3020f1,_0x46d561),_0x524892[_0x4fd736(0x182)]?0x0:0x1;}[a30_0x4c2f14(0x166)](_0x4a80a7,_0x24b14a,_0x518207,_0x148ff1){const _0x4c671c=a30_0x4c2f14;console['error']('\x0a'+a30_0x29defe['bold'](_0x4c671c(0xf0))+'\x20'+_0x4a80a7[_0x4c671c(0x202)]),console[_0x4c671c(0x1a2)]('═'[_0x4c671c(0x21a)](0x3c)),this['displayMasterInfo'](_0x4a80a7);if(typeof _0x24b14a[_0x4c671c(0x126)]===_0x4c671c(0x21c)){this[_0x4c671c(0x18f)](_0x4a80a7),this[_0x4c671c(0x114)](_0x4a80a7),this['displayPreviewHints'](_0x518207,_0x148ff1,_0x4c671c(0x126),_0x24b14a['attribute']);return;}if(_0x24b14a[_0x4c671c(0x126)]===!![]){this['displayAttributesStats'](_0x4a80a7),this[_0x4c671c(0x114)](_0x4a80a7),this[_0x4c671c(0x1b4)](_0x518207,_0x148ff1,_0x4c671c(0x175));return;}if(typeof _0x24b14a[_0x4c671c(0x1db)]===_0x4c671c(0x21c)){this[_0x4c671c(0x1d9)](_0x4a80a7,_0x148ff1),this[_0x4c671c(0x114)](_0x4a80a7),this[_0x4c671c(0x1b4)](_0x518207,_0x148ff1,'behavior',_0x24b14a[_0x4c671c(0x1db)]);return;}if(_0x24b14a['behavior']===!![]){this[_0x4c671c(0x1d9)](_0x4a80a7,_0x148ff1),this[_0x4c671c(0x114)](_0x4a80a7),this[_0x4c671c(0x1b4)](_0x518207,_0x148ff1,_0x4c671c(0x106));return;}this['displayAttributesStats'](_0x4a80a7),this[_0x4c671c(0x1d9)](_0x4a80a7,_0x148ff1),this[_0x4c671c(0x169)](_0x4a80a7),this[_0x4c671c(0x114)](_0x4a80a7),this['displayPreviewHints'](_0x518207,_0x148ff1,_0x4c671c(0x236));}['displayRealtimeInfo'](_0x227103){displayRealtimeValidation(_0x227103);}['displayPreviewHints'](_0xf05d4,_0x4f3bcb,_0x85a92e,_0x594834){const _0x43c74c=a30_0x4c2f14;console[_0x43c74c(0x1a2)]('\x0a'+a30_0x29defe[_0x43c74c(0x277)](_0x43c74c(0x108)));const _0x45989d=_0x4f3bcb!==_0x43c74c(0x146)?_0x43c74c(0x219)+_0x4f3bcb:'';if(_0x85a92e===_0x43c74c(0x126)&&_0x594834)console[_0x43c74c(0x1a2)]('\x20\x20'+a30_0x29defe[_0x43c74c(0x277)](_0x43c74c(0x180)+_0xf05d4+_0x43c74c(0x1b2)+_0x594834+'\x22'+_0x45989d));else{if(_0x85a92e===_0x43c74c(0x1db)&&_0x594834)console[_0x43c74c(0x1a2)]('\x20\x20'+a30_0x29defe['dim'](_0x43c74c(0x180)+_0xf05d4+_0x43c74c(0x116)+_0x594834+'\x22'+_0x45989d));else(_0x85a92e===_0x43c74c(0x175)||_0x85a92e===_0x43c74c(0x236))&&console[_0x43c74c(0x1a2)]('\x20\x20'+a30_0x29defe[_0x43c74c(0x277)]('tdx\x20ps\x20preview\x20'+_0xf05d4+_0x43c74c(0x10f)+_0x45989d));}(_0x85a92e===_0x43c74c(0x106)||_0x85a92e===_0x43c74c(0x236))&&console[_0x43c74c(0x1a2)]('\x20\x20'+a30_0x29defe[_0x43c74c(0x277)](_0x43c74c(0x180)+_0xf05d4+_0x43c74c(0x14d)+_0x45989d)),_0x85a92e===_0x43c74c(0x236)&&console[_0x43c74c(0x1a2)]('\x20\x20'+a30_0x29defe[_0x43c74c(0x277)](_0x43c74c(0x180)+_0xf05d4+'\x20--enriched'+_0x45989d));}['displayMasterInfo'](_0x2282b3){const _0x16d991=a30_0x4c2f14,{master:_0x4fb3a5}=_0x2282b3,_0x573e30=_0x4fb3a5[_0x16d991(0x23a)]?a30_0x29defe[_0x16d991(0x1c9)]('✔'):a30_0x29defe[_0x16d991(0x11d)]('✘');console[_0x16d991(0x1a2)]('\x0a'+a30_0x29defe[_0x16d991(0x277)](_0x16d991(0x113))),console[_0x16d991(0x1a2)](_0x573e30+'\x20'+a30_0x29defe[_0x16d991(0x151)](_0x4fb3a5[_0x16d991(0x1cc)]+'.'+_0x4fb3a5[_0x16d991(0x207)])),_0x4fb3a5[_0x16d991(0x23a)]?_0x4fb3a5[_0x16d991(0x164)]!==undefined&&console[_0x16d991(0x1a2)]('\x20\x20'+a30_0x29defe['dim']('Rows:')+'\x20'+a30_0x29defe[_0x16d991(0x1da)](formatRows(_0x4fb3a5[_0x16d991(0x164)]))):console[_0x16d991(0x1a2)]('\x20\x20'+a30_0x29defe['red']('Error:')+'\x20'+_0x4fb3a5[_0x16d991(0xfe)]);}[a30_0x4c2f14(0x18f)](_0x5e8596){const _0x44aac2=a30_0x4c2f14;if(_0x5e8596[_0x44aac2(0x175)][_0x44aac2(0x25e)]===0x0)return;console['error']('\x0a'+a30_0x29defe[_0x44aac2(0x277)](_0x44aac2(0x273)));for(const _0x1aabf7 of _0x5e8596[_0x44aac2(0x175)]){const _0xd6435f=_0x1aabf7[_0x44aac2(0x23a)]?a30_0x29defe[_0x44aac2(0x1c9)]('✔'):a30_0x29defe[_0x44aac2(0x11d)]('✘');let _0x43d69f='';if(_0x1aabf7[_0x44aac2(0x23a)]&&_0x1aabf7[_0x44aac2(0xf8)]!==undefined&&_0x1aabf7['coveragePercent']!==undefined){const _0x5d36d5=_0x1aabf7[_0x44aac2(0x22c)][_0x44aac2(0x101)](0x1),_0x1871d8=_0x1aabf7[_0x44aac2(0x22c)]>=0x50?a30_0x29defe[_0x44aac2(0x1c9)]:_0x1aabf7['coveragePercent']>=0x32?a30_0x29defe['yellow']:a30_0x29defe[_0x44aac2(0x11d)];_0x43d69f='\x20'+a30_0x29defe['dim'](_0x44aac2(0x1f3))+'\x20'+_0x1871d8(_0x5d36d5+'%')+'\x20('+formatRows(_0x1aabf7['matchedCount'])+'\x20rows)';}console['error'](_0xd6435f+'\x20'+a30_0x29defe[_0x44aac2(0x151)](_0x1aabf7[_0x44aac2(0x202)])+_0x43d69f),console[_0x44aac2(0x1a2)]('\x20\x20'+a30_0x29defe[_0x44aac2(0x277)]('Source:')+'\x20'+a30_0x29defe[_0x44aac2(0x151)](_0x1aabf7['database']+'.'+_0x1aabf7[_0x44aac2(0x207)]));const _0x2c5028=_0x1aabf7[_0x44aac2(0x179)]===_0x1aabf7[_0x44aac2(0x1a5)]?a30_0x29defe[_0x44aac2(0x277)]('Join\x20on:')+'\x20'+_0x1aabf7[_0x44aac2(0x179)]:a30_0x29defe[_0x44aac2(0x277)]('Join:')+'\x20'+_0x1aabf7[_0x44aac2(0x179)]+'\x20=\x20'+_0x1aabf7[_0x44aac2(0x1a5)];console[_0x44aac2(0x1a2)]('\x20\x20'+_0x2c5028),console['error']('\x20\x20'+a30_0x29defe[_0x44aac2(0x277)](_0x44aac2(0x240))),this[_0x44aac2(0x124)](_0x1aabf7[_0x44aac2(0x1f9)]),!_0x1aabf7['schemaValid']&&console[_0x44aac2(0x1a2)]('\x20\x20'+a30_0x29defe[_0x44aac2(0x11d)]('Error:')+'\x20'+_0x1aabf7['schemaError']);}}[a30_0x4c2f14(0x1d9)](_0x1dc522,_0x4d6c52){const _0x2f7086=a30_0x4c2f14;if(_0x1dc522['behaviors'][_0x2f7086(0x25e)]===0x0)return;console['error']('\x0a'+a30_0x29defe[_0x2f7086(0x277)](_0x2f7086(0x244))+'\x20'+a30_0x29defe['dim']('('+_0x4d6c52+')'));for(const _0x33c460 of _0x1dc522[_0x2f7086(0x106)]){const _0xcea967=_0x33c460[_0x2f7086(0x23a)]?a30_0x29defe[_0x2f7086(0x1c9)]('✔'):a30_0x29defe[_0x2f7086(0x11d)]('✘');let _0x112d87='';if(_0x33c460[_0x2f7086(0x23a)]&&_0x33c460['customersWithEvents']!==undefined&&_0x33c460[_0x2f7086(0x17e)]!==undefined){const _0x446a8d=_0x33c460[_0x2f7086(0x1f6)]?.[_0x2f7086(0x101)](0x1)||'?',_0x5e6ed9=(_0x33c460[_0x2f7086(0x1f6)]??0x0)>=0x32?a30_0x29defe[_0x2f7086(0x1c9)]:(_0x33c460[_0x2f7086(0x1f6)]??0x0)>=0x14?a30_0x29defe[_0x2f7086(0x178)]:a30_0x29defe[_0x2f7086(0x11d)];_0x112d87='\x20'+a30_0x29defe[_0x2f7086(0x277)](_0x2f7086(0x1b0))+'\x20'+_0x5e6ed9(formatRows(_0x33c460['customersWithEvents']))+'\x20('+_0x446a8d+_0x2f7086(0x187)+a30_0x29defe[_0x2f7086(0x277)](_0x2f7086(0x1ff))+'\x20'+a30_0x29defe['cyan'](formatRows(_0x33c460[_0x2f7086(0x17e)]));}console['error'](_0xcea967+'\x20'+a30_0x29defe[_0x2f7086(0x151)](_0x33c460[_0x2f7086(0x202)])+_0x112d87),console[_0x2f7086(0x1a2)]('\x20\x20'+a30_0x29defe[_0x2f7086(0x277)]('Source:')+'\x20'+a30_0x29defe[_0x2f7086(0x151)](_0x33c460[_0x2f7086(0x1cc)]+'.'+_0x33c460[_0x2f7086(0x207)]));const _0x2f2e0d=_0x33c460[_0x2f7086(0x179)]===_0x33c460[_0x2f7086(0x1a5)]?a30_0x29defe[_0x2f7086(0x277)](_0x2f7086(0x109))+'\x20'+_0x33c460[_0x2f7086(0x179)]:a30_0x29defe['dim'](_0x2f7086(0x258))+'\x20'+_0x33c460[_0x2f7086(0x179)]+_0x2f7086(0x238)+_0x33c460[_0x2f7086(0x1a5)];console[_0x2f7086(0x1a2)]('\x20\x20'+_0x2f2e0d),console[_0x2f7086(0x1a2)]('\x20\x20'+a30_0x29defe[_0x2f7086(0x277)]('Columns:')),this[_0x2f7086(0x124)](_0x33c460[_0x2f7086(0x1f9)]),!_0x33c460['schemaValid']&&console[_0x2f7086(0x1a2)]('\x20\x20'+a30_0x29defe[_0x2f7086(0x11d)](_0x2f7086(0x203))+'\x20'+_0x33c460['schemaError']);}}['displayColumns'](_0x1a815a){const _0x56c8f4=a30_0x4c2f14;for(const _0x4cfe5a of _0x1a815a){_0x4cfe5a[_0x56c8f4(0x148)]===_0x4cfe5a[_0x56c8f4(0x12a)]||_0x4cfe5a['column']==='*'?console['error'](_0x56c8f4(0x229)+_0x4cfe5a[_0x56c8f4(0x148)]):console[_0x56c8f4(0x1a2)](_0x56c8f4(0x229)+_0x4cfe5a[_0x56c8f4(0x148)]+'\x20'+a30_0x29defe['dim']('('+_0x4cfe5a['column']+')'));}}[a30_0x4c2f14(0x114)](_0x6cc8c1){const _0x3693bb=a30_0x4c2f14;console[_0x3693bb(0x1a2)]('─'[_0x3693bb(0x21a)](0x3c));if(_0x6cc8c1[_0x3693bb(0x23e)][_0x3693bb(0x25e)]>0x0){console[_0x3693bb(0x1a2)]('\x0a'+a30_0x29defe[_0x3693bb(0x11d)](_0x3693bb(0x1f5)));for(const _0x22fb5d of _0x6cc8c1[_0x3693bb(0x23e)]){console[_0x3693bb(0x1a2)]('\x20\x20'+a30_0x29defe['red']('•')+'\x20'+_0x22fb5d);}}_0x6cc8c1[_0x3693bb(0x182)]&&console[_0x3693bb(0x1a2)]('\x0a'+a30_0x29defe[_0x3693bb(0x1c9)]('✔')+'\x20Configuration\x20is\x20valid');}}export class ParentSegmentPreviewCommand extends BaseParentSegmentCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x1c7);['description']=a30_0x4c2f14(0x1b1);async[a30_0x4c2f14(0x23c)](_0x587f79){const _0x108865=a30_0x4c2f14,{options:_0x71323e,args:_0x55edbb,tdx:_0x57cbd7}=_0x587f79,_0x8f7798=_0x71323e,_0x3e2ed7=_0x55edbb[0x0]||_0x71323e[_0x108865(0x1af)];if(!_0x3e2ed7)return showParentSegmentNotSetError(_0x108865(0x1c4)+_0x108865(0x194)+_0x108865(0x21b)+_0x108865(0xf4)+_0x108865(0x123)+_0x108865(0x141)+_0x108865(0x1a8)+_0x108865(0x19a)),0x1;if(!_0x8f7798[_0x108865(0x261)]&&!_0x8f7798[_0x108865(0x126)]&&!_0x8f7798[_0x108865(0x1db)]&&!_0x8f7798[_0x108865(0x1dd)])return console[_0x108865(0x1a2)](a30_0x29defe['red'](_0x108865(0x1ce))),console[_0x108865(0x1a2)](_0x108865(0x23d)),console[_0x108865(0x1a2)](_0x108865(0x117)),console[_0x108865(0x1a2)](_0x108865(0x1c0)),console[_0x108865(0x1a2)](_0x108865(0x15a)),console['error'](_0x108865(0x1cd)),console[_0x108865(0x1a2)](_0x108865(0x196)),0x1;const _0x5ce833=resolveYamlFile(_0x3e2ed7);if(!existsSync(_0x5ce833))return showFileNotFoundError(_0x5ce833,_0x3e2ed7),0x1;_0x8f7798[_0x108865(0x248)]&&(console['error'](_0x108865(0x184)+_0x8f7798['site']),console[_0x108865(0x1a2)]('YAML\x20file:\x20'+_0x5ce833));let _0x4155f0;try{_0x4155f0=readFileSync(_0x5ce833,_0x108865(0x275));}catch(_0x59544d){const _0x539cf4=_0x59544d instanceof Error?_0x59544d[_0x108865(0x19c)]:String(_0x59544d);return console[_0x108865(0x1a2)](_0x108865(0x14a)+_0x539cf4),0x1;}let _0x2b7715;try{_0x2b7715=parseDef(_0x4155f0);}catch(_0xccb59d){const _0x1a5a76=_0xccb59d instanceof Error?_0xccb59d[_0x108865(0x19c)]:String(_0xccb59d);return console[_0x108865(0x1a2)](a30_0x29defe[_0x108865(0x11d)]('Error\x20parsing\x20YAML:\x20'+_0x1a5a76)),0x1;}if(_0x8f7798[_0x108865(0x126)]===!![]||_0x8f7798[_0x108865(0x126)]===''){const _0x26f2e0=_0x2b7715['attributes']?.['map'](_0x22cac4=>_0x22cac4[_0x108865(0x202)])||[];if(_0x26f2e0['length']===0x0)console[_0x108865(0x1a2)](a30_0x29defe[_0x108865(0x11d)](_0x108865(0x1e1)));else{console[_0x108865(0x1a2)](a30_0x29defe['red']('Error:\x20--attribute\x20requires\x20a\x20name\x0a')),console[_0x108865(0x1a2)](_0x108865(0x1c6));for(const _0x4a6c31 of _0x26f2e0){console[_0x108865(0x1a2)]('\x20\x20'+a30_0x29defe[_0x108865(0x1da)](_0x4a6c31));}console[_0x108865(0x1a2)](_0x108865(0x1d7)+_0x3e2ed7+'\x20--attribute\x20\x22'+_0x26f2e0[0x0]+'\x22');}return 0x1;}if(_0x8f7798[_0x108865(0x1db)]===!![]||_0x8f7798['behavior']===''){const _0x32add7=_0x2b7715[_0x108865(0x106)]?.[_0x108865(0x22a)](_0x53fb67=>_0x53fb67['name'])||[];if(_0x32add7['length']===0x0)console[_0x108865(0x1a2)](a30_0x29defe[_0x108865(0x11d)](_0x108865(0x16f)));else{console[_0x108865(0x1a2)](a30_0x29defe[_0x108865(0x11d)](_0x108865(0x10c))),console[_0x108865(0x1a2)](_0x108865(0x167));for(const _0x1747b2 of _0x32add7){console[_0x108865(0x1a2)]('\x20\x20'+a30_0x29defe['cyan'](_0x1747b2));}console[_0x108865(0x1a2)](_0x108865(0x1d7)+_0x3e2ed7+_0x108865(0x116)+_0x32add7[0x0]+'\x22');}return 0x1;}const _0x7f696=createCommandSpinner(a30_0x29defe[_0x108865(0x277)](_0x108865(0x225)),{'verbose':_0x8f7798[_0x108865(0x248)]});_0x7f696[_0x108865(0x159)]();const _0x29c7a9={'onProgress':_0x45d326=>{_0x7f696['text']=formatProgressMessage(_0x45d326);}};if(_0x8f7798['master'])_0x29c7a9[_0x108865(0x261)]=!![];if(_0x8f7798['attribute']&&typeof _0x8f7798['attribute']===_0x108865(0x21c))_0x29c7a9[_0x108865(0x126)]=_0x8f7798[_0x108865(0x126)];if(_0x8f7798['behavior']&&typeof _0x8f7798[_0x108865(0x1db)]==='string')_0x29c7a9[_0x108865(0x1db)]=_0x8f7798[_0x108865(0x1db)];if(_0x8f7798[_0x108865(0x1dd)])_0x29c7a9[_0x108865(0x1dd)]=!![];if(_0x8f7798[_0x108865(0x17d)])_0x29c7a9['interval']=_0x8f7798[_0x108865(0x17d)];let _0x3bd4b8;try{_0x3bd4b8=await _0x57cbd7[_0x108865(0x160)][_0x108865(0xf7)](_0x4155f0,_0x29c7a9),_0x7f696[_0x108865(0x111)]();}catch(_0x1e23ec){_0x7f696['stop']();throw _0x1e23ec;}return await this[_0x108865(0x1d5)](_0x3bd4b8,{'master':_0x8f7798['master'],'attribute':typeof _0x8f7798[_0x108865(0x126)]===_0x108865(0x21c)?_0x8f7798[_0x108865(0x126)]:undefined,'behavior':typeof _0x8f7798['behavior']===_0x108865(0x21c)?_0x8f7798[_0x108865(0x1db)]:undefined,'enriched':_0x8f7798[_0x108865(0x1dd)]}),_0x3bd4b8[_0x108865(0x182)]?0x0:0x1;}async['displayPreviewResults'](_0x57bfe9,_0x32c080){const _0x43ef3d=a30_0x4c2f14;console[_0x43ef3d(0x1a2)]('\x0a'+a30_0x29defe['bold']('Preview:')+'\x20'+_0x57bfe9[_0x43ef3d(0x202)]),console[_0x43ef3d(0x1a2)]('═'[_0x43ef3d(0x21a)](0x3c));if(_0x32c080[_0x43ef3d(0x261)]&&_0x57bfe9[_0x43ef3d(0x145)]){const _0x5b29b7=a30_0x29defe[_0x43ef3d(0x277)]('Master:')+'\x20'+a30_0x29defe[_0x43ef3d(0x151)](_0x57bfe9['master'][_0x43ef3d(0x1cc)]+'.'+_0x57bfe9[_0x43ef3d(0x261)][_0x43ef3d(0x207)]);await this[_0x43ef3d(0x1a4)](_0x5b29b7,_0x57bfe9[_0x43ef3d(0x145)]);}else{if(_0x32c080[_0x43ef3d(0x126)]&&_0x57bfe9[_0x43ef3d(0x145)]){const _0x1d562c=a30_0x29defe[_0x43ef3d(0x277)](_0x43ef3d(0x15b))+'\x20'+a30_0x29defe[_0x43ef3d(0x151)](_0x32c080[_0x43ef3d(0x126)]);await this[_0x43ef3d(0x1a4)](_0x1d562c,_0x57bfe9[_0x43ef3d(0x145)]);}else{if(_0x32c080[_0x43ef3d(0x1db)]&&_0x57bfe9[_0x43ef3d(0x145)]){const _0x55b481=a30_0x29defe['dim'](_0x43ef3d(0x26f))+'\x20'+a30_0x29defe[_0x43ef3d(0x151)](_0x32c080[_0x43ef3d(0x1db)]);await this['displaySampleData'](_0x55b481,_0x57bfe9['sampleData']);}else{if(_0x32c080['enriched']&&_0x57bfe9['sampleData']){const _0x3f37b5=a30_0x29defe[_0x43ef3d(0x277)](_0x43ef3d(0x158))+'\x20'+a30_0x29defe['bold'](_0x43ef3d(0x1d3));await this[_0x43ef3d(0x1a4)](_0x3f37b5,_0x57bfe9[_0x43ef3d(0x145)]);}else!_0x57bfe9[_0x43ef3d(0x145)]&&console['error'](_0x43ef3d(0x190));}}}if(_0x57bfe9['errors'][_0x43ef3d(0x25e)]>0x0){console[_0x43ef3d(0x1a2)]('─'[_0x43ef3d(0x21a)](0x3c)),console['error']('\x0a'+a30_0x29defe[_0x43ef3d(0x11d)]('Errors:'));for(const _0x3d8b59 of _0x57bfe9[_0x43ef3d(0x23e)]){console[_0x43ef3d(0x1a2)]('\x20\x20'+a30_0x29defe[_0x43ef3d(0x11d)]('•')+'\x20'+_0x3d8b59);}}}async[a30_0x4c2f14(0x1a4)](_0x2b31ec,_0x32856c){const _0xd357fc=a30_0x4c2f14;if(_0x32856c['length']===0x0){console[_0xd357fc(0x1a2)]('\x0a'+_0x2b31ec),console[_0xd357fc(0x1a2)]('\x20\x20No\x20sample\x20data\x20available');return;}console['error']('\x0a'+_0x2b31ec);const _0x54d241=Object[_0xd357fc(0x1dc)](_0x32856c[0x0])['map'](_0x3b0c87=>({'name':_0x3b0c87,'type':typeof _0x32856c[0x0][_0x3b0c87]==='number'?_0xd357fc(0x1ea):_0xd357fc(0x22b)})),_0x42ee42={'queryId':_0xd357fc(0x18c),'columns':_0x54d241,'data':_0x32856c,'stats':{'state':_0xd357fc(0x256),'queued':![],'scheduled':![],'nodes':0x0,'totalSplits':0x0,'queuedSplits':0x0,'runningSplits':0x0,'completedSplits':0x0,'cpuTimeMillis':0x0,'wallTimeMillis':0x0,'queuedTimeMillis':0x0,'elapsedTimeMillis':0x0,'processedRows':_0x32856c['length'],'processedBytes':0x0,'physicalInputBytes':0x0,'peakMemoryBytes':0x0,'spilledBytes':0x0}},_0xbf7199=formatAsTable(_0x42ee42,_0x32856c[_0xd357fc(0x25e)],!![]);await writeOutput(_0xbf7199,undefined,_0xd357fc(0x207));}}export class ParentSegmentRunCommand extends BaseParentSegmentCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0xfc);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0xf3);async['execute'](_0xb3869d){const _0x5b0c0c=a30_0x4c2f14,{options:_0x497bff,args:_0x458ed9,tdx:_0xc525eb}=_0xb3869d,_0xc43e15=_0x497bff,_0x21a378=_0x458ed9[0x0]||_0x497bff[_0x5b0c0c(0x1af)];if(!_0x21a378)return showParentSegmentNotSetError(_0x5b0c0c(0x268)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20run\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20specific\x20parent\x20segment'),0x1;const _0x354736=resolveYamlFile(_0x21a378);if(existsSync(_0x354736)){_0xc43e15[_0x5b0c0c(0x248)]&&console[_0x5b0c0c(0x1a2)](_0x5b0c0c(0x1b5)+_0x354736);let _0x32a8bd;try{_0x32a8bd=readFileSync(_0x354736,_0x5b0c0c(0x275));}catch(_0x3f3acd){const _0x80de53=_0x3f3acd instanceof Error?_0x3f3acd[_0x5b0c0c(0x19c)]:String(_0x3f3acd);return console['error'](_0x5b0c0c(0x14a)+_0x80de53),0x1;}const _0x293ca9=await withSpinner(_0x5b0c0c(0x1bd),()=>_0xc525eb[_0x5b0c0c(0x160)]['pushParentYaml'](_0x32a8bd),{'verbose':_0xc43e15[_0x5b0c0c(0x248)]}),_0x25a04f=_0x293ca9['data'],{isNew:_0x249fd1,name:_0x1b16ec,hasChanges:_0xb433f3,diffFormatted:_0x3279fd}=_0x25a04f;if(_0xb433f3){_0x249fd1?console[_0x5b0c0c(0x1a2)](_0x5b0c0c(0x100)+_0x1b16ec+'\x27:'):console[_0x5b0c0c(0x1a2)](_0x5b0c0c(0x201)+_0x1b16ec+'\x27:');console[_0x5b0c0c(0x1a2)]('─'[_0x5b0c0c(0x21a)](0x3c)),console[_0x5b0c0c(0x1a2)](_0x3279fd),console[_0x5b0c0c(0x1a2)]('─'[_0x5b0c0c(0x21a)](0x3c));const _0x4ab832=_0x249fd1?_0x5b0c0c(0x139)+_0x1b16ec+_0x5b0c0c(0x149):_0x5b0c0c(0x129)+_0x1b16ec+'\x27\x20and\x20run\x20workflow?';if(!_0xc43e15[_0x5b0c0c(0x23b)]){if(!isInteractive())return console[_0x5b0c0c(0x1a2)](a30_0x29defe[_0x5b0c0c(0x11d)](_0x5b0c0c(0x1ba)),_0x5b0c0c(0x1f1)),console['error'](a30_0x29defe[_0x5b0c0c(0x277)](_0x5b0c0c(0x1ad))),0x1;const _0x2e1809=await confirmKey(_0x4ab832);if(!_0x2e1809)return console[_0x5b0c0c(0x1a2)](a30_0x29defe[_0x5b0c0c(0x178)]('Aborted.')),0x1;}const _0x34e2ee=_0x249fd1?_0x5b0c0c(0x138):_0x5b0c0c(0x131);await withSpinner(_0x34e2ee+_0x5b0c0c(0x22f)+_0x1b16ec+_0x5b0c0c(0x17c),()=>_0x25a04f[_0x5b0c0c(0x1e3)](),{'verbose':_0xc43e15[_0x5b0c0c(0x248)]});const _0x5bb48b=_0x249fd1?_0x5b0c0c(0x20b):'Updated';console[_0x5b0c0c(0x1a2)]('✔\x20'+_0x5bb48b+_0x5b0c0c(0x22f)+_0x1b16ec+'\x27');}else console[_0x5b0c0c(0x1a2)](_0x5b0c0c(0x1b9)+_0x1b16ec+_0x5b0c0c(0x186));}const _0x3c614c=await withSpinner('Running\x20parent\x20segment\x20workflow\x20for\x20\x27'+_0x21a378+'\x27...',()=>_0xc525eb[_0x5b0c0c(0x160)][_0x5b0c0c(0x119)](_0x21a378),{'verbose':_0xc43e15['verbose']}),_0x3aa5a0=_0x3c614c[_0x5b0c0c(0x1cb)],_0x3ddb57=getConsoleUrl(_0xc43e15[_0x5b0c0c(0x260)],_0x5b0c0c(0x191)+_0x3aa5a0[_0x5b0c0c(0x14e)]+'/sessions/'+_0x3aa5a0[_0x5b0c0c(0x264)]+_0x5b0c0c(0x276)+_0x3aa5a0[_0x5b0c0c(0x17f)]);return console[_0x5b0c0c(0x1a2)](_0x5b0c0c(0x22d)),console[_0x5b0c0c(0x1a2)]('\x20\x20'+a30_0x29defe[_0x5b0c0c(0x277)](_0x5b0c0c(0x192))+'\x20'+_0x3aa5a0[_0x5b0c0c(0x1fd)]),console[_0x5b0c0c(0x1a2)]('\x20\x20'+a30_0x29defe[_0x5b0c0c(0x277)]('Status:')+'\x20'+_0x3aa5a0['status']),console[_0x5b0c0c(0x1a2)]('\x20\x20'+a30_0x29defe[_0x5b0c0c(0x277)](_0x5b0c0c(0x206))+'\x20'+_0x3aa5a0['workflowSessionId']),console[_0x5b0c0c(0x1a2)]('\x20\x20'+a30_0x29defe['dim']('Attempt:')+'\x20'+_0x3aa5a0[_0x5b0c0c(0x17f)]),console['error']('\x20\x20'+_0x3ddb57),console['error']('\x0a'+a30_0x29defe[_0x5b0c0c(0x277)](_0x5b0c0c(0x11a))+_0x5b0c0c(0x1ee)+_0x3aa5a0[_0x5b0c0c(0x17f)]+_0x5b0c0c(0x147)),0x0;}}export class ParentSegmentFieldsCommand extends BaseCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x1e0);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0x1bc);async[a30_0x4c2f14(0x23c)](_0xc5d362){const _0x1c6d1e=a30_0x4c2f14,{options:_0x1ea063,args:_0x500822,tdx:_0x5581df}=_0xc5d362,_0x56799a=_0x500822[0x0]||_0x1ea063[_0x1c6d1e(0x1af)];if(!_0x56799a)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20fields\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20(requires\x20context)\x0a'+_0x1c6d1e(0x1d6)),0x1;_0x1ea063[_0x1c6d1e(0x248)]&&(console[_0x1c6d1e(0x1a2)](_0x1c6d1e(0x184)+_0x1ea063['site']),console[_0x1c6d1e(0x1a2)](_0x1c6d1e(0x274)+_0x56799a));const _0x2c4608=await withSpinner(_0x1c6d1e(0x1c1)+_0x56799a+_0x1c6d1e(0x17c),()=>_0x5581df[_0x1c6d1e(0x160)]['listFields'](_0x56799a),{'verbose':_0x1ea063[_0x1c6d1e(0x248)]}),_0x212ee3=_0x2c4608[_0x1c6d1e(0x1cb)];console[_0x1c6d1e(0x1a2)](_0x1c6d1e(0x26d)+_0x212ee3['length']+_0x1c6d1e(0xf2)+(_0x212ee3[_0x1c6d1e(0x25e)]!==0x1?'s':''));if(_0x1ea063['json']||_0x1ea063['jsonl'])return await handleSDKOutput(_0x212ee3,_0x1ea063),0x0;return displayFieldsHumanReadable(_0x212ee3,_0x56799a),0x0;}}export class ParentSegmentViewCommand extends BaseCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x1f0);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0x259);async[a30_0x4c2f14(0x23c)](_0x42590f){const _0x5f1a2d=a30_0x4c2f14,{options:_0x5b9943,args:_0x13cf75,tdx:_0xc2e676}=_0x42590f,_0x1bcf35=_0x5b9943,_0x4ebcf2=_0x13cf75[0x0]||_0x5b9943[_0x5f1a2d(0x1af)];if(!_0x4ebcf2)return showParentSegmentNotSetError(_0x5f1a2d(0xff)+_0x5f1a2d(0x1e6)+'Options:\x0a'+'\x20\x20-w,\x20--web\x20\x20Open\x20parent\x20segment\x20in\x20web\x20browser'),0x1;_0x5b9943[_0x5f1a2d(0x248)]&&(console[_0x5f1a2d(0x1a2)](_0x5f1a2d(0x184)+_0x5b9943[_0x5f1a2d(0x260)]),console[_0x5f1a2d(0x1a2)](_0x5f1a2d(0x274)+_0x4ebcf2));const _0x4e0033=await withSpinner(_0x5f1a2d(0x1f4)+_0x4ebcf2+_0x5f1a2d(0x17c),()=>_0xc2e676['segment'][_0x5f1a2d(0x214)](_0x4ebcf2),{'verbose':_0x5b9943[_0x5f1a2d(0x248)]}),_0x49ec77=_0x4e0033[_0x5f1a2d(0x1cb)];if(_0x1bcf35['web']){const _0x2a2512=getConsoleNextUrl(_0x1bcf35['site'],_0x5f1a2d(0x13e)+_0x49ec77['id']);return console['error'](a30_0x29defe[_0x5f1a2d(0x1c9)]('✔')+_0x5f1a2d(0x177)+a30_0x29defe['cyan'](_0x2a2512)),openBrowser(_0x2a2512),0x0;}return await handleSingleObjectOutput(_0x49ec77,_0x5b9943),0x0;}}export class ParentSegmentDescCommand extends BaseCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x1be);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0x15d);async['execute'](_0x3170a0){const _0x15f435=a30_0x4c2f14,{options:_0x49e49c,args:_0x13ae1d,tdx:_0xaf7ca0}=_0x3170a0,_0x124d1e=_0x49e49c,_0x35ca6d=_0x13ae1d[0x0]||_0x49e49c['parentSegment'];if(!_0x35ca6d)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20desc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20desc\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Describe\x20all\x20tables\x20for\x20parent\x20segment\x0a\x0a'+'Options:\x0a'+_0x15f435(0x12c)),0x1;_0x49e49c[_0x15f435(0x248)]&&(console[_0x15f435(0x1a2)](_0x15f435(0x184)+_0x49e49c[_0x15f435(0x260)]),console['error'](_0x15f435(0x274)+_0x35ca6d));const _0x38619f=await withSpinner(_0x15f435(0x16d)+_0x35ca6d+_0x15f435(0x17c),()=>_0xaf7ca0['segment'][_0x15f435(0x22e)](_0x35ca6d),{'verbose':_0x49e49c[_0x15f435(0x248)]}),_0x50c9f7=_0x38619f[_0x15f435(0x1cb)],_0x21152c=_0xaf7ca0[_0x15f435(0x160)][_0x15f435(0x103)](_0x50c9f7);if(_0x124d1e['output']){const _0x203f16=await this[_0x15f435(0x12f)](_0x3170a0,_0x35ca6d,_0x50c9f7,_0x21152c),_0x184d76=this[_0x15f435(0x27a)](_0x203f16);writeFileSync(_0x124d1e['output'],_0x184d76);const _0x4c9711=_0x203f16[_0x15f435(0x20f)][_0x15f435(0x1f9)]['length']+_0x203f16[_0x15f435(0x106)][_0x15f435(0x1a7)]((_0x1541f9,_0x15dca5)=>_0x1541f9+_0x15dca5['columns'][_0x15f435(0x25e)],0x0),_0x54c5d7=_0x203f16['behaviors']['filter'](_0x56af71=>_0x56af71[_0x15f435(0x1f9)]['length']===0x0)[_0x15f435(0x25e)];return console['log'](_0x15f435(0x15c)+_0x124d1e['output']),console[_0x15f435(0x140)](_0x15f435(0x211)+_0x21152c),console[_0x15f435(0x140)](_0x15f435(0x128)+_0x203f16[_0x15f435(0x106)][_0x15f435(0x25e)]+_0x15f435(0x181)),console[_0x15f435(0x140)](_0x15f435(0x222)+_0x4c9711+_0x15f435(0x1ae)),_0x54c5d7>0x0&&console[_0x15f435(0x140)](_0x15f435(0x1a9)+_0x54c5d7+'\x20behavior\x20tables\x20not\x20yet\x20generated\x20(workflow\x20may\x20not\x20have\x20run)'),0x0;}console['error']('\x0a'+a30_0x29defe['bold'](_0x15f435(0x1d2))+'\x20'+a30_0x29defe['cyan'](_0x21152c));const _0x37c965=await withSpinner(_0x15f435(0x118),()=>_0xaf7ca0['segment'][_0x15f435(0x1ca)](_0x50c9f7),{'verbose':_0x49e49c['verbose']});console[_0x15f435(0x1a2)]('\x0a'+a30_0x29defe[_0x15f435(0x151)](_0x15f435(0x20f))+'\x20'+a30_0x29defe[_0x15f435(0x277)]('('+_0x21152c+_0x15f435(0x218)));const _0x1d102d=await executeSchemaQuery(_0x37c965[_0x15f435(0x1cb)],_0xaf7ca0,_0x49e49c);await handleQueryOutput(_0x1d102d,_0x49e49c);const _0x43281f=await withSpinner('Fetching\x20behavior\x20list...',()=>_0xaf7ca0[_0x15f435(0x160)]['getBehaviorNames'](_0x50c9f7),{'verbose':_0x49e49c[_0x15f435(0x248)]});for(const _0xc5e383 of _0x43281f[_0x15f435(0x1cb)]){const _0x3d32ab=_0x15f435(0x1e7)+_0xc5e383['toLowerCase']()[_0x15f435(0x241)](/\s+/g,'_'),_0x5ef6c0='SELECT\x20*\x20FROM\x20'+_0x21152c+'.'+_0x3d32ab;console[_0x15f435(0x1a2)]('\x0a'+a30_0x29defe[_0x15f435(0x151)](_0xc5e383)+'\x20'+a30_0x29defe['dim']('('+_0x21152c+'.'+_0x3d32ab+')'));try{const _0x1a1a37=await executeSchemaQuery(_0x5ef6c0,_0xaf7ca0,_0x49e49c);await handleQueryOutput(_0x1a1a37,_0x49e49c);}catch{console['error'](a30_0x29defe['yellow']('\x20\x20Schema\x20not\x20available\x20(workflow\x20may\x20not\x20have\x20run\x20yet)'));}}return 0x0;}async[a30_0x4c2f14(0x12f)](_0x1bbf3a,_0x4753d7,_0x2a816d,_0x148d21){const _0x2af12a=a30_0x4c2f14,{options:_0x2b99a9,tdx:_0x1e8271}=_0x1bbf3a,_0x1b184e=await withSpinner(_0x2af12a(0x118),()=>_0x1e8271[_0x2af12a(0x160)][_0x2af12a(0x1ca)](_0x2a816d),{'verbose':_0x2b99a9[_0x2af12a(0x248)]}),_0x2ac09f=await executeSchemaQuery(_0x1b184e[_0x2af12a(0x1cb)],_0x1e8271,_0x2b99a9),_0xa1840f=_0x2ac09f['data'][_0x2af12a(0x22a)](_0x69000c=>({'name':_0x69000c[_0x2af12a(0x155)],'type':_0x69000c[_0x2af12a(0x1d0)]})),_0x4f4175=await withSpinner(_0x2af12a(0x231),()=>_0x1e8271['segment'][_0x2af12a(0x20d)](_0x2a816d),{'verbose':_0x2b99a9['verbose']}),_0x592d08=[];for(const _0x14eebe of _0x4f4175[_0x2af12a(0x1cb)]){const _0x3387d4='behavior_'+_0x14eebe['toLowerCase']()[_0x2af12a(0x241)](/\s+/g,'_'),_0x2bebaa='SELECT\x20*\x20FROM\x20'+_0x148d21+'.'+_0x3387d4;let _0x4e3592=[];try{const _0x192b61=await executeSchemaQuery(_0x2bebaa,_0x1e8271,_0x2b99a9);_0x4e3592=_0x192b61[_0x2af12a(0x1cb)][_0x2af12a(0x22a)](_0x4647f7=>({'name':_0x4647f7[_0x2af12a(0x155)],'type':_0x4647f7['column_type']}));}catch{}_0x592d08[_0x2af12a(0x152)]({'table':_0x3387d4,'columns':_0x4e3592});}return{'database':_0x148d21,'parent_segment':_0x4753d7,'parent_id':_0x2a816d,'customers':{'table':_0x2af12a(0x20f),'columns':_0xa1840f},'behaviors':_0x592d08};}[a30_0x4c2f14(0x27a)](_0x55dd4c){const _0x5b521b=a30_0x4c2f14,_0x4cea93=_0x2858cc=>{const _0x31abe3=a30_0x5265;if(_0x2858cc[_0x31abe3(0x25e)]===0x0)return'[]';const _0x1a8e6c=_0x2858cc[_0x31abe3(0x22a)](_0x2bb212=>'\x20\x20\x20\x20\x20\x20{\x20\x22name\x22:\x20\x22'+_0x2bb212['name']+'\x22,\x20\x22type\x22:\x20\x22'+_0x2bb212[_0x31abe3(0x144)]+'\x22\x20}');return'[\x0a'+_0x1a8e6c['join'](',\x0a')+'\x0a\x20\x20\x20\x20]';},_0x56c7f6=_0x55dd4c[_0x5b521b(0x106)][_0x5b521b(0x22a)](_0x2d30e6=>{const _0x3cad45=_0x5b521b;return'\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x2d30e6[_0x3cad45(0x207)]+_0x3cad45(0x1df)+_0x4cea93(_0x2d30e6[_0x3cad45(0x1f9)])[_0x3cad45(0x241)](/^/gm,'\x20\x20')[_0x3cad45(0x10b)]()+_0x3cad45(0x233);})[_0x5b521b(0x25f)](',\x0a');return _0x5b521b(0x249)+_0x55dd4c[_0x5b521b(0x1cc)]+_0x5b521b(0x183)+_0x55dd4c[_0x5b521b(0x1fc)]+_0x5b521b(0x16c)+_0x55dd4c['parent_id']+'\x22,\x0a\x20\x20\x22customers\x22:\x20{\x0a\x20\x20\x20\x20\x22table\x22:\x20\x22'+_0x55dd4c[_0x5b521b(0x20f)][_0x5b521b(0x207)]+_0x5b521b(0x25a)+_0x4cea93(_0x55dd4c[_0x5b521b(0x20f)]['columns'])[_0x5b521b(0x241)](/^/gm,'\x20\x20')['trim']()+_0x5b521b(0x1de)+_0x56c7f6+_0x5b521b(0x193);}}export class ParentSegmentSQLCommand extends BaseCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x230);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0x254);async[a30_0x4c2f14(0x23c)](_0x2142ce){const _0x342c3b=a30_0x4c2f14,{options:_0x34e854,args:_0xe0996f,tdx:_0x425067}=_0x2142ce,_0x2d7aaf=_0xe0996f[0x0]||_0x34e854[_0x342c3b(0x1af)];if(!_0x2d7aaf)return showParentSegmentNotSetError(_0x342c3b(0x163)+_0x342c3b(0x255)),0x1;_0x34e854[_0x342c3b(0x248)]&&(console[_0x342c3b(0x1a2)](_0x342c3b(0x184)+_0x34e854[_0x342c3b(0x260)]),console[_0x342c3b(0x1a2)](_0x342c3b(0x274)+_0x2d7aaf));const _0x145cb1=await withSpinner(_0x342c3b(0x16d)+_0x2d7aaf+_0x342c3b(0x17c),()=>_0x425067[_0x342c3b(0x160)][_0x342c3b(0x22e)](_0x2d7aaf),{'verbose':_0x34e854['verbose']}),_0x2b0ebd=_0x145cb1[_0x342c3b(0x1cb)],_0x8e4f3f=await withSpinner(_0x342c3b(0x10a)+_0x2d7aaf+_0x342c3b(0x17c),()=>_0x425067[_0x342c3b(0x160)][_0x342c3b(0x1ca)](_0x2b0ebd),{'verbose':_0x34e854[_0x342c3b(0x248)]}),_0x73b017=_0x8e4f3f[_0x342c3b(0x1cb)];return _0x34e854[_0x342c3b(0x174)]===_0x342c3b(0x1a6)||_0x34e854[_0x342c3b(0x174)]===_0x342c3b(0x19d)?await handleSDKOutput([{'sql':_0x73b017}],_0x34e854):console[_0x342c3b(0x140)](_0x73b017),0x0;}}function a30_0x22a5(){const _0x4f77d0=['\x20\x20--behavior\x20[name]\x20\x20\x20\x20Show\x20only\x20behaviors\x20(or\x20specific\x20one)\x0a','Listing\x20RT-enabled\x20parent\x20segments\x20matching\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20rt\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20for\x20specific\x20parent\x20segment','length','join','site','master','filter','⚡\x20Not\x20enabled','workflowSessionId','RT\x202.0\x20Validate:','ps:pz:init','\x20\x20\x20Please\x20manually\x20merge\x20or\x20remove\x20','Usage:\x20tdx\x20ps\x20run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Run\x20(requires\x20context)\x0a','addBehaviors','run','parent_segments','\x20\x20\x20See:\x20tdx\x20segment\x20parent\x20pull\x20--help\x0a','✔\x20Found\x20','addAttributesFile','Behavior:','using\x20the\x20default\x20path:\x20','customerGroup','\x20parent\x20segment','Attributes','Parent\x20segment:\x20','utf-8','/attempt/','dim','match','\x5c$&','formatSchemaJson','Validate:','Pattern:\x20','\x20field','Run\x20parent\x20segment\x20workflow\x20(pushes\x20YAML\x20if\x20exists)','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data\x0a','Pull\x20parent\x20segment\x20configuration\x20to\x20YAML\x20file','createParent','previewParentYaml','matchedCount','✔\x20Renamed\x20directory\x20to\x20','processedRows','win32','segment:parent:run','Aborted.','schemaError','Usage:\x20tdx\x20ps\x20view\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20(requires\x20context)\x0a','\x0aNew\x20parent\x20segment\x20\x27','toFixed','List\x20personalization\x20services\x20for\x20a\x20parent\x20segment','getOutputDatabaseName','xdg-open','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20push\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20parent\x20segment','behaviors','Error\x20parsing\x20YAML:\x20','To\x20view\x20sample\x20data:','Join\x20on:','Fetching\x20SQL\x20for\x20\x27','trim','Error:\x20--behavior\x20requires\x20a\x20name\x0a','jobId','session','\x20--attribute\x20\x22<name>\x22','\x20Context\x20set:\x20','stop','true','Master\x20Table','displaySummary','22jCvLlf','\x20--behavior\x20\x22','Options:','Fetching\x20customers\x20schema...','runParent','To\x20cancel:','\x20\x201.\x20Edit\x20','scheduleType','red','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20ps\x20use\x20<name>`\x20to\x20set\x20it.\x0a','listParents','localeCompare','ps:pz:list','.yml','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute\x0a','displayColumns','\x27\x20with\x20ID:\x20','attribute','Add\x20template\x20personalization\x20section\x20to\x20parent\x20segment\x20YAML','\x20\x20Tables:\x201\x20customers\x20+\x20','Apply\x20changes\x20to\x20\x27','column','scheduleOption','\x20\x20-o,\x20--output\x20<file>\x20\x20Output\x20file\x20path','\x20Added\x20RT\x202.0\x20template\x20section','sourceTableValid','collectSchema','\x20\x20\x20\x20','Updating','personalizationServices','`\x20to\x20download\x20the\x20configuration\x20first','updateParent','\x20Saved\x20parent\x20segment\x20configuration\x20to\x20','/\x20and\x20','page_view','Creating','Create\x20parent\x20segment\x20\x27','ignore','YAML\x20file:\x20','Fetching\x20current\x20configuration\x20for\x20\x27','primaryKey','/app/dw/parentSegments/','pullParentYaml','log','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior\x0a','Usage:\x20tdx\x20ps\x20rt\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20RT\x20config\x20(requires\x20context)\x0a','endsWith','type','sampleData','-1d','\x20kill','label','\x27\x20and\x20run\x20workflow?','Error\x20reading\x20file:\x20','addBehaviorsFile','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20--behavior\x20\x22<name>\x22','workflowId','\x20personalization\x20service','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pull\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20parent\x20segment','bold','push','✔\x20Updated\x20parent\x20segment\x20\x27','Database:\x20','column_name','/\x20directory.\x0a','\x20rows\x20','Enriched:','start','\x20\x20--attribute\x20<name>\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20attribute','Attribute:','Schema\x20saved\x20to\x20','Show\x20parent\x20segment\x20schema\x20(column\x20types)','List\x20parent\x20segments\x20with\x20RT\x202.0\x20status','\x20+\x20[','segment','\x0a⚠️\x20\x20Migrating:\x20','limit','Usage:\x20tdx\x20ps\x20sql\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20(requires\x20context)\x0a','rowCount','\x20Added\x20personalization\x20template\x20to\x20','displayValidateResults','Available\x20behaviors:','Updating\x20parent\x20segment\x20\x27','displayRealtimeInfo','segment:parent:validate','last_page_viewed','\x22,\x0a\x20\x20\x22parent_id\x22:\x20\x22','Resolving\x20parent\x20segment\x20\x27','4ujlmmM','Error:\x20No\x20behaviors\x20defined\x20in\x20configuration','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Update\x20existing\x20parent\x20segment\x20(audience)\x20[DEPRECATED]','⚡\x20Enabled','customerGroupFile','format','attributes','valid','\x20Opening\x20','yellow','joinKey','Creating\x20parent\x20segment\x20\x27','\x20RT\x20configuration\x20is\x20valid','\x27...','interval','totalEvents','workflowAttemptId','tdx\x20ps\x20preview\x20','\x20behaviors','allValid','\x22,\x0a\x20\x20\x22parent_segment\x22:\x20\x22','Site:\x20','\x20to\x20push\x20the\x20configuration','\x27\x20is\x20up\x20to\x20date','%)\x20','trigger_event','segment:parent:create','5985208Qyauir','\x20\x20--attribute\x20[name]\x20\x20\x20Show\x20only\x20attributes\x20(or\x20specific\x20one)\x0a','preview','timezone','SELECT\x20*\x20FROM\x20(\x0a','displayAttributesStats','\x0aNo\x20sample\x20data\x20available','/app/workflows/','Audience\x20ID:','\x0a\x20\x20]\x0a}\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','enabled','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data','\x0aChanges\x20to\x20\x27','idStitching','⚠️\x20\x20personalization_services\x20section\x20already\x20exists\x20in\x20','\x20\x20--interval\x20<range>\x20\x20\x20TD_INTERVAL\x20time\x20range\x20for\x20behaviors\x20(default:\x20-1d)','Table:\x20','message','jsonl','The\x20-u\x20flag\x20sets\x20the\x20context\x20to\x20the\x20pulled\x20segment,\x20which\x20requires','✘\x20Failed\x20to\x20rename\x20directory:\x20','Options:\x0a','\x20is\x20already\x20up\x20to\x20date','error','\x20RT-enabled\x20parent\x20segment','displaySampleData','foreignKey','json','reduce','\x20\x20--enriched\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20enriched\x20master\x20data\x0a','\x20\x20Note:\x20','Push\x20parent\x20segment\x20configuration\x20from\x20YAML\x20file','/\x20→\x20','segment:parent:pull','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20total','parentSegment','Customers:','Preview\x20sample\x20data\x20from\x20parent\x20segment\x20YAML\x20configuration','\x20--attribute\x20\x22','Tip:\x20Use\x20-u\x20without\x20-o,\x20or\x20-o\x20without\x20-u','displayPreviewHints','Found\x20YAML\x20file:\x20','validateParentYaml','Updated','unref','✔\x20No\x20changes\x20-\x20\x27','\x0aError:','Listing\x20personalization\x20services\x20for\x20\x27','List\x20available\x20fields\x20for\x20segmentation','Analyzing\x20changes...','segment:parent:desc','\x20configured','\x20\x20--master\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20sample\x20master\x20table\x20data','Listing\x20fields\x20for\x20\x27','/\x20directories\x20exist.','2060095fITABL','Usage:\x20tdx\x20ps\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Preview\x20(requires\x20context)\x0a','\x20No\x20changes\x20-\x20','Available\x20attributes:','segment:parent:preview','\x20\x20\x20','green','getParentSQL','data','database','\x20\x20--behavior\x20<name>\x20\x20\x20\x20Show\x20sample\x20data\x20for\x20specific\x20behavior','Error:\x20At\x20least\x20one\x20preview\x20option\x20required\x0a','single','column_type','✔\x20Created\x20parent\x20segment\x20\x27','Output\x20Database:','Master\x20+\x20Attributes','dirname','displayPreviewResults','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20fields\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20fields\x20for\x20specific\x20parent\x20segment','\x0aUsage:\x20tdx\x20ps\x20preview\x20','elapsedTimeMillis','displayBehaviorsStats','cyan','behavior','keys','enriched','\x0a\x20\x20},\x0a\x20\x20\x22behaviors\x22:\x20[\x0a','\x22,\x0a\x20\x20\x20\x20\x20\x20\x22columns\x22:\x20','segment:parent:fields','Error:\x20No\x20attributes\x20defined\x20in\x20configuration','Error:\x20--database\x20and\x20--table\x20are\x20required','apply','\x20\x20\x20Use\x20`tdx\x20segment\x20parent\x20push\x20<file.yml>`\x20instead\x20for\x20better\x20configuration\x20management.\x0a','td_client_id','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20view\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20View\x20specific\x20parent\x20segment\x0a\x0a','behavior_','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20update`\x20is\x20deprecated.\x0a','\x0a⚠️\x20\x20DEPRECATED:\x20`tdx\x20segment\x20parent\x20create`\x20is\x20deprecated.\x0a','double','darwin','20jyIKLb','behaviorsFile','\x20tdx\x20wf\x20attempt\x20','10198332dvmuuc','segment:parent:view','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Name:\x20','Coverage:','Fetching\x20parent\x20segment\x20\x27','Errors:','customerPercent','\x20section','No\x20RT-enabled\x20parent\x20segments\x20found','columns','/{name}.yml\x0a','9523276ngNVdi','parent_segment','audienceId','10811130OcJKMX','Events:','information_schema','\x0aChanges\x20to\x20apply\x20to\x20\x27','name','Error:','42657dLhMQG','setJobId','Session:','table','personalization_services','pushParentYaml','query','Created','Execute\x20parent\x20segment\x20SQL\x20query\x20and\x20show\x20results','getBehaviorNames','description','customers','segment:parent:push','\x20\x20Database:\x20','text','Validate\x20RT\x202.0\x20configuration\x20from\x20parent\x20segment\x20YAML','getParentFull','events','SQL\x20query:\x0a','output','.customers)','\x20--interval\x20','repeat','Options\x20(one\x20required):\x0a','string','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20validate\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20specific\x20parent\x20segment\x0a\x0a','Usage:\x20tdx\x20ps\x20pz\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20(requires\x20context)\x0a','ps:rt:validate','realtime_enabled','👥\x20','\x20\x20Columns:\x20','sort','\x20to\x20configure\x20your\x20personalization\x20service','Fetching\x20sample\x20data...','Usage:\x20tdx\x20segment\x20parent\x20create\x20<name>\x20--database\x20<db>\x20--table\x20<table>','population','realtime','\x20\x20\x20\x20-\x20','map','varchar','coveragePercent','\x0a✔\x20Workflow\x20started','resolveParentId','\x20parent\x20segment\x20\x27','segment:parent:sql','Fetching\x20behavior\x20list...','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20show\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20for\x20specific\x20parent\x20segment','\x0a\x20\x20\x20\x20}','Validating\x20RT\x20configuration...','1095872RRFMsV','all','RT\x202.0:','\x20=\x20','Usage:\x20tdx\x20ps\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20(requires\x20context)\x0a','schemaValid','yes','execute','Usage:\x20tdx\x20parent-segment\x20preview\x20<name>\x20<option>\x0a','errors','segment:parent:list','Columns:','replace','No\x20parent\x20segments\x20match\x20pattern:\x20','Executing\x20parent\x20segment\x20query...','Behaviors','Personalization\x20service\x20description','\x20[Job\x20ID:\x20','stats','verbose','{\x0a\x20\x20\x22database\x22:\x20\x22','segment:parent:show','toLocaleString','Usage:\x20tdx\x20ps\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20(requires\x20context)\x0a','sourceTableError','Output\x20file:\x20','attributesFile','Overwrite\x20\x27','in\x20','user_id','open','Get\x20SQL\x20query\x20for\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20sql\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20SQL\x20for\x20specific\x20parent\x20segment','FINISHED','list','Join:','Show\x20parent\x20segment\x20details','\x22,\x0a\x20\x20\x20\x20\x22columns\x22:\x20'];a30_0x22a5=function(){return _0x4f77d0;};return a30_0x22a5();}export class ParentSegmentShowCommand extends BaseCommand{['name']=a30_0x4c2f14(0x24a);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0x20c);async['execute'](_0x174a20){const _0x4afbe6=a30_0x4c2f14,{options:_0x53542c,args:_0x1256d3,tdx:_0x125683}=_0x174a20,_0x37bf36=_0x1256d3[0x0]||_0x53542c['parentSegment'];if(!_0x37bf36)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20show\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20config\x20(requires\x20context)\x0a'+_0x4afbe6(0x232)),0x1;_0x53542c[_0x4afbe6(0x248)]&&(console[_0x4afbe6(0x1a2)](_0x4afbe6(0x184)+_0x53542c[_0x4afbe6(0x260)]),console['error'](_0x4afbe6(0x274)+_0x37bf36));const _0x38d037=await withSpinner(_0x4afbe6(0x16d)+_0x37bf36+_0x4afbe6(0x17c),()=>_0x125683['segment']['resolveParentId'](_0x37bf36),{'verbose':_0x53542c[_0x4afbe6(0x248)]}),_0x5f4b76=_0x38d037['data'],_0x6da865=await withSpinner(_0x4afbe6(0x10a)+_0x37bf36+_0x4afbe6(0x17c),()=>_0x125683['segment'][_0x4afbe6(0x1ca)](_0x5f4b76),{'verbose':_0x53542c[_0x4afbe6(0x248)]});let _0x382314=_0x6da865[_0x4afbe6(0x1cb)];const _0xeaaf12=resolveLimit(_0x53542c[_0x4afbe6(0x162)],DEFAULT_DISPLAY_LIMIT),_0x2ce27c=/\bLIMIT\s+\d+/i['test'](_0x382314);!_0x2ce27c&&(_0x382314=_0x382314[_0x4afbe6(0x10b)]()[_0x4afbe6(0x241)](/;+$/,''),_0x382314=_0x4afbe6(0x18e)+_0x382314+_0x4afbe6(0x170)+_0xeaaf12);_0x53542c[_0x4afbe6(0x248)]&&console[_0x4afbe6(0x1a2)](_0x4afbe6(0x216)+_0x382314);const _0x34ad01=await withProgressSpinner(_0x4afbe6(0x243),async _0x38cc29=>{const _0x1aec9f=_0x4afbe6,_0x56e768=await _0x125683[_0x1aec9f(0x20a)][_0x1aec9f(0x23c)](_0x382314,{'catalog':'td','schema':_0x1aec9f(0x200),'onJobId':_0x45ff40=>{const _0x5b3a77=_0x1aec9f;_0x38cc29[_0x5b3a77(0x205)](_0x45ff40);}});return _0x56e768;},{'verbose':_0x53542c[_0x4afbe6(0x248)]}),_0x5e2093=_0x34ad01[_0x4afbe6(0x1cb)],_0x339082=_0x5e2093['jobId']?_0x4afbe6(0x246)+_0x5e2093[_0x4afbe6(0x10d)]+']':'';return console['error']('✔\x20Query\x20completed:\x20Processed\x20'+_0x5e2093[_0x4afbe6(0x247)][_0x4afbe6(0xfa)][_0x4afbe6(0x24b)]()+_0x4afbe6(0x157)+(_0x4afbe6(0x251)+formatElapsed(_0x5e2093[_0x4afbe6(0x247)][_0x4afbe6(0x1d8)])+_0x339082)),await handleQueryOutput(_0x5e2093,_0x53542c),0x0;}}export class PSRtListCommand extends BaseCommand{[a30_0x4c2f14(0x202)]='ps:rt:list';['description']=a30_0x4c2f14(0x15e);async['execute'](_0x24aa5f){const _0x3a339c=a30_0x4c2f14,{options:_0xc8334e,args:_0x2e8296,tdx:_0x42fbe8}=_0x24aa5f,_0x4a7b48=_0x2e8296[0x0],_0x456579=await withSpinner(_0x4a7b48?_0x3a339c(0x25c)+_0x4a7b48+_0x3a339c(0x17c):'Listing\x20RT-enabled\x20parent\x20segments...',()=>_0x42fbe8['realtime'][_0x3a339c(0x257)](),{'verbose':_0xc8334e['verbose']});let _0x31be6f=_0x456579[_0x3a339c(0x1cb)]['filter'](_0x57d671=>_0x57d671[_0x3a339c(0x220)]);if(_0x4a7b48){const _0x2d7273=_0x4a7b48[_0x3a339c(0x241)](/[.+^${}()|[\]\\]/g,_0x3a339c(0x279))['replace'](/\*/g,'.*')[_0x3a339c(0x241)](/\?/g,'.'),_0x3f698d=new RegExp('^'+_0x2d7273+'$','i');_0x31be6f=_0x31be6f[_0x3a339c(0x262)](_0x5917ee=>_0x3f698d['test'](_0x5917ee[_0x3a339c(0x202)]));}_0x31be6f[_0x3a339c(0x223)]((_0x3ef814,_0x12da5b)=>_0x3ef814[_0x3a339c(0x202)][_0x3a339c(0x120)](_0x12da5b['name'])),console[_0x3a339c(0x1a2)](_0x3a339c(0x26d)+_0x31be6f[_0x3a339c(0x25e)]+_0x3a339c(0x1a3)+(_0x31be6f[_0x3a339c(0x25e)]!==0x1?'s':''));const _0x516cac=_0x30a5dc=>{const _0x38712b=_0x3a339c;return getConsoleNextUrl(_0xc8334e['site'],_0x38712b(0x13e)+_0x30a5dc);};if(_0xc8334e[_0x3a339c(0x174)]===_0x3a339c(0x1a6)||_0xc8334e[_0x3a339c(0x174)]===_0x3a339c(0x19d)){const _0x32479c=_0x31be6f['map'](_0x57d980=>({..._0x57d980,'url':_0x516cac(_0x57d980['id'])}));await handleSDKOutput(_0x32479c,_0xc8334e);}else{if(_0x31be6f[_0x3a339c(0x25e)]===0x0)console[_0x3a339c(0x140)](_0x3a339c(0x1f8));else for(const _0x12f857 of _0x31be6f){const _0x16c371=_0x12f857[_0x3a339c(0x227)]?a30_0x29defe[_0x3a339c(0x277)]('\x20('+formatRows(_0x12f857[_0x3a339c(0x227)])+')'):'',_0x43cdc0=hyperlink(_0x12f857[_0x3a339c(0x202)],_0x516cac(_0x12f857['id']));console[_0x3a339c(0x140)]('⚡\x20'+_0x43cdc0+_0x16c371);}}return 0x0;}}export class PSRtValidateCommand extends BaseParentSegmentCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x21f);[a30_0x4c2f14(0x20e)]=a30_0x4c2f14(0x213);async['execute'](_0x4bc0bf){const _0x28092d=a30_0x4c2f14,{options:_0x107f50,args:_0x50aeac,tdx:_0x24bc3a}=_0x4bc0bf,_0x6d644f=_0x50aeac[0x0]||_0x107f50['parentSegment'];if(!_0x6d644f)return showParentSegmentNotSetError(_0x28092d(0x142)+_0x28092d(0x25d)),0x1;const _0x4dd950=resolveYamlFile(_0x6d644f);if(!existsSync(_0x4dd950))return showFileNotFoundError(_0x4dd950,_0x6d644f),0x1;let _0x2fbd92;try{_0x2fbd92=readFileSync(_0x4dd950,_0x28092d(0x275));}catch(_0x2f8f71){const _0x2c5fb0=_0x2f8f71 instanceof Error?_0x2f8f71[_0x28092d(0x19c)]:String(_0x2f8f71);return console[_0x28092d(0x1a2)](_0x28092d(0x14a)+_0x2c5fb0),0x1;}const _0xe83b31=createCommandSpinner(a30_0x29defe[_0x28092d(0x277)](_0x28092d(0x234)),{'verbose':_0x107f50['verbose']});_0xe83b31[_0x28092d(0x159)]();const _0x36630a={'realtime':!![],'onProgress':_0x4bad49=>{const _0x37980d=_0x28092d;_0xe83b31[_0x37980d(0x212)]=formatProgressMessage(_0x4bad49);}};let _0x12a29f;try{_0x12a29f=await _0x24bc3a[_0x28092d(0x160)]['validateParentYaml'](_0x2fbd92,_0x36630a),_0xe83b31['stop']();}catch(_0x59f378){_0xe83b31[_0x28092d(0x111)]();throw _0x59f378;}console[_0x28092d(0x1a2)]('\x0a'+a30_0x29defe[_0x28092d(0x151)](_0x28092d(0x265))+'\x20'+_0x12a29f[_0x28092d(0x202)]),console[_0x28092d(0x1a2)]('═'[_0x28092d(0x21a)](0x3c)),displayRealtimeValidation(_0x12a29f),console['error']('─'['repeat'](0x3c));if(_0x12a29f['errors'][_0x28092d(0x25e)]>0x0){console[_0x28092d(0x1a2)]('\x0a'+a30_0x29defe['red'](_0x28092d(0x1f5)));for(const _0x1ae2ac of _0x12a29f[_0x28092d(0x23e)]){console[_0x28092d(0x1a2)]('\x20\x20'+a30_0x29defe['red']('•')+'\x20'+_0x1ae2ac);}}return _0x12a29f[_0x28092d(0x182)]&&console[_0x28092d(0x1a2)]('\x0a'+a30_0x29defe[_0x28092d(0x1c9)]('✔')+_0x28092d(0x17b)),_0x12a29f[_0x28092d(0x182)]?0x0:0x1;}}export class PSPzListCommand extends BaseCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x121);['description']=a30_0x4c2f14(0x102);async['execute'](_0x5d4232){const _0x4116ac=a30_0x4c2f14,{options:_0x1b72c0,args:_0x5af53d,tdx:_0x438e7b}=_0x5d4232,_0x5bb234=_0x5af53d[0x0]||_0x1b72c0['parentSegment'];if(!_0x5bb234)return showParentSegmentNotSetError('Usage:\x20tdx\x20ps\x20pz\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20(requires\x20context)\x0a'+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20list\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20List\x20PZ\x20services\x20for\x20specific\x20parent\x20segment'),0x1;const _0x4bcc66=await withSpinner(_0x4116ac(0x16d)+_0x5bb234+'\x27...',()=>_0x438e7b[_0x4116ac(0x160)]['resolveParentId'](_0x5bb234),{'verbose':_0x1b72c0[_0x4116ac(0x248)]}),_0x215925=_0x4bcc66[_0x4116ac(0x1cb)],_0x2681fb=await withSpinner(_0x4116ac(0x1bb)+_0x5bb234+'\x27...',()=>_0x438e7b['personalization'][_0x4116ac(0x257)](_0x215925),{'verbose':_0x1b72c0['verbose']}),_0x30b89c=_0x2681fb['data'];console[_0x4116ac(0x1a2)](_0x4116ac(0x26d)+_0x30b89c[_0x4116ac(0x25e)]+_0x4116ac(0x14f)+(_0x30b89c[_0x4116ac(0x25e)]!==0x1?'s':''));if(_0x1b72c0[_0x4116ac(0x174)]===_0x4116ac(0x1a6)||_0x1b72c0[_0x4116ac(0x174)]==='jsonl')await handleSDKOutput(_0x30b89c,_0x1b72c0);else{if(_0x30b89c[_0x4116ac(0x25e)]===0x0)console[_0x4116ac(0x140)]('No\x20personalization\x20services\x20configured'),console['error'](a30_0x29defe[_0x4116ac(0x1da)]('\x0aTip:\x20Run\x20`tdx\x20ps\x20pz\x20init`\x20to\x20add\x20a\x20template\x20personalization\x20section\x20to\x20your\x20YAML'));else for(const _0x2c3347 of _0x30b89c){const _0x34606d=_0x2c3347['sections']?.[_0x4116ac(0x25e)]||0x0,_0x32f595=_0x2c3347['trigger_event']?a30_0x29defe['dim']('\x20trigger='+_0x2c3347[_0x4116ac(0x188)]):'',_0xde0f80=a30_0x29defe['dim']('\x20('+_0x34606d+_0x4116ac(0x1f7)+(_0x34606d!==0x1?'s':'')+')');console['log']('\x20\x20'+_0x2c3347[_0x4116ac(0x202)]+_0x32f595+_0xde0f80),_0x2c3347[_0x4116ac(0x20e)]&&console['log']('\x20\x20\x20\x20'+a30_0x29defe[_0x4116ac(0x277)](_0x2c3347[_0x4116ac(0x20e)]));}}return 0x0;}}export class PSPzInitCommand extends BaseParentSegmentCommand{[a30_0x4c2f14(0x202)]=a30_0x4c2f14(0x266);['description']=a30_0x4c2f14(0x127);async[a30_0x4c2f14(0x23c)](_0x8a9c4a){const _0x2926f1=a30_0x4c2f14,{options:_0x728b,args:_0x2c2de6}=_0x8a9c4a,_0x2f8b03=_0x2c2de6[0x0]||_0x728b[_0x2926f1(0x1af)];if(!_0x2f8b03)return showParentSegmentNotSetError(_0x2926f1(0x21e)+'\x20\x20\x20\x20\x20\x20\x20tdx\x20ps\x20pz\x20init\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Add\x20PZ\x20template\x20for\x20specific\x20parent\x20segment'),0x1;const _0x2f58e8=resolveYamlFile(_0x2f8b03);if(!existsSync(_0x2f58e8))return showFileNotFoundError(_0x2f58e8,_0x2f8b03),0x1;let _0x57852a;try{_0x57852a=readFileSync(_0x2f58e8,_0x2926f1(0x275));}catch(_0x2bddb4){const _0x87cde4=_0x2bddb4 instanceof Error?_0x2bddb4[_0x2926f1(0x19c)]:String(_0x2bddb4);return console[_0x2926f1(0x1a2)]('Error\x20reading\x20file:\x20'+_0x87cde4),0x1;}let _0x1e476f;try{_0x1e476f=parseDef(_0x57852a);}catch(_0x4a32d2){const _0x5561ee=_0x4a32d2 instanceof Error?_0x4a32d2[_0x2926f1(0x19c)]:String(_0x4a32d2);return console[_0x2926f1(0x1a2)](a30_0x29defe[_0x2926f1(0x11d)](_0x2926f1(0x107)+_0x5561ee)),0x1;}if(_0x1e476f[_0x2926f1(0x208)]&&_0x1e476f['personalization_services'][_0x2926f1(0x25e)]>0x0)return console['error'](a30_0x29defe['yellow'](_0x2926f1(0x199)+_0x2f58e8)),console[_0x2926f1(0x1a2)](a30_0x29defe['dim'](_0x2926f1(0x1c8)+_0x1e476f[_0x2926f1(0x208)]['length']+'\x20service(s)\x20configured')),0x1;!_0x1e476f[_0x2926f1(0x228)]&&(_0x1e476f['realtime']={'events':[{'name':_0x2926f1(0x137),'source_table':'<database>.<table>'}],'attributes':[{'name':_0x2926f1(0x16b),'type':_0x2926f1(0x1cf)}],'id_stitching':{'primary_key':_0x1e476f[_0x2926f1(0x261)]['table']===_0x2926f1(0x20f)?_0x2926f1(0x1e5):_0x2926f1(0x252)}});_0x1e476f['personalization_services']=[{'name':'My\x20Service','description':_0x2926f1(0x245),'trigger_event':'page_view','sections':[{'name':'Default','criteria':_0x2926f1(0x112),'attributes':[_0x2926f1(0x16b)]}]}];const _0xa5d0c0=serializeDef(_0x1e476f);return writeFileSync(_0x2f58e8,_0xa5d0c0,_0x2926f1(0x275)),console[_0x2926f1(0x1a2)](a30_0x29defe[_0x2926f1(0x1c9)]('✔')+_0x2926f1(0x165)+a30_0x29defe[_0x2926f1(0x1da)](_0x2f58e8)),(!_0x1e476f[_0x2926f1(0x228)]||_0x57852a['indexOf']('realtime:')===-0x1)&&console[_0x2926f1(0x1a2)](a30_0x29defe['green']('✔')+_0x2926f1(0x12d)),console[_0x2926f1(0x1a2)]('\x0a'+a30_0x29defe['dim']('Next\x20steps:')),console[_0x2926f1(0x1a2)](_0x2926f1(0x11b)+_0x2f58e8+_0x2926f1(0x224)),console[_0x2926f1(0x1a2)]('\x20\x202.\x20Run\x20'+a30_0x29defe['dim']('tdx\x20ps\x20push\x20'+_0x2f8b03)+_0x2926f1(0x185)),0x0;}}
@@ -1 +1 @@
1
- const a31_0x1df341=a31_0x1265;(function(_0xdf65c,_0x3cda8d){const _0x4b7475=a31_0x1265,_0x4a2f11=_0xdf65c();while(!![]){try{const _0x5989af=parseInt(_0x4b7475(0x93))/0x1+-parseInt(_0x4b7475(0x89))/0x2+-parseInt(_0x4b7475(0xa4))/0x3+parseInt(_0x4b7475(0x76))/0x4+-parseInt(_0x4b7475(0x77))/0x5*(parseInt(_0x4b7475(0xab))/0x6)+-parseInt(_0x4b7475(0x95))/0x7*(parseInt(_0x4b7475(0xa7))/0x8)+parseInt(_0x4b7475(0xa0))/0x9*(parseInt(_0x4b7475(0x98))/0xa);if(_0x5989af===_0x3cda8d)break;else _0x4a2f11['push'](_0x4a2f11['shift']());}catch(_0x5d2bc3){_0x4a2f11['push'](_0x4a2f11['shift']());}}}(a31_0x3dd2,0x455ce));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a31_0x3dd2(){const _0x332781=['Account\x20Owner','👥\x20Assigned\x20Users','58670joOoGF','email','\x20—\x20','ies','log','name','verbose','policy','1314hHuPuX','policy\x20list','data','getPolicy','392100EAcAwt','all','listPolicies','496EtXgoR','Show\x20a\x20specific\x20policy\x20details\x20and\x20permissions\x20(admin\x20only)','description','✔\x20Found\x20','1895592ceYxVJ','account_id','Fetching\x20permissions...','Usage:\x20tdx\x20policy\x20show\x20<policy-name-or-id>','(ID:\x20','2203684gHplOu','5xeRLvR','Show\x20current\x20user\x20policies\x20and\x20effective\x20permissions','account_owner','Administrator','user',',\x20user_id:','🔑\x20Effective\x20Permissions','getCurrent','\x20\x20\x20','bold','policies','\x20user','map','args','length','site','execute','operation','1097652xGdYyO','policy\x20show','entries','error','\x20\x20No\x20policies\x20assigned','\x20\x20No\x20permissions','Listing\x20policies...','padEnd','permissions','\x20assigned','14975QUISZh','dim','16135GdEBho'];a31_0x3dd2=function(){return _0x332781;};return a31_0x3dd2();}import{withSpinner}from'../utils/spinner.js';import a31_0x4e84ae from'chalk';export class PolicyCommand extends BaseCommand{[a31_0x1df341(0x9d)]=a31_0x1df341(0x9f);[a31_0x1df341(0xa9)]=a31_0x1df341(0x78);async[a31_0x1df341(0x87)](_0x2453fc){const _0x392fe7=a31_0x1df341,{options:_0x25fc1f,tdx:_0x2762ab}=_0x2453fc,_0x463f3e=await withSpinner(_0x392fe7(0xad),async()=>{const _0x294f56=_0x392fe7,[_0x3569b2,_0x587f49]=await Promise['all']([_0x2762ab[_0x294f56(0x7b)][_0x294f56(0x7e)](),_0x2762ab[_0x294f56(0x9f)]['getMyPermissions']()]);return{'userInfo':_0x3569b2,'permissions':_0x587f49};},{'verbose':_0x25fc1f['verbose']}),{userInfo:_0x41fdc2,permissions:_0x4be4be}=_0x463f3e['data'];if(isStructuredFormat(_0x25fc1f))return await handleSingleObjectOutput(_0x4be4be,_0x25fc1f),0x0;const _0x37054d=_0x41fdc2[_0x392fe7(0x79)]?_0x392fe7(0x96):_0x41fdc2['administrator']?_0x392fe7(0x7a):'Member';console[_0x392fe7(0x9c)]('\x0a'+a31_0x4e84ae[_0x392fe7(0x80)]('👤')+'\x20'+a31_0x4e84ae[_0x392fe7(0x80)](_0x41fdc2[_0x392fe7(0x9d)])+'\x20'+a31_0x4e84ae[_0x392fe7(0x94)]('('+_0x41fdc2[_0x392fe7(0x99)]+')')+'\x20—\x20'+_0x37054d),console[_0x392fe7(0x9c)](a31_0x4e84ae['dim']('\x20\x20\x20'+_0x2762ab['context'][_0x392fe7(0x86)]+':'+_0x41fdc2[_0x392fe7(0xac)]+_0x392fe7(0x7c)+_0x41fdc2['id']));const _0x3e5cb7=_0x4be4be[_0x392fe7(0x81)];console[_0x392fe7(0x9c)]('\x0a'+a31_0x4e84ae[_0x392fe7(0x80)]('📋\x20Assigned\x20Policies')+'\x20('+_0x3e5cb7['length']+'):');if(_0x3e5cb7['length']===0x0)console[_0x392fe7(0x9c)](a31_0x4e84ae[_0x392fe7(0x94)](_0x392fe7(0x8d)));else for(const _0x463f16 of _0x3e5cb7){console[_0x392fe7(0x9c)]('\x20\x20•\x20'+_0x463f16[_0x392fe7(0x9d)]);}return printPermissionsMap(_0x4be4be['permissions']),console[_0x392fe7(0x9c)](),0x0;}}export class PolicyListCommand extends BaseCommand{[a31_0x1df341(0x9d)]=a31_0x1df341(0xa1);[a31_0x1df341(0xa9)]='List\x20all\x20policies\x20in\x20the\x20account\x20(admin\x20only)';async[a31_0x1df341(0x87)](_0x3080c2){const _0x2ade24=a31_0x1df341,{options:_0x2a736d,tdx:_0x11398a}=_0x3080c2,_0x215597=await withSpinner(_0x2ade24(0x8f),()=>_0x11398a['policy'][_0x2ade24(0xa6)](),{'verbose':_0x2a736d['verbose']}),_0x28f396=_0x215597['data'];console[_0x2ade24(0x8c)](_0x2ade24(0xaa)+_0x28f396['length']+'\x20polic'+(_0x28f396[_0x2ade24(0x85)]!==0x1?_0x2ade24(0x9b):'y'));if(isStructuredFormat(_0x2a736d))return await handleSDKOutput(_0x28f396,_0x2a736d),0x0;if(_0x28f396['length']===0x0)console['log'](a31_0x4e84ae[_0x2ade24(0x94)]('No\x20policies\x20found'));else for(const _0x20dadf of _0x28f396){const _0x5cc045=_0x20dadf[_0x2ade24(0xa9)]?a31_0x4e84ae[_0x2ade24(0x94)](_0x2ade24(0x9a)+_0x20dadf['description']):'';console[_0x2ade24(0x9c)]('\x20\x20•\x20'+_0x20dadf['name']+_0x5cc045);}return 0x0;}}export class PolicyShowCommand extends BaseCommand{['name']=a31_0x1df341(0x8a);[a31_0x1df341(0xa9)]=a31_0x1df341(0xa8);['validate'](_0x4534cb){const _0x3ccada=a31_0x1df341;if(_0x4534cb[_0x3ccada(0x84)][_0x3ccada(0x85)]===0x0)return _0x3ccada(0x74);return undefined;}async[a31_0x1df341(0x87)](_0x410fa4){const _0x21c8ed=a31_0x1df341,{options:_0x4fdeb0,tdx:_0x5edfc7}=_0x410fa4,_0x4a2d0f=_0x410fa4[_0x21c8ed(0x84)][0x0],_0x283212=await withSpinner('Fetching\x20policy...',async()=>{const _0x41f2b3=_0x21c8ed,_0x1488b0=await _0x5edfc7['policy'][_0x41f2b3(0xa3)](_0x4a2d0f),[_0x23d4dc,_0x1b83f6]=await Promise[_0x41f2b3(0xa5)]([_0x5edfc7[_0x41f2b3(0x9f)]['getPolicyPermissions'](_0x1488b0['id']),_0x5edfc7[_0x41f2b3(0x9f)]['getPolicyUsers'](_0x1488b0['id'])]);return{'policy':_0x1488b0,'perms':_0x23d4dc,'users':_0x1b83f6};},{'verbose':_0x4fdeb0[_0x21c8ed(0x9e)]}),{policy:_0x2e1714,perms:_0x484529,users:_0x109e74}=_0x283212[_0x21c8ed(0xa2)];if(isStructuredFormat(_0x4fdeb0))return await handleSingleObjectOutput({..._0x2e1714,'permissions':_0x484529[_0x21c8ed(0x91)],'users':_0x109e74},_0x4fdeb0),0x0;console[_0x21c8ed(0x9c)]('\x0a'+a31_0x4e84ae[_0x21c8ed(0x80)]('📋')+'\x20'+a31_0x4e84ae[_0x21c8ed(0x80)](_0x2e1714[_0x21c8ed(0x9d)])+'\x20'+a31_0x4e84ae[_0x21c8ed(0x94)](_0x21c8ed(0x75)+_0x2e1714['id']+')'));_0x2e1714[_0x21c8ed(0xa9)]&&console[_0x21c8ed(0x9c)](_0x21c8ed(0x7f)+a31_0x4e84ae[_0x21c8ed(0x94)](_0x2e1714['description']));console[_0x21c8ed(0x9c)](_0x21c8ed(0x7f)+_0x109e74[_0x21c8ed(0x85)]+_0x21c8ed(0x82)+(_0x109e74[_0x21c8ed(0x85)]!==0x1?'s':'')+_0x21c8ed(0x92)),printPermissionsMap(_0x484529[_0x21c8ed(0x91)]);if(_0x109e74['length']>0x0){console[_0x21c8ed(0x9c)]('\x0a'+a31_0x4e84ae[_0x21c8ed(0x80)](_0x21c8ed(0x97))+':');for(const _0x2958f4 of _0x109e74){const _0xc6635=_0x2958f4[_0x21c8ed(0x99)]&&_0x2958f4['email']!==_0x2958f4[_0x21c8ed(0x9d)]?a31_0x4e84ae[_0x21c8ed(0x94)]('\x20<'+_0x2958f4[_0x21c8ed(0x99)]+'>'):'';console[_0x21c8ed(0x9c)]('\x20\x20•\x20'+_0x2958f4[_0x21c8ed(0x9d)]+_0xc6635);}}return console[_0x21c8ed(0x9c)](),0x0;}}function printPermissionsMap(_0x42284a){const _0xb4324e=a31_0x1df341,_0x3f94d2=Object[_0xb4324e(0x8b)](_0x42284a);console[_0xb4324e(0x9c)]('\x0a'+a31_0x4e84ae[_0xb4324e(0x80)](_0xb4324e(0x7d))+':');if(_0x3f94d2[_0xb4324e(0x85)]===0x0){console[_0xb4324e(0x9c)](a31_0x4e84ae[_0xb4324e(0x94)](_0xb4324e(0x8e)));return;}const _0x407b11=Math['max'](..._0x3f94d2[_0xb4324e(0x83)](([_0x37c358])=>_0x37c358[_0xb4324e(0x85)]));for(const [_0x2aa195,_0x34cc58]of _0x3f94d2){const _0x3e2c42=formatOperations(_0x34cc58);console[_0xb4324e(0x9c)]('\x20\x20'+_0x2aa195[_0xb4324e(0x90)](_0x407b11+0x2)+_0x3e2c42);}}function a31_0x1265(_0x310651,_0x29f847){_0x310651=_0x310651-0x74;const _0x3dd23f=a31_0x3dd2();let _0x1265dd=_0x3dd23f[_0x310651];return _0x1265dd;}function formatOperations(_0x250fdb){const _0x38833c=a31_0x1df341,_0x334b18=[...new Set(_0x250fdb[_0x38833c(0x83)](_0x4d2101=>_0x4d2101[_0x38833c(0x88)]))];return _0x334b18['join'](',\x20');}
1
+ const a31_0x458600=a31_0x55cd;(function(_0x277221,_0x3852b3){const _0x2df5e2=a31_0x55cd,_0x3b15fa=_0x277221();while(!![]){try{const _0xbf1b61=-parseInt(_0x2df5e2(0x1f6))/0x1*(parseInt(_0x2df5e2(0x21e))/0x2)+-parseInt(_0x2df5e2(0x205))/0x3*(-parseInt(_0x2df5e2(0x20b))/0x4)+-parseInt(_0x2df5e2(0x1f3))/0x5*(parseInt(_0x2df5e2(0x200))/0x6)+-parseInt(_0x2df5e2(0x1e7))/0x7*(parseInt(_0x2df5e2(0x215))/0x8)+parseInt(_0x2df5e2(0x206))/0x9*(parseInt(_0x2df5e2(0x1f4))/0xa)+-parseInt(_0x2df5e2(0x209))/0xb+parseInt(_0x2df5e2(0x1fc))/0xc;if(_0xbf1b61===_0x3852b3)break;else _0x3b15fa['push'](_0x3b15fa['shift']());}catch(_0x58b04a){_0x3b15fa['push'](_0x3b15fa['shift']());}}}(a31_0x5743,0x4b1f8));import{BaseCommand}from'./command.js';function a31_0x5743(){const _0x583f5c=['permissions','1gBYomy','ies','Fetching\x20permissions...','📋\x20Assigned\x20Policies','data','description','7527408nmKYrQ','map','Administrator','getMyPermissions','48SWIrUc','max','getPolicyUsers','Account\x20Owner','getCurrent','16578MEPUEq','1566018tPipOl','execute','getPolicy','4864079EESvUa','validate','424KpchSR','account_id','\x20polic','🔑\x20Effective\x20Permissions','account_owner','entries','error','dim','\x20user','No\x20policies\x20found','1814672OBuBya','\x20\x20\x20','bold','(ID:\x20','Fetching\x20policy...','verbose','operation','log','user','104758ZoMdge','\x20\x20•\x20','site','\x20—\x20','Show\x20a\x20specific\x20policy\x20details\x20and\x20permissions\x20(admin\x20only)','length','policy\x20show','args','\x20assigned','7AcFzuQ','policies','Listing\x20policies...','👥\x20Assigned\x20Users','name','padEnd','\x20\x20No\x20permissions','policy','all','✔\x20Found\x20','Member','email','223710lZCuMR','10IMxlrB'];a31_0x5743=function(){return _0x583f5c;};return a31_0x5743();}import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import a31_0x930920 from'chalk';function a31_0x55cd(_0x3ae766,_0x52bdc1){_0x3ae766=_0x3ae766-0x1e2;const _0x57430e=a31_0x5743();let _0x55cd25=_0x57430e[_0x3ae766];return _0x55cd25;}export class PolicyCommand extends BaseCommand{[a31_0x458600(0x1eb)]='policy';[a31_0x458600(0x1fb)]='Show\x20current\x20user\x20policies\x20and\x20effective\x20permissions';async[a31_0x458600(0x207)](_0x479d9e){const _0x515311=a31_0x458600,{options:_0x2dc2ea,tdx:_0x3f1a80}=_0x479d9e,_0x563c91=await withSpinner(_0x515311(0x1f8),async()=>{const _0x11c9de=_0x515311,[_0x3ff620,_0x5e8157]=await Promise[_0x11c9de(0x1ef)]([_0x3f1a80[_0x11c9de(0x21d)][_0x11c9de(0x204)](),_0x3f1a80[_0x11c9de(0x1ee)][_0x11c9de(0x1ff)]()]);return{'userInfo':_0x3ff620,'permissions':_0x5e8157};},{'verbose':_0x2dc2ea['verbose']}),{userInfo:_0xd16bbe,permissions:_0x205588}=_0x563c91[_0x515311(0x1fa)];if(isStructuredFormat(_0x2dc2ea))return await handleSingleObjectOutput(_0x205588,_0x2dc2ea),0x0;const _0x24eef6=_0xd16bbe[_0x515311(0x20f)]?_0x515311(0x203):_0xd16bbe['administrator']?_0x515311(0x1fe):_0x515311(0x1f1);console[_0x515311(0x21c)]('\x0a'+a31_0x930920['bold']('👤')+'\x20'+a31_0x930920[_0x515311(0x217)](_0xd16bbe['name'])+'\x20'+a31_0x930920[_0x515311(0x212)]('('+_0xd16bbe['email']+')')+_0x515311(0x221)+_0x24eef6),console['log'](a31_0x930920[_0x515311(0x212)](_0x515311(0x216)+_0x3f1a80['context'][_0x515311(0x220)]+':'+_0xd16bbe[_0x515311(0x20c)]+',\x20user_id:'+_0xd16bbe['id']));const _0x5db91e=_0x205588[_0x515311(0x1e8)];console[_0x515311(0x21c)]('\x0a'+a31_0x930920['bold'](_0x515311(0x1f9))+'\x20('+_0x5db91e['length']+'):');if(_0x5db91e['length']===0x0)console['log'](a31_0x930920[_0x515311(0x212)]('\x20\x20No\x20policies\x20assigned'));else for(const _0xce8ff3 of _0x5db91e){console['log'](_0x515311(0x21f)+_0xce8ff3[_0x515311(0x1eb)]);}return printPermissionsMap(_0x205588[_0x515311(0x1f5)]),console[_0x515311(0x21c)](),0x0;}}export class PolicyListCommand extends BaseCommand{['name']='policy\x20list';['description']='List\x20all\x20policies\x20in\x20the\x20account\x20(admin\x20only)';async[a31_0x458600(0x207)](_0x281b4a){const _0x4d091c=a31_0x458600,{options:_0x20c5bc,tdx:_0x817b7d}=_0x281b4a,_0x524a1a=await withSpinner(_0x4d091c(0x1e9),()=>_0x817b7d['policy']['listPolicies'](),{'verbose':_0x20c5bc[_0x4d091c(0x21a)]}),_0x78b6d=_0x524a1a['data'];console[_0x4d091c(0x211)](_0x4d091c(0x1f0)+_0x78b6d['length']+_0x4d091c(0x20d)+(_0x78b6d[_0x4d091c(0x1e3)]!==0x1?_0x4d091c(0x1f7):'y'));if(isStructuredFormat(_0x20c5bc))return await handleSDKOutput(_0x78b6d,_0x20c5bc),0x0;if(_0x78b6d['length']===0x0)console[_0x4d091c(0x21c)](a31_0x930920['dim'](_0x4d091c(0x214)));else for(const _0x1b1566 of _0x78b6d){const _0x5e095c=_0x1b1566['description']?a31_0x930920['dim'](_0x4d091c(0x221)+_0x1b1566[_0x4d091c(0x1fb)]):'';console[_0x4d091c(0x21c)](_0x4d091c(0x21f)+_0x1b1566[_0x4d091c(0x1eb)]+_0x5e095c);}return 0x0;}}export class PolicyShowCommand extends BaseCommand{['name']=a31_0x458600(0x1e4);[a31_0x458600(0x1fb)]=a31_0x458600(0x1e2);[a31_0x458600(0x20a)](_0x3d430b){const _0x46c8ba=a31_0x458600;if(_0x3d430b[_0x46c8ba(0x1e5)][_0x46c8ba(0x1e3)]===0x0)return'Usage:\x20tdx\x20policy\x20show\x20<policy-name-or-id>';return undefined;}async['execute'](_0x2fe3c4){const _0x56d78a=a31_0x458600,{options:_0x1619e3,tdx:_0x413765}=_0x2fe3c4,_0x10b246=_0x2fe3c4[_0x56d78a(0x1e5)][0x0],_0x347d0f=await withSpinner(_0x56d78a(0x219),async()=>{const _0x12a433=_0x56d78a,_0x53ee97=await _0x413765[_0x12a433(0x1ee)][_0x12a433(0x208)](_0x10b246),[_0x4d0e4c,_0x112f2f]=await Promise['all']([_0x413765[_0x12a433(0x1ee)]['getPolicyPermissions'](_0x53ee97['id']),_0x413765[_0x12a433(0x1ee)][_0x12a433(0x202)](_0x53ee97['id'])]);return{'policy':_0x53ee97,'perms':_0x4d0e4c,'users':_0x112f2f};},{'verbose':_0x1619e3[_0x56d78a(0x21a)]}),{policy:_0x10081e,perms:_0x134cdb,users:_0x1ed908}=_0x347d0f[_0x56d78a(0x1fa)];if(isStructuredFormat(_0x1619e3))return await handleSingleObjectOutput({..._0x10081e,'permissions':_0x134cdb[_0x56d78a(0x1f5)],'users':_0x1ed908},_0x1619e3),0x0;console['log']('\x0a'+a31_0x930920[_0x56d78a(0x217)]('📋')+'\x20'+a31_0x930920['bold'](_0x10081e['name'])+'\x20'+a31_0x930920['dim'](_0x56d78a(0x218)+_0x10081e['id']+')'));_0x10081e[_0x56d78a(0x1fb)]&&console[_0x56d78a(0x21c)]('\x20\x20\x20'+a31_0x930920['dim'](_0x10081e[_0x56d78a(0x1fb)]));console['log']('\x20\x20\x20'+_0x1ed908[_0x56d78a(0x1e3)]+_0x56d78a(0x213)+(_0x1ed908[_0x56d78a(0x1e3)]!==0x1?'s':'')+_0x56d78a(0x1e6)),printPermissionsMap(_0x134cdb['permissions']);if(_0x1ed908[_0x56d78a(0x1e3)]>0x0){console[_0x56d78a(0x21c)]('\x0a'+a31_0x930920[_0x56d78a(0x217)](_0x56d78a(0x1ea))+':');for(const _0x59b062 of _0x1ed908){const _0xa9fe2b=_0x59b062[_0x56d78a(0x1f2)]&&_0x59b062[_0x56d78a(0x1f2)]!==_0x59b062[_0x56d78a(0x1eb)]?a31_0x930920['dim']('\x20<'+_0x59b062[_0x56d78a(0x1f2)]+'>'):'';console[_0x56d78a(0x21c)](_0x56d78a(0x21f)+_0x59b062[_0x56d78a(0x1eb)]+_0xa9fe2b);}}return console['log'](),0x0;}}function printPermissionsMap(_0x420ec4){const _0x5d899e=a31_0x458600,_0x335f34=Object[_0x5d899e(0x210)](_0x420ec4);console[_0x5d899e(0x21c)]('\x0a'+a31_0x930920[_0x5d899e(0x217)](_0x5d899e(0x20e))+':');if(_0x335f34[_0x5d899e(0x1e3)]===0x0){console['log'](a31_0x930920[_0x5d899e(0x212)](_0x5d899e(0x1ed)));return;}const _0x5db82b=Math[_0x5d899e(0x201)](..._0x335f34[_0x5d899e(0x1fd)](([_0x255134])=>_0x255134[_0x5d899e(0x1e3)]));for(const [_0x3cf450,_0x3e4420]of _0x335f34){const _0x1f57f0=formatOperations(_0x3e4420);console['log']('\x20\x20'+_0x3cf450[_0x5d899e(0x1ec)](_0x5db82b+0x2)+_0x1f57f0);}}function formatOperations(_0x15543a){const _0x5401df=a31_0x458600,_0x26ab97=[...new Set(_0x15543a[_0x5401df(0x1fd)](_0x2487ed=>_0x2487ed[_0x5401df(0x21b)]))];return _0x26ab97['join'](',\x20');}
@@ -1 +1 @@
1
- const a32_0x5624bc=a32_0x97c3;(function(_0x12e112,_0x1854ad){const _0x2f489d=a32_0x97c3,_0x2481fc=_0x12e112();while(!![]){try{const _0x5d7f1b=parseInt(_0x2f489d(0x93))/0x1+-parseInt(_0x2f489d(0xc6))/0x2*(parseInt(_0x2f489d(0xdf))/0x3)+-parseInt(_0x2f489d(0xb5))/0x4*(-parseInt(_0x2f489d(0xec))/0x5)+parseInt(_0x2f489d(0xb9))/0x6+parseInt(_0x2f489d(0x87))/0x7+parseInt(_0x2f489d(0xa5))/0x8*(-parseInt(_0x2f489d(0x98))/0x9)+-parseInt(_0x2f489d(0xe2))/0xa;if(_0x5d7f1b===_0x1854ad)break;else _0x2481fc['push'](_0x2481fc['shift']());}catch(_0x54821a){_0x2481fc['push'](_0x2481fc['shift']());}}}(a32_0x4137,0x5c782));import{BaseCommand,printAuthError}from'./command.js';import{listProfiles,profileExists,saveProfileToUserConfig,removeProfileFromUserConfig,loadProfile,getActiveProfile,saveActiveProfileToUserConfig}from'../core/profile.js';function a32_0x97c3(_0x465ce1,_0x179204){_0x465ce1=_0x465ce1-0x82;const _0x4137b1=a32_0x4137();let _0x97c3f3=_0x4137b1[_0x465ce1];return _0x97c3f3;}import{getConfigDir}from'../core/config.js';import*as a32_0x355b0d 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{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}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 a32_0x13aeaa from'prompts';import a32_0x1a21d8 from'chalk';function validateProfileName(_0x3c2d6e){const _0x5425c9=a32_0x97c3;if(!_0x3c2d6e||!_0x3c2d6e[_0x5425c9(0xc5)]())return'Profile\x20name\x20cannot\x20be\x20empty';const _0x44df3a=_0x3c2d6e[_0x5425c9(0xc5)]();if(!/^[a-zA-Z0-9_-]+$/['test'](_0x44df3a))return _0x5425c9(0xda);if(profileExists(_0x44df3a))return _0x5425c9(0xa8)+_0x44df3a+_0x5425c9(0xbd);return!![];}export class ProfileCreateCommand extends BaseCommand{['name']=a32_0x5624bc(0xd7);[a32_0x5624bc(0x9c)]=a32_0x5624bc(0x92);async['execute'](_0x216c37){const _0x31f543=a32_0x5624bc,{options:_0x5a029c,args:_0x288797}=_0x216c37;console[_0x31f543(0xd5)](a32_0x1a21d8[_0x31f543(0xa1)]('tdx:\x20profile\x20create'));let _0x42b473;if(_0x288797[_0x31f543(0x9f)]>0x0&&_0x288797[0x0]){const _0x82e26b=_0x288797[0x0][_0x31f543(0xc5)](),_0x247a44=validateProfileName(_0x82e26b);if(_0x247a44!==!![])return console['error'](a32_0x1a21d8[_0x31f543(0x82)](_0x247a44)),0x1;_0x42b473=_0x82e26b;}else{const _0x254bce=await a32_0x13aeaa({'type':_0x31f543(0xbf),'name':_0x31f543(0xe4),'message':_0x31f543(0xd0),'validate':validateProfileName});if(!_0x254bce[_0x31f543(0xe4)])return console['log'](_0x31f543(0xcc)),0x1;_0x42b473=_0x254bce[_0x31f543(0xe4)][_0x31f543(0xc5)]();}const _0x3cd86b=await a32_0x13aeaa({'type':_0x31f543(0xbf),'name':_0x31f543(0x9c),'message':_0x31f543(0xbe)}),_0x4b4fbc=_0x3cd86b[_0x31f543(0x9c)]?.['trim']()||undefined,_0x4e5dea=_0x5a029c['site']||_0x31f543(0xa9),_0x46ae60=await promptSiteSelection(_0x4e5dea,_0x42b473,_0x31f543(0xbc));if(!_0x46ae60)return 0x1;const _0x563940=resolveSite(_0x46ae60);if(isOAuthSupported(_0x563940)){const _0x363eb3=await a32_0x13aeaa({'type':'select','name':_0x31f543(0xa3),'message':_0x31f543(0x88),'choices':[{'title':_0x31f543(0x89),'value':_0x31f543(0x94)},{'title':_0x31f543(0xb3),'value':'apikey'}]});if(!_0x363eb3[_0x31f543(0xa3)])return console['log'](_0x31f543(0xcc)),0x1;if(_0x363eb3[_0x31f543(0xa3)]===_0x31f543(0x94)){if(_0x4b4fbc){const _0x703fc7={'site':_0x563940,'description':_0x4b4fbc};saveProfileToUserConfig(_0x42b473,_0x703fc7);}return await runOAuthLoginFlow(_0x563940,_0x42b473,_0x5a029c[_0x31f543(0xc0)]??LogLevel[_0x31f543(0x9b)]),0x0;}}console[_0x31f543(0xd5)](_0x31f543(0xc1)+_0x563940),console[_0x31f543(0xd5)]('You\x20can\x20find\x20your\x20API\x20key\x20at:'),console[_0x31f543(0xd5)]('\x20\x20'+getConsoleUrl(_0x563940,_0x31f543(0xeb)));const _0xe35136=await a32_0x13aeaa({'type':_0x31f543(0x84),'name':_0x31f543(0xc3),'message':_0x31f543(0x97),'validate':_0x9fe6ce=>{const _0x1dcdb2=_0x31f543;if(!_0x9fe6ce||!_0x9fe6ce[_0x1dcdb2(0xc5)]())return _0x1dcdb2(0xb7);return!![];}});if(!_0xe35136[_0x31f543(0xc3)])return console[_0x31f543(0xd5)](_0x31f543(0xcc)),0x1;const _0x3b9b4a=_0xe35136[_0x31f543(0xc3)];console[_0x31f543(0xd5)](_0x31f543(0xd4));try{const _0x5a101c=TDX[_0x31f543(0xa0)]({'site':_0x563940,'apiKey':_0x3b9b4a['trim'](),'logLevel':_0x5a029c[_0x31f543(0xc0)]??LogLevel[_0x31f543(0x9b)]}),_0x44fb71=await _0x5a101c[_0x31f543(0x9e)][_0x31f543(0xef)]();console['log'](a32_0x1a21d8[_0x31f543(0x8d)]('✓')+_0x31f543(0x95)+_0x44fb71[_0x31f543(0x8b)]+')');const _0x19ecfe=await isKeychainAvailable();_0x19ecfe?(await saveAPIKeyAsync(_0x3b9b4a[_0x31f543(0xc5)](),_0x563940,_0x42b473),console[_0x31f543(0xd5)](a32_0x1a21d8[_0x31f543(0x8d)]('✓')+'\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'+_0x42b473+')')):(console[_0x31f543(0xd6)](a32_0x1a21d8[_0x31f543(0x8e)](_0x31f543(0xce))),console[_0x31f543(0xd6)](a32_0x1a21d8[_0x31f543(0x8e)](_0x31f543(0xb2))));const _0x35bf95={'site':_0x563940,..._0x4b4fbc&&{'description':_0x4b4fbc}};return saveProfileToUserConfig(_0x42b473,_0x35bf95),console[_0x31f543(0xd5)](a32_0x1a21d8[_0x31f543(0x8d)]('✓')+_0x31f543(0xe1)+_0x42b473+'\x27\x20created'),console['log'](),console[_0x31f543(0xd5)]('You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:'),console['log'](_0x31f543(0xd1)+_0x42b473+_0x31f543(0xa6)),console[_0x31f543(0xd5)](_0x31f543(0xd1)+_0x42b473+_0x31f543(0xe0)),0x0;}catch(_0x1be70f){if(_0x1be70f instanceof HTTPClientError&&_0x1be70f[_0x31f543(0xa2)]===0x191)return printAuthError(_0x1be70f),0x1;return console[_0x31f543(0xe9)](a32_0x1a21d8[_0x31f543(0x82)](_0x31f543(0x9a)+(_0x1be70f instanceof Error?_0x1be70f[_0x31f543(0xb1)]:String(_0x1be70f)))),console[_0x31f543(0xe9)](_0x31f543(0xa7)),0x1;}}}export class ProfileRemoveCommand extends BaseCommand{[a32_0x5624bc(0xcf)]='profile:remove';[a32_0x5624bc(0x9c)]=a32_0x5624bc(0x86);[a32_0x5624bc(0xb4)](_0x517ab9){const _0x3155af=a32_0x5624bc,{args:_0x3fa618}=_0x517ab9;if(_0x3fa618[_0x3155af(0x9f)]===0x0)return _0x3155af(0x83);return undefined;}async[a32_0x5624bc(0xdd)](_0x4e94ee){const _0xb42cc3=a32_0x5624bc,{args:_0x55f717}=_0x4e94ee,_0x559111=_0x55f717[0x0];console[_0xb42cc3(0xd5)](a32_0x1a21d8[_0xb42cc3(0xa1)](_0xb42cc3(0xdb)));if(!profileExists(_0x559111)){console['error'](a32_0x1a21d8[_0xb42cc3(0x82)](_0xb42cc3(0xa8)+_0x559111+_0xb42cc3(0xd3))),console[_0xb42cc3(0xd5)](_0xb42cc3(0xb6));const _0x439ac8=listProfiles();if(_0x439ac8[_0xb42cc3(0x9f)]===0x0)console[_0xb42cc3(0xd5)](_0xb42cc3(0xaa));else for(const _0x56a7c2 of _0x439ac8){console[_0xb42cc3(0xd5)](_0xb42cc3(0x85)+_0x56a7c2[_0xb42cc3(0xcf)]);}return 0x1;}const _0x3a6634=await a32_0x13aeaa({'type':'confirm','name':_0xb42cc3(0xc7),'message':_0xb42cc3(0x9d)+_0x559111+'\x27?','initial':![]});if(!_0x3a6634['confirm'])return console[_0xb42cc3(0xd5)](_0xb42cc3(0xd2)),0x0;try{removeProfileFromUserConfig(_0x559111),console[_0xb42cc3(0xd5)](a32_0x1a21d8[_0xb42cc3(0x8d)]('✓')+'\x20Profile\x20\x27'+_0x559111+_0xb42cc3(0xb8));}catch(_0x5b673b){return console[_0xb42cc3(0xe9)](a32_0x1a21d8[_0xb42cc3(0x82)]('Failed\x20to\x20remove\x20profile:\x20'+(_0x5b673b instanceof Error?_0x5b673b[_0xb42cc3(0xb1)]:String(_0x5b673b)))),0x1;}const _0xf8595e=await isKeychainAvailable();if(_0xf8595e){const _0x2ae464=await deleteKeychainAPIKey(_0x559111);_0x2ae464&&console['log'](a32_0x1a21d8[_0xb42cc3(0x8d)]('✓')+_0xb42cc3(0xca));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{[a32_0x5624bc(0xcf)]='profile:set';[a32_0x5624bc(0x9c)]=a32_0x5624bc(0x8f);static [a32_0x5624bc(0xb0)]=['site',a32_0x5624bc(0xcb),a32_0x5624bc(0x90),a32_0x5624bc(0xc8),a32_0x5624bc(0xa4),'description'];[a32_0x5624bc(0xb4)](_0x16b680){const _0x2d52ed=a32_0x5624bc,{args:_0x5917f7,options:_0x355846}=_0x16b680,_0x41838f=_0x355846[_0x2d52ed(0xcd)]||getActiveProfile();if(!_0x41838f)return _0x2d52ed(0xdc);if(_0x5917f7[_0x2d52ed(0x9f)]===0x0)return _0x2d52ed(0xad)+ProfileSetCommand[_0x2d52ed(0xb0)]['join'](',\x20');const _0x5861b2=_0x5917f7[0x0];if(!_0x5861b2[_0x2d52ed(0x8a)]('='))return _0x2d52ed(0xe5)+ProfileSetCommand[_0x2d52ed(0xb0)][_0x2d52ed(0xd9)](',\x20');const [_0x333239]=_0x5861b2[_0x2d52ed(0x91)]('=',0x2);if(!ProfileSetCommand[_0x2d52ed(0xb0)][_0x2d52ed(0x8a)](_0x333239))return'Unknown\x20key\x20\x27'+_0x333239+_0x2d52ed(0xc2)+ProfileSetCommand['VALID_KEYS'][_0x2d52ed(0xd9)](',\x20');return undefined;}async[a32_0x5624bc(0xdd)](_0x4bea9d){const _0x235b83=a32_0x5624bc,{args:_0x34fc6c,options:_0x26b245}=_0x4bea9d,_0xa335ee=_0x26b245[_0x235b83(0xcd)]||getActiveProfile(),[_0x464d6b,..._0x1dcabf]=_0x34fc6c[0x0][_0x235b83(0x91)]('='),_0x1b9920=_0x1dcabf[_0x235b83(0xd9)]('=');console[_0x235b83(0xd5)](a32_0x1a21d8[_0x235b83(0xa1)](_0x235b83(0xaf)));if(!profileExists(_0xa335ee)){const _0x266c72=await a32_0x13aeaa({'type':_0x235b83(0xc7),'name':_0x235b83(0xa0),'message':_0x235b83(0xa8)+_0xa335ee+_0x235b83(0xd8),'initial':!![]});if(!_0x266c72[_0x235b83(0xa0)])return console[_0x235b83(0xd5)](_0x235b83(0xe8)),0x1;}const _0x41709c=loadProfile(_0xa335ee),_0x2b4240=_0x41709c?.['config']||{};if(_0x464d6b===_0x235b83(0xe6)){const _0x3e6939=resolveSite(_0x1b9920);console[_0x235b83(0xd5)](_0x235b83(0x99)+_0x3e6939+_0x235b83(0x96)),console[_0x235b83(0xd5)](_0x235b83(0xed)),console[_0x235b83(0xd5)]('\x20\x20'+getConsoleUrl(_0x3e6939,_0x235b83(0xeb)));const _0x2f72dd=await a32_0x13aeaa({'type':'password','name':_0x235b83(0xc3),'message':'Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','validate':_0x38cfc7=>{const _0x14588c=_0x235b83;if(!_0x38cfc7||!_0x38cfc7[_0x14588c(0xc5)]())return _0x14588c(0xb7);return!![];}});if(!_0x2f72dd[_0x235b83(0xc3)])return console[_0x235b83(0xd5)](_0x235b83(0xc9)),0x1;console['log']('Validating\x20API\x20key...');try{const _0x532692=TDX[_0x235b83(0xa0)]({'site':_0x3e6939,'apiKey':_0x2f72dd['apiKey'][_0x235b83(0xc5)](),'logLevel':_0x26b245['logLevel']??LogLevel[_0x235b83(0x9b)]}),_0x40b525=await _0x532692[_0x235b83(0x9e)]['getUserInfo']();console[_0x235b83(0xd5)](a32_0x1a21d8[_0x235b83(0x8d)]('✓')+_0x235b83(0x95)+_0x40b525[_0x235b83(0x8b)]+')');const _0x4cfb77=await isKeychainAvailable();_0x4cfb77?(await saveAPIKeyAsync(_0x2f72dd[_0x235b83(0xc3)]['trim'](),_0x3e6939,_0xa335ee),console[_0x235b83(0xd5)](a32_0x1a21d8[_0x235b83(0x8d)]('✓')+_0x235b83(0xee))):console[_0x235b83(0xd6)](a32_0x1a21d8[_0x235b83(0x8e)](_0x235b83(0xce))),_0x2b4240[_0x235b83(0xe6)]=_0x3e6939;}catch(_0x22951a){if(_0x22951a instanceof HTTPClientError&&_0x22951a['status']===0x191)return printAuthError(_0x22951a),0x1;return console[_0x235b83(0xe9)](a32_0x1a21d8[_0x235b83(0x82)](_0x235b83(0x9a)+(_0x22951a instanceof Error?_0x22951a['message']:String(_0x22951a)))),console[_0x235b83(0xe9)]('Site\x20was\x20not\x20changed.'),0x1;}}else _0x2b4240[_0x464d6b]=_0x1b9920||undefined;return saveProfileToUserConfig(_0xa335ee,_0x2b4240),console[_0x235b83(0xd5)](a32_0x1a21d8[_0x235b83(0x8d)]('✓')+_0x235b83(0xe1)+_0xa335ee+_0x235b83(0xe7)+_0x464d6b+'='+(_0x1b9920||_0x235b83(0xea))),0x0;}}function a32_0x4137(){const _0xa26bff=['confirm','llm_project','\x0aOperation\x20cancelled','\x20API\x20key\x20removed\x20from\x20system\x20keychain','database','\x0aSetup\x20cancelled','profile','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','name','Enter\x20profile\x20name:','\x20\x20tdx\x20--profile\x20','Removal\x20cancelled','\x27\x20does\x20not\x20exist.','Validating\x20API\x20key...','log','warn','profile:create','\x27\x20does\x20not\x20exist.\x20Create\x20it?','join','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','tdx:\x20profile\x20remove','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>','execute','Set\x20session\x20profile','542562rdEFGI','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','\x20Profile\x20\x27','10804670VcoFwU','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','profileName','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','site','\x27\x20updated:\x20','Operation\x20cancelled','error','(cleared)','/app/mp/ak','2595PJTmbY','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','\x20API\x20key\x20saved\x20to\x20system\x20keychain','getUserInfo','red','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','password','\x20\x20-\x20','Remove\x20a\x20profile','3039603fQyZFn','Choose\x20authentication\x20method:','OAuth\x20(browser\x20login)','includes','email','dim','green','yellow','Set\x20a\x20profile\x20configuration\x20value','parent_segment','split','Create\x20a\x20new\x20profile','292479faQSAw','oauth','\x20API\x20key\x20is\x20valid\x20(User:\x20','\x27\x20requires\x20API\x20key\x20validation.','Enter\x20your\x20TD\x20API\x20key:','117TOHuCR','Changing\x20site\x20to\x20\x27','✗\x20Validation\x20failed:\x20','ERROR','description','Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27','jobs','length','create','bold','status','method','llm_agent','151776PawNBw','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.','Profile\x20\x27','us01','\x20\x20(no\x20profiles\x20found)','session','\x20--default\x27\x20to\x20save\x20permanently','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','Session\x20profile\x20set\x20to:\x20','tdx:\x20profile\x20set','VALID_KEYS','message','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','API\x20Key','validate','5044aKzMPi','\x0aAvailable\x20profiles:','API\x20key\x20cannot\x20be\x20empty','\x27\x20removed\x20from\x20configuration','4118388FGRShq','default','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','Setup\x20cancelled','\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.','Enter\x20description\x20(optional):','text','logLevel','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','\x27.\x0a\x0aValid\x20keys:\x20','apiKey','profile:use','trim','4VaJpvv'];a32_0x4137=function(){return _0xa26bff;};return a32_0x4137();}export class ProfileUseCommand extends BaseCommand{[a32_0x5624bc(0xcf)]=a32_0x5624bc(0xc4);[a32_0x5624bc(0x9c)]=a32_0x5624bc(0xde);[a32_0x5624bc(0xb4)](_0x556a32){const _0x556666=a32_0x5624bc,{args:_0xc2dc78}=_0x556a32;if(_0xc2dc78[_0x556666(0x9f)]===0x0)return _0x556666(0xbb);return undefined;}async[a32_0x5624bc(0xdd)](_0x45f1c1){const _0x311d05=a32_0x5624bc,{args:_0x3d2354,options:_0x4c528d}=_0x45f1c1,_0x249646=_0x3d2354[0x0],_0x2e9d8c=_0x4c528d[_0x311d05(0xba)];cleanExpiredSessions();if(!profileExists(_0x249646)){console['error'](a32_0x1a21d8['red'](_0x311d05(0xa8)+_0x249646+_0x311d05(0xd3))),console[_0x311d05(0xd5)](_0x311d05(0xb6));const _0x5d42be=listProfiles();if(_0x5d42be[_0x311d05(0x9f)]===0x0)console[_0x311d05(0xd5)](_0x311d05(0xaa));else for(const _0x1a675c of _0x5d42be){console[_0x311d05(0xd5)]('\x20\x20-\x20'+_0x1a675c[_0x311d05(0xcf)]);}return 0x1;}if(_0x2e9d8c){const _0x276d3f=a32_0x355b0d[_0x311d05(0xd9)](getConfigDir(),'tdx.json');return saveActiveProfileToUserConfig(_0x249646),console[_0x311d05(0xd5)]('Default\x20profile\x20set\x20to:\x20'+a32_0x1a21d8[_0x311d05(0x8d)](_0x249646)),console[_0x311d05(0xd5)](a32_0x1a21d8[_0x311d05(0x8c)]('\x0aSaved\x20to:\x20'+_0x276d3f)),0x0;}const _0x280a2f=getSessionID(_0x4c528d['session']);return saveSessionContext({'profile':_0x249646},_0x4c528d[_0x311d05(0xab)]),console[_0x311d05(0xd5)](_0x311d05(0xae)+a32_0x1a21d8[_0x311d05(0x8d)](_0x249646)+'\x20'+a32_0x1a21d8['dim']('(session:\x20'+_0x280a2f+')')),console['log'](a32_0x1a21d8[_0x311d05(0x8c)](_0x311d05(0xe3)+_0x249646+_0x311d05(0xac))),0x0;}}
1
+ const a32_0x12b288=a32_0x300d;(function(_0x8ce207,_0x101cd5){const _0x4eddd5=a32_0x300d,_0x33370c=_0x8ce207();while(!![]){try{const _0x4699e1=-parseInt(_0x4eddd5(0x209))/0x1+-parseInt(_0x4eddd5(0x238))/0x2*(-parseInt(_0x4eddd5(0x1f1))/0x3)+-parseInt(_0x4eddd5(0x244))/0x4*(-parseInt(_0x4eddd5(0x22a))/0x5)+-parseInt(_0x4eddd5(0x24d))/0x6+parseInt(_0x4eddd5(0x24c))/0x7*(-parseInt(_0x4eddd5(0x24e))/0x8)+parseInt(_0x4eddd5(0x20c))/0x9+parseInt(_0x4eddd5(0x205))/0xa;if(_0x4699e1===_0x101cd5)break;else _0x33370c['push'](_0x33370c['shift']());}catch(_0x854db5){_0x33370c['push'](_0x33370c['shift']());}}}(a32_0x22e7,0x60114));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 a32_0x477203 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{runOAuthLoginFlow}from'./auth-login-command.js';import{isOAuthSupported}from'../core/oauth.js';import{promptSiteSelection}from'../core/constants.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a32_0x22e7(){const _0x2078d1=['76280UsffVG','\x0aTip:\x20Use\x20\x27tdx\x20profile\x20use\x20','Changing\x20site\x20to\x20\x27','\x27\x20does\x20not\x20exist.','yellow','Operation\x20cancelled','green','profile','115059eCZtDP','4232238GSoIzP','64zUKUgb','Enter\x20description\x20(optional):','\x20API\x20key\x20is\x20valid\x20(User:\x20','name','\x20\x20-\x20','validate','API\x20key\x20cannot\x20be\x20empty','\x0aSaved\x20to:\x20','Key=value\x20pair\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','✗\x20Validation\x20failed:\x20','includes','\x27\x20removed\x20from\x20configuration','Remove\x20a\x20profile','\x0aSetting\x20up\x20authentication\x20for\x20site:\x20','create','profileName','Failed\x20to\x20remove\x20profile:\x20','red','tdx:\x20profile\x20remove','parent_segment','bold','Choose\x20authentication\x20method:','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20use\x20<name>\x20[--default]','393ffpLMq','\x0aAvailable\x20profiles:','llm_agent','Profile\x20name\x20cannot\x20be\x20empty','text','execute','\x20API\x20key\x20saved\x20to\x20system\x20keychain','Session\x20profile\x20set\x20to:\x20','Set\x20session\x20profile','jobs','error','password','\x20\x20Set\x20TDX_API_KEY\x20environment\x20variable\x20for\x20authentication.','split','\x20API\x20key\x20removed\x20from\x20system\x20keychain','warn','Profile\x20name\x20is\x20required.\x0a\x0aUsage:\x20tdx\x20profile\x20remove\x20<name>','site','/app/mp/ak','description','12047580pePluD','Site\x20was\x20not\x20changed.','\x0aOperation\x20cancelled','email','539145oxgovF','OAuth\x20(browser\x20login)','Invalid\x20format.\x20Use:\x20tdx\x20profile\x20set\x20[--profile\x20<name>]\x20<key>=<value>\x0a\x0aValid\x20keys:\x20','3364416gsZnwm','\x27\x20requires\x20API\x20key\x20validation.','profile:set','\x20\x20(no\x20profiles\x20found)','Set\x20a\x20profile\x20configuration\x20value','config','trim','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>','\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20-\x20Verify\x20authentication','confirm','Profile\x20name\x20must\x20contain\x20only\x20alphanumeric\x20characters,\x20dash,\x20and\x20underscore','dim','\x0aYou\x20can\x20find\x20your\x20API\x20key\x20at:','profile:remove','\x0aSetup\x20cancelled','oauth','message','API\x20Key','status','You\x20can\x20now\x20use\x20tdx\x20commands\x20with\x20this\x20profile.\x20Try:','logLevel','Create\x20a\x20new\x20profile','⚠\x20System\x20keychain\x20not\x20available.\x20API\x20key\x20not\x20saved.','Profile\x20\x27','profile:create','database','Setup\x20cancelled','join','apiKey','Unknown\x20key\x20\x27','30hOViBp','\x20--default\x27\x20to\x20save\x20permanently','ERROR','VALID_KEYS','Default\x20profile\x20set\x20to:\x20','test','Validating\x20API\x20key...','tdx:\x20profile\x20create','Removal\x20cancelled','Enter\x20your\x20TD\x20API\x20key\x20for\x20the\x20new\x20site:','profile:use','log','You\x20can\x20find\x20your\x20API\x20key\x20at:','\x27\x20created','1168gAvdPZ','\x27\x20updated:\x20','\x20Profile\x20\x27','\x20\x20tdx\x20--profile\x20','(session:\x20','getUserInfo','llm_project','method','session','\x20databases\x20\x20\x20\x20\x20-\x20List\x20databases','length','\x20API\x20key\x20saved\x20to\x20system\x20keychain\x20(profile:\x20'];a32_0x22e7=function(){return _0x2078d1;};return a32_0x22e7();}import{TDX}from'../sdk/index.js';import{LogLevel}from'../utils/tdx-logger.js';import a32_0x9c7e87 from'prompts';import a32_0x3a5ad6 from'chalk';function validateProfileName(_0x3235b4){const _0x259dfe=a32_0x300d;if(!_0x3235b4||!_0x3235b4[_0x259dfe(0x212)]())return _0x259dfe(0x1f4);const _0x291d35=_0x3235b4[_0x259dfe(0x212)]();if(!/^[a-zA-Z0-9_-]+$/[_0x259dfe(0x22f)](_0x291d35))return _0x259dfe(0x216);if(profileExists(_0x291d35))return _0x259dfe(0x223)+_0x291d35+'\x27\x20already\x20exists.\x20Use\x20\x27tdx\x20profile\x20set\x27\x20to\x20modify\x20it.';return!![];}export class ProfileCreateCommand extends BaseCommand{[a32_0x12b288(0x251)]=a32_0x12b288(0x224);[a32_0x12b288(0x204)]=a32_0x12b288(0x221);async[a32_0x12b288(0x1f6)](_0x59f3d3){const _0x2ee484=a32_0x12b288,{options:_0x14b437,args:_0x27df95}=_0x59f3d3;console[_0x2ee484(0x235)](a32_0x3a5ad6[_0x2ee484(0x262)](_0x2ee484(0x231)));let _0x1e54c3;if(_0x27df95[_0x2ee484(0x242)]>0x0&&_0x27df95[0x0]){const _0xe2d7a1=_0x27df95[0x0]['trim'](),_0x4d2630=validateProfileName(_0xe2d7a1);if(_0x4d2630!==!![])return console[_0x2ee484(0x1fb)](a32_0x3a5ad6['red'](_0x4d2630)),0x1;_0x1e54c3=_0xe2d7a1;}else{const _0x70700=await a32_0x9c7e87({'type':_0x2ee484(0x1f5),'name':_0x2ee484(0x25d),'message':'Enter\x20profile\x20name:','validate':validateProfileName});if(!_0x70700[_0x2ee484(0x25d)])return console[_0x2ee484(0x235)](_0x2ee484(0x21a)),0x1;_0x1e54c3=_0x70700[_0x2ee484(0x25d)][_0x2ee484(0x212)]();}const _0x151cea=await a32_0x9c7e87({'type':'text','name':_0x2ee484(0x204),'message':_0x2ee484(0x24f)}),_0x351ab8=_0x151cea[_0x2ee484(0x204)]?.[_0x2ee484(0x212)]()||undefined,_0x5b5292=_0x14b437[_0x2ee484(0x202)]||'us01',_0x83903b=await promptSiteSelection(_0x5b5292,_0x1e54c3,_0x2ee484(0x226));if(!_0x83903b)return 0x1;const _0x26453d=resolveSite(_0x83903b);if(isOAuthSupported(_0x26453d)){const _0x57cb78=await a32_0x9c7e87({'type':'select','name':_0x2ee484(0x23f),'message':_0x2ee484(0x263),'choices':[{'title':_0x2ee484(0x20a),'value':'oauth'},{'title':_0x2ee484(0x21d),'value':'apikey'}]});if(!_0x57cb78[_0x2ee484(0x23f)])return console[_0x2ee484(0x235)]('\x0aSetup\x20cancelled'),0x1;if(_0x57cb78[_0x2ee484(0x23f)]===_0x2ee484(0x21b)){if(_0x351ab8){const _0x268610={'site':_0x26453d,'description':_0x351ab8};saveProfileToUserConfig(_0x1e54c3,_0x268610);}return await runOAuthLoginFlow(_0x26453d,_0x1e54c3,_0x14b437[_0x2ee484(0x220)]??LogLevel[_0x2ee484(0x22c)]),0x0;}}console['log'](_0x2ee484(0x25b)+_0x26453d),console[_0x2ee484(0x235)](_0x2ee484(0x236)),console[_0x2ee484(0x235)]('\x20\x20'+getConsoleUrl(_0x26453d,_0x2ee484(0x203)));const _0x14d785=await a32_0x9c7e87({'type':_0x2ee484(0x1fc),'name':'apiKey','message':'Enter\x20your\x20TD\x20API\x20key:','validate':_0x373415=>{const _0x45de1c=_0x2ee484;if(!_0x373415||!_0x373415[_0x45de1c(0x212)]())return'API\x20key\x20cannot\x20be\x20empty';return!![];}});if(!_0x14d785[_0x2ee484(0x228)])return console[_0x2ee484(0x235)](_0x2ee484(0x21a)),0x1;const _0x124415=_0x14d785[_0x2ee484(0x228)];console[_0x2ee484(0x235)](_0x2ee484(0x230));try{const _0xf06e21=TDX[_0x2ee484(0x25c)]({'site':_0x26453d,'apiKey':_0x124415[_0x2ee484(0x212)](),'logLevel':_0x14b437['logLevel']??LogLevel['ERROR']}),_0x1ee8c0=await _0xf06e21[_0x2ee484(0x1fa)]['getUserInfo']();console['log'](a32_0x3a5ad6[_0x2ee484(0x24a)]('✓')+_0x2ee484(0x250)+_0x1ee8c0[_0x2ee484(0x208)]+')');const _0x36c035=await isKeychainAvailable();_0x36c035?(await saveAPIKeyAsync(_0x124415['trim'](),_0x26453d,_0x1e54c3),console[_0x2ee484(0x235)](a32_0x3a5ad6[_0x2ee484(0x24a)]('✓')+_0x2ee484(0x243)+_0x1e54c3+')')):(console[_0x2ee484(0x200)](a32_0x3a5ad6[_0x2ee484(0x248)](_0x2ee484(0x222))),console['warn'](a32_0x3a5ad6[_0x2ee484(0x248)](_0x2ee484(0x1fd))));const _0x2e6e62={'site':_0x26453d,..._0x351ab8&&{'description':_0x351ab8}};return saveProfileToUserConfig(_0x1e54c3,_0x2e6e62),console['log'](a32_0x3a5ad6[_0x2ee484(0x24a)]('✓')+'\x20Profile\x20\x27'+_0x1e54c3+_0x2ee484(0x237)),console[_0x2ee484(0x235)](),console[_0x2ee484(0x235)](_0x2ee484(0x21f)),console[_0x2ee484(0x235)](_0x2ee484(0x23b)+_0x1e54c3+_0x2ee484(0x214)),console[_0x2ee484(0x235)](_0x2ee484(0x23b)+_0x1e54c3+_0x2ee484(0x241)),0x0;}catch(_0x5dc915){if(_0x5dc915 instanceof HTTPClientError&&_0x5dc915[_0x2ee484(0x21e)]===0x191)return printAuthError(_0x5dc915),0x1;return console[_0x2ee484(0x1fb)](a32_0x3a5ad6[_0x2ee484(0x25f)](_0x2ee484(0x257)+(_0x5dc915 instanceof Error?_0x5dc915[_0x2ee484(0x21c)]:String(_0x5dc915)))),console[_0x2ee484(0x1fb)]('Profile\x20was\x20not\x20created.\x20Please\x20try\x20again.'),0x1;}}}function a32_0x300d(_0x158c32,_0x7d51ec){_0x158c32=_0x158c32-0x1f0;const _0x22e78f=a32_0x22e7();let _0x300da5=_0x22e78f[_0x158c32];return _0x300da5;}export class ProfileRemoveCommand extends BaseCommand{[a32_0x12b288(0x251)]=a32_0x12b288(0x219);['description']=a32_0x12b288(0x25a);[a32_0x12b288(0x253)](_0x5d5982){const _0x5889a7=a32_0x12b288,{args:_0x51b668}=_0x5d5982;if(_0x51b668[_0x5889a7(0x242)]===0x0)return _0x5889a7(0x201);return undefined;}async[a32_0x12b288(0x1f6)](_0x1e2fa2){const _0x404717=a32_0x12b288,{args:_0x122bf1}=_0x1e2fa2,_0x4fb182=_0x122bf1[0x0];console[_0x404717(0x235)](a32_0x3a5ad6[_0x404717(0x262)](_0x404717(0x260)));if(!profileExists(_0x4fb182)){console['error'](a32_0x3a5ad6[_0x404717(0x25f)](_0x404717(0x223)+_0x4fb182+_0x404717(0x247))),console[_0x404717(0x235)](_0x404717(0x1f2));const _0x54df5f=listProfiles();if(_0x54df5f[_0x404717(0x242)]===0x0)console[_0x404717(0x235)](_0x404717(0x20f));else for(const _0x4de2d8 of _0x54df5f){console[_0x404717(0x235)](_0x404717(0x252)+_0x4de2d8[_0x404717(0x251)]);}return 0x1;}const _0x4f8c85=await a32_0x9c7e87({'type':_0x404717(0x215),'name':_0x404717(0x215),'message':'Are\x20you\x20sure\x20you\x20want\x20to\x20remove\x20profile\x20\x27'+_0x4fb182+'\x27?','initial':![]});if(!_0x4f8c85[_0x404717(0x215)])return console[_0x404717(0x235)](_0x404717(0x232)),0x0;try{removeProfileFromUserConfig(_0x4fb182),console[_0x404717(0x235)](a32_0x3a5ad6[_0x404717(0x24a)]('✓')+_0x404717(0x23a)+_0x4fb182+_0x404717(0x259));}catch(_0x3570a6){return console[_0x404717(0x1fb)](a32_0x3a5ad6['red'](_0x404717(0x25e)+(_0x3570a6 instanceof Error?_0x3570a6[_0x404717(0x21c)]:String(_0x3570a6)))),0x1;}const _0x3a4d17=await isKeychainAvailable();if(_0x3a4d17){const _0xa43bba=await deleteKeychainAPIKey(_0x4fb182);_0xa43bba&&console['log'](a32_0x3a5ad6[_0x404717(0x24a)]('✓')+_0x404717(0x1ff));}return 0x0;}}export class ProfileSetCommand extends BaseCommand{['name']=a32_0x12b288(0x20e);[a32_0x12b288(0x204)]=a32_0x12b288(0x210);static [a32_0x12b288(0x22d)]=['site',a32_0x12b288(0x225),a32_0x12b288(0x261),a32_0x12b288(0x23e),a32_0x12b288(0x1f3),a32_0x12b288(0x204)];[a32_0x12b288(0x253)](_0x37c78d){const _0xb2c999=a32_0x12b288,{args:_0x1e4fc0,options:_0x417275}=_0x37c78d,_0x4e4a0f=_0x417275[_0xb2c999(0x24b)]||getActiveProfile();if(!_0x4e4a0f)return _0xb2c999(0x213);if(_0x1e4fc0['length']===0x0)return _0xb2c999(0x256)+ProfileSetCommand['VALID_KEYS'][_0xb2c999(0x227)](',\x20');const _0x115c7b=_0x1e4fc0[0x0];if(!_0x115c7b[_0xb2c999(0x258)]('='))return _0xb2c999(0x20b)+ProfileSetCommand[_0xb2c999(0x22d)]['join'](',\x20');const [_0x4e7145]=_0x115c7b['split']('=',0x2);if(!ProfileSetCommand[_0xb2c999(0x22d)][_0xb2c999(0x258)](_0x4e7145))return _0xb2c999(0x229)+_0x4e7145+'\x27.\x0a\x0aValid\x20keys:\x20'+ProfileSetCommand[_0xb2c999(0x22d)][_0xb2c999(0x227)](',\x20');return undefined;}async[a32_0x12b288(0x1f6)](_0x3fa51b){const _0x400590=a32_0x12b288,{args:_0x352054,options:_0x17bef1}=_0x3fa51b,_0x2cda36=_0x17bef1[_0x400590(0x24b)]||getActiveProfile(),[_0x374a40,..._0x1f0094]=_0x352054[0x0][_0x400590(0x1fe)]('='),_0x17dbe1=_0x1f0094[_0x400590(0x227)]('=');console[_0x400590(0x235)](a32_0x3a5ad6[_0x400590(0x262)]('tdx:\x20profile\x20set'));if(!profileExists(_0x2cda36)){const _0x3ed48e=await a32_0x9c7e87({'type':'confirm','name':_0x400590(0x25c),'message':_0x400590(0x223)+_0x2cda36+'\x27\x20does\x20not\x20exist.\x20Create\x20it?','initial':!![]});if(!_0x3ed48e[_0x400590(0x25c)])return console[_0x400590(0x235)](_0x400590(0x249)),0x1;}const _0x3f7d28=loadProfile(_0x2cda36),_0x5ca9b4=_0x3f7d28?.[_0x400590(0x211)]||{};if(_0x374a40===_0x400590(0x202)){const _0x1e6869=resolveSite(_0x17dbe1);console['log'](_0x400590(0x246)+_0x1e6869+_0x400590(0x20d)),console[_0x400590(0x235)](_0x400590(0x218)),console[_0x400590(0x235)]('\x20\x20'+getConsoleUrl(_0x1e6869,'/app/mp/ak'));const _0x4cd7cd=await a32_0x9c7e87({'type':_0x400590(0x1fc),'name':_0x400590(0x228),'message':_0x400590(0x233),'validate':_0x50cb5a=>{const _0xc773ab=_0x400590;if(!_0x50cb5a||!_0x50cb5a[_0xc773ab(0x212)]())return _0xc773ab(0x254);return!![];}});if(!_0x4cd7cd[_0x400590(0x228)])return console['log'](_0x400590(0x207)),0x1;console[_0x400590(0x235)](_0x400590(0x230));try{const _0x4758e8=TDX[_0x400590(0x25c)]({'site':_0x1e6869,'apiKey':_0x4cd7cd[_0x400590(0x228)][_0x400590(0x212)](),'logLevel':_0x17bef1[_0x400590(0x220)]??LogLevel['ERROR']}),_0xffdc86=await _0x4758e8[_0x400590(0x1fa)][_0x400590(0x23d)]();console[_0x400590(0x235)](a32_0x3a5ad6['green']('✓')+_0x400590(0x250)+_0xffdc86['email']+')');const _0x1a1979=await isKeychainAvailable();_0x1a1979?(await saveAPIKeyAsync(_0x4cd7cd[_0x400590(0x228)][_0x400590(0x212)](),_0x1e6869,_0x2cda36),console['log'](a32_0x3a5ad6['green']('✓')+_0x400590(0x1f7))):console['warn'](a32_0x3a5ad6[_0x400590(0x248)](_0x400590(0x222))),_0x5ca9b4[_0x400590(0x202)]=_0x1e6869;}catch(_0x3e9035){if(_0x3e9035 instanceof HTTPClientError&&_0x3e9035['status']===0x191)return printAuthError(_0x3e9035),0x1;return console['error'](a32_0x3a5ad6[_0x400590(0x25f)]('✗\x20Validation\x20failed:\x20'+(_0x3e9035 instanceof Error?_0x3e9035['message']:String(_0x3e9035)))),console[_0x400590(0x1fb)](_0x400590(0x206)),0x1;}}else _0x5ca9b4[_0x374a40]=_0x17dbe1||undefined;return saveProfileToUserConfig(_0x2cda36,_0x5ca9b4),console[_0x400590(0x235)](a32_0x3a5ad6[_0x400590(0x24a)]('✓')+_0x400590(0x23a)+_0x2cda36+_0x400590(0x239)+_0x374a40+'='+(_0x17dbe1||'(cleared)')),0x0;}}export class ProfileUseCommand extends BaseCommand{['name']=a32_0x12b288(0x234);[a32_0x12b288(0x204)]=a32_0x12b288(0x1f9);[a32_0x12b288(0x253)](_0x528573){const _0x2a2623=a32_0x12b288,{args:_0x1fe497}=_0x528573;if(_0x1fe497[_0x2a2623(0x242)]===0x0)return _0x2a2623(0x1f0);return undefined;}async[a32_0x12b288(0x1f6)](_0x5a418e){const _0x4ccf41=a32_0x12b288,{args:_0x54852e,options:_0x42cea7}=_0x5a418e,_0x2acb11=_0x54852e[0x0],_0xab8c11=_0x42cea7['default'];cleanExpiredSessions();if(!profileExists(_0x2acb11)){console[_0x4ccf41(0x1fb)](a32_0x3a5ad6[_0x4ccf41(0x25f)](_0x4ccf41(0x223)+_0x2acb11+_0x4ccf41(0x247))),console[_0x4ccf41(0x235)](_0x4ccf41(0x1f2));const _0x554e61=listProfiles();if(_0x554e61[_0x4ccf41(0x242)]===0x0)console[_0x4ccf41(0x235)](_0x4ccf41(0x20f));else for(const _0x32d1c3 of _0x554e61){console[_0x4ccf41(0x235)](_0x4ccf41(0x252)+_0x32d1c3[_0x4ccf41(0x251)]);}return 0x1;}if(_0xab8c11){const _0x208b2e=a32_0x477203[_0x4ccf41(0x227)](getConfigDir(),'tdx.json');return saveActiveProfileToUserConfig(_0x2acb11),console[_0x4ccf41(0x235)](_0x4ccf41(0x22e)+a32_0x3a5ad6[_0x4ccf41(0x24a)](_0x2acb11)),console[_0x4ccf41(0x235)](a32_0x3a5ad6['dim'](_0x4ccf41(0x255)+_0x208b2e)),0x0;}const _0xbedb06=getSessionID(_0x42cea7[_0x4ccf41(0x240)]);return saveSessionContext({'profile':_0x2acb11},_0x42cea7[_0x4ccf41(0x240)]),console[_0x4ccf41(0x235)](_0x4ccf41(0x1f8)+a32_0x3a5ad6['green'](_0x2acb11)+'\x20'+a32_0x3a5ad6[_0x4ccf41(0x217)](_0x4ccf41(0x23c)+_0xbedb06+')')),console['log'](a32_0x3a5ad6[_0x4ccf41(0x217)](_0x4ccf41(0x245)+_0x2acb11+_0x4ccf41(0x22b))),0x0;}}
@@ -1 +1 @@
1
- const a33_0x193e4c=a33_0x47a2;(function(_0x5a0261,_0x3a133f){const _0x13d580=a33_0x47a2,_0x3f4775=_0x5a0261();while(!![]){try{const _0x1e8aff=parseInt(_0x13d580(0x1a8))/0x1*(parseInt(_0x13d580(0x1a7))/0x2)+parseInt(_0x13d580(0x1ad))/0x3+parseInt(_0x13d580(0x1a6))/0x4+parseInt(_0x13d580(0x199))/0x5*(parseInt(_0x13d580(0x196))/0x6)+parseInt(_0x13d580(0x19d))/0x7*(-parseInt(_0x13d580(0x1ac))/0x8)+parseInt(_0x13d580(0x198))/0x9*(parseInt(_0x13d580(0x1af))/0xa)+parseInt(_0x13d580(0x1ab))/0xb*(-parseInt(_0x13d580(0x197))/0xc);if(_0x1e8aff===_0x3a133f)break;else _0x3f4775['push'](_0x3f4775['shift']());}catch(_0xa8dd4a){_0x3f4775['push'](_0x3f4775['shift']());}}}(a33_0x1296,0x34b0d));import{BaseCommand}from'./command.js';function a33_0x47a2(_0x1bed7d,_0x3ac78c){_0x1bed7d=_0x1bed7d-0x195;const _0x12963c=a33_0x1296();let _0x47a262=_0x12963c[_0x1bed7d];return _0x47a262;}import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import a33_0x17e6b3 from'chalk';function a33_0x1296(){const _0x39f3e1=['name','message','2257992lXqAFU','12xsWKBW','81hZJuWz','5FiRvfw','map','description','length','994lRFOxC','\x20\x20Global:\x20~/.config/tdx/tdx.json','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','List\x20all\x20available\x20profiles','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','error','dim','site','scope','284324gauaOb','28NAbwhn','15666tDEdrh','green','Error:\x20','3816406kMBAhl','10144XXIqoZ','184491yJSpAT','log','16210IYmXAL','config'];a33_0x1296=function(){return _0x39f3e1;};return a33_0x1296();}export class ProfilesCommand extends BaseCommand{['name']='profiles';[a33_0x193e4c(0x19b)]=a33_0x193e4c(0x1a0);async['execute'](_0x5a3080){const _0x103109=a33_0x193e4c,{options:_0x12f902}=_0x5a3080;try{const _0x22f9b7=listProfiles(),_0x39380b=getActiveProfile();if(_0x22f9b7[_0x103109(0x19c)]===0x0)return console[_0x103109(0x1ae)](_0x103109(0x1a1)),console[_0x103109(0x1ae)](_0x103109(0x19f)),console[_0x103109(0x1ae)](_0x103109(0x19e)),0x0;const _0x5cbf31=_0x22f9b7[_0x103109(0x19a)](_0x43a9be=>{const _0x1372d1=_0x103109,_0x327f26=_0x43a9be[_0x1372d1(0x1b1)]===_0x39380b,_0x56f407=getProfileParams(_0x43a9be[_0x1372d1(0x1b0)]);return{'name':_0x43a9be[_0x1372d1(0x1b1)],'active':_0x327f26,'scope':_0x43a9be[_0x1372d1(0x1a5)],'description':_0x43a9be[_0x1372d1(0x1b0)][_0x1372d1(0x19b)]||'','params':_0x56f407};});if(isStructuredFormat(_0x12f902))await handleSDKOutput(_0x5cbf31,_0x12f902);else for(const _0x23151f of _0x22f9b7){const _0x5d3d2a=_0x23151f[_0x103109(0x1b1)]===_0x39380b?a33_0x17e6b3[_0x103109(0x1a9)]('\x20✓'):'',_0x78b355=_0x23151f[_0x103109(0x1b0)][_0x103109(0x1a4)]?a33_0x17e6b3[_0x103109(0x1a3)]('\x20'+_0x23151f[_0x103109(0x1b0)][_0x103109(0x1a4)]):'',_0x58e8a0=_0x23151f[_0x103109(0x1b0)][_0x103109(0x19b)]?a33_0x17e6b3['dim']('\x20\x20'+_0x23151f[_0x103109(0x1b0)]['description']):'';console[_0x103109(0x1ae)]('👤\x20'+_0x23151f[_0x103109(0x1b1)]+_0x5d3d2a+_0x78b355+_0x58e8a0);}return 0x0;}catch(_0x1dbd60){return _0x1dbd60 instanceof Error&&console[_0x103109(0x1a2)](_0x103109(0x1aa)+_0x1dbd60[_0x103109(0x195)]),0x1;}}}
1
+ const a33_0x5ed509=a33_0x1949;(function(_0x38ab17,_0xe9fdd7){const _0x1d858f=a33_0x1949,_0x4a4283=_0x38ab17();while(!![]){try{const _0x111c92=parseInt(_0x1d858f(0x1cb))/0x1+parseInt(_0x1d858f(0x1dc))/0x2+-parseInt(_0x1d858f(0x1d3))/0x3*(parseInt(_0x1d858f(0x1cd))/0x4)+-parseInt(_0x1d858f(0x1e3))/0x5*(-parseInt(_0x1d858f(0x1d1))/0x6)+-parseInt(_0x1d858f(0x1ce))/0x7*(-parseInt(_0x1d858f(0x1da))/0x8)+-parseInt(_0x1d858f(0x1cc))/0x9+-parseInt(_0x1d858f(0x1d2))/0xa;if(_0x111c92===_0xe9fdd7)break;else _0x4a4283['push'](_0x4a4283['shift']());}catch(_0x56f4ec){_0x4a4283['push'](_0x4a4283['shift']());}}}(a33_0x4556,0xbaec1));function a33_0x4556(){const _0x1ae7cb=['250odGnvp','green','error','scope','dim','971744rfzoEP','4017402AelDbO','60idxwXW','3942771lSVXtc','No\x20profiles\x20found.\x20Define\x20profiles\x20in\x20tdx.json:\x0a','name','35016fNgduW','1741800VxiAjm','152652LAsXtB','log','profiles','execute','map','\x20\x20Local:\x20\x20(project\x20folder)/tdx.json','Error:\x20','8mpvaWY','config','645308NifBhh','length','site','description','\x20\x20Global:\x20~/.config/tdx/tdx.json','message','👤\x20'];a33_0x4556=function(){return _0x1ae7cb;};return a33_0x4556();}import{BaseCommand}from'./command.js';import{listProfiles,getActiveProfile,getProfileParams}from'../core/profile.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';function a33_0x1949(_0x48f268,_0x14eb7f){_0x48f268=_0x48f268-0x1c7;const _0x4556d4=a33_0x4556();let _0x194920=_0x4556d4[_0x48f268];return _0x194920;}import a33_0x48fdb6 from'chalk';export class ProfilesCommand extends BaseCommand{[a33_0x5ed509(0x1d0)]=a33_0x5ed509(0x1d5);[a33_0x5ed509(0x1df)]='List\x20all\x20available\x20profiles';async[a33_0x5ed509(0x1d6)](_0x3908e0){const _0x3d887b=a33_0x5ed509,{options:_0x549da5}=_0x3908e0;try{const _0x4cb3c8=listProfiles(),_0x3e7277=getActiveProfile();if(_0x4cb3c8[_0x3d887b(0x1dd)]===0x0)return console['log'](_0x3d887b(0x1cf)),console[_0x3d887b(0x1d4)](_0x3d887b(0x1d8)),console[_0x3d887b(0x1d4)](_0x3d887b(0x1e0)),0x0;const _0x5e7534=_0x4cb3c8[_0x3d887b(0x1d7)](_0x13a258=>{const _0x589f4c=_0x3d887b,_0x407f55=_0x13a258[_0x589f4c(0x1d0)]===_0x3e7277,_0x1c5fbf=getProfileParams(_0x13a258[_0x589f4c(0x1db)]);return{'name':_0x13a258[_0x589f4c(0x1d0)],'active':_0x407f55,'scope':_0x13a258[_0x589f4c(0x1c9)],'description':_0x13a258[_0x589f4c(0x1db)][_0x589f4c(0x1df)]||'','params':_0x1c5fbf};});if(isStructuredFormat(_0x549da5))await handleSDKOutput(_0x5e7534,_0x549da5);else for(const _0x45d1b1 of _0x4cb3c8){const _0x46ca8b=_0x45d1b1[_0x3d887b(0x1d0)]===_0x3e7277?a33_0x48fdb6[_0x3d887b(0x1c7)]('\x20✓'):'',_0x716b49=_0x45d1b1[_0x3d887b(0x1db)][_0x3d887b(0x1de)]?a33_0x48fdb6[_0x3d887b(0x1ca)]('\x20'+_0x45d1b1['config'][_0x3d887b(0x1de)]):'',_0x5ea850=_0x45d1b1[_0x3d887b(0x1db)][_0x3d887b(0x1df)]?a33_0x48fdb6['dim']('\x20\x20'+_0x45d1b1['config'][_0x3d887b(0x1df)]):'';console[_0x3d887b(0x1d4)](_0x3d887b(0x1e2)+_0x45d1b1[_0x3d887b(0x1d0)]+_0x46ca8b+_0x716b49+_0x5ea850);}return 0x0;}catch(_0x296039){return _0x296039 instanceof Error&&console[_0x3d887b(0x1c8)](_0x3d887b(0x1d9)+_0x296039[_0x3d887b(0x1e1)]),0x1;}}}